diff --git a/_includes/topnav.html b/_includes/topnav.html index 102efa1..b897ad7 100755 --- a/_includes/topnav.html +++ b/_includes/topnav.html @@ -16,6 +16,7 @@
  • Downloads
  • About
  • The Team
  • +
  • Jsartoolkit5
  • Forum
  • Docs
  • diff --git a/jsartoolkit5/build/artoolkit.debug.js b/jsartoolkit5/build/artoolkit.debug.js new file mode 100644 index 0000000..c893dae --- /dev/null +++ b/jsartoolkit5/build/artoolkit.debug.js @@ -0,0 +1,111996 @@ +// Copyright 2010 The Emscripten Authors. All rights reserved. +// Emscripten is available under two separate licenses, the MIT license and the +// University of Illinois/NCSA Open Source License. Both these licenses can be +// found in the LICENSE file. + +// The Module object: Our interface to the outside world. We import +// and export values on it. There are various ways Module can be used: +// 1. Not defined. We create it here +// 2. A function parameter, function(Module) { ..generated code.. } +// 3. pre-run appended it, var Module = {}; ..generated code.. +// 4. External script tag defines var Module. +// We need to check if Module already exists (e.g. case 3 above). +// Substitution will be replaced with actual code on later stage of the build, +// this way Closure Compiler will not mangle it (e.g. case 4. above). +// Note that if you want to run closure, and also to use Module +// after the generated code, you will need to define var Module = {}; +// before the code. Then that object will be used in the code, and you +// can continue to use Module afterwards as well. +var Module = typeof Module !== 'undefined' ? Module : {}; + +// --pre-jses are emitted after the Module integration code, so that they can +// refer to Module (if they choose; they can also define Module) +// {{PRE_JSES}} + +// Sometimes an existing Module object exists with properties +// meant to overwrite the default module functionality. Here +// we collect those properties and reapply _after_ we configure +// the current environment's defaults to avoid having to be so +// defensive during initialization. +var moduleOverrides = {}; +var key; +for (key in Module) { + if (Module.hasOwnProperty(key)) { + moduleOverrides[key] = Module[key]; + } +} + +var arguments_ = []; +var thisProgram = './this.program'; +var quit_ = function(status, toThrow) { + throw toThrow; +}; + +// Determine the runtime environment we are in. You can customize this by +// setting the ENVIRONMENT setting at compile time (see settings.js). + +var ENVIRONMENT_IS_WEB = false; +var ENVIRONMENT_IS_WORKER = false; +var ENVIRONMENT_IS_NODE = false; +var ENVIRONMENT_HAS_NODE = false; +var ENVIRONMENT_IS_SHELL = false; +ENVIRONMENT_IS_WEB = typeof window === 'object'; +ENVIRONMENT_IS_WORKER = typeof importScripts === 'function'; +// A web environment like Electron.js can have Node enabled, so we must +// distinguish between Node-enabled environments and Node environments per se. +// This will allow the former to do things like mount NODEFS. +// Extended check using process.versions fixes issue #8816. +// (Also makes redundant the original check that 'require' is a function.) +ENVIRONMENT_HAS_NODE = typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string'; +ENVIRONMENT_IS_NODE = ENVIRONMENT_HAS_NODE && !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_WORKER; +ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; + +if (Module['ENVIRONMENT']) { + throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)'); +} + + + +// `/` should be present at the end if `scriptDirectory` is not empty +var scriptDirectory = ''; +function locateFile(path) { + if (Module['locateFile']) { + return Module['locateFile'](path, scriptDirectory); + } + return scriptDirectory + path; +} + +// Hooks that are implemented differently in different runtime environments. +var read_, + readAsync, + readBinary, + setWindowTitle; + +var nodeFS; +var nodePath; + +if (ENVIRONMENT_IS_NODE) { + scriptDirectory = __dirname + '/'; + + + read_ = function shell_read(filename, binary) { + var ret = tryParseAsDataURI(filename); + if (ret) { + return binary ? ret : ret.toString(); + } + if (!nodeFS) nodeFS = require('fs'); + if (!nodePath) nodePath = require('path'); + filename = nodePath['normalize'](filename); + return nodeFS['readFileSync'](filename, binary ? null : 'utf8'); + }; + + readBinary = function readBinary(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret); + } + assert(ret.buffer); + return ret; + }; + + + + + if (process['argv'].length > 1) { + thisProgram = process['argv'][1].replace(/\\/g, '/'); + } + + arguments_ = process['argv'].slice(2); + + if (typeof module !== 'undefined') { + module['exports'] = Module; + } + + process['on']('uncaughtException', function(ex) { + // suppress ExitStatus exceptions from showing an error + if (!(ex instanceof ExitStatus)) { + throw ex; + } + }); + + process['on']('unhandledRejection', abort); + + quit_ = function(status) { + process['exit'](status); + }; + + Module['inspect'] = function () { return '[Emscripten Module object]'; }; + + +} else +if (ENVIRONMENT_IS_SHELL) { + + + if (typeof read != 'undefined') { + read_ = function shell_read(f) { + var data = tryParseAsDataURI(f); + if (data) { + return intArrayToString(data); + } + return read(f); + }; + } + + readBinary = function readBinary(f) { + var data; + data = tryParseAsDataURI(f); + if (data) { + return data; + } + if (typeof readbuffer === 'function') { + return new Uint8Array(readbuffer(f)); + } + data = read(f, 'binary'); + assert(typeof data === 'object'); + return data; + }; + + if (typeof scriptArgs != 'undefined') { + arguments_ = scriptArgs; + } else if (typeof arguments != 'undefined') { + arguments_ = arguments; + } + + if (typeof quit === 'function') { + quit_ = function(status) { + quit(status); + }; + } + + if (typeof print !== 'undefined') { + // Prefer to use print/printErr where they exist, as they usually work better. + if (typeof console === 'undefined') console = {}; + console.log = print; + console.warn = console.error = typeof printErr !== 'undefined' ? printErr : print; + } +} else + +// Note that this includes Node.js workers when relevant (pthreads is enabled). +// Node.js workers are detected as a combination of ENVIRONMENT_IS_WORKER and +// ENVIRONMENT_HAS_NODE. +if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { + if (ENVIRONMENT_IS_WORKER) { // Check worker, not web, since window could be polyfilled + scriptDirectory = self.location.href; + } else if (document.currentScript) { // web + scriptDirectory = document.currentScript.src; + } + // blob urls look like blob:http://site.com/etc/etc and we cannot infer anything from them. + // otherwise, slice off the final part of the url to find the script directory. + // if scriptDirectory does not contain a slash, lastIndexOf will return -1, + // and scriptDirectory will correctly be replaced with an empty string. + if (scriptDirectory.indexOf('blob:') !== 0) { + scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf('/')+1); + } else { + scriptDirectory = ''; + } + + + // Differentiate the Web Worker from the Node Worker case, as reading must + // be done differently. + { + + + read_ = function shell_read(url) { + try { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.send(null); + return xhr.responseText; + } catch (err) { + var data = tryParseAsDataURI(url); + if (data) { + return intArrayToString(data); + } + throw err; + } + }; + + if (ENVIRONMENT_IS_WORKER) { + readBinary = function readBinary(url) { + try { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.responseType = 'arraybuffer'; + xhr.send(null); + return new Uint8Array(xhr.response); + } catch (err) { + var data = tryParseAsDataURI(url); + if (data) { + return data; + } + throw err; + } + }; + } + + readAsync = function readAsync(url, onload, onerror) { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.responseType = 'arraybuffer'; + xhr.onload = function xhr_onload() { + if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0 + onload(xhr.response); + return; + } + var data = tryParseAsDataURI(url); + if (data) { + onload(data.buffer); + return; + } + onerror(); + }; + xhr.onerror = onerror; + xhr.send(null); + }; + + + + + } + + setWindowTitle = function(title) { document.title = title }; +} else +{ + throw new Error('environment detection error'); +} + + +// Set up the out() and err() hooks, which are how we can print to stdout or +// stderr, respectively. +var out = Module['print'] || console.log.bind(console); +var err = Module['printErr'] || console.warn.bind(console); + +// Merge back in the overrides +for (key in moduleOverrides) { + if (moduleOverrides.hasOwnProperty(key)) { + Module[key] = moduleOverrides[key]; + } +} +// Free the object hierarchy contained in the overrides, this lets the GC +// reclaim data used e.g. in memoryInitializerRequest, which is a large typed array. +moduleOverrides = null; + +// Emit code to handle expected values on the Module object. This applies Module.x +// to the proper local x. This has two benefits: first, we only emit it if it is +// expected to arrive, and second, by using a local everywhere else that can be +// minified. +if (Module['arguments']) arguments_ = Module['arguments'];if (!Object.getOwnPropertyDescriptor(Module, 'arguments')) Object.defineProperty(Module, 'arguments', { configurable: true, get: function() { abort('Module.arguments has been replaced with plain arguments_') } }); +if (Module['thisProgram']) thisProgram = Module['thisProgram'];if (!Object.getOwnPropertyDescriptor(Module, 'thisProgram')) Object.defineProperty(Module, 'thisProgram', { configurable: true, get: function() { abort('Module.thisProgram has been replaced with plain thisProgram') } }); +if (Module['quit']) quit_ = Module['quit'];if (!Object.getOwnPropertyDescriptor(Module, 'quit')) Object.defineProperty(Module, 'quit', { configurable: true, get: function() { abort('Module.quit has been replaced with plain quit_') } }); + +// perform assertions in shell.js after we set up out() and err(), as otherwise if an assertion fails it cannot print the message +// Assertions on removed incoming Module JS APIs. +assert(typeof Module['memoryInitializerPrefixURL'] === 'undefined', 'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'); +assert(typeof Module['pthreadMainPrefixURL'] === 'undefined', 'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'); +assert(typeof Module['cdInitializerPrefixURL'] === 'undefined', 'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'); +assert(typeof Module['filePackagePrefixURL'] === 'undefined', 'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'); +assert(typeof Module['read'] === 'undefined', 'Module.read option was removed (modify read_ in JS)'); +assert(typeof Module['readAsync'] === 'undefined', 'Module.readAsync option was removed (modify readAsync in JS)'); +assert(typeof Module['readBinary'] === 'undefined', 'Module.readBinary option was removed (modify readBinary in JS)'); +assert(typeof Module['setWindowTitle'] === 'undefined', 'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'); +if (!Object.getOwnPropertyDescriptor(Module, 'read')) Object.defineProperty(Module, 'read', { configurable: true, get: function() { abort('Module.read has been replaced with plain read_') } }); +if (!Object.getOwnPropertyDescriptor(Module, 'readAsync')) Object.defineProperty(Module, 'readAsync', { configurable: true, get: function() { abort('Module.readAsync has been replaced with plain readAsync') } }); +if (!Object.getOwnPropertyDescriptor(Module, 'readBinary')) Object.defineProperty(Module, 'readBinary', { configurable: true, get: function() { abort('Module.readBinary has been replaced with plain readBinary') } }); +// TODO: add when SDL2 is fixed if (!Object.getOwnPropertyDescriptor(Module, 'setWindowTitle')) Object.defineProperty(Module, 'setWindowTitle', { configurable: true, get: function() { abort('Module.setWindowTitle has been replaced with plain setWindowTitle') } }); +var IDBFS = 'IDBFS is no longer included by default; build with -lidbfs.js'; +var PROXYFS = 'PROXYFS is no longer included by default; build with -lproxyfs.js'; +var WORKERFS = 'WORKERFS is no longer included by default; build with -lworkerfs.js'; +var NODEFS = 'NODEFS is no longer included by default; build with -lnodefs.js'; + + +// TODO remove when SDL2 is fixed (also see above) + + + +// Copyright 2017 The Emscripten Authors. All rights reserved. +// Emscripten is available under two separate licenses, the MIT license and the +// University of Illinois/NCSA Open Source License. Both these licenses can be +// found in the LICENSE file. + +// {{PREAMBLE_ADDITIONS}} + +var STACK_ALIGN = 16; + +// stack management, and other functionality that is provided by the compiled code, +// should not be used before it is ready +stackSave = stackRestore = stackAlloc = function() { + abort('cannot use the stack before compiled code is ready to run, and has provided stack access'); +}; + +function staticAlloc(size) { + abort('staticAlloc is no longer available at runtime; instead, perform static allocations at compile time (using makeStaticAlloc)'); +} + +function dynamicAlloc(size) { + assert(DYNAMICTOP_PTR); + var ret = HEAP32[DYNAMICTOP_PTR>>2]; + var end = (ret + size + 15) & -16; + if (end > _emscripten_get_heap_size()) { + abort('failure to dynamicAlloc - memory growth etc. is not supported there, call malloc/sbrk directly'); + } + HEAP32[DYNAMICTOP_PTR>>2] = end; + return ret; +} + +function alignMemory(size, factor) { + if (!factor) factor = STACK_ALIGN; // stack alignment (16-byte) by default + return Math.ceil(size / factor) * factor; +} + +function getNativeTypeSize(type) { + switch (type) { + case 'i1': case 'i8': return 1; + case 'i16': return 2; + case 'i32': return 4; + case 'i64': return 8; + case 'float': return 4; + case 'double': return 8; + default: { + if (type[type.length-1] === '*') { + return 4; // A pointer + } else if (type[0] === 'i') { + var bits = parseInt(type.substr(1)); + assert(bits % 8 === 0, 'getNativeTypeSize invalid bits ' + bits + ', type ' + type); + return bits / 8; + } else { + return 0; + } + } + } +} + +function warnOnce(text) { + if (!warnOnce.shown) warnOnce.shown = {}; + if (!warnOnce.shown[text]) { + warnOnce.shown[text] = 1; + err(text); + } +} + +var asm2wasmImports = { // special asm2wasm imports + "f64-rem": function(x, y) { + return x % y; + }, + "debugger": function() { + debugger; + } +}; + + + +var jsCallStartIndex = 1; +var functionPointers = new Array(0); + + +// 'sig' parameter is required for the llvm backend but only when func is not +// already a WebAssembly function. +function addFunction(func, sig) { + assert(typeof func !== 'undefined'); + + + var base = 0; + for (var i = base; i < base + 0; i++) { + if (!functionPointers[i]) { + functionPointers[i] = func; + return jsCallStartIndex + i; + } + } + throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.'; + +} + +function removeFunction(index) { + + functionPointers[index-jsCallStartIndex] = null; +} + +var funcWrappers = {}; + +function getFuncWrapper(func, sig) { + if (!func) return; // on null pointer, return undefined + assert(sig); + if (!funcWrappers[sig]) { + funcWrappers[sig] = {}; + } + var sigCache = funcWrappers[sig]; + if (!sigCache[func]) { + // optimize away arguments usage in common cases + if (sig.length === 1) { + sigCache[func] = function dynCall_wrapper() { + return dynCall(sig, func); + }; + } else if (sig.length === 2) { + sigCache[func] = function dynCall_wrapper(arg) { + return dynCall(sig, func, [arg]); + }; + } else { + // general case + sigCache[func] = function dynCall_wrapper() { + return dynCall(sig, func, Array.prototype.slice.call(arguments)); + }; + } + } + return sigCache[func]; +} + + +function makeBigInt(low, high, unsigned) { + return unsigned ? ((+((low>>>0)))+((+((high>>>0)))*4294967296.0)) : ((+((low>>>0)))+((+((high|0)))*4294967296.0)); +} + +function dynCall(sig, ptr, args) { + if (args && args.length) { + assert(args.length == sig.length-1); + assert(('dynCall_' + sig) in Module, 'bad function pointer type - no table for sig \'' + sig + '\''); + return Module['dynCall_' + sig].apply(null, [ptr].concat(args)); + } else { + assert(sig.length == 1); + assert(('dynCall_' + sig) in Module, 'bad function pointer type - no table for sig \'' + sig + '\''); + return Module['dynCall_' + sig].call(null, ptr); + } +} + +var tempRet0 = 0; + +var setTempRet0 = function(value) { + tempRet0 = value; +}; + +var getTempRet0 = function() { + return tempRet0; +}; + +function getCompilerSetting(name) { + throw 'You must build with -s RETAIN_COMPILER_SETTINGS=1 for getCompilerSetting or emscripten_get_compiler_setting to work'; +} + +var Runtime = { + // helpful errors + getTempRet0: function() { abort('getTempRet0() is now a top-level function, after removing the Runtime object. Remove "Runtime."') }, + staticAlloc: function() { abort('staticAlloc() is now a top-level function, after removing the Runtime object. Remove "Runtime."') }, + stackAlloc: function() { abort('stackAlloc() is now a top-level function, after removing the Runtime object. Remove "Runtime."') }, +}; + +// The address globals begin at. Very low in memory, for code size and optimization opportunities. +// Above 0 is static memory, starting with globals. +// Then the stack. +// Then 'dynamic' memory for sbrk. +var GLOBAL_BASE = 8; + + + + +// === Preamble library stuff === + +// Documentation for the public APIs defined in this file must be updated in: +// site/source/docs/api_reference/preamble.js.rst +// A prebuilt local version of the documentation is available at: +// site/build/text/docs/api_reference/preamble.js.txt +// You can also build docs locally as HTML or other formats in site/ +// An online HTML version (which may be of a different version of Emscripten) +// is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html + + +var wasmBinary;if (Module['wasmBinary']) wasmBinary = Module['wasmBinary'];if (!Object.getOwnPropertyDescriptor(Module, 'wasmBinary')) Object.defineProperty(Module, 'wasmBinary', { configurable: true, get: function() { abort('Module.wasmBinary has been replaced with plain wasmBinary') } }); +var noExitRuntime;if (Module['noExitRuntime']) noExitRuntime = Module['noExitRuntime'];if (!Object.getOwnPropertyDescriptor(Module, 'noExitRuntime')) Object.defineProperty(Module, 'noExitRuntime', { configurable: true, get: function() { abort('Module.noExitRuntime has been replaced with plain noExitRuntime') } }); + + + + +// In MINIMAL_RUNTIME, setValue() and getValue() are only available when building with safe heap enabled, for heap safety checking. +// In traditional runtime, setValue() and getValue() are always available (although their use is highly discouraged due to perf penalties) + +/** @type {function(number, number, string, boolean=)} */ +function setValue(ptr, value, type, noSafe) { + type = type || 'i8'; + if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit + switch(type) { + case 'i1': HEAP8[((ptr)>>0)]=value; break; + case 'i8': HEAP8[((ptr)>>0)]=value; break; + case 'i16': HEAP16[((ptr)>>1)]=value; break; + case 'i32': HEAP32[((ptr)>>2)]=value; break; + 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; + case 'float': HEAPF32[((ptr)>>2)]=value; break; + case 'double': HEAPF64[((ptr)>>3)]=value; break; + default: abort('invalid type for setValue: ' + type); + } +} + +/** @type {function(number, string, boolean=)} */ +function getValue(ptr, type, noSafe) { + type = type || 'i8'; + if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit + switch(type) { + case 'i1': return HEAP8[((ptr)>>0)]; + case 'i8': return HEAP8[((ptr)>>0)]; + case 'i16': return HEAP16[((ptr)>>1)]; + case 'i32': return HEAP32[((ptr)>>2)]; + case 'i64': return HEAP32[((ptr)>>2)]; + case 'float': return HEAPF32[((ptr)>>2)]; + case 'double': return HEAPF64[((ptr)>>3)]; + default: abort('invalid type for getValue: ' + type); + } + return null; +} + + + + + +// Wasm globals + +var wasmMemory; + +// In fastcomp asm.js, we don't need a wasm Table at all. +// In the wasm backend, we polyfill the WebAssembly object, +// so this creates a (non-native-wasm) table for us. + + +//======================================== +// Runtime essentials +//======================================== + +// whether we are quitting the application. no code should run after this. +// set in exit() and abort() +var ABORT = false; + +// set by exit() and abort(). Passed to 'onExit' handler. +// NOTE: This is also used as the process return code code in shell environments +// but only when noExitRuntime is false. +var EXITSTATUS = 0; + +/** @type {function(*, string=)} */ +function assert(condition, text) { + if (!condition) { + abort('Assertion failed: ' + text); + } +} + +// Returns the C function with a specified identifier (for C++, you need to do manual name mangling) +function getCFunc(ident) { + var func = Module['_' + ident]; // closure exported function + assert(func, 'Cannot call unknown function ' + ident + ', make sure it is exported'); + return func; +} + +// C calling interface. +function ccall(ident, returnType, argTypes, args, opts) { + // For fast lookup of conversion functions + var toC = { + 'string': function(str) { + var ret = 0; + if (str !== null && str !== undefined && str !== 0) { // null string + // at most 4 bytes per UTF-8 code point, +1 for the trailing '\0' + var len = (str.length << 2) + 1; + ret = stackAlloc(len); + stringToUTF8(str, ret, len); + } + return ret; + }, + 'array': function(arr) { + var ret = stackAlloc(arr.length); + writeArrayToMemory(arr, ret); + return ret; + } + }; + + function convertReturnValue(ret) { + if (returnType === 'string') return UTF8ToString(ret); + if (returnType === 'boolean') return Boolean(ret); + return ret; + } + + var func = getCFunc(ident); + var cArgs = []; + var stack = 0; + assert(returnType !== 'array', 'Return type should not be "array".'); + if (args) { + for (var i = 0; i < args.length; i++) { + var converter = toC[argTypes[i]]; + if (converter) { + if (stack === 0) stack = stackSave(); + cArgs[i] = converter(args[i]); + } else { + cArgs[i] = args[i]; + } + } + } + var ret = func.apply(null, cArgs); + + ret = convertReturnValue(ret); + if (stack !== 0) stackRestore(stack); + return ret; +} + +function cwrap(ident, returnType, argTypes, opts) { + return function() { + return ccall(ident, returnType, argTypes, arguments, opts); + } +} + +var ALLOC_NORMAL = 0; // Tries to use _malloc() +var ALLOC_STACK = 1; // Lives for the duration of the current function call +var ALLOC_DYNAMIC = 2; // Cannot be freed except through sbrk +var ALLOC_NONE = 3; // Do not allocate + +// allocate(): This is for internal use. You can use it yourself as well, but the interface +// is a little tricky (see docs right below). The reason is that it is optimized +// for multiple syntaxes to save space in generated code. So you should +// normally not use allocate(), and instead allocate memory using _malloc(), +// initialize it with setValue(), and so forth. +// @slab: An array of data, or a number. If a number, then the size of the block to allocate, +// in *bytes* (note that this is sometimes confusing: the next parameter does not +// affect this!) +// @types: Either an array of types, one for each byte (or 0 if no type at that position), +// or a single type which is used for the entire block. This only matters if there +// is initial data - if @slab is a number, then this does not matter at all and is +// ignored. +// @allocator: How to allocate memory, see ALLOC_* +/** @type {function((TypedArray|Array|number), string, number, number=)} */ +function allocate(slab, types, allocator, ptr) { + var zeroinit, size; + if (typeof slab === 'number') { + zeroinit = true; + size = slab; + } else { + zeroinit = false; + size = slab.length; + } + + var singleType = typeof types === 'string' ? types : null; + + var ret; + if (allocator == ALLOC_NONE) { + ret = ptr; + } else { + ret = [_malloc, + stackAlloc, + dynamicAlloc][allocator](Math.max(size, singleType ? 1 : types.length)); + } + + if (zeroinit) { + var stop; + ptr = ret; + assert((ret & 3) == 0); + stop = ret + (size & ~3); + for (; ptr < stop; ptr += 4) { + HEAP32[((ptr)>>2)]=0; + } + stop = ret + size; + while (ptr < stop) { + HEAP8[((ptr++)>>0)]=0; + } + return ret; + } + + if (singleType === 'i8') { + if (slab.subarray || slab.slice) { + HEAPU8.set(/** @type {!Uint8Array} */ (slab), ret); + } else { + HEAPU8.set(new Uint8Array(slab), ret); + } + return ret; + } + + var i = 0, type, typeSize, previousType; + while (i < size) { + var curr = slab[i]; + + type = singleType || types[i]; + if (type === 0) { + i++; + continue; + } + assert(type, 'Must know what type to store in allocate!'); + + if (type == 'i64') type = 'i32'; // special case: we have one i32 here, and one i32 later + + setValue(ret+i, curr, type); + + // no need to look up size unless type changes, so cache it + if (previousType !== type) { + typeSize = getNativeTypeSize(type); + previousType = type; + } + i += typeSize; + } + + return ret; +} + +// Allocate memory during any stage of startup - static memory early on, dynamic memory later, malloc when ready +function getMemory(size) { + if (!runtimeInitialized) return dynamicAlloc(size); + return _malloc(size); +} + + + + +/** @type {function(number, number=)} */ +function Pointer_stringify(ptr, length) { + abort("this function has been removed - you should use UTF8ToString(ptr, maxBytesToRead) instead!"); +} + +// Given a pointer 'ptr' to a null-terminated ASCII-encoded string in the emscripten HEAP, returns +// a copy of that string as a Javascript String object. + +function AsciiToString(ptr) { + var str = ''; + while (1) { + var ch = HEAPU8[((ptr++)>>0)]; + if (!ch) return str; + str += String.fromCharCode(ch); + } +} + +// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr', +// null-terminated and encoded in ASCII form. The copy will require at most str.length+1 bytes of space in the HEAP. + +function stringToAscii(str, outPtr) { + return writeAsciiToMemory(str, outPtr, false); +} + + +// Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the given array that contains uint8 values, returns +// a copy of that string as a Javascript String object. + +var UTF8Decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf8') : undefined; + +/** + * @param {number} idx + * @param {number=} maxBytesToRead + * @return {string} + */ +function UTF8ArrayToString(u8Array, idx, maxBytesToRead) { + var endIdx = idx + maxBytesToRead; + var endPtr = idx; + // TextDecoder needs to know the byte length in advance, it doesn't stop on null terminator by itself. + // Also, use the length info to avoid running tiny strings through TextDecoder, since .subarray() allocates garbage. + // (As a tiny code save trick, compare endPtr against endIdx using a negation, so that undefined means Infinity) + while (u8Array[endPtr] && !(endPtr >= endIdx)) ++endPtr; + + if (endPtr - idx > 16 && u8Array.subarray && UTF8Decoder) { + return UTF8Decoder.decode(u8Array.subarray(idx, endPtr)); + } else { + var str = ''; + // If building with TextDecoder, we have already computed the string length above, so test loop end condition against that + while (idx < endPtr) { + // For UTF8 byte structure, see: + // http://en.wikipedia.org/wiki/UTF-8#Description + // https://www.ietf.org/rfc/rfc2279.txt + // https://tools.ietf.org/html/rfc3629 + var u0 = u8Array[idx++]; + if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; } + var u1 = u8Array[idx++] & 63; + if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; } + var u2 = u8Array[idx++] & 63; + if ((u0 & 0xF0) == 0xE0) { + u0 = ((u0 & 15) << 12) | (u1 << 6) | u2; + } else { + if ((u0 & 0xF8) != 0xF0) warnOnce('Invalid UTF-8 leading byte 0x' + u0.toString(16) + ' encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!'); + u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (u8Array[idx++] & 63); + } + + if (u0 < 0x10000) { + str += String.fromCharCode(u0); + } else { + var ch = u0 - 0x10000; + str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF)); + } + } + } + return str; +} + +// Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the emscripten HEAP, returns a +// copy of that string as a Javascript String object. +// maxBytesToRead: an optional length that specifies the maximum number of bytes to read. You can omit +// this parameter to scan the string until the first \0 byte. If maxBytesToRead is +// passed, and the string at [ptr, ptr+maxBytesToReadr[ contains a null byte in the +// middle, then the string will cut short at that byte index (i.e. maxBytesToRead will +// not produce a string of exact length [ptr, ptr+maxBytesToRead[) +// N.B. mixing frequent uses of UTF8ToString() with and without maxBytesToRead may +// throw JS JIT optimizations off, so it is worth to consider consistently using one +// style or the other. +/** + * @param {number} ptr + * @param {number=} maxBytesToRead + * @return {string} + */ +function UTF8ToString(ptr, maxBytesToRead) { + return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : ''; +} + +// Copies the given Javascript String object 'str' to the given byte array at address 'outIdx', +// encoded in UTF8 form and null-terminated. The copy will require at most str.length*4+1 bytes of space in the HEAP. +// Use the function lengthBytesUTF8 to compute the exact number of bytes (excluding null terminator) that this function will write. +// Parameters: +// str: the Javascript string to copy. +// outU8Array: the array to copy to. Each index in this array is assumed to be one 8-byte element. +// outIdx: The starting offset in the array to begin the copying. +// maxBytesToWrite: The maximum number of bytes this function can write to the array. +// This count should include the null terminator, +// i.e. if maxBytesToWrite=1, only the null terminator will be written and nothing else. +// maxBytesToWrite=0 does not write any bytes to the output, not even the null terminator. +// Returns the number of bytes written, EXCLUDING the null terminator. + +function stringToUTF8Array(str, outU8Array, outIdx, maxBytesToWrite) { + if (!(maxBytesToWrite > 0)) // Parameter maxBytesToWrite is not optional. Negative values, 0, null, undefined and false each don't write out any bytes. + return 0; + + var startIdx = outIdx; + var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator. + for (var i = 0; i < str.length; ++i) { + // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! So decode UTF16->UTF32->UTF8. + // See http://unicode.org/faq/utf_bom.html#utf16-3 + // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629 + var u = str.charCodeAt(i); // possibly a lead surrogate + if (u >= 0xD800 && u <= 0xDFFF) { + var u1 = str.charCodeAt(++i); + u = 0x10000 + ((u & 0x3FF) << 10) | (u1 & 0x3FF); + } + if (u <= 0x7F) { + if (outIdx >= endIdx) break; + outU8Array[outIdx++] = u; + } else if (u <= 0x7FF) { + if (outIdx + 1 >= endIdx) break; + outU8Array[outIdx++] = 0xC0 | (u >> 6); + outU8Array[outIdx++] = 0x80 | (u & 63); + } else if (u <= 0xFFFF) { + if (outIdx + 2 >= endIdx) break; + outU8Array[outIdx++] = 0xE0 | (u >> 12); + outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63); + outU8Array[outIdx++] = 0x80 | (u & 63); + } else { + if (outIdx + 3 >= endIdx) break; + if (u >= 0x200000) warnOnce('Invalid Unicode code point 0x' + u.toString(16) + ' encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).'); + outU8Array[outIdx++] = 0xF0 | (u >> 18); + outU8Array[outIdx++] = 0x80 | ((u >> 12) & 63); + outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63); + outU8Array[outIdx++] = 0x80 | (u & 63); + } + } + // Null-terminate the pointer to the buffer. + outU8Array[outIdx] = 0; + return outIdx - startIdx; +} + +// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr', +// null-terminated and encoded in UTF8 form. The copy will require at most str.length*4+1 bytes of space in the HEAP. +// Use the function lengthBytesUTF8 to compute the exact number of bytes (excluding null terminator) that this function will write. +// Returns the number of bytes written, EXCLUDING the null terminator. + +function stringToUTF8(str, outPtr, maxBytesToWrite) { + assert(typeof maxBytesToWrite == 'number', 'stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!'); + return stringToUTF8Array(str, HEAPU8,outPtr, maxBytesToWrite); +} + +// Returns the number of bytes the given Javascript string takes if encoded as a UTF8 byte array, EXCLUDING the null terminator byte. +function lengthBytesUTF8(str) { + var len = 0; + for (var i = 0; i < str.length; ++i) { + // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! So decode UTF16->UTF32->UTF8. + // See http://unicode.org/faq/utf_bom.html#utf16-3 + var u = str.charCodeAt(i); // possibly a lead surrogate + if (u >= 0xD800 && u <= 0xDFFF) u = 0x10000 + ((u & 0x3FF) << 10) | (str.charCodeAt(++i) & 0x3FF); + if (u <= 0x7F) ++len; + else if (u <= 0x7FF) len += 2; + else if (u <= 0xFFFF) len += 3; + else len += 4; + } + return len; +} + + +// Given a pointer 'ptr' to a null-terminated UTF16LE-encoded string in the emscripten HEAP, returns +// a copy of that string as a Javascript String object. + +var UTF16Decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-16le') : undefined; +function UTF16ToString(ptr) { + assert(ptr % 2 == 0, 'Pointer passed to UTF16ToString must be aligned to two bytes!'); + var endPtr = ptr; + // TextDecoder needs to know the byte length in advance, it doesn't stop on null terminator by itself. + // Also, use the length info to avoid running tiny strings through TextDecoder, since .subarray() allocates garbage. + var idx = endPtr >> 1; + while (HEAP16[idx]) ++idx; + endPtr = idx << 1; + + if (endPtr - ptr > 32 && UTF16Decoder) { + return UTF16Decoder.decode(HEAPU8.subarray(ptr, endPtr)); + } else { + var i = 0; + + var str = ''; + while (1) { + var codeUnit = HEAP16[(((ptr)+(i*2))>>1)]; + if (codeUnit == 0) return str; + ++i; + // fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through. + str += String.fromCharCode(codeUnit); + } + } +} + +// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr', +// null-terminated and encoded in UTF16 form. The copy will require at most str.length*4+2 bytes of space in the HEAP. +// Use the function lengthBytesUTF16() to compute the exact number of bytes (excluding null terminator) that this function will write. +// Parameters: +// str: the Javascript string to copy. +// outPtr: Byte address in Emscripten HEAP where to write the string to. +// maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null +// terminator, i.e. if maxBytesToWrite=2, only the null terminator will be written and nothing else. +// maxBytesToWrite<2 does not write any bytes to the output, not even the null terminator. +// Returns the number of bytes written, EXCLUDING the null terminator. + +function stringToUTF16(str, outPtr, maxBytesToWrite) { + assert(outPtr % 2 == 0, 'Pointer passed to stringToUTF16 must be aligned to two bytes!'); + assert(typeof maxBytesToWrite == 'number', 'stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!'); + // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed. + if (maxBytesToWrite === undefined) { + maxBytesToWrite = 0x7FFFFFFF; + } + if (maxBytesToWrite < 2) return 0; + maxBytesToWrite -= 2; // Null terminator. + var startPtr = outPtr; + var numCharsToWrite = (maxBytesToWrite < str.length*2) ? (maxBytesToWrite / 2) : str.length; + for (var i = 0; i < numCharsToWrite; ++i) { + // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP. + var codeUnit = str.charCodeAt(i); // possibly a lead surrogate + HEAP16[((outPtr)>>1)]=codeUnit; + outPtr += 2; + } + // Null-terminate the pointer to the HEAP. + HEAP16[((outPtr)>>1)]=0; + return outPtr - startPtr; +} + +// Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte. + +function lengthBytesUTF16(str) { + return str.length*2; +} + +function UTF32ToString(ptr) { + assert(ptr % 4 == 0, 'Pointer passed to UTF32ToString must be aligned to four bytes!'); + var i = 0; + + var str = ''; + while (1) { + var utf32 = HEAP32[(((ptr)+(i*4))>>2)]; + if (utf32 == 0) + return str; + ++i; + // 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. + // See http://unicode.org/faq/utf_bom.html#utf16-3 + if (utf32 >= 0x10000) { + var ch = utf32 - 0x10000; + str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF)); + } else { + str += String.fromCharCode(utf32); + } + } +} + +// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr', +// null-terminated and encoded in UTF32 form. The copy will require at most str.length*4+4 bytes of space in the HEAP. +// Use the function lengthBytesUTF32() to compute the exact number of bytes (excluding null terminator) that this function will write. +// Parameters: +// str: the Javascript string to copy. +// outPtr: Byte address in Emscripten HEAP where to write the string to. +// maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null +// terminator, i.e. if maxBytesToWrite=4, only the null terminator will be written and nothing else. +// maxBytesToWrite<4 does not write any bytes to the output, not even the null terminator. +// Returns the number of bytes written, EXCLUDING the null terminator. + +function stringToUTF32(str, outPtr, maxBytesToWrite) { + assert(outPtr % 4 == 0, 'Pointer passed to stringToUTF32 must be aligned to four bytes!'); + assert(typeof maxBytesToWrite == 'number', 'stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!'); + // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed. + if (maxBytesToWrite === undefined) { + maxBytesToWrite = 0x7FFFFFFF; + } + if (maxBytesToWrite < 4) return 0; + var startPtr = outPtr; + var endPtr = startPtr + maxBytesToWrite - 4; + for (var i = 0; i < str.length; ++i) { + // 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. + // See http://unicode.org/faq/utf_bom.html#utf16-3 + var codeUnit = str.charCodeAt(i); // possibly a lead surrogate + if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) { + var trailSurrogate = str.charCodeAt(++i); + codeUnit = 0x10000 + ((codeUnit & 0x3FF) << 10) | (trailSurrogate & 0x3FF); + } + HEAP32[((outPtr)>>2)]=codeUnit; + outPtr += 4; + if (outPtr + 4 > endPtr) break; + } + // Null-terminate the pointer to the HEAP. + HEAP32[((outPtr)>>2)]=0; + return outPtr - startPtr; +} + +// Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte. + +function lengthBytesUTF32(str) { + var len = 0; + for (var i = 0; i < str.length; ++i) { + // 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. + // See http://unicode.org/faq/utf_bom.html#utf16-3 + var codeUnit = str.charCodeAt(i); + if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) ++i; // possibly a lead surrogate, so skip over the tail surrogate. + len += 4; + } + + return len; +} + +// Allocate heap space for a JS string, and write it there. +// It is the responsibility of the caller to free() that memory. +function allocateUTF8(str) { + var size = lengthBytesUTF8(str) + 1; + var ret = _malloc(size); + if (ret) stringToUTF8Array(str, HEAP8, ret, size); + return ret; +} + +// Allocate stack space for a JS string, and write it there. +function allocateUTF8OnStack(str) { + var size = lengthBytesUTF8(str) + 1; + var ret = stackAlloc(size); + stringToUTF8Array(str, HEAP8, ret, size); + return ret; +} + +// Deprecated: This function should not be called because it is unsafe and does not provide +// a maximum length limit of how many bytes it is allowed to write. Prefer calling the +// function stringToUTF8Array() instead, which takes in a maximum length that can be used +// to be secure from out of bounds writes. +/** @deprecated */ +function writeStringToMemory(string, buffer, dontAddNull) { + warnOnce('writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!'); + + var /** @type {number} */ lastChar, /** @type {number} */ end; + if (dontAddNull) { + // stringToUTF8Array always appends null. If we don't want to do that, remember the + // character that existed at the location where the null will be placed, and restore + // that after the write (below). + end = buffer + lengthBytesUTF8(string); + lastChar = HEAP8[end]; + } + stringToUTF8(string, buffer, Infinity); + if (dontAddNull) HEAP8[end] = lastChar; // Restore the value under the null character. +} + +function writeArrayToMemory(array, buffer) { + assert(array.length >= 0, 'writeArrayToMemory array must have a length (should be an array or typed array)') + HEAP8.set(array, buffer); +} + +function writeAsciiToMemory(str, buffer, dontAddNull) { + for (var i = 0; i < str.length; ++i) { + assert(str.charCodeAt(i) === str.charCodeAt(i)&0xff); + HEAP8[((buffer++)>>0)]=str.charCodeAt(i); + } + // Null-terminate the pointer to the HEAP. + if (!dontAddNull) HEAP8[((buffer)>>0)]=0; +} + + + + +// Memory management + +var PAGE_SIZE = 16384; +var WASM_PAGE_SIZE = 65536; +var ASMJS_PAGE_SIZE = 16777216; + +function alignUp(x, multiple) { + if (x % multiple > 0) { + x += multiple - (x % multiple); + } + return x; +} + +var HEAP, +/** @type {ArrayBuffer} */ + buffer, +/** @type {Int8Array} */ + HEAP8, +/** @type {Uint8Array} */ + HEAPU8, +/** @type {Int16Array} */ + HEAP16, +/** @type {Uint16Array} */ + HEAPU16, +/** @type {Int32Array} */ + HEAP32, +/** @type {Uint32Array} */ + HEAPU32, +/** @type {Float32Array} */ + HEAPF32, +/** @type {Float64Array} */ + HEAPF64; + +function updateGlobalBufferAndViews(buf) { + buffer = buf; + Module['HEAP8'] = HEAP8 = new Int8Array(buf); + Module['HEAP16'] = HEAP16 = new Int16Array(buf); + Module['HEAP32'] = HEAP32 = new Int32Array(buf); + Module['HEAPU8'] = HEAPU8 = new Uint8Array(buf); + Module['HEAPU16'] = HEAPU16 = new Uint16Array(buf); + Module['HEAPU32'] = HEAPU32 = new Uint32Array(buf); + Module['HEAPF32'] = HEAPF32 = new Float32Array(buf); + Module['HEAPF64'] = HEAPF64 = new Float64Array(buf); +} + +var STATIC_BASE = 8, + STACK_BASE = 67664, + STACKTOP = STACK_BASE, + STACK_MAX = 5310544, + DYNAMIC_BASE = 5310544, + DYNAMICTOP_PTR = 67472; + +assert(STACK_BASE % 16 === 0, 'stack must start aligned'); +assert(DYNAMIC_BASE % 16 === 0, 'heap must start aligned'); + + + +var TOTAL_STACK = 5242880; +if (Module['TOTAL_STACK']) assert(TOTAL_STACK === Module['TOTAL_STACK'], 'the stack size can no longer be determined at runtime') + +var INITIAL_TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 268435456;if (!Object.getOwnPropertyDescriptor(Module, 'TOTAL_MEMORY')) Object.defineProperty(Module, 'TOTAL_MEMORY', { configurable: true, get: function() { abort('Module.TOTAL_MEMORY has been replaced with plain INITIAL_TOTAL_MEMORY') } }); + +assert(INITIAL_TOTAL_MEMORY >= TOTAL_STACK, 'TOTAL_MEMORY should be larger than TOTAL_STACK, was ' + INITIAL_TOTAL_MEMORY + '! (TOTAL_STACK=' + TOTAL_STACK + ')'); + +// check for full engine support (use string 'subarray' to avoid closure compiler confusion) +assert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && Int32Array.prototype.subarray !== undefined && Int32Array.prototype.set !== undefined, + 'JS engine does not provide full typed array support'); + + + + + + +// In standalone mode, the wasm creates the memory, and the user can't provide it. +// In non-standalone/normal mode, we create the memory here. + +// Create the main memory. (Note: this isn't used in STANDALONE_WASM mode since the wasm +// memory is created in the wasm, not in JS.) + + if (Module['buffer']) { + buffer = Module['buffer']; + } + else { + buffer = new ArrayBuffer(INITIAL_TOTAL_MEMORY); + } + + +// If the user provides an incorrect length, just use that length instead rather than providing the user to +// specifically provide the memory length with Module['TOTAL_MEMORY']. +INITIAL_TOTAL_MEMORY = buffer.byteLength; +updateGlobalBufferAndViews(buffer); + +HEAP32[DYNAMICTOP_PTR>>2] = DYNAMIC_BASE; + + + + +// Initializes the stack cookie. Called at the startup of main and at the startup of each thread in pthreads mode. +function writeStackCookie() { + assert((STACK_MAX & 3) == 0); + HEAPU32[(STACK_MAX >> 2)-1] = 0x02135467; + HEAPU32[(STACK_MAX >> 2)-2] = 0x89BACDFE; + // Also test the global address 0 for integrity. + // We don't do this with ASan because ASan does its own checks for this. + HEAP32[0] = 0x63736d65; /* 'emsc' */ +} + +function checkStackCookie() { + var cookie1 = HEAPU32[(STACK_MAX >> 2)-1]; + var cookie2 = HEAPU32[(STACK_MAX >> 2)-2]; + if (cookie1 != 0x02135467 || cookie2 != 0x89BACDFE) { + abort('Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x' + cookie2.toString(16) + ' ' + cookie1.toString(16)); + } + // Also test the global address 0 for integrity. + // We don't do this with ASan because ASan does its own checks for this. + if (HEAP32[0] !== 0x63736d65 /* 'emsc' */) abort('Runtime error: The application has corrupted its heap memory area (address zero)!'); +} + +function abortStackOverflow(allocSize) { + abort('Stack overflow! Attempted to allocate ' + allocSize + ' bytes on the stack, but stack has only ' + (STACK_MAX - stackSave() + allocSize) + ' bytes available!'); +} + + + + +// Endianness check (note: assumes compiler arch was little-endian) +(function() { + var h16 = new Int16Array(1); + var h8 = new Int8Array(h16.buffer); + h16[0] = 0x6373; + if (h8[0] !== 0x73 || h8[1] !== 0x63) throw 'Runtime error: expected the system to be little-endian!'; +})(); + +function abortFnPtrError(ptr, sig) { + abort("Invalid function pointer " + ptr + " called with signature '" + sig + "'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this). Build with ASSERTIONS=2 for more info."); +} + + + +function callRuntimeCallbacks(callbacks) { + while(callbacks.length > 0) { + var callback = callbacks.shift(); + if (typeof callback == 'function') { + callback(); + continue; + } + var func = callback.func; + if (typeof func === 'number') { + if (callback.arg === undefined) { + Module['dynCall_v'](func); + } else { + Module['dynCall_vi'](func, callback.arg); + } + } else { + func(callback.arg === undefined ? null : callback.arg); + } + } +} + +var __ATPRERUN__ = []; // functions called before the runtime is initialized +var __ATINIT__ = []; // functions called during startup +var __ATMAIN__ = []; // functions called when main() is to be run +var __ATEXIT__ = []; // functions called during shutdown +var __ATPOSTRUN__ = []; // functions called after the main() is called + +var runtimeInitialized = false; +var runtimeExited = false; + + +function preRun() { + + if (Module['preRun']) { + if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']]; + while (Module['preRun'].length) { + addOnPreRun(Module['preRun'].shift()); + } + } + + callRuntimeCallbacks(__ATPRERUN__); +} + +function initRuntime() { + checkStackCookie(); + assert(!runtimeInitialized); + runtimeInitialized = true; + if (!Module["noFSInit"] && !FS.init.initialized) FS.init(); +TTY.init(); + callRuntimeCallbacks(__ATINIT__); +} + +function preMain() { + checkStackCookie(); + FS.ignorePermissions = false; + callRuntimeCallbacks(__ATMAIN__); +} + +function exitRuntime() { + checkStackCookie(); + runtimeExited = true; +} + +function postRun() { + checkStackCookie(); + + if (Module['postRun']) { + if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']]; + while (Module['postRun'].length) { + addOnPostRun(Module['postRun'].shift()); + } + } + + callRuntimeCallbacks(__ATPOSTRUN__); +} + +function addOnPreRun(cb) { + __ATPRERUN__.unshift(cb); +} + +function addOnInit(cb) { + __ATINIT__.unshift(cb); +} + +function addOnPreMain(cb) { + __ATMAIN__.unshift(cb); +} + +function addOnExit(cb) { +} + +function addOnPostRun(cb) { + __ATPOSTRUN__.unshift(cb); +} + +function unSign(value, bits, ignore) { + if (value >= 0) { + return value; + } + 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 + : Math.pow(2, bits) + value; +} +function reSign(value, bits, ignore) { + if (value <= 0) { + return value; + } + var half = bits <= 32 ? Math.abs(1 << (bits-1)) // abs is needed if bits == 32 + : Math.pow(2, bits-1); + 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 + // but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors + // TODO: In i64 mode 1, resign the two parts separately and safely + value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts + } + return value; +} + + +assert(Math.imul, 'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'); +assert(Math.fround, 'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'); +assert(Math.clz32, 'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'); +assert(Math.trunc, 'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'); + +var Math_abs = Math.abs; +var Math_cos = Math.cos; +var Math_sin = Math.sin; +var Math_tan = Math.tan; +var Math_acos = Math.acos; +var Math_asin = Math.asin; +var Math_atan = Math.atan; +var Math_atan2 = Math.atan2; +var Math_exp = Math.exp; +var Math_log = Math.log; +var Math_sqrt = Math.sqrt; +var Math_ceil = Math.ceil; +var Math_floor = Math.floor; +var Math_pow = Math.pow; +var Math_imul = Math.imul; +var Math_fround = Math.fround; +var Math_round = Math.round; +var Math_min = Math.min; +var Math_max = Math.max; +var Math_clz32 = Math.clz32; +var Math_trunc = Math.trunc; + + + +// A counter of dependencies for calling run(). If we need to +// do asynchronous work before running, increment this and +// decrement it. Incrementing must happen in a place like +// Module.preRun (used by emcc to add file preloading). +// Note that you can add dependencies in preRun, even though +// it happens right before run - run will be postponed until +// the dependencies are met. +var runDependencies = 0; +var runDependencyWatcher = null; +var dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled +var runDependencyTracking = {}; + +function getUniqueRunDependency(id) { + var orig = id; + while (1) { + if (!runDependencyTracking[id]) return id; + id = orig + Math.random(); + } + return id; +} + +function addRunDependency(id) { + runDependencies++; + + if (Module['monitorRunDependencies']) { + Module['monitorRunDependencies'](runDependencies); + } + + if (id) { + assert(!runDependencyTracking[id]); + runDependencyTracking[id] = 1; + if (runDependencyWatcher === null && typeof setInterval !== 'undefined') { + // Check for missing dependencies every few seconds + runDependencyWatcher = setInterval(function() { + if (ABORT) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + return; + } + var shown = false; + for (var dep in runDependencyTracking) { + if (!shown) { + shown = true; + err('still waiting on run dependencies:'); + } + err('dependency: ' + dep); + } + if (shown) { + err('(end of list)'); + } + }, 10000); + } + } else { + err('warning: run dependency added without ID'); + } +} + +function removeRunDependency(id) { + runDependencies--; + + if (Module['monitorRunDependencies']) { + Module['monitorRunDependencies'](runDependencies); + } + + if (id) { + assert(runDependencyTracking[id]); + delete runDependencyTracking[id]; + } else { + err('warning: run dependency removed without ID'); + } + if (runDependencies == 0) { + if (runDependencyWatcher !== null) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + } + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback(); // can add another dependenciesFulfilled + } + } +} + +Module["preloadedImages"] = {}; // maps url to image data +Module["preloadedAudios"] = {}; // maps url to audio data + + +function abort(what) { + if (Module['onAbort']) { + Module['onAbort'](what); + } + + what += ''; + out(what); + err(what); + + ABORT = true; + EXITSTATUS = 1; + + var output = 'abort(' + what + ') at ' + stackTrace(); + what = output; + + // Throw a wasm runtime error, because a JS error might be seen as a foreign + // exception, which means we'd run destructors on it. We need the error to + // simply make the program stop. + throw what; +} + + +var memoryInitializer = null; + + + + + + + +// Copyright 2017 The Emscripten Authors. All rights reserved. +// Emscripten is available under two separate licenses, the MIT license and the +// University of Illinois/NCSA Open Source License. Both these licenses can be +// found in the LICENSE file. + +// Prefix of data URIs emitted by SINGLE_FILE and related options. +var dataURIPrefix = 'data:application/octet-stream;base64,'; + +// Indicates whether filename is a base64 data URI. +function isDataURI(filename) { + return String.prototype.startsWith ? + filename.startsWith(dataURIPrefix) : + filename.indexOf(dataURIPrefix) === 0; +} + + + + + + +// Globals used by JS i64 conversions +var tempDouble; +var tempI64; + +// === Body === + +var ASM_CONSTS = [function($0, $1, $2, $3, $4, $5) { if (!artoolkit["frameMalloc"]) { artoolkit["frameMalloc"] = ({}); } var frameMalloc = artoolkit["frameMalloc"]; frameMalloc["framepointer"] = $1; frameMalloc["framesize"] = $2; frameMalloc["camera"] = $3; frameMalloc["transform"] = $4; frameMalloc["videoLumaPointer"] = $5; }, + function($0, $1, $2, $3) { if (!artoolkit["multiEachMarkerInfo"]) { artoolkit["multiEachMarkerInfo"] = ({}); } var multiEachMarker = artoolkit["multiEachMarkerInfo"]; multiEachMarker['visible'] = $0; multiEachMarker['pattId'] = $1; multiEachMarker['pattType'] = $2; multiEachMarker['width'] = $3; }, + function($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) { var $a = arguments; var i = 12; if (!artoolkit["markerInfo"]) { artoolkit["markerInfo"] = ({ pos: [0,0], line: [[0,0,0], [0,0,0], [0,0,0], [0,0,0]], vertex: [[0,0], [0,0], [0,0], [0,0]] }); } var markerInfo = artoolkit["markerInfo"]; markerInfo["area"] = $0; markerInfo["id"] = $1; markerInfo["idPatt"] = $2; markerInfo["idMatrix"] = $3; markerInfo["dir"] = $4; markerInfo["dirPatt"] = $5; markerInfo["dirMatrix"] = $6; markerInfo["cf"] = $7; markerInfo["cfPatt"] = $8; markerInfo["cfMatrix"] = $9; markerInfo["pos"][0] = $10; markerInfo["pos"][1] = $11; markerInfo["line"][0][0] = $a[i++]; markerInfo["line"][0][1] = $a[i++]; markerInfo["line"][0][2] = $a[i++]; markerInfo["line"][1][0] = $a[i++]; markerInfo["line"][1][1] = $a[i++]; markerInfo["line"][1][2] = $a[i++]; markerInfo["line"][2][0] = $a[i++]; markerInfo["line"][2][1] = $a[i++]; markerInfo["line"][2][2] = $a[i++]; markerInfo["line"][3][0] = $a[i++]; markerInfo["line"][3][1] = $a[i++]; markerInfo["line"][3][2] = $a[i++]; markerInfo["vertex"][0][0] = $a[i++]; markerInfo["vertex"][0][1] = $a[i++]; markerInfo["vertex"][1][0] = $a[i++]; markerInfo["vertex"][1][1] = $a[i++]; markerInfo["vertex"][2][0] = $a[i++]; markerInfo["vertex"][2][1] = $a[i++]; markerInfo["vertex"][3][0] = $a[i++]; markerInfo["vertex"][3][1] = $a[i++]; markerInfo["errorCorrected"] = $a[i++]; }, + function($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13) { var $a = arguments; var i = 0; if (!artoolkit["NFTMarkerInfo"]) { artoolkit["NFTMarkerInfo"] = ({ id: 0, error: -1, found: 0, pose: [0,0,0,0, 0,0,0,0, 0,0,0,0] }); } var markerInfo = artoolkit["NFTMarkerInfo"]; markerInfo["id"] = $a[i++]; markerInfo["error"] = $a[i++]; markerInfo["found"] = 1; markerInfo["pose"][0] = $a[i++]; markerInfo["pose"][1] = $a[i++]; markerInfo["pose"][2] = $a[i++]; markerInfo["pose"][3] = $a[i++]; markerInfo["pose"][4] = $a[i++]; markerInfo["pose"][5] = $a[i++]; markerInfo["pose"][6] = $a[i++]; markerInfo["pose"][7] = $a[i++]; markerInfo["pose"][8] = $a[i++]; markerInfo["pose"][9] = $a[i++]; markerInfo["pose"][10] = $a[i++]; markerInfo["pose"][11] = $a[i++]; }, + function($0) { var $a = arguments; var i = 0; if (!artoolkit["NFTMarkerInfo"]) { artoolkit["NFTMarkerInfo"] = ({ id: 0, error: -1, found: 0, pose: [0,0,0,0, 0,0,0,0, 0,0,0,0] }); } var markerInfo = artoolkit["NFTMarkerInfo"]; markerInfo["id"] = $a[i++]; markerInfo["error"] = -1; markerInfo["found"] = 0; markerInfo["pose"][0] = 0; markerInfo["pose"][1] = 0; markerInfo["pose"][2] = 0; markerInfo["pose"][3] = 0; markerInfo["pose"][4] = 0; markerInfo["pose"][5] = 0; markerInfo["pose"][6] = 0; markerInfo["pose"][7] = 0; markerInfo["pose"][8] = 0; markerInfo["pose"][9] = 0; markerInfo["pose"][10] = 0; markerInfo["pose"][11] = 0; }]; + +function _emscripten_asm_const_iiiiiii(code, a0, a1, a2, a3, a4, a5) { + return ASM_CONSTS[code](a0, a1, a2, a3, a4, a5); +} + +function _emscripten_asm_const_iiiid(code, a0, a1, a2, a3) { + return ASM_CONSTS[code](a0, a1, a2, a3); +} + +function _emscripten_asm_const_iiddddddddddddd(code, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) { + return ASM_CONSTS[code](a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); +} + +function _emscripten_asm_const_ii(code, a0) { + return ASM_CONSTS[code](a0); +} + +function _emscripten_asm_const_iiiiiiiidddddddddddddddddddddddddi(code, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32) { + return ASM_CONSTS[code](a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32); +} + + + + +// STATICTOP = STATIC_BASE + 67656; +/* global initializers */ __ATINIT__.push({ func: function() { __GLOBAL__I_000101() } }, { func: function() { __GLOBAL__sub_I_ARToolKitJS_cpp() } }, { func: function() { ___emscripten_environ_constructor() } }, { func: function() { __GLOBAL__sub_I_bind_cpp() } }, { func: function() { __GLOBAL__sub_I_iostream_cpp() } }); + + +memoryInitializer = "data:application/octet-stream;base64,AAAAAAAAAAByXQAAeV0AAIVdAACPXQAAnV0AAAAAAAAAAAAAAAAAAP//////////AAAAAAEAAAABAAAAAQAAAAAAAAD/////AAAAAAEAAAABAAAAAQAAAAAAAAD///////////////8AAAABAAEBAQACBP//BQMBAAL/Bgf/AwECAgMCAwIDAwD/BAYHBf8BBAUEBAUFBAUHBgYGBwcHBv8CBAYHBQP/AAEBAQEBAQABAQEAAAEBAQEBAAEBAAEBAQABAQEBAAEBAAEBAQEAAQEBAAEBAAEBAQEBAAABAQEAAQEBAQEBAAD//wP/BQb//wkK/wz//w//ERL/FP//Fxj//xv/HR7//wEC/wT//wcI//8L/w0O/xD//xP/FRb//xka/xz//x8BAAAAAgAAAAQAAAAIAAAAEAAAAAUAAAAKAAAAFAAAAA0AAAAaAAAAEQAAAAcAAAAOAAAAHAAAAB0AAAAfAAAAGwAAABMAAAADAAAABgAAAAwAAAAYAAAAFQAAAA8AAAAeAAAAGQAAABcAAAALAAAAFgAAAAkAAAASAAAAAAAAAAEAAAACAAAABAAAAAgAAAADAAAABgAAAAwAAAALAAAABQAAAAoAAAAHAAAADgAAAA8AAAANAAAACQAAAAAAAAD/////AAAAAAEAAAASAAAAAgAAAAUAAAATAAAACwAAAAMAAAAdAAAABgAAABsAAAAUAAAACAAAAAwAAAAXAAAABAAAAAoAAAAeAAAAEQAAAAcAAAAWAAAAHAAAABoAAAAVAAAAGQAAAAkAAAAQAAAADQAAAA4AAAAYAAAADwAAAP////8AAAAAAQAAAAQAAAACAAAACAAAAAUAAAAKAAAAAwAAAA4AAAAJAAAABwAAAAYAAAANAAAACwAAAAwAAAABAAAAAgAAAAQAAAAIAAAAEAAAACAAAABAAAAAAwAAAAYAAAAMAAAAGAAAADAAAABgAAAAQwAAAAUAAAAKAAAAFAAAACgAAABQAAAAIwAAAEYAAAAPAAAAHgAAADwAAAB4AAAAcwAAAGUAAABJAAAAEQAAACIAAABEAAAACwAAABYAAAAsAAAAWAAAADMAAABmAAAATwAAAB0AAAA6AAAAdAAAAGsAAABVAAAAKQAAAFIAAAAnAAAATgAAAB8AAAA+AAAAfAAAAHsAAAB1AAAAaQAAAFEAAAAhAAAAQgAAAAcAAAAOAAAAHAAAADgAAABwAAAAYwAAAEUAAAAJAAAAEgAAACQAAABIAAAAEwAAACYAAABMAAAAGwAAADYAAABsAAAAWwAAADUAAABqAAAAVwAAAC0AAABaAAAANwAAAG4AAABfAAAAPQAAAHoAAAB3AAAAbQAAAFkAAAAxAAAAYgAAAEcAAAANAAAAGgAAADQAAABoAAAAUwAAACUAAABKAAAAFwAAAC4AAABcAAAAOwAAAHYAAABvAAAAXQAAADkAAAByAAAAZwAAAE0AAAAZAAAAMgAAAGQAAABLAAAAFQAAACoAAABUAAAAKwAAAFYAAAAvAAAAXgAAAD8AAAB+AAAAfwAAAH0AAAB5AAAAcQAAAGEAAABBAAAAAAAAAP////8AAAAAAQAAAAcAAAACAAAADgAAAAgAAAA4AAAAAwAAAD8AAAAPAAAAHwAAAAkAAABaAAAAOQAAABUAAAAEAAAAHAAAAEAAAABDAAAAEAAAAHAAAAAgAAAAYQAAAAoAAABsAAAAWwAAAEYAAAA6AAAAJgAAABYAAAAvAAAABQAAADYAAAAdAAAAEwAAAEEAAABfAAAARAAAAC0AAAARAAAAKwAAAHEAAABzAAAAIQAAAE0AAABiAAAAdQAAAAsAAABXAAAAbQAAACMAAABcAAAASgAAAEcAAABPAAAAOwAAAGgAAAAnAAAAZAAAABcAAABSAAAAMAAAAHcAAAAGAAAAfgAAADcAAAANAAAAHgAAAD4AAAAUAAAAWQAAAEIAAAAbAAAAYAAAAG8AAABFAAAAawAAAC4AAAAlAAAAEgAAADUAAAAsAAAAXgAAAHIAAAAqAAAAdAAAAEwAAAAiAAAAVgAAAE4AAABJAAAAYwAAAGcAAAB2AAAAUQAAAAwAAAB9AAAAWAAAAD0AAABuAAAAGgAAACQAAABqAAAAXQAAADQAAABLAAAAKQAAAEgAAABVAAAAUAAAAGYAAAA8AAAAfAAAAGkAAAAZAAAAKAAAADMAAABlAAAAVAAAABgAAAB7AAAAUwAAADIAAAAxAAAAegAAAHgAAAB5AAAABAAAAIgAAAAFAAAAkAAAAAYAAACYAAAACQAAALAAAAAfZAAAJWQAACpkAAAyZAAAAAAAALK+uT4S3KC+kL45PhLcoL6Qvjm+AAAAgLK+ub4S3KA+kL45vhLcoD6Qvjk+0nIYvwAAAADScpi+OgYEv9JymD46BgS/0nIYPwAAAIDScpg+OgYEP9JymL46BgQ/AAAAgFa4Pb9mTSQ/Vri9vmZNJD9WuL0+AAAAAFa4PT9mTSS/Vri9PmZNJL9WuL2+DOlYPwAAAIAM6dg+mdk7Pwzp2L6Z2Ts/DOlYvwAAAAAM6di+mdk7vwzp2D6Z2Tu/AAAAAPxTbj/xZU6/DVTuPvFlTr8NVO6+AAAAgPxTbr/xZU4/DVTuvvFlTj8NVO4+AACAvwAAAAAAAAC/0LNdvwAAAD/Qs12/AACAPwAAAIAAAAA/0LNdPwAAAL/Qs10/ADcAAAA3AAAANwAAADcAAL2zAADTswAA87MAABi0AAAytAAAUbQAAGa0AACDtAAArbQAAO20AAAMtQAAI7UAADm1AABNtQAAirUAALq1AADWtQAA+bUAADC2AABntgAAfrYAAJ62AADItgAAFbcAADC3AABbtwAAd7cAAJy3AADCtwAA57cAAPq3AAAPuAAAIrgAADW4AABauAAAb7gAAIO4AACkuAAAurgAAOm4AAARuQAAMrkAAFO5AACCuQAAk7kAAK+5AADtuQAAFLoAADu6AABPugAAfboAAKW6AADBugAA5roAAAi7AAAyuwAAXbsAAHu7AACpuwAA0bsAAPi7AAAjvAAAULwAAIC8AACqvAAA17wAAPq8AAAYvQAANr0AAGy9AACWvQAAtb0AANi9AAD/vQAAFL4AACi+AABdvgAAbb4AAKu+AADtvgAAF78AAEO/AABqvwAAhr8AALG/AADMvwAA4L8AAPe/AAAEwAAALMAAAGHAAACdwAAAy8AAAOzAAAATwQAALMEAAFTBAAB3wQAAj8EAALPBAADYwQAA3sEAABfCAABRwgAAcMIAAH/CAACcwgAAusIAANfCAADwwgAACcMAAEvDAACFwwAAu8MAAO/DAAADxAAAGsQAAEDEAABnxAAAqcQAAOXEAAAWxQAAOsUAAGjFAACDxQAAu8UAAObFAAAAAAAAAAAAAAEAAAAIAAAAEAAAAAkAAAACAAAAAwAAAAoAAAARAAAAGAAAACAAAAAZAAAAEgAAAAsAAAAEAAAABQAAAAwAAAATAAAAGgAAACEAAAAoAAAAMAAAACkAAAAiAAAAGwAAABQAAAANAAAABgAAAAcAAAAOAAAAFQAAABwAAAAjAAAAKgAAADEAAAA4AAAAOQAAADIAAAArAAAAJAAAAB0AAAAWAAAADwAAABcAAAAeAAAAJQAAACwAAAAzAAAAOgAAADsAAAA0AAAALQAAACYAAAAfAAAAJwAAAC4AAAA1AAAAPAAAAD0AAAA2AAAALwAAADcAAAA+AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAAAAAAAAQAAAAgAAAAQAAAACQAAAAIAAAADAAAACgAAABEAAAAYAAAAIAAAABkAAAASAAAACwAAAAQAAAAFAAAADAAAABMAAAAaAAAAIQAAACgAAAAwAAAAKQAAACIAAAAbAAAAFAAAAA0AAAAGAAAADgAAABUAAAAcAAAAIwAAACoAAAAxAAAAMgAAACsAAAAkAAAAHQAAABYAAAAeAAAAJQAAACwAAAAzAAAANAAAAC0AAAAmAAAALgAAADUAAAA2AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAAAAAAAAAAAAAAAAAAAAAAABAAAACAAAABAAAAAJAAAAAgAAAAMAAAAKAAAAEQAAABgAAAAgAAAAGQAAABIAAAALAAAABAAAAAUAAAAMAAAAEwAAABoAAAAhAAAAKAAAACkAAAAiAAAAGwAAABQAAAANAAAAFQAAABwAAAAjAAAAKgAAACsAAAAkAAAAHQAAACUAAAAsAAAALQAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAAAAAAAAQAAAAgAAAAQAAAACQAAAAIAAAADAAAACgAAABEAAAAYAAAAIAAAABkAAAASAAAACwAAAAQAAAAMAAAAEwAAABoAAAAhAAAAIgAAABsAAAAUAAAAHAAAACMAAAAkAAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAAAAAAAAAAAAAAAAAAAAAAABAAAACAAAABAAAAAJAAAAAgAAAAMAAAAKAAAAEQAAABgAAAAZAAAAEgAAAAsAAAATAAAAGgAAABsAAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAAAAAAAEAAAAIAAAAEAAAAAkAAAACAAAACgAAABEAAAASAAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAAAAAAAAAAAAAAAAAAAAAAABAAAACAAAAAkAAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAgQEdWg4ChiUQAxQREgQLCBQF2AMXBtoBGQflABwIbwAeCTYAIQoaACMLDQAJDAYACg0DAAwNAQCPD39aJBAlPyYR8iwnEnwgKBO5FyoUghErFe8MLRahCS4XLwcwGFwFMRkGBDMaAwM0G0ACNhyxATgdRAE5HvUAOx+3ADwgigA+IWgAPyJOACAjOwAhCSwApSXhWkAmTEhBJw06QyjxLkQpHyZFKjMfRiuoGUgsGBVJLXcRSi50Dksv+wtNMPgJTjFhCE8yBgcwM80FMjTeBDI1DwQzNmMDNDfUAjU4XAI2OfgBNzqkATg7YAE5PCUBOj32ADs+ywA9P6sAPSCPAMFBEltQQgRNUUMsQVJE2DdTRegvVEY8KVZHeSNXSN8eV0mpGkhKThdISyQUSkycEUpNaw9LTlENTU+2C00wQArQUTJYWFIcTVlTjkNaVN07W1XuNFxWri5dV5opVkcWJdhZcFVfWqlMYFvZRGFcIj5jXSQ4Y160Ml1WFy7fYKhWZWFGT2Zi5UdnY89BaGQ9PGNdXjdpZjFSamcPTGtoOUZnY15B6WonVmxr51BtZ4VLbm2XVW9rT1DubxBacG0iVfBv61lxcR1aAAAAAAAAAAAAAAAAAQAAAAIAAAADAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAAGAAAAAwAAAAcAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAABgAAAAIAAAAEAAAABwAAAAwAAAADAAAACAAAAAsAAAANAAAACQAAAAoAAAAOAAAADwAAAAAAAAABAAAABQAAAAYAAAAOAAAAAgAAAAQAAAAHAAAADQAAAA8AAAADAAAACAAAAAwAAAAQAAAAFQAAAAkAAAALAAAAEQAAABQAAAAWAAAACgAAABIAAAATAAAAFwAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAUAAAAGAAAADgAAAA8AAAACAAAABAAAAAcAAAANAAAAEAAAABkAAAADAAAACAAAAAwAAAARAAAAGAAAABoAAAAJAAAACwAAABIAAAAXAAAAGwAAACAAAAAKAAAAEwAAABYAAAAcAAAAHwAAACEAAAAUAAAAFQAAAB0AAAAeAAAAIgAAACMAAAAAAAAAAQAAAAUAAAAGAAAADgAAAA8AAAAbAAAAAgAAAAQAAAAHAAAADQAAABAAAAAaAAAAHAAAAAMAAAAIAAAADAAAABEAAAAZAAAAHQAAACYAAAAJAAAACwAAABIAAAAYAAAAHgAAACUAAAAnAAAACgAAABMAAAAXAAAAHwAAACQAAAAoAAAALQAAABQAAAAWAAAAIAAAACMAAAApAAAALAAAAC4AAAAVAAAAIQAAACIAAAAqAAAAKwAAAC8AAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAABgAAAA4AAAAPAAAAGwAAABwAAAACAAAABAAAAAcAAAANAAAAEAAAABoAAAAdAAAAKgAAAAMAAAAIAAAADAAAABEAAAAZAAAAHgAAACkAAAArAAAACQAAAAsAAAASAAAAGAAAAB8AAAAoAAAALAAAADUAAAAKAAAAEwAAABcAAAAgAAAAJwAAAC0AAAA0AAAANgAAABQAAAAWAAAAIQAAACYAAAAuAAAAMwAAADcAAAA8AAAAFQAAACIAAAAlAAAALwAAADIAAAA4AAAAOwAAAD0AAAAjAAAAJAAAADAAAAAxAAAAOQAAADoAAAA+AAAAPwAAAAAAAAABAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAAAQMVYn1NCSwBASTKjIqgRxVghe/xzYmjFWL9FCzB+GJ9T/HNBbVRin1OzQUEtEhdCS2JoVGJ+WEJLITu6KMMUAEDFWJ9TQksAQEkyoyKoEUkyv0WzQSE7STKCJzcb4A2jIgswQS26KKMiNxu/Eo4JqBF+GBIXwxSoEeANjgnfBAAAAAAAAPA/72FIsVAx9j/Kb02Rruf0P6oRbO9i0PI/AAAAAAAA8D87v6fAaSTpP7sgx3t6UeE/Xaty3lWo0T8AwDDwDMw8/APDM/MPzz//gECwcIxMvHyDQ7Nzj0+/fyDgENAs7BzcI+MT0y/vH9+gYJBQrGycXKNjk1Ovb59fCMg4+ATENPQLyzv7B8c394hIuHiERLR0i0u7e4dHt3co6BjYJOQU1CvrG9sn5xfXqGiYWKRklFSra5tbp2eXVwLCMvIOzj7+AcEx8Q3NPf2CQrJyjk6+foFBsXGNTb19IuIS0i7uHt4h4RHRLe0d3aJiklKubp5eoWGRUa1tnV0Kyjr6BsY29gnJOfkFxTX1ikq6eoZGtnaJSbl5hUW1dSrqGtom5hbWKekZ2SXlFdWqappapmaWVqlpmVmlZZVV3hIElQAAAAD///////////////8AAAAAAAAAAAAAAAACAADAAwAAwAQAAMAFAADABgAAwAcAAMAIAADACQAAwAoAAMALAADADAAAwA0AAMAOAADADwAAwBAAAMARAADAEgAAwBMAAMAUAADAFQAAwBYAAMAXAADAGAAAwBkAAMAaAADAGwAAwBwAAMAdAADAHgAAwB8AAMAAAACzAQAAwwIAAMMDAADDBAAAwwUAAMMGAADDBwAAwwgAAMMJAADDCgAAwwsAAMMMAADDDQAA0w4AAMMPAADDAAAMuwEADMMCAAzDAwAMwwQADNMAAAAA/////////////////////////////////////////////////////////////////wABAgMEBQYHCAn/////////CgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiP///////8KCwwNDg8QERITFBUWFxgZGhscHR4fICEiI/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAARAAoAERERAAAAAAUAAAAAAAAJAAAAAAsAAAAAAAAAABEADwoREREDCgcAARMJCwsAAAkGCwAACwAGEQAAABEREQAAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAARAAoKERERAAoAAAIACQsAAAAJAAsAAAsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAMAAAAAAkMAAAAAAAMAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAA0AAAAEDQAAAAAJDgAAAAAADgAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAPAAAAAA8AAAAACRAAAAAAABAAABAAABIAAAASEhIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAABISEgAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAAoAAAAACgAAAAAJCwAAAAAACwAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAwAAAAACQwAAAAAAAwAAAwAADAxMjM0NTY3ODlBQkNERUYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgACAAIAAgACAAIAAgACAAIAAyACIAIgAiACIAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAFgBMAEwATABMAEwATABMAEwATABMAEwATABMAEwATACNgI2AjYCNgI2AjYCNgI2AjYCNgEwATABMAEwATABMAEwAjVCNUI1QjVCNUI1QjFCMUIxQjFCMUIxQjFCMUIxQjFCMUIxQjFCMUIxQjFCMUIxQjFCMUEwATABMAEwATABMAI1gjWCNYI1gjWCNYIxgjGCMYIxgjGCMYIxgjGCMYIxgjGCMYIxgjGCMYIxgjGCMYIxgjGBMAEwATABMACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACQAAAAlAAAAJgAAACcAAAAoAAAAKQAAACoAAAArAAAALAAAAC0AAAAuAAAALwAAADAAAAAxAAAAMgAAADMAAAA0AAAANQAAADYAAAA3AAAAOAAAADkAAAA6AAAAOwAAADwAAAA9AAAAPgAAAD8AAABAAAAAYQAAAGIAAABjAAAAZAAAAGUAAABmAAAAZwAAAGgAAABpAAAAagAAAGsAAABsAAAAbQAAAG4AAABvAAAAcAAAAHEAAAByAAAAcwAAAHQAAAB1AAAAdgAAAHcAAAB4AAAAeQAAAHoAAABbAAAAXAAAAF0AAABeAAAAXwAAAGAAAABhAAAAYgAAAGMAAABkAAAAZQAAAGYAAABnAAAAaAAAAGkAAABqAAAAawAAAGwAAABtAAAAbgAAAG8AAABwAAAAcQAAAHIAAABzAAAAdAAAAHUAAAB2AAAAdwAAAHgAAAB5AAAAegAAAHsAAAB8AAAAfQAAAH4AAAB/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACQAAAAlAAAAJgAAACcAAAAoAAAAKQAAACoAAAArAAAALAAAAC0AAAAuAAAALwAAADAAAAAxAAAAMgAAADMAAAA0AAAANQAAADYAAAA3AAAAOAAAADkAAAA6AAAAOwAAADwAAAA9AAAAPgAAAD8AAABAAAAAQQAAAEIAAABDAAAARAAAAEUAAABGAAAARwAAAEgAAABJAAAASgAAAEsAAABMAAAATQAAAE4AAABPAAAAUAAAAFEAAABSAAAAUwAAAFQAAABVAAAAVgAAAFcAAABYAAAAWQAAAFoAAABbAAAAXAAAAF0AAABeAAAAXwAAAGAAAABBAAAAQgAAAEMAAABEAAAARQAAAEYAAABHAAAASAAAAEkAAABKAAAASwAAAEwAAABNAAAATgAAAE8AAABQAAAAUQAAAFIAAABTAAAAVAAAAFUAAABWAAAAVwAAAFgAAABZAAAAWgAAAHsAAAB8AAAAfQAAAH4AAAB/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZEkQ7Aj8sRxQ9MzAKGwZGS0U3D0kOjhcDQB08aSs2H0otHAEgJSkhCAwVFiIuEDg+CzQxGGR0dXYvQQl/OREjQzJCiYqLBQQmKCcNKh41jAcaSJMTlJUAAAAAAAAAAABJbGxlZ2FsIGJ5dGUgc2VxdWVuY2UARG9tYWluIGVycm9yAFJlc3VsdCBub3QgcmVwcmVzZW50YWJsZQBOb3QgYSB0dHkAUGVybWlzc2lvbiBkZW5pZWQAT3BlcmF0aW9uIG5vdCBwZXJtaXR0ZWQATm8gc3VjaCBmaWxlIG9yIGRpcmVjdG9yeQBObyBzdWNoIHByb2Nlc3MARmlsZSBleGlzdHMAVmFsdWUgdG9vIGxhcmdlIGZvciBkYXRhIHR5cGUATm8gc3BhY2UgbGVmdCBvbiBkZXZpY2UAT3V0IG9mIG1lbW9yeQBSZXNvdXJjZSBidXN5AEludGVycnVwdGVkIHN5c3RlbSBjYWxsAFJlc291cmNlIHRlbXBvcmFyaWx5IHVuYXZhaWxhYmxlAEludmFsaWQgc2VlawBDcm9zcy1kZXZpY2UgbGluawBSZWFkLW9ubHkgZmlsZSBzeXN0ZW0ARGlyZWN0b3J5IG5vdCBlbXB0eQBDb25uZWN0aW9uIHJlc2V0IGJ5IHBlZXIAT3BlcmF0aW9uIHRpbWVkIG91dABDb25uZWN0aW9uIHJlZnVzZWQASG9zdCBpcyBkb3duAEhvc3QgaXMgdW5yZWFjaGFibGUAQWRkcmVzcyBpbiB1c2UAQnJva2VuIHBpcGUASS9PIGVycm9yAE5vIHN1Y2ggZGV2aWNlIG9yIGFkZHJlc3MAQmxvY2sgZGV2aWNlIHJlcXVpcmVkAE5vIHN1Y2ggZGV2aWNlAE5vdCBhIGRpcmVjdG9yeQBJcyBhIGRpcmVjdG9yeQBUZXh0IGZpbGUgYnVzeQBFeGVjIGZvcm1hdCBlcnJvcgBJbnZhbGlkIGFyZ3VtZW50AEFyZ3VtZW50IGxpc3QgdG9vIGxvbmcAU3ltYm9saWMgbGluayBsb29wAEZpbGVuYW1lIHRvbyBsb25nAFRvbyBtYW55IG9wZW4gZmlsZXMgaW4gc3lzdGVtAE5vIGZpbGUgZGVzY3JpcHRvcnMgYXZhaWxhYmxlAEJhZCBmaWxlIGRlc2NyaXB0b3IATm8gY2hpbGQgcHJvY2VzcwBCYWQgYWRkcmVzcwBGaWxlIHRvbyBsYXJnZQBUb28gbWFueSBsaW5rcwBObyBsb2NrcyBhdmFpbGFibGUAUmVzb3VyY2UgZGVhZGxvY2sgd291bGQgb2NjdXIAU3RhdGUgbm90IHJlY292ZXJhYmxlAFByZXZpb3VzIG93bmVyIGRpZWQAT3BlcmF0aW9uIGNhbmNlbGVkAEZ1bmN0aW9uIG5vdCBpbXBsZW1lbnRlZABObyBtZXNzYWdlIG9mIGRlc2lyZWQgdHlwZQBJZGVudGlmaWVyIHJlbW92ZWQARGV2aWNlIG5vdCBhIHN0cmVhbQBObyBkYXRhIGF2YWlsYWJsZQBEZXZpY2UgdGltZW91dABPdXQgb2Ygc3RyZWFtcyByZXNvdXJjZXMATGluayBoYXMgYmVlbiBzZXZlcmVkAFByb3RvY29sIGVycm9yAEJhZCBtZXNzYWdlAEZpbGUgZGVzY3JpcHRvciBpbiBiYWQgc3RhdGUATm90IGEgc29ja2V0AERlc3RpbmF0aW9uIGFkZHJlc3MgcmVxdWlyZWQATWVzc2FnZSB0b28gbGFyZ2UAUHJvdG9jb2wgd3JvbmcgdHlwZSBmb3Igc29ja2V0AFByb3RvY29sIG5vdCBhdmFpbGFibGUAUHJvdG9jb2wgbm90IHN1cHBvcnRlZABTb2NrZXQgdHlwZSBub3Qgc3VwcG9ydGVkAE5vdCBzdXBwb3J0ZWQAUHJvdG9jb2wgZmFtaWx5IG5vdCBzdXBwb3J0ZWQAQWRkcmVzcyBmYW1pbHkgbm90IHN1cHBvcnRlZCBieSBwcm90b2NvbABBZGRyZXNzIG5vdCBhdmFpbGFibGUATmV0d29yayBpcyBkb3duAE5ldHdvcmsgdW5yZWFjaGFibGUAQ29ubmVjdGlvbiByZXNldCBieSBuZXR3b3JrAENvbm5lY3Rpb24gYWJvcnRlZABObyBidWZmZXIgc3BhY2UgYXZhaWxhYmxlAFNvY2tldCBpcyBjb25uZWN0ZWQAU29ja2V0IG5vdCBjb25uZWN0ZWQAQ2Fubm90IHNlbmQgYWZ0ZXIgc29ja2V0IHNodXRkb3duAE9wZXJhdGlvbiBhbHJlYWR5IGluIHByb2dyZXNzAE9wZXJhdGlvbiBpbiBwcm9ncmVzcwBTdGFsZSBmaWxlIGhhbmRsZQBSZW1vdGUgSS9PIGVycm9yAFF1b3RhIGV4Y2VlZGVkAE5vIG1lZGl1bSBmb3VuZABXcm9uZyBtZWRpdW0gdHlwZQBObyBlcnJvciBpbmZvcm1hdGlvbgAAAAAAAAoAAABkAAAA6AMAABAnAACghgEAQEIPAICWmAAA4fUFTENfQ1RZUEUAAAAATENfTlVNRVJJQwAATENfVElNRQAAAAAATENfQ09MTEFURQAATENfTU9ORVRBUlkATENfTUVTU0FHRVMAAAAAAAAAAAAAAAAAAgAAAAMAAAAFAAAABwAAAAsAAAANAAAAEQAAABMAAAAXAAAAHQAAAB8AAAAlAAAAKQAAACsAAAAvAAAANQAAADsAAAA9AAAAQwAAAEcAAABJAAAATwAAAFMAAABZAAAAYQAAAGUAAABnAAAAawAAAG0AAABxAAAAfwAAAIMAAACJAAAAiwAAAJUAAACXAAAAnQAAAKMAAACnAAAArQAAALMAAAC1AAAAvwAAAMEAAADFAAAAxwAAANMAAAABAAAACwAAAA0AAAARAAAAEwAAABcAAAAdAAAAHwAAACUAAAApAAAAKwAAAC8AAAA1AAAAOwAAAD0AAABDAAAARwAAAEkAAABPAAAAUwAAAFkAAABhAAAAZQAAAGcAAABrAAAAbQAAAHEAAAB5AAAAfwAAAIMAAACJAAAAiwAAAI8AAACVAAAAlwAAAJ0AAACjAAAApwAAAKkAAACtAAAAswAAALUAAAC7AAAAvwAAAMEAAADFAAAAxwAAANEAAAAwMTIzNDU2Nzg5YWJjZGVmQUJDREVGeFgrLXBQaUluTgAAAAAAAAAAAAAAAAAAAAAlAAAAbQAAAC8AAAAlAAAAZAAAAC8AAAAlAAAAeQAAACUAAABZAAAALQAAACUAAABtAAAALQAAACUAAABkAAAAJQAAAEkAAAA6AAAAJQAAAE0AAAA6AAAAJQAAAFMAAAAgAAAAJQAAAHAAAAAAAAAAJQAAAEgAAAA6AAAAJQAAAE0AAAAAAAAAAAAAAAAAAAAlAAAASAAAADoAAAAlAAAATQAAADoAAAAlAAAAUwAAACUAAABIAAAAOgAAACUAAABNAAAAOgAAACUAAABTAAAA3EMAAP1sAAAERAAAcXkAAIAzAAAAAAAABEQAAFx8AAA4NgAAAAAAAAREAAALhwAAUEEAAAAAAAAERAAAc5cAAFBBAAAAAAAABEQAAOeXAABQQQAAAAAAAHBEAADNrgAAAAAAAAEAAADwMwAAAAAAANxDAAAMrwAABQAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAB2BwEAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAA//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAA47wAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAIAAABI8wAAAAQAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACv////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3EMAAC3HAAAERAAAjccAAFA2AAAAAAAABEQAADrHAABgNgAAAAAAANxDAABbxwAABEQAAGjHAABANgAAAAAAAAREAADXxwAAODYAAAAAAAAERAAA58cAAHg2AAAAAAAABEQAAPjHAABQNgAAAAAAAAREAAAayAAAmDYAAAAAAAAERAAAXMgAAFA2AAAAAAAAVEQAAITIAABURAAAhsgAAFREAACIyAAAVEQAAIrIAABURAAAjMgAAFREAACOyAAAVEQAAJDIAABURAAAksgAAFREAACUyAAAVEQAADvnAABURAAAlsgAAFREAACYyAAAVEQAAJrIAAAERAAAnMgAAEA2AAAAAAAABEQAAKDJAABQNwAAAAAAANxDAADPyQAABEQAAHfKAABQNwAAAAAAAAREAAC6ygAAUDcAAAAAAAAERAAAB8sAAFA3AAAAAAAABEQAAE3LAABQNwAAAAAAAAREAAB9ywAAUDcAAAAAAAAERAAAu8sAAFA3AAAAAAAABEQAAOzLAABQNwAAAAAAAAREAAA3zAAAUDcAAAAAAAAERAAAcMwAAFA3AAAAAAAABEQAAKvMAABQNwAAAAAAAAREAADnzAAAUDcAAAAAAAAERAAAH80AAFA3AAAAAAAABEQAAE3NAABQNwAAAAAAAAREAACAzQAAUDcAAAAAAAAERAAAPM4AAFA3AAAAAAAABEQAAGnOAABQNwAAAAAAAAREAACazgAAUDcAAAAAAAAERAAA2M4AAFA3AAAAAAAABEQAAFDPAABQNwAAAAAAAAREAAAVzwAAUDcAAAAAAAAERAAAl88AAFA3AAAAAAAABEQAAODPAABQNwAAAAAAAAREAAA70AAAUDcAAAAAAAAERAAAZtAAAFA3AAAAAAAABEQAAKDQAABQNwAAAAAAAAREAADU0AAAUDcAAAAAAAAERAAAJNEAAFA3AAAAAAAABEQAAFPRAABQNwAAAAAAAAREAACM0QAAUDcAAAAAAAAERAAAxdEAAFA3AAAAAAAABEQAAOrTAABQNwAAAAAAAAREAAA41AAAUDcAAAAAAAAERAAAc9QAAFA3AAAAAAAABEQAAJ/UAABQNwAAAAAAAAREAADp1AAAUDcAAAAAAAAERAAAHtUAAFA3AAAAAAAABEQAAFHVAABQNwAAAAAAAAREAACI1QAAUDcAAAAAAAAERAAAvdUAAFA3AAAAAAAABEQAAFPWAABQNwAAAAAAAAREAACF1gAAUDcAAAAAAAAERAAAt9YAAFA3AAAAAAAABEQAAA/XAABQNwAAAAAAAAREAABX1wAAUDcAAAAAAAAERAAAj9cAAFA3AAAAAAAABEQAAN3XAABQNwAAAAAAAAREAAAc2AAAUDcAAAAAAAAERAAAX9gAAFA3AAAAAAAABEQAAJDYAABQNwAAAAAAAAREAADK2QAAUDcAAAAAAAAERAAACtoAAFA3AAAAAAAABEQAAD3aAABQNwAAAAAAAAREAAB32gAAUDcAAAAAAAAERAAAsNoAAFA3AAAAAAAABEQAAO3aAABQNwAAAAAAAAREAABj2wAAUDcAAAAAAAAERAAAj9sAAFA3AAAAAAAABEQAAMXbAABQNwAAAAAAAAREAAAZ3AAAUDcAAAAAAAAERAAAUdwAAFA3AAAAAAAABEQAAJTcAABQNwAAAAAAAAREAADF3AAAUDcAAAAAAAAERAAA9dwAAFA3AAAAAAAABEQAADDdAABQNwAAAAAAAAREAABy3QAAUDcAAAAAAAAERAAAYd4AAFA3AAAAAAAA3EMAAAniAADcQwAAKOIAANxDAABH4gAA3EMAAGbiAADcQwAAheIAANxDAACk4gAA3EMAAMPiAADcQwAA4uIAANxDAAAB4wAA3EMAACDjAADcQwAAP+MAANxDAABe4wAA3EMAAH3jAABwRAAAkOMAAAAAAAABAAAA8DMAAAAAAABwRAAAz+MAAAAAAAABAAAA8DMAAAAAAAAERAAAIOQAACA8AAAAAAAA3EMAAA7kAAAERAAASuQAACA8AAAAAAAA3EMAAHTkAADcQwAApeQAAHBEAADW5AAAAAAAAAEAAAAQPAAAA/T//3BEAAAF5QAAAAAAAAEAAAAoPAAAA/T//3BEAAA05QAAAAAAAAEAAAAQPAAAA/T//3BEAABj5QAAAAAAAAEAAAAoPAAAA/T//wREAACS5QAAQDwAAAAAAAAERAAAq+UAADg8AAAAAAAABEQAAOrlAABAPAAAAAAAAAREAAAC5gAAODwAAAAAAAAERAAAGuYAAPg8AAAAAAAABEQAAC7mAABIQQAAAAAAAAREAABE5gAA+DwAAAAAAABwRAAAXeYAAAAAAAACAAAA+DwAAAIAAAA4PQAAAAAAAHBEAACh5gAAAAAAAAEAAABQPQAAAAAAANxDAAC35gAAcEQAANDmAAAAAAAAAgAAAPg8AAACAAAAeD0AAAAAAABwRAAAFOcAAAAAAAABAAAAUD0AAAAAAABwRAAAPecAAAAAAAACAAAA+DwAAAIAAACwPQAAAAAAAHBEAACB5wAAAAAAAAEAAADIPQAAAAAAANxDAACX5wAAcEQAALDnAAAAAAAAAgAAAPg8AAACAAAA8D0AAAAAAABwRAAA9OcAAAAAAAABAAAAyD0AAAAAAABwRAAASukAAAAAAAADAAAA+DwAAAIAAAAwPgAAAgAAADg+AAAACAAA3EMAALHpAADcQwAAj+kAAHBEAADE6QAAAAAAAAMAAAD4PAAAAgAAADA+AAACAAAAaD4AAAAIAADcQwAACeoAAHBEAAAr6gAAAAAAAAIAAAD4PAAAAgAAAJA+AAAACAAA3EMAAHDqAABwRAAAheoAAAAAAAACAAAA+DwAAAIAAACQPgAAAAgAAHBEAADK6gAAAAAAAAIAAAD4PAAAAgAAANg+AAACAAAA3EMAAObqAABwRAAA++oAAAAAAAACAAAA+DwAAAIAAADYPgAAAgAAAHBEAAAX6wAAAAAAAAIAAAD4PAAAAgAAANg+AAACAAAAcEQAADPrAAAAAAAAAgAAAPg8AAACAAAA2D4AAAIAAABwRAAAXusAAAAAAAACAAAA+DwAAAIAAABgPwAAAAAAANxDAACk6wAAcEQAAMjrAAAAAAAAAgAAAPg8AAACAAAAiD8AAAAAAADcQwAADuwAAHBEAAAt7AAAAAAAAAIAAAD4PAAAAgAAALA/AAAAAAAA3EMAAHPsAABwRAAAjOwAAAAAAAACAAAA+DwAAAIAAADYPwAAAAAAANxDAADS7AAAcEQAAOvsAAAAAAAAAgAAAPg8AAACAAAAAEAAAAIAAADcQwAAAO0AAHBEAACX7QAAAAAAAAIAAAD4PAAAAgAAAABAAAACAAAABEQAABjtAAA4QAAAAAAAAHBEAAA77QAAAAAAAAIAAAD4PAAAAgAAAFhAAAACAAAA3EMAAF7tAAAERAAAde0AADhAAAAAAAAAcEQAAKztAAAAAAAAAgAAAPg8AAACAAAAWEAAAAIAAABwRAAAzu0AAAAAAAACAAAA+DwAAAIAAABYQAAAAgAAAHBEAADw7QAAAAAAAAIAAAD4PAAAAgAAAFhAAAACAAAABEQAABPuAAD4PAAAAAAAAHBEAAAp7gAAAAAAAAIAAAD4PAAAAgAAAABBAAACAAAA3EMAADvuAABwRAAAUO4AAAAAAAACAAAA+DwAAAIAAAAAQQAAAgAAAAREAABt7gAA+DwAAAAAAAAERAAAgu4AAPg8AAAAAAAA3EMAAJfuAABwRAAAsO4AAAAAAAABAAAASEEAAAAAAAABAAAAAAAAAIgzAAABAAAAAgAAAAAAAACAMwAAAwAAAAQAAAAAAAAAmDMAAAUAAAAGAAAAAQAAALlSjD6OWuc+uVKMPgAAAACoMwAABwAAAAgAAAAJAAAAAQAAAAoAAAAAAAAAuDMAAAcAAAALAAAADAAAAAIAAAANAAAAAAAAAMgzAAAHAAAADgAAAA8AAAADAAAAEAAAAP/////+/////f///8g2AAAANwAAIDcAAMg2AAAANwAAADcAACg3AAAANwAAyDYAAAA3AAAoNwAAADcAAMg2AAAANwAAADcAANgzAAAANwAAADcAAAA3AAAANwAAADcAANgzAAAANwAAADcAAAEAAAAAAAAAAgAAAEAGAACAPgAAAAAAAIgTAABAFgAAFAAAAEMuVVRGLTgAAAAAAAAAAAAAAAAAiEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+DMAAIg0AAAYNQAAGDUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARP8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgGwAAIB8AACAlAABfcIkA/wkvDwAAAABANgAAEQAAABIAAAATAAAAFAAAAAQAAAABAAAAAQAAAAEAAAAAAAAAaDYAABEAAAAVAAAAEwAAABQAAAAEAAAAAgAAAAIAAAACAAAAAAAAAHg2AAAWAAAAFwAAAAQAAAAAAAAAiDYAABYAAAAYAAAABAAAAAAAAAC4NgAAEQAAABkAAAATAAAAFAAAAAUAAAAAAAAAMDcAABEAAAAaAAAAEwAAABQAAAAEAAAAAwAAAAMAAAADAAAAAAAAAEA3AAAEAAAABQAAAAYAAAAHAAAAAQAAAAIAAAADAAAAGwAAABwAAAAAAAAAUDcAAAQAAAAFAAAABgAAAAcAAAABAAAAAgAAAAMAAAAbAAAAHQAAAAAAAABYNwAABAAAAAUAAAAGAAAABwAAAAQAAAACAAAABQAAABsAAAAeAAAAAAAAAGg3AAAEAAAABQAAAAYAAAAHAAAABgAAAAIAAAADAAAAGwAAAB8AAAAAAAAAeDcAAAgAAAAFAAAABgAAAAcAAAAHAAAACAAAAAMAAAAbAAAAIAAAAAAAAACINwAACQAAAAUAAAAGAAAABwAAAAkAAAAKAAAAAwAAABsAAAAhAAAAAAAAAJg3AAAEAAAABQAAAAYAAAAHAAAACwAAAAIAAAAMAAAAGwAAACIAAAAAAAAAqDcAAAQAAAAFAAAABgAAAAcAAAANAAAAAgAAAAMAAAAbAAAAIwAAAAAAAAC4NwAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAAwAAABsAAAAkAAAAAAAAAMg3AAAEAAAABQAAAAYAAAAHAAAAEAAAAAIAAAADAAAAGwAAACUAAAAAAAAA2DcAAAQAAAAFAAAABgAAAAcAAAARAAAAAgAAAAMAAAAbAAAAJgAAAAAAAADoNwAABAAAAAUAAAAGAAAABwAAABIAAAACAAAAAwAAABsAAAAnAAAAAAAAAPg3AAAEAAAABQAAAAYAAAAHAAAAEwAAAAIAAAADAAAAGwAAACgAAAAAAAAACDgAAAQAAAAFAAAABgAAAAcAAAAUAAAAAgAAAAMAAAAbAAAAKQAAAAAAAAAYOAAABAAAAAUAAAAGAAAABwAAABUAAAACAAAAAwAAABsAAAAqAAAAAAAAACg4AAAEAAAABQAAAAYAAAAHAAAAFgAAAAIAAAADAAAAGwAAACsAAAAAAAAAODgAAAQAAAAFAAAABgAAAAcAAAAXAAAAAgAAAAMAAAAbAAAALAAAAAAAAABIOAAABAAAAAUAAAAGAAAABwAAABgAAAACAAAAAwAAABsAAAAtAAAAAAAAAFg4AAAEAAAABQAAAAYAAAAHAAAAGQAAAAIAAAADAAAAGwAAAC4AAAAAAAAAaDgAAAQAAAAFAAAABgAAAAcAAAAaAAAAAgAAAAMAAAAbAAAALwAAAAAAAAB4OAAABAAAAAUAAAAGAAAABwAAABsAAAACAAAAAwAAABsAAAAwAAAAAAAAAIg4AAAEAAAABQAAAAYAAAAHAAAAHAAAAAIAAAADAAAAGwAAADEAAAAAAAAAmDgAAAQAAAAFAAAABgAAAAcAAAAdAAAAAgAAAAMAAAAbAAAAMgAAAAAAAACoOAAABAAAAAUAAAAGAAAABwAAAB4AAAACAAAAAwAAABsAAAAzAAAAAAAAALg4AAAEAAAABQAAAAYAAAAHAAAAHwAAAAIAAAADAAAAGwAAADQAAAAAAAAAyDgAAAQAAAAFAAAABgAAAAcAAAAgAAAAAgAAAAMAAAAbAAAANQAAAAAAAADYOAAABAAAAAUAAAAGAAAABwAAACEAAAACAAAAAwAAABsAAAA2AAAAAAAAAOg4AAAEAAAABQAAAAYAAAAHAAAAIgAAAAIAAAADAAAAGwAAADcAAAAAAAAA+DgAAAQAAAAFAAAABgAAAAcAAAAjAAAAAgAAACQAAAAbAAAAOAAAAAAAAAAIOQAABAAAAAUAAAAGAAAABwAAACUAAAACAAAAAwAAABsAAAA5AAAAAAAAABg5AAAEAAAABQAAAAYAAAAHAAAAJgAAAAIAAAADAAAAGwAAADoAAAAAAAAAKDkAAAQAAAAFAAAABgAAAAcAAAAnAAAAAgAAACgAAAAbAAAAOwAAAAAAAAA4OQAABAAAAAUAAAAGAAAABwAAACkAAAACAAAAAwAAABsAAAA8AAAAAAAAAEg5AAAEAAAABQAAAAYAAAAHAAAAKgAAAAIAAAADAAAAGwAAAD0AAAAAAAAAWDkAAAQAAAAFAAAABgAAAAcAAAArAAAAAgAAAAMAAAAbAAAAPgAAAAAAAABoOQAABAAAAAUAAAAGAAAABwAAACwAAAACAAAALQAAABsAAAA/AAAAAAAAAHg5AAAEAAAABQAAAAYAAAAHAAAALgAAAAIAAAADAAAAGwAAAEAAAAAAAAAAiDkAAAQAAAAFAAAABgAAAAcAAAAvAAAAAgAAAAMAAAAbAAAAQQAAAAAAAACYOQAABAAAAAUAAAAGAAAABwAAADAAAAACAAAAAwAAABsAAABCAAAAAAAAAKg5AAAEAAAABQAAAAYAAAAHAAAAMQAAAAIAAAADAAAAGwAAAEMAAAAAAAAAuDkAAAQAAAAFAAAABgAAAAcAAAAyAAAAAgAAAAMAAAAbAAAARAAAAAAAAADIOQAABAAAAAUAAAAGAAAABwAAADMAAAACAAAAAwAAABsAAABFAAAAAAAAANg5AAAEAAAABQAAAAYAAAAHAAAANAAAAAIAAAADAAAAGwAAAEYAAAAAAAAA6DkAAA4AAAAPAAAAEAAAABEAAAA1AAAANgAAAAMAAAAbAAAARwAAAAAAAAD4OQAABAAAAAUAAAAGAAAABwAAADcAAAACAAAAAwAAABsAAABIAAAAAAAAAAg6AAAEAAAABQAAAAYAAAAHAAAAOAAAAAIAAAA5AAAAGwAAAEkAAAAAAAAAGDoAAAQAAAAFAAAABgAAAAcAAAA6AAAAAgAAAAMAAAAbAAAASgAAAAAAAAAoOgAABAAAAAUAAAAGAAAABwAAADsAAAACAAAAAwAAABsAAABLAAAAAAAAADg6AAAEAAAABQAAAAYAAAAHAAAAPAAAAAIAAAADAAAAGwAAAEwAAAAAAAAASDoAAAQAAAAFAAAABgAAAAcAAAA9AAAAAgAAAAMAAAAbAAAATQAAAAAAAABYOgAABAAAAAUAAAAGAAAABwAAAD4AAAACAAAAAwAAABsAAABOAAAAAAAAAGg6AAAEAAAABQAAAAYAAAAHAAAAPwAAAAIAAABAAAAAGwAAAE8AAAAAAAAAeDoAAAQAAAAFAAAABgAAAAcAAABBAAAAAgAAAEIAAAAbAAAAUAAAAAAAAACIOgAAEgAAAAUAAAAGAAAABwAAAEMAAABEAAAAAwAAABsAAABRAAAAAAAAAJg6AAATAAAAFAAAAAYAAAAHAAAARQAAAEYAAAADAAAAGwAAAFIAAAAAAAAAqDoAAAQAAAAFAAAABgAAAAcAAABHAAAAAgAAAAMAAAAbAAAAUwAAAAAAAAC4OgAABAAAAAUAAAAGAAAABwAAAEgAAAACAAAAAwAAABsAAABUAAAAAAAAAMg6AAAVAAAAFgAAABcAAAAHAAAASQAAAEoAAAADAAAAGwAAAFUAAAAAAAAA2DoAAAQAAAAFAAAABgAAAAcAAABLAAAAAgAAAAMAAAAbAAAAVgAAAAAAAADoOgAABAAAAAUAAAAGAAAABwAAAEwAAAACAAAAAwAAABsAAABXAAAAAAAAAPg6AAAYAAAABQAAABkAAAAHAAAATQAAAE4AAAADAAAAGwAAAFgAAAAAAAAACDsAAAQAAAAFAAAABgAAAAcAAABPAAAAAgAAAAMAAAAbAAAAWQAAAAAAAAAYOwAABAAAAAUAAAAGAAAABwAAAFAAAAACAAAAAwAAABsAAABaAAAAAAAAACg7AAAEAAAABQAAAAYAAAAHAAAAUQAAAAIAAAADAAAAGwAAAFsAAAAAAAAAODsAAAQAAAAFAAAABgAAAAcAAABSAAAAAgAAAAMAAAAbAAAAXAAAAAAAAABIOwAAGgAAAAUAAAAbAAAABwAAAFMAAABUAAAAAwAAABsAAABdAAAAAAAAAFg7AAAEAAAABQAAAAYAAAAHAAAAVQAAAAIAAAADAAAAGwAAAF4AAAAAAAAAaDsAAAQAAAAFAAAABgAAAAcAAABWAAAAAgAAAAMAAAAbAAAAXwAAAAAAAAAgPAAAYAAAAGEAAAAAAAAAODwAAGIAAABjAAAAVwAAAAYAAAAEAAAABAAAAAUAAAAGAAAABwAAAAcAAAAIAAAAHAAAAAgAAAAdAAAAAAAAAEA8AABkAAAAZQAAAFgAAAAJAAAABQAAAAUAAAAJAAAACgAAAAoAAAALAAAADAAAAB4AAAALAAAAHwAAAAgAAAAAAAAASDwAAGYAAABnAAAA+P////j///9IPAAAaAAAAGkAAADcUAAA8FAAAAgAAAAAAAAAYDwAAGoAAABrAAAA+P////j///9gPAAAbAAAAG0AAAAMUQAAIFEAAAQAAAAAAAAAeDwAAG4AAABvAAAA/P////z///94PAAAcAAAAHEAAAA8UQAAUFEAAAQAAAAAAAAAkDwAAHIAAABzAAAA/P////z///+QPAAAdAAAAHUAAABsUQAAgFEAAAAAAACoPAAAZAAAAHYAAABZAAAACQAAAAUAAAAFAAAADQAAAAoAAAAKAAAACwAAAAwAAAAeAAAADAAAACAAAAAAAAAAuDwAAGIAAAB3AAAAWgAAAAYAAAAEAAAABAAAAA4AAAAGAAAABwAAAAcAAAAIAAAAHAAAAA0AAAAhAAAAAAAAAMg8AABkAAAAeAAAAFsAAAAJAAAABQAAAAUAAAAJAAAACgAAAAoAAAAPAAAAEAAAACIAAAALAAAAHwAAAAAAAADYPAAAYgAAAHkAAABcAAAABgAAAAQAAAAEAAAABQAAAAYAAAAHAAAAEQAAABIAAAAjAAAACAAAAB0AAAAAAAAA6DwAAHoAAAB7AAAAfAAAAAEAAAAGAAAADgAAAAAAAAAIPQAAfQAAAH4AAAB8AAAAAgAAAAcAAAAPAAAAAAAAABg9AAB/AAAAgAAAAHwAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAAAAABYPQAAgQAAAIIAAAB8AAAADAAAAA0AAAAOAAAADwAAABAAAAARAAAAEgAAABMAAAAUAAAAFQAAABYAAAAAAAAAkD0AAIMAAACEAAAAfAAAAAMAAAAEAAAAFwAAAAUAAAAYAAAAAQAAAAIAAAAGAAAAAAAAANA9AACFAAAAhgAAAHwAAAAHAAAACAAAABkAAAAJAAAAGgAAAAMAAAAEAAAACgAAAAAAAAAIPgAAhwAAAIgAAAB8AAAAEwAAABsAAAAcAAAAHQAAAB4AAAAfAAAAAQAAAPj///8IPgAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAAAAAAABAPgAAiQAAAIoAAAB8AAAAGwAAACAAAAAhAAAAIgAAACMAAAAkAAAAAgAAAPj///9APgAAHAAAAB0AAAAeAAAAHwAAACAAAAAhAAAAIgAAACUAAABIAAAAOgAAACUAAABNAAAAOgAAACUAAABTAAAAAAAAACUAAABtAAAALwAAACUAAABkAAAALwAAACUAAAB5AAAAAAAAACUAAABJAAAAOgAAACUAAABNAAAAOgAAACUAAABTAAAAIAAAACUAAABwAAAAAAAAACUAAABhAAAAIAAAACUAAABiAAAAIAAAACUAAABkAAAAIAAAACUAAABIAAAAOgAAACUAAABNAAAAOgAAACUAAABTAAAAIAAAACUAAABZAAAAAAAAAEEAAABNAAAAAAAAAFAAAABNAAAAAAAAAEoAAABhAAAAbgAAAHUAAABhAAAAcgAAAHkAAAAAAAAARgAAAGUAAABiAAAAcgAAAHUAAABhAAAAcgAAAHkAAAAAAAAATQAAAGEAAAByAAAAYwAAAGgAAAAAAAAAQQAAAHAAAAByAAAAaQAAAGwAAAAAAAAATQAAAGEAAAB5AAAAAAAAAEoAAAB1AAAAbgAAAGUAAAAAAAAASgAAAHUAAABsAAAAeQAAAAAAAABBAAAAdQAAAGcAAAB1AAAAcwAAAHQAAAAAAAAAUwAAAGUAAABwAAAAdAAAAGUAAABtAAAAYgAAAGUAAAByAAAAAAAAAE8AAABjAAAAdAAAAG8AAABiAAAAZQAAAHIAAAAAAAAATgAAAG8AAAB2AAAAZQAAAG0AAABiAAAAZQAAAHIAAAAAAAAARAAAAGUAAABjAAAAZQAAAG0AAABiAAAAZQAAAHIAAAAAAAAASgAAAGEAAABuAAAAAAAAAEYAAABlAAAAYgAAAAAAAABNAAAAYQAAAHIAAAAAAAAAQQAAAHAAAAByAAAAAAAAAEoAAAB1AAAAbgAAAAAAAABKAAAAdQAAAGwAAAAAAAAAQQAAAHUAAABnAAAAAAAAAFMAAABlAAAAcAAAAAAAAABPAAAAYwAAAHQAAAAAAAAATgAAAG8AAAB2AAAAAAAAAEQAAABlAAAAYwAAAAAAAABTAAAAdQAAAG4AAABkAAAAYQAAAHkAAAAAAAAATQAAAG8AAABuAAAAZAAAAGEAAAB5AAAAAAAAAFQAAAB1AAAAZQAAAHMAAABkAAAAYQAAAHkAAAAAAAAAVwAAAGUAAABkAAAAbgAAAGUAAABzAAAAZAAAAGEAAAB5AAAAAAAAAFQAAABoAAAAdQAAAHIAAABzAAAAZAAAAGEAAAB5AAAAAAAAAEYAAAByAAAAaQAAAGQAAABhAAAAeQAAAAAAAABTAAAAYQAAAHQAAAB1AAAAcgAAAGQAAABhAAAAeQAAAAAAAABTAAAAdQAAAG4AAAAAAAAATQAAAG8AAABuAAAAAAAAAFQAAAB1AAAAZQAAAAAAAABXAAAAZQAAAGQAAAAAAAAAVAAAAGgAAAB1AAAAAAAAAEYAAAByAAAAaQAAAAAAAABTAAAAYQAAAHQAAAAAAAAAAAAAAHA+AACLAAAAjAAAAHwAAAABAAAAAAAAAJg+AACNAAAAjgAAAHwAAAACAAAAAAAAALg+AACPAAAAkAAAAHwAAAAjAAAAJAAAAF0AAABeAAAAXwAAAGAAAAAlAAAAYQAAAGIAAAAAAAAA4D4AAJEAAACSAAAAfAAAACYAAAAnAAAAYwAAAGQAAABlAAAAZgAAACgAAABnAAAAaAAAAAAAAAAAPwAAkwAAAJQAAAB8AAAAKQAAACoAAABpAAAAagAAAGsAAABsAAAAKwAAAG0AAABuAAAAAAAAACA/AACVAAAAlgAAAHwAAAAsAAAALQAAAG8AAABwAAAAcQAAAHIAAAAuAAAAcwAAAHQAAAAAAAAAQD8AAJcAAACYAAAAfAAAAAMAAAAEAAAAAAAAAGg/AACZAAAAmgAAAHwAAAAFAAAABgAAAAAAAACQPwAAmwAAAJwAAAB8AAAAAQAAACUAAAAAAAAAuD8AAJ0AAACeAAAAfAAAAAIAAAAmAAAAAAAAAOA/AACfAAAAoAAAAHwAAAAQAAAABgAAAHUAAAAAAAAACEAAAKEAAACiAAAAfAAAABEAAAAHAAAAdgAAAAAAAABgQAAAowAAAKQAAAB8AAAAAwAAAAQAAAALAAAALwAAADAAAAAMAAAAMQAAAAAAAAAoQAAAowAAAKUAAAB8AAAAAwAAAAQAAAALAAAALwAAADAAAAAMAAAAMQAAAAAAAACQQAAApgAAAKcAAAB8AAAABQAAAAYAAAANAAAAMgAAADMAAAAOAAAANAAAAAAAAADQQAAAqAAAAKkAAAB8AAAAAAAAAOBAAACqAAAAqwAAAHwAAAAkAAAAEgAAACUAAAATAAAAJgAAAAMAAAAUAAAADwAAAAAAAAAoQQAArAAAAK0AAAB8AAAANQAAADYAAAB3AAAAeAAAAHkAAAAAAAAAOEEAAK4AAACvAAAAfAAAADcAAAA4AAAAegAAAHsAAAB8AAAAZgAAAGEAAABsAAAAcwAAAGUAAAAAAAAAdAAAAHIAAAB1AAAAZQAAAAAAAAAAAAAA+DwAAKMAAACwAAAAfAAAAAAAAAAIQQAAowAAALEAAAB8AAAAFQAAAAQAAAAFAAAABgAAACcAAAAWAAAAKAAAABcAAAApAAAABwAAABgAAAAQAAAAAAAAAHBAAACjAAAAsgAAAHwAAAAHAAAACAAAABEAAAA5AAAAOgAAABIAAAA7AAAAAAAAALBAAACjAAAAswAAAHwAAAAJAAAACgAAABMAAAA8AAAAPQAAABQAAAA+AAAAAAAAADhAAACjAAAAtAAAAHwAAAADAAAABAAAAAsAAAAvAAAAMAAAAAwAAAAxAAAAAAAAADg+AAAUAAAAFQAAABYAAAAXAAAAGAAAABkAAAAaAAAAAAAAAGg+AAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAARXJyb3I6IGxhYmVsaW5nIHdvcmsgb3ZlcmZsb3cuCgBVbmtub3duIG9yIHVuc3VwcG9ydGVkIGxhYmVsaW5nIHRocmVzaG9sZCBtb2RlIHJlcXVlc3RlZC4gU2V0IHRvIG1hbnVhbC4KAExhYmVsaW5nIHRocmVzaG9sZCBtb2RlIHNldCB0byAlcy4KAE1BTlVBTABBVVRPX01FRElBTgBBVVRPX09UU1UAQVVUT19BREFQVElWRQBBVVRPX0JSQUNLRVRJTkcARXJyb3I6IFVuc3VwcG9ydGVkIHBpeGVsIGZvcm1hdCAoJWQpIHJlcXVlc3RlZC4KAEF1dG8gdGhyZXNob2xkIChicmFja2V0KSBtYXJrZXIgY291bnRzIC1bJTNkOiAlM2RdIFslM2Q6ICUzZF0gWyUzZDogJTNkXSsuCgBBdXRvIHRocmVzaG9sZCAoYnJhY2tldCkgYWRqdXN0ZWQgdGhyZXNob2xkIHRvICVkLgoAbWVkaWFuAE90c3UAQXV0byB0aHJlc2hvbGQgKCVzKSBhZGp1c3RlZCB0aHJlc2hvbGQgdG8gJWQuCgA/Pz8gMQoAPz8/IDIKAD8/PyAzCgBFcnJvcjogdW5zdXBwb3J0ZWQgcGl4ZWwgZm9ybWF0LgoARXJyb3I6IE5VTEwgcGF0dEhhbmRsZS4KAEVycm9yOiBjYW4ndCBsb2FkIHBhdHRlcm4gZnJvbSBOVUxMIGJ1ZmZlci4KAEVycm9yOiBvdXQgb2YgbWVtb3J5LgoAIAkKDQBQYXR0ZXJuIERhdGEgcmVhZCBlcnJvciEhCgBFcnJvciByZWFkaW5nIHBhdHRlcm4gZmlsZSAnJXMnLgoARXJyb3IgKCVkKTogdW5hYmxlIHRvIG9wZW4gY2FtZXJhIHBhcmFtZXRlcnMgZmlsZSAiJXMiIGZvciByZWFkaW5nLgoARXJyb3IgKCVkKTogdW5hYmxlIHRvIGRldGVybWluZSBmaWxlIGxlbmd0aC4ARXJyb3I6IHN1cHBsaWVkIGZpbGUgZG9lcyBub3QgYXBwZWFyIHRvIGJlIGFuIEFSVG9vbEtpdCBjYW1lcmEgcGFyYW1ldGVyIGZpbGUuCgBFcnJvciAoJWQpOiB1bmFibGUgdG8gcmVhZCBmcm9tIGZpbGUuAGFyZ2xDYW1lcmFGcnVzdHVtUkgoKTogYXJQYXJhbURlY29tcE1hdCgpIGluZGljYXRlZCBwYXJhbWV0ZXIgZXJyb3IuCgBFcnJvcjogaWNwR2V0Sl9VX1hjAEVycm9yIDE6IGljcEdldEluaXRYdzJYYwoARXJyb3IgMjogaWNwR2V0SW5pdFh3MlhjCgBFcnJvciAzOiBpY3BHZXRJbml0WHcyWGMKAEVycm9yIDQ6IGljcEdldEluaXRYdzJYYwoARXJyb3IgNTogaWNwR2V0SW5pdFh3MlhjCgBFcnJvciA2OiBpY3BHZXRJbml0WHcyWGMKAEVycm9yIDc6IGljcEdldEluaXRYdzJYYwoARXJyb3I6IHVuYWJsZSB0byBvcGVuIG11bHRpbWFya2VyIGNvbmZpZyBmaWxlICclcycuCgBFcnJvciBwcm9jZXNzaW5nIG11bHRpbWFya2VyIGNvbmZpZyBmaWxlICclcyc6IEZpcnN0IGxpbmUgbXVzdCBiZSBudW1iZXIgb2YgbWFya2VyIGNvbmZpZ3MgdG8gcmVhZC4KACVsbHUlYwBFcnJvciBwcm9jZXNzaW5nIG11bHRpbWFya2VyIGNvbmZpZyBmaWxlICclcyc6IHBhdHRlcm4gJyVzJyBzcGVjaWZpZWQgaW4gbXVsdGltYXJrZXIgY29uZmlndXJhdGlvbiB3aGlsZSBpbiBiYXJjb2RlLW9ubHkgbW9kZS4KAEVycm9yIHByb2Nlc3NpbmcgbXVsdGltYXJrZXIgY29uZmlnIGZpbGUgJyVzJzogVW5hYmxlIHRvIGRldGVybWluZSBkaXJlY3RvcnkgbmFtZS4KAEVycm9yIHByb2Nlc3NpbmcgbXVsdGltYXJrZXIgY29uZmlnIGZpbGUgJyVzJzogVW5hYmxlIHRvIGxvYWQgcGF0dGVybiAnJXMnLgoAJWxmAEVycm9yIHByb2Nlc3NpbmcgbXVsdGltYXJrZXIgY29uZmlnIGZpbGUgJyVzJywgbWFya2VyIGRlZmluaXRpb24gJTNkOiBGaXJzdCBsaW5lIG11c3QgYmUgcGF0dGVybiB3aWR0aC4KACVsZiAlbGYgJWxmICVsZgAlZiAlZgBFcnJvciBwcm9jZXNzaW5nIG11bHRpbWFya2VyIGNvbmZpZyBmaWxlICclcycsIG1hcmtlciBkZWZpbml0aW9uICUzZDogTGluZXMgMiAtIDQgbXVzdCBiZSBtYXJrZXIgdHJhbnNmb3JtLgoAWyVzXSAAZGVidWcAaW5mbwB3YXJuaW5nAGVycm9yACVzJXMALmlzZXQARXJyb3I6IHVuYWJsZSB0byBvcGVuIGZpbGUgJyVzJXMnIGZvciByZWFkaW5nLgoARXJyb3IgcmVhZGluZyBpbWFnZVNldC4KAEltYWdlc2V0IGNvbnRhaW5zICVkIGltYWdlcy4KAEZhbGxpbmcgYmFjayB0byByZWFkaW5nICclcyVzJyBpbiBBUlRvb2xLaXQgdjQueCBmb3JtYXQuCgBFcnJvciByZWFkaW5nIEpQRUcgZmlsZS4KAEVycm9yIHJlYWRpbmcgSlBFRyBmaWxlIGhlYWRlci4KACVmAEZpbGUgb3BlbiBlcnJvci4gJXMKAFJlYWQgZXJyb3IhIQoAcgBFcnJvciBvcGVuaW5nIGZpbGUgJyVzJzogACVzJXMKACVkAAojIyMgU3VyZmFjZSBOby4lZCAjIyMKACVzACAgUmVhZCBJbWFnZVNldC4KAEVycm9yIG9wZW5pbmcgZmlsZSAnJXMuaXNldCcuCgAgICAgZW5kLgoAICBSZWFkIEZlYXR1cmVTZXQuCgBFcnJvciBvcGVuaW5nIGZpbGUgJyVzLmZzZXQnLgoAICBSZWFkIE1hcmtlclNldC4KAG1yawBFcnJvciBvcGVuaW5nIGZpbGUgJyVzLm1yaycuCgAlZiAlZiAlZiAlZgBUcmFuc2Zvcm1hdGlvbiBtYXRyaXggcmVhZCBlcnJvciEhCgBqcGcAa3BtRGVsZXRlUmVmRGF0YVNldCgpOiBOVUxMIHJlZkRhdGFTZXRQdHIxL3JlZkRhdGFTZXRQdHIyLgoAa3BtRGVsZXRlUmVmRGF0YVNldCgpOiBOVUxMIHJlZkRhdGFTZXRQdHIuCgByYgBrcG1Mb2FkUmVmRGF0YVNldCgpOiBOVUxMIGZpbGVuYW1lL3JlZkRhdGFTZXRQdHIuCgBFcnJvciBsb2FkaW5nIEtQTSBkYXRhOiB1bmFibGUgdG8gb3BlbiBmaWxlICclcyVzJXMnIGZvciByZWFkaW5nLgoARXJyb3IgbG9hZGluZyBLUE0gZGF0YTogZXJyb3IgcmVhZGluZyBkYXRhLgoAa3BtQ2hhbmdlUGFnZU5vT2ZSZWZEYXRhU2V0KCk6IE5VTEwgcmVmRGF0YVNldC4KAGtwbVNldFJlZkRhdGFTZXQoKTogTlVMTCBrcG1IYW5kbGUvcmVmRGF0YVNldC4KAGtwbVNldFJlZkRhdGFTZXQoKTogcmVmRGF0YVNldC4KAHBvaW50cy0lZAoAa3BtTWF0Y2hpbmcoKTogTlVMTCBrcG1IYW5kbGUvaW5JbWFnZUx1bWEuCgBQYWdlWyVkXSAgcHJlOiUzZCwgYWZ0OiUzZCwgZXJyb3IgPSAlZgoAJXMuJXMAQXNzZXJ0aW9uIGBweXJhbWlkLT5zaXplKCkgPiAwYCBmYWlsZWQgaW4gAC9zcmMvZW1zY3JpcHRlbi9hcnRvb2xraXQ1L2xpYi9TUkMvS1BNL0ZyZWFrTWF0Y2hlci9kZXRlY3RvcnMvRG9HX3NjYWxlX2ludmFyaWFudF9kZXRlY3Rvci5jcHAAUHlyYW1pZCBpcyBub3QgYWxsb2NhdGVkAE9jdGF2ZSBvdXQgb2YgcmFuZ2UAU2NhbGUgb3V0IG9mIHJhbmdlAEFzc2VydGlvbiBgbUltYWdlcy5zaXplKCkgPiAwYCBmYWlsZWQgaW4gAExhcGxhY2lhbiBweXJhbWlkIGhhcyBub3QgYmVlbiBhbGxvY2F0ZWQAQXNzZXJ0aW9uIGBweXJhbWlkLT5udW1PY3RhdmVzKCkgPiAwYCBmYWlsZWQgaW4gAFB5cmFtaWQgZG9lcyBub3QgY29udGFpbiBhbnkgbGV2ZWxzAEFzc2VydGlvbiBgZHluYW1pY19jYXN0PGNvbnN0IEJpbm9taWFsUHlyYW1pZDMyZio+KHB5cmFtaWQpYCBmYWlsZWQgaW4gAE9ubHkgYmlub21pYWwgcHlyYW1pZCBpcyBzdXBwb3J0ZWQAQXNzZXJ0aW9uIGBkLnR5cGUoKSA9PSBJTUFHRV9GMzJgIGZhaWxlZCBpbiAAT25seSBGMzIgaW1hZ2VzIHN1cHBvcnRlZABBc3NlcnRpb24gYGltMS50eXBlKCkgPT0gSU1BR0VfRjMyYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgaW0yLnR5cGUoKSA9PSBJTUFHRV9GMzJgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGBkLmNoYW5uZWxzKCkgPT0gMWAgZmFpbGVkIGluIABPbmx5IHNpbmdsZSBjaGFubmVsIGltYWdlcyBzdXBwb3J0ZWQAQXNzZXJ0aW9uIGBpbTEuY2hhbm5lbHMoKSA9PSAxYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgaW0yLmNoYW5uZWxzKCkgPT0gMWAgZmFpbGVkIGluIABBc3NlcnRpb24gYGQud2lkdGgoKSA9PSBpbTIud2lkdGgoKWAgZmFpbGVkIGluIABJbWFnZXMgbXVzdCBoYXZlIHRoZSBzYW1lIHdpZHRoAEFzc2VydGlvbiBgZC5oZWlnaHQoKSA9PSBpbTIuaGVpZ2h0KClgIGZhaWxlZCBpbiAASW1hZ2VzIG11c3QgaGF2ZSB0aGUgc2FtZSBoZWlnaHQAQXNzZXJ0aW9uIGBpbTEud2lkdGgoKSA9PSBpbTIud2lkdGgoKWAgZmFpbGVkIGluIABBc3NlcnRpb24gYGltMS5oZWlnaHQoKSA9PSBpbTIuaGVpZ2h0KClgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGByb3cgPCBtSGVpZ2h0YCBmYWlsZWQgaW4gAC9zcmMvZW1zY3JpcHRlbi9hcnRvb2xraXQ1L2xpYi9TUkMvS1BNL0ZyZWFrTWF0Y2hlci9mcmFtZXdvcmsvaW1hZ2UuaAByb3cgb3V0IG9mIGJvdW5kcwBONnZpc2lvbjI1R2F1c3NpYW5TY2FsZVNwYWNlUHlyYW1pZEUARG9HIFB5cmFtaWQATm9uLW1heCBzdXBwcmVzc2lvbgBTdWJwaXhlbABwcnVuZUZlYXR1cmVzAEZpbmQgT3JpZW50YXRpb25zAEFzc2VydGlvbiBgbUJ1Y2tldHMuc2l6ZSgpID09IG1OdW1CdWNrZXRzWGAgZmFpbGVkIGluIABCdWNrZXRzIGFyZSBub3QgYWxsb2NhdGVkAEFzc2VydGlvbiBgbUJ1Y2tldHNbMF0uc2l6ZSgpID09IG1OdW1CdWNrZXRzWWAgZmFpbGVkIGluIABBc3NlcnRpb24gYG1GZWF0dXJlUG9pbnRzLnNpemUoKSA8PSBtTWF4TnVtRmVhdHVyZVBvaW50c2AgZmFpbGVkIGluIABUb28gbWFueSBmZWF0dXJlIHBvaW50cwBBc3NlcnRpb24gYGJ1Y2tldFswXS5maXJzdCA+PSBidWNrZXRbbl0uZmlyc3RgIGZhaWxlZCBpbiAAbnRoX2VsZW1lbnQgZmFpbGVkAEFzc2VydGlvbiBga3Auc2NhbGUgPCBtTGFwbGFjaWFuUHlyYW1pZC5udW1TY2FsZVBlck9jdGF2ZSgpYCBmYWlsZWQgaW4gAEZlYXR1cmUgcG9pbnQgc2NhbGUgaXMgb3V0IG9mIGJvdW5kcwBBc3NlcnRpb24gYGtwLnNjb3JlID09IGxhcDEuZ2V0PGZsb2F0Pih5KVt4XWAgZmFpbGVkIGluIABTY29yZSBpcyBub3QgY29uc2lzdGVudCB3aXRoIHRoZSBEb0cgaW1hZ2UAQXNzZXJ0aW9uIGBsYXAwLmhlaWdodCgpID09IGxhcDEuaGVpZ2h0KCkgPT0gbGFwMi5oZWlnaHQoKWAgZmFpbGVkIGluIAAvc3JjL2Vtc2NyaXB0ZW4vYXJ0b29sa2l0NS9saWIvU1JDL0tQTS9GcmVha01hdGNoZXIvZGV0ZWN0b3JzL0RvR19zY2FsZV9pbnZhcmlhbnRfZGV0ZWN0b3IuaABXaWR0aC9oZWlnaHQgYXJlIG5vdCBjb25zaXN0ZW50AEFzc2VydGlvbiBgKGxhcDAuaGVpZ2h0KCkgPT0gbGFwMS5oZWlnaHQoKSkgJiYgKChsYXAxLmhlaWdodCgpPj4xKSA9PSBsYXAyLmhlaWdodCgpKWAgZmFpbGVkIGluIABBc3NlcnRpb24gYCgobGFwMC53aWR0aCgpPj4xKSA9PSBsYXAxLndpZHRoKCkpICYmIChsYXAxLndpZHRoKCkgPT0gbGFwMi53aWR0aCgpKWAgZmFpbGVkIGluIABJbWFnZSBzaXplcyBhcmUgaW5jb25zaXN0ZW50AEFzc2VydGlvbiBgKHgtMSkgPj0gMCAmJiAoeCsxKSA8IGxhcDEud2lkdGgoKWAgZmFpbGVkIGluIAB4IG91dCBvZiBib3VuZHMAQXNzZXJ0aW9uIGAoeS0xKSA+PSAwICYmICh5KzEpIDwgbGFwMS5oZWlnaHQoKWAgZmFpbGVkIGluIAB5IG91dCBvZiBib3VuZHMAQXNzZXJ0aW9uIGAobGFwMC53aWR0aCgpPj4xKSA9PSBsYXAxLndpZHRoKClgIGZhaWxlZCBpbiAASW1hZ2UgZGltZW5zaW9ucyBpbmNvbnNpc3RlbnQAQXNzZXJ0aW9uIGAobGFwMC53aWR0aCgpPj4xKSA9PSBsYXAyLndpZHRoKClgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGAobGFwMC5oZWlnaHQoKT4+MSkgPT0gbGFwMS5oZWlnaHQoKWAgZmFpbGVkIGluIABBc3NlcnRpb24gYChsYXAwLmhlaWdodCgpPj4xKSA9PSBsYXAyLmhlaWdodCgpYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgKGludClzdGQ6OmZsb29yKHgpID09IChpbnQpeGAgZmFpbGVkIGluIAAvc3JjL2Vtc2NyaXB0ZW4vYXJ0b29sa2l0NS9saWIvU1JDL0tQTS9GcmVha01hdGNoZXIvZGV0ZWN0b3JzL2ludGVycG9sYXRlLmgAZmxvb3IoKSBhbmQgY2FzdCBub3QgdGhlIHNhbWUAQXNzZXJ0aW9uIGAoaW50KXN0ZDo6Zmxvb3IoeSkgPT0gKGludCl5YCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgeXAgPj0gMCAmJiB5cCA8IGhlaWdodGAgZmFpbGVkIGluIAB5cCBvdXQgb2YgYm91bmRzAEFzc2VydGlvbiBgeXBfcGx1c18xID49IDAgJiYgeXBfcGx1c18xIDwgaGVpZ2h0YCBmYWlsZWQgaW4gAHlwX3BsdXNfMSBvdXQgb2YgYm91bmRzAEFzc2VydGlvbiBgeHAgPj0gMCAmJiB4cCA8IHdpZHRoYCBmYWlsZWQgaW4gAHhwIG91dCBvZiBib3VuZHMAQXNzZXJ0aW9uIGB4cF9wbHVzXzEgPj0gMCAmJiB4cF9wbHVzXzEgPCB3aWR0aGAgZmFpbGVkIGluIAB4cF9wbHVzXzEgb3V0IG9mIGJvdW5kcwBBc3NlcnRpb24gYHcwID49IDAgJiYgdzAgPD0gMS4wMDAxYCBmYWlsZWQgaW4gAE91dCBvZiByYW5nZQBBc3NlcnRpb24gYHcxID49IDAgJiYgdzEgPD0gMS4wMDAxYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgdzIgPj0gMCAmJiB3MiA8PSAxLjAwMDFgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGB3MyA+PSAwICYmIHczIDw9IDEuMDAwMWAgZmFpbGVkIGluIABBc3NlcnRpb24gYCh3MCt3MSt3Mit3MykgPD0gMS4wMDAxYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgKHgtMSkgPj0gMCAmJiAoeCsxKSA8IGltLndpZHRoKClgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGAoeS0xKSA+PSAwICYmICh5KzEpIDwgaW0uaGVpZ2h0KClgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGBsYXAwLndpZHRoKCkgPT0gbGFwMS53aWR0aCgpYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgbGFwMC5oZWlnaHQoKSA9PSBsYXAxLmhlaWdodCgpYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgeF9kaXZfMi0wLjVmID49IDBgIGZhaWxlZCBpbiAAeF9kaXZfMiBvdXQgb2YgYm91bmRzIG91dCBvZiBib3VuZHMgZm9yIGludGVycG9sYXRpb24AQXNzZXJ0aW9uIGB5X2Rpdl8yLTAuNWYgPj0gMGAgZmFpbGVkIGluIAB5X2Rpdl8yIG91dCBvZiBib3VuZHMgb3V0IG9mIGJvdW5kcyBmb3IgaW50ZXJwb2xhdGlvbgBBc3NlcnRpb24gYHhfZGl2XzIrMC41ZiA8IGxhcDIud2lkdGgoKWAgZmFpbGVkIGluIABBc3NlcnRpb24gYHlfZGl2XzIrMC41ZiA8IGxhcDIuaGVpZ2h0KClgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGBsYXAwLndpZHRoKCkgPT0gbGFwMi53aWR0aCgpYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgbGFwMC5oZWlnaHQoKSA9PSBsYXAyLmhlaWdodCgpYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgaW0wLmhlaWdodCgpID09IGltMS5oZWlnaHQoKWAgZmFpbGVkIGluIABIZWlnaHQgaXMgaW5jb25zaXN0ZW50AEFzc2VydGlvbiBgaW0wLmhlaWdodCgpID09IGltMi5oZWlnaHQoKWAgZmFpbGVkIGluIABBc3NlcnRpb24gYChpbTEuaGVpZ2h0KCk+PjEpID09IGltMi5oZWlnaHQoKWAgZmFpbGVkIGluIABBc3NlcnRpb24gYChpbTAuaGVpZ2h0KCk+PjEpID09IGltMS5oZWlnaHQoKWAgZmFpbGVkIGluIABBc3NlcnRpb24gYChpbTAuaGVpZ2h0KCk+PjEpID09IGltMi5oZWlnaHQoKWAgZmFpbGVkIGluIABBc3NlcnRpb24gYGluZGV4IDwgbUltYWdlcy5zaXplKClgIGZhaWxlZCBpbiAASW5kZXggaXMgb3V0IG9mIHJhbmdlAE42dmlzaW9uMThCaW5vbWlhbFB5cmFtaWQzMmZFAEFzc2VydGlvbiBgd2lkdGggPj0gNWAgZmFpbGVkIGluIAAvc3JjL2Vtc2NyaXB0ZW4vYXJ0b29sa2l0NS9saWIvU1JDL0tQTS9GcmVha01hdGNoZXIvZGV0ZWN0b3JzL2dhdXNzaWFuX3NjYWxlX3NwYWNlX3B5cmFtaWQuY3BwAEltYWdlIGlzIHRvbyBzbWFsbABBc3NlcnRpb24gYGhlaWdodCA+PSA1YCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgaW1hZ2UudHlwZSgpID09IElNQUdFX1VJTlQ4YCBmYWlsZWQgaW4gAEltYWdlIG11c3QgYmUgZ3JheXNjYWxlAEFzc2VydGlvbiBgaW1hZ2UuY2hhbm5lbHMoKSA9PSAxYCBmYWlsZWQgaW4gAEltYWdlIG11c3QgaGF2ZSAxIGNoYW5uZWwAQXNzZXJ0aW9uIGBtUHlyYW1pZC5zaXplKCkgPT0gbU51bU9jdGF2ZXMqbU51bVNjYWxlc1Blck9jdGF2ZWAgZmFpbGVkIGluIABQeXJhbWlkIGhhcyBub3QgYmVlbiBhbGxvY2F0ZWQgeWV0AEFzc2VydGlvbiBgaW1hZ2Uud2lkdGgoKSA9PSBtUHlyYW1pZFswXS53aWR0aCgpYCBmYWlsZWQgaW4gAEltYWdlIG9mIHdyb25nIHNpemUgZm9yIHB5cmFtaWQAQXNzZXJ0aW9uIGBpbWFnZS5oZWlnaHQoKSA9PSBtUHlyYW1pZFswXS5oZWlnaHQoKWAgZmFpbGVkIGluIABBc3NlcnRpb24gYGRzdC50eXBlKCkgPT0gSU1BR0VfRjMyYCBmYWlsZWQgaW4gAERlc3RpbmF0aW9uIGltYWdlIHNob3VsZCBiZSBhIGZsb2F0AFVua25vd24gaW1hZ2UgdHlwZQBVbnN1cHBvcnRlZCBpbWFnZSB0eXBlAE42dmlzaW9uOUV4Y2VwdGlvbkUAQXNzZXJ0aW9uIGBpbS53aWR0aCgpID09IGltLnN0ZXAoKS9zaXplb2YoZmxvYXQpYCBmYWlsZWQgaW4gAC9zcmMvZW1zY3JpcHRlbi9hcnRvb2xraXQ1L2xpYi9TUkMvS1BNL0ZyZWFrTWF0Y2hlci9kZXRlY3RvcnMvb3JpZW50YXRpb25fYXNzaWdubWVudC5jcHAAU3RlcCBzaXplIG11c3QgYmUgZXF1YWwgdG8gd2lkdGggZm9yIG5vdwBBc3NlcnRpb24gYHggPj0gMGAgZmFpbGVkIGluIAB4IG11c3QgYmUgcG9zaXRpdmUAQXNzZXJ0aW9uIGB4IDwgbUdyYWRpZW50c1tvY3RhdmUqbU51bVNjYWxlc1Blck9jdGF2ZStzY2FsZV0ud2lkdGgoKWAgZmFpbGVkIGluIAB4IG11c3QgYmUgbGVzcyB0aGFuIHRoZSBpbWFnZSB3aWR0aABBc3NlcnRpb24gYHkgPj0gMGAgZmFpbGVkIGluIAB5IG11c3QgYmUgcG9zaXRpdmUAQXNzZXJ0aW9uIGB5IDwgbUdyYWRpZW50c1tvY3RhdmUqbU51bVNjYWxlc1Blck9jdGF2ZStzY2FsZV0uaGVpZ2h0KClgIGZhaWxlZCBpbiAAeSBtdXN0IGJlIGxlc3MgdGhhbiB0aGUgaW1hZ2UgaGVpZ2h0AEFzc2VydGlvbiBgZy5jaGFubmVscygpID09IDJgIGZhaWxlZCBpbiAATnVtYmVyIG9mIGNoYW5uZWxzIHNob3VsZCBiZSAyAEFzc2VydGlvbiBgbWF4X2hlaWdodCA+IDBgIGZhaWxlZCBpbiAATWF4aW11bSBiaW4gc2hvdWxkIGJlIHBvc2l0aXZlAEFzc2VydGlvbiBgaGlzdCAhPSBOVUxMYCBmYWlsZWQgaW4gAC9zcmMvZW1zY3JpcHRlbi9hcnRvb2xraXQ1L2xpYi9TUkMvS1BNL0ZyZWFrTWF0Y2hlci9kZXRlY3RvcnMvb3JpZW50YXRpb25fYXNzaWdubWVudC5oAEhpc3RvZ3JhbSBwb2ludGVyIGlzIE5VTEwAQXNzZXJ0aW9uIGAoZmJpbiswLjVmKSA+IDAgJiYgKGZiaW4tMC41ZikgPCBudW1fYmluc2AgZmFpbGVkIGluIABEZWNpbWFsIGJpbiBwb3NpdGlvbiBpbmRleCBvdXQgb2YgcmFuZ2UAQXNzZXJ0aW9uIGBtYWduaXR1ZGUgPj0gMGAgZmFpbGVkIGluIABNYWduaXR1ZGUgY2Fubm90IGJlIG5lZ2F0aXZlAEFzc2VydGlvbiBgbnVtX2JpbnMgPj0gMGAgZmFpbGVkIGluIABOdW1iZXIgYmlucyBtdXN0IGJlIHBvc2l0aXZlAEFzc2VydGlvbiBgdzEgPj0gMGAgZmFpbGVkIGluIAB3MSBtdXN0IGJlIHBvc2l0aXZlAEFzc2VydGlvbiBgdzIgPj0gMGAgZmFpbGVkIGluIAB3MiBtdXN0IGJlIHBvc2l0aXZlAEFzc2VydGlvbiBgYjEgPj0gMCAmJiBiMSA8IG51bV9iaW5zYCBmYWlsZWQgaW4gAGIxIGJpbiBpbmRleCBvdXQgb2YgcmFuZ2UAQXNzZXJ0aW9uIGBiMiA+PSAwICYmIGIyIDwgbnVtX2JpbnNgIGZhaWxlZCBpbiAAYjIgYmluIGluZGV4IG91dCBvZiByYW5nZQBJRCBhbHJlYWR5IGV4aXN0cwBCdWlsZCBQeXJhbWlkAEV4dHJhY3QgRmVhdHVyZXMAQXNzZXJ0aW9uIGBhc3NpZ25tZW50LnNpemUoKSA9PSBudW1faW5kaWNlc2AgZmFpbGVkIGluIAAvc3JjL2Vtc2NyaXB0ZW4vYXJ0b29sa2l0NS9saWIvU1JDL0tQTS9GcmVha01hdGNoZXIvbWF0Y2hlcnMvYmluYXJ5X2hpZXJhcmNoaWNhbF9jbHVzdGVyaW5nLmgAQXNzaWdubWVudCBzaXplIHdyb25nAEFzc2VydGlvbiBgYXNzaWdubWVudFtpXSAhPSAtMWAgZmFpbGVkIGluIABBc3NpZ25tZW50IGlzIGludmFsaWQAQXNzZXJ0aW9uIGBhc3NpZ25tZW50W2ldIDwgbnVtX2luZGljZXNgIGZhaWxlZCBpbiAAQXNzaWdubWVudCBvdXQgb2YgcmFuZ2UAQXNzZXJ0aW9uIGBpbmRpY2VzW2Fzc2lnbm1lbnRbaV1dIDwgbnVtX2ZlYXR1cmVzYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgaXQtPnNlY29uZC5zaXplKCkgIT0gMGAgZmFpbGVkIGluIABDbHVzdGVyIG11c3QgaGF2ZSBhdGxlYXNldCAxIGZlYXR1cmUAQXNzZXJ0aW9uIGBtSyA9PSBtQ2VudGVycy5zaXplKClgIGZhaWxlZCBpbiAAL3NyYy9lbXNjcmlwdGVuL2FydG9vbGtpdDUvbGliL1NSQy9LUE0vRnJlYWtNYXRjaGVyL21hdGNoZXJzL2ttZWRvaWRzLmgAayBzaG91bGQgbWF0Y2ggdGhlIG51bWJlciBvZiBjbHVzdGVyIGNlbnRlcnMAQXNzZXJ0aW9uIGBudW1fZmVhdHVyZXMgPiAwYCBmYWlsZWQgaW4gAE51bWJlciBvZiBmZWF0dXJlcyBtdXN0IGJlIHBvc2l0aXZlAEFzc2VydGlvbiBgbnVtX2luZGljZXMgPD0gbnVtX2ZlYXR1cmVzYCBmYWlsZWQgaW4gAE1vcmUgaW5kaWNlcyB0aGFuIGZlYXR1cmVzAEFzc2VydGlvbiBgbnVtX2luZGljZXMgPj0gbUtgIGZhaWxlZCBpbiAATm90IGVub3VnaCBmZWF0dXJlcwBBc3NpZ25tZW50IHNpemUgaXMgaW5jb3JyZWN0AEFzc2VydGlvbiBgbnVtX2NlbnRlcnMgPiAwYCBmYWlsZWQgaW4gAFRoZXJlIG11c3QgYmUgYXQgbGVhc3QgMSBjZW50ZXIAL3NyYy9lbXNjcmlwdGVuL2FydG9vbGtpdDUvbGliL1NSQy9LUE0vRnJlYWtNYXRjaGVyL21hdGNoZXJzL3Zpc3VhbF9kYXRhYmFzZS5oAEFzc2VydGlvbiBgZGV0ZWN0b3JgIGZhaWxlZCBpbiAARGV0ZWN0b3IgaXMgTlVMTABBc3NlcnRpb24gYHB5cmFtaWQtPmltYWdlcygpLnNpemUoKSA+IDBgIGZhaWxlZCBpbiAAUHlyYW1pZCBpcyBlbXB0eQBBc3NlcnRpb24gYHB5cmFtaWQtPmltYWdlcygpWzBdLndpZHRoKCkgPT0gZGV0ZWN0b3ItPndpZHRoKClgIGZhaWxlZCBpbiAAUHlyYW1pZCBhbmQgZGV0ZWN0b3Igc2l6ZSBtaXNtYXRjaABBc3NlcnRpb24gYHB5cmFtaWQtPmltYWdlcygpWzBdLmhlaWdodCgpID09IGRldGVjdG9yLT5oZWlnaHQoKWAgZmFpbGVkIGluIABOU3QzX18yMTRkZWZhdWx0X2RlbGV0ZUlONnZpc2lvbjhLZXlmcmFtZUlMaTk2RUVFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX3BvaW50ZXJJUE42dmlzaW9uOEtleWZyYW1lSUxpOTZFRUVOU18xNGRlZmF1bHRfZGVsZXRlSVMzX0VFTlNfOWFsbG9jYXRvcklTM19FRUVFAFslc10gWyVzXSBbJXNdIDogRm91bmQgJWQgZmVhdHVyZXMgaW4gcXVlcnkAYm9vbCB2aXNpb246OlZpc3VhbERhdGFiYXNlPHZpc2lvbjo6RlJFQUtFeHRyYWN0b3IsIHZpc2lvbjo6QmluYXJ5RmVhdHVyZVN0b3JlLCB2aXNpb246OkJpbmFyeUZlYXR1cmVNYXRjaGVyPDk2PiA+OjpxdWVyeShjb25zdCB2aXNpb246OkdhdXNzaWFuU2NhbGVTcGFjZVB5cmFtaWQgKikgW0ZFQVRVUkVfRVhUUkFDVE9SID0gdmlzaW9uOjpGUkVBS0V4dHJhY3RvciwgU1RPUkUgPSB2aXNpb246OkJpbmFyeUZlYXR1cmVTdG9yZSwgTUFUQ0hFUiA9IHZpc2lvbjo6QmluYXJ5RmVhdHVyZU1hdGNoZXI8OTY+XQBGaW5kIE1hdGNoZXMgKDEpAEhvdWdoIFZvdGluZyAoMSkARmluZCBIb3VnaCBNYXRjaGVzICgxKQBFc3RpbWF0ZSBIb21vZ3JhcGh5ICgxKQBGaW5kIElubGllcnMgKDEpAEZpbmQgTWF0Y2hlcyAoMikASG91Z2ggVm90aW5nICgyKQBGaW5kIEhvdWdoIE1hdGNoZXMgKDIpAEVzdGltYXRlIEhvbW9ncmFwaHkgKDIpAEZpbmQgSW5saWVycyAoMikAQXNzZXJ0aW9uIGAwYCBmYWlsZWQgaW4gAC9zcmMvZW1zY3JpcHRlbi9hcnRvb2xraXQ1L2xpYi9TUkMvS1BNL0ZyZWFrTWF0Y2hlci9tYXRjaGVycy9mZWF0dXJlX21hdGNoZXItaW5saW5lLmgARmFpbGVkIHRvIGNvbXB1dGUgbWF0cml4IGludmVyc2UAQXNzZXJ0aW9uIGBiZXN0X2luZGV4ICE9IHN0ZDo6bnVtZXJpY19saW1pdHM8c2l6ZV90Pjo6bWF4KClgIGZhaWxlZCBpbiAAU29tZXRoaW5nIHN0cmFuZ2UAQXNzZXJ0aW9uIGBtTWF0Y2hlcy5zaXplKCkgPD0gZmVhdHVyZXMxLT5zaXplKClgIGZhaWxlZCBpbiAATnVtYmVyIG9mIG1hdGNoZXMgc2hvdWxkIGJlIGxvd2VyAEFzc2VydGlvbiBgaHlwLnNpemUoKSA+PSA5Km1heF9udW1faHlwb3RoZXNlc2AgZmFpbGVkIGluIAAvc3JjL2Vtc2NyaXB0ZW4vYXJ0b29sa2l0NS9saWIvU1JDL0tQTS9GcmVha01hdGNoZXIvaG9tb2dyYXBoeV9lc3RpbWF0aW9uL3JvYnVzdF9ob21vZ3JhcGh5LmgAaHlwIHZlY3RvciBzaG91bGQgYmUgb2Ygc2l6ZSA5Km1heF9udW1faHlwb3RoZXNlcwBBc3NlcnRpb24gYHRtcF9pLnNpemUoKSA+PSBudW1fcG9pbnRzYCBmYWlsZWQgaW4gAHRtcF9pIHZlY3RvciBzaG91bGQgYmUgb2Ygc2l6ZSBudW1fcG9pbnRzAEFzc2VydGlvbiBgaHlwX2Nvc3RzLnNpemUoKSA+PSBtYXhfbnVtX2h5cG90aGVzZXNgIGZhaWxlZCBpbiAAaHlwX2Nvc3RzIHZlY3RvciBzaG91bGQgYmUgb2Ygc2l6ZSBtYXhfbnVtX2h5cG90aGVzZXMAQXNzZXJ0aW9uIGBuIDw9IGluX21hdGNoZXMuc2l6ZSgpYCBmYWlsZWQgaW4gAFNob3VsZCBiZSB0aGUgc2FtZQBBc3NlcnRpb24gYGRpc3RCaW5BbmdsZSA+PSAwYCBmYWlsZWQgaW4gAGRpc3RCaW5BbmdsZSBtdXN0IG5vdCBiZSBuZWdhdGl2ZQBBc3NlcnRpb24gYG1Sb290LmdldCgpYCBmYWlsZWQgaW4gAFJvb3QgY2Fubm90IGJlIE5VTEwAQXNzZXJ0aW9uIGBtaW5pICE9IC0xYCBmYWlsZWQgaW4gAE1pbmltdW0gaW5kZXggbm90IHNldABBc3NlcnRpb24gYHggPj0gbU1pblhgIGZhaWxlZCBpbiAAL3NyYy9lbXNjcmlwdGVuL2FydG9vbGtpdDUvbGliL1NSQy9LUE0vRnJlYWtNYXRjaGVyL21hdGNoZXJzL2hvdWdoX3NpbWlsYXJpdHlfdm90aW5nLmgAeCBvdXQgb2YgcmFuZ2UAQXNzZXJ0aW9uIGB4IDwgbU1heFhgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGB5ID49IG1NaW5ZYCBmYWlsZWQgaW4gAHkgb3V0IG9mIHJhbmdlAEFzc2VydGlvbiBgeSA8IG1NYXhZYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgYW5nbGUgPiAtUElgIGZhaWxlZCBpbiAAYW5nbGUgb3V0IG9mIHJhbmdlAEFzc2VydGlvbiBgYW5nbGUgPD0gUElgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGBzY2FsZSA+PSBtTWluU2NhbGVgIGZhaWxlZCBpbiAAc2NhbGUgb3V0IG9mIHJhbmdlAEFzc2VydGlvbiBgc2NhbGUgPCBtTWF4U2NhbGVgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGBpbmRleCA+PSAwYCBmYWlsZWQgaW4gAGluZGV4IG91dCBvZiByYW5nZQBBc3NlcnRpb24gYGJpblggPj0gMGAgZmFpbGVkIGluIABiaW5YIG91dCBvZiByYW5nZQBBc3NlcnRpb24gYGJpblggPCBtTnVtWEJpbnNgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGBiaW5ZID49IDBgIGZhaWxlZCBpbiAAYmluWSBvdXQgb2YgcmFuZ2UAQXNzZXJ0aW9uIGBiaW5ZIDwgbU51bVlCaW5zYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgYmluQW5nbGUgPj0gMGAgZmFpbGVkIGluIABiaW5BbmdsZSBvdXQgb2YgcmFuZ2UAQXNzZXJ0aW9uIGBiaW5BbmdsZSA8IG1OdW1BbmdsZUJpbnNgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGBiaW5TY2FsZSA+PSAwYCBmYWlsZWQgaW4gAGJpblNjYWxlIG91dCBvZiByYW5nZQBBc3NlcnRpb24gYGJpblNjYWxlIDwgbU51bVNjYWxlQmluc2AgZmFpbGVkIGluIABBc3NlcnRpb24gYGluZGV4IDw9IChiaW5YICsgYmluWSptTnVtWEJpbnMgKyBiaW5BbmdsZSptTnVtWEJpbnMqbU51bVlCaW5zICsgYmluU2NhbGUqbU51bVhCaW5zKm1OdW1ZQmlucyptTnVtQW5nbGVCaW5zKWAgZmFpbGVkIGluIABBc3NlcnRpb24gYHNpemUgPiAwYCBmYWlsZWQgaW4gAC9zcmMvZW1zY3JpcHRlbi9hcnRvb2xraXQ1L2xpYi9TUkMvS1BNL0ZyZWFrTWF0Y2hlci9tYXRjaGVycy9ob3VnaF9zaW1pbGFyaXR5X3ZvdGluZy5jcHAAc2l6ZSBtdXN0IGJlIHBvc2l0aXZlAEFzc2VydGlvbiBgbVJlZkltYWdlV2lkdGggPiAwYCBmYWlsZWQgaW4gAHdpZHRoIG11c3QgYmUgcG9zaXRpdmUAQXNzZXJ0aW9uIGBtUmVmSW1hZ2VIZWlnaHQgPiAwYCBmYWlsZWQgaW4gAGhlaWdodCBtdXN0IGJlIHBvc2l0aXZlAEFzc2VydGlvbiBgbiA+IDBgIGZhaWxlZCBpbiAAL3NyYy9lbXNjcmlwdGVuL2FydG9vbGtpdDUvbGliL1NSQy9LUE0vRnJlYWtNYXRjaGVyL3V0aWxzL3BhcnRpYWxfc29ydC5oAG4gbXVzdCBiZSBwb3NpdGl2ZQBBc3NlcnRpb24gYGsgPiAwYCBmYWlsZWQgaW4gAGsgbXVzdCBiZSBwb3NpdGl2ZQBBc3NlcnRpb24gYHB5cmFtaWRgIGZhaWxlZCBpbiAAL3NyYy9lbXNjcmlwdGVuL2FydG9vbGtpdDUvbGliL1NSQy9LUE0vRnJlYWtNYXRjaGVyL21hdGNoZXJzL2ZyZWFrLmgAUHlyYW1pZCBpcyBOVUxMAEFzc2VydGlvbiBgc3RvcmUuc2l6ZSgpID09IHBvaW50cy5zaXplKClgIGZhaWxlZCBpbiAARmVhdHVyZSBzdG9yZSBoYXMgbm90IGJlZW4gYWxsb2NhdGVkAEFzc2VydGlvbiBgbnVtX3BvaW50cyA9PSBwb2ludHMuc2l6ZSgpYCBmYWlsZWQgaW4gAFNob3VsZCBiZSBzYW1lIHNpemUAQXNzZXJ0aW9uIGBvY3RhdmUgPj0gMGAgZmFpbGVkIGluIAAvc3JjL2Vtc2NyaXB0ZW4vYXJ0b29sa2l0NS9saWIvU1JDL0tQTS9GcmVha01hdGNoZXIvZGV0ZWN0b3JzL2dhdXNzaWFuX3NjYWxlX3NwYWNlX3B5cmFtaWQuaABPY3RhdmUgbXVzdCBiZSBwb3NpdGl2ZQBBc3NlcnRpb24gYG9jdGF2ZSA8IG1OdW1PY3RhdmVzYCBmYWlsZWQgaW4gAE9jdGF2ZSBtdXN0IGJlIGxlc3MgdGhhbiBudW1iZXIgb2Ygb2N0YXZlcwBBc3NlcnRpb24gYHNjYWxlID49IDBgIGZhaWxlZCBpbiAAU2NhbGUgbXVzdCBiZSBwb3NpdGl2ZQBBc3NlcnRpb24gYHNjYWxlIDwgbU51bVNjYWxlc1Blck9jdGF2ZWAgZmFpbGVkIGluIABTY2FsZSBtdXN0IGJlIGxlc3MgdGhhbiBudW1iZXIgb2Ygc2NhbGUgcGVyIG9jdGF2ZQAlbS0lZC0lWS0lSC0lTS0lUwBBc3NlcnRpb24gYHdpZHRoID4gMGAgZmFpbGVkIGluIAAvc3JjL2Vtc2NyaXB0ZW4vYXJ0b29sa2l0NS9saWIvU1JDL0tQTS9GcmVha01hdGNoZXIvZnJhbWV3b3JrL2ltYWdlLmNwcABXaWR0aCBjYW5ub3QgYmUgemVybwBBc3NlcnRpb24gYGhlaWdodCA+IDBgIGZhaWxlZCBpbiAASGVpZ2h0IGNhbm5vdCBiZSB6ZXJvAEFzc2VydGlvbiBgc3RlcCA+PSB3aWR0aGAgZmFpbGVkIGluIABTdGVwIG11c3QgYmUgZ3JlYXRlciB0aGFuIG9yIGVxdWFsIHRoZSB3aWR0aABBc3NlcnRpb24gYGNoYW5uZWxzID4gMGAgZmFpbGVkIGluIABOdW1iZXIgb2YgY2hhbm5lbHMgY2Fubm90IGJlIHplcm8AQXNzZXJ0aW9uIGBtRGF0YS5nZXQoKWAgZmFpbGVkIGluIABEYXRhIHBvaW50ZXIgaXMgTlVMTABOU3QzX18yMTRkZWZhdWx0X2RlbGV0ZUloRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX3BvaW50ZXJJUGhOU18xNGRlZmF1bHRfZGVsZXRlSWhFRU5TXzlhbGxvY2F0b3JJaEVFRUUASW52YWxpZCBpbWFnZSB0eXBlADE2TnVsbEFycmF5RGVsZXRlckloRQBOU3QzX18yMjBfX3NoYXJlZF9wdHJfcG9pbnRlcklQaDE2TnVsbEFycmF5RGVsZXRlckloRU5TXzlhbGxvY2F0b3JJaEVFRUUAQXNzZXJ0aW9uIGBtU3RhcnRUaW1lID49IDBgIGZhaWxlZCBpbiAAL3NyYy9lbXNjcmlwdGVuL2FydG9vbGtpdDUvbGliL1NSQy9LUE0vRnJlYWtNYXRjaGVyL2ZyYW1ld29yay90aW1lcnMuY3BwACBsaW5lIAA6IABDbG9jayBoYXMgbm90IGJlZW4gc3RhcnRlZABBc3NlcnRpb24gYG1TdG9wVGltZSA+PSAwYCBmYWlsZWQgaW4gAENsb2NrIGhhcyBub3QgYmVlbiBzdG9wcGVkAFslc10gWyVzXSBbJXNdIDogJXM6ICVmIG1zACBJTkZPICAAdmlzaW9uOjpTY29wZWRUaW1lcjo6flNjb3BlZFRpbWVyKCkAc2V0dXAAdGVhcmRvd24Ac2V0dXBBUjIAX2FkZE1hcmtlcgBfYWRkTXVsdGlNYXJrZXIAX2FkZE5GVE1hcmtlcgBnZXRNdWx0aU1hcmtlck51bQBnZXRNdWx0aU1hcmtlckNvdW50AF9sb2FkQ2FtZXJhAHNldE1hcmtlckluZm9EaXIAc2V0TWFya2VySW5mb1ZlcnRleABnZXRUcmFuc01hdFNxdWFyZQBnZXRUcmFuc01hdFNxdWFyZUNvbnQAZ2V0VHJhbnNNYXRNdWx0aVNxdWFyZQBnZXRUcmFuc01hdE11bHRpU3F1YXJlUm9idXN0AGRldGVjdE1hcmtlcgBnZXRNYXJrZXJOdW0AZGV0ZWN0TkZUTWFya2VyAGdldE11bHRpRWFjaE1hcmtlcgBnZXRNYXJrZXIAZ2V0TkZUTWFya2VyAHNldERlYnVnTW9kZQBnZXREZWJ1Z01vZGUAZ2V0UHJvY2Vzc2luZ0ltYWdlAHNldExvZ0xldmVsAGdldExvZ0xldmVsAHNldFByb2plY3Rpb25OZWFyUGxhbmUAZ2V0UHJvamVjdGlvbk5lYXJQbGFuZQBzZXRQcm9qZWN0aW9uRmFyUGxhbmUAZ2V0UHJvamVjdGlvbkZhclBsYW5lAHNldFRocmVzaG9sZE1vZGUAZ2V0VGhyZXNob2xkTW9kZQBzZXRUaHJlc2hvbGQAZ2V0VGhyZXNob2xkAHNldFBhdHRlcm5EZXRlY3Rpb25Nb2RlAGdldFBhdHRlcm5EZXRlY3Rpb25Nb2RlAHNldFBhdHRSYXRpbwBnZXRQYXR0UmF0aW8Ac2V0TWF0cml4Q29kZVR5cGUAZ2V0TWF0cml4Q29kZVR5cGUAc2V0TGFiZWxpbmdNb2RlAGdldExhYmVsaW5nTW9kZQBzZXRJbWFnZVByb2NNb2RlAGdldEltYWdlUHJvY01vZGUARVJST1JfQVJDT05UUk9MTEVSX05PVF9GT1VORABFUlJPUl9NVUxUSU1BUktFUl9OT1RfRk9VTkQARVJST1JfTUFSS0VSX0lOREVYX09VVF9PRl9CT1VORFMAQVJfREVCVUdfRElTQUJMRQBBUl9ERUJVR19FTkFCTEUAQVJfREVGQVVMVF9ERUJVR19NT0RFAEFSX0xBQkVMSU5HX1dISVRFX1JFR0lPTgBBUl9MQUJFTElOR19CTEFDS19SRUdJT04AQVJfREVGQVVMVF9MQUJFTElOR19NT0RFAEFSX0RFRkFVTFRfTEFCRUxJTkdfVEhSRVNIAEFSX0lNQUdFX1BST0NfRlJBTUVfSU1BR0UAQVJfSU1BR0VfUFJPQ19GSUVMRF9JTUFHRQBBUl9ERUZBVUxUX0lNQUdFX1BST0NfTU9ERQBBUl9URU1QTEFURV9NQVRDSElOR19DT0xPUgBBUl9URU1QTEFURV9NQVRDSElOR19NT05PAEFSX01BVFJJWF9DT0RFX0RFVEVDVElPTgBBUl9URU1QTEFURV9NQVRDSElOR19DT0xPUl9BTkRfTUFUUklYAEFSX1RFTVBMQVRFX01BVENISU5HX01PTk9fQU5EX01BVFJJWABBUl9ERUZBVUxUX1BBVFRFUk5fREVURUNUSU9OX01PREUAQVJfVVNFX1RSQUNLSU5HX0hJU1RPUlkAQVJfTk9VU0VfVFJBQ0tJTkdfSElTVE9SWQBBUl9VU0VfVFJBQ0tJTkdfSElTVE9SWV9WMgBBUl9ERUZBVUxUX01BUktFUl9FWFRSQUNUSU9OX01PREUAQVJfTUFYX0xPT1BfQ09VTlQAQVJfTE9PUF9CUkVBS19USFJFU0gAQVJfTE9HX0xFVkVMX0RFQlVHAEFSX0xPR19MRVZFTF9JTkZPAEFSX0xPR19MRVZFTF9XQVJOAEFSX0xPR19MRVZFTF9FUlJPUgBBUl9MT0dfTEVWRUxfUkVMX0lORk8AQVJfTUFUUklYX0NPREVfM3gzAEFSX01BVFJJWF9DT0RFXzN4M19IQU1NSU5HNjMAQVJfTUFUUklYX0NPREVfM3gzX1BBUklUWTY1AEFSX01BVFJJWF9DT0RFXzR4NABBUl9NQVRSSVhfQ09ERV80eDRfQkNIXzEzXzlfMwBBUl9NQVRSSVhfQ09ERV80eDRfQkNIXzEzXzVfNQBBUl9MQUJFTElOR19USFJFU0hfTU9ERV9NQU5VQUwAQVJfTEFCRUxJTkdfVEhSRVNIX01PREVfQVVUT19NRURJQU4AQVJfTEFCRUxJTkdfVEhSRVNIX01PREVfQVVUT19PVFNVAEFSX0xBQkVMSU5HX1RIUkVTSF9NT0RFX0FVVE9fQURBUFRJVkUAQVJfTUFSS0VSX0lORk9fQ1VUT0ZGX1BIQVNFX05PTkUAQVJfTUFSS0VSX0lORk9fQ1VUT0ZGX1BIQVNFX1BBVFRFUk5fRVhUUkFDVElPTgBBUl9NQVJLRVJfSU5GT19DVVRPRkZfUEhBU0VfTUFUQ0hfR0VORVJJQwBBUl9NQVJLRVJfSU5GT19DVVRPRkZfUEhBU0VfTUFUQ0hfQ09OVFJBU1QAQVJfTUFSS0VSX0lORk9fQ1VUT0ZGX1BIQVNFX01BVENIX0JBUkNPREVfTk9UX0ZPVU5EAEFSX01BUktFUl9JTkZPX0NVVE9GRl9QSEFTRV9NQVRDSF9CQVJDT0RFX0VEQ19GQUlMAEFSX01BUktFUl9JTkZPX0NVVE9GRl9QSEFTRV9NQVRDSF9DT05GSURFTkNFAEFSX01BUktFUl9JTkZPX0NVVE9GRl9QSEFTRV9QT1NFX0VSUk9SAEFSX01BUktFUl9JTkZPX0NVVE9GRl9QSEFTRV9QT1NFX0VSUk9SX01VTFRJAEFSX01BUktFUl9JTkZPX0NVVE9GRl9QSEFTRV9IRVVSSVNUSUNfVFJPVUJMRVNPTUVfTUFUUklYX0NPREVTAGFsbG9jYXRvcjxUPjo6YWxsb2NhdGUoc2l6ZV90IG4pICduJyBleGNlZWRzIG1heGltdW0gc3VwcG9ydGVkIHNpemUASW1hZ2UgcHJvYy4gbW9kZSBzZXQgdG8gJWQuCgBMYWJlbGluZyBtb2RlIHNldCB0byAlZAoAdmlpZgBQYXR0ZXJuIHJhdGlvIHNpemUgc2V0IHRvICVmLgoAUGF0dGVybiBkZXRlY3Rpb24gbW9kZSBzZXQgdG8gJWQuCgBUaHJlc2hvbGQgc2V0IHRvICVkCgB2aWlpAFRocmVzaG9sZCBtb2RlIHNldCB0byAlZAoAZGlpAHZpaWQAaWkAdmlpAG9uLgBvZmYuAERlYnVnIG1vZGUgc2V0IHRvICVzCgBUcmFja2luZyBsb3N0LiAlZAoAVHJhY2tlZCBwYWdlICVkIChtYXggJWQpLgoAeyB2YXIgJGEgPSBhcmd1bWVudHM7IHZhciBpID0gMDsgaWYgKCFhcnRvb2xraXRbIk5GVE1hcmtlckluZm8iXSkgeyBhcnRvb2xraXRbIk5GVE1hcmtlckluZm8iXSA9ICh7IGlkOiAwLCBlcnJvcjogLTEsIGZvdW5kOiAwLCBwb3NlOiBbMCwwLDAsMCwgMCwwLDAsMCwgMCwwLDAsMF0gfSk7IH0gdmFyIG1hcmtlckluZm8gPSBhcnRvb2xraXRbIk5GVE1hcmtlckluZm8iXTsgbWFya2VySW5mb1siaWQiXSA9ICRhW2krK107IG1hcmtlckluZm9bImVycm9yIl0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJmb3VuZCJdID0gMTsgbWFya2VySW5mb1sicG9zZSJdWzBdID0gJGFbaSsrXTsgbWFya2VySW5mb1sicG9zZSJdWzFdID0gJGFbaSsrXTsgbWFya2VySW5mb1sicG9zZSJdWzJdID0gJGFbaSsrXTsgbWFya2VySW5mb1sicG9zZSJdWzNdID0gJGFbaSsrXTsgbWFya2VySW5mb1sicG9zZSJdWzRdID0gJGFbaSsrXTsgbWFya2VySW5mb1sicG9zZSJdWzVdID0gJGFbaSsrXTsgbWFya2VySW5mb1sicG9zZSJdWzZdID0gJGFbaSsrXTsgbWFya2VySW5mb1sicG9zZSJdWzddID0gJGFbaSsrXTsgbWFya2VySW5mb1sicG9zZSJdWzhdID0gJGFbaSsrXTsgbWFya2VySW5mb1sicG9zZSJdWzldID0gJGFbaSsrXTsgbWFya2VySW5mb1sicG9zZSJdWzEwXSA9ICRhW2krK107IG1hcmtlckluZm9bInBvc2UiXVsxMV0gPSAkYVtpKytdOyB9AHsgdmFyICRhID0gYXJndW1lbnRzOyB2YXIgaSA9IDA7IGlmICghYXJ0b29sa2l0WyJORlRNYXJrZXJJbmZvIl0pIHsgYXJ0b29sa2l0WyJORlRNYXJrZXJJbmZvIl0gPSAoeyBpZDogMCwgZXJyb3I6IC0xLCBmb3VuZDogMCwgcG9zZTogWzAsMCwwLDAsIDAsMCwwLDAsIDAsMCwwLDBdIH0pOyB9IHZhciBtYXJrZXJJbmZvID0gYXJ0b29sa2l0WyJORlRNYXJrZXJJbmZvIl07IG1hcmtlckluZm9bImlkIl0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJlcnJvciJdID0gLTE7IG1hcmtlckluZm9bImZvdW5kIl0gPSAwOyBtYXJrZXJJbmZvWyJwb3NlIl1bMF0gPSAwOyBtYXJrZXJJbmZvWyJwb3NlIl1bMV0gPSAwOyBtYXJrZXJJbmZvWyJwb3NlIl1bMl0gPSAwOyBtYXJrZXJJbmZvWyJwb3NlIl1bM10gPSAwOyBtYXJrZXJJbmZvWyJwb3NlIl1bNF0gPSAwOyBtYXJrZXJJbmZvWyJwb3NlIl1bNV0gPSAwOyBtYXJrZXJJbmZvWyJwb3NlIl1bNl0gPSAwOyBtYXJrZXJJbmZvWyJwb3NlIl1bN10gPSAwOyBtYXJrZXJJbmZvWyJwb3NlIl1bOF0gPSAwOyBtYXJrZXJJbmZvWyJwb3NlIl1bOV0gPSAwOyBtYXJrZXJJbmZvWyJwb3NlIl1bMTBdID0gMDsgbWFya2VySW5mb1sicG9zZSJdWzExXSA9IDA7IH0AeyB2YXIgJGEgPSBhcmd1bWVudHM7IHZhciBpID0gMTI7IGlmICghYXJ0b29sa2l0WyJtYXJrZXJJbmZvIl0pIHsgYXJ0b29sa2l0WyJtYXJrZXJJbmZvIl0gPSAoeyBwb3M6IFswLDBdLCBsaW5lOiBbWzAsMCwwXSwgWzAsMCwwXSwgWzAsMCwwXSwgWzAsMCwwXV0sIHZlcnRleDogW1swLDBdLCBbMCwwXSwgWzAsMF0sIFswLDBdXSB9KTsgfSB2YXIgbWFya2VySW5mbyA9IGFydG9vbGtpdFsibWFya2VySW5mbyJdOyBtYXJrZXJJbmZvWyJhcmVhIl0gPSAkMDsgbWFya2VySW5mb1siaWQiXSA9ICQxOyBtYXJrZXJJbmZvWyJpZFBhdHQiXSA9ICQyOyBtYXJrZXJJbmZvWyJpZE1hdHJpeCJdID0gJDM7IG1hcmtlckluZm9bImRpciJdID0gJDQ7IG1hcmtlckluZm9bImRpclBhdHQiXSA9ICQ1OyBtYXJrZXJJbmZvWyJkaXJNYXRyaXgiXSA9ICQ2OyBtYXJrZXJJbmZvWyJjZiJdID0gJDc7IG1hcmtlckluZm9bImNmUGF0dCJdID0gJDg7IG1hcmtlckluZm9bImNmTWF0cml4Il0gPSAkOTsgbWFya2VySW5mb1sicG9zIl1bMF0gPSAkMTA7IG1hcmtlckluZm9bInBvcyJdWzFdID0gJDExOyBtYXJrZXJJbmZvWyJsaW5lIl1bMF1bMF0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJsaW5lIl1bMF1bMV0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJsaW5lIl1bMF1bMl0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJsaW5lIl1bMV1bMF0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJsaW5lIl1bMV1bMV0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJsaW5lIl1bMV1bMl0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJsaW5lIl1bMl1bMF0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJsaW5lIl1bMl1bMV0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJsaW5lIl1bMl1bMl0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJsaW5lIl1bM11bMF0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJsaW5lIl1bM11bMV0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJsaW5lIl1bM11bMl0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJ2ZXJ0ZXgiXVswXVswXSA9ICRhW2krK107IG1hcmtlckluZm9bInZlcnRleCJdWzBdWzFdID0gJGFbaSsrXTsgbWFya2VySW5mb1sidmVydGV4Il1bMV1bMF0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJ2ZXJ0ZXgiXVsxXVsxXSA9ICRhW2krK107IG1hcmtlckluZm9bInZlcnRleCJdWzJdWzBdID0gJGFbaSsrXTsgbWFya2VySW5mb1sidmVydGV4Il1bMl1bMV0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJ2ZXJ0ZXgiXVszXVswXSA9ICRhW2krK107IG1hcmtlckluZm9bInZlcnRleCJdWzNdWzFdID0gJGFbaSsrXTsgbWFya2VySW5mb1siZXJyb3JDb3JyZWN0ZWQiXSA9ICRhW2krK107IH0AeyBpZiAoIWFydG9vbGtpdFsibXVsdGlFYWNoTWFya2VySW5mbyJdKSB7IGFydG9vbGtpdFsibXVsdGlFYWNoTWFya2VySW5mbyJdID0gKHt9KTsgfSB2YXIgbXVsdGlFYWNoTWFya2VyID0gYXJ0b29sa2l0WyJtdWx0aUVhY2hNYXJrZXJJbmZvIl07IG11bHRpRWFjaE1hcmtlclsndmlzaWJsZSddID0gJDA7IG11bHRpRWFjaE1hcmtlclsncGF0dElkJ10gPSAkMTsgbXVsdGlFYWNoTWFya2VyWydwYXR0VHlwZSddID0gJDI7IG11bHRpRWFjaE1hcmtlclsnd2lkdGgnXSA9ICQzOyB9AGlpaQBOU3QzX18yMTJiYXNpY19zdHJpbmdJY05TXzExY2hhcl90cmFpdHNJY0VFTlNfOWFsbG9jYXRvckljRUVFRQBOU3QzX18yMjFfX2Jhc2ljX3N0cmluZ19jb21tb25JTGIxRUVFAGxvYWRDYW1lcmEoKTogRXJyb3IgbG9hZGluZyBwYXJhbWV0ZXIgZmlsZSAlcyBmb3IgY2FtZXJhLgoAaWlpaQBBUlRvb2xLaXRKUygpOiBVbmFibGUgdG8gc2V0IHVwIE5GVCBtYXJrZXIuCgBSZWFkaW5nICVzLmZzZXQzCgBmc2V0MwBFcnJvciByZWFkaW5nIEtQTSBkYXRhIGZyb20gJXMuZnNldDMKACAgQXNzaWduZWQgcGFnZSBuby4gJWQuCgBFcnJvcjoga3BtQ2hhbmdlUGFnZU5vT2ZSZWZEYXRhU2V0CgBFcnJvcjoga3BtTWVyZ2VSZWZEYXRhU2V0CgAgIERvbmUuCgBSZWFkaW5nICVzLmZzZXQKAGZzZXQARXJyb3IgcmVhZGluZyBkYXRhIGZyb20gJXMuZnNldAoARXJyb3I6IGtwbVNldFJlZkRhdGFTZXQKAExvYWRpbmcgb2YgTkZUIGRhdGEgY29tcGxldGUuCgBBUlRvb2xLaXRKUygpOiBVbmFibGUgdG8gc2V0IHVwIEFSIG11bHRpbWFya2VyLgoAY29uZmlnIGRhdGEgbG9hZCBlcnJvciAhIQoAQVJUb29sS2l0SlMoKTogVW5hYmxlIHRvIHNldCB1cCBBUiBtYXJrZXIuCgBsb2FkTWFya2VyKCk6IEVycm9yIGxvYWRpbmcgcGF0dGVybiBmaWxlICVzLgoARXJyb3I6IGFyMkNyZWF0ZUhhbmRsZS4KAGlpaWlpAHNldHVwKCk6IEVycm9yOiBhclBhdHRDcmVhdGVIYW5kbGUuCgBBbGxvY2F0ZWQgdmlkZW9GcmFtZVNpemUgJWQKAHsgaWYgKCFhcnRvb2xraXRbImZyYW1lTWFsbG9jIl0pIHsgYXJ0b29sa2l0WyJmcmFtZU1hbGxvYyJdID0gKHt9KTsgfSB2YXIgZnJhbWVNYWxsb2MgPSBhcnRvb2xraXRbImZyYW1lTWFsbG9jIl07IGZyYW1lTWFsbG9jWyJmcmFtZXBvaW50ZXIiXSA9ICQxOyBmcmFtZU1hbGxvY1siZnJhbWVzaXplIl0gPSAkMjsgZnJhbWVNYWxsb2NbImNhbWVyYSJdID0gJDM7IGZyYW1lTWFsbG9jWyJ0cmFuc2Zvcm0iXSA9ICQ0OyBmcmFtZU1hbGxvY1sidmlkZW9MdW1hUG9pbnRlciJdID0gJDU7IH0AKioqIENhbWVyYSBQYXJhbWV0ZXIgcmVzaXplZCBmcm9tICVkLCAlZC4gKioqCgBzZXRDYW1lcmEoKTogRXJyb3I6IGFyUGFyYW1MVENyZWF0ZS4KAHNldENhbWVyYSgpOiBFcnJvcjogYXJDcmVhdGVIYW5kbGUuCgBzZXRDYW1lcmEoKTogRXJyb3IgY3JlYXRpbmcgM0QgaGFuZGxlAE91dCBvZiBtZW1vcnkhIQoARXJyb3I6IG1hbGxvYwoAIyMjIEZlYXR1cmUgY2FuZGlkYXRlcyBmb3IgdHJhY2tpbmcgYXJlIG92ZXJmbG93LgoAQm9ndXMgbWVzc2FnZSBjb2RlICVkAEFMSUdOX1RZUEUgaXMgd3JvbmcsIHBsZWFzZSBmaXgATUFYX0FMTE9DX0NIVU5LIGlzIHdyb25nLCBwbGVhc2UgZml4AEJvZ3VzIGJ1ZmZlciBjb250cm9sIG1vZGUASW52YWxpZCBjb21wb25lbnQgSUQgJWQgaW4gU09TAEludmFsaWQgY3JvcCByZXF1ZXN0AERDVCBjb2VmZmljaWVudCBvdXQgb2YgcmFuZ2UARENUIHNjYWxlZCBibG9jayBzaXplICVkeCVkIG5vdCBzdXBwb3J0ZWQAQ29tcG9uZW50IGluZGV4ICVkOiBtaXNtYXRjaGluZyBzYW1wbGluZyByYXRpbyAlZDolZCwgJWQ6JWQsICVjAEJvZ3VzIEh1ZmZtYW4gdGFibGUgZGVmaW5pdGlvbgBCb2d1cyBpbnB1dCBjb2xvcnNwYWNlAEJvZ3VzIEpQRUcgY29sb3JzcGFjZQBCb2d1cyBtYXJrZXIgbGVuZ3RoAFdyb25nIEpQRUcgbGlicmFyeSB2ZXJzaW9uOiBsaWJyYXJ5IGlzICVkLCBjYWxsZXIgZXhwZWN0cyAlZABTYW1wbGluZyBmYWN0b3JzIHRvbyBsYXJnZSBmb3IgaW50ZXJsZWF2ZWQgc2NhbgBJbnZhbGlkIG1lbW9yeSBwb29sIGNvZGUgJWQAVW5zdXBwb3J0ZWQgSlBFRyBkYXRhIHByZWNpc2lvbiAlZABJbnZhbGlkIHByb2dyZXNzaXZlIHBhcmFtZXRlcnMgU3M9JWQgU2U9JWQgQWg9JWQgQWw9JWQASW52YWxpZCBwcm9ncmVzc2l2ZSBwYXJhbWV0ZXJzIGF0IHNjYW4gc2NyaXB0IGVudHJ5ICVkAEJvZ3VzIHNhbXBsaW5nIGZhY3RvcnMASW52YWxpZCBzY2FuIHNjcmlwdCBhdCBlbnRyeSAlZABJbXByb3BlciBjYWxsIHRvIEpQRUcgbGlicmFyeSBpbiBzdGF0ZSAlZABKUEVHIHBhcmFtZXRlciBzdHJ1Y3QgbWlzbWF0Y2g6IGxpYnJhcnkgdGhpbmtzIHNpemUgaXMgJXUsIGNhbGxlciBleHBlY3RzICV1AEJvZ3VzIHZpcnR1YWwgYXJyYXkgYWNjZXNzAEJ1ZmZlciBwYXNzZWQgdG8gSlBFRyBsaWJyYXJ5IGlzIHRvbyBzbWFsbABTdXNwZW5zaW9uIG5vdCBhbGxvd2VkIGhlcmUAQ0NJUjYwMSBzYW1wbGluZyBub3QgaW1wbGVtZW50ZWQgeWV0AFRvbyBtYW55IGNvbG9yIGNvbXBvbmVudHM6ICVkLCBtYXggJWQAVW5zdXBwb3J0ZWQgY29sb3IgY29udmVyc2lvbiByZXF1ZXN0AEJvZ3VzIERBQyBpbmRleCAlZABCb2d1cyBEQUMgdmFsdWUgMHgleABCb2d1cyBESFQgaW5kZXggJWQAQm9ndXMgRFFUIGluZGV4ICVkAEVtcHR5IEpQRUcgaW1hZ2UgKEROTCBub3Qgc3VwcG9ydGVkKQBSZWFkIGZyb20gRU1TIGZhaWxlZABXcml0ZSB0byBFTVMgZmFpbGVkAERpZG4ndCBleHBlY3QgbW9yZSB0aGFuIG9uZSBzY2FuAElucHV0IGZpbGUgcmVhZCBlcnJvcgBPdXRwdXQgZmlsZSB3cml0ZSBlcnJvciAtLS0gb3V0IG9mIGRpc2sgc3BhY2U/AEZyYWN0aW9uYWwgc2FtcGxpbmcgbm90IGltcGxlbWVudGVkIHlldABIdWZmbWFuIGNvZGUgc2l6ZSB0YWJsZSBvdmVyZmxvdwBNaXNzaW5nIEh1ZmZtYW4gY29kZSB0YWJsZSBlbnRyeQBNYXhpbXVtIHN1cHBvcnRlZCBpbWFnZSBkaW1lbnNpb24gaXMgJXUgcGl4ZWxzAEVtcHR5IGlucHV0IGZpbGUAUHJlbWF0dXJlIGVuZCBvZiBpbnB1dCBmaWxlAENhbm5vdCB0cmFuc2NvZGUgZHVlIHRvIG11bHRpcGxlIHVzZSBvZiBxdWFudGl6YXRpb24gdGFibGUgJWQAU2NhbiBzY3JpcHQgZG9lcyBub3QgdHJhbnNtaXQgYWxsIGRhdGEASW52YWxpZCBjb2xvciBxdWFudGl6YXRpb24gbW9kZSBjaGFuZ2UATm90IGltcGxlbWVudGVkIHlldABSZXF1ZXN0ZWQgZmVhdHVyZSB3YXMgb21pdHRlZCBhdCBjb21waWxlIHRpbWUAQXJpdGhtZXRpYyB0YWJsZSAweCUwMnggd2FzIG5vdCBkZWZpbmVkAEJhY2tpbmcgc3RvcmUgbm90IHN1cHBvcnRlZABIdWZmbWFuIHRhYmxlIDB4JTAyeCB3YXMgbm90IGRlZmluZWQASlBFRyBkYXRhc3RyZWFtIGNvbnRhaW5zIG5vIGltYWdlAFF1YW50aXphdGlvbiB0YWJsZSAweCUwMnggd2FzIG5vdCBkZWZpbmVkAE5vdCBhIEpQRUcgZmlsZTogc3RhcnRzIHdpdGggMHglMDJ4IDB4JTAyeABJbnN1ZmZpY2llbnQgbWVtb3J5IChjYXNlICVkKQBDYW5ub3QgcXVhbnRpemUgbW9yZSB0aGFuICVkIGNvbG9yIGNvbXBvbmVudHMAQ2Fubm90IHF1YW50aXplIHRvIGZld2VyIHRoYW4gJWQgY29sb3JzAENhbm5vdCBxdWFudGl6ZSB0byBtb3JlIHRoYW4gJWQgY29sb3JzAEludmFsaWQgSlBFRyBmaWxlIHN0cnVjdHVyZTogJXMgYmVmb3JlIFNPRgBJbnZhbGlkIEpQRUcgZmlsZSBzdHJ1Y3R1cmU6IHR3byBTT0YgbWFya2VycwBJbnZhbGlkIEpQRUcgZmlsZSBzdHJ1Y3R1cmU6IG1pc3NpbmcgU09TIG1hcmtlcgBVbnN1cHBvcnRlZCBKUEVHIHByb2Nlc3M6IFNPRiB0eXBlIDB4JTAyeABJbnZhbGlkIEpQRUcgZmlsZSBzdHJ1Y3R1cmU6IHR3byBTT0kgbWFya2VycwBGYWlsZWQgdG8gY3JlYXRlIHRlbXBvcmFyeSBmaWxlICVzAFJlYWQgZmFpbGVkIG9uIHRlbXBvcmFyeSBmaWxlAFNlZWsgZmFpbGVkIG9uIHRlbXBvcmFyeSBmaWxlAFdyaXRlIGZhaWxlZCBvbiB0ZW1wb3JhcnkgZmlsZSAtLS0gb3V0IG9mIGRpc2sgc3BhY2U/AEFwcGxpY2F0aW9uIHRyYW5zZmVycmVkIHRvbyBmZXcgc2NhbmxpbmVzAFVuc3VwcG9ydGVkIG1hcmtlciB0eXBlIDB4JTAyeABWaXJ0dWFsIGFycmF5IGNvbnRyb2xsZXIgbWVzc2VkIHVwAEltYWdlIHRvbyB3aWRlIGZvciB0aGlzIGltcGxlbWVudGF0aW9uAFJlYWQgZnJvbSBYTVMgZmFpbGVkAFdyaXRlIHRvIFhNUyBmYWlsZWQAQ29weXJpZ2h0IChDKSAyMDE4LCBUaG9tYXMgRy4gTGFuZSwgR3VpZG8gVm9sbGJlZGluZwA5YyAgMTQtSmFuLTIwMTgAQ2F1dGlvbjogcXVhbnRpemF0aW9uIHRhYmxlcyBhcmUgdG9vIGNvYXJzZSBmb3IgYmFzZWxpbmUgSlBFRwBBZG9iZSBBUFAxNCBtYXJrZXI6IHZlcnNpb24gJWQsIGZsYWdzIDB4JTA0eCAweCUwNHgsIHRyYW5zZm9ybSAlZABVbmtub3duIEFQUDAgbWFya2VyIChub3QgSkZJRiksIGxlbmd0aCAldQBVbmtub3duIEFQUDE0IG1hcmtlciAobm90IEFkb2JlKSwgbGVuZ3RoICV1AERlZmluZSBBcml0aG1ldGljIFRhYmxlIDB4JTAyeDogMHglMDJ4AERlZmluZSBIdWZmbWFuIFRhYmxlIDB4JTAyeABEZWZpbmUgUXVhbnRpemF0aW9uIFRhYmxlICVkICBwcmVjaXNpb24gJWQARGVmaW5lIFJlc3RhcnQgSW50ZXJ2YWwgJXUARnJlZWQgRU1TIGhhbmRsZSAldQBPYnRhaW5lZCBFTVMgaGFuZGxlICV1AEVuZCBPZiBJbWFnZQAgICAgICAgICUzZCAlM2QgJTNkICUzZCAlM2QgJTNkICUzZCAlM2QASkZJRiBBUFAwIG1hcmtlcjogdmVyc2lvbiAlZC4lMDJkLCBkZW5zaXR5ICVkeCVkICAlZABXYXJuaW5nOiB0aHVtYm5haWwgaW1hZ2Ugc2l6ZSBkb2VzIG5vdCBtYXRjaCBkYXRhIGxlbmd0aCAldQBKRklGIGV4dGVuc2lvbiBtYXJrZXI6IHR5cGUgMHglMDJ4LCBsZW5ndGggJXUAICAgIHdpdGggJWQgeCAlZCB0aHVtYm5haWwgaW1hZ2UATWlzY2VsbGFuZW91cyBtYXJrZXIgMHglMDJ4LCBsZW5ndGggJXUAVW5leHBlY3RlZCBtYXJrZXIgMHglMDJ4ACAgICAgICAgJTR1ICU0dSAlNHUgJTR1ICU0dSAlNHUgJTR1ICU0dQBRdWFudGl6aW5nIHRvICVkID0gJWQqJWQqJWQgY29sb3JzAFF1YW50aXppbmcgdG8gJWQgY29sb3JzAFNlbGVjdGVkICVkIGNvbG9ycyBmb3IgcXVhbnRpemF0aW9uAEF0IG1hcmtlciAweCUwMngsIHJlY292ZXJ5IGFjdGlvbiAlZABSU1QlZABTbW9vdGhpbmcgbm90IHN1cHBvcnRlZCB3aXRoIG5vbnN0YW5kYXJkIHNhbXBsaW5nIHJhdGlvcwBTdGFydCBPZiBGcmFtZSAweCUwMng6IHdpZHRoPSV1LCBoZWlnaHQ9JXUsIGNvbXBvbmVudHM9JWQAICAgIENvbXBvbmVudCAlZDogJWRoeCVkdiBxPSVkAFN0YXJ0IG9mIEltYWdlAFN0YXJ0IE9mIFNjYW46ICVkIGNvbXBvbmVudHMAICAgIENvbXBvbmVudCAlZDogZGM9JWQgYWM9JWQAICBTcz0lZCwgU2U9JWQsIEFoPSVkLCBBbD0lZABDbG9zZWQgdGVtcG9yYXJ5IGZpbGUgJXMAT3BlbmVkIHRlbXBvcmFyeSBmaWxlICVzAEpGSUYgZXh0ZW5zaW9uIG1hcmtlcjogSlBFRy1jb21wcmVzc2VkIHRodW1ibmFpbCBpbWFnZSwgbGVuZ3RoICV1AEpGSUYgZXh0ZW5zaW9uIG1hcmtlcjogcGFsZXR0ZSB0aHVtYm5haWwgaW1hZ2UsIGxlbmd0aCAldQBKRklGIGV4dGVuc2lvbiBtYXJrZXI6IFJHQiB0aHVtYm5haWwgaW1hZ2UsIGxlbmd0aCAldQBVbnJlY29nbml6ZWQgY29tcG9uZW50IElEcyAlZCAlZCAlZCwgYXNzdW1pbmcgWUNiQ3IARnJlZWQgWE1TIGhhbmRsZSAldQBPYnRhaW5lZCBYTVMgaGFuZGxlICV1AFVua25vd24gQWRvYmUgY29sb3IgdHJhbnNmb3JtIGNvZGUgJWQAQ29ycnVwdCBKUEVHIGRhdGE6IGJhZCBhcml0aG1ldGljIGNvZGUASW5jb25zaXN0ZW50IHByb2dyZXNzaW9uIHNlcXVlbmNlIGZvciBjb21wb25lbnQgJWQgY29lZmZpY2llbnQgJWQAQ29ycnVwdCBKUEVHIGRhdGE6ICV1IGV4dHJhbmVvdXMgYnl0ZXMgYmVmb3JlIG1hcmtlciAweCUwMngAQ29ycnVwdCBKUEVHIGRhdGE6IHByZW1hdHVyZSBlbmQgb2YgZGF0YSBzZWdtZW50AENvcnJ1cHQgSlBFRyBkYXRhOiBiYWQgSHVmZm1hbiBjb2RlAFdhcm5pbmc6IHVua25vd24gSkZJRiByZXZpc2lvbiBudW1iZXIgJWQuJTAyZABQcmVtYXR1cmUgZW5kIG9mIEpQRUcgZmlsZQBDb3JydXB0IEpQRUcgZGF0YTogZm91bmQgbWFya2VyIDB4JTAyeCBpbnN0ZWFkIG9mIFJTVCVkAEludmFsaWQgU09TIHBhcmFtZXRlcnMgZm9yIHNlcXVlbnRpYWwgSlBFRwBBcHBsaWNhdGlvbiB0cmFuc2ZlcnJlZCB0b28gbWFueSBzY2FubGluZXMAU09TAExTRQBKUEVHTUVNACVsZCVjACVzCgAAAQIEBwMGBQAtKyAgIDBYMHgAKG51bGwpAC0wWCswWCAwWC0weCsweCAweABpbmYASU5GAE5BTgBpbmZpbml0eQBuYW4ATENfQUxMAExBTkcAQy5VVEYtOABQT1NJWABNVVNMX0xPQ1BBVEgAcndhAHRlcm1pbmF0aW5nIHdpdGggJXMgZXhjZXB0aW9uIG9mIHR5cGUgJXM6ICVzAHRlcm1pbmF0aW5nIHdpdGggJXMgZXhjZXB0aW9uIG9mIHR5cGUgJXMAdGVybWluYXRpbmcgd2l0aCAlcyBmb3JlaWduIGV4Y2VwdGlvbgB0ZXJtaW5hdGluZwB1bmNhdWdodABTdDlleGNlcHRpb24ATjEwX19jeHhhYml2MTE2X19zaGltX3R5cGVfaW5mb0UAU3Q5dHlwZV9pbmZvAE4xMF9fY3h4YWJpdjEyMF9fc2lfY2xhc3NfdHlwZV9pbmZvRQBOMTBfX2N4eGFiaXYxMTdfX2NsYXNzX3R5cGVfaW5mb0UAdGVybWluYXRlX2hhbmRsZXIgdW5leHBlY3RlZGx5IHJldHVybmVkAFN0MTFsb2dpY19lcnJvcgBTdDEybGVuZ3RoX2Vycm9yAE4xMF9fY3h4YWJpdjExN19fcGJhc2VfdHlwZV9pbmZvRQBOMTBfX2N4eGFiaXYxMTlfX3BvaW50ZXJfdHlwZV9pbmZvRQBQdXJlIHZpcnR1YWwgZnVuY3Rpb24gY2FsbGVkIQBOMTBfX2N4eGFiaXYxMjNfX2Z1bmRhbWVudGFsX3R5cGVfaW5mb0UAdgBiAGMAaABhAHMAdABpAGoAbQBmAGQATjEwX19jeHhhYml2MTIxX192bWlfY2xhc3NfdHlwZV9pbmZvRQBfWgBfX19aAF9ibG9ja19pbnZva2UAaW52b2NhdGlvbiBmdW5jdGlvbiBmb3IgYmxvY2sgaW4gAGxvbmcgbG9uZwBfX2ludDEyOAB1bnNpZ25lZCBfX2ludDEyOABsb25nIGRvdWJsZQBfX2Zsb2F0MTI4AC4uLgBkZWNpbWFsNjQAZGVjaW1hbDEyOABkZWNpbWFsMzIAZGVjaW1hbDE2AGNoYXIzMl90AGNoYXIxNl90AGF1dG8AZGVjbHR5cGUoYXV0bykAc3RkOjpudWxscHRyX3QAW2FiaToAXQBOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUxMEFiaVRhZ0F0dHJFAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTROb2RlRQBhbGxvY2F0b3IAYmFzaWNfc3RyaW5nAHN0cmluZwBpc3RyZWFtAG9zdHJlYW0AaW9zdHJlYW0Ac3RkOjphbGxvY2F0b3IAc3RkOjpiYXNpY19zdHJpbmcAc3RkOjppc3RyZWFtAHN0ZDo6b3N0cmVhbQBzdGQ6Omlvc3RyZWFtAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTE5U3BlY2lhbFN1YnN0aXR1dGlvbkUAIGltYWdpbmFyeQBOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUyMFBvc3RmaXhRdWFsaWZpZWRUeXBlRQAgY29tcGxleAApACAAKAAmACYmAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTEzUmVmZXJlbmNlVHlwZUUAb2JqY19vYmplY3QAKgBpZDwAPgBOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUxMVBvaW50ZXJUeXBlRQBOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUyME5hbWVXaXRoVGVtcGxhdGVBcmdzRQA8ACwgAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTEyVGVtcGxhdGVBcmdzRQBOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUxM1BhcmFtZXRlclBhY2tFAHdjaGFyX3QAYjBFAGIxRQB1AHVsAHVsbABOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUxNUludGVnZXJDYXN0RXhwckUAJUxhTABOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUxNkZsb2F0TGl0ZXJhbEltcGxJZUVFACVhAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTE2RmxvYXRMaXRlcmFsSW1wbElkRUUAJWFmAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTE2RmxvYXRMaXRlcmFsSW1wbElmRUUATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlOEJvb2xFeHByRQAtAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTE0SW50ZWdlckxpdGVyYWxFAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTIwVGVtcGxhdGVBcmd1bWVudFBhY2tFAGdzACY9AD0AYWxpZ25vZiAoACwAfgAuKgAvAC89AF4AXj0APT0APj0APD0APDwAPDw9AC09ACo9AC0tACE9ACEAfHwAfAB8PQAtPioAKwArPQArKwAtPgAlACU9AD4+AD4+PQBzaXplb2YgKAB0eXBlaWQgKAB0aHJvdwB0aHJvdyAATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlOVRocm93RXhwckUATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMTJJbml0TGlzdEV4cHJFAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTEzTm9kZUFycmF5Tm9kZUUAc2l6ZW9mLi4uICgATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMTNFbmNsb3NpbmdFeHByRQBzaXplb2YuLi4oAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTIyUGFyYW1ldGVyUGFja0V4cGFuc2lvbkUATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMTlTaXplb2ZQYXJhbVBhY2tFeHByRQBzdGF0aWNfY2FzdAA+KABOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGU4Q2FzdEV4cHJFAHJlaW50ZXJwcmV0X2Nhc3QAKSA/ICgAKSA6ICgATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMTVDb25kaXRpb25hbEV4cHJFAG5vZXhjZXB0ICgAbncAbmEAcGkAOjpvcGVyYXRvciAAbmV3AFtdAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTdOZXdFeHByRQBOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUxMVBvc3RmaXhFeHByRQAgLi4uIAAgPSAATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMTVCcmFjZWRSYW5nZUV4cHJFAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTEwQnJhY2VkRXhwckUAX0dMT0JBTF9fTgAoYW5vbnltb3VzIG5hbWVzcGFjZSkATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlOE5hbWVUeXBlRQApWwBOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUxOEFycmF5U3Vic2NyaXB0RXhwckUALgBOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUxME1lbWJlckV4cHJFAHNyTgBzcgA6OgBOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUxOUdsb2JhbFF1YWxpZmllZE5hbWVFAGRuAG9uAG9wZXJhdG9yJiYAb3BlcmF0b3ImAG9wZXJhdG9yJj0Ab3BlcmF0b3I9AG9wZXJhdG9yKCkAb3BlcmF0b3IsAG9wZXJhdG9yfgBvcGVyYXRvciBkZWxldGVbXQBvcGVyYXRvcioAb3BlcmF0b3IvAG9wZXJhdG9yLz0Ab3BlcmF0b3JeAG9wZXJhdG9yXj0Ab3BlcmF0b3I9PQBvcGVyYXRvcj49AG9wZXJhdG9yPgBvcGVyYXRvcltdAG9wZXJhdG9yPD0Ab3BlcmF0b3I8PABvcGVyYXRvcjw8PQBvcGVyYXRvcjwAb3BlcmF0b3ItAG9wZXJhdG9yLT0Ab3BlcmF0b3IqPQBvcGVyYXRvci0tAG9wZXJhdG9yIG5ld1tdAG9wZXJhdG9yIT0Ab3BlcmF0b3IhAG9wZXJhdG9yIG5ldwBvcGVyYXRvcnx8AG9wZXJhdG9yfABvcGVyYXRvcnw9AG9wZXJhdG9yLT4qAG9wZXJhdG9yKwBvcGVyYXRvcis9AG9wZXJhdG9yKysAb3BlcmF0b3ItPgBvcGVyYXRvcj8Ab3BlcmF0b3IlAG9wZXJhdG9yJT0Ab3BlcmF0b3I+PgBvcGVyYXRvcj4+PQBvcGVyYXRvcjw9PgBvcGVyYXRvciIiIABOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUxNUxpdGVyYWxPcGVyYXRvckUAb3BlcmF0b3IgZGVsZXRlAG9wZXJhdG9yIABOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUyMkNvbnZlcnNpb25PcGVyYXRvclR5cGVFAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZThEdG9yTmFtZUUATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMTNRdWFsaWZpZWROYW1lRQBkeW5hbWljX2Nhc3QAZGVsZXRlAFtdIABOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUxMERlbGV0ZUV4cHJFAGN2ACkoAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTE0Q29udmVyc2lvbkV4cHJFAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZThDYWxsRXhwckUAY29uc3RfY2FzdABOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUxMFByZWZpeEV4cHJFACkgACAoAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTEwQmluYXJ5RXhwckUAYWEAYW4AYU4AYVMAY20AZHMAZHYAZFYAZW8AZU8AZXEAZ2UAZ3QAbGUAbHMAbFMAbHQAbWkAbUkAbWwAbUwAbmUAb28Ab3IAb1IAcGwAcEwAcm0Ack0AcnMAclMALi4uIAAgLi4uAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZThGb2xkRXhwckUAZnAAZkwATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMTNGdW5jdGlvblBhcmFtRQBOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUyNEZvcndhcmRUZW1wbGF0ZVJlZmVyZW5jZUUAVHMAc3RydWN0AFR1AHVuaW9uAFRlAGVudW0ATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMjJFbGFib3JhdGVkVHlwZVNwZWZUeXBlRQBTdEwAU3QAc3RkOjoATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMTZTdGRRdWFsaWZpZWROYW1lRQBEQwBOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUyMVN0cnVjdHVyZWRCaW5kaW5nTmFtZUUAVXQAVWwAdkUAJ2xhbWJkYQAnKABOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUxNUNsb3N1cmVUeXBlTmFtZUUAJ3VubmFtZWQAJwBOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUxNVVubmFtZWRUeXBlTmFtZUUAc3RyaW5nIGxpdGVyYWwATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlOUxvY2FsTmFtZUUAc3RkAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTEyQ3RvckR0b3JOYW1lRQBiYXNpY19pc3RyZWFtAGJhc2ljX29zdHJlYW0AYmFzaWNfaW9zdHJlYW0Ac3RkOjpiYXNpY19zdHJpbmc8Y2hhciwgc3RkOjpjaGFyX3RyYWl0czxjaGFyPiwgc3RkOjphbGxvY2F0b3I8Y2hhcj4gPgBzdGQ6OmJhc2ljX2lzdHJlYW08Y2hhciwgc3RkOjpjaGFyX3RyYWl0czxjaGFyPiA+AHN0ZDo6YmFzaWNfb3N0cmVhbTxjaGFyLCBzdGQ6OmNoYXJfdHJhaXRzPGNoYXI+ID4Ac3RkOjpiYXNpY19pb3N0cmVhbTxjaGFyLCBzdGQ6OmNoYXJfdHJhaXRzPGNoYXI+ID4ATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMjdFeHBhbmRlZFNwZWNpYWxTdWJzdGl0dXRpb25FAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTEwTmVzdGVkTmFtZUUAOjoqAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTE5UG9pbnRlclRvTWVtYmVyVHlwZUUAWwBOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGU5QXJyYXlUeXBlRQBEdgAgdmVjdG9yWwBOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUxMFZlY3RvclR5cGVFAHBpeGVsIHZlY3RvclsATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMTVQaXhlbFZlY3RvclR5cGVFAGRlY2x0eXBlKAB1bnNpZ25lZCBsb25nIGxvbmcAb2JqY3Byb3RvACBjb25zdAAgdm9sYXRpbGUAIHJlc3RyaWN0AE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZThRdWFsVHlwZUUATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMTdWZW5kb3JFeHRRdWFsVHlwZUUATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMTNPYmpDUHJvdG9OYW1lRQBEbwBub2V4Y2VwdABETwBEdwBEeABSRQBPRQAgJgAgJiYATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMTJGdW5jdGlvblR5cGVFAHRocm93KABOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUyMER5bmFtaWNFeGNlcHRpb25TcGVjRQBub2V4Y2VwdCgATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMTJOb2V4Y2VwdFNwZWNFAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTExU3BlY2lhbE5hbWVFAE4xMl9HTE9CQUxfX05fMTE2aXRhbml1bV9kZW1hbmdsZTlEb3RTdWZmaXhFAFVhOWVuYWJsZV9pZkkATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMTZGdW5jdGlvbkVuY29kaW5nRQAgW2VuYWJsZV9pZjoATjEyX0dMT0JBTF9fTl8xMTZpdGFuaXVtX2RlbWFuZ2xlMTJFbmFibGVJZkF0dHJFAHRocmVhZC1sb2NhbCB3cmFwcGVyIHJvdXRpbmUgZm9yIAByZWZlcmVuY2UgdGVtcG9yYXJ5IGZvciAAZ3VhcmQgdmFyaWFibGUgZm9yIABub24tdmlydHVhbCB0aHVuayB0byAAdmlydHVhbCB0aHVuayB0byAAdGhyZWFkLWxvY2FsIGluaXRpYWxpemF0aW9uIHJvdXRpbmUgZm9yIABjb25zdHJ1Y3Rpb24gdnRhYmxlIGZvciAALWluLQBOMTJfR0xPQkFMX19OXzExNml0YW5pdW1fZGVtYW5nbGUyMUN0b3JWdGFibGVTcGVjaWFsTmFtZUUAY292YXJpYW50IHJldHVybiB0aHVuayB0byAAdHlwZWluZm8gbmFtZSBmb3IgAHR5cGVpbmZvIGZvciAAVlRUIGZvciAAdnRhYmxlIGZvciAAdm9pZABib29sAGNoYXIAc2lnbmVkIGNoYXIAdW5zaWduZWQgY2hhcgBzaG9ydAB1bnNpZ25lZCBzaG9ydABpbnQAdW5zaWduZWQgaW50AGxvbmcAdW5zaWduZWQgbG9uZwBmbG9hdABkb3VibGUAc3RkOjpzdHJpbmcAc3RkOjpiYXNpY19zdHJpbmc8dW5zaWduZWQgY2hhcj4Ac3RkOjp3c3RyaW5nAGVtc2NyaXB0ZW46OnZhbABlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxjaGFyPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxzaWduZWQgY2hhcj4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dW5zaWduZWQgY2hhcj4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8c2hvcnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIHNob3J0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIGludD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8bG9uZz4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dW5zaWduZWQgbG9uZz4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50OF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50OF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50MTZfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50MzJfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dWludDMyX3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGZsb2F0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxkb3VibGU+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGxvbmcgZG91YmxlPgBOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0llRUUATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJZEVFAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWZFRQBOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0ltRUUATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJbEVFAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWpFRQBOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lpRUUATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJdEVFAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SXNFRQBOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0loRUUATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJYUVFAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWNFRQBOMTBlbXNjcmlwdGVuM3ZhbEUATlN0M19fMjEyYmFzaWNfc3RyaW5nSXdOU18xMWNoYXJfdHJhaXRzSXdFRU5TXzlhbGxvY2F0b3JJd0VFRUUATlN0M19fMjEyYmFzaWNfc3RyaW5nSWhOU18xMWNoYXJfdHJhaXRzSWhFRU5TXzlhbGxvY2F0b3JJaEVFRUUATlN0M19fMjhpb3NfYmFzZUUATlN0M19fMjliYXNpY19pb3NJY05TXzExY2hhcl90cmFpdHNJY0VFRUUATlN0M19fMjliYXNpY19pb3NJd05TXzExY2hhcl90cmFpdHNJd0VFRUUATlN0M19fMjE1YmFzaWNfc3RyZWFtYnVmSWNOU18xMWNoYXJfdHJhaXRzSWNFRUVFAE5TdDNfXzIxNWJhc2ljX3N0cmVhbWJ1Zkl3TlNfMTFjaGFyX3RyYWl0c0l3RUVFRQBOU3QzX18yMTNiYXNpY19pc3RyZWFtSWNOU18xMWNoYXJfdHJhaXRzSWNFRUVFAE5TdDNfXzIxM2Jhc2ljX2lzdHJlYW1Jd05TXzExY2hhcl90cmFpdHNJd0VFRUUATlN0M19fMjEzYmFzaWNfb3N0cmVhbUljTlNfMTFjaGFyX3RyYWl0c0ljRUVFRQBOU3QzX18yMTNiYXNpY19vc3RyZWFtSXdOU18xMWNoYXJfdHJhaXRzSXdFRUVFAE5TdDNfXzIxMV9fc3Rkb3V0YnVmSXdFRQBOU3QzX18yMTFfX3N0ZG91dGJ1ZkljRUUAdW5zdXBwb3J0ZWQgbG9jYWxlIGZvciBzdGFuZGFyZCBpbnB1dABOU3QzX18yMTBfX3N0ZGluYnVmSXdFRQBOU3QzX18yMTBfX3N0ZGluYnVmSWNFRQBOU3QzX18yN2NvbGxhdGVJY0VFAE5TdDNfXzI2bG9jYWxlNWZhY2V0RQBOU3QzX18yN2NvbGxhdGVJd0VFACVwAEMATlN0M19fMjdudW1fZ2V0SWNOU18xOWlzdHJlYW1idWZfaXRlcmF0b3JJY05TXzExY2hhcl90cmFpdHNJY0VFRUVFRQBOU3QzX18yOV9fbnVtX2dldEljRUUATlN0M19fMjE0X19udW1fZ2V0X2Jhc2VFAE5TdDNfXzI3bnVtX2dldEl3TlNfMTlpc3RyZWFtYnVmX2l0ZXJhdG9ySXdOU18xMWNoYXJfdHJhaXRzSXdFRUVFRUUATlN0M19fMjlfX251bV9nZXRJd0VFACVwAAAAAEwAbGwAJQAAAAAAbABOU3QzX18yN251bV9wdXRJY05TXzE5b3N0cmVhbWJ1Zl9pdGVyYXRvckljTlNfMTFjaGFyX3RyYWl0c0ljRUVFRUVFAE5TdDNfXzI5X19udW1fcHV0SWNFRQBOU3QzX18yMTRfX251bV9wdXRfYmFzZUUATlN0M19fMjdudW1fcHV0SXdOU18xOW9zdHJlYW1idWZfaXRlcmF0b3JJd05TXzExY2hhcl90cmFpdHNJd0VFRUVFRQBOU3QzX18yOV9fbnVtX3B1dEl3RUUAJUg6JU06JVMAJW0vJWQvJXkAJUk6JU06JVMgJXAAJWEgJWIgJWQgJUg6JU06JVMgJVkAQU0AUE0ASmFudWFyeQBGZWJydWFyeQBNYXJjaABBcHJpbABNYXkASnVuZQBKdWx5AEF1Z3VzdABTZXB0ZW1iZXIAT2N0b2JlcgBOb3ZlbWJlcgBEZWNlbWJlcgBKYW4ARmViAE1hcgBBcHIASnVuAEp1bABBdWcAU2VwAE9jdABOb3YARGVjAFN1bmRheQBNb25kYXkAVHVlc2RheQBXZWRuZXNkYXkAVGh1cnNkYXkARnJpZGF5AFNhdHVyZGF5AFN1bgBNb24AVHVlAFdlZABUaHUARnJpAFNhdAAlbS8lZC8leSVZLSVtLSVkJUk6JU06JVMgJXAlSDolTSVIOiVNOiVTJUg6JU06JVNOU3QzX18yOHRpbWVfZ2V0SWNOU18xOWlzdHJlYW1idWZfaXRlcmF0b3JJY05TXzExY2hhcl90cmFpdHNJY0VFRUVFRQBOU3QzX18yMjBfX3RpbWVfZ2V0X2Nfc3RvcmFnZUljRUUATlN0M19fMjl0aW1lX2Jhc2VFAE5TdDNfXzI4dGltZV9nZXRJd05TXzE5aXN0cmVhbWJ1Zl9pdGVyYXRvckl3TlNfMTFjaGFyX3RyYWl0c0l3RUVFRUVFAE5TdDNfXzIyMF9fdGltZV9nZXRfY19zdG9yYWdlSXdFRQBOU3QzX18yOHRpbWVfcHV0SWNOU18xOW9zdHJlYW1idWZfaXRlcmF0b3JJY05TXzExY2hhcl90cmFpdHNJY0VFRUVFRQBOU3QzX18yMTBfX3RpbWVfcHV0RQBOU3QzX18yOHRpbWVfcHV0SXdOU18xOW9zdHJlYW1idWZfaXRlcmF0b3JJd05TXzExY2hhcl90cmFpdHNJd0VFRUVFRQBOU3QzX18yMTBtb25leXB1bmN0SWNMYjBFRUUATlN0M19fMjEwbW9uZXlfYmFzZUUATlN0M19fMjEwbW9uZXlwdW5jdEljTGIxRUVFAE5TdDNfXzIxMG1vbmV5cHVuY3RJd0xiMEVFRQBOU3QzX18yMTBtb25leXB1bmN0SXdMYjFFRUUAMDEyMzQ1Njc4OQAlTGYATlN0M19fMjltb25leV9nZXRJY05TXzE5aXN0cmVhbWJ1Zl9pdGVyYXRvckljTlNfMTFjaGFyX3RyYWl0c0ljRUVFRUVFAE5TdDNfXzIxMV9fbW9uZXlfZ2V0SWNFRQAwMTIzNDU2Nzg5AE5TdDNfXzI5bW9uZXlfZ2V0SXdOU18xOWlzdHJlYW1idWZfaXRlcmF0b3JJd05TXzExY2hhcl90cmFpdHNJd0VFRUVFRQBOU3QzX18yMTFfX21vbmV5X2dldEl3RUUAJS4wTGYATlN0M19fMjltb25leV9wdXRJY05TXzE5b3N0cmVhbWJ1Zl9pdGVyYXRvckljTlNfMTFjaGFyX3RyYWl0c0ljRUVFRUVFAE5TdDNfXzIxMV9fbW9uZXlfcHV0SWNFRQBOU3QzX18yOW1vbmV5X3B1dEl3TlNfMTlvc3RyZWFtYnVmX2l0ZXJhdG9ySXdOU18xMWNoYXJfdHJhaXRzSXdFRUVFRUUATlN0M19fMjExX19tb25leV9wdXRJd0VFAE5TdDNfXzI4bWVzc2FnZXNJY0VFAE5TdDNfXzIxM21lc3NhZ2VzX2Jhc2VFAE5TdDNfXzIxN19fd2lkZW5fZnJvbV91dGY4SUxtMzJFRUUATlN0M19fMjdjb2RlY3Z0SURpYzExX19tYnN0YXRlX3RFRQBOU3QzX18yMTJjb2RlY3Z0X2Jhc2VFAE5TdDNfXzIxNl9fbmFycm93X3RvX3V0ZjhJTG0zMkVFRQBOU3QzX18yOG1lc3NhZ2VzSXdFRQBOU3QzX18yN2NvZGVjdnRJY2MxMV9fbWJzdGF0ZV90RUUATlN0M19fMjdjb2RlY3Z0SXdjMTFfX21ic3RhdGVfdEVFAE5TdDNfXzI3Y29kZWN2dElEc2MxMV9fbWJzdGF0ZV90RUUATlN0M19fMjZsb2NhbGU1X19pbXBFAE5TdDNfXzI1Y3R5cGVJY0VFAE5TdDNfXzIxMGN0eXBlX2Jhc2VFAE5TdDNfXzI1Y3R5cGVJd0VFAGZhbHNlAHRydWUATlN0M19fMjhudW1wdW5jdEljRUUATlN0M19fMjhudW1wdW5jdEl3RUUATlN0M19fMjE0X19zaGFyZWRfY291bnRFAE5TdDNfXzIxOV9fc2hhcmVkX3dlYWtfY291bnRF"; + + + + + +/* no memory initializer */ +var tempDoublePtr = 67648 +assert(tempDoublePtr % 8 == 0); + +function copyTempFloat(ptr) { // functions, because inlining this code increases code size too much + HEAP8[tempDoublePtr] = HEAP8[ptr]; + HEAP8[tempDoublePtr+1] = HEAP8[ptr+1]; + HEAP8[tempDoublePtr+2] = HEAP8[ptr+2]; + HEAP8[tempDoublePtr+3] = HEAP8[ptr+3]; +} + +function copyTempDouble(ptr) { + HEAP8[tempDoublePtr] = HEAP8[ptr]; + HEAP8[tempDoublePtr+1] = HEAP8[ptr+1]; + HEAP8[tempDoublePtr+2] = HEAP8[ptr+2]; + HEAP8[tempDoublePtr+3] = HEAP8[ptr+3]; + HEAP8[tempDoublePtr+4] = HEAP8[ptr+4]; + HEAP8[tempDoublePtr+5] = HEAP8[ptr+5]; + HEAP8[tempDoublePtr+6] = HEAP8[ptr+6]; + HEAP8[tempDoublePtr+7] = HEAP8[ptr+7]; +} + +// {{PRE_LIBRARY}} + + + function demangle(func) { + var __cxa_demangle_func = Module['___cxa_demangle'] || Module['__cxa_demangle']; + assert(__cxa_demangle_func); + try { + var s = func; + if (s.startsWith('__Z')) + s = s.substr(1); + var len = lengthBytesUTF8(s)+1; + var buf = _malloc(len); + stringToUTF8(s, buf, len); + var status = _malloc(4); + var ret = __cxa_demangle_func(buf, 0, 0, status); + if (HEAP32[((status)>>2)] === 0 && ret) { + return UTF8ToString(ret); + } + // otherwise, libcxxabi failed + } catch(e) { + // ignore problems here + } finally { + if (buf) _free(buf); + if (status) _free(status); + if (ret) _free(ret); + } + // failure when using libcxxabi, don't demangle + return func; + } + + function demangleAll(text) { + var regex = + /\b__Z[\w\d_]+/g; + return text.replace(regex, + function(x) { + var y = demangle(x); + return x === y ? x : (y + ' [' + x + ']'); + }); + } + + function jsStackTrace() { + var err = new Error(); + if (!err.stack) { + // IE10+ special cases: It does have callstack info, but it is only populated if an Error object is thrown, + // so try that as a special-case. + try { + throw new Error(0); + } catch(e) { + err = e; + } + if (!err.stack) { + return '(no stack trace available)'; + } + } + return err.stack.toString(); + } + + function stackTrace() { + var js = jsStackTrace(); + if (Module['extraStackTrace']) js += '\n' + Module['extraStackTrace'](); + return demangleAll(js); + } + + + var ENV={};function ___buildEnvironment(environ) { + // WARNING: Arbitrary limit! + var MAX_ENV_VALUES = 64; + var TOTAL_ENV_SIZE = 1024; + + // Statically allocate memory for the environment. + var poolPtr; + var envPtr; + if (!___buildEnvironment.called) { + ___buildEnvironment.called = true; + // Set default values. Use string keys for Closure Compiler compatibility. + ENV['USER'] = 'web_user'; + ENV['LOGNAME'] = 'web_user'; + ENV['PATH'] = '/'; + ENV['PWD'] = '/'; + ENV['HOME'] = '/home/web_user'; + // Browser language detection #8751 + ENV['LANG'] = ((typeof navigator === 'object' && navigator.languages && navigator.languages[0]) || 'C').replace('-', '_') + '.UTF-8'; + ENV['_'] = thisProgram; + // Allocate memory. + poolPtr = getMemory(TOTAL_ENV_SIZE); + envPtr = getMemory(MAX_ENV_VALUES * 4); + HEAP32[((envPtr)>>2)]=poolPtr; + HEAP32[((environ)>>2)]=envPtr; + } else { + envPtr = HEAP32[((environ)>>2)]; + poolPtr = HEAP32[((envPtr)>>2)]; + } + + // Collect key=value lines. + var strings = []; + var totalSize = 0; + for (var key in ENV) { + if (typeof ENV[key] === 'string') { + var line = key + '=' + ENV[key]; + strings.push(line); + totalSize += line.length; + } + } + if (totalSize > TOTAL_ENV_SIZE) { + throw new Error('Environment size exceeded TOTAL_ENV_SIZE!'); + } + + // Make new. + var ptrSize = 4; + for (var i = 0; i < strings.length; i++) { + var line = strings[i]; + writeAsciiToMemory(line, poolPtr); + HEAP32[(((envPtr)+(i * ptrSize))>>2)]=poolPtr; + poolPtr += line.length + 1; + } + HEAP32[(((envPtr)+(strings.length * ptrSize))>>2)]=0; + } + + function ___cxa_allocate_exception(size) { + return _malloc(size); + } + + + var ___exception_infos={}; + + var ___exception_caught= []; + + function ___exception_addRef(ptr) { + if (!ptr) return; + var info = ___exception_infos[ptr]; + info.refcount++; + } + + function ___exception_deAdjust(adjusted) { + if (!adjusted || ___exception_infos[adjusted]) return adjusted; + for (var key in ___exception_infos) { + var ptr = +key; // the iteration key is a string, and if we throw this, it must be an integer as that is what we look for + var adj = ___exception_infos[ptr].adjusted; + var len = adj.length; + for (var i = 0; i < len; i++) { + if (adj[i] === adjusted) { + return ptr; + } + } + } + return adjusted; + }function ___cxa_begin_catch(ptr) { + var info = ___exception_infos[ptr]; + if (info && !info.caught) { + info.caught = true; + __ZSt18uncaught_exceptionv.uncaught_exceptions--; + } + if (info) info.rethrown = false; + ___exception_caught.push(ptr); + ___exception_addRef(___exception_deAdjust(ptr)); + return ptr; + } + + + var ___exception_last=0;function ___cxa_throw(ptr, type, destructor) { + ___exception_infos[ptr] = { + ptr: ptr, + adjusted: [ptr], + type: type, + destructor: destructor, + refcount: 0, + caught: false, + rethrown: false + }; + ___exception_last = ptr; + if (!("uncaught_exception" in __ZSt18uncaught_exceptionv)) { + __ZSt18uncaught_exceptionv.uncaught_exceptions = 1; + } else { + __ZSt18uncaught_exceptionv.uncaught_exceptions++; + } + 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."; + } + + function ___gxx_personality_v0() { + } + + function ___lock() {} + + + function ___setErrNo(value) { + if (Module['___errno_location']) HEAP32[((Module['___errno_location']())>>2)]=value; + else err('failed to set errno from JS'); + return value; + }function ___map_file(pathname, size) { + ___setErrNo(63); + return -1; + } + + + + + + + var PATH={splitPath:function (filename) { + var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; + return splitPathRe.exec(filename).slice(1); + },normalizeArray:function (parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up; up--) { + parts.unshift('..'); + } + } + return parts; + },normalize:function (path) { + var isAbsolute = path.charAt(0) === '/', + trailingSlash = path.substr(-1) === '/'; + // Normalize the path + path = PATH.normalizeArray(path.split('/').filter(function(p) { + return !!p; + }), !isAbsolute).join('/'); + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + return (isAbsolute ? '/' : '') + path; + },dirname:function (path) { + var result = PATH.splitPath(path), + root = result[0], + dir = result[1]; + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + return root + dir; + },basename:function (path) { + // EMSCRIPTEN return '/'' for '/', not an empty string + if (path === '/') return '/'; + var lastSlash = path.lastIndexOf('/'); + if (lastSlash === -1) return path; + return path.substr(lastSlash+1); + },extname:function (path) { + return PATH.splitPath(path)[3]; + },join:function () { + var paths = Array.prototype.slice.call(arguments, 0); + return PATH.normalize(paths.join('/')); + },join2:function (l, r) { + return PATH.normalize(l + '/' + r); + }}; + + + var PATH_FS={resolve:function () { + var resolvedPath = '', + resolvedAbsolute = false; + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) ? arguments[i] : FS.cwd(); + // Skip empty and invalid entries + if (typeof path !== 'string') { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + return ''; // an invalid portion invalidates the whole thing + } + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter(function(p) { + return !!p; + }), !resolvedAbsolute).join('/'); + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; + },relative:function (from, to) { + from = PATH_FS.resolve(from).substr(1); + to = PATH_FS.resolve(to).substr(1); + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + return outputParts.join('/'); + }}; + + var TTY={ttys:[],init:function () { + // https://github.com/emscripten-core/emscripten/pull/1555 + // if (ENVIRONMENT_IS_NODE) { + // // currently, FS.init does not distinguish if process.stdin is a file or TTY + // // device, it always assumes it's a TTY device. because of this, we're forcing + // // process.stdin to UTF8 encoding to at least make stdin reading compatible + // // with text files until FS.init can be refactored. + // process['stdin']['setEncoding']('utf8'); + // } + },shutdown:function () { + // https://github.com/emscripten-core/emscripten/pull/1555 + // if (ENVIRONMENT_IS_NODE) { + // // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)? + // // 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 + // // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists? + // // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle + // // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call + // process['stdin']['pause'](); + // } + },register:function (dev, ops) { + TTY.ttys[dev] = { input: [], output: [], ops: ops }; + FS.registerDevice(dev, TTY.stream_ops); + },stream_ops:{open:function (stream) { + var tty = TTY.ttys[stream.node.rdev]; + if (!tty) { + throw new FS.ErrnoError(43); + } + stream.tty = tty; + stream.seekable = false; + },close:function (stream) { + // flush any pending line data + stream.tty.ops.flush(stream.tty); + },flush:function (stream) { + stream.tty.ops.flush(stream.tty); + },read:function (stream, buffer, offset, length, pos /* ignored */) { + if (!stream.tty || !stream.tty.ops.get_char) { + throw new FS.ErrnoError(60); + } + var bytesRead = 0; + for (var i = 0; i < length; i++) { + var result; + try { + result = stream.tty.ops.get_char(stream.tty); + } catch (e) { + throw new FS.ErrnoError(29); + } + if (result === undefined && bytesRead === 0) { + throw new FS.ErrnoError(6); + } + if (result === null || result === undefined) break; + bytesRead++; + buffer[offset+i] = result; + } + if (bytesRead) { + stream.node.timestamp = Date.now(); + } + return bytesRead; + },write:function (stream, buffer, offset, length, pos) { + if (!stream.tty || !stream.tty.ops.put_char) { + throw new FS.ErrnoError(60); + } + try { + for (var i = 0; i < length; i++) { + stream.tty.ops.put_char(stream.tty, buffer[offset+i]); + } + } catch (e) { + throw new FS.ErrnoError(29); + } + if (length) { + stream.node.timestamp = Date.now(); + } + return i; + }},default_tty_ops:{get_char:function (tty) { + if (!tty.input.length) { + var result = null; + if (ENVIRONMENT_IS_NODE) { + // we will read data by chunks of BUFSIZE + var BUFSIZE = 256; + var buf = Buffer.alloc ? Buffer.alloc(BUFSIZE) : new Buffer(BUFSIZE); + var bytesRead = 0; + + try { + bytesRead = nodeFS.readSync(process.stdin.fd, buf, 0, BUFSIZE, null); + } catch(e) { + // Cross-platform differences: on Windows, reading EOF throws an exception, but on other OSes, + // reading EOF returns 0. Uniformize behavior by treating the EOF exception to return 0. + if (e.toString().indexOf('EOF') != -1) bytesRead = 0; + else throw e; + } + + if (bytesRead > 0) { + result = buf.slice(0, bytesRead).toString('utf-8'); + } else { + result = null; + } + } else + if (typeof window != 'undefined' && + typeof window.prompt == 'function') { + // Browser. + result = window.prompt('Input: '); // returns null on cancel + if (result !== null) { + result += '\n'; + } + } else if (typeof readline == 'function') { + // Command line. + result = readline(); + if (result !== null) { + result += '\n'; + } + } + if (!result) { + return null; + } + tty.input = intArrayFromString(result, true); + } + return tty.input.shift(); + },put_char:function (tty, val) { + if (val === null || val === 10) { + out(UTF8ArrayToString(tty.output, 0)); + tty.output = []; + } else { + if (val != 0) tty.output.push(val); // val == 0 would cut text output off in the middle. + } + },flush:function (tty) { + if (tty.output && tty.output.length > 0) { + out(UTF8ArrayToString(tty.output, 0)); + tty.output = []; + } + }},default_tty1_ops:{put_char:function (tty, val) { + if (val === null || val === 10) { + err(UTF8ArrayToString(tty.output, 0)); + tty.output = []; + } else { + if (val != 0) tty.output.push(val); + } + },flush:function (tty) { + if (tty.output && tty.output.length > 0) { + err(UTF8ArrayToString(tty.output, 0)); + tty.output = []; + } + }}}; + + var MEMFS={ops_table:null,mount:function (mount) { + return MEMFS.createNode(null, '/', 16384 | 511 /* 0777 */, 0); + },createNode:function (parent, name, mode, dev) { + if (FS.isBlkdev(mode) || FS.isFIFO(mode)) { + // no supported + throw new FS.ErrnoError(63); + } + if (!MEMFS.ops_table) { + MEMFS.ops_table = { + dir: { + node: { + getattr: MEMFS.node_ops.getattr, + setattr: MEMFS.node_ops.setattr, + lookup: MEMFS.node_ops.lookup, + mknod: MEMFS.node_ops.mknod, + rename: MEMFS.node_ops.rename, + unlink: MEMFS.node_ops.unlink, + rmdir: MEMFS.node_ops.rmdir, + readdir: MEMFS.node_ops.readdir, + symlink: MEMFS.node_ops.symlink + }, + stream: { + llseek: MEMFS.stream_ops.llseek + } + }, + file: { + node: { + getattr: MEMFS.node_ops.getattr, + setattr: MEMFS.node_ops.setattr + }, + stream: { + llseek: MEMFS.stream_ops.llseek, + read: MEMFS.stream_ops.read, + write: MEMFS.stream_ops.write, + allocate: MEMFS.stream_ops.allocate, + mmap: MEMFS.stream_ops.mmap, + msync: MEMFS.stream_ops.msync + } + }, + link: { + node: { + getattr: MEMFS.node_ops.getattr, + setattr: MEMFS.node_ops.setattr, + readlink: MEMFS.node_ops.readlink + }, + stream: {} + }, + chrdev: { + node: { + getattr: MEMFS.node_ops.getattr, + setattr: MEMFS.node_ops.setattr + }, + stream: FS.chrdev_stream_ops + } + }; + } + var node = FS.createNode(parent, name, mode, dev); + if (FS.isDir(node.mode)) { + node.node_ops = MEMFS.ops_table.dir.node; + node.stream_ops = MEMFS.ops_table.dir.stream; + node.contents = {}; + } else if (FS.isFile(node.mode)) { + node.node_ops = MEMFS.ops_table.file.node; + node.stream_ops = MEMFS.ops_table.file.stream; + node.usedBytes = 0; // The actual number of bytes used in the typed array, as opposed to contents.length which gives the whole capacity. + // When the byte data of the file is populated, this will point to either a typed array, or a normal JS array. Typed arrays are preferred + // for performance, and used by default. However, typed arrays are not resizable like normal JS arrays are, so there is a small disk size + // penalty involved for appending file writes that continuously grow a file similar to std::vector capacity vs used -scheme. + node.contents = null; + } else if (FS.isLink(node.mode)) { + node.node_ops = MEMFS.ops_table.link.node; + node.stream_ops = MEMFS.ops_table.link.stream; + } else if (FS.isChrdev(node.mode)) { + node.node_ops = MEMFS.ops_table.chrdev.node; + node.stream_ops = MEMFS.ops_table.chrdev.stream; + } + node.timestamp = Date.now(); + // add the new node to the parent + if (parent) { + parent.contents[name] = node; + } + return node; + },getFileDataAsRegularArray:function (node) { + if (node.contents && node.contents.subarray) { + var arr = []; + for (var i = 0; i < node.usedBytes; ++i) arr.push(node.contents[i]); + return arr; // Returns a copy of the original data. + } + return node.contents; // No-op, the file contents are already in a JS array. Return as-is. + },getFileDataAsTypedArray:function (node) { + if (!node.contents) return new Uint8Array; + if (node.contents.subarray) return node.contents.subarray(0, node.usedBytes); // Make sure to not return excess unused bytes. + return new Uint8Array(node.contents); + },expandFileStorage:function (node, newCapacity) { + var prevCapacity = node.contents ? node.contents.length : 0; + if (prevCapacity >= newCapacity) return; // No need to expand, the storage was already large enough. + // Don't expand strictly to the given requested limit if it's only a very small increase, but instead geometrically grow capacity. + // For small filesizes (<1MB), perform size*2 geometric increase, but for large sizes, do a much more conservative size*1.125 increase to + // avoid overshooting the allocation cap by a very large margin. + var CAPACITY_DOUBLING_MAX = 1024 * 1024; + newCapacity = Math.max(newCapacity, (prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2.0 : 1.125)) | 0); + if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256); // At minimum allocate 256b for each file when expanding. + var oldContents = node.contents; + node.contents = new Uint8Array(newCapacity); // Allocate new storage. + if (node.usedBytes > 0) node.contents.set(oldContents.subarray(0, node.usedBytes), 0); // Copy old data over to the new storage. + return; + },resizeFileStorage:function (node, newSize) { + if (node.usedBytes == newSize) return; + if (newSize == 0) { + node.contents = null; // Fully decommit when requesting a resize to zero. + node.usedBytes = 0; + return; + } + if (!node.contents || node.contents.subarray) { // Resize a typed array if that is being used as the backing store. + var oldContents = node.contents; + node.contents = new Uint8Array(new ArrayBuffer(newSize)); // Allocate new storage. + if (oldContents) { + node.contents.set(oldContents.subarray(0, Math.min(newSize, node.usedBytes))); // Copy old data over to the new storage. + } + node.usedBytes = newSize; + return; + } + // Backing with a JS array. + if (!node.contents) node.contents = []; + if (node.contents.length > newSize) node.contents.length = newSize; + else while (node.contents.length < newSize) node.contents.push(0); + node.usedBytes = newSize; + },node_ops:{getattr:function (node) { + var attr = {}; + // device numbers reuse inode numbers. + attr.dev = FS.isChrdev(node.mode) ? node.id : 1; + attr.ino = node.id; + attr.mode = node.mode; + attr.nlink = 1; + attr.uid = 0; + attr.gid = 0; + attr.rdev = node.rdev; + if (FS.isDir(node.mode)) { + attr.size = 4096; + } else if (FS.isFile(node.mode)) { + attr.size = node.usedBytes; + } else if (FS.isLink(node.mode)) { + attr.size = node.link.length; + } else { + attr.size = 0; + } + attr.atime = new Date(node.timestamp); + attr.mtime = new Date(node.timestamp); + attr.ctime = new Date(node.timestamp); + // NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize), + // but this is not required by the standard. + attr.blksize = 4096; + attr.blocks = Math.ceil(attr.size / attr.blksize); + return attr; + },setattr:function (node, attr) { + if (attr.mode !== undefined) { + node.mode = attr.mode; + } + if (attr.timestamp !== undefined) { + node.timestamp = attr.timestamp; + } + if (attr.size !== undefined) { + MEMFS.resizeFileStorage(node, attr.size); + } + },lookup:function (parent, name) { + throw FS.genericErrors[44]; + },mknod:function (parent, name, mode, dev) { + return MEMFS.createNode(parent, name, mode, dev); + },rename:function (old_node, new_dir, new_name) { + // if we're overwriting a directory at new_name, make sure it's empty. + if (FS.isDir(old_node.mode)) { + var new_node; + try { + new_node = FS.lookupNode(new_dir, new_name); + } catch (e) { + } + if (new_node) { + for (var i in new_node.contents) { + throw new FS.ErrnoError(55); + } + } + } + // do the internal rewiring + delete old_node.parent.contents[old_node.name]; + old_node.name = new_name; + new_dir.contents[new_name] = old_node; + old_node.parent = new_dir; + },unlink:function (parent, name) { + delete parent.contents[name]; + },rmdir:function (parent, name) { + var node = FS.lookupNode(parent, name); + for (var i in node.contents) { + throw new FS.ErrnoError(55); + } + delete parent.contents[name]; + },readdir:function (node) { + var entries = ['.', '..']; + for (var key in node.contents) { + if (!node.contents.hasOwnProperty(key)) { + continue; + } + entries.push(key); + } + return entries; + },symlink:function (parent, newname, oldpath) { + var node = MEMFS.createNode(parent, newname, 511 /* 0777 */ | 40960, 0); + node.link = oldpath; + return node; + },readlink:function (node) { + if (!FS.isLink(node.mode)) { + throw new FS.ErrnoError(28); + } + return node.link; + }},stream_ops:{read:function (stream, buffer, offset, length, position) { + var contents = stream.node.contents; + if (position >= stream.node.usedBytes) return 0; + var size = Math.min(stream.node.usedBytes - position, length); + assert(size >= 0); + if (size > 8 && contents.subarray) { // non-trivial, and typed array + buffer.set(contents.subarray(position, position + size), offset); + } else { + for (var i = 0; i < size; i++) buffer[offset + i] = contents[position + i]; + } + return size; + },write:function (stream, buffer, offset, length, position, canOwn) { + // The data buffer should be a typed array view + assert(!(buffer instanceof ArrayBuffer)); + // If the buffer is located in main memory (HEAP), and if + // memory can grow, we can't hold on to references of the + // memory buffer, as they may get invalidated. That means we + // need to do copy its contents. + if (buffer.buffer === HEAP8.buffer) { + // FIXME: this is inefficient as the file packager may have + // copied the data into memory already - we may want to + // integrate more there and let the file packager loading + // code be able to query if memory growth is on or off. + if (canOwn) { + warnOnce('file packager has copied file data into memory, but in memory growth we are forced to copy it again (see --no-heap-copy)'); + } + canOwn = false; + } + + if (!length) return 0; + var node = stream.node; + node.timestamp = Date.now(); + + if (buffer.subarray && (!node.contents || node.contents.subarray)) { // This write is from a typed array to a typed array? + if (canOwn) { + assert(position === 0, 'canOwn must imply no weird position inside the file'); + node.contents = buffer.subarray(offset, offset + length); + node.usedBytes = length; + return length; + } else if (node.usedBytes === 0 && position === 0) { // If this is a simple first write to an empty file, do a fast set since we don't need to care about old data. + node.contents = new Uint8Array(buffer.subarray(offset, offset + length)); + node.usedBytes = length; + return length; + } else if (position + length <= node.usedBytes) { // Writing to an already allocated and used subrange of the file? + node.contents.set(buffer.subarray(offset, offset + length), position); + return length; + } + } + + // Appending to an existing file and we need to reallocate, or source data did not come as a typed array. + MEMFS.expandFileStorage(node, position+length); + if (node.contents.subarray && buffer.subarray) node.contents.set(buffer.subarray(offset, offset + length), position); // Use typed array write if available. + else { + for (var i = 0; i < length; i++) { + node.contents[position + i] = buffer[offset + i]; // Or fall back to manual write if not. + } + } + node.usedBytes = Math.max(node.usedBytes, position+length); + return length; + },llseek:function (stream, offset, whence) { + var position = offset; + if (whence === 1) { + position += stream.position; + } else if (whence === 2) { + if (FS.isFile(stream.node.mode)) { + position += stream.node.usedBytes; + } + } + if (position < 0) { + throw new FS.ErrnoError(28); + } + return position; + },allocate:function (stream, offset, length) { + MEMFS.expandFileStorage(stream.node, offset + length); + stream.node.usedBytes = Math.max(stream.node.usedBytes, offset + length); + },mmap:function (stream, buffer, offset, length, position, prot, flags) { + // The data buffer should be a typed array view + assert(!(buffer instanceof ArrayBuffer)); + if (!FS.isFile(stream.node.mode)) { + throw new FS.ErrnoError(43); + } + var ptr; + var allocated; + var contents = stream.node.contents; + // Only make a new copy when MAP_PRIVATE is specified. + if ( !(flags & 2) && + contents.buffer === buffer.buffer ) { + // We can't emulate MAP_SHARED when the file is not backed by the buffer + // we're mapping to (e.g. the HEAP buffer). + allocated = false; + ptr = contents.byteOffset; + } else { + // Try to avoid unnecessary slices. + if (position > 0 || position + length < stream.node.usedBytes) { + if (contents.subarray) { + contents = contents.subarray(position, position + length); + } else { + contents = Array.prototype.slice.call(contents, position, position + length); + } + } + allocated = true; + // malloc() can lead to growing the heap. If targeting the heap, we need to + // re-acquire the heap buffer object in case growth had occurred. + var fromHeap = (buffer.buffer == HEAP8.buffer); + ptr = _malloc(length); + if (!ptr) { + throw new FS.ErrnoError(48); + } + (fromHeap ? HEAP8 : buffer).set(contents, ptr); + } + return { ptr: ptr, allocated: allocated }; + },msync:function (stream, buffer, offset, length, mmapFlags) { + if (!FS.isFile(stream.node.mode)) { + throw new FS.ErrnoError(43); + } + if (mmapFlags & 2) { + // MAP_PRIVATE calls need not to be synced back to underlying fs + return 0; + } + + var bytesWritten = MEMFS.stream_ops.write(stream, buffer, 0, length, offset, false); + // should we check if bytesWritten and length are the same? + return 0; + }}}; + + var ERRNO_MESSAGES={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"}; + + var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:function (e) { + if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + stackTrace(); + return ___setErrNo(e.errno); + },lookupPath:function (path, opts) { + path = PATH_FS.resolve(FS.cwd(), path); + opts = opts || {}; + + if (!path) return { path: '', node: null }; + + var defaults = { + follow_mount: true, + recurse_count: 0 + }; + for (var key in defaults) { + if (opts[key] === undefined) { + opts[key] = defaults[key]; + } + } + + if (opts.recurse_count > 8) { // max recursive lookup of 8 + throw new FS.ErrnoError(32); + } + + // split the path + var parts = PATH.normalizeArray(path.split('/').filter(function(p) { + return !!p; + }), false); + + // start at the root + var current = FS.root; + var current_path = '/'; + + for (var i = 0; i < parts.length; i++) { + var islast = (i === parts.length-1); + if (islast && opts.parent) { + // stop resolving + break; + } + + current = FS.lookupNode(current, parts[i]); + current_path = PATH.join2(current_path, parts[i]); + + // jump to the mount's root node if this is a mountpoint + if (FS.isMountpoint(current)) { + if (!islast || (islast && opts.follow_mount)) { + current = current.mounted.root; + } + } + + // by default, lookupPath will not follow a symlink if it is the final path component. + // setting opts.follow = true will override this behavior. + if (!islast || opts.follow) { + var count = 0; + while (FS.isLink(current.mode)) { + var link = FS.readlink(current_path); + current_path = PATH_FS.resolve(PATH.dirname(current_path), link); + + var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count }); + current = lookup.node; + + if (count++ > 40) { // limit max consecutive symlinks to 40 (SYMLOOP_MAX). + throw new FS.ErrnoError(32); + } + } + } + } + + return { path: current_path, node: current }; + },getPath:function (node) { + var path; + while (true) { + if (FS.isRoot(node)) { + var mount = node.mount.mountpoint; + if (!path) return mount; + return mount[mount.length-1] !== '/' ? mount + '/' + path : mount + path; + } + path = path ? node.name + '/' + path : node.name; + node = node.parent; + } + },hashName:function (parentid, name) { + var hash = 0; + + + for (var i = 0; i < name.length; i++) { + hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0; + } + return ((parentid + hash) >>> 0) % FS.nameTable.length; + },hashAddNode:function (node) { + var hash = FS.hashName(node.parent.id, node.name); + node.name_next = FS.nameTable[hash]; + FS.nameTable[hash] = node; + },hashRemoveNode:function (node) { + var hash = FS.hashName(node.parent.id, node.name); + if (FS.nameTable[hash] === node) { + FS.nameTable[hash] = node.name_next; + } else { + var current = FS.nameTable[hash]; + while (current) { + if (current.name_next === node) { + current.name_next = node.name_next; + break; + } + current = current.name_next; + } + } + },lookupNode:function (parent, name) { + var err = FS.mayLookup(parent); + if (err) { + throw new FS.ErrnoError(err, parent); + } + var hash = FS.hashName(parent.id, name); + for (var node = FS.nameTable[hash]; node; node = node.name_next) { + var nodeName = node.name; + if (node.parent.id === parent.id && nodeName === name) { + return node; + } + } + // if we failed to find it in the cache, call into the VFS + return FS.lookup(parent, name); + },createNode:function (parent, name, mode, rdev) { + if (!FS.FSNode) { + FS.FSNode = function(parent, name, mode, rdev) { + if (!parent) { + parent = this; // root node sets parent to itself + } + this.parent = parent; + this.mount = parent.mount; + this.mounted = null; + this.id = FS.nextInode++; + this.name = name; + this.mode = mode; + this.node_ops = {}; + this.stream_ops = {}; + this.rdev = rdev; + }; + + FS.FSNode.prototype = {}; + + // compatibility + var readMode = 292 | 73; + var writeMode = 146; + + // NOTE we must use Object.defineProperties instead of individual calls to + // Object.defineProperty in order to make closure compiler happy + Object.defineProperties(FS.FSNode.prototype, { + read: { + get: function() { return (this.mode & readMode) === readMode; }, + set: function(val) { val ? this.mode |= readMode : this.mode &= ~readMode; } + }, + write: { + get: function() { return (this.mode & writeMode) === writeMode; }, + set: function(val) { val ? this.mode |= writeMode : this.mode &= ~writeMode; } + }, + isFolder: { + get: function() { return FS.isDir(this.mode); } + }, + isDevice: { + get: function() { return FS.isChrdev(this.mode); } + } + }); + } + + var node = new FS.FSNode(parent, name, mode, rdev); + + FS.hashAddNode(node); + + return node; + },destroyNode:function (node) { + FS.hashRemoveNode(node); + },isRoot:function (node) { + return node === node.parent; + },isMountpoint:function (node) { + return !!node.mounted; + },isFile:function (mode) { + return (mode & 61440) === 32768; + },isDir:function (mode) { + return (mode & 61440) === 16384; + },isLink:function (mode) { + return (mode & 61440) === 40960; + },isChrdev:function (mode) { + return (mode & 61440) === 8192; + },isBlkdev:function (mode) { + return (mode & 61440) === 24576; + },isFIFO:function (mode) { + return (mode & 61440) === 4096; + },isSocket:function (mode) { + return (mode & 49152) === 49152; + },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) { + var flags = FS.flagModes[str]; + if (typeof flags === 'undefined') { + throw new Error('Unknown file open mode: ' + str); + } + return flags; + },flagsToPermissionString:function (flag) { + var perms = ['r', 'w', 'rw'][flag & 3]; + if ((flag & 512)) { + perms += 'w'; + } + return perms; + },nodePermissions:function (node, perms) { + if (FS.ignorePermissions) { + return 0; + } + // return 0 if any user, group or owner bits are set. + if (perms.indexOf('r') !== -1 && !(node.mode & 292)) { + return 2; + } else if (perms.indexOf('w') !== -1 && !(node.mode & 146)) { + return 2; + } else if (perms.indexOf('x') !== -1 && !(node.mode & 73)) { + return 2; + } + return 0; + },mayLookup:function (dir) { + var err = FS.nodePermissions(dir, 'x'); + if (err) return err; + if (!dir.node_ops.lookup) return 2; + return 0; + },mayCreate:function (dir, name) { + try { + var node = FS.lookupNode(dir, name); + return 20; + } catch (e) { + } + return FS.nodePermissions(dir, 'wx'); + },mayDelete:function (dir, name, isdir) { + var node; + try { + node = FS.lookupNode(dir, name); + } catch (e) { + return e.errno; + } + var err = FS.nodePermissions(dir, 'wx'); + if (err) { + return err; + } + if (isdir) { + if (!FS.isDir(node.mode)) { + return 54; + } + if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) { + return 10; + } + } else { + if (FS.isDir(node.mode)) { + return 31; + } + } + return 0; + },mayOpen:function (node, flags) { + if (!node) { + return 44; + } + if (FS.isLink(node.mode)) { + return 32; + } else if (FS.isDir(node.mode)) { + if (FS.flagsToPermissionString(flags) !== 'r' || // opening for write + (flags & 512)) { // TODO: check for O_SEARCH? (== search for dir only) + return 31; + } + } + return FS.nodePermissions(node, FS.flagsToPermissionString(flags)); + },MAX_OPEN_FDS:4096,nextfd:function (fd_start, fd_end) { + fd_start = fd_start || 0; + fd_end = fd_end || FS.MAX_OPEN_FDS; + for (var fd = fd_start; fd <= fd_end; fd++) { + if (!FS.streams[fd]) { + return fd; + } + } + throw new FS.ErrnoError(33); + },getStream:function (fd) { + return FS.streams[fd]; + },createStream:function (stream, fd_start, fd_end) { + if (!FS.FSStream) { + FS.FSStream = function(){}; + FS.FSStream.prototype = {}; + // compatibility + Object.defineProperties(FS.FSStream.prototype, { + object: { + get: function() { return this.node; }, + set: function(val) { this.node = val; } + }, + isRead: { + get: function() { return (this.flags & 2097155) !== 1; } + }, + isWrite: { + get: function() { return (this.flags & 2097155) !== 0; } + }, + isAppend: { + get: function() { return (this.flags & 1024); } + } + }); + } + // clone it, so we can return an instance of FSStream + var newStream = new FS.FSStream(); + for (var p in stream) { + newStream[p] = stream[p]; + } + stream = newStream; + var fd = FS.nextfd(fd_start, fd_end); + stream.fd = fd; + FS.streams[fd] = stream; + return stream; + },closeStream:function (fd) { + FS.streams[fd] = null; + },chrdev_stream_ops:{open:function (stream) { + var device = FS.getDevice(stream.node.rdev); + // override node's stream ops with the device's + stream.stream_ops = device.stream_ops; + // forward the open call + if (stream.stream_ops.open) { + stream.stream_ops.open(stream); + } + },llseek:function () { + throw new FS.ErrnoError(70); + }},major:function (dev) { + return ((dev) >> 8); + },minor:function (dev) { + return ((dev) & 0xff); + },makedev:function (ma, mi) { + return ((ma) << 8 | (mi)); + },registerDevice:function (dev, ops) { + FS.devices[dev] = { stream_ops: ops }; + },getDevice:function (dev) { + return FS.devices[dev]; + },getMounts:function (mount) { + var mounts = []; + var check = [mount]; + + while (check.length) { + var m = check.pop(); + + mounts.push(m); + + check.push.apply(check, m.mounts); + } + + return mounts; + },syncfs:function (populate, callback) { + if (typeof(populate) === 'function') { + callback = populate; + populate = false; + } + + FS.syncFSRequests++; + + if (FS.syncFSRequests > 1) { + console.log('warning: ' + FS.syncFSRequests + ' FS.syncfs operations in flight at once, probably just doing extra work'); + } + + var mounts = FS.getMounts(FS.root.mount); + var completed = 0; + + function doCallback(err) { + assert(FS.syncFSRequests > 0); + FS.syncFSRequests--; + return callback(err); + } + + function done(err) { + if (err) { + if (!done.errored) { + done.errored = true; + return doCallback(err); + } + return; + } + if (++completed >= mounts.length) { + doCallback(null); + } + }; + + // sync all mounts + mounts.forEach(function (mount) { + if (!mount.type.syncfs) { + return done(null); + } + mount.type.syncfs(mount, populate, done); + }); + },mount:function (type, opts, mountpoint) { + if (typeof type === 'string') { + // The filesystem was not included, and instead we have an error + // message stored in the variable. + throw type; + } + var root = mountpoint === '/'; + var pseudo = !mountpoint; + var node; + + if (root && FS.root) { + throw new FS.ErrnoError(10); + } else if (!root && !pseudo) { + var lookup = FS.lookupPath(mountpoint, { follow_mount: false }); + + mountpoint = lookup.path; // use the absolute path + node = lookup.node; + + if (FS.isMountpoint(node)) { + throw new FS.ErrnoError(10); + } + + if (!FS.isDir(node.mode)) { + throw new FS.ErrnoError(54); + } + } + + var mount = { + type: type, + opts: opts, + mountpoint: mountpoint, + mounts: [] + }; + + // create a root node for the fs + var mountRoot = type.mount(mount); + mountRoot.mount = mount; + mount.root = mountRoot; + + if (root) { + FS.root = mountRoot; + } else if (node) { + // set as a mountpoint + node.mounted = mount; + + // add the new mount to the current mount's children + if (node.mount) { + node.mount.mounts.push(mount); + } + } + + return mountRoot; + },unmount:function (mountpoint) { + var lookup = FS.lookupPath(mountpoint, { follow_mount: false }); + + if (!FS.isMountpoint(lookup.node)) { + throw new FS.ErrnoError(28); + } + + // destroy the nodes for this mount, and all its child mounts + var node = lookup.node; + var mount = node.mounted; + var mounts = FS.getMounts(mount); + + Object.keys(FS.nameTable).forEach(function (hash) { + var current = FS.nameTable[hash]; + + while (current) { + var next = current.name_next; + + if (mounts.indexOf(current.mount) !== -1) { + FS.destroyNode(current); + } + + current = next; + } + }); + + // no longer a mountpoint + node.mounted = null; + + // remove this mount from the child mounts + var idx = node.mount.mounts.indexOf(mount); + assert(idx !== -1); + node.mount.mounts.splice(idx, 1); + },lookup:function (parent, name) { + return parent.node_ops.lookup(parent, name); + },mknod:function (path, mode, dev) { + var lookup = FS.lookupPath(path, { parent: true }); + var parent = lookup.node; + var name = PATH.basename(path); + if (!name || name === '.' || name === '..') { + throw new FS.ErrnoError(28); + } + var err = FS.mayCreate(parent, name); + if (err) { + throw new FS.ErrnoError(err); + } + if (!parent.node_ops.mknod) { + throw new FS.ErrnoError(63); + } + return parent.node_ops.mknod(parent, name, mode, dev); + },create:function (path, mode) { + mode = mode !== undefined ? mode : 438 /* 0666 */; + mode &= 4095; + mode |= 32768; + return FS.mknod(path, mode, 0); + },mkdir:function (path, mode) { + mode = mode !== undefined ? mode : 511 /* 0777 */; + mode &= 511 | 512; + mode |= 16384; + return FS.mknod(path, mode, 0); + },mkdirTree:function (path, mode) { + var dirs = path.split('/'); + var d = ''; + for (var i = 0; i < dirs.length; ++i) { + if (!dirs[i]) continue; + d += '/' + dirs[i]; + try { + FS.mkdir(d, mode); + } catch(e) { + if (e.errno != 20) throw e; + } + } + },mkdev:function (path, mode, dev) { + if (typeof(dev) === 'undefined') { + dev = mode; + mode = 438 /* 0666 */; + } + mode |= 8192; + return FS.mknod(path, mode, dev); + },symlink:function (oldpath, newpath) { + if (!PATH_FS.resolve(oldpath)) { + throw new FS.ErrnoError(44); + } + var lookup = FS.lookupPath(newpath, { parent: true }); + var parent = lookup.node; + if (!parent) { + throw new FS.ErrnoError(44); + } + var newname = PATH.basename(newpath); + var err = FS.mayCreate(parent, newname); + if (err) { + throw new FS.ErrnoError(err); + } + if (!parent.node_ops.symlink) { + throw new FS.ErrnoError(63); + } + return parent.node_ops.symlink(parent, newname, oldpath); + },rename:function (old_path, new_path) { + var old_dirname = PATH.dirname(old_path); + var new_dirname = PATH.dirname(new_path); + var old_name = PATH.basename(old_path); + var new_name = PATH.basename(new_path); + // parents must exist + var lookup, old_dir, new_dir; + try { + lookup = FS.lookupPath(old_path, { parent: true }); + old_dir = lookup.node; + lookup = FS.lookupPath(new_path, { parent: true }); + new_dir = lookup.node; + } catch (e) { + throw new FS.ErrnoError(10); + } + if (!old_dir || !new_dir) throw new FS.ErrnoError(44); + // need to be part of the same mount + if (old_dir.mount !== new_dir.mount) { + throw new FS.ErrnoError(75); + } + // source must exist + var old_node = FS.lookupNode(old_dir, old_name); + // old path should not be an ancestor of the new path + var relative = PATH_FS.relative(old_path, new_dirname); + if (relative.charAt(0) !== '.') { + throw new FS.ErrnoError(28); + } + // new path should not be an ancestor of the old path + relative = PATH_FS.relative(new_path, old_dirname); + if (relative.charAt(0) !== '.') { + throw new FS.ErrnoError(55); + } + // see if the new path already exists + var new_node; + try { + new_node = FS.lookupNode(new_dir, new_name); + } catch (e) { + // not fatal + } + // early out if nothing needs to change + if (old_node === new_node) { + return; + } + // we'll need to delete the old entry + var isdir = FS.isDir(old_node.mode); + var err = FS.mayDelete(old_dir, old_name, isdir); + if (err) { + throw new FS.ErrnoError(err); + } + // need delete permissions if we'll be overwriting. + // need create permissions if new doesn't already exist. + err = new_node ? + FS.mayDelete(new_dir, new_name, isdir) : + FS.mayCreate(new_dir, new_name); + if (err) { + throw new FS.ErrnoError(err); + } + if (!old_dir.node_ops.rename) { + throw new FS.ErrnoError(63); + } + if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) { + throw new FS.ErrnoError(10); + } + // if we are going to change the parent, check write permissions + if (new_dir !== old_dir) { + err = FS.nodePermissions(old_dir, 'w'); + if (err) { + throw new FS.ErrnoError(err); + } + } + try { + if (FS.trackingDelegate['willMovePath']) { + FS.trackingDelegate['willMovePath'](old_path, new_path); + } + } catch(e) { + console.log("FS.trackingDelegate['willMovePath']('"+old_path+"', '"+new_path+"') threw an exception: " + e.message); + } + // remove the node from the lookup hash + FS.hashRemoveNode(old_node); + // do the underlying fs rename + try { + old_dir.node_ops.rename(old_node, new_dir, new_name); + } catch (e) { + throw e; + } finally { + // add the node back to the hash (in case node_ops.rename + // changed its name) + FS.hashAddNode(old_node); + } + try { + if (FS.trackingDelegate['onMovePath']) FS.trackingDelegate['onMovePath'](old_path, new_path); + } catch(e) { + console.log("FS.trackingDelegate['onMovePath']('"+old_path+"', '"+new_path+"') threw an exception: " + e.message); + } + },rmdir:function (path) { + var lookup = FS.lookupPath(path, { parent: true }); + var parent = lookup.node; + var name = PATH.basename(path); + var node = FS.lookupNode(parent, name); + var err = FS.mayDelete(parent, name, true); + if (err) { + throw new FS.ErrnoError(err); + } + if (!parent.node_ops.rmdir) { + throw new FS.ErrnoError(63); + } + if (FS.isMountpoint(node)) { + throw new FS.ErrnoError(10); + } + try { + if (FS.trackingDelegate['willDeletePath']) { + FS.trackingDelegate['willDeletePath'](path); + } + } catch(e) { + console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: " + e.message); + } + parent.node_ops.rmdir(parent, name); + FS.destroyNode(node); + try { + if (FS.trackingDelegate['onDeletePath']) FS.trackingDelegate['onDeletePath'](path); + } catch(e) { + console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: " + e.message); + } + },readdir:function (path) { + var lookup = FS.lookupPath(path, { follow: true }); + var node = lookup.node; + if (!node.node_ops.readdir) { + throw new FS.ErrnoError(54); + } + return node.node_ops.readdir(node); + },unlink:function (path) { + var lookup = FS.lookupPath(path, { parent: true }); + var parent = lookup.node; + var name = PATH.basename(path); + var node = FS.lookupNode(parent, name); + var err = FS.mayDelete(parent, name, false); + if (err) { + // According to POSIX, we should map EISDIR to EPERM, but + // we instead do what Linux does (and we must, as we use + // the musl linux libc). + throw new FS.ErrnoError(err); + } + if (!parent.node_ops.unlink) { + throw new FS.ErrnoError(63); + } + if (FS.isMountpoint(node)) { + throw new FS.ErrnoError(10); + } + try { + if (FS.trackingDelegate['willDeletePath']) { + FS.trackingDelegate['willDeletePath'](path); + } + } catch(e) { + console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: " + e.message); + } + parent.node_ops.unlink(parent, name); + FS.destroyNode(node); + try { + if (FS.trackingDelegate['onDeletePath']) FS.trackingDelegate['onDeletePath'](path); + } catch(e) { + console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: " + e.message); + } + },readlink:function (path) { + var lookup = FS.lookupPath(path); + var link = lookup.node; + if (!link) { + throw new FS.ErrnoError(44); + } + if (!link.node_ops.readlink) { + throw new FS.ErrnoError(28); + } + return PATH_FS.resolve(FS.getPath(link.parent), link.node_ops.readlink(link)); + },stat:function (path, dontFollow) { + var lookup = FS.lookupPath(path, { follow: !dontFollow }); + var node = lookup.node; + if (!node) { + throw new FS.ErrnoError(44); + } + if (!node.node_ops.getattr) { + throw new FS.ErrnoError(63); + } + return node.node_ops.getattr(node); + },lstat:function (path) { + return FS.stat(path, true); + },chmod:function (path, mode, dontFollow) { + var node; + if (typeof path === 'string') { + var lookup = FS.lookupPath(path, { follow: !dontFollow }); + node = lookup.node; + } else { + node = path; + } + if (!node.node_ops.setattr) { + throw new FS.ErrnoError(63); + } + node.node_ops.setattr(node, { + mode: (mode & 4095) | (node.mode & ~4095), + timestamp: Date.now() + }); + },lchmod:function (path, mode) { + FS.chmod(path, mode, true); + },fchmod:function (fd, mode) { + var stream = FS.getStream(fd); + if (!stream) { + throw new FS.ErrnoError(8); + } + FS.chmod(stream.node, mode); + },chown:function (path, uid, gid, dontFollow) { + var node; + if (typeof path === 'string') { + var lookup = FS.lookupPath(path, { follow: !dontFollow }); + node = lookup.node; + } else { + node = path; + } + if (!node.node_ops.setattr) { + throw new FS.ErrnoError(63); + } + node.node_ops.setattr(node, { + timestamp: Date.now() + // we ignore the uid / gid for now + }); + },lchown:function (path, uid, gid) { + FS.chown(path, uid, gid, true); + },fchown:function (fd, uid, gid) { + var stream = FS.getStream(fd); + if (!stream) { + throw new FS.ErrnoError(8); + } + FS.chown(stream.node, uid, gid); + },truncate:function (path, len) { + if (len < 0) { + throw new FS.ErrnoError(28); + } + var node; + if (typeof path === 'string') { + var lookup = FS.lookupPath(path, { follow: true }); + node = lookup.node; + } else { + node = path; + } + if (!node.node_ops.setattr) { + throw new FS.ErrnoError(63); + } + if (FS.isDir(node.mode)) { + throw new FS.ErrnoError(31); + } + if (!FS.isFile(node.mode)) { + throw new FS.ErrnoError(28); + } + var err = FS.nodePermissions(node, 'w'); + if (err) { + throw new FS.ErrnoError(err); + } + node.node_ops.setattr(node, { + size: len, + timestamp: Date.now() + }); + },ftruncate:function (fd, len) { + var stream = FS.getStream(fd); + if (!stream) { + throw new FS.ErrnoError(8); + } + if ((stream.flags & 2097155) === 0) { + throw new FS.ErrnoError(28); + } + FS.truncate(stream.node, len); + },utime:function (path, atime, mtime) { + var lookup = FS.lookupPath(path, { follow: true }); + var node = lookup.node; + node.node_ops.setattr(node, { + timestamp: Math.max(atime, mtime) + }); + },open:function (path, flags, mode, fd_start, fd_end) { + if (path === "") { + throw new FS.ErrnoError(44); + } + flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags; + mode = typeof mode === 'undefined' ? 438 /* 0666 */ : mode; + if ((flags & 64)) { + mode = (mode & 4095) | 32768; + } else { + mode = 0; + } + var node; + if (typeof path === 'object') { + node = path; + } else { + path = PATH.normalize(path); + try { + var lookup = FS.lookupPath(path, { + follow: !(flags & 131072) + }); + node = lookup.node; + } catch (e) { + // ignore + } + } + // perhaps we need to create the node + var created = false; + if ((flags & 64)) { + if (node) { + // if O_CREAT and O_EXCL are set, error out if the node already exists + if ((flags & 128)) { + throw new FS.ErrnoError(20); + } + } else { + // node doesn't exist, try to create it + node = FS.mknod(path, mode, 0); + created = true; + } + } + if (!node) { + throw new FS.ErrnoError(44); + } + // can't truncate a device + if (FS.isChrdev(node.mode)) { + flags &= ~512; + } + // if asked only for a directory, then this must be one + if ((flags & 65536) && !FS.isDir(node.mode)) { + throw new FS.ErrnoError(54); + } + // check permissions, if this is not a file we just created now (it is ok to + // create and write to a file with read-only permissions; it is read-only + // for later use) + if (!created) { + var err = FS.mayOpen(node, flags); + if (err) { + throw new FS.ErrnoError(err); + } + } + // do truncation if necessary + if ((flags & 512)) { + FS.truncate(node, 0); + } + // we've already handled these, don't pass down to the underlying vfs + flags &= ~(128 | 512); + + // register the stream with the filesystem + var stream = FS.createStream({ + node: node, + path: FS.getPath(node), // we want the absolute path to the node + flags: flags, + seekable: true, + position: 0, + stream_ops: node.stream_ops, + // used by the file family libc calls (fopen, fwrite, ferror, etc.) + ungotten: [], + error: false + }, fd_start, fd_end); + // call the new stream's open function + if (stream.stream_ops.open) { + stream.stream_ops.open(stream); + } + if (Module['logReadFiles'] && !(flags & 1)) { + if (!FS.readFiles) FS.readFiles = {}; + if (!(path in FS.readFiles)) { + FS.readFiles[path] = 1; + console.log("FS.trackingDelegate error on read file: " + path); + } + } + try { + if (FS.trackingDelegate['onOpenFile']) { + var trackingFlags = 0; + if ((flags & 2097155) !== 1) { + trackingFlags |= FS.tracking.openFlags.READ; + } + if ((flags & 2097155) !== 0) { + trackingFlags |= FS.tracking.openFlags.WRITE; + } + FS.trackingDelegate['onOpenFile'](path, trackingFlags); + } + } catch(e) { + console.log("FS.trackingDelegate['onOpenFile']('"+path+"', flags) threw an exception: " + e.message); + } + return stream; + },close:function (stream) { + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if (stream.getdents) stream.getdents = null; // free readdir state + try { + if (stream.stream_ops.close) { + stream.stream_ops.close(stream); + } + } catch (e) { + throw e; + } finally { + FS.closeStream(stream.fd); + } + stream.fd = null; + },isClosed:function (stream) { + return stream.fd === null; + },llseek:function (stream, offset, whence) { + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if (!stream.seekable || !stream.stream_ops.llseek) { + throw new FS.ErrnoError(70); + } + if (whence != 0 && whence != 1 && whence != 2) { + throw new FS.ErrnoError(28); + } + stream.position = stream.stream_ops.llseek(stream, offset, whence); + stream.ungotten = []; + return stream.position; + },read:function (stream, buffer, offset, length, position) { + if (length < 0 || position < 0) { + throw new FS.ErrnoError(28); + } + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if ((stream.flags & 2097155) === 1) { + throw new FS.ErrnoError(8); + } + if (FS.isDir(stream.node.mode)) { + throw new FS.ErrnoError(31); + } + if (!stream.stream_ops.read) { + throw new FS.ErrnoError(28); + } + var seeking = typeof position !== 'undefined'; + if (!seeking) { + position = stream.position; + } else if (!stream.seekable) { + throw new FS.ErrnoError(70); + } + var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position); + if (!seeking) stream.position += bytesRead; + return bytesRead; + },write:function (stream, buffer, offset, length, position, canOwn) { + if (length < 0 || position < 0) { + throw new FS.ErrnoError(28); + } + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if ((stream.flags & 2097155) === 0) { + throw new FS.ErrnoError(8); + } + if (FS.isDir(stream.node.mode)) { + throw new FS.ErrnoError(31); + } + if (!stream.stream_ops.write) { + throw new FS.ErrnoError(28); + } + if (stream.flags & 1024) { + // seek to the end before writing in append mode + FS.llseek(stream, 0, 2); + } + var seeking = typeof position !== 'undefined'; + if (!seeking) { + position = stream.position; + } else if (!stream.seekable) { + throw new FS.ErrnoError(70); + } + var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn); + if (!seeking) stream.position += bytesWritten; + try { + if (stream.path && FS.trackingDelegate['onWriteToFile']) FS.trackingDelegate['onWriteToFile'](stream.path); + } catch(e) { + console.log("FS.trackingDelegate['onWriteToFile']('"+stream.path+"') threw an exception: " + e.message); + } + return bytesWritten; + },allocate:function (stream, offset, length) { + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if (offset < 0 || length <= 0) { + throw new FS.ErrnoError(28); + } + if ((stream.flags & 2097155) === 0) { + throw new FS.ErrnoError(8); + } + if (!FS.isFile(stream.node.mode) && !FS.isDir(stream.node.mode)) { + throw new FS.ErrnoError(43); + } + if (!stream.stream_ops.allocate) { + throw new FS.ErrnoError(138); + } + stream.stream_ops.allocate(stream, offset, length); + },mmap:function (stream, buffer, offset, length, position, prot, flags) { + // User requests writing to file (prot & PROT_WRITE != 0). + // Checking if we have permissions to write to the file unless + // MAP_PRIVATE flag is set. According to POSIX spec it is possible + // to write to file opened in read-only mode with MAP_PRIVATE flag, + // as all modifications will be visible only in the memory of + // the current process. + if ((prot & 2) !== 0 + && (flags & 2) === 0 + && (stream.flags & 2097155) !== 2) { + throw new FS.ErrnoError(2); + } + if ((stream.flags & 2097155) === 1) { + throw new FS.ErrnoError(2); + } + if (!stream.stream_ops.mmap) { + throw new FS.ErrnoError(43); + } + return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags); + },msync:function (stream, buffer, offset, length, mmapFlags) { + if (!stream || !stream.stream_ops.msync) { + return 0; + } + return stream.stream_ops.msync(stream, buffer, offset, length, mmapFlags); + },munmap:function (stream) { + return 0; + },ioctl:function (stream, cmd, arg) { + if (!stream.stream_ops.ioctl) { + throw new FS.ErrnoError(59); + } + return stream.stream_ops.ioctl(stream, cmd, arg); + },readFile:function (path, opts) { + opts = opts || {}; + opts.flags = opts.flags || 'r'; + opts.encoding = opts.encoding || 'binary'; + if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') { + throw new Error('Invalid encoding type "' + opts.encoding + '"'); + } + var ret; + var stream = FS.open(path, opts.flags); + var stat = FS.stat(path); + var length = stat.size; + var buf = new Uint8Array(length); + FS.read(stream, buf, 0, length, 0); + if (opts.encoding === 'utf8') { + ret = UTF8ArrayToString(buf, 0); + } else if (opts.encoding === 'binary') { + ret = buf; + } + FS.close(stream); + return ret; + },writeFile:function (path, data, opts) { + opts = opts || {}; + opts.flags = opts.flags || 'w'; + var stream = FS.open(path, opts.flags, opts.mode); + if (typeof data === 'string') { + var buf = new Uint8Array(lengthBytesUTF8(data)+1); + var actualNumBytes = stringToUTF8Array(data, buf, 0, buf.length); + FS.write(stream, buf, 0, actualNumBytes, undefined, opts.canOwn); + } else if (ArrayBuffer.isView(data)) { + FS.write(stream, data, 0, data.byteLength, undefined, opts.canOwn); + } else { + throw new Error('Unsupported data type'); + } + FS.close(stream); + },cwd:function () { + return FS.currentPath; + },chdir:function (path) { + var lookup = FS.lookupPath(path, { follow: true }); + if (lookup.node === null) { + throw new FS.ErrnoError(44); + } + if (!FS.isDir(lookup.node.mode)) { + throw new FS.ErrnoError(54); + } + var err = FS.nodePermissions(lookup.node, 'x'); + if (err) { + throw new FS.ErrnoError(err); + } + FS.currentPath = lookup.path; + },createDefaultDirectories:function () { + FS.mkdir('/tmp'); + FS.mkdir('/home'); + FS.mkdir('/home/web_user'); + },createDefaultDevices:function () { + // create /dev + FS.mkdir('/dev'); + // setup /dev/null + FS.registerDevice(FS.makedev(1, 3), { + read: function() { return 0; }, + write: function(stream, buffer, offset, length, pos) { return length; } + }); + FS.mkdev('/dev/null', FS.makedev(1, 3)); + // setup /dev/tty and /dev/tty1 + // stderr needs to print output using Module['printErr'] + // so we register a second tty just for it. + TTY.register(FS.makedev(5, 0), TTY.default_tty_ops); + TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops); + FS.mkdev('/dev/tty', FS.makedev(5, 0)); + FS.mkdev('/dev/tty1', FS.makedev(6, 0)); + // setup /dev/[u]random + var random_device; + if (typeof crypto === 'object' && typeof crypto['getRandomValues'] === 'function') { + // for modern web browsers + var randomBuffer = new Uint8Array(1); + random_device = function() { crypto.getRandomValues(randomBuffer); return randomBuffer[0]; }; + } else + if (ENVIRONMENT_IS_NODE) { + // for nodejs with or without crypto support included + try { + var crypto_module = require('crypto'); + // nodejs has crypto support + random_device = function() { return crypto_module['randomBytes'](1)[0]; }; + } catch (e) { + // nodejs doesn't have crypto support + } + } else + {} + if (!random_device) { + // we couldn't find a proper implementation, as Math.random() is not suitable for /dev/random, see emscripten-core/emscripten/pull/7096 + random_device = function() { abort("no cryptographic support found for random_device. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };"); }; + } + FS.createDevice('/dev', 'random', random_device); + FS.createDevice('/dev', 'urandom', random_device); + // we're not going to emulate the actual shm device, + // just create the tmp dirs that reside in it commonly + FS.mkdir('/dev/shm'); + FS.mkdir('/dev/shm/tmp'); + },createSpecialDirectories:function () { + // create /proc/self/fd which allows /proc/self/fd/6 => readlink gives the name of the stream for fd 6 (see test_unistd_ttyname) + FS.mkdir('/proc'); + FS.mkdir('/proc/self'); + FS.mkdir('/proc/self/fd'); + FS.mount({ + mount: function() { + var node = FS.createNode('/proc/self', 'fd', 16384 | 511 /* 0777 */, 73); + node.node_ops = { + lookup: function(parent, name) { + var fd = +name; + var stream = FS.getStream(fd); + if (!stream) throw new FS.ErrnoError(8); + var ret = { + parent: null, + mount: { mountpoint: 'fake' }, + node_ops: { readlink: function() { return stream.path } } + }; + ret.parent = ret; // make it look like a simple root node + return ret; + } + }; + return node; + } + }, {}, '/proc/self/fd'); + },createStandardStreams:function () { + // TODO deprecate the old functionality of a single + // input / output callback and that utilizes FS.createDevice + // and instead require a unique set of stream ops + + // by default, we symlink the standard streams to the + // default tty devices. however, if the standard streams + // have been overwritten we create a unique device for + // them instead. + if (Module['stdin']) { + FS.createDevice('/dev', 'stdin', Module['stdin']); + } else { + FS.symlink('/dev/tty', '/dev/stdin'); + } + if (Module['stdout']) { + FS.createDevice('/dev', 'stdout', null, Module['stdout']); + } else { + FS.symlink('/dev/tty', '/dev/stdout'); + } + if (Module['stderr']) { + FS.createDevice('/dev', 'stderr', null, Module['stderr']); + } else { + FS.symlink('/dev/tty1', '/dev/stderr'); + } + + // open default streams for the stdin, stdout and stderr devices + var stdin = FS.open('/dev/stdin', 'r'); + var stdout = FS.open('/dev/stdout', 'w'); + var stderr = FS.open('/dev/stderr', 'w'); + assert(stdin.fd === 0, 'invalid handle for stdin (' + stdin.fd + ')'); + assert(stdout.fd === 1, 'invalid handle for stdout (' + stdout.fd + ')'); + assert(stderr.fd === 2, 'invalid handle for stderr (' + stderr.fd + ')'); + },ensureErrnoError:function () { + if (FS.ErrnoError) return; + FS.ErrnoError = function ErrnoError(errno, node) { + this.node = node; + this.setErrno = function(errno) { + this.errno = errno; + for (var key in ERRNO_CODES) { + if (ERRNO_CODES[key] === errno) { + this.code = key; + break; + } + } + }; + this.setErrno(errno); + this.message = ERRNO_MESSAGES[errno]; + + // Try to get a maximally helpful stack trace. On Node.js, getting Error.stack + // now ensures it shows what we want. + if (this.stack) { + // Define the stack property for Node.js 4, which otherwise errors on the next line. + Object.defineProperty(this, "stack", { value: (new Error).stack, writable: true }); + this.stack = demangleAll(this.stack); + } + }; + FS.ErrnoError.prototype = new Error(); + FS.ErrnoError.prototype.constructor = FS.ErrnoError; + // Some errors may happen quite a bit, to avoid overhead we reuse them (and suffer a lack of stack info) + [44].forEach(function(code) { + FS.genericErrors[code] = new FS.ErrnoError(code); + FS.genericErrors[code].stack = ''; + }); + },staticInit:function () { + FS.ensureErrnoError(); + + FS.nameTable = new Array(4096); + + FS.mount(MEMFS, {}, '/'); + + FS.createDefaultDirectories(); + FS.createDefaultDevices(); + FS.createSpecialDirectories(); + + FS.filesystems = { + 'MEMFS': MEMFS, + }; + },init:function (input, output, error) { + 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)'); + FS.init.initialized = true; + + FS.ensureErrnoError(); + + // Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here + Module['stdin'] = input || Module['stdin']; + Module['stdout'] = output || Module['stdout']; + Module['stderr'] = error || Module['stderr']; + + FS.createStandardStreams(); + },quit:function () { + FS.init.initialized = false; + // force-flush all streams, so we get musl std streams printed out + var fflush = Module['_fflush']; + if (fflush) fflush(0); + // close all of our streams + for (var i = 0; i < FS.streams.length; i++) { + var stream = FS.streams[i]; + if (!stream) { + continue; + } + FS.close(stream); + } + },getMode:function (canRead, canWrite) { + var mode = 0; + if (canRead) mode |= 292 | 73; + if (canWrite) mode |= 146; + return mode; + },joinPath:function (parts, forceRelative) { + var path = PATH.join.apply(null, parts); + if (forceRelative && path[0] == '/') path = path.substr(1); + return path; + },absolutePath:function (relative, base) { + return PATH_FS.resolve(base, relative); + },standardizePath:function (path) { + return PATH.normalize(path); + },findObject:function (path, dontResolveLastLink) { + var ret = FS.analyzePath(path, dontResolveLastLink); + if (ret.exists) { + return ret.object; + } else { + ___setErrNo(ret.error); + return null; + } + },analyzePath:function (path, dontResolveLastLink) { + // operate from within the context of the symlink's target + try { + var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink }); + path = lookup.path; + } catch (e) { + } + var ret = { + isRoot: false, exists: false, error: 0, name: null, path: null, object: null, + parentExists: false, parentPath: null, parentObject: null + }; + try { + var lookup = FS.lookupPath(path, { parent: true }); + ret.parentExists = true; + ret.parentPath = lookup.path; + ret.parentObject = lookup.node; + ret.name = PATH.basename(path); + lookup = FS.lookupPath(path, { follow: !dontResolveLastLink }); + ret.exists = true; + ret.path = lookup.path; + ret.object = lookup.node; + ret.name = lookup.node.name; + ret.isRoot = lookup.path === '/'; + } catch (e) { + ret.error = e.errno; + }; + return ret; + },createFolder:function (parent, name, canRead, canWrite) { + var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name); + var mode = FS.getMode(canRead, canWrite); + return FS.mkdir(path, mode); + },createPath:function (parent, path, canRead, canWrite) { + parent = typeof parent === 'string' ? parent : FS.getPath(parent); + var parts = path.split('/').reverse(); + while (parts.length) { + var part = parts.pop(); + if (!part) continue; + var current = PATH.join2(parent, part); + try { + FS.mkdir(current); + } catch (e) { + // ignore EEXIST + } + parent = current; + } + return current; + },createFile:function (parent, name, properties, canRead, canWrite) { + var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name); + var mode = FS.getMode(canRead, canWrite); + return FS.create(path, mode); + },createDataFile:function (parent, name, data, canRead, canWrite, canOwn) { + var path = name ? PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name) : parent; + var mode = FS.getMode(canRead, canWrite); + var node = FS.create(path, mode); + if (data) { + if (typeof data === 'string') { + var arr = new Array(data.length); + for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i); + data = arr; + } + // make sure we can write to the file + FS.chmod(node, mode | 146); + var stream = FS.open(node, 'w'); + FS.write(stream, data, 0, data.length, 0, canOwn); + FS.close(stream); + FS.chmod(node, mode); + } + return node; + },createDevice:function (parent, name, input, output) { + var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name); + var mode = FS.getMode(!!input, !!output); + if (!FS.createDevice.major) FS.createDevice.major = 64; + var dev = FS.makedev(FS.createDevice.major++, 0); + // Create a fake device that a set of stream ops to emulate + // the old behavior. + FS.registerDevice(dev, { + open: function(stream) { + stream.seekable = false; + }, + close: function(stream) { + // flush any pending line data + if (output && output.buffer && output.buffer.length) { + output(10); + } + }, + read: function(stream, buffer, offset, length, pos /* ignored */) { + var bytesRead = 0; + for (var i = 0; i < length; i++) { + var result; + try { + result = input(); + } catch (e) { + throw new FS.ErrnoError(29); + } + if (result === undefined && bytesRead === 0) { + throw new FS.ErrnoError(6); + } + if (result === null || result === undefined) break; + bytesRead++; + buffer[offset+i] = result; + } + if (bytesRead) { + stream.node.timestamp = Date.now(); + } + return bytesRead; + }, + write: function(stream, buffer, offset, length, pos) { + for (var i = 0; i < length; i++) { + try { + output(buffer[offset+i]); + } catch (e) { + throw new FS.ErrnoError(29); + } + } + if (length) { + stream.node.timestamp = Date.now(); + } + return i; + } + }); + return FS.mkdev(path, mode, dev); + },createLink:function (parent, name, target, canRead, canWrite) { + var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name); + return FS.symlink(target, path); + },forceLoadFile:function (obj) { + if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true; + var success = true; + if (typeof XMLHttpRequest !== 'undefined') { + 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."); + } else if (read_) { + // Command-line. + try { + // WARNING: Can't read binary files in V8's d8 or tracemonkey's js, as + // read() will try to parse UTF8. + obj.contents = intArrayFromString(read_(obj.url), true); + obj.usedBytes = obj.contents.length; + } catch (e) { + success = false; + } + } else { + throw new Error('Cannot load without read() or XMLHttpRequest.'); + } + if (!success) ___setErrNo(29); + return success; + },createLazyFile:function (parent, name, url, canRead, canWrite) { + // Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse. + function LazyUint8Array() { + this.lengthKnown = false; + this.chunks = []; // Loaded chunks. Index is the chunk number + } + LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) { + if (idx > this.length-1 || idx < 0) { + return undefined; + } + var chunkOffset = idx % this.chunkSize; + var chunkNum = (idx / this.chunkSize)|0; + return this.getter(chunkNum)[chunkOffset]; + }; + LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter(getter) { + this.getter = getter; + }; + LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() { + // Find length + var xhr = new XMLHttpRequest(); + xhr.open('HEAD', url, false); + xhr.send(null); + if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status); + var datalength = Number(xhr.getResponseHeader("Content-length")); + var header; + var hasByteServing = (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes"; + var usesGzip = (header = xhr.getResponseHeader("Content-Encoding")) && header === "gzip"; + + var chunkSize = 1024*1024; // Chunk size in bytes + + if (!hasByteServing) chunkSize = datalength; + + // Function to get a range from the remote URL. + var doXHR = (function(from, to) { + if (from > to) throw new Error("invalid range (" + from + ", " + to + ") or no bytes requested!"); + if (to > datalength-1) throw new Error("only " + datalength + " bytes available! programmer error!"); + + // TODO: Use mozResponseArrayBuffer, responseStream, etc. if available. + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + if (datalength !== chunkSize) xhr.setRequestHeader("Range", "bytes=" + from + "-" + to); + + // Some hints to the browser that we want binary data. + if (typeof Uint8Array != 'undefined') xhr.responseType = 'arraybuffer'; + if (xhr.overrideMimeType) { + xhr.overrideMimeType('text/plain; charset=x-user-defined'); + } + + xhr.send(null); + if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status); + if (xhr.response !== undefined) { + return new Uint8Array(xhr.response || []); + } else { + return intArrayFromString(xhr.responseText || '', true); + } + }); + var lazyArray = this; + lazyArray.setDataGetter(function(chunkNum) { + var start = chunkNum * chunkSize; + var end = (chunkNum+1) * chunkSize - 1; // including this byte + end = Math.min(end, datalength-1); // if datalength-1 is selected, this is the last block + if (typeof(lazyArray.chunks[chunkNum]) === "undefined") { + lazyArray.chunks[chunkNum] = doXHR(start, end); + } + if (typeof(lazyArray.chunks[chunkNum]) === "undefined") throw new Error("doXHR failed!"); + return lazyArray.chunks[chunkNum]; + }); + + if (usesGzip || !datalength) { + // if the server uses gzip or doesn't supply the length, we have to download the whole file to get the (uncompressed) length + chunkSize = datalength = 1; // this will force getter(0)/doXHR do download the whole file + datalength = this.getter(0).length; + chunkSize = datalength; + console.log("LazyFiles on gzip forces download of the whole file when length is accessed"); + } + + this._length = datalength; + this._chunkSize = chunkSize; + this.lengthKnown = true; + }; + if (typeof XMLHttpRequest !== 'undefined') { + if (!ENVIRONMENT_IS_WORKER) throw 'Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc'; + var lazyArray = new LazyUint8Array(); + Object.defineProperties(lazyArray, { + length: { + get: function() { + if(!this.lengthKnown) { + this.cacheLength(); + } + return this._length; + } + }, + chunkSize: { + get: function() { + if(!this.lengthKnown) { + this.cacheLength(); + } + return this._chunkSize; + } + } + }); + + var properties = { isDevice: false, contents: lazyArray }; + } else { + var properties = { isDevice: false, url: url }; + } + + var node = FS.createFile(parent, name, properties, canRead, canWrite); + // This is a total hack, but I want to get this lazy file code out of the + // core of MEMFS. If we want to keep this lazy file concept I feel it should + // be its own thin LAZYFS proxying calls to MEMFS. + if (properties.contents) { + node.contents = properties.contents; + } else if (properties.url) { + node.contents = null; + node.url = properties.url; + } + // Add a function that defers querying the file size until it is asked the first time. + Object.defineProperties(node, { + usedBytes: { + get: function() { return this.contents.length; } + } + }); + // override each stream op with one that tries to force load the lazy file first + var stream_ops = {}; + var keys = Object.keys(node.stream_ops); + keys.forEach(function(key) { + var fn = node.stream_ops[key]; + stream_ops[key] = function forceLoadLazyFile() { + if (!FS.forceLoadFile(node)) { + throw new FS.ErrnoError(29); + } + return fn.apply(null, arguments); + }; + }); + // use a custom read function + stream_ops.read = function stream_ops_read(stream, buffer, offset, length, position) { + if (!FS.forceLoadFile(node)) { + throw new FS.ErrnoError(29); + } + var contents = stream.node.contents; + if (position >= contents.length) + return 0; + var size = Math.min(contents.length - position, length); + assert(size >= 0); + if (contents.slice) { // normal array + for (var i = 0; i < size; i++) { + buffer[offset + i] = contents[position + i]; + } + } else { + for (var i = 0; i < size; i++) { // LazyUint8Array from sync binary XHR + buffer[offset + i] = contents.get(position + i); + } + } + return size; + }; + node.stream_ops = stream_ops; + return node; + },createPreloadedFile:function (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn, preFinish) { + Browser.init(); // XXX perhaps this method should move onto Browser? + // TODO we should allow people to just pass in a complete filename instead + // of parent and name being that we just join them anyways + var fullname = name ? PATH_FS.resolve(PATH.join2(parent, name)) : parent; + var dep = getUniqueRunDependency('cp ' + fullname); // might have several active requests for the same fullname + function processData(byteArray) { + function finish(byteArray) { + if (preFinish) preFinish(); + if (!dontCreateFile) { + FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn); + } + if (onload) onload(); + removeRunDependency(dep); + } + var handled = false; + Module['preloadPlugins'].forEach(function(plugin) { + if (handled) return; + if (plugin['canHandle'](fullname)) { + plugin['handle'](byteArray, fullname, finish, function() { + if (onerror) onerror(); + removeRunDependency(dep); + }); + handled = true; + } + }); + if (!handled) finish(byteArray); + } + addRunDependency(dep); + if (typeof url == 'string') { + Browser.asyncLoad(url, function(byteArray) { + processData(byteArray); + }, onerror); + } else { + processData(url); + } + },indexedDB:function () { + return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; + },DB_NAME:function () { + return 'EM_FS_' + window.location.pathname; + },DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function (paths, onload, onerror) { + onload = onload || function(){}; + onerror = onerror || function(){}; + var indexedDB = FS.indexedDB(); + try { + var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION); + } catch (e) { + return onerror(e); + } + openRequest.onupgradeneeded = function openRequest_onupgradeneeded() { + console.log('creating db'); + var db = openRequest.result; + db.createObjectStore(FS.DB_STORE_NAME); + }; + openRequest.onsuccess = function openRequest_onsuccess() { + var db = openRequest.result; + var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite'); + var files = transaction.objectStore(FS.DB_STORE_NAME); + var ok = 0, fail = 0, total = paths.length; + function finish() { + if (fail == 0) onload(); else onerror(); + } + paths.forEach(function(path) { + var putRequest = files.put(FS.analyzePath(path).object.contents, path); + putRequest.onsuccess = function putRequest_onsuccess() { ok++; if (ok + fail == total) finish() }; + putRequest.onerror = function putRequest_onerror() { fail++; if (ok + fail == total) finish() }; + }); + transaction.onerror = onerror; + }; + openRequest.onerror = onerror; + },loadFilesFromDB:function (paths, onload, onerror) { + onload = onload || function(){}; + onerror = onerror || function(){}; + var indexedDB = FS.indexedDB(); + try { + var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION); + } catch (e) { + return onerror(e); + } + openRequest.onupgradeneeded = onerror; // no database to load from + openRequest.onsuccess = function openRequest_onsuccess() { + var db = openRequest.result; + try { + var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly'); + } catch(e) { + onerror(e); + return; + } + var files = transaction.objectStore(FS.DB_STORE_NAME); + var ok = 0, fail = 0, total = paths.length; + function finish() { + if (fail == 0) onload(); else onerror(); + } + paths.forEach(function(path) { + var getRequest = files.get(path); + getRequest.onsuccess = function getRequest_onsuccess() { + if (FS.analyzePath(path).exists) { + FS.unlink(path); + } + FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true); + ok++; + if (ok + fail == total) finish(); + }; + getRequest.onerror = function getRequest_onerror() { fail++; if (ok + fail == total) finish() }; + }); + transaction.onerror = onerror; + }; + openRequest.onerror = onerror; + }};var SYSCALLS={DEFAULT_POLLMASK:5,mappings:{},umask:511,calculateAt:function (dirfd, path) { + if (path[0] !== '/') { + // relative path + var dir; + if (dirfd === -100) { + dir = FS.cwd(); + } else { + var dirstream = FS.getStream(dirfd); + if (!dirstream) throw new FS.ErrnoError(8); + dir = dirstream.path; + } + path = PATH.join2(dir, path); + } + return path; + },doStat:function (func, path, buf) { + try { + var stat = func(path); + } catch (e) { + if (e && e.node && PATH.normalize(path) !== PATH.normalize(FS.getPath(e.node))) { + // an error occurred while trying to look up the path; we should just report ENOTDIR + return -54; + } + throw e; + } + HEAP32[((buf)>>2)]=stat.dev; + HEAP32[(((buf)+(4))>>2)]=0; + HEAP32[(((buf)+(8))>>2)]=stat.ino; + HEAP32[(((buf)+(12))>>2)]=stat.mode; + HEAP32[(((buf)+(16))>>2)]=stat.nlink; + HEAP32[(((buf)+(20))>>2)]=stat.uid; + HEAP32[(((buf)+(24))>>2)]=stat.gid; + HEAP32[(((buf)+(28))>>2)]=stat.rdev; + HEAP32[(((buf)+(32))>>2)]=0; + (tempI64 = [stat.size>>>0,(tempDouble=stat.size,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[(((buf)+(40))>>2)]=tempI64[0],HEAP32[(((buf)+(44))>>2)]=tempI64[1]); + HEAP32[(((buf)+(48))>>2)]=4096; + HEAP32[(((buf)+(52))>>2)]=stat.blocks; + HEAP32[(((buf)+(56))>>2)]=(stat.atime.getTime() / 1000)|0; + HEAP32[(((buf)+(60))>>2)]=0; + HEAP32[(((buf)+(64))>>2)]=(stat.mtime.getTime() / 1000)|0; + HEAP32[(((buf)+(68))>>2)]=0; + HEAP32[(((buf)+(72))>>2)]=(stat.ctime.getTime() / 1000)|0; + HEAP32[(((buf)+(76))>>2)]=0; + (tempI64 = [stat.ino>>>0,(tempDouble=stat.ino,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[(((buf)+(80))>>2)]=tempI64[0],HEAP32[(((buf)+(84))>>2)]=tempI64[1]); + return 0; + },doMsync:function (addr, stream, len, flags) { + var buffer = new Uint8Array(HEAPU8.subarray(addr, addr + len)); + FS.msync(stream, buffer, 0, len, flags); + },doMkdir:function (path, mode) { + // remove a trailing slash, if one - /a/b/ has basename of '', but + // we want to create b in the context of this function + path = PATH.normalize(path); + if (path[path.length-1] === '/') path = path.substr(0, path.length-1); + FS.mkdir(path, mode, 0); + return 0; + },doMknod:function (path, mode, dev) { + // we don't want this in the JS API as it uses mknod to create all nodes. + switch (mode & 61440) { + case 32768: + case 8192: + case 24576: + case 4096: + case 49152: + break; + default: return -28; + } + FS.mknod(path, mode, dev); + return 0; + },doReadlink:function (path, buf, bufsize) { + if (bufsize <= 0) return -28; + var ret = FS.readlink(path); + + var len = Math.min(bufsize, lengthBytesUTF8(ret)); + var endChar = HEAP8[buf+len]; + stringToUTF8(ret, buf, bufsize+1); + // readlink is one of the rare functions that write out a C string, but does never append a null to the output buffer(!) + // stringToUTF8() always appends a null byte, so restore the character under the null byte after the write. + HEAP8[buf+len] = endChar; + + return len; + },doAccess:function (path, amode) { + if (amode & ~7) { + // need a valid mode + return -28; + } + var node; + var lookup = FS.lookupPath(path, { follow: true }); + node = lookup.node; + if (!node) { + return -44; + } + var perms = ''; + if (amode & 4) perms += 'r'; + if (amode & 2) perms += 'w'; + if (amode & 1) perms += 'x'; + if (perms /* otherwise, they've just passed F_OK */ && FS.nodePermissions(node, perms)) { + return -2; + } + return 0; + },doDup:function (path, flags, suggestFD) { + var suggest = FS.getStream(suggestFD); + if (suggest) FS.close(suggest); + return FS.open(path, flags, 0, suggestFD, suggestFD).fd; + },doReadv:function (stream, iov, iovcnt, offset) { + var ret = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = HEAP32[(((iov)+(i*8))>>2)]; + var len = HEAP32[(((iov)+(i*8 + 4))>>2)]; + var curr = FS.read(stream, HEAP8,ptr, len, offset); + if (curr < 0) return -1; + ret += curr; + if (curr < len) break; // nothing more to read + } + return ret; + },doWritev:function (stream, iov, iovcnt, offset) { + var ret = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = HEAP32[(((iov)+(i*8))>>2)]; + var len = HEAP32[(((iov)+(i*8 + 4))>>2)]; + var curr = FS.write(stream, HEAP8,ptr, len, offset); + if (curr < 0) return -1; + ret += curr; + } + return ret; + },varargs:0,get:function (varargs) { + SYSCALLS.varargs += 4; + var ret = HEAP32[(((SYSCALLS.varargs)-(4))>>2)]; + return ret; + },getStr:function () { + var ret = UTF8ToString(SYSCALLS.get()); + return ret; + },getStreamFromFD:function (fd) { + // TODO: when all syscalls use wasi, can remove the next line + if (fd === undefined) fd = SYSCALLS.get(); + var stream = FS.getStream(fd); + if (!stream) throw new FS.ErrnoError(8); + return stream; + },get64:function () { + var low = SYSCALLS.get(), high = SYSCALLS.get(); + if (low >= 0) assert(high === 0); + else assert(high === -1); + return low; + },getZero:function () { + assert(SYSCALLS.get() === 0); + }};function ___syscall221(which, varargs) {SYSCALLS.varargs = varargs; + try { + // fcntl64 + var stream = SYSCALLS.getStreamFromFD(), cmd = SYSCALLS.get(); + switch (cmd) { + case 0: { + var arg = SYSCALLS.get(); + if (arg < 0) { + return -28; + } + var newStream; + newStream = FS.open(stream.path, stream.flags, 0, arg); + return newStream.fd; + } + case 1: + case 2: + return 0; // FD_CLOEXEC makes no sense for a single process. + case 3: + return stream.flags; + case 4: { + var arg = SYSCALLS.get(); + stream.flags |= arg; + return 0; + } + case 12: + /* case 12: Currently in musl F_GETLK64 has same value as F_GETLK, so omitted to avoid duplicate case blocks. If that changes, uncomment this */ { + + var arg = SYSCALLS.get(); + var offset = 0; + // We're always unlocked. + HEAP16[(((arg)+(offset))>>1)]=2; + return 0; + } + case 13: + case 14: + /* case 13: Currently in musl F_SETLK64 has same value as F_SETLK, so omitted to avoid duplicate case blocks. If that changes, uncomment this */ + /* case 14: Currently in musl F_SETLKW64 has same value as F_SETLKW, so omitted to avoid duplicate case blocks. If that changes, uncomment this */ + + + return 0; // Pretend that the locking is successful. + case 16: + case 8: + return -28; // These are for sockets. We don't have them fully implemented yet. + case 9: + // musl trusts getown return values, due to a bug where they must be, as they overlap with errors. just return -1 here, so fnctl() returns that, and we set errno ourselves. + ___setErrNo(28); + return -1; + default: { + return -28; + } + } + } catch (e) { + if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } + } + + function ___syscall5(which, varargs) {SYSCALLS.varargs = varargs; + try { + // open + var pathname = SYSCALLS.getStr(), flags = SYSCALLS.get(), mode = SYSCALLS.get(); // optional TODO + var stream = FS.open(pathname, flags, mode); + return stream.fd; + } catch (e) { + if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } + } + + function ___syscall54(which, varargs) {SYSCALLS.varargs = varargs; + try { + // ioctl + var stream = SYSCALLS.getStreamFromFD(), op = SYSCALLS.get(); + switch (op) { + case 21509: + case 21505: { + if (!stream.tty) return -59; + return 0; + } + case 21510: + case 21511: + case 21512: + case 21506: + case 21507: + case 21508: { + if (!stream.tty) return -59; + return 0; // no-op, not actually adjusting terminal settings + } + case 21519: { + if (!stream.tty) return -59; + var argp = SYSCALLS.get(); + HEAP32[((argp)>>2)]=0; + return 0; + } + case 21520: { + if (!stream.tty) return -59; + return -28; // not supported + } + case 21531: { + var argp = SYSCALLS.get(); + return FS.ioctl(stream, op, argp); + } + case 21523: { + // TODO: in theory we should write to the winsize struct that gets + // passed in, but for now musl doesn't read anything on it + if (!stream.tty) return -59; + return 0; + } + case 21524: { + // TODO: technically, this ioctl call should change the window size. + // but, since emscripten doesn't have any concept of a terminal window + // yet, we'll just silently throw it away as we do TIOCGWINSZ + if (!stream.tty) return -59; + return 0; + } + default: abort('bad ioctl syscall ' + op); + } + } catch (e) { + if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } + } + + + function __emscripten_syscall_munmap(addr, len) { + if (addr === -1 || len === 0) { + return -28; + } + // TODO: support unmmap'ing parts of allocations + var info = SYSCALLS.mappings[addr]; + if (!info) return 0; + if (len === info.len) { + var stream = FS.getStream(info.fd); + SYSCALLS.doMsync(addr, stream, len, info.flags); + FS.munmap(stream); + SYSCALLS.mappings[addr] = null; + if (info.allocated) { + _free(info.malloc); + } + } + return 0; + }function ___syscall91(which, varargs) {SYSCALLS.varargs = varargs; + try { + // munmap + var addr = SYSCALLS.get(), len = SYSCALLS.get(); + return __emscripten_syscall_munmap(addr, len); + } catch (e) { + if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } + } + + + + + + + + + + function ___unlock() {} + + + function _fd_close(fd) {try { + + var stream = SYSCALLS.getStreamFromFD(fd); + FS.close(stream); + return 0; + } catch (e) { + if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e); + return e.errno; + } + }function ___wasi_fd_close() { + return _fd_close.apply(null, arguments) + } + + + function _fd_read(fd, iov, iovcnt, pnum) {try { + + var stream = SYSCALLS.getStreamFromFD(fd); + var num = SYSCALLS.doReadv(stream, iov, iovcnt); + HEAP32[((pnum)>>2)]=num + return 0; + } catch (e) { + if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e); + return e.errno; + } + }function ___wasi_fd_read() { + return _fd_read.apply(null, arguments) + } + + + function _fd_seek(fd, offset_low, offset_high, whence, newOffset) {try { + + var stream = SYSCALLS.getStreamFromFD(fd); + var HIGH_OFFSET = 0x100000000; // 2^32 + // use an unsigned operator on low and shift high by 32-bits + var offset = offset_high * HIGH_OFFSET + (offset_low >>> 0); + + var DOUBLE_LIMIT = 0x20000000000000; // 2^53 + // we also check for equality since DOUBLE_LIMIT + 1 == DOUBLE_LIMIT + if (offset <= -DOUBLE_LIMIT || offset >= DOUBLE_LIMIT) { + return -61; + } + + FS.llseek(stream, offset, whence); + (tempI64 = [stream.position>>>0,(tempDouble=stream.position,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((newOffset)>>2)]=tempI64[0],HEAP32[(((newOffset)+(4))>>2)]=tempI64[1]); + if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null; // reset readdir state + return 0; + } catch (e) { + if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e); + return e.errno; + } + }function ___wasi_fd_seek() { + return _fd_seek.apply(null, arguments) + } + + + function _fd_write(fd, iov, iovcnt, pnum) {try { + + var stream = SYSCALLS.getStreamFromFD(fd); + var num = SYSCALLS.doWritev(stream, iov, iovcnt); + HEAP32[((pnum)>>2)]=num + return 0; + } catch (e) { + if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e); + return e.errno; + } + }function ___wasi_fd_write() { + return _fd_write.apply(null, arguments) + } + + + function getShiftFromSize(size) { + switch (size) { + case 1: return 0; + case 2: return 1; + case 4: return 2; + case 8: return 3; + default: + throw new TypeError('Unknown type size: ' + size); + } + } + + + + function embind_init_charCodes() { + var codes = new Array(256); + for (var i = 0; i < 256; ++i) { + codes[i] = String.fromCharCode(i); + } + embind_charCodes = codes; + }var embind_charCodes=undefined;function readLatin1String(ptr) { + var ret = ""; + var c = ptr; + while (HEAPU8[c]) { + ret += embind_charCodes[HEAPU8[c++]]; + } + return ret; + } + + + var awaitingDependencies={}; + + var registeredTypes={}; + + var typeDependencies={}; + + + + + + + var char_0=48; + + var char_9=57;function makeLegalFunctionName(name) { + if (undefined === name) { + return '_unknown'; + } + name = name.replace(/[^a-zA-Z0-9_]/g, '$'); + var f = name.charCodeAt(0); + if (f >= char_0 && f <= char_9) { + return '_' + name; + } else { + return name; + } + }function createNamedFunction(name, body) { + name = makeLegalFunctionName(name); + /*jshint evil:true*/ + return new Function( + "body", + "return function " + name + "() {\n" + + " \"use strict\";" + + " return body.apply(this, arguments);\n" + + "};\n" + )(body); + }function extendError(baseErrorType, errorName) { + var errorClass = createNamedFunction(errorName, function(message) { + this.name = errorName; + this.message = message; + + var stack = (new Error(message)).stack; + if (stack !== undefined) { + this.stack = this.toString() + '\n' + + stack.replace(/^Error(:[^\n]*)?\n/, ''); + } + }); + errorClass.prototype = Object.create(baseErrorType.prototype); + errorClass.prototype.constructor = errorClass; + errorClass.prototype.toString = function() { + if (this.message === undefined) { + return this.name; + } else { + return this.name + ': ' + this.message; + } + }; + + return errorClass; + }var BindingError=undefined;function throwBindingError(message) { + throw new BindingError(message); + } + + + + var InternalError=undefined;function throwInternalError(message) { + throw new InternalError(message); + }function whenDependentTypesAreResolved(myTypes, dependentTypes, getTypeConverters) { + myTypes.forEach(function(type) { + typeDependencies[type] = dependentTypes; + }); + + function onComplete(typeConverters) { + var myTypeConverters = getTypeConverters(typeConverters); + if (myTypeConverters.length !== myTypes.length) { + throwInternalError('Mismatched type converter count'); + } + for (var i = 0; i < myTypes.length; ++i) { + registerType(myTypes[i], myTypeConverters[i]); + } + } + + var typeConverters = new Array(dependentTypes.length); + var unregisteredTypes = []; + var registered = 0; + dependentTypes.forEach(function(dt, i) { + if (registeredTypes.hasOwnProperty(dt)) { + typeConverters[i] = registeredTypes[dt]; + } else { + unregisteredTypes.push(dt); + if (!awaitingDependencies.hasOwnProperty(dt)) { + awaitingDependencies[dt] = []; + } + awaitingDependencies[dt].push(function() { + typeConverters[i] = registeredTypes[dt]; + ++registered; + if (registered === unregisteredTypes.length) { + onComplete(typeConverters); + } + }); + } + }); + if (0 === unregisteredTypes.length) { + onComplete(typeConverters); + } + }function registerType(rawType, registeredInstance, options) { + options = options || {}; + + if (!('argPackAdvance' in registeredInstance)) { + throw new TypeError('registerType registeredInstance requires argPackAdvance'); + } + + var name = registeredInstance.name; + if (!rawType) { + throwBindingError('type "' + name + '" must have a positive integer typeid pointer'); + } + if (registeredTypes.hasOwnProperty(rawType)) { + if (options.ignoreDuplicateRegistrations) { + return; + } else { + throwBindingError("Cannot register type '" + name + "' twice"); + } + } + + registeredTypes[rawType] = registeredInstance; + delete typeDependencies[rawType]; + + if (awaitingDependencies.hasOwnProperty(rawType)) { + var callbacks = awaitingDependencies[rawType]; + delete awaitingDependencies[rawType]; + callbacks.forEach(function(cb) { + cb(); + }); + } + }function __embind_register_bool(rawType, name, size, trueValue, falseValue) { + var shift = getShiftFromSize(size); + + name = readLatin1String(name); + registerType(rawType, { + name: name, + 'fromWireType': function(wt) { + // ambiguous emscripten ABI: sometimes return values are + // true or false, and sometimes integers (0 or 1) + return !!wt; + }, + 'toWireType': function(destructors, o) { + return o ? trueValue : falseValue; + }, + 'argPackAdvance': 8, + 'readValueFromPointer': function(pointer) { + // TODO: if heap is fixed (like in asm.js) this could be executed outside + var heap; + if (size === 1) { + heap = HEAP8; + } else if (size === 2) { + heap = HEAP16; + } else if (size === 4) { + heap = HEAP32; + } else { + throw new TypeError("Unknown boolean type size: " + name); + } + return this['fromWireType'](heap[pointer >> shift]); + }, + destructorFunction: null, // This type does not need a destructor + }); + } + + function __embind_register_constant(name, type, value) { + name = readLatin1String(name); + whenDependentTypesAreResolved([], [type], function(type) { + type = type[0]; + Module[name] = type['fromWireType'](value); + return []; + }); + } + + + + var emval_free_list=[]; + + var emval_handle_array=[{},{value:undefined},{value:null},{value:true},{value:false}];function __emval_decref(handle) { + if (handle > 4 && 0 === --emval_handle_array[handle].refcount) { + emval_handle_array[handle] = undefined; + emval_free_list.push(handle); + } + } + + + + function count_emval_handles() { + var count = 0; + for (var i = 5; i < emval_handle_array.length; ++i) { + if (emval_handle_array[i] !== undefined) { + ++count; + } + } + return count; + } + + function get_first_emval() { + for (var i = 5; i < emval_handle_array.length; ++i) { + if (emval_handle_array[i] !== undefined) { + return emval_handle_array[i]; + } + } + return null; + }function init_emval() { + Module['count_emval_handles'] = count_emval_handles; + Module['get_first_emval'] = get_first_emval; + }function __emval_register(value) { + + switch(value){ + case undefined :{ return 1; } + case null :{ return 2; } + case true :{ return 3; } + case false :{ return 4; } + default:{ + var handle = emval_free_list.length ? + emval_free_list.pop() : + emval_handle_array.length; + + emval_handle_array[handle] = {refcount: 1, value: value}; + return handle; + } + } + } + + function simpleReadValueFromPointer(pointer) { + return this['fromWireType'](HEAPU32[pointer >> 2]); + }function __embind_register_emval(rawType, name) { + name = readLatin1String(name); + registerType(rawType, { + name: name, + 'fromWireType': function(handle) { + var rv = emval_handle_array[handle].value; + __emval_decref(handle); + return rv; + }, + 'toWireType': function(destructors, value) { + return __emval_register(value); + }, + 'argPackAdvance': 8, + 'readValueFromPointer': simpleReadValueFromPointer, + destructorFunction: null, // This type does not need a destructor + + // TODO: do we need a deleteObject here? write a test where + // emval is passed into JS via an interface + }); + } + + + function _embind_repr(v) { + if (v === null) { + return 'null'; + } + var t = typeof v; + if (t === 'object' || t === 'array' || t === 'function') { + return v.toString(); + } else { + return '' + v; + } + } + + function floatReadValueFromPointer(name, shift) { + switch (shift) { + case 2: return function(pointer) { + return this['fromWireType'](HEAPF32[pointer >> 2]); + }; + case 3: return function(pointer) { + return this['fromWireType'](HEAPF64[pointer >> 3]); + }; + default: + throw new TypeError("Unknown float type: " + name); + } + }function __embind_register_float(rawType, name, size) { + var shift = getShiftFromSize(size); + name = readLatin1String(name); + registerType(rawType, { + name: name, + 'fromWireType': function(value) { + return value; + }, + 'toWireType': function(destructors, value) { + // todo: Here we have an opportunity for -O3 level "unsafe" optimizations: we could + // avoid the following if() and assume value is of proper type. + if (typeof value !== "number" && typeof value !== "boolean") { + throw new TypeError('Cannot convert "' + _embind_repr(value) + '" to ' + this.name); + } + return value; + }, + 'argPackAdvance': 8, + 'readValueFromPointer': floatReadValueFromPointer(name, shift), + destructorFunction: null, // This type does not need a destructor + }); + } + + + + function new_(constructor, argumentList) { + if (!(constructor instanceof Function)) { + throw new TypeError('new_ called with constructor type ' + typeof(constructor) + " which is not a function"); + } + + /* + * Previously, the following line was just: + + function dummy() {}; + + * Unfortunately, Chrome was preserving 'dummy' as the object's name, even though at creation, the 'dummy' has the + * correct constructor name. Thus, objects created with IMVU.new would show up in the debugger as 'dummy', which + * isn't very helpful. Using IMVU.createNamedFunction addresses the issue. Doublely-unfortunately, there's no way + * to write a test for this behavior. -NRD 2013.02.22 + */ + var dummy = createNamedFunction(constructor.name || 'unknownFunctionName', function(){}); + dummy.prototype = constructor.prototype; + var obj = new dummy; + + var r = constructor.apply(obj, argumentList); + return (r instanceof Object) ? r : obj; + } + + function runDestructors(destructors) { + while (destructors.length) { + var ptr = destructors.pop(); + var del = destructors.pop(); + del(ptr); + } + }function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cppTargetFunc) { + // humanName: a human-readable string name for the function to be generated. + // argTypes: An array that contains the embind type objects for all types in the function signature. + // argTypes[0] is the type object for the function return value. + // argTypes[1] is the type object for function this object/class type, or null if not crafting an invoker for a class method. + // argTypes[2...] are the actual function parameters. + // classType: The embind type object for the class to be bound, or null if this is not a method of a class. + // cppInvokerFunc: JS Function object to the C++-side function that interops into C++ code. + // cppTargetFunc: Function pointer (an integer to FUNCTION_TABLE) to the target C++ function the cppInvokerFunc will end up calling. + var argCount = argTypes.length; + + if (argCount < 2) { + throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!"); + } + + var isClassMethodFunc = (argTypes[1] !== null && classType !== null); + + // Free functions with signature "void function()" do not need an invoker that marshalls between wire types. + // TODO: This omits argument count check - enable only at -O3 or similar. + // if (ENABLE_UNSAFE_OPTS && argCount == 2 && argTypes[0].name == "void" && !isClassMethodFunc) { + // return FUNCTION_TABLE[fn]; + // } + + + // Determine if we need to use a dynamic stack to store the destructors for the function parameters. + // TODO: Remove this completely once all function invokers are being dynamically generated. + var needsDestructorStack = false; + + for(var i = 1; i < argTypes.length; ++i) { // Skip return value at index 0 - it's not deleted here. + if (argTypes[i] !== null && argTypes[i].destructorFunction === undefined) { // The type does not define a destructor function - must use dynamic stack + needsDestructorStack = true; + break; + } + } + + var returns = (argTypes[0].name !== "void"); + + var argsList = ""; + var argsListWired = ""; + for(var i = 0; i < argCount - 2; ++i) { + argsList += (i!==0?", ":"")+"arg"+i; + argsListWired += (i!==0?", ":"")+"arg"+i+"Wired"; + } + + var invokerFnBody = + "return function "+makeLegalFunctionName(humanName)+"("+argsList+") {\n" + + "if (arguments.length !== "+(argCount - 2)+") {\n" + + "throwBindingError('function "+humanName+" called with ' + arguments.length + ' arguments, expected "+(argCount - 2)+" args!');\n" + + "}\n"; + + + if (needsDestructorStack) { + invokerFnBody += + "var destructors = [];\n"; + } + + var dtorStack = needsDestructorStack ? "destructors" : "null"; + var args1 = ["throwBindingError", "invoker", "fn", "runDestructors", "retType", "classParam"]; + var args2 = [throwBindingError, cppInvokerFunc, cppTargetFunc, runDestructors, argTypes[0], argTypes[1]]; + + + if (isClassMethodFunc) { + invokerFnBody += "var thisWired = classParam.toWireType("+dtorStack+", this);\n"; + } + + for(var i = 0; i < argCount - 2; ++i) { + invokerFnBody += "var arg"+i+"Wired = argType"+i+".toWireType("+dtorStack+", arg"+i+"); // "+argTypes[i+2].name+"\n"; + args1.push("argType"+i); + args2.push(argTypes[i+2]); + } + + if (isClassMethodFunc) { + argsListWired = "thisWired" + (argsListWired.length > 0 ? ", " : "") + argsListWired; + } + + invokerFnBody += + (returns?"var rv = ":"") + "invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n"; + + if (needsDestructorStack) { + invokerFnBody += "runDestructors(destructors);\n"; + } else { + for(var i = isClassMethodFunc?1:2; i < argTypes.length; ++i) { // Skip return value at index 0 - it's not deleted here. Also skip class type if not a method. + var paramName = (i === 1 ? "thisWired" : ("arg"+(i - 2)+"Wired")); + if (argTypes[i].destructorFunction !== null) { + invokerFnBody += paramName+"_dtor("+paramName+"); // "+argTypes[i].name+"\n"; + args1.push(paramName+"_dtor"); + args2.push(argTypes[i].destructorFunction); + } + } + } + + if (returns) { + invokerFnBody += "var ret = retType.fromWireType(rv);\n" + + "return ret;\n"; + } else { + } + invokerFnBody += "}\n"; + + args1.push(invokerFnBody); + + var invokerFunction = new_(Function, args1).apply(null, args2); + return invokerFunction; + } + + + function ensureOverloadTable(proto, methodName, humanName) { + if (undefined === proto[methodName].overloadTable) { + var prevFunc = proto[methodName]; + // Inject an overload resolver function that routes to the appropriate overload based on the number of arguments. + proto[methodName] = function() { + // TODO This check can be removed in -O3 level "unsafe" optimizations. + if (!proto[methodName].overloadTable.hasOwnProperty(arguments.length)) { + throwBindingError("Function '" + humanName + "' called with an invalid number of arguments (" + arguments.length + ") - expects one of (" + proto[methodName].overloadTable + ")!"); + } + return proto[methodName].overloadTable[arguments.length].apply(this, arguments); + }; + // Move the previous function into the overload table. + proto[methodName].overloadTable = []; + proto[methodName].overloadTable[prevFunc.argCount] = prevFunc; + } + }function exposePublicSymbol(name, value, numArguments) { + if (Module.hasOwnProperty(name)) { + if (undefined === numArguments || (undefined !== Module[name].overloadTable && undefined !== Module[name].overloadTable[numArguments])) { + throwBindingError("Cannot register public name '" + name + "' twice"); + } + + // We are exposing a function with the same name as an existing function. Create an overload table and a function selector + // that routes between the two. + ensureOverloadTable(Module, name, name); + if (Module.hasOwnProperty(numArguments)) { + throwBindingError("Cannot register multiple overloads of a function with the same number of arguments (" + numArguments + ")!"); + } + // Add the new function into the overload table. + Module[name].overloadTable[numArguments] = value; + } + else { + Module[name] = value; + if (undefined !== numArguments) { + Module[name].numArguments = numArguments; + } + } + } + + function heap32VectorToArray(count, firstElement) { + var array = []; + for (var i = 0; i < count; i++) { + array.push(HEAP32[(firstElement >> 2) + i]); + } + return array; + } + + function replacePublicSymbol(name, value, numArguments) { + if (!Module.hasOwnProperty(name)) { + throwInternalError('Replacing nonexistant public symbol'); + } + // If there's an overload table for this symbol, replace the symbol in the overload table instead. + if (undefined !== Module[name].overloadTable && undefined !== numArguments) { + Module[name].overloadTable[numArguments] = value; + } + else { + Module[name] = value; + Module[name].argCount = numArguments; + } + } + + function embind__requireFunction(signature, rawFunction) { + signature = readLatin1String(signature); + + function makeDynCaller(dynCall) { + var args = []; + for (var i = 1; i < signature.length; ++i) { + args.push('a' + i); + } + + var name = 'dynCall_' + signature + '_' + rawFunction; + var body = 'return function ' + name + '(' + args.join(', ') + ') {\n'; + body += ' return dynCall(rawFunction' + (args.length ? ', ' : '') + args.join(', ') + ');\n'; + body += '};\n'; + + return (new Function('dynCall', 'rawFunction', body))(dynCall, rawFunction); + } + + var fp; + if (Module['FUNCTION_TABLE_' + signature] !== undefined) { + fp = Module['FUNCTION_TABLE_' + signature][rawFunction]; + } else if (typeof FUNCTION_TABLE !== "undefined") { + fp = FUNCTION_TABLE[rawFunction]; + } else { + // asm.js does not give direct access to the function tables, + // and thus we must go through the dynCall interface which allows + // calling into a signature's function table by pointer value. + // + // https://github.com/dherman/asm.js/issues/83 + // + // This has three main penalties: + // - dynCall is another function call in the path from JavaScript to C++. + // - JITs may not predict through the function table indirection at runtime. + var dc = Module['dynCall_' + signature]; + if (dc === undefined) { + // We will always enter this branch if the signature + // contains 'f' and PRECISE_F32 is not enabled. + // + // Try again, replacing 'f' with 'd'. + dc = Module['dynCall_' + signature.replace(/f/g, 'd')]; + if (dc === undefined) { + throwBindingError("No dynCall invoker for signature: " + signature); + } + } + fp = makeDynCaller(dc); + } + + if (typeof fp !== "function") { + throwBindingError("unknown function pointer with signature " + signature + ": " + rawFunction); + } + return fp; + } + + + var UnboundTypeError=undefined; + + function getTypeName(type) { + var ptr = ___getTypeName(type); + var rv = readLatin1String(ptr); + _free(ptr); + return rv; + }function throwUnboundTypeError(message, types) { + var unboundTypes = []; + var seen = {}; + function visit(type) { + if (seen[type]) { + return; + } + if (registeredTypes[type]) { + return; + } + if (typeDependencies[type]) { + typeDependencies[type].forEach(visit); + return; + } + unboundTypes.push(type); + seen[type] = true; + } + types.forEach(visit); + + throw new UnboundTypeError(message + ': ' + unboundTypes.map(getTypeName).join([', '])); + }function __embind_register_function(name, argCount, rawArgTypesAddr, signature, rawInvoker, fn) { + var argTypes = heap32VectorToArray(argCount, rawArgTypesAddr); + name = readLatin1String(name); + + rawInvoker = embind__requireFunction(signature, rawInvoker); + + exposePublicSymbol(name, function() { + throwUnboundTypeError('Cannot call ' + name + ' due to unbound types', argTypes); + }, argCount - 1); + + whenDependentTypesAreResolved([], argTypes, function(argTypes) { + var invokerArgsArray = [argTypes[0] /* return value */, null /* no class 'this'*/].concat(argTypes.slice(1) /* actual params */); + replacePublicSymbol(name, craftInvokerFunction(name, invokerArgsArray, null /* no class 'this'*/, rawInvoker, fn), argCount - 1); + return []; + }); + } + + + function integerReadValueFromPointer(name, shift, signed) { + // integers are quite common, so generate very specialized functions + switch (shift) { + case 0: return signed ? + function readS8FromPointer(pointer) { return HEAP8[pointer]; } : + function readU8FromPointer(pointer) { return HEAPU8[pointer]; }; + case 1: return signed ? + function readS16FromPointer(pointer) { return HEAP16[pointer >> 1]; } : + function readU16FromPointer(pointer) { return HEAPU16[pointer >> 1]; }; + case 2: return signed ? + function readS32FromPointer(pointer) { return HEAP32[pointer >> 2]; } : + function readU32FromPointer(pointer) { return HEAPU32[pointer >> 2]; }; + default: + throw new TypeError("Unknown integer type: " + name); + } + }function __embind_register_integer(primitiveType, name, size, minRange, maxRange) { + name = readLatin1String(name); + if (maxRange === -1) { // LLVM doesn't have signed and unsigned 32-bit types, so u32 literals come out as 'i32 -1'. Always treat those as max u32. + maxRange = 4294967295; + } + + var shift = getShiftFromSize(size); + + var fromWireType = function(value) { + return value; + }; + + if (minRange === 0) { + var bitshift = 32 - 8*size; + fromWireType = function(value) { + return (value << bitshift) >>> bitshift; + }; + } + + var isUnsignedType = (name.indexOf('unsigned') != -1); + + registerType(primitiveType, { + name: name, + 'fromWireType': fromWireType, + 'toWireType': function(destructors, value) { + // todo: Here we have an opportunity for -O3 level "unsafe" optimizations: we could + // avoid the following two if()s and assume value is of proper type. + if (typeof value !== "number" && typeof value !== "boolean") { + throw new TypeError('Cannot convert "' + _embind_repr(value) + '" to ' + this.name); + } + if (value < minRange || value > maxRange) { + throw new TypeError('Passing a number "' + _embind_repr(value) + '" from JS side to C/C++ side to an argument of type "' + name + '", which is outside the valid range [' + minRange + ', ' + maxRange + ']!'); + } + return isUnsignedType ? (value >>> 0) : (value | 0); + }, + 'argPackAdvance': 8, + 'readValueFromPointer': integerReadValueFromPointer(name, shift, minRange !== 0), + destructorFunction: null, // This type does not need a destructor + }); + } + + function __embind_register_memory_view(rawType, dataTypeIndex, name) { + var typeMapping = [ + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + ]; + + var TA = typeMapping[dataTypeIndex]; + + function decodeMemoryView(handle) { + handle = handle >> 2; + var heap = HEAPU32; + var size = heap[handle]; // in elements + var data = heap[handle + 1]; // byte offset into emscripten heap + return new TA(heap['buffer'], data, size); + } + + name = readLatin1String(name); + registerType(rawType, { + name: name, + 'fromWireType': decodeMemoryView, + 'argPackAdvance': 8, + 'readValueFromPointer': decodeMemoryView, + }, { + ignoreDuplicateRegistrations: true, + }); + } + + function __embind_register_std_string(rawType, name) { + name = readLatin1String(name); + var stdStringIsUTF8 + //process only std::string bindings with UTF8 support, in contrast to e.g. std::basic_string + = (name === "std::string"); + + registerType(rawType, { + name: name, + 'fromWireType': function(value) { + var length = HEAPU32[value >> 2]; + + var str; + if(stdStringIsUTF8) { + //ensure null termination at one-past-end byte if not present yet + var endChar = HEAPU8[value + 4 + length]; + var endCharSwap = 0; + if(endChar != 0) + { + endCharSwap = endChar; + HEAPU8[value + 4 + length] = 0; + } + + var decodeStartPtr = value + 4; + //looping here to support possible embedded '0' bytes + for (var i = 0; i <= length; ++i) { + var currentBytePtr = value + 4 + i; + if(HEAPU8[currentBytePtr] == 0) + { + var stringSegment = UTF8ToString(decodeStartPtr); + if(str === undefined) + str = stringSegment; + else + { + str += String.fromCharCode(0); + str += stringSegment; + } + decodeStartPtr = currentBytePtr + 1; + } + } + + if(endCharSwap != 0) + HEAPU8[value + 4 + length] = endCharSwap; + } else { + var a = new Array(length); + for (var i = 0; i < length; ++i) { + a[i] = String.fromCharCode(HEAPU8[value + 4 + i]); + } + str = a.join(''); + } + + _free(value); + + return str; + }, + 'toWireType': function(destructors, value) { + if (value instanceof ArrayBuffer) { + value = new Uint8Array(value); + } + + var getLength; + var valueIsOfTypeString = (typeof value === 'string'); + + if (!(valueIsOfTypeString || value instanceof Uint8Array || value instanceof Uint8ClampedArray || value instanceof Int8Array)) { + throwBindingError('Cannot pass non-string to std::string'); + } + if (stdStringIsUTF8 && valueIsOfTypeString) { + getLength = function() {return lengthBytesUTF8(value);}; + } else { + getLength = function() {return value.length;}; + } + + // assumes 4-byte alignment + var length = getLength(); + var ptr = _malloc(4 + length + 1); + HEAPU32[ptr >> 2] = length; + + if (stdStringIsUTF8 && valueIsOfTypeString) { + stringToUTF8(value, ptr + 4, length + 1); + } else { + if(valueIsOfTypeString) { + for (var i = 0; i < length; ++i) { + var charCode = value.charCodeAt(i); + if (charCode > 255) { + _free(ptr); + throwBindingError('String has UTF-16 code units that do not fit in 8 bits'); + } + HEAPU8[ptr + 4 + i] = charCode; + } + } else { + for (var i = 0; i < length; ++i) { + HEAPU8[ptr + 4 + i] = value[i]; + } + } + } + + if (destructors !== null) { + destructors.push(_free, ptr); + } + return ptr; + }, + 'argPackAdvance': 8, + 'readValueFromPointer': simpleReadValueFromPointer, + destructorFunction: function(ptr) { _free(ptr); }, + }); + } + + function __embind_register_std_wstring(rawType, charSize, name) { + // nb. do not cache HEAPU16 and HEAPU32, they may be destroyed by emscripten_resize_heap(). + name = readLatin1String(name); + var getHeap, shift; + if (charSize === 2) { + getHeap = function() { return HEAPU16; }; + shift = 1; + } else if (charSize === 4) { + getHeap = function() { return HEAPU32; }; + shift = 2; + } + registerType(rawType, { + name: name, + 'fromWireType': function(value) { + var HEAP = getHeap(); + var length = HEAPU32[value >> 2]; + var a = new Array(length); + var start = (value + 4) >> shift; + for (var i = 0; i < length; ++i) { + a[i] = String.fromCharCode(HEAP[start + i]); + } + _free(value); + return a.join(''); + }, + 'toWireType': function(destructors, value) { + // assumes 4-byte alignment + var length = value.length; + var ptr = _malloc(4 + length * charSize); + var HEAP = getHeap(); + HEAPU32[ptr >> 2] = length; + var start = (ptr + 4) >> shift; + for (var i = 0; i < length; ++i) { + HEAP[start + i] = value.charCodeAt(i); + } + if (destructors !== null) { + destructors.push(_free, ptr); + } + return ptr; + }, + 'argPackAdvance': 8, + 'readValueFromPointer': simpleReadValueFromPointer, + destructorFunction: function(ptr) { _free(ptr); }, + }); + } + + function __embind_register_void(rawType, name) { + name = readLatin1String(name); + registerType(rawType, { + isVoid: true, // void return values can be optimized out sometimes + name: name, + 'argPackAdvance': 0, + 'fromWireType': function() { + return undefined; + }, + 'toWireType': function(destructors, o) { + // TODO: assert if anything else is given? + return undefined; + }, + }); + } + + function _abort() { + abort(); + } + + + + + + var _emscripten_asm_const_int=true; + + function _emscripten_get_heap_size() { + return HEAP8.length; + } + + + + + function abortOnCannotGrowMemory(requestedSize) { + abort('Cannot enlarge memory arrays to size ' + requestedSize + ' bytes (OOM). Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ' + HEAP8.length + ', (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 '); + } + + function emscripten_realloc_buffer(size) { + try { + var newBuffer = new ArrayBuffer(size); + if (newBuffer.byteLength != size) return /*undefined, allocation did not succeed*/; + new Int8Array(newBuffer).set(HEAP8); + _emscripten_replace_memory(newBuffer); + updateGlobalBufferAndViews(newBuffer); + return 1 /*success*/; + } catch(e) { + console.error('emscripten_realloc_buffer: Attempted to grow heap from ' + buffer.byteLength + ' bytes to ' + size + ' bytes, but got error: ' + e); + } + }function _emscripten_resize_heap(requestedSize) { + var oldSize = _emscripten_get_heap_size(); + // With pthreads, races can happen (another thread might increase the size in between), so return a failure, and let the caller retry. + assert(requestedSize > oldSize); + + + var PAGE_MULTIPLE = 16777216; + var LIMIT = 2147483648 - PAGE_MULTIPLE; // We can do one page short of 2GB as theoretical maximum. + + if (requestedSize > LIMIT) { + err('Cannot enlarge memory, asked to go up to ' + requestedSize + ' bytes, but the limit is ' + LIMIT + ' bytes!'); + return false; + } + + var MIN_TOTAL_MEMORY = 16777216; + var newSize = Math.max(oldSize, MIN_TOTAL_MEMORY); // So the loop below will not be infinite, and minimum asm.js memory size is 16MB. + + // TODO: see realloc_buffer - for PTHREADS we may want to decrease these jumps + while (newSize < requestedSize) { // Keep incrementing the heap size as long as it's less than what is requested. + if (newSize <= 536870912) { + newSize = alignUp(2 * newSize, PAGE_MULTIPLE); // Simple heuristic: double until 1GB... + } else { + // ..., but after that, add smaller increments towards 2GB, which we cannot reach + newSize = Math.min(alignUp((3 * newSize + 2147483648) / 4, PAGE_MULTIPLE), LIMIT); + } + + if (newSize === oldSize) { + warnOnce('Cannot ask for more memory since we reached the practical limit in browsers (which is just below 2GB), so the request would have failed. Requesting only ' + HEAP8.length); + } + } + + + + var replacement = emscripten_realloc_buffer(newSize); + if (!replacement) { + err('Failed to grow the heap from ' + oldSize + ' bytes to ' + newSize + ' bytes, not enough memory!'); + return false; + } + + err('Warning: Enlarging memory arrays, this is not fast! ' + [oldSize, newSize]); + + + return true; + } + + function _exit(status) { + // void _exit(int status); + // http://pubs.opengroup.org/onlinepubs/000095399/functions/exit.html + exit(status); + } + + function _getenv(name) { + // char *getenv(const char *name); + // http://pubs.opengroup.org/onlinepubs/009695399/functions/getenv.html + if (name === 0) return 0; + name = UTF8ToString(name); + if (!ENV.hasOwnProperty(name)) return 0; + + if (_getenv.ret) _free(_getenv.ret); + _getenv.ret = allocateUTF8(ENV[name]); + return _getenv.ret; + } + + function _gettimeofday(ptr) { + var now = Date.now(); + HEAP32[((ptr)>>2)]=(now/1000)|0; // seconds + HEAP32[(((ptr)+(4))>>2)]=((now % 1000)*1000)|0; // microseconds + return 0; + } + + + + + + function _llvm_exp2_f32(x) { + return Math.pow(2, x); + } + + function _llvm_stackrestore(p) { + var self = _llvm_stacksave; + var ret = self.LLVM_SAVEDSTACKS[p]; + self.LLVM_SAVEDSTACKS.splice(p, 1); + stackRestore(ret); + } + + function _llvm_stacksave() { + var self = _llvm_stacksave; + if (!self.LLVM_SAVEDSTACKS) { + self.LLVM_SAVEDSTACKS = []; + } + self.LLVM_SAVEDSTACKS.push(stackSave()); + return self.LLVM_SAVEDSTACKS.length-1; + } + + function _llvm_trap() { + abort('trap!'); + } + + + var ___tm_current=67504; + + + var ___tm_timezone=(stringToUTF8("GMT", 67552, 4), 67552); + + function _tzset() { + // TODO: Use (malleable) environment variables instead of system settings. + if (_tzset.called) return; + _tzset.called = true; + + // timezone is specified as seconds west of UTC ("The external variable + // `timezone` shall be set to the difference, in seconds, between + // Coordinated Universal Time (UTC) and local standard time."), the same + // as returned by getTimezoneOffset(). + // See http://pubs.opengroup.org/onlinepubs/009695399/functions/tzset.html + HEAP32[((__get_timezone())>>2)]=(new Date()).getTimezoneOffset() * 60; + + var currentYear = new Date().getFullYear(); + var winter = new Date(currentYear, 0, 1); + var summer = new Date(currentYear, 6, 1); + HEAP32[((__get_daylight())>>2)]=Number(winter.getTimezoneOffset() != summer.getTimezoneOffset()); + + function extractZone(date) { + var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/); + return match ? match[1] : "GMT"; + }; + var winterName = extractZone(winter); + var summerName = extractZone(summer); + var winterNamePtr = allocate(intArrayFromString(winterName), 'i8', ALLOC_NORMAL); + var summerNamePtr = allocate(intArrayFromString(summerName), 'i8', ALLOC_NORMAL); + if (summer.getTimezoneOffset() < winter.getTimezoneOffset()) { + // Northern hemisphere + HEAP32[((__get_tzname())>>2)]=winterNamePtr; + HEAP32[(((__get_tzname())+(4))>>2)]=summerNamePtr; + } else { + HEAP32[((__get_tzname())>>2)]=summerNamePtr; + HEAP32[(((__get_tzname())+(4))>>2)]=winterNamePtr; + } + }function _localtime_r(time, tmPtr) { + _tzset(); + var date = new Date(HEAP32[((time)>>2)]*1000); + HEAP32[((tmPtr)>>2)]=date.getSeconds(); + HEAP32[(((tmPtr)+(4))>>2)]=date.getMinutes(); + HEAP32[(((tmPtr)+(8))>>2)]=date.getHours(); + HEAP32[(((tmPtr)+(12))>>2)]=date.getDate(); + HEAP32[(((tmPtr)+(16))>>2)]=date.getMonth(); + HEAP32[(((tmPtr)+(20))>>2)]=date.getFullYear()-1900; + HEAP32[(((tmPtr)+(24))>>2)]=date.getDay(); + + var start = new Date(date.getFullYear(), 0, 1); + var yday = ((date.getTime() - start.getTime()) / (1000 * 60 * 60 * 24))|0; + HEAP32[(((tmPtr)+(28))>>2)]=yday; + HEAP32[(((tmPtr)+(36))>>2)]=-(date.getTimezoneOffset() * 60); + + // Attention: DST is in December in South, and some regions don't have DST at all. + var summerOffset = new Date(date.getFullYear(), 6, 1).getTimezoneOffset(); + var winterOffset = start.getTimezoneOffset(); + var dst = (summerOffset != winterOffset && date.getTimezoneOffset() == Math.min(winterOffset, summerOffset))|0; + HEAP32[(((tmPtr)+(32))>>2)]=dst; + + var zonePtr = HEAP32[(((__get_tzname())+(dst ? 4 : 0))>>2)]; + HEAP32[(((tmPtr)+(40))>>2)]=zonePtr; + + return tmPtr; + }function _localtime(time) { + return _localtime_r(time, ___tm_current); + } + + + + + + + function _longjmp(env, value) { + _setThrew(env, value || 1); + throw 'longjmp'; + } + + + function _emscripten_memcpy_big(dest, src, num) { + HEAPU8.set(HEAPU8.subarray(src, src+num), dest); + } + + + + + + + + + + + + + function __isLeapYear(year) { + return year%4 === 0 && (year%100 !== 0 || year%400 === 0); + } + + function __arraySum(array, index) { + var sum = 0; + for (var i = 0; i <= index; sum += array[i++]); + return sum; + } + + + var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31]; + + var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date, days) { + var newDate = new Date(date.getTime()); + while(days > 0) { + var leap = __isLeapYear(newDate.getFullYear()); + var currentMonth = newDate.getMonth(); + var daysInCurrentMonth = (leap ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR)[currentMonth]; + + if (days > daysInCurrentMonth-newDate.getDate()) { + // we spill over to next month + days -= (daysInCurrentMonth-newDate.getDate()+1); + newDate.setDate(1); + if (currentMonth < 11) { + newDate.setMonth(currentMonth+1) + } else { + newDate.setMonth(0); + newDate.setFullYear(newDate.getFullYear()+1); + } + } else { + // we stay in current month + newDate.setDate(newDate.getDate()+days); + return newDate; + } + } + + return newDate; + }function _strftime(s, maxsize, format, tm) { + // size_t strftime(char *restrict s, size_t maxsize, const char *restrict format, const struct tm *restrict timeptr); + // http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html + + var tm_zone = HEAP32[(((tm)+(40))>>2)]; + + var date = { + tm_sec: HEAP32[((tm)>>2)], + tm_min: HEAP32[(((tm)+(4))>>2)], + tm_hour: HEAP32[(((tm)+(8))>>2)], + tm_mday: HEAP32[(((tm)+(12))>>2)], + tm_mon: HEAP32[(((tm)+(16))>>2)], + tm_year: HEAP32[(((tm)+(20))>>2)], + tm_wday: HEAP32[(((tm)+(24))>>2)], + tm_yday: HEAP32[(((tm)+(28))>>2)], + tm_isdst: HEAP32[(((tm)+(32))>>2)], + tm_gmtoff: HEAP32[(((tm)+(36))>>2)], + tm_zone: tm_zone ? UTF8ToString(tm_zone) : '' + }; + + var pattern = UTF8ToString(format); + + // expand format + var EXPANSION_RULES_1 = { + '%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 + '%D': '%m/%d/%y', // Equivalent to %m / %d / %y + '%F': '%Y-%m-%d', // Equivalent to %Y - %m - %d + '%h': '%b', // Equivalent to %b + '%r': '%I:%M:%S %p', // Replaced by the time in a.m. and p.m. notation + '%R': '%H:%M', // Replaced by the time in 24-hour notation + '%T': '%H:%M:%S', // Replaced by the time + '%x': '%m/%d/%y', // Replaced by the locale's appropriate date representation + '%X': '%H:%M:%S', // Replaced by the locale's appropriate time representation + // Modified Conversion Specifiers + '%Ec': '%c', // Replaced by the locale's alternative appropriate date and time representation. + '%EC': '%C', // Replaced by the name of the base year (period) in the locale's alternative representation. + '%Ex': '%m/%d/%y', // Replaced by the locale's alternative date representation. + '%EX': '%H:%M:%S', // Replaced by the locale's alternative time representation. + '%Ey': '%y', // Replaced by the offset from %EC (year only) in the locale's alternative representation. + '%EY': '%Y', // Replaced by the full alternative year representation. + '%Od': '%d', // Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading zeros if there is any alternative symbol for zero; otherwise, with leading characters. + '%Oe': '%e', // Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading characters. + '%OH': '%H', // Replaced by the hour (24-hour clock) using the locale's alternative numeric symbols. + '%OI': '%I', // Replaced by the hour (12-hour clock) using the locale's alternative numeric symbols. + '%Om': '%m', // Replaced by the month using the locale's alternative numeric symbols. + '%OM': '%M', // Replaced by the minutes using the locale's alternative numeric symbols. + '%OS': '%S', // Replaced by the seconds using the locale's alternative numeric symbols. + '%Ou': '%u', // Replaced by the weekday as a number in the locale's alternative representation (Monday=1). + '%OU': '%U', // Replaced by the week number of the year (Sunday as the first day of the week, rules corresponding to %U ) using the locale's alternative numeric symbols. + '%OV': '%V', // Replaced by the week number of the year (Monday as the first day of the week, rules corresponding to %V ) using the locale's alternative numeric symbols. + '%Ow': '%w', // Replaced by the number of the weekday (Sunday=0) using the locale's alternative numeric symbols. + '%OW': '%W', // Replaced by the week number of the year (Monday as the first day of the week) using the locale's alternative numeric symbols. + '%Oy': '%y', // Replaced by the year (offset from %C ) using the locale's alternative numeric symbols. + }; + for (var rule in EXPANSION_RULES_1) { + pattern = pattern.replace(new RegExp(rule, 'g'), EXPANSION_RULES_1[rule]); + } + + var WEEKDAYS = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; + var MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; + + function leadingSomething(value, digits, character) { + var str = typeof value === 'number' ? value.toString() : (value || ''); + while (str.length < digits) { + str = character[0]+str; + } + return str; + } + + function leadingNulls(value, digits) { + return leadingSomething(value, digits, '0'); + } + + function compareByDay(date1, date2) { + function sgn(value) { + return value < 0 ? -1 : (value > 0 ? 1 : 0); + } + + var compare; + if ((compare = sgn(date1.getFullYear()-date2.getFullYear())) === 0) { + if ((compare = sgn(date1.getMonth()-date2.getMonth())) === 0) { + compare = sgn(date1.getDate()-date2.getDate()); + } + } + return compare; + } + + function getFirstWeekStartDate(janFourth) { + switch (janFourth.getDay()) { + case 0: // Sunday + return new Date(janFourth.getFullYear()-1, 11, 29); + case 1: // Monday + return janFourth; + case 2: // Tuesday + return new Date(janFourth.getFullYear(), 0, 3); + case 3: // Wednesday + return new Date(janFourth.getFullYear(), 0, 2); + case 4: // Thursday + return new Date(janFourth.getFullYear(), 0, 1); + case 5: // Friday + return new Date(janFourth.getFullYear()-1, 11, 31); + case 6: // Saturday + return new Date(janFourth.getFullYear()-1, 11, 30); + } + } + + function getWeekBasedYear(date) { + var thisDate = __addDays(new Date(date.tm_year+1900, 0, 1), date.tm_yday); + + var janFourthThisYear = new Date(thisDate.getFullYear(), 0, 4); + var janFourthNextYear = new Date(thisDate.getFullYear()+1, 0, 4); + + var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear); + var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear); + + if (compareByDay(firstWeekStartThisYear, thisDate) <= 0) { + // this date is after the start of the first week of this year + if (compareByDay(firstWeekStartNextYear, thisDate) <= 0) { + return thisDate.getFullYear()+1; + } else { + return thisDate.getFullYear(); + } + } else { + return thisDate.getFullYear()-1; + } + } + + var EXPANSION_RULES_2 = { + '%a': function(date) { + return WEEKDAYS[date.tm_wday].substring(0,3); + }, + '%A': function(date) { + return WEEKDAYS[date.tm_wday]; + }, + '%b': function(date) { + return MONTHS[date.tm_mon].substring(0,3); + }, + '%B': function(date) { + return MONTHS[date.tm_mon]; + }, + '%C': function(date) { + var year = date.tm_year+1900; + return leadingNulls((year/100)|0,2); + }, + '%d': function(date) { + return leadingNulls(date.tm_mday, 2); + }, + '%e': function(date) { + return leadingSomething(date.tm_mday, 2, ' '); + }, + '%g': function(date) { + // %g, %G, and %V give values according to the ISO 8601:2000 standard week-based year. + // In this system, weeks begin on a Monday and week 1 of the year is the week that includes + // January 4th, which is also the week that includes the first Thursday of the year, and + // is also the first week that contains at least four days in the year. + // If the first Monday of January is the 2nd, 3rd, or 4th, the preceding days are part of + // the last week of the preceding year; thus, for Saturday 2nd January 1999, + // %G is replaced by 1998 and %V is replaced by 53. If December 29th, 30th, + // or 31st is a Monday, it and any following days are part of week 1 of the following year. + // Thus, for Tuesday 30th December 1997, %G is replaced by 1998 and %V is replaced by 01. + + return getWeekBasedYear(date).toString().substring(2); + }, + '%G': function(date) { + return getWeekBasedYear(date); + }, + '%H': function(date) { + return leadingNulls(date.tm_hour, 2); + }, + '%I': function(date) { + var twelveHour = date.tm_hour; + if (twelveHour == 0) twelveHour = 12; + else if (twelveHour > 12) twelveHour -= 12; + return leadingNulls(twelveHour, 2); + }, + '%j': function(date) { + // Day of the year (001-366) + return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, date.tm_mon-1), 3); + }, + '%m': function(date) { + return leadingNulls(date.tm_mon+1, 2); + }, + '%M': function(date) { + return leadingNulls(date.tm_min, 2); + }, + '%n': function() { + return '\n'; + }, + '%p': function(date) { + if (date.tm_hour >= 0 && date.tm_hour < 12) { + return 'AM'; + } else { + return 'PM'; + } + }, + '%S': function(date) { + return leadingNulls(date.tm_sec, 2); + }, + '%t': function() { + return '\t'; + }, + '%u': function(date) { + return date.tm_wday || 7; + }, + '%U': function(date) { + // Replaced by the week number of the year as a decimal number [00,53]. + // The first Sunday of January is the first day of week 1; + // days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday] + var janFirst = new Date(date.tm_year+1900, 0, 1); + var firstSunday = janFirst.getDay() === 0 ? janFirst : __addDays(janFirst, 7-janFirst.getDay()); + var endDate = new Date(date.tm_year+1900, date.tm_mon, date.tm_mday); + + // is target date after the first Sunday? + if (compareByDay(firstSunday, endDate) < 0) { + // calculate difference in days between first Sunday and endDate + var februaryFirstUntilEndMonth = __arraySum(__isLeapYear(endDate.getFullYear()) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, endDate.getMonth()-1)-31; + var firstSundayUntilEndJanuary = 31-firstSunday.getDate(); + var days = firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate(); + return leadingNulls(Math.ceil(days/7), 2); + } + + return compareByDay(firstSunday, janFirst) === 0 ? '01': '00'; + }, + '%V': function(date) { + // Replaced by the week number of the year (Monday as the first day of the week) + // as a decimal number [01,53]. If the week containing 1 January has four + // or more days in the new year, then it is considered week 1. + // Otherwise, it is the last week of the previous year, and the next week is week 1. + // Both January 4th and the first Thursday of January are always in week 1. [ tm_year, tm_wday, tm_yday] + var janFourthThisYear = new Date(date.tm_year+1900, 0, 4); + var janFourthNextYear = new Date(date.tm_year+1901, 0, 4); + + var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear); + var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear); + + var endDate = __addDays(new Date(date.tm_year+1900, 0, 1), date.tm_yday); + + if (compareByDay(endDate, firstWeekStartThisYear) < 0) { + // if given date is before this years first week, then it belongs to the 53rd week of last year + return '53'; + } + + if (compareByDay(firstWeekStartNextYear, endDate) <= 0) { + // if given date is after next years first week, then it belongs to the 01th week of next year + return '01'; + } + + // given date is in between CW 01..53 of this calendar year + var daysDifference; + if (firstWeekStartThisYear.getFullYear() < date.tm_year+1900) { + // first CW of this year starts last year + daysDifference = date.tm_yday+32-firstWeekStartThisYear.getDate() + } else { + // first CW of this year starts this year + daysDifference = date.tm_yday+1-firstWeekStartThisYear.getDate(); + } + return leadingNulls(Math.ceil(daysDifference/7), 2); + }, + '%w': function(date) { + return date.tm_wday; + }, + '%W': function(date) { + // Replaced by the week number of the year as a decimal number [00,53]. + // The first Monday of January is the first day of week 1; + // days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday] + var janFirst = new Date(date.tm_year, 0, 1); + var firstMonday = janFirst.getDay() === 1 ? janFirst : __addDays(janFirst, janFirst.getDay() === 0 ? 1 : 7-janFirst.getDay()+1); + var endDate = new Date(date.tm_year+1900, date.tm_mon, date.tm_mday); + + // is target date after the first Monday? + if (compareByDay(firstMonday, endDate) < 0) { + var februaryFirstUntilEndMonth = __arraySum(__isLeapYear(endDate.getFullYear()) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, endDate.getMonth()-1)-31; + var firstMondayUntilEndJanuary = 31-firstMonday.getDate(); + var days = firstMondayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate(); + return leadingNulls(Math.ceil(days/7), 2); + } + return compareByDay(firstMonday, janFirst) === 0 ? '01': '00'; + }, + '%y': function(date) { + // Replaced by the last two digits of the year as a decimal number [00,99]. [ tm_year] + return (date.tm_year+1900).toString().substring(2); + }, + '%Y': function(date) { + // Replaced by the year as a decimal number (for example, 1997). [ tm_year] + return date.tm_year+1900; + }, + '%z': function(date) { + // Replaced by the offset from UTC in the ISO 8601:2000 standard format ( +hhmm or -hhmm ). + // For example, "-0430" means 4 hours 30 minutes behind UTC (west of Greenwich). + var off = date.tm_gmtoff; + var ahead = off >= 0; + off = Math.abs(off) / 60; + // convert from minutes into hhmm format (which means 60 minutes = 100 units) + off = (off / 60)*100 + (off % 60); + return (ahead ? '+' : '-') + String("0000" + off).slice(-4); + }, + '%Z': function(date) { + return date.tm_zone; + }, + '%%': function() { + return '%'; + } + }; + for (var rule in EXPANSION_RULES_2) { + if (pattern.indexOf(rule) >= 0) { + pattern = pattern.replace(new RegExp(rule, 'g'), EXPANSION_RULES_2[rule](date)); + } + } + + var bytes = intArrayFromString(pattern, false); + if (bytes.length > maxsize) { + return 0; + } + + writeArrayToMemory(bytes, s); + return bytes.length-1; + } + + function _strftime_l(s, maxsize, format, tm) { + return _strftime(s, maxsize, format, tm); // no locale support yet + } + + + function _time(ptr) { + var ret = (Date.now()/1000)|0; + if (ptr) { + HEAP32[((ptr)>>2)]=ret; + } + return ret; + } +FS.staticInit();; +embind_init_charCodes(); +BindingError = Module['BindingError'] = extendError(Error, 'BindingError');; +InternalError = Module['InternalError'] = extendError(Error, 'InternalError');; +init_emval();; +UnboundTypeError = Module['UnboundTypeError'] = extendError(Error, 'UnboundTypeError');; +var ASSERTIONS = true; + +// Copyright 2017 The Emscripten Authors. All rights reserved. +// Emscripten is available under two separate licenses, the MIT license and the +// University of Illinois/NCSA Open Source License. Both these licenses can be +// found in the LICENSE file. + +/** @type {function(string, boolean=, number=)} */ +function intArrayFromString(stringy, dontAddNull, length) { + var len = length > 0 ? length : lengthBytesUTF8(stringy)+1; + var u8array = new Array(len); + var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length); + if (dontAddNull) u8array.length = numBytesWritten; + return u8array; +} + +function intArrayToString(array) { + var ret = []; + for (var i = 0; i < array.length; i++) { + var chr = array[i]; + if (chr > 0xFF) { + if (ASSERTIONS) { + assert(false, 'Character code ' + chr + ' (' + String.fromCharCode(chr) + ') at offset ' + i + ' not in 0x00-0xFF.'); + } + chr &= 0xFF; + } + ret.push(String.fromCharCode(chr)); + } + return ret.join(''); +} + + +// Copied from https://github.com/strophe/strophejs/blob/e06d027/src/polyfills.js#L149 + +// This code was written by Tyler Akins and has been placed in the +// public domain. It would be nice if you left this header intact. +// Base64 code from Tyler Akins -- http://rumkin.com + +/** + * Decodes a base64 string. + * @param {String} input The string to decode. + */ +var decodeBase64 = typeof atob === 'function' ? atob : function (input) { + var keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + + var output = ''; + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i = 0; + // remove all characters that are not A-Z, a-z, 0-9, +, /, or = + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); + do { + enc1 = keyStr.indexOf(input.charAt(i++)); + enc2 = keyStr.indexOf(input.charAt(i++)); + enc3 = keyStr.indexOf(input.charAt(i++)); + enc4 = keyStr.indexOf(input.charAt(i++)); + + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + + output = output + String.fromCharCode(chr1); + + if (enc3 !== 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 !== 64) { + output = output + String.fromCharCode(chr3); + } + } while (i < input.length); + return output; +}; + +// Converts a string of base64 into a byte array. +// Throws error on invalid input. +function intArrayFromBase64(s) { + if (typeof ENVIRONMENT_IS_NODE === 'boolean' && ENVIRONMENT_IS_NODE) { + var buf; + try { + buf = Buffer.from(s, 'base64'); + } catch (_) { + buf = new Buffer(s, 'base64'); + } + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); + } + + try { + var decoded = decodeBase64(s); + var bytes = new Uint8Array(decoded.length); + for (var i = 0 ; i < decoded.length ; ++i) { + bytes[i] = decoded.charCodeAt(i); + } + return bytes; + } catch (_) { + throw new Error('Converting base64 string to bytes failed.'); + } +} + +// If filename is a base64 data URI, parses and returns data (Buffer on node, +// Uint8Array otherwise). If filename is not a base64 data URI, returns undefined. +function tryParseAsDataURI(filename) { + if (!isDataURI(filename)) { + return; + } + + return intArrayFromBase64(filename.slice(dataURIPrefix.length)); +} + + +// ASM_LIBRARY EXTERN PRIMITIVES: Math_imul,Math_clz32,Int8Array,Int32Array,Math_floor,Math_ceil + +function nullFunc_di(x) { abortFnPtrError(x, 'di'); } +function nullFunc_dii(x) { abortFnPtrError(x, 'dii'); } +function nullFunc_i(x) { abortFnPtrError(x, 'i'); } +function nullFunc_ii(x) { abortFnPtrError(x, 'ii'); } +function nullFunc_iidiiii(x) { abortFnPtrError(x, 'iidiiii'); } +function nullFunc_iii(x) { abortFnPtrError(x, 'iii'); } +function nullFunc_iiii(x) { abortFnPtrError(x, 'iiii'); } +function nullFunc_iiiii(x) { abortFnPtrError(x, 'iiiii'); } +function nullFunc_iiiiid(x) { abortFnPtrError(x, 'iiiiid'); } +function nullFunc_iiiiii(x) { abortFnPtrError(x, 'iiiiii'); } +function nullFunc_iiiiiid(x) { abortFnPtrError(x, 'iiiiiid'); } +function nullFunc_iiiiiii(x) { abortFnPtrError(x, 'iiiiiii'); } +function nullFunc_iiiiiiii(x) { abortFnPtrError(x, 'iiiiiiii'); } +function nullFunc_iiiiiiiii(x) { abortFnPtrError(x, 'iiiiiiiii'); } +function nullFunc_v(x) { abortFnPtrError(x, 'v'); } +function nullFunc_vi(x) { abortFnPtrError(x, 'vi'); } +function nullFunc_vid(x) { abortFnPtrError(x, 'vid'); } +function nullFunc_vii(x) { abortFnPtrError(x, 'vii'); } +function nullFunc_viid(x) { abortFnPtrError(x, 'viid'); } +function nullFunc_viii(x) { abortFnPtrError(x, 'viii'); } +function nullFunc_viiii(x) { abortFnPtrError(x, 'viiii'); } +function nullFunc_viiiii(x) { abortFnPtrError(x, 'viiiii'); } +function nullFunc_viiiiii(x) { abortFnPtrError(x, 'viiiiii'); } +function nullFunc_viiiiiii(x) { abortFnPtrError(x, 'viiiiiii'); } + +function invoke_ii(index,a1) { + var sp = stackSave(); + try { + return dynCall_ii(index,a1); + } catch(e) { + stackRestore(sp); + if (e !== e+0 && e !== 'longjmp') throw e; + _setThrew(1, 0); + } +} + +function invoke_iii(index,a1,a2) { + var sp = stackSave(); + try { + return dynCall_iii(index,a1,a2); + } catch(e) { + stackRestore(sp); + if (e !== e+0 && e !== 'longjmp') throw e; + _setThrew(1, 0); + } +} + +function invoke_iiii(index,a1,a2,a3) { + var sp = stackSave(); + try { + return dynCall_iiii(index,a1,a2,a3); + } catch(e) { + stackRestore(sp); + if (e !== e+0 && e !== 'longjmp') throw e; + _setThrew(1, 0); + } +} + +function invoke_vi(index,a1) { + var sp = stackSave(); + try { + dynCall_vi(index,a1); + } catch(e) { + stackRestore(sp); + if (e !== e+0 && e !== 'longjmp') throw e; + _setThrew(1, 0); + } +} + +function invoke_vii(index,a1,a2) { + var sp = stackSave(); + try { + dynCall_vii(index,a1,a2); + } catch(e) { + stackRestore(sp); + if (e !== e+0 && e !== 'longjmp') throw e; + _setThrew(1, 0); + } +} + +function invoke_viii(index,a1,a2,a3) { + var sp = stackSave(); + try { + dynCall_viii(index,a1,a2,a3); + } catch(e) { + stackRestore(sp); + if (e !== e+0 && e !== 'longjmp') throw e; + _setThrew(1, 0); + } +} + +function invoke_viiii(index,a1,a2,a3,a4) { + var sp = stackSave(); + try { + dynCall_viiii(index,a1,a2,a3,a4); + } catch(e) { + stackRestore(sp); + if (e !== e+0 && e !== 'longjmp') throw e; + _setThrew(1, 0); + } +} + +var asmGlobalArg = { "Math": Math, "Int8Array": Int8Array, "Int16Array": Int16Array, "Int32Array": Int32Array, "Uint8Array": Uint8Array, "Uint16Array": Uint16Array, "Float32Array": Float32Array, "Float64Array": Float64Array, "NaN": NaN, "Infinity": Infinity }; + +var asmLibraryArg = { "___buildEnvironment": ___buildEnvironment, "___cxa_allocate_exception": ___cxa_allocate_exception, "___cxa_begin_catch": ___cxa_begin_catch, "___cxa_throw": ___cxa_throw, "___exception_addRef": ___exception_addRef, "___exception_deAdjust": ___exception_deAdjust, "___gxx_personality_v0": ___gxx_personality_v0, "___lock": ___lock, "___map_file": ___map_file, "___setErrNo": ___setErrNo, "___syscall221": ___syscall221, "___syscall5": ___syscall5, "___syscall54": ___syscall54, "___syscall91": ___syscall91, "___unlock": ___unlock, "___wasi_fd_close": ___wasi_fd_close, "___wasi_fd_read": ___wasi_fd_read, "___wasi_fd_seek": ___wasi_fd_seek, "___wasi_fd_write": ___wasi_fd_write, "__addDays": __addDays, "__arraySum": __arraySum, "__embind_register_bool": __embind_register_bool, "__embind_register_constant": __embind_register_constant, "__embind_register_emval": __embind_register_emval, "__embind_register_float": __embind_register_float, "__embind_register_function": __embind_register_function, "__embind_register_integer": __embind_register_integer, "__embind_register_memory_view": __embind_register_memory_view, "__embind_register_std_string": __embind_register_std_string, "__embind_register_std_wstring": __embind_register_std_wstring, "__embind_register_void": __embind_register_void, "__emscripten_syscall_munmap": __emscripten_syscall_munmap, "__emval_decref": __emval_decref, "__emval_register": __emval_register, "__isLeapYear": __isLeapYear, "_abort": _abort, "_embind_repr": _embind_repr, "_emscripten_asm_const_ii": _emscripten_asm_const_ii, "_emscripten_asm_const_iiddddddddddddd": _emscripten_asm_const_iiddddddddddddd, "_emscripten_asm_const_iiiid": _emscripten_asm_const_iiiid, "_emscripten_asm_const_iiiiiii": _emscripten_asm_const_iiiiiii, "_emscripten_asm_const_iiiiiiiidddddddddddddddddddddddddi": _emscripten_asm_const_iiiiiiiidddddddddddddddddddddddddi, "_emscripten_get_heap_size": _emscripten_get_heap_size, "_emscripten_memcpy_big": _emscripten_memcpy_big, "_emscripten_resize_heap": _emscripten_resize_heap, "_exit": _exit, "_fd_close": _fd_close, "_fd_read": _fd_read, "_fd_seek": _fd_seek, "_fd_write": _fd_write, "_getenv": _getenv, "_gettimeofday": _gettimeofday, "_llvm_exp2_f32": _llvm_exp2_f32, "_llvm_stackrestore": _llvm_stackrestore, "_llvm_stacksave": _llvm_stacksave, "_llvm_trap": _llvm_trap, "_localtime": _localtime, "_localtime_r": _localtime_r, "_longjmp": _longjmp, "_strftime": _strftime, "_strftime_l": _strftime_l, "_time": _time, "_tzset": _tzset, "abort": abort, "abortOnCannotGrowMemory": abortOnCannotGrowMemory, "abortStackOverflow": abortStackOverflow, "count_emval_handles": count_emval_handles, "craftInvokerFunction": craftInvokerFunction, "createNamedFunction": createNamedFunction, "demangle": demangle, "demangleAll": demangleAll, "embind__requireFunction": embind__requireFunction, "embind_init_charCodes": embind_init_charCodes, "emscripten_realloc_buffer": emscripten_realloc_buffer, "ensureOverloadTable": ensureOverloadTable, "exposePublicSymbol": exposePublicSymbol, "extendError": extendError, "floatReadValueFromPointer": floatReadValueFromPointer, "getShiftFromSize": getShiftFromSize, "getTempRet0": getTempRet0, "getTypeName": getTypeName, "get_first_emval": get_first_emval, "heap32VectorToArray": heap32VectorToArray, "init_emval": init_emval, "integerReadValueFromPointer": integerReadValueFromPointer, "invoke_ii": invoke_ii, "invoke_iii": invoke_iii, "invoke_iiii": invoke_iiii, "invoke_vi": invoke_vi, "invoke_vii": invoke_vii, "invoke_viii": invoke_viii, "invoke_viiii": invoke_viiii, "jsStackTrace": jsStackTrace, "makeLegalFunctionName": makeLegalFunctionName, "new_": new_, "nullFunc_di": nullFunc_di, "nullFunc_dii": nullFunc_dii, "nullFunc_i": nullFunc_i, "nullFunc_ii": nullFunc_ii, "nullFunc_iidiiii": nullFunc_iidiiii, "nullFunc_iii": nullFunc_iii, "nullFunc_iiii": nullFunc_iiii, "nullFunc_iiiii": nullFunc_iiiii, "nullFunc_iiiiid": nullFunc_iiiiid, "nullFunc_iiiiii": nullFunc_iiiiii, "nullFunc_iiiiiid": nullFunc_iiiiiid, "nullFunc_iiiiiii": nullFunc_iiiiiii, "nullFunc_iiiiiiii": nullFunc_iiiiiiii, "nullFunc_iiiiiiiii": nullFunc_iiiiiiiii, "nullFunc_v": nullFunc_v, "nullFunc_vi": nullFunc_vi, "nullFunc_vid": nullFunc_vid, "nullFunc_vii": nullFunc_vii, "nullFunc_viid": nullFunc_viid, "nullFunc_viii": nullFunc_viii, "nullFunc_viiii": nullFunc_viiii, "nullFunc_viiiii": nullFunc_viiiii, "nullFunc_viiiiii": nullFunc_viiiiii, "nullFunc_viiiiiii": nullFunc_viiiiiii, "readLatin1String": readLatin1String, "registerType": registerType, "replacePublicSymbol": replacePublicSymbol, "runDestructors": runDestructors, "setTempRet0": setTempRet0, "simpleReadValueFromPointer": simpleReadValueFromPointer, "stackTrace": stackTrace, "tempDoublePtr": tempDoublePtr, "throwBindingError": throwBindingError, "throwInternalError": throwInternalError, "throwUnboundTypeError": throwUnboundTypeError, "whenDependentTypesAreResolved": whenDependentTypesAreResolved }; +// EMSCRIPTEN_START_ASM +var asm = (/** @suppress {uselessCode} */ function(global, env, buffer) { +'almost asm'; + + var HEAP8 = new global.Int8Array(buffer), + HEAP16 = new global.Int16Array(buffer), + HEAP32 = new global.Int32Array(buffer), + HEAPU8 = new global.Uint8Array(buffer), + HEAPU16 = new global.Uint16Array(buffer), + HEAPF32 = new global.Float32Array(buffer), + HEAPF64 = new global.Float64Array(buffer), + tempDoublePtr=env.tempDoublePtr|0, + __THREW__ = 0, + threwValue = 0, + setjmpId = 0, + tempInt = 0, + tempBigInt = 0, + tempBigIntS = 0, + tempValue = 0, + tempDouble = 0.0, + nan = global.NaN, + inf = global.Infinity, + Math_floor=global.Math.floor, + Math_abs=global.Math.abs, + Math_sqrt=global.Math.sqrt, + Math_pow=global.Math.pow, + Math_cos=global.Math.cos, + Math_sin=global.Math.sin, + Math_atan2=global.Math.atan2, + Math_log=global.Math.log, + Math_ceil=global.Math.ceil, + Math_imul=global.Math.imul, + Math_clz32=global.Math.clz32, + abort=env.abort, + setTempRet0=env.setTempRet0, + getTempRet0=env.getTempRet0, + abortStackOverflow=env.abortStackOverflow, + nullFunc_di=env.nullFunc_di, + nullFunc_dii=env.nullFunc_dii, + nullFunc_i=env.nullFunc_i, + nullFunc_ii=env.nullFunc_ii, + nullFunc_iidiiii=env.nullFunc_iidiiii, + nullFunc_iii=env.nullFunc_iii, + nullFunc_iiii=env.nullFunc_iiii, + nullFunc_iiiii=env.nullFunc_iiiii, + nullFunc_iiiiid=env.nullFunc_iiiiid, + nullFunc_iiiiii=env.nullFunc_iiiiii, + nullFunc_iiiiiid=env.nullFunc_iiiiiid, + nullFunc_iiiiiii=env.nullFunc_iiiiiii, + nullFunc_iiiiiiii=env.nullFunc_iiiiiiii, + nullFunc_iiiiiiiii=env.nullFunc_iiiiiiiii, + nullFunc_v=env.nullFunc_v, + nullFunc_vi=env.nullFunc_vi, + nullFunc_vid=env.nullFunc_vid, + nullFunc_vii=env.nullFunc_vii, + nullFunc_viid=env.nullFunc_viid, + nullFunc_viii=env.nullFunc_viii, + nullFunc_viiii=env.nullFunc_viiii, + nullFunc_viiiii=env.nullFunc_viiiii, + nullFunc_viiiiii=env.nullFunc_viiiiii, + nullFunc_viiiiiii=env.nullFunc_viiiiiii, + invoke_ii=env.invoke_ii, + invoke_iii=env.invoke_iii, + invoke_iiii=env.invoke_iiii, + invoke_vi=env.invoke_vi, + invoke_vii=env.invoke_vii, + invoke_viii=env.invoke_viii, + invoke_viiii=env.invoke_viiii, + ___buildEnvironment=env.___buildEnvironment, + ___cxa_allocate_exception=env.___cxa_allocate_exception, + ___cxa_begin_catch=env.___cxa_begin_catch, + ___cxa_throw=env.___cxa_throw, + ___exception_addRef=env.___exception_addRef, + ___exception_deAdjust=env.___exception_deAdjust, + ___gxx_personality_v0=env.___gxx_personality_v0, + ___lock=env.___lock, + ___map_file=env.___map_file, + ___setErrNo=env.___setErrNo, + ___syscall221=env.___syscall221, + ___syscall5=env.___syscall5, + ___syscall54=env.___syscall54, + ___syscall91=env.___syscall91, + ___unlock=env.___unlock, + ___wasi_fd_close=env.___wasi_fd_close, + ___wasi_fd_read=env.___wasi_fd_read, + ___wasi_fd_seek=env.___wasi_fd_seek, + ___wasi_fd_write=env.___wasi_fd_write, + __addDays=env.__addDays, + __arraySum=env.__arraySum, + __embind_register_bool=env.__embind_register_bool, + __embind_register_constant=env.__embind_register_constant, + __embind_register_emval=env.__embind_register_emval, + __embind_register_float=env.__embind_register_float, + __embind_register_function=env.__embind_register_function, + __embind_register_integer=env.__embind_register_integer, + __embind_register_memory_view=env.__embind_register_memory_view, + __embind_register_std_string=env.__embind_register_std_string, + __embind_register_std_wstring=env.__embind_register_std_wstring, + __embind_register_void=env.__embind_register_void, + __emscripten_syscall_munmap=env.__emscripten_syscall_munmap, + __emval_decref=env.__emval_decref, + __emval_register=env.__emval_register, + __isLeapYear=env.__isLeapYear, + _abort=env._abort, + _embind_repr=env._embind_repr, + _emscripten_asm_const_ii=env._emscripten_asm_const_ii, + _emscripten_asm_const_iiddddddddddddd=env._emscripten_asm_const_iiddddddddddddd, + _emscripten_asm_const_iiiid=env._emscripten_asm_const_iiiid, + _emscripten_asm_const_iiiiiii=env._emscripten_asm_const_iiiiiii, + _emscripten_asm_const_iiiiiiiidddddddddddddddddddddddddi=env._emscripten_asm_const_iiiiiiiidddddddddddddddddddddddddi, + _emscripten_get_heap_size=env._emscripten_get_heap_size, + _emscripten_memcpy_big=env._emscripten_memcpy_big, + _emscripten_resize_heap=env._emscripten_resize_heap, + _exit=env._exit, + _fd_close=env._fd_close, + _fd_read=env._fd_read, + _fd_seek=env._fd_seek, + _fd_write=env._fd_write, + _getenv=env._getenv, + _gettimeofday=env._gettimeofday, + _llvm_exp2_f32=env._llvm_exp2_f32, + _llvm_stackrestore=env._llvm_stackrestore, + _llvm_stacksave=env._llvm_stacksave, + _llvm_trap=env._llvm_trap, + _localtime=env._localtime, + _localtime_r=env._localtime_r, + _longjmp=env._longjmp, + _strftime=env._strftime, + _strftime_l=env._strftime_l, + _time=env._time, + _tzset=env._tzset, + abortOnCannotGrowMemory=env.abortOnCannotGrowMemory, + count_emval_handles=env.count_emval_handles, + craftInvokerFunction=env.craftInvokerFunction, + createNamedFunction=env.createNamedFunction, + demangle=env.demangle, + demangleAll=env.demangleAll, + embind__requireFunction=env.embind__requireFunction, + embind_init_charCodes=env.embind_init_charCodes, + emscripten_realloc_buffer=env.emscripten_realloc_buffer, + ensureOverloadTable=env.ensureOverloadTable, + exposePublicSymbol=env.exposePublicSymbol, + extendError=env.extendError, + floatReadValueFromPointer=env.floatReadValueFromPointer, + getShiftFromSize=env.getShiftFromSize, + getTypeName=env.getTypeName, + get_first_emval=env.get_first_emval, + heap32VectorToArray=env.heap32VectorToArray, + init_emval=env.init_emval, + integerReadValueFromPointer=env.integerReadValueFromPointer, + jsStackTrace=env.jsStackTrace, + makeLegalFunctionName=env.makeLegalFunctionName, + new_=env.new_, + readLatin1String=env.readLatin1String, + registerType=env.registerType, + replacePublicSymbol=env.replacePublicSymbol, + runDestructors=env.runDestructors, + simpleReadValueFromPointer=env.simpleReadValueFromPointer, + stackTrace=env.stackTrace, + throwBindingError=env.throwBindingError, + throwInternalError=env.throwInternalError, + throwUnboundTypeError=env.throwUnboundTypeError, + whenDependentTypesAreResolved=env.whenDependentTypesAreResolved, + STACKTOP = 67664, + STACK_MAX = 5310544, + tempFloat = 0.0; + +function _emscripten_replace_memory(newBuffer) { + HEAP8 = new Int8Array(newBuffer); + HEAPU8 = new Uint8Array(newBuffer); + HEAP16 = new Int16Array(newBuffer); + HEAPU16 = new Uint16Array(newBuffer); + HEAP32 = new Int32Array(newBuffer); + HEAPF32 = new Float32Array(newBuffer); + HEAPF64 = new Float64Array(newBuffer); + + buffer = newBuffer; + return true; +} + +// EMSCRIPTEN_START_FUNCS + +function _read_markers($0) { + $0 = $0 | 0; + var $$0 = 0, $$0$i = 0, $$0$i46 = 0, $$0$i78 = 0, $$0$i82 = 0, $$0$i92 = 0, $$0134$lcssa$i = 0, $$0134177$i = 0, $$0135$i = 0, $$0136$i = 0, $$0146$i = 0, $$0148$i = 0, $$0158$i = 0, $$0159$i = 0, $$0168$lcssa$i = 0, $$0168199$i = 0, $$0170$ph$i = 0, $$0170220$i = 0, $$0171$i = 0, $$0171177218$i = 0, $$0171177219$i = 0, $$0176$i = 0, $$0177$i = 0, $$0186$lcssa$i = 0, $$0186203$i = 0, $$0189$lcssa$i = 0, $$0189197$i = 0, $$0189206$i = 0, $$0190201$i = 0, $$0193213$i = 0, $$0231$i = 0, $$041$i = 0, $$042$i = 0, $$057$i = 0, $$087$i = 0, $$093$i = 0, $$093$lcssa$i = 0, $$093100$i = 0, $$09397$i = 0, $$1$i = 0, $$1$i43 = 0, $$1$i47 = 0, $$1$i55 = 0, $$1$i66 = 0, $$1$i79 = 0, $$1$i83 = 0, $$1$i93 = 0, $$10$i = 0, $$10241$i = 0, $$11$i = 0, $$11242$i = 0, $$1137$i = 0, $$1145171$i = 0, $$1160$i = 0, $$1178$i = 0, $$1191202$i = 0, $$12$i = 0, $$12243$i = 0, $$1232$i = 0, $$13$i = 0, $$13244$i = 0, $$14$i = 0, $$142$i = 0, $$14245$i = 0, $$143$i = 0, $$15$i = 0, $$15246$i = 0, $$158$i = 0, $$16$i = 0, $$16247$i = 0, $$17$i = 0, $$17248$i = 0, $$18$i = 0, $$18249$i = 0, $$188$i = 0, $$19$i = 0, $$19250$i = 0, $$2$i = 0, $$2$i52 = 0, $$2$i80 = 0, $$2$i84 = 0, $$2$lcssa$i = 0, $$2$lcssa$i62 = 0, $$2$lcssa$i76 = 0, $$20$i = 0, $$20251$i = 0, $$21$i = 0, $$2101$i = 0, $$21252$i = 0, $$2138$lcssa$i = 0, $$2138175$i = 0, $$2161$lcssa$i = 0, $$2161200$i = 0, $$2175194$i = 0, $$2175194$us$i = 0, $$2176$i = 0, $$2179$i = 0, $$2188$i = 0, $$2192205$i = 0, $$22$i = 0, $$2201$i = 0, $$22253$i = 0, $$2233$i = 0, $$23$i = 0, $$23254$i = 0, $$24$i = 0, $$24255$i = 0, $$25$i = 0, $$25256$i = 0, $$259$i = 0, $$289$i = 0, $$289$lcssa$i = 0, $$289102$i = 0, $$28999$i = 0, $$298$i = 0, $$3$i = 0, $$3$i49 = 0, $$3$i56 = 0, $$3$i67 = 0, $$3$i81 = 0, $$3$i85 = 0, $$3$lcssa$i = 0, $$3139$i = 0, $$3162$i = 0, $$3176198$i = 0, $$3180$i = 0, $$3180$lcssa$i = 0, $$3180212$i = 0, $$3180212236$i = 0, $$3180218$i = 0, $$3211$i = 0, $$3211230$i = 0, $$3211233$i = 0, $$3211235$i = 0, $$3217$i = 0, $$3234$i = 0, $$360$i = 0, $$390$i = 0, $$4$1$i = 0, $$4$10$i = 0, $$4$11$i = 0, $$4$12$i = 0, $$4$13$i = 0, $$4$14$i = 0, $$4$15$i = 0, $$4$2$i = 0, $$4$3$i = 0, $$4$4$i = 0, $$4$5$i = 0, $$4$6$i = 0, $$4$7$i = 0, $$4$8$i = 0, $$4$9$i = 0, $$4$i = 0, $$4$i50 = 0, $$4$i58 = 0, $$4$i71 = 0, $$4$i86 = 0, $$4$lcssa$i = 0, $$4$us$i = 0, $$4140$1$i = 0, $$4140$10$i = 0, $$4140$11$i = 0, $$4140$12$i = 0, $$4140$13$i = 0, $$4140$14$i = 0, $$4140$15$i = 0, $$4140$2$i = 0, $$4140$3$i = 0, $$4140$4$i = 0, $$4140$5$i = 0, $$4140$6$i = 0, $$4140$7$i = 0, $$4140$8$i = 0, $$4140$9$i = 0, $$4140$i = 0, $$4140166$i = 0, $$4163$i = 0, $$4163$lcssa$i = 0, $$4163$us$i = 0, $$4163193$i = 0, $$4163193222$i = 0, $$4163196$i = 0, $$4163196$us$i = 0, $$4165$i = 0, $$4181$i = 0, $$4192$i = 0, $$4192221$i = 0, $$4195$i = 0, $$4195$us$i = 0, $$4235$i = 0, $$491$i = 0, $$5$1$i = 0, $$5$10$i = 0, $$5$11$i = 0, $$5$12$i = 0, $$5$13$i = 0, $$5$14$i = 0, $$5$15$i = 0, $$5$2$i = 0, $$5$3$i = 0, $$5$4$i = 0, $$5$5$i = 0, $$5$6$i = 0, $$5$7$i = 0, $$5$8$i = 0, $$5$9$i = 0, $$5$i = 0, $$5$i57 = 0, $$5$i87 = 0, $$5$us$i = 0, $$5141$1$i = 0, $$5141$10$i = 0, $$5141$11$i = 0, $$5141$12$i = 0, $$5141$13$i = 0, $$5141$14$i = 0, $$5141$15$i = 0, $$5141$2$i = 0, $$5141$3$i = 0, $$5141$4$i = 0, $$5141$5$i = 0, $$5141$6$i = 0, $$5141$7$i = 0, $$5141$8$i = 0, $$5141$9$i = 0, $$5141$i = 0, $$5164$us$i = 0, $$5182$i = 0, $$5236$i = 0, $$6$i = 0, $$6$i88 = 0, $$6$lcssa$i = 0, $$6$us$i = 0, $$6142$lcssa$i = 0, $$6142172$i = 0, $$6165$us$i = 0, $$6173$i = 0, $$6183$i = 0, $$6237$i = 0, $$7$i = 0, $$7$i60 = 0, $$7$i70 = 0, $$7$i90 = 0, $$7143$i = 0, $$7166$i = 0, $$7184$i = 0, $$7238$i = 0, $$8$i = 0, $$8$i91 = 0, $$8185$i = 0, $$8239$i = 0, $$9$i = 0, $$9240$i = 0, $$lcssa$i = 0, $$pre$phi$iZ2D = 0, $1 = 0, $10 = 0, $1007 = 0, $1008 = 0, $1011 = 0, $1024 = 0, $1025 = 0, $1028 = 0, $1036 = 0, $1037 = 0, $1049 = 0, $1050 = 0, $1060 = 0, $1061 = 0, $1064 = 0, $107 = 0, $1075 = 0, $1076 = 0, $108 = 0, $1080 = 0, $1089 = 0, $1090 = 0, $1094 = 0, $11 = 0, $1104 = 0, $1105 = 0, $111 = 0, $1115 = 0, $1116 = 0, $1119 = 0, $1127 = 0, $1128 = 0, $1140 = 0, $1141 = 0, $1144 = 0, $1152 = 0, $1153 = 0, $1165 = 0, $1166 = 0, $1176 = 0, $1177 = 0, $1180 = 0, $1188 = 0, $1189 = 0, $119 = 0, $12 = 0, $120 = 0, $1201 = 0, $1202 = 0, $1205 = 0, $1213 = 0, $1214 = 0, $1226 = 0, $1227 = 0, $123 = 0, $1237 = 0, $1238 = 0, $1241 = 0, $1249 = 0, $1250 = 0, $1262 = 0, $1263 = 0, $1266 = 0, $1274 = 0, $1275 = 0, $1280 = 0, $1294 = 0, $13 = 0, $1300 = 0, $1301 = 0, $1302 = 0, $1309 = 0, $131 = 0, $1310 = 0, $1313 = 0, $132 = 0, $1325 = 0, $1326 = 0, $1327 = 0, $133 = 0, $1340 = 0, $1345 = 0, $1346 = 0, $1347 = 0, $1348 = 0, $1349 = 0, $14 = 0, $15 = 0, $151 = 0, $156 = 0, $157 = 0, $158 = 0, $16 = 0, $164 = 0, $165 = 0, $167 = 0, $17 = 0, $176 = 0, $18 = 0, $180 = 0, $184 = 0, $185 = 0, $190 = 0, $192 = 0, $2 = 0, $20 = 0, $205 = 0, $207 = 0, $209 = 0, $210 = 0, $222 = 0, $229 = 0, $230 = 0, $233 = 0, $241 = 0, $242 = 0, $245 = 0, $25 = 0, $256 = 0, $258 = 0, $26 = 0, $260 = 0, $261 = 0, $27 = 0, $275 = 0, $278 = 0, $282 = 0, $283 = 0, $284 = 0, $291 = 0, $292 = 0, $295 = 0, $3 = 0, $305 = 0, $307 = 0, $314 = 0, $315 = 0, $316 = 0, $317 = 0, $324 = 0, $325 = 0, $326 = 0, $335 = 0, $34 = 0, $343 = 0, $346 = 0, $35 = 0, $350 = 0, $357 = 0, $36 = 0, $360 = 0, $361 = 0, $362 = 0, $369 = 0, $37 = 0, $370 = 0, $373 = 0, $381 = 0, $382 = 0, $385 = 0, $386 = 0, $388 = 0, $396 = 0, $397 = 0, $4 = 0, $409 = 0, $410 = 0, $412 = 0, $416 = 0, $423 = 0, $424 = 0, $429 = 0, $430 = 0, $431 = 0, $433 = 0, $434 = 0, $438 = 0, $443 = 0, $445 = 0, $446 = 0, $447 = 0, $448 = 0, $449 = 0, $450 = 0, $451 = 0, $452 = 0, $453 = 0, $454 = 0, $455 = 0, $456 = 0, $457 = 0, $458 = 0, $459 = 0, $460 = 0, $461 = 0, $466 = 0, $47 = 0, $474 = 0, $475 = 0, $48 = 0, $482 = 0, $483 = 0, $490 = 0, $491 = 0, $498 = 0, $499 = 0, $5 = 0, $506 = 0, $507 = 0, $51 = 0, $514 = 0, $515 = 0, $522 = 0, $523 = 0, $530 = 0, $531 = 0, $538 = 0, $539 = 0, $546 = 0, $547 = 0, $554 = 0, $555 = 0, $562 = 0, $563 = 0, $570 = 0, $571 = 0, $578 = 0, $579 = 0, $586 = 0, $587 = 0, $599 = 0, $6 = 0, $60 = 0, $61 = 0, $613 = 0, $614 = 0, $615 = 0, $622 = 0, $623 = 0, $626 = 0, $634 = 0, $635 = 0, $638 = 0, $639 = 0, $641 = 0, $642 = 0, $650 = 0, $651 = 0, $652 = 0, $653 = 0, $66 = 0, $662 = 0, $667 = 0, $668 = 0, $670 = 0, $671 = 0, $673 = 0, $69 = 0, $7 = 0, $8 = 0, $809 = 0, $810 = 0, $813 = 0, $82 = 0, $842 = 0, $847 = 0, $87 = 0, $88 = 0, $889 = 0, $89 = 0, $894 = 0, $897 = 0, $898 = 0, $899 = 0, $9 = 0, $90 = 0, $906 = 0, $907 = 0, $910 = 0, $918 = 0, $919 = 0, $924 = 0, $934 = 0, $935 = 0, $938 = 0, $95 = 0, $950 = 0, $951 = 0, $957 = 0, $958 = 0, $959 = 0, $960 = 0, $965 = 0, $979 = 0, $980 = 0, $983 = 0, $991 = 0, $992 = 0, $997 = 0, $scevgep$i = 0, $scevgep2$i = 0, $scevgep3$i = 0, $spec$select$i = 0, $spec$select$i74 = 0, dest = 0, label = 0, sp = 0, stop = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 256 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(256); + $1 = sp; + $2 = $0 + 440 | 0; + $3 = $0 + 464 | 0; + $4 = $0 + 24 | 0; + $scevgep$i = $0 + 232 | 0; + $scevgep2$i = $0 + 248 | 0; + $scevgep3$i = $0 + 264 | 0; + $5 = $0 + 280 | 0; + $6 = $0 + 40 | 0; + $7 = $0 + 304 | 0; + $8 = $0 + 308 | 0; + $9 = $0 + 284 | 0; + $10 = $0 + 288 | 0; + $11 = $0 + 289 | 0; + $12 = $0 + 290 | 0; + $13 = $0 + 292 | 0; + $14 = $0 + 294 | 0; + $15 = $0 + 296 | 0; + $16 = $0 + 300 | 0; + $17 = $0 + 36 | 0; + $18 = $0 + 216 | 0; + $20 = HEAP32[$2 >> 2] | 0; + L1 : while (1) { + do if (!$20) { + if (HEAP32[(HEAP32[$3 >> 2] | 0) + 12 >> 2] | 0) { + if (!(_next_marker($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $60 = HEAP32[$2 >> 2] | 0; + break; + } + $25 = HEAP32[$4 >> 2] | 0; + $26 = $25 + 4 | 0; + $27 = HEAP32[$26 >> 2] | 0; + if (!$27) { + if (!(FUNCTION_TABLE_ii[HEAP32[$25 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$0$i = HEAP32[$26 >> 2] | 0; + } else $$0$i = $27; + $$042$i = HEAP32[$25 >> 2] | 0; + $34 = $$0$i + -1 | 0; + $35 = $$042$i + 1 | 0; + $36 = HEAP8[$$042$i >> 0] | 0; + $37 = $36 & 255; + if (!$34) { + if (!(FUNCTION_TABLE_ii[HEAP32[$25 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$1$i = HEAP32[$26 >> 2] | 0; + $$143$i = HEAP32[$25 >> 2] | 0; + } else { + $$1$i = $34; + $$143$i = $35; + } + $47 = HEAP8[$$143$i >> 0] | 0; + $48 = $47 & 255; + if ($36 << 24 >> 24 != -1 | $47 << 24 >> 24 != -40) { + $51 = HEAP32[$0 >> 2] | 0; + HEAP32[$51 + 20 >> 2] = 55; + HEAP32[$51 + 24 >> 2] = $37; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = $48; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + HEAP32[$2 >> 2] = $48; + HEAP32[$25 >> 2] = $$143$i + 1; + HEAP32[$26 >> 2] = $$1$i + -1; + $60 = $48; + } else $60 = $20; while (0); + do switch ($60 | 0) { + case 218: + { + label = 25; + break L1; + break; + } + case 217: + { + label = 75; + break L1; + break; + } + case 216: + { + $61 = HEAP32[$0 >> 2] | 0; + HEAP32[$61 + 20 >> 2] = 104; + FUNCTION_TABLE_vii[HEAP32[$61 + 4 >> 2] & 255]($0, 1); + $66 = (HEAP32[$3 >> 2] | 0) + 12 | 0; + if (!(HEAP32[$66 >> 2] | 0)) $$pre$phi$iZ2D = $66; else { + $69 = HEAP32[$0 >> 2] | 0; + HEAP32[$69 + 20 >> 2] = 64; + FUNCTION_TABLE_vi[HEAP32[$69 >> 2] & 255]($0); + $$pre$phi$iZ2D = (HEAP32[$3 >> 2] | 0) + 12 | 0; + } + dest = $scevgep$i; + stop = dest + 16 | 0; + do { + HEAP8[dest >> 0] = 0; + dest = dest + 1 | 0; + } while ((dest | 0) < (stop | 0)); + dest = $scevgep2$i; + stop = dest + 16 | 0; + do { + HEAP8[dest >> 0] = 1; + dest = dest + 1 | 0; + } while ((dest | 0) < (stop | 0)); + dest = $scevgep3$i; + stop = dest + 16 | 0; + do { + HEAP8[dest >> 0] = 5; + dest = dest + 1 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$5 >> 2] = 0; + HEAP32[$6 >> 2] = 0; + HEAP32[$7 >> 2] = 0; + HEAP32[$8 >> 2] = 0; + HEAP32[$9 >> 2] = 0; + HEAP8[$10 >> 0] = 1; + HEAP8[$11 >> 0] = 1; + HEAP8[$12 >> 0] = 0; + HEAP16[$13 >> 1] = 1; + HEAP16[$14 >> 1] = 1; + HEAP32[$15 >> 2] = 0; + HEAP8[$16 >> 0] = 0; + HEAP32[$$pre$phi$iZ2D >> 2] = 1; + break; + } + case 192: + { + if (!(_get_sof($0, 1, 0, 0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + break; + } + case 193: + { + if (!(_get_sof($0, 0, 0, 0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + break; + } + case 194: + { + if (!(_get_sof($0, 0, 1, 0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + break; + } + case 201: + { + if (!(_get_sof($0, 0, 0, 1) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + break; + } + case 202: + { + if (!(_get_sof($0, 0, 1, 1) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + break; + } + case 207: + case 206: + case 205: + case 203: + case 200: + case 199: + case 198: + case 197: + case 195: + { + $82 = HEAP32[$0 >> 2] | 0; + HEAP32[$82 + 20 >> 2] = 63; + HEAP32[$82 + 24 >> 2] = $60; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + break; + } + case 204: + { + $282 = HEAP32[$4 >> 2] | 0; + $283 = $282 + 4 | 0; + $284 = HEAP32[$283 >> 2] | 0; + if (!$284) { + if (!(FUNCTION_TABLE_ii[HEAP32[$282 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$0$i46 = HEAP32[$283 >> 2] | 0; + } else $$0$i46 = $284; + $$087$i = HEAP32[$282 >> 2] | 0; + $291 = $$0$i46 + -1 | 0; + $292 = $$087$i + 1 | 0; + $295 = HEAPU8[$$087$i >> 0] << 8; + if (!$291) { + if (!(FUNCTION_TABLE_ii[HEAP32[$282 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$1$i47 = HEAP32[$283 >> 2] | 0; + $$188$i = HEAP32[$282 >> 2] | 0; + } else { + $$1$i47 = $291; + $$188$i = $292; + } + $305 = $295 | HEAPU8[$$188$i >> 0]; + $$09397$i = $305 + -2 | 0; + $$298$i = $$1$i47 + -1 | 0; + $$28999$i = $$188$i + 1 | 0; + if ($305 >>> 0 > 2) { + $307 = $282 + 12 | 0; + $$093100$i = $$09397$i; + $$2101$i = $$298$i; + $$289102$i = $$28999$i; + while (1) { + if (!$$2101$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$307 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$3$i49 = HEAP32[$283 >> 2] | 0; + $$390$i = HEAP32[$282 >> 2] | 0; + } else { + $$3$i49 = $$2101$i; + $$390$i = $$289102$i; + } + $314 = $$3$i49 + -1 | 0; + $315 = $$390$i + 1 | 0; + $316 = HEAP8[$$390$i >> 0] | 0; + $317 = $316 & 255; + if (!$314) { + if (!(FUNCTION_TABLE_ii[HEAP32[$307 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$4$i50 = HEAP32[$283 >> 2] | 0; + $$491$i = HEAP32[$282 >> 2] | 0; + } else { + $$4$i50 = $314; + $$491$i = $315; + } + $324 = HEAP8[$$491$i >> 0] | 0; + $325 = $324 & 255; + $326 = HEAP32[$0 >> 2] | 0; + HEAP32[$326 + 20 >> 2] = 81; + HEAP32[$326 + 24 >> 2] = $317; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = $325; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 1); + if (($316 & 255) <= 31) if (($316 & 255) <= 15) { + $343 = $325 & 15; + HEAP8[$0 + 232 + $317 >> 0] = $343; + $346 = ($324 & 255) >>> 4; + HEAP8[$0 + 248 + $317 >> 0] = $346; + if ($343 >>> 0 > ($346 & 255) >>> 0) { + $350 = HEAP32[$0 >> 2] | 0; + HEAP32[$350 + 20 >> 2] = 30; + HEAP32[$350 + 24 >> 2] = $325; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + } else label = 93; else { + $335 = HEAP32[$0 >> 2] | 0; + HEAP32[$335 + 20 >> 2] = 29; + HEAP32[$335 + 24 >> 2] = $317; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + label = 93; + } + if ((label | 0) == 93) { + label = 0; + HEAP8[$317 + -16 + ($0 + 264) >> 0] = $324; + } + $$093$i = $$093100$i + -2 | 0; + $$2$i52 = $$4$i50 + -1 | 0; + $$289$i = $$491$i + 1 | 0; + if (($$093100$i | 0) > 2) { + $$093100$i = $$093$i; + $$2101$i = $$2$i52; + $$289102$i = $$289$i; + } else { + $$093$lcssa$i = $$093$i; + $$2$lcssa$i = $$2$i52; + $$289$lcssa$i = $$289$i; + break; + } + } + } else { + $$093$lcssa$i = $$09397$i; + $$2$lcssa$i = $$298$i; + $$289$lcssa$i = $$28999$i; + } + if ($$093$lcssa$i | 0) { + $357 = HEAP32[$0 >> 2] | 0; + HEAP32[$357 + 20 >> 2] = 12; + FUNCTION_TABLE_vi[HEAP32[$357 >> 2] & 255]($0); + } + HEAP32[$282 >> 2] = $$289$lcssa$i; + HEAP32[$283 >> 2] = $$2$lcssa$i; + break; + } + case 196: + { + $360 = HEAP32[$4 >> 2] | 0; + $361 = $360 + 4 | 0; + $362 = HEAP32[$361 >> 2] | 0; + if (!$362) { + if (!(FUNCTION_TABLE_ii[HEAP32[$360 + 12 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$0135$i = HEAP32[$361 >> 2] | 0; + } else $$0135$i = $362; + $$0136$i = HEAP32[$360 >> 2] | 0; + $369 = $$0135$i + -1 | 0; + $370 = $$0136$i + 1 | 0; + $373 = HEAPU8[$$0136$i >> 0] << 8; + if (!$369) { + if (!(FUNCTION_TABLE_ii[HEAP32[$360 + 12 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$1$i55 = HEAP32[$361 >> 2] | 0; + $$1137$i = HEAP32[$360 >> 2] | 0; + } else { + $$1$i55 = $369; + $$1137$i = $370; + } + $381 = $$1$i55 + -1 | 0; + $382 = $$1137$i + 1 | 0; + $385 = $373 | HEAPU8[$$1137$i >> 0]; + $386 = $385 + -2 | 0; + if ($385 >>> 0 > 18) { + $388 = $360 + 12 | 0; + $$0134177$i = $386; + $$2138175$i = $382; + $$2176$i = $381; + while (1) { + if (!$$2176$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$3$i56 = HEAP32[$361 >> 2] | 0; + $$3139$i = HEAP32[$360 >> 2] | 0; + } else { + $$3$i56 = $$2176$i; + $$3139$i = $$2138175$i; + } + $396 = HEAPU8[$$3139$i >> 0] | 0; + $397 = HEAP32[$0 >> 2] | 0; + HEAP32[$397 + 20 >> 2] = 82; + HEAP32[$397 + 24 >> 2] = $396; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 1); + $$4165$i = $$3$i56 + -1 | 0; + $$4140166$i = $$3139$i + 1 | 0; + if (!$$4165$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$5$i57 = HEAP32[$361 >> 2] | 0; + $$5141$i = HEAP32[$360 >> 2] | 0; + } else { + $$5$i57 = $$4165$i; + $$5141$i = $$4140166$i; + } + $409 = HEAP8[$$5141$i >> 0] | 0; + $410 = $409 & 255; + $$4$i58 = $$5$i57 + -1 | 0; + $$4140$i = $$5141$i + 1 | 0; + if (!$$4$i58) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$5$1$i = HEAP32[$361 >> 2] | 0; + $$5141$1$i = HEAP32[$360 >> 2] | 0; + } else { + $$5$1$i = $$4$i58; + $$5141$1$i = $$4140$i; + } + $447 = HEAP8[$$5141$1$i >> 0] | 0; + $474 = $447 & 255; + $475 = $474 + $410 | 0; + $$4$1$i = $$5$1$i + -1 | 0; + $$4140$1$i = $$5141$1$i + 1 | 0; + if (!$$4$1$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$5$2$i = HEAP32[$361 >> 2] | 0; + $$5141$2$i = HEAP32[$360 >> 2] | 0; + } else { + $$5$2$i = $$4$1$i; + $$5141$2$i = $$4140$1$i; + } + $448 = HEAP8[$$5141$2$i >> 0] | 0; + $482 = $448 & 255; + $483 = $475 + $482 | 0; + $$4$2$i = $$5$2$i + -1 | 0; + $$4140$2$i = $$5141$2$i + 1 | 0; + if (!$$4$2$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$5$3$i = HEAP32[$361 >> 2] | 0; + $$5141$3$i = HEAP32[$360 >> 2] | 0; + } else { + $$5$3$i = $$4$2$i; + $$5141$3$i = $$4140$2$i; + } + $449 = HEAP8[$$5141$3$i >> 0] | 0; + $490 = $449 & 255; + $491 = $483 + $490 | 0; + $$4$3$i = $$5$3$i + -1 | 0; + $$4140$3$i = $$5141$3$i + 1 | 0; + if (!$$4$3$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$5$4$i = HEAP32[$361 >> 2] | 0; + $$5141$4$i = HEAP32[$360 >> 2] | 0; + } else { + $$5$4$i = $$4$3$i; + $$5141$4$i = $$4140$3$i; + } + $450 = HEAP8[$$5141$4$i >> 0] | 0; + $498 = $450 & 255; + $499 = $491 + $498 | 0; + $$4$4$i = $$5$4$i + -1 | 0; + $$4140$4$i = $$5141$4$i + 1 | 0; + if (!$$4$4$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$5$5$i = HEAP32[$361 >> 2] | 0; + $$5141$5$i = HEAP32[$360 >> 2] | 0; + } else { + $$5$5$i = $$4$4$i; + $$5141$5$i = $$4140$4$i; + } + $451 = HEAP8[$$5141$5$i >> 0] | 0; + $506 = $451 & 255; + $507 = $499 + $506 | 0; + $$4$5$i = $$5$5$i + -1 | 0; + $$4140$5$i = $$5141$5$i + 1 | 0; + if (!$$4$5$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$5$6$i = HEAP32[$361 >> 2] | 0; + $$5141$6$i = HEAP32[$360 >> 2] | 0; + } else { + $$5$6$i = $$4$5$i; + $$5141$6$i = $$4140$5$i; + } + $452 = HEAP8[$$5141$6$i >> 0] | 0; + $514 = $452 & 255; + $515 = $507 + $514 | 0; + $$4$6$i = $$5$6$i + -1 | 0; + $$4140$6$i = $$5141$6$i + 1 | 0; + if (!$$4$6$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$5$7$i = HEAP32[$361 >> 2] | 0; + $$5141$7$i = HEAP32[$360 >> 2] | 0; + } else { + $$5$7$i = $$4$6$i; + $$5141$7$i = $$4140$6$i; + } + $453 = HEAP8[$$5141$7$i >> 0] | 0; + $522 = $453 & 255; + $523 = $515 + $522 | 0; + $$4$7$i = $$5$7$i + -1 | 0; + $$4140$7$i = $$5141$7$i + 1 | 0; + if (!$$4$7$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$5$8$i = HEAP32[$361 >> 2] | 0; + $$5141$8$i = HEAP32[$360 >> 2] | 0; + } else { + $$5$8$i = $$4$7$i; + $$5141$8$i = $$4140$7$i; + } + $454 = HEAP8[$$5141$8$i >> 0] | 0; + $530 = $454 & 255; + $531 = $523 + $530 | 0; + $$4$8$i = $$5$8$i + -1 | 0; + $$4140$8$i = $$5141$8$i + 1 | 0; + if (!$$4$8$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$5$9$i = HEAP32[$361 >> 2] | 0; + $$5141$9$i = HEAP32[$360 >> 2] | 0; + } else { + $$5$9$i = $$4$8$i; + $$5141$9$i = $$4140$8$i; + } + $455 = HEAP8[$$5141$9$i >> 0] | 0; + $538 = $455 & 255; + $539 = $531 + $538 | 0; + $$4$9$i = $$5$9$i + -1 | 0; + $$4140$9$i = $$5141$9$i + 1 | 0; + if (!$$4$9$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$5$10$i = HEAP32[$361 >> 2] | 0; + $$5141$10$i = HEAP32[$360 >> 2] | 0; + } else { + $$5$10$i = $$4$9$i; + $$5141$10$i = $$4140$9$i; + } + $456 = HEAP8[$$5141$10$i >> 0] | 0; + $546 = $456 & 255; + $547 = $539 + $546 | 0; + $$4$10$i = $$5$10$i + -1 | 0; + $$4140$10$i = $$5141$10$i + 1 | 0; + if (!$$4$10$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$5$11$i = HEAP32[$361 >> 2] | 0; + $$5141$11$i = HEAP32[$360 >> 2] | 0; + } else { + $$5$11$i = $$4$10$i; + $$5141$11$i = $$4140$10$i; + } + $457 = HEAP8[$$5141$11$i >> 0] | 0; + $554 = $457 & 255; + $555 = $547 + $554 | 0; + $$4$11$i = $$5$11$i + -1 | 0; + $$4140$11$i = $$5141$11$i + 1 | 0; + if (!$$4$11$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$5$12$i = HEAP32[$361 >> 2] | 0; + $$5141$12$i = HEAP32[$360 >> 2] | 0; + } else { + $$5$12$i = $$4$11$i; + $$5141$12$i = $$4140$11$i; + } + $458 = HEAP8[$$5141$12$i >> 0] | 0; + $562 = $458 & 255; + $563 = $555 + $562 | 0; + $$4$12$i = $$5$12$i + -1 | 0; + $$4140$12$i = $$5141$12$i + 1 | 0; + if (!$$4$12$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$5$13$i = HEAP32[$361 >> 2] | 0; + $$5141$13$i = HEAP32[$360 >> 2] | 0; + } else { + $$5$13$i = $$4$12$i; + $$5141$13$i = $$4140$12$i; + } + $459 = HEAP8[$$5141$13$i >> 0] | 0; + $570 = $459 & 255; + $571 = $563 + $570 | 0; + $$4$13$i = $$5$13$i + -1 | 0; + $$4140$13$i = $$5141$13$i + 1 | 0; + if (!$$4$13$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$5$14$i = HEAP32[$361 >> 2] | 0; + $$5141$14$i = HEAP32[$360 >> 2] | 0; + } else { + $$5$14$i = $$4$13$i; + $$5141$14$i = $$4140$13$i; + } + $460 = HEAP8[$$5141$14$i >> 0] | 0; + $578 = $460 & 255; + $579 = $571 + $578 | 0; + $$4$14$i = $$5$14$i + -1 | 0; + $$4140$14$i = $$5141$14$i + 1 | 0; + if (!$$4$14$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$5$15$i = HEAP32[$361 >> 2] | 0; + $$5141$15$i = HEAP32[$360 >> 2] | 0; + } else { + $$5$15$i = $$4$14$i; + $$5141$15$i = $$4140$14$i; + } + $461 = HEAP8[$$5141$15$i >> 0] | 0; + $586 = $461 & 255; + $416 = $579 + $586 | 0; + $$4$15$i = $$5$15$i + -1 | 0; + $$4140$15$i = $$5141$15$i + 1 | 0; + $431 = $$0134177$i + -17 | 0; + $587 = HEAP32[$0 >> 2] | 0; + HEAP32[$587 + 24 >> 2] = $410; + HEAP32[$587 + 28 >> 2] = $474; + HEAP32[$587 + 32 >> 2] = $482; + HEAP32[$587 + 36 >> 2] = $490; + HEAP32[$587 + 40 >> 2] = $498; + HEAP32[$587 + 44 >> 2] = $506; + HEAP32[$587 + 48 >> 2] = $514; + HEAP32[$587 + 52 >> 2] = $522; + HEAP32[$587 + 20 >> 2] = 88; + FUNCTION_TABLE_vii[HEAP32[$587 + 4 >> 2] & 255]($0, 2); + $599 = HEAP32[$0 >> 2] | 0; + HEAP32[$599 + 24 >> 2] = $530; + HEAP32[$599 + 28 >> 2] = $538; + HEAP32[$599 + 32 >> 2] = $546; + HEAP32[$599 + 36 >> 2] = $554; + HEAP32[$599 + 40 >> 2] = $562; + HEAP32[$599 + 44 >> 2] = $570; + HEAP32[$599 + 48 >> 2] = $578; + HEAP32[$599 + 52 >> 2] = $586; + HEAP32[$599 + 20 >> 2] = 88; + FUNCTION_TABLE_vii[HEAP32[$599 + 4 >> 2] & 255]($0, 2); + if ($416 >>> 0 > 256 | ($431 | 0) < ($416 | 0)) { + $412 = HEAP32[$0 >> 2] | 0; + HEAP32[$412 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$412 >> 2] & 255]($0); + } + _memset($1 | 0, 0, 256) | 0; + if (!$416) { + $$6$lcssa$i = $$4$15$i; + $$6142$lcssa$i = $$4140$15$i; + $430 = 0; + } else { + $$1145171$i = 0; + $$6142172$i = $$4140$15$i; + $$6173$i = $$4$15$i; + while (1) { + if (!$$6173$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$388 >> 2] & 127]($0) | 0)) { + label = 174; + break L1; + } + $$7$i60 = HEAP32[$361 >> 2] | 0; + $$7143$i = HEAP32[$360 >> 2] | 0; + } else { + $$7$i60 = $$6173$i; + $$7143$i = $$6142172$i; + } + $423 = $$7$i60 + -1 | 0; + $424 = $$7143$i + 1 | 0; + HEAP8[$1 + $$1145171$i >> 0] = HEAP8[$$7143$i >> 0] | 0; + $$1145171$i = $$1145171$i + 1 | 0; + if ($$1145171$i >>> 0 >= $416 >>> 0) { + $$6$lcssa$i = $423; + $$6142$lcssa$i = $424; + $430 = $416; + break; + } else { + $$6142172$i = $424; + $$6173$i = $423; + } + } + } + $429 = $431 - $430 | 0; + $433 = ($396 & 16 | 0) == 0; + $434 = $396 + -16 | 0; + $$0148$i = $433 ? $396 : $434; + $$0146$i = $433 ? $0 + 180 + ($396 << 2) | 0 : $0 + 196 + ($434 << 2) | 0; + if ($$0148$i >>> 0 > 3) { + $438 = HEAP32[$0 >> 2] | 0; + HEAP32[$438 + 20 >> 2] = 31; + HEAP32[$438 + 24 >> 2] = $$0148$i; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $443 = HEAP32[$$0146$i >> 2] | 0; + if (!$443) { + $445 = _jpeg_alloc_huff_table($0) | 0; + HEAP32[$$0146$i >> 2] = $445; + $446 = $445; + } else $446 = $443; + HEAP8[$446 >> 0] = 0; + HEAP8[$446 + 1 >> 0] = $409; + HEAP8[$446 + 2 >> 0] = $447; + HEAP8[$446 + 3 >> 0] = $448; + HEAP8[$446 + 4 >> 0] = $449; + HEAP8[$446 + 5 >> 0] = $450; + HEAP8[$446 + 6 >> 0] = $451; + HEAP8[$446 + 7 >> 0] = $452; + HEAP8[$446 + 8 >> 0] = $453; + HEAP8[$446 + 9 >> 0] = $454; + HEAP8[$446 + 10 >> 0] = $455; + HEAP8[$446 + 11 >> 0] = $456; + HEAP8[$446 + 12 >> 0] = $457; + HEAP8[$446 + 13 >> 0] = $458; + HEAP8[$446 + 14 >> 0] = $459; + HEAP8[$446 + 15 >> 0] = $460; + HEAP8[$446 + 16 >> 0] = $461; + _memcpy((HEAP32[$$0146$i >> 2] | 0) + 17 | 0, $1 | 0, 256) | 0; + if (($429 | 0) > 16) { + $$0134177$i = $429; + $$2138175$i = $$6142$lcssa$i; + $$2176$i = $$6$lcssa$i; + } else { + $$0134$lcssa$i = $429; + $$2$lcssa$i62 = $$6$lcssa$i; + $$2138$lcssa$i = $$6142$lcssa$i; + break; + } + } + } else { + $$0134$lcssa$i = $386; + $$2$lcssa$i62 = $381; + $$2138$lcssa$i = $382; + } + if ($$0134$lcssa$i | 0) { + $466 = HEAP32[$0 >> 2] | 0; + HEAP32[$466 + 20 >> 2] = 12; + FUNCTION_TABLE_vi[HEAP32[$466 >> 2] & 255]($0); + } + HEAP32[$360 >> 2] = $$2138$lcssa$i; + HEAP32[$361 >> 2] = $$2$lcssa$i62; + break; + } + case 219: + { + $613 = HEAP32[$4 >> 2] | 0; + $614 = $613 + 4 | 0; + $615 = HEAP32[$614 >> 2] | 0; + if (!$615) { + if (!(FUNCTION_TABLE_ii[HEAP32[$613 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$0158$i = HEAP32[$614 >> 2] | 0; + } else $$0158$i = $615; + $$0159$i = HEAP32[$613 >> 2] | 0; + $622 = $$0158$i + -1 | 0; + $623 = $$0159$i + 1 | 0; + $626 = HEAPU8[$$0159$i >> 0] << 8; + if (!$622) { + if (!(FUNCTION_TABLE_ii[HEAP32[$613 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$1$i66 = HEAP32[$614 >> 2] | 0; + $$1160$i = HEAP32[$613 >> 2] | 0; + } else { + $$1$i66 = $622; + $$1160$i = $623; + } + $634 = $$1$i66 + -1 | 0; + $635 = $$1160$i + 1 | 0; + $638 = $626 | HEAPU8[$$1160$i >> 0]; + $639 = $638 + -2 | 0; + if ($638 >>> 0 > 2) { + $641 = $613 + 12 | 0; + $$0168199$i = $639; + $$2161200$i = $635; + $$2201$i = $634; + while (1) { + $642 = $$0168199$i + -1 | 0; + if (!$$2201$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$641 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$3$i67 = HEAP32[$614 >> 2] | 0; + $$3162$i = HEAP32[$613 >> 2] | 0; + } else { + $$3$i67 = $$2201$i; + $$3162$i = $$2161200$i; + } + $650 = HEAPU8[$$3162$i >> 0] | 0; + $651 = $650 >>> 4; + $652 = $650 & 15; + $653 = HEAP32[$0 >> 2] | 0; + HEAP32[$653 + 20 >> 2] = 83; + HEAP32[$653 + 24 >> 2] = $652; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = $651; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 1); + if ($652 >>> 0 > 3) { + $662 = HEAP32[$0 >> 2] | 0; + HEAP32[$662 + 20 >> 2] = 32; + HEAP32[$662 + 24 >> 2] = $652; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $667 = $0 + 164 + ($652 << 2) | 0; + $668 = HEAP32[$667 >> 2] | 0; + if (!$668) { + $670 = _jpeg_alloc_quant_table($0) | 0; + HEAP32[$667 >> 2] = $670; + $673 = $670; + } else $673 = $668; + $671 = ($651 | 0) != 0; + if ($671) if (($$0168199$i | 0) < 129) { + HEAP16[$673 >> 1] = 1; + HEAP16[$673 + 2 >> 1] = 1; + HEAP16[$673 + 4 >> 1] = 1; + HEAP16[$673 + 6 >> 1] = 1; + HEAP16[$673 + 8 >> 1] = 1; + HEAP16[$673 + 10 >> 1] = 1; + HEAP16[$673 + 12 >> 1] = 1; + HEAP16[$673 + 14 >> 1] = 1; + HEAP16[$673 + 16 >> 1] = 1; + HEAP16[$673 + 18 >> 1] = 1; + HEAP16[$673 + 20 >> 1] = 1; + HEAP16[$673 + 22 >> 1] = 1; + HEAP16[$673 + 24 >> 1] = 1; + HEAP16[$673 + 26 >> 1] = 1; + HEAP16[$673 + 28 >> 1] = 1; + HEAP16[$673 + 30 >> 1] = 1; + HEAP16[$673 + 32 >> 1] = 1; + HEAP16[$673 + 34 >> 1] = 1; + HEAP16[$673 + 36 >> 1] = 1; + HEAP16[$673 + 38 >> 1] = 1; + HEAP16[$673 + 40 >> 1] = 1; + HEAP16[$673 + 42 >> 1] = 1; + HEAP16[$673 + 44 >> 1] = 1; + HEAP16[$673 + 46 >> 1] = 1; + HEAP16[$673 + 48 >> 1] = 1; + HEAP16[$673 + 50 >> 1] = 1; + HEAP16[$673 + 52 >> 1] = 1; + HEAP16[$673 + 54 >> 1] = 1; + HEAP16[$673 + 56 >> 1] = 1; + HEAP16[$673 + 58 >> 1] = 1; + HEAP16[$673 + 60 >> 1] = 1; + HEAP16[$673 + 62 >> 1] = 1; + HEAP16[$673 + 64 >> 1] = 1; + HEAP16[$673 + 66 >> 1] = 1; + HEAP16[$673 + 68 >> 1] = 1; + HEAP16[$673 + 70 >> 1] = 1; + HEAP16[$673 + 72 >> 1] = 1; + HEAP16[$673 + 74 >> 1] = 1; + HEAP16[$673 + 76 >> 1] = 1; + HEAP16[$673 + 78 >> 1] = 1; + HEAP16[$673 + 80 >> 1] = 1; + HEAP16[$673 + 82 >> 1] = 1; + HEAP16[$673 + 84 >> 1] = 1; + HEAP16[$673 + 86 >> 1] = 1; + HEAP16[$673 + 88 >> 1] = 1; + HEAP16[$673 + 90 >> 1] = 1; + HEAP16[$673 + 92 >> 1] = 1; + HEAP16[$673 + 94 >> 1] = 1; + HEAP16[$673 + 96 >> 1] = 1; + HEAP16[$673 + 98 >> 1] = 1; + HEAP16[$673 + 100 >> 1] = 1; + HEAP16[$673 + 102 >> 1] = 1; + HEAP16[$673 + 104 >> 1] = 1; + HEAP16[$673 + 106 >> 1] = 1; + HEAP16[$673 + 108 >> 1] = 1; + HEAP16[$673 + 110 >> 1] = 1; + HEAP16[$673 + 112 >> 1] = 1; + HEAP16[$673 + 114 >> 1] = 1; + HEAP16[$673 + 116 >> 1] = 1; + HEAP16[$673 + 118 >> 1] = 1; + HEAP16[$673 + 120 >> 1] = 1; + HEAP16[$673 + 122 >> 1] = 1; + HEAP16[$673 + 124 >> 1] = 1; + HEAP16[$673 + 126 >> 1] = 1; + $$0171$i = $642 >> 1; + label = 196; + } else label = 203; else if (($$0168199$i | 0) < 65) { + HEAP16[$673 >> 1] = 1; + HEAP16[$673 + 2 >> 1] = 1; + HEAP16[$673 + 4 >> 1] = 1; + HEAP16[$673 + 6 >> 1] = 1; + HEAP16[$673 + 8 >> 1] = 1; + HEAP16[$673 + 10 >> 1] = 1; + HEAP16[$673 + 12 >> 1] = 1; + HEAP16[$673 + 14 >> 1] = 1; + HEAP16[$673 + 16 >> 1] = 1; + HEAP16[$673 + 18 >> 1] = 1; + HEAP16[$673 + 20 >> 1] = 1; + HEAP16[$673 + 22 >> 1] = 1; + HEAP16[$673 + 24 >> 1] = 1; + HEAP16[$673 + 26 >> 1] = 1; + HEAP16[$673 + 28 >> 1] = 1; + HEAP16[$673 + 30 >> 1] = 1; + HEAP16[$673 + 32 >> 1] = 1; + HEAP16[$673 + 34 >> 1] = 1; + HEAP16[$673 + 36 >> 1] = 1; + HEAP16[$673 + 38 >> 1] = 1; + HEAP16[$673 + 40 >> 1] = 1; + HEAP16[$673 + 42 >> 1] = 1; + HEAP16[$673 + 44 >> 1] = 1; + HEAP16[$673 + 46 >> 1] = 1; + HEAP16[$673 + 48 >> 1] = 1; + HEAP16[$673 + 50 >> 1] = 1; + HEAP16[$673 + 52 >> 1] = 1; + HEAP16[$673 + 54 >> 1] = 1; + HEAP16[$673 + 56 >> 1] = 1; + HEAP16[$673 + 58 >> 1] = 1; + HEAP16[$673 + 60 >> 1] = 1; + HEAP16[$673 + 62 >> 1] = 1; + HEAP16[$673 + 64 >> 1] = 1; + HEAP16[$673 + 66 >> 1] = 1; + HEAP16[$673 + 68 >> 1] = 1; + HEAP16[$673 + 70 >> 1] = 1; + HEAP16[$673 + 72 >> 1] = 1; + HEAP16[$673 + 74 >> 1] = 1; + HEAP16[$673 + 76 >> 1] = 1; + HEAP16[$673 + 78 >> 1] = 1; + HEAP16[$673 + 80 >> 1] = 1; + HEAP16[$673 + 82 >> 1] = 1; + HEAP16[$673 + 84 >> 1] = 1; + HEAP16[$673 + 86 >> 1] = 1; + HEAP16[$673 + 88 >> 1] = 1; + HEAP16[$673 + 90 >> 1] = 1; + HEAP16[$673 + 92 >> 1] = 1; + HEAP16[$673 + 94 >> 1] = 1; + HEAP16[$673 + 96 >> 1] = 1; + HEAP16[$673 + 98 >> 1] = 1; + HEAP16[$673 + 100 >> 1] = 1; + HEAP16[$673 + 102 >> 1] = 1; + HEAP16[$673 + 104 >> 1] = 1; + HEAP16[$673 + 106 >> 1] = 1; + HEAP16[$673 + 108 >> 1] = 1; + HEAP16[$673 + 110 >> 1] = 1; + HEAP16[$673 + 112 >> 1] = 1; + HEAP16[$673 + 114 >> 1] = 1; + HEAP16[$673 + 116 >> 1] = 1; + HEAP16[$673 + 118 >> 1] = 1; + HEAP16[$673 + 120 >> 1] = 1; + HEAP16[$673 + 122 >> 1] = 1; + HEAP16[$673 + 124 >> 1] = 1; + HEAP16[$673 + 126 >> 1] = 1; + $$0171$i = $642; + label = 196; + } else label = 203; + L197 : do if ((label | 0) == 196) { + label = 0; + switch ($$0171$i | 0) { + case 4: + { + $$0170$ph$i = 3792; + break; + } + case 9: + { + $$0170$ph$i = 3680; + break; + } + case 16: + { + $$0170$ph$i = 3552; + break; + } + case 25: + { + $$0170$ph$i = 3376; + break; + } + case 36: + { + $$0170$ph$i = 3168; + break; + } + case 49: + { + $$0170$ph$i = 2896; + break; + } + default: + { + $$4192$i = $$3$i67 + -1 | 0; + $$4163193$i = $$3162$i + 1 | 0; + if (($$0171$i | 0) > 0) { + $$0170220$i = 2576; + $$0171177218$i = $$0171$i; + $$4163193222$i = $$4163193$i; + $$4192221$i = $$4192$i; + label = 205; + break L197; + } else { + $$0171177219$i = $$0171$i; + $$4$lcssa$i = $$4192$i; + $$4163$lcssa$i = $$4163193$i; + break L197; + } + } + } + $$0170220$i = $$0170$ph$i; + $$0171177218$i = $$0171$i; + $$4163193222$i = $$3162$i + 1 | 0; + $$4192221$i = $$3$i67 + -1 | 0; + label = 205; + } else if ((label | 0) == 203) { + label = 0; + $$0170220$i = 2576; + $$0171177218$i = 64; + $$4163193222$i = $$3162$i + 1 | 0; + $$4192221$i = $$3$i67 + -1 | 0; + label = 205; + } while (0); + L208 : do if ((label | 0) == 205) { + label = 0; + if (!$671) { + $$2175194$i = 0; + $$4163196$i = $$4163193222$i; + $$4195$i = $$4192221$i; + while (1) { + if (!$$4195$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$641 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$7$i70 = HEAP32[$614 >> 2] | 0; + $$7166$i = HEAP32[$613 >> 2] | 0; + } else { + $$7$i70 = $$4195$i; + $$7166$i = $$4163196$i; + } + HEAP16[$673 + (HEAP32[$$0170220$i + ($$2175194$i << 2) >> 2] << 1) >> 1] = HEAPU8[$$7166$i >> 0] | 0; + $$2175194$i = $$2175194$i + 1 | 0; + $$4$i71 = $$7$i70 + -1 | 0; + $$4163$i = $$7166$i + 1 | 0; + if (($$2175194$i | 0) >= ($$0171177218$i | 0)) { + $$0171177219$i = $$0171177218$i; + $$4$lcssa$i = $$4$i71; + $$4163$lcssa$i = $$4163$i; + break L208; + } else { + $$4163196$i = $$4163$i; + $$4195$i = $$4$i71; + } + } + } + $$2175194$us$i = 0; + $$4163196$us$i = $$4163193222$i; + $$4195$us$i = $$4192221$i; + while (1) { + if (!$$4195$us$i) { + if (!(FUNCTION_TABLE_ii[HEAP32[$641 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$5$us$i = HEAP32[$614 >> 2] | 0; + $$5164$us$i = HEAP32[$613 >> 2] | 0; + } else { + $$5$us$i = $$4195$us$i; + $$5164$us$i = $$4163196$us$i; + } + $809 = $$5$us$i + -1 | 0; + $810 = $$5164$us$i + 1 | 0; + $813 = HEAPU8[$$5164$us$i >> 0] << 8; + if (!$809) { + if (!(FUNCTION_TABLE_ii[HEAP32[$641 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$6$us$i = HEAP32[$614 >> 2] | 0; + $$6165$us$i = HEAP32[$613 >> 2] | 0; + } else { + $$6$us$i = $809; + $$6165$us$i = $810; + } + HEAP16[$673 + (HEAP32[$$0170220$i + ($$2175194$us$i << 2) >> 2] << 1) >> 1] = $813 | HEAPU8[$$6165$us$i >> 0]; + $$2175194$us$i = $$2175194$us$i + 1 | 0; + $$4$us$i = $$6$us$i + -1 | 0; + $$4163$us$i = $$6165$us$i + 1 | 0; + if (($$2175194$us$i | 0) >= ($$0171177218$i | 0)) { + $$0171177219$i = $$0171177218$i; + $$4$lcssa$i = $$4$us$i; + $$4163$lcssa$i = $$4163$us$i; + break; + } else { + $$4163196$us$i = $$4163$us$i; + $$4195$us$i = $$4$us$i; + } + } + } while (0); + $842 = HEAP32[$0 >> 2] | 0; + L230 : do if ((HEAP32[$842 + 104 >> 2] | 0) > 1) { + $$3176198$i = 0; + $847 = $842; + while (1) { + HEAP32[$847 + 24 >> 2] = HEAPU16[$673 + ($$3176198$i << 1) >> 1]; + HEAP32[$847 + 28 >> 2] = HEAPU16[$673 + (($$3176198$i | 1) << 1) >> 1]; + HEAP32[$847 + 32 >> 2] = HEAPU16[$673 + (($$3176198$i | 2) << 1) >> 1]; + HEAP32[$847 + 36 >> 2] = HEAPU16[$673 + (($$3176198$i | 3) << 1) >> 1]; + HEAP32[$847 + 40 >> 2] = HEAPU16[$673 + (($$3176198$i | 4) << 1) >> 1]; + HEAP32[$847 + 44 >> 2] = HEAPU16[$673 + (($$3176198$i | 5) << 1) >> 1]; + HEAP32[$847 + 48 >> 2] = HEAPU16[$673 + (($$3176198$i | 6) << 1) >> 1]; + HEAP32[$847 + 52 >> 2] = HEAPU16[$673 + (($$3176198$i | 7) << 1) >> 1]; + HEAP32[$847 + 20 >> 2] = 95; + FUNCTION_TABLE_vii[HEAP32[$847 + 4 >> 2] & 255]($0, 2); + $889 = $$3176198$i + 8 | 0; + if ($889 >>> 0 >= 64) break L230; + $$3176198$i = $889; + $847 = HEAP32[$0 >> 2] | 0; + } + } while (0); + $spec$select$i74 = $642 - $$0171177219$i + ($671 ? 0 - $$0171177219$i | 0 : 0) | 0; + if (($spec$select$i74 | 0) > 0) { + $$0168199$i = $spec$select$i74; + $$2161200$i = $$4163$lcssa$i; + $$2201$i = $$4$lcssa$i; + } else { + $$0168$lcssa$i = $spec$select$i74; + $$2$lcssa$i76 = $$4$lcssa$i; + $$2161$lcssa$i = $$4163$lcssa$i; + break; + } + } + } else { + $$0168$lcssa$i = $639; + $$2$lcssa$i76 = $634; + $$2161$lcssa$i = $635; + } + if ($$0168$lcssa$i | 0) { + $894 = HEAP32[$0 >> 2] | 0; + HEAP32[$894 + 20 >> 2] = 12; + FUNCTION_TABLE_vi[HEAP32[$894 >> 2] & 255]($0); + } + HEAP32[$613 >> 2] = $$2161$lcssa$i; + HEAP32[$614 >> 2] = $$2$lcssa$i76; + break; + } + case 221: + { + $897 = HEAP32[$4 >> 2] | 0; + $898 = $897 + 4 | 0; + $899 = HEAP32[$898 >> 2] | 0; + if (!$899) { + if (!(FUNCTION_TABLE_ii[HEAP32[$897 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$0$i78 = HEAP32[$898 >> 2] | 0; + } else $$0$i78 = $899; + $$057$i = HEAP32[$897 >> 2] | 0; + $906 = $$0$i78 + -1 | 0; + $907 = $$057$i + 1 | 0; + $910 = HEAPU8[$$057$i >> 0] << 8; + if (!$906) { + if (!(FUNCTION_TABLE_ii[HEAP32[$897 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$1$i79 = HEAP32[$898 >> 2] | 0; + $$158$i = HEAP32[$897 >> 2] | 0; + } else { + $$1$i79 = $906; + $$158$i = $907; + } + $918 = $$1$i79 + -1 | 0; + $919 = $$158$i + 1 | 0; + if (($910 | HEAPU8[$$158$i >> 0] | 0) != 4) { + $924 = HEAP32[$0 >> 2] | 0; + HEAP32[$924 + 20 >> 2] = 12; + FUNCTION_TABLE_vi[HEAP32[$924 >> 2] & 255]($0); + } + if (!$918) { + if (!(FUNCTION_TABLE_ii[HEAP32[$897 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$2$i80 = HEAP32[$898 >> 2] | 0; + $$259$i = HEAP32[$897 >> 2] | 0; + } else { + $$2$i80 = $918; + $$259$i = $919; + } + $934 = $$2$i80 + -1 | 0; + $935 = $$259$i + 1 | 0; + $938 = HEAPU8[$$259$i >> 0] << 8; + if (!$934) { + if (!(FUNCTION_TABLE_ii[HEAP32[$897 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$3$i81 = HEAP32[$898 >> 2] | 0; + $$360$i = HEAP32[$897 >> 2] | 0; + } else { + $$3$i81 = $934; + $$360$i = $935; + } + $950 = $938 | HEAPU8[$$360$i >> 0]; + $951 = HEAP32[$0 >> 2] | 0; + HEAP32[$951 + 20 >> 2] = 84; + HEAP32[$951 + 24 >> 2] = $950; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 1); + HEAP32[$5 >> 2] = $950; + HEAP32[$897 >> 2] = $$360$i + 1; + HEAP32[$898 >> 2] = $$3$i81 + -1; + break; + } + case 248: + { + $957 = HEAP32[$4 >> 2] | 0; + $958 = HEAP32[$957 >> 2] | 0; + $959 = $957 + 4 | 0; + $960 = HEAP32[$959 >> 2] | 0; + if (!(HEAP32[(HEAP32[$3 >> 2] | 0) + 16 >> 2] | 0)) { + $965 = HEAP32[$0 >> 2] | 0; + HEAP32[$965 + 20 >> 2] = 60; + _strncpy($965 + 24 | 0, 50709, 80) | 0; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + do if ((HEAP32[$17 >> 2] | 0) >= 3) { + if (!$960) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$0$i82 = HEAP32[$959 >> 2] | 0; + $$0231$i = HEAP32[$957 >> 2] | 0; + } else { + $$0$i82 = $960; + $$0231$i = $958; + } + $979 = $$0$i82 + -1 | 0; + $980 = $$0231$i + 1 | 0; + $983 = HEAPU8[$$0231$i >> 0] << 8; + if (!$979) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$1$i83 = HEAP32[$959 >> 2] | 0; + $$1232$i = HEAP32[$957 >> 2] | 0; + } else { + $$1$i83 = $979; + $$1232$i = $980; + } + $991 = $$1$i83 + -1 | 0; + $992 = $$1232$i + 1 | 0; + if (($983 | HEAPU8[$$1232$i >> 0] | 0) != 24) { + $997 = HEAP32[$0 >> 2] | 0; + HEAP32[$997 + 20 >> 2] = 12; + FUNCTION_TABLE_vi[HEAP32[$997 >> 2] & 255]($0); + } + if (!$991) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$2$i84 = HEAP32[$959 >> 2] | 0; + $$2233$i = HEAP32[$957 >> 2] | 0; + } else { + $$2$i84 = $991; + $$2233$i = $992; + } + $1007 = $$2$i84 + -1 | 0; + $1008 = $$2233$i + 1 | 0; + if ((HEAP8[$$2233$i >> 0] | 0) != 13) { + $1011 = HEAP32[$0 >> 2] | 0; + HEAP32[$1011 + 20 >> 2] = 70; + HEAP32[$1011 + 24 >> 2] = HEAP32[$2 >> 2]; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + if (!$1007) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$3$i85 = HEAP32[$959 >> 2] | 0; + $$3234$i = HEAP32[$957 >> 2] | 0; + } else { + $$3$i85 = $1007; + $$3234$i = $1008; + } + $1024 = $$3$i85 + -1 | 0; + $1025 = $$3234$i + 1 | 0; + $1028 = HEAPU8[$$3234$i >> 0] << 8; + if (!$1024) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$4$i86 = HEAP32[$959 >> 2] | 0; + $$4235$i = HEAP32[$957 >> 2] | 0; + } else { + $$4$i86 = $1024; + $$4235$i = $1025; + } + $1036 = $$4$i86 + -1 | 0; + $1037 = $$4235$i + 1 | 0; + if (($1028 | HEAPU8[$$4235$i >> 0] | 0) == 255) { + if (!$1036) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$5$i87 = HEAP32[$959 >> 2] | 0; + $$5236$i = HEAP32[$957 >> 2] | 0; + } else { + $$5$i87 = $1036; + $$5236$i = $1037; + } + $1049 = $$5$i87 + -1 | 0; + $1050 = $$5236$i + 1 | 0; + if ((HEAP8[$$5236$i >> 0] | 0) == 3) { + if (!$1049) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$6$i88 = HEAP32[$959 >> 2] | 0; + $$6237$i = HEAP32[$957 >> 2] | 0; + } else { + $$6$i88 = $1049; + $$6237$i = $1050; + } + $1060 = $$6$i88 + -1 | 0; + $1061 = $$6237$i + 1 | 0; + $1064 = HEAP32[$18 >> 2] | 0; + if ((HEAP32[$1064 + 88 >> 2] | 0) == (HEAPU8[$$6237$i >> 0] | 0)) { + if (!$1060) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$7$i90 = HEAP32[$959 >> 2] | 0; + $$7238$i = HEAP32[$957 >> 2] | 0; + $1080 = HEAP32[$18 >> 2] | 0; + } else { + $$7$i90 = $1060; + $$7238$i = $1061; + $1080 = $1064; + } + $1075 = $$7$i90 + -1 | 0; + $1076 = $$7238$i + 1 | 0; + if ((HEAP32[$1080 >> 2] | 0) == (HEAPU8[$$7238$i >> 0] | 0)) { + if (!$1075) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$8$i91 = HEAP32[$959 >> 2] | 0; + $$8239$i = HEAP32[$957 >> 2] | 0; + $1094 = HEAP32[$18 >> 2] | 0; + } else { + $$8$i91 = $1075; + $$8239$i = $1076; + $1094 = $1080; + } + $1089 = $$8$i91 + -1 | 0; + $1090 = $$8239$i + 1 | 0; + if ((HEAP32[$1094 + 176 >> 2] | 0) != (HEAPU8[$$8239$i >> 0] | 0)) { + $$24$i = $1089; + $$24255$i = $1090; + label = 335; + break; + } + if (!$1089) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$9$i = HEAP32[$959 >> 2] | 0; + $$9240$i = HEAP32[$957 >> 2] | 0; + } else { + $$9$i = $1089; + $$9240$i = $1090; + } + $1104 = $$9$i + -1 | 0; + $1105 = $$9240$i + 1 | 0; + if ((HEAP8[$$9240$i >> 0] | 0) != -128) { + $$24$i = $1104; + $$24255$i = $1105; + label = 335; + break; + } + if (!$1104) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$10$i = HEAP32[$959 >> 2] | 0; + $$10241$i = HEAP32[$957 >> 2] | 0; + } else { + $$10$i = $1104; + $$10241$i = $1105; + } + $1115 = $$10$i + -1 | 0; + $1116 = $$10241$i + 1 | 0; + $1119 = HEAPU8[$$10241$i >> 0] << 8; + if (!$1115) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$11$i = HEAP32[$959 >> 2] | 0; + $$11242$i = HEAP32[$957 >> 2] | 0; + } else { + $$11$i = $1115; + $$11242$i = $1116; + } + $1127 = $$11$i + -1 | 0; + $1128 = $$11242$i + 1 | 0; + if ($1119 | HEAPU8[$$11242$i >> 0] | 0) { + $$24$i = $1127; + $$24255$i = $1128; + label = 335; + break; + } + if (!$1127) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$12$i = HEAP32[$959 >> 2] | 0; + $$12243$i = HEAP32[$957 >> 2] | 0; + } else { + $$12$i = $1127; + $$12243$i = $1128; + } + $1140 = $$12$i + -1 | 0; + $1141 = $$12243$i + 1 | 0; + $1144 = HEAPU8[$$12243$i >> 0] << 8; + if (!$1140) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$13$i = HEAP32[$959 >> 2] | 0; + $$13244$i = HEAP32[$957 >> 2] | 0; + } else { + $$13$i = $1140; + $$13244$i = $1141; + } + $1152 = $$13$i + -1 | 0; + $1153 = $$13244$i + 1 | 0; + if ($1144 | HEAPU8[$$13244$i >> 0] | 0) { + $$24$i = $1152; + $$24255$i = $1153; + label = 335; + break; + } + if (!$1152) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$14$i = HEAP32[$959 >> 2] | 0; + $$14245$i = HEAP32[$957 >> 2] | 0; + } else { + $$14$i = $1152; + $$14245$i = $1153; + } + $1165 = $$14$i + -1 | 0; + $1166 = $$14245$i + 1 | 0; + if (HEAP8[$$14245$i >> 0] | 0) { + $$24$i = $1165; + $$24255$i = $1166; + label = 335; + break; + } + if (!$1165) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$15$i = HEAP32[$959 >> 2] | 0; + $$15246$i = HEAP32[$957 >> 2] | 0; + } else { + $$15$i = $1165; + $$15246$i = $1166; + } + $1176 = $$15$i + -1 | 0; + $1177 = $$15246$i + 1 | 0; + $1180 = HEAPU8[$$15246$i >> 0] << 8; + if (!$1176) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$16$i = HEAP32[$959 >> 2] | 0; + $$16247$i = HEAP32[$957 >> 2] | 0; + } else { + $$16$i = $1176; + $$16247$i = $1177; + } + $1188 = $$16$i + -1 | 0; + $1189 = $$16247$i + 1 | 0; + if (($1180 | HEAPU8[$$16247$i >> 0] | 0) != 1) { + $$24$i = $1188; + $$24255$i = $1189; + label = 335; + break; + } + if (!$1188) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$17$i = HEAP32[$959 >> 2] | 0; + $$17248$i = HEAP32[$957 >> 2] | 0; + } else { + $$17$i = $1188; + $$17248$i = $1189; + } + $1201 = $$17$i + -1 | 0; + $1202 = $$17248$i + 1 | 0; + $1205 = HEAPU8[$$17248$i >> 0] << 8; + if (!$1201) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$18$i = HEAP32[$959 >> 2] | 0; + $$18249$i = HEAP32[$957 >> 2] | 0; + } else { + $$18$i = $1201; + $$18249$i = $1202; + } + $1213 = $$18$i + -1 | 0; + $1214 = $$18249$i + 1 | 0; + if ($1205 | HEAPU8[$$18249$i >> 0] | 0) { + $$24$i = $1213; + $$24255$i = $1214; + label = 335; + break; + } + if (!$1213) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$19$i = HEAP32[$959 >> 2] | 0; + $$19250$i = HEAP32[$957 >> 2] | 0; + } else { + $$19$i = $1213; + $$19250$i = $1214; + } + $1226 = $$19$i + -1 | 0; + $1227 = $$19250$i + 1 | 0; + if (HEAP8[$$19250$i >> 0] | 0) { + $$24$i = $1226; + $$24255$i = $1227; + label = 335; + break; + } + if (!$1226) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$20$i = HEAP32[$959 >> 2] | 0; + $$20251$i = HEAP32[$957 >> 2] | 0; + } else { + $$20$i = $1226; + $$20251$i = $1227; + } + $1237 = $$20$i + -1 | 0; + $1238 = $$20251$i + 1 | 0; + $1241 = HEAPU8[$$20251$i >> 0] << 8; + if (!$1237) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$21$i = HEAP32[$959 >> 2] | 0; + $$21252$i = HEAP32[$957 >> 2] | 0; + } else { + $$21$i = $1237; + $$21252$i = $1238; + } + $1249 = $$21$i + -1 | 0; + $1250 = $$21252$i + 1 | 0; + if (($1241 | HEAPU8[$$21252$i >> 0] | 0) != 1) { + $$24$i = $1249; + $$24255$i = $1250; + label = 335; + break; + } + if (!$1249) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$22$i = HEAP32[$959 >> 2] | 0; + $$22253$i = HEAP32[$957 >> 2] | 0; + } else { + $$22$i = $1249; + $$22253$i = $1250; + } + $1262 = $$22$i + -1 | 0; + $1263 = $$22253$i + 1 | 0; + $1266 = HEAPU8[$$22253$i >> 0] << 8; + if (!$1262) { + if (!(FUNCTION_TABLE_ii[HEAP32[$957 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$23$i = HEAP32[$959 >> 2] | 0; + $$23254$i = HEAP32[$957 >> 2] | 0; + } else { + $$23$i = $1262; + $$23254$i = $1263; + } + $1274 = $$23$i + -1 | 0; + $1275 = $$23254$i + 1 | 0; + if (!($1266 | HEAPU8[$$23254$i >> 0])) { + $$25$i = $1274; + $$25256$i = $1275; + } else { + $$24$i = $1274; + $$24255$i = $1275; + label = 335; + } + } else { + $$24$i = $1075; + $$24255$i = $1076; + label = 335; + } + } else { + $$24$i = $1060; + $$24255$i = $1061; + label = 335; + } + } else { + $$24$i = $1049; + $$24255$i = $1050; + label = 335; + } + } else { + $$24$i = $1036; + $$24255$i = $1037; + label = 335; + } + } else { + $$24$i = $960; + $$24255$i = $958; + label = 335; + } while (0); + if ((label | 0) == 335) { + label = 0; + $1280 = HEAP32[$0 >> 2] | 0; + HEAP32[$1280 + 20 >> 2] = 28; + FUNCTION_TABLE_vi[HEAP32[$1280 >> 2] & 255]($0); + $$25$i = $$24$i; + $$25256$i = $$24255$i; + } + HEAP32[$7 >> 2] = 1; + HEAP32[$957 >> 2] = $$25256$i; + HEAP32[$959 >> 2] = $$25$i; + break; + } + case 239: + case 238: + case 237: + case 236: + case 235: + case 234: + case 233: + case 232: + case 231: + case 230: + case 229: + case 228: + case 227: + case 226: + case 225: + case 224: + { + if (!(FUNCTION_TABLE_ii[HEAP32[(HEAP32[$3 >> 2] | 0) + 32 + ($60 + -224 << 2) >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + break; + } + case 254: + { + if (!(FUNCTION_TABLE_ii[HEAP32[(HEAP32[$3 >> 2] | 0) + 28 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + break; + } + case 1: + case 215: + case 214: + case 213: + case 212: + case 211: + case 210: + case 209: + case 208: + { + $1294 = HEAP32[$0 >> 2] | 0; + HEAP32[$1294 + 20 >> 2] = 94; + HEAP32[$1294 + 24 >> 2] = $60; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 1); + break; + } + case 220: + { + $1300 = HEAP32[$4 >> 2] | 0; + $1301 = $1300 + 4 | 0; + $1302 = HEAP32[$1301 >> 2] | 0; + if (!$1302) { + if (!(FUNCTION_TABLE_ii[HEAP32[$1300 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$0$i92 = HEAP32[$1301 >> 2] | 0; + } else $$0$i92 = $1302; + $$041$i = HEAP32[$1300 >> 2] | 0; + $1309 = $$0$i92 + -1 | 0; + $1310 = $$041$i + 1 | 0; + $1313 = HEAPU8[$$041$i >> 0] << 8; + if (!$1309) { + if (!(FUNCTION_TABLE_ii[HEAP32[$1300 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break L1; + } + $$1$i93 = HEAP32[$1301 >> 2] | 0; + $$142$i = HEAP32[$1300 >> 2] | 0; + } else { + $$1$i93 = $1309; + $$142$i = $1310; + } + $1325 = $1313 | HEAPU8[$$142$i >> 0]; + $1326 = $1325 + -2 | 0; + $1327 = HEAP32[$0 >> 2] | 0; + HEAP32[$1327 + 20 >> 2] = 93; + HEAP32[$1327 + 24 >> 2] = HEAP32[$2 >> 2]; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = $1326; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 1); + HEAP32[$1300 >> 2] = $$142$i + 1; + HEAP32[$1301 >> 2] = $$1$i93 + -1; + if ($1325 >>> 0 > 2) FUNCTION_TABLE_vii[HEAP32[(HEAP32[$4 >> 2] | 0) + 16 >> 2] & 255]($0, $1326); + break; + } + default: + { + $1340 = HEAP32[$0 >> 2] | 0; + HEAP32[$1340 + 20 >> 2] = 70; + HEAP32[$1340 + 24 >> 2] = $60; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + } while (0); + HEAP32[$2 >> 2] = 0; + $20 = 0; + } + if ((label | 0) == 25) { + $87 = HEAP32[$4 >> 2] | 0; + $88 = HEAP32[$87 >> 2] | 0; + $89 = $87 + 4 | 0; + $90 = HEAP32[$89 >> 2] | 0; + if (!(HEAP32[(HEAP32[$3 >> 2] | 0) + 16 >> 2] | 0)) { + $95 = HEAP32[$0 >> 2] | 0; + HEAP32[$95 + 20 >> 2] = 60; + _strncpy($95 + 24 | 0, 50705, 80) | 0; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + do if (!$90) if (!(FUNCTION_TABLE_ii[HEAP32[$87 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + STACKTOP = sp; + return $$0 | 0; + } else { + $$0176$i = HEAP32[$89 >> 2] | 0; + $$0177$i = HEAP32[$87 >> 2] | 0; + break; + } else { + $$0176$i = $90; + $$0177$i = $88; + } while (0); + $107 = $$0176$i + -1 | 0; + $108 = $$0177$i + 1 | 0; + $111 = HEAPU8[$$0177$i >> 0] << 8; + do if (!$107) if (!(FUNCTION_TABLE_ii[HEAP32[$87 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + STACKTOP = sp; + return $$0 | 0; + } else { + $$1$i43 = HEAP32[$89 >> 2] | 0; + $$1178$i = HEAP32[$87 >> 2] | 0; + break; + } else { + $$1$i43 = $107; + $$1178$i = $108; + } while (0); + $119 = $$1$i43 + -1 | 0; + $120 = $$1178$i + 1 | 0; + $123 = $111 | HEAPU8[$$1178$i >> 0]; + do if (!$119) if (!(FUNCTION_TABLE_ii[HEAP32[$87 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + STACKTOP = sp; + return $$0 | 0; + } else { + $$2$i = HEAP32[$89 >> 2] | 0; + $$2179$i = HEAP32[$87 >> 2] | 0; + break; + } else { + $$2$i = $119; + $$2179$i = $120; + } while (0); + $131 = HEAP8[$$2179$i >> 0] | 0; + $132 = $131 & 255; + $133 = HEAP32[$0 >> 2] | 0; + HEAP32[$133 + 20 >> 2] = 105; + HEAP32[$133 + 24 >> 2] = $132; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 1); + do if (!(($131 & 255) > 4 | ($123 | 0) != (($132 << 1) + 6 | 0))) { + if ($131 << 24 >> 24) { + HEAP32[$0 + 340 >> 2] = $132; + $$3211233$i = $$2$i + -1 | 0; + $$3180212236$i = $$2179$i + 1 | 0; + $$3211235$i = $$3211233$i; + $1345 = ($$3211233$i | 0) == 0; + label = 42; + break; + } + if (HEAP32[$0 + 224 >> 2] | 0) { + HEAP32[$0 + 340 >> 2] = $132; + $$3211230$i = $$2$i + -1 | 0; + if (!$$3211230$i) { + $1346 = 1; + label = 64; + } else { + $$6$i = $$3211230$i; + $$6183$i = $$2179$i + 1 | 0; + $1347 = 1; + } + } else label = 41; + } else label = 41; while (0); + if ((label | 0) == 41) { + $151 = HEAP32[$0 >> 2] | 0; + HEAP32[$151 + 20 >> 2] = 12; + FUNCTION_TABLE_vi[HEAP32[$151 >> 2] & 255]($0); + HEAP32[$0 + 340 >> 2] = $132; + $$3211$i = $$2$i + -1 | 0; + $$3180212$i = $$2179$i + 1 | 0; + $156 = ($$3211$i | 0) == 0; + if (!($131 << 24 >> 24)) { + $$3$lcssa$i = $$3211$i; + $$3180$lcssa$i = $$3180212$i; + $$lcssa$i = $156; + $1348 = 1; + label = 63; + } else { + $$3180212236$i = $$3180212$i; + $$3211235$i = $$3211$i; + $1345 = $156; + label = 42; + } + } + L436 : do if ((label | 0) == 42) { + $157 = $87 + 12 | 0; + $158 = $0 + 344 | 0; + $$0193213$i = 0; + $$3180218$i = $$3180212236$i; + $$3217$i = $$3211235$i; + $1349 = $1345; + while (1) { + if ($1349) { + if (!(FUNCTION_TABLE_ii[HEAP32[$157 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break; + } + $$4$i = HEAP32[$89 >> 2] | 0; + $$4181$i = HEAP32[$87 >> 2] | 0; + } else { + $$4$i = $$3217$i; + $$4181$i = $$3180218$i; + } + $164 = $$4$i + -1 | 0; + $165 = $$4181$i + 1 | 0; + $167 = HEAPU8[$$4181$i >> 0] | 0; + L444 : do if (!$$0193213$i) $$2188$i = $167; else { + $$0190201$i = 0; + while (1) { + if ((HEAP32[HEAP32[$0 + 344 + ($$0190201$i << 2) >> 2] >> 2] | 0) == ($167 | 0)) break; + $$0190201$i = $$0190201$i + 1 | 0; + if ($$0190201$i >>> 0 >= $$0193213$i >>> 0) { + $$2188$i = $167; + break L444; + } + } + $176 = HEAP32[HEAP32[$158 >> 2] >> 2] | 0; + if ($$0193213$i >>> 0 > 1) { + $$0186203$i = $176; + $$1191202$i = 1; + while (1) { + $180 = HEAP32[HEAP32[$0 + 344 + ($$1191202$i << 2) >> 2] >> 2] | 0; + $spec$select$i = ($180 | 0) > ($$0186203$i | 0) ? $180 : $$0186203$i; + $$1191202$i = $$1191202$i + 1 | 0; + if (($$1191202$i | 0) == ($$0193213$i | 0)) { + $$0186$lcssa$i = $spec$select$i; + break; + } else $$0186203$i = $spec$select$i; + } + } else $$0186$lcssa$i = $176; + $$2188$i = $$0186$lcssa$i + 1 | 0; + } while (0); + $184 = HEAP32[$18 >> 2] | 0; + $185 = HEAP32[$17 >> 2] | 0; + L456 : do if (($185 | 0) > 0) { + $$0189206$i = $184; + $$2192205$i = 0; + while (1) { + if (($$2188$i | 0) == (HEAP32[$$0189206$i >> 2] | 0)) { + $$0189197$i = $$0189206$i; + break L456; + } + $$2192205$i = $$2192205$i + 1 | 0; + $190 = $$0189206$i + 88 | 0; + if (($$2192205$i | 0) >= ($185 | 0)) { + $$0189$lcssa$i = $190; + label = 58; + break; + } else $$0189206$i = $190; + } + } else { + $$0189$lcssa$i = $184; + label = 58; + } while (0); + if ((label | 0) == 58) { + label = 0; + $192 = HEAP32[$0 >> 2] | 0; + HEAP32[$192 + 20 >> 2] = 4; + HEAP32[$192 + 24 >> 2] = $$2188$i; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + $$0189197$i = $$0189$lcssa$i; + } + HEAP32[$0 + 344 + ($$0193213$i << 2) >> 2] = $$0189197$i; + if (!$164) { + if (!(FUNCTION_TABLE_ii[HEAP32[$157 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 350; + break; + } + $$5$i = HEAP32[$89 >> 2] | 0; + $$5182$i = HEAP32[$87 >> 2] | 0; + } else { + $$5$i = $164; + $$5182$i = $165; + } + $205 = HEAPU8[$$5182$i >> 0] | 0; + $207 = $$0189197$i + 20 | 0; + HEAP32[$207 >> 2] = $205 >>> 4; + $209 = $$0189197$i + 24 | 0; + HEAP32[$209 >> 2] = $205 & 15; + $210 = HEAP32[$0 >> 2] | 0; + HEAP32[$210 + 24 >> 2] = HEAP32[$$0189197$i >> 2]; + HEAP32[$210 + 28 >> 2] = HEAP32[$207 >> 2]; + HEAP32[$210 + 32 >> 2] = HEAP32[$209 >> 2]; + HEAP32[$210 + 20 >> 2] = 106; + FUNCTION_TABLE_vii[HEAP32[$210 + 4 >> 2] & 255]($0, 1); + $$0193213$i = $$0193213$i + 1 | 0; + $$3$i = $$5$i + -1 | 0; + $$3180$i = $$5182$i + 1 | 0; + $222 = ($$3$i | 0) == 0; + if ($$0193213$i >>> 0 >= $132 >>> 0) { + $$3$lcssa$i = $$3$i; + $$3180$lcssa$i = $$3180$i; + $$lcssa$i = $222; + $1348 = 0; + label = 63; + break L436; + } else { + $$3180218$i = $$3180$i; + $$3217$i = $$3$i; + $1349 = $222; + } + } + if ((label | 0) == 350) { + STACKTOP = sp; + return $$0 | 0; + } + } while (0); + if ((label | 0) == 63) if ($$lcssa$i) { + $1346 = $1348; + label = 64; + } else { + $$6$i = $$3$lcssa$i; + $$6183$i = $$3180$lcssa$i; + $1347 = $1348; + } + do if ((label | 0) == 64) if (!(FUNCTION_TABLE_ii[HEAP32[$87 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + STACKTOP = sp; + return $$0 | 0; + } else { + $$6$i = HEAP32[$89 >> 2] | 0; + $$6183$i = HEAP32[$87 >> 2] | 0; + $1347 = $1346; + break; + } while (0); + $229 = $$6$i + -1 | 0; + $230 = $$6183$i + 1 | 0; + $233 = $0 + 412 | 0; + HEAP32[$233 >> 2] = HEAPU8[$$6183$i >> 0]; + do if (!$229) if (!(FUNCTION_TABLE_ii[HEAP32[$87 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + STACKTOP = sp; + return $$0 | 0; + } else { + $$7$i = HEAP32[$89 >> 2] | 0; + $$7184$i = HEAP32[$87 >> 2] | 0; + break; + } else { + $$7$i = $229; + $$7184$i = $230; + } while (0); + $241 = $$7$i + -1 | 0; + $242 = $$7184$i + 1 | 0; + $245 = $0 + 416 | 0; + HEAP32[$245 >> 2] = HEAPU8[$$7184$i >> 0]; + do if (!$241) if (!(FUNCTION_TABLE_ii[HEAP32[$87 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + STACKTOP = sp; + return $$0 | 0; + } else { + $$8$i = HEAP32[$89 >> 2] | 0; + $$8185$i = HEAP32[$87 >> 2] | 0; + break; + } else { + $$8$i = $241; + $$8185$i = $242; + } while (0); + $256 = HEAPU8[$$8185$i >> 0] | 0; + $258 = $0 + 420 | 0; + HEAP32[$258 >> 2] = $256 >>> 4; + $260 = $0 + 424 | 0; + HEAP32[$260 >> 2] = $256 & 15; + $261 = HEAP32[$0 >> 2] | 0; + HEAP32[$261 + 24 >> 2] = HEAP32[$233 >> 2]; + HEAP32[$261 + 28 >> 2] = HEAP32[$245 >> 2]; + HEAP32[$261 + 32 >> 2] = HEAP32[$258 >> 2]; + HEAP32[$261 + 36 >> 2] = HEAP32[$260 >> 2]; + HEAP32[$261 + 20 >> 2] = 107; + FUNCTION_TABLE_vii[HEAP32[$261 + 4 >> 2] & 255]($0, 1); + HEAP32[(HEAP32[$3 >> 2] | 0) + 20 >> 2] = 0; + if (!$1347) { + $275 = $0 + 144 | 0; + HEAP32[$275 >> 2] = (HEAP32[$275 >> 2] | 0) + 1; + } + HEAP32[$87 >> 2] = $$8185$i + 1; + HEAP32[$89 >> 2] = $$8$i + -1; + HEAP32[$2 >> 2] = 0; + $$0 = 1; + STACKTOP = sp; + return $$0 | 0; + } else if ((label | 0) == 75) { + $278 = HEAP32[$0 >> 2] | 0; + HEAP32[$278 + 20 >> 2] = 87; + FUNCTION_TABLE_vii[HEAP32[$278 + 4 >> 2] & 255]($0, 1); + HEAP32[$2 >> 2] = 0; + $$0 = 2; + STACKTOP = sp; + return $$0 | 0; + } else if ((label | 0) == 174) { + $$0 = 0; + STACKTOP = sp; + return $$0 | 0; + } else if ((label | 0) == 350) { + STACKTOP = sp; + return $$0 | 0; + } + return 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$10 = 0, $$11 = 0, $$12 = 0, $$13 = 0, $$14 = 0, $$15 = 0, $$16 = 0, $$17 = 0, $$2 = 0, $$21 = 0, $$22 = 0, $$23 = 0, $$24 = 0, $$25 = 0, $$26 = 0, $$27 = 0, $$28 = 0, $$29 = 0, $$3 = 0, $$30 = 0, $$31 = 0, $$32 = 0, $$33 = 0, $$34 = 0, $$35 = 0, $$36 = 0, $$37 = 0, $$42 = 0, $$43 = 0, $$47 = 0, $$48 = 0, $$49 = 0, $$7 = 0, $$8 = 0, $$9 = 0, $$byval_copy39 = 0, $1 = 0, $10 = 0, $101 = 0, $102 = 0, $104 = 0, $105 = 0, $107 = 0, $11 = 0, $111 = 0, $114 = 0, $12 = 0, $123 = 0, $127 = 0, $128 = 0, $13 = 0, $130 = 0, $134 = 0, $138 = 0, $14 = 0, $144 = 0, $145 = 0, $147 = 0, $15 = 0, $151 = 0, $152 = 0, $154 = 0, $158 = 0, $16 = 0, $161 = 0, $167 = 0, $17 = 0, $170 = 0, $173 = 0, $179 = 0, $18 = 0, $182 = 0, $188 = 0, $189 = 0, $19 = 0, $191 = 0, $195 = 0, $196 = 0, $199 = 0, $2 = 0, $20 = 0, $206 = 0, $209 = 0, $21 = 0, $212 = 0, $215 = 0, $22 = 0, $221 = 0, $224 = 0, $227 = 0, $23 = 0, $230 = 0, $234 = 0, $237 = 0, $24 = 0, $246 = 0, $249 = 0, $25 = 0, $252 = 0, $256 = 0, $26 = 0, $265 = 0, $268 = 0, $27 = 0, $271 = 0, $277 = 0, $28 = 0, $280 = 0, $283 = 0, $287 = 0, $29 = 0, $290 = 0, $294 = 0, $297 = 0, $298 = 0, $3 = 0, $30 = 0, $300 = 0, $307 = 0, $308 = 0, $31 = 0, $310 = 0, $312 = 0, $319 = 0, $32 = 0, $320 = 0, $322 = 0, $326 = 0, $329 = 0, $33 = 0, $332 = 0, $335 = 0, $34 = 0, $341 = 0, $342 = 0, $344 = 0, $349 = 0, $35 = 0, $356 = 0, $36 = 0, $361 = 0, $367 = 0, $37 = 0, $371 = 0, $375 = 0, $376 = 0, $379 = 0, $38 = 0, $381 = 0, $388 = 0, $39 = 0, $393 = 0, $397 = 0, $398 = 0, $4 = 0, $40 = 0, $400 = 0, $401 = 0, $403 = 0, $41 = 0, $410 = 0, $42 = 0, $43 = 0, $45 = 0, $48 = 0, $5 = 0, $6 = 0, $66 = 0, $69 = 0, $7 = 0, $72 = 0, $75 = 0, $78 = 0, $8 = 0, $82 = 0, $87 = 0, $9 = 0, $94 = 0, $95 = 0, $97 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 352 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(352); + $$byval_copy39 = sp + 336 | 0; + $1 = sp + 344 | 0; + $2 = sp + 328 | 0; + $3 = sp + 320 | 0; + $4 = sp + 312 | 0; + $5 = sp + 304 | 0; + $6 = sp + 296 | 0; + $7 = sp + 288 | 0; + $8 = sp + 8 | 0; + $9 = sp + 280 | 0; + $10 = sp + 272 | 0; + $11 = sp + 264 | 0; + $12 = sp + 256 | 0; + $13 = sp + 248 | 0; + $14 = sp + 240 | 0; + $15 = sp + 232 | 0; + $16 = sp + 224 | 0; + $17 = sp + 216 | 0; + $18 = sp + 208 | 0; + $19 = sp + 200 | 0; + $20 = sp + 192 | 0; + $21 = sp + 184 | 0; + $22 = sp + 176 | 0; + $23 = sp + 168 | 0; + $24 = sp + 160 | 0; + $25 = sp + 152 | 0; + $26 = sp + 144 | 0; + $27 = sp + 136 | 0; + $28 = sp + 128 | 0; + $29 = sp + 120 | 0; + $30 = sp + 112 | 0; + $31 = sp + 104 | 0; + $32 = sp + 96 | 0; + $33 = sp + 88 | 0; + $34 = sp + 80 | 0; + $35 = sp + 72 | 0; + $36 = sp + 64 | 0; + $37 = sp + 56 | 0; + $38 = sp + 48 | 0; + $39 = sp; + $40 = sp + 40 | 0; + $41 = sp + 32 | 0; + $42 = sp + 24 | 0; + $43 = sp + 16 | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 52665); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + $45 = (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy39) | 0) & 1; + HEAP8[$1 >> 0] = $45; + L1 : do if ((__ZNK12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E7numLeftEv($0) | 0) >>> 0 < 2) $$49 = 0; else { + $48 = HEAP32[$0 >> 2] | 0; + do switch (HEAP8[$48 >> 0] | 0) { + case 76: + { + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E16parseExprPrimaryEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + break L1; + break; + } + case 84: + { + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E18parseTemplateParamEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + break L1; + break; + } + case 102: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24) { + case 112: + { + label = 7; + break; + } + case 76: + { + if ((((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 2) | 0) << 24 >> 24) + -48 | 0) >>> 0 < 10) label = 7; else label = 8; + break; + } + default: + label = 8; + } + if ((label | 0) == 7) { + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E18parseFunctionParamEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + break L1; + } else if ((label | 0) == 8) { + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseFoldExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + break L1; + } + break; + } + case 97: + { + switch (HEAP8[$48 + 1 >> 0] | 0) { + case 97: + { + HEAP32[$0 >> 2] = $48 + 2; + $66 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 51972); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($66, $$byval_copy39) | 0; + break L1; + break; + } + case 100: + { + HEAP32[$0 >> 2] = $48 + 2; + $69 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 51970); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parsePrefixExprENS_10StringViewE($69, $$byval_copy39) | 0; + break L1; + break; + } + case 110: + { + HEAP32[$0 >> 2] = $48 + 2; + $72 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 51970); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($72, $$byval_copy39) | 0; + break L1; + break; + } + case 78: + { + HEAP32[$0 >> 2] = $48 + 2; + $75 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($6, 52668); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($75, $$byval_copy39) | 0; + break L1; + break; + } + case 83: + { + HEAP32[$0 >> 2] = $48 + 2; + $78 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($7, 52671); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$7 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($78, $$byval_copy39) | 0; + break L1; + break; + } + case 116: + { + HEAP32[$0 >> 2] = $48 + 2; + $82 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $82; + if (!$82) $$0 = 0; else $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13EnclosingExprEJRA10_KcRPNS0_4NodeERA2_S8_EEESC_DpOT0_($0, 52673, $$byval_copy39) | 0; + $$49 = $$0; + break L1; + break; + } + case 122: + { + HEAP32[$0 >> 2] = $48 + 2; + $87 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $87; + if (!$87) $$1 = 0; else $$1 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13EnclosingExprEJRA10_KcRPNS0_4NodeERA2_S8_EEESC_DpOT0_($0, 52673, $$byval_copy39) | 0; + $$49 = $$1; + break L1; + break; + } + default: + { + $$49 = 0; + break L1; + } + } + break; + } + case 99: + { + switch (HEAP8[$48 + 1 >> 0] | 0) { + case 99: + { + HEAP32[$0 >> 2] = $48 + 2; + $94 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $95 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($94) | 0; + HEAP32[$$byval_copy39 >> 2] = $95; + if (!$95) $$3 = 0; else { + $97 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($94) | 0; + HEAP32[$8 >> 2] = $97; + if (!$97) $$2 = 0; else $$2 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8CastExprEJRA11_KcRPNS0_4NodeESD_EEESC_DpOT0_($0, $$byval_copy39, $8) | 0; + $$3 = $$2; + } + $$49 = $$3; + break L1; + break; + } + case 108: + { + HEAP32[$0 >> 2] = $48 + 2; + $101 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $102 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($101) | 0; + HEAP32[$$byval_copy39 >> 2] = $102; + do if ($102) { + $104 = $0 + 8 | 0; + $105 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($104) | 0; + while (1) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) { + label = 33; + break; + } + $107 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($101) | 0; + HEAP32[$8 >> 2] = $107; + if (!$107) { + label = 31; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($104, $8); + } + if ((label | 0) == 31) { + $$7 = 0; + break; + } else if ((label | 0) == 33) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20popTrailingNodeArrayEm($8, $0, $105); + $$7 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8CallExprEJRPNS0_4NodeENS0_9NodeArrayEEEES9_DpOT0_($0, $$byval_copy39, $8) | 0; + break; + } + } else $$7 = 0; while (0); + $$49 = $$7; + break L1; + break; + } + case 109: + { + HEAP32[$0 >> 2] = $48 + 2; + $111 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($9, 52683); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$9 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($111, $$byval_copy39) | 0; + break L1; + break; + } + case 111: + { + HEAP32[$0 >> 2] = $48 + 2; + $114 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($10, 52685); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$10 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$10 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parsePrefixExprENS_10StringViewE($114, $$byval_copy39) | 0; + break L1; + break; + } + case 118: + { + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseConversionExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + break L1; + break; + } + default: + { + $$49 = 0; + break L1; + } + } + break; + } + case 100: + { + switch (HEAP8[$48 + 1 >> 0] | 0) { + case 97: + { + HEAP32[$0 >> 2] = $48 + 2; + $123 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $123; + if (!$123) $$8 = 0; else { + HEAP8[$8 >> 0] = 1; + $$8 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10DeleteExprEJRPNS0_4NodeERbbEEES9_DpOT0_($0, $$byval_copy39, $1, $8) | 0; + } + $$49 = $$8; + break L1; + break; + } + case 99: + { + HEAP32[$0 >> 2] = $48 + 2; + $127 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $128 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($127) | 0; + HEAP32[$$byval_copy39 >> 2] = $128; + if (!$128) $$10 = 0; else { + $130 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($127) | 0; + HEAP32[$8 >> 2] = $130; + if (!$130) $$9 = 0; else $$9 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8CastExprEJRA13_KcRPNS0_4NodeESD_EEESC_DpOT0_($0, $$byval_copy39, $8) | 0; + $$10 = $$9; + } + $$49 = $$10; + break L1; + break; + } + case 101: + { + HEAP32[$0 >> 2] = $48 + 2; + $134 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($11, 52037); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parsePrefixExprENS_10StringViewE($134, $$byval_copy39) | 0; + break L1; + break; + } + case 108: + { + HEAP32[$0 >> 2] = $48 + 2; + $138 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $138; + if (!$138) $$11 = 0; else { + HEAP8[$8 >> 0] = 0; + $$11 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10DeleteExprEJRPNS0_4NodeERbbEEES9_DpOT0_($0, $$byval_copy39, $1, $8) | 0; + } + $$49 = $$11; + break L1; + break; + } + case 110: + { + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseUnresolvedNameEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + break L1; + break; + } + case 115: + { + HEAP32[$0 >> 2] = $48 + 2; + $144 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $145 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($144) | 0; + HEAP32[$$byval_copy39 >> 2] = $145; + if (!$145) $$13 = 0; else { + $147 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($144) | 0; + HEAP32[$8 >> 2] = $147; + if (!$147) $$12 = 0; else $$12 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10MemberExprEJRPNS0_4NodeERA3_KcSA_EEES9_DpOT0_($0, $$byval_copy39, 52687, $8) | 0; + $$13 = $$12; + } + $$49 = $$13; + break L1; + break; + } + case 116: + { + HEAP32[$0 >> 2] = $48 + 2; + $151 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $152 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($151) | 0; + HEAP32[$$byval_copy39 >> 2] = $152; + if (!$152) $$15 = 0; else { + $154 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($151) | 0; + HEAP32[$8 >> 2] = $154; + if (!$154) $$14 = 0; else $$14 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10MemberExprEJRPNS0_4NodeERA2_KcSA_EEES9_DpOT0_($0, $$byval_copy39, $8) | 0; + $$15 = $$14; + } + $$49 = $$15; + break L1; + break; + } + case 118: + { + HEAP32[$0 >> 2] = $48 + 2; + $158 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($12, 52690); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$12 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$12 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($158, $$byval_copy39) | 0; + break L1; + break; + } + case 86: + { + HEAP32[$0 >> 2] = $48 + 2; + $161 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($13, 52692); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$13 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$13 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($161, $$byval_copy39) | 0; + break L1; + break; + } + default: + { + $$49 = 0; + break L1; + } + } + break; + } + case 101: + { + switch (HEAP8[$48 + 1 >> 0] | 0) { + case 111: + { + HEAP32[$0 >> 2] = $48 + 2; + $167 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($14, 52695); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$14 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$14 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($167, $$byval_copy39) | 0; + break L1; + break; + } + case 79: + { + HEAP32[$0 >> 2] = $48 + 2; + $170 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($15, 52697); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$15 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$15 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($170, $$byval_copy39) | 0; + break L1; + break; + } + case 113: + { + HEAP32[$0 >> 2] = $48 + 2; + $173 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($16, 52700); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$16 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$16 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($173, $$byval_copy39) | 0; + break L1; + break; + } + default: + { + $$49 = 0; + break L1; + } + } + break; + } + case 103: + { + switch (HEAP8[$48 + 1 >> 0] | 0) { + case 101: + { + HEAP32[$0 >> 2] = $48 + 2; + $179 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($17, 52703); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$17 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$17 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($179, $$byval_copy39) | 0; + break L1; + break; + } + case 116: + { + HEAP32[$0 >> 2] = $48 + 2; + $182 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($18, 52043); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$18 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$18 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($182, $$byval_copy39) | 0; + break L1; + break; + } + default: + { + $$49 = 0; + break L1; + } + } + break; + } + case 105: + { + switch (HEAP8[$48 + 1 >> 0] | 0) { + case 120: + { + HEAP32[$0 >> 2] = $48 + 2; + $188 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $189 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($188) | 0; + HEAP32[$$byval_copy39 >> 2] = $189; + if (!$189) $$17 = 0; else { + $191 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($188) | 0; + HEAP32[$8 >> 2] = $191; + if (!$191) $$16 = 0; else $$16 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_18ArraySubscriptExprEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $$byval_copy39, $8) | 0; + $$17 = $$16; + } + $$49 = $$17; + break L1; + break; + } + case 108: + break; + default: + { + $$49 = 0; + break L1; + } + } + HEAP32[$0 >> 2] = $48 + 2; + $195 = $0 + 8 | 0; + $196 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($195) | 0; + while (1) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) { + label = 82; + break; + } + $199 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBracedExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $199; + if (!$199) { + label = 81; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($195, $$byval_copy39); + } + if ((label | 0) == 81) { + $$49 = 0; + break L1; + } else if ((label | 0) == 82) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20popTrailingNodeArrayEm($8, $0, $196); + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_12InitListExprEJDnNS0_9NodeArrayEEEEPNS0_4NodeEDpOT0_($0, $$byval_copy39, $8) | 0; + break L1; + } + break; + } + case 108: + { + switch (HEAP8[$48 + 1 >> 0] | 0) { + case 101: + { + HEAP32[$0 >> 2] = $48 + 2; + $206 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($19, 52706); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$19 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$19 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($206, $$byval_copy39) | 0; + break L1; + break; + } + case 115: + { + HEAP32[$0 >> 2] = $48 + 2; + $209 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($20, 52709); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$20 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($209, $$byval_copy39) | 0; + break L1; + break; + } + case 83: + { + HEAP32[$0 >> 2] = $48 + 2; + $212 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($21, 52712); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$21 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$21 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($212, $$byval_copy39) | 0; + break L1; + break; + } + case 116: + { + HEAP32[$0 >> 2] = $48 + 2; + $215 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($22, 52150); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$22 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$22 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($215, $$byval_copy39) | 0; + break L1; + break; + } + default: + { + $$49 = 0; + break L1; + } + } + break; + } + case 109: + { + switch (HEAP8[$48 + 1 >> 0] | 0) { + case 105: + { + HEAP32[$0 >> 2] = $48 + 2; + $221 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($23, 52555); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$23 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$23 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($221, $$byval_copy39) | 0; + break L1; + break; + } + case 73: + { + HEAP32[$0 >> 2] = $48 + 2; + $224 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($24, 52716); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$24 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$24 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($224, $$byval_copy39) | 0; + break L1; + break; + } + case 108: + { + HEAP32[$0 >> 2] = $48 + 2; + $227 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($25, 52037); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$25 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$25 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($227, $$byval_copy39) | 0; + break L1; + break; + } + case 76: + { + HEAP32[$0 >> 2] = $48 + 2; + $230 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($26, 52719); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$26 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$26 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($230, $$byval_copy39) | 0; + break L1; + break; + } + case 109: + { + HEAP32[$0 >> 2] = $48 + 2; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) { + $234 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($27, 52722); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$27 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$27 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parsePrefixExprENS_10StringViewE($234, $$byval_copy39) | 0; + break L1; + } + $237 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $237; + if (!$237) $$21 = 0; else $$21 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11PostfixExprEJRPNS0_4NodeERA3_KcEEES9_DpOT0_($0, $$byval_copy39, 52722) | 0; + $$49 = $$21; + break L1; + break; + } + default: + { + $$49 = 0; + break L1; + } + } + break; + } + case 110: + { + switch (HEAP8[$48 + 1 >> 0] | 0) { + case 119: + case 97: + { + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E12parseNewExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + break L1; + break; + } + case 101: + { + HEAP32[$0 >> 2] = $48 + 2; + $246 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($28, 52725); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$28 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$28 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($246, $$byval_copy39) | 0; + break L1; + break; + } + case 103: + { + HEAP32[$0 >> 2] = $48 + 2; + $249 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($29, 52555); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$29 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$29 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parsePrefixExprENS_10StringViewE($249, $$byval_copy39) | 0; + break L1; + break; + } + case 116: + { + HEAP32[$0 >> 2] = $48 + 2; + $252 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($30, 52728); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$30 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$30 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parsePrefixExprENS_10StringViewE($252, $$byval_copy39) | 0; + break L1; + break; + } + case 120: + { + HEAP32[$0 >> 2] = $48 + 2; + $256 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $256; + if (!$256) $$22 = 0; else $$22 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13EnclosingExprEJRA11_KcRPNS0_4NodeERA2_S8_EEESC_DpOT0_($0, $$byval_copy39) | 0; + $$49 = $$22; + break L1; + break; + } + default: + { + $$49 = 0; + break L1; + } + } + break; + } + case 111: + { + switch (HEAP8[$48 + 1 >> 0] | 0) { + case 110: + { + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseUnresolvedNameEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + break L1; + break; + } + case 111: + { + HEAP32[$0 >> 2] = $48 + 2; + $265 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($31, 52730); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$31 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$31 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($265, $$byval_copy39) | 0; + break L1; + break; + } + case 114: + { + HEAP32[$0 >> 2] = $48 + 2; + $268 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($32, 52733); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$32 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$32 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($268, $$byval_copy39) | 0; + break L1; + break; + } + case 82: + { + HEAP32[$0 >> 2] = $48 + 2; + $271 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($33, 52735); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$33 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$33 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($271, $$byval_copy39) | 0; + break L1; + break; + } + default: + { + $$49 = 0; + break L1; + } + } + break; + } + case 112: + { + switch (HEAP8[$48 + 1 >> 0] | 0) { + case 109: + { + HEAP32[$0 >> 2] = $48 + 2; + $277 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($34, 52738); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$34 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$34 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($277, $$byval_copy39) | 0; + break L1; + break; + } + case 108: + { + HEAP32[$0 >> 2] = $48 + 2; + $280 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($35, 52742); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$35 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$35 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($280, $$byval_copy39) | 0; + break L1; + break; + } + case 76: + { + HEAP32[$0 >> 2] = $48 + 2; + $283 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($36, 52744); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$36 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$36 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($283, $$byval_copy39) | 0; + break L1; + break; + } + case 112: + { + HEAP32[$0 >> 2] = $48 + 2; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) { + $287 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($37, 52747); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$37 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$37 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parsePrefixExprENS_10StringViewE($287, $$byval_copy39) | 0; + break L1; + } + $290 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $290; + if (!$290) $$23 = 0; else $$23 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11PostfixExprEJRPNS0_4NodeERA3_KcEEES9_DpOT0_($0, $$byval_copy39, 52747) | 0; + $$49 = $$23; + break L1; + break; + } + case 115: + { + HEAP32[$0 >> 2] = $48 + 2; + $294 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($38, 52742); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$38 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$38 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parsePrefixExprENS_10StringViewE($294, $$byval_copy39) | 0; + break L1; + break; + } + case 116: + { + HEAP32[$0 >> 2] = $48 + 2; + $297 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $298 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($297) | 0; + HEAP32[$$byval_copy39 >> 2] = $298; + if (!$298) $$25 = 0; else { + $300 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($297) | 0; + HEAP32[$8 >> 2] = $300; + if (!$300) $$24 = 0; else $$24 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10MemberExprEJRPNS0_4NodeERA3_KcSA_EEES9_DpOT0_($0, $$byval_copy39, 52750, $8) | 0; + $$25 = $$24; + } + $$49 = $$25; + break L1; + break; + } + default: + { + $$49 = 0; + break L1; + } + } + break; + } + case 113: + { + if ((HEAP8[$48 + 1 >> 0] | 0) != 117) { + $$49 = 0; + break L1; + } + HEAP32[$0 >> 2] = $48 + 2; + $307 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $308 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($307) | 0; + HEAP32[$$byval_copy39 >> 2] = $308; + if (!$308) $$28 = 0; else { + $310 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($307) | 0; + HEAP32[$8 >> 2] = $310; + if (!$310) $$27 = 0; else { + $312 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($307) | 0; + HEAP32[$39 >> 2] = $312; + if (!$312) $$26 = 0; else $$26 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_15ConditionalExprEJRPNS0_4NodeESA_SA_EEES9_DpOT0_($0, $$byval_copy39, $8, $39) | 0; + $$27 = $$26; + } + $$28 = $$27; + } + $$49 = $$28; + break L1; + break; + } + case 114: + { + switch (HEAP8[$48 + 1 >> 0] | 0) { + case 99: + { + HEAP32[$0 >> 2] = $48 + 2; + $319 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $320 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($319) | 0; + HEAP32[$$byval_copy39 >> 2] = $320; + if (!$320) $$30 = 0; else { + $322 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($319) | 0; + HEAP32[$8 >> 2] = $322; + if (!$322) $$29 = 0; else $$29 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8CastExprEJRA17_KcRPNS0_4NodeESD_EEESC_DpOT0_($0, $$byval_copy39, $8) | 0; + $$30 = $$29; + } + $$49 = $$30; + break L1; + break; + } + case 109: + { + HEAP32[$0 >> 2] = $48 + 2; + $326 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($40, 52753); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$40 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$40 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($326, $$byval_copy39) | 0; + break L1; + break; + } + case 77: + { + HEAP32[$0 >> 2] = $48 + 2; + $329 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($41, 52755); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$41 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$41 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($329, $$byval_copy39) | 0; + break L1; + break; + } + case 115: + { + HEAP32[$0 >> 2] = $48 + 2; + $332 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($42, 52758); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$42 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$42 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($332, $$byval_copy39) | 0; + break L1; + break; + } + case 83: + { + HEAP32[$0 >> 2] = $48 + 2; + $335 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($43, 52761); + HEAP32[$$byval_copy39 >> 2] = HEAP32[$43 >> 2]; + HEAP32[$$byval_copy39 + 4 >> 2] = HEAP32[$43 + 4 >> 2]; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($335, $$byval_copy39) | 0; + break L1; + break; + } + default: + { + $$49 = 0; + break L1; + } + } + break; + } + case 115: + { + switch (HEAP8[$48 + 1 >> 0] | 0) { + case 99: + { + HEAP32[$0 >> 2] = $48 + 2; + $341 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $342 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($341) | 0; + HEAP32[$$byval_copy39 >> 2] = $342; + if (!$342) $$32 = 0; else { + $344 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($341) | 0; + HEAP32[$8 >> 2] = $344; + if (!$344) $$31 = 0; else $$31 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8CastExprEJRA12_KcRPNS0_4NodeESD_EEESC_DpOT0_($0, $$byval_copy39, $8) | 0; + $$32 = $$31; + } + $$49 = $$32; + break L1; + break; + } + case 112: + { + HEAP32[$0 >> 2] = $48 + 2; + $349 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $349; + if (!$349) $$33 = 0; else $$33 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_22ParameterPackExpansionEJRPNS0_4NodeEEEES9_DpOT0_($0, $$byval_copy39) | 0; + $$49 = $$33; + break L1; + break; + } + case 114: + { + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseUnresolvedNameEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + break L1; + break; + } + case 116: + { + HEAP32[$0 >> 2] = $48 + 2; + $356 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $356; + if (!$356) $$34 = 0; else $$34 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13EnclosingExprEJRA9_KcRPNS0_4NodeERA2_S8_EEESC_DpOT0_($0, 52765, $$byval_copy39) | 0; + $$49 = $$34; + break L1; + break; + } + case 122: + { + HEAP32[$0 >> 2] = $48 + 2; + $361 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $361; + if (!$361) $$35 = 0; else $$35 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13EnclosingExprEJRA9_KcRPNS0_4NodeERA2_S8_EEESC_DpOT0_($0, 52765, $$byval_copy39) | 0; + $$49 = $$35; + break L1; + break; + } + case 90: + { + HEAP32[$0 >> 2] = $48 + 2; + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24) { + case 84: + { + $367 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E18parseTemplateParamEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $367; + if (!$367) $$36 = 0; else $$36 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_19SizeofParamPackExprEJRPNS0_4NodeEEEES9_DpOT0_($0, $$byval_copy39) | 0; + $$49 = $$36; + break L1; + break; + } + case 102: + { + $371 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E18parseFunctionParamEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $371; + if (!$371) $$37 = 0; else $$37 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13EnclosingExprEJRA12_KcRPNS0_4NodeERA2_S8_EEESC_DpOT0_($0, $$byval_copy39) | 0; + $$49 = $$37; + break L1; + break; + } + default: + { + $$49 = 0; + break L1; + } + } + break; + } + case 80: + { + HEAP32[$0 >> 2] = $48 + 2; + $375 = $0 + 8 | 0; + $376 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($375) | 0; + while (1) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) { + label = 172; + break; + } + $379 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E16parseTemplateArgEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $379; + if (!$379) { + label = 171; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($375, $$byval_copy39); + } + if ((label | 0) == 171) { + $$49 = 0; + break L1; + } else if ((label | 0) == 172) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20popTrailingNodeArrayEm($8, $0, $376); + $381 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13NodeArrayNodeEJNS0_9NodeArrayEEEEPNS0_4NodeEDpOT0_($0, $8) | 0; + HEAP32[$$byval_copy39 >> 2] = $381; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13EnclosingExprEJRA12_KcRPNS0_4NodeERA2_S8_EEESC_DpOT0_($0, $$byval_copy39) | 0; + break L1; + } + break; + } + default: + { + $$49 = 0; + break L1; + } + } + break; + } + case 116: + { + switch (HEAP8[$48 + 1 >> 0] | 0) { + case 101: + { + HEAP32[$0 >> 2] = $48 + 2; + $388 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $388; + if (!$388) $$42 = 0; else $$42 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13EnclosingExprEJRA9_KcRPNS0_4NodeERA2_S8_EEESC_DpOT0_($0, 52774, $$byval_copy39) | 0; + $$49 = $$42; + break L1; + break; + } + case 105: + { + HEAP32[$0 >> 2] = $48 + 2; + $393 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $393; + if (!$393) $$43 = 0; else $$43 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13EnclosingExprEJRA9_KcRPNS0_4NodeERA2_S8_EEESC_DpOT0_($0, 52774, $$byval_copy39) | 0; + $$49 = $$43; + break L1; + break; + } + case 108: + { + HEAP32[$0 >> 2] = $48 + 2; + $397 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $398 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($397) | 0; + HEAP32[$$byval_copy39 >> 2] = $398; + do if ($398) { + $400 = $0 + 8 | 0; + $401 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($400) | 0; + while (1) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) { + label = 186; + break; + } + $403 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBracedExprEv($397) | 0; + HEAP32[$8 >> 2] = $403; + if (!$403) { + label = 185; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($400, $8); + } + if ((label | 0) == 185) { + $$47 = 0; + break; + } else if ((label | 0) == 186) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20popTrailingNodeArrayEm($8, $0, $401); + $$47 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_12InitListExprEJRPNS0_4NodeENS0_9NodeArrayEEEES9_DpOT0_($0, $$byval_copy39, $8) | 0; + break; + } + } else $$47 = 0; while (0); + $$49 = $$47; + break L1; + break; + } + case 114: + { + HEAP32[$0 >> 2] = $48 + 2; + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA6_KcEEEPNS0_4NodeEDpOT0_($0, 52783) | 0; + break L1; + break; + } + case 119: + { + HEAP32[$0 >> 2] = $48 + 2; + $410 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy39 >> 2] = $410; + if (!$410) $$48 = 0; else $$48 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_9ThrowExprEJRPNS0_4NodeEEEES9_DpOT0_($0, $$byval_copy39) | 0; + $$49 = $$48; + break L1; + break; + } + default: + { + $$49 = 0; + break L1; + } + } + break; + } + case 57: + case 56: + case 55: + case 54: + case 53: + case 52: + case 51: + case 50: + case 49: + { + $$49 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseUnresolvedNameEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + break L1; + break; + } + default: + { + $$49 = 0; + break L1; + } + } while (0); + } while (0); + STACKTOP = sp; + return $$49 | 0; +} + +function _arPattGetImage2($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + $10 = +$10; + $11 = $11 | 0; + var $$0 = 0, $$01442 = 0, $$01443 = 0, $$01464 = 0, $$01468 = 0, $$01474 = 0, $$01495 = 0, $$1 = 0, $$10 = 0, $$101453 = 0, $$101484 = 0, $$101505 = 0, $$11 = 0, $$111454 = 0, $$111485 = 0, $$111506 = 0, $$11444 = 0, $$11465 = 0, $$11469 = 0, $$11475 = 0, $$11496 = 0, $$12 = 0, $$121455 = 0, $$121486 = 0, $$121507 = 0, $$13 = 0, $$131456 = 0, $$131487 = 0, $$131508 = 0, $$14 = 0, $$141457 = 0, $$141488 = 0, $$141509 = 0, $$15 = 0, $$151458 = 0, $$151489 = 0, $$151510 = 0, $$16 = 0, $$161459 = 0, $$161490 = 0, $$161511 = 0, $$17 = 0, $$171460 = 0, $$171491 = 0, $$171512 = 0, $$18 = 0, $$181461 = 0, $$181492 = 0, $$181513 = 0, $$19 = 0, $$191462 = 0, $$191493 = 0, $$191514 = 0, $$2 = 0, $$20 = 0, $$201463 = 0, $$201494 = 0, $$201515 = 0, $$21 = 0, $$21445 = 0, $$21466 = 0, $$21470 = 0, $$21476 = 0, $$21497 = 0, $$22 = 0, $$23 = 0, $$3 = 0, $$31446 = 0, $$31471 = 0, $$31477 = 0, $$31498 = 0, $$4 = 0, $$41447 = 0, $$41478 = 0, $$41499 = 0, $$5 = 0, $$51448 = 0, $$51479 = 0, $$51500 = 0, $$6 = 0, $$61449 = 0, $$61480 = 0, $$61501 = 0, $$7 = 0, $$71450 = 0, $$71481 = 0, $$71502 = 0, $$8 = 0, $$81451 = 0, $$81482 = 0, $$81503 = 0, $$9 = 0, $$91452 = 0, $$91483 = 0, $$91504 = 0, $101 = 0, $1016 = 0, $102 = 0, $1026 = 0, $1032 = 0.0, $1038 = 0.0, $1039 = 0.0, $1043 = 0, $1049 = 0, $105 = 0.0, $1053 = 0, $1055 = 0, $106 = 0.0, $1061 = 0, $1062 = 0, $1066 = 0, $1070 = 0, $1074 = 0, $1077 = 0, $108 = 0, $1082 = 0.0, $1083 = 0.0, $1084 = 0.0, $1085 = 0, $1086 = 0, $1087 = 0, $1088 = 0, $1089 = 0, $109 = 0, $1090 = 0, $1091 = 0, $1092 = 0, $1093 = 0, $1099 = 0.0, $110 = 0, $1105 = 0.0, $1112 = 0.0, $112 = 0.0, $1122 = 0.0, $113 = 0.0, $1131 = 0.0, $1132 = 0.0, $114 = 0.0, $115 = 0, $1153 = 0, $1156 = 0, $116 = 0, $1164 = 0, $1165 = 0, $1169 = 0, $117 = 0, $1178 = 0, $118 = 0, $1185 = 0, $119 = 0, $1190 = 0.0, $1191 = 0.0, $1192 = 0.0, $1193 = 0, $1194 = 0, $1195 = 0, $1196 = 0, $1197 = 0, $1198 = 0, $1199 = 0, $12 = 0, $120 = 0, $1200 = 0, $1201 = 0, $1207 = 0.0, $121 = 0, $1213 = 0.0, $122 = 0, $1220 = 0.0, $123 = 0, $1230 = 0.0, $1239 = 0.0, $1240 = 0.0, $1261 = 0, $1264 = 0, $1272 = 0, $1273 = 0, $1277 = 0, $1286 = 0, $129 = 0.0, $1293 = 0, $1298 = 0.0, $1299 = 0.0, $13 = 0, $1300 = 0.0, $1301 = 0, $1302 = 0, $1303 = 0, $1304 = 0, $1305 = 0, $1306 = 0, $1307 = 0, $1308 = 0, $1309 = 0, $1315 = 0.0, $1321 = 0.0, $1328 = 0.0, $1338 = 0.0, $1347 = 0.0, $1348 = 0.0, $135 = 0.0, $1369 = 0, $1380 = 0, $1381 = 0, $1385 = 0, $1390 = 0, $1397 = 0, $14 = 0, $1402 = 0, $1409 = 0, $1412 = 0.0, $1413 = 0.0, $1414 = 0.0, $1415 = 0, $1416 = 0, $1417 = 0, $1418 = 0, $1419 = 0, $142 = 0.0, $1420 = 0, $1421 = 0, $1422 = 0, $1423 = 0, $1429 = 0.0, $1435 = 0.0, $1442 = 0.0, $1452 = 0.0, $1461 = 0.0, $1462 = 0.0, $1483 = 0, $15 = 0, $1502 = 0, $1509 = 0.0, $1510 = 0.0, $1511 = 0.0, $1512 = 0, $1513 = 0, $1514 = 0, $1515 = 0, $1516 = 0, $1517 = 0, $1518 = 0, $1519 = 0, $152 = 0.0, $1520 = 0, $1526 = 0.0, $1532 = 0.0, $1539 = 0.0, $1549 = 0.0, $1558 = 0.0, $1559 = 0.0, $1580 = 0, $1599 = 0, $16 = 0, $1606 = 0.0, $1607 = 0.0, $1608 = 0.0, $1609 = 0, $161 = 0.0, $1610 = 0, $1611 = 0, $1612 = 0, $1613 = 0, $1614 = 0, $1615 = 0, $1616 = 0, $1617 = 0, $162 = 0.0, $1623 = 0.0, $1629 = 0.0, $1636 = 0.0, $1646 = 0.0, $1655 = 0.0, $1656 = 0.0, $1677 = 0, $1697 = 0, $1702 = 0.0, $1703 = 0.0, $1704 = 0.0, $1705 = 0, $1706 = 0, $1707 = 0, $1708 = 0, $1709 = 0, $1710 = 0, $1711 = 0, $1712 = 0, $1713 = 0, $1719 = 0.0, $1725 = 0.0, $1732 = 0.0, $1742 = 0.0, $1751 = 0.0, $1752 = 0.0, $1773 = 0, $1780 = 0, $1785 = 0.0, $1786 = 0.0, $1787 = 0.0, $1788 = 0, $1789 = 0, $1790 = 0, $1791 = 0, $1792 = 0, $1793 = 0, $1794 = 0, $1795 = 0, $1796 = 0, $1802 = 0.0, $1808 = 0.0, $1815 = 0.0, $1825 = 0.0, $183 = 0, $1834 = 0.0, $1835 = 0.0, $1858 = 0, $1865 = 0, $1870 = 0.0, $1871 = 0.0, $1872 = 0.0, $1873 = 0, $1874 = 0, $1875 = 0, $1876 = 0, $1877 = 0, $1878 = 0, $1879 = 0, $1880 = 0, $1881 = 0, $1887 = 0.0, $1893 = 0.0, $1900 = 0.0, $1910 = 0.0, $1919 = 0.0, $192 = 0, $1920 = 0.0, $193 = 0, $1942 = 0, $1949 = 0, $1954 = 0.0, $1955 = 0.0, $1956 = 0.0, $1957 = 0, $1958 = 0, $1959 = 0, $1960 = 0, $1961 = 0, $1962 = 0, $1963 = 0, $1964 = 0, $1965 = 0, $1971 = 0.0, $1977 = 0.0, $1984 = 0.0, $1994 = 0.0, $2003 = 0.0, $2004 = 0.0, $201 = 0, $2025 = 0, $2028 = 0, $2036 = 0, $2051 = 0, $2056 = 0.0, $2057 = 0.0, $2058 = 0.0, $2059 = 0, $2060 = 0, $2061 = 0, $2062 = 0, $2063 = 0, $2064 = 0, $2065 = 0, $2066 = 0, $2067 = 0, $2073 = 0.0, $2079 = 0.0, $208 = 0, $2086 = 0.0, $2096 = 0.0, $2105 = 0.0, $2106 = 0.0, $2127 = 0, $213 = 0.0, $2130 = 0, $2138 = 0, $214 = 0.0, $215 = 0.0, $2153 = 0, $2158 = 0.0, $2159 = 0.0, $216 = 0, $2160 = 0.0, $2161 = 0, $2162 = 0, $2163 = 0, $2164 = 0, $2165 = 0, $2166 = 0, $2167 = 0, $2168 = 0, $2169 = 0, $217 = 0, $2175 = 0.0, $218 = 0, $2181 = 0.0, $2188 = 0.0, $219 = 0, $2198 = 0.0, $220 = 0, $2207 = 0.0, $2208 = 0.0, $221 = 0, $222 = 0, $2229 = 0, $223 = 0, $2232 = 0, $224 = 0, $2251 = 0, $2256 = 0, $2263 = 0, $230 = 0.0, $236 = 0.0, $243 = 0.0, $253 = 0.0, $262 = 0.0, $263 = 0.0, $284 = 0, $292 = 0, $293 = 0, $301 = 0, $309 = 0, $31 = 0.0, $314 = 0.0, $315 = 0.0, $316 = 0.0, $317 = 0, $318 = 0, $319 = 0, $320 = 0, $321 = 0, $322 = 0, $323 = 0, $324 = 0, $325 = 0, $33 = 0.0, $331 = 0.0, $337 = 0.0, $34 = 0.0, $344 = 0.0, $354 = 0.0, $363 = 0.0, $364 = 0.0, $37 = 0.0, $385 = 0, $39 = 0.0, $394 = 0, $395 = 0, $40 = 0.0, $403 = 0, $410 = 0, $415 = 0.0, $416 = 0.0, $417 = 0.0, $418 = 0, $419 = 0, $420 = 0, $421 = 0, $422 = 0, $423 = 0, $424 = 0, $425 = 0, $426 = 0, $43 = 0, $432 = 0.0, $438 = 0.0, $445 = 0.0, $45 = 0.0, $455 = 0.0, $464 = 0.0, $465 = 0.0, $47 = 0.0, $48 = 0.0, $486 = 0, $494 = 0, $495 = 0, $503 = 0, $51 = 0.0, $511 = 0, $516 = 0.0, $517 = 0.0, $518 = 0.0, $519 = 0, $520 = 0, $521 = 0, $522 = 0, $523 = 0, $524 = 0, $525 = 0, $526 = 0, $527 = 0, $53 = 0.0, $533 = 0.0, $539 = 0.0, $54 = 0.0, $546 = 0.0, $556 = 0.0, $565 = 0.0, $566 = 0.0, $57 = 0, $58 = 0.0, $587 = 0, $596 = 0, $597 = 0, $60 = 0.0, $605 = 0, $613 = 0, $618 = 0.0, $619 = 0.0, $620 = 0.0, $621 = 0, $622 = 0, $623 = 0, $624 = 0, $625 = 0, $626 = 0, $627 = 0, $628 = 0, $629 = 0, $63 = 0, $635 = 0.0, $64 = 0.0, $641 = 0.0, $648 = 0.0, $658 = 0.0, $66 = 0.0, $667 = 0.0, $668 = 0.0, $689 = 0, $69 = 0, $691 = 0, $696 = 0, $697 = 0, $701 = 0, $705 = 0, $710 = 0.0, $711 = 0.0, $712 = 0.0, $713 = 0, $714 = 0, $715 = 0, $716 = 0, $717 = 0, $718 = 0, $719 = 0, $720 = 0, $721 = 0, $727 = 0.0, $733 = 0.0, $740 = 0.0, $75 = 0, $750 = 0.0, $759 = 0.0, $760 = 0.0, $781 = 0, $79 = 0, $790 = 0, $791 = 0, $799 = 0, $807 = 0, $812 = 0.0, $813 = 0.0, $814 = 0.0, $815 = 0, $816 = 0, $817 = 0, $818 = 0, $819 = 0, $820 = 0, $821 = 0, $822 = 0, $823 = 0, $829 = 0.0, $835 = 0.0, $842 = 0.0, $852 = 0.0, $861 = 0.0, $862 = 0.0, $881 = 0, $884 = 0, $889 = 0.0, $903 = 0.0, $904 = 0.0, $908 = 0, $914 = 0, $918 = 0, $920 = 0, $926 = 0, $927 = 0, $931 = 0, $935 = 0, $939 = 0, $942 = 0, $947 = 0.0, $948 = 0.0, $949 = 0.0, $950 = 0, $951 = 0, $952 = 0, $953 = 0, $954 = 0, $955 = 0, $956 = 0, $957 = 0, $958 = 0, $964 = 0.0, $970 = 0.0, $977 = 0.0, $987 = 0.0, $996 = 0.0, $997 = 0.0, $spec$select1520 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer3 = 0, $vararg_buffer5 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 256 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(256); + $vararg_buffer5 = sp + 232 | 0; + $vararg_buffer3 = sp + 224 | 0; + $vararg_buffer1 = sp + 216 | 0; + $vararg_buffer = sp + 208 | 0; + $12 = sp + 144 | 0; + $13 = sp + 80 | 0; + $14 = sp; + $15 = sp + 240 | 0; + $16 = sp + 236 | 0; + HEAPF64[$12 >> 3] = 100.0; + HEAPF64[$12 + 8 >> 3] = 100.0; + HEAPF64[$12 + 16 >> 3] = 110.0; + HEAPF64[$12 + 24 >> 3] = 100.0; + HEAPF64[$12 + 32 >> 3] = 110.0; + HEAPF64[$12 + 40 >> 3] = 110.0; + HEAPF64[$12 + 48 >> 3] = 100.0; + HEAPF64[$12 + 56 >> 3] = 110.0; + $$01474 = 0; + while (1) { + if (($$01474 | 0) == 4) break; + HEAPF64[$13 + ($$01474 << 4) >> 3] = +HEAPF64[$9 + ($$01474 << 4) >> 3]; + HEAPF64[$13 + ($$01474 << 4) + 8 >> 3] = +HEAPF64[$9 + ($$01474 << 4) + 8 >> 3]; + $$01474 = $$01474 + 1 | 0; + } + _get_cpara($12, $13, $14); + $31 = +HEAPF64[$13 >> 3]; + $33 = +HEAPF64[$13 + 16 >> 3]; + $34 = $31 - $33; + $37 = +HEAPF64[$13 + 8 >> 3]; + $39 = +HEAPF64[$13 + 24 >> 3]; + $40 = $37 - $39; + $43 = ~~($34 * $34 + $40 * $40); + $45 = +HEAPF64[$13 + 32 >> 3]; + $47 = +HEAPF64[$13 + 48 >> 3]; + $48 = $45 - $47; + $51 = +HEAPF64[$13 + 40 >> 3]; + $53 = +HEAPF64[$13 + 56 >> 3]; + $54 = $51 - $53; + $57 = ~~($48 * $48 + $54 * $54); + $58 = $33 - $45; + $60 = $39 - $51; + $63 = ~~($58 * $58 + $60 * $60); + $64 = $47 - $31; + $66 = $53 - $37; + $69 = ~~($64 * $64 + $66 * $66); + $75 = ~~(+((($57 | 0) > ($43 | 0) ? $57 : $43) | 0) * $10 * $10); + $79 = ~~(+((($69 | 0) > ($63 | 0) ? $69 : $63) | 0) * $10 * $10); + if (!$0) { + $$01464 = $2; + while (1) if (($$01464 | 0) < ($3 | 0) & (Math_imul($$01464, $$01464) | 0) < ($75 | 0)) $$01464 = $$01464 << 1; else break; + $$01468 = $2; + while (1) if (($$01468 | 0) < ($3 | 0) & (Math_imul($$01468, $$01468) | 0) < ($79 | 0)) $$01468 = $$01468 << 1; else { + $$21466 = $$01464; + $$21470 = $$01468; + break; + } + } else { + $$11465 = $2; + while (1) if (($$11465 | 0) < ($3 | 0) & (Math_imul($$11465 << 2, $$11465) | 0) < ($75 | 0)) $$11465 = $$11465 << 1; else break; + $$11469 = $2; + while (1) if (($$11469 | 0) < ($3 | 0) & (Math_imul($$11469 << 2, $$11469) | 0) < ($79 | 0)) $$11469 = $$11469 << 1; else { + $$21466 = $$11465; + $$21470 = $$11469; + break; + } + } + $spec$select1520 = ($$21466 | 0) > ($3 | 0) ? $3 : $$21466; + $$31471 = ($$21470 | 0) > ($3 | 0) ? $3 : $$21470; + $101 = ($spec$select1520 | 0) / ($2 | 0) | 0; + $102 = ($$31471 | 0) / ($2 | 0) | 0; + $105 = (1.0 - $10) * .5 * 10.0; + $106 = $10 * 10.0; + $108 = Math_imul($2, $2) | 0; + L19 : do if (!$1) { + $109 = $108 * 3 | 0; + $110 = _calloc($109, 4) | 0; + if (!$110) { + _arLog(0, 3, 45930, $vararg_buffer); + _exit(1); + } + L24 : do switch ($7 | 0) { + case 0: + { + $112 = $105 + 100.0; + $113 = +($$31471 | 0); + $114 = +($spec$select1520 | 0); + $115 = $14 + 48 | 0; + $116 = $14 + 56 | 0; + $117 = $14 + 64 | 0; + $118 = $14 + 8 | 0; + $119 = $14 + 16 | 0; + $120 = $14 + 24 | 0; + $121 = $14 + 32 | 0; + $122 = $14 + 40 | 0; + $123 = ($0 | 0) == 1; + $$01495 = 0; + while (1) { + if (($$01495 | 0) >= ($$31471 | 0)) break L24; + $129 = $112 + $106 * (+($$01495 | 0) + .5) / $113; + $$11475 = 0; + while (1) { + if (($$11475 | 0) >= ($spec$select1520 | 0)) break; + $135 = $112 + $106 * (+($$11475 | 0) + .5) / $114; + $142 = +HEAPF64[$117 >> 3] + ($135 * +HEAPF64[$115 >> 3] + $129 * +HEAPF64[$116 >> 3]); + if ($142 == 0.0) { + $2263 = $110; + label = 306; + break L19; + } + $152 = (+HEAPF64[$119 >> 3] + ($135 * +HEAPF64[$14 >> 3] + $129 * +HEAPF64[$118 >> 3])) / $142; + HEAPF32[$15 >> 2] = $152; + $161 = (+HEAPF64[$122 >> 3] + ($135 * +HEAPF64[$120 >> 3] + $129 * +HEAPF64[$121 >> 3])) / $142; + HEAPF32[$16 >> 2] = $161; + _arParamIdeal2ObservLTf($8, $152, $161, $15, $16) | 0; + $162 = +HEAPF32[$15 >> 2]; + if ($123) { + $$01442 = ((~~($162 + 1.0) | 0) / 2 | 0) << 1; + $$01443 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$01442 = ~~($162 + .5); + $$01443 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$01442 | 0) > -1 ? ($$01443 | 0) < ($6 | 0) & (($$01443 | 0) > -1 & ($$01442 | 0) < ($5 | 0)) : 0) { + $183 = ((Math_imul($$01443, $5) | 0) + $$01442 | 0) * 3 | 0; + $192 = ((Math_imul(($$01495 | 0) / ($102 | 0) | 0, $2) | 0) + (($$11475 | 0) / ($101 | 0) | 0) | 0) * 3 | 0; + $193 = $110 + ($192 << 2) | 0; + HEAP32[$193 >> 2] = (HEAP32[$193 >> 2] | 0) + (HEAPU8[$4 + ($183 + 2) >> 0] | 0); + $201 = $110 + ($192 + 1 << 2) | 0; + HEAP32[$201 >> 2] = (HEAP32[$201 >> 2] | 0) + (HEAPU8[$4 + ($183 + 1) >> 0] | 0); + $208 = $110 + ($192 + 2 << 2) | 0; + HEAP32[$208 >> 2] = (HEAP32[$208 >> 2] | 0) + (HEAPU8[$4 + $183 >> 0] | 0); + } + $$11475 = $$11475 + 1 | 0; + } + $$01495 = $$01495 + 1 | 0; + } + break; + } + case 1: + { + $213 = $105 + 100.0; + $214 = +($$31471 | 0); + $215 = +($spec$select1520 | 0); + $216 = $14 + 48 | 0; + $217 = $14 + 56 | 0; + $218 = $14 + 64 | 0; + $219 = $14 + 8 | 0; + $220 = $14 + 16 | 0; + $221 = $14 + 24 | 0; + $222 = $14 + 32 | 0; + $223 = $14 + 40 | 0; + $224 = ($0 | 0) == 1; + $$11496 = 0; + while (1) { + if (($$11496 | 0) >= ($$31471 | 0)) break L24; + $230 = $213 + $106 * (+($$11496 | 0) + .5) / $214; + $$21476 = 0; + while (1) { + if (($$21476 | 0) >= ($spec$select1520 | 0)) break; + $236 = $213 + $106 * (+($$21476 | 0) + .5) / $215; + $243 = +HEAPF64[$218 >> 3] + ($236 * +HEAPF64[$216 >> 3] + $230 * +HEAPF64[$217 >> 3]); + if ($243 == 0.0) { + $2263 = $110; + label = 306; + break L19; + } + $253 = (+HEAPF64[$220 >> 3] + ($236 * +HEAPF64[$14 >> 3] + $230 * +HEAPF64[$219 >> 3])) / $243; + HEAPF32[$15 >> 2] = $253; + $262 = (+HEAPF64[$223 >> 3] + ($236 * +HEAPF64[$221 >> 3] + $230 * +HEAPF64[$222 >> 3])) / $243; + HEAPF32[$16 >> 2] = $262; + _arParamIdeal2ObservLTf($8, $253, $262, $15, $16) | 0; + $263 = +HEAPF32[$15 >> 2]; + if ($224) { + $$1 = ((~~($263 + 1.0) | 0) / 2 | 0) << 1; + $$11444 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$1 = ~~($263 + .5); + $$11444 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$1 | 0) > -1 ? ($$11444 | 0) < ($6 | 0) & (($$11444 | 0) > -1 & ($$1 | 0) < ($5 | 0)) : 0) { + $284 = ((Math_imul($$11444, $5) | 0) + $$1 | 0) * 3 | 0; + $292 = ((Math_imul(($$11496 | 0) / ($102 | 0) | 0, $2) | 0) + (($$21476 | 0) / ($101 | 0) | 0) | 0) * 3 | 0; + $293 = $110 + ($292 << 2) | 0; + HEAP32[$293 >> 2] = (HEAP32[$293 >> 2] | 0) + (HEAPU8[$4 + $284 >> 0] | 0); + $301 = $110 + ($292 + 1 << 2) | 0; + HEAP32[$301 >> 2] = (HEAP32[$301 >> 2] | 0) + (HEAPU8[$4 + ($284 + 1) >> 0] | 0); + $309 = $110 + ($292 + 2 << 2) | 0; + HEAP32[$309 >> 2] = (HEAP32[$309 >> 2] | 0) + (HEAPU8[$4 + ($284 + 2) >> 0] | 0); + } + $$21476 = $$21476 + 1 | 0; + } + $$11496 = $$11496 + 1 | 0; + } + break; + } + case 2: + { + $314 = $105 + 100.0; + $315 = +($$31471 | 0); + $316 = +($spec$select1520 | 0); + $317 = $14 + 48 | 0; + $318 = $14 + 56 | 0; + $319 = $14 + 64 | 0; + $320 = $14 + 8 | 0; + $321 = $14 + 16 | 0; + $322 = $14 + 24 | 0; + $323 = $14 + 32 | 0; + $324 = $14 + 40 | 0; + $325 = ($0 | 0) == 1; + $$21497 = 0; + while (1) { + if (($$21497 | 0) >= ($$31471 | 0)) break L24; + $331 = $314 + $106 * (+($$21497 | 0) + .5) / $315; + $$31477 = 0; + while (1) { + if (($$31477 | 0) >= ($spec$select1520 | 0)) break; + $337 = $314 + $106 * (+($$31477 | 0) + .5) / $316; + $344 = +HEAPF64[$319 >> 3] + ($337 * +HEAPF64[$317 >> 3] + $331 * +HEAPF64[$318 >> 3]); + if ($344 == 0.0) { + $2263 = $110; + label = 306; + break L19; + } + $354 = (+HEAPF64[$321 >> 3] + ($337 * +HEAPF64[$14 >> 3] + $331 * +HEAPF64[$320 >> 3])) / $344; + HEAPF32[$15 >> 2] = $354; + $363 = (+HEAPF64[$324 >> 3] + ($337 * +HEAPF64[$322 >> 3] + $331 * +HEAPF64[$323 >> 3])) / $344; + HEAPF32[$16 >> 2] = $363; + _arParamIdeal2ObservLTf($8, $354, $363, $15, $16) | 0; + $364 = +HEAPF32[$15 >> 2]; + if ($325) { + $$2 = ((~~($364 + 1.0) | 0) / 2 | 0) << 1; + $$21445 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$2 = ~~($364 + .5); + $$21445 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$2 | 0) > -1 ? ($$21445 | 0) < ($6 | 0) & (($$21445 | 0) > -1 & ($$2 | 0) < ($5 | 0)) : 0) { + $385 = (Math_imul($$21445, $5) | 0) + $$2 << 2; + $394 = ((Math_imul(($$21497 | 0) / ($102 | 0) | 0, $2) | 0) + (($$31477 | 0) / ($101 | 0) | 0) | 0) * 3 | 0; + $395 = $110 + ($394 << 2) | 0; + HEAP32[$395 >> 2] = (HEAP32[$395 >> 2] | 0) + (HEAPU8[$4 + ($385 | 2) >> 0] | 0); + $403 = $110 + ($394 + 1 << 2) | 0; + HEAP32[$403 >> 2] = (HEAP32[$403 >> 2] | 0) + (HEAPU8[$4 + ($385 | 1) >> 0] | 0); + $410 = $110 + ($394 + 2 << 2) | 0; + HEAP32[$410 >> 2] = (HEAP32[$410 >> 2] | 0) + (HEAPU8[$4 + $385 >> 0] | 0); + } + $$31477 = $$31477 + 1 | 0; + } + $$21497 = $$21497 + 1 | 0; + } + break; + } + case 3: + { + $415 = $105 + 100.0; + $416 = +($$31471 | 0); + $417 = +($spec$select1520 | 0); + $418 = $14 + 48 | 0; + $419 = $14 + 56 | 0; + $420 = $14 + 64 | 0; + $421 = $14 + 8 | 0; + $422 = $14 + 16 | 0; + $423 = $14 + 24 | 0; + $424 = $14 + 32 | 0; + $425 = $14 + 40 | 0; + $426 = ($0 | 0) == 1; + $$31498 = 0; + while (1) { + if (($$31498 | 0) >= ($$31471 | 0)) break L24; + $432 = $415 + $106 * (+($$31498 | 0) + .5) / $416; + $$41478 = 0; + while (1) { + if (($$41478 | 0) >= ($spec$select1520 | 0)) break; + $438 = $415 + $106 * (+($$41478 | 0) + .5) / $417; + $445 = +HEAPF64[$420 >> 3] + ($438 * +HEAPF64[$418 >> 3] + $432 * +HEAPF64[$419 >> 3]); + if ($445 == 0.0) { + $2263 = $110; + label = 306; + break L19; + } + $455 = (+HEAPF64[$422 >> 3] + ($438 * +HEAPF64[$14 >> 3] + $432 * +HEAPF64[$421 >> 3])) / $445; + HEAPF32[$15 >> 2] = $455; + $464 = (+HEAPF64[$425 >> 3] + ($438 * +HEAPF64[$423 >> 3] + $432 * +HEAPF64[$424 >> 3])) / $445; + HEAPF32[$16 >> 2] = $464; + _arParamIdeal2ObservLTf($8, $455, $464, $15, $16) | 0; + $465 = +HEAPF32[$15 >> 2]; + if ($426) { + $$3 = ((~~($465 + 1.0) | 0) / 2 | 0) << 1; + $$31446 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$3 = ~~($465 + .5); + $$31446 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$3 | 0) > -1 ? ($$31446 | 0) < ($6 | 0) & (($$31446 | 0) > -1 & ($$3 | 0) < ($5 | 0)) : 0) { + $486 = (Math_imul($$31446, $5) | 0) + $$3 << 2; + $494 = ((Math_imul(($$31498 | 0) / ($102 | 0) | 0, $2) | 0) + (($$41478 | 0) / ($101 | 0) | 0) | 0) * 3 | 0; + $495 = $110 + ($494 << 2) | 0; + HEAP32[$495 >> 2] = (HEAP32[$495 >> 2] | 0) + (HEAPU8[$4 + $486 >> 0] | 0); + $503 = $110 + ($494 + 1 << 2) | 0; + HEAP32[$503 >> 2] = (HEAP32[$503 >> 2] | 0) + (HEAPU8[$4 + ($486 | 1) >> 0] | 0); + $511 = $110 + ($494 + 2 << 2) | 0; + HEAP32[$511 >> 2] = (HEAP32[$511 >> 2] | 0) + (HEAPU8[$4 + ($486 | 2) >> 0] | 0); + } + $$41478 = $$41478 + 1 | 0; + } + $$31498 = $$31498 + 1 | 0; + } + break; + } + case 4: + { + $516 = $105 + 100.0; + $517 = +($$31471 | 0); + $518 = +($spec$select1520 | 0); + $519 = $14 + 48 | 0; + $520 = $14 + 56 | 0; + $521 = $14 + 64 | 0; + $522 = $14 + 8 | 0; + $523 = $14 + 16 | 0; + $524 = $14 + 24 | 0; + $525 = $14 + 32 | 0; + $526 = $14 + 40 | 0; + $527 = ($0 | 0) == 1; + $$41499 = 0; + while (1) { + if (($$41499 | 0) >= ($$31471 | 0)) break L24; + $533 = $516 + $106 * (+($$41499 | 0) + .5) / $517; + $$51479 = 0; + while (1) { + if (($$51479 | 0) >= ($spec$select1520 | 0)) break; + $539 = $516 + $106 * (+($$51479 | 0) + .5) / $518; + $546 = +HEAPF64[$521 >> 3] + ($539 * +HEAPF64[$519 >> 3] + $533 * +HEAPF64[$520 >> 3]); + if ($546 == 0.0) { + $2263 = $110; + label = 306; + break L19; + } + $556 = (+HEAPF64[$523 >> 3] + ($539 * +HEAPF64[$14 >> 3] + $533 * +HEAPF64[$522 >> 3])) / $546; + HEAPF32[$15 >> 2] = $556; + $565 = (+HEAPF64[$526 >> 3] + ($539 * +HEAPF64[$524 >> 3] + $533 * +HEAPF64[$525 >> 3])) / $546; + HEAPF32[$16 >> 2] = $565; + _arParamIdeal2ObservLTf($8, $556, $565, $15, $16) | 0; + $566 = +HEAPF32[$15 >> 2]; + if ($527) { + $$4 = ((~~($566 + 1.0) | 0) / 2 | 0) << 1; + $$41447 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$4 = ~~($566 + .5); + $$41447 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$4 | 0) > -1 ? ($$41447 | 0) < ($6 | 0) & (($$41447 | 0) > -1 & ($$4 | 0) < ($5 | 0)) : 0) { + $587 = (Math_imul($$41447, $5) | 0) + $$4 << 2; + $596 = ((Math_imul(($$41499 | 0) / ($102 | 0) | 0, $2) | 0) + (($$51479 | 0) / ($101 | 0) | 0) | 0) * 3 | 0; + $597 = $110 + ($596 << 2) | 0; + HEAP32[$597 >> 2] = (HEAP32[$597 >> 2] | 0) + (HEAPU8[$4 + ($587 | 1) >> 0] | 0); + $605 = $110 + ($596 + 1 << 2) | 0; + HEAP32[$605 >> 2] = (HEAP32[$605 >> 2] | 0) + (HEAPU8[$4 + ($587 | 2) >> 0] | 0); + $613 = $110 + ($596 + 2 << 2) | 0; + HEAP32[$613 >> 2] = (HEAP32[$613 >> 2] | 0) + (HEAPU8[$4 + ($587 | 3) >> 0] | 0); + } + $$51479 = $$51479 + 1 | 0; + } + $$41499 = $$41499 + 1 | 0; + } + break; + } + case 5: + case 12: + case 13: + case 14: + { + $618 = $105 + 100.0; + $619 = +($$31471 | 0); + $620 = +($spec$select1520 | 0); + $621 = $14 + 48 | 0; + $622 = $14 + 56 | 0; + $623 = $14 + 64 | 0; + $624 = $14 + 8 | 0; + $625 = $14 + 16 | 0; + $626 = $14 + 24 | 0; + $627 = $14 + 32 | 0; + $628 = $14 + 40 | 0; + $629 = ($0 | 0) == 1; + $$51500 = 0; + while (1) { + if (($$51500 | 0) >= ($$31471 | 0)) break L24; + $635 = $618 + $106 * (+($$51500 | 0) + .5) / $619; + $$61480 = 0; + while (1) { + if (($$61480 | 0) >= ($spec$select1520 | 0)) break; + $641 = $618 + $106 * (+($$61480 | 0) + .5) / $620; + $648 = +HEAPF64[$623 >> 3] + ($641 * +HEAPF64[$621 >> 3] + $635 * +HEAPF64[$622 >> 3]); + if ($648 == 0.0) { + $2263 = $110; + label = 306; + break L19; + } + $658 = (+HEAPF64[$625 >> 3] + ($641 * +HEAPF64[$14 >> 3] + $635 * +HEAPF64[$624 >> 3])) / $648; + HEAPF32[$15 >> 2] = $658; + $667 = (+HEAPF64[$628 >> 3] + ($641 * +HEAPF64[$626 >> 3] + $635 * +HEAPF64[$627 >> 3])) / $648; + HEAPF32[$16 >> 2] = $667; + _arParamIdeal2ObservLTf($8, $658, $667, $15, $16) | 0; + $668 = +HEAPF32[$15 >> 2]; + if ($629) { + $$5 = ((~~($668 + 1.0) | 0) / 2 | 0) << 1; + $$51448 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$5 = ~~($668 + .5); + $$51448 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$5 | 0) > -1 ? ($$51448 | 0) < ($6 | 0) & (($$51448 | 0) > -1 & ($$5 | 0) < ($5 | 0)) : 0) { + $689 = $4 + ((Math_imul($$51448, $5) | 0) + $$5) | 0; + $691 = HEAPU8[$689 >> 0] | 0; + $696 = ((Math_imul(($$51500 | 0) / ($102 | 0) | 0, $2) | 0) + (($$61480 | 0) / ($101 | 0) | 0) | 0) * 3 | 0; + $697 = $110 + ($696 << 2) | 0; + HEAP32[$697 >> 2] = (HEAP32[$697 >> 2] | 0) + $691; + $701 = $110 + ($696 + 1 << 2) | 0; + HEAP32[$701 >> 2] = (HEAP32[$701 >> 2] | 0) + $691; + $705 = $110 + ($696 + 2 << 2) | 0; + HEAP32[$705 >> 2] = (HEAP32[$705 >> 2] | 0) + $691; + } + $$61480 = $$61480 + 1 | 0; + } + $$51500 = $$51500 + 1 | 0; + } + break; + } + case 6: + { + $710 = $105 + 100.0; + $711 = +($$31471 | 0); + $712 = +($spec$select1520 | 0); + $713 = $14 + 48 | 0; + $714 = $14 + 56 | 0; + $715 = $14 + 64 | 0; + $716 = $14 + 8 | 0; + $717 = $14 + 16 | 0; + $718 = $14 + 24 | 0; + $719 = $14 + 32 | 0; + $720 = $14 + 40 | 0; + $721 = ($0 | 0) == 1; + $$61501 = 0; + while (1) { + if (($$61501 | 0) >= ($$31471 | 0)) break L24; + $727 = $710 + $106 * (+($$61501 | 0) + .5) / $711; + $$71481 = 0; + while (1) { + if (($$71481 | 0) >= ($spec$select1520 | 0)) break; + $733 = $710 + $106 * (+($$71481 | 0) + .5) / $712; + $740 = +HEAPF64[$715 >> 3] + ($733 * +HEAPF64[$713 >> 3] + $727 * +HEAPF64[$714 >> 3]); + if ($740 == 0.0) { + $2263 = $110; + label = 306; + break L19; + } + $750 = (+HEAPF64[$717 >> 3] + ($733 * +HEAPF64[$14 >> 3] + $727 * +HEAPF64[$716 >> 3])) / $740; + HEAPF32[$15 >> 2] = $750; + $759 = (+HEAPF64[$720 >> 3] + ($733 * +HEAPF64[$718 >> 3] + $727 * +HEAPF64[$719 >> 3])) / $740; + HEAPF32[$16 >> 2] = $759; + _arParamIdeal2ObservLTf($8, $750, $759, $15, $16) | 0; + $760 = +HEAPF32[$15 >> 2]; + if ($721) { + $$6 = ((~~($760 + 1.0) | 0) / 2 | 0) << 1; + $$61449 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$6 = ~~($760 + .5); + $$61449 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$6 | 0) > -1 ? ($$61449 | 0) < ($6 | 0) & (($$61449 | 0) > -1 & ($$6 | 0) < ($5 | 0)) : 0) { + $781 = (Math_imul($$61449, $5) | 0) + $$6 << 2; + $790 = ((Math_imul(($$61501 | 0) / ($102 | 0) | 0, $2) | 0) + (($$71481 | 0) / ($101 | 0) | 0) | 0) * 3 | 0; + $791 = $110 + ($790 << 2) | 0; + HEAP32[$791 >> 2] = (HEAP32[$791 >> 2] | 0) + (HEAPU8[$4 + ($781 | 3) >> 0] | 0); + $799 = $110 + ($790 + 1 << 2) | 0; + HEAP32[$799 >> 2] = (HEAP32[$799 >> 2] | 0) + (HEAPU8[$4 + ($781 | 2) >> 0] | 0); + $807 = $110 + ($790 + 2 << 2) | 0; + HEAP32[$807 >> 2] = (HEAP32[$807 >> 2] | 0) + (HEAPU8[$4 + ($781 | 1) >> 0] | 0); + } + $$71481 = $$71481 + 1 | 0; + } + $$61501 = $$61501 + 1 | 0; + } + break; + } + case 7: + { + $812 = $105 + 100.0; + $813 = +($$31471 | 0); + $814 = +($spec$select1520 | 0); + $815 = $14 + 48 | 0; + $816 = $14 + 56 | 0; + $817 = $14 + 64 | 0; + $818 = $14 + 8 | 0; + $819 = $14 + 16 | 0; + $820 = $14 + 24 | 0; + $821 = $14 + 32 | 0; + $822 = $14 + 40 | 0; + $823 = ($0 | 0) == 1; + $$71502 = 0; + while (1) { + if (($$71502 | 0) >= ($$31471 | 0)) break L24; + $829 = $812 + $106 * (+($$71502 | 0) + .5) / $813; + $$81482 = 0; + while (1) { + if (($$81482 | 0) >= ($spec$select1520 | 0)) break; + $835 = $812 + $106 * (+($$81482 | 0) + .5) / $814; + $842 = +HEAPF64[$817 >> 3] + ($835 * +HEAPF64[$815 >> 3] + $829 * +HEAPF64[$816 >> 3]); + if ($842 == 0.0) { + $2263 = $110; + label = 306; + break L19; + } + $852 = (+HEAPF64[$819 >> 3] + ($835 * +HEAPF64[$14 >> 3] + $829 * +HEAPF64[$818 >> 3])) / $842; + HEAPF32[$15 >> 2] = $852; + $861 = (+HEAPF64[$822 >> 3] + ($835 * +HEAPF64[$820 >> 3] + $829 * +HEAPF64[$821 >> 3])) / $842; + HEAPF32[$16 >> 2] = $861; + _arParamIdeal2ObservLTf($8, $852, $861, $15, $16) | 0; + $862 = +HEAPF32[$15 >> 2]; + if ($823) { + $$7 = ((~~($862 + 1.0) | 0) / 2 | 0) << 1; + $$71450 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$7 = ~~($862 + .5); + $$71450 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$7 | 0) > -1 ? ($$71450 | 0) < ($6 | 0) & (($$71450 | 0) > -1 & ($$7 | 0) < ($5 | 0)) : 0) { + $881 = Math_imul($$71450, $5) | 0; + $884 = ($$7 & 65534) + $881 << 1; + $889 = +((HEAPU8[$4 + $884 >> 0] | 0) + -128 | 0); + $903 = +((HEAPU8[$4 + ($884 + 2) >> 0] | 0) + -128 | 0); + $904 = +((HEAPU8[$4 + ($881 + $$7 << 1 | 1) >> 0] | 0) + -16 | 0) * 298.0820007324219; + $908 = ~~($889 * 516.4110107421875 + $904) >> 8; + $914 = ~~($904 - $889 * 100.29100036621094 - $903 * 208.1199951171875) >> 8; + $918 = ~~($904 + $903 * 408.5830078125) >> 8; + $920 = ($908 | 0) > 0 ? $908 : 0; + $926 = ((Math_imul(($$71502 | 0) / ($102 | 0) | 0, $2) | 0) + (($$81482 | 0) / ($101 | 0) | 0) | 0) * 3 | 0; + $927 = $110 + ($926 << 2) | 0; + HEAP32[$927 >> 2] = (($920 | 0) < 255 ? $920 : 255) + (HEAP32[$927 >> 2] | 0); + $931 = ($914 | 0) > 0 ? $914 : 0; + $935 = $110 + ($926 + 1 << 2) | 0; + HEAP32[$935 >> 2] = (($931 | 0) < 255 ? $931 : 255) + (HEAP32[$935 >> 2] | 0); + $939 = ($918 | 0) > 0 ? $918 : 0; + $942 = $110 + ($926 + 2 << 2) | 0; + HEAP32[$942 >> 2] = (($939 | 0) < 255 ? $939 : 255) + (HEAP32[$942 >> 2] | 0); + } + $$81482 = $$81482 + 1 | 0; + } + $$71502 = $$71502 + 1 | 0; + } + break; + } + case 8: + { + $947 = $105 + 100.0; + $948 = +($$31471 | 0); + $949 = +($spec$select1520 | 0); + $950 = $14 + 48 | 0; + $951 = $14 + 56 | 0; + $952 = $14 + 64 | 0; + $953 = $14 + 8 | 0; + $954 = $14 + 16 | 0; + $955 = $14 + 24 | 0; + $956 = $14 + 32 | 0; + $957 = $14 + 40 | 0; + $958 = ($0 | 0) == 1; + $$81503 = 0; + while (1) { + if (($$81503 | 0) >= ($$31471 | 0)) break L24; + $964 = $947 + $106 * (+($$81503 | 0) + .5) / $948; + $$91483 = 0; + while (1) { + if (($$91483 | 0) >= ($spec$select1520 | 0)) break; + $970 = $947 + $106 * (+($$91483 | 0) + .5) / $949; + $977 = +HEAPF64[$952 >> 3] + ($970 * +HEAPF64[$950 >> 3] + $964 * +HEAPF64[$951 >> 3]); + if ($977 == 0.0) { + $2263 = $110; + label = 306; + break L19; + } + $987 = (+HEAPF64[$954 >> 3] + ($970 * +HEAPF64[$14 >> 3] + $964 * +HEAPF64[$953 >> 3])) / $977; + HEAPF32[$15 >> 2] = $987; + $996 = (+HEAPF64[$957 >> 3] + ($970 * +HEAPF64[$955 >> 3] + $964 * +HEAPF64[$956 >> 3])) / $977; + HEAPF32[$16 >> 2] = $996; + _arParamIdeal2ObservLTf($8, $987, $996, $15, $16) | 0; + $997 = +HEAPF32[$15 >> 2]; + if ($958) { + $$8 = ((~~($997 + 1.0) | 0) / 2 | 0) << 1; + $$81451 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$8 = ~~($997 + .5); + $$81451 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$8 | 0) > -1 ? ($$81451 | 0) < ($6 | 0) & (($$81451 | 0) > -1 & ($$8 | 0) < ($5 | 0)) : 0) { + $1016 = Math_imul($$81451, $5) | 0; + $1026 = ($$8 & 65534) + $1016 << 1; + $1032 = +((HEAPU8[$4 + ($1026 | 1) >> 0] | 0) + -128 | 0); + $1038 = +((HEAPU8[$4 + ($1026 + 3) >> 0] | 0) + -128 | 0); + $1039 = +((HEAPU8[$4 + ($1016 + $$8 << 1) >> 0] | 0) + -16 | 0) * 298.0820007324219; + $1043 = ~~($1039 + $1032 * 516.4110107421875) >> 8; + $1049 = ~~($1039 - $1032 * 100.29100036621094 - $1038 * 208.1199951171875) >> 8; + $1053 = ~~($1039 + $1038 * 408.5830078125) >> 8; + $1055 = ($1043 | 0) > 0 ? $1043 : 0; + $1061 = ((Math_imul(($$81503 | 0) / ($102 | 0) | 0, $2) | 0) + (($$91483 | 0) / ($101 | 0) | 0) | 0) * 3 | 0; + $1062 = $110 + ($1061 << 2) | 0; + HEAP32[$1062 >> 2] = (($1055 | 0) < 255 ? $1055 : 255) + (HEAP32[$1062 >> 2] | 0); + $1066 = ($1049 | 0) > 0 ? $1049 : 0; + $1070 = $110 + ($1061 + 1 << 2) | 0; + HEAP32[$1070 >> 2] = (($1066 | 0) < 255 ? $1066 : 255) + (HEAP32[$1070 >> 2] | 0); + $1074 = ($1053 | 0) > 0 ? $1053 : 0; + $1077 = $110 + ($1061 + 2 << 2) | 0; + HEAP32[$1077 >> 2] = (($1074 | 0) < 255 ? $1074 : 255) + (HEAP32[$1077 >> 2] | 0); + } + $$91483 = $$91483 + 1 | 0; + } + $$81503 = $$81503 + 1 | 0; + } + break; + } + case 9: + { + $1082 = $105 + 100.0; + $1083 = +($$31471 | 0); + $1084 = +($spec$select1520 | 0); + $1085 = $14 + 48 | 0; + $1086 = $14 + 56 | 0; + $1087 = $14 + 64 | 0; + $1088 = $14 + 8 | 0; + $1089 = $14 + 16 | 0; + $1090 = $14 + 24 | 0; + $1091 = $14 + 32 | 0; + $1092 = $14 + 40 | 0; + $1093 = ($0 | 0) == 1; + $$91504 = 0; + while (1) { + if (($$91504 | 0) >= ($$31471 | 0)) break L24; + $1099 = $1082 + $106 * (+($$91504 | 0) + .5) / $1083; + $$101484 = 0; + while (1) { + if (($$101484 | 0) >= ($spec$select1520 | 0)) break; + $1105 = $1082 + $106 * (+($$101484 | 0) + .5) / $1084; + $1112 = +HEAPF64[$1087 >> 3] + ($1105 * +HEAPF64[$1085 >> 3] + $1099 * +HEAPF64[$1086 >> 3]); + if ($1112 == 0.0) { + $2263 = $110; + label = 306; + break L19; + } + $1122 = (+HEAPF64[$1089 >> 3] + ($1105 * +HEAPF64[$14 >> 3] + $1099 * +HEAPF64[$1088 >> 3])) / $1112; + HEAPF32[$15 >> 2] = $1122; + $1131 = (+HEAPF64[$1092 >> 3] + ($1105 * +HEAPF64[$1090 >> 3] + $1099 * +HEAPF64[$1091 >> 3])) / $1112; + HEAPF32[$16 >> 2] = $1131; + _arParamIdeal2ObservLTf($8, $1122, $1131, $15, $16) | 0; + $1132 = +HEAPF32[$15 >> 2]; + if ($1093) { + $$9 = ((~~($1132 + 1.0) | 0) / 2 | 0) << 1; + $$91452 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$9 = ~~($1132 + .5); + $$91452 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$9 | 0) > -1 ? ($$91452 | 0) < ($6 | 0) & (($$91452 | 0) > -1 & ($$9 | 0) < ($5 | 0)) : 0) { + $1153 = (Math_imul($$91452, $5) | 0) + $$9 << 1; + $1156 = HEAP8[$4 + ($1153 | 1) >> 0] | 0; + $1164 = ((Math_imul(($$91504 | 0) / ($102 | 0) | 0, $2) | 0) + (($$101484 | 0) / ($101 | 0) | 0) | 0) * 3 | 0; + $1165 = $110 + ($1164 << 2) | 0; + HEAP32[$1165 >> 2] = (HEAP32[$1165 >> 2] | 0) + (($1156 << 3 & 255 | 4) & 255); + $1169 = HEAP8[$4 + $1153 >> 0] | 0; + $1178 = $110 + ($1164 + 1 << 2) | 0; + HEAP32[$1178 >> 2] = (($1156 & -32 & 255) >>> 3 | $1169 << 5 & 255 | 2) + (HEAP32[$1178 >> 2] | 0); + $1185 = $110 + ($1164 + 2 << 2) | 0; + HEAP32[$1185 >> 2] = (HEAP32[$1185 >> 2] | 0) + (($1169 & -8 | 4) & 255); + } + $$101484 = $$101484 + 1 | 0; + } + $$91504 = $$91504 + 1 | 0; + } + break; + } + case 10: + { + $1190 = $105 + 100.0; + $1191 = +($$31471 | 0); + $1192 = +($spec$select1520 | 0); + $1193 = $14 + 48 | 0; + $1194 = $14 + 56 | 0; + $1195 = $14 + 64 | 0; + $1196 = $14 + 8 | 0; + $1197 = $14 + 16 | 0; + $1198 = $14 + 24 | 0; + $1199 = $14 + 32 | 0; + $1200 = $14 + 40 | 0; + $1201 = ($0 | 0) == 1; + $$101505 = 0; + while (1) { + if (($$101505 | 0) >= ($$31471 | 0)) break L24; + $1207 = $1190 + $106 * (+($$101505 | 0) + .5) / $1191; + $$111485 = 0; + while (1) { + if (($$111485 | 0) >= ($spec$select1520 | 0)) break; + $1213 = $1190 + $106 * (+($$111485 | 0) + .5) / $1192; + $1220 = +HEAPF64[$1195 >> 3] + ($1213 * +HEAPF64[$1193 >> 3] + $1207 * +HEAPF64[$1194 >> 3]); + if ($1220 == 0.0) { + $2263 = $110; + label = 306; + break L19; + } + $1230 = (+HEAPF64[$1197 >> 3] + ($1213 * +HEAPF64[$14 >> 3] + $1207 * +HEAPF64[$1196 >> 3])) / $1220; + HEAPF32[$15 >> 2] = $1230; + $1239 = (+HEAPF64[$1200 >> 3] + ($1213 * +HEAPF64[$1198 >> 3] + $1207 * +HEAPF64[$1199 >> 3])) / $1220; + HEAPF32[$16 >> 2] = $1239; + _arParamIdeal2ObservLTf($8, $1230, $1239, $15, $16) | 0; + $1240 = +HEAPF32[$15 >> 2]; + if ($1201) { + $$10 = ((~~($1240 + 1.0) | 0) / 2 | 0) << 1; + $$101453 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$10 = ~~($1240 + .5); + $$101453 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$10 | 0) > -1 ? ($$101453 | 0) < ($6 | 0) & (($$101453 | 0) > -1 & ($$10 | 0) < ($5 | 0)) : 0) { + $1261 = (Math_imul($$101453, $5) | 0) + $$10 << 1; + $1264 = HEAP8[$4 + ($1261 | 1) >> 0] | 0; + $1272 = ((Math_imul(($$101505 | 0) / ($102 | 0) | 0, $2) | 0) + (($$111485 | 0) / ($101 | 0) | 0) | 0) * 3 | 0; + $1273 = $110 + ($1272 << 2) | 0; + HEAP32[$1273 >> 2] = (HEAP32[$1273 >> 2] | 0) + (($1264 << 2 & 255 | 4) & 255); + $1277 = HEAP8[$4 + $1261 >> 0] | 0; + $1286 = $110 + ($1272 + 1 << 2) | 0; + HEAP32[$1286 >> 2] = (($1264 & -64 & 255) >>> 3 | $1277 << 5 & 255 | 4) + (HEAP32[$1286 >> 2] | 0); + $1293 = $110 + ($1272 + 2 << 2) | 0; + HEAP32[$1293 >> 2] = (HEAP32[$1293 >> 2] | 0) + (($1277 & -8 | 4) & 255); + } + $$111485 = $$111485 + 1 | 0; + } + $$101505 = $$101505 + 1 | 0; + } + break; + } + case 11: + { + $1298 = $105 + 100.0; + $1299 = +($$31471 | 0); + $1300 = +($spec$select1520 | 0); + $1301 = $14 + 48 | 0; + $1302 = $14 + 56 | 0; + $1303 = $14 + 64 | 0; + $1304 = $14 + 8 | 0; + $1305 = $14 + 16 | 0; + $1306 = $14 + 24 | 0; + $1307 = $14 + 32 | 0; + $1308 = $14 + 40 | 0; + $1309 = ($0 | 0) == 1; + $$111506 = 0; + while (1) { + if (($$111506 | 0) >= ($$31471 | 0)) break L24; + $1315 = $1298 + $106 * (+($$111506 | 0) + .5) / $1299; + $$121486 = 0; + while (1) { + if (($$121486 | 0) >= ($spec$select1520 | 0)) break; + $1321 = $1298 + $106 * (+($$121486 | 0) + .5) / $1300; + $1328 = +HEAPF64[$1303 >> 3] + ($1321 * +HEAPF64[$1301 >> 3] + $1315 * +HEAPF64[$1302 >> 3]); + if ($1328 == 0.0) { + $2263 = $110; + label = 306; + break L19; + } + $1338 = (+HEAPF64[$1305 >> 3] + ($1321 * +HEAPF64[$14 >> 3] + $1315 * +HEAPF64[$1304 >> 3])) / $1328; + HEAPF32[$15 >> 2] = $1338; + $1347 = (+HEAPF64[$1308 >> 3] + ($1321 * +HEAPF64[$1306 >> 3] + $1315 * +HEAPF64[$1307 >> 3])) / $1328; + HEAPF32[$16 >> 2] = $1347; + _arParamIdeal2ObservLTf($8, $1338, $1347, $15, $16) | 0; + $1348 = +HEAPF32[$15 >> 2]; + if ($1309) { + $$11 = ((~~($1348 + 1.0) | 0) / 2 | 0) << 1; + $$111454 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$11 = ~~($1348 + .5); + $$111454 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$11 | 0) > -1 ? ($$111454 | 0) < ($6 | 0) & (($$111454 | 0) > -1 & ($$11 | 0) < ($5 | 0)) : 0) { + $1369 = (Math_imul($$111454, $5) | 0) + $$11 << 1; + $1380 = ((Math_imul(($$111506 | 0) / ($102 | 0) | 0, $2) | 0) + (($$121486 | 0) / ($101 | 0) | 0) | 0) * 3 | 0; + $1381 = $110 + ($1380 << 2) | 0; + HEAP32[$1381 >> 2] = (HEAP32[$1381 >> 2] | 0) + ((HEAP8[$4 + ($1369 | 1) >> 0] & -16 | 8) & 255); + $1385 = HEAP8[$4 + $1369 >> 0] | 0; + $1390 = $110 + ($1380 + 1 << 2) | 0; + HEAP32[$1390 >> 2] = (HEAP32[$1390 >> 2] | 0) + (($1385 << 4 & 255 | 8) & 255); + $1397 = $110 + ($1380 + 2 << 2) | 0; + HEAP32[$1397 >> 2] = (HEAP32[$1397 >> 2] | 0) + (($1385 & -16 | 8) & 255); + } + $$121486 = $$121486 + 1 | 0; + } + $$111506 = $$111506 + 1 | 0; + } + break; + } + default: + { + _arLog(0, 3, 24238, $vararg_buffer1); + $2263 = $110; + label = 306; + break L19; + } + } while (0); + $1402 = Math_imul($102, $101) | 0; + $$131487 = 0; + while (1) { + if (($$131487 | 0) == ($109 | 0)) break; + HEAP8[$11 + $$131487 >> 0] = ((HEAP32[$110 + ($$131487 << 2) >> 2] | 0) >>> 0) / ($1402 >>> 0) | 0; + $$131487 = $$131487 + 1 | 0; + } + _free($110); + $$0 = 0; + } else { + $1409 = _calloc($108, 4) | 0; + if (!$1409) { + _arLog(0, 3, 45930, $vararg_buffer3); + _exit(1); + } + L239 : do if ($7 >>> 0 < 2) { + $1412 = $105 + 100.0; + $1413 = +($$31471 | 0); + $1414 = +($spec$select1520 | 0); + $1415 = $14 + 48 | 0; + $1416 = $14 + 56 | 0; + $1417 = $14 + 64 | 0; + $1418 = $14 + 8 | 0; + $1419 = $14 + 16 | 0; + $1420 = $14 + 24 | 0; + $1421 = $14 + 32 | 0; + $1422 = $14 + 40 | 0; + $1423 = ($0 | 0) == 1; + $$121507 = 0; + while (1) { + if (($$121507 | 0) >= ($$31471 | 0)) break L239; + $1429 = $1412 + $106 * (+($$121507 | 0) + .5) / $1413; + $$141488 = 0; + while (1) { + if (($$141488 | 0) >= ($spec$select1520 | 0)) break; + $1435 = $1412 + $106 * (+($$141488 | 0) + .5) / $1414; + $1442 = +HEAPF64[$1417 >> 3] + ($1435 * +HEAPF64[$1415 >> 3] + $1429 * +HEAPF64[$1416 >> 3]); + if ($1442 == 0.0) { + $2263 = $1409; + label = 306; + break L19; + } + $1452 = (+HEAPF64[$1419 >> 3] + ($1435 * +HEAPF64[$14 >> 3] + $1429 * +HEAPF64[$1418 >> 3])) / $1442; + HEAPF32[$15 >> 2] = $1452; + $1461 = (+HEAPF64[$1422 >> 3] + ($1435 * +HEAPF64[$1420 >> 3] + $1429 * +HEAPF64[$1421 >> 3])) / $1442; + HEAPF32[$16 >> 2] = $1461; + _arParamIdeal2ObservLTf($8, $1452, $1461, $15, $16) | 0; + $1462 = +HEAPF32[$15 >> 2]; + if ($1423) { + $$12 = ((~~($1462 + 1.0) | 0) / 2 | 0) << 1; + $$121455 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$12 = ~~($1462 + .5); + $$121455 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$12 | 0) > -1 ? ($$121455 | 0) < ($6 | 0) & (($$121455 | 0) > -1 & ($$12 | 0) < ($5 | 0)) : 0) { + $1483 = ((Math_imul($$121455, $5) | 0) + $$12 | 0) * 3 | 0; + $1502 = $1409 + ((Math_imul(($$121507 | 0) / ($102 | 0) | 0, $2) | 0) + (($$141488 | 0) / ($101 | 0) | 0) << 2) | 0; + HEAP32[$1502 >> 2] = (HEAP32[$1502 >> 2] | 0) + ((((HEAPU8[$4 + ($1483 + 1) >> 0] | 0) + (HEAPU8[$4 + $1483 >> 0] | 0) + (HEAPU8[$4 + ($1483 + 2) >> 0] | 0) | 0) >>> 0) / 3 | 0); + } + $$141488 = $$141488 + 1 | 0; + } + $$121507 = $$121507 + 1 | 0; + } + } else { + if (($7 | 1 | 0) == 3) { + $1509 = $105 + 100.0; + $1510 = +($$31471 | 0); + $1511 = +($spec$select1520 | 0); + $1512 = $14 + 48 | 0; + $1513 = $14 + 56 | 0; + $1514 = $14 + 64 | 0; + $1515 = $14 + 8 | 0; + $1516 = $14 + 16 | 0; + $1517 = $14 + 24 | 0; + $1518 = $14 + 32 | 0; + $1519 = $14 + 40 | 0; + $1520 = ($0 | 0) == 1; + $$131508 = 0; + while (1) { + if (($$131508 | 0) >= ($$31471 | 0)) break L239; + $1526 = $1509 + $106 * (+($$131508 | 0) + .5) / $1510; + $$151489 = 0; + while (1) { + if (($$151489 | 0) >= ($spec$select1520 | 0)) break; + $1532 = $1509 + $106 * (+($$151489 | 0) + .5) / $1511; + $1539 = +HEAPF64[$1514 >> 3] + ($1532 * +HEAPF64[$1512 >> 3] + $1526 * +HEAPF64[$1513 >> 3]); + if ($1539 == 0.0) { + $2263 = $1409; + label = 306; + break L19; + } + $1549 = (+HEAPF64[$1516 >> 3] + ($1532 * +HEAPF64[$14 >> 3] + $1526 * +HEAPF64[$1515 >> 3])) / $1539; + HEAPF32[$15 >> 2] = $1549; + $1558 = (+HEAPF64[$1519 >> 3] + ($1532 * +HEAPF64[$1517 >> 3] + $1526 * +HEAPF64[$1518 >> 3])) / $1539; + HEAPF32[$16 >> 2] = $1558; + _arParamIdeal2ObservLTf($8, $1549, $1558, $15, $16) | 0; + $1559 = +HEAPF32[$15 >> 2]; + if ($1520) { + $$13 = ((~~($1559 + 1.0) | 0) / 2 | 0) << 1; + $$131456 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$13 = ~~($1559 + .5); + $$131456 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$13 | 0) > -1 ? ($$131456 | 0) < ($6 | 0) & (($$131456 | 0) > -1 & ($$13 | 0) < ($5 | 0)) : 0) { + $1580 = (Math_imul($$131456, $5) | 0) + $$13 << 2; + $1599 = $1409 + ((Math_imul(($$131508 | 0) / ($102 | 0) | 0, $2) | 0) + (($$151489 | 0) / ($101 | 0) | 0) << 2) | 0; + HEAP32[$1599 >> 2] = (HEAP32[$1599 >> 2] | 0) + ((((HEAPU8[$4 + ($1580 | 1) >> 0] | 0) + (HEAPU8[$4 + $1580 >> 0] | 0) + (HEAPU8[$4 + ($1580 | 2) >> 0] | 0) | 0) >>> 0) / 3 | 0); + } + $$151489 = $$151489 + 1 | 0; + } + $$131508 = $$131508 + 1 | 0; + } + } + if (($7 | 2 | 0) == 6) { + $1606 = $105 + 100.0; + $1607 = +($$31471 | 0); + $1608 = +($spec$select1520 | 0); + $1609 = $14 + 48 | 0; + $1610 = $14 + 56 | 0; + $1611 = $14 + 64 | 0; + $1612 = $14 + 8 | 0; + $1613 = $14 + 16 | 0; + $1614 = $14 + 24 | 0; + $1615 = $14 + 32 | 0; + $1616 = $14 + 40 | 0; + $1617 = ($0 | 0) == 1; + $$141509 = 0; + while (1) { + if (($$141509 | 0) >= ($$31471 | 0)) break L239; + $1623 = $1606 + $106 * (+($$141509 | 0) + .5) / $1607; + $$161490 = 0; + while (1) { + if (($$161490 | 0) >= ($spec$select1520 | 0)) break; + $1629 = $1606 + $106 * (+($$161490 | 0) + .5) / $1608; + $1636 = +HEAPF64[$1611 >> 3] + ($1629 * +HEAPF64[$1609 >> 3] + $1623 * +HEAPF64[$1610 >> 3]); + if ($1636 == 0.0) { + $2263 = $1409; + label = 306; + break L19; + } + $1646 = (+HEAPF64[$1613 >> 3] + ($1629 * +HEAPF64[$14 >> 3] + $1623 * +HEAPF64[$1612 >> 3])) / $1636; + HEAPF32[$15 >> 2] = $1646; + $1655 = (+HEAPF64[$1616 >> 3] + ($1629 * +HEAPF64[$1614 >> 3] + $1623 * +HEAPF64[$1615 >> 3])) / $1636; + HEAPF32[$16 >> 2] = $1655; + _arParamIdeal2ObservLTf($8, $1646, $1655, $15, $16) | 0; + $1656 = +HEAPF32[$15 >> 2]; + if ($1617) { + $$14 = ((~~($1656 + 1.0) | 0) / 2 | 0) << 1; + $$141457 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$14 = ~~($1656 + .5); + $$141457 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$14 | 0) > -1 ? ($$141457 | 0) < ($6 | 0) & (($$141457 | 0) > -1 & ($$14 | 0) < ($5 | 0)) : 0) { + $1677 = (Math_imul($$141457, $5) | 0) + $$14 << 2; + $1697 = $1409 + ((Math_imul(($$141509 | 0) / ($102 | 0) | 0, $2) | 0) + (($$161490 | 0) / ($101 | 0) | 0) << 2) | 0; + HEAP32[$1697 >> 2] = (HEAP32[$1697 >> 2] | 0) + ((((HEAPU8[$4 + ($1677 | 2) >> 0] | 0) + (HEAPU8[$4 + ($1677 | 1) >> 0] | 0) + (HEAPU8[$4 + ($1677 | 3) >> 0] | 0) | 0) >>> 0) / 3 | 0); + } + $$161490 = $$161490 + 1 | 0; + } + $$141509 = $$141509 + 1 | 0; + } + } + switch ($7 | 0) { + case 5: + case 12: + case 13: + case 14: + { + $1702 = $105 + 100.0; + $1703 = +($$31471 | 0); + $1704 = +($spec$select1520 | 0); + $1705 = $14 + 48 | 0; + $1706 = $14 + 56 | 0; + $1707 = $14 + 64 | 0; + $1708 = $14 + 8 | 0; + $1709 = $14 + 16 | 0; + $1710 = $14 + 24 | 0; + $1711 = $14 + 32 | 0; + $1712 = $14 + 40 | 0; + $1713 = ($0 | 0) == 1; + $$151510 = 0; + while (1) { + if (($$151510 | 0) >= ($$31471 | 0)) break L239; + $1719 = $1702 + $106 * (+($$151510 | 0) + .5) / $1703; + $$171491 = 0; + while (1) { + if (($$171491 | 0) >= ($spec$select1520 | 0)) break; + $1725 = $1702 + $106 * (+($$171491 | 0) + .5) / $1704; + $1732 = +HEAPF64[$1707 >> 3] + ($1725 * +HEAPF64[$1705 >> 3] + $1719 * +HEAPF64[$1706 >> 3]); + if ($1732 == 0.0) { + $2263 = $1409; + label = 306; + break L19; + } + $1742 = (+HEAPF64[$1709 >> 3] + ($1725 * +HEAPF64[$14 >> 3] + $1719 * +HEAPF64[$1708 >> 3])) / $1732; + HEAPF32[$15 >> 2] = $1742; + $1751 = (+HEAPF64[$1712 >> 3] + ($1725 * +HEAPF64[$1710 >> 3] + $1719 * +HEAPF64[$1711 >> 3])) / $1732; + HEAPF32[$16 >> 2] = $1751; + _arParamIdeal2ObservLTf($8, $1742, $1751, $15, $16) | 0; + $1752 = +HEAPF32[$15 >> 2]; + if ($1713) { + $$15 = ((~~($1752 + 1.0) | 0) / 2 | 0) << 1; + $$151458 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$15 = ~~($1752 + .5); + $$151458 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$15 | 0) > -1 ? ($$151458 | 0) < ($6 | 0) & (($$151458 | 0) > -1 & ($$15 | 0) < ($5 | 0)) : 0) { + $1773 = $4 + ((Math_imul($$151458, $5) | 0) + $$15) | 0; + $1780 = $1409 + ((Math_imul(($$151510 | 0) / ($102 | 0) | 0, $2) | 0) + (($$171491 | 0) / ($101 | 0) | 0) << 2) | 0; + HEAP32[$1780 >> 2] = (HEAP32[$1780 >> 2] | 0) + (HEAPU8[$1773 >> 0] | 0); + } + $$171491 = $$171491 + 1 | 0; + } + $$151510 = $$151510 + 1 | 0; + } + break; + } + case 7: + { + $1785 = $105 + 100.0; + $1786 = +($$31471 | 0); + $1787 = +($spec$select1520 | 0); + $1788 = $14 + 48 | 0; + $1789 = $14 + 56 | 0; + $1790 = $14 + 64 | 0; + $1791 = $14 + 8 | 0; + $1792 = $14 + 16 | 0; + $1793 = $14 + 24 | 0; + $1794 = $14 + 32 | 0; + $1795 = $14 + 40 | 0; + $1796 = ($0 | 0) == 1; + $$161511 = 0; + while (1) { + if (($$161511 | 0) >= ($$31471 | 0)) break L239; + $1802 = $1785 + $106 * (+($$161511 | 0) + .5) / $1786; + $$181492 = 0; + while (1) { + if (($$181492 | 0) >= ($spec$select1520 | 0)) break; + $1808 = $1785 + $106 * (+($$181492 | 0) + .5) / $1787; + $1815 = +HEAPF64[$1790 >> 3] + ($1808 * +HEAPF64[$1788 >> 3] + $1802 * +HEAPF64[$1789 >> 3]); + if ($1815 == 0.0) { + $2263 = $1409; + label = 306; + break L19; + } + $1825 = (+HEAPF64[$1792 >> 3] + ($1808 * +HEAPF64[$14 >> 3] + $1802 * +HEAPF64[$1791 >> 3])) / $1815; + HEAPF32[$15 >> 2] = $1825; + $1834 = (+HEAPF64[$1795 >> 3] + ($1808 * +HEAPF64[$1793 >> 3] + $1802 * +HEAPF64[$1794 >> 3])) / $1815; + HEAPF32[$16 >> 2] = $1834; + _arParamIdeal2ObservLTf($8, $1825, $1834, $15, $16) | 0; + $1835 = +HEAPF32[$15 >> 2]; + if ($1796) { + $$16 = ((~~($1835 + 1.0) | 0) / 2 | 0) << 1; + $$161459 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$16 = ~~($1835 + .5); + $$161459 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$16 | 0) > -1 ? ($$161459 | 0) < ($6 | 0) & (($$161459 | 0) > -1 & ($$16 | 0) < ($5 | 0)) : 0) { + $1858 = $4 + ((Math_imul($$161459, $5) | 0) + $$16 << 1 | 1) | 0; + $1865 = $1409 + ((Math_imul(($$161511 | 0) / ($102 | 0) | 0, $2) | 0) + (($$181492 | 0) / ($101 | 0) | 0) << 2) | 0; + HEAP32[$1865 >> 2] = (HEAP32[$1865 >> 2] | 0) + (HEAPU8[$1858 >> 0] | 0); + } + $$181492 = $$181492 + 1 | 0; + } + $$161511 = $$161511 + 1 | 0; + } + break; + } + case 8: + { + $1870 = $105 + 100.0; + $1871 = +($$31471 | 0); + $1872 = +($spec$select1520 | 0); + $1873 = $14 + 48 | 0; + $1874 = $14 + 56 | 0; + $1875 = $14 + 64 | 0; + $1876 = $14 + 8 | 0; + $1877 = $14 + 16 | 0; + $1878 = $14 + 24 | 0; + $1879 = $14 + 32 | 0; + $1880 = $14 + 40 | 0; + $1881 = ($0 | 0) == 1; + $$171512 = 0; + while (1) { + if (($$171512 | 0) >= ($$31471 | 0)) break L239; + $1887 = $1870 + $106 * (+($$171512 | 0) + .5) / $1871; + $$191493 = 0; + while (1) { + if (($$191493 | 0) >= ($spec$select1520 | 0)) break; + $1893 = $1870 + $106 * (+($$191493 | 0) + .5) / $1872; + $1900 = +HEAPF64[$1875 >> 3] + ($1893 * +HEAPF64[$1873 >> 3] + $1887 * +HEAPF64[$1874 >> 3]); + if ($1900 == 0.0) { + $2263 = $1409; + label = 306; + break L19; + } + $1910 = (+HEAPF64[$1877 >> 3] + ($1893 * +HEAPF64[$14 >> 3] + $1887 * +HEAPF64[$1876 >> 3])) / $1900; + HEAPF32[$15 >> 2] = $1910; + $1919 = (+HEAPF64[$1880 >> 3] + ($1893 * +HEAPF64[$1878 >> 3] + $1887 * +HEAPF64[$1879 >> 3])) / $1900; + HEAPF32[$16 >> 2] = $1919; + _arParamIdeal2ObservLTf($8, $1910, $1919, $15, $16) | 0; + $1920 = +HEAPF32[$15 >> 2]; + if ($1881) { + $$17 = ((~~($1920 + 1.0) | 0) / 2 | 0) << 1; + $$171460 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$17 = ~~($1920 + .5); + $$171460 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$17 | 0) > -1 ? ($$171460 | 0) < ($6 | 0) & (($$171460 | 0) > -1 & ($$17 | 0) < ($5 | 0)) : 0) { + $1942 = $4 + ((Math_imul($$171460, $5) | 0) + $$17 << 1) | 0; + $1949 = $1409 + ((Math_imul(($$171512 | 0) / ($102 | 0) | 0, $2) | 0) + (($$191493 | 0) / ($101 | 0) | 0) << 2) | 0; + HEAP32[$1949 >> 2] = (HEAP32[$1949 >> 2] | 0) + (HEAPU8[$1942 >> 0] | 0); + } + $$191493 = $$191493 + 1 | 0; + } + $$171512 = $$171512 + 1 | 0; + } + break; + } + case 9: + { + $1954 = $105 + 100.0; + $1955 = +($$31471 | 0); + $1956 = +($spec$select1520 | 0); + $1957 = $14 + 48 | 0; + $1958 = $14 + 56 | 0; + $1959 = $14 + 64 | 0; + $1960 = $14 + 8 | 0; + $1961 = $14 + 16 | 0; + $1962 = $14 + 24 | 0; + $1963 = $14 + 32 | 0; + $1964 = $14 + 40 | 0; + $1965 = ($0 | 0) == 1; + $$181513 = 0; + while (1) { + if (($$181513 | 0) >= ($$31471 | 0)) break L239; + $1971 = $1954 + $106 * (+($$181513 | 0) + .5) / $1955; + $$201494 = 0; + while (1) { + if (($$201494 | 0) >= ($spec$select1520 | 0)) break; + $1977 = $1954 + $106 * (+($$201494 | 0) + .5) / $1956; + $1984 = +HEAPF64[$1959 >> 3] + ($1977 * +HEAPF64[$1957 >> 3] + $1971 * +HEAPF64[$1958 >> 3]); + if ($1984 == 0.0) { + $2263 = $1409; + label = 306; + break L19; + } + $1994 = (+HEAPF64[$1961 >> 3] + ($1977 * +HEAPF64[$14 >> 3] + $1971 * +HEAPF64[$1960 >> 3])) / $1984; + HEAPF32[$15 >> 2] = $1994; + $2003 = (+HEAPF64[$1964 >> 3] + ($1977 * +HEAPF64[$1962 >> 3] + $1971 * +HEAPF64[$1963 >> 3])) / $1984; + HEAPF32[$16 >> 2] = $2003; + _arParamIdeal2ObservLTf($8, $1994, $2003, $15, $16) | 0; + $2004 = +HEAPF32[$15 >> 2]; + if ($1965) { + $$18 = ((~~($2004 + 1.0) | 0) / 2 | 0) << 1; + $$181461 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$18 = ~~($2004 + .5); + $$181461 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$18 | 0) > -1 ? ($$181461 | 0) < ($6 | 0) & (($$181461 | 0) > -1 & ($$18 | 0) < ($5 | 0)) : 0) { + $2025 = (Math_imul($$181461, $5) | 0) + $$18 << 1; + $2028 = HEAPU8[$4 + $2025 >> 0] | 0; + $2036 = HEAPU8[$4 + ($2025 | 1) >> 0] | 0; + $2051 = $1409 + ((Math_imul(($$181513 | 0) / ($102 | 0) | 0, $2) | 0) + (($$201494 | 0) / ($101 | 0) | 0) << 2) | 0; + HEAP32[$2051 >> 2] = (((($2028 << 5 & 224 | $2036 >>> 3 & 28 | 2) + ($2028 & 248 | 4) + ($2036 << 3 & 248 | 4) | 0) >>> 0) / 3 | 0) + (HEAP32[$2051 >> 2] | 0); + } + $$201494 = $$201494 + 1 | 0; + } + $$181513 = $$181513 + 1 | 0; + } + break; + } + case 10: + { + $2056 = $105 + 100.0; + $2057 = +($$31471 | 0); + $2058 = +($spec$select1520 | 0); + $2059 = $14 + 48 | 0; + $2060 = $14 + 56 | 0; + $2061 = $14 + 64 | 0; + $2062 = $14 + 8 | 0; + $2063 = $14 + 16 | 0; + $2064 = $14 + 24 | 0; + $2065 = $14 + 32 | 0; + $2066 = $14 + 40 | 0; + $2067 = ($0 | 0) == 1; + $$191514 = 0; + while (1) { + if (($$191514 | 0) >= ($$31471 | 0)) break L239; + $2073 = $2056 + $106 * (+($$191514 | 0) + .5) / $2057; + $$21 = 0; + while (1) { + if (($$21 | 0) >= ($spec$select1520 | 0)) break; + $2079 = $2056 + $106 * (+($$21 | 0) + .5) / $2058; + $2086 = +HEAPF64[$2061 >> 3] + ($2079 * +HEAPF64[$2059 >> 3] + $2073 * +HEAPF64[$2060 >> 3]); + if ($2086 == 0.0) { + $2263 = $1409; + label = 306; + break L19; + } + $2096 = (+HEAPF64[$2063 >> 3] + ($2079 * +HEAPF64[$14 >> 3] + $2073 * +HEAPF64[$2062 >> 3])) / $2086; + HEAPF32[$15 >> 2] = $2096; + $2105 = (+HEAPF64[$2066 >> 3] + ($2079 * +HEAPF64[$2064 >> 3] + $2073 * +HEAPF64[$2065 >> 3])) / $2086; + HEAPF32[$16 >> 2] = $2105; + _arParamIdeal2ObservLTf($8, $2096, $2105, $15, $16) | 0; + $2106 = +HEAPF32[$15 >> 2]; + if ($2067) { + $$19 = ((~~($2106 + 1.0) | 0) / 2 | 0) << 1; + $$191462 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$19 = ~~($2106 + .5); + $$191462 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$19 | 0) > -1 ? ($$191462 | 0) < ($6 | 0) & (($$191462 | 0) > -1 & ($$19 | 0) < ($5 | 0)) : 0) { + $2127 = (Math_imul($$191462, $5) | 0) + $$19 << 1; + $2130 = HEAPU8[$4 + $2127 >> 0] | 0; + $2138 = HEAPU8[$4 + ($2127 | 1) >> 0] | 0; + $2153 = $1409 + ((Math_imul(($$191514 | 0) / ($102 | 0) | 0, $2) | 0) + (($$21 | 0) / ($101 | 0) | 0) << 2) | 0; + HEAP32[$2153 >> 2] = (((($2130 << 5 & 224 | $2138 >>> 3 & 24 | 4) + ($2130 & 248 | 4) + ($2138 << 2 & 248 | 4) | 0) >>> 0) / 3 | 0) + (HEAP32[$2153 >> 2] | 0); + } + $$21 = $$21 + 1 | 0; + } + $$191514 = $$191514 + 1 | 0; + } + break; + } + case 11: + { + $2158 = $105 + 100.0; + $2159 = +($$31471 | 0); + $2160 = +($spec$select1520 | 0); + $2161 = $14 + 48 | 0; + $2162 = $14 + 56 | 0; + $2163 = $14 + 64 | 0; + $2164 = $14 + 8 | 0; + $2165 = $14 + 16 | 0; + $2166 = $14 + 24 | 0; + $2167 = $14 + 32 | 0; + $2168 = $14 + 40 | 0; + $2169 = ($0 | 0) == 1; + $$201515 = 0; + while (1) { + if (($$201515 | 0) >= ($$31471 | 0)) break L239; + $2175 = $2158 + $106 * (+($$201515 | 0) + .5) / $2159; + $$22 = 0; + while (1) { + if (($$22 | 0) >= ($spec$select1520 | 0)) break; + $2181 = $2158 + $106 * (+($$22 | 0) + .5) / $2160; + $2188 = +HEAPF64[$2163 >> 3] + ($2181 * +HEAPF64[$2161 >> 3] + $2175 * +HEAPF64[$2162 >> 3]); + if ($2188 == 0.0) { + $2263 = $1409; + label = 306; + break L19; + } + $2198 = (+HEAPF64[$2165 >> 3] + ($2181 * +HEAPF64[$14 >> 3] + $2175 * +HEAPF64[$2164 >> 3])) / $2188; + HEAPF32[$15 >> 2] = $2198; + $2207 = (+HEAPF64[$2168 >> 3] + ($2181 * +HEAPF64[$2166 >> 3] + $2175 * +HEAPF64[$2167 >> 3])) / $2188; + HEAPF32[$16 >> 2] = $2207; + _arParamIdeal2ObservLTf($8, $2198, $2207, $15, $16) | 0; + $2208 = +HEAPF32[$15 >> 2]; + if ($2169) { + $$20 = ((~~($2208 + 1.0) | 0) / 2 | 0) << 1; + $$201463 = ((~~(+HEAPF32[$16 >> 2] + 1.0) | 0) / 2 | 0) << 1; + } else { + $$20 = ~~($2208 + .5); + $$201463 = ~~(+HEAPF32[$16 >> 2] + .5); + } + if (($$20 | 0) > -1 ? ($$201463 | 0) < ($6 | 0) & (($$201463 | 0) > -1 & ($$20 | 0) < ($5 | 0)) : 0) { + $2229 = (Math_imul($$201463, $5) | 0) + $$20 << 1; + $2232 = HEAPU8[$4 + $2229 >> 0] | 0; + $2251 = $1409 + ((Math_imul(($$201515 | 0) / ($102 | 0) | 0, $2) | 0) + (($$22 | 0) / ($101 | 0) | 0) << 2) | 0; + HEAP32[$2251 >> 2] = (((($2232 << 4 & 240 | 8) + ($2232 & 240 | 8) + ((HEAP8[$4 + ($2229 | 1) >> 0] & -16 | 8) & 255) | 0) >>> 0) / 3 | 0) + (HEAP32[$2251 >> 2] | 0); + } + $$22 = $$22 + 1 | 0; + } + $$201515 = $$201515 + 1 | 0; + } + break; + } + default: + { + _arLog(0, 3, 24238, $vararg_buffer5); + $2263 = $1409; + label = 306; + break L19; + } + } + } while (0); + $2256 = Math_imul($102, $101) | 0; + $$23 = 0; + while (1) { + if (($$23 | 0) == ($108 | 0)) break; + HEAP8[$11 + $$23 >> 0] = ((HEAP32[$1409 + ($$23 << 2) >> 2] | 0) >>> 0) / ($2256 >>> 0) | 0; + $$23 = $$23 + 1 | 0; + } + _free($1409); + $$0 = 0; + } while (0); + if ((label | 0) == 306) { + _free($2263); + $$0 = -1; + } + STACKTOP = sp; + return $$0 | 0; +} +function _malloc($0) { + $0 = $0 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i = 0, $$0$i16$i = 0, $$0187$i = 0, $$0189$i = 0, $$0190$i = 0, $$0191$i = 0, $$0197 = 0, $$0199 = 0, $$02065$i$i = 0, $$0207$lcssa$i$i = 0, $$02074$i$i = 0, $$0211$i$i = 0, $$0212$i$i = 0, $$024372$i = 0, $$0286$i$i = 0, $$028711$i$i = 0, $$0288$lcssa$i$i = 0, $$028810$i$i = 0, $$0294$i$i = 0, $$0295$i$i = 0, $$0340$i = 0, $$034217$i = 0, $$0343$lcssa$i = 0, $$034316$i = 0, $$0345$i = 0, $$0351$i = 0, $$0357$i = 0, $$0358$i = 0, $$0360$i = 0, $$0361$i = 0, $$0367$i = 0, $$1194$i = 0, $$1194$i$be = 0, $$1194$i$ph = 0, $$1196$i = 0, $$1196$i$be = 0, $$1196$i$ph = 0, $$124471$i = 0, $$1290$i$i = 0, $$1290$i$i$be = 0, $$1290$i$i$ph = 0, $$1292$i$i = 0, $$1292$i$i$be = 0, $$1292$i$i$ph = 0, $$1341$i = 0, $$1346$i = 0, $$1362$i = 0, $$1369$i = 0, $$1369$i$be = 0, $$1369$i$ph = 0, $$1373$i = 0, $$1373$i$be = 0, $$1373$i$ph = 0, $$2234243136$i = 0, $$2247$ph$i = 0, $$2253$ph$i = 0, $$2353$i = 0, $$3$i = 0, $$3$i$i = 0, $$3$i203 = 0, $$3$i203218 = 0, $$3348$i = 0, $$3371$i = 0, $$4$lcssa$i = 0, $$420$i = 0, $$420$i$ph = 0, $$4236$i = 0, $$4349$lcssa$i = 0, $$434919$i = 0, $$434919$i$ph = 0, $$4355$i = 0, $$535618$i = 0, $$535618$i$ph = 0, $$723947$i = 0, $$748$i = 0, $$pre$phi$i$iZ2D = 0, $$pre$phi$i18$iZ2D = 0, $$pre$phi$i209Z2D = 0, $$pre$phi$iZ2D = 0, $$pre$phi17$i$iZ2D = 0, $$pre$phiZ2D = 0, $1 = 0, $1000 = 0, $1003 = 0, $1008 = 0, $101 = 0, $1014 = 0, $1017 = 0, $1018 = 0, $102 = 0, $1025 = 0, $1037 = 0, $1042 = 0, $1049 = 0, $1050 = 0, $1051 = 0, $1060 = 0, $1062 = 0, $1063 = 0, $1064 = 0, $1070 = 0, $108 = 0, $112 = 0, $114 = 0, $115 = 0, $117 = 0, $119 = 0, $121 = 0, $123 = 0, $125 = 0, $127 = 0, $129 = 0, $134 = 0, $14 = 0, $140 = 0, $143 = 0, $146 = 0, $149 = 0, $150 = 0, $151 = 0, $153 = 0, $156 = 0, $158 = 0, $16 = 0, $161 = 0, $163 = 0, $166 = 0, $169 = 0, $17 = 0, $170 = 0, $172 = 0, $173 = 0, $175 = 0, $176 = 0, $178 = 0, $179 = 0, $18 = 0, $184 = 0, $185 = 0, $19 = 0, $193 = 0, $198 = 0, $20 = 0, $202 = 0, $208 = 0, $215 = 0, $219 = 0, $228 = 0, $229 = 0, $231 = 0, $232 = 0, $236 = 0, $237 = 0, $245 = 0, $246 = 0, $247 = 0, $249 = 0, $250 = 0, $255 = 0, $256 = 0, $259 = 0, $261 = 0, $264 = 0, $269 = 0, $27 = 0, $276 = 0, $286 = 0, $290 = 0, $299 = 0, $30 = 0, $302 = 0, $306 = 0, $308 = 0, $309 = 0, $311 = 0, $313 = 0, $315 = 0, $317 = 0, $319 = 0, $321 = 0, $323 = 0, $333 = 0, $334 = 0, $336 = 0, $34 = 0, $341 = 0, $346 = 0, $348 = 0, $351 = 0, $353 = 0, $356 = 0, $358 = 0, $361 = 0, $364 = 0, $365 = 0, $367 = 0, $368 = 0, $37 = 0, $370 = 0, $371 = 0, $373 = 0, $374 = 0, $379 = 0, $380 = 0, $385 = 0, $388 = 0, $393 = 0, $397 = 0, $403 = 0, $41 = 0, $410 = 0, $414 = 0, $422 = 0, $425 = 0, $426 = 0, $427 = 0, $431 = 0, $432 = 0, $438 = 0, $44 = 0, $443 = 0, $444 = 0, $447 = 0, $449 = 0, $452 = 0, $457 = 0, $463 = 0, $465 = 0, $467 = 0, $469 = 0, $47 = 0, $475 = 0, $487 = 0, $49 = 0, $492 = 0, $499 = 0, $50 = 0, $500 = 0, $501 = 0, $510 = 0, $512 = 0, $513 = 0, $515 = 0, $52 = 0, $524 = 0, $528 = 0, $530 = 0, $531 = 0, $532 = 0, $54 = 0, $543 = 0, $544 = 0, $545 = 0, $546 = 0, $547 = 0, $548 = 0, $550 = 0, $552 = 0, $553 = 0, $559 = 0, $56 = 0, $561 = 0, $568 = 0, $570 = 0, $572 = 0, $573 = 0, $574 = 0, $58 = 0, $582 = 0, $583 = 0, $586 = 0, $590 = 0, $593 = 0, $596 = 0, $6 = 0, $60 = 0, $602 = 0, $606 = 0, $610 = 0, $619 = 0, $62 = 0, $620 = 0, $626 = 0, $628 = 0, $632 = 0, $635 = 0, $637 = 0, $64 = 0, $641 = 0, $643 = 0, $648 = 0, $649 = 0, $650 = 0, $656 = 0, $658 = 0, $662 = 0, $664 = 0, $67 = 0, $673 = 0, $675 = 0, $680 = 0, $681 = 0, $682 = 0, $688 = 0, $69 = 0, $690 = 0, $694 = 0, $7 = 0, $70 = 0, $700 = 0, $704 = 0, $71 = 0, $710 = 0, $712 = 0, $718 = 0, $72 = 0, $722 = 0, $723 = 0, $728 = 0, $73 = 0, $734 = 0, $739 = 0, $742 = 0, $743 = 0, $746 = 0, $748 = 0, $750 = 0, $753 = 0, $764 = 0, $769 = 0, $77 = 0, $771 = 0, $774 = 0, $776 = 0, $779 = 0, $782 = 0, $783 = 0, $784 = 0, $786 = 0, $788 = 0, $789 = 0, $791 = 0, $792 = 0, $797 = 0, $798 = 0, $8 = 0, $80 = 0, $807 = 0, $812 = 0, $815 = 0, $816 = 0, $822 = 0, $83 = 0, $830 = 0, $836 = 0, $839 = 0, $84 = 0, $840 = 0, $841 = 0, $845 = 0, $846 = 0, $852 = 0, $857 = 0, $858 = 0, $861 = 0, $863 = 0, $866 = 0, $87 = 0, $871 = 0, $877 = 0, $879 = 0, $881 = 0, $882 = 0, $889 = 0, $9 = 0, $901 = 0, $906 = 0, $913 = 0, $914 = 0, $915 = 0, $92 = 0, $923 = 0, $927 = 0, $93 = 0, $931 = 0, $933 = 0, $939 = 0, $940 = 0, $942 = 0, $943 = 0, $945 = 0, $947 = 0, $95 = 0, $952 = 0, $953 = 0, $954 = 0, $96 = 0, $960 = 0, $962 = 0, $968 = 0, $973 = 0, $976 = 0, $977 = 0, $978 = 0, $98 = 0, $982 = 0, $983 = 0, $989 = 0, $994 = 0, $995 = 0, $998 = 0, $spec$select$i205 = 0, $spec$select3$i = 0, $spec$select49$i = 0, label = 0, sp = 0, $962$looptemp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + do if ($0 >>> 0 < 245) { + $6 = $0 >>> 0 < 11 ? 16 : $0 + 11 & -8; + $7 = $6 >>> 3; + $8 = HEAP32[16735] | 0; + $9 = $8 >>> $7; + if ($9 & 3 | 0) { + $14 = ($9 & 1 ^ 1) + $7 | 0; + $16 = 66980 + ($14 << 1 << 2) | 0; + $17 = $16 + 8 | 0; + $18 = HEAP32[$17 >> 2] | 0; + $19 = $18 + 8 | 0; + $20 = HEAP32[$19 >> 2] | 0; + do if (($20 | 0) != ($16 | 0)) { + if ((HEAP32[16739] | 0) >>> 0 > $20 >>> 0) _abort(); + $27 = $20 + 12 | 0; + if ((HEAP32[$27 >> 2] | 0) == ($18 | 0)) { + HEAP32[$27 >> 2] = $16; + HEAP32[$17 >> 2] = $20; + break; + } else _abort(); + } else HEAP32[16735] = $8 & ~(1 << $14); while (0); + $30 = $14 << 3; + HEAP32[$18 + 4 >> 2] = $30 | 3; + $34 = $18 + $30 + 4 | 0; + HEAP32[$34 >> 2] = HEAP32[$34 >> 2] | 1; + $$0 = $19; + STACKTOP = sp; + return $$0 | 0; + } + $37 = HEAP32[16737] | 0; + if ($6 >>> 0 > $37 >>> 0) { + if ($9 | 0) { + $41 = 2 << $7; + $44 = $9 << $7 & ($41 | 0 - $41); + $47 = ($44 & 0 - $44) + -1 | 0; + $49 = $47 >>> 12 & 16; + $50 = $47 >>> $49; + $52 = $50 >>> 5 & 8; + $54 = $50 >>> $52; + $56 = $54 >>> 2 & 4; + $58 = $54 >>> $56; + $60 = $58 >>> 1 & 2; + $62 = $58 >>> $60; + $64 = $62 >>> 1 & 1; + $67 = ($52 | $49 | $56 | $60 | $64) + ($62 >>> $64) | 0; + $69 = 66980 + ($67 << 1 << 2) | 0; + $70 = $69 + 8 | 0; + $71 = HEAP32[$70 >> 2] | 0; + $72 = $71 + 8 | 0; + $73 = HEAP32[$72 >> 2] | 0; + do if (($73 | 0) != ($69 | 0)) { + if ((HEAP32[16739] | 0) >>> 0 > $73 >>> 0) _abort(); + $80 = $73 + 12 | 0; + if ((HEAP32[$80 >> 2] | 0) == ($71 | 0)) { + HEAP32[$80 >> 2] = $69; + HEAP32[$70 >> 2] = $73; + $98 = $8; + break; + } else _abort(); + } else { + $77 = $8 & ~(1 << $67); + HEAP32[16735] = $77; + $98 = $77; + } while (0); + $83 = $67 << 3; + $84 = $83 - $6 | 0; + HEAP32[$71 + 4 >> 2] = $6 | 3; + $87 = $71 + $6 | 0; + HEAP32[$87 + 4 >> 2] = $84 | 1; + HEAP32[$71 + $83 >> 2] = $84; + if ($37 | 0) { + $92 = HEAP32[16740] | 0; + $93 = $37 >>> 3; + $95 = 66980 + ($93 << 1 << 2) | 0; + $96 = 1 << $93; + if ($98 & $96) { + $101 = $95 + 8 | 0; + $102 = HEAP32[$101 >> 2] | 0; + if ((HEAP32[16739] | 0) >>> 0 > $102 >>> 0) _abort(); else { + $$0199 = $102; + $$pre$phiZ2D = $101; + } + } else { + HEAP32[16735] = $98 | $96; + $$0199 = $95; + $$pre$phiZ2D = $95 + 8 | 0; + } + HEAP32[$$pre$phiZ2D >> 2] = $92; + HEAP32[$$0199 + 12 >> 2] = $92; + HEAP32[$92 + 8 >> 2] = $$0199; + HEAP32[$92 + 12 >> 2] = $95; + } + HEAP32[16737] = $84; + HEAP32[16740] = $87; + $$0 = $72; + STACKTOP = sp; + return $$0 | 0; + } + $108 = HEAP32[16736] | 0; + if ($108) { + $112 = ($108 & 0 - $108) + -1 | 0; + $114 = $112 >>> 12 & 16; + $115 = $112 >>> $114; + $117 = $115 >>> 5 & 8; + $119 = $115 >>> $117; + $121 = $119 >>> 2 & 4; + $123 = $119 >>> $121; + $125 = $123 >>> 1 & 2; + $127 = $123 >>> $125; + $129 = $127 >>> 1 & 1; + $134 = HEAP32[67244 + (($117 | $114 | $121 | $125 | $129) + ($127 >>> $129) << 2) >> 2] | 0; + $$0189$i = $134; + $$0190$i = $134; + $$0191$i = (HEAP32[$134 + 4 >> 2] & -8) - $6 | 0; + while (1) { + $140 = HEAP32[$$0189$i + 16 >> 2] | 0; + if (!$140) { + $143 = HEAP32[$$0189$i + 20 >> 2] | 0; + if (!$143) break; else $146 = $143; + } else $146 = $140; + $149 = (HEAP32[$146 + 4 >> 2] & -8) - $6 | 0; + $150 = $149 >>> 0 < $$0191$i >>> 0; + $$0189$i = $146; + $$0190$i = $150 ? $146 : $$0190$i; + $$0191$i = $150 ? $149 : $$0191$i; + } + $151 = HEAP32[16739] | 0; + if ($151 >>> 0 > $$0190$i >>> 0) _abort(); + $153 = $$0190$i + $6 | 0; + if ($153 >>> 0 <= $$0190$i >>> 0) _abort(); + $156 = HEAP32[$$0190$i + 24 >> 2] | 0; + $158 = HEAP32[$$0190$i + 12 >> 2] | 0; + do if (($158 | 0) == ($$0190$i | 0)) { + $169 = $$0190$i + 20 | 0; + $170 = HEAP32[$169 >> 2] | 0; + if (!$170) { + $172 = $$0190$i + 16 | 0; + $173 = HEAP32[$172 >> 2] | 0; + if (!$173) { + $$3$i = 0; + break; + } else { + $$1194$i$ph = $173; + $$1196$i$ph = $172; + } + } else { + $$1194$i$ph = $170; + $$1196$i$ph = $169; + } + $$1194$i = $$1194$i$ph; + $$1196$i = $$1196$i$ph; + while (1) { + $175 = $$1194$i + 20 | 0; + $176 = HEAP32[$175 >> 2] | 0; + if (!$176) { + $178 = $$1194$i + 16 | 0; + $179 = HEAP32[$178 >> 2] | 0; + if (!$179) break; else { + $$1194$i$be = $179; + $$1196$i$be = $178; + } + } else { + $$1194$i$be = $176; + $$1196$i$be = $175; + } + $$1194$i = $$1194$i$be; + $$1196$i = $$1196$i$be; + } + if ($151 >>> 0 > $$1196$i >>> 0) _abort(); else { + HEAP32[$$1196$i >> 2] = 0; + $$3$i = $$1194$i; + break; + } + } else { + $161 = HEAP32[$$0190$i + 8 >> 2] | 0; + if ($151 >>> 0 > $161 >>> 0) _abort(); + $163 = $161 + 12 | 0; + if ((HEAP32[$163 >> 2] | 0) != ($$0190$i | 0)) _abort(); + $166 = $158 + 8 | 0; + if ((HEAP32[$166 >> 2] | 0) == ($$0190$i | 0)) { + HEAP32[$163 >> 2] = $158; + HEAP32[$166 >> 2] = $161; + $$3$i = $158; + break; + } else _abort(); + } while (0); + L78 : do if ($156 | 0) { + $184 = HEAP32[$$0190$i + 28 >> 2] | 0; + $185 = 67244 + ($184 << 2) | 0; + do if (($$0190$i | 0) == (HEAP32[$185 >> 2] | 0)) { + HEAP32[$185 >> 2] = $$3$i; + if (!$$3$i) { + HEAP32[16736] = $108 & ~(1 << $184); + break L78; + } + } else if ((HEAP32[16739] | 0) >>> 0 <= $156 >>> 0) { + $193 = $156 + 16 | 0; + HEAP32[((HEAP32[$193 >> 2] | 0) == ($$0190$i | 0) ? $193 : $156 + 20 | 0) >> 2] = $$3$i; + if (!$$3$i) break L78; else break; + } else _abort(); while (0); + $198 = HEAP32[16739] | 0; + if ($198 >>> 0 > $$3$i >>> 0) _abort(); + HEAP32[$$3$i + 24 >> 2] = $156; + $202 = HEAP32[$$0190$i + 16 >> 2] | 0; + do if ($202 | 0) if ($198 >>> 0 > $202 >>> 0) _abort(); else { + HEAP32[$$3$i + 16 >> 2] = $202; + HEAP32[$202 + 24 >> 2] = $$3$i; + break; + } while (0); + $208 = HEAP32[$$0190$i + 20 >> 2] | 0; + if ($208 | 0) if ((HEAP32[16739] | 0) >>> 0 > $208 >>> 0) _abort(); else { + HEAP32[$$3$i + 20 >> 2] = $208; + HEAP32[$208 + 24 >> 2] = $$3$i; + break; + } + } while (0); + if ($$0191$i >>> 0 < 16) { + $215 = $$0191$i + $6 | 0; + HEAP32[$$0190$i + 4 >> 2] = $215 | 3; + $219 = $$0190$i + $215 + 4 | 0; + HEAP32[$219 >> 2] = HEAP32[$219 >> 2] | 1; + } else { + HEAP32[$$0190$i + 4 >> 2] = $6 | 3; + HEAP32[$153 + 4 >> 2] = $$0191$i | 1; + HEAP32[$153 + $$0191$i >> 2] = $$0191$i; + if ($37 | 0) { + $228 = HEAP32[16740] | 0; + $229 = $37 >>> 3; + $231 = 66980 + ($229 << 1 << 2) | 0; + $232 = 1 << $229; + if ($232 & $8) { + $236 = $231 + 8 | 0; + $237 = HEAP32[$236 >> 2] | 0; + if ((HEAP32[16739] | 0) >>> 0 > $237 >>> 0) _abort(); else { + $$0187$i = $237; + $$pre$phi$iZ2D = $236; + } + } else { + HEAP32[16735] = $232 | $8; + $$0187$i = $231; + $$pre$phi$iZ2D = $231 + 8 | 0; + } + HEAP32[$$pre$phi$iZ2D >> 2] = $228; + HEAP32[$$0187$i + 12 >> 2] = $228; + HEAP32[$228 + 8 >> 2] = $$0187$i; + HEAP32[$228 + 12 >> 2] = $231; + } + HEAP32[16737] = $$0191$i; + HEAP32[16740] = $153; + } + $$0 = $$0190$i + 8 | 0; + STACKTOP = sp; + return $$0 | 0; + } else $$0197 = $6; + } else $$0197 = $6; + } else if ($0 >>> 0 <= 4294967231) { + $245 = $0 + 11 | 0; + $246 = $245 & -8; + $247 = HEAP32[16736] | 0; + if ($247) { + $249 = 0 - $246 | 0; + $250 = $245 >>> 8; + if ($250) if ($246 >>> 0 > 16777215) $$0357$i = 31; else { + $255 = ($250 + 1048320 | 0) >>> 16 & 8; + $256 = $250 << $255; + $259 = ($256 + 520192 | 0) >>> 16 & 4; + $261 = $256 << $259; + $264 = ($261 + 245760 | 0) >>> 16 & 2; + $269 = 14 - ($259 | $255 | $264) + ($261 << $264 >>> 15) | 0; + $$0357$i = $246 >>> ($269 + 7 | 0) & 1 | $269 << 1; + } else $$0357$i = 0; + $276 = HEAP32[67244 + ($$0357$i << 2) >> 2] | 0; + L122 : do if (!$276) { + $$2353$i = 0; + $$3$i203 = 0; + $$3348$i = $249; + label = 85; + } else { + $$0340$i = 0; + $$0345$i = $249; + $$0351$i = $276; + $$0358$i = $246 << (($$0357$i | 0) == 31 ? 0 : 25 - ($$0357$i >>> 1) | 0); + $$0361$i = 0; + while (1) { + $286 = (HEAP32[$$0351$i + 4 >> 2] & -8) - $246 | 0; + if ($286 >>> 0 < $$0345$i >>> 0) if (!$286) { + $$420$i$ph = $$0351$i; + $$434919$i$ph = 0; + $$535618$i$ph = $$0351$i; + label = 89; + break L122; + } else { + $$1341$i = $$0351$i; + $$1346$i = $286; + } else { + $$1341$i = $$0340$i; + $$1346$i = $$0345$i; + } + $290 = HEAP32[$$0351$i + 20 >> 2] | 0; + $$0351$i = HEAP32[$$0351$i + 16 + ($$0358$i >>> 31 << 2) >> 2] | 0; + $$1362$i = ($290 | 0) == 0 | ($290 | 0) == ($$0351$i | 0) ? $$0361$i : $290; + if (!$$0351$i) { + $$2353$i = $$1362$i; + $$3$i203 = $$1341$i; + $$3348$i = $$1346$i; + label = 85; + break; + } else { + $$0340$i = $$1341$i; + $$0345$i = $$1346$i; + $$0358$i = $$0358$i << 1; + $$0361$i = $$1362$i; + } + } + } while (0); + if ((label | 0) == 85) { + if (($$2353$i | 0) == 0 & ($$3$i203 | 0) == 0) { + $299 = 2 << $$0357$i; + $302 = ($299 | 0 - $299) & $247; + if (!$302) { + $$0197 = $246; + break; + } + $306 = ($302 & 0 - $302) + -1 | 0; + $308 = $306 >>> 12 & 16; + $309 = $306 >>> $308; + $311 = $309 >>> 5 & 8; + $313 = $309 >>> $311; + $315 = $313 >>> 2 & 4; + $317 = $313 >>> $315; + $319 = $317 >>> 1 & 2; + $321 = $317 >>> $319; + $323 = $321 >>> 1 & 1; + $$3$i203218 = 0; + $$4355$i = HEAP32[67244 + (($311 | $308 | $315 | $319 | $323) + ($321 >>> $323) << 2) >> 2] | 0; + } else { + $$3$i203218 = $$3$i203; + $$4355$i = $$2353$i; + } + if (!$$4355$i) { + $$4$lcssa$i = $$3$i203218; + $$4349$lcssa$i = $$3348$i; + } else { + $$420$i$ph = $$3$i203218; + $$434919$i$ph = $$3348$i; + $$535618$i$ph = $$4355$i; + label = 89; + } + } + if ((label | 0) == 89) { + $$420$i = $$420$i$ph; + $$434919$i = $$434919$i$ph; + $$535618$i = $$535618$i$ph; + while (1) { + $333 = (HEAP32[$$535618$i + 4 >> 2] & -8) - $246 | 0; + $334 = $333 >>> 0 < $$434919$i >>> 0; + $spec$select$i205 = $334 ? $333 : $$434919$i; + $spec$select3$i = $334 ? $$535618$i : $$420$i; + $336 = HEAP32[$$535618$i + 16 >> 2] | 0; + if (!$336) $341 = HEAP32[$$535618$i + 20 >> 2] | 0; else $341 = $336; + if (!$341) { + $$4$lcssa$i = $spec$select3$i; + $$4349$lcssa$i = $spec$select$i205; + break; + } else { + $$420$i = $spec$select3$i; + $$434919$i = $spec$select$i205; + $$535618$i = $341; + } + } + } + if (($$4$lcssa$i | 0) != 0 ? $$4349$lcssa$i >>> 0 < ((HEAP32[16737] | 0) - $246 | 0) >>> 0 : 0) { + $346 = HEAP32[16739] | 0; + if ($346 >>> 0 > $$4$lcssa$i >>> 0) _abort(); + $348 = $$4$lcssa$i + $246 | 0; + if ($348 >>> 0 <= $$4$lcssa$i >>> 0) _abort(); + $351 = HEAP32[$$4$lcssa$i + 24 >> 2] | 0; + $353 = HEAP32[$$4$lcssa$i + 12 >> 2] | 0; + do if (($353 | 0) == ($$4$lcssa$i | 0)) { + $364 = $$4$lcssa$i + 20 | 0; + $365 = HEAP32[$364 >> 2] | 0; + if (!$365) { + $367 = $$4$lcssa$i + 16 | 0; + $368 = HEAP32[$367 >> 2] | 0; + if (!$368) { + $$3371$i = 0; + break; + } else { + $$1369$i$ph = $368; + $$1373$i$ph = $367; + } + } else { + $$1369$i$ph = $365; + $$1373$i$ph = $364; + } + $$1369$i = $$1369$i$ph; + $$1373$i = $$1373$i$ph; + while (1) { + $370 = $$1369$i + 20 | 0; + $371 = HEAP32[$370 >> 2] | 0; + if (!$371) { + $373 = $$1369$i + 16 | 0; + $374 = HEAP32[$373 >> 2] | 0; + if (!$374) break; else { + $$1369$i$be = $374; + $$1373$i$be = $373; + } + } else { + $$1369$i$be = $371; + $$1373$i$be = $370; + } + $$1369$i = $$1369$i$be; + $$1373$i = $$1373$i$be; + } + if ($346 >>> 0 > $$1373$i >>> 0) _abort(); else { + HEAP32[$$1373$i >> 2] = 0; + $$3371$i = $$1369$i; + break; + } + } else { + $356 = HEAP32[$$4$lcssa$i + 8 >> 2] | 0; + if ($346 >>> 0 > $356 >>> 0) _abort(); + $358 = $356 + 12 | 0; + if ((HEAP32[$358 >> 2] | 0) != ($$4$lcssa$i | 0)) _abort(); + $361 = $353 + 8 | 0; + if ((HEAP32[$361 >> 2] | 0) == ($$4$lcssa$i | 0)) { + HEAP32[$358 >> 2] = $353; + HEAP32[$361 >> 2] = $356; + $$3371$i = $353; + break; + } else _abort(); + } while (0); + L176 : do if ($351) { + $379 = HEAP32[$$4$lcssa$i + 28 >> 2] | 0; + $380 = 67244 + ($379 << 2) | 0; + do if (($$4$lcssa$i | 0) == (HEAP32[$380 >> 2] | 0)) { + HEAP32[$380 >> 2] = $$3371$i; + if (!$$3371$i) { + $385 = $247 & ~(1 << $379); + HEAP32[16736] = $385; + $469 = $385; + break L176; + } + } else if ((HEAP32[16739] | 0) >>> 0 <= $351 >>> 0) { + $388 = $351 + 16 | 0; + HEAP32[((HEAP32[$388 >> 2] | 0) == ($$4$lcssa$i | 0) ? $388 : $351 + 20 | 0) >> 2] = $$3371$i; + if (!$$3371$i) { + $469 = $247; + break L176; + } else break; + } else _abort(); while (0); + $393 = HEAP32[16739] | 0; + if ($393 >>> 0 > $$3371$i >>> 0) _abort(); + HEAP32[$$3371$i + 24 >> 2] = $351; + $397 = HEAP32[$$4$lcssa$i + 16 >> 2] | 0; + do if ($397 | 0) if ($393 >>> 0 > $397 >>> 0) _abort(); else { + HEAP32[$$3371$i + 16 >> 2] = $397; + HEAP32[$397 + 24 >> 2] = $$3371$i; + break; + } while (0); + $403 = HEAP32[$$4$lcssa$i + 20 >> 2] | 0; + if ($403) if ((HEAP32[16739] | 0) >>> 0 > $403 >>> 0) _abort(); else { + HEAP32[$$3371$i + 20 >> 2] = $403; + HEAP32[$403 + 24 >> 2] = $$3371$i; + $469 = $247; + break; + } else $469 = $247; + } else $469 = $247; while (0); + L200 : do if ($$4349$lcssa$i >>> 0 >= 16) { + HEAP32[$$4$lcssa$i + 4 >> 2] = $246 | 3; + HEAP32[$348 + 4 >> 2] = $$4349$lcssa$i | 1; + HEAP32[$348 + $$4349$lcssa$i >> 2] = $$4349$lcssa$i; + $422 = $$4349$lcssa$i >>> 3; + if ($$4349$lcssa$i >>> 0 < 256) { + $425 = 66980 + ($422 << 1 << 2) | 0; + $426 = HEAP32[16735] | 0; + $427 = 1 << $422; + if ($426 & $427) { + $431 = $425 + 8 | 0; + $432 = HEAP32[$431 >> 2] | 0; + if ((HEAP32[16739] | 0) >>> 0 > $432 >>> 0) _abort(); else { + $$0367$i = $432; + $$pre$phi$i209Z2D = $431; + } + } else { + HEAP32[16735] = $426 | $427; + $$0367$i = $425; + $$pre$phi$i209Z2D = $425 + 8 | 0; + } + HEAP32[$$pre$phi$i209Z2D >> 2] = $348; + HEAP32[$$0367$i + 12 >> 2] = $348; + HEAP32[$348 + 8 >> 2] = $$0367$i; + HEAP32[$348 + 12 >> 2] = $425; + break; + } + $438 = $$4349$lcssa$i >>> 8; + if ($438) if ($$4349$lcssa$i >>> 0 > 16777215) $$0360$i = 31; else { + $443 = ($438 + 1048320 | 0) >>> 16 & 8; + $444 = $438 << $443; + $447 = ($444 + 520192 | 0) >>> 16 & 4; + $449 = $444 << $447; + $452 = ($449 + 245760 | 0) >>> 16 & 2; + $457 = 14 - ($447 | $443 | $452) + ($449 << $452 >>> 15) | 0; + $$0360$i = $$4349$lcssa$i >>> ($457 + 7 | 0) & 1 | $457 << 1; + } else $$0360$i = 0; + $463 = 67244 + ($$0360$i << 2) | 0; + HEAP32[$348 + 28 >> 2] = $$0360$i; + $465 = $348 + 16 | 0; + HEAP32[$465 + 4 >> 2] = 0; + HEAP32[$465 >> 2] = 0; + $467 = 1 << $$0360$i; + if (!($469 & $467)) { + HEAP32[16736] = $469 | $467; + HEAP32[$463 >> 2] = $348; + HEAP32[$348 + 24 >> 2] = $463; + HEAP32[$348 + 12 >> 2] = $348; + HEAP32[$348 + 8 >> 2] = $348; + break; + } + $475 = HEAP32[$463 >> 2] | 0; + L218 : do if ((HEAP32[$475 + 4 >> 2] & -8 | 0) != ($$4349$lcssa$i | 0)) { + $$034217$i = $$4349$lcssa$i << (($$0360$i | 0) == 31 ? 0 : 25 - ($$0360$i >>> 1) | 0); + $$034316$i = $475; + while (1) { + $492 = $$034316$i + 16 + ($$034217$i >>> 31 << 2) | 0; + $487 = HEAP32[$492 >> 2] | 0; + if (!$487) break; + if ((HEAP32[$487 + 4 >> 2] & -8 | 0) == ($$4349$lcssa$i | 0)) { + $$0343$lcssa$i = $487; + break L218; + } else { + $$034217$i = $$034217$i << 1; + $$034316$i = $487; + } + } + if ((HEAP32[16739] | 0) >>> 0 > $492 >>> 0) _abort(); else { + HEAP32[$492 >> 2] = $348; + HEAP32[$348 + 24 >> 2] = $$034316$i; + HEAP32[$348 + 12 >> 2] = $348; + HEAP32[$348 + 8 >> 2] = $348; + break L200; + } + } else $$0343$lcssa$i = $475; while (0); + $499 = $$0343$lcssa$i + 8 | 0; + $500 = HEAP32[$499 >> 2] | 0; + $501 = HEAP32[16739] | 0; + if ($501 >>> 0 <= $500 >>> 0 & $501 >>> 0 <= $$0343$lcssa$i >>> 0) { + HEAP32[$500 + 12 >> 2] = $348; + HEAP32[$499 >> 2] = $348; + HEAP32[$348 + 8 >> 2] = $500; + HEAP32[$348 + 12 >> 2] = $$0343$lcssa$i; + HEAP32[$348 + 24 >> 2] = 0; + break; + } else _abort(); + } else { + $410 = $$4349$lcssa$i + $246 | 0; + HEAP32[$$4$lcssa$i + 4 >> 2] = $410 | 3; + $414 = $$4$lcssa$i + $410 + 4 | 0; + HEAP32[$414 >> 2] = HEAP32[$414 >> 2] | 1; + } while (0); + $$0 = $$4$lcssa$i + 8 | 0; + STACKTOP = sp; + return $$0 | 0; + } else $$0197 = $246; + } else $$0197 = $246; + } else $$0197 = -1; while (0); + $510 = HEAP32[16737] | 0; + if ($510 >>> 0 >= $$0197 >>> 0) { + $512 = $510 - $$0197 | 0; + $513 = HEAP32[16740] | 0; + if ($512 >>> 0 > 15) { + $515 = $513 + $$0197 | 0; + HEAP32[16740] = $515; + HEAP32[16737] = $512; + HEAP32[$515 + 4 >> 2] = $512 | 1; + HEAP32[$513 + $510 >> 2] = $512; + HEAP32[$513 + 4 >> 2] = $$0197 | 3; + } else { + HEAP32[16737] = 0; + HEAP32[16740] = 0; + HEAP32[$513 + 4 >> 2] = $510 | 3; + $524 = $513 + $510 + 4 | 0; + HEAP32[$524 >> 2] = HEAP32[$524 >> 2] | 1; + } + $$0 = $513 + 8 | 0; + STACKTOP = sp; + return $$0 | 0; + } + $528 = HEAP32[16738] | 0; + if ($528 >>> 0 > $$0197 >>> 0) { + $530 = $528 - $$0197 | 0; + HEAP32[16738] = $530; + $531 = HEAP32[16741] | 0; + $532 = $531 + $$0197 | 0; + HEAP32[16741] = $532; + HEAP32[$532 + 4 >> 2] = $530 | 1; + HEAP32[$531 + 4 >> 2] = $$0197 | 3; + $$0 = $531 + 8 | 0; + STACKTOP = sp; + return $$0 | 0; + } + if (!(HEAP32[16853] | 0)) { + HEAP32[16855] = 4096; + HEAP32[16854] = 4096; + HEAP32[16856] = -1; + HEAP32[16857] = -1; + HEAP32[16858] = 0; + HEAP32[16846] = 0; + HEAP32[16853] = $1 & -16 ^ 1431655768; + $546 = 4096; + } else $546 = HEAP32[16855] | 0; + $543 = $$0197 + 48 | 0; + $544 = $$0197 + 47 | 0; + $545 = $546 + $544 | 0; + $547 = 0 - $546 | 0; + $548 = $545 & $547; + if ($548 >>> 0 <= $$0197 >>> 0) { + $$0 = 0; + STACKTOP = sp; + return $$0 | 0; + } + $550 = HEAP32[16845] | 0; + if ($550 | 0 ? ($552 = HEAP32[16843] | 0, $553 = $552 + $548 | 0, $553 >>> 0 <= $552 >>> 0 | $553 >>> 0 > $550 >>> 0) : 0) { + $$0 = 0; + STACKTOP = sp; + return $$0 | 0; + } + L257 : do if (!(HEAP32[16846] & 4)) { + $559 = HEAP32[16741] | 0; + L259 : do if ($559) { + $$0$i$i = 67388; + while (1) { + $561 = HEAP32[$$0$i$i >> 2] | 0; + if ($561 >>> 0 <= $559 >>> 0 ? ($561 + (HEAP32[$$0$i$i + 4 >> 2] | 0) | 0) >>> 0 > $559 >>> 0 : 0) break; + $568 = HEAP32[$$0$i$i + 8 >> 2] | 0; + if (!$568) { + label = 173; + break L259; + } else $$0$i$i = $568; + } + $593 = $545 - $528 & $547; + if ($593 >>> 0 < 2147483647) { + $596 = _sbrk($593) | 0; + if (($596 | 0) == ((HEAP32[$$0$i$i >> 2] | 0) + (HEAP32[$$0$i$i + 4 >> 2] | 0) | 0)) if (($596 | 0) == (-1 | 0)) $$2234243136$i = $593; else { + $$723947$i = $593; + $$748$i = $596; + label = 190; + break L257; + } else { + $$2247$ph$i = $596; + $$2253$ph$i = $593; + label = 181; + } + } else $$2234243136$i = 0; + } else label = 173; while (0); + do if ((label | 0) == 173) { + $570 = _sbrk(0) | 0; + if (($570 | 0) != (-1 | 0) ? ($572 = $570, $573 = HEAP32[16854] | 0, $574 = $573 + -1 | 0, $spec$select49$i = (($574 & $572 | 0) == 0 ? 0 : ($574 + $572 & 0 - $573) - $572 | 0) + $548 | 0, $582 = HEAP32[16843] | 0, $583 = $spec$select49$i + $582 | 0, $spec$select49$i >>> 0 > $$0197 >>> 0 & $spec$select49$i >>> 0 < 2147483647) : 0) { + $586 = HEAP32[16845] | 0; + if ($586 | 0 ? $583 >>> 0 <= $582 >>> 0 | $583 >>> 0 > $586 >>> 0 : 0) { + $$2234243136$i = 0; + break; + } + $590 = _sbrk($spec$select49$i) | 0; + if (($590 | 0) == ($570 | 0)) { + $$723947$i = $spec$select49$i; + $$748$i = $570; + label = 190; + break L257; + } else { + $$2247$ph$i = $590; + $$2253$ph$i = $spec$select49$i; + label = 181; + } + } else $$2234243136$i = 0; + } while (0); + do if ((label | 0) == 181) { + $602 = 0 - $$2253$ph$i | 0; + if (!($543 >>> 0 > $$2253$ph$i >>> 0 & ($$2253$ph$i >>> 0 < 2147483647 & ($$2247$ph$i | 0) != (-1 | 0)))) if (($$2247$ph$i | 0) == (-1 | 0)) { + $$2234243136$i = 0; + break; + } else { + $$723947$i = $$2253$ph$i; + $$748$i = $$2247$ph$i; + label = 190; + break L257; + } + $606 = HEAP32[16855] | 0; + $610 = $544 - $$2253$ph$i + $606 & 0 - $606; + if ($610 >>> 0 >= 2147483647) { + $$723947$i = $$2253$ph$i; + $$748$i = $$2247$ph$i; + label = 190; + break L257; + } + if ((_sbrk($610) | 0) == (-1 | 0)) { + _sbrk($602) | 0; + $$2234243136$i = 0; + break; + } else { + $$723947$i = $610 + $$2253$ph$i | 0; + $$748$i = $$2247$ph$i; + label = 190; + break L257; + } + } while (0); + HEAP32[16846] = HEAP32[16846] | 4; + $$4236$i = $$2234243136$i; + label = 188; + } else { + $$4236$i = 0; + label = 188; + } while (0); + if (((label | 0) == 188 ? $548 >>> 0 < 2147483647 : 0) ? ($619 = _sbrk($548) | 0, $620 = _sbrk(0) | 0, $626 = $620 - $619 | 0, $628 = $626 >>> 0 > ($$0197 + 40 | 0) >>> 0, !(($619 | 0) == (-1 | 0) | $628 ^ 1 | $619 >>> 0 < $620 >>> 0 & (($619 | 0) != (-1 | 0) & ($620 | 0) != (-1 | 0)) ^ 1)) : 0) { + $$723947$i = $628 ? $626 : $$4236$i; + $$748$i = $619; + label = 190; + } + if ((label | 0) == 190) { + $632 = (HEAP32[16843] | 0) + $$723947$i | 0; + HEAP32[16843] = $632; + if ($632 >>> 0 > (HEAP32[16844] | 0) >>> 0) HEAP32[16844] = $632; + $635 = HEAP32[16741] | 0; + L294 : do if ($635) { + $$024372$i = 67388; + while (1) { + $656 = HEAP32[$$024372$i >> 2] | 0; + $658 = HEAP32[$$024372$i + 4 >> 2] | 0; + if (($$748$i | 0) == ($656 + $658 | 0)) { + label = 199; + break; + } + $662 = HEAP32[$$024372$i + 8 >> 2] | 0; + if (!$662) break; else $$024372$i = $662; + } + if (((label | 0) == 199 ? ($664 = $$024372$i + 4 | 0, (HEAP32[$$024372$i + 12 >> 2] & 8 | 0) == 0) : 0) ? $$748$i >>> 0 > $635 >>> 0 & $656 >>> 0 <= $635 >>> 0 : 0) { + HEAP32[$664 >> 2] = $658 + $$723947$i; + $673 = (HEAP32[16738] | 0) + $$723947$i | 0; + $675 = $635 + 8 | 0; + $680 = ($675 & 7 | 0) == 0 ? 0 : 0 - $675 & 7; + $681 = $635 + $680 | 0; + $682 = $673 - $680 | 0; + HEAP32[16741] = $681; + HEAP32[16738] = $682; + HEAP32[$681 + 4 >> 2] = $682 | 1; + HEAP32[$635 + $673 + 4 >> 2] = 40; + HEAP32[16742] = HEAP32[16857]; + break; + } + $688 = HEAP32[16739] | 0; + if ($$748$i >>> 0 < $688 >>> 0) { + HEAP32[16739] = $$748$i; + $753 = $$748$i; + } else $753 = $688; + $690 = $$748$i + $$723947$i | 0; + $$124471$i = 67388; + while (1) { + if ((HEAP32[$$124471$i >> 2] | 0) == ($690 | 0)) { + label = 207; + break; + } + $694 = HEAP32[$$124471$i + 8 >> 2] | 0; + if (!$694) break; else $$124471$i = $694; + } + if ((label | 0) == 207 ? (HEAP32[$$124471$i + 12 >> 2] & 8 | 0) == 0 : 0) { + HEAP32[$$124471$i >> 2] = $$748$i; + $700 = $$124471$i + 4 | 0; + HEAP32[$700 >> 2] = (HEAP32[$700 >> 2] | 0) + $$723947$i; + $704 = $$748$i + 8 | 0; + $710 = $$748$i + (($704 & 7 | 0) == 0 ? 0 : 0 - $704 & 7) | 0; + $712 = $690 + 8 | 0; + $718 = $690 + (($712 & 7 | 0) == 0 ? 0 : 0 - $712 & 7) | 0; + $722 = $710 + $$0197 | 0; + $723 = $718 - $710 - $$0197 | 0; + HEAP32[$710 + 4 >> 2] = $$0197 | 3; + L317 : do if (($635 | 0) != ($718 | 0)) { + if ((HEAP32[16740] | 0) == ($718 | 0)) { + $734 = (HEAP32[16737] | 0) + $723 | 0; + HEAP32[16737] = $734; + HEAP32[16740] = $722; + HEAP32[$722 + 4 >> 2] = $734 | 1; + HEAP32[$722 + $734 >> 2] = $734; + break; + } + $739 = HEAP32[$718 + 4 >> 2] | 0; + if (($739 & 3 | 0) == 1) { + $742 = $739 & -8; + $743 = $739 >>> 3; + L325 : do if ($739 >>> 0 >= 256) { + $769 = HEAP32[$718 + 24 >> 2] | 0; + $771 = HEAP32[$718 + 12 >> 2] | 0; + do if (($771 | 0) == ($718 | 0)) { + $782 = $718 + 16 | 0; + $783 = $782 + 4 | 0; + $784 = HEAP32[$783 >> 2] | 0; + if (!$784) { + $786 = HEAP32[$782 >> 2] | 0; + if (!$786) { + $$3$i$i = 0; + break; + } else { + $$1290$i$i$ph = $786; + $$1292$i$i$ph = $782; + } + } else { + $$1290$i$i$ph = $784; + $$1292$i$i$ph = $783; + } + $$1290$i$i = $$1290$i$i$ph; + $$1292$i$i = $$1292$i$i$ph; + while (1) { + $788 = $$1290$i$i + 20 | 0; + $789 = HEAP32[$788 >> 2] | 0; + if (!$789) { + $791 = $$1290$i$i + 16 | 0; + $792 = HEAP32[$791 >> 2] | 0; + if (!$792) break; else { + $$1290$i$i$be = $792; + $$1292$i$i$be = $791; + } + } else { + $$1290$i$i$be = $789; + $$1292$i$i$be = $788; + } + $$1290$i$i = $$1290$i$i$be; + $$1292$i$i = $$1292$i$i$be; + } + if ($753 >>> 0 > $$1292$i$i >>> 0) _abort(); else { + HEAP32[$$1292$i$i >> 2] = 0; + $$3$i$i = $$1290$i$i; + break; + } + } else { + $774 = HEAP32[$718 + 8 >> 2] | 0; + if ($753 >>> 0 > $774 >>> 0) _abort(); + $776 = $774 + 12 | 0; + if ((HEAP32[$776 >> 2] | 0) != ($718 | 0)) _abort(); + $779 = $771 + 8 | 0; + if ((HEAP32[$779 >> 2] | 0) == ($718 | 0)) { + HEAP32[$776 >> 2] = $771; + HEAP32[$779 >> 2] = $774; + $$3$i$i = $771; + break; + } else _abort(); + } while (0); + if (!$769) break; + $797 = HEAP32[$718 + 28 >> 2] | 0; + $798 = 67244 + ($797 << 2) | 0; + do if ((HEAP32[$798 >> 2] | 0) != ($718 | 0)) if ((HEAP32[16739] | 0) >>> 0 <= $769 >>> 0) { + $807 = $769 + 16 | 0; + HEAP32[((HEAP32[$807 >> 2] | 0) == ($718 | 0) ? $807 : $769 + 20 | 0) >> 2] = $$3$i$i; + if (!$$3$i$i) break L325; else break; + } else _abort(); else { + HEAP32[$798 >> 2] = $$3$i$i; + if ($$3$i$i | 0) break; + HEAP32[16736] = HEAP32[16736] & ~(1 << $797); + break L325; + } while (0); + $812 = HEAP32[16739] | 0; + if ($812 >>> 0 > $$3$i$i >>> 0) _abort(); + HEAP32[$$3$i$i + 24 >> 2] = $769; + $815 = $718 + 16 | 0; + $816 = HEAP32[$815 >> 2] | 0; + do if ($816 | 0) if ($812 >>> 0 > $816 >>> 0) _abort(); else { + HEAP32[$$3$i$i + 16 >> 2] = $816; + HEAP32[$816 + 24 >> 2] = $$3$i$i; + break; + } while (0); + $822 = HEAP32[$815 + 4 >> 2] | 0; + if (!$822) break; + if ((HEAP32[16739] | 0) >>> 0 > $822 >>> 0) _abort(); else { + HEAP32[$$3$i$i + 20 >> 2] = $822; + HEAP32[$822 + 24 >> 2] = $$3$i$i; + break; + } + } else { + $746 = HEAP32[$718 + 8 >> 2] | 0; + $748 = HEAP32[$718 + 12 >> 2] | 0; + $750 = 66980 + ($743 << 1 << 2) | 0; + do if (($746 | 0) != ($750 | 0)) { + if ($753 >>> 0 > $746 >>> 0) _abort(); + if ((HEAP32[$746 + 12 >> 2] | 0) == ($718 | 0)) break; + _abort(); + } while (0); + if (($748 | 0) == ($746 | 0)) { + HEAP32[16735] = HEAP32[16735] & ~(1 << $743); + break; + } + do if (($748 | 0) == ($750 | 0)) $$pre$phi17$i$iZ2D = $748 + 8 | 0; else { + if ($753 >>> 0 > $748 >>> 0) _abort(); + $764 = $748 + 8 | 0; + if ((HEAP32[$764 >> 2] | 0) == ($718 | 0)) { + $$pre$phi17$i$iZ2D = $764; + break; + } + _abort(); + } while (0); + HEAP32[$746 + 12 >> 2] = $748; + HEAP32[$$pre$phi17$i$iZ2D >> 2] = $746; + } while (0); + $$0$i16$i = $718 + $742 | 0; + $$0286$i$i = $742 + $723 | 0; + } else { + $$0$i16$i = $718; + $$0286$i$i = $723; + } + $830 = $$0$i16$i + 4 | 0; + HEAP32[$830 >> 2] = HEAP32[$830 >> 2] & -2; + HEAP32[$722 + 4 >> 2] = $$0286$i$i | 1; + HEAP32[$722 + $$0286$i$i >> 2] = $$0286$i$i; + $836 = $$0286$i$i >>> 3; + if ($$0286$i$i >>> 0 < 256) { + $839 = 66980 + ($836 << 1 << 2) | 0; + $840 = HEAP32[16735] | 0; + $841 = 1 << $836; + do if (!($840 & $841)) { + HEAP32[16735] = $840 | $841; + $$0294$i$i = $839; + $$pre$phi$i18$iZ2D = $839 + 8 | 0; + } else { + $845 = $839 + 8 | 0; + $846 = HEAP32[$845 >> 2] | 0; + if ((HEAP32[16739] | 0) >>> 0 <= $846 >>> 0) { + $$0294$i$i = $846; + $$pre$phi$i18$iZ2D = $845; + break; + } + _abort(); + } while (0); + HEAP32[$$pre$phi$i18$iZ2D >> 2] = $722; + HEAP32[$$0294$i$i + 12 >> 2] = $722; + HEAP32[$722 + 8 >> 2] = $$0294$i$i; + HEAP32[$722 + 12 >> 2] = $839; + break; + } + $852 = $$0286$i$i >>> 8; + do if (!$852) $$0295$i$i = 0; else { + if ($$0286$i$i >>> 0 > 16777215) { + $$0295$i$i = 31; + break; + } + $857 = ($852 + 1048320 | 0) >>> 16 & 8; + $858 = $852 << $857; + $861 = ($858 + 520192 | 0) >>> 16 & 4; + $863 = $858 << $861; + $866 = ($863 + 245760 | 0) >>> 16 & 2; + $871 = 14 - ($861 | $857 | $866) + ($863 << $866 >>> 15) | 0; + $$0295$i$i = $$0286$i$i >>> ($871 + 7 | 0) & 1 | $871 << 1; + } while (0); + $877 = 67244 + ($$0295$i$i << 2) | 0; + HEAP32[$722 + 28 >> 2] = $$0295$i$i; + $879 = $722 + 16 | 0; + HEAP32[$879 + 4 >> 2] = 0; + HEAP32[$879 >> 2] = 0; + $881 = HEAP32[16736] | 0; + $882 = 1 << $$0295$i$i; + if (!($881 & $882)) { + HEAP32[16736] = $881 | $882; + HEAP32[$877 >> 2] = $722; + HEAP32[$722 + 24 >> 2] = $877; + HEAP32[$722 + 12 >> 2] = $722; + HEAP32[$722 + 8 >> 2] = $722; + break; + } + $889 = HEAP32[$877 >> 2] | 0; + L410 : do if ((HEAP32[$889 + 4 >> 2] & -8 | 0) != ($$0286$i$i | 0)) { + $$028711$i$i = $$0286$i$i << (($$0295$i$i | 0) == 31 ? 0 : 25 - ($$0295$i$i >>> 1) | 0); + $$028810$i$i = $889; + while (1) { + $906 = $$028810$i$i + 16 + ($$028711$i$i >>> 31 << 2) | 0; + $901 = HEAP32[$906 >> 2] | 0; + if (!$901) break; + if ((HEAP32[$901 + 4 >> 2] & -8 | 0) == ($$0286$i$i | 0)) { + $$0288$lcssa$i$i = $901; + break L410; + } else { + $$028711$i$i = $$028711$i$i << 1; + $$028810$i$i = $901; + } + } + if ((HEAP32[16739] | 0) >>> 0 > $906 >>> 0) _abort(); else { + HEAP32[$906 >> 2] = $722; + HEAP32[$722 + 24 >> 2] = $$028810$i$i; + HEAP32[$722 + 12 >> 2] = $722; + HEAP32[$722 + 8 >> 2] = $722; + break L317; + } + } else $$0288$lcssa$i$i = $889; while (0); + $913 = $$0288$lcssa$i$i + 8 | 0; + $914 = HEAP32[$913 >> 2] | 0; + $915 = HEAP32[16739] | 0; + if ($915 >>> 0 <= $914 >>> 0 & $915 >>> 0 <= $$0288$lcssa$i$i >>> 0) { + HEAP32[$914 + 12 >> 2] = $722; + HEAP32[$913 >> 2] = $722; + HEAP32[$722 + 8 >> 2] = $914; + HEAP32[$722 + 12 >> 2] = $$0288$lcssa$i$i; + HEAP32[$722 + 24 >> 2] = 0; + break; + } else _abort(); + } else { + $728 = (HEAP32[16738] | 0) + $723 | 0; + HEAP32[16738] = $728; + HEAP32[16741] = $722; + HEAP32[$722 + 4 >> 2] = $728 | 1; + } while (0); + $$0 = $710 + 8 | 0; + STACKTOP = sp; + return $$0 | 0; + } + $$0$i$i$i = 67388; + while (1) { + $923 = HEAP32[$$0$i$i$i >> 2] | 0; + if ($923 >>> 0 <= $635 >>> 0 ? ($927 = $923 + (HEAP32[$$0$i$i$i + 4 >> 2] | 0) | 0, $927 >>> 0 > $635 >>> 0) : 0) break; + $$0$i$i$i = HEAP32[$$0$i$i$i + 8 >> 2] | 0; + } + $931 = $927 + -47 | 0; + $933 = $931 + 8 | 0; + $939 = $931 + (($933 & 7 | 0) == 0 ? 0 : 0 - $933 & 7) | 0; + $940 = $635 + 16 | 0; + $942 = $939 >>> 0 < $940 >>> 0 ? $635 : $939; + $943 = $942 + 8 | 0; + $945 = $$723947$i + -40 | 0; + $947 = $$748$i + 8 | 0; + $952 = ($947 & 7 | 0) == 0 ? 0 : 0 - $947 & 7; + $953 = $$748$i + $952 | 0; + $954 = $945 - $952 | 0; + HEAP32[16741] = $953; + HEAP32[16738] = $954; + HEAP32[$953 + 4 >> 2] = $954 | 1; + HEAP32[$$748$i + $945 + 4 >> 2] = 40; + HEAP32[16742] = HEAP32[16857]; + $960 = $942 + 4 | 0; + HEAP32[$960 >> 2] = 27; + HEAP32[$943 >> 2] = HEAP32[16847]; + HEAP32[$943 + 4 >> 2] = HEAP32[16848]; + HEAP32[$943 + 8 >> 2] = HEAP32[16849]; + HEAP32[$943 + 12 >> 2] = HEAP32[16850]; + HEAP32[16847] = $$748$i; + HEAP32[16848] = $$723947$i; + HEAP32[16850] = 0; + HEAP32[16849] = $943; + $962 = $942 + 24 | 0; + do { + $962$looptemp = $962; + $962 = $962 + 4 | 0; + HEAP32[$962 >> 2] = 7; + } while (($962$looptemp + 8 | 0) >>> 0 < $927 >>> 0); + if (($942 | 0) != ($635 | 0)) { + $968 = $942 - $635 | 0; + HEAP32[$960 >> 2] = HEAP32[$960 >> 2] & -2; + HEAP32[$635 + 4 >> 2] = $968 | 1; + HEAP32[$942 >> 2] = $968; + $973 = $968 >>> 3; + if ($968 >>> 0 < 256) { + $976 = 66980 + ($973 << 1 << 2) | 0; + $977 = HEAP32[16735] | 0; + $978 = 1 << $973; + if ($977 & $978) { + $982 = $976 + 8 | 0; + $983 = HEAP32[$982 >> 2] | 0; + if ((HEAP32[16739] | 0) >>> 0 > $983 >>> 0) _abort(); else { + $$0211$i$i = $983; + $$pre$phi$i$iZ2D = $982; + } + } else { + HEAP32[16735] = $977 | $978; + $$0211$i$i = $976; + $$pre$phi$i$iZ2D = $976 + 8 | 0; + } + HEAP32[$$pre$phi$i$iZ2D >> 2] = $635; + HEAP32[$$0211$i$i + 12 >> 2] = $635; + HEAP32[$635 + 8 >> 2] = $$0211$i$i; + HEAP32[$635 + 12 >> 2] = $976; + break; + } + $989 = $968 >>> 8; + if ($989) if ($968 >>> 0 > 16777215) $$0212$i$i = 31; else { + $994 = ($989 + 1048320 | 0) >>> 16 & 8; + $995 = $989 << $994; + $998 = ($995 + 520192 | 0) >>> 16 & 4; + $1000 = $995 << $998; + $1003 = ($1000 + 245760 | 0) >>> 16 & 2; + $1008 = 14 - ($998 | $994 | $1003) + ($1000 << $1003 >>> 15) | 0; + $$0212$i$i = $968 >>> ($1008 + 7 | 0) & 1 | $1008 << 1; + } else $$0212$i$i = 0; + $1014 = 67244 + ($$0212$i$i << 2) | 0; + HEAP32[$635 + 28 >> 2] = $$0212$i$i; + HEAP32[$635 + 20 >> 2] = 0; + HEAP32[$940 >> 2] = 0; + $1017 = HEAP32[16736] | 0; + $1018 = 1 << $$0212$i$i; + if (!($1017 & $1018)) { + HEAP32[16736] = $1017 | $1018; + HEAP32[$1014 >> 2] = $635; + HEAP32[$635 + 24 >> 2] = $1014; + HEAP32[$635 + 12 >> 2] = $635; + HEAP32[$635 + 8 >> 2] = $635; + break; + } + $1025 = HEAP32[$1014 >> 2] | 0; + L451 : do if ((HEAP32[$1025 + 4 >> 2] & -8 | 0) != ($968 | 0)) { + $$02065$i$i = $968 << (($$0212$i$i | 0) == 31 ? 0 : 25 - ($$0212$i$i >>> 1) | 0); + $$02074$i$i = $1025; + while (1) { + $1042 = $$02074$i$i + 16 + ($$02065$i$i >>> 31 << 2) | 0; + $1037 = HEAP32[$1042 >> 2] | 0; + if (!$1037) break; + if ((HEAP32[$1037 + 4 >> 2] & -8 | 0) == ($968 | 0)) { + $$0207$lcssa$i$i = $1037; + break L451; + } else { + $$02065$i$i = $$02065$i$i << 1; + $$02074$i$i = $1037; + } + } + if ((HEAP32[16739] | 0) >>> 0 > $1042 >>> 0) _abort(); else { + HEAP32[$1042 >> 2] = $635; + HEAP32[$635 + 24 >> 2] = $$02074$i$i; + HEAP32[$635 + 12 >> 2] = $635; + HEAP32[$635 + 8 >> 2] = $635; + break L294; + } + } else $$0207$lcssa$i$i = $1025; while (0); + $1049 = $$0207$lcssa$i$i + 8 | 0; + $1050 = HEAP32[$1049 >> 2] | 0; + $1051 = HEAP32[16739] | 0; + if ($1051 >>> 0 <= $1050 >>> 0 & $1051 >>> 0 <= $$0207$lcssa$i$i >>> 0) { + HEAP32[$1050 + 12 >> 2] = $635; + HEAP32[$1049 >> 2] = $635; + HEAP32[$635 + 8 >> 2] = $1050; + HEAP32[$635 + 12 >> 2] = $$0207$lcssa$i$i; + HEAP32[$635 + 24 >> 2] = 0; + break; + } else _abort(); + } + } else { + $637 = HEAP32[16739] | 0; + if (($637 | 0) == 0 | $$748$i >>> 0 < $637 >>> 0) HEAP32[16739] = $$748$i; + HEAP32[16847] = $$748$i; + HEAP32[16848] = $$723947$i; + HEAP32[16850] = 0; + HEAP32[16744] = HEAP32[16853]; + HEAP32[16743] = -1; + HEAP32[16748] = 66980; + HEAP32[16747] = 66980; + HEAP32[16750] = 66988; + HEAP32[16749] = 66988; + HEAP32[16752] = 66996; + HEAP32[16751] = 66996; + HEAP32[16754] = 67004; + HEAP32[16753] = 67004; + HEAP32[16756] = 67012; + HEAP32[16755] = 67012; + HEAP32[16758] = 67020; + HEAP32[16757] = 67020; + HEAP32[16760] = 67028; + HEAP32[16759] = 67028; + HEAP32[16762] = 67036; + HEAP32[16761] = 67036; + HEAP32[16764] = 67044; + HEAP32[16763] = 67044; + HEAP32[16766] = 67052; + HEAP32[16765] = 67052; + HEAP32[16768] = 67060; + HEAP32[16767] = 67060; + HEAP32[16770] = 67068; + HEAP32[16769] = 67068; + HEAP32[16772] = 67076; + HEAP32[16771] = 67076; + HEAP32[16774] = 67084; + HEAP32[16773] = 67084; + HEAP32[16776] = 67092; + HEAP32[16775] = 67092; + HEAP32[16778] = 67100; + HEAP32[16777] = 67100; + HEAP32[16780] = 67108; + HEAP32[16779] = 67108; + HEAP32[16782] = 67116; + HEAP32[16781] = 67116; + HEAP32[16784] = 67124; + HEAP32[16783] = 67124; + HEAP32[16786] = 67132; + HEAP32[16785] = 67132; + HEAP32[16788] = 67140; + HEAP32[16787] = 67140; + HEAP32[16790] = 67148; + HEAP32[16789] = 67148; + HEAP32[16792] = 67156; + HEAP32[16791] = 67156; + HEAP32[16794] = 67164; + HEAP32[16793] = 67164; + HEAP32[16796] = 67172; + HEAP32[16795] = 67172; + HEAP32[16798] = 67180; + HEAP32[16797] = 67180; + HEAP32[16800] = 67188; + HEAP32[16799] = 67188; + HEAP32[16802] = 67196; + HEAP32[16801] = 67196; + HEAP32[16804] = 67204; + HEAP32[16803] = 67204; + HEAP32[16806] = 67212; + HEAP32[16805] = 67212; + HEAP32[16808] = 67220; + HEAP32[16807] = 67220; + HEAP32[16810] = 67228; + HEAP32[16809] = 67228; + $641 = $$723947$i + -40 | 0; + $643 = $$748$i + 8 | 0; + $648 = ($643 & 7 | 0) == 0 ? 0 : 0 - $643 & 7; + $649 = $$748$i + $648 | 0; + $650 = $641 - $648 | 0; + HEAP32[16741] = $649; + HEAP32[16738] = $650; + HEAP32[$649 + 4 >> 2] = $650 | 1; + HEAP32[$$748$i + $641 + 4 >> 2] = 40; + HEAP32[16742] = HEAP32[16857]; + } while (0); + $1060 = HEAP32[16738] | 0; + if ($1060 >>> 0 > $$0197 >>> 0) { + $1062 = $1060 - $$0197 | 0; + HEAP32[16738] = $1062; + $1063 = HEAP32[16741] | 0; + $1064 = $1063 + $$0197 | 0; + HEAP32[16741] = $1064; + HEAP32[$1064 + 4 >> 2] = $1062 | 1; + HEAP32[$1063 + 4 >> 2] = $$0197 | 3; + $$0 = $1063 + 8 | 0; + STACKTOP = sp; + return $$0 | 0; + } + } + $1070 = ___errno_location() | 0; + HEAP32[$1070 >> 2] = 48; + $$0 = 0; + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + $10 = $10 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i161 = 0, $$0$i$i$i$i205 = 0, $$0$i$i$i$i221 = 0, $$0$i$i$i$i237 = 0, $$0$i$i$i$i254 = 0, $$0$i$i$i$i269 = 0, $$0$i$i147 = 0, $$0$i$i150 = 0, $$0$i$i153 = 0, $$0$i$i156 = 0, $$0$i$i159 = 0, $$0$i$i160 = 0, $$0$i$i173 = 0, $$0$i$i176 = 0, $$0$i$i182 = 0, $$0$i$i189 = 0, $$0$i$i194 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i167 = 0, $$0$i$i2$i$i211 = 0, $$0$i$i2$i$i227 = 0, $$0$i$i2$i$i243 = 0, $$0$i$i2$i$i260 = 0, $$0$i$i2$i$i275 = 0, $$0$i$i202 = 0, $$0$i$i233 = 0, $$0$i$i249 = 0, $$0$i$i266 = 0, $$0$i$i281 = 0, $$0$i$i284 = 0, $$0124 = 0, $$0129 = 0, $$0131 = 0, $$10 = 0, $$1130 = 0, $$2126$ph = 0, $$pre$phiZ2D = 0, $$sroa$0293$0$ptr = 0, $$sroa$0313$0 = 0, $$sroa$0313$1 = 0, $$sroa$08$0$ptr$i = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $12 = 0, $125 = 0, $128 = 0, $13 = 0, $14 = 0, $141 = 0, $143 = 0, $15 = 0, $155 = 0, $157 = 0, $16 = 0, $17 = 0, $175 = 0, $176 = 0, $177 = 0, $18 = 0, $189 = 0, $19 = 0, $193 = 0, $194 = 0, $198 = 0, $20 = 0, $201 = 0, $203 = 0, $205 = 0, $208 = 0, $21 = 0, $215 = 0, $22 = 0, $222 = 0, $223 = 0, $224 = 0, $23 = 0, $233 = 0, $24 = 0, $245 = 0, $246 = 0, $247 = 0, $25 = 0, $256 = 0, $275 = 0, $276 = 0, $277 = 0, $280 = 0, $286 = 0, $305 = 0, $306 = 0, $307 = 0, $316 = 0, $330 = 0, $331 = 0, $332 = 0, $333 = 0, $335 = 0, $336 = 0, $337 = 0, $338 = 0, $339 = 0, $346 = 0, $348 = 0, $349 = 0, $350 = 0, $351 = 0, $353 = 0, $363 = 0, $364 = 0, $365 = 0, $366 = 0, $367 = 0, $368 = 0, $372 = 0, $375 = 0, $380 = 0, $386 = 0, $387 = 0, $391 = 0, $395 = 0, $398 = 0, $40 = 0, $41 = 0, $411 = 0, $413 = 0, $42 = 0, $425 = 0, $427 = 0, $43 = 0, $44 = 0, $440 = 0, $441 = 0, $442 = 0, $45 = 0, $452 = 0, $453 = 0, $46 = 0, $463 = 0, $466 = 0, $479 = 0, $48 = 0, $481 = 0, $49 = 0, $493 = 0, $495 = 0, $50 = 0, $505 = 0, $51 = 0, $513 = 0, $517 = 0, $519 = 0, $52 = 0, $528 = 0, $53 = 0, $532 = 0, $533 = 0, $534 = 0, $535 = 0, $545 = 0, $55 = 0, $551 = 0, $554 = 0, $557 = 0, $570 = 0, $572 = 0, $58 = 0, $584 = 0, $586 = 0, $601 = 0, $602 = 0, $603 = 0, $614 = 0, $617 = 0, $630 = 0, $632 = 0, $644 = 0, $646 = 0, $669 = 0, $671 = 0, $682 = 0, $686 = 0, $687 = 0, $688 = 0, $70 = 0, $704 = 0, $705 = 0, $706 = 0, $711 = 0, $712 = 0, $715 = 0, $727 = 0, $73 = 0, $730 = 0, $742 = 0, $744 = 0, $759 = 0, $765 = 0, $766 = 0, $767 = 0, $776 = 0, $777 = 0, $783 = 0, $787 = 0, $788 = 0, $789 = 0, $790 = 0, $791 = 0, $792 = 0, $793 = 0, $794 = 0, $795 = 0, $796 = 0, $797 = 0, $798 = 0, $799 = 0, $800 = 0, $801 = 0, $802 = 0, $803 = 0, $804 = 0, $805 = 0, $88 = 0, $90 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 512 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(512); + $11 = sp + 488 | 0; + $12 = sp; + $13 = sp + 480 | 0; + $14 = sp + 472 | 0; + $15 = sp + 468 | 0; + $16 = sp + 496 | 0; + $17 = sp + 493 | 0; + $18 = sp + 492 | 0; + $19 = sp + 456 | 0; + $20 = sp + 444 | 0; + $21 = sp + 432 | 0; + $22 = sp + 420 | 0; + $23 = sp + 408 | 0; + $24 = sp + 404 | 0; + $25 = sp + 400 | 0; + HEAP32[$11 >> 2] = $10; + HEAP32[$13 >> 2] = $12; + HEAP32[$13 + 4 >> 2] = 214; + HEAP32[$14 >> 2] = $12; + HEAP32[$15 >> 2] = $12 + 400; + HEAP32[$19 >> 2] = 0; + HEAP32[$19 + 4 >> 2] = 0; + HEAP32[$19 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$19 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + HEAP32[$20 >> 2] = 0; + HEAP32[$20 + 4 >> 2] = 0; + HEAP32[$20 + 8 >> 2] = 0; + $$0$i$i147 = 0; + while (1) { + if (($$0$i$i147 | 0) == 3) break; + HEAP32[$20 + ($$0$i$i147 << 2) >> 2] = 0; + $$0$i$i147 = $$0$i$i147 + 1 | 0; + } + HEAP32[$21 >> 2] = 0; + HEAP32[$21 + 4 >> 2] = 0; + HEAP32[$21 + 8 >> 2] = 0; + $$0$i$i150 = 0; + while (1) { + if (($$0$i$i150 | 0) == 3) break; + HEAP32[$21 + ($$0$i$i150 << 2) >> 2] = 0; + $$0$i$i150 = $$0$i$i150 + 1 | 0; + } + HEAP32[$22 >> 2] = 0; + HEAP32[$22 + 4 >> 2] = 0; + HEAP32[$22 + 8 >> 2] = 0; + $$0$i$i153 = 0; + while (1) { + if (($$0$i$i153 | 0) == 3) break; + HEAP32[$22 + ($$0$i$i153 << 2) >> 2] = 0; + $$0$i$i153 = $$0$i$i153 + 1 | 0; + } + HEAP32[$23 >> 2] = 0; + HEAP32[$23 + 4 >> 2] = 0; + HEAP32[$23 + 8 >> 2] = 0; + $$0$i$i156 = 0; + while (1) { + if (($$0$i$i156 | 0) == 3) break; + HEAP32[$23 + ($$0$i$i156 << 2) >> 2] = 0; + $$0$i$i156 = $$0$i$i156 + 1 | 0; + } + __ZNSt3__211__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri($2, $3, $16, $17, $18, $19, $20, $21, $22, $24); + HEAP32[$9 >> 2] = HEAP32[$8 >> 2]; + $40 = $7 + 8 | 0; + $41 = $21 + 11 | 0; + $42 = $21 + 4 | 0; + $43 = $22 + 11 | 0; + $44 = $22 + 4 | 0; + $45 = $19 + 11 | 0; + $46 = $19 + 4 | 0; + $48 = ($4 & 512 | 0) != 0; + $49 = $20 + 11 | 0; + $50 = $16 + 3 | 0; + $51 = $20 + 4 | 0; + $52 = $23 + 11 | 0; + $53 = $23 + 4 | 0; + $$0129 = 0; + $$0131 = 0; + L21 : while (1) { + if ($$0131 >>> 0 >= 4) { + label = 243; + break; + } + $55 = HEAP32[$0 >> 2] | 0; + do if ($55) { + $58 = HEAP32[$55 + 12 >> 2] | 0; + if (($58 | 0) == (HEAP32[$55 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$55 >> 2] | 0) + 36 >> 2] & 127]($55) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$58 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $787 = 1; + break; + } else { + $787 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $787 = 1; while (0); + $70 = HEAP32[$1 >> 2] | 0; + do if ($70) { + $73 = HEAP32[$70 + 12 >> 2] | 0; + if (($73 | 0) == (HEAP32[$70 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$70 >> 2] | 0) + 36 >> 2] & 127]($70) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$73 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($787) { + $788 = $70; + break; + } else { + label = 243; + break L21; + } else { + HEAP32[$1 >> 2] = 0; + label = 31; + break; + } + } else label = 31; while (0); + if ((label | 0) == 31) { + label = 0; + if ($787) { + label = 243; + break; + } else $788 = 0; + } + L46 : do switch (HEAP8[$16 + $$0131 >> 0] | 0) { + case 1: + { + if (($$0131 | 0) == 3) $$1130 = $$0129; else { + $88 = HEAP32[$0 >> 2] | 0; + $90 = HEAP32[$88 + 12 >> 2] | 0; + if (($90 | 0) == (HEAP32[$88 + 16 >> 2] | 0)) $$0$i$i159 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$88 >> 2] | 0) + 36 >> 2] & 127]($88) | 0; else $$0$i$i159 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$90 >> 0] | 0) | 0; + if (($$0$i$i159 & 255) << 24 >> 24 <= -1) { + label = 45; + break L21; + } + if (!(HEAP16[(HEAP32[$40 >> 2] | 0) + ($$0$i$i159 << 24 >> 24 << 1) >> 1] & 8192)) { + label = 45; + break L21; + } + $108 = HEAP32[$0 >> 2] | 0; + $109 = $108 + 12 | 0; + $110 = HEAP32[$109 >> 2] | 0; + if (($110 | 0) == (HEAP32[$108 + 16 >> 2] | 0)) $$0$i$i160 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$108 >> 2] | 0) + 40 >> 2] & 127]($108) | 0; else { + HEAP32[$109 >> 2] = $110 + 1; + $$0$i$i160 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$110 >> 0] | 0) | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc($23, $$0$i$i160 & 255); + label = 47; + } + break; + } + case 0: + { + if (($$0131 | 0) == 3) $$1130 = $$0129; else label = 47; + break; + } + case 3: + { + $189 = HEAP8[$41 >> 0] | 0; + $193 = $189 << 24 >> 24 < 0 ? HEAP32[$42 >> 2] | 0 : $189 & 255; + $194 = HEAP8[$43 >> 0] | 0; + $198 = $194 << 24 >> 24 < 0 ? HEAP32[$44 >> 2] | 0 : $194 & 255; + if (($193 | 0) == (0 - $198 | 0)) $$1130 = $$0129; else { + $201 = ($193 | 0) == 0; + $203 = HEAP32[$0 >> 2] | 0; + $205 = HEAP32[$203 + 12 >> 2] | 0; + $208 = ($205 | 0) == (HEAP32[$203 + 16 >> 2] | 0); + if ($201 | ($198 | 0) == 0) { + if ($208) $$0$i$i182 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$203 >> 2] | 0) + 36 >> 2] & 127]($203) | 0; else $$0$i$i182 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$205 >> 0] | 0) | 0; + $215 = $$0$i$i182 & 255; + if ($201) { + if ((HEAP8[((HEAP8[$43 >> 0] | 0) < 0 ? HEAP32[$22 >> 2] | 0 : $22) >> 0] | 0) != $215 << 24 >> 24) { + $$1130 = $$0129; + break L46; + } + $245 = HEAP32[$0 >> 2] | 0; + $246 = $245 + 12 | 0; + $247 = HEAP32[$246 >> 2] | 0; + if (($247 | 0) == (HEAP32[$245 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$245 >> 2] | 0) + 40 >> 2] & 127]($245) | 0; else { + HEAP32[$246 >> 2] = $247 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$247 >> 0] | 0) | 0; + } + HEAP8[$6 >> 0] = 1; + $256 = HEAP8[$43 >> 0] | 0; + $$1130 = ($256 << 24 >> 24 < 0 ? HEAP32[$44 >> 2] | 0 : $256 & 255) >>> 0 > 1 ? $22 : $$0129; + break L46; + } + if ((HEAP8[((HEAP8[$41 >> 0] | 0) < 0 ? HEAP32[$21 >> 2] | 0 : $21) >> 0] | 0) != $215 << 24 >> 24) { + HEAP8[$6 >> 0] = 1; + $$1130 = $$0129; + break L46; + } + $222 = HEAP32[$0 >> 2] | 0; + $223 = $222 + 12 | 0; + $224 = HEAP32[$223 >> 2] | 0; + if (($224 | 0) == (HEAP32[$222 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$222 >> 2] | 0) + 40 >> 2] & 127]($222) | 0; else { + HEAP32[$223 >> 2] = $224 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$224 >> 0] | 0) | 0; + } + $233 = HEAP8[$41 >> 0] | 0; + $$1130 = ($233 << 24 >> 24 < 0 ? HEAP32[$42 >> 2] | 0 : $233 & 255) >>> 0 > 1 ? $21 : $$0129; + break L46; + } + if ($208) $$0$i$i189 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$203 >> 2] | 0) + 36 >> 2] & 127]($203) | 0; else $$0$i$i189 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$205 >> 0] | 0) | 0; + $275 = HEAP32[$0 >> 2] | 0; + $276 = $275 + 12 | 0; + $277 = HEAP32[$276 >> 2] | 0; + $280 = ($277 | 0) == (HEAP32[$275 + 16 >> 2] | 0); + if ((HEAP8[((HEAP8[$41 >> 0] | 0) < 0 ? HEAP32[$21 >> 2] | 0 : $21) >> 0] | 0) == ($$0$i$i189 & 255) << 24 >> 24) { + if ($280) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$275 >> 2] | 0) + 40 >> 2] & 127]($275) | 0; else { + HEAP32[$276 >> 2] = $277 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$277 >> 0] | 0) | 0; + } + $286 = HEAP8[$41 >> 0] | 0; + $$1130 = ($286 << 24 >> 24 < 0 ? HEAP32[$42 >> 2] | 0 : $286 & 255) >>> 0 > 1 ? $21 : $$0129; + break L46; + } + if ($280) $$0$i$i194 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$275 >> 2] | 0) + 36 >> 2] & 127]($275) | 0; else $$0$i$i194 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$277 >> 0] | 0) | 0; + if ((HEAP8[((HEAP8[$43 >> 0] | 0) < 0 ? HEAP32[$22 >> 2] | 0 : $22) >> 0] | 0) != ($$0$i$i194 & 255) << 24 >> 24) { + label = 105; + break L21; + } + $305 = HEAP32[$0 >> 2] | 0; + $306 = $305 + 12 | 0; + $307 = HEAP32[$306 >> 2] | 0; + if (($307 | 0) == (HEAP32[$305 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$305 >> 2] | 0) + 40 >> 2] & 127]($305) | 0; else { + HEAP32[$306 >> 2] = $307 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$307 >> 0] | 0) | 0; + } + HEAP8[$6 >> 0] = 1; + $316 = HEAP8[$43 >> 0] | 0; + $$1130 = ($316 << 24 >> 24 < 0 ? HEAP32[$44 >> 2] | 0 : $316 & 255) >>> 0 > 1 ? $22 : $$0129; + } + break; + } + case 2: + { + if ($$0131 >>> 0 < 2 | ($$0129 | 0) != 0) { + $335 = HEAP8[$49 >> 0] | 0; + $336 = $335 << 24 >> 24 < 0; + $337 = HEAP32[$20 >> 2] | 0; + $338 = $336 ? $337 : $20; + $339 = $338; + if (!$$0131) { + $$sroa$0313$1 = $339; + $793 = $337; + $794 = $335; + } else { + $346 = $335; + $348 = $336; + $350 = $338; + $364 = $339; + $792 = $337; + label = 110; + } + } else { + if (!($48 | ($$0131 | 0) == 2 & (HEAP8[$50 >> 0] | 0) != 0)) { + $$1130 = 0; + break L46; + } + $330 = HEAP8[$49 >> 0] | 0; + $331 = $330 << 24 >> 24 < 0; + $332 = HEAP32[$20 >> 2] | 0; + $333 = $331 ? $332 : $20; + $346 = $330; + $348 = $331; + $350 = $333; + $364 = $333; + $792 = $332; + label = 110; + } + L109 : do if ((label | 0) == 110) { + label = 0; + if ((HEAPU8[$16 + ($$0131 + -1) >> 0] | 0) < 2) { + $349 = $350 + ($348 ? HEAP32[$51 >> 2] | 0 : $346 & 255) | 0; + $$sroa$0313$0 = $364; + while (1) { + $351 = $$sroa$0313$0; + if (($349 | 0) == ($351 | 0)) break; + $353 = HEAP8[$351 >> 0] | 0; + if ($353 << 24 >> 24 <= -1) break; + if (!(HEAP16[(HEAP32[$40 >> 2] | 0) + ($353 << 24 >> 24 << 1) >> 1] & 8192)) break; + $$sroa$0313$0 = $351 + 1 | 0; + } + $363 = $$sroa$0313$0 - $364 | 0; + $365 = HEAP8[$52 >> 0] | 0; + $366 = $365 << 24 >> 24 < 0; + $367 = HEAP32[$53 >> 2] | 0; + $368 = $365 & 255; + if ($363 >>> 0 <= ($366 ? $367 : $368) >>> 0) { + $372 = (HEAP32[$23 >> 2] | 0) + $367 | 0; + $375 = $23 + $368 | 0; + $$pre$phiZ2D = $366 ? $372 : $375; + $$sroa$08$0$ptr$i = $350; + $380 = $366 ? $372 + (0 - $363) | 0 : $375 + (0 - $363) | 0; + while (1) { + if (($380 | 0) == ($$pre$phiZ2D | 0)) { + $$sroa$0313$1 = $$sroa$0313$0; + $793 = $792; + $794 = $346; + break L109; + } + if ((HEAP8[$380 >> 0] | 0) != (HEAP8[$$sroa$08$0$ptr$i >> 0] | 0)) { + $$sroa$0313$1 = $364; + $793 = $792; + $794 = $346; + break L109; + } + $$sroa$08$0$ptr$i = $$sroa$08$0$ptr$i + 1 | 0; + $380 = $380 + 1 | 0; + } + } else { + $$sroa$0313$1 = $364; + $793 = $792; + $794 = $346; + } + } else { + $$sroa$0313$1 = $364; + $793 = $792; + $794 = $346; + } + } while (0); + $$sroa$0293$0$ptr = $$sroa$0313$1; + $387 = $794; + $391 = $793; + $411 = $788; + L124 : while (1) { + $386 = $387 << 24 >> 24 < 0; + if (($$sroa$0293$0$ptr | 0) == (($386 ? $391 : $20) + ($386 ? HEAP32[$51 >> 2] | 0 : $387 & 255) | 0)) break; + $395 = HEAP32[$0 >> 2] | 0; + do if ($395) { + $398 = HEAP32[$395 + 12 >> 2] | 0; + if (($398 | 0) == (HEAP32[$395 + 16 >> 2] | 0)) $$0$i$i$i$i221 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$395 >> 2] | 0) + 36 >> 2] & 127]($395) | 0; else $$0$i$i$i$i221 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$398 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i221, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $795 = 1; + break; + } else { + $795 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $795 = 1; while (0); + do if ($411) { + $413 = HEAP32[$411 + 12 >> 2] | 0; + if (($413 | 0) == (HEAP32[$411 + 16 >> 2] | 0)) $$0$i$i2$i$i227 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$411 >> 2] | 0) + 36 >> 2] & 127]($411) | 0; else $$0$i$i2$i$i227 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$413 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i227, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($795) { + $796 = $411; + break; + } else break L124; else { + HEAP32[$1 >> 2] = 0; + label = 136; + break; + } + } else label = 136; while (0); + if ((label | 0) == 136) { + label = 0; + if ($795) break; else $796 = 0; + } + $425 = HEAP32[$0 >> 2] | 0; + $427 = HEAP32[$425 + 12 >> 2] | 0; + if (($427 | 0) == (HEAP32[$425 + 16 >> 2] | 0)) $$0$i$i233 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$425 >> 2] | 0) + 36 >> 2] & 127]($425) | 0; else $$0$i$i233 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$427 >> 0] | 0) | 0; + if ((HEAP8[$$sroa$0293$0$ptr >> 0] | 0) != ($$0$i$i233 & 255) << 24 >> 24) break; + $440 = HEAP32[$0 >> 2] | 0; + $441 = $440 + 12 | 0; + $442 = HEAP32[$441 >> 2] | 0; + if (($442 | 0) == (HEAP32[$440 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$440 >> 2] | 0) + 40 >> 2] & 127]($440) | 0; else { + HEAP32[$441 >> 2] = $442 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$442 >> 0] | 0) | 0; + } + $$sroa$0293$0$ptr = $$sroa$0293$0$ptr + 1 | 0; + $387 = HEAP8[$49 >> 0] | 0; + $391 = HEAP32[$20 >> 2] | 0; + $411 = $796; + } + if ($48 ? ($452 = HEAP8[$49 >> 0] | 0, $453 = $452 << 24 >> 24 < 0, ($$sroa$0293$0$ptr | 0) != (($453 ? HEAP32[$20 >> 2] | 0 : $20) + ($453 ? HEAP32[$51 >> 2] | 0 : $452 & 255) | 0)) : 0) { + label = 148; + break L21; + } else $$1130 = $$0129; + break; + } + case 4: + { + $$0124 = 0; + $479 = $788; + $789 = $788; + L161 : while (1) { + $463 = HEAP32[$0 >> 2] | 0; + do if ($463) { + $466 = HEAP32[$463 + 12 >> 2] | 0; + if (($466 | 0) == (HEAP32[$463 + 16 >> 2] | 0)) $$0$i$i$i$i237 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$463 >> 2] | 0) + 36 >> 2] & 127]($463) | 0; else $$0$i$i$i$i237 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$466 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i237, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $797 = 1; + break; + } else { + $797 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $797 = 1; while (0); + do if ($479) { + $481 = HEAP32[$479 + 12 >> 2] | 0; + if (($481 | 0) == (HEAP32[$479 + 16 >> 2] | 0)) $$0$i$i2$i$i243 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$479 >> 2] | 0) + 36 >> 2] & 127]($479) | 0; else $$0$i$i2$i$i243 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$481 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i243, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($797) { + $799 = $789; + $800 = $479; + break; + } else { + $570 = $789; + break L161; + } else { + HEAP32[$1 >> 2] = 0; + $798 = 0; + label = 162; + break; + } + } else { + $798 = $789; + label = 162; + } while (0); + if ((label | 0) == 162) { + label = 0; + if ($797) { + $570 = $798; + break; + } else { + $799 = $798; + $800 = 0; + } + } + $493 = HEAP32[$0 >> 2] | 0; + $495 = HEAP32[$493 + 12 >> 2] | 0; + if (($495 | 0) == (HEAP32[$493 + 16 >> 2] | 0)) $$0$i$i249 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$493 >> 2] | 0) + 36 >> 2] & 127]($493) | 0; else $$0$i$i249 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$495 >> 0] | 0) | 0; + $505 = $$0$i$i249 & 255; + if ($505 << 24 >> 24 > -1 ? (HEAP16[(HEAP32[$40 >> 2] | 0) + ($$0$i$i249 << 24 >> 24 << 1) >> 1] & 2048) != 0 : 0) { + $513 = HEAP32[$9 >> 2] | 0; + if (($513 | 0) == (HEAP32[$11 >> 2] | 0)) { + __ZNSt3__219__double_or_nothingIcEEvRNS_10unique_ptrIT_PFvPvEEERPS2_S9_($8, $9, $11); + $517 = HEAP32[$9 >> 2] | 0; + } else $517 = $513; + HEAP32[$9 >> 2] = $517 + 1; + HEAP8[$517 >> 0] = $505; + $$2126$ph = $$0124 + 1 | 0; + } else { + $519 = HEAP8[$45 >> 0] | 0; + if (!((HEAP8[$18 >> 0] | 0) == $505 << 24 >> 24 & ($$0124 | 0 ? (($519 << 24 >> 24 < 0 ? HEAP32[$46 >> 2] | 0 : $519 & 255) | 0) != 0 : 0))) { + $570 = $799; + break; + } + $528 = HEAP32[$14 >> 2] | 0; + if (($528 | 0) == (HEAP32[$15 >> 2] | 0)) { + __ZNSt3__219__double_or_nothingIjEEvRNS_10unique_ptrIT_PFvPvEEERPS2_S9_($13, $14, $15); + $532 = HEAP32[$14 >> 2] | 0; + } else $532 = $528; + HEAP32[$14 >> 2] = $532 + 4; + HEAP32[$532 >> 2] = $$0124; + $$2126$ph = 0; + } + $533 = HEAP32[$0 >> 2] | 0; + $534 = $533 + 12 | 0; + $535 = HEAP32[$534 >> 2] | 0; + if (($535 | 0) == (HEAP32[$533 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$533 >> 2] | 0) + 40 >> 2] & 127]($533) | 0; else { + HEAP32[$534 >> 2] = $535 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$535 >> 0] | 0) | 0; + } + $$0124 = $$2126$ph; + $479 = $800; + $789 = $799; + } + $545 = HEAP32[$14 >> 2] | 0; + if ($$0124 | 0 ? (HEAP32[$13 >> 2] | 0) != ($545 | 0) : 0) { + if (($545 | 0) == (HEAP32[$15 >> 2] | 0)) { + __ZNSt3__219__double_or_nothingIjEEvRNS_10unique_ptrIT_PFvPvEEERPS2_S9_($13, $14, $15); + $551 = HEAP32[$14 >> 2] | 0; + } else $551 = $545; + HEAP32[$14 >> 2] = $551 + 4; + HEAP32[$551 >> 2] = $$0124; + } + L213 : do if ((HEAP32[$24 >> 2] | 0) > 0) { + $554 = HEAP32[$0 >> 2] | 0; + do if ($554) { + $557 = HEAP32[$554 + 12 >> 2] | 0; + if (($557 | 0) == (HEAP32[$554 + 16 >> 2] | 0)) $$0$i$i$i$i254 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$554 >> 2] | 0) + 36 >> 2] & 127]($554) | 0; else $$0$i$i$i$i254 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$557 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i254, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $801 = 1; + break; + } else { + $801 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $801 = 1; while (0); + do if ($570) { + $572 = HEAP32[$570 + 12 >> 2] | 0; + if (($572 | 0) == (HEAP32[$570 + 16 >> 2] | 0)) $$0$i$i2$i$i260 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$570 >> 2] | 0) + 36 >> 2] & 127]($570) | 0; else $$0$i$i2$i$i260 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$572 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i260, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($801) { + $802 = $570; + break; + } else { + label = 204; + break L21; + } else { + HEAP32[$1 >> 2] = 0; + label = 198; + break; + } + } else label = 198; while (0); + if ((label | 0) == 198) { + label = 0; + if ($801) { + label = 204; + break L21; + } else $802 = 0; + } + $584 = HEAP32[$0 >> 2] | 0; + $586 = HEAP32[$584 + 12 >> 2] | 0; + if (($586 | 0) == (HEAP32[$584 + 16 >> 2] | 0)) $$0$i$i266 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$584 >> 2] | 0) + 36 >> 2] & 127]($584) | 0; else $$0$i$i266 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$586 >> 0] | 0) | 0; + if ((HEAP8[$17 >> 0] | 0) != ($$0$i$i266 & 255) << 24 >> 24) { + label = 204; + break L21; + } + $601 = HEAP32[$0 >> 2] | 0; + $602 = $601 + 12 | 0; + $603 = HEAP32[$602 >> 2] | 0; + if (($603 | 0) == (HEAP32[$601 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$601 >> 2] | 0) + 40 >> 2] & 127]($601) | 0; else { + HEAP32[$602 >> 2] = $603 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$603 >> 0] | 0) | 0; + } + $630 = $802; + while (1) { + if ((HEAP32[$24 >> 2] | 0) <= 0) break L213; + $614 = HEAP32[$0 >> 2] | 0; + do if ($614) { + $617 = HEAP32[$614 + 12 >> 2] | 0; + if (($617 | 0) == (HEAP32[$614 + 16 >> 2] | 0)) $$0$i$i$i$i269 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$614 >> 2] | 0) + 36 >> 2] & 127]($614) | 0; else $$0$i$i$i$i269 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$617 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i269, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $803 = 1; + break; + } else { + $803 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $803 = 1; while (0); + do if ($630) { + $632 = HEAP32[$630 + 12 >> 2] | 0; + if (($632 | 0) == (HEAP32[$630 + 16 >> 2] | 0)) $$0$i$i2$i$i275 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$630 >> 2] | 0) + 36 >> 2] & 127]($630) | 0; else $$0$i$i2$i$i275 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$632 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i275, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($803) { + $804 = $630; + break; + } else { + label = 230; + break L21; + } else { + HEAP32[$1 >> 2] = 0; + label = 223; + break; + } + } else label = 223; while (0); + if ((label | 0) == 223) { + label = 0; + if ($803) { + label = 230; + break L21; + } else $804 = 0; + } + $644 = HEAP32[$0 >> 2] | 0; + $646 = HEAP32[$644 + 12 >> 2] | 0; + if (($646 | 0) == (HEAP32[$644 + 16 >> 2] | 0)) $$0$i$i281 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$644 >> 2] | 0) + 36 >> 2] & 127]($644) | 0; else $$0$i$i281 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$646 >> 0] | 0) | 0; + if (($$0$i$i281 & 255) << 24 >> 24 <= -1) { + label = 230; + break L21; + } + if (!(HEAP16[(HEAP32[$40 >> 2] | 0) + ($$0$i$i281 << 24 >> 24 << 1) >> 1] & 2048)) { + label = 230; + break L21; + } + if ((HEAP32[$9 >> 2] | 0) == (HEAP32[$11 >> 2] | 0)) __ZNSt3__219__double_or_nothingIcEEvRNS_10unique_ptrIT_PFvPvEEERPS2_S9_($8, $9, $11); + $669 = HEAP32[$0 >> 2] | 0; + $671 = HEAP32[$669 + 12 >> 2] | 0; + if (($671 | 0) == (HEAP32[$669 + 16 >> 2] | 0)) $$0$i$i284 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$669 >> 2] | 0) + 36 >> 2] & 127]($669) | 0; else $$0$i$i284 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$671 >> 0] | 0) | 0; + $682 = HEAP32[$9 >> 2] | 0; + HEAP32[$9 >> 2] = $682 + 1; + HEAP8[$682 >> 0] = $$0$i$i284; + HEAP32[$24 >> 2] = (HEAP32[$24 >> 2] | 0) + -1; + $686 = HEAP32[$0 >> 2] | 0; + $687 = $686 + 12 | 0; + $688 = HEAP32[$687 >> 2] | 0; + if (($688 | 0) == (HEAP32[$686 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$686 >> 2] | 0) + 40 >> 2] & 127]($686) | 0; else { + HEAP32[$687 >> 2] = $688 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$688 >> 0] | 0) | 0; + } + $630 = $804; + } + } while (0); + if ((HEAP32[$9 >> 2] | 0) == (HEAP32[$8 >> 2] | 0)) { + label = 241; + break L21; + } else $$1130 = $$0129; + break; + } + default: + $$1130 = $$0129; + } while (0); + L289 : do if ((label | 0) == 47) { + label = 0; + $141 = $788; + while (1) { + $125 = HEAP32[$0 >> 2] | 0; + do if ($125) { + $128 = HEAP32[$125 + 12 >> 2] | 0; + if (($128 | 0) == (HEAP32[$125 + 16 >> 2] | 0)) $$0$i$i$i$i161 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$125 >> 2] | 0) + 36 >> 2] & 127]($125) | 0; else $$0$i$i$i$i161 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$128 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i161, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $790 = 1; + break; + } else { + $790 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $790 = 1; while (0); + do if ($141) { + $143 = HEAP32[$141 + 12 >> 2] | 0; + if (($143 | 0) == (HEAP32[$141 + 16 >> 2] | 0)) $$0$i$i2$i$i167 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$141 >> 2] | 0) + 36 >> 2] & 127]($141) | 0; else $$0$i$i2$i$i167 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$143 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i167, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($790) { + $791 = $141; + break; + } else { + $$1130 = $$0129; + break L289; + } else { + HEAP32[$1 >> 2] = 0; + label = 61; + break; + } + } else label = 61; while (0); + if ((label | 0) == 61) { + label = 0; + if ($790) { + $$1130 = $$0129; + break L289; + } else $791 = 0; + } + $155 = HEAP32[$0 >> 2] | 0; + $157 = HEAP32[$155 + 12 >> 2] | 0; + if (($157 | 0) == (HEAP32[$155 + 16 >> 2] | 0)) $$0$i$i173 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$155 >> 2] | 0) + 36 >> 2] & 127]($155) | 0; else $$0$i$i173 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$157 >> 0] | 0) | 0; + if (($$0$i$i173 & 255) << 24 >> 24 <= -1) { + $$1130 = $$0129; + break L289; + } + if (!(HEAP16[(HEAP32[$40 >> 2] | 0) + ($$0$i$i173 << 24 >> 24 << 1) >> 1] & 8192)) { + $$1130 = $$0129; + break L289; + } + $175 = HEAP32[$0 >> 2] | 0; + $176 = $175 + 12 | 0; + $177 = HEAP32[$176 >> 2] | 0; + if (($177 | 0) == (HEAP32[$175 + 16 >> 2] | 0)) $$0$i$i176 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$175 >> 2] | 0) + 40 >> 2] & 127]($175) | 0; else { + HEAP32[$176 >> 2] = $177 + 1; + $$0$i$i176 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$177 >> 0] | 0) | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc($23, $$0$i$i176 & 255); + $141 = $791; + } + } while (0); + $$0129 = $$1130; + $$0131 = $$0131 + 1 | 0; + } + L326 : do if ((label | 0) == 45) { + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$10 = 0; + } else if ((label | 0) == 105) { + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$10 = 0; + } else if ((label | 0) == 148) { + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$10 = 0; + } else if ((label | 0) == 204) { + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$10 = 0; + } else if ((label | 0) == 230) { + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$10 = 0; + } else if ((label | 0) == 241) { + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$10 = 0; + } else if ((label | 0) == 243) { + L328 : do if ($$0129 | 0) { + $704 = $$0129 + 11 | 0; + $705 = $$0129 + 4 | 0; + $$0 = 1; + L330 : while (1) { + $706 = HEAP8[$704 >> 0] | 0; + if ($706 << 24 >> 24 < 0) $711 = HEAP32[$705 >> 2] | 0; else $711 = $706 & 255; + if ($$0 >>> 0 >= $711 >>> 0) break L328; + $712 = HEAP32[$0 >> 2] | 0; + do if ($712) { + $715 = HEAP32[$712 + 12 >> 2] | 0; + if (($715 | 0) == (HEAP32[$712 + 16 >> 2] | 0)) $$0$i$i$i$i205 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$712 >> 2] | 0) + 36 >> 2] & 127]($712) | 0; else $$0$i$i$i$i205 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$715 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i205, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $805 = 1; + break; + } else { + $805 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $805 = 1; while (0); + $727 = HEAP32[$1 >> 2] | 0; + do if ($727) { + $730 = HEAP32[$727 + 12 >> 2] | 0; + if (($730 | 0) == (HEAP32[$727 + 16 >> 2] | 0)) $$0$i$i2$i$i211 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$727 >> 2] | 0) + 36 >> 2] & 127]($727) | 0; else $$0$i$i2$i$i211 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$730 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i211, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($805) break; else break L330; else { + HEAP32[$1 >> 2] = 0; + label = 262; + break; + } + } else label = 262; while (0); + if ((label | 0) == 262 ? (label = 0, $805) : 0) break; + $742 = HEAP32[$0 >> 2] | 0; + $744 = HEAP32[$742 + 12 >> 2] | 0; + if (($744 | 0) == (HEAP32[$742 + 16 >> 2] | 0)) $$0$i$i202 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$742 >> 2] | 0) + 36 >> 2] & 127]($742) | 0; else $$0$i$i202 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$744 >> 0] | 0) | 0; + if ((HEAP8[$704 >> 0] | 0) < 0) $759 = HEAP32[$$0129 >> 2] | 0; else $759 = $$0129; + if ((HEAP8[$759 + $$0 >> 0] | 0) != ($$0$i$i202 & 255) << 24 >> 24) break; + $765 = HEAP32[$0 >> 2] | 0; + $766 = $765 + 12 | 0; + $767 = HEAP32[$766 >> 2] | 0; + if (($767 | 0) == (HEAP32[$765 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$765 >> 2] | 0) + 40 >> 2] & 127]($765) | 0; else { + HEAP32[$766 >> 2] = $767 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$767 >> 0] | 0) | 0; + } + $$0 = $$0 + 1 | 0; + } + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$10 = 0; + break L326; + } while (0); + $776 = HEAP32[$13 >> 2] | 0; + $777 = HEAP32[$14 >> 2] | 0; + if (($776 | 0) != ($777 | 0)) { + HEAP32[$25 >> 2] = 0; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($19, $776, $777, $25); + if (!(HEAP32[$25 >> 2] | 0)) { + $$10 = 1; + break; + } else { + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$10 = 0; + break; + } + } else $$10 = 1; + } while (0); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($23); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($22); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($21); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($20); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($19); + $783 = HEAP32[$13 >> 2] | 0; + HEAP32[$13 >> 2] = 0; + if ($783 | 0) FUNCTION_TABLE_vi[HEAP32[$13 + 4 >> 2] & 255]($783); + STACKTOP = sp; + return $$10 | 0; +} + +function __ZN6vision25DoGScaleInvariantDetector15extractFeaturesEPKNS_25GaussianScaleSpacePyramidEPKNS_10DoGPyramidE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0750 = 0, $$0752 = 0, $$0753 = 0, $$0754 = 0, $$0756 = 0, $$0757 = 0, $$0759 = 0, $10 = 0, $102 = 0.0, $103 = 0, $105 = 0.0, $11 = 0, $110 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $187 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $260 = 0.0, $262 = 0, $268 = 0, $272 = 0, $275 = 0, $283 = 0, $288 = 0, $292 = 0, $294 = 0, $3 = 0, $302 = 0, $307 = 0, $31 = 0, $311 = 0, $319 = 0, $32 = 0, $327 = 0, $328 = 0.0, $33 = 0, $330 = 0, $331 = 0, $332 = 0, $333 = 0, $334 = 0, $335 = 0, $336 = 0, $337 = 0, $338 = 0.0, $34 = 0, $340 = 0.0, $341 = 0.0, $342 = 0.0, $344 = 0, $348 = 0.0, $35 = 0, $350 = 0.0, $351 = 0.0, $352 = 0, $353 = 0, $359 = 0, $36 = 0, $37 = 0, $4 = 0, $40 = 0, $405 = 0.0, $408 = 0.0, $411 = 0.0, $412 = 0.0, $415 = 0.0, $418 = 0.0, $421 = 0.0, $424 = 0.0, $427 = 0.0, $43 = 0, $430 = 0.0, $433 = 0.0, $439 = 0, $485 = 0.0, $488 = 0.0, $491 = 0.0, $492 = 0.0, $495 = 0.0, $498 = 0.0, $501 = 0.0, $504 = 0.0, $507 = 0.0, $51 = 0, $510 = 0.0, $514 = 0.0, $515 = 0, $522 = 0, $526 = 0, $530 = 0, $538 = 0, $543 = 0, $547 = 0, $549 = 0, $557 = 0, $56 = 0, $562 = 0, $566 = 0, $568 = 0, $570 = 0, $571 = 0.0, $573 = 0, $574 = 0, $575 = 0, $576 = 0, $577 = 0, $578 = 0, $579 = 0, $580 = 0, $583 = 0.0, $584 = 0.0, $585 = 0.0, $586 = 0.0, $588 = 0, $594 = 0.0, $595 = 0.0, $596 = 0, $597 = 0, $6 = 0, $60 = 0, $603 = 0, $61 = 0, $649 = 0.0, $652 = 0.0, $655 = 0.0, $656 = 0.0, $659 = 0.0, $662 = 0.0, $665 = 0.0, $668 = 0.0, $671 = 0.0, $674 = 0.0, $677 = 0.0, $683 = 0, $69 = 0, $729 = 0.0, $732 = 0.0, $735 = 0.0, $736 = 0.0, $739 = 0.0, $74 = 0, $742 = 0.0, $745 = 0.0, $748 = 0.0, $751 = 0.0, $754 = 0.0, $758 = 0.0, $760 = 0, $78 = 0, $80 = 0, $82 = 0, $83 = 0.0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0.0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0.0, $98 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $3 = sp; + $4 = $0 + 60 | 0; + $6 = $0 + 64 | 0; + HEAP32[$6 >> 2] = HEAP32[$4 >> 2]; + $9 = +__ZN6vision3sqrIfEET_S1_(+HEAPF32[$0 + 52 >> 2]); + $10 = $0 + 32 | 0; + $11 = $3 + 12 | 0; + $12 = $3 + 16 | 0; + $13 = $3 + 24 | 0; + $14 = $3 + 28 | 0; + $15 = $3 + 4 | 0; + $16 = $0 + 68 | 0; + $17 = $3 + 12 | 0; + $18 = $3 + 16 | 0; + $19 = $3 + 24 | 0; + $20 = $3 + 28 | 0; + $21 = $3 + 4 | 0; + $22 = $3 + 12 | 0; + $23 = $3 + 16 | 0; + $24 = $3 + 24 | 0; + $25 = $3 + 28 | 0; + $26 = $3 + 4 | 0; + $$0750 = 1; + L1 : while (1) { + if ($$0750 >>> 0 >= ((__ZNK6vision10DoGPyramid4sizeEv($10) | 0) + -1 | 0) >>> 0) { + label = 3; + break; + } + $31 = __ZNK6vision10DoGPyramid3getEm($2, $$0750 + -1 | 0) | 0; + $32 = __ZNK6vision10DoGPyramid3getEm($2, $$0750) | 0; + $33 = $$0750 + 1 | 0; + $34 = __ZNK6vision10DoGPyramid3getEm($2, $33) | 0; + $35 = __ZNK6vision10DoGPyramid15octaveFromIndexEi($2, $$0750) | 0; + $36 = __ZNK6vision10DoGPyramid14scaleFromIndexEi($2, $$0750) | 0; + $37 = __ZNK6vision5Image5widthEv($31) | 0; + L4 : do if (($37 | 0) == (__ZNK6vision5Image5widthEv($32) | 0) ? ($40 = __ZNK6vision5Image5widthEv($31) | 0, ($40 | 0) == (__ZNK6vision5Image5widthEv($34) | 0)) : 0) { + $43 = __ZNK6vision5Image6heightEv($31) | 0; + if (($43 | 0) != (__ZNK6vision5Image6heightEv($32) | 0)) { + label = 7; + break L1; + } + $61 = __ZNK6vision5Image6heightEv($31) | 0; + if (($61 | 0) != (__ZNK6vision5Image6heightEv($34) | 0)) { + label = 9; + break L1; + } + $80 = (__ZNK6vision5Image5widthEv($32) | 0) + -1 | 0; + $82 = (__ZNK6vision5Image6heightEv($32) | 0) + -1 | 0; + $83 = +($36 | 0); + $$0752 = 1; + while (1) { + if ($$0752 >>> 0 >= $82 >>> 0) break L4; + $85 = $$0752 + -1 | 0; + $86 = __ZNK6vision5Image3getIfEEPKT_m($31, $85) | 0; + $87 = __ZNK6vision5Image3getIfEEPKT_m($31, $$0752) | 0; + $88 = $$0752 + 1 | 0; + $89 = __ZNK6vision5Image3getIfEEPKT_m($31, $88) | 0; + $90 = __ZNK6vision5Image3getIfEEPKT_m($32, $85) | 0; + $91 = __ZNK6vision5Image3getIfEEPKT_m($32, $$0752) | 0; + $92 = __ZNK6vision5Image3getIfEEPKT_m($32, $88) | 0; + $93 = __ZNK6vision5Image3getIfEEPKT_m($34, $85) | 0; + $94 = __ZNK6vision5Image3getIfEEPKT_m($34, $$0752) | 0; + $95 = __ZNK6vision5Image3getIfEEPKT_m($34, $88) | 0; + $96 = +($$0752 >>> 0); + $$0754 = 1; + while (1) { + if ($$0754 >>> 0 >= $80 >>> 0) break; + $98 = $91 + ($$0754 << 2) | 0; + do if (!(+__ZN6vision3sqrIfEET_S1_(+HEAPF32[$98 >> 2]) < $9)) { + $102 = +HEAPF32[$98 >> 2]; + $103 = $$0754 + -1 | 0; + $105 = +HEAPF32[$86 + ($103 << 2) >> 2]; + do if ((((($102 > $105 ? $102 > +HEAPF32[$86 + ($$0754 << 2) >> 2] : 0) ? ($110 = $$0754 + 1 | 0, $102 > +HEAPF32[$86 + ($110 << 2) >> 2]) : 0) ? $102 > +HEAPF32[$87 + ($103 << 2) >> 2] : 0) ? $102 > +HEAPF32[$87 + ($$0754 << 2) >> 2] : 0) ? $102 > +HEAPF32[$87 + ($110 << 2) >> 2] : 0) { + if (!($102 > +HEAPF32[$89 + ($103 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$89 + ($$0754 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$89 + ($110 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$90 + ($103 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$90 + ($$0754 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$90 + ($110 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$91 + ($103 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$91 + ($110 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$92 + ($103 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$92 + ($$0754 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$92 + ($110 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$93 + ($103 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$93 + ($$0754 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$93 + ($110 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$94 + ($103 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$94 + ($$0754 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$94 + ($110 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$95 + ($103 << 2) >> 2])) { + label = 42; + break; + } + if (!($102 > +HEAPF32[$95 + ($$0754 << 2) >> 2])) { + label = 42; + break; + } + if ($102 > +HEAPF32[$95 + ($110 << 2) >> 2]) {} else label = 42; + } else label = 42; while (0); + if ((label | 0) == 42) { + label = 0; + if (!($102 < $105)) break; + if (!($102 < +HEAPF32[$86 + ($$0754 << 2) >> 2])) break; + $187 = $$0754 + 1 | 0; + if (!($102 < +HEAPF32[$86 + ($187 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$87 + ($103 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$87 + ($$0754 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$87 + ($187 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$89 + ($103 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$89 + ($$0754 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$89 + ($187 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$90 + ($103 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$90 + ($$0754 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$90 + ($187 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$91 + ($103 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$91 + ($187 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$92 + ($103 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$92 + ($$0754 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$92 + ($187 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$93 + ($103 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$93 + ($$0754 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$93 + ($187 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$94 + ($103 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$94 + ($$0754 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$94 + ($187 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$95 + ($103 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$95 + ($$0754 << 2) >> 2])) break; + if (!($102 < +HEAPF32[$95 + ($187 << 2) >> 2])) break; + } + HEAP32[$11 >> 2] = $35; + HEAP32[$12 >> 2] = $36; + HEAPF32[$13 >> 2] = $102; + $260 = +__ZNK6vision25GaussianScaleSpacePyramid14effectiveSigmaEmf($1, $35, $83); + HEAPF32[$14 >> 2] = $260; + __ZN6vision23bilinear_upsample_pointERfS0_ffi($3, $15, +($$0754 >>> 0), $96, $35); + $262 = HEAP32[$6 >> 2] | 0; + if (($262 | 0) == (HEAP32[$16 >> 2] | 0)) { + __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE21__push_back_slow_pathIRKS3_EEvOT_($4, $3); + break; + } else { + dest = $262; + src = $3; + stop = dest + 36 | 0; + do { + HEAP32[dest >> 2] = HEAP32[src >> 2]; + dest = dest + 4 | 0; + src = src + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$6 >> 2] = (HEAP32[$6 >> 2] | 0) + 36; + break; + } + } while (0); + $$0754 = $$0754 + 1 | 0; + } + $$0752 = $88; + } + } else label = 72; while (0); + L76 : do if ((label | 0) == 72) { + label = 0; + $268 = __ZNK6vision5Image5widthEv($31) | 0; + if (($268 | 0) == (__ZNK6vision5Image5widthEv($32) | 0) ? ($272 = (__ZNK6vision5Image5widthEv($32) | 0) >>> 1, ($272 | 0) == (__ZNK6vision5Image5widthEv($34) | 0)) : 0) { + $275 = __ZNK6vision5Image6heightEv($31) | 0; + if (($275 | 0) != (__ZNK6vision5Image6heightEv($32) | 0)) { + label = 75; + break L1; + } + $294 = (__ZNK6vision5Image6heightEv($32) | 0) >>> 1; + if (($294 | 0) != (__ZNK6vision5Image6heightEv($34) | 0)) { + label = 77; + break L1; + } + $319 = ~~+Math_floor(+((+(((__ZNK6vision5Image5widthEv($34) | 0) + -1 | 0) >>> 0) + -.5) * 2.0 + .5)) >>> 0; + $327 = ~~+Math_floor(+((+(((__ZNK6vision5Image6heightEv($34) | 0) + -1 | 0) >>> 0) + -.5) * 2.0 + .5)) >>> 0; + $328 = +($36 | 0); + $$0756 = 2; + while (1) { + if ($$0756 >>> 0 >= $327 >>> 0) break L76; + $330 = $$0756 + -1 | 0; + $331 = __ZNK6vision5Image3getIfEEPKT_m($31, $330) | 0; + $332 = __ZNK6vision5Image3getIfEEPKT_m($31, $$0756) | 0; + $333 = $$0756 + 1 | 0; + $334 = __ZNK6vision5Image3getIfEEPKT_m($31, $333) | 0; + $335 = __ZNK6vision5Image3getIfEEPKT_m($32, $330) | 0; + $336 = __ZNK6vision5Image3getIfEEPKT_m($32, $$0756) | 0; + $337 = __ZNK6vision5Image3getIfEEPKT_m($32, $333) | 0; + $338 = +($$0756 >>> 0); + $340 = $338 * .5 + -.25; + $341 = $340 + -.5; + $342 = $340 + .5; + $$0757 = 2; + while (1) { + if ($$0757 >>> 0 >= $319 >>> 0) break; + $344 = $336 + ($$0757 << 2) | 0; + do if (!(+__ZN6vision3sqrIfEET_S1_(+HEAPF32[$344 >> 2]) < $9)) { + $348 = +($$0757 >>> 0); + $350 = $348 * .5 + -.25; + $351 = +HEAPF32[$344 >> 2]; + $352 = $$0757 + -1 | 0; + $353 = $331 + ($352 << 2) | 0; + do if ((($351 > +HEAPF32[$353 >> 2] ? $351 > +HEAPF32[$331 + ($$0757 << 2) >> 2] : 0) ? ($359 = $$0757 + 1 | 0, $351 > +HEAPF32[$331 + ($359 << 2) >> 2]) : 0) ? $351 > +HEAPF32[$332 + ($352 << 2) >> 2] : 0) { + if (!($351 > +HEAPF32[$332 + ($$0757 << 2) >> 2])) { + label = 110; + break; + } + if (!($351 > +HEAPF32[$332 + ($359 << 2) >> 2])) { + label = 110; + break; + } + if (!($351 > +HEAPF32[$334 + ($352 << 2) >> 2])) { + label = 110; + break; + } + if (!($351 > +HEAPF32[$334 + ($$0757 << 2) >> 2])) { + label = 110; + break; + } + if (!($351 > +HEAPF32[$334 + ($359 << 2) >> 2])) { + label = 110; + break; + } + if (!($351 > +HEAPF32[$335 + ($352 << 2) >> 2])) { + label = 110; + break; + } + if (!($351 > +HEAPF32[$335 + ($$0757 << 2) >> 2])) { + label = 110; + break; + } + if (!($351 > +HEAPF32[$335 + ($359 << 2) >> 2])) { + label = 110; + break; + } + if (!($351 > +HEAPF32[$336 + ($352 << 2) >> 2])) { + label = 110; + break; + } + if (!($351 > +HEAPF32[$336 + ($359 << 2) >> 2])) { + label = 110; + break; + } + if (!($351 > +HEAPF32[$337 + ($352 << 2) >> 2])) { + label = 110; + break; + } + if (!($351 > +HEAPF32[$337 + ($$0757 << 2) >> 2])) { + label = 110; + break; + } + if (!($351 > +HEAPF32[$337 + ($359 << 2) >> 2])) { + label = 110; + break; + } + $405 = $350 + -.5; + if (!($351 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $405, $341))) { + label = 110; + break; + } + $408 = +HEAPF32[$344 >> 2]; + if (!($408 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $350, $341))) { + label = 110; + break; + } + $411 = +HEAPF32[$344 >> 2]; + $412 = $350 + .5; + if (!($411 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $412, $341))) { + label = 110; + break; + } + $415 = +HEAPF32[$344 >> 2]; + if (!($415 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $405, $340))) { + label = 110; + break; + } + $418 = +HEAPF32[$344 >> 2]; + if (!($418 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $350, $340))) { + label = 110; + break; + } + $421 = +HEAPF32[$344 >> 2]; + if (!($421 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $412, $340))) { + label = 110; + break; + } + $424 = +HEAPF32[$344 >> 2]; + if (!($424 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $405, $342))) { + label = 110; + break; + } + $427 = +HEAPF32[$344 >> 2]; + if (!($427 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $350, $342))) { + label = 110; + break; + } + $430 = +HEAPF32[$344 >> 2]; + if ($430 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $412, $342)) {} else label = 110; + } else label = 110; while (0); + if ((label | 0) == 110) { + label = 0; + $433 = +HEAPF32[$344 >> 2]; + if (!($433 < +HEAPF32[$353 >> 2])) break; + if (!($433 < +HEAPF32[$331 + ($$0757 << 2) >> 2])) break; + $439 = $$0757 + 1 | 0; + if (!($433 < +HEAPF32[$331 + ($439 << 2) >> 2])) break; + if (!($433 < +HEAPF32[$332 + ($352 << 2) >> 2])) break; + if (!($433 < +HEAPF32[$332 + ($$0757 << 2) >> 2])) break; + if (!($433 < +HEAPF32[$332 + ($439 << 2) >> 2])) break; + if (!($433 < +HEAPF32[$334 + ($352 << 2) >> 2])) break; + if (!($433 < +HEAPF32[$334 + ($$0757 << 2) >> 2])) break; + if (!($433 < +HEAPF32[$334 + ($439 << 2) >> 2])) break; + if (!($433 < +HEAPF32[$335 + ($352 << 2) >> 2])) break; + if (!($433 < +HEAPF32[$335 + ($$0757 << 2) >> 2])) break; + if (!($433 < +HEAPF32[$335 + ($439 << 2) >> 2])) break; + if (!($433 < +HEAPF32[$336 + ($352 << 2) >> 2])) break; + if (!($433 < +HEAPF32[$336 + ($439 << 2) >> 2])) break; + if (!($433 < +HEAPF32[$337 + ($352 << 2) >> 2])) break; + if (!($433 < +HEAPF32[$337 + ($$0757 << 2) >> 2])) break; + if (!($433 < +HEAPF32[$337 + ($439 << 2) >> 2])) break; + $485 = $350 + -.5; + if (!($433 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $485, $341))) break; + $488 = +HEAPF32[$344 >> 2]; + if (!($488 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $350, $341))) break; + $491 = +HEAPF32[$344 >> 2]; + $492 = $350 + .5; + if (!($491 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $492, $341))) break; + $495 = +HEAPF32[$344 >> 2]; + if (!($495 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $485, $340))) break; + $498 = +HEAPF32[$344 >> 2]; + if (!($498 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $350, $340))) break; + $501 = +HEAPF32[$344 >> 2]; + if (!($501 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $492, $340))) break; + $504 = +HEAPF32[$344 >> 2]; + if (!($504 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $485, $342))) break; + $507 = +HEAPF32[$344 >> 2]; + if (!($507 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $350, $342))) break; + $510 = +HEAPF32[$344 >> 2]; + if (!($510 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($34, $492, $342))) break; + } + HEAP32[$17 >> 2] = $35; + HEAP32[$18 >> 2] = $36; + HEAP32[$19 >> 2] = HEAP32[$344 >> 2]; + $514 = +__ZNK6vision25GaussianScaleSpacePyramid14effectiveSigmaEmf($1, $35, $328); + HEAPF32[$20 >> 2] = $514; + __ZN6vision23bilinear_upsample_pointERfS0_ffi($3, $21, $348, $338, $35); + $515 = HEAP32[$6 >> 2] | 0; + if (($515 | 0) == (HEAP32[$16 >> 2] | 0)) { + __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE21__push_back_slow_pathIRKS3_EEvOT_($4, $3); + break; + } else { + dest = $515; + src = $3; + stop = dest + 36 | 0; + do { + HEAP32[dest >> 2] = HEAP32[src >> 2]; + dest = dest + 4 | 0; + src = src + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$6 >> 2] = (HEAP32[$6 >> 2] | 0) + 36; + break; + } + } while (0); + $$0757 = $$0757 + 1 | 0; + } + $$0756 = $333; + } + } + $522 = (__ZNK6vision5Image5widthEv($31) | 0) >>> 1; + if (($522 | 0) == (__ZNK6vision5Image5widthEv($32) | 0) ? ($526 = (__ZNK6vision5Image5widthEv($31) | 0) >>> 1, ($526 | 0) == (__ZNK6vision5Image5widthEv($34) | 0)) : 0) { + $530 = (__ZNK6vision5Image6heightEv($31) | 0) >>> 1; + if (($530 | 0) != (__ZNK6vision5Image6heightEv($32) | 0)) { + label = 144; + break L1; + } + $549 = (__ZNK6vision5Image6heightEv($31) | 0) >>> 1; + if (($549 | 0) != (__ZNK6vision5Image6heightEv($34) | 0)) { + label = 146; + break L1; + } + $568 = (__ZNK6vision5Image5widthEv($32) | 0) + -1 | 0; + $570 = (__ZNK6vision5Image6heightEv($32) | 0) + -1 | 0; + $571 = +($36 | 0); + $$0759 = 1; + while (1) { + if ($$0759 >>> 0 >= $570 >>> 0) break L76; + $573 = $$0759 + -1 | 0; + $574 = __ZNK6vision5Image3getIfEEPKT_m($32, $573) | 0; + $575 = __ZNK6vision5Image3getIfEEPKT_m($32, $$0759) | 0; + $576 = $$0759 + 1 | 0; + $577 = __ZNK6vision5Image3getIfEEPKT_m($32, $576) | 0; + $578 = __ZNK6vision5Image3getIfEEPKT_m($34, $573) | 0; + $579 = __ZNK6vision5Image3getIfEEPKT_m($34, $$0759) | 0; + $580 = __ZNK6vision5Image3getIfEEPKT_m($34, $576) | 0; + $583 = +($$0759 << 1 >>> 0) + .5; + $584 = +($$0759 >>> 0); + $585 = $583 + -2.0; + $586 = $583 + 2.0; + $$0753 = 1; + while (1) { + if ($$0753 >>> 0 >= $568 >>> 0) break; + $588 = $575 + ($$0753 << 2) | 0; + do if (!(+__ZN6vision3sqrIfEET_S1_(+HEAPF32[$588 >> 2]) < $9)) { + $594 = +($$0753 << 1 >>> 0) + .5; + $595 = +HEAPF32[$588 >> 2]; + $596 = $$0753 + -1 | 0; + $597 = $574 + ($596 << 2) | 0; + do if ((($595 > +HEAPF32[$597 >> 2] ? $595 > +HEAPF32[$574 + ($$0753 << 2) >> 2] : 0) ? ($603 = $$0753 + 1 | 0, $595 > +HEAPF32[$574 + ($603 << 2) >> 2]) : 0) ? $595 > +HEAPF32[$575 + ($596 << 2) >> 2] : 0) { + if (!($595 > +HEAPF32[$575 + ($603 << 2) >> 2])) { + label = 179; + break; + } + if (!($595 > +HEAPF32[$577 + ($596 << 2) >> 2])) { + label = 179; + break; + } + if (!($595 > +HEAPF32[$577 + ($$0753 << 2) >> 2])) { + label = 179; + break; + } + if (!($595 > +HEAPF32[$577 + ($603 << 2) >> 2])) { + label = 179; + break; + } + if (!($595 > +HEAPF32[$578 + ($596 << 2) >> 2])) { + label = 179; + break; + } + if (!($595 > +HEAPF32[$578 + ($$0753 << 2) >> 2])) { + label = 179; + break; + } + if (!($595 > +HEAPF32[$578 + ($603 << 2) >> 2])) { + label = 179; + break; + } + if (!($595 > +HEAPF32[$579 + ($596 << 2) >> 2])) { + label = 179; + break; + } + if (!($595 > +HEAPF32[$579 + ($$0753 << 2) >> 2])) { + label = 179; + break; + } + if (!($595 > +HEAPF32[$579 + ($603 << 2) >> 2])) { + label = 179; + break; + } + if (!($595 > +HEAPF32[$580 + ($596 << 2) >> 2])) { + label = 179; + break; + } + if (!($595 > +HEAPF32[$580 + ($$0753 << 2) >> 2])) { + label = 179; + break; + } + if (!($595 > +HEAPF32[$580 + ($603 << 2) >> 2])) { + label = 179; + break; + } + $649 = $594 + -2.0; + if (!($595 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $649, $585))) { + label = 179; + break; + } + $652 = +HEAPF32[$588 >> 2]; + if (!($652 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $594, $585))) { + label = 179; + break; + } + $655 = +HEAPF32[$588 >> 2]; + $656 = $594 + 2.0; + if (!($655 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $656, $585))) { + label = 179; + break; + } + $659 = +HEAPF32[$588 >> 2]; + if (!($659 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $649, $583))) { + label = 179; + break; + } + $662 = +HEAPF32[$588 >> 2]; + if (!($662 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $594, $583))) { + label = 179; + break; + } + $665 = +HEAPF32[$588 >> 2]; + if (!($665 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $656, $583))) { + label = 179; + break; + } + $668 = +HEAPF32[$588 >> 2]; + if (!($668 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $649, $586))) { + label = 179; + break; + } + $671 = +HEAPF32[$588 >> 2]; + if (!($671 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $594, $586))) { + label = 179; + break; + } + $674 = +HEAPF32[$588 >> 2]; + if ($674 > +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $656, $586)) {} else label = 179; + } else label = 179; while (0); + if ((label | 0) == 179) { + label = 0; + $677 = +HEAPF32[$588 >> 2]; + if (!($677 < +HEAPF32[$597 >> 2])) break; + if (!($677 < +HEAPF32[$574 + ($$0753 << 2) >> 2])) break; + $683 = $$0753 + 1 | 0; + if (!($677 < +HEAPF32[$574 + ($683 << 2) >> 2])) break; + if (!($677 < +HEAPF32[$575 + ($596 << 2) >> 2])) break; + if (!($677 < +HEAPF32[$575 + ($683 << 2) >> 2])) break; + if (!($677 < +HEAPF32[$577 + ($596 << 2) >> 2])) break; + if (!($677 < +HEAPF32[$577 + ($$0753 << 2) >> 2])) break; + if (!($677 < +HEAPF32[$577 + ($683 << 2) >> 2])) break; + if (!($677 < +HEAPF32[$578 + ($596 << 2) >> 2])) break; + if (!($677 < +HEAPF32[$578 + ($$0753 << 2) >> 2])) break; + if (!($677 < +HEAPF32[$578 + ($683 << 2) >> 2])) break; + if (!($677 < +HEAPF32[$579 + ($596 << 2) >> 2])) break; + if (!($677 < +HEAPF32[$579 + ($$0753 << 2) >> 2])) break; + if (!($677 < +HEAPF32[$579 + ($683 << 2) >> 2])) break; + if (!($677 < +HEAPF32[$580 + ($596 << 2) >> 2])) break; + if (!($677 < +HEAPF32[$580 + ($$0753 << 2) >> 2])) break; + if (!($677 < +HEAPF32[$580 + ($683 << 2) >> 2])) break; + $729 = $594 + -2.0; + if (!($677 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $729, $585))) break; + $732 = +HEAPF32[$588 >> 2]; + if (!($732 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $594, $585))) break; + $735 = +HEAPF32[$588 >> 2]; + $736 = $594 + 2.0; + if (!($735 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $736, $585))) break; + $739 = +HEAPF32[$588 >> 2]; + if (!($739 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $729, $583))) break; + $742 = +HEAPF32[$588 >> 2]; + if (!($742 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $594, $583))) break; + $745 = +HEAPF32[$588 >> 2]; + if (!($745 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $736, $583))) break; + $748 = +HEAPF32[$588 >> 2]; + if (!($748 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $729, $586))) break; + $751 = +HEAPF32[$588 >> 2]; + if (!($751 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $594, $586))) break; + $754 = +HEAPF32[$588 >> 2]; + if (!($754 < +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($31, $736, $586))) break; + } + HEAP32[$22 >> 2] = $35; + HEAP32[$23 >> 2] = $36; + HEAP32[$24 >> 2] = HEAP32[$588 >> 2]; + $758 = +__ZNK6vision25GaussianScaleSpacePyramid14effectiveSigmaEmf($1, $35, $571); + HEAPF32[$25 >> 2] = $758; + __ZN6vision23bilinear_upsample_pointERfS0_ffi($3, $26, +($$0753 >>> 0), $584, $35); + $760 = HEAP32[$6 >> 2] | 0; + if (($760 | 0) == (HEAP32[$16 >> 2] | 0)) { + __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE21__push_back_slow_pathIRKS3_EEvOT_($4, $3); + break; + } else { + dest = $760; + src = $3; + stop = dest + 36 | 0; + do { + HEAP32[dest >> 2] = HEAP32[src >> 2]; + dest = dest + 4 | 0; + src = src + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$6 >> 2] = (HEAP32[$6 >> 2] | 0) + 36; + break; + } + } while (0); + $$0753 = $$0753 + 1 | 0; + } + $$0759 = $576; + } + } + } while (0); + $$0750 = $33; + } + if ((label | 0) == 3) { + STACKTOP = sp; + return; + } else if ((label | 0) == 7) { + $51 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30723) | 0, 26748) | 0, 39072) | 0, 192) | 0, 39079) | 0, 30775) | 0; + __ZNKSt3__28ios_base6getlocEv($3, $51 + (HEAP32[(HEAP32[$51 >> 2] | 0) + -12 >> 2] | 0) | 0); + $56 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66512) | 0; + $60 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$56 >> 2] | 0) + 28 >> 2] & 127]($56, 10) | 0; + __ZNSt3__26localeD2Ev($3); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($51, $60) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($51) | 0; + _abort(); + } else if ((label | 0) == 9) { + $69 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30798) | 0, 26748) | 0, 39072) | 0, 193) | 0, 39079) | 0, 30775) | 0; + __ZNKSt3__28ios_base6getlocEv($3, $69 + (HEAP32[(HEAP32[$69 >> 2] | 0) + -12 >> 2] | 0) | 0); + $74 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66512) | 0; + $78 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$74 >> 2] | 0) + 28 >> 2] & 127]($74, 10) | 0; + __ZNSt3__26localeD2Ev($3); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($69, $78) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($69) | 0; + _abort(); + } else if ((label | 0) == 75) { + $283 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30723) | 0, 26748) | 0, 39072) | 0, 277) | 0, 39079) | 0, 30775) | 0; + __ZNKSt3__28ios_base6getlocEv($3, $283 + (HEAP32[(HEAP32[$283 >> 2] | 0) + -12 >> 2] | 0) | 0); + $288 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66512) | 0; + $292 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$288 >> 2] | 0) + 28 >> 2] & 127]($288, 10) | 0; + __ZNSt3__26localeD2Ev($3); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($283, $292) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($283) | 0; + _abort(); + } else if ((label | 0) == 77) { + $302 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30850) | 0, 26748) | 0, 39072) | 0, 278) | 0, 39079) | 0, 30775) | 0; + __ZNKSt3__28ios_base6getlocEv($3, $302 + (HEAP32[(HEAP32[$302 >> 2] | 0) + -12 >> 2] | 0) | 0); + $307 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66512) | 0; + $311 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$307 >> 2] | 0) + 28 >> 2] & 127]($307, 10) | 0; + __ZNSt3__26localeD2Ev($3); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($302, $311) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($302) | 0; + _abort(); + } else if ((label | 0) == 144) { + $538 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30907) | 0, 26748) | 0, 39072) | 0, 362) | 0, 39079) | 0, 30775) | 0; + __ZNKSt3__28ios_base6getlocEv($3, $538 + (HEAP32[(HEAP32[$538 >> 2] | 0) + -12 >> 2] | 0) | 0); + $543 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66512) | 0; + $547 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$543 >> 2] | 0) + 28 >> 2] & 127]($543, 10) | 0; + __ZNSt3__26localeD2Ev($3); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($538, $547) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($538) | 0; + _abort(); + } else if ((label | 0) == 146) { + $557 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30964) | 0, 26748) | 0, 39072) | 0, 363) | 0, 39079) | 0, 30775) | 0; + __ZNKSt3__28ios_base6getlocEv($3, $557 + (HEAP32[(HEAP32[$557 >> 2] | 0) + -12 >> 2] | 0) | 0); + $562 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66512) | 0; + $566 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$562 >> 2] | 0) + 28 >> 2] & 127]($562, 10) | 0; + __ZNSt3__26localeD2Ev($3); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($557, $566) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($557) | 0; + _abort(); + } +} + +function __ZNSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + $10 = $10 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i162 = 0, $$0$i$i$i$i207 = 0, $$0$i$i$i$i220 = 0, $$0$i$i$i$i236 = 0, $$0$i$i$i$i251 = 0, $$0$i$i$i$i266 = 0, $$0$i$i149 = 0, $$0$i$i151 = 0, $$0$i$i154 = 0, $$0$i$i157 = 0, $$0$i$i160 = 0, $$0$i$i161 = 0, $$0$i$i174 = 0, $$0$i$i176 = 0, $$0$i$i182 = 0, $$0$i$i189 = 0, $$0$i$i194 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i168 = 0, $$0$i$i2$i$i213 = 0, $$0$i$i2$i$i226 = 0, $$0$i$i2$i$i242 = 0, $$0$i$i2$i$i257 = 0, $$0$i$i2$i$i272 = 0, $$0$i$i203 = 0, $$0$i$i232 = 0, $$0$i$i248 = 0, $$0$i$i263 = 0, $$0$i$i278 = 0, $$0$i$i280 = 0, $$0126 = 0, $$0131 = 0, $$0133 = 0, $$10 = 0, $$1132 = 0, $$2128$ph = 0, $$pre$phiZ2D = 0, $$sroa$0289$0$ptr = 0, $$sroa$0309$0 = 0, $$sroa$0309$1 = 0, $$sroa$08$0$ptr$i = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $12 = 0, $123 = 0, $126 = 0, $13 = 0, $139 = 0, $14 = 0, $141 = 0, $15 = 0, $153 = 0, $155 = 0, $16 = 0, $169 = 0, $17 = 0, $170 = 0, $171 = 0, $18 = 0, $182 = 0, $186 = 0, $187 = 0, $19 = 0, $191 = 0, $194 = 0, $196 = 0, $198 = 0, $20 = 0, $201 = 0, $21 = 0, $214 = 0, $215 = 0, $216 = 0, $22 = 0, $225 = 0, $23 = 0, $237 = 0, $238 = 0, $239 = 0, $24 = 0, $248 = 0, $25 = 0, $266 = 0, $267 = 0, $268 = 0, $271 = 0, $277 = 0, $295 = 0, $296 = 0, $297 = 0, $306 = 0, $320 = 0, $322 = 0, $325 = 0, $327 = 0, $329 = 0, $334 = 0, $335 = 0, $339 = 0, $342 = 0, $352 = 0, $353 = 0, $354 = 0, $355 = 0, $357 = 0, $358 = 0, $359 = 0, $360 = 0, $361 = 0, $365 = 0, $366 = 0, $370 = 0, $376 = 0, $377 = 0, $381 = 0, $385 = 0, $388 = 0, $401 = 0, $403 = 0, $41 = 0, $415 = 0, $417 = 0, $42 = 0, $429 = 0, $430 = 0, $431 = 0, $44 = 0, $441 = 0, $442 = 0, $45 = 0, $452 = 0, $455 = 0, $46 = 0, $468 = 0, $47 = 0, $470 = 0, $482 = 0, $484 = 0, $49 = 0, $498 = 0, $502 = 0, $504 = 0, $51 = 0, $513 = 0, $517 = 0, $518 = 0, $519 = 0, $52 = 0, $520 = 0, $53 = 0, $530 = 0, $536 = 0, $539 = 0, $542 = 0, $55 = 0, $555 = 0, $557 = 0, $56 = 0, $569 = 0, $571 = 0, $58 = 0, $585 = 0, $586 = 0, $587 = 0, $598 = 0, $601 = 0, $61 = 0, $614 = 0, $616 = 0, $628 = 0, $630 = 0, $649 = 0, $651 = 0, $661 = 0, $665 = 0, $666 = 0, $667 = 0, $684 = 0, $685 = 0, $686 = 0, $691 = 0, $692 = 0, $695 = 0, $707 = 0, $710 = 0, $722 = 0, $724 = 0, $73 = 0, $738 = 0, $744 = 0, $745 = 0, $746 = 0, $755 = 0, $756 = 0, $76 = 0, $762 = 0, $766 = 0, $767 = 0, $768 = 0, $769 = 0, $770 = 0, $771 = 0, $772 = 0, $773 = 0, $774 = 0, $775 = 0, $776 = 0, $777 = 0, $778 = 0, $779 = 0, $780 = 0, $781 = 0, $782 = 0, $783 = 0, $784 = 0, $785 = 0, $786 = 0, $91 = 0, $93 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 512 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(512); + $11 = sp + 496 | 0; + $12 = sp; + $13 = sp + 488 | 0; + $14 = sp + 480 | 0; + $15 = sp + 476 | 0; + $16 = sp + 500 | 0; + $17 = sp + 472 | 0; + $18 = sp + 468 | 0; + $19 = sp + 456 | 0; + $20 = sp + 444 | 0; + $21 = sp + 432 | 0; + $22 = sp + 420 | 0; + $23 = sp + 408 | 0; + $24 = sp + 404 | 0; + $25 = sp + 400 | 0; + HEAP32[$11 >> 2] = $10; + HEAP32[$13 >> 2] = $12; + HEAP32[$13 + 4 >> 2] = 214; + HEAP32[$14 >> 2] = $12; + HEAP32[$15 >> 2] = $12 + 400; + HEAP32[$19 >> 2] = 0; + HEAP32[$19 + 4 >> 2] = 0; + HEAP32[$19 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$19 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + HEAP32[$20 >> 2] = 0; + HEAP32[$20 + 4 >> 2] = 0; + HEAP32[$20 + 8 >> 2] = 0; + $$0$i$i149 = 0; + while (1) { + if (($$0$i$i149 | 0) == 3) break; + HEAP32[$20 + ($$0$i$i149 << 2) >> 2] = 0; + $$0$i$i149 = $$0$i$i149 + 1 | 0; + } + HEAP32[$21 >> 2] = 0; + HEAP32[$21 + 4 >> 2] = 0; + HEAP32[$21 + 8 >> 2] = 0; + $$0$i$i151 = 0; + while (1) { + if (($$0$i$i151 | 0) == 3) break; + HEAP32[$21 + ($$0$i$i151 << 2) >> 2] = 0; + $$0$i$i151 = $$0$i$i151 + 1 | 0; + } + HEAP32[$22 >> 2] = 0; + HEAP32[$22 + 4 >> 2] = 0; + HEAP32[$22 + 8 >> 2] = 0; + $$0$i$i154 = 0; + while (1) { + if (($$0$i$i154 | 0) == 3) break; + HEAP32[$22 + ($$0$i$i154 << 2) >> 2] = 0; + $$0$i$i154 = $$0$i$i154 + 1 | 0; + } + HEAP32[$23 >> 2] = 0; + HEAP32[$23 + 4 >> 2] = 0; + HEAP32[$23 + 8 >> 2] = 0; + $$0$i$i157 = 0; + while (1) { + if (($$0$i$i157 | 0) == 3) break; + HEAP32[$23 + ($$0$i$i157 << 2) >> 2] = 0; + $$0$i$i157 = $$0$i$i157 + 1 | 0; + } + __ZNSt3__211__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri($2, $3, $16, $17, $18, $19, $20, $21, $22, $24); + HEAP32[$9 >> 2] = HEAP32[$8 >> 2]; + $41 = $21 + 8 + 3 | 0; + $42 = $21 + 4 | 0; + $44 = $22 + 8 + 3 | 0; + $45 = $22 + 4 | 0; + $46 = $19 + 11 | 0; + $47 = $19 + 4 | 0; + $49 = ($4 & 512 | 0) != 0; + $51 = $20 + 8 + 3 | 0; + $52 = $16 + 3 | 0; + $53 = $20 + 4 | 0; + $55 = $23 + 8 + 3 | 0; + $56 = $23 + 4 | 0; + $$0131 = 0; + $$0133 = 0; + L21 : while (1) { + if ($$0133 >>> 0 >= 4) { + label = 239; + break; + } + $58 = HEAP32[$0 >> 2] | 0; + do if ($58) { + $61 = HEAP32[$58 + 12 >> 2] | 0; + if (($61 | 0) == (HEAP32[$58 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$58 >> 2] | 0) + 36 >> 2] & 127]($58) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$61 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $766 = 1; + break; + } else { + $766 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $766 = 1; while (0); + $73 = HEAP32[$1 >> 2] | 0; + do if ($73) { + $76 = HEAP32[$73 + 12 >> 2] | 0; + if (($76 | 0) == (HEAP32[$73 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$73 >> 2] | 0) + 36 >> 2] & 127]($73) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$76 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($766) { + $767 = $73; + break; + } else { + label = 239; + break L21; + } else { + HEAP32[$1 >> 2] = 0; + label = 31; + break; + } + } else label = 31; while (0); + if ((label | 0) == 31) { + label = 0; + if ($766) { + label = 239; + break; + } else $767 = 0; + } + L46 : do switch (HEAP8[$16 + $$0133 >> 0] | 0) { + case 1: + { + if (($$0133 | 0) == 3) $$1132 = $$0131; else { + $91 = HEAP32[$0 >> 2] | 0; + $93 = HEAP32[$91 + 12 >> 2] | 0; + if (($93 | 0) == (HEAP32[$91 + 16 >> 2] | 0)) $$0$i$i160 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$91 >> 2] | 0) + 36 >> 2] & 127]($91) | 0; else $$0$i$i160 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$93 >> 2] | 0) | 0; + if (!(FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$7 >> 2] | 0) + 12 >> 2] & 63]($7, 8192, $$0$i$i160) | 0)) { + label = 44; + break L21; + } + $107 = HEAP32[$0 >> 2] | 0; + $108 = $107 + 12 | 0; + $109 = HEAP32[$108 >> 2] | 0; + if (($109 | 0) == (HEAP32[$107 + 16 >> 2] | 0)) $$0$i$i161 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$107 >> 2] | 0) + 40 >> 2] & 127]($107) | 0; else { + HEAP32[$108 >> 2] = $109 + 4; + $$0$i$i161 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$109 >> 2] | 0) | 0; + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw($23, $$0$i$i161); + label = 46; + } + break; + } + case 0: + { + if (($$0133 | 0) == 3) $$1132 = $$0131; else label = 46; + break; + } + case 3: + { + $182 = HEAP8[$41 >> 0] | 0; + $186 = $182 << 24 >> 24 < 0 ? HEAP32[$42 >> 2] | 0 : $182 & 255; + $187 = HEAP8[$44 >> 0] | 0; + $191 = $187 << 24 >> 24 < 0 ? HEAP32[$45 >> 2] | 0 : $187 & 255; + if (($186 | 0) == (0 - $191 | 0)) $$1132 = $$0131; else { + $194 = ($186 | 0) == 0; + $196 = HEAP32[$0 >> 2] | 0; + $198 = HEAP32[$196 + 12 >> 2] | 0; + $201 = ($198 | 0) == (HEAP32[$196 + 16 >> 2] | 0); + if ($194 | ($191 | 0) == 0) { + if ($201) $$0$i$i182 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$196 >> 2] | 0) + 36 >> 2] & 127]($196) | 0; else $$0$i$i182 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$198 >> 2] | 0) | 0; + if ($194) { + if (($$0$i$i182 | 0) != (HEAP32[((HEAP8[$44 >> 0] | 0) < 0 ? HEAP32[$22 >> 2] | 0 : $22) >> 2] | 0)) { + $$1132 = $$0131; + break L46; + } + $237 = HEAP32[$0 >> 2] | 0; + $238 = $237 + 12 | 0; + $239 = HEAP32[$238 >> 2] | 0; + if (($239 | 0) == (HEAP32[$237 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$237 >> 2] | 0) + 40 >> 2] & 127]($237) | 0; else { + HEAP32[$238 >> 2] = $239 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$239 >> 2] | 0) | 0; + } + HEAP8[$6 >> 0] = 1; + $248 = HEAP8[$44 >> 0] | 0; + $$1132 = ($248 << 24 >> 24 < 0 ? HEAP32[$45 >> 2] | 0 : $248 & 255) >>> 0 > 1 ? $22 : $$0131; + break L46; + } + if (($$0$i$i182 | 0) != (HEAP32[((HEAP8[$41 >> 0] | 0) < 0 ? HEAP32[$21 >> 2] | 0 : $21) >> 2] | 0)) { + HEAP8[$6 >> 0] = 1; + $$1132 = $$0131; + break L46; + } + $214 = HEAP32[$0 >> 2] | 0; + $215 = $214 + 12 | 0; + $216 = HEAP32[$215 >> 2] | 0; + if (($216 | 0) == (HEAP32[$214 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$214 >> 2] | 0) + 40 >> 2] & 127]($214) | 0; else { + HEAP32[$215 >> 2] = $216 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$216 >> 2] | 0) | 0; + } + $225 = HEAP8[$41 >> 0] | 0; + $$1132 = ($225 << 24 >> 24 < 0 ? HEAP32[$42 >> 2] | 0 : $225 & 255) >>> 0 > 1 ? $21 : $$0131; + break L46; + } + if ($201) $$0$i$i189 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$196 >> 2] | 0) + 36 >> 2] & 127]($196) | 0; else $$0$i$i189 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$198 >> 2] | 0) | 0; + $266 = HEAP32[$0 >> 2] | 0; + $267 = $266 + 12 | 0; + $268 = HEAP32[$267 >> 2] | 0; + $271 = ($268 | 0) == (HEAP32[$266 + 16 >> 2] | 0); + if (($$0$i$i189 | 0) == (HEAP32[((HEAP8[$41 >> 0] | 0) < 0 ? HEAP32[$21 >> 2] | 0 : $21) >> 2] | 0)) { + if ($271) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$266 >> 2] | 0) + 40 >> 2] & 127]($266) | 0; else { + HEAP32[$267 >> 2] = $268 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$268 >> 2] | 0) | 0; + } + $277 = HEAP8[$41 >> 0] | 0; + $$1132 = ($277 << 24 >> 24 < 0 ? HEAP32[$42 >> 2] | 0 : $277 & 255) >>> 0 > 1 ? $21 : $$0131; + break L46; + } + if ($271) $$0$i$i194 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$266 >> 2] | 0) + 36 >> 2] & 127]($266) | 0; else $$0$i$i194 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$268 >> 2] | 0) | 0; + if (($$0$i$i194 | 0) != (HEAP32[((HEAP8[$44 >> 0] | 0) < 0 ? HEAP32[$22 >> 2] | 0 : $22) >> 2] | 0)) { + label = 103; + break L21; + } + $295 = HEAP32[$0 >> 2] | 0; + $296 = $295 + 12 | 0; + $297 = HEAP32[$296 >> 2] | 0; + if (($297 | 0) == (HEAP32[$295 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$295 >> 2] | 0) + 40 >> 2] & 127]($295) | 0; else { + HEAP32[$296 >> 2] = $297 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$297 >> 2] | 0) | 0; + } + HEAP8[$6 >> 0] = 1; + $306 = HEAP8[$44 >> 0] | 0; + $$1132 = ($306 << 24 >> 24 < 0 ? HEAP32[$45 >> 2] | 0 : $306 & 255) >>> 0 > 1 ? $22 : $$0131; + } + break; + } + case 2: + { + if ($$0133 >>> 0 < 2 | ($$0131 | 0) != 0) { + $325 = HEAP8[$51 >> 0] | 0; + $327 = HEAP32[$20 >> 2] | 0; + $329 = $325 << 24 >> 24 < 0 ? $327 : $20; + if (!$$0133) { + $$sroa$0309$1 = $329; + $774 = $327; + $775 = $325; + } else { + $771 = $329; + $772 = $327; + $773 = $325; + label = 108; + } + } else { + if (!($49 | ($$0133 | 0) == 2 & (HEAP8[$52 >> 0] | 0) != 0)) { + $$1132 = 0; + break L46; + } + $320 = HEAP8[$51 >> 0] | 0; + $322 = HEAP32[$20 >> 2] | 0; + $771 = $320 << 24 >> 24 < 0 ? $322 : $20; + $772 = $322; + $773 = $320; + label = 108; + } + L108 : do if ((label | 0) == 108) { + label = 0; + if ((HEAPU8[$16 + ($$0133 + -1) >> 0] | 0) < 2) { + $$sroa$0309$0 = $771; + $335 = $773; + $339 = $772; + while (1) { + $334 = $335 << 24 >> 24 < 0; + $342 = $$sroa$0309$0; + if ((($334 ? $339 : $20) + (($334 ? HEAP32[$53 >> 2] | 0 : $335 & 255) << 2) | 0) == ($342 | 0)) { + $352 = $335; + $354 = $339; + break; + } + if (!(FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$7 >> 2] | 0) + 12 >> 2] & 63]($7, 8192, HEAP32[$342 >> 2] | 0) | 0)) { + label = 112; + break; + } + $$sroa$0309$0 = $342 + 4 | 0; + $335 = HEAP8[$51 >> 0] | 0; + $339 = HEAP32[$20 >> 2] | 0; + } + if ((label | 0) == 112) { + label = 0; + $352 = HEAP8[$51 >> 0] | 0; + $354 = HEAP32[$20 >> 2] | 0; + } + $353 = $352 << 24 >> 24 < 0 ? $354 : $20; + $355 = $353; + $357 = $$sroa$0309$0 - $355 >> 2; + $358 = HEAP8[$55 >> 0] | 0; + $359 = $358 << 24 >> 24 < 0; + $360 = HEAP32[$56 >> 2] | 0; + $361 = $358 & 255; + if ($357 >>> 0 > ($359 ? $360 : $361) >>> 0) { + $$sroa$0309$1 = $355; + $774 = $354; + $775 = $352; + } else { + $365 = (HEAP32[$23 >> 2] | 0) + ($360 << 2) | 0; + $366 = $23 + ($361 << 2) | 0; + $$pre$phiZ2D = $359 ? $365 : $366; + $$sroa$08$0$ptr$i = $353; + $370 = ($359 ? $365 : $366) + (0 - $357 << 2) | 0; + while (1) { + if (($370 | 0) == ($$pre$phiZ2D | 0)) { + $$sroa$0309$1 = $$sroa$0309$0; + $774 = $354; + $775 = $352; + break L108; + } + if ((HEAP32[$370 >> 2] | 0) != (HEAP32[$$sroa$08$0$ptr$i >> 2] | 0)) { + $$sroa$0309$1 = $355; + $774 = $354; + $775 = $352; + break L108; + } + $$sroa$08$0$ptr$i = $$sroa$08$0$ptr$i + 4 | 0; + $370 = $370 + 4 | 0; + } + } + } else { + $$sroa$0309$1 = $771; + $774 = $772; + $775 = $773; + } + } while (0); + $$sroa$0289$0$ptr = $$sroa$0309$1; + $377 = $775; + $381 = $774; + $401 = $767; + L124 : while (1) { + $376 = $377 << 24 >> 24 < 0; + if (($$sroa$0289$0$ptr | 0) == (($376 ? $381 : $20) + (($376 ? HEAP32[$53 >> 2] | 0 : $377 & 255) << 2) | 0)) break; + $385 = HEAP32[$0 >> 2] | 0; + do if ($385) { + $388 = HEAP32[$385 + 12 >> 2] | 0; + if (($388 | 0) == (HEAP32[$385 + 16 >> 2] | 0)) $$0$i$i$i$i220 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$385 >> 2] | 0) + 36 >> 2] & 127]($385) | 0; else $$0$i$i$i$i220 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$388 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i220, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $776 = 1; + break; + } else { + $776 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $776 = 1; while (0); + do if ($401) { + $403 = HEAP32[$401 + 12 >> 2] | 0; + if (($403 | 0) == (HEAP32[$401 + 16 >> 2] | 0)) $$0$i$i2$i$i226 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$401 >> 2] | 0) + 36 >> 2] & 127]($401) | 0; else $$0$i$i2$i$i226 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$403 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i226, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($776) { + $777 = $401; + break; + } else break L124; else { + HEAP32[$1 >> 2] = 0; + label = 134; + break; + } + } else label = 134; while (0); + if ((label | 0) == 134) { + label = 0; + if ($776) break; else $777 = 0; + } + $415 = HEAP32[$0 >> 2] | 0; + $417 = HEAP32[$415 + 12 >> 2] | 0; + if (($417 | 0) == (HEAP32[$415 + 16 >> 2] | 0)) $$0$i$i232 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$415 >> 2] | 0) + 36 >> 2] & 127]($415) | 0; else $$0$i$i232 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$417 >> 2] | 0) | 0; + if (($$0$i$i232 | 0) != (HEAP32[$$sroa$0289$0$ptr >> 2] | 0)) break; + $429 = HEAP32[$0 >> 2] | 0; + $430 = $429 + 12 | 0; + $431 = HEAP32[$430 >> 2] | 0; + if (($431 | 0) == (HEAP32[$429 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$429 >> 2] | 0) + 40 >> 2] & 127]($429) | 0; else { + HEAP32[$430 >> 2] = $431 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$431 >> 2] | 0) | 0; + } + $$sroa$0289$0$ptr = $$sroa$0289$0$ptr + 4 | 0; + $377 = HEAP8[$51 >> 0] | 0; + $381 = HEAP32[$20 >> 2] | 0; + $401 = $777; + } + if ($49 ? ($441 = HEAP8[$51 >> 0] | 0, $442 = $441 << 24 >> 24 < 0, ($$sroa$0289$0$ptr | 0) != (($442 ? HEAP32[$20 >> 2] | 0 : $20) + (($442 ? HEAP32[$53 >> 2] | 0 : $441 & 255) << 2) | 0)) : 0) { + label = 146; + break L21; + } else $$1132 = $$0131; + break; + } + case 4: + { + $$0126 = 0; + $468 = $767; + $768 = $767; + L161 : while (1) { + $452 = HEAP32[$0 >> 2] | 0; + do if ($452) { + $455 = HEAP32[$452 + 12 >> 2] | 0; + if (($455 | 0) == (HEAP32[$452 + 16 >> 2] | 0)) $$0$i$i$i$i236 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$452 >> 2] | 0) + 36 >> 2] & 127]($452) | 0; else $$0$i$i$i$i236 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$455 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i236, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $778 = 1; + break; + } else { + $778 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $778 = 1; while (0); + do if ($468) { + $470 = HEAP32[$468 + 12 >> 2] | 0; + if (($470 | 0) == (HEAP32[$468 + 16 >> 2] | 0)) $$0$i$i2$i$i242 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$468 >> 2] | 0) + 36 >> 2] & 127]($468) | 0; else $$0$i$i2$i$i242 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$470 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i242, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($778) { + $780 = $768; + $781 = $468; + break; + } else { + $555 = $768; + break L161; + } else { + HEAP32[$1 >> 2] = 0; + $779 = 0; + label = 160; + break; + } + } else { + $779 = $768; + label = 160; + } while (0); + if ((label | 0) == 160) { + label = 0; + if ($778) { + $555 = $779; + break; + } else { + $780 = $779; + $781 = 0; + } + } + $482 = HEAP32[$0 >> 2] | 0; + $484 = HEAP32[$482 + 12 >> 2] | 0; + if (($484 | 0) == (HEAP32[$482 + 16 >> 2] | 0)) $$0$i$i248 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$482 >> 2] | 0) + 36 >> 2] & 127]($482) | 0; else $$0$i$i248 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$484 >> 2] | 0) | 0; + if (FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$7 >> 2] | 0) + 12 >> 2] & 63]($7, 2048, $$0$i$i248) | 0) { + $498 = HEAP32[$9 >> 2] | 0; + if (($498 | 0) == (HEAP32[$11 >> 2] | 0)) { + __ZNSt3__219__double_or_nothingIwEEvRNS_10unique_ptrIT_PFvPvEEERPS2_S9_($8, $9, $11); + $502 = HEAP32[$9 >> 2] | 0; + } else $502 = $498; + HEAP32[$9 >> 2] = $502 + 4; + HEAP32[$502 >> 2] = $$0$i$i248; + $$2128$ph = $$0126 + 1 | 0; + } else { + $504 = HEAP8[$46 >> 0] | 0; + if (!(($$0$i$i248 | 0) == (HEAP32[$18 >> 2] | 0) & ($$0126 | 0 ? (($504 << 24 >> 24 < 0 ? HEAP32[$47 >> 2] | 0 : $504 & 255) | 0) != 0 : 0))) { + $555 = $780; + break; + } + $513 = HEAP32[$14 >> 2] | 0; + if (($513 | 0) == (HEAP32[$15 >> 2] | 0)) { + __ZNSt3__219__double_or_nothingIjEEvRNS_10unique_ptrIT_PFvPvEEERPS2_S9_($13, $14, $15); + $517 = HEAP32[$14 >> 2] | 0; + } else $517 = $513; + HEAP32[$14 >> 2] = $517 + 4; + HEAP32[$517 >> 2] = $$0126; + $$2128$ph = 0; + } + $518 = HEAP32[$0 >> 2] | 0; + $519 = $518 + 12 | 0; + $520 = HEAP32[$519 >> 2] | 0; + if (($520 | 0) == (HEAP32[$518 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$518 >> 2] | 0) + 40 >> 2] & 127]($518) | 0; else { + HEAP32[$519 >> 2] = $520 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$520 >> 2] | 0) | 0; + } + $$0126 = $$2128$ph; + $468 = $781; + $768 = $780; + } + $530 = HEAP32[$14 >> 2] | 0; + if ($$0126 | 0 ? (HEAP32[$13 >> 2] | 0) != ($530 | 0) : 0) { + if (($530 | 0) == (HEAP32[$15 >> 2] | 0)) { + __ZNSt3__219__double_or_nothingIjEEvRNS_10unique_ptrIT_PFvPvEEERPS2_S9_($13, $14, $15); + $536 = HEAP32[$14 >> 2] | 0; + } else $536 = $530; + HEAP32[$14 >> 2] = $536 + 4; + HEAP32[$536 >> 2] = $$0126; + } + L211 : do if ((HEAP32[$24 >> 2] | 0) > 0) { + $539 = HEAP32[$0 >> 2] | 0; + do if ($539) { + $542 = HEAP32[$539 + 12 >> 2] | 0; + if (($542 | 0) == (HEAP32[$539 + 16 >> 2] | 0)) $$0$i$i$i$i251 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$539 >> 2] | 0) + 36 >> 2] & 127]($539) | 0; else $$0$i$i$i$i251 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$542 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i251, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $782 = 1; + break; + } else { + $782 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $782 = 1; while (0); + do if ($555) { + $557 = HEAP32[$555 + 12 >> 2] | 0; + if (($557 | 0) == (HEAP32[$555 + 16 >> 2] | 0)) $$0$i$i2$i$i257 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$555 >> 2] | 0) + 36 >> 2] & 127]($555) | 0; else $$0$i$i2$i$i257 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$557 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i257, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($782) { + $783 = $555; + break; + } else { + label = 201; + break L21; + } else { + HEAP32[$1 >> 2] = 0; + label = 195; + break; + } + } else label = 195; while (0); + if ((label | 0) == 195) { + label = 0; + if ($782) { + label = 201; + break L21; + } else $783 = 0; + } + $569 = HEAP32[$0 >> 2] | 0; + $571 = HEAP32[$569 + 12 >> 2] | 0; + if (($571 | 0) == (HEAP32[$569 + 16 >> 2] | 0)) $$0$i$i263 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$569 >> 2] | 0) + 36 >> 2] & 127]($569) | 0; else $$0$i$i263 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$571 >> 2] | 0) | 0; + if (($$0$i$i263 | 0) != (HEAP32[$17 >> 2] | 0)) { + label = 201; + break L21; + } + $585 = HEAP32[$0 >> 2] | 0; + $586 = $585 + 12 | 0; + $587 = HEAP32[$586 >> 2] | 0; + if (($587 | 0) == (HEAP32[$585 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$585 >> 2] | 0) + 40 >> 2] & 127]($585) | 0; else { + HEAP32[$586 >> 2] = $587 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$587 >> 2] | 0) | 0; + } + $614 = $783; + while (1) { + if ((HEAP32[$24 >> 2] | 0) <= 0) break L211; + $598 = HEAP32[$0 >> 2] | 0; + do if ($598) { + $601 = HEAP32[$598 + 12 >> 2] | 0; + if (($601 | 0) == (HEAP32[$598 + 16 >> 2] | 0)) $$0$i$i$i$i266 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$598 >> 2] | 0) + 36 >> 2] & 127]($598) | 0; else $$0$i$i$i$i266 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$601 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i266, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $784 = 1; + break; + } else { + $784 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $784 = 1; while (0); + do if ($614) { + $616 = HEAP32[$614 + 12 >> 2] | 0; + if (($616 | 0) == (HEAP32[$614 + 16 >> 2] | 0)) $$0$i$i2$i$i272 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$614 >> 2] | 0) + 36 >> 2] & 127]($614) | 0; else $$0$i$i2$i$i272 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$616 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i272, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($784) { + $785 = $614; + break; + } else { + label = 226; + break L21; + } else { + HEAP32[$1 >> 2] = 0; + label = 220; + break; + } + } else label = 220; while (0); + if ((label | 0) == 220) { + label = 0; + if ($784) { + label = 226; + break L21; + } else $785 = 0; + } + $628 = HEAP32[$0 >> 2] | 0; + $630 = HEAP32[$628 + 12 >> 2] | 0; + if (($630 | 0) == (HEAP32[$628 + 16 >> 2] | 0)) $$0$i$i278 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$628 >> 2] | 0) + 36 >> 2] & 127]($628) | 0; else $$0$i$i278 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$630 >> 2] | 0) | 0; + if (!(FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$7 >> 2] | 0) + 12 >> 2] & 63]($7, 2048, $$0$i$i278) | 0)) { + label = 226; + break L21; + } + if ((HEAP32[$9 >> 2] | 0) == (HEAP32[$11 >> 2] | 0)) __ZNSt3__219__double_or_nothingIwEEvRNS_10unique_ptrIT_PFvPvEEERPS2_S9_($8, $9, $11); + $649 = HEAP32[$0 >> 2] | 0; + $651 = HEAP32[$649 + 12 >> 2] | 0; + if (($651 | 0) == (HEAP32[$649 + 16 >> 2] | 0)) $$0$i$i280 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$649 >> 2] | 0) + 36 >> 2] & 127]($649) | 0; else $$0$i$i280 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$651 >> 2] | 0) | 0; + $661 = HEAP32[$9 >> 2] | 0; + HEAP32[$9 >> 2] = $661 + 4; + HEAP32[$661 >> 2] = $$0$i$i280; + HEAP32[$24 >> 2] = (HEAP32[$24 >> 2] | 0) + -1; + $665 = HEAP32[$0 >> 2] | 0; + $666 = $665 + 12 | 0; + $667 = HEAP32[$666 >> 2] | 0; + if (($667 | 0) == (HEAP32[$665 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$665 >> 2] | 0) + 40 >> 2] & 127]($665) | 0; else { + HEAP32[$666 >> 2] = $667 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$667 >> 2] | 0) | 0; + } + $614 = $785; + } + } while (0); + if ((HEAP32[$9 >> 2] | 0) == (HEAP32[$8 >> 2] | 0)) { + label = 237; + break L21; + } else $$1132 = $$0131; + break; + } + default: + $$1132 = $$0131; + } while (0); + L286 : do if ((label | 0) == 46) { + label = 0; + $139 = $767; + while (1) { + $123 = HEAP32[$0 >> 2] | 0; + do if ($123) { + $126 = HEAP32[$123 + 12 >> 2] | 0; + if (($126 | 0) == (HEAP32[$123 + 16 >> 2] | 0)) $$0$i$i$i$i162 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$123 >> 2] | 0) + 36 >> 2] & 127]($123) | 0; else $$0$i$i$i$i162 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$126 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i162, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $769 = 1; + break; + } else { + $769 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $769 = 1; while (0); + do if ($139) { + $141 = HEAP32[$139 + 12 >> 2] | 0; + if (($141 | 0) == (HEAP32[$139 + 16 >> 2] | 0)) $$0$i$i2$i$i168 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$139 >> 2] | 0) + 36 >> 2] & 127]($139) | 0; else $$0$i$i2$i$i168 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$141 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i168, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($769) { + $770 = $139; + break; + } else { + $$1132 = $$0131; + break L286; + } else { + HEAP32[$1 >> 2] = 0; + label = 60; + break; + } + } else label = 60; while (0); + if ((label | 0) == 60) { + label = 0; + if ($769) { + $$1132 = $$0131; + break L286; + } else $770 = 0; + } + $153 = HEAP32[$0 >> 2] | 0; + $155 = HEAP32[$153 + 12 >> 2] | 0; + if (($155 | 0) == (HEAP32[$153 + 16 >> 2] | 0)) $$0$i$i174 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$153 >> 2] | 0) + 36 >> 2] & 127]($153) | 0; else $$0$i$i174 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$155 >> 2] | 0) | 0; + if (!(FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$7 >> 2] | 0) + 12 >> 2] & 63]($7, 8192, $$0$i$i174) | 0)) { + $$1132 = $$0131; + break L286; + } + $169 = HEAP32[$0 >> 2] | 0; + $170 = $169 + 12 | 0; + $171 = HEAP32[$170 >> 2] | 0; + if (($171 | 0) == (HEAP32[$169 + 16 >> 2] | 0)) $$0$i$i176 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$169 >> 2] | 0) + 40 >> 2] & 127]($169) | 0; else { + HEAP32[$170 >> 2] = $171 + 4; + $$0$i$i176 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$171 >> 2] | 0) | 0; + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw($23, $$0$i$i176); + $139 = $770; + } + } while (0); + $$0131 = $$1132; + $$0133 = $$0133 + 1 | 0; + } + L322 : do if ((label | 0) == 44) { + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$10 = 0; + } else if ((label | 0) == 103) { + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$10 = 0; + } else if ((label | 0) == 146) { + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$10 = 0; + } else if ((label | 0) == 201) { + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$10 = 0; + } else if ((label | 0) == 226) { + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$10 = 0; + } else if ((label | 0) == 237) { + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$10 = 0; + } else if ((label | 0) == 239) { + L324 : do if ($$0131 | 0) { + $684 = $$0131 + 8 + 3 | 0; + $685 = $$0131 + 4 | 0; + $$0 = 1; + L326 : while (1) { + $686 = HEAP8[$684 >> 0] | 0; + if ($686 << 24 >> 24 < 0) $691 = HEAP32[$685 >> 2] | 0; else $691 = $686 & 255; + if ($$0 >>> 0 >= $691 >>> 0) break L324; + $692 = HEAP32[$0 >> 2] | 0; + do if ($692) { + $695 = HEAP32[$692 + 12 >> 2] | 0; + if (($695 | 0) == (HEAP32[$692 + 16 >> 2] | 0)) $$0$i$i$i$i207 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$692 >> 2] | 0) + 36 >> 2] & 127]($692) | 0; else $$0$i$i$i$i207 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$695 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i207, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $786 = 1; + break; + } else { + $786 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $786 = 1; while (0); + $707 = HEAP32[$1 >> 2] | 0; + do if ($707) { + $710 = HEAP32[$707 + 12 >> 2] | 0; + if (($710 | 0) == (HEAP32[$707 + 16 >> 2] | 0)) $$0$i$i2$i$i213 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$707 >> 2] | 0) + 36 >> 2] & 127]($707) | 0; else $$0$i$i2$i$i213 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$710 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i213, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($786) break; else break L326; else { + HEAP32[$1 >> 2] = 0; + label = 258; + break; + } + } else label = 258; while (0); + if ((label | 0) == 258 ? (label = 0, $786) : 0) break; + $722 = HEAP32[$0 >> 2] | 0; + $724 = HEAP32[$722 + 12 >> 2] | 0; + if (($724 | 0) == (HEAP32[$722 + 16 >> 2] | 0)) $$0$i$i203 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$722 >> 2] | 0) + 36 >> 2] & 127]($722) | 0; else $$0$i$i203 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$724 >> 2] | 0) | 0; + if ((HEAP8[$684 >> 0] | 0) < 0) $738 = HEAP32[$$0131 >> 2] | 0; else $738 = $$0131; + if (($$0$i$i203 | 0) != (HEAP32[$738 + ($$0 << 2) >> 2] | 0)) break; + $744 = HEAP32[$0 >> 2] | 0; + $745 = $744 + 12 | 0; + $746 = HEAP32[$745 >> 2] | 0; + if (($746 | 0) == (HEAP32[$744 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$744 >> 2] | 0) + 40 >> 2] & 127]($744) | 0; else { + HEAP32[$745 >> 2] = $746 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$746 >> 2] | 0) | 0; + } + $$0 = $$0 + 1 | 0; + } + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$10 = 0; + break L322; + } while (0); + $755 = HEAP32[$13 >> 2] | 0; + $756 = HEAP32[$14 >> 2] | 0; + if (($755 | 0) != ($756 | 0)) { + HEAP32[$25 >> 2] = 0; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($19, $755, $756, $25); + if (!(HEAP32[$25 >> 2] | 0)) { + $$10 = 1; + break; + } else { + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$10 = 0; + break; + } + } else $$10 = 1; + } while (0); + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($23); + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($22); + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($21); + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($20); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($19); + $762 = HEAP32[$13 >> 2] | 0; + HEAP32[$13 >> 2] = 0; + if ($762 | 0) FUNCTION_TABLE_vi[HEAP32[$13 + 4 >> 2] & 255]($762); + STACKTOP = sp; + return $$10 | 0; +} +function _jpeg_make_d_derived_tbl($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0122157 = 0, $$0124135$us = 0, $$0124135$us$1 = 0, $$0125134$us = 0, $$0125134$us$1 = 0, $$0129155 = 0, $$1$lcssa = 0, $$1$lcssa$1 = 0, $$1$lcssa$10 = 0, $$1$lcssa$11 = 0, $$1$lcssa$12 = 0, $$1$lcssa$13 = 0, $$1$lcssa$14 = 0, $$1$lcssa$15 = 0, $$1$lcssa$2 = 0, $$1$lcssa$3 = 0, $$1$lcssa$4 = 0, $$1$lcssa$5 = 0, $$1$lcssa$6 = 0, $$1$lcssa$7 = 0, $$1$lcssa$8 = 0, $$1$lcssa$9 = 0, $$1123$lcssa = 0, $$1123148 = 0, $$1127137$us = 0, $$1127137$us$1 = 0, $$1127137$us$2 = 0, $$1127137$us$3 = 0, $$1127137$us$4 = 0, $$1127137$us$5 = 0, $$1127137$us$6 = 0, $$1127137$us$7 = 0, $$2128133 = 0, $$2158 = 0, $$3$lcssa = 0, $$3149 = 0, $$5 = 0, $$5$1 = 0, $$5$10 = 0, $$5$11 = 0, $$5$12 = 0, $$5$13 = 0, $$5$14 = 0, $$5$2 = 0, $$5$3 = 0, $$5$4 = 0, $$5$5 = 0, $$5$6 = 0, $$5$7 = 0, $$5$8 = 0, $$5$9 = 0, $$7$lcssa = 0, $$7$lcssa$1 = 0, $$7$lcssa$2 = 0, $$7$lcssa$3 = 0, $$7$lcssa$4 = 0, $$7$lcssa$5 = 0, $$7$lcssa$6 = 0, $$7138$us = 0, $$7138$us$1 = 0, $$7138$us$2 = 0, $$7138$us$3 = 0, $$7138$us$4 = 0, $$7138$us$5 = 0, $$7138$us$6 = 0, $$7138$us$7 = 0, $$pre$phiZ2D = 0, $$sink = 0, $$sink$1 = 0, $$sink$10 = 0, $$sink$11 = 0, $$sink$12 = 0, $$sink$13 = 0, $$sink$14 = 0, $$sink$15 = 0, $$sink$2 = 0, $$sink$3 = 0, $$sink$4 = 0, $$sink$5 = 0, $$sink$6 = 0, $$sink$7 = 0, $$sink$8 = 0, $$sink$9 = 0, $104 = 0, $112 = 0, $116 = 0, $12 = 0, $121 = 0, $122 = 0, $126 = 0, $130 = 0, $134 = 0, $138 = 0, $142 = 0, $146 = 0, $15 = 0, $150 = 0, $154 = 0, $158 = 0, $162 = 0, $166 = 0, $17 = 0, $170 = 0, $174 = 0, $178 = 0, $182 = 0, $186 = 0, $190 = 0, $194 = 0, $198 = 0, $202 = 0, $206 = 0, $210 = 0, $214 = 0, $218 = 0, $22 = 0, $222 = 0, $226 = 0, $230 = 0, $234 = 0, $238 = 0, $242 = 0, $246 = 0, $251 = 0, $255 = 0, $260 = 0, $261 = 0, $265 = 0, $269 = 0, $27 = 0, $273 = 0, $277 = 0, $281 = 0, $285 = 0, $289 = 0, $29 = 0, $293 = 0, $297 = 0, $301 = 0, $305 = 0, $309 = 0, $31 = 0, $313 = 0, $317 = 0, $32 = 0, $321 = 0, $326 = 0, $330 = 0, $335 = 0, $336 = 0, $340 = 0, $344 = 0, $348 = 0, $35 = 0, $352 = 0, $356 = 0, $36 = 0, $360 = 0, $364 = 0, $369 = 0, $37 = 0, $373 = 0, $378 = 0, $379 = 0, $383 = 0, $387 = 0, $391 = 0, $396 = 0, $4 = 0, $40 = 0, $400 = 0, $405 = 0, $406 = 0, $410 = 0, $415 = 0, $419 = 0, $42 = 0, $423 = 0, $44 = 0, $440 = 0, $445 = 0, $454 = 0, $459 = 0, $46 = 0, $468 = 0, $473 = 0, $48 = 0, $482 = 0, $487 = 0, $496 = 0, $5 = 0, $501 = 0, $510 = 0, $515 = 0, $524 = 0, $529 = 0, $53 = 0, $538 = 0, $543 = 0, $552 = 0, $557 = 0, $566 = 0, $571 = 0, $580 = 0, $585 = 0, $59 = 0, $594 = 0, $599 = 0, $60 = 0, $608 = 0, $613 = 0, $622 = 0, $627 = 0, $645 = 0, $650 = 0, $651 = 0, $652 = 0, $654 = 0, $659 = 0, $660 = 0, $661 = 0, $663 = 0, $668 = 0, $669 = 0, $67 = 0, $670 = 0, $672 = 0, $677 = 0, $678 = 0, $679 = 0, $681 = 0, $686 = 0, $687 = 0, $688 = 0, $690 = 0, $695 = 0, $696 = 0, $697 = 0, $699 = 0, $7 = 0, $704 = 0, $705 = 0, $706 = 0, $708 = 0, $713 = 0, $714 = 0, $715 = 0, $717 = 0, $72 = 0, $722 = 0, $723 = 0, $724 = 0, $726 = 0, $731 = 0, $732 = 0, $733 = 0, $735 = 0, $740 = 0, $741 = 0, $742 = 0, $744 = 0, $749 = 0, $750 = 0, $751 = 0, $753 = 0, $758 = 0, $759 = 0, $760 = 0, $762 = 0, $767 = 0, $768 = 0, $769 = 0, $771 = 0, $78 = 0, $86 = 0, $88 = 0, $91 = 0, $97 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 1312 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(1312); + $4 = sp + 1040 | 0; + $5 = sp; + if ($2 >>> 0 > 3) { + $7 = HEAP32[$0 >> 2] | 0; + HEAP32[$7 + 20 >> 2] = 52; + HEAP32[$7 + 24 >> 2] = $2; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $12 = ($1 | 0) != 0; + $15 = HEAP32[($12 ? $0 + 180 + ($2 << 2) | 0 : $0 + 196 + ($2 << 2) | 0) >> 2] | 0; + if (!$15) { + $17 = HEAP32[$0 >> 2] | 0; + HEAP32[$17 + 20 >> 2] = 52; + HEAP32[$17 + 24 >> 2] = $2; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $22 = HEAP32[$3 >> 2] | 0; + if (!$22) { + $27 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$0 + 4 >> 2] >> 2] & 63]($0, 1, 1424) | 0; + HEAP32[$3 >> 2] = $27; + $$pre$phiZ2D = $0; + $29 = $27; + } else { + $$pre$phiZ2D = $0; + $29 = $22; + } + HEAP32[$29 + 140 >> 2] = $15; + $31 = HEAP8[$15 + 1 >> 0] | 0; + $32 = $31 & 255; + if (!($31 << 24 >> 24)) $$1$lcssa = 0; else { + _memset($4 | 0, 1, $32 | 0) | 0; + $$1$lcssa = $32; + } + $35 = HEAP8[$15 + 2 >> 0] | 0; + $36 = $35 & 255; + $37 = $$1$lcssa + $36 | 0; + if ($37 >>> 0 > 256) { + $645 = HEAP32[$0 >> 2] | 0; + HEAP32[$645 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$645 >> 2] & 255]($$pre$phiZ2D); + } + if (!($35 << 24 >> 24)) $$1$lcssa$1 = $$1$lcssa; else { + _memset($4 + $$1$lcssa | 0, 2, $36 | 0) | 0; + $$1$lcssa$1 = $37; + } + $650 = HEAP8[$15 + 3 >> 0] | 0; + $651 = $650 & 255; + $652 = $$1$lcssa$1 + $651 | 0; + if (($652 | 0) > 256) { + $654 = HEAP32[$0 >> 2] | 0; + HEAP32[$654 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$654 >> 2] & 255]($$pre$phiZ2D); + } + if (!($650 << 24 >> 24)) $$1$lcssa$2 = $$1$lcssa$1; else { + _memset($4 + $$1$lcssa$1 | 0, 3, $651 | 0) | 0; + $$1$lcssa$2 = $652; + } + $659 = HEAP8[$15 + 4 >> 0] | 0; + $660 = $659 & 255; + $661 = $$1$lcssa$2 + $660 | 0; + if (($661 | 0) > 256) { + $663 = HEAP32[$0 >> 2] | 0; + HEAP32[$663 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$663 >> 2] & 255]($$pre$phiZ2D); + } + if (!($659 << 24 >> 24)) $$1$lcssa$3 = $$1$lcssa$2; else { + _memset($4 + $$1$lcssa$2 | 0, 4, $660 | 0) | 0; + $$1$lcssa$3 = $661; + } + $668 = HEAP8[$15 + 5 >> 0] | 0; + $669 = $668 & 255; + $670 = $$1$lcssa$3 + $669 | 0; + if (($670 | 0) > 256) { + $672 = HEAP32[$0 >> 2] | 0; + HEAP32[$672 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$672 >> 2] & 255]($$pre$phiZ2D); + } + if (!($668 << 24 >> 24)) $$1$lcssa$4 = $$1$lcssa$3; else { + _memset($4 + $$1$lcssa$3 | 0, 5, $669 | 0) | 0; + $$1$lcssa$4 = $670; + } + $677 = HEAP8[$15 + 6 >> 0] | 0; + $678 = $677 & 255; + $679 = $$1$lcssa$4 + $678 | 0; + if (($679 | 0) > 256) { + $681 = HEAP32[$0 >> 2] | 0; + HEAP32[$681 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$681 >> 2] & 255]($$pre$phiZ2D); + } + if (!($677 << 24 >> 24)) $$1$lcssa$5 = $$1$lcssa$4; else { + _memset($4 + $$1$lcssa$4 | 0, 6, $678 | 0) | 0; + $$1$lcssa$5 = $679; + } + $686 = HEAP8[$15 + 7 >> 0] | 0; + $687 = $686 & 255; + $688 = $$1$lcssa$5 + $687 | 0; + if (($688 | 0) > 256) { + $690 = HEAP32[$0 >> 2] | 0; + HEAP32[$690 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$690 >> 2] & 255]($$pre$phiZ2D); + } + if (!($686 << 24 >> 24)) $$1$lcssa$6 = $$1$lcssa$5; else { + _memset($4 + $$1$lcssa$5 | 0, 7, $687 | 0) | 0; + $$1$lcssa$6 = $688; + } + $695 = HEAP8[$15 + 8 >> 0] | 0; + $696 = $695 & 255; + $697 = $$1$lcssa$6 + $696 | 0; + if (($697 | 0) > 256) { + $699 = HEAP32[$0 >> 2] | 0; + HEAP32[$699 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$699 >> 2] & 255]($$pre$phiZ2D); + } + if (!($695 << 24 >> 24)) $$1$lcssa$7 = $$1$lcssa$6; else { + _memset($4 + $$1$lcssa$6 | 0, 8, $696 | 0) | 0; + $$1$lcssa$7 = $697; + } + $704 = HEAP8[$15 + 9 >> 0] | 0; + $705 = $704 & 255; + $706 = $$1$lcssa$7 + $705 | 0; + if (($706 | 0) > 256) { + $708 = HEAP32[$0 >> 2] | 0; + HEAP32[$708 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$708 >> 2] & 255]($$pre$phiZ2D); + } + if (!($704 << 24 >> 24)) $$1$lcssa$8 = $$1$lcssa$7; else { + _memset($4 + $$1$lcssa$7 | 0, 9, $705 | 0) | 0; + $$1$lcssa$8 = $706; + } + $713 = HEAP8[$15 + 10 >> 0] | 0; + $714 = $713 & 255; + $715 = $$1$lcssa$8 + $714 | 0; + if (($715 | 0) > 256) { + $717 = HEAP32[$0 >> 2] | 0; + HEAP32[$717 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$717 >> 2] & 255]($$pre$phiZ2D); + } + if (!($713 << 24 >> 24)) $$1$lcssa$9 = $$1$lcssa$8; else { + _memset($4 + $$1$lcssa$8 | 0, 10, $714 | 0) | 0; + $$1$lcssa$9 = $715; + } + $722 = HEAP8[$15 + 11 >> 0] | 0; + $723 = $722 & 255; + $724 = $$1$lcssa$9 + $723 | 0; + if (($724 | 0) > 256) { + $726 = HEAP32[$0 >> 2] | 0; + HEAP32[$726 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$726 >> 2] & 255]($$pre$phiZ2D); + } + if (!($722 << 24 >> 24)) $$1$lcssa$10 = $$1$lcssa$9; else { + _memset($4 + $$1$lcssa$9 | 0, 11, $723 | 0) | 0; + $$1$lcssa$10 = $724; + } + $731 = HEAP8[$15 + 12 >> 0] | 0; + $732 = $731 & 255; + $733 = $$1$lcssa$10 + $732 | 0; + if (($733 | 0) > 256) { + $735 = HEAP32[$0 >> 2] | 0; + HEAP32[$735 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$735 >> 2] & 255]($$pre$phiZ2D); + } + if (!($731 << 24 >> 24)) $$1$lcssa$11 = $$1$lcssa$10; else { + _memset($4 + $$1$lcssa$10 | 0, 12, $732 | 0) | 0; + $$1$lcssa$11 = $733; + } + $740 = HEAP8[$15 + 13 >> 0] | 0; + $741 = $740 & 255; + $742 = $$1$lcssa$11 + $741 | 0; + if (($742 | 0) > 256) { + $744 = HEAP32[$0 >> 2] | 0; + HEAP32[$744 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$744 >> 2] & 255]($$pre$phiZ2D); + } + if (!($740 << 24 >> 24)) $$1$lcssa$12 = $$1$lcssa$11; else { + _memset($4 + $$1$lcssa$11 | 0, 13, $741 | 0) | 0; + $$1$lcssa$12 = $742; + } + $749 = HEAP8[$15 + 14 >> 0] | 0; + $750 = $749 & 255; + $751 = $$1$lcssa$12 + $750 | 0; + if (($751 | 0) > 256) { + $753 = HEAP32[$0 >> 2] | 0; + HEAP32[$753 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$753 >> 2] & 255]($$pre$phiZ2D); + } + if (!($749 << 24 >> 24)) $$1$lcssa$13 = $$1$lcssa$12; else { + _memset($4 + $$1$lcssa$12 | 0, 14, $750 | 0) | 0; + $$1$lcssa$13 = $751; + } + $758 = HEAP8[$15 + 15 >> 0] | 0; + $759 = $758 & 255; + $760 = $$1$lcssa$13 + $759 | 0; + if (($760 | 0) > 256) { + $762 = HEAP32[$0 >> 2] | 0; + HEAP32[$762 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$762 >> 2] & 255]($$pre$phiZ2D); + } + if (!($758 << 24 >> 24)) $$1$lcssa$14 = $$1$lcssa$13; else { + _memset($4 + $$1$lcssa$13 | 0, 15, $759 | 0) | 0; + $$1$lcssa$14 = $760; + } + $767 = HEAP8[$15 + 16 >> 0] | 0; + $768 = $767 & 255; + $769 = $$1$lcssa$14 + $768 | 0; + if (($769 | 0) > 256) { + $771 = HEAP32[$0 >> 2] | 0; + HEAP32[$771 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$771 >> 2] & 255]($$pre$phiZ2D); + } + if (!($767 << 24 >> 24)) $$1$lcssa$15 = $$1$lcssa$14; else { + _memset($4 + $$1$lcssa$14 | 0, 16, $768 | 0) | 0; + $$1$lcssa$15 = $769; + } + HEAP8[$4 + $$1$lcssa$15 >> 0] = 0; + $40 = HEAP8[$4 >> 0] | 0; + if ($40 << 24 >> 24) { + $$0122157 = 0; + $$0129155 = $40 << 24 >> 24; + $$2158 = 0; + $42 = $40; + while (1) { + if (($$0129155 | 0) == ($42 << 24 >> 24 | 0)) { + $$1123148 = $$0122157; + $$3149 = $$2158; + while (1) { + $44 = $$3149 + 1 | 0; + HEAP32[$5 + ($$3149 << 2) >> 2] = $$1123148; + $46 = $$1123148 + 1 | 0; + $48 = HEAP8[$4 + $44 >> 0] | 0; + if (($$0129155 | 0) == ($48 << 24 >> 24 | 0)) { + $$1123148 = $46; + $$3149 = $44; + } else { + $$1123$lcssa = $46; + $$3$lcssa = $44; + $59 = $48; + break; + } + } + } else { + $$1123$lcssa = $$0122157; + $$3$lcssa = $$2158; + $59 = $42; + } + if (($$1123$lcssa | 0) >= (1 << $$0129155 | 0)) { + $53 = HEAP32[$0 >> 2] | 0; + HEAP32[$53 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$53 >> 2] & 255]($$pre$phiZ2D); + } + if (!($59 << 24 >> 24)) break; else { + $$0122157 = $$1123$lcssa << 1; + $$0129155 = $$0129155 + 1 | 0; + $$2158 = $$3$lcssa; + $42 = $59; + } + } + } + $60 = $15 + 1 | 0; + if (!(HEAP8[$60 >> 0] | 0)) { + $$5 = 0; + $$sink = -1; + } else { + HEAP32[$29 + 76 >> 2] = 0 - (HEAP32[$5 >> 2] | 0); + $67 = HEAPU8[$60 >> 0] | 0; + $$5 = $67; + $$sink = HEAP32[$5 + ($67 + -1 << 2) >> 2] | 0; + } + HEAP32[$29 + 4 >> 2] = $$sink; + $72 = $15 + 2 | 0; + if (!(HEAP8[$72 >> 0] | 0)) { + $$5$1 = $$5; + $$sink$1 = -1; + } else { + HEAP32[$29 + 80 >> 2] = $$5 - (HEAP32[$5 + ($$5 << 2) >> 2] | 0); + $440 = $$5 + (HEAPU8[$72 >> 0] | 0) | 0; + $$5$1 = $440; + $$sink$1 = HEAP32[$5 + ($440 + -1 << 2) >> 2] | 0; + } + HEAP32[$29 + 8 >> 2] = $$sink$1; + $445 = $15 + 3 | 0; + if (!(HEAP8[$445 >> 0] | 0)) { + $$5$2 = $$5$1; + $$sink$2 = -1; + } else { + HEAP32[$29 + 84 >> 2] = $$5$1 - (HEAP32[$5 + ($$5$1 << 2) >> 2] | 0); + $454 = $$5$1 + (HEAPU8[$445 >> 0] | 0) | 0; + $$5$2 = $454; + $$sink$2 = HEAP32[$5 + ($454 + -1 << 2) >> 2] | 0; + } + HEAP32[$29 + 12 >> 2] = $$sink$2; + $459 = $15 + 4 | 0; + if (!(HEAP8[$459 >> 0] | 0)) { + $$5$3 = $$5$2; + $$sink$3 = -1; + } else { + HEAP32[$29 + 88 >> 2] = $$5$2 - (HEAP32[$5 + ($$5$2 << 2) >> 2] | 0); + $468 = $$5$2 + (HEAPU8[$459 >> 0] | 0) | 0; + $$5$3 = $468; + $$sink$3 = HEAP32[$5 + ($468 + -1 << 2) >> 2] | 0; + } + HEAP32[$29 + 16 >> 2] = $$sink$3; + $473 = $15 + 5 | 0; + if (!(HEAP8[$473 >> 0] | 0)) { + $$5$4 = $$5$3; + $$sink$4 = -1; + } else { + HEAP32[$29 + 92 >> 2] = $$5$3 - (HEAP32[$5 + ($$5$3 << 2) >> 2] | 0); + $482 = $$5$3 + (HEAPU8[$473 >> 0] | 0) | 0; + $$5$4 = $482; + $$sink$4 = HEAP32[$5 + ($482 + -1 << 2) >> 2] | 0; + } + HEAP32[$29 + 20 >> 2] = $$sink$4; + $487 = $15 + 6 | 0; + if (!(HEAP8[$487 >> 0] | 0)) { + $$5$5 = $$5$4; + $$sink$5 = -1; + } else { + HEAP32[$29 + 96 >> 2] = $$5$4 - (HEAP32[$5 + ($$5$4 << 2) >> 2] | 0); + $496 = $$5$4 + (HEAPU8[$487 >> 0] | 0) | 0; + $$5$5 = $496; + $$sink$5 = HEAP32[$5 + ($496 + -1 << 2) >> 2] | 0; + } + HEAP32[$29 + 24 >> 2] = $$sink$5; + $501 = $15 + 7 | 0; + if (!(HEAP8[$501 >> 0] | 0)) { + $$5$6 = $$5$5; + $$sink$6 = -1; + } else { + HEAP32[$29 + 100 >> 2] = $$5$5 - (HEAP32[$5 + ($$5$5 << 2) >> 2] | 0); + $510 = $$5$5 + (HEAPU8[$501 >> 0] | 0) | 0; + $$5$6 = $510; + $$sink$6 = HEAP32[$5 + ($510 + -1 << 2) >> 2] | 0; + } + HEAP32[$29 + 28 >> 2] = $$sink$6; + $515 = $15 + 8 | 0; + if (!(HEAP8[$515 >> 0] | 0)) { + $$5$7 = $$5$6; + $$sink$7 = -1; + } else { + HEAP32[$29 + 104 >> 2] = $$5$6 - (HEAP32[$5 + ($$5$6 << 2) >> 2] | 0); + $524 = $$5$6 + (HEAPU8[$515 >> 0] | 0) | 0; + $$5$7 = $524; + $$sink$7 = HEAP32[$5 + ($524 + -1 << 2) >> 2] | 0; + } + HEAP32[$29 + 32 >> 2] = $$sink$7; + $529 = $15 + 9 | 0; + if (!(HEAP8[$529 >> 0] | 0)) { + $$5$8 = $$5$7; + $$sink$8 = -1; + } else { + HEAP32[$29 + 108 >> 2] = $$5$7 - (HEAP32[$5 + ($$5$7 << 2) >> 2] | 0); + $538 = $$5$7 + (HEAPU8[$529 >> 0] | 0) | 0; + $$5$8 = $538; + $$sink$8 = HEAP32[$5 + ($538 + -1 << 2) >> 2] | 0; + } + HEAP32[$29 + 36 >> 2] = $$sink$8; + $543 = $15 + 10 | 0; + if (!(HEAP8[$543 >> 0] | 0)) { + $$5$9 = $$5$8; + $$sink$9 = -1; + } else { + HEAP32[$29 + 112 >> 2] = $$5$8 - (HEAP32[$5 + ($$5$8 << 2) >> 2] | 0); + $552 = $$5$8 + (HEAPU8[$543 >> 0] | 0) | 0; + $$5$9 = $552; + $$sink$9 = HEAP32[$5 + ($552 + -1 << 2) >> 2] | 0; + } + HEAP32[$29 + 40 >> 2] = $$sink$9; + $557 = $15 + 11 | 0; + if (!(HEAP8[$557 >> 0] | 0)) { + $$5$10 = $$5$9; + $$sink$10 = -1; + } else { + HEAP32[$29 + 116 >> 2] = $$5$9 - (HEAP32[$5 + ($$5$9 << 2) >> 2] | 0); + $566 = $$5$9 + (HEAPU8[$557 >> 0] | 0) | 0; + $$5$10 = $566; + $$sink$10 = HEAP32[$5 + ($566 + -1 << 2) >> 2] | 0; + } + HEAP32[$29 + 44 >> 2] = $$sink$10; + $571 = $15 + 12 | 0; + if (!(HEAP8[$571 >> 0] | 0)) { + $$5$11 = $$5$10; + $$sink$11 = -1; + } else { + HEAP32[$29 + 120 >> 2] = $$5$10 - (HEAP32[$5 + ($$5$10 << 2) >> 2] | 0); + $580 = $$5$10 + (HEAPU8[$571 >> 0] | 0) | 0; + $$5$11 = $580; + $$sink$11 = HEAP32[$5 + ($580 + -1 << 2) >> 2] | 0; + } + HEAP32[$29 + 48 >> 2] = $$sink$11; + $585 = $15 + 13 | 0; + if (!(HEAP8[$585 >> 0] | 0)) { + $$5$12 = $$5$11; + $$sink$12 = -1; + } else { + HEAP32[$29 + 124 >> 2] = $$5$11 - (HEAP32[$5 + ($$5$11 << 2) >> 2] | 0); + $594 = $$5$11 + (HEAPU8[$585 >> 0] | 0) | 0; + $$5$12 = $594; + $$sink$12 = HEAP32[$5 + ($594 + -1 << 2) >> 2] | 0; + } + HEAP32[$29 + 52 >> 2] = $$sink$12; + $599 = $15 + 14 | 0; + if (!(HEAP8[$599 >> 0] | 0)) { + $$5$13 = $$5$12; + $$sink$13 = -1; + } else { + HEAP32[$29 + 128 >> 2] = $$5$12 - (HEAP32[$5 + ($$5$12 << 2) >> 2] | 0); + $608 = $$5$12 + (HEAPU8[$599 >> 0] | 0) | 0; + $$5$13 = $608; + $$sink$13 = HEAP32[$5 + ($608 + -1 << 2) >> 2] | 0; + } + HEAP32[$29 + 56 >> 2] = $$sink$13; + $613 = $15 + 15 | 0; + if (!(HEAP8[$613 >> 0] | 0)) { + $$5$14 = $$5$13; + $$sink$14 = -1; + } else { + HEAP32[$29 + 132 >> 2] = $$5$13 - (HEAP32[$5 + ($$5$13 << 2) >> 2] | 0); + $622 = $$5$13 + (HEAPU8[$613 >> 0] | 0) | 0; + $$5$14 = $622; + $$sink$14 = HEAP32[$5 + ($622 + -1 << 2) >> 2] | 0; + } + HEAP32[$29 + 60 >> 2] = $$sink$14; + $627 = $15 + 16 | 0; + if (!(HEAP8[$627 >> 0] | 0)) $$sink$15 = -1; else { + HEAP32[$29 + 136 >> 2] = $$5$14 - (HEAP32[$5 + ($$5$14 << 2) >> 2] | 0); + $$sink$15 = HEAP32[$5 + ($$5$14 + (HEAPU8[$627 >> 0] | 0) + -1 << 2) >> 2] | 0; + } + HEAP32[$29 + 64 >> 2] = $$sink$15; + HEAP32[$29 + 68 >> 2] = 1048575; + _memset($29 + 144 | 0, 0, 1024) | 0; + $88 = $15 + 1 | 0; + if (!(HEAP8[$88 >> 0] | 0)) $$7$lcssa = 0; else { + $$1127137$us = 1; + $$7138$us = 0; + while (1) { + $78 = $15 + 17 + $$7138$us | 0; + $$0124135$us = 128; + $$0125134$us = HEAP32[$5 + ($$7138$us << 2) >> 2] << 7; + while (1) { + HEAP32[$29 + 144 + ($$0125134$us << 2) >> 2] = 1; + HEAP8[$29 + 1168 + $$0125134$us >> 0] = HEAP8[$78 >> 0] | 0; + if (($$0124135$us | 0) > 1) { + $$0124135$us = $$0124135$us + -1 | 0; + $$0125134$us = $$0125134$us + 1 | 0; + } else break; + } + $86 = $$7138$us + 1 | 0; + if ($$1127137$us >>> 0 < (HEAPU8[$88 >> 0] | 0) >>> 0) { + $$1127137$us = $$1127137$us + 1 | 0; + $$7138$us = $86; + } else { + $$7$lcssa = $86; + break; + } + } + } + $91 = $15 + 2 | 0; + if (!(HEAP8[$91 >> 0] | 0)) $$7$lcssa$1 = $$7$lcssa; else { + $$1127137$us$1 = 1; + $$7138$us$1 = $$7$lcssa; + while (1) { + $104 = $15 + 17 + $$7138$us$1 | 0; + $$0124135$us$1 = 64; + $$0125134$us$1 = HEAP32[$5 + ($$7138$us$1 << 2) >> 2] << 6; + while (1) { + HEAP32[$29 + 144 + ($$0125134$us$1 << 2) >> 2] = 2; + HEAP8[$29 + 1168 + $$0125134$us$1 >> 0] = HEAP8[$104 >> 0] | 0; + if (($$0124135$us$1 | 0) > 1) { + $$0124135$us$1 = $$0124135$us$1 + -1 | 0; + $$0125134$us$1 = $$0125134$us$1 + 1 | 0; + } else break; + } + $112 = $$7138$us$1 + 1 | 0; + if ($$1127137$us$1 >>> 0 < (HEAPU8[$91 >> 0] | 0) >>> 0) { + $$1127137$us$1 = $$1127137$us$1 + 1 | 0; + $$7138$us$1 = $112; + } else { + $$7$lcssa$1 = $112; + break; + } + } + } + $116 = $15 + 3 | 0; + if (!(HEAP8[$116 >> 0] | 0)) $$7$lcssa$2 = $$7$lcssa$1; else { + $$1127137$us$2 = 1; + $$7138$us$2 = $$7$lcssa$1; + while (1) { + $121 = HEAP32[$5 + ($$7138$us$2 << 2) >> 2] << 5; + $122 = $15 + 17 + $$7138$us$2 | 0; + HEAP32[$29 + 144 + ($121 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $121 >> 0] = HEAP8[$122 >> 0] | 0; + $126 = $121 | 1; + HEAP32[$29 + 144 + ($126 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $126 >> 0] = HEAP8[$122 >> 0] | 0; + $130 = $126 + 1 | 0; + HEAP32[$29 + 144 + ($130 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $130 >> 0] = HEAP8[$122 >> 0] | 0; + $134 = $121 | 3; + HEAP32[$29 + 144 + ($134 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $134 >> 0] = HEAP8[$122 >> 0] | 0; + $138 = $134 + 1 | 0; + HEAP32[$29 + 144 + ($138 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $138 >> 0] = HEAP8[$122 >> 0] | 0; + $142 = $134 + 2 | 0; + HEAP32[$29 + 144 + ($142 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $142 >> 0] = HEAP8[$122 >> 0] | 0; + $146 = $134 + 3 | 0; + HEAP32[$29 + 144 + ($146 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $146 >> 0] = HEAP8[$122 >> 0] | 0; + $150 = $121 | 7; + HEAP32[$29 + 144 + ($150 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $150 >> 0] = HEAP8[$122 >> 0] | 0; + $154 = $150 + 1 | 0; + HEAP32[$29 + 144 + ($154 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $154 >> 0] = HEAP8[$122 >> 0] | 0; + $158 = $150 + 2 | 0; + HEAP32[$29 + 144 + ($158 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $158 >> 0] = HEAP8[$122 >> 0] | 0; + $162 = $150 + 3 | 0; + HEAP32[$29 + 144 + ($162 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $162 >> 0] = HEAP8[$122 >> 0] | 0; + $166 = $150 + 4 | 0; + HEAP32[$29 + 144 + ($166 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $166 >> 0] = HEAP8[$122 >> 0] | 0; + $170 = $150 + 5 | 0; + HEAP32[$29 + 144 + ($170 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $170 >> 0] = HEAP8[$122 >> 0] | 0; + $174 = $150 + 6 | 0; + HEAP32[$29 + 144 + ($174 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $174 >> 0] = HEAP8[$122 >> 0] | 0; + $178 = $150 + 7 | 0; + HEAP32[$29 + 144 + ($178 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $178 >> 0] = HEAP8[$122 >> 0] | 0; + $182 = $121 | 15; + HEAP32[$29 + 144 + ($182 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $182 >> 0] = HEAP8[$122 >> 0] | 0; + $186 = $182 + 1 | 0; + HEAP32[$29 + 144 + ($186 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $186 >> 0] = HEAP8[$122 >> 0] | 0; + $190 = $182 + 2 | 0; + HEAP32[$29 + 144 + ($190 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $190 >> 0] = HEAP8[$122 >> 0] | 0; + $194 = $182 + 3 | 0; + HEAP32[$29 + 144 + ($194 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $194 >> 0] = HEAP8[$122 >> 0] | 0; + $198 = $182 + 4 | 0; + HEAP32[$29 + 144 + ($198 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $198 >> 0] = HEAP8[$122 >> 0] | 0; + $202 = $182 + 5 | 0; + HEAP32[$29 + 144 + ($202 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $202 >> 0] = HEAP8[$122 >> 0] | 0; + $206 = $182 + 6 | 0; + HEAP32[$29 + 144 + ($206 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $206 >> 0] = HEAP8[$122 >> 0] | 0; + $210 = $182 + 7 | 0; + HEAP32[$29 + 144 + ($210 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $210 >> 0] = HEAP8[$122 >> 0] | 0; + $214 = $182 + 8 | 0; + HEAP32[$29 + 144 + ($214 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $214 >> 0] = HEAP8[$122 >> 0] | 0; + $218 = $182 + 9 | 0; + HEAP32[$29 + 144 + ($218 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $218 >> 0] = HEAP8[$122 >> 0] | 0; + $222 = $182 + 10 | 0; + HEAP32[$29 + 144 + ($222 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $222 >> 0] = HEAP8[$122 >> 0] | 0; + $226 = $182 + 11 | 0; + HEAP32[$29 + 144 + ($226 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $226 >> 0] = HEAP8[$122 >> 0] | 0; + $230 = $182 + 12 | 0; + HEAP32[$29 + 144 + ($230 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $230 >> 0] = HEAP8[$122 >> 0] | 0; + $234 = $182 + 13 | 0; + HEAP32[$29 + 144 + ($234 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $234 >> 0] = HEAP8[$122 >> 0] | 0; + $238 = $182 + 14 | 0; + HEAP32[$29 + 144 + ($238 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $238 >> 0] = HEAP8[$122 >> 0] | 0; + $242 = $182 + 15 | 0; + HEAP32[$29 + 144 + ($242 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $242 >> 0] = HEAP8[$122 >> 0] | 0; + $246 = $121 | 31; + HEAP32[$29 + 144 + ($246 << 2) >> 2] = 3; + HEAP8[$29 + 1168 + $246 >> 0] = HEAP8[$122 >> 0] | 0; + $251 = $$7138$us$2 + 1 | 0; + if ($$1127137$us$2 >>> 0 < (HEAPU8[$116 >> 0] | 0) >>> 0) { + $$1127137$us$2 = $$1127137$us$2 + 1 | 0; + $$7138$us$2 = $251; + } else { + $$7$lcssa$2 = $251; + break; + } + } + } + $255 = $15 + 4 | 0; + if (!(HEAP8[$255 >> 0] | 0)) $$7$lcssa$3 = $$7$lcssa$2; else { + $$1127137$us$3 = 1; + $$7138$us$3 = $$7$lcssa$2; + while (1) { + $260 = HEAP32[$5 + ($$7138$us$3 << 2) >> 2] << 4; + $261 = $15 + 17 + $$7138$us$3 | 0; + HEAP32[$29 + 144 + ($260 << 2) >> 2] = 4; + HEAP8[$29 + 1168 + $260 >> 0] = HEAP8[$261 >> 0] | 0; + $265 = $260 | 1; + HEAP32[$29 + 144 + ($265 << 2) >> 2] = 4; + HEAP8[$29 + 1168 + $265 >> 0] = HEAP8[$261 >> 0] | 0; + $269 = $265 + 1 | 0; + HEAP32[$29 + 144 + ($269 << 2) >> 2] = 4; + HEAP8[$29 + 1168 + $269 >> 0] = HEAP8[$261 >> 0] | 0; + $273 = $260 | 3; + HEAP32[$29 + 144 + ($273 << 2) >> 2] = 4; + HEAP8[$29 + 1168 + $273 >> 0] = HEAP8[$261 >> 0] | 0; + $277 = $273 + 1 | 0; + HEAP32[$29 + 144 + ($277 << 2) >> 2] = 4; + HEAP8[$29 + 1168 + $277 >> 0] = HEAP8[$261 >> 0] | 0; + $281 = $273 + 2 | 0; + HEAP32[$29 + 144 + ($281 << 2) >> 2] = 4; + HEAP8[$29 + 1168 + $281 >> 0] = HEAP8[$261 >> 0] | 0; + $285 = $273 + 3 | 0; + HEAP32[$29 + 144 + ($285 << 2) >> 2] = 4; + HEAP8[$29 + 1168 + $285 >> 0] = HEAP8[$261 >> 0] | 0; + $289 = $260 | 7; + HEAP32[$29 + 144 + ($289 << 2) >> 2] = 4; + HEAP8[$29 + 1168 + $289 >> 0] = HEAP8[$261 >> 0] | 0; + $293 = $289 + 1 | 0; + HEAP32[$29 + 144 + ($293 << 2) >> 2] = 4; + HEAP8[$29 + 1168 + $293 >> 0] = HEAP8[$261 >> 0] | 0; + $297 = $289 + 2 | 0; + HEAP32[$29 + 144 + ($297 << 2) >> 2] = 4; + HEAP8[$29 + 1168 + $297 >> 0] = HEAP8[$261 >> 0] | 0; + $301 = $289 + 3 | 0; + HEAP32[$29 + 144 + ($301 << 2) >> 2] = 4; + HEAP8[$29 + 1168 + $301 >> 0] = HEAP8[$261 >> 0] | 0; + $305 = $289 + 4 | 0; + HEAP32[$29 + 144 + ($305 << 2) >> 2] = 4; + HEAP8[$29 + 1168 + $305 >> 0] = HEAP8[$261 >> 0] | 0; + $309 = $289 + 5 | 0; + HEAP32[$29 + 144 + ($309 << 2) >> 2] = 4; + HEAP8[$29 + 1168 + $309 >> 0] = HEAP8[$261 >> 0] | 0; + $313 = $289 + 6 | 0; + HEAP32[$29 + 144 + ($313 << 2) >> 2] = 4; + HEAP8[$29 + 1168 + $313 >> 0] = HEAP8[$261 >> 0] | 0; + $317 = $289 + 7 | 0; + HEAP32[$29 + 144 + ($317 << 2) >> 2] = 4; + HEAP8[$29 + 1168 + $317 >> 0] = HEAP8[$261 >> 0] | 0; + $321 = $260 | 15; + HEAP32[$29 + 144 + ($321 << 2) >> 2] = 4; + HEAP8[$29 + 1168 + $321 >> 0] = HEAP8[$261 >> 0] | 0; + $326 = $$7138$us$3 + 1 | 0; + if ($$1127137$us$3 >>> 0 < (HEAPU8[$255 >> 0] | 0) >>> 0) { + $$1127137$us$3 = $$1127137$us$3 + 1 | 0; + $$7138$us$3 = $326; + } else { + $$7$lcssa$3 = $326; + break; + } + } + } + $330 = $15 + 5 | 0; + if (!(HEAP8[$330 >> 0] | 0)) $$7$lcssa$4 = $$7$lcssa$3; else { + $$1127137$us$4 = 1; + $$7138$us$4 = $$7$lcssa$3; + while (1) { + $335 = HEAP32[$5 + ($$7138$us$4 << 2) >> 2] << 3; + $336 = $15 + 17 + $$7138$us$4 | 0; + HEAP32[$29 + 144 + ($335 << 2) >> 2] = 5; + HEAP8[$29 + 1168 + $335 >> 0] = HEAP8[$336 >> 0] | 0; + $340 = $335 | 1; + HEAP32[$29 + 144 + ($340 << 2) >> 2] = 5; + HEAP8[$29 + 1168 + $340 >> 0] = HEAP8[$336 >> 0] | 0; + $344 = $340 + 1 | 0; + HEAP32[$29 + 144 + ($344 << 2) >> 2] = 5; + HEAP8[$29 + 1168 + $344 >> 0] = HEAP8[$336 >> 0] | 0; + $348 = $335 | 3; + HEAP32[$29 + 144 + ($348 << 2) >> 2] = 5; + HEAP8[$29 + 1168 + $348 >> 0] = HEAP8[$336 >> 0] | 0; + $352 = $348 + 1 | 0; + HEAP32[$29 + 144 + ($352 << 2) >> 2] = 5; + HEAP8[$29 + 1168 + $352 >> 0] = HEAP8[$336 >> 0] | 0; + $356 = $348 + 2 | 0; + HEAP32[$29 + 144 + ($356 << 2) >> 2] = 5; + HEAP8[$29 + 1168 + $356 >> 0] = HEAP8[$336 >> 0] | 0; + $360 = $348 + 3 | 0; + HEAP32[$29 + 144 + ($360 << 2) >> 2] = 5; + HEAP8[$29 + 1168 + $360 >> 0] = HEAP8[$336 >> 0] | 0; + $364 = $335 | 7; + HEAP32[$29 + 144 + ($364 << 2) >> 2] = 5; + HEAP8[$29 + 1168 + $364 >> 0] = HEAP8[$336 >> 0] | 0; + $369 = $$7138$us$4 + 1 | 0; + if ($$1127137$us$4 >>> 0 < (HEAPU8[$330 >> 0] | 0) >>> 0) { + $$1127137$us$4 = $$1127137$us$4 + 1 | 0; + $$7138$us$4 = $369; + } else { + $$7$lcssa$4 = $369; + break; + } + } + } + $373 = $15 + 6 | 0; + if (!(HEAP8[$373 >> 0] | 0)) $$7$lcssa$5 = $$7$lcssa$4; else { + $$1127137$us$5 = 1; + $$7138$us$5 = $$7$lcssa$4; + while (1) { + $378 = HEAP32[$5 + ($$7138$us$5 << 2) >> 2] << 2; + $379 = $15 + 17 + $$7138$us$5 | 0; + HEAP32[$29 + 144 + ($378 << 2) >> 2] = 6; + HEAP8[$29 + 1168 + $378 >> 0] = HEAP8[$379 >> 0] | 0; + $383 = $378 | 1; + HEAP32[$29 + 144 + ($383 << 2) >> 2] = 6; + HEAP8[$29 + 1168 + $383 >> 0] = HEAP8[$379 >> 0] | 0; + $387 = $383 + 1 | 0; + HEAP32[$29 + 144 + ($387 << 2) >> 2] = 6; + HEAP8[$29 + 1168 + $387 >> 0] = HEAP8[$379 >> 0] | 0; + $391 = $378 | 3; + HEAP32[$29 + 144 + ($391 << 2) >> 2] = 6; + HEAP8[$29 + 1168 + $391 >> 0] = HEAP8[$379 >> 0] | 0; + $396 = $$7138$us$5 + 1 | 0; + if ($$1127137$us$5 >>> 0 < (HEAPU8[$373 >> 0] | 0) >>> 0) { + $$1127137$us$5 = $$1127137$us$5 + 1 | 0; + $$7138$us$5 = $396; + } else { + $$7$lcssa$5 = $396; + break; + } + } + } + $400 = $15 + 7 | 0; + if (!(HEAP8[$400 >> 0] | 0)) $$7$lcssa$6 = $$7$lcssa$5; else { + $$1127137$us$6 = 1; + $$7138$us$6 = $$7$lcssa$5; + while (1) { + $405 = HEAP32[$5 + ($$7138$us$6 << 2) >> 2] << 1; + $406 = $15 + 17 + $$7138$us$6 | 0; + HEAP32[$29 + 144 + ($405 << 2) >> 2] = 7; + HEAP8[$29 + 1168 + $405 >> 0] = HEAP8[$406 >> 0] | 0; + $410 = $405 | 1; + HEAP32[$29 + 144 + ($410 << 2) >> 2] = 7; + HEAP8[$29 + 1168 + $410 >> 0] = HEAP8[$406 >> 0] | 0; + $415 = $$7138$us$6 + 1 | 0; + if ($$1127137$us$6 >>> 0 < (HEAPU8[$400 >> 0] | 0) >>> 0) { + $$1127137$us$6 = $$1127137$us$6 + 1 | 0; + $$7138$us$6 = $415; + } else { + $$7$lcssa$6 = $415; + break; + } + } + } + $419 = $15 + 8 | 0; + if (HEAP8[$419 >> 0] | 0) { + $$1127137$us$7 = 1; + $$7138$us$7 = $$7$lcssa$6; + while (1) { + $423 = HEAP32[$5 + ($$7138$us$7 << 2) >> 2] | 0; + HEAP32[$29 + 144 + ($423 << 2) >> 2] = 8; + HEAP8[$29 + 1168 + $423 >> 0] = HEAP8[$15 + 17 + $$7138$us$7 >> 0] | 0; + if ($$1127137$us$7 >>> 0 < (HEAPU8[$419 >> 0] | 0) >>> 0) { + $$1127137$us$7 = $$1127137$us$7 + 1 | 0; + $$7138$us$7 = $$7138$us$7 + 1 | 0; + } else break; + } + } + if (!($12 & ($$1$lcssa$15 | 0) > 0)) { + STACKTOP = sp; + return; + } + $$2128133 = 0; + do { + if ((HEAPU8[$15 + 17 + $$2128133 >> 0] | 0) > 15) { + $97 = HEAP32[$0 >> 2] | 0; + HEAP32[$97 + 20 >> 2] = 9; + FUNCTION_TABLE_vi[HEAP32[$97 >> 2] & 255]($$pre$phiZ2D); + } + $$2128133 = $$2128133 + 1 | 0; + } while (($$2128133 | 0) != ($$1$lcssa$15 | 0)); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseFoldExprEv($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$2 = 0, $$3 = 0, $$byval_copy30 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $106 = 0, $11 = 0, $111 = 0, $112 = 0, $117 = 0, $12 = 0, $122 = 0, $123 = 0, $128 = 0, $13 = 0, $133 = 0, $134 = 0, $139 = 0, $14 = 0, $144 = 0, $145 = 0, $15 = 0, $150 = 0, $155 = 0, $156 = 0, $16 = 0, $161 = 0, $166 = 0, $167 = 0, $17 = 0, $172 = 0, $177 = 0, $178 = 0, $18 = 0, $183 = 0, $188 = 0, $189 = 0, $19 = 0, $194 = 0, $199 = 0, $2 = 0, $20 = 0, $200 = 0, $205 = 0, $21 = 0, $210 = 0, $211 = 0, $216 = 0, $22 = 0, $221 = 0, $222 = 0, $227 = 0, $23 = 0, $232 = 0, $233 = 0, $238 = 0, $24 = 0, $243 = 0, $244 = 0, $249 = 0, $25 = 0, $254 = 0, $255 = 0, $26 = 0, $260 = 0, $265 = 0, $266 = 0, $27 = 0, $271 = 0, $276 = 0, $277 = 0, $28 = 0, $282 = 0, $287 = 0, $288 = 0, $29 = 0, $293 = 0, $298 = 0, $299 = 0, $3 = 0, $30 = 0, $304 = 0, $309 = 0, $31 = 0, $310 = 0, $315 = 0, $32 = 0, $320 = 0, $321 = 0, $326 = 0, $33 = 0, $331 = 0, $332 = 0, $337 = 0, $34 = 0, $342 = 0, $343 = 0, $348 = 0, $353 = 0, $354 = 0, $359 = 0, $36 = 0, $364 = 0, $365 = 0, $370 = 0, $375 = 0, $376 = 0, $380 = 0, $381 = 0, $383 = 0, $384 = 0, $4 = 0, $40 = 0, $45 = 0, $46 = 0, $5 = 0, $51 = 0, $56 = 0, $57 = 0, $6 = 0, $62 = 0, $67 = 0, $68 = 0, $7 = 0, $73 = 0, $78 = 0, $79 = 0, $8 = 0, $84 = 0, $89 = 0, $9 = 0, $90 = 0, $95 = 0, $storemerge = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 288 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(288); + $$byval_copy30 = sp + 8 | 0; + $1 = sp + 272 | 0; + $2 = sp; + $3 = sp + 264 | 0; + $4 = sp + 256 | 0; + $5 = sp + 248 | 0; + $6 = sp + 240 | 0; + $7 = sp + 232 | 0; + $8 = sp + 224 | 0; + $9 = sp + 216 | 0; + $10 = sp + 208 | 0; + $11 = sp + 200 | 0; + $12 = sp + 192 | 0; + $13 = sp + 184 | 0; + $14 = sp + 176 | 0; + $15 = sp + 168 | 0; + $16 = sp + 160 | 0; + $17 = sp + 152 | 0; + $18 = sp + 144 | 0; + $19 = sp + 136 | 0; + $20 = sp + 128 | 0; + $21 = sp + 120 | 0; + $22 = sp + 112 | 0; + $23 = sp + 104 | 0; + $24 = sp + 96 | 0; + $25 = sp + 88 | 0; + $26 = sp + 80 | 0; + $27 = sp + 72 | 0; + $28 = sp + 64 | 0; + $29 = sp + 56 | 0; + $30 = sp + 48 | 0; + $31 = sp + 40 | 0; + $32 = sp + 32 | 0; + $33 = sp + 24 | 0; + $34 = sp + 16 | 0; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 102) | 0) { + $36 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0; + switch ($36 << 24 >> 24) { + case 76: + case 108: + { + $storemerge = 1; + label = 4; + break; + } + case 82: + case 114: + { + $storemerge = 0; + label = 4; + break; + } + default: + $$2 = 0; + } + if ((label | 0) == 4) { + HEAP8[$1 >> 0] = $storemerge; + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + __ZN12_GLOBAL__N_110StringViewC2Ev($2); + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 54764); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + do if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 51972); + $40 = $$byval_copy30; + $45 = HEAP32[$40 + 4 >> 2] | 0; + $46 = $2; + HEAP32[$46 >> 2] = HEAP32[$40 >> 2]; + HEAP32[$46 + 4 >> 2] = $45; + label = 66; + } else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 54767); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 51970); + $51 = $$byval_copy30; + $56 = HEAP32[$51 + 4 >> 2] | 0; + $57 = $2; + HEAP32[$57 >> 2] = HEAP32[$51 >> 2]; + HEAP32[$57 + 4 >> 2] = $56; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 54770); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52668); + $62 = $$byval_copy30; + $67 = HEAP32[$62 + 4 >> 2] | 0; + $68 = $2; + HEAP32[$68 >> 2] = HEAP32[$62 >> 2]; + HEAP32[$68 + 4 >> 2] = $67; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($6, 54773); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52671); + $73 = $$byval_copy30; + $78 = HEAP32[$73 + 4 >> 2] | 0; + $79 = $2; + HEAP32[$79 >> 2] = HEAP32[$73 >> 2]; + HEAP32[$79 + 4 >> 2] = $78; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($7, 54776); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$7 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52683); + $84 = $$byval_copy30; + $89 = HEAP32[$84 + 4 >> 2] | 0; + $90 = $2; + HEAP32[$90 >> 2] = HEAP32[$84 >> 2]; + HEAP32[$90 + 4 >> 2] = $89; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($8, 54779); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$8 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52687); + $95 = $$byval_copy30; + $100 = HEAP32[$95 + 4 >> 2] | 0; + $101 = $2; + HEAP32[$101 >> 2] = HEAP32[$95 >> 2]; + HEAP32[$101 + 4 >> 2] = $100; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($9, 54782); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$9 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52690); + $106 = $$byval_copy30; + $111 = HEAP32[$106 + 4 >> 2] | 0; + $112 = $2; + HEAP32[$112 >> 2] = HEAP32[$106 >> 2]; + HEAP32[$112 + 4 >> 2] = $111; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($10, 54785); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$10 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$10 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52692); + $117 = $$byval_copy30; + $122 = HEAP32[$117 + 4 >> 2] | 0; + $123 = $2; + HEAP32[$123 >> 2] = HEAP32[$117 >> 2]; + HEAP32[$123 + 4 >> 2] = $122; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($11, 54788); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52695); + $128 = $$byval_copy30; + $133 = HEAP32[$128 + 4 >> 2] | 0; + $134 = $2; + HEAP32[$134 >> 2] = HEAP32[$128 >> 2]; + HEAP32[$134 + 4 >> 2] = $133; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($12, 54791); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$12 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$12 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52697); + $139 = $$byval_copy30; + $144 = HEAP32[$139 + 4 >> 2] | 0; + $145 = $2; + HEAP32[$145 >> 2] = HEAP32[$139 >> 2]; + HEAP32[$145 + 4 >> 2] = $144; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($13, 54794); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$13 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$13 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52700); + $150 = $$byval_copy30; + $155 = HEAP32[$150 + 4 >> 2] | 0; + $156 = $2; + HEAP32[$156 >> 2] = HEAP32[$150 >> 2]; + HEAP32[$156 + 4 >> 2] = $155; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($14, 54797); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$14 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$14 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52703); + $161 = $$byval_copy30; + $166 = HEAP32[$161 + 4 >> 2] | 0; + $167 = $2; + HEAP32[$167 >> 2] = HEAP32[$161 >> 2]; + HEAP32[$167 + 4 >> 2] = $166; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($15, 54800); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$15 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$15 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52043); + $172 = $$byval_copy30; + $177 = HEAP32[$172 + 4 >> 2] | 0; + $178 = $2; + HEAP32[$178 >> 2] = HEAP32[$172 >> 2]; + HEAP32[$178 + 4 >> 2] = $177; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($16, 54803); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$16 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$16 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52706); + $183 = $$byval_copy30; + $188 = HEAP32[$183 + 4 >> 2] | 0; + $189 = $2; + HEAP32[$189 >> 2] = HEAP32[$183 >> 2]; + HEAP32[$189 + 4 >> 2] = $188; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($17, 54806); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$17 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$17 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52709); + $194 = $$byval_copy30; + $199 = HEAP32[$194 + 4 >> 2] | 0; + $200 = $2; + HEAP32[$200 >> 2] = HEAP32[$194 >> 2]; + HEAP32[$200 + 4 >> 2] = $199; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($18, 54809); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$18 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$18 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52712); + $205 = $$byval_copy30; + $210 = HEAP32[$205 + 4 >> 2] | 0; + $211 = $2; + HEAP32[$211 >> 2] = HEAP32[$205 >> 2]; + HEAP32[$211 + 4 >> 2] = $210; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($19, 54812); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$19 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$19 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52150); + $216 = $$byval_copy30; + $221 = HEAP32[$216 + 4 >> 2] | 0; + $222 = $2; + HEAP32[$222 >> 2] = HEAP32[$216 >> 2]; + HEAP32[$222 + 4 >> 2] = $221; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($20, 54815); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$20 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52555); + $227 = $$byval_copy30; + $232 = HEAP32[$227 + 4 >> 2] | 0; + $233 = $2; + HEAP32[$233 >> 2] = HEAP32[$227 >> 2]; + HEAP32[$233 + 4 >> 2] = $232; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($21, 54818); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$21 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$21 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52716); + $238 = $$byval_copy30; + $243 = HEAP32[$238 + 4 >> 2] | 0; + $244 = $2; + HEAP32[$244 >> 2] = HEAP32[$238 >> 2]; + HEAP32[$244 + 4 >> 2] = $243; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($22, 54821); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$22 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$22 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52037); + $249 = $$byval_copy30; + $254 = HEAP32[$249 + 4 >> 2] | 0; + $255 = $2; + HEAP32[$255 >> 2] = HEAP32[$249 >> 2]; + HEAP32[$255 + 4 >> 2] = $254; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($23, 54824); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$23 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$23 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52719); + $260 = $$byval_copy30; + $265 = HEAP32[$260 + 4 >> 2] | 0; + $266 = $2; + HEAP32[$266 >> 2] = HEAP32[$260 >> 2]; + HEAP32[$266 + 4 >> 2] = $265; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($24, 54827); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$24 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$24 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52725); + $271 = $$byval_copy30; + $276 = HEAP32[$271 + 4 >> 2] | 0; + $277 = $2; + HEAP32[$277 >> 2] = HEAP32[$271 >> 2]; + HEAP32[$277 + 4 >> 2] = $276; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($25, 54830); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$25 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$25 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52730); + $282 = $$byval_copy30; + $287 = HEAP32[$282 + 4 >> 2] | 0; + $288 = $2; + HEAP32[$288 >> 2] = HEAP32[$282 >> 2]; + HEAP32[$288 + 4 >> 2] = $287; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($26, 54833); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$26 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$26 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52733); + $293 = $$byval_copy30; + $298 = HEAP32[$293 + 4 >> 2] | 0; + $299 = $2; + HEAP32[$299 >> 2] = HEAP32[$293 >> 2]; + HEAP32[$299 + 4 >> 2] = $298; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($27, 54836); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$27 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$27 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52735); + $304 = $$byval_copy30; + $309 = HEAP32[$304 + 4 >> 2] | 0; + $310 = $2; + HEAP32[$310 >> 2] = HEAP32[$304 >> 2]; + HEAP32[$310 + 4 >> 2] = $309; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($28, 54839); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$28 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$28 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52742); + $315 = $$byval_copy30; + $320 = HEAP32[$315 + 4 >> 2] | 0; + $321 = $2; + HEAP32[$321 >> 2] = HEAP32[$315 >> 2]; + HEAP32[$321 + 4 >> 2] = $320; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($29, 54842); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$29 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$29 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52744); + $326 = $$byval_copy30; + $331 = HEAP32[$326 + 4 >> 2] | 0; + $332 = $2; + HEAP32[$332 >> 2] = HEAP32[$326 >> 2]; + HEAP32[$332 + 4 >> 2] = $331; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($30, 54845); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$30 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$30 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52753); + $337 = $$byval_copy30; + $342 = HEAP32[$337 + 4 >> 2] | 0; + $343 = $2; + HEAP32[$343 >> 2] = HEAP32[$337 >> 2]; + HEAP32[$343 + 4 >> 2] = $342; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($31, 54848); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$31 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$31 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52755); + $348 = $$byval_copy30; + $353 = HEAP32[$348 + 4 >> 2] | 0; + $354 = $2; + HEAP32[$354 >> 2] = HEAP32[$348 >> 2]; + HEAP32[$354 + 4 >> 2] = $353; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($32, 54851); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$32 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$32 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52758); + $359 = $$byval_copy30; + $364 = HEAP32[$359 + 4 >> 2] | 0; + $365 = $2; + HEAP32[$365 >> 2] = HEAP32[$359 >> 2]; + HEAP32[$365 + 4 >> 2] = $364; + label = 66; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($33, 54854); + HEAP32[$$byval_copy30 >> 2] = HEAP32[$33 >> 2]; + HEAP32[$$byval_copy30 + 4 >> 2] = HEAP32[$33 + 4 >> 2]; + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy30) | 0)) { + $$1 = 0; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy30, 52761); + $370 = $$byval_copy30; + $375 = HEAP32[$370 + 4 >> 2] | 0; + $376 = $2; + HEAP32[$376 >> 2] = HEAP32[$370 >> 2]; + HEAP32[$376 + 4 >> 2] = $375; + label = 66; + } while (0); + if ((label | 0) == 66) { + $380 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $381 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($380) | 0; + HEAP32[$$byval_copy30 >> 2] = $381; + HEAP32[$34 >> 2] = 0; + $383 = $381; + L100 : do if (!$381) $$0 = 0; else { + switch ($36 << 24 >> 24) { + case 76: + case 82: + { + $384 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($380) | 0; + HEAP32[$34 >> 2] = $384; + if (!$384) { + $$0 = 0; + break L100; + } + if ($storemerge << 24 >> 24) { + HEAP32[$$byval_copy30 >> 2] = $384; + HEAP32[$34 >> 2] = $383; + } + break; + } + default: + {} + } + $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8FoldExprEJRbRNS_10StringViewERPNS0_4NodeESD_EEESC_DpOT0_($0, $1, $2, $$byval_copy30, $34) | 0; + } while (0); + $$1 = $$0; + } + $$2 = $$1; + } + $$3 = $$2; + } else $$3 = 0; + STACKTOP = sp; + return $$3 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($0) { + $0 = $0 | 0; + var $$033 = 0, $$10 = 0, $$131 = 0, $$942$ph = 0, $1 = 0, $117 = 0, $119 = 0, $123 = 0, $125 = 0, $127 = 0, $129 = 0, $131 = 0, $133 = 0, $136 = 0, $137 = 0, $138 = 0, $145 = 0, $147 = 0, $151 = 0, $153 = 0, $157 = 0, $159 = 0, $163 = 0, $165 = 0, $169 = 0, $17 = 0, $171 = 0, $175 = 0, $177 = 0, $179 = 0, $180 = 0, $187 = 0, $189 = 0, $19 = 0, $191 = 0, $193 = 0, $2 = 0, $3 = 0, $4 = 0, $6 = 0, $8 = 0, $spec$select = 0, $spec$select43 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $1 = sp + 16 | 0; + $2 = sp + 8 | 0; + $3 = sp; + HEAP32[$1 >> 2] = 0; + $4 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0; + L1 : do switch ($4 << 24 >> 24 | 0) { + case 75: + case 86: + case 114: + { + $6 = $4 << 24 >> 24 == 114; + $spec$select = $6 & 1; + $8 = (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, $spec$select) | 0) << 24 >> 24 == 86; + $$131 = $8 ? ($6 ? 2 : 1) : $spec$select; + $spec$select43 = $$131 + ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, $$131) | 0) << 24 >> 24 == 75 & 1) | 0; + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, $spec$select43) | 0) << 24 >> 24) { + case 70: + break; + case 68: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, $spec$select43 + 1 | 0) | 0) << 24 >> 24) { + case 120: + case 119: + case 79: + case 111: + break; + default: + { + label = 5; + break L1; + } + } + break; + } + default: + { + label = 5; + break L1; + } + } + $17 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseFunctionTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $17; + $193 = $17; + label = 81; + break; + } + case 85: + { + label = 5; + break; + } + case 118: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA5_KcEEEPNS0_4NodeEDpOT0_($0, 57068) | 0; + break; + } + case 119: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA8_KcEEEPNS0_4NodeEDpOT0_($0) | 0; + break; + } + case 98: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA5_KcEEEPNS0_4NodeEDpOT0_($0, 57073) | 0; + break; + } + case 99: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA5_KcEEEPNS0_4NodeEDpOT0_($0, 57078) | 0; + break; + } + case 97: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA12_KcEEEPNS0_4NodeEDpOT0_($0, 57083) | 0; + break; + } + case 104: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA14_KcEEEPNS0_4NodeEDpOT0_($0, 57095) | 0; + break; + } + case 115: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA6_KcEEEPNS0_4NodeEDpOT0_($0, 57109) | 0; + break; + } + case 116: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA15_KcEEEPNS0_4NodeEDpOT0_($0, 57115) | 0; + break; + } + case 105: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA4_KcEEEPNS0_4NodeEDpOT0_($0, 57130) | 0; + break; + } + case 106: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA13_KcEEEPNS0_4NodeEDpOT0_($0, 57134) | 0; + break; + } + case 108: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA5_KcEEEPNS0_4NodeEDpOT0_($0, 57147) | 0; + break; + } + case 109: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA14_KcEEEPNS0_4NodeEDpOT0_($0, 57152) | 0; + break; + } + case 120: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 51450) | 0; + break; + } + case 121: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA19_KcEEEPNS0_4NodeEDpOT0_($0) | 0; + break; + } + case 110: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA9_KcEEEPNS0_4NodeEDpOT0_($0, 51460) | 0; + break; + } + case 111: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA18_KcEEEPNS0_4NodeEDpOT0_($0, 51469) | 0; + break; + } + case 102: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA6_KcEEEPNS0_4NodeEDpOT0_($0, 57166) | 0; + break; + } + case 100: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA7_KcEEEPNS0_4NodeEDpOT0_($0) | 0; + break; + } + case 101: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA12_KcEEEPNS0_4NodeEDpOT0_($0, 51487) | 0; + break; + } + case 103: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 51499) | 0; + break; + } + case 122: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA4_KcEEEPNS0_4NodeEDpOT0_($0, 51510) | 0; + break; + } + case 117: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseBareSourceNameEv($2, $0); + if (__ZNK12_GLOBAL__N_110StringView5emptyEv($2) | 0) $$033 = 0; else $$033 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $2) | 0; + $$10 = $$033; + break; + } + case 68: + { + do switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 | 0) { + case 100: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 51514) | 0; + break L1; + break; + } + case 101: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 51524) | 0; + break L1; + break; + } + case 102: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 51535) | 0; + break L1; + break; + } + case 104: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 51545) | 0; + break L1; + break; + } + case 105: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA9_KcEEEPNS0_4NodeEDpOT0_($0, 51555) | 0; + break L1; + break; + } + case 115: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA9_KcEEEPNS0_4NodeEDpOT0_($0, 51564) | 0; + break L1; + break; + } + case 97: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA5_KcEEEPNS0_4NodeEDpOT0_($0, 51573) | 0; + break L1; + break; + } + case 99: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA15_KcEEEPNS0_4NodeEDpOT0_($0, 51578) | 0; + break L1; + break; + } + case 110: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA15_KcEEEPNS0_4NodeEDpOT0_($0, 51593) | 0; + break L1; + break; + } + case 84: + case 116: + { + $117 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseDecltypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $117; + $193 = $117; + label = 81; + break L1; + break; + } + case 118: + { + $119 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseVectorTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $119; + $193 = $119; + label = 81; + break L1; + break; + } + case 112: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $123 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$2 >> 2] = $123; + if (!$123) { + $$10 = 0; + break L1; + } else { + $125 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_22ParameterPackExpansionEJRPNS0_4NodeEEEES9_DpOT0_($0, $2) | 0; + HEAP32[$1 >> 2] = $125; + label = 82; + break L1; + } + break; + } + case 120: + case 119: + case 79: + case 111: + { + $127 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseFunctionTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $127; + $193 = $127; + label = 81; + break L1; + break; + } + default: + { + $$10 = 0; + break L1; + } + } while (0); + break; + } + case 70: + { + $129 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseFunctionTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $129; + $193 = $129; + label = 81; + break; + } + case 65: + { + $131 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E14parseArrayTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $131; + $193 = $131; + label = 81; + break; + } + case 77: + { + $133 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E24parsePointerToMemberTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $133; + $193 = $133; + label = 81; + break; + } + case 84: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24) { + case 101: + case 117: + case 115: + { + $136 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E18parseClassEnumTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $136; + $193 = $136; + label = 81; + break L1; + break; + } + default: + {} + } + $137 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $138 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E18parseTemplateParamEv($137) | 0; + HEAP32[$1 >> 2] = $138; + if ($138) if ((HEAP8[$0 + 360 >> 0] | 0) != 0 ? (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 == 73 : 0) { + $145 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseTemplateArgsEb($137, 0) | 0; + HEAP32[$2 >> 2] = $145; + if (!$145) { + $$10 = 0; + break L1; + } else { + $147 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20NameWithTemplateArgsEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $2) | 0; + HEAP32[$1 >> 2] = $147; + label = 82; + break L1; + } + } else label = 82; else $$10 = 0; + break; + } + case 80: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $151 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$2 >> 2] = $151; + if (!$151) { + $$10 = 0; + break L1; + } else { + $153 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11PointerTypeEJRPNS0_4NodeEEEES9_DpOT0_($0, $2) | 0; + HEAP32[$1 >> 2] = $153; + label = 82; + break L1; + } + break; + } + case 82: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $157 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$2 >> 2] = $157; + if (!$157) { + $$10 = 0; + break L1; + } else { + HEAP32[$3 >> 2] = 0; + $159 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13ReferenceTypeEJRPNS0_4NodeENS0_13ReferenceKindEEEES9_DpOT0_($0, $2, $3) | 0; + HEAP32[$1 >> 2] = $159; + label = 82; + break L1; + } + break; + } + case 79: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $163 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$2 >> 2] = $163; + if (!$163) { + $$10 = 0; + break L1; + } else { + HEAP32[$3 >> 2] = 1; + $165 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13ReferenceTypeEJRPNS0_4NodeENS0_13ReferenceKindEEEES9_DpOT0_($0, $2, $3) | 0; + HEAP32[$1 >> 2] = $165; + label = 82; + break L1; + } + break; + } + case 67: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $169 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$2 >> 2] = $169; + if (!$169) { + $$10 = 0; + break L1; + } else { + $171 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20PostfixQualifiedTypeEJRPNS0_4NodeERA9_KcEEES9_DpOT0_($0, $2) | 0; + HEAP32[$1 >> 2] = $171; + label = 82; + break L1; + } + break; + } + case 71: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $175 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$2 >> 2] = $175; + if (!$175) { + $$10 = 0; + break L1; + } else { + $177 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20PostfixQualifiedTypeEJRPNS0_4NodeERA11_KcEEES9_DpOT0_($0, $2) | 0; + HEAP32[$1 >> 2] = $177; + label = 82; + break L1; + } + break; + } + case 83: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24) { + case 116: + case 0: + { + label = 80; + break L1; + break; + } + default: + {} + } + $179 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $180 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseSubstitutionEv($179) | 0; + HEAP32[$2 >> 2] = $180; + if ($180) if ((HEAP8[$0 + 360 >> 0] | 0) != 0 ? (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 == 73 : 0) { + $187 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseTemplateArgsEb($179, 0) | 0; + HEAP32[$3 >> 2] = $187; + if (!$187) { + $$10 = 0; + break L1; + } else { + $189 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20NameWithTemplateArgsEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $2, $3) | 0; + HEAP32[$1 >> 2] = $189; + label = 82; + break L1; + } + } else $$942$ph = $180; else $$942$ph = 0; + $$10 = $$942$ph; + break; + } + default: + label = 80; + } while (0); + if ((label | 0) == 5) { + $19 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E18parseQualifiedTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $19; + $193 = $19; + label = 81; + } else if ((label | 0) == 80) { + $191 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E18parseClassEnumTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $191; + $193 = $191; + label = 81; + } + if ((label | 0) == 81) if (!$193) $$10 = 0; else label = 82; + if ((label | 0) == 82) { + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($0 + 148 | 0, $1); + $$10 = HEAP32[$1 >> 2] | 0; + } + STACKTOP = sp; + return $$10 | 0; +} + +function _vfscanf($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0266$lcssa = 0, $$0266407 = 0, $$0268 = 0, $$0270 = 0, $$0272 = 0, $$0273418 = 0, $$0276$ph$ph = 0, $$0280$ph = 0, $$0280$ph$ph = 0, $$0288409 = 0, $$0290414 = 0, $$0294 = 0, $$0295 = 0, $$0308412 = 0, $$10 = 0, $$10318 = 0, $$11 = 0, $$12 = 0, $$1267 = 0, $$1271 = 0, $$1274 = 0, $$1281 = 0, $$1291 = 0, $$1309 = 0, $$2 = 0, $$2275 = 0, $$2278$ph = 0, $$2282 = 0, $$2282$ph = 0, $$2292 = 0, $$2310$ph = 0, $$3$lcssa = 0, $$3283 = 0, $$3293 = 0, $$3406 = 0, $$4 = 0, $$4284 = 0, $$5 = 0, $$5313 = 0, $$6 = 0, $$6302 = 0, $$6314 = 0, $$7 = 0, $$7315 = 0, $$8 = 0, $$8316 = 0, $$9 = 0, $$9317 = 0, $$ph$ph = 0, $$pre$phi491Z2D = 0, $$pre$phiZ2D = 0, $$sroa$2$0$$sroa_idx13 = 0, $104 = 0, $105 = 0, $11 = 0, $114 = 0, $115 = 0, $120 = 0, $122 = 0, $125 = 0, $127 = 0, $13 = 0, $130 = 0, $133 = 0, $135 = 0, $138 = 0, $14 = 0, $145 = 0, $15 = 0, $151 = 0, $153 = 0, $16 = 0, $160 = 0, $161 = 0, $164 = 0, $166 = 0, $169 = 0, $17 = 0, $170 = 0, $171 = 0, $177 = 0, $18 = 0, $180 = 0, $184 = 0, $186 = 0, $19 = 0, $191 = 0, $194 = 0, $195 = 0, $196 = 0, $197 = 0, $199 = 0, $20 = 0, $204 = 0, $208 = 0, $213 = 0, $214 = 0, $215 = 0, $217 = 0, $219 = 0, $22 = 0, $220 = 0, $228 = 0, $240 = 0, $244 = 0, $246 = 0, $25 = 0, $254 = 0, $263 = 0, $266 = 0, $274 = 0, $281 = 0, $289 = 0, $296 = 0, $298 = 0, $3 = 0, $30 = 0, $305 = 0, $306 = 0, $309 = 0, $310 = 0, $321 = 0, $322 = 0, $323 = 0, $325 = 0, $328 = 0, $331 = 0, $334 = 0, $342 = 0.0, $343 = 0, $345 = 0, $348 = 0, $351 = 0, $354 = 0, $361 = 0, $369 = 0, $37 = 0, $372 = 0, $373 = 0, $374 = 0, $376 = 0, $384 = 0, $386 = 0, $387 = 0, $388 = 0, $389 = 0, $390 = 0, $391 = 0, $392 = 0, $393 = 0, $394 = 0, $395 = 0, $396 = 0, $4 = 0, $43 = 0, $45 = 0, $5 = 0, $52 = 0, $53 = 0, $56 = 0, $57 = 0, $58 = 0, $6 = 0, $60 = 0, $63 = 0, $64 = 0, $65 = 0, $67 = 0, $68 = 0, $78 = 0, $85 = 0, $spec$select = 0, $spec$select319 = 0, $trunc = 0, label = 0, sp = 0, $$2282$looptemp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 288 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(288); + $3 = sp + 264 | 0; + $4 = sp; + $5 = sp + 260 | 0; + $6 = sp + 272 | 0; + if ((HEAP32[$0 + 76 >> 2] | 0) > -1) $386 = ___lockfile($0) | 0; else $386 = 0; + $11 = HEAP8[$1 >> 0] | 0; + L4 : do if ($11 << 24 >> 24) { + $13 = $0 + 4 | 0; + $14 = $0 + 104 | 0; + $15 = $0 + 120 | 0; + $16 = $0 + 8 | 0; + $17 = $4 + 10 | 0; + $18 = $4 + 33 | 0; + $19 = $4 + 46 | 0; + $20 = $4 + 94 | 0; + $$sroa$2$0$$sroa_idx13 = $3 + 4 | 0; + $$0273418 = $1; + $$0290414 = 0; + $$0308412 = 0; + $22 = $11; + $387 = 0; + $56 = 0; + $57 = 0; + L6 : while (1) { + L8 : do if (!(_isspace($22 & 255) | 0)) { + $63 = (HEAP8[$$0273418 >> 0] | 0) == 37; + L10 : do if ($63) { + $64 = $$0273418 + 1 | 0; + $65 = HEAP8[$64 >> 0] | 0; + L12 : do switch ($65 << 24 >> 24) { + case 37: + { + break L10; + break; + } + case 42: + { + $$0295 = 0; + $$2275 = $$0273418 + 2 | 0; + break; + } + default: + { + if (_isdigit($65 & 255) | 0 ? (HEAP8[$$0273418 + 2 >> 0] | 0) == 36 : 0) { + $$0295 = _arg_n($2, (HEAPU8[$64 >> 0] | 0) + -48 | 0) | 0; + $$2275 = $$0273418 + 3 | 0; + break L12; + } + $104 = (HEAP32[$2 >> 2] | 0) + (4 - 1) & ~(4 - 1); + $105 = HEAP32[$104 >> 2] | 0; + HEAP32[$2 >> 2] = $104 + 4; + $$0295 = $105; + $$2275 = $64; + } + } while (0); + if (!(_isdigit(HEAPU8[$$2275 >> 0] | 0) | 0)) { + $$0266$lcssa = 0; + $$3$lcssa = $$2275; + } else { + $$0266407 = 0; + $$3406 = $$2275; + while (1) { + $114 = ($$0266407 * 10 | 0) + -48 + (HEAPU8[$$3406 >> 0] | 0) | 0; + $115 = $$3406 + 1 | 0; + if (!(_isdigit(HEAPU8[$115 >> 0] | 0) | 0)) { + $$0266$lcssa = $114; + $$3$lcssa = $115; + break; + } else { + $$0266407 = $114; + $$3406 = $115; + } + } + } + $120 = HEAP8[$$3$lcssa >> 0] | 0; + $122 = $$3$lcssa + 1 | 0; + if ($120 << 24 >> 24 == 109) { + $$0270 = ($$0295 | 0) != 0 & 1; + $$1309 = 0; + $$4 = $122; + $$pre$phiZ2D = $$3$lcssa + 2 | 0; + $125 = HEAP8[$122 >> 0] | 0; + $392 = 0; + } else { + $$0270 = 0; + $$1309 = $$0308412; + $$4 = $$3$lcssa; + $$pre$phiZ2D = $122; + $125 = $120; + $392 = $387; + } + switch ($125 << 24 >> 24) { + case 104: + { + $127 = (HEAP8[$$pre$phiZ2D >> 0] | 0) == 104; + $$0268 = $127 ? -2 : -1; + $$5 = $127 ? $$4 + 2 | 0 : $$pre$phiZ2D; + break; + } + case 108: + { + $130 = (HEAP8[$$pre$phiZ2D >> 0] | 0) == 108; + $$0268 = $130 ? 3 : 1; + $$5 = $130 ? $$4 + 2 | 0 : $$pre$phiZ2D; + break; + } + case 106: + { + $$0268 = 3; + $$5 = $$pre$phiZ2D; + break; + } + case 116: + case 122: + { + $$0268 = 1; + $$5 = $$pre$phiZ2D; + break; + } + case 76: + { + $$0268 = 2; + $$5 = $$pre$phiZ2D; + break; + } + case 110: + case 112: + case 67: + case 83: + case 91: + case 99: + case 115: + case 88: + case 71: + case 70: + case 69: + case 65: + case 103: + case 102: + case 101: + case 97: + case 120: + case 117: + case 111: + case 105: + case 100: + { + $$0268 = 0; + $$5 = $$4; + break; + } + default: + { + $$8316 = $$1309; + $393 = $392; + label = 143; + break L6; + } + } + $133 = HEAPU8[$$5 >> 0] | 0; + $135 = ($133 & 47 | 0) == 3; + $spec$select = $135 ? $133 | 32 : $133; + $spec$select319 = $135 ? 1 : $$0268; + $trunc = $spec$select & 255; + switch ($trunc << 24 >> 24) { + case 99: + { + $$1267 = ($$0266$lcssa | 0) > 1 ? $$0266$lcssa : 1; + $372 = $56; + $373 = $57; + break; + } + case 91: + { + $$1267 = $$0266$lcssa; + $372 = $56; + $373 = $57; + break; + } + case 110: + { + _store_int($$0295, $spec$select319, $56, $57); + $$12 = $$5; + $$1291 = $$0290414; + $$7315 = $$1309; + $388 = $392; + $389 = $56; + $390 = $57; + break L8; + break; + } + default: + { + ___shlim($0, 0, 0); + do { + $138 = HEAP32[$13 >> 2] | 0; + if ($138 >>> 0 < (HEAP32[$14 >> 2] | 0) >>> 0) { + HEAP32[$13 >> 2] = $138 + 1; + $145 = HEAPU8[$138 >> 0] | 0; + } else $145 = ___shgetc($0) | 0; + } while ((_isspace($145) | 0) != 0); + if (!(HEAP32[$14 >> 2] | 0)) $161 = HEAP32[$13 >> 2] | 0; else { + $151 = (HEAP32[$13 >> 2] | 0) + -1 | 0; + HEAP32[$13 >> 2] = $151; + $161 = $151; + } + $153 = $15; + $160 = $161 - (HEAP32[$16 >> 2] | 0) | 0; + $164 = _i64Add(HEAP32[$153 >> 2] | 0, HEAP32[$153 + 4 >> 2] | 0, $56 | 0, $57 | 0) | 0; + $166 = _i64Add($164 | 0, getTempRet0() | 0, $160 | 0, (($160 | 0) < 0) << 31 >> 31 | 0) | 0; + $$1267 = $$0266$lcssa; + $372 = $166; + $373 = getTempRet0() | 0; + } + } + $169 = (($$1267 | 0) < 0) << 31 >> 31; + ___shlim($0, $$1267, $169); + $170 = HEAP32[$13 >> 2] | 0; + $171 = HEAP32[$14 >> 2] | 0; + if ($170 >>> 0 < $171 >>> 0) { + HEAP32[$13 >> 2] = $170 + 1; + $177 = $171; + } else { + if ((___shgetc($0) | 0) < 0) { + $$8316 = $$1309; + $393 = $392; + label = 143; + break L6; + } + $177 = HEAP32[$14 >> 2] | 0; + } + if ($177 | 0) HEAP32[$13 >> 2] = (HEAP32[$13 >> 2] | 0) + -1; + L59 : do switch ($trunc << 24 >> 24) { + case 91: + case 99: + case 115: + { + $180 = ($spec$select | 0) == 99; + L61 : do if (($spec$select | 16 | 0) == 115) { + _memset($4 | 0, -1, 257) | 0; + HEAP8[$4 >> 0] = 0; + if (($spec$select | 0) == 115) { + HEAP8[$18 >> 0] = 0; + HEAP16[$17 >> 1] = 0; + HEAP16[$17 + 2 >> 1] = 0; + HEAP8[$17 + 4 >> 0] = 0; + $$10 = $$5; + } else $$10 = $$5; + } else { + $184 = $$5 + 1 | 0; + $186 = (HEAP8[$184 >> 0] | 0) == 94; + $$0294 = $186 & 1; + $$6 = $186 ? $$5 + 2 | 0 : $184; + _memset($4 | 0, $$0294 | 0, 257) | 0; + HEAP8[$4 >> 0] = 0; + switch (HEAP8[$$6 >> 0] | 0) { + case 45: + { + $191 = ($$0294 ^ 1) & 255; + HEAP8[$19 >> 0] = $191; + $$7 = $$6 + 1 | 0; + $$pre$phi491Z2D = $191; + break; + } + case 93: + { + $194 = ($$0294 ^ 1) & 255; + HEAP8[$20 >> 0] = $194; + $$7 = $$6 + 1 | 0; + $$pre$phi491Z2D = $194; + break; + } + default: + { + $$7 = $$6; + $$pre$phi491Z2D = ($$0294 ^ 1) & 255; + } + } + $$8 = $$7; + while (1) { + $195 = HEAP8[$$8 >> 0] | 0; + L72 : do switch ($195 << 24 >> 24) { + case 0: + { + $$8316 = $$1309; + $393 = $392; + label = 143; + break L6; + break; + } + case 93: + { + $$10 = $$8; + break L61; + break; + } + case 45: + { + $196 = $$8 + 1 | 0; + $197 = HEAP8[$196 >> 0] | 0; + switch ($197 << 24 >> 24) { + case 93: + case 0: + { + $$9 = $$8; + $208 = 45; + break L72; + break; + } + default: + {} + } + $199 = HEAP8[$$8 + -1 >> 0] | 0; + if (($199 & 255) < ($197 & 255)) { + $$0288409 = $199 & 255; + do { + $$0288409 = $$0288409 + 1 | 0; + HEAP8[$4 + $$0288409 >> 0] = $$pre$phi491Z2D; + $204 = HEAP8[$196 >> 0] | 0; + } while ($$0288409 >>> 0 < ($204 & 255) >>> 0); + $$9 = $196; + $208 = $204; + } else { + $$9 = $196; + $208 = $197; + } + break; + } + default: + { + $$9 = $$8; + $208 = $195; + } + } while (0); + HEAP8[$4 + (($208 & 255) + 1) >> 0] = $$pre$phi491Z2D; + $$8 = $$9 + 1 | 0; + } + } while (0); + $213 = $180 ? $$1267 + 1 | 0 : 31; + $214 = ($spec$select319 | 0) == 1; + $215 = ($$0270 | 0) != 0; + L80 : do if ($214) { + if ($215) { + $217 = _malloc($213 << 2) | 0; + if (!$217) { + $$8316 = 0; + $393 = 0; + label = 143; + break L6; + } else $395 = $217; + } else $395 = $$0295; + HEAP32[$3 >> 2] = 0; + HEAP32[$$sroa$2$0$$sroa_idx13 >> 2] = 0; + $$0276$ph$ph = $213; + $$0280$ph$ph = 0; + $$ph$ph = $395; + L85 : while (1) { + $219 = ($$ph$ph | 0) == 0; + $$0280$ph = $$0280$ph$ph; + while (1) { + L89 : while (1) { + $220 = HEAP32[$13 >> 2] | 0; + if ($220 >>> 0 < (HEAP32[$14 >> 2] | 0) >>> 0) { + HEAP32[$13 >> 2] = $220 + 1; + $228 = HEAPU8[$220 >> 0] | 0; + } else $228 = ___shgetc($0) | 0; + if (!(HEAP8[$4 + ($228 + 1) >> 0] | 0)) break L85; + HEAP8[$6 >> 0] = $228; + switch (_mbrtowc($5, $6, 1, $3) | 0) { + case -1: + { + $$8316 = 0; + $393 = $$ph$ph; + label = 143; + break L6; + break; + } + case -2: + break; + default: + break L89; + } + } + if ($219) $$1281 = $$0280$ph; else { + HEAP32[$$ph$ph + ($$0280$ph << 2) >> 2] = HEAP32[$5 >> 2]; + $$1281 = $$0280$ph + 1 | 0; + } + if ($215 & ($$1281 | 0) == ($$0276$ph$ph | 0)) break; else $$0280$ph = $$1281; + } + $$0276$ph$ph = $$0276$ph$ph << 1 | 1; + $240 = _realloc($$ph$ph, $$0276$ph$ph << 2) | 0; + if (!$240) { + $$8316 = 0; + $393 = $$ph$ph; + label = 143; + break L6; + } else { + $$0280$ph$ph = $$1281; + $$ph$ph = $240; + } + } + if (!(_mbsinit($3) | 0)) { + $$8316 = 0; + $393 = $$ph$ph; + label = 143; + break L6; + } else { + $$4284 = $$0280$ph; + $$5313 = 0; + $$6302 = $$ph$ph; + $396 = $$ph$ph; + } + } else { + if ($215) { + $244 = _malloc($213) | 0; + if (!$244) { + $$8316 = 0; + $393 = 0; + label = 143; + break L6; + } + $$2278$ph = $213; + $$2282$ph = 0; + $$2310$ph = $244; + while (1) { + $$2282 = $$2282$ph; + do { + $246 = HEAP32[$13 >> 2] | 0; + if ($246 >>> 0 < (HEAP32[$14 >> 2] | 0) >>> 0) { + HEAP32[$13 >> 2] = $246 + 1; + $254 = HEAPU8[$246 >> 0] | 0; + } else $254 = ___shgetc($0) | 0; + if (!(HEAP8[$4 + ($254 + 1) >> 0] | 0)) { + $$4284 = $$2282; + $$5313 = $$2310$ph; + $$6302 = 0; + $396 = 0; + break L80; + } + $$2282$looptemp = $$2282; + $$2282 = $$2282 + 1 | 0; + HEAP8[$$2310$ph + $$2282$looptemp >> 0] = $254; + } while (($$2282 | 0) != ($$2278$ph | 0)); + $$2278$ph = $$2278$ph << 1 | 1; + $263 = _realloc($$2310$ph, $$2278$ph) | 0; + if (!$263) { + $$8316 = $$2310$ph; + $393 = 0; + label = 143; + break L6; + } else { + $$2282$ph = $$2282; + $$2310$ph = $263; + } + } + } + if (!$$0295) while (1) { + $281 = HEAP32[$13 >> 2] | 0; + if ($281 >>> 0 < (HEAP32[$14 >> 2] | 0) >>> 0) { + HEAP32[$13 >> 2] = $281 + 1; + $289 = HEAPU8[$281 >> 0] | 0; + } else $289 = ___shgetc($0) | 0; + if (!(HEAP8[$4 + ($289 + 1) >> 0] | 0)) { + $$4284 = 0; + $$5313 = 0; + $$6302 = 0; + $396 = 0; + break L80; + } + } + $$3283 = 0; + while (1) { + $266 = HEAP32[$13 >> 2] | 0; + if ($266 >>> 0 < (HEAP32[$14 >> 2] | 0) >>> 0) { + HEAP32[$13 >> 2] = $266 + 1; + $274 = HEAPU8[$266 >> 0] | 0; + } else $274 = ___shgetc($0) | 0; + if (!(HEAP8[$4 + ($274 + 1) >> 0] | 0)) { + $$4284 = $$3283; + $$5313 = $$0295; + $$6302 = 0; + $396 = 0; + break L80; + } + HEAP8[$$0295 + $$3283 >> 0] = $274; + $$3283 = $$3283 + 1 | 0; + } + } while (0); + if (!(HEAP32[$14 >> 2] | 0)) $306 = HEAP32[$13 >> 2] | 0; else { + $296 = (HEAP32[$13 >> 2] | 0) + -1 | 0; + HEAP32[$13 >> 2] = $296; + $306 = $296; + } + $298 = $15; + $305 = $306 - (HEAP32[$16 >> 2] | 0) | 0; + $309 = _i64Add(HEAP32[$298 >> 2] | 0, HEAP32[$298 + 4 >> 2] | 0, $305 | 0, (($305 | 0) < 0) << 31 >> 31 | 0) | 0; + $310 = getTempRet0() | 0; + if (($309 | 0) == 0 & ($310 | 0) == 0) { + $$10318 = $$5313; + $$2 = $$0270; + $$2292 = $$0290414; + $384 = $396; + break L6; + } + if (!(($309 | 0) == ($$1267 | 0) & ($310 | 0) == ($169 | 0) | $180 ^ 1)) { + $$10318 = $$5313; + $$2 = $$0270; + $$2292 = $$0290414; + $384 = $396; + break L6; + } + do if ($215) if ($214) { + HEAP32[$$0295 >> 2] = $$6302; + break; + } else { + HEAP32[$$0295 >> 2] = $$5313; + break; + } while (0); + if ($180) { + $$11 = $$10; + $$6314 = $$5313; + $394 = $396; + } else { + if ($$6302 | 0) HEAP32[$$6302 + ($$4284 << 2) >> 2] = 0; + if (!$$5313) { + $$11 = $$10; + $$6314 = 0; + $394 = $396; + break L59; + } + HEAP8[$$5313 + $$4284 >> 0] = 0; + $$11 = $$10; + $$6314 = $$5313; + $394 = $396; + } + break; + } + case 120: + case 88: + case 112: + { + $$0272 = 16; + label = 131; + break; + } + case 111: + { + $$0272 = 8; + label = 131; + break; + } + case 117: + case 100: + { + $$0272 = 10; + label = 131; + break; + } + case 105: + { + $$0272 = 0; + label = 131; + break; + } + case 71: + case 103: + case 70: + case 102: + case 69: + case 101: + case 65: + case 97: + { + $342 = +___floatscan($0, $spec$select319, 0); + $343 = $15; + $345 = HEAP32[$343 >> 2] | 0; + $348 = HEAP32[$343 + 4 >> 2] | 0; + $351 = (HEAP32[$13 >> 2] | 0) - (HEAP32[$16 >> 2] | 0) | 0; + $354 = _i64Subtract(0, 0, $351 | 0, (($351 | 0) < 0) << 31 >> 31 | 0) | 0; + if (($345 | 0) == ($354 | 0) & ($348 | 0) == (getTempRet0() | 0)) { + $$10318 = $$1309; + $$2 = $$0270; + $$2292 = $$0290414; + $384 = $392; + break L6; + } + if (!$$0295) { + $$11 = $$5; + $$6314 = $$1309; + $394 = $392; + } else switch ($spec$select319 | 0) { + case 0: + { + HEAPF32[$$0295 >> 2] = $342; + $$11 = $$5; + $$6314 = $$1309; + $394 = $392; + break L59; + break; + } + case 1: + { + HEAPF64[$$0295 >> 3] = $342; + $$11 = $$5; + $$6314 = $$1309; + $394 = $392; + break L59; + break; + } + case 2: + { + HEAPF64[$$0295 >> 3] = $342; + $$11 = $$5; + $$6314 = $$1309; + $394 = $392; + break L59; + break; + } + default: + { + $$11 = $$5; + $$6314 = $$1309; + $394 = $392; + break L59; + } + } + break; + } + default: + { + $$11 = $$5; + $$6314 = $$1309; + $394 = $392; + } + } while (0); + do if ((label | 0) == 131) { + label = 0; + $321 = ___intscan($0, $$0272, 0, -1, -1) | 0; + $322 = getTempRet0() | 0; + $323 = $15; + $325 = HEAP32[$323 >> 2] | 0; + $328 = HEAP32[$323 + 4 >> 2] | 0; + $331 = (HEAP32[$13 >> 2] | 0) - (HEAP32[$16 >> 2] | 0) | 0; + $334 = _i64Subtract(0, 0, $331 | 0, (($331 | 0) < 0) << 31 >> 31 | 0) | 0; + if (($325 | 0) == ($334 | 0) & ($328 | 0) == (getTempRet0() | 0)) { + $$10318 = $$1309; + $$2 = $$0270; + $$2292 = $$0290414; + $384 = $392; + break L6; + } + if (($$0295 | 0) != 0 & ($spec$select | 0) == 112) { + HEAP32[$$0295 >> 2] = $321; + $$11 = $$5; + $$6314 = $$1309; + $394 = $392; + break; + } else { + _store_int($$0295, $spec$select319, $321, $322); + $$11 = $$5; + $$6314 = $$1309; + $394 = $392; + break; + } + } while (0); + $361 = $15; + $369 = (HEAP32[$13 >> 2] | 0) - (HEAP32[$16 >> 2] | 0) | 0; + $374 = _i64Add(HEAP32[$361 >> 2] | 0, HEAP32[$361 + 4 >> 2] | 0, $372 | 0, $373 | 0) | 0; + $376 = _i64Add($374 | 0, getTempRet0() | 0, $369 | 0, (($369 | 0) < 0) << 31 >> 31 | 0) | 0; + $$12 = $$11; + $$1291 = $$0290414 + (($$0295 | 0) != 0 & 1) | 0; + $$7315 = $$6314; + $388 = $394; + $389 = $376; + $390 = getTempRet0() | 0; + break L8; + } while (0); + $67 = $$0273418 + ($63 & 1) | 0; + ___shlim($0, 0, 0); + $68 = HEAP32[$13 >> 2] | 0; + if ($68 >>> 0 < (HEAP32[$14 >> 2] | 0) >>> 0) { + HEAP32[$13 >> 2] = $68 + 1; + $78 = HEAPU8[$68 >> 0] | 0; + } else $78 = ___shgetc($0) | 0; + if (($78 | 0) != (HEAPU8[$67 >> 0] | 0)) { + label = 23; + break L6; + } + $85 = _i64Add($56 | 0, $57 | 0, 1, 0) | 0; + $$12 = $67; + $$1291 = $$0290414; + $$7315 = $$0308412; + $388 = $387; + $389 = $85; + $390 = getTempRet0() | 0; + } else { + $$1274 = $$0273418; + while (1) { + $25 = $$1274 + 1 | 0; + if (!(_isspace(HEAPU8[$25 >> 0] | 0) | 0)) break; else $$1274 = $25; + } + ___shlim($0, 0, 0); + do { + $30 = HEAP32[$13 >> 2] | 0; + if ($30 >>> 0 < (HEAP32[$14 >> 2] | 0) >>> 0) { + HEAP32[$13 >> 2] = $30 + 1; + $37 = HEAPU8[$30 >> 0] | 0; + } else $37 = ___shgetc($0) | 0; + } while ((_isspace($37) | 0) != 0); + if (!(HEAP32[$14 >> 2] | 0)) $53 = HEAP32[$13 >> 2] | 0; else { + $43 = (HEAP32[$13 >> 2] | 0) + -1 | 0; + HEAP32[$13 >> 2] = $43; + $53 = $43; + } + $45 = $15; + $52 = $53 - (HEAP32[$16 >> 2] | 0) | 0; + $58 = _i64Add(HEAP32[$45 >> 2] | 0, HEAP32[$45 + 4 >> 2] | 0, $56 | 0, $57 | 0) | 0; + $60 = _i64Add($58 | 0, getTempRet0() | 0, $52 | 0, (($52 | 0) < 0) << 31 >> 31 | 0) | 0; + $$12 = $$1274; + $$1291 = $$0290414; + $$7315 = $$0308412; + $388 = $387; + $389 = $60; + $390 = getTempRet0() | 0; + } while (0); + $$0273418 = $$12 + 1 | 0; + $22 = HEAP8[$$0273418 >> 0] | 0; + if (!($22 << 24 >> 24)) { + $$3293 = $$1291; + break L4; + } else { + $$0290414 = $$1291; + $$0308412 = $$7315; + $387 = $388; + $56 = $389; + $57 = $390; + } + } + if ((label | 0) == 23) { + if (HEAP32[$14 >> 2] | 0) HEAP32[$13 >> 2] = (HEAP32[$13 >> 2] | 0) + -1; + if (($$0290414 | 0) != 0 | ($78 | 0) > -1) { + $$3293 = $$0290414; + break; + } else { + $$1271 = 0; + $$9317 = $$0308412; + $391 = $387; + label = 144; + } + } else if ((label | 0) == 143) if (!$$0290414) { + $$1271 = $$0270; + $$9317 = $$8316; + $391 = $393; + label = 144; + } else { + $$10318 = $$8316; + $$2 = $$0270; + $$2292 = $$0290414; + $384 = $393; + } + if ((label | 0) == 144) { + $$10318 = $$9317; + $$2 = $$1271; + $$2292 = -1; + $384 = $391; + } + if (!$$2) $$3293 = $$2292; else { + _free($$10318); + _free($384); + $$3293 = $$2292; + } + } else $$3293 = 0; while (0); + if ($386 | 0) ___unlockfile($0); + STACKTOP = sp; + return $$3293 | 0; +} + +function __ZNSt3__212__next_primeEm($0) { + $0 = $0 | 0; + var $$0 = 0, $$0328 = 0, $$0334 = 0, $$0337 = 0, $$1 = 0, $$2332 = 0, $$4 = 0, $$5 = 0, $$6 = 0, $$8 = 0, $$sink369 = 0, $1 = 0, $100 = 0, $104 = 0, $105 = 0, $109 = 0, $110 = 0, $114 = 0, $115 = 0, $119 = 0, $120 = 0, $124 = 0, $125 = 0, $129 = 0, $130 = 0, $134 = 0, $135 = 0, $139 = 0, $140 = 0, $144 = 0, $145 = 0, $149 = 0, $150 = 0, $154 = 0, $155 = 0, $159 = 0, $16 = 0, $160 = 0, $164 = 0, $165 = 0, $169 = 0, $170 = 0, $174 = 0, $175 = 0, $179 = 0, $180 = 0, $184 = 0, $185 = 0, $189 = 0, $19 = 0, $190 = 0, $194 = 0, $195 = 0, $199 = 0, $2 = 0, $20 = 0, $200 = 0, $204 = 0, $205 = 0, $209 = 0, $210 = 0, $214 = 0, $215 = 0, $219 = 0, $220 = 0, $224 = 0, $225 = 0, $229 = 0, $230 = 0, $234 = 0, $235 = 0, $239 = 0, $240 = 0, $244 = 0, $245 = 0, $249 = 0, $25 = 0, $250 = 0, $254 = 0, $255 = 0, $259 = 0, $260 = 0, $261 = 0, $263 = 0, $266 = 0, $267 = 0, $29 = 0, $3 = 0, $30 = 0, $34 = 0, $35 = 0, $39 = 0, $40 = 0, $44 = 0, $45 = 0, $49 = 0, $5 = 0, $50 = 0, $54 = 0, $55 = 0, $59 = 0, $60 = 0, $64 = 0, $65 = 0, $69 = 0, $7 = 0, $70 = 0, $74 = 0, $75 = 0, $79 = 0, $8 = 0, $80 = 0, $84 = 0, $85 = 0, $89 = 0, $90 = 0, $94 = 0, $95 = 0, $99 = 0, $spec$select = 0, $spec$select339$sink = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + $2 = sp + 8 | 0; + $3 = sp + 4 | 0; + HEAP32[$2 >> 2] = $0; + do if ($0 >>> 0 >= 212) { + $7 = ($0 >>> 0) / 210 | 0; + $8 = $7 * 210 | 0; + HEAP32[$3 >> 2] = $0 - $8; + $$0328 = 0; + $$0337 = $7; + $$sink369 = $8; + $spec$select339$sink = (__ZNSt3__213__lower_boundIRNS_6__lessIjmEEPKjmEET0_S6_S6_RKT1_T_(12736, 12928, $3, $1) | 0) - 12736 >> 2; + L4 : while (1) { + $16 = (HEAP32[12736 + ($spec$select339$sink << 2) >> 2] | 0) + $$sink369 | 0; + $$0334 = 5; + while (1) { + if ($$0334 >>> 0 >= 47) { + label = 6; + break; + } + $19 = HEAP32[12544 + ($$0334 << 2) >> 2] | 0; + $20 = ($16 >>> 0) / ($19 >>> 0) | 0; + if ($20 >>> 0 < $19 >>> 0) { + label = 107; + break L4; + } + if (($16 | 0) == (Math_imul($20, $19) | 0)) { + $$6 = $$0328; + break; + } else $$0334 = $$0334 + 1 | 0; + } + L10 : do if ((label | 0) == 6) { + label = 0; + $$0 = 211; + $$4 = $$0328; + L12 : while (1) { + $25 = ($16 >>> 0) / ($$0 >>> 0) | 0; + do if ($25 >>> 0 >= $$0 >>> 0) if (($16 | 0) != (Math_imul($25, $$0) | 0)) { + $29 = $$0 + 10 | 0; + $30 = ($16 >>> 0) / ($29 >>> 0) | 0; + if ($30 >>> 0 >= $29 >>> 0) if (($16 | 0) != (Math_imul($30, $29) | 0)) { + $34 = $$0 + 12 | 0; + $35 = ($16 >>> 0) / ($34 >>> 0) | 0; + if ($35 >>> 0 >= $34 >>> 0) if (($16 | 0) != (Math_imul($35, $34) | 0)) { + $39 = $$0 + 16 | 0; + $40 = ($16 >>> 0) / ($39 >>> 0) | 0; + if ($40 >>> 0 >= $39 >>> 0) if (($16 | 0) != (Math_imul($40, $39) | 0)) { + $44 = $$0 + 18 | 0; + $45 = ($16 >>> 0) / ($44 >>> 0) | 0; + if ($45 >>> 0 >= $44 >>> 0) if (($16 | 0) != (Math_imul($45, $44) | 0)) { + $49 = $$0 + 22 | 0; + $50 = ($16 >>> 0) / ($49 >>> 0) | 0; + if ($50 >>> 0 >= $49 >>> 0) if (($16 | 0) != (Math_imul($50, $49) | 0)) { + $54 = $$0 + 28 | 0; + $55 = ($16 >>> 0) / ($54 >>> 0) | 0; + if ($55 >>> 0 >= $54 >>> 0) if (($16 | 0) == (Math_imul($55, $54) | 0)) { + $$1 = $54; + $$2332 = 9; + $$5 = $$4; + } else { + $59 = $$0 + 30 | 0; + $60 = ($16 >>> 0) / ($59 >>> 0) | 0; + if ($60 >>> 0 < $59 >>> 0) { + $$1 = $59; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($60, $59) | 0)) { + $$1 = $59; + $$2332 = 9; + $$5 = $$4; + break; + } + $64 = $$0 + 36 | 0; + $65 = ($16 >>> 0) / ($64 >>> 0) | 0; + if ($65 >>> 0 < $64 >>> 0) { + $$1 = $64; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($65, $64) | 0)) { + $$1 = $64; + $$2332 = 9; + $$5 = $$4; + break; + } + $69 = $$0 + 40 | 0; + $70 = ($16 >>> 0) / ($69 >>> 0) | 0; + if ($70 >>> 0 < $69 >>> 0) { + $$1 = $69; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($70, $69) | 0)) { + $$1 = $69; + $$2332 = 9; + $$5 = $$4; + break; + } + $74 = $$0 + 42 | 0; + $75 = ($16 >>> 0) / ($74 >>> 0) | 0; + if ($75 >>> 0 < $74 >>> 0) { + $$1 = $74; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($75, $74) | 0)) { + $$1 = $74; + $$2332 = 9; + $$5 = $$4; + break; + } + $79 = $$0 + 46 | 0; + $80 = ($16 >>> 0) / ($79 >>> 0) | 0; + if ($80 >>> 0 < $79 >>> 0) { + $$1 = $79; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($80, $79) | 0)) { + $$1 = $79; + $$2332 = 9; + $$5 = $$4; + break; + } + $84 = $$0 + 52 | 0; + $85 = ($16 >>> 0) / ($84 >>> 0) | 0; + if ($85 >>> 0 < $84 >>> 0) { + $$1 = $84; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($85, $84) | 0)) { + $$1 = $84; + $$2332 = 9; + $$5 = $$4; + break; + } + $89 = $$0 + 58 | 0; + $90 = ($16 >>> 0) / ($89 >>> 0) | 0; + if ($90 >>> 0 < $89 >>> 0) { + $$1 = $89; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($90, $89) | 0)) { + $$1 = $89; + $$2332 = 9; + $$5 = $$4; + break; + } + $94 = $$0 + 60 | 0; + $95 = ($16 >>> 0) / ($94 >>> 0) | 0; + if ($95 >>> 0 < $94 >>> 0) { + $$1 = $94; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($95, $94) | 0)) { + $$1 = $94; + $$2332 = 9; + $$5 = $$4; + break; + } + $99 = $$0 + 66 | 0; + $100 = ($16 >>> 0) / ($99 >>> 0) | 0; + if ($100 >>> 0 < $99 >>> 0) { + $$1 = $99; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($100, $99) | 0)) { + $$1 = $99; + $$2332 = 9; + $$5 = $$4; + break; + } + $104 = $$0 + 70 | 0; + $105 = ($16 >>> 0) / ($104 >>> 0) | 0; + if ($105 >>> 0 < $104 >>> 0) { + $$1 = $104; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($105, $104) | 0)) { + $$1 = $104; + $$2332 = 9; + $$5 = $$4; + break; + } + $109 = $$0 + 72 | 0; + $110 = ($16 >>> 0) / ($109 >>> 0) | 0; + if ($110 >>> 0 < $109 >>> 0) { + $$1 = $109; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($110, $109) | 0)) { + $$1 = $109; + $$2332 = 9; + $$5 = $$4; + break; + } + $114 = $$0 + 78 | 0; + $115 = ($16 >>> 0) / ($114 >>> 0) | 0; + if ($115 >>> 0 < $114 >>> 0) { + $$1 = $114; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($115, $114) | 0)) { + $$1 = $114; + $$2332 = 9; + $$5 = $$4; + break; + } + $119 = $$0 + 82 | 0; + $120 = ($16 >>> 0) / ($119 >>> 0) | 0; + if ($120 >>> 0 < $119 >>> 0) { + $$1 = $119; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($120, $119) | 0)) { + $$1 = $119; + $$2332 = 9; + $$5 = $$4; + break; + } + $124 = $$0 + 88 | 0; + $125 = ($16 >>> 0) / ($124 >>> 0) | 0; + if ($125 >>> 0 < $124 >>> 0) { + $$1 = $124; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($125, $124) | 0)) { + $$1 = $124; + $$2332 = 9; + $$5 = $$4; + break; + } + $129 = $$0 + 96 | 0; + $130 = ($16 >>> 0) / ($129 >>> 0) | 0; + if ($130 >>> 0 < $129 >>> 0) { + $$1 = $129; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($130, $129) | 0)) { + $$1 = $129; + $$2332 = 9; + $$5 = $$4; + break; + } + $134 = $$0 + 100 | 0; + $135 = ($16 >>> 0) / ($134 >>> 0) | 0; + if ($135 >>> 0 < $134 >>> 0) { + $$1 = $134; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($135, $134) | 0)) { + $$1 = $134; + $$2332 = 9; + $$5 = $$4; + break; + } + $139 = $$0 + 102 | 0; + $140 = ($16 >>> 0) / ($139 >>> 0) | 0; + if ($140 >>> 0 < $139 >>> 0) { + $$1 = $139; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($140, $139) | 0)) { + $$1 = $139; + $$2332 = 9; + $$5 = $$4; + break; + } + $144 = $$0 + 106 | 0; + $145 = ($16 >>> 0) / ($144 >>> 0) | 0; + if ($145 >>> 0 < $144 >>> 0) { + $$1 = $144; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($145, $144) | 0)) { + $$1 = $144; + $$2332 = 9; + $$5 = $$4; + break; + } + $149 = $$0 + 108 | 0; + $150 = ($16 >>> 0) / ($149 >>> 0) | 0; + if ($150 >>> 0 < $149 >>> 0) { + $$1 = $149; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($150, $149) | 0)) { + $$1 = $149; + $$2332 = 9; + $$5 = $$4; + break; + } + $154 = $$0 + 112 | 0; + $155 = ($16 >>> 0) / ($154 >>> 0) | 0; + if ($155 >>> 0 < $154 >>> 0) { + $$1 = $154; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($155, $154) | 0)) { + $$1 = $154; + $$2332 = 9; + $$5 = $$4; + break; + } + $159 = $$0 + 120 | 0; + $160 = ($16 >>> 0) / ($159 >>> 0) | 0; + if ($160 >>> 0 < $159 >>> 0) { + $$1 = $159; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($160, $159) | 0)) { + $$1 = $159; + $$2332 = 9; + $$5 = $$4; + break; + } + $164 = $$0 + 126 | 0; + $165 = ($16 >>> 0) / ($164 >>> 0) | 0; + if ($165 >>> 0 < $164 >>> 0) { + $$1 = $164; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($165, $164) | 0)) { + $$1 = $164; + $$2332 = 9; + $$5 = $$4; + break; + } + $169 = $$0 + 130 | 0; + $170 = ($16 >>> 0) / ($169 >>> 0) | 0; + if ($170 >>> 0 < $169 >>> 0) { + $$1 = $169; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($170, $169) | 0)) { + $$1 = $169; + $$2332 = 9; + $$5 = $$4; + break; + } + $174 = $$0 + 136 | 0; + $175 = ($16 >>> 0) / ($174 >>> 0) | 0; + if ($175 >>> 0 < $174 >>> 0) { + $$1 = $174; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($175, $174) | 0)) { + $$1 = $174; + $$2332 = 9; + $$5 = $$4; + break; + } + $179 = $$0 + 138 | 0; + $180 = ($16 >>> 0) / ($179 >>> 0) | 0; + if ($180 >>> 0 < $179 >>> 0) { + $$1 = $179; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($180, $179) | 0)) { + $$1 = $179; + $$2332 = 9; + $$5 = $$4; + break; + } + $184 = $$0 + 142 | 0; + $185 = ($16 >>> 0) / ($184 >>> 0) | 0; + if ($185 >>> 0 < $184 >>> 0) { + $$1 = $184; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($185, $184) | 0)) { + $$1 = $184; + $$2332 = 9; + $$5 = $$4; + break; + } + $189 = $$0 + 148 | 0; + $190 = ($16 >>> 0) / ($189 >>> 0) | 0; + if ($190 >>> 0 < $189 >>> 0) { + $$1 = $189; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($190, $189) | 0)) { + $$1 = $189; + $$2332 = 9; + $$5 = $$4; + break; + } + $194 = $$0 + 150 | 0; + $195 = ($16 >>> 0) / ($194 >>> 0) | 0; + if ($195 >>> 0 < $194 >>> 0) { + $$1 = $194; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($195, $194) | 0)) { + $$1 = $194; + $$2332 = 9; + $$5 = $$4; + break; + } + $199 = $$0 + 156 | 0; + $200 = ($16 >>> 0) / ($199 >>> 0) | 0; + if ($200 >>> 0 < $199 >>> 0) { + $$1 = $199; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($200, $199) | 0)) { + $$1 = $199; + $$2332 = 9; + $$5 = $$4; + break; + } + $204 = $$0 + 162 | 0; + $205 = ($16 >>> 0) / ($204 >>> 0) | 0; + if ($205 >>> 0 < $204 >>> 0) { + $$1 = $204; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($205, $204) | 0)) { + $$1 = $204; + $$2332 = 9; + $$5 = $$4; + break; + } + $209 = $$0 + 166 | 0; + $210 = ($16 >>> 0) / ($209 >>> 0) | 0; + if ($210 >>> 0 < $209 >>> 0) { + $$1 = $209; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($210, $209) | 0)) { + $$1 = $209; + $$2332 = 9; + $$5 = $$4; + break; + } + $214 = $$0 + 168 | 0; + $215 = ($16 >>> 0) / ($214 >>> 0) | 0; + if ($215 >>> 0 < $214 >>> 0) { + $$1 = $214; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($215, $214) | 0)) { + $$1 = $214; + $$2332 = 9; + $$5 = $$4; + break; + } + $219 = $$0 + 172 | 0; + $220 = ($16 >>> 0) / ($219 >>> 0) | 0; + if ($220 >>> 0 < $219 >>> 0) { + $$1 = $219; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($220, $219) | 0)) { + $$1 = $219; + $$2332 = 9; + $$5 = $$4; + break; + } + $224 = $$0 + 178 | 0; + $225 = ($16 >>> 0) / ($224 >>> 0) | 0; + if ($225 >>> 0 < $224 >>> 0) { + $$1 = $224; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($225, $224) | 0)) { + $$1 = $224; + $$2332 = 9; + $$5 = $$4; + break; + } + $229 = $$0 + 180 | 0; + $230 = ($16 >>> 0) / ($229 >>> 0) | 0; + if ($230 >>> 0 < $229 >>> 0) { + $$1 = $229; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($230, $229) | 0)) { + $$1 = $229; + $$2332 = 9; + $$5 = $$4; + break; + } + $234 = $$0 + 186 | 0; + $235 = ($16 >>> 0) / ($234 >>> 0) | 0; + if ($235 >>> 0 < $234 >>> 0) { + $$1 = $234; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($235, $234) | 0)) { + $$1 = $234; + $$2332 = 9; + $$5 = $$4; + break; + } + $239 = $$0 + 190 | 0; + $240 = ($16 >>> 0) / ($239 >>> 0) | 0; + if ($240 >>> 0 < $239 >>> 0) { + $$1 = $239; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($240, $239) | 0)) { + $$1 = $239; + $$2332 = 9; + $$5 = $$4; + break; + } + $244 = $$0 + 192 | 0; + $245 = ($16 >>> 0) / ($244 >>> 0) | 0; + if ($245 >>> 0 < $244 >>> 0) { + $$1 = $244; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($245, $244) | 0)) { + $$1 = $244; + $$2332 = 9; + $$5 = $$4; + break; + } + $249 = $$0 + 196 | 0; + $250 = ($16 >>> 0) / ($249 >>> 0) | 0; + if ($250 >>> 0 < $249 >>> 0) { + $$1 = $249; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($250, $249) | 0)) { + $$1 = $249; + $$2332 = 9; + $$5 = $$4; + break; + } + $254 = $$0 + 198 | 0; + $255 = ($16 >>> 0) / ($254 >>> 0) | 0; + if ($255 >>> 0 < $254 >>> 0) { + $$1 = $254; + $$2332 = 1; + $$5 = $16; + break; + } + if (($16 | 0) == (Math_imul($255, $254) | 0)) { + $$1 = $254; + $$2332 = 9; + $$5 = $$4; + break; + } + $259 = $$0 + 208 | 0; + $260 = ($16 >>> 0) / ($259 >>> 0) | 0; + $261 = $260 >>> 0 < $259 >>> 0; + $263 = ($16 | 0) == (Math_imul($260, $259) | 0); + $$1 = $261 | $263 ? $259 : $$0 + 210 | 0; + $$2332 = $261 ? 1 : $263 ? 9 : 0; + $$5 = $261 ? $16 : $$4; + } else { + $$1 = $54; + $$2332 = 1; + $$5 = $16; + } + } else { + $$1 = $49; + $$2332 = 9; + $$5 = $$4; + } else { + $$1 = $49; + $$2332 = 1; + $$5 = $16; + } + } else { + $$1 = $44; + $$2332 = 9; + $$5 = $$4; + } else { + $$1 = $44; + $$2332 = 1; + $$5 = $16; + } + } else { + $$1 = $39; + $$2332 = 9; + $$5 = $$4; + } else { + $$1 = $39; + $$2332 = 1; + $$5 = $16; + } + } else { + $$1 = $34; + $$2332 = 9; + $$5 = $$4; + } else { + $$1 = $34; + $$2332 = 1; + $$5 = $16; + } + } else { + $$1 = $29; + $$2332 = 9; + $$5 = $$4; + } else { + $$1 = $29; + $$2332 = 1; + $$5 = $16; + } + } else { + $$1 = $$0; + $$2332 = 9; + $$5 = $$4; + } else { + $$1 = $$0; + $$2332 = 1; + $$5 = $16; + } while (0); + switch ($$2332 & 15) { + case 9: + { + $$6 = $$5; + break L10; + break; + } + case 0: + { + $$0 = $$1; + $$4 = $$5; + break; + } + default: + break L12; + } + } + if (!$$2332) $$6 = $$5; else { + label = 108; + break L4; + } + } while (0); + $266 = $spec$select339$sink + 1 | 0; + $267 = ($266 | 0) == 48; + $spec$select = $$0337 + ($267 & 1) | 0; + $$0328 = $$6; + $$0337 = $spec$select; + $$sink369 = $spec$select * 210 | 0; + $spec$select339$sink = $267 ? 0 : $266; + } + if ((label | 0) == 107) { + HEAP32[$2 >> 2] = $16; + $$8 = $16; + break; + } else if ((label | 0) == 108) { + HEAP32[$2 >> 2] = $16; + $$8 = $$5; + break; + } + } else { + $5 = __ZNSt3__213__lower_boundIRNS_6__lessIjmEEPKjmEET0_S6_S6_RKT1_T_(12544, 12736, $2, $1) | 0; + $$8 = HEAP32[$5 >> 2] | 0; + } while (0); + STACKTOP = sp; + return $$8 | 0; +} + +function _fill_inverse_cmap($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0$i = 0, $$0115$i = 0, $$0153$i = 0, $$0156166$i = 0, $$0158$lcssa$i = 0, $$0158164$i = 0, $$0160165$i = 0, $$05466 = 0, $$05765 = 0, $$089114$i = 0, $$092113$i = 0, $$093112$i = 0, $$1$i = 0, $$1154$i = 0, $$1159$i = 0, $$1161163$i = 0, $$195111$i = 0, $$199116$i = 0, $$2$i = 0, $$2155$i = 0, $$pn$i = 0, $$pn162$i = 0, $10 = 0, $102 = 0, $105 = 0, $107 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $21 = 0, $22 = 0, $24 = 0, $247 = 0, $249 = 0, $25 = 0, $250 = 0, $251 = 0, $256 = 0, $257 = 0, $258 = 0, $264 = 0, $265 = 0, $267 = 0, $27 = 0, $273 = 0, $278 = 0, $279 = 0, $28 = 0, $280 = 0, $281 = 0, $282 = 0, $283 = 0, $284 = 0, $285 = 0, $286 = 0, $287 = 0, $288 = 0, $289 = 0, $292 = 0, $293 = 0, $298 = 0, $299 = 0, $30 = 0, $303 = 0, $304 = 0, $308 = 0, $311 = 0, $312 = 0, $316 = 0, $317 = 0, $321 = 0, $322 = 0, $326 = 0, $329 = 0, $33 = 0, $330 = 0, $334 = 0, $335 = 0, $339 = 0, $34 = 0, $340 = 0, $344 = 0, $347 = 0, $348 = 0, $352 = 0, $353 = 0, $357 = 0, $358 = 0, $36 = 0, $362 = 0, $365 = 0, $366 = 0, $370 = 0, $371 = 0, $375 = 0, $376 = 0, $38 = 0, $380 = 0, $383 = 0, $384 = 0, $388 = 0, $389 = 0, $393 = 0, $394 = 0, $398 = 0, $4 = 0, $401 = 0, $402 = 0, $406 = 0, $407 = 0, $41 = 0, $411 = 0, $412 = 0, $416 = 0, $419 = 0, $420 = 0, $424 = 0, $425 = 0, $429 = 0, $430 = 0, $438 = 0, $439 = 0, $44 = 0, $440 = 0, $441 = 0, $442 = 0, $443 = 0, $444 = 0, $445 = 0, $446 = 0, $447 = 0, $449 = 0, $450 = 0, $451 = 0, $47 = 0, $474 = 0, $497 = 0, $5 = 0, $51 = 0, $520 = 0, $54 = 0, $543 = 0, $544 = 0, $567 = 0, $58 = 0, $590 = 0, $6 = 0, $61 = 0, $613 = 0, $65 = 0, $68 = 0, $72 = 0, $76 = 0, $80 = 0, $84 = 0, $87 = 0, $91 = 0, $93 = 0, $96 = 0, $99 = 0, $scevgep$1$i = 0, $scevgep$2$i = 0, $scevgep$3$i = 0, $scevgep$4$i = 0, $scevgep$5$i = 0, $scevgep$6$i = 0, $scevgep$i = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 1408 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(1408); + $4 = sp + 384 | 0; + $5 = sp + 128 | 0; + $6 = sp; + $10 = HEAP32[(HEAP32[$0 + 484 >> 2] | 0) + 24 >> 2] | 0; + $14 = $1 >>> 2 << 5; + $15 = $14 | 4; + $16 = $2 >>> 3 << 5; + $17 = $16 | 2; + $18 = $3 >>> 2 << 5; + $19 = $18 | 4; + $21 = HEAP32[$0 + 132 >> 2] | 0; + $22 = $14 | 28; + $24 = $22 + $15 >> 1; + $25 = $16 | 30; + $27 = $25 + $17 >> 1; + $28 = $18 | 28; + $30 = $28 + $19 >> 1; + if (($21 | 0) > 0) { + $33 = HEAP32[$0 + 136 >> 2] | 0; + $34 = HEAP32[$33 >> 2] | 0; + $36 = HEAP32[$33 + 4 >> 2] | 0; + $38 = HEAP32[$33 + 8 >> 2] | 0; + $$0156166$i = 2147483647; + $$0160165$i = 0; + do { + $41 = HEAPU8[$34 + $$0160165$i >> 0] | 0; + do if (($15 | 0) <= ($41 | 0)) { + if (($22 | 0) < ($41 | 0)) { + $51 = $41 - $22 << 1; + $54 = $41 - $15 << 1; + $$0$i = Math_imul($54, $54) | 0; + $$0153$i = Math_imul($51, $51) | 0; + break; + } + if (($24 | 0) < ($41 | 0)) { + $61 = $41 - $15 << 1; + $$0$i = Math_imul($61, $61) | 0; + $$0153$i = 0; + break; + } else { + $58 = $41 - $22 << 1; + $$0$i = Math_imul($58, $58) | 0; + $$0153$i = 0; + break; + } + } else { + $44 = $41 - $15 << 1; + $47 = $41 - $22 << 1; + $$0$i = Math_imul($47, $47) | 0; + $$0153$i = Math_imul($44, $44) | 0; + } while (0); + $65 = HEAPU8[$36 + $$0160165$i >> 0] | 0; + do if (($17 | 0) <= ($65 | 0)) { + if (($25 | 0) < ($65 | 0)) { + $76 = ($65 - $25 | 0) * 3 | 0; + $80 = ($65 - $17 | 0) * 3 | 0; + $$1154$i = (Math_imul($76, $76) | 0) + $$0153$i | 0; + $$pn$i = Math_imul($80, $80) | 0; + break; + } + if (($27 | 0) < ($65 | 0)) { + $87 = ($65 - $17 | 0) * 3 | 0; + $$1154$i = $$0153$i; + $$pn$i = Math_imul($87, $87) | 0; + break; + } else { + $84 = ($65 - $25 | 0) * 3 | 0; + $$1154$i = $$0153$i; + $$pn$i = Math_imul($84, $84) | 0; + break; + } + } else { + $68 = ($65 - $17 | 0) * 3 | 0; + $72 = ($65 - $25 | 0) * 3 | 0; + $$1154$i = (Math_imul($68, $68) | 0) + $$0153$i | 0; + $$pn$i = Math_imul($72, $72) | 0; + } while (0); + $$1$i = $$pn$i + $$0$i | 0; + $91 = HEAPU8[$38 + $$0160165$i >> 0] | 0; + do if (($19 | 0) <= ($91 | 0)) { + if (($28 | 0) < ($91 | 0)) { + $99 = $91 - $28 | 0; + $102 = $91 - $19 | 0; + $$2155$i = (Math_imul($99, $99) | 0) + $$1154$i | 0; + $$pn162$i = Math_imul($102, $102) | 0; + break; + } + if (($30 | 0) < ($91 | 0)) { + $107 = $91 - $19 | 0; + $$2155$i = $$1154$i; + $$pn162$i = Math_imul($107, $107) | 0; + break; + } else { + $105 = $91 - $28 | 0; + $$2155$i = $$1154$i; + $$pn162$i = Math_imul($105, $105) | 0; + break; + } + } else { + $93 = $91 - $19 | 0; + $96 = $91 - $28 | 0; + $$2155$i = (Math_imul($93, $93) | 0) + $$1154$i | 0; + $$pn162$i = Math_imul($96, $96) | 0; + } while (0); + $$2$i = $$1$i + $$pn162$i | 0; + HEAP32[$4 + ($$0160165$i << 2) >> 2] = $$2155$i; + $$0156166$i = ($$2$i | 0) < ($$0156166$i | 0) ? $$2$i : $$0156166$i; + $$0160165$i = $$0160165$i + 1 | 0; + } while (($$0160165$i | 0) != ($21 | 0)); + $$0158164$i = 0; + $$1161163$i = 0; + while (1) { + if ((HEAP32[$4 + ($$1161163$i << 2) >> 2] | 0) > ($$0156166$i | 0)) $$1159$i = $$0158164$i; else { + HEAP8[$5 + $$0158164$i >> 0] = $$1161163$i; + $$1159$i = $$0158164$i + 1 | 0; + } + $$1161163$i = $$1161163$i + 1 | 0; + if (($$1161163$i | 0) == ($21 | 0)) { + $$0158$lcssa$i = $$1159$i; + break; + } else $$0158164$i = $$1159$i; + } + } else $$0158$lcssa$i = 0; + HEAP32[$4 >> 2] = 2147483647; + HEAP32[$4 + 4 >> 2] = 2147483647; + HEAP32[$4 + 8 >> 2] = 2147483647; + HEAP32[$4 + 12 >> 2] = 2147483647; + HEAP32[$4 + 16 >> 2] = 2147483647; + HEAP32[$4 + 20 >> 2] = 2147483647; + HEAP32[$4 + 24 >> 2] = 2147483647; + HEAP32[$4 + 28 >> 2] = 2147483647; + HEAP32[$4 + 32 >> 2] = 2147483647; + HEAP32[$4 + 36 >> 2] = 2147483647; + HEAP32[$4 + 40 >> 2] = 2147483647; + HEAP32[$4 + 44 >> 2] = 2147483647; + HEAP32[$4 + 48 >> 2] = 2147483647; + HEAP32[$4 + 52 >> 2] = 2147483647; + HEAP32[$4 + 56 >> 2] = 2147483647; + HEAP32[$4 + 60 >> 2] = 2147483647; + HEAP32[$4 + 64 >> 2] = 2147483647; + HEAP32[$4 + 68 >> 2] = 2147483647; + HEAP32[$4 + 72 >> 2] = 2147483647; + HEAP32[$4 + 76 >> 2] = 2147483647; + HEAP32[$4 + 80 >> 2] = 2147483647; + HEAP32[$4 + 84 >> 2] = 2147483647; + HEAP32[$4 + 88 >> 2] = 2147483647; + HEAP32[$4 + 92 >> 2] = 2147483647; + HEAP32[$4 + 96 >> 2] = 2147483647; + HEAP32[$4 + 100 >> 2] = 2147483647; + HEAP32[$4 + 104 >> 2] = 2147483647; + HEAP32[$4 + 108 >> 2] = 2147483647; + HEAP32[$4 + 112 >> 2] = 2147483647; + HEAP32[$4 + 116 >> 2] = 2147483647; + HEAP32[$4 + 120 >> 2] = 2147483647; + HEAP32[$4 + 124 >> 2] = 2147483647; + HEAP32[$4 + 128 >> 2] = 2147483647; + HEAP32[$4 + 132 >> 2] = 2147483647; + HEAP32[$4 + 136 >> 2] = 2147483647; + HEAP32[$4 + 140 >> 2] = 2147483647; + HEAP32[$4 + 144 >> 2] = 2147483647; + HEAP32[$4 + 148 >> 2] = 2147483647; + HEAP32[$4 + 152 >> 2] = 2147483647; + HEAP32[$4 + 156 >> 2] = 2147483647; + HEAP32[$4 + 160 >> 2] = 2147483647; + HEAP32[$4 + 164 >> 2] = 2147483647; + HEAP32[$4 + 168 >> 2] = 2147483647; + HEAP32[$4 + 172 >> 2] = 2147483647; + HEAP32[$4 + 176 >> 2] = 2147483647; + HEAP32[$4 + 180 >> 2] = 2147483647; + HEAP32[$4 + 184 >> 2] = 2147483647; + HEAP32[$4 + 188 >> 2] = 2147483647; + HEAP32[$4 + 192 >> 2] = 2147483647; + HEAP32[$4 + 196 >> 2] = 2147483647; + HEAP32[$4 + 200 >> 2] = 2147483647; + HEAP32[$4 + 204 >> 2] = 2147483647; + HEAP32[$4 + 208 >> 2] = 2147483647; + HEAP32[$4 + 212 >> 2] = 2147483647; + HEAP32[$4 + 216 >> 2] = 2147483647; + HEAP32[$4 + 220 >> 2] = 2147483647; + HEAP32[$4 + 224 >> 2] = 2147483647; + HEAP32[$4 + 228 >> 2] = 2147483647; + HEAP32[$4 + 232 >> 2] = 2147483647; + HEAP32[$4 + 236 >> 2] = 2147483647; + HEAP32[$4 + 240 >> 2] = 2147483647; + HEAP32[$4 + 244 >> 2] = 2147483647; + HEAP32[$4 + 248 >> 2] = 2147483647; + HEAP32[$4 + 252 >> 2] = 2147483647; + HEAP32[$4 + 256 >> 2] = 2147483647; + HEAP32[$4 + 260 >> 2] = 2147483647; + HEAP32[$4 + 264 >> 2] = 2147483647; + HEAP32[$4 + 268 >> 2] = 2147483647; + HEAP32[$4 + 272 >> 2] = 2147483647; + HEAP32[$4 + 276 >> 2] = 2147483647; + HEAP32[$4 + 280 >> 2] = 2147483647; + HEAP32[$4 + 284 >> 2] = 2147483647; + HEAP32[$4 + 288 >> 2] = 2147483647; + HEAP32[$4 + 292 >> 2] = 2147483647; + HEAP32[$4 + 296 >> 2] = 2147483647; + HEAP32[$4 + 300 >> 2] = 2147483647; + HEAP32[$4 + 304 >> 2] = 2147483647; + HEAP32[$4 + 308 >> 2] = 2147483647; + HEAP32[$4 + 312 >> 2] = 2147483647; + HEAP32[$4 + 316 >> 2] = 2147483647; + HEAP32[$4 + 320 >> 2] = 2147483647; + HEAP32[$4 + 324 >> 2] = 2147483647; + HEAP32[$4 + 328 >> 2] = 2147483647; + HEAP32[$4 + 332 >> 2] = 2147483647; + HEAP32[$4 + 336 >> 2] = 2147483647; + HEAP32[$4 + 340 >> 2] = 2147483647; + HEAP32[$4 + 344 >> 2] = 2147483647; + HEAP32[$4 + 348 >> 2] = 2147483647; + HEAP32[$4 + 352 >> 2] = 2147483647; + HEAP32[$4 + 356 >> 2] = 2147483647; + HEAP32[$4 + 360 >> 2] = 2147483647; + HEAP32[$4 + 364 >> 2] = 2147483647; + HEAP32[$4 + 368 >> 2] = 2147483647; + HEAP32[$4 + 372 >> 2] = 2147483647; + HEAP32[$4 + 376 >> 2] = 2147483647; + HEAP32[$4 + 380 >> 2] = 2147483647; + HEAP32[$4 + 384 >> 2] = 2147483647; + HEAP32[$4 + 388 >> 2] = 2147483647; + HEAP32[$4 + 392 >> 2] = 2147483647; + HEAP32[$4 + 396 >> 2] = 2147483647; + HEAP32[$4 + 400 >> 2] = 2147483647; + HEAP32[$4 + 404 >> 2] = 2147483647; + HEAP32[$4 + 408 >> 2] = 2147483647; + HEAP32[$4 + 412 >> 2] = 2147483647; + HEAP32[$4 + 416 >> 2] = 2147483647; + HEAP32[$4 + 420 >> 2] = 2147483647; + HEAP32[$4 + 424 >> 2] = 2147483647; + HEAP32[$4 + 428 >> 2] = 2147483647; + HEAP32[$4 + 432 >> 2] = 2147483647; + HEAP32[$4 + 436 >> 2] = 2147483647; + HEAP32[$4 + 440 >> 2] = 2147483647; + HEAP32[$4 + 444 >> 2] = 2147483647; + HEAP32[$4 + 448 >> 2] = 2147483647; + HEAP32[$4 + 452 >> 2] = 2147483647; + HEAP32[$4 + 456 >> 2] = 2147483647; + HEAP32[$4 + 460 >> 2] = 2147483647; + HEAP32[$4 + 464 >> 2] = 2147483647; + HEAP32[$4 + 468 >> 2] = 2147483647; + HEAP32[$4 + 472 >> 2] = 2147483647; + HEAP32[$4 + 476 >> 2] = 2147483647; + HEAP32[$4 + 480 >> 2] = 2147483647; + HEAP32[$4 + 484 >> 2] = 2147483647; + HEAP32[$4 + 488 >> 2] = 2147483647; + HEAP32[$4 + 492 >> 2] = 2147483647; + HEAP32[$4 + 496 >> 2] = 2147483647; + HEAP32[$4 + 500 >> 2] = 2147483647; + HEAP32[$4 + 504 >> 2] = 2147483647; + HEAP32[$4 + 508 >> 2] = 2147483647; + if (($$0158$lcssa$i | 0) > 0) { + $247 = $0 + 136 | 0; + $$199116$i = 0; + do { + $249 = HEAP8[$5 + $$199116$i >> 0] | 0; + $250 = $249 & 255; + $251 = HEAP32[$247 >> 2] | 0; + $256 = $15 - (HEAPU8[(HEAP32[$251 >> 2] | 0) + $250 >> 0] | 0) | 0; + $257 = $256 << 1; + $258 = Math_imul($257, $257) | 0; + $264 = $17 - (HEAPU8[(HEAP32[$251 + 4 >> 2] | 0) + $250 >> 0] | 0) | 0; + $265 = $264 * 3 | 0; + $267 = (Math_imul($265, $265) | 0) + $258 | 0; + $273 = $19 - (HEAPU8[(HEAP32[$251 + 8 >> 2] | 0) + $250 >> 0] | 0) | 0; + $278 = $264 * 72 | 0; + $279 = $278 + 144 | 0; + $280 = $273 << 4; + $281 = $280 + 64 | 0; + $282 = $280 + 192 | 0; + $283 = $280 + 320 | 0; + $284 = $278 + 432 | 0; + $285 = $278 + 720 | 0; + $286 = $278 + 1008 | 0; + $287 = $278 + 1296 | 0; + $288 = $278 + 1584 | 0; + $289 = $278 + 1872 | 0; + $$0115$i = 3; + $$089114$i = ($256 << 6) + 256 | 0; + $$092113$i = $267 + (Math_imul($273, $273) | 0) | 0; + $$093112$i = $6; + $$195111$i = $4; + while (1) { + $scevgep$i = $$195111$i + 16 | 0; + if (($$092113$i | 0) < (HEAP32[$$195111$i >> 2] | 0)) { + HEAP32[$$195111$i >> 2] = $$092113$i; + HEAP8[$$093112$i >> 0] = $249; + } + $292 = $$092113$i + $281 | 0; + $293 = $$195111$i + 4 | 0; + if (($292 | 0) < (HEAP32[$293 >> 2] | 0)) { + HEAP32[$293 >> 2] = $292; + HEAP8[$$093112$i + 1 >> 0] = $249; + } + $298 = $292 + $282 | 0; + $299 = $$195111$i + 8 | 0; + if (($298 | 0) < (HEAP32[$299 >> 2] | 0)) { + HEAP32[$299 >> 2] = $298; + HEAP8[$$093112$i + 2 >> 0] = $249; + } + $303 = $298 + $283 | 0; + $304 = $$195111$i + 12 | 0; + if (($303 | 0) < (HEAP32[$304 >> 2] | 0)) { + HEAP32[$304 >> 2] = $303; + HEAP8[$$093112$i + 3 >> 0] = $249; + } + $308 = $279 + $$092113$i | 0; + $scevgep$1$i = $$195111$i + 32 | 0; + if (($308 | 0) < (HEAP32[$scevgep$i >> 2] | 0)) { + HEAP32[$scevgep$i >> 2] = $308; + HEAP8[$$093112$i + 4 >> 0] = $249; + } + $311 = $308 + $281 | 0; + $312 = $$195111$i + 20 | 0; + if (($311 | 0) < (HEAP32[$312 >> 2] | 0)) { + HEAP32[$312 >> 2] = $311; + HEAP8[$$093112$i + 5 >> 0] = $249; + } + $316 = $311 + $282 | 0; + $317 = $$195111$i + 24 | 0; + if (($316 | 0) < (HEAP32[$317 >> 2] | 0)) { + HEAP32[$317 >> 2] = $316; + HEAP8[$$093112$i + 6 >> 0] = $249; + } + $321 = $316 + $283 | 0; + $322 = $$195111$i + 28 | 0; + if (($321 | 0) < (HEAP32[$322 >> 2] | 0)) { + HEAP32[$322 >> 2] = $321; + HEAP8[$$093112$i + 7 >> 0] = $249; + } + $326 = $284 + $308 | 0; + $scevgep$2$i = $$195111$i + 48 | 0; + if (($326 | 0) < (HEAP32[$scevgep$1$i >> 2] | 0)) { + HEAP32[$scevgep$1$i >> 2] = $326; + HEAP8[$$093112$i + 8 >> 0] = $249; + } + $329 = $326 + $281 | 0; + $330 = $$195111$i + 36 | 0; + if (($329 | 0) < (HEAP32[$330 >> 2] | 0)) { + HEAP32[$330 >> 2] = $329; + HEAP8[$$093112$i + 9 >> 0] = $249; + } + $334 = $329 + $282 | 0; + $335 = $$195111$i + 40 | 0; + if (($334 | 0) < (HEAP32[$335 >> 2] | 0)) { + HEAP32[$335 >> 2] = $334; + HEAP8[$$093112$i + 10 >> 0] = $249; + } + $339 = $334 + $283 | 0; + $340 = $$195111$i + 44 | 0; + if (($339 | 0) < (HEAP32[$340 >> 2] | 0)) { + HEAP32[$340 >> 2] = $339; + HEAP8[$$093112$i + 11 >> 0] = $249; + } + $344 = $285 + $326 | 0; + $scevgep$3$i = $$195111$i + 64 | 0; + if (($344 | 0) < (HEAP32[$scevgep$2$i >> 2] | 0)) { + HEAP32[$scevgep$2$i >> 2] = $344; + HEAP8[$$093112$i + 12 >> 0] = $249; + } + $347 = $344 + $281 | 0; + $348 = $$195111$i + 52 | 0; + if (($347 | 0) < (HEAP32[$348 >> 2] | 0)) { + HEAP32[$348 >> 2] = $347; + HEAP8[$$093112$i + 13 >> 0] = $249; + } + $352 = $347 + $282 | 0; + $353 = $$195111$i + 56 | 0; + if (($352 | 0) < (HEAP32[$353 >> 2] | 0)) { + HEAP32[$353 >> 2] = $352; + HEAP8[$$093112$i + 14 >> 0] = $249; + } + $357 = $352 + $283 | 0; + $358 = $$195111$i + 60 | 0; + if (($357 | 0) < (HEAP32[$358 >> 2] | 0)) { + HEAP32[$358 >> 2] = $357; + HEAP8[$$093112$i + 15 >> 0] = $249; + } + $362 = $286 + $344 | 0; + $scevgep$4$i = $$195111$i + 80 | 0; + if (($362 | 0) < (HEAP32[$scevgep$3$i >> 2] | 0)) { + HEAP32[$scevgep$3$i >> 2] = $362; + HEAP8[$$093112$i + 16 >> 0] = $249; + } + $365 = $362 + $281 | 0; + $366 = $$195111$i + 68 | 0; + if (($365 | 0) < (HEAP32[$366 >> 2] | 0)) { + HEAP32[$366 >> 2] = $365; + HEAP8[$$093112$i + 17 >> 0] = $249; + } + $370 = $365 + $282 | 0; + $371 = $$195111$i + 72 | 0; + if (($370 | 0) < (HEAP32[$371 >> 2] | 0)) { + HEAP32[$371 >> 2] = $370; + HEAP8[$$093112$i + 18 >> 0] = $249; + } + $375 = $370 + $283 | 0; + $376 = $$195111$i + 76 | 0; + if (($375 | 0) < (HEAP32[$376 >> 2] | 0)) { + HEAP32[$376 >> 2] = $375; + HEAP8[$$093112$i + 19 >> 0] = $249; + } + $380 = $287 + $362 | 0; + $scevgep$5$i = $$195111$i + 96 | 0; + if (($380 | 0) < (HEAP32[$scevgep$4$i >> 2] | 0)) { + HEAP32[$scevgep$4$i >> 2] = $380; + HEAP8[$$093112$i + 20 >> 0] = $249; + } + $383 = $380 + $281 | 0; + $384 = $$195111$i + 84 | 0; + if (($383 | 0) < (HEAP32[$384 >> 2] | 0)) { + HEAP32[$384 >> 2] = $383; + HEAP8[$$093112$i + 21 >> 0] = $249; + } + $388 = $383 + $282 | 0; + $389 = $$195111$i + 88 | 0; + if (($388 | 0) < (HEAP32[$389 >> 2] | 0)) { + HEAP32[$389 >> 2] = $388; + HEAP8[$$093112$i + 22 >> 0] = $249; + } + $393 = $388 + $283 | 0; + $394 = $$195111$i + 92 | 0; + if (($393 | 0) < (HEAP32[$394 >> 2] | 0)) { + HEAP32[$394 >> 2] = $393; + HEAP8[$$093112$i + 23 >> 0] = $249; + } + $398 = $288 + $380 | 0; + $scevgep$6$i = $$195111$i + 112 | 0; + if (($398 | 0) < (HEAP32[$scevgep$5$i >> 2] | 0)) { + HEAP32[$scevgep$5$i >> 2] = $398; + HEAP8[$$093112$i + 24 >> 0] = $249; + } + $401 = $398 + $281 | 0; + $402 = $$195111$i + 100 | 0; + if (($401 | 0) < (HEAP32[$402 >> 2] | 0)) { + HEAP32[$402 >> 2] = $401; + HEAP8[$$093112$i + 25 >> 0] = $249; + } + $406 = $401 + $282 | 0; + $407 = $$195111$i + 104 | 0; + if (($406 | 0) < (HEAP32[$407 >> 2] | 0)) { + HEAP32[$407 >> 2] = $406; + HEAP8[$$093112$i + 26 >> 0] = $249; + } + $411 = $406 + $283 | 0; + $412 = $$195111$i + 108 | 0; + if (($411 | 0) < (HEAP32[$412 >> 2] | 0)) { + HEAP32[$412 >> 2] = $411; + HEAP8[$$093112$i + 27 >> 0] = $249; + } + $416 = $289 + $398 | 0; + if (($416 | 0) < (HEAP32[$scevgep$6$i >> 2] | 0)) { + HEAP32[$scevgep$6$i >> 2] = $416; + HEAP8[$$093112$i + 28 >> 0] = $249; + } + $419 = $416 + $281 | 0; + $420 = $$195111$i + 116 | 0; + if (($419 | 0) < (HEAP32[$420 >> 2] | 0)) { + HEAP32[$420 >> 2] = $419; + HEAP8[$$093112$i + 29 >> 0] = $249; + } + $424 = $419 + $282 | 0; + $425 = $$195111$i + 120 | 0; + if (($424 | 0) < (HEAP32[$425 >> 2] | 0)) { + HEAP32[$425 >> 2] = $424; + HEAP8[$$093112$i + 30 >> 0] = $249; + } + $429 = $424 + $283 | 0; + $430 = $$195111$i + 124 | 0; + if (($429 | 0) < (HEAP32[$430 >> 2] | 0)) { + HEAP32[$430 >> 2] = $429; + HEAP8[$$093112$i + 31 >> 0] = $249; + } + $$092113$i = $$092113$i + $$089114$i | 0; + if (!$$0115$i) break; else { + $$0115$i = $$0115$i + -1 | 0; + $$089114$i = $$089114$i + 512 | 0; + $$093112$i = $$093112$i + 32 | 0; + $$195111$i = $$195111$i + 128 | 0; + } + } + $$199116$i = $$199116$i + 1 | 0; + } while (($$199116$i | 0) != ($$0158$lcssa$i | 0)); + } + $438 = $1 & -4; + $439 = $2 & -8; + $440 = $3 & -4; + $441 = $439 | 1; + $442 = $439 | 2; + $443 = $439 | 3; + $444 = $439 | 4; + $445 = $439 | 5; + $446 = $439 | 6; + $447 = $2 | 7; + $$05466 = $6; + $$05765 = 0; + while (1) { + $449 = $10 + ($$05765 + $438 << 2) | 0; + $450 = HEAP32[$449 >> 2] | 0; + $451 = $450 + ($439 << 6) + ($440 << 1) | 0; + HEAP16[$451 >> 1] = (HEAPU8[$$05466 >> 0] | 0) + 1; + HEAP16[$451 + 2 >> 1] = (HEAPU8[$$05466 + 1 >> 0] | 0) + 1; + HEAP16[$451 + 4 >> 1] = (HEAPU8[$$05466 + 2 >> 0] | 0) + 1; + HEAP16[$451 + 6 >> 1] = (HEAPU8[$$05466 + 3 >> 0] | 0) + 1; + $474 = $450 + ($441 << 6) + ($440 << 1) | 0; + HEAP16[$474 >> 1] = (HEAPU8[$$05466 + 4 >> 0] | 0) + 1; + HEAP16[$474 + 2 >> 1] = (HEAPU8[$$05466 + 5 >> 0] | 0) + 1; + HEAP16[$474 + 4 >> 1] = (HEAPU8[$$05466 + 6 >> 0] | 0) + 1; + HEAP16[$474 + 6 >> 1] = (HEAPU8[$$05466 + 7 >> 0] | 0) + 1; + $497 = $450 + ($442 << 6) + ($440 << 1) | 0; + HEAP16[$497 >> 1] = (HEAPU8[$$05466 + 8 >> 0] | 0) + 1; + HEAP16[$497 + 2 >> 1] = (HEAPU8[$$05466 + 9 >> 0] | 0) + 1; + HEAP16[$497 + 4 >> 1] = (HEAPU8[$$05466 + 10 >> 0] | 0) + 1; + HEAP16[$497 + 6 >> 1] = (HEAPU8[$$05466 + 11 >> 0] | 0) + 1; + $520 = $450 + ($443 << 6) + ($440 << 1) | 0; + HEAP16[$520 >> 1] = (HEAPU8[$$05466 + 12 >> 0] | 0) + 1; + HEAP16[$520 + 2 >> 1] = (HEAPU8[$$05466 + 13 >> 0] | 0) + 1; + HEAP16[$520 + 4 >> 1] = (HEAPU8[$$05466 + 14 >> 0] | 0) + 1; + HEAP16[$520 + 6 >> 1] = (HEAPU8[$$05466 + 15 >> 0] | 0) + 1; + $543 = HEAP32[$449 >> 2] | 0; + $544 = $543 + ($444 << 6) + ($440 << 1) | 0; + HEAP16[$544 >> 1] = (HEAPU8[$$05466 + 16 >> 0] | 0) + 1; + HEAP16[$544 + 2 >> 1] = (HEAPU8[$$05466 + 17 >> 0] | 0) + 1; + HEAP16[$544 + 4 >> 1] = (HEAPU8[$$05466 + 18 >> 0] | 0) + 1; + HEAP16[$544 + 6 >> 1] = (HEAPU8[$$05466 + 19 >> 0] | 0) + 1; + $567 = $543 + ($445 << 6) + ($440 << 1) | 0; + HEAP16[$567 >> 1] = (HEAPU8[$$05466 + 20 >> 0] | 0) + 1; + HEAP16[$567 + 2 >> 1] = (HEAPU8[$$05466 + 21 >> 0] | 0) + 1; + HEAP16[$567 + 4 >> 1] = (HEAPU8[$$05466 + 22 >> 0] | 0) + 1; + HEAP16[$567 + 6 >> 1] = (HEAPU8[$$05466 + 23 >> 0] | 0) + 1; + $590 = $543 + ($446 << 6) + ($440 << 1) | 0; + HEAP16[$590 >> 1] = (HEAPU8[$$05466 + 24 >> 0] | 0) + 1; + HEAP16[$590 + 2 >> 1] = (HEAPU8[$$05466 + 25 >> 0] | 0) + 1; + HEAP16[$590 + 4 >> 1] = (HEAPU8[$$05466 + 26 >> 0] | 0) + 1; + HEAP16[$590 + 6 >> 1] = (HEAPU8[$$05466 + 27 >> 0] | 0) + 1; + $613 = $543 + ($447 << 6) + ($440 << 1) | 0; + HEAP16[$613 >> 1] = (HEAPU8[$$05466 + 28 >> 0] | 0) + 1; + HEAP16[$613 + 2 >> 1] = (HEAPU8[$$05466 + 29 >> 0] | 0) + 1; + HEAP16[$613 + 4 >> 1] = (HEAPU8[$$05466 + 30 >> 0] | 0) + 1; + HEAP16[$613 + 6 >> 1] = (HEAPU8[$$05466 + 31 >> 0] | 0) + 1; + $$05765 = $$05765 + 1 | 0; + if (($$05765 | 0) == 4) break; else $$05466 = $$05466 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseOperatorNameEPNS5_9NameStateE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$1 = 0, $$2 = 0, $$3 = 0, $199 = 0, $2 = 0, $3 = 0, $35 = 0, $38 = 0, $4 = 0, $41 = 0, $93 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp; + L1 : do switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 | 0) { + case 97: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 | 0) { + case 97: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 53763) | 0; + break L1; + break; + } + case 110: + case 100: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 53774) | 0; + break L1; + break; + } + case 78: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 53784) | 0; + break L1; + break; + } + case 83: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 53795) | 0; + break L1; + break; + } + default: + { + $$3 = 0; + break L1; + } + } + break; + } + case 99: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 | 0) { + case 108: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 53805) | 0; + break L1; + break; + } + case 109: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 53816) | 0; + break L1; + break; + } + case 111: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 53826) | 0; + break L1; + break; + } + case 118: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + __ZN12_GLOBAL__N_114SwapAndRestoreIbEC2ERbb($2, $0 + 360 | 0, 0); + $35 = $0 + 361 | 0; + $38 = ($1 | 0) != 0; + __ZN12_GLOBAL__N_114SwapAndRestoreIbEC2ERbb($3, $35, $38 | (HEAP8[$35 >> 0] | 0) != 0); + $41 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$4 >> 2] = $41; + if (!$41) $$0 = 0; else { + if ($38) HEAP8[$1 >> 0] = 1; + $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_22ConversionOperatorTypeEJRPNS0_4NodeEEEES9_DpOT0_($0, $4) | 0; + } + __ZN12_GLOBAL__N_114SwapAndRestoreIbED2Ev($3); + __ZN12_GLOBAL__N_114SwapAndRestoreIbED2Ev($2); + $$3 = $$0; + break L1; + break; + } + default: + { + $$3 = 0; + break L1; + } + } + break; + } + case 100: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 | 0) { + case 97: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA18_KcEEEPNS0_4NodeEDpOT0_($0, 53836) | 0; + break L1; + break; + } + case 101: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 53854) | 0; + break L1; + break; + } + case 108: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA16_KcEEEPNS0_4NodeEDpOT0_($0) | 0; + break L1; + break; + } + case 118: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 53864) | 0; + break L1; + break; + } + case 86: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 53874) | 0; + break L1; + break; + } + default: + { + $$3 = 0; + break L1; + } + } + break; + } + case 101: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 | 0) { + case 111: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 53885) | 0; + break L1; + break; + } + case 79: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 53895) | 0; + break L1; + break; + } + case 113: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 53906) | 0; + break L1; + break; + } + default: + { + $$3 = 0; + break L1; + } + } + break; + } + case 103: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 | 0) { + case 101: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 53917) | 0; + break L1; + break; + } + case 116: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 53928) | 0; + break L1; + break; + } + default: + { + $$3 = 0; + break L1; + } + } + break; + } + case 105: + { + if ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 == 120) { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 53938) | 0; + } else $$3 = 0; + break; + } + case 108: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 | 0) { + case 101: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 53949) | 0; + break L1; + break; + } + case 105: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $93 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseSourceNameEPNS5_9NameStateE(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$2 >> 2] = $93; + if (!$93) $$1 = 0; else $$1 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_15LiteralOperatorEJRPNS0_4NodeEEEES9_DpOT0_($0, $2) | 0; + $$3 = $$1; + break L1; + break; + } + case 115: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 53960) | 0; + break L1; + break; + } + case 83: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA12_KcEEEPNS0_4NodeEDpOT0_($0, 53971) | 0; + break L1; + break; + } + case 116: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 53983) | 0; + break L1; + break; + } + default: + { + $$3 = 0; + break L1; + } + } + break; + } + case 109: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 | 0) { + case 105: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 53993) | 0; + break L1; + break; + } + case 73: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 54003) | 0; + break L1; + break; + } + case 108: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 53854) | 0; + break L1; + break; + } + case 76: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 54014) | 0; + break L1; + break; + } + case 109: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 54025) | 0; + break L1; + break; + } + default: + { + $$3 = 0; + break L1; + } + } + break; + } + case 110: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 | 0) { + case 97: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA15_KcEEEPNS0_4NodeEDpOT0_($0, 54036) | 0; + break L1; + break; + } + case 101: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 54051) | 0; + break L1; + break; + } + case 103: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 53993) | 0; + break L1; + break; + } + case 116: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 54062) | 0; + break L1; + break; + } + case 119: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA13_KcEEEPNS0_4NodeEDpOT0_($0, 54072) | 0; + break L1; + break; + } + default: + { + $$3 = 0; + break L1; + } + } + break; + } + case 111: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 | 0) { + case 111: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 54085) | 0; + break L1; + break; + } + case 114: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 54096) | 0; + break L1; + break; + } + case 82: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 54106) | 0; + break L1; + break; + } + default: + { + $$3 = 0; + break L1; + } + } + break; + } + case 112: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 | 0) { + case 109: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA12_KcEEEPNS0_4NodeEDpOT0_($0, 54117) | 0; + break L1; + break; + } + case 108: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 54129) | 0; + break L1; + break; + } + case 76: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 54139) | 0; + break L1; + break; + } + case 112: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 54150) | 0; + break L1; + break; + } + case 115: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 54129) | 0; + break L1; + break; + } + case 116: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 54161) | 0; + break L1; + break; + } + default: + { + $$3 = 0; + break L1; + } + } + break; + } + case 113: + { + if ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 == 117) { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 54172) | 0; + } else $$3 = 0; + break; + } + case 114: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 | 0) { + case 109: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, 54182) | 0; + break L1; + break; + } + case 77: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 54192) | 0; + break L1; + break; + } + case 115: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, 54203) | 0; + break L1; + break; + } + case 83: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA12_KcEEEPNS0_4NodeEDpOT0_($0, 54214) | 0; + break L1; + break; + } + default: + { + $$3 = 0; + break L1; + } + } + break; + } + case 115: + { + if ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 == 115) { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA12_KcEEEPNS0_4NodeEDpOT0_($0, 54226) | 0; + } else $$3 = 0; + break; + } + case 118: + { + if ((((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24) + -48 | 0) >>> 0 < 10) { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $199 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseSourceNameEPNS5_9NameStateE(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$2 >> 2] = $199; + if (!$199) $$2 = 0; else $$2 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_22ConversionOperatorTypeEJRPNS0_4NodeEEEES9_DpOT0_($0, $2) | 0; + $$3 = $$2; + } else $$3 = 0; + break; + } + default: + $$3 = 0; + } while (0); + STACKTOP = sp; + return $$3 | 0; +} + +function _fmt_fp($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = +$1; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0463$lcssa = 0, $$0463588 = 0, $$0464599 = 0, $$0471 = 0.0, $$0479 = 0, $$0487657 = 0, $$0488669 = 0, $$0488671 = 0, $$0497670 = 0, $$0498 = 0, $$0511586 = 0.0, $$0513 = 0, $$0516652 = 0, $$0522 = 0, $$0523 = 0, $$0525 = 0, $$0527 = 0, $$0529$in646 = 0, $$0532651 = 0, $$1465 = 0, $$1467 = 0.0, $$1469 = 0.0, $$1472 = 0.0, $$1480 = 0, $$1482$lcssa = 0, $$1482683 = 0, $$1489656 = 0, $$1499 = 0, $$1510587 = 0, $$1514$lcssa = 0, $$1514614 = 0, $$1517 = 0, $$1526 = 0, $$1530621 = 0, $$1533$lcssa = 0, $$1533645 = 0, $$1604 = 0, $$2 = 0, $$2473 = 0.0, $$2476 = 0, $$2483 = 0, $$2490$lcssa = 0, $$2490638 = 0, $$2500$lcssa = 0, $$2500682 = 0, $$2515 = 0, $$2518634 = 0, $$2531 = 0, $$2534633 = 0, $$3 = 0.0, $$3477 = 0, $$3484$lcssa = 0, $$3484663 = 0, $$3501$lcssa = 0, $$3501676 = 0, $$3535620 = 0, $$4 = 0.0, $$4478$lcssa = 0, $$4478594 = 0, $$4492 = 0, $$4502$lcssa = 0, $$4502662 = 0, $$4520 = 0, $$5$lcssa = 0, $$5486$lcssa = 0, $$5486639 = 0, $$5493603 = 0, $$5503 = 0, $$5521 = 0, $$5609 = 0, $$6 = 0, $$6494593 = 0, $$7495608 = 0, $$8 = 0, $$8506 = 0, $$9 = 0, $$9507$lcssa = 0, $$9507625 = 0, $$lcssa583 = 0, $$pn = 0, $$pr = 0, $$pr564 = 0, $$pre$phi717Z2D = 0, $$pre$phi718Z2D = 0, $$pre720 = 0, $$sink757 = 0, $10 = 0, $103 = 0, $104 = 0, $108 = 0, $109 = 0, $11 = 0, $113 = 0, $115 = 0, $116 = 0, $12 = 0, $123 = 0, $126 = 0, $13 = 0, $132 = 0, $135 = 0, $136 = 0, $139 = 0, $141 = 0, $142 = 0, $145 = 0, $147 = 0, $15 = 0.0, $151 = 0, $154 = 0, $158 = 0, $16 = 0, $163 = 0, $164 = 0, $165 = 0, $166 = 0, $168 = 0, $174 = 0, $175 = 0, $176 = 0, $188 = 0, $202 = 0, $203 = 0, $206 = 0, $211 = 0, $212 = 0, $214 = 0, $222 = 0, $223 = 0, $225 = 0, $227 = 0, $229 = 0, $231 = 0, $232 = 0, $234 = 0, $237 = 0, $240 = 0, $245 = 0, $248 = 0, $25 = 0, $251 = 0, $253 = 0, $255 = 0, $257 = 0, $262 = 0, $263 = 0, $266 = 0, $268 = 0, $270 = 0, $273 = 0, $286 = 0, $291 = 0, $30 = 0, $300 = 0, $301 = 0, $305 = 0, $308 = 0, $310 = 0, $312 = 0, $316 = 0, $319 = 0, $320 = 0, $324 = 0, $334 = 0, $339 = 0, $34 = 0, $342 = 0, $343 = 0, $344 = 0, $346 = 0, $351 = 0, $364 = 0, $368 = 0, $373 = 0, $38 = 0.0, $382 = 0, $384 = 0, $385 = 0, $386 = 0, $387 = 0, $389 = 0, $39 = 0, $393 = 0, $395 = 0, $398 = 0, $401 = 0, $412 = 0, $42 = 0, $44 = 0, $47 = 0, $49 = 0, $6 = 0, $63 = 0, $66 = 0, $69 = 0, $7 = 0, $71 = 0, $79 = 0, $8 = 0, $80 = 0, $82 = 0, $83 = 0, $89 = 0, $9 = 0, $spec$select = 0, $spec$select539 = 0, $spec$select540 = 0, $spec$select540723 = 0, $spec$select541 = 0, $spec$select544 = 0.0, $spec$select548 = 0, $spec$select549 = 0, $spec$select551 = 0, $spec$select554 = 0, $spec$select557 = 0, $spec$select567 = 0.0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 560 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(560); + $6 = sp + 32 | 0; + $7 = sp + 536 | 0; + $8 = sp; + $9 = $8; + $10 = sp + 540 | 0; + HEAP32[$7 >> 2] = 0; + $11 = $10 + 12 | 0; + $12 = ___DOUBLE_BITS_670($1) | 0; + $13 = getTempRet0() | 0; + if (($13 | 0) < 0) { + $15 = -$1; + $16 = ___DOUBLE_BITS_670($15) | 0; + $$0471 = $15; + $$0522 = 1; + $$0523 = 50757; + $25 = getTempRet0() | 0; + $412 = $16; + } else { + $$0471 = $1; + $$0522 = ($4 & 2049 | 0) != 0 & 1; + $$0523 = ($4 & 2048 | 0) == 0 ? (($4 & 1 | 0) == 0 ? 50758 : 50763) : 50760; + $25 = $13; + $412 = $12; + } + do if (0 == 0 & ($25 & 2146435072 | 0) == 2146435072) { + $30 = ($5 & 32 | 0) != 0; + $34 = $$0522 + 3 | 0; + _pad_667($0, 32, $2, $34, $4 & -65537); + _out($0, $$0523, $$0522); + _out($0, $$0471 != $$0471 | 0.0 != 0.0 ? ($30 ? 50797 : 50784) : $30 ? 50776 : 50780, 3); + _pad_667($0, 32, $2, $34, $4 ^ 8192); + $$sink757 = $34; + } else { + $38 = +_frexp($$0471, $7) * 2.0; + $39 = $38 != 0.0; + if ($39) HEAP32[$7 >> 2] = (HEAP32[$7 >> 2] | 0) + -1; + $42 = $5 | 32; + if (($42 | 0) == 97) { + $44 = $5 & 32; + $spec$select = ($44 | 0) == 0 ? $$0523 : $$0523 + 9 | 0; + $47 = $$0522 | 2; + $49 = 12 - $3 | 0; + do if (!($3 >>> 0 > 11 | ($49 | 0) == 0)) { + $$0511586 = 8.0; + $$1510587 = $49; + do { + $$1510587 = $$1510587 + -1 | 0; + $$0511586 = $$0511586 * 16.0; + } while (($$1510587 | 0) != 0); + if ((HEAP8[$spec$select >> 0] | 0) == 45) { + $$1472 = -($$0511586 + (-$38 - $$0511586)); + break; + } else { + $$1472 = $38 + $$0511586 - $$0511586; + break; + } + } else $$1472 = $38; while (0); + $63 = HEAP32[$7 >> 2] | 0; + $66 = ($63 | 0) < 0 ? 0 - $63 | 0 : $63; + $69 = _fmt_u($66, (($66 | 0) < 0) << 31 >> 31, $11) | 0; + if (($69 | 0) == ($11 | 0)) { + $71 = $10 + 11 | 0; + HEAP8[$71 >> 0] = 48; + $$0513 = $71; + } else $$0513 = $69; + HEAP8[$$0513 + -1 >> 0] = ($63 >> 31 & 2) + 43; + $79 = $$0513 + -2 | 0; + HEAP8[$79 >> 0] = $5 + 15; + $80 = ($3 | 0) < 1; + $82 = ($4 & 8 | 0) == 0; + $$0525 = $8; + $$2473 = $$1472; + while (1) { + $83 = ~~$$2473; + $89 = $$0525 + 1 | 0; + HEAP8[$$0525 >> 0] = $44 | HEAPU8[6672 + $83 >> 0]; + $$2473 = ($$2473 - +($83 | 0)) * 16.0; + if (($89 - $9 | 0) == 1 ? !($82 & ($80 & $$2473 == 0.0)) : 0) { + HEAP8[$89 >> 0] = 46; + $$1526 = $$0525 + 2 | 0; + } else $$1526 = $89; + if (!($$2473 != 0.0)) break; else $$0525 = $$1526; + } + $$pre720 = $$1526; + if (($3 | 0) != 0 ? (-2 - $9 + $$pre720 | 0) < ($3 | 0) : 0) { + $103 = $11; + $104 = $79; + $$0527 = $3 + 2 + $103 - $104 | 0; + $$pre$phi717Z2D = $103; + $$pre$phi718Z2D = $104; + } else { + $108 = $11; + $109 = $79; + $$0527 = $108 - $9 - $109 + $$pre720 | 0; + $$pre$phi717Z2D = $108; + $$pre$phi718Z2D = $109; + } + $113 = $$0527 + $47 | 0; + _pad_667($0, 32, $2, $113, $4); + _out($0, $spec$select, $47); + _pad_667($0, 48, $2, $113, $4 ^ 65536); + $115 = $$pre720 - $9 | 0; + _out($0, $8, $115); + $116 = $$pre$phi717Z2D - $$pre$phi718Z2D | 0; + _pad_667($0, 48, $$0527 - ($115 + $116) | 0, 0, 0); + _out($0, $79, $116); + _pad_667($0, 32, $2, $113, $4 ^ 8192); + $$sink757 = $113; + break; + } + $spec$select539 = ($3 | 0) < 0 ? 6 : $3; + if ($39) { + $123 = (HEAP32[$7 >> 2] | 0) + -28 | 0; + HEAP32[$7 >> 2] = $123; + $$3 = $38 * 268435456.0; + $$pr = $123; + } else { + $$3 = $38; + $$pr = HEAP32[$7 >> 2] | 0; + } + $$0498 = ($$pr | 0) < 0 ? $6 : $6 + 288 | 0; + $$1499 = $$0498; + $$4 = $$3; + do { + $126 = ~~$$4 >>> 0; + HEAP32[$$1499 >> 2] = $126; + $$1499 = $$1499 + 4 | 0; + $$4 = ($$4 - +($126 >>> 0)) * 1.0e9; + } while ($$4 != 0.0); + $132 = $$0498; + if (($$pr | 0) > 0) { + $$1482683 = $$0498; + $$2500682 = $$1499; + $135 = $$pr; + while (1) { + $136 = ($135 | 0) < 29 ? $135 : 29; + $$0488669 = $$2500682 + -4 | 0; + if ($$0488669 >>> 0 >= $$1482683 >>> 0) { + $$0488671 = $$0488669; + $$0497670 = 0; + do { + $139 = _bitshift64Shl(HEAP32[$$0488671 >> 2] | 0, 0, $136 | 0) | 0; + $141 = _i64Add($139 | 0, getTempRet0() | 0, $$0497670 | 0, 0) | 0; + $142 = getTempRet0() | 0; + $$0497670 = ___udivdi3($141 | 0, $142 | 0, 1e9, 0) | 0; + $145 = ___muldi3($$0497670 | 0, getTempRet0() | 0, 1e9, 0) | 0; + $147 = _i64Subtract($141 | 0, $142 | 0, $145 | 0, getTempRet0() | 0) | 0; + getTempRet0() | 0; + HEAP32[$$0488671 >> 2] = $147; + $$0488671 = $$0488671 + -4 | 0; + } while ($$0488671 >>> 0 >= $$1482683 >>> 0); + if ($$0497670) { + $151 = $$1482683 + -4 | 0; + HEAP32[$151 >> 2] = $$0497670; + $$2483 = $151; + } else $$2483 = $$1482683; + } else $$2483 = $$1482683; + L57 : do if ($$2500682 >>> 0 > $$2483 >>> 0) { + $$3501676 = $$2500682; + while (1) { + $154 = $$3501676 + -4 | 0; + if (HEAP32[$154 >> 2] | 0) { + $$3501$lcssa = $$3501676; + break L57; + } + if ($154 >>> 0 > $$2483 >>> 0) $$3501676 = $154; else { + $$3501$lcssa = $154; + break; + } + } + } else $$3501$lcssa = $$2500682; while (0); + $158 = (HEAP32[$7 >> 2] | 0) - $136 | 0; + HEAP32[$7 >> 2] = $158; + if (($158 | 0) > 0) { + $$1482683 = $$2483; + $$2500682 = $$3501$lcssa; + $135 = $158; + } else { + $$1482$lcssa = $$2483; + $$2500$lcssa = $$3501$lcssa; + $$pr564 = $158; + break; + } + } + } else { + $$1482$lcssa = $$0498; + $$2500$lcssa = $$1499; + $$pr564 = $$pr; + } + if (($$pr564 | 0) < 0) { + $163 = (($spec$select539 + 25 | 0) / 9 | 0) + 1 | 0; + $164 = ($42 | 0) == 102; + $$3484663 = $$1482$lcssa; + $$4502662 = $$2500$lcssa; + $166 = $$pr564; + while (1) { + $165 = 0 - $166 | 0; + $168 = ($165 | 0) < 9 ? $165 : 9; + if ($$3484663 >>> 0 < $$4502662 >>> 0) { + $174 = (1 << $168) + -1 | 0; + $175 = 1e9 >>> $168; + $$0487657 = 0; + $$1489656 = $$3484663; + do { + $176 = HEAP32[$$1489656 >> 2] | 0; + HEAP32[$$1489656 >> 2] = ($176 >>> $168) + $$0487657; + $$0487657 = Math_imul($176 & $174, $175) | 0; + $$1489656 = $$1489656 + 4 | 0; + } while ($$1489656 >>> 0 < $$4502662 >>> 0); + $spec$select540 = (HEAP32[$$3484663 >> 2] | 0) == 0 ? $$3484663 + 4 | 0 : $$3484663; + if (!$$0487657) { + $$5503 = $$4502662; + $spec$select540723 = $spec$select540; + } else { + HEAP32[$$4502662 >> 2] = $$0487657; + $$5503 = $$4502662 + 4 | 0; + $spec$select540723 = $spec$select540; + } + } else { + $$5503 = $$4502662; + $spec$select540723 = (HEAP32[$$3484663 >> 2] | 0) == 0 ? $$3484663 + 4 | 0 : $$3484663; + } + $188 = $164 ? $$0498 : $spec$select540723; + $spec$select541 = ($$5503 - $188 >> 2 | 0) > ($163 | 0) ? $188 + ($163 << 2) | 0 : $$5503; + $166 = (HEAP32[$7 >> 2] | 0) + $168 | 0; + HEAP32[$7 >> 2] = $166; + if (($166 | 0) >= 0) { + $$3484$lcssa = $spec$select540723; + $$4502$lcssa = $spec$select541; + break; + } else { + $$3484663 = $spec$select540723; + $$4502662 = $spec$select541; + } + } + } else { + $$3484$lcssa = $$1482$lcssa; + $$4502$lcssa = $$2500$lcssa; + } + if ($$3484$lcssa >>> 0 < $$4502$lcssa >>> 0) { + $202 = ($132 - $$3484$lcssa >> 2) * 9 | 0; + $203 = HEAP32[$$3484$lcssa >> 2] | 0; + if ($203 >>> 0 < 10) $$1517 = $202; else { + $$0516652 = $202; + $$0532651 = 10; + while (1) { + $$0532651 = $$0532651 * 10 | 0; + $206 = $$0516652 + 1 | 0; + if ($203 >>> 0 < $$0532651 >>> 0) { + $$1517 = $206; + break; + } else $$0516652 = $206; + } + } + } else $$1517 = 0; + $211 = ($42 | 0) == 103; + $212 = ($spec$select539 | 0) != 0; + $214 = $spec$select539 - (($42 | 0) == 102 ? 0 : $$1517) + (($212 & $211) << 31 >> 31) | 0; + if (($214 | 0) < ((($$4502$lcssa - $132 >> 2) * 9 | 0) + -9 | 0)) { + $222 = $214 + 9216 | 0; + $223 = ($222 | 0) / 9 | 0; + $225 = $$0498 + 4 + ($223 + -1024 << 2) | 0; + $227 = $222 - ($223 * 9 | 0) | 0; + if (($227 | 0) < 8) { + $$0529$in646 = $227; + $$1533645 = 10; + while (1) { + $229 = $$1533645 * 10 | 0; + if (($$0529$in646 | 0) < 7) { + $$0529$in646 = $$0529$in646 + 1 | 0; + $$1533645 = $229; + } else { + $$1533$lcssa = $229; + break; + } + } + } else $$1533$lcssa = 10; + $231 = HEAP32[$225 >> 2] | 0; + $232 = ($231 >>> 0) / ($$1533$lcssa >>> 0) | 0; + $234 = $231 - (Math_imul($232, $$1533$lcssa) | 0) | 0; + $237 = ($225 + 4 | 0) == ($$4502$lcssa | 0); + if (!($237 & ($234 | 0) == 0)) { + $spec$select544 = ($232 & 1 | 0) == 0 ? 9007199254740992.0 : 9007199254740994.0; + $240 = $$1533$lcssa >>> 1; + $spec$select567 = $234 >>> 0 < $240 >>> 0 ? .5 : $237 & ($234 | 0) == ($240 | 0) ? 1.0 : 1.5; + if (!$$0522) { + $$1467 = $spec$select567; + $$1469 = $spec$select544; + } else { + $245 = (HEAP8[$$0523 >> 0] | 0) == 45; + $$1467 = $245 ? -$spec$select567 : $spec$select567; + $$1469 = $245 ? -$spec$select544 : $spec$select544; + } + $248 = $231 - $234 | 0; + HEAP32[$225 >> 2] = $248; + if ($$1469 + $$1467 != $$1469) { + $251 = $248 + $$1533$lcssa | 0; + HEAP32[$225 >> 2] = $251; + if ($251 >>> 0 > 999999999) { + $$2490638 = $225; + $$5486639 = $$3484$lcssa; + while (1) { + $253 = $$2490638 + -4 | 0; + HEAP32[$$2490638 >> 2] = 0; + if ($253 >>> 0 < $$5486639 >>> 0) { + $255 = $$5486639 + -4 | 0; + HEAP32[$255 >> 2] = 0; + $$6 = $255; + } else $$6 = $$5486639; + $257 = (HEAP32[$253 >> 2] | 0) + 1 | 0; + HEAP32[$253 >> 2] = $257; + if ($257 >>> 0 > 999999999) { + $$2490638 = $253; + $$5486639 = $$6; + } else { + $$2490$lcssa = $253; + $$5486$lcssa = $$6; + break; + } + } + } else { + $$2490$lcssa = $225; + $$5486$lcssa = $$3484$lcssa; + } + $262 = ($132 - $$5486$lcssa >> 2) * 9 | 0; + $263 = HEAP32[$$5486$lcssa >> 2] | 0; + if ($263 >>> 0 < 10) { + $$4492 = $$2490$lcssa; + $$4520 = $262; + $$8 = $$5486$lcssa; + } else { + $$2518634 = $262; + $$2534633 = 10; + while (1) { + $$2534633 = $$2534633 * 10 | 0; + $266 = $$2518634 + 1 | 0; + if ($263 >>> 0 < $$2534633 >>> 0) { + $$4492 = $$2490$lcssa; + $$4520 = $266; + $$8 = $$5486$lcssa; + break; + } else $$2518634 = $266; + } + } + } else { + $$4492 = $225; + $$4520 = $$1517; + $$8 = $$3484$lcssa; + } + } else { + $$4492 = $225; + $$4520 = $$1517; + $$8 = $$3484$lcssa; + } + $268 = $$4492 + 4 | 0; + $$5521 = $$4520; + $$8506 = $$4502$lcssa >>> 0 > $268 >>> 0 ? $268 : $$4502$lcssa; + $$9 = $$8; + } else { + $$5521 = $$1517; + $$8506 = $$4502$lcssa; + $$9 = $$3484$lcssa; + } + $270 = 0 - $$5521 | 0; + L109 : do if ($$8506 >>> 0 > $$9 >>> 0) { + $$9507625 = $$8506; + while (1) { + $273 = $$9507625 + -4 | 0; + if (HEAP32[$273 >> 2] | 0) { + $$9507$lcssa = $$9507625; + $$lcssa583 = 1; + break L109; + } + if ($273 >>> 0 > $$9 >>> 0) $$9507625 = $273; else { + $$9507$lcssa = $273; + $$lcssa583 = 0; + break; + } + } + } else { + $$9507$lcssa = $$8506; + $$lcssa583 = 0; + } while (0); + do if ($211) { + $spec$select548 = $spec$select539 + (($212 ^ 1) & 1) | 0; + if (($spec$select548 | 0) > ($$5521 | 0) & ($$5521 | 0) > -5) { + $$0479 = $5 + -1 | 0; + $$2476 = $spec$select548 + -1 - $$5521 | 0; + } else { + $$0479 = $5 + -2 | 0; + $$2476 = $spec$select548 + -1 | 0; + } + if (!($4 & 8)) { + if ($$lcssa583 ? ($286 = HEAP32[$$9507$lcssa + -4 >> 2] | 0, ($286 | 0) != 0) : 0) if (!(($286 >>> 0) % 10 | 0)) { + $$1530621 = 0; + $$3535620 = 10; + while (1) { + $$3535620 = $$3535620 * 10 | 0; + $291 = $$1530621 + 1 | 0; + if (($286 >>> 0) % ($$3535620 >>> 0) | 0 | 0) { + $$2531 = $291; + break; + } else $$1530621 = $291; + } + } else $$2531 = 0; else $$2531 = 9; + $300 = (($$9507$lcssa - $132 >> 2) * 9 | 0) + -9 | 0; + if (($$0479 | 32 | 0) == 102) { + $301 = $300 - $$2531 | 0; + $spec$select549 = ($301 | 0) > 0 ? $301 : 0; + $$1480 = $$0479; + $$3477 = ($$2476 | 0) < ($spec$select549 | 0) ? $$2476 : $spec$select549; + break; + } else { + $305 = $300 + $$5521 - $$2531 | 0; + $spec$select551 = ($305 | 0) > 0 ? $305 : 0; + $$1480 = $$0479; + $$3477 = ($$2476 | 0) < ($spec$select551 | 0) ? $$2476 : $spec$select551; + break; + } + } else { + $$1480 = $$0479; + $$3477 = $$2476; + } + } else { + $$1480 = $5; + $$3477 = $spec$select539; + } while (0); + $308 = ($$3477 | 0) != 0; + $310 = $308 ? 1 : $4 >>> 3 & 1; + $312 = ($$1480 | 32 | 0) == 102; + if ($312) { + $$2515 = 0; + $$pn = ($$5521 | 0) > 0 ? $$5521 : 0; + } else { + $316 = ($$5521 | 0) < 0 ? $270 : $$5521; + $319 = _fmt_u($316, (($316 | 0) < 0) << 31 >> 31, $11) | 0; + $320 = $11; + if (($320 - $319 | 0) < 2) { + $$1514614 = $319; + while (1) { + $324 = $$1514614 + -1 | 0; + HEAP8[$324 >> 0] = 48; + if (($320 - $324 | 0) < 2) $$1514614 = $324; else { + $$1514$lcssa = $324; + break; + } + } + } else $$1514$lcssa = $319; + HEAP8[$$1514$lcssa + -1 >> 0] = ($$5521 >> 31 & 2) + 43; + $334 = $$1514$lcssa + -2 | 0; + HEAP8[$334 >> 0] = $$1480; + $$2515 = $334; + $$pn = $320 - $334 | 0; + } + $339 = $$0522 + 1 + $$3477 + $310 + $$pn | 0; + _pad_667($0, 32, $2, $339, $4); + _out($0, $$0523, $$0522); + _pad_667($0, 48, $2, $339, $4 ^ 65536); + if ($312) { + $spec$select554 = $$9 >>> 0 > $$0498 >>> 0 ? $$0498 : $$9; + $342 = $8 + 9 | 0; + $343 = $342; + $344 = $8 + 8 | 0; + $$5493603 = $spec$select554; + do { + $346 = _fmt_u(HEAP32[$$5493603 >> 2] | 0, 0, $342) | 0; + if (($$5493603 | 0) == ($spec$select554 | 0)) if (($346 | 0) == ($342 | 0)) { + HEAP8[$344 >> 0] = 48; + $$1465 = $344; + } else $$1465 = $346; else if ($346 >>> 0 > $8 >>> 0) { + _memset($8 | 0, 48, $346 - $9 | 0) | 0; + $$0464599 = $346; + while (1) { + $351 = $$0464599 + -1 | 0; + if ($351 >>> 0 > $8 >>> 0) $$0464599 = $351; else { + $$1465 = $351; + break; + } + } + } else $$1465 = $346; + _out($0, $$1465, $343 - $$1465 | 0); + $$5493603 = $$5493603 + 4 | 0; + } while ($$5493603 >>> 0 <= $$0498 >>> 0); + if (!(($4 & 8 | 0) == 0 & ($308 ^ 1))) _out($0, 53642, 1); + if ($$5493603 >>> 0 < $$9507$lcssa >>> 0 & ($$3477 | 0) > 0) { + $$4478594 = $$3477; + $$6494593 = $$5493603; + while (1) { + $364 = _fmt_u(HEAP32[$$6494593 >> 2] | 0, 0, $342) | 0; + if ($364 >>> 0 > $8 >>> 0) { + _memset($8 | 0, 48, $364 - $9 | 0) | 0; + $$0463588 = $364; + while (1) { + $368 = $$0463588 + -1 | 0; + if ($368 >>> 0 > $8 >>> 0) $$0463588 = $368; else { + $$0463$lcssa = $368; + break; + } + } + } else $$0463$lcssa = $364; + _out($0, $$0463$lcssa, ($$4478594 | 0) < 9 ? $$4478594 : 9); + $$6494593 = $$6494593 + 4 | 0; + $373 = $$4478594 + -9 | 0; + if (!($$6494593 >>> 0 < $$9507$lcssa >>> 0 & ($$4478594 | 0) > 9)) { + $$4478$lcssa = $373; + break; + } else $$4478594 = $373; + } + } else $$4478$lcssa = $$3477; + _pad_667($0, 48, $$4478$lcssa + 9 | 0, 9, 0); + } else { + $spec$select557 = $$lcssa583 ? $$9507$lcssa : $$9 + 4 | 0; + if ($$9 >>> 0 < $spec$select557 >>> 0 & ($$3477 | 0) > -1) { + $382 = $8 + 9 | 0; + $384 = ($4 & 8 | 0) == 0; + $385 = $382; + $386 = 0 - $9 | 0; + $387 = $8 + 8 | 0; + $$5609 = $$3477; + $$7495608 = $$9; + while (1) { + $389 = _fmt_u(HEAP32[$$7495608 >> 2] | 0, 0, $382) | 0; + if (($389 | 0) == ($382 | 0)) { + HEAP8[$387 >> 0] = 48; + $$0 = $387; + } else $$0 = $389; + do if (($$7495608 | 0) == ($$9 | 0)) { + $395 = $$0 + 1 | 0; + _out($0, $$0, 1); + if ($384 & ($$5609 | 0) < 1) { + $$2 = $395; + break; + } + _out($0, 53642, 1); + $$2 = $395; + } else { + if ($$0 >>> 0 <= $8 >>> 0) { + $$2 = $$0; + break; + } + _memset($8 | 0, 48, $$0 + $386 | 0) | 0; + $$1604 = $$0; + while (1) { + $393 = $$1604 + -1 | 0; + if ($393 >>> 0 > $8 >>> 0) $$1604 = $393; else { + $$2 = $393; + break; + } + } + } while (0); + $398 = $385 - $$2 | 0; + _out($0, $$2, ($$5609 | 0) > ($398 | 0) ? $398 : $$5609); + $401 = $$5609 - $398 | 0; + $$7495608 = $$7495608 + 4 | 0; + if (!($$7495608 >>> 0 < $spec$select557 >>> 0 & ($401 | 0) > -1)) { + $$5$lcssa = $401; + break; + } else $$5609 = $401; + } + } else $$5$lcssa = $$3477; + _pad_667($0, 48, $$5$lcssa + 18 | 0, 18, 0); + _out($0, $$2515, $11 - $$2515 | 0); + } + _pad_667($0, 32, $2, $339, $4 ^ 8192); + $$sink757 = $339; + } while (0); + STACKTOP = sp; + return (($$sink757 | 0) < ($2 | 0) ? $2 : $$sink757) | 0; +} + +function _decfloat($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0324 = 0, $$0324$be = 0, $$0327480 = 0, $$0328 = 0, $$0329 = 0, $$0331476 = 0, $$0335486 = 0, $$0336$lcssa = 0, $$0336453 = 0, $$0336454 = 0, $$0336455 = 0, $$0336503 = 0, $$0340$lcssa = 0, $$0340457 = 0, $$0340458 = 0, $$0340459 = 0, $$0340502 = 0, $$0345$lcssa540 = 0, $$0345484 = 0, $$0355 = 0.0, $$0356 = 0.0, $$0360474 = 0.0, $$0367 = 0, $$0376 = 0, $$0376$ph = 0, $$0381$lcssa539 = 0, $$0381483 = 0, $$0390 = 0, $$0393 = 0, $$0398$lcssa = 0, $$0398463 = 0, $$0398464 = 0, $$0398465 = 0, $$0398499 = 0, $$1 = 0.0, $$10473 = 0, $$11 = 0, $$1330 = 0, $$1357 = 0.0, $$1361 = 0.0, $$1377 = 0, $$1377$ph = 0, $$1377$ph$ph = 0, $$1391$lcssa = 0, $$1391501 = 0, $$2 = 0, $$2338 = 0, $$2342 = 0, $$2362 = 0.0, $$2369 = 0, $$2369$ph = 0, $$2369$ph579 = 0, $$2392 = 0, $$2395 = 0, $$2400 = 0, $$3$lcssa = 0, $$3339493 = 0, $$3343 = 0, $$3348$ph = 0, $$3348$ph580 = 0, $$3359 = 0.0, $$3363 = 0.0, $$3370 = 0, $$3379 = 0, $$3384$ph = 0, $$3384$ph578 = 0, $$3396$lcssa = 0, $$3396500 = 0, $$3504 = 0, $$4344485 = 0, $$4380 = 0, $$4397 = 0, $$4475 = 0, $$5 = 0, $$5$in = 0, $$5350 = 0, $$5350$ph = 0, $$5350$ph$ph = 0, $$5372 = 0, $$5386$ph = 0, $$5386$ph576 = 0, $$5386$ph576$ph = 0, $$6351478 = 0, $$6387477 = 0, $$6479 = 0, $$7374$ph$ph = 0, $$pre = 0, $$sink$off0 = 0, $10 = 0, $104 = 0, $105 = 0, $11 = 0, $110 = 0, $111 = 0, $113 = 0, $114 = 0, $127 = 0, $129 = 0, $135 = 0, $139 = 0, $141 = 0, $147 = 0, $153 = 0, $155 = 0, $177 = 0, $18 = 0, $189 = 0, $193 = 0, $196 = 0, $198 = 0, $199 = 0, $200 = 0, $201 = 0, $203 = 0, $204 = 0, $218 = 0, $219 = 0, $220 = 0, $224 = 0, $226 = 0, $228 = 0, $229 = 0, $235 = 0, $237 = 0, $239 = 0, $244 = 0, $247 = 0, $251 = 0, $254 = 0, $257 = 0, $26 = 0, $264 = 0, $267 = 0, $269 = 0, $27 = 0, $274 = 0, $277 = 0, $278 = 0, $279 = 0, $28 = 0, $280 = 0, $283 = 0, $29 = 0, $294 = 0, $297 = 0, $30 = 0, $302 = 0, $306 = 0, $309 = 0, $31 = 0, $318 = 0.0, $319 = 0.0, $320 = 0, $321 = 0, $322 = 0, $327 = 0.0, $330 = 0.0, $334 = 0, $337 = 0, $361 = 0.0, $366 = 0, $373 = 0, $375 = 0, $376 = 0, $377 = 0, $378 = 0, $379 = 0, $380 = 0, $381 = 0, $382 = 0, $383 = 0, $384 = 0, $385 = 0, $386 = 0, $387 = 0, $388 = 0, $389 = 0, $39 = 0, $390 = 0, $391 = 0, $392 = 0, $393 = 0, $394 = 0, $40 = 0, $42 = 0, $44 = 0, $47 = 0, $48 = 0, $49 = 0, $50 = 0, $51 = 0, $53 = 0, $58 = 0, $59 = 0, $6 = 0, $63 = 0, $7 = 0, $71 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $85 = 0, $86 = 0, $9 = 0, $95 = 0, $96 = 0, $97 = 0, $or$cond417 = 0, $or$cond421 = 0, $spec$select420 = 0, $spec$select441 = 0, $storemerge446 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 512 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(512); + $6 = sp; + $7 = $3 + $2 | 0; + $8 = 0 - $7 | 0; + $9 = $0 + 4 | 0; + $10 = $0 + 104 | 0; + $$0324 = $1; + $$0393 = 0; + L1 : while (1) { + switch ($$0324 | 0) { + case 46: + { + label = 7; + break L1; + break; + } + case 48: + break; + default: + { + $$0390 = 0; + $$2 = $$0324; + $$2395 = $$0393; + $375 = 0; + $376 = 0; + break L1; + } + } + $11 = HEAP32[$9 >> 2] | 0; + if ($11 >>> 0 < (HEAP32[$10 >> 2] | 0) >>> 0) { + HEAP32[$9 >> 2] = $11 + 1; + $$0324$be = HEAPU8[$11 >> 0] | 0; + } else $$0324$be = ___shgetc($0) | 0; + $$0324 = $$0324$be; + $$0393 = 1; + } + if ((label | 0) == 7) { + $18 = HEAP32[$9 >> 2] | 0; + if ($18 >>> 0 < (HEAP32[$10 >> 2] | 0) >>> 0) { + HEAP32[$9 >> 2] = $18 + 1; + $26 = HEAPU8[$18 >> 0] | 0; + } else $26 = ___shgetc($0) | 0; + if (($26 | 0) == 48) { + $27 = 0; + $28 = 0; + while (1) { + $29 = _i64Add($27 | 0, $28 | 0, -1, -1) | 0; + $30 = getTempRet0() | 0; + $31 = HEAP32[$9 >> 2] | 0; + if ($31 >>> 0 < (HEAP32[$10 >> 2] | 0) >>> 0) { + HEAP32[$9 >> 2] = $31 + 1; + $39 = HEAPU8[$31 >> 0] | 0; + } else $39 = ___shgetc($0) | 0; + if (($39 | 0) == 48) { + $27 = $29; + $28 = $30; + } else { + $$0390 = 1; + $$2 = $39; + $$2395 = 1; + $375 = $29; + $376 = $30; + break; + } + } + } else { + $$0390 = 1; + $$2 = $26; + $$2395 = $$0393; + $375 = 0; + $376 = 0; + } + } + HEAP32[$6 >> 2] = 0; + $40 = $$2 + -48 | 0; + $42 = ($$2 | 0) == 46; + L22 : do if ($42 | $40 >>> 0 < 10) { + $44 = $6 + 496 | 0; + $$0336503 = 0; + $$0340502 = 0; + $$0398499 = 0; + $$1391501 = $$0390; + $$3396500 = $$2395; + $$3504 = $$2; + $377 = $42; + $378 = $40; + $379 = $375; + $380 = $376; + $47 = 0; + $48 = 0; + L24 : while (1) { + do if ($377) if (!$$1391501) { + $$2338 = $$0336503; + $$2342 = $$0340502; + $$2392 = 1; + $$2400 = $$0398499; + $$4397 = $$3396500; + $381 = $47; + $382 = $48; + $383 = $47; + $384 = $48; + } else break L24; else { + $49 = _i64Add($47 | 0, $48 | 0, 1, 0) | 0; + $50 = getTempRet0() | 0; + $51 = ($$3504 | 0) != 48; + if (($$0340502 | 0) >= 125) { + if (!$51) { + $$2338 = $$0336503; + $$2342 = $$0340502; + $$2392 = $$1391501; + $$2400 = $$0398499; + $$4397 = $$3396500; + $381 = $379; + $382 = $380; + $383 = $49; + $384 = $50; + break; + } + HEAP32[$44 >> 2] = HEAP32[$44 >> 2] | 1; + $$2338 = $$0336503; + $$2342 = $$0340502; + $$2392 = $$1391501; + $$2400 = $$0398499; + $$4397 = $$3396500; + $381 = $379; + $382 = $380; + $383 = $49; + $384 = $50; + break; + } + $53 = $6 + ($$0340502 << 2) | 0; + if (!$$0336503) $storemerge446 = $378; else $storemerge446 = $$3504 + -48 + ((HEAP32[$53 >> 2] | 0) * 10 | 0) | 0; + HEAP32[$53 >> 2] = $storemerge446; + $58 = $$0336503 + 1 | 0; + $59 = ($58 | 0) == 9; + $$2338 = $59 ? 0 : $58; + $$2342 = $$0340502 + ($59 & 1) | 0; + $$2392 = $$1391501; + $$2400 = $51 ? $49 : $$0398499; + $$4397 = 1; + $381 = $379; + $382 = $380; + $383 = $49; + $384 = $50; + } while (0); + $63 = HEAP32[$9 >> 2] | 0; + if ($63 >>> 0 < (HEAP32[$10 >> 2] | 0) >>> 0) { + HEAP32[$9 >> 2] = $63 + 1; + $71 = HEAPU8[$63 >> 0] | 0; + } else $71 = ___shgetc($0) | 0; + $378 = $71 + -48 | 0; + $377 = ($71 | 0) == 46; + if (!($377 | $378 >>> 0 < 10)) { + $$0336$lcssa = $$2338; + $$0340$lcssa = $$2342; + $$0398$lcssa = $$2400; + $$1391$lcssa = $$2392; + $$3$lcssa = $71; + $$3396$lcssa = $$4397; + $77 = $383; + $78 = $381; + $80 = $384; + $81 = $382; + label = 31; + break L22; + } else { + $$0336503 = $$2338; + $$0340502 = $$2342; + $$0398499 = $$2400; + $$1391501 = $$2392; + $$3396500 = $$4397; + $$3504 = $71; + $379 = $381; + $380 = $382; + $47 = $383; + $48 = $384; + } + } + $$0336455 = $$0336503; + $$0340459 = $$0340502; + $$0398465 = $$0398499; + $385 = $47; + $386 = $48; + $387 = $379; + $388 = $380; + $389 = ($$3396500 | 0) != 0; + label = 39; + } else { + $$0336$lcssa = 0; + $$0340$lcssa = 0; + $$0398$lcssa = 0; + $$1391$lcssa = $$0390; + $$3$lcssa = $$2; + $$3396$lcssa = $$2395; + $77 = 0; + $78 = $375; + $80 = 0; + $81 = $376; + label = 31; + } while (0); + do if ((label | 0) == 31) { + $75 = ($$1391$lcssa | 0) == 0; + $76 = $75 ? $77 : $78; + $79 = $75 ? $80 : $81; + $82 = ($$3396$lcssa | 0) != 0; + if (!($82 & ($$3$lcssa | 32 | 0) == 101)) if (($$3$lcssa | 0) > -1) { + $$0336455 = $$0336$lcssa; + $$0340459 = $$0340$lcssa; + $$0398465 = $$0398$lcssa; + $385 = $77; + $386 = $80; + $387 = $76; + $388 = $79; + $389 = $82; + label = 39; + break; + } else { + $$0336454 = $$0336$lcssa; + $$0340458 = $$0340$lcssa; + $$0398464 = $$0398$lcssa; + $390 = $77; + $391 = $80; + $392 = $82; + $393 = $76; + $394 = $79; + label = 41; + break; + } + $85 = _scanexp($0, $5) | 0; + $86 = getTempRet0() | 0; + if (($85 | 0) == 0 & ($86 | 0) == -2147483648) { + if (!$5) { + ___shlim($0, 0, 0); + $$1 = 0.0; + break; + } + if (!(HEAP32[$10 >> 2] | 0)) { + $95 = 0; + $96 = 0; + } else { + HEAP32[$9 >> 2] = (HEAP32[$9 >> 2] | 0) + -1; + $95 = 0; + $96 = 0; + } + } else { + $95 = $85; + $96 = $86; + } + $97 = _i64Add($95 | 0, $96 | 0, $76 | 0, $79 | 0) | 0; + $$0336453 = $$0336$lcssa; + $$0340457 = $$0340$lcssa; + $$0398463 = $$0398$lcssa; + $110 = $97; + $111 = $77; + $113 = getTempRet0() | 0; + $114 = $80; + label = 43; + } while (0); + if ((label | 0) == 39) if (HEAP32[$10 >> 2] | 0) { + HEAP32[$9 >> 2] = (HEAP32[$9 >> 2] | 0) + -1; + if ($389) { + $$0336453 = $$0336455; + $$0340457 = $$0340459; + $$0398463 = $$0398465; + $110 = $387; + $111 = $385; + $113 = $388; + $114 = $386; + label = 43; + } else label = 42; + } else { + $$0336454 = $$0336455; + $$0340458 = $$0340459; + $$0398464 = $$0398465; + $390 = $385; + $391 = $386; + $392 = $389; + $393 = $387; + $394 = $388; + label = 41; + } + if ((label | 0) == 41) if ($392) { + $$0336453 = $$0336454; + $$0340457 = $$0340458; + $$0398463 = $$0398464; + $110 = $393; + $111 = $390; + $113 = $394; + $114 = $391; + label = 43; + } else label = 42; + do if ((label | 0) == 42) { + $104 = ___errno_location() | 0; + HEAP32[$104 >> 2] = 28; + ___shlim($0, 0, 0); + $$1 = 0.0; + } else if ((label | 0) == 43) { + $105 = HEAP32[$6 >> 2] | 0; + if (!$105) { + $$1 = +($4 | 0) * 0.0; + break; + } + if ((($114 | 0) < 0 | ($114 | 0) == 0 & $111 >>> 0 < 10) & (($110 | 0) == ($111 | 0) & ($113 | 0) == ($114 | 0)) ? ($2 | 0) > 30 | ($105 >>> $2 | 0) == 0 : 0) { + $$1 = +($4 | 0) * +($105 >>> 0); + break; + } + $127 = ($3 | 0) / -2 | 0; + $129 = (($127 | 0) < 0) << 31 >> 31; + if (($113 | 0) > ($129 | 0) | ($113 | 0) == ($129 | 0) & $110 >>> 0 > $127 >>> 0) { + $135 = ___errno_location() | 0; + HEAP32[$135 >> 2] = 68; + $$1 = +($4 | 0) * 1797693134862315708145274.0e284 * 1797693134862315708145274.0e284; + break; + } + $139 = $3 + -106 | 0; + $141 = (($139 | 0) < 0) << 31 >> 31; + if (($113 | 0) < ($141 | 0) | ($113 | 0) == ($141 | 0) & $110 >>> 0 < $139 >>> 0) { + $147 = ___errno_location() | 0; + HEAP32[$147 >> 2] = 68; + $$1 = +($4 | 0) * 2.2250738585072014e-308 * 2.2250738585072014e-308; + break; + } + if (!$$0336453) $$3343 = $$0340457; else { + if (($$0336453 | 0) < 9) { + $153 = $6 + ($$0340457 << 2) | 0; + $$3339493 = $$0336453; + $155 = HEAP32[$153 >> 2] | 0; + while (1) { + $155 = $155 * 10 | 0; + if (($$3339493 | 0) >= 8) break; else $$3339493 = $$3339493 + 1 | 0; + } + HEAP32[$153 >> 2] = $155; + } + $$3343 = $$0340457 + 1 | 0; + } + if (($$0398463 | 0) < 9 ? ($$0398463 | 0) <= ($110 | 0) & ($110 | 0) < 18 : 0) { + if (($110 | 0) == 9) { + $$1 = +($4 | 0) * +((HEAP32[$6 >> 2] | 0) >>> 0); + break; + } + if (($110 | 0) < 9) { + $$1 = +($4 | 0) * +((HEAP32[$6 >> 2] | 0) >>> 0) / +(HEAP32[12432 + (8 - $110 << 2) >> 2] | 0); + break; + } + $177 = $2 + 27 + (Math_imul($110, -3) | 0) | 0; + $$pre = HEAP32[$6 >> 2] | 0; + if (($177 | 0) > 30 | ($$pre >>> $177 | 0) == 0) { + $$1 = +($4 | 0) * +($$pre >>> 0) * +(HEAP32[12432 + ($110 + -10 << 2) >> 2] | 0); + break; + } + } + $189 = ($110 | 0) % 9 | 0; + if (!$189) { + $$2369$ph = $$3343; + $$3348$ph = 0; + $$3384$ph = $110; + } else { + $193 = ($110 | 0) > -1 ? $189 : $189 + 9 | 0; + $196 = HEAP32[12432 + (8 - $193 << 2) >> 2] | 0; + if ($$3343) { + $198 = 1e9 / ($196 | 0) | 0; + $$0335486 = 0; + $$0345484 = 0; + $$0381483 = $110; + $$4344485 = 0; + do { + $199 = $6 + ($$4344485 << 2) | 0; + $200 = HEAP32[$199 >> 2] | 0; + $201 = ($200 >>> 0) / ($196 >>> 0) | 0; + $203 = $200 - (Math_imul($201, $196) | 0) | 0; + $204 = $201 + $$0335486 | 0; + HEAP32[$199 >> 2] = $204; + $$0335486 = Math_imul($198, $203) | 0; + $or$cond417 = ($$4344485 | 0) == ($$0345484 | 0) & ($204 | 0) == 0; + $$0381483 = $or$cond417 ? $$0381483 + -9 | 0 : $$0381483; + $$0345484 = $or$cond417 ? $$0345484 + 1 & 127 : $$0345484; + $$4344485 = $$4344485 + 1 | 0; + } while (($$4344485 | 0) != ($$3343 | 0)); + if (!$$0335486) { + $$0345$lcssa540 = $$0345484; + $$0367 = $$3343; + $$0381$lcssa539 = $$0381483; + } else { + HEAP32[$6 + ($$3343 << 2) >> 2] = $$0335486; + $$0345$lcssa540 = $$0345484; + $$0367 = $$3343 + 1 | 0; + $$0381$lcssa539 = $$0381483; + } + } else { + $$0345$lcssa540 = 0; + $$0367 = 0; + $$0381$lcssa539 = $110; + } + $$2369$ph = $$0367; + $$3348$ph = $$0345$lcssa540; + $$3384$ph = 9 - $193 + $$0381$lcssa539 | 0; + } + $$0376$ph = 0; + $$2369$ph579 = $$2369$ph; + $$3348$ph580 = $$3348$ph; + $$3384$ph578 = $$3384$ph; + L104 : while (1) { + $218 = ($$3384$ph578 | 0) < 18; + $219 = ($$3384$ph578 | 0) == 18; + $220 = $6 + ($$3348$ph580 << 2) | 0; + $$0376 = $$0376$ph; + $$2369 = $$2369$ph579; + while (1) { + if (!$218) { + if (!$219) { + $$5386$ph = $$3384$ph578; + break L104; + } + if ((HEAP32[$220 >> 2] | 0) >>> 0 >= 9007199) { + $$5386$ph = 18; + break L104; + } + } + $$0329 = 0; + $$3370 = $$2369; + $$5$in = $$2369 + 127 | 0; + while (1) { + $$5 = $$5$in & 127; + $224 = $6 + ($$5 << 2) | 0; + $226 = _bitshift64Shl(HEAP32[$224 >> 2] | 0, 0, 29) | 0; + $228 = _i64Add($226 | 0, getTempRet0() | 0, $$0329 | 0, 0) | 0; + $229 = getTempRet0() | 0; + if ($229 >>> 0 > 0 | ($229 | 0) == 0 & $228 >>> 0 > 1e9) { + $235 = ___udivdi3($228 | 0, $229 | 0, 1e9, 0) | 0; + $237 = ___muldi3($235 | 0, getTempRet0() | 0, 1e9, 0) | 0; + $239 = _i64Subtract($228 | 0, $229 | 0, $237 | 0, getTempRet0() | 0) | 0; + getTempRet0() | 0; + $$1330 = $235; + $$sink$off0 = $239; + } else { + $$1330 = 0; + $$sink$off0 = $228; + } + HEAP32[$224 >> 2] = $$sink$off0; + $244 = ($$5 | 0) == ($$3348$ph580 | 0); + $spec$select441 = ($$5 | 0) != ($$3370 + 127 & 127 | 0) | $244 ? $$3370 : ($$sink$off0 | 0) == 0 ? $$5 : $$3370; + if ($244) break; else { + $$0329 = $$1330; + $$3370 = $spec$select441; + $$5$in = $$5 + -1 | 0; + } + } + $247 = $$0376 + -29 | 0; + if (!$$1330) { + $$0376 = $247; + $$2369 = $$3370; + } else break; + } + $251 = $$3348$ph580 + 127 & 127; + $254 = $spec$select441 + 127 & 127; + $257 = $6 + (($spec$select441 + 126 & 127) << 2) | 0; + if (($251 | 0) == ($spec$select441 | 0)) { + HEAP32[$257 >> 2] = HEAP32[$257 >> 2] | HEAP32[$6 + ($254 << 2) >> 2]; + $$5372 = $254; + } else $$5372 = $$3370; + HEAP32[$6 + ($251 << 2) >> 2] = $$1330; + $$0376$ph = $247; + $$2369$ph579 = $$5372; + $$3348$ph580 = $251; + $$3384$ph578 = $$3384$ph578 + 9 | 0; + } + $$1377$ph$ph = $$0376; + $$5350$ph$ph = $$3348$ph580; + $$5386$ph576$ph = $$5386$ph; + $$7374$ph$ph = $$2369; + L123 : while (1) { + $297 = $$7374$ph$ph + 1 & 127; + $302 = $6 + (($$7374$ph$ph + 127 & 127) << 2) | 0; + $$1377$ph = $$1377$ph$ph; + $$5350$ph = $$5350$ph$ph; + $$5386$ph576 = $$5386$ph576$ph; + while (1) { + $294 = ($$5386$ph576 | 0) == 18; + $spec$select420 = ($$5386$ph576 | 0) > 27 ? 9 : 1; + $$1377 = $$1377$ph; + $$5350 = $$5350$ph; + while (1) { + $$0331476 = 0; + while (1) { + $264 = $$0331476 + $$5350 & 127; + if (($264 | 0) == ($$7374$ph$ph | 0)) { + label = 92; + break; + } + $267 = HEAP32[$6 + ($264 << 2) >> 2] | 0; + $269 = HEAP32[17356 + ($$0331476 << 2) >> 2] | 0; + if ($267 >>> 0 < $269 >>> 0) { + label = 92; + break; + } + if ($267 >>> 0 > $269 >>> 0) break; + if (($$0331476 + 1 | 0) >>> 0 < 2) $$0331476 = 1; else { + label = 92; + break; + } + } + if ((label | 0) == 92 ? (label = 0, $294) : 0) break L123; + $274 = $spec$select420 + $$1377 | 0; + if (($$5350 | 0) == ($$7374$ph$ph | 0)) { + $$1377 = $274; + $$5350 = $$7374$ph$ph; + } else break; + } + $277 = (1 << $spec$select420) + -1 | 0; + $278 = 1e9 >>> $spec$select420; + $$0327480 = 0; + $$6351478 = $$5350; + $$6387477 = $$5386$ph576; + $$6479 = $$5350; + do { + $279 = $6 + ($$6479 << 2) | 0; + $280 = HEAP32[$279 >> 2] | 0; + $283 = ($280 >>> $spec$select420) + $$0327480 | 0; + HEAP32[$279 >> 2] = $283; + $$0327480 = Math_imul($280 & $277, $278) | 0; + $or$cond421 = ($$6479 | 0) == ($$6351478 | 0) & ($283 | 0) == 0; + $$6387477 = $or$cond421 ? $$6387477 + -9 | 0 : $$6387477; + $$6351478 = $or$cond421 ? $$6351478 + 1 & 127 : $$6351478; + $$6479 = $$6479 + 1 & 127; + } while (($$6479 | 0) != ($$7374$ph$ph | 0)); + if ($$0327480 | 0) { + if (($297 | 0) != ($$6351478 | 0)) break; + HEAP32[$302 >> 2] = HEAP32[$302 >> 2] | 1; + } + $$1377$ph = $274; + $$5350$ph = $$6351478; + $$5386$ph576 = $$6387477; + } + HEAP32[$6 + ($$7374$ph$ph << 2) >> 2] = $$0327480; + $$1377$ph$ph = $274; + $$5350$ph$ph = $$6351478; + $$5386$ph576$ph = $$6387477; + $$7374$ph$ph = $297; + } + $$0360474 = 0.0; + $$10473 = $$7374$ph$ph; + $$4475 = 0; + while (1) { + $306 = $$4475 + $$5350 & 127; + $309 = $$10473 + 1 & 127; + if (($306 | 0) == ($$10473 | 0)) { + HEAP32[$6 + ($309 + -1 << 2) >> 2] = 0; + $$11 = $309; + } else $$11 = $$10473; + $$0360474 = $$0360474 * 1.0e9 + +((HEAP32[$6 + ($306 << 2) >> 2] | 0) >>> 0); + $$4475 = $$4475 + 1 | 0; + if (($$4475 | 0) == 2) break; else $$10473 = $$11; + } + $318 = +($4 | 0); + $319 = $$0360474 * $318; + $320 = $$1377 + 53 | 0; + $321 = $320 - $3 | 0; + $322 = ($321 | 0) < ($2 | 0); + $$0328 = $322 ? (($321 | 0) > 0 ? $321 : 0) : $2; + if (($$0328 | 0) < 53) { + $327 = +_copysignl(+_scalbn(1.0, 105 - $$0328 | 0), $319); + $330 = +_fmodl($319, +_scalbn(1.0, 53 - $$0328 | 0)); + $$0355 = $327; + $$0356 = $330; + $$1361 = $327 + ($319 - $330); + } else { + $$0355 = 0.0; + $$0356 = 0.0; + $$1361 = $319; + } + $334 = $$5350 + 2 & 127; + if (($334 | 0) != ($$11 | 0)) { + $337 = HEAP32[$6 + ($334 << 2) >> 2] | 0; + do if ($337 >>> 0 >= 5e8) { + if (($337 | 0) != 5e8) { + $$1357 = $318 * .75 + $$0356; + break; + } + if (($$5350 + 3 & 127 | 0) == ($$11 | 0)) { + $$1357 = $318 * .5 + $$0356; + break; + } else { + $$1357 = $318 * .75 + $$0356; + break; + } + } else { + if (($337 | 0) == 0 ? ($$5350 + 3 & 127 | 0) == ($$11 | 0) : 0) { + $$1357 = $$0356; + break; + } + $$1357 = $318 * .25 + $$0356; + } while (0); + if ((53 - $$0328 | 0) > 1 ? !(+_fmodl($$1357, 1.0) != 0.0) : 0) $$3359 = $$1357 + 1.0; else $$3359 = $$1357; + } else $$3359 = $$0356; + $361 = $$1361 + $$3359 - $$0355; + do if (($320 & 2147483647 | 0) > (-2 - $7 | 0)) { + $366 = !(+Math_abs(+$361) >= 9007199254740992.0); + $$3379 = $$1377 + (($366 ^ 1) & 1) | 0; + $$2362 = $366 ? $361 : $361 * .5; + if (($$3379 + 50 | 0) <= ($8 | 0) ? !($$3359 != 0.0 & ($322 & (($$0328 | 0) != ($321 | 0) | $366))) : 0) { + $$3363 = $$2362; + $$4380 = $$3379; + break; + } + $373 = ___errno_location() | 0; + HEAP32[$373 >> 2] = 68; + $$3363 = $$2362; + $$4380 = $$3379; + } else { + $$3363 = $361; + $$4380 = $$1377; + } while (0); + $$1 = +_scalbnl($$3363, $$4380); + } while (0); + STACKTOP = sp; + return +$$1; +} + +function _arDetectMarker($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$0440 = 0, $$0442 = 0, $$0447 = 0, $$0452 = 0, $$0456 = 0, $$0458 = 0.0, $$0462 = 0.0, $$0464 = 0.0, $$1441 = 0, $$1443 = 0, $$1448 = 0, $$1453 = 0, $$1457 = 0, $$1459 = 0.0, $$1463 = 0.0, $$1465 = 0.0, $$2444 = 0, $$2449 = 0, $$2454 = 0, $$2460 = 0.0, $$3445 = 0, $$3450 = 0, $$3455 = 0, $$4 = 0, $$4446 = 0, $$4451 = 0, $$5 = 0, $$6 = 0, $$pre$phi495Z2D = 0, $$pre$phi501Z2D = 0, $$pre$phi503Z2D = 0, $$pre$phi505Z2D = 0, $$pre$phiZ2D = 0, $$pre486 = 0, $$pre487 = 0, $$pre488 = 0, $10 = 0, $100 = 0, $11 = 0, $111 = 0, $112 = 0, $114 = 0, $116 = 0, $119 = 0, $127 = 0, $129 = 0, $131 = 0, $132 = 0, $137 = 0, $139 = 0, $14 = 0, $145 = 0, $148 = 0, $15 = 0, $159 = 0, $16 = 0, $161 = 0, $168 = 0, $170 = 0, $176 = 0, $177 = 0, $18 = 0, $2 = 0, $20 = 0, $201 = 0, $204 = 0, $205 = 0, $206 = 0, $208 = 0, $209 = 0, $210 = 0, $211 = 0, $217 = 0.0, $218 = 0.0, $22 = 0, $224 = 0.0, $229 = 0.0, $232 = 0.0, $236 = 0, $237 = 0, $240 = 0.0, $243 = 0, $245 = 0, $249 = 0, $252 = 0.0, $258 = 0.0, $26 = 0, $27 = 0, $276 = 0, $279 = 0.0, $28 = 0, $281 = 0, $284 = 0.0, $289 = 0.0, $29 = 0, $296 = 0, $299 = 0.0, $3 = 0, $30 = 0, $305 = 0.0, $31 = 0, $310 = 0, $314 = 0, $32 = 0, $326 = 0, $327 = 0, $33 = 0, $336 = 0, $338 = 0, $34 = 0, $341 = 0, $348 = 0, $35 = 0, $355 = 0, $356 = 0, $357 = 0, $358 = 0, $36 = 0, $360 = 0, $365 = 0.0, $366 = 0.0, $37 = 0, $372 = 0.0, $377 = 0.0, $38 = 0, $386 = 0, $388 = 0, $389 = 0, $39 = 0, $390 = 0, $40 = 0, $6 = 0, $7 = 0, $77 = 0, $79 = 0, $8 = 0, $80 = 0, $82 = 0, $83 = 0, $85 = 0, $86 = 0, $88 = 0, $91 = 0, $94 = 0, $97 = 0, $99 = 0, $spec$select = 0, $storemerge = 0, $storemerge466 = 0, $vararg_buffer = 0, $vararg_buffer6 = 0, $vararg_buffer9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $vararg_buffer9 = sp + 32 | 0; + $vararg_buffer6 = sp + 24 | 0; + $vararg_buffer = sp; + $2 = sp + 52 | 0; + $3 = sp + 40 | 0; + L1 : do if (($0 | 0) != 0 & ($1 | 0) != 0) { + $6 = $0 + 44 | 0; + HEAP32[$6 >> 2] = 0; + $7 = $0 + 7062388 | 0; + $8 = HEAP32[$7 >> 2] | 0; + L3 : do if (($8 | 0) == 4) { + $10 = $0 + 7062396 | 0; + $11 = HEAP32[$10 >> 2] | 0; + do if (($11 | 0) > 0) HEAP32[$10 >> 2] = $11 + -1; else { + $14 = $0 + 16 | 0; + $15 = HEAP32[$14 >> 2] | 0; + $16 = $0 + 7062400 | 0; + $18 = (HEAP32[$16 >> 2] | 0) + $15 | 0; + $spec$select = ($18 | 0) < 255 ? $18 : 255; + HEAP32[$2 >> 2] = $spec$select; + $20 = $0 + 7062404 | 0; + $22 = $15 - (HEAP32[$20 >> 2] | 0) | 0; + $storemerge466 = ($22 | 0) > 0 ? $22 : 0; + HEAP32[$2 + 4 >> 2] = $storemerge466; + HEAP32[$2 + 8 >> 2] = $15; + $26 = $1 + 12 | 0; + $27 = $0 + 36 | 0; + $28 = $0 + 40 | 0; + $29 = $0 + 12 | 0; + $30 = $0 + 20 | 0; + $31 = $0 + 4834144 | 0; + $32 = $0 + 15416 | 0; + $33 = $0 + 15408 | 0; + $34 = $0 + 4 | 0; + $35 = $0 + 7062384 | 0; + $36 = $0 + 24 | 0; + $37 = $0 + 32 | 0; + $38 = $0 + 7062416 | 0; + $39 = $0 + 48 | 0; + $40 = $0 + 7062424 | 0; + $$0447 = 0; + while (1) { + if ($$0447 >>> 0 >= 3) break; + if ((_arLabeling(HEAP32[$26 >> 2] | 0, HEAP32[$27 >> 2] | 0, HEAP32[$28 >> 2] | 0, HEAP32[$0 >> 2] | 0, HEAP32[$29 >> 2] | 0, HEAP32[$2 + ($$0447 << 2) >> 2] | 0, HEAP32[$30 >> 2] | 0, $31, 0) | 0) < 0) { + label = 29; + break; + } + if ((_arDetectMarker2(HEAP32[$27 >> 2] | 0, HEAP32[$28 >> 2] | 0, $31, HEAP32[$30 >> 2] | 0, 1e6, 70, 1.0, $32, $33) | 0) < 0) { + label = 29; + break; + } + if ((_arGetMarkerInfo(HEAP32[$1 >> 2] | 0, HEAP32[$27 >> 2] | 0, HEAP32[$28 >> 2] | 0, HEAP32[$34 >> 2] | 0, $32, HEAP32[$33 >> 2] | 0, HEAP32[$35 >> 2] | 0, HEAP32[$30 >> 2] | 0, HEAP32[$36 >> 2] | 0, (HEAP32[$37 >> 2] | 0) + 184 | 0, +HEAPF64[$38 >> 3], $39, $6, HEAP32[$40 >> 2] | 0) | 0) < 0) { + label = 29; + break; + } + HEAP32[$3 + ($$0447 << 2) >> 2] = HEAP32[$6 >> 2]; + $$0447 = $$0447 + 1 | 0; + } + if ((label | 0) == 29) { + $$4 = -1; + break L1; + } + if ((HEAP32[$0 >> 2] | 0) == 1) { + $77 = HEAP32[$3 + 4 >> 2] | 0; + $79 = HEAP32[$3 + 8 >> 2] | 0; + $80 = HEAP32[$3 >> 2] | 0; + HEAP32[$vararg_buffer >> 2] = $storemerge466; + HEAP32[$vararg_buffer + 4 >> 2] = $77; + HEAP32[$vararg_buffer + 8 >> 2] = $15; + HEAP32[$vararg_buffer + 12 >> 2] = $79; + HEAP32[$vararg_buffer + 16 >> 2] = $spec$select; + HEAP32[$vararg_buffer + 20 >> 2] = $80; + _arLog(0, 3, 24030, $vararg_buffer); + $82 = $80; + $83 = $79; + } else { + $82 = HEAP32[$3 >> 2] | 0; + $83 = HEAP32[$3 + 8 >> 2] | 0; + } + $$pre486 = HEAP32[$3 + 4 >> 2] | 0; + if (($82 | 0) > ($83 | 0) | ($$pre486 | 0) > ($83 | 0)) { + $99 = ($82 | 0) < ($$pre486 | 0) ? $storemerge466 : $spec$select; + HEAP32[$14 >> 2] = $99; + $100 = $99 - $15 | 0; + if (($100 | 0) > 0) { + HEAP32[$16 >> 2] = $100; + $storemerge = 1; + } else { + HEAP32[$16 >> 2] = 1; + $storemerge = 0 - $100 | 0; + } + HEAP32[$20 >> 2] = $storemerge; + if ((HEAP32[$0 >> 2] | 0) == 1) { + HEAP32[$vararg_buffer6 >> 2] = $99; + _arLog(0, 3, 24106, $vararg_buffer6); + HEAP32[$10 >> 2] = HEAP32[$0 + 7062392 >> 2]; + break; + } else { + HEAP32[$10 >> 2] = HEAP32[$0 + 7062392 >> 2]; + break; + } + } + $85 = HEAP32[$16 >> 2] | 0; + $86 = HEAP32[$20 >> 2] | 0; + do if (($85 | 0) >= ($86 | 0)) if (($85 | 0) > ($86 | 0)) { + HEAP32[$20 >> 2] = $86 + 1; + $94 = $85; + break; + } else { + $91 = $85 + 1 | 0; + HEAP32[$16 >> 2] = $91; + HEAP32[$20 >> 2] = $86 + 1; + $94 = $91; + break; + } else { + $88 = $85 + 1 | 0; + HEAP32[$16 >> 2] = $88; + $94 = $88; + } while (0); + if (($94 + $15 | 0) > 254) { + HEAP32[$16 >> 2] = 1; + $97 = 1; + } else $97 = $94; + if (($15 | 0) <= ($97 | 0)) HEAP32[$20 >> 2] = 1; + HEAP32[$10 >> 2] = HEAP32[$0 + 7062392 >> 2]; + break L3; + } while (0); + $111 = HEAP32[$7 >> 2] | 0; + label = 33; + } else { + $111 = $8; + label = 33; + } while (0); + if ((label | 0) == 33) { + L47 : do switch ($111 | 0) { + case 3: + { + $112 = $0 + 7062408 | 0; + $114 = $1 + 12 | 0; + $116 = _arImageProcLumaHistAndBoxFilterWithBias(HEAP32[$112 >> 2] | 0, HEAP32[$114 >> 2] | 0, 9, -7) | 0; + if (($116 | 0) < 0) { + $$4 = $116; + break L1; + } + $119 = HEAP32[$112 >> 2] | 0; + $127 = $0 + 4834144 | 0; + $129 = _arLabeling(HEAP32[$114 >> 2] | 0, HEAP32[$119 + 4 >> 2] | 0, HEAP32[$119 + 8 >> 2] | 0, HEAP32[$0 >> 2] | 0, HEAP32[$0 + 12 >> 2] | 0, 0, 0, $127, HEAP32[$119 >> 2] | 0) | 0; + if (($129 | 0) < 0) { + $$4 = $129; + break L1; + } + $$pre$phi501Z2D = $0 + 36 | 0; + $$pre$phi503Z2D = $0 + 40 | 0; + $$pre$phi505Z2D = $0 + 20 | 0; + $$pre$phiZ2D = $127; + break; + } + case 2: + case 1: + { + $131 = $0 + 7062396 | 0; + $132 = HEAP32[$131 >> 2] | 0; + if (($132 | 0) > 0) { + HEAP32[$131 >> 2] = $132 + -1; + label = 48; + break L47; + } + $137 = HEAP32[$0 + 7062408 >> 2] | 0; + $139 = HEAP32[$1 + 12 >> 2] | 0; + if (($111 | 0) == 1) $$0 = _arImageProcLumaHistAndCDFAndMedian($137, $139, $2) | 0; else $$0 = _arImageProcLumaHistAndOtsu($137, $139, $2) | 0; + if (($$0 | 0) < 0) { + $$4 = $$0; + break L1; + } + $145 = $0 + 16 | 0; + if ((HEAP32[$0 >> 2] | 0) == 1 ? ($148 = HEAPU8[$2 >> 0] | 0, (HEAP32[$145 >> 2] | 0) != ($148 | 0)) : 0) { + HEAP32[$vararg_buffer9 >> 2] = (HEAP32[$7 >> 2] | 0) == 1 ? 24158 : 24165; + HEAP32[$vararg_buffer9 + 4 >> 2] = $148; + _arLog(0, 3, 24170, $vararg_buffer9); + } + HEAP32[$145 >> 2] = HEAPU8[$2 >> 0]; + HEAP32[$131 >> 2] = HEAP32[$0 + 7062392 >> 2]; + label = 48; + break; + } + default: + label = 48; + } while (0); + if ((label | 0) == 48) { + $159 = $0 + 36 | 0; + $161 = $0 + 40 | 0; + $168 = $0 + 20 | 0; + $170 = $0 + 4834144 | 0; + if ((_arLabeling(HEAP32[$1 + 12 >> 2] | 0, HEAP32[$159 >> 2] | 0, HEAP32[$161 >> 2] | 0, HEAP32[$0 >> 2] | 0, HEAP32[$0 + 12 >> 2] | 0, HEAP32[$0 + 16 >> 2] | 0, HEAP32[$168 >> 2] | 0, $170, 0) | 0) < 0) { + $$4 = -1; + break; + } else { + $$pre$phi501Z2D = $159; + $$pre$phi503Z2D = $161; + $$pre$phi505Z2D = $168; + $$pre$phiZ2D = $170; + } + } + $176 = $0 + 15416 | 0; + $177 = $0 + 15408 | 0; + if ((_arDetectMarker2(HEAP32[$$pre$phi501Z2D >> 2] | 0, HEAP32[$$pre$phi503Z2D >> 2] | 0, $$pre$phiZ2D, HEAP32[$$pre$phi505Z2D >> 2] | 0, 1e6, 70, 1.0, $176, $177) | 0) < 0) { + $$4 = -1; + break; + } + if ((_arGetMarkerInfo(HEAP32[$1 >> 2] | 0, HEAP32[$$pre$phi501Z2D >> 2] | 0, HEAP32[$$pre$phi503Z2D >> 2] | 0, HEAP32[$0 + 4 >> 2] | 0, $176, HEAP32[$177 >> 2] | 0, HEAP32[$0 + 7062384 >> 2] | 0, HEAP32[$$pre$phi505Z2D >> 2] | 0, HEAP32[$0 + 24 >> 2] | 0, (HEAP32[$0 + 32 >> 2] | 0) + 184 | 0, +HEAPF64[$0 + 7062416 >> 3], $0 + 48 | 0, $6, HEAP32[$0 + 7062424 >> 2] | 0) | 0) < 0) { + $$4 = -1; + break; + } + } + $201 = $0 + 28 | 0; + if ((HEAP32[$201 >> 2] | 0) == 1) { + _confidenceCutoff($0); + $$4 = 0; + break; + } + $204 = $0 + 4818296 | 0; + $205 = HEAP32[$204 >> 2] | 0; + $206 = $0 + 24 | 0; + $$1448 = 0; + while (1) { + if (($$1448 | 0) >= ($205 | 0)) break; + $208 = HEAP32[$6 >> 2] | 0; + $209 = $0 + 4818304 + ($$1448 * 264 | 0) | 0; + $210 = $0 + 4818304 + ($$1448 * 264 | 0) + 56 | 0; + $211 = $0 + 4818304 + ($$1448 * 264 | 0) + 64 | 0; + $$0442 = 0; + $$0456 = -1; + $$0464 = .5; + while (1) { + if (($$0442 | 0) >= ($208 | 0)) break; + $217 = +(HEAP32[$0 + 48 + ($$0442 << 8) >> 2] | 0); + $218 = +(HEAP32[$209 >> 2] | 0) / $217; + if (!($218 < .7 | $218 > 1.43) ? ($224 = +HEAPF64[$0 + 48 + ($$0442 << 8) + 56 >> 3] - +HEAPF64[$210 >> 3], $229 = +HEAPF64[$0 + 48 + ($$0442 << 8) + 64 >> 3] - +HEAPF64[$211 >> 3], $232 = ($224 * $224 + $229 * $229) / $217, $232 < $$0464) : 0) { + $$1457 = $$0442; + $$1465 = $232; + } else { + $$1457 = $$0456; + $$1465 = $$0464; + } + $$0442 = $$0442 + 1 | 0; + $$0456 = $$1457; + $$0464 = $$1465; + } + L85 : do if (($$0456 | 0) > -1) { + $236 = HEAP32[$206 >> 2] | 0; + switch ($236 | 0) { + case 2: + case 1: + case 0: + break; + case 4: + case 3: + { + $276 = $0 + 48 + ($$0456 << 8) + 40 | 0; + $279 = +HEAPF64[$0 + 4818304 + ($$1448 * 264 | 0) + 40 >> 3]; + if (!(+HEAPF64[$276 >> 3] < $279)) { + $281 = $0 + 48 + ($$0456 << 8) + 48 | 0; + $284 = +HEAPF64[$0 + 4818304 + ($$1448 * 264 | 0) + 48 >> 3]; + if (+HEAPF64[$281 >> 3] < $284) { + $$pre$phi495Z2D = $281; + $289 = $284; + } else break L85; + } else { + $$pre$phi495Z2D = $0 + 48 + ($$0456 << 8) + 48 | 0; + $289 = +HEAPF64[$0 + 4818304 + ($$1448 * 264 | 0) + 48 >> 3]; + } + HEAPF64[$276 >> 3] = $279; + HEAP32[$0 + 48 + ($$0456 << 8) + 8 >> 2] = HEAP32[$0 + 4818304 + ($$1448 * 264 | 0) + 8 >> 2]; + HEAPF64[$$pre$phi495Z2D >> 3] = $289; + HEAP32[$0 + 48 + ($$0456 << 8) + 12 >> 2] = HEAP32[$0 + 4818304 + ($$1448 * 264 | 0) + 12 >> 2]; + $$2444 = 0; + $$2454 = -1; + $$2460 = 1.0e8; + while (1) { + if (($$2444 | 0) == 4) break; + $$1441 = 0; + $$1463 = 0.0; + while (1) { + if (($$1441 | 0) == 4) break; + $296 = $$1441 + $$2444 & 3; + $299 = +HEAPF64[$0 + 4818304 + ($$1448 * 264 | 0) + 168 + ($$1441 << 4) >> 3] - +HEAPF64[$0 + 48 + ($$0456 << 8) + 168 + ($296 << 4) >> 3]; + $305 = +HEAPF64[$0 + 4818304 + ($$1448 * 264 | 0) + 168 + ($$1441 << 4) + 8 >> 3] - +HEAPF64[$0 + 48 + ($$0456 << 8) + 168 + ($296 << 4) + 8 >> 3]; + $$1441 = $$1441 + 1 | 0; + $$1463 = $$1463 + ($299 * $299 + $305 * $305); + } + $310 = $$1463 < $$2460; + $$3455 = $310 ? $$2444 : $$2454; + $$2444 = $$2444 + 1 | 0; + $$2454 = $$3455; + $$2460 = $310 ? $$1463 : $$2460; + } + $314 = 4 - $$2454 | 0; + HEAP32[$0 + 48 + ($$0456 << 8) + 20 >> 2] = ($314 + (HEAP32[$0 + 4818304 + ($$1448 * 264 | 0) + 20 >> 2] | 0) | 0) % 4 | 0; + HEAP32[$0 + 48 + ($$0456 << 8) + 24 >> 2] = ($314 + (HEAP32[$0 + 4818304 + ($$1448 * 264 | 0) + 24 >> 2] | 0) | 0) % 4 | 0; + break L85; + break; + } + default: + { + $$4 = -1; + break L1; + } + } + $237 = $0 + 48 + ($$0456 << 8) + 32 | 0; + $240 = +HEAPF64[$0 + 4818304 + ($$1448 * 264 | 0) + 32 >> 3]; + if (+HEAPF64[$237 >> 3] < $240) { + HEAPF64[$237 >> 3] = $240; + $243 = HEAP32[$0 + 4818304 + ($$1448 * 264 | 0) + 4 >> 2] | 0; + HEAP32[$0 + 48 + ($$0456 << 8) + 4 >> 2] = $243; + $245 = $0 + 4818304 + ($$1448 * 264 | 0) + 16 | 0; + $$0452 = -1; + $$0458 = 1.0e8; + $$1443 = 0; + while (1) { + if (($$1443 | 0) == 4) break; + $$0440 = 0; + $$0462 = 0.0; + while (1) { + if (($$0440 | 0) == 4) break; + $249 = $$0440 + $$1443 & 3; + $252 = +HEAPF64[$0 + 4818304 + ($$1448 * 264 | 0) + 168 + ($$0440 << 4) >> 3] - +HEAPF64[$0 + 48 + ($$0456 << 8) + 168 + ($249 << 4) >> 3]; + $258 = +HEAPF64[$0 + 4818304 + ($$1448 * 264 | 0) + 168 + ($$0440 << 4) + 8 >> 3] - +HEAPF64[$0 + 48 + ($$0456 << 8) + 168 + ($249 << 4) + 8 >> 3]; + $$0440 = $$0440 + 1 | 0; + $$0462 = $$0462 + ($252 * $252 + $258 * $258); + } + if ($$0462 < $$0458) { + $$1453 = (4 - $$1443 + (HEAP32[$245 >> 2] | 0) | 0) % 4 | 0; + $$1459 = $$0462; + } else { + $$1453 = $$0452; + $$1459 = $$0458; + } + $$0452 = $$1453; + $$0458 = $$1459; + $$1443 = $$1443 + 1 | 0; + } + HEAP32[$0 + 48 + ($$0456 << 8) + 16 >> 2] = $$0452; + if ($236 >>> 0 < 2) { + HEAP32[$0 + 48 + ($$0456 << 8) + 8 >> 2] = $243; + HEAPF64[$0 + 48 + ($$0456 << 8) + 40 >> 3] = $240; + HEAP32[$0 + 48 + ($$0456 << 8) + 20 >> 2] = $$0452; + break; + } else { + HEAP32[$0 + 48 + ($$0456 << 8) + 12 >> 2] = $243; + HEAPF64[$0 + 48 + ($$0456 << 8) + 48 >> 3] = $240; + HEAP32[$0 + 48 + ($$0456 << 8) + 24 >> 2] = $$0452; + break; + } + } + } while (0); + $$1448 = $$1448 + 1 | 0; + } + _confidenceCutoff($0); + $$2449 = 0; + $$3445 = 0; + while (1) { + if (($$2449 | 0) >= (HEAP32[$204 >> 2] | 0)) break; + $326 = $0 + 4818304 + ($$2449 * 264 | 0) + 256 | 0; + $327 = HEAP32[$326 >> 2] | 0; + HEAP32[$326 >> 2] = $327 + 1; + if (($327 | 0) < 3) { + if (($$2449 | 0) != ($$3445 | 0)) _memcpy($0 + 4818304 + ($$3445 * 264 | 0) | 0, $0 + 4818304 + ($$2449 * 264 | 0) | 0, 264) | 0; + $$4446 = $$3445 + 1 | 0; + } else $$4446 = $$3445; + $$2449 = $$2449 + 1 | 0; + $$3445 = $$4446; + } + HEAP32[$204 >> 2] = $$3445; + $$pre487 = HEAP32[$6 >> 2] | 0; + $$3450 = 0; + $341 = $$3445; + while (1) { + if (($$3450 | 0) >= ($$pre487 | 0)) break; + $336 = $0 + 48 + ($$3450 << 8) | 0; + $338 = HEAP32[$0 + 48 + ($$3450 << 8) + 4 >> 2] | 0; + if (($338 | 0) < 0) $388 = $341; else { + $$5 = 0; + while (1) { + if (($$5 | 0) >= ($341 | 0)) break; + if ((HEAP32[$0 + 4818304 + ($$5 * 264 | 0) + 4 >> 2] | 0) == ($338 | 0)) break; + $$5 = $$5 + 1 | 0; + } + if (($$5 | 0) == ($341 | 0)) { + if (($341 | 0) == 60) break; + $348 = $341 + 1 | 0; + HEAP32[$204 >> 2] = $348; + $389 = $348; + } else $389 = $341; + _memcpy($0 + 4818304 + ($$5 * 264 | 0) | 0, $336 | 0, 256) | 0; + HEAP32[$0 + 4818304 + ($$5 * 264 | 0) + 256 >> 2] = 1; + $388 = $389; + } + $$3450 = $$3450 + 1 | 0; + $341 = $388; + } + if ((HEAP32[$201 >> 2] | 0) == 2) $$4 = 0; else { + $$4451 = 0; + $355 = $341; + $360 = $$pre487; + while (1) { + if (($$4451 | 0) >= ($355 | 0)) { + $$4 = 0; + break L1; + } + $356 = $0 + 4818304 + ($$4451 * 264 | 0) | 0; + $357 = $0 + 4818304 + ($$4451 * 264 | 0) + 56 | 0; + $358 = $0 + 4818304 + ($$4451 * 264 | 0) + 64 | 0; + $$6 = 0; + while (1) { + if (($$6 | 0) >= ($360 | 0)) break; + $365 = +(HEAP32[$0 + 48 + ($$6 << 8) >> 2] | 0); + $366 = +(HEAP32[$356 >> 2] | 0) / $365; + if (!($366 < .7 | $366 > 1.43) ? ($372 = +HEAPF64[$0 + 48 + ($$6 << 8) + 56 >> 3] - +HEAPF64[$357 >> 3], $377 = +HEAPF64[$0 + 48 + ($$6 << 8) + 64 >> 3] - +HEAPF64[$358 >> 3], ($372 * $372 + $377 * $377) / $365 < .5) : 0) break; + $$6 = $$6 + 1 | 0; + } + if (($$6 | 0) == ($360 | 0)) { + _memcpy($0 + 48 + ($360 << 8) | 0, $0 + 4818304 + ($$4451 * 264 | 0) | 0, 256) | 0; + $386 = $360 + 1 | 0; + HEAP32[$6 >> 2] = $386; + $$pre488 = HEAP32[$204 >> 2] | 0; + $390 = $386; + } else { + $$pre488 = $355; + $390 = $360; + } + $$4451 = $$4451 + 1 | 0; + $355 = $$pre488; + $360 = $390; + } + } + } else $$4 = -1; while (0); + STACKTOP = sp; + return $$4 | 0; +} + +function _printf_core($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0 = 0, $$0231 = 0, $$0232336 = 0, $$0234 = 0, $$0237 = 0, $$0239 = 0, $$0242315 = 0, $$0242315373 = 0, $$0242335 = 0, $$0245 = 0, $$0245$ph = 0, $$0245$ph$be = 0, $$0249 = 0, $$0249$ph = 0, $$0251$lcssa = 0, $$0251323 = 0, $$0254 = 0, $$0255 = 0, $$0256 = 0, $$0261 = 0, $$0264$lcssa = 0, $$0264330 = 0, $$0271$ph = 0, $$1 = 0, $$1233342 = 0, $$1235 = 0, $$1238 = 0, $$1240 = 0, $$1243341 = 0, $$1250 = 0, $$1257 = 0, $$1262 = 0, $$1265 = 0, $$1272 = 0, $$2236 = 0, $$2241 = 0, $$2244322 = 0, $$2258 = 0, $$2263 = 0, $$2273 = 0, $$3267 = 0, $$3274 = 0, $$3319 = 0, $$4260372 = 0, $$4268 = 0, $$5 = 0, $$6270 = 0, $$lcssa310 = 0, $$pre$phiZ2D = 0, $$pre362 = 0, $$pre365 = 0, $$sink = 0, $10 = 0, $104 = 0, $105 = 0, $108 = 0, $11 = 0, $111 = 0, $114 = 0, $116 = 0, $12 = 0, $124 = 0, $128 = 0, $13 = 0, $139 = 0, $14 = 0, $143 = 0, $15 = 0, $150 = 0, $151 = 0, $153 = 0, $154 = 0, $156 = 0, $16 = 0, $165 = 0, $166 = 0, $171 = 0, $174 = 0, $179 = 0, $180 = 0, $185 = 0, $187 = 0, $194 = 0, $195 = 0, $20 = 0, $206 = 0, $218 = 0, $22 = 0, $225 = 0, $23 = 0, $232 = 0, $233 = 0, $246 = 0, $25 = 0, $252 = 0, $256 = 0, $26 = 0, $260 = 0, $262 = 0, $265 = 0, $267 = 0, $268 = 0, $269 = 0, $27 = 0, $279 = 0, $280 = 0, $284 = 0, $29 = 0, $292 = 0, $298 = 0, $307 = 0, $309 = 0, $310 = 0, $311 = 0, $32 = 0, $324 = 0, $326 = 0, $327 = 0, $331 = 0, $335 = 0, $337 = 0, $348 = 0, $350 = 0, $357 = 0, $360 = 0, $367 = 0, $368 = 0, $45 = 0, $53 = 0, $54 = 0, $56 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $7 = 0, $78 = 0, $8 = 0, $82 = 0, $9 = 0, $or$cond = 0, $or$cond280 = 0, $spec$select = 0, $spec$select286 = 0, $storemerge275$lcssa = 0, $storemerge275329 = 0, $storemerge276 = 0, label = 0, sp = 0, $156$looptemp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $7 = sp + 56 | 0; + $8 = sp + 40 | 0; + $9 = sp; + $10 = sp + 48 | 0; + $11 = sp + 60 | 0; + HEAP32[$7 >> 2] = $1; + $12 = ($0 | 0) != 0; + $13 = $9 + 40 | 0; + $14 = $13; + $15 = $9 + 39 | 0; + $16 = $10 + 4 | 0; + $$0245$ph = 0; + $$0249$ph = 0; + $$0271$ph = 0; + L1 : while (1) { + $$0245 = $$0245$ph; + $$0249 = $$0249$ph; + while (1) { + do if (($$0249 | 0) > -1) if (($$0245 | 0) > (2147483647 - $$0249 | 0)) { + $20 = ___errno_location() | 0; + HEAP32[$20 >> 2] = 61; + $$1250 = -1; + break; + } else { + $$1250 = $$0245 + $$0249 | 0; + break; + } else $$1250 = $$0249; while (0); + $22 = HEAP32[$7 >> 2] | 0; + $23 = HEAP8[$22 >> 0] | 0; + if (!($23 << 24 >> 24)) { + label = 92; + break L1; + } + $25 = $23; + $27 = $22; + L12 : while (1) { + switch ($25 << 24 >> 24) { + case 37: + { + label = 10; + break L12; + break; + } + case 0: + { + $$0251$lcssa = $27; + break L12; + break; + } + default: + {} + } + $26 = $27 + 1 | 0; + HEAP32[$7 >> 2] = $26; + $25 = HEAP8[$26 >> 0] | 0; + $27 = $26; + } + L15 : do if ((label | 0) == 10) { + label = 0; + $$0251323 = $27; + $29 = $27; + while (1) { + if ((HEAP8[$29 + 1 >> 0] | 0) != 37) { + $$0251$lcssa = $$0251323; + break L15; + } + $32 = $$0251323 + 1 | 0; + $29 = $29 + 2 | 0; + HEAP32[$7 >> 2] = $29; + if ((HEAP8[$29 >> 0] | 0) != 37) { + $$0251$lcssa = $32; + break; + } else $$0251323 = $32; + } + } while (0); + $$0245 = $$0251$lcssa - $22 | 0; + if ($12) _out($0, $22, $$0245); + if (!$$0245) break; else $$0249 = $$1250; + } + $45 = (_isdigit(HEAP8[(HEAP32[$7 >> 2] | 0) + 1 >> 0] | 0) | 0) == 0; + $$pre362 = HEAP32[$7 >> 2] | 0; + if (!$45 ? (HEAP8[$$pre362 + 2 >> 0] | 0) == 36 : 0) { + $$0255 = (HEAP8[$$pre362 + 1 >> 0] | 0) + -48 | 0; + $$1272 = 1; + $$sink = 3; + } else { + $$0255 = -1; + $$1272 = $$0271$ph; + $$sink = 1; + } + $53 = $$pre362 + $$sink | 0; + HEAP32[$7 >> 2] = $53; + $54 = HEAP8[$53 >> 0] | 0; + $56 = ($54 << 24 >> 24) + -32 | 0; + if ($56 >>> 0 > 31 | (1 << $56 & 75913 | 0) == 0) { + $$0264$lcssa = 0; + $$lcssa310 = $54; + $storemerge275$lcssa = $53; + } else { + $$0264330 = 0; + $62 = $56; + $storemerge275329 = $53; + while (1) { + $63 = 1 << $62 | $$0264330; + $64 = $storemerge275329 + 1 | 0; + HEAP32[$7 >> 2] = $64; + $65 = HEAP8[$64 >> 0] | 0; + $62 = ($65 << 24 >> 24) + -32 | 0; + if ($62 >>> 0 > 31 | (1 << $62 & 75913 | 0) == 0) { + $$0264$lcssa = $63; + $$lcssa310 = $65; + $storemerge275$lcssa = $64; + break; + } else { + $$0264330 = $63; + $storemerge275329 = $64; + } + } + } + if ($$lcssa310 << 24 >> 24 == 42) { + if ((_isdigit(HEAP8[$storemerge275$lcssa + 1 >> 0] | 0) | 0) != 0 ? ($78 = HEAP32[$7 >> 2] | 0, (HEAP8[$78 + 2 >> 0] | 0) == 36) : 0) { + $82 = $78 + 1 | 0; + HEAP32[$4 + ((HEAP8[$82 >> 0] | 0) + -48 << 2) >> 2] = 10; + $$0261 = HEAP32[$3 + ((HEAP8[$82 >> 0] | 0) + -48 << 3) >> 2] | 0; + $$2273 = 1; + $storemerge276 = $78 + 3 | 0; + } else { + if ($$1272 | 0) { + $$0 = -1; + break; + } + if ($12) { + $104 = (HEAP32[$2 >> 2] | 0) + (4 - 1) & ~(4 - 1); + $105 = HEAP32[$104 >> 2] | 0; + HEAP32[$2 >> 2] = $104 + 4; + $367 = $105; + } else $367 = 0; + $$0261 = $367; + $$2273 = 0; + $storemerge276 = (HEAP32[$7 >> 2] | 0) + 1 | 0; + } + HEAP32[$7 >> 2] = $storemerge276; + $108 = ($$0261 | 0) < 0; + $$1262 = $108 ? 0 - $$0261 | 0 : $$0261; + $$1265 = $108 ? $$0264$lcssa | 8192 : $$0264$lcssa; + $$3274 = $$2273; + $114 = $storemerge276; + } else { + $111 = _getint($7) | 0; + if (($111 | 0) < 0) { + $$0 = -1; + break; + } + $$1262 = $111; + $$1265 = $$0264$lcssa; + $$3274 = $$1272; + $114 = HEAP32[$7 >> 2] | 0; + } + do if ((HEAP8[$114 >> 0] | 0) == 46) { + $116 = $114 + 1 | 0; + if ((HEAP8[$116 >> 0] | 0) != 42) { + HEAP32[$7 >> 2] = $116; + $154 = _getint($7) | 0; + $$0256 = $154; + $$pre365 = HEAP32[$7 >> 2] | 0; + break; + } + if (_isdigit(HEAP8[$114 + 2 >> 0] | 0) | 0 ? ($124 = HEAP32[$7 >> 2] | 0, (HEAP8[$124 + 3 >> 0] | 0) == 36) : 0) { + $128 = $124 + 2 | 0; + HEAP32[$4 + ((HEAP8[$128 >> 0] | 0) + -48 << 2) >> 2] = 10; + $139 = HEAP32[$3 + ((HEAP8[$128 >> 0] | 0) + -48 << 3) >> 2] | 0; + $143 = $124 + 4 | 0; + HEAP32[$7 >> 2] = $143; + $$0256 = $139; + $$pre365 = $143; + break; + } + if ($$3274 | 0) { + $$0 = -1; + break L1; + } + if ($12) { + $150 = (HEAP32[$2 >> 2] | 0) + (4 - 1) & ~(4 - 1); + $151 = HEAP32[$150 >> 2] | 0; + HEAP32[$2 >> 2] = $150 + 4; + $368 = $151; + } else $368 = 0; + $153 = (HEAP32[$7 >> 2] | 0) + 2 | 0; + HEAP32[$7 >> 2] = $153; + $$0256 = $368; + $$pre365 = $153; + } else { + $$0256 = -1; + $$pre365 = $114; + } while (0); + $$0254 = 0; + $156 = $$pre365; + while (1) { + if (((HEAP8[$156 >> 0] | 0) + -65 | 0) >>> 0 > 57) { + $$0 = -1; + break L1; + } + $156$looptemp = $156; + $156 = $156 + 1 | 0; + HEAP32[$7 >> 2] = $156; + $165 = HEAP8[(HEAP8[$156$looptemp >> 0] | 0) + -65 + (6208 + ($$0254 * 58 | 0)) >> 0] | 0; + $166 = $165 & 255; + if (($166 + -1 | 0) >>> 0 >= 8) break; else $$0254 = $166; + } + if (!($165 << 24 >> 24)) { + $$0 = -1; + break; + } + $171 = ($$0255 | 0) > -1; + do if ($165 << 24 >> 24 == 19) if ($171) { + $$0 = -1; + break L1; + } else label = 54; else { + if ($171) { + HEAP32[$4 + ($$0255 << 2) >> 2] = $166; + $174 = $3 + ($$0255 << 3) | 0; + $179 = HEAP32[$174 + 4 >> 2] | 0; + $180 = $8; + HEAP32[$180 >> 2] = HEAP32[$174 >> 2]; + HEAP32[$180 + 4 >> 2] = $179; + label = 54; + break; + } + if (!$12) { + $$0 = 0; + break L1; + } + _pop_arg($8, $166, $2, $6); + $185 = HEAP32[$7 >> 2] | 0; + label = 55; + } while (0); + if ((label | 0) == 54) { + label = 0; + if ($12) { + $185 = $156; + label = 55; + } else $$0245$ph$be = 0; + } + L77 : do if ((label | 0) == 55) { + label = 0; + $187 = HEAP8[$185 + -1 >> 0] | 0; + $$0237 = ($$0254 | 0) != 0 & ($187 & 15 | 0) == 3 ? $187 & -33 : $187; + $194 = $$1265 & -65537; + $spec$select = ($$1265 & 8192 | 0) == 0 ? $$1265 : $194; + L79 : do switch ($$0237 | 0) { + case 110: + { + switch (($$0254 & 255) << 24 >> 24) { + case 0: + { + HEAP32[HEAP32[$8 >> 2] >> 2] = $$1250; + $$0245$ph$be = 0; + break L77; + break; + } + case 1: + { + HEAP32[HEAP32[$8 >> 2] >> 2] = $$1250; + $$0245$ph$be = 0; + break L77; + break; + } + case 2: + { + $206 = HEAP32[$8 >> 2] | 0; + HEAP32[$206 >> 2] = $$1250; + HEAP32[$206 + 4 >> 2] = (($$1250 | 0) < 0) << 31 >> 31; + $$0245$ph$be = 0; + break L77; + break; + } + case 3: + { + HEAP16[HEAP32[$8 >> 2] >> 1] = $$1250; + $$0245$ph$be = 0; + break L77; + break; + } + case 4: + { + HEAP8[HEAP32[$8 >> 2] >> 0] = $$1250; + $$0245$ph$be = 0; + break L77; + break; + } + case 6: + { + HEAP32[HEAP32[$8 >> 2] >> 2] = $$1250; + $$0245$ph$be = 0; + break L77; + break; + } + case 7: + { + $218 = HEAP32[$8 >> 2] | 0; + HEAP32[$218 >> 2] = $$1250; + HEAP32[$218 + 4 >> 2] = (($$1250 | 0) < 0) << 31 >> 31; + $$0245$ph$be = 0; + break L77; + break; + } + default: + { + $$0245$ph$be = 0; + break L77; + } + } + break; + } + case 112: + { + $$1238 = 120; + $$1257 = $$0256 >>> 0 > 8 ? $$0256 : 8; + $$3267 = $spec$select | 8; + label = 67; + break; + } + case 88: + case 120: + { + $$1238 = $$0237; + $$1257 = $$0256; + $$3267 = $spec$select; + label = 67; + break; + } + case 111: + { + $246 = $8; + $252 = _fmt_o(HEAP32[$246 >> 2] | 0, HEAP32[$246 + 4 >> 2] | 0, $13) | 0; + $256 = $14 - $252 | 0; + $$0231 = $252; + $$1235 = 0; + $$1240 = 50740; + $$2258 = ($spec$select & 8 | 0) == 0 | ($$0256 | 0) > ($256 | 0) ? $$0256 : $256 + 1 | 0; + $$4268 = $spec$select; + label = 73; + break; + } + case 105: + case 100: + { + $260 = $8; + $262 = HEAP32[$260 >> 2] | 0; + $265 = HEAP32[$260 + 4 >> 2] | 0; + if (($265 | 0) < 0) { + $267 = _i64Subtract(0, 0, $262 | 0, $265 | 0) | 0; + $268 = getTempRet0() | 0; + $269 = $8; + HEAP32[$269 >> 2] = $267; + HEAP32[$269 + 4 >> 2] = $268; + $$0234 = 1; + $$0239 = 50740; + $279 = $267; + $280 = $268; + label = 72; + break L79; + } else { + $$0234 = ($spec$select & 2049 | 0) != 0 & 1; + $$0239 = ($spec$select & 2048 | 0) == 0 ? (($spec$select & 1 | 0) == 0 ? 50740 : 50742) : 50741; + $279 = $262; + $280 = $265; + label = 72; + break L79; + } + break; + } + case 117: + { + $195 = $8; + $$0234 = 0; + $$0239 = 50740; + $279 = HEAP32[$195 >> 2] | 0; + $280 = HEAP32[$195 + 4 >> 2] | 0; + label = 72; + break; + } + case 99: + { + HEAP8[$15 >> 0] = HEAP32[$8 >> 2]; + $$1 = $15; + $$2236 = 0; + $$2241 = 50740; + $$5 = 1; + $$6270 = $194; + $$pre$phiZ2D = $14; + break; + } + case 115: + { + $307 = HEAP32[$8 >> 2] | 0; + $309 = ($307 | 0) == 0 ? 50750 : $307; + $310 = _memchr($309, 0, $$0256) | 0; + $311 = ($310 | 0) == 0; + $$1 = $309; + $$2236 = 0; + $$2241 = 50740; + $$5 = $311 ? $$0256 : $310 - $309 | 0; + $$6270 = $194; + $$pre$phiZ2D = $311 ? $309 + $$0256 | 0 : $310; + break; + } + case 67: + { + HEAP32[$10 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$16 >> 2] = 0; + HEAP32[$8 >> 2] = $10; + $$4260372 = -1; + label = 79; + break; + } + case 83: + { + if (!$$0256) { + _pad_667($0, 32, $$1262, 0, $spec$select); + $$0242315373 = 0; + label = 89; + } else { + $$4260372 = $$0256; + label = 79; + } + break; + } + case 65: + case 71: + case 70: + case 69: + case 97: + case 103: + case 102: + case 101: + { + $$0245$ph$be = FUNCTION_TABLE_iidiiii[$5 & 1]($0, +HEAPF64[$8 >> 3], $$1262, $$0256, $spec$select, $$0237) | 0; + break L77; + break; + } + default: + { + $$1 = $22; + $$2236 = 0; + $$2241 = 50740; + $$5 = $$0256; + $$6270 = $spec$select; + $$pre$phiZ2D = $14; + } + } while (0); + L102 : do if ((label | 0) == 67) { + label = 0; + $225 = $8; + $232 = _fmt_x(HEAP32[$225 >> 2] | 0, HEAP32[$225 + 4 >> 2] | 0, $13, $$1238 & 32) | 0; + $233 = $8; + $or$cond280 = ($$3267 & 8 | 0) == 0 | (HEAP32[$233 >> 2] | 0) == 0 & (HEAP32[$233 + 4 >> 2] | 0) == 0; + $$0231 = $232; + $$1235 = $or$cond280 ? 0 : 2; + $$1240 = $or$cond280 ? 50740 : 50740 + ($$1238 >>> 4) | 0; + $$2258 = $$1257; + $$4268 = $$3267; + label = 73; + } else if ((label | 0) == 72) { + label = 0; + $$0231 = _fmt_u($279, $280, $13) | 0; + $$1235 = $$0234; + $$1240 = $$0239; + $$2258 = $$0256; + $$4268 = $spec$select; + label = 73; + } else if ((label | 0) == 79) { + label = 0; + $$0232336 = HEAP32[$8 >> 2] | 0; + $$0242335 = 0; + while (1) { + $324 = HEAP32[$$0232336 >> 2] | 0; + if (!$324) { + $$0242315 = $$0242335; + break; + } + $326 = _wctomb($11, $324) | 0; + $327 = ($326 | 0) < 0; + if ($327 | $326 >>> 0 > ($$4260372 - $$0242335 | 0) >>> 0) { + label = 83; + break; + } + $331 = $326 + $$0242335 | 0; + if ($$4260372 >>> 0 > $331 >>> 0) { + $$0232336 = $$0232336 + 4 | 0; + $$0242335 = $331; + } else { + $$0242315 = $331; + break; + } + } + if ((label | 0) == 83) { + label = 0; + if ($327) { + $$0 = -1; + break L1; + } else $$0242315 = $$0242335; + } + _pad_667($0, 32, $$1262, $$0242315, $spec$select); + if (!$$0242315) { + $$0242315373 = 0; + label = 89; + } else { + $$1233342 = HEAP32[$8 >> 2] | 0; + $$1243341 = 0; + while (1) { + $335 = HEAP32[$$1233342 >> 2] | 0; + if (!$335) { + $$0242315373 = $$0242315; + label = 89; + break L102; + } + $337 = _wctomb($11, $335) | 0; + $$1243341 = $337 + $$1243341 | 0; + if (($$1243341 | 0) > ($$0242315 | 0)) { + $$0242315373 = $$0242315; + label = 89; + break L102; + } + _out($0, $11, $337); + if ($$1243341 >>> 0 >= $$0242315 >>> 0) { + $$0242315373 = $$0242315; + label = 89; + break; + } else $$1233342 = $$1233342 + 4 | 0; + } + } + } while (0); + if ((label | 0) == 73) { + label = 0; + $284 = $8; + $292 = (HEAP32[$284 >> 2] | 0) != 0 | (HEAP32[$284 + 4 >> 2] | 0) != 0; + $or$cond = ($$2258 | 0) != 0 | $292; + $298 = $14 - $$0231 + (($292 ^ 1) & 1) | 0; + $$1 = $or$cond ? $$0231 : $13; + $$2236 = $$1235; + $$2241 = $$1240; + $$5 = $or$cond ? (($$2258 | 0) > ($298 | 0) ? $$2258 : $298) : 0; + $$6270 = ($$2258 | 0) > -1 ? $$4268 & -65537 : $$4268; + $$pre$phiZ2D = $14; + } else if ((label | 0) == 89) { + label = 0; + _pad_667($0, 32, $$1262, $$0242315373, $spec$select ^ 8192); + $$0245$ph$be = ($$1262 | 0) > ($$0242315373 | 0) ? $$1262 : $$0242315373; + break; + } + $348 = $$pre$phiZ2D - $$1 | 0; + $spec$select286 = ($$5 | 0) < ($348 | 0) ? $348 : $$5; + $350 = $spec$select286 + $$2236 | 0; + $$2263 = ($$1262 | 0) < ($350 | 0) ? $350 : $$1262; + _pad_667($0, 32, $$2263, $350, $$6270); + _out($0, $$2241, $$2236); + _pad_667($0, 48, $$2263, $350, $$6270 ^ 65536); + _pad_667($0, 48, $spec$select286, $348, 0); + _out($0, $$1, $348); + _pad_667($0, 32, $$2263, $350, $$6270 ^ 8192); + $$0245$ph$be = $$2263; + } while (0); + $$0245$ph = $$0245$ph$be; + $$0249$ph = $$1250; + $$0271$ph = $$3274; + } + L123 : do if ((label | 0) == 92) if (!$0) if (!$$0271$ph) $$0 = 0; else { + $$2244322 = 1; + while (1) { + $357 = HEAP32[$4 + ($$2244322 << 2) >> 2] | 0; + if (!$357) break; + _pop_arg($3 + ($$2244322 << 3) | 0, $357, $2, $6); + $360 = $$2244322 + 1 | 0; + if ($360 >>> 0 < 10) $$2244322 = $360; else { + $$0 = 1; + break L123; + } + } + $$3319 = $$2244322; + while (1) { + if (HEAP32[$4 + ($$3319 << 2) >> 2] | 0) { + $$0 = -1; + break L123; + } + $$3319 = $$3319 + 1 | 0; + if ($$3319 >>> 0 >= 10) { + $$0 = 1; + break; + } + } + } else $$0 = $$1250; while (0); + STACKTOP = sp; + return $$0 | 0; +} +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E16parseExprPrimaryEv($0) { + $0 = $0 | 0; + var $$1 = 0, $$2 = 0, $$3 = 0, $$byval_copy16 = 0, $1 = 0, $10 = 0, $100 = 0, $102 = 0, $103 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $2 = 0, $24 = 0, $3 = 0, $32 = 0, $36 = 0, $4 = 0, $40 = 0, $44 = 0, $48 = 0, $5 = 0, $52 = 0, $56 = 0, $6 = 0, $60 = 0, $64 = 0, $68 = 0, $7 = 0, $72 = 0, $76 = 0, $8 = 0, $80 = 0, $9 = 0, $96 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 160 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(160); + $$byval_copy16 = sp + 144 | 0; + $1 = sp + 136 | 0; + $2 = sp + 128 | 0; + $3 = sp + 120 | 0; + $4 = sp + 112 | 0; + $5 = sp + 104 | 0; + $6 = sp + 96 | 0; + $7 = sp + 88 | 0; + $8 = sp + 80 | 0; + $9 = sp + 72 | 0; + $10 = sp + 64 | 0; + $11 = sp + 56 | 0; + $12 = sp + 48 | 0; + $13 = sp + 40 | 0; + $14 = sp + 32 | 0; + $15 = sp + 24 | 0; + $16 = sp + 16 | 0; + $17 = sp + 8 | 0; + $18 = sp; + L1 : do if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 76) | 0) do switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 | 0) { + case 84: + { + $$3 = 0; + break L1; + break; + } + case 119: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $24 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($1, 52254); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$1 + 4 >> 2]; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseIntegerLiteralENS_10StringViewE($24, $$byval_copy16) | 0; + break L1; + break; + } + case 98: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 52262); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy16) | 0) { + HEAP32[$$byval_copy16 >> 2] = 0; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8BoolExprEJiEEEPNS0_4NodeEDpOT0_($0, $$byval_copy16) | 0; + break L1; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 52266); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy16) | 0)) { + $$3 = 0; + break L1; + } + HEAP32[$$byval_copy16 >> 2] = 1; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8BoolExprEJiEEEPNS0_4NodeEDpOT0_($0, $$byval_copy16) | 0; + break L1; + break; + } + case 99: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $32 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 57078); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseIntegerLiteralENS_10StringViewE($32, $$byval_copy16) | 0; + break L1; + break; + } + case 97: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $36 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 57083); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseIntegerLiteralENS_10StringViewE($36, $$byval_copy16) | 0; + break L1; + break; + } + case 104: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $40 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($6, 57095); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseIntegerLiteralENS_10StringViewE($40, $$byval_copy16) | 0; + break L1; + break; + } + case 115: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $44 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($7, 57109); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$7 + 4 >> 2]; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseIntegerLiteralENS_10StringViewE($44, $$byval_copy16) | 0; + break L1; + break; + } + case 116: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $48 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($8, 57115); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$8 + 4 >> 2]; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseIntegerLiteralENS_10StringViewE($48, $$byval_copy16) | 0; + break L1; + break; + } + case 105: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $52 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($9, 67447); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$9 + 4 >> 2]; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseIntegerLiteralENS_10StringViewE($52, $$byval_copy16) | 0; + break L1; + break; + } + case 106: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $56 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($10, 52270); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$10 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$10 + 4 >> 2]; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseIntegerLiteralENS_10StringViewE($56, $$byval_copy16) | 0; + break L1; + break; + } + case 108: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $60 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($11, 59195); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseIntegerLiteralENS_10StringViewE($60, $$byval_copy16) | 0; + break L1; + break; + } + case 109: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $64 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($12, 52272); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$12 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$12 + 4 >> 2]; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseIntegerLiteralENS_10StringViewE($64, $$byval_copy16) | 0; + break L1; + break; + } + case 120: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $68 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($13, 59186); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$13 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$13 + 4 >> 2]; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseIntegerLiteralENS_10StringViewE($68, $$byval_copy16) | 0; + break L1; + break; + } + case 121: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $72 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($14, 52275); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$14 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$14 + 4 >> 2]; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseIntegerLiteralENS_10StringViewE($72, $$byval_copy16) | 0; + break L1; + break; + } + case 110: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $76 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($15, 51460); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$15 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$15 + 4 >> 2]; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseIntegerLiteralENS_10StringViewE($76, $$byval_copy16) | 0; + break L1; + break; + } + case 111: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $80 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($16, 51469); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$16 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$16 + 4 >> 2]; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseIntegerLiteralENS_10StringViewE($80, $$byval_copy16) | 0; + break L1; + break; + } + case 102: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20parseFloatingLiteralIfEEPNS0_4NodeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + break L1; + break; + } + case 100: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20parseFloatingLiteralIdEEPNS0_4NodeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + break L1; + break; + } + case 101: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20parseFloatingLiteralIeEEPNS0_4NodeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + break L1; + break; + } + case 95: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($17, 51394); + HEAP32[$$byval_copy16 >> 2] = HEAP32[$17 >> 2]; + HEAP32[$$byval_copy16 + 4 >> 2] = HEAP32[$17 + 4 >> 2]; + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy16) | 0)) { + $$3 = 0; + break L1; + } + $96 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseEncodingEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + if ($96 | 0 ? __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0 : 0) { + $$3 = $96; + break L1; + } + $$3 = 0; + break L1; + break; + } + default: + { + $100 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy16 >> 2] = $100; + if (!$100) $$2 = 0; else { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E11parseNumberEb($18, $0, 0); + $102 = __ZNK12_GLOBAL__N_110StringView5emptyEv($18) | 0; + $103 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0; + if (!$102) if ($103) $$1 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_15IntegerCastExprEJRPNS0_4NodeERNS_10StringViewEEEES9_DpOT0_($0, $$byval_copy16, $18) | 0; else $$1 = 0; else $$1 = $103 ? $100 : 0; + $$2 = $$1; + } + $$3 = $$2; + break L1; + } + } while (0); else $$3 = 0; while (0); + STACKTOP = sp; + return $$3 | 0; +} + +function __ZN6vision20SamplePyramidFREAK84EPfPKNS_25GaussianScaleSpacePyramidERKNS_12FeaturePointEPKfS8_S8_S8_S8_S8_ffffffff($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = +$9; + $10 = +$10; + $11 = +$11; + $12 = +$12; + $13 = +$13; + $14 = +$14; + $15 = +$15; + $16 = +$16; + var $$0 = 0.0, $111 = 0.0, $117 = 0.0, $124 = 0.0, $131 = 0.0, $138 = 0.0, $145 = 0.0, $152 = 0.0, $159 = 0.0, $166 = 0.0, $17 = 0, $173 = 0.0, $18 = 0, $180 = 0.0, $187 = 0.0, $19 = 0, $194 = 0.0, $20 = 0, $201 = 0.0, $208 = 0.0, $21 = 0, $215 = 0.0, $22 = 0, $222 = 0.0, $229 = 0.0, $23 = 0, $236 = 0.0, $24 = 0, $243 = 0.0, $25 = 0, $250 = 0.0, $257 = 0.0, $264 = 0.0, $271 = 0.0, $278 = 0.0, $28 = 0.0, $285 = 0.0, $292 = 0.0, $299 = 0.0, $306 = 0.0, $313 = 0.0, $320 = 0.0, $327 = 0.0, $334 = 0.0, $341 = 0.0, $348 = 0.0, $355 = 0.0, $359 = 0.0, $36 = 0.0, $38 = 0.0, $39 = 0, $41 = 0, $43 = 0, $45 = 0, $47 = 0, $49 = 0, $51 = 0, $53 = 0, $55 = 0, $57 = 0, $59 = 0, $61 = 0, $63 = 0, $65 = 0, $67 = 0, $69 = 0, $71 = 0, $73 = 0, $75 = 0, $77 = 0, $79 = 0, $81 = 0, $83 = 0, $85 = 0, $87 = 0, $89 = 0, $91 = 0, $93 = 0, $95 = 0, $97 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 336 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(336); + $17 = sp + 288 | 0; + $18 = sp + 240 | 0; + $19 = sp + 192 | 0; + $20 = sp + 144 | 0; + $21 = sp + 96 | 0; + $22 = sp + 48 | 0; + $23 = sp; + $24 = sp + 328 | 0; + $25 = sp + 324 | 0; + $28 = +HEAPF32[$2 + 12 >> 2] * $16; + $$0 = $28 < 1.0 ? 1.0 : $28; + __ZN6vision10SimilarityIfEEvPT_S1_S1_S1_S1_($17, +HEAPF32[$2 >> 2], +HEAPF32[$2 + 4 >> 2], +HEAPF32[$2 + 8 >> 2], $$0); + $36 = +HEAPF32[$17 + 8 >> 2]; + $38 = +HEAPF32[$17 + 20 >> 2]; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($18, $17, $3); + $39 = $18 + 8 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($39, $17, $3 + 8 | 0); + $41 = $18 + 16 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($41, $17, $3 + 16 | 0); + $43 = $18 + 24 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($43, $17, $3 + 24 | 0); + $45 = $18 + 32 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($45, $17, $3 + 32 | 0); + $47 = $18 + 40 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($47, $17, $3 + 40 | 0); + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($19, $17, $4); + $49 = $19 + 8 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($49, $17, $4 + 8 | 0); + $51 = $19 + 16 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($51, $17, $4 + 16 | 0); + $53 = $19 + 24 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($53, $17, $4 + 24 | 0); + $55 = $19 + 32 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($55, $17, $4 + 32 | 0); + $57 = $19 + 40 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($57, $17, $4 + 40 | 0); + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($20, $17, $5); + $59 = $20 + 8 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($59, $17, $5 + 8 | 0); + $61 = $20 + 16 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($61, $17, $5 + 16 | 0); + $63 = $20 + 24 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($63, $17, $5 + 24 | 0); + $65 = $20 + 32 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($65, $17, $5 + 32 | 0); + $67 = $20 + 40 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($67, $17, $5 + 40 | 0); + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($21, $17, $6); + $69 = $21 + 8 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($69, $17, $6 + 8 | 0); + $71 = $21 + 16 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($71, $17, $6 + 16 | 0); + $73 = $21 + 24 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($73, $17, $6 + 24 | 0); + $75 = $21 + 32 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($75, $17, $6 + 32 | 0); + $77 = $21 + 40 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($77, $17, $6 + 40 | 0); + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($22, $17, $7); + $79 = $22 + 8 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($79, $17, $7 + 8 | 0); + $81 = $22 + 16 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($81, $17, $7 + 16 | 0); + $83 = $22 + 24 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($83, $17, $7 + 24 | 0); + $85 = $22 + 32 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($85, $17, $7 + 32 | 0); + $87 = $22 + 40 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($87, $17, $7 + 40 | 0); + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($23, $17, $8); + $89 = $23 + 8 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($89, $17, $8 + 8 | 0); + $91 = $23 + 16 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($91, $17, $8 + 16 | 0); + $93 = $23 + 24 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($93, $17, $8 + 24 | 0); + $95 = $23 + 32 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($95, $17, $8 + 32 | 0); + $97 = $23 + 40 | 0; + __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($97, $17, $8 + 40 | 0); + __ZNK6vision25GaussianScaleSpacePyramid6locateERiS1_f($1, $24, $25, $$0 * $15); + $111 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$23 >> 2], +HEAPF32[$23 + 4 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 >> 2] = $111; + $117 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$89 >> 2], +HEAPF32[$23 + 12 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 4 >> 2] = $117; + $124 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$91 >> 2], +HEAPF32[$23 + 20 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 8 >> 2] = $124; + $131 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$93 >> 2], +HEAPF32[$23 + 28 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 12 >> 2] = $131; + $138 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$95 >> 2], +HEAPF32[$23 + 36 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 16 >> 2] = $138; + $145 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$97 >> 2], +HEAPF32[$23 + 44 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 20 >> 2] = $145; + __ZNK6vision25GaussianScaleSpacePyramid6locateERiS1_f($1, $24, $25, $$0 * $14); + $152 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$22 >> 2], +HEAPF32[$22 + 4 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 24 >> 2] = $152; + $159 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$79 >> 2], +HEAPF32[$22 + 12 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 28 >> 2] = $159; + $166 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$81 >> 2], +HEAPF32[$22 + 20 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 32 >> 2] = $166; + $173 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$83 >> 2], +HEAPF32[$22 + 28 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 36 >> 2] = $173; + $180 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$85 >> 2], +HEAPF32[$22 + 36 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 40 >> 2] = $180; + $187 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$87 >> 2], +HEAPF32[$22 + 44 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 44 >> 2] = $187; + __ZNK6vision25GaussianScaleSpacePyramid6locateERiS1_f($1, $24, $25, $$0 * $13); + $194 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$21 >> 2], +HEAPF32[$21 + 4 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 48 >> 2] = $194; + $201 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$69 >> 2], +HEAPF32[$21 + 12 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 52 >> 2] = $201; + $208 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$71 >> 2], +HEAPF32[$21 + 20 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 56 >> 2] = $208; + $215 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$73 >> 2], +HEAPF32[$21 + 28 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 60 >> 2] = $215; + $222 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$75 >> 2], +HEAPF32[$21 + 36 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 64 >> 2] = $222; + $229 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$77 >> 2], +HEAPF32[$21 + 44 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 68 >> 2] = $229; + __ZNK6vision25GaussianScaleSpacePyramid6locateERiS1_f($1, $24, $25, $$0 * $12); + $236 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$20 >> 2], +HEAPF32[$20 + 4 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 72 >> 2] = $236; + $243 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$59 >> 2], +HEAPF32[$20 + 12 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 76 >> 2] = $243; + $250 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$61 >> 2], +HEAPF32[$20 + 20 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 80 >> 2] = $250; + $257 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$63 >> 2], +HEAPF32[$20 + 28 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 84 >> 2] = $257; + $264 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$65 >> 2], +HEAPF32[$20 + 36 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 88 >> 2] = $264; + $271 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$67 >> 2], +HEAPF32[$20 + 44 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 92 >> 2] = $271; + __ZNK6vision25GaussianScaleSpacePyramid6locateERiS1_f($1, $24, $25, $$0 * $11); + $278 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$19 >> 2], +HEAPF32[$19 + 4 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 96 >> 2] = $278; + $285 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$49 >> 2], +HEAPF32[$19 + 12 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 100 >> 2] = $285; + $292 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$51 >> 2], +HEAPF32[$19 + 20 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 104 >> 2] = $292; + $299 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$53 >> 2], +HEAPF32[$19 + 28 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 108 >> 2] = $299; + $306 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$55 >> 2], +HEAPF32[$19 + 36 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 112 >> 2] = $306; + $313 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$57 >> 2], +HEAPF32[$19 + 44 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 116 >> 2] = $313; + __ZNK6vision25GaussianScaleSpacePyramid6locateERiS1_f($1, $24, $25, $$0 * $10); + $320 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$18 >> 2], +HEAPF32[$18 + 4 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 120 >> 2] = $320; + $327 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$39 >> 2], +HEAPF32[$18 + 12 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 124 >> 2] = $327; + $334 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$41 >> 2], +HEAPF32[$18 + 20 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 128 >> 2] = $334; + $341 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$43 >> 2], +HEAPF32[$18 + 28 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 132 >> 2] = $341; + $348 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$45 >> 2], +HEAPF32[$18 + 36 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 136 >> 2] = $348; + $355 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, +HEAPF32[$47 >> 2], +HEAPF32[$18 + 44 >> 2], HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 140 >> 2] = $355; + __ZNK6vision25GaussianScaleSpacePyramid6locateERiS1_f($1, $24, $25, $$0 * $9); + $359 = +__ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($1, $36, $38, HEAP32[$24 >> 2] | 0, HEAP32[$25 >> 2] | 0); + HEAPF32[$0 + 144 >> 2] = $359; + STACKTOP = sp; + return 1; +} + +function _ar2TrackingMod($ar2Handle, $surfaceSet, $dataPtr, $trans, $err) { + $ar2Handle = $ar2Handle | 0; + $surfaceSet = $surfaceSet | 0; + $dataPtr = $dataPtr | 0; + $trans = $trans | 0; + $err = $err | 0; + var $27 = 0, $38 = 0, $arraydecay = 0, $arraydecay13 = 0, $arraydecay222 = 0, $arraydecay224 = 0, $arraydecay23 = 0, $arraydecay279 = 0, $arraydecay281 = 0, $arraydecay34 = 0, $arraydecay35 = 0, $arraydecay40 = 0, $arraydecay42 = 0, $arraydecay45$pre$phiZ2D = 0, $arraydecay50 = 0, $arraydecay51 = 0, $arraydecay60$pre$phiZ2D = 0, $arrayidx206 = 0, $arrayidx208 = 0, $arrayidx69 = 0, $call104 = 0, $call225 = 0.0, $call235 = 0.0, $call246 = 0.0, $call257 = 0.0, $call268 = 0.0, $call282 = 0.0, $call290 = 0.0, $call298 = 0.0, $call306 = 0.0, $call314 = 0.0, $call54 = 0, $call67 = 0, $candidatePtr$0 = 0, $candidatePtr$1 = 0, $candidatePtr$2 = 0, $candidatePtr$3 = 0, $cmp216 = 0, $contNum = 0, $cp = 0, $cparamLT = 0, $cparamLT115$pre$phiZ2D = 0, $i$0 = 0, $i$1 = 0, $i$2 = 0, $i$3 = 0, $i$4 = 0, $i$5 = 0, $i$6 = 0, $icpHandle = 0, $inc91 = 0, $j$0 = 0, $j$1 = 0, $j$2 = 0, $j$3 = 0, $j$4 = 0, $k$0 = 0, $num$0 = 0, $num$1 = 0, $num$2 = 0, $num2$0 = 0, $num5 = 0, $pos2d0 = 0, $pos2d1 = 0, $result = 0, $retval$0 = 0, $searchFeatureNum = 0, $simThresh = 0, $threadNum = 0, $trackingThresh = 0, $trackingThresh283 = 0, $xsize = 0, $xsize52$pre$phiZ2D = 0, $ysize = 0, $ysize53$pre$phiZ2D = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $cp = sp; + $pos2d0 = sp + 40 | 0; + $pos2d1 = sp + 32 | 0; + L1 : do if (($ar2Handle | 0) != 0 & ($surfaceSet | 0) != 0 & ($dataPtr | 0) != 0 & ($trans | 0) != 0 & ($err | 0) != 0) { + $contNum = $surfaceSet + 152 | 0; + if ((HEAP32[$contNum >> 2] | 0) < 1) $retval$0 = -2; else { + HEAPF32[$err >> 2] = 0.0; + $num5 = $surfaceSet + 4 | 0; + $arraydecay = $surfaceSet + 8 | 0; + $arraydecay13 = $surfaceSet + 56 | 0; + $arraydecay23 = $surfaceSet + 104 | 0; + $i$0 = 0; + while (1) { + if (($i$0 | 0) >= (HEAP32[$num5 >> 2] | 0)) break; + _arUtilMatMulf($arraydecay, (HEAP32[$surfaceSet >> 2] | 0) + ($i$0 * 112 | 0) + 12 | 0, $ar2Handle + 48 + ($i$0 * 48 | 0) | 0) | 0; + if ((HEAP32[$contNum >> 2] | 0) > 1 ? (_arUtilMatMulf($arraydecay13, (HEAP32[$surfaceSet >> 2] | 0) + ($i$0 * 112 | 0) + 12 | 0, $ar2Handle + 528 + ($i$0 * 48 | 0) | 0) | 0, (HEAP32[$contNum >> 2] | 0) > 2) : 0) _arUtilMatMulf($arraydecay23, (HEAP32[$surfaceSet >> 2] | 0) + ($i$0 * 112 | 0) + 12 | 0, $ar2Handle + 1008 + ($i$0 * 48 | 0) | 0) | 0; + $i$0 = $i$0 + 1 | 0; + } + if ((HEAP32[$ar2Handle >> 2] | 0) == 1) { + $cparamLT = $ar2Handle + 12 | 0; + $arraydecay34 = $ar2Handle + 2672 | 0; + $arraydecay35 = $ar2Handle + 7496 | 0; + _extractVisibleFeatures_171(HEAP32[$cparamLT >> 2] | 0, $ar2Handle + 48 | 0, $surfaceSet, $arraydecay34, $arraydecay35); + $arraydecay45$pre$phiZ2D = $arraydecay34; + $arraydecay60$pre$phiZ2D = $arraydecay35; + $cparamLT115$pre$phiZ2D = $cparamLT; + $xsize52$pre$phiZ2D = $ar2Handle + 4 | 0; + $ysize53$pre$phiZ2D = $ar2Handle + 8 | 0; + } else { + $xsize = $ar2Handle + 4 | 0; + $ysize = $ar2Handle + 8 | 0; + $arraydecay40 = $ar2Handle + 2672 | 0; + $arraydecay42 = $ar2Handle + 7496 | 0; + _extractVisibleFeaturesHomography_172(HEAP32[$xsize >> 2] | 0, HEAP32[$ysize >> 2] | 0, $ar2Handle + 48 | 0, $surfaceSet, $arraydecay40, $arraydecay42); + $arraydecay45$pre$phiZ2D = $arraydecay40; + $arraydecay60$pre$phiZ2D = $arraydecay42; + $cparamLT115$pre$phiZ2D = $ar2Handle + 12 | 0; + $xsize52$pre$phiZ2D = $xsize; + $ysize53$pre$phiZ2D = $ysize; + } + $searchFeatureNum = $ar2Handle + 36 | 0; + $threadNum = $ar2Handle + 13280 | 0; + $arraydecay50 = $surfaceSet + 156 | 0; + $arraydecay51 = $ar2Handle + 1488 | 0; + $simThresh = $ar2Handle + 40 | 0; + $candidatePtr$0 = $arraydecay45$pre$phiZ2D; + $i$1 = 0; + $num$0 = 0; + while (1) { + if (($i$1 | 0) >= (HEAP32[$searchFeatureNum >> 2] | 0)) break; + $candidatePtr$1 = $candidatePtr$0; + $i$2 = $i$1; + $j$0 = 0; + $num2$0 = $num$0; + while (1) { + if (($j$0 | 0) >= (HEAP32[$threadNum >> 2] | 0)) { + $candidatePtr$3 = $candidatePtr$1; + break; + } + if (($i$2 | 0) == (HEAP32[$searchFeatureNum >> 2] | 0)) { + $candidatePtr$3 = $candidatePtr$1; + break; + } + $call54 = _ar2SelectTemplate($candidatePtr$1, $arraydecay50, $num2$0, $arraydecay51, HEAP32[$xsize52$pre$phiZ2D >> 2] | 0, HEAP32[$ysize53$pre$phiZ2D >> 2] | 0) | 0; + if (($call54 | 0) < 0) { + if (($candidatePtr$1 | 0) != ($arraydecay45$pre$phiZ2D | 0)) { + $candidatePtr$3 = $candidatePtr$1; + break; + } + $call67 = _ar2SelectTemplate($arraydecay60$pre$phiZ2D, $arraydecay50, $num2$0, $arraydecay51, HEAP32[$xsize52$pre$phiZ2D >> 2] | 0, HEAP32[$ysize53$pre$phiZ2D >> 2] | 0) | 0; + if (($call67 | 0) < 0) { + $candidatePtr$3 = $arraydecay60$pre$phiZ2D; + break; + } else { + $candidatePtr$2 = $arraydecay60$pre$phiZ2D; + $k$0 = $call67; + } + } else { + $candidatePtr$2 = $candidatePtr$1; + $k$0 = $call54; + } + $arrayidx69 = $candidatePtr$2 + ($k$0 * 24 | 0) | 0; + HEAP32[$cp + ($j$0 << 2) >> 2] = $arrayidx69; + HEAP32[$ar2Handle + 1488 + ($num2$0 << 3) >> 2] = HEAP32[$candidatePtr$2 + ($k$0 * 24 | 0) + 16 >> 2]; + HEAP32[$ar2Handle + 1488 + ($num2$0 << 3) + 4 >> 2] = HEAP32[$candidatePtr$2 + ($k$0 * 24 | 0) + 20 >> 2]; + HEAP32[$ar2Handle + 13284 + ($j$0 * 52 | 0) >> 2] = $ar2Handle; + HEAP32[$ar2Handle + 13284 + ($j$0 * 52 | 0) + 4 >> 2] = $surfaceSet; + HEAP32[$ar2Handle + 13284 + ($j$0 * 52 | 0) + 8 >> 2] = $arrayidx69; + HEAP32[$ar2Handle + 13284 + ($j$0 * 52 | 0) + 12 >> 2] = $dataPtr; + $inc91 = $num2$0 + 1 | 0; + $candidatePtr$1 = $candidatePtr$2; + $i$2 = $i$2 + 1 | 0; + $j$0 = $j$0 + 1 | 0; + $num2$0 = ($inc91 | 0) == 5 ? $num$0 : $inc91; + } + if (!$j$0) break; + $j$1 = 0; + $num$1 = $num$0; + while (1) { + if (($j$1 | 0) == ($j$0 | 0)) break; + $result = $ar2Handle + 13284 + ($j$1 * 52 | 0) + 24 | 0; + $call104 = _ar2Tracking2dSub(HEAP32[$ar2Handle + 13284 + ($j$1 * 52 | 0) >> 2] | 0, HEAP32[$ar2Handle + 13284 + ($j$1 * 52 | 0) + 4 >> 2] | 0, HEAP32[$ar2Handle + 13284 + ($j$1 * 52 | 0) + 8 >> 2] | 0, HEAP32[$ar2Handle + 13284 + ($j$1 * 52 | 0) + 12 >> 2] | 0, HEAP32[$ar2Handle + 13284 + ($j$1 * 52 | 0) + 16 >> 2] | 0, $ar2Handle + 13284 + ($j$1 * 52 | 0) + 20 | 0, $result) | 0; + HEAP32[$ar2Handle + 13284 + ($j$1 * 52 | 0) + 48 >> 2] = $call104; + if (($call104 | 0) == 0 ? +HEAPF32[$result >> 2] > +HEAPF32[$simThresh >> 2] : 0) { + if ((HEAP32[$ar2Handle >> 2] | 0) == 1) { + $27 = HEAP32[$cparamLT115$pre$phiZ2D >> 2] | 0; + _arParamObserv2Ideal($27 + 104 | 0, +HEAPF32[$ar2Handle + 13284 + ($j$1 * 52 | 0) + 28 >> 2], +HEAPF32[$ar2Handle + 13284 + ($j$1 * 52 | 0) + 32 >> 2], $pos2d0, $pos2d1, HEAP32[$27 + 176 >> 2] | 0) | 0; + HEAPF32[$ar2Handle + 1872 + ($num$1 << 3) >> 2] = +HEAPF64[$pos2d0 >> 3]; + HEAPF32[$ar2Handle + 1872 + ($num$1 << 3) + 4 >> 2] = +HEAPF64[$pos2d1 >> 3]; + } else { + HEAP32[$ar2Handle + 1872 + ($num$1 << 3) >> 2] = HEAP32[$ar2Handle + 13284 + ($j$1 * 52 | 0) + 28 >> 2]; + HEAP32[$ar2Handle + 1872 + ($num$1 << 3) + 4 >> 2] = HEAP32[$ar2Handle + 13284 + ($j$1 * 52 | 0) + 32 >> 2]; + } + HEAP32[$ar2Handle + 2192 + ($num$1 * 12 | 0) >> 2] = HEAP32[$ar2Handle + 13284 + ($j$1 * 52 | 0) + 36 >> 2]; + HEAP32[$ar2Handle + 2192 + ($num$1 * 12 | 0) + 4 >> 2] = HEAP32[$ar2Handle + 13284 + ($j$1 * 52 | 0) + 40 >> 2]; + HEAP32[$ar2Handle + 2192 + ($num$1 * 12 | 0) + 8 >> 2] = HEAP32[$ar2Handle + 13284 + ($j$1 * 52 | 0) + 44 >> 2]; + $38 = HEAP32[$cp + ($j$1 << 2) >> 2] | 0; + HEAP32[$ar2Handle + 1488 + ($num$1 << 3) >> 2] = HEAP32[$38 + 16 >> 2]; + HEAP32[$ar2Handle + 1488 + ($num$1 << 3) + 4 >> 2] = HEAP32[$38 + 20 >> 2]; + HEAP32[$ar2Handle + 12320 + ($num$1 * 24 | 0) >> 2] = HEAP32[$38 >> 2]; + HEAP32[$ar2Handle + 12320 + ($num$1 * 24 | 0) + 4 >> 2] = HEAP32[$38 + 4 >> 2]; + HEAP32[$ar2Handle + 12320 + ($num$1 * 24 | 0) + 8 >> 2] = HEAP32[$38 + 8 >> 2]; + HEAP32[$ar2Handle + 12320 + ($num$1 * 24 | 0) + 12 >> 2] = 0; + $num$2 = $num$1 + 1 | 0; + } else $num$2 = $num$1; + $j$1 = $j$1 + 1 | 0; + $num$1 = $num$2; + } + $candidatePtr$0 = $candidatePtr$3; + $i$1 = $i$2; + $num$0 = $num$1; + } + $i$3 = 0; + while (1) { + if (($i$3 | 0) >= ($num$0 | 0)) break; + $arrayidx206 = $surfaceSet + 156 + ($i$3 * 24 | 0) | 0; + $arrayidx208 = $ar2Handle + 12320 + ($i$3 * 24 | 0) | 0; + HEAP32[$arrayidx206 >> 2] = HEAP32[$arrayidx208 >> 2]; + HEAP32[$arrayidx206 + 4 >> 2] = HEAP32[$arrayidx208 + 4 >> 2]; + HEAP32[$arrayidx206 + 8 >> 2] = HEAP32[$arrayidx208 + 8 >> 2]; + HEAP32[$arrayidx206 + 12 >> 2] = HEAP32[$arrayidx208 + 12 >> 2]; + HEAP32[$arrayidx206 + 16 >> 2] = HEAP32[$arrayidx208 + 16 >> 2]; + HEAP32[$arrayidx206 + 20 >> 2] = HEAP32[$arrayidx208 + 20 >> 2]; + $i$3 = $i$3 + 1 | 0; + } + HEAP32[$surfaceSet + 156 + ($num$0 * 24 | 0) + 12 >> 2] = -1; + $cmp216 = ($num$0 | 0) < 3; + if ((HEAP32[$ar2Handle >> 2] | 0) == 1) { + if ($cmp216) { + HEAP32[$contNum >> 2] = 0; + $retval$0 = -3; + break; + } + $icpHandle = $ar2Handle + 16 | 0; + $arraydecay222 = $ar2Handle + 1872 | 0; + $arraydecay224 = $ar2Handle + 2192 | 0; + $call225 = +_ar2GetTransMat_175(HEAP32[$icpHandle >> 2] | 0, $arraydecay, $arraydecay222, $arraydecay224, $num$0, $trans, 0); + HEAPF32[$err >> 2] = $call225; + $trackingThresh = $ar2Handle + 44 | 0; + if (((($call225 > +HEAPF32[$trackingThresh >> 2] ? (_icpSetInlierProbability(HEAP32[$icpHandle >> 2] | 0, .800000011920929) | 0, $call235 = +_ar2GetTransMat_175(HEAP32[$icpHandle >> 2] | 0, $trans, $arraydecay222, $arraydecay224, $num$0, $trans, 1), HEAPF32[$err >> 2] = $call235, $call235 > +HEAPF32[$trackingThresh >> 2]) : 0) ? (_icpSetInlierProbability(HEAP32[$icpHandle >> 2] | 0, .6000000238418579) | 0, $call246 = +_ar2GetTransMat_175(HEAP32[$icpHandle >> 2] | 0, $trans, $arraydecay222, $arraydecay224, $num$0, $trans, 1), HEAPF32[$err >> 2] = $call246, $call246 > +HEAPF32[$trackingThresh >> 2]) : 0) ? (_icpSetInlierProbability(HEAP32[$icpHandle >> 2] | 0, .4000000059604645) | 0, $call257 = +_ar2GetTransMat_175(HEAP32[$icpHandle >> 2] | 0, $trans, $arraydecay222, $arraydecay224, $num$0, $trans, 1), HEAPF32[$err >> 2] = $call257, $call257 > +HEAPF32[$trackingThresh >> 2]) : 0) ? (_icpSetInlierProbability(HEAP32[$icpHandle >> 2] | 0, 0.0) | 0, $call268 = +_ar2GetTransMat_175(HEAP32[$icpHandle >> 2] | 0, $trans, $arraydecay222, $arraydecay224, $num$0, $trans, 1), HEAPF32[$err >> 2] = $call268, $call268 > +HEAPF32[$trackingThresh >> 2]) : 0) { + HEAP32[$contNum >> 2] = 0; + $retval$0 = -4; + break; + } + } else { + if ($cmp216) { + HEAP32[$contNum >> 2] = 0; + $retval$0 = -3; + break; + } + $arraydecay279 = $ar2Handle + 1872 | 0; + $arraydecay281 = $ar2Handle + 2192 | 0; + $call282 = +_ar2GetTransMatHomography_176($arraydecay, $arraydecay279, $arraydecay281, $num$0, $trans, 0, 1.0); + HEAPF32[$err >> 2] = $call282; + $trackingThresh283 = $ar2Handle + 44 | 0; + if (((($call282 > +HEAPF32[$trackingThresh283 >> 2] ? ($call290 = +_ar2GetTransMatHomography_176($trans, $arraydecay279, $arraydecay281, $num$0, $trans, 1, .800000011920929), HEAPF32[$err >> 2] = $call290, $call290 > +HEAPF32[$trackingThresh283 >> 2]) : 0) ? ($call298 = +_ar2GetTransMatHomography_176($trans, $arraydecay279, $arraydecay281, $num$0, $trans, 1, .6000000238418579), HEAPF32[$err >> 2] = $call298, $call298 > +HEAPF32[$trackingThresh283 >> 2]) : 0) ? ($call306 = +_ar2GetTransMatHomography_176($trans, $arraydecay279, $arraydecay281, $num$0, $trans, 1, .4000000059604645), HEAPF32[$err >> 2] = $call306, $call306 > +HEAPF32[$trackingThresh283 >> 2]) : 0) ? ($call314 = +_ar2GetTransMatHomography_176($trans, $arraydecay279, $arraydecay281, $num$0, $trans, 1, 0.0), HEAPF32[$err >> 2] = $call314, $call314 > +HEAPF32[$trackingThresh283 >> 2]) : 0) { + HEAP32[$contNum >> 2] = 0; + $retval$0 = -4; + break; + } + } + HEAP32[$contNum >> 2] = (HEAP32[$contNum >> 2] | 0) + 1; + $j$2 = 0; + while (1) { + if (($j$2 | 0) == 3) break; + $i$4 = 0; + while (1) { + if (($i$4 | 0) == 4) break; + HEAP32[$surfaceSet + 104 + ($j$2 << 4) + ($i$4 << 2) >> 2] = HEAP32[$surfaceSet + 56 + ($j$2 << 4) + ($i$4 << 2) >> 2]; + $i$4 = $i$4 + 1 | 0; + } + $j$2 = $j$2 + 1 | 0; + } + $j$3 = 0; + while (1) { + if (($j$3 | 0) == 3) break; + $i$5 = 0; + while (1) { + if (($i$5 | 0) == 4) break; + HEAP32[$surfaceSet + 56 + ($j$3 << 4) + ($i$5 << 2) >> 2] = HEAP32[$surfaceSet + 8 + ($j$3 << 4) + ($i$5 << 2) >> 2]; + $i$5 = $i$5 + 1 | 0; + } + $j$3 = $j$3 + 1 | 0; + } + $j$4 = 0; + while (1) { + if (($j$4 | 0) == 3) { + $retval$0 = 0; + break L1; + } + $i$6 = 0; + while (1) { + if (($i$6 | 0) == 4) break; + HEAP32[$surfaceSet + 8 + ($j$4 << 4) + ($i$6 << 2) >> 2] = HEAP32[$trans + ($j$4 << 4) + ($i$6 << 2) >> 2]; + $i$6 = $i$6 + 1 | 0; + } + $j$4 = $j$4 + 1 | 0; + } + } + } else $retval$0 = -1; while (0); + STACKTOP = sp; + return $retval$0 | 0; +} + +function _arGetTransMatMultiSquare2($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0389 = 0, $$0394 = 0, $$0404 = 0.0, $$0405 = 0, $$0407 = 0, $$0410 = 0, $$0413 = 0.0, $$1 = 0, $$10 = 0, $$1390 = 0, $$1395 = 0, $$1406 = 0, $$1408 = 0, $$1411 = 0, $$1414 = 0.0, $$2 = 0, $$2391 = 0, $$2396 = 0, $$2409 = 0, $$2412 = 0, $$2415 = 0.0, $$3 = 0, $$3392 = 0, $$3397 = 0, $$3416 = 0.0, $$4 = 0, $$4393 = 0, $$4398 = 0, $$4417 = 0.0, $$5 = 0, $$5399 = 0, $$5418 = 0.0, $$6 = 0, $$6400 = 0, $$6419 = 0.0, $$7 = 0, $$7401 = 0, $$8 = 0, $$8402 = 0, $$9 = 0, $$9403 = 0, $$pre441 = 0, $10 = 0, $109 = 0, $111 = 0, $114 = 0, $116 = 0, $118 = 0, $12 = 0, $120 = 0, $123 = 0, $125 = 0, $128 = 0, $135 = 0, $145 = 0, $155 = 0, $16 = 0, $166 = 0, $214 = 0, $217 = 0, $218 = 0, $219 = 0.0, $222 = 0.0, $225 = 0.0, $228 = 0.0, $23 = 0.0, $232 = 0.0, $233 = 0, $234 = 0.0, $235 = 0, $243 = 0.0, $244 = 0.0, $253 = 0.0, $254 = 0.0, $263 = 0.0, $264 = 0.0, $273 = 0.0, $274 = 0.0, $287 = 0, $291 = 0, $293 = 0, $36 = 0, $39 = 0, $42 = 0, $44 = 0, $47 = 0, $5 = 0, $51 = 0, $6 = 0, $63 = 0.0, $7 = 0, $78 = 0, $79 = 0, $8 = 0, $81 = 0, $83 = 0, $9 = 0, $90 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 208 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(208); + $vararg_buffer1 = sp + 200 | 0; + $vararg_buffer = sp + 192 | 0; + $5 = sp + 96 | 0; + $6 = sp; + $7 = $3 + 4 | 0; + $8 = HEAP32[$7 >> 2] | 0; + $9 = $3 + 112 | 0; + $10 = $3 + 120 | 0; + $$0394 = 0; + while (1) { + if (($$0394 | 0) >= ($8 | 0)) break; + $12 = HEAP32[$3 >> 2] | 0; + $16 = $12 + ($$0394 * 320 | 0) | 0; + if (!(HEAP32[$12 + ($$0394 * 320 | 0) + 4 >> 2] | 0)) { + $$0 = -1; + $$0389 = 0; + while (1) { + if (($$0389 | 0) >= ($2 | 0)) break; + if ((HEAP32[$1 + ($$0389 << 8) + 8 >> 2] | 0) == (HEAP32[$16 >> 2] | 0) ? ($23 = +HEAPF64[$1 + ($$0389 << 8) + 40 >> 3], !($23 < +HEAPF64[$9 >> 3])) : 0) if (($$0 | 0) != -1 ? !(+HEAPF64[$1 + ($$0 << 8) + 40 >> 3] < $23) : 0) $$1 = $$0; else $$1 = $$0389; else $$1 = $$0; + $$0 = $$1; + $$0389 = $$0389 + 1 | 0; + } + HEAP32[$12 + ($$0394 * 320 | 0) + 304 >> 2] = $$0; + if (($$0 | 0) > -1) HEAP32[$1 + ($$0 << 8) + 16 >> 2] = HEAP32[$1 + ($$0 << 8) + 20 >> 2]; + } else { + $36 = $12 + ($$0394 * 320 | 0) + 312 | 0; + $$1390 = 0; + $$2 = -1; + while (1) { + if (($$1390 | 0) >= ($2 | 0)) break; + $39 = HEAP32[$1 + ($$1390 << 8) + 12 >> 2] | 0; + if (($39 | 0) == 0 ? ($42 = $1 + ($$1390 << 8) + 248 | 0, $44 = HEAP32[$42 >> 2] | 0, $47 = HEAP32[$42 + 4 >> 2] | 0, !(($44 | 0) == 0 & ($47 | 0) == 0)) : 0) { + $51 = $36; + if (($44 | 0) == (HEAP32[$51 >> 2] | 0) ? ($47 | 0) == (HEAP32[$51 + 4 >> 2] | 0) : 0) label = 20; else $$3 = $$2; + } else if (($39 | 0) == (HEAP32[$16 >> 2] | 0)) label = 20; else $$3 = $$2; + if ((label | 0) == 20) { + label = 0; + $63 = +HEAPF64[$1 + ($$1390 << 8) + 48 >> 3]; + if (!($63 < +HEAPF64[$10 >> 3])) if (($$2 | 0) != -1 ? !(+HEAPF64[$1 + ($$2 << 8) + 48 >> 3] < $63) : 0) $$3 = $$2; else $$3 = $$1390; else $$3 = $$2; + } + $$1390 = $$1390 + 1 | 0; + $$2 = $$3; + } + HEAP32[$12 + ($$0394 * 320 | 0) + 304 >> 2] = $$2; + if (($$2 | 0) > -1) HEAP32[$1 + ($$2 << 8) + 16 >> 2] = HEAP32[$1 + ($$2 << 8) + 24 >> 2]; + } + $$0394 = $$0394 + 1 | 0; + } + $$0405 = 0; + $$0407 = 0; + $$0410 = 0; + $$1395 = 0; + $78 = $8; + while (1) { + if (($$1395 | 0) >= ($78 | 0)) break; + $79 = HEAP32[$3 >> 2] | 0; + $81 = HEAP32[$79 + ($$1395 * 320 | 0) + 304 >> 2] | 0; + do if (($81 | 0) < 0) { + $$1406 = $$0405; + $$2409 = $$0407; + $$2412 = $$0410; + } else { + $83 = $1 + ($81 << 8) | 0; + if (+_arGetTransMatSquare($0, $83, +HEAPF64[$79 + ($$1395 * 320 | 0) + 8 >> 3], $6) > 4.0) { + HEAP32[(HEAP32[$3 >> 2] | 0) + ($$1395 * 320 | 0) + 304 >> 2] = -1; + $90 = $1 + ($81 << 8) + 236 | 0; + if (HEAP32[$90 >> 2] | 0) { + $$1406 = $$0405; + $$2409 = $$0407; + $$2412 = $$0410; + break; + } + HEAP32[$90 >> 2] = 7; + $$1406 = $$0405; + $$2409 = $$0407; + $$2412 = $$0410; + break; + } + $$pre441 = HEAP32[$83 >> 2] | 0; + L45 : do if (($$0405 | 0) == 0 | ($$0407 | 0) < ($$pre441 | 0)) { + $$2391 = 0; + while (1) { + if (($$2391 | 0) == 3) { + $$1408 = $$pre441; + $$1411 = $$1395; + break L45; + } + $$4 = 0; + while (1) { + if (($$4 | 0) == 4) break; + HEAPF64[$5 + ($$2391 << 5) + ($$4 << 3) >> 3] = +HEAPF64[$6 + ($$2391 << 5) + ($$4 << 3) >> 3]; + $$4 = $$4 + 1 | 0; + } + $$2391 = $$2391 + 1 | 0; + } + } else { + $$1408 = $$0407; + $$1411 = $$0410; + } while (0); + $$1406 = $$0405 + 1 | 0; + $$2409 = $$1408; + $$2412 = $$1411; + } while (0); + $$0405 = $$1406; + $$0407 = $$2409; + $$0410 = $$2412; + $$1395 = $$1395 + 1 | 0; + $78 = HEAP32[$7 >> 2] | 0; + } + L57 : do if (($$0405 | 0) != 0 ? ($$0405 | 0) >= (HEAP32[$3 + 128 >> 2] | 0) : 0) { + _arUtilMatMul($5, (HEAP32[$3 >> 2] | 0) + ($$0410 * 320 | 0) + 112 | 0, $6) | 0; + $109 = $$0405 << 2; + $111 = _malloc($$0405 << 6) | 0; + if (!$111) { + _arLog(0, 3, 45930, $vararg_buffer); + _exit(1); + } + $114 = _malloc($$0405 * 96 | 0) | 0; + if (!$114) { + _arLog(0, 3, 45930, $vararg_buffer1); + _exit(1); + } + $116 = HEAP32[$7 >> 2] | 0; + $$2396 = 0; + $$3392 = 0; + while (1) { + if (($$2396 | 0) >= ($116 | 0)) break; + $118 = HEAP32[$3 >> 2] | 0; + $120 = HEAP32[$118 + ($$2396 * 320 | 0) + 304 >> 2] | 0; + if (($120 | 0) < 0) $$4393 = $$3392; else { + $123 = HEAP32[$1 + ($120 << 8) + 16 >> 2] | 0; + $125 = (4 - $123 | 0) % 4 | 0; + $128 = $$3392 << 3; + HEAPF64[$111 + ($128 << 3) >> 3] = +HEAPF64[$1 + ($120 << 8) + 168 + ($125 << 4) >> 3]; + HEAPF64[$111 + (($128 | 1) << 3) >> 3] = +HEAPF64[$1 + ($120 << 8) + 168 + ($125 << 4) + 8 >> 3]; + $135 = (5 - $123 | 0) % 4 | 0; + HEAPF64[$111 + (($128 | 2) << 3) >> 3] = +HEAPF64[$1 + ($120 << 8) + 168 + ($135 << 4) >> 3]; + HEAPF64[$111 + (($128 | 3) << 3) >> 3] = +HEAPF64[$1 + ($120 << 8) + 168 + ($135 << 4) + 8 >> 3]; + $145 = (6 - $123 | 0) % 4 | 0; + HEAPF64[$111 + (($128 | 4) << 3) >> 3] = +HEAPF64[$1 + ($120 << 8) + 168 + ($145 << 4) >> 3]; + HEAPF64[$111 + (($128 | 5) << 3) >> 3] = +HEAPF64[$1 + ($120 << 8) + 168 + ($145 << 4) + 8 >> 3]; + $155 = (7 - $123 | 0) % 4 | 0; + HEAPF64[$111 + (($128 | 6) << 3) >> 3] = +HEAPF64[$1 + ($120 << 8) + 168 + ($155 << 4) >> 3]; + HEAPF64[$111 + (($128 | 7) << 3) >> 3] = +HEAPF64[$1 + ($120 << 8) + 168 + ($155 << 4) + 8 >> 3]; + $166 = $$3392 * 12 | 0; + HEAPF64[$114 + ($166 << 3) >> 3] = +HEAPF64[$118 + ($$2396 * 320 | 0) + 208 >> 3]; + HEAPF64[$114 + (($166 | 1) << 3) >> 3] = +HEAPF64[$118 + ($$2396 * 320 | 0) + 216 >> 3]; + HEAPF64[$114 + (($166 | 2) << 3) >> 3] = +HEAPF64[$118 + ($$2396 * 320 | 0) + 224 >> 3]; + HEAPF64[$114 + (($166 | 3) << 3) >> 3] = +HEAPF64[$118 + ($$2396 * 320 | 0) + 232 >> 3]; + HEAPF64[$114 + ($166 + 4 << 3) >> 3] = +HEAPF64[$118 + ($$2396 * 320 | 0) + 240 >> 3]; + HEAPF64[$114 + ($166 + 5 << 3) >> 3] = +HEAPF64[$118 + ($$2396 * 320 | 0) + 248 >> 3]; + HEAPF64[$114 + ($166 + 6 << 3) >> 3] = +HEAPF64[$118 + ($$2396 * 320 | 0) + 256 >> 3]; + HEAPF64[$114 + ($166 + 7 << 3) >> 3] = +HEAPF64[$118 + ($$2396 * 320 | 0) + 264 >> 3]; + HEAPF64[$114 + ($166 + 8 << 3) >> 3] = +HEAPF64[$118 + ($$2396 * 320 | 0) + 272 >> 3]; + HEAPF64[$114 + ($166 + 9 << 3) >> 3] = +HEAPF64[$118 + ($$2396 * 320 | 0) + 280 >> 3]; + HEAPF64[$114 + ($166 + 10 << 3) >> 3] = +HEAPF64[$118 + ($$2396 * 320 | 0) + 288 >> 3]; + HEAPF64[$114 + ($166 + 11 << 3) >> 3] = +HEAPF64[$118 + ($$2396 * 320 | 0) + 296 >> 3]; + $$4393 = $$3392 + 1 | 0; + } + $$2396 = $$2396 + 1 | 0; + $$3392 = $$4393; + } + $214 = $3 + 104 | 0; + $217 = ($4 | 0) != 0; + if (!(HEAP32[$214 >> 2] | 0)) { + $218 = $3 + 8 | 0; + $219 = +_arGetTransMat($0, $6, $111, $114, $109, $218); + if ($217 & $219 >= 20.0) { + _icpSetInlierProbability(HEAP32[$0 >> 2] | 0, .8) | 0; + $222 = +_arGetTransMatRobust($0, $6, $111, $114, $109, $218); + if ($222 >= 20.0) { + _icpSetInlierProbability(HEAP32[$0 >> 2] | 0, .6) | 0; + $225 = +_arGetTransMatRobust($0, $6, $111, $114, $109, $218); + if ($225 >= 20.0) { + _icpSetInlierProbability(HEAP32[$0 >> 2] | 0, .4) | 0; + $228 = +_arGetTransMatRobust($0, $6, $111, $114, $109, $218); + if (!($228 >= 20.0)) $$0413 = $228; else { + _icpSetInlierProbability(HEAP32[$0 >> 2] | 0, 0.0) | 0; + $$0413 = +_arGetTransMatRobust($0, $6, $111, $114, $109, $218); + } + } else $$0413 = $225; + } else $$0413 = $222; + } else $$0413 = $219; + _free($114); + _free($111); + $$6419 = $$0413; + } else { + $232 = +_arGetTransMat($0, $6, $111, $114, $109, $5); + $233 = $3 + 8 | 0; + $234 = +_arGetTransMat($0, $233, $111, $114, $109, $233); + $235 = $232 < $234; + L82 : do if ($217) { + L84 : do if ($235) { + $$5 = 0; + while (1) { + if (($$5 | 0) == 3) { + $$1414 = $232; + break L84; + } + $$3397 = 0; + while (1) { + if (($$3397 | 0) == 4) break; + HEAPF64[$3 + 8 + ($$5 << 5) + ($$3397 << 3) >> 3] = +HEAPF64[$5 + ($$5 << 5) + ($$3397 << 3) >> 3]; + $$3397 = $$3397 + 1 | 0; + } + $$5 = $$5 + 1 | 0; + } + } else $$1414 = $234; while (0); + if ($$1414 >= 20.0) { + _icpSetInlierProbability(HEAP32[$0 >> 2] | 0, .8) | 0; + $243 = +_arGetTransMatRobust($0, $6, $111, $114, $109, $5); + $244 = +_arGetTransMatRobust($0, $233, $111, $114, $109, $233); + L95 : do if ($243 < $244) { + $$6 = 0; + while (1) { + if (($$6 | 0) == 3) { + $$2415 = $243; + break L95; + } + $$4398 = 0; + while (1) { + if (($$4398 | 0) == 4) break; + HEAPF64[$3 + 8 + ($$6 << 5) + ($$4398 << 3) >> 3] = +HEAPF64[$5 + ($$6 << 5) + ($$4398 << 3) >> 3]; + $$4398 = $$4398 + 1 | 0; + } + $$6 = $$6 + 1 | 0; + } + } else $$2415 = $244; while (0); + if ($$2415 >= 20.0) { + _icpSetInlierProbability(HEAP32[$0 >> 2] | 0, .6) | 0; + $253 = +_arGetTransMatRobust($0, $6, $111, $114, $109, $5); + $254 = +_arGetTransMatRobust($0, $233, $111, $114, $109, $233); + L106 : do if ($253 < $254) { + $$7 = 0; + while (1) { + if (($$7 | 0) == 3) { + $$3416 = $253; + break L106; + } + $$5399 = 0; + while (1) { + if (($$5399 | 0) == 4) break; + HEAPF64[$3 + 8 + ($$7 << 5) + ($$5399 << 3) >> 3] = +HEAPF64[$5 + ($$7 << 5) + ($$5399 << 3) >> 3]; + $$5399 = $$5399 + 1 | 0; + } + $$7 = $$7 + 1 | 0; + } + } else $$3416 = $254; while (0); + if ($$3416 >= 20.0) { + _icpSetInlierProbability(HEAP32[$0 >> 2] | 0, .4) | 0; + $263 = +_arGetTransMatRobust($0, $6, $111, $114, $109, $5); + $264 = +_arGetTransMatRobust($0, $233, $111, $114, $109, $233); + L117 : do if ($263 < $264) { + $$8 = 0; + while (1) { + if (($$8 | 0) == 3) { + $$4417 = $263; + break L117; + } + $$6400 = 0; + while (1) { + if (($$6400 | 0) == 4) break; + HEAPF64[$3 + 8 + ($$8 << 5) + ($$6400 << 3) >> 3] = +HEAPF64[$5 + ($$8 << 5) + ($$6400 << 3) >> 3]; + $$6400 = $$6400 + 1 | 0; + } + $$8 = $$8 + 1 | 0; + } + } else $$4417 = $264; while (0); + if ($$4417 >= 20.0) { + _icpSetInlierProbability(HEAP32[$0 >> 2] | 0, 0.0) | 0; + $273 = +_arGetTransMatRobust($0, $6, $111, $114, $109, $5); + $274 = +_arGetTransMatRobust($0, $233, $111, $114, $109, $233); + if ($273 < $274) { + $$9 = 0; + while (1) { + if (($$9 | 0) == 3) { + $$5418 = $273; + break L82; + } + $$7401 = 0; + while (1) { + if (($$7401 | 0) == 4) break; + HEAPF64[$3 + 8 + ($$9 << 5) + ($$7401 << 3) >> 3] = +HEAPF64[$5 + ($$9 << 5) + ($$7401 << 3) >> 3]; + $$7401 = $$7401 + 1 | 0; + } + $$9 = $$9 + 1 | 0; + } + } else $$5418 = $274; + } else $$5418 = $$4417; + } else $$5418 = $$3416; + } else $$5418 = $$2415; + } else $$5418 = $$1414; + } else if ($235) { + $$10 = 0; + while (1) { + if (($$10 | 0) == 3) { + $$5418 = $232; + break L82; + } + $$8402 = 0; + while (1) { + if (($$8402 | 0) == 4) break; + HEAPF64[$3 + 8 + ($$10 << 5) + ($$8402 << 3) >> 3] = +HEAPF64[$5 + ($$10 << 5) + ($$8402 << 3) >> 3]; + $$8402 = $$8402 + 1 | 0; + } + $$10 = $$10 + 1 | 0; + } + } else $$5418 = $234; while (0); + _free($114); + _free($111); + $$6419 = $$5418; + } + if ($$6419 < 20.0) { + HEAP32[$214 >> 2] = 1; + $$0404 = $$6419; + break; + } + HEAP32[$214 >> 2] = 0; + $287 = HEAP32[$7 >> 2] | 0; + $$9403 = 0; + while (1) { + if (($$9403 | 0) >= ($287 | 0)) { + $$0404 = $$6419; + break L57; + } + $291 = HEAP32[(HEAP32[$3 >> 2] | 0) + ($$9403 * 320 | 0) + 304 >> 2] | 0; + if (($291 | 0) >= 0 ? ($293 = $1 + ($291 << 8) + 236 | 0, (HEAP32[$293 >> 2] | 0) == 0) : 0) HEAP32[$293 >> 2] = 8; + $$9403 = $$9403 + 1 | 0; + } + } else label = 45; while (0); + if ((label | 0) == 45) { + HEAP32[$3 + 104 >> 2] = 0; + $$0404 = -1.0; + } + STACKTOP = sp; + return +$$0404; +} + +function __ZN6vision36ComputeSubpixelHessianFineOctavePairEPfS0_RKNS_5ImageES3_S3_ii($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $10 = 0, $104 = 0, $108 = 0, $11 = 0, $110 = 0, $118 = 0, $12 = 0, $123 = 0, $127 = 0, $129 = 0, $13 = 0, $131 = 0, $133 = 0, $135 = 0, $138 = 0.0, $14 = 0, $146 = 0, $151 = 0, $155 = 0, $164 = 0, $169 = 0, $173 = 0, $183 = 0, $188 = 0, $192 = 0, $194 = 0.0, $203 = 0, $208 = 0, $212 = 0, $215 = 0.0, $216 = 0.0, $222 = 0.0, $224 = 0.0, $229 = 0.0, $231 = 0.0, $238 = 0.0, $239 = 0.0, $24 = 0, $244 = 0.0, $245 = 0.0, $252 = 0.0, $254 = 0, $29 = 0, $33 = 0, $34 = 0, $36 = 0, $44 = 0, $49 = 0, $53 = 0, $54 = 0, $62 = 0, $67 = 0, $7 = 0, $71 = 0, $73 = 0, $8 = 0, $81 = 0, $86 = 0, $9 = 0, $90 = 0, $91 = 0, $99 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $7 = sp + 28 | 0; + $8 = sp + 24 | 0; + $9 = sp + 20 | 0; + $10 = sp + 16 | 0; + $11 = sp + 12 | 0; + $12 = sp + 8 | 0; + $13 = sp + 4 | 0; + $14 = sp; + if (($5 | 0) > 0 ? ($5 + 1 | 0) >>> 0 < (__ZNK6vision5Image5widthEv($3) | 0) >>> 0 : 0) { + $34 = $6 + -1 | 0; + if (($6 | 0) > 0 ? ($36 = $6 + 1 | 0, $36 >>> 0 < (__ZNK6vision5Image6heightEv($3) | 0) >>> 0) : 0) { + $54 = __ZNK6vision5Image5widthEv($2) | 0; + if (($54 | 0) != (__ZNK6vision5Image5widthEv($3) | 0)) { + $62 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30218) | 0, 28600) | 0, 39072) | 0, 415) | 0, 39079) | 0, 29150) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $62 + (HEAP32[(HEAP32[$62 >> 2] | 0) + -12 >> 2] | 0) | 0); + $67 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $71 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$67 >> 2] | 0) + 28 >> 2] & 127]($67, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($62, $71) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($62) | 0; + _abort(); + } + $73 = (__ZNK6vision5Image5widthEv($2) | 0) >>> 1; + if (($73 | 0) != (__ZNK6vision5Image5widthEv($4) | 0)) { + $81 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29180) | 0, 28600) | 0, 39072) | 0, 416) | 0, 39079) | 0, 29150) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $81 + (HEAP32[(HEAP32[$81 >> 2] | 0) + -12 >> 2] | 0) | 0); + $86 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $90 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$86 >> 2] | 0) + 28 >> 2] & 127]($86, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($81, $90) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($81) | 0; + _abort(); + } + $91 = __ZNK6vision5Image6heightEv($2) | 0; + if (($91 | 0) != (__ZNK6vision5Image6heightEv($3) | 0)) { + $99 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30270) | 0, 28600) | 0, 39072) | 0, 417) | 0, 39079) | 0, 29150) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $99 + (HEAP32[(HEAP32[$99 >> 2] | 0) + -12 >> 2] | 0) | 0); + $104 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $108 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$104 >> 2] | 0) + 28 >> 2] & 127]($104, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($99, $108) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($99) | 0; + _abort(); + } + $110 = (__ZNK6vision5Image6heightEv($2) | 0) >>> 1; + if (($110 | 0) != (__ZNK6vision5Image6heightEv($4) | 0)) { + $118 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29296) | 0, 28600) | 0, 39072) | 0, 418) | 0, 39079) | 0, 29150) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $118 + (HEAP32[(HEAP32[$118 >> 2] | 0) + -12 >> 2] | 0) | 0); + $123 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $127 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$123 >> 2] | 0) + 28 >> 2] & 127]($123, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($118, $127) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($118) | 0; + _abort(); + } + $129 = (__ZNK6vision5Image3getIfEEPKT_m($2, $34) | 0) + ($5 << 2) | 0; + $131 = (__ZNK6vision5Image3getIfEEPKT_m($2, $6) | 0) + ($5 << 2) | 0; + $133 = (__ZNK6vision5Image3getIfEEPKT_m($2, $36) | 0) + ($5 << 2) | 0; + $135 = (__ZNK6vision5Image3getIfEEPKT_m($3, $6) | 0) + ($5 << 2) | 0; + __ZN6vision25bilinear_downsample_pointERfS0_ffi($8, $9, +($5 | 0), +($6 | 0), 1); + $138 = +HEAPF32[$8 >> 2]; + if (!($138 + -.5 >= 0.0)) { + $146 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30324) | 0, 28600) | 0, 39072) | 0, 428) | 0, 39079) | 0, 30365) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $146 + (HEAP32[(HEAP32[$146 >> 2] | 0) + -12 >> 2] | 0) | 0); + $151 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $155 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$151 >> 2] | 0) + 28 >> 2] & 127]($151, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($146, $155) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($146) | 0; + _abort(); + } + if (!(+HEAPF32[$9 >> 2] + -.5 >= 0.0)) { + $164 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30419) | 0, 28600) | 0, 39072) | 0, 429) | 0, 39079) | 0, 30460) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $164 + (HEAP32[(HEAP32[$164 >> 2] | 0) + -12 >> 2] | 0) | 0); + $169 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $173 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$169 >> 2] | 0) + 28 >> 2] & 127]($169, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($164, $173) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($164) | 0; + _abort(); + } + if (!($138 + .5 < +((__ZNK6vision5Image5widthEv($4) | 0) >>> 0))) { + $183 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30514) | 0, 28600) | 0, 39072) | 0, 430) | 0, 39079) | 0, 30365) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $183 + (HEAP32[(HEAP32[$183 >> 2] | 0) + -12 >> 2] | 0) | 0); + $188 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $192 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$188 >> 2] | 0) + 28 >> 2] & 127]($188, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($183, $192) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($183) | 0; + _abort(); + } + $194 = +HEAPF32[$9 >> 2] + .5; + if ($194 < +((__ZNK6vision5Image6heightEv($4) | 0) >>> 0)) { + __ZN6vision26ComputeSubpixelDerivativesERfS0_S0_S0_S0_RKNS_5ImageEii($10, $11, $12, $13, $14, $3, $5, $6); + $215 = +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($4, +HEAPF32[$8 >> 2], +HEAPF32[$9 >> 2]); + $216 = +HEAPF32[$131 >> 2]; + $222 = $215 + ($216 - +HEAPF32[$135 >> 2] * 2.0); + $224 = +HEAPF32[$131 + -4 >> 2]; + $229 = $224 + +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($4, +HEAPF32[$8 >> 2] + .5, +HEAPF32[$9 >> 2]); + $231 = +HEAPF32[$131 + 4 >> 2]; + $238 = ($229 - ($231 + +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($4, +HEAPF32[$8 >> 2] + -.5, +HEAPF32[$9 >> 2]))) * .25; + $239 = +HEAPF32[$129 >> 2]; + $244 = $239 + +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($4, +HEAPF32[$8 >> 2], +HEAPF32[$9 >> 2] + .5); + $245 = +HEAPF32[$133 >> 2]; + $252 = ($244 - ($245 + +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($4, +HEAPF32[$8 >> 2], +HEAPF32[$9 >> 2] + -.5))) * .25; + HEAP32[$0 >> 2] = HEAP32[$12 >> 2]; + $254 = HEAP32[$14 >> 2] | 0; + HEAP32[$0 + 4 >> 2] = $254; + HEAPF32[$0 + 8 >> 2] = $238; + HEAP32[$0 + 12 >> 2] = $254; + HEAP32[$0 + 16 >> 2] = HEAP32[$13 >> 2]; + HEAPF32[$0 + 20 >> 2] = $252; + HEAPF32[$0 + 24 >> 2] = $238; + HEAPF32[$0 + 28 >> 2] = $252; + HEAPF32[$0 + 32 >> 2] = $222; + HEAPF32[$1 >> 2] = -+HEAPF32[$10 >> 2]; + HEAPF32[$1 + 4 >> 2] = -+HEAPF32[$11 >> 2]; + HEAPF32[$1 + 8 >> 2] = -(($215 - $216) * .5); + STACKTOP = sp; + return; + } else { + $203 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30565) | 0, 28600) | 0, 39072) | 0, 431) | 0, 39079) | 0, 30460) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $203 + (HEAP32[(HEAP32[$203 >> 2] | 0) + -12 >> 2] | 0) | 0); + $208 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $212 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$208 >> 2] | 0) + 28 >> 2] & 127]($208, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($203, $212) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($203) | 0; + _abort(); + } + } + $44 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29018) | 0, 28600) | 0, 39072) | 0, 414) | 0, 39079) | 0, 29077) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $44 + (HEAP32[(HEAP32[$44 >> 2] | 0) + -12 >> 2] | 0) | 0); + $49 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $53 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$49 >> 2] | 0) + 28 >> 2] & 127]($49, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($44, $53) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($44) | 0; + _abort(); + } + $24 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 28944) | 0, 28600) | 0, 39072) | 0, 413) | 0, 39079) | 0, 29002) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $24 + (HEAP32[(HEAP32[$24 >> 2] | 0) + -12 >> 2] | 0) | 0); + $29 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $33 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$29 >> 2] | 0) + 28 >> 2] & 127]($29, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($24, $33) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($24) | 0; + _abort(); +} + +function __ZNSt3__213__nth_elementIRNS_7greaterINS_4pairIfmEEEENS_11__wrap_iterIPS3_EEEEvT0_S9_S9_T_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$2 = 0, $$3 = 0, $$4 = 0, $$5 = 0, $$byval_copy5 = 0, $$byval_copy6 = 0, $$byval_copy7 = 0, $$cast222 = 0, $$phi$trans$insert = 0, $$phi$trans$insert262 = 0, $$phi$trans$insert264 = 0, $$phi$trans$insert266 = 0, $$phi$trans$insert268 = 0, $$pre = 0, $$pre$phi270Z2D = 0, $$pre$phi271Z2D = 0, $$pre$phi272Z2D = 0, $$pre$phi273Z2D = 0, $$pre$phi275Z2D = 0, $$pre$phi279Z2D = 0, $$pre$phiZ2D = 0, $$pre276 = 0, $$sroa$0$0$ptr = 0, $$sroa$0$1 = 0, $$sroa$0$1$ptr = 0, $$sroa$0$2$ptr = 0, $$sroa$0$3$in = 0, $$sroa$0$4 = 0, $$sroa$0$4$ptr = 0, $$sroa$0$5$ptr = 0, $$sroa$0107$0 = 0, $$sroa$0107$2$ptr = 0, $$sroa$0107$3$ptr = 0, $$sroa$0107$4$ptr = 0, $$sroa$068$0$ptr = 0, $$sroa$068$1 = 0, $$sroa$068$2 = 0, $$sroa$068$3 = 0, $$sroa$068$4 = 0, $$sroa$068$5 = 0, $$sroa$068$6 = 0, $$sroa$068$6$ptr = 0, $10 = 0, $103 = 0, $105 = 0, $106 = 0, $107 = 0, $11 = 0, $111 = 0, $113 = 0.0, $118 = 0, $12 = 0, $121 = 0, $123 = 0, $125 = 0, $126 = 0, $127 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $135 = 0, $136 = 0, $137 = 0.0, $138 = 0, $139 = 0.0, $148 = 0, $149 = 0, $15 = 0, $150 = 0.0, $157 = 0, $16 = 0, $160 = 0, $162 = 0, $163 = 0, $164 = 0, $17 = 0, $173 = 0.0, $174 = 0.0, $177 = 0, $178 = 0, $179 = 0, $180 = 0, $183 = 0, $185 = 0, $186 = 0, $19 = 0, $191 = 0, $193 = 0.0, $194 = 0.0, $20 = 0, $202 = 0, $204 = 0.0, $205 = 0.0, $21 = 0, $22 = 0.0, $23 = 0, $24 = 0.0, $27 = 0, $28 = 0, $29 = 0, $31 = 0, $32 = 0, $38 = 0, $39 = 0, $4 = 0, $41 = 0, $42 = 0, $43 = 0.0, $44 = 0.0, $5 = 0, $51 = 0, $53 = 0, $54 = 0, $55 = 0.0, $56 = 0.0, $6 = 0, $60 = 0, $64 = 0.0, $68 = 0, $7 = 0, $73 = 0, $79 = 0, $8 = 0, $80 = 0.0, $81 = 0, $82 = 0.0, $9 = 0, $91 = 0, $92 = 0, $93 = 0.0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy7 = sp + 40 | 0; + $$byval_copy6 = sp + 36 | 0; + $$byval_copy5 = sp + 32 | 0; + $4 = sp + 28 | 0; + $5 = sp + 24 | 0; + $6 = sp + 20 | 0; + $7 = sp + 16 | 0; + $8 = sp + 12 | 0; + $9 = sp + 8 | 0; + $10 = sp + 4 | 0; + $11 = sp; + $12 = HEAP32[$1 >> 2] | 0; + L1 : while (1) { + $13 = HEAP32[$2 >> 2] | 0; + $$cast222 = $13; + $15 = $13 + -8 | 0; + $16 = $15; + $17 = $13 + -4 | 0; + if (($12 | 0) == ($13 | 0)) break; + $$pre = HEAP32[$0 >> 2] | 0; + $20 = $$pre; + $23 = $$pre; + L4 : while (1) { + $19 = $$cast222 - $20 | 0; + $21 = $19 >> 3; + switch ($21 | 0) { + case 1: + case 0: + { + break L1; + break; + } + case 2: + { + label = 5; + break L1; + break; + } + case 3: + { + label = 10; + break L1; + break; + } + default: + {} + } + if (($19 | 0) < 64) { + label = 12; + break L1; + } + $38 = $21 >>> 1; + $39 = $23 + ($38 << 3) | 0; + HEAP32[$9 >> 2] = $20; + HEAP32[$10 >> 2] = $39; + HEAP32[$11 >> 2] = $16; + HEAP32[$$byval_copy5 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$$byval_copy6 >> 2] = HEAP32[$10 >> 2]; + HEAP32[$$byval_copy7 >> 2] = HEAP32[$11 >> 2]; + $41 = __ZNSt3__27__sort3IRNS_7greaterINS_4pairIfmEEEENS_11__wrap_iterIPS3_EEEEjT0_S9_S9_T_($$byval_copy5, $$byval_copy6, $$byval_copy7, $3) | 0; + $42 = $20; + $43 = +HEAPF32[$39 >> 2]; + $44 = +HEAPF32[$42 >> 2]; + if ($43 < $44) { + label = 53; + break; + } + $$pre276 = $23 + ($38 << 3) + 4 | 0; + if (!($44 < $43) ? (HEAP32[$$pre276 >> 2] | 0) >>> 0 < (HEAP32[$42 + 4 >> 2] | 0) >>> 0 : 0) { + label = 53; + break; + } + $$sroa$0$0$ptr = $15; + while (1) { + $51 = $$sroa$0$0$ptr + -8 | 0; + if (($51 | 0) == ($42 | 0)) break; + $113 = +HEAPF32[$51 >> 2]; + if ($43 < $113) { + label = 47; + break L4; + } + if (!($113 < $43) ? ($118 = HEAP32[$$sroa$0$0$ptr + -4 >> 2] | 0, (HEAP32[$$pre276 >> 2] | 0) >>> 0 < $118 >>> 0) : 0) { + label = 51; + break L4; + } + $$sroa$0$0$ptr = $51; + } + $53 = $42 + 8 | 0; + $54 = $53; + $55 = +HEAPF32[$15 >> 2]; + $56 = +HEAPF32[$23 >> 2]; + do if ($55 < $56) $$sroa$068$1 = $54; else { + if (!($56 < $55)) { + $60 = $23 + 4 | 0; + if ((HEAP32[$17 >> 2] | 0) >>> 0 < (HEAP32[$60 >> 2] | 0) >>> 0) { + $$sroa$068$1 = $54; + break; + } else $$pre$phi279Z2D = $60; + } else $$pre$phi279Z2D = $23 + 4 | 0; + $$sroa$068$0$ptr = $53; + while (1) { + if (($$sroa$068$0$ptr | 0) == ($15 | 0)) break L1; + $64 = +HEAPF32[$$sroa$068$0$ptr >> 2]; + if ($64 < $56) { + label = 25; + break; + } + if (!($56 < $64) ? ($68 = HEAP32[$$sroa$068$0$ptr + 4 >> 2] | 0, $68 >>> 0 < (HEAP32[$$pre$phi279Z2D >> 2] | 0) >>> 0) : 0) { + label = 28; + break; + } + $$sroa$068$0$ptr = $$sroa$068$0$ptr + 8 | 0; + } + if ((label | 0) == 25) { + label = 0; + $$phi$trans$insert264 = $$sroa$068$0$ptr + 4 | 0; + $$pre$phi271Z2D = $$phi$trans$insert264; + $73 = HEAP32[$$phi$trans$insert264 >> 2] | 0; + } else if ((label | 0) == 28) { + label = 0; + $$pre$phi271Z2D = $$sroa$068$0$ptr + 4 | 0; + $73 = $68; + } + HEAPF32[$$sroa$068$0$ptr >> 2] = $55; + HEAPF32[$15 >> 2] = $64; + HEAP32[$$pre$phi271Z2D >> 2] = HEAP32[$17 >> 2]; + HEAP32[$17 >> 2] = $73; + $$sroa$068$1 = $$sroa$068$0$ptr + 8 | 0; + } while (0); + if (($15 | 0) == ($$sroa$068$1 | 0)) break L1; + $79 = $23 + 4 | 0; + $$sroa$0$1 = $16; + $$sroa$068$2 = $$sroa$068$1; + while (1) { + $$sroa$0$1$ptr = $$sroa$0$1; + $80 = +HEAPF32[$23 >> 2]; + $$sroa$068$3 = $$sroa$068$2; + while (1) { + $81 = $$sroa$068$3; + $82 = +HEAPF32[$81 >> 2]; + if ($82 < $80) break; + if (!($80 < $82) ? (HEAP32[$81 + 4 >> 2] | 0) >>> 0 < (HEAP32[$79 >> 2] | 0) >>> 0 : 0) break; + $$sroa$068$3 = $81 + 8 | 0; + } + $91 = $$sroa$068$3; + $$sroa$0$2$ptr = $$sroa$0$1$ptr; + while (1) { + $92 = $$sroa$0$2$ptr + -8 | 0; + $93 = +HEAPF32[$92 >> 2]; + if (!($93 < $80)) { + if ($80 < $93) break; + if ((HEAP32[$$sroa$0$2$ptr + -4 >> 2] | 0) >>> 0 >= (HEAP32[$79 >> 2] | 0) >>> 0) break; + } + $$sroa$0$2$ptr = $92; + } + if ($92 >>> 0 <= $91 >>> 0) break; + $103 = HEAP32[$$sroa$068$3 >> 2] | 0; + HEAPF32[$$sroa$068$3 >> 2] = $93; + HEAP32[$92 >> 2] = $103; + $105 = $91 + 4 | 0; + $106 = $$sroa$0$2$ptr + -4 | 0; + $107 = HEAP32[$105 >> 2] | 0; + HEAP32[$105 >> 2] = HEAP32[$106 >> 2]; + HEAP32[$106 >> 2] = $107; + $$sroa$0$1 = $92; + $$sroa$068$2 = $91 + 8 | 0; + } + $111 = $$sroa$068$3; + if ($12 >>> 0 < $111 >>> 0) break L1; + HEAP32[$0 >> 2] = $$sroa$068$3; + $20 = $$sroa$068$3; + $23 = $111; + } + if ((label | 0) == 47) { + label = 0; + $$phi$trans$insert262 = $$sroa$0$0$ptr + -4 | 0; + $$pre$phi272Z2D = $$phi$trans$insert262; + $127 = HEAP32[$$phi$trans$insert262 >> 2] | 0; + label = 52; + } else if ((label | 0) == 51) { + label = 0; + $$pre$phi272Z2D = $$sroa$0$0$ptr + -4 | 0; + $127 = $118; + label = 52; + } else if ((label | 0) == 53) { + label = 0; + $$2 = $41; + $$sroa$0$3$in = $15; + $131 = $20; + } + if ((label | 0) == 52) { + label = 0; + $121 = $20; + $123 = HEAP32[$20 >> 2] | 0; + HEAPF32[$20 >> 2] = $113; + HEAP32[$51 >> 2] = $123; + $125 = $121 + 4 | 0; + $126 = HEAP32[$125 >> 2] | 0; + HEAP32[$125 >> 2] = $127; + HEAP32[$$pre$phi272Z2D >> 2] = $126; + $$2 = $41 + 1 | 0; + $$sroa$0$3$in = $51; + $131 = $121; + } + $130 = $131 + 8 | 0; + $132 = $130; + if ($130 >>> 0 < $$sroa$0$3$in >>> 0) { + $$3 = $$2; + $$sroa$0$4 = $$sroa$0$3$in; + $$sroa$0107$0 = $39; + $$sroa$068$4 = $132; + while (1) { + $$sroa$0$4$ptr = $$sroa$0$4; + $135 = $$sroa$0107$0; + $136 = $135 + 4 | 0; + $137 = +HEAPF32[$135 >> 2]; + $$sroa$068$5 = $$sroa$068$4; + while (1) { + $138 = $$sroa$068$5; + $139 = +HEAPF32[$138 >> 2]; + if (!($137 < $139)) { + if ($139 < $137) break; + if ((HEAP32[$136 >> 2] | 0) >>> 0 >= (HEAP32[$138 + 4 >> 2] | 0) >>> 0) break; + } + $$sroa$068$5 = $138 + 8 | 0; + } + $148 = $$sroa$068$5; + $$sroa$0$5$ptr = $$sroa$0$4$ptr; + while (1) { + $149 = $$sroa$0$5$ptr + -8 | 0; + $150 = +HEAPF32[$149 >> 2]; + if ($137 < $150) break; + if (!($150 < $137) ? (HEAP32[$136 >> 2] | 0) >>> 0 < (HEAP32[$$sroa$0$5$ptr + -4 >> 2] | 0) >>> 0 : 0) break; + $$sroa$0$5$ptr = $149; + } + $157 = $149; + if ($149 >>> 0 <= $148 >>> 0) break; + $160 = HEAP32[$$sroa$068$5 >> 2] | 0; + HEAPF32[$$sroa$068$5 >> 2] = $150; + HEAP32[$149 >> 2] = $160; + $162 = $148 + 4 | 0; + $163 = $$sroa$0$5$ptr + -4 | 0; + $164 = HEAP32[$162 >> 2] | 0; + HEAP32[$162 >> 2] = HEAP32[$163 >> 2]; + HEAP32[$163 >> 2] = $164; + $$3 = $$3 + 1 | 0; + $$sroa$0$4 = $157; + $$sroa$0107$0 = ($135 | 0) == ($148 | 0) ? $157 : $$sroa$0107$0; + $$sroa$068$4 = $148 + 8 | 0; + } + $$4 = $$3; + $$pre$phi275Z2D = $$sroa$068$5; + $$sroa$0107$2$ptr = $$sroa$0107$0; + $$sroa$068$6 = $$sroa$068$5; + } else { + $$4 = $$2; + $$pre$phi275Z2D = $130; + $$sroa$0107$2$ptr = $39; + $$sroa$068$6 = $132; + } + $$sroa$068$6$ptr = $$sroa$068$6; + do if (($$sroa$0107$2$ptr | 0) == ($$pre$phi275Z2D | 0)) $$5 = $$4; else { + $173 = +HEAPF32[$$pre$phi275Z2D >> 2]; + $174 = +HEAPF32[$$sroa$0107$2$ptr >> 2]; + if (!($173 < $174)) { + if ($174 < $173) { + $$5 = $$4; + break; + } + $177 = $$pre$phi275Z2D + 4 | 0; + $178 = HEAP32[$177 >> 2] | 0; + $179 = $$sroa$0107$2$ptr + 4 | 0; + $180 = HEAP32[$179 >> 2] | 0; + if ($178 >>> 0 < $180 >>> 0) { + $$pre$phi270Z2D = $179; + $$pre$phiZ2D = $177; + $185 = $180; + $186 = $178; + } else { + $$5 = $$4; + break; + } + } else { + $$phi$trans$insert266 = $$pre$phi275Z2D + 4 | 0; + $$phi$trans$insert268 = $$sroa$0107$2$ptr + 4 | 0; + $$pre$phi270Z2D = $$phi$trans$insert268; + $$pre$phiZ2D = $$phi$trans$insert266; + $185 = HEAP32[$$phi$trans$insert268 >> 2] | 0; + $186 = HEAP32[$$phi$trans$insert266 >> 2] | 0; + } + $183 = HEAP32[$$sroa$068$6 >> 2] | 0; + HEAPF32[$$sroa$068$6 >> 2] = $174; + HEAP32[$$sroa$0107$2$ptr >> 2] = $183; + HEAP32[$$pre$phiZ2D >> 2] = $185; + HEAP32[$$pre$phi270Z2D >> 2] = $186; + $$5 = $$4 + 1 | 0; + } while (0); + if (($12 | 0) == ($$pre$phi275Z2D | 0)) break; + L95 : do if (!$$5) if ($12 >>> 0 < $$pre$phi275Z2D >>> 0) { + $$sroa$0107$3$ptr = $131; + while (1) { + $191 = $$sroa$0107$3$ptr + 8 | 0; + if (($191 | 0) == ($$pre$phi275Z2D | 0)) break L1; + $193 = +HEAPF32[$$sroa$0107$3$ptr >> 2]; + $194 = +HEAPF32[$191 >> 2]; + if ($193 < $194) break L95; + if (!($194 < $193) ? (HEAP32[$$sroa$0107$3$ptr + 4 >> 2] | 0) >>> 0 < (HEAP32[$$sroa$0107$3$ptr + 12 >> 2] | 0) >>> 0 : 0) break L95; + $$sroa$0107$3$ptr = $191; + } + } else { + $$sroa$0107$4$ptr = $$sroa$068$6$ptr; + while (1) { + $202 = $$sroa$0107$4$ptr + 8 | 0; + if (($202 | 0) == ($13 | 0)) break L1; + $204 = +HEAPF32[$$sroa$0107$4$ptr >> 2]; + $205 = +HEAPF32[$202 >> 2]; + if ($204 < $205) break L95; + if (!($205 < $204) ? (HEAP32[$$sroa$0107$4$ptr + 4 >> 2] | 0) >>> 0 < (HEAP32[$$sroa$0107$4$ptr + 12 >> 2] | 0) >>> 0 : 0) break L95; + $$sroa$0107$4$ptr = $202; + } + } while (0); + if ($12 >>> 0 < $$pre$phi275Z2D >>> 0) HEAP32[$2 >> 2] = $$sroa$068$6; else HEAP32[$0 >> 2] = $$pre$phi275Z2D + 8; + } + do if ((label | 0) == 5) { + HEAP32[$2 >> 2] = $15; + $22 = +HEAPF32[$23 >> 2]; + $24 = +HEAPF32[$15 >> 2]; + if (!($22 < $24)) { + if ($24 < $22) break; + $27 = $23 + 4 | 0; + $28 = HEAP32[$27 >> 2] | 0; + $29 = HEAP32[$17 >> 2] | 0; + if ($28 >>> 0 < $29 >>> 0) { + $$pre$phi273Z2D = $27; + $31 = $29; + $32 = $28; + } else break; + } else { + $$phi$trans$insert = $23 + 4 | 0; + $$pre$phi273Z2D = $$phi$trans$insert; + $31 = HEAP32[$17 >> 2] | 0; + $32 = HEAP32[$$phi$trans$insert >> 2] | 0; + } + HEAPF32[$23 >> 2] = $24; + HEAPF32[$15 >> 2] = $22; + HEAP32[$$pre$phi273Z2D >> 2] = $31; + HEAP32[$17 >> 2] = $32; + } else if ((label | 0) == 10) { + HEAP32[$4 >> 2] = $20; + HEAP32[$5 >> 2] = $20 + 8; + HEAP32[$2 >> 2] = $15; + HEAP32[$6 >> 2] = $15; + HEAP32[$$byval_copy5 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy6 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy7 >> 2] = HEAP32[$6 >> 2]; + __ZNSt3__27__sort3IRNS_7greaterINS_4pairIfmEEEENS_11__wrap_iterIPS3_EEEEjT0_S9_S9_T_($$byval_copy5, $$byval_copy6, $$byval_copy7, $3) | 0; + } else if ((label | 0) == 12) { + HEAP32[$7 >> 2] = $20; + HEAP32[$8 >> 2] = $13; + HEAP32[$$byval_copy6 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$$byval_copy7 >> 2] = HEAP32[$8 >> 2]; + __ZNSt3__216__selection_sortIRNS_7greaterINS_4pairIfmEEEENS_11__wrap_iterIPS3_EEEEvT0_S9_T_($$byval_copy6, $$byval_copy7, $3); + } while (0); + STACKTOP = sp; + return; +} + +function _decode_mcu_sub($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$017$i = 0, $$0196 = 0, $$0197304 = 0, $$0198 = 0, $$0199$lcssa = 0, $$0199303 = 0, $$0209 = 0, $$0210$lcssa = 0, $$0210302 = 0, $$0239288 = 0, $$11$ph = 0, $$11221$ph = 0, $$11255$ph = 0, $$12 = 0, $$1200 = 0, $$1211 = 0, $$12222 = 0, $$1240 = 0, $$13 = 0, $$13223 = 0, $$14 = 0, $$14224 = 0, $$15 = 0, $$15225 = 0, $$16226294 = 0, $$16295 = 0, $$17 = 0, $$17227 = 0, $$18 = 0, $$18228 = 0, $$20$ph = 0, $$20230$ph = 0, $$21 = 0, $$21231 = 0, $$22 = 0, $$2201 = 0, $$2212 = 0, $$22232 = 0, $$2241 = 0, $$2246$ph = 0, $$24 = 0, $$24234 = 0, $$3242293 = 0, $$3247 = 0, $$4203$ph = 0, $$4214$ph = 0, $$5204 = 0, $$5215 = 0, $$6205 = 0, $$6216 = 0, $$6250$ph = 0, $$7206290 = 0, $$7217289 = 0, $$8207 = 0, $$8218 = 0, $$9 = 0, $$9208 = 0, $$9219 = 0, $$in = 0, $$pn = 0, $100 = 0, $108 = 0, $110 = 0, $116 = 0, $117 = 0, $12 = 0, $121 = 0, $123 = 0, $129 = 0, $133 = 0, $134 = 0, $136 = 0, $142 = 0, $145 = 0, $146 = 0, $158 = 0, $16 = 0, $17 = 0, $170 = 0, $171 = 0, $175 = 0, $177 = 0, $183 = 0, $187 = 0, $188 = 0, $2 = 0, $202 = 0, $204 = 0, $205 = 0, $24 = 0, $3 = 0, $41 = 0, $43 = 0, $45 = 0, $46 = 0, $47 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $59 = 0, $6 = 0, $60 = 0, $62 = 0, $64 = 0, $68 = 0, $69 = 0, $73 = 0, $75 = 0, $81 = 0, $86 = 0, $88 = 0, $9 = 0, $90 = 0, $96 = 0, $99 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $2 = sp + 20 | 0; + $3 = sp; + $5 = HEAP32[$0 + 468 >> 2] | 0; + $6 = $0 + 280 | 0; + if (HEAP32[$6 >> 2] | 0 ? ($9 = $5 + 44 | 0, (HEAP32[$9 >> 2] | 0) == 0) : 0) { + $12 = $5 + 16 | 0; + $16 = HEAP32[$0 + 464 >> 2] | 0; + $17 = $16 + 24 | 0; + HEAP32[$17 >> 2] = (HEAP32[$17 >> 2] | 0) + ((HEAP32[$12 >> 2] | 0) / 8 | 0); + HEAP32[$12 >> 2] = 0; + if (!(FUNCTION_TABLE_ii[HEAP32[$16 + 8 >> 2] & 127]($0) | 0)) { + $$9 = 0; + STACKTOP = sp; + return $$9 | 0; + } + $24 = $0 + 340 | 0; + if ((HEAP32[$24 >> 2] | 0) > 0) { + $$017$i = 0; + do { + HEAP32[$5 + 24 + ($$017$i << 2) >> 2] = 0; + $$017$i = $$017$i + 1 | 0; + } while (($$017$i | 0) < (HEAP32[$24 >> 2] | 0)); + } + HEAP32[$5 + 20 >> 2] = 0; + HEAP32[$9 >> 2] = HEAP32[$6 >> 2]; + if (!(HEAP32[$0 + 440 >> 2] | 0)) HEAP32[$5 + 40 >> 2] = 0; + } + if (!(HEAP32[$5 + 40 >> 2] | 0)) { + $41 = HEAP32[$0 + 432 >> 2] | 0; + $43 = HEAP32[$0 + 436 >> 2] | 0; + HEAP32[$2 + 16 >> 2] = $0; + $45 = $0 + 24 | 0; + $46 = HEAP32[$45 >> 2] | 0; + $47 = HEAP32[$46 >> 2] | 0; + HEAP32[$2 >> 2] = $47; + $49 = HEAP32[$46 + 4 >> 2] | 0; + $50 = $2 + 4 | 0; + HEAP32[$50 >> 2] = $49; + $51 = $5 + 12 | 0; + $52 = HEAP32[$51 >> 2] | 0; + $53 = $5 + 16 | 0; + $54 = HEAP32[$53 >> 2] | 0; + $55 = $5 + 20 | 0; + HEAP32[$3 >> 2] = HEAP32[$55 >> 2]; + HEAP32[$3 + 4 >> 2] = HEAP32[$55 + 4 >> 2]; + HEAP32[$3 + 8 >> 2] = HEAP32[$55 + 8 >> 2]; + HEAP32[$3 + 12 >> 2] = HEAP32[$55 + 12 >> 2]; + HEAP32[$3 + 16 >> 2] = HEAP32[$55 + 16 >> 2]; + $56 = $0 + 368 | 0; + do if ((HEAP32[$56 >> 2] | 0) > 0) { + $59 = $2 + 8 | 0; + $60 = $2 + 12 | 0; + $$0197304 = 0; + $$0199303 = $52; + $$0210302 = $54; + L18 : while (1) { + $62 = HEAP32[$1 + ($$0197304 << 2) >> 2] | 0; + $64 = HEAP32[$5 + 100 + ($$0197304 << 2) >> 2] | 0; + if (($$0210302 | 0) < 8) { + if (!(_jpeg_fill_bit_buffer($2, $$0199303, $$0210302, 0) | 0)) { + $$9 = 0; + label = 67; + break; + } + $68 = HEAP32[$59 >> 2] | 0; + $69 = HEAP32[$60 >> 2] | 0; + if (($69 | 0) < 8) { + $$0209 = 1; + $$2201 = $68; + $$2212 = $69; + label = 17; + } else { + $$1200 = $68; + $$1211 = $69; + label = 15; + } + } else { + $$1200 = $$0199303; + $$1211 = $$0210302; + label = 15; + } + if ((label | 0) == 15) { + label = 0; + $73 = $$1200 >> $$1211 + -8 & 255; + $75 = HEAP32[$64 + 144 + ($73 << 2) >> 2] | 0; + if (!$75) { + $$0209 = 9; + $$2201 = $$1200; + $$2212 = $$1211; + label = 17; + } else { + $$2246$ph = HEAPU8[$64 + 1168 + $73 >> 0] | 0; + $$4203$ph = $$1200; + $$4214$ph = $$1211 - $75 | 0; + } + } + if ((label | 0) == 17) { + label = 0; + $81 = _jpeg_huff_decode($2, $$2201, $$2212, $64, $$0209) | 0; + if (($81 | 0) < 0) { + $$9 = 0; + label = 67; + break; + } + $$2246$ph = $81; + $$4203$ph = HEAP32[$59 >> 2] | 0; + $$4214$ph = HEAP32[$60 >> 2] | 0; + } + $86 = HEAP32[$5 + 140 + ($$0197304 << 2) >> 2] | 0; + $88 = HEAP32[$5 + 180 + ($$0197304 << 2) >> 2] | 0; + $90 = ($$2246$ph | 0) != 0; + L30 : do if (!$88) if ($90) { + if (($$4214$ph | 0) < ($$2246$ph | 0)) { + if (!(_jpeg_fill_bit_buffer($2, $$4203$ph, $$4214$ph, $$2246$ph) | 0)) { + $$9 = 0; + label = 67; + break L18; + } + $$14 = HEAP32[$59 >> 2] | 0; + $$14224 = HEAP32[$60 >> 2] | 0; + } else { + $$14 = $$4203$ph; + $$14224 = $$4214$ph; + } + $$15 = $$14; + $$15225 = $$14224 - $$2246$ph | 0; + $$2241 = 1; + label = 47; + } else { + $$15 = $$4203$ph; + $$15225 = $$4214$ph; + $$2241 = 1; + label = 47; + } else { + if ($90) { + if (($$4214$ph | 0) < ($$2246$ph | 0)) { + if (!(_jpeg_fill_bit_buffer($2, $$4203$ph, $$4214$ph, $$2246$ph) | 0)) { + $$9 = 0; + label = 67; + break L18; + } + $$5204 = HEAP32[$59 >> 2] | 0; + $$5215 = HEAP32[$60 >> 2] | 0; + } else { + $$5204 = $$4203$ph; + $$5215 = $$4214$ph; + } + $96 = $$5215 - $$2246$ph | 0; + $99 = HEAP32[5184 + ($$2246$ph << 2) >> 2] | 0; + $100 = $$5204 >> $96 & $99; + $$3247 = $100 - (($100 | 0) > (HEAP32[5184 + ($$2246$ph + -1 << 2) >> 2] | 0) ? 0 : $99) | 0; + $$6205 = $$5204; + $$6216 = $96; + } else { + $$3247 = 0; + $$6205 = $$4203$ph; + $$6216 = $$4214$ph; + } + $108 = $3 + 4 + (HEAP32[$0 + 372 + ($$0197304 << 2) >> 2] << 2) | 0; + $110 = (HEAP32[$108 >> 2] | 0) + $$3247 | 0; + HEAP32[$108 >> 2] = $110; + HEAP16[$62 >> 1] = $110; + if (($88 | 0) > 1) { + $$0239288 = 1; + $$7206290 = $$6205; + $$7217289 = $$6216; + while (1) { + if (($$7217289 | 0) < 8) { + if (!(_jpeg_fill_bit_buffer($2, $$7206290, $$7217289, 0) | 0)) { + $$9 = 0; + label = 67; + break L18; + } + $116 = HEAP32[$59 >> 2] | 0; + $117 = HEAP32[$60 >> 2] | 0; + if (($117 | 0) < 8) { + $$0198 = 1; + $$9208 = $116; + $$9219 = $117; + label = 32; + } else { + $$8207 = $116; + $$8218 = $117; + label = 30; + } + } else { + $$8207 = $$7206290; + $$8218 = $$7217289; + label = 30; + } + if ((label | 0) == 30) { + label = 0; + $121 = $$8207 >> $$8218 + -8 & 255; + $123 = HEAP32[$86 + 144 + ($121 << 2) >> 2] | 0; + if (!$123) { + $$0198 = 9; + $$9208 = $$8207; + $$9219 = $$8218; + label = 32; + } else { + $$11$ph = $$8207; + $$11221$ph = $$8218 - $123 | 0; + $$6250$ph = HEAPU8[$86 + 1168 + $121 >> 0] | 0; + } + } + if ((label | 0) == 32) { + label = 0; + $129 = _jpeg_huff_decode($2, $$9208, $$9219, $86, $$0198) | 0; + if (($129 | 0) < 0) { + $$9 = 0; + label = 67; + break L18; + } + $$11$ph = HEAP32[$59 >> 2] | 0; + $$11221$ph = HEAP32[$60 >> 2] | 0; + $$6250$ph = $129; + } + $133 = $$6250$ph >>> 4; + $134 = $$6250$ph & 15; + if (!$134) { + if (($133 | 0) != 15) { + $$24 = $$11$ph; + $$24234 = $$11221$ph; + break L30; + } + $$1240 = $$0239288 + 15 | 0; + $$13 = $$11$ph; + $$13223 = $$11221$ph; + } else { + $136 = $133 + $$0239288 | 0; + if (($$11221$ph | 0) < ($134 | 0)) { + if (!(_jpeg_fill_bit_buffer($2, $$11$ph, $$11221$ph, $134) | 0)) { + $$9 = 0; + label = 67; + break L18; + } + $$12 = HEAP32[$59 >> 2] | 0; + $$12222 = HEAP32[$60 >> 2] | 0; + } else { + $$12 = $$11$ph; + $$12222 = $$11221$ph; + } + $142 = $$12222 - $134 | 0; + $145 = HEAP32[5184 + ($134 << 2) >> 2] | 0; + $146 = $$12 >> $142 & $145; + HEAP16[$62 + (HEAP32[$41 + ($136 << 2) >> 2] << 1) >> 1] = $146 - (($146 | 0) > (HEAP32[5184 + ($134 + -1 << 2) >> 2] | 0) ? 0 : $145); + $$1240 = $136; + $$13 = $$12; + $$13223 = $142; + } + $158 = $$1240 + 1 | 0; + if (($158 | 0) < ($88 | 0)) { + $$0239288 = $158; + $$7206290 = $$13; + $$7217289 = $$13223; + } else { + $$15 = $$13; + $$15225 = $$13223; + $$2241 = $158; + label = 47; + break; + } + } + } else { + $$15 = $$6205; + $$15225 = $$6216; + $$2241 = 1; + label = 47; + } + } while (0); + L67 : do if ((label | 0) == 47) { + label = 0; + if (($$2241 | 0) > ($43 | 0)) { + $$24 = $$15; + $$24234 = $$15225; + } else { + $$16226294 = $$15225; + $$16295 = $$15; + $$3242293 = $$2241; + while (1) { + if (($$16226294 | 0) < 8) { + if (!(_jpeg_fill_bit_buffer($2, $$16295, $$16226294, 0) | 0)) { + $$9 = 0; + label = 67; + break L18; + } + $170 = HEAP32[$59 >> 2] | 0; + $171 = HEAP32[$60 >> 2] | 0; + if (($171 | 0) < 8) { + $$0196 = 1; + $$18 = $170; + $$18228 = $171; + label = 54; + } else { + $$17 = $170; + $$17227 = $171; + label = 52; + } + } else { + $$17 = $$16295; + $$17227 = $$16226294; + label = 52; + } + if ((label | 0) == 52) { + label = 0; + $175 = $$17 >> $$17227 + -8 & 255; + $177 = HEAP32[$86 + 144 + ($175 << 2) >> 2] | 0; + if (!$177) { + $$0196 = 9; + $$18 = $$17; + $$18228 = $$17227; + label = 54; + } else { + $$11255$ph = HEAPU8[$86 + 1168 + $175 >> 0] | 0; + $$20$ph = $$17; + $$20230$ph = $$17227 - $177 | 0; + } + } + if ((label | 0) == 54) { + label = 0; + $183 = _jpeg_huff_decode($2, $$18, $$18228, $86, $$0196) | 0; + if (($183 | 0) < 0) { + $$9 = 0; + label = 67; + break L18; + } + $$11255$ph = $183; + $$20$ph = HEAP32[$59 >> 2] | 0; + $$20230$ph = HEAP32[$60 >> 2] | 0; + } + $187 = $$11255$ph >>> 4; + $188 = $$11255$ph & 15; + if (!$188) if (($187 | 0) == 15) { + $$22 = $$20$ph; + $$22232 = $$20230$ph; + $$pn = 15; + } else { + $$24 = $$20$ph; + $$24234 = $$20230$ph; + break L67; + } else { + if (($$20230$ph | 0) < ($188 | 0)) { + if (!(_jpeg_fill_bit_buffer($2, $$20$ph, $$20230$ph, $188) | 0)) { + $$9 = 0; + label = 67; + break L18; + } + $$21 = HEAP32[$59 >> 2] | 0; + $$21231 = HEAP32[$60 >> 2] | 0; + } else { + $$21 = $$20$ph; + $$21231 = $$20230$ph; + } + $$22 = $$21; + $$22232 = $$21231 - $188 | 0; + $$pn = $187; + } + $$3242293 = $$3242293 + 1 + $$pn | 0; + if (($$3242293 | 0) > ($43 | 0)) { + $$24 = $$22; + $$24234 = $$22232; + break; + } else { + $$16226294 = $$22232; + $$16295 = $$22; + } + } + } + } while (0); + $$0197304 = $$0197304 + 1 | 0; + if (($$0197304 | 0) >= (HEAP32[$56 >> 2] | 0)) { + label = 64; + break; + } else { + $$0199303 = $$24; + $$0210302 = $$24234; + } + } + if ((label | 0) == 64) { + $$0199$lcssa = $$24; + $$0210$lcssa = $$24234; + $$in = HEAP32[$45 >> 2] | 0; + $202 = HEAP32[$2 >> 2] | 0; + $204 = HEAP32[$50 >> 2] | 0; + break; + } else if ((label | 0) == 67) { + STACKTOP = sp; + return $$9 | 0; + } + } else { + $$0199$lcssa = $52; + $$0210$lcssa = $54; + $$in = $46; + $202 = $47; + $204 = $49; + } while (0); + HEAP32[$$in >> 2] = $202; + HEAP32[$$in + 4 >> 2] = $204; + HEAP32[$51 >> 2] = $$0199$lcssa; + HEAP32[$53 >> 2] = $$0210$lcssa; + HEAP32[$55 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$55 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + HEAP32[$55 + 8 >> 2] = HEAP32[$3 + 8 >> 2]; + HEAP32[$55 + 12 >> 2] = HEAP32[$3 + 12 >> 2]; + HEAP32[$55 + 16 >> 2] = HEAP32[$3 + 16 >> 2]; + } + $205 = $5 + 44 | 0; + HEAP32[$205 >> 2] = (HEAP32[$205 >> 2] | 0) + -1; + $$9 = 1; + STACKTOP = sp; + return $$9 | 0; +} + +function _decode_mcu_66($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$017$i = 0, $$0188 = 0, $$0189296 = 0, $$0190 = 0, $$0191$lcssa = 0, $$0191295 = 0, $$0201 = 0, $$0202$lcssa = 0, $$0202294 = 0, $$0231280 = 0, $$11$ph = 0, $$11213$ph = 0, $$11247$ph = 0, $$1192 = 0, $$12 = 0, $$1203 = 0, $$12214 = 0, $$1232 = 0, $$13 = 0, $$13215 = 0, $$14 = 0, $$14216 = 0, $$16218286 = 0, $$16218286$ph = 0, $$16287 = 0, $$16287$ph = 0, $$17 = 0, $$17219 = 0, $$18 = 0, $$18220 = 0, $$20$ph = 0, $$20222$ph = 0, $$21 = 0, $$21223 = 0, $$2193 = 0, $$22 = 0, $$2204 = 0, $$22224 = 0, $$2238$ph = 0, $$24 = 0, $$24226 = 0, $$3234285 = 0, $$3234285$ph = 0, $$3239 = 0, $$4195$ph = 0, $$4206$ph = 0, $$5196 = 0, $$5207 = 0, $$6197 = 0, $$6208 = 0, $$6242$ph = 0, $$7198282 = 0, $$7209281 = 0, $$8199 = 0, $$8210 = 0, $$9 = 0, $$9200 = 0, $$9211 = 0, $$in = 0, $$pn = 0, $104 = 0, $106 = 0, $112 = 0, $113 = 0, $117 = 0, $119 = 0, $12 = 0, $125 = 0, $129 = 0, $130 = 0, $132 = 0, $138 = 0, $141 = 0, $142 = 0, $16 = 0, $166 = 0, $167 = 0, $17 = 0, $171 = 0, $173 = 0, $179 = 0, $183 = 0, $184 = 0, $198 = 0, $2 = 0, $200 = 0, $201 = 0, $24 = 0, $3 = 0, $41 = 0, $42 = 0, $43 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $55 = 0, $56 = 0, $58 = 0, $6 = 0, $60 = 0, $64 = 0, $65 = 0, $69 = 0, $71 = 0, $77 = 0, $82 = 0, $84 = 0, $86 = 0, $9 = 0, $92 = 0, $95 = 0, $96 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $2 = sp + 20 | 0; + $3 = sp; + $5 = HEAP32[$0 + 468 >> 2] | 0; + $6 = $0 + 280 | 0; + if (HEAP32[$6 >> 2] | 0 ? ($9 = $5 + 44 | 0, (HEAP32[$9 >> 2] | 0) == 0) : 0) { + $12 = $5 + 16 | 0; + $16 = HEAP32[$0 + 464 >> 2] | 0; + $17 = $16 + 24 | 0; + HEAP32[$17 >> 2] = (HEAP32[$17 >> 2] | 0) + ((HEAP32[$12 >> 2] | 0) / 8 | 0); + HEAP32[$12 >> 2] = 0; + if (!(FUNCTION_TABLE_ii[HEAP32[$16 + 8 >> 2] & 127]($0) | 0)) { + $$9 = 0; + STACKTOP = sp; + return $$9 | 0; + } + $24 = $0 + 340 | 0; + if ((HEAP32[$24 >> 2] | 0) > 0) { + $$017$i = 0; + do { + HEAP32[$5 + 24 + ($$017$i << 2) >> 2] = 0; + $$017$i = $$017$i + 1 | 0; + } while (($$017$i | 0) < (HEAP32[$24 >> 2] | 0)); + } + HEAP32[$5 + 20 >> 2] = 0; + HEAP32[$9 >> 2] = HEAP32[$6 >> 2]; + if (!(HEAP32[$0 + 440 >> 2] | 0)) HEAP32[$5 + 40 >> 2] = 0; + } + if (!(HEAP32[$5 + 40 >> 2] | 0)) { + HEAP32[$2 + 16 >> 2] = $0; + $41 = $0 + 24 | 0; + $42 = HEAP32[$41 >> 2] | 0; + $43 = HEAP32[$42 >> 2] | 0; + HEAP32[$2 >> 2] = $43; + $45 = HEAP32[$42 + 4 >> 2] | 0; + $46 = $2 + 4 | 0; + HEAP32[$46 >> 2] = $45; + $47 = $5 + 12 | 0; + $48 = HEAP32[$47 >> 2] | 0; + $49 = $5 + 16 | 0; + $50 = HEAP32[$49 >> 2] | 0; + $51 = $5 + 20 | 0; + HEAP32[$3 >> 2] = HEAP32[$51 >> 2]; + HEAP32[$3 + 4 >> 2] = HEAP32[$51 + 4 >> 2]; + HEAP32[$3 + 8 >> 2] = HEAP32[$51 + 8 >> 2]; + HEAP32[$3 + 12 >> 2] = HEAP32[$51 + 12 >> 2]; + HEAP32[$3 + 16 >> 2] = HEAP32[$51 + 16 >> 2]; + $52 = $0 + 368 | 0; + do if ((HEAP32[$52 >> 2] | 0) > 0) { + $55 = $2 + 8 | 0; + $56 = $2 + 12 | 0; + $$0189296 = 0; + $$0191295 = $48; + $$0202294 = $50; + L18 : while (1) { + $58 = HEAP32[$1 + ($$0189296 << 2) >> 2] | 0; + $60 = HEAP32[$5 + 100 + ($$0189296 << 2) >> 2] | 0; + if (($$0202294 | 0) < 8) { + if (!(_jpeg_fill_bit_buffer($2, $$0191295, $$0202294, 0) | 0)) { + $$9 = 0; + label = 67; + break; + } + $64 = HEAP32[$55 >> 2] | 0; + $65 = HEAP32[$56 >> 2] | 0; + if (($65 | 0) < 8) { + $$0201 = 1; + $$2193 = $64; + $$2204 = $65; + label = 17; + } else { + $$1192 = $64; + $$1203 = $65; + label = 15; + } + } else { + $$1192 = $$0191295; + $$1203 = $$0202294; + label = 15; + } + if ((label | 0) == 15) { + label = 0; + $69 = $$1192 >> $$1203 + -8 & 255; + $71 = HEAP32[$60 + 144 + ($69 << 2) >> 2] | 0; + if (!$71) { + $$0201 = 9; + $$2193 = $$1192; + $$2204 = $$1203; + label = 17; + } else { + $$2238$ph = HEAPU8[$60 + 1168 + $69 >> 0] | 0; + $$4195$ph = $$1192; + $$4206$ph = $$1203 - $71 | 0; + } + } + if ((label | 0) == 17) { + label = 0; + $77 = _jpeg_huff_decode($2, $$2193, $$2204, $60, $$0201) | 0; + if (($77 | 0) < 0) { + $$9 = 0; + label = 67; + break; + } + $$2238$ph = $77; + $$4195$ph = HEAP32[$55 >> 2] | 0; + $$4206$ph = HEAP32[$56 >> 2] | 0; + } + $82 = HEAP32[$5 + 140 + ($$0189296 << 2) >> 2] | 0; + $84 = HEAP32[$5 + 180 + ($$0189296 << 2) >> 2] | 0; + $86 = ($$2238$ph | 0) != 0; + L30 : do if (!$84) if ($86) { + if (($$4206$ph | 0) < ($$2238$ph | 0)) { + if (!(_jpeg_fill_bit_buffer($2, $$4195$ph, $$4206$ph, $$2238$ph) | 0)) { + $$9 = 0; + label = 67; + break L18; + } + $$14 = HEAP32[$55 >> 2] | 0; + $$14216 = HEAP32[$56 >> 2] | 0; + } else { + $$14 = $$4195$ph; + $$14216 = $$4206$ph; + } + $$16218286$ph = $$14216 - $$2238$ph | 0; + $$16287$ph = $$14; + $$3234285$ph = 1; + label = 48; + } else { + $$16218286$ph = $$4206$ph; + $$16287$ph = $$4195$ph; + $$3234285$ph = 1; + label = 48; + } else { + if ($86) { + if (($$4206$ph | 0) < ($$2238$ph | 0)) { + if (!(_jpeg_fill_bit_buffer($2, $$4195$ph, $$4206$ph, $$2238$ph) | 0)) { + $$9 = 0; + label = 67; + break L18; + } + $$5196 = HEAP32[$55 >> 2] | 0; + $$5207 = HEAP32[$56 >> 2] | 0; + } else { + $$5196 = $$4195$ph; + $$5207 = $$4206$ph; + } + $92 = $$5207 - $$2238$ph | 0; + $95 = HEAP32[5184 + ($$2238$ph << 2) >> 2] | 0; + $96 = $$5196 >> $92 & $95; + $$3239 = $96 - (($96 | 0) > (HEAP32[5184 + ($$2238$ph + -1 << 2) >> 2] | 0) ? 0 : $95) | 0; + $$6197 = $$5196; + $$6208 = $92; + } else { + $$3239 = 0; + $$6197 = $$4195$ph; + $$6208 = $$4206$ph; + } + $104 = $3 + 4 + (HEAP32[$0 + 372 + ($$0189296 << 2) >> 2] << 2) | 0; + $106 = (HEAP32[$104 >> 2] | 0) + $$3239 | 0; + HEAP32[$104 >> 2] = $106; + HEAP16[$58 >> 1] = $106; + if (($84 | 0) > 1) { + $$0231280 = 1; + $$7198282 = $$6197; + $$7209281 = $$6208; + while (1) { + if (($$7209281 | 0) < 8) { + if (!(_jpeg_fill_bit_buffer($2, $$7198282, $$7209281, 0) | 0)) { + $$9 = 0; + label = 67; + break L18; + } + $112 = HEAP32[$55 >> 2] | 0; + $113 = HEAP32[$56 >> 2] | 0; + if (($113 | 0) < 8) { + $$0190 = 1; + $$9200 = $112; + $$9211 = $113; + label = 32; + } else { + $$8199 = $112; + $$8210 = $113; + label = 30; + } + } else { + $$8199 = $$7198282; + $$8210 = $$7209281; + label = 30; + } + if ((label | 0) == 30) { + label = 0; + $117 = $$8199 >> $$8210 + -8 & 255; + $119 = HEAP32[$82 + 144 + ($117 << 2) >> 2] | 0; + if (!$119) { + $$0190 = 9; + $$9200 = $$8199; + $$9211 = $$8210; + label = 32; + } else { + $$11$ph = $$8199; + $$11213$ph = $$8210 - $119 | 0; + $$6242$ph = HEAPU8[$82 + 1168 + $117 >> 0] | 0; + } + } + if ((label | 0) == 32) { + label = 0; + $125 = _jpeg_huff_decode($2, $$9200, $$9211, $82, $$0190) | 0; + if (($125 | 0) < 0) { + $$9 = 0; + label = 67; + break L18; + } + $$11$ph = HEAP32[$55 >> 2] | 0; + $$11213$ph = HEAP32[$56 >> 2] | 0; + $$6242$ph = $125; + } + $129 = $$6242$ph >>> 4; + $130 = $$6242$ph & 15; + if (!$130) { + if (($129 | 0) != 15) { + $$24 = $$11$ph; + $$24226 = $$11213$ph; + break L30; + } + $$1232 = $$0231280 + 15 | 0; + $$13 = $$11$ph; + $$13215 = $$11213$ph; + } else { + $132 = $129 + $$0231280 | 0; + if (($$11213$ph | 0) < ($130 | 0)) { + if (!(_jpeg_fill_bit_buffer($2, $$11$ph, $$11213$ph, $130) | 0)) { + $$9 = 0; + label = 67; + break L18; + } + $$12 = HEAP32[$55 >> 2] | 0; + $$12214 = HEAP32[$56 >> 2] | 0; + } else { + $$12 = $$11$ph; + $$12214 = $$11213$ph; + } + $138 = $$12214 - $130 | 0; + $141 = HEAP32[5184 + ($130 << 2) >> 2] | 0; + $142 = $$12 >> $138 & $141; + HEAP16[$58 + (HEAP32[2576 + ($132 << 2) >> 2] << 1) >> 1] = $142 - (($142 | 0) > (HEAP32[5184 + ($130 + -1 << 2) >> 2] | 0) ? 0 : $141); + $$1232 = $132; + $$13 = $$12; + $$13215 = $138; + } + $$0231280 = $$1232 + 1 | 0; + if (($$0231280 | 0) >= ($84 | 0)) break; else { + $$7198282 = $$13; + $$7209281 = $$13215; + } + } + if (($$1232 | 0) < 63) { + $$16218286$ph = $$13215; + $$16287$ph = $$13; + $$3234285$ph = $$0231280; + label = 48; + } else { + $$24 = $$13; + $$24226 = $$13215; + } + } else { + $$16218286$ph = $$6208; + $$16287$ph = $$6197; + $$3234285$ph = 1; + label = 48; + } + } while (0); + L68 : do if ((label | 0) == 48) { + label = 0; + $$16218286 = $$16218286$ph; + $$16287 = $$16287$ph; + $$3234285 = $$3234285$ph; + while (1) { + if (($$16218286 | 0) < 8) { + if (!(_jpeg_fill_bit_buffer($2, $$16287, $$16218286, 0) | 0)) { + $$9 = 0; + label = 67; + break L18; + } + $166 = HEAP32[$55 >> 2] | 0; + $167 = HEAP32[$56 >> 2] | 0; + if (($167 | 0) < 8) { + $$0188 = 1; + $$18 = $166; + $$18220 = $167; + label = 54; + } else { + $$17 = $166; + $$17219 = $167; + label = 52; + } + } else { + $$17 = $$16287; + $$17219 = $$16218286; + label = 52; + } + if ((label | 0) == 52) { + label = 0; + $171 = $$17 >> $$17219 + -8 & 255; + $173 = HEAP32[$82 + 144 + ($171 << 2) >> 2] | 0; + if (!$173) { + $$0188 = 9; + $$18 = $$17; + $$18220 = $$17219; + label = 54; + } else { + $$11247$ph = HEAPU8[$82 + 1168 + $171 >> 0] | 0; + $$20$ph = $$17; + $$20222$ph = $$17219 - $173 | 0; + } + } + if ((label | 0) == 54) { + label = 0; + $179 = _jpeg_huff_decode($2, $$18, $$18220, $82, $$0188) | 0; + if (($179 | 0) < 0) { + $$9 = 0; + label = 67; + break L18; + } + $$11247$ph = $179; + $$20$ph = HEAP32[$55 >> 2] | 0; + $$20222$ph = HEAP32[$56 >> 2] | 0; + } + $183 = $$11247$ph >>> 4; + $184 = $$11247$ph & 15; + if (!$184) if (($183 | 0) == 15) { + $$22 = $$20$ph; + $$22224 = $$20222$ph; + $$pn = 15; + } else { + $$24 = $$20$ph; + $$24226 = $$20222$ph; + break L68; + } else { + if (($$20222$ph | 0) < ($184 | 0)) { + if (!(_jpeg_fill_bit_buffer($2, $$20$ph, $$20222$ph, $184) | 0)) { + $$9 = 0; + label = 67; + break L18; + } + $$21 = HEAP32[$55 >> 2] | 0; + $$21223 = HEAP32[$56 >> 2] | 0; + } else { + $$21 = $$20$ph; + $$21223 = $$20222$ph; + } + $$22 = $$21; + $$22224 = $$21223 - $184 | 0; + $$pn = $183; + } + $$3234285 = $$3234285 + 1 + $$pn | 0; + if (($$3234285 | 0) >= 64) { + $$24 = $$22; + $$24226 = $$22224; + break; + } else { + $$16218286 = $$22224; + $$16287 = $$22; + } + } + } while (0); + $$0189296 = $$0189296 + 1 | 0; + if (($$0189296 | 0) >= (HEAP32[$52 >> 2] | 0)) { + label = 64; + break; + } else { + $$0191295 = $$24; + $$0202294 = $$24226; + } + } + if ((label | 0) == 64) { + $$0191$lcssa = $$24; + $$0202$lcssa = $$24226; + $$in = HEAP32[$41 >> 2] | 0; + $198 = HEAP32[$2 >> 2] | 0; + $200 = HEAP32[$46 >> 2] | 0; + break; + } else if ((label | 0) == 67) { + STACKTOP = sp; + return $$9 | 0; + } + } else { + $$0191$lcssa = $48; + $$0202$lcssa = $50; + $$in = $42; + $198 = $43; + $200 = $45; + } while (0); + HEAP32[$$in >> 2] = $198; + HEAP32[$$in + 4 >> 2] = $200; + HEAP32[$47 >> 2] = $$0191$lcssa; + HEAP32[$49 >> 2] = $$0202$lcssa; + HEAP32[$51 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$51 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + HEAP32[$51 + 8 >> 2] = HEAP32[$3 + 8 >> 2]; + HEAP32[$51 + 12 >> 2] = HEAP32[$3 + 12 >> 2]; + HEAP32[$51 + 16 >> 2] = HEAP32[$3 + 16 >> 2]; + } + $201 = $5 + 44 | 0; + HEAP32[$201 >> 2] = (HEAP32[$201 >> 2] | 0) + -1; + $$9 = 1; + STACKTOP = sp; + return $$9 | 0; +} + +function _free($0) { + $0 = $0 | 0; + var $$0211$i = 0, $$0211$in$i = 0, $$0381438 = 0, $$0382$lcssa = 0, $$0382437 = 0, $$0394 = 0, $$0401 = 0, $$1 = 0, $$1380 = 0, $$1385 = 0, $$1385$be = 0, $$1385$ph = 0, $$1388 = 0, $$1388$be = 0, $$1388$ph = 0, $$1396 = 0, $$1396$be = 0, $$1396$ph = 0, $$1400 = 0, $$1400$be = 0, $$1400$ph = 0, $$2 = 0, $$3 = 0, $$3398 = 0, $$pre$phi444Z2D = 0, $$pre$phi446Z2D = 0, $$pre$phiZ2D = 0, $10 = 0, $105 = 0, $106 = 0, $114 = 0, $115 = 0, $116 = 0, $124 = 0, $13 = 0, $132 = 0, $137 = 0, $138 = 0, $141 = 0, $143 = 0, $145 = 0, $16 = 0, $160 = 0, $165 = 0, $167 = 0, $17 = 0, $170 = 0, $173 = 0, $176 = 0, $179 = 0, $180 = 0, $181 = 0, $183 = 0, $185 = 0, $186 = 0, $188 = 0, $189 = 0, $195 = 0, $196 = 0, $2 = 0, $205 = 0, $21 = 0, $210 = 0, $213 = 0, $214 = 0, $220 = 0, $235 = 0, $238 = 0, $239 = 0, $24 = 0, $240 = 0, $244 = 0, $245 = 0, $251 = 0, $256 = 0, $257 = 0, $26 = 0, $260 = 0, $262 = 0, $265 = 0, $270 = 0, $276 = 0, $28 = 0, $280 = 0, $281 = 0, $288 = 0, $3 = 0, $300 = 0, $305 = 0, $312 = 0, $313 = 0, $314 = 0, $323 = 0, $41 = 0, $46 = 0, $48 = 0, $51 = 0, $53 = 0, $56 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $63 = 0, $65 = 0, $66 = 0, $68 = 0, $69 = 0, $7 = 0, $74 = 0, $75 = 0, $84 = 0, $89 = 0, $9 = 0, $92 = 0, $93 = 0, $99 = 0; + if (!$0) return; + $2 = $0 + -8 | 0; + $3 = HEAP32[16739] | 0; + if ($2 >>> 0 < $3 >>> 0) _abort(); + $6 = HEAP32[$0 + -4 >> 2] | 0; + $7 = $6 & 3; + if (($7 | 0) == 1) _abort(); + $9 = $6 & -8; + $10 = $2 + $9 | 0; + L10 : do if (!($6 & 1)) { + $13 = HEAP32[$2 >> 2] | 0; + if (!$7) return; + $16 = $2 + (0 - $13) | 0; + $17 = $13 + $9 | 0; + if ($16 >>> 0 < $3 >>> 0) _abort(); + if ((HEAP32[16740] | 0) == ($16 | 0)) { + $105 = $10 + 4 | 0; + $106 = HEAP32[$105 >> 2] | 0; + if (($106 & 3 | 0) != 3) { + $$1 = $16; + $$1380 = $17; + $114 = $16; + break; + } + HEAP32[16737] = $17; + HEAP32[$105 >> 2] = $106 & -2; + HEAP32[$16 + 4 >> 2] = $17 | 1; + HEAP32[$16 + $17 >> 2] = $17; + return; + } + $21 = $13 >>> 3; + if ($13 >>> 0 < 256) { + $24 = HEAP32[$16 + 8 >> 2] | 0; + $26 = HEAP32[$16 + 12 >> 2] | 0; + $28 = 66980 + ($21 << 1 << 2) | 0; + if (($24 | 0) != ($28 | 0)) { + if ($3 >>> 0 > $24 >>> 0) _abort(); + if ((HEAP32[$24 + 12 >> 2] | 0) != ($16 | 0)) _abort(); + } + if (($26 | 0) == ($24 | 0)) { + HEAP32[16735] = HEAP32[16735] & ~(1 << $21); + $$1 = $16; + $$1380 = $17; + $114 = $16; + break; + } + if (($26 | 0) != ($28 | 0)) { + if ($3 >>> 0 > $26 >>> 0) _abort(); + $41 = $26 + 8 | 0; + if ((HEAP32[$41 >> 2] | 0) == ($16 | 0)) $$pre$phi446Z2D = $41; else _abort(); + } else $$pre$phi446Z2D = $26 + 8 | 0; + HEAP32[$24 + 12 >> 2] = $26; + HEAP32[$$pre$phi446Z2D >> 2] = $24; + $$1 = $16; + $$1380 = $17; + $114 = $16; + break; + } + $46 = HEAP32[$16 + 24 >> 2] | 0; + $48 = HEAP32[$16 + 12 >> 2] | 0; + do if (($48 | 0) == ($16 | 0)) { + $59 = $16 + 16 | 0; + $60 = $59 + 4 | 0; + $61 = HEAP32[$60 >> 2] | 0; + if (!$61) { + $63 = HEAP32[$59 >> 2] | 0; + if (!$63) { + $$3 = 0; + break; + } else { + $$1385$ph = $63; + $$1388$ph = $59; + } + } else { + $$1385$ph = $61; + $$1388$ph = $60; + } + $$1385 = $$1385$ph; + $$1388 = $$1388$ph; + while (1) { + $65 = $$1385 + 20 | 0; + $66 = HEAP32[$65 >> 2] | 0; + if (!$66) { + $68 = $$1385 + 16 | 0; + $69 = HEAP32[$68 >> 2] | 0; + if (!$69) break; else { + $$1385$be = $69; + $$1388$be = $68; + } + } else { + $$1385$be = $66; + $$1388$be = $65; + } + $$1385 = $$1385$be; + $$1388 = $$1388$be; + } + if ($3 >>> 0 > $$1388 >>> 0) _abort(); else { + HEAP32[$$1388 >> 2] = 0; + $$3 = $$1385; + break; + } + } else { + $51 = HEAP32[$16 + 8 >> 2] | 0; + if ($3 >>> 0 > $51 >>> 0) _abort(); + $53 = $51 + 12 | 0; + if ((HEAP32[$53 >> 2] | 0) != ($16 | 0)) _abort(); + $56 = $48 + 8 | 0; + if ((HEAP32[$56 >> 2] | 0) == ($16 | 0)) { + HEAP32[$53 >> 2] = $48; + HEAP32[$56 >> 2] = $51; + $$3 = $48; + break; + } else _abort(); + } while (0); + if ($46) { + $74 = HEAP32[$16 + 28 >> 2] | 0; + $75 = 67244 + ($74 << 2) | 0; + do if ((HEAP32[$75 >> 2] | 0) == ($16 | 0)) { + HEAP32[$75 >> 2] = $$3; + if (!$$3) { + HEAP32[16736] = HEAP32[16736] & ~(1 << $74); + $$1 = $16; + $$1380 = $17; + $114 = $16; + break L10; + } + } else if ((HEAP32[16739] | 0) >>> 0 <= $46 >>> 0) { + $84 = $46 + 16 | 0; + HEAP32[((HEAP32[$84 >> 2] | 0) == ($16 | 0) ? $84 : $46 + 20 | 0) >> 2] = $$3; + if (!$$3) { + $$1 = $16; + $$1380 = $17; + $114 = $16; + break L10; + } else break; + } else _abort(); while (0); + $89 = HEAP32[16739] | 0; + if ($89 >>> 0 > $$3 >>> 0) _abort(); + HEAP32[$$3 + 24 >> 2] = $46; + $92 = $16 + 16 | 0; + $93 = HEAP32[$92 >> 2] | 0; + do if ($93 | 0) if ($89 >>> 0 > $93 >>> 0) _abort(); else { + HEAP32[$$3 + 16 >> 2] = $93; + HEAP32[$93 + 24 >> 2] = $$3; + break; + } while (0); + $99 = HEAP32[$92 + 4 >> 2] | 0; + if ($99) if ((HEAP32[16739] | 0) >>> 0 > $99 >>> 0) _abort(); else { + HEAP32[$$3 + 20 >> 2] = $99; + HEAP32[$99 + 24 >> 2] = $$3; + $$1 = $16; + $$1380 = $17; + $114 = $16; + break; + } else { + $$1 = $16; + $$1380 = $17; + $114 = $16; + } + } else { + $$1 = $16; + $$1380 = $17; + $114 = $16; + } + } else { + $$1 = $2; + $$1380 = $9; + $114 = $2; + } while (0); + if ($114 >>> 0 >= $10 >>> 0) _abort(); + $115 = $10 + 4 | 0; + $116 = HEAP32[$115 >> 2] | 0; + if (!($116 & 1)) _abort(); + if (!($116 & 2)) { + if ((HEAP32[16741] | 0) == ($10 | 0)) { + $124 = (HEAP32[16738] | 0) + $$1380 | 0; + HEAP32[16738] = $124; + HEAP32[16741] = $$1; + HEAP32[$$1 + 4 >> 2] = $124 | 1; + if (($$1 | 0) != (HEAP32[16740] | 0)) return; + HEAP32[16740] = 0; + HEAP32[16737] = 0; + return; + } + if ((HEAP32[16740] | 0) == ($10 | 0)) { + $132 = (HEAP32[16737] | 0) + $$1380 | 0; + HEAP32[16737] = $132; + HEAP32[16740] = $114; + HEAP32[$$1 + 4 >> 2] = $132 | 1; + HEAP32[$114 + $132 >> 2] = $132; + return; + } + $137 = ($116 & -8) + $$1380 | 0; + $138 = $116 >>> 3; + L111 : do if ($116 >>> 0 >= 256) { + $165 = HEAP32[$10 + 24 >> 2] | 0; + $167 = HEAP32[$10 + 12 >> 2] | 0; + do if (($167 | 0) == ($10 | 0)) { + $179 = $10 + 16 | 0; + $180 = $179 + 4 | 0; + $181 = HEAP32[$180 >> 2] | 0; + if (!$181) { + $183 = HEAP32[$179 >> 2] | 0; + if (!$183) { + $$3398 = 0; + break; + } else { + $$1396$ph = $183; + $$1400$ph = $179; + } + } else { + $$1396$ph = $181; + $$1400$ph = $180; + } + $$1396 = $$1396$ph; + $$1400 = $$1400$ph; + while (1) { + $185 = $$1396 + 20 | 0; + $186 = HEAP32[$185 >> 2] | 0; + if (!$186) { + $188 = $$1396 + 16 | 0; + $189 = HEAP32[$188 >> 2] | 0; + if (!$189) break; else { + $$1396$be = $189; + $$1400$be = $188; + } + } else { + $$1396$be = $186; + $$1400$be = $185; + } + $$1396 = $$1396$be; + $$1400 = $$1400$be; + } + if ((HEAP32[16739] | 0) >>> 0 > $$1400 >>> 0) _abort(); else { + HEAP32[$$1400 >> 2] = 0; + $$3398 = $$1396; + break; + } + } else { + $170 = HEAP32[$10 + 8 >> 2] | 0; + if ((HEAP32[16739] | 0) >>> 0 > $170 >>> 0) _abort(); + $173 = $170 + 12 | 0; + if ((HEAP32[$173 >> 2] | 0) != ($10 | 0)) _abort(); + $176 = $167 + 8 | 0; + if ((HEAP32[$176 >> 2] | 0) == ($10 | 0)) { + HEAP32[$173 >> 2] = $167; + HEAP32[$176 >> 2] = $170; + $$3398 = $167; + break; + } else _abort(); + } while (0); + if ($165 | 0) { + $195 = HEAP32[$10 + 28 >> 2] | 0; + $196 = 67244 + ($195 << 2) | 0; + do if ((HEAP32[$196 >> 2] | 0) == ($10 | 0)) { + HEAP32[$196 >> 2] = $$3398; + if (!$$3398) { + HEAP32[16736] = HEAP32[16736] & ~(1 << $195); + break L111; + } + } else if ((HEAP32[16739] | 0) >>> 0 <= $165 >>> 0) { + $205 = $165 + 16 | 0; + HEAP32[((HEAP32[$205 >> 2] | 0) == ($10 | 0) ? $205 : $165 + 20 | 0) >> 2] = $$3398; + if (!$$3398) break L111; else break; + } else _abort(); while (0); + $210 = HEAP32[16739] | 0; + if ($210 >>> 0 > $$3398 >>> 0) _abort(); + HEAP32[$$3398 + 24 >> 2] = $165; + $213 = $10 + 16 | 0; + $214 = HEAP32[$213 >> 2] | 0; + do if ($214 | 0) if ($210 >>> 0 > $214 >>> 0) _abort(); else { + HEAP32[$$3398 + 16 >> 2] = $214; + HEAP32[$214 + 24 >> 2] = $$3398; + break; + } while (0); + $220 = HEAP32[$213 + 4 >> 2] | 0; + if ($220 | 0) if ((HEAP32[16739] | 0) >>> 0 > $220 >>> 0) _abort(); else { + HEAP32[$$3398 + 20 >> 2] = $220; + HEAP32[$220 + 24 >> 2] = $$3398; + break; + } + } + } else { + $141 = HEAP32[$10 + 8 >> 2] | 0; + $143 = HEAP32[$10 + 12 >> 2] | 0; + $145 = 66980 + ($138 << 1 << 2) | 0; + if (($141 | 0) != ($145 | 0)) { + if ((HEAP32[16739] | 0) >>> 0 > $141 >>> 0) _abort(); + if ((HEAP32[$141 + 12 >> 2] | 0) != ($10 | 0)) _abort(); + } + if (($143 | 0) == ($141 | 0)) { + HEAP32[16735] = HEAP32[16735] & ~(1 << $138); + break; + } + if (($143 | 0) != ($145 | 0)) { + if ((HEAP32[16739] | 0) >>> 0 > $143 >>> 0) _abort(); + $160 = $143 + 8 | 0; + if ((HEAP32[$160 >> 2] | 0) == ($10 | 0)) $$pre$phi444Z2D = $160; else _abort(); + } else $$pre$phi444Z2D = $143 + 8 | 0; + HEAP32[$141 + 12 >> 2] = $143; + HEAP32[$$pre$phi444Z2D >> 2] = $141; + } while (0); + HEAP32[$$1 + 4 >> 2] = $137 | 1; + HEAP32[$114 + $137 >> 2] = $137; + if (($$1 | 0) == (HEAP32[16740] | 0)) { + HEAP32[16737] = $137; + return; + } else $$2 = $137; + } else { + HEAP32[$115 >> 2] = $116 & -2; + HEAP32[$$1 + 4 >> 2] = $$1380 | 1; + HEAP32[$114 + $$1380 >> 2] = $$1380; + $$2 = $$1380; + } + $235 = $$2 >>> 3; + if ($$2 >>> 0 < 256) { + $238 = 66980 + ($235 << 1 << 2) | 0; + $239 = HEAP32[16735] | 0; + $240 = 1 << $235; + if ($239 & $240) { + $244 = $238 + 8 | 0; + $245 = HEAP32[$244 >> 2] | 0; + if ((HEAP32[16739] | 0) >>> 0 > $245 >>> 0) _abort(); else { + $$0401 = $245; + $$pre$phiZ2D = $244; + } + } else { + HEAP32[16735] = $239 | $240; + $$0401 = $238; + $$pre$phiZ2D = $238 + 8 | 0; + } + HEAP32[$$pre$phiZ2D >> 2] = $$1; + HEAP32[$$0401 + 12 >> 2] = $$1; + HEAP32[$$1 + 8 >> 2] = $$0401; + HEAP32[$$1 + 12 >> 2] = $238; + return; + } + $251 = $$2 >>> 8; + if ($251) if ($$2 >>> 0 > 16777215) $$0394 = 31; else { + $256 = ($251 + 1048320 | 0) >>> 16 & 8; + $257 = $251 << $256; + $260 = ($257 + 520192 | 0) >>> 16 & 4; + $262 = $257 << $260; + $265 = ($262 + 245760 | 0) >>> 16 & 2; + $270 = 14 - ($260 | $256 | $265) + ($262 << $265 >>> 15) | 0; + $$0394 = $$2 >>> ($270 + 7 | 0) & 1 | $270 << 1; + } else $$0394 = 0; + $276 = 67244 + ($$0394 << 2) | 0; + HEAP32[$$1 + 28 >> 2] = $$0394; + HEAP32[$$1 + 20 >> 2] = 0; + HEAP32[$$1 + 16 >> 2] = 0; + $280 = HEAP32[16736] | 0; + $281 = 1 << $$0394; + L197 : do if ($280 & $281) { + $288 = HEAP32[$276 >> 2] | 0; + L200 : do if ((HEAP32[$288 + 4 >> 2] & -8 | 0) != ($$2 | 0)) { + $$0381438 = $$2 << (($$0394 | 0) == 31 ? 0 : 25 - ($$0394 >>> 1) | 0); + $$0382437 = $288; + while (1) { + $305 = $$0382437 + 16 + ($$0381438 >>> 31 << 2) | 0; + $300 = HEAP32[$305 >> 2] | 0; + if (!$300) break; + if ((HEAP32[$300 + 4 >> 2] & -8 | 0) == ($$2 | 0)) { + $$0382$lcssa = $300; + break L200; + } else { + $$0381438 = $$0381438 << 1; + $$0382437 = $300; + } + } + if ((HEAP32[16739] | 0) >>> 0 > $305 >>> 0) _abort(); else { + HEAP32[$305 >> 2] = $$1; + HEAP32[$$1 + 24 >> 2] = $$0382437; + HEAP32[$$1 + 12 >> 2] = $$1; + HEAP32[$$1 + 8 >> 2] = $$1; + break L197; + } + } else $$0382$lcssa = $288; while (0); + $312 = $$0382$lcssa + 8 | 0; + $313 = HEAP32[$312 >> 2] | 0; + $314 = HEAP32[16739] | 0; + if ($314 >>> 0 <= $313 >>> 0 & $314 >>> 0 <= $$0382$lcssa >>> 0) { + HEAP32[$313 + 12 >> 2] = $$1; + HEAP32[$312 >> 2] = $$1; + HEAP32[$$1 + 8 >> 2] = $313; + HEAP32[$$1 + 12 >> 2] = $$0382$lcssa; + HEAP32[$$1 + 24 >> 2] = 0; + break; + } else _abort(); + } else { + HEAP32[16736] = $280 | $281; + HEAP32[$276 >> 2] = $$1; + HEAP32[$$1 + 24 >> 2] = $276; + HEAP32[$$1 + 12 >> 2] = $$1; + HEAP32[$$1 + 8 >> 2] = $$1; + } while (0); + $323 = (HEAP32[16743] | 0) + -1 | 0; + HEAP32[16743] = $323; + if ($323 | 0) return; + $$0211$in$i = 67396; + while (1) { + $$0211$i = HEAP32[$$0211$in$i >> 2] | 0; + if (!$$0211$i) break; else $$0211$in$i = $$0211$i + 8 | 0; + } + HEAP32[16743] = -1; + return; +} + +function _arLabelingSubEWZ($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0373 = 0, $$0374 = 0, $$0376 = 0, $$0378 = 0, $$0380 = 0, $$0384 = 0, $$0387 = 0, $$0392 = 0, $$0395 = 0, $$0399 = 0, $$1 = 0, $$1375 = 0, $$1377 = 0, $$1379 = 0, $$1381 = 0, $$1385 = 0, $$1388 = 0, $$1393 = 0, $$1396 = 0, $$1400 = 0, $$2 = 0, $$2382 = 0, $$2386 = 0, $$2389 = 0, $$2394 = 0, $$2397 = 0, $$3 = 0, $$3383 = 0, $$3390 = 0, $$3398 = 0, $$4 = 0, $$4391 = 0, $$5 = 0, $$6 = 0, $103 = 0, $106 = 0, $121 = 0, $123 = 0, $125 = 0, $129 = 0, $13 = 0, $133 = 0, $136 = 0, $138 = 0, $142 = 0, $146 = 0, $150 = 0, $155 = 0, $157 = 0, $161 = 0, $165 = 0, $169 = 0, $175 = 0, $178 = 0, $180 = 0, $184 = 0, $188 = 0, $19 = 0, $192 = 0, $195 = 0, $20 = 0, $200 = 0, $224 = 0, $226 = 0, $232 = 0, $235 = 0, $236 = 0, $242 = 0, $254 = 0, $255 = 0, $258 = 0, $265 = 0, $266 = 0, $27 = 0, $274 = 0, $277 = 0, $278 = 0, $282 = 0, $285 = 0, $289 = 0, $292 = 0, $296 = 0, $299 = 0, $303 = 0, $306 = 0, $310 = 0.0, $311 = 0, $312 = 0, $316 = 0, $33 = 0, $34 = 0, $37 = 0, $39 = 0, $43 = 0, $47 = 0, $5 = 0, $53 = 0, $54 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $62 = 0, $65 = 0, $80 = 0, $82 = 0, $84 = 0, $88 = 0, $92 = 0, $98 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $5 = HEAP32[$4 >> 2] | 0; + $6 = $2 + -1 | 0; + $$0376 = $5; + $$0387 = 0; + $$0395 = $5 + ((Math_imul($6, $1) | 0) << 1) | 0; + while (1) { + if (($$0387 | 0) >= ($1 | 0)) break; + HEAP16[$$0395 >> 1] = 0; + HEAP16[$$0376 >> 1] = 0; + $$0376 = $$0376 + 2 | 0; + $$0387 = $$0387 + 1 | 0; + $$0395 = $$0395 + 2 | 0; + } + $13 = $1 + -1 | 0; + $$1377 = $5; + $$1388 = 0; + $$1396 = $5 + ($13 << 1) | 0; + while (1) { + if (($$1388 | 0) >= ($2 | 0)) break; + HEAP16[$$1396 >> 1] = 0; + HEAP16[$$1377 >> 1] = 0; + $$1377 = $$1377 + ($1 << 1) | 0; + $$1388 = $$1388 + 1 | 0; + $$1396 = $$1396 + ($1 << 1) | 0; + } + $19 = $4 + 1179664 | 0; + $20 = $1 + 1 | 0; + $27 = 0 - $1 | 0; + $$0373 = $0 + $20 | 0; + $$0374 = $3 + $20 | 0; + $$0384 = 1; + $$0392 = 0; + $$0399 = (HEAP32[$4 + 4 >> 2] | 0) + $20 | 0; + $$2397 = $5 + ($20 << 1) | 0; + L9 : while (1) { + if (($$0384 | 0) >= ($6 | 0)) { + label = 59; + break; + } + $$1 = $$0373; + $$1375 = $$0374; + $$1393 = $$0392; + $$1400 = $$0399; + $$2389 = 1; + $$3398 = $$2397; + while (1) { + if (($$2389 | 0) >= ($13 | 0)) break; + do if ((HEAPU8[$$1 >> 0] | 0) > (HEAPU8[$$1375 >> 0] | 0)) { + HEAP8[$$1400 >> 0] = -1; + $33 = $$3398 + ($27 << 1) | 0; + $34 = HEAP16[$33 >> 1] | 0; + if ($34 << 16 >> 16 > 0) { + HEAP16[$$3398 >> 1] = $34; + $37 = ($34 << 16 >> 16) * 7 | 0; + $39 = $4 + 1310736 + ($37 + -7 << 2) | 0; + HEAP32[$39 >> 2] = (HEAP32[$39 >> 2] | 0) + 1; + $43 = $4 + 1310736 + ($37 + -6 << 2) | 0; + HEAP32[$43 >> 2] = (HEAP32[$43 >> 2] | 0) + $$2389; + $47 = $4 + 1310736 + ($37 + -5 << 2) | 0; + HEAP32[$47 >> 2] = (HEAP32[$47 >> 2] | 0) + $$0384; + HEAP32[$4 + 1310736 + ($37 + -1 << 2) >> 2] = $$0384; + $$2394 = $$1393; + break; + } + $53 = HEAP16[$33 + 2 >> 1] | 0; + $54 = $53 << 16 >> 16; + $57 = HEAP16[$33 + -2 >> 1] | 0; + $58 = $57 << 16 >> 16; + $59 = $57 << 16 >> 16 > 0; + if ($53 << 16 >> 16 <= 0) { + if ($59) { + HEAP16[$$3398 >> 1] = $57; + $155 = $58 * 7 | 0; + $157 = $4 + 1310736 + ($155 + -7 << 2) | 0; + HEAP32[$157 >> 2] = (HEAP32[$157 >> 2] | 0) + 1; + $161 = $4 + 1310736 + ($155 + -6 << 2) | 0; + HEAP32[$161 >> 2] = (HEAP32[$161 >> 2] | 0) + $$2389; + $165 = $4 + 1310736 + ($155 + -5 << 2) | 0; + HEAP32[$165 >> 2] = (HEAP32[$165 >> 2] | 0) + $$0384; + $169 = $4 + 1310736 + ($155 + -3 << 2) | 0; + if ((HEAP32[$169 >> 2] | 0) < ($$2389 | 0)) HEAP32[$169 >> 2] = $$2389; + HEAP32[$4 + 1310736 + ($155 + -1 << 2) >> 2] = $$0384; + $$2394 = $$1393; + break; + } + $175 = HEAP16[$$3398 + -2 >> 1] | 0; + if ($175 << 16 >> 16 > 0) { + HEAP16[$$3398 >> 1] = $175; + $178 = ($175 << 16 >> 16) * 7 | 0; + $180 = $4 + 1310736 + ($178 + -7 << 2) | 0; + HEAP32[$180 >> 2] = (HEAP32[$180 >> 2] | 0) + 1; + $184 = $4 + 1310736 + ($178 + -6 << 2) | 0; + HEAP32[$184 >> 2] = (HEAP32[$184 >> 2] | 0) + $$2389; + $188 = $4 + 1310736 + ($178 + -5 << 2) | 0; + HEAP32[$188 >> 2] = (HEAP32[$188 >> 2] | 0) + $$0384; + $192 = $4 + 1310736 + ($178 + -3 << 2) | 0; + if ((HEAP32[$192 >> 2] | 0) >= ($$2389 | 0)) { + $$2394 = $$1393; + break; + } + HEAP32[$192 >> 2] = $$2389; + $$2394 = $$1393; + break; + } else { + $195 = $$1393 + 1 | 0; + if (($$1393 | 0) > 32767) { + label = 54; + break L9; + } + HEAP16[$$3398 >> 1] = $195; + HEAP32[$4 + 1179664 + ($$1393 << 2) >> 2] = $195 << 16 >> 16; + $200 = $$1393 * 7 | 0; + HEAP32[$4 + 1310736 + ($200 << 2) >> 2] = 1; + HEAP32[$4 + 1310736 + ($200 + 1 << 2) >> 2] = $$2389; + HEAP32[$4 + 1310736 + ($200 + 2 << 2) >> 2] = $$0384; + HEAP32[$4 + 1310736 + ($200 + 3 << 2) >> 2] = $$2389; + HEAP32[$4 + 1310736 + ($200 + 4 << 2) >> 2] = $$2389; + HEAP32[$4 + 1310736 + ($200 + 5 << 2) >> 2] = $$0384; + HEAP32[$4 + 1310736 + ($200 + 6 << 2) >> 2] = $$0384; + $$2394 = $195; + break; + } + } + if ($59) { + $62 = HEAP32[$4 + 1179664 + ($54 + -1 << 2) >> 2] | 0; + $65 = HEAP32[$4 + 1179664 + ($58 + -1 << 2) >> 2] | 0; + L36 : do if (($62 | 0) <= ($65 | 0)) { + HEAP16[$$3398 >> 1] = $62; + if (($62 | 0) < ($65 | 0)) { + $$1379 = $19; + $$1381 = 0; + while (1) { + if (($$1381 | 0) >= ($$1393 | 0)) { + $80 = $62; + break L36; + } + if ((HEAP32[$$1379 >> 2] | 0) == ($65 | 0)) HEAP32[$$1379 >> 2] = $62; + $$1379 = $$1379 + 4 | 0; + $$1381 = $$1381 + 1 | 0; + } + } else $80 = $62; + } else { + HEAP16[$$3398 >> 1] = $65; + $$0378 = $19; + $$0380 = 0; + while (1) { + if (($$0380 | 0) >= ($$1393 | 0)) { + $80 = $65; + break L36; + } + if ((HEAP32[$$0378 >> 2] | 0) == ($62 | 0)) HEAP32[$$0378 >> 2] = $65; + $$0378 = $$0378 + 4 | 0; + $$0380 = $$0380 + 1 | 0; + } + } while (0); + $82 = ($80 << 16 >> 16) * 7 | 0; + $84 = $4 + 1310736 + ($82 + -7 << 2) | 0; + HEAP32[$84 >> 2] = (HEAP32[$84 >> 2] | 0) + 1; + $88 = $4 + 1310736 + ($82 + -6 << 2) | 0; + HEAP32[$88 >> 2] = (HEAP32[$88 >> 2] | 0) + $$2389; + $92 = $4 + 1310736 + ($82 + -5 << 2) | 0; + HEAP32[$92 >> 2] = (HEAP32[$92 >> 2] | 0) + $$0384; + HEAP32[$4 + 1310736 + ($82 + -1 << 2) >> 2] = $$0384; + $$2394 = $$1393; + break; + } + $98 = HEAP16[$$3398 + -2 >> 1] | 0; + if ($98 << 16 >> 16 <= 0) { + HEAP16[$$3398 >> 1] = $53; + $136 = $54 * 7 | 0; + $138 = $4 + 1310736 + ($136 + -7 << 2) | 0; + HEAP32[$138 >> 2] = (HEAP32[$138 >> 2] | 0) + 1; + $142 = $4 + 1310736 + ($136 + -6 << 2) | 0; + HEAP32[$142 >> 2] = (HEAP32[$142 >> 2] | 0) + $$2389; + $146 = $4 + 1310736 + ($136 + -5 << 2) | 0; + HEAP32[$146 >> 2] = (HEAP32[$146 >> 2] | 0) + $$0384; + $150 = $4 + 1310736 + ($136 + -4 << 2) | 0; + if ((HEAP32[$150 >> 2] | 0) > ($$2389 | 0)) HEAP32[$150 >> 2] = $$2389; + HEAP32[$4 + 1310736 + ($136 + -1 << 2) >> 2] = $$0384; + $$2394 = $$1393; + break; + } + $103 = HEAP32[$4 + 1179664 + ($54 + -1 << 2) >> 2] | 0; + $106 = HEAP32[$4 + 1179664 + (($98 << 16 >> 16) + -1 << 2) >> 2] | 0; + L60 : do if (($103 | 0) <= ($106 | 0)) { + HEAP16[$$3398 >> 1] = $103; + if (($103 | 0) < ($106 | 0)) { + $$3 = $19; + $$3383 = 0; + while (1) { + if (($$3383 | 0) >= ($$1393 | 0)) { + $121 = $103; + break L60; + } + if ((HEAP32[$$3 >> 2] | 0) == ($106 | 0)) HEAP32[$$3 >> 2] = $103; + $$3 = $$3 + 4 | 0; + $$3383 = $$3383 + 1 | 0; + } + } else $121 = $103; + } else { + HEAP16[$$3398 >> 1] = $106; + $$2 = $19; + $$2382 = 0; + while (1) { + if (($$2382 | 0) >= ($$1393 | 0)) { + $121 = $106; + break L60; + } + if ((HEAP32[$$2 >> 2] | 0) == ($103 | 0)) HEAP32[$$2 >> 2] = $106; + $$2 = $$2 + 4 | 0; + $$2382 = $$2382 + 1 | 0; + } + } while (0); + $123 = ($121 << 16 >> 16) * 7 | 0; + $125 = $4 + 1310736 + ($123 + -7 << 2) | 0; + HEAP32[$125 >> 2] = (HEAP32[$125 >> 2] | 0) + 1; + $129 = $4 + 1310736 + ($123 + -6 << 2) | 0; + HEAP32[$129 >> 2] = (HEAP32[$129 >> 2] | 0) + $$2389; + $133 = $4 + 1310736 + ($123 + -5 << 2) | 0; + HEAP32[$133 >> 2] = (HEAP32[$133 >> 2] | 0) + $$0384; + $$2394 = $$1393; + } else { + HEAP16[$$3398 >> 1] = 0; + HEAP8[$$1400 >> 0] = 0; + $$2394 = $$1393; + } while (0); + $$1 = $$1 + 1 | 0; + $$1375 = $$1375 + 1 | 0; + $$1393 = $$2394; + $$1400 = $$1400 + 1 | 0; + $$2389 = $$2389 + 1 | 0; + $$3398 = $$3398 + 2 | 0; + } + $$0373 = $$1 + 2 | 0; + $$0374 = $$1375 + 2 | 0; + $$0384 = $$0384 + 1 | 0; + $$0392 = $$1393; + $$0399 = $$1400 + 2 | 0; + $$2397 = $$3398 + 4 | 0; + } + L80 : do if ((label | 0) == 54) { + _arLog(0, 3, 23780, $vararg_buffer); + $$0 = -1; + } else if ((label | 0) == 59) { + $224 = $4 + 12 | 0; + $$1385 = 1; + $$3390 = 1; + $$4 = $19; + while (1) { + if (($$3390 | 0) > ($$0392 | 0)) break; + $226 = HEAP32[$$4 >> 2] | 0; + if (($226 | 0) == ($$3390 | 0)) { + $$2386 = $$1385 + 1 | 0; + $232 = $$1385; + } else { + $$2386 = $$1385; + $232 = HEAP32[$4 + 1179664 + ($226 + -1 << 2) >> 2] | 0; + } + HEAP32[$$4 >> 2] = $232; + $$1385 = $$2386; + $$3390 = $$3390 + 1 | 0; + $$4 = $$4 + 4 | 0; + } + $235 = $4 + 8 | 0; + $236 = $$1385 + -1 | 0; + HEAP32[$235 >> 2] = $236; + if (!$236) $$0 = 0; else { + _memset($224 | 0, 0, $236 << 2 | 0) | 0; + _memset($4 + 655376 | 0, 0, $236 << 4 | 0) | 0; + $$4391 = 0; + while (1) { + if (($$4391 | 0) >= ($236 | 0)) break; + $242 = $$4391 << 2; + HEAP32[$4 + 131084 + ($242 << 2) >> 2] = $1; + HEAP32[$4 + 131084 + (($242 | 1) << 2) >> 2] = 0; + HEAP32[$4 + 131084 + (($242 | 2) << 2) >> 2] = $2; + HEAP32[$4 + 131084 + (($242 | 3) << 2) >> 2] = 0; + $$4391 = $$4391 + 1 | 0; + } + $$5 = 0; + while (1) { + if (($$5 | 0) >= ($$0392 | 0)) break; + $254 = (HEAP32[$4 + 1179664 + ($$5 << 2) >> 2] | 0) + -1 | 0; + $255 = $$5 * 7 | 0; + $258 = $4 + 12 + ($254 << 2) | 0; + HEAP32[$258 >> 2] = (HEAP32[$258 >> 2] | 0) + (HEAP32[$4 + 1310736 + ($255 << 2) >> 2] | 0); + $265 = $254 << 1; + $266 = $4 + 655376 + ($265 << 3) | 0; + HEAPF64[$266 >> 3] = +HEAPF64[$266 >> 3] + +(HEAP32[$4 + 1310736 + ($255 + 1 << 2) >> 2] | 0); + $274 = $4 + 655376 + (($265 | 1) << 3) | 0; + HEAPF64[$274 >> 3] = +HEAPF64[$274 >> 3] + +(HEAP32[$4 + 1310736 + ($255 + 2 << 2) >> 2] | 0); + $277 = $254 << 2; + $278 = $4 + 131084 + ($277 << 2) | 0; + $282 = HEAP32[$4 + 1310736 + ($255 + 3 << 2) >> 2] | 0; + if ((HEAP32[$278 >> 2] | 0) > ($282 | 0)) HEAP32[$278 >> 2] = $282; + $285 = $4 + 131084 + (($277 | 1) << 2) | 0; + $289 = HEAP32[$4 + 1310736 + ($255 + 4 << 2) >> 2] | 0; + if ((HEAP32[$285 >> 2] | 0) < ($289 | 0)) HEAP32[$285 >> 2] = $289; + $292 = $4 + 131084 + (($277 | 2) << 2) | 0; + $296 = HEAP32[$4 + 1310736 + ($255 + 5 << 2) >> 2] | 0; + if ((HEAP32[$292 >> 2] | 0) > ($296 | 0)) HEAP32[$292 >> 2] = $296; + $299 = $4 + 131084 + (($277 | 3) << 2) | 0; + $303 = HEAP32[$4 + 1310736 + ($255 + 6 << 2) >> 2] | 0; + if ((HEAP32[$299 >> 2] | 0) < ($303 | 0)) HEAP32[$299 >> 2] = $303; + $$5 = $$5 + 1 | 0; + } + $306 = HEAP32[$235 >> 2] | 0; + $$6 = 0; + while (1) { + if (($$6 | 0) >= ($306 | 0)) { + $$0 = 0; + break L80; + } + $310 = +(HEAP32[$4 + 12 + ($$6 << 2) >> 2] | 0); + $311 = $$6 << 1; + $312 = $4 + 655376 + ($311 << 3) | 0; + HEAPF64[$312 >> 3] = +HEAPF64[$312 >> 3] / $310; + $316 = $4 + 655376 + (($311 | 1) << 3) | 0; + HEAPF64[$316 >> 3] = +HEAPF64[$316 >> 3] / $310; + $$6 = $$6 + 1 | 0; + } + } + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function _arLabelingSubEBZ($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0373 = 0, $$0374 = 0, $$0376 = 0, $$0378 = 0, $$0380 = 0, $$0384 = 0, $$0387 = 0, $$0392 = 0, $$0395 = 0, $$0399 = 0, $$1 = 0, $$1375 = 0, $$1377 = 0, $$1379 = 0, $$1381 = 0, $$1385 = 0, $$1388 = 0, $$1393 = 0, $$1396 = 0, $$1400 = 0, $$2 = 0, $$2382 = 0, $$2386 = 0, $$2389 = 0, $$2394 = 0, $$2397 = 0, $$3 = 0, $$3383 = 0, $$3390 = 0, $$3398 = 0, $$4 = 0, $$4391 = 0, $$5 = 0, $$6 = 0, $103 = 0, $106 = 0, $121 = 0, $123 = 0, $125 = 0, $129 = 0, $13 = 0, $133 = 0, $136 = 0, $138 = 0, $142 = 0, $146 = 0, $150 = 0, $155 = 0, $157 = 0, $161 = 0, $165 = 0, $169 = 0, $175 = 0, $178 = 0, $180 = 0, $184 = 0, $188 = 0, $19 = 0, $192 = 0, $195 = 0, $20 = 0, $200 = 0, $224 = 0, $226 = 0, $232 = 0, $235 = 0, $236 = 0, $242 = 0, $254 = 0, $255 = 0, $258 = 0, $265 = 0, $266 = 0, $27 = 0, $274 = 0, $277 = 0, $278 = 0, $282 = 0, $285 = 0, $289 = 0, $292 = 0, $296 = 0, $299 = 0, $303 = 0, $306 = 0, $310 = 0.0, $311 = 0, $312 = 0, $316 = 0, $33 = 0, $34 = 0, $37 = 0, $39 = 0, $43 = 0, $47 = 0, $5 = 0, $53 = 0, $54 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $62 = 0, $65 = 0, $80 = 0, $82 = 0, $84 = 0, $88 = 0, $92 = 0, $98 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $5 = HEAP32[$4 >> 2] | 0; + $6 = $2 + -1 | 0; + $$0376 = $5; + $$0387 = 0; + $$0395 = $5 + ((Math_imul($6, $1) | 0) << 1) | 0; + while (1) { + if (($$0387 | 0) >= ($1 | 0)) break; + HEAP16[$$0395 >> 1] = 0; + HEAP16[$$0376 >> 1] = 0; + $$0376 = $$0376 + 2 | 0; + $$0387 = $$0387 + 1 | 0; + $$0395 = $$0395 + 2 | 0; + } + $13 = $1 + -1 | 0; + $$1377 = $5; + $$1388 = 0; + $$1396 = $5 + ($13 << 1) | 0; + while (1) { + if (($$1388 | 0) >= ($2 | 0)) break; + HEAP16[$$1396 >> 1] = 0; + HEAP16[$$1377 >> 1] = 0; + $$1377 = $$1377 + ($1 << 1) | 0; + $$1388 = $$1388 + 1 | 0; + $$1396 = $$1396 + ($1 << 1) | 0; + } + $19 = $4 + 1179664 | 0; + $20 = $1 + 1 | 0; + $27 = 0 - $1 | 0; + $$0373 = $0 + $20 | 0; + $$0374 = $3 + $20 | 0; + $$0384 = 1; + $$0392 = 0; + $$0399 = (HEAP32[$4 + 4 >> 2] | 0) + $20 | 0; + $$2397 = $5 + ($20 << 1) | 0; + L9 : while (1) { + if (($$0384 | 0) >= ($6 | 0)) { + label = 59; + break; + } + $$1 = $$0373; + $$1375 = $$0374; + $$1393 = $$0392; + $$1400 = $$0399; + $$2389 = 1; + $$3398 = $$2397; + while (1) { + if (($$2389 | 0) >= ($13 | 0)) break; + do if ((HEAPU8[$$1 >> 0] | 0) > (HEAPU8[$$1375 >> 0] | 0)) { + HEAP16[$$3398 >> 1] = 0; + HEAP8[$$1400 >> 0] = 0; + $$2394 = $$1393; + } else { + HEAP8[$$1400 >> 0] = -1; + $33 = $$3398 + ($27 << 1) | 0; + $34 = HEAP16[$33 >> 1] | 0; + if ($34 << 16 >> 16 > 0) { + HEAP16[$$3398 >> 1] = $34; + $37 = ($34 << 16 >> 16) * 7 | 0; + $39 = $4 + 1310736 + ($37 + -7 << 2) | 0; + HEAP32[$39 >> 2] = (HEAP32[$39 >> 2] | 0) + 1; + $43 = $4 + 1310736 + ($37 + -6 << 2) | 0; + HEAP32[$43 >> 2] = (HEAP32[$43 >> 2] | 0) + $$2389; + $47 = $4 + 1310736 + ($37 + -5 << 2) | 0; + HEAP32[$47 >> 2] = (HEAP32[$47 >> 2] | 0) + $$0384; + HEAP32[$4 + 1310736 + ($37 + -1 << 2) >> 2] = $$0384; + $$2394 = $$1393; + break; + } + $53 = HEAP16[$33 + 2 >> 1] | 0; + $54 = $53 << 16 >> 16; + $57 = HEAP16[$33 + -2 >> 1] | 0; + $58 = $57 << 16 >> 16; + $59 = $57 << 16 >> 16 > 0; + if ($53 << 16 >> 16 <= 0) { + if ($59) { + HEAP16[$$3398 >> 1] = $57; + $155 = $58 * 7 | 0; + $157 = $4 + 1310736 + ($155 + -7 << 2) | 0; + HEAP32[$157 >> 2] = (HEAP32[$157 >> 2] | 0) + 1; + $161 = $4 + 1310736 + ($155 + -6 << 2) | 0; + HEAP32[$161 >> 2] = (HEAP32[$161 >> 2] | 0) + $$2389; + $165 = $4 + 1310736 + ($155 + -5 << 2) | 0; + HEAP32[$165 >> 2] = (HEAP32[$165 >> 2] | 0) + $$0384; + $169 = $4 + 1310736 + ($155 + -3 << 2) | 0; + if ((HEAP32[$169 >> 2] | 0) < ($$2389 | 0)) HEAP32[$169 >> 2] = $$2389; + HEAP32[$4 + 1310736 + ($155 + -1 << 2) >> 2] = $$0384; + $$2394 = $$1393; + break; + } + $175 = HEAP16[$$3398 + -2 >> 1] | 0; + if ($175 << 16 >> 16 > 0) { + HEAP16[$$3398 >> 1] = $175; + $178 = ($175 << 16 >> 16) * 7 | 0; + $180 = $4 + 1310736 + ($178 + -7 << 2) | 0; + HEAP32[$180 >> 2] = (HEAP32[$180 >> 2] | 0) + 1; + $184 = $4 + 1310736 + ($178 + -6 << 2) | 0; + HEAP32[$184 >> 2] = (HEAP32[$184 >> 2] | 0) + $$2389; + $188 = $4 + 1310736 + ($178 + -5 << 2) | 0; + HEAP32[$188 >> 2] = (HEAP32[$188 >> 2] | 0) + $$0384; + $192 = $4 + 1310736 + ($178 + -3 << 2) | 0; + if ((HEAP32[$192 >> 2] | 0) >= ($$2389 | 0)) { + $$2394 = $$1393; + break; + } + HEAP32[$192 >> 2] = $$2389; + $$2394 = $$1393; + break; + } else { + $195 = $$1393 + 1 | 0; + if (($$1393 | 0) > 32767) { + label = 54; + break L9; + } + HEAP16[$$3398 >> 1] = $195; + HEAP32[$4 + 1179664 + ($$1393 << 2) >> 2] = $195 << 16 >> 16; + $200 = $$1393 * 7 | 0; + HEAP32[$4 + 1310736 + ($200 << 2) >> 2] = 1; + HEAP32[$4 + 1310736 + ($200 + 1 << 2) >> 2] = $$2389; + HEAP32[$4 + 1310736 + ($200 + 2 << 2) >> 2] = $$0384; + HEAP32[$4 + 1310736 + ($200 + 3 << 2) >> 2] = $$2389; + HEAP32[$4 + 1310736 + ($200 + 4 << 2) >> 2] = $$2389; + HEAP32[$4 + 1310736 + ($200 + 5 << 2) >> 2] = $$0384; + HEAP32[$4 + 1310736 + ($200 + 6 << 2) >> 2] = $$0384; + $$2394 = $195; + break; + } + } + if ($59) { + $62 = HEAP32[$4 + 1179664 + ($54 + -1 << 2) >> 2] | 0; + $65 = HEAP32[$4 + 1179664 + ($58 + -1 << 2) >> 2] | 0; + L37 : do if (($62 | 0) <= ($65 | 0)) { + HEAP16[$$3398 >> 1] = $62; + if (($62 | 0) < ($65 | 0)) { + $$1379 = $19; + $$1381 = 0; + while (1) { + if (($$1381 | 0) >= ($$1393 | 0)) { + $80 = $62; + break L37; + } + if ((HEAP32[$$1379 >> 2] | 0) == ($65 | 0)) HEAP32[$$1379 >> 2] = $62; + $$1379 = $$1379 + 4 | 0; + $$1381 = $$1381 + 1 | 0; + } + } else $80 = $62; + } else { + HEAP16[$$3398 >> 1] = $65; + $$0378 = $19; + $$0380 = 0; + while (1) { + if (($$0380 | 0) >= ($$1393 | 0)) { + $80 = $65; + break L37; + } + if ((HEAP32[$$0378 >> 2] | 0) == ($62 | 0)) HEAP32[$$0378 >> 2] = $65; + $$0378 = $$0378 + 4 | 0; + $$0380 = $$0380 + 1 | 0; + } + } while (0); + $82 = ($80 << 16 >> 16) * 7 | 0; + $84 = $4 + 1310736 + ($82 + -7 << 2) | 0; + HEAP32[$84 >> 2] = (HEAP32[$84 >> 2] | 0) + 1; + $88 = $4 + 1310736 + ($82 + -6 << 2) | 0; + HEAP32[$88 >> 2] = (HEAP32[$88 >> 2] | 0) + $$2389; + $92 = $4 + 1310736 + ($82 + -5 << 2) | 0; + HEAP32[$92 >> 2] = (HEAP32[$92 >> 2] | 0) + $$0384; + HEAP32[$4 + 1310736 + ($82 + -1 << 2) >> 2] = $$0384; + $$2394 = $$1393; + break; + } + $98 = HEAP16[$$3398 + -2 >> 1] | 0; + if ($98 << 16 >> 16 <= 0) { + HEAP16[$$3398 >> 1] = $53; + $136 = $54 * 7 | 0; + $138 = $4 + 1310736 + ($136 + -7 << 2) | 0; + HEAP32[$138 >> 2] = (HEAP32[$138 >> 2] | 0) + 1; + $142 = $4 + 1310736 + ($136 + -6 << 2) | 0; + HEAP32[$142 >> 2] = (HEAP32[$142 >> 2] | 0) + $$2389; + $146 = $4 + 1310736 + ($136 + -5 << 2) | 0; + HEAP32[$146 >> 2] = (HEAP32[$146 >> 2] | 0) + $$0384; + $150 = $4 + 1310736 + ($136 + -4 << 2) | 0; + if ((HEAP32[$150 >> 2] | 0) > ($$2389 | 0)) HEAP32[$150 >> 2] = $$2389; + HEAP32[$4 + 1310736 + ($136 + -1 << 2) >> 2] = $$0384; + $$2394 = $$1393; + break; + } + $103 = HEAP32[$4 + 1179664 + ($54 + -1 << 2) >> 2] | 0; + $106 = HEAP32[$4 + 1179664 + (($98 << 16 >> 16) + -1 << 2) >> 2] | 0; + L61 : do if (($103 | 0) <= ($106 | 0)) { + HEAP16[$$3398 >> 1] = $103; + if (($103 | 0) < ($106 | 0)) { + $$3 = $19; + $$3383 = 0; + while (1) { + if (($$3383 | 0) >= ($$1393 | 0)) { + $121 = $103; + break L61; + } + if ((HEAP32[$$3 >> 2] | 0) == ($106 | 0)) HEAP32[$$3 >> 2] = $103; + $$3 = $$3 + 4 | 0; + $$3383 = $$3383 + 1 | 0; + } + } else $121 = $103; + } else { + HEAP16[$$3398 >> 1] = $106; + $$2 = $19; + $$2382 = 0; + while (1) { + if (($$2382 | 0) >= ($$1393 | 0)) { + $121 = $106; + break L61; + } + if ((HEAP32[$$2 >> 2] | 0) == ($103 | 0)) HEAP32[$$2 >> 2] = $106; + $$2 = $$2 + 4 | 0; + $$2382 = $$2382 + 1 | 0; + } + } while (0); + $123 = ($121 << 16 >> 16) * 7 | 0; + $125 = $4 + 1310736 + ($123 + -7 << 2) | 0; + HEAP32[$125 >> 2] = (HEAP32[$125 >> 2] | 0) + 1; + $129 = $4 + 1310736 + ($123 + -6 << 2) | 0; + HEAP32[$129 >> 2] = (HEAP32[$129 >> 2] | 0) + $$2389; + $133 = $4 + 1310736 + ($123 + -5 << 2) | 0; + HEAP32[$133 >> 2] = (HEAP32[$133 >> 2] | 0) + $$0384; + $$2394 = $$1393; + } while (0); + $$1 = $$1 + 1 | 0; + $$1375 = $$1375 + 1 | 0; + $$1393 = $$2394; + $$1400 = $$1400 + 1 | 0; + $$2389 = $$2389 + 1 | 0; + $$3398 = $$3398 + 2 | 0; + } + $$0373 = $$1 + 2 | 0; + $$0374 = $$1375 + 2 | 0; + $$0384 = $$0384 + 1 | 0; + $$0392 = $$1393; + $$0399 = $$1400 + 2 | 0; + $$2397 = $$3398 + 4 | 0; + } + L80 : do if ((label | 0) == 54) { + _arLog(0, 3, 23780, $vararg_buffer); + $$0 = -1; + } else if ((label | 0) == 59) { + $224 = $4 + 12 | 0; + $$1385 = 1; + $$3390 = 1; + $$4 = $19; + while (1) { + if (($$3390 | 0) > ($$0392 | 0)) break; + $226 = HEAP32[$$4 >> 2] | 0; + if (($226 | 0) == ($$3390 | 0)) { + $$2386 = $$1385 + 1 | 0; + $232 = $$1385; + } else { + $$2386 = $$1385; + $232 = HEAP32[$4 + 1179664 + ($226 + -1 << 2) >> 2] | 0; + } + HEAP32[$$4 >> 2] = $232; + $$1385 = $$2386; + $$3390 = $$3390 + 1 | 0; + $$4 = $$4 + 4 | 0; + } + $235 = $4 + 8 | 0; + $236 = $$1385 + -1 | 0; + HEAP32[$235 >> 2] = $236; + if (!$236) $$0 = 0; else { + _memset($224 | 0, 0, $236 << 2 | 0) | 0; + _memset($4 + 655376 | 0, 0, $236 << 4 | 0) | 0; + $$4391 = 0; + while (1) { + if (($$4391 | 0) >= ($236 | 0)) break; + $242 = $$4391 << 2; + HEAP32[$4 + 131084 + ($242 << 2) >> 2] = $1; + HEAP32[$4 + 131084 + (($242 | 1) << 2) >> 2] = 0; + HEAP32[$4 + 131084 + (($242 | 2) << 2) >> 2] = $2; + HEAP32[$4 + 131084 + (($242 | 3) << 2) >> 2] = 0; + $$4391 = $$4391 + 1 | 0; + } + $$5 = 0; + while (1) { + if (($$5 | 0) >= ($$0392 | 0)) break; + $254 = (HEAP32[$4 + 1179664 + ($$5 << 2) >> 2] | 0) + -1 | 0; + $255 = $$5 * 7 | 0; + $258 = $4 + 12 + ($254 << 2) | 0; + HEAP32[$258 >> 2] = (HEAP32[$258 >> 2] | 0) + (HEAP32[$4 + 1310736 + ($255 << 2) >> 2] | 0); + $265 = $254 << 1; + $266 = $4 + 655376 + ($265 << 3) | 0; + HEAPF64[$266 >> 3] = +HEAPF64[$266 >> 3] + +(HEAP32[$4 + 1310736 + ($255 + 1 << 2) >> 2] | 0); + $274 = $4 + 655376 + (($265 | 1) << 3) | 0; + HEAPF64[$274 >> 3] = +HEAPF64[$274 >> 3] + +(HEAP32[$4 + 1310736 + ($255 + 2 << 2) >> 2] | 0); + $277 = $254 << 2; + $278 = $4 + 131084 + ($277 << 2) | 0; + $282 = HEAP32[$4 + 1310736 + ($255 + 3 << 2) >> 2] | 0; + if ((HEAP32[$278 >> 2] | 0) > ($282 | 0)) HEAP32[$278 >> 2] = $282; + $285 = $4 + 131084 + (($277 | 1) << 2) | 0; + $289 = HEAP32[$4 + 1310736 + ($255 + 4 << 2) >> 2] | 0; + if ((HEAP32[$285 >> 2] | 0) < ($289 | 0)) HEAP32[$285 >> 2] = $289; + $292 = $4 + 131084 + (($277 | 2) << 2) | 0; + $296 = HEAP32[$4 + 1310736 + ($255 + 5 << 2) >> 2] | 0; + if ((HEAP32[$292 >> 2] | 0) > ($296 | 0)) HEAP32[$292 >> 2] = $296; + $299 = $4 + 131084 + (($277 | 3) << 2) | 0; + $303 = HEAP32[$4 + 1310736 + ($255 + 6 << 2) >> 2] | 0; + if ((HEAP32[$299 >> 2] | 0) < ($303 | 0)) HEAP32[$299 >> 2] = $303; + $$5 = $$5 + 1 | 0; + } + $306 = HEAP32[$235 >> 2] | 0; + $$6 = 0; + while (1) { + if (($$6 | 0) >= ($306 | 0)) { + $$0 = 0; + break L80; + } + $310 = +(HEAP32[$4 + 12 + ($$6 << 2) >> 2] | 0); + $311 = $$6 << 1; + $312 = $4 + 655376 + ($311 << 3) | 0; + HEAPF64[$312 >> 3] = +HEAPF64[$312 >> 3] / $310; + $316 = $4 + 655376 + (($311 | 1) << 3) | 0; + HEAPF64[$316 >> 3] = +HEAPF64[$316 >> 3] / $310; + $$6 = $$6 + 1 | 0; + } + } + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function _arLabelingSubEWIC($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0369 = 0, $$0370 = 0, $$0372 = 0, $$0374 = 0, $$0378 = 0, $$0382 = 0, $$0385 = 0, $$0390 = 0, $$0393 = 0, $$1 = 0, $$1371 = 0, $$1373 = 0, $$1375 = 0, $$1379 = 0, $$1383 = 0, $$1386 = 0, $$1391 = 0, $$1394 = 0, $$2 = 0, $$2376 = 0, $$2380 = 0, $$2384 = 0, $$2387 = 0, $$2392 = 0, $$3 = 0, $$3377 = 0, $$3381 = 0, $$3388 = 0, $$4 = 0, $$4389 = 0, $$5 = 0, $$6 = 0, $101 = 0, $106 = 0, $109 = 0, $124 = 0, $126 = 0, $128 = 0, $132 = 0, $136 = 0, $139 = 0, $141 = 0, $145 = 0, $149 = 0, $15 = 0, $153 = 0, $158 = 0, $160 = 0, $164 = 0, $168 = 0, $172 = 0, $178 = 0, $181 = 0, $183 = 0, $187 = 0, $191 = 0, $195 = 0, $198 = 0, $203 = 0, $21 = 0, $22 = 0, $226 = 0, $228 = 0, $234 = 0, $237 = 0, $238 = 0, $244 = 0, $256 = 0, $257 = 0, $260 = 0, $267 = 0, $268 = 0, $276 = 0, $279 = 0, $280 = 0, $284 = 0, $287 = 0, $291 = 0, $294 = 0, $298 = 0, $30 = 0, $301 = 0, $305 = 0, $308 = 0, $312 = 0.0, $313 = 0, $314 = 0, $318 = 0, $36 = 0, $37 = 0, $40 = 0, $42 = 0, $46 = 0, $5 = 0, $50 = 0, $56 = 0, $57 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $65 = 0, $68 = 0, $7 = 0, $8 = 0, $83 = 0, $85 = 0, $87 = 0, $91 = 0, $95 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $5 = ($1 | 0) / 2 | 0; + $6 = ($2 | 0) / 2 | 0; + $7 = HEAP32[$4 >> 2] | 0; + $8 = $6 + -1 | 0; + $$0370 = $7; + $$0372 = $7 + ((Math_imul($8, $5) | 0) << 1) | 0; + $$0385 = 0; + while (1) { + if (($$0385 | 0) >= ($5 | 0)) break; + HEAP16[$$0372 >> 1] = 0; + HEAP16[$$0370 >> 1] = 0; + $$0370 = $$0370 + 2 | 0; + $$0372 = $$0372 + 2 | 0; + $$0385 = $$0385 + 1 | 0; + } + $15 = $5 + -1 | 0; + $$1371 = $7; + $$1373 = $7 + ($15 << 1) | 0; + $$1386 = 0; + while (1) { + if (($$1386 | 0) >= ($6 | 0)) break; + HEAP16[$$1373 >> 1] = 0; + HEAP16[$$1371 >> 1] = 0; + $$1371 = $$1371 + ($5 << 1) | 0; + $$1373 = $$1373 + ($5 << 1) | 0; + $$1386 = $$1386 + 1 | 0; + } + $21 = $4 + 1179664 | 0; + $22 = $5 + 1 | 0; + $30 = 0 - $5 | 0; + $$0369 = $0 + (($1 << 1) + 2) | 0; + $$0382 = 1; + $$0390 = 0; + $$0393 = (HEAP32[$4 + 4 >> 2] | 0) + $22 | 0; + $$2 = $7 + ($22 << 1) | 0; + L9 : while (1) { + if (($$0382 | 0) >= ($8 | 0)) { + label = 59; + break; + } + $$1 = $$0369; + $$1391 = $$0390; + $$1394 = $$0393; + $$2387 = 1; + $$3 = $$2; + while (1) { + if (($$2387 | 0) >= ($15 | 0)) break; + do if ((HEAPU8[$$1 >> 0] | 0 | 0) > ($3 | 0)) { + HEAP8[$$1394 >> 0] = -1; + $36 = $$3 + ($30 << 1) | 0; + $37 = HEAP16[$36 >> 1] | 0; + if ($37 << 16 >> 16 > 0) { + HEAP16[$$3 >> 1] = $37; + $40 = ($37 << 16 >> 16) * 7 | 0; + $42 = $4 + 1310736 + ($40 + -7 << 2) | 0; + HEAP32[$42 >> 2] = (HEAP32[$42 >> 2] | 0) + 1; + $46 = $4 + 1310736 + ($40 + -6 << 2) | 0; + HEAP32[$46 >> 2] = (HEAP32[$46 >> 2] | 0) + $$2387; + $50 = $4 + 1310736 + ($40 + -5 << 2) | 0; + HEAP32[$50 >> 2] = (HEAP32[$50 >> 2] | 0) + $$0382; + HEAP32[$4 + 1310736 + ($40 + -1 << 2) >> 2] = $$0382; + $$2392 = $$1391; + break; + } + $56 = HEAP16[$36 + 2 >> 1] | 0; + $57 = $56 << 16 >> 16; + $60 = HEAP16[$36 + -2 >> 1] | 0; + $61 = $60 << 16 >> 16; + $62 = $60 << 16 >> 16 > 0; + if ($56 << 16 >> 16 <= 0) { + if ($62) { + HEAP16[$$3 >> 1] = $60; + $158 = $61 * 7 | 0; + $160 = $4 + 1310736 + ($158 + -7 << 2) | 0; + HEAP32[$160 >> 2] = (HEAP32[$160 >> 2] | 0) + 1; + $164 = $4 + 1310736 + ($158 + -6 << 2) | 0; + HEAP32[$164 >> 2] = (HEAP32[$164 >> 2] | 0) + $$2387; + $168 = $4 + 1310736 + ($158 + -5 << 2) | 0; + HEAP32[$168 >> 2] = (HEAP32[$168 >> 2] | 0) + $$0382; + $172 = $4 + 1310736 + ($158 + -3 << 2) | 0; + if ((HEAP32[$172 >> 2] | 0) < ($$2387 | 0)) HEAP32[$172 >> 2] = $$2387; + HEAP32[$4 + 1310736 + ($158 + -1 << 2) >> 2] = $$0382; + $$2392 = $$1391; + break; + } + $178 = HEAP16[$$3 + -2 >> 1] | 0; + if ($178 << 16 >> 16 > 0) { + HEAP16[$$3 >> 1] = $178; + $181 = ($178 << 16 >> 16) * 7 | 0; + $183 = $4 + 1310736 + ($181 + -7 << 2) | 0; + HEAP32[$183 >> 2] = (HEAP32[$183 >> 2] | 0) + 1; + $187 = $4 + 1310736 + ($181 + -6 << 2) | 0; + HEAP32[$187 >> 2] = (HEAP32[$187 >> 2] | 0) + $$2387; + $191 = $4 + 1310736 + ($181 + -5 << 2) | 0; + HEAP32[$191 >> 2] = (HEAP32[$191 >> 2] | 0) + $$0382; + $195 = $4 + 1310736 + ($181 + -3 << 2) | 0; + if ((HEAP32[$195 >> 2] | 0) >= ($$2387 | 0)) { + $$2392 = $$1391; + break; + } + HEAP32[$195 >> 2] = $$2387; + $$2392 = $$1391; + break; + } else { + $198 = $$1391 + 1 | 0; + if (($$1391 | 0) > 32767) { + label = 54; + break L9; + } + HEAP16[$$3 >> 1] = $198; + HEAP32[$4 + 1179664 + ($$1391 << 2) >> 2] = $198 << 16 >> 16; + $203 = $$1391 * 7 | 0; + HEAP32[$4 + 1310736 + ($203 << 2) >> 2] = 1; + HEAP32[$4 + 1310736 + ($203 + 1 << 2) >> 2] = $$2387; + HEAP32[$4 + 1310736 + ($203 + 2 << 2) >> 2] = $$0382; + HEAP32[$4 + 1310736 + ($203 + 3 << 2) >> 2] = $$2387; + HEAP32[$4 + 1310736 + ($203 + 4 << 2) >> 2] = $$2387; + HEAP32[$4 + 1310736 + ($203 + 5 << 2) >> 2] = $$0382; + HEAP32[$4 + 1310736 + ($203 + 6 << 2) >> 2] = $$0382; + $$2392 = $198; + break; + } + } + if ($62) { + $65 = HEAP32[$4 + 1179664 + ($57 + -1 << 2) >> 2] | 0; + $68 = HEAP32[$4 + 1179664 + ($61 + -1 << 2) >> 2] | 0; + L36 : do if (($65 | 0) <= ($68 | 0)) { + HEAP16[$$3 >> 1] = $65; + if (($65 | 0) < ($68 | 0)) { + $$1375 = $21; + $$1379 = 0; + while (1) { + if (($$1379 | 0) >= ($$1391 | 0)) { + $83 = $65; + break L36; + } + if ((HEAP32[$$1375 >> 2] | 0) == ($68 | 0)) HEAP32[$$1375 >> 2] = $65; + $$1375 = $$1375 + 4 | 0; + $$1379 = $$1379 + 1 | 0; + } + } else $83 = $65; + } else { + HEAP16[$$3 >> 1] = $68; + $$0374 = $21; + $$0378 = 0; + while (1) { + if (($$0378 | 0) >= ($$1391 | 0)) { + $83 = $68; + break L36; + } + if ((HEAP32[$$0374 >> 2] | 0) == ($65 | 0)) HEAP32[$$0374 >> 2] = $68; + $$0374 = $$0374 + 4 | 0; + $$0378 = $$0378 + 1 | 0; + } + } while (0); + $85 = ($83 << 16 >> 16) * 7 | 0; + $87 = $4 + 1310736 + ($85 + -7 << 2) | 0; + HEAP32[$87 >> 2] = (HEAP32[$87 >> 2] | 0) + 1; + $91 = $4 + 1310736 + ($85 + -6 << 2) | 0; + HEAP32[$91 >> 2] = (HEAP32[$91 >> 2] | 0) + $$2387; + $95 = $4 + 1310736 + ($85 + -5 << 2) | 0; + HEAP32[$95 >> 2] = (HEAP32[$95 >> 2] | 0) + $$0382; + HEAP32[$4 + 1310736 + ($85 + -1 << 2) >> 2] = $$0382; + $$2392 = $$1391; + break; + } + $101 = HEAP16[$$3 + -2 >> 1] | 0; + if ($101 << 16 >> 16 <= 0) { + HEAP16[$$3 >> 1] = $56; + $139 = $57 * 7 | 0; + $141 = $4 + 1310736 + ($139 + -7 << 2) | 0; + HEAP32[$141 >> 2] = (HEAP32[$141 >> 2] | 0) + 1; + $145 = $4 + 1310736 + ($139 + -6 << 2) | 0; + HEAP32[$145 >> 2] = (HEAP32[$145 >> 2] | 0) + $$2387; + $149 = $4 + 1310736 + ($139 + -5 << 2) | 0; + HEAP32[$149 >> 2] = (HEAP32[$149 >> 2] | 0) + $$0382; + $153 = $4 + 1310736 + ($139 + -4 << 2) | 0; + if ((HEAP32[$153 >> 2] | 0) > ($$2387 | 0)) HEAP32[$153 >> 2] = $$2387; + HEAP32[$4 + 1310736 + ($139 + -1 << 2) >> 2] = $$0382; + $$2392 = $$1391; + break; + } + $106 = HEAP32[$4 + 1179664 + ($57 + -1 << 2) >> 2] | 0; + $109 = HEAP32[$4 + 1179664 + (($101 << 16 >> 16) + -1 << 2) >> 2] | 0; + L60 : do if (($106 | 0) <= ($109 | 0)) { + HEAP16[$$3 >> 1] = $106; + if (($106 | 0) < ($109 | 0)) { + $$3377 = $21; + $$3381 = 0; + while (1) { + if (($$3381 | 0) >= ($$1391 | 0)) { + $124 = $106; + break L60; + } + if ((HEAP32[$$3377 >> 2] | 0) == ($109 | 0)) HEAP32[$$3377 >> 2] = $106; + $$3377 = $$3377 + 4 | 0; + $$3381 = $$3381 + 1 | 0; + } + } else $124 = $106; + } else { + HEAP16[$$3 >> 1] = $109; + $$2376 = $21; + $$2380 = 0; + while (1) { + if (($$2380 | 0) >= ($$1391 | 0)) { + $124 = $109; + break L60; + } + if ((HEAP32[$$2376 >> 2] | 0) == ($106 | 0)) HEAP32[$$2376 >> 2] = $109; + $$2376 = $$2376 + 4 | 0; + $$2380 = $$2380 + 1 | 0; + } + } while (0); + $126 = ($124 << 16 >> 16) * 7 | 0; + $128 = $4 + 1310736 + ($126 + -7 << 2) | 0; + HEAP32[$128 >> 2] = (HEAP32[$128 >> 2] | 0) + 1; + $132 = $4 + 1310736 + ($126 + -6 << 2) | 0; + HEAP32[$132 >> 2] = (HEAP32[$132 >> 2] | 0) + $$2387; + $136 = $4 + 1310736 + ($126 + -5 << 2) | 0; + HEAP32[$136 >> 2] = (HEAP32[$136 >> 2] | 0) + $$0382; + $$2392 = $$1391; + } else { + HEAP16[$$3 >> 1] = 0; + HEAP8[$$1394 >> 0] = 0; + $$2392 = $$1391; + } while (0); + $$1 = $$1 + 2 | 0; + $$1391 = $$2392; + $$1394 = $$1394 + 1 | 0; + $$2387 = $$2387 + 1 | 0; + $$3 = $$3 + 2 | 0; + } + $$0369 = $$1 + $1 + 4 | 0; + $$0382 = $$0382 + 1 | 0; + $$0390 = $$1391; + $$0393 = $$1394 + 2 | 0; + $$2 = $$3 + 4 | 0; + } + L80 : do if ((label | 0) == 54) { + _arLog(0, 3, 23780, $vararg_buffer); + $$0 = -1; + } else if ((label | 0) == 59) { + $226 = $4 + 12 | 0; + $$1383 = 1; + $$3388 = 1; + $$4 = $21; + while (1) { + if (($$3388 | 0) > ($$0390 | 0)) break; + $228 = HEAP32[$$4 >> 2] | 0; + if (($228 | 0) == ($$3388 | 0)) { + $$2384 = $$1383 + 1 | 0; + $234 = $$1383; + } else { + $$2384 = $$1383; + $234 = HEAP32[$4 + 1179664 + ($228 + -1 << 2) >> 2] | 0; + } + HEAP32[$$4 >> 2] = $234; + $$1383 = $$2384; + $$3388 = $$3388 + 1 | 0; + $$4 = $$4 + 4 | 0; + } + $237 = $4 + 8 | 0; + $238 = $$1383 + -1 | 0; + HEAP32[$237 >> 2] = $238; + if (!$238) $$0 = 0; else { + _memset($226 | 0, 0, $238 << 2 | 0) | 0; + _memset($4 + 655376 | 0, 0, $238 << 4 | 0) | 0; + $$4389 = 0; + while (1) { + if (($$4389 | 0) >= ($238 | 0)) break; + $244 = $$4389 << 2; + HEAP32[$4 + 131084 + ($244 << 2) >> 2] = $5; + HEAP32[$4 + 131084 + (($244 | 1) << 2) >> 2] = 0; + HEAP32[$4 + 131084 + (($244 | 2) << 2) >> 2] = $6; + HEAP32[$4 + 131084 + (($244 | 3) << 2) >> 2] = 0; + $$4389 = $$4389 + 1 | 0; + } + $$5 = 0; + while (1) { + if (($$5 | 0) >= ($$0390 | 0)) break; + $256 = (HEAP32[$4 + 1179664 + ($$5 << 2) >> 2] | 0) + -1 | 0; + $257 = $$5 * 7 | 0; + $260 = $4 + 12 + ($256 << 2) | 0; + HEAP32[$260 >> 2] = (HEAP32[$260 >> 2] | 0) + (HEAP32[$4 + 1310736 + ($257 << 2) >> 2] | 0); + $267 = $256 << 1; + $268 = $4 + 655376 + ($267 << 3) | 0; + HEAPF64[$268 >> 3] = +HEAPF64[$268 >> 3] + +(HEAP32[$4 + 1310736 + ($257 + 1 << 2) >> 2] | 0); + $276 = $4 + 655376 + (($267 | 1) << 3) | 0; + HEAPF64[$276 >> 3] = +HEAPF64[$276 >> 3] + +(HEAP32[$4 + 1310736 + ($257 + 2 << 2) >> 2] | 0); + $279 = $256 << 2; + $280 = $4 + 131084 + ($279 << 2) | 0; + $284 = HEAP32[$4 + 1310736 + ($257 + 3 << 2) >> 2] | 0; + if ((HEAP32[$280 >> 2] | 0) > ($284 | 0)) HEAP32[$280 >> 2] = $284; + $287 = $4 + 131084 + (($279 | 1) << 2) | 0; + $291 = HEAP32[$4 + 1310736 + ($257 + 4 << 2) >> 2] | 0; + if ((HEAP32[$287 >> 2] | 0) < ($291 | 0)) HEAP32[$287 >> 2] = $291; + $294 = $4 + 131084 + (($279 | 2) << 2) | 0; + $298 = HEAP32[$4 + 1310736 + ($257 + 5 << 2) >> 2] | 0; + if ((HEAP32[$294 >> 2] | 0) > ($298 | 0)) HEAP32[$294 >> 2] = $298; + $301 = $4 + 131084 + (($279 | 3) << 2) | 0; + $305 = HEAP32[$4 + 1310736 + ($257 + 6 << 2) >> 2] | 0; + if ((HEAP32[$301 >> 2] | 0) < ($305 | 0)) HEAP32[$301 >> 2] = $305; + $$5 = $$5 + 1 | 0; + } + $308 = HEAP32[$237 >> 2] | 0; + $$6 = 0; + while (1) { + if (($$6 | 0) >= ($308 | 0)) { + $$0 = 0; + break L80; + } + $312 = +(HEAP32[$4 + 12 + ($$6 << 2) >> 2] | 0); + $313 = $$6 << 1; + $314 = $4 + 655376 + ($313 << 3) | 0; + HEAPF64[$314 >> 3] = +HEAPF64[$314 >> 3] / $312; + $318 = $4 + 655376 + (($313 | 1) << 3) | 0; + HEAPF64[$318 >> 3] = +HEAPF64[$318 >> 3] / $312; + $$6 = $$6 + 1 | 0; + } + } + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function _arLabelingSubEBIC($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0369 = 0, $$0370 = 0, $$0372 = 0, $$0374 = 0, $$0378 = 0, $$0382 = 0, $$0385 = 0, $$0390 = 0, $$0393 = 0, $$1 = 0, $$1371 = 0, $$1373 = 0, $$1375 = 0, $$1379 = 0, $$1383 = 0, $$1386 = 0, $$1391 = 0, $$1394 = 0, $$2 = 0, $$2376 = 0, $$2380 = 0, $$2384 = 0, $$2387 = 0, $$2392 = 0, $$3 = 0, $$3377 = 0, $$3381 = 0, $$3388 = 0, $$4 = 0, $$4389 = 0, $$5 = 0, $$6 = 0, $101 = 0, $106 = 0, $109 = 0, $124 = 0, $126 = 0, $128 = 0, $132 = 0, $136 = 0, $139 = 0, $141 = 0, $145 = 0, $149 = 0, $15 = 0, $153 = 0, $158 = 0, $160 = 0, $164 = 0, $168 = 0, $172 = 0, $178 = 0, $181 = 0, $183 = 0, $187 = 0, $191 = 0, $195 = 0, $198 = 0, $203 = 0, $21 = 0, $22 = 0, $226 = 0, $228 = 0, $234 = 0, $237 = 0, $238 = 0, $244 = 0, $256 = 0, $257 = 0, $260 = 0, $267 = 0, $268 = 0, $276 = 0, $279 = 0, $280 = 0, $284 = 0, $287 = 0, $291 = 0, $294 = 0, $298 = 0, $30 = 0, $301 = 0, $305 = 0, $308 = 0, $312 = 0.0, $313 = 0, $314 = 0, $318 = 0, $36 = 0, $37 = 0, $40 = 0, $42 = 0, $46 = 0, $5 = 0, $50 = 0, $56 = 0, $57 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $65 = 0, $68 = 0, $7 = 0, $8 = 0, $83 = 0, $85 = 0, $87 = 0, $91 = 0, $95 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $5 = ($1 | 0) / 2 | 0; + $6 = ($2 | 0) / 2 | 0; + $7 = HEAP32[$4 >> 2] | 0; + $8 = $6 + -1 | 0; + $$0370 = $7; + $$0372 = $7 + ((Math_imul($8, $5) | 0) << 1) | 0; + $$0385 = 0; + while (1) { + if (($$0385 | 0) >= ($5 | 0)) break; + HEAP16[$$0372 >> 1] = 0; + HEAP16[$$0370 >> 1] = 0; + $$0370 = $$0370 + 2 | 0; + $$0372 = $$0372 + 2 | 0; + $$0385 = $$0385 + 1 | 0; + } + $15 = $5 + -1 | 0; + $$1371 = $7; + $$1373 = $7 + ($15 << 1) | 0; + $$1386 = 0; + while (1) { + if (($$1386 | 0) >= ($6 | 0)) break; + HEAP16[$$1373 >> 1] = 0; + HEAP16[$$1371 >> 1] = 0; + $$1371 = $$1371 + ($5 << 1) | 0; + $$1373 = $$1373 + ($5 << 1) | 0; + $$1386 = $$1386 + 1 | 0; + } + $21 = $4 + 1179664 | 0; + $22 = $5 + 1 | 0; + $30 = 0 - $5 | 0; + $$0369 = $0 + (($1 << 1) + 2) | 0; + $$0382 = 1; + $$0390 = 0; + $$0393 = (HEAP32[$4 + 4 >> 2] | 0) + $22 | 0; + $$2 = $7 + ($22 << 1) | 0; + L9 : while (1) { + if (($$0382 | 0) >= ($8 | 0)) { + label = 59; + break; + } + $$1 = $$0369; + $$1391 = $$0390; + $$1394 = $$0393; + $$2387 = 1; + $$3 = $$2; + while (1) { + if (($$2387 | 0) >= ($15 | 0)) break; + do if ((HEAPU8[$$1 >> 0] | 0 | 0) > ($3 | 0)) { + HEAP16[$$3 >> 1] = 0; + HEAP8[$$1394 >> 0] = 0; + $$2392 = $$1391; + } else { + HEAP8[$$1394 >> 0] = -1; + $36 = $$3 + ($30 << 1) | 0; + $37 = HEAP16[$36 >> 1] | 0; + if ($37 << 16 >> 16 > 0) { + HEAP16[$$3 >> 1] = $37; + $40 = ($37 << 16 >> 16) * 7 | 0; + $42 = $4 + 1310736 + ($40 + -7 << 2) | 0; + HEAP32[$42 >> 2] = (HEAP32[$42 >> 2] | 0) + 1; + $46 = $4 + 1310736 + ($40 + -6 << 2) | 0; + HEAP32[$46 >> 2] = (HEAP32[$46 >> 2] | 0) + $$2387; + $50 = $4 + 1310736 + ($40 + -5 << 2) | 0; + HEAP32[$50 >> 2] = (HEAP32[$50 >> 2] | 0) + $$0382; + HEAP32[$4 + 1310736 + ($40 + -1 << 2) >> 2] = $$0382; + $$2392 = $$1391; + break; + } + $56 = HEAP16[$36 + 2 >> 1] | 0; + $57 = $56 << 16 >> 16; + $60 = HEAP16[$36 + -2 >> 1] | 0; + $61 = $60 << 16 >> 16; + $62 = $60 << 16 >> 16 > 0; + if ($56 << 16 >> 16 <= 0) { + if ($62) { + HEAP16[$$3 >> 1] = $60; + $158 = $61 * 7 | 0; + $160 = $4 + 1310736 + ($158 + -7 << 2) | 0; + HEAP32[$160 >> 2] = (HEAP32[$160 >> 2] | 0) + 1; + $164 = $4 + 1310736 + ($158 + -6 << 2) | 0; + HEAP32[$164 >> 2] = (HEAP32[$164 >> 2] | 0) + $$2387; + $168 = $4 + 1310736 + ($158 + -5 << 2) | 0; + HEAP32[$168 >> 2] = (HEAP32[$168 >> 2] | 0) + $$0382; + $172 = $4 + 1310736 + ($158 + -3 << 2) | 0; + if ((HEAP32[$172 >> 2] | 0) < ($$2387 | 0)) HEAP32[$172 >> 2] = $$2387; + HEAP32[$4 + 1310736 + ($158 + -1 << 2) >> 2] = $$0382; + $$2392 = $$1391; + break; + } + $178 = HEAP16[$$3 + -2 >> 1] | 0; + if ($178 << 16 >> 16 > 0) { + HEAP16[$$3 >> 1] = $178; + $181 = ($178 << 16 >> 16) * 7 | 0; + $183 = $4 + 1310736 + ($181 + -7 << 2) | 0; + HEAP32[$183 >> 2] = (HEAP32[$183 >> 2] | 0) + 1; + $187 = $4 + 1310736 + ($181 + -6 << 2) | 0; + HEAP32[$187 >> 2] = (HEAP32[$187 >> 2] | 0) + $$2387; + $191 = $4 + 1310736 + ($181 + -5 << 2) | 0; + HEAP32[$191 >> 2] = (HEAP32[$191 >> 2] | 0) + $$0382; + $195 = $4 + 1310736 + ($181 + -3 << 2) | 0; + if ((HEAP32[$195 >> 2] | 0) >= ($$2387 | 0)) { + $$2392 = $$1391; + break; + } + HEAP32[$195 >> 2] = $$2387; + $$2392 = $$1391; + break; + } else { + $198 = $$1391 + 1 | 0; + if (($$1391 | 0) > 32767) { + label = 54; + break L9; + } + HEAP16[$$3 >> 1] = $198; + HEAP32[$4 + 1179664 + ($$1391 << 2) >> 2] = $198 << 16 >> 16; + $203 = $$1391 * 7 | 0; + HEAP32[$4 + 1310736 + ($203 << 2) >> 2] = 1; + HEAP32[$4 + 1310736 + ($203 + 1 << 2) >> 2] = $$2387; + HEAP32[$4 + 1310736 + ($203 + 2 << 2) >> 2] = $$0382; + HEAP32[$4 + 1310736 + ($203 + 3 << 2) >> 2] = $$2387; + HEAP32[$4 + 1310736 + ($203 + 4 << 2) >> 2] = $$2387; + HEAP32[$4 + 1310736 + ($203 + 5 << 2) >> 2] = $$0382; + HEAP32[$4 + 1310736 + ($203 + 6 << 2) >> 2] = $$0382; + $$2392 = $198; + break; + } + } + if ($62) { + $65 = HEAP32[$4 + 1179664 + ($57 + -1 << 2) >> 2] | 0; + $68 = HEAP32[$4 + 1179664 + ($61 + -1 << 2) >> 2] | 0; + L37 : do if (($65 | 0) <= ($68 | 0)) { + HEAP16[$$3 >> 1] = $65; + if (($65 | 0) < ($68 | 0)) { + $$1375 = $21; + $$1379 = 0; + while (1) { + if (($$1379 | 0) >= ($$1391 | 0)) { + $83 = $65; + break L37; + } + if ((HEAP32[$$1375 >> 2] | 0) == ($68 | 0)) HEAP32[$$1375 >> 2] = $65; + $$1375 = $$1375 + 4 | 0; + $$1379 = $$1379 + 1 | 0; + } + } else $83 = $65; + } else { + HEAP16[$$3 >> 1] = $68; + $$0374 = $21; + $$0378 = 0; + while (1) { + if (($$0378 | 0) >= ($$1391 | 0)) { + $83 = $68; + break L37; + } + if ((HEAP32[$$0374 >> 2] | 0) == ($65 | 0)) HEAP32[$$0374 >> 2] = $68; + $$0374 = $$0374 + 4 | 0; + $$0378 = $$0378 + 1 | 0; + } + } while (0); + $85 = ($83 << 16 >> 16) * 7 | 0; + $87 = $4 + 1310736 + ($85 + -7 << 2) | 0; + HEAP32[$87 >> 2] = (HEAP32[$87 >> 2] | 0) + 1; + $91 = $4 + 1310736 + ($85 + -6 << 2) | 0; + HEAP32[$91 >> 2] = (HEAP32[$91 >> 2] | 0) + $$2387; + $95 = $4 + 1310736 + ($85 + -5 << 2) | 0; + HEAP32[$95 >> 2] = (HEAP32[$95 >> 2] | 0) + $$0382; + HEAP32[$4 + 1310736 + ($85 + -1 << 2) >> 2] = $$0382; + $$2392 = $$1391; + break; + } + $101 = HEAP16[$$3 + -2 >> 1] | 0; + if ($101 << 16 >> 16 <= 0) { + HEAP16[$$3 >> 1] = $56; + $139 = $57 * 7 | 0; + $141 = $4 + 1310736 + ($139 + -7 << 2) | 0; + HEAP32[$141 >> 2] = (HEAP32[$141 >> 2] | 0) + 1; + $145 = $4 + 1310736 + ($139 + -6 << 2) | 0; + HEAP32[$145 >> 2] = (HEAP32[$145 >> 2] | 0) + $$2387; + $149 = $4 + 1310736 + ($139 + -5 << 2) | 0; + HEAP32[$149 >> 2] = (HEAP32[$149 >> 2] | 0) + $$0382; + $153 = $4 + 1310736 + ($139 + -4 << 2) | 0; + if ((HEAP32[$153 >> 2] | 0) > ($$2387 | 0)) HEAP32[$153 >> 2] = $$2387; + HEAP32[$4 + 1310736 + ($139 + -1 << 2) >> 2] = $$0382; + $$2392 = $$1391; + break; + } + $106 = HEAP32[$4 + 1179664 + ($57 + -1 << 2) >> 2] | 0; + $109 = HEAP32[$4 + 1179664 + (($101 << 16 >> 16) + -1 << 2) >> 2] | 0; + L61 : do if (($106 | 0) <= ($109 | 0)) { + HEAP16[$$3 >> 1] = $106; + if (($106 | 0) < ($109 | 0)) { + $$3377 = $21; + $$3381 = 0; + while (1) { + if (($$3381 | 0) >= ($$1391 | 0)) { + $124 = $106; + break L61; + } + if ((HEAP32[$$3377 >> 2] | 0) == ($109 | 0)) HEAP32[$$3377 >> 2] = $106; + $$3377 = $$3377 + 4 | 0; + $$3381 = $$3381 + 1 | 0; + } + } else $124 = $106; + } else { + HEAP16[$$3 >> 1] = $109; + $$2376 = $21; + $$2380 = 0; + while (1) { + if (($$2380 | 0) >= ($$1391 | 0)) { + $124 = $109; + break L61; + } + if ((HEAP32[$$2376 >> 2] | 0) == ($106 | 0)) HEAP32[$$2376 >> 2] = $109; + $$2376 = $$2376 + 4 | 0; + $$2380 = $$2380 + 1 | 0; + } + } while (0); + $126 = ($124 << 16 >> 16) * 7 | 0; + $128 = $4 + 1310736 + ($126 + -7 << 2) | 0; + HEAP32[$128 >> 2] = (HEAP32[$128 >> 2] | 0) + 1; + $132 = $4 + 1310736 + ($126 + -6 << 2) | 0; + HEAP32[$132 >> 2] = (HEAP32[$132 >> 2] | 0) + $$2387; + $136 = $4 + 1310736 + ($126 + -5 << 2) | 0; + HEAP32[$136 >> 2] = (HEAP32[$136 >> 2] | 0) + $$0382; + $$2392 = $$1391; + } while (0); + $$1 = $$1 + 2 | 0; + $$1391 = $$2392; + $$1394 = $$1394 + 1 | 0; + $$2387 = $$2387 + 1 | 0; + $$3 = $$3 + 2 | 0; + } + $$0369 = $$1 + $1 + 4 | 0; + $$0382 = $$0382 + 1 | 0; + $$0390 = $$1391; + $$0393 = $$1394 + 2 | 0; + $$2 = $$3 + 4 | 0; + } + L80 : do if ((label | 0) == 54) { + _arLog(0, 3, 23780, $vararg_buffer); + $$0 = -1; + } else if ((label | 0) == 59) { + $226 = $4 + 12 | 0; + $$1383 = 1; + $$3388 = 1; + $$4 = $21; + while (1) { + if (($$3388 | 0) > ($$0390 | 0)) break; + $228 = HEAP32[$$4 >> 2] | 0; + if (($228 | 0) == ($$3388 | 0)) { + $$2384 = $$1383 + 1 | 0; + $234 = $$1383; + } else { + $$2384 = $$1383; + $234 = HEAP32[$4 + 1179664 + ($228 + -1 << 2) >> 2] | 0; + } + HEAP32[$$4 >> 2] = $234; + $$1383 = $$2384; + $$3388 = $$3388 + 1 | 0; + $$4 = $$4 + 4 | 0; + } + $237 = $4 + 8 | 0; + $238 = $$1383 + -1 | 0; + HEAP32[$237 >> 2] = $238; + if (!$238) $$0 = 0; else { + _memset($226 | 0, 0, $238 << 2 | 0) | 0; + _memset($4 + 655376 | 0, 0, $238 << 4 | 0) | 0; + $$4389 = 0; + while (1) { + if (($$4389 | 0) >= ($238 | 0)) break; + $244 = $$4389 << 2; + HEAP32[$4 + 131084 + ($244 << 2) >> 2] = $5; + HEAP32[$4 + 131084 + (($244 | 1) << 2) >> 2] = 0; + HEAP32[$4 + 131084 + (($244 | 2) << 2) >> 2] = $6; + HEAP32[$4 + 131084 + (($244 | 3) << 2) >> 2] = 0; + $$4389 = $$4389 + 1 | 0; + } + $$5 = 0; + while (1) { + if (($$5 | 0) >= ($$0390 | 0)) break; + $256 = (HEAP32[$4 + 1179664 + ($$5 << 2) >> 2] | 0) + -1 | 0; + $257 = $$5 * 7 | 0; + $260 = $4 + 12 + ($256 << 2) | 0; + HEAP32[$260 >> 2] = (HEAP32[$260 >> 2] | 0) + (HEAP32[$4 + 1310736 + ($257 << 2) >> 2] | 0); + $267 = $256 << 1; + $268 = $4 + 655376 + ($267 << 3) | 0; + HEAPF64[$268 >> 3] = +HEAPF64[$268 >> 3] + +(HEAP32[$4 + 1310736 + ($257 + 1 << 2) >> 2] | 0); + $276 = $4 + 655376 + (($267 | 1) << 3) | 0; + HEAPF64[$276 >> 3] = +HEAPF64[$276 >> 3] + +(HEAP32[$4 + 1310736 + ($257 + 2 << 2) >> 2] | 0); + $279 = $256 << 2; + $280 = $4 + 131084 + ($279 << 2) | 0; + $284 = HEAP32[$4 + 1310736 + ($257 + 3 << 2) >> 2] | 0; + if ((HEAP32[$280 >> 2] | 0) > ($284 | 0)) HEAP32[$280 >> 2] = $284; + $287 = $4 + 131084 + (($279 | 1) << 2) | 0; + $291 = HEAP32[$4 + 1310736 + ($257 + 4 << 2) >> 2] | 0; + if ((HEAP32[$287 >> 2] | 0) < ($291 | 0)) HEAP32[$287 >> 2] = $291; + $294 = $4 + 131084 + (($279 | 2) << 2) | 0; + $298 = HEAP32[$4 + 1310736 + ($257 + 5 << 2) >> 2] | 0; + if ((HEAP32[$294 >> 2] | 0) > ($298 | 0)) HEAP32[$294 >> 2] = $298; + $301 = $4 + 131084 + (($279 | 3) << 2) | 0; + $305 = HEAP32[$4 + 1310736 + ($257 + 6 << 2) >> 2] | 0; + if ((HEAP32[$301 >> 2] | 0) < ($305 | 0)) HEAP32[$301 >> 2] = $305; + $$5 = $$5 + 1 | 0; + } + $308 = HEAP32[$237 >> 2] | 0; + $$6 = 0; + while (1) { + if (($$6 | 0) >= ($308 | 0)) { + $$0 = 0; + break L80; + } + $312 = +(HEAP32[$4 + 12 + ($$6 << 2) >> 2] | 0); + $313 = $$6 << 1; + $314 = $4 + 655376 + ($313 << 3) | 0; + HEAPF64[$314 >> 3] = +HEAPF64[$314 >> 3] / $312; + $318 = $4 + 655376 + (($313 | 1) << 3) | 0; + HEAPF64[$318 >> 3] = +HEAPF64[$318 >> 3] / $312; + $$6 = $$6 + 1 | 0; + } + } + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN6vision21HoughSimilarityVoting4voteEffff($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + $3 = +$3; + $4 = +$4; + var $$0 = 0, $10 = 0.0, $102 = 0, $106 = 0, $113 = 0, $118 = 0, $122 = 0, $129 = 0, $13 = 0.0, $134 = 0, $138 = 0, $145 = 0, $150 = 0, $154 = 0, $155 = 0, $156 = 0, $157 = 0, $158 = 0, $16 = 0.0, $162 = 0, $166 = 0, $170 = 0, $174 = 0, $176 = 0, $178 = 0, $18 = 0.0, $180 = 0, $185 = 0, $190 = 0, $195 = 0, $22 = 0.0, $25 = 0.0, $33 = 0, $38 = 0, $42 = 0, $49 = 0, $5 = 0, $54 = 0, $58 = 0, $65 = 0, $7 = 0.0, $70 = 0, $74 = 0, $81 = 0, $86 = 0, $90 = 0, $97 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $5 = sp; + $7 = +HEAPF32[$0 + 20 >> 2]; + if ((((((!($7 > $1) ? ($10 = +HEAPF32[$0 + 24 >> 2], !($10 <= $1)) : 0) ? ($13 = +HEAPF32[$0 + 28 >> 2], !($13 > $2)) : 0) ? ($16 = +HEAPF32[$0 + 32 >> 2], !($16 <= $2)) : 0) ? ($18 = $3, !($18 <= -3.141592653589793 | $18 > 3.141592653589793)) : 0) ? ($22 = +HEAPF32[$0 + 36 >> 2], !($22 > $4)) : 0) ? ($25 = +HEAPF32[$0 + 40 >> 2], !($25 <= $4)) : 0) { + if (!($7 <= $1)) { + $33 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36193) | 0, 36227) | 0, 39072) | 0, 360) | 0, 39079) | 0, 36314) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $33 + (HEAP32[(HEAP32[$33 >> 2] | 0) + -12 >> 2] | 0) | 0); + $38 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $42 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$38 >> 2] | 0) + 28 >> 2] & 127]($38, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($33, $42) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($33) | 0; + _abort(); + } + if (!($10 > $1)) { + $49 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36329) | 0, 36227) | 0, 39072) | 0, 361) | 0, 39079) | 0, 36314) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $49 + (HEAP32[(HEAP32[$49 >> 2] | 0) + -12 >> 2] | 0) | 0); + $54 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $58 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$54 >> 2] | 0) + 28 >> 2] & 127]($54, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($49, $58) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($49) | 0; + _abort(); + } + if (!($13 <= $2)) { + $65 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36362) | 0, 36227) | 0, 39072) | 0, 362) | 0, 39079) | 0, 36396) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $65 + (HEAP32[(HEAP32[$65 >> 2] | 0) + -12 >> 2] | 0) | 0); + $70 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $74 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$70 >> 2] | 0) + 28 >> 2] & 127]($70, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($65, $74) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($65) | 0; + _abort(); + } + if (!($16 > $2)) { + $81 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36411) | 0, 36227) | 0, 39072) | 0, 363) | 0, 39079) | 0, 36396) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $81 + (HEAP32[(HEAP32[$81 >> 2] | 0) + -12 >> 2] | 0) | 0); + $86 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $90 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$86 >> 2] | 0) + 28 >> 2] & 127]($86, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($81, $90) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($81) | 0; + _abort(); + } + if (!($18 > -3.141592653589793)) { + $97 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36444) | 0, 36227) | 0, 39072) | 0, 364) | 0, 39079) | 0, 36479) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $97 + (HEAP32[(HEAP32[$97 >> 2] | 0) + -12 >> 2] | 0) | 0); + $102 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $106 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$102 >> 2] | 0) + 28 >> 2] & 127]($102, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($97, $106) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($97) | 0; + _abort(); + } + if (!($18 <= 3.141592653589793)) { + $113 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36498) | 0, 36227) | 0, 39072) | 0, 365) | 0, 39079) | 0, 36479) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $113 + (HEAP32[(HEAP32[$113 >> 2] | 0) + -12 >> 2] | 0) | 0); + $118 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $122 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$118 >> 2] | 0) + 28 >> 2] & 127]($118, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($113, $122) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($113) | 0; + _abort(); + } + if (!($22 <= $4)) { + $129 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36533) | 0, 36227) | 0, 39072) | 0, 366) | 0, 39079) | 0, 36575) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $129 + (HEAP32[(HEAP32[$129 >> 2] | 0) + -12 >> 2] | 0) | 0); + $134 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $138 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$134 >> 2] | 0) + 28 >> 2] & 127]($134, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($129, $138) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($129) | 0; + _abort(); + } + if (!($25 > $4)) { + $145 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36594) | 0, 36227) | 0, 39072) | 0, 367) | 0, 39079) | 0, 36575) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $145 + (HEAP32[(HEAP32[$145 >> 2] | 0) + -12 >> 2] | 0) | 0); + $150 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $154 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$150 >> 2] | 0) + 28 >> 2] & 127]($150, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($145, $154) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($145) | 0; + _abort(); + } + $155 = $0 + 68 | 0; + $156 = $0 + 72 | 0; + $157 = $0 + 76 | 0; + $158 = $0 + 80 | 0; + __ZNK6vision21HoughSimilarityVoting12mapVoteToBinERfS1_S1_S1_ffff($0, $155, $156, $157, $158, $1, $2, $3, $4); + $162 = ~~+Math_floor(+(+HEAPF32[$155 >> 2] + -.5)); + $166 = ~~+Math_floor(+(+HEAPF32[$156 >> 2] + -.5)); + $170 = ~~+Math_floor(+(+HEAPF32[$157 >> 2] + -.5)); + $174 = ~~+Math_floor(+(+HEAPF32[$158 >> 2] + -.5)); + $176 = HEAP32[$0 + 60 >> 2] | 0; + $178 = ($176 + $170 | 0) % ($176 | 0) | 0; + if (((($162 | 0) >= 0 ? ($180 = $162 + 1 | 0, !(($166 | 0) < 0 ? 1 : ($180 | 0) >= (HEAP32[$0 + 52 >> 2] | 0))) : 0) ? ($185 = $166 + 1 | 0, !(($174 | 0) < 0 ? 1 : ($185 | 0) >= (HEAP32[$0 + 56 >> 2] | 0))) : 0) ? ($190 = $174 + 1 | 0, ($190 | 0) < (HEAP32[$0 + 64 >> 2] | 0)) : 0) { + $195 = ($178 + 1 | 0) % ($176 | 0) | 0; + __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $162, $166, $178, $174) | 0, 1); + __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $180, $166, $178, $174) | 0, 1); + __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $180, $185, $178, $174) | 0, 1); + __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $180, $185, $195, $174) | 0, 1); + __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $180, $185, $195, $190) | 0, 1); + __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $180, $185, $178, $190) | 0, 1); + __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $180, $166, $195, $174) | 0, 1); + __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $180, $166, $195, $190) | 0, 1); + __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $180, $166, $178, $190) | 0, 1); + __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $162, $185, $178, $174) | 0, 1); + __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $162, $185, $195, $174) | 0, 1); + __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $162, $185, $195, $190) | 0, 1); + __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $162, $185, $178, $190) | 0, 1); + __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $162, $166, $195, $174) | 0, 1); + __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $162, $166, $195, $190) | 0, 1); + __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $162, $166, $178, $190) | 0, 1); + $$0 = 1; + } else $$0 = 0; + } else $$0 = 0; + STACKTOP = sp; + return $$0 | 0; +} + +function _arLabelingSubEWRC($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0367 = 0, $$0368 = 0, $$0370 = 0, $$0372 = 0, $$0376 = 0, $$0380 = 0, $$0383 = 0, $$0388 = 0, $$0391 = 0, $$1 = 0, $$1369 = 0, $$1371 = 0, $$1373 = 0, $$1377 = 0, $$1381 = 0, $$1384 = 0, $$1389 = 0, $$1392 = 0, $$2 = 0, $$2374 = 0, $$2378 = 0, $$2382 = 0, $$2385 = 0, $$2390 = 0, $$3 = 0, $$3375 = 0, $$3379 = 0, $$3386 = 0, $$4 = 0, $$4387 = 0, $$5 = 0, $$6 = 0, $102 = 0, $105 = 0, $120 = 0, $122 = 0, $124 = 0, $128 = 0, $13 = 0, $132 = 0, $135 = 0, $137 = 0, $141 = 0, $145 = 0, $149 = 0, $154 = 0, $156 = 0, $160 = 0, $164 = 0, $168 = 0, $174 = 0, $177 = 0, $179 = 0, $183 = 0, $187 = 0, $19 = 0, $191 = 0, $194 = 0, $199 = 0, $20 = 0, $221 = 0, $223 = 0, $229 = 0, $232 = 0, $233 = 0, $239 = 0, $251 = 0, $252 = 0, $255 = 0, $26 = 0, $262 = 0, $263 = 0, $271 = 0, $274 = 0, $275 = 0, $279 = 0, $282 = 0, $286 = 0, $289 = 0, $293 = 0, $296 = 0, $300 = 0, $303 = 0, $307 = 0.0, $308 = 0, $309 = 0, $313 = 0, $32 = 0, $33 = 0, $36 = 0, $38 = 0, $42 = 0, $46 = 0, $5 = 0, $52 = 0, $53 = 0, $56 = 0, $57 = 0, $58 = 0, $6 = 0, $61 = 0, $64 = 0, $79 = 0, $81 = 0, $83 = 0, $87 = 0, $91 = 0, $97 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $5 = HEAP32[$4 >> 2] | 0; + $6 = $2 + -1 | 0; + $$0368 = $5; + $$0370 = $5 + ((Math_imul($6, $1) | 0) << 1) | 0; + $$0383 = 0; + while (1) { + if (($$0383 | 0) >= ($1 | 0)) break; + HEAP16[$$0370 >> 1] = 0; + HEAP16[$$0368 >> 1] = 0; + $$0368 = $$0368 + 2 | 0; + $$0370 = $$0370 + 2 | 0; + $$0383 = $$0383 + 1 | 0; + } + $13 = $1 + -1 | 0; + $$1369 = $5; + $$1371 = $5 + ($13 << 1) | 0; + $$1384 = 0; + while (1) { + if (($$1384 | 0) >= ($2 | 0)) break; + HEAP16[$$1371 >> 1] = 0; + HEAP16[$$1369 >> 1] = 0; + $$1369 = $$1369 + ($1 << 1) | 0; + $$1371 = $$1371 + ($1 << 1) | 0; + $$1384 = $$1384 + 1 | 0; + } + $19 = $4 + 1179664 | 0; + $20 = $1 + 1 | 0; + $26 = 0 - $1 | 0; + $$0367 = $0 + $20 | 0; + $$0380 = 1; + $$0388 = 0; + $$0391 = (HEAP32[$4 + 4 >> 2] | 0) + $20 | 0; + $$2 = $5 + ($20 << 1) | 0; + L9 : while (1) { + if (($$0380 | 0) >= ($6 | 0)) { + label = 59; + break; + } + $$1 = $$0367; + $$1389 = $$0388; + $$1392 = $$0391; + $$2385 = 1; + $$3 = $$2; + while (1) { + if (($$2385 | 0) >= ($13 | 0)) break; + do if ((HEAPU8[$$1 >> 0] | 0 | 0) > ($3 | 0)) { + HEAP8[$$1392 >> 0] = -1; + $32 = $$3 + ($26 << 1) | 0; + $33 = HEAP16[$32 >> 1] | 0; + if ($33 << 16 >> 16 > 0) { + HEAP16[$$3 >> 1] = $33; + $36 = ($33 << 16 >> 16) * 7 | 0; + $38 = $4 + 1310736 + ($36 + -7 << 2) | 0; + HEAP32[$38 >> 2] = (HEAP32[$38 >> 2] | 0) + 1; + $42 = $4 + 1310736 + ($36 + -6 << 2) | 0; + HEAP32[$42 >> 2] = (HEAP32[$42 >> 2] | 0) + $$2385; + $46 = $4 + 1310736 + ($36 + -5 << 2) | 0; + HEAP32[$46 >> 2] = (HEAP32[$46 >> 2] | 0) + $$0380; + HEAP32[$4 + 1310736 + ($36 + -1 << 2) >> 2] = $$0380; + $$2390 = $$1389; + break; + } + $52 = HEAP16[$32 + 2 >> 1] | 0; + $53 = $52 << 16 >> 16; + $56 = HEAP16[$32 + -2 >> 1] | 0; + $57 = $56 << 16 >> 16; + $58 = $56 << 16 >> 16 > 0; + if ($52 << 16 >> 16 <= 0) { + if ($58) { + HEAP16[$$3 >> 1] = $56; + $154 = $57 * 7 | 0; + $156 = $4 + 1310736 + ($154 + -7 << 2) | 0; + HEAP32[$156 >> 2] = (HEAP32[$156 >> 2] | 0) + 1; + $160 = $4 + 1310736 + ($154 + -6 << 2) | 0; + HEAP32[$160 >> 2] = (HEAP32[$160 >> 2] | 0) + $$2385; + $164 = $4 + 1310736 + ($154 + -5 << 2) | 0; + HEAP32[$164 >> 2] = (HEAP32[$164 >> 2] | 0) + $$0380; + $168 = $4 + 1310736 + ($154 + -3 << 2) | 0; + if ((HEAP32[$168 >> 2] | 0) < ($$2385 | 0)) HEAP32[$168 >> 2] = $$2385; + HEAP32[$4 + 1310736 + ($154 + -1 << 2) >> 2] = $$0380; + $$2390 = $$1389; + break; + } + $174 = HEAP16[$$3 + -2 >> 1] | 0; + if ($174 << 16 >> 16 > 0) { + HEAP16[$$3 >> 1] = $174; + $177 = ($174 << 16 >> 16) * 7 | 0; + $179 = $4 + 1310736 + ($177 + -7 << 2) | 0; + HEAP32[$179 >> 2] = (HEAP32[$179 >> 2] | 0) + 1; + $183 = $4 + 1310736 + ($177 + -6 << 2) | 0; + HEAP32[$183 >> 2] = (HEAP32[$183 >> 2] | 0) + $$2385; + $187 = $4 + 1310736 + ($177 + -5 << 2) | 0; + HEAP32[$187 >> 2] = (HEAP32[$187 >> 2] | 0) + $$0380; + $191 = $4 + 1310736 + ($177 + -3 << 2) | 0; + if ((HEAP32[$191 >> 2] | 0) >= ($$2385 | 0)) { + $$2390 = $$1389; + break; + } + HEAP32[$191 >> 2] = $$2385; + $$2390 = $$1389; + break; + } else { + $194 = $$1389 + 1 | 0; + if (($$1389 | 0) > 32767) { + label = 54; + break L9; + } + HEAP16[$$3 >> 1] = $194; + HEAP32[$4 + 1179664 + ($$1389 << 2) >> 2] = $194 << 16 >> 16; + $199 = $$1389 * 7 | 0; + HEAP32[$4 + 1310736 + ($199 << 2) >> 2] = 1; + HEAP32[$4 + 1310736 + ($199 + 1 << 2) >> 2] = $$2385; + HEAP32[$4 + 1310736 + ($199 + 2 << 2) >> 2] = $$0380; + HEAP32[$4 + 1310736 + ($199 + 3 << 2) >> 2] = $$2385; + HEAP32[$4 + 1310736 + ($199 + 4 << 2) >> 2] = $$2385; + HEAP32[$4 + 1310736 + ($199 + 5 << 2) >> 2] = $$0380; + HEAP32[$4 + 1310736 + ($199 + 6 << 2) >> 2] = $$0380; + $$2390 = $194; + break; + } + } + if ($58) { + $61 = HEAP32[$4 + 1179664 + ($53 + -1 << 2) >> 2] | 0; + $64 = HEAP32[$4 + 1179664 + ($57 + -1 << 2) >> 2] | 0; + L36 : do if (($61 | 0) <= ($64 | 0)) { + HEAP16[$$3 >> 1] = $61; + if (($61 | 0) < ($64 | 0)) { + $$1373 = $19; + $$1377 = 0; + while (1) { + if (($$1377 | 0) >= ($$1389 | 0)) { + $79 = $61; + break L36; + } + if ((HEAP32[$$1373 >> 2] | 0) == ($64 | 0)) HEAP32[$$1373 >> 2] = $61; + $$1373 = $$1373 + 4 | 0; + $$1377 = $$1377 + 1 | 0; + } + } else $79 = $61; + } else { + HEAP16[$$3 >> 1] = $64; + $$0372 = $19; + $$0376 = 0; + while (1) { + if (($$0376 | 0) >= ($$1389 | 0)) { + $79 = $64; + break L36; + } + if ((HEAP32[$$0372 >> 2] | 0) == ($61 | 0)) HEAP32[$$0372 >> 2] = $64; + $$0372 = $$0372 + 4 | 0; + $$0376 = $$0376 + 1 | 0; + } + } while (0); + $81 = ($79 << 16 >> 16) * 7 | 0; + $83 = $4 + 1310736 + ($81 + -7 << 2) | 0; + HEAP32[$83 >> 2] = (HEAP32[$83 >> 2] | 0) + 1; + $87 = $4 + 1310736 + ($81 + -6 << 2) | 0; + HEAP32[$87 >> 2] = (HEAP32[$87 >> 2] | 0) + $$2385; + $91 = $4 + 1310736 + ($81 + -5 << 2) | 0; + HEAP32[$91 >> 2] = (HEAP32[$91 >> 2] | 0) + $$0380; + HEAP32[$4 + 1310736 + ($81 + -1 << 2) >> 2] = $$0380; + $$2390 = $$1389; + break; + } + $97 = HEAP16[$$3 + -2 >> 1] | 0; + if ($97 << 16 >> 16 <= 0) { + HEAP16[$$3 >> 1] = $52; + $135 = $53 * 7 | 0; + $137 = $4 + 1310736 + ($135 + -7 << 2) | 0; + HEAP32[$137 >> 2] = (HEAP32[$137 >> 2] | 0) + 1; + $141 = $4 + 1310736 + ($135 + -6 << 2) | 0; + HEAP32[$141 >> 2] = (HEAP32[$141 >> 2] | 0) + $$2385; + $145 = $4 + 1310736 + ($135 + -5 << 2) | 0; + HEAP32[$145 >> 2] = (HEAP32[$145 >> 2] | 0) + $$0380; + $149 = $4 + 1310736 + ($135 + -4 << 2) | 0; + if ((HEAP32[$149 >> 2] | 0) > ($$2385 | 0)) HEAP32[$149 >> 2] = $$2385; + HEAP32[$4 + 1310736 + ($135 + -1 << 2) >> 2] = $$0380; + $$2390 = $$1389; + break; + } + $102 = HEAP32[$4 + 1179664 + ($53 + -1 << 2) >> 2] | 0; + $105 = HEAP32[$4 + 1179664 + (($97 << 16 >> 16) + -1 << 2) >> 2] | 0; + L60 : do if (($102 | 0) <= ($105 | 0)) { + HEAP16[$$3 >> 1] = $102; + if (($102 | 0) < ($105 | 0)) { + $$3375 = $19; + $$3379 = 0; + while (1) { + if (($$3379 | 0) >= ($$1389 | 0)) { + $120 = $102; + break L60; + } + if ((HEAP32[$$3375 >> 2] | 0) == ($105 | 0)) HEAP32[$$3375 >> 2] = $102; + $$3375 = $$3375 + 4 | 0; + $$3379 = $$3379 + 1 | 0; + } + } else $120 = $102; + } else { + HEAP16[$$3 >> 1] = $105; + $$2374 = $19; + $$2378 = 0; + while (1) { + if (($$2378 | 0) >= ($$1389 | 0)) { + $120 = $105; + break L60; + } + if ((HEAP32[$$2374 >> 2] | 0) == ($102 | 0)) HEAP32[$$2374 >> 2] = $105; + $$2374 = $$2374 + 4 | 0; + $$2378 = $$2378 + 1 | 0; + } + } while (0); + $122 = ($120 << 16 >> 16) * 7 | 0; + $124 = $4 + 1310736 + ($122 + -7 << 2) | 0; + HEAP32[$124 >> 2] = (HEAP32[$124 >> 2] | 0) + 1; + $128 = $4 + 1310736 + ($122 + -6 << 2) | 0; + HEAP32[$128 >> 2] = (HEAP32[$128 >> 2] | 0) + $$2385; + $132 = $4 + 1310736 + ($122 + -5 << 2) | 0; + HEAP32[$132 >> 2] = (HEAP32[$132 >> 2] | 0) + $$0380; + $$2390 = $$1389; + } else { + HEAP16[$$3 >> 1] = 0; + HEAP8[$$1392 >> 0] = 0; + $$2390 = $$1389; + } while (0); + $$1 = $$1 + 1 | 0; + $$1389 = $$2390; + $$1392 = $$1392 + 1 | 0; + $$2385 = $$2385 + 1 | 0; + $$3 = $$3 + 2 | 0; + } + $$0367 = $$1 + 2 | 0; + $$0380 = $$0380 + 1 | 0; + $$0388 = $$1389; + $$0391 = $$1392 + 2 | 0; + $$2 = $$3 + 4 | 0; + } + L80 : do if ((label | 0) == 54) { + _arLog(0, 3, 23780, $vararg_buffer); + $$0 = -1; + } else if ((label | 0) == 59) { + $221 = $4 + 12 | 0; + $$1381 = 1; + $$3386 = 1; + $$4 = $19; + while (1) { + if (($$3386 | 0) > ($$0388 | 0)) break; + $223 = HEAP32[$$4 >> 2] | 0; + if (($223 | 0) == ($$3386 | 0)) { + $$2382 = $$1381 + 1 | 0; + $229 = $$1381; + } else { + $$2382 = $$1381; + $229 = HEAP32[$4 + 1179664 + ($223 + -1 << 2) >> 2] | 0; + } + HEAP32[$$4 >> 2] = $229; + $$1381 = $$2382; + $$3386 = $$3386 + 1 | 0; + $$4 = $$4 + 4 | 0; + } + $232 = $4 + 8 | 0; + $233 = $$1381 + -1 | 0; + HEAP32[$232 >> 2] = $233; + if (!$233) $$0 = 0; else { + _memset($221 | 0, 0, $233 << 2 | 0) | 0; + _memset($4 + 655376 | 0, 0, $233 << 4 | 0) | 0; + $$4387 = 0; + while (1) { + if (($$4387 | 0) >= ($233 | 0)) break; + $239 = $$4387 << 2; + HEAP32[$4 + 131084 + ($239 << 2) >> 2] = $1; + HEAP32[$4 + 131084 + (($239 | 1) << 2) >> 2] = 0; + HEAP32[$4 + 131084 + (($239 | 2) << 2) >> 2] = $2; + HEAP32[$4 + 131084 + (($239 | 3) << 2) >> 2] = 0; + $$4387 = $$4387 + 1 | 0; + } + $$5 = 0; + while (1) { + if (($$5 | 0) >= ($$0388 | 0)) break; + $251 = (HEAP32[$4 + 1179664 + ($$5 << 2) >> 2] | 0) + -1 | 0; + $252 = $$5 * 7 | 0; + $255 = $4 + 12 + ($251 << 2) | 0; + HEAP32[$255 >> 2] = (HEAP32[$255 >> 2] | 0) + (HEAP32[$4 + 1310736 + ($252 << 2) >> 2] | 0); + $262 = $251 << 1; + $263 = $4 + 655376 + ($262 << 3) | 0; + HEAPF64[$263 >> 3] = +HEAPF64[$263 >> 3] + +(HEAP32[$4 + 1310736 + ($252 + 1 << 2) >> 2] | 0); + $271 = $4 + 655376 + (($262 | 1) << 3) | 0; + HEAPF64[$271 >> 3] = +HEAPF64[$271 >> 3] + +(HEAP32[$4 + 1310736 + ($252 + 2 << 2) >> 2] | 0); + $274 = $251 << 2; + $275 = $4 + 131084 + ($274 << 2) | 0; + $279 = HEAP32[$4 + 1310736 + ($252 + 3 << 2) >> 2] | 0; + if ((HEAP32[$275 >> 2] | 0) > ($279 | 0)) HEAP32[$275 >> 2] = $279; + $282 = $4 + 131084 + (($274 | 1) << 2) | 0; + $286 = HEAP32[$4 + 1310736 + ($252 + 4 << 2) >> 2] | 0; + if ((HEAP32[$282 >> 2] | 0) < ($286 | 0)) HEAP32[$282 >> 2] = $286; + $289 = $4 + 131084 + (($274 | 2) << 2) | 0; + $293 = HEAP32[$4 + 1310736 + ($252 + 5 << 2) >> 2] | 0; + if ((HEAP32[$289 >> 2] | 0) > ($293 | 0)) HEAP32[$289 >> 2] = $293; + $296 = $4 + 131084 + (($274 | 3) << 2) | 0; + $300 = HEAP32[$4 + 1310736 + ($252 + 6 << 2) >> 2] | 0; + if ((HEAP32[$296 >> 2] | 0) < ($300 | 0)) HEAP32[$296 >> 2] = $300; + $$5 = $$5 + 1 | 0; + } + $303 = HEAP32[$232 >> 2] | 0; + $$6 = 0; + while (1) { + if (($$6 | 0) >= ($303 | 0)) { + $$0 = 0; + break L80; + } + $307 = +(HEAP32[$4 + 12 + ($$6 << 2) >> 2] | 0); + $308 = $$6 << 1; + $309 = $4 + 655376 + ($308 << 3) | 0; + HEAPF64[$309 >> 3] = +HEAPF64[$309 >> 3] / $307; + $313 = $4 + 655376 + (($308 | 1) << 3) | 0; + HEAPF64[$313 >> 3] = +HEAPF64[$313 >> 3] / $307; + $$6 = $$6 + 1 | 0; + } + } + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function _arLabelingSubEBRC($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0367 = 0, $$0368 = 0, $$0370 = 0, $$0372 = 0, $$0376 = 0, $$0380 = 0, $$0383 = 0, $$0388 = 0, $$0391 = 0, $$1 = 0, $$1369 = 0, $$1371 = 0, $$1373 = 0, $$1377 = 0, $$1381 = 0, $$1384 = 0, $$1389 = 0, $$1392 = 0, $$2 = 0, $$2374 = 0, $$2378 = 0, $$2382 = 0, $$2385 = 0, $$2390 = 0, $$3 = 0, $$3375 = 0, $$3379 = 0, $$3386 = 0, $$4 = 0, $$4387 = 0, $$5 = 0, $$6 = 0, $102 = 0, $105 = 0, $120 = 0, $122 = 0, $124 = 0, $128 = 0, $13 = 0, $132 = 0, $135 = 0, $137 = 0, $141 = 0, $145 = 0, $149 = 0, $154 = 0, $156 = 0, $160 = 0, $164 = 0, $168 = 0, $174 = 0, $177 = 0, $179 = 0, $183 = 0, $187 = 0, $19 = 0, $191 = 0, $194 = 0, $199 = 0, $20 = 0, $221 = 0, $223 = 0, $229 = 0, $232 = 0, $233 = 0, $239 = 0, $251 = 0, $252 = 0, $255 = 0, $26 = 0, $262 = 0, $263 = 0, $271 = 0, $274 = 0, $275 = 0, $279 = 0, $282 = 0, $286 = 0, $289 = 0, $293 = 0, $296 = 0, $300 = 0, $303 = 0, $307 = 0.0, $308 = 0, $309 = 0, $313 = 0, $32 = 0, $33 = 0, $36 = 0, $38 = 0, $42 = 0, $46 = 0, $5 = 0, $52 = 0, $53 = 0, $56 = 0, $57 = 0, $58 = 0, $6 = 0, $61 = 0, $64 = 0, $79 = 0, $81 = 0, $83 = 0, $87 = 0, $91 = 0, $97 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $5 = HEAP32[$4 >> 2] | 0; + $6 = $2 + -1 | 0; + $$0368 = $5; + $$0370 = $5 + ((Math_imul($6, $1) | 0) << 1) | 0; + $$0383 = 0; + while (1) { + if (($$0383 | 0) >= ($1 | 0)) break; + HEAP16[$$0370 >> 1] = 0; + HEAP16[$$0368 >> 1] = 0; + $$0368 = $$0368 + 2 | 0; + $$0370 = $$0370 + 2 | 0; + $$0383 = $$0383 + 1 | 0; + } + $13 = $1 + -1 | 0; + $$1369 = $5; + $$1371 = $5 + ($13 << 1) | 0; + $$1384 = 0; + while (1) { + if (($$1384 | 0) >= ($2 | 0)) break; + HEAP16[$$1371 >> 1] = 0; + HEAP16[$$1369 >> 1] = 0; + $$1369 = $$1369 + ($1 << 1) | 0; + $$1371 = $$1371 + ($1 << 1) | 0; + $$1384 = $$1384 + 1 | 0; + } + $19 = $4 + 1179664 | 0; + $20 = $1 + 1 | 0; + $26 = 0 - $1 | 0; + $$0367 = $0 + $20 | 0; + $$0380 = 1; + $$0388 = 0; + $$0391 = (HEAP32[$4 + 4 >> 2] | 0) + $20 | 0; + $$2 = $5 + ($20 << 1) | 0; + L9 : while (1) { + if (($$0380 | 0) >= ($6 | 0)) { + label = 59; + break; + } + $$1 = $$0367; + $$1389 = $$0388; + $$1392 = $$0391; + $$2385 = 1; + $$3 = $$2; + while (1) { + if (($$2385 | 0) >= ($13 | 0)) break; + do if ((HEAPU8[$$1 >> 0] | 0 | 0) > ($3 | 0)) { + HEAP16[$$3 >> 1] = 0; + HEAP8[$$1392 >> 0] = 0; + $$2390 = $$1389; + } else { + HEAP8[$$1392 >> 0] = -1; + $32 = $$3 + ($26 << 1) | 0; + $33 = HEAP16[$32 >> 1] | 0; + if ($33 << 16 >> 16 > 0) { + HEAP16[$$3 >> 1] = $33; + $36 = ($33 << 16 >> 16) * 7 | 0; + $38 = $4 + 1310736 + ($36 + -7 << 2) | 0; + HEAP32[$38 >> 2] = (HEAP32[$38 >> 2] | 0) + 1; + $42 = $4 + 1310736 + ($36 + -6 << 2) | 0; + HEAP32[$42 >> 2] = (HEAP32[$42 >> 2] | 0) + $$2385; + $46 = $4 + 1310736 + ($36 + -5 << 2) | 0; + HEAP32[$46 >> 2] = (HEAP32[$46 >> 2] | 0) + $$0380; + HEAP32[$4 + 1310736 + ($36 + -1 << 2) >> 2] = $$0380; + $$2390 = $$1389; + break; + } + $52 = HEAP16[$32 + 2 >> 1] | 0; + $53 = $52 << 16 >> 16; + $56 = HEAP16[$32 + -2 >> 1] | 0; + $57 = $56 << 16 >> 16; + $58 = $56 << 16 >> 16 > 0; + if ($52 << 16 >> 16 <= 0) { + if ($58) { + HEAP16[$$3 >> 1] = $56; + $154 = $57 * 7 | 0; + $156 = $4 + 1310736 + ($154 + -7 << 2) | 0; + HEAP32[$156 >> 2] = (HEAP32[$156 >> 2] | 0) + 1; + $160 = $4 + 1310736 + ($154 + -6 << 2) | 0; + HEAP32[$160 >> 2] = (HEAP32[$160 >> 2] | 0) + $$2385; + $164 = $4 + 1310736 + ($154 + -5 << 2) | 0; + HEAP32[$164 >> 2] = (HEAP32[$164 >> 2] | 0) + $$0380; + $168 = $4 + 1310736 + ($154 + -3 << 2) | 0; + if ((HEAP32[$168 >> 2] | 0) < ($$2385 | 0)) HEAP32[$168 >> 2] = $$2385; + HEAP32[$4 + 1310736 + ($154 + -1 << 2) >> 2] = $$0380; + $$2390 = $$1389; + break; + } + $174 = HEAP16[$$3 + -2 >> 1] | 0; + if ($174 << 16 >> 16 > 0) { + HEAP16[$$3 >> 1] = $174; + $177 = ($174 << 16 >> 16) * 7 | 0; + $179 = $4 + 1310736 + ($177 + -7 << 2) | 0; + HEAP32[$179 >> 2] = (HEAP32[$179 >> 2] | 0) + 1; + $183 = $4 + 1310736 + ($177 + -6 << 2) | 0; + HEAP32[$183 >> 2] = (HEAP32[$183 >> 2] | 0) + $$2385; + $187 = $4 + 1310736 + ($177 + -5 << 2) | 0; + HEAP32[$187 >> 2] = (HEAP32[$187 >> 2] | 0) + $$0380; + $191 = $4 + 1310736 + ($177 + -3 << 2) | 0; + if ((HEAP32[$191 >> 2] | 0) >= ($$2385 | 0)) { + $$2390 = $$1389; + break; + } + HEAP32[$191 >> 2] = $$2385; + $$2390 = $$1389; + break; + } else { + $194 = $$1389 + 1 | 0; + if (($$1389 | 0) > 32767) { + label = 54; + break L9; + } + HEAP16[$$3 >> 1] = $194; + HEAP32[$4 + 1179664 + ($$1389 << 2) >> 2] = $194 << 16 >> 16; + $199 = $$1389 * 7 | 0; + HEAP32[$4 + 1310736 + ($199 << 2) >> 2] = 1; + HEAP32[$4 + 1310736 + ($199 + 1 << 2) >> 2] = $$2385; + HEAP32[$4 + 1310736 + ($199 + 2 << 2) >> 2] = $$0380; + HEAP32[$4 + 1310736 + ($199 + 3 << 2) >> 2] = $$2385; + HEAP32[$4 + 1310736 + ($199 + 4 << 2) >> 2] = $$2385; + HEAP32[$4 + 1310736 + ($199 + 5 << 2) >> 2] = $$0380; + HEAP32[$4 + 1310736 + ($199 + 6 << 2) >> 2] = $$0380; + $$2390 = $194; + break; + } + } + if ($58) { + $61 = HEAP32[$4 + 1179664 + ($53 + -1 << 2) >> 2] | 0; + $64 = HEAP32[$4 + 1179664 + ($57 + -1 << 2) >> 2] | 0; + L37 : do if (($61 | 0) <= ($64 | 0)) { + HEAP16[$$3 >> 1] = $61; + if (($61 | 0) < ($64 | 0)) { + $$1373 = $19; + $$1377 = 0; + while (1) { + if (($$1377 | 0) >= ($$1389 | 0)) { + $79 = $61; + break L37; + } + if ((HEAP32[$$1373 >> 2] | 0) == ($64 | 0)) HEAP32[$$1373 >> 2] = $61; + $$1373 = $$1373 + 4 | 0; + $$1377 = $$1377 + 1 | 0; + } + } else $79 = $61; + } else { + HEAP16[$$3 >> 1] = $64; + $$0372 = $19; + $$0376 = 0; + while (1) { + if (($$0376 | 0) >= ($$1389 | 0)) { + $79 = $64; + break L37; + } + if ((HEAP32[$$0372 >> 2] | 0) == ($61 | 0)) HEAP32[$$0372 >> 2] = $64; + $$0372 = $$0372 + 4 | 0; + $$0376 = $$0376 + 1 | 0; + } + } while (0); + $81 = ($79 << 16 >> 16) * 7 | 0; + $83 = $4 + 1310736 + ($81 + -7 << 2) | 0; + HEAP32[$83 >> 2] = (HEAP32[$83 >> 2] | 0) + 1; + $87 = $4 + 1310736 + ($81 + -6 << 2) | 0; + HEAP32[$87 >> 2] = (HEAP32[$87 >> 2] | 0) + $$2385; + $91 = $4 + 1310736 + ($81 + -5 << 2) | 0; + HEAP32[$91 >> 2] = (HEAP32[$91 >> 2] | 0) + $$0380; + HEAP32[$4 + 1310736 + ($81 + -1 << 2) >> 2] = $$0380; + $$2390 = $$1389; + break; + } + $97 = HEAP16[$$3 + -2 >> 1] | 0; + if ($97 << 16 >> 16 <= 0) { + HEAP16[$$3 >> 1] = $52; + $135 = $53 * 7 | 0; + $137 = $4 + 1310736 + ($135 + -7 << 2) | 0; + HEAP32[$137 >> 2] = (HEAP32[$137 >> 2] | 0) + 1; + $141 = $4 + 1310736 + ($135 + -6 << 2) | 0; + HEAP32[$141 >> 2] = (HEAP32[$141 >> 2] | 0) + $$2385; + $145 = $4 + 1310736 + ($135 + -5 << 2) | 0; + HEAP32[$145 >> 2] = (HEAP32[$145 >> 2] | 0) + $$0380; + $149 = $4 + 1310736 + ($135 + -4 << 2) | 0; + if ((HEAP32[$149 >> 2] | 0) > ($$2385 | 0)) HEAP32[$149 >> 2] = $$2385; + HEAP32[$4 + 1310736 + ($135 + -1 << 2) >> 2] = $$0380; + $$2390 = $$1389; + break; + } + $102 = HEAP32[$4 + 1179664 + ($53 + -1 << 2) >> 2] | 0; + $105 = HEAP32[$4 + 1179664 + (($97 << 16 >> 16) + -1 << 2) >> 2] | 0; + L61 : do if (($102 | 0) <= ($105 | 0)) { + HEAP16[$$3 >> 1] = $102; + if (($102 | 0) < ($105 | 0)) { + $$3375 = $19; + $$3379 = 0; + while (1) { + if (($$3379 | 0) >= ($$1389 | 0)) { + $120 = $102; + break L61; + } + if ((HEAP32[$$3375 >> 2] | 0) == ($105 | 0)) HEAP32[$$3375 >> 2] = $102; + $$3375 = $$3375 + 4 | 0; + $$3379 = $$3379 + 1 | 0; + } + } else $120 = $102; + } else { + HEAP16[$$3 >> 1] = $105; + $$2374 = $19; + $$2378 = 0; + while (1) { + if (($$2378 | 0) >= ($$1389 | 0)) { + $120 = $105; + break L61; + } + if ((HEAP32[$$2374 >> 2] | 0) == ($102 | 0)) HEAP32[$$2374 >> 2] = $105; + $$2374 = $$2374 + 4 | 0; + $$2378 = $$2378 + 1 | 0; + } + } while (0); + $122 = ($120 << 16 >> 16) * 7 | 0; + $124 = $4 + 1310736 + ($122 + -7 << 2) | 0; + HEAP32[$124 >> 2] = (HEAP32[$124 >> 2] | 0) + 1; + $128 = $4 + 1310736 + ($122 + -6 << 2) | 0; + HEAP32[$128 >> 2] = (HEAP32[$128 >> 2] | 0) + $$2385; + $132 = $4 + 1310736 + ($122 + -5 << 2) | 0; + HEAP32[$132 >> 2] = (HEAP32[$132 >> 2] | 0) + $$0380; + $$2390 = $$1389; + } while (0); + $$1 = $$1 + 1 | 0; + $$1389 = $$2390; + $$1392 = $$1392 + 1 | 0; + $$2385 = $$2385 + 1 | 0; + $$3 = $$3 + 2 | 0; + } + $$0367 = $$1 + 2 | 0; + $$0380 = $$0380 + 1 | 0; + $$0388 = $$1389; + $$0391 = $$1392 + 2 | 0; + $$2 = $$3 + 4 | 0; + } + L80 : do if ((label | 0) == 54) { + _arLog(0, 3, 23780, $vararg_buffer); + $$0 = -1; + } else if ((label | 0) == 59) { + $221 = $4 + 12 | 0; + $$1381 = 1; + $$3386 = 1; + $$4 = $19; + while (1) { + if (($$3386 | 0) > ($$0388 | 0)) break; + $223 = HEAP32[$$4 >> 2] | 0; + if (($223 | 0) == ($$3386 | 0)) { + $$2382 = $$1381 + 1 | 0; + $229 = $$1381; + } else { + $$2382 = $$1381; + $229 = HEAP32[$4 + 1179664 + ($223 + -1 << 2) >> 2] | 0; + } + HEAP32[$$4 >> 2] = $229; + $$1381 = $$2382; + $$3386 = $$3386 + 1 | 0; + $$4 = $$4 + 4 | 0; + } + $232 = $4 + 8 | 0; + $233 = $$1381 + -1 | 0; + HEAP32[$232 >> 2] = $233; + if (!$233) $$0 = 0; else { + _memset($221 | 0, 0, $233 << 2 | 0) | 0; + _memset($4 + 655376 | 0, 0, $233 << 4 | 0) | 0; + $$4387 = 0; + while (1) { + if (($$4387 | 0) >= ($233 | 0)) break; + $239 = $$4387 << 2; + HEAP32[$4 + 131084 + ($239 << 2) >> 2] = $1; + HEAP32[$4 + 131084 + (($239 | 1) << 2) >> 2] = 0; + HEAP32[$4 + 131084 + (($239 | 2) << 2) >> 2] = $2; + HEAP32[$4 + 131084 + (($239 | 3) << 2) >> 2] = 0; + $$4387 = $$4387 + 1 | 0; + } + $$5 = 0; + while (1) { + if (($$5 | 0) >= ($$0388 | 0)) break; + $251 = (HEAP32[$4 + 1179664 + ($$5 << 2) >> 2] | 0) + -1 | 0; + $252 = $$5 * 7 | 0; + $255 = $4 + 12 + ($251 << 2) | 0; + HEAP32[$255 >> 2] = (HEAP32[$255 >> 2] | 0) + (HEAP32[$4 + 1310736 + ($252 << 2) >> 2] | 0); + $262 = $251 << 1; + $263 = $4 + 655376 + ($262 << 3) | 0; + HEAPF64[$263 >> 3] = +HEAPF64[$263 >> 3] + +(HEAP32[$4 + 1310736 + ($252 + 1 << 2) >> 2] | 0); + $271 = $4 + 655376 + (($262 | 1) << 3) | 0; + HEAPF64[$271 >> 3] = +HEAPF64[$271 >> 3] + +(HEAP32[$4 + 1310736 + ($252 + 2 << 2) >> 2] | 0); + $274 = $251 << 2; + $275 = $4 + 131084 + ($274 << 2) | 0; + $279 = HEAP32[$4 + 1310736 + ($252 + 3 << 2) >> 2] | 0; + if ((HEAP32[$275 >> 2] | 0) > ($279 | 0)) HEAP32[$275 >> 2] = $279; + $282 = $4 + 131084 + (($274 | 1) << 2) | 0; + $286 = HEAP32[$4 + 1310736 + ($252 + 4 << 2) >> 2] | 0; + if ((HEAP32[$282 >> 2] | 0) < ($286 | 0)) HEAP32[$282 >> 2] = $286; + $289 = $4 + 131084 + (($274 | 2) << 2) | 0; + $293 = HEAP32[$4 + 1310736 + ($252 + 5 << 2) >> 2] | 0; + if ((HEAP32[$289 >> 2] | 0) > ($293 | 0)) HEAP32[$289 >> 2] = $293; + $296 = $4 + 131084 + (($274 | 3) << 2) | 0; + $300 = HEAP32[$4 + 1310736 + ($252 + 6 << 2) >> 2] | 0; + if ((HEAP32[$296 >> 2] | 0) < ($300 | 0)) HEAP32[$296 >> 2] = $300; + $$5 = $$5 + 1 | 0; + } + $303 = HEAP32[$232 >> 2] | 0; + $$6 = 0; + while (1) { + if (($$6 | 0) >= ($303 | 0)) { + $$0 = 0; + break L80; + } + $307 = +(HEAP32[$4 + 12 + ($$6 << 2) >> 2] | 0); + $308 = $$6 << 1; + $309 = $4 + 655376 + ($308 << 3) | 0; + HEAPF64[$309 >> 3] = +HEAPF64[$309 >> 3] / $307; + $313 = $4 + 655376 + (($308 | 1) << 3) | 0; + HEAPF64[$313 >> 3] = +HEAPF64[$313 >> 3] / $307; + $$6 = $$6 + 1 | 0; + } + } + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function _arLabelingSubDWZ($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0364 = 0, $$0365 = 0, $$0367 = 0, $$0369 = 0, $$0371 = 0, $$0375 = 0, $$0378 = 0, $$0383 = 0, $$0386 = 0, $$1 = 0, $$1366 = 0, $$1368 = 0, $$1370 = 0, $$1372 = 0, $$1376 = 0, $$1379 = 0, $$1384 = 0, $$1387 = 0, $$2 = 0, $$2373 = 0, $$2377 = 0, $$2380 = 0, $$2385 = 0, $$2388 = 0, $$3 = 0, $$3374 = 0, $$3381 = 0, $$3389 = 0, $$4 = 0, $$4382 = 0, $$5 = 0, $$6 = 0, $100 = 0, $103 = 0, $118 = 0, $120 = 0, $122 = 0, $126 = 0, $13 = 0, $130 = 0, $133 = 0, $135 = 0, $139 = 0, $143 = 0, $147 = 0, $152 = 0, $154 = 0, $158 = 0, $162 = 0, $166 = 0, $172 = 0, $175 = 0, $177 = 0, $181 = 0, $185 = 0, $189 = 0, $19 = 0, $192 = 0, $197 = 0, $20 = 0, $219 = 0, $221 = 0, $227 = 0, $230 = 0, $231 = 0, $237 = 0, $24 = 0, $249 = 0, $250 = 0, $253 = 0, $260 = 0, $261 = 0, $269 = 0, $272 = 0, $273 = 0, $277 = 0, $280 = 0, $284 = 0, $287 = 0, $291 = 0, $294 = 0, $298 = 0, $30 = 0, $301 = 0, $305 = 0.0, $306 = 0, $307 = 0, $31 = 0, $311 = 0, $34 = 0, $36 = 0, $40 = 0, $44 = 0, $5 = 0, $50 = 0, $51 = 0, $54 = 0, $55 = 0, $56 = 0, $59 = 0, $6 = 0, $62 = 0, $77 = 0, $79 = 0, $81 = 0, $85 = 0, $89 = 0, $95 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $5 = HEAP32[$4 >> 2] | 0; + $6 = $2 + -1 | 0; + $$0367 = $5; + $$0378 = 0; + $$0386 = $5 + ((Math_imul($6, $1) | 0) << 1) | 0; + while (1) { + if (($$0378 | 0) >= ($1 | 0)) break; + HEAP16[$$0386 >> 1] = 0; + HEAP16[$$0367 >> 1] = 0; + $$0367 = $$0367 + 2 | 0; + $$0378 = $$0378 + 1 | 0; + $$0386 = $$0386 + 2 | 0; + } + $13 = $1 + -1 | 0; + $$1368 = $5; + $$1379 = 0; + $$1387 = $5 + ($13 << 1) | 0; + while (1) { + if (($$1379 | 0) >= ($2 | 0)) break; + HEAP16[$$1387 >> 1] = 0; + HEAP16[$$1368 >> 1] = 0; + $$1368 = $$1368 + ($1 << 1) | 0; + $$1379 = $$1379 + 1 | 0; + $$1387 = $$1387 + ($1 << 1) | 0; + } + $19 = $4 + 1179664 | 0; + $20 = $1 + 1 | 0; + $24 = 0 - $1 | 0; + $$0364 = $0 + $20 | 0; + $$0365 = $3 + $20 | 0; + $$0375 = 1; + $$0383 = 0; + $$2388 = $5 + ($20 << 1) | 0; + L9 : while (1) { + if (($$0375 | 0) >= ($6 | 0)) { + label = 59; + break; + } + $$1 = $$0364; + $$1366 = $$0365; + $$1384 = $$0383; + $$2380 = 1; + $$3389 = $$2388; + while (1) { + if (($$2380 | 0) >= ($13 | 0)) break; + do if ((HEAPU8[$$1 >> 0] | 0) > (HEAPU8[$$1366 >> 0] | 0)) { + $30 = $$3389 + ($24 << 1) | 0; + $31 = HEAP16[$30 >> 1] | 0; + if ($31 << 16 >> 16 > 0) { + HEAP16[$$3389 >> 1] = $31; + $34 = ($31 << 16 >> 16) * 7 | 0; + $36 = $4 + 1310736 + ($34 + -7 << 2) | 0; + HEAP32[$36 >> 2] = (HEAP32[$36 >> 2] | 0) + 1; + $40 = $4 + 1310736 + ($34 + -6 << 2) | 0; + HEAP32[$40 >> 2] = (HEAP32[$40 >> 2] | 0) + $$2380; + $44 = $4 + 1310736 + ($34 + -5 << 2) | 0; + HEAP32[$44 >> 2] = (HEAP32[$44 >> 2] | 0) + $$0375; + HEAP32[$4 + 1310736 + ($34 + -1 << 2) >> 2] = $$0375; + $$2385 = $$1384; + break; + } + $50 = HEAP16[$30 + 2 >> 1] | 0; + $51 = $50 << 16 >> 16; + $54 = HEAP16[$30 + -2 >> 1] | 0; + $55 = $54 << 16 >> 16; + $56 = $54 << 16 >> 16 > 0; + if ($50 << 16 >> 16 <= 0) { + if ($56) { + HEAP16[$$3389 >> 1] = $54; + $152 = $55 * 7 | 0; + $154 = $4 + 1310736 + ($152 + -7 << 2) | 0; + HEAP32[$154 >> 2] = (HEAP32[$154 >> 2] | 0) + 1; + $158 = $4 + 1310736 + ($152 + -6 << 2) | 0; + HEAP32[$158 >> 2] = (HEAP32[$158 >> 2] | 0) + $$2380; + $162 = $4 + 1310736 + ($152 + -5 << 2) | 0; + HEAP32[$162 >> 2] = (HEAP32[$162 >> 2] | 0) + $$0375; + $166 = $4 + 1310736 + ($152 + -3 << 2) | 0; + if ((HEAP32[$166 >> 2] | 0) < ($$2380 | 0)) HEAP32[$166 >> 2] = $$2380; + HEAP32[$4 + 1310736 + ($152 + -1 << 2) >> 2] = $$0375; + $$2385 = $$1384; + break; + } + $172 = HEAP16[$$3389 + -2 >> 1] | 0; + if ($172 << 16 >> 16 > 0) { + HEAP16[$$3389 >> 1] = $172; + $175 = ($172 << 16 >> 16) * 7 | 0; + $177 = $4 + 1310736 + ($175 + -7 << 2) | 0; + HEAP32[$177 >> 2] = (HEAP32[$177 >> 2] | 0) + 1; + $181 = $4 + 1310736 + ($175 + -6 << 2) | 0; + HEAP32[$181 >> 2] = (HEAP32[$181 >> 2] | 0) + $$2380; + $185 = $4 + 1310736 + ($175 + -5 << 2) | 0; + HEAP32[$185 >> 2] = (HEAP32[$185 >> 2] | 0) + $$0375; + $189 = $4 + 1310736 + ($175 + -3 << 2) | 0; + if ((HEAP32[$189 >> 2] | 0) >= ($$2380 | 0)) { + $$2385 = $$1384; + break; + } + HEAP32[$189 >> 2] = $$2380; + $$2385 = $$1384; + break; + } else { + $192 = $$1384 + 1 | 0; + if (($$1384 | 0) > 32767) { + label = 54; + break L9; + } + HEAP16[$$3389 >> 1] = $192; + HEAP32[$4 + 1179664 + ($$1384 << 2) >> 2] = $192 << 16 >> 16; + $197 = $$1384 * 7 | 0; + HEAP32[$4 + 1310736 + ($197 << 2) >> 2] = 1; + HEAP32[$4 + 1310736 + ($197 + 1 << 2) >> 2] = $$2380; + HEAP32[$4 + 1310736 + ($197 + 2 << 2) >> 2] = $$0375; + HEAP32[$4 + 1310736 + ($197 + 3 << 2) >> 2] = $$2380; + HEAP32[$4 + 1310736 + ($197 + 4 << 2) >> 2] = $$2380; + HEAP32[$4 + 1310736 + ($197 + 5 << 2) >> 2] = $$0375; + HEAP32[$4 + 1310736 + ($197 + 6 << 2) >> 2] = $$0375; + $$2385 = $192; + break; + } + } + if ($56) { + $59 = HEAP32[$4 + 1179664 + ($51 + -1 << 2) >> 2] | 0; + $62 = HEAP32[$4 + 1179664 + ($55 + -1 << 2) >> 2] | 0; + L36 : do if (($59 | 0) <= ($62 | 0)) { + HEAP16[$$3389 >> 1] = $59; + if (($59 | 0) < ($62 | 0)) { + $$1370 = $19; + $$1372 = 0; + while (1) { + if (($$1372 | 0) >= ($$1384 | 0)) { + $77 = $59; + break L36; + } + if ((HEAP32[$$1370 >> 2] | 0) == ($62 | 0)) HEAP32[$$1370 >> 2] = $59; + $$1370 = $$1370 + 4 | 0; + $$1372 = $$1372 + 1 | 0; + } + } else $77 = $59; + } else { + HEAP16[$$3389 >> 1] = $62; + $$0369 = $19; + $$0371 = 0; + while (1) { + if (($$0371 | 0) >= ($$1384 | 0)) { + $77 = $62; + break L36; + } + if ((HEAP32[$$0369 >> 2] | 0) == ($59 | 0)) HEAP32[$$0369 >> 2] = $62; + $$0369 = $$0369 + 4 | 0; + $$0371 = $$0371 + 1 | 0; + } + } while (0); + $79 = ($77 << 16 >> 16) * 7 | 0; + $81 = $4 + 1310736 + ($79 + -7 << 2) | 0; + HEAP32[$81 >> 2] = (HEAP32[$81 >> 2] | 0) + 1; + $85 = $4 + 1310736 + ($79 + -6 << 2) | 0; + HEAP32[$85 >> 2] = (HEAP32[$85 >> 2] | 0) + $$2380; + $89 = $4 + 1310736 + ($79 + -5 << 2) | 0; + HEAP32[$89 >> 2] = (HEAP32[$89 >> 2] | 0) + $$0375; + HEAP32[$4 + 1310736 + ($79 + -1 << 2) >> 2] = $$0375; + $$2385 = $$1384; + break; + } + $95 = HEAP16[$$3389 + -2 >> 1] | 0; + if ($95 << 16 >> 16 <= 0) { + HEAP16[$$3389 >> 1] = $50; + $133 = $51 * 7 | 0; + $135 = $4 + 1310736 + ($133 + -7 << 2) | 0; + HEAP32[$135 >> 2] = (HEAP32[$135 >> 2] | 0) + 1; + $139 = $4 + 1310736 + ($133 + -6 << 2) | 0; + HEAP32[$139 >> 2] = (HEAP32[$139 >> 2] | 0) + $$2380; + $143 = $4 + 1310736 + ($133 + -5 << 2) | 0; + HEAP32[$143 >> 2] = (HEAP32[$143 >> 2] | 0) + $$0375; + $147 = $4 + 1310736 + ($133 + -4 << 2) | 0; + if ((HEAP32[$147 >> 2] | 0) > ($$2380 | 0)) HEAP32[$147 >> 2] = $$2380; + HEAP32[$4 + 1310736 + ($133 + -1 << 2) >> 2] = $$0375; + $$2385 = $$1384; + break; + } + $100 = HEAP32[$4 + 1179664 + ($51 + -1 << 2) >> 2] | 0; + $103 = HEAP32[$4 + 1179664 + (($95 << 16 >> 16) + -1 << 2) >> 2] | 0; + L60 : do if (($100 | 0) <= ($103 | 0)) { + HEAP16[$$3389 >> 1] = $100; + if (($100 | 0) < ($103 | 0)) { + $$3 = $19; + $$3374 = 0; + while (1) { + if (($$3374 | 0) >= ($$1384 | 0)) { + $118 = $100; + break L60; + } + if ((HEAP32[$$3 >> 2] | 0) == ($103 | 0)) HEAP32[$$3 >> 2] = $100; + $$3 = $$3 + 4 | 0; + $$3374 = $$3374 + 1 | 0; + } + } else $118 = $100; + } else { + HEAP16[$$3389 >> 1] = $103; + $$2 = $19; + $$2373 = 0; + while (1) { + if (($$2373 | 0) >= ($$1384 | 0)) { + $118 = $103; + break L60; + } + if ((HEAP32[$$2 >> 2] | 0) == ($100 | 0)) HEAP32[$$2 >> 2] = $103; + $$2 = $$2 + 4 | 0; + $$2373 = $$2373 + 1 | 0; + } + } while (0); + $120 = ($118 << 16 >> 16) * 7 | 0; + $122 = $4 + 1310736 + ($120 + -7 << 2) | 0; + HEAP32[$122 >> 2] = (HEAP32[$122 >> 2] | 0) + 1; + $126 = $4 + 1310736 + ($120 + -6 << 2) | 0; + HEAP32[$126 >> 2] = (HEAP32[$126 >> 2] | 0) + $$2380; + $130 = $4 + 1310736 + ($120 + -5 << 2) | 0; + HEAP32[$130 >> 2] = (HEAP32[$130 >> 2] | 0) + $$0375; + $$2385 = $$1384; + } else { + HEAP16[$$3389 >> 1] = 0; + $$2385 = $$1384; + } while (0); + $$1 = $$1 + 1 | 0; + $$1366 = $$1366 + 1 | 0; + $$1384 = $$2385; + $$2380 = $$2380 + 1 | 0; + $$3389 = $$3389 + 2 | 0; + } + $$0364 = $$1 + 2 | 0; + $$0365 = $$1366 + 2 | 0; + $$0375 = $$0375 + 1 | 0; + $$0383 = $$1384; + $$2388 = $$3389 + 4 | 0; + } + L80 : do if ((label | 0) == 54) { + _arLog(0, 3, 23780, $vararg_buffer); + $$0 = -1; + } else if ((label | 0) == 59) { + $219 = $4 + 12 | 0; + $$1376 = 1; + $$3381 = 1; + $$4 = $19; + while (1) { + if (($$3381 | 0) > ($$0383 | 0)) break; + $221 = HEAP32[$$4 >> 2] | 0; + if (($221 | 0) == ($$3381 | 0)) { + $$2377 = $$1376 + 1 | 0; + $227 = $$1376; + } else { + $$2377 = $$1376; + $227 = HEAP32[$4 + 1179664 + ($221 + -1 << 2) >> 2] | 0; + } + HEAP32[$$4 >> 2] = $227; + $$1376 = $$2377; + $$3381 = $$3381 + 1 | 0; + $$4 = $$4 + 4 | 0; + } + $230 = $4 + 8 | 0; + $231 = $$1376 + -1 | 0; + HEAP32[$230 >> 2] = $231; + if (!$231) $$0 = 0; else { + _memset($219 | 0, 0, $231 << 2 | 0) | 0; + _memset($4 + 655376 | 0, 0, $231 << 4 | 0) | 0; + $$4382 = 0; + while (1) { + if (($$4382 | 0) >= ($231 | 0)) break; + $237 = $$4382 << 2; + HEAP32[$4 + 131084 + ($237 << 2) >> 2] = $1; + HEAP32[$4 + 131084 + (($237 | 1) << 2) >> 2] = 0; + HEAP32[$4 + 131084 + (($237 | 2) << 2) >> 2] = $2; + HEAP32[$4 + 131084 + (($237 | 3) << 2) >> 2] = 0; + $$4382 = $$4382 + 1 | 0; + } + $$5 = 0; + while (1) { + if (($$5 | 0) >= ($$0383 | 0)) break; + $249 = (HEAP32[$4 + 1179664 + ($$5 << 2) >> 2] | 0) + -1 | 0; + $250 = $$5 * 7 | 0; + $253 = $4 + 12 + ($249 << 2) | 0; + HEAP32[$253 >> 2] = (HEAP32[$253 >> 2] | 0) + (HEAP32[$4 + 1310736 + ($250 << 2) >> 2] | 0); + $260 = $249 << 1; + $261 = $4 + 655376 + ($260 << 3) | 0; + HEAPF64[$261 >> 3] = +HEAPF64[$261 >> 3] + +(HEAP32[$4 + 1310736 + ($250 + 1 << 2) >> 2] | 0); + $269 = $4 + 655376 + (($260 | 1) << 3) | 0; + HEAPF64[$269 >> 3] = +HEAPF64[$269 >> 3] + +(HEAP32[$4 + 1310736 + ($250 + 2 << 2) >> 2] | 0); + $272 = $249 << 2; + $273 = $4 + 131084 + ($272 << 2) | 0; + $277 = HEAP32[$4 + 1310736 + ($250 + 3 << 2) >> 2] | 0; + if ((HEAP32[$273 >> 2] | 0) > ($277 | 0)) HEAP32[$273 >> 2] = $277; + $280 = $4 + 131084 + (($272 | 1) << 2) | 0; + $284 = HEAP32[$4 + 1310736 + ($250 + 4 << 2) >> 2] | 0; + if ((HEAP32[$280 >> 2] | 0) < ($284 | 0)) HEAP32[$280 >> 2] = $284; + $287 = $4 + 131084 + (($272 | 2) << 2) | 0; + $291 = HEAP32[$4 + 1310736 + ($250 + 5 << 2) >> 2] | 0; + if ((HEAP32[$287 >> 2] | 0) > ($291 | 0)) HEAP32[$287 >> 2] = $291; + $294 = $4 + 131084 + (($272 | 3) << 2) | 0; + $298 = HEAP32[$4 + 1310736 + ($250 + 6 << 2) >> 2] | 0; + if ((HEAP32[$294 >> 2] | 0) < ($298 | 0)) HEAP32[$294 >> 2] = $298; + $$5 = $$5 + 1 | 0; + } + $301 = HEAP32[$230 >> 2] | 0; + $$6 = 0; + while (1) { + if (($$6 | 0) >= ($301 | 0)) { + $$0 = 0; + break L80; + } + $305 = +(HEAP32[$4 + 12 + ($$6 << 2) >> 2] | 0); + $306 = $$6 << 1; + $307 = $4 + 655376 + ($306 << 3) | 0; + HEAPF64[$307 >> 3] = +HEAPF64[$307 >> 3] / $305; + $311 = $4 + 655376 + (($306 | 1) << 3) | 0; + HEAPF64[$311 >> 3] = +HEAPF64[$311 >> 3] / $305; + $$6 = $$6 + 1 | 0; + } + } + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function _arLabelingSubDBZ($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0364 = 0, $$0365 = 0, $$0367 = 0, $$0369 = 0, $$0371 = 0, $$0375 = 0, $$0378 = 0, $$0383 = 0, $$0386 = 0, $$1 = 0, $$1366 = 0, $$1368 = 0, $$1370 = 0, $$1372 = 0, $$1376 = 0, $$1379 = 0, $$1384 = 0, $$1387 = 0, $$2 = 0, $$2373 = 0, $$2377 = 0, $$2380 = 0, $$2385 = 0, $$2388 = 0, $$3 = 0, $$3374 = 0, $$3381 = 0, $$3389 = 0, $$4 = 0, $$4382 = 0, $$5 = 0, $$6 = 0, $100 = 0, $103 = 0, $118 = 0, $120 = 0, $122 = 0, $126 = 0, $13 = 0, $130 = 0, $133 = 0, $135 = 0, $139 = 0, $143 = 0, $147 = 0, $152 = 0, $154 = 0, $158 = 0, $162 = 0, $166 = 0, $172 = 0, $175 = 0, $177 = 0, $181 = 0, $185 = 0, $189 = 0, $19 = 0, $192 = 0, $197 = 0, $20 = 0, $219 = 0, $221 = 0, $227 = 0, $230 = 0, $231 = 0, $237 = 0, $24 = 0, $249 = 0, $250 = 0, $253 = 0, $260 = 0, $261 = 0, $269 = 0, $272 = 0, $273 = 0, $277 = 0, $280 = 0, $284 = 0, $287 = 0, $291 = 0, $294 = 0, $298 = 0, $30 = 0, $301 = 0, $305 = 0.0, $306 = 0, $307 = 0, $31 = 0, $311 = 0, $34 = 0, $36 = 0, $40 = 0, $44 = 0, $5 = 0, $50 = 0, $51 = 0, $54 = 0, $55 = 0, $56 = 0, $59 = 0, $6 = 0, $62 = 0, $77 = 0, $79 = 0, $81 = 0, $85 = 0, $89 = 0, $95 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $5 = HEAP32[$4 >> 2] | 0; + $6 = $2 + -1 | 0; + $$0367 = $5; + $$0378 = 0; + $$0386 = $5 + ((Math_imul($6, $1) | 0) << 1) | 0; + while (1) { + if (($$0378 | 0) >= ($1 | 0)) break; + HEAP16[$$0386 >> 1] = 0; + HEAP16[$$0367 >> 1] = 0; + $$0367 = $$0367 + 2 | 0; + $$0378 = $$0378 + 1 | 0; + $$0386 = $$0386 + 2 | 0; + } + $13 = $1 + -1 | 0; + $$1368 = $5; + $$1379 = 0; + $$1387 = $5 + ($13 << 1) | 0; + while (1) { + if (($$1379 | 0) >= ($2 | 0)) break; + HEAP16[$$1387 >> 1] = 0; + HEAP16[$$1368 >> 1] = 0; + $$1368 = $$1368 + ($1 << 1) | 0; + $$1379 = $$1379 + 1 | 0; + $$1387 = $$1387 + ($1 << 1) | 0; + } + $19 = $4 + 1179664 | 0; + $20 = $1 + 1 | 0; + $24 = 0 - $1 | 0; + $$0364 = $0 + $20 | 0; + $$0365 = $3 + $20 | 0; + $$0375 = 1; + $$0383 = 0; + $$2388 = $5 + ($20 << 1) | 0; + L9 : while (1) { + if (($$0375 | 0) >= ($6 | 0)) { + label = 59; + break; + } + $$1 = $$0364; + $$1366 = $$0365; + $$1384 = $$0383; + $$2380 = 1; + $$3389 = $$2388; + while (1) { + if (($$2380 | 0) >= ($13 | 0)) break; + do if ((HEAPU8[$$1 >> 0] | 0) > (HEAPU8[$$1366 >> 0] | 0)) { + HEAP16[$$3389 >> 1] = 0; + $$2385 = $$1384; + } else { + $30 = $$3389 + ($24 << 1) | 0; + $31 = HEAP16[$30 >> 1] | 0; + if ($31 << 16 >> 16 > 0) { + HEAP16[$$3389 >> 1] = $31; + $34 = ($31 << 16 >> 16) * 7 | 0; + $36 = $4 + 1310736 + ($34 + -7 << 2) | 0; + HEAP32[$36 >> 2] = (HEAP32[$36 >> 2] | 0) + 1; + $40 = $4 + 1310736 + ($34 + -6 << 2) | 0; + HEAP32[$40 >> 2] = (HEAP32[$40 >> 2] | 0) + $$2380; + $44 = $4 + 1310736 + ($34 + -5 << 2) | 0; + HEAP32[$44 >> 2] = (HEAP32[$44 >> 2] | 0) + $$0375; + HEAP32[$4 + 1310736 + ($34 + -1 << 2) >> 2] = $$0375; + $$2385 = $$1384; + break; + } + $50 = HEAP16[$30 + 2 >> 1] | 0; + $51 = $50 << 16 >> 16; + $54 = HEAP16[$30 + -2 >> 1] | 0; + $55 = $54 << 16 >> 16; + $56 = $54 << 16 >> 16 > 0; + if ($50 << 16 >> 16 <= 0) { + if ($56) { + HEAP16[$$3389 >> 1] = $54; + $152 = $55 * 7 | 0; + $154 = $4 + 1310736 + ($152 + -7 << 2) | 0; + HEAP32[$154 >> 2] = (HEAP32[$154 >> 2] | 0) + 1; + $158 = $4 + 1310736 + ($152 + -6 << 2) | 0; + HEAP32[$158 >> 2] = (HEAP32[$158 >> 2] | 0) + $$2380; + $162 = $4 + 1310736 + ($152 + -5 << 2) | 0; + HEAP32[$162 >> 2] = (HEAP32[$162 >> 2] | 0) + $$0375; + $166 = $4 + 1310736 + ($152 + -3 << 2) | 0; + if ((HEAP32[$166 >> 2] | 0) < ($$2380 | 0)) HEAP32[$166 >> 2] = $$2380; + HEAP32[$4 + 1310736 + ($152 + -1 << 2) >> 2] = $$0375; + $$2385 = $$1384; + break; + } + $172 = HEAP16[$$3389 + -2 >> 1] | 0; + if ($172 << 16 >> 16 > 0) { + HEAP16[$$3389 >> 1] = $172; + $175 = ($172 << 16 >> 16) * 7 | 0; + $177 = $4 + 1310736 + ($175 + -7 << 2) | 0; + HEAP32[$177 >> 2] = (HEAP32[$177 >> 2] | 0) + 1; + $181 = $4 + 1310736 + ($175 + -6 << 2) | 0; + HEAP32[$181 >> 2] = (HEAP32[$181 >> 2] | 0) + $$2380; + $185 = $4 + 1310736 + ($175 + -5 << 2) | 0; + HEAP32[$185 >> 2] = (HEAP32[$185 >> 2] | 0) + $$0375; + $189 = $4 + 1310736 + ($175 + -3 << 2) | 0; + if ((HEAP32[$189 >> 2] | 0) >= ($$2380 | 0)) { + $$2385 = $$1384; + break; + } + HEAP32[$189 >> 2] = $$2380; + $$2385 = $$1384; + break; + } else { + $192 = $$1384 + 1 | 0; + if (($$1384 | 0) > 32767) { + label = 54; + break L9; + } + HEAP16[$$3389 >> 1] = $192; + HEAP32[$4 + 1179664 + ($$1384 << 2) >> 2] = $192 << 16 >> 16; + $197 = $$1384 * 7 | 0; + HEAP32[$4 + 1310736 + ($197 << 2) >> 2] = 1; + HEAP32[$4 + 1310736 + ($197 + 1 << 2) >> 2] = $$2380; + HEAP32[$4 + 1310736 + ($197 + 2 << 2) >> 2] = $$0375; + HEAP32[$4 + 1310736 + ($197 + 3 << 2) >> 2] = $$2380; + HEAP32[$4 + 1310736 + ($197 + 4 << 2) >> 2] = $$2380; + HEAP32[$4 + 1310736 + ($197 + 5 << 2) >> 2] = $$0375; + HEAP32[$4 + 1310736 + ($197 + 6 << 2) >> 2] = $$0375; + $$2385 = $192; + break; + } + } + if ($56) { + $59 = HEAP32[$4 + 1179664 + ($51 + -1 << 2) >> 2] | 0; + $62 = HEAP32[$4 + 1179664 + ($55 + -1 << 2) >> 2] | 0; + L37 : do if (($59 | 0) <= ($62 | 0)) { + HEAP16[$$3389 >> 1] = $59; + if (($59 | 0) < ($62 | 0)) { + $$1370 = $19; + $$1372 = 0; + while (1) { + if (($$1372 | 0) >= ($$1384 | 0)) { + $77 = $59; + break L37; + } + if ((HEAP32[$$1370 >> 2] | 0) == ($62 | 0)) HEAP32[$$1370 >> 2] = $59; + $$1370 = $$1370 + 4 | 0; + $$1372 = $$1372 + 1 | 0; + } + } else $77 = $59; + } else { + HEAP16[$$3389 >> 1] = $62; + $$0369 = $19; + $$0371 = 0; + while (1) { + if (($$0371 | 0) >= ($$1384 | 0)) { + $77 = $62; + break L37; + } + if ((HEAP32[$$0369 >> 2] | 0) == ($59 | 0)) HEAP32[$$0369 >> 2] = $62; + $$0369 = $$0369 + 4 | 0; + $$0371 = $$0371 + 1 | 0; + } + } while (0); + $79 = ($77 << 16 >> 16) * 7 | 0; + $81 = $4 + 1310736 + ($79 + -7 << 2) | 0; + HEAP32[$81 >> 2] = (HEAP32[$81 >> 2] | 0) + 1; + $85 = $4 + 1310736 + ($79 + -6 << 2) | 0; + HEAP32[$85 >> 2] = (HEAP32[$85 >> 2] | 0) + $$2380; + $89 = $4 + 1310736 + ($79 + -5 << 2) | 0; + HEAP32[$89 >> 2] = (HEAP32[$89 >> 2] | 0) + $$0375; + HEAP32[$4 + 1310736 + ($79 + -1 << 2) >> 2] = $$0375; + $$2385 = $$1384; + break; + } + $95 = HEAP16[$$3389 + -2 >> 1] | 0; + if ($95 << 16 >> 16 <= 0) { + HEAP16[$$3389 >> 1] = $50; + $133 = $51 * 7 | 0; + $135 = $4 + 1310736 + ($133 + -7 << 2) | 0; + HEAP32[$135 >> 2] = (HEAP32[$135 >> 2] | 0) + 1; + $139 = $4 + 1310736 + ($133 + -6 << 2) | 0; + HEAP32[$139 >> 2] = (HEAP32[$139 >> 2] | 0) + $$2380; + $143 = $4 + 1310736 + ($133 + -5 << 2) | 0; + HEAP32[$143 >> 2] = (HEAP32[$143 >> 2] | 0) + $$0375; + $147 = $4 + 1310736 + ($133 + -4 << 2) | 0; + if ((HEAP32[$147 >> 2] | 0) > ($$2380 | 0)) HEAP32[$147 >> 2] = $$2380; + HEAP32[$4 + 1310736 + ($133 + -1 << 2) >> 2] = $$0375; + $$2385 = $$1384; + break; + } + $100 = HEAP32[$4 + 1179664 + ($51 + -1 << 2) >> 2] | 0; + $103 = HEAP32[$4 + 1179664 + (($95 << 16 >> 16) + -1 << 2) >> 2] | 0; + L61 : do if (($100 | 0) <= ($103 | 0)) { + HEAP16[$$3389 >> 1] = $100; + if (($100 | 0) < ($103 | 0)) { + $$3 = $19; + $$3374 = 0; + while (1) { + if (($$3374 | 0) >= ($$1384 | 0)) { + $118 = $100; + break L61; + } + if ((HEAP32[$$3 >> 2] | 0) == ($103 | 0)) HEAP32[$$3 >> 2] = $100; + $$3 = $$3 + 4 | 0; + $$3374 = $$3374 + 1 | 0; + } + } else $118 = $100; + } else { + HEAP16[$$3389 >> 1] = $103; + $$2 = $19; + $$2373 = 0; + while (1) { + if (($$2373 | 0) >= ($$1384 | 0)) { + $118 = $103; + break L61; + } + if ((HEAP32[$$2 >> 2] | 0) == ($100 | 0)) HEAP32[$$2 >> 2] = $103; + $$2 = $$2 + 4 | 0; + $$2373 = $$2373 + 1 | 0; + } + } while (0); + $120 = ($118 << 16 >> 16) * 7 | 0; + $122 = $4 + 1310736 + ($120 + -7 << 2) | 0; + HEAP32[$122 >> 2] = (HEAP32[$122 >> 2] | 0) + 1; + $126 = $4 + 1310736 + ($120 + -6 << 2) | 0; + HEAP32[$126 >> 2] = (HEAP32[$126 >> 2] | 0) + $$2380; + $130 = $4 + 1310736 + ($120 + -5 << 2) | 0; + HEAP32[$130 >> 2] = (HEAP32[$130 >> 2] | 0) + $$0375; + $$2385 = $$1384; + } while (0); + $$1 = $$1 + 1 | 0; + $$1366 = $$1366 + 1 | 0; + $$1384 = $$2385; + $$2380 = $$2380 + 1 | 0; + $$3389 = $$3389 + 2 | 0; + } + $$0364 = $$1 + 2 | 0; + $$0365 = $$1366 + 2 | 0; + $$0375 = $$0375 + 1 | 0; + $$0383 = $$1384; + $$2388 = $$3389 + 4 | 0; + } + L80 : do if ((label | 0) == 54) { + _arLog(0, 3, 23780, $vararg_buffer); + $$0 = -1; + } else if ((label | 0) == 59) { + $219 = $4 + 12 | 0; + $$1376 = 1; + $$3381 = 1; + $$4 = $19; + while (1) { + if (($$3381 | 0) > ($$0383 | 0)) break; + $221 = HEAP32[$$4 >> 2] | 0; + if (($221 | 0) == ($$3381 | 0)) { + $$2377 = $$1376 + 1 | 0; + $227 = $$1376; + } else { + $$2377 = $$1376; + $227 = HEAP32[$4 + 1179664 + ($221 + -1 << 2) >> 2] | 0; + } + HEAP32[$$4 >> 2] = $227; + $$1376 = $$2377; + $$3381 = $$3381 + 1 | 0; + $$4 = $$4 + 4 | 0; + } + $230 = $4 + 8 | 0; + $231 = $$1376 + -1 | 0; + HEAP32[$230 >> 2] = $231; + if (!$231) $$0 = 0; else { + _memset($219 | 0, 0, $231 << 2 | 0) | 0; + _memset($4 + 655376 | 0, 0, $231 << 4 | 0) | 0; + $$4382 = 0; + while (1) { + if (($$4382 | 0) >= ($231 | 0)) break; + $237 = $$4382 << 2; + HEAP32[$4 + 131084 + ($237 << 2) >> 2] = $1; + HEAP32[$4 + 131084 + (($237 | 1) << 2) >> 2] = 0; + HEAP32[$4 + 131084 + (($237 | 2) << 2) >> 2] = $2; + HEAP32[$4 + 131084 + (($237 | 3) << 2) >> 2] = 0; + $$4382 = $$4382 + 1 | 0; + } + $$5 = 0; + while (1) { + if (($$5 | 0) >= ($$0383 | 0)) break; + $249 = (HEAP32[$4 + 1179664 + ($$5 << 2) >> 2] | 0) + -1 | 0; + $250 = $$5 * 7 | 0; + $253 = $4 + 12 + ($249 << 2) | 0; + HEAP32[$253 >> 2] = (HEAP32[$253 >> 2] | 0) + (HEAP32[$4 + 1310736 + ($250 << 2) >> 2] | 0); + $260 = $249 << 1; + $261 = $4 + 655376 + ($260 << 3) | 0; + HEAPF64[$261 >> 3] = +HEAPF64[$261 >> 3] + +(HEAP32[$4 + 1310736 + ($250 + 1 << 2) >> 2] | 0); + $269 = $4 + 655376 + (($260 | 1) << 3) | 0; + HEAPF64[$269 >> 3] = +HEAPF64[$269 >> 3] + +(HEAP32[$4 + 1310736 + ($250 + 2 << 2) >> 2] | 0); + $272 = $249 << 2; + $273 = $4 + 131084 + ($272 << 2) | 0; + $277 = HEAP32[$4 + 1310736 + ($250 + 3 << 2) >> 2] | 0; + if ((HEAP32[$273 >> 2] | 0) > ($277 | 0)) HEAP32[$273 >> 2] = $277; + $280 = $4 + 131084 + (($272 | 1) << 2) | 0; + $284 = HEAP32[$4 + 1310736 + ($250 + 4 << 2) >> 2] | 0; + if ((HEAP32[$280 >> 2] | 0) < ($284 | 0)) HEAP32[$280 >> 2] = $284; + $287 = $4 + 131084 + (($272 | 2) << 2) | 0; + $291 = HEAP32[$4 + 1310736 + ($250 + 5 << 2) >> 2] | 0; + if ((HEAP32[$287 >> 2] | 0) > ($291 | 0)) HEAP32[$287 >> 2] = $291; + $294 = $4 + 131084 + (($272 | 3) << 2) | 0; + $298 = HEAP32[$4 + 1310736 + ($250 + 6 << 2) >> 2] | 0; + if ((HEAP32[$294 >> 2] | 0) < ($298 | 0)) HEAP32[$294 >> 2] = $298; + $$5 = $$5 + 1 | 0; + } + $301 = HEAP32[$230 >> 2] | 0; + $$6 = 0; + while (1) { + if (($$6 | 0) >= ($301 | 0)) { + $$0 = 0; + break L80; + } + $305 = +(HEAP32[$4 + 12 + ($$6 << 2) >> 2] | 0); + $306 = $$6 << 1; + $307 = $4 + 655376 + ($306 << 3) | 0; + HEAPF64[$307 >> 3] = +HEAPF64[$307 >> 3] / $305; + $311 = $4 + 655376 + (($306 | 1) << 3) | 0; + HEAPF64[$311 >> 3] = +HEAPF64[$311 >> 3] / $305; + $$6 = $$6 + 1 | 0; + } + } + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN6vision22bilinear_interpolationIffEET0_PKT_mmmff($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = +$4; + $5 = +$5; + var $103 = 0, $108 = 0, $112 = 0, $114 = 0, $115 = 0, $117 = 0.0, $119 = 0.0, $120 = 0.0, $122 = 0.0, $123 = 0.0, $125 = 0.0, $126 = 0.0, $127 = 0.0, $136 = 0, $141 = 0, $145 = 0, $154 = 0, $159 = 0, $16 = 0, $163 = 0, $172 = 0, $177 = 0, $181 = 0, $190 = 0, $195 = 0, $199 = 0, $21 = 0, $210 = 0, $215 = 0, $219 = 0, $25 = 0, $27 = 0, $35 = 0, $40 = 0, $44 = 0, $45 = 0, $46 = 0, $54 = 0, $59 = 0, $6 = 0, $63 = 0, $70 = 0, $75 = 0, $79 = 0, $8 = 0, $87 = 0, $92 = 0, $96 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $6 = sp; + $8 = ~~+Math_floor(+$4); + if (($8 | 0) != (~~$4 | 0)) { + $16 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29355) | 0, 29407) | 0, 39072) | 0, 69) | 0, 39079) | 0, 29483) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $16 + (HEAP32[(HEAP32[$16 >> 2] | 0) + -12 >> 2] | 0) | 0); + $21 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $25 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$21 >> 2] | 0) + 28 >> 2] & 127]($21, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($16, $25) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($16) | 0; + _abort(); + } + $27 = ~~+Math_floor(+$5); + if (($27 | 0) != (~~$5 | 0)) { + $35 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29513) | 0, 29407) | 0, 39072) | 0, 70) | 0, 39079) | 0, 29483) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $35 + (HEAP32[(HEAP32[$35 >> 2] | 0) + -12 >> 2] | 0) | 0); + $40 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $44 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$40 >> 2] | 0) + 28 >> 2] & 127]($40, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($35, $44) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($35) | 0; + _abort(); + } + $45 = $8 + 1 | 0; + $46 = $27 + 1 | 0; + if (!(($27 | 0) > -1 & $27 >>> 0 < $2 >>> 0)) { + $54 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29565) | 0, 29407) | 0, 39072) | 0, 79) | 0, 39079) | 0, 29611) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $54 + (HEAP32[(HEAP32[$54 >> 2] | 0) + -12 >> 2] | 0) | 0); + $59 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $63 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$59 >> 2] | 0) + 28 >> 2] & 127]($59, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($54, $63) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($54) | 0; + _abort(); + } + if ($46 >>> 0 >= $2 >>> 0) { + $70 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29628) | 0, 29407) | 0, 39072) | 0, 80) | 0, 39079) | 0, 29688) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $70 + (HEAP32[(HEAP32[$70 >> 2] | 0) + -12 >> 2] | 0) | 0); + $75 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $79 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$75 >> 2] | 0) + 28 >> 2] & 127]($75, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($70, $79) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($70) | 0; + _abort(); + } + if (!(($8 | 0) > -1 & $8 >>> 0 < $1 >>> 0)) { + $87 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29712) | 0, 29407) | 0, 39072) | 0, 81) | 0, 39079) | 0, 29757) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $87 + (HEAP32[(HEAP32[$87 >> 2] | 0) + -12 >> 2] | 0) | 0); + $92 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $96 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$92 >> 2] | 0) + 28 >> 2] & 127]($92, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($87, $96) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($87) | 0; + _abort(); + } + if ($45 >>> 0 >= $1 >>> 0) { + $103 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29774) | 0, 29407) | 0, 39072) | 0, 82) | 0, 39079) | 0, 29833) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $103 + (HEAP32[(HEAP32[$103 >> 2] | 0) + -12 >> 2] | 0) | 0); + $108 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $112 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$108 >> 2] | 0) + 28 >> 2] & 127]($108, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($103, $112) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($103) | 0; + _abort(); + } + $114 = $0 + (Math_imul($27, $3) | 0) | 0; + $115 = $114 + $3 | 0; + $117 = +($45 | 0) - $4; + $119 = +($46 | 0) - $5; + $120 = $117 * $119; + $122 = $4 - +($8 | 0); + $123 = $122 * $119; + $125 = $5 - +($27 | 0); + $126 = $117 * $125; + $127 = $122 * $125; + if (!($120 >= 0.0) | !($120 <= 1.0001)) { + $136 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29857) | 0, 29407) | 0, 39072) | 0, 94) | 0, 39079) | 0, 29904) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $136 + (HEAP32[(HEAP32[$136 >> 2] | 0) + -12 >> 2] | 0) | 0); + $141 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $145 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$141 >> 2] | 0) + 28 >> 2] & 127]($141, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($136, $145) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($136) | 0; + _abort(); + } + if (!($123 >= 0.0) | !($123 <= 1.0001)) { + $154 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29917) | 0, 29407) | 0, 39072) | 0, 95) | 0, 39079) | 0, 29904) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $154 + (HEAP32[(HEAP32[$154 >> 2] | 0) + -12 >> 2] | 0) | 0); + $159 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $163 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$159 >> 2] | 0) + 28 >> 2] & 127]($159, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($154, $163) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($154) | 0; + _abort(); + } + if (!($126 >= 0.0) | !($126 <= 1.0001)) { + $172 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29964) | 0, 29407) | 0, 39072) | 0, 96) | 0, 39079) | 0, 29904) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $172 + (HEAP32[(HEAP32[$172 >> 2] | 0) + -12 >> 2] | 0) | 0); + $177 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $181 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$177 >> 2] | 0) + 28 >> 2] & 127]($177, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($172, $181) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($172) | 0; + _abort(); + } + if (!($127 >= 0.0) | !($127 <= 1.0001)) { + $190 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30011) | 0, 29407) | 0, 39072) | 0, 97) | 0, 39079) | 0, 29904) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $190 + (HEAP32[(HEAP32[$190 >> 2] | 0) + -12 >> 2] | 0) | 0); + $195 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $199 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$195 >> 2] | 0) + 28 >> 2] & 127]($195, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($190, $199) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($190) | 0; + _abort(); + } + if (!($127 + ($126 + ($120 + $123)) <= 1.0001)) { + $210 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30058) | 0, 29407) | 0, 39072) | 0, 98) | 0, 39079) | 0, 29904) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $210 + (HEAP32[(HEAP32[$210 >> 2] | 0) + -12 >> 2] | 0) | 0); + $215 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $219 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$215 >> 2] | 0) + 28 >> 2] & 127]($215, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($210, $219) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($210) | 0; + _abort(); + } else { + STACKTOP = sp; + return +($120 * +HEAPF32[$114 + ($8 << 2) >> 2] + $123 * +HEAPF32[$114 + ($45 << 2) >> 2] + $126 * +HEAPF32[$115 + ($8 << 2) >> 2] + $127 * +HEAPF32[$115 + ($45 << 2) >> 2]); + } + return +(0.0); +} + +function _arLabelingSubDWIC($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0360 = 0, $$0361 = 0, $$0363 = 0, $$0365 = 0, $$0369 = 0, $$0373 = 0, $$0376 = 0, $$0381 = 0, $$1 = 0, $$1362 = 0, $$1364 = 0, $$1366 = 0, $$1370 = 0, $$1374 = 0, $$1377 = 0, $$1382 = 0, $$2 = 0, $$2367 = 0, $$2371 = 0, $$2375 = 0, $$2378 = 0, $$2383 = 0, $$3 = 0, $$3368 = 0, $$3372 = 0, $$3379 = 0, $$4 = 0, $$4380 = 0, $$5 = 0, $$6 = 0, $103 = 0, $106 = 0, $121 = 0, $123 = 0, $125 = 0, $129 = 0, $133 = 0, $136 = 0, $138 = 0, $142 = 0, $146 = 0, $15 = 0, $150 = 0, $155 = 0, $157 = 0, $161 = 0, $165 = 0, $169 = 0, $175 = 0, $178 = 0, $180 = 0, $184 = 0, $188 = 0, $192 = 0, $195 = 0, $200 = 0, $21 = 0, $221 = 0, $223 = 0, $229 = 0, $232 = 0, $233 = 0, $239 = 0, $251 = 0, $252 = 0, $255 = 0, $262 = 0, $263 = 0, $27 = 0, $271 = 0, $274 = 0, $275 = 0, $279 = 0, $282 = 0, $286 = 0, $289 = 0, $293 = 0, $296 = 0, $300 = 0, $303 = 0, $307 = 0.0, $308 = 0, $309 = 0, $313 = 0, $33 = 0, $34 = 0, $37 = 0, $39 = 0, $43 = 0, $47 = 0, $5 = 0, $53 = 0, $54 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $62 = 0, $65 = 0, $7 = 0, $8 = 0, $80 = 0, $82 = 0, $84 = 0, $88 = 0, $92 = 0, $98 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $5 = ($1 | 0) / 2 | 0; + $6 = ($2 | 0) / 2 | 0; + $7 = HEAP32[$4 >> 2] | 0; + $8 = $6 + -1 | 0; + $$0361 = $7; + $$0363 = $7 + ((Math_imul($8, $5) | 0) << 1) | 0; + $$0376 = 0; + while (1) { + if (($$0376 | 0) >= ($5 | 0)) break; + HEAP16[$$0363 >> 1] = 0; + HEAP16[$$0361 >> 1] = 0; + $$0361 = $$0361 + 2 | 0; + $$0363 = $$0363 + 2 | 0; + $$0376 = $$0376 + 1 | 0; + } + $15 = $5 + -1 | 0; + $$1362 = $7; + $$1364 = $7 + ($15 << 1) | 0; + $$1377 = 0; + while (1) { + if (($$1377 | 0) >= ($6 | 0)) break; + HEAP16[$$1364 >> 1] = 0; + HEAP16[$$1362 >> 1] = 0; + $$1362 = $$1362 + ($5 << 1) | 0; + $$1364 = $$1364 + ($5 << 1) | 0; + $$1377 = $$1377 + 1 | 0; + } + $21 = $4 + 1179664 | 0; + $27 = 0 - $5 | 0; + $$0360 = $0 + (($1 << 1) + 2) | 0; + $$0373 = 1; + $$0381 = 0; + $$2 = $7 + ($5 + 1 << 1) | 0; + L9 : while (1) { + if (($$0373 | 0) >= ($8 | 0)) { + label = 59; + break; + } + $$1 = $$0360; + $$1382 = $$0381; + $$2378 = 1; + $$3 = $$2; + while (1) { + if (($$2378 | 0) >= ($15 | 0)) break; + do if ((HEAPU8[$$1 >> 0] | 0 | 0) > ($3 | 0)) { + $33 = $$3 + ($27 << 1) | 0; + $34 = HEAP16[$33 >> 1] | 0; + if ($34 << 16 >> 16 > 0) { + HEAP16[$$3 >> 1] = $34; + $37 = ($34 << 16 >> 16) * 7 | 0; + $39 = $4 + 1310736 + ($37 + -7 << 2) | 0; + HEAP32[$39 >> 2] = (HEAP32[$39 >> 2] | 0) + 1; + $43 = $4 + 1310736 + ($37 + -6 << 2) | 0; + HEAP32[$43 >> 2] = (HEAP32[$43 >> 2] | 0) + $$2378; + $47 = $4 + 1310736 + ($37 + -5 << 2) | 0; + HEAP32[$47 >> 2] = (HEAP32[$47 >> 2] | 0) + $$0373; + HEAP32[$4 + 1310736 + ($37 + -1 << 2) >> 2] = $$0373; + $$2383 = $$1382; + break; + } + $53 = HEAP16[$33 + 2 >> 1] | 0; + $54 = $53 << 16 >> 16; + $57 = HEAP16[$33 + -2 >> 1] | 0; + $58 = $57 << 16 >> 16; + $59 = $57 << 16 >> 16 > 0; + if ($53 << 16 >> 16 <= 0) { + if ($59) { + HEAP16[$$3 >> 1] = $57; + $155 = $58 * 7 | 0; + $157 = $4 + 1310736 + ($155 + -7 << 2) | 0; + HEAP32[$157 >> 2] = (HEAP32[$157 >> 2] | 0) + 1; + $161 = $4 + 1310736 + ($155 + -6 << 2) | 0; + HEAP32[$161 >> 2] = (HEAP32[$161 >> 2] | 0) + $$2378; + $165 = $4 + 1310736 + ($155 + -5 << 2) | 0; + HEAP32[$165 >> 2] = (HEAP32[$165 >> 2] | 0) + $$0373; + $169 = $4 + 1310736 + ($155 + -3 << 2) | 0; + if ((HEAP32[$169 >> 2] | 0) < ($$2378 | 0)) HEAP32[$169 >> 2] = $$2378; + HEAP32[$4 + 1310736 + ($155 + -1 << 2) >> 2] = $$0373; + $$2383 = $$1382; + break; + } + $175 = HEAP16[$$3 + -2 >> 1] | 0; + if ($175 << 16 >> 16 > 0) { + HEAP16[$$3 >> 1] = $175; + $178 = ($175 << 16 >> 16) * 7 | 0; + $180 = $4 + 1310736 + ($178 + -7 << 2) | 0; + HEAP32[$180 >> 2] = (HEAP32[$180 >> 2] | 0) + 1; + $184 = $4 + 1310736 + ($178 + -6 << 2) | 0; + HEAP32[$184 >> 2] = (HEAP32[$184 >> 2] | 0) + $$2378; + $188 = $4 + 1310736 + ($178 + -5 << 2) | 0; + HEAP32[$188 >> 2] = (HEAP32[$188 >> 2] | 0) + $$0373; + $192 = $4 + 1310736 + ($178 + -3 << 2) | 0; + if ((HEAP32[$192 >> 2] | 0) >= ($$2378 | 0)) { + $$2383 = $$1382; + break; + } + HEAP32[$192 >> 2] = $$2378; + $$2383 = $$1382; + break; + } else { + $195 = $$1382 + 1 | 0; + if (($$1382 | 0) > 32767) { + label = 54; + break L9; + } + HEAP16[$$3 >> 1] = $195; + HEAP32[$4 + 1179664 + ($$1382 << 2) >> 2] = $195 << 16 >> 16; + $200 = $$1382 * 7 | 0; + HEAP32[$4 + 1310736 + ($200 << 2) >> 2] = 1; + HEAP32[$4 + 1310736 + ($200 + 1 << 2) >> 2] = $$2378; + HEAP32[$4 + 1310736 + ($200 + 2 << 2) >> 2] = $$0373; + HEAP32[$4 + 1310736 + ($200 + 3 << 2) >> 2] = $$2378; + HEAP32[$4 + 1310736 + ($200 + 4 << 2) >> 2] = $$2378; + HEAP32[$4 + 1310736 + ($200 + 5 << 2) >> 2] = $$0373; + HEAP32[$4 + 1310736 + ($200 + 6 << 2) >> 2] = $$0373; + $$2383 = $195; + break; + } + } + if ($59) { + $62 = HEAP32[$4 + 1179664 + ($54 + -1 << 2) >> 2] | 0; + $65 = HEAP32[$4 + 1179664 + ($58 + -1 << 2) >> 2] | 0; + L36 : do if (($62 | 0) <= ($65 | 0)) { + HEAP16[$$3 >> 1] = $62; + if (($62 | 0) < ($65 | 0)) { + $$1366 = $21; + $$1370 = 0; + while (1) { + if (($$1370 | 0) >= ($$1382 | 0)) { + $80 = $62; + break L36; + } + if ((HEAP32[$$1366 >> 2] | 0) == ($65 | 0)) HEAP32[$$1366 >> 2] = $62; + $$1366 = $$1366 + 4 | 0; + $$1370 = $$1370 + 1 | 0; + } + } else $80 = $62; + } else { + HEAP16[$$3 >> 1] = $65; + $$0365 = $21; + $$0369 = 0; + while (1) { + if (($$0369 | 0) >= ($$1382 | 0)) { + $80 = $65; + break L36; + } + if ((HEAP32[$$0365 >> 2] | 0) == ($62 | 0)) HEAP32[$$0365 >> 2] = $65; + $$0365 = $$0365 + 4 | 0; + $$0369 = $$0369 + 1 | 0; + } + } while (0); + $82 = ($80 << 16 >> 16) * 7 | 0; + $84 = $4 + 1310736 + ($82 + -7 << 2) | 0; + HEAP32[$84 >> 2] = (HEAP32[$84 >> 2] | 0) + 1; + $88 = $4 + 1310736 + ($82 + -6 << 2) | 0; + HEAP32[$88 >> 2] = (HEAP32[$88 >> 2] | 0) + $$2378; + $92 = $4 + 1310736 + ($82 + -5 << 2) | 0; + HEAP32[$92 >> 2] = (HEAP32[$92 >> 2] | 0) + $$0373; + HEAP32[$4 + 1310736 + ($82 + -1 << 2) >> 2] = $$0373; + $$2383 = $$1382; + break; + } + $98 = HEAP16[$$3 + -2 >> 1] | 0; + if ($98 << 16 >> 16 <= 0) { + HEAP16[$$3 >> 1] = $53; + $136 = $54 * 7 | 0; + $138 = $4 + 1310736 + ($136 + -7 << 2) | 0; + HEAP32[$138 >> 2] = (HEAP32[$138 >> 2] | 0) + 1; + $142 = $4 + 1310736 + ($136 + -6 << 2) | 0; + HEAP32[$142 >> 2] = (HEAP32[$142 >> 2] | 0) + $$2378; + $146 = $4 + 1310736 + ($136 + -5 << 2) | 0; + HEAP32[$146 >> 2] = (HEAP32[$146 >> 2] | 0) + $$0373; + $150 = $4 + 1310736 + ($136 + -4 << 2) | 0; + if ((HEAP32[$150 >> 2] | 0) > ($$2378 | 0)) HEAP32[$150 >> 2] = $$2378; + HEAP32[$4 + 1310736 + ($136 + -1 << 2) >> 2] = $$0373; + $$2383 = $$1382; + break; + } + $103 = HEAP32[$4 + 1179664 + ($54 + -1 << 2) >> 2] | 0; + $106 = HEAP32[$4 + 1179664 + (($98 << 16 >> 16) + -1 << 2) >> 2] | 0; + L60 : do if (($103 | 0) <= ($106 | 0)) { + HEAP16[$$3 >> 1] = $103; + if (($103 | 0) < ($106 | 0)) { + $$3368 = $21; + $$3372 = 0; + while (1) { + if (($$3372 | 0) >= ($$1382 | 0)) { + $121 = $103; + break L60; + } + if ((HEAP32[$$3368 >> 2] | 0) == ($106 | 0)) HEAP32[$$3368 >> 2] = $103; + $$3368 = $$3368 + 4 | 0; + $$3372 = $$3372 + 1 | 0; + } + } else $121 = $103; + } else { + HEAP16[$$3 >> 1] = $106; + $$2367 = $21; + $$2371 = 0; + while (1) { + if (($$2371 | 0) >= ($$1382 | 0)) { + $121 = $106; + break L60; + } + if ((HEAP32[$$2367 >> 2] | 0) == ($103 | 0)) HEAP32[$$2367 >> 2] = $106; + $$2367 = $$2367 + 4 | 0; + $$2371 = $$2371 + 1 | 0; + } + } while (0); + $123 = ($121 << 16 >> 16) * 7 | 0; + $125 = $4 + 1310736 + ($123 + -7 << 2) | 0; + HEAP32[$125 >> 2] = (HEAP32[$125 >> 2] | 0) + 1; + $129 = $4 + 1310736 + ($123 + -6 << 2) | 0; + HEAP32[$129 >> 2] = (HEAP32[$129 >> 2] | 0) + $$2378; + $133 = $4 + 1310736 + ($123 + -5 << 2) | 0; + HEAP32[$133 >> 2] = (HEAP32[$133 >> 2] | 0) + $$0373; + $$2383 = $$1382; + } else { + HEAP16[$$3 >> 1] = 0; + $$2383 = $$1382; + } while (0); + $$1 = $$1 + 2 | 0; + $$1382 = $$2383; + $$2378 = $$2378 + 1 | 0; + $$3 = $$3 + 2 | 0; + } + $$0360 = $$1 + $1 + 4 | 0; + $$0373 = $$0373 + 1 | 0; + $$0381 = $$1382; + $$2 = $$3 + 4 | 0; + } + L80 : do if ((label | 0) == 54) { + _arLog(0, 3, 23780, $vararg_buffer); + $$0 = -1; + } else if ((label | 0) == 59) { + $221 = $4 + 12 | 0; + $$1374 = 1; + $$3379 = 1; + $$4 = $21; + while (1) { + if (($$3379 | 0) > ($$0381 | 0)) break; + $223 = HEAP32[$$4 >> 2] | 0; + if (($223 | 0) == ($$3379 | 0)) { + $$2375 = $$1374 + 1 | 0; + $229 = $$1374; + } else { + $$2375 = $$1374; + $229 = HEAP32[$4 + 1179664 + ($223 + -1 << 2) >> 2] | 0; + } + HEAP32[$$4 >> 2] = $229; + $$1374 = $$2375; + $$3379 = $$3379 + 1 | 0; + $$4 = $$4 + 4 | 0; + } + $232 = $4 + 8 | 0; + $233 = $$1374 + -1 | 0; + HEAP32[$232 >> 2] = $233; + if (!$233) $$0 = 0; else { + _memset($221 | 0, 0, $233 << 2 | 0) | 0; + _memset($4 + 655376 | 0, 0, $233 << 4 | 0) | 0; + $$4380 = 0; + while (1) { + if (($$4380 | 0) >= ($233 | 0)) break; + $239 = $$4380 << 2; + HEAP32[$4 + 131084 + ($239 << 2) >> 2] = $5; + HEAP32[$4 + 131084 + (($239 | 1) << 2) >> 2] = 0; + HEAP32[$4 + 131084 + (($239 | 2) << 2) >> 2] = $6; + HEAP32[$4 + 131084 + (($239 | 3) << 2) >> 2] = 0; + $$4380 = $$4380 + 1 | 0; + } + $$5 = 0; + while (1) { + if (($$5 | 0) >= ($$0381 | 0)) break; + $251 = (HEAP32[$4 + 1179664 + ($$5 << 2) >> 2] | 0) + -1 | 0; + $252 = $$5 * 7 | 0; + $255 = $4 + 12 + ($251 << 2) | 0; + HEAP32[$255 >> 2] = (HEAP32[$255 >> 2] | 0) + (HEAP32[$4 + 1310736 + ($252 << 2) >> 2] | 0); + $262 = $251 << 1; + $263 = $4 + 655376 + ($262 << 3) | 0; + HEAPF64[$263 >> 3] = +HEAPF64[$263 >> 3] + +(HEAP32[$4 + 1310736 + ($252 + 1 << 2) >> 2] | 0); + $271 = $4 + 655376 + (($262 | 1) << 3) | 0; + HEAPF64[$271 >> 3] = +HEAPF64[$271 >> 3] + +(HEAP32[$4 + 1310736 + ($252 + 2 << 2) >> 2] | 0); + $274 = $251 << 2; + $275 = $4 + 131084 + ($274 << 2) | 0; + $279 = HEAP32[$4 + 1310736 + ($252 + 3 << 2) >> 2] | 0; + if ((HEAP32[$275 >> 2] | 0) > ($279 | 0)) HEAP32[$275 >> 2] = $279; + $282 = $4 + 131084 + (($274 | 1) << 2) | 0; + $286 = HEAP32[$4 + 1310736 + ($252 + 4 << 2) >> 2] | 0; + if ((HEAP32[$282 >> 2] | 0) < ($286 | 0)) HEAP32[$282 >> 2] = $286; + $289 = $4 + 131084 + (($274 | 2) << 2) | 0; + $293 = HEAP32[$4 + 1310736 + ($252 + 5 << 2) >> 2] | 0; + if ((HEAP32[$289 >> 2] | 0) > ($293 | 0)) HEAP32[$289 >> 2] = $293; + $296 = $4 + 131084 + (($274 | 3) << 2) | 0; + $300 = HEAP32[$4 + 1310736 + ($252 + 6 << 2) >> 2] | 0; + if ((HEAP32[$296 >> 2] | 0) < ($300 | 0)) HEAP32[$296 >> 2] = $300; + $$5 = $$5 + 1 | 0; + } + $303 = HEAP32[$232 >> 2] | 0; + $$6 = 0; + while (1) { + if (($$6 | 0) >= ($303 | 0)) { + $$0 = 0; + break L80; + } + $307 = +(HEAP32[$4 + 12 + ($$6 << 2) >> 2] | 0); + $308 = $$6 << 1; + $309 = $4 + 655376 + ($308 << 3) | 0; + HEAPF64[$309 >> 3] = +HEAPF64[$309 >> 3] / $307; + $313 = $4 + 655376 + (($308 | 1) << 3) | 0; + HEAPF64[$313 >> 3] = +HEAPF64[$313 >> 3] / $307; + $$6 = $$6 + 1 | 0; + } + } + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function _arLabelingSubDBIC($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0360 = 0, $$0361 = 0, $$0363 = 0, $$0365 = 0, $$0369 = 0, $$0373 = 0, $$0376 = 0, $$0381 = 0, $$1 = 0, $$1362 = 0, $$1364 = 0, $$1366 = 0, $$1370 = 0, $$1374 = 0, $$1377 = 0, $$1382 = 0, $$2 = 0, $$2367 = 0, $$2371 = 0, $$2375 = 0, $$2378 = 0, $$2383 = 0, $$3 = 0, $$3368 = 0, $$3372 = 0, $$3379 = 0, $$4 = 0, $$4380 = 0, $$5 = 0, $$6 = 0, $103 = 0, $106 = 0, $121 = 0, $123 = 0, $125 = 0, $129 = 0, $133 = 0, $136 = 0, $138 = 0, $142 = 0, $146 = 0, $15 = 0, $150 = 0, $155 = 0, $157 = 0, $161 = 0, $165 = 0, $169 = 0, $175 = 0, $178 = 0, $180 = 0, $184 = 0, $188 = 0, $192 = 0, $195 = 0, $200 = 0, $21 = 0, $221 = 0, $223 = 0, $229 = 0, $232 = 0, $233 = 0, $239 = 0, $251 = 0, $252 = 0, $255 = 0, $262 = 0, $263 = 0, $27 = 0, $271 = 0, $274 = 0, $275 = 0, $279 = 0, $282 = 0, $286 = 0, $289 = 0, $293 = 0, $296 = 0, $300 = 0, $303 = 0, $307 = 0.0, $308 = 0, $309 = 0, $313 = 0, $33 = 0, $34 = 0, $37 = 0, $39 = 0, $43 = 0, $47 = 0, $5 = 0, $53 = 0, $54 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $62 = 0, $65 = 0, $7 = 0, $8 = 0, $80 = 0, $82 = 0, $84 = 0, $88 = 0, $92 = 0, $98 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $5 = ($1 | 0) / 2 | 0; + $6 = ($2 | 0) / 2 | 0; + $7 = HEAP32[$4 >> 2] | 0; + $8 = $6 + -1 | 0; + $$0361 = $7; + $$0363 = $7 + ((Math_imul($8, $5) | 0) << 1) | 0; + $$0376 = 0; + while (1) { + if (($$0376 | 0) >= ($5 | 0)) break; + HEAP16[$$0363 >> 1] = 0; + HEAP16[$$0361 >> 1] = 0; + $$0361 = $$0361 + 2 | 0; + $$0363 = $$0363 + 2 | 0; + $$0376 = $$0376 + 1 | 0; + } + $15 = $5 + -1 | 0; + $$1362 = $7; + $$1364 = $7 + ($15 << 1) | 0; + $$1377 = 0; + while (1) { + if (($$1377 | 0) >= ($6 | 0)) break; + HEAP16[$$1364 >> 1] = 0; + HEAP16[$$1362 >> 1] = 0; + $$1362 = $$1362 + ($5 << 1) | 0; + $$1364 = $$1364 + ($5 << 1) | 0; + $$1377 = $$1377 + 1 | 0; + } + $21 = $4 + 1179664 | 0; + $27 = 0 - $5 | 0; + $$0360 = $0 + (($1 << 1) + 2) | 0; + $$0373 = 1; + $$0381 = 0; + $$2 = $7 + ($5 + 1 << 1) | 0; + L9 : while (1) { + if (($$0373 | 0) >= ($8 | 0)) { + label = 59; + break; + } + $$1 = $$0360; + $$1382 = $$0381; + $$2378 = 1; + $$3 = $$2; + while (1) { + if (($$2378 | 0) >= ($15 | 0)) break; + do if ((HEAPU8[$$1 >> 0] | 0 | 0) > ($3 | 0)) { + HEAP16[$$3 >> 1] = 0; + $$2383 = $$1382; + } else { + $33 = $$3 + ($27 << 1) | 0; + $34 = HEAP16[$33 >> 1] | 0; + if ($34 << 16 >> 16 > 0) { + HEAP16[$$3 >> 1] = $34; + $37 = ($34 << 16 >> 16) * 7 | 0; + $39 = $4 + 1310736 + ($37 + -7 << 2) | 0; + HEAP32[$39 >> 2] = (HEAP32[$39 >> 2] | 0) + 1; + $43 = $4 + 1310736 + ($37 + -6 << 2) | 0; + HEAP32[$43 >> 2] = (HEAP32[$43 >> 2] | 0) + $$2378; + $47 = $4 + 1310736 + ($37 + -5 << 2) | 0; + HEAP32[$47 >> 2] = (HEAP32[$47 >> 2] | 0) + $$0373; + HEAP32[$4 + 1310736 + ($37 + -1 << 2) >> 2] = $$0373; + $$2383 = $$1382; + break; + } + $53 = HEAP16[$33 + 2 >> 1] | 0; + $54 = $53 << 16 >> 16; + $57 = HEAP16[$33 + -2 >> 1] | 0; + $58 = $57 << 16 >> 16; + $59 = $57 << 16 >> 16 > 0; + if ($53 << 16 >> 16 <= 0) { + if ($59) { + HEAP16[$$3 >> 1] = $57; + $155 = $58 * 7 | 0; + $157 = $4 + 1310736 + ($155 + -7 << 2) | 0; + HEAP32[$157 >> 2] = (HEAP32[$157 >> 2] | 0) + 1; + $161 = $4 + 1310736 + ($155 + -6 << 2) | 0; + HEAP32[$161 >> 2] = (HEAP32[$161 >> 2] | 0) + $$2378; + $165 = $4 + 1310736 + ($155 + -5 << 2) | 0; + HEAP32[$165 >> 2] = (HEAP32[$165 >> 2] | 0) + $$0373; + $169 = $4 + 1310736 + ($155 + -3 << 2) | 0; + if ((HEAP32[$169 >> 2] | 0) < ($$2378 | 0)) HEAP32[$169 >> 2] = $$2378; + HEAP32[$4 + 1310736 + ($155 + -1 << 2) >> 2] = $$0373; + $$2383 = $$1382; + break; + } + $175 = HEAP16[$$3 + -2 >> 1] | 0; + if ($175 << 16 >> 16 > 0) { + HEAP16[$$3 >> 1] = $175; + $178 = ($175 << 16 >> 16) * 7 | 0; + $180 = $4 + 1310736 + ($178 + -7 << 2) | 0; + HEAP32[$180 >> 2] = (HEAP32[$180 >> 2] | 0) + 1; + $184 = $4 + 1310736 + ($178 + -6 << 2) | 0; + HEAP32[$184 >> 2] = (HEAP32[$184 >> 2] | 0) + $$2378; + $188 = $4 + 1310736 + ($178 + -5 << 2) | 0; + HEAP32[$188 >> 2] = (HEAP32[$188 >> 2] | 0) + $$0373; + $192 = $4 + 1310736 + ($178 + -3 << 2) | 0; + if ((HEAP32[$192 >> 2] | 0) >= ($$2378 | 0)) { + $$2383 = $$1382; + break; + } + HEAP32[$192 >> 2] = $$2378; + $$2383 = $$1382; + break; + } else { + $195 = $$1382 + 1 | 0; + if (($$1382 | 0) > 32767) { + label = 54; + break L9; + } + HEAP16[$$3 >> 1] = $195; + HEAP32[$4 + 1179664 + ($$1382 << 2) >> 2] = $195 << 16 >> 16; + $200 = $$1382 * 7 | 0; + HEAP32[$4 + 1310736 + ($200 << 2) >> 2] = 1; + HEAP32[$4 + 1310736 + ($200 + 1 << 2) >> 2] = $$2378; + HEAP32[$4 + 1310736 + ($200 + 2 << 2) >> 2] = $$0373; + HEAP32[$4 + 1310736 + ($200 + 3 << 2) >> 2] = $$2378; + HEAP32[$4 + 1310736 + ($200 + 4 << 2) >> 2] = $$2378; + HEAP32[$4 + 1310736 + ($200 + 5 << 2) >> 2] = $$0373; + HEAP32[$4 + 1310736 + ($200 + 6 << 2) >> 2] = $$0373; + $$2383 = $195; + break; + } + } + if ($59) { + $62 = HEAP32[$4 + 1179664 + ($54 + -1 << 2) >> 2] | 0; + $65 = HEAP32[$4 + 1179664 + ($58 + -1 << 2) >> 2] | 0; + L37 : do if (($62 | 0) <= ($65 | 0)) { + HEAP16[$$3 >> 1] = $62; + if (($62 | 0) < ($65 | 0)) { + $$1366 = $21; + $$1370 = 0; + while (1) { + if (($$1370 | 0) >= ($$1382 | 0)) { + $80 = $62; + break L37; + } + if ((HEAP32[$$1366 >> 2] | 0) == ($65 | 0)) HEAP32[$$1366 >> 2] = $62; + $$1366 = $$1366 + 4 | 0; + $$1370 = $$1370 + 1 | 0; + } + } else $80 = $62; + } else { + HEAP16[$$3 >> 1] = $65; + $$0365 = $21; + $$0369 = 0; + while (1) { + if (($$0369 | 0) >= ($$1382 | 0)) { + $80 = $65; + break L37; + } + if ((HEAP32[$$0365 >> 2] | 0) == ($62 | 0)) HEAP32[$$0365 >> 2] = $65; + $$0365 = $$0365 + 4 | 0; + $$0369 = $$0369 + 1 | 0; + } + } while (0); + $82 = ($80 << 16 >> 16) * 7 | 0; + $84 = $4 + 1310736 + ($82 + -7 << 2) | 0; + HEAP32[$84 >> 2] = (HEAP32[$84 >> 2] | 0) + 1; + $88 = $4 + 1310736 + ($82 + -6 << 2) | 0; + HEAP32[$88 >> 2] = (HEAP32[$88 >> 2] | 0) + $$2378; + $92 = $4 + 1310736 + ($82 + -5 << 2) | 0; + HEAP32[$92 >> 2] = (HEAP32[$92 >> 2] | 0) + $$0373; + HEAP32[$4 + 1310736 + ($82 + -1 << 2) >> 2] = $$0373; + $$2383 = $$1382; + break; + } + $98 = HEAP16[$$3 + -2 >> 1] | 0; + if ($98 << 16 >> 16 <= 0) { + HEAP16[$$3 >> 1] = $53; + $136 = $54 * 7 | 0; + $138 = $4 + 1310736 + ($136 + -7 << 2) | 0; + HEAP32[$138 >> 2] = (HEAP32[$138 >> 2] | 0) + 1; + $142 = $4 + 1310736 + ($136 + -6 << 2) | 0; + HEAP32[$142 >> 2] = (HEAP32[$142 >> 2] | 0) + $$2378; + $146 = $4 + 1310736 + ($136 + -5 << 2) | 0; + HEAP32[$146 >> 2] = (HEAP32[$146 >> 2] | 0) + $$0373; + $150 = $4 + 1310736 + ($136 + -4 << 2) | 0; + if ((HEAP32[$150 >> 2] | 0) > ($$2378 | 0)) HEAP32[$150 >> 2] = $$2378; + HEAP32[$4 + 1310736 + ($136 + -1 << 2) >> 2] = $$0373; + $$2383 = $$1382; + break; + } + $103 = HEAP32[$4 + 1179664 + ($54 + -1 << 2) >> 2] | 0; + $106 = HEAP32[$4 + 1179664 + (($98 << 16 >> 16) + -1 << 2) >> 2] | 0; + L61 : do if (($103 | 0) <= ($106 | 0)) { + HEAP16[$$3 >> 1] = $103; + if (($103 | 0) < ($106 | 0)) { + $$3368 = $21; + $$3372 = 0; + while (1) { + if (($$3372 | 0) >= ($$1382 | 0)) { + $121 = $103; + break L61; + } + if ((HEAP32[$$3368 >> 2] | 0) == ($106 | 0)) HEAP32[$$3368 >> 2] = $103; + $$3368 = $$3368 + 4 | 0; + $$3372 = $$3372 + 1 | 0; + } + } else $121 = $103; + } else { + HEAP16[$$3 >> 1] = $106; + $$2367 = $21; + $$2371 = 0; + while (1) { + if (($$2371 | 0) >= ($$1382 | 0)) { + $121 = $106; + break L61; + } + if ((HEAP32[$$2367 >> 2] | 0) == ($103 | 0)) HEAP32[$$2367 >> 2] = $106; + $$2367 = $$2367 + 4 | 0; + $$2371 = $$2371 + 1 | 0; + } + } while (0); + $123 = ($121 << 16 >> 16) * 7 | 0; + $125 = $4 + 1310736 + ($123 + -7 << 2) | 0; + HEAP32[$125 >> 2] = (HEAP32[$125 >> 2] | 0) + 1; + $129 = $4 + 1310736 + ($123 + -6 << 2) | 0; + HEAP32[$129 >> 2] = (HEAP32[$129 >> 2] | 0) + $$2378; + $133 = $4 + 1310736 + ($123 + -5 << 2) | 0; + HEAP32[$133 >> 2] = (HEAP32[$133 >> 2] | 0) + $$0373; + $$2383 = $$1382; + } while (0); + $$1 = $$1 + 2 | 0; + $$1382 = $$2383; + $$2378 = $$2378 + 1 | 0; + $$3 = $$3 + 2 | 0; + } + $$0360 = $$1 + $1 + 4 | 0; + $$0373 = $$0373 + 1 | 0; + $$0381 = $$1382; + $$2 = $$3 + 4 | 0; + } + L80 : do if ((label | 0) == 54) { + _arLog(0, 3, 23780, $vararg_buffer); + $$0 = -1; + } else if ((label | 0) == 59) { + $221 = $4 + 12 | 0; + $$1374 = 1; + $$3379 = 1; + $$4 = $21; + while (1) { + if (($$3379 | 0) > ($$0381 | 0)) break; + $223 = HEAP32[$$4 >> 2] | 0; + if (($223 | 0) == ($$3379 | 0)) { + $$2375 = $$1374 + 1 | 0; + $229 = $$1374; + } else { + $$2375 = $$1374; + $229 = HEAP32[$4 + 1179664 + ($223 + -1 << 2) >> 2] | 0; + } + HEAP32[$$4 >> 2] = $229; + $$1374 = $$2375; + $$3379 = $$3379 + 1 | 0; + $$4 = $$4 + 4 | 0; + } + $232 = $4 + 8 | 0; + $233 = $$1374 + -1 | 0; + HEAP32[$232 >> 2] = $233; + if (!$233) $$0 = 0; else { + _memset($221 | 0, 0, $233 << 2 | 0) | 0; + _memset($4 + 655376 | 0, 0, $233 << 4 | 0) | 0; + $$4380 = 0; + while (1) { + if (($$4380 | 0) >= ($233 | 0)) break; + $239 = $$4380 << 2; + HEAP32[$4 + 131084 + ($239 << 2) >> 2] = $5; + HEAP32[$4 + 131084 + (($239 | 1) << 2) >> 2] = 0; + HEAP32[$4 + 131084 + (($239 | 2) << 2) >> 2] = $6; + HEAP32[$4 + 131084 + (($239 | 3) << 2) >> 2] = 0; + $$4380 = $$4380 + 1 | 0; + } + $$5 = 0; + while (1) { + if (($$5 | 0) >= ($$0381 | 0)) break; + $251 = (HEAP32[$4 + 1179664 + ($$5 << 2) >> 2] | 0) + -1 | 0; + $252 = $$5 * 7 | 0; + $255 = $4 + 12 + ($251 << 2) | 0; + HEAP32[$255 >> 2] = (HEAP32[$255 >> 2] | 0) + (HEAP32[$4 + 1310736 + ($252 << 2) >> 2] | 0); + $262 = $251 << 1; + $263 = $4 + 655376 + ($262 << 3) | 0; + HEAPF64[$263 >> 3] = +HEAPF64[$263 >> 3] + +(HEAP32[$4 + 1310736 + ($252 + 1 << 2) >> 2] | 0); + $271 = $4 + 655376 + (($262 | 1) << 3) | 0; + HEAPF64[$271 >> 3] = +HEAPF64[$271 >> 3] + +(HEAP32[$4 + 1310736 + ($252 + 2 << 2) >> 2] | 0); + $274 = $251 << 2; + $275 = $4 + 131084 + ($274 << 2) | 0; + $279 = HEAP32[$4 + 1310736 + ($252 + 3 << 2) >> 2] | 0; + if ((HEAP32[$275 >> 2] | 0) > ($279 | 0)) HEAP32[$275 >> 2] = $279; + $282 = $4 + 131084 + (($274 | 1) << 2) | 0; + $286 = HEAP32[$4 + 1310736 + ($252 + 4 << 2) >> 2] | 0; + if ((HEAP32[$282 >> 2] | 0) < ($286 | 0)) HEAP32[$282 >> 2] = $286; + $289 = $4 + 131084 + (($274 | 2) << 2) | 0; + $293 = HEAP32[$4 + 1310736 + ($252 + 5 << 2) >> 2] | 0; + if ((HEAP32[$289 >> 2] | 0) > ($293 | 0)) HEAP32[$289 >> 2] = $293; + $296 = $4 + 131084 + (($274 | 3) << 2) | 0; + $300 = HEAP32[$4 + 1310736 + ($252 + 6 << 2) >> 2] | 0; + if ((HEAP32[$296 >> 2] | 0) < ($300 | 0)) HEAP32[$296 >> 2] = $300; + $$5 = $$5 + 1 | 0; + } + $303 = HEAP32[$232 >> 2] | 0; + $$6 = 0; + while (1) { + if (($$6 | 0) >= ($303 | 0)) { + $$0 = 0; + break L80; + } + $307 = +(HEAP32[$4 + 12 + ($$6 << 2) >> 2] | 0); + $308 = $$6 << 1; + $309 = $4 + 655376 + ($308 << 3) | 0; + HEAPF64[$309 >> 3] = +HEAPF64[$309 >> 3] / $307; + $313 = $4 + 655376 + (($308 | 1) << 3) | 0; + HEAPF64[$313 >> 3] = +HEAPF64[$313 >> 3] / $307; + $$6 = $$6 + 1 | 0; + } + } + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function _arLabelingSubDWRC($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0358 = 0, $$0359 = 0, $$0361 = 0, $$0363 = 0, $$0367 = 0, $$0371 = 0, $$0374 = 0, $$0379 = 0, $$1 = 0, $$1360 = 0, $$1362 = 0, $$1364 = 0, $$1368 = 0, $$1372 = 0, $$1375 = 0, $$1380 = 0, $$2 = 0, $$2365 = 0, $$2369 = 0, $$2373 = 0, $$2376 = 0, $$2381 = 0, $$3 = 0, $$3366 = 0, $$3370 = 0, $$3377 = 0, $$4 = 0, $$4378 = 0, $$5 = 0, $$6 = 0, $102 = 0, $117 = 0, $119 = 0, $121 = 0, $125 = 0, $129 = 0, $13 = 0, $132 = 0, $134 = 0, $138 = 0, $142 = 0, $146 = 0, $151 = 0, $153 = 0, $157 = 0, $161 = 0, $165 = 0, $171 = 0, $174 = 0, $176 = 0, $180 = 0, $184 = 0, $188 = 0, $19 = 0, $191 = 0, $196 = 0, $20 = 0, $216 = 0, $218 = 0, $224 = 0, $227 = 0, $228 = 0, $23 = 0, $234 = 0, $246 = 0, $247 = 0, $250 = 0, $257 = 0, $258 = 0, $266 = 0, $269 = 0, $270 = 0, $274 = 0, $277 = 0, $281 = 0, $284 = 0, $288 = 0, $29 = 0, $291 = 0, $295 = 0, $298 = 0, $30 = 0, $302 = 0.0, $303 = 0, $304 = 0, $308 = 0, $33 = 0, $35 = 0, $39 = 0, $43 = 0, $49 = 0, $5 = 0, $50 = 0, $53 = 0, $54 = 0, $55 = 0, $58 = 0, $6 = 0, $61 = 0, $76 = 0, $78 = 0, $80 = 0, $84 = 0, $88 = 0, $94 = 0, $99 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $5 = HEAP32[$4 >> 2] | 0; + $6 = $2 + -1 | 0; + $$0359 = $5; + $$0361 = $5 + ((Math_imul($6, $1) | 0) << 1) | 0; + $$0374 = 0; + while (1) { + if (($$0374 | 0) >= ($1 | 0)) break; + HEAP16[$$0361 >> 1] = 0; + HEAP16[$$0359 >> 1] = 0; + $$0359 = $$0359 + 2 | 0; + $$0361 = $$0361 + 2 | 0; + $$0374 = $$0374 + 1 | 0; + } + $13 = $1 + -1 | 0; + $$1360 = $5; + $$1362 = $5 + ($13 << 1) | 0; + $$1375 = 0; + while (1) { + if (($$1375 | 0) >= ($2 | 0)) break; + HEAP16[$$1362 >> 1] = 0; + HEAP16[$$1360 >> 1] = 0; + $$1360 = $$1360 + ($1 << 1) | 0; + $$1362 = $$1362 + ($1 << 1) | 0; + $$1375 = $$1375 + 1 | 0; + } + $19 = $4 + 1179664 | 0; + $20 = $1 + 1 | 0; + $23 = 0 - $1 | 0; + $$0358 = $0 + $20 | 0; + $$0371 = 1; + $$0379 = 0; + $$2 = $5 + ($20 << 1) | 0; + L9 : while (1) { + if (($$0371 | 0) >= ($6 | 0)) { + label = 59; + break; + } + $$1 = $$0358; + $$1380 = $$0379; + $$2376 = 1; + $$3 = $$2; + while (1) { + if (($$2376 | 0) >= ($13 | 0)) break; + do if ((HEAPU8[$$1 >> 0] | 0 | 0) > ($3 | 0)) { + $29 = $$3 + ($23 << 1) | 0; + $30 = HEAP16[$29 >> 1] | 0; + if ($30 << 16 >> 16 > 0) { + HEAP16[$$3 >> 1] = $30; + $33 = ($30 << 16 >> 16) * 7 | 0; + $35 = $4 + 1310736 + ($33 + -7 << 2) | 0; + HEAP32[$35 >> 2] = (HEAP32[$35 >> 2] | 0) + 1; + $39 = $4 + 1310736 + ($33 + -6 << 2) | 0; + HEAP32[$39 >> 2] = (HEAP32[$39 >> 2] | 0) + $$2376; + $43 = $4 + 1310736 + ($33 + -5 << 2) | 0; + HEAP32[$43 >> 2] = (HEAP32[$43 >> 2] | 0) + $$0371; + HEAP32[$4 + 1310736 + ($33 + -1 << 2) >> 2] = $$0371; + $$2381 = $$1380; + break; + } + $49 = HEAP16[$29 + 2 >> 1] | 0; + $50 = $49 << 16 >> 16; + $53 = HEAP16[$29 + -2 >> 1] | 0; + $54 = $53 << 16 >> 16; + $55 = $53 << 16 >> 16 > 0; + if ($49 << 16 >> 16 <= 0) { + if ($55) { + HEAP16[$$3 >> 1] = $53; + $151 = $54 * 7 | 0; + $153 = $4 + 1310736 + ($151 + -7 << 2) | 0; + HEAP32[$153 >> 2] = (HEAP32[$153 >> 2] | 0) + 1; + $157 = $4 + 1310736 + ($151 + -6 << 2) | 0; + HEAP32[$157 >> 2] = (HEAP32[$157 >> 2] | 0) + $$2376; + $161 = $4 + 1310736 + ($151 + -5 << 2) | 0; + HEAP32[$161 >> 2] = (HEAP32[$161 >> 2] | 0) + $$0371; + $165 = $4 + 1310736 + ($151 + -3 << 2) | 0; + if ((HEAP32[$165 >> 2] | 0) < ($$2376 | 0)) HEAP32[$165 >> 2] = $$2376; + HEAP32[$4 + 1310736 + ($151 + -1 << 2) >> 2] = $$0371; + $$2381 = $$1380; + break; + } + $171 = HEAP16[$$3 + -2 >> 1] | 0; + if ($171 << 16 >> 16 > 0) { + HEAP16[$$3 >> 1] = $171; + $174 = ($171 << 16 >> 16) * 7 | 0; + $176 = $4 + 1310736 + ($174 + -7 << 2) | 0; + HEAP32[$176 >> 2] = (HEAP32[$176 >> 2] | 0) + 1; + $180 = $4 + 1310736 + ($174 + -6 << 2) | 0; + HEAP32[$180 >> 2] = (HEAP32[$180 >> 2] | 0) + $$2376; + $184 = $4 + 1310736 + ($174 + -5 << 2) | 0; + HEAP32[$184 >> 2] = (HEAP32[$184 >> 2] | 0) + $$0371; + $188 = $4 + 1310736 + ($174 + -3 << 2) | 0; + if ((HEAP32[$188 >> 2] | 0) >= ($$2376 | 0)) { + $$2381 = $$1380; + break; + } + HEAP32[$188 >> 2] = $$2376; + $$2381 = $$1380; + break; + } else { + $191 = $$1380 + 1 | 0; + if (($$1380 | 0) > 32767) { + label = 54; + break L9; + } + HEAP16[$$3 >> 1] = $191; + HEAP32[$4 + 1179664 + ($$1380 << 2) >> 2] = $191 << 16 >> 16; + $196 = $$1380 * 7 | 0; + HEAP32[$4 + 1310736 + ($196 << 2) >> 2] = 1; + HEAP32[$4 + 1310736 + ($196 + 1 << 2) >> 2] = $$2376; + HEAP32[$4 + 1310736 + ($196 + 2 << 2) >> 2] = $$0371; + HEAP32[$4 + 1310736 + ($196 + 3 << 2) >> 2] = $$2376; + HEAP32[$4 + 1310736 + ($196 + 4 << 2) >> 2] = $$2376; + HEAP32[$4 + 1310736 + ($196 + 5 << 2) >> 2] = $$0371; + HEAP32[$4 + 1310736 + ($196 + 6 << 2) >> 2] = $$0371; + $$2381 = $191; + break; + } + } + if ($55) { + $58 = HEAP32[$4 + 1179664 + ($50 + -1 << 2) >> 2] | 0; + $61 = HEAP32[$4 + 1179664 + ($54 + -1 << 2) >> 2] | 0; + L36 : do if (($58 | 0) <= ($61 | 0)) { + HEAP16[$$3 >> 1] = $58; + if (($58 | 0) < ($61 | 0)) { + $$1364 = $19; + $$1368 = 0; + while (1) { + if (($$1368 | 0) >= ($$1380 | 0)) { + $76 = $58; + break L36; + } + if ((HEAP32[$$1364 >> 2] | 0) == ($61 | 0)) HEAP32[$$1364 >> 2] = $58; + $$1364 = $$1364 + 4 | 0; + $$1368 = $$1368 + 1 | 0; + } + } else $76 = $58; + } else { + HEAP16[$$3 >> 1] = $61; + $$0363 = $19; + $$0367 = 0; + while (1) { + if (($$0367 | 0) >= ($$1380 | 0)) { + $76 = $61; + break L36; + } + if ((HEAP32[$$0363 >> 2] | 0) == ($58 | 0)) HEAP32[$$0363 >> 2] = $61; + $$0363 = $$0363 + 4 | 0; + $$0367 = $$0367 + 1 | 0; + } + } while (0); + $78 = ($76 << 16 >> 16) * 7 | 0; + $80 = $4 + 1310736 + ($78 + -7 << 2) | 0; + HEAP32[$80 >> 2] = (HEAP32[$80 >> 2] | 0) + 1; + $84 = $4 + 1310736 + ($78 + -6 << 2) | 0; + HEAP32[$84 >> 2] = (HEAP32[$84 >> 2] | 0) + $$2376; + $88 = $4 + 1310736 + ($78 + -5 << 2) | 0; + HEAP32[$88 >> 2] = (HEAP32[$88 >> 2] | 0) + $$0371; + HEAP32[$4 + 1310736 + ($78 + -1 << 2) >> 2] = $$0371; + $$2381 = $$1380; + break; + } + $94 = HEAP16[$$3 + -2 >> 1] | 0; + if ($94 << 16 >> 16 <= 0) { + HEAP16[$$3 >> 1] = $49; + $132 = $50 * 7 | 0; + $134 = $4 + 1310736 + ($132 + -7 << 2) | 0; + HEAP32[$134 >> 2] = (HEAP32[$134 >> 2] | 0) + 1; + $138 = $4 + 1310736 + ($132 + -6 << 2) | 0; + HEAP32[$138 >> 2] = (HEAP32[$138 >> 2] | 0) + $$2376; + $142 = $4 + 1310736 + ($132 + -5 << 2) | 0; + HEAP32[$142 >> 2] = (HEAP32[$142 >> 2] | 0) + $$0371; + $146 = $4 + 1310736 + ($132 + -4 << 2) | 0; + if ((HEAP32[$146 >> 2] | 0) > ($$2376 | 0)) HEAP32[$146 >> 2] = $$2376; + HEAP32[$4 + 1310736 + ($132 + -1 << 2) >> 2] = $$0371; + $$2381 = $$1380; + break; + } + $99 = HEAP32[$4 + 1179664 + ($50 + -1 << 2) >> 2] | 0; + $102 = HEAP32[$4 + 1179664 + (($94 << 16 >> 16) + -1 << 2) >> 2] | 0; + L60 : do if (($99 | 0) <= ($102 | 0)) { + HEAP16[$$3 >> 1] = $99; + if (($99 | 0) < ($102 | 0)) { + $$3366 = $19; + $$3370 = 0; + while (1) { + if (($$3370 | 0) >= ($$1380 | 0)) { + $117 = $99; + break L60; + } + if ((HEAP32[$$3366 >> 2] | 0) == ($102 | 0)) HEAP32[$$3366 >> 2] = $99; + $$3366 = $$3366 + 4 | 0; + $$3370 = $$3370 + 1 | 0; + } + } else $117 = $99; + } else { + HEAP16[$$3 >> 1] = $102; + $$2365 = $19; + $$2369 = 0; + while (1) { + if (($$2369 | 0) >= ($$1380 | 0)) { + $117 = $102; + break L60; + } + if ((HEAP32[$$2365 >> 2] | 0) == ($99 | 0)) HEAP32[$$2365 >> 2] = $102; + $$2365 = $$2365 + 4 | 0; + $$2369 = $$2369 + 1 | 0; + } + } while (0); + $119 = ($117 << 16 >> 16) * 7 | 0; + $121 = $4 + 1310736 + ($119 + -7 << 2) | 0; + HEAP32[$121 >> 2] = (HEAP32[$121 >> 2] | 0) + 1; + $125 = $4 + 1310736 + ($119 + -6 << 2) | 0; + HEAP32[$125 >> 2] = (HEAP32[$125 >> 2] | 0) + $$2376; + $129 = $4 + 1310736 + ($119 + -5 << 2) | 0; + HEAP32[$129 >> 2] = (HEAP32[$129 >> 2] | 0) + $$0371; + $$2381 = $$1380; + } else { + HEAP16[$$3 >> 1] = 0; + $$2381 = $$1380; + } while (0); + $$1 = $$1 + 1 | 0; + $$1380 = $$2381; + $$2376 = $$2376 + 1 | 0; + $$3 = $$3 + 2 | 0; + } + $$0358 = $$1 + 2 | 0; + $$0371 = $$0371 + 1 | 0; + $$0379 = $$1380; + $$2 = $$3 + 4 | 0; + } + L80 : do if ((label | 0) == 54) { + _arLog(0, 3, 23780, $vararg_buffer); + $$0 = -1; + } else if ((label | 0) == 59) { + $216 = $4 + 12 | 0; + $$1372 = 1; + $$3377 = 1; + $$4 = $19; + while (1) { + if (($$3377 | 0) > ($$0379 | 0)) break; + $218 = HEAP32[$$4 >> 2] | 0; + if (($218 | 0) == ($$3377 | 0)) { + $$2373 = $$1372 + 1 | 0; + $224 = $$1372; + } else { + $$2373 = $$1372; + $224 = HEAP32[$4 + 1179664 + ($218 + -1 << 2) >> 2] | 0; + } + HEAP32[$$4 >> 2] = $224; + $$1372 = $$2373; + $$3377 = $$3377 + 1 | 0; + $$4 = $$4 + 4 | 0; + } + $227 = $4 + 8 | 0; + $228 = $$1372 + -1 | 0; + HEAP32[$227 >> 2] = $228; + if (!$228) $$0 = 0; else { + _memset($216 | 0, 0, $228 << 2 | 0) | 0; + _memset($4 + 655376 | 0, 0, $228 << 4 | 0) | 0; + $$4378 = 0; + while (1) { + if (($$4378 | 0) >= ($228 | 0)) break; + $234 = $$4378 << 2; + HEAP32[$4 + 131084 + ($234 << 2) >> 2] = $1; + HEAP32[$4 + 131084 + (($234 | 1) << 2) >> 2] = 0; + HEAP32[$4 + 131084 + (($234 | 2) << 2) >> 2] = $2; + HEAP32[$4 + 131084 + (($234 | 3) << 2) >> 2] = 0; + $$4378 = $$4378 + 1 | 0; + } + $$5 = 0; + while (1) { + if (($$5 | 0) >= ($$0379 | 0)) break; + $246 = (HEAP32[$4 + 1179664 + ($$5 << 2) >> 2] | 0) + -1 | 0; + $247 = $$5 * 7 | 0; + $250 = $4 + 12 + ($246 << 2) | 0; + HEAP32[$250 >> 2] = (HEAP32[$250 >> 2] | 0) + (HEAP32[$4 + 1310736 + ($247 << 2) >> 2] | 0); + $257 = $246 << 1; + $258 = $4 + 655376 + ($257 << 3) | 0; + HEAPF64[$258 >> 3] = +HEAPF64[$258 >> 3] + +(HEAP32[$4 + 1310736 + ($247 + 1 << 2) >> 2] | 0); + $266 = $4 + 655376 + (($257 | 1) << 3) | 0; + HEAPF64[$266 >> 3] = +HEAPF64[$266 >> 3] + +(HEAP32[$4 + 1310736 + ($247 + 2 << 2) >> 2] | 0); + $269 = $246 << 2; + $270 = $4 + 131084 + ($269 << 2) | 0; + $274 = HEAP32[$4 + 1310736 + ($247 + 3 << 2) >> 2] | 0; + if ((HEAP32[$270 >> 2] | 0) > ($274 | 0)) HEAP32[$270 >> 2] = $274; + $277 = $4 + 131084 + (($269 | 1) << 2) | 0; + $281 = HEAP32[$4 + 1310736 + ($247 + 4 << 2) >> 2] | 0; + if ((HEAP32[$277 >> 2] | 0) < ($281 | 0)) HEAP32[$277 >> 2] = $281; + $284 = $4 + 131084 + (($269 | 2) << 2) | 0; + $288 = HEAP32[$4 + 1310736 + ($247 + 5 << 2) >> 2] | 0; + if ((HEAP32[$284 >> 2] | 0) > ($288 | 0)) HEAP32[$284 >> 2] = $288; + $291 = $4 + 131084 + (($269 | 3) << 2) | 0; + $295 = HEAP32[$4 + 1310736 + ($247 + 6 << 2) >> 2] | 0; + if ((HEAP32[$291 >> 2] | 0) < ($295 | 0)) HEAP32[$291 >> 2] = $295; + $$5 = $$5 + 1 | 0; + } + $298 = HEAP32[$227 >> 2] | 0; + $$6 = 0; + while (1) { + if (($$6 | 0) >= ($298 | 0)) { + $$0 = 0; + break L80; + } + $302 = +(HEAP32[$4 + 12 + ($$6 << 2) >> 2] | 0); + $303 = $$6 << 1; + $304 = $4 + 655376 + ($303 << 3) | 0; + HEAPF64[$304 >> 3] = +HEAPF64[$304 >> 3] / $302; + $308 = $4 + 655376 + (($303 | 1) << 3) | 0; + HEAPF64[$308 >> 3] = +HEAPF64[$308 >> 3] / $302; + $$6 = $$6 + 1 | 0; + } + } + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function _arLabelingSubDBRC($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0358 = 0, $$0359 = 0, $$0361 = 0, $$0363 = 0, $$0367 = 0, $$0371 = 0, $$0374 = 0, $$0379 = 0, $$1 = 0, $$1360 = 0, $$1362 = 0, $$1364 = 0, $$1368 = 0, $$1372 = 0, $$1375 = 0, $$1380 = 0, $$2 = 0, $$2365 = 0, $$2369 = 0, $$2373 = 0, $$2376 = 0, $$2381 = 0, $$3 = 0, $$3366 = 0, $$3370 = 0, $$3377 = 0, $$4 = 0, $$4378 = 0, $$5 = 0, $$6 = 0, $102 = 0, $117 = 0, $119 = 0, $121 = 0, $125 = 0, $129 = 0, $13 = 0, $132 = 0, $134 = 0, $138 = 0, $142 = 0, $146 = 0, $151 = 0, $153 = 0, $157 = 0, $161 = 0, $165 = 0, $171 = 0, $174 = 0, $176 = 0, $180 = 0, $184 = 0, $188 = 0, $19 = 0, $191 = 0, $196 = 0, $20 = 0, $216 = 0, $218 = 0, $224 = 0, $227 = 0, $228 = 0, $23 = 0, $234 = 0, $246 = 0, $247 = 0, $250 = 0, $257 = 0, $258 = 0, $266 = 0, $269 = 0, $270 = 0, $274 = 0, $277 = 0, $281 = 0, $284 = 0, $288 = 0, $29 = 0, $291 = 0, $295 = 0, $298 = 0, $30 = 0, $302 = 0.0, $303 = 0, $304 = 0, $308 = 0, $33 = 0, $35 = 0, $39 = 0, $43 = 0, $49 = 0, $5 = 0, $50 = 0, $53 = 0, $54 = 0, $55 = 0, $58 = 0, $6 = 0, $61 = 0, $76 = 0, $78 = 0, $80 = 0, $84 = 0, $88 = 0, $94 = 0, $99 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $5 = HEAP32[$4 >> 2] | 0; + $6 = $2 + -1 | 0; + $$0359 = $5; + $$0361 = $5 + ((Math_imul($6, $1) | 0) << 1) | 0; + $$0374 = 0; + while (1) { + if (($$0374 | 0) >= ($1 | 0)) break; + HEAP16[$$0361 >> 1] = 0; + HEAP16[$$0359 >> 1] = 0; + $$0359 = $$0359 + 2 | 0; + $$0361 = $$0361 + 2 | 0; + $$0374 = $$0374 + 1 | 0; + } + $13 = $1 + -1 | 0; + $$1360 = $5; + $$1362 = $5 + ($13 << 1) | 0; + $$1375 = 0; + while (1) { + if (($$1375 | 0) >= ($2 | 0)) break; + HEAP16[$$1362 >> 1] = 0; + HEAP16[$$1360 >> 1] = 0; + $$1360 = $$1360 + ($1 << 1) | 0; + $$1362 = $$1362 + ($1 << 1) | 0; + $$1375 = $$1375 + 1 | 0; + } + $19 = $4 + 1179664 | 0; + $20 = $1 + 1 | 0; + $23 = 0 - $1 | 0; + $$0358 = $0 + $20 | 0; + $$0371 = 1; + $$0379 = 0; + $$2 = $5 + ($20 << 1) | 0; + L9 : while (1) { + if (($$0371 | 0) >= ($6 | 0)) { + label = 59; + break; + } + $$1 = $$0358; + $$1380 = $$0379; + $$2376 = 1; + $$3 = $$2; + while (1) { + if (($$2376 | 0) >= ($13 | 0)) break; + do if ((HEAPU8[$$1 >> 0] | 0 | 0) > ($3 | 0)) { + HEAP16[$$3 >> 1] = 0; + $$2381 = $$1380; + } else { + $29 = $$3 + ($23 << 1) | 0; + $30 = HEAP16[$29 >> 1] | 0; + if ($30 << 16 >> 16 > 0) { + HEAP16[$$3 >> 1] = $30; + $33 = ($30 << 16 >> 16) * 7 | 0; + $35 = $4 + 1310736 + ($33 + -7 << 2) | 0; + HEAP32[$35 >> 2] = (HEAP32[$35 >> 2] | 0) + 1; + $39 = $4 + 1310736 + ($33 + -6 << 2) | 0; + HEAP32[$39 >> 2] = (HEAP32[$39 >> 2] | 0) + $$2376; + $43 = $4 + 1310736 + ($33 + -5 << 2) | 0; + HEAP32[$43 >> 2] = (HEAP32[$43 >> 2] | 0) + $$0371; + HEAP32[$4 + 1310736 + ($33 + -1 << 2) >> 2] = $$0371; + $$2381 = $$1380; + break; + } + $49 = HEAP16[$29 + 2 >> 1] | 0; + $50 = $49 << 16 >> 16; + $53 = HEAP16[$29 + -2 >> 1] | 0; + $54 = $53 << 16 >> 16; + $55 = $53 << 16 >> 16 > 0; + if ($49 << 16 >> 16 <= 0) { + if ($55) { + HEAP16[$$3 >> 1] = $53; + $151 = $54 * 7 | 0; + $153 = $4 + 1310736 + ($151 + -7 << 2) | 0; + HEAP32[$153 >> 2] = (HEAP32[$153 >> 2] | 0) + 1; + $157 = $4 + 1310736 + ($151 + -6 << 2) | 0; + HEAP32[$157 >> 2] = (HEAP32[$157 >> 2] | 0) + $$2376; + $161 = $4 + 1310736 + ($151 + -5 << 2) | 0; + HEAP32[$161 >> 2] = (HEAP32[$161 >> 2] | 0) + $$0371; + $165 = $4 + 1310736 + ($151 + -3 << 2) | 0; + if ((HEAP32[$165 >> 2] | 0) < ($$2376 | 0)) HEAP32[$165 >> 2] = $$2376; + HEAP32[$4 + 1310736 + ($151 + -1 << 2) >> 2] = $$0371; + $$2381 = $$1380; + break; + } + $171 = HEAP16[$$3 + -2 >> 1] | 0; + if ($171 << 16 >> 16 > 0) { + HEAP16[$$3 >> 1] = $171; + $174 = ($171 << 16 >> 16) * 7 | 0; + $176 = $4 + 1310736 + ($174 + -7 << 2) | 0; + HEAP32[$176 >> 2] = (HEAP32[$176 >> 2] | 0) + 1; + $180 = $4 + 1310736 + ($174 + -6 << 2) | 0; + HEAP32[$180 >> 2] = (HEAP32[$180 >> 2] | 0) + $$2376; + $184 = $4 + 1310736 + ($174 + -5 << 2) | 0; + HEAP32[$184 >> 2] = (HEAP32[$184 >> 2] | 0) + $$0371; + $188 = $4 + 1310736 + ($174 + -3 << 2) | 0; + if ((HEAP32[$188 >> 2] | 0) >= ($$2376 | 0)) { + $$2381 = $$1380; + break; + } + HEAP32[$188 >> 2] = $$2376; + $$2381 = $$1380; + break; + } else { + $191 = $$1380 + 1 | 0; + if (($$1380 | 0) > 32767) { + label = 54; + break L9; + } + HEAP16[$$3 >> 1] = $191; + HEAP32[$4 + 1179664 + ($$1380 << 2) >> 2] = $191 << 16 >> 16; + $196 = $$1380 * 7 | 0; + HEAP32[$4 + 1310736 + ($196 << 2) >> 2] = 1; + HEAP32[$4 + 1310736 + ($196 + 1 << 2) >> 2] = $$2376; + HEAP32[$4 + 1310736 + ($196 + 2 << 2) >> 2] = $$0371; + HEAP32[$4 + 1310736 + ($196 + 3 << 2) >> 2] = $$2376; + HEAP32[$4 + 1310736 + ($196 + 4 << 2) >> 2] = $$2376; + HEAP32[$4 + 1310736 + ($196 + 5 << 2) >> 2] = $$0371; + HEAP32[$4 + 1310736 + ($196 + 6 << 2) >> 2] = $$0371; + $$2381 = $191; + break; + } + } + if ($55) { + $58 = HEAP32[$4 + 1179664 + ($50 + -1 << 2) >> 2] | 0; + $61 = HEAP32[$4 + 1179664 + ($54 + -1 << 2) >> 2] | 0; + L37 : do if (($58 | 0) <= ($61 | 0)) { + HEAP16[$$3 >> 1] = $58; + if (($58 | 0) < ($61 | 0)) { + $$1364 = $19; + $$1368 = 0; + while (1) { + if (($$1368 | 0) >= ($$1380 | 0)) { + $76 = $58; + break L37; + } + if ((HEAP32[$$1364 >> 2] | 0) == ($61 | 0)) HEAP32[$$1364 >> 2] = $58; + $$1364 = $$1364 + 4 | 0; + $$1368 = $$1368 + 1 | 0; + } + } else $76 = $58; + } else { + HEAP16[$$3 >> 1] = $61; + $$0363 = $19; + $$0367 = 0; + while (1) { + if (($$0367 | 0) >= ($$1380 | 0)) { + $76 = $61; + break L37; + } + if ((HEAP32[$$0363 >> 2] | 0) == ($58 | 0)) HEAP32[$$0363 >> 2] = $61; + $$0363 = $$0363 + 4 | 0; + $$0367 = $$0367 + 1 | 0; + } + } while (0); + $78 = ($76 << 16 >> 16) * 7 | 0; + $80 = $4 + 1310736 + ($78 + -7 << 2) | 0; + HEAP32[$80 >> 2] = (HEAP32[$80 >> 2] | 0) + 1; + $84 = $4 + 1310736 + ($78 + -6 << 2) | 0; + HEAP32[$84 >> 2] = (HEAP32[$84 >> 2] | 0) + $$2376; + $88 = $4 + 1310736 + ($78 + -5 << 2) | 0; + HEAP32[$88 >> 2] = (HEAP32[$88 >> 2] | 0) + $$0371; + HEAP32[$4 + 1310736 + ($78 + -1 << 2) >> 2] = $$0371; + $$2381 = $$1380; + break; + } + $94 = HEAP16[$$3 + -2 >> 1] | 0; + if ($94 << 16 >> 16 <= 0) { + HEAP16[$$3 >> 1] = $49; + $132 = $50 * 7 | 0; + $134 = $4 + 1310736 + ($132 + -7 << 2) | 0; + HEAP32[$134 >> 2] = (HEAP32[$134 >> 2] | 0) + 1; + $138 = $4 + 1310736 + ($132 + -6 << 2) | 0; + HEAP32[$138 >> 2] = (HEAP32[$138 >> 2] | 0) + $$2376; + $142 = $4 + 1310736 + ($132 + -5 << 2) | 0; + HEAP32[$142 >> 2] = (HEAP32[$142 >> 2] | 0) + $$0371; + $146 = $4 + 1310736 + ($132 + -4 << 2) | 0; + if ((HEAP32[$146 >> 2] | 0) > ($$2376 | 0)) HEAP32[$146 >> 2] = $$2376; + HEAP32[$4 + 1310736 + ($132 + -1 << 2) >> 2] = $$0371; + $$2381 = $$1380; + break; + } + $99 = HEAP32[$4 + 1179664 + ($50 + -1 << 2) >> 2] | 0; + $102 = HEAP32[$4 + 1179664 + (($94 << 16 >> 16) + -1 << 2) >> 2] | 0; + L61 : do if (($99 | 0) <= ($102 | 0)) { + HEAP16[$$3 >> 1] = $99; + if (($99 | 0) < ($102 | 0)) { + $$3366 = $19; + $$3370 = 0; + while (1) { + if (($$3370 | 0) >= ($$1380 | 0)) { + $117 = $99; + break L61; + } + if ((HEAP32[$$3366 >> 2] | 0) == ($102 | 0)) HEAP32[$$3366 >> 2] = $99; + $$3366 = $$3366 + 4 | 0; + $$3370 = $$3370 + 1 | 0; + } + } else $117 = $99; + } else { + HEAP16[$$3 >> 1] = $102; + $$2365 = $19; + $$2369 = 0; + while (1) { + if (($$2369 | 0) >= ($$1380 | 0)) { + $117 = $102; + break L61; + } + if ((HEAP32[$$2365 >> 2] | 0) == ($99 | 0)) HEAP32[$$2365 >> 2] = $102; + $$2365 = $$2365 + 4 | 0; + $$2369 = $$2369 + 1 | 0; + } + } while (0); + $119 = ($117 << 16 >> 16) * 7 | 0; + $121 = $4 + 1310736 + ($119 + -7 << 2) | 0; + HEAP32[$121 >> 2] = (HEAP32[$121 >> 2] | 0) + 1; + $125 = $4 + 1310736 + ($119 + -6 << 2) | 0; + HEAP32[$125 >> 2] = (HEAP32[$125 >> 2] | 0) + $$2376; + $129 = $4 + 1310736 + ($119 + -5 << 2) | 0; + HEAP32[$129 >> 2] = (HEAP32[$129 >> 2] | 0) + $$0371; + $$2381 = $$1380; + } while (0); + $$1 = $$1 + 1 | 0; + $$1380 = $$2381; + $$2376 = $$2376 + 1 | 0; + $$3 = $$3 + 2 | 0; + } + $$0358 = $$1 + 2 | 0; + $$0371 = $$0371 + 1 | 0; + $$0379 = $$1380; + $$2 = $$3 + 4 | 0; + } + L80 : do if ((label | 0) == 54) { + _arLog(0, 3, 23780, $vararg_buffer); + $$0 = -1; + } else if ((label | 0) == 59) { + $216 = $4 + 12 | 0; + $$1372 = 1; + $$3377 = 1; + $$4 = $19; + while (1) { + if (($$3377 | 0) > ($$0379 | 0)) break; + $218 = HEAP32[$$4 >> 2] | 0; + if (($218 | 0) == ($$3377 | 0)) { + $$2373 = $$1372 + 1 | 0; + $224 = $$1372; + } else { + $$2373 = $$1372; + $224 = HEAP32[$4 + 1179664 + ($218 + -1 << 2) >> 2] | 0; + } + HEAP32[$$4 >> 2] = $224; + $$1372 = $$2373; + $$3377 = $$3377 + 1 | 0; + $$4 = $$4 + 4 | 0; + } + $227 = $4 + 8 | 0; + $228 = $$1372 + -1 | 0; + HEAP32[$227 >> 2] = $228; + if (!$228) $$0 = 0; else { + _memset($216 | 0, 0, $228 << 2 | 0) | 0; + _memset($4 + 655376 | 0, 0, $228 << 4 | 0) | 0; + $$4378 = 0; + while (1) { + if (($$4378 | 0) >= ($228 | 0)) break; + $234 = $$4378 << 2; + HEAP32[$4 + 131084 + ($234 << 2) >> 2] = $1; + HEAP32[$4 + 131084 + (($234 | 1) << 2) >> 2] = 0; + HEAP32[$4 + 131084 + (($234 | 2) << 2) >> 2] = $2; + HEAP32[$4 + 131084 + (($234 | 3) << 2) >> 2] = 0; + $$4378 = $$4378 + 1 | 0; + } + $$5 = 0; + while (1) { + if (($$5 | 0) >= ($$0379 | 0)) break; + $246 = (HEAP32[$4 + 1179664 + ($$5 << 2) >> 2] | 0) + -1 | 0; + $247 = $$5 * 7 | 0; + $250 = $4 + 12 + ($246 << 2) | 0; + HEAP32[$250 >> 2] = (HEAP32[$250 >> 2] | 0) + (HEAP32[$4 + 1310736 + ($247 << 2) >> 2] | 0); + $257 = $246 << 1; + $258 = $4 + 655376 + ($257 << 3) | 0; + HEAPF64[$258 >> 3] = +HEAPF64[$258 >> 3] + +(HEAP32[$4 + 1310736 + ($247 + 1 << 2) >> 2] | 0); + $266 = $4 + 655376 + (($257 | 1) << 3) | 0; + HEAPF64[$266 >> 3] = +HEAPF64[$266 >> 3] + +(HEAP32[$4 + 1310736 + ($247 + 2 << 2) >> 2] | 0); + $269 = $246 << 2; + $270 = $4 + 131084 + ($269 << 2) | 0; + $274 = HEAP32[$4 + 1310736 + ($247 + 3 << 2) >> 2] | 0; + if ((HEAP32[$270 >> 2] | 0) > ($274 | 0)) HEAP32[$270 >> 2] = $274; + $277 = $4 + 131084 + (($269 | 1) << 2) | 0; + $281 = HEAP32[$4 + 1310736 + ($247 + 4 << 2) >> 2] | 0; + if ((HEAP32[$277 >> 2] | 0) < ($281 | 0)) HEAP32[$277 >> 2] = $281; + $284 = $4 + 131084 + (($269 | 2) << 2) | 0; + $288 = HEAP32[$4 + 1310736 + ($247 + 5 << 2) >> 2] | 0; + if ((HEAP32[$284 >> 2] | 0) > ($288 | 0)) HEAP32[$284 >> 2] = $288; + $291 = $4 + 131084 + (($269 | 3) << 2) | 0; + $295 = HEAP32[$4 + 1310736 + ($247 + 6 << 2) >> 2] | 0; + if ((HEAP32[$291 >> 2] | 0) < ($295 | 0)) HEAP32[$291 >> 2] = $295; + $$5 = $$5 + 1 | 0; + } + $298 = HEAP32[$227 >> 2] | 0; + $$6 = 0; + while (1) { + if (($$6 | 0) >= ($298 | 0)) { + $$0 = 0; + break L80; + } + $302 = +(HEAP32[$4 + 12 + ($$6 << 2) >> 2] | 0); + $303 = $$6 << 1; + $304 = $4 + 655376 + ($303 << 3) | 0; + HEAPF64[$304 >> 3] = +HEAPF64[$304 >> 3] / $302; + $308 = $4 + 655376 + (($303 | 1) << 3) | 0; + HEAPF64[$308 >> 3] = +HEAPF64[$308 >> 3] / $302; + $$6 = $$6 + 1 | 0; + } + } + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function _dispose_chunk($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$041722 = 0, $$0418$lcssa = 0, $$041821 = 0, $$0429 = 0, $$0436 = 0, $$1 = 0, $$1416 = 0, $$1424 = 0, $$1424$be = 0, $$1424$ph = 0, $$1427 = 0, $$1427$be = 0, $$1427$ph = 0, $$1431 = 0, $$1431$be = 0, $$1431$ph = 0, $$1435 = 0, $$1435$be = 0, $$1435$ph = 0, $$2 = 0, $$3 = 0, $$3433 = 0, $$pre$phi28Z2D = 0, $$pre$phi30Z2D = 0, $$pre$phiZ2D = 0, $101 = 0, $102 = 0, $108 = 0, $11 = 0, $110 = 0, $111 = 0, $117 = 0, $12 = 0, $125 = 0, $13 = 0, $130 = 0, $131 = 0, $134 = 0, $136 = 0, $138 = 0, $151 = 0, $156 = 0, $158 = 0, $161 = 0, $163 = 0, $166 = 0, $169 = 0, $17 = 0, $170 = 0, $171 = 0, $173 = 0, $175 = 0, $176 = 0, $178 = 0, $179 = 0, $184 = 0, $185 = 0, $194 = 0, $199 = 0, $2 = 0, $20 = 0, $202 = 0, $203 = 0, $209 = 0, $22 = 0, $224 = 0, $227 = 0, $228 = 0, $229 = 0, $233 = 0, $234 = 0, $24 = 0, $240 = 0, $245 = 0, $246 = 0, $249 = 0, $251 = 0, $254 = 0, $259 = 0, $265 = 0, $269 = 0, $270 = 0, $277 = 0, $289 = 0, $294 = 0, $301 = 0, $302 = 0, $303 = 0, $37 = 0, $4 = 0, $42 = 0, $44 = 0, $47 = 0, $49 = 0, $52 = 0, $55 = 0, $56 = 0, $57 = 0, $59 = 0, $61 = 0, $62 = 0, $64 = 0, $65 = 0, $7 = 0, $70 = 0, $71 = 0, $80 = 0, $85 = 0, $88 = 0, $89 = 0, $95 = 0; + $2 = $0 + $1 | 0; + $4 = HEAP32[$0 + 4 >> 2] | 0; + L1 : do if (!($4 & 1)) { + $7 = HEAP32[$0 >> 2] | 0; + if (!($4 & 3)) return; + $11 = $0 + (0 - $7) | 0; + $12 = $7 + $1 | 0; + $13 = HEAP32[16739] | 0; + if ($11 >>> 0 < $13 >>> 0) _abort(); + if ((HEAP32[16740] | 0) == ($11 | 0)) { + $101 = $2 + 4 | 0; + $102 = HEAP32[$101 >> 2] | 0; + if (($102 & 3 | 0) != 3) { + $$1 = $11; + $$1416 = $12; + break; + } + HEAP32[16737] = $12; + HEAP32[$101 >> 2] = $102 & -2; + HEAP32[$11 + 4 >> 2] = $12 | 1; + HEAP32[$2 >> 2] = $12; + return; + } + $17 = $7 >>> 3; + if ($7 >>> 0 < 256) { + $20 = HEAP32[$11 + 8 >> 2] | 0; + $22 = HEAP32[$11 + 12 >> 2] | 0; + $24 = 66980 + ($17 << 1 << 2) | 0; + if (($20 | 0) != ($24 | 0)) { + if ($13 >>> 0 > $20 >>> 0) _abort(); + if ((HEAP32[$20 + 12 >> 2] | 0) != ($11 | 0)) _abort(); + } + if (($22 | 0) == ($20 | 0)) { + HEAP32[16735] = HEAP32[16735] & ~(1 << $17); + $$1 = $11; + $$1416 = $12; + break; + } + if (($22 | 0) != ($24 | 0)) { + if ($13 >>> 0 > $22 >>> 0) _abort(); + $37 = $22 + 8 | 0; + if ((HEAP32[$37 >> 2] | 0) == ($11 | 0)) $$pre$phi30Z2D = $37; else _abort(); + } else $$pre$phi30Z2D = $22 + 8 | 0; + HEAP32[$20 + 12 >> 2] = $22; + HEAP32[$$pre$phi30Z2D >> 2] = $20; + $$1 = $11; + $$1416 = $12; + break; + } + $42 = HEAP32[$11 + 24 >> 2] | 0; + $44 = HEAP32[$11 + 12 >> 2] | 0; + do if (($44 | 0) == ($11 | 0)) { + $55 = $11 + 16 | 0; + $56 = $55 + 4 | 0; + $57 = HEAP32[$56 >> 2] | 0; + if (!$57) { + $59 = HEAP32[$55 >> 2] | 0; + if (!$59) { + $$3 = 0; + break; + } else { + $$1424$ph = $59; + $$1427$ph = $55; + } + } else { + $$1424$ph = $57; + $$1427$ph = $56; + } + $$1424 = $$1424$ph; + $$1427 = $$1427$ph; + while (1) { + $61 = $$1424 + 20 | 0; + $62 = HEAP32[$61 >> 2] | 0; + if (!$62) { + $64 = $$1424 + 16 | 0; + $65 = HEAP32[$64 >> 2] | 0; + if (!$65) break; else { + $$1424$be = $65; + $$1427$be = $64; + } + } else { + $$1424$be = $62; + $$1427$be = $61; + } + $$1424 = $$1424$be; + $$1427 = $$1427$be; + } + if ($13 >>> 0 > $$1427 >>> 0) _abort(); else { + HEAP32[$$1427 >> 2] = 0; + $$3 = $$1424; + break; + } + } else { + $47 = HEAP32[$11 + 8 >> 2] | 0; + if ($13 >>> 0 > $47 >>> 0) _abort(); + $49 = $47 + 12 | 0; + if ((HEAP32[$49 >> 2] | 0) != ($11 | 0)) _abort(); + $52 = $44 + 8 | 0; + if ((HEAP32[$52 >> 2] | 0) == ($11 | 0)) { + HEAP32[$49 >> 2] = $44; + HEAP32[$52 >> 2] = $47; + $$3 = $44; + break; + } else _abort(); + } while (0); + if ($42) { + $70 = HEAP32[$11 + 28 >> 2] | 0; + $71 = 67244 + ($70 << 2) | 0; + do if ((HEAP32[$71 >> 2] | 0) == ($11 | 0)) { + HEAP32[$71 >> 2] = $$3; + if (!$$3) { + HEAP32[16736] = HEAP32[16736] & ~(1 << $70); + $$1 = $11; + $$1416 = $12; + break L1; + } + } else if ((HEAP32[16739] | 0) >>> 0 <= $42 >>> 0) { + $80 = $42 + 16 | 0; + HEAP32[((HEAP32[$80 >> 2] | 0) == ($11 | 0) ? $80 : $42 + 20 | 0) >> 2] = $$3; + if (!$$3) { + $$1 = $11; + $$1416 = $12; + break L1; + } else break; + } else _abort(); while (0); + $85 = HEAP32[16739] | 0; + if ($85 >>> 0 > $$3 >>> 0) _abort(); + HEAP32[$$3 + 24 >> 2] = $42; + $88 = $11 + 16 | 0; + $89 = HEAP32[$88 >> 2] | 0; + do if ($89 | 0) if ($85 >>> 0 > $89 >>> 0) _abort(); else { + HEAP32[$$3 + 16 >> 2] = $89; + HEAP32[$89 + 24 >> 2] = $$3; + break; + } while (0); + $95 = HEAP32[$88 + 4 >> 2] | 0; + if ($95) if ((HEAP32[16739] | 0) >>> 0 > $95 >>> 0) _abort(); else { + HEAP32[$$3 + 20 >> 2] = $95; + HEAP32[$95 + 24 >> 2] = $$3; + $$1 = $11; + $$1416 = $12; + break; + } else { + $$1 = $11; + $$1416 = $12; + } + } else { + $$1 = $11; + $$1416 = $12; + } + } else { + $$1 = $0; + $$1416 = $1; + } while (0); + $108 = HEAP32[16739] | 0; + if ($2 >>> 0 < $108 >>> 0) _abort(); + $110 = $2 + 4 | 0; + $111 = HEAP32[$110 >> 2] | 0; + if (!($111 & 2)) { + if ((HEAP32[16741] | 0) == ($2 | 0)) { + $117 = (HEAP32[16738] | 0) + $$1416 | 0; + HEAP32[16738] = $117; + HEAP32[16741] = $$1; + HEAP32[$$1 + 4 >> 2] = $117 | 1; + if (($$1 | 0) != (HEAP32[16740] | 0)) return; + HEAP32[16740] = 0; + HEAP32[16737] = 0; + return; + } + if ((HEAP32[16740] | 0) == ($2 | 0)) { + $125 = (HEAP32[16737] | 0) + $$1416 | 0; + HEAP32[16737] = $125; + HEAP32[16740] = $$1; + HEAP32[$$1 + 4 >> 2] = $125 | 1; + HEAP32[$$1 + $125 >> 2] = $125; + return; + } + $130 = ($111 & -8) + $$1416 | 0; + $131 = $111 >>> 3; + L99 : do if ($111 >>> 0 >= 256) { + $156 = HEAP32[$2 + 24 >> 2] | 0; + $158 = HEAP32[$2 + 12 >> 2] | 0; + do if (($158 | 0) == ($2 | 0)) { + $169 = $2 + 16 | 0; + $170 = $169 + 4 | 0; + $171 = HEAP32[$170 >> 2] | 0; + if (!$171) { + $173 = HEAP32[$169 >> 2] | 0; + if (!$173) { + $$3433 = 0; + break; + } else { + $$1431$ph = $173; + $$1435$ph = $169; + } + } else { + $$1431$ph = $171; + $$1435$ph = $170; + } + $$1431 = $$1431$ph; + $$1435 = $$1435$ph; + while (1) { + $175 = $$1431 + 20 | 0; + $176 = HEAP32[$175 >> 2] | 0; + if (!$176) { + $178 = $$1431 + 16 | 0; + $179 = HEAP32[$178 >> 2] | 0; + if (!$179) break; else { + $$1431$be = $179; + $$1435$be = $178; + } + } else { + $$1431$be = $176; + $$1435$be = $175; + } + $$1431 = $$1431$be; + $$1435 = $$1435$be; + } + if ($108 >>> 0 > $$1435 >>> 0) _abort(); else { + HEAP32[$$1435 >> 2] = 0; + $$3433 = $$1431; + break; + } + } else { + $161 = HEAP32[$2 + 8 >> 2] | 0; + if ($108 >>> 0 > $161 >>> 0) _abort(); + $163 = $161 + 12 | 0; + if ((HEAP32[$163 >> 2] | 0) != ($2 | 0)) _abort(); + $166 = $158 + 8 | 0; + if ((HEAP32[$166 >> 2] | 0) == ($2 | 0)) { + HEAP32[$163 >> 2] = $158; + HEAP32[$166 >> 2] = $161; + $$3433 = $158; + break; + } else _abort(); + } while (0); + if ($156 | 0) { + $184 = HEAP32[$2 + 28 >> 2] | 0; + $185 = 67244 + ($184 << 2) | 0; + do if ((HEAP32[$185 >> 2] | 0) == ($2 | 0)) { + HEAP32[$185 >> 2] = $$3433; + if (!$$3433) { + HEAP32[16736] = HEAP32[16736] & ~(1 << $184); + break L99; + } + } else if ((HEAP32[16739] | 0) >>> 0 <= $156 >>> 0) { + $194 = $156 + 16 | 0; + HEAP32[((HEAP32[$194 >> 2] | 0) == ($2 | 0) ? $194 : $156 + 20 | 0) >> 2] = $$3433; + if (!$$3433) break L99; else break; + } else _abort(); while (0); + $199 = HEAP32[16739] | 0; + if ($199 >>> 0 > $$3433 >>> 0) _abort(); + HEAP32[$$3433 + 24 >> 2] = $156; + $202 = $2 + 16 | 0; + $203 = HEAP32[$202 >> 2] | 0; + do if ($203 | 0) if ($199 >>> 0 > $203 >>> 0) _abort(); else { + HEAP32[$$3433 + 16 >> 2] = $203; + HEAP32[$203 + 24 >> 2] = $$3433; + break; + } while (0); + $209 = HEAP32[$202 + 4 >> 2] | 0; + if ($209 | 0) if ((HEAP32[16739] | 0) >>> 0 > $209 >>> 0) _abort(); else { + HEAP32[$$3433 + 20 >> 2] = $209; + HEAP32[$209 + 24 >> 2] = $$3433; + break; + } + } + } else { + $134 = HEAP32[$2 + 8 >> 2] | 0; + $136 = HEAP32[$2 + 12 >> 2] | 0; + $138 = 66980 + ($131 << 1 << 2) | 0; + if (($134 | 0) != ($138 | 0)) { + if ($108 >>> 0 > $134 >>> 0) _abort(); + if ((HEAP32[$134 + 12 >> 2] | 0) != ($2 | 0)) _abort(); + } + if (($136 | 0) == ($134 | 0)) { + HEAP32[16735] = HEAP32[16735] & ~(1 << $131); + break; + } + if (($136 | 0) != ($138 | 0)) { + if ($108 >>> 0 > $136 >>> 0) _abort(); + $151 = $136 + 8 | 0; + if ((HEAP32[$151 >> 2] | 0) == ($2 | 0)) $$pre$phi28Z2D = $151; else _abort(); + } else $$pre$phi28Z2D = $136 + 8 | 0; + HEAP32[$134 + 12 >> 2] = $136; + HEAP32[$$pre$phi28Z2D >> 2] = $134; + } while (0); + HEAP32[$$1 + 4 >> 2] = $130 | 1; + HEAP32[$$1 + $130 >> 2] = $130; + if (($$1 | 0) == (HEAP32[16740] | 0)) { + HEAP32[16737] = $130; + return; + } else $$2 = $130; + } else { + HEAP32[$110 >> 2] = $111 & -2; + HEAP32[$$1 + 4 >> 2] = $$1416 | 1; + HEAP32[$$1 + $$1416 >> 2] = $$1416; + $$2 = $$1416; + } + $224 = $$2 >>> 3; + if ($$2 >>> 0 < 256) { + $227 = 66980 + ($224 << 1 << 2) | 0; + $228 = HEAP32[16735] | 0; + $229 = 1 << $224; + if ($228 & $229) { + $233 = $227 + 8 | 0; + $234 = HEAP32[$233 >> 2] | 0; + if ((HEAP32[16739] | 0) >>> 0 > $234 >>> 0) _abort(); else { + $$0436 = $234; + $$pre$phiZ2D = $233; + } + } else { + HEAP32[16735] = $228 | $229; + $$0436 = $227; + $$pre$phiZ2D = $227 + 8 | 0; + } + HEAP32[$$pre$phiZ2D >> 2] = $$1; + HEAP32[$$0436 + 12 >> 2] = $$1; + HEAP32[$$1 + 8 >> 2] = $$0436; + HEAP32[$$1 + 12 >> 2] = $227; + return; + } + $240 = $$2 >>> 8; + if ($240) if ($$2 >>> 0 > 16777215) $$0429 = 31; else { + $245 = ($240 + 1048320 | 0) >>> 16 & 8; + $246 = $240 << $245; + $249 = ($246 + 520192 | 0) >>> 16 & 4; + $251 = $246 << $249; + $254 = ($251 + 245760 | 0) >>> 16 & 2; + $259 = 14 - ($249 | $245 | $254) + ($251 << $254 >>> 15) | 0; + $$0429 = $$2 >>> ($259 + 7 | 0) & 1 | $259 << 1; + } else $$0429 = 0; + $265 = 67244 + ($$0429 << 2) | 0; + HEAP32[$$1 + 28 >> 2] = $$0429; + HEAP32[$$1 + 20 >> 2] = 0; + HEAP32[$$1 + 16 >> 2] = 0; + $269 = HEAP32[16736] | 0; + $270 = 1 << $$0429; + if (!($269 & $270)) { + HEAP32[16736] = $269 | $270; + HEAP32[$265 >> 2] = $$1; + HEAP32[$$1 + 24 >> 2] = $265; + HEAP32[$$1 + 12 >> 2] = $$1; + HEAP32[$$1 + 8 >> 2] = $$1; + return; + } + $277 = HEAP32[$265 >> 2] | 0; + L189 : do if ((HEAP32[$277 + 4 >> 2] & -8 | 0) == ($$2 | 0)) $$0418$lcssa = $277; else { + $$041722 = $$2 << (($$0429 | 0) == 31 ? 0 : 25 - ($$0429 >>> 1) | 0); + $$041821 = $277; + while (1) { + $294 = $$041821 + 16 + ($$041722 >>> 31 << 2) | 0; + $289 = HEAP32[$294 >> 2] | 0; + if (!$289) break; + if ((HEAP32[$289 + 4 >> 2] & -8 | 0) == ($$2 | 0)) { + $$0418$lcssa = $289; + break L189; + } else { + $$041722 = $$041722 << 1; + $$041821 = $289; + } + } + if ((HEAP32[16739] | 0) >>> 0 > $294 >>> 0) _abort(); + HEAP32[$294 >> 2] = $$1; + HEAP32[$$1 + 24 >> 2] = $$041821; + HEAP32[$$1 + 12 >> 2] = $$1; + HEAP32[$$1 + 8 >> 2] = $$1; + return; + } while (0); + $301 = $$0418$lcssa + 8 | 0; + $302 = HEAP32[$301 >> 2] | 0; + $303 = HEAP32[16739] | 0; + if (!($303 >>> 0 <= $302 >>> 0 & $303 >>> 0 <= $$0418$lcssa >>> 0)) _abort(); + HEAP32[$302 + 12 >> 2] = $$1; + HEAP32[$301 >> 2] = $$1; + HEAP32[$$1 + 8 >> 2] = $302; + HEAP32[$$1 + 12 >> 2] = $$0418$lcssa; + HEAP32[$$1 + 24 >> 2] = 0; + return; +} + +function __ZN6vision21OrientationAssignment7computeEPfRiiifff($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = +$5; + $6 = +$6; + $7 = +$7; + var $$0 = 0, $$0148 = 0, $$0149 = 0, $$0150 = 0.0, $$0152 = 0, $$0153 = 0, $$pre = 0, $10 = 0, $107 = 0, $11 = 0, $112 = 0, $116 = 0, $118 = 0, $12 = 0, $120 = 0, $13 = 0, $130 = 0.0, $133 = 0.0, $136 = 0.0, $138 = 0.0, $14 = 0, $140 = 0, $145 = 0, $148 = 0, $149 = 0, $152 = 0, $153 = 0, $154 = 0, $159 = 0, $161 = 0, $164 = 0.0, $165 = 0, $171 = 0.0, $174 = 0, $177 = 0.0, $178 = 0, $191 = 0, $192 = 0, $199 = 0.0, $208 = 0, $21 = 0, $213 = 0, $217 = 0, $218 = 0, $219 = 0, $220 = 0, $221 = 0, $223 = 0, $224 = 0.0, $225 = 0, $226 = 0, $227 = 0, $228 = 0, $233 = 0, $234 = 0, $239 = 0, $244 = 0.0, $245 = 0.0, $256 = 0.0, $26 = 0, $263 = 0, $30 = 0, $31 = 0, $34 = 0, $35 = 0, $46 = 0, $51 = 0, $55 = 0, $62 = 0, $67 = 0, $71 = 0, $74 = 0, $8 = 0, $85 = 0, $9 = 0, $90 = 0, $94 = 0, $97 = 0, $99 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $8 = sp + 32 | 0; + $9 = sp + 24 | 0; + $10 = sp + 16 | 0; + $11 = sp + 12 | 0; + $12 = sp + 8 | 0; + $13 = sp + 4 | 0; + $14 = sp; + if (!($5 >= 0.0)) { + $21 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 32047) | 0, 31917) | 0, 39072) | 0, 119) | 0, 39079) | 0, 32077) | 0; + __ZNKSt3__28ios_base6getlocEv($8, $21 + (HEAP32[(HEAP32[$21 >> 2] | 0) + -12 >> 2] | 0) | 0); + $26 = __ZNKSt3__26locale9use_facetERNS0_2idE($8, 66512) | 0; + $30 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$26 >> 2] | 0) + 28 >> 2] & 127]($26, 10) | 0; + __ZNSt3__26localeD2Ev($8); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($21, $30) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($21) | 0; + _abort(); + } + $31 = $0 + 4 | 0; + $34 = (Math_imul(HEAP32[$31 >> 2] | 0, $3) | 0) + $4 | 0; + $35 = $0 + 40 | 0; + if (!(+((__ZNK6vision5Image5widthEv((HEAP32[$35 >> 2] | 0) + ($34 << 5) | 0) | 0) >>> 0) > $5)) { + $46 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 32096) | 0, 31917) | 0, 39072) | 0, 120) | 0, 39079) | 0, 32176) | 0; + __ZNKSt3__28ios_base6getlocEv($8, $46 + (HEAP32[(HEAP32[$46 >> 2] | 0) + -12 >> 2] | 0) | 0); + $51 = __ZNKSt3__26locale9use_facetERNS0_2idE($8, 66512) | 0; + $55 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$51 >> 2] | 0) + 28 >> 2] & 127]($51, 10) | 0; + __ZNSt3__26localeD2Ev($8); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($46, $55) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($46) | 0; + _abort(); + } + if (!($6 >= 0.0)) { + $62 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 32212) | 0, 31917) | 0, 39072) | 0, 121) | 0, 39079) | 0, 32242) | 0; + __ZNKSt3__28ios_base6getlocEv($8, $62 + (HEAP32[(HEAP32[$62 >> 2] | 0) + -12 >> 2] | 0) | 0); + $67 = __ZNKSt3__26locale9use_facetERNS0_2idE($8, 66512) | 0; + $71 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$67 >> 2] | 0) + 28 >> 2] & 127]($67, 10) | 0; + __ZNSt3__26localeD2Ev($8); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($62, $71) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($62) | 0; + _abort(); + } + $74 = (Math_imul(HEAP32[$31 >> 2] | 0, $3) | 0) + $4 | 0; + if (!(+((__ZNK6vision5Image6heightEv((HEAP32[$35 >> 2] | 0) + ($74 << 5) | 0) | 0) >>> 0) > $6)) { + $85 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 32261) | 0, 31917) | 0, 39072) | 0, 122) | 0, 39079) | 0, 32342) | 0; + __ZNKSt3__28ios_base6getlocEv($8, $85 + (HEAP32[(HEAP32[$85 >> 2] | 0) + -12 >> 2] | 0) | 0); + $90 = __ZNKSt3__26locale9use_facetERNS0_2idE($8, 66512) | 0; + $94 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$90 >> 2] | 0) + 28 >> 2] & 127]($90, 10) | 0; + __ZNSt3__26localeD2Ev($8); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($85, $94) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($85) | 0; + _abort(); + } + $97 = (Math_imul(HEAP32[$31 >> 2] | 0, $3) | 0) + $4 | 0; + $99 = (HEAP32[$35 >> 2] | 0) + ($97 << 5) | 0; + if ((__ZNK6vision5Image8channelsEv($99) | 0) != 2) { + $107 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 32379) | 0, 31917) | 0, 39072) | 0, 126) | 0, 39079) | 0, 32420) | 0; + __ZNKSt3__28ios_base6getlocEv($8, $107 + (HEAP32[(HEAP32[$107 >> 2] | 0) + -12 >> 2] | 0) | 0); + $112 = __ZNKSt3__26locale9use_facetERNS0_2idE($8, 66512) | 0; + $116 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$112 >> 2] | 0) + 28 >> 2] & 127]($112, 10) | 0; + __ZNSt3__26localeD2Ev($8); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($107, $116) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($107) | 0; + _abort(); + } + HEAP32[$2 >> 2] = 0; + $118 = ~~($5 + .5); + $120 = ~~($6 + .5); + L16 : do if ((($118 | 0) >= 0 ? !(($120 | 0) < 0 | (__ZNK6vision5Image5widthEv($99) | 0) >>> 0 <= $118 >>> 0) : 0) ? (__ZNK6vision5Image6heightEv($99) | 0) >>> 0 > $120 >>> 0 : 0) { + $130 = +__ZN6vision4max2IfEET_S1_S1_(1.0, +HEAPF32[$0 + 12 >> 2] * $7); + $133 = -1.0 / (+__ZN6vision3sqrIfEET_S1_($130) * 2.0); + $136 = $130 * +HEAPF32[$0 + 16 >> 2]; + $138 = +Math_ceil(+(+__ZN6vision3sqrIfEET_S1_($136))); + $140 = ~~($136 + .5); + $145 = __ZN6vision4max2IiEET_S1_S1_(0, $118 - $140 | 0) | 0; + $148 = __ZN6vision4min2IiEET_S1_S1_($140 + $118 | 0, (__ZNK6vision5Image5widthEv($99) | 0) + -1 | 0) | 0; + $149 = __ZN6vision4max2IiEET_S1_S1_(0, $120 - $140 | 0) | 0; + $152 = __ZN6vision4min2IiEET_S1_S1_($140 + $120 | 0, (__ZNK6vision5Image6heightEv($99) | 0) + -1 | 0) | 0; + $153 = $0 + 28 | 0; + $154 = HEAP32[$153 >> 2] | 0; + __ZN6vision10ZeroVectorIfEEvPT_m($154, (HEAP32[$0 + 32 >> 2] | 0) - $154 >> 2); + $159 = $0 + 8 | 0; + $$0152 = $149; + while (1) { + if (($$0152 | 0) > ($152 | 0)) break; + $164 = +__ZN6vision3sqrIfEET_S1_(+($$0152 | 0) - $6); + $165 = __ZNK6vision5Image3getIfEEPKT_m($99, $$0152) | 0; + $$0153 = $145; + while (1) { + if (($$0153 | 0) > ($148 | 0)) break; + $171 = $164 + +__ZN6vision3sqrIfEET_S1_(+($$0153 | 0) - $5); + if (!($171 > $138)) { + $174 = $165 + ($$0153 << 1 << 2) | 0; + $177 = +__ZN6vision8fastexp6IfEET_S1_($133 * $171); + $178 = HEAP32[$159 >> 2] | 0; + __ZN6vision25bilinear_histogram_updateEPfffi(HEAP32[$153 >> 2] | 0, +HEAPF32[$174 >> 2] * +($178 | 0) * .159154943091895, $177 * +HEAPF32[$174 + 4 >> 2], $178); + } + $$0153 = $$0153 + 1 | 0; + } + $$0152 = $$0152 + 1 | 0; + } + $161 = $0 + 20 | 0; + $$0149 = 0; + while (1) { + if (($$0149 | 0) >= (HEAP32[$161 >> 2] | 0)) break; + $192 = HEAP32[$153 >> 2] | 0; + __ZN6vision26SmoothOrientationHistogramIfEEvPT_PKS1_mS4_($192, $192, HEAP32[$159 >> 2] | 0, 16800); + $$0149 = $$0149 + 1 | 0; + } + $191 = HEAP32[$159 >> 2] | 0; + $$0148 = 0; + $$0150 = 0.0; + while (1) { + if (($$0148 | 0) >= ($191 | 0)) break; + $199 = +HEAPF32[(HEAP32[$153 >> 2] | 0) + ($$0148 << 2) >> 2]; + $$0148 = $$0148 + 1 | 0; + $$0150 = $199 > $$0150 ? $199 : $$0150; + } + if (!($$0150 == 0.0)) { + if (!($$0150 > 0.0)) { + $208 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 32451) | 0, 31917) | 0, 39072) | 0, 218) | 0, 39079) | 0, 32489) | 0; + __ZNKSt3__28ios_base6getlocEv($8, $208 + (HEAP32[(HEAP32[$208 >> 2] | 0) + -12 >> 2] | 0) | 0); + $213 = __ZNKSt3__26locale9use_facetERNS0_2idE($8, 66512) | 0; + $217 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$213 >> 2] | 0) + 28 >> 2] & 127]($213, 10) | 0; + __ZNSt3__26localeD2Ev($8); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($208, $217) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($208) | 0; + _abort(); + } + $218 = $8 + 4 | 0; + $219 = $9 + 4 | 0; + $220 = $10 + 4 | 0; + $221 = $0 + 24 | 0; + $$0 = 0; + $223 = $191; + while (1) { + if (($$0 | 0) >= ($223 | 0)) break L16; + $224 = +($$0 | 0); + HEAPF32[$8 >> 2] = $224; + $225 = HEAP32[$153 >> 2] | 0; + $226 = $225 + ($$0 << 2) | 0; + $227 = HEAP32[$226 >> 2] | 0; + HEAP32[$218 >> 2] = $227; + $228 = $$0 + -1 | 0; + HEAPF32[$9 >> 2] = +($228 | 0); + $233 = HEAP32[$225 + ((($228 + $223 | 0) % ($223 | 0) | 0) << 2) >> 2] | 0; + HEAP32[$219 >> 2] = $233; + $234 = $$0 + 1 | 0; + HEAPF32[$10 >> 2] = +($234 | 0); + $239 = HEAP32[$225 + ((($234 + $223 | 0) % ($223 | 0) | 0) << 2) >> 2] | 0; + HEAP32[$220 >> 2] = $239; + $244 = (HEAP32[tempDoublePtr >> 2] = $227, +HEAPF32[tempDoublePtr >> 2]); + if (+HEAPF32[$226 >> 2] > $$0150 * +HEAPF32[$221 >> 2] ? ($245 = (HEAP32[tempDoublePtr >> 2] = $239, +HEAPF32[tempDoublePtr >> 2]), $244 > (HEAP32[tempDoublePtr >> 2] = $233, +HEAPF32[tempDoublePtr >> 2]) & $244 > $245) : 0) { + HEAPF32[$14 >> 2] = $224; + if (__ZN6vision16Quadratic3PointsIfEEbRT_S2_S2_PKS1_S4_S4_($11, $12, $13, $9, $8, $10) | 0) __ZN6vision22QuadraticCriticalPointIfEEbRT_S1_S1_S1_($14, +HEAPF32[$11 >> 2], +HEAPF32[$12 >> 2], +HEAPF32[$13 >> 2]) | 0; + $256 = +(HEAP32[$159 >> 2] | 0); + $263 = HEAP32[$2 >> 2] | 0; + HEAPF32[$1 + ($263 << 2) >> 2] = (+HEAPF32[$14 >> 2] + .5 + $256) / $256 * 6.283185307179586 % 6.283185307179586; + HEAP32[$2 >> 2] = $263 + 1; + $$pre = HEAP32[$159 >> 2] | 0; + } else $$pre = $223; + $$0 = $234; + $223 = $$pre; + } + } + } while (0); + STACKTOP = sp; + return; +} + +function _jpeg_idct_5x5($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $103 = 0, $109 = 0, $111 = 0, $113 = 0, $115 = 0, $137 = 0, $143 = 0, $149 = 0, $15 = 0, $151 = 0, $152 = 0, $154 = 0, $155 = 0, $156 = 0, $158 = 0, $164 = 0, $170 = 0, $172 = 0, $174 = 0, $176 = 0, $198 = 0, $204 = 0, $21 = 0, $210 = 0, $212 = 0, $213 = 0, $215 = 0, $216 = 0, $217 = 0, $219 = 0, $225 = 0, $231 = 0, $233 = 0, $235 = 0, $237 = 0, $259 = 0, $265 = 0, $27 = 0, $271 = 0, $273 = 0, $274 = 0, $276 = 0, $277 = 0, $278 = 0, $280 = 0, $286 = 0, $29 = 0, $292 = 0, $294 = 0, $296 = 0, $298 = 0, $30 = 0, $312 = 0, $314 = 0, $317 = 0, $319 = 0, $32 = 0, $321 = 0, $323 = 0, $324 = 0, $326 = 0, $327 = 0, $328 = 0, $33 = 0, $330 = 0, $331 = 0, $333 = 0, $335 = 0, $337 = 0, $339 = 0, $34 = 0, $36 = 0, $370 = 0, $373 = 0, $375 = 0, $377 = 0, $379 = 0, $380 = 0, $382 = 0, $383 = 0, $384 = 0, $386 = 0, $388 = 0, $390 = 0, $392 = 0, $394 = 0, $396 = 0, $42 = 0, $428 = 0, $431 = 0, $433 = 0, $435 = 0, $437 = 0, $438 = 0, $440 = 0, $441 = 0, $442 = 0, $444 = 0, $446 = 0, $448 = 0, $450 = 0, $452 = 0, $454 = 0, $48 = 0, $486 = 0, $489 = 0, $491 = 0, $493 = 0, $495 = 0, $496 = 0, $498 = 0, $499 = 0, $5 = 0, $50 = 0, $500 = 0, $502 = 0, $504 = 0, $506 = 0, $508 = 0, $510 = 0, $512 = 0, $52 = 0, $54 = 0, $544 = 0, $547 = 0, $549 = 0, $551 = 0, $553 = 0, $554 = 0, $556 = 0, $557 = 0, $558 = 0, $560 = 0, $562 = 0, $564 = 0, $566 = 0, $568 = 0, $570 = 0, $62 = 0, $7 = 0, $70 = 0, $76 = 0, $82 = 0, $88 = 0, $9 = 0, $90 = 0, $91 = 0, $93 = 0, $94 = 0, $95 = 0, $97 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 112 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(112); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $9 = HEAP32[$1 + 84 >> 2] | 0; + $15 = Math_imul(HEAP16[$2 >> 1] << 13, HEAP32[$9 >> 2] | 0) | 0 | 1024; + $21 = Math_imul(HEAP32[$9 + 64 >> 2] | 0, HEAP16[$2 + 32 >> 1] | 0) | 0; + $27 = Math_imul(HEAP32[$9 + 128 >> 2] | 0, HEAP16[$2 + 64 >> 1] | 0) | 0; + $29 = ($27 + $21 | 0) * 6476 | 0; + $30 = $21 - $27 | 0; + $32 = ($30 * 2896 | 0) + $15 | 0; + $33 = $32 + $29 | 0; + $34 = $32 - $29 | 0; + $36 = (Math_imul($30, -11584) | 0) + $15 | 0; + $42 = Math_imul(HEAP32[$9 + 32 >> 2] | 0, HEAP16[$2 + 16 >> 1] | 0) | 0; + $48 = Math_imul(HEAP32[$9 + 96 >> 2] | 0, HEAP16[$2 + 48 >> 1] | 0) | 0; + $50 = ($48 + $42 | 0) * 6810 | 0; + $52 = $50 + ($42 * 4209 | 0) | 0; + $54 = $50 + (Math_imul($48, -17828) | 0) | 0; + HEAP32[$5 >> 2] = $52 + $33 >> 11; + HEAP32[$5 + 80 >> 2] = $33 - $52 >> 11; + $62 = $5 + 20 | 0; + HEAP32[$62 >> 2] = $54 + $34 >> 11; + HEAP32[$5 + 60 >> 2] = $34 - $54 >> 11; + HEAP32[$5 + 40 >> 2] = $36 >> 11; + $70 = $5 + 4 | 0; + $76 = Math_imul(HEAP16[$2 + 2 >> 1] << 13, HEAP32[$9 + 4 >> 2] | 0) | 0 | 1024; + $82 = Math_imul(HEAP32[$9 + 68 >> 2] | 0, HEAP16[$2 + 34 >> 1] | 0) | 0; + $88 = Math_imul(HEAP32[$9 + 132 >> 2] | 0, HEAP16[$2 + 66 >> 1] | 0) | 0; + $90 = ($88 + $82 | 0) * 6476 | 0; + $91 = $82 - $88 | 0; + $93 = ($91 * 2896 | 0) + $76 | 0; + $94 = $93 + $90 | 0; + $95 = $93 - $90 | 0; + $97 = (Math_imul($91, -11584) | 0) + $76 | 0; + $103 = Math_imul(HEAP32[$9 + 36 >> 2] | 0, HEAP16[$2 + 18 >> 1] | 0) | 0; + $109 = Math_imul(HEAP32[$9 + 100 >> 2] | 0, HEAP16[$2 + 50 >> 1] | 0) | 0; + $111 = ($109 + $103 | 0) * 6810 | 0; + $113 = $111 + ($103 * 4209 | 0) | 0; + $115 = $111 + (Math_imul($109, -17828) | 0) | 0; + HEAP32[$70 >> 2] = $113 + $94 >> 11; + HEAP32[$5 + 84 >> 2] = $94 - $113 >> 11; + HEAP32[$5 + 24 >> 2] = $115 + $95 >> 11; + HEAP32[$5 + 64 >> 2] = $95 - $115 >> 11; + HEAP32[$5 + 44 >> 2] = $97 >> 11; + $137 = Math_imul(HEAP16[$2 + 4 >> 1] << 13, HEAP32[$9 + 8 >> 2] | 0) | 0 | 1024; + $143 = Math_imul(HEAP32[$9 + 72 >> 2] | 0, HEAP16[$2 + 36 >> 1] | 0) | 0; + $149 = Math_imul(HEAP32[$9 + 136 >> 2] | 0, HEAP16[$2 + 68 >> 1] | 0) | 0; + $151 = ($149 + $143 | 0) * 6476 | 0; + $152 = $143 - $149 | 0; + $154 = ($152 * 2896 | 0) + $137 | 0; + $155 = $154 + $151 | 0; + $156 = $154 - $151 | 0; + $158 = (Math_imul($152, -11584) | 0) + $137 | 0; + $164 = Math_imul(HEAP32[$9 + 40 >> 2] | 0, HEAP16[$2 + 20 >> 1] | 0) | 0; + $170 = Math_imul(HEAP32[$9 + 104 >> 2] | 0, HEAP16[$2 + 52 >> 1] | 0) | 0; + $172 = ($170 + $164 | 0) * 6810 | 0; + $174 = $172 + ($164 * 4209 | 0) | 0; + $176 = $172 + (Math_imul($170, -17828) | 0) | 0; + HEAP32[$5 + 8 >> 2] = $174 + $155 >> 11; + HEAP32[$5 + 88 >> 2] = $155 - $174 >> 11; + HEAP32[$5 + 28 >> 2] = $176 + $156 >> 11; + HEAP32[$5 + 68 >> 2] = $156 - $176 >> 11; + HEAP32[$5 + 48 >> 2] = $158 >> 11; + $198 = Math_imul(HEAP16[$2 + 6 >> 1] << 13, HEAP32[$9 + 12 >> 2] | 0) | 0 | 1024; + $204 = Math_imul(HEAP32[$9 + 76 >> 2] | 0, HEAP16[$2 + 38 >> 1] | 0) | 0; + $210 = Math_imul(HEAP32[$9 + 140 >> 2] | 0, HEAP16[$2 + 70 >> 1] | 0) | 0; + $212 = ($210 + $204 | 0) * 6476 | 0; + $213 = $204 - $210 | 0; + $215 = ($213 * 2896 | 0) + $198 | 0; + $216 = $215 + $212 | 0; + $217 = $215 - $212 | 0; + $219 = (Math_imul($213, -11584) | 0) + $198 | 0; + $225 = Math_imul(HEAP32[$9 + 44 >> 2] | 0, HEAP16[$2 + 22 >> 1] | 0) | 0; + $231 = Math_imul(HEAP32[$9 + 108 >> 2] | 0, HEAP16[$2 + 54 >> 1] | 0) | 0; + $233 = ($231 + $225 | 0) * 6810 | 0; + $235 = $233 + ($225 * 4209 | 0) | 0; + $237 = $233 + (Math_imul($231, -17828) | 0) | 0; + HEAP32[$5 + 12 >> 2] = $235 + $216 >> 11; + HEAP32[$5 + 92 >> 2] = $216 - $235 >> 11; + HEAP32[$5 + 32 >> 2] = $237 + $217 >> 11; + HEAP32[$5 + 72 >> 2] = $217 - $237 >> 11; + HEAP32[$5 + 52 >> 2] = $219 >> 11; + $259 = Math_imul(HEAP16[$2 + 8 >> 1] << 13, HEAP32[$9 + 16 >> 2] | 0) | 0 | 1024; + $265 = Math_imul(HEAP32[$9 + 80 >> 2] | 0, HEAP16[$2 + 40 >> 1] | 0) | 0; + $271 = Math_imul(HEAP32[$9 + 144 >> 2] | 0, HEAP16[$2 + 72 >> 1] | 0) | 0; + $273 = ($271 + $265 | 0) * 6476 | 0; + $274 = $265 - $271 | 0; + $276 = ($274 * 2896 | 0) + $259 | 0; + $277 = $276 + $273 | 0; + $278 = $276 - $273 | 0; + $280 = (Math_imul($274, -11584) | 0) + $259 | 0; + $286 = Math_imul(HEAP32[$9 + 48 >> 2] | 0, HEAP16[$2 + 24 >> 1] | 0) | 0; + $292 = Math_imul(HEAP32[$9 + 112 >> 2] | 0, HEAP16[$2 + 56 >> 1] | 0) | 0; + $294 = ($292 + $286 | 0) * 6810 | 0; + $296 = $294 + ($286 * 4209 | 0) | 0; + $298 = $294 + (Math_imul($292, -17828) | 0) | 0; + HEAP32[$5 + 16 >> 2] = $296 + $277 >> 11; + HEAP32[$5 + 96 >> 2] = $277 - $296 >> 11; + HEAP32[$5 + 36 >> 2] = $298 + $278 >> 11; + HEAP32[$5 + 76 >> 2] = $278 - $298 >> 11; + HEAP32[$5 + 56 >> 2] = $280 >> 11; + $312 = $7 + -384 | 0; + $314 = (HEAP32[$3 >> 2] | 0) + $4 | 0; + $317 = (HEAP32[$5 >> 2] << 13) + 134348800 | 0; + $319 = HEAP32[$5 + 8 >> 2] | 0; + $321 = HEAP32[$5 + 16 >> 2] | 0; + $323 = ($321 + $319 | 0) * 6476 | 0; + $324 = $319 - $321 | 0; + $326 = ($324 * 2896 | 0) + $317 | 0; + $327 = $326 + $323 | 0; + $328 = $326 - $323 | 0; + $330 = (Math_imul($324, -11584) | 0) + $317 | 0; + $331 = HEAP32[$70 >> 2] | 0; + $333 = HEAP32[$5 + 12 >> 2] | 0; + $335 = ($333 + $331 | 0) * 6810 | 0; + $337 = $335 + ($331 * 4209 | 0) | 0; + $339 = $335 + (Math_imul($333, -17828) | 0) | 0; + HEAP8[$314 >> 0] = HEAP8[$312 + (($337 + $327 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$314 + 4 >> 0] = HEAP8[$312 + (($327 - $337 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$314 + 1 >> 0] = HEAP8[$312 + (($339 + $328 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$314 + 3 >> 0] = HEAP8[$312 + (($328 - $339 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$314 + 2 >> 0] = HEAP8[$312 + ($330 >>> 18 & 1023) >> 0] | 0; + $370 = (HEAP32[$3 + 4 >> 2] | 0) + $4 | 0; + $373 = (HEAP32[$62 >> 2] << 13) + 134348800 | 0; + $375 = HEAP32[$5 + 28 >> 2] | 0; + $377 = HEAP32[$5 + 36 >> 2] | 0; + $379 = ($377 + $375 | 0) * 6476 | 0; + $380 = $375 - $377 | 0; + $382 = ($380 * 2896 | 0) + $373 | 0; + $383 = $382 + $379 | 0; + $384 = $382 - $379 | 0; + $386 = (Math_imul($380, -11584) | 0) + $373 | 0; + $388 = HEAP32[$5 + 24 >> 2] | 0; + $390 = HEAP32[$5 + 32 >> 2] | 0; + $392 = ($390 + $388 | 0) * 6810 | 0; + $394 = $392 + ($388 * 4209 | 0) | 0; + $396 = $392 + (Math_imul($390, -17828) | 0) | 0; + HEAP8[$370 >> 0] = HEAP8[$312 + (($394 + $383 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$370 + 4 >> 0] = HEAP8[$312 + (($383 - $394 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$370 + 1 >> 0] = HEAP8[$312 + (($396 + $384 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$370 + 3 >> 0] = HEAP8[$312 + (($384 - $396 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$370 + 2 >> 0] = HEAP8[$312 + ($386 >>> 18 & 1023) >> 0] | 0; + $428 = (HEAP32[$3 + 8 >> 2] | 0) + $4 | 0; + $431 = (HEAP32[$5 + 40 >> 2] << 13) + 134348800 | 0; + $433 = HEAP32[$5 + 48 >> 2] | 0; + $435 = HEAP32[$5 + 56 >> 2] | 0; + $437 = ($435 + $433 | 0) * 6476 | 0; + $438 = $433 - $435 | 0; + $440 = ($438 * 2896 | 0) + $431 | 0; + $441 = $440 + $437 | 0; + $442 = $440 - $437 | 0; + $444 = (Math_imul($438, -11584) | 0) + $431 | 0; + $446 = HEAP32[$5 + 44 >> 2] | 0; + $448 = HEAP32[$5 + 52 >> 2] | 0; + $450 = ($448 + $446 | 0) * 6810 | 0; + $452 = $450 + ($446 * 4209 | 0) | 0; + $454 = $450 + (Math_imul($448, -17828) | 0) | 0; + HEAP8[$428 >> 0] = HEAP8[$312 + (($452 + $441 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$428 + 4 >> 0] = HEAP8[$312 + (($441 - $452 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$428 + 1 >> 0] = HEAP8[$312 + (($454 + $442 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$428 + 3 >> 0] = HEAP8[$312 + (($442 - $454 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$428 + 2 >> 0] = HEAP8[$312 + ($444 >>> 18 & 1023) >> 0] | 0; + $486 = (HEAP32[$3 + 12 >> 2] | 0) + $4 | 0; + $489 = (HEAP32[$5 + 60 >> 2] << 13) + 134348800 | 0; + $491 = HEAP32[$5 + 68 >> 2] | 0; + $493 = HEAP32[$5 + 76 >> 2] | 0; + $495 = ($493 + $491 | 0) * 6476 | 0; + $496 = $491 - $493 | 0; + $498 = ($496 * 2896 | 0) + $489 | 0; + $499 = $498 + $495 | 0; + $500 = $498 - $495 | 0; + $502 = (Math_imul($496, -11584) | 0) + $489 | 0; + $504 = HEAP32[$5 + 64 >> 2] | 0; + $506 = HEAP32[$5 + 72 >> 2] | 0; + $508 = ($506 + $504 | 0) * 6810 | 0; + $510 = $508 + ($504 * 4209 | 0) | 0; + $512 = $508 + (Math_imul($506, -17828) | 0) | 0; + HEAP8[$486 >> 0] = HEAP8[$312 + (($510 + $499 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$486 + 4 >> 0] = HEAP8[$312 + (($499 - $510 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$486 + 1 >> 0] = HEAP8[$312 + (($512 + $500 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$486 + 3 >> 0] = HEAP8[$312 + (($500 - $512 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$486 + 2 >> 0] = HEAP8[$312 + ($502 >>> 18 & 1023) >> 0] | 0; + $544 = (HEAP32[$3 + 16 >> 2] | 0) + $4 | 0; + $547 = (HEAP32[$5 + 80 >> 2] << 13) + 134348800 | 0; + $549 = HEAP32[$5 + 88 >> 2] | 0; + $551 = HEAP32[$5 + 96 >> 2] | 0; + $553 = ($551 + $549 | 0) * 6476 | 0; + $554 = $549 - $551 | 0; + $556 = ($554 * 2896 | 0) + $547 | 0; + $557 = $556 + $553 | 0; + $558 = $556 - $553 | 0; + $560 = (Math_imul($554, -11584) | 0) + $547 | 0; + $562 = HEAP32[$5 + 84 >> 2] | 0; + $564 = HEAP32[$5 + 92 >> 2] | 0; + $566 = ($564 + $562 | 0) * 6810 | 0; + $568 = $566 + ($562 * 4209 | 0) | 0; + $570 = $566 + (Math_imul($564, -17828) | 0) | 0; + HEAP8[$544 >> 0] = HEAP8[$312 + (($568 + $557 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$544 + 4 >> 0] = HEAP8[$312 + (($557 - $568 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$544 + 1 >> 0] = HEAP8[$312 + (($570 + $558 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$544 + 3 >> 0] = HEAP8[$312 + (($558 - $570 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$544 + 2 >> 0] = HEAP8[$312 + ($560 >>> 18 & 1023) >> 0] | 0; + STACKTOP = sp; + return; +} + +function __ZN6vision10DoGPyramid25difference_image_binomialERNS_5ImageERKS1_S4_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$041 = 0, $102 = 0, $106 = 0, $107 = 0, $115 = 0, $12 = 0, $120 = 0, $124 = 0, $125 = 0, $133 = 0, $138 = 0, $142 = 0, $143 = 0, $151 = 0, $156 = 0, $160 = 0, $161 = 0, $169 = 0, $17 = 0, $174 = 0, $178 = 0, $181 = 0, $182 = 0, $183 = 0, $21 = 0, $29 = 0, $34 = 0, $38 = 0, $4 = 0, $46 = 0, $51 = 0, $55 = 0, $63 = 0, $68 = 0, $72 = 0, $80 = 0, $85 = 0, $89 = 0, $97 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp; + if ((__ZNK6vision5Image4typeEv($1) | 0) != 2) { + $12 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 27182) | 0, 26748) | 0, 39072) | 0, 86) | 0, 39079) | 0, 27227) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $12 + (HEAP32[(HEAP32[$12 >> 2] | 0) + -12 >> 2] | 0) | 0); + $17 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $21 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$17 >> 2] | 0) + 28 >> 2] & 127]($17, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($12, $21) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($12) | 0; + _abort(); + } + if ((__ZNK6vision5Image4typeEv($2) | 0) != 2) { + $29 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 27253) | 0, 26748) | 0, 39072) | 0, 87) | 0, 39079) | 0, 27227) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $29 + (HEAP32[(HEAP32[$29 >> 2] | 0) + -12 >> 2] | 0) | 0); + $34 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $38 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$34 >> 2] | 0) + 28 >> 2] & 127]($34, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($29, $38) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($29) | 0; + _abort(); + } + if ((__ZNK6vision5Image4typeEv($3) | 0) != 2) { + $46 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 27300) | 0, 26748) | 0, 39072) | 0, 88) | 0, 39079) | 0, 27227) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $46 + (HEAP32[(HEAP32[$46 >> 2] | 0) + -12 >> 2] | 0) | 0); + $51 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $55 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$51 >> 2] | 0) + 28 >> 2] & 127]($51, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($46, $55) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($46) | 0; + _abort(); + } + if ((__ZNK6vision5Image8channelsEv($1) | 0) != 1) { + $63 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 27347) | 0, 26748) | 0, 39072) | 0, 89) | 0, 39079) | 0, 27388) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $63 + (HEAP32[(HEAP32[$63 >> 2] | 0) + -12 >> 2] | 0) | 0); + $68 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $72 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$68 >> 2] | 0) + 28 >> 2] & 127]($68, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($63, $72) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($63) | 0; + _abort(); + } + if ((__ZNK6vision5Image8channelsEv($2) | 0) != 1) { + $80 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 27425) | 0, 26748) | 0, 39072) | 0, 90) | 0, 39079) | 0, 27388) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $80 + (HEAP32[(HEAP32[$80 >> 2] | 0) + -12 >> 2] | 0) | 0); + $85 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $89 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$85 >> 2] | 0) + 28 >> 2] & 127]($85, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($80, $89) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($80) | 0; + _abort(); + } + if ((__ZNK6vision5Image8channelsEv($3) | 0) != 1) { + $97 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 27468) | 0, 26748) | 0, 39072) | 0, 91) | 0, 39079) | 0, 27388) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $97 + (HEAP32[(HEAP32[$97 >> 2] | 0) + -12 >> 2] | 0) | 0); + $102 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $106 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$102 >> 2] | 0) + 28 >> 2] & 127]($102, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($97, $106) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($97) | 0; + _abort(); + } + $107 = __ZNK6vision5Image5widthEv($1) | 0; + if (($107 | 0) != (__ZNK6vision5Image5widthEv($3) | 0)) { + $115 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 27511) | 0, 26748) | 0, 39072) | 0, 92) | 0, 39079) | 0, 27559) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $115 + (HEAP32[(HEAP32[$115 >> 2] | 0) + -12 >> 2] | 0) | 0); + $120 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $124 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$120 >> 2] | 0) + 28 >> 2] & 127]($120, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($115, $124) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($115) | 0; + _abort(); + } + $125 = __ZNK6vision5Image6heightEv($1) | 0; + if (($125 | 0) != (__ZNK6vision5Image6heightEv($3) | 0)) { + $133 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 27591) | 0, 26748) | 0, 39072) | 0, 93) | 0, 39079) | 0, 27641) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $133 + (HEAP32[(HEAP32[$133 >> 2] | 0) + -12 >> 2] | 0) | 0); + $138 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $142 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$138 >> 2] | 0) + 28 >> 2] & 127]($138, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($133, $142) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($133) | 0; + _abort(); + } + $143 = __ZNK6vision5Image5widthEv($2) | 0; + if (($143 | 0) != (__ZNK6vision5Image5widthEv($3) | 0)) { + $151 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 27674) | 0, 26748) | 0, 39072) | 0, 94) | 0, 39079) | 0, 27559) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $151 + (HEAP32[(HEAP32[$151 >> 2] | 0) + -12 >> 2] | 0) | 0); + $156 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $160 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$156 >> 2] | 0) + 28 >> 2] & 127]($156, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($151, $160) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($151) | 0; + _abort(); + } + $161 = __ZNK6vision5Image6heightEv($2) | 0; + if (($161 | 0) != (__ZNK6vision5Image6heightEv($3) | 0)) { + $169 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 27724) | 0, 26748) | 0, 39072) | 0, 95) | 0, 39079) | 0, 27641) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $169 + (HEAP32[(HEAP32[$169 >> 2] | 0) + -12 >> 2] | 0) | 0); + $174 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $178 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$174 >> 2] | 0) + 28 >> 2] & 127]($174, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($169, $178) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($169) | 0; + _abort(); + } + $$041 = 0; + while (1) { + if ($$041 >>> 0 >= (__ZNK6vision5Image6heightEv($2) | 0) >>> 0) break; + $181 = __ZN6vision5Image3getIfEEPT_m($1, $$041) | 0; + $182 = __ZNK6vision5Image3getIfEEPKT_m($2, $$041) | 0; + $183 = __ZNK6vision5Image3getIfEEPKT_m($3, $$041) | 0; + $$0 = 0; + while (1) { + if ($$0 >>> 0 >= (__ZNK6vision5Image5widthEv($2) | 0) >>> 0) break; + HEAPF32[$181 + ($$0 << 2) >> 2] = +HEAPF32[$182 + ($$0 << 2) >> 2] - +HEAPF32[$183 + ($$0 << 2) >> 2]; + $$0 = $$0 + 1 | 0; + } + $$041 = $$041 + 1 | 0; + } + STACKTOP = sp; + return; +} + +function ___intscan($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0154215 = 0, $$0157 = 0, $$0159 = 0, $$1155184 = 0, $$1158 = 0, $$1160 = 0, $$1160170 = 0, $$1165 = 0, $$1165168 = 0, $$1165169 = 0, $$2156202 = 0, $$3162208 = 0, $$4163$lcssa = 0, $$6$lcssa = 0, $$7190 = 0, $$8 = 0, $$pre$phi237Z2D = 0, $$pre$phi239Z2D = 0, $104 = 0, $112 = 0, $128 = 0, $130 = 0, $131 = 0, $135 = 0, $136 = 0, $144 = 0, $145 = 0, $150 = 0, $151 = 0, $154 = 0, $156 = 0, $16 = 0, $160 = 0, $161 = 0, $162 = 0, $163 = 0, $165 = 0, $166 = 0, $167 = 0, $175 = 0, $185 = 0, $186 = 0, $190 = 0, $191 = 0, $199 = 0, $20 = 0, $200 = 0, $206 = 0, $207 = 0, $209 = 0, $21 = 0, $211 = 0, $215 = 0, $216 = 0, $217 = 0, $218 = 0, $225 = 0, $226 = 0, $227 = 0, $235 = 0, $243 = 0, $251 = 0, $255 = 0, $265 = 0, $267 = 0, $276 = 0, $277 = 0, $28 = 0, $284 = 0, $286 = 0, $289 = 0, $291 = 0, $292 = 0, $293 = 0, $294 = 0, $295 = 0, $296 = 0, $297 = 0, $298 = 0, $32 = 0, $40 = 0, $42 = 0, $50 = 0, $54 = 0, $6 = 0, $68 = 0, $7 = 0, $70 = 0, $74 = 0, $75 = 0, $8 = 0, $83 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $93 = 0, $94 = 0, $96 = 0, $spec$select166 = 0, label = 0; + L1 : do if ($1 >>> 0 > 36) { + $6 = ___errno_location() | 0; + HEAP32[$6 >> 2] = 28; + $291 = 0; + $292 = 0; + } else { + $7 = $0 + 4 | 0; + $8 = $0 + 104 | 0; + do { + $9 = HEAP32[$7 >> 2] | 0; + if ($9 >>> 0 < (HEAP32[$8 >> 2] | 0) >>> 0) { + HEAP32[$7 >> 2] = $9 + 1; + $16 = HEAPU8[$9 >> 0] | 0; + } else $16 = ___shgetc($0) | 0; + } while ((_isspace($16) | 0) != 0); + L11 : do switch ($16 | 0) { + case 43: + case 45: + { + $20 = (($16 | 0) == 45) << 31 >> 31; + $21 = HEAP32[$7 >> 2] | 0; + if ($21 >>> 0 < (HEAP32[$8 >> 2] | 0) >>> 0) { + HEAP32[$7 >> 2] = $21 + 1; + $$0157 = $20; + $$0159 = HEAPU8[$21 >> 0] | 0; + break L11; + } else { + $$0157 = $20; + $$0159 = ___shgetc($0) | 0; + break L11; + } + break; + } + default: + { + $$0157 = 0; + $$0159 = $16; + } + } while (0); + $28 = ($1 | 0) == 0; + do if (($1 | 16 | 0) == 16 & ($$0159 | 0) == 48) { + $32 = HEAP32[$7 >> 2] | 0; + if ($32 >>> 0 < (HEAP32[$8 >> 2] | 0) >>> 0) { + HEAP32[$7 >> 2] = $32 + 1; + $40 = HEAPU8[$32 >> 0] | 0; + } else $40 = ___shgetc($0) | 0; + if (($40 | 32 | 0) != 120) if ($28) { + $$1160170 = $40; + $$1165168 = 8; + label = 47; + break; + } else { + $$1160 = $40; + $$1165 = $1; + label = 32; + break; + } + $42 = HEAP32[$7 >> 2] | 0; + if ($42 >>> 0 < (HEAP32[$8 >> 2] | 0) >>> 0) { + HEAP32[$7 >> 2] = $42 + 1; + $50 = HEAPU8[$42 >> 0] | 0; + } else $50 = ___shgetc($0) | 0; + if ((HEAPU8[5937 + $50 >> 0] | 0) > 15) { + $54 = (HEAP32[$8 >> 2] | 0) == 0; + if (!$54) HEAP32[$7 >> 2] = (HEAP32[$7 >> 2] | 0) + -1; + if (!$2) { + ___shlim($0, 0, 0); + $291 = 0; + $292 = 0; + break L1; + } + if ($54) { + $291 = 0; + $292 = 0; + break L1; + } + HEAP32[$7 >> 2] = (HEAP32[$7 >> 2] | 0) + -1; + $291 = 0; + $292 = 0; + break L1; + } else { + $$1160170 = $50; + $$1165168 = 16; + label = 47; + } + } else { + $spec$select166 = $28 ? 10 : $1; + if ($spec$select166 >>> 0 > (HEAPU8[5937 + $$0159 >> 0] | 0) >>> 0) { + $$1160 = $$0159; + $$1165 = $spec$select166; + label = 32; + } else { + if (HEAP32[$8 >> 2] | 0) HEAP32[$7 >> 2] = (HEAP32[$7 >> 2] | 0) + -1; + ___shlim($0, 0, 0); + $68 = ___errno_location() | 0; + HEAP32[$68 >> 2] = 28; + $291 = 0; + $292 = 0; + break L1; + } + } while (0); + L43 : do if ((label | 0) == 32) if (($$1165 | 0) == 10) { + $70 = $$1160 + -48 | 0; + if ($70 >>> 0 < 10) { + $$0154215 = 0; + $74 = $70; + do { + $$0154215 = ($$0154215 * 10 | 0) + $74 | 0; + $75 = HEAP32[$7 >> 2] | 0; + if ($75 >>> 0 < (HEAP32[$8 >> 2] | 0) >>> 0) { + HEAP32[$7 >> 2] = $75 + 1; + $83 = HEAPU8[$75 >> 0] | 0; + } else $83 = ___shgetc($0) | 0; + $74 = $83 + -48 | 0; + } while ($74 >>> 0 < 10 & $$0154215 >>> 0 < 429496729); + if ($74 >>> 0 < 10) { + $$3162208 = $83; + $88 = $$0154215; + $89 = 0; + $93 = $74; + while (1) { + $90 = ___muldi3($88 | 0, $89 | 0, 10, 0) | 0; + $91 = getTempRet0() | 0; + $94 = (($93 | 0) < 0) << 31 >> 31; + $96 = ~$94; + if ($91 >>> 0 > $96 >>> 0 | ($91 | 0) == ($96 | 0) & $90 >>> 0 > ~$93 >>> 0) { + $$1165169 = 10; + $$8 = $$3162208; + $293 = $88; + $294 = $89; + label = 76; + break L43; + } + $88 = _i64Add($90 | 0, $91 | 0, $93 | 0, $94 | 0) | 0; + $89 = getTempRet0() | 0; + $104 = HEAP32[$7 >> 2] | 0; + if ($104 >>> 0 < (HEAP32[$8 >> 2] | 0) >>> 0) { + HEAP32[$7 >> 2] = $104 + 1; + $112 = HEAPU8[$104 >> 0] | 0; + } else $112 = ___shgetc($0) | 0; + $93 = $112 + -48 | 0; + if (!($93 >>> 0 < 10 & ($89 >>> 0 < 429496729 | ($89 | 0) == 429496729 & $88 >>> 0 < 2576980378))) break; else $$3162208 = $112; + } + if ($93 >>> 0 > 9) { + $$1158 = $$0157; + $265 = $89; + $267 = $88; + } else { + $$1165169 = 10; + $$8 = $112; + $293 = $88; + $294 = $89; + label = 76; + } + } else { + $$1158 = $$0157; + $265 = 0; + $267 = $$0154215; + } + } else { + $$1158 = $$0157; + $265 = 0; + $267 = 0; + } + } else { + $$1160170 = $$1160; + $$1165168 = $$1165; + label = 47; + } while (0); + L63 : do if ((label | 0) == 47) { + if (!($$1165168 + -1 & $$1165168)) { + $128 = HEAP8[50731 + (($$1165168 * 23 | 0) >>> 5 & 7) >> 0] | 0; + $130 = HEAP8[5937 + $$1160170 >> 0] | 0; + $131 = $130 & 255; + if ($$1165168 >>> 0 > $131 >>> 0) { + $$1155184 = 0; + $135 = $131; + do { + $$1155184 = $135 | $$1155184 << $128; + $136 = HEAP32[$7 >> 2] | 0; + if ($136 >>> 0 < (HEAP32[$8 >> 2] | 0) >>> 0) { + HEAP32[$7 >> 2] = $136 + 1; + $144 = HEAPU8[$136 >> 0] | 0; + } else $144 = ___shgetc($0) | 0; + $145 = HEAP8[5937 + $144 >> 0] | 0; + $135 = $145 & 255; + } while ($$1155184 >>> 0 < 134217728 & $$1165168 >>> 0 > $135 >>> 0); + $$4163$lcssa = $144; + $$pre$phi237Z2D = $135; + $154 = 0; + $156 = $$1155184; + $295 = $145; + } else { + $$4163$lcssa = $$1160170; + $$pre$phi237Z2D = $131; + $154 = 0; + $156 = 0; + $295 = $130; + } + $150 = _bitshift64Lshr(-1, -1, $128 | 0) | 0; + $151 = getTempRet0() | 0; + if ($$1165168 >>> 0 <= $$pre$phi237Z2D >>> 0 | ($151 >>> 0 < $154 >>> 0 | ($151 | 0) == ($154 | 0) & $150 >>> 0 < $156 >>> 0)) { + $$1165169 = $$1165168; + $$8 = $$4163$lcssa; + $293 = $156; + $294 = $154; + label = 76; + break; + } + $160 = $156; + $161 = $154; + $165 = $295; + while (1) { + $162 = _bitshift64Shl($160 | 0, $161 | 0, $128 | 0) | 0; + $163 = getTempRet0() | 0; + $166 = $162 | $165 & 255; + $167 = HEAP32[$7 >> 2] | 0; + if ($167 >>> 0 < (HEAP32[$8 >> 2] | 0) >>> 0) { + HEAP32[$7 >> 2] = $167 + 1; + $175 = HEAPU8[$167 >> 0] | 0; + } else $175 = ___shgetc($0) | 0; + $165 = HEAP8[5937 + $175 >> 0] | 0; + if ($$1165168 >>> 0 <= ($165 & 255) >>> 0 | ($163 >>> 0 > $151 >>> 0 | ($163 | 0) == ($151 | 0) & $166 >>> 0 > $150 >>> 0)) { + $$1165169 = $$1165168; + $$8 = $175; + $293 = $166; + $294 = $163; + label = 76; + break L63; + } else { + $160 = $166; + $161 = $163; + } + } + } + $185 = HEAP8[5937 + $$1160170 >> 0] | 0; + $186 = $185 & 255; + if ($$1165168 >>> 0 > $186 >>> 0) { + $$2156202 = 0; + $190 = $186; + do { + $$2156202 = $190 + (Math_imul($$2156202, $$1165168) | 0) | 0; + $191 = HEAP32[$7 >> 2] | 0; + if ($191 >>> 0 < (HEAP32[$8 >> 2] | 0) >>> 0) { + HEAP32[$7 >> 2] = $191 + 1; + $199 = HEAPU8[$191 >> 0] | 0; + } else $199 = ___shgetc($0) | 0; + $200 = HEAP8[5937 + $199 >> 0] | 0; + $190 = $200 & 255; + } while ($$2156202 >>> 0 < 119304647 & $$1165168 >>> 0 > $190 >>> 0); + $$6$lcssa = $199; + $$pre$phi239Z2D = $190; + $296 = $200; + $297 = $$2156202; + $298 = 0; + } else { + $$6$lcssa = $$1160170; + $$pre$phi239Z2D = $186; + $296 = $185; + $297 = 0; + $298 = 0; + } + if ($$1165168 >>> 0 > $$pre$phi239Z2D >>> 0) { + $206 = ___udivdi3(-1, -1, $$1165168 | 0, 0) | 0; + $207 = getTempRet0() | 0; + $$7190 = $$6$lcssa; + $209 = $298; + $211 = $297; + $218 = $296; + while (1) { + if ($209 >>> 0 > $207 >>> 0 | ($209 | 0) == ($207 | 0) & $211 >>> 0 > $206 >>> 0) { + $$1165169 = $$1165168; + $$8 = $$7190; + $293 = $211; + $294 = $209; + label = 76; + break L63; + } + $215 = ___muldi3($211 | 0, $209 | 0, $$1165168 | 0, 0) | 0; + $216 = getTempRet0() | 0; + $217 = $218 & 255; + if ($216 >>> 0 > 4294967295 | ($216 | 0) == -1 & $215 >>> 0 > ~$217 >>> 0) { + $$1165169 = $$1165168; + $$8 = $$7190; + $293 = $211; + $294 = $209; + label = 76; + break L63; + } + $225 = _i64Add($215 | 0, $216 | 0, $217 | 0, 0) | 0; + $226 = getTempRet0() | 0; + $227 = HEAP32[$7 >> 2] | 0; + if ($227 >>> 0 < (HEAP32[$8 >> 2] | 0) >>> 0) { + HEAP32[$7 >> 2] = $227 + 1; + $235 = HEAPU8[$227 >> 0] | 0; + } else $235 = ___shgetc($0) | 0; + $218 = HEAP8[5937 + $235 >> 0] | 0; + if ($$1165168 >>> 0 <= ($218 & 255) >>> 0) { + $$1165169 = $$1165168; + $$8 = $235; + $293 = $225; + $294 = $226; + label = 76; + break; + } else { + $$7190 = $235; + $209 = $226; + $211 = $225; + } + } + } else { + $$1165169 = $$1165168; + $$8 = $$6$lcssa; + $293 = $297; + $294 = $298; + label = 76; + } + } while (0); + if ((label | 0) == 76) if ($$1165169 >>> 0 > (HEAPU8[5937 + $$8 >> 0] | 0) >>> 0) { + do { + $243 = HEAP32[$7 >> 2] | 0; + if ($243 >>> 0 < (HEAP32[$8 >> 2] | 0) >>> 0) { + HEAP32[$7 >> 2] = $243 + 1; + $251 = HEAPU8[$243 >> 0] | 0; + } else $251 = ___shgetc($0) | 0; + } while ($$1165169 >>> 0 > (HEAPU8[5937 + $251 >> 0] | 0) >>> 0); + $255 = ___errno_location() | 0; + HEAP32[$255 >> 2] = 68; + $$1158 = ($3 & 1 | 0) == 0 & 0 == 0 ? $$0157 : 0; + $265 = $4; + $267 = $3; + } else { + $$1158 = $$0157; + $265 = $294; + $267 = $293; + } + if (HEAP32[$8 >> 2] | 0) HEAP32[$7 >> 2] = (HEAP32[$7 >> 2] | 0) + -1; + if (!($265 >>> 0 < $4 >>> 0 | ($265 | 0) == ($4 | 0) & $267 >>> 0 < $3 >>> 0)) { + if (!(($3 & 1 | 0) != 0 | 0 != 0 | ($$1158 | 0) != 0)) { + $276 = ___errno_location() | 0; + HEAP32[$276 >> 2] = 68; + $277 = _i64Add($3 | 0, $4 | 0, -1, -1) | 0; + $291 = getTempRet0() | 0; + $292 = $277; + break; + } + if ($265 >>> 0 > $4 >>> 0 | ($265 | 0) == ($4 | 0) & $267 >>> 0 > $3 >>> 0) { + $284 = ___errno_location() | 0; + HEAP32[$284 >> 2] = 68; + $291 = $4; + $292 = $3; + break; + } + } + $286 = (($$1158 | 0) < 0) << 31 >> 31; + $289 = _i64Subtract($267 ^ $$1158 | 0, $265 ^ $286 | 0, $$1158 | 0, $286 | 0) | 0; + $291 = getTempRet0() | 0; + $292 = $289; + } while (0); + setTempRet0($291 | 0); + return $292 | 0; +} + +function _ar2GetBestMatchingSubFine($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0231 = 0, $$0232 = 0, $$0239 = 0, $$0251 = 0, $$0257 = 0, $$0263 = 0, $$0282 = 0, $$1 = 0, $$10 = 0, $$10249 = 0, $$10273 = 0, $$10292 = 0, $$11 = 0, $$11250 = 0, $$11274 = 0, $$11293 = 0, $$12 = 0, $$12275 = 0, $$12294 = 0, $$1233 = 0, $$1240 = 0, $$1252 = 0, $$1258 = 0, $$1264 = 0, $$1283 = 0, $$13 = 0, $$13276 = 0, $$13295 = 0, $$14 = 0, $$14277 = 0, $$14296 = 0, $$15 = 0, $$15278 = 0, $$15297 = 0, $$16 = 0, $$16279 = 0, $$16298 = 0, $$17 = 0, $$17280 = 0, $$17299 = 0, $$18 = 0, $$18281 = 0, $$18300 = 0, $$2 = 0, $$2234 = 0, $$2241 = 0, $$2253 = 0, $$2259 = 0, $$2265 = 0, $$2284 = 0, $$3 = 0, $$3235 = 0, $$3242 = 0, $$3254 = 0, $$3260 = 0, $$3266 = 0, $$3285 = 0, $$4 = 0, $$4236 = 0, $$4243 = 0, $$4255 = 0, $$4261 = 0, $$4267 = 0, $$4286 = 0, $$5 = 0, $$5237 = 0, $$5244 = 0, $$5256 = 0, $$5262 = 0, $$5268 = 0, $$5287 = 0, $$6 = 0, $$6238 = 0, $$6245 = 0, $$6269 = 0, $$6288 = 0, $$7 = 0, $$7246 = 0, $$7270 = 0, $$7289 = 0, $$8 = 0, $$8247 = 0, $$8271 = 0, $$8290 = 0, $$9 = 0, $$9248 = 0, $$9272 = 0, $$9291 = 0, $101 = 0, $102 = 0, $108 = 0, $11 = 0, $110 = 0, $123 = 0, $13 = 0, $139 = 0, $140 = 0, $141 = 0, $146 = 0, $147 = 0, $153 = 0, $155 = 0, $16 = 0, $169 = 0, $18 = 0, $183 = 0, $184 = 0, $185 = 0, $190 = 0, $191 = 0, $197 = 0, $199 = 0, $204 = 0, $218 = 0, $219 = 0, $220 = 0, $225 = 0, $226 = 0, $232 = 0, $234 = 0, $238 = 0, $249 = 0, $252 = 0, $259 = 0, $26 = 0, $29 = 0, $33 = 0, $49 = 0, $50 = 0, $51 = 0, $56 = 0, $57 = 0, $63 = 0, $65 = 0, $78 = 0, $8 = 0, $94 = 0, $95 = 0, $96 = 0, $storemerge = 0; + $8 = HEAP32[$3 + 24 >> 2] | 0; + L1 : do switch ($2 | 0) { + case 5: + case 12: + case 13: + case 14: + { + $11 = 0 - (HEAP32[$3 + 8 >> 2] | 0) | 0; + $13 = HEAP32[$3 + 12 >> 2] | 0; + $16 = 0 - (HEAP32[$3 + 16 >> 2] | 0) | 0; + $18 = HEAP32[$3 + 20 >> 2] | 0; + $26 = $1 << 1; + $$0231 = $8; + $$0232 = $0 + (($11 << 1) + $4 + (Math_imul(($16 << 1) + $5 | 0, $1) | 0)) | 0; + $$0239 = 0; + $$0251 = $16; + $$0263 = 0; + $$0282 = 0; + while (1) { + if (($$0251 | 0) > ($18 | 0)) { + $$18 = $$0239; + $$18281 = $$0263; + $$18300 = $$0282; + break L1; + } + $$0257 = $11; + $$1 = $$0231; + $$1233 = $$0232; + $$1240 = $$0239; + $$1264 = $$0263; + $$1283 = $$0282; + while (1) { + if (($$0257 | 0) > ($13 | 0)) break; + $29 = HEAP16[$$1 >> 1] | 0; + if ($29 << 16 >> 16 == 4096) { + $$2241 = $$1240; + $$2265 = $$1264; + $$2284 = $$1283; + } else { + $33 = HEAPU8[$$1233 >> 0] | 0; + $$2241 = $$1240 + $33 | 0; + $$2265 = (Math_imul($33, $33) | 0) + $$1264 | 0; + $$2284 = (Math_imul($33, $29 & 65535) | 0) + $$1283 | 0; + } + $$0257 = $$0257 + 1 | 0; + $$1 = $$1 + 2 | 0; + $$1233 = $$1233 + 2 | 0; + $$1240 = $$2241; + $$1264 = $$2265; + $$1283 = $$2284; + } + $$0231 = $$1; + $$0232 = $$0232 + $26 | 0; + $$0239 = $$1240; + $$0251 = $$0251 + 1 | 0; + $$0263 = $$1264; + $$0282 = $$1283; + } + break; + } + default: + { + if ($2 >>> 0 < 2) { + $49 = HEAP32[$3 + 20 >> 2] | 0; + $50 = $3 + 8 | 0; + $51 = $3 + 12 | 0; + $$1252 = 0 - (HEAP32[$3 + 16 >> 2] | 0) | 0; + $$2 = $8; + $$3242 = 0; + $$3266 = 0; + $$3285 = 0; + while (1) { + if (($$1252 | 0) > ($49 | 0)) { + $$18 = $$3242; + $$18281 = $$3266; + $$18300 = $$3285; + break L1; + } + $56 = (Math_imul(($$1252 << 1) + $5 | 0, $1) | 0) + $4 | 0; + $57 = HEAP32[$50 >> 2] | 0; + $63 = HEAP32[$51 >> 2] | 0; + $$1258 = 0 - $57 | 0; + $$2234 = $0 + (($56 - ($57 << 1) | 0) * 3 | 0) | 0; + $$3 = $$2; + $$4243 = $$3242; + $$4267 = $$3266; + $$4286 = $$3285; + while (1) { + if (($$1258 | 0) > ($63 | 0)) break; + $65 = HEAP16[$$3 >> 1] | 0; + if ($65 << 16 >> 16 == 4096) { + $$5244 = $$4243; + $$5268 = $$4267; + $$5287 = $$4286; + } else { + $78 = (((HEAPU8[$$2234 + 1 >> 0] | 0) + (HEAPU8[$$2234 >> 0] | 0) + (HEAPU8[$$2234 + 2 >> 0] | 0) | 0) >>> 0) / 3 | 0; + $$5244 = $78 + $$4243 | 0; + $$5268 = (Math_imul($78, $78) | 0) + $$4267 | 0; + $$5287 = (Math_imul($78, $65 & 65535) | 0) + $$4286 | 0; + } + $$1258 = $$1258 + 1 | 0; + $$2234 = $$2234 + 6 | 0; + $$3 = $$3 + 2 | 0; + $$4243 = $$5244; + $$4267 = $$5268; + $$4286 = $$5287; + } + $$1252 = $$1252 + 1 | 0; + $$2 = $$3; + $$3242 = $$4243; + $$3266 = $$4267; + $$3285 = $$4286; + } + } + if (($2 | 1 | 0) == 3) { + $94 = HEAP32[$3 + 20 >> 2] | 0; + $95 = $3 + 8 | 0; + $96 = $3 + 12 | 0; + $$2253 = 0 - (HEAP32[$3 + 16 >> 2] | 0) | 0; + $$4 = $8; + $$6245 = 0; + $$6269 = 0; + $$6288 = 0; + while (1) { + if (($$2253 | 0) > ($94 | 0)) { + $$18 = $$6245; + $$18281 = $$6269; + $$18300 = $$6288; + break L1; + } + $101 = (Math_imul(($$2253 << 1) + $5 | 0, $1) | 0) + $4 | 0; + $102 = HEAP32[$95 >> 2] | 0; + $108 = HEAP32[$96 >> 2] | 0; + $$2259 = 0 - $102 | 0; + $$3235 = $0 + ($101 - ($102 << 1) << 2) | 0; + $$5 = $$4; + $$7246 = $$6245; + $$7270 = $$6269; + $$7289 = $$6288; + while (1) { + if (($$2259 | 0) > ($108 | 0)) break; + $110 = HEAP16[$$5 >> 1] | 0; + if ($110 << 16 >> 16 == 4096) { + $$8247 = $$7246; + $$8271 = $$7270; + $$8290 = $$7289; + } else { + $123 = (((HEAPU8[$$3235 + 1 >> 0] | 0) + (HEAPU8[$$3235 >> 0] | 0) + (HEAPU8[$$3235 + 2 >> 0] | 0) | 0) >>> 0) / 3 | 0; + $$8247 = $123 + $$7246 | 0; + $$8271 = (Math_imul($123, $123) | 0) + $$7270 | 0; + $$8290 = (Math_imul($123, $110 & 65535) | 0) + $$7289 | 0; + } + $$2259 = $$2259 + 1 | 0; + $$3235 = $$3235 + 8 | 0; + $$5 = $$5 + 2 | 0; + $$7246 = $$8247; + $$7270 = $$8271; + $$7289 = $$8290; + } + $$2253 = $$2253 + 1 | 0; + $$4 = $$5; + $$6245 = $$7246; + $$6269 = $$7270; + $$6288 = $$7289; + } + } + if (($2 | 2 | 0) == 6) { + $139 = HEAP32[$3 + 20 >> 2] | 0; + $140 = $3 + 8 | 0; + $141 = $3 + 12 | 0; + $$3254 = 0 - (HEAP32[$3 + 16 >> 2] | 0) | 0; + $$6 = $8; + $$9248 = 0; + $$9272 = 0; + $$9291 = 0; + while (1) { + if (($$3254 | 0) > ($139 | 0)) { + $$18 = $$9248; + $$18281 = $$9272; + $$18300 = $$9291; + break L1; + } + $146 = (Math_imul(($$3254 << 1) + $5 | 0, $1) | 0) + $4 | 0; + $147 = HEAP32[$140 >> 2] | 0; + $153 = HEAP32[$141 >> 2] | 0; + $$10249 = $$9248; + $$10273 = $$9272; + $$10292 = $$9291; + $$3260 = 0 - $147 | 0; + $$4236 = $0 + ($146 - ($147 << 1) << 2) | 0; + $$7 = $$6; + while (1) { + if (($$3260 | 0) > ($153 | 0)) break; + $155 = HEAP16[$$7 >> 1] | 0; + if ($155 << 16 >> 16 == 4096) { + $$11250 = $$10249; + $$11274 = $$10273; + $$11293 = $$10292; + } else { + $169 = (((HEAPU8[$$4236 + 2 >> 0] | 0) + (HEAPU8[$$4236 + 1 >> 0] | 0) + (HEAPU8[$$4236 + 3 >> 0] | 0) | 0) >>> 0) / 3 | 0; + $$11250 = $169 + $$10249 | 0; + $$11274 = (Math_imul($169, $169) | 0) + $$10273 | 0; + $$11293 = (Math_imul($169, $155 & 65535) | 0) + $$10292 | 0; + } + $$10249 = $$11250; + $$10273 = $$11274; + $$10292 = $$11293; + $$3260 = $$3260 + 1 | 0; + $$4236 = $$4236 + 8 | 0; + $$7 = $$7 + 2 | 0; + } + $$3254 = $$3254 + 1 | 0; + $$6 = $$7; + $$9248 = $$10249; + $$9272 = $$10273; + $$9291 = $$10292; + } + } + switch ($2 | 0) { + case 7: + { + $183 = HEAP32[$3 + 20 >> 2] | 0; + $184 = $3 + 8 | 0; + $185 = $3 + 12 | 0; + $$12 = 0; + $$12275 = 0; + $$12294 = 0; + $$4255 = 0 - (HEAP32[$3 + 16 >> 2] | 0) | 0; + $$8 = $8; + while (1) { + if (($$4255 | 0) > ($183 | 0)) { + $$18 = $$12; + $$18281 = $$12275; + $$18300 = $$12294; + break L1; + } + $190 = (Math_imul(($$4255 << 1) + $5 | 0, $1) | 0) + $4 | 0; + $191 = HEAP32[$184 >> 2] | 0; + $197 = HEAP32[$185 >> 2] | 0; + $$13 = $$12; + $$13276 = $$12275; + $$13295 = $$12294; + $$4261 = 0 - $191 | 0; + $$5237 = $0 + ($190 - ($191 << 1) << 1) | 0; + $$9 = $$8; + while (1) { + if (($$4261 | 0) > ($197 | 0)) break; + $199 = HEAP16[$$9 >> 1] | 0; + if ($199 << 16 >> 16 == 4096) { + $$14 = $$13; + $$14277 = $$13276; + $$14296 = $$13295; + } else { + $204 = HEAPU8[$$5237 + 1 >> 0] | 0; + $$14 = $$13 + $204 | 0; + $$14277 = (Math_imul($204, $204) | 0) + $$13276 | 0; + $$14296 = (Math_imul($204, $199 & 65535) | 0) + $$13295 | 0; + } + $$13 = $$14; + $$13276 = $$14277; + $$13295 = $$14296; + $$4261 = $$4261 + 1 | 0; + $$5237 = $$5237 + 4 | 0; + $$9 = $$9 + 2 | 0; + } + $$12 = $$13; + $$12275 = $$13276; + $$12294 = $$13295; + $$4255 = $$4255 + 1 | 0; + $$8 = $$9; + } + break; + } + case 8: + { + $218 = HEAP32[$3 + 20 >> 2] | 0; + $219 = $3 + 8 | 0; + $220 = $3 + 12 | 0; + $$10 = $8; + $$15 = 0; + $$15278 = 0; + $$15297 = 0; + $$5256 = 0 - (HEAP32[$3 + 16 >> 2] | 0) | 0; + while (1) { + if (($$5256 | 0) > ($218 | 0)) { + $$18 = $$15; + $$18281 = $$15278; + $$18300 = $$15297; + break L1; + } + $225 = (Math_imul(($$5256 << 1) + $5 | 0, $1) | 0) + $4 | 0; + $226 = HEAP32[$219 >> 2] | 0; + $232 = HEAP32[$220 >> 2] | 0; + $$11 = $$10; + $$16 = $$15; + $$16279 = $$15278; + $$16298 = $$15297; + $$5262 = 0 - $226 | 0; + $$6238 = $0 + ($225 - ($226 << 1) << 1) | 0; + while (1) { + if (($$5262 | 0) > ($232 | 0)) break; + $234 = HEAP16[$$11 >> 1] | 0; + if ($234 << 16 >> 16 == 4096) { + $$17 = $$16; + $$17280 = $$16279; + $$17299 = $$16298; + } else { + $238 = HEAPU8[$$6238 >> 0] | 0; + $$17 = $$16 + $238 | 0; + $$17280 = (Math_imul($238, $238) | 0) + $$16279 | 0; + $$17299 = (Math_imul($238, $234 & 65535) | 0) + $$16298 | 0; + } + $$11 = $$11 + 2 | 0; + $$16 = $$17; + $$16279 = $$17280; + $$16298 = $$17299; + $$5262 = $$5262 + 1 | 0; + $$6238 = $$6238 + 4 | 0; + } + $$10 = $$11; + $$15 = $$16; + $$15278 = $$16279; + $$15297 = $$16298; + $$5256 = $$5256 + 1 | 0; + } + break; + } + default: + { + $$18 = 0; + $$18281 = 0; + $$18300 = 0; + break L1; + } + } + } + } while (0); + $249 = HEAP32[$3 + 36 >> 2] | 0; + $252 = $$18281 - ((Math_imul($$18, $$18) | 0) / ($249 | 0) | 0) | 0; + if (!$252) $storemerge = 0; else { + $259 = ($$18300 - ((Math_imul(HEAP32[$3 + 32 >> 2] | 0, $$18) | 0) / ($249 | 0) | 0) | 0) * 100 | 0; + $storemerge = ((($259 | 0) / (HEAP32[$3 + 28 >> 2] | 0) | 0) * 100 | 0) / (~~+Math_sqrt(+(+($252 | 0))) | 0) | 0; + } + HEAP32[$6 >> 2] = $storemerge; + return; +} + +function __ZNSt3__211__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + var $$0$i$i$i = 0, $$0$i$i$i51 = 0, $$0$i$i$i59 = 0, $$0$i$i$i67 = 0, $$0$i$i$i75 = 0, $$0$i$i$i83 = 0, $$0$i$i$i91 = 0, $$0$i$i$i99 = 0, $$pre$phi102Z2D = 0, $$pre$phiZ2D = 0, $10 = 0, $101 = 0, $104 = 0, $108 = 0, $11 = 0, $116 = 0, $12 = 0, $120 = 0, $123 = 0, $127 = 0, $135 = 0, $139 = 0, $143 = 0, $146 = 0, $150 = 0, $158 = 0, $16 = 0, $161 = 0, $165 = 0, $20 = 0, $23 = 0, $27 = 0, $35 = 0, $39 = 0, $42 = 0, $46 = 0, $54 = 0, $58 = 0, $62 = 0, $65 = 0, $69 = 0, $77 = 0, $80 = 0, $84 = 0, $93 = 0, $97 = 0, $storemerge = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $10 = sp + 12 | 0; + $11 = sp; + if ($0) { + $12 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66744) | 0; + if ($1) { + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 44 >> 2] & 255]($10, $12); + $16 = HEAP32[$10 >> 2] | 0; + HEAP8[$3 >> 0] = $16; + HEAP8[$3 + 1 >> 0] = $16 >> 8; + HEAP8[$3 + 2 >> 0] = $16 >> 16; + HEAP8[$3 + 3 >> 0] = $16 >> 24; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 32 >> 2] & 255]($11, $12); + $20 = $8 + 11 | 0; + if ((HEAP8[$20 >> 0] | 0) < 0) { + $23 = HEAP32[$8 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($23, $10); + HEAP32[$8 + 4 >> 2] = 0; + if ((HEAP8[$20 >> 0] | 0) < 0) { + $27 = $8 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$8 >> 2] | 0, HEAP32[$27 >> 2] & 2147483647); + HEAP32[$27 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($8, $10); + HEAP8[$20 >> 0] = 0; + }; + HEAP32[$8 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$8 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$8 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i = 0; + while (1) { + if (($$0$i$i$i | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i << 2) >> 2] = 0; + $$0$i$i$i = $$0$i$i$i + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + $$pre$phiZ2D = $12; + } else { + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 40 >> 2] & 255]($10, $12); + $35 = HEAP32[$10 >> 2] | 0; + HEAP8[$3 >> 0] = $35; + HEAP8[$3 + 1 >> 0] = $35 >> 8; + HEAP8[$3 + 2 >> 0] = $35 >> 16; + HEAP8[$3 + 3 >> 0] = $35 >> 24; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 28 >> 2] & 255]($11, $12); + $39 = $8 + 11 | 0; + if ((HEAP8[$39 >> 0] | 0) < 0) { + $42 = HEAP32[$8 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($42, $10); + HEAP32[$8 + 4 >> 2] = 0; + if ((HEAP8[$39 >> 0] | 0) < 0) { + $46 = $8 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$8 >> 2] | 0, HEAP32[$46 >> 2] & 2147483647); + HEAP32[$46 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($8, $10); + HEAP8[$39 >> 0] = 0; + }; + HEAP32[$8 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$8 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$8 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i51 = 0; + while (1) { + if (($$0$i$i$i51 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i51 << 2) >> 2] = 0; + $$0$i$i$i51 = $$0$i$i$i51 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + $$pre$phiZ2D = $12; + } + $54 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$12 >> 2] | 0) + 12 >> 2] & 127]($12) | 0; + HEAP8[$4 >> 0] = $54; + $58 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$12 >> 2] | 0) + 16 >> 2] & 127]($12) | 0; + HEAP8[$5 >> 0] = $58; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$$pre$phiZ2D >> 2] | 0) + 20 >> 2] & 255]($11, $12); + $62 = $6 + 11 | 0; + if ((HEAP8[$62 >> 0] | 0) < 0) { + $65 = HEAP32[$6 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($65, $10); + HEAP32[$6 + 4 >> 2] = 0; + if ((HEAP8[$62 >> 0] | 0) < 0) { + $69 = $6 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$6 >> 2] | 0, HEAP32[$69 >> 2] & 2147483647); + HEAP32[$69 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($6, $10); + HEAP8[$62 >> 0] = 0; + }; + HEAP32[$6 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$6 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$6 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i59 = 0; + while (1) { + if (($$0$i$i$i59 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i59 << 2) >> 2] = 0; + $$0$i$i$i59 = $$0$i$i$i59 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$$pre$phiZ2D >> 2] | 0) + 24 >> 2] & 255]($11, $12); + $77 = $7 + 11 | 0; + if ((HEAP8[$77 >> 0] | 0) < 0) { + $80 = HEAP32[$7 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($80, $10); + HEAP32[$7 + 4 >> 2] = 0; + if ((HEAP8[$77 >> 0] | 0) < 0) { + $84 = $7 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$7 >> 2] | 0, HEAP32[$84 >> 2] & 2147483647); + HEAP32[$84 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($7, $10); + HEAP8[$77 >> 0] = 0; + }; + HEAP32[$7 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$7 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$7 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i67 = 0; + while (1) { + if (($$0$i$i$i67 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i67 << 2) >> 2] = 0; + $$0$i$i$i67 = $$0$i$i$i67 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + $storemerge = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$12 >> 2] | 0) + 36 >> 2] & 127]($12) | 0; + } else { + $93 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66736) | 0; + if ($1) { + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$93 >> 2] | 0) + 44 >> 2] & 255]($10, $93); + $97 = HEAP32[$10 >> 2] | 0; + HEAP8[$3 >> 0] = $97; + HEAP8[$3 + 1 >> 0] = $97 >> 8; + HEAP8[$3 + 2 >> 0] = $97 >> 16; + HEAP8[$3 + 3 >> 0] = $97 >> 24; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$93 >> 2] | 0) + 32 >> 2] & 255]($11, $93); + $101 = $8 + 11 | 0; + if ((HEAP8[$101 >> 0] | 0) < 0) { + $104 = HEAP32[$8 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($104, $10); + HEAP32[$8 + 4 >> 2] = 0; + if ((HEAP8[$101 >> 0] | 0) < 0) { + $108 = $8 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$8 >> 2] | 0, HEAP32[$108 >> 2] & 2147483647); + HEAP32[$108 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($8, $10); + HEAP8[$101 >> 0] = 0; + }; + HEAP32[$8 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$8 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$8 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i75 = 0; + while (1) { + if (($$0$i$i$i75 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i75 << 2) >> 2] = 0; + $$0$i$i$i75 = $$0$i$i$i75 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + $$pre$phi102Z2D = $93; + } else { + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$93 >> 2] | 0) + 40 >> 2] & 255]($10, $93); + $116 = HEAP32[$10 >> 2] | 0; + HEAP8[$3 >> 0] = $116; + HEAP8[$3 + 1 >> 0] = $116 >> 8; + HEAP8[$3 + 2 >> 0] = $116 >> 16; + HEAP8[$3 + 3 >> 0] = $116 >> 24; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$93 >> 2] | 0) + 28 >> 2] & 255]($11, $93); + $120 = $8 + 11 | 0; + if ((HEAP8[$120 >> 0] | 0) < 0) { + $123 = HEAP32[$8 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($123, $10); + HEAP32[$8 + 4 >> 2] = 0; + if ((HEAP8[$120 >> 0] | 0) < 0) { + $127 = $8 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$8 >> 2] | 0, HEAP32[$127 >> 2] & 2147483647); + HEAP32[$127 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($8, $10); + HEAP8[$120 >> 0] = 0; + }; + HEAP32[$8 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$8 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$8 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i83 = 0; + while (1) { + if (($$0$i$i$i83 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i83 << 2) >> 2] = 0; + $$0$i$i$i83 = $$0$i$i$i83 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + $$pre$phi102Z2D = $93; + } + $135 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$93 >> 2] | 0) + 12 >> 2] & 127]($93) | 0; + HEAP8[$4 >> 0] = $135; + $139 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$93 >> 2] | 0) + 16 >> 2] & 127]($93) | 0; + HEAP8[$5 >> 0] = $139; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$$pre$phi102Z2D >> 2] | 0) + 20 >> 2] & 255]($11, $93); + $143 = $6 + 11 | 0; + if ((HEAP8[$143 >> 0] | 0) < 0) { + $146 = HEAP32[$6 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($146, $10); + HEAP32[$6 + 4 >> 2] = 0; + if ((HEAP8[$143 >> 0] | 0) < 0) { + $150 = $6 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$6 >> 2] | 0, HEAP32[$150 >> 2] & 2147483647); + HEAP32[$150 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($6, $10); + HEAP8[$143 >> 0] = 0; + }; + HEAP32[$6 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$6 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$6 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i91 = 0; + while (1) { + if (($$0$i$i$i91 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i91 << 2) >> 2] = 0; + $$0$i$i$i91 = $$0$i$i$i91 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$$pre$phi102Z2D >> 2] | 0) + 24 >> 2] & 255]($11, $93); + $158 = $7 + 11 | 0; + if ((HEAP8[$158 >> 0] | 0) < 0) { + $161 = HEAP32[$7 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($161, $10); + HEAP32[$7 + 4 >> 2] = 0; + if ((HEAP8[$158 >> 0] | 0) < 0) { + $165 = $7 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$7 >> 2] | 0, HEAP32[$165 >> 2] & 2147483647); + HEAP32[$165 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($7, $10); + HEAP8[$158 >> 0] = 0; + }; + HEAP32[$7 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$7 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$7 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i99 = 0; + while (1) { + if (($$0$i$i$i99 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i99 << 2) >> 2] = 0; + $$0$i$i$i99 = $$0$i$i$i99 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + $storemerge = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$93 >> 2] | 0) + 36 >> 2] & 127]($93) | 0; + } + HEAP32[$9 >> 2] = $storemerge; + STACKTOP = sp; + return; +} + +function _consume_markers($0) { + $0 = $0 | 0; + var $$0 = 0, $$0160168$i = 0, $$0169$i = 0, $$1161166$i = 0, $$1167$i = 0, $$pre183$i = 0, $1 = 0, $10 = 0, $103 = 0, $105 = 0, $108 = 0, $11 = 0, $111 = 0, $113 = 0, $116 = 0, $119 = 0, $12 = 0, $121 = 0, $125 = 0, $129 = 0, $13 = 0, $131 = 0, $135 = 0, $137 = 0, $14 = 0, $141 = 0, $148 = 0, $149 = 0, $15 = 0, $150 = 0, $16 = 0, $160 = 0, $163 = 0, $17 = 0, $174 = 0, $177 = 0, $18 = 0, $180 = 0, $182 = 0, $183 = 0, $184 = 0, $185 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $3 = 0, $32 = 0, $38 = 0, $43 = 0, $45 = 0, $50 = 0, $52 = 0, $6 = 0, $60 = 0, $62 = 0, $63 = 0, $65 = 0, $67 = 0, $7 = 0, $71 = 0, $72 = 0, $74 = 0, $75 = 0, $8 = 0, $80 = 0, $88 = 0, $9 = 0, label = 0; + $1 = $0 + 460 | 0; + $2 = HEAP32[$1 >> 2] | 0; + $3 = $2 + 20 | 0; + if (HEAP32[$3 >> 2] | 0) { + $$0 = 2; + return $$0 | 0; + } + $6 = $0 + 464 | 0; + $7 = $2 + 24 | 0; + $8 = $0 + 340 | 0; + $9 = $2 + 16 | 0; + $10 = $0 + 32 | 0; + $11 = $0 + 212 | 0; + $12 = $0 + 28 | 0; + $13 = $0 + 36 | 0; + $14 = $0 + 316 | 0; + $15 = $0 + 320 | 0; + $16 = $0 + 216 | 0; + $17 = $0 + 220 | 0; + $18 = $0 + 224 | 0; + $19 = $0 + 324 | 0; + $20 = $0 + 328 | 0; + $21 = $0 + 428 | 0; + $22 = $0 + 432 | 0; + $23 = $0 + 436 | 0; + $24 = $0 + 416 | 0; + $25 = $0 + 332 | 0; + $26 = $0 + 412 | 0; + $27 = $0 + 420 | 0; + $28 = $0 + 424 | 0; + L4 : while (1) { + $32 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$6 >> 2] | 0) + 4 >> 2] & 127]($0) | 0; + switch ($32 | 0) { + case 2: + { + label = 58; + break L4; + break; + } + case 1: + break; + default: + { + $$0 = $32; + label = 63; + break L4; + } + } + L7 : do switch (HEAP32[$7 >> 2] | 0) { + case 0: + { + if (!(HEAP32[$9 >> 2] | 0)) { + $163 = HEAP32[$0 >> 2] | 0; + HEAP32[$163 + 20 >> 2] = 36; + FUNCTION_TABLE_vi[HEAP32[$163 >> 2] & 255]($0); + } + if (HEAP32[$8 >> 2] | 0) { + label = 57; + break L4; + } + break; + } + case 1: + { + if ((HEAP32[$10 >> 2] | 0) <= 65500 ? (HEAP32[$12 >> 2] | 0) <= 65500 : 0) {} else { + $38 = HEAP32[$0 >> 2] | 0; + HEAP32[$38 + 20 >> 2] = 42; + HEAP32[$38 + 24 >> 2] = 65500; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $43 = HEAP32[$11 >> 2] | 0; + if (($43 + -8 | 0) >>> 0 > 4) { + $45 = HEAP32[$0 >> 2] | 0; + HEAP32[$45 + 20 >> 2] = 16; + HEAP32[$45 + 24 >> 2] = $43; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $50 = HEAP32[$13 >> 2] | 0; + if (($50 | 0) > 10) { + $52 = HEAP32[$0 >> 2] | 0; + HEAP32[$52 + 20 >> 2] = 27; + HEAP32[$52 + 24 >> 2] = $50; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = 10; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + $60 = HEAP32[$13 >> 2] | 0; + } else $60 = $50; + HEAP32[$14 >> 2] = 1; + HEAP32[$15 >> 2] = 1; + if (($60 | 0) > 0) { + $$0160168$i = 0; + $$0169$i = HEAP32[$16 >> 2] | 0; + $183 = $60; + $184 = 1; + $185 = 1; + while (1) { + $62 = $$0169$i + 8 | 0; + $63 = HEAP32[$62 >> 2] | 0; + $$pre183$i = $$0169$i + 12 | 0; + if (($63 + -1 | 0) >>> 0 <= 3 ? ($65 = HEAP32[$$pre183$i >> 2] | 0, ($65 + -1 | 0) >>> 0 <= 3) : 0) { + $71 = $185; + $72 = $63; + $74 = $184; + $75 = $65; + $80 = $183; + } else { + $67 = HEAP32[$0 >> 2] | 0; + HEAP32[$67 + 20 >> 2] = 19; + FUNCTION_TABLE_vi[HEAP32[$67 >> 2] & 255]($0); + $71 = HEAP32[$14 >> 2] | 0; + $72 = HEAP32[$62 >> 2] | 0; + $74 = HEAP32[$15 >> 2] | 0; + $75 = HEAP32[$$pre183$i >> 2] | 0; + $80 = HEAP32[$13 >> 2] | 0; + } + $185 = ($71 | 0) > ($72 | 0) ? $71 : $72; + HEAP32[$14 >> 2] = $185; + $184 = ($74 | 0) > ($75 | 0) ? $74 : $75; + HEAP32[$15 >> 2] = $184; + $$0160168$i = $$0160168$i + 1 | 0; + if (($$0160168$i | 0) >= ($80 | 0)) { + $182 = $80; + break; + } else { + $$0169$i = $$0169$i + 88 | 0; + $183 = $80; + } + } + } else $182 = $60; + L35 : do if (!(HEAP32[$17 >> 2] | 0)) { + if (HEAP32[$18 >> 2] | 0 ? HEAP32[$8 >> 2] | 0 : 0) { + label = 22; + break; + } + do switch (HEAP32[$24 >> 2] | 0) { + case 0: + { + HEAP32[$21 >> 2] = 1; + HEAP32[$22 >> 2] = 2576; + HEAP32[$23 >> 2] = 0; + $103 = 1; + $105 = $182; + break L35; + break; + } + case 3: + { + HEAP32[$21 >> 2] = 2; + HEAP32[$22 >> 2] = 3792; + HEAP32[$23 >> 2] = 3; + $103 = 2; + $105 = $182; + break L35; + break; + } + case 8: + { + HEAP32[$21 >> 2] = 3; + HEAP32[$22 >> 2] = 3680; + HEAP32[$23 >> 2] = 8; + $103 = 3; + $105 = $182; + break L35; + break; + } + case 15: + { + HEAP32[$21 >> 2] = 4; + HEAP32[$22 >> 2] = 3552; + HEAP32[$23 >> 2] = 15; + $103 = 4; + $105 = $182; + break L35; + break; + } + case 24: + { + HEAP32[$21 >> 2] = 5; + HEAP32[$22 >> 2] = 3376; + HEAP32[$23 >> 2] = 24; + $103 = 5; + $105 = $182; + break L35; + break; + } + case 35: + { + HEAP32[$21 >> 2] = 6; + HEAP32[$22 >> 2] = 3168; + HEAP32[$23 >> 2] = 35; + $103 = 6; + $105 = $182; + break L35; + break; + } + case 48: + { + HEAP32[$21 >> 2] = 7; + HEAP32[$22 >> 2] = 2896; + HEAP32[$23 >> 2] = 48; + $103 = 7; + $105 = $182; + break L35; + break; + } + case 63: + { + HEAP32[$21 >> 2] = 8; + HEAP32[$22 >> 2] = 2576; + HEAP32[$23 >> 2] = 63; + $103 = 8; + $105 = $182; + break L35; + break; + } + case 80: + { + HEAP32[$21 >> 2] = 9; + HEAP32[$22 >> 2] = 2576; + HEAP32[$23 >> 2] = 63; + $103 = 9; + $105 = $182; + break L35; + break; + } + case 99: + { + HEAP32[$21 >> 2] = 10; + HEAP32[$22 >> 2] = 2576; + HEAP32[$23 >> 2] = 63; + $103 = 10; + $105 = $182; + break L35; + break; + } + case 120: + { + HEAP32[$21 >> 2] = 11; + HEAP32[$22 >> 2] = 2576; + HEAP32[$23 >> 2] = 63; + $103 = 11; + $105 = $182; + break L35; + break; + } + case 143: + { + HEAP32[$21 >> 2] = 12; + HEAP32[$22 >> 2] = 2576; + HEAP32[$23 >> 2] = 63; + $103 = 12; + $105 = $182; + break L35; + break; + } + case 168: + { + HEAP32[$21 >> 2] = 13; + HEAP32[$22 >> 2] = 2576; + HEAP32[$23 >> 2] = 63; + $103 = 13; + $105 = $182; + break L35; + break; + } + case 195: + { + HEAP32[$21 >> 2] = 14; + HEAP32[$22 >> 2] = 2576; + HEAP32[$23 >> 2] = 63; + $103 = 14; + $105 = $182; + break L35; + break; + } + case 224: + { + HEAP32[$21 >> 2] = 15; + HEAP32[$22 >> 2] = 2576; + HEAP32[$23 >> 2] = 63; + $103 = 15; + $105 = $182; + break L35; + break; + } + case 255: + { + HEAP32[$21 >> 2] = 16; + HEAP32[$22 >> 2] = 2576; + HEAP32[$23 >> 2] = 63; + $103 = 16; + $105 = $182; + break L35; + break; + } + default: + { + $88 = HEAP32[$0 >> 2] | 0; + HEAP32[$88 + 20 >> 2] = 17; + HEAP32[$88 + 24 >> 2] = HEAP32[$26 >> 2]; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = HEAP32[$24 >> 2]; + HEAP32[(HEAP32[$0 >> 2] | 0) + 32 >> 2] = HEAP32[$27 >> 2]; + HEAP32[(HEAP32[$0 >> 2] | 0) + 36 >> 2] = HEAP32[$28 >> 2]; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + $103 = HEAP32[$21 >> 2] | 0; + $105 = HEAP32[$13 >> 2] | 0; + break L35; + } + } while (0); + } else label = 22; while (0); + if ((label | 0) == 22) { + label = 0; + HEAP32[$21 >> 2] = 8; + HEAP32[$22 >> 2] = 2576; + HEAP32[$23 >> 2] = 63; + $103 = 8; + $105 = $182; + } + HEAP32[$19 >> 2] = $103; + HEAP32[$20 >> 2] = $103; + if (($105 | 0) > 0) { + $$1161166$i = 0; + $$1167$i = HEAP32[$16 >> 2] | 0; + $108 = $103; + while (1) { + HEAP32[$$1167$i + 36 >> 2] = $108; + HEAP32[$$1167$i + 40 >> 2] = $108; + $111 = $$1167$i + 8 | 0; + $113 = Math_imul(HEAP32[$111 >> 2] | 0, HEAP32[$12 >> 2] | 0) | 0; + $116 = _jdiv_round_up($113, Math_imul(HEAP32[$14 >> 2] | 0, $108) | 0) | 0; + HEAP32[$$1167$i + 28 >> 2] = $116; + $119 = $$1167$i + 12 | 0; + $121 = Math_imul(HEAP32[$119 >> 2] | 0, HEAP32[$10 >> 2] | 0) | 0; + $125 = _jdiv_round_up($121, Math_imul(HEAP32[$21 >> 2] | 0, HEAP32[$15 >> 2] | 0) | 0) | 0; + HEAP32[$$1167$i + 32 >> 2] = $125; + $129 = Math_imul(HEAP32[$111 >> 2] | 0, HEAP32[$12 >> 2] | 0) | 0; + $131 = _jdiv_round_up($129, HEAP32[$14 >> 2] | 0) | 0; + HEAP32[$$1167$i + 44 >> 2] = $131; + $135 = Math_imul(HEAP32[$119 >> 2] | 0, HEAP32[$10 >> 2] | 0) | 0; + $137 = _jdiv_round_up($135, HEAP32[$15 >> 2] | 0) | 0; + HEAP32[$$1167$i + 48 >> 2] = $137; + HEAP32[$$1167$i + 52 >> 2] = 1; + HEAP32[$$1167$i + 80 >> 2] = 0; + $141 = $$1161166$i + 1 | 0; + if (($141 | 0) >= (HEAP32[$13 >> 2] | 0)) break; + $$1161166$i = $141; + $$1167$i = $$1167$i + 88 | 0; + $108 = HEAP32[$21 >> 2] | 0; + } + $148 = HEAP32[$21 >> 2] | 0; + } else $148 = $103; + $149 = _jdiv_round_up(HEAP32[$10 >> 2] | 0, Math_imul($148, HEAP32[$15 >> 2] | 0) | 0) | 0; + HEAP32[$25 >> 2] = $149; + $150 = HEAP32[$8 >> 2] | 0; + if (($150 | 0) >= (HEAP32[$13 >> 2] | 0) ? (HEAP32[$18 >> 2] | 0) == 0 : 0) { + HEAP32[(HEAP32[$1 >> 2] | 0) + 16 >> 2] = 0; + $160 = $150; + label = 50; + break L7; + } + HEAP32[(HEAP32[$1 >> 2] | 0) + 16 >> 2] = 1; + $160 = $150; + label = 50; + break; + } + default: + { + $160 = HEAP32[$8 >> 2] | 0; + label = 50; + } + } while (0); + if ((label | 0) == 50) { + label = 0; + if ($160 | 0) { + label = 52; + break; + } + HEAP32[$7 >> 2] = 2; + } + } + if ((label | 0) == 52) { + HEAP32[$7 >> 2] = 0; + $$0 = 1; + return $$0 | 0; + } else if ((label | 0) == 57) { + _start_input_pass_79($0); + $$0 = 1; + return $$0 | 0; + } else if ((label | 0) == 58) { + HEAP32[$3 >> 2] = 1; + if (!(HEAP32[$7 >> 2] | 0)) { + $177 = $0 + 152 | 0; + $180 = HEAP32[$0 + 144 >> 2] | 0; + if ((HEAP32[$177 >> 2] | 0) <= ($180 | 0)) { + $$0 = 2; + return $$0 | 0; + } + HEAP32[$177 >> 2] = $180; + $$0 = 2; + return $$0 | 0; + } else { + if (!(HEAP32[(HEAP32[$6 >> 2] | 0) + 16 >> 2] | 0)) { + $$0 = 2; + return $$0 | 0; + } + $174 = HEAP32[$0 >> 2] | 0; + HEAP32[$174 + 20 >> 2] = 62; + FUNCTION_TABLE_vi[HEAP32[$174 >> 2] & 255]($0); + $$0 = 2; + return $$0 | 0; + } + } else if ((label | 0) == 63) return $$0 | 0; + return 0; +} + +function __ZNSt3__211__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + var $$0$i$i$i = 0, $$0$i$i$i51 = 0, $$0$i$i$i55 = 0, $$0$i$i$i62 = 0, $$0$i$i$i70 = 0, $$0$i$i$i78 = 0, $$0$i$i$i86 = 0, $$0$i$i$i94 = 0, $10 = 0, $101 = 0, $102 = 0, $105 = 0, $11 = 0, $116 = 0, $12 = 0, $120 = 0, $121 = 0, $124 = 0, $135 = 0, $139 = 0, $143 = 0, $146 = 0, $150 = 0, $158 = 0, $159 = 0, $16 = 0, $162 = 0, $20 = 0, $21 = 0, $24 = 0, $35 = 0, $39 = 0, $40 = 0, $43 = 0, $54 = 0, $58 = 0, $62 = 0, $65 = 0, $69 = 0, $77 = 0, $78 = 0, $81 = 0, $93 = 0, $97 = 0, $storemerge = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $10 = sp + 12 | 0; + $11 = sp; + if ($0) { + $12 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66760) | 0; + if ($1) { + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 44 >> 2] & 255]($10, $12); + $16 = HEAP32[$10 >> 2] | 0; + HEAP8[$3 >> 0] = $16; + HEAP8[$3 + 1 >> 0] = $16 >> 8; + HEAP8[$3 + 2 >> 0] = $16 >> 16; + HEAP8[$3 + 3 >> 0] = $16 >> 24; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 32 >> 2] & 255]($11, $12); + $20 = $8 + 8 | 0; + $21 = $20 + 3 | 0; + if ((HEAP8[$21 >> 0] | 0) < 0) { + $24 = HEAP32[$8 >> 2] | 0; + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($24, $10); + HEAP32[$8 + 4 >> 2] = 0; + if ((HEAP8[$21 >> 0] | 0) < 0) { + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$8 >> 2] | 0, HEAP32[$20 >> 2] << 2); + HEAP32[$20 >> 2] = 0; + } + } else { + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($8, $10); + HEAP8[$21 >> 0] = 0; + }; + HEAP32[$8 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$8 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$8 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i = 0; + while (1) { + if (($$0$i$i$i | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i << 2) >> 2] = 0; + $$0$i$i$i = $$0$i$i$i + 1 | 0; + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($11); + } else { + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 40 >> 2] & 255]($10, $12); + $35 = HEAP32[$10 >> 2] | 0; + HEAP8[$3 >> 0] = $35; + HEAP8[$3 + 1 >> 0] = $35 >> 8; + HEAP8[$3 + 2 >> 0] = $35 >> 16; + HEAP8[$3 + 3 >> 0] = $35 >> 24; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 28 >> 2] & 255]($11, $12); + $39 = $8 + 8 | 0; + $40 = $39 + 3 | 0; + if ((HEAP8[$40 >> 0] | 0) < 0) { + $43 = HEAP32[$8 >> 2] | 0; + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($43, $10); + HEAP32[$8 + 4 >> 2] = 0; + if ((HEAP8[$40 >> 0] | 0) < 0) { + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$8 >> 2] | 0, HEAP32[$39 >> 2] << 2); + HEAP32[$39 >> 2] = 0; + } + } else { + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($8, $10); + HEAP8[$40 >> 0] = 0; + }; + HEAP32[$8 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$8 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$8 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i51 = 0; + while (1) { + if (($$0$i$i$i51 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i51 << 2) >> 2] = 0; + $$0$i$i$i51 = $$0$i$i$i51 + 1 | 0; + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($11); + } + $54 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$12 >> 2] | 0) + 12 >> 2] & 127]($12) | 0; + HEAP32[$4 >> 2] = $54; + $58 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$12 >> 2] | 0) + 16 >> 2] & 127]($12) | 0; + HEAP32[$5 >> 2] = $58; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 20 >> 2] & 255]($11, $12); + $62 = $6 + 11 | 0; + if ((HEAP8[$62 >> 0] | 0) < 0) { + $65 = HEAP32[$6 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($65, $10); + HEAP32[$6 + 4 >> 2] = 0; + if ((HEAP8[$62 >> 0] | 0) < 0) { + $69 = $6 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$6 >> 2] | 0, HEAP32[$69 >> 2] & 2147483647); + HEAP32[$69 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($6, $10); + HEAP8[$62 >> 0] = 0; + }; + HEAP32[$6 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$6 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$6 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i55 = 0; + while (1) { + if (($$0$i$i$i55 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i55 << 2) >> 2] = 0; + $$0$i$i$i55 = $$0$i$i$i55 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 24 >> 2] & 255]($11, $12); + $77 = $7 + 8 | 0; + $78 = $77 + 3 | 0; + if ((HEAP8[$78 >> 0] | 0) < 0) { + $81 = HEAP32[$7 >> 2] | 0; + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($81, $10); + HEAP32[$7 + 4 >> 2] = 0; + if ((HEAP8[$78 >> 0] | 0) < 0) { + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$7 >> 2] | 0, HEAP32[$77 >> 2] << 2); + HEAP32[$77 >> 2] = 0; + } + } else { + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($7, $10); + HEAP8[$78 >> 0] = 0; + }; + HEAP32[$7 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$7 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$7 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i62 = 0; + while (1) { + if (($$0$i$i$i62 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i62 << 2) >> 2] = 0; + $$0$i$i$i62 = $$0$i$i$i62 + 1 | 0; + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($11); + $storemerge = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$12 >> 2] | 0) + 36 >> 2] & 127]($12) | 0; + } else { + $93 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66752) | 0; + if ($1) { + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$93 >> 2] | 0) + 44 >> 2] & 255]($10, $93); + $97 = HEAP32[$10 >> 2] | 0; + HEAP8[$3 >> 0] = $97; + HEAP8[$3 + 1 >> 0] = $97 >> 8; + HEAP8[$3 + 2 >> 0] = $97 >> 16; + HEAP8[$3 + 3 >> 0] = $97 >> 24; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$93 >> 2] | 0) + 32 >> 2] & 255]($11, $93); + $101 = $8 + 8 | 0; + $102 = $101 + 3 | 0; + if ((HEAP8[$102 >> 0] | 0) < 0) { + $105 = HEAP32[$8 >> 2] | 0; + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($105, $10); + HEAP32[$8 + 4 >> 2] = 0; + if ((HEAP8[$102 >> 0] | 0) < 0) { + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$8 >> 2] | 0, HEAP32[$101 >> 2] << 2); + HEAP32[$101 >> 2] = 0; + } + } else { + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($8, $10); + HEAP8[$102 >> 0] = 0; + }; + HEAP32[$8 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$8 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$8 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i70 = 0; + while (1) { + if (($$0$i$i$i70 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i70 << 2) >> 2] = 0; + $$0$i$i$i70 = $$0$i$i$i70 + 1 | 0; + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($11); + } else { + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$93 >> 2] | 0) + 40 >> 2] & 255]($10, $93); + $116 = HEAP32[$10 >> 2] | 0; + HEAP8[$3 >> 0] = $116; + HEAP8[$3 + 1 >> 0] = $116 >> 8; + HEAP8[$3 + 2 >> 0] = $116 >> 16; + HEAP8[$3 + 3 >> 0] = $116 >> 24; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$93 >> 2] | 0) + 28 >> 2] & 255]($11, $93); + $120 = $8 + 8 | 0; + $121 = $120 + 3 | 0; + if ((HEAP8[$121 >> 0] | 0) < 0) { + $124 = HEAP32[$8 >> 2] | 0; + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($124, $10); + HEAP32[$8 + 4 >> 2] = 0; + if ((HEAP8[$121 >> 0] | 0) < 0) { + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$8 >> 2] | 0, HEAP32[$120 >> 2] << 2); + HEAP32[$120 >> 2] = 0; + } + } else { + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($8, $10); + HEAP8[$121 >> 0] = 0; + }; + HEAP32[$8 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$8 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$8 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i78 = 0; + while (1) { + if (($$0$i$i$i78 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i78 << 2) >> 2] = 0; + $$0$i$i$i78 = $$0$i$i$i78 + 1 | 0; + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($11); + } + $135 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$93 >> 2] | 0) + 12 >> 2] & 127]($93) | 0; + HEAP32[$4 >> 2] = $135; + $139 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$93 >> 2] | 0) + 16 >> 2] & 127]($93) | 0; + HEAP32[$5 >> 2] = $139; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$93 >> 2] | 0) + 20 >> 2] & 255]($11, $93); + $143 = $6 + 11 | 0; + if ((HEAP8[$143 >> 0] | 0) < 0) { + $146 = HEAP32[$6 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($146, $10); + HEAP32[$6 + 4 >> 2] = 0; + if ((HEAP8[$143 >> 0] | 0) < 0) { + $150 = $6 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$6 >> 2] | 0, HEAP32[$150 >> 2] & 2147483647); + HEAP32[$150 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($6, $10); + HEAP8[$143 >> 0] = 0; + }; + HEAP32[$6 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$6 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$6 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i86 = 0; + while (1) { + if (($$0$i$i$i86 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i86 << 2) >> 2] = 0; + $$0$i$i$i86 = $$0$i$i$i86 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$93 >> 2] | 0) + 24 >> 2] & 255]($11, $93); + $158 = $7 + 8 | 0; + $159 = $158 + 3 | 0; + if ((HEAP8[$159 >> 0] | 0) < 0) { + $162 = HEAP32[$7 >> 2] | 0; + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($162, $10); + HEAP32[$7 + 4 >> 2] = 0; + if ((HEAP8[$159 >> 0] | 0) < 0) { + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$7 >> 2] | 0, HEAP32[$158 >> 2] << 2); + HEAP32[$158 >> 2] = 0; + } + } else { + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($7, $10); + HEAP8[$159 >> 0] = 0; + }; + HEAP32[$7 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$7 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$7 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i94 = 0; + while (1) { + if (($$0$i$i$i94 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i94 << 2) >> 2] = 0; + $$0$i$i$i94 = $$0$i$i$i94 + 1 | 0; + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($11); + $storemerge = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$93 >> 2] | 0) + 36 >> 2] & 127]($93) | 0; + } + HEAP32[$9 >> 2] = $storemerge; + STACKTOP = sp; + return; +} + +function _ar2GetBestMatching($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + $10 = $10 | 0; + $11 = $11 | 0; + var $$0 = 0, $$0282 = 0, $$0284 = 0, $$0286 = 0, $$0288 = 0, $$0289 = 0, $$0293 = 0, $$0295 = 0, $$0299 = 0, $$0305 = 0, $$0306 = 0, $$0315 = 0, $$0317 = 0, $$0318 = 0, $$1 = 0, $$10 = 0, $$11 = 0, $$12 = 0, $$1285 = 0, $$1287 = 0, $$1290 = 0, $$1294 = 0, $$1296 = 0, $$13 = 0, $$1300 = 0, $$1307 = 0, $$1316 = 0, $$1319 = 0, $$14 = 0, $$2 = 0, $$2291 = 0, $$2297 = 0, $$2301 = 0, $$2308 = 0, $$2320 = 0, $$3 = 0, $$3292 = 0, $$3298 = 0, $$3302 = 0, $$3309 = 0, $$3321 = 0, $$4 = 0, $$4303 = 0, $$4310 = 0, $$4322 = 0, $$5 = 0, $$5304 = 0, $$5323 = 0, $$6 = 0, $$6312 = 0, $$7 = 0, $$7313 = 0, $$8 = 0, $$8314 = 0, $$9 = 0, $101 = 0, $102 = 0, $104 = 0, $106 = 0, $110 = 0, $111 = 0, $114 = 0, $115 = 0, $119 = 0, $12 = 0, $126 = 0, $127 = 0, $13 = 0, $131 = 0, $139 = 0, $14 = 0, $141 = 0, $142 = 0, $15 = 0, $151 = 0, $153 = 0, $16 = 0, $162 = 0, $169 = 0, $17 = 0, $171 = 0, $177 = 0, $18 = 0, $19 = 0, $192 = 0, $193 = 0, $195 = 0, $197 = 0, $198 = 0, $199 = 0, $20 = 0, $201 = 0, $21 = 0, $214 = 0, $215 = 0, $216 = 0, $219 = 0, $22 = 0, $23 = 0, $24 = 0, $27 = 0, $30 = 0, $35 = 0, $36 = 0, $38 = 0, $40 = 0, $42 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $59 = 0, $63 = 0, $68 = 0, $70 = 0, $71 = 0, $72 = 0, $77 = 0, $87 = 0, $96 = 0, $scevgep = 0, $spec$select = 0, $spec$store$select = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 80 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(80); + $vararg_buffer1 = sp + 8 | 0; + $vararg_buffer = sp; + $12 = sp + 72 | 0; + $13 = sp + 60 | 0; + $14 = sp + 48 | 0; + $15 = sp + 36 | 0; + $16 = sp + 32 | 0; + $17 = sp + 24 | 0; + $18 = sp + 16 | 0; + $19 = $5 + 16 | 0; + $20 = HEAP32[$19 >> 2] | 0; + $21 = $5 + 20 | 0; + $22 = HEAP32[$21 >> 2] | 0; + $23 = $2 + -1 | 0; + $24 = $3 + -1 | 0; + $$0315 = 0; + while (1) { + if ($$0315 >>> 0 >= 3) break; + $27 = HEAP32[$8 + ($$0315 << 3) >> 2] | 0; + if (($27 | 0) < 0) break; + $30 = $27 & -4 | 2; + $35 = ((HEAP32[$8 + ($$0315 << 3) + 4 >> 2] | 0) / 4 | 0) << 2 | 2; + $36 = $30 - $6 | 0; + $spec$store$select = ($36 | 0) > 0 ? $36 : 0; + $38 = $30 + $6 | 0; + $spec$select = ($38 | 0) < ($2 | 0) ? $38 : $23; + $40 = $35 - $7 | 0; + $42 = $35 + $7 | 0; + $$0288 = ($42 | 0) < ($3 | 0) ? $42 : $24; + $$0318 = ($40 | 0) > 0 ? $40 : 0; + while (1) { + if (($$0318 | 0) > ($$0288 | 0)) break; + $$0299 = $spec$store$select; + $$0305 = $1 + ((Math_imul($$0318, $2) | 0) + $spec$store$select) | 0; + while (1) { + if (($$0299 | 0) > ($spec$select | 0)) break; + HEAP8[$$0305 >> 0] = 0; + $$0299 = $$0299 + 1 | 0; + $$0305 = $$0305 + 1 | 0; + } + $$0318 = $$0318 + 1 | 0; + } + $$0315 = $$0315 + 1 | 0; + } + HEAP32[$12 >> 2] = 0; + $53 = $22 << 1; + $54 = $20 << 1; + $55 = $5 + 12 | 0; + $56 = $5 + 8 | 0; + $$0306 = 1; + $$1316 = 0; + while (1) { + if ($$1316 >>> 0 >= 3) { + label = 28; + break; + } + $59 = HEAP32[$8 + ($$1316 << 3) >> 2] | 0; + if (($59 | 0) < 0) { + label = 14; + break; + } + $63 = $59 & -4 | 2; + $68 = ((HEAP32[$8 + ($$1316 << 3) + 4 >> 2] | 0) / 4 | 0) << 2 | 2; + $70 = $68 + $7 | 0; + $71 = $63 - $6 | 0; + $72 = $63 + $6 | 0; + $$1307 = $$0306; + $$1319 = $68 - $7 | 0; + L18 : while (1) { + if (($$1319 | 0) > ($70 | 0)) break; + L21 : do if (($$1319 | 0) < ($54 | 0)) $$4310 = $$1307; else { + if (($$1319 + $53 | 0) >= ($3 | 0)) break L18; + $77 = Math_imul($$1319, $2) | 0; + $$1300 = $71; + $$2308 = $$1307; + while (1) { + if (($$1300 | 0) > ($72 | 0)) { + $$4310 = $$2308; + break L21; + } + if (($$1300 | 0) >= (HEAP32[$56 >> 2] << 1 | 0)) { + if (((HEAP32[$55 >> 2] << 1) + $$1300 | 0) >= ($2 | 0)) { + $$4310 = $$2308; + break L21; + } + $87 = $1 + ($$1300 + $77) | 0; + if (!(HEAP8[$87 >> 0] | 0)) { + HEAP8[$87 >> 0] = 1; + _ar2GetBestMatchingSubFine($0, $2, $4, $5, $$1300, $$1319, $16); + _updateCandidate($$1300, $$1319, HEAP32[$16 >> 2] | 0, $12, $13, $14, $15); + $$3309 = 0; + } else $$3309 = $$2308; + } else $$3309 = $$2308; + $$1300 = $$1300 + 4 | 0; + $$2308 = $$3309; + } + } while (0); + $$1307 = $$4310; + $$1319 = $$1319 + 4 | 0; + } + $$0306 = $$1307; + $$1316 = $$1316 + 1 | 0; + } + if ((label | 0) == 14) if (!$$0306) label = 28; else $$0 = -1; + if ((label | 0) == 28) { + $96 = $5 + 4 | 0; + $101 = Math_imul((HEAP32[$5 >> 2] << 3) + 32 | 0, (HEAP32[$96 >> 2] << 1) + 8 | 0) | 0; + $102 = _malloc($101) | 0; + if (!$102) { + _arLog(0, 3, 45930, $vararg_buffer); + _exit(1); + } + $104 = _malloc($101) | 0; + if (!$104) { + _arLog(0, 3, 45930, $vararg_buffer1); + _exit(1); + } + $106 = $5 + 36 | 0; + $$0289 = 0; + $$0317 = 0; + $$6312 = -1; + while (1) { + if (($$0317 | 0) >= (HEAP32[$12 >> 2] | 0)) break; + $110 = HEAP32[$5 >> 2] | 0; + $111 = HEAP32[$96 >> 2] | 0; + L47 : do if ((HEAP32[$106 >> 2] | 0) == (Math_imul($111, $110) | 0)) { + switch ($4 | 0) { + case 5: + case 12: + case 13: + case 14: + break; + default: + { + label = 40; + break L47; + } + } + $114 = $14 + ($$0317 << 2) | 0; + $115 = HEAP32[$114 >> 2] | 0; + $119 = $115 + -3 - (HEAP32[$19 >> 2] << 1) | 0; + if (((($119 | 0) >= 0 ? ($115 + 3 + (HEAP32[$21 >> 2] << 1) | 0) < ($3 | 0) : 0) ? ($126 = $13 + ($$0317 << 2) | 0, $127 = HEAP32[$126 >> 2] | 0, $131 = $127 + -3 - (HEAP32[$56 >> 2] << 1) | 0, ($131 | 0) >= 0) : 0) ? ($127 + 3 + (HEAP32[$55 >> 2] << 1) | 0) < ($2 | 0) : 0) { + $169 = ($111 << 1) + 6 | 0; + $171 = ($110 << 2) + 16 | 0; + $$0286 = $104; + $$0295 = $102; + $$3321 = 0; + while (1) { + if (($$3321 | 0) >= ($171 | 0)) break; + HEAP32[$$0295 >> 2] = 0; + HEAP32[$$0286 >> 2] = 0; + $$0286 = $$0286 + 4 | 0; + $$0295 = $$0295 + 4 | 0; + $$3321 = $$3321 + 1 | 0; + } + $177 = ($110 << 1) + 6 | 0; + $$0282 = $0 + ($131 + (Math_imul($119, $2) | 0)) | 0; + $$0284 = $104; + $$0293 = $102; + $$1287 = $$0286; + $$1296 = $$0295; + $$4322 = 0; + while (1) { + if (($$4322 | 0) >= ($169 | 0)) break; + $scevgep = $$1296 + 8 | 0; + $$2 = $$1287; + $$2297 = $$1296; + $$3302 = 0; + while (1) { + if (($$3302 | 0) == 2) break; + HEAP32[$$2297 >> 2] = 0; + HEAP32[$$2 >> 2] = 0; + HEAP32[$17 + ($$3302 << 2) >> 2] = 0; + HEAP32[$18 + ($$3302 << 2) >> 2] = 0; + $$2 = $$2 + 4 | 0; + $$2297 = $$2297 + 4 | 0; + $$3302 = $$3302 + 1 | 0; + } + $$1 = $$0282; + $$1285 = $$0284 + 8 | 0; + $$1294 = $$0293 + 8 | 0; + $$3 = $$1287 + 8 | 0; + $$3298 = $scevgep; + $$4303 = 0; + while (1) { + if (($$4303 | 0) >= ($177 | 0)) break; + $192 = $$4303 & 1; + $193 = $17 + ($192 << 2) | 0; + $195 = (HEAP32[$193 >> 2] | 0) + (HEAPU8[$$1 >> 0] | 0) | 0; + HEAP32[$193 >> 2] = $195; + $197 = HEAPU8[$$1 >> 0] | 0; + $198 = Math_imul($197, $197) | 0; + $199 = $18 + ($192 << 2) | 0; + $201 = $198 + (HEAP32[$199 >> 2] | 0) | 0; + HEAP32[$199 >> 2] = $201; + HEAP32[$$3298 >> 2] = (HEAP32[$$1294 >> 2] | 0) + $195; + HEAP32[$$3 >> 2] = (HEAP32[$$1285 >> 2] | 0) + $201; + $$1 = $$1 + 1 | 0; + $$1285 = $$1285 + 4 | 0; + $$1294 = $$1294 + 4 | 0; + $$3 = $$3 + 4 | 0; + $$3298 = $$3298 + 4 | 0; + $$4303 = $$4303 + 1 | 0; + } + $$0282 = $$0282 + $2 | 0; + $$0284 = $$1285; + $$0293 = $$1294; + $$1287 = $$3; + $$1296 = $$3298; + $$4322 = $$4322 + 1 | 0; + } + $$11 = $$6312; + $$5 = $$0289; + $$5323 = 0; + while (1) { + if (($$5323 | 0) == 7) { + $$14 = $$11; + $$8 = $$5; + break L47; + } + $214 = $$5323 + $119 | 0; + $215 = $$5323 + 2 | 0; + $216 = $$5323 + -3 | 0; + $$12 = $$11; + $$5304 = 0; + $$6 = $$5; + while (1) { + if (($$5304 | 0) == 7) break; + _ar2GetBestMatchingSubFineOpt($0, $2, $$5304 + $131 | 0, $214, $5, $102, $104, $$5304 + 2 | 0, $215, $16); + $219 = HEAP32[$16 >> 2] | 0; + if (($219 | 0) > ($$6 | 0)) { + HEAP32[$9 >> 2] = $$5304 + -3 + (HEAP32[$126 >> 2] | 0); + HEAP32[$10 >> 2] = $216 + (HEAP32[$114 >> 2] | 0); + HEAPF32[$11 >> 2] = +($219 | 0) / 1.0e4; + $$13 = 0; + $$7 = $219; + } else { + $$13 = $$12; + $$7 = $$6; + } + $$12 = $$13; + $$5304 = $$5304 + 1 | 0; + $$6 = $$7; + } + $$11 = $$12; + $$5 = $$6; + $$5323 = $$5323 + 1 | 0; + } + } else label = 40; + } else label = 40; while (0); + L80 : do if ((label | 0) == 40) { + label = 0; + $139 = HEAP32[$14 + ($$0317 << 2) >> 2] | 0; + $141 = $139 + 3 | 0; + $142 = $13 + ($$0317 << 2) | 0; + $$1290 = $$0289; + $$2320 = $139 + -3 | 0; + $$7313 = $$6312; + while (1) { + if (($$2320 | 0) > ($141 | 0)) { + $$14 = $$7313; + $$8 = $$1290; + break L80; + } + L85 : do if (($$2320 | 0) < (HEAP32[$19 >> 2] << 1 | 0)) { + $$10 = $$7313; + $$4 = $$1290; + } else { + if (((HEAP32[$21 >> 2] << 1) + $$2320 | 0) >= ($3 | 0)) { + $$14 = $$7313; + $$8 = $$1290; + break L80; + } + $151 = HEAP32[$142 >> 2] | 0; + $153 = $151 + 3 | 0; + $$2291 = $$1290; + $$2301 = $151 + -3 | 0; + $$8314 = $$7313; + while (1) { + if (($$2301 | 0) > ($153 | 0)) { + $$10 = $$8314; + $$4 = $$2291; + break L85; + } + if (($$2301 | 0) >= (HEAP32[$56 >> 2] << 1 | 0)) { + if (((HEAP32[$55 >> 2] << 1) + $$2301 | 0) >= ($2 | 0)) { + $$10 = $$8314; + $$4 = $$2291; + break L85; + } + _ar2GetBestMatchingSubFine($0, $2, $4, $5, $$2301, $$2320, $16); + $162 = HEAP32[$16 >> 2] | 0; + if (($162 | 0) > ($$2291 | 0)) { + HEAP32[$9 >> 2] = $$2301; + HEAP32[$10 >> 2] = $$2320; + HEAPF32[$11 >> 2] = +($162 | 0) / 1.0e4; + $$3292 = $162; + $$9 = 0; + } else { + $$3292 = $$2291; + $$9 = $$8314; + } + } else { + $$3292 = $$2291; + $$9 = $$8314; + } + $$2291 = $$3292; + $$2301 = $$2301 + 1 | 0; + $$8314 = $$9; + } + } while (0); + $$1290 = $$4; + $$2320 = $$2320 + 1 | 0; + $$7313 = $$10; + } + } while (0); + $$0289 = $$8; + $$0317 = $$0317 + 1 | 0; + $$6312 = $$14; + } + _free($102); + _free($104); + $$0 = $$6312; + } + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $$byval_copy26 = 0, $$byval_copy30 = 0, $$sroa$095$0 = 0, $10 = 0, $103 = 0, $107 = 0, $11 = 0, $112 = 0, $113 = 0, $118 = 0, $12 = 0, $120 = 0, $121 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $45 = 0, $49 = 0, $54 = 0, $55 = 0, $60 = 0, $62 = 0, $63 = 0, $68 = 0, $71 = 0, $8 = 0, $87 = 0, $9 = 0, $90 = 0, $94 = 0, $99 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 144 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(144); + $$byval_copy30 = sp + 128 | 0; + $$byval_copy26 = sp + 112 | 0; + $8 = sp + 124 | 0; + $9 = sp + 120 | 0; + $10 = sp + 116 | 0; + $11 = sp + 108 | 0; + $12 = sp + 104 | 0; + $13 = sp + 100 | 0; + $14 = sp + 96 | 0; + $15 = sp + 92 | 0; + $16 = sp + 88 | 0; + $17 = sp + 84 | 0; + $18 = sp + 80 | 0; + $19 = sp + 76 | 0; + $20 = sp + 72 | 0; + $21 = sp + 68 | 0; + $22 = sp + 64 | 0; + $23 = sp + 60 | 0; + $24 = sp + 56 | 0; + $25 = sp + 52 | 0; + $26 = sp + 48 | 0; + $27 = sp + 44 | 0; + $28 = sp + 40 | 0; + $29 = sp + 36 | 0; + $30 = sp + 32 | 0; + $31 = sp + 28 | 0; + $32 = sp + 24 | 0; + $33 = sp + 20 | 0; + $34 = sp + 16 | 0; + $35 = sp + 12 | 0; + $36 = sp + 8 | 0; + $37 = sp + 4 | 0; + $38 = sp; + HEAP32[$4 >> 2] = 0; + __ZNKSt3__28ios_base6getlocEv($$byval_copy30, $3); + $39 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy30, 66544) | 0; + __ZNSt3__26localeD2Ev($$byval_copy30); + do switch ($6 << 24 >> 24 | 0) { + case 65: + case 97: + { + HEAP32[$8 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$8 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE($0, $5 + 24 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 104: + case 66: + case 98: + { + HEAP32[$9 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$9 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE($0, $5 + 16 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 99: + { + $45 = $0 + 8 | 0; + $49 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$45 >> 2] | 0) + 12 >> 2] & 127]($45) | 0; + HEAP32[$10 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$11 >> 2] = HEAP32[$2 >> 2]; + $54 = HEAP8[$49 + 8 + 3 >> 0] | 0; + $55 = $54 << 24 >> 24 < 0; + $60 = $55 ? HEAP32[$49 >> 2] | 0 : $49; + $62 = $60 + (($55 ? HEAP32[$49 + 4 >> 2] | 0 : $54 & 255) << 2) | 0; + HEAP32[$$byval_copy26 >> 2] = HEAP32[$10 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$11 >> 2]; + $63 = __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_($0, $$byval_copy26, $$byval_copy30, $3, $4, $5, $60, $62) | 0; + HEAP32[$1 >> 2] = $63; + label = 26; + break; + } + case 101: + case 100: + { + HEAP32[$12 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$12 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE($0, $5 + 12 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 68: + { + HEAP32[$13 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$14 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy26 >> 2] = HEAP32[$13 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$14 >> 2]; + $68 = __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_($0, $$byval_copy26, $$byval_copy30, $3, $4, $5, 12976, 13008) | 0; + HEAP32[$1 >> 2] = $68; + label = 26; + break; + } + case 70: + { + HEAP32[$15 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$16 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy26 >> 2] = HEAP32[$15 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$16 >> 2]; + $71 = __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_($0, $$byval_copy26, $$byval_copy30, $3, $4, $5, 13008, 13040) | 0; + HEAP32[$1 >> 2] = $71; + label = 26; + break; + } + case 72: + { + HEAP32[$17 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$17 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE($0, $5 + 8 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 73: + { + HEAP32[$18 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$18 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE($0, $5 + 8 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 106: + { + HEAP32[$19 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$19 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE($0, $5 + 28 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 109: + { + HEAP32[$20 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$20 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE($0, $5 + 16 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 77: + { + HEAP32[$21 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$21 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE($0, $5 + 4 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 116: + case 110: + { + HEAP32[$22 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$22 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE($0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 112: + { + HEAP32[$23 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$23 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE($0, $5 + 8 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 114: + { + HEAP32[$24 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$25 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy26 >> 2] = HEAP32[$24 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$25 >> 2]; + $87 = __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_($0, $$byval_copy26, $$byval_copy30, $3, $4, $5, 13040, 13084) | 0; + HEAP32[$1 >> 2] = $87; + label = 26; + break; + } + case 82: + { + HEAP32[$26 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$27 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy26 >> 2] = HEAP32[$26 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$27 >> 2]; + $90 = __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_($0, $$byval_copy26, $$byval_copy30, $3, $4, $5, 13088, 13108) | 0; + HEAP32[$1 >> 2] = $90; + label = 26; + break; + } + case 83: + { + HEAP32[$28 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$28 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE($0, $5, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 84: + { + HEAP32[$29 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$30 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy26 >> 2] = HEAP32[$29 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$30 >> 2]; + $94 = __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_($0, $$byval_copy26, $$byval_copy30, $3, $4, $5, 13120, 13152) | 0; + HEAP32[$1 >> 2] = $94; + label = 26; + break; + } + case 119: + { + HEAP32[$31 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$31 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE($0, $5 + 24 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 120: + { + $99 = HEAP32[(HEAP32[$0 >> 2] | 0) + 20 >> 2] | 0; + HEAP32[$32 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$33 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy26 >> 2] = HEAP32[$32 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$33 >> 2]; + $$sroa$095$0 = FUNCTION_TABLE_iiiiiii[$99 & 63]($0, $$byval_copy26, $$byval_copy30, $3, $4, $5) | 0; + break; + } + case 88: + { + $103 = $0 + 8 | 0; + $107 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$103 >> 2] | 0) + 24 >> 2] & 127]($103) | 0; + HEAP32[$34 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$35 >> 2] = HEAP32[$2 >> 2]; + $112 = HEAP8[$107 + 8 + 3 >> 0] | 0; + $113 = $112 << 24 >> 24 < 0; + $118 = $113 ? HEAP32[$107 >> 2] | 0 : $107; + $120 = $118 + (($113 ? HEAP32[$107 + 4 >> 2] | 0 : $112 & 255) << 2) | 0; + HEAP32[$$byval_copy26 >> 2] = HEAP32[$34 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$35 >> 2]; + $121 = __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_($0, $$byval_copy26, $$byval_copy30, $3, $4, $5, $118, $120) | 0; + HEAP32[$1 >> 2] = $121; + label = 26; + break; + } + case 121: + { + HEAP32[$36 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$36 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE($0, $5 + 20 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 89: + { + HEAP32[$37 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$37 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE($0, $5 + 20 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 37: + { + HEAP32[$38 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$38 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE($0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + default: + { + HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 4; + label = 26; + } + } while (0); + if ((label | 0) == 26) $$sroa$095$0 = HEAP32[$1 >> 2] | 0; + STACKTOP = sp; + return $$sroa$095$0 | 0; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $$byval_copy26 = 0, $$byval_copy30 = 0, $$sroa$095$0 = 0, $10 = 0, $102 = 0, $106 = 0, $11 = 0, $110 = 0, $111 = 0, $116 = 0, $118 = 0, $119 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $45 = 0, $49 = 0, $53 = 0, $54 = 0, $59 = 0, $61 = 0, $62 = 0, $67 = 0, $70 = 0, $8 = 0, $86 = 0, $89 = 0, $9 = 0, $93 = 0, $98 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 144 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(144); + $$byval_copy30 = sp + 128 | 0; + $$byval_copy26 = sp + 112 | 0; + $8 = sp + 124 | 0; + $9 = sp + 120 | 0; + $10 = sp + 116 | 0; + $11 = sp + 108 | 0; + $12 = sp + 104 | 0; + $13 = sp + 100 | 0; + $14 = sp + 96 | 0; + $15 = sp + 92 | 0; + $16 = sp + 88 | 0; + $17 = sp + 84 | 0; + $18 = sp + 80 | 0; + $19 = sp + 76 | 0; + $20 = sp + 72 | 0; + $21 = sp + 68 | 0; + $22 = sp + 64 | 0; + $23 = sp + 60 | 0; + $24 = sp + 56 | 0; + $25 = sp + 52 | 0; + $26 = sp + 48 | 0; + $27 = sp + 44 | 0; + $28 = sp + 40 | 0; + $29 = sp + 36 | 0; + $30 = sp + 32 | 0; + $31 = sp + 28 | 0; + $32 = sp + 24 | 0; + $33 = sp + 20 | 0; + $34 = sp + 16 | 0; + $35 = sp + 12 | 0; + $36 = sp + 8 | 0; + $37 = sp + 4 | 0; + $38 = sp; + HEAP32[$4 >> 2] = 0; + __ZNKSt3__28ios_base6getlocEv($$byval_copy30, $3); + $39 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy30, 66512) | 0; + __ZNSt3__26localeD2Ev($$byval_copy30); + do switch ($6 << 24 >> 24 | 0) { + case 65: + case 97: + { + HEAP32[$8 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$8 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE($0, $5 + 24 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 104: + case 66: + case 98: + { + HEAP32[$9 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$9 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE($0, $5 + 16 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 99: + { + $45 = $0 + 8 | 0; + $49 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$45 >> 2] | 0) + 12 >> 2] & 127]($45) | 0; + HEAP32[$10 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$11 >> 2] = HEAP32[$2 >> 2]; + $53 = HEAP8[$49 + 11 >> 0] | 0; + $54 = $53 << 24 >> 24 < 0; + $59 = $54 ? HEAP32[$49 >> 2] | 0 : $49; + $61 = $59 + ($54 ? HEAP32[$49 + 4 >> 2] | 0 : $53 & 255) | 0; + HEAP32[$$byval_copy26 >> 2] = HEAP32[$10 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$11 >> 2]; + $62 = __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_($0, $$byval_copy26, $$byval_copy30, $3, $4, $5, $59, $61) | 0; + HEAP32[$1 >> 2] = $62; + label = 26; + break; + } + case 101: + case 100: + { + HEAP32[$12 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$12 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE($0, $5 + 12 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 68: + { + HEAP32[$13 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$14 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy26 >> 2] = HEAP32[$13 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$14 >> 2]; + $67 = __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_($0, $$byval_copy26, $$byval_copy30, $3, $4, $5, 59674, 59682) | 0; + HEAP32[$1 >> 2] = $67; + label = 26; + break; + } + case 70: + { + HEAP32[$15 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$16 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy26 >> 2] = HEAP32[$15 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$16 >> 2]; + $70 = __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_($0, $$byval_copy26, $$byval_copy30, $3, $4, $5, 59682, 59690) | 0; + HEAP32[$1 >> 2] = $70; + label = 26; + break; + } + case 72: + { + HEAP32[$17 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$17 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE($0, $5 + 8 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 73: + { + HEAP32[$18 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$18 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE($0, $5 + 8 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 106: + { + HEAP32[$19 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$19 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE($0, $5 + 28 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 109: + { + HEAP32[$20 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$20 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE($0, $5 + 16 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 77: + { + HEAP32[$21 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$21 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE($0, $5 + 4 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 116: + case 110: + { + HEAP32[$22 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$22 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE($0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 112: + { + HEAP32[$23 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$23 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE($0, $5 + 8 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 114: + { + HEAP32[$24 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$25 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy26 >> 2] = HEAP32[$24 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$25 >> 2]; + $86 = __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_($0, $$byval_copy26, $$byval_copy30, $3, $4, $5, 59690, 59701) | 0; + HEAP32[$1 >> 2] = $86; + label = 26; + break; + } + case 82: + { + HEAP32[$26 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$27 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy26 >> 2] = HEAP32[$26 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$27 >> 2]; + $89 = __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_($0, $$byval_copy26, $$byval_copy30, $3, $4, $5, 59701, 59706) | 0; + HEAP32[$1 >> 2] = $89; + label = 26; + break; + } + case 83: + { + HEAP32[$28 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$28 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE($0, $5, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 84: + { + HEAP32[$29 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$30 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy26 >> 2] = HEAP32[$29 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$30 >> 2]; + $93 = __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_($0, $$byval_copy26, $$byval_copy30, $3, $4, $5, 59706, 59714) | 0; + HEAP32[$1 >> 2] = $93; + label = 26; + break; + } + case 119: + { + HEAP32[$31 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$31 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE($0, $5 + 24 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 120: + { + $98 = HEAP32[(HEAP32[$0 >> 2] | 0) + 20 >> 2] | 0; + HEAP32[$32 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$33 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy26 >> 2] = HEAP32[$32 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$33 >> 2]; + $$sroa$095$0 = FUNCTION_TABLE_iiiiiii[$98 & 63]($0, $$byval_copy26, $$byval_copy30, $3, $4, $5) | 0; + break; + } + case 88: + { + $102 = $0 + 8 | 0; + $106 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$102 >> 2] | 0) + 24 >> 2] & 127]($102) | 0; + HEAP32[$34 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$35 >> 2] = HEAP32[$2 >> 2]; + $110 = HEAP8[$106 + 11 >> 0] | 0; + $111 = $110 << 24 >> 24 < 0; + $116 = $111 ? HEAP32[$106 >> 2] | 0 : $106; + $118 = $116 + ($111 ? HEAP32[$106 + 4 >> 2] | 0 : $110 & 255) | 0; + HEAP32[$$byval_copy26 >> 2] = HEAP32[$34 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$35 >> 2]; + $119 = __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_($0, $$byval_copy26, $$byval_copy30, $3, $4, $5, $116, $118) | 0; + HEAP32[$1 >> 2] = $119; + label = 26; + break; + } + case 121: + { + HEAP32[$36 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$36 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE($0, $5 + 20 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 89: + { + HEAP32[$37 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$37 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE($0, $5 + 20 | 0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + case 37: + { + HEAP32[$38 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy30 >> 2] = HEAP32[$38 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE($0, $1, $$byval_copy30, $4, $39); + label = 26; + break; + } + default: + { + HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 4; + label = 26; + } + } while (0); + if ((label | 0) == 26) $$sroa$095$0 = HEAP32[$1 >> 2] | 0; + STACKTOP = sp; + return $$sroa$095$0 | 0; +} + +function _jpgread($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0$reg2mem$0 = 0, $$033$reg2mem99$0 = 0, $$034$reg2mem101$0 = 0, $$reg2mem103$0 = 0, $10 = 0, $11 = 0, $13 = 0, $14 = 0, $15 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $30 = 0, $31 = 0, $32 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $45 = 0, $47 = 0, $48 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $69 = 0, $7 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $9 = 0, $91 = 0, $93 = 0, $99 = 0, $vararg_buffer = 0, $vararg_buffer105 = 0, $vararg_buffer107 = 0, _setjmpTable = 0, _setjmpTableSize = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 832 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(832); + $vararg_buffer107 = sp + 528 | 0; + $vararg_buffer105 = sp + 520 | 0; + $vararg_buffer = sp + 512 | 0; + _setjmpTableSize = 4; + _setjmpTable = _malloc(40) | 0; + HEAP32[_setjmpTable >> 2] = 0; + $5 = sp + 24 | 0; + $6 = sp + 536 | 0; + $7 = sp; + _memset($5 | 0, 0, 488) | 0; + __THREW__ = 0; + $8 = invoke_ii(63, $6 | 0) | 0; + $9 = __THREW__; + __THREW__ = 0; + if (($9 | 0) != 0 & (threwValue | 0) != 0) { + $10 = _testSetjmp(HEAP32[$9 >> 2] | 0, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + if (!$10) _longjmp($9 | 0, threwValue | 0); + setTempRet0(threwValue | 0); + } else $10 = -1; + $11 = getTempRet0() | 0; + if (($10 | 0) != 1) { + HEAP32[$5 >> 2] = $8; + HEAP32[$6 >> 2] = 181; + _setjmpTable = _saveSetjmp($6 + 132 | 0, 1, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + _setjmpTableSize = getTempRet0() | 0; + __THREW__ = 0; + $13 = __THREW__; + __THREW__ = 0; + if (($13 | 0) != 0 & (threwValue | 0) != 0) { + $14 = _testSetjmp(HEAP32[$13 >> 2] | 0, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + if (!$14) _longjmp($13 | 0, threwValue | 0); + setTempRet0(threwValue | 0); + } else $14 = -1; + $15 = getTempRet0() | 0; + if (($14 | 0) == 1) $$reg2mem103$0 = $15; else $$reg2mem103$0 = 0; + } else $$reg2mem103$0 = $11; + L4 : while (1) { + if ($$reg2mem103$0 | 0) { + __THREW__ = 0; + invoke_vi(182, $5 | 0); + $17 = __THREW__; + __THREW__ = 0; + if (($17 | 0) != 0 & (threwValue | 0) != 0) { + $18 = _testSetjmp(HEAP32[$17 >> 2] | 0, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + if (!$18) _longjmp($17 | 0, threwValue | 0); + setTempRet0(threwValue | 0); + } else $18 = -1; + $19 = getTempRet0() | 0; + if (($18 | 0) == 1) { + $$reg2mem103$0 = $19; + continue; + } + __THREW__ = 0; + invoke_viiii(8, 0, 3, 25828, $vararg_buffer | 0); + $20 = __THREW__; + __THREW__ = 0; + if (($20 | 0) != 0 & (threwValue | 0) != 0) { + $21 = _testSetjmp(HEAP32[$20 >> 2] | 0, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + if (!$21) _longjmp($20 | 0, threwValue | 0); + setTempRet0(threwValue | 0); + } else $21 = -1; + $22 = getTempRet0() | 0; + if (($21 | 0) == 1) { + $$reg2mem103$0 = $22; + continue; + } else { + label = 7; + break; + } + } + __THREW__ = 0; + invoke_viii(1, $5 | 0, 90, 488); + $23 = __THREW__; + __THREW__ = 0; + if (($23 | 0) != 0 & (threwValue | 0) != 0) { + $24 = _testSetjmp(HEAP32[$23 >> 2] | 0, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + if (!$24) _longjmp($23 | 0, threwValue | 0); + setTempRet0(threwValue | 0); + } else $24 = -1; + $25 = getTempRet0() | 0; + if (($24 | 0) == 1) { + $$reg2mem103$0 = $25; + continue; + } + __THREW__ = 0; + invoke_vii(125, $5 | 0, $0 | 0); + $26 = __THREW__; + __THREW__ = 0; + if (($26 | 0) != 0 & (threwValue | 0) != 0) { + $27 = _testSetjmp(HEAP32[$26 >> 2] | 0, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + if (!$27) _longjmp($26 | 0, threwValue | 0); + setTempRet0(threwValue | 0); + } else $27 = -1; + $28 = getTempRet0() | 0; + if (($27 | 0) == 1) { + $$reg2mem103$0 = $28; + continue; + } + __THREW__ = 0; + $29 = invoke_iii(43, $5 | 0, 1) | 0; + $30 = __THREW__; + __THREW__ = 0; + if (($30 | 0) != 0 & (threwValue | 0) != 0) { + $31 = _testSetjmp(HEAP32[$30 >> 2] | 0, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + if (!$31) _longjmp($30 | 0, threwValue | 0); + setTempRet0(threwValue | 0); + } else $31 = -1; + $32 = getTempRet0() | 0; + if (($31 | 0) == 1) { + $$reg2mem103$0 = $32; + continue; + } + if (($29 | 0) != 1) { + __THREW__ = 0; + invoke_viiii(8, 0, 3, 25854, $vararg_buffer105 | 0); + $34 = __THREW__; + __THREW__ = 0; + if (($34 | 0) != 0 & (threwValue | 0) != 0) { + $35 = _testSetjmp(HEAP32[$34 >> 2] | 0, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + if (!$35) _longjmp($34 | 0, threwValue | 0); + setTempRet0(threwValue | 0); + } else $35 = -1; + $36 = getTempRet0() | 0; + if (($35 | 0) == 1) { + $$reg2mem103$0 = $36; + continue; + } + __THREW__ = 0; + invoke_vi(182, $5 | 0); + $37 = __THREW__; + __THREW__ = 0; + if (($37 | 0) != 0 & (threwValue | 0) != 0) { + $38 = _testSetjmp(HEAP32[$37 >> 2] | 0, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + if (!$38) _longjmp($37 | 0, threwValue | 0); + setTempRet0(threwValue | 0); + } else $38 = -1; + $39 = getTempRet0() | 0; + if (($38 | 0) == 1) { + $$reg2mem103$0 = $39; + continue; + } else { + label = 14; + break; + } + } + __THREW__ = 0; + invoke_ii(64, $5 | 0) | 0; + $40 = __THREW__; + __THREW__ = 0; + if (($40 | 0) != 0 & (threwValue | 0) != 0) { + $41 = _testSetjmp(HEAP32[$40 >> 2] | 0, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + if (!$41) _longjmp($40 | 0, threwValue | 0); + setTempRet0(threwValue | 0); + } else $41 = -1; + $42 = getTempRet0() | 0; + if (($41 | 0) == 1) { + $$reg2mem103$0 = $42; + continue; + } + $43 = $5 + 36 | 0; + $45 = $5 + 28 | 0; + $47 = Math_imul(HEAP32[$45 >> 2] | 0, HEAP32[$43 >> 2] | 0) | 0; + $48 = $5 + 32 | 0; + $50 = Math_imul($47, HEAP32[$48 >> 2] | 0) | 0; + __THREW__ = 0; + $51 = invoke_ii(65, $50 | 0) | 0; + $52 = __THREW__; + __THREW__ = 0; + if (($52 | 0) != 0 & (threwValue | 0) != 0) { + $53 = _testSetjmp(HEAP32[$52 >> 2] | 0, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + if (!$53) _longjmp($52 | 0, threwValue | 0); + setTempRet0(threwValue | 0); + } else $53 = -1; + $54 = getTempRet0() | 0; + if (($53 | 0) == 1) { + $$reg2mem103$0 = $54; + continue; + } + if (!$51) { + __THREW__ = 0; + invoke_viiii(8, 0, 3, 45930, $vararg_buffer107 | 0); + $56 = __THREW__; + __THREW__ = 0; + if (($56 | 0) != 0 & (threwValue | 0) != 0) { + $57 = _testSetjmp(HEAP32[$56 >> 2] | 0, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + if (!$57) _longjmp($56 | 0, threwValue | 0); + setTempRet0(threwValue | 0); + } else $57 = -1; + $58 = getTempRet0() | 0; + if (($57 | 0) == 1) { + $$reg2mem103$0 = $58; + continue; + } + __THREW__ = 0; + invoke_vi(182, $5 | 0); + $59 = __THREW__; + __THREW__ = 0; + if (($59 | 0) != 0 & (threwValue | 0) != 0) { + $60 = _testSetjmp(HEAP32[$59 >> 2] | 0, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + if (!$60) _longjmp($59 | 0, threwValue | 0); + setTempRet0(threwValue | 0); + } else $60 = -1; + $61 = getTempRet0() | 0; + if (($60 | 0) == 1) { + $$reg2mem103$0 = $61; + continue; + } else { + label = 20; + break; + } + } + $62 = $5 + 140 | 0; + $63 = $5 + 116 | 0; + $$034$reg2mem101$0 = 0; + while (1) { + if ((HEAP32[$62 >> 2] | 0) >>> 0 >= (HEAP32[$63 >> 2] | 0) >>> 0) break; + $$033$reg2mem99$0 = 0; + while (1) { + if (($$033$reg2mem99$0 | 0) == 5) break; + $69 = $51 + (Math_imul($$033$reg2mem99$0 + $$034$reg2mem101$0 | 0, $47) | 0) | 0; + HEAP32[$7 + ($$033$reg2mem99$0 << 2) >> 2] = $69; + $$033$reg2mem99$0 = $$033$reg2mem99$0 + 1 | 0; + } + __THREW__ = 0; + $72 = invoke_iiii(25, $5 | 0, $7 | 0, 5) | 0; + $73 = __THREW__; + __THREW__ = 0; + if (($73 | 0) != 0 & (threwValue | 0) != 0) { + $74 = _testSetjmp(HEAP32[$73 >> 2] | 0, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + if (!$74) _longjmp($73 | 0, threwValue | 0); + setTempRet0(threwValue | 0); + } else $74 = -1; + $75 = getTempRet0() | 0; + if (($74 | 0) == 1) { + $$reg2mem103$0 = $75; + continue L4; + } + $$034$reg2mem101$0 = $72 + $$034$reg2mem101$0 | 0; + } + __THREW__ = 0; + invoke_ii(66, $5 | 0) | 0; + $77 = __THREW__; + __THREW__ = 0; + if (($77 | 0) != 0 & (threwValue | 0) != 0) { + $78 = _testSetjmp(HEAP32[$77 >> 2] | 0, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + if (!$78) _longjmp($77 | 0, threwValue | 0); + setTempRet0(threwValue | 0); + } else $78 = -1; + $79 = getTempRet0() | 0; + if (($78 | 0) == 1) { + $$reg2mem103$0 = $79; + continue; + } + __THREW__ = 0; + invoke_vi(182, $5 | 0); + $80 = __THREW__; + __THREW__ = 0; + if (($80 | 0) != 0 & (threwValue | 0) != 0) { + $81 = _testSetjmp(HEAP32[$80 >> 2] | 0, _setjmpTable | 0, _setjmpTableSize | 0) | 0; + if (!$81) _longjmp($80 | 0, threwValue | 0); + setTempRet0(threwValue | 0); + } else $81 = -1; + $$reg2mem103$0 = getTempRet0() | 0; + if (($81 | 0) != 1) { + label = 30; + break; + } + } + L33 : do if ((label | 0) == 7) $$0$reg2mem$0 = 0; else if ((label | 0) == 14) $$0$reg2mem$0 = 0; else if ((label | 0) == 20) $$0$reg2mem$0 = 0; else if ((label | 0) == 30) { + if ($1 | 0) HEAP32[$1 >> 2] = HEAP32[$45 >> 2]; + if ($2 | 0) HEAP32[$2 >> 2] = HEAP32[$48 >> 2]; + if ($3 | 0) HEAP32[$3 >> 2] = HEAP32[$43 >> 2]; + if (!$4) $$0$reg2mem$0 = $51; else { + $91 = HEAP8[$5 + 290 >> 0] | 0; + switch ($91 << 24 >> 24) { + case 1: + { + $93 = HEAP16[$5 + 292 >> 1] | 0; + if ($93 << 16 >> 16 == (HEAP16[$5 + 294 >> 1] | 0)) { + HEAPF32[$4 >> 2] = +($93 & 65535); + $$0$reg2mem$0 = $51; + break L33; + } + break; + } + case 2: + { + $99 = HEAP16[$5 + 292 >> 1] | 0; + if ($99 << 16 >> 16 == (HEAP16[$5 + 294 >> 1] | 0)) { + HEAPF32[$4 >> 2] = +($99 & 65535) * 2.5399999618530273; + $$0$reg2mem$0 = $51; + break L33; + } + break; + } + default: + if ((($91 & 255) > 2 ? (HEAP16[$5 + 292 >> 1] | 0) == 0 : 0) ? (HEAP16[$5 + 294 >> 1] | 0) == 0 : 0) { + HEAPF32[$4 >> 2] = +($91 & 255); + $$0$reg2mem$0 = $51; + break L33; + } + } + HEAPF32[$4 >> 2] = 0.0; + $$0$reg2mem$0 = $51; + } + } while (0); + _free(_setjmpTable | 0); + STACKTOP = sp; + return $$0$reg2mem$0 | 0; +} + +function _decompress_smooth_data($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0284 = 0, $$0288350 = 0, $$0289349 = 0, $$0289349$phi = 0, $$0292348 = 0, $$0293347 = 0, $$0293347$phi = 0, $$0296346 = 0, $$0297345 = 0, $$0297345$phi = 0, $$0298344 = 0, $$0299354 = 0, $$0300352 = 0, $$0303 = 0, $$0304 = 0, $$0305343 = 0, $$0306 = 0, $$0308 = 0, $$0309 = 0, $$0310 = 0, $$0312353 = 0, $$0313340 = 0, $$0314351 = 0, $$1 = 0, $$1287 = 0, $$1291 = 0, $$1295 = 0, $$1302 = 0, $$1307342 = 0, $$1311341 = 0, $$3 = 0, $$5 = 0, $$7 = 0, $$9 = 0, $$pre$phiZ2D = 0, $10 = 0, $100 = 0, $103 = 0, $106 = 0, $109 = 0, $11 = 0, $113 = 0, $114 = 0, $115 = 0, $116 = 0, $117 = 0, $118 = 0, $119 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0, $134 = 0, $135 = 0, $136 = 0, $138 = 0, $14 = 0, $148 = 0, $15 = 0, $150 = 0, $152 = 0, $154 = 0, $16 = 0, $165 = 0, $170 = 0, $173 = 0, $175 = 0, $179 = 0, $181 = 0, $186 = 0, $191 = 0, $194 = 0, $196 = 0, $2 = 0, $20 = 0, $200 = 0, $202 = 0, $207 = 0, $214 = 0, $217 = 0, $219 = 0, $223 = 0, $225 = 0, $230 = 0, $237 = 0, $240 = 0, $242 = 0, $246 = 0, $248 = 0, $25 = 0, $253 = 0, $26 = 0, $260 = 0, $263 = 0, $265 = 0, $269 = 0, $271 = 0, $291 = 0, $37 = 0, $4 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $54 = 0, $57 = 0, $62 = 0, $63 = 0, $68 = 0, $7 = 0, $75 = 0, $76 = 0, $8 = 0, $87 = 0, $89 = 0, $9 = 0, $91 = 0, $94 = 0, $97 = 0, $spec$select = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 128 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(128); + $2 = sp; + $4 = HEAP32[$0 + 452 >> 2] | 0; + $5 = $0 + 332 | 0; + $7 = (HEAP32[$5 >> 2] | 0) + -1 | 0; + $8 = $0 + 144 | 0; + $9 = HEAP32[$8 >> 2] | 0; + $10 = $0 + 152 | 0; + $11 = HEAP32[$10 >> 2] | 0; + L1 : do if (($9 | 0) <= ($11 | 0)) { + $13 = $0 + 460 | 0; + $14 = $0 + 412 | 0; + $15 = $0 + 148 | 0; + $16 = $0 + 156 | 0; + $25 = $9; + $26 = $11; + while (1) { + $20 = HEAP32[$13 >> 2] | 0; + if (HEAP32[$20 + 20 >> 2] | 0) break L1; + if (($25 | 0) == ($26 | 0) ? (HEAP32[$15 >> 2] | 0) >>> 0 > ((HEAP32[$16 >> 2] | 0) + ((HEAP32[$14 >> 2] | 0) == 0 & 1) | 0) >>> 0 : 0) break L1; + if (!(FUNCTION_TABLE_ii[HEAP32[$20 >> 2] & 127]($0) | 0)) { + $$0284 = 0; + break; + } + $25 = HEAP32[$8 >> 2] | 0; + $26 = HEAP32[$10 >> 2] | 0; + if (($25 | 0) > ($26 | 0)) break L1; + } + STACKTOP = sp; + return $$0284 | 0; + } while (0); + $37 = $0 + 36 | 0; + if ((HEAP32[$37 >> 2] | 0) > 0) { + $42 = $0 + 156 | 0; + $43 = $0 + 4 | 0; + $44 = $4 + 112 | 0; + $45 = $0 + 472 | 0; + $46 = $2 + 2 | 0; + $47 = $2 + 16 | 0; + $48 = $2 + 32 | 0; + $49 = $2 + 18 | 0; + $50 = $2 + 4 | 0; + $$0299354 = 0; + $$0312353 = HEAP32[$0 + 216 >> 2] | 0; + while (1) { + if (HEAP32[$$0312353 + 52 >> 2] | 0) { + $54 = HEAP32[$42 >> 2] | 0; + if ($54 >>> 0 < $7 >>> 0) { + $57 = HEAP32[$$0312353 + 12 >> 2] | 0; + $$0303 = $57 << 1; + $$0308 = 0; + $$1302 = $57; + $68 = $57; + } else { + $62 = HEAP32[$$0312353 + 12 >> 2] | 0; + $63 = ((HEAP32[$$0312353 + 32 >> 2] | 0) >>> 0) % ($62 >>> 0) | 0; + $spec$select = ($63 | 0) == 0 ? $62 : $63; + $$0303 = $spec$select; + $$0308 = 1; + $$1302 = $spec$select; + $68 = $62; + } + if (!$54) { + $$0304 = FUNCTION_TABLE_iiiiii[HEAP32[(HEAP32[$43 >> 2] | 0) + 32 >> 2] & 31]($0, HEAP32[$4 + 72 + ($$0299354 << 2) >> 2] | 0, 0, $$0303, 0) | 0; + $$0309 = 1; + } else { + $75 = Math_imul($68, $54 + -1 | 0) | 0; + $76 = FUNCTION_TABLE_iiiiii[HEAP32[(HEAP32[$43 >> 2] | 0) + 32 >> 2] & 31]($0, HEAP32[$4 + 72 + ($$0299354 << 2) >> 2] | 0, $75, $68 + $$0303 | 0, 0) | 0; + $$0304 = $76 + (HEAP32[$$0312353 + 12 >> 2] << 2) | 0; + $$0309 = 0; + } + $87 = (HEAP32[$44 >> 2] | 0) + ($$0299354 * 6 << 2) | 0; + $89 = HEAP32[$$0312353 + 80 >> 2] | 0; + $91 = HEAPU16[$89 >> 1] | 0; + $94 = HEAPU16[$89 + 2 >> 1] | 0; + $97 = HEAPU16[$89 + 16 >> 1] | 0; + $100 = HEAPU16[$89 + 32 >> 1] | 0; + $103 = HEAPU16[$89 + 18 >> 1] | 0; + $106 = HEAPU16[$89 + 4 >> 1] | 0; + $109 = HEAP32[(HEAP32[$45 >> 2] | 0) + 4 + ($$0299354 << 2) >> 2] | 0; + if (($$1302 | 0) > 0) { + $113 = ($$0309 | 0) != 0; + $114 = ($$0308 | 0) != 0; + $115 = $$1302 + -1 | 0; + $116 = $$0312353 + 28 | 0; + $117 = $87 + 4 | 0; + $118 = $87 + 8 | 0; + $119 = $87 + 12 | 0; + $120 = $91 * 36 | 0; + $121 = $94 << 7; + $122 = $87 + 16 | 0; + $123 = $97 << 7; + $124 = $94 << 8; + $125 = $87 + 20 | 0; + $126 = $91 * 9 | 0; + $127 = $100 << 7; + $128 = $97 << 8; + $129 = $$0312353 + 36 | 0; + $130 = $91 * 5 | 0; + $131 = $103 << 7; + $132 = $100 << 8; + $133 = $106 << 7; + $134 = $103 << 8; + $135 = $106 << 8; + $136 = $$0312353 + 40 | 0; + $$0300352 = 0; + $$0314351 = HEAP32[$1 + ($$0299354 << 2) >> 2] | 0; + while (1) { + $138 = HEAP32[$$0304 + ($$0300352 << 2) >> 2] | 0; + if ($113 & ($$0300352 | 0) == 0) $$0306 = $138; else $$0306 = HEAP32[$$0304 + ($$0300352 + -1 << 2) >> 2] | 0; + if ($114 & ($$0300352 | 0) == ($115 | 0)) $$0310 = $138; else $$0310 = HEAP32[$$0304 + ($$0300352 + 1 << 2) >> 2] | 0; + $148 = HEAP16[$$0306 >> 1] | 0; + $150 = HEAP16[$138 >> 1] | 0; + $152 = HEAP16[$$0310 >> 1] | 0; + $154 = (HEAP32[$116 >> 2] | 0) + -1 | 0; + $$0288350 = $152; + $$0289349 = $152; + $$0292348 = $150; + $$0293347 = $150; + $$0296346 = $148; + $$0297345 = $148; + $$0298344 = 0; + $$0305343 = $138; + $$0313340 = 0; + $$1307342 = $$0306; + $$1311341 = $$0310; + while (1) { + _jcopy_block_row($$0305343, $2, 1); + if ($$0298344 >>> 0 < $154 >>> 0) { + $$1287 = HEAP16[$$1311341 + 128 >> 1] | 0; + $$1291 = HEAP16[$$0305343 + 128 >> 1] | 0; + $$1295 = HEAP16[$$1307342 + 128 >> 1] | 0; + } else { + $$1287 = $$0288350; + $$1291 = $$0292348; + $$1295 = $$0296346; + } + $165 = HEAP32[$117 >> 2] | 0; + if (($165 | 0) != 0 & (HEAP16[$46 >> 1] | 0) == 0) { + $170 = Math_imul($120, $$0293347 - $$1291 | 0) | 0; + if (($170 | 0) > -1) { + $173 = ($170 + $121 | 0) / ($124 | 0) | 0; + $175 = 1 << $165; + $$1 = ($165 | 0) > 0 ? (($173 | 0) < ($175 | 0) ? $173 : $175 + -1 | 0) : $173; + } else { + $179 = ($121 - $170 | 0) / ($124 | 0) | 0; + $181 = 1 << $165; + $$1 = 0 - (($165 | 0) > 0 ? (($179 | 0) < ($181 | 0) ? $179 : $181 + -1 | 0) : $179) | 0; + } + HEAP16[$46 >> 1] = $$1; + } + $186 = HEAP32[$118 >> 2] | 0; + if (($186 | 0) != 0 & (HEAP16[$47 >> 1] | 0) == 0) { + $191 = Math_imul($120, $$0296346 - $$0288350 | 0) | 0; + if (($191 | 0) > -1) { + $194 = ($191 + $123 | 0) / ($128 | 0) | 0; + $196 = 1 << $186; + $$3 = ($186 | 0) > 0 ? (($194 | 0) < ($196 | 0) ? $194 : $196 + -1 | 0) : $194; + } else { + $200 = ($123 - $191 | 0) / ($128 | 0) | 0; + $202 = 1 << $186; + $$3 = 0 - (($186 | 0) > 0 ? (($200 | 0) < ($202 | 0) ? $200 : $202 + -1 | 0) : $200) | 0; + } + HEAP16[$47 >> 1] = $$3; + } + $207 = HEAP32[$119 >> 2] | 0; + if (($207 | 0) != 0 & (HEAP16[$48 >> 1] | 0) == 0) { + $214 = Math_imul($126, $$0296346 - ($$0292348 << 1) + $$0288350 | 0) | 0; + if (($214 | 0) > -1) { + $217 = ($214 + $127 | 0) / ($132 | 0) | 0; + $219 = 1 << $207; + $$5 = ($207 | 0) > 0 ? (($217 | 0) < ($219 | 0) ? $217 : $219 + -1 | 0) : $217; + } else { + $223 = ($127 - $214 | 0) / ($132 | 0) | 0; + $225 = 1 << $207; + $$5 = 0 - (($207 | 0) > 0 ? (($223 | 0) < ($225 | 0) ? $223 : $225 + -1 | 0) : $223) | 0; + } + HEAP16[$48 >> 1] = $$5; + } + $230 = HEAP32[$122 >> 2] | 0; + if (($230 | 0) != 0 & (HEAP16[$49 >> 1] | 0) == 0) { + $237 = Math_imul($130, $$0297345 - $$0289349 - $$1295 + $$1287 | 0) | 0; + if (($237 | 0) > -1) { + $240 = ($237 + $131 | 0) / ($134 | 0) | 0; + $242 = 1 << $230; + $$7 = ($230 | 0) > 0 ? (($240 | 0) < ($242 | 0) ? $240 : $242 + -1 | 0) : $240; + } else { + $246 = ($131 - $237 | 0) / ($134 | 0) | 0; + $248 = 1 << $230; + $$7 = 0 - (($230 | 0) > 0 ? (($246 | 0) < ($248 | 0) ? $246 : $248 + -1 | 0) : $246) | 0; + } + HEAP16[$49 >> 1] = $$7; + } + $253 = HEAP32[$125 >> 2] | 0; + if (($253 | 0) != 0 & (HEAP16[$50 >> 1] | 0) == 0) { + $260 = Math_imul($126, $$0293347 - ($$0292348 << 1) + $$1291 | 0) | 0; + if (($260 | 0) > -1) { + $263 = ($260 + $133 | 0) / ($135 | 0) | 0; + $265 = 1 << $253; + $$9 = ($253 | 0) > 0 ? (($263 | 0) < ($265 | 0) ? $263 : $265 + -1 | 0) : $263; + } else { + $269 = ($133 - $260 | 0) / ($135 | 0) | 0; + $271 = 1 << $253; + $$9 = 0 - (($253 | 0) > 0 ? (($269 | 0) < ($271 | 0) ? $269 : $271 + -1 | 0) : $269) | 0; + } + HEAP16[$50 >> 1] = $$9; + } + FUNCTION_TABLE_viiiii[$109 & 63]($0, $$0312353, $2, $$0314351, $$0313340); + $$0298344 = $$0298344 + 1 | 0; + if ($$0298344 >>> 0 > $154 >>> 0) break; else { + $$0297345$phi = $$0296346; + $$0293347$phi = $$0292348; + $$0289349$phi = $$0288350; + $$0288350 = $$1287; + $$0292348 = $$1291; + $$0296346 = $$1295; + $$0305343 = $$0305343 + 128 | 0; + $$0313340 = (HEAP32[$129 >> 2] | 0) + $$0313340 | 0; + $$1307342 = $$1307342 + 128 | 0; + $$1311341 = $$1311341 + 128 | 0; + $$0297345 = $$0297345$phi; + $$0293347 = $$0293347$phi; + $$0289349 = $$0289349$phi; + } + } + $$0300352 = $$0300352 + 1 | 0; + if (($$0300352 | 0) == ($$1302 | 0)) break; else $$0314351 = $$0314351 + (HEAP32[$136 >> 2] << 2) | 0; + } + } + } + $$0299354 = $$0299354 + 1 | 0; + if (($$0299354 | 0) >= (HEAP32[$37 >> 2] | 0)) { + $$pre$phiZ2D = $42; + break; + } else $$0312353 = $$0312353 + 88 | 0; + } + } else $$pre$phiZ2D = $0 + 156 | 0; + $291 = (HEAP32[$$pre$phiZ2D >> 2] | 0) + 1 | 0; + HEAP32[$$pre$phiZ2D >> 2] = $291; + $$0284 = $291 >>> 0 < (HEAP32[$5 >> 2] | 0) >>> 0 ? 3 : 4; + STACKTOP = sp; + return $$0284 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E16parseSpecialNameEv($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$11 = 0, $$12 = 0, $$13 = 0, $$14 = 0, $$2 = 0, $$3 = 0, $$4 = 0, $$5 = 0, $$6 = 0, $$7 = 0, $$8 = 0, $$9 = 0, $1 = 0, $10 = 0, $16 = 0, $2 = 0, $22 = 0, $28 = 0, $36 = 0, $41 = 0, $42 = 0, $46 = 0, $52 = 0, $58 = 0, $64 = 0, $67 = 0, $76 = 0, $82 = 0, $84 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp + 8 | 0; + $2 = sp; + L1 : do switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 | 0) { + case 84: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 | 0) { + case 86: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $10; + if (!$10) $$0 = 0; else $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA12_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) | 0; + $$14 = $$0; + break L1; + break; + } + case 84: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $16 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $16; + if (!$16) $$1 = 0; else $$1 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA9_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) | 0; + $$14 = $$1; + break L1; + break; + } + case 73: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $22 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $22; + if (!$22) $$2 = 0; else $$2 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA14_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) | 0; + $$14 = $$2; + break L1; + break; + } + case 83: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $28 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $28; + if (!$28) $$3 = 0; else $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA19_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) | 0; + $$14 = $$3; + break L1; + break; + } + case 99: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseCallOffsetEv($0) | 0) { + $$14 = 0; + break L1; + } + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseCallOffsetEv($0) | 0) { + $$14 = 0; + break L1; + } + $36 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseEncodingEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $36; + if (!$36) $$4 = 0; else $$4 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA27_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) | 0; + $$14 = $$4; + break L1; + break; + } + case 67: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $41 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $42 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($41) | 0; + HEAP32[$1 >> 2] = $42; + do if ($42) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E11parseNumberEb($2, $0, 1); + if (__ZNK12_GLOBAL__N_110StringView5emptyEv($2) | 0) { + $$6 = 0; + break; + } + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) { + $46 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($41) | 0; + HEAP32[$2 >> 2] = $46; + if (!$46) $$5 = 0; else $$5 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_21CtorVtableSpecialNameEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $2, $1) | 0; + $$6 = $$5; + } else $$6 = 0; + } else $$6 = 0; while (0); + $$14 = $$6; + break L1; + break; + } + case 87: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $52 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseNameEPNS5_9NameStateE(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0, 0) | 0; + HEAP32[$1 >> 2] = $52; + if (!$52) $$7 = 0; else $$7 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA34_KcRPNS0_4NodeEEEESC_DpOT0_($0, 56739, $1) | 0; + $$14 = $$7; + break L1; + break; + } + case 72: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $58 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseNameEPNS5_9NameStateE(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0, 0) | 0; + HEAP32[$1 >> 2] = $58; + if (!$58) $$8 = 0; else $$8 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA41_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) | 0; + $$14 = $$8; + break L1; + break; + } + default: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $64 = (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 == 118; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseCallOffsetEv($0) | 0) { + $$14 = 0; + break L1; + } + $67 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseEncodingEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $67; + do if ($67) if ($64) { + $$9 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA18_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) | 0; + break; + } else { + $$9 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA22_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) | 0; + break; + } else $$9 = 0; while (0); + $$14 = $$9; + break L1; + } + } + break; + } + case 71: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 | 0) { + case 86: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $76 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseNameEPNS5_9NameStateE(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0, 0) | 0; + HEAP32[$1 >> 2] = $76; + if (!$76) $$11 = 0; else $$11 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA20_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) | 0; + $$14 = $$11; + break L1; + break; + } + case 82: + break; + default: + { + $$14 = 0; + break L1; + } + } + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $82 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseNameEPNS5_9NameStateE(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0, 0) | 0; + HEAP32[$1 >> 2] = $82; + if (!$82) $$13 = 0; else { + $84 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10parseSeqIdEPm($0, $2) | 0; + if ($84 | (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0)) $$12 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA25_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) | 0; else $$12 = 0; + $$13 = $$12; + } + $$14 = $$13; + break; + } + default: + $$14 = 0; + } while (0); + STACKTOP = sp; + return $$14 | 0; +} + +function _ar2SelectTemplate($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0248 = 0, $$0250 = 0, $$0253 = 0, $$0255 = 0, $$0256 = 0, $$0257 = 0, $$0258 = 0, $$0259 = 0.0, $$0261 = 0.0, $$0263 = 0, $$0265 = 0, $$0266 = 0.0, $$0268 = 0, $$0270 = 0, $$0271 = 0.0, $$0273 = 0, $$0274 = 0, $$1 = 0, $$1249 = 0, $$1251 = 0, $$1254 = 0, $$1260 = 0.0, $$1262 = 0.0, $$1264 = 0, $$1267 = 0.0, $$1269 = 0, $$1272 = 0.0, $$1275 = 0, $$2 = 0, $$2252 = 0, $$279 = 0, $$280 = 0, $$3 = 0, $$4 = 0, $$pre = 0.0, $10 = 0, $101 = 0.0, $104 = 0.0, $11 = 0, $111 = 0.0, $112 = 0.0, $120 = 0.0, $123 = 0.0, $125 = 0.0, $128 = 0.0, $129 = 0, $130 = 0, $131 = 0.0, $132 = 0.0, $133 = 0.0, $134 = 0.0, $135 = 0.0, $136 = 0.0, $138 = 0, $14 = 0.0, $140 = 0, $144 = 0.0, $147 = 0, $148 = 0.0, $153 = 0.0, $160 = 0, $161 = 0.0, $162 = 0.0, $163 = 0.0, $169 = 0, $17 = 0.0, $176 = 0.0, $181 = 0, $183 = 0, $184 = 0, $185 = 0, $186 = 0, $19 = 0.0, $203 = 0, $206 = 0, $207 = 0, $219 = 0, $22 = 0.0, $220 = 0, $221 = 0, $24 = 0.0, $26 = 0.0, $30 = 0.0, $34 = 0.0, $37 = 0.0, $39 = 0.0, $41 = 0.0, $47 = 0.0, $50 = 0.0, $52 = 0.0, $55 = 0.0, $56 = 0, $6 = 0, $60 = 0.0, $64 = 0.0, $68 = 0.0, $7 = 0, $71 = 0.0, $73 = 0.0, $79 = 0.0, $8 = 0, $82 = 0.0, $84 = 0.0, $87 = 0.0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $94 = 0.0, $98 = 0.0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $6 = sp + 20 | 0; + $7 = sp + 16 | 0; + $8 = sp + 12 | 0; + $9 = sp + 8 | 0; + $10 = sp + 4 | 0; + $11 = sp; + L1 : do if (($2 | 0) < 0) $$1 = -1; else switch ($2 | 0) { + case 0: + { + $14 = +(($4 | 0) / 8 | 0 | 0); + $17 = +(($4 * 7 | 0) / 8 | 0 | 0); + $19 = +(($5 | 0) / 8 | 0 | 0); + $22 = +(($5 * 7 | 0) / 8 | 0 | 0); + $24 = +(($4 | 0) / 2 | 0 | 0); + $26 = +(($5 | 0) / 2 | 0 | 0); + $$0259 = 0.0; + $$0273 = 0; + $$0274 = -1; + L38 : while (1) { + switch (HEAP32[$0 + ($$0273 * 24 | 0) + 12 >> 2] | 0) { + case -1: + { + break L38; + break; + } + case 0: + { + $30 = +HEAPF32[$0 + ($$0273 * 24 | 0) + 16 >> 2]; + if ((!($30 < $14 | $30 > $17) ? ($34 = +HEAPF32[$0 + ($$0273 * 24 | 0) + 20 >> 2], !($34 < $19 | $34 > $22)) : 0) ? ($37 = $30 - $24, $39 = $34 - $26, $41 = $37 * $37 + $39 * $39, $41 > $$0259) : 0) { + $$1260 = $41; + $$1275 = $$0273; + } else { + $$1260 = $$0259; + $$1275 = $$0274; + } + break; + } + default: + { + $$1260 = $$0259; + $$1275 = $$0274; + } + } + $$0259 = $$1260; + $$0273 = $$0273 + 1 | 0; + $$0274 = $$1275; + } + if (($$0274 | 0) == -1) { + $$1 = -1; + break L1; + } + HEAP32[$0 + ($$0274 * 24 | 0) + 12 >> 2] = 1; + $$1 = $$0274; + break L1; + break; + } + case 1: + { + $47 = +(($4 | 0) / 8 | 0 | 0); + $50 = +(($4 * 7 | 0) / 8 | 0 | 0); + $52 = +(($5 | 0) / 8 | 0 | 0); + $55 = +(($5 * 7 | 0) / 8 | 0 | 0); + $56 = $3 + 4 | 0; + $$0268 = -1; + $$0270 = 0; + $$0271 = 0.0; + L49 : while (1) { + switch (HEAP32[$0 + ($$0270 * 24 | 0) + 12 >> 2] | 0) { + case -1: + { + break L49; + break; + } + case 0: + { + $60 = +HEAPF32[$0 + ($$0270 * 24 | 0) + 16 >> 2]; + if ((!($60 < $47 | $60 > $50) ? ($64 = +HEAPF32[$0 + ($$0270 * 24 | 0) + 20 >> 2], !($64 < $52 | $64 > $55)) : 0) ? ($68 = $60 - +HEAPF32[$3 >> 2], $71 = $64 - +HEAPF32[$56 >> 2], $73 = $68 * $68 + $71 * $71, $73 > $$0271) : 0) { + $$1269 = $$0270; + $$1272 = $73; + } else { + $$1269 = $$0268; + $$1272 = $$0271; + } + break; + } + default: + { + $$1269 = $$0268; + $$1272 = $$0271; + } + } + $$0268 = $$1269; + $$0270 = $$0270 + 1 | 0; + $$0271 = $$1272; + } + if (($$0268 | 0) == -1) { + $$1 = -1; + break L1; + } + HEAP32[$0 + ($$0268 * 24 | 0) + 12 >> 2] = 1; + $$1 = $$0268; + break L1; + break; + } + case 2: + { + $79 = +(($4 | 0) / 8 | 0 | 0); + $82 = +(($4 * 7 | 0) / 8 | 0 | 0); + $84 = +(($5 | 0) / 8 | 0 | 0); + $87 = +(($5 * 7 | 0) / 8 | 0 | 0); + $88 = $3 + 12 | 0; + $89 = $3 + 4 | 0; + $90 = $3 + 8 | 0; + $$0263 = -1; + $$0265 = 0; + $$0266 = 0.0; + L60 : while (1) { + switch (HEAP32[$0 + ($$0265 * 24 | 0) + 12 >> 2] | 0) { + case -1: + { + break L60; + break; + } + case 0: + { + $94 = +HEAPF32[$0 + ($$0265 * 24 | 0) + 16 >> 2]; + if ((!($94 < $79 | $94 > $82) ? ($98 = +HEAPF32[$0 + ($$0265 * 24 | 0) + 20 >> 2], !($98 < $84 | $98 > $87)) : 0) ? ($101 = +HEAPF32[$3 >> 2], $104 = +HEAPF32[$89 >> 2], $111 = ($94 - $101) * (+HEAPF32[$88 >> 2] - $104) - ($98 - $104) * (+HEAPF32[$90 >> 2] - $101), $112 = $111 * $111, $112 > $$0266) : 0) { + $$1264 = $$0265; + $$1267 = $112; + } else { + $$1264 = $$0263; + $$1267 = $$0266; + } + break; + } + default: + { + $$1264 = $$0263; + $$1267 = $$0266; + } + } + $$0263 = $$1264; + $$0265 = $$0265 + 1 | 0; + $$0266 = $$1267; + } + if (($$0263 | 0) == -1) { + $$1 = -1; + break L1; + } + HEAP32[$0 + ($$0263 * 24 | 0) + 12 >> 2] = 1; + $$1 = $$0263; + break L1; + break; + } + case 3: + { + _ar2GetVectorAngle($3, $3 + 8 | 0, $6, $7); + _ar2GetVectorAngle($3, $3 + 16 | 0, $8, $9); + $120 = +(($4 | 0) / 8 | 0 | 0); + $123 = +(($4 * 7 | 0) / 8 | 0 | 0); + $125 = +(($5 | 0) / 8 | 0 | 0); + $128 = +(($5 * 7 | 0) / 8 | 0 | 0); + $129 = $3 + 24 | 0; + $130 = $3 + 28 | 0; + $131 = +HEAPF32[$8 >> 2]; + $132 = +HEAPF32[$7 >> 2]; + $133 = $131 * $132; + $134 = +HEAPF32[$9 >> 2]; + $135 = +HEAPF32[$6 >> 2]; + $136 = $134 * $135; + $138 = !($133 - $136 >= 0.0); + $140 = !($136 - $133 >= 0.0); + $$279 = $138 ? 2 : 1; + $$280 = $138 ? 1 : 2; + $$0253 = -1; + $$0255 = 0; + $$0261 = 0.0; + L71 : while (1) { + L73 : do switch (HEAP32[$0 + ($$0255 * 24 | 0) + 12 >> 2] | 0) { + case -1: + { + break L71; + break; + } + case 0: + { + $144 = +HEAPF32[$0 + ($$0255 * 24 | 0) + 16 >> 2]; + if (!($144 < $120 | $144 > $123) ? ($147 = $0 + ($$0255 * 24 | 0) + 20 | 0, $148 = +HEAPF32[$147 >> 2], !($148 < $125 | $148 > $128)) : 0) { + HEAPF32[$129 >> 2] = $144; + HEAP32[$130 >> 2] = HEAP32[$147 >> 2]; + _ar2GetVectorAngle($3, $129, $10, $11); + $$pre = +HEAPF32[$10 >> 2]; + if (!$138) { + $153 = +HEAPF32[$11 >> 2]; + if (!($132 * $$pre - $135 * $153 >= 0.0)) { + $163 = $153; + label = 39; + } else { + $160 = !($134 * $$pre - $131 * $153 >= 0.0); + $$0256 = $160 ? 2 : 3; + $$0257 = $160 ? 3 : 2; + $$0258 = 1; + } + } else { + $163 = +HEAPF32[$11 >> 2]; + label = 39; + } + do if ((label | 0) == 39) { + label = 0; + $161 = $134 * $$pre; + $162 = $131 * $163; + if ($140 | !($161 - $162 >= 0.0)) if ($162 - $161 >= 0.0 ? !($135 * $163 - $132 * $$pre >= 0.0) : 1) { + $$1254 = $$0253; + $$1262 = $$0261; + break L73; + } else { + $$0256 = $$280; + $$0257 = $$279; + $$0258 = 3; + break; + } else { + $169 = !($132 * $$pre - $135 * $163 >= 0.0); + $$0256 = $169 ? 1 : 3; + $$0257 = $169 ? 3 : 1; + $$0258 = 2; + break; + } + } while (0); + $176 = +_ar2GetRegionArea($3, $$0258, $$0257, $$0256); + if ($176 > $$0261) { + $$1254 = $$0255; + $$1262 = $176; + } else { + $$1254 = $$0253; + $$1262 = $$0261; + } + } else { + $$1254 = $$0253; + $$1262 = $$0261; + } + break; + } + default: + { + $$1254 = $$0253; + $$1262 = $$0261; + } + } while (0); + $$0253 = $$1254; + $$0255 = $$0255 + 1 | 0; + $$0261 = $$1262; + } + if (($$0253 | 0) != -1) HEAP32[$0 + ($$0253 * 24 | 0) + 12 >> 2] = 1; + $$1 = $$0253; + break L1; + break; + } + default: + { + $$0250 = 0; + L5 : while (1) { + $181 = $1 + ($$0250 * 24 | 0) + 12 | 0; + L7 : do switch (HEAP32[$181 >> 2] | 0) { + case -1: + { + break L5; + break; + } + case 0: + { + HEAP32[$181 >> 2] = 1; + $183 = $1 + ($$0250 * 24 | 0) | 0; + $184 = $1 + ($$0250 * 24 | 0) + 4 | 0; + $185 = $1 + ($$0250 * 24 | 0) + 8 | 0; + $$0248 = 0; + while (1) { + $186 = $0 + ($$0248 * 24 | 0) + 12 | 0; + switch (HEAP32[$186 >> 2] | 0) { + case -1: + { + break L7; + break; + } + case 0: + { + if (((HEAP32[$183 >> 2] | 0) == (HEAP32[$0 + ($$0248 * 24 | 0) >> 2] | 0) ? (HEAP32[$184 >> 2] | 0) == (HEAP32[$0 + ($$0248 * 24 | 0) + 4 >> 2] | 0) : 0) ? (HEAP32[$185 >> 2] | 0) == (HEAP32[$0 + ($$0248 * 24 | 0) + 8 >> 2] | 0) : 0) { + label = 55; + break L5; + } + break; + } + default: + {} + } + $$0248 = $$0248 + 1 | 0; + } + break; + } + default: + {} + } while (0); + $$0250 = $$0250 + 1 | 0; + } + if ((label | 0) == 55) { + HEAP32[$186 >> 2] = 1; + $$1 = $$0248; + break L1; + } + HEAP32[$1 + 12 >> 2] = -1; + $203 = HEAP32[16309] | 0; + if (!$203) { + _srand(_time(0) | 0); + $207 = HEAP32[16309] | 0; + } else $207 = $203; + $206 = $207 + 1 | 0; + HEAP32[16309] = ($206 | 0) == 128 ? 0 : $206; + $$1249 = 0; + $$1251 = 0; + L23 : while (1) { + switch (HEAP32[$0 + ($$1251 * 24 | 0) + 12 >> 2] | 0) { + case -1: + { + break L23; + break; + } + case 0: + { + $$2 = $$1249 + 1 | 0; + break; + } + default: + $$2 = $$1249; + } + $$1249 = $$2; + $$1251 = $$1251 + 1 | 0; + } + if (!$$1249) { + $$1 = -1; + break L1; + } + $219 = ~~(+($$1249 | 0) * +(_rand() | 0) * 4.656612873077393e-10); + $$2252 = 0; + $$3 = 0; + L30 : while (1) { + $220 = $0 + ($$2252 * 24 | 0) + 12 | 0; + $221 = HEAP32[$220 >> 2] | 0; + switch ($221 | 0) { + case -1: + { + $$1 = $221; + break L1; + break; + } + case 0: + { + if (($$3 | 0) == ($219 | 0)) break L30; + $$4 = $$3 + 1 | 0; + break; + } + default: + $$4 = $$3; + } + $$2252 = $$2252 + 1 | 0; + $$3 = $$4; + } + HEAP32[$220 >> 2] = 1; + $$1 = $$2252; + break L1; + } + } while (0); + STACKTOP = sp; + return $$1 | 0; +} + +function _jpeg_idct_4x8($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0199209 = 0, $$0201208 = 0, $$0203207 = 0, $$0210 = 0, $$sink = 0, $$sink212 = 0, $100 = 0, $101 = 0, $103 = 0, $106 = 0, $107 = 0, $109 = 0, $11 = 0, $113 = 0, $115 = 0, $117 = 0, $121 = 0, $123 = 0, $13 = 0, $149 = 0, $151 = 0, $153 = 0, $155 = 0, $157 = 0, $159 = 0, $161 = 0, $163 = 0, $165 = 0, $167 = 0, $169 = 0, $196 = 0, $198 = 0, $200 = 0, $202 = 0, $204 = 0, $206 = 0, $208 = 0, $210 = 0, $212 = 0, $214 = 0, $241 = 0, $243 = 0, $245 = 0, $247 = 0, $249 = 0, $251 = 0, $253 = 0, $255 = 0, $257 = 0, $259 = 0, $286 = 0, $288 = 0, $290 = 0, $292 = 0, $294 = 0, $296 = 0, $298 = 0, $300 = 0, $302 = 0, $304 = 0, $331 = 0, $333 = 0, $335 = 0, $337 = 0, $339 = 0, $341 = 0, $343 = 0, $345 = 0, $347 = 0, $349 = 0, $35 = 0, $376 = 0, $378 = 0, $380 = 0, $382 = 0, $384 = 0, $386 = 0, $388 = 0, $390 = 0, $392 = 0, $394 = 0, $421 = 0, $423 = 0, $425 = 0, $427 = 0, $429 = 0, $431 = 0, $433 = 0, $435 = 0, $437 = 0, $439 = 0, $466 = 0, $468 = 0, $470 = 0, $472 = 0, $474 = 0, $476 = 0, $478 = 0, $480 = 0, $482 = 0, $484 = 0, $5 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $58 = 0, $61 = 0, $67 = 0, $69 = 0, $7 = 0, $71 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $83 = 0, $89 = 0, $95 = 0, $99 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 128 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(128); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0199209 = $5; + $$0201208 = HEAP32[$1 + 84 >> 2] | 0; + $$0203207 = $2; + $$0210 = 4; + while (1) { + $11 = HEAP16[$$0203207 + 16 >> 1] | 0; + $13 = HEAP16[$$0203207 + 32 >> 1] | 0; + if (!(($11 | $13) << 16 >> 16)) if (((((HEAP16[$$0203207 + 48 >> 1] | 0) == 0 ? (HEAP16[$$0203207 + 64 >> 1] | 0) == 0 : 0) ? (HEAP16[$$0203207 + 80 >> 1] | 0) == 0 : 0) ? (HEAP16[$$0203207 + 96 >> 1] | 0) == 0 : 0) ? (HEAP16[$$0203207 + 112 >> 1] | 0) == 0 : 0) { + $35 = Math_imul(HEAP16[$$0203207 >> 1] << 2, HEAP32[$$0201208 >> 2] | 0) | 0; + HEAP32[$$0199209 >> 2] = $35; + HEAP32[$$0199209 + 16 >> 2] = $35; + HEAP32[$$0199209 + 32 >> 2] = $35; + HEAP32[$$0199209 + 48 >> 2] = $35; + HEAP32[$$0199209 + 64 >> 2] = $35; + HEAP32[$$0199209 + 80 >> 2] = $35; + HEAP32[$$0199209 + 96 >> 2] = $35; + $$sink = $35; + $$sink212 = 28; + } else { + $58 = 0; + label = 9; + } else { + $58 = $13; + label = 9; + } + if ((label | 0) == 9) { + label = 0; + $53 = Math_imul(HEAP16[$$0203207 + 64 >> 1] << 13, HEAP32[$$0201208 + 128 >> 2] | 0) | 0; + $54 = Math_imul(HEAP16[$$0203207 >> 1] << 13, HEAP32[$$0201208 >> 2] | 0) | 0 | 1024; + $55 = $53 + $54 | 0; + $56 = $54 - $53 | 0; + $61 = Math_imul(HEAP32[$$0201208 + 64 >> 2] | 0, $58 << 16 >> 16) | 0; + $67 = Math_imul(HEAP32[$$0201208 + 192 >> 2] | 0, HEAP16[$$0203207 + 96 >> 1] | 0) | 0; + $69 = ($67 + $61 | 0) * 4433 | 0; + $71 = $69 + ($61 * 6270 | 0) | 0; + $73 = $69 + (Math_imul($67, -15137) | 0) | 0; + $74 = $71 + $55 | 0; + $75 = $55 - $71 | 0; + $76 = $73 + $56 | 0; + $77 = $56 - $73 | 0; + $83 = Math_imul(HEAP32[$$0201208 + 224 >> 2] | 0, HEAP16[$$0203207 + 112 >> 1] | 0) | 0; + $89 = Math_imul(HEAP32[$$0201208 + 160 >> 2] | 0, HEAP16[$$0203207 + 80 >> 1] | 0) | 0; + $95 = Math_imul(HEAP32[$$0201208 + 96 >> 2] | 0, HEAP16[$$0203207 + 48 >> 1] | 0) | 0; + $99 = Math_imul(HEAP32[$$0201208 + 32 >> 2] | 0, $11 << 16 >> 16) | 0; + $100 = $95 + $83 | 0; + $101 = $99 + $89 | 0; + $103 = ($101 + $100 | 0) * 9633 | 0; + $106 = $103 + (Math_imul($100, -16069) | 0) | 0; + $107 = $103 + (Math_imul($101, -3196) | 0) | 0; + $109 = Math_imul($99 + $83 | 0, -7373) | 0; + $113 = $109 + ($83 * 2446 | 0) + $106 | 0; + $115 = $109 + ($99 * 12299 | 0) + $107 | 0; + $117 = Math_imul($95 + $89 | 0, -20995) | 0; + $121 = $117 + ($89 * 16819 | 0) + $107 | 0; + $123 = $117 + ($95 * 25172 | 0) + $106 | 0; + HEAP32[$$0199209 >> 2] = $115 + $74 >> 11; + HEAP32[$$0199209 + 112 >> 2] = $74 - $115 >> 11; + HEAP32[$$0199209 + 16 >> 2] = $123 + $76 >> 11; + HEAP32[$$0199209 + 96 >> 2] = $76 - $123 >> 11; + HEAP32[$$0199209 + 32 >> 2] = $121 + $77 >> 11; + HEAP32[$$0199209 + 80 >> 2] = $77 - $121 >> 11; + HEAP32[$$0199209 + 48 >> 2] = $113 + $75 >> 11; + $$sink = $75 - $113 >> 11; + $$sink212 = 16; + } + HEAP32[$$0199209 + ($$sink212 << 2) >> 2] = $$sink; + if ($$0210 >>> 0 > 1) { + $$0199209 = $$0199209 + 4 | 0; + $$0201208 = $$0201208 + 4 | 0; + $$0203207 = $$0203207 + 2 | 0; + $$0210 = $$0210 + -1 | 0; + } else break; + } + $149 = $7 + -384 | 0; + $151 = (HEAP32[$3 >> 2] | 0) + $4 | 0; + $153 = (HEAP32[$5 >> 2] | 0) + 16400 | 0; + $155 = HEAP32[$5 + 8 >> 2] | 0; + $157 = $153 + $155 << 13; + $159 = $153 - $155 << 13; + $161 = HEAP32[$5 + 4 >> 2] | 0; + $163 = HEAP32[$5 + 12 >> 2] | 0; + $165 = ($163 + $161 | 0) * 4433 | 0; + $167 = $165 + ($161 * 6270 | 0) | 0; + $169 = $165 + (Math_imul($163, -15137) | 0) | 0; + HEAP8[$151 >> 0] = HEAP8[$149 + (($167 + $157 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$151 + 3 >> 0] = HEAP8[$149 + (($157 - $167 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$151 + 1 >> 0] = HEAP8[$149 + (($169 + $159 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$151 + 2 >> 0] = HEAP8[$149 + (($159 - $169 | 0) >>> 18 & 1023) >> 0] | 0; + $196 = (HEAP32[$3 + 4 >> 2] | 0) + $4 | 0; + $198 = (HEAP32[$5 + 16 >> 2] | 0) + 16400 | 0; + $200 = HEAP32[$5 + 24 >> 2] | 0; + $202 = $198 + $200 << 13; + $204 = $198 - $200 << 13; + $206 = HEAP32[$5 + 20 >> 2] | 0; + $208 = HEAP32[$5 + 28 >> 2] | 0; + $210 = ($208 + $206 | 0) * 4433 | 0; + $212 = $210 + ($206 * 6270 | 0) | 0; + $214 = $210 + (Math_imul($208, -15137) | 0) | 0; + HEAP8[$196 >> 0] = HEAP8[$149 + (($212 + $202 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$196 + 3 >> 0] = HEAP8[$149 + (($202 - $212 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$196 + 1 >> 0] = HEAP8[$149 + (($214 + $204 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$196 + 2 >> 0] = HEAP8[$149 + (($204 - $214 | 0) >>> 18 & 1023) >> 0] | 0; + $241 = (HEAP32[$3 + 8 >> 2] | 0) + $4 | 0; + $243 = (HEAP32[$5 + 32 >> 2] | 0) + 16400 | 0; + $245 = HEAP32[$5 + 40 >> 2] | 0; + $247 = $243 + $245 << 13; + $249 = $243 - $245 << 13; + $251 = HEAP32[$5 + 36 >> 2] | 0; + $253 = HEAP32[$5 + 44 >> 2] | 0; + $255 = ($253 + $251 | 0) * 4433 | 0; + $257 = $255 + ($251 * 6270 | 0) | 0; + $259 = $255 + (Math_imul($253, -15137) | 0) | 0; + HEAP8[$241 >> 0] = HEAP8[$149 + (($257 + $247 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$241 + 3 >> 0] = HEAP8[$149 + (($247 - $257 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$241 + 1 >> 0] = HEAP8[$149 + (($259 + $249 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$241 + 2 >> 0] = HEAP8[$149 + (($249 - $259 | 0) >>> 18 & 1023) >> 0] | 0; + $286 = (HEAP32[$3 + 12 >> 2] | 0) + $4 | 0; + $288 = (HEAP32[$5 + 48 >> 2] | 0) + 16400 | 0; + $290 = HEAP32[$5 + 56 >> 2] | 0; + $292 = $288 + $290 << 13; + $294 = $288 - $290 << 13; + $296 = HEAP32[$5 + 52 >> 2] | 0; + $298 = HEAP32[$5 + 60 >> 2] | 0; + $300 = ($298 + $296 | 0) * 4433 | 0; + $302 = $300 + ($296 * 6270 | 0) | 0; + $304 = $300 + (Math_imul($298, -15137) | 0) | 0; + HEAP8[$286 >> 0] = HEAP8[$149 + (($302 + $292 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$286 + 3 >> 0] = HEAP8[$149 + (($292 - $302 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$286 + 1 >> 0] = HEAP8[$149 + (($304 + $294 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$286 + 2 >> 0] = HEAP8[$149 + (($294 - $304 | 0) >>> 18 & 1023) >> 0] | 0; + $331 = (HEAP32[$3 + 16 >> 2] | 0) + $4 | 0; + $333 = (HEAP32[$5 + 64 >> 2] | 0) + 16400 | 0; + $335 = HEAP32[$5 + 72 >> 2] | 0; + $337 = $333 + $335 << 13; + $339 = $333 - $335 << 13; + $341 = HEAP32[$5 + 68 >> 2] | 0; + $343 = HEAP32[$5 + 76 >> 2] | 0; + $345 = ($343 + $341 | 0) * 4433 | 0; + $347 = $345 + ($341 * 6270 | 0) | 0; + $349 = $345 + (Math_imul($343, -15137) | 0) | 0; + HEAP8[$331 >> 0] = HEAP8[$149 + (($347 + $337 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$331 + 3 >> 0] = HEAP8[$149 + (($337 - $347 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$331 + 1 >> 0] = HEAP8[$149 + (($349 + $339 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$331 + 2 >> 0] = HEAP8[$149 + (($339 - $349 | 0) >>> 18 & 1023) >> 0] | 0; + $376 = (HEAP32[$3 + 20 >> 2] | 0) + $4 | 0; + $378 = (HEAP32[$5 + 80 >> 2] | 0) + 16400 | 0; + $380 = HEAP32[$5 + 88 >> 2] | 0; + $382 = $378 + $380 << 13; + $384 = $378 - $380 << 13; + $386 = HEAP32[$5 + 84 >> 2] | 0; + $388 = HEAP32[$5 + 92 >> 2] | 0; + $390 = ($388 + $386 | 0) * 4433 | 0; + $392 = $390 + ($386 * 6270 | 0) | 0; + $394 = $390 + (Math_imul($388, -15137) | 0) | 0; + HEAP8[$376 >> 0] = HEAP8[$149 + (($392 + $382 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$376 + 3 >> 0] = HEAP8[$149 + (($382 - $392 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$376 + 1 >> 0] = HEAP8[$149 + (($394 + $384 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$376 + 2 >> 0] = HEAP8[$149 + (($384 - $394 | 0) >>> 18 & 1023) >> 0] | 0; + $421 = (HEAP32[$3 + 24 >> 2] | 0) + $4 | 0; + $423 = (HEAP32[$5 + 96 >> 2] | 0) + 16400 | 0; + $425 = HEAP32[$5 + 104 >> 2] | 0; + $427 = $423 + $425 << 13; + $429 = $423 - $425 << 13; + $431 = HEAP32[$5 + 100 >> 2] | 0; + $433 = HEAP32[$5 + 108 >> 2] | 0; + $435 = ($433 + $431 | 0) * 4433 | 0; + $437 = $435 + ($431 * 6270 | 0) | 0; + $439 = $435 + (Math_imul($433, -15137) | 0) | 0; + HEAP8[$421 >> 0] = HEAP8[$149 + (($437 + $427 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$421 + 3 >> 0] = HEAP8[$149 + (($427 - $437 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$421 + 1 >> 0] = HEAP8[$149 + (($439 + $429 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$421 + 2 >> 0] = HEAP8[$149 + (($429 - $439 | 0) >>> 18 & 1023) >> 0] | 0; + $466 = (HEAP32[$3 + 28 >> 2] | 0) + $4 | 0; + $468 = (HEAP32[$5 + 112 >> 2] | 0) + 16400 | 0; + $470 = HEAP32[$5 + 120 >> 2] | 0; + $472 = $468 + $470 << 13; + $474 = $468 - $470 << 13; + $476 = HEAP32[$5 + 116 >> 2] | 0; + $478 = HEAP32[$5 + 124 >> 2] | 0; + $480 = ($478 + $476 | 0) * 4433 | 0; + $482 = $480 + ($476 * 6270 | 0) | 0; + $484 = $480 + (Math_imul($478, -15137) | 0) | 0; + HEAP8[$466 >> 0] = HEAP8[$149 + (($482 + $472 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$466 + 3 >> 0] = HEAP8[$149 + (($472 - $482 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$466 + 1 >> 0] = HEAP8[$149 + (($484 + $474 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$466 + 2 >> 0] = HEAP8[$149 + (($474 - $484 | 0) >>> 18 & 1023) >> 0] | 0; + STACKTOP = sp; + return; +} + +function __ZNSt3__211__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + var $$0$i$i$i = 0, $$0$i$i$i43 = 0, $$0$i$i$i51 = 0, $$0$i$i$i59 = 0, $$0$i$i$i67 = 0, $$0$i$i$i75 = 0, $$0$i$i$i83 = 0, $$0$i$i$i91 = 0, $10 = 0, $100 = 0, $104 = 0, $11 = 0, $112 = 0, $115 = 0, $119 = 0, $12 = 0, $127 = 0, $131 = 0, $135 = 0, $138 = 0, $142 = 0, $150 = 0, $153 = 0, $157 = 0, $16 = 0, $20 = 0, $23 = 0, $27 = 0, $35 = 0, $38 = 0, $42 = 0, $50 = 0, $54 = 0, $58 = 0, $61 = 0, $65 = 0, $73 = 0, $76 = 0, $80 = 0, $89 = 0, $93 = 0, $97 = 0, $storemerge = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $10 = sp + 12 | 0; + $11 = sp; + if ($0) { + $12 = __ZNKSt3__26locale9use_facetERNS0_2idE($1, 66744) | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 44 >> 2] & 255]($10, $12); + $16 = HEAP32[$10 >> 2] | 0; + HEAP8[$2 >> 0] = $16; + HEAP8[$2 + 1 >> 0] = $16 >> 8; + HEAP8[$2 + 2 >> 0] = $16 >> 16; + HEAP8[$2 + 3 >> 0] = $16 >> 24; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 32 >> 2] & 255]($11, $12); + $20 = $8 + 11 | 0; + if ((HEAP8[$20 >> 0] | 0) < 0) { + $23 = HEAP32[$8 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($23, $10); + HEAP32[$8 + 4 >> 2] = 0; + if ((HEAP8[$20 >> 0] | 0) < 0) { + $27 = $8 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$8 >> 2] | 0, HEAP32[$27 >> 2] & 2147483647); + HEAP32[$27 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($8, $10); + HEAP8[$20 >> 0] = 0; + }; + HEAP32[$8 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$8 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$8 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i = 0; + while (1) { + if (($$0$i$i$i | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i << 2) >> 2] = 0; + $$0$i$i$i = $$0$i$i$i + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 28 >> 2] & 255]($11, $12); + $35 = $7 + 11 | 0; + if ((HEAP8[$35 >> 0] | 0) < 0) { + $38 = HEAP32[$7 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($38, $10); + HEAP32[$7 + 4 >> 2] = 0; + if ((HEAP8[$35 >> 0] | 0) < 0) { + $42 = $7 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$7 >> 2] | 0, HEAP32[$42 >> 2] & 2147483647); + HEAP32[$42 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($7, $10); + HEAP8[$35 >> 0] = 0; + }; + HEAP32[$7 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$7 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$7 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i43 = 0; + while (1) { + if (($$0$i$i$i43 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i43 << 2) >> 2] = 0; + $$0$i$i$i43 = $$0$i$i$i43 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + $50 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$12 >> 2] | 0) + 12 >> 2] & 127]($12) | 0; + HEAP8[$3 >> 0] = $50; + $54 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$12 >> 2] | 0) + 16 >> 2] & 127]($12) | 0; + HEAP8[$4 >> 0] = $54; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 20 >> 2] & 255]($11, $12); + $58 = $5 + 11 | 0; + if ((HEAP8[$58 >> 0] | 0) < 0) { + $61 = HEAP32[$5 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($61, $10); + HEAP32[$5 + 4 >> 2] = 0; + if ((HEAP8[$58 >> 0] | 0) < 0) { + $65 = $5 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$5 >> 2] | 0, HEAP32[$65 >> 2] & 2147483647); + HEAP32[$65 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($5, $10); + HEAP8[$58 >> 0] = 0; + }; + HEAP32[$5 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$5 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$5 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i51 = 0; + while (1) { + if (($$0$i$i$i51 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i51 << 2) >> 2] = 0; + $$0$i$i$i51 = $$0$i$i$i51 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 24 >> 2] & 255]($11, $12); + $73 = $6 + 11 | 0; + if ((HEAP8[$73 >> 0] | 0) < 0) { + $76 = HEAP32[$6 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($76, $10); + HEAP32[$6 + 4 >> 2] = 0; + if ((HEAP8[$73 >> 0] | 0) < 0) { + $80 = $6 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$6 >> 2] | 0, HEAP32[$80 >> 2] & 2147483647); + HEAP32[$80 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($6, $10); + HEAP8[$73 >> 0] = 0; + }; + HEAP32[$6 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$6 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$6 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i59 = 0; + while (1) { + if (($$0$i$i$i59 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i59 << 2) >> 2] = 0; + $$0$i$i$i59 = $$0$i$i$i59 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + $storemerge = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$12 >> 2] | 0) + 36 >> 2] & 127]($12) | 0; + } else { + $89 = __ZNKSt3__26locale9use_facetERNS0_2idE($1, 66736) | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$89 >> 2] | 0) + 44 >> 2] & 255]($10, $89); + $93 = HEAP32[$10 >> 2] | 0; + HEAP8[$2 >> 0] = $93; + HEAP8[$2 + 1 >> 0] = $93 >> 8; + HEAP8[$2 + 2 >> 0] = $93 >> 16; + HEAP8[$2 + 3 >> 0] = $93 >> 24; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$89 >> 2] | 0) + 32 >> 2] & 255]($11, $89); + $97 = $8 + 11 | 0; + if ((HEAP8[$97 >> 0] | 0) < 0) { + $100 = HEAP32[$8 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($100, $10); + HEAP32[$8 + 4 >> 2] = 0; + if ((HEAP8[$97 >> 0] | 0) < 0) { + $104 = $8 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$8 >> 2] | 0, HEAP32[$104 >> 2] & 2147483647); + HEAP32[$104 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($8, $10); + HEAP8[$97 >> 0] = 0; + }; + HEAP32[$8 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$8 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$8 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i67 = 0; + while (1) { + if (($$0$i$i$i67 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i67 << 2) >> 2] = 0; + $$0$i$i$i67 = $$0$i$i$i67 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$89 >> 2] | 0) + 28 >> 2] & 255]($11, $89); + $112 = $7 + 11 | 0; + if ((HEAP8[$112 >> 0] | 0) < 0) { + $115 = HEAP32[$7 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($115, $10); + HEAP32[$7 + 4 >> 2] = 0; + if ((HEAP8[$112 >> 0] | 0) < 0) { + $119 = $7 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$7 >> 2] | 0, HEAP32[$119 >> 2] & 2147483647); + HEAP32[$119 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($7, $10); + HEAP8[$112 >> 0] = 0; + }; + HEAP32[$7 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$7 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$7 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i75 = 0; + while (1) { + if (($$0$i$i$i75 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i75 << 2) >> 2] = 0; + $$0$i$i$i75 = $$0$i$i$i75 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + $127 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$89 >> 2] | 0) + 12 >> 2] & 127]($89) | 0; + HEAP8[$3 >> 0] = $127; + $131 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$89 >> 2] | 0) + 16 >> 2] & 127]($89) | 0; + HEAP8[$4 >> 0] = $131; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$89 >> 2] | 0) + 20 >> 2] & 255]($11, $89); + $135 = $5 + 11 | 0; + if ((HEAP8[$135 >> 0] | 0) < 0) { + $138 = HEAP32[$5 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($138, $10); + HEAP32[$5 + 4 >> 2] = 0; + if ((HEAP8[$135 >> 0] | 0) < 0) { + $142 = $5 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$5 >> 2] | 0, HEAP32[$142 >> 2] & 2147483647); + HEAP32[$142 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($5, $10); + HEAP8[$135 >> 0] = 0; + }; + HEAP32[$5 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$5 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$5 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i83 = 0; + while (1) { + if (($$0$i$i$i83 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i83 << 2) >> 2] = 0; + $$0$i$i$i83 = $$0$i$i$i83 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$89 >> 2] | 0) + 24 >> 2] & 255]($11, $89); + $150 = $6 + 11 | 0; + if ((HEAP8[$150 >> 0] | 0) < 0) { + $153 = HEAP32[$6 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($153, $10); + HEAP32[$6 + 4 >> 2] = 0; + if ((HEAP8[$150 >> 0] | 0) < 0) { + $157 = $6 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$6 >> 2] | 0, HEAP32[$157 >> 2] & 2147483647); + HEAP32[$157 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($6, $10); + HEAP8[$150 >> 0] = 0; + }; + HEAP32[$6 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$6 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$6 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i91 = 0; + while (1) { + if (($$0$i$i$i91 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i91 << 2) >> 2] = 0; + $$0$i$i$i91 = $$0$i$i$i91 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + $storemerge = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$89 >> 2] | 0) + 36 >> 2] & 127]($89) | 0; + } + HEAP32[$9 >> 2] = $storemerge; + STACKTOP = sp; + return; +} + +function __ZNSt3__211__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + var $$0$i$i$i = 0, $$0$i$i$i43 = 0, $$0$i$i$i47 = 0, $$0$i$i$i54 = 0, $$0$i$i$i62 = 0, $$0$i$i$i70 = 0, $$0$i$i$i78 = 0, $$0$i$i$i86 = 0, $10 = 0, $101 = 0, $11 = 0, $112 = 0, $113 = 0, $116 = 0, $12 = 0, $127 = 0, $131 = 0, $135 = 0, $138 = 0, $142 = 0, $150 = 0, $151 = 0, $154 = 0, $16 = 0, $20 = 0, $21 = 0, $24 = 0, $35 = 0, $36 = 0, $39 = 0, $50 = 0, $54 = 0, $58 = 0, $61 = 0, $65 = 0, $73 = 0, $74 = 0, $77 = 0, $89 = 0, $93 = 0, $97 = 0, $98 = 0, $storemerge = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $10 = sp + 12 | 0; + $11 = sp; + if ($0) { + $12 = __ZNKSt3__26locale9use_facetERNS0_2idE($1, 66760) | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 44 >> 2] & 255]($10, $12); + $16 = HEAP32[$10 >> 2] | 0; + HEAP8[$2 >> 0] = $16; + HEAP8[$2 + 1 >> 0] = $16 >> 8; + HEAP8[$2 + 2 >> 0] = $16 >> 16; + HEAP8[$2 + 3 >> 0] = $16 >> 24; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 32 >> 2] & 255]($11, $12); + $20 = $8 + 8 | 0; + $21 = $20 + 3 | 0; + if ((HEAP8[$21 >> 0] | 0) < 0) { + $24 = HEAP32[$8 >> 2] | 0; + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($24, $10); + HEAP32[$8 + 4 >> 2] = 0; + if ((HEAP8[$21 >> 0] | 0) < 0) { + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$8 >> 2] | 0, HEAP32[$20 >> 2] << 2); + HEAP32[$20 >> 2] = 0; + } + } else { + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($8, $10); + HEAP8[$21 >> 0] = 0; + }; + HEAP32[$8 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$8 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$8 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i = 0; + while (1) { + if (($$0$i$i$i | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i << 2) >> 2] = 0; + $$0$i$i$i = $$0$i$i$i + 1 | 0; + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($11); + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 28 >> 2] & 255]($11, $12); + $35 = $7 + 8 | 0; + $36 = $35 + 3 | 0; + if ((HEAP8[$36 >> 0] | 0) < 0) { + $39 = HEAP32[$7 >> 2] | 0; + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($39, $10); + HEAP32[$7 + 4 >> 2] = 0; + if ((HEAP8[$36 >> 0] | 0) < 0) { + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$7 >> 2] | 0, HEAP32[$35 >> 2] << 2); + HEAP32[$35 >> 2] = 0; + } + } else { + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($7, $10); + HEAP8[$36 >> 0] = 0; + }; + HEAP32[$7 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$7 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$7 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i43 = 0; + while (1) { + if (($$0$i$i$i43 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i43 << 2) >> 2] = 0; + $$0$i$i$i43 = $$0$i$i$i43 + 1 | 0; + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($11); + $50 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$12 >> 2] | 0) + 12 >> 2] & 127]($12) | 0; + HEAP32[$3 >> 2] = $50; + $54 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$12 >> 2] | 0) + 16 >> 2] & 127]($12) | 0; + HEAP32[$4 >> 2] = $54; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 20 >> 2] & 255]($11, $12); + $58 = $5 + 11 | 0; + if ((HEAP8[$58 >> 0] | 0) < 0) { + $61 = HEAP32[$5 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($61, $10); + HEAP32[$5 + 4 >> 2] = 0; + if ((HEAP8[$58 >> 0] | 0) < 0) { + $65 = $5 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$5 >> 2] | 0, HEAP32[$65 >> 2] & 2147483647); + HEAP32[$65 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($5, $10); + HEAP8[$58 >> 0] = 0; + }; + HEAP32[$5 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$5 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$5 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i47 = 0; + while (1) { + if (($$0$i$i$i47 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i47 << 2) >> 2] = 0; + $$0$i$i$i47 = $$0$i$i$i47 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 24 >> 2] & 255]($11, $12); + $73 = $6 + 8 | 0; + $74 = $73 + 3 | 0; + if ((HEAP8[$74 >> 0] | 0) < 0) { + $77 = HEAP32[$6 >> 2] | 0; + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($77, $10); + HEAP32[$6 + 4 >> 2] = 0; + if ((HEAP8[$74 >> 0] | 0) < 0) { + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$6 >> 2] | 0, HEAP32[$73 >> 2] << 2); + HEAP32[$73 >> 2] = 0; + } + } else { + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($6, $10); + HEAP8[$74 >> 0] = 0; + }; + HEAP32[$6 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$6 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$6 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i54 = 0; + while (1) { + if (($$0$i$i$i54 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i54 << 2) >> 2] = 0; + $$0$i$i$i54 = $$0$i$i$i54 + 1 | 0; + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($11); + $storemerge = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$12 >> 2] | 0) + 36 >> 2] & 127]($12) | 0; + } else { + $89 = __ZNKSt3__26locale9use_facetERNS0_2idE($1, 66752) | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$89 >> 2] | 0) + 44 >> 2] & 255]($10, $89); + $93 = HEAP32[$10 >> 2] | 0; + HEAP8[$2 >> 0] = $93; + HEAP8[$2 + 1 >> 0] = $93 >> 8; + HEAP8[$2 + 2 >> 0] = $93 >> 16; + HEAP8[$2 + 3 >> 0] = $93 >> 24; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$89 >> 2] | 0) + 32 >> 2] & 255]($11, $89); + $97 = $8 + 8 | 0; + $98 = $97 + 3 | 0; + if ((HEAP8[$98 >> 0] | 0) < 0) { + $101 = HEAP32[$8 >> 2] | 0; + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($101, $10); + HEAP32[$8 + 4 >> 2] = 0; + if ((HEAP8[$98 >> 0] | 0) < 0) { + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$8 >> 2] | 0, HEAP32[$97 >> 2] << 2); + HEAP32[$97 >> 2] = 0; + } + } else { + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($8, $10); + HEAP8[$98 >> 0] = 0; + }; + HEAP32[$8 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$8 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$8 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i62 = 0; + while (1) { + if (($$0$i$i$i62 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i62 << 2) >> 2] = 0; + $$0$i$i$i62 = $$0$i$i$i62 + 1 | 0; + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($11); + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$89 >> 2] | 0) + 28 >> 2] & 255]($11, $89); + $112 = $7 + 8 | 0; + $113 = $112 + 3 | 0; + if ((HEAP8[$113 >> 0] | 0) < 0) { + $116 = HEAP32[$7 >> 2] | 0; + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($116, $10); + HEAP32[$7 + 4 >> 2] = 0; + if ((HEAP8[$113 >> 0] | 0) < 0) { + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$7 >> 2] | 0, HEAP32[$112 >> 2] << 2); + HEAP32[$112 >> 2] = 0; + } + } else { + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($7, $10); + HEAP8[$113 >> 0] = 0; + }; + HEAP32[$7 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$7 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$7 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i70 = 0; + while (1) { + if (($$0$i$i$i70 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i70 << 2) >> 2] = 0; + $$0$i$i$i70 = $$0$i$i$i70 + 1 | 0; + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($11); + $127 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$89 >> 2] | 0) + 12 >> 2] & 127]($89) | 0; + HEAP32[$3 >> 2] = $127; + $131 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$89 >> 2] | 0) + 16 >> 2] & 127]($89) | 0; + HEAP32[$4 >> 2] = $131; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$89 >> 2] | 0) + 20 >> 2] & 255]($11, $89); + $135 = $5 + 11 | 0; + if ((HEAP8[$135 >> 0] | 0) < 0) { + $138 = HEAP32[$5 >> 2] | 0; + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($138, $10); + HEAP32[$5 + 4 >> 2] = 0; + if ((HEAP8[$135 >> 0] | 0) < 0) { + $142 = $5 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$5 >> 2] | 0, HEAP32[$142 >> 2] & 2147483647); + HEAP32[$142 >> 2] = 0; + } + } else { + HEAP8[$10 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($5, $10); + HEAP8[$135 >> 0] = 0; + }; + HEAP32[$5 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$5 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$5 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i78 = 0; + while (1) { + if (($$0$i$i$i78 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i78 << 2) >> 2] = 0; + $$0$i$i$i78 = $$0$i$i$i78 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$89 >> 2] | 0) + 24 >> 2] & 255]($11, $89); + $150 = $6 + 8 | 0; + $151 = $150 + 3 | 0; + if ((HEAP8[$151 >> 0] | 0) < 0) { + $154 = HEAP32[$6 >> 2] | 0; + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($154, $10); + HEAP32[$6 + 4 >> 2] = 0; + if ((HEAP8[$151 >> 0] | 0) < 0) { + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$6 >> 2] | 0, HEAP32[$150 >> 2] << 2); + HEAP32[$150 >> 2] = 0; + } + } else { + HEAP32[$10 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($6, $10); + HEAP8[$151 >> 0] = 0; + }; + HEAP32[$6 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$6 + 4 >> 2] = HEAP32[$11 + 4 >> 2]; + HEAP32[$6 + 8 >> 2] = HEAP32[$11 + 8 >> 2]; + $$0$i$i$i86 = 0; + while (1) { + if (($$0$i$i$i86 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i$i86 << 2) >> 2] = 0; + $$0$i$i$i86 = $$0$i$i$i86 + 1 | 0; + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($11); + $storemerge = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$89 >> 2] | 0) + 36 >> 2] & 127]($89) | 0; + } + HEAP32[$9 >> 2] = $storemerge; + STACKTOP = sp; + return; +} + +function _ar2GetTransMatHomographyRobust_178($initConv, $pos2d, $pos3d, $num, $conv, $inlierProb) { + $initConv = $initConv | 0; + $pos2d = $pos2d | 0; + $pos3d = $pos3d | 0; + $num = $num | 0; + $conv = $conv | 0; + $inlierProb = +$inlierProb; + var $21 = 0.0, $22 = 0.0, $5 = 0.0, $7 = 0.0, $K2$0 = 0.0, $add49 = 0.0, $add63 = 0.0, $add75 = 0.0, $add95 = 0.0, $arrayidx181 = 0, $arrayidx2 = 0, $arrayidx368 = 0, $arrayidx372 = 0, $arrayidx376 = 0, $arrayidx380 = 0, $arrayidx384 = 0, $arrayidx388 = 0, $arrayidx392 = 0, $arrayidx43 = 0, $arrayidx48 = 0, $arrayidx51 = 0, $arrayidx56 = 0, $arrayidx62 = 0, $arrayidx65 = 0, $arrayidx70 = 0, $call = 0, $call13 = 0, $call17 = 0, $call21 = 0, $conv5 = 0.0, $dH = 0, $div100 = 0.0, $div106 = 0.0, $div110 = 0.0, $div190 = 0.0, $div190$pn = 0.0, $div209 = 0.0, $err0$0 = 0.0, $err1$0 = 0.0, $i$0 = 0, $i$1 = 0, $j$0 = 0, $j$1 = 0, $j$2 = 0, $j$3 = 0, $k$0 = 0, $k$1 = 0, $mul101 = 0, $mul16 = 0, $mul182 = 0.0, $mul232 = 0.0, $mul233 = 0, $mul237 = 0, $mul345 = 0, $mul78 = 0.0, $mul87 = 0, $retval$0 = 0.0, $spec$store$select = 0, $sub = 0, $sub195 = 0.0, $sub228 = 0.0, $sub83 = 0.0, $sub86 = 0.0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer3 = 0, $vararg_buffer5 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $vararg_buffer5 = sp + 56 | 0; + $vararg_buffer3 = sp + 48 | 0; + $vararg_buffer1 = sp + 40 | 0; + $vararg_buffer = sp + 32 | 0; + $dH = sp; + do if (($num | 0) >= 4 ? ($arrayidx2 = $initConv + 44 | 0, !(+HEAPF32[$arrayidx2 >> 2] == 0.0)) : 0) { + $conv5 = +($num | 0); + $sub = ~~($conv5 * $inlierProb) + -1 | 0; + $spec$store$select = ($sub | 0) > 4 ? $sub : 4; + $call = _malloc($num << 6) | 0; + if (!$call) { + _arLog(0, 3, 45947, $vararg_buffer); + $retval$0 = -1.0; + break; + } + $call13 = _malloc($num << 3) | 0; + if (!$call13) { + _arLog(0, 3, 45947, $vararg_buffer1); + _free($call); + $retval$0 = -1.0; + break; + } + $mul16 = $num << 2; + $call17 = _malloc($mul16) | 0; + if (!$call17) { + _arLog(0, 3, 45947, $vararg_buffer3); + _free($call); + _free($call13); + $retval$0 = -1.0; + break; + } + $call21 = _malloc($mul16) | 0; + if (!$call21) { + _arLog(0, 3, 45947, $vararg_buffer5); + _free($call); + _free($call13); + _free($call17); + $retval$0 = -1.0; + break; + } + $j$0 = 0; + while (1) { + if (($j$0 | 0) == 3) break; + $i$0 = 0; + while (1) { + if (($i$0 | 0) == 4) break; + HEAPF32[$conv + ($j$0 << 4) + ($i$0 << 2) >> 2] = +HEAPF32[$initConv + ($j$0 << 4) + ($i$0 << 2) >> 2] / +HEAPF32[$arrayidx2 >> 2]; + $i$0 = $i$0 + 1 | 0; + } + $j$0 = $j$0 + 1 | 0; + } + $arrayidx43 = $conv + 4 | 0; + $arrayidx48 = $conv + 12 | 0; + $arrayidx51 = $conv + 16 | 0; + $arrayidx56 = $conv + 20 | 0; + $arrayidx62 = $conv + 28 | 0; + $arrayidx65 = $conv + 32 | 0; + $arrayidx70 = $conv + 36 | 0; + $arrayidx181 = $call21 + ($spec$store$select << 2) | 0; + $arrayidx368 = $dH + 4 | 0; + $arrayidx372 = $dH + 8 | 0; + $arrayidx376 = $dH + 12 | 0; + $arrayidx380 = $dH + 16 | 0; + $arrayidx384 = $dH + 20 | 0; + $arrayidx388 = $dH + 24 | 0; + $arrayidx392 = $dH + 28 | 0; + $err0$0 = 0.0; + $i$1 = 0; + L24 : while (1) { + $j$1 = 0; + while (1) { + if (($j$1 | 0) >= ($num | 0)) break; + $5 = +HEAPF32[$pos3d + ($j$1 * 12 | 0) >> 2]; + $7 = +HEAPF32[$pos3d + ($j$1 * 12 | 0) + 4 >> 2]; + $add49 = +HEAPF32[$arrayidx48 >> 2] + (+HEAPF32[$conv >> 2] * $5 + +HEAPF32[$arrayidx43 >> 2] * $7); + $add63 = +HEAPF32[$arrayidx62 >> 2] + ($5 * +HEAPF32[$arrayidx51 >> 2] + $7 * +HEAPF32[$arrayidx56 >> 2]); + $add75 = $5 * +HEAPF32[$arrayidx65 >> 2] + $7 * +HEAPF32[$arrayidx70 >> 2] + 1.0; + if ($add75 == 0.0) { + label = 21; + break L24; + } + $mul78 = $add75 * $add75; + $sub83 = +HEAPF32[$pos2d + ($j$1 << 3) >> 2] - $add49 / $add75; + $sub86 = +HEAPF32[$pos2d + ($j$1 << 3) + 4 >> 2] - $add63 / $add75; + $mul87 = $j$1 << 1; + HEAPF32[$call13 + ($mul87 << 2) >> 2] = $sub83; + HEAPF32[$call13 + (($mul87 | 1) << 2) >> 2] = $sub86; + $add95 = $sub83 * $sub83 + $sub86 * $sub86; + HEAPF32[$call21 + ($j$1 << 2) >> 2] = $add95; + HEAPF32[$call17 + ($j$1 << 2) >> 2] = $add95; + $div100 = $5 / $add75; + $mul101 = $j$1 << 4; + HEAPF32[$call + ($mul101 << 2) >> 2] = $div100; + $div106 = $7 / $add75; + HEAPF32[$call + (($mul101 | 1) << 2) >> 2] = $div106; + $div110 = 1.0 / $add75; + HEAPF32[$call + (($mul101 | 2) << 2) >> 2] = $div110; + HEAPF32[$call + (($mul101 | 3) << 2) >> 2] = 0.0; + HEAPF32[$call + (($mul101 | 4) << 2) >> 2] = 0.0; + HEAPF32[$call + (($mul101 | 5) << 2) >> 2] = 0.0; + HEAPF32[$call + (($mul101 | 6) << 2) >> 2] = -($5 * $add49) / $mul78; + HEAPF32[$call + (($mul101 | 7) << 2) >> 2] = -($7 * $add49) / $mul78; + HEAPF32[$call + (($mul101 | 8) << 2) >> 2] = 0.0; + HEAPF32[$call + (($mul101 | 9) << 2) >> 2] = 0.0; + HEAPF32[$call + (($mul101 | 10) << 2) >> 2] = 0.0; + HEAPF32[$call + (($mul101 | 11) << 2) >> 2] = $div100; + HEAPF32[$call + (($mul101 | 12) << 2) >> 2] = $div106; + HEAPF32[$call + (($mul101 | 13) << 2) >> 2] = $div110; + HEAPF32[$call + (($mul101 | 14) << 2) >> 2] = -($5 * $add63) / $mul78; + HEAPF32[$call + (($mul101 | 15) << 2) >> 2] = -($7 * $add63) / $mul78; + $j$1 = $j$1 + 1 | 0; + } + _qsort($call21, $num, 4, 56); + $mul182 = +HEAPF32[$arrayidx181 >> 2] * 4.0; + $K2$0 = $mul182 < 16.0 ? 16.0 : $mul182; + $div190 = $K2$0 / 6.0; + $err1$0 = 0.0; + $j$2 = 0; + while (1) { + if (($j$2 | 0) == ($num | 0)) break; + $21 = +HEAPF32[$call21 + ($j$2 << 2) >> 2]; + if ($21 > $K2$0) $div190$pn = $div190; else { + $sub195 = 1.0 - $21 / $K2$0; + $div190$pn = $div190 * (1.0 - $sub195 * ($sub195 * $sub195)); + } + $err1$0 = $err1$0 + $div190$pn; + $j$2 = $j$2 + 1 | 0; + } + $div209 = $err1$0 / $conv5; + if ($div209 < .10000000149011612) { + label = 42; + break; + } + if (($i$1 | 0) != 0 & $div209 < 4.0) { + if (($i$1 | 0) == 10 | $div209 / $err0$0 > .9900000095367432) { + label = 42; + break; + } + } else if (($i$1 | 0) == 10) { + label = 42; + break; + } + $j$3 = 0; + $k$0 = 0; + while (1) { + if (($j$3 | 0) == ($num | 0)) break; + $22 = +HEAPF32[$call17 + ($j$3 << 2) >> 2]; + if (!($22 <= $K2$0)) $k$1 = $k$0; else { + $sub228 = 1.0 - $22 / $K2$0; + $mul232 = $sub228 * $sub228; + $mul233 = $j$3 << 4; + $mul237 = $k$0 << 3; + HEAPF32[$call + ($mul237 << 2) >> 2] = $mul232 * +HEAPF32[$call + ($mul233 << 2) >> 2]; + HEAPF32[$call + (($mul237 | 1) << 2) >> 2] = $mul232 * +HEAPF32[$call + (($mul233 | 1) << 2) >> 2]; + HEAPF32[$call + (($mul237 | 2) << 2) >> 2] = $mul232 * +HEAPF32[$call + (($mul233 | 2) << 2) >> 2]; + HEAPF32[$call + (($mul237 | 3) << 2) >> 2] = $mul232 * +HEAPF32[$call + (($mul233 | 3) << 2) >> 2]; + HEAPF32[$call + (($mul237 | 4) << 2) >> 2] = $mul232 * +HEAPF32[$call + (($mul233 | 4) << 2) >> 2]; + HEAPF32[$call + (($mul237 | 5) << 2) >> 2] = $mul232 * +HEAPF32[$call + (($mul233 | 5) << 2) >> 2]; + HEAPF32[$call + (($mul237 | 6) << 2) >> 2] = $mul232 * +HEAPF32[$call + (($mul233 | 6) << 2) >> 2]; + HEAPF32[$call + (($mul237 | 7) << 2) >> 2] = $mul232 * +HEAPF32[$call + (($mul233 | 7) << 2) >> 2]; + HEAPF32[$call + ($mul237 + 8 << 2) >> 2] = $mul232 * +HEAPF32[$call + (($mul233 | 8) << 2) >> 2]; + HEAPF32[$call + ($mul237 + 9 << 2) >> 2] = $mul232 * +HEAPF32[$call + (($mul233 | 9) << 2) >> 2]; + HEAPF32[$call + ($mul237 + 10 << 2) >> 2] = $mul232 * +HEAPF32[$call + (($mul233 | 10) << 2) >> 2]; + HEAPF32[$call + ($mul237 + 11 << 2) >> 2] = $mul232 * +HEAPF32[$call + (($mul233 | 11) << 2) >> 2]; + HEAPF32[$call + ($mul237 + 12 << 2) >> 2] = $mul232 * +HEAPF32[$call + (($mul233 | 12) << 2) >> 2]; + HEAPF32[$call + ($mul237 + 13 << 2) >> 2] = $mul232 * +HEAPF32[$call + (($mul233 | 13) << 2) >> 2]; + HEAPF32[$call + ($mul237 + 14 << 2) >> 2] = $mul232 * +HEAPF32[$call + (($mul233 | 14) << 2) >> 2]; + HEAPF32[$call + ($mul237 + 15 << 2) >> 2] = $mul232 * +HEAPF32[$call + (($mul233 | 15) << 2) >> 2]; + $mul345 = $j$3 << 1; + HEAPF32[$call13 + ($k$0 << 2) >> 2] = $mul232 * +HEAPF32[$call13 + ($mul345 << 2) >> 2]; + HEAPF32[$call13 + ($k$0 + 1 << 2) >> 2] = $mul232 * +HEAPF32[$call13 + (($mul345 | 1) << 2) >> 2]; + $k$1 = $k$0 + 2 | 0; + } + $j$3 = $j$3 + 1 | 0; + $k$0 = $k$1; + } + if (($k$0 | 0) < 6) { + label = 38; + break; + } + if ((_getDeltaS_181($dH, $call13, $call, $k$0) | 0) < 0) { + label = 40; + break; + } + HEAPF32[$conv >> 2] = +HEAPF32[$dH >> 2] + +HEAPF32[$conv >> 2]; + HEAPF32[$arrayidx43 >> 2] = +HEAPF32[$arrayidx368 >> 2] + +HEAPF32[$arrayidx43 >> 2]; + HEAPF32[$arrayidx48 >> 2] = +HEAPF32[$arrayidx372 >> 2] + +HEAPF32[$arrayidx48 >> 2]; + HEAPF32[$arrayidx51 >> 2] = +HEAPF32[$arrayidx376 >> 2] + +HEAPF32[$arrayidx51 >> 2]; + HEAPF32[$arrayidx56 >> 2] = +HEAPF32[$arrayidx380 >> 2] + +HEAPF32[$arrayidx56 >> 2]; + HEAPF32[$arrayidx62 >> 2] = +HEAPF32[$arrayidx384 >> 2] + +HEAPF32[$arrayidx62 >> 2]; + HEAPF32[$arrayidx65 >> 2] = +HEAPF32[$arrayidx388 >> 2] + +HEAPF32[$arrayidx65 >> 2]; + HEAPF32[$arrayidx70 >> 2] = +HEAPF32[$arrayidx392 >> 2] + +HEAPF32[$arrayidx70 >> 2]; + $err0$0 = $div209; + $i$1 = $i$1 + 1 | 0; + } + if ((label | 0) == 21) { + _free($call); + _free($call13); + _free($call17); + _free($call21); + $retval$0 = 1.0e8; + break; + } else if ((label | 0) == 38) { + _free($call); + _free($call13); + _free($call17); + _free($call21); + $retval$0 = -1.0; + break; + } else if ((label | 0) == 40) { + _free($call); + _free($call13); + _free($call17); + _free($call21); + $retval$0 = 1.0e8; + break; + } else if ((label | 0) == 42) { + _free($call); + _free($call13); + _free($call17); + _free($call21); + $retval$0 = $div209; + break; + } + } else $retval$0 = 1.0e8; while (0); + STACKTOP = sp; + return +$retval$0; +} + +function _decode_bch($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$ = 0, $$0 = 0, $$0235 = 0, $$0237 = 0, $$0238 = 0, $$0240 = 0, $$0242 = 0, $$0245 = 0, $$0251 = 0, $$0253 = 0, $$0259 = 0, $$0261 = 0, $$0268 = 0, $$10 = 0, $$11 = 0, $$12 = 0, $$1236 = 0, $$1239 = 0, $$1241 = 0, $$1243 = 0, $$1246 = 0, $$1252 = 0, $$1254 = 0, $$1256 = 0, $$1260 = 0, $$1262 = 0, $$1264 = 0, $$2 = 0, $$2244 = 0, $$2247 = 0, $$2257 = 0, $$2265 = 0, $$3 = 0, $$3248 = 0, $$3258 = 0, $$3266 = 0, $$4 = 0, $$4249 = 0, $$5 = 0, $$5250 = 0, $$6 = 0, $$7 = 0, $$8 = 0, $$9 = 0, $$pre$phiZ2D = 0, $$pre280 = 0, $$sink = 0, $10 = 0, $105 = 0, $106 = 0, $107 = 0, $11 = 0, $114 = 0, $118 = 0, $12 = 0, $122 = 0, $126 = 0, $129 = 0, $137 = 0, $138 = 0, $14 = 0, $145 = 0, $157 = 0, $158 = 0, $161 = 0, $17 = 0, $175 = 0, $179 = 0, $18 = 0, $188 = 0, $189 = 0, $190 = 0, $192 = 0, $193 = 0, $194 = 0, $195 = 0, $196 = 0, $200 = 0, $205 = 0, $206 = 0, $21 = 0, $23 = 0, $30 = 0, $32 = 0, $33 = 0, $39 = 0, $41 = 0, $5 = 0, $52 = 0, $53 = 0, $55 = 0, $57 = 0, $58 = 0, $6 = 0, $66 = 0, $7 = 0, $79 = 0, $8 = 0, $81 = 0, $82 = 0, $84 = 0, $89 = 0, $9 = 0, $90 = 0, $93 = 0, label = 0, sp = 0, $$1243$looptemp = 0, $$0240$looptemp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 2384 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(2384); + $5 = sp + 2320 | 0; + $6 = sp + 880 | 0; + $7 = sp + 800 | 0; + $8 = sp + 720 | 0; + $9 = sp + 640 | 0; + $10 = sp + 560 | 0; + $11 = sp + 48 | 0; + $12 = sp; + switch ($0 | 0) { + case 2830: + { + $$0268 = $3; + $$1252 = 1200; + $$1254 = 688; + $$1260 = 120; + $$1262 = 127; + $$3258 = 64; + $$3266 = 9; + label = 8; + break; + } + case 772: + { + $$0251 = 624; + $$0253 = 432; + $$0259 = 13; + $$0261 = 15; + $$2257 = 9; + $$2265 = 1; + label = 5; + break; + } + case 1028: + { + $$0251 = 624; + $$0253 = 432; + $$0259 = 13; + $$0261 = 15; + $$2257 = 5; + $$2265 = 2; + label = 5; + break; + } + case 1029: + { + $$1256 = 12; + $$1264 = 2; + label = 4; + break; + } + case 1285: + { + $$1256 = 7; + $$1264 = 3; + label = 4; + break; + } + default: + $$0237 = -1; + } + if ((label | 0) == 4) { + $$0251 = 496; + $$0253 = 304; + $$0259 = 22; + $$0261 = 31; + $$2257 = $$1256; + $$2265 = $$1264; + label = 5; + } + L6 : do if ((label | 0) == 5) { + $$0245 = 0; + $14 = $1; + $17 = $2; + while (1) { + if (($$0245 | 0) == ($$0259 | 0)) { + $$0268 = $5; + $$1252 = $$0251; + $$1254 = $$0253; + $$1260 = $$0259; + $$1262 = $$0261; + $$3258 = $$2257; + $$3266 = $$2265; + label = 8; + break L6; + } + HEAP8[$5 + $$0245 >> 0] = $14 & 1; + $18 = _bitshift64Lshr($14 | 0, $17 | 0, 1) | 0; + $$0245 = $$0245 + 1 | 0; + $14 = $18; + $17 = getTempRet0() | 0; + } + } while (0); + L11 : do if ((label | 0) == 8) { + $21 = $$3266 << 1; + $$0 = 0; + $$1246 = 1; + while (1) { + if (($$1246 | 0) > ($21 | 0)) break; + $23 = $10 + ($$1246 << 2) | 0; + HEAP32[$23 >> 2] = 0; + $$0242 = 0; + $33 = 0; + while (1) { + if (($$0242 | 0) >= ($$1260 | 0)) break; + if (!(HEAP8[$$0268 + $$0242 >> 0] | 0)) $205 = $33; else { + $30 = $$1254 + (((Math_imul($$0242, $$1246) | 0) % ($$1262 | 0) | 0) << 2) | 0; + $32 = $33 ^ HEAP32[$30 >> 2]; + HEAP32[$23 >> 2] = $32; + $205 = $32; + } + $$0242 = $$0242 + 1 | 0; + $33 = $205; + } + HEAP32[$23 >> 2] = HEAP32[$$1252 + ($33 << 2) >> 2]; + $$0 = ($33 | 0) == 0 ? $$0 : 1; + $$1246 = $$1246 + 1 | 0; + } + $39 = ($$0 | 0) != 0; + L24 : do if ($39) { + HEAP32[$7 >> 2] = 0; + $41 = HEAP32[$10 + 4 >> 2] | 0; + HEAP32[$7 + 4 >> 2] = $41; + HEAP32[$6 >> 2] = 0; + HEAP32[$6 + 72 >> 2] = 1; + $$2247 = 1; + while (1) { + if (($$2247 | 0) >= ($21 | 0)) break; + HEAP32[$6 + ($$2247 << 2) >> 2] = -1; + HEAP32[$6 + 72 + ($$2247 << 2) >> 2] = 0; + $$2247 = $$2247 + 1 | 0; + } + HEAP32[$8 >> 2] = 0; + HEAP32[$8 + 4 >> 2] = 0; + HEAP32[$9 >> 2] = -1; + HEAP32[$9 + 4 >> 2] = 0; + $$0240 = 0; + $52 = $41; + $55 = 0; + while (1) { + $$0240$looptemp = $$0240; + $$0240 = $$0240 + 1 | 0; + L32 : do if (($52 | 0) == -1) { + $53 = $$0240$looptemp + 2 | 0; + HEAP32[$8 + ($53 << 2) >> 2] = $55; + $$3248 = 0; + while (1) { + if (($$3248 | 0) > ($55 | 0)) { + $$pre$phiZ2D = $53; + $114 = $55; + break L32; + } + $57 = $6 + ($$0240 * 72 | 0) + ($$3248 << 2) | 0; + $58 = HEAP32[$57 >> 2] | 0; + HEAP32[$6 + ($53 * 72 | 0) + ($$3248 << 2) >> 2] = $58; + HEAP32[$57 >> 2] = HEAP32[$$1252 + ($58 << 2) >> 2]; + $$3248 = $$3248 + 1 | 0; + } + } else { + $$0238 = $$0240$looptemp; + while (1) { + $66 = ($$0238 | 0) > 0; + if ($66 & (HEAP32[$7 + ($$0238 << 2) >> 2] | 0) == -1) $$0238 = $$0238 + -1 | 0; else break; + } + if ($66) { + $$1239 = $$0238; + $$1243 = $$0238; + while (1) { + $$1243$looptemp = $$1243; + $$1243 = $$1243 + -1 | 0; + if ((HEAP32[$7 + ($$1243 << 2) >> 2] | 0) == -1) $$2 = $$1239; else $$2 = (HEAP32[$9 + ($$1239 << 2) >> 2] | 0) < (HEAP32[$9 + ($$1243 << 2) >> 2] | 0) ? $$1243 : $$1239; + if (($$1243$looptemp | 0) <= 1) { + $$3 = $$2; + break; + } else $$1239 = $$2; + } + } else $$3 = $$0238; + $79 = $8 + ($$3 << 2) | 0; + $81 = $$0240 - $$3 | 0; + $82 = $81 + (HEAP32[$79 >> 2] | 0) | 0; + $84 = $$0240$looptemp + 2 | 0; + $$ = ($55 | 0) > ($82 | 0) ? $55 : $82; + HEAP32[$8 + ($84 << 2) >> 2] = $$; + $$4249 = 0; + while (1) { + if (($$4249 | 0) >= ($21 | 0)) break; + HEAP32[$6 + ($84 * 72 | 0) + ($$4249 << 2) >> 2] = 0; + $$4249 = $$4249 + 1 | 0; + } + $89 = $52 + $$1262 | 0; + $90 = $7 + ($$3 << 2) | 0; + $$pre280 = HEAP32[$79 >> 2] | 0; + $$5250 = 0; + while (1) { + if (($$5250 | 0) > ($$pre280 | 0)) break; + $93 = HEAP32[$6 + ($$3 * 72 | 0) + ($$5250 << 2) >> 2] | 0; + if (($93 | 0) != -1) HEAP32[$6 + ($84 * 72 | 0) + ($81 + $$5250 << 2) >> 2] = HEAP32[$$1254 + ((($89 + $93 - (HEAP32[$90 >> 2] | 0) | 0) % ($$1262 | 0) | 0) << 2) >> 2]; + $$5250 = $$5250 + 1 | 0; + } + $$6 = 0; + while (1) { + if (($$6 | 0) > ($55 | 0)) { + $$pre$phiZ2D = $84; + $114 = $$; + break L32; + } + $105 = $6 + ($$0240 * 72 | 0) + ($$6 << 2) | 0; + $106 = HEAP32[$105 >> 2] | 0; + $107 = $6 + ($84 * 72 | 0) + ($$6 << 2) | 0; + HEAP32[$107 >> 2] = HEAP32[$107 >> 2] ^ $106; + HEAP32[$105 >> 2] = HEAP32[$$1252 + ($106 << 2) >> 2]; + $$6 = $$6 + 1 | 0; + } + } while (0); + HEAP32[$9 + ($$pre$phiZ2D << 2) >> 2] = $$0240 - $114; + if (($$0240 | 0) >= ($21 | 0)) break; + $118 = HEAP32[$10 + ($$pre$phiZ2D << 2) >> 2] | 0; + if (($118 | 0) == -1) $$sink = 0; else $$sink = HEAP32[$$1254 + ($118 << 2) >> 2] | 0; + $122 = $7 + ($$pre$phiZ2D << 2) | 0; + HEAP32[$122 >> 2] = $$sink; + $$7 = 1; + $138 = $$sink; + while (1) { + if (($$7 | 0) > ($114 | 0)) break; + $126 = HEAP32[$10 + ($$pre$phiZ2D - $$7 << 2) >> 2] | 0; + if (($126 | 0) != -1 ? ($129 = HEAP32[$6 + ($$pre$phiZ2D * 72 | 0) + ($$7 << 2) >> 2] | 0, ($129 | 0) != 0) : 0) { + $137 = $138 ^ HEAP32[$$1254 + ((((HEAP32[$$1252 + ($129 << 2) >> 2] | 0) + $126 | 0) % ($$1262 | 0) | 0) << 2) >> 2]; + HEAP32[$122 >> 2] = $137; + $206 = $137; + } else $206 = $138; + $$7 = $$7 + 1 | 0; + $138 = $206; + } + $52 = HEAP32[$$1252 + ($138 << 2) >> 2] | 0; + HEAP32[$122 >> 2] = $52; + if (($114 | 0) > ($$3266 | 0)) break; else $55 = $114; + } + if (($114 | 0) > ($$3266 | 0)) { + $$0237 = -1; + break L11; + } + $$8 = 0; + while (1) { + if (($$8 | 0) > ($114 | 0)) break; + $145 = $6 + ($$pre$phiZ2D * 72 | 0) + ($$8 << 2) | 0; + HEAP32[$145 >> 2] = HEAP32[$$1252 + (HEAP32[$145 >> 2] << 2) >> 2]; + $$8 = $$8 + 1 | 0; + } + $$9 = 1; + while (1) { + if (($$9 | 0) > ($114 | 0)) break; + HEAP32[$12 + ($$9 << 2) >> 2] = HEAP32[$6 + ($$pre$phiZ2D * 72 | 0) + ($$9 << 2) >> 2]; + $$9 = $$9 + 1 | 0; + } + $$0235 = 0; + $$10 = 1; + while (1) { + if (($$1262 | 0) < ($$10 | 0)) break; + $$2244 = 1; + $$4 = 1; + while (1) { + if (($$2244 | 0) > ($114 | 0)) break; + $157 = $12 + ($$2244 << 2) | 0; + $158 = HEAP32[$157 >> 2] | 0; + if (($158 | 0) == -1) $$5 = $$4; else { + $161 = ($158 + $$2244 | 0) % ($$1262 | 0) | 0; + HEAP32[$157 >> 2] = $161; + $$5 = HEAP32[$$1254 + ($161 << 2) >> 2] ^ $$4; + } + $$2244 = $$2244 + 1 | 0; + $$4 = $$5; + } + if (!$$4) { + HEAP32[$11 + ($$0235 << 2) >> 2] = $$1262 - $$10; + $$1236 = $$0235 + 1 | 0; + } else $$1236 = $$0235; + $$0235 = $$1236; + $$10 = $$10 + 1 | 0; + } + if (($$0235 | 0) != ($114 | 0)) { + $$0237 = -1; + break L11; + } + $$11 = 0; + while (1) { + if (($$11 | 0) >= ($114 | 0)) { + $$1241 = $$pre$phiZ2D; + break L24; + } + $175 = $$0268 + (HEAP32[$11 + ($$11 << 2) >> 2] | 0) | 0; + HEAP8[$175 >> 0] = HEAP8[$175 >> 0] ^ 1; + $$11 = $$11 + 1 | 0; + } + } else $$1241 = 0; while (0); + $179 = $4; + HEAP32[$179 >> 2] = 0; + HEAP32[$179 + 4 >> 2] = 0; + $$12 = $$1260 - $$3258 | 0; + $188 = 1; + $189 = 0; + $192 = 0; + $193 = 0; + while (1) { + if (($$12 | 0) >= ($$1260 | 0)) break; + $190 = ___muldi3($188 | 0, $189 | 0, HEAPU8[$$0268 + $$12 >> 0] | 0, 0) | 0; + $194 = _i64Add($190 | 0, getTempRet0() | 0, $192 | 0, $193 | 0) | 0; + $195 = getTempRet0() | 0; + $196 = $4; + HEAP32[$196 >> 2] = $194; + HEAP32[$196 + 4 >> 2] = $195; + $200 = _bitshift64Shl($188 | 0, $189 | 0, 1) | 0; + $$12 = $$12 + 1 | 0; + $188 = $200; + $189 = getTempRet0() | 0; + $192 = $194; + $193 = $195; + } + if ($39) $$0237 = HEAP32[$8 + ($$1241 << 2) >> 2] | 0; else $$0237 = 0; + } while (0); + STACKTOP = sp; + return $$0237 | 0; +} + +function _jinit_color_deconverter($0) { + $0 = $0 | 0; + var $$0107 = 0, $$019$i = 0, $$03233$i = 0, $$03233$i100 = 0, $$03233$i96 = 0, $$034$i = 0, $$034$i95 = 0, $$034$i99 = 0, $$sink = 0, $1 = 0, $108 = 0, $11 = 0, $111 = 0, $116 = 0, $119 = 0, $120 = 0, $123 = 0, $124 = 0, $127 = 0, $128 = 0, $131 = 0, $133 = 0, $134 = 0, $135 = 0, $144 = 0, $147 = 0, $154 = 0, $157 = 0, $166 = 0, $169 = 0, $17 = 0, $175 = 0, $178 = 0, $179 = 0, $182 = 0, $183 = 0, $186 = 0, $187 = 0, $190 = 0, $192 = 0, $193 = 0, $194 = 0, $203 = 0, $206 = 0, $211 = 0, $220 = 0, $228 = 0, $23 = 0, $29 = 0, $32 = 0, $36 = 0, $4 = 0, $40 = 0, $45 = 0, $48 = 0, $5 = 0, $55 = 0, $58 = 0, $6 = 0, $61 = 0, $73 = 0, $80 = 0, $83 = 0, $84 = 0, $87 = 0, $88 = 0, $91 = 0, $92 = 0, $95 = 0, $97 = 0, $98 = 0, $99 = 0; + $1 = $0 + 4 | 0; + $4 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 28) | 0; + $5 = $0 + 480 | 0; + HEAP32[$5 >> 2] = $4; + HEAP32[$4 >> 2] = 190; + $6 = $0 + 40 | 0; + switch (HEAP32[$6 >> 2] | 0) { + case 1: + { + if ((HEAP32[$0 + 36 >> 2] | 0) != 1) { + $11 = HEAP32[$0 >> 2] | 0; + HEAP32[$11 + 20 >> 2] = 11; + FUNCTION_TABLE_vi[HEAP32[$11 >> 2] & 255]($0); + } + break; + } + case 7: + case 6: + case 3: + case 2: + { + if ((HEAP32[$0 + 36 >> 2] | 0) != 3) { + $17 = HEAP32[$0 >> 2] | 0; + HEAP32[$17 + 20 >> 2] = 11; + FUNCTION_TABLE_vi[HEAP32[$17 >> 2] & 255]($0); + } + break; + } + case 5: + case 4: + { + if ((HEAP32[$0 + 36 >> 2] | 0) != 4) { + $23 = HEAP32[$0 >> 2] | 0; + HEAP32[$23 + 20 >> 2] = 11; + FUNCTION_TABLE_vi[HEAP32[$23 >> 2] & 255]($0); + } + break; + } + default: + if ((HEAP32[$0 + 36 >> 2] | 0) < 1) { + $29 = HEAP32[$0 >> 2] | 0; + HEAP32[$29 + 20 >> 2] = 11; + FUNCTION_TABLE_vi[HEAP32[$29 >> 2] & 255]($0); + } + } + $32 = $0 + 304 | 0; + L11 : do if (HEAP32[$32 >> 2] | 0) { + switch (HEAP32[$6 >> 2] | 0) { + case 6: + case 2: + { + break L11; + break; + } + default: + {} + } + $36 = HEAP32[$0 >> 2] | 0; + HEAP32[$36 + 20 >> 2] = 28; + FUNCTION_TABLE_vi[HEAP32[$36 >> 2] & 255]($0); + } while (0); + $40 = HEAP32[$0 + 44 >> 2] | 0; + L15 : do switch ($40 | 0) { + case 1: + { + HEAP32[$0 + 120 >> 2] = 1; + switch (HEAP32[$6 >> 2] | 0) { + case 7: + case 3: + case 1: + { + HEAP32[$4 + 4 >> 2] = 4; + $45 = HEAP32[$0 + 36 >> 2] | 0; + if (($45 | 0) <= 1) break L15; + $48 = HEAP32[$0 + 216 >> 2] | 0; + $$0107 = 1; + do { + HEAP32[$48 + ($$0107 * 88 | 0) + 52 >> 2] = 0; + $$0107 = $$0107 + 1 | 0; + } while (($$0107 | 0) < ($45 | 0)); + break; + } + case 2: + { + switch (HEAP32[$32 >> 2] | 0) { + case 0: + { + HEAP32[$4 + 4 >> 2] = 5; + break; + } + case 1: + { + HEAP32[$4 + 4 >> 2] = 6; + break; + } + default: + { + $55 = HEAP32[$0 >> 2] | 0; + HEAP32[$55 + 20 >> 2] = 28; + FUNCTION_TABLE_vi[HEAP32[$55 >> 2] & 255]($0); + } + } + $58 = HEAP32[$5 >> 2] | 0; + $61 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 3072) | 0; + HEAP32[$58 + 24 >> 2] = $61; + $$019$i = 0; + do { + HEAP32[$61 + ($$019$i << 2) >> 2] = $$019$i * 19595; + HEAP32[$61 + ($$019$i + 256 << 2) >> 2] = $$019$i * 38470; + HEAP32[$61 + ($$019$i + 512 << 2) >> 2] = ($$019$i * 7471 | 0) + 32768; + $$019$i = $$019$i + 1 | 0; + } while (($$019$i | 0) != 256); + break; + } + default: + { + $73 = HEAP32[$0 >> 2] | 0; + HEAP32[$73 + 20 >> 2] = 28; + FUNCTION_TABLE_vi[HEAP32[$73 >> 2] & 255]($0); + break L15; + } + } + break; + } + case 2: + { + HEAP32[$0 + 120 >> 2] = 3; + switch (HEAP32[$6 >> 2] | 0) { + case 1: + { + HEAP32[$4 + 4 >> 2] = 7; + break L15; + break; + } + case 3: + { + HEAP32[$4 + 4 >> 2] = 8; + $80 = HEAP32[$5 >> 2] | 0; + $83 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + $84 = $80 + 8 | 0; + HEAP32[$84 >> 2] = $83; + $87 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + $88 = $80 + 12 | 0; + HEAP32[$88 >> 2] = $87; + $91 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + $92 = $80 + 16 | 0; + HEAP32[$92 >> 2] = $91; + $95 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + HEAP32[$80 + 20 >> 2] = $95; + $97 = HEAP32[$84 >> 2] | 0; + $98 = HEAP32[$88 >> 2] | 0; + $99 = HEAP32[$92 >> 2] | 0; + $$03233$i = 0; + $$034$i = -128; + while (1) { + HEAP32[$97 + ($$03233$i << 2) >> 2] = ($$034$i * 91881 | 0) + 32768 >> 16; + HEAP32[$98 + ($$03233$i << 2) >> 2] = ($$034$i * 116130 | 0) + 32768 >> 16; + $108 = Math_imul($$034$i, -46802) | 0; + HEAP32[$99 + ($$03233$i << 2) >> 2] = $108; + $111 = (Math_imul($$034$i, -22553) | 0) + 32768 | 0; + HEAP32[$95 + ($$03233$i << 2) >> 2] = $111; + $$03233$i = $$03233$i + 1 | 0; + if (($$03233$i | 0) == 256) break; else $$034$i = $$034$i + 1 | 0; + } + break; + } + case 7: + { + HEAP32[$4 + 4 >> 2] = 8; + $116 = HEAP32[$5 >> 2] | 0; + $119 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + $120 = $116 + 8 | 0; + HEAP32[$120 >> 2] = $119; + $123 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + $124 = $116 + 12 | 0; + HEAP32[$124 >> 2] = $123; + $127 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + $128 = $116 + 16 | 0; + HEAP32[$128 >> 2] = $127; + $131 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + HEAP32[$116 + 20 >> 2] = $131; + $133 = HEAP32[$120 >> 2] | 0; + $134 = HEAP32[$124 >> 2] | 0; + $135 = HEAP32[$128 >> 2] | 0; + $$03233$i96 = 0; + $$034$i95 = -128; + while (1) { + HEAP32[$133 + ($$03233$i96 << 2) >> 2] = ($$034$i95 * 183763 | 0) + 32768 >> 16; + HEAP32[$134 + ($$03233$i96 << 2) >> 2] = ($$034$i95 * 232260 | 0) + 32768 >> 16; + $144 = Math_imul($$034$i95, -93603) | 0; + HEAP32[$135 + ($$03233$i96 << 2) >> 2] = $144; + $147 = (Math_imul($$034$i95, -45107) | 0) + 32768 | 0; + HEAP32[$131 + ($$03233$i96 << 2) >> 2] = $147; + $$03233$i96 = $$03233$i96 + 1 | 0; + if (($$03233$i96 | 0) == 256) break; else $$034$i95 = $$034$i95 + 1 | 0; + } + break; + } + case 2: + { + switch (HEAP32[$32 >> 2] | 0) { + case 0: + { + HEAP32[$4 + 4 >> 2] = 9; + break L15; + break; + } + case 1: + { + HEAP32[$4 + 4 >> 2] = 10; + break L15; + break; + } + default: + { + $154 = HEAP32[$0 >> 2] | 0; + HEAP32[$154 + 20 >> 2] = 28; + FUNCTION_TABLE_vi[HEAP32[$154 >> 2] & 255]($0); + break L15; + } + } + break; + } + default: + { + $157 = HEAP32[$0 >> 2] | 0; + HEAP32[$157 + 20 >> 2] = 28; + FUNCTION_TABLE_vi[HEAP32[$157 >> 2] & 255]($0); + break L15; + } + } + break; + } + case 6: + { + HEAP32[$0 + 120 >> 2] = 3; + if ((HEAP32[$6 >> 2] | 0) != 6) { + $169 = HEAP32[$0 >> 2] | 0; + HEAP32[$169 + 20 >> 2] = 28; + FUNCTION_TABLE_vi[HEAP32[$169 >> 2] & 255]($0); + break L15; + } + switch (HEAP32[$32 >> 2] | 0) { + case 0: + { + HEAP32[$4 + 4 >> 2] = 9; + break L15; + break; + } + case 1: + { + HEAP32[$4 + 4 >> 2] = 10; + break L15; + break; + } + default: + { + $166 = HEAP32[$0 >> 2] | 0; + HEAP32[$166 + 20 >> 2] = 28; + FUNCTION_TABLE_vi[HEAP32[$166 >> 2] & 255]($0); + break L15; + } + } + break; + } + case 4: + { + HEAP32[$0 + 120 >> 2] = 4; + switch (HEAP32[$6 >> 2] | 0) { + case 5: + { + HEAP32[$4 + 4 >> 2] = 11; + $175 = HEAP32[$5 >> 2] | 0; + $178 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + $179 = $175 + 8 | 0; + HEAP32[$179 >> 2] = $178; + $182 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + $183 = $175 + 12 | 0; + HEAP32[$183 >> 2] = $182; + $186 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + $187 = $175 + 16 | 0; + HEAP32[$187 >> 2] = $186; + $190 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + HEAP32[$175 + 20 >> 2] = $190; + $192 = HEAP32[$179 >> 2] | 0; + $193 = HEAP32[$183 >> 2] | 0; + $194 = HEAP32[$187 >> 2] | 0; + $$03233$i100 = 0; + $$034$i99 = -128; + while (1) { + HEAP32[$192 + ($$03233$i100 << 2) >> 2] = ($$034$i99 * 91881 | 0) + 32768 >> 16; + HEAP32[$193 + ($$03233$i100 << 2) >> 2] = ($$034$i99 * 116130 | 0) + 32768 >> 16; + $203 = Math_imul($$034$i99, -46802) | 0; + HEAP32[$194 + ($$03233$i100 << 2) >> 2] = $203; + $206 = (Math_imul($$034$i99, -22553) | 0) + 32768 | 0; + HEAP32[$190 + ($$03233$i100 << 2) >> 2] = $206; + $$03233$i100 = $$03233$i100 + 1 | 0; + if (($$03233$i100 | 0) == 256) break; else $$034$i99 = $$034$i99 + 1 | 0; + } + break; + } + case 4: + { + HEAP32[$4 + 4 >> 2] = 12; + break L15; + break; + } + default: + { + $211 = HEAP32[$0 >> 2] | 0; + HEAP32[$211 + 20 >> 2] = 28; + FUNCTION_TABLE_vi[HEAP32[$211 >> 2] & 255]($0); + break L15; + } + } + break; + } + default: + if (($40 | 0) == (HEAP32[$6 >> 2] | 0)) { + HEAP32[$0 + 120 >> 2] = HEAP32[$0 + 36 >> 2]; + HEAP32[$4 + 4 >> 2] = 12; + break L15; + } else { + $220 = HEAP32[$0 >> 2] | 0; + HEAP32[$220 + 20 >> 2] = 28; + FUNCTION_TABLE_vi[HEAP32[$220 >> 2] & 255]($0); + break L15; + } + } while (0); + if (HEAP32[$0 + 84 >> 2] | 0) { + $$sink = 1; + $228 = $0 + 124 | 0; + HEAP32[$228 >> 2] = $$sink; + return; + } + $$sink = HEAP32[$0 + 120 >> 2] | 0; + $228 = $0 + 124 | 0; + HEAP32[$228 >> 2] = $$sink; + return; +} + +function _decode_mcu_AC_refine_65($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$0164 = 0, $$0166 = 0, $$017$i = 0, $$0170 = 0, $$0175 = 0, $$0180 = 0, $$0197 = 0, $$0199205 = 0, $$10 = 0, $$10190 = 0, $$11 = 0, $$11191 = 0, $$1167 = 0, $$1171 = 0, $$1176 = 0, $$1181 = 0, $$1198 = 0, $$1200 = 0, $$12192206 = 0, $$12207 = 0, $$13 = 0, $$13193 = 0, $$14 = 0, $$14194 = 0, $$15 = 0, $$15195 = 0, $$16 = 0, $$16196 = 0, $$2$ph = 0, $$2168209 = 0, $$2172 = 0, $$2177 = 0, $$2182 = 0, $$3 = 0, $$3169 = 0, $$3173208 = 0, $$4174 = 0, $$4179$ph = 0, $$4184$ph = 0, $$4226 = 0, $$5 = 0, $$5185 = 0, $$6 = 0, $$6186 = 0, $$7 = 0, $$7187 = 0, $$8 = 0, $$8188 = 0, $$9 = 0, $$9189 = 0, $104 = 0, $113 = 0, $12 = 0, $121 = 0, $125 = 0, $126 = 0, $136 = 0, $140 = 0, $147 = 0, $152 = 0, $156 = 0, $16 = 0, $164 = 0, $168 = 0, $169 = 0, $17 = 0, $181 = 0, $184 = 0, $2 = 0, $24 = 0, $3 = 0, $41 = 0, $43 = 0, $44 = 0, $45 = 0, $47 = 0, $49 = 0, $5 = 0, $50 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $63 = 0, $65 = 0, $67 = 0, $68 = 0, $72 = 0, $73 = 0, $77 = 0, $79 = 0, $85 = 0, $89 = 0, $9 = 0, $90 = 0, $99 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 288 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(288); + $2 = sp + 256 | 0; + $3 = sp; + $5 = HEAP32[$0 + 468 >> 2] | 0; + $6 = $0 + 280 | 0; + if (HEAP32[$6 >> 2] | 0 ? ($9 = $5 + 44 | 0, (HEAP32[$9 >> 2] | 0) == 0) : 0) { + $12 = $5 + 16 | 0; + $16 = HEAP32[$0 + 464 >> 2] | 0; + $17 = $16 + 24 | 0; + HEAP32[$17 >> 2] = (HEAP32[$17 >> 2] | 0) + ((HEAP32[$12 >> 2] | 0) / 8 | 0); + HEAP32[$12 >> 2] = 0; + if (!(FUNCTION_TABLE_ii[HEAP32[$16 + 8 >> 2] & 127]($0) | 0)) { + $$0 = 0; + STACKTOP = sp; + return $$0 | 0; + } + $24 = $0 + 340 | 0; + if ((HEAP32[$24 >> 2] | 0) > 0) { + $$017$i = 0; + do { + HEAP32[$5 + 24 + ($$017$i << 2) >> 2] = 0; + $$017$i = $$017$i + 1 | 0; + } while (($$017$i | 0) < (HEAP32[$24 >> 2] | 0)); + } + HEAP32[$5 + 20 >> 2] = 0; + HEAP32[$9 >> 2] = HEAP32[$6 >> 2]; + if (!(HEAP32[$0 + 440 >> 2] | 0)) HEAP32[$5 + 40 >> 2] = 0; + } + do if (!(HEAP32[$5 + 40 >> 2] | 0)) { + $41 = HEAP32[$0 + 416 >> 2] | 0; + $43 = HEAP32[$0 + 424 >> 2] | 0; + $44 = 1 << $43; + $45 = -1 << $43; + $47 = HEAP32[$0 + 432 >> 2] | 0; + HEAP32[$2 + 16 >> 2] = $0; + $49 = $0 + 24 | 0; + $50 = HEAP32[$49 >> 2] | 0; + HEAP32[$2 >> 2] = HEAP32[$50 >> 2]; + $54 = $2 + 4 | 0; + HEAP32[$54 >> 2] = HEAP32[$50 + 4 >> 2]; + $55 = $5 + 12 | 0; + $56 = HEAP32[$55 >> 2] | 0; + $57 = $5 + 16 | 0; + $58 = HEAP32[$57 >> 2] | 0; + $59 = $5 + 20 | 0; + $60 = HEAP32[$59 >> 2] | 0; + $61 = HEAP32[$1 >> 2] | 0; + $63 = HEAP32[$5 + 64 >> 2] | 0; + $65 = HEAP32[$0 + 412 >> 2] | 0; + $67 = $2 + 8 | 0; + $68 = $2 + 12 | 0; + L16 : do if (!$60) { + $$0166 = 0; + $$0170 = $65; + $$0175 = $58; + $$0180 = $56; + L18 : while (1) { + if (($$0175 | 0) < 8) { + if (!(_jpeg_fill_bit_buffer($2, $$0180, $$0175, 0) | 0)) { + $$3169 = $$0166; + break L16; + } + $72 = HEAP32[$67 >> 2] | 0; + $73 = HEAP32[$68 >> 2] | 0; + if (($73 | 0) < 8) { + $$0164 = 1; + $$2177 = $73; + $$2182 = $72; + label = 17; + } else { + $$1176 = $73; + $$1181 = $72; + label = 15; + } + } else { + $$1176 = $$0175; + $$1181 = $$0180; + label = 15; + } + if ((label | 0) == 15) { + label = 0; + $77 = $$1181 >> $$1176 + -8 & 255; + $79 = HEAP32[$63 + 144 + ($77 << 2) >> 2] | 0; + if (!$79) { + $$0164 = 9; + $$2177 = $$1176; + $$2182 = $$1181; + label = 17; + } else { + $$2$ph = HEAPU8[$63 + 1168 + $77 >> 0] | 0; + $$4179$ph = $$1176 - $79 | 0; + $$4184$ph = $$1181; + } + } + if ((label | 0) == 17) { + label = 0; + $85 = _jpeg_huff_decode($2, $$2182, $$2177, $63, $$0164) | 0; + if (($85 | 0) < 0) { + $$3169 = $$0166; + break L16; + } + $$2$ph = $85; + $$4179$ph = HEAP32[$68 >> 2] | 0; + $$4184$ph = HEAP32[$67 >> 2] | 0; + } + $89 = $$2$ph >>> 4; + switch ($$2$ph & 15) { + case 0: + { + if (($89 | 0) == 15) { + $$3 = 0; + $$7 = $$4179$ph; + $$7187 = $$4184$ph; + } else break L18; + break; + } + case 1: + { + label = 21; + break; + } + default: + { + $90 = HEAP32[$0 >> 2] | 0; + HEAP32[$90 + 20 >> 2] = 121; + FUNCTION_TABLE_vii[HEAP32[$90 + 4 >> 2] & 255]($0, -1); + label = 21; + } + } + if ((label | 0) == 21) { + label = 0; + if (($$4179$ph | 0) < 1) { + if (!(_jpeg_fill_bit_buffer($2, $$4184$ph, $$4179$ph, 1) | 0)) { + $$3169 = $$0166; + break L16; + } + $$5 = HEAP32[$68 >> 2] | 0; + $$5185 = HEAP32[$67 >> 2] | 0; + } else { + $$5 = $$4179$ph; + $$5185 = $$4184$ph; + } + $99 = $$5 + -1 | 0; + $$3 = (1 << $99 & $$5185 | 0) == 0 ? $45 : $44; + $$7 = $99; + $$7187 = $$5185; + } + $$0197 = $89; + $$1171 = $$0170; + $$8 = $$7; + $$8188 = $$7187; + L40 : while (1) { + $113 = $61 + (HEAP32[$47 + ($$1171 << 2) >> 2] << 1) | 0; + do if (!(HEAP16[$113 >> 1] | 0)) if (($$0197 | 0) < 1) { + $$11 = $$8; + $$11191 = $$8188; + $$2172 = $$1171; + break L40; + } else { + $$10 = $$8; + $$10190 = $$8188; + $$1198 = $$0197 + -1 | 0; + } else { + if (($$8 | 0) < 1) { + if (!(_jpeg_fill_bit_buffer($2, $$8188, $$8, 1) | 0)) { + $$3169 = $$0166; + break L16; + } + $$9 = HEAP32[$68 >> 2] | 0; + $$9189 = HEAP32[$67 >> 2] | 0; + } else { + $$9 = $$8; + $$9189 = $$8188; + } + $121 = $$9 + -1 | 0; + if ((1 << $121 & $$9189 | 0) != 0 ? ($125 = HEAP16[$113 >> 1] | 0, $126 = $125 << 16 >> 16, ($44 & $126 | 0) == 0) : 0) if ($125 << 16 >> 16 > -1) { + HEAP16[$113 >> 1] = $44 + $126; + $$10 = $121; + $$10190 = $$9189; + $$1198 = $$0197; + break; + } else { + HEAP16[$113 >> 1] = $45 + $126; + $$10 = $121; + $$10190 = $$9189; + $$1198 = $$0197; + break; + } else { + $$10 = $121; + $$10190 = $$9189; + $$1198 = $$0197; + } + } while (0); + $136 = $$1171 + 1 | 0; + if (($$1171 | 0) < ($41 | 0)) { + $$0197 = $$1198; + $$1171 = $136; + $$8 = $$10; + $$8188 = $$10190; + } else { + $$11 = $$10; + $$11191 = $$10190; + $$2172 = $136; + break; + } + } + if (!$$3) $$1167 = $$0166; else { + $140 = HEAP32[$47 + ($$2172 << 2) >> 2] | 0; + HEAP16[$61 + ($140 << 1) >> 1] = $$3; + HEAP32[$3 + ($$0166 << 2) >> 2] = $140; + $$1167 = $$0166 + 1 | 0; + } + if (($$2172 | 0) < ($41 | 0)) { + $$0166 = $$1167; + $$0170 = $$2172 + 1 | 0; + $$0175 = $$11; + $$0180 = $$11191; + } else { + $$1200 = 0; + $$16 = $$11; + $$16196 = $$11191; + label = 58; + break L16; + } + } + $104 = 1 << $89; + if ($89) { + if (($$4179$ph | 0) < ($89 | 0)) { + if (!(_jpeg_fill_bit_buffer($2, $$4184$ph, $$4179$ph, $89) | 0)) { + $$3169 = $$0166; + break; + } + $$6 = HEAP32[$68 >> 2] | 0; + $$6186 = HEAP32[$67 >> 2] | 0; + } else { + $$6 = $$4179$ph; + $$6186 = $$4184$ph; + } + $147 = $$6 - $89 | 0; + $152 = ($$6186 >> $147 & HEAP32[5184 + ($89 << 2) >> 2]) + $104 | 0; + if (!$152) { + $$1200 = 0; + $$16 = $147; + $$16196 = $$6186; + label = 58; + } else { + $$0199205 = $152; + $$12192206 = $$6186; + $$12207 = $147; + $$2168209 = $$0166; + $$3173208 = $$0170; + label = 46; + } + } else { + $$0199205 = 1; + $$12192206 = $$4184$ph; + $$12207 = $$4179$ph; + $$2168209 = $$0166; + $$3173208 = $$0170; + label = 46; + } + } else { + $$0199205 = $60; + $$12192206 = $56; + $$12207 = $58; + $$2168209 = 0; + $$3173208 = $65; + label = 46; + } while (0); + L65 : do if ((label | 0) == 46) { + $$13 = $$12207; + $$13193 = $$12192206; + $$4174 = $$3173208; + while (1) { + $156 = $61 + (HEAP32[$47 + ($$4174 << 2) >> 2] << 1) | 0; + do if (HEAP16[$156 >> 1] | 0) { + if (($$13 | 0) < 1) { + if (!(_jpeg_fill_bit_buffer($2, $$13193, $$13, 1) | 0)) { + $$3169 = $$2168209; + break L65; + } + $$14 = HEAP32[$68 >> 2] | 0; + $$14194 = HEAP32[$67 >> 2] | 0; + } else { + $$14 = $$13; + $$14194 = $$13193; + } + $164 = $$14 + -1 | 0; + if ((1 << $164 & $$14194 | 0) != 0 ? ($168 = HEAP16[$156 >> 1] | 0, $169 = $168 << 16 >> 16, ($44 & $169 | 0) == 0) : 0) if ($168 << 16 >> 16 > -1) { + HEAP16[$156 >> 1] = $44 + $169; + $$15 = $164; + $$15195 = $$14194; + break; + } else { + HEAP16[$156 >> 1] = $45 + $169; + $$15 = $164; + $$15195 = $$14194; + break; + } else { + $$15 = $164; + $$15195 = $$14194; + } + } else { + $$15 = $$13; + $$15195 = $$13193; + } while (0); + if (($$4174 | 0) < ($41 | 0)) { + $$13 = $$15; + $$13193 = $$15195; + $$4174 = $$4174 + 1 | 0; + } else break; + } + $$1200 = $$0199205 + -1 | 0; + $$16 = $$15; + $$16196 = $$15195; + label = 58; + } while (0); + if ((label | 0) == 58) { + $181 = HEAP32[$49 >> 2] | 0; + HEAP32[$181 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$181 + 4 >> 2] = HEAP32[$54 >> 2]; + HEAP32[$55 >> 2] = $$16196; + HEAP32[$57 >> 2] = $$16; + HEAP32[$59 >> 2] = $$1200; + break; + } + if (!$$3169) { + $$0 = 0; + STACKTOP = sp; + return $$0 | 0; + } + $$4226 = $$3169; + do { + $$4226 = $$4226 + -1 | 0; + HEAP16[$61 + (HEAP32[$3 + ($$4226 << 2) >> 2] << 1) >> 1] = 0; + } while (($$4226 | 0) != 0); + $$0 = 0; + STACKTOP = sp; + return $$0 | 0; + } while (0); + $184 = $5 + 44 | 0; + HEAP32[$184 >> 2] = (HEAP32[$184 >> 2] | 0) + -1; + $$0 = 1; + STACKTOP = sp; + return $$0 | 0; +} + +function _mbsrtowcs($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0105132 = 0, $$0111131 = 0, $$097 = 0, $$098$lcssa = 0, $$098133 = 0, $$10 = 0, $$1106$ph = 0, $$1106147 = 0, $$1112 = 0, $$1112$ph = 0, $$11122124 = 0, $$11182 = 0, $$11183 = 0, $$199 = 0, $$199$ph = 0, $$2 = 0, $$2100154 = 0, $$2107135 = 0, $$2113153 = 0, $$3101 = 0, $$3108 = 0, $$3108$ph = 0, $$3108176 = 0, $$3114 = 0, $$4 = 0, $$4102 = 0, $$4109 = 0, $$4115 = 0, $$5 = 0, $$5103 = 0, $$5110 = 0, $$5110180 = 0, $$5110181 = 0, $$5116$ph = 0, $$5116146 = 0, $$6 = 0, $$6104$lcssa = 0, $$6104$ph = 0, $$6104148 = 0, $$6117134 = 0, $$7118 = 0, $$7118$ph = 0, $$7118175 = 0, $$7136 = 0, $$8 = 0, $$8$ph = 0, $$8119 = 0, $$8177 = 0, $$9 = 0, $$9$sink = 0, $$9120 = 0, $$9120179 = 0, $$pre = 0, $$pre$phi173Z2D = 0, $$pre$phi174Z2D = 0, $$pre$phiZ2D = 0, $$pre171 = 0, $10 = 0, $105 = 0, $108 = 0, $109 = 0, $113 = 0, $117 = 0, $123 = 0, $124 = 0, $131 = 0, $133 = 0, $137 = 0, $14 = 0, $140 = 0, $141 = 0, $145 = 0, $152 = 0, $153 = 0, $159 = 0, $17 = 0, $19 = 0, $23 = 0, $26 = 0, $33 = 0, $38 = 0, $4 = 0, $41 = 0, $47 = 0, $48 = 0, $53 = 0, $6 = 0, $60 = 0, $66 = 0, $72 = 0, $82 = 0, $83 = 0, $89 = 0, label = 0; + $4 = HEAP32[$1 >> 2] | 0; + if (($3 | 0) != 0 ? ($6 = HEAP32[$3 >> 2] | 0, ($6 | 0) != 0) : 0) if (!$0) { + $$2 = $6; + $$4102 = $4; + $$4115 = $2; + label = 26; + } else { + HEAP32[$3 >> 2] = 0; + $$4 = $6; + $$4109 = $0; + $$8119 = $2; + $$9 = $4; + label = 48; + } else label = 5; + L5 : do if ((label | 0) == 5) { + $10 = (___pthread_self_417() | 0) + 188 | 0; + $14 = ($0 | 0) != 0; + if (HEAP32[HEAP32[$10 >> 2] >> 2] | 0) if ($14) { + $$1106$ph = $0; + $$5116$ph = $2; + $$6104$ph = $4; + label = 33; + break; + } else { + $$1112$ph = $2; + $$199$ph = $4; + label = 15; + break; + } + if (!$14) { + $$097 = _strlen($4) | 0; + label = 63; + break; + } + L13 : do if (!$2) $$098$lcssa = $4; else { + $$0105132 = $0; + $$0111131 = $2; + $$098133 = $4; + while (1) { + $17 = HEAP8[$$098133 >> 0] | 0; + if (!($17 << 24 >> 24)) break; + $19 = $$098133 + 1 | 0; + HEAP32[$$0105132 >> 2] = $17 << 24 >> 24 & 57343; + $23 = $$0111131 + -1 | 0; + if (!$23) { + $$098$lcssa = $19; + break L13; + } else { + $$0105132 = $$0105132 + 4 | 0; + $$0111131 = $23; + $$098133 = $19; + } + } + HEAP32[$$0105132 >> 2] = 0; + HEAP32[$1 >> 2] = 0; + $$097 = $2 - $$0111131 | 0; + label = 63; + break L5; + } while (0); + HEAP32[$1 >> 2] = $$098$lcssa; + $$097 = $2; + label = 63; + } while (0); + L20 : while (1) { + L21 : do if ((label | 0) == 15) { + label = 0; + $$1112 = $$1112$ph; + $$199 = $$199$ph; + while (1) { + $26 = HEAP8[$$199 >> 0] | 0; + if ((($26 & 255) + -1 | 0) >>> 0 < 127 ? ($$199 & 3 | 0) == 0 : 0) { + $33 = HEAP32[$$199 >> 2] | 0; + $38 = $33 & 255; + if (!(($33 + -16843009 | $33) & -2139062144)) { + $$2100154 = $$199; + $$2113153 = $$1112; + do { + $$2100154 = $$2100154 + 4 | 0; + $$2113153 = $$2113153 + -4 | 0; + $41 = HEAP32[$$2100154 >> 2] | 0; + } while (!(($41 + -16843009 | $41) & -2139062144 | 0)); + $$3101 = $$2100154; + $$3114 = $$2113153; + $48 = $41 & 255; + } else { + $$3101 = $$199; + $$3114 = $$1112; + $48 = $38; + } + } else { + $$3101 = $$199; + $$3114 = $$1112; + $48 = $26; + } + $47 = $48 & 255; + if (($47 + -1 | 0) >>> 0 >= 127) break; + $$1112 = $$3114 + -1 | 0; + $$199 = $$3101 + 1 | 0; + } + $53 = $47 + -194 | 0; + if ($53 >>> 0 > 50) { + $$11182 = $$3101; + $$5110180 = $0; + $$9120179 = $$3114; + label = 57; + } else { + $$2 = HEAP32[5728 + ($53 << 2) >> 2] | 0; + $$4102 = $$3101 + 1 | 0; + $$4115 = $$3114; + label = 26; + continue L20; + } + } else if ((label | 0) == 26) { + label = 0; + $60 = (HEAPU8[$$4102 >> 0] | 0) >>> 3; + if (($60 + -16 | $60 + ($$2 >> 26)) >>> 0 > 7) { + $$5110 = $0; + $$6 = $$2; + $$9$sink = $$4102; + $$9120 = $$4115; + label = 56; + } else { + $66 = $$4102 + 1 | 0; + if ($$2 & 33554432) { + if ((HEAP8[$66 >> 0] & -64) << 24 >> 24 != -128) { + $$5110 = $0; + $$6 = $$2; + $$9$sink = $$4102; + $$9120 = $$4115; + label = 56; + break; + } + $72 = $$4102 + 2 | 0; + if (!($$2 & 524288)) $$5103 = $72; else { + if ((HEAP8[$72 >> 0] & -64) << 24 >> 24 != -128) { + $$5110 = $0; + $$6 = $$2; + $$9$sink = $$4102; + $$9120 = $$4115; + label = 56; + break; + } + $$5103 = $$4102 + 3 | 0; + } + } else $$5103 = $66; + $$1112$ph = $$4115 + -1 | 0; + $$199$ph = $$5103; + label = 15; + continue L20; + } + } else if ((label | 0) == 33) { + label = 0; + L23 : do if (!$$5116$ph) $$6104$lcssa = $$6104$ph; else { + $$1106147 = $$1106$ph; + $$5116146 = $$5116$ph; + $$6104148 = $$6104$ph; + while (1) { + $82 = HEAPU8[$$6104148 >> 0] | 0; + $83 = $82 + -1 | 0; + if ($83 >>> 0 < 127) if (($$6104148 & 3 | 0) == 0 & $$5116146 >>> 0 > 4) { + $$2107135 = $$1106147; + $$6117134 = $$5116146; + $$7136 = $$6104148; + while (1) { + $89 = HEAP32[$$7136 >> 2] | 0; + if (($89 + -16843009 | $89) & -2139062144 | 0) { + label = 42; + break; + } + HEAP32[$$2107135 >> 2] = $89 & 255; + HEAP32[$$2107135 + 4 >> 2] = HEAPU8[$$7136 + 1 >> 0]; + HEAP32[$$2107135 + 8 >> 2] = HEAPU8[$$7136 + 2 >> 0]; + $105 = $$7136 + 4 | 0; + $108 = $$2107135 + 16 | 0; + HEAP32[$$2107135 + 12 >> 2] = HEAPU8[$$7136 + 3 >> 0]; + $109 = $$6117134 + -4 | 0; + if ($109 >>> 0 > 4) { + $$2107135 = $108; + $$6117134 = $109; + $$7136 = $105; + } else { + label = 41; + break; + } + } + if ((label | 0) == 41) { + label = 0; + $$3108$ph = $108; + $$7118$ph = $109; + $$8$ph = $105; + $$pre = HEAP8[$105 >> 0] | 0; + } else if ((label | 0) == 42) { + label = 0; + $$3108$ph = $$2107135; + $$7118$ph = $$6117134; + $$8$ph = $$7136; + $$pre = $89 & 255; + } + $$pre171 = $$pre & 255; + $$3108 = $$3108$ph; + $$7118 = $$7118$ph; + $$8 = $$8$ph; + $$pre$phi173Z2D = $$pre171 + -1 | 0; + $$pre$phiZ2D = $$pre171; + label = 44; + } else { + $$3108176 = $$1106147; + $$7118175 = $$5116146; + $$8177 = $$6104148; + $$pre$phi174Z2D = $82; + } else { + $$3108 = $$1106147; + $$7118 = $$5116146; + $$8 = $$6104148; + $$pre$phi173Z2D = $83; + $$pre$phiZ2D = $82; + label = 44; + } + if ((label | 0) == 44) { + label = 0; + if ($$pre$phi173Z2D >>> 0 < 127) { + $$3108176 = $$3108; + $$7118175 = $$7118; + $$8177 = $$8; + $$pre$phi174Z2D = $$pre$phiZ2D; + } else break; + } + $113 = $$8177 + 1 | 0; + HEAP32[$$3108176 >> 2] = $$pre$phi174Z2D; + $$5116146 = $$7118175 + -1 | 0; + if (!$$5116146) { + $$6104$lcssa = $113; + break L23; + } else { + $$1106147 = $$3108176 + 4 | 0; + $$6104148 = $113; + } + } + $117 = $$pre$phiZ2D + -194 | 0; + if ($117 >>> 0 > 50) { + $$11182 = $$8; + $$5110180 = $$3108; + $$9120179 = $$7118; + label = 57; + break L21; + } + $$4 = HEAP32[5728 + ($117 << 2) >> 2] | 0; + $$4109 = $$3108; + $$8119 = $$7118; + $$9 = $$8 + 1 | 0; + label = 48; + continue L20; + } while (0); + HEAP32[$1 >> 2] = $$6104$lcssa; + $$097 = $2; + label = 63; + continue L20; + } else if ((label | 0) == 48) { + label = 0; + $123 = HEAPU8[$$9 >> 0] | 0; + $124 = $123 >>> 3; + if (($124 + -16 | $124 + ($$4 >> 26)) >>> 0 > 7) { + $$5110 = $$4109; + $$6 = $$4; + $$9$sink = $$9; + $$9120 = $$8119; + label = 56; + } else { + $131 = $$9 + 1 | 0; + $133 = $123 + -128 | $$4 << 6; + do if (($133 | 0) < 0) { + $137 = (HEAPU8[$131 >> 0] | 0) + -128 | 0; + if ($137 >>> 0 <= 63) { + $140 = $$9 + 2 | 0; + $141 = $137 | $133 << 6; + if (($141 | 0) >= 0) { + $$10 = $140; + $$5 = $141; + break; + } + $145 = (HEAPU8[$140 >> 0] | 0) + -128 | 0; + if ($145 >>> 0 <= 63) { + $$10 = $$9 + 3 | 0; + $$5 = $145 | $141 << 6; + break; + } + } + $152 = ___errno_location() | 0; + HEAP32[$152 >> 2] = 25; + $$11122124 = $$9 + -1 | 0; + break L21; + } else { + $$10 = $131; + $$5 = $133; + } while (0); + HEAP32[$$4109 >> 2] = $$5; + $$1106$ph = $$4109 + 4 | 0; + $$5116$ph = $$8119 + -1 | 0; + $$6104$ph = $$10; + label = 33; + continue L20; + } + } else if ((label | 0) == 63) { + label = 0; + return $$097 | 0; + } while (0); + if ((label | 0) == 56) { + label = 0; + $153 = $$9$sink + -1 | 0; + if (!$$6) { + $$11182 = $153; + $$5110180 = $$5110; + $$9120179 = $$9120; + label = 57; + } else { + $$11183 = $153; + $$5110181 = $$5110; + label = 61; + } + } + if ((label | 0) == 57) { + label = 0; + if (!(HEAP8[$$11182 >> 0] | 0)) { + if ($$5110180 | 0) { + HEAP32[$$5110180 >> 2] = 0; + HEAP32[$1 >> 2] = 0; + } + $$097 = $2 - $$9120179 | 0; + label = 63; + continue; + } else { + $$11183 = $$11182; + $$5110181 = $$5110180; + label = 61; + } + } + if ((label | 0) == 61) { + label = 0; + $159 = ___errno_location() | 0; + HEAP32[$159 >> 2] = 25; + if (!$$5110181) { + $$097 = -1; + label = 63; + continue; + } else $$11122124 = $$11183; + } + HEAP32[$1 >> 2] = $$11122124; + $$097 = -1; + label = 63; + } + return 0; +} + +function __ZNK6vision21HoughSimilarityVoting11getBinIndexEiiii($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $103 = 0, $107 = 0, $114 = 0, $119 = 0, $12 = 0, $123 = 0, $132 = 0, $137 = 0, $141 = 0, $143 = 0, $147 = 0, $151 = 0, $160 = 0, $165 = 0, $169 = 0, $17 = 0, $21 = 0, $23 = 0, $30 = 0, $35 = 0, $39 = 0, $46 = 0, $5 = 0, $51 = 0, $55 = 0, $57 = 0, $64 = 0, $69 = 0, $73 = 0, $80 = 0, $85 = 0, $89 = 0, $91 = 0, $98 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $5 = sp; + if (($1 | 0) <= -1) { + $12 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36688) | 0, 36227) | 0, 39072) | 0, 165) | 0, 39079) | 0, 36721) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $12 + (HEAP32[(HEAP32[$12 >> 2] | 0) + -12 >> 2] | 0) | 0); + $17 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $21 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$17 >> 2] | 0) + 28 >> 2] & 127]($17, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($12, $21) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($12) | 0; + _abort(); + } + $23 = HEAP32[$0 + 52 >> 2] | 0; + if (($23 | 0) <= ($1 | 0)) { + $30 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36739) | 0, 36227) | 0, 39072) | 0, 166) | 0, 39079) | 0, 36721) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $30 + (HEAP32[(HEAP32[$30 >> 2] | 0) + -12 >> 2] | 0) | 0); + $35 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $39 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$35 >> 2] | 0) + 28 >> 2] & 127]($35, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($30, $39) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($30) | 0; + _abort(); + } + if (($2 | 0) <= -1) { + $46 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36779) | 0, 36227) | 0, 39072) | 0, 167) | 0, 39079) | 0, 36812) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $46 + (HEAP32[(HEAP32[$46 >> 2] | 0) + -12 >> 2] | 0) | 0); + $51 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $55 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$51 >> 2] | 0) + 28 >> 2] & 127]($51, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($46, $55) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($46) | 0; + _abort(); + } + $57 = HEAP32[$0 + 56 >> 2] | 0; + if (($57 | 0) <= ($2 | 0)) { + $64 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36830) | 0, 36227) | 0, 39072) | 0, 168) | 0, 39079) | 0, 36812) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $64 + (HEAP32[(HEAP32[$64 >> 2] | 0) + -12 >> 2] | 0) | 0); + $69 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $73 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$69 >> 2] | 0) + 28 >> 2] & 127]($69, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($64, $73) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($64) | 0; + _abort(); + } + if (($3 | 0) <= -1) { + $80 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36870) | 0, 36227) | 0, 39072) | 0, 169) | 0, 39079) | 0, 36907) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $80 + (HEAP32[(HEAP32[$80 >> 2] | 0) + -12 >> 2] | 0) | 0); + $85 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $89 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$85 >> 2] | 0) + 28 >> 2] & 127]($85, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($80, $89) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($80) | 0; + _abort(); + } + $91 = HEAP32[$0 + 60 >> 2] | 0; + if (($91 | 0) <= ($3 | 0)) { + $98 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36929) | 0, 36227) | 0, 39072) | 0, 170) | 0, 39079) | 0, 36907) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $98 + (HEAP32[(HEAP32[$98 >> 2] | 0) + -12 >> 2] | 0) | 0); + $103 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $107 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$103 >> 2] | 0) + 28 >> 2] & 127]($103, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($98, $107) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($98) | 0; + _abort(); + } + if (($4 | 0) <= -1) { + $114 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36977) | 0, 36227) | 0, 39072) | 0, 171) | 0, 39079) | 0, 37014) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $114 + (HEAP32[(HEAP32[$114 >> 2] | 0) + -12 >> 2] | 0) | 0); + $119 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $123 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$119 >> 2] | 0) + 28 >> 2] & 127]($119, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($114, $123) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($114) | 0; + _abort(); + } + if ((HEAP32[$0 + 64 >> 2] | 0) <= ($4 | 0)) { + $132 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 37036) | 0, 36227) | 0, 39072) | 0, 172) | 0, 39079) | 0, 37014) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $132 + (HEAP32[(HEAP32[$132 >> 2] | 0) + -12 >> 2] | 0) | 0); + $137 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $141 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$137 >> 2] | 0) + 28 >> 2] & 127]($137, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($132, $141) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($132) | 0; + _abort(); + } + $143 = (Math_imul($23, $2) | 0) + $1 | 0; + $147 = (Math_imul(HEAP32[$0 + 84 >> 2] | 0, $3) | 0) + $143 | 0; + $151 = $147 + (Math_imul(HEAP32[$0 + 88 >> 2] | 0, $4) | 0) | 0; + if (($151 | 0) > ((Math_imul(Math_imul($57, $23) | 0, (Math_imul($91, $4) | 0) + $3 | 0) | 0) + $143 | 0)) { + $160 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 37084) | 0, 36227) | 0, 39072) | 0, 176) | 0, 39079) | 0, 36669) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $160 + (HEAP32[(HEAP32[$160 >> 2] | 0) + -12 >> 2] | 0) | 0); + $165 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $169 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$165 >> 2] | 0) + 28 >> 2] & 127]($165, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($160, $169) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($160) | 0; + _abort(); + } else { + STACKTOP = sp; + return $151 | 0; + } + return 0; +} + +function __ZN6vision28BinaryHierarchicalClusteringILi96EE5buildEPNS_4NodeILi96EEEPKhiPKii($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$065 = 0, $$066 = 0, $$in = 0, $$sroa$0120$0 = 0, $$sroa$0120$0$in = 0, $100 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $118 = 0, $119 = 0, $123 = 0, $127 = 0, $128 = 0, $129 = 0, $138 = 0, $143 = 0, $147 = 0, $148 = 0, $149 = 0, $154 = 0, $155 = 0, $156 = 0, $164 = 0, $17 = 0, $18 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $35 = 0, $40 = 0, $44 = 0, $46 = 0, $49 = 0, $54 = 0, $6 = 0, $61 = 0, $66 = 0, $7 = 0, $70 = 0, $77 = 0, $8 = 0, $82 = 0, $86 = 0, $87 = 0, $9 = 0, $95 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $6 = sp + 20 | 0; + $7 = sp; + $8 = $0 + 12 | 0; + $9 = __ZNK6vision14BinarykMedoidsILi96EE1kEv($8) | 0; + if ((__ZN6vision4max2IiEET_S1_S1_($9, HEAP32[$0 + 108 >> 2] | 0) | 0) >= ($5 | 0)) { + __ZN6vision4NodeILi96EE4leafEb($1, 1); + __ZNSt3__26vectorIiNS_9allocatorIiEEE6resizeEm(__ZN6vision4NodeILi96EE12reverseIndexEv($1) | 0, $5); + $$0 = 0; + while (1) { + if (($$0 | 0) >= ($5 | 0)) break; + $17 = HEAP32[$4 + ($$0 << 2) >> 2] | 0; + $18 = __ZN6vision4NodeILi96EE12reverseIndexEv($1) | 0; + HEAP32[(HEAP32[$18 >> 2] | 0) + ($$0 << 2) >> 2] = $17; + $$0 = $$0 + 1 | 0; + } + STACKTOP = sp; + return; + } + HEAP32[$7 >> 2] = 0; + HEAP32[$7 + 4 >> 2] = 0; + HEAP32[$7 + 8 >> 2] = 0; + HEAP32[$7 + 12 >> 2] = 0; + HEAP32[$7 + 16 >> 2] = 1065353216; + __ZN6vision14BinarykMedoidsILi96EE6assignEPKhiPKii($8, $2, $3, $4, $5); + $23 = __ZNK6vision14BinarykMedoidsILi96EE10assignmentEv($8) | 0; + $24 = $23 + 4 | 0; + $25 = HEAP32[$24 >> 2] | 0; + $26 = HEAP32[$23 >> 2] | 0; + if (($25 - $26 >> 2 | 0) != ($5 | 0)) { + $35 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 33206) | 0, 33262) | 0, 39072) | 0, 363) | 0, 39079) | 0, 33356) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $35 + (HEAP32[(HEAP32[$35 >> 2] | 0) + -12 >> 2] | 0) | 0); + $40 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $44 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$40 >> 2] | 0) + 28 >> 2] & 127]($40, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($35, $44) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($35) | 0; + _abort(); + } + $$066 = 0; + $$in = $26; + $46 = $25; + while (1) { + if ($$066 >>> 0 >= $46 - $$in >> 2 >>> 0) { + label = 10; + break; + } + $54 = HEAP32[$$in + ($$066 << 2) >> 2] | 0; + if (($54 | 0) == -1) { + label = 12; + break; + } + if (($54 | 0) >= ($5 | 0)) { + label = 14; + break; + } + $87 = $4 + ($54 << 2) | 0; + if ((HEAP32[$87 >> 2] | 0) >= ($3 | 0)) { + label = 16; + break; + } + $105 = __ZNSt3__213unordered_mapIiNS_6vectorIiNS_9allocatorIiEEEENS_4hashIiEENS_8equal_toIiEENS2_INS_4pairIKiS4_EEEEEixERSA_($7, $87) | 0; + $106 = $4 + ($$066 << 2) | 0; + $107 = $105 + 4 | 0; + $108 = HEAP32[$107 >> 2] | 0; + if (($108 | 0) == (HEAP32[$105 + 8 >> 2] | 0)) __ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_($105, $106); else { + HEAP32[$108 >> 2] = HEAP32[$106 >> 2]; + HEAP32[$107 >> 2] = $108 + 4; + } + $$066 = $$066 + 1 | 0; + $$in = HEAP32[$23 >> 2] | 0; + $46 = HEAP32[$24 >> 2] | 0; + } + if ((label | 0) == 10) { + $49 = $7 + 12 | 0; + L23 : do if ((HEAP32[$49 >> 2] | 0) == 1) { + __ZN6vision4NodeILi96EE4leafEb($1, 1); + __ZNSt3__26vectorIiNS_9allocatorIiEEE6resizeEm(__ZN6vision4NodeILi96EE12reverseIndexEv($1) | 0, $5); + $$065 = 0; + while (1) { + if (($$065 | 0) >= ($5 | 0)) break L23; + $118 = HEAP32[$4 + ($$065 << 2) >> 2] | 0; + $119 = __ZN6vision4NodeILi96EE12reverseIndexEv($1) | 0; + HEAP32[(HEAP32[$119 >> 2] | 0) + ($$065 << 2) >> 2] = $118; + $$065 = $$065 + 1 | 0; + } + } else { + $123 = __ZN6vision4NodeILi96EE8childrenEv($1) | 0; + __ZNSt3__26vectorIPN6vision4NodeILi96EEENS_9allocatorIS4_EEE7reserveEm($123, HEAP32[$49 >> 2] | 0); + $$sroa$0120$0$in = $7 + 8 | 0; + while (1) { + $$sroa$0120$0 = HEAP32[$$sroa$0120$0$in >> 2] | 0; + if (!$$sroa$0120$0) break L23; + $127 = $$sroa$0120$0; + $128 = $127 + 12 | 0; + $129 = $127 + 16 | 0; + if ((HEAP32[$129 >> 2] | 0) == (HEAP32[$128 >> 2] | 0)) break; + $148 = __Znwm(128) | 0; + $149 = __ZN6vision28BinaryHierarchicalClusteringILi96EE10nextNodeIdEv($0) | 0; + __ZN6vision4NodeILi96EEC2EiPKh($148, $149, $2 + ((HEAP32[$127 + 8 >> 2] | 0) * 96 | 0) | 0); + HEAP32[$6 >> 2] = $148; + __ZN6vision4NodeILi96EE4leafEb($148, 0); + $154 = __ZN6vision4NodeILi96EE8childrenEv($1) | 0; + $155 = $154 + 4 | 0; + $156 = HEAP32[$155 >> 2] | 0; + if (($156 | 0) == (HEAP32[$154 + 8 >> 2] | 0)) __ZNSt3__26vectorIPN6vision4NodeILi96EEENS_9allocatorIS4_EEE21__push_back_slow_pathIRKS4_EEvOT_($154, $6); else { + HEAP32[$156 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$155 >> 2] = (HEAP32[$155 >> 2] | 0) + 4; + } + $164 = HEAP32[$128 >> 2] | 0; + __ZN6vision28BinaryHierarchicalClusteringILi96EE5buildEPNS_4NodeILi96EEEPKhiPKii($0, HEAP32[$6 >> 2] | 0, $2, $3, $164, (HEAP32[$129 >> 2] | 0) - $164 >> 2); + $$sroa$0120$0$in = $$sroa$0120$0; + } + $138 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 33579) | 0, 33262) | 0, 39072) | 0, 387) | 0, 39079) | 0, 33625) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $138 + (HEAP32[(HEAP32[$138 >> 2] | 0) + -12 >> 2] | 0) | 0); + $143 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $147 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$143 >> 2] | 0) + 28 >> 2] & 127]($143, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($138, $147) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($138) | 0; + _abort(); + } while (0); + __ZNSt3__213unordered_mapIiNS_6vectorIiNS_9allocatorIiEEEENS_4hashIiEENS_8equal_toIiEENS2_INS_4pairIKiS4_EEEEED2Ev($7); + STACKTOP = sp; + return; + } else if ((label | 0) == 12) { + $61 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 33378) | 0, 33262) | 0, 39072) | 0, 365) | 0, 39079) | 0, 33421) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $61 + (HEAP32[(HEAP32[$61 >> 2] | 0) + -12 >> 2] | 0) | 0); + $66 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $70 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$66 >> 2] | 0) + 28 >> 2] & 127]($66, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($61, $70) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($61) | 0; + _abort(); + } else if ((label | 0) == 14) { + $77 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 33443) | 0, 33262) | 0, 39072) | 0, 366) | 0, 39079) | 0, 33494) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $77 + (HEAP32[(HEAP32[$77 >> 2] | 0) + -12 >> 2] | 0) | 0); + $82 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $86 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$82 >> 2] | 0) + 28 >> 2] & 127]($82, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($77, $86) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($77) | 0; + _abort(); + } else if ((label | 0) == 16) { + $95 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 33518) | 0, 33262) | 0, 39072) | 0, 367) | 0, 39079) | 0, 33494) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $95 + (HEAP32[(HEAP32[$95 >> 2] | 0) + -12 >> 2] | 0) | 0); + $100 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $104 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$100 >> 2] | 0) + 28 >> 2] & 127]($100, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($95, $104) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($95) | 0; + _abort(); + } +} + +function _realize_virt_arrays($0) { + $0 = $0 | 0; + var $$$i = 0, $$$i108 = 0, $$0$i = 0, $$0101 = 0, $$0102$lcssa = 0, $$0102139 = 0, $$0104$lcssa = 0, $$0104138 = 0, $$0129 = 0, $$0132 = 0, $$04853$i = 0, $$04853$i116 = 0, $$04956$i = 0, $$04956$i110 = 0, $$054$i = 0, $$054$i115 = 0, $$099137 = 0, $$099140 = 0, $$1$lcssa$i = 0, $$1$lcssa$i119 = 0, $$1100125 = 0, $$1100126 = 0, $$1103 = 0, $$1105 = 0, $$1122 = 0, $$1123 = 0, $$15155$i = 0, $$15155$i111 = 0, $$152$i = 0, $$152$i117 = 0, $$2$lcssa = 0, $$2106$lcssa = 0, $$2106130 = 0, $$2131 = 0, $$3 = 0, $$3107 = 0, $$pre$phi151Z2D = 0, $$pre$phiZ2D = 0, $1 = 0, $10 = 0, $100 = 0, $103 = 0, $109 = 0, $110 = 0, $111 = 0, $12 = 0, $128 = 0, $132 = 0, $135 = 0, $140 = 0, $141 = 0, $143 = 0, $148 = 0, $149 = 0, $150 = 0, $151 = 0, $153 = 0, $157 = 0, $160 = 0, $162 = 0, $163 = 0, $165 = 0, $166 = 0, $168 = 0, $173 = 0, $174 = 0, $176 = 0, $181 = 0, $184 = 0, $19 = 0, $190 = 0, $191 = 0, $192 = 0, $2 = 0, $26 = 0, $29 = 0, $3 = 0, $40 = 0, $42 = 0, $45 = 0, $49 = 0, $52 = 0, $57 = 0, $58 = 0, $60 = 0, $64 = 0, $65 = 0, $66 = 0, $68 = 0, $72 = 0, $75 = 0, $77 = 0, $78 = 0, $80 = 0, $81 = 0, $83 = 0, $88 = 0, $92 = 0, $93 = 0, $95 = 0, $$15155$i$looptemp = 0, $$15155$i111$looptemp = 0; + $1 = $0 + 4 | 0; + $2 = HEAP32[$1 >> 2] | 0; + $3 = $2 + 68 | 0; + $$099137 = HEAP32[$3 >> 2] | 0; + if (!$$099137) { + $$0102$lcssa = 0; + $$0104$lcssa = 0; + } else { + $$0102139 = 0; + $$0104138 = 0; + $$099140 = $$099137; + while (1) { + if (!(HEAP32[$$099140 >> 2] | 0)) { + $10 = HEAP32[$$099140 + 8 >> 2] | 0; + $12 = (Math_imul($10, HEAP32[$$099140 + 12 >> 2] | 0) | 0) + $$0102139 | 0; + $$1103 = $12; + $$1105 = (Math_imul(HEAP32[$$099140 + 4 >> 2] | 0, $10) | 0) + $$0104138 | 0; + } else { + $$1103 = $$0102139; + $$1105 = $$0104138; + } + $$099140 = HEAP32[$$099140 + 44 >> 2] | 0; + if (!$$099140) { + $$0102$lcssa = $$1103; + $$0104$lcssa = $$1105; + break; + } else { + $$0102139 = $$1103; + $$0104138 = $$1105; + } + } + } + $19 = $2 + 72 | 0; + $$0129 = HEAP32[$19 >> 2] | 0; + if (!$$0129) { + $$2$lcssa = $$0102$lcssa; + $$2106$lcssa = $$0104$lcssa; + } else { + $$0132 = $$0129; + $$2106130 = $$0104$lcssa; + $$2131 = $$0102$lcssa; + while (1) { + if (!(HEAP32[$$0132 >> 2] | 0)) { + $26 = HEAP32[$$0132 + 8 >> 2] | 0; + $29 = (Math_imul(HEAP32[$$0132 + 12 >> 2] << 7, $26) | 0) + $$2131 | 0; + $$3 = $29; + $$3107 = (Math_imul($26 << 7, HEAP32[$$0132 + 4 >> 2] | 0) | 0) + $$2106130 | 0; + } else { + $$3 = $$2131; + $$3107 = $$2106130; + } + $$0132 = HEAP32[$$0132 + 44 >> 2] | 0; + if (!$$0132) { + $$2$lcssa = $$3; + $$2106$lcssa = $$3107; + break; + } else { + $$2106130 = $$3107; + $$2131 = $$3; + } + } + } + if (($$2$lcssa | 0) < 1) return; + $40 = _jpeg_mem_available($0, $$2$lcssa, $$2106$lcssa, HEAP32[$2 + 76 >> 2] | 0) | 0; + if (($40 | 0) < ($$2106$lcssa | 0)) { + $42 = ($40 | 0) / ($$2$lcssa | 0) | 0; + $$0101 = ($42 | 0) > 1 ? $42 : 1; + } else $$0101 = 1e9; + $$1100125 = HEAP32[$3 >> 2] | 0; + if ($$1100125 | 0) { + $45 = $2 + 80 | 0; + $$1100126 = $$1100125; + do { + if (!(HEAP32[$$1100126 >> 2] | 0)) { + $49 = HEAP32[$$1100126 + 4 >> 2] | 0; + $52 = HEAP32[$$1100126 + 12 >> 2] | 0; + if ((((($49 + -1 | 0) >>> 0) / ($52 >>> 0) | 0) + 1 | 0) > ($$0101 | 0)) { + $57 = Math_imul($52, $$0101) | 0; + $58 = $$1100126 + 16 | 0; + HEAP32[$58 >> 2] = $57; + $60 = $$1100126 + 8 | 0; + _jpeg_open_backing_store($0, $$1100126 + 48 | 0, Math_imul(HEAP32[$60 >> 2] | 0, $49) | 0); + HEAP32[$$1100126 + 40 >> 2] = 1; + $$pre$phi151Z2D = $60; + $72 = HEAP32[$58 >> 2] | 0; + } else { + HEAP32[$$1100126 + 16 >> 2] = $49; + $$pre$phi151Z2D = $$1100126 + 8 | 0; + $72 = $49; + } + $64 = HEAP32[$$pre$phi151Z2D >> 2] | 0; + $65 = HEAP32[$1 >> 2] | 0; + $66 = 999999984 / ($64 >>> 0) | 0; + if ($64 >>> 0 > 999999984) { + $68 = HEAP32[$0 >> 2] | 0; + HEAP32[$68 + 20 >> 2] = 72; + FUNCTION_TABLE_vi[HEAP32[$68 >> 2] & 255]($0); + } + $$$i = ($66 | 0) < ($72 | 0) ? $66 : $72; + HEAP32[$65 + 80 >> 2] = $$$i; + $75 = _alloc_small($0, 1, $72 << 2) | 0; + if ($72 | 0) { + $77 = ~$72; + $$04956$i = 0; + $$15155$i = $$$i; + while (1) { + $78 = $72 - $$04956$i | 0; + $$15155$i$looptemp = $$15155$i; + $$15155$i = $$15155$i >>> 0 < $78 >>> 0 ? $$15155$i : $78; + $80 = Math_imul($$15155$i, $64) | 0; + $81 = HEAP32[$1 >> 2] | 0; + if ($80 >>> 0 > 999999984) { + $83 = HEAP32[$0 >> 2] | 0; + HEAP32[$83 + 20 >> 2] = 56; + HEAP32[$83 + 24 >> 2] = 3; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $88 = $80 & 7; + $$0$i = (($88 | 0) == 0 ? 0 : 8 - $88 | 0) + $80 | 0; + $92 = $$0$i + 16 | 0; + $93 = _jpeg_get_large($0, $92) | 0; + if (!$93) { + $95 = HEAP32[$0 >> 2] | 0; + HEAP32[$95 + 20 >> 2] = 56; + HEAP32[$95 + 24 >> 2] = 4; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $100 = $81 + 76 | 0; + HEAP32[$100 >> 2] = (HEAP32[$100 >> 2] | 0) + $92; + $103 = $81 + 64 | 0; + HEAP32[$93 >> 2] = HEAP32[$103 >> 2]; + HEAP32[$93 + 4 >> 2] = $$0$i; + HEAP32[$93 + 8 >> 2] = 0; + HEAP32[$103 >> 2] = $93; + if (!$$15155$i) $$1$lcssa$i = $$04956$i; else { + $109 = $$04956$i + $77 | 0; + $110 = ~$$15155$i$looptemp; + $111 = $109 >>> 0 > $110 >>> 0; + $$04853$i = $$15155$i; + $$054$i = $93 + 16 | 0; + $$152$i = $$04956$i; + while (1) { + HEAP32[$75 + ($$152$i << 2) >> 2] = $$054$i; + $$04853$i = $$04853$i + -1 | 0; + if (!$$04853$i) break; else { + $$054$i = $$054$i + $64 | 0; + $$152$i = $$152$i + 1 | 0; + } + } + $$1$lcssa$i = $$04956$i + -1 - ($111 ? $109 : $110) | 0; + } + if ($$1$lcssa$i >>> 0 >= $72 >>> 0) break; else $$04956$i = $$1$lcssa$i; + } + } + HEAP32[$$1100126 >> 2] = $75; + HEAP32[$$1100126 + 20 >> 2] = HEAP32[$45 >> 2]; + HEAP32[$$1100126 + 24 >> 2] = 0; + HEAP32[$$1100126 + 28 >> 2] = 0; + HEAP32[$$1100126 + 36 >> 2] = 0; + } + $$1100126 = HEAP32[$$1100126 + 44 >> 2] | 0; + } while (($$1100126 | 0) != 0); + } + $$1122 = HEAP32[$19 >> 2] | 0; + if (!$$1122) return; + $128 = $2 + 80 | 0; + $$1123 = $$1122; + do { + if (!(HEAP32[$$1123 >> 2] | 0)) { + $132 = HEAP32[$$1123 + 4 >> 2] | 0; + $135 = HEAP32[$$1123 + 12 >> 2] | 0; + if ((((($132 + -1 | 0) >>> 0) / ($135 >>> 0) | 0) + 1 | 0) > ($$0101 | 0)) { + $140 = Math_imul($135, $$0101) | 0; + $141 = $$1123 + 16 | 0; + HEAP32[$141 >> 2] = $140; + $143 = $$1123 + 8 | 0; + _jpeg_open_backing_store($0, $$1123 + 48 | 0, Math_imul($132 << 7, HEAP32[$143 >> 2] | 0) | 0); + HEAP32[$$1123 + 40 >> 2] = 1; + $$pre$phiZ2D = $143; + $157 = HEAP32[$141 >> 2] | 0; + } else { + HEAP32[$$1123 + 16 >> 2] = $132; + $$pre$phiZ2D = $$1123 + 8 | 0; + $157 = $132; + } + $148 = HEAP32[$$pre$phiZ2D >> 2] | 0; + $149 = HEAP32[$1 >> 2] | 0; + $150 = $148 << 7; + $151 = 999999984 / ($150 >>> 0) | 0; + if ($150 >>> 0 > 999999984) { + $153 = HEAP32[$0 >> 2] | 0; + HEAP32[$153 + 20 >> 2] = 72; + FUNCTION_TABLE_vi[HEAP32[$153 >> 2] & 255]($0); + } + $$$i108 = ($151 | 0) < ($157 | 0) ? $151 : $157; + HEAP32[$149 + 80 >> 2] = $$$i108; + $160 = _alloc_small($0, 1, $157 << 2) | 0; + if ($157 | 0) { + $162 = ~$157; + $$04956$i110 = 0; + $$15155$i111 = $$$i108; + while (1) { + $163 = $157 - $$04956$i110 | 0; + $$15155$i111$looptemp = $$15155$i111; + $$15155$i111 = $$15155$i111 >>> 0 < $163 >>> 0 ? $$15155$i111 : $163; + $165 = Math_imul($$15155$i111, $150) | 0; + $166 = HEAP32[$1 >> 2] | 0; + if ($165 >>> 0 > 999999984) { + $168 = HEAP32[$0 >> 2] | 0; + HEAP32[$168 + 20 >> 2] = 56; + HEAP32[$168 + 24 >> 2] = 3; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $173 = $165 | 16; + $174 = _jpeg_get_large($0, $173) | 0; + if (!$174) { + $176 = HEAP32[$0 >> 2] | 0; + HEAP32[$176 + 20 >> 2] = 56; + HEAP32[$176 + 24 >> 2] = 4; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $181 = $166 + 76 | 0; + HEAP32[$181 >> 2] = (HEAP32[$181 >> 2] | 0) + $173; + $184 = $166 + 64 | 0; + HEAP32[$174 >> 2] = HEAP32[$184 >> 2]; + HEAP32[$174 + 4 >> 2] = $165; + HEAP32[$174 + 8 >> 2] = 0; + HEAP32[$184 >> 2] = $174; + if (!$$15155$i111) $$1$lcssa$i119 = $$04956$i110; else { + $190 = $$04956$i110 + $162 | 0; + $191 = ~$$15155$i111$looptemp; + $192 = $190 >>> 0 > $191 >>> 0; + $$04853$i116 = $$15155$i111; + $$054$i115 = $174 + 16 | 0; + $$152$i117 = $$04956$i110; + while (1) { + HEAP32[$160 + ($$152$i117 << 2) >> 2] = $$054$i115; + $$04853$i116 = $$04853$i116 + -1 | 0; + if (!$$04853$i116) break; else { + $$054$i115 = $$054$i115 + ($148 << 7) | 0; + $$152$i117 = $$152$i117 + 1 | 0; + } + } + $$1$lcssa$i119 = $$04956$i110 + -1 - ($192 ? $190 : $191) | 0; + } + if ($$1$lcssa$i119 >>> 0 >= $157 >>> 0) break; else $$04956$i110 = $$1$lcssa$i119; + } + } + HEAP32[$$1123 >> 2] = $160; + HEAP32[$$1123 + 20 >> 2] = HEAP32[$128 >> 2]; + HEAP32[$$1123 + 24 >> 2] = 0; + HEAP32[$$1123 + 28 >> 2] = 0; + HEAP32[$$1123 + 36 >> 2] = 0; + } + $$1123 = HEAP32[$$1123 + 44 >> 2] | 0; + } while (($$1123 | 0) != 0); + return; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i53 = 0, $$0$i$i$i$i68 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i59 = 0, $$0$i$i2$i$i74 = 0, $$0$i$i65 = 0, $$0$pn = 0, $$049 = 0, $$050 = 0, $$3 = 0, $$3$lcssa = 0, $$4 = 0, $$byval_copy = 0, $$byval_copy1 = 0, $$ph = 0, $$sroa$047$0$copyload = 0, $10 = 0, $107 = 0, $109 = 0, $11 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $14 = 0, $141 = 0, $149 = 0, $15 = 0, $150 = 0, $151 = 0, $152 = 0, $165 = 0, $17 = 0, $172 = 0, $182 = 0, $184 = 0, $19 = 0, $196 = 0, $199 = 0, $213 = 0, $214 = 0, $215 = 0, $216 = 0, $217 = 0, $31 = 0, $33 = 0, $35 = 0, $53 = 0, $59 = 0, $60 = 0, $69 = 0, $70 = 0, $71 = 0, $72 = 0, $74 = 0, $75 = 0, $78 = 0, $8 = 0, $84 = 0, $9 = 0, $92 = 0, $94 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $8 = sp + 4 | 0; + $9 = sp; + __ZNKSt3__28ios_base6getlocEv($$byval_copy1, $3); + $10 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy1, 66512) | 0; + __ZNSt3__26localeD2Ev($$byval_copy1); + HEAP32[$4 >> 2] = 0; + $11 = $10 + 8 | 0; + $$0 = $6; + $14 = 0; + L1 : while (1) { + $15 = HEAP32[$1 >> 2] | 0; + if (!(($$0 | 0) != ($7 | 0) & ($14 | 0) == 0)) { + $182 = $15; + break; + } + $17 = $15; + if ($15) { + $19 = HEAP32[$15 + 12 >> 2] | 0; + if (($19 | 0) == (HEAP32[$15 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$15 >> 2] | 0) + 36 >> 2] & 127]($15) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$19 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $150 = 0; + $213 = 1; + $70 = 0; + } else { + $150 = $15; + $213 = 0; + $70 = $17; + } + } else { + $150 = 0; + $213 = 1; + $70 = $17; + } + $31 = HEAP32[$2 >> 2] | 0; + $33 = $31; + do if ($31) { + $35 = HEAP32[$31 + 12 >> 2] | 0; + if (($35 | 0) == (HEAP32[$31 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$31 >> 2] | 0) + 36 >> 2] & 127]($31) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$35 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($213) { + $214 = $31; + $71 = $33; + break; + } else { + label = 63; + break L1; + } else { + HEAP32[$2 >> 2] = 0; + $$ph = 0; + label = 15; + break; + } + } else { + $$ph = $33; + label = 15; + } while (0); + if ((label | 0) == 15) { + label = 0; + if ($213) { + label = 63; + break; + } else { + $214 = 0; + $71 = $$ph; + } + } + L24 : do if ((FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$10 >> 2] | 0) + 36 >> 2] & 63]($10, HEAP8[$$0 >> 0] | 0, 0) | 0) << 24 >> 24 == 37) { + $53 = $$0 + 1 | 0; + if (($53 | 0) == ($7 | 0)) { + label = 63; + break L1; + } + $59 = FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$10 >> 2] | 0) + 36 >> 2] & 63]($10, HEAP8[$53 >> 0] | 0, 0) | 0; + switch ($59 << 24 >> 24) { + case 48: + case 69: + { + $60 = $$0 + 2 | 0; + if (($60 | 0) == ($7 | 0)) { + label = 63; + break L1; + } + $$049 = $59; + $$050 = FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$10 >> 2] | 0) + 36 >> 2] & 63]($10, HEAP8[$60 >> 0] | 0, 0) | 0; + $74 = $53; + break; + } + default: + { + $$049 = 0; + $$050 = $59; + $74 = $$0; + } + } + $69 = HEAP32[(HEAP32[$0 >> 2] | 0) + 36 >> 2] | 0; + HEAP32[$8 >> 2] = $70; + HEAP32[$9 >> 2] = $71; + HEAP32[$$byval_copy >> 2] = HEAP32[$8 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$9 >> 2]; + $72 = FUNCTION_TABLE_iiiiiiiii[$69 & 15]($0, $$byval_copy, $$byval_copy1, $3, $4, $5, $$050, $$049) | 0; + HEAP32[$1 >> 2] = $72; + $$4 = $74 + 2 | 0; + } else { + $75 = HEAP8[$$0 >> 0] | 0; + if ($75 << 24 >> 24 > -1 ? ($78 = HEAP32[$11 >> 2] | 0, HEAP16[$78 + ($75 << 24 >> 24 << 1) >> 1] & 8192) : 0) { + $$0$pn = $$0; + while (1) { + $$3 = $$0$pn + 1 | 0; + if (($$3 | 0) == ($7 | 0)) { + $$3$lcssa = $7; + break; + } + $84 = HEAP8[$$3 >> 0] | 0; + if ($84 << 24 >> 24 <= -1) { + $$3$lcssa = $$3; + break; + } + if (!(HEAP16[$78 + ($84 << 24 >> 24 << 1) >> 1] & 8192)) { + $$3$lcssa = $$3; + break; + } else $$0$pn = $$3; + } + $107 = $214; + $92 = $150; + while (1) { + if ($92) { + $94 = HEAP32[$92 + 12 >> 2] | 0; + if (($94 | 0) == (HEAP32[$92 + 16 >> 2] | 0)) $$0$i$i$i$i53 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$92 >> 2] | 0) + 36 >> 2] & 127]($92) | 0; else $$0$i$i$i$i53 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$94 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i53, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $122 = 0; + $215 = 1; + } else { + $122 = $92; + $215 = 0; + } + } else { + $122 = 0; + $215 = 1; + } + do if ($107) { + $109 = HEAP32[$107 + 12 >> 2] | 0; + if (($109 | 0) == (HEAP32[$107 + 16 >> 2] | 0)) $$0$i$i2$i$i59 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$107 >> 2] | 0) + 36 >> 2] & 127]($107) | 0; else $$0$i$i2$i$i59 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$109 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i59, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($215) { + $216 = $107; + break; + } else { + $$4 = $$3$lcssa; + break L24; + } else { + HEAP32[$2 >> 2] = 0; + label = 42; + break; + } + } else label = 42; while (0); + if ((label | 0) == 42) { + label = 0; + if ($215) { + $$4 = $$3$lcssa; + break L24; + } else $216 = 0; + } + $121 = $122 + 12 | 0; + $123 = HEAP32[$121 >> 2] | 0; + $124 = $122 + 16 | 0; + if (($123 | 0) == (HEAP32[$124 >> 2] | 0)) $$0$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$122 >> 2] | 0) + 36 >> 2] & 127]($122) | 0; else $$0$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$123 >> 0] | 0) | 0; + if (($$0$i$i & 255) << 24 >> 24 <= -1) { + $$4 = $$3$lcssa; + break L24; + } + if (!(HEAP16[(HEAP32[$11 >> 2] | 0) + ($$0$i$i << 24 >> 24 << 1) >> 1] & 8192)) { + $$4 = $$3$lcssa; + break L24; + } + $141 = HEAP32[$121 >> 2] | 0; + if (($141 | 0) == (HEAP32[$124 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$122 >> 2] | 0) + 40 >> 2] & 127]($122) | 0; else { + HEAP32[$121 >> 2] = $141 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$141 >> 0] | 0) | 0; + } + $107 = $216; + $92 = $122; + } + } + $149 = $150 + 12 | 0; + $151 = HEAP32[$149 >> 2] | 0; + $152 = $150 + 16 | 0; + if (($151 | 0) == (HEAP32[$152 >> 2] | 0)) $$0$i$i65 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$150 >> 2] | 0) + 36 >> 2] & 127]($150) | 0; else $$0$i$i65 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$151 >> 0] | 0) | 0; + $165 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$10 >> 2] | 0) + 12 >> 2] & 127]($10, $$0$i$i65 & 255) | 0; + if ($165 << 24 >> 24 != (FUNCTION_TABLE_iii[HEAP32[(HEAP32[$10 >> 2] | 0) + 12 >> 2] & 127]($10, HEAP8[$$0 >> 0] | 0) | 0) << 24 >> 24) { + HEAP32[$4 >> 2] = 4; + $$4 = $$0; + break; + } + $172 = HEAP32[$149 >> 2] | 0; + if (($172 | 0) == (HEAP32[$152 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$150 >> 2] | 0) + 40 >> 2] & 127]($150) | 0; else { + HEAP32[$149 >> 2] = $172 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$172 >> 0] | 0) | 0; + } + $$4 = $$0 + 1 | 0; + } while (0); + $$0 = $$4; + $14 = HEAP32[$4 >> 2] | 0; + } + if ((label | 0) == 63) { + HEAP32[$4 >> 2] = 4; + $182 = $150; + } + if ($182) { + $184 = HEAP32[$182 + 12 >> 2] | 0; + if (($184 | 0) == (HEAP32[$182 + 16 >> 2] | 0)) $$0$i$i$i$i68 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$182 >> 2] | 0) + 36 >> 2] & 127]($182) | 0; else $$0$i$i$i$i68 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$184 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i68, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $$sroa$047$0$copyload = 0; + $217 = 1; + } else { + $$sroa$047$0$copyload = $182; + $217 = 0; + } + } else { + $$sroa$047$0$copyload = 0; + $217 = 1; + } + $196 = HEAP32[$2 >> 2] | 0; + do if ($196) { + $199 = HEAP32[$196 + 12 >> 2] | 0; + if (($199 | 0) == (HEAP32[$196 + 16 >> 2] | 0)) $$0$i$i2$i$i74 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$196 >> 2] | 0) + 36 >> 2] & 127]($196) | 0; else $$0$i$i2$i$i74 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$199 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i74, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($217) break; else { + label = 78; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 76; + break; + } + } else label = 76; while (0); + if ((label | 0) == 76 ? $217 : 0) label = 78; + if ((label | 0) == 78) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + STACKTOP = sp; + return $$sroa$047$0$copyload | 0; +} + +function __ZNK6vision21HoughSimilarityVoting16getBinsFromIndexERiS1_S1_S1_i($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$neg31 = 0, $10 = 0, $104 = 0, $108 = 0, $109 = 0, $116 = 0, $121 = 0, $125 = 0, $13 = 0, $134 = 0, $139 = 0, $143 = 0, $15 = 0, $150 = 0, $155 = 0, $159 = 0, $168 = 0, $173 = 0, $177 = 0, $22 = 0, $27 = 0, $31 = 0, $37 = 0, $39 = 0, $40 = 0, $47 = 0, $52 = 0, $56 = 0, $6 = 0, $64 = 0, $69 = 0, $7 = 0, $73 = 0, $74 = 0, $81 = 0, $86 = 0, $90 = 0, $99 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $6 = sp; + $7 = $0 + 88 | 0; + $10 = $0 + 84 | 0; + $13 = $0 + 52 | 0; + $15 = ((($5 | 0) % (HEAP32[$7 >> 2] | 0) | 0 | 0) % (HEAP32[$10 >> 2] | 0) | 0 | 0) % (HEAP32[$13 >> 2] | 0) | 0; + HEAP32[$1 >> 2] = $15; + $22 = ((($5 - $15 | 0) % (HEAP32[$7 >> 2] | 0) | 0 | 0) % (HEAP32[$10 >> 2] | 0) | 0 | 0) / (HEAP32[$13 >> 2] | 0) | 0; + HEAP32[$2 >> 2] = $22; + $27 = $5 - (HEAP32[$1 >> 2] | 0) - (Math_imul(HEAP32[$13 >> 2] | 0, $22) | 0) | 0; + $31 = (($27 | 0) % (HEAP32[$7 >> 2] | 0) | 0 | 0) / (HEAP32[$10 >> 2] | 0) | 0; + HEAP32[$3 >> 2] = $31; + $$neg31 = Math_imul(HEAP32[$13 >> 2] | 0, HEAP32[$2 >> 2] | 0) | 0; + $37 = $5 - (HEAP32[$1 >> 2] | 0) - ((Math_imul(HEAP32[$10 >> 2] | 0, $31) | 0) + $$neg31) | 0; + $39 = ($37 | 0) / (HEAP32[$7 >> 2] | 0) | 0; + HEAP32[$4 >> 2] = $39; + $40 = HEAP32[$1 >> 2] | 0; + if (($40 | 0) <= -1) { + $47 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36688) | 0, 36227) | 0, 39072) | 0, 190) | 0, 39079) | 0, 36721) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $47 + (HEAP32[(HEAP32[$47 >> 2] | 0) + -12 >> 2] | 0) | 0); + $52 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $56 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$52 >> 2] | 0) + 28 >> 2] & 127]($52, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($47, $56) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($47) | 0; + _abort(); + } + if (($40 | 0) >= (HEAP32[$13 >> 2] | 0)) { + $64 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36739) | 0, 36227) | 0, 39072) | 0, 191) | 0, 39079) | 0, 36721) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $64 + (HEAP32[(HEAP32[$64 >> 2] | 0) + -12 >> 2] | 0) | 0); + $69 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $73 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$69 >> 2] | 0) + 28 >> 2] & 127]($69, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($64, $73) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($64) | 0; + _abort(); + } + $74 = HEAP32[$2 >> 2] | 0; + if (($74 | 0) <= -1) { + $81 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36779) | 0, 36227) | 0, 39072) | 0, 192) | 0, 39079) | 0, 36812) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $81 + (HEAP32[(HEAP32[$81 >> 2] | 0) + -12 >> 2] | 0) | 0); + $86 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $90 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$86 >> 2] | 0) + 28 >> 2] & 127]($86, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($81, $90) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($81) | 0; + _abort(); + } + if (($74 | 0) >= (HEAP32[$0 + 56 >> 2] | 0)) { + $99 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36830) | 0, 36227) | 0, 39072) | 0, 193) | 0, 39079) | 0, 36812) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $99 + (HEAP32[(HEAP32[$99 >> 2] | 0) + -12 >> 2] | 0) | 0); + $104 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $108 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$104 >> 2] | 0) + 28 >> 2] & 127]($104, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($99, $108) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($99) | 0; + _abort(); + } + $109 = HEAP32[$3 >> 2] | 0; + if (($109 | 0) <= -1) { + $116 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36870) | 0, 36227) | 0, 39072) | 0, 194) | 0, 39079) | 0, 36907) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $116 + (HEAP32[(HEAP32[$116 >> 2] | 0) + -12 >> 2] | 0) | 0); + $121 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $125 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$121 >> 2] | 0) + 28 >> 2] & 127]($121, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($116, $125) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($116) | 0; + _abort(); + } + if (($109 | 0) >= (HEAP32[$0 + 60 >> 2] | 0)) { + $134 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36929) | 0, 36227) | 0, 39072) | 0, 195) | 0, 39079) | 0, 36907) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $134 + (HEAP32[(HEAP32[$134 >> 2] | 0) + -12 >> 2] | 0) | 0); + $139 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $143 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$139 >> 2] | 0) + 28 >> 2] & 127]($139, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($134, $143) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($134) | 0; + _abort(); + } + if (($39 | 0) <= -1) { + $150 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36977) | 0, 36227) | 0, 39072) | 0, 196) | 0, 39079) | 0, 37014) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $150 + (HEAP32[(HEAP32[$150 >> 2] | 0) + -12 >> 2] | 0) | 0); + $155 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $159 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$155 >> 2] | 0) + 28 >> 2] & 127]($155, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($150, $159) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($150) | 0; + _abort(); + } + if (($39 | 0) < (HEAP32[$0 + 64 >> 2] | 0)) { + STACKTOP = sp; + return; + } else { + $168 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 37036) | 0, 36227) | 0, 39072) | 0, 197) | 0, 39079) | 0, 37014) | 0; + __ZNKSt3__28ios_base6getlocEv($6, $168 + (HEAP32[(HEAP32[$168 >> 2] | 0) + -12 >> 2] | 0) | 0); + $173 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $177 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$173 >> 2] | 0) + 28 >> 2] & 127]($173, 10) | 0; + __ZNSt3__26localeD2Ev($6); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($168, $177) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($168) | 0; + _abort(); + } +} + +function _hexfloat($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0$be = 0, $$0$ph = 0, $$0133 = 0, $$0143 = 0, $$0151 = 0, $$0154 = 0.0, $$0155 = 0.0, $$0158 = 0.0, $$0163 = 0, $$0169 = 0.0, $$0170 = 0, $$0170173 = 0, $$0170174 = 0, $$1149 = 0, $$1149$ph = 0, $$1152 = 0, $$1156 = 0.0, $$1159 = 0.0, $$1164 = 0, $$2150 = 0, $$2153 = 0, $$2157 = 0.0, $$2160 = 0.0, $$2165 = 0, $$3 = 0, $$3$be = 0, $$3$lcssa = 0, $$3$ph = 0, $$3146 = 0, $$3146$ph = 0, $$3161$lcssa = 0.0, $$3161181 = 0.0, $$3166$lcssa = 0, $$3166185 = 0, $$4147 = 0, $$4162 = 0.0, $$4167$lcssa = 0, $$4167180 = 0, $$5168 = 0, $$pre = 0, $$pre$phi204Z2D = 0.0, $105 = 0, $106 = 0, $107 = 0, $117 = 0, $118 = 0, $131 = 0, $133 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $14 = 0, $142 = 0, $144 = 0, $150 = 0, $154 = 0, $156 = 0, $162 = 0, $167 = 0, $171 = 0, $172 = 0, $173 = 0, $174 = 0, $177 = 0, $180 = 0, $182 = 0, $183 = 0, $184 = 0, $185 = 0, $194 = 0.0, $195 = 0, $208 = 0.0, $21 = 0, $210 = 0, $212 = 0, $213 = 0, $214 = 0, $215 = 0, $216 = 0, $217 = 0, $29 = 0, $30 = 0, $37 = 0, $38 = 0, $39 = 0, $40 = 0, $42 = 0, $43 = 0, $47 = 0, $5 = 0, $52 = 0, $54 = 0, $6 = 0, $66 = 0.0, $7 = 0, $73 = 0, $75 = 0, $84 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $or$cond = 0, $or$cond172 = 0, label = 0, $106$looptemp = 0, $107$looptemp = 0; + $5 = $0 + 4 | 0; + $6 = HEAP32[$5 >> 2] | 0; + $7 = $0 + 104 | 0; + if ($6 >>> 0 < (HEAP32[$7 >> 2] | 0) >>> 0) { + HEAP32[$5 >> 2] = $6 + 1; + $$0$ph = HEAPU8[$6 >> 0] | 0; + } else $$0$ph = ___shgetc($0) | 0; + $$0 = $$0$ph; + $$0143 = 0; + L5 : while (1) { + switch ($$0 | 0) { + case 46: + { + label = 10; + break L5; + break; + } + case 48: + break; + default: + { + $$1149$ph = 0; + $$3$ph = $$0; + $$3146$ph = $$0143; + $212 = 0; + $213 = 0; + break L5; + } + } + $14 = HEAP32[$5 >> 2] | 0; + if ($14 >>> 0 < (HEAP32[$7 >> 2] | 0) >>> 0) { + HEAP32[$5 >> 2] = $14 + 1; + $$0$be = HEAPU8[$14 >> 0] | 0; + } else $$0$be = ___shgetc($0) | 0; + $$0 = $$0$be; + $$0143 = 1; + } + if ((label | 0) == 10) { + $21 = HEAP32[$5 >> 2] | 0; + if ($21 >>> 0 < (HEAP32[$7 >> 2] | 0) >>> 0) { + HEAP32[$5 >> 2] = $21 + 1; + $29 = HEAPU8[$21 >> 0] | 0; + } else $29 = ___shgetc($0) | 0; + if (($29 | 0) == 48) { + $37 = 0; + $38 = 0; + while (1) { + $30 = HEAP32[$5 >> 2] | 0; + if ($30 >>> 0 < (HEAP32[$7 >> 2] | 0) >>> 0) { + HEAP32[$5 >> 2] = $30 + 1; + $42 = HEAPU8[$30 >> 0] | 0; + } else $42 = ___shgetc($0) | 0; + $39 = _i64Add($37 | 0, $38 | 0, -1, -1) | 0; + $40 = getTempRet0() | 0; + if (($42 | 0) == 48) { + $37 = $39; + $38 = $40; + } else { + $$1149$ph = 1; + $$3$ph = $42; + $$3146$ph = 1; + $212 = $39; + $213 = $40; + break; + } + } + } else { + $$1149$ph = 1; + $$3$ph = $29; + $$3146$ph = $$0143; + $212 = 0; + $213 = 0; + } + } + $$0151 = 0; + $$0155 = 1.0; + $$0158 = 0.0; + $$0163 = 0; + $$1149 = $$1149$ph; + $$3 = $$3$ph; + $$3146 = $$3146$ph; + $52 = 0; + $54 = 0; + $97 = $212; + $99 = $213; + while (1) { + $43 = $$3 + -48 | 0; + $$pre = $$3 | 32; + if ($43 >>> 0 >= 10) { + $47 = ($$3 | 0) == 46; + if (!($47 | ($$pre + -97 | 0) >>> 0 < 6)) { + $$3$lcssa = $$3; + break; + } + if ($47) if (!$$1149) { + $$2150 = 1; + $$2153 = $$0151; + $$2157 = $$0155; + $$2160 = $$0158; + $$2165 = $$0163; + $$4147 = $$3146; + $214 = $54; + $215 = $52; + $216 = $54; + $217 = $52; + } else { + $$3$lcssa = 46; + break; + } else label = 24; + } else label = 24; + if ((label | 0) == 24) { + label = 0; + $$0133 = ($$3 | 0) > 57 ? $$pre + -87 | 0 : $43; + do if (!(($52 | 0) < 0 | ($52 | 0) == 0 & $54 >>> 0 < 8)) if (($52 | 0) < 0 | ($52 | 0) == 0 & $54 >>> 0 < 14) { + $66 = $$0155 * .0625; + $$1152 = $$0151; + $$1156 = $66; + $$1159 = $$0158 + $66 * +($$0133 | 0); + $$1164 = $$0163; + break; + } else { + $or$cond = ($$0151 | 0) != 0 | ($$0133 | 0) == 0; + $$1152 = $or$cond ? $$0151 : 1; + $$1156 = $$0155; + $$1159 = $or$cond ? $$0158 : $$0158 + $$0155 * .5; + $$1164 = $$0163; + break; + } else { + $$1152 = $$0151; + $$1156 = $$0155; + $$1159 = $$0158; + $$1164 = $$0133 + ($$0163 << 4) | 0; + } while (0); + $73 = _i64Add($54 | 0, $52 | 0, 1, 0) | 0; + $$2150 = $$1149; + $$2153 = $$1152; + $$2157 = $$1156; + $$2160 = $$1159; + $$2165 = $$1164; + $$4147 = 1; + $214 = $97; + $215 = $99; + $216 = $73; + $217 = getTempRet0() | 0; + } + $75 = HEAP32[$5 >> 2] | 0; + if ($75 >>> 0 < (HEAP32[$7 >> 2] | 0) >>> 0) { + HEAP32[$5 >> 2] = $75 + 1; + $$3$be = HEAPU8[$75 >> 0] | 0; + } else $$3$be = ___shgetc($0) | 0; + $$0151 = $$2153; + $$0155 = $$2157; + $$0158 = $$2160; + $$0163 = $$2165; + $$1149 = $$2150; + $$3 = $$3$be; + $$3146 = $$4147; + $52 = $217; + $54 = $216; + $97 = $214; + $99 = $215; + } + do if (!$$3146) { + $84 = (HEAP32[$7 >> 2] | 0) == 0; + if (!$84) HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + -1; + if ($4) { + if (!$84 ? (HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + -1, !(($$1149 | 0) == 0 | $84)) : 0) HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + -1; + } else ___shlim($0, 0, 0); + $$0169 = +($3 | 0) * 0.0; + } else { + $95 = ($$1149 | 0) == 0; + $96 = $95 ? $54 : $97; + $98 = $95 ? $52 : $99; + if (($52 | 0) < 0 | ($52 | 0) == 0 & $54 >>> 0 < 8) { + $$3166185 = $$0163; + $106 = $54; + $107 = $52; + while (1) { + $105 = $$3166185 << 4; + $106$looptemp = $106; + $106 = _i64Add($106 | 0, $107 | 0, 1, 0) | 0; + $107$looptemp = $107; + $107 = getTempRet0() | 0; + if (!(($107$looptemp | 0) < 0 | ($107$looptemp | 0) == 0 & $106$looptemp >>> 0 < 7)) { + $$3166$lcssa = $105; + break; + } else $$3166185 = $105; + } + } else $$3166$lcssa = $$0163; + if (($$3$lcssa | 32 | 0) == 112) { + $117 = _scanexp($0, $4) | 0; + $118 = getTempRet0() | 0; + if (($117 | 0) == 0 & ($118 | 0) == -2147483648) { + if (!$4) { + ___shlim($0, 0, 0); + $$0169 = 0.0; + break; + } + if (!(HEAP32[$7 >> 2] | 0)) { + $135 = 0; + $136 = 0; + } else { + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + -1; + $135 = 0; + $136 = 0; + } + } else { + $135 = $117; + $136 = $118; + } + } else if (!(HEAP32[$7 >> 2] | 0)) { + $135 = 0; + $136 = 0; + } else { + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + -1; + $135 = 0; + $136 = 0; + } + $131 = _bitshift64Shl($96 | 0, $98 | 0, 2) | 0; + $133 = _i64Add($131 | 0, getTempRet0() | 0, -32, -1) | 0; + $137 = _i64Add($133 | 0, getTempRet0() | 0, $135 | 0, $136 | 0) | 0; + $138 = getTempRet0() | 0; + if (!$$3166$lcssa) { + $$0169 = +($3 | 0) * 0.0; + break; + } + $142 = 0 - $2 | 0; + $144 = (($142 | 0) < 0) << 31 >> 31; + if (($138 | 0) > ($144 | 0) | ($138 | 0) == ($144 | 0) & $137 >>> 0 > $142 >>> 0) { + $150 = ___errno_location() | 0; + HEAP32[$150 >> 2] = 68; + $$0169 = +($3 | 0) * 1797693134862315708145274.0e284 * 1797693134862315708145274.0e284; + break; + } + $154 = $2 + -106 | 0; + $156 = (($154 | 0) < 0) << 31 >> 31; + if (($138 | 0) < ($156 | 0) | ($138 | 0) == ($156 | 0) & $137 >>> 0 < $154 >>> 0) { + $162 = ___errno_location() | 0; + HEAP32[$162 >> 2] = 68; + $$0169 = +($3 | 0) * 2.2250738585072014e-308 * 2.2250738585072014e-308; + break; + } + if (($$3166$lcssa | 0) > -1) { + $$3161181 = $$0158; + $$4167180 = $$3166$lcssa; + $171 = $137; + $172 = $138; + while (1) { + $167 = !($$3161181 >= .5); + $$5168 = $$4167180 << 1 | ($167 ^ 1) & 1; + $$4162 = $$3161181 + ($167 ? $$3161181 : $$3161181 + -1.0); + $173 = _i64Add($171 | 0, $172 | 0, -1, -1) | 0; + $174 = getTempRet0() | 0; + if (($$5168 | 0) > -1) { + $$3161181 = $$4162; + $$4167180 = $$5168; + $171 = $173; + $172 = $174; + } else { + $$3161$lcssa = $$4162; + $$4167$lcssa = $$5168; + $182 = $173; + $183 = $174; + break; + } + } + } else { + $$3161$lcssa = $$0158; + $$4167$lcssa = $$3166$lcssa; + $182 = $137; + $183 = $138; + } + $177 = (($1 | 0) < 0) << 31 >> 31; + $180 = _i64Subtract(32, 0, $2 | 0, (($2 | 0) < 0) << 31 >> 31 | 0) | 0; + $184 = _i64Add($180 | 0, getTempRet0() | 0, $182 | 0, $183 | 0) | 0; + $185 = getTempRet0() | 0; + if (($185 | 0) < ($177 | 0) | ($185 | 0) == ($177 | 0) & $184 >>> 0 < $1 >>> 0) if (($184 | 0) > 0) { + $$0170 = $184; + label = 65; + } else { + $$0170174 = 0; + $195 = 84; + label = 67; + } else { + $$0170 = $1; + label = 65; + } + if ((label | 0) == 65) if (($$0170 | 0) < 53) { + $$0170174 = $$0170; + $195 = 84 - $$0170 | 0; + label = 67; + } else { + $$0154 = 0.0; + $$0170173 = $$0170; + $$pre$phi204Z2D = +($3 | 0); + } + if ((label | 0) == 67) { + $194 = +($3 | 0); + $$0154 = +_copysignl(+_scalbn(1.0, $195), $194); + $$0170173 = $$0170174; + $$pre$phi204Z2D = $194; + } + $or$cond172 = ($$4167$lcssa & 1 | 0) == 0 & ($$3161$lcssa != 0.0 & ($$0170173 | 0) < 32); + $208 = ($or$cond172 ? 0.0 : $$3161$lcssa) * $$pre$phi204Z2D + ($$0154 + $$pre$phi204Z2D * +(($$4167$lcssa + ($or$cond172 & 1) | 0) >>> 0)) - $$0154; + if (!($208 != 0.0)) { + $210 = ___errno_location() | 0; + HEAP32[$210 >> 2] = 68; + } + $$0169 = +_scalbnl($208, $182); + } while (0); + return +$$0169; +} + +function __ZN6vision38ComputeSubpixelHessianCoarseOctavePairEPfS0_RKNS_5ImageES3_S3_ii($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $10 = 0, $101 = 0, $106 = 0, $11 = 0, $110 = 0, $112 = 0, $12 = 0, $120 = 0, $125 = 0, $129 = 0, $13 = 0, $131 = 0, $133 = 0, $135 = 0, $137 = 0, $14 = 0, $142 = 0.0, $143 = 0.0, $149 = 0.0, $153 = 0.0, $156 = 0.0, $160 = 0.0, $165 = 0.0, $169 = 0.0, $171 = 0.0, $175 = 0.0, $179 = 0.0, $181 = 0, $24 = 0, $29 = 0, $33 = 0, $34 = 0, $36 = 0, $44 = 0, $49 = 0, $53 = 0, $55 = 0, $63 = 0, $68 = 0, $7 = 0, $72 = 0, $74 = 0, $8 = 0, $82 = 0, $87 = 0, $9 = 0, $91 = 0, $93 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $7 = sp + 28 | 0; + $8 = sp + 24 | 0; + $9 = sp + 20 | 0; + $10 = sp + 16 | 0; + $11 = sp + 12 | 0; + $12 = sp + 8 | 0; + $13 = sp + 4 | 0; + $14 = sp; + if (($5 | 0) > 0 ? ($5 + 1 | 0) >>> 0 < (__ZNK6vision5Image5widthEv($3) | 0) >>> 0 : 0) { + $34 = $6 + -1 | 0; + if (($6 | 0) > 0 ? ($36 = $6 + 1 | 0, $36 >>> 0 < (__ZNK6vision5Image6heightEv($3) | 0) >>> 0) : 0) { + $55 = (__ZNK6vision5Image5widthEv($2) | 0) >>> 1; + if (($55 | 0) != (__ZNK6vision5Image5widthEv($3) | 0)) { + $63 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29093) | 0, 28600) | 0, 39072) | 0, 361) | 0, 39079) | 0, 29150) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $63 + (HEAP32[(HEAP32[$63 >> 2] | 0) + -12 >> 2] | 0) | 0); + $68 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $72 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$68 >> 2] | 0) + 28 >> 2] & 127]($68, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($63, $72) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($63) | 0; + _abort(); + } + $74 = (__ZNK6vision5Image5widthEv($2) | 0) >>> 1; + if (($74 | 0) != (__ZNK6vision5Image5widthEv($4) | 0)) { + $82 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29180) | 0, 28600) | 0, 39072) | 0, 362) | 0, 39079) | 0, 29150) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $82 + (HEAP32[(HEAP32[$82 >> 2] | 0) + -12 >> 2] | 0) | 0); + $87 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $91 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$87 >> 2] | 0) + 28 >> 2] & 127]($87, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($82, $91) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($82) | 0; + _abort(); + } + $93 = (__ZNK6vision5Image6heightEv($2) | 0) >>> 1; + if (($93 | 0) != (__ZNK6vision5Image6heightEv($3) | 0)) { + $101 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29237) | 0, 28600) | 0, 39072) | 0, 363) | 0, 39079) | 0, 29150) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $101 + (HEAP32[(HEAP32[$101 >> 2] | 0) + -12 >> 2] | 0) | 0); + $106 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $110 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$106 >> 2] | 0) + 28 >> 2] & 127]($106, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($101, $110) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($101) | 0; + _abort(); + } + $112 = (__ZNK6vision5Image6heightEv($2) | 0) >>> 1; + if (($112 | 0) == (__ZNK6vision5Image6heightEv($4) | 0)) { + $131 = (__ZNK6vision5Image3getIfEEPKT_m($3, $6) | 0) + ($5 << 2) | 0; + $133 = (__ZNK6vision5Image3getIfEEPKT_m($4, $34) | 0) + ($5 << 2) | 0; + $135 = (__ZNK6vision5Image3getIfEEPKT_m($4, $6) | 0) + ($5 << 2) | 0; + $137 = (__ZNK6vision5Image3getIfEEPKT_m($4, $36) | 0) + ($5 << 2) | 0; + __ZN6vision23bilinear_upsample_pointERfS0_ffi($8, $9, +($5 | 0), +($6 | 0), 1); + __ZN6vision26ComputeSubpixelDerivativesERfS0_S0_S0_S0_RKNS_5ImageEii($10, $11, $12, $13, $14, $3, $5, $6); + $142 = +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($2, +HEAPF32[$8 >> 2], +HEAPF32[$9 >> 2]); + $143 = +HEAPF32[$135 >> 2]; + $149 = $143 + ($142 - +HEAPF32[$131 >> 2] * 2.0); + $153 = +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($2, +HEAPF32[$8 >> 2] + -2.0, +HEAPF32[$9 >> 2]); + $156 = $153 + +HEAPF32[$135 + 4 >> 2]; + $160 = +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($2, +HEAPF32[$8 >> 2] + 2.0, +HEAPF32[$9 >> 2]); + $165 = ($156 - ($160 + +HEAPF32[$135 + -4 >> 2])) * .25; + $169 = +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($2, +HEAPF32[$8 >> 2], +HEAPF32[$9 >> 2] + -2.0); + $171 = $169 + +HEAPF32[$137 >> 2]; + $175 = +__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($2, +HEAPF32[$8 >> 2], +HEAPF32[$9 >> 2] + 2.0); + $179 = ($171 - ($175 + +HEAPF32[$133 >> 2])) * .25; + HEAP32[$0 >> 2] = HEAP32[$12 >> 2]; + $181 = HEAP32[$14 >> 2] | 0; + HEAP32[$0 + 4 >> 2] = $181; + HEAPF32[$0 + 8 >> 2] = $165; + HEAP32[$0 + 12 >> 2] = $181; + HEAP32[$0 + 16 >> 2] = HEAP32[$13 >> 2]; + HEAPF32[$0 + 20 >> 2] = $179; + HEAPF32[$0 + 24 >> 2] = $165; + HEAPF32[$0 + 28 >> 2] = $179; + HEAPF32[$0 + 32 >> 2] = $149; + HEAPF32[$1 >> 2] = -+HEAPF32[$10 >> 2]; + HEAPF32[$1 + 4 >> 2] = -+HEAPF32[$11 >> 2]; + HEAPF32[$1 + 8 >> 2] = -(($143 - $142) * .5); + STACKTOP = sp; + return; + } else { + $120 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29296) | 0, 28600) | 0, 39072) | 0, 364) | 0, 39079) | 0, 29150) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $120 + (HEAP32[(HEAP32[$120 >> 2] | 0) + -12 >> 2] | 0) | 0); + $125 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $129 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$125 >> 2] | 0) + 28 >> 2] & 127]($125, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($120, $129) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($120) | 0; + _abort(); + } + } + $44 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29018) | 0, 28600) | 0, 39072) | 0, 360) | 0, 39079) | 0, 29077) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $44 + (HEAP32[(HEAP32[$44 >> 2] | 0) + -12 >> 2] | 0) | 0); + $49 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $53 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$49 >> 2] | 0) + 28 >> 2] & 127]($49, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($44, $53) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($44) | 0; + _abort(); + } + $24 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 28944) | 0, 28600) | 0, 39072) | 0, 359) | 0, 39079) | 0, 29002) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $24 + (HEAP32[(HEAP32[$24 >> 2] | 0) + -12 >> 2] | 0) | 0); + $29 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $33 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$29 >> 2] | 0) + 28 >> 2] & 127]($29, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($24, $33) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($24) | 0; + _abort(); +} + +function _kpmSetRefDataSet($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$0156 = 0, $$0157 = 0, $$0158 = 0, $$0159 = 0, $$0161 = 0, $$0162 = 0, $$0163 = 0, $$0165 = 0, $$1160 = 0, $$1164 = 0, $$2 = 0, $$pre = 0, $$pre199 = 0, $$pre201 = 0, $11 = 0, $110 = 0, $116 = 0, $12 = 0, $123 = 0, $126 = 0, $148 = 0, $152 = 0, $157 = 0, $16 = 0, $164 = 0, $165 = 0, $17 = 0, $2 = 0, $20 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $31 = 0, $35 = 0, $36 = 0, $39 = 0, $4 = 0, $40 = 0, $43 = 0, $45 = 0, $47 = 0, $48 = 0, $5 = 0, $51 = 0, $53 = 0, $56 = 0, $59 = 0, $63 = 0, $68 = 0, $72 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $82 = 0, $86 = 0, $9 = 0, $90 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer11 = 0, $vararg_buffer3 = 0, $vararg_buffer5 = 0, $vararg_buffer7 = 0, $vararg_buffer9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 112 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(112); + $vararg_buffer11 = sp + 48 | 0; + $vararg_buffer9 = sp + 40 | 0; + $vararg_buffer7 = sp + 32 | 0; + $vararg_buffer5 = sp + 24 | 0; + $vararg_buffer3 = sp + 16 | 0; + $vararg_buffer1 = sp + 8 | 0; + $vararg_buffer = sp; + $2 = sp + 96 | 0; + $3 = sp + 84 | 0; + $4 = sp + 72 | 0; + $5 = sp + 52 | 0; + L1 : do if (($0 | 0) != 0 & ($1 | 0) != 0) { + $8 = $1 + 4 | 0; + $9 = HEAP32[$8 >> 2] | 0; + if (!$9) { + _arLog(0, 3, 26571, $vararg_buffer1); + $$0165 = -1; + break; + } + $11 = $0 + 28 | 0; + $12 = HEAP32[$11 >> 2] | 0; + if ($12) { + _free($12); + $$pre = HEAP32[$8 >> 2] | 0; + if (!$$pre) { + HEAP32[$11 >> 2] = 0; + $27 = 0; + } else { + $16 = $$pre; + label = 7; + } + } else { + $16 = $9; + label = 7; + } + L9 : do if ((label | 0) == 7) { + $17 = _malloc($16 * 132 | 0) | 0; + HEAP32[$11 >> 2] = $17; + if (!$17) { + _arLog(0, 3, 45930, $vararg_buffer3); + _exit(1); + } + $$0163 = 0; + $20 = $16; + while (1) { + if (($$0163 | 0) >= ($20 | 0)) { + $27 = $20; + break L9; + } + _memcpy((HEAP32[$11 >> 2] | 0) + ($$0163 * 132 | 0) | 0, (HEAP32[$1 >> 2] | 0) + ($$0163 * 132 | 0) | 0, 132) | 0; + $$0163 = $$0163 + 1 | 0; + $20 = HEAP32[$8 >> 2] | 0; + } + } while (0); + $26 = $0 + 32 | 0; + HEAP32[$26 >> 2] = $27; + $28 = $0 + 36 | 0; + $29 = HEAP32[$28 >> 2] | 0; + if ($29 | 0) { + $31 = $0 + 40 | 0; + $$1164 = 0; + $35 = $29; + while (1) { + if (($$1164 | 0) >= (HEAP32[$31 >> 2] | 0)) break; + $36 = HEAP32[$35 + ($$1164 * 12 | 0) >> 2] | 0; + if (!$36) $$pre199 = $35; else { + _free($36); + $$pre199 = HEAP32[$28 >> 2] | 0; + } + $$1164 = $$1164 + 1 | 0; + $35 = $$pre199; + } + _free($35); + } + $39 = $1 + 12 | 0; + $40 = HEAP32[$39 >> 2] | 0; + L28 : do if (!$40) { + HEAP32[$28 >> 2] = 0; + $77 = 0; + } else { + $43 = _malloc($40 * 12 | 0) | 0; + HEAP32[$28 >> 2] = $43; + if (!$43) { + _arLog(0, 3, 45930, $vararg_buffer5); + _exit(1); + } + $45 = $1 + 8 | 0; + $$2 = 0; + $47 = $40; + while (1) { + if (($$2 | 0) >= ($47 | 0)) { + $77 = $47; + break L28; + } + $48 = HEAP32[$45 >> 2] | 0; + $51 = HEAP32[$28 >> 2] | 0; + HEAP32[$51 + ($$2 * 12 | 0) + 8 >> 2] = HEAP32[$48 + ($$2 * 12 | 0) + 8 >> 2]; + $53 = $48 + ($$2 * 12 | 0) + 4 | 0; + HEAP32[$51 + ($$2 * 12 | 0) + 4 >> 2] = HEAP32[$53 >> 2]; + $56 = HEAP32[$53 >> 2] | 0; + if (!$56) { + HEAP32[$48 + ($$2 * 12 | 0) >> 2] = 0; + $$pre201 = $47; + } else { + $59 = _malloc($56 * 12 | 0) | 0; + HEAP32[$51 + ($$2 * 12 | 0) >> 2] = $59; + if (!$59) break; + $$0162 = 0; + $63 = $48; + while (1) { + if (($$0162 | 0) >= (HEAP32[$63 + ($$2 * 12 | 0) + 4 >> 2] | 0)) break; + $68 = (HEAP32[$63 + ($$2 * 12 | 0) >> 2] | 0) + ($$0162 * 12 | 0) | 0; + $72 = (HEAP32[(HEAP32[$28 >> 2] | 0) + ($$2 * 12 | 0) >> 2] | 0) + ($$0162 * 12 | 0) | 0; + HEAP32[$72 >> 2] = HEAP32[$68 >> 2]; + HEAP32[$72 + 4 >> 2] = HEAP32[$68 + 4 >> 2]; + HEAP32[$72 + 8 >> 2] = HEAP32[$68 + 8 >> 2]; + $$0162 = $$0162 + 1 | 0; + $63 = HEAP32[$45 >> 2] | 0; + } + $$pre201 = HEAP32[$39 >> 2] | 0; + } + $$2 = $$2 + 1 | 0; + $47 = $$pre201; + } + _arLog(0, 3, 45930, $vararg_buffer7); + _exit(1); + } while (0); + $76 = $0 + 40 | 0; + HEAP32[$76 >> 2] = $77; + $78 = $0 + 52 | 0; + $79 = HEAP32[$78 >> 2] | 0; + if ($79 | 0) { + _free($79); + HEAP32[$78 >> 2] = 0; + HEAP32[$0 + 56 >> 2] = 0; + } + $82 = HEAP32[$39 >> 2] | 0; + L51 : do if (($82 | 0) > 0) { + HEAP32[$0 + 56 >> 2] = $82; + $86 = _malloc($82 * 68 | 0) | 0; + HEAP32[$78 >> 2] = $86; + if (!$86) { + _arLog(0, 3, 45930, $vararg_buffer9); + _exit(1); + } + $$0161 = 0; + while (1) { + if (($$0161 | 0) == ($82 | 0)) break L51; + HEAP32[$86 + ($$0161 * 68 | 0) + 64 >> 2] = 0; + $$0161 = $$0161 + 1 | 0; + } + } while (0); + $90 = HEAP32[$26 >> 2] | 0; + if (!$90) $$0165 = 0; else { + $92 = $2 + 4 | 0; + $93 = $2 + 8 | 0; + $94 = $3 + 4 | 0; + $95 = $3 + 8 | 0; + $96 = $4 + 4 | 0; + $97 = $4 + 8 | 0; + $$0158 = 0; + $$0159 = 0; + while (1) { + if (($$0158 | 0) >= (HEAP32[$76 >> 2] | 0)) { + $$0165 = 0; + break L1; + } + $$0157 = 0; + $$1160 = $$0159; + while (1) { + if (($$0157 | 0) >= (HEAP32[(HEAP32[$28 >> 2] | 0) + ($$0158 * 12 | 0) + 4 >> 2] | 0)) break; + HEAP32[$2 >> 2] = 0; + HEAP32[$92 >> 2] = 0; + HEAP32[$93 >> 2] = 0; + HEAP32[$3 >> 2] = 0; + HEAP32[$94 >> 2] = 0; + HEAP32[$95 >> 2] = 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$96 >> 2] = 0; + HEAP32[$97 >> 2] = 0; + $$0156 = 0; + while (1) { + if (($$0156 | 0) >= ($90 | 0)) break; + $123 = HEAP32[$11 >> 2] | 0; + $126 = HEAP32[$28 >> 2] | 0; + L70 : do if ((HEAP32[$123 + ($$0156 * 132 | 0) + 128 >> 2] | 0) == (HEAP32[(HEAP32[$126 + ($$0158 * 12 | 0) >> 2] | 0) + ($$0157 * 12 | 0) + 8 >> 2] | 0) ? (HEAP32[$123 + ($$0156 * 132 | 0) + 124 >> 2] | 0) == (HEAP32[$126 + ($$0158 * 12 | 0) + 8 >> 2] | 0) : 0) { + __ZN6vision12FeaturePointC2Effffb($5, +HEAPF32[$123 + ($$0156 * 132 | 0) >> 2], +HEAPF32[$123 + ($$0156 * 132 | 0) + 4 >> 2], +HEAPF32[$123 + ($$0156 * 132 | 0) + 112 >> 2], +HEAPF32[$123 + ($$0156 * 132 | 0) + 116 >> 2], (HEAP32[$123 + ($$0156 * 132 | 0) + 120 >> 2] | 0) != 0); + $148 = HEAP32[$92 >> 2] | 0; + if ($148 >>> 0 < (HEAP32[$93 >> 2] | 0) >>> 0) { + HEAP32[$148 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$148 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + HEAP32[$148 + 8 >> 2] = HEAP32[$5 + 8 >> 2]; + HEAP32[$148 + 12 >> 2] = HEAP32[$5 + 12 >> 2]; + HEAP32[$148 + 16 >> 2] = HEAP32[$5 + 16 >> 2]; + HEAP32[$92 >> 2] = $148 + 20; + } else __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_($2, $5); + __ZN6vision12FeaturePointD2Ev($5); + $152 = HEAP32[$11 >> 2] | 0; + __ZN6vision7Point3dIfEC2Efff($5, +HEAPF32[$152 + ($$0156 * 132 | 0) + 8 >> 2], +HEAPF32[$152 + ($$0156 * 132 | 0) + 12 >> 2], 0.0); + $157 = HEAP32[$94 >> 2] | 0; + if ($157 >>> 0 < (HEAP32[$95 >> 2] | 0) >>> 0) { + HEAP32[$157 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$157 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + HEAP32[$157 + 8 >> 2] = HEAP32[$5 + 8 >> 2]; + HEAP32[$94 >> 2] = (HEAP32[$94 >> 2] | 0) + 12; + } else __ZNSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE21__push_back_slow_pathIS3_EEvOT_($3, $5); + $$0 = 0; + while (1) { + if ($$0 >>> 0 >= 96) break L70; + $164 = (HEAP32[$11 >> 2] | 0) + ($$0156 * 132 | 0) + 16 + $$0 | 0; + $165 = HEAP32[$96 >> 2] | 0; + if (($165 | 0) == (HEAP32[$97 >> 2] | 0)) __ZNSt3__26vectorIhNS_9allocatorIhEEE21__push_back_slow_pathIRKhEEvOT_($4, $164); else { + HEAP8[$165 >> 0] = HEAP8[$164 >> 0] | 0; + HEAP32[$96 >> 2] = (HEAP32[$96 >> 2] | 0) + 1; + } + $$0 = $$0 + 1 | 0; + } + } while (0); + $$0156 = $$0156 + 1 | 0; + } + HEAP32[$vararg_buffer11 >> 2] = ((HEAP32[$92 >> 2] | 0) - (HEAP32[$2 >> 2] | 0) | 0) / 20 | 0; + _arLog(0, 1, 26604, $vararg_buffer11); + $110 = HEAP32[$28 >> 2] | 0; + HEAP32[$0 + 60 + ($$1160 << 2) >> 2] = HEAP32[$110 + ($$0158 * 12 | 0) + 8 >> 2]; + $116 = HEAP32[$110 + ($$0158 * 12 | 0) >> 2] | 0; + __ZN6vision20VisualDatabaseFacade30addFreakFeaturesAndDescriptorsERKNSt3__26vectorINS_12FeaturePointENS1_9allocatorIS3_EEEERKNS2_IhNS4_IhEEEERKNS2_INS_7Point3dIfEENS4_ISE_EEEEmmi(HEAP32[$0 >> 2] | 0, $2, $4, $3, HEAP32[$116 + ($$0157 * 12 | 0) >> 2] | 0, HEAP32[$116 + ($$0157 * 12 | 0) + 4 >> 2] | 0, $$1160); + __ZNSt3__213__vector_baseIhNS_9allocatorIhEEED2Ev($4); + __ZNSt3__213__vector_baseIN6vision7Point3dIfEENS_9allocatorIS3_EEED2Ev($3); + __ZNSt3__213__vector_baseIN6vision12FeaturePointENS_9allocatorIS2_EEED2Ev($2); + $$0157 = $$0157 + 1 | 0; + $$1160 = $$1160 + 1 | 0; + } + $$0158 = $$0158 + 1 | 0; + $$0159 = $$1160; + } + } + } else { + _arLog(0, 3, 26523, $vararg_buffer); + $$0165 = -1; + } while (0); + STACKTOP = sp; + return $$0165 | 0; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i52 = 0, $$0$i$i$i$i66 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i58 = 0, $$0$i$i2$i$i72 = 0, $$0$i$i63 = 0, $$0$pn = 0, $$049 = 0, $$050 = 0, $$3 = 0, $$3$lcssa = 0, $$4 = 0, $$byval_copy = 0, $$byval_copy1 = 0, $$ph = 0, $$sroa$047$0$copyload = 0, $10 = 0, $101 = 0, $103 = 0, $115 = 0, $116 = 0, $117 = 0, $118 = 0, $13 = 0, $131 = 0, $139 = 0, $14 = 0, $140 = 0, $141 = 0, $142 = 0, $154 = 0, $16 = 0, $161 = 0, $171 = 0, $173 = 0, $18 = 0, $185 = 0, $188 = 0, $202 = 0, $203 = 0, $204 = 0, $205 = 0, $206 = 0, $30 = 0, $32 = 0, $34 = 0, $52 = 0, $58 = 0, $59 = 0, $68 = 0, $69 = 0, $70 = 0, $71 = 0, $73 = 0, $8 = 0, $86 = 0, $88 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $8 = sp + 4 | 0; + $9 = sp; + __ZNKSt3__28ios_base6getlocEv($$byval_copy1, $3); + $10 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy1, 66544) | 0; + __ZNSt3__26localeD2Ev($$byval_copy1); + HEAP32[$4 >> 2] = 0; + $$0 = $6; + $13 = 0; + L1 : while (1) { + $14 = HEAP32[$1 >> 2] | 0; + if (!(($$0 | 0) != ($7 | 0) & ($13 | 0) == 0)) { + $171 = $14; + break; + } + $16 = $14; + if ($14) { + $18 = HEAP32[$14 + 12 >> 2] | 0; + if (($18 | 0) == (HEAP32[$14 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$14 >> 2] | 0) + 36 >> 2] & 127]($14) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$18 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $140 = 0; + $202 = 1; + $69 = 0; + } else { + $140 = $14; + $202 = 0; + $69 = $16; + } + } else { + $140 = 0; + $202 = 1; + $69 = $16; + } + $30 = HEAP32[$2 >> 2] | 0; + $32 = $30; + do if ($30) { + $34 = HEAP32[$30 + 12 >> 2] | 0; + if (($34 | 0) == (HEAP32[$30 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$30 >> 2] | 0) + 36 >> 2] & 127]($30) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$34 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($202) { + $203 = $30; + $70 = $32; + break; + } else { + label = 60; + break L1; + } else { + HEAP32[$2 >> 2] = 0; + $$ph = 0; + label = 15; + break; + } + } else { + $$ph = $32; + label = 15; + } while (0); + if ((label | 0) == 15) { + label = 0; + if ($202) { + label = 60; + break; + } else { + $203 = 0; + $70 = $$ph; + } + } + L24 : do if ((FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$10 >> 2] | 0) + 52 >> 2] & 63]($10, HEAP32[$$0 >> 2] | 0, 0) | 0) << 24 >> 24 == 37) { + $52 = $$0 + 4 | 0; + if (($52 | 0) == ($7 | 0)) { + label = 60; + break L1; + } + $58 = FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$10 >> 2] | 0) + 52 >> 2] & 63]($10, HEAP32[$52 >> 2] | 0, 0) | 0; + switch ($58 << 24 >> 24) { + case 48: + case 69: + { + $59 = $$0 + 8 | 0; + if (($59 | 0) == ($7 | 0)) { + label = 60; + break L1; + } + $$049 = $58; + $$050 = FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$10 >> 2] | 0) + 52 >> 2] & 63]($10, HEAP32[$59 >> 2] | 0, 0) | 0; + $73 = $52; + break; + } + default: + { + $$049 = 0; + $$050 = $58; + $73 = $$0; + } + } + $68 = HEAP32[(HEAP32[$0 >> 2] | 0) + 36 >> 2] | 0; + HEAP32[$8 >> 2] = $69; + HEAP32[$9 >> 2] = $70; + HEAP32[$$byval_copy >> 2] = HEAP32[$8 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$9 >> 2]; + $71 = FUNCTION_TABLE_iiiiiiiii[$68 & 15]($0, $$byval_copy, $$byval_copy1, $3, $4, $5, $$050, $$049) | 0; + HEAP32[$1 >> 2] = $71; + $$4 = $73 + 8 | 0; + } else { + if (!(FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$10 >> 2] | 0) + 12 >> 2] & 63]($10, 8192, HEAP32[$$0 >> 2] | 0) | 0)) { + $139 = $140 + 12 | 0; + $141 = HEAP32[$139 >> 2] | 0; + $142 = $140 + 16 | 0; + if (($141 | 0) == (HEAP32[$142 >> 2] | 0)) $$0$i$i63 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$140 >> 2] | 0) + 36 >> 2] & 127]($140) | 0; else $$0$i$i63 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$141 >> 2] | 0) | 0; + $154 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$10 >> 2] | 0) + 28 >> 2] & 127]($10, $$0$i$i63) | 0; + if (($154 | 0) != (FUNCTION_TABLE_iii[HEAP32[(HEAP32[$10 >> 2] | 0) + 28 >> 2] & 127]($10, HEAP32[$$0 >> 2] | 0) | 0)) { + HEAP32[$4 >> 2] = 4; + $$4 = $$0; + break; + } + $161 = HEAP32[$139 >> 2] | 0; + if (($161 | 0) == (HEAP32[$142 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$140 >> 2] | 0) + 40 >> 2] & 127]($140) | 0; else { + HEAP32[$139 >> 2] = $161 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$161 >> 2] | 0) | 0; + } + $$4 = $$0 + 4 | 0; + break; + } + $$0$pn = $$0; + while (1) { + $$3 = $$0$pn + 4 | 0; + if (($$3 | 0) == ($7 | 0)) { + $$3$lcssa = $7; + break; + } + if (FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$10 >> 2] | 0) + 12 >> 2] & 63]($10, 8192, HEAP32[$$3 >> 2] | 0) | 0) $$0$pn = $$3; else { + $$3$lcssa = $$3; + break; + } + } + $101 = $203; + $86 = $140; + while (1) { + if ($86) { + $88 = HEAP32[$86 + 12 >> 2] | 0; + if (($88 | 0) == (HEAP32[$86 + 16 >> 2] | 0)) $$0$i$i$i$i52 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$86 >> 2] | 0) + 36 >> 2] & 127]($86) | 0; else $$0$i$i$i$i52 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$88 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i52, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $116 = 0; + $204 = 1; + } else { + $116 = $86; + $204 = 0; + } + } else { + $116 = 0; + $204 = 1; + } + do if ($101) { + $103 = HEAP32[$101 + 12 >> 2] | 0; + if (($103 | 0) == (HEAP32[$101 + 16 >> 2] | 0)) $$0$i$i2$i$i58 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$101 >> 2] | 0) + 36 >> 2] & 127]($101) | 0; else $$0$i$i2$i$i58 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$103 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i58, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($204) { + $205 = $101; + break; + } else { + $$4 = $$3$lcssa; + break L24; + } else { + HEAP32[$2 >> 2] = 0; + label = 40; + break; + } + } else label = 40; while (0); + if ((label | 0) == 40) { + label = 0; + if ($204) { + $$4 = $$3$lcssa; + break L24; + } else $205 = 0; + } + $115 = $116 + 12 | 0; + $117 = HEAP32[$115 >> 2] | 0; + $118 = $116 + 16 | 0; + if (($117 | 0) == (HEAP32[$118 >> 2] | 0)) $$0$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$116 >> 2] | 0) + 36 >> 2] & 127]($116) | 0; else $$0$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$117 >> 2] | 0) | 0; + if (!(FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$10 >> 2] | 0) + 12 >> 2] & 63]($10, 8192, $$0$i$i) | 0)) { + $$4 = $$3$lcssa; + break L24; + } + $131 = HEAP32[$115 >> 2] | 0; + if (($131 | 0) == (HEAP32[$118 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$116 >> 2] | 0) + 40 >> 2] & 127]($116) | 0; else { + HEAP32[$115 >> 2] = $131 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$131 >> 2] | 0) | 0; + } + $101 = $205; + $86 = $116; + } + } while (0); + $$0 = $$4; + $13 = HEAP32[$4 >> 2] | 0; + } + if ((label | 0) == 60) { + HEAP32[$4 >> 2] = 4; + $171 = $140; + } + if ($171) { + $173 = HEAP32[$171 + 12 >> 2] | 0; + if (($173 | 0) == (HEAP32[$171 + 16 >> 2] | 0)) $$0$i$i$i$i66 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$171 >> 2] | 0) + 36 >> 2] & 127]($171) | 0; else $$0$i$i$i$i66 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$173 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i66, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $$sroa$047$0$copyload = 0; + $206 = 1; + } else { + $$sroa$047$0$copyload = $171; + $206 = 0; + } + } else { + $$sroa$047$0$copyload = 0; + $206 = 1; + } + $185 = HEAP32[$2 >> 2] | 0; + do if ($185) { + $188 = HEAP32[$185 + 12 >> 2] | 0; + if (($188 | 0) == (HEAP32[$185 + 16 >> 2] | 0)) $$0$i$i2$i$i72 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$185 >> 2] | 0) + 36 >> 2] & 127]($185) | 0; else $$0$i$i2$i$i72 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$188 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i72, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($206) break; else { + label = 75; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 73; + break; + } + } else label = 73; while (0); + if ((label | 0) == 73 ? $206 : 0) label = 75; + if ((label | 0) == 75) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + STACKTOP = sp; + return $$sroa$047$0$copyload | 0; +} + +function _check_rotation($0) { + $0 = $0 | 0; + var $$0 = 0, $$0457 = 0.0, $$0458 = 0.0, $$0459 = 0.0, $$0460 = 0.0, $$0461 = 0.0, $$0462 = 0.0, $$0463 = 0.0, $$0464 = 0.0, $$0465 = 0.0, $$0466 = 0.0, $$0467 = 0.0, $$0468 = 0.0, $$0469 = 0.0, $$0470 = 0.0, $$0471 = 0.0, $$0472 = 0.0, $$0473 = 0.0, $$1 = 0, $$10 = 0.0, $$2 = 0.0, $$3 = 0.0, $$5 = 0.0, $$6 = 0.0, $$9 = 0.0, $$pre = 0.0, $$pre$phi15Z2D = 0.0, $$pre$phi17Z2D = 0.0, $$pre$phi19Z2D = 0.0, $$pre$phi21Z2D = 0.0, $$pre$phi23Z2D = 0.0, $$pre$phiZ2D = 0.0, $$pre14 = 0.0, $$pre18 = 0.0, $$pre20 = 0.0, $$sroa$0$0 = 0.0, $$sroa$0$1 = 0.0, $$sroa$0$1$$sroa$62$1 = 0.0, $$sroa$0$2 = 0.0, $$sroa$0333$0 = 0.0, $$sroa$0370$0 = 0.0, $$sroa$18$0 = 0.0, $$sroa$18384$0 = 0.0, $$sroa$33$0 = 0.0, $$sroa$33$1 = 0.0, $$sroa$33$2 = 0.0, $$sroa$33359$0 = 0.0, $$sroa$33397$0 = 0.0, $$sroa$62$0 = 0.0, $$sroa$62$1 = 0.0, $$sroa$62$1$$sroa$33$1 = 0.0, $$sroa$62$2 = 0.0, $1 = 0.0, $10 = 0, $102 = 0, $107 = 0.0, $109 = 0.0, $11 = 0.0, $113 = 0.0, $114 = 0.0, $116 = 0.0, $120 = 0.0, $123 = 0.0, $130 = 0.0, $133 = 0.0, $135 = 0.0, $137 = 0.0, $139 = 0.0, $14 = 0.0, $141 = 0.0, $143 = 0.0, $145 = 0.0, $150 = 0.0, $157 = 0.0, $164 = 0.0, $17 = 0.0, $171 = 0.0, $2 = 0, $20 = 0.0, $26 = 0.0, $28 = 0.0, $29 = 0.0, $3 = 0.0, $30 = 0.0, $35 = 0.0, $4 = 0, $43 = 0.0, $44 = 0.0, $45 = 0.0, $46 = 0.0, $5 = 0.0, $51 = 0, $56 = 0.0, $58 = 0.0, $6 = 0, $62 = 0.0, $63 = 0.0, $65 = 0.0, $69 = 0.0, $7 = 0.0, $72 = 0.0, $79 = 0.0, $8 = 0, $82 = 0.0, $84 = 0.0, $86 = 0.0, $88 = 0.0, $9 = 0.0, $90 = 0.0, $92 = 0.0, $94 = 0.0, $95 = 0.0, $96 = 0.0, $97 = 0.0; + $1 = +HEAPF64[$0 >> 3]; + $2 = $0 + 8 | 0; + $3 = +HEAPF64[$2 >> 3]; + $4 = $0 + 16 | 0; + $5 = +HEAPF64[$4 >> 3]; + $6 = $0 + 24 | 0; + $7 = +HEAPF64[$6 >> 3]; + $8 = $0 + 32 | 0; + $9 = +HEAPF64[$8 >> 3]; + $10 = $0 + 40 | 0; + $11 = +HEAPF64[$10 >> 3]; + $14 = $3 * $11 - $5 * $9; + $17 = $5 * $7 - $1 * $11; + $20 = $1 * $9 - $3 * $7; + $26 = +Math_sqrt(+($20 * $20 + ($14 * $14 + $17 * $17))); + do if (!($26 == 0.0)) { + $28 = $14 / $26; + $29 = $17 / $26; + $30 = $20 / $26; + $35 = $1 * $7 + $3 * $9 + $5 * $11; + $$0473 = $35 < 0.0 ? -$35 : $35; + $43 = (+Math_sqrt(+($$0473 + 1.0)) + +Math_sqrt(+(1.0 - $$0473))) * .5; + $44 = $1 * $29; + $45 = $3 * $28; + $46 = $44 - $45; + if ($46 != 0.0) { + $$0 = 0; + $$pre$phi15Z2D = $45; + $$pre$phi17Z2D = $46; + $$pre$phiZ2D = $44; + $$sroa$0$0 = $28; + $$sroa$0370$0 = $1; + $$sroa$18384$0 = $3; + $$sroa$33$0 = $29; + $$sroa$33397$0 = $5; + $$sroa$62$0 = $30; + } else { + $51 = $1 * $30 - $5 * $28 != 0.0; + $$2 = $51 ? $5 : $3; + $$3 = $51 ? $1 : $5; + $$5 = $51 ? $30 : $29; + $$6 = $51 ? $28 : $30; + $$pre = $$3 * $$5; + $$pre14 = $$2 * $$6; + $$0 = $51 ? 1 : 2; + $$pre$phi15Z2D = $$pre14; + $$pre$phi17Z2D = $$pre - $$pre14; + $$pre$phiZ2D = $$pre; + $$sroa$0$0 = $$6; + $$sroa$0370$0 = $$3; + $$sroa$18384$0 = $$2; + $$sroa$33$0 = $$5; + $$sroa$33397$0 = $51 ? $3 : $1; + $$sroa$62$0 = $51 ? $29 : $28; + } + if (!($$pre$phi17Z2D == 0.0) ? ($56 = ($$sroa$18384$0 * $$sroa$62$0 - $$sroa$33397$0 * $$sroa$33$0) / $$pre$phi17Z2D, $58 = $43 * $$sroa$33$0 / $$pre$phi17Z2D, $62 = $$pre$phi15Z2D - $$pre$phiZ2D, $63 = ($$sroa$0370$0 * $$sroa$62$0 - $$sroa$33397$0 * $$sroa$0$0) / $62, $65 = $43 * $$sroa$0$0 / $62, $69 = $56 * $56 + $63 * $63 + 1.0, $72 = $56 * $58 + $63 * $65, $79 = $72 * $72 - $69 * ($58 * $58 + $65 * $65 + -1.0), !($79 < 0.0)) : 0) { + $82 = +Math_sqrt(+$79); + $84 = ($82 - $72) / $69; + $86 = $58 + $56 * $84; + $88 = $65 + $63 * $84; + $90 = (-$72 - $82) / $69; + $92 = $58 + $56 * $90; + $94 = $65 + $63 * $90; + switch ($$0 & 3) { + case 1: + { + $$0467 = $94; + $$0468 = $90; + $$0469 = $92; + $$0470 = $88; + $$0471 = $84; + $$0472 = $86; + $$sroa$0$1 = $$sroa$0$0; + $$sroa$33$1 = $$sroa$62$0; + $$sroa$62$1 = $$sroa$33$0; + break; + } + case 2: + { + $$0467 = $92; + $$0468 = $94; + $$0469 = $90; + $$0470 = $86; + $$0471 = $88; + $$0472 = $84; + $$sroa$0$1 = $$sroa$62$0; + $$sroa$33$1 = $$sroa$33$0; + $$sroa$62$1 = $$sroa$0$0; + break; + } + default: + { + $$0467 = $90; + $$0468 = $94; + $$0469 = $92; + $$0470 = $84; + $$0471 = $88; + $$0472 = $86; + $$sroa$0$1 = $$sroa$0$0; + $$sroa$33$1 = $$sroa$33$0; + $$sroa$62$1 = $$sroa$62$0; + } + } + $95 = $7 * $$sroa$33$1; + $96 = $9 * $$sroa$0$1; + $97 = $95 - $96; + if ($97 != 0.0) { + $$1 = 0; + $$pre$phi19Z2D = $95; + $$pre$phi21Z2D = $96; + $$pre$phi23Z2D = $97; + $$sroa$0$2 = $$sroa$0$1; + $$sroa$0333$0 = $7; + $$sroa$18$0 = $9; + $$sroa$33$2 = $$sroa$33$1; + $$sroa$33359$0 = $11; + $$sroa$62$2 = $$sroa$62$1; + } else { + $102 = $7 * $$sroa$62$1 - $11 * $$sroa$0$1 != 0.0; + $$9 = $102 ? $11 : $9; + $$10 = $102 ? $7 : $11; + $$sroa$62$1$$sroa$33$1 = $102 ? $$sroa$62$1 : $$sroa$33$1; + $$sroa$0$1$$sroa$62$1 = $102 ? $$sroa$0$1 : $$sroa$62$1; + $$pre18 = $$10 * $$sroa$62$1$$sroa$33$1; + $$pre20 = $$9 * $$sroa$0$1$$sroa$62$1; + $$1 = $102 ? 1 : 2; + $$pre$phi19Z2D = $$pre18; + $$pre$phi21Z2D = $$pre20; + $$pre$phi23Z2D = $$pre18 - $$pre20; + $$sroa$0$2 = $$sroa$0$1$$sroa$62$1; + $$sroa$0333$0 = $$10; + $$sroa$18$0 = $$9; + $$sroa$33$2 = $$sroa$62$1$$sroa$33$1; + $$sroa$33359$0 = $102 ? $9 : $7; + $$sroa$62$2 = $102 ? $$sroa$33$1 : $$sroa$0$1; + } + if (!($$pre$phi23Z2D == 0.0) ? ($107 = ($$sroa$18$0 * $$sroa$62$2 - $$sroa$33359$0 * $$sroa$33$2) / $$pre$phi23Z2D, $109 = $43 * $$sroa$33$2 / $$pre$phi23Z2D, $113 = $$pre$phi21Z2D - $$pre$phi19Z2D, $114 = ($$sroa$0333$0 * $$sroa$62$2 - $$sroa$33359$0 * $$sroa$0$2) / $113, $116 = $43 * $$sroa$0$2 / $113, $120 = $107 * $107 + $114 * $114 + 1.0, $123 = $107 * $109 + $114 * $116, $130 = $123 * $123 - $120 * ($109 * $109 + $116 * $116 + -1.0), !($130 < 0.0)) : 0) { + $133 = +Math_sqrt(+$130); + $135 = ($133 - $123) / $120; + $137 = $109 + $107 * $135; + $139 = $116 + $114 * $135; + $141 = (-$123 - $133) / $120; + $143 = $109 + $107 * $141; + $145 = $116 + $114 * $141; + switch ($$1 & 3) { + case 1: + { + $$0461 = $145; + $$0462 = $141; + $$0463 = $143; + $$0464 = $139; + $$0465 = $135; + $$0466 = $137; + break; + } + case 2: + { + $$0461 = $143; + $$0462 = $145; + $$0463 = $141; + $$0464 = $137; + $$0465 = $139; + $$0466 = $135; + break; + } + default: + { + $$0461 = $141; + $$0462 = $145; + $$0463 = $143; + $$0464 = $135; + $$0465 = $139; + $$0466 = $137; + } + } + $150 = $$0472 * $$0466 + $$0471 * $$0465 + $$0470 * $$0464; + $$0460 = $150 < 0.0 ? -$150 : $150; + $157 = $$0472 * $$0463 + $$0471 * $$0462 + $$0470 * $$0461; + $$0459 = $157 < 0.0 ? -$157 : $157; + $164 = $$0469 * $$0466 + $$0468 * $$0465 + $$0467 * $$0464; + $$0458 = $164 < 0.0 ? -$164 : $164; + $171 = $$0469 * $$0463 + $$0468 * $$0462 + $$0467 * $$0461; + $$0457 = $171 < 0.0 ? -$171 : $171; + if ($$0460 < $$0459) if ($$0460 < $$0458) if ($$0460 < $$0457) { + HEAPF64[$0 >> 3] = $$0472; + HEAPF64[$2 >> 3] = $$0471; + HEAPF64[$4 >> 3] = $$0470; + HEAPF64[$6 >> 3] = $$0466; + HEAPF64[$8 >> 3] = $$0465; + HEAPF64[$10 >> 3] = $$0464; + break; + } else { + HEAPF64[$0 >> 3] = $$0469; + HEAPF64[$2 >> 3] = $$0468; + HEAPF64[$4 >> 3] = $$0467; + HEAPF64[$6 >> 3] = $$0463; + HEAPF64[$8 >> 3] = $$0462; + HEAPF64[$10 >> 3] = $$0461; + break; + } else { + HEAPF64[$0 >> 3] = $$0469; + HEAPF64[$2 >> 3] = $$0468; + HEAPF64[$4 >> 3] = $$0467; + if ($$0458 < $$0457) { + HEAPF64[$6 >> 3] = $$0466; + HEAPF64[$8 >> 3] = $$0465; + HEAPF64[$10 >> 3] = $$0464; + break; + } else { + HEAPF64[$6 >> 3] = $$0463; + HEAPF64[$8 >> 3] = $$0462; + HEAPF64[$10 >> 3] = $$0461; + break; + } + } else if ($$0459 < $$0458) if ($$0459 < $$0457) { + HEAPF64[$0 >> 3] = $$0472; + HEAPF64[$2 >> 3] = $$0471; + HEAPF64[$4 >> 3] = $$0470; + HEAPF64[$6 >> 3] = $$0463; + HEAPF64[$8 >> 3] = $$0462; + HEAPF64[$10 >> 3] = $$0461; + break; + } else { + HEAPF64[$0 >> 3] = $$0469; + HEAPF64[$2 >> 3] = $$0468; + HEAPF64[$4 >> 3] = $$0467; + HEAPF64[$6 >> 3] = $$0463; + HEAPF64[$8 >> 3] = $$0462; + HEAPF64[$10 >> 3] = $$0461; + break; + } else { + HEAPF64[$0 >> 3] = $$0469; + HEAPF64[$2 >> 3] = $$0468; + HEAPF64[$4 >> 3] = $$0467; + if ($$0458 < $$0457) { + HEAPF64[$6 >> 3] = $$0466; + HEAPF64[$8 >> 3] = $$0465; + HEAPF64[$10 >> 3] = $$0464; + break; + } else { + HEAPF64[$6 >> 3] = $$0463; + HEAPF64[$8 >> 3] = $$0462; + HEAPF64[$10 >> 3] = $$0461; + break; + } + } + } + } + } while (0); + return; +} + +function _ar2ReadSurfaceSet($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$093 = 0, $$094 = 0, $$096 = 0, $$1 = 0, $$198 = 0, $$sink = 0, $13 = 0, $15 = 0, $17 = 0, $18 = 0, $20 = 0, $25 = 0, $3 = 0, $30 = 0, $32 = 0, $39 = 0, $4 = 0, $44 = 0, $5 = 0, $51 = 0, $6 = 0, $64 = 0, $73 = 0, $82 = 0, $89 = 0, $96 = 0, $98 = 0, $storemerge = 0, $vararg_buffer = 0, $vararg_buffer11 = 0, $vararg_buffer14 = 0, $vararg_buffer16 = 0, $vararg_buffer19 = 0, $vararg_buffer2 = 0, $vararg_buffer22 = 0, $vararg_buffer24 = 0, $vararg_buffer27 = 0, $vararg_buffer29 = 0, $vararg_buffer31 = 0, $vararg_buffer34 = 0, $vararg_buffer36 = 0, $vararg_buffer38 = 0, $vararg_buffer41 = 0, $vararg_buffer43 = 0, $vararg_buffer49 = 0, $vararg_buffer5 = 0, $vararg_buffer51 = 0, $vararg_buffer57 = 0, $vararg_buffer59 = 0, $vararg_buffer65 = 0, $vararg_buffer67 = 0, $vararg_buffer9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 1248 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(1248); + $vararg_buffer67 = sp + 1232 | 0; + $vararg_buffer65 = sp + 1224 | 0; + $vararg_buffer59 = sp + 1208 | 0; + $vararg_buffer57 = sp + 1200 | 0; + $vararg_buffer51 = sp + 1184 | 0; + $vararg_buffer49 = sp + 1176 | 0; + $vararg_buffer43 = sp + 1160 | 0; + $vararg_buffer41 = sp + 1152 | 0; + $vararg_buffer38 = sp + 1144 | 0; + $vararg_buffer36 = sp + 1136 | 0; + $vararg_buffer34 = sp + 1128 | 0; + $vararg_buffer31 = sp + 1120 | 0; + $vararg_buffer29 = sp + 1112 | 0; + $vararg_buffer27 = sp + 1104 | 0; + $vararg_buffer24 = sp + 1096 | 0; + $vararg_buffer22 = sp + 1088 | 0; + $vararg_buffer19 = sp + 1080 | 0; + $vararg_buffer16 = sp + 1072 | 0; + $vararg_buffer14 = sp + 1064 | 0; + $vararg_buffer11 = sp + 1056 | 0; + $vararg_buffer9 = sp + 1048 | 0; + $vararg_buffer5 = sp + 1040 | 0; + $vararg_buffer2 = sp + 1032 | 0; + $vararg_buffer = sp + 1024 | 0; + $3 = sp + 768 | 0; + $4 = sp + 512 | 0; + $5 = sp + 1236 | 0; + $6 = sp; + do if ((($1 | 0) != 0 ? (HEAP8[$1 >> 0] | 0) != 0 : 0) ? (_strcmp($1, 45135) | 0) != 0 : 0) { + HEAP32[$vararg_buffer >> 2] = $0; + HEAP32[$vararg_buffer + 4 >> 2] = $1; + _sprintf($6, 26699, $vararg_buffer) | 0; + $13 = _fopen($6, 25925) | 0; + if (!$13) { + HEAP32[$vararg_buffer2 >> 2] = $0; + _arLog(0, 3, 25927, $vararg_buffer2); + $15 = ___errno_location() | 0; + $17 = _strerror(HEAP32[$15 >> 2] | 0) | 0; + HEAP32[$vararg_buffer5 >> 2] = 67447; + HEAP32[$vararg_buffer5 + 4 >> 2] = $17; + _arLog(0, 3, 25953, $vararg_buffer5); + $$198 = 0; + break; + } else { + $$096 = $13; + $$1 = 1; + label = 8; + break; + } + } else label = 4; while (0); + if ((label | 0) == 4) { + _strncpy($4, $0, 255) | 0; + HEAP8[$4 + 255 >> 0] = 0; + $$096 = 0; + $$1 = 0; + label = 8; + } + do if ((label | 0) == 8) { + $18 = _malloc(1140) | 0; + if (!$18) { + _arLog(0, 3, 45930, $vararg_buffer9); + _exit(1); + } + $20 = ($$1 | 0) != 0; + if ($20) { + if (!(_get_buff_380($3, $$096) | 0)) { + _fclose($$096) | 0; + _free($18); + $$198 = 0; + break; + } + HEAP32[$vararg_buffer11 >> 2] = $5; + if ((_sscanf($3, 25959, $vararg_buffer11) | 0) != 1) { + _fclose($$096) | 0; + _free($18); + $$198 = 0; + break; + } + $25 = HEAP32[$5 >> 2] | 0; + if (($25 | 0) < 1) { + _fclose($$096) | 0; + _free($18); + $$198 = 0; + break; + } else $$sink = $25; + } else $$sink = 1; + HEAP32[$18 + 4 >> 2] = $$sink; + HEAP32[$18 + 152 >> 2] = 0; + $30 = _malloc($$sink * 112 | 0) | 0; + HEAP32[$18 >> 2] = $30; + if (!$30) { + _arLog(0, 3, 45930, $vararg_buffer14); + _exit(1); + } + $32 = ($2 | 0) == 0; + $storemerge = 0; + L28 : while (1) { + HEAP32[$5 >> 2] = $storemerge; + if (($storemerge | 0) >= ($$sink | 0)) { + label = 57; + break; + } + HEAP32[$vararg_buffer16 >> 2] = $storemerge + 1; + _arLog(0, 1, 25962, $vararg_buffer16); + if ($20) { + if (!(_get_buff_380($3, $$096) | 0)) { + label = 57; + break; + } + HEAP32[$vararg_buffer19 >> 2] = $4; + if ((_sscanf($3, 25986, $vararg_buffer19) | 0) != 1) { + label = 57; + break; + } + _ar2UtilRemoveExt($4) | 0; + } + _arLog(0, 1, 25989, $vararg_buffer22); + $39 = _ar2ReadImageSet($4) | 0; + HEAP32[$30 + ((HEAP32[$5 >> 2] | 0) * 112 | 0) >> 2] = $39; + if (!$39) { + label = 26; + break; + } + _arLog(0, 1, 26038, $vararg_buffer27); + _arLog(0, 1, 26048, $vararg_buffer29); + $44 = _ar2ReadFeatureSet($4, 45135) | 0; + HEAP32[$30 + ((HEAP32[$5 >> 2] | 0) * 112 | 0) + 4 >> 2] = $44; + if (!$44) { + label = 29; + break; + } + _arLog(0, 1, 26038, $vararg_buffer34); + if ($32) HEAP32[$30 + ((HEAP32[$5 >> 2] | 0) * 112 | 0) + 8 >> 2] = 0; else { + _arLog(0, 1, 26099, $vararg_buffer36); + _ar2UtilRemoveExt($4) | 0; + $51 = _ar2ReadMarkerSet($4, 26118, $2) | 0; + HEAP32[$30 + ((HEAP32[$5 >> 2] | 0) * 112 | 0) + 8 >> 2] = $51; + if (!$51) { + label = 33; + break; + } + _arLog(0, 1, 26038, $vararg_buffer41); + } + L43 : do if ($20) { + if (!(_get_buff_380($3, $$096) | 0)) { + label = 57; + break L28; + } + $64 = HEAP32[$5 >> 2] | 0; + HEAP32[$vararg_buffer43 >> 2] = $30 + ($64 * 112 | 0) + 12; + HEAP32[$vararg_buffer43 + 4 >> 2] = $30 + ($64 * 112 | 0) + 16; + HEAP32[$vararg_buffer43 + 8 >> 2] = $30 + ($64 * 112 | 0) + 20; + HEAP32[$vararg_buffer43 + 12 >> 2] = $30 + ($64 * 112 | 0) + 24; + if ((_sscanf($3, 26152, $vararg_buffer43) | 0) != 4) { + label = 40; + break L28; + } + if (!(_get_buff_380($3, $$096) | 0)) { + label = 57; + break L28; + } + $73 = HEAP32[$5 >> 2] | 0; + HEAP32[$vararg_buffer51 >> 2] = $30 + ($73 * 112 | 0) + 28; + HEAP32[$vararg_buffer51 + 4 >> 2] = $30 + ($73 * 112 | 0) + 32; + HEAP32[$vararg_buffer51 + 8 >> 2] = $30 + ($73 * 112 | 0) + 36; + HEAP32[$vararg_buffer51 + 12 >> 2] = $30 + ($73 * 112 | 0) + 40; + if ((_sscanf($3, 26152, $vararg_buffer51) | 0) != 4) { + label = 43; + break L28; + } + if (!(_get_buff_380($3, $$096) | 0)) { + label = 57; + break L28; + } + $82 = HEAP32[$5 >> 2] | 0; + HEAP32[$vararg_buffer59 >> 2] = $30 + ($82 * 112 | 0) + 44; + HEAP32[$vararg_buffer59 + 4 >> 2] = $30 + ($82 * 112 | 0) + 48; + HEAP32[$vararg_buffer59 + 8 >> 2] = $30 + ($82 * 112 | 0) + 52; + HEAP32[$vararg_buffer59 + 12 >> 2] = $30 + ($82 * 112 | 0) + 56; + if ((_sscanf($3, 26152, $vararg_buffer59) | 0) != 4) { + label = 47; + break L28; + } + $96 = HEAP32[$5 >> 2] | 0; + } else { + $89 = HEAP32[$5 >> 2] | 0; + $$094 = 0; + while (1) { + if (($$094 | 0) == 3) { + $96 = $89; + break L43; + } + $$093 = 0; + while (1) { + if (($$093 | 0) == 4) break; + HEAPF32[$30 + ($89 * 112 | 0) + 12 + ($$094 << 4) + ($$093 << 2) >> 2] = ($$094 | 0) == ($$093 | 0) ? 1.0 : 0.0; + $$093 = $$093 + 1 | 0; + } + $$094 = $$094 + 1 | 0; + } + } while (0); + _arUtilMatInvf($30 + ($96 * 112 | 0) + 12 | 0, $30 + ($96 * 112 | 0) + 60 | 0) | 0; + _ar2UtilReplaceExt($4, 256, 26200) | 0; + $98 = _malloc(256) | 0; + HEAP32[$30 + ((HEAP32[$5 >> 2] | 0) * 112 | 0) + 108 >> 2] = $98; + if (!$98) { + label = 55; + break; + } + _strncpy($98, $4, 256) | 0; + $storemerge = (HEAP32[$5 >> 2] | 0) + 1 | 0; + } + if ((label | 0) == 26) { + HEAP32[$vararg_buffer24 >> 2] = $4; + _arLog(0, 3, 26007, $vararg_buffer24); + _free($30); + _free($18); + if (!$$096) { + $$198 = 0; + break; + } + _fclose($$096) | 0; + $$198 = 0; + break; + } else if ((label | 0) == 29) { + HEAP32[$vararg_buffer31 >> 2] = $4; + _arLog(0, 3, 26068, $vararg_buffer31); + _ar2FreeImageSet($30 + ((HEAP32[$5 >> 2] | 0) * 112 | 0) | 0) | 0; + _free($30); + _free($18); + if (!$$096) { + $$198 = 0; + break; + } + _fclose($$096) | 0; + $$198 = 0; + break; + } else if ((label | 0) == 33) { + HEAP32[$vararg_buffer38 >> 2] = $4; + _arLog(0, 3, 26122, $vararg_buffer38); + _ar2FreeFeatureSet($30 + ((HEAP32[$5 >> 2] | 0) * 112 | 0) + 4 | 0) | 0; + _ar2FreeImageSet($30 + ((HEAP32[$5 >> 2] | 0) * 112 | 0) | 0) | 0; + _free($30); + _free($18); + if (!$$096) { + $$198 = 0; + break; + } + _fclose($$096) | 0; + $$198 = 0; + break; + } else if ((label | 0) == 40) { + _arLog(0, 3, 26164, $vararg_buffer49); + _fclose($$096) | 0; + _exit(0); + } else if ((label | 0) == 43) { + _arLog(0, 3, 26164, $vararg_buffer57); + _fclose($$096) | 0; + _exit(0); + } else if ((label | 0) == 47) { + _arLog(0, 3, 26164, $vararg_buffer65); + _fclose($$096) | 0; + _exit(0); + } else if ((label | 0) == 55) { + _arLog(0, 3, 45930, $vararg_buffer67); + _exit(1); + } else if ((label | 0) == 57) { + if ($$096 | 0) _fclose($$096) | 0; + if ((HEAP32[$5 >> 2] | 0) >= ($$sink | 0)) { + $$198 = $18; + break; + } + _exit(0); + } + } while (0); + STACKTOP = sp; + return $$198 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseNestedNameEPNS5_9NameStateE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$3 = 0, $$4 = 0, $$byval_copy = 0, $13 = 0, $19 = 0, $2 = 0, $20 = 0, $3 = 0, $32 = 0, $36 = 0, $37 = 0, $4 = 0, $47 = 0, $5 = 0, $53 = 0, $58 = 0, $60 = 0, $7 = 0, $8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy = sp + 32 | 0; + $2 = sp + 20 | 0; + $3 = sp + 24 | 0; + $4 = sp + 8 | 0; + $5 = sp; + HEAP32[$2 >> 2] = $1; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 78) | 0) { + $7 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseCVQualifiersEv($0) | 0; + $8 = ($1 | 0) == 0; + if (!$8) HEAP32[$1 + 4 >> 2] = $7; + do if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 79) | 0) { + if (!$8) HEAP8[$1 + 8 >> 0] = 2; + } else { + $13 = ($1 | 0) != 0; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 82) | 0) { + if (!$13) break; + HEAP8[$1 + 8 >> 0] = 1; + break; + } else { + if (!$13) break; + HEAP8[$1 + 8 >> 0] = 0; + break; + } + } while (0); + HEAP32[$3 >> 2] = 0; + HEAP32[$4 >> 2] = $0; + HEAP32[$4 + 4 >> 2] = $3; + HEAP32[$4 + 8 >> 2] = $2; + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 55118); + HEAP32[$$byval_copy >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy) | 0) { + $19 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA4_KcEEEPNS0_4NodeEDpOT0_($0, 55436) | 0; + HEAP32[$3 >> 2] = $19; + } + $20 = $0 + 148 | 0; + L19 : while (1) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) { + label = 41; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 76) | 0; + L22 : do if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 77) | 0) { + if (!(HEAP32[$3 >> 2] | 0)) { + $$3 = 0; + break L19; + } + } else { + L25 : do switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24) { + case 84: + { + if (!(__ZZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseNestedNameEPNS5_9NameStateEENKUlPNS0_4NodeEE_clES9_($4, __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E18parseTemplateParamEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0) | 0)) { + $$3 = 0; + break L19; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($20, $3); + break L22; + break; + } + case 73: + { + $32 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseTemplateArgsEb(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0, (HEAP32[$2 >> 2] | 0) != 0) | 0; + HEAP32[$$byval_copy >> 2] = $32; + if (($32 | 0) == 0 | (HEAP32[$3 >> 2] | 0) == 0) { + label = 26; + break L19; + } + $36 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20NameWithTemplateArgsEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $3, $$byval_copy) | 0; + HEAP32[$3 >> 2] = $36; + $37 = HEAP32[$2 >> 2] | 0; + if ($37 | 0) HEAP8[$37 + 1 >> 0] = 1; + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($20, $3); + break L22; + break; + } + case 68: + { + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24) { + case 67: + { + label = 39; + break L25; + break; + } + case 84: + case 116: + break; + default: + break L25; + } + if (!(__ZZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseNestedNameEPNS5_9NameStateEENKUlPNS0_4NodeEE_clES9_($4, __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseDecltypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0) | 0)) { + $$3 = 0; + break L19; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($20, $3); + break L22; + break; + } + case 83: + { + if ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 == 116) label = 39; else { + $47 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseSubstitutionEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy >> 2] = $47; + if (!(__ZZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseNestedNameEPNS5_9NameStateEENKUlPNS0_4NodeEE_clES9_($4, $47) | 0)) { + label = 44; + break L19; + } + if ((HEAP32[$3 >> 2] | 0) != ($47 | 0)) __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($20, $$byval_copy); + break L22; + } + break; + } + case 67: + break; + default: + label = 39; + } while (0); + if ((label | 0) == 39) { + label = 0; + $60 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + if (!(__ZZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseNestedNameEPNS5_9NameStateEENKUlPNS0_4NodeEE_clES9_($4, __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20parseUnqualifiedNameEPNS5_9NameStateE($60, HEAP32[$2 >> 2] | 0) | 0) | 0)) { + $$3 = 0; + break L19; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($20, $3); + break; + } + if (!(HEAP32[$3 >> 2] | 0)) { + $$3 = 0; + break L19; + } + $53 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + if (!(__ZZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseNestedNameEPNS5_9NameStateEENKUlPNS0_4NodeEE_clES9_($4, __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseCtorDtorNameERPNS0_4NodeEPNS5_9NameStateE($53, $3, HEAP32[$2 >> 2] | 0) | 0) | 0)) { + $$3 = 0; + break L19; + } + $58 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E12parseAbiTagsEPNS0_4NodeE($53, HEAP32[$3 >> 2] | 0) | 0; + HEAP32[$3 >> 2] = $58; + if (!$58) { + $$3 = 0; + break L19; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($20, $3); + } while (0); + } + if ((label | 0) == 26) $$3 = 0; else if ((label | 0) == 41) if ((HEAP32[$3 >> 2] | 0) != 0 ? !(__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE5emptyEv($20) | 0) : 0) { + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE8pop_backEv($20); + $$3 = HEAP32[$3 >> 2] | 0; + } else $$3 = 0; else if ((label | 0) == 44) $$3 = 0; + $$4 = $$3; + } else $$4 = 0; + STACKTOP = sp; + return $$4 | 0; +} + +function _get_sof($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$0192 = 0, $$0193 = 0, $$0205$lcssa = 0, $$0205222 = 0, $$0208219 = 0, $$0211218 = 0, $$0213229 = 0, $$1 = 0, $$10 = 0, $$10203 = 0, $$11 = 0, $$11204 = 0, $$1194 = 0, $$1209$lcssa = 0, $$1209220 = 0, $$1209223 = 0, $$1212221 = 0, $$2 = 0, $$2195 = 0, $$2207 = 0, $$2210 = 0, $$3 = 0, $$3196 = 0, $$4 = 0, $$4197 = 0, $$5 = 0, $$5198 = 0, $$6 = 0, $$6199 = 0, $$7 = 0, $$7200 = 0, $$8 = 0, $$8$lcssa = 0, $$8201 = 0, $$8201$lcssa = 0, $$8201228 = 0, $$8201234 = 0, $$8227 = 0, $$8233 = 0, $$9 = 0, $$9202 = 0, $109 = 0, $110 = 0, $111 = 0, $124 = 0, $129 = 0, $136 = 0, $138 = 0, $142 = 0, $144 = 0, $147 = 0, $155 = 0, $158 = 0, $165 = 0, $166 = 0, $168 = 0, $169 = 0, $173 = 0, $175 = 0, $180 = 0, $189 = 0, $19 = 0, $190 = 0, $192 = 0, $194 = 0, $196 = 0, $20 = 0, $205 = 0, $206 = 0, $23 = 0, $31 = 0, $32 = 0, $35 = 0, $43 = 0, $44 = 0, $5 = 0, $55 = 0, $56 = 0, $59 = 0, $6 = 0, $60 = 0, $68 = 0, $69 = 0, $7 = 0, $73 = 0, $8 = 0, $81 = 0, $82 = 0, $85 = 0, $86 = 0, $94 = 0, $95 = 0, $99 = 0, label = 0; + $5 = HEAP32[$0 + 24 >> 2] | 0; + $6 = HEAP32[$5 >> 2] | 0; + $7 = $5 + 4 | 0; + $8 = HEAP32[$7 >> 2] | 0; + HEAP32[$0 + 220 >> 2] = $1; + HEAP32[$0 + 224 >> 2] = $2; + HEAP32[$0 + 228 >> 2] = $3; + do if (!$8) if (!(FUNCTION_TABLE_ii[HEAP32[$5 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + return $$0 | 0; + } else { + $$0192 = HEAP32[$7 >> 2] | 0; + $$0193 = HEAP32[$5 >> 2] | 0; + break; + } else { + $$0192 = $8; + $$0193 = $6; + } while (0); + $19 = $$0192 + -1 | 0; + $20 = $$0193 + 1 | 0; + $23 = (HEAPU8[$$0193 >> 0] | 0) << 8; + do if (!$19) if (!(FUNCTION_TABLE_ii[HEAP32[$5 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + return $$0 | 0; + } else { + $$1 = HEAP32[$7 >> 2] | 0; + $$1194 = HEAP32[$5 >> 2] | 0; + break; + } else { + $$1 = $19; + $$1194 = $20; + } while (0); + $31 = $$1 + -1 | 0; + $32 = $$1194 + 1 | 0; + $35 = $23 | (HEAPU8[$$1194 >> 0] | 0); + do if (!$31) if (!(FUNCTION_TABLE_ii[HEAP32[$5 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + return $$0 | 0; + } else { + $$2 = HEAP32[$7 >> 2] | 0; + $$2195 = HEAP32[$5 >> 2] | 0; + break; + } else { + $$2 = $31; + $$2195 = $32; + } while (0); + $43 = $$2 + -1 | 0; + $44 = $$2195 + 1 | 0; + HEAP32[$0 + 212 >> 2] = HEAPU8[$$2195 >> 0]; + do if (!$43) if (!(FUNCTION_TABLE_ii[HEAP32[$5 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + return $$0 | 0; + } else { + $$3 = HEAP32[$7 >> 2] | 0; + $$3196 = HEAP32[$5 >> 2] | 0; + break; + } else { + $$3 = $43; + $$3196 = $44; + } while (0); + $55 = $$3 + -1 | 0; + $56 = $$3196 + 1 | 0; + $59 = (HEAPU8[$$3196 >> 0] | 0) << 8; + $60 = $0 + 32 | 0; + HEAP32[$60 >> 2] = $59; + do if (!$55) if (!(FUNCTION_TABLE_ii[HEAP32[$5 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + return $$0 | 0; + } else { + $$4 = HEAP32[$7 >> 2] | 0; + $$4197 = HEAP32[$5 >> 2] | 0; + $73 = HEAP32[$60 >> 2] | 0; + break; + } else { + $$4 = $55; + $$4197 = $56; + $73 = $59; + } while (0); + $68 = $$4 + -1 | 0; + $69 = $$4197 + 1 | 0; + HEAP32[$60 >> 2] = $73 + (HEAPU8[$$4197 >> 0] | 0); + do if (!$68) if (!(FUNCTION_TABLE_ii[HEAP32[$5 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + return $$0 | 0; + } else { + $$5 = HEAP32[$7 >> 2] | 0; + $$5198 = HEAP32[$5 >> 2] | 0; + break; + } else { + $$5 = $68; + $$5198 = $69; + } while (0); + $81 = $$5 + -1 | 0; + $82 = $$5198 + 1 | 0; + $85 = (HEAPU8[$$5198 >> 0] | 0) << 8; + $86 = $0 + 28 | 0; + HEAP32[$86 >> 2] = $85; + do if (!$81) if (!(FUNCTION_TABLE_ii[HEAP32[$5 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + return $$0 | 0; + } else { + $$6 = HEAP32[$7 >> 2] | 0; + $$6199 = HEAP32[$5 >> 2] | 0; + $99 = HEAP32[$86 >> 2] | 0; + break; + } else { + $$6 = $81; + $$6199 = $82; + $99 = $85; + } while (0); + $94 = $$6 + -1 | 0; + $95 = $$6199 + 1 | 0; + HEAP32[$86 >> 2] = $99 + (HEAPU8[$$6199 >> 0] | 0); + do if (!$94) if (!(FUNCTION_TABLE_ii[HEAP32[$5 + 12 >> 2] & 127]($0) | 0)) { + $$0 = 0; + return $$0 | 0; + } else { + $$7 = HEAP32[$7 >> 2] | 0; + $$7200 = HEAP32[$5 >> 2] | 0; + break; + } else { + $$7 = $94; + $$7200 = $95; + } while (0); + $109 = $0 + 36 | 0; + HEAP32[$109 >> 2] = HEAPU8[$$7200 >> 0]; + $110 = $35 + -8 | 0; + $111 = HEAP32[$0 >> 2] | 0; + HEAP32[$111 + 24 >> 2] = HEAP32[$0 + 440 >> 2]; + HEAP32[$111 + 28 >> 2] = HEAP32[$86 >> 2]; + HEAP32[$111 + 32 >> 2] = HEAP32[$60 >> 2]; + HEAP32[$111 + 36 >> 2] = HEAP32[$109 >> 2]; + HEAP32[$111 + 20 >> 2] = 102; + FUNCTION_TABLE_vii[HEAP32[$111 + 4 >> 2] & 255]($0, 1); + $124 = $0 + 464 | 0; + if (HEAP32[(HEAP32[$124 >> 2] | 0) + 16 >> 2] | 0) { + $129 = HEAP32[$0 >> 2] | 0; + HEAP32[$129 + 20 >> 2] = 61; + FUNCTION_TABLE_vi[HEAP32[$129 >> 2] & 255]($0); + } + if (((HEAP32[$60 >> 2] | 0) != 0 ? (HEAP32[$86 >> 2] | 0) != 0 : 0) ? ($136 = HEAP32[$109 >> 2] | 0, ($136 | 0) >= 1) : 0) $142 = $136; else { + $138 = HEAP32[$0 >> 2] | 0; + HEAP32[$138 + 20 >> 2] = 33; + FUNCTION_TABLE_vi[HEAP32[$138 >> 2] & 255]($0); + $142 = HEAP32[$109 >> 2] | 0; + } + if (($110 | 0) != ($142 * 3 | 0)) { + $144 = HEAP32[$0 >> 2] | 0; + HEAP32[$144 + 20 >> 2] = 12; + FUNCTION_TABLE_vi[HEAP32[$144 >> 2] & 255]($0); + } + $147 = $0 + 216 | 0; + if (!(HEAP32[$147 >> 2] | 0)) { + $155 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$0 + 4 >> 2] >> 2] & 63]($0, 1, (HEAP32[$109 >> 2] | 0) * 88 | 0) | 0; + HEAP32[$147 >> 2] = $155; + } + $$8227 = $$7 + -1 | 0; + $$8201228 = $$7200 + 1 | 0; + L64 : do if ((HEAP32[$109 >> 2] | 0) > 0) { + $158 = $5 + 12 | 0; + $$0213229 = 0; + $$8201234 = $$8201228; + $$8233 = $$8227; + while (1) { + if (!$$8233) { + if (!(FUNCTION_TABLE_ii[HEAP32[$158 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 57; + break; + } + $$9 = HEAP32[$7 >> 2] | 0; + $$9202 = HEAP32[$5 >> 2] | 0; + } else { + $$9 = $$8233; + $$9202 = $$8201234; + } + $165 = $$9 + -1 | 0; + $166 = $$9202 + 1 | 0; + $168 = HEAPU8[$$9202 >> 0] | 0; + $169 = HEAP32[$147 >> 2] | 0; + L72 : do if (!$$0213229) { + $$2207 = $168; + $$2210 = $169; + } else { + $$0208219 = $169; + $$0211218 = 0; + while (1) { + if ((HEAP32[$$0208219 >> 2] | 0) == ($168 | 0)) break; + $$0211218 = $$0211218 + 1 | 0; + $180 = $$0208219 + 88 | 0; + if ($$0211218 >>> 0 >= $$0213229 >>> 0) { + $$2207 = $168; + $$2210 = $180; + break L72; + } else $$0208219 = $180; + } + $173 = HEAP32[$169 >> 2] | 0; + $$1209220 = $169 + 88 | 0; + if ($$0213229 >>> 0 > 1) { + $$0205222 = $173; + $$1209223 = $$1209220; + $$1212221 = 1; + while (1) { + $175 = HEAP32[$$1209223 >> 2] | 0; + $$0205222 = ($175 | 0) > ($$0205222 | 0) ? $175 : $$0205222; + $$1212221 = $$1212221 + 1 | 0; + if (($$1212221 | 0) == ($$0213229 | 0)) break; else $$1209223 = $$1209223 + 88 | 0; + } + $$0205$lcssa = $$0205222; + $$1209$lcssa = $169 + ($$0213229 * 88 | 0) | 0; + } else { + $$0205$lcssa = $173; + $$1209$lcssa = $$1209220; + } + $$2207 = $$0205$lcssa + 1 | 0; + $$2210 = $$1209$lcssa; + } while (0); + HEAP32[$$2210 >> 2] = $$2207; + HEAP32[$$2210 + 4 >> 2] = $$0213229; + if (!$165) { + if (!(FUNCTION_TABLE_ii[HEAP32[$158 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 57; + break; + } + $$10 = HEAP32[$7 >> 2] | 0; + $$10203 = HEAP32[$5 >> 2] | 0; + } else { + $$10 = $165; + $$10203 = $166; + } + $189 = $$10 + -1 | 0; + $190 = $$10203 + 1 | 0; + $192 = HEAPU8[$$10203 >> 0] | 0; + $194 = $$2210 + 8 | 0; + HEAP32[$194 >> 2] = $192 >>> 4; + $196 = $$2210 + 12 | 0; + HEAP32[$196 >> 2] = $192 & 15; + if (!$189) { + if (!(FUNCTION_TABLE_ii[HEAP32[$158 >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 57; + break; + } + $$11 = HEAP32[$7 >> 2] | 0; + $$11204 = HEAP32[$5 >> 2] | 0; + } else { + $$11 = $189; + $$11204 = $190; + } + $205 = $$2210 + 16 | 0; + HEAP32[$205 >> 2] = HEAPU8[$$11204 >> 0]; + $206 = HEAP32[$0 >> 2] | 0; + HEAP32[$206 + 24 >> 2] = HEAP32[$$2210 >> 2]; + HEAP32[$206 + 28 >> 2] = HEAP32[$194 >> 2]; + HEAP32[$206 + 32 >> 2] = HEAP32[$196 >> 2]; + HEAP32[$206 + 36 >> 2] = HEAP32[$205 >> 2]; + HEAP32[$206 + 20 >> 2] = 103; + FUNCTION_TABLE_vii[HEAP32[$206 + 4 >> 2] & 255]($0, 1); + $$0213229 = $$0213229 + 1 | 0; + $$8 = $$11 + -1 | 0; + $$8201 = $$11204 + 1 | 0; + if (($$0213229 | 0) >= (HEAP32[$109 >> 2] | 0)) { + $$8$lcssa = $$8; + $$8201$lcssa = $$8201; + break L64; + } else { + $$8201234 = $$8201; + $$8233 = $$8; + } + } + if ((label | 0) == 57) return $$0 | 0; + } else { + $$8$lcssa = $$8227; + $$8201$lcssa = $$8201228; + } while (0); + HEAP32[(HEAP32[$124 >> 2] | 0) + 16 >> 2] = 1; + HEAP32[$5 >> 2] = $$8201$lcssa; + HEAP32[$7 >> 2] = $$8$lcssa; + $$0 = 1; + return $$0 | 0; +} + +function __ZN6vision32ComputeSubpixelHessianSameOctaveEPfS0_RKNS_5ImageES3_S3_ii($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $10 = 0, $101 = 0, $105 = 0, $106 = 0, $11 = 0, $114 = 0, $119 = 0, $12 = 0, $123 = 0, $125 = 0, $127 = 0, $129 = 0, $131 = 0, $133 = 0, $135 = 0, $137 = 0, $138 = 0.0, $139 = 0.0, $145 = 0.0, $157 = 0.0, $165 = 0.0, $167 = 0, $22 = 0, $27 = 0, $31 = 0, $32 = 0, $34 = 0, $42 = 0, $47 = 0, $51 = 0, $52 = 0, $60 = 0, $65 = 0, $69 = 0, $7 = 0, $70 = 0, $78 = 0, $8 = 0, $83 = 0, $87 = 0, $88 = 0, $9 = 0, $96 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $7 = sp + 20 | 0; + $8 = sp + 16 | 0; + $9 = sp + 12 | 0; + $10 = sp + 8 | 0; + $11 = sp + 4 | 0; + $12 = sp; + if (($5 | 0) > 0 ? ($5 + 1 | 0) >>> 0 < (__ZNK6vision5Image5widthEv($3) | 0) >>> 0 : 0) { + $32 = $6 + -1 | 0; + if (($6 | 0) > 0 ? ($34 = $6 + 1 | 0, $34 >>> 0 < (__ZNK6vision5Image6heightEv($3) | 0) >>> 0) : 0) { + $52 = __ZNK6vision5Image5widthEv($2) | 0; + if (($52 | 0) != (__ZNK6vision5Image5widthEv($3) | 0)) { + $60 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30218) | 0, 28600) | 0, 39072) | 0, 311) | 0, 39079) | 0, 29150) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $60 + (HEAP32[(HEAP32[$60 >> 2] | 0) + -12 >> 2] | 0) | 0); + $65 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $69 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$65 >> 2] | 0) + 28 >> 2] & 127]($65, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($60, $69) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($60) | 0; + _abort(); + } + $70 = __ZNK6vision5Image5widthEv($2) | 0; + if (($70 | 0) != (__ZNK6vision5Image5widthEv($4) | 0)) { + $78 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30617) | 0, 28600) | 0, 39072) | 0, 312) | 0, 39079) | 0, 29150) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $78 + (HEAP32[(HEAP32[$78 >> 2] | 0) + -12 >> 2] | 0) | 0); + $83 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $87 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$83 >> 2] | 0) + 28 >> 2] & 127]($83, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($78, $87) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($78) | 0; + _abort(); + } + $88 = __ZNK6vision5Image6heightEv($2) | 0; + if (($88 | 0) != (__ZNK6vision5Image6heightEv($3) | 0)) { + $96 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30270) | 0, 28600) | 0, 39072) | 0, 313) | 0, 39079) | 0, 29150) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $96 + (HEAP32[(HEAP32[$96 >> 2] | 0) + -12 >> 2] | 0) | 0); + $101 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $105 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$101 >> 2] | 0) + 28 >> 2] & 127]($101, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($96, $105) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($96) | 0; + _abort(); + } + $106 = __ZNK6vision5Image6heightEv($2) | 0; + if (($106 | 0) == (__ZNK6vision5Image6heightEv($4) | 0)) { + $125 = (__ZNK6vision5Image3getIfEEPKT_m($2, $32) | 0) + ($5 << 2) | 0; + $127 = (__ZNK6vision5Image3getIfEEPKT_m($2, $6) | 0) + ($5 << 2) | 0; + $129 = (__ZNK6vision5Image3getIfEEPKT_m($2, $34) | 0) + ($5 << 2) | 0; + $131 = (__ZNK6vision5Image3getIfEEPKT_m($3, $6) | 0) + ($5 << 2) | 0; + $133 = (__ZNK6vision5Image3getIfEEPKT_m($4, $32) | 0) + ($5 << 2) | 0; + $135 = (__ZNK6vision5Image3getIfEEPKT_m($4, $6) | 0) + ($5 << 2) | 0; + $137 = (__ZNK6vision5Image3getIfEEPKT_m($4, $34) | 0) + ($5 << 2) | 0; + __ZN6vision26ComputeSubpixelDerivativesERfS0_S0_S0_S0_RKNS_5ImageEii($8, $9, $10, $11, $12, $3, $5, $6); + $138 = +HEAPF32[$135 >> 2]; + $139 = +HEAPF32[$127 >> 2]; + $145 = $138 + ($139 - +HEAPF32[$131 >> 2] * 2.0); + $157 = (+HEAPF32[$127 + -4 >> 2] - +HEAPF32[$127 + 4 >> 2] + (+HEAPF32[$135 + 4 >> 2] - +HEAPF32[$135 + -4 >> 2])) * .25; + $165 = (+HEAPF32[$125 >> 2] - +HEAPF32[$129 >> 2] + (+HEAPF32[$137 >> 2] - +HEAPF32[$133 >> 2])) * .25; + HEAP32[$0 >> 2] = HEAP32[$10 >> 2]; + $167 = HEAP32[$12 >> 2] | 0; + HEAP32[$0 + 4 >> 2] = $167; + HEAPF32[$0 + 8 >> 2] = $157; + HEAP32[$0 + 12 >> 2] = $167; + HEAP32[$0 + 16 >> 2] = HEAP32[$11 >> 2]; + HEAPF32[$0 + 20 >> 2] = $165; + HEAPF32[$0 + 24 >> 2] = $157; + HEAPF32[$0 + 28 >> 2] = $165; + HEAPF32[$0 + 32 >> 2] = $145; + HEAPF32[$1 >> 2] = -+HEAPF32[$8 >> 2]; + HEAPF32[$1 + 4 >> 2] = -+HEAPF32[$9 >> 2]; + HEAPF32[$1 + 8 >> 2] = -(($138 - $139) * .5); + STACKTOP = sp; + return; + } else { + $114 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30669) | 0, 28600) | 0, 39072) | 0, 314) | 0, 39079) | 0, 29150) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $114 + (HEAP32[(HEAP32[$114 >> 2] | 0) + -12 >> 2] | 0) | 0); + $119 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $123 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$119 >> 2] | 0) + 28 >> 2] & 127]($119, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($114, $123) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($114) | 0; + _abort(); + } + } + $42 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 29018) | 0, 28600) | 0, 39072) | 0, 310) | 0, 39079) | 0, 29077) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $42 + (HEAP32[(HEAP32[$42 >> 2] | 0) + -12 >> 2] | 0) | 0); + $47 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $51 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$47 >> 2] | 0) + 28 >> 2] & 127]($47, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($42, $51) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($42) | 0; + _abort(); + } + $22 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 28944) | 0, 28600) | 0, 39072) | 0, 309) | 0, 39079) | 0, 29002) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $22 + (HEAP32[(HEAP32[$22 >> 2] | 0) + -12 >> 2] | 0) | 0); + $27 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $31 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$27 >> 2] | 0) + 28 >> 2] & 127]($27, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($22, $31) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($22) | 0; + _abort(); +} + +function _start_pass_huff_decoder($0) { + $0 = $0 | 0; + var $$0242284 = 0, $$0243291 = 0, $$0295 = 0, $$1287 = 0, $$2285 = 0, $$off = 0, $$off251 = 0, $$off252 = 0, $$off253 = 0, $$off254 = 0, $$off255 = 0, $$off256 = 0, $$off257 = 0, $$off258 = 0, $$off259 = 0, $$off262 = 0, $$off263 = 0, $$pre$phi308Z2D = 0, $$sink = 0, $10 = 0, $100 = 0, $102 = 0, $106 = 0, $109 = 0, $110 = 0, $113 = 0, $127 = 0, $132 = 0, $136 = 0, $140 = 0, $144 = 0, $146 = 0, $151 = 0, $157 = 0, $163 = 0, $178 = 0, $180 = 0, $2 = 0, $20 = 0, $22 = 0, $235 = 0, $236 = 0, $237 = 0, $238 = 0, $239 = 0, $240 = 0, $27 = 0, $28 = 0, $44 = 0, $45 = 0, $47 = 0, $48 = 0, $49 = 0, $53 = 0, $54 = 0, $55 = 0, $6 = 0, $60 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $76 = 0, $8 = 0, $89 = 0, $9 = 0, $93 = 0, $94 = 0, $97 = 0, $98 = 0, label = 0; + $2 = HEAP32[$0 + 468 >> 2] | 0; + $6 = $0 + 412 | 0; + $7 = HEAP32[$6 >> 2] | 0; + $8 = ($7 | 0) == 0; + if (!(HEAP32[$0 + 224 >> 2] | 0)) { + if (($8 ? (HEAP32[$0 + 420 >> 2] | 0) == 0 : 0) ? (HEAP32[$0 + 424 >> 2] | 0) == 0 : 0) { + $127 = HEAP32[$0 + 416 >> 2] | 0; + if ((HEAP32[$0 + 220 >> 2] | 0) != 0 | ($127 | 0) < 64 ? ($127 | 0) != (HEAP32[$0 + 436 >> 2] | 0) : 0) label = 38; + } else label = 38; + if ((label | 0) == 38) { + $132 = HEAP32[$0 >> 2] | 0; + HEAP32[$132 + 20 >> 2] = 125; + FUNCTION_TABLE_vii[HEAP32[$132 + 4 >> 2] & 255]($0, -1); + } + $136 = $0 + 436 | 0; + HEAP32[$2 + 4 >> 2] = (HEAP32[$136 >> 2] | 0) == 63 ? 64 : 65; + $140 = $0 + 340 | 0; + if ((HEAP32[$140 >> 2] | 0) > 0) { + $$2285 = 0; + do { + $144 = HEAP32[$0 + 344 + ($$2285 << 2) >> 2] | 0; + $146 = HEAP32[$144 + 20 >> 2] | 0; + _jpeg_make_d_derived_tbl($0, 1, $146, $2 + 68 + ($146 << 2) | 0); + if (HEAP32[$136 >> 2] | 0) { + $151 = HEAP32[$144 + 24 >> 2] | 0; + _jpeg_make_d_derived_tbl($0, 0, $151, $2 + 84 + ($151 << 2) | 0); + } + HEAP32[$2 + 24 + ($$2285 << 2) >> 2] = 0; + $$2285 = $$2285 + 1 | 0; + } while (($$2285 | 0) < (HEAP32[$140 >> 2] | 0)); + } + $157 = $0 + 368 | 0; + if ((HEAP32[$157 >> 2] | 0) <= 0) { + $235 = $2 + 16 | 0; + HEAP32[$235 >> 2] = 0; + $236 = $2 + 12 | 0; + HEAP32[$236 >> 2] = 0; + $237 = $2 + 40 | 0; + HEAP32[$237 >> 2] = 0; + $238 = $0 + 280 | 0; + $239 = HEAP32[$238 >> 2] | 0; + $240 = $2 + 44 | 0; + HEAP32[$240 >> 2] = $239; + return; + } + $$0242284 = 0; + do { + $163 = HEAP32[$0 + 344 + (HEAP32[$0 + 372 + ($$0242284 << 2) >> 2] << 2) >> 2] | 0; + HEAP32[$2 + 100 + ($$0242284 << 2) >> 2] = HEAP32[$2 + 68 + (HEAP32[$163 + 20 >> 2] << 2) >> 2]; + HEAP32[$2 + 140 + ($$0242284 << 2) >> 2] = HEAP32[$2 + 84 + (HEAP32[$163 + 24 >> 2] << 2) >> 2]; + L24 : do if (!(HEAP32[$163 + 52 >> 2] | 0)) $$sink = 0; else { + $178 = HEAP32[$163 + 40 >> 2] | 0; + $180 = HEAP32[$163 + 36 >> 2] | 0; + switch (HEAP32[$136 >> 2] | 0) { + case 0: + { + $$sink = 1; + break L24; + break; + } + case 3: + { + $$sink = (HEAP32[4336 + ((($178 | 0) != 1 & 1) << 3) + ((($180 | 0) != 1 & 1) << 2) >> 2] | 0) + 1 | 0; + break L24; + break; + } + case 8: + { + $$off258 = $178 + -1 | 0; + $$off259 = $180 + -1 | 0; + $$sink = (HEAP32[4352 + (($$off258 >>> 0 < 2 ? $$off258 : 2) * 12 | 0) + (($$off259 >>> 0 < 2 ? $$off259 : 2) << 2) >> 2] | 0) + 1 | 0; + break L24; + break; + } + case 15: + { + $$off256 = $178 + -1 | 0; + $$off257 = $180 + -1 | 0; + $$sink = (HEAP32[4400 + (($$off256 >>> 0 < 3 ? $$off256 : 3) << 4) + (($$off257 >>> 0 < 3 ? $$off257 : 3) << 2) >> 2] | 0) + 1 | 0; + break L24; + break; + } + case 24: + { + $$off254 = $178 + -1 | 0; + $$off255 = $180 + -1 | 0; + $$sink = (HEAP32[4464 + (($$off254 >>> 0 < 4 ? $$off254 : 4) * 20 | 0) + (($$off255 >>> 0 < 4 ? $$off255 : 4) << 2) >> 2] | 0) + 1 | 0; + break L24; + break; + } + case 35: + { + $$off252 = $178 + -1 | 0; + $$off253 = $180 + -1 | 0; + $$sink = (HEAP32[4576 + (($$off252 >>> 0 < 5 ? $$off252 : 5) * 24 | 0) + (($$off253 >>> 0 < 5 ? $$off253 : 5) << 2) >> 2] | 0) + 1 | 0; + break L24; + break; + } + case 48: + { + $$off = $178 + -1 | 0; + $$off251 = $180 + -1 | 0; + $$sink = (HEAP32[4720 + (($$off >>> 0 < 6 ? $$off : 6) * 28 | 0) + (($$off251 >>> 0 < 6 ? $$off251 : 6) << 2) >> 2] | 0) + 1 | 0; + break L24; + break; + } + default: + { + $$off262 = $178 + -1 | 0; + $$off263 = $180 + -1 | 0; + $$sink = (HEAP32[4928 + (($$off262 >>> 0 < 7 ? $$off262 : 7) << 5) + (($$off263 >>> 0 < 7 ? $$off263 : 7) << 2) >> 2] | 0) + 1 | 0; + break L24; + } + } + } while (0); + HEAP32[$2 + 180 + ($$0242284 << 2) >> 2] = $$sink; + $$0242284 = $$0242284 + 1 | 0; + } while (($$0242284 | 0) < (HEAP32[$157 >> 2] | 0)); + $235 = $2 + 16 | 0; + HEAP32[$235 >> 2] = 0; + $236 = $2 + 12 | 0; + HEAP32[$236 >> 2] = 0; + $237 = $2 + 40 | 0; + HEAP32[$237 >> 2] = 0; + $238 = $0 + 280 | 0; + $239 = HEAP32[$238 >> 2] | 0; + $240 = $2 + 44 | 0; + HEAP32[$240 >> 2] = $239; + return; + } + $9 = $0 + 416 | 0; + $10 = HEAP32[$9 >> 2] | 0; + if ($8) if (!$10) label = 7; else label = 11; else if ((($10 | 0) >= ($7 | 0) ? ($10 | 0) <= (HEAP32[$0 + 436 >> 2] | 0) : 0) ? (HEAP32[$0 + 340 >> 2] | 0) == 1 : 0) label = 7; else label = 11; + do if ((label | 0) == 7) { + $20 = HEAP32[$0 + 420 >> 2] | 0; + if ($20) { + $22 = $20 + -1 | 0; + if (($22 | 0) == (HEAP32[$0 + 424 >> 2] | 0)) $27 = $22; else { + label = 11; + break; + } + } else $27 = HEAP32[$0 + 424 >> 2] | 0; + if (($27 | 0) > 13) label = 11; + } while (0); + if ((label | 0) == 11) { + $28 = HEAP32[$0 >> 2] | 0; + HEAP32[$28 + 20 >> 2] = 17; + HEAP32[$28 + 24 >> 2] = $7; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = HEAP32[$9 >> 2]; + HEAP32[(HEAP32[$0 >> 2] | 0) + 32 >> 2] = HEAP32[$0 + 420 >> 2]; + HEAP32[(HEAP32[$0 >> 2] | 0) + 36 >> 2] = HEAP32[$0 + 424 >> 2]; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $44 = $0 + 340 | 0; + $45 = HEAP32[$44 >> 2] | 0; + if (($45 | 0) > 0) { + $47 = $0 + 160 | 0; + $48 = $0 + 420 | 0; + $49 = $0 + 424 | 0; + $$0295 = 0; + do { + $53 = HEAP32[(HEAP32[$0 + 344 + ($$0295 << 2) >> 2] | 0) + 4 >> 2] | 0; + $54 = HEAP32[$47 >> 2] | 0; + $55 = HEAP32[$6 >> 2] | 0; + if ($55) if ((HEAP32[$54 + ($53 << 8) >> 2] | 0) < 0) { + $60 = HEAP32[$0 >> 2] | 0; + HEAP32[$60 + 20 >> 2] = 118; + HEAP32[$60 + 24 >> 2] = $53; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, -1); + $70 = HEAP32[$6 >> 2] | 0; + } else $70 = $55; else $70 = 0; + if (($70 | 0) <= (HEAP32[$9 >> 2] | 0)) { + $$0243291 = $70; + while (1) { + $71 = $54 + ($53 << 8) + ($$0243291 << 2) | 0; + $72 = HEAP32[$71 >> 2] | 0; + if ((HEAP32[$48 >> 2] | 0) != ((($72 | 0) > 0 ? $72 : 0) | 0)) { + $76 = HEAP32[$0 >> 2] | 0; + HEAP32[$76 + 20 >> 2] = 118; + HEAP32[$76 + 24 >> 2] = $53; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = $$0243291; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, -1); + } + HEAP32[$71 >> 2] = HEAP32[$49 >> 2]; + if (($$0243291 | 0) < (HEAP32[$9 >> 2] | 0)) $$0243291 = $$0243291 + 1 | 0; else break; + } + } + $$0295 = $$0295 + 1 | 0; + $89 = HEAP32[$44 >> 2] | 0; + } while (($$0295 | 0) < ($89 | 0)); + $$pre$phi308Z2D = $48; + $97 = $89; + } else { + $$pre$phi308Z2D = $0 + 420 | 0; + $97 = $45; + } + $93 = HEAP32[$6 >> 2] | 0; + $94 = ($93 | 0) == 0; + HEAP32[$2 + 4 >> 2] = (HEAP32[$$pre$phi308Z2D >> 2] | 0) == 0 ? ($94 ? 60 : 61) : $94 ? 62 : 63; + L69 : do if (($97 | 0) > 0) { + $98 = $2 + 64 | 0; + $$1287 = 0; + $102 = $93; + while (1) { + $100 = HEAP32[$0 + 344 + ($$1287 << 2) >> 2] | 0; + if (!$102) { + if (!(HEAP32[$$pre$phi308Z2D >> 2] | 0)) { + $106 = HEAP32[$100 + 20 >> 2] | 0; + _jpeg_make_d_derived_tbl($0, 1, $106, $2 + 48 + ($106 << 2) | 0); + } + } else { + $109 = HEAP32[$100 + 24 >> 2] | 0; + $110 = $2 + 48 + ($109 << 2) | 0; + _jpeg_make_d_derived_tbl($0, 0, $109, $110); + HEAP32[$98 >> 2] = HEAP32[$110 >> 2]; + } + HEAP32[$2 + 24 + ($$1287 << 2) >> 2] = 0; + $113 = $$1287 + 1 | 0; + if (($113 | 0) >= (HEAP32[$44 >> 2] | 0)) break L69; + $$1287 = $113; + $102 = HEAP32[$6 >> 2] | 0; + } + } while (0); + HEAP32[$2 + 20 >> 2] = 0; + $235 = $2 + 16 | 0; + HEAP32[$235 >> 2] = 0; + $236 = $2 + 12 | 0; + HEAP32[$236 >> 2] = 0; + $237 = $2 + 40 | 0; + HEAP32[$237 >> 2] = 0; + $238 = $0 + 280 | 0; + $239 = HEAP32[$238 >> 2] | 0; + $240 = $2 + 44 | 0; + HEAP32[$240 >> 2] = $239; + return; +} + +function _kpmMatching($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$0224 = 0, $$0225 = 0, $$0226 = 0, $$0227 = 0, $$1 = 0, $$2 = 0, $$3 = 0, $$4 = 0, $$5 = 0, $$6 = 0, $$pre$phi239Z2D = 0, $$pre$phi240Z2D = 0, $101 = 0.0, $103 = 0.0, $104 = 0, $109 = 0, $11 = 0, $113 = 0, $118 = 0, $12 = 0, $121 = 0, $123 = 0.0, $125 = 0.0, $126 = 0, $13 = 0, $131 = 0, $135 = 0, $140 = 0, $141 = 0, $142 = 0, $143 = 0, $148 = 0, $155 = 0, $157 = 0, $159 = 0, $161 = 0, $163 = 0, $164 = 0, $169 = 0, $17 = 0, $175 = 0, $182 = 0.0, $185 = 0, $186 = 0, $192 = 0, $2 = 0, $21 = 0, $22 = 0, $23 = 0, $25 = 0, $26 = 0, $29 = 0, $3 = 0, $30 = 0, $33 = 0, $34 = 0, $37 = 0, $39 = 0.0, $41 = 0.0, $42 = 0, $45 = 0, $48 = 0, $52 = 0, $55 = 0, $57 = 0.0, $59 = 0.0, $60 = 0, $65 = 0, $69 = 0, $7 = 0, $74 = 0, $77 = 0, $79 = 0.0, $81 = 0.0, $82 = 0, $87 = 0, $9 = 0, $91 = 0, $96 = 0, $99 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $vararg_buffer3 = sp + 16 | 0; + $vararg_buffer1 = sp + 8 | 0; + $vararg_buffer = sp; + $2 = sp + 44 | 0; + $3 = sp + 40 | 0; + do if (($0 | 0) != 0 & ($1 | 0) != 0) { + $7 = HEAP32[$0 + 12 >> 2] | 0; + $9 = HEAP32[$0 + 16 >> 2] | 0; + $11 = HEAP32[$0 + 20 >> 2] | 0; + $12 = ($11 | 0) == 1; + if (!$12) { + $13 = _kpmUtilResizeImage($1, $7, $9, $11, $2, $3) | 0; + if (!$13) { + $$0 = -1; + break; + } else { + $$0224 = $13; + $$0226 = 1; + } + } else { + $$0224 = $1; + $$0226 = 0; + } + __ZN6vision20VisualDatabaseFacade5queryEPhmm(HEAP32[$0 >> 2] | 0, $$0224, $7, $9) | 0; + $17 = __ZNK6vision20VisualDatabaseFacade21getQueryFeaturePointsEv(HEAP32[$0 >> 2] | 0) | 0; + $21 = (HEAP32[$17 + 4 >> 2] | 0) - (HEAP32[$17 >> 2] | 0) | 0; + $22 = ($21 | 0) / 20 | 0; + $23 = $0 + 48 | 0; + HEAP32[$23 >> 2] = $22; + L6 : do if (!$21) { + $185 = HEAP32[$0 + 56 >> 2] | 0; + $186 = $0 + 52 | 0; + $$5 = 0; + while (1) { + if (($$5 | 0) >= ($185 | 0)) { + $$pre$phi239Z2D = $186; + $192 = $185; + break L6; + } + HEAP32[(HEAP32[$186 >> 2] | 0) + ($$5 * 68 | 0) + 60 >> 2] = -1; + $$5 = $$5 + 1 | 0; + } + } else { + $25 = $0 + 44 | 0; + $26 = HEAP32[$25 >> 2] | 0; + if (!$26) $29 = $22; else { + _free($26); + $29 = HEAP32[$23 >> 2] | 0; + } + $30 = _malloc($29 << 3) | 0; + HEAP32[$25 >> 2] = $30; + if (!$30) { + _arLog(0, 3, 45930, $vararg_buffer1); + _exit(1); + } + $33 = __ZNK6vision20VisualDatabaseFacade21getQueryFeaturePointsEv(HEAP32[$0 >> 2] | 0) | 0; + L18 : do if ($12) { + $34 = $0 + 4 | 0; + $$0227 = 0; + while (1) { + if (($$0227 | 0) >= (HEAP32[$23 >> 2] | 0)) { + $$pre$phi240Z2D = $34; + break L18; + } + $37 = HEAP32[$33 >> 2] | 0; + $39 = +HEAPF32[$37 + ($$0227 * 20 | 0) >> 2]; + $41 = +HEAPF32[$37 + ($$0227 * 20 | 0) + 4 >> 2]; + $42 = HEAP32[$34 >> 2] | 0; + if (!$42) { + $48 = HEAP32[$25 >> 2] | 0; + HEAPF32[$48 + ($$0227 << 3) >> 2] = $39; + HEAPF32[$48 + ($$0227 << 3) + 4 >> 2] = $41; + } else { + $45 = HEAP32[$25 >> 2] | 0; + _arParamObserv2IdealLTf($42 + 184 | 0, $39, $41, $45 + ($$0227 << 3) | 0, $45 + ($$0227 << 3) + 4 | 0) | 0; + } + $$0227 = $$0227 + 1 | 0; + } + } else switch ($11 | 0) { + case 5: + { + $52 = $0 + 4 | 0; + $$1 = 0; + while (1) { + if (($$1 | 0) >= (HEAP32[$23 >> 2] | 0)) { + $$pre$phi240Z2D = $52; + break L18; + } + $55 = HEAP32[$33 >> 2] | 0; + $57 = +HEAPF32[$55 + ($$1 * 20 | 0) >> 2]; + $59 = +HEAPF32[$55 + ($$1 * 20 | 0) + 4 >> 2]; + $60 = HEAP32[$52 >> 2] | 0; + if (!$60) { + $69 = HEAP32[$25 >> 2] | 0; + HEAPF32[$69 + ($$1 << 3) >> 2] = $57 * 1.5; + HEAPF32[$69 + ($$1 << 3) + 4 >> 2] = $59 * 1.5; + } else { + $65 = HEAP32[$25 >> 2] | 0; + _arParamObserv2IdealLTf($60 + 184 | 0, $57 * 1.5, $59 * 1.5, $65 + ($$1 << 3) | 0, $65 + ($$1 << 3) + 4 | 0) | 0; + } + $$1 = $$1 + 1 | 0; + } + break; + } + case 2: + { + $74 = $0 + 4 | 0; + $$2 = 0; + while (1) { + if (($$2 | 0) >= (HEAP32[$23 >> 2] | 0)) { + $$pre$phi240Z2D = $74; + break L18; + } + $77 = HEAP32[$33 >> 2] | 0; + $79 = +HEAPF32[$77 + ($$2 * 20 | 0) >> 2]; + $81 = +HEAPF32[$77 + ($$2 * 20 | 0) + 4 >> 2]; + $82 = HEAP32[$74 >> 2] | 0; + if (!$82) { + $91 = HEAP32[$25 >> 2] | 0; + HEAPF32[$91 + ($$2 << 3) >> 2] = $79 * 2.0; + HEAPF32[$91 + ($$2 << 3) + 4 >> 2] = $81 * 2.0; + } else { + $87 = HEAP32[$25 >> 2] | 0; + _arParamObserv2IdealLTf($82 + 184 | 0, $79 * 2.0, $81 * 2.0, $87 + ($$2 << 3) | 0, $87 + ($$2 << 3) + 4 | 0) | 0; + } + $$2 = $$2 + 1 | 0; + } + break; + } + case 4: + { + $96 = $0 + 4 | 0; + $$3 = 0; + while (1) { + if (($$3 | 0) >= (HEAP32[$23 >> 2] | 0)) { + $$pre$phi240Z2D = $96; + break L18; + } + $99 = HEAP32[$33 >> 2] | 0; + $101 = +HEAPF32[$99 + ($$3 * 20 | 0) >> 2]; + $103 = +HEAPF32[$99 + ($$3 * 20 | 0) + 4 >> 2]; + $104 = HEAP32[$96 >> 2] | 0; + if (!$104) { + $113 = HEAP32[$25 >> 2] | 0; + HEAPF32[$113 + ($$3 << 3) >> 2] = $101 * 3.0; + HEAPF32[$113 + ($$3 << 3) + 4 >> 2] = $103 * 3.0; + } else { + $109 = HEAP32[$25 >> 2] | 0; + _arParamObserv2IdealLTf($104 + 184 | 0, $101 * 3.0, $103 * 3.0, $109 + ($$3 << 3) | 0, $109 + ($$3 << 3) + 4 | 0) | 0; + } + $$3 = $$3 + 1 | 0; + } + break; + } + default: + { + $118 = $0 + 4 | 0; + $$4 = 0; + while (1) { + if (($$4 | 0) >= (HEAP32[$23 >> 2] | 0)) { + $$pre$phi240Z2D = $118; + break L18; + } + $121 = HEAP32[$33 >> 2] | 0; + $123 = +HEAPF32[$121 + ($$4 * 20 | 0) >> 2]; + $125 = +HEAPF32[$121 + ($$4 * 20 | 0) + 4 >> 2]; + $126 = HEAP32[$118 >> 2] | 0; + if (!$126) { + $135 = HEAP32[$25 >> 2] | 0; + HEAPF32[$135 + ($$4 << 3) >> 2] = $123 * 4.0; + HEAPF32[$135 + ($$4 << 3) + 4 >> 2] = $125 * 4.0; + } else { + $131 = HEAP32[$25 >> 2] | 0; + _arParamObserv2IdealLTf($126 + 184 | 0, $123 * 4.0, $125 * 4.0, $131 + ($$4 << 3) | 0, $131 + ($$4 << 3) + 4 | 0) | 0; + } + $$4 = $$4 + 1 | 0; + } + } + } while (0); + $140 = $0 + 56 | 0; + $141 = $0 + 36 | 0; + $142 = $0 + 52 | 0; + $$0225 = 0; + while (1) { + $143 = HEAP32[$140 >> 2] | 0; + if (($$0225 | 0) >= ($143 | 0)) { + $$pre$phi239Z2D = $142; + $192 = $143; + break L6; + } + $148 = HEAP32[$142 >> 2] | 0; + HEAP32[$148 + ($$0225 * 68 | 0) + 48 >> 2] = HEAP32[(HEAP32[$141 >> 2] | 0) + ($$0225 * 12 | 0) + 8 >> 2]; + HEAP32[$148 + ($$0225 * 68 | 0) + 60 >> 2] = -1; + if (((HEAP32[$148 + ($$0225 * 68 | 0) + 64 >> 2] | 0) == 0 ? ($155 = __ZNK6vision20VisualDatabaseFacade7inliersEv(HEAP32[$0 >> 2] | 0) | 0, $157 = __ZN6vision20VisualDatabaseFacade9matchedIdEv(HEAP32[$0 >> 2] | 0) | 0, ($157 | 0) >= 0) : 0) ? ($159 = HEAP32[$$pre$phi240Z2D >> 2] | 0, $161 = __ZNK6vision20VisualDatabaseFacade18get3DFeaturePointsEi(HEAP32[$0 >> 2] | 0, $157) | 0, $163 = __ZNK6vision20VisualDatabaseFacade21getQueryFeaturePointsEv(HEAP32[$0 >> 2] | 0) | 0, $164 = HEAP32[$142 >> 2] | 0, (__Z21kpmUtilGetPose_binaryP9ARParamLTRKNSt3__26vectorIN6vision7match_tENS1_9allocatorIS4_EEEERKNS2_INS3_7Point3dIfEENS5_ISB_EEEERKNS2_INS3_12FeaturePointENS5_ISG_EEEEPA4_fPf($159, $155, $161, $163, $164 + ($$0225 * 68 | 0) | 0, $164 + ($$0225 * 68 | 0) + 52 | 0) | 0) == 0) : 0) { + $169 = HEAP32[$142 >> 2] | 0; + HEAP32[$169 + ($$0225 * 68 | 0) + 60 >> 2] = 0; + $175 = (HEAP32[$155 + 4 >> 2] | 0) - (HEAP32[$155 >> 2] | 0) >> 3; + HEAP32[$169 + ($$0225 * 68 | 0) + 56 >> 2] = $175; + HEAP32[$169 + ($$0225 * 68 | 0) + 48 >> 2] = HEAP32[$0 + 60 + ($157 << 2) >> 2]; + $182 = +HEAPF32[$169 + ($$0225 * 68 | 0) + 52 >> 2]; + HEAP32[$vararg_buffer3 >> 2] = $$0225; + HEAP32[$vararg_buffer3 + 4 >> 2] = $175; + HEAP32[$vararg_buffer3 + 8 >> 2] = $175; + HEAPF64[$vararg_buffer3 + 16 >> 3] = $182; + _arLog(0, 1, 26659, $vararg_buffer3); + } + $$0225 = $$0225 + 1 | 0; + } + } while (0); + $$6 = 0; + while (1) { + if (($$6 | 0) >= ($192 | 0)) break; + HEAP32[(HEAP32[$$pre$phi239Z2D >> 2] | 0) + ($$6 * 68 | 0) + 64 >> 2] = 0; + $$6 = $$6 + 1 | 0; + } + if (!$$0226) $$0 = 0; else { + _free($$0224); + $$0 = 0; + } + } else { + _arLog(0, 3, 26615, $vararg_buffer); + $$0 = -1; + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN6vision25bilinear_histogram_updateEPfffi($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + $3 = $3 | 0; + var $105 = 0, $11 = 0, $110 = 0, $114 = 0, $121 = 0, $126 = 0, $130 = 0, $137 = 0, $142 = 0, $146 = 0, $148 = 0, $152 = 0, $16 = 0, $20 = 0, $23 = 0.0, $31 = 0, $36 = 0, $4 = 0, $40 = 0, $47 = 0, $52 = 0, $56 = 0, $63 = 0, $68 = 0, $72 = 0, $74 = 0, $77 = 0.0, $78 = 0.0, $80 = 0, $82 = 0, $89 = 0, $94 = 0, $98 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp; + if (!$0) { + $11 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 32520) | 0, 32556) | 0, 39072) | 0, 139) | 0, 39079) | 0, 32643) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $11 + (HEAP32[(HEAP32[$11 >> 2] | 0) + -12 >> 2] | 0) | 0); + $16 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $20 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$16 >> 2] | 0) + 28 >> 2] & 127]($16, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($11, $20) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($11) | 0; + _abort(); + } + if ($1 + .5 > 0.0 ? ($23 = $1 + -.5, $23 < +($3 | 0)) : 0) { + if (!($2 >= 0.0)) { + $47 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 32774) | 0, 32556) | 0, 39072) | 0, 141) | 0, 39079) | 0, 32812) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $47 + (HEAP32[(HEAP32[$47 >> 2] | 0) + -12 >> 2] | 0) | 0); + $52 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $56 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$52 >> 2] | 0) + 28 >> 2] & 127]($52, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($47, $56) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($47) | 0; + _abort(); + } + if (($3 | 0) <= -1) { + $63 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 32841) | 0, 32556) | 0, 39072) | 0, 142) | 0, 39079) | 0, 32878) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $63 + (HEAP32[(HEAP32[$63 >> 2] | 0) + -12 >> 2] | 0) | 0); + $68 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $72 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$68 >> 2] | 0) + 28 >> 2] & 127]($68, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($63, $72) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($63) | 0; + _abort(); + } + $74 = ~~+Math_floor(+$23); + $77 = $1 - +($74 | 0) + -.5; + $78 = 1.0 - $77; + $80 = ($74 + $3 | 0) % ($3 | 0) | 0; + $82 = ($74 + 1 | 0) % ($3 | 0) | 0; + if (!($78 >= 0.0)) { + $89 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 32907) | 0, 32556) | 0, 39072) | 0, 150) | 0, 39079) | 0, 32938) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $89 + (HEAP32[(HEAP32[$89 >> 2] | 0) + -12 >> 2] | 0) | 0); + $94 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $98 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$94 >> 2] | 0) + 28 >> 2] & 127]($94, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($89, $98) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($89) | 0; + _abort(); + } + if (!($77 >= 0.0)) { + $105 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 32958) | 0, 32556) | 0, 39072) | 0, 151) | 0, 39079) | 0, 32989) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $105 + (HEAP32[(HEAP32[$105 >> 2] | 0) + -12 >> 2] | 0) | 0); + $110 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $114 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$110 >> 2] | 0) + 28 >> 2] & 127]($110, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($105, $114) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($105) | 0; + _abort(); + } + if (($80 | 0) <= -1) { + $121 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 33009) | 0, 32556) | 0, 39072) | 0, 152) | 0, 39079) | 0, 33057) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $121 + (HEAP32[(HEAP32[$121 >> 2] | 0) + -12 >> 2] | 0) | 0); + $126 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $130 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$126 >> 2] | 0) + 28 >> 2] & 127]($126, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($121, $130) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($121) | 0; + _abort(); + } + if (($82 | 0) > -1) { + $148 = $0 + ($80 << 2) | 0; + HEAPF32[$148 >> 2] = $78 * $2 + +HEAPF32[$148 >> 2]; + $152 = $0 + ($82 << 2) | 0; + HEAPF32[$152 >> 2] = $77 * $2 + +HEAPF32[$152 >> 2]; + STACKTOP = sp; + return; + } else { + $137 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 33083) | 0, 32556) | 0, 39072) | 0, 153) | 0, 39079) | 0, 33131) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $137 + (HEAP32[(HEAP32[$137 >> 2] | 0) + -12 >> 2] | 0) | 0); + $142 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $146 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$142 >> 2] | 0) + 28 >> 2] & 127]($142, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($137, $146) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($137) | 0; + _abort(); + } + } + $31 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 32669) | 0, 32556) | 0, 39072) | 0, 140) | 0, 39079) | 0, 32734) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $31 + (HEAP32[(HEAP32[$31 >> 2] | 0) + -12 >> 2] | 0) | 0); + $36 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $40 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$36 >> 2] | 0) + 28 >> 2] & 127]($36, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($31, $40) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($31) | 0; + _abort(); +} + +function _jpeg_idct_8x4($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$1168171 = 0, $$1172 = 0, $103 = 0, $109 = 0, $111 = 0, $113 = 0, $119 = 0, $125 = 0, $128 = 0, $13 = 0, $131 = 0, $134 = 0, $148 = 0, $154 = 0, $156 = 0, $158 = 0, $164 = 0, $170 = 0, $173 = 0, $176 = 0, $179 = 0, $19 = 0, $193 = 0, $199 = 0, $201 = 0, $203 = 0, $209 = 0, $21 = 0, $215 = 0, $218 = 0, $221 = 0, $224 = 0, $23 = 0, $238 = 0, $244 = 0, $246 = 0, $248 = 0, $254 = 0, $260 = 0, $263 = 0, $266 = 0, $269 = 0, $283 = 0, $289 = 0, $29 = 0, $291 = 0, $293 = 0, $299 = 0, $305 = 0, $308 = 0, $311 = 0, $314 = 0, $328 = 0, $334 = 0, $336 = 0, $338 = 0, $344 = 0, $35 = 0, $350 = 0, $353 = 0, $356 = 0, $359 = 0, $367 = 0, $370 = 0, $372 = 0, $374 = 0, $376 = 0, $378 = 0, $38 = 0, $380 = 0, $382 = 0, $384 = 0, $386 = 0, $388 = 0, $389 = 0, $390 = 0, $391 = 0, $392 = 0, $394 = 0, $396 = 0, $398 = 0, $400 = 0, $401 = 0, $402 = 0, $404 = 0, $407 = 0, $408 = 0, $41 = 0, $410 = 0, $414 = 0, $416 = 0, $418 = 0, $422 = 0, $424 = 0, $44 = 0, $5 = 0, $58 = 0, $64 = 0, $66 = 0, $68 = 0, $7 = 0, $74 = 0, $80 = 0, $83 = 0, $86 = 0, $89 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 128 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(128); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $9 = HEAP32[$1 + 84 >> 2] | 0; + $13 = Math_imul(HEAP32[$9 >> 2] | 0, HEAP16[$2 >> 1] | 0) | 0; + $19 = Math_imul(HEAP32[$9 + 64 >> 2] | 0, HEAP16[$2 + 32 >> 1] | 0) | 0; + $21 = $19 + $13 << 2; + $23 = $13 - $19 << 2; + $29 = Math_imul(HEAP32[$9 + 32 >> 2] | 0, HEAP16[$2 + 16 >> 1] | 0) | 0; + $35 = Math_imul(HEAP32[$9 + 96 >> 2] | 0, HEAP16[$2 + 48 >> 1] | 0) | 0; + $38 = (($35 + $29 | 0) * 4433 | 0) + 1024 | 0; + $41 = $38 + ($29 * 6270 | 0) >> 11; + $44 = $38 + (Math_imul($35, -15137) | 0) >> 11; + HEAP32[$5 >> 2] = $41 + $21; + HEAP32[$5 + 96 >> 2] = $21 - $41; + HEAP32[$5 + 32 >> 2] = $44 + $23; + HEAP32[$5 + 64 >> 2] = $23 - $44; + $58 = Math_imul(HEAP32[$9 + 4 >> 2] | 0, HEAP16[$2 + 2 >> 1] | 0) | 0; + $64 = Math_imul(HEAP32[$9 + 68 >> 2] | 0, HEAP16[$2 + 34 >> 1] | 0) | 0; + $66 = $64 + $58 << 2; + $68 = $58 - $64 << 2; + $74 = Math_imul(HEAP32[$9 + 36 >> 2] | 0, HEAP16[$2 + 18 >> 1] | 0) | 0; + $80 = Math_imul(HEAP32[$9 + 100 >> 2] | 0, HEAP16[$2 + 50 >> 1] | 0) | 0; + $83 = (($80 + $74 | 0) * 4433 | 0) + 1024 | 0; + $86 = $83 + ($74 * 6270 | 0) >> 11; + $89 = $83 + (Math_imul($80, -15137) | 0) >> 11; + HEAP32[$5 + 4 >> 2] = $86 + $66; + HEAP32[$5 + 100 >> 2] = $66 - $86; + HEAP32[$5 + 36 >> 2] = $89 + $68; + HEAP32[$5 + 68 >> 2] = $68 - $89; + $103 = Math_imul(HEAP32[$9 + 8 >> 2] | 0, HEAP16[$2 + 4 >> 1] | 0) | 0; + $109 = Math_imul(HEAP32[$9 + 72 >> 2] | 0, HEAP16[$2 + 36 >> 1] | 0) | 0; + $111 = $109 + $103 << 2; + $113 = $103 - $109 << 2; + $119 = Math_imul(HEAP32[$9 + 40 >> 2] | 0, HEAP16[$2 + 20 >> 1] | 0) | 0; + $125 = Math_imul(HEAP32[$9 + 104 >> 2] | 0, HEAP16[$2 + 52 >> 1] | 0) | 0; + $128 = (($125 + $119 | 0) * 4433 | 0) + 1024 | 0; + $131 = $128 + ($119 * 6270 | 0) >> 11; + $134 = $128 + (Math_imul($125, -15137) | 0) >> 11; + HEAP32[$5 + 8 >> 2] = $131 + $111; + HEAP32[$5 + 104 >> 2] = $111 - $131; + HEAP32[$5 + 40 >> 2] = $134 + $113; + HEAP32[$5 + 72 >> 2] = $113 - $134; + $148 = Math_imul(HEAP32[$9 + 12 >> 2] | 0, HEAP16[$2 + 6 >> 1] | 0) | 0; + $154 = Math_imul(HEAP32[$9 + 76 >> 2] | 0, HEAP16[$2 + 38 >> 1] | 0) | 0; + $156 = $154 + $148 << 2; + $158 = $148 - $154 << 2; + $164 = Math_imul(HEAP32[$9 + 44 >> 2] | 0, HEAP16[$2 + 22 >> 1] | 0) | 0; + $170 = Math_imul(HEAP32[$9 + 108 >> 2] | 0, HEAP16[$2 + 54 >> 1] | 0) | 0; + $173 = (($170 + $164 | 0) * 4433 | 0) + 1024 | 0; + $176 = $173 + ($164 * 6270 | 0) >> 11; + $179 = $173 + (Math_imul($170, -15137) | 0) >> 11; + HEAP32[$5 + 12 >> 2] = $176 + $156; + HEAP32[$5 + 108 >> 2] = $156 - $176; + HEAP32[$5 + 44 >> 2] = $179 + $158; + HEAP32[$5 + 76 >> 2] = $158 - $179; + $193 = Math_imul(HEAP32[$9 + 16 >> 2] | 0, HEAP16[$2 + 8 >> 1] | 0) | 0; + $199 = Math_imul(HEAP32[$9 + 80 >> 2] | 0, HEAP16[$2 + 40 >> 1] | 0) | 0; + $201 = $199 + $193 << 2; + $203 = $193 - $199 << 2; + $209 = Math_imul(HEAP32[$9 + 48 >> 2] | 0, HEAP16[$2 + 24 >> 1] | 0) | 0; + $215 = Math_imul(HEAP32[$9 + 112 >> 2] | 0, HEAP16[$2 + 56 >> 1] | 0) | 0; + $218 = (($215 + $209 | 0) * 4433 | 0) + 1024 | 0; + $221 = $218 + ($209 * 6270 | 0) >> 11; + $224 = $218 + (Math_imul($215, -15137) | 0) >> 11; + HEAP32[$5 + 16 >> 2] = $221 + $201; + HEAP32[$5 + 112 >> 2] = $201 - $221; + HEAP32[$5 + 48 >> 2] = $224 + $203; + HEAP32[$5 + 80 >> 2] = $203 - $224; + $238 = Math_imul(HEAP32[$9 + 20 >> 2] | 0, HEAP16[$2 + 10 >> 1] | 0) | 0; + $244 = Math_imul(HEAP32[$9 + 84 >> 2] | 0, HEAP16[$2 + 42 >> 1] | 0) | 0; + $246 = $244 + $238 << 2; + $248 = $238 - $244 << 2; + $254 = Math_imul(HEAP32[$9 + 52 >> 2] | 0, HEAP16[$2 + 26 >> 1] | 0) | 0; + $260 = Math_imul(HEAP32[$9 + 116 >> 2] | 0, HEAP16[$2 + 58 >> 1] | 0) | 0; + $263 = (($260 + $254 | 0) * 4433 | 0) + 1024 | 0; + $266 = $263 + ($254 * 6270 | 0) >> 11; + $269 = $263 + (Math_imul($260, -15137) | 0) >> 11; + HEAP32[$5 + 20 >> 2] = $266 + $246; + HEAP32[$5 + 116 >> 2] = $246 - $266; + HEAP32[$5 + 52 >> 2] = $269 + $248; + HEAP32[$5 + 84 >> 2] = $248 - $269; + $283 = Math_imul(HEAP32[$9 + 24 >> 2] | 0, HEAP16[$2 + 12 >> 1] | 0) | 0; + $289 = Math_imul(HEAP32[$9 + 88 >> 2] | 0, HEAP16[$2 + 44 >> 1] | 0) | 0; + $291 = $289 + $283 << 2; + $293 = $283 - $289 << 2; + $299 = Math_imul(HEAP32[$9 + 56 >> 2] | 0, HEAP16[$2 + 28 >> 1] | 0) | 0; + $305 = Math_imul(HEAP32[$9 + 120 >> 2] | 0, HEAP16[$2 + 60 >> 1] | 0) | 0; + $308 = (($305 + $299 | 0) * 4433 | 0) + 1024 | 0; + $311 = $308 + ($299 * 6270 | 0) >> 11; + $314 = $308 + (Math_imul($305, -15137) | 0) >> 11; + HEAP32[$5 + 24 >> 2] = $311 + $291; + HEAP32[$5 + 120 >> 2] = $291 - $311; + HEAP32[$5 + 56 >> 2] = $314 + $293; + HEAP32[$5 + 88 >> 2] = $293 - $314; + $328 = Math_imul(HEAP32[$9 + 28 >> 2] | 0, HEAP16[$2 + 14 >> 1] | 0) | 0; + $334 = Math_imul(HEAP32[$9 + 92 >> 2] | 0, HEAP16[$2 + 46 >> 1] | 0) | 0; + $336 = $334 + $328 << 2; + $338 = $328 - $334 << 2; + $344 = Math_imul(HEAP32[$9 + 60 >> 2] | 0, HEAP16[$2 + 30 >> 1] | 0) | 0; + $350 = Math_imul(HEAP32[$9 + 124 >> 2] | 0, HEAP16[$2 + 62 >> 1] | 0) | 0; + $353 = (($350 + $344 | 0) * 4433 | 0) + 1024 | 0; + $356 = $353 + ($344 * 6270 | 0) >> 11; + $359 = $353 + (Math_imul($350, -15137) | 0) >> 11; + HEAP32[$5 + 28 >> 2] = $356 + $336; + HEAP32[$5 + 124 >> 2] = $336 - $356; + HEAP32[$5 + 60 >> 2] = $359 + $338; + HEAP32[$5 + 92 >> 2] = $338 - $359; + $367 = $7 + -384 | 0; + $$1168171 = $5; + $$1172 = 0; + while (1) { + $370 = (HEAP32[$3 + ($$1172 << 2) >> 2] | 0) + $4 | 0; + $372 = (HEAP32[$$1168171 >> 2] | 0) + 16400 | 0; + $374 = HEAP32[$$1168171 + 16 >> 2] | 0; + $376 = $372 + $374 << 13; + $378 = $372 - $374 << 13; + $380 = HEAP32[$$1168171 + 8 >> 2] | 0; + $382 = HEAP32[$$1168171 + 24 >> 2] | 0; + $384 = ($382 + $380 | 0) * 4433 | 0; + $386 = $384 + ($380 * 6270 | 0) | 0; + $388 = $384 + (Math_imul($382, -15137) | 0) | 0; + $389 = $386 + $376 | 0; + $390 = $376 - $386 | 0; + $391 = $388 + $378 | 0; + $392 = $378 - $388 | 0; + $394 = HEAP32[$$1168171 + 28 >> 2] | 0; + $396 = HEAP32[$$1168171 + 20 >> 2] | 0; + $398 = HEAP32[$$1168171 + 12 >> 2] | 0; + $400 = HEAP32[$$1168171 + 4 >> 2] | 0; + $401 = $398 + $394 | 0; + $402 = $400 + $396 | 0; + $404 = ($402 + $401 | 0) * 9633 | 0; + $407 = $404 + (Math_imul($401, -16069) | 0) | 0; + $408 = $404 + (Math_imul($402, -3196) | 0) | 0; + $410 = Math_imul($400 + $394 | 0, -7373) | 0; + $414 = $410 + ($394 * 2446 | 0) + $407 | 0; + $416 = $410 + ($400 * 12299 | 0) + $408 | 0; + $418 = Math_imul($398 + $396 | 0, -20995) | 0; + $422 = $418 + ($396 * 16819 | 0) + $408 | 0; + $424 = $418 + ($398 * 25172 | 0) + $407 | 0; + HEAP8[$370 >> 0] = HEAP8[$367 + (($416 + $389 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$370 + 7 >> 0] = HEAP8[$367 + (($389 - $416 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$370 + 1 >> 0] = HEAP8[$367 + (($424 + $391 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$370 + 6 >> 0] = HEAP8[$367 + (($391 - $424 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$370 + 2 >> 0] = HEAP8[$367 + (($422 + $392 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$370 + 5 >> 0] = HEAP8[$367 + (($392 - $422 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$370 + 3 >> 0] = HEAP8[$367 + (($414 + $390 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$370 + 4 >> 0] = HEAP8[$367 + (($390 - $414 | 0) >>> 18 & 1023) >> 0] | 0; + $$1172 = $$1172 + 1 | 0; + if (($$1172 | 0) == 4) break; else $$1168171 = $$1168171 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function ___udivmoddi4($a$0, $a$1, $b$0, $b$1, $rem) { + $a$0 = $a$0 | 0; + $a$1 = $a$1 | 0; + $b$0 = $b$0 | 0; + $b$1 = $b$1 | 0; + $rem = $rem | 0; + var $n_sroa_0_0_extract_trunc = 0, $n_sroa_1_4_extract_shift$0 = 0, $n_sroa_1_4_extract_trunc = 0, $d_sroa_0_0_extract_trunc = 0, $d_sroa_1_4_extract_shift$0 = 0, $d_sroa_1_4_extract_trunc = 0, $4 = 0, $17 = 0, $37 = 0, $51 = 0, $57 = 0, $58 = 0, $66 = 0, $78 = 0, $88 = 0, $89 = 0, $91 = 0, $92 = 0, $95 = 0, $105 = 0, $119 = 0, $125 = 0, $126 = 0, $130 = 0, $q_sroa_1_1_ph = 0, $q_sroa_0_1_ph = 0, $r_sroa_1_1_ph = 0, $r_sroa_0_1_ph = 0, $sr_1_ph = 0, $d_sroa_0_0_insert_insert99$0 = 0, $d_sroa_0_0_insert_insert99$1 = 0, $137$0 = 0, $137$1 = 0, $carry_0203 = 0, $sr_1202 = 0, $r_sroa_0_1201 = 0, $r_sroa_1_1200 = 0, $q_sroa_0_1199 = 0, $q_sroa_1_1198 = 0, $r_sroa_0_0_insert_insert42$0 = 0, $r_sroa_0_0_insert_insert42$1 = 0, $150$1 = 0, $151$0 = 0, $carry_0_lcssa$0 = 0, $carry_0_lcssa$1 = 0, $r_sroa_0_1_lcssa = 0, $r_sroa_1_1_lcssa = 0, $q_sroa_0_1_lcssa = 0, $q_sroa_1_1_lcssa = 0, $q_sroa_0_0_insert_ext75$0 = 0, $q_sroa_0_0_insert_ext75$1 = 0, $_0$0 = 0, $_0$1 = 0, $q_sroa_1_1198$looptemp = 0; + $n_sroa_0_0_extract_trunc = $a$0; + $n_sroa_1_4_extract_shift$0 = $a$1; + $n_sroa_1_4_extract_trunc = $n_sroa_1_4_extract_shift$0; + $d_sroa_0_0_extract_trunc = $b$0; + $d_sroa_1_4_extract_shift$0 = $b$1; + $d_sroa_1_4_extract_trunc = $d_sroa_1_4_extract_shift$0; + if (!$n_sroa_1_4_extract_trunc) { + $4 = ($rem | 0) != 0; + if (!$d_sroa_1_4_extract_trunc) { + if ($4) { + HEAP32[$rem >> 2] = ($n_sroa_0_0_extract_trunc >>> 0) % ($d_sroa_0_0_extract_trunc >>> 0); + HEAP32[$rem + 4 >> 2] = 0; + } + $_0$1 = 0; + $_0$0 = ($n_sroa_0_0_extract_trunc >>> 0) / ($d_sroa_0_0_extract_trunc >>> 0) >>> 0; + return (setTempRet0($_0$1 | 0), $_0$0) | 0; + } else { + if (!$4) { + $_0$1 = 0; + $_0$0 = 0; + return (setTempRet0($_0$1 | 0), $_0$0) | 0; + } + HEAP32[$rem >> 2] = $a$0 | 0; + HEAP32[$rem + 4 >> 2] = $a$1 & 0; + $_0$1 = 0; + $_0$0 = 0; + return (setTempRet0($_0$1 | 0), $_0$0) | 0; + } + } + $17 = ($d_sroa_1_4_extract_trunc | 0) == 0; + do if ($d_sroa_0_0_extract_trunc) { + if (!$17) { + $119 = (Math_clz32($d_sroa_1_4_extract_trunc | 0) | 0) - (Math_clz32($n_sroa_1_4_extract_trunc | 0) | 0) | 0; + if ($119 >>> 0 <= 31) { + $125 = $119 + 1 | 0; + $126 = 31 - $119 | 0; + $130 = $119 - 31 >> 31; + $sr_1_ph = $125; + $r_sroa_0_1_ph = $n_sroa_0_0_extract_trunc >>> ($125 >>> 0) & $130 | $n_sroa_1_4_extract_trunc << $126; + $r_sroa_1_1_ph = $n_sroa_1_4_extract_trunc >>> ($125 >>> 0) & $130; + $q_sroa_0_1_ph = 0; + $q_sroa_1_1_ph = $n_sroa_0_0_extract_trunc << $126; + break; + } + if (!$rem) { + $_0$1 = 0; + $_0$0 = 0; + return (setTempRet0($_0$1 | 0), $_0$0) | 0; + } + HEAP32[$rem >> 2] = $a$0 | 0; + HEAP32[$rem + 4 >> 2] = $n_sroa_1_4_extract_shift$0 | $a$1 & 0; + $_0$1 = 0; + $_0$0 = 0; + return (setTempRet0($_0$1 | 0), $_0$0) | 0; + } + $66 = $d_sroa_0_0_extract_trunc - 1 | 0; + if ($66 & $d_sroa_0_0_extract_trunc | 0) { + $88 = (Math_clz32($d_sroa_0_0_extract_trunc | 0) | 0) + 33 - (Math_clz32($n_sroa_1_4_extract_trunc | 0) | 0) | 0; + $89 = 64 - $88 | 0; + $91 = 32 - $88 | 0; + $92 = $91 >> 31; + $95 = $88 - 32 | 0; + $105 = $95 >> 31; + $sr_1_ph = $88; + $r_sroa_0_1_ph = $91 - 1 >> 31 & $n_sroa_1_4_extract_trunc >>> ($95 >>> 0) | ($n_sroa_1_4_extract_trunc << $91 | $n_sroa_0_0_extract_trunc >>> ($88 >>> 0)) & $105; + $r_sroa_1_1_ph = $105 & $n_sroa_1_4_extract_trunc >>> ($88 >>> 0); + $q_sroa_0_1_ph = $n_sroa_0_0_extract_trunc << $89 & $92; + $q_sroa_1_1_ph = ($n_sroa_1_4_extract_trunc << $89 | $n_sroa_0_0_extract_trunc >>> ($95 >>> 0)) & $92 | $n_sroa_0_0_extract_trunc << $91 & $88 - 33 >> 31; + break; + } + if ($rem | 0) { + HEAP32[$rem >> 2] = $66 & $n_sroa_0_0_extract_trunc; + HEAP32[$rem + 4 >> 2] = 0; + } + if (($d_sroa_0_0_extract_trunc | 0) == 1) { + $_0$1 = $n_sroa_1_4_extract_shift$0 | $a$1 & 0; + $_0$0 = $a$0 | 0 | 0; + return (setTempRet0($_0$1 | 0), $_0$0) | 0; + } else { + $78 = _llvm_cttz_i32($d_sroa_0_0_extract_trunc | 0) | 0; + $_0$1 = $n_sroa_1_4_extract_trunc >>> ($78 >>> 0) | 0; + $_0$0 = $n_sroa_1_4_extract_trunc << 32 - $78 | $n_sroa_0_0_extract_trunc >>> ($78 >>> 0) | 0; + return (setTempRet0($_0$1 | 0), $_0$0) | 0; + } + } else { + if ($17) { + if ($rem | 0) { + HEAP32[$rem >> 2] = ($n_sroa_1_4_extract_trunc >>> 0) % ($d_sroa_0_0_extract_trunc >>> 0); + HEAP32[$rem + 4 >> 2] = 0; + } + $_0$1 = 0; + $_0$0 = ($n_sroa_1_4_extract_trunc >>> 0) / ($d_sroa_0_0_extract_trunc >>> 0) >>> 0; + return (setTempRet0($_0$1 | 0), $_0$0) | 0; + } + if (!$n_sroa_0_0_extract_trunc) { + if ($rem | 0) { + HEAP32[$rem >> 2] = 0; + HEAP32[$rem + 4 >> 2] = ($n_sroa_1_4_extract_trunc >>> 0) % ($d_sroa_1_4_extract_trunc >>> 0); + } + $_0$1 = 0; + $_0$0 = ($n_sroa_1_4_extract_trunc >>> 0) / ($d_sroa_1_4_extract_trunc >>> 0) >>> 0; + return (setTempRet0($_0$1 | 0), $_0$0) | 0; + } + $37 = $d_sroa_1_4_extract_trunc - 1 | 0; + if (!($37 & $d_sroa_1_4_extract_trunc)) { + if ($rem | 0) { + HEAP32[$rem >> 2] = $a$0 | 0; + HEAP32[$rem + 4 >> 2] = $37 & $n_sroa_1_4_extract_trunc | $a$1 & 0; + } + $_0$1 = 0; + $_0$0 = $n_sroa_1_4_extract_trunc >>> ((_llvm_cttz_i32($d_sroa_1_4_extract_trunc | 0) | 0) >>> 0); + return (setTempRet0($_0$1 | 0), $_0$0) | 0; + } + $51 = (Math_clz32($d_sroa_1_4_extract_trunc | 0) | 0) - (Math_clz32($n_sroa_1_4_extract_trunc | 0) | 0) | 0; + if ($51 >>> 0 <= 30) { + $57 = $51 + 1 | 0; + $58 = 31 - $51 | 0; + $sr_1_ph = $57; + $r_sroa_0_1_ph = $n_sroa_1_4_extract_trunc << $58 | $n_sroa_0_0_extract_trunc >>> ($57 >>> 0); + $r_sroa_1_1_ph = $n_sroa_1_4_extract_trunc >>> ($57 >>> 0); + $q_sroa_0_1_ph = 0; + $q_sroa_1_1_ph = $n_sroa_0_0_extract_trunc << $58; + break; + } + if (!$rem) { + $_0$1 = 0; + $_0$0 = 0; + return (setTempRet0($_0$1 | 0), $_0$0) | 0; + } + HEAP32[$rem >> 2] = $a$0 | 0; + HEAP32[$rem + 4 >> 2] = $n_sroa_1_4_extract_shift$0 | $a$1 & 0; + $_0$1 = 0; + $_0$0 = 0; + return (setTempRet0($_0$1 | 0), $_0$0) | 0; + } while (0); + if (!$sr_1_ph) { + $q_sroa_1_1_lcssa = $q_sroa_1_1_ph; + $q_sroa_0_1_lcssa = $q_sroa_0_1_ph; + $r_sroa_1_1_lcssa = $r_sroa_1_1_ph; + $r_sroa_0_1_lcssa = $r_sroa_0_1_ph; + $carry_0_lcssa$1 = 0; + $carry_0_lcssa$0 = 0; + } else { + $d_sroa_0_0_insert_insert99$0 = $b$0 | 0 | 0; + $d_sroa_0_0_insert_insert99$1 = $d_sroa_1_4_extract_shift$0 | $b$1 & 0; + $137$0 = _i64Add($d_sroa_0_0_insert_insert99$0 | 0, $d_sroa_0_0_insert_insert99$1 | 0, -1, -1) | 0; + $137$1 = getTempRet0() | 0; + $q_sroa_1_1198 = $q_sroa_1_1_ph; + $q_sroa_0_1199 = $q_sroa_0_1_ph; + $r_sroa_1_1200 = $r_sroa_1_1_ph; + $r_sroa_0_1201 = $r_sroa_0_1_ph; + $sr_1202 = $sr_1_ph; + $carry_0203 = 0; + do { + $q_sroa_1_1198$looptemp = $q_sroa_1_1198; + $q_sroa_1_1198 = $q_sroa_0_1199 >>> 31 | $q_sroa_1_1198 << 1; + $q_sroa_0_1199 = $carry_0203 | $q_sroa_0_1199 << 1; + $r_sroa_0_0_insert_insert42$0 = $r_sroa_0_1201 << 1 | $q_sroa_1_1198$looptemp >>> 31 | 0; + $r_sroa_0_0_insert_insert42$1 = $r_sroa_0_1201 >>> 31 | $r_sroa_1_1200 << 1 | 0; + _i64Subtract($137$0 | 0, $137$1 | 0, $r_sroa_0_0_insert_insert42$0 | 0, $r_sroa_0_0_insert_insert42$1 | 0) | 0; + $150$1 = getTempRet0() | 0; + $151$0 = $150$1 >> 31 | (($150$1 | 0) < 0 ? -1 : 0) << 1; + $carry_0203 = $151$0 & 1; + $r_sroa_0_1201 = _i64Subtract($r_sroa_0_0_insert_insert42$0 | 0, $r_sroa_0_0_insert_insert42$1 | 0, $151$0 & $d_sroa_0_0_insert_insert99$0 | 0, ((($150$1 | 0) < 0 ? -1 : 0) >> 31 | (($150$1 | 0) < 0 ? -1 : 0) << 1) & $d_sroa_0_0_insert_insert99$1 | 0) | 0; + $r_sroa_1_1200 = getTempRet0() | 0; + $sr_1202 = $sr_1202 - 1 | 0; + } while (($sr_1202 | 0) != 0); + $q_sroa_1_1_lcssa = $q_sroa_1_1198; + $q_sroa_0_1_lcssa = $q_sroa_0_1199; + $r_sroa_1_1_lcssa = $r_sroa_1_1200; + $r_sroa_0_1_lcssa = $r_sroa_0_1201; + $carry_0_lcssa$1 = 0; + $carry_0_lcssa$0 = $carry_0203; + } + $q_sroa_0_0_insert_ext75$0 = $q_sroa_0_1_lcssa; + $q_sroa_0_0_insert_ext75$1 = 0; + if ($rem | 0) { + HEAP32[$rem >> 2] = $r_sroa_0_1_lcssa; + HEAP32[$rem + 4 >> 2] = $r_sroa_1_1_lcssa; + } + $_0$1 = ($q_sroa_0_0_insert_ext75$0 | 0) >>> 31 | ($q_sroa_1_1_lcssa | $q_sroa_0_0_insert_ext75$1) << 1 | ($q_sroa_0_0_insert_ext75$1 << 1 | $q_sroa_0_0_insert_ext75$0 >>> 31) & 0 | $carry_0_lcssa$1; + $_0$0 = ($q_sroa_0_0_insert_ext75$0 << 1 | 0 >>> 31) & -2 | $carry_0_lcssa$0; + return (setTempRet0($_0$1 | 0), $_0$0) | 0; +} + +function __ZN6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEE5queryEPKNS_8KeyframeILi96EEE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$047 = 0, $$249 = 0, $$pre = 0, $$pre$phi257Z2D = 0, $$pre$phiZ2D = 0, $$sroa$082$0 = 0, $$sroa$082$0$in = 0, $100 = 0, $11 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $31 = 0, $34 = 0, $37 = 0, $4 = 0, $42 = 0, $44 = 0, $45 = 0, $46 = 0, $48 = 0, $5 = 0, $51 = 0, $57 = 0, $6 = 0, $70 = 0, $73 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $81 = 0, $84 = 0, $9 = 0, $90 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 144 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(144); + $2 = sp + 104 | 0; + $3 = sp; + $4 = sp + 72 | 0; + $5 = sp + 40 | 0; + $6 = $0 + 12 | 0; + $8 = $0 + 16 | 0; + HEAP32[$8 >> 2] = HEAP32[$6 >> 2]; + $9 = $0 + 24 | 0; + HEAP32[$9 >> 2] = -1; + $11 = __ZNK6vision18BinaryFeatureStore6pointsEv(__ZNK6vision8KeyframeILi96EE5storeEv($1) | 0) | 0; + $13 = $0 + 8 | 0; + $14 = $0 + 636 | 0; + $15 = $0 + 652 | 0; + $16 = $2 + 4 | 0; + $17 = $2 + 8 | 0; + $18 = $0 + 788 | 0; + $19 = $4 + 4 | 0; + $20 = $4 + 8 | 0; + $21 = $0 + 4 | 0; + $22 = $0 + 28 | 0; + $$sroa$082$0$in = $0 + 80 | 0; + while (1) { + $$sroa$082$0 = HEAP32[$$sroa$082$0$in >> 2] | 0; + if (!$$sroa$082$0) break; + __ZN6vision11ScopedTimerC2EPKc($2, 35008); + do if (__ZN6vision11ScopedTimercvbEv($2) | 0) { + $26 = (HEAP8[$13 >> 0] | 0) == 0; + $27 = __ZNK6vision8KeyframeILi96EE5storeEv($1) | 0; + $28 = $$sroa$082$0; + $29 = $28 + 12 | 0; + $31 = __ZN6vision8KeyframeILi96EE5storeEv(HEAP32[$29 >> 2] | 0) | 0; + if ($26) { + $37 = __ZN6vision20BinaryFeatureMatcherILi96EE5matchEPKNS_18BinaryFeatureStoreES4_($14, $27, $31) | 0; + if ($37 >>> 0 >= (HEAP32[$0 >> 2] | 0) >>> 0) { + $$pre$phi257Z2D = $29; + $$pre$phiZ2D = $28; + label = 9; + break; + } + } else { + $34 = __ZN6vision20BinaryFeatureMatcherILi96EE5matchEPKNS_18BinaryFeatureStoreES4_RKNS_28BinaryHierarchicalClusteringILi96EEE($14, $27, $31, __ZNK6vision8KeyframeILi96EE5indexEv(HEAP32[$29 >> 2] | 0) | 0) | 0; + if ($34 >>> 0 >= (HEAP32[$0 >> 2] | 0) >>> 0) { + $$pre$phi257Z2D = $29; + $$pre$phiZ2D = $28; + label = 9; + break; + } + } + __ZN6vision11ScopedTimerD2Ev($2); + } else { + $$pre = $$sroa$082$0; + $$pre$phi257Z2D = $$pre + 12 | 0; + $$pre$phiZ2D = $$pre; + label = 9; + } while (0); + do if ((label | 0) == 9) { + label = 0; + __ZN6vision11ScopedTimerD2Ev($2); + $42 = __ZN6vision18BinaryFeatureStore6pointsEv(__ZN6vision8KeyframeILi96EE5storeEv(HEAP32[$$pre$phi257Z2D >> 2] | 0) | 0) | 0; + __ZN6vision11ScopedTimerC2EPKc($2, 35025); + if (__ZN6vision11ScopedTimercvbEv($2) | 0) { + $44 = __ZNK6vision20BinaryFeatureMatcherILi96EE7matchesEv($14) | 0; + $45 = __ZNK6vision8KeyframeILi96EE5widthEv($1) | 0; + $46 = __ZNK6vision8KeyframeILi96EE6heightEv($1) | 0; + $48 = __ZNK6vision8KeyframeILi96EE5widthEv(HEAP32[$$pre$phi257Z2D >> 2] | 0) | 0; + $51 = __ZN6vision19FindHoughSimilarityERNS_21HoughSimilarityVotingERKNSt3__26vectorINS_12FeaturePointENS2_9allocatorIS4_EEEES9_RKNS3_INS_7match_tENS5_ISA_EEEEiiii($15, $11, $42, $44, $45, $46, $48, __ZNK6vision8KeyframeILi96EE6heightEv(HEAP32[$$pre$phi257Z2D >> 2] | 0) | 0) | 0; + if (($51 | 0) < 0) { + __ZN6vision11ScopedTimerD2Ev($2); + break; + } else $$047 = $51; + } else $$047 = -1; + __ZN6vision11ScopedTimerD2Ev($2); + HEAP32[$2 >> 2] = 0; + HEAP32[$16 >> 2] = 0; + HEAP32[$17 >> 2] = 0; + __ZN6vision11ScopedTimerC2EPKc($3, 35042); + if (__ZN6vision11ScopedTimercvbEv($3) | 0) __ZN6vision16FindHoughMatchesERNSt3__26vectorINS_7match_tENS0_9allocatorIS2_EEEERKNS_21HoughSimilarityVotingERKS5_if($2, $15, __ZNK6vision20BinaryFeatureMatcherILi96EE7matchesEv($14) | 0, $$047, 1.0); + __ZN6vision11ScopedTimerD2Ev($3); + __ZN6vision11ScopedTimerC2EPKc($4, 35065); + if (__ZN6vision11ScopedTimercvbEv($4) | 0 ? ($57 = __ZNK6vision8KeyframeILi96EE5widthEv(HEAP32[$$pre$phi257Z2D >> 2] | 0) | 0, !(__ZN6vision18EstimateHomographyEPfRKNSt3__26vectorINS_12FeaturePointENS1_9allocatorIS3_EEEES8_RKNS2_INS_7match_tENS4_IS9_EEEERNS_16RobustHomographyIfEEii($3, $11, $42, $2, $18, $57, __ZNK6vision8KeyframeILi96EE6heightEv(HEAP32[$$pre$phi257Z2D >> 2] | 0) | 0) | 0)) : 0) __ZN6vision11ScopedTimerD2Ev($4); else { + __ZN6vision11ScopedTimerD2Ev($4); + HEAP32[$4 >> 2] = 0; + HEAP32[$19 >> 2] = 0; + HEAP32[$20 >> 2] = 0; + __ZN6vision11ScopedTimerC2EPKc($5, 35089); + if (__ZN6vision11ScopedTimercvbEv($5) | 0 ? (__ZN6vision11FindInliersERNSt3__26vectorINS_7match_tENS0_9allocatorIS2_EEEEPKfRKNS1_INS_12FeaturePointENS3_IS9_EEEESD_RKS5_f($4, $3, $11, $42, $2, +HEAPF32[$21 >> 2]), (HEAP32[$19 >> 2] | 0) - (HEAP32[$4 >> 2] | 0) >> 3 >>> 0 < (HEAP32[$0 >> 2] | 0) >>> 0) : 0) __ZN6vision11ScopedTimerD2Ev($5); else label = 20; + do if ((label | 0) == 20) { + label = 0; + __ZN6vision11ScopedTimerD2Ev($5); + __ZN6vision11ScopedTimerC2EPKc($5, 35106); + if (__ZN6vision11ScopedTimercvbEv($5) | 0 ? ($70 = __ZNK6vision8KeyframeILi96EE5storeEv($1) | 0, $73 = __ZN6vision20BinaryFeatureMatcherILi96EE5matchEPKNS_18BinaryFeatureStoreES4_PKff($14, $70, __ZN6vision8KeyframeILi96EE5storeEv(HEAP32[$$pre$phi257Z2D >> 2] | 0) | 0, $3, 10.0) | 0, $73 >>> 0 < (HEAP32[$0 >> 2] | 0) >>> 0) : 0) { + __ZN6vision11ScopedTimerD2Ev($5); + break; + } + __ZN6vision11ScopedTimerD2Ev($5); + __ZN6vision11ScopedTimerC2EPKc($5, 35123); + if (__ZN6vision11ScopedTimercvbEv($5) | 0) { + $77 = __ZNK6vision20BinaryFeatureMatcherILi96EE7matchesEv($14) | 0; + $78 = __ZNK6vision8KeyframeILi96EE5widthEv($1) | 0; + $79 = __ZNK6vision8KeyframeILi96EE6heightEv($1) | 0; + $81 = __ZNK6vision8KeyframeILi96EE5widthEv(HEAP32[$$pre$phi257Z2D >> 2] | 0) | 0; + $84 = __ZN6vision19FindHoughSimilarityERNS_21HoughSimilarityVotingERKNSt3__26vectorINS_12FeaturePointENS2_9allocatorIS4_EEEES9_RKNS3_INS_7match_tENS5_ISA_EEEEiiii($15, $11, $42, $77, $78, $79, $81, __ZNK6vision8KeyframeILi96EE6heightEv(HEAP32[$$pre$phi257Z2D >> 2] | 0) | 0) | 0; + if (($84 | 0) < 0) { + __ZN6vision11ScopedTimerD2Ev($5); + break; + } else $$249 = $84; + } else $$249 = $$047; + __ZN6vision11ScopedTimerD2Ev($5); + __ZN6vision11ScopedTimerC2EPKc($5, 35140); + if (__ZN6vision11ScopedTimercvbEv($5) | 0) __ZN6vision16FindHoughMatchesERNSt3__26vectorINS_7match_tENS0_9allocatorIS2_EEEERKNS_21HoughSimilarityVotingERKS5_if($2, $15, __ZNK6vision20BinaryFeatureMatcherILi96EE7matchesEv($14) | 0, $$249, 1.0); + __ZN6vision11ScopedTimerD2Ev($5); + __ZN6vision11ScopedTimerC2EPKc($5, 35163); + if (__ZN6vision11ScopedTimercvbEv($5) | 0 ? ($90 = __ZNK6vision8KeyframeILi96EE5widthEv(HEAP32[$$pre$phi257Z2D >> 2] | 0) | 0, !(__ZN6vision18EstimateHomographyEPfRKNSt3__26vectorINS_12FeaturePointENS1_9allocatorIS3_EEEES8_RKNS2_INS_7match_tENS4_IS9_EEEERNS_16RobustHomographyIfEEii($3, $11, $42, $2, $18, $90, __ZNK6vision8KeyframeILi96EE6heightEv(HEAP32[$$pre$phi257Z2D >> 2] | 0) | 0) | 0)) : 0) { + __ZN6vision11ScopedTimerD2Ev($5); + break; + } + __ZN6vision11ScopedTimerD2Ev($5); + HEAP32[$19 >> 2] = HEAP32[$4 >> 2]; + __ZN6vision11ScopedTimerC2EPKc($5, 35187); + if (__ZN6vision11ScopedTimercvbEv($5) | 0) __ZN6vision11FindInliersERNSt3__26vectorINS_7match_tENS0_9allocatorIS2_EEEEPKfRKNS1_INS_12FeaturePointENS3_IS9_EEEESD_RKS5_f($4, $3, $11, $42, $2, +HEAPF32[$21 >> 2]); + __ZN6vision11ScopedTimerD2Ev($5); + $100 = (HEAP32[$19 >> 2] | 0) - (HEAP32[$4 >> 2] | 0) >> 3; + if ($100 >>> 0 >= (HEAP32[$0 >> 2] | 0) >>> 0 ? $100 >>> 0 > (HEAP32[$8 >> 2] | 0) - (HEAP32[$6 >> 2] | 0) >> 3 >>> 0 : 0) { + __ZN6vision11CopyVector9IfEEvPT_PKS1_($22, $3); + __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE4swapERS5_($6, $4); + HEAP32[$9 >> 2] = HEAP32[$$pre$phiZ2D + 8 >> 2]; + } + } while (0); + __ZNSt3__213__vector_baseIN6vision7match_tENS_9allocatorIS2_EEED2Ev($4); + } + __ZNSt3__213__vector_baseIN6vision7match_tENS_9allocatorIS2_EEED2Ev($2); + } while (0); + $$sroa$082$0$in = $$sroa$082$0; + } + STACKTOP = sp; + return (HEAP32[$9 >> 2] | 0) > -1 | 0; +} + +function _decode_mcu($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0148177 = 0, $$0149$lcssa = 0, $$0149179 = 0, $$0155 = 0, $$0157176 = 0, $$0162200 = 0, $$035$i = 0, $$1 = 0, $$1156$lcssa = 0, $$1158 = 0, $$2159$lcssa = 0, $$2159182 = 0, $$3152$lcssa = 0, $$3152195 = 0, $$3160189 = 0, $$3190 = 0, $$4 = 0, $$4161 = 0, $$lcssa = 0, $$sink = 0, $113 = 0, $116 = 0, $117 = 0, $120 = 0, $122 = 0, $128 = 0, $130 = 0, $132 = 0, $136 = 0, $137 = 0, $138 = 0, $141 = 0, $144 = 0, $150 = 0, $151 = 0, $155 = 0, $156 = 0, $16 = 0, $160 = 0, $161 = 0, $162 = 0, $166 = 0, $172 = 0, $175 = 0, $177 = 0, $181 = 0, $184 = 0, $185 = 0, $188 = 0, $19 = 0, $190 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $27 = 0, $3 = 0, $4 = 0, $54 = 0, $56 = 0, $57 = 0, $61 = 0, $62 = 0, $65 = 0, $66 = 0, $68 = 0, $7 = 0, $70 = 0, $72 = 0, $74 = 0, $75 = 0, $77 = 0, $79 = 0, $8 = 0, $83 = 0, $85 = 0, $86 = 0, $89 = 0, $92 = 0, $94 = 0, $98 = 0, $spec$select = 0, $spec$select164 = 0, dest = 0, label = 0, stop = 0; + $3 = HEAP32[$0 + 468 >> 2] | 0; + $4 = $0 + 280 | 0; + if (HEAP32[$4 >> 2] | 0) { + $7 = $3 + 56 | 0; + $8 = HEAP32[$7 >> 2] | 0; + if (!$8) { + if (!(FUNCTION_TABLE_ii[HEAP32[(HEAP32[$0 + 464 >> 2] | 0) + 8 >> 2] & 127]($0) | 0)) { + $16 = HEAP32[$0 >> 2] | 0; + HEAP32[$16 + 20 >> 2] = 25; + FUNCTION_TABLE_vi[HEAP32[$16 >> 2] & 255]($0); + } + $19 = $0 + 340 | 0; + if ((HEAP32[$19 >> 2] | 0) > 0) { + $22 = $0 + 224 | 0; + $23 = $0 + 412 | 0; + $24 = $0 + 436 | 0; + $25 = $0 + 420 | 0; + $$035$i = 0; + do { + $27 = HEAP32[$0 + 344 + ($$035$i << 2) >> 2] | 0; + if (HEAP32[$22 >> 2] | 0) if (!(HEAP32[$23 >> 2] | 0)) { + if (!(HEAP32[$25 >> 2] | 0)) label = 10; + } else label = 13; else label = 10; + do if ((label | 0) == 10) { + label = 0; + dest = HEAP32[$3 + 60 + (HEAP32[$27 + 20 >> 2] << 2) >> 2] | 0; + stop = dest + 64 | 0; + do { + HEAP8[dest >> 0] = 0; + dest = dest + 1 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$3 + 24 + ($$035$i << 2) >> 2] = 0; + HEAP32[$3 + 40 + ($$035$i << 2) >> 2] = 0; + if (!(HEAP32[$22 >> 2] | 0)) if (!(HEAP32[$24 >> 2] | 0)) break; else { + label = 13; + break; + } else if (!(HEAP32[$23 >> 2] | 0)) break; else { + label = 13; + break; + } + } while (0); + if ((label | 0) == 13) { + label = 0; + _memset(HEAP32[$3 + 124 + (HEAP32[$27 + 24 >> 2] << 2) >> 2] | 0, 0, 256) | 0; + } + $$035$i = $$035$i + 1 | 0; + } while (($$035$i | 0) < (HEAP32[$19 >> 2] | 0)); + } + HEAP32[$3 + 12 >> 2] = 0; + HEAP32[$3 + 16 >> 2] = 0; + HEAP32[$3 + 20 >> 2] = -16; + $54 = HEAP32[$4 >> 2] | 0; + HEAP32[$7 >> 2] = $54; + $56 = $54; + } else $56 = $8; + HEAP32[$7 >> 2] = $56 + -1; + } + $57 = $3 + 20 | 0; + if ((HEAP32[$57 >> 2] | 0) == -1) return 1; + $61 = HEAP32[$0 + 432 >> 2] | 0; + $62 = $0 + 368 | 0; + if ((HEAP32[$62 >> 2] | 0) <= 0) return 1; + $65 = $0 + 436 | 0; + $66 = $3 + 188 | 0; + $$0162200 = 0; + L32 : while (1) { + $68 = HEAP32[$1 + ($$0162200 << 2) >> 2] | 0; + $70 = HEAP32[$0 + 372 + ($$0162200 << 2) >> 2] | 0; + $72 = HEAP32[$0 + 344 + ($70 << 2) >> 2] | 0; + $74 = HEAP32[$72 + 20 >> 2] | 0; + $75 = $3 + 60 + ($74 << 2) | 0; + $77 = $3 + 40 + ($70 << 2) | 0; + $79 = (HEAP32[$75 >> 2] | 0) + (HEAP32[$77 >> 2] | 0) | 0; + if (!(_arith_decode($0, $79) | 0)) { + HEAP32[$77 >> 2] = 0; + $132 = HEAP32[$3 + 24 + ($70 << 2) >> 2] | 0; + } else { + $83 = _arith_decode($0, $79 + 1 | 0) | 0; + $85 = $79 + 2 + $83 | 0; + $86 = _arith_decode($0, $85) | 0; + if ($86) { + $89 = (HEAP32[$75 >> 2] | 0) + 20 | 0; + if (!(_arith_decode($0, $89) | 0)) { + $$1 = $86; + $$1158 = $89; + } else { + $$0148177 = $86; + $$0157176 = $89; + while (1) { + $92 = $$0148177 << 1; + if (($92 | 0) == 32768) { + label = 26; + break L32; + } + $98 = $$0157176 + 1 | 0; + if (!(_arith_decode($0, $98) | 0)) { + $$1 = $92; + $$1158 = $98; + break; + } else { + $$0148177 = $92; + $$0157176 = $98; + } + } + } + } else { + $$1 = 0; + $$1158 = $85; + } + do if (($$1 | 0) >= (1 << (HEAPU8[$0 + 232 + $74 >> 0] | 0) >> 1 | 0)) { + $113 = $83 << 2; + if (($$1 | 0) > (1 << (HEAPU8[$0 + 248 + $74 >> 0] | 0) >> 1 | 0)) { + $$sink = $113 + 12 | 0; + break; + } else { + $$sink = $113 + 4 | 0; + break; + } + } else $$sink = 0; while (0); + HEAP32[$77 >> 2] = $$sink; + $116 = $$1158 + 14 | 0; + $117 = $$1 >> 1; + if (!$117) $$0149$lcssa = $$1; else { + $$0149179 = $$1; + $122 = $117; + while (1) { + $120 = (_arith_decode($0, $116) | 0) == 0; + $spec$select = ($120 ? 0 : $122) | $$0149179; + $122 = $122 >> 1; + if (!$122) { + $$0149$lcssa = $spec$select; + break; + } else $$0149179 = $spec$select; + } + } + $128 = $3 + 24 + ($70 << 2) | 0; + $130 = (HEAP32[$128 >> 2] | 0) + (($83 | 0) == 0 ? $$0149$lcssa + 1 | 0 : ~$$0149$lcssa) | 0; + HEAP32[$128 >> 2] = $130; + $132 = $130; + } + HEAP16[$68 >> 1] = $132; + L56 : do if (HEAP32[$65 >> 2] | 0) { + $136 = HEAP32[$72 + 24 >> 2] | 0; + $137 = $3 + 124 + ($136 << 2) | 0; + $138 = $0 + 264 + $136 | 0; + $$0155 = 0; + while (1) { + $141 = (HEAP32[$137 >> 2] | 0) + ($$0155 * 3 | 0) | 0; + if (_arith_decode($0, $141) | 0) break L56; + $144 = $$0155 + 1 | 0; + if (!(_arith_decode($0, $141 + 1 | 0) | 0)) { + $$2159182 = $141; + $150 = $144; + while (1) { + if (($150 | 0) >= (HEAP32[$65 >> 2] | 0)) { + label = 42; + break L32; + } + $155 = $$2159182 + 3 | 0; + $156 = $150 + 1 | 0; + if (!(_arith_decode($0, $$2159182 + 4 | 0) | 0)) { + $$2159182 = $155; + $150 = $156; + } else { + $$1156$lcssa = $150; + $$2159$lcssa = $155; + $$lcssa = $156; + break; + } + } + } else { + $$1156$lcssa = $$0155; + $$2159$lcssa = $141; + $$lcssa = $144; + } + $160 = _arith_decode($0, $66) | 0; + $161 = $$2159$lcssa + 2 | 0; + $162 = _arith_decode($0, $161) | 0; + if ($162) { + if (_arith_decode($0, $161) | 0) { + $166 = $162 << 1; + $172 = (HEAP32[$137 >> 2] | 0) + (($$1156$lcssa | 0) < (HEAPU8[$138 >> 0] | 0 | 0) ? 189 : 217) | 0; + if (!(_arith_decode($0, $172) | 0)) { + $$4 = $166; + $$4161 = $172; + } else { + $$3160189 = $172; + $$3190 = $166; + while (1) { + $175 = $$3190 << 1; + if (($175 | 0) == 32768) { + label = 49; + break L32; + } + $181 = $$3160189 + 1 | 0; + if (!(_arith_decode($0, $181) | 0)) { + $$4 = $175; + $$4161 = $181; + break; + } else { + $$3160189 = $181; + $$3190 = $175; + } + } + } + } else { + $$4 = $162; + $$4161 = $161; + } + $184 = $$4161 + 14 | 0; + $185 = $$4 >> 1; + if (!$185) $$3152$lcssa = $$4; else { + $$3152195 = $$4; + $190 = $185; + while (1) { + $188 = (_arith_decode($0, $184) | 0) == 0; + $spec$select164 = ($188 ? 0 : $190) | $$3152195; + $190 = $190 >> 1; + if (!$190) { + $$3152$lcssa = $spec$select164; + break; + } else $$3152195 = $spec$select164; + } + } + } else $$3152$lcssa = 0; + HEAP16[$68 + (HEAP32[$61 + ($$lcssa << 2) >> 2] << 1) >> 1] = ($160 | 0) == 0 ? $$3152$lcssa + 1 | 0 : $$3152$lcssa ^ 65535; + if (($$lcssa | 0) < (HEAP32[$65 >> 2] | 0)) $$0155 = $$lcssa; else break; + } + } while (0); + $$0162200 = $$0162200 + 1 | 0; + if (($$0162200 | 0) >= (HEAP32[$62 >> 2] | 0)) { + label = 56; + break; + } + } + if ((label | 0) == 26) { + $94 = HEAP32[$0 >> 2] | 0; + HEAP32[$94 + 20 >> 2] = 117; + FUNCTION_TABLE_vii[HEAP32[$94 + 4 >> 2] & 255]($0, -1); + HEAP32[$57 >> 2] = -1; + return 1; + } else if ((label | 0) == 42) { + $151 = HEAP32[$0 >> 2] | 0; + HEAP32[$151 + 20 >> 2] = 117; + FUNCTION_TABLE_vii[HEAP32[$151 + 4 >> 2] & 255]($0, -1); + HEAP32[$57 >> 2] = -1; + return 1; + } else if ((label | 0) == 49) { + $177 = HEAP32[$0 >> 2] | 0; + HEAP32[$177 + 20 >> 2] = 117; + FUNCTION_TABLE_vii[HEAP32[$177 + 4 >> 2] & 255]($0, -1); + HEAP32[$57 >> 2] = -1; + return 1; + } else if ((label | 0) == 56) return 1; + return 0; +} + +function _jpeg_idct_16x16($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0403411 = 0, $$0405410 = 0, $$0406409 = 0, $$0412 = 0, $$1404407 = 0, $$1408 = 0, $101 = 0, $103 = 0, $109 = 0, $114 = 0, $115 = 0, $118 = 0, $122 = 0, $128 = 0, $130 = 0, $131 = 0, $132 = 0, $134 = 0, $135 = 0, $136 = 0, $15 = 0, $188 = 0, $191 = 0, $194 = 0, $196 = 0, $197 = 0, $198 = 0, $199 = 0, $200 = 0, $201 = 0, $202 = 0, $204 = 0, $206 = 0, $207 = 0, $208 = 0, $209 = 0, $21 = 0, $211 = 0, $213 = 0, $215 = 0, $217 = 0, $218 = 0, $219 = 0, $22 = 0, $220 = 0, $221 = 0, $222 = 0, $223 = 0, $224 = 0, $225 = 0, $227 = 0, $229 = 0, $23 = 0, $231 = 0, $233 = 0, $234 = 0, $236 = 0, $237 = 0, $239 = 0, $24 = 0, $241 = 0, $242 = 0, $244 = 0, $248 = 0, $25 = 0, $252 = 0, $254 = 0, $26 = 0, $260 = 0, $265 = 0, $266 = 0, $269 = 0, $27 = 0, $273 = 0, $279 = 0, $281 = 0, $282 = 0, $283 = 0, $285 = 0, $286 = 0, $287 = 0, $33 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $44 = 0, $46 = 0, $48 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $64 = 0, $7 = 0, $70 = 0, $76 = 0, $82 = 0, $83 = 0, $85 = 0, $86 = 0, $88 = 0, $90 = 0, $91 = 0, $93 = 0, $97 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 512 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(512); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0403411 = $5; + $$0405410 = HEAP32[$1 + 84 >> 2] | 0; + $$0406409 = $2; + $$0412 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0406409 >> 1] << 13, HEAP32[$$0405410 >> 2] | 0) | 0 | 1024; + $21 = Math_imul(HEAP32[$$0405410 + 128 >> 2] | 0, HEAP16[$$0406409 + 64 >> 1] | 0) | 0; + $22 = $21 * 10703 | 0; + $23 = $21 * 4433 | 0; + $24 = $22 + $15 | 0; + $25 = $15 - $22 | 0; + $26 = $23 + $15 | 0; + $27 = $15 - $23 | 0; + $33 = Math_imul(HEAP32[$$0405410 + 64 >> 2] | 0, HEAP16[$$0406409 + 32 >> 1] | 0) | 0; + $39 = Math_imul(HEAP32[$$0405410 + 192 >> 2] | 0, HEAP16[$$0406409 + 96 >> 1] | 0) | 0; + $40 = $33 - $39 | 0; + $41 = $40 * 2260 | 0; + $42 = $40 * 11363 | 0; + $44 = $42 + ($39 * 20995 | 0) | 0; + $46 = $41 + ($33 * 7373 | 0) | 0; + $48 = $42 + (Math_imul($33, -4926) | 0) | 0; + $50 = $41 + (Math_imul($39, -4176) | 0) | 0; + $51 = $44 + $24 | 0; + $52 = $24 - $44 | 0; + $53 = $46 + $26 | 0; + $54 = $26 - $46 | 0; + $55 = $48 + $27 | 0; + $56 = $27 - $48 | 0; + $57 = $50 + $25 | 0; + $58 = $25 - $50 | 0; + $64 = Math_imul(HEAP32[$$0405410 + 32 >> 2] | 0, HEAP16[$$0406409 + 16 >> 1] | 0) | 0; + $70 = Math_imul(HEAP32[$$0405410 + 96 >> 2] | 0, HEAP16[$$0406409 + 48 >> 1] | 0) | 0; + $76 = Math_imul(HEAP32[$$0405410 + 160 >> 2] | 0, HEAP16[$$0406409 + 80 >> 1] | 0) | 0; + $82 = Math_imul(HEAP32[$$0405410 + 224 >> 2] | 0, HEAP16[$$0406409 + 112 >> 1] | 0) | 0; + $83 = $76 + $64 | 0; + $85 = ($70 + $64 | 0) * 11086 | 0; + $86 = $83 * 10217 | 0; + $88 = ($82 + $64 | 0) * 8956 | 0; + $90 = ($64 - $82 | 0) * 7350 | 0; + $91 = $83 * 5461 | 0; + $93 = ($64 - $70 | 0) * 3363 | 0; + $97 = $85 + (Math_imul($64, -18730) | 0) + $86 + $88 | 0; + $101 = $93 + (Math_imul($64, -15038) | 0) + $91 + $90 | 0; + $103 = ($76 + $70 | 0) * 1136 | 0; + $109 = ($76 - $70 | 0) * 11529 | 0; + $114 = $82 + $70 | 0; + $115 = Math_imul($114, -5461) | 0; + $118 = $85 + ($70 * 589 | 0) + $103 + $115 | 0; + $122 = Math_imul($114, -10217) | 0; + $128 = $93 + ($70 * 16154 | 0) + $109 + $122 | 0; + $130 = Math_imul($82 + $76 | 0, -11086) | 0; + $131 = $103 + (Math_imul($76, -9222) | 0) + $86 + $130 | 0; + $132 = $115 + ($82 * 8728 | 0) + $88 + $130 | 0; + $134 = ($82 - $76 | 0) * 3363 | 0; + $135 = $122 + ($82 * 25733 | 0) + $90 + $134 | 0; + $136 = $109 + (Math_imul($76, -6278) | 0) + $91 + $134 | 0; + HEAP32[$$0403411 >> 2] = $97 + $51 >> 11; + HEAP32[$$0403411 + 480 >> 2] = $51 - $97 >> 11; + HEAP32[$$0403411 + 32 >> 2] = $118 + $53 >> 11; + HEAP32[$$0403411 + 448 >> 2] = $53 - $118 >> 11; + HEAP32[$$0403411 + 64 >> 2] = $131 + $55 >> 11; + HEAP32[$$0403411 + 416 >> 2] = $55 - $131 >> 11; + HEAP32[$$0403411 + 96 >> 2] = $132 + $57 >> 11; + HEAP32[$$0403411 + 384 >> 2] = $57 - $132 >> 11; + HEAP32[$$0403411 + 128 >> 2] = $135 + $58 >> 11; + HEAP32[$$0403411 + 352 >> 2] = $58 - $135 >> 11; + HEAP32[$$0403411 + 160 >> 2] = $136 + $56 >> 11; + HEAP32[$$0403411 + 320 >> 2] = $56 - $136 >> 11; + HEAP32[$$0403411 + 192 >> 2] = $128 + $54 >> 11; + HEAP32[$$0403411 + 288 >> 2] = $54 - $128 >> 11; + HEAP32[$$0403411 + 224 >> 2] = $101 + $52 >> 11; + HEAP32[$$0403411 + 256 >> 2] = $52 - $101 >> 11; + $$0412 = $$0412 + 1 | 0; + if (($$0412 | 0) == 8) break; else { + $$0403411 = $$0403411 + 4 | 0; + $$0405410 = $$0405410 + 4 | 0; + $$0406409 = $$0406409 + 2 | 0; + } + } + $188 = $7 + -384 | 0; + $$1404407 = $5; + $$1408 = 0; + while (1) { + $191 = (HEAP32[$3 + ($$1408 << 2) >> 2] | 0) + $4 | 0; + $194 = (HEAP32[$$1404407 >> 2] << 13) + 134348800 | 0; + $196 = HEAP32[$$1404407 + 16 >> 2] | 0; + $197 = $196 * 10703 | 0; + $198 = $196 * 4433 | 0; + $199 = $194 + $197 | 0; + $200 = $194 - $197 | 0; + $201 = $194 + $198 | 0; + $202 = $194 - $198 | 0; + $204 = HEAP32[$$1404407 + 8 >> 2] | 0; + $206 = HEAP32[$$1404407 + 24 >> 2] | 0; + $207 = $204 - $206 | 0; + $208 = $207 * 2260 | 0; + $209 = $207 * 11363 | 0; + $211 = $209 + ($206 * 20995 | 0) | 0; + $213 = $208 + ($204 * 7373 | 0) | 0; + $215 = $209 + (Math_imul($204, -4926) | 0) | 0; + $217 = $208 + (Math_imul($206, -4176) | 0) | 0; + $218 = $211 + $199 | 0; + $219 = $199 - $211 | 0; + $220 = $213 + $201 | 0; + $221 = $201 - $213 | 0; + $222 = $215 + $202 | 0; + $223 = $202 - $215 | 0; + $224 = $217 + $200 | 0; + $225 = $200 - $217 | 0; + $227 = HEAP32[$$1404407 + 4 >> 2] | 0; + $229 = HEAP32[$$1404407 + 12 >> 2] | 0; + $231 = HEAP32[$$1404407 + 20 >> 2] | 0; + $233 = HEAP32[$$1404407 + 28 >> 2] | 0; + $234 = $231 + $227 | 0; + $236 = ($229 + $227 | 0) * 11086 | 0; + $237 = $234 * 10217 | 0; + $239 = ($233 + $227 | 0) * 8956 | 0; + $241 = ($227 - $233 | 0) * 7350 | 0; + $242 = $234 * 5461 | 0; + $244 = ($227 - $229 | 0) * 3363 | 0; + $248 = $236 + (Math_imul($227, -18730) | 0) + $237 + $239 | 0; + $252 = $244 + (Math_imul($227, -15038) | 0) + $242 + $241 | 0; + $254 = ($231 + $229 | 0) * 1136 | 0; + $260 = ($231 - $229 | 0) * 11529 | 0; + $265 = $233 + $229 | 0; + $266 = Math_imul($265, -5461) | 0; + $269 = $236 + ($229 * 589 | 0) + $254 + $266 | 0; + $273 = Math_imul($265, -10217) | 0; + $279 = $244 + ($229 * 16154 | 0) + $260 + $273 | 0; + $281 = Math_imul($233 + $231 | 0, -11086) | 0; + $282 = $254 + (Math_imul($231, -9222) | 0) + $237 + $281 | 0; + $283 = $266 + ($233 * 8728 | 0) + $239 + $281 | 0; + $285 = ($233 - $231 | 0) * 3363 | 0; + $286 = $273 + ($233 * 25733 | 0) + $241 + $285 | 0; + $287 = $260 + (Math_imul($231, -6278) | 0) + $242 + $285 | 0; + HEAP8[$191 >> 0] = HEAP8[$188 + (($248 + $218 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 15 >> 0] = HEAP8[$188 + (($218 - $248 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 1 >> 0] = HEAP8[$188 + (($269 + $220 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 14 >> 0] = HEAP8[$188 + (($220 - $269 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 2 >> 0] = HEAP8[$188 + (($282 + $222 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 13 >> 0] = HEAP8[$188 + (($222 - $282 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 3 >> 0] = HEAP8[$188 + (($283 + $224 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 12 >> 0] = HEAP8[$188 + (($224 - $283 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 4 >> 0] = HEAP8[$188 + (($286 + $225 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 11 >> 0] = HEAP8[$188 + (($225 - $286 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 5 >> 0] = HEAP8[$188 + (($287 + $223 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 10 >> 0] = HEAP8[$188 + (($223 - $287 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 6 >> 0] = HEAP8[$188 + (($279 + $221 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 9 >> 0] = HEAP8[$188 + (($221 - $279 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 7 >> 0] = HEAP8[$188 + (($252 + $219 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 8 >> 0] = HEAP8[$188 + (($219 - $252 | 0) >>> 18 & 1023) >> 0] | 0; + $$1408 = $$1408 + 1 | 0; + if (($$1408 | 0) == 16) break; else $$1404407 = $$1404407 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function _finish_pass1($0) { + $0 = $0 | 0; + var $$0$lcssa$i$i = 0, $$0$lcssa$i34$i = 0, $$0124$i$i = 0, $$01623$i$i$i = 0, $$01724$i$i$i = 0, $$01822$i$i$i = 0, $$01921$i$i$i = 0, $$01923$i$i$i = 0, $$02022$i$i$i = 0, $$024$i$i$i = 0, $$025$i$i$i = 0, $$036$i = 0, $$05$i$i = 0, $$072$i$i = 0, $$083$lcssa$i$i = 0, $$083123$i$i = 0, $$087$lcssa$i$i = 0, $$087122$i$i = 0, $$091$lcssa$i$i = 0, $$091121$i$i = 0, $$095100$i$i = 0, $$096120$i$i = 0, $$097108$i$i = 0, $$09899$i$i = 0, $$1$i$i$i = 0, $$1112$i$i = 0, $$118$i$i$i = 0, $$184111$i$i = 0, $$188110$i$i = 0, $$192109$i$i = 0, $$2104$i$i = 0, $$285103$i$i = 0, $$289102$i$i = 0, $$293101$i$i = 0, $$3$i$i = 0, $$386$i$i = 0, $$390$i$i = 0, $$394$i$i = 0, $$sink11 = 0, $$sink12 = 0, $1 = 0, $100 = 0, $102 = 0, $103 = 0, $12 = 0, $120 = 0, $144 = 0, $2 = 0, $22 = 0, $26 = 0, $30 = 0, $31 = 0, $35 = 0, $36 = 0, $39 = 0, $42 = 0, $46 = 0, $48 = 0, $49 = 0, $5 = 0, $51 = 0, $52 = 0, $53 = 0, $55 = 0, $56 = 0, $57 = 0, $59 = 0, $60 = 0, $61 = 0, $64 = 0, $68 = 0, $7 = 0, $70 = 0, $72 = 0, $74 = 0, $78 = 0, $80 = 0, $82 = 0, $84 = 0, $86 = 0, $88 = 0, $90 = 0, $95 = 0, $97 = 0, $spec$select20$i$i$i = 0, label = 0; + $1 = $0 + 484 | 0; + $2 = HEAP32[$1 >> 2] | 0; + $5 = $0 + 136 | 0; + HEAP32[$5 >> 2] = HEAP32[$2 + 16 >> 2]; + $7 = HEAP32[$2 + 20 >> 2] | 0; + $12 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$0 + 4 >> 2] >> 2] & 63]($0, 1, $7 << 5) | 0; + HEAP32[$12 >> 2] = 0; + HEAP32[$12 + 4 >> 2] = 31; + HEAP32[$12 + 8 >> 2] = 0; + HEAP32[$12 + 12 >> 2] = 63; + HEAP32[$12 + 16 >> 2] = 0; + HEAP32[$12 + 20 >> 2] = 31; + _update_box($0, $12); + L1 : do if (($7 | 0) > 1) { + $$05$i$i = 1; + while (1) { + if (($$05$i$i << 1 | 0) > ($7 | 0)) { + $$01623$i$i$i = 0; + $$01822$i$i$i = 0; + $$01921$i$i$i = $12; + $$024$i$i$i = 0; + while (1) { + $30 = HEAP32[$$01921$i$i$i + 24 >> 2] | 0; + $31 = ($30 | 0) > ($$01623$i$i$i | 0); + $spec$select20$i$i$i = $31 ? $$01921$i$i$i : $$024$i$i$i; + $$01822$i$i$i = $$01822$i$i$i + 1 | 0; + if (($$01822$i$i$i | 0) == ($$05$i$i | 0)) { + $$072$i$i = $spec$select20$i$i$i; + break; + } else { + $$01623$i$i$i = $31 ? $30 : $$01623$i$i$i; + $$01921$i$i$i = $$01921$i$i$i + 32 | 0; + $$024$i$i$i = $spec$select20$i$i$i; + } + } + } else { + $$01724$i$i$i = 0; + $$01923$i$i$i = 0; + $$02022$i$i$i = $12; + $$025$i$i$i = 0; + while (1) { + $22 = HEAP32[$$02022$i$i$i + 28 >> 2] | 0; + if (($22 | 0) > ($$01724$i$i$i | 0)) { + $26 = (HEAP32[$$02022$i$i$i + 24 >> 2] | 0) > 0; + $$1$i$i$i = $26 ? $$02022$i$i$i : $$025$i$i$i; + $$118$i$i$i = $26 ? $22 : $$01724$i$i$i; + } else { + $$1$i$i$i = $$025$i$i$i; + $$118$i$i$i = $$01724$i$i$i; + } + $$01923$i$i$i = $$01923$i$i$i + 1 | 0; + if (($$01923$i$i$i | 0) == ($$05$i$i | 0)) { + $$072$i$i = $$1$i$i$i; + break; + } else { + $$01724$i$i$i = $$118$i$i$i; + $$02022$i$i$i = $$02022$i$i$i + 32 | 0; + $$025$i$i$i = $$1$i$i$i; + } + } + } + if (!$$072$i$i) { + $$0$lcssa$i$i = $$05$i$i; + break L1; + } + $35 = $12 + ($$05$i$i << 5) | 0; + $36 = $$072$i$i + 4 | 0; + HEAP32[$12 + ($$05$i$i << 5) + 4 >> 2] = HEAP32[$36 >> 2]; + $39 = $$072$i$i + 12 | 0; + HEAP32[$12 + ($$05$i$i << 5) + 12 >> 2] = HEAP32[$39 >> 2]; + $42 = $$072$i$i + 20 | 0; + HEAP32[$12 + ($$05$i$i << 5) + 20 >> 2] = HEAP32[$42 >> 2]; + HEAP32[$35 >> 2] = HEAP32[$$072$i$i >> 2]; + $46 = $$072$i$i + 8 | 0; + $48 = $12 + ($$05$i$i << 5) + 8 | 0; + HEAP32[$48 >> 2] = HEAP32[$46 >> 2]; + $49 = $$072$i$i + 16 | 0; + $51 = $12 + ($$05$i$i << 5) + 16 | 0; + HEAP32[$51 >> 2] = HEAP32[$49 >> 2]; + $52 = HEAP32[$36 >> 2] | 0; + $53 = HEAP32[$$072$i$i >> 2] | 0; + $55 = $52 - $53 << 4; + $56 = HEAP32[$39 >> 2] | 0; + $57 = HEAP32[$46 >> 2] | 0; + $59 = ($56 - $57 | 0) * 12 | 0; + $60 = HEAP32[$42 >> 2] | 0; + $61 = HEAP32[$49 >> 2] | 0; + $64 = ($55 | 0) > ($59 | 0); + switch ((($60 - $61 << 3 | 0) > (($64 ? $55 : $59) | 0) ? 2 : ($64 ^ 1) & 1) & 3) { + case 0: + { + $68 = ($53 + $52 | 0) / 2 | 0; + HEAP32[$36 >> 2] = $68; + $$sink11 = $35; + $$sink12 = $68; + label = 15; + break; + } + case 1: + { + $70 = ($57 + $56 | 0) / 2 | 0; + HEAP32[$39 >> 2] = $70; + $$sink11 = $48; + $$sink12 = $70; + label = 15; + break; + } + case 2: + { + $72 = ($61 + $60 | 0) / 2 | 0; + HEAP32[$42 >> 2] = $72; + $$sink11 = $51; + $$sink12 = $72; + label = 15; + break; + } + default: + {} + } + if ((label | 0) == 15) { + label = 0; + HEAP32[$$sink11 >> 2] = $$sink12 + 1; + } + _update_box($0, $$072$i$i); + _update_box($0, $35); + $74 = $$05$i$i + 1 | 0; + if (($74 | 0) < ($7 | 0)) $$05$i$i = $74; else { + $$0$lcssa$i$i = $74; + break L1; + } + } + } else $$0$lcssa$i$i = 1; while (0); + $$036$i = 0; + do { + $78 = HEAP32[(HEAP32[$1 >> 2] | 0) + 24 >> 2] | 0; + $80 = HEAP32[$12 + ($$036$i << 5) >> 2] | 0; + $82 = HEAP32[$12 + ($$036$i << 5) + 4 >> 2] | 0; + $84 = HEAP32[$12 + ($$036$i << 5) + 8 >> 2] | 0; + $86 = HEAP32[$12 + ($$036$i << 5) + 12 >> 2] | 0; + $88 = HEAP32[$12 + ($$036$i << 5) + 16 >> 2] | 0; + $90 = HEAP32[$12 + ($$036$i << 5) + 20 >> 2] | 0; + if (($80 | 0) > ($82 | 0) | ($84 | 0) > ($86 | 0) | ($88 | 0) > ($90 | 0)) { + $$0$lcssa$i34$i = 0; + $$083$lcssa$i$i = 0; + $$087$lcssa$i$i = 0; + $$091$lcssa$i$i = 0; + } else { + $$0124$i$i = 0; + $$083123$i$i = 0; + $$087122$i$i = 0; + $$091121$i$i = 0; + $$096120$i$i = $80; + while (1) { + $95 = HEAP32[$78 + ($$096120$i$i << 2) >> 2] | 0; + $97 = $$096120$i$i << 3 | 4; + $$097108$i$i = $84; + $$1112$i$i = $$0124$i$i; + $$184111$i$i = $$083123$i$i; + $$188110$i$i = $$087122$i$i; + $$192109$i$i = $$091121$i$i; + while (1) { + $100 = $$097108$i$i << 2 | 2; + $$095100$i$i = $95 + ($$097108$i$i << 6) + ($88 << 1) | 0; + $$09899$i$i = $88; + $$2104$i$i = $$1112$i$i; + $$285103$i$i = $$184111$i$i; + $$289102$i$i = $$188110$i$i; + $$293101$i$i = $$192109$i$i; + while (1) { + $102 = HEAP16[$$095100$i$i >> 1] | 0; + $103 = $102 & 65535; + if (!($102 << 16 >> 16)) { + $$3$i$i = $$2104$i$i; + $$386$i$i = $$285103$i$i; + $$390$i$i = $$289102$i$i; + $$394$i$i = $$293101$i$i; + } else { + $$3$i$i = (Math_imul($$09899$i$i << 3 | 4, $103) | 0) + $$2104$i$i | 0; + $$386$i$i = (Math_imul($100, $103) | 0) + $$285103$i$i | 0; + $$390$i$i = (Math_imul($97, $103) | 0) + $$289102$i$i | 0; + $$394$i$i = $$293101$i$i + $103 | 0; + } + if (($$09899$i$i | 0) < ($90 | 0)) { + $$095100$i$i = $$095100$i$i + 2 | 0; + $$09899$i$i = $$09899$i$i + 1 | 0; + $$2104$i$i = $$3$i$i; + $$285103$i$i = $$386$i$i; + $$289102$i$i = $$390$i$i; + $$293101$i$i = $$394$i$i; + } else break; + } + if (($$097108$i$i | 0) < ($86 | 0)) { + $$097108$i$i = $$097108$i$i + 1 | 0; + $$1112$i$i = $$3$i$i; + $$184111$i$i = $$386$i$i; + $$188110$i$i = $$390$i$i; + $$192109$i$i = $$394$i$i; + } else break; + } + if (($$096120$i$i | 0) < ($82 | 0)) { + $$0124$i$i = $$3$i$i; + $$083123$i$i = $$386$i$i; + $$087122$i$i = $$390$i$i; + $$091121$i$i = $$394$i$i; + $$096120$i$i = $$096120$i$i + 1 | 0; + } else { + $$0$lcssa$i34$i = $$3$i$i; + $$083$lcssa$i$i = $$386$i$i; + $$087$lcssa$i$i = $$390$i$i; + $$091$lcssa$i$i = $$394$i$i; + break; + } + } + } + $120 = $$091$lcssa$i$i >> 1; + HEAP8[(HEAP32[HEAP32[$5 >> 2] >> 2] | 0) + $$036$i >> 0] = ($$087$lcssa$i$i + $120 | 0) / ($$091$lcssa$i$i | 0) | 0; + HEAP8[(HEAP32[(HEAP32[$5 >> 2] | 0) + 4 >> 2] | 0) + $$036$i >> 0] = ($$083$lcssa$i$i + $120 | 0) / ($$091$lcssa$i$i | 0) | 0; + HEAP8[(HEAP32[(HEAP32[$5 >> 2] | 0) + 8 >> 2] | 0) + $$036$i >> 0] = ($$0$lcssa$i34$i + $120 | 0) / ($$091$lcssa$i$i | 0) | 0; + $$036$i = $$036$i + 1 | 0; + } while (($$036$i | 0) < ($$0$lcssa$i$i | 0)); + HEAP32[$0 + 132 >> 2] = $$0$lcssa$i$i; + $144 = HEAP32[$0 >> 2] | 0; + HEAP32[$144 + 20 >> 2] = 98; + HEAP32[$144 + 24 >> 2] = $$0$lcssa$i$i; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 1); + HEAP32[$2 + 28 >> 2] = 1; + return; +} + +function _get_matrix_code($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0212 = 0, $$0213 = 0, $$0217 = 0, $$0225 = 0, $$0228 = 0, $$0230 = 0, $$1214 = 0, $$1218 = 0, $$2215 = 0, $$2219 = 0, $$3216 = 0, $$3220 = 0, $$4221 = 0, $$5222 = 0, $$6223 = 0, $$7224 = 0, $107 = 0, $11 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0, $12 = 0, $125 = 0, $126 = 0, $132 = 0, $133 = 0, $134 = 0, $135 = 0, $138 = 0, $14 = 0, $149 = 0, $150 = 0, $151 = 0, $154 = 0, $160 = 0, $161 = 0, $164 = 0, $173 = 0, $174 = 0, $178 = 0, $188 = 0, $189 = 0, $190 = 0, $191 = 0, $192 = 0, $193 = 0, $194 = 0, $195 = 0, $196 = 0, $197 = 0, $198 = 0, $199 = 0, $200 = 0, $201 = 0, $202 = 0, $203 = 0, $21 = 0, $25 = 0, $26 = 0, $30 = 0, $44 = 0, $55 = 0, $57 = 0, $58 = 0, $65 = 0, $67 = 0, $68 = 0, $7 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $8 = 0, $86 = 0, $87 = 0, $89 = 0, $9 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $97 = 0, $or$cond7249 = 0, $spec$select232 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $7 = sp + 24 | 0; + $8 = sp; + $9 = sp + 16 | 0; + L1 : do if (($1 + -3 | 0) >>> 0 > 5) { + HEAP32[$2 >> 2] = -1; + HEAP32[$3 >> 2] = 0; + HEAPF64[$4 >> 3] = -1.0; + $$0212 = -1; + } else { + HEAP32[$8 >> 2] = 0; + $11 = $1 + -1 | 0; + $12 = Math_imul($11, $1) | 0; + HEAP32[$8 + 4 >> 2] = $12; + $14 = Math_imul($1, $1) | 0; + HEAP32[$8 + 8 >> 2] = $14 + -1; + HEAP32[$8 + 12 >> 2] = $11; + $$0217 = 0; + $$0228 = 0; + $$0230 = -1; + while (1) { + if (($$0217 | 0) == 4) break; + $21 = HEAP8[$0 + (HEAP32[$8 + ($$0217 << 2) >> 2] | 0) >> 0] | 0; + $$0217 = $$0217 + 1 | 0; + $$0228 = ($21 & 255) > ($$0228 & 255) ? $21 : $$0228; + $$0230 = ($21 & 255) < ($$0230 & 255) ? $21 : $$0230; + } + $25 = $$0228 & 255; + $26 = $$0230 & 255; + if (($25 - $26 | 0) < 30) { + HEAP32[$2 >> 2] = -1; + HEAP32[$3 >> 2] = 0; + HEAPF64[$4 >> 3] = -1.0; + $$0212 = -2; + break; + } + $30 = ($25 + $26 | 0) >>> 1; + $$1218 = 0; + while (1) { + if (($$1218 | 0) == 4) break; + HEAP8[$7 + $$1218 >> 0] = $30 >>> 0 > (HEAPU8[$0 + (HEAP32[$8 + ($$1218 << 2) >> 2] | 0) >> 0] | 0) >>> 0 & 1; + $$1218 = $$1218 + 1 | 0; + } + $$2219 = 0; + while (1) { + if ($$2219 >>> 0 >= 4) { + label = 18; + break; + } + $44 = $$2219 + 1 | 0; + if (((HEAP8[$7 + $$2219 >> 0] | 0) == 1 ? (HEAP8[$7 + ($44 & 3) >> 0] | 0) == 1 : 0) ? (HEAP8[$7 + ($$2219 + 2 & 3) >> 0] | 0) == 0 : 0) { + label = 17; + break; + } + $$2219 = $44; + } + if ((label | 0) == 17) HEAP32[$3 >> 2] = $$2219; else if ((label | 0) == 18 ? ($$2219 | 0) == 4 : 0) { + HEAP32[$2 >> 2] = -1; + HEAP32[$3 >> 2] = 0; + HEAPF64[$4 >> 3] = -1.0; + $$0212 = -3; + break; + } + $$0225 = 255; + $$3220 = 0; + while (1) { + if (($$3220 | 0) == ($14 | 0)) break; + $55 = $0 + $$3220 | 0; + $57 = HEAPU8[$55 >> 0] | 0; + $58 = $57 - $30 | 0; + $spec$select232 = ($58 | 0) < 0 ? 0 - $58 | 0 : $58; + HEAP8[$55 >> 0] = $30 >>> 0 > $57 >>> 0 & 1; + $$0225 = ($spec$select232 | 0) < ($$0225 | 0) ? $spec$select232 : $$0225; + $$3220 = $$3220 + 1 | 0; + } + $65 = HEAP32[$3 >> 2] | 0; + L31 : do switch ($65 | 0) { + case 0: + { + $$0213 = $65; + $194 = 0; + $195 = 0; + while (1) { + if (($$0213 | 0) >= ($1 | 0)) { + $149 = $194; + $173 = $195; + break L31; + } + $67 = ($$0213 | 0) == ($11 | 0); + $68 = Math_imul($$0213, $1) | 0; + $$4221 = 0; + $73 = $194; + $74 = $195; + while (1) { + if (($$4221 | 0) == ($1 | 0)) break; + if (($$4221 | $$0213 | 0) != 0 ? !($67 & (($$4221 | 0) == 0 | ($$4221 | 0) == ($11 | 0))) : 0) { + $75 = _bitshift64Shl($73 | 0, $74 | 0, 1) | 0; + $76 = getTempRet0() | 0; + $196 = $75 | (HEAP8[$0 + ($$4221 + $68) >> 0] | 0) != 0; + $197 = $76; + } else { + $196 = $73; + $197 = $74; + } + $$4221 = $$4221 + 1 | 0; + $73 = $196; + $74 = $197; + } + $$0213 = $$0213 + 1 | 0; + $194 = $73; + $195 = $74; + } + break; + } + case 1: + { + $$5222 = 0; + $192 = 0; + $193 = 0; + while (1) { + if (($$5222 | 0) >= ($1 | 0)) { + $149 = $192; + $173 = $193; + break L31; + } + $86 = ($$5222 | 0) == 0; + $87 = ($$5222 | 0) == ($11 | 0); + $$1214 = $11; + $91 = $192; + $92 = $193; + while (1) { + if (($$1214 | 0) <= -1) break; + $89 = ($$1214 | 0) == ($11 | 0); + if (!($86 & $89) ? !($87 & ($89 | ($$1214 | 0) == 0)) : 0) { + $93 = _bitshift64Shl($91 | 0, $92 | 0, 1) | 0; + $94 = getTempRet0() | 0; + $97 = $0 + ((Math_imul($$1214, $1) | 0) + $$5222) | 0; + $198 = $93 | (HEAP8[$97 >> 0] | 0) != 0; + $199 = $94; + } else { + $198 = $91; + $199 = $92; + } + $$1214 = $$1214 + -1 | 0; + $91 = $198; + $92 = $199; + } + $$5222 = $$5222 + 1 | 0; + $192 = $91; + $193 = $92; + } + break; + } + case 2: + { + $$2215 = $11; + $190 = 0; + $191 = 0; + while (1) { + if (($$2215 | 0) <= -1) { + $149 = $190; + $173 = $191; + break L31; + } + $or$cond7249 = ($$2215 | 0) == ($11 | 0) | ($$2215 | 0) == 0; + $107 = Math_imul($$2215, $1) | 0; + $$6223 = $11; + $112 = $190; + $113 = $191; + while (1) { + if (($$6223 | 0) <= -1) break; + if ($or$cond7249 & ($$6223 | 0) == ($11 | 0) | ($$6223 | $$2215 | 0) == 0) { + $200 = $112; + $201 = $113; + } else { + $114 = _bitshift64Shl($112 | 0, $113 | 0, 1) | 0; + $115 = getTempRet0() | 0; + $200 = $114 | (HEAP8[$0 + ($$6223 + $107) >> 0] | 0) != 0; + $201 = $115; + } + $$6223 = $$6223 + -1 | 0; + $112 = $200; + $113 = $201; + } + $$2215 = $$2215 + -1 | 0; + $190 = $112; + $191 = $113; + } + break; + } + case 3: + { + $$7224 = $11; + $188 = 0; + $189 = 0; + while (1) { + if (($$7224 | 0) <= -1) { + $149 = $188; + $173 = $189; + break L31; + } + $125 = ($$7224 | 0) == ($11 | 0); + $126 = ($$7224 | 0) == 0; + $$3216 = 0; + $132 = $188; + $133 = $189; + while (1) { + if (($$3216 | 0) >= ($1 | 0)) break; + if ($125 & ($$3216 | 0) == 0 | ($$3216 | $$7224 | 0) == 0 | $126 & ($$3216 | 0) == ($11 | 0)) { + $202 = $132; + $203 = $133; + } else { + $134 = _bitshift64Shl($132 | 0, $133 | 0, 1) | 0; + $135 = getTempRet0() | 0; + $138 = $0 + ((Math_imul($$3216, $1) | 0) + $$7224) | 0; + $202 = $134 | (HEAP8[$138 >> 0] | 0) != 0; + $203 = $135; + } + $$3216 = $$3216 + 1 | 0; + $132 = $202; + $133 = $203; + } + $$7224 = $$7224 + -1 | 0; + $188 = $132; + $189 = $133; + } + break; + } + default: + { + $149 = 0; + $173 = 0; + } + } while (0); + HEAPF64[$4 >> 3] = ($$0225 | 0) > 30 ? 1.0 : +($$0225 | 0) / 30.0; + switch ($5 | 0) { + case 259: + { + $150 = HEAP8[240 + $149 >> 0] | 0; + $151 = $150 << 24 >> 24; + $154 = $9; + HEAP32[$154 >> 2] = $151; + HEAP32[$154 + 4 >> 2] = (($151 | 0) < 0) << 31 >> 31; + if ($150 << 24 >> 24 < 0) { + HEAP32[$2 >> 2] = -1; + HEAPF64[$4 >> 3] = -1.0; + $$0212 = -4; + break L1; + } + break; + } + case 515: + { + $160 = HEAP8[112 + $149 >> 0] | 0; + $161 = $160 << 24 >> 24; + $164 = $9; + HEAP32[$164 >> 2] = $161; + HEAP32[$164 + 4 >> 2] = (($161 | 0) < 0) << 31 >> 31; + if ($6 | 0) HEAP32[$6 >> 2] = HEAPU8[176 + $149 >> 0]; + if ($160 << 24 >> 24 < 0) { + HEAP32[$2 >> 2] = -1; + HEAPF64[$4 >> 3] = -1.0; + $$0212 = -4; + break L1; + } + break; + } + case 772: + case 1028: + case 1029: + case 1285: + { + $174 = _decode_bch($5, $149, $173, 0, $9) | 0; + if (($174 | 0) < 0) { + HEAP32[$2 >> 2] = -1; + HEAPF64[$4 >> 3] = -1.0; + $$0212 = -4; + break L1; + } + if (($6 | 0) != 0 & ($174 | 0) != 0) HEAP32[$6 >> 2] = $174; + break; + } + default: + { + $178 = $9; + HEAP32[$178 >> 2] = $149; + HEAP32[$178 + 4 >> 2] = $173; + } + } + HEAP32[$2 >> 2] = HEAP32[$9 >> 2]; + $$0212 = 0; + } while (0); + STACKTOP = sp; + return $$0212 | 0; +} + +function _kpmMergeRefDataSet($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$0181 = 0, $$0182 = 0, $$0185 = 0, $$0191 = 0, $$0193 = 0, $$1 = 0, $$1183 = 0, $$1186 = 0, $$1192 = 0, $$1194 = 0, $$2184 = 0, $$2187 = 0, $$2195 = 0, $$3 = 0, $$3188 = 0, $$4 = 0, $$4189 = 0, $$5 = 0, $$5190 = 0, $$pre$phiZ2D = 0, $$pre205 = 0, $103 = 0, $11 = 0, $113 = 0, $118 = 0, $121 = 0, $129 = 0, $131 = 0, $14 = 0, $142 = 0, $143 = 0, $146 = 0, $148 = 0, $15 = 0, $156 = 0, $158 = 0, $162 = 0, $163 = 0, $164 = 0, $167 = 0, $17 = 0, $171 = 0, $176 = 0, $18 = 0, $20 = 0, $33 = 0, $35 = 0, $36 = 0, $39 = 0, $4 = 0, $40 = 0, $42 = 0, $43 = 0, $44 = 0, $58 = 0, $6 = 0, $60 = 0, $64 = 0, $65 = 0, $66 = 0, $74 = 0, $83 = 0, $85 = 0, $89 = 0, $96 = 0, $98 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer3 = 0, $vararg_buffer5 = 0, $vararg_buffer7 = 0, $vararg_buffer9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $vararg_buffer9 = sp + 40 | 0; + $vararg_buffer7 = sp + 32 | 0; + $vararg_buffer5 = sp + 24 | 0; + $vararg_buffer3 = sp + 16 | 0; + $vararg_buffer1 = sp + 8 | 0; + $vararg_buffer = sp; + if (($0 | 0) != 0 & ($1 | 0) != 0) { + $4 = HEAP32[$0 >> 2] | 0; + do if (!$4) { + $6 = _malloc(16) | 0; + HEAP32[$0 >> 2] = $6; + if (!$6) { + _arLog(0, 3, 45930, $vararg_buffer1); + _exit(1); + } else { + HEAP32[$6 + 4 >> 2] = 0; + HEAP32[$6 >> 2] = 0; + HEAP32[$6 + 12 >> 2] = 0; + HEAP32[$6 + 8 >> 2] = 0; + $14 = $6; + $176 = $6; + break; + } + } else { + $14 = $4; + $176 = $4; + } while (0); + $11 = HEAP32[$1 >> 2] | 0; + if (!$11) $$0 = 0; else { + $15 = HEAP32[$14 + 4 >> 2] | 0; + $17 = HEAP32[$11 + 4 >> 2] | 0; + $18 = $17 + $15 | 0; + $20 = _malloc($18 * 132 | 0) | 0; + if (!$20) { + _arLog(0, 3, 45930, $vararg_buffer3); + _exit(1); + } + $$0185 = 0; + while (1) { + if (($$0185 | 0) >= ($15 | 0)) break; + _memcpy($20 + ($$0185 * 132 | 0) | 0, (HEAP32[$14 >> 2] | 0) + ($$0185 * 132 | 0) | 0, 132) | 0; + $$0185 = $$0185 + 1 | 0; + } + $$1186 = 0; + while (1) { + if (($$1186 | 0) >= ($17 | 0)) break; + _memcpy($20 + (($$1186 + $15 | 0) * 132 | 0) | 0, (HEAP32[$11 >> 2] | 0) + ($$1186 * 132 | 0) | 0, 132) | 0; + $$1186 = $$1186 + 1 | 0; + } + $33 = HEAP32[$14 >> 2] | 0; + if (!$33) $35 = $176; else { + _free($33); + $35 = HEAP32[$0 >> 2] | 0; + } + HEAP32[$35 >> 2] = $20; + $36 = HEAP32[$0 >> 2] | 0; + HEAP32[$36 + 4 >> 2] = $18; + $39 = HEAP32[$36 + 12 >> 2] | 0; + $40 = HEAP32[$1 >> 2] | 0; + $42 = HEAP32[$40 + 12 >> 2] | 0; + $43 = $40 + 8 | 0; + $44 = $36 + 8 | 0; + $$0191 = 0; + $$2187 = 0; + while (1) { + if (($$2187 | 0) >= ($42 | 0)) break; + $$0182 = 0; + while (1) { + if (($$0182 | 0) >= ($39 | 0)) { + $$1192 = $$0191; + break; + } + if ((HEAP32[(HEAP32[$43 >> 2] | 0) + ($$2187 * 12 | 0) + 8 >> 2] | 0) == (HEAP32[(HEAP32[$44 >> 2] | 0) + ($$0182 * 12 | 0) + 8 >> 2] | 0)) { + label = 23; + break; + } else $$0182 = $$0182 + 1 | 0; + } + if ((label | 0) == 23) { + label = 0; + $$1192 = $$0191 + 1 | 0; + } + $$0191 = $$1192; + $$2187 = $$2187 + 1 | 0; + } + $58 = $42 + $39 - $$0191 | 0; + $60 = _malloc($58 * 12 | 0) | 0; + if (!$60) { + _arLog(0, 3, 45930, $vararg_buffer5); + _exit(1); + } + $$3188 = 0; + while (1) { + if (($$3188 | 0) >= ($39 | 0)) break; + $64 = (HEAP32[$0 >> 2] | 0) + 8 | 0; + $65 = HEAP32[$64 >> 2] | 0; + $66 = $65 + ($$3188 * 12 | 0) + 8 | 0; + HEAP32[$60 + ($$3188 * 12 | 0) + 8 >> 2] = HEAP32[$66 >> 2]; + $$0193 = HEAP32[$65 + ($$3188 * 12 | 0) + 4 >> 2] | 0; + $$1183 = 0; + while (1) { + if (($$1183 | 0) >= ($42 | 0)) break; + $74 = HEAP32[(HEAP32[$1 >> 2] | 0) + 8 >> 2] | 0; + if ((HEAP32[$74 + ($$1183 * 12 | 0) + 8 >> 2] | 0) == (HEAP32[$66 >> 2] | 0)) $$1194 = (HEAP32[$74 + ($$1183 * 12 | 0) + 4 >> 2] | 0) + $$0193 | 0; else $$1194 = $$0193; + $$0193 = $$1194; + $$1183 = $$1183 + 1 | 0; + } + $83 = $60 + ($$3188 * 12 | 0) | 0; + $85 = _malloc($$0193 * 12 | 0) | 0; + HEAP32[$83 >> 2] = $85; + if (!$85) { + label = 36; + break; + } + $89 = HEAP32[(HEAP32[$64 >> 2] | 0) + ($$3188 * 12 | 0) + 4 >> 2] | 0; + $$2184 = 0; + while (1) { + if (($$2184 | 0) >= ($89 | 0)) break; + $96 = (HEAP32[(HEAP32[(HEAP32[$0 >> 2] | 0) + 8 >> 2] | 0) + ($$3188 * 12 | 0) >> 2] | 0) + ($$2184 * 12 | 0) | 0; + $98 = (HEAP32[$83 >> 2] | 0) + ($$2184 * 12 | 0) | 0; + HEAP32[$98 >> 2] = HEAP32[$96 >> 2]; + HEAP32[$98 + 4 >> 2] = HEAP32[$96 + 4 >> 2]; + HEAP32[$98 + 8 >> 2] = HEAP32[$96 + 8 >> 2]; + $$2184 = $$2184 + 1 | 0; + } + $$3 = 0; + while (1) { + if (($$3 | 0) >= ($42 | 0)) break; + $103 = HEAP32[(HEAP32[$1 >> 2] | 0) + 8 >> 2] | 0; + if ((HEAP32[$103 + ($$3 * 12 | 0) + 8 >> 2] | 0) == (HEAP32[(HEAP32[(HEAP32[$0 >> 2] | 0) + 8 >> 2] | 0) + ($$3188 * 12 | 0) + 8 >> 2] | 0)) { + label = 43; + break; + } + $$3 = $$3 + 1 | 0; + } + L56 : do if ((label | 0) == 43) { + label = 0; + $$0181 = 0; + $113 = $103; + while (1) { + if (($$0181 | 0) >= (HEAP32[$113 + ($$3 * 12 | 0) + 4 >> 2] | 0)) break L56; + $118 = (HEAP32[$113 + ($$3 * 12 | 0) >> 2] | 0) + ($$0181 * 12 | 0) | 0; + $121 = (HEAP32[$83 >> 2] | 0) + (($$0181 + $89 | 0) * 12 | 0) | 0; + HEAP32[$121 >> 2] = HEAP32[$118 >> 2]; + HEAP32[$121 + 4 >> 2] = HEAP32[$118 + 4 >> 2]; + HEAP32[$121 + 8 >> 2] = HEAP32[$118 + 8 >> 2]; + $$0181 = $$0181 + 1 | 0; + $113 = HEAP32[(HEAP32[$1 >> 2] | 0) + 8 >> 2] | 0; + } + } while (0); + HEAP32[$60 + ($$3188 * 12 | 0) + 4 >> 2] = $$0193; + $$3188 = $$3188 + 1 | 0; + } + if ((label | 0) == 36) { + _arLog(0, 3, 45930, $vararg_buffer7); + _exit(1); + } + $$1 = 0; + $$4189 = 0; + while (1) { + if (($$4189 | 0) >= ($42 | 0)) break; + $129 = HEAP32[(HEAP32[$1 >> 2] | 0) + 8 >> 2] | 0; + $131 = HEAP32[$129 + ($$4189 * 12 | 0) + 8 >> 2] | 0; + $$4 = 0; + while (1) { + if (($$4 | 0) >= ($39 | 0)) { + label = 53; + break; + } + if (($131 | 0) == (HEAP32[(HEAP32[(HEAP32[$0 >> 2] | 0) + 8 >> 2] | 0) + ($$4 * 12 | 0) + 8 >> 2] | 0)) { + label = 52; + break; + } else $$4 = $$4 + 1 | 0; + } + if ((label | 0) == 52) { + label = 0; + $$2195 = $$1 + 1 | 0; + } else if ((label | 0) == 53) { + label = 0; + $142 = $$4189 + $39 - $$1 | 0; + $143 = $60 + ($142 * 12 | 0) | 0; + HEAP32[$60 + ($142 * 12 | 0) + 8 >> 2] = $131; + $146 = HEAP32[$129 + ($$4189 * 12 | 0) + 4 >> 2] | 0; + $148 = _malloc($146 * 12 | 0) | 0; + HEAP32[$143 >> 2] = $148; + if (!$148) { + label = 55; + break; + } + $$5 = 0; + while (1) { + if (($$5 | 0) >= ($146 | 0)) break; + $156 = (HEAP32[(HEAP32[(HEAP32[$1 >> 2] | 0) + 8 >> 2] | 0) + ($$4189 * 12 | 0) >> 2] | 0) + ($$5 * 12 | 0) | 0; + $158 = (HEAP32[$143 >> 2] | 0) + ($$5 * 12 | 0) | 0; + HEAP32[$158 >> 2] = HEAP32[$156 >> 2]; + HEAP32[$158 + 4 >> 2] = HEAP32[$156 + 4 >> 2]; + HEAP32[$158 + 8 >> 2] = HEAP32[$156 + 8 >> 2]; + $$5 = $$5 + 1 | 0; + } + HEAP32[$60 + ($142 * 12 | 0) + 4 >> 2] = $146; + $$2195 = $$1; + } + $$1 = $$2195; + $$4189 = $$4189 + 1 | 0; + } + if ((label | 0) == 55) { + _arLog(0, 3, 45930, $vararg_buffer9); + _exit(1); + } + $162 = HEAP32[$0 >> 2] | 0; + $163 = $162 + 8 | 0; + $164 = HEAP32[$163 >> 2] | 0; + if (!$164) $$pre$phiZ2D = $163; else { + $$5190 = 0; + $167 = $162; + $171 = $164; + while (1) { + if (($$5190 | 0) >= (HEAP32[$167 + 12 >> 2] | 0)) break; + _free(HEAP32[$171 + ($$5190 * 12 | 0) >> 2] | 0); + $$pre205 = HEAP32[$0 >> 2] | 0; + $$5190 = $$5190 + 1 | 0; + $167 = $$pre205; + $171 = HEAP32[$$pre205 + 8 >> 2] | 0; + } + _free($171); + $$pre$phiZ2D = (HEAP32[$0 >> 2] | 0) + 8 | 0; + } + HEAP32[$$pre$phiZ2D >> 2] = $60; + HEAP32[(HEAP32[$0 >> 2] | 0) + 12 >> 2] = $58; + _kpmDeleteRefDataSet($1) | 0; + $$0 = 0; + } + } else { + _arLog(0, 3, 26204, $vararg_buffer); + $$0 = -1; + } + STACKTOP = sp; + return $$0 | 0; +} + +function _arMultiReadConfigFile($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0151 = 0, $$0152 = 0, $$0154 = 0, $$1 = 0, $$1$ph = 0, $$2 = 0, $$sink204 = 0, $$sink205 = 0, $10 = 0, $114 = 0, $12 = 0, $125 = 0, $15 = 0, $17 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $37 = 0, $4 = 0, $41 = 0, $5 = 0, $51 = 0, $52 = 0, $56 = 0, $57 = 0, $59 = 0, $6 = 0, $7 = 0, $75 = 0.0, $76 = 0.0, $77 = 0.0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $86 = 0.0, $90 = 0.0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer11 = 0, $vararg_buffer13 = 0, $vararg_buffer17 = 0, $vararg_buffer21 = 0, $vararg_buffer24 = 0, $vararg_buffer28 = 0, $vararg_buffer31 = 0, $vararg_buffer35 = 0, $vararg_buffer41 = 0, $vararg_buffer45 = 0, $vararg_buffer49 = 0, $vararg_buffer5 = 0, $vararg_buffer55 = 0, $vararg_buffer59 = 0, $vararg_buffer8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 2528 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(2528); + $vararg_buffer59 = sp + 2512 | 0; + $vararg_buffer55 = sp + 2504 | 0; + $vararg_buffer49 = sp + 2488 | 0; + $vararg_buffer45 = sp + 2480 | 0; + $vararg_buffer41 = sp + 2472 | 0; + $vararg_buffer35 = sp + 2456 | 0; + $vararg_buffer31 = sp + 2448 | 0; + $vararg_buffer28 = sp + 2440 | 0; + $vararg_buffer24 = sp + 2432 | 0; + $vararg_buffer21 = sp + 2424 | 0; + $vararg_buffer17 = sp + 2416 | 0; + $vararg_buffer13 = sp + 2408 | 0; + $vararg_buffer11 = sp + 2400 | 0; + $vararg_buffer8 = sp + 2392 | 0; + $vararg_buffer5 = sp + 2384 | 0; + $vararg_buffer1 = sp + 2376 | 0; + $vararg_buffer = sp + 2368 | 0; + $2 = sp + 2304 | 0; + $3 = sp + 2048 | 0; + $4 = sp; + $5 = sp + 2524 | 0; + $6 = sp + 2520 | 0; + $7 = sp + 2516 | 0; + $8 = _fopen($0, 25925) | 0; + do if (!$8) { + HEAP32[$vararg_buffer >> 2] = $0; + _arLog(0, 3, 24935, $vararg_buffer); + $10 = ___errno_location() | 0; + $12 = _strerror(HEAP32[$10 >> 2] | 0) | 0; + HEAP32[$vararg_buffer1 >> 2] = 67447; + HEAP32[$vararg_buffer1 + 4 >> 2] = $12; + _arLog(0, 3, 25953, $vararg_buffer1); + $$0154 = 0; + } else { + _get_buff($3, $8); + HEAP32[$vararg_buffer5 >> 2] = $6; + if ((_sscanf($3, 25959, $vararg_buffer5) | 0) != 1) { + HEAP32[$vararg_buffer8 >> 2] = $0; + _arLog(0, 3, 24988, $vararg_buffer8); + _fclose($8) | 0; + $$0154 = 0; + break; + } + $15 = HEAP32[$6 >> 2] | 0; + $17 = _malloc($15 * 320 | 0) | 0; + if (!$17) { + _arLog(0, 3, 45930, $vararg_buffer11); + _exit(1); + } + $19 = ($1 | 0) == 0; + $20 = $2 + 8 | 0; + $21 = $2 + 16 | 0; + $22 = $2 + 24 | 0; + $23 = $2 + 32 | 0; + $24 = $2 + 40 | 0; + $25 = $2 + 48 | 0; + $26 = $2 + 56 | 0; + $$0151 = 0; + $$0152 = 0; + $28 = $15; + L10 : while (1) { + if (($$0151 | 0) >= ($28 | 0)) { + label = 31; + break; + } + _get_buff($3, $8); + $29 = $17 + ($$0151 * 320 | 0) | 0; + $30 = $17 + ($$0151 * 320 | 0) + 312 | 0; + HEAP32[$vararg_buffer13 >> 2] = $30; + HEAP32[$vararg_buffer13 + 4 >> 2] = $5; + if ((_sscanf($3, 25089, $vararg_buffer13) | 0) != 1) { + if ($19) { + label = 11; + break; + } + if (!(_arUtilGetDirectoryNameFromPath($4, $0, 2048, 1) | 0)) { + label = 13; + break; + } + _strncat($4, $3, 2047 - (_strlen($4) | 0) | 0) | 0; + $37 = _arPattLoad($1, $4) | 0; + HEAP32[$29 >> 2] = $37; + if (($37 | 0) < 0) { + label = 15; + break; + } else { + $$sink204 = 1; + $$sink205 = 0; + } + } else { + $41 = HEAP32[$30 >> 2] | 0; + HEAP32[$29 >> 2] = ($41 & -32768 | 0) == 0 & 0 == 0 ? $41 & 32767 : 0; + $$sink204 = 2; + $$sink205 = 1; + } + HEAP32[$17 + ($$0151 * 320 | 0) + 4 >> 2] = $$sink205; + $51 = $$0152 | $$sink204; + _get_buff($3, $8); + $52 = $17 + ($$0151 * 320 | 0) + 8 | 0; + HEAP32[$vararg_buffer28 >> 2] = $52; + if ((_sscanf($3, 25385, $vararg_buffer28) | 0) != 1) { + label = 18; + break; + } + _get_buff($3, $8); + $56 = $17 + ($$0151 * 320 | 0) + 16 | 0; + $57 = $17 + ($$0151 * 320 | 0) + 24 | 0; + $59 = $17 + ($$0151 * 320 | 0) + 40 | 0; + HEAP32[$vararg_buffer35 >> 2] = $56; + HEAP32[$vararg_buffer35 + 4 >> 2] = $57; + HEAP32[$vararg_buffer35 + 8 >> 2] = $17 + ($$0151 * 320 | 0) + 32; + HEAP32[$vararg_buffer35 + 12 >> 2] = $59; + if ((_sscanf($3, 25494, $vararg_buffer35) | 0) == 4) $$1$ph = 1; else { + HEAP32[$vararg_buffer41 >> 2] = $vararg_buffer5; + HEAP32[$vararg_buffer41 + 4 >> 2] = $7; + if ((_sscanf($3, 25510, $vararg_buffer41) | 0) != 2) { + label = 23; + break; + } + $$1$ph = 0; + } + $$1 = $$1$ph; + do { + _get_buff($3, $8); + HEAP32[$vararg_buffer49 >> 2] = $17 + ($$0151 * 320 | 0) + 16 + ($$1 << 5); + HEAP32[$vararg_buffer49 + 4 >> 2] = $17 + ($$0151 * 320 | 0) + 16 + ($$1 << 5) + 8; + HEAP32[$vararg_buffer49 + 8 >> 2] = $17 + ($$0151 * 320 | 0) + 16 + ($$1 << 5) + 16; + HEAP32[$vararg_buffer49 + 12 >> 2] = $17 + ($$0151 * 320 | 0) + 16 + ($$1 << 5) + 24; + if ((_sscanf($3, 25494, $vararg_buffer49) | 0) != 4) { + label = 25; + break L10; + } + $$1 = $$1 + 1 | 0; + } while ($$1 >>> 0 < 3); + _arUtilMatInv($56, $17 + ($$0151 * 320 | 0) + 112 | 0) | 0; + $75 = +HEAPF64[$52 >> 3]; + $76 = $75 * -.5; + HEAPF64[$2 >> 3] = $76; + $77 = $75 * .5; + HEAPF64[$20 >> 3] = $77; + HEAPF64[$21 >> 3] = $77; + HEAPF64[$22 >> 3] = $77; + HEAPF64[$23 >> 3] = $77; + HEAPF64[$24 >> 3] = $76; + HEAPF64[$25 >> 3] = $76; + HEAPF64[$26 >> 3] = $76; + $78 = $17 + ($$0151 * 320 | 0) + 48 | 0; + $79 = $17 + ($$0151 * 320 | 0) + 56 | 0; + $80 = $17 + ($$0151 * 320 | 0) + 72 | 0; + $81 = $17 + ($$0151 * 320 | 0) + 80 | 0; + $82 = $17 + ($$0151 * 320 | 0) + 88 | 0; + $83 = $17 + ($$0151 * 320 | 0) + 104 | 0; + $$2 = 0; + while (1) { + if (($$2 | 0) == 4) break; + $86 = +HEAPF64[$2 + ($$2 << 4) >> 3]; + $90 = +HEAPF64[$2 + ($$2 << 4) + 8 >> 3]; + HEAPF64[$17 + ($$0151 * 320 | 0) + 208 + ($$2 * 24 | 0) >> 3] = +HEAPF64[$59 >> 3] + (+HEAPF64[$56 >> 3] * $86 + +HEAPF64[$57 >> 3] * $90); + HEAPF64[$17 + ($$0151 * 320 | 0) + 208 + ($$2 * 24 | 0) + 8 >> 3] = +HEAPF64[$80 >> 3] + ($86 * +HEAPF64[$78 >> 3] + $90 * +HEAPF64[$79 >> 3]); + HEAPF64[$17 + ($$0151 * 320 | 0) + 208 + ($$2 * 24 | 0) + 16 >> 3] = +HEAPF64[$83 >> 3] + ($86 * +HEAPF64[$81 >> 3] + $90 * +HEAPF64[$82 >> 3]); + $$2 = $$2 + 1 | 0; + } + $$0151 = $$0151 + 1 | 0; + $$0152 = $51; + $28 = HEAP32[$6 >> 2] | 0; + } + if ((label | 0) == 11) { + HEAP32[$vararg_buffer17 >> 2] = $0; + HEAP32[$vararg_buffer17 + 4 >> 2] = $3; + _arLog(0, 3, 25096, $vararg_buffer17); + } else if ((label | 0) == 13) { + HEAP32[$vararg_buffer21 >> 2] = $0; + _arLog(0, 3, 25224, $vararg_buffer21); + } else if ((label | 0) == 15) { + HEAP32[$vararg_buffer24 >> 2] = $0; + HEAP32[$vararg_buffer24 + 4 >> 2] = $4; + _arLog(0, 3, 25308, $vararg_buffer24); + } else if ((label | 0) == 18) { + HEAP32[$vararg_buffer31 >> 2] = $0; + HEAP32[$vararg_buffer31 + 4 >> 2] = $$0151 + 1; + _arLog(0, 3, 25389, $vararg_buffer31); + } else if ((label | 0) == 23) { + HEAP32[$vararg_buffer45 >> 2] = $0; + HEAP32[$vararg_buffer45 + 4 >> 2] = $$0151 + 1; + _arLog(0, 3, 25516, $vararg_buffer45); + } else if ((label | 0) == 25) { + HEAP32[$vararg_buffer55 >> 2] = $0; + HEAP32[$vararg_buffer55 + 4 >> 2] = $$0151 + 1; + _arLog(0, 3, 25516, $vararg_buffer55); + } else if ((label | 0) == 31) { + _fclose($8) | 0; + $114 = _malloc(136) | 0; + if (!$114) { + _arLog(0, 3, 45930, $vararg_buffer59); + _exit(1); + } + HEAP32[$114 >> 2] = $17; + HEAP32[$114 + 4 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$114 + 128 >> 2] = 0; + HEAP32[$114 + 104 >> 2] = 0; + do if (($$0152 & 3 | 0) != 3) { + $125 = $114 + 108 | 0; + if (!($$0152 & 1)) { + HEAP32[$125 >> 2] = 1; + break; + } else { + HEAP32[$125 >> 2] = 0; + break; + } + } else HEAP32[$114 + 108 >> 2] = 2; while (0); + HEAPF64[$114 + 112 >> 3] = .5; + HEAPF64[$114 + 120 >> 3] = .5; + $$0154 = $114; + break; + } + _fclose($8) | 0; + _free($17); + $$0154 = 0; + } while (0); + STACKTOP = sp; + return $$0154 | 0; +} + +function _jinit_1pass_quantizer($0) { + $0 = $0 | 0; + var $$0$lcssa$lcssa$i$i = 0, $$0107$i = 0, $$014$i = 0, $$058$lcssa$us$i$ph$us$i = 0, $$058$lcssa$us$i$ph87$i = 0, $$05866$us$us$i$us$i = 0, $$05866$us$us$i$us$i$be = 0, $$05866$us71$i$i = 0, $$05866$us71$i$i$be = 0, $$05981$i$i = 0, $$06086$us$i$i = 0, $$063$lcssa$i$i = 0, $$063$us$i$i = 0, $$08195$us$i = 0, $$08290$us$us$i = 0, $$083106$i = 0, $$08489$us$us$i = 0, $$087$us$i$i = 0, $$16180$i$i = 0, $$2$lcssa$lcssa$i$i = 0, $$2$lcssa$us$i$ph$us$i = 0, $$2$lcssa$us$i$ph86$i = 0, $$26264$us$us$i$us$i = 0, $$26264$us$us$i$us$i$be = 0, $$26264$us73$i$i = 0, $$26264$us73$i$i$be = 0, $$265$us$us$i$us$i = 0, $$265$us$us$i$us$i$be = 0, $$265$us72$i$i = 0, $$265$us72$i$i$be = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $103 = 0, $104 = 0, $110 = 0, $119 = 0, $125 = 0, $129 = 0, $13 = 0, $135 = 0, $140 = 0, $18 = 0, $19 = 0, $21 = 0, $26 = 0, $27 = 0, $28 = 0, $30 = 0, $34 = 0, $38 = 0, $4 = 0, $5 = 0, $51 = 0, $52 = 0, $54 = 0, $55 = 0, $57 = 0, $60 = 0, $61 = 0, $63 = 0, $64 = 0, $66 = 0, $71 = 0, $93 = 0, $94 = 0, $97 = 0, $smax$i$i = 0, label = 0, $$083106$i$looptemp = 0; + $1 = $0 + 4 | 0; + $4 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 88) | 0; + $5 = $0 + 484 | 0; + HEAP32[$5 >> 2] = $4; + HEAP32[$4 >> 2] = 133; + HEAP32[$4 + 8 >> 2] = 186; + HEAP32[$4 + 12 >> 2] = 187; + HEAP32[$4 + 68 >> 2] = 0; + HEAP32[$4 + 52 >> 2] = 0; + $10 = $0 + 120 | 0; + if ((HEAP32[$10 >> 2] | 0) > 4) { + $13 = HEAP32[$0 >> 2] | 0; + HEAP32[$13 + 20 >> 2] = 57; + HEAP32[$13 + 24 >> 2] = 4; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $18 = $0 + 96 | 0; + $19 = HEAP32[$18 >> 2] | 0; + if (($19 | 0) > 256) { + $21 = HEAP32[$0 >> 2] | 0; + HEAP32[$21 + 20 >> 2] = 59; + HEAP32[$21 + 24 >> 2] = 256; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + $34 = HEAP32[$18 >> 2] | 0; + } else $34 = $19; + $26 = HEAP32[$5 >> 2] | 0; + $27 = $26 + 32 | 0; + $28 = HEAP32[$10 >> 2] | 0; + if (($28 | 0) > 1) { + $$063$us$i$i = 1; + while (1) { + $30 = $$063$us$i$i + 1 | 0; + $$06086$us$i$i = 1; + $$087$us$i$i = $30; + do { + $$087$us$i$i = Math_imul($$087$us$i$i, $30) | 0; + $$06086$us$i$i = $$06086$us$i$i + 1 | 0; + } while (($$06086$us$i$i | 0) != ($28 | 0)); + if (($$087$us$i$i | 0) > ($34 | 0)) { + $$0$lcssa$lcssa$i$i = $$087$us$i$i; + $$063$lcssa$i$i = $$063$us$i$i; + break; + } else $$063$us$i$i = $30; + } + } else { + $smax$i$i = ($34 | 0) > 1 ? $34 : 1; + $$0$lcssa$lcssa$i$i = $smax$i$i + 1 | 0; + $$063$lcssa$i$i = $smax$i$i; + } + if ($$063$lcssa$i$i >>> 0 < 2) { + $38 = HEAP32[$0 >> 2] | 0; + HEAP32[$38 + 20 >> 2] = 58; + HEAP32[$38 + 24 >> 2] = $$0$lcssa$lcssa$i$i; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + L19 : do if (($28 | 0) > 0) { + $$05981$i$i = 1; + $$16180$i$i = 0; + do { + HEAP32[$26 + 32 + ($$16180$i$i << 2) >> 2] = $$063$lcssa$i$i; + $$05981$i$i = Math_imul($$05981$i$i, $$063$lcssa$i$i) | 0; + $$16180$i$i = $$16180$i$i + 1 | 0; + } while (($$16180$i$i | 0) != ($28 | 0)); + if ((HEAP32[$0 + 44 >> 2] | 0) == 2) { + $$05866$us$us$i$us$i = 0; + $$26264$us$us$i$us$i = 0; + $$265$us$us$i$us$i = $$05981$i$i; + while (1) { + $51 = $26 + 32 + (HEAP32[17004 + ($$26264$us$us$i$us$i << 2) >> 2] << 2) | 0; + $52 = HEAP32[$51 >> 2] | 0; + $54 = $52 + 1 | 0; + $55 = Math_imul(($$265$us$us$i$us$i | 0) / ($52 | 0) | 0, $54) | 0; + if (($55 | 0) <= ($34 | 0)) { + HEAP32[$51 >> 2] = $54; + $57 = $$26264$us$us$i$us$i + 1 | 0; + if (($57 | 0) < ($28 | 0)) { + $$05866$us$us$i$us$i$be = 1; + $$26264$us$us$i$us$i$be = $57; + $$265$us$us$i$us$i$be = $55; + } else { + $$058$lcssa$us$i$ph$us$i = 1; + $$2$lcssa$us$i$ph$us$i = $55; + label = 22; + } + } else { + $$058$lcssa$us$i$ph$us$i = $$05866$us$us$i$us$i; + $$2$lcssa$us$i$ph$us$i = $$265$us$us$i$us$i; + label = 22; + } + if ((label | 0) == 22) { + label = 0; + if (!$$058$lcssa$us$i$ph$us$i) { + $$2$lcssa$lcssa$i$i = $$2$lcssa$us$i$ph$us$i; + break L19; + } else { + $$05866$us$us$i$us$i$be = 0; + $$26264$us$us$i$us$i$be = 0; + $$265$us$us$i$us$i$be = $$2$lcssa$us$i$ph$us$i; + } + } + $$05866$us$us$i$us$i = $$05866$us$us$i$us$i$be; + $$26264$us$us$i$us$i = $$26264$us$us$i$us$i$be; + $$265$us$us$i$us$i = $$265$us$us$i$us$i$be; + } + } else { + $$05866$us71$i$i = 0; + $$26264$us73$i$i = 0; + $$265$us72$i$i = $$05981$i$i; + while (1) { + $60 = $26 + 32 + ($$26264$us73$i$i << 2) | 0; + $61 = HEAP32[$60 >> 2] | 0; + $63 = $61 + 1 | 0; + $64 = Math_imul(($$265$us72$i$i | 0) / ($61 | 0) | 0, $63) | 0; + if (($64 | 0) <= ($34 | 0)) { + HEAP32[$60 >> 2] = $63; + $66 = $$26264$us73$i$i + 1 | 0; + if (($66 | 0) < ($28 | 0)) { + $$05866$us71$i$i$be = 1; + $$26264$us73$i$i$be = $66; + $$265$us72$i$i$be = $64; + } else { + $$058$lcssa$us$i$ph87$i = 1; + $$2$lcssa$us$i$ph86$i = $64; + label = 26; + } + } else { + $$058$lcssa$us$i$ph87$i = $$05866$us71$i$i; + $$2$lcssa$us$i$ph86$i = $$265$us72$i$i; + label = 26; + } + if ((label | 0) == 26) { + label = 0; + if (!$$058$lcssa$us$i$ph87$i) { + $$2$lcssa$lcssa$i$i = $$2$lcssa$us$i$ph86$i; + break L19; + } else { + $$05866$us71$i$i$be = 0; + $$26264$us73$i$i$be = 0; + $$265$us72$i$i$be = $$2$lcssa$us$i$ph86$i; + } + } + $$05866$us71$i$i = $$05866$us71$i$i$be; + $$26264$us73$i$i = $$26264$us73$i$i$be; + $$265$us72$i$i = $$265$us72$i$i$be; + } + } + } else $$2$lcssa$lcssa$i$i = 1; while (0); + $71 = HEAP32[$0 >> 2] | 0; + if ((HEAP32[$10 >> 2] | 0) == 3) { + HEAP32[$71 + 24 >> 2] = $$2$lcssa$lcssa$i$i; + HEAP32[$71 + 28 >> 2] = HEAP32[$27 >> 2]; + HEAP32[$71 + 32 >> 2] = HEAP32[$26 + 36 >> 2]; + HEAP32[$71 + 36 >> 2] = HEAP32[$26 + 40 >> 2]; + HEAP32[$71 + 20 >> 2] = 96; + FUNCTION_TABLE_vii[HEAP32[$71 + 4 >> 2] & 255]($0, 1); + } else { + HEAP32[$71 + 20 >> 2] = 97; + HEAP32[$71 + 24 >> 2] = $$2$lcssa$lcssa$i$i; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 1); + } + $93 = FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$1 >> 2] | 0) + 8 >> 2] & 15]($0, 1, $$2$lcssa$lcssa$i$i, HEAP32[$10 >> 2] | 0) | 0; + $94 = HEAP32[$10 >> 2] | 0; + if (($94 | 0) > 0) { + $$0107$i = 0; + $$083106$i = $$2$lcssa$lcssa$i$i; + $140 = $94; + while (1) { + $97 = HEAP32[$26 + 32 + ($$0107$i << 2) >> 2] | 0; + $$083106$i$looptemp = $$083106$i; + $$083106$i = ($$083106$i | 0) / ($97 | 0) | 0; + if (($97 | 0) > 0 ? ($100 = $97 + -1 | 0, $101 = ($100 | 0) / 2 | 0, $103 = $93 + ($$0107$i << 2) | 0, ($$083106$i | 0) > 0) : 0) { + $$08195$us$i = 0; + do { + $104 = Math_imul($$08195$us$i, $$083106$i) | 0; + if (($104 | 0) < ($$2$lcssa$lcssa$i$i | 0)) { + $110 = ((($$08195$us$i * 255 | 0) + $101 | 0) / ($100 | 0) | 0) & 255; + $$08290$us$us$i = $104; + do { + $$08489$us$us$i = 0; + do { + HEAP8[(HEAP32[$103 >> 2] | 0) + ($$08489$us$us$i + $$08290$us$us$i) >> 0] = $110; + $$08489$us$us$i = $$08489$us$us$i + 1 | 0; + } while (($$08489$us$us$i | 0) != ($$083106$i | 0)); + $$08290$us$us$i = $$08290$us$us$i + $$083106$i$looptemp | 0; + } while (($$08290$us$us$i | 0) < ($$2$lcssa$lcssa$i$i | 0)); + } + $$08195$us$i = $$08195$us$i + 1 | 0; + } while (($$08195$us$i | 0) != ($97 | 0)); + $119 = HEAP32[$10 >> 2] | 0; + } else $119 = $140; + $$0107$i = $$0107$i + 1 | 0; + if (($$0107$i | 0) >= ($119 | 0)) break; else $140 = $119; + } + } + HEAP32[$26 + 16 >> 2] = $93; + HEAP32[$26 + 20 >> 2] = $$2$lcssa$lcssa$i$i; + _create_colorindex($0); + if ((HEAP32[$0 + 88 >> 2] | 0) != 2) return; + $125 = HEAP32[$5 >> 2] | 0; + $129 = (HEAP32[$0 + 112 >> 2] << 1) + 4 | 0; + if ((HEAP32[$10 >> 2] | 0) <= 0) return; + $$014$i = 0; + do { + $135 = FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$1 >> 2] | 0) + 4 >> 2] & 63]($0, 1, $129) | 0; + HEAP32[$125 + 68 + ($$014$i << 2) >> 2] = $135; + $$014$i = $$014$i + 1 | 0; + } while (($$014$i | 0) < (HEAP32[$10 >> 2] | 0)); + return; +} + +function __ZN6vision26PreemptiveRobustHomographyIfEEbPT_PKS1_S4_iS4_iRNSt3__26vectorIS1_NS5_9allocatorIS1_EEEERNS6_IiNS7_IiEEEERNS6_INS5_4pairIS1_iEENS7_ISF_EEEES1_iii($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = +$9; + $10 = $10 | 0; + $11 = $11 | 0; + $12 = $12 | 0; + var $$0 = 0, $$0156 = 0, $$0157 = 0, $$0158 = 0, $$0159 = 0, $$0160 = 0, $$0161 = 0, $$0162 = 0.0, $$0163 = 0, $$0165 = 0, $$0166 = 0, $$1 = 0.0, $$1164 = 0, $$1167 = 0, $106 = 0, $110 = 0, $113 = 0, $116 = 0, $119 = 0, $13 = 0, $131 = 0.0, $133 = 0, $14 = 0, $141 = 0, $147 = 0, $148 = 0, $154 = 0, $159 = 0, $162 = 0.0, $163 = 0, $164 = 0, $173 = 0.0, $178 = 0, $27 = 0, $32 = 0, $36 = 0, $39 = 0, $43 = 0, $49 = 0, $54 = 0, $58 = 0, $70 = 0, $75 = 0, $79 = 0, $81 = 0.0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $90 = 0, $93 = 0, $96 = 0, $99 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $13 = sp + 8 | 0; + $14 = sp; + if ((HEAP32[$6 + 4 >> 2] | 0) - (HEAP32[$6 >> 2] | 0) >> 2 >>> 0 < ($10 * 9 | 0) >>> 0) { + $27 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 35532) | 0, 35590) | 0, 39072) | 0, 119) | 0, 39079) | 0, 35684) | 0; + __ZNKSt3__28ios_base6getlocEv($13, $27 + (HEAP32[(HEAP32[$27 >> 2] | 0) + -12 >> 2] | 0) | 0); + $32 = __ZNKSt3__26locale9use_facetERNS0_2idE($13, 66512) | 0; + $36 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$32 >> 2] | 0) + 28 >> 2] & 127]($32, 10) | 0; + __ZNSt3__26localeD2Ev($13); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($27, $36) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($27) | 0; + _abort(); + } + $39 = HEAP32[$7 >> 2] | 0; + $43 = $39; + if ((HEAP32[$7 + 4 >> 2] | 0) - $39 >> 2 >>> 0 < $3 >>> 0) { + $49 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 35734) | 0, 35590) | 0, 39072) | 0, 120) | 0, 39079) | 0, 35784) | 0; + __ZNKSt3__28ios_base6getlocEv($13, $49 + (HEAP32[(HEAP32[$49 >> 2] | 0) + -12 >> 2] | 0) | 0); + $54 = __ZNKSt3__26locale9use_facetERNS0_2idE($13, 66512) | 0; + $58 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$54 >> 2] | 0) + 28 >> 2] & 127]($54, 10) | 0; + __ZNSt3__26localeD2Ev($13); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($49, $58) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($49) | 0; + _abort(); + } + if ((HEAP32[$8 + 4 >> 2] | 0) - (HEAP32[$8 >> 2] | 0) >> 3 >>> 0 < $10 >>> 0) { + $70 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 35826) | 0, 35590) | 0, 39072) | 0, 121) | 0, 39079) | 0, 35888) | 0; + __ZNKSt3__28ios_base6getlocEv($13, $70 + (HEAP32[(HEAP32[$70 >> 2] | 0) + -12 >> 2] | 0) | 0); + $75 = __ZNKSt3__26locale9use_facetERNS0_2idE($13, 66512) | 0; + $79 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$75 >> 2] | 0) + 28 >> 2] & 127]($75, 10) | 0; + __ZNSt3__26localeD2Ev($13); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($70, $79) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($70) | 0; + _abort(); + } + if (($3 | 0) >= 4) { + HEAP32[$14 >> 2] = 1234; + $81 = +__ZN6vision3sqrIfEET_S1_($9); + $82 = __ZN6vision4min2IiEET_S1_S1_($12, $3) | 0; + __ZN6vision16SequentialVectorIiEEvPT_iS1_($43, $3, 0); + __ZN6vision12ArrayShuffleIiEEvPT_iiRi($43, $3, $3, $14); + $83 = $43 + 4 | 0; + $84 = $43 + 8 | 0; + $85 = $43 + 12 | 0; + $86 = ($5 | 0) > 0; + $$0161 = 0; + $$0166 = 0; + while (1) { + if (!(($$0166 | 0) < ($10 | 0) & ($$0161 | 0) < ($11 | 0))) break; + __ZN6vision12ArrayShuffleIiEEvPT_iiRi($43, $3, 4, $14); + $90 = HEAP32[$43 >> 2] << 1; + $93 = HEAP32[$83 >> 2] << 1; + $96 = HEAP32[$84 >> 2] << 1; + $99 = HEAP32[$85 >> 2] << 1; + do if (__ZN6vision40Homography4PointsGeometricallyConsistentIfEEbPKT_S3_S3_S3_S3_S3_S3_S3_($1 + ($90 << 2) | 0, $1 + ($93 << 2) | 0, $1 + ($96 << 2) | 0, $1 + ($99 << 2) | 0, $2 + ($90 << 2) | 0, $2 + ($93 << 2) | 0, $2 + ($96 << 2) | 0, $2 + ($99 << 2) | 0) | 0 ? ($106 = $$0166 * 9 | 0, $110 = HEAP32[$43 >> 2] << 1, $113 = HEAP32[$83 >> 2] << 1, $116 = HEAP32[$84 >> 2] << 1, $119 = HEAP32[$85 >> 2] << 1, __ZN6vision22SolveHomography4PointsIfEEbPT_PKS1_S4_S4_S4_S4_S4_S4_S4_((HEAP32[$6 >> 2] | 0) + ($106 << 2) | 0, $1 + ($110 << 2) | 0, $1 + ($113 << 2) | 0, $1 + ($116 << 2) | 0, $1 + ($119 << 2) | 0, $2 + ($110 << 2) | 0, $2 + ($113 << 2) | 0, $2 + ($116 << 2) | 0, $2 + ($119 << 2) | 0) | 0) : 0) { + if ($86 ? !(__ZN6vision39HomographyPointsGeometricallyConsistentIfEEbPKT_S3_i((HEAP32[$6 >> 2] | 0) + ($106 << 2) | 0, $4, $5) | 0) : 0) { + $$1167 = $$0166; + break; + } + $$1167 = $$0166 + 1 | 0; + } else $$1167 = $$0166; while (0); + $$0161 = $$0161 + 1 | 0; + $$0166 = $$1167; + } + $131 = 1.0 / $81; + if ($$0166) { + $133 = HEAP32[$8 >> 2] | 0; + $$0160 = 0; + while (1) { + if (($$0160 | 0) >= ($$0166 | 0)) break; + HEAPF32[$133 + ($$0160 << 3) >> 2] = 0.0; + HEAP32[$133 + ($$0160 << 3) + 4 >> 2] = $$0160; + $$0160 = $$0160 + 1 | 0; + } + $$0159 = 0; + $$0165 = $$0166; + while (1) { + if (!(($$0165 | 0) > 2 & ($$0159 | 0) < ($3 | 0))) break; + $147 = (__ZN6vision4min2IiEET_S1_S1_($82, $3 - $$0159 | 0) | 0) + $$0159 | 0; + $$0158 = 0; + $148 = HEAP32[$8 >> 2] | 0; + while (1) { + if (($$0158 | 0) == ($$0165 | 0)) break; + $154 = (HEAP32[$6 >> 2] | 0) + ((HEAP32[$148 + ($$0158 << 3) + 4 >> 2] | 0) * 9 << 2) | 0; + $$0156 = $$0159; + $178 = $148; + while (1) { + if (($$0156 | 0) >= ($147 | 0)) break; + $159 = HEAP32[$43 + ($$0156 << 2) >> 2] << 1; + $162 = +__ZN6vision32CauchyProjectiveReprojectionCostIfEET_PKS1_S3_S3_S1_($154, $1 + ($159 << 2) | 0, $2 + ($159 << 2) | 0, $131); + $163 = HEAP32[$8 >> 2] | 0; + $164 = $163 + ($$0158 << 3) | 0; + HEAPF32[$164 >> 2] = $162 + +HEAPF32[$164 >> 2]; + $$0156 = $$0156 + 1 | 0; + $178 = $163; + } + $$0158 = $$0158 + 1 | 0; + $148 = $178; + } + __ZN6vision10FastMedianIfiEENSt3__24pairIT_T0_EEPS5_i($13, $148, $$0165); + $$0159 = $147; + $$0165 = $$0165 >> 1; + } + $141 = HEAP32[$8 >> 2] | 0; + $$0 = 1; + $$0162 = +HEAPF32[$141 >> 2]; + $$0163 = HEAP32[$141 + 4 >> 2] | 0; + while (1) { + if (($$0 | 0) >= ($$0165 | 0)) break; + $173 = +HEAPF32[$141 + ($$0 << 3) >> 2]; + if ($173 < $$0162) { + $$1 = $173; + $$1164 = HEAP32[$141 + ($$0 << 3) + 4 >> 2] | 0; + } else { + $$1 = $$0162; + $$1164 = $$0163; + } + $$0 = $$0 + 1 | 0; + $$0162 = $$1; + $$0163 = $$1164; + } + __ZN6vision11CopyVector9IfEEvPT_PKS1_($0, (HEAP32[$6 >> 2] | 0) + ($$0163 * 9 << 2) | 0); + __ZN6vision19NormalizeHomographyIfEEvPT_($0); + $$0157 = 1; + } else $$0157 = 0; + } else $$0157 = 0; + STACKTOP = sp; + return $$0157 | 0; +} + +function _jpeg_idct_16x8($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0360370 = 0, $$0362369 = 0, $$0364368 = 0, $$0371 = 0, $$1367 = 0, $$2366 = 0, $$sink = 0, $$sink373 = 0, $100 = 0, $101 = 0, $103 = 0, $106 = 0, $107 = 0, $109 = 0, $11 = 0, $113 = 0, $115 = 0, $117 = 0, $121 = 0, $123 = 0, $13 = 0, $149 = 0, $152 = 0, $155 = 0, $157 = 0, $158 = 0, $159 = 0, $160 = 0, $161 = 0, $162 = 0, $163 = 0, $165 = 0, $167 = 0, $168 = 0, $169 = 0, $170 = 0, $172 = 0, $174 = 0, $176 = 0, $178 = 0, $179 = 0, $180 = 0, $181 = 0, $182 = 0, $183 = 0, $184 = 0, $185 = 0, $186 = 0, $188 = 0, $190 = 0, $192 = 0, $194 = 0, $195 = 0, $197 = 0, $198 = 0, $200 = 0, $202 = 0, $203 = 0, $205 = 0, $209 = 0, $213 = 0, $215 = 0, $221 = 0, $226 = 0, $227 = 0, $230 = 0, $234 = 0, $240 = 0, $242 = 0, $243 = 0, $244 = 0, $246 = 0, $247 = 0, $248 = 0, $35 = 0, $5 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $58 = 0, $61 = 0, $67 = 0, $69 = 0, $7 = 0, $71 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $83 = 0, $89 = 0, $95 = 0, $99 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 256 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(256); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0360370 = $5; + $$0362369 = HEAP32[$1 + 84 >> 2] | 0; + $$0364368 = $2; + $$0371 = 8; + while (1) { + $11 = HEAP16[$$0364368 + 16 >> 1] | 0; + $13 = HEAP16[$$0364368 + 32 >> 1] | 0; + if (!(($11 | $13) << 16 >> 16)) if (((((HEAP16[$$0364368 + 48 >> 1] | 0) == 0 ? (HEAP16[$$0364368 + 64 >> 1] | 0) == 0 : 0) ? (HEAP16[$$0364368 + 80 >> 1] | 0) == 0 : 0) ? (HEAP16[$$0364368 + 96 >> 1] | 0) == 0 : 0) ? (HEAP16[$$0364368 + 112 >> 1] | 0) == 0 : 0) { + $35 = Math_imul(HEAP16[$$0364368 >> 1] << 2, HEAP32[$$0362369 >> 2] | 0) | 0; + HEAP32[$$0360370 >> 2] = $35; + HEAP32[$$0360370 + 32 >> 2] = $35; + HEAP32[$$0360370 + 64 >> 2] = $35; + HEAP32[$$0360370 + 96 >> 2] = $35; + HEAP32[$$0360370 + 128 >> 2] = $35; + HEAP32[$$0360370 + 160 >> 2] = $35; + HEAP32[$$0360370 + 192 >> 2] = $35; + $$sink = $35; + $$sink373 = 56; + } else { + $58 = 0; + label = 9; + } else { + $58 = $13; + label = 9; + } + if ((label | 0) == 9) { + label = 0; + $53 = Math_imul(HEAP16[$$0364368 + 64 >> 1] << 13, HEAP32[$$0362369 + 128 >> 2] | 0) | 0; + $54 = Math_imul(HEAP16[$$0364368 >> 1] << 13, HEAP32[$$0362369 >> 2] | 0) | 0 | 1024; + $55 = $53 + $54 | 0; + $56 = $54 - $53 | 0; + $61 = Math_imul(HEAP32[$$0362369 + 64 >> 2] | 0, $58 << 16 >> 16) | 0; + $67 = Math_imul(HEAP32[$$0362369 + 192 >> 2] | 0, HEAP16[$$0364368 + 96 >> 1] | 0) | 0; + $69 = ($67 + $61 | 0) * 4433 | 0; + $71 = $69 + ($61 * 6270 | 0) | 0; + $73 = $69 + (Math_imul($67, -15137) | 0) | 0; + $74 = $71 + $55 | 0; + $75 = $55 - $71 | 0; + $76 = $73 + $56 | 0; + $77 = $56 - $73 | 0; + $83 = Math_imul(HEAP32[$$0362369 + 224 >> 2] | 0, HEAP16[$$0364368 + 112 >> 1] | 0) | 0; + $89 = Math_imul(HEAP32[$$0362369 + 160 >> 2] | 0, HEAP16[$$0364368 + 80 >> 1] | 0) | 0; + $95 = Math_imul(HEAP32[$$0362369 + 96 >> 2] | 0, HEAP16[$$0364368 + 48 >> 1] | 0) | 0; + $99 = Math_imul(HEAP32[$$0362369 + 32 >> 2] | 0, $11 << 16 >> 16) | 0; + $100 = $95 + $83 | 0; + $101 = $99 + $89 | 0; + $103 = ($101 + $100 | 0) * 9633 | 0; + $106 = $103 + (Math_imul($100, -16069) | 0) | 0; + $107 = $103 + (Math_imul($101, -3196) | 0) | 0; + $109 = Math_imul($99 + $83 | 0, -7373) | 0; + $113 = $109 + ($83 * 2446 | 0) + $106 | 0; + $115 = $109 + ($99 * 12299 | 0) + $107 | 0; + $117 = Math_imul($95 + $89 | 0, -20995) | 0; + $121 = $117 + ($89 * 16819 | 0) + $107 | 0; + $123 = $117 + ($95 * 25172 | 0) + $106 | 0; + HEAP32[$$0360370 >> 2] = $115 + $74 >> 11; + HEAP32[$$0360370 + 224 >> 2] = $74 - $115 >> 11; + HEAP32[$$0360370 + 32 >> 2] = $123 + $76 >> 11; + HEAP32[$$0360370 + 192 >> 2] = $76 - $123 >> 11; + HEAP32[$$0360370 + 64 >> 2] = $121 + $77 >> 11; + HEAP32[$$0360370 + 160 >> 2] = $77 - $121 >> 11; + HEAP32[$$0360370 + 96 >> 2] = $113 + $75 >> 11; + $$sink = $75 - $113 >> 11; + $$sink373 = 32; + } + HEAP32[$$0360370 + ($$sink373 << 2) >> 2] = $$sink; + if ($$0371 >>> 0 > 1) { + $$0360370 = $$0360370 + 4 | 0; + $$0362369 = $$0362369 + 4 | 0; + $$0364368 = $$0364368 + 2 | 0; + $$0371 = $$0371 + -1 | 0; + } else break; + } + $149 = $7 + -384 | 0; + $$1367 = 0; + $$2366 = $5; + while (1) { + $152 = (HEAP32[$3 + ($$1367 << 2) >> 2] | 0) + $4 | 0; + $155 = (HEAP32[$$2366 >> 2] << 13) + 134348800 | 0; + $157 = HEAP32[$$2366 + 16 >> 2] | 0; + $158 = $157 * 10703 | 0; + $159 = $157 * 4433 | 0; + $160 = $155 + $158 | 0; + $161 = $155 - $158 | 0; + $162 = $155 + $159 | 0; + $163 = $155 - $159 | 0; + $165 = HEAP32[$$2366 + 8 >> 2] | 0; + $167 = HEAP32[$$2366 + 24 >> 2] | 0; + $168 = $165 - $167 | 0; + $169 = $168 * 2260 | 0; + $170 = $168 * 11363 | 0; + $172 = $170 + ($167 * 20995 | 0) | 0; + $174 = $169 + ($165 * 7373 | 0) | 0; + $176 = $170 + (Math_imul($165, -4926) | 0) | 0; + $178 = $169 + (Math_imul($167, -4176) | 0) | 0; + $179 = $172 + $160 | 0; + $180 = $160 - $172 | 0; + $181 = $174 + $162 | 0; + $182 = $162 - $174 | 0; + $183 = $176 + $163 | 0; + $184 = $163 - $176 | 0; + $185 = $178 + $161 | 0; + $186 = $161 - $178 | 0; + $188 = HEAP32[$$2366 + 4 >> 2] | 0; + $190 = HEAP32[$$2366 + 12 >> 2] | 0; + $192 = HEAP32[$$2366 + 20 >> 2] | 0; + $194 = HEAP32[$$2366 + 28 >> 2] | 0; + $195 = $192 + $188 | 0; + $197 = ($190 + $188 | 0) * 11086 | 0; + $198 = $195 * 10217 | 0; + $200 = ($194 + $188 | 0) * 8956 | 0; + $202 = ($188 - $194 | 0) * 7350 | 0; + $203 = $195 * 5461 | 0; + $205 = ($188 - $190 | 0) * 3363 | 0; + $209 = $197 + (Math_imul($188, -18730) | 0) + $198 + $200 | 0; + $213 = $205 + (Math_imul($188, -15038) | 0) + $203 + $202 | 0; + $215 = ($192 + $190 | 0) * 1136 | 0; + $221 = ($192 - $190 | 0) * 11529 | 0; + $226 = $194 + $190 | 0; + $227 = Math_imul($226, -5461) | 0; + $230 = $197 + ($190 * 589 | 0) + $215 + $227 | 0; + $234 = Math_imul($226, -10217) | 0; + $240 = $205 + ($190 * 16154 | 0) + $221 + $234 | 0; + $242 = Math_imul($194 + $192 | 0, -11086) | 0; + $243 = $215 + (Math_imul($192, -9222) | 0) + $198 + $242 | 0; + $244 = $227 + ($194 * 8728 | 0) + $200 + $242 | 0; + $246 = ($194 - $192 | 0) * 3363 | 0; + $247 = $234 + ($194 * 25733 | 0) + $202 + $246 | 0; + $248 = $221 + (Math_imul($192, -6278) | 0) + $203 + $246 | 0; + HEAP8[$152 >> 0] = HEAP8[$149 + (($209 + $179 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 15 >> 0] = HEAP8[$149 + (($179 - $209 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 1 >> 0] = HEAP8[$149 + (($230 + $181 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 14 >> 0] = HEAP8[$149 + (($181 - $230 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 2 >> 0] = HEAP8[$149 + (($243 + $183 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 13 >> 0] = HEAP8[$149 + (($183 - $243 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 3 >> 0] = HEAP8[$149 + (($244 + $185 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 12 >> 0] = HEAP8[$149 + (($185 - $244 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 4 >> 0] = HEAP8[$149 + (($247 + $186 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 11 >> 0] = HEAP8[$149 + (($186 - $247 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 5 >> 0] = HEAP8[$149 + (($248 + $184 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 10 >> 0] = HEAP8[$149 + (($184 - $248 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 6 >> 0] = HEAP8[$149 + (($240 + $182 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 9 >> 0] = HEAP8[$149 + (($182 - $240 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 7 >> 0] = HEAP8[$149 + (($213 + $180 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 8 >> 0] = HEAP8[$149 + (($180 - $213 | 0) >>> 18 & 1023) >> 0] | 0; + $$1367 = $$1367 + 1 | 0; + if (($$1367 | 0) == 8) break; else $$2366 = $$2366 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function __ZN46EmscriptenBindingInitializer_constant_bindingsC2Ev($this) { + $this = $this | 0; + var $ref$tmp = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $ref$tmp = sp; + __ZN10emscripten8functionIiJiiiEJEEEvPKcPFT_DpT0_EDpT1_(39245, 26); + __ZN10emscripten8functionIiJiEJEEEvPKcPFT_DpT0_EDpT1_(39251, 67); + __ZN10emscripten8functionIiJiEJEEEvPKcPFT_DpT0_EDpT1_(39260, 68); + __ZN10emscripten8functionIiJiNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEJEEEvPKcPFT_DpT0_EDpT1_(39269, 44); + __ZN10emscripten8functionIiJiNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEJEEEvPKcPFT_DpT0_EDpT1_(39280, 45); + __ZN10emscripten8functionIiJiNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEJEEEvPKcPFT_DpT0_EDpT1_(39296, 46); + __ZN10emscripten8functionIiJiiEJEEEvPKcPFT_DpT0_EDpT1_(39310, 47); + __ZN10emscripten8functionIiJiEJEEEvPKcPFT_DpT0_EDpT1_(39328, 69); + __ZN10emscripten8functionIiJNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEJEEEvPKcPFT_DpT0_EDpT1_(39348, 70); + __ZN10emscripten8functionIiJiiiEJEEEvPKcPFT_DpT0_EDpT1_(39360, 27); + __ZN10emscripten8functionIiJiiEJEEEvPKcPFT_DpT0_EDpT1_(39377, 48); + __ZN10emscripten8functionIiJiiiEJEEEvPKcPFT_DpT0_EDpT1_(39397, 28); + __ZN10emscripten8functionIiJiiiEJEEEvPKcPFT_DpT0_EDpT1_(39415, 29); + __ZN10emscripten8functionIiJiiEJEEEvPKcPFT_DpT0_EDpT1_(39437, 49); + __ZN10emscripten8functionIiJiiEJEEEvPKcPFT_DpT0_EDpT1_(39460, 50); + __ZN10emscripten8functionIiJiEJEEEvPKcPFT_DpT0_EDpT1_(39489, 71); + __ZN10emscripten8functionIiJiEJEEEvPKcPFT_DpT0_EDpT1_(39502, 72); + __ZN10emscripten8functionIiJiEJEEEvPKcPFT_DpT0_EDpT1_(39515, 73); + __ZN10emscripten8functionIiJiiiEJEEEvPKcPFT_DpT0_EDpT1_(39531, 30); + __ZN10emscripten8functionIiJiiEJEEEvPKcPFT_DpT0_EDpT1_(39550, 51); + __ZN10emscripten8functionIiJiiEJEEEvPKcPFT_DpT0_EDpT1_(39560, 52); + __ZN10emscripten8functionIiJiiEJEEEvPKcPFT_DpT0_EDpT1_(39573, 53); + __ZN10emscripten8functionIiJiEJEEEvPKcPFT_DpT0_EDpT1_(39586, 74); + __ZN10emscripten8functionIiJiEJEEEvPKcPFT_DpT0_EDpT1_(39599, 75); + __ZN10emscripten8functionIvJiEJEEEvPKcPFT_DpT0_EDpT1_(39618, 183); + __ZN10emscripten8functionIiJEJEEEvPKcPFT_DpT0_EDpT1_(39630, 1); + __ZN10emscripten8functionIvJidEJEEEvPKcPFT_DpT0_EDpT1_(39642, 1); + __ZN10emscripten8functionIdJiEJEEEvPKcPFT_DpT0_EDpT1_(39665, 1); + __ZN10emscripten8functionIvJidEJEEEvPKcPFT_DpT0_EDpT1_(39688, 2); + __ZN10emscripten8functionIdJiEJEEEvPKcPFT_DpT0_EDpT1_(39710, 2); + __ZN10emscripten8functionIvJiiEJEEEvPKcPFT_DpT0_EDpT1_(39732, 126); + __ZN10emscripten8functionIiJiEJEEEvPKcPFT_DpT0_EDpT1_(39749, 76); + __ZN10emscripten8functionIvJiiEJEEEvPKcPFT_DpT0_EDpT1_(39766, 127); + __ZN10emscripten8functionIiJiEJEEEvPKcPFT_DpT0_EDpT1_(39779, 77); + __ZN10emscripten8functionIvJiiEJEEEvPKcPFT_DpT0_EDpT1_(39792, 128); + __ZN10emscripten8functionIiJiEJEEEvPKcPFT_DpT0_EDpT1_(39816, 78); + __ZN10emscripten8functionIvJifEJEEEvPKcPFT_DpT0_EDpT1_(39840, 3); + __ZN10emscripten8functionIdJiEJEEEvPKcPFT_DpT0_EDpT1_(39853, 3); + __ZN10emscripten8functionIvJiiEJEEEvPKcPFT_DpT0_EDpT1_(39866, 129); + __ZN10emscripten8functionIiJiEJEEEvPKcPFT_DpT0_EDpT1_(39884, 79); + __ZN10emscripten8functionIvJiiEJEEEvPKcPFT_DpT0_EDpT1_(39902, 130); + __ZN10emscripten8functionIiJiEJEEEvPKcPFT_DpT0_EDpT1_(39918, 80); + __ZN10emscripten8functionIvJiiEJEEEvPKcPFT_DpT0_EDpT1_(39934, 131); + __ZN10emscripten8functionIiJiEJEEEvPKcPFT_DpT0_EDpT1_(39951, 81); + __ZN10emscripten8constantIiEEvPKcRKT_(39968, 16896); + __ZN10emscripten8constantIiEEvPKcRKT_(39997, 16900); + __ZN10emscripten8constantIiEEvPKcRKT_(40025, 16904); + HEAP32[$ref$tmp >> 2] = 0; + __ZN10emscripten8constantIiEEvPKcRKT_(40058, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 1; + __ZN10emscripten8constantIiEEvPKcRKT_(40075, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 0; + __ZN10emscripten8constantIiEEvPKcRKT_(40091, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 0; + __ZN10emscripten8constantIiEEvPKcRKT_(40113, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 1; + __ZN10emscripten8constantIiEEvPKcRKT_(40138, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 1; + __ZN10emscripten8constantIiEEvPKcRKT_(40163, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 100; + __ZN10emscripten8constantIiEEvPKcRKT_(40188, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 0; + __ZN10emscripten8constantIiEEvPKcRKT_(40215, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 1; + __ZN10emscripten8constantIiEEvPKcRKT_(40241, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 0; + __ZN10emscripten8constantIiEEvPKcRKT_(40267, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 0; + __ZN10emscripten8constantIiEEvPKcRKT_(40294, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 1; + __ZN10emscripten8constantIiEEvPKcRKT_(40321, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 2; + __ZN10emscripten8constantIiEEvPKcRKT_(40347, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 3; + __ZN10emscripten8constantIiEEvPKcRKT_(40372, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 4; + __ZN10emscripten8constantIiEEvPKcRKT_(40410, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 0; + __ZN10emscripten8constantIiEEvPKcRKT_(40447, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 0; + __ZN10emscripten8constantIiEEvPKcRKT_(40481, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 1; + __ZN10emscripten8constantIiEEvPKcRKT_(40505, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 2; + __ZN10emscripten8constantIiEEvPKcRKT_(40531, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 2; + __ZN10emscripten8constantIiEEvPKcRKT_(40558, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 5; + __ZN10emscripten8constantIiEEvPKcRKT_(40592, $ref$tmp); + HEAPF64[$ref$tmp >> 3] = .5; + __ZN10emscripten8constantIdEEvPKcRKT_(40610, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 0; + __ZN10emscripten8constantIiEEvPKcRKT_(40631, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 1; + __ZN10emscripten8constantIiEEvPKcRKT_(40650, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 2; + __ZN10emscripten8constantIiEEvPKcRKT_(40668, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 3; + __ZN10emscripten8constantIiEEvPKcRKT_(40686, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 4; + __ZN10emscripten8constantIiEEvPKcRKT_(40705, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 3; + __ZN10emscripten8constantIiEEvPKcRKT_(40727, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 515; + __ZN10emscripten8constantIiEEvPKcRKT_(40746, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 259; + __ZN10emscripten8constantIiEEvPKcRKT_(40775, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 4; + __ZN10emscripten8constantIiEEvPKcRKT_(40803, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 772; + __ZN10emscripten8constantIiEEvPKcRKT_(40822, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 1028; + __ZN10emscripten8constantIiEEvPKcRKT_(40852, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 0; + __ZN10emscripten8constantIiEEvPKcRKT_(40882, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 1; + __ZN10emscripten8constantIiEEvPKcRKT_(40913, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 2; + __ZN10emscripten8constantIiEEvPKcRKT_(40949, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 3; + __ZN10emscripten8constantIiEEvPKcRKT_(40983, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 0; + __ZN10emscripten8constantIiEEvPKcRKT_(41021, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 1; + __ZN10emscripten8constantIiEEvPKcRKT_(41054, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 2; + __ZN10emscripten8constantIiEEvPKcRKT_(41101, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 3; + __ZN10emscripten8constantIiEEvPKcRKT_(41143, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 4; + __ZN10emscripten8constantIiEEvPKcRKT_(41186, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 5; + __ZN10emscripten8constantIiEEvPKcRKT_(41238, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 6; + __ZN10emscripten8constantIiEEvPKcRKT_(41289, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 7; + __ZN10emscripten8constantIiEEvPKcRKT_(41334, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 8; + __ZN10emscripten8constantIiEEvPKcRKT_(41373, $ref$tmp); + HEAP32[$ref$tmp >> 2] = 9; + __ZN10emscripten8constantIiEEvPKcRKT_(41418, $ref$tmp); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseFunctionTypeEv($0) { + $0 = $0 | 0; + var $$7 = 0, $$8 = 0, $$9 = 0, $$byval_copy5 = 0, $1 = 0, $10 = 0, $11 = 0, $13 = 0, $16 = 0, $19 = 0, $2 = 0, $21 = 0, $22 = 0, $25 = 0, $27 = 0, $29 = 0, $3 = 0, $30 = 0, $32 = 0, $33 = 0, $38 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 80 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(80); + $$byval_copy5 = sp + 64 | 0; + $1 = sp + 28 | 0; + $2 = sp + 24 | 0; + $3 = sp + 56 | 0; + $4 = sp + 48 | 0; + $5 = sp + 40 | 0; + $6 = sp + 32 | 0; + $7 = sp; + $8 = sp + 72 | 0; + $9 = sp + 16 | 0; + $10 = sp + 8 | 0; + $11 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseCVQualifiersEv($0) | 0; + HEAP32[$1 >> 2] = $11; + HEAP32[$2 >> 2] = 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 56311); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + do if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy5) | 0)) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 56323); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy5) | 0) { + $16 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy5 >> 2] = $16; + if (!$16) { + $$9 = 0; + break; + } + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) { + $19 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_12NoexceptSpecEJRPNS0_4NodeEEEES9_DpOT0_($0, $$byval_copy5) | 0; + HEAP32[$2 >> 2] = $19; + label = 14; + break; + } else { + $$9 = 0; + break; + } + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 56326); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy5) | 0) { + $21 = $0 + 8 | 0; + $22 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($21) | 0; + while (1) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) { + label = 12; + break; + } + $25 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy5 >> 2] = $25; + if (!$25) { + label = 13; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($21, $$byval_copy5); + } + if ((label | 0) == 12) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20popTrailingNodeArrayEm($$byval_copy5, $0, $22); + $27 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20DynamicExceptionSpecEJNS0_9NodeArrayEEEEPNS0_4NodeEDpOT0_($0, $$byval_copy5) | 0; + HEAP32[$2 >> 2] = $27; + label = 14; + break; + } else if ((label | 0) == 13) { + $$9 = 0; + break; + } + } else label = 14; + } else { + $13 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA9_KcEEEPNS0_4NodeEDpOT0_($0, 56314) | 0; + HEAP32[$2 >> 2] = $13; + label = 14; + } while (0); + if ((label | 0) == 14) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($6, 56329); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy5) | 0; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 70) | 0) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 89) | 0; + $29 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $30 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($29) | 0; + HEAP32[$7 >> 2] = $30; + if (!$30) $$8 = 0; else { + HEAP8[$8 >> 0] = 0; + $32 = $0 + 8 | 0; + $33 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($32) | 0; + while (1) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) { + label = 27; + break; + } + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 118) | 0)) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($9, 56332); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$9 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy5) | 0) { + label = 21; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($10, 56335); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$10 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$10 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy5) | 0) { + label = 23; + break; + } + $38 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($29) | 0; + HEAP32[$$byval_copy5 >> 2] = $38; + if (!$38) { + label = 26; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($32, $$byval_copy5); + } + } + if ((label | 0) == 21) { + HEAP8[$8 >> 0] = 1; + label = 27; + } else if ((label | 0) == 23) { + HEAP8[$8 >> 0] = 2; + label = 27; + } else if ((label | 0) == 26) $$7 = 0; + if ((label | 0) == 27) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20popTrailingNodeArrayEm($$byval_copy5, $0, $33); + $$7 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_12FunctionTypeEJRPNS0_4NodeERNS0_9NodeArrayERNS0_10QualifiersERNS0_15FunctionRefQualESA_EEES9_DpOT0_($0, $7, $$byval_copy5, $1, $8, $2) | 0; + } + $$8 = $$7; + } + $$9 = $$8; + } else $$9 = 0; + } + STACKTOP = sp; + return $$9 | 0; +} + +function __ZN6vision18binomial_4th_orderEPfPtPKhmm($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0254 = 0, $$0255 = 0, $$0256 = 0, $$0257 = 0, $$0258 = 0, $$0259 = 0, $$0260 = 0, $$0275 = 0, $$0280 = 0, $$0281 = 0, $$0283 = 0, $$0284 = 0, $$1 = 0, $$1261 = 0, $$1266 = 0, $$1276 = 0, $$1282 = 0, $$1285 = 0, $$2 = 0, $$2262 = 0, $$2267 = 0, $$2272 = 0, $$2277 = 0, $$2286 = 0, $$3263 = 0, $$3268 = 0, $$3273 = 0, $$3278 = 0, $$3287 = 0, $$4269 = 0, $$4274 = 0, $$4279 = 0, $$4288 = 0, $100 = 0, $12 = 0, $121 = 0, $143 = 0, $164 = 0, $17 = 0, $184 = 0, $185 = 0, $186 = 0, $192 = 0, $193 = 0, $194 = 0, $195 = 0, $21 = 0, $227 = 0, $228 = 0, $239 = 0, $256 = 0, $28 = 0, $33 = 0, $37 = 0, $38 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $46 = 0, $48 = 0, $49 = 0, $5 = 0, $54 = 0, $66 = 0, $79 = 0, $83 = 0, $86 = 0, $88 = 0, $scevgep = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $5 = sp; + if ($3 >>> 0 <= 4) { + $12 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 31119) | 0, 31153) | 0, 39072) | 0, 55) | 0, 39079) | 0, 31248) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $12 + (HEAP32[(HEAP32[$12 >> 2] | 0) + -12 >> 2] | 0) | 0); + $17 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $21 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$17 >> 2] | 0) + 28 >> 2] & 127]($17, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($12, $21) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($12) | 0; + _abort(); + } + if ($4 >>> 0 <= 4) { + $28 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 31267) | 0, 31153) | 0, 39072) | 0, 56) | 0, 39079) | 0, 31248) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $28 + (HEAP32[(HEAP32[$28 >> 2] | 0) + -12 >> 2] | 0) | 0); + $33 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $37 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$33 >> 2] | 0) + 28 >> 2] & 127]($33, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($28, $37) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($28) | 0; + _abort(); + } + $38 = $3 + -1 | 0; + $39 = $3 + -2 | 0; + $40 = $3 + -3 | 0; + $41 = $3 + -4 | 0; + $$0281 = $1; + $$0283 = 0; + while (1) { + if (($$0283 | 0) == ($4 | 0)) break; + $46 = $2 + (Math_imul($$0283, $3) | 0) | 0; + $48 = HEAPU8[$46 >> 0] | 0; + $49 = $46 + 1 | 0; + $54 = $46 + 2 | 0; + HEAP16[$$0281 >> 1] = ($48 * 7 | 0) + (HEAPU8[$54 >> 0] | 0) + ((HEAPU8[$49 >> 0] | 0) + $48 << 2); + $66 = HEAPU8[$46 >> 0] | 0; + HEAP16[$$0281 + 2 >> 1] = ((HEAPU8[$49 >> 0] | 0) * 6 | 0) + $66 + (HEAPU8[$46 + 3 >> 0] | 0) + ((HEAPU8[$54 >> 0] | 0) + $66 << 2); + $$0280 = 2; + $$1282 = $$0281 + 4 | 0; + while (1) { + if (($$0280 | 0) == ($39 | 0)) break; + $121 = $$0280 + 1 | 0; + HEAP16[$$1282 >> 1] = ((HEAPU8[$46 + $$0280 >> 0] | 0) * 6 | 0) + (HEAPU8[$46 + ($$0280 + -2) >> 0] | 0) + ((HEAPU8[$46 + $121 >> 0] | 0) + (HEAPU8[$46 + ($$0280 + -1) >> 0] | 0) << 2) + (HEAPU8[$46 + ($$0280 + 2) >> 0] | 0); + $$0280 = $121; + $$1282 = $$1282 + 2 | 0; + } + $scevgep = $$0281 + ($39 << 1) | 0; + $79 = $46 + $39 | 0; + $83 = $46 + $40 | 0; + $86 = $46 + $38 | 0; + $88 = HEAPU8[$86 >> 0] | 0; + HEAP16[$scevgep >> 1] = ((HEAPU8[$79 >> 0] | 0) * 6 | 0) + $88 + (HEAPU8[$46 + $41 >> 0] | 0) + ($88 + (HEAPU8[$83 >> 0] | 0) << 2); + $100 = HEAPU8[$86 >> 0] | 0; + HEAP16[$scevgep + 2 >> 1] = ($100 * 7 | 0) + (HEAPU8[$83 >> 0] | 0) + ((HEAPU8[$79 >> 0] | 0) + $100 << 2); + $$0281 = $$0281 + ($3 << 1) | 0; + $$0283 = $$0283 + 1 | 0; + } + $42 = $4 + -2 | 0; + $43 = $1 + ($3 << 1) | 0; + $44 = $43 + ($3 << 1) | 0; + $$0258 = 0; + $$0259 = $44; + $$0260 = $43; + $$0275 = $1; + $$0284 = $0; + while (1) { + if (($$0258 | 0) == ($3 | 0)) break; + $143 = HEAPU16[$$0275 >> 1] | 0; + HEAPF32[$$0284 >> 2] = +(($143 * 7 | 0) + ((HEAPU16[$$0260 >> 1] | 0) + $143 << 2) + (HEAPU16[$$0259 >> 1] | 0) | 0) * .00390625; + $$0258 = $$0258 + 1 | 0; + $$0259 = $$0259 + 2 | 0; + $$0260 = $$0260 + 2 | 0; + $$0275 = $$0275 + 2 | 0; + $$0284 = $$0284 + 4 | 0; + } + $$0257 = 0; + $$1 = $44 + ($3 << 1) | 0; + $$1261 = $44; + $$1266 = $43; + $$1276 = $1; + $$1285 = $0 + ($3 << 2) | 0; + while (1) { + if (($$0257 | 0) == ($3 | 0)) break; + $164 = HEAPU16[$$1276 >> 1] | 0; + HEAPF32[$$1285 >> 2] = +(((HEAPU16[$$1266 >> 1] | 0) * 6 | 0) + $164 + ((HEAPU16[$$1261 >> 1] | 0) + $164 << 2) + (HEAPU16[$$1 >> 1] | 0) | 0) * .00390625; + $$0257 = $$0257 + 1 | 0; + $$1 = $$1 + 2 | 0; + $$1261 = $$1261 + 2 | 0; + $$1266 = $$1266 + 2 | 0; + $$1276 = $$1276 + 2 | 0; + $$1285 = $$1285 + 4 | 0; + } + $$0256 = 2; + while (1) { + if (($$0256 | 0) == ($42 | 0)) break; + $192 = $1 + ((Math_imul($$0256 + -2 | 0, $3) | 0) << 1) | 0; + $193 = $192 + ($3 << 1) | 0; + $194 = $193 + ($3 << 1) | 0; + $195 = $194 + ($3 << 1) | 0; + $$0255 = 0; + $$2 = $195 + ($3 << 1) | 0; + $$2262 = $195; + $$2267 = $194; + $$2272 = $193; + $$2277 = $192; + $$2286 = $0 + ((Math_imul($$0256, $3) | 0) << 2) | 0; + while (1) { + if (($$0255 | 0) == ($3 | 0)) break; + HEAPF32[$$2286 >> 2] = +(((HEAPU16[$$2267 >> 1] | 0) * 6 | 0) + (HEAPU16[$$2277 >> 1] | 0) + ((HEAPU16[$$2262 >> 1] | 0) + (HEAPU16[$$2272 >> 1] | 0) << 2) + (HEAPU16[$$2 >> 1] | 0) | 0) * .00390625; + $$0255 = $$0255 + 1 | 0; + $$2 = $$2 + 2 | 0; + $$2262 = $$2262 + 2 | 0; + $$2267 = $$2267 + 2 | 0; + $$2272 = $$2272 + 2 | 0; + $$2277 = $$2277 + 2 | 0; + $$2286 = $$2286 + 4 | 0; + } + $$0256 = $$0256 + 1 | 0; + } + $184 = $1 + ((Math_imul($4 + -4 | 0, $3) | 0) << 1) | 0; + $185 = $184 + ($3 << 1) | 0; + $186 = $185 + ($3 << 1) | 0; + $$0254 = 0; + $$3263 = $186 + ($3 << 1) | 0; + $$3268 = $186; + $$3273 = $185; + $$3278 = $184; + $$3287 = $0 + ((Math_imul($42, $3) | 0) << 2) | 0; + while (1) { + if (($$0254 | 0) == ($3 | 0)) break; + $239 = HEAPU16[$$3263 >> 1] | 0; + HEAPF32[$$3287 >> 2] = +(((HEAPU16[$$3268 >> 1] | 0) * 6 | 0) + (HEAPU16[$$3278 >> 1] | 0) + ($239 + (HEAPU16[$$3273 >> 1] | 0) << 2) + $239 | 0) * .00390625; + $$0254 = $$0254 + 1 | 0; + $$3263 = $$3263 + 2 | 0; + $$3268 = $$3268 + 2 | 0; + $$3273 = $$3273 + 2 | 0; + $$3278 = $$3278 + 2 | 0; + $$3287 = $$3287 + 4 | 0; + } + $227 = $1 + ((Math_imul($4 + -3 | 0, $3) | 0) << 1) | 0; + $228 = $227 + ($3 << 1) | 0; + $$0 = 0; + $$4269 = $228 + ($3 << 1) | 0; + $$4274 = $228; + $$4279 = $227; + $$4288 = $0 + ((Math_imul($4 + -1 | 0, $3) | 0) << 2) | 0; + while (1) { + if (($$0 | 0) == ($3 | 0)) break; + $256 = HEAPU16[$$4269 >> 1] | 0; + HEAPF32[$$4288 >> 2] = +(($256 * 6 | 0) + (HEAPU16[$$4279 >> 1] | 0) + ($256 + (HEAPU16[$$4274 >> 1] | 0) << 2) + $256 | 0) * .00390625; + $$0 = $$0 + 1 | 0; + $$4269 = $$4269 + 2 | 0; + $$4274 = $$4274 + 2 | 0; + $$4279 = $$4279 + 2 | 0; + $$4288 = $$4288 + 4 | 0; + } + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseUnresolvedNameEv($0) { + $0 = $0 | 0; + var $$10 = 0, $$4 = 0, $$8 = 0, $$byval_copy2 = 0, $$pre$phi24Z2D = 0, $1 = 0, $11 = 0, $13 = 0, $15 = 0, $17 = 0, $18 = 0, $2 = 0, $21 = 0, $24 = 0, $26 = 0, $29 = 0, $3 = 0, $30 = 0, $34 = 0, $35 = 0, $37 = 0, $38 = 0, $4 = 0, $42 = 0, $44 = 0, $45 = 0, $6 = 0, $7 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy2 = sp + 32 | 0; + $1 = sp + 8 | 0; + $2 = sp + 24 | 0; + $3 = sp + 16 | 0; + $4 = sp; + HEAP32[$1 >> 2] = 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 53691); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + L1 : do if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy2) | 0) { + $6 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $7 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseUnresolvedTypeEv($6) | 0; + HEAP32[$1 >> 2] = $7; + if (!$7) $$10 = 0; else { + do if ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 == 73) { + $11 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseTemplateArgsEb($6, 0) | 0; + HEAP32[$$byval_copy2 >> 2] = $11; + if (!$11) { + $$10 = 0; + break L1; + } else { + $13 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20NameWithTemplateArgsEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $$byval_copy2) | 0; + HEAP32[$1 >> 2] = $13; + break; + } + } while (0); + while (1) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) break; + $15 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseSimpleIdEv($6) | 0; + HEAP32[$$byval_copy2 >> 2] = $15; + if (!$15) { + label = 35; + break; + } + $17 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13QualifiedNameEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $$byval_copy2) | 0; + HEAP32[$1 >> 2] = $17; + } + if ((label | 0) == 35) { + $$10 = 0; + break; + } + $18 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E23parseBaseUnresolvedNameEv($6) | 0; + HEAP32[$$byval_copy2 >> 2] = $18; + if (!$18) $$4 = 0; else $$4 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13QualifiedNameEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $$byval_copy2) | 0; + $$10 = $$4; + } + } else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 52665); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + $21 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy2) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 53695); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy2) | 0)) { + $24 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E23parseBaseUnresolvedNameEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $24; + if (($24 | 0) == 0 | $21 ^ 1) { + $$10 = $24; + break; + } + $26 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_19GlobalQualifiedNameEJRPNS0_4NodeEEEES9_DpOT0_($0, $1) | 0; + HEAP32[$1 >> 2] = $26; + $$10 = $26; + break; + } + L25 : do if ((((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24) + -48 | 0) >>> 0 >= 10) { + $37 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $38 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseUnresolvedTypeEv($37) | 0; + HEAP32[$1 >> 2] = $38; + if (!$38) { + $$10 = 0; + break L1; + } + if ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 == 73) { + $42 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseTemplateArgsEb($37, 0) | 0; + HEAP32[$$byval_copy2 >> 2] = $42; + if (!$42) { + $$10 = 0; + break L1; + } else { + $44 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20NameWithTemplateArgsEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $$byval_copy2) | 0; + HEAP32[$1 >> 2] = $44; + $$pre$phi24Z2D = $37; + break; + } + } else $$pre$phi24Z2D = $37; + } else { + while (1) { + $29 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $30 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseSimpleIdEv($29) | 0; + HEAP32[$$byval_copy2 >> 2] = $30; + if (!$30) break; + do if (!(HEAP32[$1 >> 2] | 0)) if ($21) { + $35 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_19GlobalQualifiedNameEJRPNS0_4NodeEEEES9_DpOT0_($0, $$byval_copy2) | 0; + HEAP32[$1 >> 2] = $35; + break; + } else { + HEAP32[$1 >> 2] = $30; + break; + } else { + $34 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13QualifiedNameEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $$byval_copy2) | 0; + HEAP32[$1 >> 2] = $34; + } while (0); + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) { + $$pre$phi24Z2D = $29; + break L25; + } + } + $$10 = 0; + break L1; + } while (0); + $45 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E23parseBaseUnresolvedNameEv($$pre$phi24Z2D) | 0; + HEAP32[$$byval_copy2 >> 2] = $45; + if (!$45) $$8 = 0; else $$8 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13QualifiedNameEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $$byval_copy2) | 0; + $$10 = $$8; + } while (0); + STACKTOP = sp; + return $$10 | 0; +} + +function __ZN6vision18binomial_4th_orderEPfS0_PKfmm($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0232 = 0, $$0233 = 0, $$0234 = 0, $$0235 = 0, $$0236 = 0, $$0237 = 0, $$0238 = 0, $$0253 = 0, $$0258 = 0, $$0259 = 0, $$0261 = 0, $$0262 = 0, $$1 = 0, $$1239 = 0, $$1244 = 0, $$1254 = 0, $$1260 = 0, $$1263 = 0, $$2 = 0, $$2240 = 0, $$2245 = 0, $$2250 = 0, $$2255 = 0, $$2264 = 0, $$3241 = 0, $$3246 = 0, $$3251 = 0, $$3256 = 0, $$3265 = 0, $$4247 = 0, $$4252 = 0, $$4257 = 0, $$4266 = 0, $103 = 0, $12 = 0, $120 = 0.0, $137 = 0.0, $154 = 0, $155 = 0, $156 = 0, $162 = 0, $163 = 0, $164 = 0, $165 = 0, $17 = 0, $191 = 0, $192 = 0, $200 = 0.0, $21 = 0, $214 = 0.0, $28 = 0, $33 = 0, $37 = 0, $38 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $46 = 0, $47 = 0.0, $49 = 0, $5 = 0, $55 = 0, $61 = 0.0, $71 = 0, $74 = 0, $76 = 0, $77 = 0.0, $86 = 0.0, $scevgep = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $5 = sp; + if ($3 >>> 0 <= 4) { + $12 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 31119) | 0, 31153) | 0, 39072) | 0, 168) | 0, 39079) | 0, 31248) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $12 + (HEAP32[(HEAP32[$12 >> 2] | 0) + -12 >> 2] | 0) | 0); + $17 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $21 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$17 >> 2] | 0) + 28 >> 2] & 127]($17, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($12, $21) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($12) | 0; + _abort(); + } + if ($4 >>> 0 <= 4) { + $28 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 31267) | 0, 31153) | 0, 39072) | 0, 169) | 0, 39079) | 0, 31248) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $28 + (HEAP32[(HEAP32[$28 >> 2] | 0) + -12 >> 2] | 0) | 0); + $33 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $37 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$33 >> 2] | 0) + 28 >> 2] & 127]($33, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($28, $37) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($28) | 0; + _abort(); + } + $38 = $3 + -1 | 0; + $39 = $3 + -2 | 0; + $40 = $3 + -3 | 0; + $41 = $3 + -4 | 0; + $$0259 = $1; + $$0261 = 0; + while (1) { + if (($$0261 | 0) == ($4 | 0)) break; + $46 = $2 + ((Math_imul($$0261, $3) | 0) << 2) | 0; + $47 = +HEAPF32[$46 >> 2]; + $49 = $46 + 4 | 0; + $55 = $46 + 8 | 0; + HEAPF32[$$0259 >> 2] = +HEAPF32[$55 >> 2] + ($47 + ($47 * 6.0 + ($47 + +HEAPF32[$49 >> 2]) * 4.0)); + $61 = +HEAPF32[$46 >> 2]; + HEAPF32[$$0259 + 4 >> 2] = +HEAPF32[$46 + 12 >> 2] + ($61 + (+HEAPF32[$49 >> 2] * 6.0 + ($61 + +HEAPF32[$55 >> 2]) * 4.0)); + $$0258 = 2; + $$1260 = $$0259 + 8 | 0; + while (1) { + if (($$0258 | 0) == ($39 | 0)) break; + $103 = $$0258 + 1 | 0; + HEAPF32[$$1260 >> 2] = +HEAPF32[$46 + ($$0258 + 2 << 2) >> 2] + (+HEAPF32[$46 + ($$0258 + -2 << 2) >> 2] + (+HEAPF32[$46 + ($$0258 << 2) >> 2] * 6.0 + (+HEAPF32[$46 + ($$0258 + -1 << 2) >> 2] + +HEAPF32[$46 + ($103 << 2) >> 2]) * 4.0)); + $$0258 = $103; + $$1260 = $$1260 + 4 | 0; + } + $scevgep = $$0259 + ($39 << 2) | 0; + $71 = $46 + ($39 << 2) | 0; + $74 = $46 + ($40 << 2) | 0; + $76 = $46 + ($38 << 2) | 0; + $77 = +HEAPF32[$76 >> 2]; + HEAPF32[$scevgep >> 2] = $77 + (+HEAPF32[$46 + ($41 << 2) >> 2] + (+HEAPF32[$71 >> 2] * 6.0 + (+HEAPF32[$74 >> 2] + $77) * 4.0)); + $86 = +HEAPF32[$76 >> 2]; + HEAPF32[$scevgep + 4 >> 2] = $86 + (+HEAPF32[$74 >> 2] + ($86 * 6.0 + ($86 + +HEAPF32[$71 >> 2]) * 4.0)); + $$0259 = $$0259 + ($3 << 2) | 0; + $$0261 = $$0261 + 1 | 0; + } + $42 = $4 + -2 | 0; + $43 = $1 + ($3 << 2) | 0; + $44 = $43 + ($3 << 2) | 0; + $$0236 = 0; + $$0237 = $44; + $$0238 = $43; + $$0253 = $1; + $$0262 = $0; + while (1) { + if (($$0236 | 0) == ($3 | 0)) break; + $120 = +HEAPF32[$$0253 >> 2]; + HEAPF32[$$0262 >> 2] = (+HEAPF32[$$0237 >> 2] + ($120 + ($120 * 6.0 + ($120 + +HEAPF32[$$0238 >> 2]) * 4.0))) * .00390625; + $$0236 = $$0236 + 1 | 0; + $$0237 = $$0237 + 4 | 0; + $$0238 = $$0238 + 4 | 0; + $$0253 = $$0253 + 4 | 0; + $$0262 = $$0262 + 4 | 0; + } + $$0235 = 0; + $$1 = $44 + ($3 << 2) | 0; + $$1239 = $44; + $$1244 = $43; + $$1254 = $1; + $$1263 = $0 + ($3 << 2) | 0; + while (1) { + if (($$0235 | 0) == ($3 | 0)) break; + $137 = +HEAPF32[$$1254 >> 2]; + HEAPF32[$$1263 >> 2] = (+HEAPF32[$$1 >> 2] + ($137 + (+HEAPF32[$$1244 >> 2] * 6.0 + ($137 + +HEAPF32[$$1239 >> 2]) * 4.0))) * .00390625; + $$0235 = $$0235 + 1 | 0; + $$1 = $$1 + 4 | 0; + $$1239 = $$1239 + 4 | 0; + $$1244 = $$1244 + 4 | 0; + $$1254 = $$1254 + 4 | 0; + $$1263 = $$1263 + 4 | 0; + } + $$0234 = 2; + while (1) { + if (($$0234 | 0) == ($42 | 0)) break; + $162 = $1 + ((Math_imul($$0234 + -2 | 0, $3) | 0) << 2) | 0; + $163 = $162 + ($3 << 2) | 0; + $164 = $163 + ($3 << 2) | 0; + $165 = $164 + ($3 << 2) | 0; + $$0233 = 0; + $$2 = $165 + ($3 << 2) | 0; + $$2240 = $165; + $$2245 = $164; + $$2250 = $163; + $$2255 = $162; + $$2264 = $0 + ((Math_imul($$0234, $3) | 0) << 2) | 0; + while (1) { + if (($$0233 | 0) == ($3 | 0)) break; + HEAPF32[$$2264 >> 2] = (+HEAPF32[$$2 >> 2] + (+HEAPF32[$$2255 >> 2] + (+HEAPF32[$$2245 >> 2] * 6.0 + (+HEAPF32[$$2250 >> 2] + +HEAPF32[$$2240 >> 2]) * 4.0))) * .00390625; + $$0233 = $$0233 + 1 | 0; + $$2 = $$2 + 4 | 0; + $$2240 = $$2240 + 4 | 0; + $$2245 = $$2245 + 4 | 0; + $$2250 = $$2250 + 4 | 0; + $$2255 = $$2255 + 4 | 0; + $$2264 = $$2264 + 4 | 0; + } + $$0234 = $$0234 + 1 | 0; + } + $154 = $1 + ((Math_imul($4 + -4 | 0, $3) | 0) << 2) | 0; + $155 = $154 + ($3 << 2) | 0; + $156 = $155 + ($3 << 2) | 0; + $$0232 = 0; + $$3241 = $156 + ($3 << 2) | 0; + $$3246 = $156; + $$3251 = $155; + $$3256 = $154; + $$3265 = $0 + ((Math_imul($42, $3) | 0) << 2) | 0; + while (1) { + if (($$0232 | 0) == ($3 | 0)) break; + $200 = +HEAPF32[$$3241 >> 2]; + HEAPF32[$$3265 >> 2] = ($200 + (+HEAPF32[$$3256 >> 2] + (+HEAPF32[$$3246 >> 2] * 6.0 + (+HEAPF32[$$3251 >> 2] + $200) * 4.0))) * .00390625; + $$0232 = $$0232 + 1 | 0; + $$3241 = $$3241 + 4 | 0; + $$3246 = $$3246 + 4 | 0; + $$3251 = $$3251 + 4 | 0; + $$3256 = $$3256 + 4 | 0; + $$3265 = $$3265 + 4 | 0; + } + $191 = $1 + ((Math_imul($4 + -3 | 0, $3) | 0) << 2) | 0; + $192 = $191 + ($3 << 2) | 0; + $$0 = 0; + $$4247 = $192 + ($3 << 2) | 0; + $$4252 = $192; + $$4257 = $191; + $$4266 = $0 + ((Math_imul($4 + -1 | 0, $3) | 0) << 2) | 0; + while (1) { + if (($$0 | 0) == ($3 | 0)) break; + $214 = +HEAPF32[$$4247 >> 2]; + HEAPF32[$$4266 >> 2] = ($214 + (+HEAPF32[$$4257 >> 2] + ($214 * 6.0 + (+HEAPF32[$$4252 >> 2] + $214) * 4.0))) * .00390625; + $$0 = $$0 + 1 | 0; + $$4247 = $$4247 + 4 | 0; + $$4252 = $$4252 + 4 | 0; + $$4257 = $$4257 + 4 | 0; + $$4266 = $$4266 + 4 | 0; + } + STACKTOP = sp; + return; +} + +function __ZNSt3__214__scan_keywordINS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEPKNS_12basic_stringIwS3_NS_9allocatorIwEEEENS_5ctypeIwEEEET0_RT_SE_SD_SD_RKT1_Rjb($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i116 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i122 = 0, $$0101 = 0, $$0105 = 0, $$0111 = 0, $$0112 = 0, $$0112140 = 0, $$092 = 0, $$093 = 0, $$094$off0 = 0, $$095 = 0, $$096 = 0, $$097 = 0, $$098 = 0, $$1102 = 0, $$1106 = 0, $$199 = 0, $$2$off0 = 0, $$2100 = 0, $$2103 = 0, $$2103$be = 0, $$2107 = 0, $$3 = 0, $$3104 = 0, $$3108 = 0, $$5 = 0, $$5110 = 0, $$6 = 0, $$7 = 0, $$sroa$0129$0 = 0, $109 = 0, $11 = 0, $114 = 0, $119 = 0, $120 = 0, $126 = 0, $13 = 0, $132 = 0, $138 = 0, $139 = 0, $140 = 0, $156 = 0, $162 = 0, $175 = 0, $18 = 0, $24 = 0, $29 = 0, $32 = 0, $44 = 0, $47 = 0, $60 = 0, $61 = 0, $64 = 0, $67 = 0, $7 = 0, $80 = 0, $82 = 0, $95 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 112 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(112); + $7 = sp; + $11 = ($3 - $2 | 0) / 12 | 0; + if ($11 >>> 0 > 100) { + $13 = _malloc($11) | 0; + if (!$13) __ZSt17__throw_bad_allocv(); else { + $$0111 = $13; + $$sroa$0129$0 = $13; + } + } else { + $$0111 = $7; + $$sroa$0129$0 = 0; + } + $$0101 = 0; + $$0105 = $11; + $$097 = $2; + $$098 = $$0111; + while (1) { + if (($$097 | 0) == ($3 | 0)) break; + $18 = HEAP8[$$097 + 8 + 3 >> 0] | 0; + if ($18 << 24 >> 24 < 0) $24 = HEAP32[$$097 + 4 >> 2] | 0; else $24 = $18 & 255; + if (!$24) { + HEAP8[$$098 >> 0] = 2; + $$1102 = $$0101 + 1 | 0; + $$1106 = $$0105 + -1 | 0; + } else { + HEAP8[$$098 >> 0] = 1; + $$1102 = $$0101; + $$1106 = $$0105; + } + $$0101 = $$1102; + $$0105 = $$1106; + $$097 = $$097 + 12 | 0; + $$098 = $$098 + 1 | 0; + } + $$096 = 0; + $$2103 = $$0101; + $$2107 = $$0105; + while (1) { + $29 = HEAP32[$0 >> 2] | 0; + do if ($29) { + $32 = HEAP32[$29 + 12 >> 2] | 0; + if (($32 | 0) == (HEAP32[$29 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$29 >> 2] | 0) + 36 >> 2] & 127]($29) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$32 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $60 = 1; + break; + } else { + $60 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $60 = 1; while (0); + $44 = HEAP32[$1 >> 2] | 0; + if ($44) { + $47 = HEAP32[$44 + 12 >> 2] | 0; + if (($47 | 0) == (HEAP32[$44 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$44 >> 2] | 0) + 36 >> 2] & 127]($44) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$47 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $61 = 1; + $80 = 0; + } else { + $61 = 0; + $80 = $44; + } + } else { + $61 = 1; + $80 = 0; + } + $64 = HEAP32[$0 >> 2] | 0; + if (!(($$2107 | 0) != 0 & ($60 ^ $61))) break; + $95 = HEAP32[$64 + 12 >> 2] | 0; + if (($95 | 0) == (HEAP32[$64 + 16 >> 2] | 0)) $$0$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$64 >> 2] | 0) + 36 >> 2] & 127]($64) | 0; else $$0$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$95 >> 2] | 0) | 0; + if ($6) $$095 = $$0$i$i; else $$095 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$4 >> 2] | 0) + 28 >> 2] & 127]($4, $$0$i$i) | 0; + $109 = $$096 + 1 | 0; + $$093 = $2; + $$094$off0 = 0; + $$199 = $$0111; + $$3104 = $$2103; + $$3108 = $$2107; + while (1) { + if (($$093 | 0) == ($3 | 0)) break; + do if ((HEAP8[$$199 >> 0] | 0) == 1) { + $114 = $$093 + 8 + 3 | 0; + if ((HEAP8[$114 >> 0] | 0) < 0) $119 = HEAP32[$$093 >> 2] | 0; else $119 = $$093; + $120 = HEAP32[$119 + ($$096 << 2) >> 2] | 0; + if ($6) $$092 = $120; else $$092 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$4 >> 2] | 0) + 28 >> 2] & 127]($4, $120) | 0; + if (($$095 | 0) != ($$092 | 0)) { + HEAP8[$$199 >> 0] = 0; + $$2$off0 = $$094$off0; + $$5 = $$3104; + $$5110 = $$3108 + -1 | 0; + break; + } + $126 = HEAP8[$114 >> 0] | 0; + if ($126 << 24 >> 24 < 0) $132 = HEAP32[$$093 + 4 >> 2] | 0; else $132 = $126 & 255; + if (($132 | 0) == ($109 | 0)) { + HEAP8[$$199 >> 0] = 2; + $$2$off0 = 1; + $$5 = $$3104 + 1 | 0; + $$5110 = $$3108 + -1 | 0; + } else { + $$2$off0 = 1; + $$5 = $$3104; + $$5110 = $$3108; + } + } else { + $$2$off0 = $$094$off0; + $$5 = $$3104; + $$5110 = $$3108; + } while (0); + $$093 = $$093 + 12 | 0; + $$094$off0 = $$2$off0; + $$199 = $$199 + 1 | 0; + $$3104 = $$5; + $$3108 = $$5110; + } + L67 : do if ($$094$off0) { + $138 = HEAP32[$0 >> 2] | 0; + $139 = $138 + 12 | 0; + $140 = HEAP32[$139 >> 2] | 0; + if (($140 | 0) == (HEAP32[$138 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$138 >> 2] | 0) + 40 >> 2] & 127]($138) | 0; else { + HEAP32[$139 >> 2] = $140 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$140 >> 2] | 0) | 0; + } + if (($$3104 + $$3108 | 0) >>> 0 > 1) { + $$0 = $2; + $$2100 = $$0111; + $$6 = $$3104; + while (1) { + if (($$0 | 0) == ($3 | 0)) { + $$2103$be = $$6; + break L67; + } + if ((HEAP8[$$2100 >> 0] | 0) == 2) { + $156 = HEAP8[$$0 + 8 + 3 >> 0] | 0; + if ($156 << 24 >> 24 < 0) $162 = HEAP32[$$0 + 4 >> 2] | 0; else $162 = $156 & 255; + if (($162 | 0) != ($109 | 0)) { + HEAP8[$$2100 >> 0] = 0; + $$7 = $$6 + -1 | 0; + } else $$7 = $$6; + } else $$7 = $$6; + $$0 = $$0 + 12 | 0; + $$2100 = $$2100 + 1 | 0; + $$6 = $$7; + } + } else $$2103$be = $$3104; + } else $$2103$be = $$3104; while (0); + $$096 = $109; + $$2103 = $$2103$be; + $$2107 = $$3108; + } + do if ($64) { + $67 = HEAP32[$64 + 12 >> 2] | 0; + if (($67 | 0) == (HEAP32[$64 + 16 >> 2] | 0)) $$0$i$i$i$i116 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$64 >> 2] | 0) + 36 >> 2] & 127]($64) | 0; else $$0$i$i$i$i116 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$67 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i116, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $175 = 1; + break; + } else { + $175 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $175 = 1; while (0); + do if ($80) { + $82 = HEAP32[$80 + 12 >> 2] | 0; + if (($82 | 0) == (HEAP32[$80 + 16 >> 2] | 0)) $$0$i$i2$i$i122 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i2$i$i122 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$82 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i122, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($175) break; else { + label = 79; + break; + } else { + HEAP32[$1 >> 2] = 0; + label = 41; + break; + } + } else label = 41; while (0); + if ((label | 0) == 41 ? $175 : 0) label = 79; + if ((label | 0) == 79) HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 2; + $$0112 = $2; + $$3 = $$0111; + while (1) { + if (($$0112 | 0) == ($3 | 0)) { + label = 84; + break; + } + if ((HEAP8[$$3 >> 0] | 0) == 2) { + $$0112140 = $$0112; + break; + } + $$0112 = $$0112 + 12 | 0; + $$3 = $$3 + 1 | 0; + } + if ((label | 0) == 84) { + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$0112140 = $3; + } + _free($$sroa$0129$0); + STACKTOP = sp; + return $$0112140 | 0; +} + +function __ZNSt3__214__scan_keywordINS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEPKNS_12basic_stringIcS3_NS_9allocatorIcEEEENS_5ctypeIcEEEET0_RT_SE_SD_SD_RKT1_Rjb($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i112 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i118 = 0, $$0101 = 0, $$0107 = 0, $$0108 = 0, $$0108136 = 0, $$088 = 0, $$089 = 0, $$090$off0 = 0, $$091 = 0, $$092 = 0, $$093 = 0, $$094 = 0, $$097 = 0, $$1102 = 0, $$195 = 0, $$198 = 0, $$2$off0 = 0, $$2103 = 0, $$296 = 0, $$299 = 0, $$299$be = 0, $$3 = 0, $$3100 = 0, $$3104 = 0, $$5 = 0, $$5106 = 0, $$6 = 0, $$7 = 0, $$sroa$0125$0 = 0, $104 = 0, $109 = 0, $11 = 0, $113 = 0, $118 = 0, $119 = 0, $125 = 0, $13 = 0, $131 = 0, $137 = 0, $138 = 0, $139 = 0, $154 = 0, $160 = 0, $17 = 0, $173 = 0, $23 = 0, $28 = 0, $31 = 0, $43 = 0, $46 = 0, $59 = 0, $60 = 0, $63 = 0, $66 = 0, $7 = 0, $79 = 0, $81 = 0, $94 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 112 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(112); + $7 = sp; + $11 = ($3 - $2 | 0) / 12 | 0; + if ($11 >>> 0 > 100) { + $13 = _malloc($11) | 0; + if (!$13) __ZSt17__throw_bad_allocv(); else { + $$0107 = $13; + $$sroa$0125$0 = $13; + } + } else { + $$0107 = $7; + $$sroa$0125$0 = 0; + } + $$0101 = $11; + $$093 = $2; + $$094 = $$0107; + $$097 = 0; + while (1) { + if (($$093 | 0) == ($3 | 0)) break; + $17 = HEAP8[$$093 + 11 >> 0] | 0; + if ($17 << 24 >> 24 < 0) $23 = HEAP32[$$093 + 4 >> 2] | 0; else $23 = $17 & 255; + if (!$23) { + HEAP8[$$094 >> 0] = 2; + $$1102 = $$0101 + -1 | 0; + $$198 = $$097 + 1 | 0; + } else { + HEAP8[$$094 >> 0] = 1; + $$1102 = $$0101; + $$198 = $$097; + } + $$0101 = $$1102; + $$093 = $$093 + 12 | 0; + $$094 = $$094 + 1 | 0; + $$097 = $$198; + } + $$092 = 0; + $$2103 = $$0101; + $$299 = $$097; + while (1) { + $28 = HEAP32[$0 >> 2] | 0; + do if ($28) { + $31 = HEAP32[$28 + 12 >> 2] | 0; + if (($31 | 0) == (HEAP32[$28 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$28 >> 2] | 0) + 36 >> 2] & 127]($28) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$31 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $59 = 1; + break; + } else { + $59 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $59 = 1; while (0); + $43 = HEAP32[$1 >> 2] | 0; + if ($43) { + $46 = HEAP32[$43 + 12 >> 2] | 0; + if (($46 | 0) == (HEAP32[$43 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$43 >> 2] | 0) + 36 >> 2] & 127]($43) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$46 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $60 = 1; + $79 = 0; + } else { + $60 = 0; + $79 = $43; + } + } else { + $60 = 1; + $79 = 0; + } + $63 = HEAP32[$0 >> 2] | 0; + if (!(($$2103 | 0) != 0 & ($59 ^ $60))) break; + $94 = HEAP32[$63 + 12 >> 2] | 0; + if (($94 | 0) == (HEAP32[$63 + 16 >> 2] | 0)) $$0$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$63 >> 2] | 0) + 36 >> 2] & 127]($63) | 0; else $$0$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$94 >> 0] | 0) | 0; + $104 = $$0$i$i & 255; + if ($6) $$091 = $104; else $$091 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$4 >> 2] | 0) + 12 >> 2] & 127]($4, $104) | 0; + $109 = $$092 + 1 | 0; + $$089 = $2; + $$090$off0 = 0; + $$195 = $$0107; + $$3100 = $$299; + $$3104 = $$2103; + while (1) { + if (($$089 | 0) == ($3 | 0)) break; + do if ((HEAP8[$$195 >> 0] | 0) == 1) { + $113 = $$089 + 11 | 0; + if ((HEAP8[$113 >> 0] | 0) < 0) $118 = HEAP32[$$089 >> 2] | 0; else $118 = $$089; + $119 = HEAP8[$118 + $$092 >> 0] | 0; + if ($6) $$088 = $119; else $$088 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$4 >> 2] | 0) + 12 >> 2] & 127]($4, $119) | 0; + if ($$091 << 24 >> 24 != $$088 << 24 >> 24) { + HEAP8[$$195 >> 0] = 0; + $$2$off0 = $$090$off0; + $$5 = $$3100; + $$5106 = $$3104 + -1 | 0; + break; + } + $125 = HEAP8[$113 >> 0] | 0; + if ($125 << 24 >> 24 < 0) $131 = HEAP32[$$089 + 4 >> 2] | 0; else $131 = $125 & 255; + if (($131 | 0) == ($109 | 0)) { + HEAP8[$$195 >> 0] = 2; + $$2$off0 = 1; + $$5 = $$3100 + 1 | 0; + $$5106 = $$3104 + -1 | 0; + } else { + $$2$off0 = 1; + $$5 = $$3100; + $$5106 = $$3104; + } + } else { + $$2$off0 = $$090$off0; + $$5 = $$3100; + $$5106 = $$3104; + } while (0); + $$089 = $$089 + 12 | 0; + $$090$off0 = $$2$off0; + $$195 = $$195 + 1 | 0; + $$3100 = $$5; + $$3104 = $$5106; + } + L67 : do if ($$090$off0) { + $137 = HEAP32[$0 >> 2] | 0; + $138 = $137 + 12 | 0; + $139 = HEAP32[$138 >> 2] | 0; + if (($139 | 0) == (HEAP32[$137 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$137 >> 2] | 0) + 40 >> 2] & 127]($137) | 0; else { + HEAP32[$138 >> 2] = $139 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$139 >> 0] | 0) | 0; + } + if (($$3100 + $$3104 | 0) >>> 0 > 1) { + $$0 = $2; + $$296 = $$0107; + $$6 = $$3100; + while (1) { + if (($$0 | 0) == ($3 | 0)) { + $$299$be = $$6; + break L67; + } + if ((HEAP8[$$296 >> 0] | 0) == 2) { + $154 = HEAP8[$$0 + 11 >> 0] | 0; + if ($154 << 24 >> 24 < 0) $160 = HEAP32[$$0 + 4 >> 2] | 0; else $160 = $154 & 255; + if (($160 | 0) != ($109 | 0)) { + HEAP8[$$296 >> 0] = 0; + $$7 = $$6 + -1 | 0; + } else $$7 = $$6; + } else $$7 = $$6; + $$0 = $$0 + 12 | 0; + $$296 = $$296 + 1 | 0; + $$6 = $$7; + } + } else $$299$be = $$3100; + } else $$299$be = $$3100; while (0); + $$092 = $109; + $$2103 = $$3104; + $$299 = $$299$be; + } + do if ($63) { + $66 = HEAP32[$63 + 12 >> 2] | 0; + if (($66 | 0) == (HEAP32[$63 + 16 >> 2] | 0)) $$0$i$i$i$i112 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$63 >> 2] | 0) + 36 >> 2] & 127]($63) | 0; else $$0$i$i$i$i112 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$66 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i112, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $173 = 1; + break; + } else { + $173 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $173 = 1; while (0); + do if ($79) { + $81 = HEAP32[$79 + 12 >> 2] | 0; + if (($81 | 0) == (HEAP32[$79 + 16 >> 2] | 0)) $$0$i$i2$i$i118 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$79 >> 2] | 0) + 36 >> 2] & 127]($79) | 0; else $$0$i$i2$i$i118 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$81 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i118, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($173) break; else { + label = 79; + break; + } else { + HEAP32[$1 >> 2] = 0; + label = 41; + break; + } + } else label = 41; while (0); + if ((label | 0) == 41 ? $173 : 0) label = 79; + if ((label | 0) == 79) HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 2; + $$0108 = $2; + $$3 = $$0107; + while (1) { + if (($$0108 | 0) == ($3 | 0)) { + label = 84; + break; + } + if ((HEAP8[$$3 >> 0] | 0) == 2) { + $$0108136 = $$0108; + break; + } + $$0108 = $$0108 + 12 | 0; + $$3 = $$3 + 1 | 0; + } + if ((label | 0) == 84) { + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 4; + $$0108136 = $3; + } + _free($$sroa$0125$0); + STACKTOP = sp; + return $$0108136 | 0; +} + +function _jpeg_idct_15x15($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0352372 = 0, $$0354371 = 0, $$0355370 = 0, $$0373 = 0, $$1353368 = 0, $$1369 = 0, $$neg356 = 0, $$neg362 = 0, $101 = 0, $104 = 0, $107 = 0, $109 = 0, $111 = 0, $115 = 0, $119 = 0, $15 = 0, $167 = 0, $170 = 0, $173 = 0, $175 = 0, $177 = 0, $179 = 0, $182 = 0, $183 = 0, $185 = 0, $186 = 0, $187 = 0, $188 = 0, $189 = 0, $190 = 0, $192 = 0, $195 = 0, $196 = 0, $198 = 0, $201 = 0, $202 = 0, $203 = 0, $205 = 0, $207 = 0, $209 = 0, $21 = 0, $210 = 0, $212 = 0, $214 = 0, $217 = 0, $219 = 0, $220 = 0, $222 = 0, $224 = 0, $226 = 0, $227 = 0, $228 = 0, $229 = 0, $231 = 0, $234 = 0, $237 = 0, $239 = 0, $241 = 0, $245 = 0, $249 = 0, $27 = 0, $33 = 0, $36 = 0, $37 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $46 = 0, $49 = 0, $5 = 0, $50 = 0, $52 = 0, $55 = 0, $56 = 0, $57 = 0, $59 = 0, $61 = 0, $63 = 0, $64 = 0, $7 = 0, $70 = 0, $76 = 0, $83 = 0, $89 = 0, $90 = 0, $92 = 0, $94 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 480 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(480); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0352372 = $5; + $$0354371 = HEAP32[$1 + 84 >> 2] | 0; + $$0355370 = $2; + $$0373 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0355370 >> 1] << 13, HEAP32[$$0354371 >> 2] | 0) | 0 | 1024; + $21 = Math_imul(HEAP32[$$0354371 + 64 >> 2] | 0, HEAP16[$$0355370 + 32 >> 1] | 0) | 0; + $27 = Math_imul(HEAP32[$$0354371 + 128 >> 2] | 0, HEAP16[$$0355370 + 64 >> 1] | 0) | 0; + $33 = Math_imul(HEAP32[$$0354371 + 192 >> 2] | 0, HEAP16[$$0355370 + 96 >> 1] | 0) | 0; + $36 = (Math_imul($33, -3580) | 0) + $15 | 0; + $37 = ($33 * 9373 | 0) + $15 | 0; + $39 = (Math_imul($33, -11586) | 0) + $15 | 0; + $40 = $21 - $27 | 0; + $41 = $27 + $21 | 0; + $42 = $41 * 10958 | 0; + $43 = $40 * 374 | 0; + $44 = $21 * 11795 | 0; + $46 = $43 + $42 + $37 | 0; + $49 = $44 - $42 + $43 + $36 | 0; + $50 = $41 * 4482 | 0; + $$neg362 = Math_imul($40, -3271) | 0; + $52 = $37 - $50 + $$neg362 | 0; + $55 = $50 - $44 + $$neg362 + $36 | 0; + $56 = $41 * 6476 | 0; + $57 = $40 * 2896 | 0; + $59 = $57 + $56 + $36 | 0; + $61 = $37 - $56 + $57 | 0; + $63 = $39 + ($40 * 5792 | 0) | 0; + $64 = (Math_imul($40, -11584) | 0) + $39 | 0; + $70 = Math_imul(HEAP32[$$0354371 + 32 >> 2] | 0, HEAP16[$$0355370 + 16 >> 1] | 0) | 0; + $76 = Math_imul(HEAP32[$$0354371 + 96 >> 2] | 0, HEAP16[$$0355370 + 48 >> 1] | 0) | 0; + $83 = Math_imul((HEAP16[$$0355370 + 80 >> 1] | 0) * 10033 | 0, HEAP32[$$0354371 + 160 >> 2] | 0) | 0; + $89 = Math_imul(HEAP32[$$0354371 + 224 >> 2] | 0, HEAP16[$$0355370 + 112 >> 1] | 0) | 0; + $90 = $76 - $89 | 0; + $92 = ($90 + $70 | 0) * 6810 | 0; + $94 = $92 + ($70 * 4209 | 0) | 0; + $96 = $92 + (Math_imul($90, -17828) | 0) | 0; + $97 = Math_imul($76, -6810) | 0; + $98 = Math_imul($76, -11018) | 0; + $99 = $70 - $89 | 0; + $101 = ($99 * 11522 | 0) + $83 | 0; + $104 = ($89 * 20131 | 0) - $98 + $101 | 0; + $107 = $97 + (Math_imul($70, -9113) | 0) + $101 | 0; + $109 = ($99 * 10033 | 0) - $83 | 0; + $111 = ($89 + $70 | 0) * 4712 | 0; + $115 = $97 + ($70 * 3897 | 0) - $83 + $111 | 0; + $119 = $83 + $98 + (Math_imul($89, -7121) | 0) + $111 | 0; + HEAP32[$$0352372 >> 2] = $104 + $46 >> 11; + HEAP32[$$0352372 + 448 >> 2] = $46 - $104 >> 11; + HEAP32[$$0352372 + 32 >> 2] = $94 + $59 >> 11; + HEAP32[$$0352372 + 416 >> 2] = $59 - $94 >> 11; + HEAP32[$$0352372 + 64 >> 2] = $109 + $63 >> 11; + HEAP32[$$0352372 + 384 >> 2] = $63 - $109 >> 11; + HEAP32[$$0352372 + 96 >> 2] = $115 + $49 >> 11; + HEAP32[$$0352372 + 352 >> 2] = $49 - $115 >> 11; + HEAP32[$$0352372 + 128 >> 2] = $96 + $61 >> 11; + HEAP32[$$0352372 + 320 >> 2] = $61 - $96 >> 11; + HEAP32[$$0352372 + 160 >> 2] = $119 + $52 >> 11; + HEAP32[$$0352372 + 288 >> 2] = $52 - $119 >> 11; + HEAP32[$$0352372 + 192 >> 2] = $107 + $55 >> 11; + HEAP32[$$0352372 + 256 >> 2] = $55 - $107 >> 11; + HEAP32[$$0352372 + 224 >> 2] = $64 >> 11; + $$0373 = $$0373 + 1 | 0; + if (($$0373 | 0) == 8) break; else { + $$0352372 = $$0352372 + 4 | 0; + $$0354371 = $$0354371 + 4 | 0; + $$0355370 = $$0355370 + 2 | 0; + } + } + $167 = $7 + -384 | 0; + $$1353368 = $5; + $$1369 = 0; + while (1) { + $170 = (HEAP32[$3 + ($$1369 << 2) >> 2] | 0) + $4 | 0; + $173 = (HEAP32[$$1353368 >> 2] << 13) + 134348800 | 0; + $175 = HEAP32[$$1353368 + 8 >> 2] | 0; + $177 = HEAP32[$$1353368 + 16 >> 2] | 0; + $179 = HEAP32[$$1353368 + 24 >> 2] | 0; + $182 = (Math_imul($179, -3580) | 0) + $173 | 0; + $183 = ($179 * 9373 | 0) + $173 | 0; + $185 = (Math_imul($179, -11586) | 0) + $173 | 0; + $186 = $175 - $177 | 0; + $187 = $177 + $175 | 0; + $188 = $187 * 10958 | 0; + $189 = $186 * 374 | 0; + $190 = $175 * 11795 | 0; + $192 = $189 + $188 + $183 | 0; + $195 = $190 - $188 + $189 + $182 | 0; + $196 = $187 * 4482 | 0; + $$neg356 = Math_imul($186, -3271) | 0; + $198 = $183 - $196 + $$neg356 | 0; + $201 = $196 - $190 + $$neg356 + $182 | 0; + $202 = $187 * 6476 | 0; + $203 = $186 * 2896 | 0; + $205 = $203 + $202 + $182 | 0; + $207 = $183 - $202 + $203 | 0; + $209 = $185 + ($186 * 5792 | 0) | 0; + $210 = (Math_imul($186, -11584) | 0) + $185 | 0; + $212 = HEAP32[$$1353368 + 4 >> 2] | 0; + $214 = HEAP32[$$1353368 + 12 >> 2] | 0; + $217 = (HEAP32[$$1353368 + 20 >> 2] | 0) * 10033 | 0; + $219 = HEAP32[$$1353368 + 28 >> 2] | 0; + $220 = $214 - $219 | 0; + $222 = ($220 + $212 | 0) * 6810 | 0; + $224 = $222 + ($212 * 4209 | 0) | 0; + $226 = $222 + (Math_imul($220, -17828) | 0) | 0; + $227 = Math_imul($214, -6810) | 0; + $228 = Math_imul($214, -11018) | 0; + $229 = $212 - $219 | 0; + $231 = ($229 * 11522 | 0) + $217 | 0; + $234 = ($219 * 20131 | 0) - $228 + $231 | 0; + $237 = $227 + (Math_imul($212, -9113) | 0) + $231 | 0; + $239 = ($229 * 10033 | 0) - $217 | 0; + $241 = ($219 + $212 | 0) * 4712 | 0; + $245 = $227 + ($212 * 3897 | 0) - $217 + $241 | 0; + $249 = $217 + $228 + (Math_imul($219, -7121) | 0) + $241 | 0; + HEAP8[$170 >> 0] = HEAP8[$167 + (($234 + $192 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$170 + 14 >> 0] = HEAP8[$167 + (($192 - $234 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$170 + 1 >> 0] = HEAP8[$167 + (($224 + $205 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$170 + 13 >> 0] = HEAP8[$167 + (($205 - $224 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$170 + 2 >> 0] = HEAP8[$167 + (($239 + $209 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$170 + 12 >> 0] = HEAP8[$167 + (($209 - $239 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$170 + 3 >> 0] = HEAP8[$167 + (($245 + $195 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$170 + 11 >> 0] = HEAP8[$167 + (($195 - $245 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$170 + 4 >> 0] = HEAP8[$167 + (($226 + $207 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$170 + 10 >> 0] = HEAP8[$167 + (($207 - $226 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$170 + 5 >> 0] = HEAP8[$167 + (($249 + $198 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$170 + 9 >> 0] = HEAP8[$167 + (($198 - $249 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$170 + 6 >> 0] = HEAP8[$167 + (($237 + $201 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$170 + 8 >> 0] = HEAP8[$167 + (($201 - $237 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$170 + 7 >> 0] = HEAP8[$167 + ($210 >>> 18 & 1023) >> 0] | 0; + $$1369 = $$1369 + 1 | 0; + if (($$1369 | 0) == 15) break; else $$1353368 = $$1353368 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function _icpGetInitXw2Xc_from_PlanarData($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0204 = 0, $$1 = 0, $101 = 0, $102 = 0, $108 = 0, $110 = 0, $112 = 0, $116 = 0, $118 = 0, $120 = 0.0, $121 = 0, $125 = 0.0, $128 = 0.0, $129 = 0.0, $130 = 0, $133 = 0.0, $137 = 0.0, $140 = 0.0, $141 = 0.0, $143 = 0.0, $144 = 0, $149 = 0.0, $150 = 0, $157 = 0.0, $158 = 0, $162 = 0.0, $164 = 0.0, $17 = 0, $170 = 0.0, $176 = 0.0, $184 = 0.0, $192 = 0.0, $193 = 0.0, $195 = 0.0, $196 = 0.0, $198 = 0.0, $200 = 0.0, $202 = 0.0, $204 = 0.0, $208 = 0.0, $215 = 0.0, $216 = 0.0, $217 = 0.0, $218 = 0.0, $38 = 0, $39 = 0, $41 = 0, $43 = 0, $45 = 0, $46 = 0, $48 = 0, $5 = 0, $61 = 0, $88 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer11 = 0, $vararg_buffer3 = 0, $vararg_buffer5 = 0, $vararg_buffer7 = 0, $vararg_buffer9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 128 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(128); + $vararg_buffer11 = sp + 120 | 0; + $vararg_buffer9 = sp + 112 | 0; + $vararg_buffer7 = sp + 104 | 0; + $vararg_buffer5 = sp + 96 | 0; + $vararg_buffer3 = sp + 88 | 0; + $vararg_buffer1 = sp + 80 | 0; + $vararg_buffer = sp + 72 | 0; + $5 = sp; + L1 : do if (($3 | 0) >= 4) { + $$0 = 0; + while (1) { + if (($$0 | 0) >= ($3 | 0)) break; + if (+HEAPF64[$2 + ($$0 * 24 | 0) + 16 >> 3] != 0.0) { + $$0204 = -1; + break L1; + } else $$0 = $$0 + 1 | 0; + } + if ((((((((!(+HEAPF64[$0 >> 3] == 0.0) ? !(+HEAPF64[$0 + 32 >> 3] != 0.0) : 0) ? ($17 = $0 + 40 | 0, !(+HEAPF64[$17 >> 3] == 0.0)) : 0) ? !(+HEAPF64[$0 + 64 >> 3] != 0.0) : 0) ? !(+HEAPF64[$0 + 72 >> 3] != 0.0) : 0) ? !(+HEAPF64[$0 + 80 >> 3] != 1.0) : 0) ? !(+HEAPF64[$0 + 24 >> 3] != 0.0) : 0) ? !(+HEAPF64[$0 + 56 >> 3] != 0.0) : 0) ? !(+HEAPF64[$0 + 88 >> 3] != 0.0) : 0) { + $38 = $3 << 1; + $39 = _arMatrixAlloc($38, 8) | 0; + if (!$39) { + _arLog(0, 3, 24753, $vararg_buffer); + $$0204 = -1; + break; + } + $41 = _arMatrixAlloc($38, 1) | 0; + if (!$41) { + _arMatrixFree($39) | 0; + _arLog(0, 3, 24779, $vararg_buffer1); + $$0204 = -1; + break; + } + $$1 = 0; + while (1) { + if (($$1 | 0) == ($3 | 0)) break; + $43 = $2 + ($$1 * 24 | 0) | 0; + $45 = HEAP32[$39 >> 2] | 0; + $46 = $$1 << 4; + HEAPF64[$45 + ($46 << 3) >> 3] = +HEAPF64[$43 >> 3]; + $48 = $2 + ($$1 * 24 | 0) + 8 | 0; + HEAPF64[$45 + (($46 | 1) << 3) >> 3] = +HEAPF64[$48 >> 3]; + HEAPF64[$45 + (($46 | 2) << 3) >> 3] = 1.0; + HEAPF64[$45 + (($46 | 3) << 3) >> 3] = 0.0; + HEAPF64[$45 + (($46 | 4) << 3) >> 3] = 0.0; + HEAPF64[$45 + (($46 | 5) << 3) >> 3] = 0.0; + $61 = $1 + ($$1 << 4) | 0; + HEAPF64[$45 + (($46 | 6) << 3) >> 3] = -(+HEAPF64[$43 >> 3] * +HEAPF64[$61 >> 3]); + HEAPF64[$45 + (($46 | 7) << 3) >> 3] = -(+HEAPF64[$48 >> 3] * +HEAPF64[$61 >> 3]); + HEAPF64[$45 + (($46 | 8) << 3) >> 3] = 0.0; + HEAPF64[$45 + (($46 | 9) << 3) >> 3] = 0.0; + HEAPF64[$45 + (($46 | 10) << 3) >> 3] = 0.0; + HEAPF64[$45 + (($46 | 11) << 3) >> 3] = +HEAPF64[$43 >> 3]; + HEAPF64[$45 + (($46 | 12) << 3) >> 3] = +HEAPF64[$48 >> 3]; + HEAPF64[$45 + (($46 | 13) << 3) >> 3] = 1.0; + $88 = $1 + ($$1 << 4) + 8 | 0; + HEAPF64[$45 + (($46 | 14) << 3) >> 3] = -(+HEAPF64[$43 >> 3] * +HEAPF64[$88 >> 3]); + HEAPF64[$45 + (($46 | 15) << 3) >> 3] = -(+HEAPF64[$48 >> 3] * +HEAPF64[$88 >> 3]); + $101 = HEAP32[$41 >> 2] | 0; + $102 = $$1 << 1; + HEAPF64[$101 + ($102 << 3) >> 3] = +HEAPF64[$61 >> 3]; + HEAPF64[$101 + (($102 | 1) << 3) >> 3] = +HEAPF64[$88 >> 3]; + $$1 = $$1 + 1 | 0; + } + $108 = _arMatrixAllocTrans($39) | 0; + if (!$108) { + _arMatrixFree($39) | 0; + _arMatrixFree($41) | 0; + _arLog(0, 3, 24805, $vararg_buffer3); + $$0204 = -1; + break; + } + $110 = _arMatrixAllocMul($108, $39) | 0; + if (!$110) { + _arMatrixFree($39) | 0; + _arMatrixFree($41) | 0; + _arMatrixFree($108) | 0; + _arLog(0, 3, 24831, $vararg_buffer5); + $$0204 = -1; + break; + } + $112 = _arMatrixAllocMul($108, $41) | 0; + if (!$112) { + _arMatrixFree($39) | 0; + _arMatrixFree($41) | 0; + _arMatrixFree($108) | 0; + _arMatrixFree($110) | 0; + _arLog(0, 3, 24857, $vararg_buffer7); + $$0204 = -1; + break; + } + if ((_arMatrixSelfInv($110) | 0) < 0) { + _arMatrixFree($39) | 0; + _arMatrixFree($41) | 0; + _arMatrixFree($108) | 0; + _arMatrixFree($110) | 0; + _arMatrixFree($112) | 0; + _arLog(0, 3, 24883, $vararg_buffer9); + $$0204 = -1; + break; + } + $116 = _arMatrixAllocMul($110, $112) | 0; + if (!$116) { + _arMatrixFree($39) | 0; + _arMatrixFree($41) | 0; + _arMatrixFree($108) | 0; + _arMatrixFree($110) | 0; + _arMatrixFree($112) | 0; + _arLog(0, 3, 24909, $vararg_buffer11); + $$0204 = -1; + break; + } else { + $118 = HEAP32[$116 >> 2] | 0; + $120 = +HEAPF64[$118 + 48 >> 3]; + $121 = $5 + 16 | 0; + $125 = +HEAPF64[$0 + 48 >> 3]; + $128 = +HEAPF64[$17 >> 3]; + $129 = (+HEAPF64[$118 + 24 >> 3] - $120 * $125) / $128; + $130 = $5 + 8 | 0; + $133 = +HEAPF64[$0 + 16 >> 3]; + $137 = +HEAPF64[$0 + 8 >> 3]; + $140 = +HEAPF64[$0 >> 3]; + $141 = (+HEAPF64[$118 >> 3] - $120 * $133 - $129 * $137) / $140; + $143 = +HEAPF64[$118 + 56 >> 3]; + $144 = $5 + 40 | 0; + $149 = (+HEAPF64[$118 + 32 >> 3] - $125 * $143) / $128; + $150 = $5 + 32 | 0; + $157 = (+HEAPF64[$118 + 8 >> 3] - $133 * $143 - $137 * $149) / $140; + $158 = $5 + 24 | 0; + $162 = (+HEAPF64[$118 + 40 >> 3] - $125) / $128; + $164 = +HEAPF64[$118 + 16 >> 3]; + _arMatrixFree($39) | 0; + _arMatrixFree($41) | 0; + _arMatrixFree($108) | 0; + _arMatrixFree($110) | 0; + _arMatrixFree($112) | 0; + _arMatrixFree($116) | 0; + $170 = +Math_sqrt(+($120 * $120 + ($129 * $129 + $141 * $141))); + $176 = +Math_sqrt(+($143 * $143 + ($149 * $149 + $157 * $157))); + HEAPF64[$5 >> 3] = $141 / $170; + HEAPF64[$130 >> 3] = $129 / $170; + HEAPF64[$121 >> 3] = $120 / $170; + HEAPF64[$158 >> 3] = $157 / $176; + HEAPF64[$150 >> 3] = $149 / $176; + HEAPF64[$144 >> 3] = $143 / $176; + $184 = ($170 + $176) * .5; + _check_rotation($5); + $192 = +HEAPF64[$130 >> 3]; + $193 = +HEAPF64[$144 >> 3]; + $195 = +HEAPF64[$121 >> 3]; + $196 = +HEAPF64[$150 >> 3]; + $198 = $192 * $193 - $195 * $196; + $200 = +HEAPF64[$158 >> 3]; + $202 = +HEAPF64[$5 >> 3]; + $204 = $195 * $200 - $193 * $202; + $208 = $196 * $202 - $192 * $200; + $215 = +Math_sqrt(+($208 * $208 + ($198 * $198 + $204 * $204))); + $216 = $198 / $215; + HEAPF64[$5 + 48 >> 3] = $216; + $217 = $204 / $215; + HEAPF64[$5 + 56 >> 3] = $217; + $218 = $208 / $215; + HEAPF64[$5 + 64 >> 3] = $218; + HEAPF64[$4 >> 3] = $202; + HEAPF64[$4 + 32 >> 3] = $192; + HEAPF64[$4 + 64 >> 3] = $195; + HEAPF64[$4 + 8 >> 3] = $200; + HEAPF64[$4 + 40 >> 3] = $196; + HEAPF64[$4 + 72 >> 3] = $193; + HEAPF64[$4 + 16 >> 3] = $216; + HEAPF64[$4 + 48 >> 3] = $217; + HEAPF64[$4 + 80 >> 3] = $218; + HEAPF64[$4 + 24 >> 3] = ($164 - $133 - $137 * $162) / $140 / $184; + HEAPF64[$4 + 56 >> 3] = $162 / $184; + HEAPF64[$4 + 88 >> 3] = 1.0 / $184; + $$0204 = 0; + break; + } + } else $$0204 = -1; + } else $$0204 = -1; while (0); + STACKTOP = sp; + return $$0204 | 0; +} + +function __ZN6vision12FindFeaturesINS_14FREAKExtractorELi96EEEvPNS_8KeyframeIXT0_EEEPKNS_25GaussianScaleSpacePyramidEPNS_25DoGScaleInvariantDetectorEPT_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $104 = 0, $112 = 0, $113 = 0, $12 = 0, $126 = 0, $17 = 0, $21 = 0, $28 = 0, $33 = 0, $37 = 0, $38 = 0, $4 = 0, $48 = 0, $5 = 0, $53 = 0, $57 = 0, $58 = 0, $60 = 0, $68 = 0, $73 = 0, $77 = 0, $78 = 0, $80 = 0, $88 = 0, $93 = 0, $97 = 0, $98 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $4 = sp + 20 | 0; + $5 = sp; + if (!$1) { + $12 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 37660) | 0, 34139) | 0, 39072) | 0, 212) | 0, 39079) | 0, 37760) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $12 + (HEAP32[(HEAP32[$12 >> 2] | 0) + -12 >> 2] | 0) | 0); + $17 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $21 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$17 >> 2] | 0) + 28 >> 2] & 127]($17, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($12, $21) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($12) | 0; + _abort(); + } + if (!$2) { + $28 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 34218) | 0, 34139) | 0, 39072) | 0, 213) | 0, 39079) | 0, 34250) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $28 + (HEAP32[(HEAP32[$28 >> 2] | 0) + -12 >> 2] | 0) | 0); + $33 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $37 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$33 >> 2] | 0) + 28 >> 2] & 127]($33, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($28, $37) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($28) | 0; + _abort(); + } + $38 = __ZNK6vision25GaussianScaleSpacePyramid6imagesEv($1) | 0; + if ((HEAP32[$38 + 4 >> 2] | 0) == (HEAP32[$38 >> 2] | 0)) { + $48 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 34267) | 0, 34139) | 0, 39072) | 0, 214) | 0, 39079) | 0, 34319) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $48 + (HEAP32[(HEAP32[$48 >> 2] | 0) + -12 >> 2] | 0) | 0); + $53 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $57 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$53 >> 2] | 0) + 28 >> 2] & 127]($53, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($48, $57) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($48) | 0; + _abort(); + } + $58 = __ZNK6vision25GaussianScaleSpacePyramid6imagesEv($1) | 0; + $60 = __ZNK6vision5Image5widthEv(HEAP32[$58 >> 2] | 0) | 0; + if (($60 | 0) != (__ZNK6vision25DoGScaleInvariantDetector5widthEv($2) | 0)) { + $68 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 34336) | 0, 34139) | 0, 39072) | 0, 215) | 0, 39079) | 0, 34409) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $68 + (HEAP32[(HEAP32[$68 >> 2] | 0) + -12 >> 2] | 0) | 0); + $73 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $77 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$73 >> 2] | 0) + 28 >> 2] & 127]($73, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($68, $77) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($68) | 0; + _abort(); + } + $78 = __ZNK6vision25GaussianScaleSpacePyramid6imagesEv($1) | 0; + $80 = __ZNK6vision5Image6heightEv(HEAP32[$78 >> 2] | 0) | 0; + if (($80 | 0) != (__ZNK6vision25DoGScaleInvariantDetector6heightEv($2) | 0)) { + $88 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 34444) | 0, 34139) | 0, 39072) | 0, 216) | 0, 39079) | 0, 34409) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $88 + (HEAP32[(HEAP32[$88 >> 2] | 0) + -12 >> 2] | 0) | 0); + $93 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $97 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$93 >> 2] | 0) + 28 >> 2] & 127]($93, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($88, $97) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($88) | 0; + _abort(); + } + __ZN6vision25DoGScaleInvariantDetector6detectEPKNS_25GaussianScaleSpacePyramidE($2, $1); + $98 = __ZNK6vision25DoGScaleInvariantDetector8featuresEv($2) | 0; + __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEEC2Em($4, ((HEAP32[$98 + 4 >> 2] | 0) - (HEAP32[$98 >> 2] | 0) | 0) / 36 | 0); + $$0 = 0; + while (1) { + $104 = __ZNK6vision25DoGScaleInvariantDetector8featuresEv($2) | 0; + if ($$0 >>> 0 >= (((HEAP32[$104 + 4 >> 2] | 0) - (HEAP32[$104 >> 2] | 0) | 0) / 36 | 0) >>> 0) break; + $112 = __ZNK6vision25DoGScaleInvariantDetector8featuresEv($2) | 0; + $113 = HEAP32[$112 >> 2] | 0; + __ZN6vision12FeaturePointC2Effffb($5, +HEAPF32[$113 + ($$0 * 36 | 0) >> 2], +HEAPF32[$113 + ($$0 * 36 | 0) + 4 >> 2], +HEAPF32[$113 + ($$0 * 36 | 0) + 8 >> 2], +HEAPF32[$113 + ($$0 * 36 | 0) + 28 >> 2], +HEAPF32[$113 + ($$0 * 36 | 0) + 24 >> 2] > 0.0); + $126 = (HEAP32[$4 >> 2] | 0) + ($$0 * 20 | 0) | 0; + HEAP32[$126 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$126 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + HEAP32[$126 + 8 >> 2] = HEAP32[$5 + 8 >> 2]; + HEAP32[$126 + 12 >> 2] = HEAP32[$5 + 12 >> 2]; + HEAP8[$126 + 16 >> 0] = HEAP8[$5 + 16 >> 0] | 0; + __ZN6vision12FeaturePointD2Ev($5); + $$0 = $$0 + 1 | 0; + } + __ZN6vision14FREAKExtractor7extractERNS_18BinaryFeatureStoreEPKNS_25GaussianScaleSpacePyramidERKNSt3__26vectorINS_12FeaturePointENS6_9allocatorIS8_EEEE($3, __ZN6vision8KeyframeILi96EE5storeEv($0) | 0, $1, $4); + __ZNSt3__213__vector_baseIN6vision12FeaturePointENS_9allocatorIS2_EEED2Ev($4); + STACKTOP = sp; + return; +} + +function __ZN6vision18BinomialPyramid32f5buildERKNS_5ImageE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $10 = 0, $101 = 0, $103 = 0, $105 = 0, $111 = 0, $114 = 0, $117 = 0, $120 = 0, $123 = 0, $126 = 0, $129 = 0, $134 = 0, $136 = 0, $140 = 0, $142 = 0, $15 = 0, $19 = 0, $2 = 0, $27 = 0, $32 = 0, $36 = 0, $37 = 0, $43 = 0, $45 = 0, $54 = 0, $59 = 0, $63 = 0, $64 = 0, $73 = 0, $78 = 0, $82 = 0, $83 = 0, $92 = 0, $97 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + if ((__ZNK6vision5Image4typeEv($1) | 0) != 1) { + $10 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 31302) | 0, 31153) | 0, 39072) | 0, 330) | 0, 39079) | 0, 31353) | 0; + __ZNKSt3__28ios_base6getlocEv($2, $10 + (HEAP32[(HEAP32[$10 >> 2] | 0) + -12 >> 2] | 0) | 0); + $15 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66512) | 0; + $19 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$15 >> 2] | 0) + 28 >> 2] & 127]($15, 10) | 0; + __ZNSt3__26localeD2Ev($2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($10, $19) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($10) | 0; + _abort(); + } + if ((__ZNK6vision5Image8channelsEv($1) | 0) != 1) { + $27 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 31377) | 0, 31153) | 0, 39072) | 0, 331) | 0, 39079) | 0, 31422) | 0; + __ZNKSt3__28ios_base6getlocEv($2, $27 + (HEAP32[(HEAP32[$27 >> 2] | 0) + -12 >> 2] | 0) | 0); + $32 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66512) | 0; + $36 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$32 >> 2] | 0) + 28 >> 2] & 127]($32, 10) | 0; + __ZNSt3__26localeD2Ev($2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($27, $36) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($27) | 0; + _abort(); + } + $37 = $0 + 4 | 0; + $43 = $0 + 16 | 0; + $45 = $0 + 20 | 0; + if (((HEAP32[$0 + 8 >> 2] | 0) - (HEAP32[$37 >> 2] | 0) >> 5 | 0) != (Math_imul(HEAP32[$45 >> 2] | 0, HEAP32[$43 >> 2] | 0) | 0)) { + $54 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 31448) | 0, 31153) | 0, 39072) | 0, 333) | 0, 39079) | 0, 31522) | 0; + __ZNKSt3__28ios_base6getlocEv($2, $54 + (HEAP32[(HEAP32[$54 >> 2] | 0) + -12 >> 2] | 0) | 0); + $59 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66512) | 0; + $63 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$59 >> 2] | 0) + 28 >> 2] & 127]($59, 10) | 0; + __ZNSt3__26localeD2Ev($2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($54, $63) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($54) | 0; + _abort(); + } + $64 = __ZNK6vision5Image5widthEv($1) | 0; + if (($64 | 0) != (__ZNK6vision5Image5widthEv(HEAP32[$37 >> 2] | 0) | 0)) { + $73 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 31557) | 0, 31153) | 0, 39072) | 0, 334) | 0, 39079) | 0, 31617) | 0; + __ZNKSt3__28ios_base6getlocEv($2, $73 + (HEAP32[(HEAP32[$73 >> 2] | 0) + -12 >> 2] | 0) | 0); + $78 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66512) | 0; + $82 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$78 >> 2] | 0) + 28 >> 2] & 127]($78, 10) | 0; + __ZNSt3__26localeD2Ev($2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($73, $82) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($73) | 0; + _abort(); + } + $83 = __ZNK6vision5Image6heightEv($1) | 0; + if (($83 | 0) != (__ZNK6vision5Image6heightEv(HEAP32[$37 >> 2] | 0) | 0)) { + $92 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 31649) | 0, 31153) | 0, 39072) | 0, 335) | 0, 39079) | 0, 31617) | 0; + __ZNKSt3__28ios_base6getlocEv($2, $92 + (HEAP32[(HEAP32[$92 >> 2] | 0) + -12 >> 2] | 0) | 0); + $97 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66512) | 0; + $101 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$97 >> 2] | 0) + 28 >> 2] & 127]($97, 10) | 0; + __ZNSt3__26localeD2Ev($2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($92, $101) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($92) | 0; + _abort(); + } + __ZN6vision18BinomialPyramid32f12apply_filterERNS_5ImageERKS1_($0, HEAP32[$37 >> 2] | 0, $1); + $103 = HEAP32[$37 >> 2] | 0; + __ZN6vision18BinomialPyramid32f12apply_filterERNS_5ImageERKS1_($0, $103 + 32 | 0, $103); + $105 = HEAP32[$37 >> 2] | 0; + __ZN6vision18BinomialPyramid32f18apply_filter_twiceERNS_5ImageERKS1_($0, $105 + 64 | 0, $105 + 32 | 0); + $$0 = 1; + while (1) { + if ($$0 >>> 0 >= (HEAP32[$43 >> 2] | 0) >>> 0) break; + $111 = Math_imul(HEAP32[$45 >> 2] | 0, $$0) | 0; + $114 = __ZN6vision5Image3getEv((HEAP32[$37 >> 2] | 0) + ($111 << 5) | 0) | 0; + $117 = (Math_imul(HEAP32[$45 >> 2] | 0, $$0) | 0) + -1 | 0; + $120 = __ZN6vision5Image3getEv((HEAP32[$37 >> 2] | 0) + ($117 << 5) | 0) | 0; + $123 = (Math_imul(HEAP32[$45 >> 2] | 0, $$0) | 0) + -1 | 0; + $126 = __ZNK6vision5Image5widthEv((HEAP32[$37 >> 2] | 0) + ($123 << 5) | 0) | 0; + $129 = (Math_imul(HEAP32[$45 >> 2] | 0, $$0) | 0) + -1 | 0; + __ZN6vision19downsample_bilinearEPfPKfmm($114, $120, $126, __ZNK6vision5Image6heightEv((HEAP32[$37 >> 2] | 0) + ($129 << 5) | 0) | 0); + $134 = Math_imul(HEAP32[$45 >> 2] | 0, $$0) | 0; + $136 = HEAP32[$37 >> 2] | 0; + __ZN6vision18BinomialPyramid32f12apply_filterERNS_5ImageERKS1_($0, $136 + ($134 + 1 << 5) | 0, $136 + ($134 << 5) | 0); + $140 = Math_imul(HEAP32[$45 >> 2] | 0, $$0) | 0; + $142 = HEAP32[$37 >> 2] | 0; + __ZN6vision18BinomialPyramid32f18apply_filter_twiceERNS_5ImageERKS1_($0, $142 + ($140 + 2 << 5) | 0, $142 + ($140 + 1 << 5) | 0); + $$0 = $$0 + 1 | 0; + } + STACKTOP = sp; + return; +} + +function _get_global_id_code($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0177 = 0, $$0178 = 0, $$0178$off = 0, $$0182 = 0, $$0189 = 0, $$0202 = 0, $$0204 = 0, $$1 = 0, $$10 = 0, $$10199 = 0, $$11 = 0, $$11200 = 0, $$1179 = 0, $$1183 = 0, $$1190 = 0, $$12 = 0, $$2 = 0, $$2180 = 0, $$2180$off = 0, $$2191 = 0, $$3 = 0, $$3181 = 0, $$3185 = 0, $$3192 = 0, $$4 = 0, $$4186 = 0, $$4186$off = 0, $$4193 = 0, $$5 = 0, $$5187 = 0, $$5194 = 0, $$6 = 0, $$6188 = 0, $$6188$off = 0, $$6195 = 0, $$7 = 0, $$7196 = 0, $$8 = 0, $$8197 = 0, $$9 = 0, $$9198 = 0, $109 = 0, $113 = 0, $118 = 0, $119 = 0, $120 = 0, $123 = 0, $133 = 0, $137 = 0, $144 = 0.0, $145 = 0, $148 = 0, $15 = 0, $153 = 0, $154 = 0, $19 = 0, $20 = 0, $24 = 0, $38 = 0, $49 = 0, $5 = 0, $50 = 0, $53 = 0, $6 = 0, $63 = 0, $67 = 0, $7 = 0, $71 = 0, $72 = 0, $73 = 0, $78 = 0, $8 = 0, $85 = 0, $89 = 0, $97 = 0, $or$cond229245 = 0, $trunc = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 160 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(160); + $5 = sp + 152 | 0; + $6 = sp + 128 | 0; + $7 = sp + 144 | 0; + $8 = sp; + HEAP32[$6 >> 2] = 0; + HEAP32[$6 + 4 >> 2] = 182; + HEAP32[$6 + 8 >> 2] = 195; + HEAP32[$6 + 12 >> 2] = 13; + $$0182 = 0; + $$0202 = 0; + $$0204 = -1; + while (1) { + if (($$0182 | 0) == 4) break; + $15 = HEAP8[$0 + (HEAP32[$6 + ($$0182 << 2) >> 2] | 0) >> 0] | 0; + $$0182 = $$0182 + 1 | 0; + $$0202 = ($15 & 255) > ($$0202 & 255) ? $15 : $$0202; + $$0204 = ($15 & 255) < ($$0204 & 255) ? $15 : $$0204; + } + $19 = $$0202 & 255; + $20 = $$0204 & 255; + L5 : do if (($19 - $20 | 0) >= 30) { + $24 = ($19 + $20 | 0) >>> 1; + $$1183 = 0; + while (1) { + if (($$1183 | 0) == 4) break; + HEAP8[$5 + $$1183 >> 0] = $24 >>> 0 > (HEAPU8[$0 + (HEAP32[$6 + ($$1183 << 2) >> 2] | 0) >> 0] | 0) >>> 0 & 1; + $$1183 = $$1183 + 1 | 0; + } + $trunc = 0; + while (1) { + if ($trunc >>> 0 >= 4) break; + $38 = $trunc + 1 | 0; + if (((HEAP8[$5 + $trunc >> 0] | 0) == 1 ? (HEAP8[$5 + ($38 & 3) >> 0] | 0) == 1 : 0) ? (HEAP8[$5 + ($trunc + 2 & 3) >> 0] | 0) == 0 : 0) break; + $trunc = $38; + } + L20 : do switch ($trunc & 2147483647 | 0) { + case 4: + { + HEAP32[$2 >> 2] = 0; + HEAPF64[$3 >> 3] = -1.0; + $$0177 = -3; + break L5; + break; + } + case 0: + { + $$0 = 119; + $$0178 = 0; + $$0189 = 255; + while (1) { + if (($$0178 | 0) == 14) { + $$12 = $$0189; + label = 57; + break L20; + } + $$0178$off = $$0178 + -3 | 0; + $49 = ($$0178 & 2147483646 | 0) == 12; + $50 = $$0178 * 14 | 0; + $$1 = $$0; + $$1190 = $$0189; + $$3185 = 0; + while (1) { + if (($$3185 | 0) == 14) break; + if ((($$3185 + -3 | $$0178$off) >>> 0 >= 8 ? ($53 = $$3185 & 2147483646, (($$3185 | $$0178) & 2147483646 | 0) != 0) : 0) ? !($49 & (($53 | 0) == 0 | ($53 | 0) == 12)) : 0) { + $63 = (HEAPU8[$0 + ($$3185 + $50) >> 0] | 0) - $24 | 0; + HEAP8[$8 + $$1 >> 0] = $63 >>> 31; + $67 = ($63 | 0) > -1 ? $63 : 0 - $63 | 0; + $$2 = $$1 + -1 | 0; + $$2191 = ($67 | 0) < ($$1190 | 0) ? $67 : $$1190; + } else { + $$2 = $$1; + $$2191 = $$1190; + } + $$1 = $$2; + $$1190 = $$2191; + $$3185 = $$3185 + 1 | 0; + } + $$0 = $$1; + $$0178 = $$0178 + 1 | 0; + $$0189 = $$1190; + } + break; + } + case 1: + { + $$3 = 119; + $$3192 = 255; + $$4186 = 0; + while (1) { + if (($$4186 | 0) == 14) { + $$12 = $$3192; + label = 57; + break L20; + } + $$4186$off = $$4186 + -3 | 0; + $71 = $$4186 & 2147483646; + $72 = ($71 | 0) == 0; + $73 = ($71 | 0) == 12; + $$1179 = 13; + $$4 = $$3; + $$4193 = $$3192; + while (1) { + if (($$1179 | 0) <= -1) break; + if ((($$1179 + -3 | $$4186$off) >>> 0 >= 8 ? ($78 = ($$1179 & -2 | 0) == 12, !($72 & $78)) : 0) ? !($73 & ($$1179 >>> 0 < 2 | $78)) : 0) { + $85 = (HEAPU8[$0 + (($$1179 * 14 | 0) + $$4186) >> 0] | 0) - $24 | 0; + HEAP8[$8 + $$4 >> 0] = $85 >>> 31; + $89 = ($85 | 0) > -1 ? $85 : 0 - $85 | 0; + $$5 = $$4 + -1 | 0; + $$5194 = ($89 | 0) < ($$4193 | 0) ? $89 : $$4193; + } else { + $$5 = $$4; + $$5194 = $$4193; + } + $$1179 = $$1179 + -1 | 0; + $$4 = $$5; + $$4193 = $$5194; + } + $$3 = $$4; + $$3192 = $$4193; + $$4186 = $$4186 + 1 | 0; + } + break; + } + case 2: + { + $$2180 = 13; + $$6 = 119; + $$6195 = 255; + while (1) { + if (($$2180 | 0) <= -1) { + $$12 = $$6195; + label = 57; + break L20; + } + $$2180$off = $$2180 + -3 | 0; + $or$cond229245 = $$2180 >>> 0 < 2 | ($$2180 & -2 | 0) == 12; + $97 = $$2180 * 14 | 0; + $$5187 = 13; + $$7 = $$6; + $$7196 = $$6195; + while (1) { + if (($$5187 | 0) <= -1) break; + if (($$5187 + -3 | $$2180$off) >>> 0 >= 8 ? !(($$5187 | $$2180) >>> 0 < 2 | $or$cond229245 & ($$5187 & -2 | 0) == 12) : 0) { + $109 = (HEAPU8[$0 + ($$5187 + $97) >> 0] | 0) - $24 | 0; + HEAP8[$8 + $$7 >> 0] = $109 >>> 31; + $113 = ($109 | 0) > -1 ? $109 : 0 - $109 | 0; + $$8 = $$7 + -1 | 0; + $$8197 = ($113 | 0) < ($$7196 | 0) ? $113 : $$7196; + } else { + $$8 = $$7; + $$8197 = $$7196; + } + $$5187 = $$5187 + -1 | 0; + $$7 = $$8; + $$7196 = $$8197; + } + $$2180 = $$2180 + -1 | 0; + $$6 = $$7; + $$6195 = $$7196; + } + break; + } + case 3: + { + $$6188 = 13; + $$9 = 119; + $$9198 = 255; + while (1) { + if (($$6188 | 0) <= -1) { + $$12 = $$9198; + label = 57; + break L20; + } + $$6188$off = $$6188 + -3 | 0; + $118 = $$6188 & -2; + $119 = ($118 | 0) == 12; + $120 = ($118 | 0) == 0; + $$10 = $$9; + $$10199 = $$9198; + $$3181 = 0; + while (1) { + if (($$3181 | 0) == 14) break; + if ((($$3181 + -3 | $$6188$off) >>> 0 >= 8 ? ($123 = $$3181 & 2147483646, !($119 & ($123 | 0) == 0)) : 0) ? !(($123 | $118 | 0) == 0 | $120 & ($123 | 0) == 12) : 0) { + $133 = (HEAPU8[$0 + (($$3181 * 14 | 0) + $$6188) >> 0] | 0) - $24 | 0; + HEAP8[$8 + $$10 >> 0] = $133 >>> 31; + $137 = ($133 | 0) > -1 ? $133 : 0 - $133 | 0; + $$11 = $$10 + -1 | 0; + $$11200 = ($137 | 0) < ($$10199 | 0) ? $137 : $$10199; + } else { + $$11 = $$10; + $$11200 = $$10199; + } + $$10 = $$11; + $$10199 = $$11200; + $$3181 = $$3181 + 1 | 0; + } + $$6188 = $$6188 + -1 | 0; + $$9 = $$10; + $$9198 = $$10199; + } + break; + } + default: + { + HEAP32[$2 >> 2] = $trunc; + $144 = 1.0; + } + } while (0); + if ((label | 0) == 57) { + HEAP32[$2 >> 2] = $trunc; + $144 = ($$12 | 0) > 30 ? 1.0 : +($$12 | 0) / 30.0; + } + HEAPF64[$3 >> 3] = $144; + $145 = _decode_bch(2830, 0, 0, $8, $7) | 0; + if (($145 | 0) < 0) $$0177 = -4; else { + if ($4 | 0) HEAP32[$4 >> 2] = $145; + $148 = $7; + $153 = HEAP32[$148 + 4 >> 2] | 0; + $154 = $1; + HEAP32[$154 >> 2] = HEAP32[$148 >> 2]; + HEAP32[$154 + 4 >> 2] = $153; + $$0177 = 0; + } + } else { + HEAP32[$2 >> 2] = 0; + HEAPF64[$3 >> 3] = -1.0; + $$0177 = -2; + } while (0); + STACKTOP = sp; + return $$0177 | 0; +} + +function _jpeg_idct_3x6($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $104 = 0, $105 = 0, $106 = 0, $112 = 0, $118 = 0, $124 = 0, $126 = 0, $129 = 0, $132 = 0, $135 = 0, $15 = 0, $159 = 0, $166 = 0, $167 = 0, $169 = 0, $176 = 0, $177 = 0, $178 = 0, $184 = 0, $190 = 0, $196 = 0, $198 = 0, $201 = 0, $204 = 0, $207 = 0, $209 = 0, $213 = 0, $218 = 0, $22 = 0, $223 = 0, $225 = 0, $228 = 0, $23 = 0, $230 = 0, $231 = 0, $233 = 0, $25 = 0, $252 = 0, $255 = 0, $257 = 0, $258 = 0, $261 = 0, $281 = 0, $284 = 0, $286 = 0, $287 = 0, $290 = 0, $310 = 0, $313 = 0, $315 = 0, $317 = 0, $318 = 0, $32 = 0, $321 = 0, $33 = 0, $34 = 0, $341 = 0, $344 = 0, $346 = 0, $348 = 0, $349 = 0, $352 = 0, $372 = 0, $375 = 0, $377 = 0, $379 = 0, $380 = 0, $383 = 0, $40 = 0, $46 = 0, $5 = 0, $52 = 0, $54 = 0, $57 = 0, $60 = 0, $63 = 0, $7 = 0, $70 = 0, $81 = 0, $87 = 0, $9 = 0, $94 = 0, $95 = 0, $97 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 80 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(80); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $9 = HEAP32[$1 + 84 >> 2] | 0; + $15 = Math_imul(HEAP16[$2 >> 1] << 13, HEAP32[$9 >> 2] | 0) | 0 | 1024; + $22 = Math_imul((HEAP16[$2 + 64 >> 1] | 0) * 5793 | 0, HEAP32[$9 + 128 >> 2] | 0) | 0; + $23 = $22 + $15 | 0; + $25 = (Math_imul($22, -2) | 0) + $15 >> 11; + $32 = Math_imul((HEAP16[$2 + 32 >> 1] | 0) * 10033 | 0, HEAP32[$9 + 64 >> 2] | 0) | 0; + $33 = $32 + $23 | 0; + $34 = $23 - $32 | 0; + $40 = Math_imul(HEAP32[$9 + 32 >> 2] | 0, HEAP16[$2 + 16 >> 1] | 0) | 0; + $46 = Math_imul(HEAP32[$9 + 96 >> 2] | 0, HEAP16[$2 + 48 >> 1] | 0) | 0; + $52 = Math_imul(HEAP32[$9 + 160 >> 2] | 0, HEAP16[$2 + 80 >> 1] | 0) | 0; + $54 = ($52 + $40 | 0) * 2998 | 0; + $57 = $54 + ($46 + $40 << 13) | 0; + $60 = $54 + ($52 - $46 << 13) | 0; + $63 = $40 - $46 - $52 << 2; + HEAP32[$5 >> 2] = $57 + $33 >> 11; + HEAP32[$5 + 60 >> 2] = $33 - $57 >> 11; + $70 = $5 + 12 | 0; + HEAP32[$70 >> 2] = $63 + $25; + HEAP32[$5 + 48 >> 2] = $25 - $63; + HEAP32[$5 + 24 >> 2] = $60 + $34 >> 11; + HEAP32[$5 + 36 >> 2] = $34 - $60 >> 11; + $81 = $5 + 4 | 0; + $87 = Math_imul(HEAP16[$2 + 2 >> 1] << 13, HEAP32[$9 + 4 >> 2] | 0) | 0 | 1024; + $94 = Math_imul((HEAP16[$2 + 66 >> 1] | 0) * 5793 | 0, HEAP32[$9 + 132 >> 2] | 0) | 0; + $95 = $94 + $87 | 0; + $97 = (Math_imul($94, -2) | 0) + $87 >> 11; + $104 = Math_imul((HEAP16[$2 + 34 >> 1] | 0) * 10033 | 0, HEAP32[$9 + 68 >> 2] | 0) | 0; + $105 = $104 + $95 | 0; + $106 = $95 - $104 | 0; + $112 = Math_imul(HEAP32[$9 + 36 >> 2] | 0, HEAP16[$2 + 18 >> 1] | 0) | 0; + $118 = Math_imul(HEAP32[$9 + 100 >> 2] | 0, HEAP16[$2 + 50 >> 1] | 0) | 0; + $124 = Math_imul(HEAP32[$9 + 164 >> 2] | 0, HEAP16[$2 + 82 >> 1] | 0) | 0; + $126 = ($124 + $112 | 0) * 2998 | 0; + $129 = $126 + ($118 + $112 << 13) | 0; + $132 = $126 + ($124 - $118 << 13) | 0; + $135 = $112 - $118 - $124 << 2; + HEAP32[$81 >> 2] = $129 + $105 >> 11; + HEAP32[$5 + 64 >> 2] = $105 - $129 >> 11; + HEAP32[$5 + 16 >> 2] = $135 + $97; + HEAP32[$5 + 52 >> 2] = $97 - $135; + HEAP32[$5 + 28 >> 2] = $132 + $106 >> 11; + HEAP32[$5 + 40 >> 2] = $106 - $132 >> 11; + $159 = Math_imul(HEAP16[$2 + 4 >> 1] << 13, HEAP32[$9 + 8 >> 2] | 0) | 0 | 1024; + $166 = Math_imul((HEAP16[$2 + 68 >> 1] | 0) * 5793 | 0, HEAP32[$9 + 136 >> 2] | 0) | 0; + $167 = $166 + $159 | 0; + $169 = (Math_imul($166, -2) | 0) + $159 >> 11; + $176 = Math_imul((HEAP16[$2 + 36 >> 1] | 0) * 10033 | 0, HEAP32[$9 + 72 >> 2] | 0) | 0; + $177 = $176 + $167 | 0; + $178 = $167 - $176 | 0; + $184 = Math_imul(HEAP32[$9 + 40 >> 2] | 0, HEAP16[$2 + 20 >> 1] | 0) | 0; + $190 = Math_imul(HEAP32[$9 + 104 >> 2] | 0, HEAP16[$2 + 52 >> 1] | 0) | 0; + $196 = Math_imul(HEAP32[$9 + 168 >> 2] | 0, HEAP16[$2 + 84 >> 1] | 0) | 0; + $198 = ($196 + $184 | 0) * 2998 | 0; + $201 = $198 + ($190 + $184 << 13) | 0; + $204 = $198 + ($196 - $190 << 13) | 0; + $207 = $184 - $190 - $196 << 2; + $209 = $201 + $177 >> 11; + HEAP32[$5 + 8 >> 2] = $209; + HEAP32[$5 + 68 >> 2] = $177 - $201 >> 11; + $213 = $207 + $169 | 0; + HEAP32[$5 + 20 >> 2] = $213; + HEAP32[$5 + 56 >> 2] = $169 - $207; + $218 = $204 + $178 >> 11; + HEAP32[$5 + 32 >> 2] = $218; + HEAP32[$5 + 44 >> 2] = $178 - $204 >> 11; + $223 = $7 + -384 | 0; + $225 = (HEAP32[$3 >> 2] | 0) + $4 | 0; + $228 = (HEAP32[$5 >> 2] << 13) + 134348800 | 0; + $230 = $228 + ($209 * 5793 | 0) | 0; + $231 = (Math_imul($209, -11586) | 0) + $228 | 0; + $233 = (HEAP32[$81 >> 2] | 0) * 10033 | 0; + HEAP8[$225 >> 0] = HEAP8[$223 + (($230 + $233 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$225 + 2 >> 0] = HEAP8[$223 + (($230 - $233 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$225 + 1 >> 0] = HEAP8[$223 + ($231 >>> 18 & 1023) >> 0] | 0; + $252 = (HEAP32[$3 + 4 >> 2] | 0) + $4 | 0; + $255 = (HEAP32[$70 >> 2] << 13) + 134348800 | 0; + $257 = $255 + ($213 * 5793 | 0) | 0; + $258 = (Math_imul($213, -11586) | 0) + $255 | 0; + $261 = (HEAP32[$5 + 16 >> 2] | 0) * 10033 | 0; + HEAP8[$252 >> 0] = HEAP8[$223 + (($257 + $261 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$252 + 2 >> 0] = HEAP8[$223 + (($257 - $261 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$252 + 1 >> 0] = HEAP8[$223 + ($258 >>> 18 & 1023) >> 0] | 0; + $281 = (HEAP32[$3 + 8 >> 2] | 0) + $4 | 0; + $284 = (HEAP32[$5 + 24 >> 2] << 13) + 134348800 | 0; + $286 = $284 + ($218 * 5793 | 0) | 0; + $287 = (Math_imul($218, -11586) | 0) + $284 | 0; + $290 = (HEAP32[$5 + 28 >> 2] | 0) * 10033 | 0; + HEAP8[$281 >> 0] = HEAP8[$223 + (($286 + $290 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$281 + 2 >> 0] = HEAP8[$223 + (($286 - $290 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$281 + 1 >> 0] = HEAP8[$223 + ($287 >>> 18 & 1023) >> 0] | 0; + $310 = (HEAP32[$3 + 12 >> 2] | 0) + $4 | 0; + $313 = (HEAP32[$5 + 36 >> 2] << 13) + 134348800 | 0; + $315 = HEAP32[$5 + 44 >> 2] | 0; + $317 = $313 + ($315 * 5793 | 0) | 0; + $318 = (Math_imul($315, -11586) | 0) + $313 | 0; + $321 = (HEAP32[$5 + 40 >> 2] | 0) * 10033 | 0; + HEAP8[$310 >> 0] = HEAP8[$223 + (($317 + $321 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$310 + 2 >> 0] = HEAP8[$223 + (($317 - $321 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$310 + 1 >> 0] = HEAP8[$223 + ($318 >>> 18 & 1023) >> 0] | 0; + $341 = (HEAP32[$3 + 16 >> 2] | 0) + $4 | 0; + $344 = (HEAP32[$5 + 48 >> 2] << 13) + 134348800 | 0; + $346 = HEAP32[$5 + 56 >> 2] | 0; + $348 = $344 + ($346 * 5793 | 0) | 0; + $349 = (Math_imul($346, -11586) | 0) + $344 | 0; + $352 = (HEAP32[$5 + 52 >> 2] | 0) * 10033 | 0; + HEAP8[$341 >> 0] = HEAP8[$223 + (($348 + $352 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$341 + 2 >> 0] = HEAP8[$223 + (($348 - $352 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$341 + 1 >> 0] = HEAP8[$223 + ($349 >>> 18 & 1023) >> 0] | 0; + $372 = (HEAP32[$3 + 20 >> 2] | 0) + $4 | 0; + $375 = (HEAP32[$5 + 60 >> 2] << 13) + 134348800 | 0; + $377 = HEAP32[$5 + 68 >> 2] | 0; + $379 = $375 + ($377 * 5793 | 0) | 0; + $380 = (Math_imul($377, -11586) | 0) + $375 | 0; + $383 = (HEAP32[$5 + 64 >> 2] | 0) * 10033 | 0; + HEAP8[$372 >> 0] = HEAP8[$223 + (($379 + $383 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$372 + 2 >> 0] = HEAP8[$223 + (($379 - $383 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$372 + 1 >> 0] = HEAP8[$223 + ($380 >>> 18 & 1023) >> 0] | 0; + STACKTOP = sp; + return; +} + +function _update_box($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$lcssa = 0, $$0200513 = 0, $$0204522 = 0, $$0211517 = 0, $$0218 = 0, $$0219 = 0, $$0220 = 0, $$0221 = 0, $$0222 = 0, $$0223 = 0, $$0224512 = 0, $$0252 = 0, $$1201471 = 0, $$1205480 = 0, $$1212475 = 0, $$1225470 = 0, $$1246 = 0, $$2202429 = 0, $$2206433 = 0, $$2213438 = 0, $$2226428 = 0, $$2244 = 0, $$3203387 = 0, $$3207391 = 0, $$3214396 = 0, $$3227386 = 0, $$4208349 = 0, $$4215344 = 0, $$4228354 = 0, $$4345 = 0, $$5209308 = 0, $$5216303 = 0, $$5229312 = 0, $$5304 = 0, $$6210251 = 0, $$6217245 = 0, $$6230242 = 0, $$6243 = 0, $10 = 0, $108 = 0, $11 = 0, $110 = 0, $112 = 0, $117 = 0, $12 = 0, $123 = 0, $13 = 0, $135 = 0, $14 = 0, $15 = 0, $16 = 0, $21 = 0, $36 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0; + $5 = HEAP32[(HEAP32[$0 + 484 >> 2] | 0) + 24 >> 2] | 0; + $6 = HEAP32[$1 >> 2] | 0; + $7 = $1 + 4 | 0; + $8 = HEAP32[$7 >> 2] | 0; + $9 = $1 + 8 | 0; + $10 = HEAP32[$9 >> 2] | 0; + $11 = $1 + 12 | 0; + $12 = HEAP32[$11 >> 2] | 0; + $13 = $1 + 16 | 0; + $14 = HEAP32[$13 >> 2] | 0; + $15 = $1 + 20 | 0; + $16 = HEAP32[$15 >> 2] | 0; + L1 : do if (($8 | 0) <= ($6 | 0) | ($10 | 0) > ($12 | 0) | ($14 | 0) > ($16 | 0)) $$0223 = $6; else { + $$0204522 = $6; + L3 : while (1) { + $21 = HEAP32[$5 + ($$0204522 << 2) >> 2] | 0; + $$0211517 = $10; + while (1) { + $$0200513 = $21 + ($$0211517 << 6) + ($14 << 1) | 0; + $$0224512 = $14; + while (1) { + if (HEAP16[$$0200513 >> 1] | 0) break L3; + if (($$0224512 | 0) < ($16 | 0)) { + $$0200513 = $$0200513 + 2 | 0; + $$0224512 = $$0224512 + 1 | 0; + } else break; + } + if (($$0211517 | 0) < ($12 | 0)) $$0211517 = $$0211517 + 1 | 0; else break; + } + if (($$0204522 | 0) < ($8 | 0)) $$0204522 = $$0204522 + 1 | 0; else { + $$0223 = $6; + break L1; + } + } + HEAP32[$1 >> 2] = $$0204522; + $$0223 = $$0204522; + } while (0); + L14 : do if (($8 | 0) <= ($$0223 | 0) | ($10 | 0) > ($12 | 0) | ($14 | 0) > ($16 | 0)) $$0222 = $8; else { + $$1205480 = $8; + L16 : while (1) { + $36 = HEAP32[$5 + ($$1205480 << 2) >> 2] | 0; + $$1212475 = $10; + while (1) { + $$1201471 = $36 + ($$1212475 << 6) + ($14 << 1) | 0; + $$1225470 = $14; + while (1) { + if (HEAP16[$$1201471 >> 1] | 0) break L16; + if (($$1225470 | 0) < ($16 | 0)) { + $$1201471 = $$1201471 + 2 | 0; + $$1225470 = $$1225470 + 1 | 0; + } else break; + } + if (($$1212475 | 0) < ($12 | 0)) $$1212475 = $$1212475 + 1 | 0; else break; + } + if (($$1205480 | 0) > ($$0223 | 0)) $$1205480 = $$1205480 + -1 | 0; else { + $$0222 = $8; + break L14; + } + } + HEAP32[$7 >> 2] = $$1205480; + $$0222 = $$1205480; + } while (0); + L27 : do if (($12 | 0) <= ($10 | 0) | ($$0222 | 0) < ($$0223 | 0) | ($14 | 0) > ($16 | 0)) $$0221 = $10; else { + $$2213438 = $10; + L29 : while (1) { + $$2206433 = $$0223; + while (1) { + $$2202429 = (HEAP32[$5 + ($$2206433 << 2) >> 2] | 0) + ($$2213438 << 6) + ($14 << 1) | 0; + $$2226428 = $14; + while (1) { + if (HEAP16[$$2202429 >> 1] | 0) break L29; + if (($$2226428 | 0) < ($16 | 0)) { + $$2202429 = $$2202429 + 2 | 0; + $$2226428 = $$2226428 + 1 | 0; + } else break; + } + if (($$2206433 | 0) < ($$0222 | 0)) $$2206433 = $$2206433 + 1 | 0; else break; + } + if (($$2213438 | 0) < ($12 | 0)) $$2213438 = $$2213438 + 1 | 0; else { + $$0221 = $10; + break L27; + } + } + HEAP32[$9 >> 2] = $$2213438; + $$0221 = $$2213438; + } while (0); + L40 : do if (($12 | 0) <= ($$0221 | 0) | ($$0222 | 0) < ($$0223 | 0) | ($14 | 0) > ($16 | 0)) $$0220 = $12; else { + $$3214396 = $12; + L42 : while (1) { + $$3207391 = $$0223; + while (1) { + $$3203387 = (HEAP32[$5 + ($$3207391 << 2) >> 2] | 0) + ($$3214396 << 6) + ($14 << 1) | 0; + $$3227386 = $14; + while (1) { + if (HEAP16[$$3203387 >> 1] | 0) break L42; + if (($$3227386 | 0) < ($16 | 0)) { + $$3203387 = $$3203387 + 2 | 0; + $$3227386 = $$3227386 + 1 | 0; + } else break; + } + if (($$3207391 | 0) < ($$0222 | 0)) $$3207391 = $$3207391 + 1 | 0; else break; + } + if (($$3214396 | 0) > ($$0221 | 0)) $$3214396 = $$3214396 + -1 | 0; else { + $$0220 = $12; + break L40; + } + } + HEAP32[$11 >> 2] = $$3214396; + $$0220 = $$3214396; + } while (0); + L53 : do if (($16 | 0) <= ($14 | 0) | ($$0222 | 0) < ($$0223 | 0) | ($$0220 | 0) < ($$0221 | 0)) $$0219 = $14; else { + $$4228354 = $14; + L55 : while (1) { + $$4208349 = $$0223; + while (1) { + $$4215344 = $$0221; + $$4345 = (HEAP32[$5 + ($$4208349 << 2) >> 2] | 0) + ($$0221 << 6) + ($$4228354 << 1) | 0; + while (1) { + if (HEAP16[$$4345 >> 1] | 0) break L55; + if (($$4215344 | 0) < ($$0220 | 0)) { + $$4215344 = $$4215344 + 1 | 0; + $$4345 = $$4345 + 64 | 0; + } else break; + } + if (($$4208349 | 0) < ($$0222 | 0)) $$4208349 = $$4208349 + 1 | 0; else break; + } + if (($$4228354 | 0) < ($16 | 0)) $$4228354 = $$4228354 + 1 | 0; else { + $$0219 = $14; + break L53; + } + } + HEAP32[$13 >> 2] = $$4228354; + $$0219 = $$4228354; + } while (0); + L66 : do if (($16 | 0) <= ($$0219 | 0) | ($$0222 | 0) < ($$0223 | 0) | ($$0220 | 0) < ($$0221 | 0)) $$0218 = $16; else { + $$5229312 = $16; + L68 : while (1) { + $$5209308 = $$0223; + while (1) { + $$5216303 = $$0221; + $$5304 = (HEAP32[$5 + ($$5209308 << 2) >> 2] | 0) + ($$0221 << 6) + ($$5229312 << 1) | 0; + while (1) { + if (HEAP16[$$5304 >> 1] | 0) break L68; + if (($$5216303 | 0) < ($$0220 | 0)) { + $$5216303 = $$5216303 + 1 | 0; + $$5304 = $$5304 + 64 | 0; + } else break; + } + if (($$5209308 | 0) < ($$0222 | 0)) $$5209308 = $$5209308 + 1 | 0; else break; + } + if (($$5229312 | 0) > ($$0219 | 0)) $$5229312 = $$5229312 + -1 | 0; else { + $$0218 = $16; + break L66; + } + } + HEAP32[$15 >> 2] = $$5229312; + $$0218 = $$5229312; + } while (0); + $108 = $$0222 - $$0223 << 4; + $110 = ($$0220 - $$0221 | 0) * 12 | 0; + $112 = $$0218 - $$0219 << 3; + $117 = (Math_imul($110, $110) | 0) + (Math_imul($108, $108) | 0) + (Math_imul($112, $112) | 0) | 0; + HEAP32[$1 + 24 >> 2] = $117; + if (($$0222 | 0) < ($$0223 | 0) | ($$0220 | 0) < ($$0221 | 0) | ($$0218 | 0) < ($$0219 | 0)) { + $$0$lcssa = 0; + $135 = $1 + 28 | 0; + HEAP32[$135 >> 2] = $$0$lcssa; + return; + } + $$0252 = 0; + $$6210251 = $$0223; + while (1) { + $123 = HEAP32[$5 + ($$6210251 << 2) >> 2] | 0; + $$1246 = $$0252; + $$6217245 = $$0221; + while (1) { + $$2244 = $$1246; + $$6230242 = $$0219; + $$6243 = $123 + ($$6217245 << 6) + ($$0219 << 1) | 0; + while (1) { + $$2244 = $$2244 + ((HEAP16[$$6243 >> 1] | 0) != 0 & 1) | 0; + if (($$6230242 | 0) >= ($$0218 | 0)) break; else { + $$6230242 = $$6230242 + 1 | 0; + $$6243 = $$6243 + 2 | 0; + } + } + if (($$6217245 | 0) < ($$0220 | 0)) { + $$1246 = $$2244; + $$6217245 = $$6217245 + 1 | 0; + } else break; + } + if (($$6210251 | 0) < ($$0222 | 0)) { + $$0252 = $$2244; + $$6210251 = $$6210251 + 1 | 0; + } else { + $$0$lcssa = $$2244; + break; + } + } + $135 = $1 + 28 | 0; + HEAP32[$135 >> 2] = $$0$lcssa; + return; +} + +function _jpeg_idct_13x13($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0330339 = 0, $$0332338 = 0, $$0333337 = 0, $$0340 = 0, $$1331335 = 0, $$1336 = 0, $101 = 0, $107 = 0, $110 = 0, $115 = 0, $116 = 0, $117 = 0, $123 = 0, $125 = 0, $129 = 0, $15 = 0, $171 = 0, $174 = 0, $177 = 0, $179 = 0, $181 = 0, $183 = 0, $184 = 0, $185 = 0, $186 = 0, $188 = 0, $191 = 0, $194 = 0, $195 = 0, $197 = 0, $200 = 0, $203 = 0, $204 = 0, $206 = 0, $209 = 0, $21 = 0, $212 = 0, $217 = 0, $219 = 0, $221 = 0, $223 = 0, $225 = 0, $227 = 0, $228 = 0, $229 = 0, $233 = 0, $235 = 0, $241 = 0, $244 = 0, $249 = 0, $250 = 0, $251 = 0, $257 = 0, $259 = 0, $263 = 0, $27 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $38 = 0, $41 = 0, $44 = 0, $45 = 0, $47 = 0, $5 = 0, $50 = 0, $53 = 0, $54 = 0, $56 = 0, $59 = 0, $62 = 0, $7 = 0, $71 = 0, $77 = 0, $83 = 0, $89 = 0, $91 = 0, $93 = 0, $94 = 0, $95 = 0, $99 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 416 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(416); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0330339 = $5; + $$0332338 = HEAP32[$1 + 84 >> 2] | 0; + $$0333337 = $2; + $$0340 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0333337 >> 1] << 13, HEAP32[$$0332338 >> 2] | 0) | 0 | 1024; + $21 = Math_imul(HEAP32[$$0332338 + 64 >> 2] | 0, HEAP16[$$0333337 + 32 >> 1] | 0) | 0; + $27 = Math_imul(HEAP32[$$0332338 + 128 >> 2] | 0, HEAP16[$$0333337 + 64 >> 1] | 0) | 0; + $33 = Math_imul(HEAP32[$$0332338 + 192 >> 2] | 0, HEAP16[$$0333337 + 96 >> 1] | 0) | 0; + $34 = $33 + $27 | 0; + $35 = $27 - $33 | 0; + $36 = $34 * 9465 | 0; + $38 = ($35 * 793 | 0) + $15 | 0; + $41 = $36 + ($21 * 11249 | 0) + $38 | 0; + $44 = ($21 * 4108 | 0) - $36 + $38 | 0; + $45 = $34 * 2592 | 0; + $47 = ($35 * 3989 | 0) + $15 | 0; + $50 = ($21 * 8672 | 0) - $45 + $47 | 0; + $53 = $45 + (Math_imul($21, -10258) | 0) + $47 | 0; + $54 = $34 * 3570 | 0; + $56 = $15 + (Math_imul($35, -7678) | 0) | 0; + $59 = (Math_imul($21, -1396) | 0) - $54 + $56 | 0; + $62 = $54 + (Math_imul($21, -6581) | 0) + $56 | 0; + $71 = Math_imul(HEAP32[$$0332338 + 32 >> 2] | 0, HEAP16[$$0333337 + 16 >> 1] | 0) | 0; + $77 = Math_imul(HEAP32[$$0332338 + 96 >> 2] | 0, HEAP16[$$0333337 + 48 >> 1] | 0) | 0; + $83 = Math_imul(HEAP32[$$0332338 + 160 >> 2] | 0, HEAP16[$$0333337 + 80 >> 1] | 0) | 0; + $89 = Math_imul(HEAP32[$$0332338 + 224 >> 2] | 0, HEAP16[$$0333337 + 112 >> 1] | 0) | 0; + $91 = ($77 + $71 | 0) * 10832 | 0; + $93 = ($83 + $71 | 0) * 9534 | 0; + $94 = $89 + $71 | 0; + $95 = $94 * 7682 | 0; + $99 = $91 + (Math_imul($71, -16549) | 0) + $93 + $95 | 0; + $101 = Math_imul($83 + $77 | 0, -2773) | 0; + $107 = Math_imul($89 + $77 | 0, -9534) | 0; + $110 = $91 + ($77 * 6859 | 0) + $101 + $107 | 0; + $115 = Math_imul($89 + $83 | 0, -5384) | 0; + $116 = $101 + (Math_imul($83, -12879) | 0) + $93 + $115 | 0; + $117 = $107 + ($89 * 18068 | 0) + $95 + $115 | 0; + $123 = ($94 * 2773 | 0) + (($83 - $77 | 0) * 7682 | 0) | 0; + $125 = $123 + ($71 * 2611 | 0) + (Math_imul($77, -3818) | 0) | 0; + $129 = $123 + ($83 * 3150 | 0) + (Math_imul($89, -14273) | 0) | 0; + HEAP32[$$0330339 >> 2] = $99 + $41 >> 11; + HEAP32[$$0330339 + 384 >> 2] = $41 - $99 >> 11; + HEAP32[$$0330339 + 32 >> 2] = $110 + $50 >> 11; + HEAP32[$$0330339 + 352 >> 2] = $50 - $110 >> 11; + HEAP32[$$0330339 + 64 >> 2] = $116 + $44 >> 11; + HEAP32[$$0330339 + 320 >> 2] = $44 - $116 >> 11; + HEAP32[$$0330339 + 96 >> 2] = $117 + $59 >> 11; + HEAP32[$$0330339 + 288 >> 2] = $59 - $117 >> 11; + HEAP32[$$0330339 + 128 >> 2] = $125 + $62 >> 11; + HEAP32[$$0330339 + 256 >> 2] = $62 - $125 >> 11; + HEAP32[$$0330339 + 160 >> 2] = $129 + $53 >> 11; + HEAP32[$$0330339 + 224 >> 2] = $53 - $129 >> 11; + HEAP32[$$0330339 + 192 >> 2] = (($35 - $21 | 0) * 11585 | 0) + $15 >> 11; + $$0340 = $$0340 + 1 | 0; + if (($$0340 | 0) == 8) break; else { + $$0330339 = $$0330339 + 4 | 0; + $$0332338 = $$0332338 + 4 | 0; + $$0333337 = $$0333337 + 2 | 0; + } + } + $171 = $7 + -384 | 0; + $$1331335 = $5; + $$1336 = 0; + while (1) { + $174 = (HEAP32[$3 + ($$1336 << 2) >> 2] | 0) + $4 | 0; + $177 = (HEAP32[$$1331335 >> 2] << 13) + 134348800 | 0; + $179 = HEAP32[$$1331335 + 8 >> 2] | 0; + $181 = HEAP32[$$1331335 + 16 >> 2] | 0; + $183 = HEAP32[$$1331335 + 24 >> 2] | 0; + $184 = $183 + $181 | 0; + $185 = $181 - $183 | 0; + $186 = $184 * 9465 | 0; + $188 = ($185 * 793 | 0) + $177 | 0; + $191 = $186 + ($179 * 11249 | 0) + $188 | 0; + $194 = ($179 * 4108 | 0) - $186 + $188 | 0; + $195 = $184 * 2592 | 0; + $197 = ($185 * 3989 | 0) + $177 | 0; + $200 = ($179 * 8672 | 0) - $195 + $197 | 0; + $203 = $195 + (Math_imul($179, -10258) | 0) + $197 | 0; + $204 = $184 * 3570 | 0; + $206 = $177 + (Math_imul($185, -7678) | 0) | 0; + $209 = (Math_imul($179, -1396) | 0) - $204 + $206 | 0; + $212 = $204 + (Math_imul($179, -6581) | 0) + $206 | 0; + $217 = HEAP32[$$1331335 + 4 >> 2] | 0; + $219 = HEAP32[$$1331335 + 12 >> 2] | 0; + $221 = HEAP32[$$1331335 + 20 >> 2] | 0; + $223 = HEAP32[$$1331335 + 28 >> 2] | 0; + $225 = ($219 + $217 | 0) * 10832 | 0; + $227 = ($221 + $217 | 0) * 9534 | 0; + $228 = $223 + $217 | 0; + $229 = $228 * 7682 | 0; + $233 = $225 + (Math_imul($217, -16549) | 0) + $227 + $229 | 0; + $235 = Math_imul($221 + $219 | 0, -2773) | 0; + $241 = Math_imul($223 + $219 | 0, -9534) | 0; + $244 = $225 + ($219 * 6859 | 0) + $235 + $241 | 0; + $249 = Math_imul($223 + $221 | 0, -5384) | 0; + $250 = $235 + (Math_imul($221, -12879) | 0) + $227 + $249 | 0; + $251 = $241 + ($223 * 18068 | 0) + $229 + $249 | 0; + $257 = ($228 * 2773 | 0) + (($221 - $219 | 0) * 7682 | 0) | 0; + $259 = $257 + ($217 * 2611 | 0) + (Math_imul($219, -3818) | 0) | 0; + $263 = $257 + ($221 * 3150 | 0) + (Math_imul($223, -14273) | 0) | 0; + HEAP8[$174 >> 0] = HEAP8[$171 + (($233 + $191 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$174 + 12 >> 0] = HEAP8[$171 + (($191 - $233 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$174 + 1 >> 0] = HEAP8[$171 + (($244 + $200 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$174 + 11 >> 0] = HEAP8[$171 + (($200 - $244 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$174 + 2 >> 0] = HEAP8[$171 + (($250 + $194 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$174 + 10 >> 0] = HEAP8[$171 + (($194 - $250 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$174 + 3 >> 0] = HEAP8[$171 + (($251 + $209 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$174 + 9 >> 0] = HEAP8[$171 + (($209 - $251 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$174 + 4 >> 0] = HEAP8[$171 + (($259 + $212 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$174 + 8 >> 0] = HEAP8[$171 + (($212 - $259 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$174 + 5 >> 0] = HEAP8[$171 + (($263 + $203 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$174 + 7 >> 0] = HEAP8[$171 + (($203 - $263 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$174 + 6 >> 0] = HEAP8[$171 + (((($185 - $179 | 0) * 11585 | 0) + $177 | 0) >>> 18 & 1023) >> 0] | 0; + $$1336 = $$1336 + 1 | 0; + if (($$1336 | 0) == 13) break; else $$1331335 = $$1331335 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function _jpeg_idct_6x3($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $111 = 0, $118 = 0, $119 = 0, $120 = 0, $127 = 0, $143 = 0, $15 = 0, $150 = 0, $151 = 0, $152 = 0, $159 = 0, $175 = 0, $182 = 0, $183 = 0, $184 = 0, $191 = 0, $197 = 0, $199 = 0, $201 = 0, $204 = 0, $207 = 0, $208 = 0, $210 = 0, $213 = 0, $214 = 0, $215 = 0, $216 = 0, $218 = 0, $22 = 0, $220 = 0, $222 = 0, $225 = 0, $228 = 0, $23 = 0, $231 = 0, $24 = 0, $269 = 0, $272 = 0, $275 = 0, $276 = 0, $278 = 0, $281 = 0, $282 = 0, $283 = 0, $285 = 0, $287 = 0, $289 = 0, $292 = 0, $295 = 0, $298 = 0, $31 = 0, $337 = 0, $340 = 0, $343 = 0, $344 = 0, $346 = 0, $349 = 0, $350 = 0, $351 = 0, $353 = 0, $355 = 0, $357 = 0, $359 = 0, $362 = 0, $365 = 0, $368 = 0, $38 = 0, $41 = 0, $47 = 0, $5 = 0, $54 = 0, $55 = 0, $56 = 0, $63 = 0, $7 = 0, $79 = 0, $86 = 0, $87 = 0, $88 = 0, $9 = 0, $95 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 80 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(80); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $9 = HEAP32[$1 + 84 >> 2] | 0; + $15 = Math_imul(HEAP16[$2 >> 1] << 13, HEAP32[$9 >> 2] | 0) | 0 | 1024; + $22 = Math_imul((HEAP16[$2 + 32 >> 1] | 0) * 5793 | 0, HEAP32[$9 + 64 >> 2] | 0) | 0; + $23 = $22 + $15 | 0; + $24 = (Math_imul($22, -2) | 0) + $15 | 0; + $31 = Math_imul((HEAP16[$2 + 16 >> 1] | 0) * 10033 | 0, HEAP32[$9 + 32 >> 2] | 0) | 0; + HEAP32[$5 >> 2] = $31 + $23 >> 11; + HEAP32[$5 + 48 >> 2] = $23 - $31 >> 11; + $38 = $5 + 24 | 0; + HEAP32[$38 >> 2] = $24 >> 11; + $41 = $5 + 4 | 0; + $47 = Math_imul(HEAP16[$2 + 2 >> 1] << 13, HEAP32[$9 + 4 >> 2] | 0) | 0 | 1024; + $54 = Math_imul((HEAP16[$2 + 34 >> 1] | 0) * 5793 | 0, HEAP32[$9 + 68 >> 2] | 0) | 0; + $55 = $54 + $47 | 0; + $56 = (Math_imul($54, -2) | 0) + $47 | 0; + $63 = Math_imul((HEAP16[$2 + 18 >> 1] | 0) * 10033 | 0, HEAP32[$9 + 36 >> 2] | 0) | 0; + HEAP32[$41 >> 2] = $63 + $55 >> 11; + HEAP32[$5 + 52 >> 2] = $55 - $63 >> 11; + HEAP32[$5 + 28 >> 2] = $56 >> 11; + $79 = Math_imul(HEAP16[$2 + 4 >> 1] << 13, HEAP32[$9 + 8 >> 2] | 0) | 0 | 1024; + $86 = Math_imul((HEAP16[$2 + 36 >> 1] | 0) * 5793 | 0, HEAP32[$9 + 72 >> 2] | 0) | 0; + $87 = $86 + $79 | 0; + $88 = (Math_imul($86, -2) | 0) + $79 | 0; + $95 = Math_imul((HEAP16[$2 + 20 >> 1] | 0) * 10033 | 0, HEAP32[$9 + 40 >> 2] | 0) | 0; + HEAP32[$5 + 8 >> 2] = $95 + $87 >> 11; + HEAP32[$5 + 56 >> 2] = $87 - $95 >> 11; + HEAP32[$5 + 32 >> 2] = $88 >> 11; + $111 = Math_imul(HEAP16[$2 + 6 >> 1] << 13, HEAP32[$9 + 12 >> 2] | 0) | 0 | 1024; + $118 = Math_imul((HEAP16[$2 + 38 >> 1] | 0) * 5793 | 0, HEAP32[$9 + 76 >> 2] | 0) | 0; + $119 = $118 + $111 | 0; + $120 = (Math_imul($118, -2) | 0) + $111 | 0; + $127 = Math_imul((HEAP16[$2 + 22 >> 1] | 0) * 10033 | 0, HEAP32[$9 + 44 >> 2] | 0) | 0; + HEAP32[$5 + 12 >> 2] = $127 + $119 >> 11; + HEAP32[$5 + 60 >> 2] = $119 - $127 >> 11; + HEAP32[$5 + 36 >> 2] = $120 >> 11; + $143 = Math_imul(HEAP16[$2 + 8 >> 1] << 13, HEAP32[$9 + 16 >> 2] | 0) | 0 | 1024; + $150 = Math_imul((HEAP16[$2 + 40 >> 1] | 0) * 5793 | 0, HEAP32[$9 + 80 >> 2] | 0) | 0; + $151 = $150 + $143 | 0; + $152 = (Math_imul($150, -2) | 0) + $143 | 0; + $159 = Math_imul((HEAP16[$2 + 24 >> 1] | 0) * 10033 | 0, HEAP32[$9 + 48 >> 2] | 0) | 0; + HEAP32[$5 + 16 >> 2] = $159 + $151 >> 11; + HEAP32[$5 + 64 >> 2] = $151 - $159 >> 11; + HEAP32[$5 + 40 >> 2] = $152 >> 11; + $175 = Math_imul(HEAP16[$2 + 10 >> 1] << 13, HEAP32[$9 + 20 >> 2] | 0) | 0 | 1024; + $182 = Math_imul((HEAP16[$2 + 42 >> 1] | 0) * 5793 | 0, HEAP32[$9 + 84 >> 2] | 0) | 0; + $183 = $182 + $175 | 0; + $184 = (Math_imul($182, -2) | 0) + $175 | 0; + $191 = Math_imul((HEAP16[$2 + 26 >> 1] | 0) * 10033 | 0, HEAP32[$9 + 52 >> 2] | 0) | 0; + HEAP32[$5 + 20 >> 2] = $191 + $183 >> 11; + HEAP32[$5 + 68 >> 2] = $183 - $191 >> 11; + $197 = $184 >> 11; + HEAP32[$5 + 44 >> 2] = $197; + $199 = $7 + -384 | 0; + $201 = (HEAP32[$3 >> 2] | 0) + $4 | 0; + $204 = (HEAP32[$5 >> 2] << 13) + 134348800 | 0; + $207 = (HEAP32[$5 + 16 >> 2] | 0) * 5793 | 0; + $208 = $204 + $207 | 0; + $210 = $204 - $207 - $207 | 0; + $213 = (HEAP32[$5 + 8 >> 2] | 0) * 10033 | 0; + $214 = $208 + $213 | 0; + $215 = $208 - $213 | 0; + $216 = HEAP32[$41 >> 2] | 0; + $218 = HEAP32[$5 + 12 >> 2] | 0; + $220 = HEAP32[$5 + 20 >> 2] | 0; + $222 = ($220 + $216 | 0) * 2998 | 0; + $225 = $222 + ($218 + $216 << 13) | 0; + $228 = $222 + ($220 - $218 << 13) | 0; + $231 = $216 - $218 - $220 << 13; + HEAP8[$201 >> 0] = HEAP8[$199 + (($225 + $214 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$201 + 5 >> 0] = HEAP8[$199 + (($214 - $225 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$201 + 1 >> 0] = HEAP8[$199 + (($231 + $210 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$201 + 4 >> 0] = HEAP8[$199 + (($210 - $231 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$201 + 2 >> 0] = HEAP8[$199 + (($228 + $215 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$201 + 3 >> 0] = HEAP8[$199 + (($215 - $228 | 0) >>> 18 & 1023) >> 0] | 0; + $269 = (HEAP32[$3 + 4 >> 2] | 0) + $4 | 0; + $272 = (HEAP32[$38 >> 2] << 13) + 134348800 | 0; + $275 = (HEAP32[$5 + 40 >> 2] | 0) * 5793 | 0; + $276 = $272 + $275 | 0; + $278 = $272 - $275 - $275 | 0; + $281 = (HEAP32[$5 + 32 >> 2] | 0) * 10033 | 0; + $282 = $276 + $281 | 0; + $283 = $276 - $281 | 0; + $285 = HEAP32[$5 + 28 >> 2] | 0; + $287 = HEAP32[$5 + 36 >> 2] | 0; + $289 = ($197 + $285 | 0) * 2998 | 0; + $292 = $289 + ($287 + $285 << 13) | 0; + $295 = $289 + ($197 - $287 << 13) | 0; + $298 = $285 - $287 - $197 << 13; + HEAP8[$269 >> 0] = HEAP8[$199 + (($292 + $282 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$269 + 5 >> 0] = HEAP8[$199 + (($282 - $292 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$269 + 1 >> 0] = HEAP8[$199 + (($298 + $278 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$269 + 4 >> 0] = HEAP8[$199 + (($278 - $298 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$269 + 2 >> 0] = HEAP8[$199 + (($295 + $283 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$269 + 3 >> 0] = HEAP8[$199 + (($283 - $295 | 0) >>> 18 & 1023) >> 0] | 0; + $337 = (HEAP32[$3 + 8 >> 2] | 0) + $4 | 0; + $340 = (HEAP32[$5 + 48 >> 2] << 13) + 134348800 | 0; + $343 = (HEAP32[$5 + 64 >> 2] | 0) * 5793 | 0; + $344 = $340 + $343 | 0; + $346 = $340 - $343 - $343 | 0; + $349 = (HEAP32[$5 + 56 >> 2] | 0) * 10033 | 0; + $350 = $344 + $349 | 0; + $351 = $344 - $349 | 0; + $353 = HEAP32[$5 + 52 >> 2] | 0; + $355 = HEAP32[$5 + 60 >> 2] | 0; + $357 = HEAP32[$5 + 68 >> 2] | 0; + $359 = ($357 + $353 | 0) * 2998 | 0; + $362 = $359 + ($355 + $353 << 13) | 0; + $365 = $359 + ($357 - $355 << 13) | 0; + $368 = $353 - $355 - $357 << 13; + HEAP8[$337 >> 0] = HEAP8[$199 + (($362 + $350 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$337 + 5 >> 0] = HEAP8[$199 + (($350 - $362 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$337 + 1 >> 0] = HEAP8[$199 + (($368 + $346 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$337 + 4 >> 0] = HEAP8[$199 + (($346 - $368 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$337 + 2 >> 0] = HEAP8[$199 + (($365 + $351 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$337 + 3 >> 0] = HEAP8[$199 + (($351 - $365 | 0) >>> 18 & 1023) >> 0] | 0; + STACKTOP = sp; + return; +} + +function __ZNSt3__211__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + $10 = $10 | 0; + $11 = $11 | 0; + $12 = $12 | 0; + $13 = $13 | 0; + $14 = $14 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i108 = 0, $$0$i$i112 = 0, $$0$ph = 0, $$0101 = 0, $$0103 = 0, $$0106 = 0, $$07$i$i = 0, $$095 = 0, $$097 = 0, $$099 = 0, $$1 = 0, $$1102 = 0, $$1104 = 0, $$196 = 0, $$198 = 0, $$2 = 0, $$2105 = 0, $$3 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $114 = 0, $115 = 0, $116 = 0, $117 = 0, $118 = 0, $126 = 0, $129 = 0, $130 = 0, $132 = 0, $135 = 0, $136 = 0, $138 = 0, $142 = 0, $144 = 0, $146 = 0, $147 = 0, $150 = 0, $152 = 0, $16 = 0, $17 = 0, $19 = 0, $20 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $30 = 0, $40 = 0, $41 = 0, $43 = 0, $44 = 0, $51 = 0, $52 = 0, $54 = 0, $55 = 0, $58 = 0, $61 = 0, $62 = 0, $63 = 0, $65 = 0, $69 = 0, $79 = 0, $81 = 0, $82 = 0, $83 = 0, $91 = 0, $92 = 0, $93 = 0, $99 = 0, $spec$select = 0; + HEAP32[$2 >> 2] = $0; + $16 = $13 + 8 + 3 | 0; + $17 = $13 + 4 | 0; + $19 = $12 + 8 + 3 | 0; + $20 = $12 + 4 | 0; + $22 = ($3 & 512 | 0) == 0; + $23 = ($14 | 0) > 0; + $24 = $11 + 11 | 0; + $25 = $11 + 4 | 0; + $$0106 = 0; + $$099 = $4; + while (1) { + if (($$0106 | 0) == 4) break; + L4 : do switch (HEAP8[$8 + $$0106 >> 0] | 0) { + case 0: + { + HEAP32[$1 >> 2] = HEAP32[$2 >> 2]; + $$2 = $$099; + break; + } + case 1: + { + HEAP32[$1 >> 2] = HEAP32[$2 >> 2]; + $40 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$6 >> 2] | 0) + 44 >> 2] & 127]($6, 32) | 0; + $41 = HEAP32[$2 >> 2] | 0; + HEAP32[$2 >> 2] = $41 + 4; + HEAP32[$41 >> 2] = $40; + $$2 = $$099; + break; + } + case 3: + { + $43 = HEAP8[$16 >> 0] | 0; + $44 = $43 << 24 >> 24 < 0; + if (!(($44 ? HEAP32[$17 >> 2] | 0 : $43 & 255) | 0)) $$2 = $$099; else { + $51 = HEAP32[($44 ? HEAP32[$13 >> 2] | 0 : $13) >> 2] | 0; + $52 = HEAP32[$2 >> 2] | 0; + HEAP32[$2 >> 2] = $52 + 4; + HEAP32[$52 >> 2] = $51; + $$2 = $$099; + } + break; + } + case 2: + { + $54 = HEAP8[$19 >> 0] | 0; + $55 = $54 << 24 >> 24 < 0; + $58 = $55 ? HEAP32[$20 >> 2] | 0 : $54 & 255; + if ($22 | ($58 | 0) == 0) $$2 = $$099; else { + $61 = $55 ? HEAP32[$12 >> 2] | 0 : $12; + $62 = $61 + ($58 << 2) | 0; + $63 = HEAP32[$2 >> 2] | 0; + $$0$i$i112 = $63; + $65 = $61; + while (1) { + if (($65 | 0) == ($62 | 0)) break; + HEAP32[$$0$i$i112 >> 2] = HEAP32[$65 >> 2]; + $$0$i$i112 = $$0$i$i112 + 4 | 0; + $65 = $65 + 4 | 0; + } + HEAP32[$2 >> 2] = $63 + ($58 << 2); + $$2 = $$099; + } + break; + } + case 4: + { + $69 = HEAP32[$2 >> 2] | 0; + $spec$select = $7 ? $$099 + 4 | 0 : $$099; + $$0103 = $spec$select; + while (1) { + if ($$0103 >>> 0 >= $5 >>> 0) break; + if (!(FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$6 >> 2] | 0) + 12 >> 2] & 63]($6, 2048, HEAP32[$$0103 >> 2] | 0) | 0)) break; + $$0103 = $$0103 + 4 | 0; + } + if ($23) { + $$0101 = $14; + $$1104 = $$0103; + while (1) { + $79 = ($$0101 | 0) > 0; + if (!($$1104 >>> 0 > $spec$select >>> 0 & $79)) break; + $81 = $$1104 + -4 | 0; + $82 = HEAP32[$81 >> 2] | 0; + $83 = HEAP32[$2 >> 2] | 0; + HEAP32[$2 >> 2] = $83 + 4; + HEAP32[$83 >> 2] = $82; + $$0101 = $$0101 + -1 | 0; + $$1104 = $81; + } + if ($79) $93 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$6 >> 2] | 0) + 44 >> 2] & 127]($6, 48) | 0; else $93 = 0; + $$1102 = $$0101; + $92 = HEAP32[$2 >> 2] | 0; + while (1) { + $91 = $92 + 4 | 0; + if (($$1102 | 0) <= 0) break; + HEAP32[$92 >> 2] = $93; + $$1102 = $$1102 + -1 | 0; + $92 = $91; + } + HEAP32[$2 >> 2] = $91; + HEAP32[$92 >> 2] = $9; + $$2105 = $$1104; + } else $$2105 = $$0103; + if (($$2105 | 0) == ($spec$select | 0)) { + $99 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$6 >> 2] | 0) + 44 >> 2] & 127]($6, 48) | 0; + $100 = HEAP32[$2 >> 2] | 0; + $101 = $100 + 4 | 0; + HEAP32[$2 >> 2] = $101; + HEAP32[$100 >> 2] = $99; + $135 = $101; + } else { + $102 = HEAP8[$24 >> 0] | 0; + $103 = $102 << 24 >> 24 < 0; + if (!(($103 ? HEAP32[$25 >> 2] | 0 : $102 & 255) | 0)) $$0$ph = -1; else $$0$ph = HEAP8[($103 ? HEAP32[$11 >> 2] | 0 : $11) >> 0] | 0; + $$0 = $$0$ph; + $$095 = 0; + $$097 = 0; + $$3 = $$2105; + while (1) { + if (($$3 | 0) == ($spec$select | 0)) break; + $114 = HEAP32[$2 >> 2] | 0; + if (($$097 | 0) == ($$0 | 0)) { + $115 = $114 + 4 | 0; + HEAP32[$2 >> 2] = $115; + HEAP32[$114 >> 2] = $10; + $116 = $$095 + 1 | 0; + $117 = HEAP8[$24 >> 0] | 0; + $118 = $117 << 24 >> 24 < 0; + if ($116 >>> 0 < ($118 ? HEAP32[$25 >> 2] | 0 : $117 & 255) >>> 0) { + $126 = HEAP8[($118 ? HEAP32[$11 >> 2] | 0 : $11) + $116 >> 0] | 0; + $$1 = $126 << 24 >> 24 == 127 ? -1 : $126 << 24 >> 24; + $$196 = $116; + $$198 = 0; + $132 = $115; + } else { + $$1 = $$097; + $$196 = $116; + $$198 = 0; + $132 = $115; + } + } else { + $$1 = $$0; + $$196 = $$095; + $$198 = $$097; + $132 = $114; + } + $129 = $$3 + -4 | 0; + $130 = HEAP32[$129 >> 2] | 0; + HEAP32[$2 >> 2] = $132 + 4; + HEAP32[$132 >> 2] = $130; + $$0 = $$1; + $$095 = $$196; + $$097 = $$198 + 1 | 0; + $$3 = $129; + } + $135 = HEAP32[$2 >> 2] | 0; + } + if (($69 | 0) == ($135 | 0)) $$2 = $spec$select; else { + $$0$i$i108 = $135; + $$07$i$i = $69; + while (1) { + $136 = $$0$i$i108 + -4 | 0; + if ($$07$i$i >>> 0 >= $136 >>> 0) { + $$2 = $spec$select; + break L4; + } + $138 = HEAP32[$$07$i$i >> 2] | 0; + HEAP32[$$07$i$i >> 2] = HEAP32[$136 >> 2]; + HEAP32[$136 >> 2] = $138; + $$0$i$i108 = $136; + $$07$i$i = $$07$i$i + 4 | 0; + } + } + break; + } + default: + $$2 = $$099; + } while (0); + $$0106 = $$0106 + 1 | 0; + $$099 = $$2; + } + $26 = HEAP8[$16 >> 0] | 0; + $27 = $26 << 24 >> 24 < 0; + $30 = $27 ? HEAP32[$17 >> 2] | 0 : $26 & 255; + if ($30 >>> 0 > 1) { + $142 = HEAP32[$13 >> 2] | 0; + $144 = $27 ? $142 + 4 | 0 : $17; + $146 = ($27 ? $142 : $13) + ($30 << 2) | 0; + $147 = HEAP32[$2 >> 2] | 0; + $150 = $146 - $144 | 0; + $$0$i$i = $147; + $152 = $144; + while (1) { + if (($152 | 0) == ($146 | 0)) break; + HEAP32[$$0$i$i >> 2] = HEAP32[$152 >> 2]; + $$0$i$i = $$0$i$i + 4 | 0; + $152 = $152 + 4 | 0; + } + HEAP32[$2 >> 2] = $147 + ($150 >>> 2 << 2); + } + switch (($3 & 176) << 24 >> 24) { + case 32: + { + HEAP32[$1 >> 2] = HEAP32[$2 >> 2]; + break; + } + case 16: + break; + default: + HEAP32[$1 >> 2] = $0; + } + return; +} + +function _pattern_match($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0175 = 0.0, $$0178 = 0, $$0180 = 0, $$0184 = 0, $$0186 = 0, $$0192 = 0, $$0200 = 0, $$0208 = 0, $$0210 = 0, $$1176 = 0.0, $$1179 = 0, $$1181 = 0, $$1181$in = 0, $$1185 = 0, $$1187 = 0, $$1193 = 0, $$1201 = 0, $$1209 = 0, $$1211 = 0, $$2 = 0, $$2182 = 0, $$2188 = 0, $$2202 = 0, $$2212 = 0, $$3 = 0.0, $$3183 = 0, $$3183$in = 0, $$3189 = 0, $$3195 = 0, $$3203 = 0, $$3213 = 0, $$4 = 0.0, $$4190 = 0, $$4196 = 0, $$4204 = 0, $$5 = 0.0, $$5191 = 0, $$5197 = 0, $$5205 = 0, $$6206 = 0, $$7 = 0.0, $$7199 = 0, $$7207 = 0, $10 = 0, $115 = 0.0, $116 = 0, $12 = 0, $18 = 0, $20 = 0, $25 = 0, $31 = 0.0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $41 = 0, $44 = 0, $45 = 0, $61 = 0.0, $62 = 0, $65 = 0, $67 = 0, $75 = 0, $80 = 0, $86 = 0.0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $95 = 0, $98 = 0, $99 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer1 = sp + 8 | 0; + $vararg_buffer = sp; + L1 : do if (($0 | 0) == 0 | ($3 | 0) < 1) { + HEAP32[$4 >> 2] = 0; + HEAP32[$5 >> 2] = 0; + HEAPF64[$6 >> 3] = -1.0; + $$2 = -1; + } else switch ($1 | 0) { + case 0: + { + $9 = Math_imul($3, $3) | 0; + $10 = $9 * 3 | 0; + $12 = _malloc($9 * 12 | 0) | 0; + if (!$12) { + _arLog(0, 3, 45930, $vararg_buffer); + _exit(1); + } + $$0186 = 0; + $$0208 = 0; + while (1) { + if (($$0186 | 0) == ($10 | 0)) break; + $18 = $$0208 + (~HEAP8[$2 + $$0186 >> 0] & 255) | 0; + $$0186 = $$0186 + 1 | 0; + $$0208 = $18; + } + $20 = ($$0208 >>> 0) / ($10 >>> 0) | 0; + $$0210 = 0; + $$1187 = 0; + while (1) { + if (($$1187 | 0) == ($10 | 0)) break; + $25 = (~HEAP8[$2 + $$1187 >> 0] & 255) - $20 | 0; + HEAP32[$12 + ($$1187 << 2) >> 2] = $25; + $$0210 = (Math_imul($25, $25) | 0) + $$0210 | 0; + $$1187 = $$1187 + 1 | 0; + } + $31 = +Math_sqrt(+(+($$0210 | 0))); + if ($31 / (+($3 | 0) * 1.7320508) < 15.0) { + HEAP32[$4 >> 2] = 0; + HEAP32[$5 >> 2] = 0; + HEAPF64[$6 >> 3] = -1.0; + _free($12); + $$2 = -2; + break L1; + } + $36 = HEAP32[$0 >> 2] | 0; + $37 = $0 + 8 | 0; + $38 = $0 + 12 | 0; + $39 = $0 + 16 | 0; + $$0175 = 0.0; + $$0178 = 0; + $$0180 = -1; + $$0192 = -1; + $$0200 = -1; + while (1) { + if (($$0178 | 0) >= ($36 | 0)) break; + $41 = HEAP32[$37 >> 2] | 0; + $$1181$in = $$0180; + L23 : while (1) { + $$1181 = $$1181$in + 1 | 0; + switch (HEAP32[$41 + ($$1181 << 2) >> 2] | 0) { + case 0: + { + $$1181$in = $$1181; + break; + } + case 2: + { + $$3 = $$0175; + $$3195 = $$0192; + $$3203 = $$0200; + break L23; + break; + } + default: + { + label = 18; + break L23; + } + } + } + L25 : do if ((label | 0) == 18) { + label = 0; + $44 = $$1181 << 2; + $$0184 = 0; + $$1176 = $$0175; + $$1193 = $$0192; + $$1201 = $$0200; + while (1) { + if (($$0184 | 0) == 4) { + $$3 = $$1176; + $$3195 = $$1193; + $$3203 = $$1201; + break L25; + } + $45 = $$0184 + $44 | 0; + $$1211 = 0; + $$2188 = 0; + while (1) { + if (($$2188 | 0) == ($10 | 0)) break; + $$1211 = (Math_imul(HEAP32[(HEAP32[(HEAP32[$38 >> 2] | 0) + ($45 << 2) >> 2] | 0) + ($$2188 << 2) >> 2] | 0, HEAP32[$12 + ($$2188 << 2) >> 2] | 0) | 0) + $$1211 | 0; + $$2188 = $$2188 + 1 | 0; + } + $61 = +($$1211 | 0) / +HEAPF64[(HEAP32[$39 >> 2] | 0) + ($45 << 3) >> 3] / $31; + $62 = $61 > $$1176; + $$2202 = $62 ? $$0184 : $$1201; + $$0184 = $$0184 + 1 | 0; + $$1176 = $62 ? $61 : $$1176; + $$1193 = $62 ? $$1181 : $$1193; + $$1201 = $$2202; + } + } while (0); + $$0175 = $$3; + $$0178 = $$0178 + 1 | 0; + $$0180 = $$1181; + $$0192 = $$3195; + $$0200 = $$3203; + } + HEAP32[$5 >> 2] = $$0200; + HEAP32[$4 >> 2] = $$0192; + HEAPF64[$6 >> 3] = $$0175; + _free($12); + $$2 = 0; + break L1; + break; + } + case 1: + { + $65 = Math_imul($3, $3) | 0; + $67 = _malloc($65 << 2) | 0; + if (!$67) { + _arLog(0, 3, 45930, $vararg_buffer1); + _exit(1); + } + $$1209 = 0; + $$3189 = 0; + while (1) { + if (($$3189 | 0) == ($65 | 0)) break; + $$1209 = $$1209 + (~HEAP8[$2 + $$3189 >> 0] & 255) | 0; + $$3189 = $$3189 + 1 | 0; + } + $75 = ($$1209 >>> 0) / ($65 >>> 0) | 0; + $$2212 = 0; + $$4190 = 0; + while (1) { + if (($$4190 | 0) == ($65 | 0)) break; + $80 = (~HEAP8[$2 + $$4190 >> 0] & 255) - $75 | 0; + HEAP32[$67 + ($$4190 << 2) >> 2] = $80; + $$2212 = (Math_imul($80, $80) | 0) + $$2212 | 0; + $$4190 = $$4190 + 1 | 0; + } + $86 = +Math_sqrt(+(+($$2212 | 0))); + if ($86 / +($3 | 0) < 15.0) { + HEAP32[$4 >> 2] = 0; + HEAP32[$5 >> 2] = 0; + HEAPF64[$6 >> 3] = -1.0; + _free($67); + $$2 = -2; + break L1; + } + $90 = HEAP32[$0 >> 2] | 0; + $91 = $0 + 8 | 0; + $92 = $0 + 20 | 0; + $93 = $0 + 24 | 0; + $$1179 = 0; + $$2182 = -1; + $$4 = 0.0; + $$4196 = -1; + $$4204 = -1; + while (1) { + if (($$1179 | 0) >= ($90 | 0)) break; + $95 = HEAP32[$91 >> 2] | 0; + $$3183$in = $$2182; + L54 : while (1) { + $$3183 = $$3183$in + 1 | 0; + switch (HEAP32[$95 + ($$3183 << 2) >> 2] | 0) { + case 0: + { + $$3183$in = $$3183; + break; + } + case 2: + { + $$7 = $$4; + $$7199 = $$4196; + $$7207 = $$4204; + break L54; + break; + } + default: + { + label = 40; + break L54; + } + } + } + L56 : do if ((label | 0) == 40) { + label = 0; + $98 = $$3183 << 2; + $$1185 = 0; + $$5 = $$4; + $$5197 = $$4196; + $$5205 = $$4204; + while (1) { + if (($$1185 | 0) == 4) { + $$7 = $$5; + $$7199 = $$5197; + $$7207 = $$5205; + break L56; + } + $99 = $$1185 + $98 | 0; + $$3213 = 0; + $$5191 = 0; + while (1) { + if (($$5191 | 0) == ($65 | 0)) break; + $$3213 = (Math_imul(HEAP32[(HEAP32[(HEAP32[$92 >> 2] | 0) + ($99 << 2) >> 2] | 0) + ($$5191 << 2) >> 2] | 0, HEAP32[$67 + ($$5191 << 2) >> 2] | 0) | 0) + $$3213 | 0; + $$5191 = $$5191 + 1 | 0; + } + $115 = +($$3213 | 0) / +HEAPF64[(HEAP32[$93 >> 2] | 0) + ($99 << 3) >> 3] / $86; + $116 = $115 > $$5; + $$6206 = $116 ? $$1185 : $$5205; + $$1185 = $$1185 + 1 | 0; + $$5 = $116 ? $115 : $$5; + $$5197 = $116 ? $$3183 : $$5197; + $$5205 = $$6206; + } + } while (0); + $$1179 = $$1179 + 1 | 0; + $$2182 = $$3183; + $$4 = $$7; + $$4196 = $$7199; + $$4204 = $$7207; + } + HEAP32[$5 >> 2] = $$4204; + HEAP32[$4 >> 2] = $$4196; + HEAPF64[$6 >> 3] = $$4; + _free($67); + $$2 = 0; + break L1; + break; + } + default: + { + $$2 = -1; + break L1; + } + } while (0); + STACKTOP = sp; + return $$2 | 0; +} + +function _jpeg_idct_14x14($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0332340 = 0, $$0334339 = 0, $$0335338 = 0, $$0341 = 0, $$1333336 = 0, $$1337 = 0, $100 = 0, $103 = 0, $106 = 0, $108 = 0, $112 = 0, $115 = 0, $118 = 0, $15 = 0, $162 = 0, $165 = 0, $168 = 0, $170 = 0, $173 = 0, $174 = 0, $176 = 0, $178 = 0, $180 = 0, $182 = 0, $184 = 0, $186 = 0, $188 = 0, $191 = 0, $192 = 0, $193 = 0, $194 = 0, $195 = 0, $196 = 0, $197 = 0, $199 = 0, $201 = 0, $203 = 0, $206 = 0, $207 = 0, $209 = 0, $21 = 0, $210 = 0, $214 = 0, $215 = 0, $218 = 0, $220 = 0, $221 = 0, $224 = 0, $227 = 0, $230 = 0, $232 = 0, $236 = 0, $239 = 0, $24 = 0, $242 = 0, $25 = 0, $27 = 0, $30 = 0, $36 = 0, $42 = 0, $44 = 0, $46 = 0, $48 = 0, $5 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $63 = 0, $69 = 0, $7 = 0, $75 = 0, $81 = 0, $82 = 0, $83 = 0, $85 = 0, $86 = 0, $90 = 0, $91 = 0, $94 = 0, $96 = 0, $97 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 448 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(448); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0332340 = $5; + $$0334339 = HEAP32[$1 + 84 >> 2] | 0; + $$0335338 = $2; + $$0341 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0335338 >> 1] << 13, HEAP32[$$0334339 >> 2] | 0) | 0 | 1024; + $21 = Math_imul(HEAP32[$$0334339 + 128 >> 2] | 0, HEAP16[$$0335338 + 64 >> 1] | 0) | 0; + $24 = ($21 * 10438 | 0) + $15 | 0; + $25 = ($21 * 2578 | 0) + $15 | 0; + $27 = (Math_imul($21, -7223) | 0) + $15 | 0; + $30 = (Math_imul($21, -11586) | 0) + $15 >> 11; + $36 = Math_imul(HEAP32[$$0334339 + 64 >> 2] | 0, HEAP16[$$0335338 + 32 >> 1] | 0) | 0; + $42 = Math_imul(HEAP32[$$0334339 + 192 >> 2] | 0, HEAP16[$$0335338 + 96 >> 1] | 0) | 0; + $44 = ($42 + $36 | 0) * 9058 | 0; + $46 = $44 + ($36 * 2237 | 0) | 0; + $48 = $44 + (Math_imul($42, -14084) | 0) | 0; + $51 = (Math_imul($42, -11295) | 0) + ($36 * 5027 | 0) | 0; + $52 = $46 + $24 | 0; + $53 = $24 - $46 | 0; + $54 = $48 + $25 | 0; + $55 = $25 - $48 | 0; + $56 = $51 + $27 | 0; + $57 = $27 - $51 | 0; + $63 = Math_imul(HEAP32[$$0334339 + 32 >> 2] | 0, HEAP16[$$0335338 + 16 >> 1] | 0) | 0; + $69 = Math_imul(HEAP32[$$0334339 + 96 >> 2] | 0, HEAP16[$$0335338 + 48 >> 1] | 0) | 0; + $75 = Math_imul(HEAP32[$$0334339 + 160 >> 2] | 0, HEAP16[$$0335338 + 80 >> 1] | 0) | 0; + $81 = Math_imul(HEAP32[$$0334339 + 224 >> 2] | 0, HEAP16[$$0335338 + 112 >> 1] | 0) | 0; + $82 = $81 << 13; + $83 = $75 + $63 | 0; + $85 = ($69 + $63 | 0) * 10935 | 0; + $86 = $83 * 9810 | 0; + $90 = $85 + (Math_imul($63, -9232) | 0) + $86 + $82 | 0; + $91 = $83 * 6164 | 0; + $94 = $63 - $69 | 0; + $96 = ($94 * 3826 | 0) - $82 | 0; + $97 = $91 + (Math_imul($63, -8693) | 0) + $96 | 0; + $100 = (Math_imul($75 + $69 | 0, -1297) | 0) - $82 | 0; + $103 = $85 + (Math_imul($69, -3474) | 0) + $100 | 0; + $106 = $86 + (Math_imul($75, -19447) | 0) + $100 | 0; + $108 = ($75 - $69 | 0) * 11512 | 0; + $112 = $108 + (Math_imul($75, -13850) | 0) + $91 + $82 | 0; + $115 = $108 + ($69 * 5529 | 0) + $96 | 0; + $118 = $94 - $75 + $81 << 2; + HEAP32[$$0332340 >> 2] = $90 + $52 >> 11; + HEAP32[$$0332340 + 416 >> 2] = $52 - $90 >> 11; + HEAP32[$$0332340 + 32 >> 2] = $103 + $54 >> 11; + HEAP32[$$0332340 + 384 >> 2] = $54 - $103 >> 11; + HEAP32[$$0332340 + 64 >> 2] = $106 + $56 >> 11; + HEAP32[$$0332340 + 352 >> 2] = $56 - $106 >> 11; + HEAP32[$$0332340 + 96 >> 2] = $118 + $30; + HEAP32[$$0332340 + 320 >> 2] = $30 - $118; + HEAP32[$$0332340 + 128 >> 2] = $112 + $57 >> 11; + HEAP32[$$0332340 + 288 >> 2] = $57 - $112 >> 11; + HEAP32[$$0332340 + 160 >> 2] = $115 + $55 >> 11; + HEAP32[$$0332340 + 256 >> 2] = $55 - $115 >> 11; + HEAP32[$$0332340 + 192 >> 2] = $97 + $53 >> 11; + HEAP32[$$0332340 + 224 >> 2] = $53 - $97 >> 11; + $$0341 = $$0341 + 1 | 0; + if (($$0341 | 0) == 8) break; else { + $$0332340 = $$0332340 + 4 | 0; + $$0334339 = $$0334339 + 4 | 0; + $$0335338 = $$0335338 + 2 | 0; + } + } + $162 = $7 + -384 | 0; + $$1333336 = $5; + $$1337 = 0; + while (1) { + $165 = (HEAP32[$3 + ($$1337 << 2) >> 2] | 0) + $4 | 0; + $168 = (HEAP32[$$1333336 >> 2] << 13) + 134348800 | 0; + $170 = HEAP32[$$1333336 + 16 >> 2] | 0; + $173 = $168 + ($170 * 10438 | 0) | 0; + $174 = $168 + ($170 * 2578 | 0) | 0; + $176 = $168 + (Math_imul($170, -7223) | 0) | 0; + $178 = $168 + (Math_imul($170, -11586) | 0) | 0; + $180 = HEAP32[$$1333336 + 8 >> 2] | 0; + $182 = HEAP32[$$1333336 + 24 >> 2] | 0; + $184 = ($182 + $180 | 0) * 9058 | 0; + $186 = $184 + ($180 * 2237 | 0) | 0; + $188 = $184 + (Math_imul($182, -14084) | 0) | 0; + $191 = (Math_imul($182, -11295) | 0) + ($180 * 5027 | 0) | 0; + $192 = $186 + $173 | 0; + $193 = $173 - $186 | 0; + $194 = $188 + $174 | 0; + $195 = $174 - $188 | 0; + $196 = $191 + $176 | 0; + $197 = $176 - $191 | 0; + $199 = HEAP32[$$1333336 + 4 >> 2] | 0; + $201 = HEAP32[$$1333336 + 12 >> 2] | 0; + $203 = HEAP32[$$1333336 + 20 >> 2] | 0; + $206 = HEAP32[$$1333336 + 28 >> 2] << 13; + $207 = $203 + $199 | 0; + $209 = ($201 + $199 | 0) * 10935 | 0; + $210 = $207 * 9810 | 0; + $214 = $209 + (Math_imul($199, -9232) | 0) + $210 + $206 | 0; + $215 = $207 * 6164 | 0; + $218 = $199 - $201 | 0; + $220 = ($218 * 3826 | 0) - $206 | 0; + $221 = $215 + (Math_imul($199, -8693) | 0) + $220 | 0; + $224 = (Math_imul($203 + $201 | 0, -1297) | 0) - $206 | 0; + $227 = $209 + (Math_imul($201, -3474) | 0) + $224 | 0; + $230 = $210 + (Math_imul($203, -19447) | 0) + $224 | 0; + $232 = ($203 - $201 | 0) * 11512 | 0; + $236 = $206 + (Math_imul($203, -13850) | 0) + $232 + $215 | 0; + $239 = $232 + ($201 * 5529 | 0) + $220 | 0; + $242 = ($218 - $203 << 13) + $206 | 0; + HEAP8[$165 >> 0] = HEAP8[$162 + (($214 + $192 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 13 >> 0] = HEAP8[$162 + (($192 - $214 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 1 >> 0] = HEAP8[$162 + (($227 + $194 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 12 >> 0] = HEAP8[$162 + (($194 - $227 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 2 >> 0] = HEAP8[$162 + (($230 + $196 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 11 >> 0] = HEAP8[$162 + (($196 - $230 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 3 >> 0] = HEAP8[$162 + (($242 + $178 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 10 >> 0] = HEAP8[$162 + (($178 - $242 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 4 >> 0] = HEAP8[$162 + (($236 + $197 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 9 >> 0] = HEAP8[$162 + (($197 - $236 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 5 >> 0] = HEAP8[$162 + (($239 + $195 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 8 >> 0] = HEAP8[$162 + (($195 - $239 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 6 >> 0] = HEAP8[$162 + (($221 + $193 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 7 >> 0] = HEAP8[$162 + (($193 - $221 | 0) >>> 18 & 1023) >> 0] | 0; + $$1337 = $$1337 + 1 | 0; + if (($$1337 | 0) == 14) break; else $$1333336 = $$1333336 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function __ZN6vision25DoGScaleInvariantDetector21findSubpixelLocationsEPKNS_25GaussianScaleSpacePyramidE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$070 = 0, $$2 = 0, $10 = 0.0, $100 = 0, $105 = 0, $109 = 0, $11 = 0, $111 = 0, $114 = 0.0, $117 = 0.0, $133 = 0.0, $134 = 0, $137 = 0.0, $14 = 0.0, $144 = 0.0, $146 = 0, $151 = 0.0, $153 = 0, $16 = 0.0, $160 = 0.0, $162 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $26 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $4 = 0, $41 = 0, $46 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $54 = 0, $56 = 0, $58 = 0, $6 = 0, $63 = 0, $66 = 0, $67 = 0, $7 = 0, $70 = 0, $71 = 0, $73 = 0, $74 = 0, $81 = 0.0, $84 = 0.0, $87 = 0, $89 = 0, $90 = 0.0, $92 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 80 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(80); + $2 = sp + 68 | 0; + $3 = sp; + $4 = sp + 56 | 0; + $5 = sp + 44 | 0; + $6 = sp + 40 | 0; + $7 = sp + 36 | 0; + $10 = +__ZN6vision3sqrIfEET_S1_(+HEAPF32[$0 + 52 >> 2]); + $11 = $0 + 56 | 0; + $14 = +__ZN6vision3sqrIfEET_S1_(+HEAPF32[$11 >> 2] + 1.0); + $16 = $14 / +HEAPF32[$11 >> 2]; + $17 = $0 + 60 | 0; + $18 = $0 + 64 | 0; + $19 = $0 + 32 | 0; + $20 = $5 + 4 | 0; + $21 = $0 + 88 | 0; + $22 = $4 + 4 | 0; + $23 = $4 + 8 | 0; + $24 = $5 + 8 | 0; + $$0 = 0; + $$070 = 0; + while (1) { + $26 = HEAP32[$17 >> 2] | 0; + $30 = $26; + if ($$070 >>> 0 >= (((HEAP32[$18 >> 2] | 0) - $26 | 0) / 36 | 0) >>> 0) { + label = 3; + break; + } + $31 = $30 + ($$070 * 36 | 0) | 0; + $32 = $30 + ($$070 * 36 | 0) + 16 | 0; + $33 = HEAP32[$32 >> 2] | 0; + if (($33 | 0) >= (__ZNK6vision10DoGPyramid17numScalePerOctaveEv($19) | 0)) { + label = 5; + break; + } + $51 = $30 + ($$070 * 36 | 0) + 12 | 0; + $52 = HEAP32[$51 >> 2] | 0; + $54 = Math_imul(__ZNK6vision10DoGPyramid17numScalePerOctaveEv($19) | 0, $52) | 0; + $56 = $54 + (HEAP32[$32 >> 2] | 0) | 0; + $58 = $30 + ($$070 * 36 | 0) + 4 | 0; + __ZN6vision25bilinear_downsample_pointERfS0_ffi($6, $7, +HEAPF32[$31 >> 2], +HEAPF32[$58 >> 2], HEAP32[$51 >> 2] | 0); + $63 = ~~(+HEAPF32[$6 >> 2] + .5); + $66 = ~~(+HEAPF32[$7 >> 2] + .5); + $67 = __ZNK6vision10DoGPyramid6imagesEv($19) | 0; + $70 = (HEAP32[$67 >> 2] | 0) + ($56 + -1 << 5) | 0; + $71 = __ZNK6vision10DoGPyramid6imagesEv($19) | 0; + $73 = (HEAP32[$71 >> 2] | 0) + ($56 << 5) | 0; + $74 = __ZNK6vision10DoGPyramid6imagesEv($19) | 0; + if (((__ZN6vision22ComputeSubpixelHessianEPfS0_RKNS_5ImageES3_S3_ii($3, $4, $70, $73, (HEAP32[$74 >> 2] | 0) + ($56 + 1 << 5) | 0, $63, $66) | 0 ? __ZN6vision29SolveSymmetricLinearSystem3x3IfEEbPT_PKS1_S4_($5, $3, $4) | 0 : 0) ? ($81 = +__ZN6vision3sqrIfEET_S1_(+HEAPF32[$5 >> 2]), $84 = $81 + +__ZN6vision3sqrIfEET_S1_(+HEAPF32[$20 >> 2]), !($84 > +HEAPF32[$21 >> 2])) : 0) ? ($87 = $30 + ($$070 * 36 | 0) + 32 | 0, __ZN6vision16ComputeEdgeScoreERfPKf($87, $3) | 0) : 0) { + $89 = $30 + ($$070 * 36 | 0) + 24 | 0; + $90 = +HEAPF32[$89 >> 2]; + $92 = (__ZNK6vision5Image3getIfEEPKT_m($73, $66) | 0) + ($63 << 2) | 0; + if (!($90 == +HEAPF32[$92 >> 2])) { + label = 11; + break; + } + $111 = (__ZNK6vision5Image3getIfEEPKT_m($73, $66) | 0) + ($63 << 2) | 0; + $114 = +HEAPF32[$5 >> 2]; + $117 = +HEAPF32[$20 >> 2]; + HEAPF32[$89 >> 2] = +HEAPF32[$111 >> 2] - (+HEAPF32[$4 >> 2] * $114 + +HEAPF32[$22 >> 2] * $117 + +HEAPF32[$23 >> 2] * +HEAPF32[$24 >> 2]); + __ZN6vision23bilinear_upsample_pointERfS0_ffi($31, $58, $114 + +HEAPF32[$6 >> 2], $117 + +HEAPF32[$7 >> 2], HEAP32[$51 >> 2] | 0); + $133 = +HEAPF32[$24 >> 2] + +(HEAP32[$32 >> 2] | 0); + $134 = $30 + ($$070 * 36 | 0) + 20 | 0; + HEAPF32[$134 >> 2] = $133; + $137 = +__ZN6vision10ClipScalarIfEET_S1_S1_S1_($133, 0.0, +(__ZNK6vision10DoGPyramid17numScalePerOctaveEv($19) | 0)); + HEAPF32[$134 >> 2] = $137; + if (((((+Math_abs(+(+HEAPF32[$87 >> 2])) < $16 ? +__ZN6vision3sqrIfEET_S1_(+HEAPF32[$89 >> 2]) >= $10 : 0) ? ($144 = +HEAPF32[$31 >> 2], $144 >= 0.0) : 0) ? ($146 = __ZNK6vision10DoGPyramid6imagesEv($19) | 0, $144 < +((__ZNK6vision5Image5widthEv(HEAP32[$146 >> 2] | 0) | 0) >>> 0)) : 0) ? ($151 = +HEAPF32[$58 >> 2], $151 >= 0.0) : 0) ? ($153 = __ZNK6vision10DoGPyramid6imagesEv($19) | 0, $151 < +((__ZNK6vision5Image6heightEv(HEAP32[$153 >> 2] | 0) | 0) >>> 0)) : 0) { + $160 = +__ZNK6vision25GaussianScaleSpacePyramid14effectiveSigmaEmf($1, HEAP32[$51 >> 2] | 0, +HEAPF32[$134 >> 2]); + HEAPF32[$30 + ($$070 * 36 | 0) + 28 >> 2] = $160; + $162 = $$0 + 1 | 0; + dest = (HEAP32[$17 >> 2] | 0) + ($$0 * 36 | 0) | 0; + src = $31; + stop = dest + 36 | 0; + do { + HEAP32[dest >> 2] = HEAP32[src >> 2]; + dest = dest + 4 | 0; + src = src + 4 | 0; + } while ((dest | 0) < (stop | 0)); + $$2 = $162; + } else $$2 = $$0; + } else $$2 = $$0; + $$0 = $$2; + $$070 = $$070 + 1 | 0; + } + if ((label | 0) == 3) { + __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE6resizeEm($17, $$0); + STACKTOP = sp; + return; + } else if ((label | 0) == 5) { + $41 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 28320) | 0, 26748) | 0, 39072) | 0, 489) | 0, 39079) | 0, 28392) | 0; + __ZNKSt3__28ios_base6getlocEv($2, $41 + (HEAP32[(HEAP32[$41 >> 2] | 0) + -12 >> 2] | 0) | 0); + $46 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66512) | 0; + $50 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$46 >> 2] | 0) + 28 >> 2] & 127]($46, 10) | 0; + __ZNSt3__26localeD2Ev($2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($41, $50) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($41) | 0; + _abort(); + } else if ((label | 0) == 11) { + $100 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 28429) | 0, 26748) | 0, 39072) | 0, 526) | 0, 39079) | 0, 28486) | 0; + __ZNKSt3__28ios_base6getlocEv($2, $100 + (HEAP32[(HEAP32[$100 >> 2] | 0) + -12 >> 2] | 0) | 0); + $105 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66512) | 0; + $109 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$105 >> 2] | 0) + 28 >> 2] & 127]($105, 10) | 0; + __ZNSt3__26localeD2Ev($2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($100, $109) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($100) | 0; + _abort(); + } +} + +function __ZNSt3__211__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + $10 = $10 | 0; + $11 = $11 | 0; + $12 = $12 | 0; + $13 = $13 | 0; + $14 = $14 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i106 = 0, $$0$i$i113 = 0, $$0$ph = 0, $$0101 = 0, $$0104 = 0, $$07$i$i = 0, $$093 = 0, $$095 = 0, $$097 = 0, $$099 = 0, $$1 = 0, $$1100 = 0, $$1102 = 0, $$194 = 0, $$196 = 0, $$2 = 0, $$2103 = 0, $$3 = 0, $$pn = 0, $$pn$pn = 0, $$sroa$08$0$i = 0, $$sroa$08$0$i112 = 0, $100 = 0, $101 = 0, $103 = 0, $104 = 0, $115 = 0, $117 = 0, $118 = 0, $119 = 0, $127 = 0, $130 = 0, $131 = 0, $132 = 0, $135 = 0, $137 = 0, $139 = 0, $144 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $29 = 0, $39 = 0, $40 = 0, $42 = 0, $43 = 0, $50 = 0, $51 = 0, $53 = 0, $54 = 0, $57 = 0, $60 = 0, $61 = 0, $67 = 0, $70 = 0, $80 = 0, $82 = 0, $83 = 0, $84 = 0, $92 = 0, $94 = 0, $spec$select = 0; + HEAP32[$2 >> 2] = $0; + $15 = $13 + 11 | 0; + $16 = $13 + 4 | 0; + $17 = $12 + 11 | 0; + $18 = $12 + 4 | 0; + $20 = ($3 & 512 | 0) == 0; + $21 = $6 + 8 | 0; + $22 = ($14 | 0) > 0; + $23 = $11 + 11 | 0; + $24 = $11 + 4 | 0; + $$0104 = 0; + $$097 = $4; + while (1) { + if (($$0104 | 0) == 4) break; + L4 : do switch (HEAP8[$8 + $$0104 >> 0] | 0) { + case 0: + { + HEAP32[$1 >> 2] = HEAP32[$2 >> 2]; + $$2 = $$097; + break; + } + case 1: + { + HEAP32[$1 >> 2] = HEAP32[$2 >> 2]; + $39 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$6 >> 2] | 0) + 28 >> 2] & 127]($6, 32) | 0; + $40 = HEAP32[$2 >> 2] | 0; + HEAP32[$2 >> 2] = $40 + 1; + HEAP8[$40 >> 0] = $39; + $$2 = $$097; + break; + } + case 3: + { + $42 = HEAP8[$15 >> 0] | 0; + $43 = $42 << 24 >> 24 < 0; + if (!(($43 ? HEAP32[$16 >> 2] | 0 : $42 & 255) | 0)) $$2 = $$097; else { + $50 = HEAP8[($43 ? HEAP32[$13 >> 2] | 0 : $13) >> 0] | 0; + $51 = HEAP32[$2 >> 2] | 0; + HEAP32[$2 >> 2] = $51 + 1; + HEAP8[$51 >> 0] = $50; + $$2 = $$097; + } + break; + } + case 2: + { + $53 = HEAP8[$17 >> 0] | 0; + $54 = $53 << 24 >> 24 < 0; + $57 = $54 ? HEAP32[$18 >> 2] | 0 : $53 & 255; + if ($20 | ($57 | 0) == 0) $$2 = $$097; else { + $60 = $54 ? HEAP32[$12 >> 2] | 0 : $12; + $61 = $60 + $57 | 0; + $$0$i$i113 = HEAP32[$2 >> 2] | 0; + $$sroa$08$0$i112 = $60; + while (1) { + if (($$sroa$08$0$i112 | 0) == ($61 | 0)) break; + HEAP8[$$0$i$i113 >> 0] = HEAP8[$$sroa$08$0$i112 >> 0] | 0; + $$0$i$i113 = $$0$i$i113 + 1 | 0; + $$sroa$08$0$i112 = $$sroa$08$0$i112 + 1 | 0; + } + HEAP32[$2 >> 2] = $$0$i$i113; + $$2 = $$097; + } + break; + } + case 4: + { + $67 = HEAP32[$2 >> 2] | 0; + $spec$select = $7 ? $$097 + 1 | 0 : $$097; + $$0101 = $spec$select; + while (1) { + if ($$0101 >>> 0 >= $5 >>> 0) break; + $70 = HEAP8[$$0101 >> 0] | 0; + if ($70 << 24 >> 24 <= -1) break; + if (!(HEAP16[(HEAP32[$21 >> 2] | 0) + ($70 << 24 >> 24 << 1) >> 1] & 2048)) break; + $$0101 = $$0101 + 1 | 0; + } + if ($22) { + $$099 = $14; + $$1102 = $$0101; + while (1) { + $80 = ($$099 | 0) > 0; + if (!($$1102 >>> 0 > $spec$select >>> 0 & $80)) break; + $82 = $$1102 + -1 | 0; + $83 = HEAP8[$82 >> 0] | 0; + $84 = HEAP32[$2 >> 2] | 0; + HEAP32[$2 >> 2] = $84 + 1; + HEAP8[$84 >> 0] = $83; + $$099 = $$099 + -1 | 0; + $$1102 = $82; + } + if ($80) $94 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$6 >> 2] | 0) + 28 >> 2] & 127]($6, 48) | 0; else $94 = 0; + $$1100 = $$099; + while (1) { + $92 = HEAP32[$2 >> 2] | 0; + HEAP32[$2 >> 2] = $92 + 1; + if (($$1100 | 0) <= 0) break; + HEAP8[$92 >> 0] = $94; + $$1100 = $$1100 + -1 | 0; + } + HEAP8[$92 >> 0] = $9; + $$2103 = $$1102; + } else $$2103 = $$0101; + L36 : do if (($$2103 | 0) == ($spec$select | 0)) { + $100 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$6 >> 2] | 0) + 28 >> 2] & 127]($6, 48) | 0; + $101 = HEAP32[$2 >> 2] | 0; + HEAP32[$2 >> 2] = $101 + 1; + HEAP8[$101 >> 0] = $100; + } else { + $103 = HEAP8[$23 >> 0] | 0; + $104 = $103 << 24 >> 24 < 0; + if (!(($104 ? HEAP32[$24 >> 2] | 0 : $103 & 255) | 0)) $$0$ph = -1; else $$0$ph = HEAP8[($104 ? HEAP32[$11 >> 2] | 0 : $11) >> 0] | 0; + $$0 = $$0$ph; + $$093 = 0; + $$095 = 0; + $$3 = $$2103; + while (1) { + if (($$3 | 0) == ($spec$select | 0)) break L36; + if (($$095 | 0) == ($$0 | 0)) { + $115 = HEAP32[$2 >> 2] | 0; + HEAP32[$2 >> 2] = $115 + 1; + HEAP8[$115 >> 0] = $10; + $117 = $$093 + 1 | 0; + $118 = HEAP8[$23 >> 0] | 0; + $119 = $118 << 24 >> 24 < 0; + if ($117 >>> 0 < ($119 ? HEAP32[$24 >> 2] | 0 : $118 & 255) >>> 0) { + $127 = HEAP8[($119 ? HEAP32[$11 >> 2] | 0 : $11) + $117 >> 0] | 0; + $$1 = $127 << 24 >> 24 == 127 ? -1 : $127 << 24 >> 24; + $$194 = $117; + $$196 = 0; + } else { + $$1 = $$095; + $$194 = $117; + $$196 = 0; + } + } else { + $$1 = $$0; + $$194 = $$093; + $$196 = $$095; + } + $130 = $$3 + -1 | 0; + $131 = HEAP8[$130 >> 0] | 0; + $132 = HEAP32[$2 >> 2] | 0; + HEAP32[$2 >> 2] = $132 + 1; + HEAP8[$132 >> 0] = $131; + $$0 = $$1; + $$093 = $$194; + $$095 = $$196 + 1 | 0; + $$3 = $130; + } + } while (0); + $135 = HEAP32[$2 >> 2] | 0; + if (($67 | 0) == ($135 | 0)) $$2 = $spec$select; else { + $$0$i$i106 = $135; + $$07$i$i = $67; + while (1) { + $137 = $$0$i$i106 + -1 | 0; + if ($$07$i$i >>> 0 >= $137 >>> 0) { + $$2 = $spec$select; + break L4; + } + $139 = HEAP8[$$07$i$i >> 0] | 0; + HEAP8[$$07$i$i >> 0] = HEAP8[$137 >> 0] | 0; + HEAP8[$137 >> 0] = $139; + $$0$i$i106 = $137; + $$07$i$i = $$07$i$i + 1 | 0; + } + } + break; + } + default: + $$2 = $$097; + } while (0); + $$0104 = $$0104 + 1 | 0; + $$097 = $$2; + } + $25 = HEAP8[$15 >> 0] | 0; + $26 = $25 << 24 >> 24 < 0; + $29 = $26 ? HEAP32[$16 >> 2] | 0 : $25 & 255; + if ($29 >>> 0 > 1) { + $$pn = $26 ? HEAP32[$13 >> 2] | 0 : $13; + $144 = $$pn + $29 | 0; + $$0$i$i = HEAP32[$2 >> 2] | 0; + $$pn$pn = $$pn; + while (1) { + $$sroa$08$0$i = $$pn$pn + 1 | 0; + if (($$sroa$08$0$i | 0) == ($144 | 0)) break; + HEAP8[$$0$i$i >> 0] = HEAP8[$$sroa$08$0$i >> 0] | 0; + $$0$i$i = $$0$i$i + 1 | 0; + $$pn$pn = $$sroa$08$0$i; + } + HEAP32[$2 >> 2] = $$0$i$i; + } + switch (($3 & 176) << 24 >> 24) { + case 32: + { + HEAP32[$1 >> 2] = HEAP32[$2 >> 2]; + break; + } + case 16: + break; + default: + HEAP32[$1 >> 2] = $0; + } + return; +} + +function __ZNSt3__220__get_up_to_n_digitsIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i25 = 0, $$0$i$i$i$i40 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i31 = 0, $$0$i$i2$i$i46 = 0, $$0$i$i36 = 0, $$0$in = 0, $$023 = 0, $$023$in = 0, $$2 = 0, $107 = 0, $108 = 0, $111 = 0, $113 = 0, $123 = 0, $137 = 0, $138 = 0, $139 = 0, $140 = 0, $151 = 0, $164 = 0, $166 = 0, $180 = 0, $181 = 0, $182 = 0, $183 = 0, $184 = 0, $20 = 0, $23 = 0, $37 = 0, $39 = 0, $49 = 0, $5 = 0, $52 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $76 = 0, $79 = 0, $8 = 0, $92 = 0, $94 = 0, label = 0; + $5 = HEAP32[$0 >> 2] | 0; + do if ($5) { + $8 = HEAP32[$5 + 12 >> 2] | 0; + if (($8 | 0) == (HEAP32[$5 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$5 >> 2] | 0) + 36 >> 2] & 127]($5) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$8 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $180 = 1; + break; + } else { + $180 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $180 = 1; while (0); + $20 = HEAP32[$1 >> 2] | 0; + do if ($20) { + $23 = HEAP32[$20 + 12 >> 2] | 0; + if (($23 | 0) == (HEAP32[$20 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$20 >> 2] | 0) + 36 >> 2] & 127]($20) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$23 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($180) { + $181 = $20; + label = 17; + break; + } else { + label = 16; + break; + } else { + HEAP32[$1 >> 2] = 0; + label = 14; + break; + } + } else label = 14; while (0); + if ((label | 0) == 14) if ($180) label = 16; else { + $181 = 0; + label = 17; + } + L22 : do if ((label | 0) == 16) { + HEAP32[$2 >> 2] = HEAP32[$2 >> 2] | 6; + $$2 = 0; + } else if ((label | 0) == 17) { + $37 = HEAP32[$0 >> 2] | 0; + $39 = HEAP32[$37 + 12 >> 2] | 0; + if (($39 | 0) == (HEAP32[$37 + 16 >> 2] | 0)) $$0$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$37 >> 2] | 0) + 36 >> 2] & 127]($37) | 0; else $$0$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$39 >> 0] | 0) | 0; + $49 = $$0$i$i & 255; + if ($49 << 24 >> 24 > -1 ? ($52 = $3 + 8 | 0, HEAP16[(HEAP32[$52 >> 2] | 0) + ($$0$i$i << 24 >> 24 << 1) >> 1] & 2048) : 0) { + $64 = (FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$3 >> 2] | 0) + 36 >> 2] & 63]($3, $49, 0) | 0) << 24 >> 24; + $65 = HEAP32[$0 >> 2] | 0; + $66 = $65 + 12 | 0; + $67 = HEAP32[$66 >> 2] | 0; + if (($67 | 0) == (HEAP32[$65 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$65 >> 2] | 0) + 40 >> 2] & 127]($65) | 0; else { + HEAP32[$66 >> 2] = $67 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$67 >> 0] | 0) | 0; + } + $$0$in = $64; + $$023$in = $4; + $182 = $181; + $92 = $181; + while (1) { + $$0 = $$0$in + -48 | 0; + $$023 = $$023$in + -1 | 0; + $76 = HEAP32[$0 >> 2] | 0; + do if ($76) { + $79 = HEAP32[$76 + 12 >> 2] | 0; + if (($79 | 0) == (HEAP32[$76 + 16 >> 2] | 0)) $$0$i$i$i$i25 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$76 >> 2] | 0) + 36 >> 2] & 127]($76) | 0; else $$0$i$i$i$i25 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$79 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i25, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $107 = 1; + break; + } else { + $107 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $107 = 1; while (0); + if ($92) { + $94 = HEAP32[$92 + 12 >> 2] | 0; + if (($94 | 0) == (HEAP32[$92 + 16 >> 2] | 0)) $$0$i$i2$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$92 >> 2] | 0) + 36 >> 2] & 127]($92) | 0; else $$0$i$i2$i$i31 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$94 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i31, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $108 = 1; + $164 = 0; + $183 = 0; + } else { + $108 = 0; + $164 = $182; + $183 = $92; + } + } else { + $108 = 1; + $164 = $182; + $183 = 0; + } + $111 = HEAP32[$0 >> 2] | 0; + if (!(($$023$in | 0) > 1 & ($107 ^ $108))) break; + $113 = HEAP32[$111 + 12 >> 2] | 0; + if (($113 | 0) == (HEAP32[$111 + 16 >> 2] | 0)) $$0$i$i36 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$111 >> 2] | 0) + 36 >> 2] & 127]($111) | 0; else $$0$i$i36 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$113 >> 0] | 0) | 0; + $123 = $$0$i$i36 & 255; + if ($123 << 24 >> 24 <= -1) { + $$2 = $$0; + break L22; + } + if (!(HEAP16[(HEAP32[$52 >> 2] | 0) + ($$0$i$i36 << 24 >> 24 << 1) >> 1] & 2048)) { + $$2 = $$0; + break L22; + } + $137 = ($$0 * 10 | 0) + ((FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$3 >> 2] | 0) + 36 >> 2] & 63]($3, $123, 0) | 0) << 24 >> 24) | 0; + $138 = HEAP32[$0 >> 2] | 0; + $139 = $138 + 12 | 0; + $140 = HEAP32[$139 >> 2] | 0; + if (($140 | 0) == (HEAP32[$138 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$138 >> 2] | 0) + 40 >> 2] & 127]($138) | 0; else { + HEAP32[$139 >> 2] = $140 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$140 >> 0] | 0) | 0; + } + $$0$in = $137; + $$023$in = $$023; + $182 = $164; + $92 = $183; + } + do if ($111) { + $151 = HEAP32[$111 + 12 >> 2] | 0; + if (($151 | 0) == (HEAP32[$111 + 16 >> 2] | 0)) $$0$i$i$i$i40 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$111 >> 2] | 0) + 36 >> 2] & 127]($111) | 0; else $$0$i$i$i$i40 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$151 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i40, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $184 = 1; + break; + } else { + $184 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $184 = 1; while (0); + do if ($164) { + $166 = HEAP32[$164 + 12 >> 2] | 0; + if (($166 | 0) == (HEAP32[$164 + 16 >> 2] | 0)) $$0$i$i2$i$i46 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$164 >> 2] | 0) + 36 >> 2] & 127]($164) | 0; else $$0$i$i2$i$i46 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$166 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i46, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($184) { + $$2 = $$0; + break L22; + } else break; else { + HEAP32[$1 >> 2] = 0; + label = 63; + break; + } + } else label = 63; while (0); + if ((label | 0) == 63 ? !$184 : 0) { + $$2 = $$0; + break; + } + HEAP32[$2 >> 2] = HEAP32[$2 >> 2] | 2; + $$2 = $$0; + break; + } + HEAP32[$2 >> 2] = HEAP32[$2 >> 2] | 4; + $$2 = 0; + } while (0); + return $$2 | 0; +} + +function __ZN6vision20BinaryFeatureMatcherILi96EE5matchEPKNS_18BinaryFeatureStoreES4_PKff($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = +$4; + var $$0 = 0, $$070 = 0, $$071 = 0, $$072 = 0, $$073 = 0, $$076 = 0, $$2 = 0, $$275 = 0, $$278 = 0, $10 = 0, $110 = 0, $113 = 0, $118 = 0, $119 = 0, $131 = 0, $136 = 0, $140 = 0, $15 = 0.0, $22 = 0, $27 = 0, $31 = 0, $33 = 0, $34 = 0, $40 = 0, $43 = 0, $44 = 0, $48 = 0, $5 = 0, $52 = 0, $6 = 0, $60 = 0.0, $69 = 0, $7 = 0, $70 = 0, $79 = 0, $8 = 0, $84 = 0, $88 = 0, $90 = 0, $93 = 0, $98 = 0, $99 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $5 = sp + 40 | 0; + $6 = sp; + $7 = sp + 52 | 0; + $8 = sp + 48 | 0; + $10 = $0 + 4 | 0; + HEAP32[$10 >> 2] = HEAP32[$0 >> 2]; + do if ((__ZNK6vision18BinaryFeatureStore4sizeEv($1) | 0) != 0 ? (__ZNK6vision18BinaryFeatureStore4sizeEv($2) | 0) != 0 : 0) { + $15 = +__ZN6vision3sqrIfEET_S1_($4); + if (!(__ZN6vision16MatrixInverse3x3IfEEbPT_PKS1_S1_($6, $3, 0.0) | 0)) { + $22 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 35204) | 0, 35229) | 0, 39072) | 0, 196) | 0, 39079) | 0, 35315) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $22 + (HEAP32[(HEAP32[$22 >> 2] | 0) + -12 >> 2] | 0) | 0); + $27 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $31 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$27 >> 2] | 0) + 28 >> 2] & 127]($27, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($22, $31) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($22) | 0; + _abort(); + } + __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE7reserveEm($0, __ZNK6vision18BinaryFeatureStore4sizeEv($1) | 0); + $33 = $0 + 8 | 0; + $34 = $0 + 12 | 0; + $$070 = 0; + L7 : while (1) { + if ($$070 >>> 0 >= (__ZNK6vision18BinaryFeatureStore4sizeEv($1) | 0) >>> 0) break; + $43 = __ZNK6vision18BinaryFeatureStore7featureEm($1, $$070) | 0; + $44 = __ZNK6vision18BinaryFeatureStore5pointEm($1, $$070) | 0; + __ZN6vision35MultiplyPointHomographyInhomogenousIfEEvRT_S2_PKS1_S1_S1_($7, $8, $6, +HEAPF32[$44 >> 2], +HEAPF32[$44 + 4 >> 2]); + $48 = $44 + 16 | 0; + $$071 = 0; + $$072 = -1; + $$073 = -1; + $$076 = 2147483647; + while (1) { + if ($$071 >>> 0 >= (__ZNK6vision18BinaryFeatureStore4sizeEv($2) | 0) >>> 0) break; + $52 = __ZNK6vision18BinaryFeatureStore5pointEm($2, $$071) | 0; + if ((HEAP8[$48 >> 0] | 0) == (HEAP8[$52 + 16 >> 0] | 0) ? ($60 = +__ZN6vision3sqrIfEET_S1_(+HEAPF32[$7 >> 2] - +HEAPF32[$52 >> 2]), !($60 + +__ZN6vision3sqrIfEET_S1_(+HEAPF32[$8 >> 2] - +HEAPF32[$52 + 4 >> 2]) > $15)) : 0) { + $69 = __ZN6vision18HammingDistance768EPKjS1_($43, __ZNK6vision18BinaryFeatureStore7featureEm($2, $$071) | 0) | 0; + $70 = $69 >>> 0 < $$072 >>> 0; + $$2 = $70 ? $69 : $$072; + $$275 = $70 ? $$072 : $69 >>> 0 < $$073 >>> 0 ? $69 : $$073; + $$278 = $70 ? $$071 : $$076; + } else { + $$2 = $$072; + $$275 = $$073; + $$278 = $$076; + } + $$071 = $$071 + 1 | 0; + $$072 = $$2; + $$073 = $$275; + $$076 = $$278; + } + do if (($$072 | 0) != -1) { + if (($$076 | 0) == -1) { + label = 16; + break L7; + } + if (($$073 | 0) == -1) { + __ZN6vision7match_tC2Eii($5, $$070, $$076); + $90 = HEAP32[$10 >> 2] | 0; + if ($90 >>> 0 < (HEAP32[$33 >> 2] | 0) >>> 0) { + $93 = $5; + $98 = HEAP32[$93 + 4 >> 2] | 0; + $99 = $90; + HEAP32[$99 >> 2] = HEAP32[$93 >> 2]; + HEAP32[$99 + 4 >> 2] = $98; + HEAP32[$10 >> 2] = (HEAP32[$10 >> 2] | 0) + 8; + } else __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_($0, $5); + break; + } + if (+($$072 >>> 0) / +($$073 >>> 0) < +HEAPF32[$34 >> 2]) { + __ZN6vision7match_tC2Eii($5, $$070, $$076); + $110 = HEAP32[$10 >> 2] | 0; + if ($110 >>> 0 < (HEAP32[$33 >> 2] | 0) >>> 0) { + $113 = $5; + $118 = HEAP32[$113 + 4 >> 2] | 0; + $119 = $110; + HEAP32[$119 >> 2] = HEAP32[$113 >> 2]; + HEAP32[$119 + 4 >> 2] = $118; + HEAP32[$10 >> 2] = (HEAP32[$10 >> 2] | 0) + 8; + } else __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_($0, $5); + } + } while (0); + $$070 = $$070 + 1 | 0; + } + if ((label | 0) == 16) { + $79 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 35348) | 0, 35229) | 0, 39072) | 0, 241) | 0, 39079) | 0, 35420) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $79 + (HEAP32[(HEAP32[$79 >> 2] | 0) + -12 >> 2] | 0) | 0); + $84 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $88 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$84 >> 2] | 0) + 28 >> 2] & 127]($84, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($79, $88) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($79) | 0; + _abort(); + } + $40 = (HEAP32[$10 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 3; + if ($40 >>> 0 > (__ZNK6vision18BinaryFeatureStore4sizeEv($1) | 0) >>> 0) { + $131 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 35438) | 0, 35229) | 0, 39072) | 0, 256) | 0, 39079) | 0, 35498) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $131 + (HEAP32[(HEAP32[$131 >> 2] | 0) + -12 >> 2] | 0) | 0); + $136 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $140 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$136 >> 2] | 0) + 28 >> 2] & 127]($136, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($131, $140) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($131) | 0; + _abort(); + } else { + $$0 = (HEAP32[$10 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 3; + break; + } + } else $$0 = 0; while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function _start_pass($0) { + $0 = $0 | 0; + var $$0140148 = 0, $$0152 = 0, $$1144 = 0, $$phi$trans$insert158 = 0, $$pre$phi163Z2D = 0, $$pre$phiZ2D = 0, $10 = 0, $103 = 0, $108 = 0, $114 = 0, $115 = 0, $116 = 0, $117 = 0, $119 = 0, $127 = 0, $129 = 0, $134 = 0, $135 = 0, $139 = 0, $140 = 0, $148 = 0, $150 = 0, $155 = 0, $156 = 0, $160 = 0, $161 = 0, $165 = 0, $166 = 0, $167 = 0, $168 = 0, $169 = 0, $170 = 0, $171 = 0, $2 = 0, $20 = 0, $22 = 0, $27 = 0, $28 = 0, $3 = 0, $44 = 0, $45 = 0, $47 = 0, $48 = 0, $49 = 0, $53 = 0, $54 = 0, $55 = 0, $6 = 0, $60 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $76 = 0, $8 = 0, $89 = 0, $9 = 0, $94 = 0, $95 = 0, dest = 0, label = 0, stop = 0; + $2 = HEAP32[$0 + 468 >> 2] | 0; + $3 = $0 + 224 | 0; + $6 = $0 + 412 | 0; + $7 = HEAP32[$6 >> 2] | 0; + $8 = ($7 | 0) == 0; + do if (HEAP32[$3 >> 2] | 0) { + $9 = $0 + 416 | 0; + $10 = HEAP32[$9 >> 2] | 0; + if ($8) if (!$10) label = 7; else label = 11; else if ((($10 | 0) >= ($7 | 0) ? ($10 | 0) <= (HEAP32[$0 + 436 >> 2] | 0) : 0) ? (HEAP32[$0 + 340 >> 2] | 0) == 1 : 0) label = 7; else label = 11; + do if ((label | 0) == 7) { + $20 = HEAP32[$0 + 420 >> 2] | 0; + if ($20) { + $22 = $20 + -1 | 0; + if (($22 | 0) == (HEAP32[$0 + 424 >> 2] | 0)) $27 = $22; else { + label = 11; + break; + } + } else $27 = HEAP32[$0 + 424 >> 2] | 0; + if (($27 | 0) > 13) label = 11; + } while (0); + if ((label | 0) == 11) { + $28 = HEAP32[$0 >> 2] | 0; + HEAP32[$28 + 20 >> 2] = 17; + HEAP32[$28 + 24 >> 2] = $7; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = HEAP32[$9 >> 2]; + HEAP32[(HEAP32[$0 >> 2] | 0) + 32 >> 2] = HEAP32[$0 + 420 >> 2]; + HEAP32[(HEAP32[$0 >> 2] | 0) + 36 >> 2] = HEAP32[$0 + 424 >> 2]; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $44 = $0 + 340 | 0; + $45 = HEAP32[$44 >> 2] | 0; + if (($45 | 0) > 0) { + $47 = $0 + 160 | 0; + $48 = $0 + 420 | 0; + $49 = $0 + 424 | 0; + $$0152 = 0; + do { + $53 = HEAP32[(HEAP32[$0 + 344 + ($$0152 << 2) >> 2] | 0) + 4 >> 2] | 0; + $54 = HEAP32[$47 >> 2] | 0; + $55 = HEAP32[$6 >> 2] | 0; + if ($55) if ((HEAP32[$54 + ($53 << 8) >> 2] | 0) < 0) { + $60 = HEAP32[$0 >> 2] | 0; + HEAP32[$60 + 20 >> 2] = 118; + HEAP32[$60 + 24 >> 2] = $53; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, -1); + $70 = HEAP32[$6 >> 2] | 0; + } else $70 = $55; else $70 = 0; + if (($70 | 0) <= (HEAP32[$9 >> 2] | 0)) { + $$0140148 = $70; + while (1) { + $71 = $54 + ($53 << 8) + ($$0140148 << 2) | 0; + $72 = HEAP32[$71 >> 2] | 0; + if ((HEAP32[$48 >> 2] | 0) != ((($72 | 0) > 0 ? $72 : 0) | 0)) { + $76 = HEAP32[$0 >> 2] | 0; + HEAP32[$76 + 20 >> 2] = 118; + HEAP32[$76 + 24 >> 2] = $53; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = $$0140148; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, -1); + } + HEAP32[$71 >> 2] = HEAP32[$49 >> 2]; + if (($$0140148 | 0) < (HEAP32[$9 >> 2] | 0)) $$0140148 = $$0140148 + 1 | 0; else break; + } + } + $$0152 = $$0152 + 1 | 0; + $89 = HEAP32[$44 >> 2] | 0; + } while (($$0152 | 0) < ($89 | 0)); + $$pre$phi163Z2D = $48; + $171 = $89; + } else { + $$pre$phi163Z2D = $0 + 420 | 0; + $171 = $45; + } + $94 = (HEAP32[$6 >> 2] | 0) == 0; + $95 = $2 + 4 | 0; + if (!(HEAP32[$$pre$phi163Z2D >> 2] | 0)) if ($94) { + HEAP32[$95 >> 2] = 66; + $$pre$phiZ2D = $44; + $114 = $171; + break; + } else { + HEAP32[$95 >> 2] = 67; + $$pre$phiZ2D = $44; + $114 = $171; + break; + } else if ($94) { + HEAP32[$95 >> 2] = 68; + $$pre$phiZ2D = $44; + $114 = $171; + break; + } else { + HEAP32[$95 >> 2] = 69; + $$pre$phiZ2D = $44; + $114 = $171; + break; + } + } else { + if (($8 ? (HEAP32[$0 + 420 >> 2] | 0) == 0 : 0) ? (HEAP32[$0 + 424 >> 2] | 0) == 0 : 0) { + $103 = HEAP32[$0 + 416 >> 2] | 0; + if (($103 | 0) < 64 ? ($103 | 0) != (HEAP32[$0 + 436 >> 2] | 0) : 0) label = 36; + } else label = 36; + if ((label | 0) == 36) { + $108 = HEAP32[$0 >> 2] | 0; + HEAP32[$108 + 20 >> 2] = 125; + FUNCTION_TABLE_vii[HEAP32[$108 + 4 >> 2] & 255]($0, -1); + } + HEAP32[$2 + 4 >> 2] = 70; + $$phi$trans$insert158 = $0 + 340 | 0; + $$pre$phiZ2D = $$phi$trans$insert158; + $114 = HEAP32[$$phi$trans$insert158 >> 2] | 0; + } while (0); + if (($114 | 0) <= 0) { + $165 = $2 + 12 | 0; + HEAP32[$165 >> 2] = 0; + $166 = $2 + 16 | 0; + HEAP32[$166 >> 2] = 0; + $167 = $2 + 20 | 0; + HEAP32[$167 >> 2] = -16; + $168 = $0 + 280 | 0; + $169 = HEAP32[$168 >> 2] | 0; + $170 = $2 + 56 | 0; + HEAP32[$170 >> 2] = $169; + return; + } + $115 = $0 + 436 | 0; + $116 = $0 + 420 | 0; + $117 = $0 + 4 | 0; + $$1144 = 0; + do { + $119 = HEAP32[$0 + 344 + ($$1144 << 2) >> 2] | 0; + if (HEAP32[$3 >> 2] | 0) if (!(HEAP32[$6 >> 2] | 0)) { + if (!(HEAP32[$116 >> 2] | 0)) label = 43; + } else label = 50; else label = 43; + do if ((label | 0) == 43) { + label = 0; + $127 = HEAP32[$119 + 20 >> 2] | 0; + if ($127 >>> 0 > 15) { + $129 = HEAP32[$0 >> 2] | 0; + HEAP32[$129 + 20 >> 2] = 50; + HEAP32[$129 + 24 >> 2] = $127; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $134 = $2 + 60 + ($127 << 2) | 0; + $135 = HEAP32[$134 >> 2] | 0; + if (!$135) { + $139 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$117 >> 2] >> 2] & 63]($0, 1, 64) | 0; + HEAP32[$134 >> 2] = $139; + $140 = $139; + } else $140 = $135; + dest = $140; + stop = dest + 64 | 0; + do { + HEAP8[dest >> 0] = 0; + dest = dest + 1 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$2 + 24 + ($$1144 << 2) >> 2] = 0; + HEAP32[$2 + 40 + ($$1144 << 2) >> 2] = 0; + if (!(HEAP32[$3 >> 2] | 0)) if (!(HEAP32[$115 >> 2] | 0)) break; else { + label = 50; + break; + } else if (!(HEAP32[$6 >> 2] | 0)) break; else { + label = 50; + break; + } + } while (0); + if ((label | 0) == 50) { + label = 0; + $148 = HEAP32[$119 + 24 >> 2] | 0; + if ($148 >>> 0 > 15) { + $150 = HEAP32[$0 >> 2] | 0; + HEAP32[$150 + 20 >> 2] = 50; + HEAP32[$150 + 24 >> 2] = $148; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $155 = $2 + 124 + ($148 << 2) | 0; + $156 = HEAP32[$155 >> 2] | 0; + if (!$156) { + $160 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$117 >> 2] >> 2] & 63]($0, 1, 256) | 0; + HEAP32[$155 >> 2] = $160; + $161 = $160; + } else $161 = $156; + _memset($161 | 0, 0, 256) | 0; + } + $$1144 = $$1144 + 1 | 0; + } while (($$1144 | 0) < (HEAP32[$$pre$phiZ2D >> 2] | 0)); + $165 = $2 + 12 | 0; + HEAP32[$165 >> 2] = 0; + $166 = $2 + 16 | 0; + HEAP32[$166 >> 2] = 0; + $167 = $2 + 20 | 0; + HEAP32[$167 >> 2] = -16; + $168 = $0 + 280 | 0; + $169 = HEAP32[$168 >> 2] | 0; + $170 = $2 + 56 | 0; + HEAP32[$170 >> 2] = $169; + return; +} + +function __ZN6vision16PruneDoGFeaturesERNSt3__26vectorINS1_INS1_INS0_4pairIfmEENS0_9allocatorIS3_EEEENS4_IS6_EEEENS4_IS8_EEEERNS1_INS_25DoGScaleInvariantDetector12FeaturePointENS4_ISD_EEEERKSF_iiiii($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $$0 = 0, $$087 = 0, $$089 = 0, $$090 = 0, $$091 = 0, $$byval_copy = 0, $$byval_copy1 = 0, $$byval_copy2 = 0, $$cast = 0, $$pre = 0, $$pre118 = 0, $$pre118119 = 0, $$pre118120 = 0, $$sroa$speculated = 0, $10 = 0, $101 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $109 = 0, $11 = 0, $116 = 0, $12 = 0, $120 = 0, $130 = 0, $135 = 0, $139 = 0, $145 = 0, $146 = 0, $153 = 0, $16 = 0.0, $20 = 0.0, $22 = 0, $23 = 0, $25 = 0, $27 = 0, $28 = 0, $31 = 0, $32 = 0.0, $33 = 0.0, $34 = 0, $38 = 0, $40 = 0, $41 = 0, $48 = 0, $52 = 0, $53 = 0, $54 = 0, $62 = 0, $65 = 0, $68 = 0.0, $69 = 0, $70 = 0, $74 = 0, $79 = 0, $8 = 0, $80 = 0, $9 = 0, $90 = 0, $94 = 0, $97 = 0, $storemerge = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy2 = sp + 8 | 0; + $$byval_copy1 = sp + 32 | 0; + $$byval_copy = sp + 28 | 0; + $8 = sp + 24 | 0; + $9 = sp + 20 | 0; + $10 = sp + 16 | 0; + $11 = sp; + $12 = Math_imul($4, $3) | 0; + $16 = +Math_ceil(+(+($5 | 0) / +($3 | 0))); + $20 = +Math_ceil(+(+($6 | 0) / +($4 | 0))); + $22 = $1 + 4 | 0; + HEAP32[$22 >> 2] = HEAP32[$1 >> 2]; + __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE7reserveEm($1, $7); + $23 = $0 + 4 | 0; + $25 = HEAP32[$0 >> 2] | 0; + $27 = ((HEAP32[$23 >> 2] | 0) - $25 | 0) / 12 | 0; + $$cast = $25; + $$087 = 0; + while (1) { + if (($$087 | 0) == ($27 | 0)) break; + $38 = HEAP32[$$cast + ($$087 * 12 | 0) >> 2] | 0; + $40 = ((HEAP32[$$cast + ($$087 * 12 | 0) + 4 >> 2] | 0) - $38 | 0) / 12 | 0; + $41 = $38; + $$091 = 0; + while (1) { + if (($$091 | 0) == ($40 | 0)) break; + HEAP32[$41 + ($$091 * 12 | 0) + 4 >> 2] = HEAP32[$41 + ($$091 * 12 | 0) >> 2]; + $$091 = $$091 + 1 | 0; + } + $$087 = $$087 + 1 | 0; + } + $28 = ($7 | 0) / ($12 | 0) | 0; + $31 = $2 + 4 | 0; + $32 = +(~~$16 | 0); + $33 = +(~~$20 | 0); + $34 = $$byval_copy2 + 4 | 0; + $storemerge = 0; + while (1) { + $48 = HEAP32[$2 >> 2] | 0; + $52 = $48; + if ($storemerge >>> 0 >= (((HEAP32[$31 >> 2] | 0) - $48 | 0) / 36 | 0) >>> 0) break; + $62 = ~~(+HEAPF32[$52 + ($storemerge * 36 | 0) + 4 >> 2] / $33); + $65 = HEAP32[(HEAP32[$0 >> 2] | 0) + (~~(+HEAPF32[$52 + ($storemerge * 36 | 0) >> 2] / $32) * 12 | 0) >> 2] | 0; + $68 = +Math_abs(+(+HEAPF32[$52 + ($storemerge * 36 | 0) + 24 >> 2])); + HEAPF32[$$byval_copy2 >> 2] = $68; + HEAP32[$34 >> 2] = $storemerge; + $69 = $65 + ($62 * 12 | 0) + 4 | 0; + $70 = HEAP32[$69 >> 2] | 0; + if ($70 >>> 0 < (HEAP32[$65 + ($62 * 12 | 0) + 8 >> 2] | 0) >>> 0) { + $74 = $$byval_copy2; + $79 = HEAP32[$74 + 4 >> 2] | 0; + $80 = $70; + HEAP32[$80 >> 2] = HEAP32[$74 >> 2]; + HEAP32[$80 + 4 >> 2] = $79; + HEAP32[$69 >> 2] = (HEAP32[$69 >> 2] | 0) + 8; + } else __ZNSt3__26vectorINS_4pairIfmEENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_($65 + ($62 * 12 | 0) | 0, $$byval_copy2); + $storemerge = $storemerge + 1 | 0; + } + $53 = $1 + 8 | 0; + $$pre = HEAP32[$0 >> 2] | 0; + $54 = $$pre; + $$090 = 0; + $$pre118119 = $54; + $153 = $54; + $90 = $$pre; + L17 : while (1) { + if ($$090 >>> 0 >= (((HEAP32[$23 >> 2] | 0) - $90 | 0) / 12 | 0) >>> 0) { + label = 16; + break; + } + $$089 = 0; + $$pre118120 = $$pre118119; + $94 = $153; + while (1) { + $97 = HEAP32[$94 + ($$090 * 12 | 0) >> 2] | 0; + $101 = $97; + if ($$089 >>> 0 >= (((HEAP32[$94 + ($$090 * 12 | 0) + 4 >> 2] | 0) - $97 | 0) / 12 | 0) >>> 0) break; + $104 = $101 + ($$089 * 12 | 0) | 0; + $105 = $101 + ($$089 * 12 | 0) + 4 | 0; + $106 = HEAP32[$105 >> 2] | 0; + $107 = HEAP32[$104 >> 2] | 0; + $109 = $106 - $107 >> 3; + $$sroa$speculated = $28 >>> 0 < $109 >>> 0 ? $28 : $109; + if (!$$sroa$speculated) $$pre118 = $$pre118120; else { + HEAP32[$8 >> 2] = $107; + HEAP32[$9 >> 2] = $107 + ($$sroa$speculated << 3); + HEAP32[$10 >> 2] = $106; + HEAP32[$$byval_copy >> 2] = HEAP32[$8 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$$byval_copy2 >> 2] = HEAP32[$10 >> 2]; + __ZNSt3__213__nth_elementIRNS_7greaterINS_4pairIfmEEEENS_11__wrap_iterIPS3_EEEEvT0_S9_S9_T_($$byval_copy, $$byval_copy1, $$byval_copy2, $11); + $116 = HEAP32[$104 >> 2] | 0; + $120 = $116; + if ($$sroa$speculated >>> 0 > (HEAP32[$105 >> 2] | 0) - $116 >> 3 >>> 0 ? !(+HEAPF32[$120 >> 2] >= +HEAPF32[$120 + ($$sroa$speculated << 3) >> 2]) : 0) { + label = 23; + break L17; + } + $$0 = 0; + while (1) { + if ($$0 >>> 0 >= $$sroa$speculated >>> 0) break; + $145 = (HEAP32[$2 >> 2] | 0) + ((HEAP32[(HEAP32[$104 >> 2] | 0) + ($$0 << 3) + 4 >> 2] | 0) * 36 | 0) | 0; + $146 = HEAP32[$22 >> 2] | 0; + if (($146 | 0) == (HEAP32[$53 >> 2] | 0)) __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE21__push_back_slow_pathIRKS3_EEvOT_($1, $145); else { + dest = $146; + src = $145; + stop = dest + 36 | 0; + do { + HEAP32[dest >> 2] = HEAP32[src >> 2]; + dest = dest + 4 | 0; + src = src + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$22 >> 2] = (HEAP32[$22 >> 2] | 0) + 36; + } + $$0 = $$0 + 1 | 0; + } + $$pre118 = HEAP32[$0 >> 2] | 0; + } + $$089 = $$089 + 1 | 0; + $$pre118120 = $$pre118; + $94 = $$pre118; + } + $$090 = $$090 + 1 | 0; + $$pre118119 = $$pre118120; + $153 = $94; + $90 = $94; + } + if ((label | 0) == 16) { + STACKTOP = sp; + return; + } else if ((label | 0) == 23) { + $130 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 28243) | 0, 26748) | 0, 39072) | 0, 661) | 0, 39079) | 0, 28301) | 0; + __ZNKSt3__28ios_base6getlocEv($$byval_copy2, $130 + (HEAP32[(HEAP32[$130 >> 2] | 0) + -12 >> 2] | 0) | 0); + $135 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy2, 66512) | 0; + $139 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$135 >> 2] | 0) + 28 >> 2] & 127]($135, 10) | 0; + __ZNSt3__26localeD2Ev($$byval_copy2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($130, $139) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($130) | 0; + _abort(); + } +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedIyEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i25 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i31 = 0, $$0$i$i41 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $103 = 0, $11 = 0, $110 = 0, $115 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $127 = 0, $13 = 0, $132 = 0, $14 = 0, $141 = 0, $143 = 0, $15 = 0, $157 = 0, $158 = 0, $159 = 0, $160 = 0, $18 = 0, $21 = 0, $24 = 0, $28 = 0, $29 = 0, $31 = 0, $33 = 0, $45 = 0, $48 = 0, $6 = 0, $61 = 0, $65 = 0, $73 = 0, $77 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $9 = 0, $94 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 304 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(304); + $6 = sp + 300 | 0; + $8 = sp + 288 | 0; + $9 = sp + 276 | 0; + $10 = sp + 272 | 0; + $11 = sp; + $12 = sp + 268 | 0; + $13 = sp + 264 | 0; + $14 = __ZNSt3__214__num_get_base10__get_baseERNS_8ios_baseE($3) | 0; + $15 = __ZNKSt3__29__num_getIwE10__do_widenERNS_8ios_baseEPw($0, $3, sp + 160 | 0) | 0; + __ZNSt3__29__num_getIwE17__stage2_int_prepERNS_8ios_baseERw($8, $3, $6); + HEAP32[$9 >> 2] = 0; + HEAP32[$9 + 4 >> 2] = 0; + HEAP32[$9 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$9 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $18 = $9 + 11 | 0; + $21 = $9 + 8 | 0; + if ((HEAP8[$18 >> 0] | 0) < 0) $24 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $24 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $24, 0); + $28 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $28; + HEAP32[$12 >> 2] = $11; + HEAP32[$13 >> 2] = 0; + $29 = $9 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $28; + $157 = $$pre; + $31 = $$pre; + L8 : while (1) { + if ($31) { + $33 = HEAP32[$31 + 12 >> 2] | 0; + if (($33 | 0) == (HEAP32[$31 + 16 >> 2] | 0)) $$0$i$i$i$i25 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$31 >> 2] | 0) + 36 >> 2] & 127]($31) | 0; else $$0$i$i$i$i25 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$33 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i25, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $132 = 0; + $158 = 1; + $80 = 0; + } else { + $132 = $157; + $158 = 0; + $80 = $31; + } + } else { + $132 = 0; + $158 = 1; + $80 = 0; + } + $45 = HEAP32[$2 >> 2] | 0; + do if ($45) { + $48 = HEAP32[$45 + 12 >> 2] | 0; + if (($48 | 0) == (HEAP32[$45 + 16 >> 2] | 0)) $$0$i$i2$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$45 >> 2] | 0) + 36 >> 2] & 127]($45) | 0; else $$0$i$i2$i$i31 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$48 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i31, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($158) { + $159 = $45; + break; + } else { + $$2 = $$0; + $141 = $45; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($158) { + $$2 = $$0; + $141 = 0; + break; + } else $159 = 0; + } + $61 = HEAP8[$18 >> 0] | 0; + $65 = $61 << 24 >> 24 < 0 ? HEAP32[$29 >> 2] | 0 : $61 & 255; + if ((HEAP32[$10 >> 2] | 0) == ($$0 + $65 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $65 << 1, 0); + if ((HEAP8[$18 >> 0] | 0) < 0) $73 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $73 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $73, 0); + $77 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $77 + $65; + $$1 = $77; + } else $$1 = $$0; + $79 = $80 + 12 | 0; + $81 = HEAP32[$79 >> 2] | 0; + $82 = $80 + 16 | 0; + if (($81 | 0) == (HEAP32[$82 >> 2] | 0)) $$0$i$i41 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i41 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$81 >> 2] | 0) | 0; + if (__ZNSt3__29__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKw($$0$i$i41, $14, $$1, $10, $13, HEAP32[$6 >> 2] | 0, $8, $11, $12, $15) | 0) { + $$2 = $$1; + $141 = $159; + break; + } + $94 = HEAP32[$79 >> 2] | 0; + if (($94 | 0) == (HEAP32[$82 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 40 >> 2] & 127]($80) | 0; else { + HEAP32[$79 >> 2] = $94 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$94 >> 2] | 0) | 0; + } + $$0 = $$1; + $157 = $132; + $31 = $80; + } + $103 = HEAP8[$8 + 11 >> 0] | 0; + if (($103 << 24 >> 24 < 0 ? HEAP32[$8 + 4 >> 2] | 0 : $103 & 255) | 0 ? ($110 = HEAP32[$12 >> 2] | 0, ($110 - $11 | 0) < 160) : 0) { + $115 = HEAP32[$13 >> 2] | 0; + HEAP32[$12 >> 2] = $110 + 4; + HEAP32[$110 >> 2] = $115; + } + $118 = __ZNSt3__227__num_get_unsigned_integralIyEET_PKcS3_Rji($$2, HEAP32[$10 >> 2] | 0, $4, $14) | 0; + $119 = getTempRet0() | 0; + $120 = $5; + HEAP32[$120 >> 2] = $118; + HEAP32[$120 + 4 >> 2] = $119; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($8, $11, HEAP32[$12 >> 2] | 0, $4); + if ($80) { + $127 = HEAP32[$80 + 12 >> 2] | 0; + if (($127 | 0) == (HEAP32[$80 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$132 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$127 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $160 = 1; + } else $160 = 0; + } else $160 = 1; + do if ($141) { + $143 = HEAP32[$141 + 12 >> 2] | 0; + if (($143 | 0) == (HEAP32[$141 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$141 >> 2] | 0) + 36 >> 2] & 127]($141) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$143 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($160) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $160 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($8); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedIyEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i25 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i31 = 0, $$0$i$i41 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $104 = 0, $11 = 0, $111 = 0, $116 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $128 = 0, $13 = 0, $133 = 0, $14 = 0, $142 = 0, $144 = 0, $15 = 0, $158 = 0, $159 = 0, $160 = 0, $161 = 0, $18 = 0, $21 = 0, $24 = 0, $28 = 0, $29 = 0, $31 = 0, $33 = 0, $45 = 0, $48 = 0, $6 = 0, $61 = 0, $65 = 0, $73 = 0, $77 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $9 = 0, $95 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 240 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(240); + $6 = sp + 224 | 0; + $8 = sp + 212 | 0; + $9 = sp + 200 | 0; + $10 = sp + 196 | 0; + $11 = sp; + $12 = sp + 192 | 0; + $13 = sp + 188 | 0; + $14 = __ZNSt3__214__num_get_base10__get_baseERNS_8ios_baseE($3) | 0; + $15 = __ZNKSt3__29__num_getIcE10__do_widenERNS_8ios_baseEPc($0, $3, sp + 160 | 0) | 0; + __ZNSt3__29__num_getIcE17__stage2_int_prepERNS_8ios_baseERc($8, $3, $6); + HEAP32[$9 >> 2] = 0; + HEAP32[$9 + 4 >> 2] = 0; + HEAP32[$9 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$9 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $18 = $9 + 11 | 0; + $21 = $9 + 8 | 0; + if ((HEAP8[$18 >> 0] | 0) < 0) $24 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $24 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $24, 0); + $28 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $28; + HEAP32[$12 >> 2] = $11; + HEAP32[$13 >> 2] = 0; + $29 = $9 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $28; + $158 = $$pre; + $31 = $$pre; + L8 : while (1) { + if ($31) { + $33 = HEAP32[$31 + 12 >> 2] | 0; + if (($33 | 0) == (HEAP32[$31 + 16 >> 2] | 0)) $$0$i$i$i$i25 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$31 >> 2] | 0) + 36 >> 2] & 127]($31) | 0; else $$0$i$i$i$i25 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$33 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i25, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $133 = 0; + $159 = 1; + $80 = 0; + } else { + $133 = $158; + $159 = 0; + $80 = $31; + } + } else { + $133 = 0; + $159 = 1; + $80 = 0; + } + $45 = HEAP32[$2 >> 2] | 0; + do if ($45) { + $48 = HEAP32[$45 + 12 >> 2] | 0; + if (($48 | 0) == (HEAP32[$45 + 16 >> 2] | 0)) $$0$i$i2$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$45 >> 2] | 0) + 36 >> 2] & 127]($45) | 0; else $$0$i$i2$i$i31 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$48 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i31, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($159) { + $160 = $45; + break; + } else { + $$2 = $$0; + $142 = $45; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($159) { + $$2 = $$0; + $142 = 0; + break; + } else $160 = 0; + } + $61 = HEAP8[$18 >> 0] | 0; + $65 = $61 << 24 >> 24 < 0 ? HEAP32[$29 >> 2] | 0 : $61 & 255; + if ((HEAP32[$10 >> 2] | 0) == ($$0 + $65 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $65 << 1, 0); + if ((HEAP8[$18 >> 0] | 0) < 0) $73 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $73 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $73, 0); + $77 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $77 + $65; + $$1 = $77; + } else $$1 = $$0; + $79 = $80 + 12 | 0; + $81 = HEAP32[$79 >> 2] | 0; + $82 = $80 + 16 | 0; + if (($81 | 0) == (HEAP32[$82 >> 2] | 0)) $$0$i$i41 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i41 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$81 >> 0] | 0) | 0; + if (__ZNSt3__29__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKc($$0$i$i41 & 255, $14, $$1, $10, $13, HEAP8[$6 >> 0] | 0, $8, $11, $12, $15) | 0) { + $$2 = $$1; + $142 = $160; + break; + } + $95 = HEAP32[$79 >> 2] | 0; + if (($95 | 0) == (HEAP32[$82 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 40 >> 2] & 127]($80) | 0; else { + HEAP32[$79 >> 2] = $95 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$95 >> 0] | 0) | 0; + } + $$0 = $$1; + $158 = $133; + $31 = $80; + } + $104 = HEAP8[$8 + 11 >> 0] | 0; + if (($104 << 24 >> 24 < 0 ? HEAP32[$8 + 4 >> 2] | 0 : $104 & 255) | 0 ? ($111 = HEAP32[$12 >> 2] | 0, ($111 - $11 | 0) < 160) : 0) { + $116 = HEAP32[$13 >> 2] | 0; + HEAP32[$12 >> 2] = $111 + 4; + HEAP32[$111 >> 2] = $116; + } + $119 = __ZNSt3__227__num_get_unsigned_integralIyEET_PKcS3_Rji($$2, HEAP32[$10 >> 2] | 0, $4, $14) | 0; + $120 = getTempRet0() | 0; + $121 = $5; + HEAP32[$121 >> 2] = $119; + HEAP32[$121 + 4 >> 2] = $120; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($8, $11, HEAP32[$12 >> 2] | 0, $4); + if ($80) { + $128 = HEAP32[$80 + 12 >> 2] | 0; + if (($128 | 0) == (HEAP32[$80 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$133 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$128 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $161 = 1; + } else $161 = 0; + } else $161 = 1; + do if ($142) { + $144 = HEAP32[$142 + 12 >> 2] | 0; + if (($144 | 0) == (HEAP32[$142 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$142 >> 2] | 0) + 36 >> 2] & 127]($142) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$144 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($161) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $161 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($8); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__do_get_signedIxEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i25 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i31 = 0, $$0$i$i41 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $103 = 0, $11 = 0, $110 = 0, $115 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $127 = 0, $13 = 0, $132 = 0, $14 = 0, $141 = 0, $143 = 0, $15 = 0, $157 = 0, $158 = 0, $159 = 0, $160 = 0, $18 = 0, $21 = 0, $24 = 0, $28 = 0, $29 = 0, $31 = 0, $33 = 0, $45 = 0, $48 = 0, $6 = 0, $61 = 0, $65 = 0, $73 = 0, $77 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $9 = 0, $94 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 304 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(304); + $6 = sp + 300 | 0; + $8 = sp + 288 | 0; + $9 = sp + 276 | 0; + $10 = sp + 272 | 0; + $11 = sp; + $12 = sp + 268 | 0; + $13 = sp + 264 | 0; + $14 = __ZNSt3__214__num_get_base10__get_baseERNS_8ios_baseE($3) | 0; + $15 = __ZNKSt3__29__num_getIwE10__do_widenERNS_8ios_baseEPw($0, $3, sp + 160 | 0) | 0; + __ZNSt3__29__num_getIwE17__stage2_int_prepERNS_8ios_baseERw($8, $3, $6); + HEAP32[$9 >> 2] = 0; + HEAP32[$9 + 4 >> 2] = 0; + HEAP32[$9 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$9 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $18 = $9 + 11 | 0; + $21 = $9 + 8 | 0; + if ((HEAP8[$18 >> 0] | 0) < 0) $24 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $24 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $24, 0); + $28 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $28; + HEAP32[$12 >> 2] = $11; + HEAP32[$13 >> 2] = 0; + $29 = $9 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $28; + $157 = $$pre; + $31 = $$pre; + L8 : while (1) { + if ($31) { + $33 = HEAP32[$31 + 12 >> 2] | 0; + if (($33 | 0) == (HEAP32[$31 + 16 >> 2] | 0)) $$0$i$i$i$i25 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$31 >> 2] | 0) + 36 >> 2] & 127]($31) | 0; else $$0$i$i$i$i25 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$33 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i25, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $132 = 0; + $158 = 1; + $80 = 0; + } else { + $132 = $157; + $158 = 0; + $80 = $31; + } + } else { + $132 = 0; + $158 = 1; + $80 = 0; + } + $45 = HEAP32[$2 >> 2] | 0; + do if ($45) { + $48 = HEAP32[$45 + 12 >> 2] | 0; + if (($48 | 0) == (HEAP32[$45 + 16 >> 2] | 0)) $$0$i$i2$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$45 >> 2] | 0) + 36 >> 2] & 127]($45) | 0; else $$0$i$i2$i$i31 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$48 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i31, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($158) { + $159 = $45; + break; + } else { + $$2 = $$0; + $141 = $45; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($158) { + $$2 = $$0; + $141 = 0; + break; + } else $159 = 0; + } + $61 = HEAP8[$18 >> 0] | 0; + $65 = $61 << 24 >> 24 < 0 ? HEAP32[$29 >> 2] | 0 : $61 & 255; + if ((HEAP32[$10 >> 2] | 0) == ($$0 + $65 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $65 << 1, 0); + if ((HEAP8[$18 >> 0] | 0) < 0) $73 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $73 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $73, 0); + $77 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $77 + $65; + $$1 = $77; + } else $$1 = $$0; + $79 = $80 + 12 | 0; + $81 = HEAP32[$79 >> 2] | 0; + $82 = $80 + 16 | 0; + if (($81 | 0) == (HEAP32[$82 >> 2] | 0)) $$0$i$i41 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i41 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$81 >> 2] | 0) | 0; + if (__ZNSt3__29__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKw($$0$i$i41, $14, $$1, $10, $13, HEAP32[$6 >> 2] | 0, $8, $11, $12, $15) | 0) { + $$2 = $$1; + $141 = $159; + break; + } + $94 = HEAP32[$79 >> 2] | 0; + if (($94 | 0) == (HEAP32[$82 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 40 >> 2] & 127]($80) | 0; else { + HEAP32[$79 >> 2] = $94 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$94 >> 2] | 0) | 0; + } + $$0 = $$1; + $157 = $132; + $31 = $80; + } + $103 = HEAP8[$8 + 11 >> 0] | 0; + if (($103 << 24 >> 24 < 0 ? HEAP32[$8 + 4 >> 2] | 0 : $103 & 255) | 0 ? ($110 = HEAP32[$12 >> 2] | 0, ($110 - $11 | 0) < 160) : 0) { + $115 = HEAP32[$13 >> 2] | 0; + HEAP32[$12 >> 2] = $110 + 4; + HEAP32[$110 >> 2] = $115; + } + $118 = __ZNSt3__225__num_get_signed_integralIxEET_PKcS3_Rji($$2, HEAP32[$10 >> 2] | 0, $4, $14) | 0; + $119 = getTempRet0() | 0; + $120 = $5; + HEAP32[$120 >> 2] = $118; + HEAP32[$120 + 4 >> 2] = $119; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($8, $11, HEAP32[$12 >> 2] | 0, $4); + if ($80) { + $127 = HEAP32[$80 + 12 >> 2] | 0; + if (($127 | 0) == (HEAP32[$80 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$132 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$127 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $160 = 1; + } else $160 = 0; + } else $160 = 1; + do if ($141) { + $143 = HEAP32[$141 + 12 >> 2] | 0; + if (($143 | 0) == (HEAP32[$141 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$141 >> 2] | 0) + 36 >> 2] & 127]($141) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$143 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($160) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $160 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($8); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__do_get_signedIxEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i25 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i31 = 0, $$0$i$i41 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $104 = 0, $11 = 0, $111 = 0, $116 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $128 = 0, $13 = 0, $133 = 0, $14 = 0, $142 = 0, $144 = 0, $15 = 0, $158 = 0, $159 = 0, $160 = 0, $161 = 0, $18 = 0, $21 = 0, $24 = 0, $28 = 0, $29 = 0, $31 = 0, $33 = 0, $45 = 0, $48 = 0, $6 = 0, $61 = 0, $65 = 0, $73 = 0, $77 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $9 = 0, $95 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 240 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(240); + $6 = sp + 224 | 0; + $8 = sp + 212 | 0; + $9 = sp + 200 | 0; + $10 = sp + 196 | 0; + $11 = sp; + $12 = sp + 192 | 0; + $13 = sp + 188 | 0; + $14 = __ZNSt3__214__num_get_base10__get_baseERNS_8ios_baseE($3) | 0; + $15 = __ZNKSt3__29__num_getIcE10__do_widenERNS_8ios_baseEPc($0, $3, sp + 160 | 0) | 0; + __ZNSt3__29__num_getIcE17__stage2_int_prepERNS_8ios_baseERc($8, $3, $6); + HEAP32[$9 >> 2] = 0; + HEAP32[$9 + 4 >> 2] = 0; + HEAP32[$9 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$9 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $18 = $9 + 11 | 0; + $21 = $9 + 8 | 0; + if ((HEAP8[$18 >> 0] | 0) < 0) $24 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $24 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $24, 0); + $28 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $28; + HEAP32[$12 >> 2] = $11; + HEAP32[$13 >> 2] = 0; + $29 = $9 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $28; + $158 = $$pre; + $31 = $$pre; + L8 : while (1) { + if ($31) { + $33 = HEAP32[$31 + 12 >> 2] | 0; + if (($33 | 0) == (HEAP32[$31 + 16 >> 2] | 0)) $$0$i$i$i$i25 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$31 >> 2] | 0) + 36 >> 2] & 127]($31) | 0; else $$0$i$i$i$i25 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$33 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i25, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $133 = 0; + $159 = 1; + $80 = 0; + } else { + $133 = $158; + $159 = 0; + $80 = $31; + } + } else { + $133 = 0; + $159 = 1; + $80 = 0; + } + $45 = HEAP32[$2 >> 2] | 0; + do if ($45) { + $48 = HEAP32[$45 + 12 >> 2] | 0; + if (($48 | 0) == (HEAP32[$45 + 16 >> 2] | 0)) $$0$i$i2$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$45 >> 2] | 0) + 36 >> 2] & 127]($45) | 0; else $$0$i$i2$i$i31 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$48 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i31, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($159) { + $160 = $45; + break; + } else { + $$2 = $$0; + $142 = $45; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($159) { + $$2 = $$0; + $142 = 0; + break; + } else $160 = 0; + } + $61 = HEAP8[$18 >> 0] | 0; + $65 = $61 << 24 >> 24 < 0 ? HEAP32[$29 >> 2] | 0 : $61 & 255; + if ((HEAP32[$10 >> 2] | 0) == ($$0 + $65 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $65 << 1, 0); + if ((HEAP8[$18 >> 0] | 0) < 0) $73 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $73 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $73, 0); + $77 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $77 + $65; + $$1 = $77; + } else $$1 = $$0; + $79 = $80 + 12 | 0; + $81 = HEAP32[$79 >> 2] | 0; + $82 = $80 + 16 | 0; + if (($81 | 0) == (HEAP32[$82 >> 2] | 0)) $$0$i$i41 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i41 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$81 >> 0] | 0) | 0; + if (__ZNSt3__29__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKc($$0$i$i41 & 255, $14, $$1, $10, $13, HEAP8[$6 >> 0] | 0, $8, $11, $12, $15) | 0) { + $$2 = $$1; + $142 = $160; + break; + } + $95 = HEAP32[$79 >> 2] | 0; + if (($95 | 0) == (HEAP32[$82 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 40 >> 2] & 127]($80) | 0; else { + HEAP32[$79 >> 2] = $95 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$95 >> 0] | 0) | 0; + } + $$0 = $$1; + $158 = $133; + $31 = $80; + } + $104 = HEAP8[$8 + 11 >> 0] | 0; + if (($104 << 24 >> 24 < 0 ? HEAP32[$8 + 4 >> 2] | 0 : $104 & 255) | 0 ? ($111 = HEAP32[$12 >> 2] | 0, ($111 - $11 | 0) < 160) : 0) { + $116 = HEAP32[$13 >> 2] | 0; + HEAP32[$12 >> 2] = $111 + 4; + HEAP32[$111 >> 2] = $116; + } + $119 = __ZNSt3__225__num_get_signed_integralIxEET_PKcS3_Rji($$2, HEAP32[$10 >> 2] | 0, $4, $14) | 0; + $120 = getTempRet0() | 0; + $121 = $5; + HEAP32[$121 >> 2] = $119; + HEAP32[$121 + 4 >> 2] = $120; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($8, $11, HEAP32[$12 >> 2] | 0, $4); + if ($80) { + $128 = HEAP32[$80 + 12 >> 2] | 0; + if (($128 | 0) == (HEAP32[$80 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$133 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$128 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $161 = 1; + } else $161 = 0; + } else $161 = 1; + do if ($142) { + $144 = HEAP32[$142 + 12 >> 2] | 0; + if (($144 | 0) == (HEAP32[$142 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$142 >> 2] | 0) + 36 >> 2] & 127]($142) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$144 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($161) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $161 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($8); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIfEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i15 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i21 = 0, $$0$i$i31 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $105 = 0, $11 = 0, $114 = 0, $119 = 0, $12 = 0, $122 = 0.0, $126 = 0, $13 = 0, $131 = 0, $14 = 0, $140 = 0, $142 = 0, $15 = 0, $156 = 0, $157 = 0, $158 = 0, $159 = 0, $16 = 0, $19 = 0, $22 = 0, $25 = 0, $29 = 0, $30 = 0, $32 = 0, $34 = 0, $46 = 0, $49 = 0, $6 = 0, $62 = 0, $66 = 0, $7 = 0, $74 = 0, $78 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $9 = 0, $96 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 336 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(336); + $6 = sp + 160 | 0; + $7 = sp + 328 | 0; + $8 = sp + 324 | 0; + $9 = sp + 312 | 0; + $10 = sp + 300 | 0; + $11 = sp + 296 | 0; + $12 = sp; + $13 = sp + 292 | 0; + $14 = sp + 288 | 0; + $15 = sp + 333 | 0; + $16 = sp + 332 | 0; + __ZNSt3__29__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_($9, $3, $6, $7, $8); + HEAP32[$10 >> 2] = 0; + HEAP32[$10 + 4 >> 2] = 0; + HEAP32[$10 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$10 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $19 = $10 + 11 | 0; + $22 = $10 + 8 | 0; + if ((HEAP8[$19 >> 0] | 0) < 0) $25 = (HEAP32[$22 >> 2] & 2147483647) + -1 | 0; else $25 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $25, 0); + $29 = (HEAP8[$19 >> 0] | 0) < 0 ? HEAP32[$10 >> 2] | 0 : $10; + HEAP32[$11 >> 2] = $29; + HEAP32[$13 >> 2] = $12; + HEAP32[$14 >> 2] = 0; + HEAP8[$15 >> 0] = 1; + HEAP8[$16 >> 0] = 69; + $30 = $10 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $29; + $156 = $$pre; + $32 = $$pre; + L8 : while (1) { + if ($32) { + $34 = HEAP32[$32 + 12 >> 2] | 0; + if (($34 | 0) == (HEAP32[$32 + 16 >> 2] | 0)) $$0$i$i$i$i15 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$32 >> 2] | 0) + 36 >> 2] & 127]($32) | 0; else $$0$i$i$i$i15 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$34 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i15, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $131 = 0; + $157 = 1; + $81 = 0; + } else { + $131 = $156; + $157 = 0; + $81 = $32; + } + } else { + $131 = 0; + $157 = 1; + $81 = 0; + } + $46 = HEAP32[$2 >> 2] | 0; + do if ($46) { + $49 = HEAP32[$46 + 12 >> 2] | 0; + if (($49 | 0) == (HEAP32[$46 + 16 >> 2] | 0)) $$0$i$i2$i$i21 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$46 >> 2] | 0) + 36 >> 2] & 127]($46) | 0; else $$0$i$i2$i$i21 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$49 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i21, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($157) { + $158 = $46; + break; + } else { + $$2 = $$0; + $140 = $46; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($157) { + $$2 = $$0; + $140 = 0; + break; + } else $158 = 0; + } + $62 = HEAP8[$19 >> 0] | 0; + $66 = $62 << 24 >> 24 < 0 ? HEAP32[$30 >> 2] | 0 : $62 & 255; + if ((HEAP32[$11 >> 2] | 0) == ($$0 + $66 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $66 << 1, 0); + if ((HEAP8[$19 >> 0] | 0) < 0) $74 = (HEAP32[$22 >> 2] & 2147483647) + -1 | 0; else $74 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $74, 0); + $78 = (HEAP8[$19 >> 0] | 0) < 0 ? HEAP32[$10 >> 2] | 0 : $10; + HEAP32[$11 >> 2] = $78 + $66; + $$1 = $78; + } else $$1 = $$0; + $80 = $81 + 12 | 0; + $82 = HEAP32[$80 >> 2] | 0; + $83 = $81 + 16 | 0; + if (($82 | 0) == (HEAP32[$83 >> 2] | 0)) $$0$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$81 >> 2] | 0) + 36 >> 2] & 127]($81) | 0; else $$0$i$i31 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$82 >> 2] | 0) | 0; + if (__ZNSt3__29__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw($$0$i$i31, $15, $16, $$1, $11, HEAP32[$7 >> 2] | 0, HEAP32[$8 >> 2] | 0, $9, $12, $13, $14, $6) | 0) { + $$2 = $$1; + $140 = $158; + break; + } + $96 = HEAP32[$80 >> 2] | 0; + if (($96 | 0) == (HEAP32[$83 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$81 >> 2] | 0) + 40 >> 2] & 127]($81) | 0; else { + HEAP32[$80 >> 2] = $96 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$96 >> 2] | 0) | 0; + } + $$0 = $$1; + $156 = $131; + $32 = $81; + } + $105 = HEAP8[$9 + 11 >> 0] | 0; + if (!((HEAP8[$15 >> 0] | 0) == 0 ? 1 : (($105 << 24 >> 24 < 0 ? HEAP32[$9 + 4 >> 2] | 0 : $105 & 255) | 0) == 0) ? ($114 = HEAP32[$13 >> 2] | 0, ($114 - $12 | 0) < 160) : 0) { + $119 = HEAP32[$14 >> 2] | 0; + HEAP32[$13 >> 2] = $114 + 4; + HEAP32[$114 >> 2] = $119; + } + $122 = +__ZNSt3__215__num_get_floatIfEET_PKcS3_Rj($$2, HEAP32[$11 >> 2] | 0, $4); + HEAPF32[$5 >> 2] = $122; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($9, $12, HEAP32[$13 >> 2] | 0, $4); + if ($81) { + $126 = HEAP32[$81 + 12 >> 2] | 0; + if (($126 | 0) == (HEAP32[$81 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$131 >> 2] | 0) + 36 >> 2] & 127]($81) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$126 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $159 = 1; + } else $159 = 0; + } else $159 = 1; + do if ($140) { + $142 = HEAP32[$140 + 12 >> 2] | 0; + if (($142 | 0) == (HEAP32[$140 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$140 >> 2] | 0) + 36 >> 2] & 127]($140) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$142 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($159) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $159 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($10); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i15 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i21 = 0, $$0$i$i31 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $105 = 0, $11 = 0, $114 = 0, $119 = 0, $12 = 0, $122 = 0.0, $126 = 0, $13 = 0, $131 = 0, $14 = 0, $140 = 0, $142 = 0, $15 = 0, $156 = 0, $157 = 0, $158 = 0, $159 = 0, $16 = 0, $19 = 0, $22 = 0, $25 = 0, $29 = 0, $30 = 0, $32 = 0, $34 = 0, $46 = 0, $49 = 0, $6 = 0, $62 = 0, $66 = 0, $7 = 0, $74 = 0, $78 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $9 = 0, $96 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 336 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(336); + $6 = sp + 160 | 0; + $7 = sp + 328 | 0; + $8 = sp + 324 | 0; + $9 = sp + 312 | 0; + $10 = sp + 300 | 0; + $11 = sp + 296 | 0; + $12 = sp; + $13 = sp + 292 | 0; + $14 = sp + 288 | 0; + $15 = sp + 333 | 0; + $16 = sp + 332 | 0; + __ZNSt3__29__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_($9, $3, $6, $7, $8); + HEAP32[$10 >> 2] = 0; + HEAP32[$10 + 4 >> 2] = 0; + HEAP32[$10 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$10 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $19 = $10 + 11 | 0; + $22 = $10 + 8 | 0; + if ((HEAP8[$19 >> 0] | 0) < 0) $25 = (HEAP32[$22 >> 2] & 2147483647) + -1 | 0; else $25 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $25, 0); + $29 = (HEAP8[$19 >> 0] | 0) < 0 ? HEAP32[$10 >> 2] | 0 : $10; + HEAP32[$11 >> 2] = $29; + HEAP32[$13 >> 2] = $12; + HEAP32[$14 >> 2] = 0; + HEAP8[$15 >> 0] = 1; + HEAP8[$16 >> 0] = 69; + $30 = $10 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $29; + $156 = $$pre; + $32 = $$pre; + L8 : while (1) { + if ($32) { + $34 = HEAP32[$32 + 12 >> 2] | 0; + if (($34 | 0) == (HEAP32[$32 + 16 >> 2] | 0)) $$0$i$i$i$i15 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$32 >> 2] | 0) + 36 >> 2] & 127]($32) | 0; else $$0$i$i$i$i15 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$34 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i15, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $131 = 0; + $157 = 1; + $81 = 0; + } else { + $131 = $156; + $157 = 0; + $81 = $32; + } + } else { + $131 = 0; + $157 = 1; + $81 = 0; + } + $46 = HEAP32[$2 >> 2] | 0; + do if ($46) { + $49 = HEAP32[$46 + 12 >> 2] | 0; + if (($49 | 0) == (HEAP32[$46 + 16 >> 2] | 0)) $$0$i$i2$i$i21 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$46 >> 2] | 0) + 36 >> 2] & 127]($46) | 0; else $$0$i$i2$i$i21 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$49 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i21, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($157) { + $158 = $46; + break; + } else { + $$2 = $$0; + $140 = $46; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($157) { + $$2 = $$0; + $140 = 0; + break; + } else $158 = 0; + } + $62 = HEAP8[$19 >> 0] | 0; + $66 = $62 << 24 >> 24 < 0 ? HEAP32[$30 >> 2] | 0 : $62 & 255; + if ((HEAP32[$11 >> 2] | 0) == ($$0 + $66 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $66 << 1, 0); + if ((HEAP8[$19 >> 0] | 0) < 0) $74 = (HEAP32[$22 >> 2] & 2147483647) + -1 | 0; else $74 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $74, 0); + $78 = (HEAP8[$19 >> 0] | 0) < 0 ? HEAP32[$10 >> 2] | 0 : $10; + HEAP32[$11 >> 2] = $78 + $66; + $$1 = $78; + } else $$1 = $$0; + $80 = $81 + 12 | 0; + $82 = HEAP32[$80 >> 2] | 0; + $83 = $81 + 16 | 0; + if (($82 | 0) == (HEAP32[$83 >> 2] | 0)) $$0$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$81 >> 2] | 0) + 36 >> 2] & 127]($81) | 0; else $$0$i$i31 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$82 >> 2] | 0) | 0; + if (__ZNSt3__29__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw($$0$i$i31, $15, $16, $$1, $11, HEAP32[$7 >> 2] | 0, HEAP32[$8 >> 2] | 0, $9, $12, $13, $14, $6) | 0) { + $$2 = $$1; + $140 = $158; + break; + } + $96 = HEAP32[$80 >> 2] | 0; + if (($96 | 0) == (HEAP32[$83 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$81 >> 2] | 0) + 40 >> 2] & 127]($81) | 0; else { + HEAP32[$80 >> 2] = $96 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$96 >> 2] | 0) | 0; + } + $$0 = $$1; + $156 = $131; + $32 = $81; + } + $105 = HEAP8[$9 + 11 >> 0] | 0; + if (!((HEAP8[$15 >> 0] | 0) == 0 ? 1 : (($105 << 24 >> 24 < 0 ? HEAP32[$9 + 4 >> 2] | 0 : $105 & 255) | 0) == 0) ? ($114 = HEAP32[$13 >> 2] | 0, ($114 - $12 | 0) < 160) : 0) { + $119 = HEAP32[$14 >> 2] | 0; + HEAP32[$13 >> 2] = $114 + 4; + HEAP32[$114 >> 2] = $119; + } + $122 = +__ZNSt3__215__num_get_floatIeEET_PKcS3_Rj($$2, HEAP32[$11 >> 2] | 0, $4); + HEAPF64[$5 >> 3] = $122; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($9, $12, HEAP32[$13 >> 2] | 0, $4); + if ($81) { + $126 = HEAP32[$81 + 12 >> 2] | 0; + if (($126 | 0) == (HEAP32[$81 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$131 >> 2] | 0) + 36 >> 2] & 127]($81) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$126 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $159 = 1; + } else $159 = 0; + } else $159 = 1; + do if ($140) { + $142 = HEAP32[$140 + 12 >> 2] | 0; + if (($142 | 0) == (HEAP32[$140 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$140 >> 2] | 0) + 36 >> 2] & 127]($140) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$142 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($159) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $159 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($10); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIdEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i15 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i21 = 0, $$0$i$i31 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $105 = 0, $11 = 0, $114 = 0, $119 = 0, $12 = 0, $122 = 0.0, $126 = 0, $13 = 0, $131 = 0, $14 = 0, $140 = 0, $142 = 0, $15 = 0, $156 = 0, $157 = 0, $158 = 0, $159 = 0, $16 = 0, $19 = 0, $22 = 0, $25 = 0, $29 = 0, $30 = 0, $32 = 0, $34 = 0, $46 = 0, $49 = 0, $6 = 0, $62 = 0, $66 = 0, $7 = 0, $74 = 0, $78 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $9 = 0, $96 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 336 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(336); + $6 = sp + 160 | 0; + $7 = sp + 328 | 0; + $8 = sp + 324 | 0; + $9 = sp + 312 | 0; + $10 = sp + 300 | 0; + $11 = sp + 296 | 0; + $12 = sp; + $13 = sp + 292 | 0; + $14 = sp + 288 | 0; + $15 = sp + 333 | 0; + $16 = sp + 332 | 0; + __ZNSt3__29__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_($9, $3, $6, $7, $8); + HEAP32[$10 >> 2] = 0; + HEAP32[$10 + 4 >> 2] = 0; + HEAP32[$10 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$10 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $19 = $10 + 11 | 0; + $22 = $10 + 8 | 0; + if ((HEAP8[$19 >> 0] | 0) < 0) $25 = (HEAP32[$22 >> 2] & 2147483647) + -1 | 0; else $25 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $25, 0); + $29 = (HEAP8[$19 >> 0] | 0) < 0 ? HEAP32[$10 >> 2] | 0 : $10; + HEAP32[$11 >> 2] = $29; + HEAP32[$13 >> 2] = $12; + HEAP32[$14 >> 2] = 0; + HEAP8[$15 >> 0] = 1; + HEAP8[$16 >> 0] = 69; + $30 = $10 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $29; + $156 = $$pre; + $32 = $$pre; + L8 : while (1) { + if ($32) { + $34 = HEAP32[$32 + 12 >> 2] | 0; + if (($34 | 0) == (HEAP32[$32 + 16 >> 2] | 0)) $$0$i$i$i$i15 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$32 >> 2] | 0) + 36 >> 2] & 127]($32) | 0; else $$0$i$i$i$i15 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$34 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i15, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $131 = 0; + $157 = 1; + $81 = 0; + } else { + $131 = $156; + $157 = 0; + $81 = $32; + } + } else { + $131 = 0; + $157 = 1; + $81 = 0; + } + $46 = HEAP32[$2 >> 2] | 0; + do if ($46) { + $49 = HEAP32[$46 + 12 >> 2] | 0; + if (($49 | 0) == (HEAP32[$46 + 16 >> 2] | 0)) $$0$i$i2$i$i21 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$46 >> 2] | 0) + 36 >> 2] & 127]($46) | 0; else $$0$i$i2$i$i21 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$49 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i21, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($157) { + $158 = $46; + break; + } else { + $$2 = $$0; + $140 = $46; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($157) { + $$2 = $$0; + $140 = 0; + break; + } else $158 = 0; + } + $62 = HEAP8[$19 >> 0] | 0; + $66 = $62 << 24 >> 24 < 0 ? HEAP32[$30 >> 2] | 0 : $62 & 255; + if ((HEAP32[$11 >> 2] | 0) == ($$0 + $66 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $66 << 1, 0); + if ((HEAP8[$19 >> 0] | 0) < 0) $74 = (HEAP32[$22 >> 2] & 2147483647) + -1 | 0; else $74 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $74, 0); + $78 = (HEAP8[$19 >> 0] | 0) < 0 ? HEAP32[$10 >> 2] | 0 : $10; + HEAP32[$11 >> 2] = $78 + $66; + $$1 = $78; + } else $$1 = $$0; + $80 = $81 + 12 | 0; + $82 = HEAP32[$80 >> 2] | 0; + $83 = $81 + 16 | 0; + if (($82 | 0) == (HEAP32[$83 >> 2] | 0)) $$0$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$81 >> 2] | 0) + 36 >> 2] & 127]($81) | 0; else $$0$i$i31 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$82 >> 2] | 0) | 0; + if (__ZNSt3__29__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw($$0$i$i31, $15, $16, $$1, $11, HEAP32[$7 >> 2] | 0, HEAP32[$8 >> 2] | 0, $9, $12, $13, $14, $6) | 0) { + $$2 = $$1; + $140 = $158; + break; + } + $96 = HEAP32[$80 >> 2] | 0; + if (($96 | 0) == (HEAP32[$83 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$81 >> 2] | 0) + 40 >> 2] & 127]($81) | 0; else { + HEAP32[$80 >> 2] = $96 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$96 >> 2] | 0) | 0; + } + $$0 = $$1; + $156 = $131; + $32 = $81; + } + $105 = HEAP8[$9 + 11 >> 0] | 0; + if (!((HEAP8[$15 >> 0] | 0) == 0 ? 1 : (($105 << 24 >> 24 < 0 ? HEAP32[$9 + 4 >> 2] | 0 : $105 & 255) | 0) == 0) ? ($114 = HEAP32[$13 >> 2] | 0, ($114 - $12 | 0) < 160) : 0) { + $119 = HEAP32[$14 >> 2] | 0; + HEAP32[$13 >> 2] = $114 + 4; + HEAP32[$114 >> 2] = $119; + } + $122 = +__ZNSt3__215__num_get_floatIdEET_PKcS3_Rj($$2, HEAP32[$11 >> 2] | 0, $4); + HEAPF64[$5 >> 3] = $122; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($9, $12, HEAP32[$13 >> 2] | 0, $4); + if ($81) { + $126 = HEAP32[$81 + 12 >> 2] | 0; + if (($126 | 0) == (HEAP32[$81 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$131 >> 2] | 0) + 36 >> 2] & 127]($81) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$126 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $159 = 1; + } else $159 = 0; + } else $159 = 1; + do if ($140) { + $142 = HEAP32[$140 + 12 >> 2] | 0; + if (($142 | 0) == (HEAP32[$140 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$140 >> 2] | 0) + 36 >> 2] & 127]($140) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$142 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($159) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $159 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($10); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIfEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i15 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i21 = 0, $$0$i$i31 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $106 = 0, $11 = 0, $115 = 0, $12 = 0, $120 = 0, $123 = 0.0, $127 = 0, $13 = 0, $132 = 0, $14 = 0, $141 = 0, $143 = 0, $15 = 0, $157 = 0, $158 = 0, $159 = 0, $16 = 0, $160 = 0, $19 = 0, $22 = 0, $25 = 0, $29 = 0, $30 = 0, $32 = 0, $34 = 0, $46 = 0, $49 = 0, $6 = 0, $62 = 0, $66 = 0, $7 = 0, $74 = 0, $78 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $9 = 0, $97 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 240 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(240); + $6 = sp + 160 | 0; + $7 = sp + 231 | 0; + $8 = sp + 230 | 0; + $9 = sp + 216 | 0; + $10 = sp + 204 | 0; + $11 = sp + 200 | 0; + $12 = sp; + $13 = sp + 196 | 0; + $14 = sp + 192 | 0; + $15 = sp + 229 | 0; + $16 = sp + 228 | 0; + __ZNSt3__29__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_($9, $3, $6, $7, $8); + HEAP32[$10 >> 2] = 0; + HEAP32[$10 + 4 >> 2] = 0; + HEAP32[$10 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$10 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $19 = $10 + 11 | 0; + $22 = $10 + 8 | 0; + if ((HEAP8[$19 >> 0] | 0) < 0) $25 = (HEAP32[$22 >> 2] & 2147483647) + -1 | 0; else $25 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $25, 0); + $29 = (HEAP8[$19 >> 0] | 0) < 0 ? HEAP32[$10 >> 2] | 0 : $10; + HEAP32[$11 >> 2] = $29; + HEAP32[$13 >> 2] = $12; + HEAP32[$14 >> 2] = 0; + HEAP8[$15 >> 0] = 1; + HEAP8[$16 >> 0] = 69; + $30 = $10 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $29; + $157 = $$pre; + $32 = $$pre; + L8 : while (1) { + if ($32) { + $34 = HEAP32[$32 + 12 >> 2] | 0; + if (($34 | 0) == (HEAP32[$32 + 16 >> 2] | 0)) $$0$i$i$i$i15 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$32 >> 2] | 0) + 36 >> 2] & 127]($32) | 0; else $$0$i$i$i$i15 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$34 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i15, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $132 = 0; + $158 = 1; + $81 = 0; + } else { + $132 = $157; + $158 = 0; + $81 = $32; + } + } else { + $132 = 0; + $158 = 1; + $81 = 0; + } + $46 = HEAP32[$2 >> 2] | 0; + do if ($46) { + $49 = HEAP32[$46 + 12 >> 2] | 0; + if (($49 | 0) == (HEAP32[$46 + 16 >> 2] | 0)) $$0$i$i2$i$i21 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$46 >> 2] | 0) + 36 >> 2] & 127]($46) | 0; else $$0$i$i2$i$i21 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$49 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i21, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($158) { + $159 = $46; + break; + } else { + $$2 = $$0; + $141 = $46; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($158) { + $$2 = $$0; + $141 = 0; + break; + } else $159 = 0; + } + $62 = HEAP8[$19 >> 0] | 0; + $66 = $62 << 24 >> 24 < 0 ? HEAP32[$30 >> 2] | 0 : $62 & 255; + if ((HEAP32[$11 >> 2] | 0) == ($$0 + $66 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $66 << 1, 0); + if ((HEAP8[$19 >> 0] | 0) < 0) $74 = (HEAP32[$22 >> 2] & 2147483647) + -1 | 0; else $74 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $74, 0); + $78 = (HEAP8[$19 >> 0] | 0) < 0 ? HEAP32[$10 >> 2] | 0 : $10; + HEAP32[$11 >> 2] = $78 + $66; + $$1 = $78; + } else $$1 = $$0; + $80 = $81 + 12 | 0; + $82 = HEAP32[$80 >> 2] | 0; + $83 = $81 + 16 | 0; + if (($82 | 0) == (HEAP32[$83 >> 2] | 0)) $$0$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$81 >> 2] | 0) + 36 >> 2] & 127]($81) | 0; else $$0$i$i31 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$82 >> 0] | 0) | 0; + if (__ZNSt3__29__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_($$0$i$i31 & 255, $15, $16, $$1, $11, HEAP8[$7 >> 0] | 0, HEAP8[$8 >> 0] | 0, $9, $12, $13, $14, $6) | 0) { + $$2 = $$1; + $141 = $159; + break; + } + $97 = HEAP32[$80 >> 2] | 0; + if (($97 | 0) == (HEAP32[$83 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$81 >> 2] | 0) + 40 >> 2] & 127]($81) | 0; else { + HEAP32[$80 >> 2] = $97 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$97 >> 0] | 0) | 0; + } + $$0 = $$1; + $157 = $132; + $32 = $81; + } + $106 = HEAP8[$9 + 11 >> 0] | 0; + if (!((HEAP8[$15 >> 0] | 0) == 0 ? 1 : (($106 << 24 >> 24 < 0 ? HEAP32[$9 + 4 >> 2] | 0 : $106 & 255) | 0) == 0) ? ($115 = HEAP32[$13 >> 2] | 0, ($115 - $12 | 0) < 160) : 0) { + $120 = HEAP32[$14 >> 2] | 0; + HEAP32[$13 >> 2] = $115 + 4; + HEAP32[$115 >> 2] = $120; + } + $123 = +__ZNSt3__215__num_get_floatIfEET_PKcS3_Rj($$2, HEAP32[$11 >> 2] | 0, $4); + HEAPF32[$5 >> 2] = $123; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($9, $12, HEAP32[$13 >> 2] | 0, $4); + if ($81) { + $127 = HEAP32[$81 + 12 >> 2] | 0; + if (($127 | 0) == (HEAP32[$81 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$132 >> 2] | 0) + 36 >> 2] & 127]($81) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$127 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $160 = 1; + } else $160 = 0; + } else $160 = 1; + do if ($141) { + $143 = HEAP32[$141 + 12 >> 2] | 0; + if (($143 | 0) == (HEAP32[$141 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$141 >> 2] | 0) + 36 >> 2] & 127]($141) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$143 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($160) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $160 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($10); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i15 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i21 = 0, $$0$i$i31 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $106 = 0, $11 = 0, $115 = 0, $12 = 0, $120 = 0, $123 = 0.0, $127 = 0, $13 = 0, $132 = 0, $14 = 0, $141 = 0, $143 = 0, $15 = 0, $157 = 0, $158 = 0, $159 = 0, $16 = 0, $160 = 0, $19 = 0, $22 = 0, $25 = 0, $29 = 0, $30 = 0, $32 = 0, $34 = 0, $46 = 0, $49 = 0, $6 = 0, $62 = 0, $66 = 0, $7 = 0, $74 = 0, $78 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $9 = 0, $97 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 240 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(240); + $6 = sp + 160 | 0; + $7 = sp + 231 | 0; + $8 = sp + 230 | 0; + $9 = sp + 216 | 0; + $10 = sp + 204 | 0; + $11 = sp + 200 | 0; + $12 = sp; + $13 = sp + 196 | 0; + $14 = sp + 192 | 0; + $15 = sp + 229 | 0; + $16 = sp + 228 | 0; + __ZNSt3__29__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_($9, $3, $6, $7, $8); + HEAP32[$10 >> 2] = 0; + HEAP32[$10 + 4 >> 2] = 0; + HEAP32[$10 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$10 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $19 = $10 + 11 | 0; + $22 = $10 + 8 | 0; + if ((HEAP8[$19 >> 0] | 0) < 0) $25 = (HEAP32[$22 >> 2] & 2147483647) + -1 | 0; else $25 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $25, 0); + $29 = (HEAP8[$19 >> 0] | 0) < 0 ? HEAP32[$10 >> 2] | 0 : $10; + HEAP32[$11 >> 2] = $29; + HEAP32[$13 >> 2] = $12; + HEAP32[$14 >> 2] = 0; + HEAP8[$15 >> 0] = 1; + HEAP8[$16 >> 0] = 69; + $30 = $10 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $29; + $157 = $$pre; + $32 = $$pre; + L8 : while (1) { + if ($32) { + $34 = HEAP32[$32 + 12 >> 2] | 0; + if (($34 | 0) == (HEAP32[$32 + 16 >> 2] | 0)) $$0$i$i$i$i15 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$32 >> 2] | 0) + 36 >> 2] & 127]($32) | 0; else $$0$i$i$i$i15 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$34 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i15, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $132 = 0; + $158 = 1; + $81 = 0; + } else { + $132 = $157; + $158 = 0; + $81 = $32; + } + } else { + $132 = 0; + $158 = 1; + $81 = 0; + } + $46 = HEAP32[$2 >> 2] | 0; + do if ($46) { + $49 = HEAP32[$46 + 12 >> 2] | 0; + if (($49 | 0) == (HEAP32[$46 + 16 >> 2] | 0)) $$0$i$i2$i$i21 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$46 >> 2] | 0) + 36 >> 2] & 127]($46) | 0; else $$0$i$i2$i$i21 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$49 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i21, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($158) { + $159 = $46; + break; + } else { + $$2 = $$0; + $141 = $46; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($158) { + $$2 = $$0; + $141 = 0; + break; + } else $159 = 0; + } + $62 = HEAP8[$19 >> 0] | 0; + $66 = $62 << 24 >> 24 < 0 ? HEAP32[$30 >> 2] | 0 : $62 & 255; + if ((HEAP32[$11 >> 2] | 0) == ($$0 + $66 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $66 << 1, 0); + if ((HEAP8[$19 >> 0] | 0) < 0) $74 = (HEAP32[$22 >> 2] & 2147483647) + -1 | 0; else $74 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $74, 0); + $78 = (HEAP8[$19 >> 0] | 0) < 0 ? HEAP32[$10 >> 2] | 0 : $10; + HEAP32[$11 >> 2] = $78 + $66; + $$1 = $78; + } else $$1 = $$0; + $80 = $81 + 12 | 0; + $82 = HEAP32[$80 >> 2] | 0; + $83 = $81 + 16 | 0; + if (($82 | 0) == (HEAP32[$83 >> 2] | 0)) $$0$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$81 >> 2] | 0) + 36 >> 2] & 127]($81) | 0; else $$0$i$i31 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$82 >> 0] | 0) | 0; + if (__ZNSt3__29__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_($$0$i$i31 & 255, $15, $16, $$1, $11, HEAP8[$7 >> 0] | 0, HEAP8[$8 >> 0] | 0, $9, $12, $13, $14, $6) | 0) { + $$2 = $$1; + $141 = $159; + break; + } + $97 = HEAP32[$80 >> 2] | 0; + if (($97 | 0) == (HEAP32[$83 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$81 >> 2] | 0) + 40 >> 2] & 127]($81) | 0; else { + HEAP32[$80 >> 2] = $97 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$97 >> 0] | 0) | 0; + } + $$0 = $$1; + $157 = $132; + $32 = $81; + } + $106 = HEAP8[$9 + 11 >> 0] | 0; + if (!((HEAP8[$15 >> 0] | 0) == 0 ? 1 : (($106 << 24 >> 24 < 0 ? HEAP32[$9 + 4 >> 2] | 0 : $106 & 255) | 0) == 0) ? ($115 = HEAP32[$13 >> 2] | 0, ($115 - $12 | 0) < 160) : 0) { + $120 = HEAP32[$14 >> 2] | 0; + HEAP32[$13 >> 2] = $115 + 4; + HEAP32[$115 >> 2] = $120; + } + $123 = +__ZNSt3__215__num_get_floatIeEET_PKcS3_Rj($$2, HEAP32[$11 >> 2] | 0, $4); + HEAPF64[$5 >> 3] = $123; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($9, $12, HEAP32[$13 >> 2] | 0, $4); + if ($81) { + $127 = HEAP32[$81 + 12 >> 2] | 0; + if (($127 | 0) == (HEAP32[$81 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$132 >> 2] | 0) + 36 >> 2] & 127]($81) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$127 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $160 = 1; + } else $160 = 0; + } else $160 = 1; + do if ($141) { + $143 = HEAP32[$141 + 12 >> 2] | 0; + if (($143 | 0) == (HEAP32[$141 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$141 >> 2] | 0) + 36 >> 2] & 127]($141) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$143 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($160) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $160 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($10); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIdEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i15 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i21 = 0, $$0$i$i31 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $106 = 0, $11 = 0, $115 = 0, $12 = 0, $120 = 0, $123 = 0.0, $127 = 0, $13 = 0, $132 = 0, $14 = 0, $141 = 0, $143 = 0, $15 = 0, $157 = 0, $158 = 0, $159 = 0, $16 = 0, $160 = 0, $19 = 0, $22 = 0, $25 = 0, $29 = 0, $30 = 0, $32 = 0, $34 = 0, $46 = 0, $49 = 0, $6 = 0, $62 = 0, $66 = 0, $7 = 0, $74 = 0, $78 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $9 = 0, $97 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 240 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(240); + $6 = sp + 160 | 0; + $7 = sp + 231 | 0; + $8 = sp + 230 | 0; + $9 = sp + 216 | 0; + $10 = sp + 204 | 0; + $11 = sp + 200 | 0; + $12 = sp; + $13 = sp + 196 | 0; + $14 = sp + 192 | 0; + $15 = sp + 229 | 0; + $16 = sp + 228 | 0; + __ZNSt3__29__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_($9, $3, $6, $7, $8); + HEAP32[$10 >> 2] = 0; + HEAP32[$10 + 4 >> 2] = 0; + HEAP32[$10 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$10 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $19 = $10 + 11 | 0; + $22 = $10 + 8 | 0; + if ((HEAP8[$19 >> 0] | 0) < 0) $25 = (HEAP32[$22 >> 2] & 2147483647) + -1 | 0; else $25 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $25, 0); + $29 = (HEAP8[$19 >> 0] | 0) < 0 ? HEAP32[$10 >> 2] | 0 : $10; + HEAP32[$11 >> 2] = $29; + HEAP32[$13 >> 2] = $12; + HEAP32[$14 >> 2] = 0; + HEAP8[$15 >> 0] = 1; + HEAP8[$16 >> 0] = 69; + $30 = $10 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $29; + $157 = $$pre; + $32 = $$pre; + L8 : while (1) { + if ($32) { + $34 = HEAP32[$32 + 12 >> 2] | 0; + if (($34 | 0) == (HEAP32[$32 + 16 >> 2] | 0)) $$0$i$i$i$i15 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$32 >> 2] | 0) + 36 >> 2] & 127]($32) | 0; else $$0$i$i$i$i15 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$34 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i15, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $132 = 0; + $158 = 1; + $81 = 0; + } else { + $132 = $157; + $158 = 0; + $81 = $32; + } + } else { + $132 = 0; + $158 = 1; + $81 = 0; + } + $46 = HEAP32[$2 >> 2] | 0; + do if ($46) { + $49 = HEAP32[$46 + 12 >> 2] | 0; + if (($49 | 0) == (HEAP32[$46 + 16 >> 2] | 0)) $$0$i$i2$i$i21 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$46 >> 2] | 0) + 36 >> 2] & 127]($46) | 0; else $$0$i$i2$i$i21 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$49 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i21, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($158) { + $159 = $46; + break; + } else { + $$2 = $$0; + $141 = $46; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($158) { + $$2 = $$0; + $141 = 0; + break; + } else $159 = 0; + } + $62 = HEAP8[$19 >> 0] | 0; + $66 = $62 << 24 >> 24 < 0 ? HEAP32[$30 >> 2] | 0 : $62 & 255; + if ((HEAP32[$11 >> 2] | 0) == ($$0 + $66 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $66 << 1, 0); + if ((HEAP8[$19 >> 0] | 0) < 0) $74 = (HEAP32[$22 >> 2] & 2147483647) + -1 | 0; else $74 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($10, $74, 0); + $78 = (HEAP8[$19 >> 0] | 0) < 0 ? HEAP32[$10 >> 2] | 0 : $10; + HEAP32[$11 >> 2] = $78 + $66; + $$1 = $78; + } else $$1 = $$0; + $80 = $81 + 12 | 0; + $82 = HEAP32[$80 >> 2] | 0; + $83 = $81 + 16 | 0; + if (($82 | 0) == (HEAP32[$83 >> 2] | 0)) $$0$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$81 >> 2] | 0) + 36 >> 2] & 127]($81) | 0; else $$0$i$i31 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$82 >> 0] | 0) | 0; + if (__ZNSt3__29__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_($$0$i$i31 & 255, $15, $16, $$1, $11, HEAP8[$7 >> 0] | 0, HEAP8[$8 >> 0] | 0, $9, $12, $13, $14, $6) | 0) { + $$2 = $$1; + $141 = $159; + break; + } + $97 = HEAP32[$80 >> 2] | 0; + if (($97 | 0) == (HEAP32[$83 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$81 >> 2] | 0) + 40 >> 2] & 127]($81) | 0; else { + HEAP32[$80 >> 2] = $97 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$97 >> 0] | 0) | 0; + } + $$0 = $$1; + $157 = $132; + $32 = $81; + } + $106 = HEAP8[$9 + 11 >> 0] | 0; + if (!((HEAP8[$15 >> 0] | 0) == 0 ? 1 : (($106 << 24 >> 24 < 0 ? HEAP32[$9 + 4 >> 2] | 0 : $106 & 255) | 0) == 0) ? ($115 = HEAP32[$13 >> 2] | 0, ($115 - $12 | 0) < 160) : 0) { + $120 = HEAP32[$14 >> 2] | 0; + HEAP32[$13 >> 2] = $115 + 4; + HEAP32[$115 >> 2] = $120; + } + $123 = +__ZNSt3__215__num_get_floatIdEET_PKcS3_Rj($$2, HEAP32[$11 >> 2] | 0, $4); + HEAPF64[$5 >> 3] = $123; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($9, $12, HEAP32[$13 >> 2] | 0, $4); + if ($81) { + $127 = HEAP32[$81 + 12 >> 2] | 0; + if (($127 | 0) == (HEAP32[$81 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$132 >> 2] | 0) + 36 >> 2] & 127]($81) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$127 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $160 = 1; + } else $160 = 0; + } else $160 = 1; + do if ($141) { + $143 = HEAP32[$141 + 12 >> 2] | 0; + if (($143 | 0) == (HEAP32[$141 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$141 >> 2] | 0) + 36 >> 2] & 127]($141) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$143 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($160) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $160 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($10); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZN6vision14BinarykMedoidsILi96EE6assignEPKhiPKii($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$021 = 0, $$1 = 0, $103 = 0, $114 = 0, $119 = 0, $123 = 0, $20 = 0, $25 = 0, $29 = 0, $36 = 0, $41 = 0, $45 = 0, $5 = 0, $52 = 0, $57 = 0, $6 = 0, $61 = 0, $68 = 0, $7 = 0, $73 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $86 = 0, $9 = 0, $95 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $5 = sp; + $6 = $0 + 4 | 0; + $7 = HEAP32[$6 >> 2] | 0; + $8 = $0 + 12 | 0; + $9 = $0 + 16 | 0; + if (($7 | 0) != ((HEAP32[$9 >> 2] | 0) - (HEAP32[$8 >> 2] | 0) >> 2 | 0)) { + $20 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 33662) | 0, 33707) | 0, 39072) | 0, 154) | 0, 39079) | 0, 33779) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $20 + (HEAP32[(HEAP32[$20 >> 2] | 0) + -12 >> 2] | 0) | 0); + $25 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $29 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$25 >> 2] | 0) + 28 >> 2] & 127]($25, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($20, $29) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($20) | 0; + _abort(); + } + if (($2 | 0) <= 0) { + $36 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 33824) | 0, 33707) | 0, 39072) | 0, 155) | 0, 39079) | 0, 33864) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $36 + (HEAP32[(HEAP32[$36 >> 2] | 0) + -12 >> 2] | 0) | 0); + $41 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $45 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$41 >> 2] | 0) + 28 >> 2] & 127]($41, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($36, $45) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($36) | 0; + _abort(); + } + if (($4 | 0) > ($2 | 0)) { + $52 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 33900) | 0, 33707) | 0, 39072) | 0, 156) | 0, 39079) | 0, 33951) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $52 + (HEAP32[(HEAP32[$52 >> 2] | 0) + -12 >> 2] | 0) | 0); + $57 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $61 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$57 >> 2] | 0) + 28 >> 2] & 127]($57, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($52, $61) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($52) | 0; + _abort(); + } + if (($7 | 0) > ($4 | 0)) { + $68 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 33978) | 0, 33707) | 0, 39072) | 0, 157) | 0, 39079) | 0, 34019) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $68 + (HEAP32[(HEAP32[$68 >> 2] | 0) + -12 >> 2] | 0) | 0); + $73 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $77 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$73 >> 2] | 0) + 28 >> 2] & 127]($73, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($68, $77) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($68) | 0; + _abort(); + } + $78 = $0 + 24 | 0; + HEAP32[$5 >> 2] = -1; + __ZNSt3__26vectorIiNS_9allocatorIiEEE6resizeEmRKi($78, $4, $5); + $79 = $0 + 36 | 0; + HEAP32[$5 >> 2] = -1; + __ZNSt3__26vectorIiNS_9allocatorIiEEE6resizeEmRKi($79, $4, $5); + $80 = $0 + 48 | 0; + __ZNSt3__26vectorIiNS_9allocatorIiEEE6resizeEm($80, $4); + $81 = HEAP32[$80 >> 2] | 0; + $82 = $0 + 52 | 0; + __ZN6vision16SequentialVectorIiEEvPT_iS1_($81, (HEAP32[$82 >> 2] | 0) - $81 >> 2, 0); + $86 = $0 + 8 | 0; + $$0 = -1; + $$021 = 0; + while (1) { + if (($$021 | 0) >= (HEAP32[$86 >> 2] | 0)) break; + $95 = HEAP32[$80 >> 2] | 0; + __ZN6vision12ArrayShuffleIiEEvPT_iiRi($95, (HEAP32[$82 >> 2] | 0) - $95 >> 2, HEAP32[$6 >> 2] | 0, HEAP32[$0 >> 2] | 0); + $103 = __ZN6vision14BinarykMedoidsILi96EE6assignERNSt3__26vectorIiNS2_9allocatorIiEEEEPKhiPKiiSB_i($0, $79, $1, $2, $3, $4, HEAP32[$80 >> 2] | 0, HEAP32[$6 >> 2] | 0) | 0; + if ($103 >>> 0 < $$0 >>> 0) { + __ZNSt3__26vectorIiNS_9allocatorIiEEE4swapERS3_($78, $79); + __ZN6vision10CopyVectorIiEEvPT_PKS1_m(HEAP32[$8 >> 2] | 0, HEAP32[$80 >> 2] | 0, HEAP32[$6 >> 2] | 0); + $$1 = $103; + } else $$1 = $$0; + $$0 = $$1; + $$021 = $$021 + 1 | 0; + } + if ((HEAP32[$6 >> 2] | 0) == ((HEAP32[$9 >> 2] | 0) - (HEAP32[$8 >> 2] | 0) >> 2 | 0)) { + STACKTOP = sp; + return; + } else { + $114 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 33662) | 0, 33707) | 0, 39072) | 0, 187) | 0, 39079) | 0, 33779) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $114 + (HEAP32[(HEAP32[$114 >> 2] | 0) + -12 >> 2] | 0) | 0); + $119 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $123 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$119 >> 2] | 0) + 28 >> 2] & 127]($119, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($114, $123) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($114) | 0; + _abort(); + } +} + +function _icpPointRobust($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0205 = 0, $$0207 = 0, $$0209 = 0.0, $$0211 = 0.0, $$0212 = 0, $$0213 = 0.0, $$1 = 0, $$1206 = 0, $$1208 = 0, $$2 = 0, $$3 = 0, $$pn = 0.0, $$pre = 0, $100 = 0, $106 = 0.0, $107 = 0.0, $111 = 0, $115 = 0, $119 = 0, $123 = 0, $127 = 0, $131 = 0, $135 = 0, $139 = 0, $143 = 0, $147 = 0, $151 = 0, $154 = 0, $16 = 0, $19 = 0, $22 = 0, $24 = 0, $25 = 0, $27 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $40 = 0, $41 = 0, $47 = 0, $5 = 0, $51 = 0.0, $55 = 0.0, $56 = 0, $6 = 0, $62 = 0.0, $67 = 0.0, $69 = 0, $7 = 0, $70 = 0.0, $73 = 0.0, $76 = 0.0, $8 = 0, $83 = 0.0, $9 = 0, $95 = 0, $97 = 0.0, $99 = 0, $spec$store$select = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer3 = 0, $vararg_buffer5 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 192 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(192); + $vararg_buffer5 = sp + 184 | 0; + $vararg_buffer3 = sp + 176 | 0; + $vararg_buffer1 = sp + 168 | 0; + $vararg_buffer = sp + 160 | 0; + $5 = sp + 144 | 0; + $6 = sp + 48 | 0; + $7 = sp; + $8 = $1 + 8 | 0; + $9 = HEAP32[$8 >> 2] | 0; + do if (($9 | 0) >= 4) { + $16 = ~~(+HEAPF64[$0 + 128 >> 3] * +($9 | 0)) + -1 | 0; + $spec$store$select = ($16 | 0) > 3 ? $16 : 3; + $19 = _malloc($9 * 96 | 0) | 0; + if (!$19) { + _arLog(0, 3, 45947, $vararg_buffer); + $$0212 = -1; + break; + } + $22 = _malloc($9 << 4) | 0; + if (!$22) { + _arLog(0, 3, 45947, $vararg_buffer1); + _free($19); + $$0212 = -1; + break; + } + $24 = $9 << 3; + $25 = _malloc($24) | 0; + if (!$25) { + _arLog(0, 3, 45947, $vararg_buffer3); + _free($19); + _free($22); + $$0212 = -1; + break; + } + $27 = _malloc($24) | 0; + if (!$27) { + _arLog(0, 3, 45947, $vararg_buffer5); + _free($19); + _free($22); + _free($25); + $$0212 = -1; + break; + } + $$0205 = 0; + while (1) { + if (($$0205 | 0) == 3) break; + $$0207 = 0; + while (1) { + if (($$0207 | 0) == 4) break; + HEAPF64[$3 + ($$0205 << 5) + ($$0207 << 3) >> 3] = +HEAPF64[$2 + ($$0205 << 5) + ($$0207 << 3) >> 3]; + $$0207 = $$0207 + 1 | 0; + } + $$0205 = $$0205 + 1 | 0; + } + $34 = $1 + 4 | 0; + $35 = $5 + 8 | 0; + $36 = $27 + ($spec$store$select << 3) | 0; + $37 = $0 + 104 | 0; + $38 = $0 + 96 | 0; + $39 = $0 + 120 | 0; + $40 = $0 + 112 | 0; + $$0211 = 0.0; + $$1208 = 0; + L23 : while (1) { + _arUtilMatMul($0, $3, $6) | 0; + $$1206 = 0; + while (1) { + $41 = HEAP32[$8 >> 2] | 0; + if (($$1206 | 0) >= ($41 | 0)) break; + if ((_icpGetU_from_X_by_MatX2U($5, $6, (HEAP32[$34 >> 2] | 0) + ($$1206 * 24 | 0) | 0) | 0) < 0) { + label = 20; + break L23; + } + $47 = HEAP32[$1 >> 2] | 0; + $51 = +HEAPF64[$47 + ($$1206 << 4) >> 3] - +HEAPF64[$5 >> 3]; + $55 = +HEAPF64[$47 + ($$1206 << 4) + 8 >> 3] - +HEAPF64[$35 >> 3]; + $56 = $$1206 << 1; + HEAPF64[$22 + ($56 << 3) >> 3] = $51; + HEAPF64[$22 + (($56 | 1) << 3) >> 3] = $55; + $62 = $51 * $51 + $55 * $55; + HEAPF64[$27 + ($$1206 << 3) >> 3] = $62; + HEAPF64[$25 + ($$1206 << 3) >> 3] = $62; + $$1206 = $$1206 + 1 | 0; + } + _qsort($27, $41, 8, 42); + $67 = +HEAPF64[$36 >> 3] * 4.0; + $$0213 = $67 < 16.0 ? 16.0 : $67; + $69 = HEAP32[$8 >> 2] | 0; + $70 = $$0213 / 6.0; + $$0209 = 0.0; + $$2 = 0; + while (1) { + if (($$2 | 0) >= ($69 | 0)) break; + $73 = +HEAPF64[$27 + ($$2 << 3) >> 3]; + if ($73 > $$0213) $$pn = $70; else { + $76 = 1.0 - $73 / $$0213; + $$pn = $70 * (1.0 - $76 * ($76 * $76)); + } + $$0209 = $$0209 + $$pn; + $$2 = $$2 + 1 | 0; + } + $83 = $$0209 / +($69 | 0); + if ($83 < +HEAPF64[$37 >> 3]) { + label = 44; + break; + } + if (($$1208 | 0 ? $83 < +HEAPF64[$39 >> 3] : 0) ? $83 / $$0211 > +HEAPF64[$40 >> 3] : 0) { + label = 44; + break; + } + if (($$1208 | 0) == (HEAP32[$38 >> 2] | 0)) { + label = 44; + break; + } + $$0 = 0; + $$3 = 0; + $95 = $69; + while (1) { + if (($$3 | 0) >= ($95 | 0)) break; + $97 = +HEAPF64[$25 + ($$3 << 3) >> 3]; + if (!($97 <= $$0213)) { + $$1 = $$0; + $$pre = $95; + } else { + $99 = $$0 * 6 | 0; + $100 = $19 + ($99 << 3) | 0; + if ((_icpGetJ_U_S($100, $0, $3, (HEAP32[$34 >> 2] | 0) + ($$3 * 24 | 0) | 0) | 0) < 0) { + label = 36; + break L23; + } + $106 = 1.0 - $97 / $$0213; + $107 = $106 * $106; + HEAPF64[$100 >> 3] = $107 * +HEAPF64[$100 >> 3]; + $111 = $19 + (($99 | 1) << 3) | 0; + HEAPF64[$111 >> 3] = $107 * +HEAPF64[$111 >> 3]; + $115 = $19 + ($99 + 2 << 3) | 0; + HEAPF64[$115 >> 3] = $107 * +HEAPF64[$115 >> 3]; + $119 = $19 + ($99 + 3 << 3) | 0; + HEAPF64[$119 >> 3] = $107 * +HEAPF64[$119 >> 3]; + $123 = $19 + ($99 + 4 << 3) | 0; + HEAPF64[$123 >> 3] = $107 * +HEAPF64[$123 >> 3]; + $127 = $19 + ($99 + 5 << 3) | 0; + HEAPF64[$127 >> 3] = $107 * +HEAPF64[$127 >> 3]; + $131 = $19 + ($99 + 6 << 3) | 0; + HEAPF64[$131 >> 3] = $107 * +HEAPF64[$131 >> 3]; + $135 = $19 + ($99 + 7 << 3) | 0; + HEAPF64[$135 >> 3] = $107 * +HEAPF64[$135 >> 3]; + $139 = $19 + ($99 + 8 << 3) | 0; + HEAPF64[$139 >> 3] = $107 * +HEAPF64[$139 >> 3]; + $143 = $19 + ($99 + 9 << 3) | 0; + HEAPF64[$143 >> 3] = $107 * +HEAPF64[$143 >> 3]; + $147 = $19 + ($99 + 10 << 3) | 0; + HEAPF64[$147 >> 3] = $107 * +HEAPF64[$147 >> 3]; + $151 = $19 + ($99 + 11 << 3) | 0; + HEAPF64[$151 >> 3] = $107 * +HEAPF64[$151 >> 3]; + $154 = $$3 << 1; + HEAPF64[$22 + ($$0 << 3) >> 3] = $107 * +HEAPF64[$22 + ($154 << 3) >> 3]; + HEAPF64[$22 + ($$0 + 1 << 3) >> 3] = $107 * +HEAPF64[$22 + (($154 | 1) << 3) >> 3]; + $$1 = $$0 + 2 | 0; + $$pre = HEAP32[$8 >> 2] | 0; + } + $$0 = $$1; + $$3 = $$3 + 1 | 0; + $95 = $$pre; + } + if (($$0 | 0) < 6) { + label = 40; + break; + } + if ((_icpGetDeltaS($7, $22, $19, $$0) | 0) < 0) { + label = 42; + break; + } + _icpUpdateMat($3, $7) | 0; + $$0211 = $83; + $$1208 = $$1208 + 1 | 0; + } + if ((label | 0) == 20) { + _icpGetXw2XcCleanup_221($19, $22, $25, $27); + $$0212 = -1; + break; + } else if ((label | 0) == 36) { + _icpGetXw2XcCleanup_221($19, $22, $25, $27); + $$0212 = -1; + break; + } else if ((label | 0) == 40) { + _icpGetXw2XcCleanup_221($19, $22, $25, $27); + $$0212 = -1; + break; + } else if ((label | 0) == 42) { + _icpGetXw2XcCleanup_221($19, $22, $25, $27); + $$0212 = -1; + break; + } else if ((label | 0) == 44) { + HEAPF64[$4 >> 3] = $83; + _free($19); + _free($22); + _free($25); + _free($27); + $$0212 = 0; + break; + } + } else $$0212 = -1; while (0); + STACKTOP = sp; + return $$0212 | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i22 = 0, $$0$i$i19 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i28 = 0, $$0$i$i38 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $11 = 0, $110 = 0, $111 = 0, $116 = 0, $12 = 0, $121 = 0, $130 = 0, $132 = 0, $146 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0, $21 = 0, $24 = 0, $27 = 0, $31 = 0, $32 = 0, $34 = 0, $36 = 0, $48 = 0, $51 = 0, $6 = 0, $64 = 0, $68 = 0, $7 = 0, $76 = 0, $8 = 0, $80 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $9 = 0, $96 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 304 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(304); + $vararg_buffer = sp + 264 | 0; + $6 = sp + 160 | 0; + $7 = sp + 292 | 0; + $8 = sp + 280 | 0; + $9 = sp + 276 | 0; + $10 = sp; + $11 = sp + 272 | 0; + $12 = sp + 268 | 0; + HEAP32[$7 >> 2] = 0; + HEAP32[$7 + 4 >> 2] = 0; + HEAP32[$7 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$7 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + __ZNKSt3__28ios_base6getlocEv($8, $3); + $15 = __ZNKSt3__26locale9use_facetERNS0_2idE($8, 66544) | 0; + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$15 >> 2] | 0) + 48 >> 2] & 15]($15, 12928, 12954, $6) | 0; + __ZNSt3__26localeD2Ev($8); + HEAP32[$8 >> 2] = 0; + HEAP32[$8 + 4 >> 2] = 0; + HEAP32[$8 + 8 >> 2] = 0; + $$0$i$i19 = 0; + while (1) { + if (($$0$i$i19 | 0) == 3) break; + HEAP32[$8 + ($$0$i$i19 << 2) >> 2] = 0; + $$0$i$i19 = $$0$i$i19 + 1 | 0; + } + $21 = $8 + 11 | 0; + $24 = $8 + 8 | 0; + if ((HEAP8[$21 >> 0] | 0) < 0) $27 = (HEAP32[$24 >> 2] & 2147483647) + -1 | 0; else $27 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($8, $27, 0); + $31 = (HEAP8[$21 >> 0] | 0) < 0 ? HEAP32[$8 >> 2] | 0 : $8; + HEAP32[$9 >> 2] = $31; + HEAP32[$11 >> 2] = $10; + HEAP32[$12 >> 2] = 0; + $32 = $8 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $31; + $146 = $$pre; + $34 = $$pre; + L12 : while (1) { + if ($34) { + $36 = HEAP32[$34 + 12 >> 2] | 0; + if (($36 | 0) == (HEAP32[$34 + 16 >> 2] | 0)) $$0$i$i$i$i22 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$34 >> 2] | 0) + 36 >> 2] & 127]($34) | 0; else $$0$i$i$i$i22 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$36 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i22, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $121 = 0; + $147 = 1; + $83 = 0; + } else { + $121 = $146; + $147 = 0; + $83 = $34; + } + } else { + $121 = 0; + $147 = 1; + $83 = 0; + } + $48 = HEAP32[$2 >> 2] | 0; + do if ($48) { + $51 = HEAP32[$48 + 12 >> 2] | 0; + if (($51 | 0) == (HEAP32[$48 + 16 >> 2] | 0)) $$0$i$i2$i$i28 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$48 >> 2] | 0) + 36 >> 2] & 127]($48) | 0; else $$0$i$i2$i$i28 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$51 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i28, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($147) { + $148 = $48; + break; + } else { + $$2 = $$0; + $130 = $48; + break L12; + } else { + HEAP32[$2 >> 2] = 0; + label = 22; + break; + } + } else label = 22; while (0); + if ((label | 0) == 22) { + label = 0; + if ($147) { + $$2 = $$0; + $130 = 0; + break; + } else $148 = 0; + } + $64 = HEAP8[$21 >> 0] | 0; + $68 = $64 << 24 >> 24 < 0 ? HEAP32[$32 >> 2] | 0 : $64 & 255; + if ((HEAP32[$9 >> 2] | 0) == ($$0 + $68 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($8, $68 << 1, 0); + if ((HEAP8[$21 >> 0] | 0) < 0) $76 = (HEAP32[$24 >> 2] & 2147483647) + -1 | 0; else $76 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($8, $76, 0); + $80 = (HEAP8[$21 >> 0] | 0) < 0 ? HEAP32[$8 >> 2] | 0 : $8; + HEAP32[$9 >> 2] = $80 + $68; + $$1 = $80; + } else $$1 = $$0; + $82 = $83 + 12 | 0; + $84 = HEAP32[$82 >> 2] | 0; + $85 = $83 + 16 | 0; + if (($84 | 0) == (HEAP32[$85 >> 2] | 0)) $$0$i$i38 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$83 >> 2] | 0) + 36 >> 2] & 127]($83) | 0; else $$0$i$i38 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$84 >> 2] | 0) | 0; + if (__ZNSt3__29__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKw($$0$i$i38, 16, $$1, $9, $12, 0, $7, $10, $11, $6) | 0) { + $$2 = $$1; + $130 = $148; + break; + } + $96 = HEAP32[$82 >> 2] | 0; + if (($96 | 0) == (HEAP32[$85 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$83 >> 2] | 0) + 40 >> 2] & 127]($83) | 0; else { + HEAP32[$82 >> 2] = $96 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$96 >> 2] | 0) | 0; + } + $$0 = $$1; + $146 = $121; + $34 = $83; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($8, (HEAP32[$9 >> 2] | 0) - $$2 | 0, 0); + $110 = (HEAP8[$21 >> 0] | 0) < 0 ? HEAP32[$8 >> 2] | 0 : $8; + $111 = __ZNSt3__26__clocEv() | 0; + HEAP32[$vararg_buffer >> 2] = $5; + if ((__ZNSt3__217__libcpp_sscanf_lEPKcP15__locale_structS1_z($110, $111, 58968, $vararg_buffer) | 0) != 1) HEAP32[$4 >> 2] = 4; + if ($83) { + $116 = HEAP32[$83 + 12 >> 2] | 0; + if (($116 | 0) == (HEAP32[$83 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$121 >> 2] | 0) + 36 >> 2] & 127]($83) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$116 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $149 = 1; + } else $149 = 0; + } else $149 = 1; + do if ($130) { + $132 = HEAP32[$130 + 12 >> 2] | 0; + if (($132 | 0) == (HEAP32[$130 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$130 >> 2] | 0) + 36 >> 2] & 127]($130) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$132 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($149) break; else { + label = 52; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 50; + break; + } + } else label = 50; while (0); + if ((label | 0) == 50 ? $149 : 0) label = 52; + if ((label | 0) == 52) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($8); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($7); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i20 = 0, $$0$i$i17 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i26 = 0, $$0$i$i36 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $11 = 0, $111 = 0, $112 = 0, $117 = 0, $12 = 0, $122 = 0, $131 = 0, $133 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0, $150 = 0, $21 = 0, $24 = 0, $27 = 0, $31 = 0, $32 = 0, $34 = 0, $36 = 0, $48 = 0, $51 = 0, $6 = 0, $64 = 0, $68 = 0, $7 = 0, $76 = 0, $8 = 0, $80 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $9 = 0, $97 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 240 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(240); + $vararg_buffer = sp + 192 | 0; + $6 = sp + 160 | 0; + $7 = sp + 220 | 0; + $8 = sp + 208 | 0; + $9 = sp + 204 | 0; + $10 = sp; + $11 = sp + 200 | 0; + $12 = sp + 196 | 0; + HEAP32[$7 >> 2] = 0; + HEAP32[$7 + 4 >> 2] = 0; + HEAP32[$7 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$7 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + __ZNKSt3__28ios_base6getlocEv($8, $3); + $15 = __ZNKSt3__26locale9use_facetERNS0_2idE($8, 66512) | 0; + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$15 >> 2] | 0) + 32 >> 2] & 15]($15, 12928, 12954, $6) | 0; + __ZNSt3__26localeD2Ev($8); + HEAP32[$8 >> 2] = 0; + HEAP32[$8 + 4 >> 2] = 0; + HEAP32[$8 + 8 >> 2] = 0; + $$0$i$i17 = 0; + while (1) { + if (($$0$i$i17 | 0) == 3) break; + HEAP32[$8 + ($$0$i$i17 << 2) >> 2] = 0; + $$0$i$i17 = $$0$i$i17 + 1 | 0; + } + $21 = $8 + 11 | 0; + $24 = $8 + 8 | 0; + if ((HEAP8[$21 >> 0] | 0) < 0) $27 = (HEAP32[$24 >> 2] & 2147483647) + -1 | 0; else $27 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($8, $27, 0); + $31 = (HEAP8[$21 >> 0] | 0) < 0 ? HEAP32[$8 >> 2] | 0 : $8; + HEAP32[$9 >> 2] = $31; + HEAP32[$11 >> 2] = $10; + HEAP32[$12 >> 2] = 0; + $32 = $8 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $31; + $147 = $$pre; + $34 = $$pre; + L12 : while (1) { + if ($34) { + $36 = HEAP32[$34 + 12 >> 2] | 0; + if (($36 | 0) == (HEAP32[$34 + 16 >> 2] | 0)) $$0$i$i$i$i20 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$34 >> 2] | 0) + 36 >> 2] & 127]($34) | 0; else $$0$i$i$i$i20 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$36 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i20, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $122 = 0; + $148 = 1; + $83 = 0; + } else { + $122 = $147; + $148 = 0; + $83 = $34; + } + } else { + $122 = 0; + $148 = 1; + $83 = 0; + } + $48 = HEAP32[$2 >> 2] | 0; + do if ($48) { + $51 = HEAP32[$48 + 12 >> 2] | 0; + if (($51 | 0) == (HEAP32[$48 + 16 >> 2] | 0)) $$0$i$i2$i$i26 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$48 >> 2] | 0) + 36 >> 2] & 127]($48) | 0; else $$0$i$i2$i$i26 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$51 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i26, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($148) { + $149 = $48; + break; + } else { + $$2 = $$0; + $131 = $48; + break L12; + } else { + HEAP32[$2 >> 2] = 0; + label = 22; + break; + } + } else label = 22; while (0); + if ((label | 0) == 22) { + label = 0; + if ($148) { + $$2 = $$0; + $131 = 0; + break; + } else $149 = 0; + } + $64 = HEAP8[$21 >> 0] | 0; + $68 = $64 << 24 >> 24 < 0 ? HEAP32[$32 >> 2] | 0 : $64 & 255; + if ((HEAP32[$9 >> 2] | 0) == ($$0 + $68 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($8, $68 << 1, 0); + if ((HEAP8[$21 >> 0] | 0) < 0) $76 = (HEAP32[$24 >> 2] & 2147483647) + -1 | 0; else $76 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($8, $76, 0); + $80 = (HEAP8[$21 >> 0] | 0) < 0 ? HEAP32[$8 >> 2] | 0 : $8; + HEAP32[$9 >> 2] = $80 + $68; + $$1 = $80; + } else $$1 = $$0; + $82 = $83 + 12 | 0; + $84 = HEAP32[$82 >> 2] | 0; + $85 = $83 + 16 | 0; + if (($84 | 0) == (HEAP32[$85 >> 2] | 0)) $$0$i$i36 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$83 >> 2] | 0) + 36 >> 2] & 127]($83) | 0; else $$0$i$i36 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$84 >> 0] | 0) | 0; + if (__ZNSt3__29__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKc($$0$i$i36 & 255, 16, $$1, $9, $12, 0, $7, $10, $11, $6) | 0) { + $$2 = $$1; + $131 = $149; + break; + } + $97 = HEAP32[$82 >> 2] | 0; + if (($97 | 0) == (HEAP32[$85 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$83 >> 2] | 0) + 40 >> 2] & 127]($83) | 0; else { + HEAP32[$82 >> 2] = $97 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$97 >> 0] | 0) | 0; + } + $$0 = $$1; + $147 = $122; + $34 = $83; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($8, (HEAP32[$9 >> 2] | 0) - $$2 | 0, 0); + $111 = (HEAP8[$21 >> 0] | 0) < 0 ? HEAP32[$8 >> 2] | 0 : $8; + $112 = __ZNSt3__26__clocEv() | 0; + HEAP32[$vararg_buffer >> 2] = $5; + if ((__ZNSt3__217__libcpp_sscanf_lEPKcP15__locale_structS1_z($111, $112, 58968, $vararg_buffer) | 0) != 1) HEAP32[$4 >> 2] = 4; + if ($83) { + $117 = HEAP32[$83 + 12 >> 2] | 0; + if (($117 | 0) == (HEAP32[$83 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$122 >> 2] | 0) + 36 >> 2] & 127]($83) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$117 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $150 = 1; + } else $150 = 0; + } else $150 = 1; + do if ($131) { + $133 = HEAP32[$131 + 12 >> 2] | 0; + if (($133 | 0) == (HEAP32[$131 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$131 >> 2] | 0) + 36 >> 2] & 127]($131) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$133 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($150) break; else { + label = 52; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 50; + break; + } + } else label = 50; while (0); + if ((label | 0) == 50 ? $150 : 0) label = 52; + if ((label | 0) == 52) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($8); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($7); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function _jpeg_idct_islow($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0285295 = 0, $$0287294 = 0, $$0289293 = 0, $$0296 = 0, $$1292 = 0, $$2291 = 0, $$sink = 0, $$sink303 = 0, $100 = 0, $101 = 0, $103 = 0, $106 = 0, $107 = 0, $109 = 0, $11 = 0, $113 = 0, $115 = 0, $117 = 0, $121 = 0, $123 = 0, $13 = 0, $149 = 0, $152 = 0, $154 = 0, $156 = 0, $158 = 0, $179 = 0, $182 = 0, $184 = 0, $186 = 0, $188 = 0, $190 = 0, $191 = 0, $193 = 0, $195 = 0, $196 = 0, $197 = 0, $198 = 0, $199 = 0, $201 = 0, $203 = 0, $205 = 0, $206 = 0, $207 = 0, $209 = 0, $212 = 0, $213 = 0, $215 = 0, $219 = 0, $221 = 0, $223 = 0, $227 = 0, $229 = 0, $35 = 0, $5 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $58 = 0, $61 = 0, $67 = 0, $69 = 0, $7 = 0, $71 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $83 = 0, $89 = 0, $95 = 0, $99 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 256 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(256); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0285295 = $5; + $$0287294 = HEAP32[$1 + 84 >> 2] | 0; + $$0289293 = $2; + $$0296 = 8; + while (1) { + $11 = HEAP16[$$0289293 + 16 >> 1] | 0; + $13 = HEAP16[$$0289293 + 32 >> 1] | 0; + if (!(($11 | $13) << 16 >> 16)) if (((((HEAP16[$$0289293 + 48 >> 1] | 0) == 0 ? (HEAP16[$$0289293 + 64 >> 1] | 0) == 0 : 0) ? (HEAP16[$$0289293 + 80 >> 1] | 0) == 0 : 0) ? (HEAP16[$$0289293 + 96 >> 1] | 0) == 0 : 0) ? (HEAP16[$$0289293 + 112 >> 1] | 0) == 0 : 0) { + $35 = Math_imul(HEAP16[$$0289293 >> 1] << 2, HEAP32[$$0287294 >> 2] | 0) | 0; + HEAP32[$$0285295 >> 2] = $35; + HEAP32[$$0285295 + 32 >> 2] = $35; + HEAP32[$$0285295 + 64 >> 2] = $35; + HEAP32[$$0285295 + 96 >> 2] = $35; + HEAP32[$$0285295 + 128 >> 2] = $35; + HEAP32[$$0285295 + 160 >> 2] = $35; + HEAP32[$$0285295 + 192 >> 2] = $35; + $$sink = $35; + $$sink303 = 56; + } else { + $58 = 0; + label = 9; + } else { + $58 = $13; + label = 9; + } + if ((label | 0) == 9) { + label = 0; + $53 = Math_imul(HEAP16[$$0289293 + 64 >> 1] << 13, HEAP32[$$0287294 + 128 >> 2] | 0) | 0; + $54 = Math_imul(HEAP16[$$0289293 >> 1] << 13, HEAP32[$$0287294 >> 2] | 0) | 0 | 1024; + $55 = $53 + $54 | 0; + $56 = $54 - $53 | 0; + $61 = Math_imul(HEAP32[$$0287294 + 64 >> 2] | 0, $58 << 16 >> 16) | 0; + $67 = Math_imul(HEAP32[$$0287294 + 192 >> 2] | 0, HEAP16[$$0289293 + 96 >> 1] | 0) | 0; + $69 = ($67 + $61 | 0) * 4433 | 0; + $71 = $69 + ($61 * 6270 | 0) | 0; + $73 = $69 + (Math_imul($67, -15137) | 0) | 0; + $74 = $71 + $55 | 0; + $75 = $55 - $71 | 0; + $76 = $73 + $56 | 0; + $77 = $56 - $73 | 0; + $83 = Math_imul(HEAP32[$$0287294 + 224 >> 2] | 0, HEAP16[$$0289293 + 112 >> 1] | 0) | 0; + $89 = Math_imul(HEAP32[$$0287294 + 160 >> 2] | 0, HEAP16[$$0289293 + 80 >> 1] | 0) | 0; + $95 = Math_imul(HEAP32[$$0287294 + 96 >> 2] | 0, HEAP16[$$0289293 + 48 >> 1] | 0) | 0; + $99 = Math_imul(HEAP32[$$0287294 + 32 >> 2] | 0, $11 << 16 >> 16) | 0; + $100 = $95 + $83 | 0; + $101 = $99 + $89 | 0; + $103 = ($101 + $100 | 0) * 9633 | 0; + $106 = $103 + (Math_imul($100, -16069) | 0) | 0; + $107 = $103 + (Math_imul($101, -3196) | 0) | 0; + $109 = Math_imul($99 + $83 | 0, -7373) | 0; + $113 = $109 + ($83 * 2446 | 0) + $106 | 0; + $115 = $109 + ($99 * 12299 | 0) + $107 | 0; + $117 = Math_imul($95 + $89 | 0, -20995) | 0; + $121 = $117 + ($89 * 16819 | 0) + $107 | 0; + $123 = $117 + ($95 * 25172 | 0) + $106 | 0; + HEAP32[$$0285295 >> 2] = $115 + $74 >> 11; + HEAP32[$$0285295 + 224 >> 2] = $74 - $115 >> 11; + HEAP32[$$0285295 + 32 >> 2] = $123 + $76 >> 11; + HEAP32[$$0285295 + 192 >> 2] = $76 - $123 >> 11; + HEAP32[$$0285295 + 64 >> 2] = $121 + $77 >> 11; + HEAP32[$$0285295 + 160 >> 2] = $77 - $121 >> 11; + HEAP32[$$0285295 + 96 >> 2] = $113 + $75 >> 11; + $$sink = $75 - $113 >> 11; + $$sink303 = 32; + } + HEAP32[$$0285295 + ($$sink303 << 2) >> 2] = $$sink; + if ($$0296 >>> 0 > 1) { + $$0285295 = $$0285295 + 4 | 0; + $$0287294 = $$0287294 + 4 | 0; + $$0289293 = $$0289293 + 2 | 0; + $$0296 = $$0296 + -1 | 0; + } else break; + } + $149 = $7 + -384 | 0; + $$1292 = 0; + $$2291 = $5; + while (1) { + $152 = (HEAP32[$3 + ($$1292 << 2) >> 2] | 0) + $4 | 0; + $154 = (HEAP32[$$2291 >> 2] | 0) + 16400 | 0; + $156 = HEAP32[$$2291 + 4 >> 2] | 0; + $158 = HEAP32[$$2291 + 8 >> 2] | 0; + if (!($156 | $158)) if (((((HEAP32[$$2291 + 12 >> 2] | 0) == 0 ? (HEAP32[$$2291 + 16 >> 2] | 0) == 0 : 0) ? (HEAP32[$$2291 + 20 >> 2] | 0) == 0 : 0) ? (HEAP32[$$2291 + 24 >> 2] | 0) == 0 : 0) ? (HEAP32[$$2291 + 28 >> 2] | 0) == 0 : 0) { + $179 = HEAP8[$149 + ($154 >>> 5 & 1023) >> 0] | 0; + HEAP8[$152 >> 0] = $179; + _memset($152 + 1 | 0, $179 | 0, 7) | 0; + } else { + $190 = 0; + label = 19; + } else { + $190 = $158; + label = 19; + } + if ((label | 0) == 19) { + label = 0; + $182 = HEAP32[$$2291 + 16 >> 2] | 0; + $184 = $182 + $154 << 13; + $186 = $154 - $182 << 13; + $188 = HEAP32[$$2291 + 24 >> 2] | 0; + $191 = ($188 + $190 | 0) * 4433 | 0; + $193 = $191 + ($190 * 6270 | 0) | 0; + $195 = $191 + (Math_imul($188, -15137) | 0) | 0; + $196 = $193 + $184 | 0; + $197 = $184 - $193 | 0; + $198 = $195 + $186 | 0; + $199 = $186 - $195 | 0; + $201 = HEAP32[$$2291 + 28 >> 2] | 0; + $203 = HEAP32[$$2291 + 20 >> 2] | 0; + $205 = HEAP32[$$2291 + 12 >> 2] | 0; + $206 = $205 + $201 | 0; + $207 = $203 + $156 | 0; + $209 = ($206 + $207 | 0) * 9633 | 0; + $212 = $209 + (Math_imul($206, -16069) | 0) | 0; + $213 = $209 + (Math_imul($207, -3196) | 0) | 0; + $215 = Math_imul($201 + $156 | 0, -7373) | 0; + $219 = $215 + ($201 * 2446 | 0) + $212 | 0; + $221 = $215 + ($156 * 12299 | 0) + $213 | 0; + $223 = Math_imul($205 + $203 | 0, -20995) | 0; + $227 = $223 + ($203 * 16819 | 0) + $213 | 0; + $229 = $223 + ($205 * 25172 | 0) + $212 | 0; + HEAP8[$152 >> 0] = HEAP8[$149 + (($221 + $196 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 7 >> 0] = HEAP8[$149 + (($196 - $221 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 1 >> 0] = HEAP8[$149 + (($229 + $198 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 6 >> 0] = HEAP8[$149 + (($198 - $229 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 2 >> 0] = HEAP8[$149 + (($227 + $199 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 5 >> 0] = HEAP8[$149 + (($199 - $227 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 3 >> 0] = HEAP8[$149 + (($219 + $197 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$152 + 4 >> 0] = HEAP8[$149 + (($197 - $219 | 0) >>> 18 & 1023) >> 0] | 0; + } + $$1292 = $$1292 + 1 | 0; + if (($$1292 | 0) == 8) break; else $$2291 = $$2291 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function __ZNSt3__220__get_up_to_n_digitsIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i27 = 0, $$0$i$i$i$i41 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i33 = 0, $$0$i$i2$i$i47 = 0, $$0$i$i38 = 0, $$0$in = 0, $$025 = 0, $$025$in = 0, $$2 = 0, $102 = 0, $103 = 0, $106 = 0, $108 = 0, $128 = 0, $129 = 0, $130 = 0, $131 = 0, $142 = 0, $155 = 0, $157 = 0, $171 = 0, $172 = 0, $173 = 0, $174 = 0, $175 = 0, $20 = 0, $23 = 0, $37 = 0, $39 = 0, $5 = 0, $59 = 0, $60 = 0, $61 = 0, $62 = 0, $71 = 0, $74 = 0, $8 = 0, $87 = 0, $89 = 0, label = 0; + $5 = HEAP32[$0 >> 2] | 0; + do if ($5) { + $8 = HEAP32[$5 + 12 >> 2] | 0; + if (($8 | 0) == (HEAP32[$5 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$5 >> 2] | 0) + 36 >> 2] & 127]($5) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$8 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $171 = 1; + break; + } else { + $171 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $171 = 1; while (0); + $20 = HEAP32[$1 >> 2] | 0; + do if ($20) { + $23 = HEAP32[$20 + 12 >> 2] | 0; + if (($23 | 0) == (HEAP32[$20 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$20 >> 2] | 0) + 36 >> 2] & 127]($20) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$23 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($171) { + $172 = $20; + label = 17; + break; + } else { + label = 16; + break; + } else { + HEAP32[$1 >> 2] = 0; + label = 14; + break; + } + } else label = 14; while (0); + if ((label | 0) == 14) if ($171) label = 16; else { + $172 = 0; + label = 17; + } + L22 : do if ((label | 0) == 16) { + HEAP32[$2 >> 2] = HEAP32[$2 >> 2] | 6; + $$2 = 0; + } else if ((label | 0) == 17) { + $37 = HEAP32[$0 >> 2] | 0; + $39 = HEAP32[$37 + 12 >> 2] | 0; + if (($39 | 0) == (HEAP32[$37 + 16 >> 2] | 0)) $$0$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$37 >> 2] | 0) + 36 >> 2] & 127]($37) | 0; else $$0$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$39 >> 2] | 0) | 0; + if (!(FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$3 >> 2] | 0) + 12 >> 2] & 63]($3, 2048, $$0$i$i) | 0)) { + HEAP32[$2 >> 2] = HEAP32[$2 >> 2] | 4; + $$2 = 0; + break; + } + $59 = (FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$3 >> 2] | 0) + 52 >> 2] & 63]($3, $$0$i$i, 0) | 0) << 24 >> 24; + $60 = HEAP32[$0 >> 2] | 0; + $61 = $60 + 12 | 0; + $62 = HEAP32[$61 >> 2] | 0; + if (($62 | 0) == (HEAP32[$60 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$60 >> 2] | 0) + 40 >> 2] & 127]($60) | 0; else { + HEAP32[$61 >> 2] = $62 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$62 >> 2] | 0) | 0; + } + $$0$in = $59; + $$025$in = $4; + $173 = $172; + $87 = $172; + while (1) { + $$0 = $$0$in + -48 | 0; + $$025 = $$025$in + -1 | 0; + $71 = HEAP32[$0 >> 2] | 0; + do if ($71) { + $74 = HEAP32[$71 + 12 >> 2] | 0; + if (($74 | 0) == (HEAP32[$71 + 16 >> 2] | 0)) $$0$i$i$i$i27 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$71 >> 2] | 0) + 36 >> 2] & 127]($71) | 0; else $$0$i$i$i$i27 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$74 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i27, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $102 = 1; + break; + } else { + $102 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $102 = 1; while (0); + if ($87) { + $89 = HEAP32[$87 + 12 >> 2] | 0; + if (($89 | 0) == (HEAP32[$87 + 16 >> 2] | 0)) $$0$i$i2$i$i33 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$87 >> 2] | 0) + 36 >> 2] & 127]($87) | 0; else $$0$i$i2$i$i33 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$89 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i33, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $103 = 1; + $155 = 0; + $174 = 0; + } else { + $103 = 0; + $155 = $173; + $174 = $87; + } + } else { + $103 = 1; + $155 = $173; + $174 = 0; + } + $106 = HEAP32[$0 >> 2] | 0; + if (!(($$025$in | 0) > 1 & ($102 ^ $103))) break; + $108 = HEAP32[$106 + 12 >> 2] | 0; + if (($108 | 0) == (HEAP32[$106 + 16 >> 2] | 0)) $$0$i$i38 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$106 >> 2] | 0) + 36 >> 2] & 127]($106) | 0; else $$0$i$i38 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$108 >> 2] | 0) | 0; + if (!(FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$3 >> 2] | 0) + 12 >> 2] & 63]($3, 2048, $$0$i$i38) | 0)) { + $$2 = $$0; + break L22; + } + $128 = ($$0 * 10 | 0) + ((FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$3 >> 2] | 0) + 52 >> 2] & 63]($3, $$0$i$i38, 0) | 0) << 24 >> 24) | 0; + $129 = HEAP32[$0 >> 2] | 0; + $130 = $129 + 12 | 0; + $131 = HEAP32[$130 >> 2] | 0; + if (($131 | 0) == (HEAP32[$129 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$129 >> 2] | 0) + 40 >> 2] & 127]($129) | 0; else { + HEAP32[$130 >> 2] = $131 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$131 >> 2] | 0) | 0; + } + $$0$in = $128; + $$025$in = $$025; + $173 = $155; + $87 = $174; + } + do if ($106) { + $142 = HEAP32[$106 + 12 >> 2] | 0; + if (($142 | 0) == (HEAP32[$106 + 16 >> 2] | 0)) $$0$i$i$i$i41 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$106 >> 2] | 0) + 36 >> 2] & 127]($106) | 0; else $$0$i$i$i$i41 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$142 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i41, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$0 >> 2] = 0; + $175 = 1; + break; + } else { + $175 = (HEAP32[$0 >> 2] | 0) == 0; + break; + } + } else $175 = 1; while (0); + do if ($155) { + $157 = HEAP32[$155 + 12 >> 2] | 0; + if (($157 | 0) == (HEAP32[$155 + 16 >> 2] | 0)) $$0$i$i2$i$i47 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$155 >> 2] | 0) + 36 >> 2] & 127]($155) | 0; else $$0$i$i2$i$i47 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$157 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i47, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($175) { + $$2 = $$0; + break L22; + } else break; else { + HEAP32[$1 >> 2] = 0; + label = 61; + break; + } + } else label = 61; while (0); + if ((label | 0) == 61 ? !$175 : 0) { + $$2 = $$0; + break; + } + HEAP32[$2 >> 2] = HEAP32[$2 >> 2] | 2; + $$2 = $$0; + } while (0); + return $$2 | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedItEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i25 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i31 = 0, $$0$i$i41 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $103 = 0, $11 = 0, $110 = 0, $115 = 0, $118 = 0, $12 = 0, $122 = 0, $127 = 0, $13 = 0, $136 = 0, $138 = 0, $14 = 0, $15 = 0, $152 = 0, $153 = 0, $154 = 0, $155 = 0, $18 = 0, $21 = 0, $24 = 0, $28 = 0, $29 = 0, $31 = 0, $33 = 0, $45 = 0, $48 = 0, $6 = 0, $61 = 0, $65 = 0, $73 = 0, $77 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $9 = 0, $94 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 304 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(304); + $6 = sp + 300 | 0; + $8 = sp + 288 | 0; + $9 = sp + 276 | 0; + $10 = sp + 272 | 0; + $11 = sp; + $12 = sp + 268 | 0; + $13 = sp + 264 | 0; + $14 = __ZNSt3__214__num_get_base10__get_baseERNS_8ios_baseE($3) | 0; + $15 = __ZNKSt3__29__num_getIwE10__do_widenERNS_8ios_baseEPw($0, $3, sp + 160 | 0) | 0; + __ZNSt3__29__num_getIwE17__stage2_int_prepERNS_8ios_baseERw($8, $3, $6); + HEAP32[$9 >> 2] = 0; + HEAP32[$9 + 4 >> 2] = 0; + HEAP32[$9 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$9 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $18 = $9 + 11 | 0; + $21 = $9 + 8 | 0; + if ((HEAP8[$18 >> 0] | 0) < 0) $24 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $24 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $24, 0); + $28 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $28; + HEAP32[$12 >> 2] = $11; + HEAP32[$13 >> 2] = 0; + $29 = $9 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $28; + $152 = $$pre; + $31 = $$pre; + L8 : while (1) { + if ($31) { + $33 = HEAP32[$31 + 12 >> 2] | 0; + if (($33 | 0) == (HEAP32[$31 + 16 >> 2] | 0)) $$0$i$i$i$i25 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$31 >> 2] | 0) + 36 >> 2] & 127]($31) | 0; else $$0$i$i$i$i25 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$33 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i25, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $127 = 0; + $153 = 1; + $80 = 0; + } else { + $127 = $152; + $153 = 0; + $80 = $31; + } + } else { + $127 = 0; + $153 = 1; + $80 = 0; + } + $45 = HEAP32[$2 >> 2] | 0; + do if ($45) { + $48 = HEAP32[$45 + 12 >> 2] | 0; + if (($48 | 0) == (HEAP32[$45 + 16 >> 2] | 0)) $$0$i$i2$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$45 >> 2] | 0) + 36 >> 2] & 127]($45) | 0; else $$0$i$i2$i$i31 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$48 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i31, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($153) { + $154 = $45; + break; + } else { + $$2 = $$0; + $136 = $45; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($153) { + $$2 = $$0; + $136 = 0; + break; + } else $154 = 0; + } + $61 = HEAP8[$18 >> 0] | 0; + $65 = $61 << 24 >> 24 < 0 ? HEAP32[$29 >> 2] | 0 : $61 & 255; + if ((HEAP32[$10 >> 2] | 0) == ($$0 + $65 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $65 << 1, 0); + if ((HEAP8[$18 >> 0] | 0) < 0) $73 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $73 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $73, 0); + $77 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $77 + $65; + $$1 = $77; + } else $$1 = $$0; + $79 = $80 + 12 | 0; + $81 = HEAP32[$79 >> 2] | 0; + $82 = $80 + 16 | 0; + if (($81 | 0) == (HEAP32[$82 >> 2] | 0)) $$0$i$i41 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i41 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$81 >> 2] | 0) | 0; + if (__ZNSt3__29__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKw($$0$i$i41, $14, $$1, $10, $13, HEAP32[$6 >> 2] | 0, $8, $11, $12, $15) | 0) { + $$2 = $$1; + $136 = $154; + break; + } + $94 = HEAP32[$79 >> 2] | 0; + if (($94 | 0) == (HEAP32[$82 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 40 >> 2] & 127]($80) | 0; else { + HEAP32[$79 >> 2] = $94 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$94 >> 2] | 0) | 0; + } + $$0 = $$1; + $152 = $127; + $31 = $80; + } + $103 = HEAP8[$8 + 11 >> 0] | 0; + if (($103 << 24 >> 24 < 0 ? HEAP32[$8 + 4 >> 2] | 0 : $103 & 255) | 0 ? ($110 = HEAP32[$12 >> 2] | 0, ($110 - $11 | 0) < 160) : 0) { + $115 = HEAP32[$13 >> 2] | 0; + HEAP32[$12 >> 2] = $110 + 4; + HEAP32[$110 >> 2] = $115; + } + $118 = __ZNSt3__227__num_get_unsigned_integralItEET_PKcS3_Rji($$2, HEAP32[$10 >> 2] | 0, $4, $14) | 0; + HEAP16[$5 >> 1] = $118; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($8, $11, HEAP32[$12 >> 2] | 0, $4); + if ($80) { + $122 = HEAP32[$80 + 12 >> 2] | 0; + if (($122 | 0) == (HEAP32[$80 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$127 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$122 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $155 = 1; + } else $155 = 0; + } else $155 = 1; + do if ($136) { + $138 = HEAP32[$136 + 12 >> 2] | 0; + if (($138 | 0) == (HEAP32[$136 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$136 >> 2] | 0) + 36 >> 2] & 127]($136) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$138 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($155) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $155 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($8); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedImEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i25 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i31 = 0, $$0$i$i41 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $103 = 0, $11 = 0, $110 = 0, $115 = 0, $118 = 0, $12 = 0, $122 = 0, $127 = 0, $13 = 0, $136 = 0, $138 = 0, $14 = 0, $15 = 0, $152 = 0, $153 = 0, $154 = 0, $155 = 0, $18 = 0, $21 = 0, $24 = 0, $28 = 0, $29 = 0, $31 = 0, $33 = 0, $45 = 0, $48 = 0, $6 = 0, $61 = 0, $65 = 0, $73 = 0, $77 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $9 = 0, $94 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 304 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(304); + $6 = sp + 300 | 0; + $8 = sp + 288 | 0; + $9 = sp + 276 | 0; + $10 = sp + 272 | 0; + $11 = sp; + $12 = sp + 268 | 0; + $13 = sp + 264 | 0; + $14 = __ZNSt3__214__num_get_base10__get_baseERNS_8ios_baseE($3) | 0; + $15 = __ZNKSt3__29__num_getIwE10__do_widenERNS_8ios_baseEPw($0, $3, sp + 160 | 0) | 0; + __ZNSt3__29__num_getIwE17__stage2_int_prepERNS_8ios_baseERw($8, $3, $6); + HEAP32[$9 >> 2] = 0; + HEAP32[$9 + 4 >> 2] = 0; + HEAP32[$9 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$9 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $18 = $9 + 11 | 0; + $21 = $9 + 8 | 0; + if ((HEAP8[$18 >> 0] | 0) < 0) $24 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $24 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $24, 0); + $28 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $28; + HEAP32[$12 >> 2] = $11; + HEAP32[$13 >> 2] = 0; + $29 = $9 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $28; + $152 = $$pre; + $31 = $$pre; + L8 : while (1) { + if ($31) { + $33 = HEAP32[$31 + 12 >> 2] | 0; + if (($33 | 0) == (HEAP32[$31 + 16 >> 2] | 0)) $$0$i$i$i$i25 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$31 >> 2] | 0) + 36 >> 2] & 127]($31) | 0; else $$0$i$i$i$i25 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$33 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i25, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $127 = 0; + $153 = 1; + $80 = 0; + } else { + $127 = $152; + $153 = 0; + $80 = $31; + } + } else { + $127 = 0; + $153 = 1; + $80 = 0; + } + $45 = HEAP32[$2 >> 2] | 0; + do if ($45) { + $48 = HEAP32[$45 + 12 >> 2] | 0; + if (($48 | 0) == (HEAP32[$45 + 16 >> 2] | 0)) $$0$i$i2$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$45 >> 2] | 0) + 36 >> 2] & 127]($45) | 0; else $$0$i$i2$i$i31 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$48 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i31, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($153) { + $154 = $45; + break; + } else { + $$2 = $$0; + $136 = $45; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($153) { + $$2 = $$0; + $136 = 0; + break; + } else $154 = 0; + } + $61 = HEAP8[$18 >> 0] | 0; + $65 = $61 << 24 >> 24 < 0 ? HEAP32[$29 >> 2] | 0 : $61 & 255; + if ((HEAP32[$10 >> 2] | 0) == ($$0 + $65 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $65 << 1, 0); + if ((HEAP8[$18 >> 0] | 0) < 0) $73 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $73 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $73, 0); + $77 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $77 + $65; + $$1 = $77; + } else $$1 = $$0; + $79 = $80 + 12 | 0; + $81 = HEAP32[$79 >> 2] | 0; + $82 = $80 + 16 | 0; + if (($81 | 0) == (HEAP32[$82 >> 2] | 0)) $$0$i$i41 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i41 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$81 >> 2] | 0) | 0; + if (__ZNSt3__29__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKw($$0$i$i41, $14, $$1, $10, $13, HEAP32[$6 >> 2] | 0, $8, $11, $12, $15) | 0) { + $$2 = $$1; + $136 = $154; + break; + } + $94 = HEAP32[$79 >> 2] | 0; + if (($94 | 0) == (HEAP32[$82 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 40 >> 2] & 127]($80) | 0; else { + HEAP32[$79 >> 2] = $94 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$94 >> 2] | 0) | 0; + } + $$0 = $$1; + $152 = $127; + $31 = $80; + } + $103 = HEAP8[$8 + 11 >> 0] | 0; + if (($103 << 24 >> 24 < 0 ? HEAP32[$8 + 4 >> 2] | 0 : $103 & 255) | 0 ? ($110 = HEAP32[$12 >> 2] | 0, ($110 - $11 | 0) < 160) : 0) { + $115 = HEAP32[$13 >> 2] | 0; + HEAP32[$12 >> 2] = $110 + 4; + HEAP32[$110 >> 2] = $115; + } + $118 = __ZNSt3__227__num_get_unsigned_integralImEET_PKcS3_Rji($$2, HEAP32[$10 >> 2] | 0, $4, $14) | 0; + HEAP32[$5 >> 2] = $118; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($8, $11, HEAP32[$12 >> 2] | 0, $4); + if ($80) { + $122 = HEAP32[$80 + 12 >> 2] | 0; + if (($122 | 0) == (HEAP32[$80 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$127 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$122 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $155 = 1; + } else $155 = 0; + } else $155 = 1; + do if ($136) { + $138 = HEAP32[$136 + 12 >> 2] | 0; + if (($138 | 0) == (HEAP32[$136 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$136 >> 2] | 0) + 36 >> 2] & 127]($136) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$138 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($155) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $155 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($8); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedIjEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i25 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i31 = 0, $$0$i$i41 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $103 = 0, $11 = 0, $110 = 0, $115 = 0, $118 = 0, $12 = 0, $122 = 0, $127 = 0, $13 = 0, $136 = 0, $138 = 0, $14 = 0, $15 = 0, $152 = 0, $153 = 0, $154 = 0, $155 = 0, $18 = 0, $21 = 0, $24 = 0, $28 = 0, $29 = 0, $31 = 0, $33 = 0, $45 = 0, $48 = 0, $6 = 0, $61 = 0, $65 = 0, $73 = 0, $77 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $9 = 0, $94 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 304 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(304); + $6 = sp + 300 | 0; + $8 = sp + 288 | 0; + $9 = sp + 276 | 0; + $10 = sp + 272 | 0; + $11 = sp; + $12 = sp + 268 | 0; + $13 = sp + 264 | 0; + $14 = __ZNSt3__214__num_get_base10__get_baseERNS_8ios_baseE($3) | 0; + $15 = __ZNKSt3__29__num_getIwE10__do_widenERNS_8ios_baseEPw($0, $3, sp + 160 | 0) | 0; + __ZNSt3__29__num_getIwE17__stage2_int_prepERNS_8ios_baseERw($8, $3, $6); + HEAP32[$9 >> 2] = 0; + HEAP32[$9 + 4 >> 2] = 0; + HEAP32[$9 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$9 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $18 = $9 + 11 | 0; + $21 = $9 + 8 | 0; + if ((HEAP8[$18 >> 0] | 0) < 0) $24 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $24 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $24, 0); + $28 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $28; + HEAP32[$12 >> 2] = $11; + HEAP32[$13 >> 2] = 0; + $29 = $9 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $28; + $152 = $$pre; + $31 = $$pre; + L8 : while (1) { + if ($31) { + $33 = HEAP32[$31 + 12 >> 2] | 0; + if (($33 | 0) == (HEAP32[$31 + 16 >> 2] | 0)) $$0$i$i$i$i25 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$31 >> 2] | 0) + 36 >> 2] & 127]($31) | 0; else $$0$i$i$i$i25 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$33 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i25, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $127 = 0; + $153 = 1; + $80 = 0; + } else { + $127 = $152; + $153 = 0; + $80 = $31; + } + } else { + $127 = 0; + $153 = 1; + $80 = 0; + } + $45 = HEAP32[$2 >> 2] | 0; + do if ($45) { + $48 = HEAP32[$45 + 12 >> 2] | 0; + if (($48 | 0) == (HEAP32[$45 + 16 >> 2] | 0)) $$0$i$i2$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$45 >> 2] | 0) + 36 >> 2] & 127]($45) | 0; else $$0$i$i2$i$i31 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$48 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i31, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($153) { + $154 = $45; + break; + } else { + $$2 = $$0; + $136 = $45; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($153) { + $$2 = $$0; + $136 = 0; + break; + } else $154 = 0; + } + $61 = HEAP8[$18 >> 0] | 0; + $65 = $61 << 24 >> 24 < 0 ? HEAP32[$29 >> 2] | 0 : $61 & 255; + if ((HEAP32[$10 >> 2] | 0) == ($$0 + $65 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $65 << 1, 0); + if ((HEAP8[$18 >> 0] | 0) < 0) $73 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $73 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $73, 0); + $77 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $77 + $65; + $$1 = $77; + } else $$1 = $$0; + $79 = $80 + 12 | 0; + $81 = HEAP32[$79 >> 2] | 0; + $82 = $80 + 16 | 0; + if (($81 | 0) == (HEAP32[$82 >> 2] | 0)) $$0$i$i41 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i41 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$81 >> 2] | 0) | 0; + if (__ZNSt3__29__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKw($$0$i$i41, $14, $$1, $10, $13, HEAP32[$6 >> 2] | 0, $8, $11, $12, $15) | 0) { + $$2 = $$1; + $136 = $154; + break; + } + $94 = HEAP32[$79 >> 2] | 0; + if (($94 | 0) == (HEAP32[$82 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 40 >> 2] & 127]($80) | 0; else { + HEAP32[$79 >> 2] = $94 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$94 >> 2] | 0) | 0; + } + $$0 = $$1; + $152 = $127; + $31 = $80; + } + $103 = HEAP8[$8 + 11 >> 0] | 0; + if (($103 << 24 >> 24 < 0 ? HEAP32[$8 + 4 >> 2] | 0 : $103 & 255) | 0 ? ($110 = HEAP32[$12 >> 2] | 0, ($110 - $11 | 0) < 160) : 0) { + $115 = HEAP32[$13 >> 2] | 0; + HEAP32[$12 >> 2] = $110 + 4; + HEAP32[$110 >> 2] = $115; + } + $118 = __ZNSt3__227__num_get_unsigned_integralIjEET_PKcS3_Rji($$2, HEAP32[$10 >> 2] | 0, $4, $14) | 0; + HEAP32[$5 >> 2] = $118; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($8, $11, HEAP32[$12 >> 2] | 0, $4); + if ($80) { + $122 = HEAP32[$80 + 12 >> 2] | 0; + if (($122 | 0) == (HEAP32[$80 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$127 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$122 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $155 = 1; + } else $155 = 0; + } else $155 = 1; + do if ($136) { + $138 = HEAP32[$136 + 12 >> 2] | 0; + if (($138 | 0) == (HEAP32[$136 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$136 >> 2] | 0) + 36 >> 2] & 127]($136) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$138 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($155) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $155 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($8); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedItEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i25 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i31 = 0, $$0$i$i41 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $104 = 0, $11 = 0, $111 = 0, $116 = 0, $119 = 0, $12 = 0, $123 = 0, $128 = 0, $13 = 0, $137 = 0, $139 = 0, $14 = 0, $15 = 0, $153 = 0, $154 = 0, $155 = 0, $156 = 0, $18 = 0, $21 = 0, $24 = 0, $28 = 0, $29 = 0, $31 = 0, $33 = 0, $45 = 0, $48 = 0, $6 = 0, $61 = 0, $65 = 0, $73 = 0, $77 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $9 = 0, $95 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 240 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(240); + $6 = sp + 224 | 0; + $8 = sp + 212 | 0; + $9 = sp + 200 | 0; + $10 = sp + 196 | 0; + $11 = sp; + $12 = sp + 192 | 0; + $13 = sp + 188 | 0; + $14 = __ZNSt3__214__num_get_base10__get_baseERNS_8ios_baseE($3) | 0; + $15 = __ZNKSt3__29__num_getIcE10__do_widenERNS_8ios_baseEPc($0, $3, sp + 160 | 0) | 0; + __ZNSt3__29__num_getIcE17__stage2_int_prepERNS_8ios_baseERc($8, $3, $6); + HEAP32[$9 >> 2] = 0; + HEAP32[$9 + 4 >> 2] = 0; + HEAP32[$9 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$9 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $18 = $9 + 11 | 0; + $21 = $9 + 8 | 0; + if ((HEAP8[$18 >> 0] | 0) < 0) $24 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $24 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $24, 0); + $28 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $28; + HEAP32[$12 >> 2] = $11; + HEAP32[$13 >> 2] = 0; + $29 = $9 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $28; + $153 = $$pre; + $31 = $$pre; + L8 : while (1) { + if ($31) { + $33 = HEAP32[$31 + 12 >> 2] | 0; + if (($33 | 0) == (HEAP32[$31 + 16 >> 2] | 0)) $$0$i$i$i$i25 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$31 >> 2] | 0) + 36 >> 2] & 127]($31) | 0; else $$0$i$i$i$i25 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$33 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i25, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $128 = 0; + $154 = 1; + $80 = 0; + } else { + $128 = $153; + $154 = 0; + $80 = $31; + } + } else { + $128 = 0; + $154 = 1; + $80 = 0; + } + $45 = HEAP32[$2 >> 2] | 0; + do if ($45) { + $48 = HEAP32[$45 + 12 >> 2] | 0; + if (($48 | 0) == (HEAP32[$45 + 16 >> 2] | 0)) $$0$i$i2$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$45 >> 2] | 0) + 36 >> 2] & 127]($45) | 0; else $$0$i$i2$i$i31 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$48 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i31, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($154) { + $155 = $45; + break; + } else { + $$2 = $$0; + $137 = $45; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($154) { + $$2 = $$0; + $137 = 0; + break; + } else $155 = 0; + } + $61 = HEAP8[$18 >> 0] | 0; + $65 = $61 << 24 >> 24 < 0 ? HEAP32[$29 >> 2] | 0 : $61 & 255; + if ((HEAP32[$10 >> 2] | 0) == ($$0 + $65 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $65 << 1, 0); + if ((HEAP8[$18 >> 0] | 0) < 0) $73 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $73 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $73, 0); + $77 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $77 + $65; + $$1 = $77; + } else $$1 = $$0; + $79 = $80 + 12 | 0; + $81 = HEAP32[$79 >> 2] | 0; + $82 = $80 + 16 | 0; + if (($81 | 0) == (HEAP32[$82 >> 2] | 0)) $$0$i$i41 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i41 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$81 >> 0] | 0) | 0; + if (__ZNSt3__29__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKc($$0$i$i41 & 255, $14, $$1, $10, $13, HEAP8[$6 >> 0] | 0, $8, $11, $12, $15) | 0) { + $$2 = $$1; + $137 = $155; + break; + } + $95 = HEAP32[$79 >> 2] | 0; + if (($95 | 0) == (HEAP32[$82 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 40 >> 2] & 127]($80) | 0; else { + HEAP32[$79 >> 2] = $95 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$95 >> 0] | 0) | 0; + } + $$0 = $$1; + $153 = $128; + $31 = $80; + } + $104 = HEAP8[$8 + 11 >> 0] | 0; + if (($104 << 24 >> 24 < 0 ? HEAP32[$8 + 4 >> 2] | 0 : $104 & 255) | 0 ? ($111 = HEAP32[$12 >> 2] | 0, ($111 - $11 | 0) < 160) : 0) { + $116 = HEAP32[$13 >> 2] | 0; + HEAP32[$12 >> 2] = $111 + 4; + HEAP32[$111 >> 2] = $116; + } + $119 = __ZNSt3__227__num_get_unsigned_integralItEET_PKcS3_Rji($$2, HEAP32[$10 >> 2] | 0, $4, $14) | 0; + HEAP16[$5 >> 1] = $119; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($8, $11, HEAP32[$12 >> 2] | 0, $4); + if ($80) { + $123 = HEAP32[$80 + 12 >> 2] | 0; + if (($123 | 0) == (HEAP32[$80 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$128 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$123 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $156 = 1; + } else $156 = 0; + } else $156 = 1; + do if ($137) { + $139 = HEAP32[$137 + 12 >> 2] | 0; + if (($139 | 0) == (HEAP32[$137 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$137 >> 2] | 0) + 36 >> 2] & 127]($137) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$139 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($156) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $156 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($8); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedImEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i25 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i31 = 0, $$0$i$i41 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $104 = 0, $11 = 0, $111 = 0, $116 = 0, $119 = 0, $12 = 0, $123 = 0, $128 = 0, $13 = 0, $137 = 0, $139 = 0, $14 = 0, $15 = 0, $153 = 0, $154 = 0, $155 = 0, $156 = 0, $18 = 0, $21 = 0, $24 = 0, $28 = 0, $29 = 0, $31 = 0, $33 = 0, $45 = 0, $48 = 0, $6 = 0, $61 = 0, $65 = 0, $73 = 0, $77 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $9 = 0, $95 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 240 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(240); + $6 = sp + 224 | 0; + $8 = sp + 212 | 0; + $9 = sp + 200 | 0; + $10 = sp + 196 | 0; + $11 = sp; + $12 = sp + 192 | 0; + $13 = sp + 188 | 0; + $14 = __ZNSt3__214__num_get_base10__get_baseERNS_8ios_baseE($3) | 0; + $15 = __ZNKSt3__29__num_getIcE10__do_widenERNS_8ios_baseEPc($0, $3, sp + 160 | 0) | 0; + __ZNSt3__29__num_getIcE17__stage2_int_prepERNS_8ios_baseERc($8, $3, $6); + HEAP32[$9 >> 2] = 0; + HEAP32[$9 + 4 >> 2] = 0; + HEAP32[$9 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$9 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $18 = $9 + 11 | 0; + $21 = $9 + 8 | 0; + if ((HEAP8[$18 >> 0] | 0) < 0) $24 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $24 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $24, 0); + $28 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $28; + HEAP32[$12 >> 2] = $11; + HEAP32[$13 >> 2] = 0; + $29 = $9 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $28; + $153 = $$pre; + $31 = $$pre; + L8 : while (1) { + if ($31) { + $33 = HEAP32[$31 + 12 >> 2] | 0; + if (($33 | 0) == (HEAP32[$31 + 16 >> 2] | 0)) $$0$i$i$i$i25 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$31 >> 2] | 0) + 36 >> 2] & 127]($31) | 0; else $$0$i$i$i$i25 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$33 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i25, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $128 = 0; + $154 = 1; + $80 = 0; + } else { + $128 = $153; + $154 = 0; + $80 = $31; + } + } else { + $128 = 0; + $154 = 1; + $80 = 0; + } + $45 = HEAP32[$2 >> 2] | 0; + do if ($45) { + $48 = HEAP32[$45 + 12 >> 2] | 0; + if (($48 | 0) == (HEAP32[$45 + 16 >> 2] | 0)) $$0$i$i2$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$45 >> 2] | 0) + 36 >> 2] & 127]($45) | 0; else $$0$i$i2$i$i31 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$48 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i31, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($154) { + $155 = $45; + break; + } else { + $$2 = $$0; + $137 = $45; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($154) { + $$2 = $$0; + $137 = 0; + break; + } else $155 = 0; + } + $61 = HEAP8[$18 >> 0] | 0; + $65 = $61 << 24 >> 24 < 0 ? HEAP32[$29 >> 2] | 0 : $61 & 255; + if ((HEAP32[$10 >> 2] | 0) == ($$0 + $65 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $65 << 1, 0); + if ((HEAP8[$18 >> 0] | 0) < 0) $73 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $73 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $73, 0); + $77 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $77 + $65; + $$1 = $77; + } else $$1 = $$0; + $79 = $80 + 12 | 0; + $81 = HEAP32[$79 >> 2] | 0; + $82 = $80 + 16 | 0; + if (($81 | 0) == (HEAP32[$82 >> 2] | 0)) $$0$i$i41 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i41 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$81 >> 0] | 0) | 0; + if (__ZNSt3__29__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKc($$0$i$i41 & 255, $14, $$1, $10, $13, HEAP8[$6 >> 0] | 0, $8, $11, $12, $15) | 0) { + $$2 = $$1; + $137 = $155; + break; + } + $95 = HEAP32[$79 >> 2] | 0; + if (($95 | 0) == (HEAP32[$82 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 40 >> 2] & 127]($80) | 0; else { + HEAP32[$79 >> 2] = $95 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$95 >> 0] | 0) | 0; + } + $$0 = $$1; + $153 = $128; + $31 = $80; + } + $104 = HEAP8[$8 + 11 >> 0] | 0; + if (($104 << 24 >> 24 < 0 ? HEAP32[$8 + 4 >> 2] | 0 : $104 & 255) | 0 ? ($111 = HEAP32[$12 >> 2] | 0, ($111 - $11 | 0) < 160) : 0) { + $116 = HEAP32[$13 >> 2] | 0; + HEAP32[$12 >> 2] = $111 + 4; + HEAP32[$111 >> 2] = $116; + } + $119 = __ZNSt3__227__num_get_unsigned_integralImEET_PKcS3_Rji($$2, HEAP32[$10 >> 2] | 0, $4, $14) | 0; + HEAP32[$5 >> 2] = $119; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($8, $11, HEAP32[$12 >> 2] | 0, $4); + if ($80) { + $123 = HEAP32[$80 + 12 >> 2] | 0; + if (($123 | 0) == (HEAP32[$80 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$128 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$123 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $156 = 1; + } else $156 = 0; + } else $156 = 1; + do if ($137) { + $139 = HEAP32[$137 + 12 >> 2] | 0; + if (($139 | 0) == (HEAP32[$137 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$137 >> 2] | 0) + 36 >> 2] & 127]($137) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$139 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($156) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $156 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($8); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedIjEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i25 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i31 = 0, $$0$i$i41 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $104 = 0, $11 = 0, $111 = 0, $116 = 0, $119 = 0, $12 = 0, $123 = 0, $128 = 0, $13 = 0, $137 = 0, $139 = 0, $14 = 0, $15 = 0, $153 = 0, $154 = 0, $155 = 0, $156 = 0, $18 = 0, $21 = 0, $24 = 0, $28 = 0, $29 = 0, $31 = 0, $33 = 0, $45 = 0, $48 = 0, $6 = 0, $61 = 0, $65 = 0, $73 = 0, $77 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $9 = 0, $95 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 240 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(240); + $6 = sp + 224 | 0; + $8 = sp + 212 | 0; + $9 = sp + 200 | 0; + $10 = sp + 196 | 0; + $11 = sp; + $12 = sp + 192 | 0; + $13 = sp + 188 | 0; + $14 = __ZNSt3__214__num_get_base10__get_baseERNS_8ios_baseE($3) | 0; + $15 = __ZNKSt3__29__num_getIcE10__do_widenERNS_8ios_baseEPc($0, $3, sp + 160 | 0) | 0; + __ZNSt3__29__num_getIcE17__stage2_int_prepERNS_8ios_baseERc($8, $3, $6); + HEAP32[$9 >> 2] = 0; + HEAP32[$9 + 4 >> 2] = 0; + HEAP32[$9 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$9 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $18 = $9 + 11 | 0; + $21 = $9 + 8 | 0; + if ((HEAP8[$18 >> 0] | 0) < 0) $24 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $24 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $24, 0); + $28 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $28; + HEAP32[$12 >> 2] = $11; + HEAP32[$13 >> 2] = 0; + $29 = $9 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $28; + $153 = $$pre; + $31 = $$pre; + L8 : while (1) { + if ($31) { + $33 = HEAP32[$31 + 12 >> 2] | 0; + if (($33 | 0) == (HEAP32[$31 + 16 >> 2] | 0)) $$0$i$i$i$i25 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$31 >> 2] | 0) + 36 >> 2] & 127]($31) | 0; else $$0$i$i$i$i25 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$33 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i25, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $128 = 0; + $154 = 1; + $80 = 0; + } else { + $128 = $153; + $154 = 0; + $80 = $31; + } + } else { + $128 = 0; + $154 = 1; + $80 = 0; + } + $45 = HEAP32[$2 >> 2] | 0; + do if ($45) { + $48 = HEAP32[$45 + 12 >> 2] | 0; + if (($48 | 0) == (HEAP32[$45 + 16 >> 2] | 0)) $$0$i$i2$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$45 >> 2] | 0) + 36 >> 2] & 127]($45) | 0; else $$0$i$i2$i$i31 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$48 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i31, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($154) { + $155 = $45; + break; + } else { + $$2 = $$0; + $137 = $45; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($154) { + $$2 = $$0; + $137 = 0; + break; + } else $155 = 0; + } + $61 = HEAP8[$18 >> 0] | 0; + $65 = $61 << 24 >> 24 < 0 ? HEAP32[$29 >> 2] | 0 : $61 & 255; + if ((HEAP32[$10 >> 2] | 0) == ($$0 + $65 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $65 << 1, 0); + if ((HEAP8[$18 >> 0] | 0) < 0) $73 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $73 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $73, 0); + $77 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $77 + $65; + $$1 = $77; + } else $$1 = $$0; + $79 = $80 + 12 | 0; + $81 = HEAP32[$79 >> 2] | 0; + $82 = $80 + 16 | 0; + if (($81 | 0) == (HEAP32[$82 >> 2] | 0)) $$0$i$i41 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i41 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$81 >> 0] | 0) | 0; + if (__ZNSt3__29__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKc($$0$i$i41 & 255, $14, $$1, $10, $13, HEAP8[$6 >> 0] | 0, $8, $11, $12, $15) | 0) { + $$2 = $$1; + $137 = $155; + break; + } + $95 = HEAP32[$79 >> 2] | 0; + if (($95 | 0) == (HEAP32[$82 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 40 >> 2] & 127]($80) | 0; else { + HEAP32[$79 >> 2] = $95 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$95 >> 0] | 0) | 0; + } + $$0 = $$1; + $153 = $128; + $31 = $80; + } + $104 = HEAP8[$8 + 11 >> 0] | 0; + if (($104 << 24 >> 24 < 0 ? HEAP32[$8 + 4 >> 2] | 0 : $104 & 255) | 0 ? ($111 = HEAP32[$12 >> 2] | 0, ($111 - $11 | 0) < 160) : 0) { + $116 = HEAP32[$13 >> 2] | 0; + HEAP32[$12 >> 2] = $111 + 4; + HEAP32[$111 >> 2] = $116; + } + $119 = __ZNSt3__227__num_get_unsigned_integralIjEET_PKcS3_Rji($$2, HEAP32[$10 >> 2] | 0, $4, $14) | 0; + HEAP32[$5 >> 2] = $119; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($8, $11, HEAP32[$12 >> 2] | 0, $4); + if ($80) { + $123 = HEAP32[$80 + 12 >> 2] | 0; + if (($123 | 0) == (HEAP32[$80 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$128 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$123 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $156 = 1; + } else $156 = 0; + } else $156 = 1; + do if ($137) { + $139 = HEAP32[$137 + 12 >> 2] | 0; + if (($139 | 0) == (HEAP32[$137 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$137 >> 2] | 0) + 36 >> 2] & 127]($137) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$139 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($156) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $156 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($8); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__do_get_signedIlEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i25 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i31 = 0, $$0$i$i41 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $103 = 0, $11 = 0, $110 = 0, $115 = 0, $118 = 0, $12 = 0, $122 = 0, $127 = 0, $13 = 0, $136 = 0, $138 = 0, $14 = 0, $15 = 0, $152 = 0, $153 = 0, $154 = 0, $155 = 0, $18 = 0, $21 = 0, $24 = 0, $28 = 0, $29 = 0, $31 = 0, $33 = 0, $45 = 0, $48 = 0, $6 = 0, $61 = 0, $65 = 0, $73 = 0, $77 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $9 = 0, $94 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 304 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(304); + $6 = sp + 300 | 0; + $8 = sp + 288 | 0; + $9 = sp + 276 | 0; + $10 = sp + 272 | 0; + $11 = sp; + $12 = sp + 268 | 0; + $13 = sp + 264 | 0; + $14 = __ZNSt3__214__num_get_base10__get_baseERNS_8ios_baseE($3) | 0; + $15 = __ZNKSt3__29__num_getIwE10__do_widenERNS_8ios_baseEPw($0, $3, sp + 160 | 0) | 0; + __ZNSt3__29__num_getIwE17__stage2_int_prepERNS_8ios_baseERw($8, $3, $6); + HEAP32[$9 >> 2] = 0; + HEAP32[$9 + 4 >> 2] = 0; + HEAP32[$9 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$9 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $18 = $9 + 11 | 0; + $21 = $9 + 8 | 0; + if ((HEAP8[$18 >> 0] | 0) < 0) $24 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $24 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $24, 0); + $28 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $28; + HEAP32[$12 >> 2] = $11; + HEAP32[$13 >> 2] = 0; + $29 = $9 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $28; + $152 = $$pre; + $31 = $$pre; + L8 : while (1) { + if ($31) { + $33 = HEAP32[$31 + 12 >> 2] | 0; + if (($33 | 0) == (HEAP32[$31 + 16 >> 2] | 0)) $$0$i$i$i$i25 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$31 >> 2] | 0) + 36 >> 2] & 127]($31) | 0; else $$0$i$i$i$i25 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$33 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i25, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $127 = 0; + $153 = 1; + $80 = 0; + } else { + $127 = $152; + $153 = 0; + $80 = $31; + } + } else { + $127 = 0; + $153 = 1; + $80 = 0; + } + $45 = HEAP32[$2 >> 2] | 0; + do if ($45) { + $48 = HEAP32[$45 + 12 >> 2] | 0; + if (($48 | 0) == (HEAP32[$45 + 16 >> 2] | 0)) $$0$i$i2$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$45 >> 2] | 0) + 36 >> 2] & 127]($45) | 0; else $$0$i$i2$i$i31 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$48 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i31, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($153) { + $154 = $45; + break; + } else { + $$2 = $$0; + $136 = $45; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($153) { + $$2 = $$0; + $136 = 0; + break; + } else $154 = 0; + } + $61 = HEAP8[$18 >> 0] | 0; + $65 = $61 << 24 >> 24 < 0 ? HEAP32[$29 >> 2] | 0 : $61 & 255; + if ((HEAP32[$10 >> 2] | 0) == ($$0 + $65 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $65 << 1, 0); + if ((HEAP8[$18 >> 0] | 0) < 0) $73 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $73 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $73, 0); + $77 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $77 + $65; + $$1 = $77; + } else $$1 = $$0; + $79 = $80 + 12 | 0; + $81 = HEAP32[$79 >> 2] | 0; + $82 = $80 + 16 | 0; + if (($81 | 0) == (HEAP32[$82 >> 2] | 0)) $$0$i$i41 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i41 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$81 >> 2] | 0) | 0; + if (__ZNSt3__29__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKw($$0$i$i41, $14, $$1, $10, $13, HEAP32[$6 >> 2] | 0, $8, $11, $12, $15) | 0) { + $$2 = $$1; + $136 = $154; + break; + } + $94 = HEAP32[$79 >> 2] | 0; + if (($94 | 0) == (HEAP32[$82 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 40 >> 2] & 127]($80) | 0; else { + HEAP32[$79 >> 2] = $94 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$94 >> 2] | 0) | 0; + } + $$0 = $$1; + $152 = $127; + $31 = $80; + } + $103 = HEAP8[$8 + 11 >> 0] | 0; + if (($103 << 24 >> 24 < 0 ? HEAP32[$8 + 4 >> 2] | 0 : $103 & 255) | 0 ? ($110 = HEAP32[$12 >> 2] | 0, ($110 - $11 | 0) < 160) : 0) { + $115 = HEAP32[$13 >> 2] | 0; + HEAP32[$12 >> 2] = $110 + 4; + HEAP32[$110 >> 2] = $115; + } + $118 = __ZNSt3__225__num_get_signed_integralIlEET_PKcS3_Rji($$2, HEAP32[$10 >> 2] | 0, $4, $14) | 0; + HEAP32[$5 >> 2] = $118; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($8, $11, HEAP32[$12 >> 2] | 0, $4); + if ($80) { + $122 = HEAP32[$80 + 12 >> 2] | 0; + if (($122 | 0) == (HEAP32[$80 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$127 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$122 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $155 = 1; + } else $155 = 0; + } else $155 = 1; + do if ($136) { + $138 = HEAP32[$136 + 12 >> 2] | 0; + if (($138 | 0) == (HEAP32[$136 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$136 >> 2] | 0) + 36 >> 2] & 127]($136) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$138 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($155) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $155 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($8); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__do_get_signedIlEES4_S4_S4_RNS_8ios_baseERjRT_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i25 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i31 = 0, $$0$i$i41 = 0, $$1 = 0, $$2 = 0, $$pre = 0, $$sroa$0$0$copyload = 0, $10 = 0, $104 = 0, $11 = 0, $111 = 0, $116 = 0, $119 = 0, $12 = 0, $123 = 0, $128 = 0, $13 = 0, $137 = 0, $139 = 0, $14 = 0, $15 = 0, $153 = 0, $154 = 0, $155 = 0, $156 = 0, $18 = 0, $21 = 0, $24 = 0, $28 = 0, $29 = 0, $31 = 0, $33 = 0, $45 = 0, $48 = 0, $6 = 0, $61 = 0, $65 = 0, $73 = 0, $77 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $9 = 0, $95 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 240 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(240); + $6 = sp + 224 | 0; + $8 = sp + 212 | 0; + $9 = sp + 200 | 0; + $10 = sp + 196 | 0; + $11 = sp; + $12 = sp + 192 | 0; + $13 = sp + 188 | 0; + $14 = __ZNSt3__214__num_get_base10__get_baseERNS_8ios_baseE($3) | 0; + $15 = __ZNKSt3__29__num_getIcE10__do_widenERNS_8ios_baseEPc($0, $3, sp + 160 | 0) | 0; + __ZNSt3__29__num_getIcE17__stage2_int_prepERNS_8ios_baseERc($8, $3, $6); + HEAP32[$9 >> 2] = 0; + HEAP32[$9 + 4 >> 2] = 0; + HEAP32[$9 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$9 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $18 = $9 + 11 | 0; + $21 = $9 + 8 | 0; + if ((HEAP8[$18 >> 0] | 0) < 0) $24 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $24 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $24, 0); + $28 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $28; + HEAP32[$12 >> 2] = $11; + HEAP32[$13 >> 2] = 0; + $29 = $9 + 4 | 0; + $$pre = HEAP32[$1 >> 2] | 0; + $$0 = $28; + $153 = $$pre; + $31 = $$pre; + L8 : while (1) { + if ($31) { + $33 = HEAP32[$31 + 12 >> 2] | 0; + if (($33 | 0) == (HEAP32[$31 + 16 >> 2] | 0)) $$0$i$i$i$i25 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$31 >> 2] | 0) + 36 >> 2] & 127]($31) | 0; else $$0$i$i$i$i25 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$33 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i25, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $128 = 0; + $154 = 1; + $80 = 0; + } else { + $128 = $153; + $154 = 0; + $80 = $31; + } + } else { + $128 = 0; + $154 = 1; + $80 = 0; + } + $45 = HEAP32[$2 >> 2] | 0; + do if ($45) { + $48 = HEAP32[$45 + 12 >> 2] | 0; + if (($48 | 0) == (HEAP32[$45 + 16 >> 2] | 0)) $$0$i$i2$i$i31 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$45 >> 2] | 0) + 36 >> 2] & 127]($45) | 0; else $$0$i$i2$i$i31 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$48 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i31, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($154) { + $155 = $45; + break; + } else { + $$2 = $$0; + $137 = $45; + break L8; + } else { + HEAP32[$2 >> 2] = 0; + label = 19; + break; + } + } else label = 19; while (0); + if ((label | 0) == 19) { + label = 0; + if ($154) { + $$2 = $$0; + $137 = 0; + break; + } else $155 = 0; + } + $61 = HEAP8[$18 >> 0] | 0; + $65 = $61 << 24 >> 24 < 0 ? HEAP32[$29 >> 2] | 0 : $61 & 255; + if ((HEAP32[$10 >> 2] | 0) == ($$0 + $65 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $65 << 1, 0); + if ((HEAP8[$18 >> 0] | 0) < 0) $73 = (HEAP32[$21 >> 2] & 2147483647) + -1 | 0; else $73 = 10; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($9, $73, 0); + $77 = (HEAP8[$18 >> 0] | 0) < 0 ? HEAP32[$9 >> 2] | 0 : $9; + HEAP32[$10 >> 2] = $77 + $65; + $$1 = $77; + } else $$1 = $$0; + $79 = $80 + 12 | 0; + $81 = HEAP32[$79 >> 2] | 0; + $82 = $80 + 16 | 0; + if (($81 | 0) == (HEAP32[$82 >> 2] | 0)) $$0$i$i41 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i41 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$81 >> 0] | 0) | 0; + if (__ZNSt3__29__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKc($$0$i$i41 & 255, $14, $$1, $10, $13, HEAP8[$6 >> 0] | 0, $8, $11, $12, $15) | 0) { + $$2 = $$1; + $137 = $155; + break; + } + $95 = HEAP32[$79 >> 2] | 0; + if (($95 | 0) == (HEAP32[$82 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$80 >> 2] | 0) + 40 >> 2] & 127]($80) | 0; else { + HEAP32[$79 >> 2] = $95 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$95 >> 0] | 0) | 0; + } + $$0 = $$1; + $153 = $128; + $31 = $80; + } + $104 = HEAP8[$8 + 11 >> 0] | 0; + if (($104 << 24 >> 24 < 0 ? HEAP32[$8 + 4 >> 2] | 0 : $104 & 255) | 0 ? ($111 = HEAP32[$12 >> 2] | 0, ($111 - $11 | 0) < 160) : 0) { + $116 = HEAP32[$13 >> 2] | 0; + HEAP32[$12 >> 2] = $111 + 4; + HEAP32[$111 >> 2] = $116; + } + $119 = __ZNSt3__225__num_get_signed_integralIlEET_PKcS3_Rji($$2, HEAP32[$10 >> 2] | 0, $4, $14) | 0; + HEAP32[$5 >> 2] = $119; + __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($8, $11, HEAP32[$12 >> 2] | 0, $4); + if ($80) { + $123 = HEAP32[$80 + 12 >> 2] | 0; + if (($123 | 0) == (HEAP32[$80 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$128 >> 2] | 0) + 36 >> 2] & 127]($80) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$123 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $156 = 1; + } else $156 = 0; + } else $156 = 1; + do if ($137) { + $139 = HEAP32[$137 + 12 >> 2] | 0; + if (($139 | 0) == (HEAP32[$137 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$137 >> 2] | 0) + 36 >> 2] & 127]($137) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$139 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($156) break; else { + label = 50; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 48; + break; + } + } else label = 48; while (0); + if ((label | 0) == 48 ? $156 : 0) label = 50; + if ((label | 0) == 50) HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($9); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($8); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function _jpeg_idct_8x16($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0320328 = 0, $$0322327 = 0, $$0323326 = 0, $$0329 = 0, $$1321324 = 0, $$1325 = 0, $101 = 0, $103 = 0, $109 = 0, $114 = 0, $115 = 0, $118 = 0, $122 = 0, $128 = 0, $130 = 0, $131 = 0, $132 = 0, $134 = 0, $135 = 0, $136 = 0, $15 = 0, $188 = 0, $191 = 0, $193 = 0, $195 = 0, $197 = 0, $199 = 0, $201 = 0, $203 = 0, $205 = 0, $207 = 0, $209 = 0, $21 = 0, $210 = 0, $211 = 0, $212 = 0, $213 = 0, $215 = 0, $217 = 0, $219 = 0, $22 = 0, $221 = 0, $222 = 0, $223 = 0, $225 = 0, $228 = 0, $229 = 0, $23 = 0, $231 = 0, $235 = 0, $237 = 0, $239 = 0, $24 = 0, $243 = 0, $245 = 0, $25 = 0, $26 = 0, $27 = 0, $33 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $44 = 0, $46 = 0, $48 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $64 = 0, $7 = 0, $70 = 0, $76 = 0, $82 = 0, $83 = 0, $85 = 0, $86 = 0, $88 = 0, $90 = 0, $91 = 0, $93 = 0, $97 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 512 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(512); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0320328 = $5; + $$0322327 = HEAP32[$1 + 84 >> 2] | 0; + $$0323326 = $2; + $$0329 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0323326 >> 1] << 13, HEAP32[$$0322327 >> 2] | 0) | 0 | 1024; + $21 = Math_imul(HEAP32[$$0322327 + 128 >> 2] | 0, HEAP16[$$0323326 + 64 >> 1] | 0) | 0; + $22 = $21 * 10703 | 0; + $23 = $21 * 4433 | 0; + $24 = $22 + $15 | 0; + $25 = $15 - $22 | 0; + $26 = $23 + $15 | 0; + $27 = $15 - $23 | 0; + $33 = Math_imul(HEAP32[$$0322327 + 64 >> 2] | 0, HEAP16[$$0323326 + 32 >> 1] | 0) | 0; + $39 = Math_imul(HEAP32[$$0322327 + 192 >> 2] | 0, HEAP16[$$0323326 + 96 >> 1] | 0) | 0; + $40 = $33 - $39 | 0; + $41 = $40 * 2260 | 0; + $42 = $40 * 11363 | 0; + $44 = $42 + ($39 * 20995 | 0) | 0; + $46 = $41 + ($33 * 7373 | 0) | 0; + $48 = $42 + (Math_imul($33, -4926) | 0) | 0; + $50 = $41 + (Math_imul($39, -4176) | 0) | 0; + $51 = $44 + $24 | 0; + $52 = $24 - $44 | 0; + $53 = $46 + $26 | 0; + $54 = $26 - $46 | 0; + $55 = $48 + $27 | 0; + $56 = $27 - $48 | 0; + $57 = $50 + $25 | 0; + $58 = $25 - $50 | 0; + $64 = Math_imul(HEAP32[$$0322327 + 32 >> 2] | 0, HEAP16[$$0323326 + 16 >> 1] | 0) | 0; + $70 = Math_imul(HEAP32[$$0322327 + 96 >> 2] | 0, HEAP16[$$0323326 + 48 >> 1] | 0) | 0; + $76 = Math_imul(HEAP32[$$0322327 + 160 >> 2] | 0, HEAP16[$$0323326 + 80 >> 1] | 0) | 0; + $82 = Math_imul(HEAP32[$$0322327 + 224 >> 2] | 0, HEAP16[$$0323326 + 112 >> 1] | 0) | 0; + $83 = $76 + $64 | 0; + $85 = ($70 + $64 | 0) * 11086 | 0; + $86 = $83 * 10217 | 0; + $88 = ($82 + $64 | 0) * 8956 | 0; + $90 = ($64 - $82 | 0) * 7350 | 0; + $91 = $83 * 5461 | 0; + $93 = ($64 - $70 | 0) * 3363 | 0; + $97 = $85 + (Math_imul($64, -18730) | 0) + $86 + $88 | 0; + $101 = $93 + (Math_imul($64, -15038) | 0) + $91 + $90 | 0; + $103 = ($76 + $70 | 0) * 1136 | 0; + $109 = ($76 - $70 | 0) * 11529 | 0; + $114 = $82 + $70 | 0; + $115 = Math_imul($114, -5461) | 0; + $118 = $85 + ($70 * 589 | 0) + $103 + $115 | 0; + $122 = Math_imul($114, -10217) | 0; + $128 = $93 + ($70 * 16154 | 0) + $109 + $122 | 0; + $130 = Math_imul($82 + $76 | 0, -11086) | 0; + $131 = $103 + (Math_imul($76, -9222) | 0) + $86 + $130 | 0; + $132 = $115 + ($82 * 8728 | 0) + $88 + $130 | 0; + $134 = ($82 - $76 | 0) * 3363 | 0; + $135 = $122 + ($82 * 25733 | 0) + $90 + $134 | 0; + $136 = $109 + (Math_imul($76, -6278) | 0) + $91 + $134 | 0; + HEAP32[$$0320328 >> 2] = $97 + $51 >> 11; + HEAP32[$$0320328 + 480 >> 2] = $51 - $97 >> 11; + HEAP32[$$0320328 + 32 >> 2] = $118 + $53 >> 11; + HEAP32[$$0320328 + 448 >> 2] = $53 - $118 >> 11; + HEAP32[$$0320328 + 64 >> 2] = $131 + $55 >> 11; + HEAP32[$$0320328 + 416 >> 2] = $55 - $131 >> 11; + HEAP32[$$0320328 + 96 >> 2] = $132 + $57 >> 11; + HEAP32[$$0320328 + 384 >> 2] = $57 - $132 >> 11; + HEAP32[$$0320328 + 128 >> 2] = $135 + $58 >> 11; + HEAP32[$$0320328 + 352 >> 2] = $58 - $135 >> 11; + HEAP32[$$0320328 + 160 >> 2] = $136 + $56 >> 11; + HEAP32[$$0320328 + 320 >> 2] = $56 - $136 >> 11; + HEAP32[$$0320328 + 192 >> 2] = $128 + $54 >> 11; + HEAP32[$$0320328 + 288 >> 2] = $54 - $128 >> 11; + HEAP32[$$0320328 + 224 >> 2] = $101 + $52 >> 11; + HEAP32[$$0320328 + 256 >> 2] = $52 - $101 >> 11; + $$0329 = $$0329 + 1 | 0; + if (($$0329 | 0) == 8) break; else { + $$0320328 = $$0320328 + 4 | 0; + $$0322327 = $$0322327 + 4 | 0; + $$0323326 = $$0323326 + 2 | 0; + } + } + $188 = $7 + -384 | 0; + $$1321324 = $5; + $$1325 = 0; + while (1) { + $191 = (HEAP32[$3 + ($$1325 << 2) >> 2] | 0) + $4 | 0; + $193 = (HEAP32[$$1321324 >> 2] | 0) + 16400 | 0; + $195 = HEAP32[$$1321324 + 16 >> 2] | 0; + $197 = $193 + $195 << 13; + $199 = $193 - $195 << 13; + $201 = HEAP32[$$1321324 + 8 >> 2] | 0; + $203 = HEAP32[$$1321324 + 24 >> 2] | 0; + $205 = ($203 + $201 | 0) * 4433 | 0; + $207 = $205 + ($201 * 6270 | 0) | 0; + $209 = $205 + (Math_imul($203, -15137) | 0) | 0; + $210 = $207 + $197 | 0; + $211 = $197 - $207 | 0; + $212 = $209 + $199 | 0; + $213 = $199 - $209 | 0; + $215 = HEAP32[$$1321324 + 28 >> 2] | 0; + $217 = HEAP32[$$1321324 + 20 >> 2] | 0; + $219 = HEAP32[$$1321324 + 12 >> 2] | 0; + $221 = HEAP32[$$1321324 + 4 >> 2] | 0; + $222 = $219 + $215 | 0; + $223 = $221 + $217 | 0; + $225 = ($223 + $222 | 0) * 9633 | 0; + $228 = $225 + (Math_imul($222, -16069) | 0) | 0; + $229 = $225 + (Math_imul($223, -3196) | 0) | 0; + $231 = Math_imul($221 + $215 | 0, -7373) | 0; + $235 = $231 + ($215 * 2446 | 0) + $228 | 0; + $237 = $231 + ($221 * 12299 | 0) + $229 | 0; + $239 = Math_imul($219 + $217 | 0, -20995) | 0; + $243 = $239 + ($217 * 16819 | 0) + $229 | 0; + $245 = $239 + ($219 * 25172 | 0) + $228 | 0; + HEAP8[$191 >> 0] = HEAP8[$188 + (($237 + $210 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 7 >> 0] = HEAP8[$188 + (($210 - $237 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 1 >> 0] = HEAP8[$188 + (($245 + $212 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 6 >> 0] = HEAP8[$188 + (($212 - $245 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 2 >> 0] = HEAP8[$188 + (($243 + $213 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 5 >> 0] = HEAP8[$188 + (($213 - $243 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 3 >> 0] = HEAP8[$188 + (($235 + $211 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$191 + 4 >> 0] = HEAP8[$188 + (($211 - $235 | 0) >>> 18 & 1023) >> 0] | 0; + $$1325 = $$1325 + 1 | 0; + if (($$1325 | 0) == 16) break; else $$1321324 = $$1321324 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function _jpeg_idct_4x4($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $103 = 0, $109 = 0, $111 = 0, $113 = 0, $119 = 0, $125 = 0, $128 = 0, $13 = 0, $131 = 0, $134 = 0, $135 = 0, $148 = 0, $154 = 0, $156 = 0, $158 = 0, $164 = 0, $170 = 0, $173 = 0, $176 = 0, $179 = 0, $180 = 0, $183 = 0, $187 = 0, $189 = 0, $19 = 0, $191 = 0, $193 = 0, $195 = 0, $196 = 0, $198 = 0, $200 = 0, $202 = 0, $21 = 0, $228 = 0, $23 = 0, $230 = 0, $232 = 0, $234 = 0, $236 = 0, $238 = 0, $240 = 0, $242 = 0, $244 = 0, $271 = 0, $273 = 0, $275 = 0, $277 = 0, $279 = 0, $281 = 0, $283 = 0, $285 = 0, $287 = 0, $289 = 0, $29 = 0, $316 = 0, $318 = 0, $320 = 0, $322 = 0, $324 = 0, $326 = 0, $328 = 0, $330 = 0, $332 = 0, $334 = 0, $35 = 0, $38 = 0, $41 = 0, $44 = 0, $49 = 0, $5 = 0, $54 = 0, $58 = 0, $64 = 0, $66 = 0, $68 = 0, $7 = 0, $74 = 0, $80 = 0, $83 = 0, $86 = 0, $89 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $9 = HEAP32[$1 + 84 >> 2] | 0; + $13 = Math_imul(HEAP32[$9 >> 2] | 0, HEAP16[$2 >> 1] | 0) | 0; + $19 = Math_imul(HEAP32[$9 + 64 >> 2] | 0, HEAP16[$2 + 32 >> 1] | 0) | 0; + $21 = $19 + $13 << 2; + $23 = $13 - $19 << 2; + $29 = Math_imul(HEAP32[$9 + 32 >> 2] | 0, HEAP16[$2 + 16 >> 1] | 0) | 0; + $35 = Math_imul(HEAP32[$9 + 96 >> 2] | 0, HEAP16[$2 + 48 >> 1] | 0) | 0; + $38 = (($35 + $29 | 0) * 4433 | 0) + 1024 | 0; + $41 = $38 + ($29 * 6270 | 0) >> 11; + $44 = $38 + (Math_imul($35, -15137) | 0) >> 11; + HEAP32[$5 >> 2] = $41 + $21; + HEAP32[$5 + 48 >> 2] = $21 - $41; + $49 = $5 + 16 | 0; + HEAP32[$49 >> 2] = $44 + $23; + HEAP32[$5 + 32 >> 2] = $23 - $44; + $54 = $5 + 4 | 0; + $58 = Math_imul(HEAP32[$9 + 4 >> 2] | 0, HEAP16[$2 + 2 >> 1] | 0) | 0; + $64 = Math_imul(HEAP32[$9 + 68 >> 2] | 0, HEAP16[$2 + 34 >> 1] | 0) | 0; + $66 = $64 + $58 << 2; + $68 = $58 - $64 << 2; + $74 = Math_imul(HEAP32[$9 + 36 >> 2] | 0, HEAP16[$2 + 18 >> 1] | 0) | 0; + $80 = Math_imul(HEAP32[$9 + 100 >> 2] | 0, HEAP16[$2 + 50 >> 1] | 0) | 0; + $83 = (($80 + $74 | 0) * 4433 | 0) + 1024 | 0; + $86 = $83 + ($74 * 6270 | 0) >> 11; + $89 = $83 + (Math_imul($80, -15137) | 0) >> 11; + HEAP32[$54 >> 2] = $86 + $66; + HEAP32[$5 + 52 >> 2] = $66 - $86; + HEAP32[$5 + 20 >> 2] = $89 + $68; + HEAP32[$5 + 36 >> 2] = $68 - $89; + $103 = Math_imul(HEAP32[$9 + 8 >> 2] | 0, HEAP16[$2 + 4 >> 1] | 0) | 0; + $109 = Math_imul(HEAP32[$9 + 72 >> 2] | 0, HEAP16[$2 + 36 >> 1] | 0) | 0; + $111 = $109 + $103 << 2; + $113 = $103 - $109 << 2; + $119 = Math_imul(HEAP32[$9 + 40 >> 2] | 0, HEAP16[$2 + 20 >> 1] | 0) | 0; + $125 = Math_imul(HEAP32[$9 + 104 >> 2] | 0, HEAP16[$2 + 52 >> 1] | 0) | 0; + $128 = (($125 + $119 | 0) * 4433 | 0) + 1024 | 0; + $131 = $128 + ($119 * 6270 | 0) >> 11; + $134 = $128 + (Math_imul($125, -15137) | 0) >> 11; + $135 = $131 + $111 | 0; + HEAP32[$5 + 8 >> 2] = $135; + HEAP32[$5 + 56 >> 2] = $111 - $131; + HEAP32[$5 + 24 >> 2] = $134 + $113; + HEAP32[$5 + 40 >> 2] = $113 - $134; + $148 = Math_imul(HEAP32[$9 + 12 >> 2] | 0, HEAP16[$2 + 6 >> 1] | 0) | 0; + $154 = Math_imul(HEAP32[$9 + 76 >> 2] | 0, HEAP16[$2 + 38 >> 1] | 0) | 0; + $156 = $154 + $148 << 2; + $158 = $148 - $154 << 2; + $164 = Math_imul(HEAP32[$9 + 44 >> 2] | 0, HEAP16[$2 + 22 >> 1] | 0) | 0; + $170 = Math_imul(HEAP32[$9 + 108 >> 2] | 0, HEAP16[$2 + 54 >> 1] | 0) | 0; + $173 = (($170 + $164 | 0) * 4433 | 0) + 1024 | 0; + $176 = $173 + ($164 * 6270 | 0) >> 11; + $179 = $173 + (Math_imul($170, -15137) | 0) >> 11; + $180 = $176 + $156 | 0; + HEAP32[$5 + 12 >> 2] = $180; + HEAP32[$5 + 60 >> 2] = $156 - $176; + $183 = $179 + $158 | 0; + HEAP32[$5 + 28 >> 2] = $183; + HEAP32[$5 + 44 >> 2] = $158 - $179; + $187 = $7 + -384 | 0; + $189 = (HEAP32[$3 >> 2] | 0) + $4 | 0; + $191 = (HEAP32[$5 >> 2] | 0) + 16400 | 0; + $193 = $191 + $135 << 13; + $195 = $191 - $135 << 13; + $196 = HEAP32[$54 >> 2] | 0; + $198 = ($180 + $196 | 0) * 4433 | 0; + $200 = $198 + ($196 * 6270 | 0) | 0; + $202 = $198 + (Math_imul($180, -15137) | 0) | 0; + HEAP8[$189 >> 0] = HEAP8[$187 + (($200 + $193 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$189 + 3 >> 0] = HEAP8[$187 + (($193 - $200 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$189 + 1 >> 0] = HEAP8[$187 + (($202 + $195 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$189 + 2 >> 0] = HEAP8[$187 + (($195 - $202 | 0) >>> 18 & 1023) >> 0] | 0; + $228 = (HEAP32[$3 + 4 >> 2] | 0) + $4 | 0; + $230 = (HEAP32[$49 >> 2] | 0) + 16400 | 0; + $232 = HEAP32[$5 + 24 >> 2] | 0; + $234 = $230 + $232 << 13; + $236 = $230 - $232 << 13; + $238 = HEAP32[$5 + 20 >> 2] | 0; + $240 = ($183 + $238 | 0) * 4433 | 0; + $242 = $240 + ($238 * 6270 | 0) | 0; + $244 = $240 + (Math_imul($183, -15137) | 0) | 0; + HEAP8[$228 >> 0] = HEAP8[$187 + (($242 + $234 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$228 + 3 >> 0] = HEAP8[$187 + (($234 - $242 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$228 + 1 >> 0] = HEAP8[$187 + (($244 + $236 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$228 + 2 >> 0] = HEAP8[$187 + (($236 - $244 | 0) >>> 18 & 1023) >> 0] | 0; + $271 = (HEAP32[$3 + 8 >> 2] | 0) + $4 | 0; + $273 = (HEAP32[$5 + 32 >> 2] | 0) + 16400 | 0; + $275 = HEAP32[$5 + 40 >> 2] | 0; + $277 = $273 + $275 << 13; + $279 = $273 - $275 << 13; + $281 = HEAP32[$5 + 36 >> 2] | 0; + $283 = HEAP32[$5 + 44 >> 2] | 0; + $285 = ($283 + $281 | 0) * 4433 | 0; + $287 = $285 + ($281 * 6270 | 0) | 0; + $289 = $285 + (Math_imul($283, -15137) | 0) | 0; + HEAP8[$271 >> 0] = HEAP8[$187 + (($287 + $277 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$271 + 3 >> 0] = HEAP8[$187 + (($277 - $287 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$271 + 1 >> 0] = HEAP8[$187 + (($289 + $279 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$271 + 2 >> 0] = HEAP8[$187 + (($279 - $289 | 0) >>> 18 & 1023) >> 0] | 0; + $316 = (HEAP32[$3 + 12 >> 2] | 0) + $4 | 0; + $318 = (HEAP32[$5 + 48 >> 2] | 0) + 16400 | 0; + $320 = HEAP32[$5 + 56 >> 2] | 0; + $322 = $318 + $320 << 13; + $324 = $318 - $320 << 13; + $326 = HEAP32[$5 + 52 >> 2] | 0; + $328 = HEAP32[$5 + 60 >> 2] | 0; + $330 = ($328 + $326 | 0) * 4433 | 0; + $332 = $330 + ($326 * 6270 | 0) | 0; + $334 = $330 + (Math_imul($328, -15137) | 0) | 0; + HEAP8[$316 >> 0] = HEAP8[$187 + (($332 + $322 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$316 + 3 >> 0] = HEAP8[$187 + (($322 - $332 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$316 + 1 >> 0] = HEAP8[$187 + (($334 + $324 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$316 + 2 >> 0] = HEAP8[$187 + (($324 - $334 | 0) >>> 18 & 1023) >> 0] | 0; + STACKTOP = sp; + return; +} + +function _jpeg_idct_11x11($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0286294 = 0, $$0288293 = 0, $$0289292 = 0, $$0295 = 0, $$1287290 = 0, $$1291 = 0, $101 = 0, $105 = 0, $107 = 0, $110 = 0, $113 = 0, $119 = 0, $15 = 0, $155 = 0, $158 = 0, $161 = 0, $163 = 0, $165 = 0, $167 = 0, $171 = 0, $172 = 0, $174 = 0, $176 = 0, $178 = 0, $180 = 0, $182 = 0, $185 = 0, $186 = 0, $188 = 0, $192 = 0, $194 = 0, $196 = 0, $198 = 0, $200 = 0, $202 = 0, $203 = 0, $206 = 0, $207 = 0, $209 = 0, $21 = 0, $212 = 0, $216 = 0, $219 = 0, $223 = 0, $225 = 0, $228 = 0, $231 = 0, $237 = 0, $27 = 0, $33 = 0, $37 = 0, $38 = 0, $40 = 0, $42 = 0, $44 = 0, $46 = 0, $48 = 0, $5 = 0, $51 = 0, $52 = 0, $54 = 0, $58 = 0, $60 = 0, $66 = 0, $7 = 0, $72 = 0, $78 = 0, $84 = 0, $85 = 0, $88 = 0, $89 = 0, $91 = 0, $94 = 0, $98 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 352 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(352); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0286294 = $5; + $$0288293 = HEAP32[$1 + 84 >> 2] | 0; + $$0289292 = $2; + $$0295 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0289292 >> 1] << 13, HEAP32[$$0288293 >> 2] | 0) | 0 | 1024; + $21 = Math_imul(HEAP32[$$0288293 + 64 >> 2] | 0, HEAP16[$$0289292 + 32 >> 1] | 0) | 0; + $27 = Math_imul(HEAP32[$$0288293 + 128 >> 2] | 0, HEAP16[$$0289292 + 64 >> 1] | 0) | 0; + $33 = Math_imul(HEAP32[$$0288293 + 192 >> 2] | 0, HEAP16[$$0289292 + 96 >> 1] | 0) | 0; + $37 = ($27 - $21 | 0) * 3529 | 0; + $38 = $33 + $21 | 0; + $40 = $38 - $27 | 0; + $42 = ($40 * 11116 | 0) + $15 | 0; + $44 = $42 + (($27 - $33 | 0) * 20862 | 0) | 0; + $46 = $44 + (Math_imul($27, -14924) | 0) + $37 | 0; + $48 = $44 + ($33 * 17333 | 0) | 0; + $51 = $42 + $37 + (Math_imul($21, -12399) | 0) | 0; + $52 = $42 + (Math_imul($38, -9467) | 0) | 0; + $54 = $52 + (Math_imul($33, -6461) | 0) | 0; + $58 = ($27 * 15929 | 0) + (Math_imul($21, -11395) | 0) + $52 | 0; + $60 = (Math_imul($40, -11585) | 0) + $15 | 0; + $66 = Math_imul(HEAP32[$$0288293 + 32 >> 2] | 0, HEAP16[$$0289292 + 16 >> 1] | 0) | 0; + $72 = Math_imul(HEAP32[$$0288293 + 96 >> 2] | 0, HEAP16[$$0289292 + 48 >> 1] | 0) | 0; + $78 = Math_imul(HEAP32[$$0288293 + 160 >> 2] | 0, HEAP16[$$0289292 + 80 >> 1] | 0) | 0; + $84 = Math_imul(HEAP32[$$0288293 + 224 >> 2] | 0, HEAP16[$$0289292 + 112 >> 1] | 0) | 0; + $85 = $72 + $66 | 0; + $88 = ($78 + $85 + $84 | 0) * 3264 | 0; + $89 = $85 * 7274 | 0; + $91 = ($78 + $66 | 0) * 5492 | 0; + $94 = $88 + (($84 + $66 | 0) * 3e3 | 0) | 0; + $98 = $89 + (Math_imul($66, -7562) | 0) + $91 + $94 | 0; + $101 = $88 + (Math_imul($78 + $72 | 0, -9527) | 0) | 0; + $105 = $91 + (Math_imul($78, -9766) | 0) + $101 | 0; + $107 = Math_imul($84 + $72 | 0, -14731) | 0; + $110 = $89 + ($72 * 16984 | 0) + $107 + $101 | 0; + $113 = $107 + ($84 * 17223 | 0) + $94 | 0; + $119 = ($78 * 8203 | 0) + (Math_imul($72, -12019) | 0) + (Math_imul($84, -13802) | 0) + $88 | 0; + HEAP32[$$0286294 >> 2] = $98 + $48 >> 11; + HEAP32[$$0286294 + 320 >> 2] = $48 - $98 >> 11; + HEAP32[$$0286294 + 32 >> 2] = $110 + $46 >> 11; + HEAP32[$$0286294 + 288 >> 2] = $46 - $110 >> 11; + HEAP32[$$0286294 + 64 >> 2] = $105 + $54 >> 11; + HEAP32[$$0286294 + 256 >> 2] = $54 - $105 >> 11; + HEAP32[$$0286294 + 96 >> 2] = $113 + $51 >> 11; + HEAP32[$$0286294 + 224 >> 2] = $51 - $113 >> 11; + HEAP32[$$0286294 + 128 >> 2] = $119 + $58 >> 11; + HEAP32[$$0286294 + 192 >> 2] = $58 - $119 >> 11; + HEAP32[$$0286294 + 160 >> 2] = $60 >> 11; + $$0295 = $$0295 + 1 | 0; + if (($$0295 | 0) == 8) break; else { + $$0286294 = $$0286294 + 4 | 0; + $$0288293 = $$0288293 + 4 | 0; + $$0289292 = $$0289292 + 2 | 0; + } + } + $155 = $7 + -384 | 0; + $$1287290 = $5; + $$1291 = 0; + while (1) { + $158 = (HEAP32[$3 + ($$1291 << 2) >> 2] | 0) + $4 | 0; + $161 = (HEAP32[$$1287290 >> 2] << 13) + 134348800 | 0; + $163 = HEAP32[$$1287290 + 8 >> 2] | 0; + $165 = HEAP32[$$1287290 + 16 >> 2] | 0; + $167 = HEAP32[$$1287290 + 24 >> 2] | 0; + $171 = ($165 - $163 | 0) * 3529 | 0; + $172 = $167 + $163 | 0; + $174 = $172 - $165 | 0; + $176 = ($174 * 11116 | 0) + $161 | 0; + $178 = $176 + (($165 - $167 | 0) * 20862 | 0) | 0; + $180 = $178 + (Math_imul($165, -14924) | 0) + $171 | 0; + $182 = $178 + ($167 * 17333 | 0) | 0; + $185 = $176 + $171 + (Math_imul($163, -12399) | 0) | 0; + $186 = $176 + (Math_imul($172, -9467) | 0) | 0; + $188 = $186 + (Math_imul($167, -6461) | 0) | 0; + $192 = ($165 * 15929 | 0) + (Math_imul($163, -11395) | 0) + $186 | 0; + $194 = (Math_imul($174, -11585) | 0) + $161 | 0; + $196 = HEAP32[$$1287290 + 4 >> 2] | 0; + $198 = HEAP32[$$1287290 + 12 >> 2] | 0; + $200 = HEAP32[$$1287290 + 20 >> 2] | 0; + $202 = HEAP32[$$1287290 + 28 >> 2] | 0; + $203 = $198 + $196 | 0; + $206 = ($203 + $200 + $202 | 0) * 3264 | 0; + $207 = $203 * 7274 | 0; + $209 = ($200 + $196 | 0) * 5492 | 0; + $212 = $206 + (($202 + $196 | 0) * 3e3 | 0) | 0; + $216 = $207 + (Math_imul($196, -7562) | 0) + $209 + $212 | 0; + $219 = $206 + (Math_imul($200 + $198 | 0, -9527) | 0) | 0; + $223 = $209 + (Math_imul($200, -9766) | 0) + $219 | 0; + $225 = Math_imul($202 + $198 | 0, -14731) | 0; + $228 = $207 + ($198 * 16984 | 0) + $225 + $219 | 0; + $231 = $225 + ($202 * 17223 | 0) + $212 | 0; + $237 = ($200 * 8203 | 0) + (Math_imul($198, -12019) | 0) + (Math_imul($202, -13802) | 0) + $206 | 0; + HEAP8[$158 >> 0] = HEAP8[$155 + (($216 + $182 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$158 + 10 >> 0] = HEAP8[$155 + (($182 - $216 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$158 + 1 >> 0] = HEAP8[$155 + (($228 + $180 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$158 + 9 >> 0] = HEAP8[$155 + (($180 - $228 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$158 + 2 >> 0] = HEAP8[$155 + (($223 + $188 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$158 + 8 >> 0] = HEAP8[$155 + (($188 - $223 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$158 + 3 >> 0] = HEAP8[$155 + (($231 + $185 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$158 + 7 >> 0] = HEAP8[$155 + (($185 - $231 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$158 + 4 >> 0] = HEAP8[$155 + (($237 + $192 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$158 + 6 >> 0] = HEAP8[$155 + (($192 - $237 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$158 + 5 >> 0] = HEAP8[$155 + ($194 >>> 18 & 1023) >> 0] | 0; + $$1291 = $$1291 + 1 | 0; + if (($$1291 | 0) == 11) break; else $$1287290 = $$1287290 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function __ZN6vision5Image5allocENS_9ImageTypeEmmim($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$sink = 0, $101 = 0, $105 = 0, $14 = 0, $19 = 0, $23 = 0, $30 = 0, $35 = 0, $39 = 0, $46 = 0, $51 = 0, $55 = 0, $6 = 0, $62 = 0, $67 = 0, $7 = 0, $71 = 0, $77 = 0, $78 = 0, $81 = 0, $82 = 0, $83 = 0, $85 = 0, $86 = 0, $87 = 0, $96 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp + 16 | 0; + $6 = sp + 8 | 0; + $7 = sp; + if (!$2) { + $14 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 38353) | 0, 38386) | 0, 39072) | 0, 127) | 0, 39079) | 0, 38458) | 0; + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $14 + (HEAP32[(HEAP32[$14 >> 2] | 0) + -12 >> 2] | 0) | 0); + $19 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66512) | 0; + $23 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$19 >> 2] | 0) + 28 >> 2] & 127]($19, 10) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($14, $23) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($14) | 0; + _abort(); + } + if (!$3) { + $30 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 38479) | 0, 38386) | 0, 39072) | 0, 128) | 0, 39079) | 0, 38513) | 0; + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $30 + (HEAP32[(HEAP32[$30 >> 2] | 0) + -12 >> 2] | 0) | 0); + $35 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66512) | 0; + $39 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$35 >> 2] | 0) + 28 >> 2] & 127]($35, 10) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($30, $39) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($30) | 0; + _abort(); + } + if ($4 >>> 0 < $2 >>> 0) { + $46 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 38535) | 0, 38386) | 0, 39072) | 0, 129) | 0, 39079) | 0, 38572) | 0; + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $46 + (HEAP32[(HEAP32[$46 >> 2] | 0) + -12 >> 2] | 0) | 0); + $51 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66512) | 0; + $55 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$51 >> 2] | 0) + 28 >> 2] & 127]($51, 10) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($46, $55) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($46) | 0; + _abort(); + } + if (!$5) { + $62 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 38617) | 0, 38386) | 0, 39072) | 0, 130) | 0, 39079) | 0, 38653) | 0; + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $62 + (HEAP32[(HEAP32[$62 >> 2] | 0) + -12 >> 2] | 0) | 0); + $67 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66512) | 0; + $71 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$67 >> 2] | 0) + 28 >> 2] & 127]($67, 10) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($62, $71) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($62) | 0; + _abort(); + } + if (($4 | 0) < 0) $$sink = Math_imul(Math_imul($5, $2) | 0, __ZN6vision5Image19calculate_unit_sizeENS_9ImageTypeE($1) | 0) | 0; else $$sink = $4; + HEAP32[$0 + 12 >> 2] = $$sink; + $77 = Math_imul($$sink, $3) | 0; + $78 = $0 + 20 | 0; + if ((HEAP32[$78 >> 2] | 0) != ($77 | 0) ? ($81 = $0 + 24 | 0, $82 = __Znam($77) | 0, HEAP32[$7 >> 2] = 0, HEAP32[$$byval_copy >> 2] = HEAP32[$7 >> 2], __ZNSt3__210shared_ptrIhEC2IhEEPT_NS_9enable_ifIXsr14is_convertibleIS4_PhEE5valueENS1_5__natEE4typeE($6, $82, $$byval_copy), $83 = HEAP32[$6 >> 2] | 0, HEAP32[$6 >> 2] = HEAP32[$81 >> 2], HEAP32[$81 >> 2] = $83, $85 = $6 + 4 | 0, $86 = $0 + 28 | 0, $87 = HEAP32[$85 >> 2] | 0, HEAP32[$85 >> 2] = HEAP32[$86 >> 2], HEAP32[$86 >> 2] = $87, __ZNSt3__210shared_ptrIhED2Ev($6), (HEAP32[$81 >> 2] | 0) == 0) : 0) { + $96 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 38687) | 0, 38386) | 0, 39072) | 0, 149) | 0, 39079) | 0, 38722) | 0; + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $96 + (HEAP32[(HEAP32[$96 >> 2] | 0) + -12 >> 2] | 0) | 0); + $101 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66512) | 0; + $105 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$101 >> 2] | 0) + 28 >> 2] & 127]($101, 10) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($96, $105) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($96) | 0; + _abort(); + } + HEAP32[$0 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = $2; + HEAP32[$0 + 8 >> 2] = $3; + HEAP32[$0 + 16 >> 2] = $5; + HEAP32[$78 >> 2] = $77; + STACKTOP = sp; + return; +} + +function _arParamObserv2Ideal($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0342 = 0.0, $$0343 = 0.0, $$0345 = 0, $$0346 = 0.0, $$0348 = 0.0, $$0350 = 0.0, $$0351 = 0.0, $$0352 = 0, $$0353 = 0.0, $$0355 = 0.0, $$0357 = 0.0, $$0358 = 0.0, $$0359 = 0, $$0360 = 0.0, $$0361 = 0.0, $$0362 = 0.0, $$0363 = 0, $$0364 = 0.0, $$0365 = 0.0, $$0367 = 0.0, $$1 = 0.0, $$1344 = 0.0, $$1347 = 0.0, $$1349 = 0.0, $$1354 = 0.0, $$1356 = 0.0, $$1366 = 0.0, $$1368 = 0.0, $$sink = 0.0, $10 = 0.0, $105 = 0.0, $107 = 0.0, $108 = 0, $110 = 0.0, $113 = 0.0, $117 = 0.0, $12 = 0.0, $120 = 0.0, $121 = 0.0, $122 = 0.0, $123 = 0.0, $138 = 0.0, $14 = 0.0, $140 = 0.0, $142 = 0.0, $146 = 0.0, $149 = 0, $157 = 0.0, $158 = 0.0, $159 = 0, $16 = 0.0, $161 = 0.0, $164 = 0.0, $168 = 0.0, $171 = 0.0, $172 = 0.0, $173 = 0.0, $174 = 0.0, $18 = 0.0, $189 = 0.0, $191 = 0.0, $193 = 0.0, $197 = 0.0, $20 = 0.0, $200 = 0, $208 = 0.0, $209 = 0.0, $210 = 0, $212 = 0.0, $215 = 0.0, $218 = 0.0, $219 = 0.0, $22 = 0.0, $220 = 0.0, $229 = 0.0, $231 = 0.0, $233 = 0.0, $237 = 0.0, $24 = 0.0, $240 = 0, $26 = 0.0, $29 = 0.0, $30 = 0.0, $31 = 0.0, $32 = 0.0, $35 = 0.0, $40 = 0.0, $50 = 0.0, $56 = 0.0, $6 = 0.0, $67 = 0.0, $73 = 0.0, $8 = 0.0, $92 = 0.0, label = 0; + switch ($5 | 0) { + case 4: + { + $6 = +HEAPF64[$0 >> 3]; + $8 = +HEAPF64[$0 + 8 >> 3]; + $10 = +HEAPF64[$0 + 16 >> 3]; + $12 = +HEAPF64[$0 + 24 >> 3]; + $14 = +HEAPF64[$0 + 32 >> 3]; + $16 = +HEAPF64[$0 + 40 >> 3]; + $18 = +HEAPF64[$0 + 48 >> 3]; + $20 = +HEAPF64[$0 + 56 >> 3]; + $22 = +HEAPF64[$0 + 64 >> 3]; + $24 = ($1 - $18) / $14; + $26 = ($2 - $20) / $16; + $29 = $10 * 2.0; + $30 = $12 * 6.0; + $31 = $12 * 2.0; + $32 = $10 * 6.0; + $$0346 = $24; + $$0348 = $26; + $$0357 = $24 * $24; + $$0358 = $26 * $26; + $$0359 = 1; + while (1) { + if (!($$0358 != 0.0 | $$0357 != 0.0)) { + $$1347 = 0.0; + $$1349 = 0.0; + break; + } + $35 = $$0358 + $$0357; + $40 = $6 * $35 + 1.0 + $35 * ($8 * $35); + $50 = $$0357 * 3.0; + $56 = $$0358 * $50; + $67 = $$0346 - ($12 * ($35 + $$0357 * 2.0) + ($$0348 * ($29 * $$0346) + $$0346 * $40) - $24) / ($30 * $$0346 + ($29 * $$0348 + ($6 * ($$0358 + $50) + 1.0 + $8 * ($$0358 * $$0358 + ($$0357 * ($$0357 * 5.0) + $56))))); + $73 = $31 * $67; + $92 = $$0348 - ($10 * ($$0358 * 2.0 + $35) + $$0348 * $40 + $$0348 * $73 - $26) / ($32 * $$0348 + ($6 * ($$0357 + $$0358 * 3.0) + 1.0 + $8 * ($$0358 * ($$0358 * 5.0) + ($$0357 * $$0357 + $56))) + $73); + if (($$0359 | 0) == 4) { + $$1347 = $67; + $$1349 = $92; + break; + } + $$0346 = $67; + $$0348 = $92; + $$0357 = $67 * $67; + $$0358 = $92 * $92; + $$0359 = $$0359 + 1 | 0; + } + HEAPF64[$3 >> 3] = $18 + $14 * $$1347 / $22; + $$sink = $20 + $16 * $$1349 / $22; + label = 22; + break; + } + case 3: + { + $105 = +HEAPF64[$0 >> 3]; + $107 = ($1 - $105) / +HEAPF64[$0 + 24 >> 3]; + $108 = $0 + 8 | 0; + $110 = $2 - +HEAPF64[$108 >> 3]; + $113 = +HEAPF64[$0 + 32 >> 3] / 1.0e8; + $117 = +HEAPF64[$0 + 40 >> 3] / 1.0e8 / 1.0e5; + $120 = $107 * $107 + $110 * $110; + $121 = +Math_sqrt(+$120); + $122 = $113 * 3.0; + $123 = $117 * 5.0; + $$0360 = $120; + $$0363 = 1; + $$0364 = $121; + $$0365 = $110; + $$0367 = $107; + while (1) { + if (!($$0364 != 0.0)) { + $$1366 = 0.0; + $$1368 = 0.0; + break; + } + $138 = $$0364 - ($$0364 * (1.0 - $113 * $$0360 - $$0360 * ($117 * $$0360)) - $121) / (1.0 - $122 * $$0360 - $$0360 * ($123 * $$0360)); + $140 = $$0367 * $138 / $$0364; + $142 = $$0365 * $138 / $$0364; + if (($$0363 | 0) == 3) { + $$1366 = $142; + $$1368 = $140; + break; + } + $146 = $140 * $140 + $142 * $142; + $$0360 = $146; + $$0363 = $$0363 + 1 | 0; + $$0364 = +Math_sqrt(+$146); + $$0365 = $142; + $$0367 = $140; + } + $149 = $0 + 16 | 0; + HEAPF64[$3 >> 3] = $105 + $$1368 / +HEAPF64[$149 >> 3]; + $$sink = $$1366 / +HEAPF64[$149 >> 3] + +HEAPF64[$108 >> 3]; + label = 22; + break; + } + case 2: + { + $157 = +HEAPF64[$0 >> 3]; + $158 = $1 - $157; + $159 = $0 + 8 | 0; + $161 = $2 - +HEAPF64[$159 >> 3]; + $164 = +HEAPF64[$0 + 24 >> 3] / 1.0e8; + $168 = +HEAPF64[$0 + 32 >> 3] / 1.0e8 / 1.0e5; + $171 = $158 * $158 + $161 * $161; + $172 = +Math_sqrt(+$171); + $173 = $164 * 3.0; + $174 = $168 * 5.0; + $$0352 = 1; + $$0353 = $161; + $$0355 = $158; + $$0361 = $172; + $$0362 = $171; + while (1) { + if (!($$0361 != 0.0)) { + $$1354 = 0.0; + $$1356 = 0.0; + break; + } + $189 = $$0361 - ($$0361 * (1.0 - $164 * $$0362 - $$0362 * ($168 * $$0362)) - $172) / (1.0 - $173 * $$0362 - $$0362 * ($174 * $$0362)); + $191 = $$0355 * $189 / $$0361; + $193 = $$0353 * $189 / $$0361; + if (($$0352 | 0) == 3) { + $$1354 = $193; + $$1356 = $191; + break; + } + $197 = $191 * $191 + $193 * $193; + $$0352 = $$0352 + 1 | 0; + $$0353 = $193; + $$0355 = $191; + $$0361 = +Math_sqrt(+$197); + $$0362 = $197; + } + $200 = $0 + 16 | 0; + HEAPF64[$3 >> 3] = $157 + $$1356 / +HEAPF64[$200 >> 3]; + $$sink = $$1354 / +HEAPF64[$200 >> 3] + +HEAPF64[$159 >> 3]; + label = 22; + break; + } + case 1: + { + $208 = +HEAPF64[$0 >> 3]; + $209 = $1 - $208; + $210 = $0 + 8 | 0; + $212 = $2 - +HEAPF64[$210 >> 3]; + $215 = +HEAPF64[$0 + 24 >> 3] / 1.0e8; + $218 = $209 * $209 + $212 * $212; + $219 = +Math_sqrt(+$218); + $220 = $215 * 3.0; + $$0 = 1; + $$0342 = $212; + $$0343 = $209; + $$0350 = $219; + $$0351 = $218; + while (1) { + if (!($$0350 != 0.0)) { + $$1 = 0.0; + $$1344 = 0.0; + break; + } + $229 = $$0350 - ($$0350 * (1.0 - $215 * $$0351) - $219) / (1.0 - $220 * $$0351); + $231 = $$0343 * $229 / $$0350; + $233 = $$0342 * $229 / $$0350; + if (($$0 | 0) == 3) { + $$1 = $233; + $$1344 = $231; + break; + } + $237 = $231 * $231 + $233 * $233; + $$0 = $$0 + 1 | 0; + $$0342 = $233; + $$0343 = $231; + $$0350 = +Math_sqrt(+$237); + $$0351 = $237; + } + $240 = $0 + 16 | 0; + HEAPF64[$3 >> 3] = $208 + $$1344 / +HEAPF64[$240 >> 3]; + $$sink = $$1 / +HEAPF64[$240 >> 3] + +HEAPF64[$210 >> 3]; + label = 22; + break; + } + default: + $$0345 = -1; + } + if ((label | 0) == 22) { + HEAPF64[$4 >> 3] = $$sink; + $$0345 = 0; + } + return $$0345 | 0; +} + +function _jpeg_idct_12x12($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0291300 = 0, $$0293299 = 0, $$0294298 = 0, $$0301 = 0, $$1292296 = 0, $$1297 = 0, $100 = 0, $102 = 0, $104 = 0, $106 = 0, $146 = 0, $149 = 0, $15 = 0, $152 = 0, $155 = 0, $156 = 0, $157 = 0, $159 = 0, $164 = 0, $165 = 0, $166 = 0, $167 = 0, $168 = 0, $169 = 0, $170 = 0, $172 = 0, $173 = 0, $174 = 0, $176 = 0, $178 = 0, $180 = 0, $182 = 0, $183 = 0, $184 = 0, $185 = 0, $187 = 0, $189 = 0, $192 = 0, $194 = 0, $198 = 0, $202 = 0, $207 = 0, $208 = 0, $209 = 0, $211 = 0, $213 = 0, $215 = 0, $22 = 0, $23 = 0, $24 = 0, $30 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $55 = 0, $61 = 0, $67 = 0, $7 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $78 = 0, $80 = 0, $83 = 0, $85 = 0, $89 = 0, $93 = 0, $98 = 0, $99 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 384 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(384); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0291300 = $5; + $$0293299 = HEAP32[$1 + 84 >> 2] | 0; + $$0294298 = $2; + $$0301 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0294298 >> 1] << 13, HEAP32[$$0293299 >> 2] | 0) | 0 | 1024; + $22 = Math_imul((HEAP16[$$0294298 + 64 >> 1] | 0) * 10033 | 0, HEAP32[$$0293299 + 128 >> 2] | 0) | 0; + $23 = $22 + $15 | 0; + $24 = $15 - $22 | 0; + $30 = Math_imul(HEAP32[$$0293299 + 64 >> 2] | 0, HEAP16[$$0294298 + 32 >> 1] | 0) | 0; + $39 = Math_imul(HEAP16[$$0294298 + 96 >> 1] << 13, HEAP32[$$0293299 + 192 >> 2] | 0) | 0; + $40 = ($30 << 13) - $39 | 0; + $41 = $40 + $15 | 0; + $42 = $15 - $40 | 0; + $43 = $39 + ($30 * 11190 | 0) | 0; + $44 = $43 + $23 | 0; + $45 = $23 - $43 | 0; + $47 = ($30 * 2998 | 0) - $39 | 0; + $48 = $47 + $24 | 0; + $49 = $24 - $47 | 0; + $55 = Math_imul(HEAP32[$$0293299 + 32 >> 2] | 0, HEAP16[$$0294298 + 16 >> 1] | 0) | 0; + $61 = Math_imul(HEAP32[$$0293299 + 96 >> 2] | 0, HEAP16[$$0294298 + 48 >> 1] | 0) | 0; + $67 = Math_imul(HEAP32[$$0293299 + 160 >> 2] | 0, HEAP16[$$0294298 + 80 >> 1] | 0) | 0; + $73 = Math_imul(HEAP32[$$0293299 + 224 >> 2] | 0, HEAP16[$$0294298 + 112 >> 1] | 0) | 0; + $74 = $61 * 10703 | 0; + $75 = Math_imul($61, -4433) | 0; + $76 = $67 + $55 | 0; + $78 = ($73 + $76 | 0) * 7053 | 0; + $80 = $78 + ($76 * 2139 | 0) | 0; + $83 = $74 + ($55 * 2295 | 0) + $80 | 0; + $85 = Math_imul($73 + $67 | 0, -8565) | 0; + $89 = (Math_imul($67, -12112) | 0) + $75 + $85 + $80 | 0; + $93 = ($73 * 12998 | 0) - $74 + $78 + $85 | 0; + $98 = $75 + (Math_imul($55, -5540) | 0) + (Math_imul($73, -16244) | 0) + $78 | 0; + $99 = $55 - $73 | 0; + $100 = $61 - $67 | 0; + $102 = ($99 + $100 | 0) * 4433 | 0; + $104 = $102 + ($99 * 6270 | 0) | 0; + $106 = $102 + (Math_imul($100, -15137) | 0) | 0; + HEAP32[$$0291300 >> 2] = $83 + $44 >> 11; + HEAP32[$$0291300 + 352 >> 2] = $44 - $83 >> 11; + HEAP32[$$0291300 + 32 >> 2] = $104 + $41 >> 11; + HEAP32[$$0291300 + 320 >> 2] = $41 - $104 >> 11; + HEAP32[$$0291300 + 64 >> 2] = $89 + $48 >> 11; + HEAP32[$$0291300 + 288 >> 2] = $48 - $89 >> 11; + HEAP32[$$0291300 + 96 >> 2] = $93 + $49 >> 11; + HEAP32[$$0291300 + 256 >> 2] = $49 - $93 >> 11; + HEAP32[$$0291300 + 128 >> 2] = $106 + $42 >> 11; + HEAP32[$$0291300 + 224 >> 2] = $42 - $106 >> 11; + HEAP32[$$0291300 + 160 >> 2] = $98 + $45 >> 11; + HEAP32[$$0291300 + 192 >> 2] = $45 - $98 >> 11; + $$0301 = $$0301 + 1 | 0; + if (($$0301 | 0) == 8) break; else { + $$0291300 = $$0291300 + 4 | 0; + $$0293299 = $$0293299 + 4 | 0; + $$0294298 = $$0294298 + 2 | 0; + } + } + $146 = $7 + -384 | 0; + $$1292296 = $5; + $$1297 = 0; + while (1) { + $149 = (HEAP32[$3 + ($$1297 << 2) >> 2] | 0) + $4 | 0; + $152 = (HEAP32[$$1292296 >> 2] << 13) + 134348800 | 0; + $155 = (HEAP32[$$1292296 + 16 >> 2] | 0) * 10033 | 0; + $156 = $152 + $155 | 0; + $157 = $152 - $155 | 0; + $159 = HEAP32[$$1292296 + 8 >> 2] | 0; + $164 = HEAP32[$$1292296 + 24 >> 2] << 13; + $165 = ($159 << 13) - $164 | 0; + $166 = $165 + $152 | 0; + $167 = $152 - $165 | 0; + $168 = $164 + ($159 * 11190 | 0) | 0; + $169 = $168 + $156 | 0; + $170 = $156 - $168 | 0; + $172 = ($159 * 2998 | 0) - $164 | 0; + $173 = $172 + $157 | 0; + $174 = $157 - $172 | 0; + $176 = HEAP32[$$1292296 + 4 >> 2] | 0; + $178 = HEAP32[$$1292296 + 12 >> 2] | 0; + $180 = HEAP32[$$1292296 + 20 >> 2] | 0; + $182 = HEAP32[$$1292296 + 28 >> 2] | 0; + $183 = $178 * 10703 | 0; + $184 = Math_imul($178, -4433) | 0; + $185 = $180 + $176 | 0; + $187 = ($185 + $182 | 0) * 7053 | 0; + $189 = $187 + ($185 * 2139 | 0) | 0; + $192 = $183 + ($176 * 2295 | 0) + $189 | 0; + $194 = Math_imul($182 + $180 | 0, -8565) | 0; + $198 = (Math_imul($180, -12112) | 0) + $184 + $194 + $189 | 0; + $202 = ($182 * 12998 | 0) - $183 + $187 + $194 | 0; + $207 = $184 + (Math_imul($176, -5540) | 0) + (Math_imul($182, -16244) | 0) + $187 | 0; + $208 = $176 - $182 | 0; + $209 = $178 - $180 | 0; + $211 = ($208 + $209 | 0) * 4433 | 0; + $213 = $211 + ($208 * 6270 | 0) | 0; + $215 = $211 + (Math_imul($209, -15137) | 0) | 0; + HEAP8[$149 >> 0] = HEAP8[$146 + (($192 + $169 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$149 + 11 >> 0] = HEAP8[$146 + (($169 - $192 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$149 + 1 >> 0] = HEAP8[$146 + (($213 + $166 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$149 + 10 >> 0] = HEAP8[$146 + (($166 - $213 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$149 + 2 >> 0] = HEAP8[$146 + (($198 + $173 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$149 + 9 >> 0] = HEAP8[$146 + (($173 - $198 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$149 + 3 >> 0] = HEAP8[$146 + (($202 + $174 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$149 + 8 >> 0] = HEAP8[$146 + (($174 - $202 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$149 + 4 >> 0] = HEAP8[$146 + (($215 + $167 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$149 + 7 >> 0] = HEAP8[$146 + (($167 - $215 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$149 + 5 >> 0] = HEAP8[$146 + (($207 + $170 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$149 + 6 >> 0] = HEAP8[$146 + (($170 - $207 | 0) >>> 18 & 1023) >> 0] | 0; + $$1297 = $$1297 + 1 | 0; + if (($$1297 | 0) == 12) break; else $$1292296 = $$1292296 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function _start_pass_51($0) { + $0 = $0 | 0; + var $$08497 = 0, $$085103 = 0, $$08699 = 0, $$087102 = 0, $$088101 = 0, $$090100 = 0, $$189 = 0, $$191 = 0, $$198 = 0, $$296 = 0, $10 = 0, $103 = 0, $112 = 0, $12 = 0, $121 = 0, $132 = 0, $15 = 0, $16 = 0, $19 = 0, $2 = 0, $3 = 0, $31 = 0, $35 = 0, $38 = 0, $45 = 0, $54 = 0, $58 = 0, $60 = 0.0, $68 = 0, $77 = 0, $8 = 0, $86 = 0, $95 = 0; + $2 = HEAP32[$0 + 472 >> 2] | 0; + $3 = $0 + 36 | 0; + if ((HEAP32[$3 >> 2] | 0) <= 0) return; + $8 = $0 + 72 | 0; + $$085103 = 0; + $$087102 = HEAP32[$0 + 216 >> 2] | 0; + $$088101 = 0; + $$090100 = 0; + while (1) { + $10 = HEAP32[$$087102 + 36 >> 2] | 0; + $12 = $$087102 + 40 | 0; + L6 : do switch (($10 << 8) + (HEAP32[$12 >> 2] | 0) | 0) { + case 257: + { + $$189 = 0; + $$191 = 13; + break; + } + case 514: + { + $$189 = 0; + $$191 = 14; + break; + } + case 771: + { + $$189 = 0; + $$191 = 15; + break; + } + case 1028: + { + $$189 = 0; + $$191 = 16; + break; + } + case 1285: + { + $$189 = 0; + $$191 = 17; + break; + } + case 1542: + { + $$189 = 0; + $$191 = 18; + break; + } + case 1799: + { + $$189 = 0; + $$191 = 19; + break; + } + case 2313: + { + $$189 = 0; + $$191 = 20; + break; + } + case 2570: + { + $$189 = 0; + $$191 = 21; + break; + } + case 2827: + { + $$189 = 0; + $$191 = 22; + break; + } + case 3084: + { + $$189 = 0; + $$191 = 23; + break; + } + case 3341: + { + $$189 = 0; + $$191 = 24; + break; + } + case 3598: + { + $$189 = 0; + $$191 = 25; + break; + } + case 3855: + { + $$189 = 0; + $$191 = 26; + break; + } + case 4112: + { + $$189 = 0; + $$191 = 27; + break; + } + case 4104: + { + $$189 = 0; + $$191 = 28; + break; + } + case 3591: + { + $$189 = 0; + $$191 = 29; + break; + } + case 3078: + { + $$189 = 0; + $$191 = 30; + break; + } + case 2565: + { + $$189 = 0; + $$191 = 31; + break; + } + case 2052: + { + $$189 = 0; + $$191 = 32; + break; + } + case 1539: + { + $$189 = 0; + $$191 = 33; + break; + } + case 1026: + { + $$189 = 0; + $$191 = 34; + break; + } + case 513: + { + $$189 = 0; + $$191 = 35; + break; + } + case 2064: + { + $$189 = 0; + $$191 = 36; + break; + } + case 1806: + { + $$189 = 0; + $$191 = 37; + break; + } + case 1548: + { + $$189 = 0; + $$191 = 38; + break; + } + case 1290: + { + $$189 = 0; + $$191 = 39; + break; + } + case 1032: + { + $$189 = 0; + $$191 = 40; + break; + } + case 774: + { + $$189 = 0; + $$191 = 41; + break; + } + case 516: + { + $$189 = 0; + $$191 = 42; + break; + } + case 258: + { + $$189 = 0; + $$191 = 43; + break; + } + case 2056: + { + $15 = HEAP32[$8 >> 2] | 0; + switch ($15 | 0) { + case 0: + { + $$189 = $15; + $$191 = 44; + break L6; + break; + } + case 1: + { + $$189 = $15; + $$191 = 45; + break L6; + break; + } + case 2: + { + $$189 = $15; + $$191 = 46; + break L6; + break; + } + default: + { + $16 = HEAP32[$0 >> 2] | 0; + HEAP32[$16 + 20 >> 2] = 49; + FUNCTION_TABLE_vi[HEAP32[$16 >> 2] & 255]($0); + $$189 = $$088101; + $$191 = $$090100; + break L6; + } + } + break; + } + default: + { + $19 = HEAP32[$0 >> 2] | 0; + HEAP32[$19 + 20 >> 2] = 7; + HEAP32[$19 + 24 >> 2] = $10; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = HEAP32[$12 >> 2]; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + $$189 = $$088101; + $$191 = $$090100; + } + } while (0); + HEAP32[$2 + 4 + ($$085103 << 2) >> 2] = $$191; + L44 : do if ((HEAP32[$$087102 + 52 >> 2] | 0 ? ($31 = $2 + 44 + ($$085103 << 2) | 0, (HEAP32[$31 >> 2] | 0) != ($$189 | 0)) : 0) ? ($35 = HEAP32[$$087102 + 80 >> 2] | 0, $35 | 0) : 0) { + HEAP32[$31 >> 2] = $$189; + switch ($$189 | 0) { + case 0: + { + $38 = HEAP32[$$087102 + 84 >> 2] | 0; + $$08699 = 0; + do { + HEAP32[$38 + ($$08699 << 2) >> 2] = HEAPU16[$35 + ($$08699 << 1) >> 1]; + $$08699 = $$08699 + 1 | 0; + } while (($$08699 | 0) != 64); + break; + } + case 1: + { + $45 = HEAP32[$$087102 + 84 >> 2] | 0; + $$198 = 0; + do { + $54 = (Math_imul(HEAP16[5248 + ($$198 << 1) >> 1] | 0, HEAPU16[$35 + ($$198 << 1) >> 1] | 0) | 0) + 2048 >> 12; + HEAP32[$45 + ($$198 << 2) >> 2] = $54; + $$198 = $$198 + 1 | 0; + } while (($$198 | 0) != 64); + break; + } + case 2: + { + $58 = HEAP32[$$087102 + 84 >> 2] | 0; + $$08497 = 0; + $$296 = 0; + while (1) { + $60 = +HEAPF64[5376 + ($$08497 << 3) >> 3]; + HEAPF32[$58 + ($$296 << 2) >> 2] = $60 * +(HEAPU16[$35 + ($$296 << 1) >> 1] | 0) * .125; + $68 = $$296 | 1; + HEAPF32[$58 + ($68 << 2) >> 2] = $60 * +(HEAPU16[$35 + ($68 << 1) >> 1] | 0) * 1.387039845 * .125; + $77 = $68 + 1 | 0; + HEAPF32[$58 + ($77 << 2) >> 2] = $60 * +(HEAPU16[$35 + ($77 << 1) >> 1] | 0) * 1.306562965 * .125; + $86 = $$296 | 3; + HEAPF32[$58 + ($86 << 2) >> 2] = $60 * +(HEAPU16[$35 + ($86 << 1) >> 1] | 0) * 1.175875602 * .125; + $95 = $86 + 1 | 0; + HEAPF32[$58 + ($95 << 2) >> 2] = $60 * +(HEAPU16[$35 + ($95 << 1) >> 1] | 0) * .125; + $103 = $86 + 2 | 0; + HEAPF32[$58 + ($103 << 2) >> 2] = $60 * +(HEAPU16[$35 + ($103 << 1) >> 1] | 0) * .785694958 * .125; + $112 = $86 + 3 | 0; + HEAPF32[$58 + ($112 << 2) >> 2] = $60 * +(HEAPU16[$35 + ($112 << 1) >> 1] | 0) * .5411961 * .125; + $121 = $$296 | 7; + HEAPF32[$58 + ($121 << 2) >> 2] = $60 * +(HEAPU16[$35 + ($121 << 1) >> 1] | 0) * .275899379 * .125; + $$08497 = $$08497 + 1 | 0; + if (($$08497 | 0) == 8) break; else $$296 = $$296 + 8 | 0; + } + break; + } + default: + { + $132 = HEAP32[$0 >> 2] | 0; + HEAP32[$132 + 20 >> 2] = 49; + FUNCTION_TABLE_vi[HEAP32[$132 >> 2] & 255]($0); + break L44; + } + } + } while (0); + $$085103 = $$085103 + 1 | 0; + if (($$085103 | 0) >= (HEAP32[$3 >> 2] | 0)) break; else { + $$087102 = $$087102 + 88 | 0; + $$088101 = $$189; + $$090100 = $$191; + } + } + return; +} + +function __ZNSt3__29__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i110 = 0, $$0101 = 0, $$0102 = 0, $$0104 = 0, $$0106 = 0, $$07$i$i = 0, $$07$i$i109 = 0, $$1 = 0, $$1103 = 0, $$1105 = 0, $$1107 = 0, $$2 = 0, $$2108 = 0, $$3 = 0, $$pre$phiZ2D = 0, $101 = 0, $105 = 0, $107 = 0, $119 = 0, $120 = 0, $125 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $137 = 0, $138 = 0, $139 = 0, $144 = 0, $148 = 0, $154 = 0, $155 = 0, $18 = 0, $19 = 0, $21 = 0, $27 = 0, $32 = 0, $33 = 0, $35 = 0, $40 = 0, $41 = 0, $45 = 0, $52 = 0, $57 = 0, $58 = 0, $60 = 0, $7 = 0, $73 = 0, $75 = 0, $77 = 0, $8 = 0, $83 = 0, $88 = 0, $89 = 0, $9 = 0, $91 = 0, $93 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $7 = sp; + $8 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66544) | 0; + $9 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66552) | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$9 >> 2] | 0) + 20 >> 2] & 255]($7, $9); + HEAP32[$5 >> 2] = $3; + $13 = HEAP8[$0 >> 0] | 0; + switch ($13 << 24 >> 24) { + case 43: + case 45: + { + $18 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$8 >> 2] | 0) + 44 >> 2] & 127]($8, $13) | 0; + $19 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $19 + 4; + HEAP32[$19 >> 2] = $18; + $$0104 = $0 + 1 | 0; + break; + } + default: + $$0104 = $0; + } + $21 = $2; + L4 : do if (($21 - $$0104 | 0) > 1 ? (HEAP8[$$0104 >> 0] | 0) == 48 : 0) { + $27 = $$0104 + 1 | 0; + switch (HEAP8[$27 >> 0] | 0) { + case 88: + case 120: + break; + default: + { + label = 4; + break L4; + } + } + $32 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$8 >> 2] | 0) + 44 >> 2] & 127]($8, 48) | 0; + $33 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $33 + 4; + HEAP32[$33 >> 2] = $32; + $35 = $$0104 + 2 | 0; + $40 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$8 >> 2] | 0) + 44 >> 2] & 127]($8, HEAP8[$27 >> 0] | 0) | 0; + $41 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $41 + 4; + HEAP32[$41 >> 2] = $40; + $$0106 = $35; + while (1) { + if ($$0106 >>> 0 >= $2 >>> 0) { + $$1105 = $35; + $$2108 = $$0106; + break L4; + } + $45 = HEAP8[$$0106 >> 0] | 0; + if (!(_isxdigit_l($45, __ZNSt3__26__clocEv() | 0) | 0)) { + $$1105 = $35; + $$2108 = $$0106; + break L4; + } + $$0106 = $$0106 + 1 | 0; + } + } else label = 4; while (0); + L12 : do if ((label | 0) == 4) { + $$1107 = $$0104; + while (1) { + if ($$1107 >>> 0 >= $2 >>> 0) { + $$1105 = $$0104; + $$2108 = $$1107; + break L12; + } + $52 = HEAP8[$$1107 >> 0] | 0; + if (!(_isdigit_l($52, __ZNSt3__26__clocEv() | 0) | 0)) { + $$1105 = $$0104; + $$2108 = $$1107; + break L12; + } + $$1107 = $$1107 + 1 | 0; + } + } while (0); + $57 = $7 + 11 | 0; + $58 = HEAP8[$57 >> 0] | 0; + $60 = $7 + 4 | 0; + L19 : do if (($58 << 24 >> 24 < 0 ? HEAP32[$60 >> 2] | 0 : $58 & 255) | 0) { + L22 : do if (($$1105 | 0) != ($$2108 | 0)) { + $$0$i$i = $$2108; + $$07$i$i = $$1105; + while (1) { + $75 = $$0$i$i + -1 | 0; + if ($$07$i$i >>> 0 >= $75 >>> 0) break L22; + $77 = HEAP8[$$07$i$i >> 0] | 0; + HEAP8[$$07$i$i >> 0] = HEAP8[$75 >> 0] | 0; + HEAP8[$75 >> 0] = $77; + $$0$i$i = $75; + $$07$i$i = $$07$i$i + 1 | 0; + } + } while (0); + $83 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$9 >> 2] | 0) + 16 >> 2] & 127]($9) | 0; + $$0 = $$1105; + $$0101 = 0; + $$0102 = 0; + while (1) { + if ($$0 >>> 0 >= $$2108 >>> 0) break; + $101 = HEAP8[((HEAP8[$57 >> 0] | 0) < 0 ? HEAP32[$7 >> 2] | 0 : $7) + $$0101 >> 0] | 0; + if ($101 << 24 >> 24 > 0 & ($$0102 | 0) == ($101 << 24 >> 24 | 0)) { + $105 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $105 + 4; + HEAP32[$105 >> 2] = $83; + $107 = HEAP8[$57 >> 0] | 0; + $$1 = $$0101 + ($$0101 >>> 0 < (($107 << 24 >> 24 < 0 ? HEAP32[$60 >> 2] | 0 : $107 & 255) + -1 | 0) >>> 0 & 1) | 0; + $$1103 = 0; + } else { + $$1 = $$0101; + $$1103 = $$0102; + } + $119 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$8 >> 2] | 0) + 44 >> 2] & 127]($8, HEAP8[$$0 >> 0] | 0) | 0; + $120 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $120 + 4; + HEAP32[$120 >> 2] = $119; + $$0 = $$0 + 1 | 0; + $$0101 = $$1; + $$0102 = $$1103 + 1 | 0; + } + $88 = $3 + ($$1105 - $0 << 2) | 0; + $89 = HEAP32[$5 >> 2] | 0; + if (($88 | 0) == ($89 | 0)) { + $$pre$phiZ2D = $8; + $154 = $88; + } else { + $$0$i$i110 = $89; + $$07$i$i109 = $88; + while (1) { + $91 = $$0$i$i110 + -4 | 0; + if ($$07$i$i109 >>> 0 >= $91 >>> 0) { + $$pre$phiZ2D = $8; + $154 = $89; + break L19; + } + $93 = HEAP32[$$07$i$i109 >> 2] | 0; + HEAP32[$$07$i$i109 >> 2] = HEAP32[$91 >> 2]; + HEAP32[$91 >> 2] = $93; + $$0$i$i110 = $91; + $$07$i$i109 = $$07$i$i109 + 4 | 0; + } + } + } else { + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$8 >> 2] | 0) + 48 >> 2] & 15]($8, $$1105, $$2108, HEAP32[$5 >> 2] | 0) | 0; + $73 = (HEAP32[$5 >> 2] | 0) + ($$2108 - $$1105 << 2) | 0; + HEAP32[$5 >> 2] = $73; + $$pre$phiZ2D = $8; + $154 = $73; + } while (0); + $$2 = $$2108; + $155 = $154; + while (1) { + if ($$2 >>> 0 >= $2 >>> 0) { + $$3 = $$2; + $144 = $155; + break; + } + $125 = HEAP8[$$2 >> 0] | 0; + if ($125 << 24 >> 24 == 46) { + label = 32; + break; + } + $137 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$$pre$phiZ2D >> 2] | 0) + 44 >> 2] & 127]($8, $125) | 0; + $138 = HEAP32[$5 >> 2] | 0; + $139 = $138 + 4 | 0; + HEAP32[$5 >> 2] = $139; + HEAP32[$138 >> 2] = $137; + $$2 = $$2 + 1 | 0; + $155 = $139; + } + if ((label | 0) == 32) { + $130 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$9 >> 2] | 0) + 12 >> 2] & 127]($9) | 0; + $131 = HEAP32[$5 >> 2] | 0; + $132 = $131 + 4 | 0; + HEAP32[$5 >> 2] = $132; + HEAP32[$131 >> 2] = $130; + $$3 = $$2 + 1 | 0; + $144 = $132; + } + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$8 >> 2] | 0) + 48 >> 2] & 15]($8, $$3, $2, $144) | 0; + $148 = (HEAP32[$5 >> 2] | 0) + ($21 - $$3 << 2) | 0; + HEAP32[$5 >> 2] = $148; + HEAP32[$4 >> 2] = ($1 | 0) == ($2 | 0) ? $148 : $3 + ($1 - $0 << 2) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($7); + STACKTOP = sp; + return; +} + +function _try_realloc_chunk($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$1271 = 0, $$1271$be = 0, $$1271$ph = 0, $$1274 = 0, $$1274$be = 0, $$1274$ph = 0, $$2 = 0, $$3 = 0, $$pre$phiZ2D = 0, $101 = 0, $103 = 0, $106 = 0, $108 = 0, $11 = 0, $111 = 0, $114 = 0, $115 = 0, $116 = 0, $118 = 0, $12 = 0, $120 = 0, $121 = 0, $123 = 0, $124 = 0, $129 = 0, $130 = 0, $139 = 0, $144 = 0, $147 = 0, $148 = 0, $154 = 0, $165 = 0, $168 = 0, $175 = 0, $2 = 0, $24 = 0, $26 = 0, $3 = 0, $37 = 0, $39 = 0, $4 = 0, $40 = 0, $49 = 0, $5 = 0, $51 = 0, $53 = 0, $54 = 0, $6 = 0, $60 = 0, $67 = 0, $73 = 0, $75 = 0, $76 = 0, $79 = 0, $8 = 0, $81 = 0, $83 = 0, $96 = 0, $storemerge = 0, $storemerge3 = 0; + $2 = $0 + 4 | 0; + $3 = HEAP32[$2 >> 2] | 0; + $4 = $3 & -8; + $5 = $0 + $4 | 0; + $6 = HEAP32[16739] | 0; + $8 = $3 & 3; + if (!(($8 | 0) != 1 & $6 >>> 0 <= $0 >>> 0 & $5 >>> 0 > $0 >>> 0)) _abort(); + $11 = $5 + 4 | 0; + $12 = HEAP32[$11 >> 2] | 0; + if (!($12 & 1)) _abort(); + if (!$8) { + if ($1 >>> 0 < 256) { + $$2 = 0; + return $$2 | 0; + } + if ($4 >>> 0 >= ($1 + 4 | 0) >>> 0 ? ($4 - $1 | 0) >>> 0 <= HEAP32[16855] << 1 >>> 0 : 0) { + $$2 = $0; + return $$2 | 0; + } + $$2 = 0; + return $$2 | 0; + } + if ($4 >>> 0 >= $1 >>> 0) { + $24 = $4 - $1 | 0; + if ($24 >>> 0 <= 15) { + $$2 = $0; + return $$2 | 0; + } + $26 = $0 + $1 | 0; + HEAP32[$2 >> 2] = $3 & 1 | $1 | 2; + HEAP32[$26 + 4 >> 2] = $24 | 3; + HEAP32[$11 >> 2] = HEAP32[$11 >> 2] | 1; + _dispose_chunk($26, $24); + $$2 = $0; + return $$2 | 0; + } + if ((HEAP32[16741] | 0) == ($5 | 0)) { + $37 = (HEAP32[16738] | 0) + $4 | 0; + $39 = $37 - $1 | 0; + $40 = $0 + $1 | 0; + if ($37 >>> 0 <= $1 >>> 0) { + $$2 = 0; + return $$2 | 0; + } + HEAP32[$2 >> 2] = $3 & 1 | $1 | 2; + HEAP32[$40 + 4 >> 2] = $39 | 1; + HEAP32[16741] = $40; + HEAP32[16738] = $39; + $$2 = $0; + return $$2 | 0; + } + if ((HEAP32[16740] | 0) == ($5 | 0)) { + $49 = (HEAP32[16737] | 0) + $4 | 0; + if ($49 >>> 0 < $1 >>> 0) { + $$2 = 0; + return $$2 | 0; + } + $51 = $49 - $1 | 0; + if ($51 >>> 0 > 15) { + $53 = $0 + $1 | 0; + $54 = $0 + $49 | 0; + HEAP32[$2 >> 2] = $3 & 1 | $1 | 2; + HEAP32[$53 + 4 >> 2] = $51 | 1; + HEAP32[$54 >> 2] = $51; + $60 = $54 + 4 | 0; + HEAP32[$60 >> 2] = HEAP32[$60 >> 2] & -2; + $storemerge = $53; + $storemerge3 = $51; + } else { + HEAP32[$2 >> 2] = $3 & 1 | $49 | 2; + $67 = $0 + $49 + 4 | 0; + HEAP32[$67 >> 2] = HEAP32[$67 >> 2] | 1; + $storemerge = 0; + $storemerge3 = 0; + } + HEAP32[16737] = $storemerge3; + HEAP32[16740] = $storemerge; + $$2 = $0; + return $$2 | 0; + } + if ($12 & 2 | 0) { + $$2 = 0; + return $$2 | 0; + } + $73 = ($12 & -8) + $4 | 0; + if ($73 >>> 0 < $1 >>> 0) { + $$2 = 0; + return $$2 | 0; + } + $75 = $73 - $1 | 0; + $76 = $12 >>> 3; + L49 : do if ($12 >>> 0 >= 256) { + $101 = HEAP32[$5 + 24 >> 2] | 0; + $103 = HEAP32[$5 + 12 >> 2] | 0; + do if (($103 | 0) == ($5 | 0)) { + $114 = $5 + 16 | 0; + $115 = $114 + 4 | 0; + $116 = HEAP32[$115 >> 2] | 0; + if (!$116) { + $118 = HEAP32[$114 >> 2] | 0; + if (!$118) { + $$3 = 0; + break; + } else { + $$1271$ph = $118; + $$1274$ph = $114; + } + } else { + $$1271$ph = $116; + $$1274$ph = $115; + } + $$1271 = $$1271$ph; + $$1274 = $$1274$ph; + while (1) { + $120 = $$1271 + 20 | 0; + $121 = HEAP32[$120 >> 2] | 0; + if (!$121) { + $123 = $$1271 + 16 | 0; + $124 = HEAP32[$123 >> 2] | 0; + if (!$124) break; else { + $$1271$be = $124; + $$1274$be = $123; + } + } else { + $$1271$be = $121; + $$1274$be = $120; + } + $$1271 = $$1271$be; + $$1274 = $$1274$be; + } + if ($6 >>> 0 > $$1274 >>> 0) _abort(); else { + HEAP32[$$1274 >> 2] = 0; + $$3 = $$1271; + break; + } + } else { + $106 = HEAP32[$5 + 8 >> 2] | 0; + if ($6 >>> 0 > $106 >>> 0) _abort(); + $108 = $106 + 12 | 0; + if ((HEAP32[$108 >> 2] | 0) != ($5 | 0)) _abort(); + $111 = $103 + 8 | 0; + if ((HEAP32[$111 >> 2] | 0) == ($5 | 0)) { + HEAP32[$108 >> 2] = $103; + HEAP32[$111 >> 2] = $106; + $$3 = $103; + break; + } else _abort(); + } while (0); + if ($101 | 0) { + $129 = HEAP32[$5 + 28 >> 2] | 0; + $130 = 67244 + ($129 << 2) | 0; + do if ((HEAP32[$130 >> 2] | 0) == ($5 | 0)) { + HEAP32[$130 >> 2] = $$3; + if (!$$3) { + HEAP32[16736] = HEAP32[16736] & ~(1 << $129); + break L49; + } + } else if ((HEAP32[16739] | 0) >>> 0 <= $101 >>> 0) { + $139 = $101 + 16 | 0; + HEAP32[((HEAP32[$139 >> 2] | 0) == ($5 | 0) ? $139 : $101 + 20 | 0) >> 2] = $$3; + if (!$$3) break L49; else break; + } else _abort(); while (0); + $144 = HEAP32[16739] | 0; + if ($144 >>> 0 > $$3 >>> 0) _abort(); + HEAP32[$$3 + 24 >> 2] = $101; + $147 = $5 + 16 | 0; + $148 = HEAP32[$147 >> 2] | 0; + do if ($148 | 0) if ($144 >>> 0 > $148 >>> 0) _abort(); else { + HEAP32[$$3 + 16 >> 2] = $148; + HEAP32[$148 + 24 >> 2] = $$3; + break; + } while (0); + $154 = HEAP32[$147 + 4 >> 2] | 0; + if ($154 | 0) if ((HEAP32[16739] | 0) >>> 0 > $154 >>> 0) _abort(); else { + HEAP32[$$3 + 20 >> 2] = $154; + HEAP32[$154 + 24 >> 2] = $$3; + break; + } + } + } else { + $79 = HEAP32[$5 + 8 >> 2] | 0; + $81 = HEAP32[$5 + 12 >> 2] | 0; + $83 = 66980 + ($76 << 1 << 2) | 0; + if (($79 | 0) != ($83 | 0)) { + if ($6 >>> 0 > $79 >>> 0) _abort(); + if ((HEAP32[$79 + 12 >> 2] | 0) != ($5 | 0)) _abort(); + } + if (($81 | 0) == ($79 | 0)) { + HEAP32[16735] = HEAP32[16735] & ~(1 << $76); + break; + } + if (($81 | 0) != ($83 | 0)) { + if ($6 >>> 0 > $81 >>> 0) _abort(); + $96 = $81 + 8 | 0; + if ((HEAP32[$96 >> 2] | 0) == ($5 | 0)) $$pre$phiZ2D = $96; else _abort(); + } else $$pre$phiZ2D = $81 + 8 | 0; + HEAP32[$79 + 12 >> 2] = $81; + HEAP32[$$pre$phiZ2D >> 2] = $79; + } while (0); + if ($75 >>> 0 < 16) { + HEAP32[$2 >> 2] = $3 & 1 | $73 | 2; + $165 = $0 + $73 + 4 | 0; + HEAP32[$165 >> 2] = HEAP32[$165 >> 2] | 1; + $$2 = $0; + return $$2 | 0; + } else { + $168 = $0 + $1 | 0; + HEAP32[$2 >> 2] = $3 & 1 | $1 | 2; + HEAP32[$168 + 4 >> 2] = $75 | 3; + $175 = $0 + $73 + 4 | 0; + HEAP32[$175 >> 2] = HEAP32[$175 >> 2] | 1; + _dispose_chunk($168, $75); + $$2 = $0; + return $$2 | 0; + } + return 0; +} + +function _decode_mcu_AC_first_63($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0113 = 0, $$0118140 = 0, $$0122139 = 0, $$0131138 = 0, $$0133 = 0, $$017$i = 0, $$1119 = 0, $$1123 = 0, $$1132 = 0, $$1134 = 0, $$2 = 0, $$2117$ph = 0, $$2120 = 0, $$2124 = 0, $$4$ph = 0, $$4126$ph = 0, $$5 = 0, $$5127 = 0, $$6 = 0, $$6128 = 0, $$7 = 0, $$7129 = 0, $$8 = 0, $$8130 = 0, $100 = 0, $11 = 0, $111 = 0, $117 = 0, $128 = 0, $131 = 0, $15 = 0, $16 = 0, $2 = 0, $23 = 0, $39 = 0, $4 = 0, $40 = 0, $44 = 0, $45 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $55 = 0, $57 = 0, $59 = 0, $60 = 0, $62 = 0, $64 = 0, $66 = 0, $67 = 0, $71 = 0, $72 = 0, $76 = 0, $78 = 0, $8 = 0, $84 = 0, $88 = 0, $90 = 0, $96 = 0, $99 = 0, $trunc = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $4 = HEAP32[$0 + 468 >> 2] | 0; + $5 = $0 + 280 | 0; + if (HEAP32[$5 >> 2] | 0 ? ($8 = $4 + 44 | 0, (HEAP32[$8 >> 2] | 0) == 0) : 0) { + $11 = $4 + 16 | 0; + $15 = HEAP32[$0 + 464 >> 2] | 0; + $16 = $15 + 24 | 0; + HEAP32[$16 >> 2] = (HEAP32[$16 >> 2] | 0) + ((HEAP32[$11 >> 2] | 0) / 8 | 0); + HEAP32[$11 >> 2] = 0; + if (!(FUNCTION_TABLE_ii[HEAP32[$15 + 8 >> 2] & 127]($0) | 0)) { + $$2 = 0; + STACKTOP = sp; + return $$2 | 0; + } + $23 = $0 + 340 | 0; + if ((HEAP32[$23 >> 2] | 0) > 0) { + $$017$i = 0; + do { + HEAP32[$4 + 24 + ($$017$i << 2) >> 2] = 0; + $$017$i = $$017$i + 1 | 0; + } while (($$017$i | 0) < (HEAP32[$23 >> 2] | 0)); + } + HEAP32[$4 + 20 >> 2] = 0; + HEAP32[$8 >> 2] = HEAP32[$5 >> 2]; + if (!(HEAP32[$0 + 440 >> 2] | 0)) HEAP32[$4 + 40 >> 2] = 0; + } + if (!(HEAP32[$4 + 40 >> 2] | 0)) { + $39 = $4 + 20 | 0; + $40 = HEAP32[$39 >> 2] | 0; + if (!$40) { + HEAP32[$2 + 16 >> 2] = $0; + $44 = $0 + 24 | 0; + $45 = HEAP32[$44 >> 2] | 0; + HEAP32[$2 >> 2] = HEAP32[$45 >> 2]; + $49 = $2 + 4 | 0; + HEAP32[$49 >> 2] = HEAP32[$45 + 4 >> 2]; + $50 = $4 + 12 | 0; + $51 = HEAP32[$50 >> 2] | 0; + $52 = $4 + 16 | 0; + $53 = HEAP32[$52 >> 2] | 0; + $55 = HEAP32[$0 + 416 >> 2] | 0; + $57 = HEAP32[$0 + 424 >> 2] | 0; + $59 = HEAP32[$0 + 432 >> 2] | 0; + $60 = HEAP32[$1 >> 2] | 0; + $62 = HEAP32[$4 + 64 >> 2] | 0; + $64 = HEAP32[$0 + 412 >> 2] | 0; + L18 : do if (($64 | 0) <= ($55 | 0)) { + $66 = $2 + 8 | 0; + $67 = $2 + 12 | 0; + $$0118140 = $53; + $$0122139 = $51; + $$0131138 = $64; + L20 : while (1) { + if (($$0118140 | 0) < 8) { + if (!(_jpeg_fill_bit_buffer($2, $$0122139, $$0118140, 0) | 0)) { + $$2 = 0; + label = 36; + break; + } + $71 = HEAP32[$66 >> 2] | 0; + $72 = HEAP32[$67 >> 2] | 0; + if (($72 | 0) < 8) { + $$0113 = 1; + $$2120 = $72; + $$2124 = $71; + label = 19; + } else { + $$1119 = $72; + $$1123 = $71; + label = 17; + } + } else { + $$1119 = $$0118140; + $$1123 = $$0122139; + label = 17; + } + if ((label | 0) == 17) { + label = 0; + $76 = $$1123 >> $$1119 + -8 & 255; + $78 = HEAP32[$62 + 144 + ($76 << 2) >> 2] | 0; + if (!$78) { + $$0113 = 9; + $$2120 = $$1119; + $$2124 = $$1123; + label = 19; + } else { + $$2117$ph = HEAPU8[$62 + 1168 + $76 >> 0] | 0; + $$4$ph = $$1119 - $78 | 0; + $$4126$ph = $$1123; + } + } + if ((label | 0) == 19) { + label = 0; + $84 = _jpeg_huff_decode($2, $$2124, $$2120, $62, $$0113) | 0; + if (($84 | 0) < 0) { + $$2 = 0; + label = 36; + break; + } + $$2117$ph = $84; + $$4$ph = HEAP32[$67 >> 2] | 0; + $$4126$ph = HEAP32[$66 >> 2] | 0; + } + $trunc = $$2117$ph >>> 4; + $88 = $$2117$ph & 15; + if (!$88) { + switch ($trunc & 268435455 | 0) { + case 0: + { + $$0133 = 0; + $$8 = $$4$ph; + $$8130 = $$4126$ph; + break L18; + break; + } + case 15: + break; + default: + { + label = 27; + break L20; + } + } + $$1132 = $$0131138 + 15 | 0; + $$7 = $$4$ph; + $$7129 = $$4126$ph; + } else { + $90 = $trunc + $$0131138 | 0; + if (($$4$ph | 0) < ($88 | 0)) { + if (!(_jpeg_fill_bit_buffer($2, $$4126$ph, $$4$ph, $88) | 0)) { + $$2 = 0; + label = 36; + break; + } + $$5 = HEAP32[$67 >> 2] | 0; + $$5127 = HEAP32[$66 >> 2] | 0; + } else { + $$5 = $$4$ph; + $$5127 = $$4126$ph; + } + $96 = $$5 - $88 | 0; + $99 = HEAP32[5184 + ($88 << 2) >> 2] | 0; + $100 = $$5127 >> $96 & $99; + HEAP16[$60 + (HEAP32[$59 + ($90 << 2) >> 2] << 1) >> 1] = $100 - (($100 | 0) > (HEAP32[5184 + ($88 + -1 << 2) >> 2] | 0) ? 0 : $99) << $57; + $$1132 = $90; + $$7 = $96; + $$7129 = $$5127; + } + if (($$1132 | 0) < ($55 | 0)) { + $$0118140 = $$7; + $$0122139 = $$7129; + $$0131138 = $$1132 + 1 | 0; + } else { + $$0133 = 0; + $$8 = $$7; + $$8130 = $$7129; + break L18; + } + } + if ((label | 0) == 27) { + $111 = 1 << $trunc; + do if (($$4$ph | 0) < ($trunc | 0)) if (!(_jpeg_fill_bit_buffer($2, $$4126$ph, $$4$ph, $trunc) | 0)) { + $$2 = 0; + STACKTOP = sp; + return $$2 | 0; + } else { + $$6 = HEAP32[$67 >> 2] | 0; + $$6128 = HEAP32[$66 >> 2] | 0; + break; + } else { + $$6 = $$4$ph; + $$6128 = $$4126$ph; + } while (0); + $117 = $$6 - $trunc | 0; + $$0133 = $111 + -1 + ($$6128 >> $117 & HEAP32[5184 + ($trunc << 2) >> 2]) | 0; + $$8 = $117; + $$8130 = $$6128; + break; + } else if ((label | 0) == 36) { + STACKTOP = sp; + return $$2 | 0; + } + } else { + $$0133 = 0; + $$8 = $53; + $$8130 = $51; + } while (0); + $128 = HEAP32[$44 >> 2] | 0; + HEAP32[$128 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$128 + 4 >> 2] = HEAP32[$49 >> 2]; + HEAP32[$50 >> 2] = $$8130; + HEAP32[$52 >> 2] = $$8; + $$1134 = $$0133; + } else $$1134 = $40 + -1 | 0; + HEAP32[$39 >> 2] = $$1134; + } + $131 = $4 + 44 | 0; + HEAP32[$131 >> 2] = (HEAP32[$131 >> 2] | 0) + -1; + $$2 = 1; + STACKTOP = sp; + return $$2 | 0; +} + +function _access_virt_barray($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$$i = 0, $$$i88 = 0, $$$us$i = 0, $$$us$i81 = 0, $$05557$i91 = 0, $$05557$us$i84 = 0, $$058$i90 = 0, $$058$us$i83 = 0, $$077 = 0, $$078 = 0, $$180 = 0, $$56$i89 = 0, $$56$i92 = 0, $$56$us$i82 = 0, $$56$us$i85 = 0, $$phi$trans$insert = 0, $$pre = 0, $$pre63$i = 0, $$pre63$i74 = 0, $101 = 0, $103 = 0, $106 = 0, $108 = 0, $110 = 0, $112 = 0, $114 = 0, $117 = 0, $118 = 0, $121 = 0, $122 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0, $139 = 0, $14 = 0, $144 = 0, $145 = 0, $146 = 0, $147 = 0, $148 = 0, $17 = 0, $18 = 0, $27 = 0, $30 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $41 = 0, $42 = 0, $43 = 0, $46 = 0, $48 = 0, $5 = 0, $50 = 0, $54 = 0, $59 = 0, $6 = 0, $61 = 0, $64 = 0, $66 = 0, $68 = 0, $70 = 0, $72 = 0, $77 = 0, $81 = 0, $82 = 0, $84 = 0, $85 = 0, $88 = 0, $90 = 0, $92 = 0, $96 = 0, $storemerge = 0, label = 0; + $5 = $3 + $2 | 0; + $6 = $1 + 4 | 0; + if (($5 >>> 0 <= (HEAP32[$6 >> 2] | 0) >>> 0 ? (HEAP32[$1 + 12 >> 2] | 0) >>> 0 >= $3 >>> 0 : 0) ? (HEAP32[$1 >> 2] | 0) != 0 : 0) {} else { + $14 = HEAP32[$0 >> 2] | 0; + HEAP32[$14 + 20 >> 2] = 23; + FUNCTION_TABLE_vi[HEAP32[$14 >> 2] & 255]($0); + } + $17 = $1 + 24 | 0; + $18 = HEAP32[$17 >> 2] | 0; + if ($18 >>> 0 <= $2 >>> 0 ? $5 >>> 0 <= ((HEAP32[$1 + 16 >> 2] | 0) + $18 | 0) >>> 0 : 0) {} else label = 7; + L9 : do if ((label | 0) == 7) { + if (!(HEAP32[$1 + 40 >> 2] | 0)) { + $27 = HEAP32[$0 >> 2] | 0; + HEAP32[$27 + 20 >> 2] = 71; + FUNCTION_TABLE_vi[HEAP32[$27 >> 2] & 255]($0); + } + $30 = $1 + 36 | 0; + if (HEAP32[$30 >> 2] | 0) { + $35 = HEAP32[$1 + 8 >> 2] << 7; + $36 = HEAP32[$17 >> 2] | 0; + $37 = $1 + 20 | 0; + $38 = $1 + 16 | 0; + $39 = HEAP32[$38 >> 2] | 0; + L16 : do if (($39 | 0) > 0 ? ($41 = $1 + 28 | 0, $42 = $1 + 48 | 0, $43 = $1 + 52 | 0, $$pre63$i = HEAP32[$37 >> 2] | 0, $$$i88 = ($$pre63$i | 0) < ($39 | 0) ? $$pre63$i : $39, $46 = (HEAP32[$41 >> 2] | 0) - $36 | 0, $48 = ($$$i88 | 0) < ($46 | 0) ? $$$i88 : $46, $50 = (HEAP32[$6 >> 2] | 0) - $36 | 0, $$56$i89 = ($48 | 0) < ($50 | 0) ? $48 : $50, ($$56$i89 | 0) >= 1) : 0) { + $$05557$i91 = Math_imul($36, $35) | 0; + $$058$i90 = 0; + $$56$i92 = $$56$i89; + while (1) { + $54 = Math_imul($$56$i92, $35) | 0; + FUNCTION_TABLE_viiiii[HEAP32[$43 >> 2] & 63]($0, $42, HEAP32[(HEAP32[$1 >> 2] | 0) + ($$058$i90 << 2) >> 2] | 0, $$05557$i91, $54); + $59 = HEAP32[$37 >> 2] | 0; + $$058$i90 = $59 + $$058$i90 | 0; + $61 = HEAP32[$38 >> 2] | 0; + if (($61 | 0) <= ($$058$i90 | 0)) break L16; + $64 = $61 - $$058$i90 | 0; + $$$i = ($59 | 0) < ($64 | 0) ? $59 : $64; + $66 = $$058$i90 + (HEAP32[$17 >> 2] | 0) | 0; + $68 = (HEAP32[$41 >> 2] | 0) - $66 | 0; + $70 = ($$$i | 0) < ($68 | 0) ? $$$i : $68; + $72 = (HEAP32[$6 >> 2] | 0) - $66 | 0; + $$56$i92 = ($70 | 0) < ($72 | 0) ? $70 : $72; + if (($$56$i92 | 0) < 1) break; else $$05557$i91 = $54 + $$05557$i91 | 0; + } + } while (0); + HEAP32[$30 >> 2] = 0; + } + $$phi$trans$insert = $1 + 16 | 0; + $$pre = HEAP32[$$phi$trans$insert >> 2] | 0; + if ((HEAP32[$17 >> 2] | 0) >>> 0 < $2 >>> 0) $storemerge = $2; else { + $77 = $5 - $$pre | 0; + $storemerge = ($77 | 0) > 0 ? $77 : 0; + } + HEAP32[$17 >> 2] = $storemerge; + $81 = HEAP32[$1 + 8 >> 2] << 7; + $82 = $1 + 20 | 0; + if (($$pre | 0) > 0 ? ($84 = $1 + 28 | 0, $85 = $1 + 48 | 0, $$pre63$i74 = HEAP32[$82 >> 2] | 0, $$$us$i81 = ($$pre63$i74 | 0) < ($$pre | 0) ? $$pre63$i74 : $$pre, $88 = (HEAP32[$84 >> 2] | 0) - $storemerge | 0, $90 = ($$$us$i81 | 0) < ($88 | 0) ? $$$us$i81 : $88, $92 = (HEAP32[$6 >> 2] | 0) - $storemerge | 0, $$56$us$i82 = ($90 | 0) < ($92 | 0) ? $90 : $92, ($$56$us$i82 | 0) >= 1) : 0) { + $$05557$us$i84 = Math_imul($81, $storemerge) | 0; + $$058$us$i83 = 0; + $$56$us$i85 = $$56$us$i82; + while (1) { + $96 = Math_imul($$56$us$i85, $81) | 0; + FUNCTION_TABLE_viiiii[HEAP32[$85 >> 2] & 63]($0, $85, HEAP32[(HEAP32[$1 >> 2] | 0) + ($$058$us$i83 << 2) >> 2] | 0, $$05557$us$i84, $96); + $101 = HEAP32[$82 >> 2] | 0; + $$058$us$i83 = $101 + $$058$us$i83 | 0; + $103 = HEAP32[$$phi$trans$insert >> 2] | 0; + if (($103 | 0) <= ($$058$us$i83 | 0)) break L9; + $106 = $103 - $$058$us$i83 | 0; + $$$us$i = ($101 | 0) < ($106 | 0) ? $101 : $106; + $108 = $$058$us$i83 + (HEAP32[$17 >> 2] | 0) | 0; + $110 = (HEAP32[$84 >> 2] | 0) - $108 | 0; + $112 = ($$$us$i | 0) < ($110 | 0) ? $$$us$i : $110; + $114 = (HEAP32[$6 >> 2] | 0) - $108 | 0; + $$56$us$i85 = ($112 | 0) < ($114 | 0) ? $112 : $114; + if (($$56$us$i85 | 0) < 1) break; else $$05557$us$i84 = $96 + $$05557$us$i84 | 0; + } + } + } while (0); + $117 = $1 + 28 | 0; + $118 = HEAP32[$117 >> 2] | 0; + do if ($118 >>> 0 < $5 >>> 0) { + $121 = ($4 | 0) == 0; + if ($118 >>> 0 < $2 >>> 0) if ($121) { + $$077 = $2; + $148 = 0; + } else { + $122 = HEAP32[$0 >> 2] | 0; + HEAP32[$122 + 20 >> 2] = 23; + FUNCTION_TABLE_vi[HEAP32[$122 >> 2] & 255]($0); + $$078 = $2; + label = 28; + } else if ($121) { + $$077 = $118; + $148 = 0; + } else { + $$078 = $118; + label = 28; + } + if ((label | 0) == 28) { + HEAP32[$117 >> 2] = $5; + $$077 = $$078; + $148 = 1; + } + if (!(HEAP32[$1 + 32 >> 2] | 0)) { + if ($148) break; + $139 = HEAP32[$0 >> 2] | 0; + HEAP32[$139 + 20 >> 2] = 23; + FUNCTION_TABLE_vi[HEAP32[$139 >> 2] & 255]($0); + break; + } + $130 = HEAP32[$1 + 8 >> 2] << 7; + $131 = HEAP32[$17 >> 2] | 0; + $132 = $$077 - $131 | 0; + $133 = $5 - $131 | 0; + if ($132 >>> 0 < $133 >>> 0) { + $$180 = $132; + do { + _memset(HEAP32[(HEAP32[$1 >> 2] | 0) + ($$180 << 2) >> 2] | 0, 0, $130 | 0) | 0; + $$180 = $$180 + 1 | 0; + } while (($$180 | 0) != ($133 | 0)); + } + } while (0); + if (!$4) { + $144 = HEAP32[$1 >> 2] | 0; + $145 = HEAP32[$17 >> 2] | 0; + $146 = $2 - $145 | 0; + $147 = $144 + ($146 << 2) | 0; + return $147 | 0; + } + HEAP32[$1 + 36 >> 2] = 1; + $144 = HEAP32[$1 >> 2] | 0; + $145 = HEAP32[$17 >> 2] | 0; + $146 = $2 - $145 | 0; + $147 = $144 + ($146 << 2) | 0; + return $147 | 0; +} + +function _access_virt_sarray($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$$i = 0, $$$i88 = 0, $$$us$i = 0, $$$us$i81 = 0, $$05557$i91 = 0, $$05557$us$i84 = 0, $$058$i90 = 0, $$058$us$i83 = 0, $$077 = 0, $$078 = 0, $$180 = 0, $$56$i89 = 0, $$56$i92 = 0, $$56$us$i82 = 0, $$56$us$i85 = 0, $$phi$trans$insert = 0, $$pre = 0, $$pre63$i = 0, $$pre63$i74 = 0, $101 = 0, $104 = 0, $106 = 0, $108 = 0, $110 = 0, $112 = 0, $115 = 0, $116 = 0, $119 = 0, $120 = 0, $127 = 0, $128 = 0, $129 = 0, $130 = 0, $136 = 0, $14 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $17 = 0, $18 = 0, $27 = 0, $30 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $40 = 0, $41 = 0, $42 = 0, $45 = 0, $47 = 0, $49 = 0, $5 = 0, $53 = 0, $58 = 0, $6 = 0, $60 = 0, $63 = 0, $65 = 0, $67 = 0, $69 = 0, $71 = 0, $76 = 0, $79 = 0, $80 = 0, $82 = 0, $83 = 0, $86 = 0, $88 = 0, $90 = 0, $94 = 0, $99 = 0, $storemerge = 0, label = 0; + $5 = $3 + $2 | 0; + $6 = $1 + 4 | 0; + if (($5 >>> 0 <= (HEAP32[$6 >> 2] | 0) >>> 0 ? (HEAP32[$1 + 12 >> 2] | 0) >>> 0 >= $3 >>> 0 : 0) ? (HEAP32[$1 >> 2] | 0) != 0 : 0) {} else { + $14 = HEAP32[$0 >> 2] | 0; + HEAP32[$14 + 20 >> 2] = 23; + FUNCTION_TABLE_vi[HEAP32[$14 >> 2] & 255]($0); + } + $17 = $1 + 24 | 0; + $18 = HEAP32[$17 >> 2] | 0; + if ($18 >>> 0 <= $2 >>> 0 ? $5 >>> 0 <= ((HEAP32[$1 + 16 >> 2] | 0) + $18 | 0) >>> 0 : 0) {} else label = 7; + L9 : do if ((label | 0) == 7) { + if (!(HEAP32[$1 + 40 >> 2] | 0)) { + $27 = HEAP32[$0 >> 2] | 0; + HEAP32[$27 + 20 >> 2] = 71; + FUNCTION_TABLE_vi[HEAP32[$27 >> 2] & 255]($0); + } + $30 = $1 + 36 | 0; + if (HEAP32[$30 >> 2] | 0) { + $34 = HEAP32[$1 + 8 >> 2] | 0; + $35 = HEAP32[$17 >> 2] | 0; + $36 = $1 + 20 | 0; + $37 = $1 + 16 | 0; + $38 = HEAP32[$37 >> 2] | 0; + L16 : do if (($38 | 0) > 0 ? ($40 = $1 + 28 | 0, $41 = $1 + 48 | 0, $42 = $1 + 52 | 0, $$pre63$i = HEAP32[$36 >> 2] | 0, $$$i88 = ($$pre63$i | 0) < ($38 | 0) ? $$pre63$i : $38, $45 = (HEAP32[$40 >> 2] | 0) - $35 | 0, $47 = ($$$i88 | 0) < ($45 | 0) ? $$$i88 : $45, $49 = (HEAP32[$6 >> 2] | 0) - $35 | 0, $$56$i89 = ($47 | 0) < ($49 | 0) ? $47 : $49, ($$56$i89 | 0) >= 1) : 0) { + $$05557$i91 = Math_imul($35, $34) | 0; + $$058$i90 = 0; + $$56$i92 = $$56$i89; + while (1) { + $53 = Math_imul($$56$i92, $34) | 0; + FUNCTION_TABLE_viiiii[HEAP32[$42 >> 2] & 63]($0, $41, HEAP32[(HEAP32[$1 >> 2] | 0) + ($$058$i90 << 2) >> 2] | 0, $$05557$i91, $53); + $58 = HEAP32[$36 >> 2] | 0; + $$058$i90 = $58 + $$058$i90 | 0; + $60 = HEAP32[$37 >> 2] | 0; + if (($60 | 0) <= ($$058$i90 | 0)) break L16; + $63 = $60 - $$058$i90 | 0; + $$$i = ($58 | 0) < ($63 | 0) ? $58 : $63; + $65 = $$058$i90 + (HEAP32[$17 >> 2] | 0) | 0; + $67 = (HEAP32[$40 >> 2] | 0) - $65 | 0; + $69 = ($$$i | 0) < ($67 | 0) ? $$$i : $67; + $71 = (HEAP32[$6 >> 2] | 0) - $65 | 0; + $$56$i92 = ($69 | 0) < ($71 | 0) ? $69 : $71; + if (($$56$i92 | 0) < 1) break; else $$05557$i91 = $53 + $$05557$i91 | 0; + } + } while (0); + HEAP32[$30 >> 2] = 0; + } + $$phi$trans$insert = $1 + 16 | 0; + $$pre = HEAP32[$$phi$trans$insert >> 2] | 0; + if ((HEAP32[$17 >> 2] | 0) >>> 0 < $2 >>> 0) $storemerge = $2; else { + $76 = $5 - $$pre | 0; + $storemerge = ($76 | 0) > 0 ? $76 : 0; + } + HEAP32[$17 >> 2] = $storemerge; + $79 = HEAP32[$1 + 8 >> 2] | 0; + $80 = $1 + 20 | 0; + if (($$pre | 0) > 0 ? ($82 = $1 + 28 | 0, $83 = $1 + 48 | 0, $$pre63$i74 = HEAP32[$80 >> 2] | 0, $$$us$i81 = ($$pre63$i74 | 0) < ($$pre | 0) ? $$pre63$i74 : $$pre, $86 = (HEAP32[$82 >> 2] | 0) - $storemerge | 0, $88 = ($$$us$i81 | 0) < ($86 | 0) ? $$$us$i81 : $86, $90 = (HEAP32[$6 >> 2] | 0) - $storemerge | 0, $$56$us$i82 = ($88 | 0) < ($90 | 0) ? $88 : $90, ($$56$us$i82 | 0) >= 1) : 0) { + $$05557$us$i84 = Math_imul($79, $storemerge) | 0; + $$058$us$i83 = 0; + $$56$us$i85 = $$56$us$i82; + while (1) { + $94 = Math_imul($$56$us$i85, $79) | 0; + FUNCTION_TABLE_viiiii[HEAP32[$83 >> 2] & 63]($0, $83, HEAP32[(HEAP32[$1 >> 2] | 0) + ($$058$us$i83 << 2) >> 2] | 0, $$05557$us$i84, $94); + $99 = HEAP32[$80 >> 2] | 0; + $$058$us$i83 = $99 + $$058$us$i83 | 0; + $101 = HEAP32[$$phi$trans$insert >> 2] | 0; + if (($101 | 0) <= ($$058$us$i83 | 0)) break L9; + $104 = $101 - $$058$us$i83 | 0; + $$$us$i = ($99 | 0) < ($104 | 0) ? $99 : $104; + $106 = $$058$us$i83 + (HEAP32[$17 >> 2] | 0) | 0; + $108 = (HEAP32[$82 >> 2] | 0) - $106 | 0; + $110 = ($$$us$i | 0) < ($108 | 0) ? $$$us$i : $108; + $112 = (HEAP32[$6 >> 2] | 0) - $106 | 0; + $$56$us$i85 = ($110 | 0) < ($112 | 0) ? $110 : $112; + if (($$56$us$i85 | 0) < 1) break; else $$05557$us$i84 = $94 + $$05557$us$i84 | 0; + } + } + } while (0); + $115 = $1 + 28 | 0; + $116 = HEAP32[$115 >> 2] | 0; + do if ($116 >>> 0 < $5 >>> 0) { + $119 = ($4 | 0) == 0; + if ($116 >>> 0 < $2 >>> 0) if ($119) { + $$077 = $2; + $145 = 0; + } else { + $120 = HEAP32[$0 >> 2] | 0; + HEAP32[$120 + 20 >> 2] = 23; + FUNCTION_TABLE_vi[HEAP32[$120 >> 2] & 255]($0); + $$078 = $2; + label = 28; + } else if ($119) { + $$077 = $116; + $145 = 0; + } else { + $$078 = $116; + label = 28; + } + if ((label | 0) == 28) { + HEAP32[$115 >> 2] = $5; + $$077 = $$078; + $145 = 1; + } + if (!(HEAP32[$1 + 32 >> 2] | 0)) { + if ($145) break; + $136 = HEAP32[$0 >> 2] | 0; + HEAP32[$136 + 20 >> 2] = 23; + FUNCTION_TABLE_vi[HEAP32[$136 >> 2] & 255]($0); + break; + } + $127 = HEAP32[$1 + 8 >> 2] | 0; + $128 = HEAP32[$17 >> 2] | 0; + $129 = $$077 - $128 | 0; + $130 = $5 - $128 | 0; + if ($129 >>> 0 < $130 >>> 0) { + $$180 = $129; + do { + _memset(HEAP32[(HEAP32[$1 >> 2] | 0) + ($$180 << 2) >> 2] | 0, 0, $127 | 0) | 0; + $$180 = $$180 + 1 | 0; + } while (($$180 | 0) != ($130 | 0)); + } + } while (0); + if (!$4) { + $141 = HEAP32[$1 >> 2] | 0; + $142 = HEAP32[$17 >> 2] | 0; + $143 = $2 - $142 | 0; + $144 = $141 + ($143 << 2) | 0; + return $144 | 0; + } + HEAP32[$1 + 36 >> 2] = 1; + $141 = HEAP32[$1 >> 2] | 0; + $142 = HEAP32[$17 >> 2] | 0; + $143 = $2 - $142 | 0; + $144 = $141 + ($143 << 2) | 0; + return $144 | 0; +} + +function _extractVisibleFeatures_171($cparamLT, $trans1, $surfaceSet, $candidate, $candidate2) { + $cparamLT = $cparamLT | 0; + $trans1 = $trans1 | 0; + $surfaceSet = $surfaceSet | 0; + $candidate = $candidate | 0; + $candidate2 = $candidate2 | 0; + var $12 = 0.0, $13 = 0.0, $18 = 0, $19 = 0.0, $21 = 0.0, $29 = 0.0, $33 = 0.0, $36 = 0, $37 = 0.0, $4 = 0, $6 = 0, $7 = 0, $9 = 0, $add119 = 0.0, $add65 = 0.0, $add92 = 0.0, $arrayidx106 = 0, $arrayidx118 = 0, $arrayidx139 = 0, $arrayidx143 = 0, $arrayidx148 = 0, $arrayidx170 = 0, $arrayidx175 = 0, $arrayidx53 = 0, $arrayidx64 = 0, $arrayidx68 = 0, $arrayidx79 = 0, $arrayidx91 = 0, $arrayidx95 = 0, $cmp33 = 0, $conv = 0.0, $conv39 = 0.0, $flag228 = 0, $flag248$sink = 0, $i$0 = 0, $j$0 = 0, $j$1 = 0, $k$0 = 0, $k$1 = 0, $l$0 = 0, $l$1 = 0, $l$2 = 0, $l$3 = 0, $l2$0 = 0, $l2$1 = 0, $l2$2 = 0, $l2$3 = 0, $num = 0, $sx = 0, $sy = 0, $trans2 = 0, $vararg_buffer = 0, $w = 0, $wpos = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 80 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(80); + $vararg_buffer = sp + 48 | 0; + $trans2 = sp; + $sx = sp + 76 | 0; + $sy = sp + 72 | 0; + $wpos = sp + 64 | 0; + $w = sp + 56 | 0; + $num = $surfaceSet + 4 | 0; + $conv = +(HEAP32[$cparamLT >> 2] | 0); + $conv39 = +(HEAP32[$cparamLT + 4 >> 2] | 0); + $arrayidx53 = $trans2 + 4 | 0; + $arrayidx64 = $trans2 + 12 | 0; + $arrayidx68 = $trans2 + 16 | 0; + $arrayidx79 = $trans2 + 20 | 0; + $arrayidx91 = $trans2 + 28 | 0; + $arrayidx95 = $trans2 + 32 | 0; + $arrayidx106 = $trans2 + 36 | 0; + $arrayidx118 = $trans2 + 44 | 0; + $arrayidx139 = $trans2 + 8 | 0; + $arrayidx143 = $trans2 + 24 | 0; + $arrayidx148 = $trans2 + 40 | 0; + $arrayidx170 = $wpos + 4 | 0; + $arrayidx175 = $w + 4 | 0; + $flag228 = $candidate2 + 4812 | 0; + $i$0 = 0; + $l$0 = 0; + $l2$0 = 0; + L1 : while (1) { + if (($i$0 | 0) >= (HEAP32[$num >> 2] | 0)) { + label = 29; + break; + } + $j$0 = 0; + while (1) { + if (($j$0 | 0) == 3) break; + $k$0 = 0; + while (1) { + if (($k$0 | 0) == 4) break; + HEAP32[$trans2 + ($j$0 << 4) + ($k$0 << 2) >> 2] = HEAP32[$trans1 + ($i$0 * 48 | 0) + ($j$0 << 4) + ($k$0 << 2) >> 2]; + $k$0 = $k$0 + 1 | 0; + } + $j$0 = $j$0 + 1 | 0; + } + $4 = HEAP32[(HEAP32[$surfaceSet >> 2] | 0) + ($i$0 * 112 | 0) + 4 >> 2] | 0; + $j$1 = 0; + $l$1 = $l$0; + $l2$1 = $l2$0; + while (1) { + if (($j$1 | 0) >= (HEAP32[$4 + 4 >> 2] | 0)) break; + $7 = $4; + $k$1 = 0; + $l$2 = $l$1; + $l2$2 = $l2$1; + while (1) { + $6 = HEAP32[$7 >> 2] | 0; + if (($k$1 | 0) >= (HEAP32[$6 + ($j$1 * 20 | 0) + 4 >> 2] | 0)) break; + $9 = HEAP32[$6 + ($j$1 * 20 | 0) >> 2] | 0; + $cmp33 = (_ar2MarkerCoord2ScreenCoord2($cparamLT, $trans2, +HEAPF32[$9 + ($k$1 * 20 | 0) + 8 >> 2], +HEAPF32[$9 + ($k$1 * 20 | 0) + 12 >> 2], $sx, $sy) | 0) < 0; + $12 = +HEAPF32[$sx >> 2]; + do if ((!($cmp33 | $12 < 0.0) ? ($13 = +HEAPF32[$sy >> 2], !($13 >= $conv39) & (!($12 >= $conv) & !($13 < 0.0))) : 0) ? ($18 = HEAP32[(HEAP32[HEAP32[(HEAP32[$surfaceSet >> 2] | 0) + ($i$0 * 112 | 0) + 4 >> 2] >> 2] | 0) + ($j$1 * 20 | 0) >> 2] | 0, $19 = +HEAPF32[$18 + ($k$1 * 20 | 0) + 8 >> 2], $21 = +HEAPF32[$18 + ($k$1 * 20 | 0) + 12 >> 2], $add65 = +HEAPF32[$arrayidx64 >> 2] + (+HEAPF32[$trans2 >> 2] * $19 + +HEAPF32[$arrayidx53 >> 2] * $21), $add92 = +HEAPF32[$arrayidx91 >> 2] + ($19 * +HEAPF32[$arrayidx68 >> 2] + $21 * +HEAPF32[$arrayidx79 >> 2]), $add119 = +HEAPF32[$arrayidx118 >> 2] + ($19 * +HEAPF32[$arrayidx95 >> 2] + $21 * +HEAPF32[$arrayidx106 >> 2]), $29 = +Math_sqrt(+($add65 * $add65 + $add92 * $add92 + $add119 * $add119)), !(+HEAPF32[$arrayidx148 >> 2] * ($add119 / $29) + (+HEAPF32[$arrayidx139 >> 2] * ($add65 / $29) + +HEAPF32[$arrayidx143 >> 2] * ($add92 / $29)) > -.10000000149011612)) : 0) { + HEAPF32[$wpos >> 2] = $19; + HEAPF32[$arrayidx170 >> 2] = $21; + _ar2GetResolution($cparamLT, $trans2, $wpos, $w) | 0; + $33 = +HEAPF32[$arrayidx175 >> 2]; + $36 = HEAP32[HEAP32[(HEAP32[$surfaceSet >> 2] | 0) + ($i$0 * 112 | 0) + 4 >> 2] >> 2] | 0; + $37 = +HEAPF32[$36 + ($j$1 * 20 | 0) + 12 >> 2]; + if ($33 <= $37 ? $33 >= +HEAPF32[$36 + ($j$1 * 20 | 0) + 16 >> 2] : 0) { + if (($l$2 | 0) == 200) { + label = 19; + break L1; + } + HEAP32[$candidate + ($l$2 * 24 | 0) >> 2] = $i$0; + HEAP32[$candidate + ($l$2 * 24 | 0) + 4 >> 2] = $j$1; + HEAP32[$candidate + ($l$2 * 24 | 0) + 8 >> 2] = $k$1; + HEAP32[$candidate + ($l$2 * 24 | 0) + 16 >> 2] = HEAP32[$sx >> 2]; + HEAP32[$candidate + ($l$2 * 24 | 0) + 20 >> 2] = HEAP32[$sy >> 2]; + HEAP32[$candidate + ($l$2 * 24 | 0) + 12 >> 2] = 0; + $l$3 = $l$2 + 1 | 0; + $l2$3 = $l2$2; + break; + } + if ($33 <= $37 * 2.0 ? $33 >= +HEAPF32[$36 + ($j$1 * 20 | 0) + 16 >> 2] * .5 : 0) if (($l2$2 | 0) == 200) { + HEAP32[$flag228 >> 2] = -1; + $l$3 = $l$2; + $l2$3 = 200; + break; + } else { + HEAP32[$candidate2 + ($l2$2 * 24 | 0) >> 2] = $i$0; + HEAP32[$candidate2 + ($l2$2 * 24 | 0) + 4 >> 2] = $j$1; + HEAP32[$candidate2 + ($l2$2 * 24 | 0) + 8 >> 2] = $k$1; + HEAP32[$candidate2 + ($l2$2 * 24 | 0) + 16 >> 2] = HEAP32[$sx >> 2]; + HEAP32[$candidate2 + ($l2$2 * 24 | 0) + 20 >> 2] = HEAP32[$sy >> 2]; + HEAP32[$candidate2 + ($l2$2 * 24 | 0) + 12 >> 2] = 0; + $l$3 = $l$2; + $l2$3 = $l2$2 + 1 | 0; + break; + } else { + $l$3 = $l$2; + $l2$3 = $l2$2; + } + } else { + $l$3 = $l$2; + $l2$3 = $l2$2; + } while (0); + $7 = HEAP32[(HEAP32[$surfaceSet >> 2] | 0) + ($i$0 * 112 | 0) + 4 >> 2] | 0; + $k$1 = $k$1 + 1 | 0; + $l$2 = $l$3; + $l2$2 = $l2$3; + } + $4 = $7; + $j$1 = $j$1 + 1 | 0; + $l$1 = $l$2; + $l2$1 = $l2$2; + } + $i$0 = $i$0 + 1 | 0; + $l$0 = $l$1; + $l2$0 = $l2$1; + } + if ((label | 0) == 19) { + _arLog(0, 3, 45962, $vararg_buffer); + $flag248$sink = $candidate + 4812 | 0; + } else if ((label | 0) == 29) { + HEAP32[$candidate + ($l$0 * 24 | 0) + 12 >> 2] = -1; + $flag248$sink = $candidate2 + ($l2$0 * 24 | 0) + 12 | 0; + } + HEAP32[$flag248$sink >> 2] = -1; + STACKTOP = sp; + return; +} + +function _jpeg_idct_ifast($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0269282 = 0, $$0271281 = 0, $$0273280 = 0, $$0283 = 0, $$1279 = 0, $$2278 = 0, $$sink = 0, $$sink290 = 0, $105 = 0, $11 = 0, $112 = 0, $113 = 0, $114 = 0, $13 = 0, $132 = 0, $135 = 0, $137 = 0, $139 = 0, $141 = 0, $162 = 0, $165 = 0, $166 = 0, $167 = 0, $169 = 0, $170 = 0, $171 = 0, $175 = 0, $176 = 0, $177 = 0, $178 = 0, $179 = 0, $181 = 0, $183 = 0, $184 = 0, $185 = 0, $187 = 0, $188 = 0, $189 = 0, $190 = 0, $196 = 0, $203 = 0, $204 = 0, $205 = 0, $34 = 0, $44 = 0, $46 = 0, $49 = 0, $5 = 0, $55 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $76 = 0, $82 = 0, $88 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 256 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(256); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0269282 = $5; + $$0271281 = HEAP32[$1 + 84 >> 2] | 0; + $$0273280 = $2; + $$0283 = 8; + while (1) { + $11 = HEAP16[$$0273280 + 16 >> 1] | 0; + $13 = HEAP16[$$0273280 + 32 >> 1] | 0; + if (!(($11 | $13) << 16 >> 16)) if (((((HEAP16[$$0273280 + 48 >> 1] | 0) == 0 ? (HEAP16[$$0273280 + 64 >> 1] | 0) == 0 : 0) ? (HEAP16[$$0273280 + 80 >> 1] | 0) == 0 : 0) ? (HEAP16[$$0273280 + 96 >> 1] | 0) == 0 : 0) ? (HEAP16[$$0273280 + 112 >> 1] | 0) == 0 : 0) { + $34 = Math_imul(HEAP32[$$0271281 >> 2] | 0, HEAP16[$$0273280 >> 1] | 0) | 0; + HEAP32[$$0269282 >> 2] = $34; + HEAP32[$$0269282 + 32 >> 2] = $34; + HEAP32[$$0269282 + 64 >> 2] = $34; + HEAP32[$$0269282 + 96 >> 2] = $34; + HEAP32[$$0269282 + 128 >> 2] = $34; + HEAP32[$$0269282 + 160 >> 2] = $34; + HEAP32[$$0269282 + 192 >> 2] = $34; + $$sink = $34; + $$sink290 = 56; + } else { + $46 = 0; + label = 9; + } else { + $46 = $13; + label = 9; + } + if ((label | 0) == 9) { + label = 0; + $44 = Math_imul(HEAP32[$$0271281 >> 2] | 0, HEAP16[$$0273280 >> 1] | 0) | 0; + $49 = Math_imul(HEAP32[$$0271281 + 64 >> 2] | 0, $46 << 16 >> 16) | 0; + $55 = Math_imul(HEAP32[$$0271281 + 128 >> 2] | 0, HEAP16[$$0273280 + 64 >> 1] | 0) | 0; + $61 = Math_imul(HEAP32[$$0271281 + 192 >> 2] | 0, HEAP16[$$0273280 + 96 >> 1] | 0) | 0; + $62 = $55 + $44 | 0; + $63 = $44 - $55 | 0; + $64 = $61 + $49 | 0; + $68 = (($49 - $61 | 0) * 362 >> 8) - $64 | 0; + $69 = $64 + $62 | 0; + $70 = $62 - $64 | 0; + $71 = $68 + $63 | 0; + $72 = $63 - $68 | 0; + $76 = Math_imul(HEAP32[$$0271281 + 32 >> 2] | 0, $11 << 16 >> 16) | 0; + $82 = Math_imul(HEAP32[$$0271281 + 96 >> 2] | 0, HEAP16[$$0273280 + 48 >> 1] | 0) | 0; + $88 = Math_imul(HEAP32[$$0271281 + 160 >> 2] | 0, HEAP16[$$0273280 + 80 >> 1] | 0) | 0; + $94 = Math_imul(HEAP32[$$0271281 + 224 >> 2] | 0, HEAP16[$$0273280 + 112 >> 1] | 0) | 0; + $95 = $88 + $82 | 0; + $96 = $88 - $82 | 0; + $97 = $94 + $76 | 0; + $98 = $76 - $94 | 0; + $99 = $97 + $95 | 0; + $105 = ($98 + $96 | 0) * 473 >> 8; + $112 = $105 - ($96 * 669 >> 8) - $99 | 0; + $113 = (($97 - $95 | 0) * 362 >> 8) - $112 | 0; + $114 = $105 - ($98 * 277 >> 8) - $113 | 0; + HEAP32[$$0269282 >> 2] = $99 + $69; + HEAP32[$$0269282 + 224 >> 2] = $69 - $99; + HEAP32[$$0269282 + 32 >> 2] = $112 + $71; + HEAP32[$$0269282 + 192 >> 2] = $71 - $112; + HEAP32[$$0269282 + 64 >> 2] = $113 + $72; + HEAP32[$$0269282 + 160 >> 2] = $72 - $113; + HEAP32[$$0269282 + 96 >> 2] = $114 + $70; + $$sink = $70 - $114 | 0; + $$sink290 = 32; + } + HEAP32[$$0269282 + ($$sink290 << 2) >> 2] = $$sink; + if ($$0283 >>> 0 > 1) { + $$0269282 = $$0269282 + 4 | 0; + $$0271281 = $$0271281 + 4 | 0; + $$0273280 = $$0273280 + 2 | 0; + $$0283 = $$0283 + -1 | 0; + } else break; + } + $132 = $7 + -384 | 0; + $$1279 = 0; + $$2278 = $5; + while (1) { + $135 = (HEAP32[$3 + ($$1279 << 2) >> 2] | 0) + $4 | 0; + $137 = (HEAP32[$$2278 >> 2] | 0) + 16400 | 0; + $139 = HEAP32[$$2278 + 4 >> 2] | 0; + $141 = HEAP32[$$2278 + 8 >> 2] | 0; + if (!($139 | $141)) if (((((HEAP32[$$2278 + 12 >> 2] | 0) == 0 ? (HEAP32[$$2278 + 16 >> 2] | 0) == 0 : 0) ? (HEAP32[$$2278 + 20 >> 2] | 0) == 0 : 0) ? (HEAP32[$$2278 + 24 >> 2] | 0) == 0 : 0) ? (HEAP32[$$2278 + 28 >> 2] | 0) == 0 : 0) { + $162 = HEAP8[$132 + ($137 >>> 5 & 1023) >> 0] | 0; + HEAP8[$135 >> 0] = $162; + _memset($135 + 1 | 0, $162 | 0, 7) | 0; + } else { + $171 = 0; + label = 19; + } else { + $171 = $141; + label = 19; + } + if ((label | 0) == 19) { + label = 0; + $165 = HEAP32[$$2278 + 16 >> 2] | 0; + $166 = $165 + $137 | 0; + $167 = $137 - $165 | 0; + $169 = HEAP32[$$2278 + 24 >> 2] | 0; + $170 = $169 + $171 | 0; + $175 = (($171 - $169 | 0) * 362 >> 8) - $170 | 0; + $176 = $170 + $166 | 0; + $177 = $166 - $170 | 0; + $178 = $175 + $167 | 0; + $179 = $167 - $175 | 0; + $181 = HEAP32[$$2278 + 20 >> 2] | 0; + $183 = HEAP32[$$2278 + 12 >> 2] | 0; + $184 = $183 + $181 | 0; + $185 = $181 - $183 | 0; + $187 = HEAP32[$$2278 + 28 >> 2] | 0; + $188 = $187 + $139 | 0; + $189 = $139 - $187 | 0; + $190 = $188 + $184 | 0; + $196 = ($189 + $185 | 0) * 473 >> 8; + $203 = $196 - ($185 * 669 >> 8) - $190 | 0; + $204 = (($188 - $184 | 0) * 362 >> 8) - $203 | 0; + $205 = $196 - ($189 * 277 >> 8) - $204 | 0; + HEAP8[$135 >> 0] = HEAP8[$132 + (($190 + $176 | 0) >>> 5 & 1023) >> 0] | 0; + HEAP8[$135 + 7 >> 0] = HEAP8[$132 + (($176 - $190 | 0) >>> 5 & 1023) >> 0] | 0; + HEAP8[$135 + 1 >> 0] = HEAP8[$132 + (($203 + $178 | 0) >>> 5 & 1023) >> 0] | 0; + HEAP8[$135 + 6 >> 0] = HEAP8[$132 + (($178 - $203 | 0) >>> 5 & 1023) >> 0] | 0; + HEAP8[$135 + 2 >> 0] = HEAP8[$132 + (($204 + $179 | 0) >>> 5 & 1023) >> 0] | 0; + HEAP8[$135 + 5 >> 0] = HEAP8[$132 + (($179 - $204 | 0) >>> 5 & 1023) >> 0] | 0; + HEAP8[$135 + 3 >> 0] = HEAP8[$132 + (($205 + $177 | 0) >>> 5 & 1023) >> 0] | 0; + HEAP8[$135 + 4 >> 0] = HEAP8[$132 + (($177 - $205 | 0) >>> 5 & 1023) >> 0] | 0; + } + $$1279 = $$1279 + 1 | 0; + if (($$1279 | 0) == 8) break; else $$2278 = $$2278 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function _QRM($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$0213 = 0, $$0215 = 0, $$0216 = 0, $$0219 = 0, $$0220 = 0, $$0221 = 0, $$0222 = 0, $$0223 = 0.0, $$0224 = 0.0, $$0224$be = 0.0, $$0227 = 0.0, $$0227$be = 0.0, $$0232 = 0.0, $$1 = 0, $$1214 = 0, $$1217 = 0, $$1225 = 0.0, $$1228 = 0.0, $$1231 = 0.0, $$2218 = 0, $$pre = 0, $106 = 0.0, $111 = 0, $112 = 0, $113 = 0, $115 = 0, $116 = 0.0, $118 = 0, $119 = 0.0, $12 = 0, $128 = 0.0, $130 = 0, $131 = 0.0, $136 = 0.0, $138 = 0.0, $14 = 0, $144 = 0, $145 = 0, $146 = 0.0, $147 = 0, $150 = 0.0, $151 = 0, $154 = 0, $159 = 0.0, $2 = 0, $20 = 0, $25 = 0.0, $26 = 0, $27 = 0, $30 = 0.0, $38 = 0, $4 = 0, $40 = 0, $43 = 0, $44 = 0, $46 = 0, $47 = 0.0, $49 = 0.0, $50 = 0.0, $51 = 0.0, $54 = 0.0, $65 = 0.0, $70 = 0.0, $74 = 0.0, $77 = 0.0, $81 = 0.0, $83 = 0, $84 = 0.0, $85 = 0, $86 = 0, $87 = 0.0, $88 = 0.0, $91 = 0, $95 = 0.0, $99 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $4 = HEAP32[$0 + 4 >> 2] | 0; + do if ((!(($4 | 0) < 2 ? 1 : ($4 | 0) != (HEAP32[$0 + 8 >> 2] | 0)) ? (HEAP32[$1 + 4 >> 2] | 0) == ($4 | 0) : 0) ? ($12 = _arVecAlloc($4) | 0, ($12 | 0) != 0) : 0) { + $14 = $4 + -1 | 0; + HEAP32[$2 + 4 >> 2] = $14; + HEAP32[$2 >> 2] = (HEAP32[$12 >> 2] | 0) + 8; + if ((_arVecTridiagonalize($0, $1, $2) | 0) < 0) { + _arVecFree($12) | 0; + $$0220 = -1; + break; + } + $20 = HEAP32[$12 >> 2] | 0; + HEAPF64[$20 >> 3] = 0.0; + $$0 = $14; + while (1) { + if (($$0 | 0) <= 0) break; + $$0215 = $$0; + while (1) { + if (($$0215 | 0) <= 0) break; + $25 = +Math_abs(+(+HEAPF64[$20 + ($$0215 << 3) >> 3])); + $26 = HEAP32[$1 >> 2] | 0; + $27 = $$0215 + -1 | 0; + $30 = +Math_abs(+(+HEAPF64[$26 + ($27 << 3) >> 3])); + if ($25 > ($30 + +Math_abs(+(+HEAPF64[$26 + ($$0215 << 3) >> 3]))) * 1.0e-06) $$0215 = $27; else break; + } + $$pre = $$0 + -1 | 0; + L15 : do if (($$0215 | 0) != ($$0 | 0)) { + $38 = $20 + ($$0 << 3) | 0; + $40 = $20 + ($$0215 + 1 << 3) | 0; + $$0219 = 0; + do { + if ($$0219 >>> 0 > 99) break L15; + $$0219 = $$0219 + 1 | 0; + $43 = HEAP32[$1 >> 2] | 0; + $44 = $43 + ($$pre << 3) | 0; + $46 = $43 + ($$0 << 3) | 0; + $47 = +HEAPF64[$46 >> 3]; + $49 = (+HEAPF64[$44 >> 3] - $47) * .5; + $50 = +HEAPF64[$38 >> 3]; + $51 = $50 * $50; + $54 = +Math_sqrt(+($51 + $49 * $49)); + $$0213 = $$0215; + $$0224 = +HEAPF64[$40 >> 3]; + $$0227 = +HEAPF64[$43 + ($$0215 << 3) >> 3] - $47 + $51 / ($49 + ($49 < 0.0 ? -$54 : $54)); + while (1) { + if (($$0213 | 0) >= ($$0 | 0)) break; + $65 = +Math_abs(+$$0227); + if ($65 >= +Math_abs(+$$0224)) if ($65 > 1.0e-16) { + $70 = -$$0224 / $$0227; + $74 = 1.0 / +Math_sqrt(+($70 * $70 + 1.0)); + $$0223 = $74; + $$1231 = $70 * $74; + } else { + $$0223 = 1.0; + $$1231 = 0.0; + } else { + $77 = -$$0227 / $$0224; + $81 = 1.0 / +Math_sqrt(+($77 * $77 + 1.0)); + $$0223 = $77 * $81; + $$1231 = $81; + } + $83 = $43 + ($$0213 << 3) | 0; + $84 = +HEAPF64[$83 >> 3]; + $85 = $$0213 + 1 | 0; + $86 = $43 + ($85 << 3) | 0; + $87 = +HEAPF64[$86 >> 3]; + $88 = $84 - $87; + $91 = $20 + ($85 << 3) | 0; + $95 = $$1231 * ($$1231 * $88 + $$0223 * 2.0 * +HEAPF64[$91 >> 3]); + HEAPF64[$83 >> 3] = $84 - $95; + HEAPF64[$86 >> 3] = $87 + $95; + $99 = $20 + ($$0213 << 3) | 0; + if (($$0213 | 0) > ($$0215 | 0)) HEAPF64[$99 >> 3] = $$0223 * +HEAPF64[$99 >> 3] - $$0224 * $$1231; + $106 = +HEAPF64[$91 >> 3]; + HEAPF64[$91 >> 3] = $106 + $$1231 * ($$0223 * $88 - $$1231 * 2.0 * $106); + $111 = Math_imul($$0213, $4) | 0; + $112 = Math_imul($85, $4) | 0; + $$0216 = 0; + $$1225 = $$0224; + $$1228 = $$0227; + while (1) { + if (($$0216 | 0) == ($4 | 0)) break; + $113 = HEAP32[$0 >> 2] | 0; + $115 = $113 + ($$0216 + $111 << 3) | 0; + $116 = +HEAPF64[$115 >> 3]; + $118 = $113 + ($$0216 + $112 << 3) | 0; + $119 = +HEAPF64[$118 >> 3]; + HEAPF64[$115 >> 3] = $$0223 * $116 - $$1231 * $119; + HEAPF64[$118 >> 3] = $$1231 * $116 + $$0223 * $119; + $$0216 = $$0216 + 1 | 0; + $$1225 = $119; + $$1228 = $116; + } + if (($$0213 | 0) < ($$pre | 0)) { + $128 = +HEAPF64[$91 >> 3]; + $130 = $20 + ($$0213 + 2 << 3) | 0; + $131 = +HEAPF64[$130 >> 3]; + HEAPF64[$130 >> 3] = $$0223 * $131; + $$0224$be = -($$1231 * $131); + $$0227$be = $128; + } else { + $$0224$be = $$1225; + $$0227$be = $$1228; + } + $$0213 = $85; + $$0224 = $$0224$be; + $$0227 = $$0227$be; + } + $136 = +Math_abs(+(+HEAPF64[$38 >> 3])); + $138 = +Math_abs(+(+HEAPF64[$44 >> 3])); + } while ($136 > ($138 + +Math_abs(+(+HEAPF64[$46 >> 3]))) * 1.0e-06); + } while (0); + $$0 = $$pre; + } + $$1214 = 0; + while (1) { + if (($$1214 | 0) == ($14 | 0)) break; + $144 = HEAP32[$1 >> 2] | 0; + $145 = $144 + ($$1214 << 3) | 0; + $146 = +HEAPF64[$145 >> 3]; + $147 = $$1214 + 1 | 0; + $$0232 = $146; + $$1 = $$1214; + $$1217 = $147; + while (1) { + if (($$1217 | 0) >= ($4 | 0)) break; + $150 = +HEAPF64[$144 + ($$1217 << 3) >> 3]; + $151 = $150 > $$0232; + $$0232 = $151 ? $150 : $$0232; + $$1 = $151 ? $$1217 : $$1; + $$1217 = $$1217 + 1 | 0; + } + HEAPF64[$144 + ($$1 << 3) >> 3] = $146; + HEAPF64[$145 >> 3] = $$0232; + $154 = HEAP32[$0 >> 2] | 0; + $$0221 = $154 + ((Math_imul($$1214, $4) | 0) << 3) | 0; + $$0222 = $154 + ((Math_imul($$1, $4) | 0) << 3) | 0; + $$2218 = 0; + while (1) { + if (($$2218 | 0) == ($4 | 0)) break; + $159 = +HEAPF64[$$0222 >> 3]; + HEAPF64[$$0222 >> 3] = +HEAPF64[$$0221 >> 3]; + HEAPF64[$$0221 >> 3] = $159; + $$0221 = $$0221 + 8 | 0; + $$0222 = $$0222 + 8 | 0; + $$2218 = $$2218 + 1 | 0; + } + $$1214 = $147; + } + _arVecFree($12) | 0; + $$0220 = 0; + } else $$0220 = -1; while (0); + STACKTOP = sp; + return $$0220 | 0; +} + +function ___floatscan($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$0102 = 0, $$0103 = 0, $$0104122 = 0, $$0110 = 0, $$0111 = 0.0, $$1$lcssa = 0, $$1105118 = 0, $$1123 = 0, $$2 = 0, $$2106120 = 0, $$3107 = 0, $$3121 = 0, $$4 = 0, $$4108 = 0, $$5 = 0, $$6 = 0, $$in = 0, $103 = 0, $106 = 0, $117 = 0, $119 = 0, $12 = 0, $127 = 0, $18 = 0, $19 = 0, $3 = 0, $32 = 0, $4 = 0, $42 = 0, $45 = 0, $5 = 0, $64 = 0, $73 = 0, $81 = 0, $86 = 0, $94 = 0, $trunc = 0, label = 0; + switch ($1 | 0) { + case 0: + { + $$0102 = -149; + $$0103 = 24; + label = 4; + break; + } + case 1: + { + $$0102 = -1074; + $$0103 = 53; + label = 4; + break; + } + case 2: + { + $$0102 = -1074; + $$0103 = 53; + label = 4; + break; + } + default: + $$0111 = 0.0; + } + L4 : do if ((label | 0) == 4) { + $3 = $0 + 4 | 0; + $4 = $0 + 104 | 0; + do { + $5 = HEAP32[$3 >> 2] | 0; + if ($5 >>> 0 < (HEAP32[$4 >> 2] | 0) >>> 0) { + HEAP32[$3 >> 2] = $5 + 1; + $12 = HEAPU8[$5 >> 0] | 0; + } else $12 = ___shgetc($0) | 0; + } while ((_isspace($12) | 0) != 0); + L13 : do switch ($12 | 0) { + case 43: + case 45: + { + $18 = 1 - ((($12 | 0) == 45 & 1) << 1) | 0; + $19 = HEAP32[$3 >> 2] | 0; + if ($19 >>> 0 < (HEAP32[$4 >> 2] | 0) >>> 0) { + HEAP32[$3 >> 2] = $19 + 1; + $$0 = HEAPU8[$19 >> 0] | 0; + $$0110 = $18; + break L13; + } else { + $$0 = ___shgetc($0) | 0; + $$0110 = $18; + break L13; + } + break; + } + default: + { + $$0 = $12; + $$0110 = 1; + } + } while (0); + $$0104122 = 0; + $$1123 = $$0; + while (1) { + if (($$1123 | 32 | 0) != (HEAP8[50788 + $$0104122 >> 0] | 0)) { + $$1$lcssa = $$1123; + $trunc = $$0104122; + break; + } + do if ($$0104122 >>> 0 < 7) { + $32 = HEAP32[$3 >> 2] | 0; + if ($32 >>> 0 < (HEAP32[$4 >> 2] | 0) >>> 0) { + HEAP32[$3 >> 2] = $32 + 1; + $$2 = HEAPU8[$32 >> 0] | 0; + break; + } else { + $$2 = ___shgetc($0) | 0; + break; + } + } else $$2 = $$1123; while (0); + $$0104122 = $$0104122 + 1 | 0; + if ($$0104122 >>> 0 >= 8) { + $$1$lcssa = $$2; + $trunc = 8; + break; + } else $$1123 = $$2; + } + L29 : do switch ($trunc & 2147483647 | 0) { + case 8: + break; + case 3: + { + label = 23; + break; + } + default: + { + $42 = ($2 | 0) != 0; + if ($42 & $trunc >>> 0 > 3) if (($trunc | 0) == 8) break L29; else { + label = 23; + break L29; + } + L34 : do if (!$trunc) { + $$2106120 = 0; + $$3121 = $$1$lcssa; + while (1) { + if (($$3121 | 32 | 0) != (HEAP8[50797 + $$2106120 >> 0] | 0)) { + $$3107 = $$2106120; + $$5 = $$3121; + break L34; + } + do if ($$2106120 >>> 0 < 2) { + $64 = HEAP32[$3 >> 2] | 0; + if ($64 >>> 0 < (HEAP32[$4 >> 2] | 0) >>> 0) { + HEAP32[$3 >> 2] = $64 + 1; + $$4 = HEAPU8[$64 >> 0] | 0; + break; + } else { + $$4 = ___shgetc($0) | 0; + break; + } + } else $$4 = $$3121; while (0); + $$2106120 = $$2106120 + 1 | 0; + if ($$2106120 >>> 0 >= 3) { + $$3107 = 3; + $$5 = $$4; + break; + } else $$3121 = $$4; + } + } else { + $$3107 = $trunc; + $$5 = $$1$lcssa; + } while (0); + switch ($$3107 | 0) { + case 3: + { + $73 = HEAP32[$3 >> 2] | 0; + if ($73 >>> 0 < (HEAP32[$4 >> 2] | 0) >>> 0) { + HEAP32[$3 >> 2] = $73 + 1; + $81 = HEAPU8[$73 >> 0] | 0; + } else $81 = ___shgetc($0) | 0; + if (($81 | 0) != 40) { + if (!(HEAP32[$4 >> 2] | 0)) { + $$0111 = nan; + break L4; + } + HEAP32[$3 >> 2] = (HEAP32[$3 >> 2] | 0) + -1; + $$0111 = nan; + break L4; + } + $$4108 = 1; + while (1) { + $86 = HEAP32[$3 >> 2] | 0; + if ($86 >>> 0 < (HEAP32[$4 >> 2] | 0) >>> 0) { + HEAP32[$3 >> 2] = $86 + 1; + $94 = HEAPU8[$86 >> 0] | 0; + } else $94 = ___shgetc($0) | 0; + if (!(($94 + -48 | 0) >>> 0 < 10 | ($94 + -65 | 0) >>> 0 < 26) ? !(($94 | 0) == 95 | ($94 + -97 | 0) >>> 0 < 26) : 0) break; + $$4108 = $$4108 + 1 | 0; + } + if (($94 | 0) == 41) { + $$0111 = nan; + break L4; + } + $103 = (HEAP32[$4 >> 2] | 0) == 0; + if (!$103) HEAP32[$3 >> 2] = (HEAP32[$3 >> 2] | 0) + -1; + if (!$42) { + $106 = ___errno_location() | 0; + HEAP32[$106 >> 2] = 28; + ___shlim($0, 0, 0); + $$0111 = 0.0; + break L4; + } + if (!$$4108) { + $$0111 = nan; + break L4; + } + $$in = $$4108; + while (1) { + $$in = $$in + -1 | 0; + if (!$103) HEAP32[$3 >> 2] = (HEAP32[$3 >> 2] | 0) + -1; + if (!$$in) { + $$0111 = nan; + break L4; + } + } + break; + } + case 0: + { + if (($$5 | 0) == 48) { + $119 = HEAP32[$3 >> 2] | 0; + if ($119 >>> 0 < (HEAP32[$4 >> 2] | 0) >>> 0) { + HEAP32[$3 >> 2] = $119 + 1; + $127 = HEAPU8[$119 >> 0] | 0; + } else $127 = ___shgetc($0) | 0; + if (($127 | 32 | 0) == 120) { + $$0111 = +_hexfloat($0, $$0103, $$0102, $$0110, $2); + break L4; + } + if (!(HEAP32[$4 >> 2] | 0)) $$6 = 48; else { + HEAP32[$3 >> 2] = (HEAP32[$3 >> 2] | 0) + -1; + $$6 = 48; + } + } else $$6 = $$5; + $$0111 = +_decfloat($0, $$6, $$0103, $$0102, $$0110, $2); + break L4; + break; + } + default: + { + if (HEAP32[$4 >> 2] | 0) HEAP32[$3 >> 2] = (HEAP32[$3 >> 2] | 0) + -1; + $117 = ___errno_location() | 0; + HEAP32[$117 >> 2] = 28; + ___shlim($0, 0, 0); + $$0111 = 0.0; + break L4; + } + } + } + } while (0); + if ((label | 0) == 23) { + $45 = (HEAP32[$4 >> 2] | 0) == 0; + if (!$45) HEAP32[$3 >> 2] = (HEAP32[$3 >> 2] | 0) + -1; + if (($2 | 0) != 0 & $trunc >>> 0 > 3) { + $$1105118 = $trunc; + do { + if (!$45) HEAP32[$3 >> 2] = (HEAP32[$3 >> 2] | 0) + -1; + $$1105118 = $$1105118 + -1 | 0; + } while ($$1105118 >>> 0 > 3); + } + } + $$0111 = +($$0110 | 0) * inf; + } while (0); + return +$$0111; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseEncodingEv($0) { + $0 = $0 | 0; + var $$10 = 0, $$7 = 0, $$8 = 0, $$9 = 0, $$byval_copy = 0, $1 = 0, $10 = 0, $11 = 0, $16 = 0, $17 = 0, $19 = 0, $2 = 0, $21 = 0, $27 = 0, $3 = 0, $33 = 0, $34 = 0, $35 = 0, $4 = 0, $5 = 0, $6 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $$byval_copy = sp + 48 | 0; + $1 = sp + 40 | 0; + $2 = sp + 24 | 0; + $3 = sp + 20 | 0; + $4 = sp + 16 | 0; + $5 = sp + 8 | 0; + $6 = sp; + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24) { + case 84: + case 71: + { + $$10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E16parseSpecialNameEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + break; + } + default: + { + HEAP32[$1 >> 2] = $0; + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9NameStateC2EPS5_($2, $0); + $10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $11 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseNameEPNS5_9NameStateE($10, $2) | 0; + HEAP32[$3 >> 2] = $11; + if (($11 | 0) != 0 ? !(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E26resolveForwardTemplateRefsERNS5_9NameStateE($0, $2) | 0) : 0) if (__ZZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseEncodingEvENKUlvE_clEv($1) | 0) $$9 = $11; else { + HEAP32[$4 >> 2] = 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 56610); + HEAP32[$$byval_copy >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + do if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy) | 0) { + $16 = $0 + 8 | 0; + $17 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($16) | 0; + while (1) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) { + label = 11; + break; + } + $19 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E16parseTemplateArgEv($10) | 0; + HEAP32[$$byval_copy >> 2] = $19; + if (!$19) { + label = 12; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($16, $$byval_copy); + } + if ((label | 0) == 11) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20popTrailingNodeArrayEm($$byval_copy, $0, $17); + $21 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_12EnableIfAttrEJNS0_9NodeArrayEEEEPNS0_4NodeEDpOT0_($0, $$byval_copy) | 0; + HEAP32[$4 >> 2] = $21; + label = 13; + break; + } else if ((label | 0) == 12) { + $$8 = 0; + break; + } + } else label = 13; while (0); + if ((label | 0) == 13) { + HEAP32[$$byval_copy >> 2] = 0; + if (((HEAP8[$2 >> 0] | 0) == 0 ? (HEAP8[$2 + 1 >> 0] | 0) != 0 : 0) ? ($27 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($10) | 0, HEAP32[$$byval_copy >> 2] = $27, ($27 | 0) == 0) : 0) $$7 = 0; else label = 16; + do if ((label | 0) == 16) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 118) | 0) { + __ZN12_GLOBAL__N_116itanium_demangle9NodeArrayC2Ev($6); + $$7 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_16FunctionEncodingEJRPNS0_4NodeESA_NS0_9NodeArrayESA_RNS0_10QualifiersERNS0_15FunctionRefQualEEEES9_DpOT0_($0, $$byval_copy, $3, $6, $4, $2 + 4 | 0, $2 + 8 | 0) | 0; + break; + } + $33 = $0 + 8 | 0; + $34 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($33) | 0; + while (1) { + $35 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($10) | 0; + HEAP32[$6 >> 2] = $35; + if (!$35) { + label = 21; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($33, $6); + if (__ZZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseEncodingEvENKUlvE_clEv($1) | 0) { + label = 22; + break; + } + } + if ((label | 0) == 21) { + $$7 = 0; + break; + } else if ((label | 0) == 22) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20popTrailingNodeArrayEm($6, $0, $34); + $$7 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_16FunctionEncodingEJRPNS0_4NodeESA_NS0_9NodeArrayESA_RNS0_10QualifiersERNS0_15FunctionRefQualEEEES9_DpOT0_($0, $$byval_copy, $3, $6, $4, $2 + 4 | 0, $2 + 8 | 0) | 0; + break; + } + } while (0); + $$8 = $$7; + } + $$9 = $$8; + } else $$9 = 0; + $$10 = $$9; + } + } + STACKTOP = sp; + return $$10 | 0; +} + +function __ZNSt3__29__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i108 = 0, $$0100 = 0, $$0102 = 0, $$0104 = 0, $$07$i$i = 0, $$07$i$i107 = 0, $$099 = 0, $$1 = 0, $$1101 = 0, $$1103 = 0, $$1105 = 0, $$2 = 0, $$2106 = 0, $$3 = 0, $$pre$phiZ2D = 0, $101 = 0, $105 = 0, $107 = 0, $119 = 0, $120 = 0, $125 = 0, $13 = 0, $130 = 0, $131 = 0, $137 = 0, $138 = 0, $148 = 0, $18 = 0, $19 = 0, $21 = 0, $27 = 0, $32 = 0, $33 = 0, $35 = 0, $40 = 0, $41 = 0, $45 = 0, $52 = 0, $57 = 0, $58 = 0, $60 = 0, $7 = 0, $75 = 0, $77 = 0, $8 = 0, $83 = 0, $88 = 0, $89 = 0, $9 = 0, $91 = 0, $93 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $7 = sp; + $8 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $9 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66528) | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$9 >> 2] | 0) + 20 >> 2] & 255]($7, $9); + HEAP32[$5 >> 2] = $3; + $13 = HEAP8[$0 >> 0] | 0; + switch ($13 << 24 >> 24) { + case 43: + case 45: + { + $18 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$8 >> 2] | 0) + 28 >> 2] & 127]($8, $13) | 0; + $19 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $19 + 1; + HEAP8[$19 >> 0] = $18; + $$0102 = $0 + 1 | 0; + break; + } + default: + $$0102 = $0; + } + $21 = $2; + L4 : do if (($21 - $$0102 | 0) > 1 ? (HEAP8[$$0102 >> 0] | 0) == 48 : 0) { + $27 = $$0102 + 1 | 0; + switch (HEAP8[$27 >> 0] | 0) { + case 88: + case 120: + break; + default: + { + label = 4; + break L4; + } + } + $32 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$8 >> 2] | 0) + 28 >> 2] & 127]($8, 48) | 0; + $33 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $33 + 1; + HEAP8[$33 >> 0] = $32; + $35 = $$0102 + 2 | 0; + $40 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$8 >> 2] | 0) + 28 >> 2] & 127]($8, HEAP8[$27 >> 0] | 0) | 0; + $41 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $41 + 1; + HEAP8[$41 >> 0] = $40; + $$0104 = $35; + while (1) { + if ($$0104 >>> 0 >= $2 >>> 0) { + $$1103 = $35; + $$2106 = $$0104; + break L4; + } + $45 = HEAP8[$$0104 >> 0] | 0; + if (!(_isxdigit_l($45, __ZNSt3__26__clocEv() | 0) | 0)) { + $$1103 = $35; + $$2106 = $$0104; + break L4; + } + $$0104 = $$0104 + 1 | 0; + } + } else label = 4; while (0); + L12 : do if ((label | 0) == 4) { + $$1105 = $$0102; + while (1) { + if ($$1105 >>> 0 >= $2 >>> 0) { + $$1103 = $$0102; + $$2106 = $$1105; + break L12; + } + $52 = HEAP8[$$1105 >> 0] | 0; + if (!(_isdigit_l($52, __ZNSt3__26__clocEv() | 0) | 0)) { + $$1103 = $$0102; + $$2106 = $$1105; + break L12; + } + $$1105 = $$1105 + 1 | 0; + } + } while (0); + $57 = $7 + 11 | 0; + $58 = HEAP8[$57 >> 0] | 0; + $60 = $7 + 4 | 0; + L19 : do if (($58 << 24 >> 24 < 0 ? HEAP32[$60 >> 2] | 0 : $58 & 255) | 0) { + L22 : do if (($$1103 | 0) != ($$2106 | 0)) { + $$0$i$i = $$2106; + $$07$i$i = $$1103; + while (1) { + $75 = $$0$i$i + -1 | 0; + if ($$07$i$i >>> 0 >= $75 >>> 0) break L22; + $77 = HEAP8[$$07$i$i >> 0] | 0; + HEAP8[$$07$i$i >> 0] = HEAP8[$75 >> 0] | 0; + HEAP8[$75 >> 0] = $77; + $$0$i$i = $75; + $$07$i$i = $$07$i$i + 1 | 0; + } + } while (0); + $83 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$9 >> 2] | 0) + 16 >> 2] & 127]($9) | 0; + $$0 = $$1103; + $$0100 = 0; + $$099 = 0; + while (1) { + if ($$0 >>> 0 >= $$2106 >>> 0) break; + $101 = HEAP8[((HEAP8[$57 >> 0] | 0) < 0 ? HEAP32[$7 >> 2] | 0 : $7) + $$099 >> 0] | 0; + if ($101 << 24 >> 24 > 0 & ($$0100 | 0) == ($101 << 24 >> 24 | 0)) { + $105 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $105 + 1; + HEAP8[$105 >> 0] = $83; + $107 = HEAP8[$57 >> 0] | 0; + $$1 = $$099 + ($$099 >>> 0 < (($107 << 24 >> 24 < 0 ? HEAP32[$60 >> 2] | 0 : $107 & 255) + -1 | 0) >>> 0 & 1) | 0; + $$1101 = 0; + } else { + $$1 = $$099; + $$1101 = $$0100; + } + $119 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$8 >> 2] | 0) + 28 >> 2] & 127]($8, HEAP8[$$0 >> 0] | 0) | 0; + $120 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $120 + 1; + HEAP8[$120 >> 0] = $119; + $$0 = $$0 + 1 | 0; + $$0100 = $$1101 + 1 | 0; + $$099 = $$1; + } + $88 = $3 + ($$1103 - $0) | 0; + $89 = HEAP32[$5 >> 2] | 0; + if (($88 | 0) == ($89 | 0)) $$pre$phiZ2D = $8; else { + $$0$i$i108 = $89; + $$07$i$i107 = $88; + while (1) { + $91 = $$0$i$i108 + -1 | 0; + if ($$07$i$i107 >>> 0 >= $91 >>> 0) { + $$pre$phiZ2D = $8; + break L19; + } + $93 = HEAP8[$$07$i$i107 >> 0] | 0; + HEAP8[$$07$i$i107 >> 0] = HEAP8[$91 >> 0] | 0; + HEAP8[$91 >> 0] = $93; + $$0$i$i108 = $91; + $$07$i$i107 = $$07$i$i107 + 1 | 0; + } + } + } else { + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$8 >> 2] | 0) + 32 >> 2] & 15]($8, $$1103, $$2106, HEAP32[$5 >> 2] | 0) | 0; + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + ($$2106 - $$1103); + $$pre$phiZ2D = $8; + } while (0); + $$2 = $$2106; + while (1) { + if ($$2 >>> 0 >= $2 >>> 0) { + $$3 = $$2; + break; + } + $125 = HEAP8[$$2 >> 0] | 0; + if ($125 << 24 >> 24 == 46) { + label = 32; + break; + } + $137 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$$pre$phiZ2D >> 2] | 0) + 28 >> 2] & 127]($8, $125) | 0; + $138 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $138 + 1; + HEAP8[$138 >> 0] = $137; + $$2 = $$2 + 1 | 0; + } + if ((label | 0) == 32) { + $130 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$9 >> 2] | 0) + 12 >> 2] & 127]($9) | 0; + $131 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $131 + 1; + HEAP8[$131 >> 0] = $130; + $$3 = $$2 + 1 | 0; + } + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$8 >> 2] | 0) + 32 >> 2] & 15]($8, $$3, $2, HEAP32[$5 >> 2] | 0) | 0; + $148 = (HEAP32[$5 >> 2] | 0) + ($21 - $$3) | 0; + HEAP32[$5 >> 2] = $148; + HEAP32[$4 >> 2] = ($1 | 0) == ($2 | 0) ? $148 : $3 + ($1 - $0) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($7); + STACKTOP = sp; + return; +} + +function __ZN6vision22ComputeSubpixelHessianEPfS0_RKNS_5ImageES3_S3_ii($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $103 = 0, $107 = 0, $11 = 0, $14 = 0, $17 = 0, $25 = 0, $30 = 0, $34 = 0, $35 = 0, $39 = 0, $42 = 0, $46 = 0, $54 = 0, $59 = 0, $63 = 0, $65 = 0, $68 = 0, $7 = 0, $72 = 0, $75 = 0, $8 = 0, $83 = 0, $88 = 0, $92 = 0, $98 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $7 = sp; + $8 = __ZNK6vision5Image5widthEv($2) | 0; + $11 = ($8 | 0) == (__ZNK6vision5Image5widthEv($3) | 0) & 1; + do if ((__ZNK6vision5Image5widthEv($4) | 0) == ($11 | 0)) { + $14 = __ZNK6vision5Image6heightEv($2) | 0; + $17 = ($14 | 0) == (__ZNK6vision5Image6heightEv($3) | 0) & 1; + if ((__ZNK6vision5Image6heightEv($4) | 0) == ($17 | 0)) { + __ZN6vision32ComputeSubpixelHessianSameOctaveEPfS0_RKNS_5ImageES3_S3_ii($0, $1, $2, $3, $4, $5, $6); + break; + } else { + $25 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 28529) | 0, 28600) | 0, 39072) | 0, 466) | 0, 39079) | 0, 28693) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $25 + (HEAP32[(HEAP32[$25 >> 2] | 0) + -12 >> 2] | 0) | 0); + $30 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $34 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$30 >> 2] | 0) + 28 >> 2] & 127]($30, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($25, $34) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($25) | 0; + _abort(); + } + } else { + $35 = __ZNK6vision5Image5widthEv($2) | 0; + if (($35 | 0) == (__ZNK6vision5Image5widthEv($3) | 0) ? ($39 = (__ZNK6vision5Image5widthEv($3) | 0) >>> 1, ($39 | 0) == (__ZNK6vision5Image5widthEv($4) | 0)) : 0) { + $42 = __ZNK6vision5Image6heightEv($2) | 0; + if (($42 | 0) == (__ZNK6vision5Image6heightEv($3) | 0) ? ($46 = (__ZNK6vision5Image6heightEv($3) | 0) >>> 1, ($46 | 0) == (__ZNK6vision5Image6heightEv($4) | 0)) : 0) { + __ZN6vision36ComputeSubpixelHessianFineOctavePairEPfS0_RKNS_5ImageES3_S3_ii($0, $1, $2, $3, $4, $5, $6); + break; + } + $54 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 28725) | 0, 28600) | 0, 39072) | 0, 469) | 0, 39079) | 0, 28693) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $54 + (HEAP32[(HEAP32[$54 >> 2] | 0) + -12 >> 2] | 0) | 0); + $59 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $63 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$59 >> 2] | 0) + 28 >> 2] & 127]($59, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($54, $63) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($54) | 0; + _abort(); + } + $65 = (__ZNK6vision5Image5widthEv($2) | 0) >>> 1; + if (($65 | 0) == (__ZNK6vision5Image5widthEv($3) | 0) ? ($68 = __ZNK6vision5Image5widthEv($3) | 0, ($68 | 0) == (__ZNK6vision5Image5widthEv($4) | 0)) : 0) { + $72 = (__ZNK6vision5Image5widthEv($2) | 0) >>> 1; + if (($72 | 0) == (__ZNK6vision5Image5widthEv($3) | 0) ? ($75 = __ZNK6vision5Image5widthEv($3) | 0, ($75 | 0) == (__ZNK6vision5Image5widthEv($4) | 0)) : 0) { + __ZN6vision38ComputeSubpixelHessianCoarseOctavePairEPfS0_RKNS_5ImageES3_S3_ii($0, $1, $2, $3, $4, $5, $6); + break; + } + $83 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 28822) | 0, 28600) | 0, 39072) | 0, 472) | 0, 39079) | 0, 28693) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $83 + (HEAP32[(HEAP32[$83 >> 2] | 0) + -12 >> 2] | 0) | 0); + $88 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $92 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$88 >> 2] | 0) + 28 >> 2] & 127]($88, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($83, $92) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($83) | 0; + _abort(); + } + $98 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 35204) | 0, 28600) | 0, 39072) | 0, 475) | 0, 39079) | 0, 28915) | 0; + __ZNKSt3__28ios_base6getlocEv($7, $98 + (HEAP32[(HEAP32[$98 >> 2] | 0) + -12 >> 2] | 0) | 0); + $103 = __ZNKSt3__26locale9use_facetERNS0_2idE($7, 66512) | 0; + $107 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$103 >> 2] | 0) + 28 >> 2] & 127]($103, 10) | 0; + __ZNSt3__26localeD2Ev($7); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($98, $107) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($98) | 0; + _abort(); + } while (0); + STACKTOP = sp; + return 1; +} + +function __ZN6vision20BinaryFeatureMatcherILi96EE5matchEPKNS_18BinaryFeatureStoreES4_RKNS_28BinaryHierarchicalClusteringILi96EEE($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$064 = 0, $$065 = 0, $$066 = 0, $$067 = 0, $$070 = 0, $$2 = 0, $$269 = 0, $$272 = 0, $110 = 0, $115 = 0, $119 = 0, $12 = 0, $13 = 0, $19 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $28 = 0, $34 = 0, $38 = 0, $4 = 0, $45 = 0, $58 = 0, $6 = 0, $63 = 0, $67 = 0, $69 = 0, $72 = 0, $77 = 0, $78 = 0, $89 = 0, $92 = 0, $97 = 0, $98 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp; + $6 = $0 + 4 | 0; + HEAP32[$6 >> 2] = HEAP32[$0 >> 2]; + do if ((__ZNK6vision18BinaryFeatureStore4sizeEv($1) | 0) != 0 ? (__ZNK6vision18BinaryFeatureStore4sizeEv($2) | 0) != 0 : 0) { + __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE7reserveEm($0, __ZNK6vision18BinaryFeatureStore4sizeEv($1) | 0); + $12 = $0 + 8 | 0; + $13 = $0 + 12 | 0; + $$064 = 0; + L4 : while (1) { + if ($$064 >>> 0 >= (__ZNK6vision18BinaryFeatureStore4sizeEv($1) | 0) >>> 0) break; + $22 = __ZNK6vision18BinaryFeatureStore7featureEm($1, $$064) | 0; + __ZNK6vision28BinaryHierarchicalClusteringILi96EE5queryEPKh($3, $22) | 0; + $23 = __ZNK6vision18BinaryFeatureStore5pointEm($1, $$064) | 0; + $24 = __ZNK6vision28BinaryHierarchicalClusteringILi96EE12reverseIndexEv($3) | 0; + $25 = $24 + 4 | 0; + $26 = $23 + 16 | 0; + $$065 = 0; + $$066 = -1; + $$067 = -1; + $$070 = 2147483647; + while (1) { + $28 = HEAP32[$24 >> 2] | 0; + if ($$065 >>> 0 >= (HEAP32[$25 >> 2] | 0) - $28 >> 2 >>> 0) break; + $34 = HEAP8[$26 >> 0] | 0; + $38 = (__ZNK6vision18BinaryFeatureStore5pointEm($2, HEAP32[$28 + ($$065 << 2) >> 2] | 0) | 0) + 16 | 0; + do if ($34 << 24 >> 24 == (HEAP8[$38 >> 0] | 0)) { + $45 = __ZN6vision15HammingDistanceILi96EEEjPKhS2_($22, __ZNK6vision18BinaryFeatureStore7featureEm($2, HEAP32[(HEAP32[$24 >> 2] | 0) + ($$065 << 2) >> 2] | 0) | 0) | 0; + if ($45 >>> 0 < $$066 >>> 0) { + $$2 = $45; + $$269 = $$066; + $$272 = HEAP32[(HEAP32[$24 >> 2] | 0) + ($$065 << 2) >> 2] | 0; + break; + } else { + $$2 = $$066; + $$269 = $45 >>> 0 < $$067 >>> 0 ? $45 : $$067; + $$272 = $$070; + break; + } + } else { + $$2 = $$066; + $$269 = $$067; + $$272 = $$070; + } while (0); + $$065 = $$065 + 1 | 0; + $$066 = $$2; + $$067 = $$269; + $$070 = $$272; + } + do if (($$066 | 0) != -1) { + if (($$070 | 0) == -1) { + label = 15; + break L4; + } + if (($$067 | 0) == -1) { + __ZN6vision7match_tC2Eii($4, $$064, $$070); + $69 = HEAP32[$6 >> 2] | 0; + if ($69 >>> 0 < (HEAP32[$12 >> 2] | 0) >>> 0) { + $72 = $4; + $77 = HEAP32[$72 + 4 >> 2] | 0; + $78 = $69; + HEAP32[$78 >> 2] = HEAP32[$72 >> 2]; + HEAP32[$78 + 4 >> 2] = $77; + HEAP32[$6 >> 2] = (HEAP32[$6 >> 2] | 0) + 8; + } else __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_($0, $4); + break; + } + if (+($$066 >>> 0) / +($$067 >>> 0) < +HEAPF32[$13 >> 2]) { + __ZN6vision7match_tC2Eii($4, $$064, $$070); + $89 = HEAP32[$6 >> 2] | 0; + if ($89 >>> 0 < (HEAP32[$12 >> 2] | 0) >>> 0) { + $92 = $4; + $97 = HEAP32[$92 + 4 >> 2] | 0; + $98 = $89; + HEAP32[$98 >> 2] = HEAP32[$92 >> 2]; + HEAP32[$98 + 4 >> 2] = $97; + HEAP32[$6 >> 2] = (HEAP32[$6 >> 2] | 0) + 8; + } else __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_($0, $4); + } + } while (0); + $$064 = $$064 + 1 | 0; + } + if ((label | 0) == 15) { + $58 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 35348) | 0, 35229) | 0, 39072) | 0, 160) | 0, 39079) | 0, 35420) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $58 + (HEAP32[(HEAP32[$58 >> 2] | 0) + -12 >> 2] | 0) | 0); + $63 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $67 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$63 >> 2] | 0) + 28 >> 2] & 127]($63, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($58, $67) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($58) | 0; + _abort(); + } + $19 = (HEAP32[$6 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 3; + if ($19 >>> 0 > (__ZNK6vision18BinaryFeatureStore4sizeEv($1) | 0) >>> 0) { + $110 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 35438) | 0, 35229) | 0, 39072) | 0, 175) | 0, 39079) | 0, 35498) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $110 + (HEAP32[(HEAP32[$110 >> 2] | 0) + -12 >> 2] | 0) | 0); + $115 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $119 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$115 >> 2] | 0) + 28 >> 2] & 127]($115, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($110, $119) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($110) | 0; + _abort(); + } else { + $$0 = (HEAP32[$6 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 3; + break; + } + } else $$0 = 0; while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function _fmod($0, $1) { + $0 = +$0; + $1 = +$1; + var $$070 = 0.0, $$071$lcssa = 0, $$07194 = 0, $$073$lcssa = 0, $$073100 = 0, $$172 = 0, $$174 = 0, $$275$lcssa = 0, $$27585 = 0, $$376$lcssa = 0, $$37682 = 0, $$lcssa = 0, $101 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $11 = 0, $110 = 0, $111 = 0, $116 = 0, $118 = 0, $12 = 0, $120 = 0, $124 = 0, $126 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0, $134 = 0, $14 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $150 = 0, $153 = 0, $155 = 0, $156 = 0, $157 = 0, $158 = 0, $159 = 0, $160 = 0, $18 = 0, $2 = 0, $20 = 0, $27 = 0.0, $29 = 0, $3 = 0, $30 = 0, $4 = 0, $41 = 0, $42 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $59 = 0, $6 = 0, $64 = 0, $65 = 0, $71 = 0, $72 = 0, $73 = 0, $8 = 0, $82 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $97 = 0, $99 = 0, label = 0; + HEAPF64[tempDoublePtr >> 3] = $0; + $2 = HEAP32[tempDoublePtr >> 2] | 0; + $3 = HEAP32[tempDoublePtr + 4 >> 2] | 0; + HEAPF64[tempDoublePtr >> 3] = $1; + $4 = HEAP32[tempDoublePtr >> 2] | 0; + $5 = HEAP32[tempDoublePtr + 4 >> 2] | 0; + $6 = _bitshift64Lshr($2 | 0, $3 | 0, 52) | 0; + getTempRet0() | 0; + $8 = $6 & 2047; + $9 = _bitshift64Lshr($4 | 0, $5 | 0, 52) | 0; + getTempRet0() | 0; + $11 = $9 & 2047; + $12 = $3 & -2147483648; + $13 = _bitshift64Shl($4 | 0, $5 | 0, 1) | 0; + $14 = getTempRet0() | 0; + L1 : do if (!(($13 | 0) == 0 & ($14 | 0) == 0) ? ($18 = ___DOUBLE_BITS_273($1) | 0, $20 = (getTempRet0() | 0) & 2147483647, !(($8 | 0) == 2047 | ($20 >>> 0 > 2146435072 | ($20 | 0) == 2146435072 & $18 >>> 0 > 0))) : 0) { + $29 = _bitshift64Shl($2 | 0, $3 | 0, 1) | 0; + $30 = getTempRet0() | 0; + if (!($30 >>> 0 > $14 >>> 0 | ($30 | 0) == ($14 | 0) & $29 >>> 0 > $13 >>> 0)) return +(($29 | 0) == ($13 | 0) & ($30 | 0) == ($14 | 0) ? $0 * 0.0 : $0); + if (!$8) { + $41 = _bitshift64Shl($2 | 0, $3 | 0, 12) | 0; + $42 = getTempRet0() | 0; + if (($42 | 0) > -1 | ($42 | 0) == -1 & $41 >>> 0 > 4294967295) { + $$073100 = 0; + $49 = $41; + $50 = $42; + while (1) { + $48 = $$073100 + -1 | 0; + $49 = _bitshift64Shl($49 | 0, $50 | 0, 1) | 0; + $50 = getTempRet0() | 0; + if (!(($50 | 0) > -1 | ($50 | 0) == -1 & $49 >>> 0 > 4294967295)) { + $$073$lcssa = $48; + break; + } else $$073100 = $48; + } + } else $$073$lcssa = 0; + $59 = _bitshift64Shl($2 | 0, $3 | 0, 1 - $$073$lcssa | 0) | 0; + $$174 = $$073$lcssa; + $87 = $59; + $88 = getTempRet0() | 0; + } else { + $$174 = $8; + $87 = $2; + $88 = $3 & 1048575 | 1048576; + } + if (!$11) { + $64 = _bitshift64Shl($4 | 0, $5 | 0, 12) | 0; + $65 = getTempRet0() | 0; + if (($65 | 0) > -1 | ($65 | 0) == -1 & $64 >>> 0 > 4294967295) { + $$07194 = 0; + $72 = $64; + $73 = $65; + while (1) { + $71 = $$07194 + -1 | 0; + $72 = _bitshift64Shl($72 | 0, $73 | 0, 1) | 0; + $73 = getTempRet0() | 0; + if (!(($73 | 0) > -1 | ($73 | 0) == -1 & $72 >>> 0 > 4294967295)) { + $$071$lcssa = $71; + break; + } else $$07194 = $71; + } + } else $$071$lcssa = 0; + $82 = _bitshift64Shl($4 | 0, $5 | 0, 1 - $$071$lcssa | 0) | 0; + $$172 = $$071$lcssa; + $89 = $82; + $90 = getTempRet0() | 0; + } else { + $$172 = $11; + $89 = $4; + $90 = $5 & 1048575 | 1048576; + } + $91 = _i64Subtract($87 | 0, $88 | 0, $89 | 0, $90 | 0) | 0; + $92 = getTempRet0() | 0; + $97 = ($92 | 0) > -1 | ($92 | 0) == -1 & $91 >>> 0 > 4294967295; + L25 : do if (($$174 | 0) > ($$172 | 0)) { + $$27585 = $$174; + $101 = $92; + $158 = $97; + $159 = $87; + $160 = $88; + $99 = $91; + while (1) { + if ($158) if (($99 | 0) == 0 & ($101 | 0) == 0) break; else { + $104 = $99; + $105 = $101; + } else { + $104 = $159; + $105 = $160; + } + $106 = _bitshift64Shl($104 | 0, $105 | 0, 1) | 0; + $107 = getTempRet0() | 0; + $108 = $$27585 + -1 | 0; + $110 = _i64Subtract($106 | 0, $107 | 0, $89 | 0, $90 | 0) | 0; + $111 = getTempRet0() | 0; + $116 = ($111 | 0) > -1 | ($111 | 0) == -1 & $110 >>> 0 > 4294967295; + if (($108 | 0) > ($$172 | 0)) { + $$27585 = $108; + $101 = $111; + $158 = $116; + $159 = $106; + $160 = $107; + $99 = $110; + } else { + $$275$lcssa = $108; + $$lcssa = $116; + $118 = $110; + $120 = $111; + $156 = $106; + $157 = $107; + break L25; + } + } + $$070 = $0 * 0.0; + break L1; + } else { + $$275$lcssa = $$174; + $$lcssa = $97; + $118 = $91; + $120 = $92; + $156 = $87; + $157 = $88; + } while (0); + if ($$lcssa) if (($118 | 0) == 0 & ($120 | 0) == 0) { + $$070 = $0 * 0.0; + break; + } else { + $124 = $120; + $126 = $118; + } else { + $124 = $157; + $126 = $156; + } + if ($124 >>> 0 < 1048576 | ($124 | 0) == 1048576 & $126 >>> 0 < 0) { + $$37682 = $$275$lcssa; + $130 = $126; + $131 = $124; + while (1) { + $132 = _bitshift64Shl($130 | 0, $131 | 0, 1) | 0; + $133 = getTempRet0() | 0; + $134 = $$37682 + -1 | 0; + if ($133 >>> 0 < 1048576 | ($133 | 0) == 1048576 & $132 >>> 0 < 0) { + $$37682 = $134; + $130 = $132; + $131 = $133; + } else { + $$376$lcssa = $134; + $141 = $132; + $142 = $133; + break; + } + } + } else { + $$376$lcssa = $$275$lcssa; + $141 = $126; + $142 = $124; + } + if (($$376$lcssa | 0) > 0) { + $143 = _i64Add($141 | 0, $142 | 0, 0, -1048576) | 0; + $144 = getTempRet0() | 0; + $145 = _bitshift64Shl($$376$lcssa | 0, 0, 52) | 0; + $153 = $144 | (getTempRet0() | 0); + $155 = $143 | $145; + } else { + $150 = _bitshift64Lshr($141 | 0, $142 | 0, 1 - $$376$lcssa | 0) | 0; + $153 = getTempRet0() | 0; + $155 = $150; + } + HEAP32[tempDoublePtr >> 2] = $155; + HEAP32[tempDoublePtr + 4 >> 2] = $153 | $12; + $$070 = +HEAPF64[tempDoublePtr >> 3]; + } else label = 3; while (0); + if ((label | 0) == 3) { + $27 = $0 * $1; + $$070 = $27 / $27; + } + return +$$070; +} + +function _ar2GetTransMatHomography2_177($initConv, $pos2d, $pos3d, $num, $conv) { + $initConv = $initConv | 0; + $pos2d = $pos2d | 0; + $pos3d = $pos3d | 0; + $num = $num | 0; + $conv = $conv | 0; + var $4 = 0.0, $6 = 0.0, $add36 = 0.0, $add50 = 0.0, $add62 = 0.0, $arrayidx188 = 0, $arrayidx192 = 0, $arrayidx196 = 0, $arrayidx2 = 0, $arrayidx200 = 0, $arrayidx204 = 0, $arrayidx208 = 0, $arrayidx212 = 0, $arrayidx30 = 0, $arrayidx35 = 0, $arrayidx38 = 0, $arrayidx43 = 0, $arrayidx49 = 0, $arrayidx52 = 0, $arrayidx57 = 0, $call = 0, $call8 = 0, $conv167 = 0.0, $dH = 0, $div168 = 0.0, $div86 = 0.0, $div92 = 0.0, $div96 = 0.0, $err0$0 = 0.0, $err1$0 = 0.0, $i$0 = 0, $i$1 = 0, $j$0 = 0, $j$1 = 0, $mul180 = 0, $mul66 = 0.0, $mul78 = 0, $mul87 = 0, $retval$0 = 0.0, $sub = 0.0, $sub73 = 0.0, $vararg_buffer = 0, $vararg_buffer1 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $vararg_buffer1 = sp + 40 | 0; + $vararg_buffer = sp + 32 | 0; + $dH = sp; + do if (($num | 0) >= 4 ? ($arrayidx2 = $initConv + 44 | 0, !(+HEAPF32[$arrayidx2 >> 2] == 0.0)) : 0) { + $call = _malloc($num << 6) | 0; + if (!$call) { + _arLog(0, 3, 45947, $vararg_buffer); + $retval$0 = -1.0; + break; + } + $call8 = _malloc($num << 3) | 0; + if (!$call8) { + _arLog(0, 3, 45947, $vararg_buffer1); + _free($call); + $retval$0 = -1.0; + break; + } + $j$0 = 0; + while (1) { + if (($j$0 | 0) == 3) break; + $i$0 = 0; + while (1) { + if (($i$0 | 0) == 4) break; + HEAPF32[$conv + ($j$0 << 4) + ($i$0 << 2) >> 2] = +HEAPF32[$initConv + ($j$0 << 4) + ($i$0 << 2) >> 2] / +HEAPF32[$arrayidx2 >> 2]; + $i$0 = $i$0 + 1 | 0; + } + $j$0 = $j$0 + 1 | 0; + } + $arrayidx30 = $conv + 4 | 0; + $arrayidx35 = $conv + 12 | 0; + $arrayidx38 = $conv + 16 | 0; + $arrayidx43 = $conv + 20 | 0; + $arrayidx49 = $conv + 28 | 0; + $arrayidx52 = $conv + 32 | 0; + $arrayidx57 = $conv + 36 | 0; + $conv167 = +($num | 0); + $mul180 = $num << 1; + $arrayidx188 = $dH + 4 | 0; + $arrayidx192 = $dH + 8 | 0; + $arrayidx196 = $dH + 12 | 0; + $arrayidx200 = $dH + 16 | 0; + $arrayidx204 = $dH + 20 | 0; + $arrayidx208 = $dH + 24 | 0; + $arrayidx212 = $dH + 28 | 0; + $err0$0 = 0.0; + $i$1 = 0; + L18 : while (1) { + $err1$0 = 0.0; + $j$1 = 0; + while (1) { + if (($j$1 | 0) >= ($num | 0)) break; + $4 = +HEAPF32[$pos3d + ($j$1 * 12 | 0) >> 2]; + $6 = +HEAPF32[$pos3d + ($j$1 * 12 | 0) + 4 >> 2]; + $add36 = +HEAPF32[$arrayidx35 >> 2] + (+HEAPF32[$conv >> 2] * $4 + +HEAPF32[$arrayidx30 >> 2] * $6); + $add50 = +HEAPF32[$arrayidx49 >> 2] + ($4 * +HEAPF32[$arrayidx38 >> 2] + $6 * +HEAPF32[$arrayidx43 >> 2]); + $add62 = $4 * +HEAPF32[$arrayidx52 >> 2] + $6 * +HEAPF32[$arrayidx57 >> 2] + 1.0; + if ($add62 == 0.0) { + label = 17; + break L18; + } + $mul66 = $add62 * $add62; + $sub = +HEAPF32[$pos2d + ($j$1 << 3) >> 2] - $add36 / $add62; + $sub73 = +HEAPF32[$pos2d + ($j$1 << 3) + 4 >> 2] - $add50 / $add62; + $mul78 = $j$1 << 1; + HEAPF32[$call8 + ($mul78 << 2) >> 2] = $sub; + HEAPF32[$call8 + (($mul78 | 1) << 2) >> 2] = $sub73; + $div86 = $4 / $add62; + $mul87 = $j$1 << 4; + HEAPF32[$call + ($mul87 << 2) >> 2] = $div86; + $div92 = $6 / $add62; + HEAPF32[$call + (($mul87 | 1) << 2) >> 2] = $div92; + $div96 = 1.0 / $add62; + HEAPF32[$call + (($mul87 | 2) << 2) >> 2] = $div96; + HEAPF32[$call + (($mul87 | 3) << 2) >> 2] = 0.0; + HEAPF32[$call + (($mul87 | 4) << 2) >> 2] = 0.0; + HEAPF32[$call + (($mul87 | 5) << 2) >> 2] = 0.0; + HEAPF32[$call + (($mul87 | 6) << 2) >> 2] = -($4 * $add36) / $mul66; + HEAPF32[$call + (($mul87 | 7) << 2) >> 2] = -($6 * $add36) / $mul66; + HEAPF32[$call + (($mul87 | 8) << 2) >> 2] = 0.0; + HEAPF32[$call + (($mul87 | 9) << 2) >> 2] = 0.0; + HEAPF32[$call + (($mul87 | 10) << 2) >> 2] = 0.0; + HEAPF32[$call + (($mul87 | 11) << 2) >> 2] = $div86; + HEAPF32[$call + (($mul87 | 12) << 2) >> 2] = $div92; + HEAPF32[$call + (($mul87 | 13) << 2) >> 2] = $div96; + HEAPF32[$call + (($mul87 | 14) << 2) >> 2] = -($4 * $add50) / $mul66; + HEAPF32[$call + (($mul87 | 15) << 2) >> 2] = -($6 * $add50) / $mul66; + $err1$0 = $err1$0 + ($sub * $sub + $sub73 * $sub73); + $j$1 = $j$1 + 1 | 0; + } + $div168 = $err1$0 / $conv167; + if ($div168 < .10000000149011612) { + label = 26; + break; + } + if (($i$1 | 0) != 0 & $div168 < 4.0) { + if (($i$1 | 0) == 10 | $div168 / $err0$0 > .9900000095367432) { + label = 26; + break; + } + } else if (($i$1 | 0) == 10) { + label = 26; + break; + } + if ((_getDeltaS_181($dH, $call8, $call, $mul180) | 0) < 0) { + label = 24; + break; + } + HEAPF32[$conv >> 2] = +HEAPF32[$dH >> 2] + +HEAPF32[$conv >> 2]; + HEAPF32[$arrayidx30 >> 2] = +HEAPF32[$arrayidx188 >> 2] + +HEAPF32[$arrayidx30 >> 2]; + HEAPF32[$arrayidx35 >> 2] = +HEAPF32[$arrayidx192 >> 2] + +HEAPF32[$arrayidx35 >> 2]; + HEAPF32[$arrayidx38 >> 2] = +HEAPF32[$arrayidx196 >> 2] + +HEAPF32[$arrayidx38 >> 2]; + HEAPF32[$arrayidx43 >> 2] = +HEAPF32[$arrayidx200 >> 2] + +HEAPF32[$arrayidx43 >> 2]; + HEAPF32[$arrayidx49 >> 2] = +HEAPF32[$arrayidx204 >> 2] + +HEAPF32[$arrayidx49 >> 2]; + HEAPF32[$arrayidx52 >> 2] = +HEAPF32[$arrayidx208 >> 2] + +HEAPF32[$arrayidx52 >> 2]; + HEAPF32[$arrayidx57 >> 2] = +HEAPF32[$arrayidx212 >> 2] + +HEAPF32[$arrayidx57 >> 2]; + $err0$0 = $div168; + $i$1 = $i$1 + 1 | 0; + } + if ((label | 0) == 17) { + _free($call); + _free($call8); + $retval$0 = 1.0e8; + break; + } else if ((label | 0) == 24) { + _free($call); + _free($call8); + $retval$0 = 1.0e8; + break; + } else if ((label | 0) == 26) { + _free($call); + _free($call8); + $retval$0 = $div168; + break; + } + } else $retval$0 = 1.0e8; while (0); + STACKTOP = sp; + return +$retval$0; +} + +function _jpeg_idct_14x7($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0275283 = 0, $$0277282 = 0, $$0278281 = 0, $$0284 = 0, $$1276279 = 0, $$1280 = 0, $110 = 0, $113 = 0, $116 = 0, $118 = 0, $121 = 0, $122 = 0, $124 = 0, $126 = 0, $128 = 0, $130 = 0, $132 = 0, $134 = 0, $136 = 0, $139 = 0, $140 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $147 = 0, $149 = 0, $15 = 0, $151 = 0, $154 = 0, $155 = 0, $157 = 0, $158 = 0, $162 = 0, $163 = 0, $166 = 0, $168 = 0, $169 = 0, $172 = 0, $175 = 0, $178 = 0, $180 = 0, $184 = 0, $187 = 0, $190 = 0, $21 = 0, $27 = 0, $33 = 0, $35 = 0, $37 = 0, $41 = 0, $42 = 0, $45 = 0, $48 = 0, $5 = 0, $51 = 0, $59 = 0, $65 = 0, $7 = 0, $71 = 0, $73 = 0, $75 = 0, $79 = 0, $80 = 0, $82 = 0, $83 = 0, $86 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 224 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(224); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0275283 = $5; + $$0277282 = HEAP32[$1 + 84 >> 2] | 0; + $$0278281 = $2; + $$0284 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0278281 >> 1] << 13, HEAP32[$$0277282 >> 2] | 0) | 0 | 1024; + $21 = Math_imul(HEAP32[$$0277282 + 64 >> 2] | 0, HEAP16[$$0278281 + 32 >> 1] | 0) | 0; + $27 = Math_imul(HEAP32[$$0277282 + 128 >> 2] | 0, HEAP16[$$0278281 + 64 >> 1] | 0) | 0; + $33 = Math_imul(HEAP32[$$0277282 + 192 >> 2] | 0, HEAP16[$$0278281 + 96 >> 1] | 0) | 0; + $35 = ($27 - $33 | 0) * 7223 | 0; + $37 = ($21 - $27 | 0) * 2578 | 0; + $41 = (Math_imul($27, -15083) | 0) + $15 + $37 + $35 | 0; + $42 = $33 + $21 | 0; + $45 = ($42 * 10438 | 0) + $15 | 0; + $48 = $35 + (Math_imul($33, -637) | 0) + $45 | 0; + $51 = $37 + (Math_imul($21, -20239) | 0) + $45 | 0; + $59 = Math_imul(HEAP32[$$0277282 + 32 >> 2] | 0, HEAP16[$$0278281 + 16 >> 1] | 0) | 0; + $65 = Math_imul(HEAP32[$$0277282 + 96 >> 2] | 0, HEAP16[$$0278281 + 48 >> 1] | 0) | 0; + $71 = Math_imul(HEAP32[$$0277282 + 160 >> 2] | 0, HEAP16[$$0278281 + 80 >> 1] | 0) | 0; + $73 = ($65 + $59 | 0) * 7663 | 0; + $75 = ($59 - $65 | 0) * 1395 | 0; + $79 = Math_imul($71 + $65 | 0, -11295) | 0; + $80 = $73 + $75 + $79 | 0; + $82 = ($71 + $59 | 0) * 5027 | 0; + $83 = $82 + ($73 - $75) | 0; + $86 = $82 + ($71 * 15326 | 0) + $79 | 0; + HEAP32[$$0275283 >> 2] = $83 + $48 >> 11; + HEAP32[$$0275283 + 192 >> 2] = $48 - $83 >> 11; + HEAP32[$$0275283 + 32 >> 2] = $80 + $41 >> 11; + HEAP32[$$0275283 + 160 >> 2] = $41 - $80 >> 11; + HEAP32[$$0275283 + 64 >> 2] = $86 + $51 >> 11; + HEAP32[$$0275283 + 128 >> 2] = $51 - $86 >> 11; + HEAP32[$$0275283 + 96 >> 2] = (($27 - $42 | 0) * 11585 | 0) + $15 >> 11; + $$0284 = $$0284 + 1 | 0; + if (($$0284 | 0) == 8) break; else { + $$0275283 = $$0275283 + 4 | 0; + $$0277282 = $$0277282 + 4 | 0; + $$0278281 = $$0278281 + 2 | 0; + } + } + $110 = $7 + -384 | 0; + $$1276279 = $5; + $$1280 = 0; + while (1) { + $113 = (HEAP32[$3 + ($$1280 << 2) >> 2] | 0) + $4 | 0; + $116 = (HEAP32[$$1276279 >> 2] << 13) + 134348800 | 0; + $118 = HEAP32[$$1276279 + 16 >> 2] | 0; + $121 = $116 + ($118 * 10438 | 0) | 0; + $122 = $116 + ($118 * 2578 | 0) | 0; + $124 = $116 + (Math_imul($118, -7223) | 0) | 0; + $126 = $116 + (Math_imul($118, -11586) | 0) | 0; + $128 = HEAP32[$$1276279 + 8 >> 2] | 0; + $130 = HEAP32[$$1276279 + 24 >> 2] | 0; + $132 = ($130 + $128 | 0) * 9058 | 0; + $134 = $132 + ($128 * 2237 | 0) | 0; + $136 = $132 + (Math_imul($130, -14084) | 0) | 0; + $139 = (Math_imul($130, -11295) | 0) + ($128 * 5027 | 0) | 0; + $140 = $134 + $121 | 0; + $141 = $121 - $134 | 0; + $142 = $136 + $122 | 0; + $143 = $122 - $136 | 0; + $144 = $139 + $124 | 0; + $145 = $124 - $139 | 0; + $147 = HEAP32[$$1276279 + 4 >> 2] | 0; + $149 = HEAP32[$$1276279 + 12 >> 2] | 0; + $151 = HEAP32[$$1276279 + 20 >> 2] | 0; + $154 = HEAP32[$$1276279 + 28 >> 2] << 13; + $155 = $151 + $147 | 0; + $157 = ($149 + $147 | 0) * 10935 | 0; + $158 = $155 * 9810 | 0; + $162 = $157 + (Math_imul($147, -9232) | 0) + $158 + $154 | 0; + $163 = $155 * 6164 | 0; + $166 = $147 - $149 | 0; + $168 = ($166 * 3826 | 0) - $154 | 0; + $169 = $163 + (Math_imul($147, -8693) | 0) + $168 | 0; + $172 = (Math_imul($151 + $149 | 0, -1297) | 0) - $154 | 0; + $175 = $157 + (Math_imul($149, -3474) | 0) + $172 | 0; + $178 = $158 + (Math_imul($151, -19447) | 0) + $172 | 0; + $180 = ($151 - $149 | 0) * 11512 | 0; + $184 = $154 + (Math_imul($151, -13850) | 0) + $180 + $163 | 0; + $187 = $180 + ($149 * 5529 | 0) + $168 | 0; + $190 = ($166 - $151 << 13) + $154 | 0; + HEAP8[$113 >> 0] = HEAP8[$110 + (($162 + $140 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 13 >> 0] = HEAP8[$110 + (($140 - $162 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 1 >> 0] = HEAP8[$110 + (($175 + $142 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 12 >> 0] = HEAP8[$110 + (($142 - $175 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 2 >> 0] = HEAP8[$110 + (($178 + $144 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 11 >> 0] = HEAP8[$110 + (($144 - $178 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 3 >> 0] = HEAP8[$110 + (($190 + $126 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 10 >> 0] = HEAP8[$110 + (($126 - $190 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 4 >> 0] = HEAP8[$110 + (($184 + $145 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 9 >> 0] = HEAP8[$110 + (($145 - $184 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 5 >> 0] = HEAP8[$110 + (($187 + $143 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 8 >> 0] = HEAP8[$110 + (($143 - $187 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 6 >> 0] = HEAP8[$110 + (($169 + $141 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 7 >> 0] = HEAP8[$110 + (($141 - $169 | 0) >>> 18 & 1023) >> 0] | 0; + $$1280 = $$1280 + 1 | 0; + if (($$1280 | 0) == 7) break; else $$1276279 = $$1276279 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function _decode_mcu_DC_first_62($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0100$lcssa = 0, $$0100117 = 0, $$0104$lcssa = 0, $$0104116 = 0, $$017$i = 0, $$094 = 0, $$099118 = 0, $$1101 = 0, $$1105 = 0, $$2 = 0, $$2102 = 0, $$2106 = 0, $$298$ph = 0, $$3 = 0, $$4$ph = 0, $$4108$ph = 0, $$5 = 0, $$5109 = 0, $$6 = 0, $$6110 = 0, $$in = 0, $105 = 0, $107 = 0, $11 = 0, $113 = 0, $115 = 0, $116 = 0, $14 = 0, $18 = 0, $19 = 0, $2 = 0, $26 = 0, $3 = 0, $43 = 0, $44 = 0, $45 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $57 = 0, $58 = 0, $60 = 0, $62 = 0, $68 = 0, $7 = 0, $72 = 0, $73 = 0, $77 = 0, $79 = 0, $8 = 0, $85 = 0, $95 = 0, $98 = 0, $99 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $2 = sp + 20 | 0; + $3 = sp; + $5 = HEAP32[$0 + 468 >> 2] | 0; + $7 = HEAP32[$0 + 424 >> 2] | 0; + $8 = $0 + 280 | 0; + if (HEAP32[$8 >> 2] | 0 ? ($11 = $5 + 44 | 0, (HEAP32[$11 >> 2] | 0) == 0) : 0) { + $14 = $5 + 16 | 0; + $18 = HEAP32[$0 + 464 >> 2] | 0; + $19 = $18 + 24 | 0; + HEAP32[$19 >> 2] = (HEAP32[$19 >> 2] | 0) + ((HEAP32[$14 >> 2] | 0) / 8 | 0); + HEAP32[$14 >> 2] = 0; + if (!(FUNCTION_TABLE_ii[HEAP32[$18 + 8 >> 2] & 127]($0) | 0)) { + $$2 = 0; + STACKTOP = sp; + return $$2 | 0; + } + $26 = $0 + 340 | 0; + if ((HEAP32[$26 >> 2] | 0) > 0) { + $$017$i = 0; + do { + HEAP32[$5 + 24 + ($$017$i << 2) >> 2] = 0; + $$017$i = $$017$i + 1 | 0; + } while (($$017$i | 0) < (HEAP32[$26 >> 2] | 0)); + } + HEAP32[$5 + 20 >> 2] = 0; + HEAP32[$11 >> 2] = HEAP32[$8 >> 2]; + if (!(HEAP32[$0 + 440 >> 2] | 0)) HEAP32[$5 + 40 >> 2] = 0; + } + if (!(HEAP32[$5 + 40 >> 2] | 0)) { + HEAP32[$2 + 16 >> 2] = $0; + $43 = $0 + 24 | 0; + $44 = HEAP32[$43 >> 2] | 0; + $45 = HEAP32[$44 >> 2] | 0; + HEAP32[$2 >> 2] = $45; + $47 = HEAP32[$44 + 4 >> 2] | 0; + $48 = $2 + 4 | 0; + HEAP32[$48 >> 2] = $47; + $49 = $5 + 12 | 0; + $50 = HEAP32[$49 >> 2] | 0; + $51 = $5 + 16 | 0; + $52 = HEAP32[$51 >> 2] | 0; + $53 = $5 + 20 | 0; + HEAP32[$3 >> 2] = HEAP32[$53 >> 2]; + HEAP32[$3 + 4 >> 2] = HEAP32[$53 + 4 >> 2]; + HEAP32[$3 + 8 >> 2] = HEAP32[$53 + 8 >> 2]; + HEAP32[$3 + 12 >> 2] = HEAP32[$53 + 12 >> 2]; + HEAP32[$3 + 16 >> 2] = HEAP32[$53 + 16 >> 2]; + $54 = $0 + 368 | 0; + do if ((HEAP32[$54 >> 2] | 0) > 0) { + $57 = $2 + 8 | 0; + $58 = $2 + 12 | 0; + $$0100117 = $52; + $$0104116 = $50; + $$099118 = 0; + while (1) { + $60 = HEAP32[$1 + ($$099118 << 2) >> 2] | 0; + $62 = HEAP32[$0 + 372 + ($$099118 << 2) >> 2] | 0; + $68 = HEAP32[$5 + 48 + (HEAP32[(HEAP32[$0 + 344 + ($62 << 2) >> 2] | 0) + 20 >> 2] << 2) >> 2] | 0; + if (($$0100117 | 0) < 8) { + if (!(_jpeg_fill_bit_buffer($2, $$0104116, $$0100117, 0) | 0)) { + $$2 = 0; + label = 28; + break; + } + $72 = HEAP32[$57 >> 2] | 0; + $73 = HEAP32[$58 >> 2] | 0; + if (($73 | 0) < 8) { + $$094 = 1; + $$2102 = $73; + $$2106 = $72; + label = 17; + } else { + $$1101 = $73; + $$1105 = $72; + label = 15; + } + } else { + $$1101 = $$0100117; + $$1105 = $$0104116; + label = 15; + } + if ((label | 0) == 15) { + label = 0; + $77 = $$1105 >> $$1101 + -8 & 255; + $79 = HEAP32[$68 + 144 + ($77 << 2) >> 2] | 0; + if (!$79) { + $$094 = 9; + $$2102 = $$1101; + $$2106 = $$1105; + label = 17; + } else { + $$298$ph = HEAPU8[$68 + 1168 + $77 >> 0] | 0; + $$4$ph = $$1101 - $79 | 0; + $$4108$ph = $$1105; + } + } + if ((label | 0) == 17) { + label = 0; + $85 = _jpeg_huff_decode($2, $$2106, $$2102, $68, $$094) | 0; + if (($85 | 0) < 0) { + $$2 = 0; + label = 28; + break; + } + $$298$ph = $85; + $$4$ph = HEAP32[$58 >> 2] | 0; + $$4108$ph = HEAP32[$57 >> 2] | 0; + } + if (!$$298$ph) { + $$3 = 0; + $$6 = $$4$ph; + $$6110 = $$4108$ph; + } else { + if (($$4$ph | 0) < ($$298$ph | 0)) { + if (!(_jpeg_fill_bit_buffer($2, $$4108$ph, $$4$ph, $$298$ph) | 0)) { + $$2 = 0; + label = 28; + break; + } + $$5 = HEAP32[$58 >> 2] | 0; + $$5109 = HEAP32[$57 >> 2] | 0; + } else { + $$5 = $$4$ph; + $$5109 = $$4108$ph; + } + $95 = $$5 - $$298$ph | 0; + $98 = HEAP32[5184 + ($$298$ph << 2) >> 2] | 0; + $99 = $$5109 >> $95 & $98; + $$3 = $99 - (($99 | 0) > (HEAP32[5184 + ($$298$ph + -1 << 2) >> 2] | 0) ? 0 : $98) | 0; + $$6 = $95; + $$6110 = $$5109; + } + $105 = $3 + 4 + ($62 << 2) | 0; + $107 = (HEAP32[$105 >> 2] | 0) + $$3 | 0; + HEAP32[$105 >> 2] = $107; + HEAP16[$60 >> 1] = $107 << $7; + $$099118 = $$099118 + 1 | 0; + if (($$099118 | 0) >= (HEAP32[$54 >> 2] | 0)) { + label = 25; + break; + } else { + $$0100117 = $$6; + $$0104116 = $$6110; + } + } + if ((label | 0) == 25) { + $$0100$lcssa = $$6; + $$0104$lcssa = $$6110; + $$in = HEAP32[$43 >> 2] | 0; + $113 = HEAP32[$2 >> 2] | 0; + $115 = HEAP32[$48 >> 2] | 0; + break; + } else if ((label | 0) == 28) { + STACKTOP = sp; + return $$2 | 0; + } + } else { + $$0100$lcssa = $52; + $$0104$lcssa = $50; + $$in = $44; + $113 = $45; + $115 = $47; + } while (0); + HEAP32[$$in >> 2] = $113; + HEAP32[$$in + 4 >> 2] = $115; + HEAP32[$49 >> 2] = $$0104$lcssa; + HEAP32[$51 >> 2] = $$0100$lcssa; + HEAP32[$53 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$53 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + HEAP32[$53 + 8 >> 2] = HEAP32[$3 + 8 >> 2]; + HEAP32[$53 + 12 >> 2] = HEAP32[$3 + 12 >> 2]; + HEAP32[$53 + 16 >> 2] = HEAP32[$3 + 16 >> 2]; + } + $116 = $5 + 44 | 0; + HEAP32[$116 >> 2] = (HEAP32[$116 >> 2] | 0) + -1; + $$2 = 1; + STACKTOP = sp; + return $$2 | 0; +} + +function _decompress_onepass($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$0101123 = 0, $$0102113$us = 0, $$0103121 = 0, $$0104115$us = 0, $$0105120 = 0, $$0106128 = 0, $$0107114 = 0, $$0107114$us = 0, $$0108112$us = 0, $$1116 = 0, $$1116$us = 0, $$2 = 0, $$pre$phiZ2D = 0, $$pre137 = 0, $$sink = 0, $10 = 0, $102 = 0, $104 = 0, $105 = 0, $11 = 0, $112 = 0, $12 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $13 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $24 = 0, $3 = 0, $35 = 0, $37 = 0, $39 = 0, $48 = 0, $50 = 0, $51 = 0, $53 = 0, $54 = 0, $55 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $63 = 0, $64 = 0, $7 = 0, $77 = 0, $8 = 0, $80 = 0, $87 = 0, $9 = 0, $92 = 0, $93 = 0, $95 = 0, $97 = 0, $98 = 0, label = 0; + $2 = $0 + 452 | 0; + $3 = HEAP32[$2 >> 2] | 0; + $6 = (HEAP32[$0 + 360 >> 2] | 0) + -1 | 0; + $7 = $0 + 332 | 0; + $8 = HEAP32[$7 >> 2] | 0; + $9 = $8 + -1 | 0; + $10 = $3 + 24 | 0; + $11 = HEAP32[$10 >> 2] | 0; + $12 = $3 + 28 | 0; + $13 = HEAP32[$12 >> 2] | 0; + do if (($11 | 0) < ($13 | 0)) { + $15 = $3 + 20 | 0; + $16 = $0 + 436 | 0; + $17 = $0 + 468 | 0; + $18 = $3 + 32 | 0; + $19 = $0 + 368 | 0; + $20 = $0 + 340 | 0; + $21 = $0 + 472 | 0; + $22 = $0 + 148 | 0; + $$0106128 = $11; + $123 = $13; + $24 = HEAP32[$15 >> 2] | 0; + L3 : while (1) { + if ($24 >>> 0 > $6 >>> 0) $97 = $123; else { + $$0101123 = $24; + while (1) { + if (HEAP32[$16 >> 2] | 0) _memset(HEAP32[$18 >> 2] | 0, 0, HEAP32[$19 >> 2] << 7 | 0) | 0; + if (!(FUNCTION_TABLE_iii[HEAP32[(HEAP32[$17 >> 2] | 0) + 4 >> 2] & 127]($0, $18) | 0)) break L3; + $35 = HEAP32[$20 >> 2] | 0; + if (($35 | 0) > 0) { + $37 = $$0101123 >>> 0 < $6 >>> 0; + $$0103121 = 0; + $$0105120 = 0; + $124 = $35; + while (1) { + $39 = HEAP32[$0 + 344 + ($$0105120 << 2) >> 2] | 0; + L17 : do if (HEAP32[$39 + 52 >> 2] | 0) { + $48 = HEAP32[$39 + 4 >> 2] | 0; + $50 = HEAP32[(HEAP32[$21 >> 2] | 0) + 4 + ($48 << 2) >> 2] | 0; + $51 = $39 + 56 | 0; + $53 = HEAP32[($37 ? $51 : $39 + 72 | 0) >> 2] | 0; + $54 = $39 + 40 | 0; + $55 = HEAP32[$54 >> 2] | 0; + $58 = Math_imul(HEAP32[$39 + 68 >> 2] | 0, $$0101123) | 0; + $59 = $39 + 60 | 0; + $60 = HEAP32[$59 >> 2] | 0; + if (($60 | 0) > 0) { + $63 = $39 + 76 | 0; + $64 = $39 + 36 | 0; + if (($53 | 0) <= 0) { + $$pre137 = HEAP32[$51 >> 2] | 0; + $$0107114 = 0; + $$1116 = $$0103121; + while (1) { + $87 = $$pre137 + $$1116 | 0; + $$0107114 = $$0107114 + 1 | 0; + if (($$0107114 | 0) >= ($60 | 0)) { + $$2 = $87; + $92 = $124; + break L17; + } else $$1116 = $87; + } + } + $$0104115$us = (HEAP32[$1 + ($48 << 2) >> 2] | 0) + ((Math_imul($55, $$0106128) | 0) << 2) | 0; + $$0107114$us = 0; + $$1116$us = $$0103121; + $125 = $60; + $126 = $55; + while (1) { + if ((HEAP32[$22 >> 2] | 0) >>> 0 >= $9 >>> 0 ? ($$0107114$us + $$0106128 | 0) >= (HEAP32[$63 >> 2] | 0) : 0) { + $77 = $126; + $80 = $125; + } else { + $$0102113$us = $58; + $$0108112$us = 0; + while (1) { + FUNCTION_TABLE_viiiii[$50 & 63]($0, $39, HEAP32[$3 + 32 + ($$0108112$us + $$1116$us << 2) >> 2] | 0, $$0104115$us, $$0102113$us); + $$0108112$us = $$0108112$us + 1 | 0; + if (($$0108112$us | 0) == ($53 | 0)) break; else $$0102113$us = (HEAP32[$64 >> 2] | 0) + $$0102113$us | 0; + } + $77 = HEAP32[$54 >> 2] | 0; + $80 = HEAP32[$59 >> 2] | 0; + } + $$1116$us = (HEAP32[$51 >> 2] | 0) + $$1116$us | 0; + $$0107114$us = $$0107114$us + 1 | 0; + if (($$0107114$us | 0) >= ($80 | 0)) break; else { + $$0104115$us = $$0104115$us + ($77 << 2) | 0; + $125 = $80; + $126 = $77; + } + } + $$2 = $$1116$us; + $92 = HEAP32[$20 >> 2] | 0; + } else { + $$2 = $$0103121; + $92 = $124; + } + } else { + $$2 = (HEAP32[$39 + 64 >> 2] | 0) + $$0103121 | 0; + $92 = $124; + } while (0); + $$0105120 = $$0105120 + 1 | 0; + if (($$0105120 | 0) >= ($92 | 0)) break; else { + $$0103121 = $$2; + $124 = $92; + } + } + } + $93 = $$0101123 + 1 | 0; + if ($93 >>> 0 > $6 >>> 0) break; else $$0101123 = $93; + } + $97 = HEAP32[$12 >> 2] | 0; + } + HEAP32[$15 >> 2] = 0; + $95 = $$0106128 + 1 | 0; + if (($95 | 0) < ($97 | 0)) { + $$0106128 = $95; + $123 = $97; + $24 = 0; + } else { + label = 30; + break; + } + } + if ((label | 0) == 30) { + $$pre$phiZ2D = $22; + $104 = HEAP32[$7 >> 2] | 0; + break; + } + HEAP32[$10 >> 2] = $$0106128; + HEAP32[$15 >> 2] = $$0101123; + $$0 = 0; + return $$0 | 0; + } else { + $$pre$phiZ2D = $0 + 148 | 0; + $104 = $8; + } while (0); + $98 = $0 + 156 | 0; + HEAP32[$98 >> 2] = (HEAP32[$98 >> 2] | 0) + 1; + $102 = (HEAP32[$$pre$phiZ2D >> 2] | 0) + 1 | 0; + HEAP32[$$pre$phiZ2D >> 2] = $102; + if ($102 >>> 0 >= $104 >>> 0) { + FUNCTION_TABLE_vi[HEAP32[(HEAP32[$0 + 460 >> 2] | 0) + 12 >> 2] & 255]($0); + $$0 = 4; + return $$0 | 0; + } + $105 = HEAP32[$2 >> 2] | 0; + if ((HEAP32[$0 + 340 >> 2] | 0) > 1) $$sink = 1; else { + $112 = HEAP32[$0 + 344 >> 2] | 0; + $$sink = HEAP32[($102 >>> 0 < ($104 + -1 | 0) >>> 0 ? $112 + 12 | 0 : $112 + 76 | 0) >> 2] | 0; + } + HEAP32[$105 + 28 >> 2] = $$sink; + HEAP32[$105 + 20 >> 2] = 0; + HEAP32[$105 + 24 >> 2] = 0; + $$0 = 3; + return $$0 | 0; +} + +function _jpeg_idct_7x14($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0270278 = 0, $$0272277 = 0, $$0273276 = 0, $$0279 = 0, $$1271274 = 0, $$1275 = 0, $100 = 0, $103 = 0, $106 = 0, $108 = 0, $112 = 0, $115 = 0, $118 = 0, $15 = 0, $162 = 0, $165 = 0, $168 = 0, $170 = 0, $172 = 0, $174 = 0, $176 = 0, $178 = 0, $182 = 0, $183 = 0, $186 = 0, $189 = 0, $192 = 0, $196 = 0, $198 = 0, $200 = 0, $202 = 0, $204 = 0, $208 = 0, $209 = 0, $21 = 0, $211 = 0, $212 = 0, $215 = 0, $24 = 0, $25 = 0, $27 = 0, $30 = 0, $36 = 0, $42 = 0, $44 = 0, $46 = 0, $48 = 0, $5 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $63 = 0, $69 = 0, $7 = 0, $75 = 0, $81 = 0, $82 = 0, $83 = 0, $85 = 0, $86 = 0, $90 = 0, $91 = 0, $94 = 0, $96 = 0, $97 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 400 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(400); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0270278 = $5; + $$0272277 = HEAP32[$1 + 84 >> 2] | 0; + $$0273276 = $2; + $$0279 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0273276 >> 1] << 13, HEAP32[$$0272277 >> 2] | 0) | 0 | 1024; + $21 = Math_imul(HEAP32[$$0272277 + 128 >> 2] | 0, HEAP16[$$0273276 + 64 >> 1] | 0) | 0; + $24 = ($21 * 10438 | 0) + $15 | 0; + $25 = ($21 * 2578 | 0) + $15 | 0; + $27 = (Math_imul($21, -7223) | 0) + $15 | 0; + $30 = (Math_imul($21, -11586) | 0) + $15 >> 11; + $36 = Math_imul(HEAP32[$$0272277 + 64 >> 2] | 0, HEAP16[$$0273276 + 32 >> 1] | 0) | 0; + $42 = Math_imul(HEAP32[$$0272277 + 192 >> 2] | 0, HEAP16[$$0273276 + 96 >> 1] | 0) | 0; + $44 = ($42 + $36 | 0) * 9058 | 0; + $46 = $44 + ($36 * 2237 | 0) | 0; + $48 = $44 + (Math_imul($42, -14084) | 0) | 0; + $51 = (Math_imul($42, -11295) | 0) + ($36 * 5027 | 0) | 0; + $52 = $46 + $24 | 0; + $53 = $24 - $46 | 0; + $54 = $48 + $25 | 0; + $55 = $25 - $48 | 0; + $56 = $51 + $27 | 0; + $57 = $27 - $51 | 0; + $63 = Math_imul(HEAP32[$$0272277 + 32 >> 2] | 0, HEAP16[$$0273276 + 16 >> 1] | 0) | 0; + $69 = Math_imul(HEAP32[$$0272277 + 96 >> 2] | 0, HEAP16[$$0273276 + 48 >> 1] | 0) | 0; + $75 = Math_imul(HEAP32[$$0272277 + 160 >> 2] | 0, HEAP16[$$0273276 + 80 >> 1] | 0) | 0; + $81 = Math_imul(HEAP32[$$0272277 + 224 >> 2] | 0, HEAP16[$$0273276 + 112 >> 1] | 0) | 0; + $82 = $81 << 13; + $83 = $75 + $63 | 0; + $85 = ($69 + $63 | 0) * 10935 | 0; + $86 = $83 * 9810 | 0; + $90 = $85 + (Math_imul($63, -9232) | 0) + $86 + $82 | 0; + $91 = $83 * 6164 | 0; + $94 = $63 - $69 | 0; + $96 = ($94 * 3826 | 0) - $82 | 0; + $97 = $91 + (Math_imul($63, -8693) | 0) + $96 | 0; + $100 = (Math_imul($75 + $69 | 0, -1297) | 0) - $82 | 0; + $103 = $85 + (Math_imul($69, -3474) | 0) + $100 | 0; + $106 = $86 + (Math_imul($75, -19447) | 0) + $100 | 0; + $108 = ($75 - $69 | 0) * 11512 | 0; + $112 = $108 + (Math_imul($75, -13850) | 0) + $91 + $82 | 0; + $115 = $108 + ($69 * 5529 | 0) + $96 | 0; + $118 = $94 - $75 + $81 << 2; + HEAP32[$$0270278 >> 2] = $90 + $52 >> 11; + HEAP32[$$0270278 + 364 >> 2] = $52 - $90 >> 11; + HEAP32[$$0270278 + 28 >> 2] = $103 + $54 >> 11; + HEAP32[$$0270278 + 336 >> 2] = $54 - $103 >> 11; + HEAP32[$$0270278 + 56 >> 2] = $106 + $56 >> 11; + HEAP32[$$0270278 + 308 >> 2] = $56 - $106 >> 11; + HEAP32[$$0270278 + 84 >> 2] = $118 + $30; + HEAP32[$$0270278 + 280 >> 2] = $30 - $118; + HEAP32[$$0270278 + 112 >> 2] = $112 + $57 >> 11; + HEAP32[$$0270278 + 252 >> 2] = $57 - $112 >> 11; + HEAP32[$$0270278 + 140 >> 2] = $115 + $55 >> 11; + HEAP32[$$0270278 + 224 >> 2] = $55 - $115 >> 11; + HEAP32[$$0270278 + 168 >> 2] = $97 + $53 >> 11; + HEAP32[$$0270278 + 196 >> 2] = $53 - $97 >> 11; + $$0279 = $$0279 + 1 | 0; + if (($$0279 | 0) == 7) break; else { + $$0270278 = $$0270278 + 4 | 0; + $$0272277 = $$0272277 + 4 | 0; + $$0273276 = $$0273276 + 2 | 0; + } + } + $162 = $7 + -384 | 0; + $$1271274 = $5; + $$1275 = 0; + while (1) { + $165 = (HEAP32[$3 + ($$1275 << 2) >> 2] | 0) + $4 | 0; + $168 = (HEAP32[$$1271274 >> 2] << 13) + 134348800 | 0; + $170 = HEAP32[$$1271274 + 8 >> 2] | 0; + $172 = HEAP32[$$1271274 + 16 >> 2] | 0; + $174 = HEAP32[$$1271274 + 24 >> 2] | 0; + $176 = ($172 - $174 | 0) * 7223 | 0; + $178 = ($170 - $172 | 0) * 2578 | 0; + $182 = (Math_imul($172, -15083) | 0) + $168 + $178 + $176 | 0; + $183 = $174 + $170 | 0; + $186 = ($183 * 10438 | 0) + $168 | 0; + $189 = $176 + (Math_imul($174, -637) | 0) + $186 | 0; + $192 = $178 + (Math_imul($170, -20239) | 0) + $186 | 0; + $196 = HEAP32[$$1271274 + 4 >> 2] | 0; + $198 = HEAP32[$$1271274 + 12 >> 2] | 0; + $200 = HEAP32[$$1271274 + 20 >> 2] | 0; + $202 = ($198 + $196 | 0) * 7663 | 0; + $204 = ($196 - $198 | 0) * 1395 | 0; + $208 = Math_imul($200 + $198 | 0, -11295) | 0; + $209 = $202 + $204 + $208 | 0; + $211 = ($200 + $196 | 0) * 5027 | 0; + $212 = $202 - $204 + $211 | 0; + $215 = $211 + ($200 * 15326 | 0) + $208 | 0; + HEAP8[$165 >> 0] = HEAP8[$162 + (($212 + $189 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 6 >> 0] = HEAP8[$162 + (($189 - $212 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 1 >> 0] = HEAP8[$162 + (($209 + $182 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 5 >> 0] = HEAP8[$162 + (($182 - $209 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 2 >> 0] = HEAP8[$162 + (($215 + $192 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 4 >> 0] = HEAP8[$162 + (($192 - $215 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$165 + 3 >> 0] = HEAP8[$162 + (((($172 - $183 | 0) * 11585 | 0) + $168 | 0) >>> 18 & 1023) >> 0] | 0; + $$1275 = $$1275 + 1 | 0; + if (($$1275 | 0) == 14) break; else $$1271274 = $$1271274 + 28 | 0; + } + STACKTOP = sp; + return; +} + +function _ar2SetTemplateSub($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0100 = 0, $$0102 = 0, $$0104 = 0, $$0106 = 0, $$0108 = 0, $$0109 = 0, $$0116 = 0, $$0123 = 0, $$1 = 0, $$1101 = 0, $$1103 = 0, $$1105 = 0, $$1107 = 0, $$1110 = 0, $$1117 = 0, $$1124 = 0, $$2 = 0, $$2111 = 0, $$2118 = 0, $$3 = 0, $$3112 = 0, $$3119 = 0, $$3126 = 0, $$4 = 0, $$4113 = 0, $$4120 = 0, $$4127 = 0, $$5 = 0, $$5114 = 0, $$5121 = 0, $$6 = 0, $$6115 = 0, $$6122 = 0, $10 = 0, $100 = 0, $104 = 0.0, $11 = 0, $114 = 0, $116 = 0, $131 = 0, $14 = 0, $16 = 0, $18 = 0.0, $21 = 0, $28 = 0, $35 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $45 = 0, $49 = 0.0, $6 = 0, $63 = 0, $65 = 0, $7 = 0, $74 = 0, $76 = 0, $78 = 0.0, $8 = 0, $83 = 0, $9 = 0, $90 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 80 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(80); + $6 = sp + 60 | 0; + $7 = sp + 56 | 0; + $8 = sp + 52 | 0; + $9 = sp + 48 | 0; + $10 = sp; + $11 = sp + 64 | 0; + L1 : do if (!$0) { + $74 = HEAP32[$3 >> 2] | 0; + $76 = HEAP32[$74 + ($4 * 20 | 0) + 8 >> 2] | 0; + HEAP32[$6 >> 2] = $76; + $78 = +HEAPF32[$74 + ($4 * 20 | 0) + 12 >> 2]; + HEAPF32[$7 >> 2] = $78; + if ((_ar2MarkerCoord2ScreenCoord(0, $1, (HEAP32[tempDoublePtr >> 2] = $76, +HEAPF32[tempDoublePtr >> 2]), $78, $8, $9) | 0) < 0) $$0108 = -1; else { + $83 = ~~(+HEAPF32[$8 >> 2] + .5); + $90 = HEAP32[$5 + 16 >> 2] | 0; + $94 = $5 + 20 | 0; + $95 = $5 + 8 | 0; + $96 = $5 + 12 | 0; + $97 = $3 + 8 | 0; + $$1101 = 0 - $90 | 0; + $$1105 = ~~(+HEAPF32[$9 >> 2] + .5) - ($90 << 1) | 0; + $$3 = 0; + $$3112 = 0; + $$3119 = 0; + $$3126 = HEAP32[$5 + 24 >> 2] | 0; + while (1) { + if (($$1101 | 0) > (HEAP32[$94 >> 2] | 0)) { + $$6 = $$3; + $$6115 = $$3112; + $$6122 = $$3119; + label = 25; + break L1; + } + $100 = HEAP32[$95 >> 2] | 0; + $104 = +($$1105 | 0); + $$1103 = 0 - $100 | 0; + $$1107 = $83 - ($100 << 1) | 0; + $$4 = $$3; + $$4113 = $$3112; + $$4120 = $$3119; + $$4127 = $$3126; + while (1) { + if (($$1103 | 0) > (HEAP32[$96 >> 2] | 0)) break; + if ((_ar2GetImageValue(0, $1, HEAP32[(HEAP32[$2 >> 2] | 0) + (HEAP32[$97 >> 2] << 2) >> 2] | 0, +($$1107 | 0), $104, $11) | 0) < 0) { + HEAP16[$$4127 >> 1] = 4096; + $$5 = $$4; + $$5114 = $$4113; + $$5121 = $$4120; + } else { + $114 = HEAP8[$11 >> 0] | 0; + HEAP16[$$4127 >> 1] = $114 & 255; + $116 = $114 & 255; + $$5 = $$4 + 1 | 0; + $$5114 = (Math_imul($116, $116) | 0) + $$4113 | 0; + $$5121 = $$4120 + $116 | 0; + } + $$1103 = $$1103 + 1 | 0; + $$1107 = $$1107 + 2 | 0; + $$4 = $$5; + $$4113 = $$5114; + $$4120 = $$5121; + $$4127 = $$4127 + 2 | 0; + } + $$1101 = $$1101 + 1 | 0; + $$1105 = $$1105 + 2 | 0; + $$3 = $$4; + $$3112 = $$4113; + $$3119 = $$4120; + $$3126 = $$4127; + } + } + } else { + _arUtilMatMuldff($0 + 8 | 0, $1, $10) | 0; + $14 = HEAP32[$3 >> 2] | 0; + $16 = HEAP32[$14 + ($4 * 20 | 0) + 8 >> 2] | 0; + HEAP32[$6 >> 2] = $16; + $18 = +HEAPF32[$14 + ($4 * 20 | 0) + 12 >> 2]; + HEAPF32[$7 >> 2] = $18; + if ((_ar2MarkerCoord2ScreenCoord(0, $10, (HEAP32[tempDoublePtr >> 2] = $16, +HEAPF32[tempDoublePtr >> 2]), $18, $6, $7) | 0) >= 0 ? ($21 = $0 + 184 | 0, (_arParamIdeal2ObservLTf($21, +HEAPF32[$6 >> 2], +HEAPF32[$7 >> 2], $8, $9) | 0) >= 0) : 0) { + $28 = ~~(+HEAPF32[$8 >> 2] + .5); + $35 = HEAP32[$5 + 16 >> 2] | 0; + $39 = $5 + 20 | 0; + $40 = $5 + 8 | 0; + $41 = $5 + 12 | 0; + $42 = $3 + 8 | 0; + $$0 = 0; + $$0100 = 0 - $35 | 0; + $$0104 = ~~(+HEAPF32[$9 >> 2] + .5) - ($35 << 1) | 0; + $$0109 = 0; + $$0116 = 0; + $$0123 = HEAP32[$5 + 24 >> 2] | 0; + while (1) { + if (($$0100 | 0) > (HEAP32[$39 >> 2] | 0)) { + $$6 = $$0; + $$6115 = $$0109; + $$6122 = $$0116; + label = 25; + break L1; + } + $45 = HEAP32[$40 >> 2] | 0; + $49 = +($$0104 | 0); + $$0102 = 0 - $45 | 0; + $$0106 = $28 - ($45 << 1) | 0; + $$1 = $$0; + $$1110 = $$0109; + $$1117 = $$0116; + $$1124 = $$0123; + while (1) { + if (($$0102 | 0) > (HEAP32[$41 >> 2] | 0)) break; + do if ((_arParamObserv2IdealLTf($21, +($$0106 | 0), $49, $8, $9) | 0) >= 0) if ((_ar2GetImageValue(0, $10, HEAP32[(HEAP32[$2 >> 2] | 0) + (HEAP32[$42 >> 2] << 2) >> 2] | 0, +HEAPF32[$8 >> 2], +HEAPF32[$9 >> 2], $11) | 0) < 0) { + HEAP16[$$1124 >> 1] = 4096; + $$2 = $$1; + $$2111 = $$1110; + $$2118 = $$1117; + break; + } else { + $63 = HEAP8[$11 >> 0] | 0; + HEAP16[$$1124 >> 1] = $63 & 255; + $65 = $63 & 255; + $$2 = $$1 + 1 | 0; + $$2111 = (Math_imul($65, $65) | 0) + $$1110 | 0; + $$2118 = $$1117 + $65 | 0; + break; + } else { + HEAP16[$$1124 >> 1] = 4096; + $$2 = $$1; + $$2111 = $$1110; + $$2118 = $$1117; + } while (0); + $$0102 = $$0102 + 1 | 0; + $$0106 = $$0106 + 2 | 0; + $$1 = $$2; + $$1110 = $$2111; + $$1117 = $$2118; + $$1124 = $$1124 + 2 | 0; + } + $$0 = $$1; + $$0100 = $$0100 + 1 | 0; + $$0104 = $$0104 + 2 | 0; + $$0109 = $$1110; + $$0116 = $$1117; + $$0123 = $$1124; + } + } else $$0108 = -1; + } while (0); + if ((label | 0) == 25) if (!$$6) $$0108 = -1; else { + $131 = ~~+Math_sqrt(+(+($$6115 - ((Math_imul($$6122, $$6122) | 0) / ($$6 | 0) | 0) | 0))); + HEAP32[$5 + 28 >> 2] = $131; + HEAP32[$5 + 32 >> 2] = $$6122; + HEAP32[$5 + 36 >> 2] = $$6; + $$0108 = 0; + } + STACKTOP = sp; + return $$0108 | 0; +} + +function __ZNSt3__26locale5__impC2Em($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $4 = 0, $5 = 0; + HEAP32[$0 + 4 >> 2] = $1 + -1; + HEAP32[$0 >> 2] = 23288; + $4 = $0 + 8 | 0; + __ZNSt3__26vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEEC2Em($4, 28); + $5 = $0 + 144 | 0; + HEAP32[$5 >> 2] = 0; + HEAP32[$5 + 4 >> 2] = 0; + HEAP32[$5 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm($5, 58971, __ZNSt3__211char_traitsIcE6lengthEPKc(58971) | 0); + HEAP32[$0 + 12 >> 2] = HEAP32[$4 >> 2]; + __ZNSt3__212_GLOBAL__N_14makeINS_7collateIcEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_7collateIcEEEEvPT_($0, 64744); + __ZNSt3__212_GLOBAL__N_14makeINS_7collateIwEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_7collateIwEEEEvPT_($0, 64752); + __ZNSt3__212_GLOBAL__N_14makeINS_5ctypeIcEEDnbjEERT_T0_T1_T2_(); + __ZNSt3__26locale5__imp7installINS_5ctypeIcEEEEvPT_($0, 64760); + __ZNSt3__212_GLOBAL__N_14makeINS_5ctypeIwEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_5ctypeIwEEEEvPT_($0, 64776); + __ZNSt3__212_GLOBAL__N_14makeINS_7codecvtIcc11__mbstate_tEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_7codecvtIcc11__mbstate_tEEEEvPT_($0, 64784); + __ZNSt3__212_GLOBAL__N_14makeINS_7codecvtIwc11__mbstate_tEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_7codecvtIwc11__mbstate_tEEEEvPT_($0, 64792); + __ZNSt3__212_GLOBAL__N_14makeINS_7codecvtIDsc11__mbstate_tEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_7codecvtIDsc11__mbstate_tEEEEvPT_($0, 64808); + __ZNSt3__212_GLOBAL__N_14makeINS_7codecvtIDic11__mbstate_tEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_7codecvtIDic11__mbstate_tEEEEvPT_($0, 64816); + __ZNSt3__212_GLOBAL__N_14makeINS_8numpunctIcEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_8numpunctIcEEEEvPT_($0, 64824); + __ZNSt3__212_GLOBAL__N_14makeINS_8numpunctIwEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_8numpunctIwEEEEvPT_($0, 64848); + __ZNSt3__212_GLOBAL__N_14makeINS_7num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_7num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_($0, 64880); + __ZNSt3__212_GLOBAL__N_14makeINS_7num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_7num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_($0, 64888); + __ZNSt3__212_GLOBAL__N_14makeINS_7num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_7num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_($0, 64896); + __ZNSt3__212_GLOBAL__N_14makeINS_7num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_7num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_($0, 64904); + __ZNSt3__212_GLOBAL__N_14makeINS_10moneypunctIcLb0EEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_10moneypunctIcLb0EEEEEvPT_($0, 64912); + __ZNSt3__212_GLOBAL__N_14makeINS_10moneypunctIcLb1EEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_10moneypunctIcLb1EEEEEvPT_($0, 64920); + __ZNSt3__212_GLOBAL__N_14makeINS_10moneypunctIwLb0EEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_10moneypunctIwLb0EEEEEvPT_($0, 64928); + __ZNSt3__212_GLOBAL__N_14makeINS_10moneypunctIwLb1EEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_10moneypunctIwLb1EEEEEvPT_($0, 64936); + __ZNSt3__212_GLOBAL__N_14makeINS_9money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_9money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_($0, 64944); + __ZNSt3__212_GLOBAL__N_14makeINS_9money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_9money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_($0, 64952); + __ZNSt3__212_GLOBAL__N_14makeINS_9money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_9money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_($0, 64960); + __ZNSt3__212_GLOBAL__N_14makeINS_9money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_9money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_($0, 64968); + __ZNSt3__212_GLOBAL__N_14makeINS_8time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_8time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_($0, 64976); + __ZNSt3__212_GLOBAL__N_14makeINS_8time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_8time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_($0, 64992); + __ZNSt3__212_GLOBAL__N_14makeINS_8time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_8time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_($0, 65008); + __ZNSt3__212_GLOBAL__N_14makeINS_8time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_8time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_($0, 65024); + __ZNSt3__212_GLOBAL__N_14makeINS_8messagesIcEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_8messagesIcEEEEvPT_($0, 65040); + __ZNSt3__212_GLOBAL__N_14makeINS_8messagesIwEEjEERT_T0_(); + __ZNSt3__26locale5__imp7installINS_8messagesIwEEEEvPT_($0, 65048); + return; +} + +function _jpeg_idct_10x10($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0253266 = 0, $$0255265 = 0, $$0256264 = 0, $$0267 = 0, $$1254262 = 0, $$1263 = 0, $131 = 0, $134 = 0, $137 = 0, $139 = 0, $141 = 0, $143 = 0, $145 = 0, $147 = 0, $149 = 0, $15 = 0, $151 = 0, $153 = 0, $155 = 0, $156 = 0, $157 = 0, $158 = 0, $159 = 0, $161 = 0, $163 = 0, $166 = 0, $168 = 0, $169 = 0, $170 = 0, $171 = 0, $172 = 0, $173 = 0, $176 = 0, $179 = 0, $180 = 0, $183 = 0, $186 = 0, $189 = 0, $192 = 0, $21 = 0, $23 = 0, $25 = 0, $28 = 0, $34 = 0, $40 = 0, $42 = 0, $44 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $56 = 0, $62 = 0, $68 = 0, $7 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $80 = 0, $83 = 0, $86 = 0, $87 = 0, $90 = 0, $93 = 0, $96 = 0, $99 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 320 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(320); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0253266 = $5; + $$0255265 = HEAP32[$1 + 84 >> 2] | 0; + $$0256264 = $2; + $$0267 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0256264 >> 1] << 13, HEAP32[$$0255265 >> 2] | 0) | 0 | 1024; + $21 = Math_imul(HEAP32[$$0255265 + 128 >> 2] | 0, HEAP16[$$0256264 + 64 >> 1] | 0) | 0; + $23 = ($21 * 9373 | 0) + $15 | 0; + $25 = (Math_imul($21, -3580) | 0) + $15 | 0; + $28 = (Math_imul($21, -11586) | 0) + $15 >> 11; + $34 = Math_imul(HEAP32[$$0255265 + 64 >> 2] | 0, HEAP16[$$0256264 + 32 >> 1] | 0) | 0; + $40 = Math_imul(HEAP32[$$0255265 + 192 >> 2] | 0, HEAP16[$$0256264 + 96 >> 1] | 0) | 0; + $42 = ($40 + $34 | 0) * 6810 | 0; + $44 = $42 + ($34 * 4209 | 0) | 0; + $46 = $42 + (Math_imul($40, -17828) | 0) | 0; + $47 = $44 + $23 | 0; + $48 = $23 - $44 | 0; + $49 = $46 + $25 | 0; + $50 = $25 - $46 | 0; + $56 = Math_imul(HEAP32[$$0255265 + 32 >> 2] | 0, HEAP16[$$0256264 + 16 >> 1] | 0) | 0; + $62 = Math_imul(HEAP32[$$0255265 + 96 >> 2] | 0, HEAP16[$$0256264 + 48 >> 1] | 0) | 0; + $68 = Math_imul(HEAP32[$$0255265 + 160 >> 2] | 0, HEAP16[$$0256264 + 80 >> 1] | 0) | 0; + $74 = Math_imul(HEAP32[$$0255265 + 224 >> 2] | 0, HEAP16[$$0256264 + 112 >> 1] | 0) | 0; + $75 = $74 + $62 | 0; + $76 = $62 - $74 | 0; + $77 = $76 * 2531 | 0; + $78 = $68 << 13; + $79 = $75 * 7791 | 0; + $80 = $77 + $78 | 0; + $83 = $79 + ($56 * 11443 | 0) + $80 | 0; + $86 = ($56 * 1812 | 0) - $79 + $80 | 0; + $87 = $75 * 4815 | 0; + $90 = $78 - $77 - ($76 << 12) | 0; + $93 = $56 - $68 - $76 << 2; + $96 = ($56 * 10323 | 0) - $87 - $90 | 0; + $99 = $90 + (($56 * 5260 | 0) - $87) | 0; + HEAP32[$$0253266 >> 2] = $83 + $47 >> 11; + HEAP32[$$0253266 + 288 >> 2] = $47 - $83 >> 11; + HEAP32[$$0253266 + 32 >> 2] = $96 + $49 >> 11; + HEAP32[$$0253266 + 256 >> 2] = $49 - $96 >> 11; + HEAP32[$$0253266 + 64 >> 2] = $93 + $28; + HEAP32[$$0253266 + 224 >> 2] = $28 - $93; + HEAP32[$$0253266 + 96 >> 2] = $99 + $50 >> 11; + HEAP32[$$0253266 + 192 >> 2] = $50 - $99 >> 11; + HEAP32[$$0253266 + 128 >> 2] = $86 + $48 >> 11; + HEAP32[$$0253266 + 160 >> 2] = $48 - $86 >> 11; + $$0267 = $$0267 + 1 | 0; + if (($$0267 | 0) == 8) break; else { + $$0253266 = $$0253266 + 4 | 0; + $$0255265 = $$0255265 + 4 | 0; + $$0256264 = $$0256264 + 2 | 0; + } + } + $131 = $7 + -384 | 0; + $$1254262 = $5; + $$1263 = 0; + while (1) { + $134 = (HEAP32[$3 + ($$1263 << 2) >> 2] | 0) + $4 | 0; + $137 = (HEAP32[$$1254262 >> 2] << 13) + 134348800 | 0; + $139 = HEAP32[$$1254262 + 16 >> 2] | 0; + $141 = $137 + ($139 * 9373 | 0) | 0; + $143 = $137 + (Math_imul($139, -3580) | 0) | 0; + $145 = $137 + (Math_imul($139, -11586) | 0) | 0; + $147 = HEAP32[$$1254262 + 8 >> 2] | 0; + $149 = HEAP32[$$1254262 + 24 >> 2] | 0; + $151 = ($149 + $147 | 0) * 6810 | 0; + $153 = $151 + ($147 * 4209 | 0) | 0; + $155 = $151 + (Math_imul($149, -17828) | 0) | 0; + $156 = $153 + $141 | 0; + $157 = $141 - $153 | 0; + $158 = $155 + $143 | 0; + $159 = $143 - $155 | 0; + $161 = HEAP32[$$1254262 + 4 >> 2] | 0; + $163 = HEAP32[$$1254262 + 12 >> 2] | 0; + $166 = HEAP32[$$1254262 + 20 >> 2] << 13; + $168 = HEAP32[$$1254262 + 28 >> 2] | 0; + $169 = $168 + $163 | 0; + $170 = $163 - $168 | 0; + $171 = $170 * 2531 | 0; + $172 = $169 * 7791 | 0; + $173 = $171 + $166 | 0; + $176 = $172 + ($161 * 11443 | 0) + $173 | 0; + $179 = ($161 * 1812 | 0) - $172 + $173 | 0; + $180 = $169 * 4815 | 0; + $183 = $166 - $171 - ($170 << 12) | 0; + $186 = ($161 - $170 << 13) - $166 | 0; + $189 = ($161 * 10323 | 0) - $180 - $183 | 0; + $192 = $183 + (($161 * 5260 | 0) - $180) | 0; + HEAP8[$134 >> 0] = HEAP8[$131 + (($176 + $156 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$134 + 9 >> 0] = HEAP8[$131 + (($156 - $176 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$134 + 1 >> 0] = HEAP8[$131 + (($189 + $158 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$134 + 8 >> 0] = HEAP8[$131 + (($158 - $189 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$134 + 2 >> 0] = HEAP8[$131 + (($186 + $145 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$134 + 7 >> 0] = HEAP8[$131 + (($145 - $186 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$134 + 3 >> 0] = HEAP8[$131 + (($192 + $159 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$134 + 6 >> 0] = HEAP8[$131 + (($159 - $192 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$134 + 4 >> 0] = HEAP8[$131 + (($179 + $157 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$134 + 5 >> 0] = HEAP8[$131 + (($157 - $179 | 0) >>> 18 & 1023) >> 0] | 0; + $$1263 = $$1263 + 1 | 0; + if (($$1263 | 0) == 10) break; else $$1254262 = $$1254262 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function __ZN6vision21HoughSimilarityVoting11voteAtIndexEij($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0$i$i$i$i$i = 0, $$052$i$i$i$i$i = 0, $$153$i$i$i$i$i = 0, $$pn$i$i$i$i$i = 0, $$pre$phi$i$i$i$i$iZ2D = 0, $102 = 0, $108 = 0, $11 = 0, $16 = 0, $20 = 0, $21 = 0, $22 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $3 = 0, $30 = 0, $36 = 0, $37 = 0, $4 = 0, $41 = 0, $47 = 0, $51 = 0, $54 = 0.0, $57 = 0.0, $67 = 0, $70 = 0, $72 = 0, $73 = 0, $81 = 0, $83 = 0, $89 = 0, $90 = 0, $93 = 0, $94 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $3 = sp + 8 | 0; + $4 = sp; + if (($1 | 0) <= -1) { + $11 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36635) | 0, 36227) | 0, 39072) | 0, 290) | 0, 39079) | 0, 36669) | 0; + __ZNKSt3__28ios_base6getlocEv($3, $11 + (HEAP32[(HEAP32[$11 >> 2] | 0) + -12 >> 2] | 0) | 0); + $16 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66512) | 0; + $20 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$16 >> 2] | 0) + 28 >> 2] & 127]($16, 10) | 0; + __ZNSt3__26localeD2Ev($3); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($11, $20) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($11) | 0; + _abort(); + } + $21 = $0 + 92 | 0; + HEAP32[$3 >> 2] = $1; + $22 = __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEE4findIjEENS_15__hash_iteratorIPNS_11__hash_nodeIS2_PvEEEERKT_($21, $3) | 0; + if (!$22) { + HEAP32[$4 >> 2] = $1; + HEAP32[$4 + 4 >> 2] = $2; + $25 = $0 + 96 | 0; + $26 = HEAP32[$25 >> 2] | 0; + $27 = ($26 | 0) == 0; + L6 : do if (!$27) { + $28 = $26 + -1 | 0; + $30 = ($28 & $26 | 0) == 0; + if (!$30) if ($26 >>> 0 > $1 >>> 0) $36 = $1; else $36 = ($1 >>> 0) % ($26 >>> 0) | 0; else $36 = $28 & $1; + $37 = HEAP32[(HEAP32[$21 >> 2] | 0) + ($36 << 2) >> 2] | 0; + if (!$37) { + $$052$i$i$i$i$i = $36; + label = 19; + } else { + $$pn$i$i$i$i$i = $37; + do { + $$pn$i$i$i$i$i = HEAP32[$$pn$i$i$i$i$i >> 2] | 0; + if (!$$pn$i$i$i$i$i) { + $$052$i$i$i$i$i = $36; + label = 19; + break L6; + } + $41 = HEAP32[$$pn$i$i$i$i$i + 4 >> 2] | 0; + if (($41 | 0) != ($1 | 0)) { + if (!$30) if ($41 >>> 0 < $26 >>> 0) $47 = $41; else $47 = ($41 >>> 0) % ($26 >>> 0) | 0; else $47 = $41 & $28; + if (($47 | 0) != ($36 | 0)) { + $$052$i$i$i$i$i = $36; + label = 19; + break L6; + } + } + } while ((HEAP32[$$pn$i$i$i$i$i + 8 >> 2] | 0) != ($1 | 0)); + } + } else { + $$052$i$i$i$i$i = 0; + label = 19; + } while (0); + if ((label | 0) == 19) { + __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEE21__construct_node_hashINS_4pairIjjEEJEEENS_10unique_ptrINS_11__hash_nodeIS2_PvEENS_22__hash_node_destructorINSB_ISK_EEEEEEmOT_DpOT0_($3, $21, $1, $4); + $51 = $0 + 104 | 0; + $54 = +(((HEAP32[$51 >> 2] | 0) + 1 | 0) >>> 0); + $57 = +HEAPF32[$0 + 108 >> 2]; + do if ($27 | $57 * +($26 >>> 0) < $54) { + $67 = $26 << 1 | ($26 >>> 0 < 3 | ($26 + -1 & $26 | 0) != 0) & 1; + $70 = ~~+Math_ceil(+($54 / $57)) >>> 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEE6rehashEm($21, $67 >>> 0 < $70 >>> 0 ? $70 : $67); + $72 = HEAP32[$25 >> 2] | 0; + $73 = $72 + -1 | 0; + if (!($73 & $72)) { + $$0$i$i$i$i$i = $72; + $$153$i$i$i$i$i = $73 & $1; + break; + } + if ($72 >>> 0 > $1 >>> 0) { + $$0$i$i$i$i$i = $72; + $$153$i$i$i$i$i = $1; + } else { + $$0$i$i$i$i$i = $72; + $$153$i$i$i$i$i = ($1 >>> 0) % ($72 >>> 0) | 0; + } + } else { + $$0$i$i$i$i$i = $26; + $$153$i$i$i$i$i = $$052$i$i$i$i$i; + } while (0); + $81 = HEAP32[(HEAP32[$21 >> 2] | 0) + ($$153$i$i$i$i$i << 2) >> 2] | 0; + if (!$81) { + $83 = $0 + 100 | 0; + HEAP32[HEAP32[$3 >> 2] >> 2] = HEAP32[$83 >> 2]; + HEAP32[$83 >> 2] = HEAP32[$3 >> 2]; + HEAP32[(HEAP32[$21 >> 2] | 0) + ($$153$i$i$i$i$i << 2) >> 2] = $83; + $89 = HEAP32[$3 >> 2] | 0; + $90 = HEAP32[$89 >> 2] | 0; + if (!$90) $$pre$phi$i$i$i$i$iZ2D = $3; else { + $93 = HEAP32[$90 + 4 >> 2] | 0; + $94 = $$0$i$i$i$i$i + -1 | 0; + if ($94 & $$0$i$i$i$i$i) if ($93 >>> 0 < $$0$i$i$i$i$i >>> 0) $102 = $93; else $102 = ($93 >>> 0) % ($$0$i$i$i$i$i >>> 0) | 0; else $102 = $93 & $94; + HEAP32[(HEAP32[$21 >> 2] | 0) + ($102 << 2) >> 2] = $89; + $$pre$phi$i$i$i$i$iZ2D = $3; + } + } else { + HEAP32[HEAP32[$3 >> 2] >> 2] = HEAP32[$81 >> 2]; + HEAP32[$81 >> 2] = HEAP32[$3 >> 2]; + $$pre$phi$i$i$i$i$iZ2D = $3; + } + HEAP32[$51 >> 2] = (HEAP32[$51 >> 2] | 0) + 1; + HEAP32[$$pre$phi$i$i$i$i$iZ2D >> 2] = 0; + } + } else { + $108 = $22 + 12 | 0; + HEAP32[$108 >> 2] = (HEAP32[$108 >> 2] | 0) + $2; + } + STACKTOP = sp; + return; +} + +function _arVecTridiagonalize($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$0158 = 0, $$0160 = 0, $$0164 = 0, $$0165 = 0.0, $$1 = 0, $$1$in = 0, $$1$in$ph = 0, $$1159 = 0, $$1161 = 0, $$1161$in = 0, $$1166 = 0.0, $$2 = 0, $$2162 = 0, $$3 = 0, $$3163 = 0, $$pre$phiZ2D = 0, $$sink = 0.0, $$sink171 = 0, $106 = 0, $107 = 0, $110 = 0, $114 = 0, $117 = 0, $118 = 0, $121 = 0, $124 = 0.0, $131 = 0, $17 = 0, $18 = 0, $19 = 0, $23 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0.0, $4 = 0, $41 = 0, $46 = 0.0, $48 = 0, $57 = 0.0, $6 = 0, $65 = 0.0, $68 = 0.0, $70 = 0, $71 = 0, $73 = 0.0, $74 = 0, $85 = 0, $90 = 0, $91 = 0, $95 = 0, $97 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp + 8 | 0; + $4 = sp; + $6 = HEAP32[$0 + 8 >> 2] | 0; + L1 : do if ((($6 | 0) == (HEAP32[$0 + 4 >> 2] | 0) ? ($6 | 0) == (HEAP32[$1 + 4 >> 2] | 0) : 0) ? ($6 | 0) == ((HEAP32[$2 + 4 >> 2] | 0) + 1 | 0) : 0) { + $17 = $6 + -2 | 0; + $18 = $3 + 4 | 0; + $19 = $4 + 4 | 0; + $$0 = 0; + while (1) { + if (($$0 | 0) >= ($17 | 0)) break; + $23 = (HEAP32[$0 >> 2] | 0) + ((Math_imul($$0, $6) | 0) << 3) | 0; + HEAPF64[(HEAP32[$1 >> 2] | 0) + ($$0 << 3) >> 3] = +HEAPF64[$23 + ($$0 << 3) >> 3]; + $29 = $6 - $$0 + -1 | 0; + HEAP32[$18 >> 2] = $29; + $30 = $$0 + 1 | 0; + $31 = $23 + ($30 << 3) | 0; + HEAP32[$3 >> 2] = $31; + $32 = +_arVecHousehold($3); + HEAPF64[(HEAP32[$2 >> 2] | 0) + ($$0 << 3) >> 3] = $32; + L8 : do if (!($32 == 0.0)) { + $$0160 = $30; + while (1) { + if (($$0160 | 0) >= ($6 | 0)) break; + $$0158 = $30; + $$0165 = 0.0; + while (1) { + if ($$0158 >>> 0 >= $$0160 >>> 0) break; + $41 = (HEAP32[$0 >> 2] | 0) + ((Math_imul($$0158, $6) | 0) + $$0160 << 3) | 0; + $46 = $$0165 + +HEAPF64[$41 >> 3] * +HEAPF64[$23 + ($$0158 << 3) >> 3]; + $$0158 = $$0158 + 1 | 0; + $$0165 = $46; + } + $48 = Math_imul($$0160, $6) | 0; + $$1159 = $$0160; + $$1166 = $$0165; + while (1) { + if (($$1159 | 0) >= ($6 | 0)) break; + $57 = $$1166 + +HEAPF64[(HEAP32[$0 >> 2] | 0) + ($$1159 + $48 << 3) >> 3] * +HEAPF64[$23 + ($$1159 << 3) >> 3]; + $$1159 = $$1159 + 1 | 0; + $$1166 = $57; + } + HEAPF64[(HEAP32[$1 >> 2] | 0) + ($$0160 << 3) >> 3] = $$1166; + $$0160 = $$0160 + 1 | 0; + } + HEAP32[$19 >> 2] = $29; + HEAP32[$18 >> 2] = $29; + HEAP32[$3 >> 2] = $31; + HEAP32[$4 >> 2] = (HEAP32[$1 >> 2] | 0) + ($30 << 3); + $65 = +_arVecInnerproduct($3, $4) * .5; + $$1161$in = $6; + while (1) { + $$1161 = $$1161$in + -1 | 0; + if (($$1161 | 0) <= ($$0 | 0)) break L8; + $68 = +HEAPF64[$23 + ($$1161 << 3) >> 3]; + $70 = HEAP32[$1 >> 2] | 0; + $71 = $70 + ($$1161 << 3) | 0; + $73 = +HEAPF64[$71 >> 3] - $65 * $68; + HEAPF64[$71 >> 3] = $73; + $74 = Math_imul($$1161, $6) | 0; + $$2 = $$1161; + while (1) { + if (($$2 | 0) >= ($6 | 0)) break; + $85 = (HEAP32[$0 >> 2] | 0) + ($$2 + $74 << 3) | 0; + HEAPF64[$85 >> 3] = +HEAPF64[$85 >> 3] - ($68 * +HEAPF64[$70 + ($$2 << 3) >> 3] + $73 * +HEAPF64[$23 + ($$2 << 3) >> 3]); + $$2 = $$2 + 1 | 0; + } + $$1161$in = $$1161; + } + } while (0); + $$0 = $30; + } + if (($6 | 0) <= 1) if (($6 | 0) == 1) { + $$pre$phiZ2D = 0; + $107 = HEAP32[$0 >> 2] | 0; + $110 = HEAP32[$1 >> 2] | 0; + label = 27; + } else $$1$in = $6; else { + $90 = HEAP32[$0 >> 2] | 0; + $91 = Math_imul($17, $6) | 0; + $95 = HEAP32[$1 >> 2] | 0; + HEAPF64[$95 + ($17 << 3) >> 3] = +HEAPF64[$90 + ($91 + $17 << 3) >> 3]; + $97 = $6 + -1 | 0; + HEAPF64[(HEAP32[$2 >> 2] | 0) + ($17 << 3) >> 3] = +HEAPF64[$90 + ($97 + $91 << 3) >> 3]; + $$pre$phiZ2D = $97; + $107 = $90; + $110 = $95; + label = 27; + } + if ((label | 0) == 27) { + $106 = $107 + ((Math_imul($$pre$phiZ2D, $6) | 0) + $$pre$phiZ2D << 3) | 0; + $$1$in$ph = $6; + $$sink = +HEAPF64[$106 >> 3]; + $$sink171 = $110 + ($$pre$phiZ2D << 3) | 0; + label = 28; + } + while (1) { + if ((label | 0) == 28) { + label = 0; + HEAPF64[$$sink171 >> 3] = $$sink; + $$1$in = $$1$in$ph; + } + $$1 = $$1$in + -1 | 0; + if (($$1$in | 0) <= 0) { + $$0164 = 0; + break L1; + } + $114 = (HEAP32[$0 >> 2] | 0) + ((Math_imul($$1, $6) | 0) << 3) | 0; + L42 : do if (($$1$in | 0) <= ($17 | 0)) { + $117 = $6 - $$1 + -1 | 0; + $118 = $114 + ($$1$in << 3) | 0; + $$2162 = $$1$in; + while (1) { + if (($$2162 | 0) >= ($6 | 0)) break L42; + HEAP32[$19 >> 2] = $117; + HEAP32[$18 >> 2] = $117; + HEAP32[$3 >> 2] = $118; + $121 = Math_imul($$2162, $6) | 0; + HEAP32[$4 >> 2] = (HEAP32[$0 >> 2] | 0) + ($121 + $$1$in << 3); + $124 = +_arVecInnerproduct($3, $4); + $$3 = $$1$in; + while (1) { + if (($$3 | 0) >= ($6 | 0)) break; + $131 = (HEAP32[$0 >> 2] | 0) + ($$3 + $121 << 3) | 0; + HEAPF64[$131 >> 3] = +HEAPF64[$131 >> 3] - $124 * +HEAPF64[$114 + ($$3 << 3) >> 3]; + $$3 = $$3 + 1 | 0; + } + $$2162 = $$2162 + 1 | 0; + } + } while (0); + $$3163 = 0; + while (1) { + if (($$3163 | 0) >= ($6 | 0)) break; + HEAPF64[$114 + ($$3163 << 3) >> 3] = 0.0; + $$3163 = $$3163 + 1 | 0; + } + $$1$in$ph = $$1; + $$sink = 1.0; + $$sink171 = $114 + ($$1 << 3) | 0; + label = 28; + } + } else $$0164 = -1; while (0); + STACKTOP = sp; + return $$0164 | 0; +} + +function _jpeg_idct_float($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0243253 = 0, $$0245252 = 0, $$0247251 = 0, $$0254 = 0, $$1250 = 0, $$2249 = 0, $$sink = 0.0, $$sink256 = 0, $102 = 0.0, $107 = 0.0, $108 = 0.0, $109 = 0.0, $11 = 0, $127 = 0, $13 = 0, $130 = 0, $132 = 0.0, $134 = 0.0, $135 = 0.0, $136 = 0.0, $138 = 0.0, $140 = 0.0, $141 = 0.0, $144 = 0.0, $145 = 0.0, $146 = 0.0, $147 = 0.0, $148 = 0.0, $150 = 0.0, $152 = 0.0, $153 = 0.0, $154 = 0.0, $156 = 0.0, $158 = 0.0, $159 = 0.0, $160 = 0.0, $161 = 0.0, $165 = 0.0, $170 = 0.0, $171 = 0.0, $172 = 0.0, $34 = 0.0, $44 = 0.0, $46 = 0, $49 = 0.0, $5 = 0, $55 = 0.0, $61 = 0.0, $62 = 0.0, $63 = 0.0, $64 = 0.0, $67 = 0.0, $68 = 0.0, $69 = 0.0, $7 = 0, $70 = 0.0, $71 = 0.0, $75 = 0.0, $81 = 0.0, $87 = 0.0, $93 = 0.0, $94 = 0.0, $95 = 0.0, $96 = 0.0, $97 = 0.0, $98 = 0.0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 256 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(256); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0243253 = $5; + $$0245252 = HEAP32[$1 + 84 >> 2] | 0; + $$0247251 = $2; + $$0254 = 8; + while (1) { + $11 = HEAP16[$$0247251 + 16 >> 1] | 0; + $13 = HEAP16[$$0247251 + 32 >> 1] | 0; + if (!(($11 | $13) << 16 >> 16)) if (((((HEAP16[$$0247251 + 48 >> 1] | 0) == 0 ? (HEAP16[$$0247251 + 64 >> 1] | 0) == 0 : 0) ? (HEAP16[$$0247251 + 80 >> 1] | 0) == 0 : 0) ? (HEAP16[$$0247251 + 96 >> 1] | 0) == 0 : 0) ? (HEAP16[$$0247251 + 112 >> 1] | 0) == 0 : 0) { + $34 = +HEAPF32[$$0245252 >> 2] * +(HEAP16[$$0247251 >> 1] | 0); + HEAPF32[$$0243253 >> 2] = $34; + HEAPF32[$$0243253 + 32 >> 2] = $34; + HEAPF32[$$0243253 + 64 >> 2] = $34; + HEAPF32[$$0243253 + 96 >> 2] = $34; + HEAPF32[$$0243253 + 128 >> 2] = $34; + HEAPF32[$$0243253 + 160 >> 2] = $34; + HEAPF32[$$0243253 + 192 >> 2] = $34; + $$sink = $34; + $$sink256 = 56; + } else { + $46 = 0; + label = 9; + } else { + $46 = $13; + label = 9; + } + if ((label | 0) == 9) { + label = 0; + $44 = +HEAPF32[$$0245252 >> 2] * +(HEAP16[$$0247251 >> 1] | 0); + $49 = +HEAPF32[$$0245252 + 64 >> 2] * +($46 << 16 >> 16); + $55 = +HEAPF32[$$0245252 + 128 >> 2] * +(HEAP16[$$0247251 + 64 >> 1] | 0); + $61 = +HEAPF32[$$0245252 + 192 >> 2] * +(HEAP16[$$0247251 + 96 >> 1] | 0); + $62 = $44 + $55; + $63 = $44 - $55; + $64 = $49 + $61; + $67 = ($49 - $61) * 1.4142135381698608 - $64; + $68 = $62 + $64; + $69 = $62 - $64; + $70 = $63 + $67; + $71 = $63 - $67; + $75 = +HEAPF32[$$0245252 + 32 >> 2] * +($11 << 16 >> 16); + $81 = +HEAPF32[$$0245252 + 96 >> 2] * +(HEAP16[$$0247251 + 48 >> 1] | 0); + $87 = +HEAPF32[$$0245252 + 160 >> 2] * +(HEAP16[$$0247251 + 80 >> 1] | 0); + $93 = +HEAPF32[$$0245252 + 224 >> 2] * +(HEAP16[$$0247251 + 112 >> 1] | 0); + $94 = $81 + $87; + $95 = $87 - $81; + $96 = $75 + $93; + $97 = $75 - $93; + $98 = $94 + $96; + $102 = ($95 + $97) * 1.8477590084075928; + $107 = $102 - $95 * 2.613126039505005 - $98; + $108 = ($96 - $94) * 1.4142135381698608 - $107; + $109 = $102 - $97 * 1.0823922157287598 - $108; + HEAPF32[$$0243253 >> 2] = $68 + $98; + HEAPF32[$$0243253 + 224 >> 2] = $68 - $98; + HEAPF32[$$0243253 + 32 >> 2] = $70 + $107; + HEAPF32[$$0243253 + 192 >> 2] = $70 - $107; + HEAPF32[$$0243253 + 64 >> 2] = $71 + $108; + HEAPF32[$$0243253 + 160 >> 2] = $71 - $108; + HEAPF32[$$0243253 + 96 >> 2] = $69 + $109; + $$sink = $69 - $109; + $$sink256 = 32; + } + HEAPF32[$$0243253 + ($$sink256 << 2) >> 2] = $$sink; + if ($$0254 >>> 0 > 1) { + $$0243253 = $$0243253 + 4 | 0; + $$0245252 = $$0245252 + 4 | 0; + $$0247251 = $$0247251 + 2 | 0; + $$0254 = $$0254 + -1 | 0; + } else break; + } + $127 = $7 + -384 | 0; + $$1250 = 0; + $$2249 = $5; + while (1) { + $130 = (HEAP32[$3 + ($$1250 << 2) >> 2] | 0) + $4 | 0; + $132 = +HEAPF32[$$2249 >> 2] + 512.5; + $134 = +HEAPF32[$$2249 + 16 >> 2]; + $135 = $132 + $134; + $136 = $132 - $134; + $138 = +HEAPF32[$$2249 + 8 >> 2]; + $140 = +HEAPF32[$$2249 + 24 >> 2]; + $141 = $138 + $140; + $144 = ($138 - $140) * 1.4142135381698608 - $141; + $145 = $135 + $141; + $146 = $135 - $141; + $147 = $136 + $144; + $148 = $136 - $144; + $150 = +HEAPF32[$$2249 + 20 >> 2]; + $152 = +HEAPF32[$$2249 + 12 >> 2]; + $153 = $150 + $152; + $154 = $150 - $152; + $156 = +HEAPF32[$$2249 + 4 >> 2]; + $158 = +HEAPF32[$$2249 + 28 >> 2]; + $159 = $156 + $158; + $160 = $156 - $158; + $161 = $153 + $159; + $165 = ($154 + $160) * 1.8477590084075928; + $170 = $165 - $154 * 2.613126039505005 - $161; + $171 = ($159 - $153) * 1.4142135381698608 - $170; + $172 = $165 - $160 * 1.0823922157287598 - $171; + HEAP8[$130 >> 0] = HEAP8[$127 + (~~($145 + $161) & 1023) >> 0] | 0; + HEAP8[$130 + 7 >> 0] = HEAP8[$127 + (~~($145 - $161) & 1023) >> 0] | 0; + HEAP8[$130 + 1 >> 0] = HEAP8[$127 + (~~($147 + $170) & 1023) >> 0] | 0; + HEAP8[$130 + 6 >> 0] = HEAP8[$127 + (~~($147 - $170) & 1023) >> 0] | 0; + HEAP8[$130 + 2 >> 0] = HEAP8[$127 + (~~($148 + $171) & 1023) >> 0] | 0; + HEAP8[$130 + 5 >> 0] = HEAP8[$127 + (~~($148 - $171) & 1023) >> 0] | 0; + HEAP8[$130 + 3 >> 0] = HEAP8[$127 + (~~($146 + $172) & 1023) >> 0] | 0; + HEAP8[$130 + 4 >> 0] = HEAP8[$127 + (~~($146 - $172) & 1023) >> 0] | 0; + $$1250 = $$1250 + 1 | 0; + if (($$1250 | 0) == 8) break; else $$2249 = $$2249 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function _decode_mcu_AC_first($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$035$i = 0, $$080100 = 0, $$081$lcssa = 0, $$081105 = 0, $$084 = 0, $$086$lcssa = 0, $$08696 = 0, $$1 = 0, $$185$lcssa = 0, $$18799 = 0, $$288 = 0, $$lcssa = 0, $102 = 0, $108 = 0, $111 = 0, $113 = 0, $117 = 0, $120 = 0, $121 = 0, $124 = 0, $126 = 0, $16 = 0, $19 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $27 = 0, $3 = 0, $4 = 0, $54 = 0, $56 = 0, $57 = 0, $61 = 0, $62 = 0, $66 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $77 = 0, $8 = 0, $80 = 0, $86 = 0, $87 = 0, $91 = 0, $92 = 0, $96 = 0, $97 = 0, $98 = 0, $spec$select = 0, dest = 0, label = 0, stop = 0; + $3 = HEAP32[$0 + 468 >> 2] | 0; + $4 = $0 + 280 | 0; + if (HEAP32[$4 >> 2] | 0) { + $7 = $3 + 56 | 0; + $8 = HEAP32[$7 >> 2] | 0; + if (!$8) { + if (!(FUNCTION_TABLE_ii[HEAP32[(HEAP32[$0 + 464 >> 2] | 0) + 8 >> 2] & 127]($0) | 0)) { + $16 = HEAP32[$0 >> 2] | 0; + HEAP32[$16 + 20 >> 2] = 25; + FUNCTION_TABLE_vi[HEAP32[$16 >> 2] & 255]($0); + } + $19 = $0 + 340 | 0; + if ((HEAP32[$19 >> 2] | 0) > 0) { + $22 = $0 + 224 | 0; + $23 = $0 + 412 | 0; + $24 = $0 + 436 | 0; + $25 = $0 + 420 | 0; + $$035$i = 0; + do { + $27 = HEAP32[$0 + 344 + ($$035$i << 2) >> 2] | 0; + if (HEAP32[$22 >> 2] | 0) if (!(HEAP32[$23 >> 2] | 0)) { + if (!(HEAP32[$25 >> 2] | 0)) label = 10; + } else label = 13; else label = 10; + do if ((label | 0) == 10) { + label = 0; + dest = HEAP32[$3 + 60 + (HEAP32[$27 + 20 >> 2] << 2) >> 2] | 0; + stop = dest + 64 | 0; + do { + HEAP8[dest >> 0] = 0; + dest = dest + 1 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$3 + 24 + ($$035$i << 2) >> 2] = 0; + HEAP32[$3 + 40 + ($$035$i << 2) >> 2] = 0; + if (!(HEAP32[$22 >> 2] | 0)) if (!(HEAP32[$24 >> 2] | 0)) break; else { + label = 13; + break; + } else if (!(HEAP32[$23 >> 2] | 0)) break; else { + label = 13; + break; + } + } while (0); + if ((label | 0) == 13) { + label = 0; + _memset(HEAP32[$3 + 124 + (HEAP32[$27 + 24 >> 2] << 2) >> 2] | 0, 0, 256) | 0; + } + $$035$i = $$035$i + 1 | 0; + } while (($$035$i | 0) < (HEAP32[$19 >> 2] | 0)); + } + HEAP32[$3 + 12 >> 2] = 0; + HEAP32[$3 + 16 >> 2] = 0; + HEAP32[$3 + 20 >> 2] = -16; + $54 = HEAP32[$4 >> 2] | 0; + HEAP32[$7 >> 2] = $54; + $56 = $54; + } else $56 = $8; + HEAP32[$7 >> 2] = $56 + -1; + } + $57 = $3 + 20 | 0; + if ((HEAP32[$57 >> 2] | 0) == -1) return 1; + $61 = HEAP32[$0 + 432 >> 2] | 0; + $62 = HEAP32[$1 >> 2] | 0; + $66 = HEAP32[(HEAP32[$0 + 344 >> 2] | 0) + 24 >> 2] | 0; + $70 = $3 + 124 + ($66 << 2) | 0; + $71 = $3 + 188 | 0; + $72 = $0 + 416 | 0; + $73 = $0 + 424 | 0; + $74 = $0 + 264 + $66 | 0; + $$084 = (HEAP32[$0 + 412 >> 2] | 0) + -1 | 0; + L29 : while (1) { + $77 = (HEAP32[$70 >> 2] | 0) + ($$084 * 3 | 0) | 0; + if (_arith_decode($0, $77) | 0) { + label = 36; + break; + } + $80 = $$084 + 1 | 0; + if (!(_arith_decode($0, $77 + 1 | 0) | 0)) { + $$08696 = $77; + $86 = $80; + while (1) { + if (($86 | 0) >= (HEAP32[$72 >> 2] | 0)) { + label = 23; + break L29; + } + $91 = $$08696 + 3 | 0; + $92 = $86 + 1 | 0; + if (!(_arith_decode($0, $$08696 + 4 | 0) | 0)) { + $$08696 = $91; + $86 = $92; + } else { + $$086$lcssa = $91; + $$185$lcssa = $86; + $$lcssa = $92; + break; + } + } + } else { + $$086$lcssa = $77; + $$185$lcssa = $$084; + $$lcssa = $80; + } + $96 = _arith_decode($0, $71) | 0; + $97 = $$086$lcssa + 2 | 0; + $98 = _arith_decode($0, $97) | 0; + if ($98) { + if (_arith_decode($0, $97) | 0) { + $102 = $98 << 1; + $108 = (HEAP32[$70 >> 2] | 0) + (($$185$lcssa | 0) < (HEAPU8[$74 >> 0] | 0 | 0) ? 189 : 217) | 0; + if (!(_arith_decode($0, $108) | 0)) { + $$1 = $102; + $$288 = $108; + } else { + $$080100 = $102; + $$18799 = $108; + while (1) { + $111 = $$080100 << 1; + if (($111 | 0) == 32768) { + label = 30; + break L29; + } + $117 = $$18799 + 1 | 0; + if (!(_arith_decode($0, $117) | 0)) { + $$1 = $111; + $$288 = $117; + break; + } else { + $$080100 = $111; + $$18799 = $117; + } + } + } + } else { + $$1 = $98; + $$288 = $97; + } + $120 = $$288 + 14 | 0; + $121 = $$1 >> 1; + if (!$121) $$081$lcssa = $$1; else { + $$081105 = $$1; + $126 = $121; + while (1) { + $124 = (_arith_decode($0, $120) | 0) == 0; + $spec$select = ($124 ? 0 : $126) | $$081105; + $126 = $126 >> 1; + if (!$126) { + $$081$lcssa = $spec$select; + break; + } else $$081105 = $spec$select; + } + } + } else $$081$lcssa = 0; + HEAP16[$62 + (HEAP32[$61 + ($$lcssa << 2) >> 2] << 1) >> 1] = (($96 | 0) == 0 ? $$081$lcssa + 1 | 0 : ~$$081$lcssa) << HEAP32[$73 >> 2]; + if (($$lcssa | 0) < (HEAP32[$72 >> 2] | 0)) $$084 = $$lcssa; else { + label = 36; + break; + } + } + if ((label | 0) == 23) { + $87 = HEAP32[$0 >> 2] | 0; + HEAP32[$87 + 20 >> 2] = 117; + FUNCTION_TABLE_vii[HEAP32[$87 + 4 >> 2] & 255]($0, -1); + HEAP32[$57 >> 2] = -1; + return 1; + } else if ((label | 0) == 30) { + $113 = HEAP32[$0 >> 2] | 0; + HEAP32[$113 + 20 >> 2] = 117; + FUNCTION_TABLE_vii[HEAP32[$113 + 4 >> 2] & 255]($0, -1); + HEAP32[$57 >> 2] = -1; + return 1; + } else if ((label | 0) == 36) return 1; + return 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E12parseNewExprEv($0) { + $0 = $0 | 0; + var $$5 = 0, $$7 = 0, $$byval_copy3 = 0, $1 = 0, $10 = 0, $13 = 0, $16 = 0, $17 = 0, $2 = 0, $20 = 0, $22 = 0, $23 = 0, $26 = 0, $28 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $$byval_copy3 = sp + 48 | 0; + $1 = sp + 57 | 0; + $2 = sp + 40 | 0; + $3 = sp + 56 | 0; + $4 = sp + 32 | 0; + $5 = sp + 24 | 0; + $6 = sp + 16 | 0; + $7 = sp; + $8 = sp + 8 | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 52665); + HEAP32[$$byval_copy3 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy3 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + $10 = (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy3) | 0) & 1; + HEAP8[$1 >> 0] = $10; + $13 = (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 == 97 & 1; + HEAP8[$3 >> 0] = $13; + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 53279); + HEAP32[$$byval_copy3 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy3 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy3) | 0) ? (__ZN12_GLOBAL__N_110StringViewC2EPKc($5, 53282), HEAP32[$$byval_copy3 >> 2] = HEAP32[$5 >> 2], HEAP32[$$byval_copy3 + 4 >> 2] = HEAP32[$5 + 4 >> 2], !(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy3) | 0)) : 0) $$7 = 0; else label = 3; + do if ((label | 0) == 3) { + $16 = $0 + 8 | 0; + $17 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($16) | 0; + while (1) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) break; + $20 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy3 >> 2] = $20; + if (!$20) { + label = 7; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($16, $$byval_copy3); + } + if ((label | 0) == 7) { + $$7 = 0; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20popTrailingNodeArrayEm($6, $0, $17); + $22 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $23 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($22) | 0; + HEAP32[$7 >> 2] = $23; + do if ($23) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($8, 53285); + HEAP32[$$byval_copy3 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$$byval_copy3 + 4 >> 2] = HEAP32[$8 + 4 >> 2]; + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy3) | 0)) { + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0)) { + $$5 = 0; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle9NodeArrayC2Ev($$byval_copy3); + $$5 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_7NewExprEJRNS0_9NodeArrayERPNS0_4NodeES8_RbSD_EEESB_DpOT0_($0, $6, $7, $$byval_copy3, $1, $3) | 0; + break; + } + $26 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($16) | 0; + while (1) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) { + label = 15; + break; + } + $28 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($22) | 0; + HEAP32[$$byval_copy3 >> 2] = $28; + if (!$28) { + label = 13; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($16, $$byval_copy3); + } + if ((label | 0) == 13) { + $$5 = 0; + break; + } else if ((label | 0) == 15) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20popTrailingNodeArrayEm($$byval_copy3, $0, $26); + $$5 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_7NewExprEJRNS0_9NodeArrayERPNS0_4NodeES9_RbSD_EEESB_DpOT0_($0, $6, $7, $$byval_copy3, $1, $3) | 0; + break; + } + } else $$5 = 0; while (0); + $$7 = $$5; + } while (0); + STACKTOP = sp; + return $$7 | 0; +} + +function _jpeg_calc_output_dimensions($0) { + $0 = $0 | 0; + var $$07397 = 0, $$07397$us = 0, $$07596 = 0, $$07596$us = 0, $$083 = 0, $$17482 = 0, $$17681 = 0, $$191 = 0, $$191$us = 0, $$lcssa = 0, $$lcssa$sink = 0, $$lcssa78 = 0, $$lcssa79 = 0, $$lcssa79$us = 0, $$pre = 0, $$sink = 0, $10 = 0, $102 = 0, $105 = 0, $11 = 0, $115 = 0, $116 = 0, $117 = 0, $118 = 0, $12 = 0, $13 = 0, $15 = 0, $19 = 0, $2 = 0, $21 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $31 = 0, $33 = 0, $35 = 0, $36 = 0, $4 = 0, $44 = 0, $46 = 0, $47 = 0, $53 = 0, $54 = 0, $56 = 0, $57 = 0, $63 = 0, $64 = 0, $66 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $82 = 0, $86 = 0, $94 = 0, $98 = 0; + $2 = HEAP32[$0 + 20 >> 2] | 0; + if (($2 | 0) != 202) { + $4 = HEAP32[$0 >> 2] | 0; + HEAP32[$4 + 20 >> 2] = 21; + HEAP32[$4 + 24 >> 2] = $2; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + _jpeg_core_output_dimensions($0); + $10 = HEAP32[$0 + 216 >> 2] | 0; + $11 = $0 + 36 | 0; + $12 = HEAP32[$11 >> 2] | 0; + $13 = ($12 | 0) > 0; + if ($13) { + $15 = HEAP32[$0 + 324 >> 2] | 0; + $19 = (HEAP32[$0 + 76 >> 2] | 0) == 0 ? 4 : 8; + $21 = $0 + 320 | 0; + $23 = HEAP32[$0 + 328 >> 2] | 0; + if (($15 | 0) > ($19 | 0)) { + $24 = ($23 | 0) > ($19 | 0); + $25 = $15 << 1; + $$07397$us = $10; + $$07596$us = 0; + while (1) { + $26 = $$07397$us + 36 | 0; + HEAP32[$26 >> 2] = $15; + L10 : do if ($24) $$lcssa79$us = $23; else { + $33 = HEAP32[$21 >> 2] | 0; + $31 = HEAP32[$$07397$us + 12 >> 2] | 0; + $$191$us = 1; + $116 = $23; + while (1) { + $$191$us = $$191$us << 1; + if (($33 | 0) % (Math_imul($$191$us, $31) | 0) | 0 | 0) { + $$lcssa79$us = $116; + break L10; + } + $27 = Math_imul($23, $$191$us) | 0; + if (($27 | 0) > ($19 | 0)) { + $$lcssa79$us = $27; + break; + } else $116 = $27; + } + } while (0); + $35 = $$07397$us + 40 | 0; + HEAP32[$35 >> 2] = $$lcssa79$us; + $36 = $$lcssa79$us << 1; + if (($15 | 0) <= ($36 | 0)) { + if (($$lcssa79$us | 0) > ($25 | 0)) HEAP32[$35 >> 2] = $25; + } else HEAP32[$26 >> 2] = $36; + $$07596$us = $$07596$us + 1 | 0; + if (($$07596$us | 0) >= ($12 | 0)) break; else $$07397$us = $$07397$us + 88 | 0; + } + } else { + $$pre = HEAP32[$0 + 316 >> 2] | 0; + $44 = ($23 | 0) > ($19 | 0); + $$07397 = $10; + $$07596 = 0; + while (1) { + $46 = HEAP32[$$07397 + 8 >> 2] | 0; + $$083 = 1; + $117 = $15; + while (1) { + $$083 = $$083 << 1; + if (($$pre | 0) % (Math_imul($$083, $46) | 0) | 0 | 0) { + $$lcssa78 = $117; + break; + } + $47 = Math_imul($15, $$083) | 0; + if (($47 | 0) > ($19 | 0)) { + $$lcssa78 = $47; + break; + } else $117 = $47; + } + $53 = $$07397 + 36 | 0; + HEAP32[$53 >> 2] = $$lcssa78; + L28 : do if ($44) $$lcssa79 = $23; else { + $54 = HEAP32[$21 >> 2] | 0; + $56 = HEAP32[$$07397 + 12 >> 2] | 0; + $$191 = 1; + $118 = $23; + while (1) { + $$191 = $$191 << 1; + if (($54 | 0) % (Math_imul($$191, $56) | 0) | 0 | 0) { + $$lcssa79 = $118; + break L28; + } + $57 = Math_imul($23, $$191) | 0; + if (($57 | 0) > ($19 | 0)) { + $$lcssa79 = $57; + break; + } else $118 = $57; + } + } while (0); + $63 = $$07397 + 40 | 0; + HEAP32[$63 >> 2] = $$lcssa79; + $64 = $$lcssa79 << 1; + if (($$lcssa78 | 0) <= ($64 | 0)) { + $66 = $$lcssa78 << 1; + if (($$lcssa79 | 0) > ($66 | 0)) HEAP32[$63 >> 2] = $66; + } else HEAP32[$53 >> 2] = $64; + $$07596 = $$07596 + 1 | 0; + if (($$07596 | 0) >= ($12 | 0)) break; else $$07397 = $$07397 + 88 | 0; + } + } + if ($13) { + $71 = $0 + 28 | 0; + $72 = $0 + 316 | 0; + $73 = $0 + 428 | 0; + $74 = $0 + 32 | 0; + $75 = $0 + 320 | 0; + $$17482 = $10; + $$17681 = 0; + while (1) { + $82 = Math_imul(Math_imul(HEAP32[$$17482 + 8 >> 2] | 0, HEAP32[$71 >> 2] | 0) | 0, HEAP32[$$17482 + 36 >> 2] | 0) | 0; + $86 = _jdiv_round_up($82, Math_imul(HEAP32[$73 >> 2] | 0, HEAP32[$72 >> 2] | 0) | 0) | 0; + HEAP32[$$17482 + 44 >> 2] = $86; + $94 = Math_imul(Math_imul(HEAP32[$$17482 + 12 >> 2] | 0, HEAP32[$74 >> 2] | 0) | 0, HEAP32[$$17482 + 40 >> 2] | 0) | 0; + $98 = _jdiv_round_up($94, Math_imul(HEAP32[$73 >> 2] | 0, HEAP32[$75 >> 2] | 0) | 0) | 0; + HEAP32[$$17482 + 48 >> 2] = $98; + $$17681 = $$17681 + 1 | 0; + $102 = HEAP32[$11 >> 2] | 0; + if (($$17681 | 0) >= ($102 | 0)) { + $$lcssa = $102; + break; + } else $$17482 = $$17482 + 88 | 0; + } + } else $$lcssa = $12; + } else $$lcssa = $12; + $105 = HEAP32[$0 + 44 >> 2] | 0; + switch ($105 | 0) { + case 1: + { + $$lcssa$sink = $105; + break; + } + case 6: + case 2: + { + $$lcssa$sink = 3; + break; + } + case 7: + case 3: + { + $$lcssa$sink = 3; + break; + } + case 5: + case 4: + { + $$lcssa$sink = 4; + break; + } + default: + $$lcssa$sink = $$lcssa; + } + HEAP32[$0 + 120 >> 2] = $$lcssa$sink; + HEAP32[$0 + 124 >> 2] = (HEAP32[$0 + 84 >> 2] | 0) == 0 ? $$lcssa$sink : 1; + if (!(_use_merged_upsample($0) | 0)) { + $$sink = 1; + $115 = $0 + 128 | 0; + HEAP32[$115 >> 2] = $$sink; + return; + } + $$sink = HEAP32[$0 + 320 >> 2] | 0; + $115 = $0 + 128 | 0; + HEAP32[$115 >> 2] = $$sink; + return; +} + +function __ZNK6vision4NodeILi96EE7nearestERNSt3__26vectorIPKS1_NS2_9allocatorIS5_EEEERNS2_14priority_queueINS_17PriorityQueueItemILi96EEENS3_ISC_NS6_ISC_EEEENS2_4lessISC_EEEEPKh($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$043 = 0, $$045 = 0, $$046 = 0, $$byval_copy = 0, $$byval_copy1 = 0, $101 = 0, $102 = 0, $107 = 0, $109 = 0, $110 = 0, $14 = 0, $25 = 0, $31 = 0, $36 = 0, $37 = 0, $4 = 0, $41 = 0, $48 = 0, $5 = 0, $53 = 0, $57 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $68 = 0, $69 = 0, $7 = 0, $71 = 0, $78 = 0, $8 = 0, $85 = 0, $86 = 0, $92 = 0, $93 = 0, $96 = 0, $spec$select = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy1 = sp + 8 | 0; + $$byval_copy = sp + 36 | 0; + $4 = sp + 32 | 0; + $5 = sp + 28 | 0; + $6 = sp; + $7 = sp + 16 | 0; + $8 = $0 + 104 | 0; + __ZNSt3__26vectorIN6vision17PriorityQueueItemILi96EEENS_9allocatorIS3_EEEC2Em($7, (HEAP32[$0 + 108 >> 2] | 0) - (HEAP32[$8 >> 2] | 0) >> 2); + $14 = $7 + 4 | 0; + $$043 = -1; + $$045 = 0; + $$046 = -1; + while (1) { + if ($$045 >>> 0 >= (HEAP32[$14 >> 2] | 0) - (HEAP32[$7 >> 2] | 0) >> 3 >>> 0) break; + $25 = __ZN6vision15HammingDistanceILi96EEEjPKhS2_((HEAP32[(HEAP32[$8 >> 2] | 0) + ($$045 << 2) >> 2] | 0) + 4 | 0, $3) | 0; + __ZN6vision17PriorityQueueItemILi96EEC2EPKNS_4NodeILi96EEEj($$byval_copy1, HEAP32[(HEAP32[$8 >> 2] | 0) + ($$045 << 2) >> 2] | 0, $25); + $31 = $$byval_copy1; + $36 = HEAP32[$31 + 4 >> 2] | 0; + $37 = (HEAP32[$7 >> 2] | 0) + ($$045 << 3) | 0; + HEAP32[$37 >> 2] = HEAP32[$31 >> 2]; + HEAP32[$37 + 4 >> 2] = $36; + __ZN6vision17PriorityQueueItemILi96EED2Ev($$byval_copy1); + $41 = $25 >>> 0 < $$043 >>> 0; + $spec$select = $41 ? $$045 : $$046; + $$043 = $41 ? $25 : $$043; + $$045 = $$045 + 1 | 0; + $$046 = $spec$select; + } + if (($$046 | 0) == -1) { + $48 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36137) | 0, 33262) | 0, 39072) | 0, 155) | 0, 39079) | 0, 36171) | 0; + __ZNKSt3__28ios_base6getlocEv($$byval_copy1, $48 + (HEAP32[(HEAP32[$48 >> 2] | 0) + -12 >> 2] | 0) | 0); + $53 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy1, 66512) | 0; + $57 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$53 >> 2] | 0) + 28 >> 2] & 127]($53, 10) | 0; + __ZNSt3__26localeD2Ev($$byval_copy1); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($48, $57) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($48) | 0; + _abort(); + } + $60 = HEAP32[(HEAP32[$8 >> 2] | 0) + ($$046 << 2) >> 2] | 0; + HEAP32[$$byval_copy1 >> 2] = $60; + $61 = $1 + 4 | 0; + $62 = HEAP32[$61 >> 2] | 0; + $63 = $1 + 8 | 0; + if ($62 >>> 0 < (HEAP32[$63 >> 2] | 0) >>> 0) { + HEAP32[$62 >> 2] = $60; + HEAP32[$61 >> 2] = (HEAP32[$61 >> 2] | 0) + 4; + } else __ZNSt3__26vectorIPKN6vision4NodeILi96EEENS_9allocatorIS5_EEE21__push_back_slow_pathIS5_EEvOT_($1, $$byval_copy1); + $68 = $2 + 4 | 0; + $69 = $2 + 8 | 0; + $$0 = 0; + while (1) { + $71 = HEAP32[$7 >> 2] | 0; + if ($$0 >>> 0 >= (HEAP32[$14 >> 2] | 0) - $71 >> 3 >>> 0) break; + do if (($$0 | 0) != ($$046 | 0)) { + $78 = __ZNK6vision17PriorityQueueItemILi96EE4distEv($71 + ($$0 << 3) | 0) | 0; + if (($78 | 0) == (__ZNK6vision17PriorityQueueItemILi96EE4distEv((HEAP32[$7 >> 2] | 0) + ($$046 << 3) | 0) | 0)) { + $85 = HEAP32[(HEAP32[$8 >> 2] | 0) + ($$0 << 2) >> 2] | 0; + HEAP32[$$byval_copy1 >> 2] = $85; + $86 = HEAP32[$61 >> 2] | 0; + if ($86 >>> 0 < (HEAP32[$63 >> 2] | 0) >>> 0) { + HEAP32[$86 >> 2] = $85; + HEAP32[$61 >> 2] = (HEAP32[$61 >> 2] | 0) + 4; + } else __ZNSt3__26vectorIPKN6vision4NodeILi96EEENS_9allocatorIS5_EEE21__push_back_slow_pathIS5_EEvOT_($1, $$byval_copy1); + break; + } else { + $92 = (HEAP32[$7 >> 2] | 0) + ($$0 << 3) | 0; + $93 = HEAP32[$68 >> 2] | 0; + if (($93 | 0) == (HEAP32[$69 >> 2] | 0)) { + __ZNSt3__26vectorIN6vision17PriorityQueueItemILi96EEENS_9allocatorIS3_EEE21__push_back_slow_pathIRKS3_EEvOT_($2, $92); + $110 = HEAP32[$68 >> 2] | 0; + } else { + $96 = $92; + $101 = HEAP32[$96 + 4 >> 2] | 0; + $102 = $93; + HEAP32[$102 >> 2] = HEAP32[$96 >> 2]; + HEAP32[$102 + 4 >> 2] = $101; + $107 = (HEAP32[$68 >> 2] | 0) + 8 | 0; + HEAP32[$68 >> 2] = $107; + $110 = $107; + } + $109 = HEAP32[$2 >> 2] | 0; + HEAP32[$4 >> 2] = $109; + HEAP32[$5 >> 2] = $110; + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$5 >> 2]; + __ZNSt3__29__sift_upIRNS_4lessIN6vision17PriorityQueueItemILi96EEEEENS_11__wrap_iterIPS4_EEEEvT0_SA_T_NS_15iterator_traitsISA_E15difference_typeE($$byval_copy, $$byval_copy1, $6, $110 - $109 >> 3); + break; + } + } while (0); + $$0 = $$0 + 1 | 0; + } + __ZNSt3__213__vector_baseIN6vision17PriorityQueueItemILi96EEENS_9allocatorIS3_EEED2Ev($7); + STACKTOP = sp; + return; +} + +function _start_input_pass_79($0) { + $0 = $0 | 0; + var $$030$i = 0, $$07881$i = 0, $$07982$i = 0, $$pre33$i = 0, $1 = 0, $10 = 0, $101 = 0, $105 = 0, $112 = 0, $116 = 0, $117 = 0, $118 = 0, $119 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $2 = 0, $20 = 0, $21 = 0, $27 = 0, $38 = 0, $41 = 0, $49 = 0, $5 = 0, $51 = 0, $55 = 0, $57 = 0, $60 = 0, $62 = 0, $66 = 0, $70 = 0, $75 = 0, $79 = 0, $81 = 0, $86 = 0, $90 = 0, $91 = 0, $94 = 0, $96 = 0, $97 = 0, label = 0; + $1 = $0 + 340 | 0; + $2 = HEAP32[$1 >> 2] | 0; + if (($2 | 0) != 1) { + if (($2 + -1 | 0) >>> 0 > 3) { + $27 = HEAP32[$0 >> 2] | 0; + HEAP32[$27 + 20 >> 2] = 27; + HEAP32[$27 + 24 >> 2] = $2; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = 4; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $38 = $0 + 428 | 0; + $41 = _jdiv_round_up(HEAP32[$0 + 28 >> 2] | 0, Math_imul(HEAP32[$38 >> 2] | 0, HEAP32[$0 + 316 >> 2] | 0) | 0) | 0; + HEAP32[$0 + 360 >> 2] = $41; + $49 = _jdiv_round_up(HEAP32[$0 + 32 >> 2] | 0, Math_imul(HEAP32[$38 >> 2] | 0, HEAP32[$0 + 320 >> 2] | 0) | 0) | 0; + HEAP32[$0 + 364 >> 2] = $49; + $51 = $0 + 368 | 0; + HEAP32[$51 >> 2] = 0; + if ((HEAP32[$1 >> 2] | 0) <= 0) { + $117 = $0 + 468 | 0; + $118 = HEAP32[$117 >> 2] | 0; + $119 = HEAP32[$118 >> 2] | 0; + FUNCTION_TABLE_vi[$119 & 255]($0); + $120 = $0 + 452 | 0; + $121 = HEAP32[$120 >> 2] | 0; + $122 = HEAP32[$121 >> 2] | 0; + FUNCTION_TABLE_vi[$122 & 255]($0); + $123 = HEAP32[$120 >> 2] | 0; + $124 = $123 + 4 | 0; + $125 = HEAP32[$124 >> 2] | 0; + $126 = $0 + 460 | 0; + $127 = HEAP32[$126 >> 2] | 0; + HEAP32[$127 >> 2] = $125; + return; + } + $$07982$i = 0; + $79 = 0; + while (1) { + $55 = HEAP32[$0 + 344 + ($$07982$i << 2) >> 2] | 0; + $57 = HEAP32[$55 + 8 >> 2] | 0; + HEAP32[$55 + 56 >> 2] = $57; + $60 = HEAP32[$55 + 12 >> 2] | 0; + HEAP32[$55 + 60 >> 2] = $60; + $62 = Math_imul($60, $57) | 0; + HEAP32[$55 + 64 >> 2] = $62; + $66 = Math_imul(HEAP32[$55 + 36 >> 2] | 0, $57) | 0; + HEAP32[$55 + 68 >> 2] = $66; + $70 = ((HEAP32[$55 + 28 >> 2] | 0) >>> 0) % ($57 >>> 0) | 0; + HEAP32[$55 + 72 >> 2] = ($70 | 0) == 0 ? $57 : $70; + $75 = ((HEAP32[$55 + 32 >> 2] | 0) >>> 0) % ($60 >>> 0) | 0; + HEAP32[$55 + 76 >> 2] = ($75 | 0) == 0 ? $60 : $75; + if (($62 + $79 | 0) > 10) { + $81 = HEAP32[$0 >> 2] | 0; + HEAP32[$81 + 20 >> 2] = 14; + FUNCTION_TABLE_vi[HEAP32[$81 >> 2] & 255]($0); + } + if (($62 | 0) > 0) { + $$07881$i = $62; + while (1) { + $86 = HEAP32[$51 >> 2] | 0; + HEAP32[$51 >> 2] = $86 + 1; + HEAP32[$0 + 372 + ($86 << 2) >> 2] = $$07982$i; + if (($$07881$i | 0) > 1) $$07881$i = $$07881$i + -1 | 0; else break; + } + } + $90 = $$07982$i + 1 | 0; + $91 = HEAP32[$1 >> 2] | 0; + if (($90 | 0) >= ($91 | 0)) break; + $$07982$i = $90; + $79 = HEAP32[$51 >> 2] | 0; + } + if (($91 | 0) > 0) $128 = $91; else { + $117 = $0 + 468 | 0; + $118 = HEAP32[$117 >> 2] | 0; + $119 = HEAP32[$118 >> 2] | 0; + FUNCTION_TABLE_vi[$119 & 255]($0); + $120 = $0 + 452 | 0; + $121 = HEAP32[$120 >> 2] | 0; + $122 = HEAP32[$121 >> 2] | 0; + FUNCTION_TABLE_vi[$122 & 255]($0); + $123 = HEAP32[$120 >> 2] | 0; + $124 = $123 + 4 | 0; + $125 = HEAP32[$124 >> 2] | 0; + $126 = $0 + 460 | 0; + $127 = HEAP32[$126 >> 2] | 0; + HEAP32[$127 >> 2] = $125; + return; + } + } else { + $5 = HEAP32[$0 + 344 >> 2] | 0; + HEAP32[$0 + 360 >> 2] = HEAP32[$5 + 28 >> 2]; + $10 = HEAP32[$5 + 32 >> 2] | 0; + HEAP32[$0 + 364 >> 2] = $10; + HEAP32[$5 + 56 >> 2] = 1; + HEAP32[$5 + 60 >> 2] = 1; + HEAP32[$5 + 64 >> 2] = 1; + HEAP32[$5 + 68 >> 2] = HEAP32[$5 + 36 >> 2]; + HEAP32[$5 + 72 >> 2] = 1; + $20 = HEAP32[$5 + 12 >> 2] | 0; + $21 = ($10 >>> 0) % ($20 >>> 0) | 0; + HEAP32[$5 + 76 >> 2] = ($21 | 0) == 0 ? $20 : $21; + HEAP32[$0 + 368 >> 2] = 1; + HEAP32[$0 + 372 >> 2] = 0; + $128 = 1; + } + $94 = $0 + 4 | 0; + $$030$i = 0; + $129 = $128; + while (1) { + $96 = HEAP32[$0 + 344 + ($$030$i << 2) >> 2] | 0; + $97 = $96 + 80 | 0; + if (!(HEAP32[$97 >> 2] | 0)) { + $101 = HEAP32[$96 + 16 >> 2] | 0; + $$pre33$i = $0 + 164 + ($101 << 2) | 0; + if ($101 >>> 0 <= 3 ? (HEAP32[$$pre33$i >> 2] | 0) != 0 : 0) {} else { + $105 = HEAP32[$0 >> 2] | 0; + HEAP32[$105 + 20 >> 2] = 54; + HEAP32[$105 + 24 >> 2] = $101; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $112 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$94 >> 2] >> 2] & 63]($0, 1, 132) | 0; + _memcpy($112 | 0, HEAP32[$$pre33$i >> 2] | 0, 132) | 0; + HEAP32[$97 >> 2] = $112; + $116 = HEAP32[$1 >> 2] | 0; + } else $116 = $129; + $$030$i = $$030$i + 1 | 0; + if (($$030$i | 0) >= ($116 | 0)) break; else $129 = $116; + } + $117 = $0 + 468 | 0; + $118 = HEAP32[$117 >> 2] | 0; + $119 = HEAP32[$118 >> 2] | 0; + FUNCTION_TABLE_vi[$119 & 255]($0); + $120 = $0 + 452 | 0; + $121 = HEAP32[$120 >> 2] | 0; + $122 = HEAP32[$121 >> 2] | 0; + FUNCTION_TABLE_vi[$122 & 255]($0); + $123 = HEAP32[$120 >> 2] | 0; + $124 = $123 + 4 | 0; + $125 = HEAP32[$124 >> 2] | 0; + $126 = $0 + 460 | 0; + $127 = HEAP32[$126 >> 2] | 0; + HEAP32[$127 >> 2] = $125; + return; +} + +function __ZNK6vision25GaussianScaleSpacePyramid6locateERiS1_f($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = +$3; + var $$sink = 0, $100 = 0, $11 = 0.0, $16 = 0, $17 = 0, $23 = 0, $26 = 0, $31 = 0, $38 = 0, $4 = 0, $43 = 0, $47 = 0, $56 = 0, $61 = 0, $65 = 0, $67 = 0, $7 = 0, $73 = 0, $78 = 0, $82 = 0, $90 = 0, $95 = 0, $99 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp; + $7 = ~~+Math_floor(+(+__ZN6vision4log2IfEET_S1_($3))); + HEAP32[$1 >> 2] = $7; + $11 = +Math_log(+($3 / +(1 << $7 | 0))); + $16 = ~~+__ZN6vision5roundIfEET_S1_(+HEAPF32[$0 + 28 >> 2] * $11); + HEAP32[$2 >> 2] = $16; + $17 = $0 + 20 | 0; + if (((HEAP32[$17 >> 2] | 0) + -1 | 0) == ($16 | 0)) { + HEAP32[$1 >> 2] = (HEAP32[$1 >> 2] | 0) + 1; + HEAP32[$2 >> 2] = 0; + $100 = 0; + } else $100 = $16; + $23 = HEAP32[$1 >> 2] | 0; + if (($23 | 0) >= 0) { + $26 = HEAP32[$0 + 16 >> 2] | 0; + if (($23 | 0) < ($26 | 0)) $67 = $100; else { + HEAP32[$1 >> 2] = $26 + -1; + $$sink = (HEAP32[$17 >> 2] | 0) + -1 | 0; + label = 7; + } + } else { + HEAP32[$1 >> 2] = 0; + $$sink = 0; + label = 7; + } + if ((label | 0) == 7) { + HEAP32[$2 >> 2] = $$sink; + $67 = $$sink; + } + $31 = HEAP32[$1 >> 2] | 0; + if (($31 | 0) <= -1) { + $38 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 37937) | 0, 37972) | 0, 39072) | 0, 268) | 0, 39079) | 0, 38065) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $38 + (HEAP32[(HEAP32[$38 >> 2] | 0) + -12 >> 2] | 0) | 0); + $43 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $47 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$43 >> 2] | 0) + 28 >> 2] & 127]($43, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($38, $47) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($38) | 0; + _abort(); + } + if (($31 | 0) >= (HEAP32[$0 + 16 >> 2] | 0)) { + $56 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 38089) | 0, 37972) | 0, 39072) | 0, 269) | 0, 39079) | 0, 38133) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $56 + (HEAP32[(HEAP32[$56 >> 2] | 0) + -12 >> 2] | 0) | 0); + $61 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $65 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$61 >> 2] | 0) + 28 >> 2] & 127]($61, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($56, $65) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($56) | 0; + _abort(); + } + if (($67 | 0) <= -1) { + $73 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 38176) | 0, 37972) | 0, 39072) | 0, 270) | 0, 39079) | 0, 38210) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $73 + (HEAP32[(HEAP32[$73 >> 2] | 0) + -12 >> 2] | 0) | 0); + $78 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $82 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$78 >> 2] | 0) + 28 >> 2] & 127]($78, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($73, $82) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($73) | 0; + _abort(); + } + if (($67 | 0) < (HEAP32[$17 >> 2] | 0)) { + STACKTOP = sp; + return; + } else { + $90 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 38233) | 0, 37972) | 0, 39072) | 0, 271) | 0, 39079) | 0, 38284) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $90 + (HEAP32[(HEAP32[$90 >> 2] | 0) + -12 >> 2] | 0) | 0); + $95 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $99 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$95 >> 2] | 0) + 28 >> 2] & 127]($95, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($90, $99) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($90) | 0; + _abort(); + } +} + +function _process_data_context_main($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$04347$i = 0, $$04546$i = 0, $$048$i = 0, $$05759$i = 0, $$05860$i = 0, $$061$i = 0, $$pre$phi59Z2D = 0, $$pre$phi61Z2D = 0, $$pre$phi63Z2D = 0, $$pre$phi65Z2D = 0, $101 = 0, $103 = 0, $105 = 0, $109 = 0, $110 = 0, $111 = 0, $112 = 0, $118 = 0, $121 = 0, $124 = 0, $126 = 0, $127 = 0, $128 = 0, $131 = 0, $138 = 0, $149 = 0, $19 = 0, $22 = 0, $32 = 0, $33 = 0, $4 = 0, $41 = 0, $48 = 0, $5 = 0, $50 = 0, $54 = 0, $57 = 0, $6 = 0, $62 = 0, $63 = 0, $66 = 0, $74 = 0, $75 = 0, $78 = 0, $90 = 0, $spec$select$i = 0, label = 0; + $4 = $0 + 448 | 0; + $5 = HEAP32[$4 >> 2] | 0; + $6 = $5 + 56 | 0; + do if (!(HEAP32[$6 >> 2] | 0)) if (!(FUNCTION_TABLE_iii[HEAP32[(HEAP32[$0 + 452 >> 2] | 0) + 12 >> 2] & 127]($0, HEAP32[$5 + 60 + (HEAP32[$5 + 68 >> 2] << 2) >> 2] | 0) | 0)) return; else { + HEAP32[$6 >> 2] = 1; + $19 = $5 + 76 | 0; + HEAP32[$19 >> 2] = (HEAP32[$19 >> 2] | 0) + 1; + break; + } while (0); + $22 = $5 + 72 | 0; + switch (HEAP32[$22 >> 2] | 0) { + case 2: + { + $32 = $5 + 48 | 0; + $33 = $5 + 52 | 0; + FUNCTION_TABLE_viiiiiii[HEAP32[(HEAP32[$0 + 456 >> 2] | 0) + 4 >> 2] & 7]($0, HEAP32[$5 + 60 + (HEAP32[$5 + 68 >> 2] << 2) >> 2] | 0, $32, HEAP32[$33 >> 2] | 0, $1, $2, $3); + if ((HEAP32[$32 >> 2] | 0) >>> 0 < (HEAP32[$33 >> 2] | 0) >>> 0) return; + HEAP32[$22 >> 2] = 0; + if ((HEAP32[$2 >> 2] | 0) >>> 0 < $3 >>> 0) { + $$pre$phi59Z2D = $32; + $$pre$phi61Z2D = $33; + label = 9; + } else return; + break; + } + case 0: + { + $$pre$phi59Z2D = $5 + 48 | 0; + $$pre$phi61Z2D = $5 + 52 | 0; + label = 9; + break; + } + case 1: + { + $$pre$phi63Z2D = $5 + 48 | 0; + $$pre$phi65Z2D = $5 + 52 | 0; + break; + } + default: + return; + } + if ((label | 0) == 9) { + HEAP32[$$pre$phi59Z2D >> 2] = 0; + $41 = HEAP32[$0 + 328 >> 2] | 0; + HEAP32[$$pre$phi61Z2D >> 2] = $41 + -1; + if ((HEAP32[$5 + 76 >> 2] | 0) == (HEAP32[$0 + 332 >> 2] | 0) ? ($48 = HEAP32[$4 >> 2] | 0, $50 = HEAP32[$0 + 36 >> 2] | 0, ($50 | 0) > 0) : 0) { + $54 = $48 + 52 | 0; + $57 = $48 + 60 + (HEAP32[$48 + 68 >> 2] << 2) | 0; + $$04347$i = HEAP32[$0 + 216 >> 2] | 0; + $$048$i = 0; + while (1) { + $62 = Math_imul(HEAP32[$$04347$i + 40 >> 2] | 0, HEAP32[$$04347$i + 12 >> 2] | 0) | 0; + $63 = ($62 | 0) / ($41 | 0) | 0; + $66 = ((HEAP32[$$04347$i + 48 >> 2] | 0) >>> 0) % ($62 >>> 0) | 0; + $spec$select$i = ($66 | 0) == 0 ? $62 : $66; + if (!$$048$i) HEAP32[$54 >> 2] = (($spec$select$i + -1 | 0) / ($63 | 0) | 0) + 1; + $74 = HEAP32[(HEAP32[$57 >> 2] | 0) + ($$048$i << 2) >> 2] | 0; + $75 = $63 << 1; + if (($63 | 0) > 0) { + $78 = $74 + ($spec$select$i + -1 << 2) | 0; + $$04546$i = 0; + do { + HEAP32[$74 + ($$04546$i + $spec$select$i << 2) >> 2] = HEAP32[$78 >> 2]; + $$04546$i = $$04546$i + 1 | 0; + } while (($$04546$i | 0) < ($75 | 0)); + } + $$048$i = $$048$i + 1 | 0; + if (($$048$i | 0) == ($50 | 0)) break; else $$04347$i = $$04347$i + 88 | 0; + } + } + HEAP32[$22 >> 2] = 1; + $$pre$phi63Z2D = $$pre$phi59Z2D; + $$pre$phi65Z2D = $$pre$phi61Z2D; + } + $90 = $5 + 68 | 0; + FUNCTION_TABLE_viiiiiii[HEAP32[(HEAP32[$0 + 456 >> 2] | 0) + 4 >> 2] & 7]($0, HEAP32[$5 + 60 + (HEAP32[$90 >> 2] << 2) >> 2] | 0, $$pre$phi63Z2D, HEAP32[$$pre$phi65Z2D >> 2] | 0, $1, $2, $3); + if ((HEAP32[$$pre$phi63Z2D >> 2] | 0) >>> 0 < (HEAP32[$$pre$phi65Z2D >> 2] | 0) >>> 0) return; + if ((HEAP32[$5 + 76 >> 2] | 0) == 1) { + $101 = HEAP32[$4 >> 2] | 0; + $103 = HEAP32[$0 + 328 >> 2] | 0; + $105 = HEAP32[$0 + 36 >> 2] | 0; + if (($105 | 0) > 0) { + $109 = $101 + 60 | 0; + $110 = $101 + 64 | 0; + $111 = $103 + 1 | 0; + $112 = $103 + 2 | 0; + $$05860$i = HEAP32[$0 + 216 >> 2] | 0; + $$061$i = 0; + while (1) { + $118 = (Math_imul(HEAP32[$$05860$i + 40 >> 2] | 0, HEAP32[$$05860$i + 12 >> 2] | 0) | 0) / ($103 | 0) | 0; + $121 = HEAP32[(HEAP32[$109 >> 2] | 0) + ($$061$i << 2) >> 2] | 0; + $124 = HEAP32[(HEAP32[$110 >> 2] | 0) + ($$061$i << 2) >> 2] | 0; + if (($118 | 0) > 0) { + $126 = Math_imul($118, $111) | 0; + $127 = Math_imul($118, $112) | 0; + $$05759$i = 0; + do { + $128 = $$05759$i + $126 | 0; + $131 = $$05759$i - $118 | 0; + HEAP32[$121 + ($131 << 2) >> 2] = HEAP32[$121 + ($128 << 2) >> 2]; + HEAP32[$124 + ($131 << 2) >> 2] = HEAP32[$124 + ($128 << 2) >> 2]; + $138 = $$05759$i + $127 | 0; + HEAP32[$121 + ($138 << 2) >> 2] = HEAP32[$121 + ($$05759$i << 2) >> 2]; + HEAP32[$124 + ($138 << 2) >> 2] = HEAP32[$124 + ($$05759$i << 2) >> 2]; + $$05759$i = $$05759$i + 1 | 0; + } while (($$05759$i | 0) != ($118 | 0)); + } + $$061$i = $$061$i + 1 | 0; + if (($$061$i | 0) == ($105 | 0)) { + $149 = $103; + break; + } else $$05860$i = $$05860$i + 88 | 0; + } + } else $149 = $103; + } else $149 = HEAP32[$0 + 328 >> 2] | 0; + HEAP32[$90 >> 2] = HEAP32[$90 >> 2] ^ 1; + HEAP32[$6 >> 2] = 0; + HEAP32[$$pre$phi63Z2D >> 2] = $149 + 1; + HEAP32[$$pre$phi65Z2D >> 2] = $149 + 2; + HEAP32[$22 >> 2] = 2; + return; +} + +function __ZN6vision14BinarykMedoidsILi96EE6assignERNSt3__26vectorIiNS2_9allocatorIiEEEEPKhiPKiiSB_i($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $$0 = 0, $$038 = 0, $$039 = 0, $$040 = 0, $$1 = 0, $20 = 0, $25 = 0, $29 = 0, $36 = 0, $41 = 0, $45 = 0, $52 = 0, $57 = 0, $61 = 0, $68 = 0, $73 = 0, $77 = 0, $79 = 0, $8 = 0, $85 = 0, $91 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $8 = sp; + if (((HEAP32[$1 + 4 >> 2] | 0) - (HEAP32[$1 >> 2] | 0) >> 2 | 0) != ($5 | 0)) { + $20 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 33206) | 0, 33707) | 0, 39072) | 0, 198) | 0, 39079) | 0, 34039) | 0; + __ZNKSt3__28ios_base6getlocEv($8, $20 + (HEAP32[(HEAP32[$20 >> 2] | 0) + -12 >> 2] | 0) | 0); + $25 = __ZNKSt3__26locale9use_facetERNS0_2idE($8, 66512) | 0; + $29 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$25 >> 2] | 0) + 28 >> 2] & 127]($25, 10) | 0; + __ZNSt3__26localeD2Ev($8); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($20, $29) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($20) | 0; + _abort(); + } + if (($3 | 0) <= 0) { + $36 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 33824) | 0, 33707) | 0, 39072) | 0, 199) | 0, 39079) | 0, 33864) | 0; + __ZNKSt3__28ios_base6getlocEv($8, $36 + (HEAP32[(HEAP32[$36 >> 2] | 0) + -12 >> 2] | 0) | 0); + $41 = __ZNKSt3__26locale9use_facetERNS0_2idE($8, 66512) | 0; + $45 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$41 >> 2] | 0) + 28 >> 2] & 127]($41, 10) | 0; + __ZNSt3__26localeD2Ev($8); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($36, $45) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($36) | 0; + _abort(); + } + if (($5 | 0) > ($3 | 0)) { + $52 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 33900) | 0, 33707) | 0, 39072) | 0, 200) | 0, 39079) | 0, 33951) | 0; + __ZNKSt3__28ios_base6getlocEv($8, $52 + (HEAP32[(HEAP32[$52 >> 2] | 0) + -12 >> 2] | 0) | 0); + $57 = __ZNKSt3__26locale9use_facetERNS0_2idE($8, 66512) | 0; + $61 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$57 >> 2] | 0) + 28 >> 2] & 127]($57, 10) | 0; + __ZNSt3__26localeD2Ev($8); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($52, $61) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($52) | 0; + _abort(); + } + if (($7 | 0) <= 0) { + $68 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 34068) | 0, 33707) | 0, 39072) | 0, 201) | 0, 39079) | 0, 34107) | 0; + __ZNKSt3__28ios_base6getlocEv($8, $68 + (HEAP32[(HEAP32[$68 >> 2] | 0) + -12 >> 2] | 0) | 0); + $73 = __ZNKSt3__26locale9use_facetERNS0_2idE($8, 66512) | 0; + $77 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$73 >> 2] | 0) + 28 >> 2] & 127]($73, 10) | 0; + __ZNSt3__26localeD2Ev($8); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($68, $77) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($68) | 0; + _abort(); + } + $$0 = 0; + $$040 = 0; + while (1) { + if (($$040 | 0) >= ($5 | 0)) break; + $79 = $4 + ($$040 << 2) | 0; + $$038 = 0; + $$039 = -1; + while (1) { + if (($$038 | 0) == ($7 | 0)) break; + $85 = $6 + ($$038 << 2) | 0; + $91 = __ZN6vision15HammingDistanceILi96EEEjPKhS2_($2 + ((HEAP32[$79 >> 2] | 0) * 96 | 0) | 0, $2 + ((HEAP32[$4 + (HEAP32[$85 >> 2] << 2) >> 2] | 0) * 96 | 0) | 0) | 0; + if ($91 >>> 0 < $$039 >>> 0) { + HEAP32[(HEAP32[$1 >> 2] | 0) + ($$040 << 2) >> 2] = HEAP32[$85 >> 2]; + $$1 = $91; + } else $$1 = $$039; + $$038 = $$038 + 1 | 0; + $$039 = $$1; + } + $$0 = $$039 + $$0 | 0; + $$040 = $$040 + 1 | 0; + } + STACKTOP = sp; + return $$0 | 0; +} + +function _jpeg_idct_9x9($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0228248 = 0, $$0230247 = 0, $$0231246 = 0, $$0249 = 0, $$1229244 = 0, $$1245 = 0, $121 = 0, $124 = 0, $127 = 0, $129 = 0, $131 = 0, $134 = 0, $135 = 0, $137 = 0, $138 = 0, $140 = 0, $141 = 0, $143 = 0, $144 = 0, $145 = 0, $147 = 0, $149 = 0, $15 = 0, $151 = 0, $153 = 0, $157 = 0, $159 = 0, $160 = 0, $162 = 0, $164 = 0, $166 = 0, $168 = 0, $170 = 0, $172 = 0, $175 = 0, $21 = 0, $27 = 0, $34 = 0, $35 = 0, $37 = 0, $38 = 0, $40 = 0, $41 = 0, $43 = 0, $44 = 0, $45 = 0, $47 = 0, $49 = 0, $5 = 0, $51 = 0, $57 = 0, $68 = 0, $7 = 0, $74 = 0, $76 = 0, $78 = 0, $80 = 0, $82 = 0, $84 = 0, $86 = 0, $88 = 0, $91 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 288 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(288); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0228248 = $5; + $$0230247 = HEAP32[$1 + 84 >> 2] | 0; + $$0231246 = $2; + $$0249 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0231246 >> 1] << 13, HEAP32[$$0230247 >> 2] | 0) | 0 | 1024; + $21 = Math_imul(HEAP32[$$0230247 + 64 >> 2] | 0, HEAP16[$$0231246 + 32 >> 1] | 0) | 0; + $27 = Math_imul(HEAP32[$$0230247 + 128 >> 2] | 0, HEAP16[$$0231246 + 64 >> 1] | 0) | 0; + $34 = Math_imul((HEAP16[$$0231246 + 96 >> 1] | 0) * 5793 | 0, HEAP32[$$0230247 + 192 >> 2] | 0) | 0; + $35 = $34 + $15 | 0; + $37 = $15 - $34 - $34 | 0; + $38 = $21 - $27 | 0; + $40 = $37 + ($38 * 5793 | 0) | 0; + $41 = (Math_imul($38, -11586) | 0) + $37 | 0; + $43 = ($27 + $21 | 0) * 10887 | 0; + $44 = $21 * 8875 | 0; + $45 = $27 * 2012 | 0; + $47 = $43 - $45 + $35 | 0; + $49 = $35 - $43 + $44 | 0; + $51 = $35 - $44 + $45 | 0; + $57 = Math_imul(HEAP32[$$0230247 + 32 >> 2] | 0, HEAP16[$$0231246 + 16 >> 1] | 0) | 0; + $68 = Math_imul(HEAP32[$$0230247 + 160 >> 2] | 0, HEAP16[$$0231246 + 80 >> 1] | 0) | 0; + $74 = Math_imul(HEAP32[$$0230247 + 224 >> 2] | 0, HEAP16[$$0231246 + 112 >> 1] | 0) | 0; + $76 = Math_imul(Math_imul(HEAP16[$$0231246 + 48 >> 1] | 0, -10033) | 0, HEAP32[$$0230247 + 96 >> 2] | 0) | 0; + $78 = ($68 + $57 | 0) * 7447 | 0; + $80 = ($74 + $57 | 0) * 3962 | 0; + $82 = $78 - $76 + $80 | 0; + $84 = ($68 - $74 | 0) * 11409 | 0; + $86 = $76 - $84 + $78 | 0; + $88 = $84 + $76 + $80 | 0; + $91 = ($57 - $68 - $74 | 0) * 10033 | 0; + HEAP32[$$0228248 >> 2] = $82 + $47 >> 11; + HEAP32[$$0228248 + 256 >> 2] = $47 - $82 >> 11; + HEAP32[$$0228248 + 32 >> 2] = $91 + $40 >> 11; + HEAP32[$$0228248 + 224 >> 2] = $40 - $91 >> 11; + HEAP32[$$0228248 + 64 >> 2] = $86 + $49 >> 11; + HEAP32[$$0228248 + 192 >> 2] = $49 - $86 >> 11; + HEAP32[$$0228248 + 96 >> 2] = $88 + $51 >> 11; + HEAP32[$$0228248 + 160 >> 2] = $51 - $88 >> 11; + HEAP32[$$0228248 + 128 >> 2] = $41 >> 11; + $$0249 = $$0249 + 1 | 0; + if (($$0249 | 0) == 8) break; else { + $$0228248 = $$0228248 + 4 | 0; + $$0230247 = $$0230247 + 4 | 0; + $$0231246 = $$0231246 + 2 | 0; + } + } + $121 = $7 + -384 | 0; + $$1229244 = $5; + $$1245 = 0; + while (1) { + $124 = (HEAP32[$3 + ($$1245 << 2) >> 2] | 0) + $4 | 0; + $127 = (HEAP32[$$1229244 >> 2] << 13) + 134348800 | 0; + $129 = HEAP32[$$1229244 + 8 >> 2] | 0; + $131 = HEAP32[$$1229244 + 16 >> 2] | 0; + $134 = (HEAP32[$$1229244 + 24 >> 2] | 0) * 5793 | 0; + $135 = $134 + $127 | 0; + $137 = $127 - $134 - $134 | 0; + $138 = $129 - $131 | 0; + $140 = $137 + ($138 * 5793 | 0) | 0; + $141 = (Math_imul($138, -11586) | 0) + $137 | 0; + $143 = ($131 + $129 | 0) * 10887 | 0; + $144 = $129 * 8875 | 0; + $145 = $131 * 2012 | 0; + $147 = $143 - $145 + $135 | 0; + $149 = $135 - $143 + $144 | 0; + $151 = $135 - $144 + $145 | 0; + $153 = HEAP32[$$1229244 + 4 >> 2] | 0; + $157 = HEAP32[$$1229244 + 20 >> 2] | 0; + $159 = HEAP32[$$1229244 + 28 >> 2] | 0; + $160 = Math_imul(HEAP32[$$1229244 + 12 >> 2] | 0, -10033) | 0; + $162 = ($157 + $153 | 0) * 7447 | 0; + $164 = ($159 + $153 | 0) * 3962 | 0; + $166 = $162 - $160 + $164 | 0; + $168 = ($157 - $159 | 0) * 11409 | 0; + $170 = $160 - $168 + $162 | 0; + $172 = $168 + $160 + $164 | 0; + $175 = ($153 - $157 - $159 | 0) * 10033 | 0; + HEAP8[$124 >> 0] = HEAP8[$121 + (($166 + $147 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$124 + 8 >> 0] = HEAP8[$121 + (($147 - $166 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$124 + 1 >> 0] = HEAP8[$121 + (($175 + $140 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$124 + 7 >> 0] = HEAP8[$121 + (($140 - $175 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$124 + 2 >> 0] = HEAP8[$121 + (($170 + $149 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$124 + 6 >> 0] = HEAP8[$121 + (($149 - $170 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$124 + 3 >> 0] = HEAP8[$121 + (($172 + $151 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$124 + 5 >> 0] = HEAP8[$121 + (($151 - $172 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$124 + 4 >> 0] = HEAP8[$121 + ($141 >>> 18 & 1023) >> 0] | 0; + $$1245 = $$1245 + 1 | 0; + if (($$1245 | 0) == 9) break; else $$1229244 = $$1229244 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function __ZNKSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = +$5; + var $$0 = 0, $$0$i$i = 0, $$0$i$i39 = 0, $$0$i$i41 = 0, $$037 = 0, $$038 = 0, $$byval_copy = 0, $$sink72 = 0, $$sink73 = 0, $$sink74 = 0, $$sroa$050$0 = 0, $$sroa$058$0 = 0, $$sroa$067$0 = 0, $10 = 0, $101 = 0, $102 = 0, $103 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $23 = 0, $24 = 0, $25 = 0, $29 = 0, $32 = 0, $33 = 0, $48 = 0, $49 = 0, $55 = 0, $6 = 0, $63 = 0, $7 = 0, $73 = 0, $8 = 0, $81 = 0, $89 = 0, $9 = 0, $92 = 0, $vararg_buffer1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 992 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(992); + $$byval_copy = sp + 912 | 0; + $vararg_buffer1 = sp + 904 | 0; + $6 = sp + 800 | 0; + $7 = sp + 984 | 0; + $8 = sp + 400 | 0; + $9 = sp + 980 | 0; + $10 = sp + 988 | 0; + $11 = sp + 976 | 0; + $12 = sp + 972 | 0; + $13 = sp + 960 | 0; + $14 = sp + 948 | 0; + $15 = sp + 936 | 0; + $16 = sp + 932 | 0; + $17 = sp; + $18 = sp + 928 | 0; + $19 = sp + 920 | 0; + $20 = sp + 924 | 0; + HEAP32[$7 >> 2] = $6; + HEAPF64[$$byval_copy >> 3] = $5; + $21 = _snprintf($6, 100, 60455, $$byval_copy) | 0; + if ($21 >>> 0 > 99) { + $23 = __ZNSt3__26__clocEv() | 0; + HEAPF64[$vararg_buffer1 >> 3] = $5; + $24 = __ZNSt3__219__libcpp_asprintf_lEPPcP15__locale_structPKcz($7, $23, 60455, $vararg_buffer1) | 0; + $25 = HEAP32[$7 >> 2] | 0; + if (!$25) __ZSt17__throw_bad_allocv(); + $29 = _malloc($24 << 2) | 0; + if (!$29) __ZSt17__throw_bad_allocv(); else { + $$0 = $29; + $$038 = $24; + $$sroa$058$0 = $29; + $$sroa$067$0 = $25; + } + } else { + $$0 = $8; + $$038 = $21; + $$sroa$058$0 = 0; + $$sroa$067$0 = 0; + } + __ZNKSt3__28ios_base6getlocEv($9, $3); + $32 = __ZNKSt3__26locale9use_facetERNS0_2idE($9, 66544) | 0; + $33 = HEAP32[$7 >> 2] | 0; + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$32 >> 2] | 0) + 48 >> 2] & 15]($32, $33, $33 + $$038 | 0, $$0) | 0; + if (!$$038) $48 = 0; else $48 = (HEAP8[HEAP32[$7 >> 2] >> 0] | 0) == 45; + HEAP32[$13 >> 2] = 0; + HEAP32[$13 + 4 >> 2] = 0; + HEAP32[$13 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$13 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + HEAP32[$14 >> 2] = 0; + HEAP32[$14 + 4 >> 2] = 0; + HEAP32[$14 + 8 >> 2] = 0; + $$0$i$i39 = 0; + while (1) { + if (($$0$i$i39 | 0) == 3) break; + HEAP32[$14 + ($$0$i$i39 << 2) >> 2] = 0; + $$0$i$i39 = $$0$i$i39 + 1 | 0; + } + HEAP32[$15 >> 2] = 0; + HEAP32[$15 + 4 >> 2] = 0; + HEAP32[$15 + 8 >> 2] = 0; + $$0$i$i41 = 0; + while (1) { + if (($$0$i$i41 | 0) == 3) break; + HEAP32[$15 + ($$0$i$i41 << 2) >> 2] = 0; + $$0$i$i41 = $$0$i$i41 + 1 | 0; + } + __ZNSt3__211__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri($2, $48, $9, $10, $11, $12, $13, $14, $15, $16); + $49 = HEAP32[$16 >> 2] | 0; + if (($$038 | 0) > ($49 | 0)) { + $55 = HEAP8[$15 + 8 + 3 >> 0] | 0; + $63 = HEAP8[$14 + 8 + 3 >> 0] | 0; + $$sink72 = $63 << 24 >> 24 < 0 ? HEAP32[$14 + 4 >> 2] | 0 : $63 & 255; + $$sink73 = $49 + 1 + ($$038 - $49 << 1) | 0; + $$sink74 = $55 << 24 >> 24 < 0 ? HEAP32[$15 + 4 >> 2] | 0 : $55 & 255; + } else { + $73 = HEAP8[$15 + 8 + 3 >> 0] | 0; + $81 = HEAP8[$14 + 8 + 3 >> 0] | 0; + $$sink72 = $81 << 24 >> 24 < 0 ? HEAP32[$14 + 4 >> 2] | 0 : $81 & 255; + $$sink73 = $49 + 2 | 0; + $$sink74 = $73 << 24 >> 24 < 0 ? HEAP32[$15 + 4 >> 2] | 0 : $73 & 255; + } + $89 = $$sink73 + $$sink74 + $$sink72 | 0; + if ($89 >>> 0 > 100) { + $92 = _malloc($89 << 2) | 0; + if (!$92) __ZSt17__throw_bad_allocv(); else { + $$037 = $92; + $$sroa$050$0 = $92; + } + } else { + $$037 = $17; + $$sroa$050$0 = 0; + } + __ZNSt3__211__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i($$037, $18, $19, HEAP32[$3 + 4 >> 2] | 0, $$0, $$0 + ($$038 << 2) | 0, $32, $48, $10, HEAP32[$11 >> 2] | 0, HEAP32[$12 >> 2] | 0, $13, $14, $15, $49); + HEAP32[$20 >> 2] = HEAP32[$1 >> 2]; + $101 = HEAP32[$18 >> 2] | 0; + $102 = HEAP32[$19 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$20 >> 2]; + $103 = __ZNSt3__216__pad_and_outputIwNS_11char_traitsIwEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $$037, $101, $102, $3, $4) | 0; + if ($$sroa$050$0 | 0) _free($$sroa$050$0); + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($15); + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($14); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($13); + __ZNSt3__26localeD2Ev($9); + if ($$sroa$058$0 | 0) _free($$sroa$058$0); + if ($$sroa$067$0 | 0) _free($$sroa$067$0); + STACKTOP = sp; + return $103 | 0; +} + +function _arGetContour($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0 = 0, $$0137 = 0, $$0138 = 0, $$0140 = 0, $$0141 = 0, $$0143 = 0, $$1 = 0, $$1144 = 0, $$1144$in = 0, $$2 = 0, $$3 = 0, $$4 = 0, $$5 = 0, $10 = 0, $103 = 0, $11 = 0, $12 = 0, $16 = 0, $18 = 0, $28 = 0, $29 = 0, $30 = 0, $32 = 0, $34 = 0, $35 = 0, $39 = 0, $40 = 0, $42 = 0, $51 = 0, $53 = 0, $54 = 0, $59 = 0, $61 = 0, $62 = 0, $68 = 0, $7 = 0, $73 = 0, $74 = 0, $77 = 0, $79 = 0, $8 = 0, $80 = 0, $91 = 0, $94 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer3 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 80032 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(80032); + $vararg_buffer3 = sp + 80016 | 0; + $vararg_buffer1 = sp + 80008 | 0; + $vararg_buffer = sp + 8e4 | 0; + $7 = sp + 4e4 | 0; + $8 = sp; + $10 = HEAP32[$5 + 8 >> 2] | 0; + $11 = Math_imul($10, $1) | 0; + $12 = HEAP32[$5 >> 2] | 0; + $16 = HEAP32[$5 + 4 >> 2] | 0; + $$0137 = $12; + $$0140 = $0 + ($11 + $12 << 1) | 0; + while (1) { + if (($$0137 | 0) > ($16 | 0)) { + label = 7; + break; + } + $18 = HEAP16[$$0140 >> 1] | 0; + if ($18 << 16 >> 16 > 0 ? (HEAP32[$3 + (($18 << 16 >> 16) + -1 << 2) >> 2] | 0) == ($4 | 0) : 0) { + label = 6; + break; + } + $$0137 = $$0137 + 1 | 0; + $$0140 = $$0140 + 2 | 0; + } + do if ((label | 0) == 6) if (($$0137 | 0) != -1) { + $28 = $6 + 24 | 0; + HEAP32[$28 >> 2] = 1; + $29 = $6 + 28 | 0; + HEAP32[$29 >> 2] = $$0137; + $30 = $6 + 40028 | 0; + HEAP32[$30 >> 2] = $10; + $$0143 = 5; + $32 = $10; + $34 = $$0137; + $53 = 1; + while (1) { + $35 = $0 + ((Math_imul($32, $1) | 0) + $34 << 1) | 0; + $$1 = 0; + $$1144$in = $$0143 + 5 | 0; + while (1) { + $$1144 = ($$1144$in | 0) % 8 | 0; + if ($$1 >>> 0 >= 8) { + label = 13; + break; + } + $39 = HEAP32[48 + ($$1144 << 2) >> 2] | 0; + $40 = Math_imul($39, $1) | 0; + $42 = HEAP32[80 + ($$1144 << 2) >> 2] | 0; + if ((HEAP16[$35 + ($40 + $42 << 1) >> 1] | 0) > 0) { + $51 = $42; + $59 = $39; + break; + } + $$1 = $$1 + 1 | 0; + $$1144$in = $$1144 + 1 | 0; + } + if ((label | 0) == 13) { + label = 0; + if (($$1 | 0) == 8) { + label = 15; + break; + } + $51 = HEAP32[80 + ($$1144 << 2) >> 2] | 0; + $59 = HEAP32[48 + ($$1144 << 2) >> 2] | 0; + } + HEAP32[$6 + 28 + ($53 << 2) >> 2] = $51 + $34; + $54 = HEAP32[$28 >> 2] | 0; + HEAP32[$6 + 40028 + ($54 << 2) >> 2] = $59 + (HEAP32[$6 + 40028 + ($54 + -1 << 2) >> 2] | 0); + $61 = HEAP32[$28 >> 2] | 0; + $62 = $6 + 28 + ($61 << 2) | 0; + if ((HEAP32[$62 >> 2] | 0) == ($$0137 | 0) ? (HEAP32[$6 + 40028 + ($61 << 2) >> 2] | 0) == ($10 | 0) : 0) { + label = 18; + break; + } + $68 = $61 + 1 | 0; + HEAP32[$28 >> 2] = $68; + if (($68 | 0) == 9999) { + label = 21; + break; + } + $$0143 = $$1144; + $32 = HEAP32[$6 + 40028 + ($61 << 2) >> 2] | 0; + $34 = HEAP32[$62 >> 2] | 0; + $53 = $68; + } + if ((label | 0) == 15) { + _arLog(0, 3, 24224, $vararg_buffer1); + $$0 = -1; + break; + } else if ((label | 0) == 18) { + $$0138 = 0; + $$0141 = 0; + $$2 = 1; + while (1) { + if (($$2 | 0) >= ($61 | 0)) break; + $73 = (HEAP32[$6 + 28 + ($$2 << 2) >> 2] | 0) - $$0137 | 0; + $74 = Math_imul($73, $73) | 0; + $77 = (HEAP32[$6 + 40028 + ($$2 << 2) >> 2] | 0) - $10 | 0; + $79 = (Math_imul($77, $77) | 0) + $74 | 0; + $80 = ($79 | 0) > ($$0141 | 0); + $$0138 = $80 ? $$2 : $$0138; + $$0141 = $80 ? $79 : $$0141; + $$2 = $$2 + 1 | 0; + } + $$3 = 0; + while (1) { + if (($$3 | 0) >= ($$0138 | 0)) break; + HEAP32[$7 + ($$3 << 2) >> 2] = HEAP32[$6 + 28 + ($$3 << 2) >> 2]; + HEAP32[$8 + ($$3 << 2) >> 2] = HEAP32[$6 + 40028 + ($$3 << 2) >> 2]; + $$3 = $$3 + 1 | 0; + } + $$4 = $$0138; + $91 = $61; + while (1) { + if (($$4 | 0) >= ($91 | 0)) break; + $94 = $$4 - $$0138 | 0; + HEAP32[$6 + 28 + ($94 << 2) >> 2] = HEAP32[$6 + 28 + ($$4 << 2) >> 2]; + HEAP32[$6 + 40028 + ($94 << 2) >> 2] = HEAP32[$6 + 40028 + ($$4 << 2) >> 2]; + $$4 = $$4 + 1 | 0; + $91 = HEAP32[$28 >> 2] | 0; + } + $$5 = 0; + while (1) { + if (($$5 | 0) >= ($$0138 | 0)) break; + $103 = $$5 - $$0138 | 0; + HEAP32[$6 + 28 + ((HEAP32[$28 >> 2] | 0) + $103 << 2) >> 2] = HEAP32[$7 + ($$5 << 2) >> 2]; + HEAP32[$6 + 40028 + ((HEAP32[$28 >> 2] | 0) + $103 << 2) >> 2] = HEAP32[$8 + ($$5 << 2) >> 2]; + $$5 = $$5 + 1 | 0; + } + HEAP32[$6 + 28 + (HEAP32[$28 >> 2] << 2) >> 2] = HEAP32[$29 >> 2]; + HEAP32[$6 + 40028 + (HEAP32[$28 >> 2] << 2) >> 2] = HEAP32[$30 >> 2]; + HEAP32[$28 >> 2] = (HEAP32[$28 >> 2] | 0) + 1; + $$0 = 0; + break; + } else if ((label | 0) == 21) { + _arLog(0, 3, 24231, $vararg_buffer3); + $$0 = -1; + break; + } + } else label = 7; while (0); + if ((label | 0) == 7) { + _arLog(0, 3, 24217, $vararg_buffer); + $$0 = -1; + } + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN6vision21ComputePolarGradientsEPfPKfmm($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$0184 = 0, $$0185 = 0, $$0186 = 0, $$0187 = 0, $$0192 = 0, $$0196 = 0, $$0196$pn = 0, $$1 = 0, $$1$pn = 0, $$1189 = 0, $$1189$pn = 0, $$1193 = 0, $$1197 = 0, $$1197$pn = 0, $$2 = 0, $$2190 = 0, $$2194 = 0, $$2198 = 0, $$3191 = 0, $$3195 = 0, $$3199 = 0, $$pn = 0, $$pn200 = 0, $$pn201 = 0, $101 = 0.0, $105 = 0.0, $11 = 0.0, $110 = 0.0, $115 = 0, $119 = 0.0, $122 = 0.0, $126 = 0.0, $131 = 0.0, $135 = 0.0, $138 = 0.0, $140 = 0.0, $144 = 0.0, $149 = 0.0, $15 = 0.0, $150 = 0, $154 = 0.0, $157 = 0.0, $161 = 0.0, $166 = 0.0, $20 = 0.0, $22 = 0, $23 = 0.0, $26 = 0.0, $28 = 0.0, $32 = 0.0, $37 = 0.0, $39 = 0, $4 = 0, $43 = 0.0, $46 = 0.0, $5 = 0, $50 = 0.0, $55 = 0.0, $59 = 0, $6 = 0, $61 = 0, $62 = 0, $64 = 0.0, $65 = 0.0, $67 = 0.0, $71 = 0.0, $76 = 0.0, $77 = 0, $8 = 0.0, $80 = 0.0, $83 = 0.0, $87 = 0.0, $9 = 0.0, $92 = 0.0, $98 = 0.0; + $4 = $2 + -1 | 0; + $5 = $1 + ($2 << 2) | 0; + $6 = $1 + 4 | 0; + $8 = +HEAPF32[$1 >> 2]; + $9 = +HEAPF32[$6 >> 2] - $8; + $11 = +HEAPF32[$5 >> 2] - $8; + $15 = +Math_atan2(+$11, +$9) + 3.141592653589793; + HEAPF32[$0 >> 2] = $15; + $20 = +Math_sqrt(+($9 * $9 + $11 * $11)); + HEAPF32[$0 + 4 >> 2] = $20; + $$0186 = 1; + $$0192 = $6; + $$pn = $5; + $$pn201 = $0; + while (1) { + $$0196 = $$pn201 + 8 | 0; + $$0187 = $$pn + 4 | 0; + if ($$0186 >>> 0 >= $4 >>> 0) break; + $39 = $$0192 + 4 | 0; + $43 = +HEAPF32[$39 >> 2] - +HEAPF32[$$0192 + -4 >> 2]; + $46 = +HEAPF32[$$0187 >> 2] - +HEAPF32[$$0192 >> 2]; + $50 = +Math_atan2(+$46, +$43) + 3.141592653589793; + HEAPF32[$$0196 >> 2] = $50; + $55 = +Math_sqrt(+($43 * $43 + $46 * $46)); + HEAPF32[$$pn201 + 12 >> 2] = $55; + $$0186 = $$0186 + 1 | 0; + $$0192 = $39; + $$pn = $$0187; + $$pn201 = $$0196; + } + $22 = $3 + -1 | 0; + $23 = +HEAPF32[$$0192 >> 2]; + $26 = $23 - +HEAPF32[$$0192 + -4 >> 2]; + $28 = +HEAPF32[$$0187 >> 2] - $23; + $32 = +Math_atan2(+$28, +$26) + 3.141592653589793; + HEAPF32[$$0196 >> 2] = $32; + $37 = +Math_sqrt(+($26 * $26 + $28 * $28)); + HEAPF32[$$pn201 + 12 >> 2] = $37; + $$0185 = 1; + $$0196$pn = $$0196; + $$1 = $5 + ($2 << 2) | 0; + $$1189 = $1; + $$1193 = $5; + while (1) { + $$1197 = $$0196$pn + 8 | 0; + if ($$0185 >>> 0 >= $22 >>> 0) break; + $77 = $$1193 + 4 | 0; + $80 = +HEAPF32[$77 >> 2] - +HEAPF32[$$1193 >> 2]; + $83 = +HEAPF32[$$1 >> 2] - +HEAPF32[$$1189 >> 2]; + $87 = +Math_atan2(+$83, +$80) + 3.141592653589793; + HEAPF32[$$1197 >> 2] = $87; + $92 = +Math_sqrt(+($80 * $80 + $83 * $83)); + HEAPF32[$$0196$pn + 12 >> 2] = $92; + $$0184 = 1; + $$1$pn = $$1; + $$1189$pn = $$1189; + $$2194 = $77; + $$2198 = $$0196$pn + 16 | 0; + while (1) { + $$2 = $$1$pn + 4 | 0; + $$2190 = $$1189$pn + 4 | 0; + if ($$0184 >>> 0 >= $4 >>> 0) break; + $115 = $$2194 + 4 | 0; + $119 = +HEAPF32[$115 >> 2] - +HEAPF32[$$2194 + -4 >> 2]; + $122 = +HEAPF32[$$2 >> 2] - +HEAPF32[$$2190 >> 2]; + $126 = +Math_atan2(+$122, +$119) + 3.141592653589793; + HEAPF32[$$2198 >> 2] = $126; + $131 = +Math_sqrt(+($119 * $119 + $122 * $122)); + HEAPF32[$$2198 + 4 >> 2] = $131; + $$0184 = $$0184 + 1 | 0; + $$1$pn = $$2; + $$1189$pn = $$2190; + $$2194 = $115; + $$2198 = $$2198 + 8 | 0; + } + $98 = +HEAPF32[$$2194 >> 2] - +HEAPF32[$$2194 + -4 >> 2]; + $101 = +HEAPF32[$$2 >> 2] - +HEAPF32[$$2190 >> 2]; + $105 = +Math_atan2(+$101, +$98) + 3.141592653589793; + HEAPF32[$$2198 >> 2] = $105; + $110 = +Math_sqrt(+($98 * $98 + $101 * $101)); + HEAPF32[$$2198 + 4 >> 2] = $110; + $$0185 = $$0185 + 1 | 0; + $$0196$pn = $$2198; + $$1 = $$1$pn + 8 | 0; + $$1189 = $$1189$pn + 8 | 0; + $$1193 = $$2194 + 4 | 0; + } + $59 = $1 + ((Math_imul($22, $2) | 0) << 2) | 0; + $61 = $59 + (0 - $2 << 2) | 0; + $62 = $59 + 4 | 0; + $64 = +HEAPF32[$59 >> 2]; + $65 = +HEAPF32[$62 >> 2] - $64; + $67 = $64 - +HEAPF32[$61 >> 2]; + $71 = +Math_atan2(+$67, +$65) + 3.141592653589793; + HEAPF32[$$1197 >> 2] = $71; + $76 = +Math_sqrt(+($65 * $65 + $67 * $67)); + HEAPF32[$$0196$pn + 12 >> 2] = $76; + $$0 = 1; + $$1197$pn = $$1197; + $$3195 = $62; + $$pn200 = $61; + while (1) { + $$3199 = $$1197$pn + 8 | 0; + $$3191 = $$pn200 + 4 | 0; + if ($$0 >>> 0 >= $4 >>> 0) break; + $150 = $$3195 + 4 | 0; + $154 = +HEAPF32[$150 >> 2] - +HEAPF32[$$3195 + -4 >> 2]; + $157 = +HEAPF32[$$3195 >> 2] - +HEAPF32[$$3191 >> 2]; + $161 = +Math_atan2(+$157, +$154) + 3.141592653589793; + HEAPF32[$$3199 >> 2] = $161; + $166 = +Math_sqrt(+($154 * $154 + $157 * $157)); + HEAPF32[$$1197$pn + 12 >> 2] = $166; + $$0 = $$0 + 1 | 0; + $$1197$pn = $$3199; + $$3195 = $150; + $$pn200 = $$3191; + } + $135 = +HEAPF32[$$3195 >> 2]; + $138 = $135 - +HEAPF32[$$3195 + -4 >> 2]; + $140 = $135 - +HEAPF32[$$3191 >> 2]; + $144 = +Math_atan2(+$140, +$138) + 3.141592653589793; + HEAPF32[$$3199 >> 2] = $144; + $149 = +Math_sqrt(+($138 * $138 + $140 * $140)); + HEAPF32[$$1197$pn + 12 >> 2] = $149; + return; +} +function _arPattLoadFromBuffer($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$0140 = 0, $$0141 = 0, $$0143 = 0, $$0146 = 0, $$0149 = 0, $$0150 = 0, $$0151 = 0, $$0152 = 0, $$1 = 0, $$1142 = 0, $$1144 = 0, $$1147 = 0, $$2 = 0, $$2145 = 0, $$2148 = 0, $$3 = 0, $14 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $24 = 0, $26 = 0, $27 = 0, $29 = 0, $31 = 0, $33 = 0, $34 = 0, $35 = 0, $4 = 0, $44 = 0, $47 = 0, $51 = 0, $57 = 0, $6 = 0, $64 = 0, $67 = 0, $69 = 0, $75 = 0, $77 = 0, $79 = 0, $82 = 0.0, $87 = 0, $92 = 0, $94 = 0, $96 = 0, $99 = 0.0, $vararg_buffer1 = 0, $vararg_buffer3 = 0, $vararg_buffer5 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $vararg_buffer5 = sp + 24 | 0; + $vararg_buffer3 = sp + 16 | 0; + $vararg_buffer1 = sp + 8 | 0; + do if ($0) { + if (!$1) { + _arLog(0, 3, 24297, $vararg_buffer1); + $$0 = -1; + break; + } + $4 = $0 + 8 | 0; + $6 = HEAP32[$0 + 4 >> 2] | 0; + $$0146 = 0; + while (1) { + if (($$0146 | 0) >= ($6 | 0)) break; + if (!(HEAP32[(HEAP32[$4 >> 2] | 0) + ($$0146 << 2) >> 2] | 0)) break; + $$0146 = $$0146 + 1 | 0; + } + if (($$0146 | 0) != ($6 | 0)) { + $14 = ___strdup($1) | 0; + if (!$14) { + _arLog(0, 3, 24342, $vararg_buffer3); + $$0 = -1; + break; + } + $17 = $0 + 28 | 0; + $18 = $0 + 12 | 0; + $19 = $$0146 << 2; + $20 = $0 + 20 | 0; + $21 = $0 + 16 | 0; + $22 = $0 + 24 | 0; + $$0140 = _strtok($14, 24365) | 0; + $$0152 = 0; + L16 : while (1) { + if ($$0152 >>> 0 >= 4) { + label = 36; + break; + } + $24 = $$0152 + $19 | 0; + $$0143 = 0; + $$0149 = 0; + $$1 = $$0140; + while (1) { + if ($$0149 >>> 0 >= 3) break; + $26 = ($$0149 | 0) == 0; + $27 = ($$0149 | 0) == 2; + $$0150 = 0; + $$1144 = $$0143; + $$2 = $$1; + $29 = HEAP32[$17 >> 2] | 0; + while (1) { + if (($$0150 | 0) >= ($29 | 0)) break; + $$0151 = 0; + $$2145 = $$1144; + $$3 = $$2; + $31 = $29; + while (1) { + if (($$0151 | 0) >= ($31 | 0)) break; + if (!$$3) { + label = 21; + break L16; + } + $33 = _atoi($$3) | 0; + $34 = _strtok(0, 24365) | 0; + $35 = 255 - $33 | 0; + $44 = (HEAP32[(HEAP32[$18 >> 2] | 0) + ($24 << 2) >> 2] | 0) + ((((Math_imul(HEAP32[$17 >> 2] | 0, $$0150) | 0) + $$0151 | 0) * 3 | 0) + $$0149 << 2) | 0; + HEAP32[$44 >> 2] = $35; + $47 = HEAP32[(HEAP32[$20 >> 2] | 0) + ($24 << 2) >> 2] | 0; + $51 = $47 + ((Math_imul(HEAP32[$17 >> 2] | 0, $$0150) | 0) + $$0151 << 2) | 0; + if (!$26) { + HEAP32[$51 >> 2] = (HEAP32[$51 >> 2] | 0) + $35; + if ($27) { + $57 = $47 + ((Math_imul(HEAP32[$17 >> 2] | 0, $$0150) | 0) + $$0151 << 2) | 0; + HEAP32[$57 >> 2] = (HEAP32[$57 >> 2] | 0) / 3 | 0; + } + } else HEAP32[$51 >> 2] = $35; + $$0151 = $$0151 + 1 | 0; + $$2145 = $35 + $$2145 | 0; + $$3 = $34; + $31 = HEAP32[$17 >> 2] | 0; + } + $$0150 = $$0150 + 1 | 0; + $$1144 = $$2145; + $$2 = $$3; + $29 = $31; + } + $$0143 = $$1144; + $$0149 = $$0149 + 1 | 0; + $$1 = $$2; + } + $64 = HEAP32[$17 >> 2] | 0; + $67 = ($$0143 | 0) / (Math_imul($64 * 3 | 0, $64) | 0) | 0; + $$0141 = 0; + $$1147 = 0; + $69 = $64; + while (1) { + if ($$1147 >>> 0 >= (Math_imul($69 * 3 | 0, $69) | 0) >>> 0) break; + $75 = (HEAP32[(HEAP32[$18 >> 2] | 0) + ($24 << 2) >> 2] | 0) + ($$1147 << 2) | 0; + $77 = (HEAP32[$75 >> 2] | 0) - $67 | 0; + HEAP32[$75 >> 2] = $77; + $79 = (Math_imul($77, $77) | 0) + $$0141 | 0; + $$0141 = $79; + $$1147 = $$1147 + 1 | 0; + $69 = HEAP32[$17 >> 2] | 0; + } + $82 = +Math_sqrt(+(+($$0141 | 0))); + HEAPF64[(HEAP32[$21 >> 2] | 0) + ($24 << 3) >> 3] = $82 == 0.0 ? 1.0e-07 : $82; + $$1142 = 0; + $$2148 = 0; + $87 = $69; + while (1) { + if ($$2148 >>> 0 >= (Math_imul($87, $87) | 0) >>> 0) break; + $92 = (HEAP32[(HEAP32[$20 >> 2] | 0) + ($24 << 2) >> 2] | 0) + ($$2148 << 2) | 0; + $94 = (HEAP32[$92 >> 2] | 0) - $67 | 0; + HEAP32[$92 >> 2] = $94; + $96 = (Math_imul($94, $94) | 0) + $$1142 | 0; + $$1142 = $96; + $$2148 = $$2148 + 1 | 0; + $87 = HEAP32[$17 >> 2] | 0; + } + $99 = +Math_sqrt(+(+($$1142 | 0))); + HEAPF64[(HEAP32[$22 >> 2] | 0) + ($24 << 3) >> 3] = $99 == 0.0 ? 1.0e-07 : $99; + $$0140 = $$1; + $$0152 = $$0152 + 1 | 0; + } + if ((label | 0) == 21) { + _arLog(0, 3, 24370, $vararg_buffer5); + _free($14); + $$0 = -1; + break; + } else if ((label | 0) == 36) { + _free($14); + HEAP32[(HEAP32[$4 >> 2] | 0) + ($$0146 << 2) >> 2] = 1; + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$0 = $$0146; + break; + } + } else $$0 = -1; + } else { + _arLog(0, 3, 24272, sp); + $$0 = -1; + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNKSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = +$5; + var $$0 = 0, $$0$i$i = 0, $$0$i$i41 = 0, $$0$i$i44 = 0, $$037 = 0, $$038 = 0, $$byval_copy = 0, $$sink75 = 0, $$sink76 = 0, $$sink77 = 0, $$sroa$053$0 = 0, $$sroa$061$0 = 0, $$sroa$070$0 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $23 = 0, $24 = 0, $25 = 0, $28 = 0, $31 = 0, $32 = 0, $47 = 0, $48 = 0, $53 = 0, $6 = 0, $60 = 0, $69 = 0, $7 = 0, $76 = 0, $8 = 0, $84 = 0, $86 = 0, $9 = 0, $95 = 0, $96 = 0, $97 = 0, $vararg_buffer1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 416 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(416); + $$byval_copy = sp + 336 | 0; + $vararg_buffer1 = sp + 328 | 0; + $6 = sp + 224 | 0; + $7 = sp + 400 | 0; + $8 = sp + 112 | 0; + $9 = sp + 396 | 0; + $10 = sp + 408 | 0; + $11 = sp + 405 | 0; + $12 = sp + 404 | 0; + $13 = sp + 384 | 0; + $14 = sp + 372 | 0; + $15 = sp + 360 | 0; + $16 = sp + 356 | 0; + $17 = sp; + $18 = sp + 352 | 0; + $19 = sp + 344 | 0; + $20 = sp + 348 | 0; + HEAP32[$7 >> 2] = $6; + HEAPF64[$$byval_copy >> 3] = $5; + $21 = _snprintf($6, 100, 60455, $$byval_copy) | 0; + if ($21 >>> 0 > 99) { + $23 = __ZNSt3__26__clocEv() | 0; + HEAPF64[$vararg_buffer1 >> 3] = $5; + $24 = __ZNSt3__219__libcpp_asprintf_lEPPcP15__locale_structPKcz($7, $23, 60455, $vararg_buffer1) | 0; + $25 = HEAP32[$7 >> 2] | 0; + if (!$25) __ZSt17__throw_bad_allocv(); + $28 = _malloc($24) | 0; + if (!$28) __ZSt17__throw_bad_allocv(); else { + $$0 = $28; + $$038 = $24; + $$sroa$061$0 = $28; + $$sroa$070$0 = $25; + } + } else { + $$0 = $8; + $$038 = $21; + $$sroa$061$0 = 0; + $$sroa$070$0 = 0; + } + __ZNKSt3__28ios_base6getlocEv($9, $3); + $31 = __ZNKSt3__26locale9use_facetERNS0_2idE($9, 66512) | 0; + $32 = HEAP32[$7 >> 2] | 0; + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$31 >> 2] | 0) + 32 >> 2] & 15]($31, $32, $32 + $$038 | 0, $$0) | 0; + if (!$$038) $47 = 0; else $47 = (HEAP8[HEAP32[$7 >> 2] >> 0] | 0) == 45; + HEAP32[$13 >> 2] = 0; + HEAP32[$13 + 4 >> 2] = 0; + HEAP32[$13 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$13 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + HEAP32[$14 >> 2] = 0; + HEAP32[$14 + 4 >> 2] = 0; + HEAP32[$14 + 8 >> 2] = 0; + $$0$i$i41 = 0; + while (1) { + if (($$0$i$i41 | 0) == 3) break; + HEAP32[$14 + ($$0$i$i41 << 2) >> 2] = 0; + $$0$i$i41 = $$0$i$i41 + 1 | 0; + } + HEAP32[$15 >> 2] = 0; + HEAP32[$15 + 4 >> 2] = 0; + HEAP32[$15 + 8 >> 2] = 0; + $$0$i$i44 = 0; + while (1) { + if (($$0$i$i44 | 0) == 3) break; + HEAP32[$15 + ($$0$i$i44 << 2) >> 2] = 0; + $$0$i$i44 = $$0$i$i44 + 1 | 0; + } + __ZNSt3__211__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri($2, $47, $9, $10, $11, $12, $13, $14, $15, $16); + $48 = HEAP32[$16 >> 2] | 0; + if (($$038 | 0) > ($48 | 0)) { + $53 = HEAP8[$15 + 11 >> 0] | 0; + $60 = HEAP8[$14 + 11 >> 0] | 0; + $$sink75 = $60 << 24 >> 24 < 0 ? HEAP32[$14 + 4 >> 2] | 0 : $60 & 255; + $$sink76 = $48 + 1 + ($$038 - $48 << 1) | 0; + $$sink77 = $53 << 24 >> 24 < 0 ? HEAP32[$15 + 4 >> 2] | 0 : $53 & 255; + } else { + $69 = HEAP8[$15 + 11 >> 0] | 0; + $76 = HEAP8[$14 + 11 >> 0] | 0; + $$sink75 = $76 << 24 >> 24 < 0 ? HEAP32[$14 + 4 >> 2] | 0 : $76 & 255; + $$sink76 = $48 + 2 | 0; + $$sink77 = $69 << 24 >> 24 < 0 ? HEAP32[$15 + 4 >> 2] | 0 : $69 & 255; + } + $84 = $$sink76 + $$sink77 + $$sink75 | 0; + if ($84 >>> 0 > 100) { + $86 = _malloc($84) | 0; + if (!$86) __ZSt17__throw_bad_allocv(); else { + $$037 = $86; + $$sroa$053$0 = $86; + } + } else { + $$037 = $17; + $$sroa$053$0 = 0; + } + __ZNSt3__211__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i($$037, $18, $19, HEAP32[$3 + 4 >> 2] | 0, $$0, $$0 + $$038 | 0, $31, $47, $10, HEAP8[$11 >> 0] | 0, HEAP8[$12 >> 0] | 0, $13, $14, $15, $48); + HEAP32[$20 >> 2] = HEAP32[$1 >> 2]; + $95 = HEAP32[$18 >> 2] | 0; + $96 = HEAP32[$19 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$20 >> 2]; + $97 = __ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $$037, $95, $96, $3, $4) | 0; + if ($$sroa$053$0 | 0) _free($$sroa$053$0); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($15); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($14); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($13); + __ZNSt3__26localeD2Ev($9); + if ($$sroa$061$0 | 0) _free($$sroa$061$0); + if ($$sroa$070$0 | 0) _free($$sroa$070$0); + STACKTOP = sp; + return $97 | 0; +} + +function __ZNSt3__213unordered_mapIi7ARParamNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_($this, $__k) { + $this = $this | 0; + $__k = $__k | 0; + var $$pn$i = 0, $0 = 0, $1 = 0, $11 = 0, $16 = 0, $17 = 0, $18 = 0, $23 = 0, $3 = 0, $4 = 0, $7 = 0.0, $9 = 0, $__bc$0$i = 0, $__chash$0$i = 0, $__chash$1$i = 0, $__h$i = 0, $__nd$0$i = 0, $__nd$1$i = 0, $__value_$i$i$i = 0, $__value_$i$i$i1$i$i = 0, $__value_$i$i$i38$pre$phi$iZZZZ2D = 0, $__value_$i$i$i81$i = 0, $add32$i = 0, $cmp$i = 0, $cond3$i$i = 0, $cond3$i60$i = 0, $cond3$i89$i = 0, $conv$i = 0.0, $conv39$i = 0, $ref$tmp2 = 0, $ref$tmp5 = 0, $sub$i$i = 0, $sub$i54$i = 0, $sub$i64$i = 0, $tobool$i56$i = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $__h$i = sp + 4 | 0; + $ref$tmp2 = sp; + $ref$tmp5 = sp + 16 | 0; + HEAP32[$ref$tmp2 >> 2] = $__k; + $0 = HEAP32[$__k >> 2] | 0; + $__value_$i$i$i1$i$i = $this + 4 | 0; + $1 = HEAP32[$__value_$i$i$i1$i$i >> 2] | 0; + $cmp$i = ($1 | 0) == 0; + L1 : do if (!$cmp$i) { + $sub$i54$i = $1 + -1 | 0; + $tobool$i56$i = ($sub$i54$i & $1 | 0) == 0; + if (!$tobool$i56$i) if ($0 >>> 0 < $1 >>> 0) $cond3$i60$i = $0; else $cond3$i60$i = ($0 >>> 0) % ($1 >>> 0) | 0; else $cond3$i60$i = $sub$i54$i & $0; + $3 = HEAP32[(HEAP32[$this >> 2] | 0) + ($cond3$i60$i << 2) >> 2] | 0; + if (!$3) { + $__chash$0$i = $cond3$i60$i; + label = 16; + } else { + $$pn$i = $3; + while (1) { + $__nd$0$i = HEAP32[$$pn$i >> 2] | 0; + if (!$__nd$0$i) { + $__chash$0$i = $cond3$i60$i; + label = 16; + break L1; + } + $4 = HEAP32[$__nd$0$i + 4 >> 2] | 0; + if (($4 | 0) != ($0 | 0)) { + if (!$tobool$i56$i) if ($4 >>> 0 < $1 >>> 0) $cond3$i89$i = $4; else $cond3$i89$i = ($4 >>> 0) % ($1 >>> 0) | 0; else $cond3$i89$i = $4 & $sub$i54$i; + if (($cond3$i89$i | 0) != ($cond3$i60$i | 0)) { + $__chash$0$i = $cond3$i60$i; + label = 16; + break L1; + } + } + if ((HEAP32[$__nd$0$i + 8 >> 2] | 0) == ($0 | 0)) { + $__nd$1$i = $__nd$0$i; + break; + } else $$pn$i = $__nd$0$i; + } + } + } else { + $__chash$0$i = 0; + label = 16; + } while (0); + if ((label | 0) == 16) { + __ZNSt3__212__hash_tableINS_17__hash_value_typeIi7ARParamEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE21__construct_node_hashIRKNS_21piecewise_construct_tEJNS_5tupleIJRKiEEENSJ_IJEEEEEENS_10unique_ptrINS_11__hash_nodeIS3_PvEENS_22__hash_node_destructorINSC_ISR_EEEEEEmOT_DpOT0_($__h$i, $this, $0, 67437, $ref$tmp2, $ref$tmp5); + $__value_$i$i$i81$i = $this + 12 | 0; + $conv$i = +(((HEAP32[$__value_$i$i$i81$i >> 2] | 0) + 1 | 0) >>> 0); + $7 = +HEAPF32[$this + 16 >> 2]; + do if ($cmp$i | $7 * +($1 >>> 0) < $conv$i) { + $add32$i = $1 << 1 | ($1 >>> 0 < 3 | ($1 + -1 & $1 | 0) != 0) & 1; + $conv39$i = ~~+Math_ceil(+($conv$i / $7)) >>> 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIi7ARParamEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE6rehashEm($this, $add32$i >>> 0 < $conv39$i >>> 0 ? $conv39$i : $add32$i); + $9 = HEAP32[$__value_$i$i$i1$i$i >> 2] | 0; + $sub$i64$i = $9 + -1 | 0; + if (!($sub$i64$i & $9)) { + $__bc$0$i = $9; + $__chash$1$i = $sub$i64$i & $0; + break; + } + if ($0 >>> 0 < $9 >>> 0) { + $__bc$0$i = $9; + $__chash$1$i = $0; + } else { + $__bc$0$i = $9; + $__chash$1$i = ($0 >>> 0) % ($9 >>> 0) | 0; + } + } else { + $__bc$0$i = $1; + $__chash$1$i = $__chash$0$i; + } while (0); + $11 = HEAP32[(HEAP32[$this >> 2] | 0) + ($__chash$1$i << 2) >> 2] | 0; + if (!$11) { + $__value_$i$i$i = $this + 8 | 0; + HEAP32[HEAP32[$__h$i >> 2] >> 2] = HEAP32[$__value_$i$i$i >> 2]; + HEAP32[$__value_$i$i$i >> 2] = HEAP32[$__h$i >> 2]; + HEAP32[(HEAP32[$this >> 2] | 0) + ($__chash$1$i << 2) >> 2] = $__value_$i$i$i; + $16 = HEAP32[$__h$i >> 2] | 0; + $17 = HEAP32[$16 >> 2] | 0; + if (!$17) $__value_$i$i$i38$pre$phi$iZZZZ2D = $__h$i; else { + $18 = HEAP32[$17 + 4 >> 2] | 0; + $sub$i$i = $__bc$0$i + -1 | 0; + if ($sub$i$i & $__bc$0$i) if ($18 >>> 0 < $__bc$0$i >>> 0) $cond3$i$i = $18; else $cond3$i$i = ($18 >>> 0) % ($__bc$0$i >>> 0) | 0; else $cond3$i$i = $18 & $sub$i$i; + HEAP32[(HEAP32[$this >> 2] | 0) + ($cond3$i$i << 2) >> 2] = $16; + $__value_$i$i$i38$pre$phi$iZZZZ2D = $__h$i; + } + } else { + HEAP32[HEAP32[$__h$i >> 2] >> 2] = HEAP32[$11 >> 2]; + HEAP32[$11 >> 2] = HEAP32[$__h$i >> 2]; + $__value_$i$i$i38$pre$phi$iZZZZ2D = $__h$i; + } + $23 = HEAP32[$__value_$i$i$i38$pre$phi$iZZZZ2D >> 2] | 0; + HEAP32[$__value_$i$i$i81$i >> 2] = (HEAP32[$__value_$i$i$i81$i >> 2] | 0) + 1; + HEAP32[$__value_$i$i$i38$pre$phi$iZZZZ2D >> 2] = 0; + $__nd$1$i = $23; + } + STACKTOP = sp; + return $__nd$1$i + 16 | 0; +} + +function __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_($this, $__k) { + $this = $this | 0; + $__k = $__k | 0; + var $$pn$i = 0, $0 = 0, $1 = 0, $11 = 0, $16 = 0, $17 = 0, $18 = 0, $23 = 0, $3 = 0, $4 = 0, $7 = 0.0, $9 = 0, $__bc$0$i = 0, $__chash$0$i = 0, $__chash$1$i = 0, $__h$i = 0, $__nd$0$i = 0, $__nd$1$i = 0, $__value_$i$i$i = 0, $__value_$i$i$i1$i$i = 0, $__value_$i$i$i38$pre$phi$iZZZZ2D = 0, $__value_$i$i$i93$i = 0, $add32$i = 0, $cmp$i = 0, $cond3$i$i = 0, $cond3$i48$i = 0, $cond3$i84$i = 0, $conv$i = 0.0, $conv39$i = 0, $ref$tmp2 = 0, $ref$tmp5 = 0, $sub$i$i = 0, $sub$i42$i = 0, $sub$i69$i = 0, $tobool$i$i = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $__h$i = sp + 4 | 0; + $ref$tmp2 = sp; + $ref$tmp5 = sp + 16 | 0; + HEAP32[$ref$tmp2 >> 2] = $__k; + $0 = HEAP32[$__k >> 2] | 0; + $__value_$i$i$i1$i$i = $this + 4 | 0; + $1 = HEAP32[$__value_$i$i$i1$i$i >> 2] | 0; + $cmp$i = ($1 | 0) == 0; + L1 : do if (!$cmp$i) { + $sub$i$i = $1 + -1 | 0; + $tobool$i$i = ($sub$i$i & $1 | 0) == 0; + if (!$tobool$i$i) if ($0 >>> 0 < $1 >>> 0) $cond3$i$i = $0; else $cond3$i$i = ($0 >>> 0) % ($1 >>> 0) | 0; else $cond3$i$i = $sub$i$i & $0; + $3 = HEAP32[(HEAP32[$this >> 2] | 0) + ($cond3$i$i << 2) >> 2] | 0; + if (!$3) { + $__chash$0$i = $cond3$i$i; + label = 16; + } else { + $$pn$i = $3; + while (1) { + $__nd$0$i = HEAP32[$$pn$i >> 2] | 0; + if (!$__nd$0$i) { + $__chash$0$i = $cond3$i$i; + label = 16; + break L1; + } + $4 = HEAP32[$__nd$0$i + 4 >> 2] | 0; + if (($4 | 0) != ($0 | 0)) { + if (!$tobool$i$i) if ($4 >>> 0 < $1 >>> 0) $cond3$i84$i = $4; else $cond3$i84$i = ($4 >>> 0) % ($1 >>> 0) | 0; else $cond3$i84$i = $4 & $sub$i$i; + if (($cond3$i84$i | 0) != ($cond3$i$i | 0)) { + $__chash$0$i = $cond3$i$i; + label = 16; + break L1; + } + } + if ((HEAP32[$__nd$0$i + 8 >> 2] | 0) == ($0 | 0)) { + $__nd$1$i = $__nd$0$i; + break; + } else $$pn$i = $__nd$0$i; + } + } + } else { + $__chash$0$i = 0; + label = 16; + } while (0); + if ((label | 0) == 16) { + __ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE21__construct_node_hashIRKNS_21piecewise_construct_tEJNS_5tupleIJRKiEEENSJ_IJEEEEEENS_10unique_ptrINS_11__hash_nodeIS3_PvEENS_22__hash_node_destructorINSC_ISR_EEEEEEmOT_DpOT0_($__h$i, $this, $0, 67437, $ref$tmp2, $ref$tmp5); + $__value_$i$i$i93$i = $this + 12 | 0; + $conv$i = +(((HEAP32[$__value_$i$i$i93$i >> 2] | 0) + 1 | 0) >>> 0); + $7 = +HEAPF32[$this + 16 >> 2]; + do if ($cmp$i | $7 * +($1 >>> 0) < $conv$i) { + $add32$i = $1 << 1 | ($1 >>> 0 < 3 | ($1 + -1 & $1 | 0) != 0) & 1; + $conv39$i = ~~+Math_ceil(+($conv$i / $7)) >>> 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE6rehashEm($this, $add32$i >>> 0 < $conv39$i >>> 0 ? $conv39$i : $add32$i); + $9 = HEAP32[$__value_$i$i$i1$i$i >> 2] | 0; + $sub$i69$i = $9 + -1 | 0; + if (!($sub$i69$i & $9)) { + $__bc$0$i = $9; + $__chash$1$i = $sub$i69$i & $0; + break; + } + if ($0 >>> 0 < $9 >>> 0) { + $__bc$0$i = $9; + $__chash$1$i = $0; + } else { + $__bc$0$i = $9; + $__chash$1$i = ($0 >>> 0) % ($9 >>> 0) | 0; + } + } else { + $__bc$0$i = $1; + $__chash$1$i = $__chash$0$i; + } while (0); + $11 = HEAP32[(HEAP32[$this >> 2] | 0) + ($__chash$1$i << 2) >> 2] | 0; + if (!$11) { + $__value_$i$i$i = $this + 8 | 0; + HEAP32[HEAP32[$__h$i >> 2] >> 2] = HEAP32[$__value_$i$i$i >> 2]; + HEAP32[$__value_$i$i$i >> 2] = HEAP32[$__h$i >> 2]; + HEAP32[(HEAP32[$this >> 2] | 0) + ($__chash$1$i << 2) >> 2] = $__value_$i$i$i; + $16 = HEAP32[$__h$i >> 2] | 0; + $17 = HEAP32[$16 >> 2] | 0; + if (!$17) $__value_$i$i$i38$pre$phi$iZZZZ2D = $__h$i; else { + $18 = HEAP32[$17 + 4 >> 2] | 0; + $sub$i42$i = $__bc$0$i + -1 | 0; + if ($sub$i42$i & $__bc$0$i) if ($18 >>> 0 < $__bc$0$i >>> 0) $cond3$i48$i = $18; else $cond3$i48$i = ($18 >>> 0) % ($__bc$0$i >>> 0) | 0; else $cond3$i48$i = $18 & $sub$i42$i; + HEAP32[(HEAP32[$this >> 2] | 0) + ($cond3$i48$i << 2) >> 2] = $16; + $__value_$i$i$i38$pre$phi$iZZZZ2D = $__h$i; + } + } else { + HEAP32[HEAP32[$__h$i >> 2] >> 2] = HEAP32[$11 >> 2]; + HEAP32[$11 >> 2] = HEAP32[$__h$i >> 2]; + $__value_$i$i$i38$pre$phi$iZZZZ2D = $__h$i; + } + $23 = HEAP32[$__value_$i$i$i38$pre$phi$iZZZZ2D >> 2] | 0; + HEAP32[$__value_$i$i$i93$i >> 2] = (HEAP32[$__value_$i$i$i93$i >> 2] | 0) + 1; + HEAP32[$__value_$i$i$i38$pre$phi$iZZZZ2D >> 2] = 0; + $__nd$1$i = $23; + } + STACKTOP = sp; + return $__nd$1$i + 16 | 0; +} + +function __ZN6vision14ExtractFREAK84ERNS_18BinaryFeatureStoreEPKNS_25GaussianScaleSpacePyramidERKNSt3__26vectorINS_12FeaturePointENS5_9allocatorIS7_EEEEPKfSE_SE_SE_SE_SE_ffffffff($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = +$9; + $10 = +$10; + $11 = +$11; + $12 = +$12; + $13 = +$13; + $14 = +$14; + $15 = +$15; + $16 = +$16; + var $$0 = 0, $$036 = 0, $$1 = 0, $17 = 0, $24 = 0, $29 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $46 = 0, $51 = 0, $55 = 0, $57 = 0, $58 = 0, $59 = 0, $62 = 0, $67 = 0, $68 = 0, $76 = 0, $81 = 0, $85 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $17 = sp; + if (!$1) { + $24 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 37660) | 0, 37691) | 0, 39072) | 0, 537) | 0, 39079) | 0, 37760) | 0; + __ZNKSt3__28ios_base6getlocEv($17, $24 + (HEAP32[(HEAP32[$24 >> 2] | 0) + -12 >> 2] | 0) | 0); + $29 = __ZNKSt3__26locale9use_facetERNS0_2idE($17, 66512) | 0; + $33 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$29 >> 2] | 0) + 28 >> 2] & 127]($29, 10) | 0; + __ZNSt3__26localeD2Ev($17); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($24, $33) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($24) | 0; + _abort(); + } + $34 = __ZNK6vision18BinaryFeatureStore4sizeEv($0) | 0; + $35 = $2 + 4 | 0; + $36 = HEAP32[$35 >> 2] | 0; + $37 = HEAP32[$2 >> 2] | 0; + if (($34 | 0) != (($36 - $37 | 0) / 20 | 0 | 0)) { + $46 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 37776) | 0, 37691) | 0, 39072) | 0, 538) | 0, 39079) | 0, 37829) | 0; + __ZNKSt3__28ios_base6getlocEv($17, $46 + (HEAP32[(HEAP32[$46 >> 2] | 0) + -12 >> 2] | 0) | 0); + $51 = __ZNKSt3__26locale9use_facetERNS0_2idE($17, 66512) | 0; + $55 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$51 >> 2] | 0) + 28 >> 2] & 127]($51, 10) | 0; + __ZNSt3__26localeD2Ev($17); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($46, $55) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($46) | 0; + _abort(); + } + $$0 = 0; + $$036 = 0; + $57 = $37; + $58 = $36; + while (1) { + $59 = ($58 - $57 | 0) / 20 | 0; + if ($$0 >>> 0 >= $59 >>> 0) break; + $62 = __ZN6vision18BinaryFeatureStore7featureEm($0, $$036) | 0; + if (__ZN6vision14ExtractFREAK84EPhPKNS_25GaussianScaleSpacePyramidERKNS_12FeaturePointEPKfS8_S8_S8_S8_S8_ffffffff($62, $1, (HEAP32[$2 >> 2] | 0) + ($$0 * 20 | 0) | 0, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16) | 0) { + $67 = (HEAP32[$2 >> 2] | 0) + ($$0 * 20 | 0) | 0; + $68 = __ZN6vision18BinaryFeatureStore5pointEm($0, $$036) | 0; + HEAP32[$68 >> 2] = HEAP32[$67 >> 2]; + HEAP32[$68 + 4 >> 2] = HEAP32[$67 + 4 >> 2]; + HEAP32[$68 + 8 >> 2] = HEAP32[$67 + 8 >> 2]; + HEAP32[$68 + 12 >> 2] = HEAP32[$67 + 12 >> 2]; + HEAP8[$68 + 16 >> 0] = HEAP8[$67 + 16 >> 0] | 0; + $$1 = $$036 + 1 | 0; + } else $$1 = $$036; + $$0 = $$0 + 1 | 0; + $$036 = $$1; + $57 = HEAP32[$2 >> 2] | 0; + $58 = HEAP32[$35 >> 2] | 0; + } + if (($$036 | 0) == ($59 | 0)) { + __ZN6vision18BinaryFeatureStore6resizeEm($0, $$036); + STACKTOP = sp; + return; + } else { + $76 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 37866) | 0, 37691) | 0, 39072) | 0, 617) | 0, 39079) | 0, 37917) | 0; + __ZNKSt3__28ios_base6getlocEv($17, $76 + (HEAP32[(HEAP32[$76 >> 2] | 0) + -12 >> 2] | 0) | 0); + $81 = __ZNKSt3__26locale9use_facetERNS0_2idE($17, 66512) | 0; + $85 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$81 >> 2] | 0) + 28 >> 2] & 127]($81, 10) | 0; + __ZNSt3__26localeD2Ev($17); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($76, $85) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($76) | 0; + _abort(); + } +} + +function _decode_mcu_DC_first($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$035$i = 0, $$087$lcssa = 0, $$087101 = 0, $$09198 = 0, $$093104 = 0, $$099 = 0, $$1 = 0, $$192 = 0, $$sink = 0, $110 = 0, $113 = 0, $114 = 0, $117 = 0, $119 = 0, $125 = 0, $127 = 0, $130 = 0, $16 = 0, $19 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $27 = 0, $3 = 0, $4 = 0, $54 = 0, $56 = 0, $57 = 0, $60 = 0, $63 = 0, $65 = 0, $67 = 0, $7 = 0, $71 = 0, $72 = 0, $74 = 0, $76 = 0, $8 = 0, $80 = 0, $82 = 0, $83 = 0, $86 = 0, $89 = 0, $91 = 0, $95 = 0, $spec$select = 0, dest = 0, label = 0, stop = 0; + $3 = HEAP32[$0 + 468 >> 2] | 0; + $4 = $0 + 280 | 0; + if (HEAP32[$4 >> 2] | 0) { + $7 = $3 + 56 | 0; + $8 = HEAP32[$7 >> 2] | 0; + if (!$8) { + if (!(FUNCTION_TABLE_ii[HEAP32[(HEAP32[$0 + 464 >> 2] | 0) + 8 >> 2] & 127]($0) | 0)) { + $16 = HEAP32[$0 >> 2] | 0; + HEAP32[$16 + 20 >> 2] = 25; + FUNCTION_TABLE_vi[HEAP32[$16 >> 2] & 255]($0); + } + $19 = $0 + 340 | 0; + if ((HEAP32[$19 >> 2] | 0) > 0) { + $22 = $0 + 224 | 0; + $23 = $0 + 412 | 0; + $24 = $0 + 436 | 0; + $25 = $0 + 420 | 0; + $$035$i = 0; + do { + $27 = HEAP32[$0 + 344 + ($$035$i << 2) >> 2] | 0; + if (HEAP32[$22 >> 2] | 0) if (!(HEAP32[$23 >> 2] | 0)) { + if (!(HEAP32[$25 >> 2] | 0)) label = 10; + } else label = 13; else label = 10; + do if ((label | 0) == 10) { + label = 0; + dest = HEAP32[$3 + 60 + (HEAP32[$27 + 20 >> 2] << 2) >> 2] | 0; + stop = dest + 64 | 0; + do { + HEAP8[dest >> 0] = 0; + dest = dest + 1 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$3 + 24 + ($$035$i << 2) >> 2] = 0; + HEAP32[$3 + 40 + ($$035$i << 2) >> 2] = 0; + if (!(HEAP32[$22 >> 2] | 0)) if (!(HEAP32[$24 >> 2] | 0)) break; else { + label = 13; + break; + } else if (!(HEAP32[$23 >> 2] | 0)) break; else { + label = 13; + break; + } + } while (0); + if ((label | 0) == 13) { + label = 0; + _memset(HEAP32[$3 + 124 + (HEAP32[$27 + 24 >> 2] << 2) >> 2] | 0, 0, 256) | 0; + } + $$035$i = $$035$i + 1 | 0; + } while (($$035$i | 0) < (HEAP32[$19 >> 2] | 0)); + } + HEAP32[$3 + 12 >> 2] = 0; + HEAP32[$3 + 16 >> 2] = 0; + HEAP32[$3 + 20 >> 2] = -16; + $54 = HEAP32[$4 >> 2] | 0; + HEAP32[$7 >> 2] = $54; + $56 = $54; + } else $56 = $8; + HEAP32[$7 >> 2] = $56 + -1; + } + $57 = $3 + 20 | 0; + if ((HEAP32[$57 >> 2] | 0) == -1) return 1; + $60 = $0 + 368 | 0; + if ((HEAP32[$60 >> 2] | 0) <= 0) return 1; + $63 = $0 + 424 | 0; + $$093104 = 0; + L32 : while (1) { + $65 = HEAP32[$1 + ($$093104 << 2) >> 2] | 0; + $67 = HEAP32[$0 + 372 + ($$093104 << 2) >> 2] | 0; + $71 = HEAP32[(HEAP32[$0 + 344 + ($67 << 2) >> 2] | 0) + 20 >> 2] | 0; + $72 = $3 + 60 + ($71 << 2) | 0; + $74 = $3 + 40 + ($67 << 2) | 0; + $76 = (HEAP32[$72 >> 2] | 0) + (HEAP32[$74 >> 2] | 0) | 0; + if (!(_arith_decode($0, $76) | 0)) { + HEAP32[$74 >> 2] = 0; + $130 = HEAP32[$3 + 24 + ($67 << 2) >> 2] | 0; + } else { + $80 = _arith_decode($0, $76 + 1 | 0) | 0; + $82 = $76 + 2 + $80 | 0; + $83 = _arith_decode($0, $82) | 0; + if ($83) { + $86 = (HEAP32[$72 >> 2] | 0) + 20 | 0; + if (!(_arith_decode($0, $86) | 0)) { + $$1 = $83; + $$192 = $86; + } else { + $$09198 = $86; + $$099 = $83; + while (1) { + $89 = $$099 << 1; + if (($89 | 0) == 32768) break L32; + $95 = $$09198 + 1 | 0; + if (!(_arith_decode($0, $95) | 0)) { + $$1 = $89; + $$192 = $95; + break; + } else { + $$09198 = $95; + $$099 = $89; + } + } + } + } else { + $$1 = 0; + $$192 = $82; + } + do if (($$1 | 0) >= (1 << (HEAPU8[$0 + 232 + $71 >> 0] | 0) >> 1 | 0)) { + $110 = $80 << 2; + if (($$1 | 0) > (1 << (HEAPU8[$0 + 248 + $71 >> 0] | 0) >> 1 | 0)) { + $$sink = $110 + 12 | 0; + break; + } else { + $$sink = $110 + 4 | 0; + break; + } + } else $$sink = 0; while (0); + HEAP32[$74 >> 2] = $$sink; + $113 = $$192 + 14 | 0; + $114 = $$1 >> 1; + if (!$114) $$087$lcssa = $$1; else { + $$087101 = $$1; + $119 = $114; + while (1) { + $117 = (_arith_decode($0, $113) | 0) == 0; + $spec$select = ($117 ? 0 : $119) | $$087101; + $119 = $119 >> 1; + if (!$119) { + $$087$lcssa = $spec$select; + break; + } else $$087101 = $spec$select; + } + } + $125 = $3 + 24 + ($67 << 2) | 0; + $127 = (HEAP32[$125 >> 2] | 0) + (($80 | 0) == 0 ? $$087$lcssa + 1 | 0 : ~$$087$lcssa) | 0; + HEAP32[$125 >> 2] = $127; + $130 = $127; + } + HEAP16[$65 >> 1] = $130 << HEAP32[$63 >> 2]; + $$093104 = $$093104 + 1 | 0; + if (($$093104 | 0) >= (HEAP32[$60 >> 2] | 0)) { + label = 37; + break; + } + } + if ((label | 0) == 37) return 1; + $91 = HEAP32[$0 >> 2] | 0; + HEAP32[$91 + 20 >> 2] = 117; + FUNCTION_TABLE_vii[HEAP32[$91 + 4 >> 2] & 255]($0, -1); + HEAP32[$57 >> 2] = -1; + return 1; +} + +function _decode_mcu_AC_refine($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$035$i = 0, $$069$lcssa = 0, $$06980 = 0, $$070 = 0, $$071 = 0, $$172 = 0, $$lcssa = 0, $$lcssa75 = 0, $102 = 0, $103 = 0, $114 = 0, $117 = 0, $118 = 0, $122 = 0, $123 = 0, $126 = 0, $131 = 0, $16 = 0, $19 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $27 = 0, $3 = 0, $4 = 0, $54 = 0, $56 = 0, $57 = 0, $61 = 0, $62 = 0, $66 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $8 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $89 = 0, $93 = 0, $96 = 0, dest = 0, label = 0, stop = 0; + $3 = HEAP32[$0 + 468 >> 2] | 0; + $4 = $0 + 280 | 0; + if (HEAP32[$4 >> 2] | 0) { + $7 = $3 + 56 | 0; + $8 = HEAP32[$7 >> 2] | 0; + if (!$8) { + if (!(FUNCTION_TABLE_ii[HEAP32[(HEAP32[$0 + 464 >> 2] | 0) + 8 >> 2] & 127]($0) | 0)) { + $16 = HEAP32[$0 >> 2] | 0; + HEAP32[$16 + 20 >> 2] = 25; + FUNCTION_TABLE_vi[HEAP32[$16 >> 2] & 255]($0); + } + $19 = $0 + 340 | 0; + if ((HEAP32[$19 >> 2] | 0) > 0) { + $22 = $0 + 224 | 0; + $23 = $0 + 412 | 0; + $24 = $0 + 436 | 0; + $25 = $0 + 420 | 0; + $$035$i = 0; + do { + $27 = HEAP32[$0 + 344 + ($$035$i << 2) >> 2] | 0; + if (HEAP32[$22 >> 2] | 0) if (!(HEAP32[$23 >> 2] | 0)) { + if (!(HEAP32[$25 >> 2] | 0)) label = 10; + } else label = 13; else label = 10; + do if ((label | 0) == 10) { + label = 0; + dest = HEAP32[$3 + 60 + (HEAP32[$27 + 20 >> 2] << 2) >> 2] | 0; + stop = dest + 64 | 0; + do { + HEAP8[dest >> 0] = 0; + dest = dest + 1 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$3 + 24 + ($$035$i << 2) >> 2] = 0; + HEAP32[$3 + 40 + ($$035$i << 2) >> 2] = 0; + if (!(HEAP32[$22 >> 2] | 0)) if (!(HEAP32[$24 >> 2] | 0)) break; else { + label = 13; + break; + } else if (!(HEAP32[$23 >> 2] | 0)) break; else { + label = 13; + break; + } + } while (0); + if ((label | 0) == 13) { + label = 0; + _memset(HEAP32[$3 + 124 + (HEAP32[$27 + 24 >> 2] << 2) >> 2] | 0, 0, 256) | 0; + } + $$035$i = $$035$i + 1 | 0; + } while (($$035$i | 0) < (HEAP32[$19 >> 2] | 0)); + } + HEAP32[$3 + 12 >> 2] = 0; + HEAP32[$3 + 16 >> 2] = 0; + HEAP32[$3 + 20 >> 2] = -16; + $54 = HEAP32[$4 >> 2] | 0; + HEAP32[$7 >> 2] = $54; + $56 = $54; + } else $56 = $8; + HEAP32[$7 >> 2] = $56 + -1; + } + $57 = $3 + 20 | 0; + if ((HEAP32[$57 >> 2] | 0) == -1) return 1; + $61 = HEAP32[$0 + 432 >> 2] | 0; + $62 = HEAP32[$1 >> 2] | 0; + $66 = HEAP32[(HEAP32[$0 + 344 >> 2] | 0) + 24 >> 2] | 0; + $68 = HEAP32[$0 + 424 >> 2] | 0; + $69 = 1 << $68; + $70 = -1 << $68; + $71 = $0 + 416 | 0; + $$071 = HEAP32[$71 >> 2] | 0; + while (1) { + if (HEAP16[$62 + (HEAP32[$61 + ($$071 << 2) >> 2] << 1) >> 1] | 0) { + $$172 = $$071; + break; + } + $$071 = $$071 + -1 | 0; + if (!$$071) { + $$172 = 0; + break; + } + } + $83 = $3 + 124 + ($66 << 2) | 0; + $84 = $3 + 188 | 0; + $85 = $69 & 65535; + $86 = $70 & 65535; + $$070 = (HEAP32[$0 + 412 >> 2] | 0) + -1 | 0; + L33 : while (1) { + $89 = (HEAP32[$83 >> 2] | 0) + ($$070 * 3 | 0) | 0; + if (($$070 | 0) >= ($$172 | 0) ? _arith_decode($0, $89) | 0 : 0) { + label = 38; + break; + } + $93 = $$070 + 1 | 0; + $96 = $62 + (HEAP32[$61 + ($93 << 2) >> 2] << 1) | 0; + L38 : do if (!(HEAP16[$96 >> 1] | 0)) { + $$06980 = $89; + $114 = $96; + $117 = $93; + while (1) { + if (_arith_decode($0, $$06980 + 1 | 0) | 0) break; + if (($117 | 0) >= (HEAP32[$71 >> 2] | 0)) { + label = 35; + break L33; + } + $122 = $$06980 + 3 | 0; + $123 = $117 + 1 | 0; + $126 = $62 + (HEAP32[$61 + ($123 << 2) >> 2] << 1) | 0; + if (!(HEAP16[$126 >> 1] | 0)) { + $$06980 = $122; + $114 = $126; + $117 = $123; + } else { + $$069$lcssa = $122; + $$lcssa = $126; + $$lcssa75 = $123; + label = 26; + break L38; + } + } + if (!(_arith_decode($0, $84) | 0)) { + HEAP16[$114 >> 1] = $85; + $131 = $117; + break; + } else { + HEAP16[$114 >> 1] = $86; + $131 = $117; + break; + } + } else { + $$069$lcssa = $89; + $$lcssa = $96; + $$lcssa75 = $93; + label = 26; + } while (0); + do if ((label | 0) == 26) { + label = 0; + if (_arith_decode($0, $$069$lcssa + 2 | 0) | 0) { + $102 = HEAP16[$$lcssa >> 1] | 0; + $103 = $102 << 16 >> 16; + if ($102 << 16 >> 16 < 0) { + HEAP16[$$lcssa >> 1] = $70 + $103; + $131 = $$lcssa75; + break; + } else { + HEAP16[$$lcssa >> 1] = $69 + $103; + $131 = $$lcssa75; + break; + } + } else $131 = $$lcssa75; + } while (0); + if (($131 | 0) < (HEAP32[$71 >> 2] | 0)) $$070 = $131; else { + label = 38; + break; + } + } + if ((label | 0) == 35) { + $118 = HEAP32[$0 >> 2] | 0; + HEAP32[$118 + 20 >> 2] = 117; + FUNCTION_TABLE_vii[HEAP32[$118 + 4 >> 2] & 255]($0, -1); + HEAP32[$57 >> 2] = -1; + return 1; + } else if ((label | 0) == 38) return 1; + return 0; +} + +function _extractVisibleFeaturesHomography_172($xsize, $ysize, $trans1, $surfaceSet, $candidate, $candidate2) { + $xsize = $xsize | 0; + $ysize = $ysize | 0; + $trans1 = $trans1 | 0; + $surfaceSet = $surfaceSet | 0; + $candidate = $candidate | 0; + $candidate2 = $candidate2 | 0; + var $10 = 0.0, $11 = 0.0, $15 = 0, $18 = 0.0, $2 = 0, $21 = 0, $22 = 0.0, $4 = 0, $5 = 0, $7 = 0, $arrayidx56 = 0, $arrayidx61 = 0, $cmp30 = 0, $conv = 0.0, $conv36 = 0.0, $flag112 = 0, $flag132$sink = 0, $i$0 = 0, $j$0 = 0, $j$1 = 0, $k$0 = 0, $k$1 = 0, $l$0 = 0, $l$1 = 0, $l$2 = 0, $l$3 = 0, $l2$0 = 0, $l2$1 = 0, $l2$2 = 0, $l2$3 = 0, $num = 0, $sx = 0, $sy = 0, $trans2 = 0, $vararg_buffer = 0, $w = 0, $wpos = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 80 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(80); + $vararg_buffer = sp + 48 | 0; + $trans2 = sp; + $sx = sp + 76 | 0; + $sy = sp + 72 | 0; + $wpos = sp + 64 | 0; + $w = sp + 56 | 0; + $num = $surfaceSet + 4 | 0; + $conv = +($xsize | 0); + $conv36 = +($ysize | 0); + $arrayidx56 = $wpos + 4 | 0; + $arrayidx61 = $w + 4 | 0; + $flag112 = $candidate2 + 4812 | 0; + $i$0 = 0; + $l$0 = 0; + $l2$0 = 0; + L1 : while (1) { + if (($i$0 | 0) >= (HEAP32[$num >> 2] | 0)) { + label = 28; + break; + } + $j$0 = 0; + while (1) { + if (($j$0 | 0) == 3) break; + $k$0 = 0; + while (1) { + if (($k$0 | 0) == 4) break; + HEAP32[$trans2 + ($j$0 << 4) + ($k$0 << 2) >> 2] = HEAP32[$trans1 + ($i$0 * 48 | 0) + ($j$0 << 4) + ($k$0 << 2) >> 2]; + $k$0 = $k$0 + 1 | 0; + } + $j$0 = $j$0 + 1 | 0; + } + $2 = HEAP32[(HEAP32[$surfaceSet >> 2] | 0) + ($i$0 * 112 | 0) + 4 >> 2] | 0; + $j$1 = 0; + $l$1 = $l$0; + $l2$1 = $l2$0; + while (1) { + if (($j$1 | 0) >= (HEAP32[$2 + 4 >> 2] | 0)) break; + $5 = $2; + $k$1 = 0; + $l$2 = $l$1; + $l2$2 = $l2$1; + while (1) { + $4 = HEAP32[$5 >> 2] | 0; + if (($k$1 | 0) >= (HEAP32[$4 + ($j$1 * 20 | 0) + 4 >> 2] | 0)) break; + $7 = HEAP32[$4 + ($j$1 * 20 | 0) >> 2] | 0; + $cmp30 = (_ar2MarkerCoord2ScreenCoord2(0, $trans2, +HEAPF32[$7 + ($k$1 * 20 | 0) + 8 >> 2], +HEAPF32[$7 + ($k$1 * 20 | 0) + 12 >> 2], $sx, $sy) | 0) < 0; + $10 = +HEAPF32[$sx >> 2]; + do if (!($cmp30 | $10 < 0.0) ? ($11 = +HEAPF32[$sy >> 2], !($11 >= $conv36) & (!($10 >= $conv) & !($11 < 0.0))) : 0) { + $15 = HEAP32[(HEAP32[HEAP32[(HEAP32[$surfaceSet >> 2] | 0) + ($i$0 * 112 | 0) + 4 >> 2] >> 2] | 0) + ($j$1 * 20 | 0) >> 2] | 0; + HEAP32[$wpos >> 2] = HEAP32[$15 + ($k$1 * 20 | 0) + 8 >> 2]; + HEAP32[$arrayidx56 >> 2] = HEAP32[$15 + ($k$1 * 20 | 0) + 12 >> 2]; + _ar2GetResolution(0, $trans2, $wpos, $w) | 0; + $18 = +HEAPF32[$arrayidx61 >> 2]; + $21 = HEAP32[HEAP32[(HEAP32[$surfaceSet >> 2] | 0) + ($i$0 * 112 | 0) + 4 >> 2] >> 2] | 0; + $22 = +HEAPF32[$21 + ($j$1 * 20 | 0) + 12 >> 2]; + if ($18 <= $22 ? $18 >= +HEAPF32[$21 + ($j$1 * 20 | 0) + 16 >> 2] : 0) { + if (($l$2 | 0) == 200) { + label = 18; + break L1; + } + HEAP32[$candidate + ($l$2 * 24 | 0) >> 2] = $i$0; + HEAP32[$candidate + ($l$2 * 24 | 0) + 4 >> 2] = $j$1; + HEAP32[$candidate + ($l$2 * 24 | 0) + 8 >> 2] = $k$1; + HEAP32[$candidate + ($l$2 * 24 | 0) + 16 >> 2] = HEAP32[$sx >> 2]; + HEAP32[$candidate + ($l$2 * 24 | 0) + 20 >> 2] = HEAP32[$sy >> 2]; + HEAP32[$candidate + ($l$2 * 24 | 0) + 12 >> 2] = 0; + $l$3 = $l$2 + 1 | 0; + $l2$3 = $l2$2; + break; + } + if ($18 <= $22 * 2.0 ? $18 >= +HEAPF32[$21 + ($j$1 * 20 | 0) + 16 >> 2] * .5 : 0) if (($l2$2 | 0) == 200) { + HEAP32[$flag112 >> 2] = -1; + $l$3 = $l$2; + $l2$3 = 200; + break; + } else { + HEAP32[$candidate2 + ($l2$2 * 24 | 0) >> 2] = $i$0; + HEAP32[$candidate2 + ($l2$2 * 24 | 0) + 4 >> 2] = $j$1; + HEAP32[$candidate2 + ($l2$2 * 24 | 0) + 8 >> 2] = $k$1; + HEAP32[$candidate2 + ($l2$2 * 24 | 0) + 16 >> 2] = HEAP32[$sx >> 2]; + HEAP32[$candidate2 + ($l2$2 * 24 | 0) + 20 >> 2] = HEAP32[$sy >> 2]; + HEAP32[$candidate2 + ($l2$2 * 24 | 0) + 12 >> 2] = 0; + $l$3 = $l$2; + $l2$3 = $l2$2 + 1 | 0; + break; + } else { + $l$3 = $l$2; + $l2$3 = $l2$2; + } + } else { + $l$3 = $l$2; + $l2$3 = $l2$2; + } while (0); + $5 = HEAP32[(HEAP32[$surfaceSet >> 2] | 0) + ($i$0 * 112 | 0) + 4 >> 2] | 0; + $k$1 = $k$1 + 1 | 0; + $l$2 = $l$3; + $l2$2 = $l2$3; + } + $2 = $5; + $j$1 = $j$1 + 1 | 0; + $l$1 = $l$2; + $l2$1 = $l2$2; + } + $i$0 = $i$0 + 1 | 0; + $l$0 = $l$1; + $l2$0 = $l2$1; + } + if ((label | 0) == 18) { + _arLog(0, 3, 45962, $vararg_buffer); + $flag132$sink = $candidate + 4812 | 0; + } else if ((label | 0) == 28) { + HEAP32[$candidate + ($l$0 * 24 | 0) + 12 >> 2] = -1; + $flag132$sink = $candidate2 + ($l2$0 * 24 | 0) + 12 | 0; + } + HEAP32[$flag132$sink >> 2] = -1; + STACKTOP = sp; + return; +} + +function _jpeg_idct_12x6($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0229240 = 0, $$0231239 = 0, $$0232238 = 0, $$0241 = 0, $$1230236 = 0, $$1237 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $109 = 0, $110 = 0, $111 = 0, $113 = 0, $115 = 0, $117 = 0, $119 = 0, $120 = 0, $121 = 0, $122 = 0, $124 = 0, $126 = 0, $129 = 0, $131 = 0, $135 = 0, $139 = 0, $144 = 0, $145 = 0, $146 = 0, $148 = 0, $15 = 0, $150 = 0, $152 = 0, $22 = 0, $23 = 0, $25 = 0, $32 = 0, $33 = 0, $34 = 0, $40 = 0, $46 = 0, $5 = 0, $52 = 0, $54 = 0, $57 = 0, $60 = 0, $63 = 0, $7 = 0, $83 = 0, $86 = 0, $89 = 0, $92 = 0, $93 = 0, $94 = 0, $96 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 192 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(192); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0229240 = $5; + $$0231239 = HEAP32[$1 + 84 >> 2] | 0; + $$0232238 = $2; + $$0241 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0232238 >> 1] << 13, HEAP32[$$0231239 >> 2] | 0) | 0 | 1024; + $22 = Math_imul((HEAP16[$$0232238 + 64 >> 1] | 0) * 5793 | 0, HEAP32[$$0231239 + 128 >> 2] | 0) | 0; + $23 = $22 + $15 | 0; + $25 = (Math_imul($22, -2) | 0) + $15 >> 11; + $32 = Math_imul((HEAP16[$$0232238 + 32 >> 1] | 0) * 10033 | 0, HEAP32[$$0231239 + 64 >> 2] | 0) | 0; + $33 = $32 + $23 | 0; + $34 = $23 - $32 | 0; + $40 = Math_imul(HEAP32[$$0231239 + 32 >> 2] | 0, HEAP16[$$0232238 + 16 >> 1] | 0) | 0; + $46 = Math_imul(HEAP32[$$0231239 + 96 >> 2] | 0, HEAP16[$$0232238 + 48 >> 1] | 0) | 0; + $52 = Math_imul(HEAP32[$$0231239 + 160 >> 2] | 0, HEAP16[$$0232238 + 80 >> 1] | 0) | 0; + $54 = ($52 + $40 | 0) * 2998 | 0; + $57 = $54 + ($46 + $40 << 13) | 0; + $60 = $54 + ($52 - $46 << 13) | 0; + $63 = $40 - $46 - $52 << 2; + HEAP32[$$0229240 >> 2] = $57 + $33 >> 11; + HEAP32[$$0229240 + 160 >> 2] = $33 - $57 >> 11; + HEAP32[$$0229240 + 32 >> 2] = $63 + $25; + HEAP32[$$0229240 + 128 >> 2] = $25 - $63; + HEAP32[$$0229240 + 64 >> 2] = $60 + $34 >> 11; + HEAP32[$$0229240 + 96 >> 2] = $34 - $60 >> 11; + $$0241 = $$0241 + 1 | 0; + if (($$0241 | 0) == 8) break; else { + $$0229240 = $$0229240 + 4 | 0; + $$0231239 = $$0231239 + 4 | 0; + $$0232238 = $$0232238 + 2 | 0; + } + } + $83 = $7 + -384 | 0; + $$1230236 = $5; + $$1237 = 0; + while (1) { + $86 = (HEAP32[$3 + ($$1237 << 2) >> 2] | 0) + $4 | 0; + $89 = (HEAP32[$$1230236 >> 2] << 13) + 134348800 | 0; + $92 = (HEAP32[$$1230236 + 16 >> 2] | 0) * 10033 | 0; + $93 = $89 + $92 | 0; + $94 = $89 - $92 | 0; + $96 = HEAP32[$$1230236 + 8 >> 2] | 0; + $101 = HEAP32[$$1230236 + 24 >> 2] << 13; + $102 = ($96 << 13) - $101 | 0; + $103 = $102 + $89 | 0; + $104 = $89 - $102 | 0; + $105 = $101 + ($96 * 11190 | 0) | 0; + $106 = $105 + $93 | 0; + $107 = $93 - $105 | 0; + $109 = ($96 * 2998 | 0) - $101 | 0; + $110 = $109 + $94 | 0; + $111 = $94 - $109 | 0; + $113 = HEAP32[$$1230236 + 4 >> 2] | 0; + $115 = HEAP32[$$1230236 + 12 >> 2] | 0; + $117 = HEAP32[$$1230236 + 20 >> 2] | 0; + $119 = HEAP32[$$1230236 + 28 >> 2] | 0; + $120 = $115 * 10703 | 0; + $121 = Math_imul($115, -4433) | 0; + $122 = $117 + $113 | 0; + $124 = ($122 + $119 | 0) * 7053 | 0; + $126 = $124 + ($122 * 2139 | 0) | 0; + $129 = $120 + ($113 * 2295 | 0) + $126 | 0; + $131 = Math_imul($119 + $117 | 0, -8565) | 0; + $135 = (Math_imul($117, -12112) | 0) + $121 + $131 + $126 | 0; + $139 = ($119 * 12998 | 0) - $120 + $124 + $131 | 0; + $144 = $121 + (Math_imul($113, -5540) | 0) + (Math_imul($119, -16244) | 0) + $124 | 0; + $145 = $113 - $119 | 0; + $146 = $115 - $117 | 0; + $148 = ($145 + $146 | 0) * 4433 | 0; + $150 = $148 + ($145 * 6270 | 0) | 0; + $152 = $148 + (Math_imul($146, -15137) | 0) | 0; + HEAP8[$86 >> 0] = HEAP8[$83 + (($129 + $106 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$86 + 11 >> 0] = HEAP8[$83 + (($106 - $129 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$86 + 1 >> 0] = HEAP8[$83 + (($150 + $103 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$86 + 10 >> 0] = HEAP8[$83 + (($103 - $150 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$86 + 2 >> 0] = HEAP8[$83 + (($135 + $110 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$86 + 9 >> 0] = HEAP8[$83 + (($110 - $135 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$86 + 3 >> 0] = HEAP8[$83 + (($139 + $111 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$86 + 8 >> 0] = HEAP8[$83 + (($111 - $139 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$86 + 4 >> 0] = HEAP8[$83 + (($152 + $104 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$86 + 7 >> 0] = HEAP8[$83 + (($104 - $152 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$86 + 5 >> 0] = HEAP8[$83 + (($144 + $107 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$86 + 6 >> 0] = HEAP8[$83 + (($107 - $144 | 0) >>> 18 & 1023) >> 0] | 0; + $$1237 = $$1237 + 1 | 0; + if (($$1237 | 0) == 6) break; else $$1230236 = $$1230236 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function _jpeg_idct_6x12($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0225236 = 0, $$0227235 = 0, $$0228234 = 0, $$0237 = 0, $$1226232 = 0, $$1233 = 0, $100 = 0, $102 = 0, $104 = 0, $106 = 0, $146 = 0, $149 = 0, $15 = 0, $152 = 0, $155 = 0, $156 = 0, $158 = 0, $161 = 0, $162 = 0, $163 = 0, $165 = 0, $167 = 0, $169 = 0, $171 = 0, $174 = 0, $177 = 0, $180 = 0, $22 = 0, $23 = 0, $24 = 0, $30 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $55 = 0, $61 = 0, $67 = 0, $7 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $78 = 0, $80 = 0, $83 = 0, $85 = 0, $89 = 0, $93 = 0, $98 = 0, $99 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 288 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(288); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0225236 = $5; + $$0227235 = HEAP32[$1 + 84 >> 2] | 0; + $$0228234 = $2; + $$0237 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0228234 >> 1] << 13, HEAP32[$$0227235 >> 2] | 0) | 0 | 1024; + $22 = Math_imul((HEAP16[$$0228234 + 64 >> 1] | 0) * 10033 | 0, HEAP32[$$0227235 + 128 >> 2] | 0) | 0; + $23 = $22 + $15 | 0; + $24 = $15 - $22 | 0; + $30 = Math_imul(HEAP32[$$0227235 + 64 >> 2] | 0, HEAP16[$$0228234 + 32 >> 1] | 0) | 0; + $39 = Math_imul(HEAP16[$$0228234 + 96 >> 1] << 13, HEAP32[$$0227235 + 192 >> 2] | 0) | 0; + $40 = ($30 << 13) - $39 | 0; + $41 = $40 + $15 | 0; + $42 = $15 - $40 | 0; + $43 = $39 + ($30 * 11190 | 0) | 0; + $44 = $43 + $23 | 0; + $45 = $23 - $43 | 0; + $47 = ($30 * 2998 | 0) - $39 | 0; + $48 = $47 + $24 | 0; + $49 = $24 - $47 | 0; + $55 = Math_imul(HEAP32[$$0227235 + 32 >> 2] | 0, HEAP16[$$0228234 + 16 >> 1] | 0) | 0; + $61 = Math_imul(HEAP32[$$0227235 + 96 >> 2] | 0, HEAP16[$$0228234 + 48 >> 1] | 0) | 0; + $67 = Math_imul(HEAP32[$$0227235 + 160 >> 2] | 0, HEAP16[$$0228234 + 80 >> 1] | 0) | 0; + $73 = Math_imul(HEAP32[$$0227235 + 224 >> 2] | 0, HEAP16[$$0228234 + 112 >> 1] | 0) | 0; + $74 = $61 * 10703 | 0; + $75 = Math_imul($61, -4433) | 0; + $76 = $67 + $55 | 0; + $78 = ($73 + $76 | 0) * 7053 | 0; + $80 = $78 + ($76 * 2139 | 0) | 0; + $83 = $74 + ($55 * 2295 | 0) + $80 | 0; + $85 = Math_imul($73 + $67 | 0, -8565) | 0; + $89 = (Math_imul($67, -12112) | 0) + $75 + $85 + $80 | 0; + $93 = ($73 * 12998 | 0) - $74 + $78 + $85 | 0; + $98 = $75 + (Math_imul($55, -5540) | 0) + (Math_imul($73, -16244) | 0) + $78 | 0; + $99 = $55 - $73 | 0; + $100 = $61 - $67 | 0; + $102 = ($99 + $100 | 0) * 4433 | 0; + $104 = $102 + ($99 * 6270 | 0) | 0; + $106 = $102 + (Math_imul($100, -15137) | 0) | 0; + HEAP32[$$0225236 >> 2] = $83 + $44 >> 11; + HEAP32[$$0225236 + 264 >> 2] = $44 - $83 >> 11; + HEAP32[$$0225236 + 24 >> 2] = $104 + $41 >> 11; + HEAP32[$$0225236 + 240 >> 2] = $41 - $104 >> 11; + HEAP32[$$0225236 + 48 >> 2] = $89 + $48 >> 11; + HEAP32[$$0225236 + 216 >> 2] = $48 - $89 >> 11; + HEAP32[$$0225236 + 72 >> 2] = $93 + $49 >> 11; + HEAP32[$$0225236 + 192 >> 2] = $49 - $93 >> 11; + HEAP32[$$0225236 + 96 >> 2] = $106 + $42 >> 11; + HEAP32[$$0225236 + 168 >> 2] = $42 - $106 >> 11; + HEAP32[$$0225236 + 120 >> 2] = $98 + $45 >> 11; + HEAP32[$$0225236 + 144 >> 2] = $45 - $98 >> 11; + $$0237 = $$0237 + 1 | 0; + if (($$0237 | 0) == 6) break; else { + $$0225236 = $$0225236 + 4 | 0; + $$0227235 = $$0227235 + 4 | 0; + $$0228234 = $$0228234 + 2 | 0; + } + } + $146 = $7 + -384 | 0; + $$1226232 = $5; + $$1233 = 0; + while (1) { + $149 = (HEAP32[$3 + ($$1233 << 2) >> 2] | 0) + $4 | 0; + $152 = (HEAP32[$$1226232 >> 2] << 13) + 134348800 | 0; + $155 = (HEAP32[$$1226232 + 16 >> 2] | 0) * 5793 | 0; + $156 = $152 + $155 | 0; + $158 = $152 - $155 - $155 | 0; + $161 = (HEAP32[$$1226232 + 8 >> 2] | 0) * 10033 | 0; + $162 = $156 + $161 | 0; + $163 = $156 - $161 | 0; + $165 = HEAP32[$$1226232 + 4 >> 2] | 0; + $167 = HEAP32[$$1226232 + 12 >> 2] | 0; + $169 = HEAP32[$$1226232 + 20 >> 2] | 0; + $171 = ($169 + $165 | 0) * 2998 | 0; + $174 = $171 + ($167 + $165 << 13) | 0; + $177 = $171 + ($169 - $167 << 13) | 0; + $180 = $165 - $167 - $169 << 13; + HEAP8[$149 >> 0] = HEAP8[$146 + (($174 + $162 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$149 + 5 >> 0] = HEAP8[$146 + (($162 - $174 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$149 + 1 >> 0] = HEAP8[$146 + (($180 + $158 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$149 + 4 >> 0] = HEAP8[$146 + (($158 - $180 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$149 + 2 >> 0] = HEAP8[$146 + (($177 + $163 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$149 + 3 >> 0] = HEAP8[$146 + (($163 - $177 | 0) >>> 18 & 1023) >> 0] | 0; + $$1233 = $$1233 + 1 | 0; + if (($$1233 | 0) == 12) break; else $$1226232 = $$1226232 + 24 | 0; + } + STACKTOP = sp; + return; +} + +function _ar2ReadFeatureSet($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$067 = 0, $$068 = 0, $$069 = 0, $$070 = 0, $10 = 0, $12 = 0, $2 = 0, $24 = 0, $27 = 0, $29 = 0, $3 = 0, $30 = 0, $33 = 0, $5 = 0, $7 = 0, $vararg_buffer = 0, $vararg_buffer11 = 0, $vararg_buffer13 = 0, $vararg_buffer15 = 0, $vararg_buffer17 = 0, $vararg_buffer19 = 0, $vararg_buffer2 = 0, $vararg_buffer21 = 0, $vararg_buffer23 = 0, $vararg_buffer25 = 0, $vararg_buffer27 = 0, $vararg_buffer29 = 0, $vararg_buffer5 = 0, $vararg_buffer7 = 0, $vararg_buffer9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 640 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(640); + $vararg_buffer29 = sp + 624 | 0; + $vararg_buffer27 = sp + 616 | 0; + $vararg_buffer25 = sp + 608 | 0; + $vararg_buffer23 = sp + 600 | 0; + $vararg_buffer21 = sp + 592 | 0; + $vararg_buffer19 = sp + 584 | 0; + $vararg_buffer17 = sp + 576 | 0; + $vararg_buffer15 = sp + 568 | 0; + $vararg_buffer13 = sp + 560 | 0; + $vararg_buffer11 = sp + 552 | 0; + $vararg_buffer9 = sp + 544 | 0; + $vararg_buffer7 = sp + 536 | 0; + $vararg_buffer5 = sp + 528 | 0; + $vararg_buffer2 = sp + 520 | 0; + $vararg_buffer = sp + 512 | 0; + $2 = sp; + HEAP32[$vararg_buffer >> 2] = $0; + HEAP32[$vararg_buffer + 4 >> 2] = $1; + _sprintf($2, 26699, $vararg_buffer) | 0; + $3 = _fopen($2, 26308) | 0; + if (!$3) { + HEAP32[$vararg_buffer2 >> 2] = $0; + _arLog(0, 3, 25890, $vararg_buffer2); + $$070 = 0; + } else { + $5 = _malloc(8) | 0; + if (!$5) { + _arLog(0, 3, 45930, $vararg_buffer5); + _exit(1); + } + $7 = $5 + 4 | 0; + L7 : do if ((_fread($7, 4, 1, $3) | 0) == 1) { + $10 = HEAP32[$7 >> 2] | 0; + $12 = _malloc($10 * 20 | 0) | 0; + HEAP32[$5 >> 2] = $12; + if (!$12) { + _arLog(0, 3, 45930, $vararg_buffer9); + _exit(1); + } + $$068 = 0; + L12 : while (1) { + if (($$068 | 0) >= ($10 | 0)) { + $$069 = $5; + break L7; + } + if ((_fread($12 + ($$068 * 20 | 0) + 8 | 0, 4, 1, $3) | 0) != 1) { + label = 12; + break; + } + if ((_fread($12 + ($$068 * 20 | 0) + 12 | 0, 4, 1, $3) | 0) != 1) { + label = 15; + break; + } + if ((_fread($12 + ($$068 * 20 | 0) + 16 | 0, 4, 1, $3) | 0) != 1) { + label = 17; + break; + } + $24 = $12 + ($$068 * 20 | 0) + 4 | 0; + if ((_fread($24, 4, 1, $3) | 0) != 1) { + label = 19; + break; + } + $27 = HEAP32[$24 >> 2] | 0; + $29 = _malloc($27 * 20 | 0) | 0; + $30 = $12 + ($$068 * 20 | 0) | 0; + HEAP32[$30 >> 2] = $29; + if (!$29) { + label = 22; + break; + } + $$067 = 0; + $33 = $27; + while (1) { + if (($$067 | 0) >= ($33 | 0)) break; + if ((_fread((HEAP32[$30 >> 2] | 0) + ($$067 * 20 | 0) | 0, 4, 1, $3) | 0) != 1) { + label = 25; + break L12; + } + if ((_fread((HEAP32[$30 >> 2] | 0) + ($$067 * 20 | 0) + 4 | 0, 4, 1, $3) | 0) != 1) { + label = 27; + break L12; + } + if ((_fread((HEAP32[$30 >> 2] | 0) + ($$067 * 20 | 0) + 8 | 0, 4, 1, $3) | 0) != 1) { + label = 29; + break L12; + } + if ((_fread((HEAP32[$30 >> 2] | 0) + ($$067 * 20 | 0) + 12 | 0, 4, 1, $3) | 0) != 1) { + label = 31; + break L12; + } + if ((_fread((HEAP32[$30 >> 2] | 0) + ($$067 * 20 | 0) + 16 | 0, 4, 1, $3) | 0) != 1) { + label = 34; + break L12; + } + $$067 = $$067 + 1 | 0; + $33 = HEAP32[$24 >> 2] | 0; + } + $$068 = $$068 + 1 | 0; + } + switch (label | 0) { + case 12: + { + _arLog(0, 3, 25911, $vararg_buffer11); + break; + } + case 15: + { + _arLog(0, 3, 25911, $vararg_buffer13); + break; + } + case 17: + { + _arLog(0, 3, 25911, $vararg_buffer15); + break; + } + case 19: + { + _arLog(0, 3, 25911, $vararg_buffer17); + break; + } + case 22: + { + _arLog(0, 3, 45930, $vararg_buffer19); + _exit(1); + break; + } + case 25: + { + _arLog(0, 3, 25911, $vararg_buffer21); + break; + } + case 27: + { + _arLog(0, 3, 25911, $vararg_buffer23); + break; + } + case 29: + { + _arLog(0, 3, 25911, $vararg_buffer25); + break; + } + case 31: + { + _arLog(0, 3, 25911, $vararg_buffer27); + break; + } + case 34: + { + _arLog(0, 3, 25911, $vararg_buffer29); + break; + } + } + $$0 = 0; + while (1) { + if (($$0 | 0) == ($$068 | 0)) break; + _free(HEAP32[$12 + ($$0 * 20 | 0) >> 2] | 0); + $$0 = $$0 + 1 | 0; + } + _free($12); + label = 39; + } else { + _arLog(0, 3, 25911, $vararg_buffer7); + label = 39; + } while (0); + if ((label | 0) == 39) { + _free($5); + $$069 = 0; + } + _fclose($3) | 0; + $$070 = $$069; + } + STACKTOP = sp; + return $$070 | 0; +} + +function _getNFTMarkerInfo($id, $markerIndex) { + $id = $id | 0; + $markerIndex = $markerIndex | 0; + var $12 = 0.0, $14 = 0, $15 = 0, $18 = 0, $3 = 0, $7 = 0, $8 = 0, $call44 = 0, $call7 = 0, $detectedPage = 0, $err = 0, $flag$0 = 0, $flag$1 = 0, $i$0 = 0, $id$addr = 0, $j$0 = 0, $k$0 = 0, $kpmHandle = 0, $kpmResult = 0, $kpmResultNum = 0, $retval$1 = 0, $sub = 0, $surfaceSetCount = 0, $trans = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 80 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(80); + $vararg_buffer1 = sp + 56 | 0; + $vararg_buffer = sp + 48 | 0; + $id$addr = sp + 72 | 0; + $kpmResult = sp + 76 | 0; + $kpmResultNum = sp + 68 | 0; + $trans = sp; + $err = sp + 64 | 0; + HEAP32[$id$addr >> 2] = $id; + do if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$1 = HEAP32[4224] | 0; else { + $call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0; + $surfaceSetCount = $call7 + 244 | 0; + if ((HEAP32[$surfaceSetCount >> 2] | 0) <= ($markerIndex | 0)) { + $retval$1 = HEAP32[4226] | 0; + break; + } + HEAP32[$kpmResult >> 2] = 0; + HEAP32[$kpmResultNum >> 2] = -1; + HEAPF32[$err >> 2] = -1.0; + $detectedPage = $call7 + 240 | 0; + $3 = HEAP32[$detectedPage >> 2] | 0; + do if (($3 | 0) == -2) { + $kpmHandle = $call7 + 232 | 0; + _kpmMatching(HEAP32[$kpmHandle >> 2] | 0, HEAP32[$call7 + 204 >> 2] | 0) | 0; + _kpmGetResult(HEAP32[$kpmHandle >> 2] | 0, $kpmResult, $kpmResultNum) | 0; + $7 = HEAP32[$kpmResultNum >> 2] | 0; + $8 = HEAP32[$kpmResult >> 2] | 0; + $flag$0 = -1; + $i$0 = 0; + while (1) { + if (($i$0 | 0) >= ($7 | 0)) break; + do if ((HEAP32[$8 + ($i$0 * 68 | 0) + 48 >> 2] | 0) == ($markerIndex | 0) ? (HEAP32[$8 + ($i$0 * 68 | 0) + 60 >> 2] | 0) == 0 : 0) { + if (($flag$0 | 0) == -1) $14 = HEAP32[$8 + ($i$0 * 68 | 0) + 52 >> 2] | 0; else { + $12 = +HEAPF32[$8 + ($i$0 * 68 | 0) + 52 >> 2]; + if (!(+HEAPF32[$err >> 2] > $12)) { + $flag$1 = $flag$0; + break; + } + $14 = (HEAPF32[tempDoublePtr >> 2] = $12, HEAP32[tempDoublePtr >> 2] | 0); + } + HEAP32[$err >> 2] = $14; + $flag$1 = $i$0; + } else $flag$1 = $flag$0; while (0); + $flag$0 = $flag$1; + $i$0 = $i$0 + 1 | 0; + } + if (($flag$0 | 0) <= -1) { + HEAP32[$detectedPage >> 2] = -2; + label = 30; + break; + } + $15 = HEAP32[$8 + 48 >> 2] | 0; + HEAP32[$detectedPage >> 2] = $15; + $j$0 = 0; + while (1) { + if (($j$0 | 0) == 3) break; + $k$0 = 0; + while (1) { + if (($k$0 | 0) == 4) break; + HEAP32[$trans + ($j$0 << 4) + ($k$0 << 2) >> 2] = HEAP32[$8 + ($flag$0 * 68 | 0) + ($j$0 << 4) + ($k$0 << 2) >> 2]; + $k$0 = $k$0 + 1 | 0; + } + $j$0 = $j$0 + 1 | 0; + } + _ar2SetInitTrans(HEAP32[$call7 + 248 + ($15 << 2) >> 2] | 0, $trans) | 0; + $18 = HEAP32[$detectedPage >> 2] | 0; + label = 25; + } else { + $18 = $3; + label = 25; + } while (0); + do if ((label | 0) == 25) if (($18 | 0) > -1) { + $call44 = _ar2TrackingMod(HEAP32[$call7 + 236 >> 2] | 0, HEAP32[$call7 + 248 + ($18 << 2) >> 2] | 0, HEAP32[$call7 + 196 >> 2] | 0, $trans, $err) | 0; + if (($call44 | 0) < 0) { + HEAP32[$vararg_buffer >> 2] = $call44; + _arLog(0, 1, 41773, $vararg_buffer); + HEAP32[$detectedPage >> 2] = -2; + label = 30; + break; + } + $sub = (HEAP32[$surfaceSetCount >> 2] | 0) + -1 | 0; + HEAP32[$vararg_buffer1 >> 2] = HEAP32[$call7 + 248 + (HEAP32[$detectedPage >> 2] << 2) >> 2]; + HEAP32[$vararg_buffer1 + 4 >> 2] = $sub; + _arLog(0, 1, 41792, $vararg_buffer1); + if ((HEAP32[$detectedPage >> 2] | 0) > -1) _emscripten_asm_const_iiddddddddddddd(3, $markerIndex | 0, +(+HEAPF32[$err >> 2]), +(+HEAPF32[$trans >> 2]), +(+HEAPF32[$trans + 4 >> 2]), +(+HEAPF32[$trans + 8 >> 2]), +(+HEAPF32[$trans + 12 >> 2]), +(+HEAPF32[$trans + 16 >> 2]), +(+HEAPF32[$trans + 20 >> 2]), +(+HEAPF32[$trans + 24 >> 2]), +(+HEAPF32[$trans + 28 >> 2]), +(+HEAPF32[$trans + 32 >> 2]), +(+HEAPF32[$trans + 36 >> 2]), +(+HEAPF32[$trans + 40 >> 2]), +(+HEAPF32[$trans + 44 >> 2])) | 0; else label = 30; + } else label = 30; while (0); + if ((label | 0) == 30) _emscripten_asm_const_ii(4, $markerIndex | 0) | 0; + $retval$1 = 0; + } while (0); + STACKTOP = sp; + return $retval$1 | 0; +} + +function __ZN6vision21HoughSimilarityVoting19autoAdjustXYNumBinsEPKfS2_i($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$041 = 0, $103 = 0.0, $16 = 0, $21 = 0, $25 = 0, $33 = 0, $38 = 0, $4 = 0, $42 = 0, $5 = 0, $50 = 0, $55 = 0, $59 = 0, $60 = 0.0, $61 = 0, $67 = 0.0, $7 = 0, $76 = 0, $77 = 0, $86 = 0, $89 = 0, $9 = 0, $93 = 0, $95 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp + 12 | 0; + $5 = sp; + $7 = $0 + 4 | 0; + $9 = __ZN6vision4max2IiEET_S1_S1_(HEAP32[$0 >> 2] | 0, HEAP32[$7 >> 2] | 0) | 0; + __ZNSt3__26vectorIfNS_9allocatorIfEEEC2Em($5, $3); + if (($3 | 0) <= 0) { + $16 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 37216) | 0, 37248) | 0, 39072) | 0, 208) | 0, 39079) | 0, 37337) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $16 + (HEAP32[(HEAP32[$16 >> 2] | 0) + -12 >> 2] | 0) | 0); + $21 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $25 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$21 >> 2] | 0) + 28 >> 2] & 127]($21, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($16, $25) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($16) | 0; + _abort(); + } + if ((HEAP32[$0 >> 2] | 0) <= 0) { + $33 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 37359) | 0, 37248) | 0, 39072) | 0, 209) | 0, 39079) | 0, 37401) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $33 + (HEAP32[(HEAP32[$33 >> 2] | 0) + -12 >> 2] | 0) | 0); + $38 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $42 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$38 >> 2] | 0) + 28 >> 2] & 127]($38, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($33, $42) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($33) | 0; + _abort(); + } + if ((HEAP32[$7 >> 2] | 0) <= 0) { + $50 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 37424) | 0, 37248) | 0, 39072) | 0, 210) | 0, 39079) | 0, 37467) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $50 + (HEAP32[(HEAP32[$50 >> 2] | 0) + -12 >> 2] | 0) | 0); + $55 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $59 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$55 >> 2] | 0) + 28 >> 2] & 127]($55, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($50, $59) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($50) | 0; + _abort(); + } + $60 = +($9 | 0); + $$041 = 0; + while (1) { + if (($$041 | 0) == ($3 | 0)) break; + $95 = $$041 << 2; + $103 = +__ZN6vision12SafeDivisionIfEET_S1_S1_(+HEAPF32[$1 + ($95 << 2) + 12 >> 2], +HEAPF32[$2 + ($95 << 2) + 12 >> 2]) * $60; + HEAPF32[(HEAP32[$5 >> 2] | 0) + ($$041 << 2) >> 2] = $103; + $$041 = $$041 + 1 | 0; + } + $61 = HEAP32[$5 >> 2] | 0; + $67 = +__ZN6vision10FastMedianIfEET_PS1_i($61, (HEAP32[$5 + 4 >> 2] | 0) - $61 >> 2) * .25; + $76 = __ZN6vision4max2IiEET_S1_S1_(5, ~~+Math_ceil(+((+HEAPF32[$0 + 24 >> 2] - +HEAPF32[$0 + 20 >> 2]) / $67))) | 0; + $77 = $0 + 52 | 0; + HEAP32[$77 >> 2] = $76; + $86 = __ZN6vision4max2IiEET_S1_S1_(5, ~~+Math_ceil(+((+HEAPF32[$0 + 32 >> 2] - +HEAPF32[$0 + 28 >> 2]) / $67))) | 0; + HEAP32[$0 + 56 >> 2] = $86; + $89 = Math_imul(HEAP32[$77 >> 2] | 0, $86) | 0; + HEAP32[$0 + 84 >> 2] = $89; + $93 = Math_imul(HEAP32[$0 + 60 >> 2] | 0, $89) | 0; + HEAP32[$0 + 88 >> 2] = $93; + __ZNSt3__213__vector_baseIfNS_9allocatorIfEEED2Ev($5); + STACKTOP = sp; + return; +} + +function _jpeg_core_output_dimensions($0) { + $0 = $0 | 0; + var $$0169170 = 0, $$0171 = 0, $$sink173 = 0, $$sink177 = 0, $100 = 0, $11 = 0, $110 = 0, $120 = 0, $130 = 0, $140 = 0, $148 = 0, $150 = 0, $156 = 0, $162 = 0, $167 = 0, $20 = 0, $3 = 0, $30 = 0, $4 = 0, $40 = 0, $5 = 0, $50 = 0, $60 = 0, $7 = 0, $70 = 0, $80 = 0, $90 = 0; + $3 = $0 + 428 | 0; + $4 = HEAP32[$3 >> 2] | 0; + $5 = Math_imul($4, HEAP32[$0 + 48 >> 2] | 0) | 0; + $7 = HEAP32[$0 + 52 >> 2] | 0; + do if ($5 >>> 0 > $7 >>> 0) { + if ($5 >>> 0 <= $7 << 1 >>> 0) { + $20 = _jdiv_round_up(HEAP32[$0 + 28 >> 2] << 1, $4) | 0; + HEAP32[$0 + 112 >> 2] = $20; + $$sink173 = 2; + $$sink177 = HEAP32[$0 + 32 >> 2] << 1; + break; + } + if ($5 >>> 0 <= ($7 * 3 | 0) >>> 0) { + $30 = _jdiv_round_up((HEAP32[$0 + 28 >> 2] | 0) * 3 | 0, $4) | 0; + HEAP32[$0 + 112 >> 2] = $30; + $$sink173 = 3; + $$sink177 = (HEAP32[$0 + 32 >> 2] | 0) * 3 | 0; + break; + } + if ($5 >>> 0 <= $7 << 2 >>> 0) { + $40 = _jdiv_round_up(HEAP32[$0 + 28 >> 2] << 2, $4) | 0; + HEAP32[$0 + 112 >> 2] = $40; + $$sink173 = 4; + $$sink177 = HEAP32[$0 + 32 >> 2] << 2; + break; + } + if ($5 >>> 0 <= ($7 * 5 | 0) >>> 0) { + $50 = _jdiv_round_up((HEAP32[$0 + 28 >> 2] | 0) * 5 | 0, $4) | 0; + HEAP32[$0 + 112 >> 2] = $50; + $$sink173 = 5; + $$sink177 = (HEAP32[$0 + 32 >> 2] | 0) * 5 | 0; + break; + } + if ($5 >>> 0 <= ($7 * 6 | 0) >>> 0) { + $60 = _jdiv_round_up((HEAP32[$0 + 28 >> 2] | 0) * 6 | 0, $4) | 0; + HEAP32[$0 + 112 >> 2] = $60; + $$sink173 = 6; + $$sink177 = (HEAP32[$0 + 32 >> 2] | 0) * 6 | 0; + break; + } + if ($5 >>> 0 <= ($7 * 7 | 0) >>> 0) { + $70 = _jdiv_round_up((HEAP32[$0 + 28 >> 2] | 0) * 7 | 0, $4) | 0; + HEAP32[$0 + 112 >> 2] = $70; + $$sink173 = 7; + $$sink177 = (HEAP32[$0 + 32 >> 2] | 0) * 7 | 0; + break; + } + if ($5 >>> 0 <= $7 << 3 >>> 0) { + $80 = _jdiv_round_up(HEAP32[$0 + 28 >> 2] << 3, $4) | 0; + HEAP32[$0 + 112 >> 2] = $80; + $$sink173 = 8; + $$sink177 = HEAP32[$0 + 32 >> 2] << 3; + break; + } + if ($5 >>> 0 <= ($7 * 9 | 0) >>> 0) { + $90 = _jdiv_round_up((HEAP32[$0 + 28 >> 2] | 0) * 9 | 0, $4) | 0; + HEAP32[$0 + 112 >> 2] = $90; + $$sink173 = 9; + $$sink177 = (HEAP32[$0 + 32 >> 2] | 0) * 9 | 0; + break; + } + if ($5 >>> 0 <= ($7 * 10 | 0) >>> 0) { + $100 = _jdiv_round_up((HEAP32[$0 + 28 >> 2] | 0) * 10 | 0, $4) | 0; + HEAP32[$0 + 112 >> 2] = $100; + $$sink173 = 10; + $$sink177 = (HEAP32[$0 + 32 >> 2] | 0) * 10 | 0; + break; + } + if ($5 >>> 0 <= ($7 * 11 | 0) >>> 0) { + $110 = _jdiv_round_up((HEAP32[$0 + 28 >> 2] | 0) * 11 | 0, $4) | 0; + HEAP32[$0 + 112 >> 2] = $110; + $$sink173 = 11; + $$sink177 = (HEAP32[$0 + 32 >> 2] | 0) * 11 | 0; + break; + } + if ($5 >>> 0 <= ($7 * 12 | 0) >>> 0) { + $120 = _jdiv_round_up((HEAP32[$0 + 28 >> 2] | 0) * 12 | 0, $4) | 0; + HEAP32[$0 + 112 >> 2] = $120; + $$sink173 = 12; + $$sink177 = (HEAP32[$0 + 32 >> 2] | 0) * 12 | 0; + break; + } + if ($5 >>> 0 <= ($7 * 13 | 0) >>> 0) { + $130 = _jdiv_round_up((HEAP32[$0 + 28 >> 2] | 0) * 13 | 0, $4) | 0; + HEAP32[$0 + 112 >> 2] = $130; + $$sink173 = 13; + $$sink177 = (HEAP32[$0 + 32 >> 2] | 0) * 13 | 0; + break; + } + if ($5 >>> 0 <= ($7 * 14 | 0) >>> 0) { + $140 = _jdiv_round_up((HEAP32[$0 + 28 >> 2] | 0) * 14 | 0, $4) | 0; + HEAP32[$0 + 112 >> 2] = $140; + $$sink173 = 14; + $$sink177 = (HEAP32[$0 + 32 >> 2] | 0) * 14 | 0; + break; + } + $148 = HEAP32[$0 + 28 >> 2] | 0; + if ($5 >>> 0 > ($7 * 15 | 0) >>> 0) { + $156 = _jdiv_round_up($148 << 4, $4) | 0; + HEAP32[$0 + 112 >> 2] = $156; + $$sink173 = 16; + $$sink177 = HEAP32[$0 + 32 >> 2] << 4; + break; + } else { + $150 = _jdiv_round_up($148 * 15 | 0, $4) | 0; + HEAP32[$0 + 112 >> 2] = $150; + $$sink173 = 15; + $$sink177 = (HEAP32[$0 + 32 >> 2] | 0) * 15 | 0; + break; + } + } else { + $11 = _jdiv_round_up(HEAP32[$0 + 28 >> 2] | 0, $4) | 0; + HEAP32[$0 + 112 >> 2] = $11; + $$sink173 = 1; + $$sink177 = HEAP32[$0 + 32 >> 2] | 0; + } while (0); + $162 = _jdiv_round_up($$sink177, HEAP32[$3 >> 2] | 0) | 0; + HEAP32[$0 + 116 >> 2] = $162; + HEAP32[$0 + 324 >> 2] = $$sink173; + HEAP32[$0 + 328 >> 2] = $$sink173; + $167 = HEAP32[$0 + 36 >> 2] | 0; + if (($167 | 0) <= 0) return; + $$0169170 = 0; + $$0171 = HEAP32[$0 + 216 >> 2] | 0; + while (1) { + HEAP32[$$0171 + 36 >> 2] = $$sink173; + HEAP32[$$0171 + 40 >> 2] = $$sink173; + $$0169170 = $$0169170 + 1 | 0; + if (($$0169170 | 0) >= ($167 | 0)) break; else $$0171 = $$0171 + 88 | 0; + } + return; +} + +function __ZNK6vision28BinaryHierarchicalClusteringILi96EE5queryERNSt3__214priority_queueINS_17PriorityQueueItemILi96EEENS2_6vectorIS5_NS2_9allocatorIS5_EEEENS2_4lessIS5_EEEEPKNS_4NodeILi96EEEPKh($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0$i$i$add$i$i = 0, $$0$i$i$idx$i$i = 0, $$024 = 0, $$byval_copy3 = 0, $$byval_copy4 = 0, $$byval_copy5 = 0, $10 = 0, $11 = 0, $16 = 0, $19 = 0, $21 = 0, $24 = 0, $28 = 0, $37 = 0, $38 = 0, $4 = 0, $41 = 0, $42 = 0, $43 = 0, $45 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $52 = 0, $55 = 0, $56 = 0, $6 = 0, $60 = 0, $65 = 0, $66 = 0, $7 = 0, $70 = 0, $77 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $$byval_copy5 = sp + 8 | 0; + $$byval_copy4 = sp + 56 | 0; + $$byval_copy3 = sp + 52 | 0; + $4 = sp + 44 | 0; + $5 = sp + 36 | 0; + $6 = sp + 28 | 0; + $7 = sp; + $8 = sp + 48 | 0; + $9 = sp + 40 | 0; + $10 = sp + 32 | 0; + $11 = sp + 16 | 0; + if (__ZNK6vision4NodeILi96EE4leafEv($2) | 0) { + HEAP32[$8 >> 2] = HEAP32[$0 + 76 >> 2]; + $16 = __ZNK6vision4NodeILi96EE12reverseIndexEv($2) | 0; + HEAP32[$9 >> 2] = HEAP32[$16 >> 2]; + $19 = (__ZNK6vision4NodeILi96EE12reverseIndexEv($2) | 0) + 4 | 0; + HEAP32[$10 >> 2] = HEAP32[$19 >> 2]; + HEAP32[$$byval_copy3 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$$byval_copy4 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$$byval_copy5 >> 2] = HEAP32[$10 >> 2]; + __ZNSt3__26vectorIiNS_9allocatorIiEEE6insertINS_11__wrap_iterIPKiEEEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr16is_constructibleIiNS_15iterator_traitsISA_E9referenceEEE5valueENS5_IPiEEE4typeES8_SA_SA_($0 + 72 | 0, $$byval_copy3, $$byval_copy4, $$byval_copy5) | 0; + } else { + HEAP32[$11 >> 2] = 0; + $21 = $11 + 4 | 0; + HEAP32[$21 >> 2] = 0; + HEAP32[$11 + 8 >> 2] = 0; + __ZNK6vision4NodeILi96EE7nearestERNSt3__26vectorIPKS1_NS2_9allocatorIS5_EEEERNS2_14priority_queueINS_17PriorityQueueItemILi96EEENS3_ISC_NS6_ISC_EEEENS2_4lessISC_EEEEPKh($2, $11, $1, $3); + $$024 = 0; + while (1) { + $24 = HEAP32[$11 >> 2] | 0; + if ($$024 >>> 0 >= (HEAP32[$21 >> 2] | 0) - $24 >> 2 >>> 0) break; + __ZNK6vision28BinaryHierarchicalClusteringILi96EE5queryERNSt3__214priority_queueINS_17PriorityQueueItemILi96EEENS2_6vectorIS5_NS2_9allocatorIS5_EEEENS2_4lessIS5_EEEEPKNS_4NodeILi96EEEPKh($0, $1, HEAP32[$24 + ($$024 << 2) >> 2] | 0, $3); + $$024 = $$024 + 1 | 0; + } + $28 = $0 + 100 | 0; + if ((HEAP32[$28 >> 2] | 0) < (HEAP32[$0 + 104 >> 2] | 0) ? ($37 = HEAP32[$1 >> 2] | 0, $38 = $1 + 4 | 0, ($37 | 0) != (HEAP32[$38 >> 2] | 0)) : 0) { + $41 = __ZNK6vision17PriorityQueueItemILi96EE4nodeEv($37) | 0; + $42 = HEAP32[$1 >> 2] | 0; + $43 = HEAP32[$38 >> 2] | 0; + $45 = $43 - $42 | 0; + if (($45 | 0) > 8) { + $48 = $42; + $49 = $43 + -8 | 0; + $50 = $48; + $52 = HEAP32[$50 >> 2] | 0; + $55 = HEAP32[$50 + 4 >> 2] | 0; + $56 = $$byval_copy5; + HEAP32[$56 >> 2] = $52; + HEAP32[$56 + 4 >> 2] = $55; + $60 = $49; + $65 = HEAP32[$60 + 4 >> 2] | 0; + $66 = $48; + HEAP32[$66 >> 2] = HEAP32[$60 >> 2]; + HEAP32[$66 + 4 >> 2] = $65; + $70 = $49; + HEAP32[$70 >> 2] = $52; + HEAP32[$70 + 4 >> 2] = $55; + __ZN6vision17PriorityQueueItemILi96EED2Ev($$byval_copy5); + HEAP32[$4 >> 2] = $42; + HEAP32[$5 >> 2] = $49; + HEAP32[$6 >> 2] = $42; + HEAP32[$$byval_copy3 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy4 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy5 >> 2] = HEAP32[$6 >> 2]; + __ZNSt3__211__sift_downIRNS_4lessIN6vision17PriorityQueueItemILi96EEEEENS_11__wrap_iterIPS4_EEEEvT0_SA_T_NS_15iterator_traitsISA_E15difference_typeESA_($$byval_copy3, $$byval_copy4, $7, ($45 >>> 3) + -1 | 0, $$byval_copy5); + $77 = HEAP32[$38 >> 2] | 0; + } else $77 = $43; + $$0$i$i$idx$i$i = 0; + while (1) { + if (($$0$i$i$idx$i$i | 0) == -1) break; + $$0$i$i$add$i$i = $$0$i$i$idx$i$i + -1 | 0; + __ZN6vision17PriorityQueueItemILi96EED2Ev($77 + ($$0$i$i$add$i$i << 3) | 0); + $$0$i$i$idx$i$i = $$0$i$i$add$i$i; + } + HEAP32[$38 >> 2] = $77 + -8; + HEAP32[$28 >> 2] = (HEAP32[$28 >> 2] | 0) + 1; + __ZNK6vision28BinaryHierarchicalClusteringILi96EE5queryERNSt3__214priority_queueINS_17PriorityQueueItemILi96EEENS2_6vectorIS5_NS2_9allocatorIS5_EEEENS2_4lessIS5_EEEEPKNS_4NodeILi96EEEPKh($0, $1, $41, $3); + } + __ZNSt3__213__vector_baseIPKN6vision4NodeILi96EEENS_9allocatorIS5_EEED2Ev($11); + } + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseSubstitutionEv($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$18 = 0, $$2 = 0, $1 = 0, $26 = 0, $30 = 0, $32 = 0, $36 = 0, $38 = 0, $4 = 0, $41 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + L1 : do if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 83) | 0) { + $4 = (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24; + if (!(_islower($4) | 0)) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) { + $30 = $0 + 148 | 0; + if (__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE5emptyEv($30) | 0) { + $$2 = 0; + break; + } + $32 = __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EEixEm($30, 0) | 0; + $$2 = HEAP32[$32 >> 2] | 0; + break; + } + HEAP32[$1 >> 2] = 0; + if ((!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10parseSeqIdEPm($0, $1) | 0) ? ($36 = (HEAP32[$1 >> 2] | 0) + 1 | 0, HEAP32[$1 >> 2] = $36, __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) : 0) ? ($38 = $0 + 148 | 0, $36 >>> 0 < (__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($38) | 0) >>> 0) : 0) { + $41 = __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EEixEm($38, $36) | 0; + $$18 = HEAP32[$41 >> 2] | 0; + } else $$18 = 0; + $$2 = $$18; + break; + } + switch ($4 | 0) { + case 97: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + HEAP32[$1 >> 2] = 0; + $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_19SpecialSubstitutionEJNS0_14SpecialSubKindEEEEPNS0_4NodeEDpOT0_($0, $1) | 0; + break; + } + case 98: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + HEAP32[$1 >> 2] = 1; + $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_19SpecialSubstitutionEJNS0_14SpecialSubKindEEEEPNS0_4NodeEDpOT0_($0, $1) | 0; + break; + } + case 115: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + HEAP32[$1 >> 2] = 2; + $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_19SpecialSubstitutionEJNS0_14SpecialSubKindEEEEPNS0_4NodeEDpOT0_($0, $1) | 0; + break; + } + case 105: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + HEAP32[$1 >> 2] = 3; + $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_19SpecialSubstitutionEJNS0_14SpecialSubKindEEEEPNS0_4NodeEDpOT0_($0, $1) | 0; + break; + } + case 111: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + HEAP32[$1 >> 2] = 4; + $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_19SpecialSubstitutionEJNS0_14SpecialSubKindEEEEPNS0_4NodeEDpOT0_($0, $1) | 0; + break; + } + case 100: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + HEAP32[$1 >> 2] = 5; + $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_19SpecialSubstitutionEJNS0_14SpecialSubKindEEEEPNS0_4NodeEDpOT0_($0, $1) | 0; + break; + } + default: + { + $$2 = 0; + break L1; + } + } + $26 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E12parseAbiTagsEPNS0_4NodeE(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0, $$0) | 0; + HEAP32[$1 >> 2] = $26; + if (($26 | 0) == ($$0 | 0)) $$1 = $$0; else { + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($0 + 148 | 0, $1); + $$1 = $26; + } + $$2 = $$1; + } else $$2 = 0; while (0); + STACKTOP = sp; + return $$2 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E5parseEv($0) { + $0 = $0 | 0; + var $$0 = 0, $$2 = 0, $$4 = 0, $$byval_copy2 = 0, $1 = 0, $12 = 0, $14 = 0, $17 = 0, $18 = 0, $2 = 0, $21 = 0, $24 = 0, $3 = 0, $35 = 0, $37 = 0, $4 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy2 = sp + 32 | 0; + $1 = sp + 24 | 0; + $2 = sp; + $3 = sp + 16 | 0; + $4 = sp + 8 | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($1, 51394); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$1 + 4 >> 2]; + do if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy2) | 0) { + $7 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseEncodingEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy2 >> 2] = $7; + if (!$7) $$0 = 0; else { + if ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 == 46) { + $12 = $0 + 4 | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKcS2_($2, HEAP32[$0 >> 2] | 0, HEAP32[$12 >> 2] | 0); + $14 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_9DotSuffixEJRPNS0_4NodeENS_10StringViewEEEES9_DpOT0_($0, $$byval_copy2, $2) | 0; + HEAP32[$$byval_copy2 >> 2] = $14; + HEAP32[$0 >> 2] = HEAP32[$12 >> 2]; + $18 = $14; + } else $18 = $7; + $17 = (__ZNK12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E7numLeftEv($0) | 0) == 0; + $$0 = $17 ? $18 : 0; + } + $$4 = $$0; + } else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 51397); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy2) | 0)) { + $35 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + $37 = (__ZNK12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E7numLeftEv($0) | 0) == 0; + $$4 = $37 ? $35 : 0; + break; + } + $21 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseEncodingEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$2 >> 2] = $21; + if ((($21 | 0) != 0 ? (__ZN12_GLOBAL__N_110StringViewC2EPKc($4, 51402), HEAP32[$$byval_copy2 >> 2] = HEAP32[$4 >> 2], HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$4 + 4 >> 2], __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy2) | 0) : 0) ? ($24 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0, __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E11parseNumberEb($$byval_copy2, $0, 0), !($24 & (__ZNK12_GLOBAL__N_110StringView5emptyEv($$byval_copy2) | 0))) : 0) { + if ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 == 46) HEAP32[$0 >> 2] = HEAP32[$0 + 4 >> 2]; + if (!(__ZNK12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E7numLeftEv($0) | 0)) $$2 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA34_KcRPNS0_4NodeEEEESC_DpOT0_($0, 51416, $2) | 0; else $$2 = 0; + } else $$2 = 0; + $$4 = $$2; + } while (0); + STACKTOP = sp; + return $$4 | 0; +} + +function _jpeg_idct_7x7($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0197205 = 0, $$0199204 = 0, $$0200203 = 0, $$0206 = 0, $$1198201 = 0, $$1202 = 0, $110 = 0, $113 = 0, $116 = 0, $118 = 0, $120 = 0, $122 = 0, $124 = 0, $126 = 0, $130 = 0, $131 = 0, $134 = 0, $137 = 0, $140 = 0, $144 = 0, $146 = 0, $148 = 0, $15 = 0, $150 = 0, $152 = 0, $156 = 0, $157 = 0, $159 = 0, $160 = 0, $163 = 0, $21 = 0, $27 = 0, $33 = 0, $35 = 0, $37 = 0, $41 = 0, $42 = 0, $45 = 0, $48 = 0, $5 = 0, $51 = 0, $59 = 0, $65 = 0, $7 = 0, $71 = 0, $73 = 0, $75 = 0, $79 = 0, $80 = 0, $82 = 0, $83 = 0, $86 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 208 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(208); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0197205 = $5; + $$0199204 = HEAP32[$1 + 84 >> 2] | 0; + $$0200203 = $2; + $$0206 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0200203 >> 1] << 13, HEAP32[$$0199204 >> 2] | 0) | 0 | 1024; + $21 = Math_imul(HEAP32[$$0199204 + 64 >> 2] | 0, HEAP16[$$0200203 + 32 >> 1] | 0) | 0; + $27 = Math_imul(HEAP32[$$0199204 + 128 >> 2] | 0, HEAP16[$$0200203 + 64 >> 1] | 0) | 0; + $33 = Math_imul(HEAP32[$$0199204 + 192 >> 2] | 0, HEAP16[$$0200203 + 96 >> 1] | 0) | 0; + $35 = ($27 - $33 | 0) * 7223 | 0; + $37 = ($21 - $27 | 0) * 2578 | 0; + $41 = (Math_imul($27, -15083) | 0) + $15 + $37 + $35 | 0; + $42 = $33 + $21 | 0; + $45 = ($42 * 10438 | 0) + $15 | 0; + $48 = $35 + (Math_imul($33, -637) | 0) + $45 | 0; + $51 = $37 + (Math_imul($21, -20239) | 0) + $45 | 0; + $59 = Math_imul(HEAP32[$$0199204 + 32 >> 2] | 0, HEAP16[$$0200203 + 16 >> 1] | 0) | 0; + $65 = Math_imul(HEAP32[$$0199204 + 96 >> 2] | 0, HEAP16[$$0200203 + 48 >> 1] | 0) | 0; + $71 = Math_imul(HEAP32[$$0199204 + 160 >> 2] | 0, HEAP16[$$0200203 + 80 >> 1] | 0) | 0; + $73 = ($65 + $59 | 0) * 7663 | 0; + $75 = ($59 - $65 | 0) * 1395 | 0; + $79 = Math_imul($71 + $65 | 0, -11295) | 0; + $80 = $73 + $75 + $79 | 0; + $82 = ($71 + $59 | 0) * 5027 | 0; + $83 = $82 + ($73 - $75) | 0; + $86 = $82 + ($71 * 15326 | 0) + $79 | 0; + HEAP32[$$0197205 >> 2] = $83 + $48 >> 11; + HEAP32[$$0197205 + 168 >> 2] = $48 - $83 >> 11; + HEAP32[$$0197205 + 28 >> 2] = $80 + $41 >> 11; + HEAP32[$$0197205 + 140 >> 2] = $41 - $80 >> 11; + HEAP32[$$0197205 + 56 >> 2] = $86 + $51 >> 11; + HEAP32[$$0197205 + 112 >> 2] = $51 - $86 >> 11; + HEAP32[$$0197205 + 84 >> 2] = (($27 - $42 | 0) * 11585 | 0) + $15 >> 11; + $$0206 = $$0206 + 1 | 0; + if (($$0206 | 0) == 7) break; else { + $$0197205 = $$0197205 + 4 | 0; + $$0199204 = $$0199204 + 4 | 0; + $$0200203 = $$0200203 + 2 | 0; + } + } + $110 = $7 + -384 | 0; + $$1198201 = $5; + $$1202 = 0; + while (1) { + $113 = (HEAP32[$3 + ($$1202 << 2) >> 2] | 0) + $4 | 0; + $116 = (HEAP32[$$1198201 >> 2] << 13) + 134348800 | 0; + $118 = HEAP32[$$1198201 + 8 >> 2] | 0; + $120 = HEAP32[$$1198201 + 16 >> 2] | 0; + $122 = HEAP32[$$1198201 + 24 >> 2] | 0; + $124 = ($120 - $122 | 0) * 7223 | 0; + $126 = ($118 - $120 | 0) * 2578 | 0; + $130 = (Math_imul($120, -15083) | 0) + $116 + $126 + $124 | 0; + $131 = $122 + $118 | 0; + $134 = ($131 * 10438 | 0) + $116 | 0; + $137 = $124 + (Math_imul($122, -637) | 0) + $134 | 0; + $140 = $126 + (Math_imul($118, -20239) | 0) + $134 | 0; + $144 = HEAP32[$$1198201 + 4 >> 2] | 0; + $146 = HEAP32[$$1198201 + 12 >> 2] | 0; + $148 = HEAP32[$$1198201 + 20 >> 2] | 0; + $150 = ($146 + $144 | 0) * 7663 | 0; + $152 = ($144 - $146 | 0) * 1395 | 0; + $156 = Math_imul($148 + $146 | 0, -11295) | 0; + $157 = $150 + $152 + $156 | 0; + $159 = ($148 + $144 | 0) * 5027 | 0; + $160 = $150 - $152 + $159 | 0; + $163 = $159 + ($148 * 15326 | 0) + $156 | 0; + HEAP8[$113 >> 0] = HEAP8[$110 + (($160 + $137 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 6 >> 0] = HEAP8[$110 + (($137 - $160 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 1 >> 0] = HEAP8[$110 + (($157 + $130 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 5 >> 0] = HEAP8[$110 + (($130 - $157 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 2 >> 0] = HEAP8[$110 + (($163 + $140 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 4 >> 0] = HEAP8[$110 + (($140 - $163 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$113 + 3 >> 0] = HEAP8[$110 + (((($120 - $131 | 0) * 11585 | 0) + $116 | 0) >>> 18 & 1023) >> 0] | 0; + $$1202 = $$1202 + 1 | 0; + if (($$1202 | 0) == 7) break; else $$1198201 = $$1198201 + 28 | 0; + } + STACKTOP = sp; + return; +} + +function __ZN6vision25DoGScaleInvariantDetector13pruneFeaturesEv($0) { + $0 = $0 | 0; + var $1 = 0, $10 = 0, $12 = 0, $15 = 0, $17 = 0, $2 = 0, $26 = 0, $3 = 0, $31 = 0, $35 = 0, $4 = 0, $42 = 0, $51 = 0, $56 = 0, $60 = 0, $77 = 0, $82 = 0, $86 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp + 12 | 0; + $2 = sp; + $3 = $0 + 60 | 0; + $4 = $0 + 64 | 0; + $9 = $0 + 84 | 0; + $10 = HEAP32[$9 >> 2] | 0; + do if ((((HEAP32[$4 >> 2] | 0) - (HEAP32[$3 >> 2] | 0) | 0) / 36 | 0) >>> 0 > $10 >>> 0) { + $12 = $0 + 16 | 0; + $15 = HEAP32[$12 >> 2] | 0; + $17 = ((HEAP32[$0 + 20 >> 2] | 0) - $15 | 0) / 12 | 0; + if (($17 | 0) != (HEAP32[$0 + 8 >> 2] | 0)) { + $26 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 28011) | 0, 26748) | 0, 39072) | 0, 454) | 0, 39079) | 0, 28066) | 0; + __ZNKSt3__28ios_base6getlocEv($1, $26 + (HEAP32[(HEAP32[$26 >> 2] | 0) + -12 >> 2] | 0) | 0); + $31 = __ZNKSt3__26locale9use_facetERNS0_2idE($1, 66512) | 0; + $35 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$31 >> 2] | 0) + 28 >> 2] & 127]($31, 10) | 0; + __ZNSt3__26localeD2Ev($1); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($26, $35) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($26) | 0; + _abort(); + } + $42 = ((HEAP32[$15 + 4 >> 2] | 0) - (HEAP32[$15 >> 2] | 0) | 0) / 12 | 0; + if (($42 | 0) != (HEAP32[$0 + 12 >> 2] | 0)) { + $51 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 28092) | 0, 26748) | 0, 39072) | 0, 455) | 0, 39079) | 0, 28066) | 0; + __ZNKSt3__28ios_base6getlocEv($1, $51 + (HEAP32[(HEAP32[$51 >> 2] | 0) + -12 >> 2] | 0) | 0); + $56 = __ZNKSt3__26locale9use_facetERNS0_2idE($1, 66512) | 0; + $60 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$56 >> 2] | 0) + 28 >> 2] & 127]($56, 10) | 0; + __ZNSt3__26localeD2Ev($1); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($51, $60) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($51) | 0; + _abort(); + } + HEAP32[$2 >> 2] = 0; + HEAP32[$2 + 4 >> 2] = 0; + HEAP32[$2 + 8 >> 2] = 0; + __ZN6vision16PruneDoGFeaturesERNSt3__26vectorINS1_INS1_INS0_4pairIfmEENS0_9allocatorIS3_EEEENS4_IS6_EEEENS4_IS8_EEEERNS1_INS_25DoGScaleInvariantDetector12FeaturePointENS4_ISD_EEEERKSF_iiiii($12, $2, $3, $17, $42, HEAP32[$0 >> 2] | 0, HEAP32[$0 + 4 >> 2] | 0, $10); + __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE4swapERS6_($3, $2); + if ((((HEAP32[$4 >> 2] | 0) - (HEAP32[$3 >> 2] | 0) | 0) / 36 | 0) >>> 0 > (HEAP32[$9 >> 2] | 0) >>> 0) { + $77 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 28150) | 0, 26748) | 0, 39072) | 0, 469) | 0, 39079) | 0, 28219) | 0; + __ZNKSt3__28ios_base6getlocEv($1, $77 + (HEAP32[(HEAP32[$77 >> 2] | 0) + -12 >> 2] | 0) | 0); + $82 = __ZNKSt3__26locale9use_facetERNS0_2idE($1, 66512) | 0; + $86 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$82 >> 2] | 0) + 28 >> 2] & 127]($82, 10) | 0; + __ZNSt3__26localeD2Ev($1); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($77, $86) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($77) | 0; + _abort(); + } else { + __ZNSt3__213__vector_baseIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEED2Ev($2); + break; + } + } while (0); + STACKTOP = sp; + return; +} + +function _arDetectMarker2($0, $1, $2, $3, $4, $5, $6, $7, $8) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = +$6; + $7 = $7 | 0; + $8 = $8 | 0; + var $$0 = 0, $$0127 = 0, $$0128 = 0, $$0131 = 0, $$0132 = 0, $$0133 = 0, $$0134 = 0, $$1 = 0, $$1$in = 0, $$1129 = 0, $$2 = 0, $$2130 = 0, $$3 = 0, $$ph = 0, $$pre136 = 0, $102 = 0, $105 = 0, $108 = 0, $113 = 0, $116 = 0, $122 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $20 = 0, $21 = 0, $24 = 0, $52 = 0, $57 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $67 = 0, $71 = 0.0, $76 = 0.0, $78 = 0.0, $79 = 0, $80 = 0, $81 = 0, $9 = 0, $91 = 0, $96 = 0, $99 = 0, label = 0; + $9 = ($3 | 0) == 1; + if ($9) { + $$0 = ($0 | 0) / 2 | 0; + $$0132 = ($1 | 0) / 2 | 0; + $$0133 = ($4 | 0) / 4 | 0; + $$0134 = ($5 | 0) / 4 | 0; + } else { + $$0 = $0; + $$0132 = $1; + $$0133 = $4; + $$0134 = $5; + } + HEAP32[$8 >> 2] = 0; + $14 = $2 + 8 | 0; + $15 = $$0 + -2 | 0; + $16 = $$0132 + -2 | 0; + $17 = $2 + 1179664 | 0; + $$0128 = 0; + while (1) { + if (($$0128 | 0) >= (HEAP32[$14 >> 2] | 0)) { + label = 5; + break; + } + $20 = $2 + 12 + ($$0128 << 2) | 0; + $21 = HEAP32[$20 >> 2] | 0; + if (((((((!(($21 | 0) < ($$0134 | 0) | ($21 | 0) > ($$0133 | 0)) ? ($24 = $2 + 131084 + ($$0128 << 4) | 0, (HEAP32[$24 >> 2] | 0) != 1) : 0) ? (HEAP32[$2 + 131084 + ($$0128 << 4) + 4 >> 2] | 0) != ($15 | 0) : 0) ? (HEAP32[$2 + 131084 + ($$0128 << 4) + 8 >> 2] | 0) != 1 : 0) ? (HEAP32[$2 + 131084 + ($$0128 << 4) + 12 >> 2] | 0) != ($16 | 0) : 0) ? (_arGetContour(HEAP32[$2 >> 2] | 0, $$0, 0, $17, $$0128 + 1 | 0, $24, $7 + ((HEAP32[$8 >> 2] | 0) * 80048 | 0) | 0) | 0) >= 0 : 0) ? (_check_square(HEAP32[$20 >> 2] | 0, $7 + ((HEAP32[$8 >> 2] | 0) * 80048 | 0) | 0, $6) | 0) >= 0 : 0) ? (HEAP32[$7 + ((HEAP32[$8 >> 2] | 0) * 80048 | 0) >> 2] = HEAP32[$20 >> 2], $52 = HEAP32[$8 >> 2] | 0, HEAPF64[$7 + ($52 * 80048 | 0) + 8 >> 3] = +HEAPF64[$2 + 655376 + ($$0128 << 4) >> 3], HEAPF64[$7 + ($52 * 80048 | 0) + 16 >> 3] = +HEAPF64[$2 + 655376 + ($$0128 << 4) + 8 >> 3], $57 = $52 + 1 | 0, HEAP32[$8 >> 2] = $57, ($57 | 0) == 60) : 0) { + $$ph = 60; + break; + } + $$0128 = $$0128 + 1 | 0; + } + if ((label | 0) == 5) $$ph = HEAP32[$8 >> 2] | 0; + $$1129 = 0; + $61 = $$ph; + while (1) { + if (($$1129 | 0) >= ($61 | 0)) break; + $62 = $$1129 + 1 | 0; + $63 = $7 + ($$1129 * 80048 | 0) + 8 | 0; + $64 = $7 + ($$1129 * 80048 | 0) + 16 | 0; + $65 = $7 + ($$1129 * 80048 | 0) | 0; + $$0127 = $62; + $67 = $61; + while (1) { + if (($$0127 | 0) >= ($67 | 0)) break; + $71 = +HEAPF64[$63 >> 3] - +HEAPF64[$7 + ($$0127 * 80048 | 0) + 8 >> 3]; + $76 = +HEAPF64[$64 >> 3] - +HEAPF64[$7 + ($$0127 * 80048 | 0) + 16 >> 3]; + $78 = $71 * $71 + $76 * $76; + $79 = HEAP32[$65 >> 2] | 0; + $80 = $7 + ($$0127 * 80048 | 0) | 0; + $81 = HEAP32[$80 >> 2] | 0; + if (($79 | 0) > ($81 | 0)) { + if ($78 < +(($79 | 0) / 4 | 0 | 0)) HEAP32[$80 >> 2] = 0; + } else if ($78 < +(($81 | 0) / 4 | 0 | 0)) HEAP32[$65 >> 2] = 0; + $$0127 = $$0127 + 1 | 0; + $67 = HEAP32[$8 >> 2] | 0; + } + $$1129 = $62; + $61 = $67; + } + $$2130 = 0; + $91 = $61; + while (1) { + if (($$2130 | 0) >= ($91 | 0)) break; + if (!(HEAP32[$7 + ($$2130 * 80048 | 0) >> 2] | 0)) { + $$1$in = $$2130; + $96 = $91; + while (1) { + $$1 = $$1$in + 1 | 0; + if (($$1 | 0) >= ($96 | 0)) break; + _memcpy($7 + ($$1$in * 80048 | 0) | 0, $7 + ($$1 * 80048 | 0) | 0, 80048) | 0; + $$1$in = $$1; + $96 = HEAP32[$8 >> 2] | 0; + } + $99 = $96 + -1 | 0; + HEAP32[$8 >> 2] = $99; + $122 = $99; + } else $122 = $91; + $$2130 = $$2130 + 1 | 0; + $91 = $122; + } + L44 : do if ($9) { + $$0131 = $7; + $$3 = 0; + $102 = $91; + while (1) { + if (($$3 | 0) >= ($102 | 0)) break L44; + HEAP32[$$0131 >> 2] = HEAP32[$$0131 >> 2] << 2; + $105 = $$0131 + 8 | 0; + HEAPF64[$105 >> 3] = +HEAPF64[$105 >> 3] * 2.0; + $108 = $$0131 + 16 | 0; + HEAPF64[$108 >> 3] = +HEAPF64[$108 >> 3] * 2.0; + $$pre136 = HEAP32[$$0131 + 24 >> 2] | 0; + $$2 = 0; + while (1) { + if (($$2 | 0) >= ($$pre136 | 0)) break; + $113 = $$0131 + 28 + ($$2 << 2) | 0; + HEAP32[$113 >> 2] = HEAP32[$113 >> 2] << 1; + $116 = $$0131 + 40028 + ($$2 << 2) | 0; + HEAP32[$116 >> 2] = HEAP32[$116 >> 2] << 1; + $$2 = $$2 + 1 | 0; + } + $$0131 = $$0131 + 80048 | 0; + $$3 = $$3 + 1 | 0; + $102 = HEAP32[$8 >> 2] | 0; + } + } while (0); + return 0; +} + +function __ZNKSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i26 = 0, $$0$i$i28 = 0, $$byval_copy = 0, $$sink46 = 0, $$sink47 = 0, $$sink48 = 0, $$sroa$040$0 = 0, $10 = 0, $102 = 0, $103 = 0, $104 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $30 = 0, $42 = 0, $43 = 0, $44 = 0, $47 = 0, $48 = 0, $54 = 0, $6 = 0, $62 = 0, $7 = 0, $72 = 0, $8 = 0, $80 = 0, $88 = 0, $9 = 0, $91 = 0, $97 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 480 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(480); + $$byval_copy = sp + 464 | 0; + $6 = sp + 460 | 0; + $7 = sp + 468 | 0; + $8 = sp + 456 | 0; + $9 = sp + 452 | 0; + $10 = sp + 440 | 0; + $11 = sp + 428 | 0; + $12 = sp + 416 | 0; + $13 = sp + 412 | 0; + $14 = sp; + $15 = sp + 408 | 0; + $16 = sp + 404 | 0; + $17 = sp + 400 | 0; + __ZNKSt3__28ios_base6getlocEv($6, $3); + $18 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66544) | 0; + $20 = $5 + 8 + 3 | 0; + $21 = HEAP8[$20 >> 0] | 0; + $22 = $21 << 24 >> 24 < 0; + $23 = $5 + 4 | 0; + if (!(($22 ? HEAP32[$23 >> 2] | 0 : $21 & 255) | 0)) $42 = 0; else { + $30 = HEAP32[($22 ? HEAP32[$5 >> 2] | 0 : $5) >> 2] | 0; + $42 = ($30 | 0) == (FUNCTION_TABLE_iii[HEAP32[(HEAP32[$18 >> 2] | 0) + 44 >> 2] & 127]($18, 45) | 0); + }; + HEAP32[$10 >> 2] = 0; + HEAP32[$10 + 4 >> 2] = 0; + HEAP32[$10 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$10 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + HEAP32[$11 >> 2] = 0; + HEAP32[$11 + 4 >> 2] = 0; + HEAP32[$11 + 8 >> 2] = 0; + $$0$i$i26 = 0; + while (1) { + if (($$0$i$i26 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i26 << 2) >> 2] = 0; + $$0$i$i26 = $$0$i$i26 + 1 | 0; + } + HEAP32[$12 >> 2] = 0; + HEAP32[$12 + 4 >> 2] = 0; + HEAP32[$12 + 8 >> 2] = 0; + $$0$i$i28 = 0; + while (1) { + if (($$0$i$i28 | 0) == 3) break; + HEAP32[$12 + ($$0$i$i28 << 2) >> 2] = 0; + $$0$i$i28 = $$0$i$i28 + 1 | 0; + } + __ZNSt3__211__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri($2, $42, $6, $7, $8, $9, $10, $11, $12, $13); + $43 = HEAP8[$20 >> 0] | 0; + $44 = $43 << 24 >> 24 < 0; + $47 = $44 ? HEAP32[$23 >> 2] | 0 : $43 & 255; + $48 = HEAP32[$13 >> 2] | 0; + if (($47 | 0) > ($48 | 0)) { + $54 = HEAP8[$12 + 8 + 3 >> 0] | 0; + $62 = HEAP8[$11 + 8 + 3 >> 0] | 0; + $$sink46 = $62 << 24 >> 24 < 0 ? HEAP32[$11 + 4 >> 2] | 0 : $62 & 255; + $$sink47 = $48 + 1 + ($47 - $48 << 1) | 0; + $$sink48 = $54 << 24 >> 24 < 0 ? HEAP32[$12 + 4 >> 2] | 0 : $54 & 255; + } else { + $72 = HEAP8[$12 + 8 + 3 >> 0] | 0; + $80 = HEAP8[$11 + 8 + 3 >> 0] | 0; + $$sink46 = $80 << 24 >> 24 < 0 ? HEAP32[$11 + 4 >> 2] | 0 : $80 & 255; + $$sink47 = $48 + 2 | 0; + $$sink48 = $72 << 24 >> 24 < 0 ? HEAP32[$12 + 4 >> 2] | 0 : $72 & 255; + } + $88 = $$sink47 + $$sink48 + $$sink46 | 0; + if ($88 >>> 0 > 100) { + $91 = _malloc($88 << 2) | 0; + if (!$91) __ZSt17__throw_bad_allocv(); else { + $$0 = $91; + $$sroa$040$0 = $91; + } + } else { + $$0 = $14; + $$sroa$040$0 = 0; + } + $97 = $44 ? HEAP32[$5 >> 2] | 0 : $5; + __ZNSt3__211__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i($$0, $15, $16, HEAP32[$3 + 4 >> 2] | 0, $97, $97 + ($47 << 2) | 0, $18, $42, $7, HEAP32[$8 >> 2] | 0, HEAP32[$9 >> 2] | 0, $10, $11, $12, $48); + HEAP32[$17 >> 2] = HEAP32[$1 >> 2]; + $102 = HEAP32[$15 >> 2] | 0; + $103 = HEAP32[$16 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$17 >> 2]; + $104 = __ZNSt3__216__pad_and_outputIwNS_11char_traitsIwEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $$0, $102, $103, $3, $4) | 0; + if ($$sroa$040$0 | 0) _free($$sroa$040$0); + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($12); + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($11); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($10); + __ZNSt3__26localeD2Ev($6); + STACKTOP = sp; + return $104 | 0; +} + +function _examine_app0($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$pre$phi107Z2D = 0, $100 = 0, $102 = 0, $106 = 0, $125 = 0, $127 = 0, $133 = 0, $139 = 0, $145 = 0, $155 = 0, $22 = 0, $23 = 0, $25 = 0, $26 = 0, $28 = 0, $29 = 0, $38 = 0, $39 = 0, $4 = 0, $48 = 0, $49 = 0, $50 = 0, $61 = 0, $64 = 0, $66 = 0, $69 = 0, $72 = 0, $75 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $86 = 0, $98 = 0, label = 0; + $4 = $3 + $2 | 0; + if ($2 >>> 0 > 13) { + if ((HEAP8[$1 >> 0] | 0) == 74) if ((((HEAP8[$1 + 1 >> 0] | 0) == 70 ? (HEAP8[$1 + 2 >> 0] | 0) == 73 : 0) ? (HEAP8[$1 + 3 >> 0] | 0) == 70 : 0) ? (HEAP8[$1 + 4 >> 0] | 0) == 0 : 0) { + HEAP32[$0 + 284 >> 2] = 1; + $22 = HEAP8[$1 + 5 >> 0] | 0; + $23 = $0 + 288 | 0; + HEAP8[$23 >> 0] = $22; + $25 = HEAP8[$1 + 6 >> 0] | 0; + $26 = $0 + 289 | 0; + HEAP8[$26 >> 0] = $25; + $28 = HEAP8[$1 + 7 >> 0] | 0; + $29 = $0 + 290 | 0; + HEAP8[$29 >> 0] = $28; + $38 = (HEAPU8[$1 + 8 >> 0] << 8 | HEAPU8[$1 + 9 >> 0]) & 65535; + $39 = $0 + 292 | 0; + HEAP16[$39 >> 1] = $38; + $48 = (HEAPU8[$1 + 10 >> 0] << 8 | HEAPU8[$1 + 11 >> 0]) & 65535; + $49 = $0 + 294 | 0; + HEAP16[$49 >> 1] = $48; + if (($22 + -1 & 255) < 2) { + $$pre$phi107Z2D = $0; + $64 = $22; + $66 = $25; + $69 = $38; + $72 = $48; + $75 = $28; + } else { + $50 = HEAP32[$0 >> 2] | 0; + HEAP32[$50 + 20 >> 2] = 122; + HEAP32[$50 + 24 >> 2] = $22 & 255; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = HEAPU8[$26 >> 0]; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, -1); + $$pre$phi107Z2D = $0; + $64 = HEAP8[$23 >> 0] | 0; + $66 = HEAP8[$26 >> 0] | 0; + $69 = HEAP16[$39 >> 1] | 0; + $72 = HEAP16[$49 >> 1] | 0; + $75 = HEAP8[$29 >> 0] | 0; + } + $61 = HEAP32[$0 >> 2] | 0; + HEAP32[$61 + 24 >> 2] = $64 & 255; + HEAP32[$61 + 28 >> 2] = $66 & 255; + HEAP32[$61 + 32 >> 2] = $69 & 65535; + HEAP32[$61 + 36 >> 2] = $72 & 65535; + HEAP32[$61 + 40 >> 2] = $75 & 255; + HEAP32[$61 + 20 >> 2] = 89; + FUNCTION_TABLE_vii[HEAP32[$61 + 4 >> 2] & 255]($$pre$phi107Z2D, 1); + $80 = $1 + 12 | 0; + $81 = HEAP8[$80 >> 0] | 0; + $82 = $1 + 13 | 0; + $83 = HEAP8[$82 >> 0] | 0; + if (!(($83 | $81) << 24 >> 24)) { + $100 = $81; + $102 = $83; + } else { + $86 = HEAP32[$0 >> 2] | 0; + HEAP32[$86 + 20 >> 2] = 92; + HEAP32[$86 + 24 >> 2] = HEAPU8[$80 >> 0]; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = HEAPU8[$82 >> 0]; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($$pre$phi107Z2D, 1); + $100 = HEAP8[$80 >> 0] | 0; + $102 = HEAP8[$82 >> 0] | 0; + } + $98 = $4 + -14 | 0; + if (($98 | 0) == (Math_imul(($100 & 255) * 3 | 0, $102 & 255) | 0)) return; + $106 = HEAP32[$0 >> 2] | 0; + HEAP32[$106 + 20 >> 2] = 90; + HEAP32[$106 + 24 >> 2] = $98; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($$pre$phi107Z2D, 1); + return; + } else label = 16; + } else if ($2 >>> 0 > 5 ? (HEAP8[$1 >> 0] | 0) == 74 : 0) label = 16; + if (((((label | 0) == 16 ? (HEAP8[$1 + 1 >> 0] | 0) == 70 : 0) ? (HEAP8[$1 + 2 >> 0] | 0) == 88 : 0) ? (HEAP8[$1 + 3 >> 0] | 0) == 88 : 0) ? (HEAP8[$1 + 4 >> 0] | 0) == 0 : 0) { + $125 = $1 + 5 | 0; + switch (HEAP8[$125 >> 0] | 0) { + case 16: + { + $127 = HEAP32[$0 >> 2] | 0; + HEAP32[$127 + 20 >> 2] = 110; + HEAP32[$127 + 24 >> 2] = $4; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 1); + return; + } + case 17: + { + $133 = HEAP32[$0 >> 2] | 0; + HEAP32[$133 + 20 >> 2] = 111; + HEAP32[$133 + 24 >> 2] = $4; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 1); + return; + } + case 19: + { + $139 = HEAP32[$0 >> 2] | 0; + HEAP32[$139 + 20 >> 2] = 112; + HEAP32[$139 + 24 >> 2] = $4; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 1); + return; + } + default: + { + $145 = HEAP32[$0 >> 2] | 0; + HEAP32[$145 + 20 >> 2] = 91; + HEAP32[$145 + 24 >> 2] = HEAPU8[$125 >> 0]; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = $4; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 1); + return; + } + } + } + $155 = HEAP32[$0 >> 2] | 0; + HEAP32[$155 + 20 >> 2] = 79; + HEAP32[$155 + 24 >> 2] = $4; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 1); + return; +} + +function ___get_locale($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$093$lcssa = 0, $$093118 = 0, $$094114 = 0, $$1 = 0, $$1100111 = 0, $$195112 = 0, $$2122 = 0, $$2123 = 0, $$2124 = 0, $$4 = 0, $11 = 0, $15 = 0, $2 = 0, $23 = 0, $3 = 0, $40 = 0, $48 = 0, $54 = 0, $58 = 0, $6 = 0, $62 = 0, $63 = 0, $64 = 0, $68 = 0, $70 = 0, $72 = 0, $76 = 0, $78 = 0, $82 = 0, $87 = 0, $93 = 0, $98 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 272 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(272); + $2 = sp; + $3 = sp + 256 | 0; + do if (!(HEAP8[$1 >> 0] | 0)) { + $6 = _getenv(50801) | 0; + if ($6 | 0 ? HEAP8[$6 >> 0] | 0 : 0) { + $$1 = $6; + break; + } + $11 = _getenv(12464 + ($0 * 12 | 0) | 0) | 0; + if ($11 | 0 ? HEAP8[$11 >> 0] | 0 : 0) { + $$1 = $11; + break; + } + $15 = _getenv(50808) | 0; + if ($15 | 0 ? HEAP8[$15 >> 0] | 0 : 0) { + $$1 = $15; + break; + } + $$1 = 50813; + } else $$1 = $1; while (0); + $$093118 = 0; + L13 : while (1) { + switch (HEAP8[$$1 + $$093118 >> 0] | 0) { + case 47: + case 0: + { + $$093$lcssa = $$093118; + break L13; + break; + } + default: + {} + } + $$093118 = $$093118 + 1 | 0; + if ($$093118 >>> 0 >= 15) { + $$093$lcssa = 15; + break; + } + } + $23 = HEAP8[$$1 >> 0] | 0; + if ($23 << 24 >> 24 != 46 ? (HEAP8[$$1 + $$093$lcssa >> 0] | 0) == 0 : 0) if ($23 << 24 >> 24 == 67) { + $$2122 = $$1; + label = 15; + } else { + $$2123 = $$1; + label = 16; + } else { + $$2122 = 50813; + label = 15; + } + if ((label | 0) == 15) if (!(HEAP8[$$2122 + 1 >> 0] | 0)) { + $$2124 = $$2122; + label = 18; + } else { + $$2123 = $$2122; + label = 16; + } + L22 : do if ((label | 0) == 16) if ((_strcmp($$2123, 50813) | 0) != 0 ? (_strcmp($$2123, 50821) | 0) != 0 : 0) { + $40 = HEAP32[16351] | 0; + if ($40 | 0) { + $$094114 = $40; + do { + if (!(_strcmp($$2123, $$094114 + 8 | 0) | 0)) { + $$0 = $$094114; + break L22; + } + $$094114 = HEAP32[$$094114 + 24 >> 2] | 0; + } while (($$094114 | 0) != 0); + } + ___lock(65408); + $48 = HEAP32[16351] | 0; + L32 : do if ($48 | 0) { + $$195112 = $48; + while (1) { + if (!(_strcmp($$2123, $$195112 + 8 | 0) | 0)) break; + $54 = HEAP32[$$195112 + 24 >> 2] | 0; + if (!$54) break L32; else $$195112 = $54; + } + ___unlock(65408); + $$0 = $$195112; + break L22; + } while (0); + L39 : do if (((HEAP32[16329] | 0) == 0 ? ($58 = _getenv(50827) | 0, ($58 | 0) != 0) : 0) ? (HEAP8[$58 >> 0] | 0) != 0 : 0) { + $62 = 254 - $$093$lcssa | 0; + $63 = $$093$lcssa + 1 | 0; + $$1100111 = $58; + while (1) { + $64 = ___strchrnul($$1100111, 58) | 0; + $68 = HEAP8[$64 >> 0] | 0; + $70 = $64 - $$1100111 + (($68 << 24 >> 24 != 0) << 31 >> 31) | 0; + if ($70 >>> 0 < $62 >>> 0) { + _memcpy($2 | 0, $$1100111 | 0, $70 | 0) | 0; + $72 = $2 + $70 | 0; + HEAP8[$72 >> 0] = 47; + _memcpy($72 + 1 | 0, $$2123 | 0, $$093$lcssa | 0) | 0; + HEAP8[$2 + ($63 + $70) >> 0] = 0; + $76 = ___map_file($2 | 0, $3 | 0) | 0; + if ($76 | 0) break; + $87 = HEAP8[$64 >> 0] | 0; + } else $87 = $68; + $$1100111 = $64 + ($87 << 24 >> 24 != 0 & 1) | 0; + if (!(HEAP8[$$1100111 >> 0] | 0)) { + label = 41; + break L39; + } + } + $78 = _malloc(28) | 0; + if (!$78) { + ___munmap($76, HEAP32[$3 >> 2] | 0) | 0; + label = 41; + break; + } else { + HEAP32[$78 >> 2] = $76; + HEAP32[$78 + 4 >> 2] = HEAP32[$3 >> 2]; + $82 = $78 + 8 | 0; + _memcpy($82 | 0, $$2123 | 0, $$093$lcssa | 0) | 0; + HEAP8[$82 + $$093$lcssa >> 0] = 0; + HEAP32[$78 + 24 >> 2] = HEAP32[16351]; + HEAP32[16351] = $78; + $$4 = $78; + break; + } + } else label = 41; while (0); + if ((label | 0) == 41) { + $93 = _malloc(28) | 0; + if (!$93) $$4 = $93; else { + HEAP32[$93 >> 2] = HEAP32[4258]; + HEAP32[$93 + 4 >> 2] = HEAP32[4259]; + $98 = $93 + 8 | 0; + _memcpy($98 | 0, $$2123 | 0, $$093$lcssa | 0) | 0; + HEAP8[$98 + $$093$lcssa >> 0] = 0; + HEAP32[$93 + 24 >> 2] = HEAP32[16351]; + HEAP32[16351] = $93; + $$4 = $93; + } + } + ___unlock(65408); + $$0 = ($0 | 0) == 0 & ($$4 | 0) == 0 ? 17032 : $$4; + } else { + $$2124 = $$2123; + label = 18; + } while (0); + do if ((label | 0) == 18) { + if (($0 | 0) == 0 ? (HEAP8[$$2124 + 1 >> 0] | 0) == 46 : 0) { + $$0 = 17032; + break; + } + $$0 = 0; + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNSt3__29__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i78 = 0, $$07$i$i = 0, $$07$i$i77 = 0, $$072 = 0, $$073 = 0, $$075 = 0, $$1 = 0, $$174 = 0, $$176 = 0, $$pre$phiZ2D = 0, $103 = 0, $104 = 0, $112 = 0, $13 = 0, $14 = 0, $16 = 0, $25 = 0, $27 = 0, $28 = 0, $33 = 0, $34 = 0, $42 = 0, $47 = 0, $48 = 0, $55 = 0, $56 = 0, $59 = 0, $61 = 0, $67 = 0, $7 = 0, $70 = 0, $72 = 0, $73 = 0, $75 = 0, $77 = 0, $8 = 0, $85 = 0, $89 = 0, $9 = 0, $91 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $7 = sp; + $8 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66544) | 0; + $9 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66552) | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$9 >> 2] | 0) + 20 >> 2] & 255]($7, $9); + $13 = $7 + 11 | 0; + $14 = HEAP8[$13 >> 0] | 0; + $16 = $7 + 4 | 0; + if (($14 << 24 >> 24 < 0 ? HEAP32[$16 >> 2] | 0 : $14 & 255) | 0) { + HEAP32[$5 >> 2] = $3; + $28 = HEAP8[$0 >> 0] | 0; + switch ($28 << 24 >> 24) { + case 43: + case 45: + { + $33 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$8 >> 2] | 0) + 44 >> 2] & 127]($8, $28) | 0; + $34 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $34 + 4; + HEAP32[$34 >> 2] = $33; + $$075 = $0 + 1 | 0; + break; + } + default: + $$075 = $0; + } + L7 : do if (($2 - $$075 | 0) > 1 ? (HEAP8[$$075 >> 0] | 0) == 48 : 0) { + $42 = $$075 + 1 | 0; + switch (HEAP8[$42 >> 0] | 0) { + case 88: + case 120: + break; + default: + { + $$176 = $$075; + break L7; + } + } + $47 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$8 >> 2] | 0) + 44 >> 2] & 127]($8, 48) | 0; + $48 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $48 + 4; + HEAP32[$48 >> 2] = $47; + $55 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$8 >> 2] | 0) + 44 >> 2] & 127]($8, HEAP8[$42 >> 0] | 0) | 0; + $56 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $56 + 4; + HEAP32[$56 >> 2] = $55; + $$176 = $$075 + 2 | 0; + } else $$176 = $$075; while (0); + L12 : do if (($$176 | 0) != ($2 | 0)) { + $$0$i$i = $2; + $$07$i$i = $$176; + while (1) { + $59 = $$0$i$i + -1 | 0; + if ($$07$i$i >>> 0 >= $59 >>> 0) break L12; + $61 = HEAP8[$$07$i$i >> 0] | 0; + HEAP8[$$07$i$i >> 0] = HEAP8[$59 >> 0] | 0; + HEAP8[$59 >> 0] = $61; + $$0$i$i = $59; + $$07$i$i = $$07$i$i + 1 | 0; + } + } while (0); + $67 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$9 >> 2] | 0) + 16 >> 2] & 127]($9) | 0; + $$0 = $$176; + $$072 = 0; + $$073 = 0; + while (1) { + if ($$0 >>> 0 >= $2 >>> 0) break; + $85 = HEAP8[((HEAP8[$13 >> 0] | 0) < 0 ? HEAP32[$7 >> 2] | 0 : $7) + $$072 >> 0] | 0; + if ($85 << 24 >> 24 != 0 & ($$073 | 0) == ($85 << 24 >> 24 | 0)) { + $89 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $89 + 4; + HEAP32[$89 >> 2] = $67; + $91 = HEAP8[$13 >> 0] | 0; + $$1 = $$072 + ($$072 >>> 0 < (($91 << 24 >> 24 < 0 ? HEAP32[$16 >> 2] | 0 : $91 & 255) + -1 | 0) >>> 0 & 1) | 0; + $$174 = 0; + } else { + $$1 = $$072; + $$174 = $$073; + } + $103 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$8 >> 2] | 0) + 44 >> 2] & 127]($8, HEAP8[$$0 >> 0] | 0) | 0; + $104 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $104 + 4; + HEAP32[$104 >> 2] = $103; + $$0 = $$0 + 1 | 0; + $$072 = $$1; + $$073 = $$174 + 1 | 0; + } + $70 = $0; + $72 = $3 + ($$176 - $70 << 2) | 0; + $73 = HEAP32[$5 >> 2] | 0; + if (($72 | 0) == ($73 | 0)) { + $$pre$phiZ2D = $70; + $112 = $72; + } else { + $$0$i$i78 = $73; + $$07$i$i77 = $72; + while (1) { + $75 = $$0$i$i78 + -4 | 0; + if ($$07$i$i77 >>> 0 >= $75 >>> 0) break; + $77 = HEAP32[$$07$i$i77 >> 2] | 0; + HEAP32[$$07$i$i77 >> 2] = HEAP32[$75 >> 2]; + HEAP32[$75 >> 2] = $77; + $$0$i$i78 = $75; + $$07$i$i77 = $$07$i$i77 + 4 | 0; + } + $$pre$phiZ2D = $70; + $112 = HEAP32[$5 >> 2] | 0; + } + } else { + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$8 >> 2] | 0) + 48 >> 2] & 15]($8, $0, $2, $3) | 0; + $25 = $0; + $27 = $3 + ($2 - $25 << 2) | 0; + HEAP32[$5 >> 2] = $27; + $$pre$phiZ2D = $25; + $112 = $27; + } + HEAP32[$4 >> 2] = ($1 | 0) == ($2 | 0) ? $112 : $3 + ($1 - $$pre$phiZ2D << 2) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($7); + STACKTOP = sp; + return; +} + +function __ZNSt3__29__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i76 = 0, $$07$i$i = 0, $$07$i$i75 = 0, $$070 = 0, $$071 = 0, $$073 = 0, $$1 = 0, $$172 = 0, $$174 = 0, $$pre$phiZ2D = 0, $103 = 0, $104 = 0, $112 = 0, $13 = 0, $14 = 0, $16 = 0, $25 = 0, $27 = 0, $28 = 0, $33 = 0, $34 = 0, $42 = 0, $47 = 0, $48 = 0, $55 = 0, $56 = 0, $59 = 0, $61 = 0, $67 = 0, $7 = 0, $70 = 0, $72 = 0, $73 = 0, $75 = 0, $77 = 0, $8 = 0, $85 = 0, $89 = 0, $9 = 0, $91 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $7 = sp; + $8 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $9 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66528) | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$9 >> 2] | 0) + 20 >> 2] & 255]($7, $9); + $13 = $7 + 11 | 0; + $14 = HEAP8[$13 >> 0] | 0; + $16 = $7 + 4 | 0; + if (($14 << 24 >> 24 < 0 ? HEAP32[$16 >> 2] | 0 : $14 & 255) | 0) { + HEAP32[$5 >> 2] = $3; + $28 = HEAP8[$0 >> 0] | 0; + switch ($28 << 24 >> 24) { + case 43: + case 45: + { + $33 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$8 >> 2] | 0) + 28 >> 2] & 127]($8, $28) | 0; + $34 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $34 + 1; + HEAP8[$34 >> 0] = $33; + $$073 = $0 + 1 | 0; + break; + } + default: + $$073 = $0; + } + L7 : do if (($2 - $$073 | 0) > 1 ? (HEAP8[$$073 >> 0] | 0) == 48 : 0) { + $42 = $$073 + 1 | 0; + switch (HEAP8[$42 >> 0] | 0) { + case 88: + case 120: + break; + default: + { + $$174 = $$073; + break L7; + } + } + $47 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$8 >> 2] | 0) + 28 >> 2] & 127]($8, 48) | 0; + $48 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $48 + 1; + HEAP8[$48 >> 0] = $47; + $55 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$8 >> 2] | 0) + 28 >> 2] & 127]($8, HEAP8[$42 >> 0] | 0) | 0; + $56 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $56 + 1; + HEAP8[$56 >> 0] = $55; + $$174 = $$073 + 2 | 0; + } else $$174 = $$073; while (0); + L12 : do if (($$174 | 0) != ($2 | 0)) { + $$0$i$i = $2; + $$07$i$i = $$174; + while (1) { + $59 = $$0$i$i + -1 | 0; + if ($$07$i$i >>> 0 >= $59 >>> 0) break L12; + $61 = HEAP8[$$07$i$i >> 0] | 0; + HEAP8[$$07$i$i >> 0] = HEAP8[$59 >> 0] | 0; + HEAP8[$59 >> 0] = $61; + $$0$i$i = $59; + $$07$i$i = $$07$i$i + 1 | 0; + } + } while (0); + $67 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$9 >> 2] | 0) + 16 >> 2] & 127]($9) | 0; + $$0 = $$174; + $$070 = 0; + $$071 = 0; + while (1) { + if ($$0 >>> 0 >= $2 >>> 0) break; + $85 = HEAP8[((HEAP8[$13 >> 0] | 0) < 0 ? HEAP32[$7 >> 2] | 0 : $7) + $$070 >> 0] | 0; + if ($85 << 24 >> 24 != 0 & ($$071 | 0) == ($85 << 24 >> 24 | 0)) { + $89 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $89 + 1; + HEAP8[$89 >> 0] = $67; + $91 = HEAP8[$13 >> 0] | 0; + $$1 = $$070 + ($$070 >>> 0 < (($91 << 24 >> 24 < 0 ? HEAP32[$16 >> 2] | 0 : $91 & 255) + -1 | 0) >>> 0 & 1) | 0; + $$172 = 0; + } else { + $$1 = $$070; + $$172 = $$071; + } + $103 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$8 >> 2] | 0) + 28 >> 2] & 127]($8, HEAP8[$$0 >> 0] | 0) | 0; + $104 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $104 + 1; + HEAP8[$104 >> 0] = $103; + $$0 = $$0 + 1 | 0; + $$070 = $$1; + $$071 = $$172 + 1 | 0; + } + $70 = $0; + $72 = $3 + ($$174 - $70) | 0; + $73 = HEAP32[$5 >> 2] | 0; + if (($72 | 0) == ($73 | 0)) { + $$pre$phiZ2D = $70; + $112 = $72; + } else { + $$0$i$i76 = $73; + $$07$i$i75 = $72; + while (1) { + $75 = $$0$i$i76 + -1 | 0; + if ($$07$i$i75 >>> 0 >= $75 >>> 0) break; + $77 = HEAP8[$$07$i$i75 >> 0] | 0; + HEAP8[$$07$i$i75 >> 0] = HEAP8[$75 >> 0] | 0; + HEAP8[$75 >> 0] = $77; + $$0$i$i76 = $75; + $$07$i$i75 = $$07$i$i75 + 1 | 0; + } + $$pre$phiZ2D = $70; + $112 = HEAP32[$5 >> 2] | 0; + } + } else { + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$8 >> 2] | 0) + 32 >> 2] & 15]($8, $0, $2, $3) | 0; + $25 = $0; + $27 = $3 + ($2 - $25) | 0; + HEAP32[$5 >> 2] = $27; + $$pre$phiZ2D = $25; + $112 = $27; + } + HEAP32[$4 >> 2] = ($1 | 0) == ($2 | 0) ? $112 : $3 + ($1 - $$pre$phiZ2D) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($7); + STACKTOP = sp; + return; +} + +function __ZNKSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0 = 0, $$0$i = 0, $$0$i$i$i$i = 0, $$0$i$i2$i$i = 0, $$0$lcssa$i = 0, $$025 = 0, $$1 = 0, $$2 = 0, $$byval_copy = 0, $$sroa$0$0$copyload = 0, $$sroa$027$0 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $17 = 0, $20 = 0, $25 = 0, $26 = 0, $27 = 0, $29 = 0, $30 = 0, $33 = 0, $39 = 0, $40 = 0, $42 = 0, $45 = 0, $59 = 0, $62 = 0, $7 = 0, $74 = 0, $77 = 0, $8 = 0, $9 = 0, $91 = 0, $95 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 592 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(592); + $$byval_copy = sp + 512 | 0; + $vararg_buffer = sp + 552 | 0; + $7 = sp + 112 | 0; + $8 = sp + 568 | 0; + $9 = sp + 564 | 0; + $10 = sp + 560 | 0; + $11 = sp + 576 | 0; + $12 = sp + 556 | 0; + $13 = sp; + HEAP32[$8 >> 2] = $7; + HEAP32[$8 + 4 >> 2] = 214; + __ZNKSt3__28ios_base6getlocEv($10, $4); + $17 = __ZNKSt3__26locale9use_facetERNS0_2idE($10, 66544) | 0; + HEAP8[$11 >> 0] = 0; + HEAP32[$12 >> 2] = HEAP32[$2 >> 2]; + $20 = HEAP32[$4 + 4 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$12 >> 2]; + if (__ZNSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_($1, $$byval_copy, $3, $10, $20, $5, $11, $17, $8, $9, $7 + 400 | 0) | 0) { + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$17 >> 2] | 0) + 48 >> 2] & 15]($17, 60349, 60359, $$byval_copy) | 0; + $25 = HEAP32[$9 >> 2] | 0; + $26 = HEAP32[$8 >> 2] | 0; + $27 = $25 - $26 | 0; + $29 = $26; + $30 = $25; + if (($27 | 0) > 392) { + $33 = _malloc(($27 >>> 2) + 2 | 0) | 0; + if (!$33) __ZSt17__throw_bad_allocv(); else { + $$025 = $33; + $$sroa$027$0 = $33; + } + } else { + $$025 = $13; + $$sroa$027$0 = 0; + } + if (!(HEAP8[$11 >> 0] | 0)) $$1 = $$025; else { + HEAP8[$$025 >> 0] = 45; + $$1 = $$025 + 1 | 0; + } + $39 = $$byval_copy + 40 | 0; + $40 = $$byval_copy; + $$0 = $29; + $$2 = $$1; + $42 = $30; + while (1) { + if ($$0 >>> 0 >= $42 >>> 0) break; + $45 = HEAP32[$$0 >> 2] | 0; + $$0$i = $$byval_copy; + while (1) { + if (($$0$i | 0) == ($39 | 0)) { + $$0$lcssa$i = $39; + break; + } + if ((HEAP32[$$0$i >> 2] | 0) == ($45 | 0)) { + $$0$lcssa$i = $$0$i; + break; + } + $$0$i = $$0$i + 4 | 0; + } + HEAP8[$$2 >> 0] = HEAP8[60349 + ($$0$lcssa$i - $40 >> 2) >> 0] | 0; + $$0 = $$0 + 4 | 0; + $$2 = $$2 + 1 | 0; + $42 = HEAP32[$9 >> 2] | 0; + } + HEAP8[$$2 >> 0] = 0; + HEAP32[$vararg_buffer >> 2] = $6; + if ((_sscanf($13, 60250, $vararg_buffer) | 0) != 1) __ZNSt3__221__throw_runtime_errorEPKc(0); + if ($$sroa$027$0 | 0) _free($$sroa$027$0); + } + $59 = HEAP32[$1 >> 2] | 0; + do if ($59) { + $62 = HEAP32[$59 + 12 >> 2] | 0; + if (($62 | 0) == (HEAP32[$59 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$59 >> 2] | 0) + 36 >> 2] & 127]($59) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$62 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $95 = 1; + break; + } else { + $95 = (HEAP32[$1 >> 2] | 0) == 0; + break; + } + } else $95 = 1; while (0); + $74 = HEAP32[$2 >> 2] | 0; + do if ($74) { + $77 = HEAP32[$74 + 12 >> 2] | 0; + if (($77 | 0) == (HEAP32[$74 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$74 >> 2] | 0) + 36 >> 2] & 127]($74) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$77 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($95) break; else { + label = 34; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 32; + break; + } + } else label = 32; while (0); + if ((label | 0) == 32 ? $95 : 0) label = 34; + if ((label | 0) == 34) HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__26localeD2Ev($10); + $91 = HEAP32[$8 >> 2] | 0; + HEAP32[$8 >> 2] = 0; + if ($91 | 0) FUNCTION_TABLE_vi[HEAP32[$8 + 4 >> 2] & 255]($91); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$0$i$i = 0, $$0$i$i26 = 0, $$0$i$i29 = 0, $$byval_copy = 0, $$sink47 = 0, $$sink48 = 0, $$sink49 = 0, $$sroa$041$0 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $29 = 0, $41 = 0, $42 = 0, $43 = 0, $46 = 0, $47 = 0, $52 = 0, $59 = 0, $6 = 0, $68 = 0, $7 = 0, $75 = 0, $8 = 0, $83 = 0, $85 = 0, $9 = 0, $91 = 0, $96 = 0, $97 = 0, $98 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 176 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(176); + $$byval_copy = sp + 156 | 0; + $6 = sp + 152 | 0; + $7 = sp + 164 | 0; + $8 = sp + 161 | 0; + $9 = sp + 160 | 0; + $10 = sp + 140 | 0; + $11 = sp + 128 | 0; + $12 = sp + 116 | 0; + $13 = sp + 112 | 0; + $14 = sp; + $15 = sp + 108 | 0; + $16 = sp + 104 | 0; + $17 = sp + 100 | 0; + __ZNKSt3__28ios_base6getlocEv($6, $3); + $18 = __ZNKSt3__26locale9use_facetERNS0_2idE($6, 66512) | 0; + $19 = $5 + 11 | 0; + $20 = HEAP8[$19 >> 0] | 0; + $21 = $20 << 24 >> 24 < 0; + $22 = $5 + 4 | 0; + if (!(($21 ? HEAP32[$22 >> 2] | 0 : $20 & 255) | 0)) $41 = 0; else { + $29 = HEAP8[($21 ? HEAP32[$5 >> 2] | 0 : $5) >> 0] | 0; + $41 = $29 << 24 >> 24 == (FUNCTION_TABLE_iii[HEAP32[(HEAP32[$18 >> 2] | 0) + 28 >> 2] & 127]($18, 45) | 0) << 24 >> 24; + }; + HEAP32[$10 >> 2] = 0; + HEAP32[$10 + 4 >> 2] = 0; + HEAP32[$10 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$10 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + HEAP32[$11 >> 2] = 0; + HEAP32[$11 + 4 >> 2] = 0; + HEAP32[$11 + 8 >> 2] = 0; + $$0$i$i26 = 0; + while (1) { + if (($$0$i$i26 | 0) == 3) break; + HEAP32[$11 + ($$0$i$i26 << 2) >> 2] = 0; + $$0$i$i26 = $$0$i$i26 + 1 | 0; + } + HEAP32[$12 >> 2] = 0; + HEAP32[$12 + 4 >> 2] = 0; + HEAP32[$12 + 8 >> 2] = 0; + $$0$i$i29 = 0; + while (1) { + if (($$0$i$i29 | 0) == 3) break; + HEAP32[$12 + ($$0$i$i29 << 2) >> 2] = 0; + $$0$i$i29 = $$0$i$i29 + 1 | 0; + } + __ZNSt3__211__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri($2, $41, $6, $7, $8, $9, $10, $11, $12, $13); + $42 = HEAP8[$19 >> 0] | 0; + $43 = $42 << 24 >> 24 < 0; + $46 = $43 ? HEAP32[$22 >> 2] | 0 : $42 & 255; + $47 = HEAP32[$13 >> 2] | 0; + if (($46 | 0) > ($47 | 0)) { + $52 = HEAP8[$12 + 11 >> 0] | 0; + $59 = HEAP8[$11 + 11 >> 0] | 0; + $$sink47 = $59 << 24 >> 24 < 0 ? HEAP32[$11 + 4 >> 2] | 0 : $59 & 255; + $$sink48 = $47 + 1 + ($46 - $47 << 1) | 0; + $$sink49 = $52 << 24 >> 24 < 0 ? HEAP32[$12 + 4 >> 2] | 0 : $52 & 255; + } else { + $68 = HEAP8[$12 + 11 >> 0] | 0; + $75 = HEAP8[$11 + 11 >> 0] | 0; + $$sink47 = $75 << 24 >> 24 < 0 ? HEAP32[$11 + 4 >> 2] | 0 : $75 & 255; + $$sink48 = $47 + 2 | 0; + $$sink49 = $68 << 24 >> 24 < 0 ? HEAP32[$12 + 4 >> 2] | 0 : $68 & 255; + } + $83 = $$sink48 + $$sink49 + $$sink47 | 0; + if ($83 >>> 0 > 100) { + $85 = _malloc($83) | 0; + if (!$85) __ZSt17__throw_bad_allocv(); else { + $$0 = $85; + $$sroa$041$0 = $85; + } + } else { + $$0 = $14; + $$sroa$041$0 = 0; + } + $91 = $43 ? HEAP32[$5 >> 2] | 0 : $5; + __ZNSt3__211__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i($$0, $15, $16, HEAP32[$3 + 4 >> 2] | 0, $91, $91 + $46 | 0, $18, $41, $7, HEAP8[$8 >> 0] | 0, HEAP8[$9 >> 0] | 0, $10, $11, $12, $47); + HEAP32[$17 >> 2] = HEAP32[$1 >> 2]; + $96 = HEAP32[$15 >> 2] | 0; + $97 = HEAP32[$16 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$17 >> 2]; + $98 = __ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $$0, $96, $97, $3, $4) | 0; + if ($$sroa$041$0 | 0) _free($$sroa$041$0); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($12); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($11); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($10); + __ZNSt3__26localeD2Ev($6); + STACKTOP = sp; + return $98 | 0; +} + +function __ZNKSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0 = 0, $$0$i = 0, $$0$i$i$i$i = 0, $$0$i$i2$i$i = 0, $$0$lcssa$i = 0, $$025 = 0, $$1 = 0, $$2 = 0, $$byval_copy = 0, $$sroa$0$0$copyload = 0, $$sroa$028$0 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $17 = 0, $20 = 0, $25 = 0, $26 = 0, $27 = 0, $29 = 0, $30 = 0, $32 = 0, $38 = 0, $39 = 0, $41 = 0, $44 = 0, $57 = 0, $60 = 0, $7 = 0, $72 = 0, $75 = 0, $8 = 0, $89 = 0, $9 = 0, $93 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 256 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(256); + $$byval_copy = sp + 240 | 0; + $vararg_buffer = sp + 216 | 0; + $7 = sp + 112 | 0; + $8 = sp + 232 | 0; + $9 = sp + 228 | 0; + $10 = sp + 224 | 0; + $11 = sp + 250 | 0; + $12 = sp + 220 | 0; + $13 = sp; + HEAP32[$8 >> 2] = $7; + HEAP32[$8 + 4 >> 2] = 214; + __ZNKSt3__28ios_base6getlocEv($10, $4); + $17 = __ZNKSt3__26locale9use_facetERNS0_2idE($10, 66512) | 0; + HEAP8[$11 >> 0] = 0; + HEAP32[$12 >> 2] = HEAP32[$2 >> 2]; + $20 = HEAP32[$4 + 4 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$12 >> 2]; + if (__ZNSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_($1, $$byval_copy, $3, $10, $20, $5, $11, $17, $8, $9, $7 + 100 | 0) | 0) { + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$17 >> 2] | 0) + 32 >> 2] & 15]($17, 60239, 60249, $$byval_copy) | 0; + $25 = HEAP32[$9 >> 2] | 0; + $26 = HEAP32[$8 >> 2] | 0; + $27 = $25 - $26 | 0; + $29 = $26; + $30 = $25; + if (($27 | 0) > 98) { + $32 = _malloc($27 + 2 | 0) | 0; + if (!$32) __ZSt17__throw_bad_allocv(); else { + $$025 = $32; + $$sroa$028$0 = $32; + } + } else { + $$025 = $13; + $$sroa$028$0 = 0; + } + if (!(HEAP8[$11 >> 0] | 0)) $$1 = $$025; else { + HEAP8[$$025 >> 0] = 45; + $$1 = $$025 + 1 | 0; + } + $38 = $$byval_copy + 10 | 0; + $39 = $$byval_copy; + $$0 = $29; + $$2 = $$1; + $41 = $30; + while (1) { + if ($$0 >>> 0 >= $41 >>> 0) break; + $44 = HEAP8[$$0 >> 0] | 0; + $$0$i = $$byval_copy; + while (1) { + if (($$0$i | 0) == ($38 | 0)) { + $$0$lcssa$i = $38; + break; + } + if ((HEAP8[$$0$i >> 0] | 0) == $44 << 24 >> 24) { + $$0$lcssa$i = $$0$i; + break; + } + $$0$i = $$0$i + 1 | 0; + } + HEAP8[$$2 >> 0] = HEAP8[60239 + ($$0$lcssa$i - $39) >> 0] | 0; + $$0 = $$0 + 1 | 0; + $$2 = $$2 + 1 | 0; + $41 = HEAP32[$9 >> 2] | 0; + } + HEAP8[$$2 >> 0] = 0; + HEAP32[$vararg_buffer >> 2] = $6; + if ((_sscanf($13, 60250, $vararg_buffer) | 0) != 1) __ZNSt3__221__throw_runtime_errorEPKc(0); + if ($$sroa$028$0 | 0) _free($$sroa$028$0); + } + $57 = HEAP32[$1 >> 2] | 0; + do if ($57) { + $60 = HEAP32[$57 + 12 >> 2] | 0; + if (($60 | 0) == (HEAP32[$57 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$57 >> 2] | 0) + 36 >> 2] & 127]($57) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$60 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $93 = 1; + break; + } else { + $93 = (HEAP32[$1 >> 2] | 0) == 0; + break; + } + } else $93 = 1; while (0); + $72 = HEAP32[$2 >> 2] | 0; + do if ($72) { + $75 = HEAP32[$72 + 12 >> 2] | 0; + if (($75 | 0) == (HEAP32[$72 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$72 >> 2] | 0) + 36 >> 2] & 127]($72) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$75 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($93) break; else { + label = 34; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 32; + break; + } + } else label = 32; while (0); + if ((label | 0) == 32 ? $93 : 0) label = 34; + if ((label | 0) == 34) HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__26localeD2Ev($10); + $89 = HEAP32[$8 >> 2] | 0; + HEAP32[$8 >> 2] = 0; + if ($89 | 0) FUNCTION_TABLE_vi[HEAP32[$8 + 4 >> 2] & 255]($89); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function _pass2_fs_dither($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0184212 = 0, $$0185211 = 0, $$0186210 = 0, $$0187209 = 0, $$0188208 = 0, $$0189$lcssa = 0, $$0189207 = 0, $$0190$lcssa = 0, $$0190206 = 0, $$0191$lcssa = 0, $$0191205 = 0, $$0192204 = 0, $$0193217 = 0, $$0194 = 0, $$0195 = 0, $$0196 = 0, $$0197 = 0, $$0199 = 0, $$0213 = 0, $$1$lcssa = 0, $$1198202 = 0, $$1200201 = 0, $$1203 = 0, $102 = 0, $106 = 0, $11 = 0, $110 = 0, $13 = 0, $15 = 0, $16 = 0, $18 = 0, $20 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $28 = 0, $30 = 0, $32 = 0, $40 = 0, $41 = 0, $42 = 0, $5 = 0, $7 = 0, $80 = 0, $83 = 0, $86 = 0, $87 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $96 = 0, $97 = 0, $storemerge = 0, $$1203$looptemp = 0; + $5 = HEAP32[$0 + 484 >> 2] | 0; + $7 = HEAP32[$5 + 24 >> 2] | 0; + $9 = HEAP32[$0 + 112 >> 2] | 0; + $11 = HEAP32[$0 + 336 >> 2] | 0; + $13 = HEAP32[$5 + 40 >> 2] | 0; + $15 = HEAP32[$0 + 136 >> 2] | 0; + $16 = HEAP32[$15 >> 2] | 0; + $18 = HEAP32[$15 + 4 >> 2] | 0; + $20 = HEAP32[$15 + 8 >> 2] | 0; + if (($3 | 0) <= 0) return; + $22 = $5 + 36 | 0; + $23 = $5 + 32 | 0; + $24 = ($9 | 0) == 0; + $25 = $9 + -1 | 0; + $26 = $25 * 3 | 0; + $28 = ($9 * 3 | 0) + 3 | 0; + $$0193217 = 0; + do { + $30 = HEAP32[$1 + ($$0193217 << 2) >> 2] | 0; + $32 = HEAP32[$2 + ($$0193217 << 2) >> 2] | 0; + if (!(HEAP32[$22 >> 2] | 0)) { + $$0194 = 3; + $$0195 = 1; + $$0196 = HEAP32[$23 >> 2] | 0; + $$0197 = $32; + $$0199 = $30; + $storemerge = 1; + } else { + $$0194 = -3; + $$0195 = -1; + $$0196 = (HEAP32[$23 >> 2] | 0) + ($28 << 1) | 0; + $$0197 = $32 + $25 | 0; + $$0199 = $30 + $26 | 0; + $storemerge = 0; + } + HEAP32[$22 >> 2] = $storemerge; + if ($24) { + $$0189$lcssa = 0; + $$0190$lcssa = 0; + $$0191$lcssa = 0; + $$1$lcssa = $$0196; + } else { + $40 = $$0194 + 1 | 0; + $41 = $$0194 + 2 | 0; + $42 = Math_imul($9, $$0194) | 0; + $$0184212 = 0; + $$0185211 = 0; + $$0186210 = 0; + $$0187209 = 0; + $$0188208 = 0; + $$0189207 = 0; + $$0190206 = 0; + $$0191205 = 0; + $$0192204 = $9; + $$0213 = 0; + $$1198202 = $$0197; + $$1200201 = $$0199; + $$1203 = $$0196; + while (1) { + $$1203$looptemp = $$1203; + $$1203 = $$1203 + ($$0194 << 1) | 0; + $80 = HEAPU8[$11 + ((HEAP32[$13 + ($$0213 + 8 + (HEAP16[$$1203 >> 1] | 0) >> 4 << 2) >> 2] | 0) + (HEAPU8[$$1200201 >> 0] | 0)) >> 0] | 0; + $83 = HEAPU8[$11 + ((HEAP32[$13 + ($$0184212 + 8 + (HEAP16[$$1203$looptemp + ($40 << 1) >> 1] | 0) >> 4 << 2) >> 2] | 0) + (HEAPU8[$$1200201 + 1 >> 0] | 0)) >> 0] | 0; + $86 = HEAPU8[$11 + ((HEAP32[$13 + ($$0185211 + 8 + (HEAP16[$$1203$looptemp + ($41 << 1) >> 1] | 0) >> 4 << 2) >> 2] | 0) + (HEAPU8[$$1200201 + 2 >> 0] | 0)) >> 0] | 0; + $87 = $80 >>> 3; + $90 = $83 >>> 2; + $91 = $86 >>> 3; + $92 = (HEAP32[$7 + ($87 << 2) >> 2] | 0) + ($90 << 6) + ($91 << 1) | 0; + $93 = HEAP16[$92 >> 1] | 0; + if (!($93 << 16 >> 16)) { + _fill_inverse_cmap($0, $87, $90, $91); + $96 = HEAP16[$92 >> 1] | 0; + } else $96 = $93; + $97 = ($96 & 65535) + -1 | 0; + HEAP8[$$1198202 >> 0] = $97; + $102 = $80 - (HEAPU8[$16 + $97 >> 0] | 0) | 0; + $106 = $83 - (HEAPU8[$18 + $97 >> 0] | 0) | 0; + $110 = $86 - (HEAPU8[$20 + $97 >> 0] | 0) | 0; + HEAP16[$$1203$looptemp >> 1] = ($102 * 3 | 0) + $$0189207; + $$0189207 = ($102 * 5 | 0) + $$0186210 | 0; + HEAP16[$$1203$looptemp + 2 >> 1] = ($106 * 3 | 0) + $$0190206; + $$0190206 = ($106 * 5 | 0) + $$0187209 | 0; + HEAP16[$$1203$looptemp + 4 >> 1] = ($110 * 3 | 0) + $$0191205; + $$0191205 = ($110 * 5 | 0) + $$0188208 | 0; + $$0192204 = $$0192204 + -1 | 0; + if (!$$0192204) break; else { + $$0184212 = $106 * 7 | 0; + $$0185211 = $110 * 7 | 0; + $$0186210 = $102; + $$0187209 = $106; + $$0188208 = $110; + $$0213 = $102 * 7 | 0; + $$1198202 = $$1198202 + $$0195 | 0; + $$1200201 = $$1200201 + $$0194 | 0; + } + } + $$0189$lcssa = $$0189207; + $$0190$lcssa = $$0190206; + $$0191$lcssa = $$0191205; + $$1$lcssa = $$0196 + ($42 << 1) | 0; + } + HEAP16[$$1$lcssa >> 1] = $$0189$lcssa; + HEAP16[$$1$lcssa + 2 >> 1] = $$0190$lcssa; + HEAP16[$$1$lcssa + 4 >> 1] = $$0191$lcssa; + $$0193217 = $$0193217 + 1 | 0; + } while (($$0193217 | 0) != ($3 | 0)); + return; +} + +function _jpeg_idct_5x10($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0196207 = 0, $$0198206 = 0, $$0199205 = 0, $$0208 = 0, $$1197203 = 0, $$1204 = 0, $131 = 0, $134 = 0, $137 = 0, $139 = 0, $141 = 0, $143 = 0, $144 = 0, $146 = 0, $147 = 0, $148 = 0, $15 = 0, $150 = 0, $152 = 0, $154 = 0, $156 = 0, $158 = 0, $160 = 0, $21 = 0, $23 = 0, $25 = 0, $28 = 0, $34 = 0, $40 = 0, $42 = 0, $44 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $56 = 0, $62 = 0, $68 = 0, $7 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $80 = 0, $83 = 0, $86 = 0, $87 = 0, $90 = 0, $93 = 0, $96 = 0, $99 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 208 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(208); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0196207 = $5; + $$0198206 = HEAP32[$1 + 84 >> 2] | 0; + $$0199205 = $2; + $$0208 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0199205 >> 1] << 13, HEAP32[$$0198206 >> 2] | 0) | 0 | 1024; + $21 = Math_imul(HEAP32[$$0198206 + 128 >> 2] | 0, HEAP16[$$0199205 + 64 >> 1] | 0) | 0; + $23 = ($21 * 9373 | 0) + $15 | 0; + $25 = (Math_imul($21, -3580) | 0) + $15 | 0; + $28 = (Math_imul($21, -11586) | 0) + $15 >> 11; + $34 = Math_imul(HEAP32[$$0198206 + 64 >> 2] | 0, HEAP16[$$0199205 + 32 >> 1] | 0) | 0; + $40 = Math_imul(HEAP32[$$0198206 + 192 >> 2] | 0, HEAP16[$$0199205 + 96 >> 1] | 0) | 0; + $42 = ($40 + $34 | 0) * 6810 | 0; + $44 = $42 + ($34 * 4209 | 0) | 0; + $46 = $42 + (Math_imul($40, -17828) | 0) | 0; + $47 = $44 + $23 | 0; + $48 = $23 - $44 | 0; + $49 = $46 + $25 | 0; + $50 = $25 - $46 | 0; + $56 = Math_imul(HEAP32[$$0198206 + 32 >> 2] | 0, HEAP16[$$0199205 + 16 >> 1] | 0) | 0; + $62 = Math_imul(HEAP32[$$0198206 + 96 >> 2] | 0, HEAP16[$$0199205 + 48 >> 1] | 0) | 0; + $68 = Math_imul(HEAP32[$$0198206 + 160 >> 2] | 0, HEAP16[$$0199205 + 80 >> 1] | 0) | 0; + $74 = Math_imul(HEAP32[$$0198206 + 224 >> 2] | 0, HEAP16[$$0199205 + 112 >> 1] | 0) | 0; + $75 = $74 + $62 | 0; + $76 = $62 - $74 | 0; + $77 = $76 * 2531 | 0; + $78 = $68 << 13; + $79 = $75 * 7791 | 0; + $80 = $77 + $78 | 0; + $83 = $79 + ($56 * 11443 | 0) + $80 | 0; + $86 = ($56 * 1812 | 0) - $79 + $80 | 0; + $87 = $75 * 4815 | 0; + $90 = $78 - $77 - ($76 << 12) | 0; + $93 = $56 - $68 - $76 << 2; + $96 = ($56 * 10323 | 0) - $87 - $90 | 0; + $99 = $90 + (($56 * 5260 | 0) - $87) | 0; + HEAP32[$$0196207 >> 2] = $83 + $47 >> 11; + HEAP32[$$0196207 + 180 >> 2] = $47 - $83 >> 11; + HEAP32[$$0196207 + 20 >> 2] = $96 + $49 >> 11; + HEAP32[$$0196207 + 160 >> 2] = $49 - $96 >> 11; + HEAP32[$$0196207 + 40 >> 2] = $93 + $28; + HEAP32[$$0196207 + 140 >> 2] = $28 - $93; + HEAP32[$$0196207 + 60 >> 2] = $99 + $50 >> 11; + HEAP32[$$0196207 + 120 >> 2] = $50 - $99 >> 11; + HEAP32[$$0196207 + 80 >> 2] = $86 + $48 >> 11; + HEAP32[$$0196207 + 100 >> 2] = $48 - $86 >> 11; + $$0208 = $$0208 + 1 | 0; + if (($$0208 | 0) == 5) break; else { + $$0196207 = $$0196207 + 4 | 0; + $$0198206 = $$0198206 + 4 | 0; + $$0199205 = $$0199205 + 2 | 0; + } + } + $131 = $7 + -384 | 0; + $$1197203 = $5; + $$1204 = 0; + while (1) { + $134 = (HEAP32[$3 + ($$1204 << 2) >> 2] | 0) + $4 | 0; + $137 = (HEAP32[$$1197203 >> 2] << 13) + 134348800 | 0; + $139 = HEAP32[$$1197203 + 8 >> 2] | 0; + $141 = HEAP32[$$1197203 + 16 >> 2] | 0; + $143 = ($141 + $139 | 0) * 6476 | 0; + $144 = $139 - $141 | 0; + $146 = ($144 * 2896 | 0) + $137 | 0; + $147 = $146 + $143 | 0; + $148 = $146 - $143 | 0; + $150 = (Math_imul($144, -11584) | 0) + $137 | 0; + $152 = HEAP32[$$1197203 + 4 >> 2] | 0; + $154 = HEAP32[$$1197203 + 12 >> 2] | 0; + $156 = ($154 + $152 | 0) * 6810 | 0; + $158 = $156 + ($152 * 4209 | 0) | 0; + $160 = $156 + (Math_imul($154, -17828) | 0) | 0; + HEAP8[$134 >> 0] = HEAP8[$131 + (($158 + $147 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$134 + 4 >> 0] = HEAP8[$131 + (($147 - $158 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$134 + 1 >> 0] = HEAP8[$131 + (($160 + $148 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$134 + 3 >> 0] = HEAP8[$131 + (($148 - $160 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$134 + 2 >> 0] = HEAP8[$131 + ($150 >>> 18 & 1023) >> 0] | 0; + $$1204 = $$1204 + 1 | 0; + if (($$1204 | 0) == 10) break; else $$1197203 = $$1197203 + 20 | 0; + } + STACKTOP = sp; + return; +} + +function _jpeg_idct_10x5($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0196205 = 0, $$0198204 = 0, $$0199203 = 0, $$0206 = 0, $$1197201 = 0, $$1202 = 0, $100 = 0, $102 = 0, $104 = 0, $107 = 0, $109 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $117 = 0, $120 = 0, $121 = 0, $124 = 0, $127 = 0, $130 = 0, $133 = 0, $15 = 0, $21 = 0, $27 = 0, $29 = 0, $30 = 0, $32 = 0, $33 = 0, $34 = 0, $36 = 0, $42 = 0, $48 = 0, $5 = 0, $50 = 0, $52 = 0, $54 = 0, $7 = 0, $72 = 0, $75 = 0, $78 = 0, $80 = 0, $82 = 0, $84 = 0, $86 = 0, $88 = 0, $90 = 0, $92 = 0, $94 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 160 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(160); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0196205 = $5; + $$0198204 = HEAP32[$1 + 84 >> 2] | 0; + $$0199203 = $2; + $$0206 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0199203 >> 1] << 13, HEAP32[$$0198204 >> 2] | 0) | 0 | 1024; + $21 = Math_imul(HEAP32[$$0198204 + 64 >> 2] | 0, HEAP16[$$0199203 + 32 >> 1] | 0) | 0; + $27 = Math_imul(HEAP32[$$0198204 + 128 >> 2] | 0, HEAP16[$$0199203 + 64 >> 1] | 0) | 0; + $29 = ($27 + $21 | 0) * 6476 | 0; + $30 = $21 - $27 | 0; + $32 = ($30 * 2896 | 0) + $15 | 0; + $33 = $32 + $29 | 0; + $34 = $32 - $29 | 0; + $36 = (Math_imul($30, -11584) | 0) + $15 | 0; + $42 = Math_imul(HEAP32[$$0198204 + 32 >> 2] | 0, HEAP16[$$0199203 + 16 >> 1] | 0) | 0; + $48 = Math_imul(HEAP32[$$0198204 + 96 >> 2] | 0, HEAP16[$$0199203 + 48 >> 1] | 0) | 0; + $50 = ($48 + $42 | 0) * 6810 | 0; + $52 = $50 + ($42 * 4209 | 0) | 0; + $54 = $50 + (Math_imul($48, -17828) | 0) | 0; + HEAP32[$$0196205 >> 2] = $52 + $33 >> 11; + HEAP32[$$0196205 + 128 >> 2] = $33 - $52 >> 11; + HEAP32[$$0196205 + 32 >> 2] = $54 + $34 >> 11; + HEAP32[$$0196205 + 96 >> 2] = $34 - $54 >> 11; + HEAP32[$$0196205 + 64 >> 2] = $36 >> 11; + $$0206 = $$0206 + 1 | 0; + if (($$0206 | 0) == 8) break; else { + $$0196205 = $$0196205 + 4 | 0; + $$0198204 = $$0198204 + 4 | 0; + $$0199203 = $$0199203 + 2 | 0; + } + } + $72 = $7 + -384 | 0; + $$1197201 = $5; + $$1202 = 0; + while (1) { + $75 = (HEAP32[$3 + ($$1202 << 2) >> 2] | 0) + $4 | 0; + $78 = (HEAP32[$$1197201 >> 2] << 13) + 134348800 | 0; + $80 = HEAP32[$$1197201 + 16 >> 2] | 0; + $82 = $78 + ($80 * 9373 | 0) | 0; + $84 = $78 + (Math_imul($80, -3580) | 0) | 0; + $86 = $78 + (Math_imul($80, -11586) | 0) | 0; + $88 = HEAP32[$$1197201 + 8 >> 2] | 0; + $90 = HEAP32[$$1197201 + 24 >> 2] | 0; + $92 = ($90 + $88 | 0) * 6810 | 0; + $94 = $92 + ($88 * 4209 | 0) | 0; + $96 = $92 + (Math_imul($90, -17828) | 0) | 0; + $97 = $94 + $82 | 0; + $98 = $82 - $94 | 0; + $99 = $96 + $84 | 0; + $100 = $84 - $96 | 0; + $102 = HEAP32[$$1197201 + 4 >> 2] | 0; + $104 = HEAP32[$$1197201 + 12 >> 2] | 0; + $107 = HEAP32[$$1197201 + 20 >> 2] << 13; + $109 = HEAP32[$$1197201 + 28 >> 2] | 0; + $110 = $109 + $104 | 0; + $111 = $104 - $109 | 0; + $112 = $111 * 2531 | 0; + $113 = $110 * 7791 | 0; + $114 = $112 + $107 | 0; + $117 = $113 + ($102 * 11443 | 0) + $114 | 0; + $120 = ($102 * 1812 | 0) - $113 + $114 | 0; + $121 = $110 * 4815 | 0; + $124 = $107 - $112 - ($111 << 12) | 0; + $127 = ($102 - $111 << 13) - $107 | 0; + $130 = ($102 * 10323 | 0) - $121 - $124 | 0; + $133 = $124 + (($102 * 5260 | 0) - $121) | 0; + HEAP8[$75 >> 0] = HEAP8[$72 + (($117 + $97 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$75 + 9 >> 0] = HEAP8[$72 + (($97 - $117 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$75 + 1 >> 0] = HEAP8[$72 + (($130 + $99 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$75 + 8 >> 0] = HEAP8[$72 + (($99 - $130 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$75 + 2 >> 0] = HEAP8[$72 + (($127 + $86 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$75 + 7 >> 0] = HEAP8[$72 + (($86 - $127 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$75 + 3 >> 0] = HEAP8[$72 + (($133 + $100 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$75 + 6 >> 0] = HEAP8[$72 + (($100 - $133 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$75 + 4 >> 0] = HEAP8[$72 + (($120 + $98 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$75 + 5 >> 0] = HEAP8[$72 + (($98 - $120 | 0) >>> 18 & 1023) >> 0] | 0; + $$1202 = $$1202 + 1 | 0; + if (($$1202 | 0) == 5) break; else $$1197201 = $$1197201 + 32 | 0; + } + STACKTOP = sp; + return; +} + +function __ZN6vision20BinaryFeatureMatcherILi96EE5matchEPKNS_18BinaryFeatureStoreES4_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$055 = 0, $$056 = 0, $$057 = 0, $$058 = 0, $$061 = 0, $$2 = 0, $$260 = 0, $$263 = 0, $11 = 0, $12 = 0, $18 = 0, $21 = 0, $23 = 0, $27 = 0, $29 = 0, $3 = 0, $33 = 0, $34 = 0, $38 = 0, $41 = 0, $46 = 0, $47 = 0, $5 = 0, $58 = 0, $61 = 0, $66 = 0, $67 = 0, $79 = 0, $84 = 0, $88 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + $5 = $0 + 4 | 0; + HEAP32[$5 >> 2] = HEAP32[$0 >> 2]; + do if ((__ZNK6vision18BinaryFeatureStore4sizeEv($1) | 0) != 0 ? (__ZNK6vision18BinaryFeatureStore4sizeEv($2) | 0) != 0 : 0) { + __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE7reserveEm($0, __ZNK6vision18BinaryFeatureStore4sizeEv($1) | 0); + $11 = $0 + 8 | 0; + $12 = $0 + 12 | 0; + $$055 = 0; + while (1) { + if ($$055 >>> 0 >= (__ZNK6vision18BinaryFeatureStore4sizeEv($1) | 0) >>> 0) break; + $21 = __ZNK6vision18BinaryFeatureStore7featureEm($1, $$055) | 0; + $23 = (__ZNK6vision18BinaryFeatureStore5pointEm($1, $$055) | 0) + 16 | 0; + $$056 = 0; + $$057 = -1; + $$058 = 2147483647; + $$061 = -1; + while (1) { + if ($$056 >>> 0 >= (__ZNK6vision18BinaryFeatureStore4sizeEv($2) | 0) >>> 0) break; + $27 = HEAP8[$23 >> 0] | 0; + $29 = (__ZNK6vision18BinaryFeatureStore5pointEm($2, $$056) | 0) + 16 | 0; + if ($27 << 24 >> 24 == (HEAP8[$29 >> 0] | 0)) { + $33 = __ZN6vision15HammingDistanceILi96EEEjPKhS2_($21, __ZNK6vision18BinaryFeatureStore7featureEm($2, $$056) | 0) | 0; + $34 = $33 >>> 0 < $$057 >>> 0; + $$2 = $34 ? $33 : $$057; + $$260 = $34 ? $$056 : $$058; + $$263 = $34 ? $$057 : $33 >>> 0 < $$061 >>> 0 ? $33 : $$061; + } else { + $$2 = $$057; + $$260 = $$058; + $$263 = $$061; + } + $$056 = $$056 + 1 | 0; + $$057 = $$2; + $$058 = $$260; + $$061 = $$263; + } + do if (($$057 | 0) != -1) { + if (($$061 | 0) == -1) { + __ZN6vision7match_tC2Eii($3, $$055, $$058); + $38 = HEAP32[$5 >> 2] | 0; + if ($38 >>> 0 < (HEAP32[$11 >> 2] | 0) >>> 0) { + $41 = $3; + $46 = HEAP32[$41 + 4 >> 2] | 0; + $47 = $38; + HEAP32[$47 >> 2] = HEAP32[$41 >> 2]; + HEAP32[$47 + 4 >> 2] = $46; + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + 8; + } else __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_($0, $3); + break; + } + if (+($$057 >>> 0) / +($$061 >>> 0) < +HEAPF32[$12 >> 2]) { + __ZN6vision7match_tC2Eii($3, $$055, $$058); + $58 = HEAP32[$5 >> 2] | 0; + if ($58 >>> 0 < (HEAP32[$11 >> 2] | 0) >>> 0) { + $61 = $3; + $66 = HEAP32[$61 + 4 >> 2] | 0; + $67 = $58; + HEAP32[$67 >> 2] = HEAP32[$61 >> 2]; + HEAP32[$67 + 4 >> 2] = $66; + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + 8; + } else __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_($0, $3); + } + } while (0); + $$055 = $$055 + 1 | 0; + } + $18 = (HEAP32[$5 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 3; + if ($18 >>> 0 > (__ZNK6vision18BinaryFeatureStore4sizeEv($1) | 0) >>> 0) { + $79 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 35438) | 0, 35229) | 0, 39072) | 0, 112) | 0, 39079) | 0, 35498) | 0; + __ZNKSt3__28ios_base6getlocEv($3, $79 + (HEAP32[(HEAP32[$79 >> 2] | 0) + -12 >> 2] | 0) | 0); + $84 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66512) | 0; + $88 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$84 >> 2] | 0) + 28 >> 2] & 127]($84, 10) | 0; + __ZNSt3__26localeD2Ev($3); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($79, $88) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($79) | 0; + _abort(); + } else { + $$0 = (HEAP32[$5 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 3; + break; + } + } else $$0 = 0; while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNK10__cxxabiv121__vmi_class_type_info16search_below_dstEPNS_19__dynamic_cast_infoEPKvib($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$081 = 0, $$084 = 0, $$085$off0 = 0, $$1 = 0, $$182 = 0, $$186$off0 = 0, $$2 = 0, $$28392 = 0, $$28393 = 0, $13 = 0, $19 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $30 = 0, $47 = 0, $49 = 0, $61 = 0, $62 = 0, $63 = 0, $66 = 0, $69 = 0, $72 = 0, $79 = 0, $80 = 0, $89 = 0, label = 0; + L1 : do if (!(__ZL8is_equalPKSt9type_infoS1_b($0, HEAP32[$1 + 8 >> 2] | 0, $4) | 0)) { + if (!(__ZL8is_equalPKSt9type_infoS1_b($0, HEAP32[$1 >> 2] | 0, $4) | 0)) { + $61 = HEAP32[$0 + 12 >> 2] | 0; + $62 = $0 + 16 + ($61 << 3) | 0; + __ZNK10__cxxabiv122__base_class_type_info16search_below_dstEPNS_19__dynamic_cast_infoEPKvib($0 + 16 | 0, $1, $2, $3, $4); + $63 = $0 + 24 | 0; + if (($61 | 0) <= 1) break; + $66 = HEAP32[$0 + 8 >> 2] | 0; + if (($66 & 2 | 0) == 0 ? ($69 = $1 + 36 | 0, (HEAP32[$69 >> 2] | 0) != 1) : 0) { + if (!($66 & 1)) { + $89 = $1 + 54 | 0; + $$2 = $63; + while (1) { + if (HEAP8[$89 >> 0] | 0) break L1; + if ((HEAP32[$69 >> 2] | 0) == 1) break L1; + __ZNK10__cxxabiv122__base_class_type_info16search_below_dstEPNS_19__dynamic_cast_infoEPKvib($$2, $1, $2, $3, $4); + $$2 = $$2 + 8 | 0; + if ($$2 >>> 0 >= $62 >>> 0) break L1; + } + } + $79 = $1 + 24 | 0; + $80 = $1 + 54 | 0; + $$1 = $63; + while (1) { + if (HEAP8[$80 >> 0] | 0) break L1; + if ((HEAP32[$69 >> 2] | 0) == 1 ? (HEAP32[$79 >> 2] | 0) == 1 : 0) break L1; + __ZNK10__cxxabiv122__base_class_type_info16search_below_dstEPNS_19__dynamic_cast_infoEPKvib($$1, $1, $2, $3, $4); + $$1 = $$1 + 8 | 0; + if ($$1 >>> 0 >= $62 >>> 0) break L1; + } + } + $72 = $1 + 54 | 0; + $$0 = $63; + while (1) { + if (HEAP8[$72 >> 0] | 0) break L1; + __ZNK10__cxxabiv122__base_class_type_info16search_below_dstEPNS_19__dynamic_cast_infoEPKvib($$0, $1, $2, $3, $4); + $$0 = $$0 + 8 | 0; + if ($$0 >>> 0 >= $62 >>> 0) break L1; + } + } + if ((HEAP32[$1 + 16 >> 2] | 0) != ($2 | 0) ? ($13 = $1 + 20 | 0, (HEAP32[$13 >> 2] | 0) != ($2 | 0)) : 0) { + HEAP32[$1 + 32 >> 2] = $3; + $19 = $1 + 44 | 0; + if ((HEAP32[$19 >> 2] | 0) != 4) { + $25 = $0 + 16 + (HEAP32[$0 + 12 >> 2] << 3) | 0; + $26 = $1 + 52 | 0; + $27 = $1 + 53 | 0; + $28 = $1 + 54 | 0; + $29 = $0 + 8 | 0; + $30 = $1 + 24 | 0; + $$081 = 0; + $$084 = $0 + 16 | 0; + $$085$off0 = 0; + L33 : while (1) { + if ($$084 >>> 0 >= $25 >>> 0) { + label = 18; + break; + } + HEAP8[$26 >> 0] = 0; + HEAP8[$27 >> 0] = 0; + __ZNK10__cxxabiv122__base_class_type_info16search_above_dstEPNS_19__dynamic_cast_infoEPKvS4_ib($$084, $1, $2, $2, 1, $4); + if (HEAP8[$28 >> 0] | 0) { + label = 18; + break; + } + do if (HEAP8[$27 >> 0] | 0) { + if (!(HEAP8[$26 >> 0] | 0)) if (!(HEAP32[$29 >> 2] & 1)) { + $$28393 = $$081; + label = 19; + break L33; + } else { + $$182 = $$081; + $$186$off0 = 1; + break; + } + if ((HEAP32[$30 >> 2] | 0) == 1) { + $$28393 = 1; + label = 19; + break L33; + } + if (!(HEAP32[$29 >> 2] & 2)) { + $$28393 = 1; + label = 19; + break L33; + } else { + $$182 = 1; + $$186$off0 = 1; + } + } else { + $$182 = $$081; + $$186$off0 = $$085$off0; + } while (0); + $$081 = $$182; + $$084 = $$084 + 8 | 0; + $$085$off0 = $$186$off0; + } + if ((label | 0) == 18) if ($$085$off0) { + $$28393 = $$081; + label = 19; + } else { + $$28392 = $$081; + $47 = 4; + } + if ((label | 0) == 19) { + $$28392 = $$28393; + $47 = 3; + } + HEAP32[$19 >> 2] = $47; + if ($$28392 & 1) break; + } + HEAP32[$13 >> 2] = $2; + $49 = $1 + 40 | 0; + HEAP32[$49 >> 2] = (HEAP32[$49 >> 2] | 0) + 1; + if ((HEAP32[$1 + 36 >> 2] | 0) != 1) break; + if ((HEAP32[$1 + 24 >> 2] | 0) != 2) break; + HEAP8[$1 + 54 >> 0] = 1; + break; + } + if (($3 | 0) == 1) HEAP32[$1 + 32 >> 2] = 1; + } else __ZNK10__cxxabiv117__class_type_info29process_static_type_below_dstEPNS_19__dynamic_cast_infoEPKvi(0, $1, $2, $3); while (0); + return; +} + +function _jpeg_consume_input($0) { + $0 = $0 | 0; + var $$0 = 0, $$pre$phiZ2D = 0, $$sink22 = 0, $$sink24 = 0, $1 = 0, $13 = 0, $16 = 0, $18 = 0, $19 = 0, $2 = 0, $21 = 0, $23 = 0, $24 = 0, $3 = 0, $42 = 0, $43 = 0, $50 = 0, $61 = 0, $62 = 0, $72 = 0, $93 = 0; + $1 = $0 + 20 | 0; + $2 = HEAP32[$1 >> 2] | 0; + switch ($2 | 0) { + case 200: + { + $3 = $0 + 460 | 0; + FUNCTION_TABLE_vi[HEAP32[(HEAP32[$3 >> 2] | 0) + 4 >> 2] & 255]($0); + FUNCTION_TABLE_vi[HEAP32[(HEAP32[$0 + 24 >> 2] | 0) + 8 >> 2] & 255]($0); + HEAP32[$1 >> 2] = 201; + $$pre$phiZ2D = $3; + break; + } + case 201: + { + $$pre$phiZ2D = $0 + 460 | 0; + break; + } + case 210: + case 208: + case 207: + case 206: + case 205: + case 204: + case 203: + { + $$0 = FUNCTION_TABLE_ii[HEAP32[HEAP32[$0 + 460 >> 2] >> 2] & 127]($0) | 0; + return $$0 | 0; + } + case 202: + { + $$0 = 1; + return $$0 | 0; + } + default: + { + $93 = HEAP32[$0 >> 2] | 0; + HEAP32[$93 + 20 >> 2] = 21; + HEAP32[$93 + 24 >> 2] = $2; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + $$0 = 0; + return $$0 | 0; + } + } + $13 = FUNCTION_TABLE_ii[HEAP32[HEAP32[$$pre$phiZ2D >> 2] >> 2] & 127]($0) | 0; + if (($13 | 0) != 1) { + $$0 = $13; + return $$0 | 0; + } + $16 = HEAP32[$0 + 36 >> 2] | 0; + L13 : do switch ($16 | 0) { + case 1: + { + $$sink22 = $16; + $$sink24 = $16; + break; + } + case 3: + { + $18 = HEAP32[$0 + 216 >> 2] | 0; + $19 = HEAP32[$18 >> 2] | 0; + $21 = HEAP32[$18 + 88 >> 2] | 0; + $23 = HEAP32[$18 + 176 >> 2] | 0; + $24 = ($19 | 0) == 1; + if (!($24 & ($21 | 0) == 2 & ($23 | 0) == 3)) if (!($24 & ($21 | 0) == 34 & ($23 | 0) == 35)) if (!(($19 | 0) == 82 & ($21 | 0) == 71 & ($23 | 0) == 66)) if (!(($19 | 0) == 114 & ($21 | 0) == 103 & ($23 | 0) == 98)) if (!(HEAP32[$0 + 284 >> 2] | 0)) { + if (!(HEAP32[$0 + 296 >> 2] | 0)) { + $50 = HEAP32[$0 >> 2] | 0; + HEAP32[$50 + 24 >> 2] = $19; + HEAP32[$50 + 28 >> 2] = $21; + HEAP32[$50 + 32 >> 2] = $23; + HEAP32[$50 + 20 >> 2] = 113; + FUNCTION_TABLE_vii[HEAP32[$50 + 4 >> 2] & 255]($0, 1); + $$sink22 = 2; + $$sink24 = 3; + break L13; + } + $42 = HEAP8[$0 + 300 >> 0] | 0; + switch ($42 << 24 >> 24) { + case 0: + { + $$sink22 = 2; + $$sink24 = 2; + break L13; + break; + } + case 1: + { + $$sink22 = 2; + $$sink24 = 3; + break L13; + break; + } + default: + { + $43 = HEAP32[$0 >> 2] | 0; + HEAP32[$43 + 20 >> 2] = 116; + HEAP32[$43 + 24 >> 2] = $42 & 255; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, -1); + $$sink22 = 2; + $$sink24 = 3; + break L13; + } + } + } else { + $$sink22 = 2; + $$sink24 = 3; + } else { + $$sink22 = 2; + $$sink24 = 6; + } else { + $$sink22 = 2; + $$sink24 = 2; + } else { + $$sink22 = 2; + $$sink24 = 7; + } else { + $$sink22 = 2; + $$sink24 = 3; + } + break; + } + case 4: + { + if (!(HEAP32[$0 + 296 >> 2] | 0)) { + $$sink22 = 4; + $$sink24 = 4; + } else { + $61 = HEAP8[$0 + 300 >> 0] | 0; + switch ($61 << 24 >> 24) { + case 0: + { + $$sink22 = 4; + $$sink24 = 4; + break L13; + break; + } + case 2: + { + $$sink22 = 4; + $$sink24 = 5; + break L13; + break; + } + default: + { + $62 = HEAP32[$0 >> 2] | 0; + HEAP32[$62 + 20 >> 2] = 116; + HEAP32[$62 + 24 >> 2] = $61 & 255; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, -1); + $$sink22 = 4; + $$sink24 = 5; + break L13; + } + } + } + break; + } + default: + { + $$sink22 = 0; + $$sink24 = 0; + } + } while (0); + HEAP32[$0 + 40 >> 2] = $$sink24; + HEAP32[$0 + 44 >> 2] = $$sink22; + $72 = HEAP32[$0 + 428 >> 2] | 0; + HEAP32[$0 + 48 >> 2] = $72; + HEAP32[$0 + 52 >> 2] = $72; + HEAPF64[$0 + 56 >> 3] = 1.0; + HEAP32[$0 + 64 >> 2] = 0; + HEAP32[$0 + 68 >> 2] = 0; + HEAP32[$0 + 72 >> 2] = 0; + HEAP32[$0 + 76 >> 2] = 1; + HEAP32[$0 + 80 >> 2] = 1; + HEAP32[$0 + 84 >> 2] = 0; + HEAP32[$0 + 88 >> 2] = 2; + HEAP32[$0 + 92 >> 2] = 1; + HEAP32[$0 + 96 >> 2] = 256; + HEAP32[$0 + 136 >> 2] = 0; + HEAP32[$0 + 100 >> 2] = 0; + HEAP32[$0 + 104 >> 2] = 0; + HEAP32[$0 + 108 >> 2] = 0; + HEAP32[$1 >> 2] = 202; + $$0 = 1; + return $$0 | 0; +} + +function _consume_data($0) { + $0 = $0 | 0; + var $$071 = 0, $$072100 = 0, $$07386$us = 0, $$07483$us = 0, $$075105 = 0, $$07691 = 0, $$07896 = 0, $$084$us = 0, $$177$lcssa = 0, $$17785$us = 0, $$192 = 0, $$282$us = 0, $$sink = 0, $1 = 0, $10 = 0, $100 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $42 = 0, $44 = 0, $45 = 0, $47 = 0, $50 = 0, $60 = 0, $7 = 0, $70 = 0, $71 = 0, $73 = 0, $75 = 0, $76 = 0, $78 = 0, $8 = 0, $80 = 0, $82 = 0, $88 = 0, $99 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + $2 = $0 + 452 | 0; + $3 = HEAP32[$2 >> 2] | 0; + $4 = $0 + 340 | 0; + if ((HEAP32[$4 >> 2] | 0) > 0) { + $7 = $0 + 4 | 0; + $8 = $0 + 148 | 0; + $$075105 = 0; + do { + $10 = HEAP32[$0 + 344 + ($$075105 << 2) >> 2] | 0; + $20 = HEAP32[$10 + 12 >> 2] | 0; + $21 = Math_imul($20, HEAP32[$8 >> 2] | 0) | 0; + $22 = FUNCTION_TABLE_iiiiii[HEAP32[(HEAP32[$7 >> 2] | 0) + 32 >> 2] & 31]($0, HEAP32[$3 + 72 + (HEAP32[$10 + 4 >> 2] << 2) >> 2] | 0, $21, $20, 1) | 0; + HEAP32[$1 + ($$075105 << 2) >> 2] = $22; + $$075105 = $$075105 + 1 | 0; + } while (($$075105 | 0) < (HEAP32[$4 >> 2] | 0)); + } + $27 = $3 + 24 | 0; + $28 = HEAP32[$27 >> 2] | 0; + $29 = $3 + 28 | 0; + $30 = HEAP32[$29 >> 2] | 0; + L6 : do if (($28 | 0) < ($30 | 0)) { + $32 = $3 + 20 | 0; + $33 = $0 + 360 | 0; + $34 = $0 + 468 | 0; + $35 = $3 + 32 | 0; + $$072100 = $28; + $37 = HEAP32[$32 >> 2] | 0; + $38 = HEAP32[$33 >> 2] | 0; + $99 = $30; + L8 : while (1) { + if ($37 >>> 0 < $38 >>> 0) { + $$07896 = $37; + while (1) { + $39 = HEAP32[$4 >> 2] | 0; + if (($39 | 0) > 0) { + $$07691 = 0; + $$192 = 0; + while (1) { + $42 = HEAP32[$0 + 344 + ($$192 << 2) >> 2] | 0; + $44 = HEAP32[$42 + 56 >> 2] | 0; + $45 = Math_imul($44, $$07896) | 0; + $47 = HEAP32[$42 + 60 >> 2] | 0; + if (($47 | 0) > 0 ? ($50 = HEAP32[$1 + ($$192 << 2) >> 2] | 0, ($44 | 0) > 0) : 0) { + $$07386$us = 0; + $$17785$us = $$07691; + while (1) { + $$07483$us = 0; + $$084$us = (HEAP32[$50 + ($$07386$us + $$072100 << 2) >> 2] | 0) + ($45 << 7) | 0; + $$282$us = $$17785$us; + while (1) { + HEAP32[$3 + 32 + ($$282$us << 2) >> 2] = $$084$us; + $$07483$us = $$07483$us + 1 | 0; + if (($$07483$us | 0) == ($44 | 0)) break; else { + $$084$us = $$084$us + 128 | 0; + $$282$us = $$282$us + 1 | 0; + } + } + $60 = $44 + $$17785$us | 0; + $$07386$us = $$07386$us + 1 | 0; + if (($$07386$us | 0) >= ($47 | 0)) { + $$177$lcssa = $60; + break; + } else $$17785$us = $60; + } + } else $$177$lcssa = $$07691; + $$192 = $$192 + 1 | 0; + if (($$192 | 0) >= ($39 | 0)) break; else $$07691 = $$177$lcssa; + } + } + if (!(FUNCTION_TABLE_iii[HEAP32[(HEAP32[$34 >> 2] | 0) + 4 >> 2] & 127]($0, $35) | 0)) break L8; + $70 = $$07896 + 1 | 0; + $71 = HEAP32[$33 >> 2] | 0; + if ($70 >>> 0 < $71 >>> 0) $$07896 = $70; else break; + } + $100 = $71; + $75 = HEAP32[$29 >> 2] | 0; + } else { + $100 = $38; + $75 = $99; + } + HEAP32[$32 >> 2] = 0; + $73 = $$072100 + 1 | 0; + if (($73 | 0) < ($75 | 0)) { + $$072100 = $73; + $37 = 0; + $38 = $100; + $99 = $75; + } else break L6; + } + HEAP32[$27 >> 2] = $$072100; + HEAP32[$32 >> 2] = $$07896; + $$071 = 0; + STACKTOP = sp; + return $$071 | 0; + } while (0); + $76 = $0 + 148 | 0; + $78 = (HEAP32[$76 >> 2] | 0) + 1 | 0; + HEAP32[$76 >> 2] = $78; + $80 = HEAP32[$0 + 332 >> 2] | 0; + if ($78 >>> 0 >= $80 >>> 0) { + FUNCTION_TABLE_vi[HEAP32[(HEAP32[$0 + 460 >> 2] | 0) + 12 >> 2] & 255]($0); + $$071 = 4; + STACKTOP = sp; + return $$071 | 0; + } + $82 = HEAP32[$2 >> 2] | 0; + if ((HEAP32[$4 >> 2] | 0) > 1) $$sink = 1; else { + $88 = HEAP32[$0 + 344 >> 2] | 0; + $$sink = HEAP32[($78 >>> 0 < ($80 + -1 | 0) >>> 0 ? $88 + 12 | 0 : $88 + 76 | 0) >> 2] | 0; + } + HEAP32[$82 + 28 >> 2] = $$sink; + HEAP32[$82 + 20 >> 2] = 0; + HEAP32[$82 + 24 >> 2] = 0; + $$071 = 3; + STACKTOP = sp; + return $$071 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBracedExprEv($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$2 = 0, $$3 = 0, $$4 = 0, $$5 = 0, $$6 = 0, $$7 = 0, $1 = 0, $10 = 0, $11 = 0, $13 = 0, $18 = 0, $19 = 0, $2 = 0, $21 = 0, $26 = 0, $27 = 0, $29 = 0, $3 = 0, $31 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp + 8 | 0; + $2 = sp + 4 | 0; + $3 = sp; + L1 : do if ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 == 100) switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 | 0) { + case 105: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $11 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseSourceNameEPNS5_9NameStateE($10) | 0; + HEAP32[$1 >> 2] = $11; + if (!$11) $$1 = 0; else { + $13 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBracedExprEv($10) | 0; + HEAP32[$2 >> 2] = $13; + if (!$13) $$0 = 0; else { + HEAP8[$3 >> 0] = 0; + $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10BracedExprEJRPNS0_4NodeESA_bEEES9_DpOT0_($0, $1, $2, $3) | 0; + } + $$1 = $$0; + } + $$7 = $$1; + break L1; + break; + } + case 120: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $18 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $19 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($18) | 0; + HEAP32[$1 >> 2] = $19; + if (!$19) $$3 = 0; else { + $21 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBracedExprEv($18) | 0; + HEAP32[$2 >> 2] = $21; + if (!$21) $$2 = 0; else { + HEAP8[$3 >> 0] = 1; + $$2 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10BracedExprEJRPNS0_4NodeESA_bEEES9_DpOT0_($0, $1, $2, $3) | 0; + } + $$3 = $$2; + } + $$7 = $$3; + break L1; + break; + } + case 88: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $26 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $27 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($26) | 0; + HEAP32[$1 >> 2] = $27; + if (!$27) $$6 = 0; else { + $29 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($26) | 0; + HEAP32[$2 >> 2] = $29; + if (!$29) $$5 = 0; else { + $31 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBracedExprEv($26) | 0; + HEAP32[$3 >> 2] = $31; + if (!$31) $$4 = 0; else $$4 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_15BracedRangeExprEJRPNS0_4NodeESA_SA_EEES9_DpOT0_($0, $1, $2, $3) | 0; + $$5 = $$4; + } + $$6 = $$5; + } + $$7 = $$6; + break L1; + break; + } + default: + { + label = 20; + break L1; + } + } else label = 20; while (0); + if ((label | 0) == 20) $$7 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + STACKTOP = sp; + return $$7 | 0; +} + +function _jinit_master_decompress($0) { + $0 = $0 | 0; + var $$0$i = 0, $$018$i$i = 0, $$pre$phi$iZ2D = 0, $$pre$phi96$iZ2D = 0, $1 = 0, $104 = 0, $11 = 0, $114 = 0, $127 = 0, $133 = 0, $18 = 0, $19 = 0, $30 = 0, $33 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $53 = 0, $56 = 0, $9 = 0, $96 = 0, label = 0; + $1 = $0 + 4 | 0; + $4 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 28) | 0; + HEAP32[$0 + 444 >> 2] = $4; + HEAP32[$4 >> 2] = 184; + HEAP32[$4 + 4 >> 2] = 185; + HEAP32[$4 + 8 >> 2] = 0; + $9 = HEAP32[$0 + 212 >> 2] | 0; + if (($9 | 0) != 8) { + $11 = HEAP32[$0 >> 2] | 0; + HEAP32[$11 + 20 >> 2] = 16; + HEAP32[$11 + 24 >> 2] = $9; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + _jpeg_calc_output_dimensions($0); + $18 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1280) | 0; + _memset($18 | 0, 0, 512) | 0; + $19 = $18 + 512 | 0; + HEAP32[$0 + 336 >> 2] = $19; + $$018$i$i = 0; + do { + HEAP8[$19 + $$018$i$i >> 0] = $$018$i$i; + $$018$i$i = $$018$i$i + 1 | 0; + } while (($$018$i$i | 0) != 256); + _memset($18 + 768 | 0, -1, 512) | 0; + if (((HEAP32[$0 + 116 >> 2] | 0) != 0 ? (HEAP32[$0 + 112 >> 2] | 0) != 0 : 0) ? ($30 = $0 + 120 | 0, (HEAP32[$30 >> 2] | 0) >= 1) : 0) $$pre$phi$iZ2D = $30; else { + $33 = HEAP32[$0 >> 2] | 0; + HEAP32[$33 + 20 >> 2] = 33; + FUNCTION_TABLE_vi[HEAP32[$33 >> 2] & 255]($0); + $$pre$phi$iZ2D = $0 + 120 | 0; + } + $36 = $4 + 12 | 0; + HEAP32[$36 >> 2] = 0; + $37 = _use_merged_upsample($0) | 0; + $38 = $4 + 16 | 0; + HEAP32[$38 >> 2] = $37; + $39 = $4 + 20 | 0; + HEAP32[$39 >> 2] = 0; + $40 = $4 + 24 | 0; + HEAP32[$40 >> 2] = 0; + do if (!(HEAP32[$0 + 84 >> 2] | 0)) { + HEAP32[$0 + 100 >> 2] = 0; + HEAP32[$0 + 104 >> 2] = 0; + HEAP32[$0 + 108 >> 2] = 0; + $$pre$phi96$iZ2D = $0 + 68 | 0; + } else { + if (!(HEAP32[$0 + 64 >> 2] | 0)) { + HEAP32[$0 + 100 >> 2] = 0; + HEAP32[$0 + 104 >> 2] = 0; + HEAP32[$0 + 108 >> 2] = 0; + } + $53 = $0 + 68 | 0; + if (HEAP32[$53 >> 2] | 0) { + $56 = HEAP32[$0 >> 2] | 0; + HEAP32[$56 + 20 >> 2] = 48; + FUNCTION_TABLE_vi[HEAP32[$56 >> 2] & 255]($0); + } + do if ((HEAP32[$$pre$phi$iZ2D >> 2] | 0) == 3) { + if (HEAP32[$0 + 136 >> 2] | 0) { + HEAP32[$0 + 104 >> 2] = 1; + break; + } + if (!(HEAP32[$0 + 92 >> 2] | 0)) { + HEAP32[$0 + 100 >> 2] = 1; + break; + } else { + HEAP32[$0 + 108 >> 2] = 1; + break; + } + } else { + HEAP32[$0 + 100 >> 2] = 1; + HEAP32[$0 + 104 >> 2] = 0; + HEAP32[$0 + 108 >> 2] = 0; + HEAP32[$0 + 136 >> 2] = 0; + } while (0); + if (HEAP32[$0 + 100 >> 2] | 0) { + _jinit_1pass_quantizer($0); + HEAP32[$39 >> 2] = HEAP32[$0 + 484 >> 2]; + } + if ((HEAP32[$0 + 108 >> 2] | 0) == 0 ? (HEAP32[$0 + 104 >> 2] | 0) == 0 : 0) { + $$pre$phi96$iZ2D = $53; + break; + } + _jinit_2pass_quantizer($0); + HEAP32[$40 >> 2] = HEAP32[$0 + 484 >> 2]; + $$pre$phi96$iZ2D = $53; + } while (0); + if (!(HEAP32[$$pre$phi96$iZ2D >> 2] | 0)) { + if (!(HEAP32[$38 >> 2] | 0)) { + _jinit_color_deconverter($0); + _jinit_upsampler($0); + } else _jinit_merged_upsampler($0); + _jinit_d_post_controller($0, HEAP32[$0 + 108 >> 2] | 0); + } + _jinit_inverse_dct($0); + if (!(HEAP32[$0 + 228 >> 2] | 0)) _jinit_huff_decoder($0); else _jinit_arith_decoder($0); + $96 = $0 + 460 | 0; + if (!(HEAP32[(HEAP32[$96 >> 2] | 0) + 16 >> 2] | 0)) $104 = (HEAP32[$0 + 64 >> 2] | 0) != 0 & 1; else $104 = 1; + _jinit_d_coef_controller($0, $104); + if (!(HEAP32[$$pre$phi96$iZ2D >> 2] | 0)) _jinit_d_main_controller($0, 0); + FUNCTION_TABLE_vi[HEAP32[(HEAP32[$1 >> 2] | 0) + 24 >> 2] & 255]($0); + FUNCTION_TABLE_vi[HEAP32[(HEAP32[$96 >> 2] | 0) + 8 >> 2] & 255]($0); + $114 = HEAP32[$0 + 8 >> 2] | 0; + if (!$114) return; + if (HEAP32[$0 + 64 >> 2] | 0) return; + if (!(HEAP32[(HEAP32[$96 >> 2] | 0) + 16 >> 2] | 0)) return; + $127 = HEAP32[$0 + 36 >> 2] | 0; + $$0$i = (HEAP32[$0 + 224 >> 2] | 0) == 0 ? $127 : ($127 * 3 | 0) + 2 | 0; + HEAP32[$114 + 4 >> 2] = 0; + $133 = Math_imul($$0$i, HEAP32[$0 + 332 >> 2] | 0) | 0; + HEAP32[$114 + 8 >> 2] = $133; + HEAP32[$114 + 12 >> 2] = 0; + HEAP32[$114 + 16 >> 2] = (HEAP32[$0 + 108 >> 2] | 0) == 0 ? 2 : 3; + HEAP32[$36 >> 2] = (HEAP32[$36 >> 2] | 0) + 1; + return; +} + +function _h2v2_merged_upsample($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0158$lcssa = 0, $$0158169 = 0, $$0159$lcssa = 0, $$0159168 = 0, $$0160$lcssa = 0, $$0160167 = 0, $$0161$lcssa = 0, $$0161166 = 0, $$0162$lcssa = 0, $$0162165 = 0, $$0163$lcssa = 0, $$0163164 = 0, $$0170 = 0, $103 = 0, $11 = 0, $119 = 0, $122 = 0, $124 = 0, $126 = 0, $13 = 0, $132 = 0, $134 = 0, $136 = 0, $149 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $22 = 0, $26 = 0, $30 = 0, $31 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $38 = 0, $39 = 0, $42 = 0, $45 = 0, $47 = 0, $5 = 0, $53 = 0, $55 = 0, $58 = 0, $7 = 0, $73 = 0, $88 = 0, $9 = 0, $scevgep = 0, $scevgep184 = 0; + $5 = HEAP32[$0 + 476 >> 2] | 0; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $9 = HEAP32[$5 + 16 >> 2] | 0; + $11 = HEAP32[$5 + 20 >> 2] | 0; + $13 = HEAP32[$5 + 24 >> 2] | 0; + $15 = HEAP32[$5 + 28 >> 2] | 0; + $16 = HEAP32[$1 >> 2] | 0; + $17 = $2 << 1; + $19 = HEAP32[$16 + ($17 << 2) >> 2] | 0; + $22 = HEAP32[$16 + (($17 | 1) << 2) >> 2] | 0; + $26 = HEAP32[(HEAP32[$1 + 4 >> 2] | 0) + ($2 << 2) >> 2] | 0; + $30 = HEAP32[(HEAP32[$1 + 8 >> 2] | 0) + ($2 << 2) >> 2] | 0; + $31 = HEAP32[$3 >> 2] | 0; + $33 = HEAP32[$3 + 4 >> 2] | 0; + $34 = $0 + 112 | 0; + $35 = HEAP32[$34 >> 2] | 0; + $36 = $35 >>> 1; + if (!$36) { + $$0158$lcssa = $30; + $$0159$lcssa = $26; + $$0160$lcssa = $22; + $$0161$lcssa = $19; + $$0162$lcssa = $33; + $$0163$lcssa = $31; + $119 = $35; + } else { + $scevgep = $26 + $36 | 0; + $38 = $35 & -2; + $39 = $36 * 6 | 0; + $scevgep184 = $22 + $38 | 0; + $$0158169 = $30; + $$0159168 = $26; + $$0160167 = $22; + $$0161166 = $19; + $$0162165 = $33; + $$0163164 = $31; + $$0170 = $36; + while (1) { + $42 = HEAPU8[$$0159168 >> 0] | 0; + $45 = HEAPU8[$$0158169 >> 0] | 0; + $47 = HEAP32[$9 + ($45 << 2) >> 2] | 0; + $53 = (HEAP32[$13 + ($45 << 2) >> 2] | 0) + (HEAP32[$15 + ($42 << 2) >> 2] | 0) >> 16; + $55 = HEAP32[$11 + ($42 << 2) >> 2] | 0; + $58 = HEAPU8[$$0161166 >> 0] | 0; + HEAP8[$$0163164 >> 0] = HEAP8[$7 + ($47 + $58) >> 0] | 0; + HEAP8[$$0163164 + 1 >> 0] = HEAP8[$7 + ($53 + $58) >> 0] | 0; + HEAP8[$$0163164 + 2 >> 0] = HEAP8[$7 + ($55 + $58) >> 0] | 0; + $73 = HEAPU8[$$0161166 + 1 >> 0] | 0; + HEAP8[$$0163164 + 3 >> 0] = HEAP8[$7 + ($47 + $73) >> 0] | 0; + HEAP8[$$0163164 + 4 >> 0] = HEAP8[$7 + ($53 + $73) >> 0] | 0; + HEAP8[$$0163164 + 5 >> 0] = HEAP8[$7 + ($55 + $73) >> 0] | 0; + $88 = HEAPU8[$$0160167 >> 0] | 0; + HEAP8[$$0162165 >> 0] = HEAP8[$7 + ($47 + $88) >> 0] | 0; + HEAP8[$$0162165 + 1 >> 0] = HEAP8[$7 + ($53 + $88) >> 0] | 0; + HEAP8[$$0162165 + 2 >> 0] = HEAP8[$7 + ($55 + $88) >> 0] | 0; + $103 = HEAPU8[$$0160167 + 1 >> 0] | 0; + HEAP8[$$0162165 + 3 >> 0] = HEAP8[$7 + ($47 + $103) >> 0] | 0; + HEAP8[$$0162165 + 4 >> 0] = HEAP8[$7 + ($53 + $103) >> 0] | 0; + HEAP8[$$0162165 + 5 >> 0] = HEAP8[$7 + ($55 + $103) >> 0] | 0; + $$0170 = $$0170 + -1 | 0; + if (!$$0170) break; else { + $$0158169 = $$0158169 + 1 | 0; + $$0159168 = $$0159168 + 1 | 0; + $$0160167 = $$0160167 + 2 | 0; + $$0161166 = $$0161166 + 2 | 0; + $$0162165 = $$0162165 + 6 | 0; + $$0163164 = $$0163164 + 6 | 0; + } + } + $$0158$lcssa = $30 + $36 | 0; + $$0159$lcssa = $scevgep; + $$0160$lcssa = $scevgep184; + $$0161$lcssa = $19 + $38 | 0; + $$0162$lcssa = $33 + $39 | 0; + $$0163$lcssa = $31 + $39 | 0; + $119 = HEAP32[$34 >> 2] | 0; + } + if (!($119 & 1)) return; + $122 = HEAPU8[$$0159$lcssa >> 0] | 0; + $124 = HEAPU8[$$0158$lcssa >> 0] | 0; + $126 = HEAP32[$9 + ($124 << 2) >> 2] | 0; + $132 = (HEAP32[$13 + ($124 << 2) >> 2] | 0) + (HEAP32[$15 + ($122 << 2) >> 2] | 0) >> 16; + $134 = HEAP32[$11 + ($122 << 2) >> 2] | 0; + $136 = HEAPU8[$$0161$lcssa >> 0] | 0; + HEAP8[$$0163$lcssa >> 0] = HEAP8[$7 + ($126 + $136) >> 0] | 0; + HEAP8[$$0163$lcssa + 1 >> 0] = HEAP8[$7 + ($132 + $136) >> 0] | 0; + HEAP8[$$0163$lcssa + 2 >> 0] = HEAP8[$7 + ($134 + $136) >> 0] | 0; + $149 = HEAPU8[$$0160$lcssa >> 0] | 0; + HEAP8[$$0162$lcssa >> 0] = HEAP8[$7 + ($126 + $149) >> 0] | 0; + HEAP8[$$0162$lcssa + 1 >> 0] = HEAP8[$7 + ($132 + $149) >> 0] | 0; + HEAP8[$$0162$lcssa + 2 >> 0] = HEAP8[$7 + ($134 + $149) >> 0] | 0; + return; +} + +function _arParamLoad($0, $1, $2, $varargs) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $varargs = $varargs | 0; + var $$05254 = 0, $$053 = 0, $$056 = 0, $$059 = 0, $$1 = 0, $$pre$phi64Z2D = 0, $10 = 0, $12 = 0, $14 = 0, $17 = 0, $19 = 0, $21 = 0, $22 = 0, $25 = 0, $28 = 0, $3 = 0, $30 = 0, $33 = 0, $35 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0.0, $42 = 0, $44 = 0, $51 = 0, $52 = 0, $61 = 0.0, $8 = 0, $vararg_buffer = 0, $vararg_buffer13 = 0, $vararg_buffer15 = 0, $vararg_buffer18 = 0, $vararg_buffer2 = 0, $vararg_buffer6 = 0, $vararg_buffer9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 256 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(256); + $vararg_buffer18 = sp + 248 | 0; + $vararg_buffer15 = sp + 240 | 0; + $vararg_buffer13 = sp + 232 | 0; + $vararg_buffer9 = sp + 224 | 0; + $vararg_buffer6 = sp + 216 | 0; + $vararg_buffer2 = sp + 208 | 0; + $vararg_buffer = sp + 200 | 0; + $3 = sp; + $4 = sp + 16 | 0; + do if (($0 | 0) != 0 & ($1 | 0) > 0 & ($2 | 0) != 0) { + $8 = _fopen($0, 26308) | 0; + if (!$8) { + $10 = ___errno_location() | 0; + HEAP32[$vararg_buffer >> 2] = HEAP32[$10 >> 2]; + HEAP32[$vararg_buffer + 4 >> 2] = $0; + _arLog(0, 3, 24431, $vararg_buffer); + $12 = ___errno_location() | 0; + $14 = _strerror(HEAP32[$12 >> 2] | 0) | 0; + HEAP32[$vararg_buffer2 >> 2] = 67447; + HEAP32[$vararg_buffer2 + 4 >> 2] = $14; + _arLog(0, 3, 25953, $vararg_buffer2); + $$056 = -1; + break; + } + _fseek($8, 0, 2) | 0; + L6 : do if (!(_ferror($8) | 0)) { + $22 = _ftell($8) | 0; + _rewind($8); + $$053 = 0; + while (1) { + if ($$053 >>> 0 >= 4) { + label = 9; + break; + } + $25 = HEAP32[1712 + ($$053 << 3) + 4 >> 2] | 0; + $28 = $$053 + 1 | 0; + if (!(($22 | 0) % ($25 | 0) | 0)) { + $$05254 = $28; + $30 = $25; + break; + } else $$053 = $28; + } + do if ((label | 0) == 9) if (($$053 | 0) == 4) { + _arLog(0, 3, 24545, $vararg_buffer13); + $$059 = -1; + break L6; + } else { + $$05254 = 0; + $30 = HEAP32[1712 + (0 << 3) + 4 >> 2] | 0; + break; + } while (0); + if ((_fread($4, $30, 1, $8) | 0) != 1) { + $33 = ___errno_location() | 0; + HEAP32[$vararg_buffer15 >> 2] = HEAP32[$33 >> 2]; + _arLog(0, 3, 24625, $vararg_buffer15); + $35 = ___errno_location() | 0; + $37 = _strerror(HEAP32[$35 >> 2] | 0) | 0; + HEAP32[$vararg_buffer18 >> 2] = 67447; + HEAP32[$vararg_buffer18 + 4 >> 2] = $37; + _arLog(0, 3, 25953, $vararg_buffer18); + $$059 = -1; + break; + } + $38 = $4 + 176 | 0; + HEAP32[$38 >> 2] = $$05254; + _byteswap($4); + $39 = ($$05254 | 0) == 1; + $40 = $4 + 120 | 0; + if ($39) { + $41 = +HEAPF64[$40 >> 3]; + $42 = $4 + 128 | 0; + HEAPF64[$40 >> 3] = +HEAPF64[$42 >> 3]; + HEAPF64[$42 >> 3] = $41; + $$pre$phi64Z2D = $42; + } else $$pre$phi64Z2D = $4 + 128 | 0; + _memcpy($2 | 0, $4 | 0, 184) | 0; + HEAP32[$3 >> 2] = $varargs; + $44 = $2 + 176 | 0; + $$1 = 1; + while (1) { + if (($$1 | 0) >= ($1 | 0)) { + $$059 = 0; + break L6; + } + $51 = (HEAP32[$3 >> 2] | 0) + (4 - 1) & ~(4 - 1); + $52 = HEAP32[$51 >> 2] | 0; + HEAP32[$3 >> 2] = $51 + 4; + HEAP32[$52 + 176 >> 2] = HEAP32[$44 >> 2]; + if ((_fread($4, HEAP32[1712 + ((HEAP32[$44 >> 2] | 0) + -1 << 3) + 4 >> 2] | 0, 1, $8) | 0) != 1) { + $$059 = -1; + break L6; + } + HEAP32[$38 >> 2] = $$05254; + _byteswap($4); + if ($39) { + $61 = +HEAPF64[$40 >> 3]; + HEAPF64[$40 >> 3] = +HEAPF64[$$pre$phi64Z2D >> 3]; + HEAPF64[$$pre$phi64Z2D >> 3] = $61; + } + _memcpy($52 | 0, $4 | 0, 184) | 0; + $$1 = $$1 + 1 | 0; + } + } else { + $17 = ___errno_location() | 0; + HEAP32[$vararg_buffer6 >> 2] = HEAP32[$17 >> 2]; + _arLog(0, 3, 24500, $vararg_buffer6); + $19 = ___errno_location() | 0; + $21 = _strerror(HEAP32[$19 >> 2] | 0) | 0; + HEAP32[$vararg_buffer9 >> 2] = 67447; + HEAP32[$vararg_buffer9 + 4 >> 2] = $21; + _arLog(0, 3, 25953, $vararg_buffer9); + $$059 = -1; + } while (0); + _fclose($8) | 0; + $$056 = $$059; + } else $$056 = -1; while (0); + STACKTOP = sp; + return $$056 | 0; +} + +function _ar2GetTransMat_175($icpHandle, $initConv, $pos2d, $pos3d, $num, $conv, $robustMode) { + $icpHandle = $icpHandle | 0; + $initConv = $initConv | 0; + $pos2d = $pos2d | 0; + $pos3d = $pos3d | 0; + $num = $num | 0; + $conv = $conv | 0; + $robustMode = $robustMode | 0; + var $call = 0, $call3 = 0, $conv143 = 0.0, $conv148 = 0.0, $conv15 = 0.0, $conv153 = 0.0, $data = 0, $div = 0.0, $div17 = 0.0, $div19 = 0.0, $dx$0 = 0.0, $dy$0 = 0.0, $dz$0 = 0.0, $err = 0, $i$0 = 0, $i$1 = 0, $i$2 = 0, $i$3 = 0, $initMat = 0, $j$0 = 0, $j$1 = 0, $mat = 0, $worldCoord = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 224 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(224); + $data = sp + 212 | 0; + $initMat = sp + 96 | 0; + $mat = sp; + $err = sp + 192 | 0; + $call = _malloc($num << 4) | 0; + HEAP32[$data >> 2] = $call; + if (!$call) { + _arLog(0, 3, 45930, sp + 200 | 0); + _exit(1); + } + $call3 = _malloc($num * 24 | 0) | 0; + $worldCoord = $data + 4 | 0; + HEAP32[$worldCoord >> 2] = $call3; + if (!$call3) { + _arLog(0, 3, 45930, sp + 208 | 0); + _exit(1); + } + $dx$0 = 0.0; + $dy$0 = 0.0; + $dz$0 = 0.0; + $i$0 = 0; + while (1) { + if (($i$0 | 0) >= ($num | 0)) break; + $dx$0 = $dx$0 + +HEAPF32[$pos3d + ($i$0 * 12 | 0) >> 2]; + $dy$0 = $dy$0 + +HEAPF32[$pos3d + ($i$0 * 12 | 0) + 4 >> 2]; + $dz$0 = $dz$0 + +HEAPF32[$pos3d + ($i$0 * 12 | 0) + 8 >> 2]; + $i$0 = $i$0 + 1 | 0; + } + $conv15 = +($num | 0); + $div = $dx$0 / $conv15; + $div17 = $dy$0 / $conv15; + $div19 = $dz$0 / $conv15; + $i$1 = 0; + while (1) { + if (($i$1 | 0) >= ($num | 0)) break; + HEAPF64[$call + ($i$1 << 4) >> 3] = +HEAPF32[$pos2d + ($i$1 << 3) >> 2]; + HEAPF64[$call + ($i$1 << 4) + 8 >> 3] = +HEAPF32[$pos2d + ($i$1 << 3) + 4 >> 2]; + HEAPF64[$call3 + ($i$1 * 24 | 0) >> 3] = +HEAPF32[$pos3d + ($i$1 * 12 | 0) >> 2] - $div; + HEAPF64[$call3 + ($i$1 * 24 | 0) + 8 >> 3] = +HEAPF32[$pos3d + ($i$1 * 12 | 0) + 4 >> 2] - $div17; + HEAPF64[$call3 + ($i$1 * 24 | 0) + 16 >> 3] = +HEAPF32[$pos3d + ($i$1 * 12 | 0) + 8 >> 2] - $div19; + $i$1 = $i$1 + 1 | 0; + } + HEAP32[$data + 8 >> 2] = $num; + $j$0 = 0; + while (1) { + if (($j$0 | 0) == 3) break; + $i$2 = 0; + while (1) { + if (($i$2 | 0) == 3) break; + HEAPF64[$initMat + ($j$0 << 5) + ($i$2 << 3) >> 3] = +HEAPF32[$initConv + ($j$0 << 4) + ($i$2 << 2) >> 2]; + $i$2 = $i$2 + 1 | 0; + } + $j$0 = $j$0 + 1 | 0; + } + HEAPF64[$initMat + 24 >> 3] = +HEAPF32[$initConv + 12 >> 2] + ($div * +HEAPF32[$initConv >> 2] + $div17 * +HEAPF32[$initConv + 4 >> 2] + $div19 * +HEAPF32[$initConv + 8 >> 2]); + HEAPF64[$initMat + 56 >> 3] = +HEAPF32[$initConv + 28 >> 2] + ($div * +HEAPF32[$initConv + 16 >> 2] + $div17 * +HEAPF32[$initConv + 20 >> 2] + $div19 * +HEAPF32[$initConv + 24 >> 2]); + HEAPF64[$initMat + 88 >> 3] = +HEAPF32[$initConv + 44 >> 2] + ($div * +HEAPF32[$initConv + 32 >> 2] + $div17 * +HEAPF32[$initConv + 36 >> 2] + $div19 * +HEAPF32[$initConv + 40 >> 2]); + if (!$robustMode) { + if ((_icpPoint($icpHandle, $data, $initMat, $mat, $err) | 0) < 0) HEAPF64[$err >> 3] = 1.0e8; + } else if ((_icpPointRobust($icpHandle, $data, $initMat, $mat, $err) | 0) < 0) HEAPF64[$err >> 3] = 1.0e8; + _free(HEAP32[$data >> 2] | 0); + _free(HEAP32[$worldCoord >> 2] | 0); + $j$1 = 0; + while (1) { + if (($j$1 | 0) == 3) break; + $i$3 = 0; + while (1) { + if (($i$3 | 0) == 3) break; + HEAPF32[$conv + ($j$1 << 4) + ($i$3 << 2) >> 2] = +HEAPF64[$mat + ($j$1 << 5) + ($i$3 << 3) >> 3]; + $i$3 = $i$3 + 1 | 0; + } + $j$1 = $j$1 + 1 | 0; + } + $conv143 = $div; + $conv148 = $div17; + $conv153 = $div19; + HEAPF32[$conv + 12 >> 2] = +HEAPF64[$mat + 24 >> 3] - +HEAPF64[$mat >> 3] * $conv143 - +HEAPF64[$mat + 8 >> 3] * $conv148 - +HEAPF64[$mat + 16 >> 3] * $conv153; + HEAPF32[$conv + 28 >> 2] = +HEAPF64[$mat + 56 >> 3] - +HEAPF64[$mat + 32 >> 3] * $conv143 - +HEAPF64[$mat + 40 >> 3] * $conv148 - +HEAPF64[$mat + 48 >> 3] * $conv153; + HEAPF32[$conv + 44 >> 2] = +HEAPF64[$mat + 88 >> 3] - +HEAPF64[$mat + 64 >> 3] * $conv143 - +HEAPF64[$mat + 72 >> 3] * $conv148 - +HEAPF64[$mat + 80 >> 3] * $conv153; + STACKTOP = sp; + return +(+HEAPF64[$err >> 3]); +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20parseUnnamedTypeNameEPNS5_9NameStateE($0) { + $0 = $0 | 0; + var $$0 = 0, $$3 = 0, $$4 = 0, $$5 = 0, $$byval_copy2 = 0, $1 = 0, $12 = 0, $13 = 0, $15 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy2 = sp + 40 | 0; + $1 = sp + 32 | 0; + $2 = sp + 24 | 0; + $3 = sp; + $4 = sp + 8 | 0; + $5 = sp + 16 | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($1, 55241); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$1 + 4 >> 2]; + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy2) | 0)) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 55244); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy2) | 0) { + __ZN12_GLOBAL__N_116itanium_demangle9NodeArrayC2Ev($3); + __ZN12_GLOBAL__N_114SwapAndRestoreIbEC2ERbb($4, $0 + 362 | 0, 1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 55247); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + do if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy2) | 0)) { + $12 = $0 + 8 | 0; + $13 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($12) | 0; + while (1) { + $15 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy2 >> 2] = $15; + if (!$15) { + label = 11; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($12, $$byval_copy2); + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) { + label = 10; + break; + } + } + if ((label | 0) == 10) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20popTrailingNodeArrayEm($3, $0, $13); + label = 12; + break; + } else if ((label | 0) == 11) { + $$4 = 0; + break; + } + } else label = 12; while (0); + if ((label | 0) == 12) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E11parseNumberEb($$byval_copy2, $0, 0); + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_15ClosureTypeNameEJRNS0_9NodeArrayERNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $3, $$byval_copy2) | 0; else $$3 = 0; + $$4 = $$3; + } + __ZN12_GLOBAL__N_114SwapAndRestoreIbED2Ev($4); + $$5 = $$4; + } else $$5 = 0; + } else { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E11parseNumberEb($$byval_copy2, $0, 0); + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_15UnnamedTypeNameEJRNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $$byval_copy2) | 0; else $$0 = 0; + $$5 = $$0; + } + STACKTOP = sp; + return $$5 | 0; +} + +function _ar2Tracking2dSub($handle, $surfaceSet, $candidate, $dataPtr, $mfImage, $templ, $result) { + $handle = $handle | 0; + $surfaceSet = $surfaceSet | 0; + $candidate = $candidate | 0; + $dataPtr = $dataPtr | 0; + $mfImage = $mfImage | 0; + $templ = $templ | 0; + $result = $result | 0; + var $0 = 0, $1 = 0, $11 = 0, $12 = 0, $13 = 0, $18 = 0, $2 = 0, $24 = 0, $3 = 0, $37 = 0, $40 = 0, $44 = 0, $7 = 0, $arraydecay = 0, $arraydecay40 = 0, $arraydecay67$pre$phiZ2D = 0, $bx = 0, $by = 0, $call = 0, $conv = 0.0, $cparamLT = 0, $mx = 0, $my = 0, $retval$0 = 0, $search = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $search = sp; + $bx = sp + 28 | 0; + $by = sp + 24 | 0; + $0 = HEAP32[$candidate >> 2] | 0; + $1 = HEAP32[$candidate + 4 >> 2] | 0; + $2 = HEAP32[$candidate + 8 >> 2] | 0; + $3 = HEAP32[$templ >> 2] | 0; + if (!$3) { + $call = _ar2GenTemplate(HEAP32[$handle + 28 >> 2] | 0, HEAP32[$handle + 32 >> 2] | 0) | 0; + HEAP32[$templ >> 2] = $call; + $11 = $call; + } else $11 = $3; + $cparamLT = $handle + 12 | 0; + $arraydecay = $handle + 48 + ($0 * 48 | 0) | 0; + $7 = HEAP32[$surfaceSet >> 2] | 0; + if ((_ar2SetTemplateSub(HEAP32[$cparamLT >> 2] | 0, $arraydecay, HEAP32[$7 + ($0 * 112 | 0) >> 2] | 0, (HEAP32[HEAP32[$7 + ($0 * 112 | 0) + 4 >> 2] >> 2] | 0) + ($1 * 20 | 0) | 0, $2, $11) | 0) >= 0 ? ($12 = HEAP32[$templ >> 2] | 0, $13 = HEAP32[$12 + 28 >> 2] | 0, $conv = +(Math_imul($13, $13) | 0), !(+(Math_imul((HEAP32[$12 + 16 >> 2] | 0) + 1 + (HEAP32[$12 + 20 >> 2] | 0) | 0, (HEAP32[$12 + 8 >> 2] | 0) + 1 + (HEAP32[$12 + 12 >> 2] | 0) | 0) | 0) * 5.0 * 5.0 > $conv)) : 0) { + $18 = HEAP32[$surfaceSet + 152 >> 2] | 0; + do if (($18 | 0) != 1) { + $24 = HEAP32[$cparamLT >> 2] | 0; + $arraydecay40 = $handle + 528 + ($0 * 48 | 0) | 0; + if (($18 | 0) == 2) { + _ar2GetSearchPoint($24, $arraydecay, $arraydecay40, 0, (HEAP32[(HEAP32[HEAP32[(HEAP32[$surfaceSet >> 2] | 0) + ($0 * 112 | 0) + 4 >> 2] >> 2] | 0) + ($1 * 20 | 0) >> 2] | 0) + ($2 * 20 | 0) | 0, $search); + $arraydecay67$pre$phiZ2D = $search; + break; + } else { + _ar2GetSearchPoint($24, $arraydecay, $arraydecay40, $handle + 1008 + ($0 * 48 | 0) | 0, (HEAP32[(HEAP32[HEAP32[(HEAP32[$surfaceSet >> 2] | 0) + ($0 * 112 | 0) + 4 >> 2] >> 2] | 0) + ($1 * 20 | 0) >> 2] | 0) + ($2 * 20 | 0) | 0, $search); + $arraydecay67$pre$phiZ2D = $search; + break; + } + } else { + _ar2GetSearchPoint(HEAP32[$cparamLT >> 2] | 0, $arraydecay, 0, 0, (HEAP32[(HEAP32[HEAP32[(HEAP32[$surfaceSet >> 2] | 0) + ($0 * 112 | 0) + 4 >> 2] >> 2] | 0) + ($1 * 20 | 0) >> 2] | 0) + ($2 * 20 | 0) | 0, $search); + $arraydecay67$pre$phiZ2D = $search; + } while (0); + $37 = HEAP32[$handle + 24 >> 2] | 0; + if ((_ar2GetBestMatching($dataPtr, $mfImage, HEAP32[$handle + 4 >> 2] | 0, HEAP32[$handle + 8 >> 2] | 0, HEAP32[$handle + 20 >> 2] | 0, HEAP32[$templ >> 2] | 0, $37, $37, $arraydecay67$pre$phiZ2D, $bx, $by, $result) | 0) >= 0) { + HEAPF32[$result + 4 >> 2] = +(HEAP32[$bx >> 2] | 0); + HEAPF32[$result + 8 >> 2] = +(HEAP32[$by >> 2] | 0); + $40 = HEAP32[$surfaceSet >> 2] | 0; + $44 = HEAP32[(HEAP32[HEAP32[$40 + ($0 * 112 | 0) + 4 >> 2] >> 2] | 0) + ($1 * 20 | 0) >> 2] | 0; + $mx = $44 + ($2 * 20 | 0) + 8 | 0; + $my = $44 + ($2 * 20 | 0) + 12 | 0; + HEAPF32[$result + 12 >> 2] = +HEAPF32[$40 + ($0 * 112 | 0) + 24 >> 2] + (+HEAPF32[$40 + ($0 * 112 | 0) + 12 >> 2] * +HEAPF32[$mx >> 2] + +HEAPF32[$40 + ($0 * 112 | 0) + 16 >> 2] * +HEAPF32[$my >> 2]); + HEAPF32[$result + 16 >> 2] = +HEAPF32[$40 + ($0 * 112 | 0) + 40 >> 2] + (+HEAPF32[$40 + ($0 * 112 | 0) + 28 >> 2] * +HEAPF32[$mx >> 2] + +HEAPF32[$40 + ($0 * 112 | 0) + 32 >> 2] * +HEAPF32[$my >> 2]); + HEAPF32[$result + 20 >> 2] = +HEAPF32[$40 + ($0 * 112 | 0) + 56 >> 2] + (+HEAPF32[$40 + ($0 * 112 | 0) + 44 >> 2] * +HEAPF32[$mx >> 2] + +HEAPF32[$40 + ($0 * 112 | 0) + 48 >> 2] * +HEAPF32[$my >> 2]); + $retval$0 = 0; + } else $retval$0 = -1; + } else $retval$0 = -1; + STACKTOP = sp; + return $retval$0 | 0; +} + +function _minvf($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$0130 = 0.0, $$0131 = 0, $$0133 = 0, $$0135 = 0, $$0138 = 0, $$0142 = 0, $$0145 = 0, $$1132 = 0, $$1136 = 0, $$1139 = 0, $$1143 = 0, $$1146 = 0, $$2 = 0, $$2137 = 0, $$2140 = 0, $$2144 = 0, $$2147 = 0, $$3 = 0, $$3141 = 0, $$4 = 0, $13 = 0, $15 = 0.0, $16 = 0, $21 = 0, $22 = 0, $23 = 0, $27 = 0, $3 = 0, $32 = 0.0, $33 = 0, $40 = 0, $41 = 0.0, $42 = 0, $56 = 0, $65 = 0, $indvars$iv = 0, $indvars$iv154 = 0, $scevgep = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 2e3 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(2e3); + $3 = sp; + L1 : do if (($1 | 0) > 500) $$0 = 0; else { + switch ($1 | 0) { + case 0: + { + $$0 = 0; + break L1; + break; + } + case 1: + { + HEAPF32[$0 >> 2] = 1.0 / +HEAPF32[$0 >> 2]; + $$0 = $0; + break L1; + break; + } + default: + {} + } + $$0135 = 0; + while (1) { + if (($$0135 | 0) >= ($1 | 0)) break; + HEAP32[$3 + ($$0135 << 2) >> 2] = $$0135; + $$0135 = $$0135 + 1 | 0; + } + $scevgep = $0 + ($1 + -1 << 2) | 0; + $$1136 = 0; + $indvars$iv = $scevgep; + while (1) { + if (($$1136 | 0) >= ($1 | 0)) break; + $13 = $0 + ((Math_imul($$1136, $2) | 0) << 2) | 0; + $$0130 = 0.0; + $$0131 = $13; + $$0133 = -1; + $$0142 = $$1136; + while (1) { + if (($$0142 | 0) == ($1 | 0)) break; + $15 = +Math_abs(+(+HEAPF32[$$0131 >> 2])); + $16 = $$0130 < $15; + $$0130 = $16 ? $15 : $$0130; + $$0131 = $$0131 + ($2 << 2) | 0; + $$0133 = $16 ? $$0142 : $$0133; + $$0142 = $$0142 + 1 | 0; + } + if (($$0133 | 0) == -1 | $$0130 <= 1.000000013351432e-10) { + $$0 = 0; + break L1; + } + $21 = $3 + ($$0133 << 2) | 0; + $22 = HEAP32[$21 >> 2] | 0; + $23 = $3 + ($$1136 << 2) | 0; + HEAP32[$21 >> 2] = HEAP32[$23 >> 2]; + HEAP32[$23 >> 2] = $22; + $$0138 = 0; + $$0145 = $13; + $$1132 = $0 + ((Math_imul($$0133, $2) | 0) << 2) | 0; + while (1) { + if (($$0138 | 0) == ($1 | 0)) break; + $27 = HEAP32[$$1132 >> 2] | 0; + HEAP32[$$1132 >> 2] = HEAP32[$$0145 >> 2]; + HEAP32[$$0145 >> 2] = $27; + $$0138 = $$0138 + 1 | 0; + $$0145 = $$0145 + 4 | 0; + $$1132 = $$1132 + 4 | 0; + } + $32 = +HEAPF32[$13 >> 2]; + $$1139 = 1; + $$2 = $13; + while (1) { + if (($$1139 | 0) == ($1 | 0)) break; + $33 = $$2 + 4 | 0; + HEAPF32[$$2 >> 2] = +HEAPF32[$33 >> 2] / $32; + $$1139 = $$1139 + 1 | 0; + $$2 = $33; + } + HEAPF32[$indvars$iv >> 2] = 1.0 / $32; + $$1143 = 0; + $indvars$iv154 = $scevgep; + while (1) { + if (($$1143 | 0) == ($1 | 0)) break; + if (($$1143 | 0) != ($$1136 | 0)) { + $40 = $0 + ((Math_imul($$1143, $2) | 0) << 2) | 0; + $41 = +HEAPF32[$40 >> 2]; + $$1146 = $13; + $$2140 = 1; + $$3 = $40; + while (1) { + if (($$2140 | 0) == ($1 | 0)) break; + $42 = $$3 + 4 | 0; + HEAPF32[$$3 >> 2] = +HEAPF32[$42 >> 2] - $41 * +HEAPF32[$$1146 >> 2]; + $$1146 = $$1146 + 4 | 0; + $$2140 = $$2140 + 1 | 0; + $$3 = $42; + } + HEAPF32[$indvars$iv154 >> 2] = -($41 * +HEAPF32[$indvars$iv >> 2]); + } + $$1143 = $$1143 + 1 | 0; + $indvars$iv154 = $indvars$iv154 + ($2 << 2) | 0; + } + $$1136 = $$1136 + 1 | 0; + $indvars$iv = $indvars$iv + ($2 << 2) | 0; + } + $$2137 = 0; + while (1) { + if (($$2137 | 0) >= ($1 | 0)) { + $$0 = $0; + break L1; + } + $$3141 = $$2137; + while (1) { + $56 = $3 + ($$3141 << 2) | 0; + if (($$3141 | 0) >= ($1 | 0)) break; + if ((HEAP32[$56 >> 2] | 0) == ($$2137 | 0)) break; + $$3141 = $$3141 + 1 | 0; + } + HEAP32[$56 >> 2] = HEAP32[$3 + ($$2137 << 2) >> 2]; + $$2144 = 0; + $$2147 = $0 + ($$2137 << 2) | 0; + $$4 = $0 + ($$3141 << 2) | 0; + while (1) { + if (($$2144 | 0) >= ($1 | 0)) break; + $65 = HEAP32[$$4 >> 2] | 0; + HEAP32[$$4 >> 2] = HEAP32[$$2147 >> 2]; + HEAP32[$$2147 >> 2] = $65; + $$2144 = $$2144 + 1 | 0; + $$2147 = $$2147 + ($2 << 2) | 0; + $$4 = $$4 + ($2 << 2) | 0; + } + $$2137 = $$2137 + 1 | 0; + } + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNSt3__213unordered_mapIiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS4_EEEENS_4hashIiEENS_8equal_toIiEENS5_INS_4pairIKiS7_EEEEEixERSD_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i = 0, $$053$i = 0, $$054$i = 0, $$1$i = 0, $$155$i = 0, $$pn$i = 0, $$pre$phi$iZ2D = 0, $11 = 0, $17 = 0, $18 = 0, $2 = 0, $22 = 0, $28 = 0, $3 = 0, $32 = 0, $35 = 0.0, $38 = 0.0, $4 = 0, $48 = 0, $5 = 0, $51 = 0, $53 = 0, $54 = 0, $6 = 0, $62 = 0, $64 = 0, $7 = 0, $70 = 0, $71 = 0, $74 = 0, $75 = 0, $8 = 0, $83 = 0, $87 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp + 4 | 0; + $3 = sp; + $4 = sp + 16 | 0; + HEAP32[$3 >> 2] = $1; + $5 = HEAP32[$1 >> 2] | 0; + $6 = $0 + 4 | 0; + $7 = HEAP32[$6 >> 2] | 0; + $8 = ($7 | 0) == 0; + L1 : do if (!$8) { + $9 = $7 + -1 | 0; + $11 = ($9 & $7 | 0) == 0; + if (!$11) if ($5 >>> 0 < $7 >>> 0) $17 = $5; else $17 = ($5 >>> 0) % ($7 >>> 0) | 0; else $17 = $9 & $5; + $18 = HEAP32[(HEAP32[$0 >> 2] | 0) + ($17 << 2) >> 2] | 0; + if (!$18) { + $$054$i = $17; + label = 16; + } else { + $$pn$i = $18; + while (1) { + $$053$i = HEAP32[$$pn$i >> 2] | 0; + if (!$$053$i) { + $$054$i = $17; + label = 16; + break L1; + } + $22 = HEAP32[$$053$i + 4 >> 2] | 0; + if (($22 | 0) != ($5 | 0)) { + if (!$11) if ($22 >>> 0 < $7 >>> 0) $28 = $22; else $28 = ($22 >>> 0) % ($7 >>> 0) | 0; else $28 = $22 & $9; + if (($28 | 0) != ($17 | 0)) { + $$054$i = $17; + label = 16; + break L1; + } + } + if ((HEAP32[$$053$i + 8 >> 2] | 0) == ($5 | 0)) { + $$1$i = $$053$i; + break; + } else $$pn$i = $$053$i; + } + } + } else { + $$054$i = 0; + label = 16; + } while (0); + if ((label | 0) == 16) { + __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS5_EEEEEENS_22__unordered_map_hasherIiS9_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS9_NS_8equal_toIiEELb1EEENS6_IS9_EEE21__construct_node_hashIRKNS_21piecewise_construct_tEJNS_5tupleIJRKiEEENSO_IJEEEEEENS_10unique_ptrINS_11__hash_nodeIS9_PvEENS_22__hash_node_destructorINS6_ISW_EEEEEEmOT_DpOT0_($2, $0, $5, 67436, $3, $4); + $32 = $0 + 12 | 0; + $35 = +(((HEAP32[$32 >> 2] | 0) + 1 | 0) >>> 0); + $38 = +HEAPF32[$0 + 16 >> 2]; + do if ($8 | $38 * +($7 >>> 0) < $35) { + $48 = $7 << 1 | ($7 >>> 0 < 3 | ($7 + -1 & $7 | 0) != 0) & 1; + $51 = ~~+Math_ceil(+($35 / $38)) >>> 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS5_EEEEEENS_22__unordered_map_hasherIiS9_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS9_NS_8equal_toIiEELb1EEENS6_IS9_EEE6rehashEm($0, $48 >>> 0 < $51 >>> 0 ? $51 : $48); + $53 = HEAP32[$6 >> 2] | 0; + $54 = $53 + -1 | 0; + if (!($54 & $53)) { + $$0$i = $53; + $$155$i = $54 & $5; + break; + } + if ($5 >>> 0 < $53 >>> 0) { + $$0$i = $53; + $$155$i = $5; + } else { + $$0$i = $53; + $$155$i = ($5 >>> 0) % ($53 >>> 0) | 0; + } + } else { + $$0$i = $7; + $$155$i = $$054$i; + } while (0); + $62 = HEAP32[(HEAP32[$0 >> 2] | 0) + ($$155$i << 2) >> 2] | 0; + if (!$62) { + $64 = $0 + 8 | 0; + HEAP32[HEAP32[$2 >> 2] >> 2] = HEAP32[$64 >> 2]; + HEAP32[$64 >> 2] = HEAP32[$2 >> 2]; + HEAP32[(HEAP32[$0 >> 2] | 0) + ($$155$i << 2) >> 2] = $64; + $70 = HEAP32[$2 >> 2] | 0; + $71 = HEAP32[$70 >> 2] | 0; + if (!$71) $$pre$phi$iZ2D = $2; else { + $74 = HEAP32[$71 + 4 >> 2] | 0; + $75 = $$0$i + -1 | 0; + if ($75 & $$0$i) if ($74 >>> 0 < $$0$i >>> 0) $83 = $74; else $83 = ($74 >>> 0) % ($$0$i >>> 0) | 0; else $83 = $74 & $75; + HEAP32[(HEAP32[$0 >> 2] | 0) + ($83 << 2) >> 2] = $70; + $$pre$phi$iZ2D = $2; + } + } else { + HEAP32[HEAP32[$2 >> 2] >> 2] = HEAP32[$62 >> 2]; + HEAP32[$62 >> 2] = HEAP32[$2 >> 2]; + $$pre$phi$iZ2D = $2; + } + $87 = HEAP32[$$pre$phi$iZ2D >> 2] | 0; + HEAP32[$32 >> 2] = (HEAP32[$32 >> 2] | 0) + 1; + HEAP32[$$pre$phi$iZ2D >> 2] = 0; + $$1$i = $87; + } + STACKTOP = sp; + return $$1$i + 12 | 0; +} + +function __ZNSt3__213unordered_mapIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEENS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS5_EEEEEixERSC_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i = 0, $$053$i = 0, $$054$i = 0, $$1$i = 0, $$155$i = 0, $$pn$i = 0, $$pre$phi$iZ2D = 0, $11 = 0, $17 = 0, $18 = 0, $2 = 0, $22 = 0, $28 = 0, $3 = 0, $32 = 0, $35 = 0.0, $38 = 0.0, $4 = 0, $48 = 0, $5 = 0, $51 = 0, $53 = 0, $54 = 0, $6 = 0, $62 = 0, $64 = 0, $7 = 0, $70 = 0, $71 = 0, $74 = 0, $75 = 0, $8 = 0, $83 = 0, $87 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp + 4 | 0; + $3 = sp; + $4 = sp + 16 | 0; + HEAP32[$3 >> 2] = $1; + $5 = HEAP32[$1 >> 2] | 0; + $6 = $0 + 4 | 0; + $7 = HEAP32[$6 >> 2] | 0; + $8 = ($7 | 0) == 0; + L1 : do if (!$8) { + $9 = $7 + -1 | 0; + $11 = ($9 & $7 | 0) == 0; + if (!$11) if ($5 >>> 0 < $7 >>> 0) $17 = $5; else $17 = ($5 >>> 0) % ($7 >>> 0) | 0; else $17 = $9 & $5; + $18 = HEAP32[(HEAP32[$0 >> 2] | 0) + ($17 << 2) >> 2] | 0; + if (!$18) { + $$054$i = $17; + label = 16; + } else { + $$pn$i = $18; + while (1) { + $$053$i = HEAP32[$$pn$i >> 2] | 0; + if (!$$053$i) { + $$054$i = $17; + label = 16; + break L1; + } + $22 = HEAP32[$$053$i + 4 >> 2] | 0; + if (($22 | 0) != ($5 | 0)) { + if (!$11) if ($22 >>> 0 < $7 >>> 0) $28 = $22; else $28 = ($22 >>> 0) % ($7 >>> 0) | 0; else $28 = $22 & $9; + if (($28 | 0) != ($17 | 0)) { + $$054$i = $17; + label = 16; + break L1; + } + } + if ((HEAP32[$$053$i + 8 >> 2] | 0) == ($5 | 0)) { + $$1$i = $$053$i; + break; + } else $$pn$i = $$053$i; + } + } + } else { + $$054$i = 0; + label = 16; + } while (0); + if ((label | 0) == 16) { + __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEEEENS_22__unordered_map_hasherIiS7_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS7_NS_8equal_toIiEELb1EEENS_9allocatorIS7_EEE21__construct_node_hashIRKNS_21piecewise_construct_tEJNS_5tupleIJRKiEEENSN_IJEEEEEENS_10unique_ptrINS_11__hash_nodeIS7_PvEENS_22__hash_node_destructorINSG_ISV_EEEEEEmOT_DpOT0_($2, $0, $5, 67436, $3, $4); + $32 = $0 + 12 | 0; + $35 = +(((HEAP32[$32 >> 2] | 0) + 1 | 0) >>> 0); + $38 = +HEAPF32[$0 + 16 >> 2]; + do if ($8 | $38 * +($7 >>> 0) < $35) { + $48 = $7 << 1 | ($7 >>> 0 < 3 | ($7 + -1 & $7 | 0) != 0) & 1; + $51 = ~~+Math_ceil(+($35 / $38)) >>> 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEEEENS_22__unordered_map_hasherIiS7_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS7_NS_8equal_toIiEELb1EEENS_9allocatorIS7_EEE6rehashEm($0, $48 >>> 0 < $51 >>> 0 ? $51 : $48); + $53 = HEAP32[$6 >> 2] | 0; + $54 = $53 + -1 | 0; + if (!($54 & $53)) { + $$0$i = $53; + $$155$i = $54 & $5; + break; + } + if ($5 >>> 0 < $53 >>> 0) { + $$0$i = $53; + $$155$i = $5; + } else { + $$0$i = $53; + $$155$i = ($5 >>> 0) % ($53 >>> 0) | 0; + } + } else { + $$0$i = $7; + $$155$i = $$054$i; + } while (0); + $62 = HEAP32[(HEAP32[$0 >> 2] | 0) + ($$155$i << 2) >> 2] | 0; + if (!$62) { + $64 = $0 + 8 | 0; + HEAP32[HEAP32[$2 >> 2] >> 2] = HEAP32[$64 >> 2]; + HEAP32[$64 >> 2] = HEAP32[$2 >> 2]; + HEAP32[(HEAP32[$0 >> 2] | 0) + ($$155$i << 2) >> 2] = $64; + $70 = HEAP32[$2 >> 2] | 0; + $71 = HEAP32[$70 >> 2] | 0; + if (!$71) $$pre$phi$iZ2D = $2; else { + $74 = HEAP32[$71 + 4 >> 2] | 0; + $75 = $$0$i + -1 | 0; + if ($75 & $$0$i) if ($74 >>> 0 < $$0$i >>> 0) $83 = $74; else $83 = ($74 >>> 0) % ($$0$i >>> 0) | 0; else $83 = $74 & $75; + HEAP32[(HEAP32[$0 >> 2] | 0) + ($83 << 2) >> 2] = $70; + $$pre$phi$iZ2D = $2; + } + } else { + HEAP32[HEAP32[$2 >> 2] >> 2] = HEAP32[$62 >> 2]; + HEAP32[$62 >> 2] = HEAP32[$2 >> 2]; + $$pre$phi$iZ2D = $2; + } + $87 = HEAP32[$$pre$phi$iZ2D >> 2] | 0; + HEAP32[$32 >> 2] = (HEAP32[$32 >> 2] | 0) + 1; + HEAP32[$$pre$phi$iZ2D >> 2] = 0; + $$1$i = $87; + } + STACKTOP = sp; + return $$1$i + 12 | 0; +} + +function _minv($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$0128 = 0.0, $$0129 = 0, $$0131 = 0, $$0133 = 0, $$0136 = 0, $$0140 = 0, $$0143 = 0, $$1130 = 0, $$1134 = 0, $$1137 = 0, $$1141 = 0, $$1144 = 0, $$2 = 0, $$2135 = 0, $$2138 = 0, $$2142 = 0, $$2145 = 0, $$3 = 0, $$3139 = 0, $$4 = 0, $13 = 0, $15 = 0.0, $16 = 0, $21 = 0, $22 = 0, $23 = 0, $27 = 0.0, $3 = 0, $32 = 0.0, $33 = 0, $40 = 0, $41 = 0.0, $42 = 0, $56 = 0, $65 = 0.0, $indvars$iv = 0, $indvars$iv152 = 0, $scevgep = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 2e3 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(2e3); + $3 = sp; + L1 : do if (($1 | 0) > 500) $$0 = 0; else { + switch ($1 | 0) { + case 0: + { + $$0 = 0; + break L1; + break; + } + case 1: + { + HEAPF64[$0 >> 3] = 1.0 / +HEAPF64[$0 >> 3]; + $$0 = $0; + break L1; + break; + } + default: + {} + } + $$0133 = 0; + while (1) { + if (($$0133 | 0) >= ($1 | 0)) break; + HEAP32[$3 + ($$0133 << 2) >> 2] = $$0133; + $$0133 = $$0133 + 1 | 0; + } + $scevgep = $0 + ($1 + -1 << 3) | 0; + $$1134 = 0; + $indvars$iv = $scevgep; + while (1) { + if (($$1134 | 0) >= ($1 | 0)) break; + $13 = $0 + ((Math_imul($$1134, $2) | 0) << 3) | 0; + $$0128 = 0.0; + $$0129 = $13; + $$0131 = -1; + $$0140 = $$1134; + while (1) { + if (($$0140 | 0) == ($1 | 0)) break; + $15 = +Math_abs(+(+HEAPF64[$$0129 >> 3])); + $16 = $$0128 < $15; + $$0128 = $16 ? $15 : $$0128; + $$0129 = $$0129 + ($2 << 3) | 0; + $$0131 = $16 ? $$0140 : $$0131; + $$0140 = $$0140 + 1 | 0; + } + if (($$0131 | 0) == -1 | $$0128 <= 1.0e-10) { + $$0 = 0; + break L1; + } + $21 = $3 + ($$0131 << 2) | 0; + $22 = HEAP32[$21 >> 2] | 0; + $23 = $3 + ($$1134 << 2) | 0; + HEAP32[$21 >> 2] = HEAP32[$23 >> 2]; + HEAP32[$23 >> 2] = $22; + $$0136 = 0; + $$0143 = $13; + $$1130 = $0 + ((Math_imul($$0131, $2) | 0) << 3) | 0; + while (1) { + if (($$0136 | 0) == ($1 | 0)) break; + $27 = +HEAPF64[$$1130 >> 3]; + HEAPF64[$$1130 >> 3] = +HEAPF64[$$0143 >> 3]; + HEAPF64[$$0143 >> 3] = $27; + $$0136 = $$0136 + 1 | 0; + $$0143 = $$0143 + 8 | 0; + $$1130 = $$1130 + 8 | 0; + } + $32 = +HEAPF64[$13 >> 3]; + $$1137 = 1; + $$2 = $13; + while (1) { + if (($$1137 | 0) == ($1 | 0)) break; + $33 = $$2 + 8 | 0; + HEAPF64[$$2 >> 3] = +HEAPF64[$33 >> 3] / $32; + $$1137 = $$1137 + 1 | 0; + $$2 = $33; + } + HEAPF64[$indvars$iv >> 3] = 1.0 / $32; + $$1141 = 0; + $indvars$iv152 = $scevgep; + while (1) { + if (($$1141 | 0) == ($1 | 0)) break; + if (($$1141 | 0) != ($$1134 | 0)) { + $40 = $0 + ((Math_imul($$1141, $2) | 0) << 3) | 0; + $41 = +HEAPF64[$40 >> 3]; + $$1144 = $13; + $$2138 = 1; + $$3 = $40; + while (1) { + if (($$2138 | 0) == ($1 | 0)) break; + $42 = $$3 + 8 | 0; + HEAPF64[$$3 >> 3] = +HEAPF64[$42 >> 3] - $41 * +HEAPF64[$$1144 >> 3]; + $$1144 = $$1144 + 8 | 0; + $$2138 = $$2138 + 1 | 0; + $$3 = $42; + } + HEAPF64[$indvars$iv152 >> 3] = -($41 * +HEAPF64[$indvars$iv >> 3]); + } + $$1141 = $$1141 + 1 | 0; + $indvars$iv152 = $indvars$iv152 + ($2 << 3) | 0; + } + $$1134 = $$1134 + 1 | 0; + $indvars$iv = $indvars$iv + ($2 << 3) | 0; + } + $$2135 = 0; + while (1) { + if (($$2135 | 0) >= ($1 | 0)) { + $$0 = $0; + break L1; + } + $$3139 = $$2135; + while (1) { + $56 = $3 + ($$3139 << 2) | 0; + if (($$3139 | 0) >= ($1 | 0)) break; + if ((HEAP32[$56 >> 2] | 0) == ($$2135 | 0)) break; + $$3139 = $$3139 + 1 | 0; + } + HEAP32[$56 >> 2] = HEAP32[$3 + ($$2135 << 2) >> 2]; + $$2142 = 0; + $$2145 = $0 + ($$2135 << 3) | 0; + $$4 = $0 + ($$3139 << 3) | 0; + while (1) { + if (($$2142 | 0) >= ($1 | 0)) break; + $65 = +HEAPF64[$$4 >> 3]; + HEAPF64[$$4 >> 3] = +HEAPF64[$$2145 >> 3]; + HEAPF64[$$2145 >> 3] = $65; + $$2142 = $$2142 + 1 | 0; + $$2145 = $$2145 + ($2 << 3) | 0; + $$4 = $$4 + ($2 << 3) | 0; + } + $$2135 = $$2135 + 1 | 0; + } + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseVectorTypeEv($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$2 = 0, $$3 = 0, $$4 = 0, $$5 = 0, $$byval_copy = 0, $1 = 0, $10 = 0, $14 = 0, $15 = 0, $18 = 0, $2 = 0, $22 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp + 16 | 0; + $1 = sp + 8 | 0; + $2 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($1, 55972); + HEAP32[$$byval_copy >> 2] = HEAP32[$1 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$1 + 4 >> 2]; + do if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy) | 0) { + if (((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) + -49 & 255) < 9) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E11parseNumberEb($$byval_copy, $0, 0); + do if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 112) | 0) { + $$1 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_15PixelVectorTypeEJRNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $$byval_copy) | 0; + break; + } + $10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$2 >> 2] = $10; + if (!$10) $$0 = 0; else $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10VectorTypeEJRPNS0_4NodeERNS_10StringViewEEEES9_DpOT0_($0, $2, $$byval_copy) | 0; + $$1 = $$0; + } else $$1 = 0; while (0); + $$5 = $$1; + break; + } + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) { + $22 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy >> 2] = $22; + if (!$22) $$4 = 0; else { + __ZN12_GLOBAL__N_110StringViewC2Ev($2); + $$4 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10VectorTypeEJRPNS0_4NodeENS_10StringViewEEEES9_DpOT0_($0, $$byval_copy, $2) | 0; + } + $$5 = $$4; + break; + } + $14 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $15 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($14) | 0; + HEAP32[$$byval_copy >> 2] = $15; + if (($15 | 0) != 0 ? __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0 : 0) { + $18 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($14) | 0; + HEAP32[$2 >> 2] = $18; + if (!$18) $$2 = 0; else $$2 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10VectorTypeEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $2, $$byval_copy) | 0; + $$3 = $$2; + } else $$3 = 0; + $$5 = $$3; + } else $$5 = 0; while (0); + STACKTOP = sp; + return $$5 | 0; +} + +function _ar2ReadImageSetOld($0) { + $0 = $0 | 0; + var $$0 = 0, $$089 = 0, $$091 = 0, $$1 = 0, $$190 = 0, $$2 = 0, $$3 = 0, $$4 = 0, $$5 = 0, $$6 = 0, $$7 = 0, $1 = 0, $12 = 0, $17 = 0, $3 = 0, $51 = 0, $57 = 0, $6 = 0, $60 = 0, $67 = 0, $68 = 0, $75 = 0, $9 = 0, $vararg_buffer1 = 0, $vararg_buffer3 = 0, $vararg_buffer5 = 0, $vararg_buffer7 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $vararg_buffer7 = sp + 32 | 0; + $vararg_buffer5 = sp + 24 | 0; + $vararg_buffer3 = sp + 16 | 0; + $vararg_buffer1 = sp + 8 | 0; + $1 = _malloc(8) | 0; + if (!$1) { + _arLog(0, 3, 45930, sp); + _exit(1); + } + $3 = $1 + 4 | 0; + L4 : do if ((_fread($3, 4, 1, $0) | 0) == 1 ? ($6 = HEAP32[$3 >> 2] | 0, ($6 | 0) >= 1) : 0) { + $9 = _malloc($6 << 2) | 0; + HEAP32[$1 >> 2] = $9; + if (!$9) { + _arLog(0, 3, 45930, $vararg_buffer3); + _exit(1); + } + $$089 = 0; + while (1) { + if (($$089 | 0) >= ($6 | 0)) break; + $12 = _malloc(16) | 0; + HEAP32[$9 + ($$089 << 2) >> 2] = $12; + if (!$12) { + label = 12; + break; + } else $$089 = $$089 + 1 | 0; + } + if ((label | 0) == 12) { + _arLog(0, 3, 45930, $vararg_buffer5); + _exit(1); + } + $$190 = 0; + while (1) { + if (($$190 | 0) >= ($6 | 0)) { + label = 44; + break; + } + $17 = $9 + ($$190 << 2) | 0; + if ((_fread((HEAP32[$17 >> 2] | 0) + 4 | 0, 4, 1, $0) | 0) != 1) { + label = 15; + break; + } + if ((_fread((HEAP32[$17 >> 2] | 0) + 8 | 0, 4, 1, $0) | 0) != 1) { + label = 22; + break; + } + if ((_fread((HEAP32[$17 >> 2] | 0) + 12 | 0, 4, 1, $0) | 0) != 1) { + label = 29; + break; + } + $51 = HEAP32[$17 >> 2] | 0; + $57 = _malloc(Math_imul(HEAP32[$51 + 8 >> 2] | 0, HEAP32[$51 + 4 >> 2] | 0) | 0) | 0; + HEAP32[HEAP32[$17 >> 2] >> 2] = $57; + if (!$57) { + label = 36; + break; + } + $60 = HEAP32[$17 >> 2] | 0; + $67 = _fread(HEAP32[$60 >> 2] | 0, 1, Math_imul(HEAP32[$60 + 8 >> 2] | 0, HEAP32[$60 + 4 >> 2] | 0) | 0, $0) | 0; + $68 = HEAP32[$17 >> 2] | 0; + $75 = $$190 + 1 | 0; + if (($67 | 0) == (Math_imul(HEAP32[$68 + 8 >> 2] | 0, HEAP32[$68 + 4 >> 2] | 0) | 0)) $$190 = $75; else { + label = 38; + break; + } + } + L23 : do if ((label | 0) == 15) { + $$0 = 0; + while (1) { + if (($$0 | 0) == ($$190 | 0)) break; + _free(HEAP32[HEAP32[$9 + ($$0 << 2) >> 2] >> 2] | 0); + $$0 = $$0 + 1 | 0; + } + $$1 = 0; + while (1) { + if (($$1 | 0) == ($6 | 0)) break L23; + _free(HEAP32[$9 + ($$1 << 2) >> 2] | 0); + $$1 = $$1 + 1 | 0; + } + } else if ((label | 0) == 22) { + $$2 = 0; + while (1) { + if (($$2 | 0) == ($$190 | 0)) break; + _free(HEAP32[HEAP32[$9 + ($$2 << 2) >> 2] >> 2] | 0); + $$2 = $$2 + 1 | 0; + } + $$3 = 0; + while (1) { + if (($$3 | 0) == ($6 | 0)) break L23; + _free(HEAP32[$9 + ($$3 << 2) >> 2] | 0); + $$3 = $$3 + 1 | 0; + } + } else if ((label | 0) == 29) { + $$4 = 0; + while (1) { + if (($$4 | 0) == ($$190 | 0)) break; + _free(HEAP32[HEAP32[$9 + ($$4 << 2) >> 2] >> 2] | 0); + $$4 = $$4 + 1 | 0; + } + $$5 = 0; + while (1) { + if (($$5 | 0) == ($6 | 0)) break L23; + _free(HEAP32[$9 + ($$5 << 2) >> 2] | 0); + $$5 = $$5 + 1 | 0; + } + } else if ((label | 0) == 36) { + _arLog(0, 3, 45930, $vararg_buffer7); + _exit(1); + } else if ((label | 0) == 38) { + $$6 = 0; + while (1) { + if (($$6 | 0) == ($75 | 0)) break; + _free(HEAP32[HEAP32[$9 + ($$6 << 2) >> 2] >> 2] | 0); + $$6 = $$6 + 1 | 0; + } + $$7 = 0; + while (1) { + if (($$7 | 0) == ($6 | 0)) break L23; + _free(HEAP32[$9 + ($$7 << 2) >> 2] | 0); + $$7 = $$7 + 1 | 0; + } + } else if ((label | 0) == 44) { + _fclose($0) | 0; + $$091 = $1; + break L4; + } while (0); + _free($9); + label = 46; + } else label = 5; while (0); + if ((label | 0) == 5) { + _arLog(0, 3, 25715, $vararg_buffer1); + label = 46; + } + if ((label | 0) == 46) { + _free($1); + _fclose($0) | 0; + $$091 = 0; + } + STACKTOP = sp; + return $$091 | 0; +} + +function _arParamDecompMat($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$0117 = 0, $$1 = 0, $$1118 = 0, $$2 = 0, $$2119 = 0, $$3 = 0, $$3120 = 0, $101 = 0.0, $102 = 0.0, $113 = 0.0, $117 = 0.0, $131 = 0, $22 = 0.0, $24 = 0.0, $26 = 0.0, $27 = 0.0, $28 = 0, $29 = 0.0, $3 = 0, $30 = 0, $32 = 0.0, $33 = 0, $35 = 0.0, $36 = 0, $41 = 0, $43 = 0.0, $45 = 0.0, $47 = 0.0, $48 = 0.0, $49 = 0, $52 = 0.0, $55 = 0.0, $58 = 0.0, $59 = 0.0, $60 = 0, $62 = 0, $65 = 0, $68 = 0, $72 = 0.0, $74 = 0.0, $76 = 0.0, $77 = 0.0, $78 = 0, $82 = 0.0, $83 = 0, $89 = 0.0, $95 = 0.0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 96 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(96); + $3 = sp; + L1 : do if (!(+HEAPF64[$0 + 88 >> 3] >= 0.0)) { + $$1 = 0; + while (1) { + if (($$1 | 0) == 3) break L1; + $$1118 = 0; + while (1) { + if (($$1118 | 0) == 4) break; + HEAPF64[$3 + ($$1 << 5) + ($$1118 << 3) >> 3] = -+HEAPF64[$0 + ($$1 << 5) + ($$1118 << 3) >> 3]; + $$1118 = $$1118 + 1 | 0; + } + $$1 = $$1 + 1 | 0; + } + } else { + $$0 = 0; + while (1) { + if (($$0 | 0) == 3) break L1; + $$0117 = 0; + while (1) { + if (($$0117 | 0) == 4) break; + HEAPF64[$3 + ($$0 << 5) + ($$0117 << 3) >> 3] = +HEAPF64[$0 + ($$0 << 5) + ($$0117 << 3) >> 3]; + $$0117 = $$0117 + 1 | 0; + } + $$0 = $$0 + 1 | 0; + } + } while (0); + $$2 = 0; + while (1) { + if (($$2 | 0) == 3) break; + $$2119 = 0; + while (1) { + if (($$2119 | 0) == 4) break; + HEAPF64[$1 + ($$2 << 5) + ($$2119 << 3) >> 3] = 0.0; + $$2119 = $$2119 + 1 | 0; + } + $$2 = $$2 + 1 | 0; + } + $22 = +HEAPF64[$3 + 64 >> 3]; + $24 = +HEAPF64[$3 + 72 >> 3]; + $26 = +HEAPF64[$3 + 80 >> 3]; + $27 = +_norm($22, $24, $26); + $28 = $1 + 80 | 0; + HEAPF64[$28 >> 3] = $27; + $29 = $22 / $27; + $30 = $2 + 64 | 0; + HEAPF64[$30 >> 3] = $29; + $32 = $24 / +HEAPF64[$28 >> 3]; + $33 = $2 + 72 | 0; + HEAPF64[$33 >> 3] = $32; + $35 = $26 / +HEAPF64[$28 >> 3]; + $36 = $2 + 80 | 0; + HEAPF64[$36 >> 3] = $35; + $41 = $2 + 88 | 0; + HEAPF64[$41 >> 3] = +HEAPF64[$3 + 88 >> 3] / +HEAPF64[$28 >> 3]; + $43 = +HEAPF64[$3 + 32 >> 3]; + $45 = +HEAPF64[$3 + 40 >> 3]; + $47 = +HEAPF64[$3 + 48 >> 3]; + $48 = +_dot($29, $32, $35, $43, $45, $47); + $49 = $1 + 48 | 0; + HEAPF64[$49 >> 3] = $48; + $52 = $43 - $48 * +HEAPF64[$30 >> 3]; + $55 = $45 - $48 * +HEAPF64[$33 >> 3]; + $58 = $47 - $48 * +HEAPF64[$36 >> 3]; + $59 = +_norm($52, $55, $58); + $60 = $1 + 40 | 0; + HEAPF64[$60 >> 3] = $59; + $62 = $2 + 32 | 0; + HEAPF64[$62 >> 3] = $52 / $59; + $65 = $2 + 40 | 0; + HEAPF64[$65 >> 3] = $55 / +HEAPF64[$60 >> 3]; + $68 = $2 + 48 | 0; + HEAPF64[$68 >> 3] = $58 / +HEAPF64[$60 >> 3]; + $72 = +HEAPF64[$3 >> 3]; + $74 = +HEAPF64[$3 + 8 >> 3]; + $76 = +HEAPF64[$3 + 16 >> 3]; + $77 = +_dot(+HEAPF64[$30 >> 3], +HEAPF64[$33 >> 3], +HEAPF64[$36 >> 3], $72, $74, $76); + $78 = $1 + 16 | 0; + HEAPF64[$78 >> 3] = $77; + $82 = +_dot(+HEAPF64[$62 >> 3], +HEAPF64[$65 >> 3], +HEAPF64[$68 >> 3], $72, $74, $76); + $83 = $1 + 8 | 0; + HEAPF64[$83 >> 3] = $82; + $89 = $72 - $82 * +HEAPF64[$62 >> 3] - $77 * +HEAPF64[$30 >> 3]; + $95 = $74 - $82 * +HEAPF64[$65 >> 3] - $77 * +HEAPF64[$33 >> 3]; + $101 = $76 - $82 * +HEAPF64[$68 >> 3] - $77 * +HEAPF64[$36 >> 3]; + $102 = +_norm($89, $95, $101); + HEAPF64[$1 >> 3] = $102; + HEAPF64[$2 >> 3] = $89 / $102; + HEAPF64[$2 + 8 >> 3] = $95 / +HEAPF64[$1 >> 3]; + HEAPF64[$2 + 16 >> 3] = $101 / +HEAPF64[$1 >> 3]; + $113 = +HEAPF64[$41 >> 3]; + $117 = (+HEAPF64[$3 + 56 >> 3] - +HEAPF64[$49 >> 3] * $113) / +HEAPF64[$60 >> 3]; + HEAPF64[$2 + 56 >> 3] = $117; + HEAPF64[$2 + 24 >> 3] = (+HEAPF64[$3 + 24 >> 3] - $117 * +HEAPF64[$83 >> 3] - $113 * +HEAPF64[$78 >> 3]) / +HEAPF64[$1 >> 3]; + $$3 = 0; + while (1) { + if (($$3 | 0) == 3) break; + $$3120 = 0; + while (1) { + if (($$3120 | 0) == 3) break; + $131 = $1 + ($$3 << 5) + ($$3120 << 3) | 0; + HEAPF64[$131 >> 3] = +HEAPF64[$131 >> 3] / +HEAPF64[$28 >> 3]; + $$3120 = $$3120 + 1 | 0; + } + $$3 = $$3 + 1 | 0; + } + STACKTOP = sp; + return 0; +} + +function __ZNSt3__213unordered_mapIiNS_6vectorIiNS_9allocatorIiEEEENS_4hashIiEENS_8equal_toIiEENS2_INS_4pairIKiS4_EEEEEixERSA_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i = 0, $$053$i = 0, $$054$i = 0, $$1$i = 0, $$155$i = 0, $$pn$i = 0, $$pre$phi$iZ2D = 0, $11 = 0, $17 = 0, $18 = 0, $2 = 0, $22 = 0, $28 = 0, $3 = 0, $32 = 0, $35 = 0.0, $38 = 0.0, $4 = 0, $48 = 0, $5 = 0, $51 = 0, $53 = 0, $54 = 0, $6 = 0, $62 = 0, $64 = 0, $7 = 0, $70 = 0, $71 = 0, $74 = 0, $75 = 0, $8 = 0, $83 = 0, $87 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp + 4 | 0; + $3 = sp; + $4 = sp + 16 | 0; + HEAP32[$3 >> 2] = $1; + $5 = HEAP32[$1 >> 2] | 0; + $6 = $0 + 4 | 0; + $7 = HEAP32[$6 >> 2] | 0; + $8 = ($7 | 0) == 0; + L1 : do if (!$8) { + $9 = $7 + -1 | 0; + $11 = ($9 & $7 | 0) == 0; + if (!$11) if ($5 >>> 0 < $7 >>> 0) $17 = $5; else $17 = ($5 >>> 0) % ($7 >>> 0) | 0; else $17 = $9 & $5; + $18 = HEAP32[(HEAP32[$0 >> 2] | 0) + ($17 << 2) >> 2] | 0; + if (!$18) { + $$054$i = $17; + label = 16; + } else { + $$pn$i = $18; + while (1) { + $$053$i = HEAP32[$$pn$i >> 2] | 0; + if (!$$053$i) { + $$054$i = $17; + label = 16; + break L1; + } + $22 = HEAP32[$$053$i + 4 >> 2] | 0; + if (($22 | 0) != ($5 | 0)) { + if (!$11) if ($22 >>> 0 < $7 >>> 0) $28 = $22; else $28 = ($22 >>> 0) % ($7 >>> 0) | 0; else $28 = $22 & $9; + if (($28 | 0) != ($17 | 0)) { + $$054$i = $17; + label = 16; + break L1; + } + } + if ((HEAP32[$$053$i + 8 >> 2] | 0) == ($5 | 0)) { + $$1$i = $$053$i; + break; + } else $$pn$i = $$053$i; + } + } + } else { + $$054$i = 0; + label = 16; + } while (0); + if ((label | 0) == 16) { + __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIiNS_9allocatorIiEEEEEENS_22__unordered_map_hasherIiS6_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS6_NS_8equal_toIiEELb1EEENS3_IS6_EEE21__construct_node_hashIRKNS_21piecewise_construct_tEJNS_5tupleIJRKiEEENSL_IJEEEEEENS_10unique_ptrINS_11__hash_nodeIS6_PvEENS_22__hash_node_destructorINS3_IST_EEEEEEmOT_DpOT0_($2, $0, $5, 67436, $3, $4); + $32 = $0 + 12 | 0; + $35 = +(((HEAP32[$32 >> 2] | 0) + 1 | 0) >>> 0); + $38 = +HEAPF32[$0 + 16 >> 2]; + do if ($8 | $38 * +($7 >>> 0) < $35) { + $48 = $7 << 1 | ($7 >>> 0 < 3 | ($7 + -1 & $7 | 0) != 0) & 1; + $51 = ~~+Math_ceil(+($35 / $38)) >>> 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIiNS_9allocatorIiEEEEEENS_22__unordered_map_hasherIiS6_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS6_NS_8equal_toIiEELb1EEENS3_IS6_EEE6rehashEm($0, $48 >>> 0 < $51 >>> 0 ? $51 : $48); + $53 = HEAP32[$6 >> 2] | 0; + $54 = $53 + -1 | 0; + if (!($54 & $53)) { + $$0$i = $53; + $$155$i = $54 & $5; + break; + } + if ($5 >>> 0 < $53 >>> 0) { + $$0$i = $53; + $$155$i = $5; + } else { + $$0$i = $53; + $$155$i = ($5 >>> 0) % ($53 >>> 0) | 0; + } + } else { + $$0$i = $7; + $$155$i = $$054$i; + } while (0); + $62 = HEAP32[(HEAP32[$0 >> 2] | 0) + ($$155$i << 2) >> 2] | 0; + if (!$62) { + $64 = $0 + 8 | 0; + HEAP32[HEAP32[$2 >> 2] >> 2] = HEAP32[$64 >> 2]; + HEAP32[$64 >> 2] = HEAP32[$2 >> 2]; + HEAP32[(HEAP32[$0 >> 2] | 0) + ($$155$i << 2) >> 2] = $64; + $70 = HEAP32[$2 >> 2] | 0; + $71 = HEAP32[$70 >> 2] | 0; + if (!$71) $$pre$phi$iZ2D = $2; else { + $74 = HEAP32[$71 + 4 >> 2] | 0; + $75 = $$0$i + -1 | 0; + if ($75 & $$0$i) if ($74 >>> 0 < $$0$i >>> 0) $83 = $74; else $83 = ($74 >>> 0) % ($$0$i >>> 0) | 0; else $83 = $74 & $75; + HEAP32[(HEAP32[$0 >> 2] | 0) + ($83 << 2) >> 2] = $70; + $$pre$phi$iZ2D = $2; + } + } else { + HEAP32[HEAP32[$2 >> 2] >> 2] = HEAP32[$62 >> 2]; + HEAP32[$62 >> 2] = HEAP32[$2 >> 2]; + $$pre$phi$iZ2D = $2; + } + $87 = HEAP32[$$pre$phi$iZ2D >> 2] | 0; + HEAP32[$32 >> 2] = (HEAP32[$32 >> 2] | 0) + 1; + HEAP32[$$pre$phi$iZ2D >> 2] = 0; + $$1$i = $87; + } + STACKTOP = sp; + return $$1$i + 12 | 0; +} + +function __ZN6vision10DoGPyramid7computeEPKNS_25GaussianScaleSpacePyramidE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$017 = 0, $12 = 0, $17 = 0, $2 = 0, $21 = 0, $29 = 0, $34 = 0, $38 = 0, $46 = 0, $51 = 0, $55 = 0, $56 = 0, $57 = 0, $63 = 0, $64 = 0, $65 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + if ((HEAP32[$0 + 4 >> 2] | 0) == (HEAP32[$0 >> 2] | 0)) { + $12 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 26907) | 0, 26748) | 0, 39072) | 0, 72) | 0, 39079) | 0, 26949) | 0; + __ZNKSt3__28ios_base6getlocEv($2, $12 + (HEAP32[(HEAP32[$12 >> 2] | 0) + -12 >> 2] | 0) | 0); + $17 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66512) | 0; + $21 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$17 >> 2] | 0) + 28 >> 2] & 127]($17, 10) | 0; + __ZNSt3__26localeD2Ev($2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($12, $21) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($12) | 0; + _abort(); + } + if ((__ZNK6vision25GaussianScaleSpacePyramid10numOctavesEv($1) | 0) <= 0) { + $29 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 26990) | 0, 26748) | 0, 39072) | 0, 73) | 0, 39079) | 0, 27039) | 0; + __ZNKSt3__28ios_base6getlocEv($2, $29 + (HEAP32[(HEAP32[$29 >> 2] | 0) + -12 >> 2] | 0) | 0); + $34 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66512) | 0; + $38 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$34 >> 2] | 0) + 28 >> 2] & 127]($34, 10) | 0; + __ZNSt3__26localeD2Ev($2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($29, $38) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($29) | 0; + _abort(); + } + if ($1 | 0 ? ___dynamic_cast($1, 13184, 13192, 0) | 0 : 0) { + $56 = $0 + 12 | 0; + $57 = $0 + 16 | 0; + $$017 = 0; + while (1) { + if ($$017 >>> 0 >= (HEAP32[$56 >> 2] | 0) >>> 0) break; + $$0 = 0; + while (1) { + if ($$0 >>> 0 >= (HEAP32[$57 >> 2] | 0) >>> 0) break; + $63 = __ZN6vision10DoGPyramid3getEmm($0, $$017, $$0) | 0; + $64 = __ZNK6vision25GaussianScaleSpacePyramid3getEmm($1, $$017, $$0) | 0; + $65 = $$0 + 1 | 0; + __ZN6vision10DoGPyramid25difference_image_binomialERNS_5ImageERKS1_S4_(0, $63, $64, __ZNK6vision25GaussianScaleSpacePyramid3getEmm($1, $$017, $65) | 0); + $$0 = $65; + } + $$017 = $$017 + 1 | 0; + } + STACKTOP = sp; + return; + } + $46 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 27075) | 0, 26748) | 0, 39072) | 0, 74) | 0, 39079) | 0, 27147) | 0; + __ZNKSt3__28ios_base6getlocEv($2, $46 + (HEAP32[(HEAP32[$46 >> 2] | 0) + -12 >> 2] | 0) | 0); + $51 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66512) | 0; + $55 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$51 >> 2] | 0) + 28 >> 2] & 127]($51, 10) | 0; + __ZNSt3__26localeD2Ev($2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($46, $55) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($46) | 0; + _abort(); +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseNameEPNS5_9NameStateE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$1 = 0, $$2 = 0, $$3 = 0, $$4 = 0, $11 = 0, $12 = 0, $16 = 0, $17 = 0, $2 = 0, $21 = 0, $22 = 0, $27 = 0, $28 = 0, $3 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp + 4 | 0; + $3 = sp; + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 76) | 0; + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24) { + case 78: + { + $$4 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseNestedNameEPNS5_9NameStateE(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0, $1) | 0; + break; + } + case 90: + { + $$4 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E14parseLocalNameEPNS5_9NameStateE(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0, $1) | 0; + break; + } + case 83: + { + if ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 == 116) label = 13; else { + $11 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $12 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseSubstitutionEv($11) | 0; + HEAP32[$2 >> 2] = $12; + if (($12 | 0) != 0 ? (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 == 73 : 0) { + $16 = ($1 | 0) != 0; + $17 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseTemplateArgsEb($11, $16) | 0; + HEAP32[$3 >> 2] = $17; + if (!$17) $$0 = 0; else { + if ($16) HEAP8[$1 + 1 >> 0] = 1; + $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20NameWithTemplateArgsEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $2, $3) | 0; + } + $$1 = $$0; + } else $$1 = 0; + $$4 = $$1; + } + break; + } + default: + label = 13; + } + if ((label | 0) == 13) { + $21 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $22 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseUnscopedNameEPNS5_9NameStateE($21, $1) | 0; + HEAP32[$2 >> 2] = $22; + if ($22) if ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 == 73) { + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($0 + 148 | 0, $2); + $27 = ($1 | 0) != 0; + $28 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseTemplateArgsEb($21, $27) | 0; + HEAP32[$3 >> 2] = $28; + if (!$28) $$2 = 0; else { + if ($27) HEAP8[$1 + 1 >> 0] = 1; + $$2 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20NameWithTemplateArgsEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $2, $3) | 0; + } + $$3 = $$2; + } else $$3 = $22; else $$3 = 0; + $$4 = $$3; + } + STACKTOP = sp; + return $$4 | 0; +} + +function __ZNSt3__2L13utf8_to_utf16EPKhS1_RS1_PtS3_RS3_mNS_12codecvt_modeE($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $$8 = 0, $$pre$phiZ2D = 0, $$sink = 0, $10 = 0, $104 = 0, $106 = 0, $11 = 0, $110 = 0, $113 = 0, $134 = 0, $24 = 0, $25 = 0, $27 = 0, $29 = 0, $30 = 0, $42 = 0, $48 = 0, $57 = 0, $59 = 0, $66 = 0, $75 = 0, $85 = 0, $87 = 0, $89 = 0, $95 = 0, $98 = 0; + HEAP32[$2 >> 2] = $0; + HEAP32[$5 >> 2] = $3; + if ($7 & 4) { + $10 = HEAP32[$2 >> 2] | 0; + $11 = $1; + if (((($11 - $10 | 0) > 2 ? (HEAP8[$10 >> 0] | 0) == -17 : 0) ? (HEAP8[$10 + 1 >> 0] | 0) == -69 : 0) ? (HEAP8[$10 + 2 >> 0] | 0) == -65 : 0) { + HEAP32[$2 >> 2] = $10 + 3; + $$pre$phiZ2D = $11; + } else $$pre$phiZ2D = $11; + } else $$pre$phiZ2D = $1; + $24 = $4; + L9 : while (1) { + $25 = HEAP32[$2 >> 2] | 0; + if ($25 >>> 0 >= $1 >>> 0) { + $$8 = 0; + break; + } + $27 = HEAP32[$5 >> 2] | 0; + if ($27 >>> 0 >= $4 >>> 0) { + $$8 = 1; + break; + } + $29 = HEAP8[$25 >> 0] | 0; + $30 = $29 & 255; + if ($30 >>> 0 > $6 >>> 0) { + $$8 = 2; + break; + } + do if ($29 << 24 >> 24 > -1) { + HEAP16[$27 >> 1] = $29 & 255; + $$sink = $25 + 1 | 0; + } else { + if (($29 & 255) < 194) { + $$8 = 2; + break L9; + } + if (($29 & 255) < 224) { + if (($$pre$phiZ2D - $25 | 0) < 2) { + $$8 = 1; + break L9; + } + $42 = HEAPU8[$25 + 1 >> 0] | 0; + if (($42 & 192 | 0) != 128) { + $$8 = 2; + break L9; + } + $48 = $42 & 63 | $30 << 6 & 1984; + if ($48 >>> 0 > $6 >>> 0) { + $$8 = 2; + break L9; + } + HEAP16[$27 >> 1] = $48; + $$sink = $25 + 2 | 0; + break; + } + if (($29 & 255) < 240) { + if (($$pre$phiZ2D - $25 | 0) < 3) { + $$8 = 1; + break L9; + } + $57 = HEAP8[$25 + 1 >> 0] | 0; + $59 = HEAP8[$25 + 2 >> 0] | 0; + switch ($29 << 24 >> 24) { + case -32: + { + if (($57 & -32) << 24 >> 24 != -96) { + $$8 = 2; + break L9; + } + break; + } + case -19: + { + if (($57 & -32) << 24 >> 24 != -128) { + $$8 = 2; + break L9; + } + break; + } + default: + if (($57 & -64) << 24 >> 24 != -128) { + $$8 = 2; + break L9; + } + } + $66 = $59 & 255; + if (($66 & 192 | 0) != 128) { + $$8 = 2; + break L9; + } + $75 = ($57 & 63) << 6 | $30 << 12 | $66 & 63; + if (($75 & 65535) >>> 0 > $6 >>> 0) { + $$8 = 2; + break L9; + } + HEAP16[$27 >> 1] = $75; + $$sink = $25 + 3 | 0; + break; + } + if (($29 & 255) >= 245) { + $$8 = 2; + break L9; + } + if (($$pre$phiZ2D - $25 | 0) < 4) { + $$8 = 1; + break L9; + } + $85 = HEAP8[$25 + 1 >> 0] | 0; + $87 = HEAP8[$25 + 2 >> 0] | 0; + $89 = HEAP8[$25 + 3 >> 0] | 0; + switch ($29 << 24 >> 24) { + case -16: + { + if (($85 + 112 & 255) >= 48) { + $$8 = 2; + break L9; + } + break; + } + case -12: + { + if (($85 & -16) << 24 >> 24 != -128) { + $$8 = 2; + break L9; + } + break; + } + default: + if (($85 & -64) << 24 >> 24 != -128) { + $$8 = 2; + break L9; + } + } + $95 = $87 & 255; + if (($95 & 192 | 0) != 128) { + $$8 = 2; + break L9; + } + $98 = $89 & 255; + if (($98 & 192 | 0) != 128) { + $$8 = 2; + break L9; + } + if (($24 - $27 | 0) < 4) { + $$8 = 1; + break L9; + } + $104 = $30 & 7; + $106 = $85 & 255; + $110 = $95 << 6; + $113 = $98 & 63; + if (($106 << 12 & 258048 | $104 << 18 | $110 & 4032 | $113) >>> 0 > $6 >>> 0) { + $$8 = 2; + break L9; + } + HEAP16[$27 >> 1] = $106 << 2 & 60 | $95 >>> 4 & 3 | (($106 >>> 4 & 3 | $104 << 2) << 6) + 16320 | 55296; + $134 = $27 + 2 | 0; + HEAP32[$5 >> 2] = $134; + HEAP16[$134 >> 1] = $113 | $110 & 960 | 56320; + $$sink = (HEAP32[$2 >> 2] | 0) + 4 | 0; + } while (0); + HEAP32[$2 >> 2] = $$sink; + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + 2; + } + return $$8 | 0; +} + +function __ZN6vision11PartialSortIfiEENSt3__24pairIT_T0_EEPS5_ii($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$040 = 0, $$042 = 0, $$044 = 0, $$1 = 0, $$145 = 0, $$2 = 0, $$246 = 0, $11 = 0, $16 = 0, $20 = 0, $27 = 0, $32 = 0, $36 = 0, $37 = 0, $39 = 0, $4 = 0, $40 = 0, $42 = 0.0, $43 = 0, $44 = 0, $45 = 0.0, $52 = 0, $53 = 0.0, $61 = 0, $62 = 0, $63 = 0, $70 = 0, $75 = 0, $76 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp; + if (($2 | 0) <= 0) { + $11 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 37491) | 0, 37520) | 0, 39072) | 0, 82) | 0, 39079) | 0, 37593) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $11 + (HEAP32[(HEAP32[$11 >> 2] | 0) + -12 >> 2] | 0) | 0); + $16 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $20 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$16 >> 2] | 0) + 28 >> 2] & 127]($16, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($11, $20) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($11) | 0; + _abort(); + } + if (($3 | 0) <= 0) { + $27 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 37612) | 0, 37520) | 0, 39072) | 0, 83) | 0, 39079) | 0, 37641) | 0; + __ZNKSt3__28ios_base6getlocEv($4, $27 + (HEAP32[(HEAP32[$27 >> 2] | 0) + -12 >> 2] | 0) | 0); + $32 = __ZNKSt3__26locale9use_facetERNS0_2idE($4, 66512) | 0; + $36 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$32 >> 2] | 0) + 28 >> 2] & 127]($32, 10) | 0; + __ZNSt3__26localeD2Ev($4); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($27, $36) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($27) | 0; + _abort(); + } + $37 = $3 + -1 | 0; + $39 = $1 + ($37 << 3) | 0; + $40 = $1 + ($37 << 3) + 4 | 0; + $$040 = $2 + -1 | 0; + $$042 = 0; + while (1) { + if (($$042 | 0) >= ($$040 | 0)) break; + $42 = +HEAPF32[$39 >> 2]; + $43 = HEAP32[$40 >> 2] | 0; + $$0 = $$042; + $$044 = $$040; + while (1) { + $$1 = $$0; + while (1) { + $44 = $1 + ($$1 << 3) | 0; + $45 = +HEAPF32[$44 >> 2]; + if (!($45 < $42)) { + if ($42 < $45) break; + if ((HEAP32[$1 + ($$1 << 3) + 4 >> 2] | 0) >= ($43 | 0)) break; + } + $$1 = $$1 + 1 | 0; + } + $$145 = $$044; + while (1) { + $52 = $1 + ($$145 << 3) | 0; + $53 = +HEAPF32[$52 >> 2]; + if (!($42 < $53)) { + if ($53 < $42) break; + if (($43 | 0) >= (HEAP32[$1 + ($$145 << 3) + 4 >> 2] | 0)) break; + } + $$145 = $$145 + -1 | 0; + } + if (($$1 | 0) > ($$145 | 0)) { + $$2 = $$1; + $$246 = $$145; + } else { + HEAPF32[$44 >> 2] = $53; + HEAPF32[$52 >> 2] = $45; + $61 = $1 + ($$1 << 3) + 4 | 0; + $62 = $1 + ($$145 << 3) + 4 | 0; + $63 = HEAP32[$61 >> 2] | 0; + HEAP32[$61 >> 2] = HEAP32[$62 >> 2]; + HEAP32[$62 >> 2] = $63; + $$2 = $$1 + 1 | 0; + $$246 = $$145 + -1 | 0; + } + if (($$2 | 0) > ($$246 | 0)) break; else { + $$0 = $$2; + $$044 = $$246; + } + } + $$040 = ($$2 | 0) < ($3 | 0) ? $$040 : $$246; + $$042 = ($$246 | 0) < ($37 | 0) ? $$2 : $$042; + } + $70 = $39; + $75 = HEAP32[$70 + 4 >> 2] | 0; + $76 = $0; + HEAP32[$76 >> 2] = HEAP32[$70 >> 2]; + HEAP32[$76 + 4 >> 2] = $75; + STACKTOP = sp; + return; +} + +function _ar2ReadImageSet($0) { + $0 = $0 | 0; + var $$0 = 0, $$079 = 0, $$080 = 0, $$1 = 0, $1 = 0, $10 = 0, $13 = 0, $15 = 0, $16 = 0, $18 = 0, $20 = 0, $30 = 0, $4 = 0, $43 = 0, $50 = 0, $53 = 0, $6 = 0, $8 = 0, $vararg_buffer1 = 0, $vararg_buffer10 = 0, $vararg_buffer12 = 0, $vararg_buffer15 = 0, $vararg_buffer17 = 0, $vararg_buffer19 = 0, $vararg_buffer23 = 0, $vararg_buffer4 = 0, $vararg_buffer8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 96 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(96); + $vararg_buffer23 = sp + 72 | 0; + $vararg_buffer19 = sp + 64 | 0; + $vararg_buffer17 = sp + 56 | 0; + $vararg_buffer15 = sp + 48 | 0; + $vararg_buffer12 = sp + 40 | 0; + $vararg_buffer10 = sp + 32 | 0; + $vararg_buffer8 = sp + 24 | 0; + $vararg_buffer4 = sp + 16 | 0; + $vararg_buffer1 = sp + 8 | 0; + $1 = sp + 80 | 0; + $4 = _malloc((_strlen($0) | 0) + 6 | 0) | 0; + if (!$4) { + _arLog(0, 3, 45930, sp); + _exit(1); + } + HEAP32[$vararg_buffer1 >> 2] = $0; + HEAP32[$vararg_buffer1 + 4 >> 2] = 25661; + _sprintf($4, 25656, $vararg_buffer1) | 0; + $6 = _fopen($4, 26308) | 0; + _free($4); + L4 : do if (!$6) { + HEAP32[$vararg_buffer4 >> 2] = $0; + HEAP32[$vararg_buffer4 + 4 >> 2] = 25661; + _arLog(0, 3, 25667, $vararg_buffer4); + $$0 = 0; + } else { + $8 = _malloc(8) | 0; + if (!$8) { + _arLog(0, 3, 45930, $vararg_buffer8); + _exit(1); + } + $10 = $8 + 4 | 0; + if ((_fread($10, 4, 1, $6) | 0) == 1 ? ($13 = HEAP32[$10 >> 2] | 0, ($13 | 0) >= 1) : 0) { + HEAP32[$vararg_buffer12 >> 2] = $13; + _arLog(0, 1, 25740, $vararg_buffer12); + $15 = $13 << 2; + $16 = _malloc($15) | 0; + HEAP32[$8 >> 2] = $16; + if (!$16) { + _arLog(0, 3, 45930, $vararg_buffer15); + _exit(1); + } + $18 = _malloc(16) | 0; + HEAP32[$16 >> 2] = $18; + if (!$18) { + _arLog(0, 3, 45930, $vararg_buffer17); + _exit(1); + } + $20 = _ar2ReadJpegImage2($6) | 0; + if (!$20) { + HEAP32[$vararg_buffer19 >> 2] = $0; + HEAP32[$vararg_buffer19 + 4 >> 2] = 25661; + _arLog(0, 2, 25770, $vararg_buffer19); + _free(HEAP32[$16 >> 2] | 0); + _free($16); + _free($8); + _rewind($6); + $$0 = _ar2ReadImageSetOld($6) | 0; + break; + } + if ((HEAP32[$20 + 4 >> 2] | 0) != 1) { + HEAP32[$vararg_buffer23 >> 2] = $0; + HEAP32[$vararg_buffer23 + 4 >> 2] = 25661; + _arLog(0, 2, 25770, $vararg_buffer23); + _free(HEAP32[$16 >> 2] | 0); + _free($16); + _free($8); + _free($20); + _fclose($6) | 0; + $$0 = 0; + break; + } + $30 = HEAP32[$16 >> 2] | 0; + HEAP32[$30 + 4 >> 2] = HEAP32[$20 + 8 >> 2]; + HEAP32[$30 + 8 >> 2] = HEAP32[$20 + 12 >> 2]; + HEAP32[$30 + 12 >> 2] = HEAP32[$20 + 16 >> 2]; + HEAP32[$30 >> 2] = HEAP32[$20 >> 2]; + _free($20); + _fseek($6, 4 - $15 | 0, 2) | 0; + $$079 = 1; + while (1) { + if (($$079 | 0) >= ($13 | 0)) { + label = 29; + break; + } + if ((_fread($1, 4, 1, $6) | 0) != 1) { + label = 21; + break; + } + $50 = _ar2GenImageLayer2(HEAP32[$16 >> 2] | 0, +HEAPF32[$1 >> 2]) | 0; + HEAP32[$16 + ($$079 << 2) >> 2] = $50; + if (!$50) { + label = 25; + break; + } + $$079 = $$079 + 1 | 0; + } + L30 : do if ((label | 0) == 21) { + $$080 = 0; + while (1) { + if (($$080 | 0) == ($$079 | 0)) break L30; + $43 = $16 + ($$080 << 2) | 0; + _free(HEAP32[HEAP32[$43 >> 2] >> 2] | 0); + _free(HEAP32[$43 >> 2] | 0); + $$080 = $$080 + 1 | 0; + } + } else if ((label | 0) == 25) { + $$1 = 0; + while (1) { + if (($$1 | 0) == ($$079 | 0)) break L30; + $53 = $16 + ($$1 << 2) | 0; + _free(HEAP32[HEAP32[$53 >> 2] >> 2] | 0); + _free(HEAP32[$53 >> 2] | 0); + $$1 = $$1 + 1 | 0; + } + } else if ((label | 0) == 29) { + _fclose($6) | 0; + $$0 = $8; + break L4; + } while (0); + _free($16); + } else _arLog(0, 3, 25715, $vararg_buffer10); + _free($8); + _fclose($6) | 0; + $$0 = 0; + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E18parseQualifiedTypeEv($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$2 = 0, $$3 = 0, $$4 = 0, $$5 = 0, $$byval_copy = 0, $1 = 0, $14 = 0, $18 = 0, $2 = 0, $21 = 0, $23 = 0, $26 = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $$byval_copy = sp + 48 | 0; + $1 = sp + 40 | 0; + $2 = sp + 32 | 0; + $3 = sp; + $4 = sp + 20 | 0; + $5 = sp + 8 | 0; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 85) | 0) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseBareSourceNameEv($1, $0); + do if (__ZNK12_GLOBAL__N_110StringView5emptyEv($1) | 0) $$3 = 0; else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 56126); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + if (!(__ZNK12_GLOBAL__N_110StringView10startsWithES0_($1, $$byval_copy) | 0)) { + $18 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E18parseQualifiedTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy >> 2] = $18; + if (!$18) $$2 = 0; else $$2 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_17VendorExtQualTypeEJRPNS0_4NodeERNS_10StringViewEEEES9_DpOT0_($0, $$byval_copy, $1) | 0; + $$3 = $$2; + break; + } + __ZNK12_GLOBAL__N_110StringView9dropFrontEm($$byval_copy, $1, 9); + __ZN12_GLOBAL__N_110StringViewC2Ev($3); + __ZN12_GLOBAL__N_114SwapAndRestoreIPKcEC2ERS2_S2_($4, $0, __ZNK12_GLOBAL__N_110StringView5beginEv($$byval_copy) | 0); + __ZN12_GLOBAL__N_114SwapAndRestoreIPKcEC2ERS2_S2_($5, $0 + 4 | 0, __ZNK12_GLOBAL__N_110StringView3endEv($$byval_copy) | 0); + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseBareSourceNameEv($3, $0); + __ZN12_GLOBAL__N_114SwapAndRestoreIPKcED2Ev($5); + __ZN12_GLOBAL__N_114SwapAndRestoreIPKcED2Ev($4); + if (__ZNK12_GLOBAL__N_110StringView5emptyEv($3) | 0) $$1 = 0; else { + $14 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E18parseQualifiedTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$4 >> 2] = $14; + if (!$14) $$0 = 0; else $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13ObjCProtoNameEJRPNS0_4NodeERNS_10StringViewEEEES9_DpOT0_($0, $4, $3) | 0; + $$1 = $$0; + } + $$3 = $$1; + } while (0); + $$5 = $$3; + } else { + $21 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseCVQualifiersEv($0) | 0; + HEAP32[$$byval_copy >> 2] = $21; + $23 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $23; + if ($23) if (!$21) $$4 = $23; else { + $26 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8QualTypeEJRPNS0_4NodeERNS0_10QualifiersEEEES9_DpOT0_($0, $1, $$byval_copy) | 0; + HEAP32[$1 >> 2] = $26; + $$4 = $26; + } else $$4 = 0; + $$5 = $$4; + } + STACKTOP = sp; + return $$5 | 0; +} + +function _start_pass_1_quant($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$014$i = 0, $$02425$i$i = 0, $$026$i$i = 0, $$02831$i = 0, $$02932$i = 0, $$036 = 0, $$1$i = 0, $$phi$trans$insert = 0, $$pre$phi40Z2D = 0, $$pre$phiZ2D = 0, $100 = 0, $15 = 0, $16 = 0, $2 = 0, $27 = 0, $28 = 0, $3 = 0, $30 = 0, $32 = 0, $37 = 0, $40 = 0, $44 = 0, $46 = 0, $51 = 0, $52 = 0, $59 = 0, $65 = 0, $71 = 0, $74 = 0, $75 = 0, $78 = 0, $82 = 0, $85 = 0, $89 = 0, $91 = 0, $97 = 0, label = 0; + $2 = $0 + 484 | 0; + $3 = HEAP32[$2 >> 2] | 0; + HEAP32[$0 + 136 >> 2] = HEAP32[$3 + 16 >> 2]; + HEAP32[$0 + 132 >> 2] = HEAP32[$3 + 20 >> 2]; + switch (HEAP32[$0 + 88 >> 2] | 0) { + case 0: + { + $15 = $3 + 4 | 0; + if ((HEAP32[$0 + 120 >> 2] | 0) == 3) { + HEAP32[$15 >> 2] = 22; + return; + } else { + HEAP32[$15 >> 2] = 23; + return; + } + break; + } + case 1: + { + $16 = $0 + 120 | 0; + HEAP32[$3 + 4 >> 2] = (HEAP32[$16 >> 2] | 0) == 3 ? 24 : 25; + HEAP32[$3 + 48 >> 2] = 0; + if (!(HEAP32[$3 + 28 >> 2] | 0)) _create_colorindex($0); + if (HEAP32[$3 + 52 >> 2] | 0) return; + $27 = HEAP32[$2 >> 2] | 0; + $28 = HEAP32[$16 >> 2] | 0; + if (($28 | 0) <= 0) return; + $30 = $0 + 4 | 0; + $$02932$i = 0; + $100 = $28; + while (1) { + $32 = HEAP32[$27 + 32 + ($$02932$i << 2) >> 2] | 0; + L22 : do if ($$02932$i) { + $$02831$i = 0; + while (1) { + if (($32 | 0) == (HEAP32[$27 + 32 + ($$02831$i << 2) >> 2] | 0)) break; + $37 = $$02831$i + 1 | 0; + if ($37 >>> 0 < $$02932$i >>> 0) $$02831$i = $37; else { + label = 15; + break L22; + } + } + $40 = HEAP32[$27 + 52 + ($$02831$i << 2) >> 2] | 0; + if ($40) { + $$1$i = $40; + $65 = $100; + } else label = 15; + } else label = 15; while (0); + if ((label | 0) == 15) { + label = 0; + $44 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$30 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + $46 = ($32 << 9) + -512 | 0; + $$026$i$i = 0; + do { + $$02425$i$i = 0; + do { + $51 = 255 - ((HEAPU8[5440 + ($$026$i$i << 4) + $$02425$i$i >> 0] | 0) << 1) | 0; + $52 = $51 * 255 | 0; + if (($51 | 0) < 0) $59 = 0 - ((0 - $52 | 0) / ($46 | 0) | 0) | 0; else $59 = ($52 | 0) / ($46 | 0) | 0; + HEAP32[$44 + ($$026$i$i << 6) + ($$02425$i$i << 2) >> 2] = $59; + $$02425$i$i = $$02425$i$i + 1 | 0; + } while (($$02425$i$i | 0) != 16); + $$026$i$i = $$026$i$i + 1 | 0; + } while (($$026$i$i | 0) != 16); + $$1$i = $44; + $65 = HEAP32[$16 >> 2] | 0; + } + HEAP32[$27 + 52 + ($$02932$i << 2) >> 2] = $$1$i; + $$02932$i = $$02932$i + 1 | 0; + if (($$02932$i | 0) >= ($65 | 0)) break; else $100 = $65; + } + return; + } + case 2: + { + HEAP32[$3 + 4 >> 2] = 26; + HEAP32[$3 + 84 >> 2] = 0; + if (!(HEAP32[$3 + 68 >> 2] | 0)) { + $71 = $0 + 112 | 0; + $74 = (HEAP32[$71 >> 2] << 1) + 4 | 0; + $75 = $0 + 120 | 0; + if ((HEAP32[$75 >> 2] | 0) <= 0) return; + $78 = $0 + 4 | 0; + $$014$i = 0; + do { + $82 = FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$78 >> 2] | 0) + 4 >> 2] & 63]($0, 1, $74) | 0; + HEAP32[$3 + 68 + ($$014$i << 2) >> 2] = $82; + $$014$i = $$014$i + 1 | 0; + $85 = HEAP32[$75 >> 2] | 0; + } while (($$014$i | 0) < ($85 | 0)); + $$pre$phi40Z2D = $75; + $$pre$phiZ2D = $71; + $91 = $85; + } else { + $$phi$trans$insert = $0 + 120 | 0; + $$pre$phi40Z2D = $$phi$trans$insert; + $$pre$phiZ2D = $0 + 112 | 0; + $91 = HEAP32[$$phi$trans$insert >> 2] | 0; + } + $89 = (HEAP32[$$pre$phiZ2D >> 2] << 1) + 4 | 0; + if (($91 | 0) <= 0) return; + $$036 = 0; + do { + _memset(HEAP32[$3 + 68 + ($$036 << 2) >> 2] | 0, 0, $89 | 0) | 0; + $$036 = $$036 + 1 | 0; + } while (($$036 | 0) < (HEAP32[$$pre$phi40Z2D >> 2] | 0)); + return; + } + default: + { + $97 = HEAP32[$0 >> 2] | 0; + HEAP32[$97 + 20 >> 2] = 49; + FUNCTION_TABLE_vi[HEAP32[$97 >> 2] & 255]($0); + return; + } + } +} + +function _ar2ReadMarkerSet($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$056 = 0, $$057 = 0, $$058 = 0, $12 = 0, $15 = 0, $18 = 0, $21 = 0, $28 = 0, $29 = 0, $3 = 0, $4 = 0, $44 = 0, $5 = 0, $6 = 0, $8 = 0, $vararg_buffer = 0, $vararg_buffer12 = 0, $vararg_buffer15 = 0, $vararg_buffer2 = 0, $vararg_buffer4 = 0, $vararg_buffer7 = 0, $vararg_buffer9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 1088 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(1088); + $vararg_buffer15 = sp + 1072 | 0; + $vararg_buffer12 = sp + 1064 | 0; + $vararg_buffer9 = sp + 1056 | 0; + $vararg_buffer7 = sp + 1048 | 0; + $vararg_buffer4 = sp + 1040 | 0; + $vararg_buffer2 = sp + 1032 | 0; + $vararg_buffer = sp + 1024 | 0; + $3 = sp + 768 | 0; + $4 = sp + 512 | 0; + $5 = sp; + HEAP32[$vararg_buffer >> 2] = $0; + HEAP32[$vararg_buffer + 4 >> 2] = $1; + _sprintf($5, 26699, $vararg_buffer) | 0; + $6 = _fopen($5, 25925) | 0; + if (!$6) $$058 = 0; else { + $8 = _malloc(8) | 0; + if (!$8) { + _arLog(0, 3, 45930, $vararg_buffer2); + _exit(1); + } + L6 : do if (_get_buff_345($3, $6) | 0) { + $12 = $8 + 4 | 0; + HEAP32[$vararg_buffer4 >> 2] = $12; + if ((_sscanf($3, 25959, $vararg_buffer4) | 0) != 1) { + _free($8); + $$057 = 0; + break; + } + $15 = HEAP32[$12 >> 2] | 0; + if (($15 | 0) < 1) { + _free($8); + $$057 = 0; + break; + } + $18 = _malloc($15 * 56 | 0) | 0; + HEAP32[$8 >> 2] = $18; + if (!$18) { + _arLog(0, 3, 45930, $vararg_buffer7); + _exit(1); + } + $$056 = 0; + $21 = $15; + L18 : while (1) { + if (($$056 | 0) >= ($21 | 0)) { + $$057 = $8; + break L6; + } + if (!(_get_buff_345($3, $6) | 0)) { + label = 15; + break; + } + HEAP32[$vararg_buffer9 >> 2] = $4; + if ((_sscanf($3, 25986, $vararg_buffer9) | 0) != 1) { + label = 17; + break; + } + $28 = _arPattLoad($2, $4) | 0; + $29 = HEAP32[$8 >> 2] | 0; + HEAP32[$29 + ($$056 * 56 | 0) + 4 >> 2] = $28; + if (($28 | 0) < 0) { + label = 19; + break; + } + if (!(_get_buff_345($3, $6) | 0)) { + label = 21; + break; + } + HEAP32[$vararg_buffer12 >> 2] = (HEAP32[$8 >> 2] | 0) + ($$056 * 56 | 0); + if ((_sscanf($3, 25887, $vararg_buffer12) | 0) != 1) { + label = 24; + break; + } + $$0 = 0; + while (1) { + if ($$0 >>> 0 >= 3) break; + if (!(_get_buff_345($3, $6) | 0)) { + label = 27; + break L18; + } + $44 = HEAP32[$8 >> 2] | 0; + HEAP32[$vararg_buffer15 >> 2] = $44 + ($$056 * 56 | 0) + 8 + ($$0 << 4); + HEAP32[$vararg_buffer15 + 4 >> 2] = $44 + ($$056 * 56 | 0) + 8 + ($$0 << 4) + 4; + HEAP32[$vararg_buffer15 + 8 >> 2] = $44 + ($$056 * 56 | 0) + 8 + ($$0 << 4) + 8; + HEAP32[$vararg_buffer15 + 12 >> 2] = $44 + ($$056 * 56 | 0) + 8 + ($$0 << 4) + 12; + if ((_sscanf($3, 26152, $vararg_buffer15) | 0) == 4) $$0 = $$0 + 1 | 0; else { + label = 29; + break L18; + } + } + $$056 = $$056 + 1 | 0; + $21 = HEAP32[$12 >> 2] | 0; + } + if ((label | 0) == 15) { + _free(HEAP32[$8 >> 2] | 0); + _free($8); + $$057 = 0; + break; + } else if ((label | 0) == 17) { + _free(HEAP32[$8 >> 2] | 0); + _free($8); + $$057 = 0; + break; + } else if ((label | 0) == 19) { + _free($29); + _free($8); + $$057 = 0; + break; + } else if ((label | 0) == 21) { + _free(HEAP32[$8 >> 2] | 0); + _free($8); + $$057 = 0; + break; + } else if ((label | 0) == 24) { + _free(HEAP32[$8 >> 2] | 0); + _free($8); + $$057 = 0; + break; + } else if ((label | 0) == 27) { + _free(HEAP32[$8 >> 2] | 0); + _free($8); + $$057 = 0; + break; + } else if ((label | 0) == 29) { + _free(HEAP32[$8 >> 2] | 0); + _free($8); + $$057 = 0; + break; + } + } else { + _free($8); + $$057 = 0; + } while (0); + _fclose($6) | 0; + $$058 = $$057; + } + STACKTOP = sp; + return $$058 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20parseUnqualifiedNameEPNS5_9NameStateE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$118 = 0, $$11823 = 0, $$2 = 0, $$byval_copy = 0, $$pre$phi26Z2D = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $2 = 0, $3 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0; + do if ($3 << 24 >> 24 != 85) { + if (($3 + -49 & 255) < 9) { + $$118 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseSourceNameEPNS5_9NameStateE(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + label = 12; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 55180); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy) | 0)) { + $$118 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseOperatorNameEPNS5_9NameStateE(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0, $1) | 0; + label = 12; + break; + } + $11 = $0 + 8 | 0; + $12 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($11) | 0; + while (1) { + $13 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $14 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseSourceNameEPNS5_9NameStateE($13) | 0; + HEAP32[$$byval_copy >> 2] = $14; + if (!$14) { + label = 10; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($11, $$byval_copy); + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) { + label = 9; + break; + } + } + if ((label | 0) == 9) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20popTrailingNodeArrayEm($$byval_copy, $0, $12); + $$11823 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_21StructuredBindingNameEJNS0_9NodeArrayEEEEPNS0_4NodeEDpOT0_($0, $$byval_copy) | 0; + $$pre$phi26Z2D = $13; + label = 14; + break; + } else if ((label | 0) == 10) { + $$2 = 0; + break; + } + } else { + $$118 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20parseUnnamedTypeNameEPNS5_9NameStateE(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + label = 12; + } while (0); + if ((label | 0) == 12) if (!$$118) $$2 = 0; else { + $$11823 = $$118; + $$pre$phi26Z2D = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + label = 14; + } + if ((label | 0) == 14) $$2 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E12parseAbiTagsEPNS0_4NodeE($$pre$phi26Z2D, $$11823) | 0; + STACKTOP = sp; + return $$2 | 0; +} + +function _kpmLoadRefDataSet($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$071 = 0, $$1 = 0, $11 = 0, $13 = 0, $16 = 0, $19 = 0, $22 = 0, $3 = 0, $44 = 0, $47 = 0, $51 = 0, $52 = 0, $55 = 0, $6 = 0, $64 = 0, $66 = 0, $68 = 0, $75 = 0, $77 = 0, $8 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer11 = 0, $vararg_buffer13 = 0, $vararg_buffer5 = 0, $vararg_buffer7 = 0, $vararg_buffer9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $vararg_buffer13 = sp + 56 | 0; + $vararg_buffer11 = sp + 48 | 0; + $vararg_buffer9 = sp + 40 | 0; + $vararg_buffer7 = sp + 32 | 0; + $vararg_buffer5 = sp + 24 | 0; + $vararg_buffer1 = sp + 8 | 0; + $vararg_buffer = sp; + $3 = sp + 60 | 0; + HEAP8[$3 >> 0] = HEAP8[26308] | 0; + HEAP8[$3 + 1 >> 0] = HEAP8[26309] | 0; + HEAP8[$3 + 2 >> 0] = HEAP8[26310] | 0; + L1 : do if (($0 | 0) != 0 & ($2 | 0) != 0) { + $6 = _kpmFopen($0, $1, $3) | 0; + if (!$6) { + $8 = ($1 | 0) != 0; + HEAP32[$vararg_buffer1 >> 2] = $0; + HEAP32[$vararg_buffer1 + 4 >> 2] = $8 ? 53642 : 67447; + HEAP32[$vararg_buffer1 + 8 >> 2] = $8 ? $1 : 67447; + _arLog(0, 3, 26362, $vararg_buffer1); + $$0 = -1; + break; + } + $11 = _calloc(1, 16) | 0; + if (!$11) { + _arLog(0, 3, 45930, $vararg_buffer5); + _exit(1); + } + $13 = $11 + 4 | 0; + L9 : do if ((_fread($13, 4, 1, $6) | 0) == 1 ? ($16 = HEAP32[$13 >> 2] | 0, ($16 | 0) >= 1) : 0) { + $19 = _malloc($16 * 132 | 0) | 0; + HEAP32[$11 >> 2] = $19; + if (!$19) { + _arLog(0, 3, 45930, $vararg_buffer7); + _exit(1); + } + $$071 = 0; + $22 = $16; + while (1) { + if (($$071 | 0) >= ($22 | 0)) break; + if ((_fread((HEAP32[$11 >> 2] | 0) + ($$071 * 132 | 0) | 0, 8, 1, $6) | 0) != 1) break L9; + if ((_fread((HEAP32[$11 >> 2] | 0) + ($$071 * 132 | 0) + 8 | 0, 8, 1, $6) | 0) != 1) break L9; + if ((_fread((HEAP32[$11 >> 2] | 0) + ($$071 * 132 | 0) + 16 | 0, 108, 1, $6) | 0) != 1) break L9; + if ((_fread((HEAP32[$11 >> 2] | 0) + ($$071 * 132 | 0) + 124 | 0, 4, 1, $6) | 0) != 1) break L9; + if ((_fread((HEAP32[$11 >> 2] | 0) + ($$071 * 132 | 0) + 128 | 0, 4, 1, $6) | 0) != 1) break L9; + $$071 = $$071 + 1 | 0; + $22 = HEAP32[$13 >> 2] | 0; + } + $44 = $11 + 12 | 0; + if ((_fread($44, 4, 1, $6) | 0) == 1) { + $47 = HEAP32[$44 >> 2] | 0; + if (($47 | 0) < 1) { + HEAP32[$11 + 8 >> 2] = 0; + break; + } + $51 = _malloc($47 * 12 | 0) | 0; + $52 = $11 + 8 | 0; + HEAP32[$52 >> 2] = $51; + if (!$51) { + _arLog(0, 3, 45930, $vararg_buffer9); + _exit(1); + } + $$1 = 0; + $55 = $47; + while (1) { + if (($$1 | 0) >= ($55 | 0)) { + label = 32; + break; + } + if ((_fread((HEAP32[$52 >> 2] | 0) + ($$1 * 12 | 0) + 8 | 0, 4, 1, $6) | 0) != 1) break L9; + if ((_fread((HEAP32[$52 >> 2] | 0) + ($$1 * 12 | 0) + 4 | 0, 4, 1, $6) | 0) != 1) break L9; + $64 = HEAP32[$52 >> 2] | 0; + $66 = HEAP32[$64 + ($$1 * 12 | 0) + 4 >> 2] | 0; + $68 = _malloc($66 * 12 | 0) | 0; + HEAP32[$64 + ($$1 * 12 | 0) >> 2] = $68; + if (!$68) { + label = 29; + break; + } + if ((_fread($68, 12, $66, $6) | 0) != ($66 | 0)) break L9; + $$1 = $$1 + 1 | 0; + $55 = HEAP32[$44 >> 2] | 0; + } + if ((label | 0) == 29) { + _arLog(0, 3, 45930, $vararg_buffer11); + _exit(1); + } else if ((label | 0) == 32) { + HEAP32[$2 >> 2] = $11; + _fclose($6) | 0; + $$0 = 0; + break L1; + } + } + } while (0); + _arLog(0, 3, 26429, $vararg_buffer13); + $75 = HEAP32[$11 + 8 >> 2] | 0; + if ($75 | 0) _free($75); + $77 = HEAP32[$11 >> 2] | 0; + if ($77 | 0) _free($77); + _free($11); + _fclose($6) | 0; + $$0 = -1; + } else { + _arLog(0, 3, 26311, $vararg_buffer); + $$0 = -1; + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E16parseTemplateArgEv($0) { + $0 = $0 | 0; + var $$5 = 0, $1 = 0, $12 = 0, $13 = 0, $16 = 0, $24 = 0, $26 = 0, $7 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + L1 : do switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 | 0) { + case 88: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $7 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + if (!$7) $$5 = 0; else { + $9 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0; + STACKTOP = sp; + return ($9 ? $7 : 0) | 0; + } + break; + } + case 74: + { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $12 = $0 + 8 | 0; + $13 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($12) | 0; + while (1) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) { + label = 9; + break; + } + $16 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E16parseTemplateArgEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $16; + if (!$16) { + label = 8; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($12, $1); + } + if ((label | 0) == 8) { + $$5 = 0; + break L1; + } else if ((label | 0) == 9) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20popTrailingNodeArrayEm($1, $0, $13); + $$5 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20TemplateArgumentPackEJRNS0_9NodeArrayEEEEPNS0_4NodeEDpOT0_($0, $1) | 0; + break L1; + } + break; + } + case 76: + { + if ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0) << 24 >> 24 != 90) { + $$5 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E16parseExprPrimaryEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + break L1; + } + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + $24 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseEncodingEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + if (!$24) $$5 = 0; else { + $26 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0; + $$5 = $26 ? $24 : 0; + } + break; + } + default: + $$5 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + } while (0); + STACKTOP = sp; + return $$5 | 0; +} + +function __ZNKSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0 = 0, $$0$i$i$i$i = 0, $$0$i$i2$i$i = 0, $$byval_copy = 0, $$sroa$0$0$copyload = 0, $10 = 0, $11 = 0, $12 = 0, $16 = 0, $17 = 0, $19 = 0, $21 = 0, $23 = 0, $26 = 0, $37 = 0, $39 = 0, $40 = 0, $45 = 0, $48 = 0, $62 = 0, $7 = 0, $77 = 0, $8 = 0, $81 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 432 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(432); + $$byval_copy = sp + 424 | 0; + $7 = sp; + $8 = sp + 416 | 0; + $9 = sp + 408 | 0; + $10 = sp + 400 | 0; + $11 = sp + 428 | 0; + $12 = sp + 404 | 0; + HEAP32[$8 >> 2] = $7; + HEAP32[$8 + 4 >> 2] = 214; + __ZNKSt3__28ios_base6getlocEv($10, $4); + $16 = __ZNKSt3__26locale9use_facetERNS0_2idE($10, 66544) | 0; + HEAP8[$11 >> 0] = 0; + $17 = HEAP32[$2 >> 2] | 0; + HEAP32[$12 >> 2] = $17; + $19 = HEAP32[$4 + 4 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$12 >> 2]; + $21 = $17; + if (__ZNSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_($1, $$byval_copy, $3, $10, $19, $5, $11, $16, $8, $9, $7 + 400 | 0) | 0) { + $23 = $6 + 8 + 3 | 0; + if ((HEAP8[$23 >> 0] | 0) < 0) { + $26 = HEAP32[$6 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($26, $$byval_copy); + HEAP32[$6 + 4 >> 2] = 0; + } else { + HEAP32[$$byval_copy >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($6, $$byval_copy); + HEAP8[$23 >> 0] = 0; + } + if (HEAP8[$11 >> 0] | 0) __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw($6, FUNCTION_TABLE_iii[HEAP32[(HEAP32[$16 >> 2] | 0) + 44 >> 2] & 127]($16, 45) | 0); + $37 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$16 >> 2] | 0) + 44 >> 2] & 127]($16, 48) | 0; + $39 = HEAP32[$9 >> 2] | 0; + $40 = $39 + -4 | 0; + $$0 = HEAP32[$8 >> 2] | 0; + while (1) { + if ($$0 >>> 0 >= $40 >>> 0) break; + if ((HEAP32[$$0 >> 2] | 0) != ($37 | 0)) break; + $$0 = $$0 + 4 | 0; + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE23__append_forward_unsafeIPwEERS5_T_S9_($6, $$0, $39) | 0; + } + $45 = HEAP32[$1 >> 2] | 0; + do if ($45) { + $48 = HEAP32[$45 + 12 >> 2] | 0; + if (($48 | 0) == (HEAP32[$45 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$45 >> 2] | 0) + 36 >> 2] & 127]($45) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$48 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $81 = 1; + break; + } else { + $81 = (HEAP32[$1 >> 2] | 0) == 0; + break; + } + } else $81 = 1; while (0); + do if ($17) { + $62 = HEAP32[$21 + 12 >> 2] | 0; + if (($62 | 0) == (HEAP32[$21 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$17 >> 2] | 0) + 36 >> 2] & 127]($21) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$62 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($81) break; else { + label = 27; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 25; + break; + } + } else label = 25; while (0); + if ((label | 0) == 25 ? $81 : 0) label = 27; + if ((label | 0) == 27) HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__26localeD2Ev($10); + $77 = HEAP32[$8 >> 2] | 0; + HEAP32[$8 >> 2] = 0; + if ($77 | 0) FUNCTION_TABLE_vi[HEAP32[$8 + 4 >> 2] & 255]($77); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0 = 0, $$0$i$i$i$i = 0, $$0$i$i2$i$i = 0, $$byval_copy = 0, $$sroa$0$0$copyload = 0, $10 = 0, $11 = 0, $12 = 0, $16 = 0, $17 = 0, $19 = 0, $21 = 0, $22 = 0, $25 = 0, $36 = 0, $38 = 0, $39 = 0, $44 = 0, $47 = 0, $61 = 0, $7 = 0, $76 = 0, $8 = 0, $80 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 128 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(128); + $$byval_copy = sp + 120 | 0; + $7 = sp; + $8 = sp + 112 | 0; + $9 = sp + 108 | 0; + $10 = sp + 100 | 0; + $11 = sp + 124 | 0; + $12 = sp + 104 | 0; + HEAP32[$8 >> 2] = $7; + HEAP32[$8 + 4 >> 2] = 214; + __ZNKSt3__28ios_base6getlocEv($10, $4); + $16 = __ZNKSt3__26locale9use_facetERNS0_2idE($10, 66512) | 0; + HEAP8[$11 >> 0] = 0; + $17 = HEAP32[$2 >> 2] | 0; + HEAP32[$12 >> 2] = $17; + $19 = HEAP32[$4 + 4 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$12 >> 2]; + $21 = $17; + if (__ZNSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_($1, $$byval_copy, $3, $10, $19, $5, $11, $16, $8, $9, $7 + 100 | 0) | 0) { + $22 = $6 + 11 | 0; + if ((HEAP8[$22 >> 0] | 0) < 0) { + $25 = HEAP32[$6 >> 2] | 0; + HEAP8[$$byval_copy >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($25, $$byval_copy); + HEAP32[$6 + 4 >> 2] = 0; + } else { + HEAP8[$$byval_copy >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($6, $$byval_copy); + HEAP8[$22 >> 0] = 0; + } + if (HEAP8[$11 >> 0] | 0) __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc($6, FUNCTION_TABLE_iii[HEAP32[(HEAP32[$16 >> 2] | 0) + 28 >> 2] & 127]($16, 45) | 0); + $36 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$16 >> 2] | 0) + 28 >> 2] & 127]($16, 48) | 0; + $38 = HEAP32[$9 >> 2] | 0; + $39 = $38 + -1 | 0; + $$0 = HEAP32[$8 >> 2] | 0; + while (1) { + if ($$0 >>> 0 >= $39 >>> 0) break; + if ((HEAP8[$$0 >> 0] | 0) != $36 << 24 >> 24) break; + $$0 = $$0 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE23__append_forward_unsafeIPcEERS5_T_S9_($6, $$0, $38) | 0; + } + $44 = HEAP32[$1 >> 2] | 0; + do if ($44) { + $47 = HEAP32[$44 + 12 >> 2] | 0; + if (($47 | 0) == (HEAP32[$44 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$44 >> 2] | 0) + 36 >> 2] & 127]($44) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$47 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $80 = 1; + break; + } else { + $80 = (HEAP32[$1 >> 2] | 0) == 0; + break; + } + } else $80 = 1; while (0); + do if ($17) { + $61 = HEAP32[$21 + 12 >> 2] | 0; + if (($61 | 0) == (HEAP32[$21 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$17 >> 2] | 0) + 36 >> 2] & 127]($21) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$61 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($80) break; else { + label = 27; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 25; + break; + } + } else label = 25; while (0); + if ((label | 0) == 25 ? $80 : 0) label = 27; + if ((label | 0) == 27) HEAP32[$5 >> 2] = HEAP32[$5 >> 2] | 2; + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__26localeD2Ev($10); + $76 = HEAP32[$8 >> 2] | 0; + HEAP32[$8 >> 2] = 0; + if ($76 | 0) FUNCTION_TABLE_vi[HEAP32[$8 + 4 >> 2] & 255]($76); + STACKTOP = sp; + return $$sroa$0$0$copyload | 0; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i7 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i13 = 0, $100 = 0, $101 = 0, $21 = 0, $24 = 0, $36 = 0, $38 = 0, $5 = 0, $56 = 0, $57 = 0, $58 = 0, $6 = 0, $67 = 0, $70 = 0, $83 = 0, $85 = 0, $9 = 0, $99 = 0, label = 0; + $5 = $4 + 8 | 0; + L1 : while (1) { + $6 = HEAP32[$1 >> 2] | 0; + do if ($6) { + $9 = HEAP32[$6 + 12 >> 2] | 0; + if (($9 | 0) == (HEAP32[$6 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$6 >> 2] | 0) + 36 >> 2] & 127]($6) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$9 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $99 = 1; + break; + } else { + $99 = (HEAP32[$1 >> 2] | 0) == 0; + break; + } + } else $99 = 1; while (0); + $21 = HEAP32[$2 >> 2] | 0; + do if ($21) { + $24 = HEAP32[$21 + 12 >> 2] | 0; + if (($24 | 0) == (HEAP32[$21 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$21 >> 2] | 0) + 36 >> 2] & 127]($21) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$24 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($99) { + $100 = $21; + break; + } else { + $83 = $21; + break L1; + } else { + HEAP32[$2 >> 2] = 0; + label = 15; + break; + } + } else label = 15; while (0); + if ((label | 0) == 15) { + label = 0; + if ($99) { + $83 = 0; + break; + } else $100 = 0; + } + $36 = HEAP32[$1 >> 2] | 0; + $38 = HEAP32[$36 + 12 >> 2] | 0; + if (($38 | 0) == (HEAP32[$36 + 16 >> 2] | 0)) $$0$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$36 >> 2] | 0) + 36 >> 2] & 127]($36) | 0; else $$0$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$38 >> 0] | 0) | 0; + if (($$0$i$i & 255) << 24 >> 24 <= -1) { + $83 = $100; + break; + } + if (!(HEAP16[(HEAP32[$5 >> 2] | 0) + ($$0$i$i << 24 >> 24 << 1) >> 1] & 8192)) { + $83 = $100; + break; + } + $56 = HEAP32[$1 >> 2] | 0; + $57 = $56 + 12 | 0; + $58 = HEAP32[$57 >> 2] | 0; + if (($58 | 0) == (HEAP32[$56 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$56 >> 2] | 0) + 40 >> 2] & 127]($56) | 0; else { + HEAP32[$57 >> 2] = $58 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$58 >> 0] | 0) | 0; + } + } + $67 = HEAP32[$1 >> 2] | 0; + do if ($67) { + $70 = HEAP32[$67 + 12 >> 2] | 0; + if (($70 | 0) == (HEAP32[$67 + 16 >> 2] | 0)) $$0$i$i$i$i7 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$67 >> 2] | 0) + 36 >> 2] & 127]($67) | 0; else $$0$i$i$i$i7 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$70 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i7, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $101 = 1; + break; + } else { + $101 = (HEAP32[$1 >> 2] | 0) == 0; + break; + } + } else $101 = 1; while (0); + do if ($83) { + $85 = HEAP32[$83 + 12 >> 2] | 0; + if (($85 | 0) == (HEAP32[$83 + 16 >> 2] | 0)) $$0$i$i2$i$i13 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$83 >> 2] | 0) + 36 >> 2] & 127]($83) | 0; else $$0$i$i2$i$i13 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$85 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i13, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($101) break; else { + label = 41; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 39; + break; + } + } else label = 39; while (0); + if ((label | 0) == 39 ? $101 : 0) label = 41; + if ((label | 0) == 41) HEAP32[$3 >> 2] = HEAP32[$3 >> 2] | 2; + return; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i8 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i14 = 0, $100 = 0, $101 = 0, $20 = 0, $23 = 0, $37 = 0, $39 = 0, $5 = 0, $57 = 0, $58 = 0, $59 = 0, $68 = 0, $71 = 0, $8 = 0, $84 = 0, $86 = 0, label = 0; + $5 = HEAP32[$1 >> 2] | 0; + do if ($5) { + $8 = HEAP32[$5 + 12 >> 2] | 0; + if (($8 | 0) == (HEAP32[$5 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$5 >> 2] | 0) + 36 >> 2] & 127]($5) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$8 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $100 = 1; + break; + } else { + $100 = (HEAP32[$1 >> 2] | 0) == 0; + break; + } + } else $100 = 1; while (0); + $20 = HEAP32[$2 >> 2] | 0; + do if ($20) { + $23 = HEAP32[$20 + 12 >> 2] | 0; + if (($23 | 0) == (HEAP32[$20 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$20 >> 2] | 0) + 36 >> 2] & 127]($20) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$23 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($100) { + $84 = $20; + label = 17; + break; + } else { + label = 16; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 14; + break; + } + } else label = 14; while (0); + if ((label | 0) == 14) if ($100) label = 16; else { + $84 = 0; + label = 17; + } + L22 : do if ((label | 0) == 16) HEAP32[$3 >> 2] = HEAP32[$3 >> 2] | 6; else if ((label | 0) == 17) { + $37 = HEAP32[$1 >> 2] | 0; + $39 = HEAP32[$37 + 12 >> 2] | 0; + if (($39 | 0) == (HEAP32[$37 + 16 >> 2] | 0)) $$0$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$37 >> 2] | 0) + 36 >> 2] & 127]($37) | 0; else $$0$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$39 >> 0] | 0) | 0; + if ((FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$4 >> 2] | 0) + 36 >> 2] & 63]($4, $$0$i$i & 255, 0) | 0) << 24 >> 24 != 37) { + HEAP32[$3 >> 2] = HEAP32[$3 >> 2] | 4; + break; + } + $57 = HEAP32[$1 >> 2] | 0; + $58 = $57 + 12 | 0; + $59 = HEAP32[$58 >> 2] | 0; + if (($59 | 0) == (HEAP32[$57 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$57 >> 2] | 0) + 40 >> 2] & 127]($57) | 0; else { + HEAP32[$58 >> 2] = $59 + 1; + __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$59 >> 0] | 0) | 0; + } + $68 = HEAP32[$1 >> 2] | 0; + do if ($68) { + $71 = HEAP32[$68 + 12 >> 2] | 0; + if (($71 | 0) == (HEAP32[$68 + 16 >> 2] | 0)) $$0$i$i$i$i8 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$68 >> 2] | 0) + 36 >> 2] & 127]($68) | 0; else $$0$i$i$i$i8 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$71 >> 0] | 0) | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i8, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $101 = 1; + break; + } else { + $101 = (HEAP32[$1 >> 2] | 0) == 0; + break; + } + } else $101 = 1; while (0); + do if ($84) { + $86 = HEAP32[$84 + 12 >> 2] | 0; + if (($86 | 0) == (HEAP32[$84 + 16 >> 2] | 0)) $$0$i$i2$i$i14 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$84 >> 2] | 0) + 36 >> 2] & 127]($84) | 0; else $$0$i$i2$i$i14 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$86 >> 0] | 0) | 0; + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i2$i$i14, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) if ($101) break L22; else break; else { + HEAP32[$2 >> 2] = 0; + label = 38; + break; + } + } else label = 38; while (0); + if ((label | 0) == 38 ? !$101 : 0) break; + HEAP32[$3 >> 2] = HEAP32[$3 >> 2] | 2; + } while (0); + return; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i8 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i14 = 0, $100 = 0, $20 = 0, $23 = 0, $37 = 0, $39 = 0, $5 = 0, $56 = 0, $57 = 0, $58 = 0, $67 = 0, $70 = 0, $8 = 0, $83 = 0, $85 = 0, $99 = 0, label = 0; + $5 = HEAP32[$1 >> 2] | 0; + do if ($5) { + $8 = HEAP32[$5 + 12 >> 2] | 0; + if (($8 | 0) == (HEAP32[$5 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$5 >> 2] | 0) + 36 >> 2] & 127]($5) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$8 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $99 = 1; + break; + } else { + $99 = (HEAP32[$1 >> 2] | 0) == 0; + break; + } + } else $99 = 1; while (0); + $20 = HEAP32[$2 >> 2] | 0; + do if ($20) { + $23 = HEAP32[$20 + 12 >> 2] | 0; + if (($23 | 0) == (HEAP32[$20 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$20 >> 2] | 0) + 36 >> 2] & 127]($20) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$23 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($99) { + $83 = $20; + label = 17; + break; + } else { + label = 16; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 14; + break; + } + } else label = 14; while (0); + if ((label | 0) == 14) if ($99) label = 16; else { + $83 = 0; + label = 17; + } + L22 : do if ((label | 0) == 16) HEAP32[$3 >> 2] = HEAP32[$3 >> 2] | 6; else if ((label | 0) == 17) { + $37 = HEAP32[$1 >> 2] | 0; + $39 = HEAP32[$37 + 12 >> 2] | 0; + if (($39 | 0) == (HEAP32[$37 + 16 >> 2] | 0)) $$0$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$37 >> 2] | 0) + 36 >> 2] & 127]($37) | 0; else $$0$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$39 >> 2] | 0) | 0; + if ((FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$4 >> 2] | 0) + 52 >> 2] & 63]($4, $$0$i$i, 0) | 0) << 24 >> 24 != 37) { + HEAP32[$3 >> 2] = HEAP32[$3 >> 2] | 4; + break; + } + $56 = HEAP32[$1 >> 2] | 0; + $57 = $56 + 12 | 0; + $58 = HEAP32[$57 >> 2] | 0; + if (($58 | 0) == (HEAP32[$56 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$56 >> 2] | 0) + 40 >> 2] & 127]($56) | 0; else { + HEAP32[$57 >> 2] = $58 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$58 >> 2] | 0) | 0; + } + $67 = HEAP32[$1 >> 2] | 0; + do if ($67) { + $70 = HEAP32[$67 + 12 >> 2] | 0; + if (($70 | 0) == (HEAP32[$67 + 16 >> 2] | 0)) $$0$i$i$i$i8 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$67 >> 2] | 0) + 36 >> 2] & 127]($67) | 0; else $$0$i$i$i$i8 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$70 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i8, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $100 = 1; + break; + } else { + $100 = (HEAP32[$1 >> 2] | 0) == 0; + break; + } + } else $100 = 1; while (0); + do if ($83) { + $85 = HEAP32[$83 + 12 >> 2] | 0; + if (($85 | 0) == (HEAP32[$83 + 16 >> 2] | 0)) $$0$i$i2$i$i14 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$83 >> 2] | 0) + 36 >> 2] & 127]($83) | 0; else $$0$i$i2$i$i14 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$85 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i14, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($100) break L22; else break; else { + HEAP32[$2 >> 2] = 0; + label = 38; + break; + } + } else label = 38; while (0); + if ((label | 0) == 38 ? !$100 : 0) break; + HEAP32[$3 >> 2] = HEAP32[$3 >> 2] | 2; + } while (0); + return; +} + +function __ZN6vision25DoGScaleInvariantDetector23findFeatureOrientationsEPKNS_25GaussianScaleSpacePyramidE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$025 = 0, $$026 = 0, $13 = 0, $15 = 0, $16 = 0, $19 = 0, $2 = 0, $21 = 0, $22 = 0, $23 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $32 = 0, $36 = 0, $4 = 0, $45 = 0.0, $5 = 0, $53 = 0.0, $54 = 0.0, $6 = 0, $62 = 0.0, $64 = 0, $79 = 0, dest = 0, sp = 0, src = 0, stop = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $2 = sp + 48 | 0; + $3 = sp + 44 | 0; + $4 = sp + 40 | 0; + $5 = sp + 36 | 0; + $6 = sp; + L1 : do if (!(HEAP8[$0 + 28 >> 0] | 0)) { + $13 = HEAP32[$0 + 60 >> 2] | 0; + $15 = ((HEAP32[$0 + 64 >> 2] | 0) - $13 | 0) / 36 | 0; + $16 = $13; + $$026 = 0; + while (1) { + if (($$026 | 0) == ($15 | 0)) break L1; + HEAPF32[$16 + ($$026 * 36 | 0) + 8 >> 2] = 0.0; + $$026 = $$026 + 1 | 0; + } + } else { + $19 = $0 + 72 | 0; + $21 = $0 + 76 | 0; + HEAP32[$21 >> 2] = HEAP32[$19 >> 2]; + $22 = $0 + 60 | 0; + $23 = $0 + 64 | 0; + __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE7reserveEm($19, (HEAP32[$23 >> 2] | 0) - (HEAP32[$22 >> 2] | 0) | 0); + $27 = $0 + 92 | 0; + __ZN6vision21OrientationAssignment16computeGradientsEPKNS_25GaussianScaleSpacePyramidE($27, $1); + $28 = $0 + 144 | 0; + $29 = $6 + 8 | 0; + $30 = $0 + 80 | 0; + $$025 = 0; + while (1) { + $32 = HEAP32[$22 >> 2] | 0; + $36 = $32; + if ($$025 >>> 0 >= (((HEAP32[$23 >> 2] | 0) - $32 | 0) / 36 | 0) >>> 0) break; + __ZN6vision25bilinear_downsample_pointERfS0_S0_fffi($3, $4, $5, +HEAPF32[$36 + ($$025 * 36 | 0) >> 2], +HEAPF32[$36 + ($$025 * 36 | 0) + 4 >> 2], +HEAPF32[$36 + ($$025 * 36 | 0) + 28 >> 2], HEAP32[$36 + ($$025 * 36 | 0) + 12 >> 2] | 0); + $45 = +HEAPF32[$3 >> 2]; + $53 = +__ZN6vision10ClipScalarIfEET_S1_S1_S1_($45, 0.0, +(((__ZNK6vision5Image5widthEv(__ZNK6vision25GaussianScaleSpacePyramid3getEmm($1, HEAP32[(HEAP32[$22 >> 2] | 0) + ($$025 * 36 | 0) + 12 >> 2] | 0, 0) | 0) | 0) + -1 | 0) >>> 0)); + HEAPF32[$3 >> 2] = $53; + $54 = +HEAPF32[$4 >> 2]; + $62 = +__ZN6vision10ClipScalarIfEET_S1_S1_S1_($54, 0.0, +(((__ZNK6vision5Image6heightEv(__ZNK6vision25GaussianScaleSpacePyramid3getEmm($1, HEAP32[(HEAP32[$22 >> 2] | 0) + ($$025 * 36 | 0) + 12 >> 2] | 0, 0) | 0) | 0) + -1 | 0) >>> 0)); + HEAPF32[$4 >> 2] = $62; + $64 = HEAP32[$22 >> 2] | 0; + __ZN6vision21OrientationAssignment7computeEPfRiiifff($27, HEAP32[$28 >> 2] | 0, $2, HEAP32[$64 + ($$025 * 36 | 0) + 12 >> 2] | 0, HEAP32[$64 + ($$025 * 36 | 0) + 16 >> 2] | 0, +HEAPF32[$3 >> 2], $62, +HEAPF32[$5 >> 2]); + $$0 = 0; + while (1) { + if (($$0 | 0) >= (HEAP32[$2 >> 2] | 0)) break; + dest = $6; + src = (HEAP32[$22 >> 2] | 0) + ($$025 * 36 | 0) | 0; + stop = dest + 36 | 0; + do { + HEAP32[dest >> 2] = HEAP32[src >> 2]; + dest = dest + 4 | 0; + src = src + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$29 >> 2] = HEAP32[(HEAP32[$28 >> 2] | 0) + ($$0 << 2) >> 2]; + $79 = HEAP32[$21 >> 2] | 0; + if (($79 | 0) == (HEAP32[$30 >> 2] | 0)) __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE21__push_back_slow_pathIRKS3_EEvOT_($19, $6); else { + dest = $79; + src = $6; + stop = dest + 36 | 0; + do { + HEAP32[dest >> 2] = HEAP32[src >> 2]; + dest = dest + 4 | 0; + src = src + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$21 >> 2] = (HEAP32[$21 >> 2] | 0) + 36; + } + $$0 = $$0 + 1 | 0; + } + $$025 = $$025 + 1 | 0; + } + __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE4swapERS6_($22, $19); + } while (0); + STACKTOP = sp; + return; +} + +function __ZNSt3__2L13utf16_to_utf8EPKtS1_RS1_PhS3_RS3_mNS_12codecvt_modeE($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $$4 = 0, $$pre80 = 0, $100 = 0, $109 = 0, $114 = 0, $117 = 0, $129 = 0, $134 = 0, $137 = 0, $14 = 0, $16 = 0, $18 = 0, $20 = 0, $21 = 0, $22 = 0, $25 = 0, $32 = 0, $43 = 0, $46 = 0, $58 = 0, $63 = 0, $69 = 0, $71 = 0, $77 = 0, $87 = 0, $91 = 0, label = 0; + HEAP32[$2 >> 2] = $0; + HEAP32[$5 >> 2] = $3; + $$pre80 = $4; + if ($7 & 2) if (($$pre80 - $3 | 0) < 3) $$4 = 1; else { + HEAP32[$5 >> 2] = $3 + 1; + HEAP8[$3 >> 0] = -17; + $14 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $14 + 1; + HEAP8[$14 >> 0] = -69; + $16 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $16 + 1; + HEAP8[$16 >> 0] = -65; + label = 4; + } else label = 4; + L4 : do if ((label | 0) == 4) { + $18 = $1; + $20 = HEAP32[$2 >> 2] | 0; + while (1) { + if ($20 >>> 0 >= $1 >>> 0) { + $$4 = 0; + break L4; + } + $21 = HEAP16[$20 >> 1] | 0; + $22 = $21 & 65535; + if ($22 >>> 0 > $6 >>> 0) { + $$4 = 2; + break L4; + } + do if (($21 & 65535) < 128) { + $25 = HEAP32[$5 >> 2] | 0; + if (($$pre80 - $25 | 0) < 1) { + $$4 = 1; + break L4; + } + HEAP32[$5 >> 2] = $25 + 1; + HEAP8[$25 >> 0] = $21; + } else { + if (($21 & 65535) < 2048) { + $32 = HEAP32[$5 >> 2] | 0; + if (($$pre80 - $32 | 0) < 2) { + $$4 = 1; + break L4; + } + HEAP32[$5 >> 2] = $32 + 1; + HEAP8[$32 >> 0] = $22 >>> 6 | 192; + $43 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $43 + 1; + HEAP8[$43 >> 0] = $22 & 63 | 128; + break; + } + if (($21 & 65535) < 55296) { + $46 = HEAP32[$5 >> 2] | 0; + if (($$pre80 - $46 | 0) < 3) { + $$4 = 1; + break L4; + } + HEAP32[$5 >> 2] = $46 + 1; + HEAP8[$46 >> 0] = $22 >>> 12 | 224; + $58 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $58 + 1; + HEAP8[$58 >> 0] = $22 >>> 6 & 63 | 128; + $63 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $63 + 1; + HEAP8[$63 >> 0] = $22 & 63 | 128; + break; + } + if (($21 & 65535) >= 56320) { + if (($21 & 65535) < 57344) { + $$4 = 2; + break L4; + } + $117 = HEAP32[$5 >> 2] | 0; + if (($$pre80 - $117 | 0) < 3) { + $$4 = 1; + break L4; + } + HEAP32[$5 >> 2] = $117 + 1; + HEAP8[$117 >> 0] = $22 >>> 12 | 224; + $129 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $129 + 1; + HEAP8[$129 >> 0] = $22 >>> 6 & 63 | 128; + $134 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $134 + 1; + HEAP8[$134 >> 0] = $22 & 63 | 128; + break; + } + if (($18 - $20 | 0) < 4) { + $$4 = 1; + break L4; + } + $69 = $20 + 2 | 0; + $71 = HEAPU16[$69 >> 1] | 0; + if (($71 & 64512 | 0) != 56320) { + $$4 = 2; + break L4; + } + if (($$pre80 - (HEAP32[$5 >> 2] | 0) | 0) < 4) { + $$4 = 1; + break L4; + } + $77 = $22 & 960; + if ((($77 << 10) + 65536 | $22 << 10 & 64512 | $71 & 1023) >>> 0 > $6 >>> 0) { + $$4 = 2; + break L4; + } + HEAP32[$2 >> 2] = $69; + $87 = ($77 >>> 6) + 1 | 0; + $91 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $91 + 1; + HEAP8[$91 >> 0] = $87 >>> 2 | 240; + $100 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $100 + 1; + HEAP8[$100 >> 0] = $22 >>> 2 & 15 | $87 << 4 & 48 | 128; + $109 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $109 + 1; + HEAP8[$109 >> 0] = $22 << 4 & 48 | $71 >>> 6 & 15 | 128; + $114 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $114 + 1; + HEAP8[$114 >> 0] = $71 & 63 | 128; + } while (0); + $137 = (HEAP32[$2 >> 2] | 0) + 2 | 0; + HEAP32[$2 >> 2] = $137; + $20 = $137; + } + } while (0); + return $$4 | 0; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0$i$i = 0, $$0$i$i$i$i = 0, $$0$i$i$i$i7 = 0, $$0$i$i2$i$i = 0, $$0$i$i2$i$i13 = 0, $20 = 0, $23 = 0, $35 = 0, $37 = 0, $5 = 0, $51 = 0, $52 = 0, $53 = 0, $62 = 0, $65 = 0, $78 = 0, $8 = 0, $80 = 0, $94 = 0, $95 = 0, $96 = 0, label = 0; + L1 : while (1) { + $5 = HEAP32[$1 >> 2] | 0; + do if ($5) { + $8 = HEAP32[$5 + 12 >> 2] | 0; + if (($8 | 0) == (HEAP32[$5 + 16 >> 2] | 0)) $$0$i$i$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$5 >> 2] | 0) + 36 >> 2] & 127]($5) | 0; else $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$8 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $94 = 1; + break; + } else { + $94 = (HEAP32[$1 >> 2] | 0) == 0; + break; + } + } else $94 = 1; while (0); + $20 = HEAP32[$2 >> 2] | 0; + do if ($20) { + $23 = HEAP32[$20 + 12 >> 2] | 0; + if (($23 | 0) == (HEAP32[$20 + 16 >> 2] | 0)) $$0$i$i2$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$20 >> 2] | 0) + 36 >> 2] & 127]($20) | 0; else $$0$i$i2$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$23 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($94) { + $95 = $20; + break; + } else { + $78 = $20; + break L1; + } else { + HEAP32[$2 >> 2] = 0; + label = 15; + break; + } + } else label = 15; while (0); + if ((label | 0) == 15) { + label = 0; + if ($94) { + $78 = 0; + break; + } else $95 = 0; + } + $35 = HEAP32[$1 >> 2] | 0; + $37 = HEAP32[$35 + 12 >> 2] | 0; + if (($37 | 0) == (HEAP32[$35 + 16 >> 2] | 0)) $$0$i$i = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$35 >> 2] | 0) + 36 >> 2] & 127]($35) | 0; else $$0$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$37 >> 2] | 0) | 0; + if (!(FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$4 >> 2] | 0) + 12 >> 2] & 63]($4, 8192, $$0$i$i) | 0)) { + $78 = $95; + break; + } + $51 = HEAP32[$1 >> 2] | 0; + $52 = $51 + 12 | 0; + $53 = HEAP32[$52 >> 2] | 0; + if (($53 | 0) == (HEAP32[$51 + 16 >> 2] | 0)) FUNCTION_TABLE_ii[HEAP32[(HEAP32[$51 >> 2] | 0) + 40 >> 2] & 127]($51) | 0; else { + HEAP32[$52 >> 2] = $53 + 4; + __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$53 >> 2] | 0) | 0; + } + } + $62 = HEAP32[$1 >> 2] | 0; + do if ($62) { + $65 = HEAP32[$62 + 12 >> 2] | 0; + if (($65 | 0) == (HEAP32[$62 + 16 >> 2] | 0)) $$0$i$i$i$i7 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$62 >> 2] | 0) + 36 >> 2] & 127]($62) | 0; else $$0$i$i$i$i7 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$65 >> 2] | 0) | 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i7, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) { + HEAP32[$1 >> 2] = 0; + $96 = 1; + break; + } else { + $96 = (HEAP32[$1 >> 2] | 0) == 0; + break; + } + } else $96 = 1; while (0); + do if ($78) { + $80 = HEAP32[$78 + 12 >> 2] | 0; + if (($80 | 0) == (HEAP32[$78 + 16 >> 2] | 0)) $$0$i$i2$i$i13 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$78 >> 2] | 0) + 36 >> 2] & 127]($78) | 0; else $$0$i$i2$i$i13 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$80 >> 2] | 0) | 0; + if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i2$i$i13, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) if ($96) break; else { + label = 40; + break; + } else { + HEAP32[$2 >> 2] = 0; + label = 38; + break; + } + } else label = 38; while (0); + if ((label | 0) == 38 ? $96 : 0) label = 40; + if ((label | 0) == 40) HEAP32[$3 >> 2] = HEAP32[$3 >> 2] | 2; + return; +} + +function _arith_decode($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$0$ph = 0, $$062 = 0, $$lcssa65 = 0, $$pre$phi72Z2D = 0, $10 = 0, $11 = 0, $12 = 0, $16 = 0, $17 = 0, $24 = 0, $29 = 0, $3 = 0, $31 = 0, $32 = 0, $34 = 0, $35 = 0, $4 = 0, $42 = 0, $47 = 0, $49 = 0, $5 = 0, $54 = 0, $55 = 0, $57 = 0, $60 = 0, $63 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $76 = 0, $8 = 0, $84 = 0, $9 = 0, $90 = 0, $91 = 0; + $3 = HEAP32[$0 + 468 >> 2] | 0; + $4 = $3 + 16 | 0; + $5 = HEAP32[$4 >> 2] | 0; + $7 = $3 + 20 | 0; + if (($5 | 0) < 32768) { + $8 = $0 + 440 | 0; + $9 = $0 + 24 | 0; + $10 = $3 + 12 | 0; + $12 = HEAP32[$7 >> 2] | 0; + while (1) { + $11 = $12 + -1 | 0; + HEAP32[$7 >> 2] = $11; + if (($12 | 0) < 1) { + if (!(HEAP32[$8 >> 2] | 0)) { + $16 = HEAP32[$9 >> 2] | 0; + $17 = $16 + 4 | 0; + if ((HEAP32[$17 >> 2] | 0) == 0 ? (FUNCTION_TABLE_ii[HEAP32[$16 + 12 >> 2] & 127]($0) | 0) == 0 : 0) { + $24 = HEAP32[$0 >> 2] | 0; + HEAP32[$24 + 20 >> 2] = 25; + FUNCTION_TABLE_vi[HEAP32[$24 >> 2] & 255]($0); + } + HEAP32[$17 >> 2] = (HEAP32[$17 >> 2] | 0) + -1; + $29 = HEAP32[$16 >> 2] | 0; + HEAP32[$16 >> 2] = $29 + 1; + $31 = HEAP8[$29 >> 0] | 0; + $32 = $31 & 255; + L13 : do if ($31 << 24 >> 24 == -1) { + L15 : while (1) { + $34 = HEAP32[$9 >> 2] | 0; + $35 = $34 + 4 | 0; + if ((HEAP32[$35 >> 2] | 0) == 0 ? (FUNCTION_TABLE_ii[HEAP32[$34 + 12 >> 2] & 127]($0) | 0) == 0 : 0) { + $42 = HEAP32[$0 >> 2] | 0; + HEAP32[$42 + 20 >> 2] = 25; + FUNCTION_TABLE_vi[HEAP32[$42 >> 2] & 255]($0); + } + HEAP32[$35 >> 2] = (HEAP32[$35 >> 2] | 0) + -1; + $47 = HEAP32[$34 >> 2] | 0; + HEAP32[$34 >> 2] = $47 + 1; + $49 = HEAP8[$47 >> 0] | 0; + switch ($49 << 24 >> 24) { + case 0: + { + $$0$ph = 255; + break L13; + break; + } + case -1: + break; + default: + break L15; + } + } + HEAP32[$8 >> 2] = $49 & 255; + $$0$ph = 0; + } else $$0$ph = $32; while (0); + $$0 = $$0$ph; + $55 = HEAP32[$7 >> 2] | 0; + } else { + $$0 = 0; + $55 = $11; + } + HEAP32[$10 >> 2] = HEAP32[$10 >> 2] << 8 | $$0; + $54 = $55 + 8 | 0; + HEAP32[$7 >> 2] = $54; + if (($55 | 0) < -8) { + $57 = $55 + 9 | 0; + HEAP32[$7 >> 2] = $57; + if (!$57) { + HEAP32[$4 >> 2] = 32768; + $91 = 0; + } else $91 = $57; + } else $91 = $54; + } else $91 = $11; + $60 = HEAP32[$4 >> 2] << 1; + HEAP32[$4 >> 2] = $60; + if (($60 | 0) < 32768) $12 = $91; else { + $$lcssa65 = $60; + $$pre$phi72Z2D = $10; + $71 = $91; + break; + } + } + } else { + $$lcssa65 = $5; + $$pre$phi72Z2D = $3 + 12 | 0; + $71 = HEAP32[$7 >> 2] | 0; + } + $63 = HEAPU8[$1 >> 0] | 0; + $66 = HEAP32[3872 + (($63 & 127) << 2) >> 2] | 0; + $67 = $66 >> 8; + $68 = $66 >> 16; + $69 = $$lcssa65 - $68 | 0; + HEAP32[$4 >> 2] = $69; + $70 = $69 << $71; + $72 = HEAP32[$$pre$phi72Z2D >> 2] | 0; + if (($72 | 0) >= ($70 | 0)) { + HEAP32[$$pre$phi72Z2D >> 2] = $72 - $70; + HEAP32[$4 >> 2] = $68; + $76 = $63 & 128; + if (($69 | 0) < ($68 | 0)) { + HEAP8[$1 >> 0] = $76 ^ $67; + $$062 = $63; + $90 = $$062 >> 7; + return $90 | 0; + } else { + HEAP8[$1 >> 0] = $76 ^ $66; + $$062 = $63 ^ 128; + $90 = $$062 >> 7; + return $90 | 0; + } + } + if (($69 | 0) >= 32768) { + $$062 = $63; + $90 = $$062 >> 7; + return $90 | 0; + } + $84 = $63 & 128; + if (($69 | 0) < ($68 | 0)) { + HEAP8[$1 >> 0] = $84 ^ $66; + $$062 = $63 ^ 128; + $90 = $$062 >> 7; + return $90 | 0; + } else { + HEAP8[$1 >> 0] = $84 ^ $67; + $$062 = $63; + $90 = $$062 >> 7; + return $90 | 0; + } + return 0; +} + +function _get_interesting_appn($0) { + $0 = $0 | 0; + var $$0 = 0, $$066 = 0, $$070 = 0, $$071 = 0, $$07278 = 0, $$1 = 0, $$167 = 0, $$2 = 0, $$2$lcssa = 0, $$268 = 0, $$268$lcssa = 0, $$26877 = 0, $$26880 = 0, $$276 = 0, $$279 = 0, $$3 = 0, $$369 = 0, $1 = 0, $103 = 0, $12 = 0, $13 = 0, $16 = 0, $2 = 0, $26 = 0, $27 = 0, $3 = 0, $31 = 0, $4 = 0, $42 = 0, $44 = 0, $5 = 0, $75 = 0, $83 = 0, $85 = 0, $87 = 0, $97 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + $2 = $0 + 24 | 0; + $3 = HEAP32[$2 >> 2] | 0; + $4 = $3 + 4 | 0; + $5 = HEAP32[$4 >> 2] | 0; + do if (!$5) if (!(FUNCTION_TABLE_ii[HEAP32[$3 + 12 >> 2] & 127]($0) | 0)) { + $$070 = 0; + STACKTOP = sp; + return $$070 | 0; + } else { + $$0 = HEAP32[$4 >> 2] | 0; + break; + } else $$0 = $5; while (0); + $$066 = HEAP32[$3 >> 2] | 0; + $12 = $$0 + -1 | 0; + $13 = $$066 + 1 | 0; + $16 = HEAPU8[$$066 >> 0] << 8; + do if (!$12) if (!(FUNCTION_TABLE_ii[HEAP32[$3 + 12 >> 2] & 127]($0) | 0)) { + $$070 = 0; + STACKTOP = sp; + return $$070 | 0; + } else { + $$1 = HEAP32[$4 >> 2] | 0; + $$167 = HEAP32[$3 >> 2] | 0; + break; + } else { + $$1 = $12; + $$167 = $13; + } while (0); + $26 = $16 | HEAPU8[$$167 >> 0]; + $27 = $26 + -2 | 0; + $$071 = $26 >>> 0 > 15 ? 14 : $26 >>> 0 > 2 ? $27 : 0; + $$276 = $$1 + -1 | 0; + $$26877 = $$167 + 1 | 0; + L13 : do if (!$$071) { + $$2$lcssa = $$276; + $$268$lcssa = $$26877; + } else { + $31 = $3 + 12 | 0; + $$07278 = 0; + $$26880 = $$26877; + $$279 = $$276; + while (1) { + if (!$$279) { + if (!(FUNCTION_TABLE_ii[HEAP32[$31 >> 2] & 127]($0) | 0)) { + $$070 = 0; + break; + } + $$3 = HEAP32[$4 >> 2] | 0; + $$369 = HEAP32[$3 >> 2] | 0; + } else { + $$3 = $$279; + $$369 = $$26880; + } + HEAP8[$1 + $$07278 >> 0] = HEAP8[$$369 >> 0] | 0; + $$07278 = $$07278 + 1 | 0; + $$2 = $$3 + -1 | 0; + $$268 = $$369 + 1 | 0; + if ($$07278 >>> 0 >= $$071 >>> 0) { + $$2$lcssa = $$2; + $$268$lcssa = $$268; + break L13; + } else { + $$26880 = $$268; + $$279 = $$2; + } + } + STACKTOP = sp; + return $$070 | 0; + } while (0); + $42 = $27 - $$071 | 0; + $44 = HEAP32[$0 + 440 >> 2] | 0; + L23 : do switch ($44 | 0) { + case 224: + { + _examine_app0($0, $1, $$071, $42); + break; + } + case 238: + { + if (((($$071 >>> 0 > 11 & (HEAP8[$1 >> 0] | 0) == 65 ? (HEAP8[$1 + 1 >> 0] | 0) == 100 : 0) ? (HEAP8[$1 + 2 >> 0] | 0) == 111 : 0) ? (HEAP8[$1 + 3 >> 0] | 0) == 98 : 0) ? (HEAP8[$1 + 4 >> 0] | 0) == 101 : 0) { + $75 = HEAPU8[$1 + 7 >> 0] << 8 | HEAPU8[$1 + 8 >> 0]; + $83 = HEAPU8[$1 + 9 >> 0] << 8 | HEAPU8[$1 + 10 >> 0]; + $85 = HEAP8[$1 + 11 >> 0] | 0; + $87 = HEAP32[$0 >> 2] | 0; + HEAP32[$87 + 24 >> 2] = HEAPU8[$1 + 5 >> 0] << 8 | HEAPU8[$1 + 6 >> 0]; + HEAP32[$87 + 28 >> 2] = $75; + HEAP32[$87 + 32 >> 2] = $83; + HEAP32[$87 + 36 >> 2] = $85 & 255; + HEAP32[$87 + 20 >> 2] = 78; + FUNCTION_TABLE_vii[HEAP32[$87 + 4 >> 2] & 255]($0, 1); + HEAP32[$0 + 296 >> 2] = 1; + HEAP8[$0 + 300 >> 0] = $85; + break L23; + } + $97 = HEAP32[$0 >> 2] | 0; + HEAP32[$97 + 20 >> 2] = 80; + HEAP32[$97 + 24 >> 2] = $27; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 1); + break; + } + default: + { + $103 = HEAP32[$0 >> 2] | 0; + HEAP32[$103 + 20 >> 2] = 70; + HEAP32[$103 + 24 >> 2] = $44; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + } while (0); + HEAP32[$3 >> 2] = $$268$lcssa; + HEAP32[$4 >> 2] = $$2$lcssa; + if (($42 | 0) <= 0) { + $$070 = 1; + STACKTOP = sp; + return $$070 | 0; + } + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$2 >> 2] | 0) + 16 >> 2] & 255]($0, $42); + $$070 = 1; + STACKTOP = sp; + return $$070 | 0; +} + +function __ZN6vision20VisualDatabaseFacade30addFreakFeaturesAndDescriptorsERKNSt3__26vectorINS_12FeaturePointENS1_9allocatorIS3_EEEERKNS2_IhNS4_IhEEEERKNS2_INS_7Point3dIfEENS4_ISE_EEEEmmi($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$byval_copy = 0, $10 = 0, $11 = 0, $18 = 0, $19 = 0, $26 = 0, $32 = 0, $33 = 0, $39 = 0, $45 = 0, $49 = 0, $51 = 0, $57 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp + 24 | 0; + $7 = sp + 12 | 0; + $8 = sp + 16 | 0; + $9 = sp + 8 | 0; + $10 = sp; + HEAP32[$7 >> 2] = $6; + $11 = __Znwm(148) | 0; + __ZN6vision8KeyframeILi96EEC2Ev($11); + HEAP32[$9 >> 2] = 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$9 >> 2]; + __ZNSt3__210shared_ptrIN6vision8KeyframeILi96EEEEC2IS3_EEPT_NS_9enable_ifIXsr14is_convertibleIS7_PS3_EE5valueENS4_5__natEE4typeE($8, $11, $$byval_copy); + __ZN6vision8KeyframeILi96EE8setWidthEi(HEAP32[$8 >> 2] | 0, $4); + __ZN6vision8KeyframeILi96EE9setHeightEi(HEAP32[$8 >> 2] | 0, $5); + __ZN6vision18BinaryFeatureStore21setNumBytesPerFeatureEi(__ZN6vision8KeyframeILi96EE5storeEv(HEAP32[$8 >> 2] | 0) | 0, 96); + $18 = __ZN6vision18BinaryFeatureStore6pointsEv(__ZN6vision8KeyframeILi96EE5storeEv(HEAP32[$8 >> 2] | 0) | 0) | 0; + $19 = $1 + 4 | 0; + __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE6resizeEm($18, ((HEAP32[$19 >> 2] | 0) - (HEAP32[$1 >> 2] | 0) | 0) / 20 | 0); + $26 = __ZN6vision18BinaryFeatureStore6pointsEv(__ZN6vision8KeyframeILi96EE5storeEv(HEAP32[$8 >> 2] | 0) | 0) | 0; + if (($26 | 0) != ($1 | 0)) __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE6assignIPS2_EENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr16is_constructibleIS2_NS_15iterator_traitsIS9_E9referenceEEE5valueEvE4typeES9_S9_($26, HEAP32[$1 >> 2] | 0, HEAP32[$19 >> 2] | 0); + $32 = __ZN6vision18BinaryFeatureStore8featuresEv(__ZN6vision8KeyframeILi96EE5storeEv(HEAP32[$8 >> 2] | 0) | 0) | 0; + $33 = $2 + 4 | 0; + __ZNSt3__26vectorIhNS_9allocatorIhEEE6resizeEm($32, (HEAP32[$33 >> 2] | 0) - (HEAP32[$2 >> 2] | 0) | 0); + $39 = __ZN6vision18BinaryFeatureStore8featuresEv(__ZN6vision8KeyframeILi96EE5storeEv(HEAP32[$8 >> 2] | 0) | 0) | 0; + if (($39 | 0) != ($2 | 0)) __ZNSt3__26vectorIhNS_9allocatorIhEEE6assignIPhEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr16is_constructibleIhNS_15iterator_traitsIS7_E9referenceEEE5valueEvE4typeES7_S7_($39, HEAP32[$2 >> 2] | 0, HEAP32[$33 >> 2] | 0); + __ZN6vision8KeyframeILi96EE10buildIndexEv(HEAP32[$8 >> 2] | 0); + $45 = HEAP32[HEAP32[$0 >> 2] >> 2] | 0; + HEAP32[$10 >> 2] = HEAP32[$8 >> 2]; + $49 = HEAP32[$8 + 4 >> 2] | 0; + HEAP32[$10 + 4 >> 2] = $49; + if ($49 | 0) { + $51 = $49 + 4 | 0; + HEAP32[$51 >> 2] = (HEAP32[$51 >> 2] | 0) + 1; + } + __ZN6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEE11addKeyframeENSt3__210shared_ptrINS_8KeyframeILi96EEEEEi($45, $10, HEAP32[$7 >> 2] | 0); + __ZNSt3__210shared_ptrIN6vision8KeyframeILi96EEEED2Ev($10); + $57 = __ZNSt3__213unordered_mapIiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS4_EEEENS_4hashIiEENS_8equal_toIiEENS5_INS_4pairIKiS7_EEEEEixERSD_((HEAP32[$0 >> 2] | 0) + 4 | 0, $7) | 0; + if (($57 | 0) != ($3 | 0)) __ZNSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE6assignIPS3_EENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr16is_constructibleIS3_NS_15iterator_traitsISA_E9referenceEEE5valueEvE4typeESA_SA_($57, HEAP32[$3 >> 2] | 0, HEAP32[$3 + 4 >> 2] | 0); + __ZNSt3__210shared_ptrIN6vision8KeyframeILi96EEEED2Ev($8); + STACKTOP = sp; + return; +} + +function __ZNKSt3__27codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $$0 = 0, $$069 = 0, $$070 = 0, $$070$lcssa = 0, $$077 = 0, $$079 = 0, $$171 = 0, $$173 = 0, $$178 = 0, $$2 = 0, $$2$lcssa = 0, $$375$ph = 0, $$476 = 0, $$5$ph85 = 0, $14 = 0, $15 = 0, $18 = 0, $23 = 0, $24 = 0, $35 = 0, $36 = 0, $40 = 0, $42 = 0, $43 = 0, $44 = 0, $48 = 0, $51 = 0, $55 = 0, $56 = 0, $64 = 0, $66 = 0, $67 = 0, $75 = 0, $77 = 0, $78 = 0, $8 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $8 = sp; + $9 = sp + 8 | 0; + $$070 = $2; + while (1) { + if (($$070 | 0) == ($3 | 0)) { + $$070$lcssa = $3; + break; + } + if (!(HEAP32[$$070 >> 2] | 0)) { + $$070$lcssa = $$070; + break; + } + $$070 = $$070 + 4 | 0; + } + HEAP32[$7 >> 2] = $5; + HEAP32[$4 >> 2] = $2; + $14 = $6; + $15 = $0 + 8 | 0; + $$077 = $2; + $$079 = $5; + $$171 = $$070$lcssa; + L6 : while (1) { + if (($$079 | 0) == ($6 | 0) | ($$077 | 0) == ($3 | 0)) { + $75 = $$077; + label = 36; + break; + } + $18 = $1; + $23 = HEAP32[$18 + 4 >> 2] | 0; + $24 = $8; + HEAP32[$24 >> 2] = HEAP32[$18 >> 2]; + HEAP32[$24 + 4 >> 2] = $23; + $35 = ___uselocale(HEAP32[$15 >> 2] | 0) | 0; + $36 = _wcsnrtombs($$079, $4, $$171 - $$077 >> 2, $14 - $$079 | 0, $1) | 0; + if ($35 | 0) ___uselocale($35) | 0; + switch ($36 | 0) { + case -1: + { + label = 10; + break L6; + break; + } + case 0: + { + $$375$ph = 1; + label = 33; + break L6; + break; + } + default: + {} + } + $51 = (HEAP32[$7 >> 2] | 0) + $36 | 0; + HEAP32[$7 >> 2] = $51; + if (($51 | 0) == ($6 | 0)) { + label = 34; + break; + } + if (($$171 | 0) == ($3 | 0)) { + $$5$ph85 = $3; + $77 = $51; + $78 = HEAP32[$4 >> 2] | 0; + } else { + $55 = ___uselocale(HEAP32[$15 >> 2] | 0) | 0; + $56 = _wcrtomb($9, 0, $1) | 0; + if ($55 | 0) ___uselocale($55) | 0; + if (($56 | 0) == -1) { + $$173 = 2; + label = 32; + break; + } + if ($56 >>> 0 > ($14 - (HEAP32[$7 >> 2] | 0) | 0) >>> 0) { + $$173 = 1; + label = 32; + break; + } + $$0 = $9; + $$069 = $56; + while (1) { + if (!$$069) break; + $66 = HEAP8[$$0 >> 0] | 0; + $67 = HEAP32[$7 >> 2] | 0; + HEAP32[$7 >> 2] = $67 + 1; + HEAP8[$67 >> 0] = $66; + $$0 = $$0 + 1 | 0; + $$069 = $$069 + -1 | 0; + } + $64 = (HEAP32[$4 >> 2] | 0) + 4 | 0; + HEAP32[$4 >> 2] = $64; + $$2 = $64; + while (1) { + if (($$2 | 0) == ($3 | 0)) { + $$2$lcssa = $3; + break; + } + if (!(HEAP32[$$2 >> 2] | 0)) { + $$2$lcssa = $$2; + break; + } + $$2 = $$2 + 4 | 0; + } + $$5$ph85 = $$2$lcssa; + $77 = HEAP32[$7 >> 2] | 0; + $78 = $64; + } + $$077 = $78; + $$079 = $77; + $$171 = $$5$ph85; + } + if ((label | 0) == 10) { + HEAP32[$7 >> 2] = $$079; + $$178 = $$077; + $43 = $$079; + while (1) { + if (($$178 | 0) == (HEAP32[$4 >> 2] | 0)) break; + $40 = HEAP32[$$178 >> 2] | 0; + $42 = ___uselocale(HEAP32[$15 >> 2] | 0) | 0; + $44 = _wcrtomb($43, $40, $8) | 0; + if ($42 | 0) ___uselocale($42) | 0; + if (($44 | 0) == -1) break; + $48 = (HEAP32[$7 >> 2] | 0) + $44 | 0; + HEAP32[$7 >> 2] = $48; + $$178 = $$178 + 4 | 0; + $43 = $48; + } + HEAP32[$4 >> 2] = $$178; + $$375$ph = 2; + label = 33; + } else if ((label | 0) == 32) { + $$375$ph = $$173; + label = 33; + } else if ((label | 0) == 34) { + $75 = HEAP32[$4 >> 2] | 0; + label = 36; + } + if ((label | 0) == 33) $$476 = $$375$ph; else if ((label | 0) == 36) $$476 = ($75 | 0) != ($3 | 0) & 1; + STACKTOP = sp; + return $$476 | 0; +} + +function __ZNKSt3__27codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $$070 = 0, $$070$lcssa = 0, $$074 = 0, $$077 = 0, $$1 = 0, $$172$ph = 0, $$175 = 0, $$2 = 0, $$2$lcssa = 0, $$273 = 0, $$4$ph = 0, $$pre = 0, $$sink = 0, $13 = 0, $14 = 0, $17 = 0, $22 = 0, $23 = 0, $34 = 0, $35 = 0, $38 = 0, $44 = 0, $45 = 0, $53 = 0, $57 = 0, $58 = 0, $64 = 0, $70 = 0, $72 = 0, $73 = 0, $8 = 0, $storemerge = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $8 = sp; + $$070 = $2; + while (1) { + if (($$070 | 0) == ($3 | 0)) { + $$070$lcssa = $3; + break; + } + if (!(HEAP8[$$070 >> 0] | 0)) { + $$070$lcssa = $$070; + break; + } + $$070 = $$070 + 1 | 0; + } + HEAP32[$7 >> 2] = $5; + HEAP32[$4 >> 2] = $2; + $13 = $6; + $14 = $0 + 8 | 0; + $$074 = $2; + $$077 = $5; + $$1 = $$070$lcssa; + while (1) { + if (($$077 | 0) == ($6 | 0) | ($$074 | 0) == ($3 | 0)) { + $70 = $$074; + label = 33; + break; + } + $17 = $1; + $22 = HEAP32[$17 + 4 >> 2] | 0; + $23 = $8; + HEAP32[$23 >> 2] = HEAP32[$17 >> 2]; + HEAP32[$23 + 4 >> 2] = $22; + $34 = ___uselocale(HEAP32[$14 >> 2] | 0) | 0; + $35 = _mbsnrtowcs($$077, $4, $$1 - $$074 | 0, $13 - $$077 >> 2, $1) | 0; + if ($34 | 0) ___uselocale($34) | 0; + if (($35 | 0) == -1) { + label = 10; + break; + } + $53 = (HEAP32[$7 >> 2] | 0) + ($35 << 2) | 0; + HEAP32[$7 >> 2] = $53; + if (($53 | 0) == ($6 | 0)) { + label = 30; + break; + } + $$pre = HEAP32[$4 >> 2] | 0; + if (($$1 | 0) == ($3 | 0)) { + $$4$ph = $3; + $72 = $53; + $73 = $$pre; + } else { + $57 = ___uselocale(HEAP32[$14 >> 2] | 0) | 0; + $58 = _mbrtowc($53, $$pre, 1, $1) | 0; + if ($57 | 0) ___uselocale($57) | 0; + if ($58 | 0) { + $$172$ph = 2; + label = 29; + break; + } + HEAP32[$7 >> 2] = (HEAP32[$7 >> 2] | 0) + 4; + $64 = (HEAP32[$4 >> 2] | 0) + 1 | 0; + HEAP32[$4 >> 2] = $64; + $$2 = $64; + while (1) { + if (($$2 | 0) == ($3 | 0)) { + $$2$lcssa = $3; + break; + } + if (!(HEAP8[$$2 >> 0] | 0)) { + $$2$lcssa = $$2; + break; + } + $$2 = $$2 + 1 | 0; + } + $$4$ph = $$2$lcssa; + $72 = HEAP32[$7 >> 2] | 0; + $73 = $64; + } + $$074 = $73; + $$077 = $72; + $$1 = $$4$ph; + } + do if ((label | 0) == 10) { + $38 = $$1; + $$175 = $$074; + $storemerge = $$077; + L29 : while (1) { + HEAP32[$7 >> 2] = $storemerge; + if (($$175 | 0) == (HEAP32[$4 >> 2] | 0)) { + label = 19; + break; + } + $44 = ___uselocale(HEAP32[$14 >> 2] | 0) | 0; + $45 = _mbrtowc($storemerge, $$175, $38 - $$175 | 0, $8) | 0; + if ($44 | 0) ___uselocale($44) | 0; + switch ($45 | 0) { + case -1: + { + label = 15; + break L29; + break; + } + case -2: + { + label = 16; + break L29; + break; + } + case 0: + { + $$sink = 1; + break; + } + default: + $$sink = $45; + } + $$175 = $$175 + $$sink | 0; + $storemerge = (HEAP32[$7 >> 2] | 0) + 4 | 0; + } + if ((label | 0) == 15) { + HEAP32[$4 >> 2] = $$175; + $$172$ph = 2; + label = 29; + break; + } else if ((label | 0) == 16) { + HEAP32[$4 >> 2] = $$175; + $$172$ph = 1; + label = 29; + break; + } else if ((label | 0) == 19) { + HEAP32[$4 >> 2] = $$175; + $$172$ph = ($$175 | 0) != ($3 | 0) & 1; + label = 29; + break; + } + } else if ((label | 0) == 30) { + $70 = HEAP32[$4 >> 2] | 0; + label = 33; + } while (0); + if ((label | 0) == 29) $$273 = $$172$ph; else if ((label | 0) == 33) $$273 = ($70 | 0) != ($3 | 0) & 1; + STACKTOP = sp; + return $$273 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle8FoldExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$pre$phi22Z2D = 0, $14 = 0, $16 = 0, $17 = 0, $2 = 0, $22 = 0, $23 = 0, $27 = 0, $3 = 0, $32 = 0, $33 = 0, $37 = 0, $38 = 0, $4 = 0, $43 = 0, $44 = 0, $48 = 0, $5 = 0, $51 = 0, $56 = 0, $57 = 0, $6 = 0, $7 = 0, $8 = 0, $tmpcast18$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $tmpcast18$byval_copy = sp + 56 | 0; + $2 = sp + 32 | 0; + $3 = sp + 24 | 0; + $4 = sp + 48 | 0; + $5 = sp + 16 | 0; + $6 = sp + 8 | 0; + $7 = sp + 40 | 0; + $8 = sp; + HEAP32[$2 >> 2] = $1; + HEAP32[$2 + 4 >> 2] = $0; + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 40); + if (!(HEAP8[$0 + 24 >> 0] | 0)) { + __ZZNK12_GLOBAL__N_116itanium_demangle8FoldExpr9printLeftERNS_12OutputStreamEENKUlvE_clEv($2); + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 32); + $37 = $0 + 16 | 0; + $38 = $37; + $43 = HEAP32[$38 + 4 >> 2] | 0; + $44 = $6; + HEAP32[$44 >> 2] = HEAP32[$38 >> 2]; + HEAP32[$44 + 4 >> 2] = $43; + HEAP32[$tmpcast18$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$tmpcast18$byval_copy + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast18$byval_copy); + __ZN12_GLOBAL__N_110StringViewC2EPKc($7, 54862); + HEAP32[$tmpcast18$byval_copy >> 2] = HEAP32[$7 >> 2]; + HEAP32[$tmpcast18$byval_copy + 4 >> 2] = HEAP32[$7 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast18$byval_copy); + $48 = $0 + 12 | 0; + if (HEAP32[$48 >> 2] | 0) { + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 32); + $51 = $37; + $56 = HEAP32[$51 + 4 >> 2] | 0; + $57 = $8; + HEAP32[$57 >> 2] = HEAP32[$51 >> 2]; + HEAP32[$57 + 4 >> 2] = $56; + HEAP32[$tmpcast18$byval_copy >> 2] = HEAP32[$8 >> 2]; + HEAP32[$tmpcast18$byval_copy + 4 >> 2] = HEAP32[$8 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast18$byval_copy); + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 32); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$48 >> 2] | 0, $1); + } + } else { + $14 = HEAP32[$0 + 12 >> 2] | 0; + if (!$14) $$pre$phi22Z2D = $0 + 16 | 0; else { + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE($14, $1); + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 32); + $16 = $0 + 16 | 0; + $17 = $16; + $22 = HEAP32[$17 + 4 >> 2] | 0; + $23 = $3; + HEAP32[$23 >> 2] = HEAP32[$17 >> 2]; + HEAP32[$23 + 4 >> 2] = $22; + HEAP32[$tmpcast18$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast18$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast18$byval_copy); + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 32); + $$pre$phi22Z2D = $16; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 54857); + HEAP32[$tmpcast18$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$tmpcast18$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast18$byval_copy); + $27 = $$pre$phi22Z2D; + $32 = HEAP32[$27 + 4 >> 2] | 0; + $33 = $5; + HEAP32[$33 >> 2] = HEAP32[$27 >> 2]; + HEAP32[$33 + 4 >> 2] = $32; + HEAP32[$tmpcast18$byval_copy >> 2] = HEAP32[$5 >> 2]; + HEAP32[$tmpcast18$byval_copy + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast18$byval_copy); + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 32); + __ZZNK12_GLOBAL__N_116itanium_demangle8FoldExpr9printLeftERNS_12OutputStreamEENKUlvE_clEv($2); + } + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 41); + STACKTOP = sp; + return; +} + +function __ZNK6vision28BinaryHierarchicalClusteringILi96EE5queryEPKh($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i$add$i$i = 0, $$0$i$i$idx$i$i = 0, $$byval_copy = 0, $$byval_copy1 = 0, $$byval_copy2 = 0, $14 = 0, $19 = 0, $2 = 0, $23 = 0, $25 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $32 = 0, $33 = 0, $35 = 0, $38 = 0, $39 = 0, $4 = 0, $41 = 0, $44 = 0, $45 = 0, $49 = 0, $5 = 0, $54 = 0, $55 = 0, $59 = 0, $6 = 0, $66 = 0, $67 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy2 = sp + 8 | 0; + $$byval_copy1 = sp + 32 | 0; + $$byval_copy = sp + 28 | 0; + $2 = sp + 24 | 0; + $3 = sp + 20 | 0; + $4 = sp + 16 | 0; + $5 = sp; + $6 = $0 + 8 | 0; + if (!(HEAP32[$6 >> 2] | 0)) { + $14 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36082) | 0, 33262) | 0, 39072) | 0, 405) | 0, 39079) | 0, 36117) | 0; + __ZNKSt3__28ios_base6getlocEv($$byval_copy2, $14 + (HEAP32[(HEAP32[$14 >> 2] | 0) + -12 >> 2] | 0) | 0); + $19 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy2, 66512) | 0; + $23 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$19 >> 2] | 0) + 28 >> 2] & 127]($19, 10) | 0; + __ZNSt3__26localeD2Ev($$byval_copy2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($14, $23) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($14) | 0; + _abort(); + } + HEAP32[$0 + 100 >> 2] = 0; + $25 = $0 + 72 | 0; + $27 = $0 + 76 | 0; + HEAP32[$27 >> 2] = HEAP32[$25 >> 2]; + $28 = $0 + 84 | 0; + $29 = $0 + 88 | 0; + $32 = HEAP32[$29 >> 2] | 0; + while (1) { + $30 = HEAP32[$28 >> 2] | 0; + $33 = $30; + if (($30 | 0) == ($32 | 0)) break; + $35 = $32 - $33 | 0; + if (($35 | 0) > 8) { + $38 = $32 + -8 | 0; + $39 = $30; + $41 = HEAP32[$39 >> 2] | 0; + $44 = HEAP32[$39 + 4 >> 2] | 0; + $45 = $$byval_copy2; + HEAP32[$45 >> 2] = $41; + HEAP32[$45 + 4 >> 2] = $44; + $49 = $38; + $54 = HEAP32[$49 + 4 >> 2] | 0; + $55 = $30; + HEAP32[$55 >> 2] = HEAP32[$49 >> 2]; + HEAP32[$55 + 4 >> 2] = $54; + $59 = $38; + HEAP32[$59 >> 2] = $41; + HEAP32[$59 + 4 >> 2] = $44; + __ZN6vision17PriorityQueueItemILi96EED2Ev($$byval_copy2); + HEAP32[$2 >> 2] = $33; + HEAP32[$3 >> 2] = $38; + HEAP32[$4 >> 2] = $33; + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy2 >> 2] = HEAP32[$4 >> 2]; + __ZNSt3__211__sift_downIRNS_4lessIN6vision17PriorityQueueItemILi96EEEEENS_11__wrap_iterIPS4_EEEEvT0_SA_T_NS_15iterator_traitsISA_E15difference_typeESA_($$byval_copy, $$byval_copy1, $5, ($35 >>> 3) + -1 | 0, $$byval_copy2); + $66 = HEAP32[$29 >> 2] | 0; + } else $66 = $32; + $$0$i$i$idx$i$i = 0; + while (1) { + if (($$0$i$i$idx$i$i | 0) == -1) break; + $$0$i$i$add$i$i = $$0$i$i$idx$i$i + -1 | 0; + __ZN6vision17PriorityQueueItemILi96EED2Ev($66 + ($$0$i$i$add$i$i << 3) | 0); + $$0$i$i$idx$i$i = $$0$i$i$add$i$i; + } + $67 = $66 + -8 | 0; + HEAP32[$29 >> 2] = $67; + $32 = $67; + } + __ZNK6vision28BinaryHierarchicalClusteringILi96EE5queryERNSt3__214priority_queueINS_17PriorityQueueItemILi96EEENS2_6vectorIS5_NS2_9allocatorIS5_EEEENS2_4lessIS5_EEEEPKNS_4NodeILi96EEEPKh($0, $28, HEAP32[$6 >> 2] | 0, $1); + STACKTOP = sp; + return (HEAP32[$27 >> 2] | 0) - (HEAP32[$25 >> 2] | 0) >> 2 | 0; +} + +function __ZNK6vision21HoughSimilarityVoting17mapCorrespondenceERfS1_S1_S1_ffffffff($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = +$5; + $6 = +$6; + $7 = +$7; + $8 = +$8; + $9 = +$9; + $10 = +$10; + $11 = +$11; + $12 = +$12; + var $$sink = 0.0, $13 = 0, $14 = 0, $15 = 0.0, $16 = 0.0, $23 = 0.0, $24 = 0.0, $31 = 0, $36 = 0, $40 = 0, $47 = 0, $52 = 0, $56 = 0, $57 = 0.0, $60 = 0.0, $64 = 0.0, $67 = 0.0, $71 = 0.0, $74 = 0.0, $79 = 0, $82 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $13 = sp + 16 | 0; + $14 = sp; + $15 = $7 - $11; + HEAPF32[$3 >> 2] = $15; + $16 = $15; + if (!($16 <= -3.141592653589793)) if ($16 > 3.141592653589793) { + $$sink = $16 + -6.283185307179586; + label = 5; + } else $24 = $15; else { + $$sink = $16 + 6.283185307179586; + label = 5; + } + if ((label | 0) == 5) { + HEAPF32[$3 >> 2] = $$sink; + $24 = $$sink; + } + $23 = $24; + if (!($23 > -3.141592653589793)) { + $31 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36444) | 0, 36227) | 0, 39072) | 0, 468) | 0, 39079) | 0, 36479) | 0; + __ZNKSt3__28ios_base6getlocEv($13, $31 + (HEAP32[(HEAP32[$31 >> 2] | 0) + -12 >> 2] | 0) | 0); + $36 = __ZNKSt3__26locale9use_facetERNS0_2idE($13, 66512) | 0; + $40 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$36 >> 2] | 0) + 28 >> 2] & 127]($36, 10) | 0; + __ZNSt3__26localeD2Ev($13); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($31, $40) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($31) | 0; + _abort(); + } + if (!($23 <= 3.141592653589793)) { + $47 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36498) | 0, 36227) | 0, 39072) | 0, 469) | 0, 39079) | 0, 36479) | 0; + __ZNKSt3__28ios_base6getlocEv($13, $47 + (HEAP32[(HEAP32[$47 >> 2] | 0) + -12 >> 2] | 0) | 0); + $52 = __ZNKSt3__26locale9use_facetERNS0_2idE($13, 66512) | 0; + $56 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$52 >> 2] | 0) + 28 >> 2] & 127]($52, 10) | 0; + __ZNSt3__26localeD2Ev($13); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($47, $56) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($47) | 0; + _abort(); + } else { + $57 = +__ZN6vision12SafeDivisionIfEET_S1_S1_($8, $12); + HEAPF32[$4 >> 2] = $57; + __ZN6vision13Similarity2x2IfEEvPT_S1_S1_($14, +HEAPF32[$3 >> 2], $57); + $60 = +Math_log(+(+HEAPF32[$4 >> 2])); + HEAPF32[$4 >> 2] = $60 * +HEAPF32[$0 + 48 >> 2]; + $64 = +HEAPF32[$14 >> 2]; + $67 = +HEAPF32[$14 + 4 >> 2]; + $71 = +HEAPF32[$14 + 8 >> 2]; + $74 = +HEAPF32[$14 + 12 >> 2]; + $79 = $0 + 8 | 0; + $82 = $0 + 12 | 0; + HEAPF32[$1 >> 2] = $5 - ($64 * $9 + $67 * $10) + ($64 * +HEAPF32[$79 >> 2] + $67 * +HEAPF32[$82 >> 2]); + HEAPF32[$2 >> 2] = $6 - ($71 * $9 + $74 * $10) + ($71 * +HEAPF32[$79 >> 2] + $74 * +HEAPF32[$82 >> 2]); + STACKTOP = sp; + return; + } +} + +function __ZNSt3__2L12utf8_to_ucs4EPKhS1_RS1_PjS3_RS3_mNS_12codecvt_modeE($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $$9 = 0, $$pre$phiZ2D = 0, $$sink = 0, $$sink107 = 0, $10 = 0, $104 = 0, $11 = 0, $24 = 0, $26 = 0, $28 = 0, $29 = 0, $39 = 0, $45 = 0, $52 = 0, $54 = 0, $61 = 0, $71 = 0, $78 = 0, $80 = 0, $82 = 0, $88 = 0, $91 = 0; + HEAP32[$2 >> 2] = $0; + HEAP32[$5 >> 2] = $3; + if ($7 & 4) { + $10 = HEAP32[$2 >> 2] | 0; + $11 = $1; + if (((($11 - $10 | 0) > 2 ? (HEAP8[$10 >> 0] | 0) == -17 : 0) ? (HEAP8[$10 + 1 >> 0] | 0) == -69 : 0) ? (HEAP8[$10 + 2 >> 0] | 0) == -65 : 0) { + HEAP32[$2 >> 2] = $10 + 3; + $$pre$phiZ2D = $11; + } else $$pre$phiZ2D = $11; + } else $$pre$phiZ2D = $1; + L9 : while (1) { + $24 = HEAP32[$2 >> 2] | 0; + if ($24 >>> 0 >= $1 >>> 0) { + $$9 = 0; + break; + } + $26 = HEAP32[$5 >> 2] | 0; + if ($26 >>> 0 >= $4 >>> 0) { + $$9 = 1; + break; + } + $28 = HEAP8[$24 >> 0] | 0; + $29 = $28 & 255; + do if ($28 << 24 >> 24 > -1) if ($29 >>> 0 > $6 >>> 0) { + $$9 = 2; + break L9; + } else { + $$sink = $29; + $$sink107 = 1; + } else { + if (($28 & 255) < 194) { + $$9 = 2; + break L9; + } + if (($28 & 255) < 224) { + if (($$pre$phiZ2D - $24 | 0) < 2) { + $$9 = 1; + break L9; + } + $39 = HEAPU8[$24 + 1 >> 0] | 0; + if (($39 & 192 | 0) != 128) { + $$9 = 2; + break L9; + } + $45 = $39 & 63 | $29 << 6 & 1984; + if ($45 >>> 0 > $6 >>> 0) { + $$9 = 2; + break L9; + } else { + $$sink = $45; + $$sink107 = 2; + break; + } + } + if (($28 & 255) < 240) { + if (($$pre$phiZ2D - $24 | 0) < 3) { + $$9 = 1; + break L9; + } + $52 = HEAP8[$24 + 1 >> 0] | 0; + $54 = HEAP8[$24 + 2 >> 0] | 0; + switch ($28 << 24 >> 24) { + case -32: + { + if (($52 & -32) << 24 >> 24 != -96) { + $$9 = 2; + break L9; + } + break; + } + case -19: + { + if (($52 & -32) << 24 >> 24 != -128) { + $$9 = 2; + break L9; + } + break; + } + default: + if (($52 & -64) << 24 >> 24 != -128) { + $$9 = 2; + break L9; + } + } + $61 = $54 & 255; + if (($61 & 192 | 0) != 128) { + $$9 = 2; + break L9; + } + $71 = ($52 & 63) << 6 | $29 << 12 & 61440 | $61 & 63; + if ($71 >>> 0 > $6 >>> 0) { + $$9 = 2; + break L9; + } else { + $$sink = $71; + $$sink107 = 3; + break; + } + } + if (($28 & 255) >= 245) { + $$9 = 2; + break L9; + } + if (($$pre$phiZ2D - $24 | 0) < 4) { + $$9 = 1; + break L9; + } + $78 = HEAP8[$24 + 1 >> 0] | 0; + $80 = HEAP8[$24 + 2 >> 0] | 0; + $82 = HEAP8[$24 + 3 >> 0] | 0; + switch ($28 << 24 >> 24) { + case -16: + { + if (($78 + 112 & 255) >= 48) { + $$9 = 2; + break L9; + } + break; + } + case -12: + { + if (($78 & -16) << 24 >> 24 != -128) { + $$9 = 2; + break L9; + } + break; + } + default: + if (($78 & -64) << 24 >> 24 != -128) { + $$9 = 2; + break L9; + } + } + $88 = $80 & 255; + if (($88 & 192 | 0) != 128) { + $$9 = 2; + break L9; + } + $91 = $82 & 255; + if (($91 & 192 | 0) != 128) { + $$9 = 2; + break L9; + } + $104 = ($78 & 63) << 12 | $29 << 18 & 1835008 | $88 << 6 & 4032 | $91 & 63; + if ($104 >>> 0 > $6 >>> 0) { + $$9 = 2; + break L9; + } else { + $$sink = $104; + $$sink107 = 4; + } + } while (0); + HEAP32[$26 >> 2] = $$sink; + HEAP32[$2 >> 2] = $24 + $$sink107; + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + 4; + } + return $$9 | 0; +} + +function _create_colorindex($0) { + $0 = $0 | 0; + var $$06274 = 0, $$06274$us = 0, $$06377 = 0, $$06377$us = 0, $$06476 = 0, $$06476$us = 0, $$06573 = 0, $$06573$us = 0, $$06772 = 0, $$06772$us = 0, $$1$lcssa = 0, $$1$lcssa$us = 0, $$166$lcssa = 0, $$166$lcssa$us = 0, $$16875$us = 0, $$170 = 0, $$170$us = 0, $12 = 0, $14 = 0, $15 = 0, $17 = 0, $2 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $29 = 0, $30 = 0, $32 = 0, $34 = 0, $44 = 0, $47 = 0, $5 = 0, $52 = 0, $54 = 0, $58 = 0, $59 = 0, $61 = 0, $62 = 0, $63 = 0, $65 = 0, $68 = 0, $73 = 0, $76 = 0, $79 = 0; + $2 = HEAP32[$0 + 484 >> 2] | 0; + $5 = (HEAP32[$0 + 88 >> 2] | 0) == 1; + HEAP32[$2 + 28 >> 2] = $5 & 1; + $12 = $0 + 120 | 0; + $14 = FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$0 + 4 >> 2] | 0) + 8 >> 2] & 15]($0, 1, $5 ? 766 : 256, HEAP32[$12 >> 2] | 0) | 0; + $15 = $2 + 24 | 0; + HEAP32[$15 >> 2] = $14; + $17 = HEAP32[$2 + 20 >> 2] | 0; + if ((HEAP32[$12 >> 2] | 0) <= 0) return; + if (!$5) { + $$06377 = $17; + $$06476 = 0; + $61 = $14; + while (1) { + $58 = HEAP32[$2 + 32 + ($$06476 << 2) >> 2] | 0; + $59 = ($$06377 | 0) / ($58 | 0) | 0; + $62 = HEAP32[$61 + ($$06476 << 2) >> 2] | 0; + $63 = $58 + -1 | 0; + $65 = $63 << 1; + $$06274 = 0; + $$06573 = ($58 + 254 | 0) / ($65 | 0) | 0; + $$06772 = 0; + while (1) { + if (($$06772 | 0) > ($$06573 | 0)) { + $$170 = $$06274; + while (1) { + $68 = $$170 + 1 | 0; + $73 = ((($68 << 1 | 1) * 255 | 0) + $63 | 0) / ($65 | 0) | 0; + if (($$06772 | 0) > ($73 | 0)) $$170 = $68; else { + $$1$lcssa = $68; + $$166$lcssa = $73; + break; + } + } + } else { + $$1$lcssa = $$06274; + $$166$lcssa = $$06573; + } + $76 = (Math_imul($$1$lcssa, $59) | 0) & 255; + HEAP8[$62 + $$06772 >> 0] = $76; + $$06772 = $$06772 + 1 | 0; + if (($$06772 | 0) == 256) break; else { + $$06274 = $$1$lcssa; + $$06573 = $$166$lcssa; + } + } + $79 = $$06476 + 1 | 0; + if (($79 | 0) >= (HEAP32[$12 >> 2] | 0)) break; + $$06377 = $59; + $$06476 = $79; + $61 = HEAP32[$15 >> 2] | 0; + } + return; + } + $$06377$us = $17; + $$06476$us = 0; + $24 = $14; + while (1) { + $21 = HEAP32[$2 + 32 + ($$06476$us << 2) >> 2] | 0; + $22 = ($$06377$us | 0) / ($21 | 0) | 0; + $23 = $24 + ($$06476$us << 2) | 0; + HEAP32[$23 >> 2] = (HEAP32[$23 >> 2] | 0) + 255; + $29 = HEAP32[(HEAP32[$15 >> 2] | 0) + ($$06476$us << 2) >> 2] | 0; + $30 = $21 + -1 | 0; + $32 = $30 << 1; + $$06274$us = 0; + $$06573$us = ($21 + 254 | 0) / ($32 | 0) | 0; + $$06772$us = 0; + while (1) { + if (($$06772$us | 0) > ($$06573$us | 0)) { + $$170$us = $$06274$us; + while (1) { + $47 = $$170$us + 1 | 0; + $52 = ((($47 << 1 | 1) * 255 | 0) + $30 | 0) / ($32 | 0) | 0; + if (($$06772$us | 0) > ($52 | 0)) $$170$us = $47; else { + $$1$lcssa$us = $47; + $$166$lcssa$us = $52; + break; + } + } + } else { + $$1$lcssa$us = $$06274$us; + $$166$lcssa$us = $$06573$us; + } + $44 = (Math_imul($$1$lcssa$us, $22) | 0) & 255; + HEAP8[$29 + $$06772$us >> 0] = $44; + $$06772$us = $$06772$us + 1 | 0; + if (($$06772$us | 0) == 256) break; else { + $$06274$us = $$1$lcssa$us; + $$06573$us = $$166$lcssa$us; + } + } + $34 = $29 + 255 | 0; + $$16875$us = 1; + do { + HEAP8[$29 + (0 - $$16875$us) >> 0] = HEAP8[$29 >> 0] | 0; + HEAP8[$29 + ($$16875$us + 255) >> 0] = HEAP8[$34 >> 0] | 0; + $$16875$us = $$16875$us + 1 | 0; + } while (($$16875$us | 0) != 256); + $54 = $$06476$us + 1 | 0; + if (($54 | 0) >= (HEAP32[$12 >> 2] | 0)) break; + $$06377$us = $22; + $$06476$us = $54; + $24 = HEAP32[$15 >> 2] | 0; + } + return; +} + +function _jpeg_idct_3x3($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $101 = 0, $103 = 0, $105 = 0, $107 = 0, $109 = 0, $110 = 0, $111 = 0, $130 = 0, $133 = 0, $135 = 0, $136 = 0, $137 = 0, $15 = 0, $157 = 0, $160 = 0, $162 = 0, $163 = 0, $166 = 0, $22 = 0, $23 = 0, $24 = 0, $31 = 0, $33 = 0, $38 = 0, $47 = 0, $5 = 0, $54 = 0, $55 = 0, $56 = 0, $63 = 0, $65 = 0, $69 = 0, $7 = 0, $79 = 0, $86 = 0, $87 = 0, $88 = 0, $9 = 0, $95 = 0, $97 = 0, $99 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $9 = HEAP32[$1 + 84 >> 2] | 0; + $15 = Math_imul(HEAP16[$2 >> 1] << 13, HEAP32[$9 >> 2] | 0) | 0 | 1024; + $22 = Math_imul((HEAP16[$2 + 32 >> 1] | 0) * 5793 | 0, HEAP32[$9 + 64 >> 2] | 0) | 0; + $23 = $22 + $15 | 0; + $24 = (Math_imul($22, -2) | 0) + $15 | 0; + $31 = Math_imul((HEAP16[$2 + 16 >> 1] | 0) * 10033 | 0, HEAP32[$9 + 32 >> 2] | 0) | 0; + $33 = $31 + $23 >> 11; + HEAP32[$5 >> 2] = $33; + HEAP32[$5 + 24 >> 2] = $23 - $31 >> 11; + $38 = $5 + 12 | 0; + HEAP32[$38 >> 2] = $24 >> 11; + $47 = Math_imul(HEAP16[$2 + 2 >> 1] << 13, HEAP32[$9 + 4 >> 2] | 0) | 0 | 1024; + $54 = Math_imul((HEAP16[$2 + 34 >> 1] | 0) * 5793 | 0, HEAP32[$9 + 68 >> 2] | 0) | 0; + $55 = $54 + $47 | 0; + $56 = (Math_imul($54, -2) | 0) + $47 | 0; + $63 = Math_imul((HEAP16[$2 + 18 >> 1] | 0) * 10033 | 0, HEAP32[$9 + 36 >> 2] | 0) | 0; + $65 = $63 + $55 >> 11; + HEAP32[$5 + 4 >> 2] = $65; + HEAP32[$5 + 28 >> 2] = $55 - $63 >> 11; + $69 = $56 >> 11; + HEAP32[$5 + 16 >> 2] = $69; + $79 = Math_imul(HEAP16[$2 + 4 >> 1] << 13, HEAP32[$9 + 8 >> 2] | 0) | 0 | 1024; + $86 = Math_imul((HEAP16[$2 + 36 >> 1] | 0) * 5793 | 0, HEAP32[$9 + 72 >> 2] | 0) | 0; + $87 = $86 + $79 | 0; + $88 = (Math_imul($86, -2) | 0) + $79 | 0; + $95 = Math_imul((HEAP16[$2 + 20 >> 1] | 0) * 10033 | 0, HEAP32[$9 + 40 >> 2] | 0) | 0; + $97 = $95 + $87 >> 11; + HEAP32[$5 + 8 >> 2] = $97; + $99 = $87 - $95 >> 11; + HEAP32[$5 + 32 >> 2] = $99; + $101 = $88 >> 11; + HEAP32[$5 + 20 >> 2] = $101; + $103 = $7 + -384 | 0; + $105 = (HEAP32[$3 >> 2] | 0) + $4 | 0; + $107 = ($33 << 13) + 134348800 | 0; + $109 = $107 + ($97 * 5793 | 0) | 0; + $110 = (Math_imul($97, -11586) | 0) + $107 | 0; + $111 = $65 * 10033 | 0; + HEAP8[$105 >> 0] = HEAP8[$103 + (($109 + $111 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$105 + 2 >> 0] = HEAP8[$103 + (($109 - $111 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$105 + 1 >> 0] = HEAP8[$103 + ($110 >>> 18 & 1023) >> 0] | 0; + $130 = (HEAP32[$3 + 4 >> 2] | 0) + $4 | 0; + $133 = (HEAP32[$38 >> 2] << 13) + 134348800 | 0; + $135 = $133 + ($101 * 5793 | 0) | 0; + $136 = (Math_imul($101, -11586) | 0) + $133 | 0; + $137 = $69 * 10033 | 0; + HEAP8[$130 >> 0] = HEAP8[$103 + (($135 + $137 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$130 + 2 >> 0] = HEAP8[$103 + (($135 - $137 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$130 + 1 >> 0] = HEAP8[$103 + ($136 >>> 18 & 1023) >> 0] | 0; + $157 = (HEAP32[$3 + 8 >> 2] | 0) + $4 | 0; + $160 = (HEAP32[$5 + 24 >> 2] << 13) + 134348800 | 0; + $162 = $160 + ($99 * 5793 | 0) | 0; + $163 = (Math_imul($99, -11586) | 0) + $160 | 0; + $166 = (HEAP32[$5 + 28 >> 2] | 0) * 10033 | 0; + HEAP8[$157 >> 0] = HEAP8[$103 + (($162 + $166 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$157 + 2 >> 0] = HEAP8[$103 + (($162 - $166 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$157 + 1 >> 0] = HEAP8[$103 + ($163 >>> 18 & 1023) >> 0] | 0; + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseTemplateArgsEb($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$6 = 0, $12 = 0, $17 = 0, $19 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $2 = sp + 16 | 0; + $3 = sp + 12 | 0; + $4 = sp + 8 | 0; + $5 = sp; + do if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 73) | 0) { + $7 = $0 + 288 | 0; + if ($1) __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE5clearEv($7); + $8 = $0 + 8 | 0; + $9 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($8) | 0; + while (1) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) { + label = 16; + break; + } + if ($1) { + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EEC2EOS4_($2, $7); + $12 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E16parseTemplateArgEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$3 >> 2] = $12; + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EEaSEOS4_($7, $2); + if (!$12) { + label = 12; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($8, $3); + HEAP32[$4 >> 2] = $12; + if ((__ZNK12_GLOBAL__N_116itanium_demangle4Node7getKindEv($12) | 0) << 24 >> 24 == 28) { + __ZNK12_GLOBAL__N_116itanium_demangle20TemplateArgumentPack11getElementsEv($5, $12); + $17 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13ParameterPackEJNS0_9NodeArrayEEEEPNS0_4NodeEDpOT0_($0, $5) | 0; + HEAP32[$4 >> 2] = $17; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE9push_backERKS3_($7, $4); + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EED2Ev($2); + } else { + $19 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E16parseTemplateArgEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$2 >> 2] = $19; + if (!$19) { + label = 15; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($8, $2); + } + } + if ((label | 0) == 12) { + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EED2Ev($2); + $$6 = 0; + break; + } else if ((label | 0) == 15) { + $$6 = 0; + break; + } else if ((label | 0) == 16) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20popTrailingNodeArrayEm($2, $0, $9); + $$6 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_12TemplateArgsEJNS0_9NodeArrayEEEEPNS0_4NodeEDpOT0_($0, $2) | 0; + break; + } + } else $$6 = 0; while (0); + STACKTOP = sp; + return $$6 | 0; +} + +function _icpGetJ_Xc_S($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$0108 = 0, $$0109 = 0, $104 = 0.0, $11 = 0, $111 = 0.0, $118 = 0.0, $12 = 0.0, $128 = 0, $134 = 0.0, $135 = 0.0, $15 = 0, $17 = 0, $18 = 0.0, $24 = 0, $26 = 0.0, $28 = 0, $32 = 0, $4 = 0, $40 = 0, $43 = 0, $45 = 0.0, $48 = 0, $5 = 0, $56 = 0.0, $60 = 0.0, $63 = 0.0, $70 = 0.0, $80 = 0.0, $87 = 0.0, $9 = 0, $94 = 0.0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 864 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(864); + $4 = sp + 576 | 0; + $5 = sp; + $9 = $2 + 8 | 0; + $11 = $3 + 8 | 0; + $12 = +HEAPF64[$11 >> 3]; + $15 = $2 + 16 | 0; + $17 = $3 + 16 | 0; + $18 = +HEAPF64[$17 >> 3]; + HEAPF64[$1 >> 3] = +HEAPF64[$2 + 24 >> 3] + (+HEAPF64[$2 >> 3] * +HEAPF64[$3 >> 3] + +HEAPF64[$9 >> 3] * $12 + +HEAPF64[$15 >> 3] * $18); + $24 = $2 + 32 | 0; + $26 = +HEAPF64[$3 >> 3]; + $28 = $2 + 40 | 0; + $32 = $2 + 48 | 0; + HEAPF64[$1 + 8 >> 3] = +HEAPF64[$2 + 56 >> 3] + (+HEAPF64[$24 >> 3] * $26 + $12 * +HEAPF64[$28 >> 3] + $18 * +HEAPF64[$32 >> 3]); + $40 = $2 + 64 | 0; + $43 = $2 + 72 | 0; + $45 = +HEAPF64[$11 >> 3]; + $48 = $2 + 80 | 0; + HEAPF64[$1 + 16 >> 3] = +HEAPF64[$2 + 88 >> 3] + ($26 * +HEAPF64[$40 >> 3] + +HEAPF64[$43 >> 3] * $45 + $18 * +HEAPF64[$48 >> 3]); + $56 = +HEAPF64[$2 >> 3]; + HEAPF64[$4 >> 3] = $26 * $56; + HEAPF64[$4 + 8 >> 3] = $45 * $56; + $60 = +HEAPF64[$17 >> 3]; + HEAPF64[$4 + 16 >> 3] = $56 * $60; + $63 = +HEAPF64[$9 >> 3]; + HEAPF64[$4 + 24 >> 3] = $26 * $63; + HEAPF64[$4 + 32 >> 3] = $45 * $63; + HEAPF64[$4 + 40 >> 3] = $60 * $63; + $70 = +HEAPF64[$15 >> 3]; + HEAPF64[$4 + 48 >> 3] = $26 * $70; + HEAPF64[$4 + 56 >> 3] = $45 * $70; + HEAPF64[$4 + 64 >> 3] = $60 * $70; + HEAPF64[$4 + 72 >> 3] = $56; + HEAPF64[$4 + 80 >> 3] = $63; + HEAPF64[$4 + 88 >> 3] = $70; + $80 = +HEAPF64[$24 >> 3]; + HEAPF64[$4 + 96 >> 3] = $26 * $80; + HEAPF64[$4 + 104 >> 3] = $45 * $80; + HEAPF64[$4 + 112 >> 3] = $60 * $80; + $87 = +HEAPF64[$28 >> 3]; + HEAPF64[$4 + 120 >> 3] = $26 * $87; + HEAPF64[$4 + 128 >> 3] = $45 * $87; + HEAPF64[$4 + 136 >> 3] = $60 * $87; + $94 = +HEAPF64[$32 >> 3]; + HEAPF64[$4 + 144 >> 3] = $26 * $94; + HEAPF64[$4 + 152 >> 3] = $45 * $94; + HEAPF64[$4 + 160 >> 3] = $60 * $94; + HEAPF64[$4 + 168 >> 3] = $80; + HEAPF64[$4 + 176 >> 3] = $87; + HEAPF64[$4 + 184 >> 3] = $94; + $104 = +HEAPF64[$40 >> 3]; + HEAPF64[$4 + 192 >> 3] = $26 * $104; + HEAPF64[$4 + 200 >> 3] = $45 * $104; + HEAPF64[$4 + 208 >> 3] = $60 * $104; + $111 = +HEAPF64[$43 >> 3]; + HEAPF64[$4 + 216 >> 3] = $26 * $111; + HEAPF64[$4 + 224 >> 3] = $45 * $111; + HEAPF64[$4 + 232 >> 3] = $60 * $111; + $118 = +HEAPF64[$48 >> 3]; + HEAPF64[$4 + 240 >> 3] = $26 * $118; + HEAPF64[$4 + 248 >> 3] = $45 * $118; + HEAPF64[$4 + 256 >> 3] = $60 * $118; + HEAPF64[$4 + 264 >> 3] = $104; + HEAPF64[$4 + 272 >> 3] = $111; + HEAPF64[$4 + 280 >> 3] = $118; + _icpGetJ_T_S($5); + $$0108 = 0; + while (1) { + if (($$0108 | 0) == 3) break; + $$0109 = 0; + while (1) { + if (($$0109 | 0) == 6) break; + $128 = $0 + ($$0108 * 48 | 0) + ($$0109 << 3) | 0; + HEAPF64[$128 >> 3] = 0.0; + $$0 = 0; + $135 = 0.0; + while (1) { + if (($$0 | 0) == 12) break; + $134 = $135 + +HEAPF64[$4 + ($$0108 * 96 | 0) + ($$0 << 3) >> 3] * +HEAPF64[$5 + ($$0 * 48 | 0) + ($$0109 << 3) >> 3]; + HEAPF64[$128 >> 3] = $134; + $$0 = $$0 + 1 | 0; + $135 = $134; + } + $$0109 = $$0109 + 1 | 0; + } + $$0108 = $$0108 + 1 | 0; + } + STACKTOP = sp; + return; +} + +function _jpeg_start_decompress($0) { + $0 = $0 | 0; + var $$2 = 0, $$pre38$i = 0, $$pre38$i39 = 0, $1 = 0, $11 = 0, $12 = 0, $14 = 0, $18 = 0, $19 = 0, $2 = 0, $23 = 0, $25 = 0, $26 = 0, $27 = 0, $34 = 0, $42 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $50 = 0, $52 = 0, $56 = 0, $59 = 0, $6 = 0, $61 = 0, $67 = 0, $69 = 0, $81 = 0, label = 0; + $1 = $0 + 20 | 0; + $2 = HEAP32[$1 >> 2] | 0; + L1 : do switch ($2 | 0) { + case 202: + { + _jinit_master_decompress($0); + if (!(HEAP32[$0 + 64 >> 2] | 0)) { + HEAP32[$1 >> 2] = 203; + label = 6; + break L1; + } + HEAP32[$1 >> 2] = 207; + $$2 = 1; + return $$2 | 0; + } + case 203: + { + label = 6; + break; + } + case 204: + { + $$pre38$i39 = $0 + 444 | 0; + break; + } + default: + { + $34 = HEAP32[$0 >> 2] | 0; + HEAP32[$34 + 20 >> 2] = 21; + HEAP32[$34 + 24 >> 2] = $2; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + label = 17; + } + } while (0); + if ((label | 0) == 6) { + $6 = $0 + 460 | 0; + L11 : do if (HEAP32[(HEAP32[$6 >> 2] | 0) + 16 >> 2] | 0) { + $11 = $0 + 8 | 0; + $12 = $0 + 332 | 0; + $14 = HEAP32[$11 >> 2] | 0; + L13 : while (1) { + if ($14 | 0) FUNCTION_TABLE_vi[HEAP32[$14 >> 2] & 255]($0); + $18 = FUNCTION_TABLE_ii[HEAP32[HEAP32[$6 >> 2] >> 2] & 127]($0) | 0; + switch ($18 | 0) { + case 2: + { + break L11; + break; + } + case 0: + { + $$2 = $18; + break L13; + break; + } + default: + {} + } + $19 = HEAP32[$11 >> 2] | 0; + if (($18 | 2 | 0) == 3 & ($19 | 0) != 0 ? ($23 = $19 + 4 | 0, $25 = (HEAP32[$23 >> 2] | 0) + 1 | 0, HEAP32[$23 >> 2] = $25, $26 = $19 + 8 | 0, $27 = HEAP32[$26 >> 2] | 0, ($25 | 0) >= ($27 | 0)) : 0) HEAP32[$26 >> 2] = (HEAP32[$12 >> 2] | 0) + $27; + $14 = $19; + } + return $$2 | 0; + } while (0); + HEAP32[$0 + 152 >> 2] = HEAP32[$0 + 144 >> 2]; + label = 17; + } + if ((label | 0) == 17) { + $$pre38$i = $0 + 444 | 0; + if ((HEAP32[$1 >> 2] | 0) == 204) $$pre38$i39 = $$pre38$i; else { + FUNCTION_TABLE_vi[HEAP32[HEAP32[$$pre38$i >> 2] >> 2] & 255]($0); + HEAP32[$0 + 140 >> 2] = 0; + HEAP32[$1 >> 2] = 204; + $$pre38$i39 = $$pre38$i; + } + } + $42 = HEAP32[$$pre38$i39 >> 2] | 0; + L29 : do if (HEAP32[$42 + 8 >> 2] | 0) { + $46 = $0 + 140 | 0; + $47 = $0 + 116 | 0; + $48 = $0 + 8 | 0; + $49 = $0 + 448 | 0; + $52 = HEAP32[$46 >> 2] | 0; + $81 = $42; + L31 : while (1) { + $50 = HEAP32[$47 >> 2] | 0; + if ($52 >>> 0 < $50 >>> 0) { + $59 = $52; + $61 = $50; + do { + $56 = HEAP32[$48 >> 2] | 0; + if (!$56) $67 = $59; else { + HEAP32[$56 + 4 >> 2] = $59; + HEAP32[$56 + 8 >> 2] = $61; + FUNCTION_TABLE_vi[HEAP32[$56 >> 2] & 255]($0); + $67 = HEAP32[$46 >> 2] | 0; + } + FUNCTION_TABLE_viiii[HEAP32[(HEAP32[$49 >> 2] | 0) + 4 >> 2] & 31]($0, 0, $46, 0); + $59 = HEAP32[$46 >> 2] | 0; + if (($59 | 0) == ($67 | 0)) { + $$2 = 0; + break L31; + } + $61 = HEAP32[$47 >> 2] | 0; + } while ($59 >>> 0 < $61 >>> 0); + $69 = HEAP32[$$pre38$i39 >> 2] | 0; + } else $69 = $81; + FUNCTION_TABLE_vi[HEAP32[$69 + 4 >> 2] & 255]($0); + FUNCTION_TABLE_vi[HEAP32[HEAP32[$$pre38$i39 >> 2] >> 2] & 255]($0); + HEAP32[$46 >> 2] = 0; + $81 = HEAP32[$$pre38$i39 >> 2] | 0; + if (!(HEAP32[$81 + 8 >> 2] | 0)) break L29; else $52 = 0; + } + return $$2 | 0; + } while (0); + HEAP32[$1 >> 2] = (HEAP32[$0 + 68 >> 2] | 0) == 0 ? 205 : 206; + $$2 = 1; + return $$2 | 0; +} + +function __ZNKSt3__28messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0$i = 0, $$0$i$i = 0, $$0$i$i18 = 0, $$0$i21 = 0, $$016$i = 0, $$017$i = 0, $$019$i = 0, $$020$i = 0, $10 = 0, $11 = 0, $12 = 0, $18 = 0, $19 = 0, $24 = 0, $26 = 0, $27 = 0, $34 = 0, $51 = 0, $52 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $7 = 0, $71 = 0, $8 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 176 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(176); + $6 = sp + 168 | 0; + $7 = sp; + $8 = sp + 164 | 0; + $9 = sp + 160 | 0; + $10 = sp + 128 | 0; + $11 = sp + 152 | 0; + $12 = sp + 144 | 0; + HEAP32[$10 >> 2] = 0; + HEAP32[$10 + 4 >> 2] = 0; + HEAP32[$10 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$10 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + HEAP32[$11 + 4 >> 2] = 0; + HEAP32[$11 >> 2] = 23144; + $18 = HEAP8[$5 + 8 + 3 >> 0] | 0; + $19 = $18 << 24 >> 24 < 0; + $24 = $19 ? HEAP32[$5 >> 2] | 0 : $5; + $26 = $24 + (($19 ? HEAP32[$5 + 4 >> 2] | 0 : $18 & 255) << 2) | 0; + $27 = $7 + 32 | 0; + $$016$i = $24; + $$017$i = 0; + while (1) { + if (!(($$017$i | 0) != 2 & $$016$i >>> 0 < $26 >>> 0)) break; + HEAP32[$9 >> 2] = $$016$i; + $34 = FUNCTION_TABLE_iiiiiiiii[HEAP32[(HEAP32[$11 >> 2] | 0) + 12 >> 2] & 15]($11, $6, $$016$i, $26, $9, $7, $27, $8) | 0; + if (($34 | 0) == 2 ? 1 : (HEAP32[$9 >> 2] | 0) == ($$016$i | 0)) { + label = 8; + break; + } + $$0$i21 = $7; + while (1) { + if ($$0$i21 >>> 0 >= (HEAP32[$8 >> 2] | 0) >>> 0) break; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc($10, HEAP8[$$0$i21 >> 0] | 0); + $$0$i21 = $$0$i21 + 1 | 0; + } + $$016$i = HEAP32[$9 >> 2] | 0; + $$017$i = $34; + } + if ((label | 0) == 8) __ZNSt3__221__throw_runtime_errorEPKc(0); + __ZNSt3__26locale5facetD2Ev($11); + $51 = (HEAP8[$10 + 11 >> 0] | 0) < 0 ? HEAP32[$10 >> 2] | 0 : $10; + $52 = _catgets(($2 | 0) == -1 ? -1 : $2 << 1, $3, $4, $51) | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + $$0$i$i18 = 0; + while (1) { + if (($$0$i$i18 | 0) == 3) break; + HEAP32[$0 + ($$0$i$i18 << 2) >> 2] = 0; + $$0$i$i18 = $$0$i$i18 + 1 | 0; + } + HEAP32[$12 + 4 >> 2] = 0; + HEAP32[$12 >> 2] = 23192; + $57 = $51 + (_strlen($52) | 0) | 0; + $58 = $57; + $59 = $7 + 128 | 0; + $$019$i = $51; + $$020$i = 0; + while (1) { + if (!(($$020$i | 0) != 2 & $$019$i >>> 0 < $57 >>> 0)) { + label = 23; + break; + } + HEAP32[$9 >> 2] = $$019$i; + $71 = FUNCTION_TABLE_iiiiiiiii[HEAP32[(HEAP32[$12 >> 2] | 0) + 16 >> 2] & 15]($12, $6, $$019$i, ($58 - $$019$i | 0) > 32 ? $$019$i + 32 | 0 : $57, $9, $7, $59, $8) | 0; + if (($71 | 0) == 2 ? 1 : (HEAP32[$9 >> 2] | 0) == ($$019$i | 0)) { + label = 19; + break; + } + $$0$i = $7; + while (1) { + if ($$0$i >>> 0 >= (HEAP32[$8 >> 2] | 0) >>> 0) break; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw($0, HEAP32[$$0$i >> 2] | 0); + $$0$i = $$0$i + 4 | 0; + } + $$019$i = HEAP32[$9 >> 2] | 0; + $$020$i = $71; + } + if ((label | 0) == 19) __ZNSt3__221__throw_runtime_errorEPKc(0); else if ((label | 0) == 23) { + __ZNSt3__26locale5facetD2Ev($12); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($10); + STACKTOP = sp; + return; + } +} + +function _jpeg_fill_bit_buffer($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$052 = 0, $$054102 = 0, $$057101 = 0, $$06599 = 0, $$06997 = 0, $$155 = 0, $$158 = 0, $$2 = 0, $$256 = 0, $$259 = 0, $$267 = 0, $$271 = 0, $$3 = 0, $$360 = 0, $$368 = 0, $$372 = 0, $$4 = 0, $$461 = 0, $$6 = 0, $$663 = 0, $$7 = 0, $$764 = 0, $13 = 0, $20 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $35 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $44 = 0, $45 = 0, $48 = 0, $5 = 0, $53 = 0, $6 = 0, $8 = 0, $9 = 0, label = 0; + $4 = HEAP32[$0 >> 2] | 0; + $5 = $0 + 4 | 0; + $6 = HEAP32[$5 >> 2] | 0; + $8 = HEAP32[$0 + 16 >> 2] | 0; + $9 = $8 + 440 | 0; + L1 : do if (!(HEAP32[$9 >> 2] | 0)) if (($2 | 0) < 25) { + $13 = $8 + 24 | 0; + $$054102 = $6; + $$057101 = $4; + $$06599 = $1; + $$06997 = $2; + L4 : while (1) { + if (!$$054102) { + if (!(FUNCTION_TABLE_ii[HEAP32[(HEAP32[$13 >> 2] | 0) + 12 >> 2] & 127]($8) | 0)) { + $$2 = 0; + label = 20; + break; + } + $20 = HEAP32[$13 >> 2] | 0; + $$155 = HEAP32[$20 + 4 >> 2] | 0; + $$158 = HEAP32[$20 >> 2] | 0; + } else { + $$155 = $$054102; + $$158 = $$057101; + } + $24 = $$155 + -1 | 0; + $25 = $$158 + 1 | 0; + $26 = HEAP8[$$158 >> 0] | 0; + $27 = $26 & 255; + L10 : do if ($26 << 24 >> 24 == -1) { + $$256 = $24; + $$259 = $25; + while (1) { + if (!$$256) { + if (!(FUNCTION_TABLE_ii[HEAP32[(HEAP32[$13 >> 2] | 0) + 12 >> 2] & 127]($8) | 0)) { + $$2 = 0; + label = 20; + break L4; + } + $35 = HEAP32[$13 >> 2] | 0; + $$3 = HEAP32[$35 + 4 >> 2] | 0; + $$360 = HEAP32[$35 >> 2] | 0; + } else { + $$3 = $$256; + $$360 = $$259; + } + $39 = $$3 + -1 | 0; + $40 = $$360 + 1 | 0; + $41 = HEAP8[$$360 >> 0] | 0; + switch ($41 << 24 >> 24) { + case 0: + { + $$052 = 255; + $$4 = $39; + $$461 = $40; + break L10; + break; + } + case -1: + { + $$256 = $39; + $$259 = $40; + break; + } + default: + { + label = 13; + break L4; + } + } + } + } else { + $$052 = $27; + $$4 = $24; + $$461 = $25; + } while (0); + $44 = $$052 | $$06599 << 8; + $45 = $$06997 + 8 | 0; + if (($$06997 | 0) < 17) { + $$054102 = $$4; + $$057101 = $$461; + $$06599 = $44; + $$06997 = $45; + } else { + $$368 = $44; + $$372 = $45; + $$7 = $$4; + $$764 = $$461; + break L1; + } + } + if ((label | 0) == 13) { + HEAP32[$9 >> 2] = $41 & 255; + $$267 = $$06599; + $$271 = $$06997; + $$6 = $39; + $$663 = $40; + label = 15; + break; + } else if ((label | 0) == 20) return $$2 | 0; + } else { + $$368 = $1; + $$372 = $2; + $$7 = $6; + $$764 = $4; + } else { + $$267 = $1; + $$271 = $2; + $$6 = $6; + $$663 = $4; + label = 15; + } while (0); + if ((label | 0) == 15) if (($$271 | 0) < ($3 | 0)) { + $48 = $8 + 468 | 0; + if (!(HEAP32[(HEAP32[$48 >> 2] | 0) + 40 >> 2] | 0)) { + $53 = HEAP32[$8 >> 2] | 0; + HEAP32[$53 + 20 >> 2] = 120; + FUNCTION_TABLE_vii[HEAP32[$53 + 4 >> 2] & 255]($8, -1); + HEAP32[(HEAP32[$48 >> 2] | 0) + 40 >> 2] = 1; + } + $$368 = $$267 << 25 - $$271; + $$372 = 25; + $$7 = $$6; + $$764 = $$663; + } else { + $$368 = $$267; + $$372 = $$271; + $$7 = $$6; + $$764 = $$663; + } + HEAP32[$0 >> 2] = $$764; + HEAP32[$5 >> 2] = $$7; + HEAP32[$0 + 8 >> 2] = $$368; + HEAP32[$0 + 12 >> 2] = $$372; + $$2 = 1; + return $$2 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E14parseLocalNameEPNS5_9NameStateE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$1 = 0, $$2 = 0, $$3 = 0, $$4 = 0, $13 = 0, $14 = 0, $18 = 0, $2 = 0, $21 = 0, $26 = 0, $3 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp + 8 | 0; + $3 = sp; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 90) | 0) { + $5 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $6 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseEncodingEv($5) | 0; + HEAP32[$2 >> 2] = $6; + do if (($6 | 0) != 0 ? __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0 : 0) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 115) | 0) { + $13 = __ZN12_GLOBAL__N_116itanium_demangle19parse_discriminatorEPKcS2_(HEAP32[$0 >> 2] | 0, HEAP32[$0 + 4 >> 2] | 0) | 0; + HEAP32[$0 >> 2] = $13; + $14 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA15_KcEEEPNS0_4NodeEDpOT0_($0, 55376) | 0; + HEAP32[$3 >> 2] = $14; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_9LocalNameEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $2, $3) | 0; + break; + } + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 100) | 0)) { + $21 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseNameEPNS5_9NameStateE($5, $1) | 0; + HEAP32[$3 >> 2] = $21; + if (!$21) $$2 = 0; else { + $26 = __ZN12_GLOBAL__N_116itanium_demangle19parse_discriminatorEPKcS2_(HEAP32[$0 >> 2] | 0, HEAP32[$0 + 4 >> 2] | 0) | 0; + HEAP32[$0 >> 2] = $26; + $$2 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_9LocalNameEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $2, $3) | 0; + } + $$3 = $$2; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E11parseNumberEb($3, $0, 1); + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) { + $18 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseNameEPNS5_9NameStateE($5, $1) | 0; + HEAP32[$3 >> 2] = $18; + if (!$18) $$1 = 0; else $$1 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_9LocalNameEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $2, $3) | 0; + $$3 = $$1; + } else $$3 = 0; + } else $$3 = 0; while (0); + $$4 = $$3; + } else $$4 = 0; + STACKTOP = sp; + return $$4 | 0; +} +function __ZN6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEE5queryEPKNS_25GaussianScaleSpacePyramidE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $10 = 0, $11 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $23 = 0, $24 = 0, $27 = 0, $28 = 0, $3 = 0, $34 = 0, $39 = 0, $4 = 0, $42 = 0, $44 = 0, $5 = 0, $6 = 0, $vararg_buffer = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $$byval_copy = sp + 16 | 0; + $vararg_buffer = sp; + $2 = sp + 56 | 0; + $3 = sp + 48 | 0; + $4 = $0 + 160 | 0; + $5 = __ZNK6vision25DoGScaleInvariantDetector5widthEv($4) | 0; + $6 = __ZNK6vision25GaussianScaleSpacePyramid6imagesEv($1) | 0; + if (($5 | 0) == (__ZNK6vision5Image5widthEv(HEAP32[$6 >> 2] | 0) | 0) ? ($10 = __ZNK6vision25DoGScaleInvariantDetector6heightEv($4) | 0, $11 = __ZNK6vision25GaussianScaleSpacePyramid6imagesEv($1) | 0, ($10 | 0) == (__ZNK6vision5Image6heightEv(HEAP32[$11 >> 2] | 0) | 0)) : 0) {} else __ZN6vision25DoGScaleInvariantDetector5allocEPKNS_25GaussianScaleSpacePyramidE($4, $1); + $15 = $0 + 64 | 0; + $16 = __Znwm(148) | 0; + __ZN6vision8KeyframeILi96EEC2Ev($16); + HEAP32[$3 >> 2] = 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + __ZNSt3__210shared_ptrIN6vision8KeyframeILi96EEEEC2IS3_EEPT_NS_9enable_ifIXsr14is_convertibleIS7_PS3_EE5valueENS4_5__natEE4typeE($2, $16, $$byval_copy); + $17 = HEAP32[$2 >> 2] | 0; + HEAP32[$2 >> 2] = HEAP32[$15 >> 2]; + HEAP32[$15 >> 2] = $17; + $19 = $2 + 4 | 0; + $20 = $0 + 68 | 0; + $21 = HEAP32[$19 >> 2] | 0; + HEAP32[$19 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$20 >> 2] = $21; + __ZNSt3__210shared_ptrIN6vision8KeyframeILi96EEEED2Ev($2); + $23 = HEAP32[$15 >> 2] | 0; + $24 = __ZNK6vision25GaussianScaleSpacePyramid6imagesEv($1) | 0; + __ZN6vision8KeyframeILi96EE8setWidthEi($23, __ZNK6vision5Image5widthEv(HEAP32[$24 >> 2] | 0) | 0); + $27 = HEAP32[$15 >> 2] | 0; + $28 = __ZNK6vision25GaussianScaleSpacePyramid6imagesEv($1) | 0; + __ZN6vision8KeyframeILi96EE9setHeightEi($27, __ZNK6vision5Image6heightEv(HEAP32[$28 >> 2] | 0) | 0); + __ZN6vision11ScopedTimerC2EPKc($$byval_copy, 33189); + if (__ZN6vision11ScopedTimercvbEv($$byval_copy) | 0) __ZN6vision12FindFeaturesINS_14FREAKExtractorELi96EEEvPNS_8KeyframeIXT0_EEEPKNS_25GaussianScaleSpacePyramidEPNS_25DoGScaleInvariantDetectorEPT_(HEAP32[$15 >> 2] | 0, $1, $4, $0 + 316 | 0); + __ZN6vision11ScopedTimerD2Ev($$byval_copy); + $34 = __ZN6vision6Logger11getInstanceEv() | 0; + __ZN6vision15get_pretty_timeEv($$byval_copy); + $39 = (HEAP8[$$byval_copy + 11 >> 0] | 0) < 0 ? HEAP32[$$byval_copy >> 2] | 0 : $$byval_copy; + $42 = __ZNK6vision18BinaryFeatureStore4sizeEv(__ZN6vision8KeyframeILi96EE5storeEv(HEAP32[$15 >> 2] | 0) | 0) | 0; + HEAP32[$vararg_buffer >> 2] = 39201; + HEAP32[$vararg_buffer + 4 >> 2] = $39; + HEAP32[$vararg_buffer + 8 >> 2] = 34718; + HEAP32[$vararg_buffer + 12 >> 2] = $42; + __ZN6vision6Logger5writeENS_19LoggerPriorityLevelEPKcz($34, 8, 34674, $vararg_buffer); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($$byval_copy); + $44 = __ZN6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEE5queryEPKNS_8KeyframeILi96EEE($0, HEAP32[$15 >> 2] | 0) | 0; + STACKTOP = sp; + return $44 | 0; +} + +function __ZNSt3__210__stdinbufIcE9__getcharEb($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$048 = 0, $$052 = 0, $$10 = 0, $$11 = 0, $$351 = 0, $$9 = 0, $$sroa$speculated = 0, $10 = 0, $11 = 0, $13 = 0, $15 = 0, $18 = 0, $2 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $34 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $45 = 0, $5 = 0, $51 = 0, $6 = 0, $61 = 0, $67 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp + 4 | 0; + $5 = sp; + $6 = $0 + 52 | 0; + if (HEAP8[$6 >> 0] | 0) { + $9 = $0 + 48 | 0; + $10 = HEAP32[$9 >> 2] | 0; + if ($1) { + $11 = __ZNSt3__211char_traitsIcE3eofEv() | 0; + HEAP32[$9 >> 2] = $11; + HEAP8[$6 >> 0] = 0; + $$11 = $10; + } else $$11 = $10; + } else { + $13 = HEAP32[$0 + 44 >> 2] | 0; + $$sroa$speculated = ($13 | 0) > 1 ? $13 : 1; + $15 = $0 + 32 | 0; + $$052 = 0; + while (1) { + if ($$052 >>> 0 >= $$sroa$speculated >>> 0) { + label = 9; + break; + } + $18 = _getc(HEAP32[$15 >> 2] | 0) | 0; + if (($18 | 0) == -1) { + label = 8; + break; + } + HEAP8[$2 + $$052 >> 0] = $18; + $$052 = $$052 + 1 | 0; + } + if ((label | 0) == 8) $$10 = __ZNSt3__211char_traitsIcE3eofEv() | 0; else if ((label | 0) == 9) { + do if (!(HEAP8[$0 + 53 >> 0] | 0)) { + $28 = $0 + 40 | 0; + $29 = $0 + 36 | 0; + $30 = $3 + 1 | 0; + $$048 = $$sroa$speculated; + L11 : while (1) { + $31 = HEAP32[$28 >> 2] | 0; + $32 = $31; + $34 = HEAP32[$32 >> 2] | 0; + $37 = HEAP32[$32 + 4 >> 2] | 0; + $38 = HEAP32[$29 >> 2] | 0; + $39 = $2 + $$048 | 0; + switch (FUNCTION_TABLE_iiiiiiiii[HEAP32[(HEAP32[$38 >> 2] | 0) + 16 >> 2] & 15]($38, $31, $2, $39, $4, $3, $30, $5) | 0) { + case 3: + { + label = 15; + break L11; + break; + } + case 2: + { + label = 17; + break L11; + break; + } + case 1: + break; + default: + break L11; + } + $45 = HEAP32[$28 >> 2] | 0; + HEAP32[$45 >> 2] = $34; + HEAP32[$45 + 4 >> 2] = $37; + if (($$048 | 0) == 8) { + label = 17; + break; + } + $51 = _getc(HEAP32[$15 >> 2] | 0) | 0; + if (($51 | 0) == -1) { + label = 17; + break; + } + HEAP8[$39 >> 0] = $51; + $$048 = $$048 + 1 | 0; + } + if ((label | 0) == 15) HEAP8[$3 >> 0] = HEAP8[$2 >> 0] | 0; else if ((label | 0) == 17) { + $$9 = __ZNSt3__211char_traitsIcE3eofEv() | 0; + break; + } + $$351 = $$048; + label = 19; + } else { + HEAP8[$3 >> 0] = HEAP8[$2 >> 0] | 0; + $$351 = $$sroa$speculated; + label = 19; + } while (0); + L21 : do if ((label | 0) == 19) { + L23 : do if ($1) { + $67 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$3 >> 0] | 0) | 0; + HEAP32[$0 + 48 >> 2] = $67; + } else { + $$0 = $$351; + do { + if (($$0 | 0) <= 0) break L23; + $$0 = $$0 + -1 | 0; + $61 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$2 + $$0 >> 0] | 0) | 0; + } while ((_ungetc($61, HEAP32[$15 >> 2] | 0) | 0) != -1); + $$9 = __ZNSt3__211char_traitsIcE3eofEv() | 0; + break L21; + } while (0); + $$9 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$3 >> 0] | 0) | 0; + } while (0); + $$10 = $$9; + } + $$11 = $$10; + } + STACKTOP = sp; + return $$11 | 0; +} + +function __ZNSt3__210__stdinbufIwE9__getcharEb($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$048 = 0, $$052 = 0, $$10 = 0, $$11 = 0, $$351 = 0, $$9 = 0, $$sroa$speculated = 0, $10 = 0, $11 = 0, $13 = 0, $15 = 0, $18 = 0, $2 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $35 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $46 = 0, $5 = 0, $52 = 0, $6 = 0, $64 = 0, $70 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp + 4 | 0; + $5 = sp; + $6 = $0 + 52 | 0; + if (HEAP8[$6 >> 0] | 0) { + $9 = $0 + 48 | 0; + $10 = HEAP32[$9 >> 2] | 0; + if ($1) { + $11 = __ZNSt3__211char_traitsIwE3eofEv() | 0; + HEAP32[$9 >> 2] = $11; + HEAP8[$6 >> 0] = 0; + $$11 = $10; + } else $$11 = $10; + } else { + $13 = HEAP32[$0 + 44 >> 2] | 0; + $$sroa$speculated = ($13 | 0) > 1 ? $13 : 1; + $15 = $0 + 32 | 0; + $$052 = 0; + while (1) { + if ($$052 >>> 0 >= $$sroa$speculated >>> 0) { + label = 9; + break; + } + $18 = _getc(HEAP32[$15 >> 2] | 0) | 0; + if (($18 | 0) == -1) { + label = 8; + break; + } + HEAP8[$2 + $$052 >> 0] = $18; + $$052 = $$052 + 1 | 0; + } + if ((label | 0) == 8) $$10 = __ZNSt3__211char_traitsIwE3eofEv() | 0; else if ((label | 0) == 9) { + do if (!(HEAP8[$0 + 53 >> 0] | 0)) { + $29 = $0 + 40 | 0; + $30 = $0 + 36 | 0; + $31 = $3 + 4 | 0; + $$048 = $$sroa$speculated; + L11 : while (1) { + $32 = HEAP32[$29 >> 2] | 0; + $33 = $32; + $35 = HEAP32[$33 >> 2] | 0; + $38 = HEAP32[$33 + 4 >> 2] | 0; + $39 = HEAP32[$30 >> 2] | 0; + $40 = $2 + $$048 | 0; + switch (FUNCTION_TABLE_iiiiiiiii[HEAP32[(HEAP32[$39 >> 2] | 0) + 16 >> 2] & 15]($39, $32, $2, $40, $4, $3, $31, $5) | 0) { + case 3: + { + label = 15; + break L11; + break; + } + case 2: + { + label = 17; + break L11; + break; + } + case 1: + break; + default: + break L11; + } + $46 = HEAP32[$29 >> 2] | 0; + HEAP32[$46 >> 2] = $35; + HEAP32[$46 + 4 >> 2] = $38; + if (($$048 | 0) == 8) { + label = 17; + break; + } + $52 = _getc(HEAP32[$15 >> 2] | 0) | 0; + if (($52 | 0) == -1) { + label = 17; + break; + } + HEAP8[$40 >> 0] = $52; + $$048 = $$048 + 1 | 0; + } + if ((label | 0) == 15) HEAP32[$3 >> 2] = HEAP8[$2 >> 0]; else if ((label | 0) == 17) { + $$9 = __ZNSt3__211char_traitsIwE3eofEv() | 0; + break; + } + $$351 = $$048; + label = 19; + } else { + HEAP32[$3 >> 2] = HEAP8[$2 >> 0]; + $$351 = $$sroa$speculated; + label = 19; + } while (0); + L21 : do if ((label | 0) == 19) { + L23 : do if ($1) { + $70 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$3 >> 2] | 0) | 0; + HEAP32[$0 + 48 >> 2] = $70; + } else { + $$0 = $$351; + do { + if (($$0 | 0) <= 0) break L23; + $$0 = $$0 + -1 | 0; + $64 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP8[$2 + $$0 >> 0] | 0) | 0; + } while ((_ungetc($64, HEAP32[$15 >> 2] | 0) | 0) != -1); + $$9 = __ZNSt3__211char_traitsIwE3eofEv() | 0; + break L21; + } while (0); + $$9 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$3 >> 2] | 0) | 0; + } while (0); + $$10 = $$9; + } + $$11 = $$10; + } + STACKTOP = sp; + return $$11 | 0; +} + +function _jpeg_idct_6x6($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0149162 = 0, $$0151161 = 0, $$0152160 = 0, $$0163 = 0, $$1150158 = 0, $$1159 = 0, $100 = 0, $102 = 0, $104 = 0, $106 = 0, $108 = 0, $111 = 0, $114 = 0, $117 = 0, $15 = 0, $22 = 0, $23 = 0, $25 = 0, $32 = 0, $33 = 0, $34 = 0, $40 = 0, $46 = 0, $5 = 0, $52 = 0, $54 = 0, $57 = 0, $60 = 0, $63 = 0, $7 = 0, $83 = 0, $86 = 0, $89 = 0, $92 = 0, $93 = 0, $95 = 0, $98 = 0, $99 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 144 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(144); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $$0149162 = $5; + $$0151161 = HEAP32[$1 + 84 >> 2] | 0; + $$0152160 = $2; + $$0163 = 0; + while (1) { + $15 = Math_imul(HEAP16[$$0152160 >> 1] << 13, HEAP32[$$0151161 >> 2] | 0) | 0 | 1024; + $22 = Math_imul((HEAP16[$$0152160 + 64 >> 1] | 0) * 5793 | 0, HEAP32[$$0151161 + 128 >> 2] | 0) | 0; + $23 = $22 + $15 | 0; + $25 = (Math_imul($22, -2) | 0) + $15 >> 11; + $32 = Math_imul((HEAP16[$$0152160 + 32 >> 1] | 0) * 10033 | 0, HEAP32[$$0151161 + 64 >> 2] | 0) | 0; + $33 = $32 + $23 | 0; + $34 = $23 - $32 | 0; + $40 = Math_imul(HEAP32[$$0151161 + 32 >> 2] | 0, HEAP16[$$0152160 + 16 >> 1] | 0) | 0; + $46 = Math_imul(HEAP32[$$0151161 + 96 >> 2] | 0, HEAP16[$$0152160 + 48 >> 1] | 0) | 0; + $52 = Math_imul(HEAP32[$$0151161 + 160 >> 2] | 0, HEAP16[$$0152160 + 80 >> 1] | 0) | 0; + $54 = ($52 + $40 | 0) * 2998 | 0; + $57 = $54 + ($46 + $40 << 13) | 0; + $60 = $54 + ($52 - $46 << 13) | 0; + $63 = $40 - $46 - $52 << 2; + HEAP32[$$0149162 >> 2] = $57 + $33 >> 11; + HEAP32[$$0149162 + 120 >> 2] = $33 - $57 >> 11; + HEAP32[$$0149162 + 24 >> 2] = $63 + $25; + HEAP32[$$0149162 + 96 >> 2] = $25 - $63; + HEAP32[$$0149162 + 48 >> 2] = $60 + $34 >> 11; + HEAP32[$$0149162 + 72 >> 2] = $34 - $60 >> 11; + $$0163 = $$0163 + 1 | 0; + if (($$0163 | 0) == 6) break; else { + $$0149162 = $$0149162 + 4 | 0; + $$0151161 = $$0151161 + 4 | 0; + $$0152160 = $$0152160 + 2 | 0; + } + } + $83 = $7 + -384 | 0; + $$1150158 = $5; + $$1159 = 0; + while (1) { + $86 = (HEAP32[$3 + ($$1159 << 2) >> 2] | 0) + $4 | 0; + $89 = (HEAP32[$$1150158 >> 2] << 13) + 134348800 | 0; + $92 = (HEAP32[$$1150158 + 16 >> 2] | 0) * 5793 | 0; + $93 = $89 + $92 | 0; + $95 = $89 - $92 - $92 | 0; + $98 = (HEAP32[$$1150158 + 8 >> 2] | 0) * 10033 | 0; + $99 = $93 + $98 | 0; + $100 = $93 - $98 | 0; + $102 = HEAP32[$$1150158 + 4 >> 2] | 0; + $104 = HEAP32[$$1150158 + 12 >> 2] | 0; + $106 = HEAP32[$$1150158 + 20 >> 2] | 0; + $108 = ($106 + $102 | 0) * 2998 | 0; + $111 = $108 + ($104 + $102 << 13) | 0; + $114 = $108 + ($106 - $104 << 13) | 0; + $117 = $102 - $104 - $106 << 13; + HEAP8[$86 >> 0] = HEAP8[$83 + (($111 + $99 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$86 + 5 >> 0] = HEAP8[$83 + (($99 - $111 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$86 + 1 >> 0] = HEAP8[$83 + (($117 + $95 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$86 + 4 >> 0] = HEAP8[$83 + (($95 - $117 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$86 + 2 >> 0] = HEAP8[$83 + (($114 + $100 | 0) >>> 18 & 1023) >> 0] | 0; + HEAP8[$86 + 3 >> 0] = HEAP8[$83 + (($100 - $114 | 0) >>> 18 & 1023) >> 0] | 0; + $$1159 = $$1159 + 1 | 0; + if (($$1159 | 0) == 6) break; else $$1150158 = $$1150158 + 24 | 0; + } + STACKTOP = sp; + return; +} + +function __ZN6vision16FindHoughMatchesERNSt3__26vectorINS_7match_tENS0_9allocatorIS2_EEEERKNS_21HoughSimilarityVotingERKS5_if($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = +$4; + var $$0 = 0, $$031 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $15 = 0, $16 = 0, $21 = 0, $22 = 0, $34 = 0, $39 = 0, $43 = 0, $45 = 0, $5 = 0, $6 = 0, $7 = 0, $78 = 0, $8 = 0, $83 = 0, $84 = 0, $87 = 0, $9 = 0, $92 = 0, $93 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $5 = sp + 32 | 0; + $6 = sp + 28 | 0; + $7 = sp + 24 | 0; + $8 = sp + 20 | 0; + $9 = sp + 16 | 0; + $10 = sp + 12 | 0; + $11 = sp + 8 | 0; + $12 = sp + 4 | 0; + $13 = sp; + __ZNK6vision21HoughSimilarityVoting16getBinsFromIndexERiS1_S1_S1_i($1, $10, $11, $12, $13, $3); + $15 = $0 + 4 | 0; + HEAP32[$15 >> 2] = HEAP32[$0 >> 2]; + $16 = __ZNK6vision21HoughSimilarityVoting24getSubBinLocationIndicesEv($1) | 0; + $21 = (HEAP32[$16 + 4 >> 2] | 0) - (HEAP32[$16 >> 2] | 0) >> 2; + $22 = __ZNK6vision21HoughSimilarityVoting18getSubBinLocationsEv($1) | 0; + if ($21 >>> 0 > (HEAP32[$2 + 4 >> 2] | 0) - (HEAP32[$2 >> 2] | 0) >> 3 >>> 0) { + $34 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 35942) | 0, 34139) | 0, 39072) | 0, 342) | 0, 39079) | 0, 35988) | 0; + __ZNKSt3__28ios_base6getlocEv($5, $34 + (HEAP32[(HEAP32[$34 >> 2] | 0) + -12 >> 2] | 0) | 0); + $39 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + $43 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$39 >> 2] | 0) + 28 >> 2] & 127]($39, 10) | 0; + __ZNSt3__26localeD2Ev($5); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($34, $43) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($34) | 0; + _abort(); + } + $45 = $0 + 8 | 0; + $$0 = HEAP32[$22 >> 2] | 0; + $$031 = 0; + while (1) { + if (($$031 | 0) >= ($21 | 0)) break; + __ZNK6vision21HoughSimilarityVoting14getBinDistanceERfS1_S1_S1_ffffffff($1, $6, $7, $8, $9, +HEAPF32[$$0 >> 2], +HEAPF32[$$0 + 4 >> 2], +HEAPF32[$$0 + 8 >> 2], +HEAPF32[$$0 + 12 >> 2], +(HEAP32[$10 >> 2] | 0) + .5, +(HEAP32[$11 >> 2] | 0) + .5, +(HEAP32[$12 >> 2] | 0) + .5, +(HEAP32[$13 >> 2] | 0) + .5); + do if ((+HEAPF32[$6 >> 2] < $4 ? +HEAPF32[$7 >> 2] < $4 : 0) & +HEAPF32[$8 >> 2] < $4 & +HEAPF32[$9 >> 2] < $4) { + $78 = __ZNK6vision21HoughSimilarityVoting24getSubBinLocationIndicesEv($1) | 0; + $83 = (HEAP32[$2 >> 2] | 0) + (HEAP32[(HEAP32[$78 >> 2] | 0) + ($$031 << 2) >> 2] << 3) | 0; + $84 = HEAP32[$15 >> 2] | 0; + if (($84 | 0) == (HEAP32[$45 >> 2] | 0)) { + __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE21__push_back_slow_pathIRKS2_EEvOT_($0, $83); + break; + } else { + $87 = $83; + $92 = HEAP32[$87 + 4 >> 2] | 0; + $93 = $84; + HEAP32[$93 >> 2] = HEAP32[$87 >> 2]; + HEAP32[$93 + 4 >> 2] = $92; + HEAP32[$15 >> 2] = (HEAP32[$15 >> 2] | 0) + 8; + break; + } + } while (0); + $$0 = $$0 + 16 | 0; + $$031 = $$031 + 1 | 0; + } + STACKTOP = sp; + return; +} + +function _scanexp($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$04858 = 0, $$049 = 0, $$157 = 0, $$251 = 0, $$pre$phi69Z2D = 0, $100 = 0, $11 = 0, $13 = 0, $14 = 0, $2 = 0, $21 = 0, $22 = 0, $3 = 0, $36 = 0, $4 = 0, $43 = 0, $44 = 0, $49 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $57 = 0, $61 = 0, $68 = 0, $69 = 0, $78 = 0, $86 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $99 = 0, label = 0; + $2 = $0 + 4 | 0; + $3 = HEAP32[$2 >> 2] | 0; + $4 = $0 + 104 | 0; + if ($3 >>> 0 < (HEAP32[$4 >> 2] | 0) >>> 0) { + HEAP32[$2 >> 2] = $3 + 1; + $11 = HEAPU8[$3 >> 0] | 0; + } else $11 = ___shgetc($0) | 0; + switch ($11 | 0) { + case 43: + case 45: + { + $13 = ($11 | 0) == 45 & 1; + $14 = HEAP32[$2 >> 2] | 0; + if ($14 >>> 0 < (HEAP32[$4 >> 2] | 0) >>> 0) { + HEAP32[$2 >> 2] = $14 + 1; + $22 = HEAPU8[$14 >> 0] | 0; + } else $22 = ___shgetc($0) | 0; + $21 = $22 + -48 | 0; + if (($1 | 0) != 0 & $21 >>> 0 > 9) if (!(HEAP32[$4 >> 2] | 0)) { + $100 = 0; + $99 = -2147483648; + } else { + HEAP32[$2 >> 2] = (HEAP32[$2 >> 2] | 0) + -1; + label = 14; + } else { + $$0 = $13; + $$049 = $22; + $$pre$phi69Z2D = $21; + label = 12; + } + break; + } + default: + { + $$0 = 0; + $$049 = $11; + $$pre$phi69Z2D = $11 + -48 | 0; + label = 12; + } + } + if ((label | 0) == 12) if ($$pre$phi69Z2D >>> 0 > 9) label = 14; else { + $$04858 = 0; + $$157 = $$049; + while (1) { + $$04858 = $$157 + -48 + ($$04858 * 10 | 0) | 0; + $36 = HEAP32[$2 >> 2] | 0; + if ($36 >>> 0 < (HEAP32[$4 >> 2] | 0) >>> 0) { + HEAP32[$2 >> 2] = $36 + 1; + $44 = HEAPU8[$36 >> 0] | 0; + } else $44 = ___shgetc($0) | 0; + $43 = $44 + -48 | 0; + if (!($43 >>> 0 < 10 & ($$04858 | 0) < 214748364)) break; else $$157 = $44; + } + $49 = (($$04858 | 0) < 0) << 31 >> 31; + if ($43 >>> 0 < 10) { + $$251 = $44; + $51 = $$04858; + $52 = $49; + while (1) { + $53 = ___muldi3($51 | 0, $52 | 0, 10, 0) | 0; + $54 = getTempRet0() | 0; + $57 = _i64Add($$251 | 0, (($$251 | 0) < 0) << 31 >> 31 | 0, -48, -1) | 0; + $51 = _i64Add($57 | 0, getTempRet0() | 0, $53 | 0, $54 | 0) | 0; + $52 = getTempRet0() | 0; + $61 = HEAP32[$2 >> 2] | 0; + if ($61 >>> 0 < (HEAP32[$4 >> 2] | 0) >>> 0) { + HEAP32[$2 >> 2] = $61 + 1; + $69 = HEAPU8[$61 >> 0] | 0; + } else $69 = ___shgetc($0) | 0; + $68 = $69 + -48 | 0; + if (!($68 >>> 0 < 10 & (($52 | 0) < 21474836 | ($52 | 0) == 21474836 & $51 >>> 0 < 2061584302))) break; else $$251 = $69; + } + if ($68 >>> 0 < 10) { + do { + $78 = HEAP32[$2 >> 2] | 0; + if ($78 >>> 0 < (HEAP32[$4 >> 2] | 0) >>> 0) { + HEAP32[$2 >> 2] = $78 + 1; + $86 = HEAPU8[$78 >> 0] | 0; + } else $86 = ___shgetc($0) | 0; + } while (($86 + -48 | 0) >>> 0 < 10); + $93 = $51; + $94 = $52; + } else { + $93 = $51; + $94 = $52; + } + } else { + $93 = $$04858; + $94 = $49; + } + if (HEAP32[$4 >> 2] | 0) HEAP32[$2 >> 2] = (HEAP32[$2 >> 2] | 0) + -1; + $92 = ($$0 | 0) == 0; + $95 = _i64Subtract(0, 0, $93 | 0, $94 | 0) | 0; + $96 = getTempRet0() | 0; + $100 = $92 ? $93 : $95; + $99 = $92 ? $94 : $96; + } + if ((label | 0) == 14) if (!(HEAP32[$4 >> 2] | 0)) { + $100 = 0; + $99 = -2147483648; + } else { + HEAP32[$2 >> 2] = (HEAP32[$2 >> 2] | 0) + -1; + $100 = 0; + $99 = -2147483648; + } + setTempRet0($99 | 0); + return $100 | 0; +} + +function _icpPoint($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$088 = 0, $$090 = 0.0, $$091 = 0.0, $$092 = 0, $$1 = 0, $$189 = 0, $$2 = 0, $12 = 0, $15 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $34 = 0, $38 = 0.0, $42 = 0.0, $47 = 0, $5 = 0, $53 = 0.0, $6 = 0, $65 = 0, $7 = 0, $8 = 0, $9 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 176 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(176); + $vararg_buffer1 = sp + 168 | 0; + $vararg_buffer = sp + 160 | 0; + $5 = sp + 144 | 0; + $6 = sp + 48 | 0; + $7 = sp; + $8 = $1 + 8 | 0; + $9 = HEAP32[$8 >> 2] | 0; + do if (($9 | 0) >= 3) { + $12 = _malloc($9 * 96 | 0) | 0; + if (!$12) { + _arLog(0, 3, 45947, $vararg_buffer); + $$092 = -1; + break; + } + $15 = _malloc($9 << 4) | 0; + if (!$15) { + _arLog(0, 3, 45947, $vararg_buffer1); + _free($12); + $$092 = -1; + break; + } + $$0 = 0; + while (1) { + if (($$0 | 0) == 3) break; + $$088 = 0; + while (1) { + if (($$088 | 0) == 4) break; + HEAPF64[$3 + ($$0 << 5) + ($$088 << 3) >> 3] = +HEAPF64[$2 + ($$0 << 5) + ($$088 << 3) >> 3]; + $$088 = $$088 + 1 | 0; + } + $$0 = $$0 + 1 | 0; + } + $22 = $1 + 4 | 0; + $23 = $5 + 8 | 0; + $24 = $0 + 104 | 0; + $25 = $0 + 96 | 0; + $26 = $0 + 120 | 0; + $27 = $0 + 112 | 0; + $$091 = 0.0; + $$189 = 0; + L17 : while (1) { + _arUtilMatMul($0, $3, $6) | 0; + $$090 = 0.0; + $$1 = 0; + while (1) { + $28 = HEAP32[$8 >> 2] | 0; + if (($$1 | 0) >= ($28 | 0)) break; + if ((_icpGetU_from_X_by_MatX2U($5, $6, (HEAP32[$22 >> 2] | 0) + ($$1 * 24 | 0) | 0) | 0) < 0) { + label = 16; + break L17; + } + $34 = HEAP32[$1 >> 2] | 0; + $38 = +HEAPF64[$34 + ($$1 << 4) >> 3] - +HEAPF64[$5 >> 3]; + $42 = +HEAPF64[$34 + ($$1 << 4) + 8 >> 3] - +HEAPF64[$23 >> 3]; + $47 = $$1 << 1; + HEAPF64[$15 + ($47 << 3) >> 3] = $38; + HEAPF64[$15 + (($47 | 1) << 3) >> 3] = $42; + $$090 = $$090 + ($38 * $38 + $42 * $42); + $$1 = $$1 + 1 | 0; + } + $53 = $$090 / +($28 | 0); + if ($53 < +HEAPF64[$24 >> 3]) { + label = 31; + break; + } + if (($$189 | 0 ? $53 < +HEAPF64[$26 >> 3] : 0) ? $53 / $$091 > +HEAPF64[$27 >> 3] : 0) { + label = 31; + break; + } + if (($$189 | 0) == (HEAP32[$25 >> 2] | 0)) { + label = 31; + break; + } + $$2 = 0; + $65 = $28; + while (1) { + if (($$2 | 0) >= ($65 | 0)) break; + if ((_icpGetJ_U_S($12 + ($$2 * 12 << 3) | 0, $0, $3, (HEAP32[$22 >> 2] | 0) + ($$2 * 24 | 0) | 0) | 0) < 0) { + label = 27; + break L17; + } + $$2 = $$2 + 1 | 0; + $65 = HEAP32[$8 >> 2] | 0; + } + if ((_icpGetDeltaS($7, $15, $12, $65 << 1) | 0) < 0) { + label = 29; + break; + } + _icpUpdateMat($3, $7) | 0; + $$091 = $53; + $$189 = $$189 + 1 | 0; + } + if ((label | 0) == 16) { + _icpGetXw2XcCleanup($12, $15); + $$092 = -1; + break; + } else if ((label | 0) == 27) { + _icpGetXw2XcCleanup($12, $15); + $$092 = -1; + break; + } else if ((label | 0) == 29) { + _icpGetXw2XcCleanup($12, $15); + $$092 = -1; + break; + } else if ((label | 0) == 31) { + HEAPF64[$4 >> 3] = $53; + _free($12); + _free($15); + $$092 = 0; + break; + } + } else $$092 = -1; while (0); + STACKTOP = sp; + return $$092 | 0; +} + +function __ZNSt3__26vectorIiNS_9allocatorIiEEE6insertINS_11__wrap_iterIPKiEEEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr16is_constructibleIiNS_15iterator_traitsISA_E9referenceEEE5valueENS5_IPiEEE4typeES8_SA_SA_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$0$i$i = 0, $$byval_copy2 = 0, $$byval_copy3 = 0, $$sroa$044$059 = 0, $10 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $20 = 0, $23 = 0, $24 = 0, $29 = 0, $30 = 0, $32 = 0, $34 = 0, $38 = 0, $4 = 0, $40 = 0, $46 = 0, $47 = 0, $5 = 0, $51 = 0, $52 = 0, $56 = 0, $6 = 0, $61 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy3 = sp + 40 | 0; + $$byval_copy2 = sp + 36 | 0; + $4 = sp + 32 | 0; + $5 = sp + 28 | 0; + $6 = sp + 8 | 0; + $7 = sp + 4 | 0; + $8 = sp; + $9 = HEAP32[$0 >> 2] | 0; + $10 = $9; + $14 = $9 + ((HEAP32[$1 >> 2] | 0) - $10 >> 2 << 2) | 0; + $15 = HEAP32[$2 >> 2] | 0; + $16 = HEAP32[$3 >> 2] | 0; + $17 = $16 - $15 | 0; + $18 = $17 >> 2; + L1 : do if (($17 | 0) > 0) { + $20 = $0 + 8 | 0; + $23 = HEAP32[$0 + 4 >> 2] | 0; + $24 = $23; + if (($18 | 0) > ((HEAP32[$20 >> 2] | 0) - $24 >> 2 | 0)) { + $46 = ($24 - $10 >> 2) + $18 | 0; + $47 = __ZNKSt3__26vectorIiNS_9allocatorIiEEE8max_sizeEv($0) | 0; + if ($47 >>> 0 < $46 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $51 = HEAP32[$0 >> 2] | 0; + $52 = (HEAP32[$20 >> 2] | 0) - $51 | 0; + $56 = $52 >> 1; + __ZNSt3__214__split_bufferIiRNS_9allocatorIiEEEC2EmmS3_($6, $52 >> 2 >>> 0 < $47 >>> 1 >>> 0 ? ($56 >>> 0 < $46 >>> 0 ? $46 : $56) : $47, $14 - $51 >> 2, $0 + 8 | 0); + HEAP32[$7 >> 2] = $15; + HEAP32[$8 >> 2] = $16; + HEAP32[$$byval_copy2 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$$byval_copy3 >> 2] = HEAP32[$8 >> 2]; + __ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE18__construct_at_endINS_11__wrap_iterIPKiEEEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESB_SB_($6, $$byval_copy2, $$byval_copy3); + $61 = __ZNSt3__26vectorIiNS_9allocatorIiEEE26__swap_out_circular_bufferERNS_14__split_bufferIiRS2_EEPi($0, $6, $14) | 0; + __ZNSt3__214__split_bufferIiRNS_9allocatorIiEEED2Ev($6); + $$0 = $61; + break; + } + } + $29 = $24 - $14 | 0; + $30 = $29 >> 2; + $32 = $15; + $34 = $32 + ($30 << 2) | 0; + if (($18 | 0) > ($30 | 0)) { + HEAP32[$4 >> 2] = $34; + HEAP32[$5 >> 2] = $16; + HEAP32[$$byval_copy2 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy3 >> 2] = HEAP32[$5 >> 2]; + __ZNSt3__26vectorIiNS_9allocatorIiEEE18__construct_at_endINS_11__wrap_iterIPKiEEEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_m($0, $$byval_copy2, $$byval_copy3, $18 - $30 | 0); + if (($29 | 0) > 0) $$sroa$044$059 = $34; else { + $$0 = $14; + break; + } + } else $$sroa$044$059 = $16; + __ZNSt3__26vectorIiNS_9allocatorIiEEE12__move_rangeEPiS4_S4_($0, $14, $23, $14 + ($18 << 2) | 0); + $38 = $$sroa$044$059; + $$0$i$i = $14; + $40 = $32; + while (1) { + if (($40 | 0) == ($38 | 0)) { + $$0 = $14; + break L1; + } + HEAP32[$$0$i$i >> 2] = HEAP32[$40 >> 2]; + $$0$i$i = $$0$i$i + 4 | 0; + $40 = $40 + 4 | 0; + } + } else $$0 = $14; while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN6vision11PartialSortIfEET_PS1_ii($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$044 = 0, $$047 = 0, $$049 = 0, $$1 = 0, $$145 = 0, $$2 = 0, $$246 = 0, $10 = 0, $15 = 0, $19 = 0, $26 = 0, $3 = 0, $31 = 0, $35 = 0, $36 = 0, $38 = 0, $40 = 0.0, $41 = 0, $42 = 0.0, $44 = 0, $45 = 0, $46 = 0.0, $48 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + if (($1 | 0) <= 0) { + $10 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 37491) | 0, 37520) | 0, 39072) | 0, 53) | 0, 39079) | 0, 37593) | 0; + __ZNKSt3__28ios_base6getlocEv($3, $10 + (HEAP32[(HEAP32[$10 >> 2] | 0) + -12 >> 2] | 0) | 0); + $15 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66512) | 0; + $19 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$15 >> 2] | 0) + 28 >> 2] & 127]($15, 10) | 0; + __ZNSt3__26localeD2Ev($3); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($10, $19) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($10) | 0; + _abort(); + } + if (($2 | 0) <= 0) { + $26 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 37612) | 0, 37520) | 0, 39072) | 0, 54) | 0, 39079) | 0, 37641) | 0; + __ZNKSt3__28ios_base6getlocEv($3, $26 + (HEAP32[(HEAP32[$26 >> 2] | 0) + -12 >> 2] | 0) | 0); + $31 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66512) | 0; + $35 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$31 >> 2] | 0) + 28 >> 2] & 127]($31, 10) | 0; + __ZNSt3__26localeD2Ev($3); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($26, $35) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($26) | 0; + _abort(); + } + $36 = $2 + -1 | 0; + $38 = $0 + ($36 << 2) | 0; + $$047 = $1 + -1 | 0; + $$049 = 0; + while (1) { + $40 = +HEAPF32[$38 >> 2]; + if (($$049 | 0) >= ($$047 | 0)) break; + $$0 = $$049; + $$044 = $$047; + while (1) { + $$1 = $$0; + while (1) { + $41 = $0 + ($$1 << 2) | 0; + $42 = +HEAPF32[$41 >> 2]; + $44 = $$1 + 1 | 0; + if ($42 < $40) $$1 = $44; else break; + } + $$145 = $$044; + while (1) { + $45 = $0 + ($$145 << 2) | 0; + $46 = +HEAPF32[$45 >> 2]; + $48 = $$145 + -1 | 0; + if ($40 < $46) $$145 = $48; else break; + } + if (($$1 | 0) > ($$145 | 0)) { + $$2 = $$1; + $$246 = $$145; + } else { + HEAPF32[$41 >> 2] = $46; + HEAPF32[$45 >> 2] = $42; + $$2 = $44; + $$246 = $48; + } + if (($$2 | 0) > ($$246 | 0)) break; else { + $$0 = $$2; + $$044 = $$246; + } + } + $$047 = ($$2 | 0) < ($2 | 0) ? $$047 : $$246; + $$049 = ($$246 | 0) < ($36 | 0) ? $$2 : $$049; + } + STACKTOP = sp; + return +$40; +} + +function __ZN6vision26ComputeSubpixelDerivativesERfS0_S0_S0_S0_RKNS_5ImageEii($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $18 = 0, $23 = 0, $27 = 0, $28 = 0, $30 = 0, $38 = 0, $43 = 0, $47 = 0, $49 = 0, $51 = 0, $53 = 0, $54 = 0, $56 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $8 = sp; + if (($6 | 0) > 0 ? ($6 + 1 | 0) >>> 0 < (__ZNK6vision5Image5widthEv($5) | 0) >>> 0 : 0) { + $28 = $7 + -1 | 0; + if (($7 | 0) > 0 ? ($30 = $7 + 1 | 0, $30 >>> 0 < (__ZNK6vision5Image6heightEv($5) | 0) >>> 0) : 0) { + $49 = (__ZNK6vision5Image3getIfEEPKT_m($5, $28) | 0) + ($6 << 2) | 0; + $51 = (__ZNK6vision5Image3getIfEEPKT_m($5, $7) | 0) + ($6 << 2) | 0; + $53 = (__ZNK6vision5Image3getIfEEPKT_m($5, $30) | 0) + ($6 << 2) | 0; + $54 = $51 + 4 | 0; + $56 = $51 + -4 | 0; + HEAPF32[$0 >> 2] = (+HEAPF32[$54 >> 2] - +HEAPF32[$56 >> 2]) * .5; + HEAPF32[$1 >> 2] = (+HEAPF32[$53 >> 2] - +HEAPF32[$49 >> 2]) * .5; + HEAPF32[$2 >> 2] = +HEAPF32[$54 >> 2] + (+HEAPF32[$56 >> 2] - +HEAPF32[$51 >> 2] * 2.0); + HEAPF32[$3 >> 2] = +HEAPF32[$53 >> 2] + (+HEAPF32[$49 >> 2] - +HEAPF32[$51 >> 2] * 2.0); + HEAPF32[$4 >> 2] = (+HEAPF32[$49 + -4 >> 2] + +HEAPF32[$53 + 4 >> 2] - (+HEAPF32[$49 + 4 >> 2] + +HEAPF32[$53 + -4 >> 2])) * .25; + STACKTOP = sp; + return; + } + $38 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30161) | 0, 28600) | 0, 39072) | 0, 285) | 0, 39079) | 0, 29077) | 0; + __ZNKSt3__28ios_base6getlocEv($8, $38 + (HEAP32[(HEAP32[$38 >> 2] | 0) + -12 >> 2] | 0) | 0); + $43 = __ZNKSt3__26locale9use_facetERNS0_2idE($8, 66512) | 0; + $47 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$43 >> 2] | 0) + 28 >> 2] & 127]($43, 10) | 0; + __ZNSt3__26localeD2Ev($8); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($38, $47) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($38) | 0; + _abort(); + } + $18 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 30105) | 0, 28600) | 0, 39072) | 0, 284) | 0, 39079) | 0, 29002) | 0; + __ZNKSt3__28ios_base6getlocEv($8, $18 + (HEAP32[(HEAP32[$18 >> 2] | 0) + -12 >> 2] | 0) | 0); + $23 = __ZNKSt3__26locale9use_facetERNS0_2idE($8, 66512) | 0; + $27 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$23 >> 2] | 0) + 28 >> 2] & 127]($23, 10) | 0; + __ZNSt3__26localeD2Ev($8); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($18, $27) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($18) | 0; + _abort(); +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseConversionExprEv($0) { + $0 = $0 | 0; + var $$3 = 0, $$4 = 0, $$5 = 0, $$byval_copy = 0, $1 = 0, $10 = 0, $11 = 0, $13 = 0, $16 = 0, $2 = 0, $3 = 0, $6 = 0, $7 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp + 24 | 0; + $1 = sp + 16 | 0; + $2 = sp + 8 | 0; + $3 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($1, 54552); + HEAP32[$$byval_copy >> 2] = HEAP32[$1 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$1 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy) | 0) { + __ZN12_GLOBAL__N_114SwapAndRestoreIbEC2ERbb($2, $0 + 360 | 0, 0); + $6 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $7 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($6) | 0; + HEAP32[$$byval_copy >> 2] = $7; + __ZN12_GLOBAL__N_114SwapAndRestoreIbED2Ev($2); + do if ($7) { + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0)) { + $16 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($6) | 0; + HEAP32[$2 >> 2] = $16; + if (!$16) $$3 = 0; else { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13makeNodeArrayIPPNS0_4NodeEEENS0_9NodeArrayET_SB_($3, $0, $2, $2 + 4 | 0); + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_14ConversionExprEJRPNS0_4NodeENS0_9NodeArrayEEEES9_DpOT0_($0, $$byval_copy, $3) | 0; + } + $$4 = $$3; + break; + } + $10 = $0 + 8 | 0; + $11 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($10) | 0; + while (1) { + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) { + label = 9; + break; + } + $13 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($6) | 0; + HEAP32[$2 >> 2] = $13; + if (!$13) { + label = 7; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($10, $2); + } + if ((label | 0) == 7) { + $$4 = 0; + break; + } else if ((label | 0) == 9) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20popTrailingNodeArrayEm($2, $0, $11); + $$4 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_14ConversionExprEJRPNS0_4NodeERNS0_9NodeArrayEEEES9_DpOT0_($0, $$byval_copy, $2) | 0; + break; + } + } else $$4 = 0; while (0); + $$5 = $$4; + } else $$5 = 0; + STACKTOP = sp; + return $$5 | 0; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE8__rehashEm($this, $__nbc) { + $this = $this | 0; + $__nbc = $__nbc | 0; + var $0 = 0, $18 = 0, $2 = 0, $4 = 0, $6 = 0, $9 = 0, $__cp$0 = 0, $__i$0 = 0, $__np$0 = 0, $__phash$0$ph$ph = 0, $__pp$0$ph = 0, $__pp$0$ph$ph = 0, $__value_ = 0, $__value_$i$i = 0, $__value_$i$i$i = 0, $arrayidx$i61 = 0, $call$i$i$i = 0, $cond3$i = 0, $cond3$i72 = 0, $exception$i$i$i = 0, $sub$i66 = 0, $tobool$i68 = 0; + $__value_$i$i$i = $this + 4 | 0; + L1 : do if ($__nbc) { + if ($__nbc >>> 0 > 1073741823) { + $exception$i$i$i = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($exception$i$i$i, 41481); + HEAP32[$exception$i$i$i >> 2] = 17472; + ___cxa_throw($exception$i$i$i | 0, 13960, 22); + } + $call$i$i$i = __Znwm($__nbc << 2) | 0; + $0 = HEAP32[$this >> 2] | 0; + HEAP32[$this >> 2] = $call$i$i$i; + if ($0 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($0, HEAP32[$this + 4 >> 2] << 2); + HEAP32[$__value_$i$i$i >> 2] = $__nbc; + $__i$0 = 0; + while (1) { + if (($__i$0 | 0) == ($__nbc | 0)) break; + HEAP32[(HEAP32[$this >> 2] | 0) + ($__i$0 << 2) >> 2] = 0; + $__i$0 = $__i$0 + 1 | 0; + } + $__value_$i$i = $this + 8 | 0; + $2 = HEAP32[$__value_$i$i >> 2] | 0; + if ($2 | 0) { + $4 = HEAP32[$2 + 4 >> 2] | 0; + $sub$i66 = $__nbc + -1 | 0; + $tobool$i68 = ($sub$i66 & $__nbc | 0) == 0; + if (!$tobool$i68) if ($4 >>> 0 < $__nbc >>> 0) $cond3$i72 = $4; else $cond3$i72 = ($4 >>> 0) % ($__nbc >>> 0) | 0; else $cond3$i72 = $4 & $sub$i66; + HEAP32[(HEAP32[$this >> 2] | 0) + ($cond3$i72 << 2) >> 2] = $__value_$i$i; + $__phash$0$ph$ph = $cond3$i72; + $__pp$0$ph$ph = $2; + while (1) { + $__pp$0$ph = $__pp$0$ph$ph; + L25 : while (1) { + while (1) { + $__cp$0 = HEAP32[$__pp$0$ph >> 2] | 0; + if (!$__cp$0) break L1; + $6 = HEAP32[$__cp$0 + 4 >> 2] | 0; + if (!$tobool$i68) if ($6 >>> 0 < $__nbc >>> 0) $cond3$i = $6; else $cond3$i = ($6 >>> 0) % ($__nbc >>> 0) | 0; else $cond3$i = $6 & $sub$i66; + if (($cond3$i | 0) == ($__phash$0$ph$ph | 0)) break; + $arrayidx$i61 = (HEAP32[$this >> 2] | 0) + ($cond3$i << 2) | 0; + if (!(HEAP32[$arrayidx$i61 >> 2] | 0)) break L25; + $__value_ = $__cp$0 + 8 | 0; + $__np$0 = $__cp$0; + while (1) { + $9 = HEAP32[$__np$0 >> 2] | 0; + if (!$9) break; + if ((HEAP32[$__value_ >> 2] | 0) == (HEAP32[$9 + 8 >> 2] | 0)) $__np$0 = $9; else break; + } + HEAP32[$__pp$0$ph >> 2] = $9; + HEAP32[$__np$0 >> 2] = HEAP32[HEAP32[(HEAP32[$this >> 2] | 0) + ($cond3$i << 2) >> 2] >> 2]; + HEAP32[HEAP32[(HEAP32[$this >> 2] | 0) + ($cond3$i << 2) >> 2] >> 2] = $__cp$0; + } + $__pp$0$ph = $__cp$0; + } + HEAP32[$arrayidx$i61 >> 2] = $__pp$0$ph; + $__phash$0$ph$ph = $cond3$i; + $__pp$0$ph$ph = $__cp$0; + } + } + } else { + $18 = HEAP32[$this >> 2] | 0; + HEAP32[$this >> 2] = 0; + if ($18 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($18, HEAP32[$this + 4 >> 2] << 2); + HEAP32[$__value_$i$i$i >> 2] = 0; + } while (0); + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIi7ARParamEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE8__rehashEm($this, $__nbc) { + $this = $this | 0; + $__nbc = $__nbc | 0; + var $0 = 0, $18 = 0, $2 = 0, $4 = 0, $6 = 0, $9 = 0, $__cp$0 = 0, $__i$0 = 0, $__np$0 = 0, $__phash$0$ph$ph = 0, $__pp$0$ph = 0, $__pp$0$ph$ph = 0, $__value_ = 0, $__value_$i$i = 0, $__value_$i$i$i = 0, $arrayidx$i61 = 0, $call$i$i$i = 0, $cond3$i = 0, $cond3$i72 = 0, $exception$i$i$i = 0, $sub$i66 = 0, $tobool$i68 = 0; + $__value_$i$i$i = $this + 4 | 0; + L1 : do if ($__nbc) { + if ($__nbc >>> 0 > 1073741823) { + $exception$i$i$i = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($exception$i$i$i, 41481); + HEAP32[$exception$i$i$i >> 2] = 17472; + ___cxa_throw($exception$i$i$i | 0, 13960, 22); + } + $call$i$i$i = __Znwm($__nbc << 2) | 0; + $0 = HEAP32[$this >> 2] | 0; + HEAP32[$this >> 2] = $call$i$i$i; + if ($0 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($0, HEAP32[$this + 4 >> 2] << 2); + HEAP32[$__value_$i$i$i >> 2] = $__nbc; + $__i$0 = 0; + while (1) { + if (($__i$0 | 0) == ($__nbc | 0)) break; + HEAP32[(HEAP32[$this >> 2] | 0) + ($__i$0 << 2) >> 2] = 0; + $__i$0 = $__i$0 + 1 | 0; + } + $__value_$i$i = $this + 8 | 0; + $2 = HEAP32[$__value_$i$i >> 2] | 0; + if ($2 | 0) { + $4 = HEAP32[$2 + 4 >> 2] | 0; + $sub$i66 = $__nbc + -1 | 0; + $tobool$i68 = ($sub$i66 & $__nbc | 0) == 0; + if (!$tobool$i68) if ($4 >>> 0 < $__nbc >>> 0) $cond3$i72 = $4; else $cond3$i72 = ($4 >>> 0) % ($__nbc >>> 0) | 0; else $cond3$i72 = $4 & $sub$i66; + HEAP32[(HEAP32[$this >> 2] | 0) + ($cond3$i72 << 2) >> 2] = $__value_$i$i; + $__phash$0$ph$ph = $cond3$i72; + $__pp$0$ph$ph = $2; + while (1) { + $__pp$0$ph = $__pp$0$ph$ph; + L25 : while (1) { + while (1) { + $__cp$0 = HEAP32[$__pp$0$ph >> 2] | 0; + if (!$__cp$0) break L1; + $6 = HEAP32[$__cp$0 + 4 >> 2] | 0; + if (!$tobool$i68) if ($6 >>> 0 < $__nbc >>> 0) $cond3$i = $6; else $cond3$i = ($6 >>> 0) % ($__nbc >>> 0) | 0; else $cond3$i = $6 & $sub$i66; + if (($cond3$i | 0) == ($__phash$0$ph$ph | 0)) break; + $arrayidx$i61 = (HEAP32[$this >> 2] | 0) + ($cond3$i << 2) | 0; + if (!(HEAP32[$arrayidx$i61 >> 2] | 0)) break L25; + $__value_ = $__cp$0 + 8 | 0; + $__np$0 = $__cp$0; + while (1) { + $9 = HEAP32[$__np$0 >> 2] | 0; + if (!$9) break; + if ((HEAP32[$__value_ >> 2] | 0) == (HEAP32[$9 + 8 >> 2] | 0)) $__np$0 = $9; else break; + } + HEAP32[$__pp$0$ph >> 2] = $9; + HEAP32[$__np$0 >> 2] = HEAP32[HEAP32[(HEAP32[$this >> 2] | 0) + ($cond3$i << 2) >> 2] >> 2]; + HEAP32[HEAP32[(HEAP32[$this >> 2] | 0) + ($cond3$i << 2) >> 2] >> 2] = $__cp$0; + } + $__pp$0$ph = $__cp$0; + } + HEAP32[$arrayidx$i61 >> 2] = $__pp$0$ph; + $__phash$0$ph$ph = $cond3$i; + $__pp$0$ph$ph = $__cp$0; + } + } + } else { + $18 = HEAP32[$this >> 2] | 0; + HEAP32[$this >> 2] = 0; + if ($18 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($18, HEAP32[$this + 4 >> 2] << 2); + HEAP32[$__value_$i$i$i >> 2] = 0; + } while (0); + return; +} + +function __ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = +$4; + var $$0 = 0, $$037 = 0, $$1 = 0, $$2 = 0, $$byval_copy = 0, $$sroa$039$0 = 0, $$sroa$046$0 = 0, $10 = 0, $11 = 0, $12 = 0, $19 = 0, $20 = 0, $26 = 0, $31 = 0, $33 = 0, $34 = 0, $35 = 0, $38 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $vararg_buffer = 0, $vararg_buffer2 = 0, $vararg_buffer5 = 0, $vararg_buffer9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 352 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(352); + $$byval_copy = sp + 344 | 0; + $vararg_buffer9 = sp + 320 | 0; + $vararg_buffer5 = sp + 304 | 0; + $vararg_buffer2 = sp + 296 | 0; + $vararg_buffer = sp + 280 | 0; + $5 = sp + 272 | 0; + $6 = sp + 240 | 0; + $7 = sp + 340 | 0; + $8 = sp; + $9 = sp + 336 | 0; + $10 = sp + 332 | 0; + $11 = sp + 328 | 0; + $12 = $5; + HEAP32[$12 >> 2] = 37; + HEAP32[$12 + 4 >> 2] = 0; + $19 = __ZNSt3__214__num_put_base14__format_floatEPcPKcj($5 + 1 | 0, 59184, HEAP32[$2 + 4 >> 2] | 0) | 0; + HEAP32[$7 >> 2] = $6; + $20 = __ZNSt3__26__clocEv() | 0; + if ($19) { + HEAP32[$vararg_buffer >> 2] = HEAP32[$2 + 8 >> 2]; + HEAPF64[$vararg_buffer + 8 >> 3] = $4; + $$0 = __ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($6, 30, $20, $5, $vararg_buffer) | 0; + } else { + HEAPF64[$vararg_buffer2 >> 3] = $4; + $$0 = __ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($6, 30, $20, $5, $vararg_buffer2) | 0; + } + if (($$0 | 0) > 29) { + $26 = __ZNSt3__26__clocEv() | 0; + if ($19) { + HEAP32[$vararg_buffer5 >> 2] = HEAP32[$2 + 8 >> 2]; + HEAPF64[$vararg_buffer5 + 8 >> 3] = $4; + $$1 = __ZNSt3__219__libcpp_asprintf_lEPPcP15__locale_structPKcz($7, $26, $5, $vararg_buffer5) | 0; + } else { + HEAPF64[$vararg_buffer9 >> 3] = $4; + $$1 = __ZNSt3__219__libcpp_asprintf_lEPPcP15__locale_structPKcz($7, $26, $5, $vararg_buffer9) | 0; + } + $31 = HEAP32[$7 >> 2] | 0; + if (!$31) __ZSt17__throw_bad_allocv(); else { + $$2 = $$1; + $$sroa$046$0 = $31; + $34 = $31; + } + } else { + $$2 = $$0; + $$sroa$046$0 = 0; + $34 = HEAP32[$7 >> 2] | 0; + } + $33 = $34 + $$2 | 0; + $35 = __ZNSt3__214__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE($34, $33, $2) | 0; + do if (($34 | 0) != ($6 | 0)) { + $38 = _malloc($$2 << 3) | 0; + if (!$38) __ZSt17__throw_bad_allocv(); else { + $$037 = $38; + $$sroa$039$0 = 0; + $44 = $38; + break; + } + } else { + $$037 = $8; + $$sroa$039$0 = 1; + $44 = 0; + } while (0); + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $2); + __ZNSt3__29__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE($34, $35, $33, $$037, $9, $10, $$byval_copy); + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$11 >> 2] = HEAP32[$1 >> 2]; + $41 = HEAP32[$9 >> 2] | 0; + $42 = HEAP32[$10 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$11 >> 2]; + $43 = __ZNSt3__216__pad_and_outputIwNS_11char_traitsIwEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $$037, $41, $42, $2, $3) | 0; + HEAP32[$1 >> 2] = $43; + if (!$$sroa$039$0) _free($44); + _free($$sroa$046$0); + STACKTOP = sp; + return $43 | 0; +} + +function __ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = +$4; + var $$0 = 0, $$037 = 0, $$1 = 0, $$2 = 0, $$byval_copy = 0, $$sroa$039$0 = 0, $$sroa$046$0 = 0, $10 = 0, $11 = 0, $12 = 0, $19 = 0, $20 = 0, $26 = 0, $31 = 0, $33 = 0, $34 = 0, $35 = 0, $38 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $vararg_buffer = 0, $vararg_buffer2 = 0, $vararg_buffer5 = 0, $vararg_buffer9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 352 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(352); + $$byval_copy = sp + 344 | 0; + $vararg_buffer9 = sp + 320 | 0; + $vararg_buffer5 = sp + 304 | 0; + $vararg_buffer2 = sp + 296 | 0; + $vararg_buffer = sp + 280 | 0; + $5 = sp + 272 | 0; + $6 = sp + 240 | 0; + $7 = sp + 340 | 0; + $8 = sp; + $9 = sp + 336 | 0; + $10 = sp + 332 | 0; + $11 = sp + 328 | 0; + $12 = $5; + HEAP32[$12 >> 2] = 37; + HEAP32[$12 + 4 >> 2] = 0; + $19 = __ZNSt3__214__num_put_base14__format_floatEPcPKcj($5 + 1 | 0, 67447, HEAP32[$2 + 4 >> 2] | 0) | 0; + HEAP32[$7 >> 2] = $6; + $20 = __ZNSt3__26__clocEv() | 0; + if ($19) { + HEAP32[$vararg_buffer >> 2] = HEAP32[$2 + 8 >> 2]; + HEAPF64[$vararg_buffer + 8 >> 3] = $4; + $$0 = __ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($6, 30, $20, $5, $vararg_buffer) | 0; + } else { + HEAPF64[$vararg_buffer2 >> 3] = $4; + $$0 = __ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($6, 30, $20, $5, $vararg_buffer2) | 0; + } + if (($$0 | 0) > 29) { + $26 = __ZNSt3__26__clocEv() | 0; + if ($19) { + HEAP32[$vararg_buffer5 >> 2] = HEAP32[$2 + 8 >> 2]; + HEAPF64[$vararg_buffer5 + 8 >> 3] = $4; + $$1 = __ZNSt3__219__libcpp_asprintf_lEPPcP15__locale_structPKcz($7, $26, $5, $vararg_buffer5) | 0; + } else { + HEAPF64[$vararg_buffer9 >> 3] = $4; + $$1 = __ZNSt3__219__libcpp_asprintf_lEPPcP15__locale_structPKcz($7, $26, $5, $vararg_buffer9) | 0; + } + $31 = HEAP32[$7 >> 2] | 0; + if (!$31) __ZSt17__throw_bad_allocv(); else { + $$2 = $$1; + $$sroa$046$0 = $31; + $34 = $31; + } + } else { + $$2 = $$0; + $$sroa$046$0 = 0; + $34 = HEAP32[$7 >> 2] | 0; + } + $33 = $34 + $$2 | 0; + $35 = __ZNSt3__214__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE($34, $33, $2) | 0; + do if (($34 | 0) != ($6 | 0)) { + $38 = _malloc($$2 << 3) | 0; + if (!$38) __ZSt17__throw_bad_allocv(); else { + $$037 = $38; + $$sroa$039$0 = 0; + $44 = $38; + break; + } + } else { + $$037 = $8; + $$sroa$039$0 = 1; + $44 = 0; + } while (0); + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $2); + __ZNSt3__29__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE($34, $35, $33, $$037, $9, $10, $$byval_copy); + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$11 >> 2] = HEAP32[$1 >> 2]; + $41 = HEAP32[$9 >> 2] | 0; + $42 = HEAP32[$10 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$11 >> 2]; + $43 = __ZNSt3__216__pad_and_outputIwNS_11char_traitsIwEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $$037, $41, $42, $2, $3) | 0; + HEAP32[$1 >> 2] = $43; + if (!$$sroa$039$0) _free($44); + _free($$sroa$046$0); + STACKTOP = sp; + return $43 | 0; +} + +function _setCamera($id, $cameraID) { + $id = $id | 0; + $cameraID = $cameraID | 0; + var $0 = 0, $2 = 0, $arhandle = 0, $call31 = 0, $call34 = 0, $call39 = 0, $call47 = 0, $call7 = 0, $cameraID$addr = 0, $height = 0, $id$addr = 0, $param = 0, $paramLT = 0, $retval$2 = 0, $vararg_buffer = 0, $vararg_buffer2 = 0, $vararg_buffer4 = 0, $vararg_buffer6 = 0, $width = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $vararg_buffer6 = sp + 24 | 0; + $vararg_buffer4 = sp + 16 | 0; + $vararg_buffer2 = sp + 8 | 0; + $vararg_buffer = sp; + $id$addr = sp + 32 | 0; + $cameraID$addr = sp + 28 | 0; + HEAP32[$id$addr >> 2] = $id; + HEAP32[$cameraID$addr >> 2] = $cameraID; + do if ((__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0) != 0 ? ($call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0, (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi7ARParamEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65280, $cameraID$addr) | 0) != 0) : 0) { + $param = $call7 + 8 | 0; + _memcpy($param | 0, __ZNSt3__213unordered_mapIi7ARParamNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65280, $cameraID$addr) | 0, 184) | 0; + $0 = HEAP32[$param >> 2] | 0; + $width = $call7 + 208 | 0; + $2 = HEAP32[$call7 + 12 >> 2] | 0; + $height = $call7 + 212 | 0; + if (($0 | 0) == (HEAP32[$width >> 2] | 0) ? ($2 | 0) == (HEAP32[$height >> 2] | 0) : 0) {} else { + HEAP32[$vararg_buffer >> 2] = $0; + HEAP32[$vararg_buffer + 4 >> 2] = $2; + _arLog(0, 2, 45770, $vararg_buffer); + _arParamChangeSize($param, HEAP32[$width >> 2] | 0, HEAP32[$height >> 2] | 0, $param) | 0; + } + _deleteHandle($call7); + $call31 = _arParamLTCreate($param, 15) | 0; + $paramLT = $call7 + 192 | 0; + HEAP32[$paramLT >> 2] = $call31; + if (!$call31) { + _arLog(0, 3, 45817, $vararg_buffer2); + $retval$2 = -1; + break; + } + $call34 = _arCreateHandle($call31) | 0; + $arhandle = $call7 + 216 | 0; + HEAP32[$arhandle >> 2] = $call34; + if (!$call34) { + _arLog(0, 3, 45855, $vararg_buffer4); + $retval$2 = -1; + break; + } + _arSetPixelFormat($call34, HEAP32[$call7 + 472 >> 2] | 0) | 0; + $call39 = _ar3DCreateHandle($param) | 0; + HEAP32[$call7 + 228 >> 2] = $call39; + if (!$call39) { + _arLog(0, 3, 45892, $vararg_buffer6); + $retval$2 = -1; + break; + } else { + _arPattAttach(HEAP32[$arhandle >> 2] | 0, HEAP32[$call7 + 220 >> 2] | 0) | 0; + _arglCameraFrustumRH(HEAP32[$paramLT >> 2] | 0, +HEAPF64[$call7 + 312 >> 3], +HEAPF64[$call7 + 320 >> 3], $call7 + 344 | 0); + $call47 = _createKpmHandle(HEAP32[$paramLT >> 2] | 0) | 0; + HEAP32[$call7 + 232 >> 2] = $call47; + $retval$2 = 0; + break; + } + } else $retval$2 = -1; while (0); + STACKTOP = sp; + return $retval$2 | 0; +} + +function _int_upsample($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$05061$us = 0, $$05061$us77 = 0, $$05157$us$us = 0, $$05157$us$us90 = 0, $$05256$us$us = 0, $$05256$us$us91 = 0, $$05354$us$us = 0, $$05354$us$us97 = 0, $$062 = 0, $$062$us = 0, $$062$us76 = 0, $$155$us$us = 0, $$155$us$us96 = 0, $10 = 0, $11 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $18 = 0, $19 = 0, $21 = 0, $25 = 0, $27 = 0, $28 = 0, $29 = 0, $32 = 0, $46 = 0, $47 = 0, $48 = 0, $5 = 0, $6 = 0, $62 = 0, $8 = 0, label = 0; + $5 = HEAP32[$0 + 476 >> 2] | 0; + $6 = HEAP32[$3 >> 2] | 0; + $8 = HEAP32[$1 + 4 >> 2] | 0; + $10 = HEAP8[$5 + 140 + $8 >> 0] | 0; + $11 = $10 & 255; + $13 = HEAP8[$5 + 150 + $8 >> 0] | 0; + $14 = $13 & 255; + $15 = $0 + 320 | 0; + $16 = HEAP32[$15 >> 2] | 0; + if (($16 | 0) <= 0) return; + $18 = $0 + 112 | 0; + $19 = $10 << 24 >> 24 != 0; + $21 = $14 + -1 | 0; + if (($13 & 255) > 1) { + $25 = ($10 << 24 >> 24 == 0 ? ~$11 : -2) + $11 + 2 | 0; + $$05061$us = 0; + $$062$us = 0; + while (1) { + $27 = HEAP32[$6 + ($$062$us << 2) >> 2] | 0; + $28 = HEAP32[$18 >> 2] | 0; + $29 = $27 + $28 | 0; + if (($28 | 0) > 0) { + if (!$19) break; + $$05157$us$us = HEAP32[$2 + ($$05061$us << 2) >> 2] | 0; + $$05256$us$us = $27; + while (1) { + _memset($$05256$us$us | 0, HEAP8[$$05157$us$us >> 0] | 0, $25 | 0) | 0; + $$05354$us$us = $11; + $$155$us$us = $$05256$us$us; + while (1) { + $$155$us$us = $$155$us$us + 1 | 0; + if (($$05354$us$us | 0) <= 1) break; else $$05354$us$us = $$05354$us$us + -1 | 0; + } + if ($$155$us$us >>> 0 < $29 >>> 0) { + $$05157$us$us = $$05157$us$us + 1 | 0; + $$05256$us$us = $$155$us$us; + } else break; + } + $32 = HEAP32[$18 >> 2] | 0; + } else $32 = $28; + _jcopy_sample_rows($6, $$062$us, $6, $$062$us + 1 | 0, $21, $32); + $$062$us = $$062$us + $14 | 0; + if (($$062$us | 0) >= (HEAP32[$15 >> 2] | 0)) { + label = 27; + break; + } else $$05061$us = $$05061$us + 1 | 0; + } + if ((label | 0) == 27) return; + while (1) {} + } + if (!$19) { + $62 = (HEAP32[$18 >> 2] | 0) > 0; + $$062 = 0; + while (1) { + if ($62) break; + $$062 = $$062 + $14 | 0; + if (($$062 | 0) >= ($16 | 0)) { + label = 27; + break; + } + } + if ((label | 0) == 27) return; + while (1) {} + } + $$05061$us77 = 0; + $$062$us76 = 0; + while (1) { + $46 = HEAP32[$6 + ($$062$us76 << 2) >> 2] | 0; + $47 = HEAP32[$18 >> 2] | 0; + $48 = $46 + $47 | 0; + if (($47 | 0) > 0) { + $$05157$us$us90 = HEAP32[$2 + ($$05061$us77 << 2) >> 2] | 0; + $$05256$us$us91 = $46; + while (1) { + _memset($$05256$us$us91 | 0, HEAP8[$$05157$us$us90 >> 0] | 0, $11 | 0) | 0; + $$05354$us$us97 = $11; + $$155$us$us96 = $$05256$us$us91; + while (1) { + $$155$us$us96 = $$155$us$us96 + 1 | 0; + if (($$05354$us$us97 | 0) <= 1) break; else $$05354$us$us97 = $$05354$us$us97 + -1 | 0; + } + if ($$155$us$us96 >>> 0 < $48 >>> 0) { + $$05157$us$us90 = $$05157$us$us90 + 1 | 0; + $$05256$us$us91 = $$155$us$us96; + } else break; + } + } + $$062$us76 = $$062$us76 + $14 | 0; + if (($$062$us76 | 0) >= (HEAP32[$15 >> 2] | 0)) break; else $$05061$us77 = $$05061$us77 + 1 | 0; + } + return; +} + +function _arParamIdeal2Observ($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $10 = 0.0, $100 = 0.0, $101 = 0, $104 = 0.0, $110 = 0.0, $12 = 0.0, $122 = 0.0, $128 = 0.0, $131 = 0.0, $132 = 0.0, $133 = 0, $136 = 0.0, $14 = 0.0, $147 = 0.0, $16 = 0.0, $18 = 0.0, $20 = 0.0, $22 = 0.0, $25 = 0.0, $28 = 0.0, $31 = 0.0, $36 = 0.0, $61 = 0.0, $64 = 0.0, $65 = 0.0, $66 = 0, $69 = 0.0, $77 = 0.0, $89 = 0.0, $96 = 0.0, $99 = 0.0, $storemerge$sink = 0.0, label = 0; + L1 : do switch ($5 | 0) { + case 4: + { + $10 = +HEAPF64[$0 + 16 >> 3]; + $12 = +HEAPF64[$0 + 24 >> 3]; + $14 = +HEAPF64[$0 + 32 >> 3]; + $16 = +HEAPF64[$0 + 40 >> 3]; + $18 = +HEAPF64[$0 + 48 >> 3]; + $20 = +HEAPF64[$0 + 56 >> 3]; + $22 = +HEAPF64[$0 + 64 >> 3]; + $25 = ($1 - $18) * $22 / $14; + $28 = ($2 - $20) * $22 / $16; + $31 = $25 * $25 + $28 * $28; + $36 = +HEAPF64[$0 >> 3] * $31 + 1.0 + $31 * (+HEAPF64[$0 + 8 >> 3] * $31); + HEAPF64[$3 >> 3] = $18 + $14 * ($12 * ($31 + $25 * ($25 * 2.0)) + ($28 * ($10 * 2.0 * $25) + $25 * $36)); + $storemerge$sink = $20 + $16 * ($28 * ($12 * 2.0 * $25) + ($10 * ($31 + $28 * ($28 * 2.0)) + $28 * $36)); + label = 12; + break; + } + case 3: + { + $61 = +HEAPF64[$0 >> 3]; + $64 = +HEAPF64[$0 + 16 >> 3]; + $65 = ($1 - $61) * $64; + $66 = $0 + 8 | 0; + $69 = $64 * ($2 - +HEAPF64[$66 >> 3]); + if ($65 == 0.0 & $69 == 0.0) { + HEAPF64[$3 >> 3] = $61; + $storemerge$sink = +HEAPF64[$66 >> 3]; + label = 12; + break L1; + } else { + $77 = $65 * $65 + $69 * $69; + $89 = 1.0 - $77 * (+HEAPF64[$0 + 32 >> 3] / 1.0e8) - $77 * ($77 * (+HEAPF64[$0 + 40 >> 3] / 1.0e8 / 1.0e5)); + HEAPF64[$3 >> 3] = $61 + +HEAPF64[$0 + 24 >> 3] * ($65 * $89); + $storemerge$sink = +HEAPF64[$66 >> 3] + $69 * $89; + label = 12; + break L1; + } + break; + } + case 2: + { + $96 = +HEAPF64[$0 >> 3]; + $99 = +HEAPF64[$0 + 16 >> 3]; + $100 = ($1 - $96) * $99; + $101 = $0 + 8 | 0; + $104 = $99 * ($2 - +HEAPF64[$101 >> 3]); + if ($100 == 0.0 & $104 == 0.0) { + HEAPF64[$3 >> 3] = $96; + $storemerge$sink = +HEAPF64[$101 >> 3]; + label = 12; + break L1; + } else { + $110 = $100 * $100 + $104 * $104; + $122 = 1.0 - $110 * (+HEAPF64[$0 + 24 >> 3] / 1.0e8) - $110 * ($110 * (+HEAPF64[$0 + 32 >> 3] / 1.0e8 / 1.0e5)); + HEAPF64[$3 >> 3] = $96 + $100 * $122; + $storemerge$sink = +HEAPF64[$101 >> 3] + $104 * $122; + label = 12; + break L1; + } + break; + } + case 1: + { + $128 = +HEAPF64[$0 >> 3]; + $131 = +HEAPF64[$0 + 16 >> 3]; + $132 = ($1 - $128) * $131; + $133 = $0 + 8 | 0; + $136 = $131 * ($2 - +HEAPF64[$133 >> 3]); + if ($132 == 0.0 & $136 == 0.0) { + HEAPF64[$3 >> 3] = $128; + $storemerge$sink = +HEAPF64[$133 >> 3]; + label = 12; + break L1; + } else { + $147 = 1.0 - ($132 * $132 + $136 * $136) * (+HEAPF64[$0 + 24 >> 3] / 1.0e8); + HEAPF64[$3 >> 3] = $128 + $132 * $147; + $storemerge$sink = +HEAPF64[$133 >> 3] + $136 * $147; + label = 12; + break L1; + } + break; + } + default: + $$0 = -1; + } while (0); + if ((label | 0) == 12) { + HEAPF64[$4 >> 3] = $storemerge$sink; + $$0 = 0; + } + return $$0 | 0; +} + +function __ZNSt3__29__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + $10 = $10 | 0; + $11 = $11 | 0; + var $$0$i$idx = 0, $$0$i$ptr = 0, $$0$lcssa$i = 0, $$2 = 0, $15 = 0, $18 = 0, $25 = 0, $30 = 0, $34 = 0, $43 = 0, $48 = 0, $50 = 0, $56 = 0, $59 = 0, $60 = 0, $69 = 0, $72 = 0, $81 = 0, $88 = 0, $93 = 0, $95 = 0; + L1 : do if ($0 << 24 >> 24 == $5 << 24 >> 24) if (HEAP8[$1 >> 0] | 0) { + HEAP8[$1 >> 0] = 0; + $15 = HEAP32[$4 >> 2] | 0; + HEAP32[$4 >> 2] = $15 + 1; + HEAP8[$15 >> 0] = 46; + $18 = HEAP8[$7 + 11 >> 0] | 0; + if ((($18 << 24 >> 24 < 0 ? HEAP32[$7 + 4 >> 2] | 0 : $18 & 255) | 0) != 0 ? ($25 = HEAP32[$9 >> 2] | 0, ($25 - $8 | 0) < 160) : 0) { + $30 = HEAP32[$10 >> 2] | 0; + HEAP32[$9 >> 2] = $25 + 4; + HEAP32[$25 >> 2] = $30; + $$2 = 0; + } else $$2 = 0; + } else $$2 = -1; else { + if ($0 << 24 >> 24 == $6 << 24 >> 24 ? ($34 = HEAP8[$7 + 11 >> 0] | 0, ($34 << 24 >> 24 < 0 ? HEAP32[$7 + 4 >> 2] | 0 : $34 & 255) | 0) : 0) { + if (!(HEAP8[$1 >> 0] | 0)) { + $$2 = -1; + break; + } + $43 = HEAP32[$9 >> 2] | 0; + if (($43 - $8 | 0) >= 160) { + $$2 = 0; + break; + } + $48 = HEAP32[$10 >> 2] | 0; + HEAP32[$9 >> 2] = $43 + 4; + HEAP32[$43 >> 2] = $48; + HEAP32[$10 >> 2] = 0; + $$2 = 0; + break; + } + $50 = $11 + 32 | 0; + $$0$i$idx = 0; + while (1) { + $$0$i$ptr = $11 + $$0$i$idx | 0; + if (($$0$i$idx | 0) == 32) { + $$0$lcssa$i = $50; + break; + } + if ((HEAP8[$$0$i$ptr >> 0] | 0) == $0 << 24 >> 24) { + $$0$lcssa$i = $$0$i$ptr; + break; + } else $$0$i$idx = $$0$i$idx + 1 | 0; + } + $56 = $$0$lcssa$i - $11 | 0; + if (($56 | 0) > 31) $$2 = -1; else { + $59 = HEAP8[12928 + $56 >> 0] | 0; + switch ($56 | 0) { + case 24: + case 25: + { + $60 = HEAP32[$4 >> 2] | 0; + if (($60 | 0) != ($3 | 0) ? (HEAP8[$60 + -1 >> 0] & 95) != (HEAP8[$2 >> 0] & 127) : 0) { + $$2 = -1; + break L1; + } + HEAP32[$4 >> 2] = $60 + 1; + HEAP8[$60 >> 0] = $59; + $$2 = 0; + break L1; + break; + } + case 23: + case 22: + { + HEAP8[$2 >> 0] = 80; + $69 = HEAP32[$4 >> 2] | 0; + HEAP32[$4 >> 2] = $69 + 1; + HEAP8[$69 >> 0] = $59; + $$2 = 0; + break L1; + break; + } + default: + { + $72 = $59 & 95; + if (((($72 | 0) == (HEAP8[$2 >> 0] | 0) ? (HEAP8[$2 >> 0] = $72 | 128, HEAP8[$1 >> 0] | 0) : 0) ? (HEAP8[$1 >> 0] = 0, $81 = HEAP8[$7 + 11 >> 0] | 0, ($81 << 24 >> 24 < 0 ? HEAP32[$7 + 4 >> 2] | 0 : $81 & 255) | 0) : 0) ? ($88 = HEAP32[$9 >> 2] | 0, ($88 - $8 | 0) < 160) : 0) { + $93 = HEAP32[$10 >> 2] | 0; + HEAP32[$9 >> 2] = $88 + 4; + HEAP32[$88 >> 2] = $93; + } + $95 = HEAP32[$4 >> 2] | 0; + HEAP32[$4 >> 2] = $95 + 1; + HEAP8[$95 >> 0] = $59; + if (($56 | 0) > 21) { + $$2 = 0; + break L1; + } + HEAP32[$10 >> 2] = (HEAP32[$10 >> 2] | 0) + 1; + $$2 = 0; + break L1; + } + } + } + } while (0); + return $$2 | 0; +} + +function _quantize_fs_dither($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0114131 = 0, $$0115130 = 0, $$0116138 = 0, $$0117134 = 0, $$0117134$us = 0, $$0118 = 0, $$0119 = 0, $$0120129 = 0, $$0121 = 0, $$0122 = 0, $$0124 = 0, $$0132 = 0, $$1123127 = 0, $$1125126 = 0, $$1128 = 0, $11 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $24 = 0, $25 = 0, $27 = 0, $31 = 0, $32 = 0, $44 = 0, $47 = 0, $48 = 0, $5 = 0, $60 = 0, $63 = 0, $7 = 0, $71 = 0, $9 = 0, $$1128$looptemp = 0; + $5 = HEAP32[$0 + 484 >> 2] | 0; + $7 = HEAP32[$0 + 120 >> 2] | 0; + $9 = HEAP32[$0 + 112 >> 2] | 0; + $11 = HEAP32[$0 + 336 >> 2] | 0; + if (($3 | 0) <= 0) return; + $13 = ($7 | 0) > 0; + $14 = $5 + 84 | 0; + $15 = $5 + 24 | 0; + $16 = $5 + 16 | 0; + $17 = ($9 | 0) == 0; + $18 = $9 + -1 | 0; + $19 = Math_imul($18, $7) | 0; + $20 = 0 - $7 | 0; + $21 = $9 + 1 | 0; + $$0116138 = 0; + do { + $22 = $2 + ($$0116138 << 2) | 0; + _memset(HEAP32[$22 >> 2] | 0, 0, $9 | 0) | 0; + L6 : do if ($13) { + $24 = $1 + ($$0116138 << 2) | 0; + if ($17) { + $25 = (HEAP32[$14 >> 2] | 0) == 0; + $$0117134$us = 0; + while (1) { + $27 = HEAP32[$5 + 68 + ($$0117134$us << 2) >> 2] | 0; + HEAP16[($25 ? $27 : $27 + ($21 << 1) | 0) >> 1] = 0; + $$0117134$us = $$0117134$us + 1 | 0; + if (($$0117134$us | 0) == ($7 | 0)) break L6; + } + } + $$0117134 = 0; + do { + $31 = (HEAP32[$24 >> 2] | 0) + $$0117134 | 0; + $32 = HEAP32[$22 >> 2] | 0; + if (!(HEAP32[$14 >> 2] | 0)) { + $$0118 = $7; + $$0119 = 1; + $$0121 = HEAP32[$5 + 68 + ($$0117134 << 2) >> 2] | 0; + $$0122 = $31; + $$0124 = $32; + } else { + $$0118 = $20; + $$0119 = -1; + $$0121 = (HEAP32[$5 + 68 + ($$0117134 << 2) >> 2] | 0) + ($21 << 1) | 0; + $$0122 = $31 + $19 | 0; + $$0124 = $32 + $18 | 0; + } + $44 = HEAP32[(HEAP32[$15 >> 2] | 0) + ($$0117134 << 2) >> 2] | 0; + $47 = HEAP32[(HEAP32[$16 >> 2] | 0) + ($$0117134 << 2) >> 2] | 0; + $48 = Math_imul($9, $$0119) | 0; + $$0114131 = 0; + $$0115130 = $9; + $$0120129 = 0; + $$0132 = 0; + $$1123127 = $$0122; + $$1125126 = $$0124; + $$1128 = $$0121; + while (1) { + $$1128$looptemp = $$1128; + $$1128 = $$1128 + ($$0119 << 1) | 0; + $60 = HEAPU8[$11 + (($$0132 + 8 + (HEAP16[$$1128 >> 1] | 0) >> 4) + (HEAPU8[$$1123127 >> 0] | 0)) >> 0] | 0; + $63 = HEAPU8[$44 + $60 >> 0] | 0; + HEAP8[$$1125126 >> 0] = (HEAPU8[$$1125126 >> 0] | 0) + $63; + $71 = $60 - (HEAPU8[$47 + $63 >> 0] | 0) | 0; + HEAP16[$$1128$looptemp >> 1] = ($71 * 3 | 0) + $$0120129; + $$0120129 = ($71 * 5 | 0) + $$0114131 | 0; + $$0115130 = $$0115130 + -1 | 0; + if (!$$0115130) break; else { + $$0114131 = $71; + $$0132 = $71 * 7 | 0; + $$1123127 = $$1123127 + $$0118 | 0; + $$1125126 = $$1125126 + $$0119 | 0; + } + } + HEAP16[$$0121 + ($48 << 1) >> 1] = $$0120129; + $$0117134 = $$0117134 + 1 | 0; + } while (($$0117134 | 0) != ($7 | 0)); + } while (0); + HEAP32[$14 >> 2] = (HEAP32[$14 >> 2] | 0) == 0 & 1; + $$0116138 = $$0116138 + 1 | 0; + } while (($$0116138 | 0) != ($3 | 0)); + return; +} + +function __ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = +$4; + var $$0 = 0, $$037 = 0, $$1 = 0, $$2 = 0, $$byval_copy = 0, $$sroa$041$0 = 0, $$sroa$048$0 = 0, $10 = 0, $11 = 0, $12 = 0, $19 = 0, $20 = 0, $26 = 0, $31 = 0, $33 = 0, $34 = 0, $35 = 0, $38 = 0, $41 = 0, $42 = 0, $43 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $vararg_buffer = 0, $vararg_buffer2 = 0, $vararg_buffer5 = 0, $vararg_buffer9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 176 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(176); + $$byval_copy = sp + 168 | 0; + $vararg_buffer9 = sp + 144 | 0; + $vararg_buffer5 = sp + 128 | 0; + $vararg_buffer2 = sp + 120 | 0; + $vararg_buffer = sp + 104 | 0; + $5 = sp + 96 | 0; + $6 = sp + 64 | 0; + $7 = sp + 164 | 0; + $8 = sp; + $9 = sp + 160 | 0; + $10 = sp + 156 | 0; + $11 = sp + 152 | 0; + $12 = $5; + HEAP32[$12 >> 2] = 37; + HEAP32[$12 + 4 >> 2] = 0; + $19 = __ZNSt3__214__num_put_base14__format_floatEPcPKcj($5 + 1 | 0, 59184, HEAP32[$2 + 4 >> 2] | 0) | 0; + HEAP32[$7 >> 2] = $6; + $20 = __ZNSt3__26__clocEv() | 0; + if ($19) { + HEAP32[$vararg_buffer >> 2] = HEAP32[$2 + 8 >> 2]; + HEAPF64[$vararg_buffer + 8 >> 3] = $4; + $$0 = __ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($6, 30, $20, $5, $vararg_buffer) | 0; + } else { + HEAPF64[$vararg_buffer2 >> 3] = $4; + $$0 = __ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($6, 30, $20, $5, $vararg_buffer2) | 0; + } + if (($$0 | 0) > 29) { + $26 = __ZNSt3__26__clocEv() | 0; + if ($19) { + HEAP32[$vararg_buffer5 >> 2] = HEAP32[$2 + 8 >> 2]; + HEAPF64[$vararg_buffer5 + 8 >> 3] = $4; + $$1 = __ZNSt3__219__libcpp_asprintf_lEPPcP15__locale_structPKcz($7, $26, $5, $vararg_buffer5) | 0; + } else { + HEAPF64[$vararg_buffer9 >> 3] = $4; + $$1 = __ZNSt3__219__libcpp_asprintf_lEPPcP15__locale_structPKcz($7, $26, $5, $vararg_buffer9) | 0; + } + $31 = HEAP32[$7 >> 2] | 0; + if (!$31) __ZSt17__throw_bad_allocv(); else { + $$2 = $$1; + $$sroa$048$0 = $31; + $34 = $31; + } + } else { + $$2 = $$0; + $$sroa$048$0 = 0; + $34 = HEAP32[$7 >> 2] | 0; + } + $33 = $34 + $$2 | 0; + $35 = __ZNSt3__214__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE($34, $33, $2) | 0; + if (($34 | 0) != ($6 | 0)) { + $38 = _malloc($$2 << 1) | 0; + if (!$38) __ZSt17__throw_bad_allocv(); else { + $$037 = $38; + $$sroa$041$0 = $38; + } + } else { + $$037 = $8; + $$sroa$041$0 = 0; + } + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $2); + __ZNSt3__29__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE($34, $35, $33, $$037, $9, $10, $$byval_copy); + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$11 >> 2] = HEAP32[$1 >> 2]; + $41 = HEAP32[$9 >> 2] | 0; + $42 = HEAP32[$10 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$11 >> 2]; + $43 = __ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $$037, $41, $42, $2, $3) | 0; + _free($$sroa$041$0); + _free($$sroa$048$0); + STACKTOP = sp; + return $43 | 0; +} + +function __ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = +$4; + var $$0 = 0, $$037 = 0, $$1 = 0, $$2 = 0, $$byval_copy = 0, $$sroa$041$0 = 0, $$sroa$048$0 = 0, $10 = 0, $11 = 0, $12 = 0, $19 = 0, $20 = 0, $26 = 0, $31 = 0, $33 = 0, $34 = 0, $35 = 0, $38 = 0, $41 = 0, $42 = 0, $43 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $vararg_buffer = 0, $vararg_buffer2 = 0, $vararg_buffer5 = 0, $vararg_buffer9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 176 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(176); + $$byval_copy = sp + 168 | 0; + $vararg_buffer9 = sp + 144 | 0; + $vararg_buffer5 = sp + 128 | 0; + $vararg_buffer2 = sp + 120 | 0; + $vararg_buffer = sp + 104 | 0; + $5 = sp + 96 | 0; + $6 = sp + 64 | 0; + $7 = sp + 164 | 0; + $8 = sp; + $9 = sp + 160 | 0; + $10 = sp + 156 | 0; + $11 = sp + 152 | 0; + $12 = $5; + HEAP32[$12 >> 2] = 37; + HEAP32[$12 + 4 >> 2] = 0; + $19 = __ZNSt3__214__num_put_base14__format_floatEPcPKcj($5 + 1 | 0, 67447, HEAP32[$2 + 4 >> 2] | 0) | 0; + HEAP32[$7 >> 2] = $6; + $20 = __ZNSt3__26__clocEv() | 0; + if ($19) { + HEAP32[$vararg_buffer >> 2] = HEAP32[$2 + 8 >> 2]; + HEAPF64[$vararg_buffer + 8 >> 3] = $4; + $$0 = __ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($6, 30, $20, $5, $vararg_buffer) | 0; + } else { + HEAPF64[$vararg_buffer2 >> 3] = $4; + $$0 = __ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($6, 30, $20, $5, $vararg_buffer2) | 0; + } + if (($$0 | 0) > 29) { + $26 = __ZNSt3__26__clocEv() | 0; + if ($19) { + HEAP32[$vararg_buffer5 >> 2] = HEAP32[$2 + 8 >> 2]; + HEAPF64[$vararg_buffer5 + 8 >> 3] = $4; + $$1 = __ZNSt3__219__libcpp_asprintf_lEPPcP15__locale_structPKcz($7, $26, $5, $vararg_buffer5) | 0; + } else { + HEAPF64[$vararg_buffer9 >> 3] = $4; + $$1 = __ZNSt3__219__libcpp_asprintf_lEPPcP15__locale_structPKcz($7, $26, $5, $vararg_buffer9) | 0; + } + $31 = HEAP32[$7 >> 2] | 0; + if (!$31) __ZSt17__throw_bad_allocv(); else { + $$2 = $$1; + $$sroa$048$0 = $31; + $34 = $31; + } + } else { + $$2 = $$0; + $$sroa$048$0 = 0; + $34 = HEAP32[$7 >> 2] | 0; + } + $33 = $34 + $$2 | 0; + $35 = __ZNSt3__214__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE($34, $33, $2) | 0; + if (($34 | 0) != ($6 | 0)) { + $38 = _malloc($$2 << 1) | 0; + if (!$38) __ZSt17__throw_bad_allocv(); else { + $$037 = $38; + $$sroa$041$0 = $38; + } + } else { + $$037 = $8; + $$sroa$041$0 = 0; + } + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $2); + __ZNSt3__29__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE($34, $35, $33, $$037, $9, $10, $$byval_copy); + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$11 >> 2] = HEAP32[$1 >> 2]; + $41 = HEAP32[$9 >> 2] | 0; + $42 = HEAP32[$10 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$11 >> 2]; + $43 = __ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $$037, $41, $42, $2, $3) | 0; + _free($$sroa$041$0); + _free($$sroa$048$0); + STACKTOP = sp; + return $43 | 0; +} + +function _start_pass_2_quant($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $14 = 0, $18 = 0, $20 = 0, $26 = 0, $3 = 0, $36 = 0, $37 = 0, $38 = 0, $44 = 0, $45 = 0, $5 = 0, $50 = 0, $6 = 0; + $3 = HEAP32[$0 + 484 >> 2] | 0; + $5 = HEAP32[$3 + 24 >> 2] | 0; + $6 = $0 + 88 | 0; + if (!(HEAP32[$6 >> 2] | 0)) $14 = 0; else { + HEAP32[$6 >> 2] = 2; + $14 = 2; + } + if (!$1) { + HEAP32[$3 + 4 >> 2] = ($14 | 0) == 2 ? 20 : 21; + HEAP32[$3 + 8 >> 2] = 200; + $18 = HEAP32[$0 + 132 >> 2] | 0; + if (($18 | 0) >= 1) { + if (($18 | 0) > 256) { + $26 = HEAP32[$0 >> 2] | 0; + HEAP32[$26 + 20 >> 2] = 59; + HEAP32[$26 + 24 >> 2] = 256; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + } else { + $20 = HEAP32[$0 >> 2] | 0; + HEAP32[$20 + 20 >> 2] = 58; + HEAP32[$20 + 24 >> 2] = 1; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + if ((HEAP32[$6 >> 2] | 0) == 2) { + $36 = ((HEAP32[$0 + 112 >> 2] | 0) * 6 | 0) + 12 | 0; + $37 = $3 + 32 | 0; + $38 = HEAP32[$37 >> 2] | 0; + if (!$38) { + $44 = FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$0 + 4 >> 2] | 0) + 4 >> 2] & 63]($0, 1, $36) | 0; + HEAP32[$37 >> 2] = $44; + $45 = $44; + } else $45 = $38; + _memset($45 | 0, 0, $36 | 0) | 0; + if (!(HEAP32[$3 + 40 >> 2] | 0)) _init_error_limit($0); + HEAP32[$3 + 36 >> 2] = 0; + } + } else { + HEAP32[$3 + 4 >> 2] = 19; + HEAP32[$3 + 8 >> 2] = 199; + HEAP32[$3 + 28 >> 2] = 1; + } + $50 = $3 + 28 | 0; + if (!(HEAP32[$50 >> 2] | 0)) return; + _memset(HEAP32[$5 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 4 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 8 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 12 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 16 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 20 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 24 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 28 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 32 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 36 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 40 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 44 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 48 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 52 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 56 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 60 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 64 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 68 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 72 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 76 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 80 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 84 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 88 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 92 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 96 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 100 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 104 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 108 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 112 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 116 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 120 >> 2] | 0, 0, 4096) | 0; + _memset(HEAP32[$5 + 124 >> 2] | 0, 0, 4096) | 0; + HEAP32[$50 >> 2] = 0; + return; +} + +function _ar2GetResolution2($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0.0, $$0153 = 0.0, $$0154 = 0.0, $$0155 = 0.0, $$0156 = 0.0, $$0157 = 0.0, $$sink = 0.0, $10 = 0.0, $108 = 0.0, $11 = 0.0, $111 = 0.0, $120 = 0.0, $123 = 0.0, $125 = 0.0, $127 = 0.0, $128 = 0.0, $13 = 0.0, $130 = 0.0, $132 = 0.0, $133 = 0, $135 = 0.0, $14 = 0.0, $17 = 0.0, $20 = 0.0, $21 = 0.0, $23 = 0.0, $24 = 0.0, $27 = 0.0, $30 = 0.0, $31 = 0.0, $33 = 0.0, $34 = 0.0, $37 = 0.0, $38 = 0.0, $4 = 0, $41 = 0.0, $50 = 0.0, $53 = 0.0, $62 = 0.0, $65 = 0.0, $67 = 0.0, $68 = 0.0, $69 = 0.0, $7 = 0.0, $71 = 0.0, $72 = 0.0, $75 = 0.0, $78 = 0.0, $79 = 0.0, $81 = 0.0, $82 = 0.0, $85 = 0.0, $88 = 0.0, $89 = 0.0, $9 = 0.0, $91 = 0.0, $92 = 0.0, $95 = 0.0, $96 = 0.0, $99 = 0.0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $4 = sp; + if (!$0) { + $65 = +HEAPF32[$2 >> 2]; + $67 = +HEAPF32[$2 + 4 >> 2]; + $68 = +HEAPF32[$1 >> 2]; + $69 = $65 * $68; + $71 = +HEAPF32[$1 + 4 >> 2]; + $72 = $67 * $71; + $75 = +HEAPF32[$1 + 12 >> 2]; + $78 = +HEAPF32[$1 + 16 >> 2]; + $79 = $65 * $78; + $81 = +HEAPF32[$1 + 20 >> 2]; + $82 = $67 * $81; + $85 = +HEAPF32[$1 + 28 >> 2]; + $88 = +HEAPF32[$1 + 32 >> 2]; + $89 = $65 * $88; + $91 = +HEAPF32[$1 + 36 >> 2]; + $92 = $67 * $91; + $95 = +HEAPF32[$1 + 44 >> 2]; + $96 = $95 + ($89 + $92); + $99 = $65 + 10.0; + $108 = $95 + ($99 * $88 + $92); + $111 = $67 + 10.0; + $120 = $95 + ($89 + $111 * $91); + $$0 = ($85 + ($79 + $111 * $81)) / $120; + $$0153 = ($75 + ($69 + $111 * $71)) / $120; + $$0154 = ($85 + ($99 * $78 + $82)) / $108; + $$0155 = ($75 + ($99 * $68 + $72)) / $108; + $$0156 = ($85 + ($79 + $82)) / $96; + $$0157 = ($75 + ($69 + $72)) / $96; + } else { + _arUtilMatMuldff($0 + 8 | 0, $1, $4) | 0; + $7 = +HEAPF32[$2 >> 2]; + $9 = +HEAPF32[$2 + 4 >> 2]; + $10 = +HEAPF32[$4 >> 2]; + $11 = $7 * $10; + $13 = +HEAPF32[$4 + 4 >> 2]; + $14 = $9 * $13; + $17 = +HEAPF32[$4 + 12 >> 2]; + $20 = +HEAPF32[$4 + 16 >> 2]; + $21 = $7 * $20; + $23 = +HEAPF32[$4 + 20 >> 2]; + $24 = $9 * $23; + $27 = +HEAPF32[$4 + 28 >> 2]; + $30 = +HEAPF32[$4 + 32 >> 2]; + $31 = $7 * $30; + $33 = +HEAPF32[$4 + 36 >> 2]; + $34 = $9 * $33; + $37 = +HEAPF32[$4 + 44 >> 2]; + $38 = $37 + ($31 + $34); + $41 = $7 + 10.0; + $50 = $37 + ($41 * $30 + $34); + $53 = $9 + 10.0; + $62 = $37 + ($31 + $53 * $33); + $$0 = ($27 + ($21 + $53 * $23)) / $62; + $$0153 = ($17 + ($11 + $53 * $13)) / $62; + $$0154 = ($27 + ($41 * $20 + $24)) / $50; + $$0155 = ($17 + ($41 * $10 + $14)) / $50; + $$0156 = ($27 + ($21 + $24)) / $38; + $$0157 = ($17 + ($11 + $14)) / $38; + } + $123 = $$0155 - $$0157; + $125 = $$0154 - $$0156; + $127 = $123 * $123 + $125 * $125; + $128 = $$0153 - $$0157; + $130 = $$0 - $$0156; + $132 = $128 * $128 + $130 * $130; + $133 = $127 < $132; + $135 = +Math_sqrt(+($133 ? $132 : $127)) * 2.5399999618530273; + HEAPF32[$3 >> 2] = $135; + $$sink = +Math_sqrt(+($133 ? $127 : $132)) * 2.5399999618530273; + HEAPF32[$3 + 4 >> 2] = $$sink; + STACKTOP = sp; + return 0; +} + +function _check_square($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = +$2; + var $$0 = 0, $$092 = 0, $$093 = 0, $$094 = 0, $$sroa$12$0 = 0, $$sroa$4$0 = 0, $$sroa$8$0 = 0, $10 = 0, $11 = 0, $13 = 0, $17 = 0, $18 = 0, $21 = 0, $23 = 0, $24 = 0, $29 = 0.0, $3 = 0, $36 = 0, $38 = 0, $4 = 0, $44 = 0, $5 = 0, $6 = 0, $60 = 0, $7 = 0, $8 = 0, $9 = 0, $spec$select = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 96 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(96); + $3 = sp + 48 | 0; + $4 = sp + 92 | 0; + $5 = sp; + $6 = sp + 88 | 0; + $7 = $1 + 28 | 0; + $8 = HEAP32[$7 >> 2] | 0; + $9 = $1 + 40028 | 0; + $10 = HEAP32[$9 >> 2] | 0; + $11 = $1 + 24 | 0; + $13 = (HEAP32[$11 >> 2] | 0) + -1 | 0; + $$0 = 1; + $$093 = 0; + $$094 = 0; + while (1) { + if (($$0 | 0) >= ($13 | 0)) break; + $17 = (HEAP32[$1 + 28 + ($$0 << 2) >> 2] | 0) - $8 | 0; + $18 = Math_imul($17, $17) | 0; + $21 = (HEAP32[$1 + 40028 + ($$0 << 2) >> 2] | 0) - $10 | 0; + $23 = (Math_imul($21, $21) | 0) + $18 | 0; + $24 = ($23 | 0) > ($$093 | 0); + $spec$select = $24 ? $$0 : $$094; + $$0 = $$0 + 1 | 0; + $$093 = $24 ? $23 : $$093; + $$094 = $spec$select; + } + $29 = +($0 | 0) / .75 * .01 * $2; + HEAP32[$4 >> 2] = 0; + HEAP32[$6 >> 2] = 0; + L5 : do if ((_get_vertex($7, $9, 0, $$094, $29, $3, $4) | 0) >= 0 ? (_get_vertex($7, $9, $$094, (HEAP32[$11 >> 2] | 0) + -1 | 0, $29, $5, $6) | 0) >= 0 : 0) { + $36 = HEAP32[$4 >> 2] | 0; + $38 = HEAP32[$6 >> 2] | 0; + do if (($36 | 0) == 1 & ($38 | 0) == 1) { + $$sroa$12$0 = HEAP32[$5 >> 2] | 0; + $$sroa$4$0 = HEAP32[$3 >> 2] | 0; + $$sroa$8$0 = $$094; + } else { + if (($36 | 0) > 1 & ($38 | 0) == 0) { + $44 = ($$094 | 0) / 2 | 0; + HEAP32[$6 >> 2] = 0; + HEAP32[$4 >> 2] = 0; + if ((_get_vertex($7, $9, 0, $44, $29, $3, $4) | 0) < 0) { + $$092 = -1; + break L5; + } + if ((_get_vertex($7, $9, $44, $$094, $29, $5, $6) | 0) < 0) { + $$092 = -1; + break L5; + } + if (!((HEAP32[$4 >> 2] | 0) == 1 & (HEAP32[$6 >> 2] | 0) == 1)) { + $$092 = -1; + break L5; + } + $$sroa$12$0 = $$094; + $$sroa$4$0 = HEAP32[$3 >> 2] | 0; + $$sroa$8$0 = HEAP32[$5 >> 2] | 0; + break; + } + if (!(($36 | 0) == 0 & ($38 | 0) > 1)) { + $$092 = -1; + break L5; + } + $60 = ($$094 + -1 + (HEAP32[$11 >> 2] | 0) | 0) / 2 | 0; + HEAP32[$6 >> 2] = 0; + HEAP32[$4 >> 2] = 0; + if ((_get_vertex($7, $9, $$094, $60, $29, $3, $4) | 0) < 0) { + $$092 = -1; + break L5; + } + if ((_get_vertex($7, $9, $60, (HEAP32[$11 >> 2] | 0) + -1 | 0, $29, $5, $6) | 0) < 0) { + $$092 = -1; + break L5; + } + if (!((HEAP32[$4 >> 2] | 0) == 1 & (HEAP32[$6 >> 2] | 0) == 1)) { + $$092 = -1; + break L5; + } + $$sroa$12$0 = HEAP32[$5 >> 2] | 0; + $$sroa$4$0 = $$094; + $$sroa$8$0 = HEAP32[$3 >> 2] | 0; + } while (0); + HEAP32[$1 + 80028 >> 2] = 0; + HEAP32[$1 + 80032 >> 2] = $$sroa$4$0; + HEAP32[$1 + 80036 >> 2] = $$sroa$8$0; + HEAP32[$1 + 80040 >> 2] = $$sroa$12$0; + HEAP32[$1 + 80044 >> 2] = (HEAP32[$11 >> 2] | 0) + -1; + $$092 = 0; + } else $$092 = -1; while (0); + STACKTOP = sp; + return $$092 | 0; +} + +function _wcsrtombs($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$05674 = 0, $$057$lcssa = 0, $$05784 = 0, $$05873 = 0, $$1 = 0, $$159 = 0, $$260$lcssa = 0, $$26083 = 0, $$278 = 0, $$3 = 0, $$361 = 0, $$477 = 0, $$5 = 0, $$pn = 0, $10 = 0, $11 = 0, $17 = 0, $18 = 0, $23 = 0, $31 = 0, $34 = 0, $35 = 0, $4 = 0, $40 = 0, $51 = 0, $6 = 0, $7 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp; + L1 : do if (!$0) { + $6 = HEAP32[$1 >> 2] | 0; + $7 = HEAP32[$6 >> 2] | 0; + if (!$7) $$0 = 0; else { + $$05674 = $6; + $$05873 = 0; + $10 = $7; + while (1) { + if ($10 >>> 0 > 127) { + $11 = _wcrtomb($4, $10, 0) | 0; + if (($11 | 0) == -1) { + $$0 = -1; + break L1; + } else $$pn = $11; + } else $$pn = 1; + $$159 = $$pn + $$05873 | 0; + $$05674 = $$05674 + 4 | 0; + $10 = HEAP32[$$05674 >> 2] | 0; + if (!$10) { + $$0 = $$159; + break; + } else $$05873 = $$159; + } + } + } else { + L10 : do if ($2 >>> 0 > 3) { + $$05784 = $0; + $$26083 = $2; + $18 = HEAP32[$1 >> 2] | 0; + while (1) { + $17 = HEAP32[$18 >> 2] | 0; + if (($17 + -1 | 0) >>> 0 > 126) { + if (!$17) break; + $23 = _wcrtomb($$05784, $17, 0) | 0; + if (($23 | 0) == -1) { + $$0 = -1; + break L1; + } + $$1 = $$05784 + $23 | 0; + $$361 = $$26083 - $23 | 0; + $31 = $18; + } else { + HEAP8[$$05784 >> 0] = $17; + $$1 = $$05784 + 1 | 0; + $$361 = $$26083 + -1 | 0; + $31 = HEAP32[$1 >> 2] | 0; + } + $18 = $31 + 4 | 0; + HEAP32[$1 >> 2] = $18; + if ($$361 >>> 0 <= 3) { + $$057$lcssa = $$1; + $$260$lcssa = $$361; + break L10; + } else { + $$05784 = $$1; + $$26083 = $$361; + } + } + HEAP8[$$05784 >> 0] = 0; + HEAP32[$1 >> 2] = 0; + $$0 = $2 - $$26083 | 0; + break L1; + } else { + $$057$lcssa = $0; + $$260$lcssa = $2; + } while (0); + if ($$260$lcssa) { + $$278 = $$057$lcssa; + $$477 = $$260$lcssa; + $35 = HEAP32[$1 >> 2] | 0; + while (1) { + $34 = HEAP32[$35 >> 2] | 0; + if (($34 + -1 | 0) >>> 0 > 126) { + if (!$34) { + label = 20; + break; + } + $40 = _wcrtomb($4, $34, 0) | 0; + if (($40 | 0) == -1) { + $$0 = -1; + break L1; + } + if ($$477 >>> 0 < $40 >>> 0) { + label = 23; + break; + } + _wcrtomb($$278, HEAP32[$35 >> 2] | 0, 0) | 0; + $$3 = $$278 + $40 | 0; + $$5 = $$477 - $40 | 0; + $51 = $35; + } else { + HEAP8[$$278 >> 0] = $34; + $$3 = $$278 + 1 | 0; + $$5 = $$477 + -1 | 0; + $51 = HEAP32[$1 >> 2] | 0; + } + $35 = $51 + 4 | 0; + HEAP32[$1 >> 2] = $35; + if (!$$5) { + $$0 = $2; + break L1; + } else { + $$278 = $$3; + $$477 = $$5; + } + } + if ((label | 0) == 20) { + HEAP8[$$278 >> 0] = 0; + HEAP32[$1 >> 2] = 0; + $$0 = $2 - $$477 | 0; + break; + } else if ((label | 0) == 23) { + $$0 = $2 - $$477 | 0; + break; + } + } else $$0 = $2; + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function _arGetLine($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0108 = 0, $$0109 = 0, $$0110 = 0, $$1 = 0, $10 = 0, $11 = 0, $13 = 0, $15 = 0, $17 = 0, $22 = 0.0, $25 = 0, $29 = 0, $31 = 0, $33 = 0, $44 = 0, $45 = 0, $54 = 0, $56 = 0.0, $59 = 0.0, $61 = 0, $7 = 0, $72 = 0, $73 = 0, $76 = 0.0, $78 = 0, $8 = 0, $81 = 0.0, $83 = 0.0, $86 = 0, $89 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $7 = sp + 4 | 0; + $8 = sp; + $9 = _arVecAlloc(2) | 0; + $10 = _arVecAlloc(2) | 0; + $11 = _arMatrixAlloc(2, 2) | 0; + $$0109 = 0; + L1 : while (1) { + if ($$0109 >>> 0 >= 4) { + label = 10; + break; + } + $13 = $$0109 + 1 | 0; + $15 = HEAP32[$3 + ($13 << 2) >> 2] | 0; + $17 = HEAP32[$3 + ($$0109 << 2) >> 2] | 0; + $22 = +($15 + 1 - $17 | 0) * .05 + .5; + $25 = ~~($22 + +($17 | 0)); + $29 = ~~(+($15 | 0) - $22) - $25 | 0; + $31 = _arMatrixAlloc($29 + 1 | 0, 2) | 0; + $$0108 = 0; + while (1) { + if (($$0108 | 0) > ($29 | 0)) break; + $33 = $$0108 + $25 | 0; + if ((_arParamObserv2IdealLTf($4, +(HEAP32[$0 + ($33 << 2) >> 2] | 0), +(HEAP32[$1 + ($33 << 2) >> 2] | 0), $7, $8) | 0) < 0) { + label = 6; + break L1; + } + $44 = HEAP32[$31 >> 2] | 0; + $45 = $$0108 << 1; + HEAPF64[$44 + ($45 << 3) >> 3] = +HEAPF32[$7 >> 2]; + HEAPF64[$44 + (($45 | 1) << 3) >> 3] = +HEAPF32[$8 >> 2]; + $$0108 = $$0108 + 1 | 0; + } + if ((_arMatrixPCA($31, $11, $9, $10) | 0) < 0) { + label = 14; + break; + } + $54 = HEAP32[$11 >> 2] | 0; + $56 = +HEAPF64[$54 + 8 >> 3]; + HEAPF64[$5 + ($$0109 * 24 | 0) >> 3] = $56; + $59 = -+HEAPF64[$54 >> 3]; + HEAPF64[$5 + ($$0109 * 24 | 0) + 8 >> 3] = $59; + $61 = HEAP32[$10 >> 2] | 0; + HEAPF64[$5 + ($$0109 * 24 | 0) + 16 >> 3] = -($56 * +HEAPF64[$61 >> 3] + +HEAPF64[$61 + 8 >> 3] * $59); + _arMatrixFree($31) | 0; + $$0109 = $13; + } + L10 : do if ((label | 0) == 6) label = 14; else if ((label | 0) == 10) { + _arMatrixFree($11) | 0; + _arVecFree($10) | 0; + _arVecFree($9) | 0; + $$1 = 0; + while (1) { + if ($$1 >>> 0 >= 4) { + $$0110 = 0; + break L10; + } + $72 = $$1 + 3 & 3; + $73 = $5 + ($72 * 24 | 0) | 0; + $76 = +HEAPF64[$5 + ($$1 * 24 | 0) + 8 >> 3]; + $78 = $5 + ($$1 * 24 | 0) | 0; + $81 = +HEAPF64[$5 + ($72 * 24 | 0) + 8 >> 3]; + $83 = +HEAPF64[$73 >> 3] * $76 - +HEAPF64[$78 >> 3] * $81; + if (+Math_abs(+$83) < .0001) { + $$0110 = -1; + break L10; + } + $86 = $5 + ($$1 * 24 | 0) + 16 | 0; + $89 = $5 + ($72 * 24 | 0) + 16 | 0; + HEAPF64[$6 + ($$1 << 4) >> 3] = ($81 * +HEAPF64[$86 >> 3] - $76 * +HEAPF64[$89 >> 3]) / $83; + HEAPF64[$6 + ($$1 << 4) + 8 >> 3] = (+HEAPF64[$78 >> 3] * +HEAPF64[$89 >> 3] - +HEAPF64[$73 >> 3] * +HEAPF64[$86 >> 3]) / $83; + $$1 = $$1 + 1 | 0; + } + } while (0); + if ((label | 0) == 14) { + _arMatrixFree($31) | 0; + _arMatrixFree($11) | 0; + _arVecFree($10) | 0; + _arVecFree($9) | 0; + $$0110 = -1; + } + STACKTOP = sp; + return $$0110 | 0; +} + +function _arGetMarkerInfo($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + $10 = +$10; + $11 = $11 | 0; + $12 = $12 | 0; + $13 = $13 | 0; + var $$0 = 0, $$0113 = 0, $$1 = 0, $$sink = 0, $$sink118 = 0, $$sink119$in = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $42 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $50 = 0, $53 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $14 = sp + 4 | 0; + $15 = sp; + $16 = $8 >>> 0 < 2; + $17 = ($8 | 0) == 2; + $$0 = 0; + $$0113 = 0; + while (1) { + if (($$0 | 0) >= ($5 | 0)) break; + HEAP32[$11 + ($$0113 << 8) >> 2] = HEAP32[$4 + ($$0 * 80048 | 0) >> 2]; + if ((_arParamObserv2IdealLTf($9, +HEAPF64[$4 + ($$0 * 80048 | 0) + 8 >> 3], +HEAPF64[$4 + ($$0 * 80048 | 0) + 16 >> 3], $14, $15) | 0) >= 0 ? (HEAPF64[$11 + ($$0113 << 8) + 56 >> 3] = +HEAPF32[$14 >> 2], HEAPF64[$11 + ($$0113 << 8) + 64 >> 3] = +HEAPF32[$15 >> 2], $42 = $11 + ($$0113 << 8) + 168 | 0, (_arGetLine($4 + ($$0 * 80048 | 0) + 28 | 0, $4 + ($$0 * 80048 | 0) + 40028 | 0, HEAP32[$4 + ($$0 * 80048 | 0) + 24 >> 2] | 0, $4 + ($$0 * 80048 | 0) + 80028 | 0, $9, $11 + ($$0113 << 8) + 72 | 0, $42) | 0) >= 0) : 0) { + $45 = $11 + ($$0113 << 8) + 8 | 0; + $46 = $11 + ($$0113 << 8) + 20 | 0; + $47 = $11 + ($$0113 << 8) + 40 | 0; + $48 = $11 + ($$0113 << 8) + 12 | 0; + $49 = $11 + ($$0113 << 8) + 24 | 0; + $50 = $11 + ($$0113 << 8) + 48 | 0; + $53 = _arPattGetIDGlobal($6, $7, $8, $0, $1, $2, $3, $9, $42, $10, $45, $46, $47, $48, $49, $50, $13, $11 + ($$0113 << 8) + 240 | 0, $11 + ($$0113 << 8) + 248 | 0) | 0; + switch ($53 | 0) { + case 0: + { + $$sink = $53; + label = 12; + break; + } + case -1: + { + $$sink = 2; + label = 12; + break; + } + case -2: + { + $$sink = 3; + label = 12; + break; + } + case -3: + { + $$sink = 4; + label = 12; + break; + } + case -4: + { + $$sink = 5; + label = 12; + break; + } + case -5: + { + $$sink = 9; + label = 12; + break; + } + case -6: + { + $$sink = 1; + label = 12; + break; + } + default: + {} + } + if ((label | 0) == 12) { + label = 0; + HEAP32[$11 + ($$0113 << 8) + 236 >> 2] = $$sink; + } + if (!$16) { + if ($17) { + HEAP32[$11 + ($$0113 << 8) + 4 >> 2] = HEAP32[$48 >> 2]; + $$sink118 = $50; + $$sink119$in = $49; + label = 17; + } + } else { + HEAP32[$11 + ($$0113 << 8) + 4 >> 2] = HEAP32[$45 >> 2]; + $$sink118 = $47; + $$sink119$in = $46; + label = 17; + } + if ((label | 0) == 17) { + label = 0; + HEAP32[$11 + ($$0113 << 8) + 16 >> 2] = HEAP32[$$sink119$in >> 2]; + HEAPF64[$11 + ($$0113 << 8) + 32 >> 3] = +HEAPF64[$$sink118 >> 3]; + } + $$1 = $$0113 + 1 | 0; + } else $$1 = $$0113; + $$0 = $$0 + 1 | 0; + $$0113 = $$1; + } + HEAP32[$12 >> 2] = $$0113; + STACKTOP = sp; + return 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseCtorDtorNameERPNS0_4NodeEPNS5_9NameStateE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$1 = 0, $$3 = 0, $10 = 0, $12 = 0, $13 = 0, $25 = 0, $3 = 0, $4 = 0, $5 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + $4 = sp + 4 | 0; + $5 = HEAP32[$1 >> 2] | 0; + if ((__ZNK12_GLOBAL__N_116itanium_demangle4Node7getKindEv($5) | 0) << 24 >> 24 == 36 ? ($9 = HEAP32[$5 + 8 >> 2] | 0, HEAP32[$3 >> 2] = $9, ($9 + -2 | 0) >>> 0 < 4) : 0) { + $10 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_27ExpandedSpecialSubstitutionEJRNS0_14SpecialSubKindEEEEPNS0_4NodeEDpOT0_($0, $3) | 0; + HEAP32[$1 >> 2] = $10; + } + L7 : do if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 67) | 0)) if ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 == 68) { + $25 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 1) | 0; + switch ($25 << 24 >> 24) { + case 53: + case 50: + case 49: + case 48: + break; + default: + { + $$3 = 0; + break L7; + } + } + HEAP32[$3 >> 2] = ($25 << 24 >> 24) + -48; + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 2; + if ($2 | 0) HEAP8[$2 >> 0] = 1; + HEAP8[$4 >> 0] = 1; + $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_12CtorDtorNameEJRPNS0_4NodeEbRiEEES9_DpOT0_($0, $1, $4, $3) | 0; + } else $$3 = 0; else { + $12 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 73) | 0; + $13 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0; + switch ($13 << 24 >> 24) { + case 53: + case 51: + case 50: + case 49: + break; + default: + { + $$3 = 0; + break L7; + } + } + HEAP32[$3 >> 2] = ($13 << 24 >> 24) + -48; + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + if ($2 | 0) HEAP8[$2 >> 0] = 1; + if ($12 ? (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseNameEPNS5_9NameStateE(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0, $2) | 0) == 0 : 0) $$1 = 0; else { + HEAP8[$4 >> 0] = 0; + $$1 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_12CtorDtorNameEJRPNS0_4NodeEbRiEEES9_DpOT0_($0, $1, $4, $3) | 0; + } + $$3 = $$1; + } while (0); + STACKTOP = sp; + return $$3 | 0; +} + +function _decode_mcu_DC_refine_64($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$lcssa = 0, $$017$i = 0, $$037$lcssa = 0, $$03744 = 0, $$03943 = 0, $$040 = 0, $$045 = 0, $$1 = 0, $$138 = 0, $$in = 0, $11 = 0, $15 = 0, $16 = 0, $2 = 0, $23 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $49 = 0, $5 = 0, $50 = 0, $53 = 0, $54 = 0, $65 = 0, $73 = 0, $75 = 0, $76 = 0, $8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $4 = HEAP32[$0 + 468 >> 2] | 0; + $5 = $0 + 280 | 0; + if (HEAP32[$5 >> 2] | 0 ? ($8 = $4 + 44 | 0, (HEAP32[$8 >> 2] | 0) == 0) : 0) { + $11 = $4 + 16 | 0; + $15 = HEAP32[$0 + 464 >> 2] | 0; + $16 = $15 + 24 | 0; + HEAP32[$16 >> 2] = (HEAP32[$16 >> 2] | 0) + ((HEAP32[$11 >> 2] | 0) / 8 | 0); + HEAP32[$11 >> 2] = 0; + if (!(FUNCTION_TABLE_ii[HEAP32[$15 + 8 >> 2] & 127]($0) | 0)) { + $$040 = 0; + STACKTOP = sp; + return $$040 | 0; + } + $23 = $0 + 340 | 0; + if ((HEAP32[$23 >> 2] | 0) > 0) { + $$017$i = 0; + do { + HEAP32[$4 + 24 + ($$017$i << 2) >> 2] = 0; + $$017$i = $$017$i + 1 | 0; + } while (($$017$i | 0) < (HEAP32[$23 >> 2] | 0)); + } + HEAP32[$4 + 20 >> 2] = 0; + HEAP32[$8 >> 2] = HEAP32[$5 >> 2]; + if (!(HEAP32[$0 + 440 >> 2] | 0)) HEAP32[$4 + 40 >> 2] = 0; + } + HEAP32[$2 + 16 >> 2] = $0; + $37 = $0 + 24 | 0; + $38 = HEAP32[$37 >> 2] | 0; + $39 = HEAP32[$38 >> 2] | 0; + HEAP32[$2 >> 2] = $39; + $41 = HEAP32[$38 + 4 >> 2] | 0; + $42 = $2 + 4 | 0; + HEAP32[$42 >> 2] = $41; + $43 = $4 + 12 | 0; + $44 = HEAP32[$43 >> 2] | 0; + $45 = $4 + 16 | 0; + $46 = HEAP32[$45 >> 2] | 0; + $49 = 1 << HEAP32[$0 + 424 >> 2]; + $50 = $0 + 368 | 0; + do if ((HEAP32[$50 >> 2] | 0) > 0) { + $53 = $2 + 8 | 0; + $54 = $2 + 12 | 0; + $$03744 = $44; + $$03943 = 0; + $$045 = $46; + while (1) { + if (($$045 | 0) < 1) { + if (!(_jpeg_fill_bit_buffer($2, $$03744, $$045, 1) | 0)) { + $$040 = 0; + label = 19; + break; + } + $$1 = HEAP32[$54 >> 2] | 0; + $$138 = HEAP32[$53 >> 2] | 0; + } else { + $$1 = $$045; + $$138 = $$03744; + } + $$045 = $$1 + -1 | 0; + if (1 << $$045 & $$138 | 0) { + $65 = HEAP32[$1 + ($$03943 << 2) >> 2] | 0; + HEAP16[$65 >> 1] = $49 | (HEAPU16[$65 >> 1] | 0); + } + $$03943 = $$03943 + 1 | 0; + if (($$03943 | 0) >= (HEAP32[$50 >> 2] | 0)) { + label = 17; + break; + } else $$03744 = $$138; + } + if ((label | 0) == 17) { + $$0$lcssa = $$045; + $$037$lcssa = $$138; + $$in = HEAP32[$37 >> 2] | 0; + $73 = HEAP32[$2 >> 2] | 0; + $75 = HEAP32[$42 >> 2] | 0; + break; + } else if ((label | 0) == 19) { + STACKTOP = sp; + return $$040 | 0; + } + } else { + $$0$lcssa = $46; + $$037$lcssa = $44; + $$in = $38; + $73 = $39; + $75 = $41; + } while (0); + HEAP32[$$in >> 2] = $73; + HEAP32[$$in + 4 >> 2] = $75; + HEAP32[$43 >> 2] = $$037$lcssa; + HEAP32[$45 >> 2] = $$0$lcssa; + $76 = $4 + 44 | 0; + HEAP32[$76 >> 2] = (HEAP32[$76 >> 2] | 0) + -1; + $$040 = 1; + STACKTOP = sp; + return $$040 | 0; +} + +function __ZNSt3__29__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + $10 = $10 | 0; + $11 = $11 | 0; + var $$0$i$idx = 0, $$0$i$ptr = 0, $$0$lcssa$i = 0, $$2 = 0, $15 = 0, $18 = 0, $25 = 0, $30 = 0, $34 = 0, $43 = 0, $48 = 0, $50 = 0, $56 = 0, $60 = 0, $61 = 0, $65 = 0, $75 = 0, $84 = 0, $91 = 0, $96 = 0, $98 = 0; + L1 : do if (($0 | 0) == ($5 | 0)) if (HEAP8[$1 >> 0] | 0) { + HEAP8[$1 >> 0] = 0; + $15 = HEAP32[$4 >> 2] | 0; + HEAP32[$4 >> 2] = $15 + 1; + HEAP8[$15 >> 0] = 46; + $18 = HEAP8[$7 + 11 >> 0] | 0; + if ((($18 << 24 >> 24 < 0 ? HEAP32[$7 + 4 >> 2] | 0 : $18 & 255) | 0) != 0 ? ($25 = HEAP32[$9 >> 2] | 0, ($25 - $8 | 0) < 160) : 0) { + $30 = HEAP32[$10 >> 2] | 0; + HEAP32[$9 >> 2] = $25 + 4; + HEAP32[$25 >> 2] = $30; + $$2 = 0; + } else $$2 = 0; + } else $$2 = -1; else { + if (($0 | 0) == ($6 | 0) ? ($34 = HEAP8[$7 + 11 >> 0] | 0, ($34 << 24 >> 24 < 0 ? HEAP32[$7 + 4 >> 2] | 0 : $34 & 255) | 0) : 0) { + if (!(HEAP8[$1 >> 0] | 0)) { + $$2 = -1; + break; + } + $43 = HEAP32[$9 >> 2] | 0; + if (($43 - $8 | 0) >= 160) { + $$2 = 0; + break; + } + $48 = HEAP32[$10 >> 2] | 0; + HEAP32[$9 >> 2] = $43 + 4; + HEAP32[$43 >> 2] = $48; + HEAP32[$10 >> 2] = 0; + $$2 = 0; + break; + } + $50 = $11 + 128 | 0; + $$0$i$idx = 0; + while (1) { + $$0$i$ptr = $11 + ($$0$i$idx << 2) | 0; + if (($$0$i$idx | 0) == 32) { + $$0$lcssa$i = $50; + break; + } + if ((HEAP32[$$0$i$ptr >> 2] | 0) == ($0 | 0)) { + $$0$lcssa$i = $$0$i$ptr; + break; + } else $$0$i$idx = $$0$i$idx + 1 | 0; + } + $56 = $$0$lcssa$i - $11 | 0; + if (($56 | 0) <= 124) { + $60 = HEAP8[12928 + ($56 >> 2) >> 0] | 0; + $61 = $56 + -88 | 0; + switch ($61 >>> 2 | $61 << 30 | 0) { + case 2: + case 3: + { + $65 = HEAP32[$4 >> 2] | 0; + if (($65 | 0) != ($3 | 0) ? (HEAP8[$65 + -1 >> 0] & 95) != (HEAP8[$2 >> 0] & 127) : 0) { + $$2 = -1; + break L1; + } + HEAP32[$4 >> 2] = $65 + 1; + HEAP8[$65 >> 0] = $60; + $$2 = 0; + break L1; + break; + } + case 1: + case 0: + { + HEAP8[$2 >> 0] = 80; + break; + } + default: + { + $75 = $60 & 95; + if (((($75 | 0) == (HEAP8[$2 >> 0] | 0) ? (HEAP8[$2 >> 0] = $75 | 128, HEAP8[$1 >> 0] | 0) : 0) ? (HEAP8[$1 >> 0] = 0, $84 = HEAP8[$7 + 11 >> 0] | 0, ($84 << 24 >> 24 < 0 ? HEAP32[$7 + 4 >> 2] | 0 : $84 & 255) | 0) : 0) ? ($91 = HEAP32[$9 >> 2] | 0, ($91 - $8 | 0) < 160) : 0) { + $96 = HEAP32[$10 >> 2] | 0; + HEAP32[$9 >> 2] = $91 + 4; + HEAP32[$91 >> 2] = $96; + } + } + } + $98 = HEAP32[$4 >> 2] | 0; + HEAP32[$4 >> 2] = $98 + 1; + HEAP8[$98 >> 0] = $60; + if (($56 | 0) > 84) $$2 = 0; else { + HEAP32[$10 >> 2] = (HEAP32[$10 >> 2] | 0) + 1; + $$2 = 0; + } + } else $$2 = -1; + } while (0); + return $$2 | 0; +} + +function _jinit_d_main_controller($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$042 = 0, $$04243$i = 0, $$04344 = 0, $$044$i = 0, $$045 = 0, $$phi$trans$insert = 0, $$pre$phiZ2D = 0, $16 = 0, $17 = 0, $19 = 0, $2 = 0, $22 = 0, $25 = 0, $28 = 0, $29 = 0, $30 = 0, $32 = 0, $36 = 0, $37 = 0, $42 = 0, $44 = 0, $47 = 0, $5 = 0, $50 = 0, $58 = 0, $6 = 0, $60 = 0, $64 = 0, $67 = 0, $73 = 0, $74 = 0, $8 = 0, $82 = 0, $83 = 0, $84 = 0, $86 = 0, $90 = 0, $91 = 0; + $2 = $0 + 4 | 0; + $5 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$2 >> 2] >> 2] & 63]($0, 1, 80) | 0; + $6 = $0 + 448 | 0; + HEAP32[$6 >> 2] = $5; + HEAP32[$5 >> 2] = 136; + if ($1 | 0) { + $8 = HEAP32[$0 >> 2] | 0; + HEAP32[$8 + 20 >> 2] = 3; + FUNCTION_TABLE_vi[HEAP32[$8 >> 2] & 255]($0); + } + $16 = $0 + 328 | 0; + $17 = HEAP32[$16 >> 2] | 0; + if (!(HEAP32[(HEAP32[$0 + 476 >> 2] | 0) + 8 >> 2] | 0)) { + HEAP32[$5 + 52 >> 2] = $17; + $$phi$trans$insert = $0 + 36 | 0; + $$042 = $17; + $$pre$phiZ2D = $$phi$trans$insert; + $64 = HEAP32[$$phi$trans$insert >> 2] | 0; + $91 = $17; + } else { + if (($17 | 0) < 2) { + $19 = HEAP32[$0 >> 2] | 0; + HEAP32[$19 + 20 >> 2] = 48; + FUNCTION_TABLE_vi[HEAP32[$19 >> 2] & 255]($0); + $37 = HEAP32[$16 >> 2] | 0; + } else $37 = $17; + $22 = HEAP32[$6 >> 2] | 0; + $25 = $0 + 36 | 0; + $28 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$2 >> 2] >> 2] & 63]($0, 1, HEAP32[$25 >> 2] << 3) | 0; + $29 = $22 + 60 | 0; + HEAP32[$29 >> 2] = $28; + $30 = HEAP32[$25 >> 2] | 0; + $32 = $22 + 64 | 0; + HEAP32[$32 >> 2] = $28 + ($30 << 2); + if (($30 | 0) > 0) { + $36 = $37 + 4 | 0; + $$04243$i = HEAP32[$0 + 216 >> 2] | 0; + $$044$i = 0; + while (1) { + $42 = Math_imul(HEAP32[$$04243$i + 40 >> 2] | 0, HEAP32[$$04243$i + 12 >> 2] | 0) | 0; + $44 = ($42 | 0) / (HEAP32[$16 >> 2] | 0) | 0; + $47 = Math_imul($44, $36) | 0; + $50 = (FUNCTION_TABLE_iiii[HEAP32[HEAP32[$2 >> 2] >> 2] & 63]($0, 1, $47 << 3) | 0) + ($44 << 2) | 0; + HEAP32[(HEAP32[$29 >> 2] | 0) + ($$044$i << 2) >> 2] = $50; + HEAP32[(HEAP32[$32 >> 2] | 0) + ($$044$i << 2) >> 2] = $50 + ($47 << 2); + $$044$i = $$044$i + 1 | 0; + $58 = HEAP32[$25 >> 2] | 0; + if (($$044$i | 0) >= ($58 | 0)) { + $90 = $58; + break; + } else $$04243$i = $$04243$i + 88 | 0; + } + } else $90 = $30; + $60 = HEAP32[$16 >> 2] | 0; + $$042 = $60 + 2 | 0; + $$pre$phiZ2D = $25; + $64 = $90; + $91 = $60; + } + if (($64 | 0) <= 0) return; + $67 = $5 + 8 | 0; + $$04344 = 0; + $$045 = HEAP32[$0 + 216 >> 2] | 0; + $74 = $91; + while (1) { + $73 = (Math_imul(HEAP32[$$045 + 40 >> 2] | 0, HEAP32[$$045 + 12 >> 2] | 0) | 0) / ($74 | 0) | 0; + $82 = Math_imul(HEAP32[$$045 + 36 >> 2] | 0, HEAP32[$$045 + 28 >> 2] | 0) | 0; + $83 = Math_imul($73, $$042) | 0; + $84 = FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$2 >> 2] | 0) + 8 >> 2] & 15]($0, 1, $82, $83) | 0; + HEAP32[$67 + ($$04344 << 2) >> 2] = $84; + $86 = $$04344 + 1 | 0; + if (($86 | 0) >= (HEAP32[$$pre$phiZ2D >> 2] | 0)) break; + $$04344 = $86; + $$045 = $$045 + 88 | 0; + $74 = HEAP32[$16 >> 2] | 0; + } + return; +} + +function _arglCameraFrustumRH($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + $3 = $3 | 0; + var $$0 = 0, $$053 = 0, $$1 = 0, $$154 = 0, $$2 = 0, $10 = 0, $15 = 0.0, $19 = 0, $24 = 0.0, $34 = 0.0, $4 = 0, $48 = 0, $5 = 0, $6 = 0, $62 = 0, $64 = 0.0, $7 = 0, $71 = 0, $75 = 0.0, $77 = 0.0, $79 = 0.0, $8 = 0, $81 = 0.0, $82 = 0, $83 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 416 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(416); + $4 = sp + 304 | 0; + $5 = sp + 208 | 0; + $6 = sp + 128 | 0; + $7 = sp; + $8 = HEAP32[$0 >> 2] | 0; + $10 = HEAP32[$0 + 4 >> 2] | 0; + L1 : do if ((_arParamDecompMat($0 + 8 | 0, $4, $5) | 0) < 0) _arLog(0, 3, 24663, sp + 400 | 0); else { + $15 = +($10 + -1 | 0); + $$053 = 0; + while (1) { + if (($$053 | 0) == 4) break; + $19 = $4 + 32 + ($$053 << 3) | 0; + HEAPF64[$19 >> 3] = +HEAPF64[$4 + 64 + ($$053 << 3) >> 3] * $15 - +HEAPF64[$19 >> 3]; + $$053 = $$053 + 1 | 0; + } + $24 = +HEAPF64[$4 + 80 >> 3]; + $$154 = 0; + while (1) { + if (($$154 | 0) == 3) break; + $$0 = 0; + while (1) { + if (($$0 | 0) == 3) break; + HEAPF64[$6 + ($$154 * 24 | 0) + ($$0 << 3) >> 3] = +HEAPF64[$4 + ($$154 << 5) + ($$0 << 3) >> 3] / $24; + $$0 = $$0 + 1 | 0; + } + $$154 = $$154 + 1 | 0; + } + $34 = +($8 + -1 | 0); + HEAPF64[$7 >> 3] = +HEAPF64[$6 >> 3] * 2.0 / $34; + HEAPF64[$7 + 8 >> 3] = +HEAPF64[$6 + 8 >> 3] * 2.0 / $34; + HEAPF64[$7 + 16 >> 3] = -(+HEAPF64[$6 + 16 >> 3] * 2.0 / $34 + -1.0); + $48 = $7 + 24 | 0; + HEAP32[$48 >> 2] = 0; + HEAP32[$48 + 4 >> 2] = 0; + HEAP32[$48 + 8 >> 2] = 0; + HEAP32[$48 + 12 >> 2] = 0; + HEAPF64[$7 + 40 >> 3] = -(+HEAPF64[$6 + 32 >> 3] * 2.0 / $15); + HEAPF64[$7 + 48 >> 3] = -(+HEAPF64[$6 + 40 >> 3] * 2.0 / $15 + -1.0); + $62 = $7 + 56 | 0; + $64 = $1 - $2; + HEAP32[$62 >> 2] = 0; + HEAP32[$62 + 4 >> 2] = 0; + HEAP32[$62 + 8 >> 2] = 0; + HEAP32[$62 + 12 >> 2] = 0; + HEAP32[$62 + 16 >> 2] = 0; + HEAP32[$62 + 20 >> 2] = 0; + HEAPF64[$7 + 80 >> 3] = ($1 + $2) / $64; + HEAPF64[$7 + 88 >> 3] = $2 * 2.0 * $1 / $64; + $71 = $7 + 96 | 0; + HEAP32[$71 >> 2] = 0; + HEAP32[$71 + 4 >> 2] = 0; + HEAP32[$71 + 8 >> 2] = 0; + HEAP32[$71 + 12 >> 2] = 0; + HEAPF64[$7 + 112 >> 3] = -1.0; + HEAPF64[$7 + 120 >> 3] = 0.0; + $75 = +HEAPF64[$5 + 24 >> 3]; + $77 = +HEAPF64[$5 + 56 >> 3]; + $79 = +HEAPF64[$5 + 88 >> 3]; + $$2 = 0; + while (1) { + if (($$2 | 0) == 4) break L1; + $81 = +HEAPF64[$7 + ($$2 << 5) >> 3]; + $82 = $7 + ($$2 << 5) + 8 | 0; + $83 = $7 + ($$2 << 5) + 16 | 0; + $$1 = 0; + while (1) { + if (($$1 | 0) == 3) break; + HEAPF64[$3 + (($$1 << 2) + $$2 << 3) >> 3] = $81 * +HEAPF64[$5 + ($$1 << 3) >> 3] + +HEAPF64[$82 >> 3] * +HEAPF64[$5 + 32 + ($$1 << 3) >> 3] + +HEAPF64[$83 >> 3] * +HEAPF64[$5 + 64 + ($$1 << 3) >> 3]; + $$1 = $$1 + 1 | 0; + } + HEAPF64[$3 + ($$2 + 12 << 3) >> 3] = +HEAPF64[$7 + ($$2 << 5) + 24 >> 3] + ($81 * $75 + +HEAPF64[$82 >> 3] * $77 + +HEAPF64[$83 >> 3] * $79); + $$2 = $$2 + 1 | 0; + } + } while (0); + STACKTOP = sp; + return; +} + +function _decompress_data($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$07896 = 0, $$07989 = 0, $$08091 = 0, $$08188 = 0, $$08287 = 0, $$083 = 0, $$08490 = 0, $$08594 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $23 = 0, $28 = 0, $29 = 0, $3 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $48 = 0, $49 = 0, $53 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $61 = 0, $68 = 0, $7 = 0, $78 = 0, $8 = 0, $81 = 0, $9 = 0, label = 0; + $3 = HEAP32[$0 + 452 >> 2] | 0; + $4 = $0 + 332 | 0; + $6 = (HEAP32[$4 >> 2] | 0) + -1 | 0; + $7 = $0 + 144 | 0; + $8 = $0 + 152 | 0; + $9 = $0 + 460 | 0; + $10 = $0 + 148 | 0; + $11 = $0 + 156 | 0; + while (1) { + $12 = HEAP32[$7 >> 2] | 0; + $13 = HEAP32[$8 >> 2] | 0; + if (($12 | 0) >= ($13 | 0)) { + if (($12 | 0) != ($13 | 0)) break; + if ((HEAP32[$10 >> 2] | 0) >>> 0 > (HEAP32[$11 >> 2] | 0) >>> 0) break; + } + if (!(FUNCTION_TABLE_ii[HEAP32[HEAP32[$9 >> 2] >> 2] & 127]($0) | 0)) { + $$0 = 0; + label = 20; + break; + } + } + if ((label | 0) == 20) return $$0 | 0; + $23 = $0 + 36 | 0; + if ((HEAP32[$23 >> 2] | 0) > 0) { + $28 = $0 + 4 | 0; + $29 = $0 + 472 | 0; + $$07896 = HEAP32[$0 + 216 >> 2] | 0; + $$08594 = 0; + while (1) { + if (HEAP32[$$07896 + 52 >> 2] | 0) { + $39 = $$07896 + 12 | 0; + $40 = HEAP32[$39 >> 2] | 0; + $41 = Math_imul($40, HEAP32[$11 >> 2] | 0) | 0; + $42 = FUNCTION_TABLE_iiiiii[HEAP32[(HEAP32[$28 >> 2] | 0) + 32 >> 2] & 31]($0, HEAP32[$3 + 72 + ($$08594 << 2) >> 2] | 0, $41, $40, 0) | 0; + if ((HEAP32[$11 >> 2] | 0) >>> 0 < $6 >>> 0) $$083 = HEAP32[$39 >> 2] | 0; else { + $48 = HEAP32[$39 >> 2] | 0; + $49 = ((HEAP32[$$07896 + 32 >> 2] | 0) >>> 0) % ($48 >>> 0) | 0; + $$083 = ($49 | 0) == 0 ? $48 : $49; + } + $53 = HEAP32[(HEAP32[$29 >> 2] | 0) + 4 + ($$08594 << 2) >> 2] | 0; + if (($$083 | 0) > 0) { + $57 = $$07896 + 28 | 0; + $58 = $$07896 + 40 | 0; + $59 = $$07896 + 36 | 0; + $$08091 = HEAP32[$1 + ($$08594 << 2) >> 2] | 0; + $$08490 = 0; + $61 = HEAP32[$57 >> 2] | 0; + while (1) { + if (!$61) $81 = 0; else { + $$07989 = 0; + $$08188 = HEAP32[$42 + ($$08490 << 2) >> 2] | 0; + $$08287 = 0; + while (1) { + FUNCTION_TABLE_viiiii[$53 & 63]($0, $$07896, $$08188, $$08091, $$07989); + $$08287 = $$08287 + 1 | 0; + $68 = HEAP32[$57 >> 2] | 0; + if ($$08287 >>> 0 >= $68 >>> 0) { + $81 = $68; + break; + } else { + $$07989 = (HEAP32[$59 >> 2] | 0) + $$07989 | 0; + $$08188 = $$08188 + 128 | 0; + } + } + } + $$08490 = $$08490 + 1 | 0; + if (($$08490 | 0) == ($$083 | 0)) break; else { + $$08091 = $$08091 + (HEAP32[$58 >> 2] << 2) | 0; + $61 = $81; + } + } + } + } + $$08594 = $$08594 + 1 | 0; + if (($$08594 | 0) >= (HEAP32[$23 >> 2] | 0)) break; else $$07896 = $$07896 + 88 | 0; + } + } + $78 = (HEAP32[$11 >> 2] | 0) + 1 | 0; + HEAP32[$11 >> 2] = $78; + $$0 = $78 >>> 0 < (HEAP32[$4 >> 2] | 0) >>> 0 ? 3 : 4; + return $$0 | 0; +} + +function _qsort($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$067$lcssa = 0, $$06772 = 0, $$068$lcssa = 0, $$06871 = 0, $$1 = 0, $$169 = 0, $$169$be = 0, $$2 = 0, $$2$be = 0, $$be = 0, $12 = 0, $15 = 0, $15$phi = 0, $16 = 0, $17 = 0, $22 = 0, $24 = 0, $26 = 0, $29 = 0, $37 = 0, $38 = 0, $4 = 0, $40 = 0, $43 = 0, $47 = 0, $49 = 0, $5 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $7 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 208 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(208); + $4 = sp; + $5 = sp + 192 | 0; + $6 = Math_imul($2, $1) | 0; + $7 = $5; + HEAP32[$7 >> 2] = 1; + HEAP32[$7 + 4 >> 2] = 0; + L1 : do if ($6 | 0) { + $12 = 0 - $2 | 0; + HEAP32[$4 + 4 >> 2] = $2; + HEAP32[$4 >> 2] = $2; + $$0 = 2; + $15 = $2; + $17 = $2; + while (1) { + $16 = $15 + $2 + $17 | 0; + HEAP32[$4 + ($$0 << 2) >> 2] = $16; + if ($16 >>> 0 < $6 >>> 0) { + $15$phi = $17; + $$0 = $$0 + 1 | 0; + $17 = $16; + $15 = $15$phi; + } else break; + } + $22 = $0 + $6 + $12 | 0; + if ($22 >>> 0 > $0 >>> 0) { + $24 = $22; + $$06772 = 1; + $$06871 = $0; + $26 = 1; + while (1) { + do if (($26 & 3 | 0) != 3) { + $29 = $$06772 + -1 | 0; + if ((HEAP32[$4 + ($29 << 2) >> 2] | 0) >>> 0 < ($24 - $$06871 | 0) >>> 0) _sift($$06871, $2, $3, $$06772, $4); else _trinkle($$06871, $2, $3, $5, $$06772, 0, $4); + if (($$06772 | 0) == 1) { + _shl($5, 1); + $$1 = 0; + break; + } else { + _shl($5, $29); + $$1 = 1; + break; + } + } else { + _sift($$06871, $2, $3, $$06772, $4); + _shr($5, 2); + $$1 = $$06772 + 2 | 0; + } while (0); + $37 = HEAP32[$5 >> 2] | 1; + HEAP32[$5 >> 2] = $37; + $38 = $$06871 + $2 | 0; + if ($38 >>> 0 < $22 >>> 0) { + $$06772 = $$1; + $$06871 = $38; + $26 = $37; + } else { + $$067$lcssa = $$1; + $$068$lcssa = $38; + $61 = $37; + break; + } + } + } else { + $$067$lcssa = 1; + $$068$lcssa = $0; + $61 = 1; + } + _trinkle($$068$lcssa, $2, $3, $5, $$067$lcssa, 0, $4); + $40 = $5 + 4 | 0; + $$169 = $$068$lcssa; + $$2 = $$067$lcssa; + $43 = $61; + while (1) { + if (($$2 | 0) == 1 & ($43 | 0) == 1) if (!(HEAP32[$40 >> 2] | 0)) break L1; else label = 19; else if (($$2 | 0) < 2) label = 19; else { + _shl($5, 2); + $49 = $$2 + -2 | 0; + HEAP32[$5 >> 2] = HEAP32[$5 >> 2] ^ 7; + _shr($5, 1); + _trinkle($$169 + (0 - (HEAP32[$4 + ($49 << 2) >> 2] | 0)) + $12 | 0, $2, $3, $5, $$2 + -1 | 0, 1, $4); + _shl($5, 1); + $59 = HEAP32[$5 >> 2] | 1; + HEAP32[$5 >> 2] = $59; + $60 = $$169 + $12 | 0; + _trinkle($60, $2, $3, $5, $49, 1, $4); + $$169$be = $60; + $$2$be = $49; + $$be = $59; + } + if ((label | 0) == 19) { + label = 0; + $47 = _pntz($5) | 0; + _shr($5, $47); + $$169$be = $$169 + $12 | 0; + $$2$be = $47 + $$2 | 0; + $$be = HEAP32[$5 >> 2] | 0; + } + $$169 = $$169$be; + $$2 = $$2$be; + $43 = $$be; + } + } while (0); + STACKTOP = sp; + return; +} + +function _start_output_pass($0) { + $0 = $0 | 0; + var $$05058$i = 0, $$05157$i = 0, $$05356$i = 0, $$059$i = 0, $$pre$phi$iZ2D = 0, $12 = 0, $15 = 0, $16 = 0, $2 = 0, $21 = 0, $24 = 0, $30 = 0, $49 = 0, $53 = 0, $56 = 0, $57 = 0, $61 = 0, $62 = 0, $66 = 0, $67 = 0, $71 = 0, $72 = 0, $85 = 0, $86 = 0, $decompress_smooth_data$sink = 0, label = 0; + $2 = HEAP32[$0 + 452 >> 2] | 0; + if (!(HEAP32[$2 + 16 >> 2] | 0)) { + $85 = $0 + 156 | 0; + HEAP32[$85 >> 2] = 0; + return; + } + L4 : do if (((HEAP32[$0 + 80 >> 2] | 0) != 0 ? (HEAP32[$0 + 224 >> 2] | 0) != 0 : 0) ? ($12 = $0 + 160 | 0, (HEAP32[$12 >> 2] | 0) != 0) : 0) { + $15 = $2 + 112 | 0; + $16 = HEAP32[$15 >> 2] | 0; + if (!$16) { + $21 = $0 + 36 | 0; + $24 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$0 + 4 >> 2] >> 2] & 63]($0, 1, (HEAP32[$21 >> 2] | 0) * 24 | 0) | 0; + HEAP32[$15 >> 2] = $24; + $$pre$phi$iZ2D = $21; + $86 = $24; + } else { + $$pre$phi$iZ2D = $0 + 36 | 0; + $86 = $16; + } + if ((HEAP32[$$pre$phi$iZ2D >> 2] | 0) > 0) { + $$05058$i = 0; + $$05157$i = HEAP32[$0 + 216 >> 2] | 0; + $$05356$i = 0; + $$059$i = $86; + while (1) { + $30 = HEAP32[$$05157$i + 80 >> 2] | 0; + if (!$30) { + label = 20; + break L4; + } + if (!(HEAP16[$30 >> 1] | 0)) { + label = 20; + break L4; + } + if (!(HEAP16[$30 + 2 >> 1] | 0)) { + label = 20; + break L4; + } + if (!(HEAP16[$30 + 16 >> 1] | 0)) { + label = 20; + break L4; + } + if (!(HEAP16[$30 + 32 >> 1] | 0)) { + label = 20; + break L4; + } + if (!(HEAP16[$30 + 18 >> 1] | 0)) { + label = 20; + break L4; + } + if (!(HEAP16[$30 + 4 >> 1] | 0)) { + label = 20; + break L4; + } + $49 = HEAP32[$12 >> 2] | 0; + if ((HEAP32[$49 + ($$05356$i << 8) >> 2] | 0) < 0) { + label = 20; + break L4; + } + $53 = $49 + ($$05356$i << 8) + 4 | 0; + HEAP32[$$059$i + 4 >> 2] = HEAP32[$53 >> 2]; + $56 = HEAP32[$53 >> 2] | 0; + $57 = $49 + ($$05356$i << 8) + 8 | 0; + HEAP32[$$059$i + 8 >> 2] = HEAP32[$57 >> 2]; + $61 = HEAP32[$57 >> 2] | $56; + $62 = $49 + ($$05356$i << 8) + 12 | 0; + HEAP32[$$059$i + 12 >> 2] = HEAP32[$62 >> 2]; + $66 = $61 | HEAP32[$62 >> 2]; + $67 = $49 + ($$05356$i << 8) + 16 | 0; + HEAP32[$$059$i + 16 >> 2] = HEAP32[$67 >> 2]; + $71 = $66 | HEAP32[$67 >> 2]; + $72 = $49 + ($$05356$i << 8) + 20 | 0; + HEAP32[$$059$i + 20 >> 2] = HEAP32[$72 >> 2]; + $$05058$i = ($71 | HEAP32[$72 >> 2] | 0) == 0 ? $$05058$i : 1; + $$05356$i = $$05356$i + 1 | 0; + if (($$05356$i | 0) >= (HEAP32[$$pre$phi$iZ2D >> 2] | 0)) break; else { + $$05157$i = $$05157$i + 88 | 0; + $$059$i = $$059$i + 24 | 0; + } + } + if ($$05058$i) $decompress_smooth_data$sink = 59; else label = 20; + } else label = 20; + } else label = 20; while (0); + if ((label | 0) == 20) $decompress_smooth_data$sink = 57; + HEAP32[$2 + 12 >> 2] = $decompress_smooth_data$sink; + $85 = $0 + 156 | 0; + HEAP32[$85 >> 2] = 0; + return; +} + +function __ZN6vision18HammingDistance768EPKjS1_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $100 = 0, $106 = 0, $112 = 0, $118 = 0, $124 = 0, $130 = 0, $136 = 0, $16 = 0, $22 = 0, $28 = 0, $34 = 0, $4 = 0, $40 = 0, $46 = 0, $52 = 0, $58 = 0, $64 = 0, $70 = 0, $76 = 0, $82 = 0, $88 = 0, $94 = 0; + $4 = __ZN6vision17HammingDistance32Ejj(HEAP32[$0 >> 2] | 0, HEAP32[$1 >> 2] | 0) | 0; + $10 = (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 4 >> 2] | 0, HEAP32[$1 + 4 >> 2] | 0) | 0) + $4 | 0; + $16 = $10 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 8 >> 2] | 0, HEAP32[$1 + 8 >> 2] | 0) | 0) | 0; + $22 = $16 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 12 >> 2] | 0, HEAP32[$1 + 12 >> 2] | 0) | 0) | 0; + $28 = $22 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 16 >> 2] | 0, HEAP32[$1 + 16 >> 2] | 0) | 0) | 0; + $34 = $28 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 20 >> 2] | 0, HEAP32[$1 + 20 >> 2] | 0) | 0) | 0; + $40 = $34 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 24 >> 2] | 0, HEAP32[$1 + 24 >> 2] | 0) | 0) | 0; + $46 = $40 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 28 >> 2] | 0, HEAP32[$1 + 28 >> 2] | 0) | 0) | 0; + $52 = $46 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 32 >> 2] | 0, HEAP32[$1 + 32 >> 2] | 0) | 0) | 0; + $58 = $52 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 36 >> 2] | 0, HEAP32[$1 + 36 >> 2] | 0) | 0) | 0; + $64 = $58 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 40 >> 2] | 0, HEAP32[$1 + 40 >> 2] | 0) | 0) | 0; + $70 = $64 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 44 >> 2] | 0, HEAP32[$1 + 44 >> 2] | 0) | 0) | 0; + $76 = $70 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 48 >> 2] | 0, HEAP32[$1 + 48 >> 2] | 0) | 0) | 0; + $82 = $76 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 52 >> 2] | 0, HEAP32[$1 + 52 >> 2] | 0) | 0) | 0; + $88 = $82 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 56 >> 2] | 0, HEAP32[$1 + 56 >> 2] | 0) | 0) | 0; + $94 = $88 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 60 >> 2] | 0, HEAP32[$1 + 60 >> 2] | 0) | 0) | 0; + $100 = $94 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 64 >> 2] | 0, HEAP32[$1 + 64 >> 2] | 0) | 0) | 0; + $106 = $100 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 68 >> 2] | 0, HEAP32[$1 + 68 >> 2] | 0) | 0) | 0; + $112 = $106 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 72 >> 2] | 0, HEAP32[$1 + 72 >> 2] | 0) | 0) | 0; + $118 = $112 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 76 >> 2] | 0, HEAP32[$1 + 76 >> 2] | 0) | 0) | 0; + $124 = $118 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 80 >> 2] | 0, HEAP32[$1 + 80 >> 2] | 0) | 0) | 0; + $130 = $124 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 84 >> 2] | 0, HEAP32[$1 + 84 >> 2] | 0) | 0) | 0; + $136 = $130 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 88 >> 2] | 0, HEAP32[$1 + 88 >> 2] | 0) | 0) | 0; + return $136 + (__ZN6vision17HammingDistance32Ejj(HEAP32[$0 + 92 >> 2] | 0, HEAP32[$1 + 92 >> 2] | 0) | 0) | 0; +} + +function _jpeg_idct_2x4($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $108 = 0, $109 = 0, $123 = 0, $124 = 0, $13 = 0, $139 = 0, $141 = 0, $19 = 0, $21 = 0, $23 = 0, $29 = 0, $35 = 0, $37 = 0, $39 = 0, $41 = 0, $42 = 0, $45 = 0, $47 = 0, $5 = 0, $55 = 0, $61 = 0, $63 = 0, $65 = 0, $7 = 0, $71 = 0, $77 = 0, $79 = 0, $81 = 0, $83 = 0, $84 = 0, $85 = 0, $87 = 0, $89 = 0, $9 = 0, $91 = 0, $93 = 0, $94 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $9 = HEAP32[$1 + 84 >> 2] | 0; + $13 = Math_imul(HEAP32[$9 >> 2] | 0, HEAP16[$2 >> 1] | 0) | 0; + $19 = Math_imul(HEAP32[$9 + 64 >> 2] | 0, HEAP16[$2 + 32 >> 1] | 0) | 0; + $21 = $19 + $13 << 13; + $23 = $13 - $19 << 13; + $29 = Math_imul(HEAP32[$9 + 32 >> 2] | 0, HEAP16[$2 + 16 >> 1] | 0) | 0; + $35 = Math_imul(HEAP32[$9 + 96 >> 2] | 0, HEAP16[$2 + 48 >> 1] | 0) | 0; + $37 = ($35 + $29 | 0) * 4433 | 0; + $39 = $37 + ($29 * 6270 | 0) | 0; + $41 = $37 + (Math_imul($35, -15137) | 0) | 0; + $42 = $39 + $21 | 0; + HEAP32[$5 >> 2] = $42; + HEAP32[$5 + 24 >> 2] = $21 - $39; + $45 = $41 + $23 | 0; + HEAP32[$5 + 8 >> 2] = $45; + $47 = $23 - $41 | 0; + HEAP32[$5 + 16 >> 2] = $47; + $55 = Math_imul(HEAP32[$9 + 4 >> 2] | 0, HEAP16[$2 + 2 >> 1] | 0) | 0; + $61 = Math_imul(HEAP32[$9 + 68 >> 2] | 0, HEAP16[$2 + 34 >> 1] | 0) | 0; + $63 = $61 + $55 << 13; + $65 = $55 - $61 << 13; + $71 = Math_imul(HEAP32[$9 + 36 >> 2] | 0, HEAP16[$2 + 18 >> 1] | 0) | 0; + $77 = Math_imul(HEAP32[$9 + 100 >> 2] | 0, HEAP16[$2 + 50 >> 1] | 0) | 0; + $79 = ($77 + $71 | 0) * 4433 | 0; + $81 = $79 + ($71 * 6270 | 0) | 0; + $83 = $79 + (Math_imul($77, -15137) | 0) | 0; + $84 = $81 + $63 | 0; + HEAP32[$5 + 4 >> 2] = $84; + $85 = $63 - $81 | 0; + HEAP32[$5 + 28 >> 2] = $85; + $87 = $83 + $65 | 0; + HEAP32[$5 + 12 >> 2] = $87; + $89 = $65 - $83 | 0; + HEAP32[$5 + 20 >> 2] = $89; + $91 = $7 + -384 | 0; + $93 = (HEAP32[$3 >> 2] | 0) + $4 | 0; + $94 = $42 + 33587200 | 0; + HEAP8[$93 >> 0] = HEAP8[$91 + (($94 + $84 | 0) >>> 16 & 1023) >> 0] | 0; + HEAP8[$93 + 1 >> 0] = HEAP8[$91 + (($94 - $84 | 0) >>> 16 & 1023) >> 0] | 0; + $108 = (HEAP32[$3 + 4 >> 2] | 0) + $4 | 0; + $109 = $45 + 33587200 | 0; + HEAP8[$108 >> 0] = HEAP8[$91 + (($109 + $87 | 0) >>> 16 & 1023) >> 0] | 0; + HEAP8[$108 + 1 >> 0] = HEAP8[$91 + (($109 - $87 | 0) >>> 16 & 1023) >> 0] | 0; + $123 = (HEAP32[$3 + 8 >> 2] | 0) + $4 | 0; + $124 = $47 + 33587200 | 0; + HEAP8[$123 >> 0] = HEAP8[$91 + (($124 + $89 | 0) >>> 16 & 1023) >> 0] | 0; + HEAP8[$123 + 1 >> 0] = HEAP8[$91 + (($124 - $89 | 0) >>> 16 & 1023) >> 0] | 0; + $139 = (HEAP32[$3 + 12 >> 2] | 0) + $4 | 0; + $141 = (HEAP32[$5 + 24 >> 2] | 0) + 33587200 | 0; + HEAP8[$139 >> 0] = HEAP8[$91 + (($141 + $85 | 0) >>> 16 & 1023) >> 0] | 0; + HEAP8[$139 + 1 >> 0] = HEAP8[$91 + (($141 - $85 | 0) >>> 16 & 1023) >> 0] | 0; + STACKTOP = sp; + return; +} + +function __ZNSt3__28ios_base4InitC2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $14 = 0, $15 = 0, $16 = 0, $2 = 0, $22 = 0, $23 = 0, $3 = 0, $35 = 0, $38 = 0, $4 = 0, $42 = 0, $45 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0; + $1 = HEAP32[4272] | 0; + __ZNSt3__210__stdinbufIcEC2EP8_IO_FILEP11__mbstate_t(66144, $1, 66200); + HEAP32[16366] = 20700; + HEAP32[16368] = 20720; + HEAP32[16367] = 0; + __ZNSt3__28ios_base4initEPv(65472, 66144); + HEAP32[16386] = 0; + $2 = __ZNSt3__211char_traitsIcE3eofEv() | 0; + HEAP32[16387] = $2; + __ZNSt3__210__stdinbufIwEC2EP8_IO_FILEP11__mbstate_t(66208, $1, 66264); + HEAP32[16388] = 20748; + HEAP32[16390] = 20768; + HEAP32[16389] = 0; + __ZNSt3__28ios_base4initEPv(65560, 66208); + HEAP32[16408] = 0; + $3 = __ZNSt3__211char_traitsIwE3eofEv() | 0; + HEAP32[16409] = $3; + $4 = HEAP32[4273] | 0; + __ZNSt3__211__stdoutbufIcEC2EP8_IO_FILEP11__mbstate_t(66272, $4, 66320); + HEAP32[16410] = 20796; + HEAP32[16411] = 20816; + __ZNSt3__28ios_base4initEPv(65644, 66272); + HEAP32[16429] = 0; + $5 = __ZNSt3__211char_traitsIcE3eofEv() | 0; + HEAP32[16430] = $5; + __ZNSt3__211__stdoutbufIwEC2EP8_IO_FILEP11__mbstate_t(66328, $4, 66376); + HEAP32[16431] = 20844; + HEAP32[16432] = 20864; + __ZNSt3__28ios_base4initEPv(65728, 66328); + HEAP32[16450] = 0; + $6 = __ZNSt3__211char_traitsIwE3eofEv() | 0; + HEAP32[16451] = $6; + $7 = HEAP32[4271] | 0; + __ZNSt3__211__stdoutbufIcEC2EP8_IO_FILEP11__mbstate_t(66384, $7, 66432); + HEAP32[16452] = 20796; + HEAP32[16453] = 20816; + __ZNSt3__28ios_base4initEPv(65812, 66384); + HEAP32[16471] = 0; + $8 = __ZNSt3__211char_traitsIcE3eofEv() | 0; + HEAP32[16472] = $8; + $14 = HEAP32[65808 + (HEAP32[(HEAP32[16452] | 0) + -12 >> 2] | 0) + 24 >> 2] | 0; + HEAP32[16494] = 20796; + HEAP32[16495] = 20816; + __ZNSt3__28ios_base4initEPv(65980, $14); + HEAP32[16513] = 0; + $15 = __ZNSt3__211char_traitsIcE3eofEv() | 0; + HEAP32[16514] = $15; + __ZNSt3__211__stdoutbufIwEC2EP8_IO_FILEP11__mbstate_t(66440, $7, 66488); + HEAP32[16473] = 20844; + HEAP32[16474] = 20864; + __ZNSt3__28ios_base4initEPv(65896, 66440); + HEAP32[16492] = 0; + $16 = __ZNSt3__211char_traitsIwE3eofEv() | 0; + HEAP32[16493] = $16; + $22 = HEAP32[65892 + (HEAP32[(HEAP32[16473] | 0) + -12 >> 2] | 0) + 24 >> 2] | 0; + HEAP32[16515] = 20844; + HEAP32[16516] = 20864; + __ZNSt3__28ios_base4initEPv(66064, $22); + HEAP32[16534] = 0; + $23 = __ZNSt3__211char_traitsIwE3eofEv() | 0; + HEAP32[16535] = $23; + HEAP32[65464 + (HEAP32[(HEAP32[16366] | 0) + -12 >> 2] | 0) + 72 >> 2] = 65640; + HEAP32[65552 + (HEAP32[(HEAP32[16388] | 0) + -12 >> 2] | 0) + 72 >> 2] = 65724; + $35 = (HEAP32[16452] | 0) + -12 | 0; + $38 = 65808 + (HEAP32[$35 >> 2] | 0) + 4 | 0; + HEAP32[$38 >> 2] = HEAP32[$38 >> 2] | 8192; + $42 = (HEAP32[16473] | 0) + -12 | 0; + $45 = 65892 + (HEAP32[$42 >> 2] | 0) + 4 | 0; + HEAP32[$45 >> 2] = HEAP32[$45 >> 2] | 8192; + HEAP32[65808 + (HEAP32[$35 >> 2] | 0) + 72 >> 2] = 65640; + HEAP32[65892 + (HEAP32[$42 >> 2] | 0) + 72 >> 2] = 65724; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle14IntegerLiteral9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $12 = 0, $17 = 0, $18 = 0, $2 = 0, $22 = 0, $23 = 0, $26 = 0, $3 = 0, $31 = 0, $32 = 0, $38 = 0, $4 = 0, $43 = 0, $44 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $tmpcast8$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $tmpcast8$byval_copy = sp + 56 | 0; + $2 = sp + 48 | 0; + $3 = sp + 16 | 0; + $4 = sp + 40 | 0; + $5 = sp + 32 | 0; + $6 = sp + 24 | 0; + $7 = sp + 8 | 0; + $8 = sp; + $9 = $0 + 8 | 0; + if ((__ZNK12_GLOBAL__N_110StringView4sizeEv($9) | 0) >>> 0 > 3) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51968); + HEAP32[$tmpcast8$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast8$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast8$byval_copy); + $12 = $9; + $17 = HEAP32[$12 + 4 >> 2] | 0; + $18 = $3; + HEAP32[$18 >> 2] = HEAP32[$12 >> 2]; + HEAP32[$18 + 4 >> 2] = $17; + HEAP32[$tmpcast8$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast8$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast8$byval_copy); + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 51964); + HEAP32[$tmpcast8$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$tmpcast8$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast8$byval_copy); + } + $22 = $0 + 16 | 0; + $23 = __ZNK12_GLOBAL__N_110StringViewixEm($22) | 0; + if ((HEAP8[$23 >> 0] | 0) == 110) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 52555); + HEAP32[$tmpcast8$byval_copy >> 2] = HEAP32[$5 >> 2]; + HEAP32[$tmpcast8$byval_copy + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast8$byval_copy); + __ZNK12_GLOBAL__N_110StringView9dropFrontEm($6, $22, 1); + HEAP32[$tmpcast8$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$tmpcast8$byval_copy + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast8$byval_copy); + } else { + $26 = $22; + $31 = HEAP32[$26 + 4 >> 2] | 0; + $32 = $7; + HEAP32[$32 >> 2] = HEAP32[$26 >> 2]; + HEAP32[$32 + 4 >> 2] = $31; + HEAP32[$tmpcast8$byval_copy >> 2] = HEAP32[$7 >> 2]; + HEAP32[$tmpcast8$byval_copy + 4 >> 2] = HEAP32[$7 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast8$byval_copy); + } + if ((__ZNK12_GLOBAL__N_110StringView4sizeEv($9) | 0) >>> 0 < 4) { + $38 = $9; + $43 = HEAP32[$38 + 4 >> 2] | 0; + $44 = $8; + HEAP32[$44 >> 2] = HEAP32[$38 >> 2]; + HEAP32[$44 + 4 >> 2] = $43; + HEAP32[$tmpcast8$byval_copy >> 2] = HEAP32[$8 >> 2]; + HEAP32[$tmpcast8$byval_copy + 4 >> 2] = HEAP32[$8 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast8$byval_copy); + } + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E23parseBaseUnresolvedNameEv($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$2 = 0, $$byval_copy1 = 0, $1 = 0, $11 = 0, $12 = 0, $16 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 24 | 0; + $1 = sp + 16 | 0; + $2 = sp + 8 | 0; + $3 = sp; + do if ((((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24) + -48 | 0) >>> 0 < 10) $$2 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseSimpleIdEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($1, 53757); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$1 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy1) | 0) { + $$2 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseDestructorNameEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 53760); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy1) | 0; + $11 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $12 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseOperatorNameEPNS5_9NameStateE($11, 0) | 0; + HEAP32[$$byval_copy1 >> 2] = $12; + if ($12) if ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 == 73) { + $16 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseTemplateArgsEb($11, 0) | 0; + HEAP32[$3 >> 2] = $16; + if (!$16) $$0 = 0; else $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20NameWithTemplateArgsEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $$byval_copy1, $3) | 0; + $$1 = $$0; + } else $$1 = $12; else $$1 = 0; + $$2 = $$1; + } while (0); + STACKTOP = sp; + return $$2 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle12FunctionType10printRightERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy6 = 0, $11 = 0, $15 = 0, $16 = 0, $2 = 0, $20 = 0, $23 = 0, $27 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $$byval_copy6 = sp + 56 | 0; + $2 = sp + 48 | 0; + $3 = sp + 40 | 0; + $4 = sp + 32 | 0; + $5 = sp + 24 | 0; + $6 = sp + 16 | 0; + $7 = sp + 8 | 0; + $8 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51968); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray14printWithCommaERNS_12OutputStreamE($0 + 12 | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 51964); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + $11 = HEAP32[$0 + 8 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$11 >> 2] | 0) + 20 >> 2] & 255]($11, $1); + $15 = $0 + 20 | 0; + $16 = HEAP32[$15 >> 2] | 0; + if (!($16 & 1)) $20 = $16; else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 56136); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + $20 = HEAP32[$15 >> 2] | 0; + } + if (!($20 & 2)) $23 = $20; else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 56143); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + $23 = HEAP32[$15 >> 2] | 0; + } + if ($23 & 4 | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($6, 56153); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + } + switch (HEAP8[$0 + 24 >> 0] | 0) { + case 1: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($7, 56338); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$7 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + break; + } + case 2: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($8, 56341); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$8 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + break; + } + default: + {} + } + $27 = $0 + 28 | 0; + if (HEAP32[$27 >> 2] | 0) { + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 32); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$27 >> 2] | 0, $1); + } + STACKTOP = sp; + return; +} + +function _h2v1_merged_upsample($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0110$lcssa = 0, $$0110117 = 0, $$0111$lcssa = 0, $$0111116 = 0, $$0112$lcssa = 0, $$0112115 = 0, $$0113$lcssa = 0, $$0113114 = 0, $$0118 = 0, $100 = 0, $11 = 0, $13 = 0, $15 = 0, $18 = 0, $22 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $30 = 0, $32 = 0, $33 = 0, $36 = 0, $39 = 0, $41 = 0, $47 = 0, $49 = 0, $5 = 0, $52 = 0, $67 = 0, $7 = 0, $83 = 0, $86 = 0, $88 = 0, $9 = 0, $96 = 0, $98 = 0, $scevgep = 0; + $5 = HEAP32[$0 + 476 >> 2] | 0; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $9 = HEAP32[$5 + 16 >> 2] | 0; + $11 = HEAP32[$5 + 20 >> 2] | 0; + $13 = HEAP32[$5 + 24 >> 2] | 0; + $15 = HEAP32[$5 + 28 >> 2] | 0; + $18 = HEAP32[(HEAP32[$1 >> 2] | 0) + ($2 << 2) >> 2] | 0; + $22 = HEAP32[(HEAP32[$1 + 4 >> 2] | 0) + ($2 << 2) >> 2] | 0; + $26 = HEAP32[(HEAP32[$1 + 8 >> 2] | 0) + ($2 << 2) >> 2] | 0; + $27 = HEAP32[$3 >> 2] | 0; + $28 = $0 + 112 | 0; + $29 = HEAP32[$28 >> 2] | 0; + $30 = $29 >>> 1; + if (!$30) { + $$0110$lcssa = $26; + $$0111$lcssa = $22; + $$0112$lcssa = $18; + $$0113$lcssa = $27; + $83 = $29; + } else { + $scevgep = $22 + $30 | 0; + $32 = $29 & -2; + $33 = $30 * 6 | 0; + $$0110117 = $26; + $$0111116 = $22; + $$0112115 = $18; + $$0113114 = $27; + $$0118 = $30; + while (1) { + $36 = HEAPU8[$$0111116 >> 0] | 0; + $39 = HEAPU8[$$0110117 >> 0] | 0; + $41 = HEAP32[$9 + ($39 << 2) >> 2] | 0; + $47 = (HEAP32[$13 + ($39 << 2) >> 2] | 0) + (HEAP32[$15 + ($36 << 2) >> 2] | 0) >> 16; + $49 = HEAP32[$11 + ($36 << 2) >> 2] | 0; + $52 = HEAPU8[$$0112115 >> 0] | 0; + HEAP8[$$0113114 >> 0] = HEAP8[$7 + ($41 + $52) >> 0] | 0; + HEAP8[$$0113114 + 1 >> 0] = HEAP8[$7 + ($47 + $52) >> 0] | 0; + HEAP8[$$0113114 + 2 >> 0] = HEAP8[$7 + ($49 + $52) >> 0] | 0; + $67 = HEAPU8[$$0112115 + 1 >> 0] | 0; + HEAP8[$$0113114 + 3 >> 0] = HEAP8[$7 + ($41 + $67) >> 0] | 0; + HEAP8[$$0113114 + 4 >> 0] = HEAP8[$7 + ($47 + $67) >> 0] | 0; + HEAP8[$$0113114 + 5 >> 0] = HEAP8[$7 + ($49 + $67) >> 0] | 0; + $$0118 = $$0118 + -1 | 0; + if (!$$0118) break; else { + $$0110117 = $$0110117 + 1 | 0; + $$0111116 = $$0111116 + 1 | 0; + $$0112115 = $$0112115 + 2 | 0; + $$0113114 = $$0113114 + 6 | 0; + } + } + $$0110$lcssa = $26 + $30 | 0; + $$0111$lcssa = $scevgep; + $$0112$lcssa = $18 + $32 | 0; + $$0113$lcssa = $27 + $33 | 0; + $83 = HEAP32[$28 >> 2] | 0; + } + if (!($83 & 1)) return; + $86 = HEAPU8[$$0111$lcssa >> 0] | 0; + $88 = HEAPU8[$$0110$lcssa >> 0] | 0; + $96 = (HEAP32[$13 + ($88 << 2) >> 2] | 0) + (HEAP32[$15 + ($86 << 2) >> 2] | 0) >> 16; + $98 = HEAP32[$11 + ($86 << 2) >> 2] | 0; + $100 = HEAPU8[$$0112$lcssa >> 0] | 0; + HEAP8[$$0113$lcssa >> 0] = HEAP8[$7 + ((HEAP32[$9 + ($88 << 2) >> 2] | 0) + $100) >> 0] | 0; + HEAP8[$$0113$lcssa + 1 >> 0] = HEAP8[$7 + ($96 + $100) >> 0] | 0; + HEAP8[$$0113$lcssa + 2 >> 0] = HEAP8[$7 + ($98 + $100) >> 0] | 0; + return; +} + +function ___stpncpy($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0$lcssa = 0, $$037$lcssa = 0, $$03754 = 0, $$038$lcssa = 0, $$03867 = 0, $$039$lcssa = 0, $$03966 = 0, $$042$lcssa = 0, $$04265 = 0, $$055 = 0, $$1$lcssa = 0, $$140 = 0, $$143 = 0, $$153 = 0, $$2 = 0, $$24147 = 0, $$24446 = 0, $$345 = 0, $$348 = 0, $$4 = 0, $$lcssa = 0, $10 = 0, $11 = 0, $13 = 0, $14 = 0, $15 = 0, $19 = 0, $22 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $33 = 0, $37 = 0, label = 0; + $3 = $1; + L1 : do if (!(($3 ^ $0) & 3)) { + $10 = ($2 | 0) != 0; + if ($10 & ($3 & 3 | 0) != 0) { + $$03867 = $2; + $$03966 = $1; + $$04265 = $0; + while (1) { + $11 = HEAP8[$$03966 >> 0] | 0; + HEAP8[$$04265 >> 0] = $11; + if (!($11 << 24 >> 24)) { + $$345 = $$04265; + $$4 = $$03867; + break L1; + } + $13 = $$03867 + -1 | 0; + $14 = $$03966 + 1 | 0; + $15 = $$04265 + 1 | 0; + $19 = ($13 | 0) != 0; + if ($19 & ($14 & 3 | 0) != 0) { + $$03867 = $13; + $$03966 = $14; + $$04265 = $15; + } else { + $$038$lcssa = $13; + $$039$lcssa = $14; + $$042$lcssa = $15; + $$lcssa = $19; + break; + } + } + } else { + $$038$lcssa = $2; + $$039$lcssa = $1; + $$042$lcssa = $0; + $$lcssa = $10; + } + if ($$lcssa) if (!(HEAP8[$$039$lcssa >> 0] | 0)) { + $$345 = $$042$lcssa; + $$4 = $$038$lcssa; + } else { + L11 : do if ($$038$lcssa >>> 0 > 3) { + $$03754 = $$042$lcssa; + $$055 = $$039$lcssa; + $$153 = $$038$lcssa; + while (1) { + $22 = HEAP32[$$055 >> 2] | 0; + if (($22 & -2139062144 ^ -2139062144) & $22 + -16843009 | 0) { + $$0$lcssa = $$055; + $$037$lcssa = $$03754; + $$1$lcssa = $$153; + break L11; + } + HEAP32[$$03754 >> 2] = $22; + $28 = $$153 + -4 | 0; + $29 = $$055 + 4 | 0; + $30 = $$03754 + 4 | 0; + if ($28 >>> 0 > 3) { + $$03754 = $30; + $$055 = $29; + $$153 = $28; + } else { + $$0$lcssa = $29; + $$037$lcssa = $30; + $$1$lcssa = $28; + break; + } + } + } else { + $$0$lcssa = $$039$lcssa; + $$037$lcssa = $$042$lcssa; + $$1$lcssa = $$038$lcssa; + } while (0); + $$140 = $$0$lcssa; + $$143 = $$037$lcssa; + $$2 = $$1$lcssa; + label = 13; + } else { + $$345 = $$042$lcssa; + $$4 = 0; + } + } else { + $$140 = $1; + $$143 = $0; + $$2 = $2; + label = 13; + } while (0); + L17 : do if ((label | 0) == 13) if (!$$2) { + $$345 = $$143; + $$4 = 0; + } else { + $$24147 = $$140; + $$24446 = $$143; + $$348 = $$2; + while (1) { + $33 = HEAP8[$$24147 >> 0] | 0; + HEAP8[$$24446 >> 0] = $33; + if (!($33 << 24 >> 24)) { + $$345 = $$24446; + $$4 = $$348; + break L17; + } + $$348 = $$348 + -1 | 0; + $37 = $$24446 + 1 | 0; + if (!$$348) { + $$345 = $37; + $$4 = 0; + break; + } else { + $$24147 = $$24147 + 1 | 0; + $$24446 = $37; + } + } + } while (0); + _memset($$345 | 0, 0, $$4 | 0) | 0; + return $$345 | 0; +} + +function _arPattGetIDGlobal($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = +$9; + $10 = $10 | 0; + $11 = $11 | 0; + $12 = $12 | 0; + $13 = $13 | 0; + $14 = $14 | 0; + $15 = $15 | 0; + $16 = $16 | 0; + $17 = $17 | 0; + $18 = $18 | 0; + var $$0 = 0, $$091 = 0, $$092 = 0, $19 = 0, $20 = 0, $24 = 0, $26 = 0, $28 = 0, $31 = 0, $41 = 0, $45 = 0, $49 = 0, $51 = 0, $56 = 0, $57 = 0, $58 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 12304 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(12304); + $19 = sp; + $20 = sp + 12288 | 0; + do if (($2 + -2 | 0) >>> 0 < 3) { + if (($16 | 0) != 2830) { + $45 = $16 & 255; + if ((_arPattGetImage2($1, 2, $45, $45 * 3 | 0, $3, $4, $5, $6, $7, $8, $9, $19) | 0) < 0) { + HEAP32[$13 >> 2] = -1; + $$091 = -6; + break; + } + $49 = _get_matrix_code($19, $45, $13, $14, $15, $16, $17) | 0; + if (!$18) { + $$091 = $49; + break; + } + $51 = $18; + HEAP32[$51 >> 2] = 0; + HEAP32[$51 + 4 >> 2] = 0; + $$091 = $49; + break; + } + if ((_arPattGetImage2($1, 2, 14, 42, $3, $4, $5, $6, $7, $8, .875, $19) | 0) < 0) { + HEAP32[$13 >> 2] = -1; + $$091 = -6; + break; + } + $24 = _get_global_id_code($19, $20, $14, $15, $17) | 0; + if (($24 | 0) < 0) { + HEAP32[$13 >> 2] = -1; + $$091 = $24; + break; + } + $26 = $20; + $28 = HEAP32[$26 >> 2] | 0; + $31 = HEAP32[$26 + 4 >> 2] | 0; + if (($28 | 0) == -1 & ($31 | 0) == -1) { + HEAP32[$13 >> 2] = -1; + $$091 = -5; + break; + } + HEAP32[$13 >> 2] = ($28 & -32768 | 0) == 0 & 0 == 0 ? $28 & 32767 : 0; + if (!$18) $$091 = $24; else { + $41 = $18; + HEAP32[$41 >> 2] = $28; + HEAP32[$41 + 4 >> 2] = $31; + $$091 = $24; + } + } else $$091 = 1; while (0); + L21 : do switch ($2 | 0) { + case 0: + case 1: + case 3: + case 4: + { + if (!$0) { + HEAP32[$10 >> 2] = -1; + $$0 = -1; + break L21; + } + $56 = $0 + 28 | 0; + $57 = HEAP32[$56 >> 2] | 0; + $58 = $57 << 2; + switch ($2 | 0) { + case 0: + case 3: + { + if ((_arPattGetImage2($1, 0, $57, $58, $3, $4, $5, $6, $7, $8, $9, $19) | 0) < 0) { + HEAP32[$10 >> 2] = -1; + $$0 = -6; + break L21; + } else { + $$0 = _pattern_match($0, 0, $19, HEAP32[$56 >> 2] | 0, $10, $11, $12) | 0; + break L21; + } + break; + } + default: + if ((_arPattGetImage2($1, 1, $57, $58, $3, $4, $5, $6, $7, $8, $9, $19) | 0) < 0) { + HEAP32[$10 >> 2] = -1; + $$0 = -6; + break L21; + } else { + $$0 = _pattern_match($0, 1, $19, HEAP32[$56 >> 2] | 0, $10, $11, $12) | 0; + break L21; + } + } + break; + } + default: + $$0 = 1; + } while (0); + if (($$091 | 0) == 1) $$092 = $$0; else $$092 = ($$0 | 0) == 1 ? $$091 : ($$0 & $$091 | 0) < 0 ? $$0 : 0; + STACKTOP = sp; + return $$092 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle11PointerType9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy4 = 0, $14 = 0, $2 = 0, $23 = 0, $25 = 0, $3 = 0, $30 = 0, $31 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $$byval_copy4 = sp + 48 | 0; + $2 = sp + 40 | 0; + $3 = sp + 32 | 0; + $4 = sp + 24 | 0; + $5 = sp + 16 | 0; + $6 = sp; + $7 = sp + 8 | 0; + $8 = $0 + 8 | 0; + $9 = HEAP32[$8 >> 2] | 0; + do if ((__ZNK12_GLOBAL__N_116itanium_demangle4Node7getKindEv($9) | 0) << 24 >> 24 == 10) if (__ZNK12_GLOBAL__N_116itanium_demangle13ObjCProtoName12isObjCObjectEv($9) | 0) { + $23 = HEAP32[$8 >> 2] | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 52039); + HEAP32[$$byval_copy4 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy4 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy4); + $25 = $23 + 12 | 0; + $30 = HEAP32[$25 + 4 >> 2] | 0; + $31 = $6; + HEAP32[$31 >> 2] = HEAP32[$25 >> 2]; + HEAP32[$31 + 4 >> 2] = $30; + HEAP32[$$byval_copy4 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy4 + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy4); + __ZN12_GLOBAL__N_110StringViewC2EPKc($7, 52043); + HEAP32[$$byval_copy4 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$$byval_copy4 + 4 >> 2] = HEAP32[$7 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy4); + break; + } else { + $14 = HEAP32[$8 >> 2] | 0; + label = 4; + break; + } else { + $14 = $9; + label = 4; + } while (0); + if ((label | 0) == 4) { + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$14 >> 2] | 0) + 16 >> 2] & 255]($14, $1); + if (__ZNK12_GLOBAL__N_116itanium_demangle4Node8hasArrayERNS_12OutputStreamE(HEAP32[$8 >> 2] | 0, $1) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51966); + HEAP32[$$byval_copy4 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy4 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy4); + } + if (!(__ZNK12_GLOBAL__N_116itanium_demangle4Node8hasArrayERNS_12OutputStreamE(HEAP32[$8 >> 2] | 0, $1) | 0) ? !(__ZNK12_GLOBAL__N_116itanium_demangle4Node11hasFunctionERNS_12OutputStreamE(HEAP32[$8 >> 2] | 0, $1) | 0) : 0) {} else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 51968); + HEAP32[$$byval_copy4 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy4 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy4); + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 52037); + HEAP32[$$byval_copy4 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy4 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy4); + } + STACKTOP = sp; + return; +} + +function _mbsnrtowcs($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$04975 = 0, $$05374 = 0, $$056 = 0, $$150 = 0, $$154 = 0, $$15773 = 0, $$164 = 0, $$176 = 0, $$2 = 0, $$25170 = 0, $$25569 = 0, $$258 = 0, $$352 = 0, $$359 = 0, $$371 = 0, $$468 = 0, $$cast = 0, $11 = 0, $12 = 0, $15 = 0, $16 = 0, $18 = 0, $21 = 0, $22 = 0, $26 = 0, $30 = 0, $31 = 0, $39 = 0, $44 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $spec$select = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 1040 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(1040); + $5 = sp; + $6 = sp + 1024 | 0; + $7 = HEAP32[$1 >> 2] | 0; + HEAP32[$6 >> 2] = $7; + $8 = ($0 | 0) != 0; + $$056 = $8 ? $3 : 256; + $$0 = $8 ? $0 : $5; + $$cast = $7; + L1 : do if (($$056 | 0) != 0 & ($7 | 0) != 0) { + $$04975 = 0; + $$05374 = $2; + $$15773 = $$056; + $$176 = $$0; + $44 = $$cast; + while (1) { + $11 = $$05374 >>> 2; + $12 = $11 >>> 0 >= $$15773 >>> 0; + if (!($$05374 >>> 0 > 131 | $12)) { + $$150 = $$04975; + $$154 = $$05374; + $$164 = $$176; + $$359 = $$15773; + $26 = $44; + break L1; + } + $spec$select = $12 ? $$15773 : $11; + $15 = $$05374 - $spec$select | 0; + $16 = _mbsrtowcs($$176, $6, $spec$select, $4) | 0; + if (($16 | 0) == -1) break; + $18 = ($$176 | 0) == ($5 | 0); + $$258 = $$15773 - ($18 ? 0 : $16) | 0; + $$2 = $18 ? $$176 : $$176 + ($16 << 2) | 0; + $21 = $16 + $$04975 | 0; + $22 = HEAP32[$6 >> 2] | 0; + if (($$258 | 0) != 0 & ($22 | 0) != 0) { + $$04975 = $21; + $$05374 = $15; + $$15773 = $$258; + $$176 = $$2; + $44 = $22; + } else { + $$150 = $21; + $$154 = $15; + $$164 = $$2; + $$359 = $$258; + $26 = $22; + break L1; + } + } + $$150 = -1; + $$154 = $15; + $$164 = $$176; + $$359 = 0; + $26 = HEAP32[$6 >> 2] | 0; + } else { + $$150 = 0; + $$154 = $2; + $$164 = $$0; + $$359 = $$056; + $26 = $$cast; + } while (0); + L9 : do if (($26 | 0) != 0 ? ($$359 | 0) != 0 & ($$154 | 0) != 0 : 0) { + $$25170 = $$150; + $$25569 = $$154; + $$371 = $$164; + $$468 = $$359; + $30 = $26; + while (1) { + $31 = _mbrtowc($$371, $30, $$25569, $4) | 0; + if (($31 + 2 | 0) >>> 0 < 3) break; + $30 = (HEAP32[$6 >> 2] | 0) + $31 | 0; + HEAP32[$6 >> 2] = $30; + $$25569 = $$25569 - $31 | 0; + $$468 = $$468 + -1 | 0; + $39 = $$25170 + 1 | 0; + if (!(($$468 | 0) != 0 & ($$25569 | 0) != 0)) { + $$352 = $39; + break L9; + } else { + $$25170 = $39; + $$371 = $$371 + 4 | 0; + } + } + switch ($31 | 0) { + case -1: + { + $$352 = $31; + break L9; + break; + } + case 0: + { + HEAP32[$6 >> 2] = 0; + $$352 = $$25170; + break L9; + break; + } + default: + { + HEAP32[$4 >> 2] = 0; + $$352 = $$25170; + break L9; + } + } + } else $$352 = $$150; while (0); + if ($8) HEAP32[$1 >> 2] = HEAP32[$6 >> 2]; + STACKTOP = sp; + return $$352 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle16FunctionEncoding10printRightERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy6 = 0, $11 = 0, $16 = 0, $17 = 0, $2 = 0, $21 = 0, $24 = 0, $29 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $$byval_copy6 = sp + 56 | 0; + $2 = sp + 48 | 0; + $3 = sp + 40 | 0; + $4 = sp + 32 | 0; + $5 = sp + 24 | 0; + $6 = sp + 16 | 0; + $7 = sp + 8 | 0; + $8 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51968); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray14printWithCommaERNS_12OutputStreamE($0 + 16 | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 51964); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + $11 = HEAP32[$0 + 8 >> 2] | 0; + if ($11 | 0) FUNCTION_TABLE_vii[HEAP32[(HEAP32[$11 >> 2] | 0) + 20 >> 2] & 255]($11, $1); + $16 = $0 + 28 | 0; + $17 = HEAP32[$16 >> 2] | 0; + if (!($17 & 1)) $21 = $17; else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 56136); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + $21 = HEAP32[$16 >> 2] | 0; + } + if (!($21 & 2)) $24 = $21; else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 56143); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + $24 = HEAP32[$16 >> 2] | 0; + } + if ($24 & 4 | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($6, 56153); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + } + switch (HEAP8[$0 + 32 >> 0] | 0) { + case 1: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($7, 56338); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$7 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + break; + } + case 2: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($8, 56341); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$8 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + break; + } + default: + {} + } + $29 = HEAP32[$0 + 24 >> 2] | 0; + if ($29 | 0) __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE($29, $1); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E18parseFunctionParamEv($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$2 = 0, $$byval_copy1 = 0, $1 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 16 | 0; + $1 = sp + 8 | 0; + $2 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($1, 54911); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$1 + 4 >> 2]; + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy1) | 0)) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 54914); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + if ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy1) | 0 ? (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E11parseNumberEb($$byval_copy1, $0, 0), !(__ZNK12_GLOBAL__N_110StringView5emptyEv($$byval_copy1) | 0)) : 0) ? __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 112) | 0 : 0) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseCVQualifiersEv($0) | 0; + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E11parseNumberEb($$byval_copy1, $0, 0); + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) $$1 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13FunctionParamEJRNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $$byval_copy1) | 0; else $$1 = 0; + $$2 = $$1; + } else $$2 = 0; + } else { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseCVQualifiersEv($0) | 0; + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E11parseNumberEb($$byval_copy1, $0, 0); + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13FunctionParamEJRNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $$byval_copy1) | 0; else $$0 = 0; + $$2 = $$0; + } + STACKTOP = sp; + return $$2 | 0; +} + +function __ZN6vision18BinomialPyramid32f12apply_filterERNS_5ImageERKS1_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $16 = 0, $20 = 0, $22 = 0, $24 = 0, $25 = 0, $28 = 0, $3 = 0, $30 = 0, $31 = 0, $34 = 0, $36 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + if ((__ZNK6vision5Image4typeEv($1) | 0) != 2) { + $11 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 31711) | 0, 31153) | 0, 39072) | 0, 357) | 0, 39079) | 0, 31758) | 0; + __ZNKSt3__28ios_base6getlocEv($3, $11 + (HEAP32[(HEAP32[$11 >> 2] | 0) + -12 >> 2] | 0) | 0); + $16 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66512) | 0; + $20 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$16 >> 2] | 0) + 28 >> 2] & 127]($16, 10) | 0; + __ZNSt3__26localeD2Ev($3); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($11, $20) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($11) | 0; + _abort(); + } + switch (__ZNK6vision5Image4typeEv($2) | 0) { + case 1: + { + $22 = __ZN6vision5Image3getEv($1) | 0; + $24 = HEAP32[$0 + 32 >> 2] | 0; + $25 = __ZNK6vision5Image3getEv($2) | 0; + __ZN6vision18binomial_4th_orderEPfPtPKhmm($22, $24, $25, __ZNK6vision5Image5widthEv($2) | 0, __ZNK6vision5Image6heightEv($2) | 0); + break; + } + case 2: + { + $28 = __ZN6vision5Image3getEv($1) | 0; + $30 = HEAP32[$0 + 44 >> 2] | 0; + $31 = __ZNK6vision5Image3getEv($2) | 0; + __ZN6vision18binomial_4th_orderEPfS0_PKfmm($28, $30, $31, __ZNK6vision5Image5widthEv($2) | 0, __ZNK6vision5Image6heightEv($2) | 0); + break; + } + case 0: + { + $34 = ___cxa_allocate_exception(16) | 0; + HEAP32[$3 >> 2] = 0; + HEAP32[$3 + 4 >> 2] = 0; + HEAP32[$3 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm($3, 31794, __ZNSt3__211char_traitsIcE6lengthEPKc(31794) | 0); + __ZN6vision9ExceptionC2ERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE($34, $3); + ___cxa_throw($34 | 0, 13208, 5); + break; + } + default: + { + $36 = ___cxa_allocate_exception(16) | 0; + HEAP32[$3 >> 2] = 0; + HEAP32[$3 + 4 >> 2] = 0; + HEAP32[$3 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm($3, 31813, __ZNSt3__211char_traitsIcE6lengthEPKc(31813) | 0); + __ZN6vision9ExceptionC2ERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE($36, $3); + ___cxa_throw($36 | 0, 13208, 5); + } + } + STACKTOP = sp; + return; +} + +function __ZNSt3__27__sort3IRNS_7greaterINS_4pairIfmEEEENS_11__wrap_iterIPS3_EEEEjT0_S9_S9_T_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$09 = 0, $$phi$trans$insert = 0, $$phi$trans$insert16 = 0, $$pre$phi18Z2D = 0, $$pre$phiZ2D = 0, $15 = 0, $16 = 0.0, $24 = 0, $25 = 0, $26 = 0, $28 = 0.0, $29 = 0.0, $32 = 0, $33 = 0, $34 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $42 = 0, $43 = 0, $44 = 0, $46 = 0.0, $49 = 0, $5 = 0, $50 = 0, $52 = 0, $53 = 0, $54 = 0, $6 = 0.0, $7 = 0.0; + $4 = HEAP32[$1 >> 2] | 0; + $5 = HEAP32[$0 >> 2] | 0; + $6 = +HEAPF32[$5 >> 2]; + $7 = +HEAPF32[$4 >> 2]; + if (!($6 < $7)) if ($7 < $6) $53 = 0; else $53 = (HEAP32[$5 + 4 >> 2] | 0) >>> 0 < (HEAP32[$4 + 4 >> 2] | 0) >>> 0; else $53 = 1; + $15 = HEAP32[$2 >> 2] | 0; + $16 = +HEAPF32[$15 >> 2]; + if (!($7 < $16)) if ($16 < $7) $54 = 0; else $54 = (HEAP32[$4 + 4 >> 2] | 0) >>> 0 < (HEAP32[$15 + 4 >> 2] | 0) >>> 0; else $54 = 1; + do if (!$53) if ($54) { + HEAPF32[$4 >> 2] = $16; + HEAPF32[$15 >> 2] = $7; + $24 = $4 + 4 | 0; + $25 = $15 + 4 | 0; + $26 = HEAP32[$24 >> 2] | 0; + HEAP32[$24 >> 2] = HEAP32[$25 >> 2]; + HEAP32[$25 >> 2] = $26; + $28 = +HEAPF32[$5 >> 2]; + $29 = +HEAPF32[$4 >> 2]; + if (!($28 < $29)) { + if ($29 < $28) { + $$09 = 1; + break; + } + $32 = $5 + 4 | 0; + $33 = HEAP32[$32 >> 2] | 0; + $34 = HEAP32[$24 >> 2] | 0; + if ($33 >>> 0 < $34 >>> 0) { + $$pre$phi18Z2D = $32; + $36 = $34; + $37 = $33; + } else { + $$09 = 1; + break; + } + } else { + $$phi$trans$insert = $5 + 4 | 0; + $$pre$phi18Z2D = $$phi$trans$insert; + $36 = HEAP32[$24 >> 2] | 0; + $37 = HEAP32[$$phi$trans$insert >> 2] | 0; + } + HEAPF32[$5 >> 2] = $29; + HEAPF32[$4 >> 2] = $28; + HEAP32[$$pre$phi18Z2D >> 2] = $36; + HEAP32[$24 >> 2] = $37; + $$09 = 2; + } else $$09 = 0; else { + if ($54) { + HEAPF32[$5 >> 2] = $16; + HEAPF32[$15 >> 2] = $6; + $38 = $5 + 4 | 0; + $39 = $15 + 4 | 0; + $40 = HEAP32[$38 >> 2] | 0; + HEAP32[$38 >> 2] = HEAP32[$39 >> 2]; + HEAP32[$39 >> 2] = $40; + $$09 = 1; + break; + } + HEAPF32[$5 >> 2] = $7; + HEAPF32[$4 >> 2] = $6; + $42 = $5 + 4 | 0; + $43 = $4 + 4 | 0; + $44 = HEAP32[$42 >> 2] | 0; + HEAP32[$42 >> 2] = HEAP32[$43 >> 2]; + HEAP32[$43 >> 2] = $44; + $46 = +HEAPF32[$15 >> 2]; + if (!($6 < $46)) { + if ($46 < $6) { + $$09 = 1; + break; + } + $49 = $15 + 4 | 0; + $50 = HEAP32[$49 >> 2] | 0; + if ($44 >>> 0 < $50 >>> 0) { + $$pre$phiZ2D = $49; + $52 = $50; + } else { + $$09 = 1; + break; + } + } else { + $$phi$trans$insert16 = $15 + 4 | 0; + $$pre$phiZ2D = $$phi$trans$insert16; + $52 = HEAP32[$$phi$trans$insert16 >> 2] | 0; + } + HEAPF32[$4 >> 2] = $46; + HEAPF32[$15 >> 2] = $6; + HEAP32[$43 >> 2] = $52; + HEAP32[$$pre$phiZ2D >> 2] = $44; + $$09 = 2; + } while (0); + return $$09 | 0; +} + +function __Z21kpmUtilGetPose_binaryP9ARParamLTRKNSt3__26vectorIN6vision7match_tENS1_9allocatorIS4_EEEERKNS2_INS3_7Point3dIfEENS5_ISB_EEEERKNS2_INS3_12FeaturePointENS5_ISG_EEEEPA4_fPf($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$064 = 0, $$065 = 0, $$066 = 0, $$1 = 0, $10 = 0, $13 = 0, $14 = 0, $15 = 0, $17 = 0, $19 = 0, $22 = 0, $24 = 0, $25 = 0, $27 = 0, $37 = 0, $50 = 0, $53 = 0, $58 = 0.0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 240 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(240); + $vararg_buffer1 = sp + 208 | 0; + $vararg_buffer = sp + 200 | 0; + $6 = sp + 224 | 0; + $7 = sp + 212 | 0; + $8 = sp + 96 | 0; + $9 = sp + 192 | 0; + $10 = sp; + $13 = HEAP32[$1 >> 2] | 0; + $14 = (HEAP32[$1 + 4 >> 2] | 0) - $13 | 0; + $15 = $14 >> 3; + $17 = $13; + do if ($15 >>> 0 < 4) $$1 = -1; else { + $19 = _malloc($14 << 1) | 0; + if (!$19) { + _arLog(0, 3, 45930, $vararg_buffer); + _exit(1); + } + $22 = _malloc($15 * 24 | 0) | 0; + if (!$22) { + _arLog(0, 3, 45930, $vararg_buffer1); + _exit(1); + } + $24 = HEAP32[$3 >> 2] | 0; + $25 = HEAP32[$2 >> 2] | 0; + $$065 = 0; + while (1) { + if (($$065 | 0) == ($15 | 0)) break; + $27 = HEAP32[$17 + ($$065 << 3) >> 2] | 0; + HEAPF64[$19 + ($$065 << 4) >> 3] = +HEAPF32[$24 + ($27 * 20 | 0) >> 2]; + HEAPF64[$19 + ($$065 << 4) + 8 >> 3] = +HEAPF32[$24 + ($27 * 20 | 0) + 4 >> 2]; + $37 = HEAP32[$17 + ($$065 << 3) + 4 >> 2] | 0; + HEAPF64[$22 + ($$065 * 24 | 0) >> 3] = +HEAPF32[$25 + ($37 * 12 | 0) >> 2]; + HEAPF64[$22 + ($$065 * 24 | 0) + 8 >> 3] = +HEAPF32[$25 + ($37 * 12 | 0) + 4 >> 2]; + HEAPF64[$22 + ($$065 * 24 | 0) + 16 >> 3] = 0.0; + $$065 = $$065 + 1 | 0; + } + HEAP32[$7 + 8 >> 2] = $15; + HEAP32[$7 >> 2] = $19; + HEAP32[$7 + 4 >> 2] = $22; + $50 = $0 + 8 | 0; + if ((_icpGetInitXw2Xc_from_PlanarData($50, $19, $22, $15, $8) | 0) < 0) { + _free($19); + _free($22); + $$1 = -1; + break; + } + $53 = _icpCreateHandle($50) | 0; + HEAP32[$6 >> 2] = $53; + if (!$53) { + _free($19); + _free($22); + $$1 = -1; + break; + } + if ((_icpPoint($53, $7, $8, $10, $9) | 0) < 0) { + _free($19); + _free($22); + _icpDeleteHandle($6) | 0; + $$066 = -1; + } else { + $$064 = 0; + while (1) { + if (($$064 | 0) == 3) break; + $$0 = 0; + while (1) { + if (($$0 | 0) == 4) break; + HEAPF32[$4 + ($$064 << 4) + ($$0 << 2) >> 2] = +HEAPF64[$10 + ($$064 << 5) + ($$0 << 3) >> 3]; + $$0 = $$0 + 1 | 0; + } + $$064 = $$064 + 1 | 0; + } + _icpDeleteHandle($6) | 0; + _free($19); + _free($22); + $58 = +HEAPF64[$9 >> 3]; + HEAPF32[$5 >> 2] = $58; + $$066 = ($58 > 10.0) << 31 >> 31; + } + $$1 = $$066; + } while (0); + STACKTOP = sp; + return $$1 | 0; +} + +function __ZNSt3__2L12init_wmonthsEv() { + var $$0$i$i = 0, $4 = 0; + if ((HEAP8[64720] | 0) == 0 ? ___cxa_guard_acquire(64720) | 0 : 0) { + $4 = 63840; + do { + HEAP32[$4 >> 2] = 0; + HEAP32[$4 + 4 >> 2] = 0; + HEAP32[$4 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$4 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $4 = $4 + 12 | 0; + } while (($4 | 0) != 64128); + ___cxa_guard_release(64720); + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(63840, 21828) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(63852, 21860) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(63864, 21896) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(63876, 21920) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(63888, 21944) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(63900, 21960) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(63912, 21980) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(63924, 22e3) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(63936, 22028) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(63948, 22068) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(63960, 22100) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(63972, 22136) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(63984, 22172) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(63996, 22188) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64008, 22204) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64020, 22220) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64032, 21944) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64044, 22236) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64056, 22252) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64068, 22268) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64080, 22284) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64092, 22300) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64104, 22316) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64116, 22332) | 0; + return; +} + +function __ZNSt3__2L11init_monthsEv() { + var $$0$i$i = 0, $4 = 0; + if ((HEAP8[64640] | 0) == 0 ? ___cxa_guard_acquire(64640) | 0 : 0) { + $4 = 63344; + do { + HEAP32[$4 >> 2] = 0; + HEAP32[$4 + 4 >> 2] = 0; + HEAP32[$4 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$4 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $4 = $4 + 12 | 0; + } while (($4 | 0) != 63632); + ___cxa_guard_release(64640); + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63344, 59459) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63356, 59467) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63368, 59476) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63380, 59482) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63392, 59488) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63404, 59492) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63416, 59497) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63428, 59502) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63440, 59509) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63452, 59519) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63464, 59527) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63476, 59536) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63488, 59545) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63500, 59549) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63512, 59553) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63524, 59557) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63536, 59488) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63548, 59561) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63560, 59565) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63572, 59569) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63584, 59573) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63596, 59577) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63608, 59581) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63620, 59585) | 0; + return; +} + +function _jpeg_idct_4x2($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $110 = 0, $112 = 0, $114 = 0, $116 = 0, $118 = 0, $120 = 0, $122 = 0, $13 = 0, $19 = 0, $20 = 0, $22 = 0, $29 = 0, $35 = 0, $36 = 0, $37 = 0, $45 = 0, $5 = 0, $51 = 0, $52 = 0, $53 = 0, $61 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $71 = 0, $73 = 0, $74 = 0, $76 = 0, $78 = 0, $80 = 0, $82 = 0, $84 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $5 = sp; + $7 = HEAP32[$0 + 336 >> 2] | 0; + $9 = HEAP32[$1 + 84 >> 2] | 0; + $13 = Math_imul(HEAP32[$9 >> 2] | 0, HEAP16[$2 >> 1] | 0) | 0; + $19 = Math_imul(HEAP32[$9 + 32 >> 2] | 0, HEAP16[$2 + 16 >> 1] | 0) | 0; + $20 = $19 + $13 | 0; + HEAP32[$5 >> 2] = $20; + $22 = $5 + 16 | 0; + HEAP32[$22 >> 2] = $13 - $19; + $29 = Math_imul(HEAP32[$9 + 4 >> 2] | 0, HEAP16[$2 + 2 >> 1] | 0) | 0; + $35 = Math_imul(HEAP32[$9 + 36 >> 2] | 0, HEAP16[$2 + 18 >> 1] | 0) | 0; + $36 = $35 + $29 | 0; + HEAP32[$5 + 4 >> 2] = $36; + $37 = $29 - $35 | 0; + HEAP32[$5 + 20 >> 2] = $37; + $45 = Math_imul(HEAP32[$9 + 8 >> 2] | 0, HEAP16[$2 + 4 >> 1] | 0) | 0; + $51 = Math_imul(HEAP32[$9 + 40 >> 2] | 0, HEAP16[$2 + 20 >> 1] | 0) | 0; + $52 = $51 + $45 | 0; + HEAP32[$5 + 8 >> 2] = $52; + $53 = $45 - $51 | 0; + HEAP32[$5 + 24 >> 2] = $53; + $61 = Math_imul(HEAP32[$9 + 12 >> 2] | 0, HEAP16[$2 + 6 >> 1] | 0) | 0; + $67 = Math_imul(HEAP32[$9 + 44 >> 2] | 0, HEAP16[$2 + 22 >> 1] | 0) | 0; + $68 = $67 + $61 | 0; + HEAP32[$5 + 12 >> 2] = $68; + $69 = $61 - $67 | 0; + HEAP32[$5 + 28 >> 2] = $69; + $71 = $7 + -384 | 0; + $73 = (HEAP32[$3 >> 2] | 0) + $4 | 0; + $74 = $20 + 4100 | 0; + $76 = $74 + $52 << 13; + $78 = $74 - $52 << 13; + $80 = ($68 + $36 | 0) * 4433 | 0; + $82 = $80 + ($36 * 6270 | 0) | 0; + $84 = $80 + (Math_imul($68, -15137) | 0) | 0; + HEAP8[$73 >> 0] = HEAP8[$71 + (($82 + $76 | 0) >>> 16 & 1023) >> 0] | 0; + HEAP8[$73 + 3 >> 0] = HEAP8[$71 + (($76 - $82 | 0) >>> 16 & 1023) >> 0] | 0; + HEAP8[$73 + 1 >> 0] = HEAP8[$71 + (($84 + $78 | 0) >>> 16 & 1023) >> 0] | 0; + HEAP8[$73 + 2 >> 0] = HEAP8[$71 + (($78 - $84 | 0) >>> 16 & 1023) >> 0] | 0; + $110 = (HEAP32[$3 + 4 >> 2] | 0) + $4 | 0; + $112 = (HEAP32[$22 >> 2] | 0) + 4100 | 0; + $114 = $112 + $53 << 13; + $116 = $112 - $53 << 13; + $118 = ($69 + $37 | 0) * 4433 | 0; + $120 = $118 + ($37 * 6270 | 0) | 0; + $122 = $118 + (Math_imul($69, -15137) | 0) | 0; + HEAP8[$110 >> 0] = HEAP8[$71 + (($120 + $114 | 0) >>> 16 & 1023) >> 0] | 0; + HEAP8[$110 + 3 >> 0] = HEAP8[$71 + (($114 - $120 | 0) >>> 16 & 1023) >> 0] | 0; + HEAP8[$110 + 1 >> 0] = HEAP8[$71 + (($122 + $116 | 0) >>> 16 & 1023) >> 0] | 0; + HEAP8[$110 + 2 >> 0] = HEAP8[$71 + (($116 - $122 | 0) >>> 16 & 1023) >> 0] | 0; + STACKTOP = sp; + return; +} + +function _mbrtowc($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$03952 = 0, $$03952$pn = 0, $$04051 = 0, $$04350 = 0, $$2 = 0, $$lcssa = 0, $$lcssa56 = 0, $12 = 0, $18 = 0, $22 = 0, $26 = 0, $30 = 0, $31 = 0, $34 = 0, $35 = 0, $4 = 0, $43 = 0, $44 = 0, $47 = 0, $49 = 0, $51 = 0, $52 = 0, $53 = 0, $6 = 0, $60 = 0, $spec$select = 0, $spec$select47 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp; + $spec$select = ($3 | 0) == 0 ? 65400 : $3; + $6 = HEAP32[$spec$select >> 2] | 0; + L1 : do if (!$1) if (!$6) $$0 = 0; else label = 19; else { + $spec$select47 = ($0 | 0) == 0 ? $4 : $0; + if (!$2) $$0 = -2; else { + if (!$6) { + $12 = HEAP8[$1 >> 0] | 0; + if ($12 << 24 >> 24 > -1) { + HEAP32[$spec$select47 >> 2] = $12 & 255; + $$0 = $12 << 24 >> 24 != 0 & 1; + break; + } + $18 = (___pthread_self_414() | 0) + 188 | 0; + $22 = HEAP8[$1 >> 0] | 0; + if (!(HEAP32[HEAP32[$18 >> 2] >> 2] | 0)) { + HEAP32[$spec$select47 >> 2] = $22 << 24 >> 24 & 57343; + $$0 = 1; + break; + } + $26 = ($22 & 255) + -194 | 0; + if ($26 >>> 0 > 50) { + label = 19; + break; + } + $30 = HEAP32[5728 + ($26 << 2) >> 2] | 0; + $31 = $2 + -1 | 0; + if (!$31) $$2 = $30; else { + $$03952 = $1 + 1 | 0; + $$04051 = $30; + $$04350 = $31; + label = 11; + } + } else { + $$03952 = $1; + $$04051 = $6; + $$04350 = $2; + label = 11; + } + L14 : do if ((label | 0) == 11) { + $34 = HEAPU8[$$03952 >> 0] | 0; + $35 = $34 >>> 3; + if (($35 + -16 | $35 + ($$04051 >> 26)) >>> 0 > 7) { + label = 19; + break L1; + } + $43 = $34 + -128 | $$04051 << 6; + $44 = $$04350 + -1 | 0; + if (($43 | 0) < 0) { + $$03952$pn = $$03952; + $47 = $43; + $53 = $44; + while (1) { + $$03952$pn = $$03952$pn + 1 | 0; + if (!$53) { + $$2 = $47; + break L14; + } + $49 = HEAP8[$$03952$pn >> 0] | 0; + if (($49 & -64) << 24 >> 24 != -128) { + label = 19; + break L1; + } + $51 = ($49 & 255) + -128 | $47 << 6; + $52 = $53 + -1 | 0; + if (($51 | 0) >= 0) { + $$lcssa = $52; + $$lcssa56 = $51; + break; + } else { + $47 = $51; + $53 = $52; + } + } + } else { + $$lcssa = $44; + $$lcssa56 = $43; + } + HEAP32[$spec$select >> 2] = 0; + HEAP32[$spec$select47 >> 2] = $$lcssa56; + $$0 = $2 - $$lcssa | 0; + break L1; + } while (0); + HEAP32[$spec$select >> 2] = $$2; + $$0 = -2; + } + } while (0); + if ((label | 0) == 19) { + HEAP32[$spec$select >> 2] = 0; + $60 = ___errno_location() | 0; + HEAP32[$60 >> 2] = 25; + $$0 = -1; + } + STACKTOP = sp; + return $$0 | 0; +} + +function _next_marker($0) { + $0 = $0 | 0; + var $$0 = 0, $$058 = 0, $$064 = 0, $$1 = 0, $$159 = 0, $$2 = 0, $$260 = 0, $$26076 = 0, $$26078 = 0, $$275 = 0, $$277 = 0, $$3 = 0, $$361 = 0, $$4 = 0, $$4$ph = 0, $$462 = 0, $$462$ph = 0, $$5 = 0, $$563 = 0, $17 = 0, $2 = 0, $36 = 0, $4 = 0, $40 = 0, $41 = 0, $43 = 0, $45 = 0, $6 = 0, $7 = 0, label = 0; + $2 = HEAP32[$0 + 24 >> 2] | 0; + $4 = $2 + 4 | 0; + $6 = $2 + 12 | 0; + $7 = $0 + 464 | 0; + $$0 = HEAP32[$4 >> 2] | 0; + $$058 = HEAP32[$2 >> 2] | 0; + L1 : while (1) { + if (!$$0) { + if (!(FUNCTION_TABLE_ii[HEAP32[$6 >> 2] & 127]($0) | 0)) { + $$064 = 0; + label = 21; + break; + } + $$1 = HEAP32[$4 >> 2] | 0; + $$159 = HEAP32[$2 >> 2] | 0; + } else { + $$1 = $$0; + $$159 = $$058; + } + $$275 = $$1 + -1 | 0; + $$26076 = $$159 + 1 | 0; + if ((HEAP8[$$159 >> 0] | 0) == -1) { + $$4$ph = $$275; + $$462$ph = $$26076; + } else { + $$26078 = $$26076; + $$277 = $$275; + while (1) { + $17 = (HEAP32[$7 >> 2] | 0) + 24 | 0; + HEAP32[$17 >> 2] = (HEAP32[$17 >> 2] | 0) + 1; + HEAP32[$2 >> 2] = $$26078; + HEAP32[$4 >> 2] = $$277; + if (!$$277) { + if (!(FUNCTION_TABLE_ii[HEAP32[$6 >> 2] & 127]($0) | 0)) { + $$064 = 0; + label = 21; + break L1; + } + $$3 = HEAP32[$4 >> 2] | 0; + $$361 = HEAP32[$2 >> 2] | 0; + } else { + $$3 = $$277; + $$361 = $$26078; + } + $$2 = $$3 + -1 | 0; + $$260 = $$361 + 1 | 0; + if ((HEAP8[$$361 >> 0] | 0) == -1) { + $$4$ph = $$2; + $$462$ph = $$260; + break; + } else { + $$26078 = $$260; + $$277 = $$2; + } + } + } + $$4 = $$4$ph; + $$462 = $$462$ph; + do { + if (!$$4) { + if (!(FUNCTION_TABLE_ii[HEAP32[$6 >> 2] & 127]($0) | 0)) { + $$064 = 0; + label = 21; + break L1; + } + $$5 = HEAP32[$4 >> 2] | 0; + $$563 = HEAP32[$2 >> 2] | 0; + } else { + $$5 = $$4; + $$563 = $$462; + } + $$4 = $$5 + -1 | 0; + $$462 = $$563 + 1 | 0; + $36 = HEAP8[$$563 >> 0] | 0; + } while ($36 << 24 >> 24 == -1); + $40 = (HEAP32[$7 >> 2] | 0) + 24 | 0; + $41 = HEAP32[$40 >> 2] | 0; + if ($36 << 24 >> 24) { + label = 18; + break; + } + HEAP32[$40 >> 2] = $41 + 2; + HEAP32[$2 >> 2] = $$462; + HEAP32[$4 >> 2] = $$4; + $$0 = $$4; + $$058 = $$462; + } + if ((label | 0) == 18) { + $43 = $36 & 255; + if ($41 | 0) { + $45 = HEAP32[$0 >> 2] | 0; + HEAP32[$45 + 20 >> 2] = 119; + HEAP32[$45 + 24 >> 2] = $41; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = $43; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, -1); + HEAP32[(HEAP32[$7 >> 2] | 0) + 24 >> 2] = 0; + } + HEAP32[$0 + 440 >> 2] = $43; + HEAP32[$2 >> 2] = $$462; + HEAP32[$4 >> 2] = $$4; + $$064 = 1; + return $$064 | 0; + } else if ((label | 0) == 21) return $$064 | 0; + return 0; +} + +function __ZN6vision19FindHoughSimilarityERNS_21HoughSimilarityVotingERKNSt3__26vectorINS_12FeaturePointENS2_9allocatorIS4_EEEES9_RKNS3_INS_7match_tENS5_ISA_EEEEiiii($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $$065 = 0, $$cast = 0, $10 = 0, $11 = 0, $12 = 0, $22 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0.0, $31 = 0.0, $32 = 0.0, $34 = 0.0, $50 = 0, $52 = 0, $55 = 0, $57 = 0, $58 = 0, $69 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $8 = sp + 20 | 0; + $9 = sp + 8 | 0; + $10 = sp + 4 | 0; + $11 = sp; + $12 = $3 + 4 | 0; + __ZNSt3__26vectorIfNS_9allocatorIfEEEC2Em($8, (HEAP32[$12 >> 2] | 0) - (HEAP32[$3 >> 2] | 0) >> 1); + __ZNSt3__26vectorIfNS_9allocatorIfEEEC2Em($9, (HEAP32[$12 >> 2] | 0) - (HEAP32[$3 >> 2] | 0) >> 1); + $22 = HEAP32[$3 >> 2] | 0; + $24 = (HEAP32[$12 >> 2] | 0) - $22 >> 3; + $$cast = $22; + $25 = HEAP32[$1 >> 2] | 0; + $26 = HEAP32[$2 >> 2] | 0; + $27 = HEAP32[$8 >> 2] | 0; + $28 = HEAP32[$9 >> 2] | 0; + $$065 = 0; + while (1) { + if (($$065 | 0) == ($24 | 0)) break; + $52 = HEAP32[$$cast + ($$065 << 3) >> 2] | 0; + $55 = HEAP32[$$cast + ($$065 << 3) + 4 >> 2] | 0; + $57 = $$065 << 2; + $58 = $27 + ($57 << 2) | 0; + HEAP32[$58 >> 2] = HEAP32[$25 + ($52 * 20 | 0) >> 2]; + HEAP32[$58 + 4 >> 2] = HEAP32[$25 + ($52 * 20 | 0) + 4 >> 2]; + HEAP32[$58 + 8 >> 2] = HEAP32[$25 + ($52 * 20 | 0) + 8 >> 2]; + HEAP32[$58 + 12 >> 2] = HEAP32[$25 + ($52 * 20 | 0) + 12 >> 2]; + $69 = $28 + ($57 << 2) | 0; + HEAP32[$69 >> 2] = HEAP32[$26 + ($55 * 20 | 0) >> 2]; + HEAP32[$69 + 4 >> 2] = HEAP32[$26 + ($55 * 20 | 0) + 4 >> 2]; + HEAP32[$69 + 8 >> 2] = HEAP32[$26 + ($55 * 20 | 0) + 8 >> 2]; + HEAP32[$69 + 12 >> 2] = HEAP32[$26 + ($55 * 20 | 0) + 12 >> 2]; + $$065 = $$065 + 1 | 0; + } + $29 = +($4 | 0); + $31 = $29 * .20000000298023224 + $29; + $32 = +($5 | 0); + $34 = $32 * .20000000298023224 + $32; + __ZN6vision21HoughSimilarityVoting4initEffffiiii($0, -$31, $31, -$34, $34, 0, 0, 12, 10); + __ZN6vision21HoughSimilarityVoting26setObjectCenterInReferenceEff($0, +($6 >> 1 | 0), +($7 >> 1 | 0)); + __ZN6vision21HoughSimilarityVoting21setRefImageDimensionsEii($0, $6, $7); + __ZN6vision21HoughSimilarityVoting4voteEPKfS2_i($0, HEAP32[$8 >> 2] | 0, HEAP32[$9 >> 2] | 0, (HEAP32[$12 >> 2] | 0) - (HEAP32[$3 >> 2] | 0) >> 3); + __ZNK6vision21HoughSimilarityVoting23getMaximumNumberOfVotesERfRi($0, $10, $11); + $50 = +HEAPF32[$10 >> 2] < 3.0 ? -1 : HEAP32[$11 >> 2] | 0; + __ZNSt3__213__vector_baseIfNS_9allocatorIfEEED2Ev($9); + __ZNSt3__213__vector_baseIfNS_9allocatorIfEEED2Ev($8); + STACKTOP = sp; + return $50 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle7NewExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy6 = 0, $15 = 0, $19 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $$byval_copy6 = sp + 56 | 0; + $2 = sp + 48 | 0; + $3 = sp + 40 | 0; + $4 = sp + 32 | 0; + $5 = sp + 24 | 0; + $6 = sp + 16 | 0; + $7 = sp + 8 | 0; + $8 = sp; + if (HEAP8[$0 + 28 >> 0] | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 53288); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 53300); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + if (HEAP8[$0 + 29 >> 0] | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 53304); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + } + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 32); + $15 = $0 + 8 | 0; + if (!(__ZNK12_GLOBAL__N_116itanium_demangle9NodeArray5emptyEv($15) | 0)) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 51968); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray14printWithCommaERNS_12OutputStreamE($15, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($6, 51964); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + } + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 16 >> 2] | 0, $1); + $19 = $0 + 20 | 0; + if (!(__ZNK12_GLOBAL__N_116itanium_demangle9NodeArray5emptyEv($19) | 0)) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($7, 51968); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$7 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray14printWithCommaERNS_12OutputStreamE($19, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($8, 51964); + HEAP32[$$byval_copy6 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$$byval_copy6 + 4 >> 2] = HEAP32[$8 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy6); + } + STACKTOP = sp; + return; +} + +function __ZNSt3__2L20utf8_to_utf16_lengthEPKhS1_mmNS_12codecvt_modeE($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0100 = 0, $$194 = 0, $$194$ph = 0, $$2102 = 0, $$598 = 0, $$pre = 0, $21 = 0, $22 = 0, $33 = 0, $47 = 0, $49 = 0, $56 = 0, $76 = 0, $78 = 0, $80 = 0, $86 = 0, $89 = 0; + $$pre = $1; + if (((($4 & 4 | 0) != 0 ? ($$pre - $0 | 0) > 2 : 0) ? (HEAP8[$0 >> 0] | 0) == -17 : 0) ? (HEAP8[$0 + 1 >> 0] | 0) == -69 : 0) $$194$ph = (HEAP8[$0 + 2 >> 0] | 0) == -65 ? $0 + 3 | 0 : $0; else $$194$ph = $0; + $$0100 = 0; + $$194 = $$194$ph; + L7 : while (1) { + if (!($$0100 >>> 0 < $2 >>> 0 & $$194 >>> 0 < $1 >>> 0)) break; + $21 = HEAP8[$$194 >> 0] | 0; + $22 = $21 & 255; + if ($22 >>> 0 > $3 >>> 0) break; + do if ($21 << 24 >> 24 <= -1) { + if (($21 & 255) < 194) break L7; + if (($21 & 255) < 224) { + if (($$pre - $$194 | 0) < 2) break L7; + $33 = HEAPU8[$$194 + 1 >> 0] | 0; + if (($33 & 192 | 0) != 128) break L7; + if (($33 & 63 | $22 << 6 & 1984) >>> 0 > $3 >>> 0) break L7; else { + $$2102 = $$0100; + $$598 = $$194 + 2 | 0; + break; + } + } + if (($21 & 255) < 240) { + if (($$pre - $$194 | 0) < 3) break L7; + $47 = HEAP8[$$194 + 1 >> 0] | 0; + $49 = HEAP8[$$194 + 2 >> 0] | 0; + switch ($21 << 24 >> 24) { + case -32: + { + if (($47 & -32) << 24 >> 24 != -96) break L7; + break; + } + case -19: + { + if (($47 & -32) << 24 >> 24 != -128) break L7; + break; + } + default: + if (($47 & -64) << 24 >> 24 != -128) break L7; + } + $56 = $49 & 255; + if (($56 & 192 | 0) != 128) break L7; + if ((($47 & 63) << 6 | $22 << 12 & 61440 | $56 & 63) >>> 0 > $3 >>> 0) break L7; else { + $$2102 = $$0100; + $$598 = $$194 + 3 | 0; + break; + } + } + if (($21 & 255) >= 245) break L7; + if (($2 - $$0100 | 0) >>> 0 < 2 | ($$pre - $$194 | 0) < 4) break L7; + $76 = HEAP8[$$194 + 1 >> 0] | 0; + $78 = HEAP8[$$194 + 2 >> 0] | 0; + $80 = HEAP8[$$194 + 3 >> 0] | 0; + switch ($21 << 24 >> 24) { + case -16: + { + if (($76 + 112 & 255) >= 48) break L7; + break; + } + case -12: + { + if (($76 & -16) << 24 >> 24 != -128) break L7; + break; + } + default: + if (($76 & -64) << 24 >> 24 != -128) break L7; + } + $86 = $78 & 255; + if (($86 & 192 | 0) != 128) break L7; + $89 = $80 & 255; + if (($89 & 192 | 0) != 128) break L7; + if ((($76 & 63) << 12 | $22 << 18 & 1835008 | $86 << 6 & 4032 | $89 & 63) >>> 0 > $3 >>> 0) break L7; else { + $$2102 = $$0100 + 1 | 0; + $$598 = $$194 + 4 | 0; + } + } else { + $$2102 = $$0100; + $$598 = $$194 + 1 | 0; + } while (0); + $$0100 = $$2102 + 1 | 0; + $$194 = $$598; + } + return $$194 - $0 | 0; +} + +function _pop_arg($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $10 = 0, $100 = 0, $109 = 0, $11 = 0, $110 = 0.0, $17 = 0, $18 = 0, $21 = 0, $30 = 0, $31 = 0, $32 = 0, $41 = 0, $42 = 0, $44 = 0, $47 = 0, $48 = 0, $57 = 0, $58 = 0, $60 = 0, $63 = 0, $72 = 0, $73 = 0, $74 = 0, $83 = 0, $84 = 0, $86 = 0, $89 = 0, $98 = 0, $99 = 0; + L1 : do if ($1 >>> 0 <= 20) do switch ($1 | 0) { + case 9: + { + $10 = (HEAP32[$2 >> 2] | 0) + (4 - 1) & ~(4 - 1); + $11 = HEAP32[$10 >> 2] | 0; + HEAP32[$2 >> 2] = $10 + 4; + HEAP32[$0 >> 2] = $11; + break L1; + break; + } + case 10: + { + $17 = (HEAP32[$2 >> 2] | 0) + (4 - 1) & ~(4 - 1); + $18 = HEAP32[$17 >> 2] | 0; + HEAP32[$2 >> 2] = $17 + 4; + $21 = $0; + HEAP32[$21 >> 2] = $18; + HEAP32[$21 + 4 >> 2] = (($18 | 0) < 0) << 31 >> 31; + break L1; + break; + } + case 11: + { + $30 = (HEAP32[$2 >> 2] | 0) + (4 - 1) & ~(4 - 1); + $31 = HEAP32[$30 >> 2] | 0; + HEAP32[$2 >> 2] = $30 + 4; + $32 = $0; + HEAP32[$32 >> 2] = $31; + HEAP32[$32 + 4 >> 2] = 0; + break L1; + break; + } + case 12: + { + $41 = (HEAP32[$2 >> 2] | 0) + (8 - 1) & ~(8 - 1); + $42 = $41; + $44 = HEAP32[$42 >> 2] | 0; + $47 = HEAP32[$42 + 4 >> 2] | 0; + HEAP32[$2 >> 2] = $41 + 8; + $48 = $0; + HEAP32[$48 >> 2] = $44; + HEAP32[$48 + 4 >> 2] = $47; + break L1; + break; + } + case 13: + { + $57 = (HEAP32[$2 >> 2] | 0) + (4 - 1) & ~(4 - 1); + $58 = HEAP32[$57 >> 2] | 0; + HEAP32[$2 >> 2] = $57 + 4; + $60 = ($58 & 65535) << 16 >> 16; + $63 = $0; + HEAP32[$63 >> 2] = $60; + HEAP32[$63 + 4 >> 2] = (($60 | 0) < 0) << 31 >> 31; + break L1; + break; + } + case 14: + { + $72 = (HEAP32[$2 >> 2] | 0) + (4 - 1) & ~(4 - 1); + $73 = HEAP32[$72 >> 2] | 0; + HEAP32[$2 >> 2] = $72 + 4; + $74 = $0; + HEAP32[$74 >> 2] = $73 & 65535; + HEAP32[$74 + 4 >> 2] = 0; + break L1; + break; + } + case 15: + { + $83 = (HEAP32[$2 >> 2] | 0) + (4 - 1) & ~(4 - 1); + $84 = HEAP32[$83 >> 2] | 0; + HEAP32[$2 >> 2] = $83 + 4; + $86 = ($84 & 255) << 24 >> 24; + $89 = $0; + HEAP32[$89 >> 2] = $86; + HEAP32[$89 + 4 >> 2] = (($86 | 0) < 0) << 31 >> 31; + break L1; + break; + } + case 16: + { + $98 = (HEAP32[$2 >> 2] | 0) + (4 - 1) & ~(4 - 1); + $99 = HEAP32[$98 >> 2] | 0; + HEAP32[$2 >> 2] = $98 + 4; + $100 = $0; + HEAP32[$100 >> 2] = $99 & 255; + HEAP32[$100 + 4 >> 2] = 0; + break L1; + break; + } + case 17: + { + $109 = (HEAP32[$2 >> 2] | 0) + (8 - 1) & ~(8 - 1); + $110 = +HEAPF64[$109 >> 3]; + HEAP32[$2 >> 2] = $109 + 8; + HEAPF64[$0 >> 3] = $110; + break L1; + break; + } + case 18: + { + FUNCTION_TABLE_vii[$3 & 255]($0, $2); + break L1; + break; + } + default: + break L1; + } while (0); while (0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle10BinaryExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy5 = 0, $13 = 0, $18 = 0, $19 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $$byval_copy5 = sp + 56 | 0; + $2 = sp + 48 | 0; + $3 = sp + 40 | 0; + $4 = sp + 32 | 0; + $5 = sp; + $6 = sp + 24 | 0; + $7 = sp + 16 | 0; + $8 = sp + 8 | 0; + $9 = $0 + 12 | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy5, 52043); + if (__ZN12_GLOBAL__N_1eqERKNS_10StringViewES2_($9, $$byval_copy5) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51968); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 51968); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 54711); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + $13 = $9; + $18 = HEAP32[$13 + 4 >> 2] | 0; + $19 = $5; + HEAP32[$19 >> 2] = HEAP32[$13 >> 2]; + HEAP32[$19 + 4 >> 2] = $18; + HEAP32[$$byval_copy5 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + __ZN12_GLOBAL__N_110StringViewC2EPKc($6, 54714); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 20 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($7, 51964); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$7 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + __ZN12_GLOBAL__N_110StringViewC2EPKc($$byval_copy5, 52043); + if (__ZN12_GLOBAL__N_1eqERKNS_10StringViewES2_($9, $$byval_copy5) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($8, 51964); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$8 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + } + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E14parseArrayTypeEv($0) { + $0 = $0 | 0; + var $$1 = 0, $$2 = 0, $$3 = 0, $$byval_copy = 0, $1 = 0, $13 = 0, $2 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp + 16 | 0; + $1 = sp; + $2 = sp + 8 | 0; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 65) | 0) { + __ZN12_GLOBAL__N_116itanium_demangle12NodeOrStringC2Ev($1); + if ((((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24) + -48 | 0) >>> 0 < 10) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E11parseNumberEb($2, $0, 0); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle12NodeOrStringC2ENS_10StringViewE($1, $$byval_copy); + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) label = 8; else $$2 = 0; + } else if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0)) { + $9 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + if (($9 | 0) != 0 ? __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0 : 0) { + __ZN12_GLOBAL__N_116itanium_demangle12NodeOrStringC2EPNS0_4NodeE($1, $9); + label = 8; + } else $$2 = 0; + } else label = 8; + if ((label | 0) == 8) { + $13 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$$byval_copy >> 2] = $13; + if (!$13) $$1 = 0; else $$1 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_9ArrayTypeEJRPNS0_4NodeERNS0_12NodeOrStringEEEES9_DpOT0_($0, $$byval_copy, $1) | 0; + $$2 = $$1; + } + $$3 = $$2; + } else $$3 = 0; + STACKTOP = sp; + return $$3 | 0; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS5_EEEEEENS_22__unordered_map_hasherIiS9_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS9_NS_8equal_toIiEELb1EEENS6_IS9_EEE8__rehashEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$054$ph$ph = 0, $$055 = 0, $$056$ph = 0, $$056$ph$ph = 0, $$058 = 0, $13 = 0, $14 = 0, $2 = 0, $20 = 0, $21 = 0, $23 = 0, $29 = 0, $32 = 0, $37 = 0, $39 = 0, $42 = 0, $43 = 0, $5 = 0, $57 = 0, $7 = 0, $8 = 0; + $2 = $0 + 4 | 0; + L1 : do if ($1) { + if ($1 >>> 0 > 1073741823) { + $5 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($5, 41481); + HEAP32[$5 >> 2] = 17472; + ___cxa_throw($5 | 0, 13960, 22); + } + $7 = __Znwm($1 << 2) | 0; + $8 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $7; + if ($8 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($8, HEAP32[$0 + 4 >> 2] << 2); + HEAP32[$2 >> 2] = $1; + $$058 = 0; + while (1) { + if (($$058 | 0) == ($1 | 0)) break; + HEAP32[(HEAP32[$0 >> 2] | 0) + ($$058 << 2) >> 2] = 0; + $$058 = $$058 + 1 | 0; + } + $13 = $0 + 8 | 0; + $14 = HEAP32[$13 >> 2] | 0; + if ($14 | 0) { + $20 = HEAP32[$14 + 4 >> 2] | 0; + $21 = $1 + -1 | 0; + $23 = ($21 & $1 | 0) == 0; + if (!$23) if ($20 >>> 0 < $1 >>> 0) $29 = $20; else $29 = ($20 >>> 0) % ($1 >>> 0) | 0; else $29 = $20 & $21; + HEAP32[(HEAP32[$0 >> 2] | 0) + ($29 << 2) >> 2] = $13; + $$054$ph$ph = $29; + $$056$ph$ph = $14; + while (1) { + $$056$ph = $$056$ph$ph; + L25 : while (1) { + while (1) { + $$055 = HEAP32[$$056$ph >> 2] | 0; + if (!$$055) break L1; + $32 = HEAP32[$$055 + 4 >> 2] | 0; + if (!$23) if ($32 >>> 0 < $1 >>> 0) $37 = $32; else $37 = ($32 >>> 0) % ($1 >>> 0) | 0; else $37 = $32 & $21; + if (($37 | 0) == ($$054$ph$ph | 0)) break; + $39 = (HEAP32[$0 >> 2] | 0) + ($37 << 2) | 0; + if (!(HEAP32[$39 >> 2] | 0)) break L25; + $42 = $$055 + 8 | 0; + $$0 = $$055; + while (1) { + $43 = HEAP32[$$0 >> 2] | 0; + if (!$43) break; + if ((HEAP32[$42 >> 2] | 0) == (HEAP32[$43 + 8 >> 2] | 0)) $$0 = $43; else break; + } + HEAP32[$$056$ph >> 2] = $43; + HEAP32[$$0 >> 2] = HEAP32[HEAP32[(HEAP32[$0 >> 2] | 0) + ($37 << 2) >> 2] >> 2]; + HEAP32[HEAP32[(HEAP32[$0 >> 2] | 0) + ($37 << 2) >> 2] >> 2] = $$055; + } + $$056$ph = $$055; + } + HEAP32[$39 >> 2] = $$056$ph; + $$054$ph$ph = $37; + $$056$ph$ph = $$055; + } + } + } else { + $57 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = 0; + if ($57 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($57, HEAP32[$0 + 4 >> 2] << 2); + HEAP32[$2 >> 2] = 0; + } while (0); + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEEEENS_22__unordered_map_hasherIiS7_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS7_NS_8equal_toIiEELb1EEENS_9allocatorIS7_EEE8__rehashEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$054$ph$ph = 0, $$055 = 0, $$056$ph = 0, $$056$ph$ph = 0, $$058 = 0, $13 = 0, $14 = 0, $2 = 0, $20 = 0, $21 = 0, $23 = 0, $29 = 0, $32 = 0, $37 = 0, $39 = 0, $42 = 0, $43 = 0, $5 = 0, $57 = 0, $7 = 0, $8 = 0; + $2 = $0 + 4 | 0; + L1 : do if ($1) { + if ($1 >>> 0 > 1073741823) { + $5 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($5, 41481); + HEAP32[$5 >> 2] = 17472; + ___cxa_throw($5 | 0, 13960, 22); + } + $7 = __Znwm($1 << 2) | 0; + $8 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $7; + if ($8 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($8, HEAP32[$0 + 4 >> 2] << 2); + HEAP32[$2 >> 2] = $1; + $$058 = 0; + while (1) { + if (($$058 | 0) == ($1 | 0)) break; + HEAP32[(HEAP32[$0 >> 2] | 0) + ($$058 << 2) >> 2] = 0; + $$058 = $$058 + 1 | 0; + } + $13 = $0 + 8 | 0; + $14 = HEAP32[$13 >> 2] | 0; + if ($14 | 0) { + $20 = HEAP32[$14 + 4 >> 2] | 0; + $21 = $1 + -1 | 0; + $23 = ($21 & $1 | 0) == 0; + if (!$23) if ($20 >>> 0 < $1 >>> 0) $29 = $20; else $29 = ($20 >>> 0) % ($1 >>> 0) | 0; else $29 = $20 & $21; + HEAP32[(HEAP32[$0 >> 2] | 0) + ($29 << 2) >> 2] = $13; + $$054$ph$ph = $29; + $$056$ph$ph = $14; + while (1) { + $$056$ph = $$056$ph$ph; + L25 : while (1) { + while (1) { + $$055 = HEAP32[$$056$ph >> 2] | 0; + if (!$$055) break L1; + $32 = HEAP32[$$055 + 4 >> 2] | 0; + if (!$23) if ($32 >>> 0 < $1 >>> 0) $37 = $32; else $37 = ($32 >>> 0) % ($1 >>> 0) | 0; else $37 = $32 & $21; + if (($37 | 0) == ($$054$ph$ph | 0)) break; + $39 = (HEAP32[$0 >> 2] | 0) + ($37 << 2) | 0; + if (!(HEAP32[$39 >> 2] | 0)) break L25; + $42 = $$055 + 8 | 0; + $$0 = $$055; + while (1) { + $43 = HEAP32[$$0 >> 2] | 0; + if (!$43) break; + if ((HEAP32[$42 >> 2] | 0) == (HEAP32[$43 + 8 >> 2] | 0)) $$0 = $43; else break; + } + HEAP32[$$056$ph >> 2] = $43; + HEAP32[$$0 >> 2] = HEAP32[HEAP32[(HEAP32[$0 >> 2] | 0) + ($37 << 2) >> 2] >> 2]; + HEAP32[HEAP32[(HEAP32[$0 >> 2] | 0) + ($37 << 2) >> 2] >> 2] = $$055; + } + $$056$ph = $$055; + } + HEAP32[$39 >> 2] = $$056$ph; + $$054$ph$ph = $37; + $$056$ph$ph = $$055; + } + } + } else { + $57 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = 0; + if ($57 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($57, HEAP32[$0 + 4 >> 2] << 2); + HEAP32[$2 >> 2] = 0; + } while (0); + return; +} + +function _jinit_merged_upsampler($0) { + $0 = $0 | 0; + var $$03233$i = 0, $$03233$i23 = 0, $$034$i = 0, $$034$i22 = 0, $1 = 0, $11 = 0, $16 = 0, $21 = 0, $27 = 0, $30 = 0, $31 = 0, $32 = 0, $35 = 0, $36 = 0, $39 = 0, $4 = 0, $40 = 0, $43 = 0, $45 = 0, $46 = 0, $47 = 0, $5 = 0, $56 = 0, $59 = 0, $71 = 0, $74 = 0; + $1 = $0 + 4 | 0; + $4 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 48) | 0; + $5 = $0 + 476 | 0; + HEAP32[$5 >> 2] = $4; + HEAP32[$4 >> 2] = 189; + HEAP32[$4 + 8 >> 2] = 0; + $11 = Math_imul(HEAP32[$0 + 120 >> 2] | 0, HEAP32[$0 + 112 >> 2] | 0) | 0; + HEAP32[$4 + 40 >> 2] = $11; + $16 = $4 + 4 | 0; + if ((HEAP32[$0 + 320 >> 2] | 0) == 2) { + HEAP32[$16 >> 2] = 1; + HEAP32[$4 + 12 >> 2] = 9; + $21 = FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$1 >> 2] | 0) + 4 >> 2] & 63]($0, 1, $11) | 0; + HEAP32[$4 + 32 >> 2] = $21; + $32 = HEAP32[$5 >> 2] | 0; + } else { + HEAP32[$16 >> 2] = 2; + HEAP32[$4 + 12 >> 2] = 10; + HEAP32[$4 + 32 >> 2] = 0; + $32 = $4; + } + $27 = (HEAP32[$0 + 40 >> 2] | 0) == 7; + $30 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + $31 = $32 + 16 | 0; + HEAP32[$31 >> 2] = $30; + $35 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + $36 = $32 + 20 | 0; + HEAP32[$36 >> 2] = $35; + $39 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + $40 = $32 + 24 | 0; + HEAP32[$40 >> 2] = $39; + $43 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 1024) | 0; + HEAP32[$32 + 28 >> 2] = $43; + $45 = HEAP32[$31 >> 2] | 0; + $46 = HEAP32[$36 >> 2] | 0; + $47 = HEAP32[$40 >> 2] | 0; + if ($27) { + $$03233$i = 0; + $$034$i = -128; + while (1) { + HEAP32[$45 + ($$03233$i << 2) >> 2] = ($$034$i * 183763 | 0) + 32768 >> 16; + HEAP32[$46 + ($$03233$i << 2) >> 2] = ($$034$i * 232260 | 0) + 32768 >> 16; + $56 = Math_imul($$034$i, -93603) | 0; + HEAP32[$47 + ($$03233$i << 2) >> 2] = $56; + $59 = (Math_imul($$034$i, -45107) | 0) + 32768 | 0; + HEAP32[$43 + ($$03233$i << 2) >> 2] = $59; + $$03233$i = $$03233$i + 1 | 0; + if (($$03233$i | 0) == 256) break; else $$034$i = $$034$i + 1 | 0; + } + return; + } else { + $$03233$i23 = 0; + $$034$i22 = -128; + while (1) { + HEAP32[$45 + ($$03233$i23 << 2) >> 2] = ($$034$i22 * 91881 | 0) + 32768 >> 16; + HEAP32[$46 + ($$03233$i23 << 2) >> 2] = ($$034$i22 * 116130 | 0) + 32768 >> 16; + $71 = Math_imul($$034$i22, -46802) | 0; + HEAP32[$47 + ($$03233$i23 << 2) >> 2] = $71; + $74 = (Math_imul($$034$i22, -22553) | 0) + 32768 | 0; + HEAP32[$43 + ($$03233$i23 << 2) >> 2] = $74; + $$03233$i23 = $$03233$i23 + 1 | 0; + if (($$03233$i23 | 0) == 256) break; else $$034$i22 = $$034$i22 + 1 | 0; + } + return; + } +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE6removeENS_21__hash_const_iteratorIPNS_11__hash_nodeIS3_PvEEEE($agg$result, $this, $__p) { + $agg$result = $agg$result | 0; + $this = $this | 0; + $__p = $__p | 0; + var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $13 = 0, $2 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $__next_20$pre$phiZ2D = 0, $__p1_ = 0, $__pn$0 = 0, $__value_$i$i$i = 0, $arrayidx$i48 = 0, $cond3$i = 0, $cond3$i35 = 0, $cond3$i44 = 0, $cond3$i55 = 0, $sub$i49 = 0, $tobool$i51 = 0, label = 0; + $0 = HEAP32[$__p >> 2] | 0; + $1 = HEAP32[$this + 4 >> 2] | 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $sub$i49 = $1 + -1 | 0; + $tobool$i51 = ($sub$i49 & $1 | 0) == 0; + if (!$tobool$i51) if ($2 >>> 0 < $1 >>> 0) $cond3$i55 = $2; else $cond3$i55 = ($2 >>> 0) % ($1 >>> 0) | 0; else $cond3$i55 = $sub$i49 & $2; + $arrayidx$i48 = (HEAP32[$this >> 2] | 0) + ($cond3$i55 << 2) | 0; + $__pn$0 = HEAP32[$arrayidx$i48 >> 2] | 0; + while (1) { + $5 = HEAP32[$__pn$0 >> 2] | 0; + if (($5 | 0) == ($0 | 0)) break; else $__pn$0 = $5; + } + $__p1_ = $this + 8 | 0; + if (($__pn$0 | 0) != ($__p1_ | 0)) { + $6 = HEAP32[$__pn$0 + 4 >> 2] | 0; + if (!$tobool$i51) if ($6 >>> 0 < $1 >>> 0) $cond3$i44 = $6; else $cond3$i44 = ($6 >>> 0) % ($1 >>> 0) | 0; else $cond3$i44 = $6 & $sub$i49; + if (($cond3$i44 | 0) == ($cond3$i55 | 0)) $__next_20$pre$phiZ2D = $0; else label = 14; + } else label = 14; + do if ((label | 0) == 14) { + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) { + $8 = HEAP32[$7 + 4 >> 2] | 0; + if (!$tobool$i51) if ($8 >>> 0 < $1 >>> 0) $cond3$i35 = $8; else $cond3$i35 = ($8 >>> 0) % ($1 >>> 0) | 0; else $cond3$i35 = $8 & $sub$i49; + if (($cond3$i35 | 0) == ($cond3$i55 | 0)) { + $__next_20$pre$phiZ2D = $0; + break; + } + } + HEAP32[$arrayidx$i48 >> 2] = 0; + $__next_20$pre$phiZ2D = $0; + } while (0); + $9 = HEAP32[$__next_20$pre$phiZ2D >> 2] | 0; + $10 = $9; + if ($9) { + $11 = HEAP32[$9 + 4 >> 2] | 0; + if (!$tobool$i51) if ($11 >>> 0 < $1 >>> 0) $cond3$i = $11; else $cond3$i = ($11 >>> 0) % ($1 >>> 0) | 0; else $cond3$i = $11 & $sub$i49; + if (($cond3$i | 0) != ($cond3$i55 | 0)) { + HEAP32[(HEAP32[$this >> 2] | 0) + ($cond3$i << 2) >> 2] = $__pn$0; + $13 = HEAP32[$0 >> 2] | 0; + } else $13 = $10; + } else $13 = $10; + HEAP32[$__pn$0 >> 2] = $13; + HEAP32[$__next_20$pre$phiZ2D >> 2] = 0; + $__value_$i$i$i = $this + 12 | 0; + HEAP32[$__value_$i$i$i >> 2] = (HEAP32[$__value_$i$i$i >> 2] | 0) + -1; + HEAP32[$agg$result >> 2] = $0; + HEAP32[$agg$result + 4 >> 2] = $__p1_; + HEAP8[$agg$result + 8 >> 0] = 1; + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIiNS_9allocatorIiEEEEEENS_22__unordered_map_hasherIiS6_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS6_NS_8equal_toIiEELb1EEENS3_IS6_EEE8__rehashEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$054$ph$ph = 0, $$055 = 0, $$056$ph = 0, $$056$ph$ph = 0, $$058 = 0, $13 = 0, $14 = 0, $2 = 0, $20 = 0, $21 = 0, $23 = 0, $29 = 0, $32 = 0, $37 = 0, $39 = 0, $42 = 0, $43 = 0, $5 = 0, $57 = 0, $7 = 0, $8 = 0; + $2 = $0 + 4 | 0; + L1 : do if ($1) { + if ($1 >>> 0 > 1073741823) { + $5 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($5, 41481); + HEAP32[$5 >> 2] = 17472; + ___cxa_throw($5 | 0, 13960, 22); + } + $7 = __Znwm($1 << 2) | 0; + $8 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $7; + if ($8 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($8, HEAP32[$0 + 4 >> 2] << 2); + HEAP32[$2 >> 2] = $1; + $$058 = 0; + while (1) { + if (($$058 | 0) == ($1 | 0)) break; + HEAP32[(HEAP32[$0 >> 2] | 0) + ($$058 << 2) >> 2] = 0; + $$058 = $$058 + 1 | 0; + } + $13 = $0 + 8 | 0; + $14 = HEAP32[$13 >> 2] | 0; + if ($14 | 0) { + $20 = HEAP32[$14 + 4 >> 2] | 0; + $21 = $1 + -1 | 0; + $23 = ($21 & $1 | 0) == 0; + if (!$23) if ($20 >>> 0 < $1 >>> 0) $29 = $20; else $29 = ($20 >>> 0) % ($1 >>> 0) | 0; else $29 = $20 & $21; + HEAP32[(HEAP32[$0 >> 2] | 0) + ($29 << 2) >> 2] = $13; + $$054$ph$ph = $29; + $$056$ph$ph = $14; + while (1) { + $$056$ph = $$056$ph$ph; + L25 : while (1) { + while (1) { + $$055 = HEAP32[$$056$ph >> 2] | 0; + if (!$$055) break L1; + $32 = HEAP32[$$055 + 4 >> 2] | 0; + if (!$23) if ($32 >>> 0 < $1 >>> 0) $37 = $32; else $37 = ($32 >>> 0) % ($1 >>> 0) | 0; else $37 = $32 & $21; + if (($37 | 0) == ($$054$ph$ph | 0)) break; + $39 = (HEAP32[$0 >> 2] | 0) + ($37 << 2) | 0; + if (!(HEAP32[$39 >> 2] | 0)) break L25; + $42 = $$055 + 8 | 0; + $$0 = $$055; + while (1) { + $43 = HEAP32[$$0 >> 2] | 0; + if (!$43) break; + if ((HEAP32[$42 >> 2] | 0) == (HEAP32[$43 + 8 >> 2] | 0)) $$0 = $43; else break; + } + HEAP32[$$056$ph >> 2] = $43; + HEAP32[$$0 >> 2] = HEAP32[HEAP32[(HEAP32[$0 >> 2] | 0) + ($37 << 2) >> 2] >> 2]; + HEAP32[HEAP32[(HEAP32[$0 >> 2] | 0) + ($37 << 2) >> 2] >> 2] = $$055; + } + $$056$ph = $$055; + } + HEAP32[$39 >> 2] = $$056$ph; + $$054$ph$ph = $37; + $$056$ph$ph = $$055; + } + } + } else { + $57 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = 0; + if ($57 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($57, HEAP32[$0 + 4 >> 2] << 2); + HEAP32[$2 >> 2] = 0; + } while (0); + return; +} + +function _wcsnrtombs($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$04773 = 0, $$05172 = 0, $$054 = 0, $$148 = 0, $$152 = 0, $$15571 = 0, $$162 = 0, $$174 = 0, $$2 = 0, $$24968 = 0, $$25367 = 0, $$256 = 0, $$350 = 0, $$357 = 0, $$369 = 0, $$466 = 0, $$cast = 0, $11 = 0, $14 = 0, $15 = 0, $17 = 0, $20 = 0, $21 = 0, $25 = 0, $30 = 0, $31 = 0, $40 = 0, $45 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $spec$select = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 272 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(272); + $5 = sp; + $6 = sp + 256 | 0; + $7 = HEAP32[$1 >> 2] | 0; + HEAP32[$6 >> 2] = $7; + $8 = ($0 | 0) != 0; + $$054 = $8 ? $3 : 256; + $$0 = $8 ? $0 : $5; + $$cast = $7; + L1 : do if (($$054 | 0) != 0 & ($7 | 0) != 0) { + $$04773 = 0; + $$05172 = $2; + $$15571 = $$054; + $$174 = $$0; + $45 = $$cast; + while (1) { + $11 = $$05172 >>> 0 >= $$15571 >>> 0; + if (!($11 | $$05172 >>> 0 > 32)) { + $$148 = $$04773; + $$152 = $$05172; + $$162 = $$174; + $$357 = $$15571; + $25 = $45; + break L1; + } + $spec$select = $11 ? $$15571 : $$05172; + $14 = $$05172 - $spec$select | 0; + $15 = _wcsrtombs($$174, $6, $spec$select, 0) | 0; + if (($15 | 0) == -1) break; + $17 = ($$174 | 0) == ($5 | 0); + $$256 = $$15571 - ($17 ? 0 : $15) | 0; + $$2 = $17 ? $$174 : $$174 + $15 | 0; + $20 = $15 + $$04773 | 0; + $21 = HEAP32[$6 >> 2] | 0; + if (($$256 | 0) != 0 & ($21 | 0) != 0) { + $$04773 = $20; + $$05172 = $14; + $$15571 = $$256; + $$174 = $$2; + $45 = $21; + } else { + $$148 = $20; + $$152 = $14; + $$162 = $$2; + $$357 = $$256; + $25 = $21; + break L1; + } + } + $$148 = -1; + $$152 = $14; + $$162 = $$174; + $$357 = 0; + $25 = HEAP32[$6 >> 2] | 0; + } else { + $$148 = 0; + $$152 = $2; + $$162 = $$0; + $$357 = $$054; + $25 = $$cast; + } while (0); + L9 : do if (($25 | 0) != 0 ? ($$357 | 0) != 0 & ($$152 | 0) != 0 : 0) { + $$24968 = $$148; + $$25367 = $$152; + $$369 = $$162; + $$466 = $$357; + $30 = $25; + while (1) { + $31 = _wcrtomb($$369, HEAP32[$30 >> 2] | 0, 0) | 0; + if (($31 + 1 | 0) >>> 0 < 2) break; + $30 = (HEAP32[$6 >> 2] | 0) + 4 | 0; + HEAP32[$6 >> 2] = $30; + $$25367 = $$25367 + -1 | 0; + $$466 = $$466 - $31 | 0; + $40 = $31 + $$24968 | 0; + if (!(($$466 | 0) != 0 & ($$25367 | 0) != 0)) { + $$350 = $40; + break L9; + } else { + $$24968 = $40; + $$369 = $$369 + $31 | 0; + } + } + if (!$31) { + HEAP32[$6 >> 2] = 0; + $$350 = $$24968; + } else $$350 = -1; + } else $$350 = $$148; while (0); + if ($8) HEAP32[$1 >> 2] = HEAP32[$6 >> 2]; + STACKTOP = sp; + return $$350 | 0; +} + +function _alloc_small($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$069 = 0, $$070 = 0, $$07082 = 0, $$07084 = 0, $$072$lcssa = 0, $$1 = 0, $$171 = 0, $$277 = 0, $$lcssa73 = 0, $$lcssa74 = 0, $$pre$phiZ2D = 0, $11 = 0, $16 = 0, $21 = 0, $25 = 0, $26 = 0, $28 = 0, $29 = 0, $30 = 0, $34 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $43 = 0, $49 = 0, $50 = 0, $53 = 0, $6 = 0, label = 0; + $4 = HEAP32[$0 + 4 >> 2] | 0; + if ($2 >>> 0 > 999999984) { + $6 = HEAP32[$0 >> 2] | 0; + HEAP32[$6 + 20 >> 2] = 56; + HEAP32[$6 + 24 >> 2] = 1; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $11 = $2 & 7; + $$069 = (($11 | 0) == 0 ? 0 : 8 - $11 | 0) + $2 | 0; + if ($1 >>> 0 > 1) { + $16 = HEAP32[$0 >> 2] | 0; + HEAP32[$16 + 20 >> 2] = 15; + HEAP32[$16 + 24 >> 2] = $1; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $21 = $4 + 52 + ($1 << 2) | 0; + $$07082 = HEAP32[$21 >> 2] | 0; + L7 : do if (!$$07082) { + $$072$lcssa = 0; + label = 9; + } else { + $$07084 = $$07082; + while (1) { + if ((HEAP32[$$07084 + 8 >> 2] | 0) >>> 0 >= $$069 >>> 0) { + $$171 = $$07084; + break L7; + } + $$070 = HEAP32[$$07084 >> 2] | 0; + if (!$$070) { + $$072$lcssa = $$07084; + label = 9; + break; + } else $$07084 = $$070; + } + } while (0); + do if ((label | 0) == 9) { + $25 = ($$072$lcssa | 0) == 0; + $$0 = HEAP32[($25 ? 17016 : 17024) + ($1 << 2) >> 2] | 0; + $26 = 999999984 - $$069 | 0; + $$1 = $$0 >>> 0 > $26 >>> 0 ? $26 : $$0; + $28 = $$1 + $$069 | 0; + $29 = $28 + 16 | 0; + $30 = _jpeg_get_small($0, $29) | 0; + if (!$30) { + $$277 = $$1; + do { + if ($$277 >>> 0 < 100) { + $34 = HEAP32[$0 >> 2] | 0; + HEAP32[$34 + 20 >> 2] = 56; + HEAP32[$34 + 24 >> 2] = 2; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $$277 = $$277 >>> 1; + $39 = $$277 + $$069 | 0; + $40 = $39 + 16 | 0; + $41 = _jpeg_get_small($0, $40) | 0; + } while (!($41 | 0)); + $$lcssa73 = $41; + $$lcssa74 = $40; + $$pre$phiZ2D = $39; + } else { + $$lcssa73 = $30; + $$lcssa74 = $29; + $$pre$phiZ2D = $28; + } + $43 = $4 + 76 | 0; + HEAP32[$43 >> 2] = (HEAP32[$43 >> 2] | 0) + $$lcssa74; + HEAP32[$$lcssa73 >> 2] = 0; + HEAP32[$$lcssa73 + 4 >> 2] = 0; + HEAP32[$$lcssa73 + 8 >> 2] = $$pre$phiZ2D; + if ($25) { + HEAP32[$21 >> 2] = $$lcssa73; + $$171 = $$lcssa73; + break; + } else { + HEAP32[$$072$lcssa >> 2] = $$lcssa73; + $$171 = $$lcssa73; + break; + } + } while (0); + $49 = $$171 + 4 | 0; + $50 = HEAP32[$49 >> 2] | 0; + HEAP32[$49 >> 2] = $50 + $$069; + $53 = $$171 + 8 | 0; + HEAP32[$53 >> 2] = (HEAP32[$53 >> 2] | 0) - $$069; + return $$171 + 16 + $50 | 0; +} + +function _arImageProcLumaHistAndBoxFilterWithBias($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$073 = 0, $$074 = 0, $$075 = 0, $$076 = 0, $$078 = 0, $$082 = 0, $$1 = 0, $$177 = 0, $$179 = 0, $$2 = 0, $$280 = 0, $$3 = 0, $$381 = 0, $$pre$phi86Z2D = 0, $$pre$phiZ2D = 0, $10 = 0, $13 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $22 = 0, $26 = 0, $28 = 0, $4 = 0, $44 = 0, $50 = 0, $53 = 0, $8 = 0; + $4 = _arImageProcLumaHist($0, $1) | 0; + L1 : do if (($4 | 0) >= 0) { + if (!(HEAP32[$0 >> 2] | 0)) { + $8 = $0 + 4 | 0; + $10 = $0 + 8 | 0; + $13 = _malloc(Math_imul(HEAP32[$10 >> 2] | 0, HEAP32[$8 >> 2] | 0) | 0) | 0; + HEAP32[$0 >> 2] = $13; + if (!$13) { + $$0 = -1; + break; + } else { + $$pre$phi86Z2D = $8; + $$pre$phiZ2D = $10; + } + } else { + $$pre$phi86Z2D = $0 + 4 | 0; + $$pre$phiZ2D = $0 + 8 | 0; + } + $15 = $2 >> 1; + $16 = 0 - $15 | 0; + $$082 = 0; + while (1) { + $17 = HEAP32[$$pre$phiZ2D >> 2] | 0; + if (($$082 | 0) >= ($17 | 0)) break; + $$073 = 0; + while (1) { + $19 = HEAP32[$$pre$phi86Z2D >> 2] | 0; + if (($$073 | 0) >= ($19 | 0)) break; + $$074 = $16; + $$076 = 0; + $$078 = 0; + while (1) { + if (($$074 | 0) > ($15 | 0)) break; + $22 = $$074 + $$082 | 0; + L16 : do if (($22 | 0) >= 0 ? ($22 | 0) < (HEAP32[$$pre$phiZ2D >> 2] | 0) : 0) { + $26 = Math_imul($22, $19) | 0; + $$075 = $16; + $$177 = $$076; + $$179 = $$078; + while (1) { + if (($$075 | 0) > ($15 | 0)) { + $$3 = $$177; + $$381 = $$179; + break L16; + } + $28 = $$075 + $$073 | 0; + if (($28 | 0) > -1 & ($28 | 0) < ($19 | 0)) { + $$2 = $$177 + 1 | 0; + $$280 = $$179 + (HEAPU8[$1 + ($28 + $26) >> 0] | 0) | 0; + } else { + $$2 = $$177; + $$280 = $$179; + } + $$075 = $$075 + 1 | 0; + $$177 = $$2; + $$179 = $$280; + } + } else { + $$3 = $$076; + $$381 = $$078; + } while (0); + $$074 = $$074 + 1 | 0; + $$076 = $$3; + $$078 = $$381; + } + $44 = (HEAP32[$0 >> 2] | 0) + ((Math_imul($19, $$082) | 0) + $$073) | 0; + HEAP8[$44 >> 0] = ($$078 | 0) / ($$076 | 0) | 0; + $$073 = $$073 + 1 | 0; + } + $$082 = $$082 + 1 | 0; + } + if (!$3) $$0 = 0; else { + $$1 = 0; + $50 = $17; + while (1) { + if (($$1 | 0) >= (Math_imul($50, HEAP32[$$pre$phi86Z2D >> 2] | 0) | 0)) { + $$0 = 0; + break L1; + } + $53 = (HEAP32[$0 >> 2] | 0) + $$1 | 0; + HEAP8[$53 >> 0] = (HEAPU8[$53 >> 0] | 0) + $3; + $$1 = $$1 + 1 | 0; + $50 = HEAP32[$$pre$phiZ2D >> 2] | 0; + } + } + } else $$0 = $4; while (0); + return $$0 | 0; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEE8__rehashEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$054$ph$ph = 0, $$055 = 0, $$056$ph = 0, $$056$ph$ph = 0, $$058 = 0, $13 = 0, $14 = 0, $2 = 0, $20 = 0, $21 = 0, $23 = 0, $29 = 0, $32 = 0, $37 = 0, $39 = 0, $42 = 0, $43 = 0, $5 = 0, $57 = 0, $7 = 0, $8 = 0; + $2 = $0 + 4 | 0; + L1 : do if ($1) { + if ($1 >>> 0 > 1073741823) { + $5 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($5, 41481); + HEAP32[$5 >> 2] = 17472; + ___cxa_throw($5 | 0, 13960, 22); + } + $7 = __Znwm($1 << 2) | 0; + $8 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $7; + if ($8 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($8, HEAP32[$0 + 4 >> 2] << 2); + HEAP32[$2 >> 2] = $1; + $$058 = 0; + while (1) { + if (($$058 | 0) == ($1 | 0)) break; + HEAP32[(HEAP32[$0 >> 2] | 0) + ($$058 << 2) >> 2] = 0; + $$058 = $$058 + 1 | 0; + } + $13 = $0 + 8 | 0; + $14 = HEAP32[$13 >> 2] | 0; + if ($14 | 0) { + $20 = HEAP32[$14 + 4 >> 2] | 0; + $21 = $1 + -1 | 0; + $23 = ($21 & $1 | 0) == 0; + if (!$23) if ($20 >>> 0 < $1 >>> 0) $29 = $20; else $29 = ($20 >>> 0) % ($1 >>> 0) | 0; else $29 = $20 & $21; + HEAP32[(HEAP32[$0 >> 2] | 0) + ($29 << 2) >> 2] = $13; + $$054$ph$ph = $29; + $$056$ph$ph = $14; + while (1) { + $$056$ph = $$056$ph$ph; + L25 : while (1) { + while (1) { + $$055 = HEAP32[$$056$ph >> 2] | 0; + if (!$$055) break L1; + $32 = HEAP32[$$055 + 4 >> 2] | 0; + if (!$23) if ($32 >>> 0 < $1 >>> 0) $37 = $32; else $37 = ($32 >>> 0) % ($1 >>> 0) | 0; else $37 = $32 & $21; + if (($37 | 0) == ($$054$ph$ph | 0)) break; + $39 = (HEAP32[$0 >> 2] | 0) + ($37 << 2) | 0; + if (!(HEAP32[$39 >> 2] | 0)) break L25; + $42 = $$055 + 8 | 0; + $$0 = $$055; + while (1) { + $43 = HEAP32[$$0 >> 2] | 0; + if (!$43) break; + if ((HEAP32[$42 >> 2] | 0) == (HEAP32[$43 + 8 >> 2] | 0)) $$0 = $43; else break; + } + HEAP32[$$056$ph >> 2] = $43; + HEAP32[$$0 >> 2] = HEAP32[HEAP32[(HEAP32[$0 >> 2] | 0) + ($37 << 2) >> 2] >> 2]; + HEAP32[HEAP32[(HEAP32[$0 >> 2] | 0) + ($37 << 2) >> 2] >> 2] = $$055; + } + $$056$ph = $$055; + } + HEAP32[$39 >> 2] = $$056$ph; + $$054$ph$ph = $37; + $$056$ph$ph = $$055; + } + } + } else { + $57 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = 0; + if ($57 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($57, HEAP32[$0 + 4 >> 2] << 2); + HEAP32[$2 >> 2] = 0; + } while (0); + return; +} + +function __ZNSt3__2L12ucs4_to_utf8EPKjS1_RS1_PhS3_RS3_mNS_12codecvt_modeE($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $$2 = 0, $$pre49 = 0, $14 = 0, $16 = 0, $19 = 0, $20 = 0, $25 = 0, $32 = 0, $43 = 0, $46 = 0, $48 = 0, $58 = 0, $63 = 0, $74 = 0, $80 = 0, $85 = 0, $88 = 0, label = 0; + HEAP32[$2 >> 2] = $0; + HEAP32[$5 >> 2] = $3; + $$pre49 = $4; + if ($7 & 2) if (($$pre49 - $3 | 0) < 3) $$2 = 1; else { + HEAP32[$5 >> 2] = $3 + 1; + HEAP8[$3 >> 0] = -17; + $14 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $14 + 1; + HEAP8[$14 >> 0] = -69; + $16 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $16 + 1; + HEAP8[$16 >> 0] = -65; + label = 4; + } else label = 4; + L4 : do if ((label | 0) == 4) { + $19 = HEAP32[$2 >> 2] | 0; + while (1) { + if ($19 >>> 0 >= $1 >>> 0) { + $$2 = 0; + break L4; + } + $20 = HEAP32[$19 >> 2] | 0; + if ($20 >>> 0 > $6 >>> 0 | ($20 & -2048 | 0) == 55296) { + $$2 = 2; + break L4; + } + do if ($20 >>> 0 >= 128) { + if ($20 >>> 0 < 2048) { + $32 = HEAP32[$5 >> 2] | 0; + if (($$pre49 - $32 | 0) < 2) { + $$2 = 1; + break L4; + } + HEAP32[$5 >> 2] = $32 + 1; + HEAP8[$32 >> 0] = $20 >>> 6 | 192; + $43 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $43 + 1; + HEAP8[$43 >> 0] = $20 & 63 | 128; + break; + } + $46 = HEAP32[$5 >> 2] | 0; + $48 = $$pre49 - $46 | 0; + if ($20 >>> 0 < 65536) { + if (($48 | 0) < 3) { + $$2 = 1; + break L4; + } + HEAP32[$5 >> 2] = $46 + 1; + HEAP8[$46 >> 0] = $20 >>> 12 | 224; + $58 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $58 + 1; + HEAP8[$58 >> 0] = $20 >>> 6 & 63 | 128; + $63 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $63 + 1; + HEAP8[$63 >> 0] = $20 & 63 | 128; + break; + } else { + if (($48 | 0) < 4) { + $$2 = 1; + break L4; + } + HEAP32[$5 >> 2] = $46 + 1; + HEAP8[$46 >> 0] = $20 >>> 18 | 240; + $74 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $74 + 1; + HEAP8[$74 >> 0] = $20 >>> 12 & 63 | 128; + $80 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $80 + 1; + HEAP8[$80 >> 0] = $20 >>> 6 & 63 | 128; + $85 = HEAP32[$5 >> 2] | 0; + HEAP32[$5 >> 2] = $85 + 1; + HEAP8[$85 >> 0] = $20 & 63 | 128; + break; + } + } else { + $25 = HEAP32[$5 >> 2] | 0; + if (($$pre49 - $25 | 0) < 1) { + $$2 = 1; + break L4; + } + HEAP32[$5 >> 2] = $25 + 1; + HEAP8[$25 >> 0] = $20; + } while (0); + $88 = (HEAP32[$2 >> 2] | 0) + 4 | 0; + HEAP32[$2 >> 2] = $88; + $19 = $88; + } + } while (0); + return $$2 | 0; +} + +function _trinkle($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0$lcssa = 0, $$045$lcssa = 0, $$04551 = 0, $$0455780 = 0, $$046$lcssa = 0, $$04653 = 0, $$0465681 = 0, $$047$lcssa = 0, $$0475582 = 0, $$049 = 0, $$05879 = 0, $$05879$phi = 0, $11 = 0, $12 = 0, $16 = 0, $20 = 0, $24 = 0, $27 = 0, $28 = 0, $35 = 0, $37 = 0, $38 = 0, $47 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 240 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(240); + $7 = sp + 232 | 0; + $8 = sp; + $9 = HEAP32[$3 >> 2] | 0; + HEAP32[$7 >> 2] = $9; + $11 = HEAP32[$3 + 4 >> 2] | 0; + $12 = $7 + 4 | 0; + HEAP32[$12 >> 2] = $11; + HEAP32[$8 >> 2] = $0; + L1 : do if (($9 | 0) != 1 | ($11 | 0) != 0 ? ($16 = 0 - $1 | 0, $20 = $0 + (0 - (HEAP32[$6 + ($4 << 2) >> 2] | 0)) | 0, (FUNCTION_TABLE_iii[$2 & 127]($20, $0) | 0) >= 1) : 0) { + $$0455780 = 1; + $$0465681 = $4; + $$0475582 = ($5 | 0) == 0; + $$05879 = $0; + $28 = $20; + while (1) { + if ($$0475582 & ($$0465681 | 0) > 1) { + $24 = $$05879 + $16 | 0; + $27 = HEAP32[$6 + ($$0465681 + -2 << 2) >> 2] | 0; + if ((FUNCTION_TABLE_iii[$2 & 127]($24, $28) | 0) > -1) { + $$04551 = $$0455780; + $$04653 = $$0465681; + $$049 = $$05879; + label = 10; + break L1; + } + if ((FUNCTION_TABLE_iii[$2 & 127]($24 + (0 - $27) | 0, $28) | 0) > -1) { + $$04551 = $$0455780; + $$04653 = $$0465681; + $$049 = $$05879; + label = 10; + break L1; + } + } + $35 = $$0455780 + 1 | 0; + HEAP32[$8 + ($$0455780 << 2) >> 2] = $28; + $37 = _pntz($7) | 0; + _shr($7, $37); + $38 = $37 + $$0465681 | 0; + if (!((HEAP32[$7 >> 2] | 0) != 1 | (HEAP32[$12 >> 2] | 0) != 0)) { + $$04551 = $35; + $$04653 = $38; + $$049 = $28; + label = 10; + break L1; + } + $47 = $28 + (0 - (HEAP32[$6 + ($38 << 2) >> 2] | 0)) | 0; + if ((FUNCTION_TABLE_iii[$2 & 127]($47, HEAP32[$8 >> 2] | 0) | 0) < 1) { + $$0$lcssa = $28; + $$045$lcssa = $35; + $$046$lcssa = $38; + $$047$lcssa = 0; + label = 9; + break; + } else { + $$05879$phi = $28; + $$0455780 = $35; + $$0465681 = $38; + $$0475582 = 1; + $28 = $47; + $$05879 = $$05879$phi; + } + } + } else { + $$0$lcssa = $0; + $$045$lcssa = 1; + $$046$lcssa = $4; + $$047$lcssa = $5; + label = 9; + } while (0); + if ((label | 0) == 9 ? ($$047$lcssa | 0) == 0 : 0) { + $$04551 = $$045$lcssa; + $$04653 = $$046$lcssa; + $$049 = $$0$lcssa; + label = 10; + } + if ((label | 0) == 10) { + _cycle($1, $8, $$04551); + _sift($$049, $1, $2, $$04653, $6); + } + STACKTOP = sp; + return; +} + +function _jinit_upsampler($0) { + $0 = $0 | 0; + var $$08488 = 0, $$089 = 0, $1 = 0, $11 = 0, $14 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $33 = 0, $35 = 0, $4 = 0, $40 = 0, $42 = 0, $43 = 0, $44 = 0, $51 = 0, $54 = 0, $59 = 0, $63 = 0, $72 = 0, $77 = 0, $80 = 0, $82 = 0; + $1 = $0 + 4 | 0; + $4 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 160) | 0; + HEAP32[$0 + 476 >> 2] = $4; + HEAP32[$4 >> 2] = 191; + HEAP32[$4 + 4 >> 2] = 3; + HEAP32[$4 + 8 >> 2] = 0; + if (HEAP32[$0 + 308 >> 2] | 0) { + $11 = HEAP32[$0 >> 2] | 0; + HEAP32[$11 + 20 >> 2] = 26; + FUNCTION_TABLE_vi[HEAP32[$11 >> 2] & 255]($0); + } + $14 = $0 + 36 | 0; + if ((HEAP32[$14 >> 2] | 0) <= 0) return; + $19 = $0 + 324 | 0; + $20 = $0 + 328 | 0; + $21 = $0 + 316 | 0; + $22 = $0 + 320 | 0; + $23 = $4 + 100 | 0; + $24 = $4 + 52 | 0; + $25 = $0 + 112 | 0; + $26 = $4 + 12 | 0; + $27 = $4 + 140 | 0; + $28 = $4 + 150 | 0; + $$08488 = HEAP32[$0 + 216 >> 2] | 0; + $$089 = 0; + while (1) { + $33 = Math_imul(HEAP32[$$08488 + 36 >> 2] | 0, HEAP32[$$08488 + 8 >> 2] | 0) | 0; + $35 = ($33 | 0) / (HEAP32[$19 >> 2] | 0) | 0; + $40 = Math_imul(HEAP32[$$08488 + 40 >> 2] | 0, HEAP32[$$08488 + 12 >> 2] | 0) | 0; + $42 = ($40 | 0) / (HEAP32[$20 >> 2] | 0) | 0; + $43 = HEAP32[$21 >> 2] | 0; + $44 = HEAP32[$22 >> 2] | 0; + HEAP32[$23 + ($$089 << 2) >> 2] = $42; + do if (!(HEAP32[$$08488 + 52 >> 2] | 0)) HEAP32[$24 + ($$089 << 2) >> 2] = 11; else { + $51 = ($42 | 0) == ($44 | 0); + if (($35 | 0) == ($43 | 0) & $51) { + HEAP32[$24 + ($$089 << 2) >> 2] = 12; + break; + } + $54 = ($35 << 1 | 0) == ($43 | 0); + do if ($54 & $51) HEAP32[$24 + ($$089 << 2) >> 2] = 13; else { + if ($54 & ($42 << 1 | 0) == ($44 | 0)) { + HEAP32[$24 + ($$089 << 2) >> 2] = 14; + break; + } + $59 = ($43 | 0) / ($35 | 0) | 0; + if (($43 - (Math_imul($59, $35) | 0) | 0) == 0 ? ($63 = ($44 | 0) / ($42 | 0) | 0, ($44 - (Math_imul($63, $42) | 0) | 0) == 0) : 0) { + HEAP32[$24 + ($$089 << 2) >> 2] = 15; + HEAP8[$27 + $$089 >> 0] = $59; + HEAP8[$28 + $$089 >> 0] = $63; + break; + } + $72 = HEAP32[$0 >> 2] | 0; + HEAP32[$72 + 20 >> 2] = 39; + FUNCTION_TABLE_vi[HEAP32[$72 >> 2] & 255]($0); + } while (0); + $77 = HEAP32[(HEAP32[$1 >> 2] | 0) + 8 >> 2] | 0; + $80 = _jround_up(HEAP32[$25 >> 2] | 0, HEAP32[$21 >> 2] | 0) | 0; + $82 = FUNCTION_TABLE_iiiii[$77 & 15]($0, 1, $80, HEAP32[$22 >> 2] | 0) | 0; + HEAP32[$26 + ($$089 << 2) >> 2] = $82; + } while (0); + $$089 = $$089 + 1 | 0; + if (($$089 | 0) >= (HEAP32[$14 >> 2] | 0)) break; else $$08488 = $$08488 + 88 | 0; + } + return; +} + +function _arPattCreateHandle2($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$043 = 0, $$044 = 0, $12 = 0, $13 = 0, $16 = 0, $17 = 0, $19 = 0, $20 = 0, $23 = 0, $26 = 0, $27 = 0, $28 = 0, $31 = 0, $33 = 0, $34 = 0, $37 = 0, $4 = 0, $9 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer11 = 0, $vararg_buffer13 = 0, $vararg_buffer3 = 0, $vararg_buffer5 = 0, $vararg_buffer7 = 0, $vararg_buffer9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $vararg_buffer13 = sp + 56 | 0; + $vararg_buffer11 = sp + 48 | 0; + $vararg_buffer9 = sp + 40 | 0; + $vararg_buffer7 = sp + 32 | 0; + $vararg_buffer5 = sp + 24 | 0; + $vararg_buffer3 = sp + 16 | 0; + $vararg_buffer1 = sp + 8 | 0; + $vararg_buffer = sp; + L1 : do if (!(($0 + -16 | 0) >>> 0 > 48 | ($1 | 0) < 1)) { + $4 = _malloc(32) | 0; + if (!$4) { + _arLog(0, 3, 45930, $vararg_buffer); + _exit(1); + } + HEAP32[$4 >> 2] = 0; + HEAP32[$4 + 4 >> 2] = $1; + HEAP32[$4 + 28 >> 2] = $0; + $9 = _malloc($1 << 2) | 0; + HEAP32[$4 + 8 >> 2] = $9; + if (!$9) { + _arLog(0, 3, 45930, $vararg_buffer1); + _exit(1); + } + $12 = $1 << 4; + $13 = _malloc($12) | 0; + HEAP32[$4 + 12 >> 2] = $13; + if (!$13) { + _arLog(0, 3, 45930, $vararg_buffer3); + _exit(1); + } + $16 = _malloc($12) | 0; + $17 = $4 + 20 | 0; + HEAP32[$17 >> 2] = $16; + if (!$16) { + _arLog(0, 3, 45930, $vararg_buffer5); + _exit(1); + } + $19 = $1 << 5; + $20 = _malloc($19) | 0; + HEAP32[$4 + 16 >> 2] = $20; + if (!$20) { + _arLog(0, 3, 45930, $vararg_buffer7); + _exit(1); + } + $23 = _malloc($19) | 0; + HEAP32[$4 + 24 >> 2] = $23; + if (!$23) { + _arLog(0, 3, 45930, $vararg_buffer9); + _exit(1); + } + $26 = Math_imul($0, $0) | 0; + $27 = $26 * 12 | 0; + $28 = $26 << 2; + $$043 = 0; + L21 : while (1) { + if (($$043 | 0) >= ($1 | 0)) { + $$044 = $4; + break L1; + } + HEAP32[$9 + ($$043 << 2) >> 2] = 0; + $31 = $$043 << 2; + $$0 = 0; + while (1) { + if ($$0 >>> 0 >= 4) break; + $33 = _malloc($27) | 0; + $34 = $$0 + $31 | 0; + HEAP32[$13 + ($34 << 2) >> 2] = $33; + if (!$33) { + label = 19; + break L21; + } + $37 = _malloc($28) | 0; + HEAP32[(HEAP32[$17 >> 2] | 0) + ($34 << 2) >> 2] = $37; + if (!$37) { + label = 21; + break L21; + } else $$0 = $$0 + 1 | 0; + } + $$043 = $$043 + 1 | 0; + } + if ((label | 0) == 19) { + _arLog(0, 3, 45930, $vararg_buffer11); + _exit(1); + } else if ((label | 0) == 21) { + _arLog(0, 3, 45930, $vararg_buffer13); + _exit(1); + } + } else $$044 = 0; while (0); + STACKTOP = sp; + return $$044 | 0; +} + +function __ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0$i$i = 0, $$byval_copy = 0, $$sroa$0$0 = 0, $$sroa$0$0$copyload = 0, $$sroa$09$0 = 0, $12 = 0, $16 = 0, $17 = 0, $23 = 0, $24 = 0, $26 = 0, $28 = 0, $29 = 0, $30 = 0, $34 = 0, $38 = 0, $39 = 0, $41 = 0, $42 = 0, $48 = 0, $49 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $5 = sp; + if (!(HEAP32[$2 + 4 >> 2] & 1)) { + $12 = HEAP32[(HEAP32[$0 >> 2] | 0) + 24 >> 2] | 0; + HEAP32[$5 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$5 >> 2]; + $$sroa$0$0 = FUNCTION_TABLE_iiiiii[$12 & 31]($0, $$byval_copy, $2, $3, $4 & 1) | 0; + } else { + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $2); + $16 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66552) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + $17 = HEAP32[$16 >> 2] | 0; + if ($4) FUNCTION_TABLE_vii[HEAP32[$17 + 24 >> 2] & 255]($$byval_copy, $16); else FUNCTION_TABLE_vii[HEAP32[$17 + 28 >> 2] & 255]($$byval_copy, $16); + $23 = $$byval_copy + 8 + 3 | 0; + $24 = HEAP8[$23 >> 0] | 0; + $26 = HEAP32[$$byval_copy >> 2] | 0; + $28 = $$byval_copy + 4 | 0; + $$sroa$09$0 = $24 << 24 >> 24 < 0 ? $26 : $$byval_copy; + $30 = $24; + $34 = $26; + while (1) { + $29 = $30 << 24 >> 24 < 0; + if (($$sroa$09$0 | 0) == (($29 ? $34 : $$byval_copy) + (($29 ? HEAP32[$28 >> 2] | 0 : $30 & 255) << 2) | 0)) break; + $38 = HEAP32[$$sroa$09$0 >> 2] | 0; + $39 = HEAP32[$1 >> 2] | 0; + if ($39 | 0) { + $41 = $39 + 24 | 0; + $42 = HEAP32[$41 >> 2] | 0; + if (($42 | 0) == (HEAP32[$39 + 28 >> 2] | 0)) { + $48 = HEAP32[(HEAP32[$39 >> 2] | 0) + 52 >> 2] | 0; + $49 = __ZNSt3__211char_traitsIwE11to_int_typeEw($38) | 0; + $$0$i$i = FUNCTION_TABLE_iii[$48 & 127]($39, $49) | 0; + } else { + HEAP32[$41 >> 2] = $42 + 4; + HEAP32[$42 >> 2] = $38; + $$0$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw($38) | 0; + } + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) HEAP32[$1 >> 2] = 0; + } + $$sroa$09$0 = $$sroa$09$0 + 4 | 0; + $30 = HEAP8[$23 >> 0] | 0; + $34 = HEAP32[$$byval_copy >> 2] | 0; + } + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($$byval_copy); + $$sroa$0$0 = $$sroa$0$0$copyload; + } + STACKTOP = sp; + return $$sroa$0$0 | 0; +} + +function __ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0$i$i = 0, $$byval_copy = 0, $$sroa$0$0 = 0, $$sroa$0$0$copyload = 0, $$sroa$09$0 = 0, $12 = 0, $16 = 0, $17 = 0, $22 = 0, $23 = 0, $25 = 0, $27 = 0, $28 = 0, $29 = 0, $33 = 0, $37 = 0, $38 = 0, $40 = 0, $41 = 0, $47 = 0, $48 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $5 = sp; + if (!(HEAP32[$2 + 4 >> 2] & 1)) { + $12 = HEAP32[(HEAP32[$0 >> 2] | 0) + 24 >> 2] | 0; + HEAP32[$5 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$5 >> 2]; + $$sroa$0$0 = FUNCTION_TABLE_iiiiii[$12 & 31]($0, $$byval_copy, $2, $3, $4 & 1) | 0; + } else { + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $2); + $16 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66528) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + $17 = HEAP32[$16 >> 2] | 0; + if ($4) FUNCTION_TABLE_vii[HEAP32[$17 + 24 >> 2] & 255]($$byval_copy, $16); else FUNCTION_TABLE_vii[HEAP32[$17 + 28 >> 2] & 255]($$byval_copy, $16); + $22 = $$byval_copy + 11 | 0; + $23 = HEAP8[$22 >> 0] | 0; + $25 = HEAP32[$$byval_copy >> 2] | 0; + $27 = $$byval_copy + 4 | 0; + $$sroa$09$0 = $23 << 24 >> 24 < 0 ? $25 : $$byval_copy; + $29 = $23; + $33 = $25; + while (1) { + $28 = $29 << 24 >> 24 < 0; + if (($$sroa$09$0 | 0) == (($28 ? $33 : $$byval_copy) + ($28 ? HEAP32[$27 >> 2] | 0 : $29 & 255) | 0)) break; + $37 = HEAP8[$$sroa$09$0 >> 0] | 0; + $38 = HEAP32[$1 >> 2] | 0; + if ($38 | 0) { + $40 = $38 + 24 | 0; + $41 = HEAP32[$40 >> 2] | 0; + if (($41 | 0) == (HEAP32[$38 + 28 >> 2] | 0)) { + $47 = HEAP32[(HEAP32[$38 >> 2] | 0) + 52 >> 2] | 0; + $48 = __ZNSt3__211char_traitsIcE11to_int_typeEc($37) | 0; + $$0$i$i = FUNCTION_TABLE_iii[$47 & 127]($38, $48) | 0; + } else { + HEAP32[$40 >> 2] = $41 + 1; + HEAP8[$41 >> 0] = $37; + $$0$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc($37) | 0; + } + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) HEAP32[$1 >> 2] = 0; + } + $$sroa$09$0 = $$sroa$09$0 + 1 | 0; + $29 = HEAP8[$22 >> 0] | 0; + $33 = HEAP32[$$byval_copy >> 2] | 0; + } + $$sroa$0$0$copyload = HEAP32[$1 >> 2] | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($$byval_copy); + $$sroa$0$0 = $$sroa$0$0$copyload; + } + STACKTOP = sp; + return $$sroa$0$0 | 0; +} + +function _start_pass_main($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$06870$i = 0, $$06979$i = 0, $$080$i = 0, $$171$i = 0, $$275$i = 0, $11 = 0, $13 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $26 = 0, $29 = 0, $3 = 0, $32 = 0, $34 = 0, $35 = 0, $38 = 0, $42 = 0, $44 = 0, $45 = 0, $46 = 0, $49 = 0, $70 = 0, $9 = 0; + $3 = HEAP32[$0 + 448 >> 2] | 0; + switch ($1 | 0) { + case 0: + { + $9 = $3 + 4 | 0; + if (!(HEAP32[(HEAP32[$0 + 476 >> 2] | 0) + 8 >> 2] | 0)) { + HEAP32[$9 >> 2] = 17; + HEAP32[$3 + 48 >> 2] = HEAP32[$3 + 52 >> 2]; + return; + } + HEAP32[$9 >> 2] = 16; + $11 = HEAP32[$0 + 328 >> 2] | 0; + $13 = HEAP32[$0 + 36 >> 2] | 0; + if (($13 | 0) > 0) { + $17 = $3 + 60 | 0; + $18 = $3 + 64 | 0; + $19 = $11 + 2 | 0; + $20 = $11 + -2 | 0; + $$06979$i = HEAP32[$0 + 216 >> 2] | 0; + $$080$i = 0; + while (1) { + $26 = (Math_imul(HEAP32[$$06979$i + 40 >> 2] | 0, HEAP32[$$06979$i + 12 >> 2] | 0) | 0) / ($11 | 0) | 0; + $29 = HEAP32[(HEAP32[$17 >> 2] | 0) + ($$080$i << 2) >> 2] | 0; + $32 = HEAP32[(HEAP32[$18 >> 2] | 0) + ($$080$i << 2) >> 2] | 0; + $34 = HEAP32[$3 + 8 + ($$080$i << 2) >> 2] | 0; + $35 = Math_imul($26, $19) | 0; + if (($35 | 0) > 0) { + $$06870$i = 0; + do { + $38 = HEAP32[$34 + ($$06870$i << 2) >> 2] | 0; + HEAP32[$32 + ($$06870$i << 2) >> 2] = $38; + HEAP32[$29 + ($$06870$i << 2) >> 2] = $38; + $$06870$i = $$06870$i + 1 | 0; + } while (($$06870$i | 0) != ($35 | 0)); + } + $42 = $26 << 1; + if (($26 | 0) > 0) { + $44 = Math_imul($26, $11) | 0; + $45 = Math_imul($26, $20) | 0; + $$171$i = 0; + do { + $46 = $$171$i + $44 | 0; + $49 = $$171$i + $45 | 0; + HEAP32[$32 + ($49 << 2) >> 2] = HEAP32[$34 + ($46 << 2) >> 2]; + HEAP32[$32 + ($46 << 2) >> 2] = HEAP32[$34 + ($49 << 2) >> 2]; + $$171$i = $$171$i + 1 | 0; + } while (($$171$i | 0) < ($42 | 0)); + $$275$i = 0; + do { + HEAP32[$29 + ($$275$i - $26 << 2) >> 2] = HEAP32[$29 >> 2]; + $$275$i = $$275$i + 1 | 0; + } while (($$275$i | 0) != ($26 | 0)); + } + $$080$i = $$080$i + 1 | 0; + if (($$080$i | 0) == ($13 | 0)) break; else $$06979$i = $$06979$i + 88 | 0; + } + } + HEAP32[$3 + 68 >> 2] = 0; + HEAP32[$3 + 72 >> 2] = 0; + HEAP32[$3 + 76 >> 2] = 0; + HEAP32[$3 + 56 >> 2] = 0; + return; + } + case 2: + { + HEAP32[$3 + 4 >> 2] = 18; + return; + } + default: + { + $70 = HEAP32[$0 >> 2] | 0; + HEAP32[$70 + 20 >> 2] = 3; + FUNCTION_TABLE_vi[HEAP32[$70 >> 2] & 255]($0); + return; + } + } +} + +function __ZNSt3__211__sift_downIRNS_4lessIN6vision17PriorityQueueItemILi96EEEEENS_11__wrap_iterIPS4_EEEEvT0_SA_T_NS_15iterator_traitsISA_E15difference_typeESA_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$1 = 0, $$2 = 0, $$sroa$024$0 = 0, $$sroa$024$1 = 0, $$sroa$024$2 = 0, $10 = 0, $11 = 0, $12 = 0, $15 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $23 = 0, $24 = 0, $29 = 0, $34 = 0, $35 = 0, $40 = 0, $45 = 0, $46 = 0, $47 = 0, $5 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $58 = 0, $59 = 0, $6 = 0, $64 = 0, $69 = 0, $7 = 0, $70 = 0, $8 = 0, sp = 0, $47$looptemp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $5 = sp; + $6 = HEAP32[$4 >> 2] | 0; + $7 = HEAP32[$0 >> 2] | 0; + $8 = $6 - $7 | 0; + $10 = $7; + $11 = $6; + $12 = $6; + if (($3 | 0) >= 2 ? ($15 = ($3 + -2 | 0) / 2 | 0, ($15 | 0) >= ($8 >> 3 | 0)) : 0) { + $18 = $8 >> 2 | 1; + $19 = $10 + ($18 << 3) | 0; + $20 = $19; + $21 = $18 + 1 | 0; + if (($21 | 0) < ($3 | 0)) { + $23 = $19 + 8 | 0; + $24 = __ZNK6vision17PriorityQueueItemILi96EEltERKS1_($19, $23) | 0; + $$0 = $24 ? $21 : $18; + $$sroa$024$0 = $24 ? $23 : $20; + } else { + $$0 = $18; + $$sroa$024$0 = $20; + } + if (!(__ZNK6vision17PriorityQueueItemILi96EEltERKS1_($$sroa$024$0, $11) | 0)) { + $29 = $6; + $34 = HEAP32[$29 + 4 >> 2] | 0; + $35 = $5; + HEAP32[$35 >> 2] = HEAP32[$29 >> 2]; + HEAP32[$35 + 4 >> 2] = $34; + $$1 = $$0; + $$sroa$024$1 = $$sroa$024$0; + $47 = $12; + while (1) { + $47$looptemp = $47; + $47 = $$sroa$024$1; + $40 = $47; + $45 = HEAP32[$40 + 4 >> 2] | 0; + $46 = $47$looptemp; + HEAP32[$46 >> 2] = HEAP32[$40 >> 2]; + HEAP32[$46 + 4 >> 2] = $45; + HEAP32[$4 >> 2] = $$sroa$024$1; + if (($15 | 0) < ($$1 | 0)) break; + $53 = $$1 << 1 | 1; + $54 = $10 + ($53 << 3) | 0; + $55 = $54; + $56 = $53 + 1 | 0; + if (($56 | 0) < ($3 | 0)) { + $58 = $54 + 8 | 0; + $59 = __ZNK6vision17PriorityQueueItemILi96EEltERKS1_($54, $58) | 0; + $$2 = $59 ? $56 : $53; + $$sroa$024$2 = $59 ? $58 : $55; + } else { + $$2 = $53; + $$sroa$024$2 = $55; + } + if (__ZNK6vision17PriorityQueueItemILi96EEltERKS1_($$sroa$024$2, $5) | 0) break; else { + $$1 = $$2; + $$sroa$024$1 = $$sroa$024$2; + } + } + $64 = $5; + $69 = HEAP32[$64 + 4 >> 2] | 0; + $70 = $$sroa$024$1; + HEAP32[$70 >> 2] = HEAP32[$64 >> 2]; + HEAP32[$70 + 4 >> 2] = $69; + __ZN6vision17PriorityQueueItemILi96EED2Ev($5); + } + } + STACKTOP = sp; + return; +} + +function __ZNSt3__2L19utf8_to_ucs4_lengthEPKhS1_mmNS_12codecvt_modeE($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$091 = 0, $$185 = 0, $$185$ph = 0, $$589 = 0, $$pre = 0, $21 = 0, $22 = 0, $33 = 0, $47 = 0, $49 = 0, $56 = 0, $74 = 0, $76 = 0, $78 = 0, $84 = 0, $87 = 0; + $$pre = $1; + if (((($4 & 4 | 0) != 0 ? ($$pre - $0 | 0) > 2 : 0) ? (HEAP8[$0 >> 0] | 0) == -17 : 0) ? (HEAP8[$0 + 1 >> 0] | 0) == -69 : 0) $$185$ph = (HEAP8[$0 + 2 >> 0] | 0) == -65 ? $0 + 3 | 0 : $0; else $$185$ph = $0; + $$091 = 0; + $$185 = $$185$ph; + L7 : while (1) { + if (!($$091 >>> 0 < $2 >>> 0 & $$185 >>> 0 < $1 >>> 0)) break; + $21 = HEAP8[$$185 >> 0] | 0; + $22 = $21 & 255; + do if ($21 << 24 >> 24 <= -1) { + if (($21 & 255) < 194) break L7; + if (($21 & 255) < 224) { + if (($$pre - $$185 | 0) < 2) break L7; + $33 = HEAPU8[$$185 + 1 >> 0] | 0; + if (($33 & 192 | 0) != 128) break L7; + if (($33 & 63 | $22 << 6 & 1984) >>> 0 > $3 >>> 0) break L7; + $$589 = $$185 + 2 | 0; + break; + } + if (($21 & 255) < 240) { + if (($$pre - $$185 | 0) < 3) break L7; + $47 = HEAP8[$$185 + 1 >> 0] | 0; + $49 = HEAP8[$$185 + 2 >> 0] | 0; + switch ($21 << 24 >> 24) { + case -32: + { + if (($47 & -32) << 24 >> 24 != -96) break L7; + break; + } + case -19: + { + if (($47 & -32) << 24 >> 24 != -128) break L7; + break; + } + default: + if (($47 & -64) << 24 >> 24 != -128) break L7; + } + $56 = $49 & 255; + if (($56 & 192 | 0) != 128) break L7; + if ((($47 & 63) << 6 | $22 << 12 & 61440 | $56 & 63) >>> 0 > $3 >>> 0) break L7; else { + $$589 = $$185 + 3 | 0; + break; + } + } + if (($21 & 255) >= 245) break L7; + if (($$pre - $$185 | 0) < 4) break L7; + $74 = HEAP8[$$185 + 1 >> 0] | 0; + $76 = HEAP8[$$185 + 2 >> 0] | 0; + $78 = HEAP8[$$185 + 3 >> 0] | 0; + switch ($21 << 24 >> 24) { + case -16: + { + if (($74 + 112 & 255) >= 48) break L7; + break; + } + case -12: + { + if (($74 & -16) << 24 >> 24 != -128) break L7; + break; + } + default: + if (($74 & -64) << 24 >> 24 != -128) break L7; + } + $84 = $76 & 255; + if (($84 & 192 | 0) != 128) break L7; + $87 = $78 & 255; + if (($87 & 192 | 0) != 128) break L7; + if ((($74 & 63) << 12 | $22 << 18 & 1835008 | $84 << 6 & 4032 | $87 & 63) >>> 0 > $3 >>> 0) break L7; else $$589 = $$185 + 4 | 0; + } else { + if ($22 >>> 0 > $3 >>> 0) break L7; + $$589 = $$185 + 1 | 0; + } while (0); + $$091 = $$091 + 1 | 0; + $$185 = $$589; + } + return $$185 - $0 | 0; +} + +function _loadNFTMarker($arc, $surfaceSetCount, $datasetPathname) { + $arc = $arc | 0; + $surfaceSetCount = $surfaceSetCount | 0; + $datasetPathname = $datasetPathname | 0; + var $0 = 0, $call6 = 0, $refDataSet = 0, $refDataSet2 = 0, $retval$0 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer11 = 0, $vararg_buffer13 = 0, $vararg_buffer16 = 0, $vararg_buffer19 = 0, $vararg_buffer21 = 0, $vararg_buffer23 = 0, $vararg_buffer4 = 0, $vararg_buffer7 = 0, $vararg_buffer9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 96 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(96); + $vararg_buffer23 = sp + 80 | 0; + $vararg_buffer21 = sp + 72 | 0; + $vararg_buffer19 = sp + 64 | 0; + $vararg_buffer16 = sp + 56 | 0; + $vararg_buffer13 = sp + 48 | 0; + $vararg_buffer11 = sp + 40 | 0; + $vararg_buffer9 = sp + 32 | 0; + $vararg_buffer7 = sp + 24 | 0; + $vararg_buffer4 = sp + 16 | 0; + $vararg_buffer1 = sp + 8 | 0; + $vararg_buffer = sp; + $refDataSet = sp + 88 | 0; + $refDataSet2 = sp + 84 | 0; + $0 = HEAP32[$arc + 232 >> 2] | 0; + HEAP32[$refDataSet >> 2] = 0; + HEAP32[$vararg_buffer >> 2] = $datasetPathname; + _arLog(0, 1, 44959, $vararg_buffer); + do if ((_kpmLoadRefDataSet($datasetPathname, 44977, $refDataSet2) | 0) >= 0) { + HEAP32[$vararg_buffer4 >> 2] = $surfaceSetCount; + _arLog(0, 1, 45021, $vararg_buffer4); + if ((_kpmChangePageNoOfRefDataSet(HEAP32[$refDataSet2 >> 2] | 0, -1, $surfaceSetCount) | 0) < 0) { + _arLog(0, 3, 45046, $vararg_buffer7); + $retval$0 = 0; + break; + } + if ((_kpmMergeRefDataSet($refDataSet, $refDataSet2) | 0) < 0) { + _arLog(0, 3, 45082, $vararg_buffer9); + $retval$0 = 0; + break; + } + _arLog(0, 1, 45109, $vararg_buffer11); + HEAP32[$vararg_buffer13 >> 2] = $datasetPathname; + _arLog(0, 1, 45118, $vararg_buffer13); + $call6 = _ar2ReadSurfaceSet($datasetPathname, 45135, 0) | 0; + HEAP32[$arc + 248 + ($surfaceSetCount << 2) >> 2] = $call6; + if (!$call6) { + HEAP32[$vararg_buffer16 >> 2] = $datasetPathname; + _arLog(0, 3, 45140, $vararg_buffer16); + } + _arLog(0, 1, 45109, $vararg_buffer19); + if (($surfaceSetCount | 0) == 10) _exit(-1); + if ((_kpmSetRefDataSet($0, HEAP32[$refDataSet >> 2] | 0) | 0) < 0) { + _arLog(0, 3, 45173, $vararg_buffer21); + $retval$0 = 0; + break; + } else { + _kpmDeleteRefDataSet($refDataSet) | 0; + _arLog(0, 1, 45198, $vararg_buffer23); + $retval$0 = 1; + break; + } + } else { + HEAP32[$vararg_buffer1 >> 2] = $datasetPathname; + _arLog(0, 3, 44983, $vararg_buffer1); + $retval$0 = 0; + } while (0); + STACKTOP = sp; + return $retval$0 | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy2 = 0, $$sroa$022$0 = 0, $$sroa$022$0$copyload24 = 0, $16 = 0, $19 = 0, $21 = 0, $22 = 0, $31 = 0, $34 = 0, $36 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy2 = sp + 40 | 0; + $$byval_copy = sp; + $6 = sp + 32 | 0; + $7 = sp + 36 | 0; + $8 = sp + 28 | 0; + $9 = sp + 24 | 0; + if (!(HEAP32[$3 + 4 >> 2] & 1)) { + HEAP32[$6 >> 2] = -1; + $16 = HEAP32[(HEAP32[$0 >> 2] | 0) + 16 >> 2] | 0; + HEAP32[$7 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$8 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$7 >> 2]; + HEAP32[$$byval_copy2 >> 2] = HEAP32[$8 >> 2]; + $19 = FUNCTION_TABLE_iiiiiii[$16 & 63]($0, $$byval_copy, $$byval_copy2, $3, $4, $6) | 0; + HEAP32[$1 >> 2] = $19; + switch (HEAP32[$6 >> 2] | 0) { + case 0: + { + HEAP8[$5 >> 0] = 0; + break; + } + case 1: + { + HEAP8[$5 >> 0] = 1; + break; + } + default: + { + HEAP8[$5 >> 0] = 1; + HEAP32[$4 >> 2] = 4; + } + } + $$sroa$022$0 = HEAP32[$1 >> 2] | 0; + } else { + __ZNKSt3__28ios_base6getlocEv($$byval_copy2, $3); + $21 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy2, 66544) | 0; + __ZNSt3__26localeD2Ev($$byval_copy2); + __ZNKSt3__28ios_base6getlocEv($$byval_copy2, $3); + $22 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy2, 66552) | 0; + __ZNSt3__26localeD2Ev($$byval_copy2); + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$22 >> 2] | 0) + 24 >> 2] & 255]($$byval_copy, $22); + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$22 >> 2] | 0) + 28 >> 2] & 255]($$byval_copy + 12 | 0, $22); + HEAP32[$9 >> 2] = HEAP32[$2 >> 2]; + $31 = $$byval_copy + 24 | 0; + HEAP32[$$byval_copy2 >> 2] = HEAP32[$9 >> 2]; + $34 = (__ZNSt3__214__scan_keywordINS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEPKNS_12basic_stringIwS3_NS_9allocatorIwEEEENS_5ctypeIwEEEET0_RT_SE_SD_SD_RKT1_Rjb($1, $$byval_copy2, $$byval_copy, $31, $21, $4, 1) | 0) == ($$byval_copy | 0) & 1; + HEAP8[$5 >> 0] = $34; + $$sroa$022$0$copyload24 = HEAP32[$1 >> 2] | 0; + $36 = $31; + do { + $36 = $36 + -12 | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($36); + } while (($36 | 0) != ($$byval_copy | 0)); + $$sroa$022$0 = $$sroa$022$0$copyload24; + } + STACKTOP = sp; + return $$sroa$022$0 | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy2 = 0, $$sroa$022$0 = 0, $$sroa$022$0$copyload24 = 0, $16 = 0, $19 = 0, $21 = 0, $22 = 0, $31 = 0, $34 = 0, $36 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy2 = sp + 40 | 0; + $$byval_copy = sp; + $6 = sp + 32 | 0; + $7 = sp + 36 | 0; + $8 = sp + 28 | 0; + $9 = sp + 24 | 0; + if (!(HEAP32[$3 + 4 >> 2] & 1)) { + HEAP32[$6 >> 2] = -1; + $16 = HEAP32[(HEAP32[$0 >> 2] | 0) + 16 >> 2] | 0; + HEAP32[$7 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$8 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$7 >> 2]; + HEAP32[$$byval_copy2 >> 2] = HEAP32[$8 >> 2]; + $19 = FUNCTION_TABLE_iiiiiii[$16 & 63]($0, $$byval_copy, $$byval_copy2, $3, $4, $6) | 0; + HEAP32[$1 >> 2] = $19; + switch (HEAP32[$6 >> 2] | 0) { + case 0: + { + HEAP8[$5 >> 0] = 0; + break; + } + case 1: + { + HEAP8[$5 >> 0] = 1; + break; + } + default: + { + HEAP8[$5 >> 0] = 1; + HEAP32[$4 >> 2] = 4; + } + } + $$sroa$022$0 = HEAP32[$1 >> 2] | 0; + } else { + __ZNKSt3__28ios_base6getlocEv($$byval_copy2, $3); + $21 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy2, 66512) | 0; + __ZNSt3__26localeD2Ev($$byval_copy2); + __ZNKSt3__28ios_base6getlocEv($$byval_copy2, $3); + $22 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy2, 66528) | 0; + __ZNSt3__26localeD2Ev($$byval_copy2); + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$22 >> 2] | 0) + 24 >> 2] & 255]($$byval_copy, $22); + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$22 >> 2] | 0) + 28 >> 2] & 255]($$byval_copy + 12 | 0, $22); + HEAP32[$9 >> 2] = HEAP32[$2 >> 2]; + $31 = $$byval_copy + 24 | 0; + HEAP32[$$byval_copy2 >> 2] = HEAP32[$9 >> 2]; + $34 = (__ZNSt3__214__scan_keywordINS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEPKNS_12basic_stringIcS3_NS_9allocatorIcEEEENS_5ctypeIcEEEET0_RT_SE_SD_SD_RKT1_Rjb($1, $$byval_copy2, $$byval_copy, $31, $21, $4, 1) | 0) == ($$byval_copy | 0) & 1; + HEAP8[$5 >> 0] = $34; + $$sroa$022$0$copyload24 = HEAP32[$1 >> 2] | 0; + $36 = $31; + do { + $36 = $36 + -12 | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($36); + } while (($36 | 0) != ($$byval_copy | 0)); + $$sroa$022$0 = $$sroa$022$0$copyload24; + } + STACKTOP = sp; + return $$sroa$022$0 | 0; +} + +function __ZNK10__cxxabiv121__vmi_class_type_info16search_above_dstEPNS_19__dynamic_cast_infoEPKvS4_ib($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$046 = 0, $$047 = 0, $$1$off0$in = 0, $$148$off0$in = 0, $10 = 0, $11 = 0, $12 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $23 = 0, $24 = 0, $25 = 0, $28 = 0, $29 = 0, $31 = 0, $38 = 0, $43 = 0, $45 = 0, $9 = 0; + if (__ZL8is_equalPKSt9type_infoS1_b($0, HEAP32[$1 + 8 >> 2] | 0, $5) | 0) __ZNK10__cxxabiv117__class_type_info29process_static_type_above_dstEPNS_19__dynamic_cast_infoEPKvS4_i(0, $1, $2, $3, $4); else { + $9 = $1 + 52 | 0; + $10 = HEAP8[$9 >> 0] | 0; + $11 = $1 + 53 | 0; + $12 = HEAP8[$11 >> 0] | 0; + $15 = HEAP32[$0 + 12 >> 2] | 0; + $16 = $0 + 16 + ($15 << 3) | 0; + HEAP8[$9 >> 0] = 0; + HEAP8[$11 >> 0] = 0; + __ZNK10__cxxabiv122__base_class_type_info16search_above_dstEPNS_19__dynamic_cast_infoEPKvS4_ib($0 + 16 | 0, $1, $2, $3, $4, $5); + $17 = HEAP8[$9 >> 0] | 0; + $18 = $17 | $10; + $19 = HEAP8[$11 >> 0] | 0; + $20 = $19 | $12; + L4 : do if (($15 | 0) > 1) { + $23 = $1 + 24 | 0; + $24 = $0 + 8 | 0; + $25 = $1 + 54 | 0; + $$0 = $0 + 24 | 0; + $$046 = $18; + $$047 = $20; + $31 = $17; + $38 = $19; + while (1) { + $28 = $$047 & 1; + $29 = $$046 & 1; + if (HEAP8[$25 >> 0] | 0) { + $$1$off0$in = $29; + $$148$off0$in = $28; + break L4; + } + if (!($31 << 24 >> 24)) { + if ($38 << 24 >> 24 ? (HEAP32[$24 >> 2] & 1 | 0) == 0 : 0) { + $$1$off0$in = $29; + $$148$off0$in = $28; + break L4; + } + } else { + if ((HEAP32[$23 >> 2] | 0) == 1) { + $$1$off0$in = $29; + $$148$off0$in = $28; + break L4; + } + if (!(HEAP32[$24 >> 2] & 2)) { + $$1$off0$in = $29; + $$148$off0$in = $28; + break L4; + } + } + HEAP8[$9 >> 0] = 0; + HEAP8[$11 >> 0] = 0; + __ZNK10__cxxabiv122__base_class_type_info16search_above_dstEPNS_19__dynamic_cast_infoEPKvS4_ib($$0, $1, $2, $3, $4, $5); + $31 = HEAP8[$9 >> 0] | 0; + $43 = $31 | $29; + $38 = HEAP8[$11 >> 0] | 0; + $45 = $38 | $28; + $$0 = $$0 + 8 | 0; + if ($$0 >>> 0 >= $16 >>> 0) { + $$1$off0$in = $43; + $$148$off0$in = $45; + break; + } else { + $$046 = $43; + $$047 = $45; + } + } + } else { + $$1$off0$in = $18; + $$148$off0$in = $20; + } while (0); + HEAP8[$9 >> 0] = $$1$off0$in << 24 >> 24 != 0 & 1; + HEAP8[$11 >> 0] = $$148$off0$in << 24 >> 24 != 0 & 1; + } + return; +} + +function _memchr($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0$lcssa = 0, $$035$lcssa = 0, $$035$lcssa65 = 0, $$03555 = 0, $$036$lcssa = 0, $$036$lcssa64 = 0, $$03654 = 0, $$046 = 0, $$137$lcssa = 0, $$137$lcssa66 = 0, $$13745 = 0, $$140 = 0, $$23839 = 0, $$in = 0, $$lcssa = 0, $11 = 0, $12 = 0, $16 = 0, $18 = 0, $20 = 0, $23 = 0, $29 = 0, $3 = 0, $30 = 0, $39 = 0, $7 = 0, $8 = 0, label = 0; + $3 = $1 & 255; + $7 = ($2 | 0) != 0; + L1 : do if ($7 & ($0 & 3 | 0) != 0) { + $8 = $1 & 255; + $$03555 = $0; + $$03654 = $2; + while (1) { + if ((HEAP8[$$03555 >> 0] | 0) == $8 << 24 >> 24) { + $$035$lcssa65 = $$03555; + $$036$lcssa64 = $$03654; + label = 6; + break L1; + } + $11 = $$03555 + 1 | 0; + $12 = $$03654 + -1 | 0; + $16 = ($12 | 0) != 0; + if ($16 & ($11 & 3 | 0) != 0) { + $$03555 = $11; + $$03654 = $12; + } else { + $$035$lcssa = $11; + $$036$lcssa = $12; + $$lcssa = $16; + label = 5; + break; + } + } + } else { + $$035$lcssa = $0; + $$036$lcssa = $2; + $$lcssa = $7; + label = 5; + } while (0); + if ((label | 0) == 5) if ($$lcssa) { + $$035$lcssa65 = $$035$lcssa; + $$036$lcssa64 = $$036$lcssa; + label = 6; + } else label = 16; + L8 : do if ((label | 0) == 6) { + $18 = $1 & 255; + if ((HEAP8[$$035$lcssa65 >> 0] | 0) == $18 << 24 >> 24) if (!$$036$lcssa64) { + label = 16; + break; + } else { + $39 = $$035$lcssa65; + break; + } + $20 = Math_imul($3, 16843009) | 0; + L13 : do if ($$036$lcssa64 >>> 0 > 3) { + $$046 = $$035$lcssa65; + $$13745 = $$036$lcssa64; + while (1) { + $23 = HEAP32[$$046 >> 2] ^ $20; + if (($23 & -2139062144 ^ -2139062144) & $23 + -16843009 | 0) { + $$137$lcssa66 = $$13745; + $$in = $$046; + break L13; + } + $29 = $$046 + 4 | 0; + $30 = $$13745 + -4 | 0; + if ($30 >>> 0 > 3) { + $$046 = $29; + $$13745 = $30; + } else { + $$0$lcssa = $29; + $$137$lcssa = $30; + label = 11; + break; + } + } + } else { + $$0$lcssa = $$035$lcssa65; + $$137$lcssa = $$036$lcssa64; + label = 11; + } while (0); + if ((label | 0) == 11) if (!$$137$lcssa) { + label = 16; + break; + } else { + $$137$lcssa66 = $$137$lcssa; + $$in = $$0$lcssa; + } + $$140 = $$in; + $$23839 = $$137$lcssa66; + while (1) { + if ((HEAP8[$$140 >> 0] | 0) == $18 << 24 >> 24) { + $39 = $$140; + break L8; + } + $$23839 = $$23839 + -1 | 0; + if (!$$23839) { + label = 16; + break; + } else $$140 = $$140 + 1 | 0; + } + } while (0); + if ((label | 0) == 16) $39 = 0; + return $39 | 0; +} + +function __ZN6vision10DoGPyramid5allocEPKNS_25GaussianScaleSpacePyramidE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$026 = 0, $10 = 0, $15 = 0, $19 = 0, $2 = 0, $21 = 0, $23 = 0, $25 = 0, $26 = 0, $27 = 0, $29 = 0, $30 = 0, $35 = 0, $36 = 0, $37 = 0, $41 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + if (!(__ZNK6vision25GaussianScaleSpacePyramid4sizeEv($1) | 0)) { + $10 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 26705) | 0, 26748) | 0, 39072) | 0, 53) | 0, 39079) | 0, 26843) | 0; + __ZNKSt3__28ios_base6getlocEv($2, $10 + (HEAP32[(HEAP32[$10 >> 2] | 0) + -12 >> 2] | 0) | 0); + $15 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66512) | 0; + $19 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$15 >> 2] | 0) + 28 >> 2] & 127]($15, 10) | 0; + __ZNSt3__26localeD2Ev($2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($10, $19) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($10) | 0; + _abort(); + } + $21 = __ZNK6vision5Image4typeEv(__ZNK6vision25GaussianScaleSpacePyramid3getEmm($1, 0, 0) | 0) | 0; + $23 = __ZNK6vision5Image5widthEv(__ZNK6vision25GaussianScaleSpacePyramid3getEmm($1, 0, 0) | 0) | 0; + $25 = __ZNK6vision5Image6heightEv(__ZNK6vision25GaussianScaleSpacePyramid3getEmm($1, 0, 0) | 0) | 0; + $26 = __ZNK6vision25GaussianScaleSpacePyramid10numOctavesEv($1) | 0; + $27 = $0 + 12 | 0; + HEAP32[$27 >> 2] = $26; + $29 = (__ZNK6vision25GaussianScaleSpacePyramid18numScalesPerOctaveEv($1) | 0) + -1 | 0; + $30 = $0 + 16 | 0; + HEAP32[$30 >> 2] = $29; + __ZNSt3__26vectorIN6vision5ImageENS_9allocatorIS2_EEE6resizeEm($0, Math_imul(HEAP32[$27 >> 2] | 0, $29) | 0); + $$026 = 0; + while (1) { + if ($$026 >>> 0 >= (HEAP32[$27 >> 2] | 0) >>> 0) break; + $35 = $23 >>> $$026; + $36 = $25 >>> $$026; + $$0 = 0; + while (1) { + $37 = HEAP32[$30 >> 2] | 0; + if ($$0 >>> 0 >= $37 >>> 0) break; + $41 = (Math_imul($37, $$026) | 0) + $$0 | 0; + __ZN6vision5Image5allocENS_9ImageTypeEmmim((HEAP32[$0 >> 2] | 0) + ($41 << 5) | 0, $21, $35, $36, -1, 1); + $$0 = $$0 + 1 | 0; + } + $$026 = $$026 + 1 | 0; + } + STACKTOP = sp; + return; +} + +function ___embind_register_native_and_builtin_types() { + __embind_register_void(__ZN10emscripten8internal6TypeIDIvvE3getEv() | 0, 57068); + __embind_register_bool(__ZN10emscripten8internal6TypeIDIbvE3getEv() | 0, 57073, 1, 1, 0); + __ZN12_GLOBAL__N_116register_integerIcEEvPKc(57078); + __ZN12_GLOBAL__N_116register_integerIaEEvPKc(57083); + __ZN12_GLOBAL__N_116register_integerIhEEvPKc(57095); + __ZN12_GLOBAL__N_116register_integerIsEEvPKc(57109); + __ZN12_GLOBAL__N_116register_integerItEEvPKc(57115); + __ZN12_GLOBAL__N_116register_integerIiEEvPKc(57130); + __ZN12_GLOBAL__N_116register_integerIjEEvPKc(57134); + __ZN12_GLOBAL__N_116register_integerIlEEvPKc(57147); + __ZN12_GLOBAL__N_116register_integerImEEvPKc(57152); + __ZN12_GLOBAL__N_114register_floatIfEEvPKc(57166); + __ZN12_GLOBAL__N_114register_floatIdEEvPKc(57172); + __embind_register_std_string(__ZN10emscripten8internal6TypeIDINSt3__212basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEvE3getEv() | 0, 57179); + __embind_register_std_string(__ZN10emscripten8internal6TypeIDINSt3__212basic_stringIhNS2_11char_traitsIhEENS2_9allocatorIhEEEEvE3getEv() | 0, 57191); + __embind_register_std_wstring(__ZN10emscripten8internal6TypeIDINSt3__212basic_stringIwNS2_11char_traitsIwEENS2_9allocatorIwEEEEvE3getEv() | 0, 4, 57224); + __embind_register_emval(__ZN10emscripten8internal6TypeIDINS_3valEvE3getEv() | 0, 57237); + __ZN12_GLOBAL__N_120register_memory_viewIcEEvPKc(57253); + __ZN12_GLOBAL__N_120register_memory_viewIaEEvPKc(57283); + __ZN12_GLOBAL__N_120register_memory_viewIhEEvPKc(57320); + __ZN12_GLOBAL__N_120register_memory_viewIsEEvPKc(57359); + __ZN12_GLOBAL__N_120register_memory_viewItEEvPKc(57390); + __ZN12_GLOBAL__N_120register_memory_viewIiEEvPKc(57430); + __ZN12_GLOBAL__N_120register_memory_viewIjEEvPKc(57459); + __ZN12_GLOBAL__N_120register_memory_viewIlEEvPKc(57497); + __ZN12_GLOBAL__N_120register_memory_viewImEEvPKc(57527); + __ZN12_GLOBAL__N_120register_memory_viewIaEEvPKc(57566); + __ZN12_GLOBAL__N_120register_memory_viewIhEEvPKc(57598); + __ZN12_GLOBAL__N_120register_memory_viewIsEEvPKc(57631); + __ZN12_GLOBAL__N_120register_memory_viewItEEvPKc(57664); + __ZN12_GLOBAL__N_120register_memory_viewIiEEvPKc(57698); + __ZN12_GLOBAL__N_120register_memory_viewIjEEvPKc(57731); + __ZN12_GLOBAL__N_120register_memory_viewIfEEvPKc(57765); + __ZN12_GLOBAL__N_120register_memory_viewIdEEvPKc(57796); + __ZN12_GLOBAL__N_120register_memory_viewIeEEvPKc(57828); + return; +} + +function __ZNSt3__29__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKw($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + var $$0$i$idx = 0, $$0$i$ptr = 0, $$0$lcssa$i = 0, $$1 = 0, $10 = 0, $11 = 0, $14 = 0, $21 = 0, $29 = 0, $34 = 0, $36 = 0, $42 = 0, $43 = 0, $56 = 0, $58 = 0, label = 0; + $10 = HEAP32[$3 >> 2] | 0; + $11 = ($10 | 0) == ($2 | 0); + do if ($11) { + $14 = (HEAP32[$9 + 96 >> 2] | 0) == ($0 | 0); + if (!$14 ? (HEAP32[$9 + 100 >> 2] | 0) != ($0 | 0) : 0) { + label = 5; + break; + } + HEAP32[$3 >> 2] = $2 + 1; + HEAP8[$2 >> 0] = $14 ? 43 : 45; + HEAP32[$4 >> 2] = 0; + $$1 = 0; + } else label = 5; while (0); + L6 : do if ((label | 0) == 5) { + $21 = HEAP8[$6 + 11 >> 0] | 0; + if (($0 | 0) == ($5 | 0) ? (($21 << 24 >> 24 < 0 ? HEAP32[$6 + 4 >> 2] | 0 : $21 & 255) | 0) != 0 : 0) { + $29 = HEAP32[$8 >> 2] | 0; + if (($29 - $7 | 0) >= 160) { + $$1 = 0; + break; + } + $34 = HEAP32[$4 >> 2] | 0; + HEAP32[$8 >> 2] = $29 + 4; + HEAP32[$29 >> 2] = $34; + HEAP32[$4 >> 2] = 0; + $$1 = 0; + break; + } + $36 = $9 + 104 | 0; + $$0$i$idx = 0; + while (1) { + $$0$i$ptr = $9 + ($$0$i$idx << 2) | 0; + if (($$0$i$idx | 0) == 26) { + $$0$lcssa$i = $36; + break; + } + if ((HEAP32[$$0$i$ptr >> 2] | 0) == ($0 | 0)) { + $$0$lcssa$i = $$0$i$ptr; + break; + } else $$0$i$idx = $$0$i$idx + 1 | 0; + } + $42 = $$0$lcssa$i - $9 | 0; + $43 = $42 >> 2; + if (($42 | 0) > 92) $$1 = -1; else { + switch ($1 | 0) { + case 10: + case 8: + { + if (($43 | 0) >= ($1 | 0)) { + $$1 = -1; + break L6; + } + break; + } + case 16: + { + if (($42 | 0) >= 88) { + if ($11) { + $$1 = -1; + break L6; + } + if (($10 - $2 | 0) >= 3) { + $$1 = -1; + break L6; + } + if ((HEAP8[$10 + -1 >> 0] | 0) != 48) { + $$1 = -1; + break L6; + } + HEAP32[$4 >> 2] = 0; + $56 = HEAP8[12928 + $43 >> 0] | 0; + HEAP32[$3 >> 2] = $10 + 1; + HEAP8[$10 >> 0] = $56; + $$1 = 0; + break L6; + } + break; + } + default: + {} + } + $58 = HEAP8[12928 + $43 >> 0] | 0; + HEAP32[$3 >> 2] = $10 + 1; + HEAP8[$10 >> 0] = $58; + HEAP32[$4 >> 2] = (HEAP32[$4 >> 2] | 0) + 1; + $$1 = 0; + } + } while (0); + return $$1 | 0; +} + +function _getMarkerInfo($id, $markerIndex) { + $id = $id | 0; + $markerIndex = $markerIndex | 0; + var $1 = 0, $arhandle = 0, $id$addr = 0, $retval$1 = 0, $spec$select = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + do if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0) { + $arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0; + $1 = HEAP32[$arhandle >> 2] | 0; + if ((HEAP32[$1 + 44 >> 2] | 0) > ($markerIndex | 0)) { + $spec$select = ($markerIndex | 0) < 0 ? 64312 : $1 + 48 + ($markerIndex << 8) | 0; + _emscripten_asm_const_iiiiiiiidddddddddddddddddddddddddi(2, HEAP32[$spec$select >> 2] | 0, HEAP32[$spec$select + 4 >> 2] | 0, HEAP32[$spec$select + 8 >> 2] | 0, HEAP32[$spec$select + 12 >> 2] | 0, HEAP32[$spec$select + 16 >> 2] | 0, HEAP32[$spec$select + 20 >> 2] | 0, HEAP32[$spec$select + 24 >> 2] | 0, +(+HEAPF64[$spec$select + 32 >> 3]), +(+HEAPF64[$spec$select + 40 >> 3]), +(+HEAPF64[$spec$select + 48 >> 3]), +(+HEAPF64[$spec$select + 56 >> 3]), +(+HEAPF64[$spec$select + 64 >> 3]), +(+HEAPF64[$spec$select + 72 >> 3]), +(+HEAPF64[$spec$select + 80 >> 3]), +(+HEAPF64[$spec$select + 88 >> 3]), +(+HEAPF64[$spec$select + 96 >> 3]), +(+HEAPF64[$spec$select + 104 >> 3]), +(+HEAPF64[$spec$select + 112 >> 3]), +(+HEAPF64[$spec$select + 120 >> 3]), +(+HEAPF64[$spec$select + 128 >> 3]), +(+HEAPF64[$spec$select + 136 >> 3]), +(+HEAPF64[$spec$select + 144 >> 3]), +(+HEAPF64[$spec$select + 152 >> 3]), +(+HEAPF64[$spec$select + 160 >> 3]), +(+HEAPF64[$spec$select + 168 >> 3]), +(+HEAPF64[$spec$select + 176 >> 3]), +(+HEAPF64[$spec$select + 184 >> 3]), +(+HEAPF64[$spec$select + 192 >> 3]), +(+HEAPF64[$spec$select + 200 >> 3]), +(+HEAPF64[$spec$select + 208 >> 3]), +(+HEAPF64[$spec$select + 216 >> 3]), +(+HEAPF64[$spec$select + 224 >> 3]), HEAP32[$spec$select + 240 >> 2] | 0) | 0; + $retval$1 = 0; + break; + } else { + $retval$1 = HEAP32[4226] | 0; + break; + } + } else $retval$1 = HEAP32[4224] | 0; while (0); + STACKTOP = sp; + return $retval$1 | 0; +} + +function __ZNSt3__29__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKc($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + var $$0$i$idx = 0, $$0$i$ptr = 0, $$0$lcssa$i = 0, $$1 = 0, $10 = 0, $11 = 0, $14 = 0, $21 = 0, $29 = 0, $34 = 0, $36 = 0, $42 = 0, $55 = 0, $57 = 0, label = 0; + $10 = HEAP32[$3 >> 2] | 0; + $11 = ($10 | 0) == ($2 | 0); + do if ($11) { + $14 = (HEAP8[$9 + 24 >> 0] | 0) == $0 << 24 >> 24; + if (!$14 ? (HEAP8[$9 + 25 >> 0] | 0) != $0 << 24 >> 24 : 0) { + label = 5; + break; + } + HEAP32[$3 >> 2] = $2 + 1; + HEAP8[$2 >> 0] = $14 ? 43 : 45; + HEAP32[$4 >> 2] = 0; + $$1 = 0; + } else label = 5; while (0); + L6 : do if ((label | 0) == 5) { + $21 = HEAP8[$6 + 11 >> 0] | 0; + if ($0 << 24 >> 24 == $5 << 24 >> 24 ? (($21 << 24 >> 24 < 0 ? HEAP32[$6 + 4 >> 2] | 0 : $21 & 255) | 0) != 0 : 0) { + $29 = HEAP32[$8 >> 2] | 0; + if (($29 - $7 | 0) >= 160) { + $$1 = 0; + break; + } + $34 = HEAP32[$4 >> 2] | 0; + HEAP32[$8 >> 2] = $29 + 4; + HEAP32[$29 >> 2] = $34; + HEAP32[$4 >> 2] = 0; + $$1 = 0; + break; + } + $36 = $9 + 26 | 0; + $$0$i$idx = 0; + while (1) { + $$0$i$ptr = $9 + $$0$i$idx | 0; + if (($$0$i$idx | 0) == 26) { + $$0$lcssa$i = $36; + break; + } + if ((HEAP8[$$0$i$ptr >> 0] | 0) == $0 << 24 >> 24) { + $$0$lcssa$i = $$0$i$ptr; + break; + } else $$0$i$idx = $$0$i$idx + 1 | 0; + } + $42 = $$0$lcssa$i - $9 | 0; + if (($42 | 0) > 23) $$1 = -1; else { + switch ($1 | 0) { + case 10: + case 8: + { + if (($42 | 0) >= ($1 | 0)) { + $$1 = -1; + break L6; + } + break; + } + case 16: + { + if (($42 | 0) >= 22) { + if ($11) { + $$1 = -1; + break L6; + } + if (($10 - $2 | 0) >= 3) { + $$1 = -1; + break L6; + } + if ((HEAP8[$10 + -1 >> 0] | 0) != 48) { + $$1 = -1; + break L6; + } + HEAP32[$4 >> 2] = 0; + $55 = HEAP8[12928 + $42 >> 0] | 0; + HEAP32[$3 >> 2] = $10 + 1; + HEAP8[$10 >> 0] = $55; + $$1 = 0; + break L6; + } + break; + } + default: + {} + } + $57 = HEAP8[12928 + $42 >> 0] | 0; + HEAP32[$3 >> 2] = $10 + 1; + HEAP8[$10 >> 0] = $57; + HEAP32[$4 >> 2] = (HEAP32[$4 >> 2] | 0) + 1; + $$1 = 0; + } + } while (0); + return $$1 | 0; +} + +function __ZN6vision25DoGScaleInvariantDetector6detectEPKNS_25GaussianScaleSpacePyramidE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $15 = 0, $19 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + if ((__ZNK6vision25GaussianScaleSpacePyramid10numOctavesEv($1) | 0) <= 0) { + $10 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 26990) | 0, 26748) | 0, 39072) | 0, 147) | 0, 39079) | 0, 27039) | 0; + __ZNKSt3__28ios_base6getlocEv($2, $10 + (HEAP32[(HEAP32[$10 >> 2] | 0) + -12 >> 2] | 0) | 0); + $15 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66512) | 0; + $19 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$15 >> 2] | 0) + 28 >> 2] & 127]($15, 10) | 0; + __ZNSt3__26localeD2Ev($2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($10, $19) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($10) | 0; + _abort(); + } + __ZN6vision11ScopedTimerC2EPKc($2, 27938); + if (__ZN6vision11ScopedTimercvbEv($2) | 0) __ZN6vision10DoGPyramid7computeEPKNS_25GaussianScaleSpacePyramidE($0 + 32 | 0, $1); + __ZN6vision11ScopedTimerD2Ev($2); + __ZN6vision11ScopedTimerC2EPKc($2, 27950); + if (__ZN6vision11ScopedTimercvbEv($2) | 0) __ZN6vision25DoGScaleInvariantDetector15extractFeaturesEPKNS_25GaussianScaleSpacePyramidEPKNS_10DoGPyramidE($0, $1, $0 + 32 | 0); + __ZN6vision11ScopedTimerD2Ev($2); + __ZN6vision11ScopedTimerC2EPKc($2, 27970); + if (__ZN6vision11ScopedTimercvbEv($2) | 0) __ZN6vision25DoGScaleInvariantDetector21findSubpixelLocationsEPKNS_25GaussianScaleSpacePyramidE($0, $1); + __ZN6vision11ScopedTimerD2Ev($2); + __ZN6vision11ScopedTimerC2EPKc($2, 27979); + if (__ZN6vision11ScopedTimercvbEv($2) | 0) __ZN6vision25DoGScaleInvariantDetector13pruneFeaturesEv($0); + __ZN6vision11ScopedTimerD2Ev($2); + __ZN6vision11ScopedTimerC2EPKc($2, 27993); + if (__ZN6vision11ScopedTimercvbEv($2) | 0) __ZN6vision25DoGScaleInvariantDetector23findFeatureOrientationsEPKNS_25GaussianScaleSpacePyramidE($0, $1); + __ZN6vision11ScopedTimerD2Ev($2); + STACKTOP = sp; + return; +} + +function _decode_mcu_DC_refine($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$021 = 0, $$035$i = 0, $16 = 0, $19 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $27 = 0, $3 = 0, $4 = 0, $54 = 0, $56 = 0, $57 = 0, $60 = 0, $61 = 0, $67 = 0, $7 = 0, $8 = 0, dest = 0, label = 0, stop = 0; + $3 = HEAP32[$0 + 468 >> 2] | 0; + $4 = $0 + 280 | 0; + if (HEAP32[$4 >> 2] | 0) { + $7 = $3 + 56 | 0; + $8 = HEAP32[$7 >> 2] | 0; + if (!$8) { + if (!(FUNCTION_TABLE_ii[HEAP32[(HEAP32[$0 + 464 >> 2] | 0) + 8 >> 2] & 127]($0) | 0)) { + $16 = HEAP32[$0 >> 2] | 0; + HEAP32[$16 + 20 >> 2] = 25; + FUNCTION_TABLE_vi[HEAP32[$16 >> 2] & 255]($0); + } + $19 = $0 + 340 | 0; + if ((HEAP32[$19 >> 2] | 0) > 0) { + $22 = $0 + 224 | 0; + $23 = $0 + 412 | 0; + $24 = $0 + 436 | 0; + $25 = $0 + 420 | 0; + $$035$i = 0; + do { + $27 = HEAP32[$0 + 344 + ($$035$i << 2) >> 2] | 0; + if (HEAP32[$22 >> 2] | 0) if (!(HEAP32[$23 >> 2] | 0)) { + if (!(HEAP32[$25 >> 2] | 0)) label = 10; + } else label = 13; else label = 10; + do if ((label | 0) == 10) { + label = 0; + dest = HEAP32[$3 + 60 + (HEAP32[$27 + 20 >> 2] << 2) >> 2] | 0; + stop = dest + 64 | 0; + do { + HEAP8[dest >> 0] = 0; + dest = dest + 1 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$3 + 24 + ($$035$i << 2) >> 2] = 0; + HEAP32[$3 + 40 + ($$035$i << 2) >> 2] = 0; + if (!(HEAP32[$22 >> 2] | 0)) if (!(HEAP32[$24 >> 2] | 0)) break; else { + label = 13; + break; + } else if (!(HEAP32[$23 >> 2] | 0)) break; else { + label = 13; + break; + } + } while (0); + if ((label | 0) == 13) { + label = 0; + _memset(HEAP32[$3 + 124 + (HEAP32[$27 + 24 >> 2] << 2) >> 2] | 0, 0, 256) | 0; + } + $$035$i = $$035$i + 1 | 0; + } while (($$035$i | 0) < (HEAP32[$19 >> 2] | 0)); + } + HEAP32[$3 + 12 >> 2] = 0; + HEAP32[$3 + 16 >> 2] = 0; + HEAP32[$3 + 20 >> 2] = -16; + $54 = HEAP32[$4 >> 2] | 0; + HEAP32[$7 >> 2] = $54; + $56 = $54; + } else $56 = $8; + HEAP32[$7 >> 2] = $56 + -1; + } + $57 = $3 + 188 | 0; + $60 = 1 << HEAP32[$0 + 424 >> 2]; + $61 = $0 + 368 | 0; + if ((HEAP32[$61 >> 2] | 0) <= 0) return 1; + $$021 = 0; + do { + if (_arith_decode($0, $57) | 0) { + $67 = HEAP32[$1 + ($$021 << 2) >> 2] | 0; + HEAP16[$67 >> 1] = $60 | (HEAPU16[$67 >> 1] | 0); + } + $$021 = $$021 + 1 | 0; + } while (($$021 | 0) < (HEAP32[$61 >> 2] | 0)); + return 1; +} + +function __ZNK6vision25GaussianScaleSpacePyramid3getEmm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $12 = 0, $17 = 0, $21 = 0, $23 = 0, $3 = 0, $30 = 0, $35 = 0, $39 = 0, $41 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + if ((HEAP32[$0 + 16 >> 2] | 0) >>> 0 <= $1 >>> 0) { + $12 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 38089) | 0, 37972) | 0, 39072) | 0, 218) | 0, 39079) | 0, 26868) | 0; + __ZNKSt3__28ios_base6getlocEv($3, $12 + (HEAP32[(HEAP32[$12 >> 2] | 0) + -12 >> 2] | 0) | 0); + $17 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66512) | 0; + $21 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$17 >> 2] | 0) + 28 >> 2] & 127]($17, 10) | 0; + __ZNSt3__26localeD2Ev($3); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($12, $21) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($12) | 0; + _abort(); + } + $23 = HEAP32[$0 + 20 >> 2] | 0; + if ($23 >>> 0 > $2 >>> 0) { + $41 = (Math_imul($23, $1) | 0) + $2 | 0; + STACKTOP = sp; + return (HEAP32[$0 + 4 >> 2] | 0) + ($41 << 5) | 0; + } else { + $30 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 38233) | 0, 37972) | 0, 39072) | 0, 219) | 0, 39079) | 0, 26888) | 0; + __ZNKSt3__28ios_base6getlocEv($3, $30 + (HEAP32[(HEAP32[$30 >> 2] | 0) + -12 >> 2] | 0) | 0); + $35 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66512) | 0; + $39 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$35 >> 2] | 0) + 28 >> 2] & 127]($35, 10) | 0; + __ZNSt3__26localeD2Ev($3); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($30, $39) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($30) | 0; + _abort(); + } + return 0; +} + +function _arParamChangeSize($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$0103 = 0, $12 = 0.0, $27 = 0, $7 = 0.0, label = 0; + $7 = +($1 | 0) / +(HEAP32[$0 >> 2] | 0); + $12 = +($2 | 0) / +(HEAP32[$0 + 4 >> 2] | 0); + HEAP32[$3 >> 2] = $1; + HEAP32[$3 + 4 >> 2] = $2; + $$0 = 0; + while (1) { + if (($$0 | 0) == 4) break; + HEAPF64[$3 + 8 + ($$0 << 3) >> 3] = $7 * +HEAPF64[$0 + 8 + ($$0 << 3) >> 3]; + HEAPF64[$3 + 40 + ($$0 << 3) >> 3] = $12 * +HEAPF64[$0 + 40 + ($$0 << 3) >> 3]; + HEAPF64[$3 + 72 + ($$0 << 3) >> 3] = +HEAPF64[$0 + 72 + ($$0 << 3) >> 3]; + $$0 = $$0 + 1 | 0; + } + $27 = HEAP32[$0 + 176 >> 2] | 0; + switch ($27 | 0) { + case 4: + { + HEAPF64[$3 + 104 >> 3] = +HEAPF64[$0 + 104 >> 3]; + HEAPF64[$3 + 112 >> 3] = +HEAPF64[$0 + 112 >> 3]; + HEAPF64[$3 + 120 >> 3] = +HEAPF64[$0 + 120 >> 3]; + HEAPF64[$3 + 128 >> 3] = +HEAPF64[$0 + 128 >> 3]; + HEAPF64[$3 + 136 >> 3] = $7 * +HEAPF64[$0 + 136 >> 3]; + HEAPF64[$3 + 144 >> 3] = $12 * +HEAPF64[$0 + 144 >> 3]; + HEAPF64[$3 + 152 >> 3] = $7 * +HEAPF64[$0 + 152 >> 3]; + HEAPF64[$3 + 160 >> 3] = $12 * +HEAPF64[$0 + 160 >> 3]; + HEAPF64[$3 + 168 >> 3] = +HEAPF64[$0 + 168 >> 3]; + label = 9; + break; + } + case 3: + { + HEAPF64[$3 + 104 >> 3] = $7 * +HEAPF64[$0 + 104 >> 3]; + HEAPF64[$3 + 112 >> 3] = $12 * +HEAPF64[$0 + 112 >> 3]; + HEAPF64[$3 + 120 >> 3] = +HEAPF64[$0 + 120 >> 3]; + HEAPF64[$3 + 128 >> 3] = +HEAPF64[$0 + 128 >> 3]; + HEAPF64[$3 + 136 >> 3] = +HEAPF64[$0 + 136 >> 3] / ($7 * $12); + HEAPF64[$3 + 144 >> 3] = +HEAPF64[$0 + 144 >> 3] / ($12 * ($7 * $7 * $12)); + label = 9; + break; + } + case 2: + { + HEAPF64[$3 + 104 >> 3] = $7 * +HEAPF64[$0 + 104 >> 3]; + HEAPF64[$3 + 112 >> 3] = $12 * +HEAPF64[$0 + 112 >> 3]; + HEAPF64[$3 + 120 >> 3] = +HEAPF64[$0 + 120 >> 3]; + HEAPF64[$3 + 128 >> 3] = +HEAPF64[$0 + 128 >> 3] / ($7 * $12); + HEAPF64[$3 + 136 >> 3] = +HEAPF64[$0 + 136 >> 3] / ($12 * ($7 * $7 * $12)); + label = 9; + break; + } + case 1: + { + HEAPF64[$3 + 104 >> 3] = $7 * +HEAPF64[$0 + 104 >> 3]; + HEAPF64[$3 + 112 >> 3] = $12 * +HEAPF64[$0 + 112 >> 3]; + HEAPF64[$3 + 120 >> 3] = +HEAPF64[$0 + 120 >> 3]; + HEAPF64[$3 + 128 >> 3] = +HEAPF64[$0 + 128 >> 3] / ($7 * $12); + label = 9; + break; + } + default: + $$0103 = -1; + } + if ((label | 0) == 9) { + HEAP32[$3 + 176 >> 2] = $27; + $$0103 = 0; + } + return $$0103 | 0; +} + +function __ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$alloca_mul = 0, $$alloca_mul6 = 0, $$byval_copy = 0, $$lobit = 0, $10 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $20 = 0, $24 = 0, $26 = 0, $27 = 0, $28 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp; + $5 = sp + 16 | 0; + $6 = sp + 12 | 0; + $7 = sp + 4 | 0; + $8 = sp + 8 | 0; + HEAP8[$5 >> 0] = HEAP8[59189] | 0; + HEAP8[$5 + 1 >> 0] = HEAP8[59190] | 0; + HEAP8[$5 + 2 >> 0] = HEAP8[59191] | 0; + HEAP8[$5 + 3 >> 0] = HEAP8[59192] | 0; + HEAP8[$5 + 4 >> 0] = HEAP8[59193] | 0; + HEAP8[$5 + 5 >> 0] = HEAP8[59194] | 0; + $10 = $2 + 4 | 0; + __ZNSt3__214__num_put_base12__format_intEPcPKcbj($5 + 1 | 0, 59195, 1, HEAP32[$10 >> 2] | 0); + $$lobit = (HEAP32[$10 >> 2] | 0) >>> 9 & 1; + $14 = $$lobit + 13 | 0; + $15 = _llvm_stacksave() | 0; + $$alloca_mul = $14; + $16 = STACKTOP; + STACKTOP = STACKTOP + ((1 * $$alloca_mul | 0) + 15 & -16) | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow((1 * $$alloca_mul | 0) + 15 & -16 | 0); + $17 = __ZNSt3__26__clocEv() | 0; + HEAP32[$$byval_copy >> 2] = $4; + $19 = $16 + (__ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($16, $14, $17, $5, $$byval_copy) | 0) | 0; + $20 = __ZNSt3__214__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE($16, $19, $2) | 0; + $$alloca_mul6 = ($$lobit << 1 | 24) + -1 << 2; + $24 = STACKTOP; + STACKTOP = STACKTOP + ((1 * $$alloca_mul6 | 0) + 15 & -16) | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow((1 * $$alloca_mul6 | 0) + 15 & -16 | 0); + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $2); + __ZNSt3__29__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE($16, $20, $19, $24, $6, $7, $$byval_copy); + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$8 >> 2] = HEAP32[$1 >> 2]; + $26 = HEAP32[$6 >> 2] | 0; + $27 = HEAP32[$7 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$8 >> 2]; + $28 = __ZNSt3__216__pad_and_outputIwNS_11char_traitsIwEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $24, $26, $27, $2, $3) | 0; + _llvm_stackrestore($15 | 0); + STACKTOP = sp; + return $28 | 0; +} + +function __ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$alloca_mul = 0, $$alloca_mul6 = 0, $$byval_copy = 0, $$lobit = 0, $10 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $20 = 0, $24 = 0, $26 = 0, $27 = 0, $28 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp; + $5 = sp + 16 | 0; + $6 = sp + 12 | 0; + $7 = sp + 4 | 0; + $8 = sp + 8 | 0; + HEAP8[$5 >> 0] = HEAP8[59189] | 0; + HEAP8[$5 + 1 >> 0] = HEAP8[59190] | 0; + HEAP8[$5 + 2 >> 0] = HEAP8[59191] | 0; + HEAP8[$5 + 3 >> 0] = HEAP8[59192] | 0; + HEAP8[$5 + 4 >> 0] = HEAP8[59193] | 0; + HEAP8[$5 + 5 >> 0] = HEAP8[59194] | 0; + $10 = $2 + 4 | 0; + __ZNSt3__214__num_put_base12__format_intEPcPKcbj($5 + 1 | 0, 59195, 1, HEAP32[$10 >> 2] | 0); + $$lobit = (HEAP32[$10 >> 2] | 0) >>> 9 & 1; + $14 = $$lobit + 13 | 0; + $15 = _llvm_stacksave() | 0; + $$alloca_mul = $14; + $16 = STACKTOP; + STACKTOP = STACKTOP + ((1 * $$alloca_mul | 0) + 15 & -16) | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow((1 * $$alloca_mul | 0) + 15 & -16 | 0); + $17 = __ZNSt3__26__clocEv() | 0; + HEAP32[$$byval_copy >> 2] = $4; + $19 = $16 + (__ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($16, $14, $17, $5, $$byval_copy) | 0) | 0; + $20 = __ZNSt3__214__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE($16, $19, $2) | 0; + $$alloca_mul6 = ($$lobit << 1 | 24) + -1 | 0; + $24 = STACKTOP; + STACKTOP = STACKTOP + ((1 * $$alloca_mul6 | 0) + 15 & -16) | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow((1 * $$alloca_mul6 | 0) + 15 & -16 | 0); + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $2); + __ZNSt3__29__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE($16, $20, $19, $24, $6, $7, $$byval_copy); + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$8 >> 2] = HEAP32[$1 >> 2]; + $26 = HEAP32[$6 >> 2] | 0; + $27 = HEAP32[$7 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$8 >> 2]; + $28 = __ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $24, $26, $27, $2, $3) | 0; + _llvm_stackrestore($15 | 0); + STACKTOP = sp; + return $28 | 0; +} + +function __ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$alloca_mul = 0, $$alloca_mul6 = 0, $$byval_copy = 0, $$lobit = 0, $10 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $20 = 0, $23 = 0, $25 = 0, $26 = 0, $27 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp; + $5 = sp + 16 | 0; + $6 = sp + 12 | 0; + $7 = sp + 4 | 0; + $8 = sp + 8 | 0; + HEAP8[$5 >> 0] = HEAP8[59189] | 0; + HEAP8[$5 + 1 >> 0] = HEAP8[59190] | 0; + HEAP8[$5 + 2 >> 0] = HEAP8[59191] | 0; + HEAP8[$5 + 3 >> 0] = HEAP8[59192] | 0; + HEAP8[$5 + 4 >> 0] = HEAP8[59193] | 0; + HEAP8[$5 + 5 >> 0] = HEAP8[59194] | 0; + $10 = $2 + 4 | 0; + __ZNSt3__214__num_put_base12__format_intEPcPKcbj($5 + 1 | 0, 59195, 0, HEAP32[$10 >> 2] | 0); + $$lobit = (HEAP32[$10 >> 2] | 0) >>> 9 & 1; + $14 = $$lobit | 12; + $15 = _llvm_stacksave() | 0; + $$alloca_mul = $14; + $16 = STACKTOP; + STACKTOP = STACKTOP + ((1 * $$alloca_mul | 0) + 15 & -16) | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow((1 * $$alloca_mul | 0) + 15 & -16 | 0); + $17 = __ZNSt3__26__clocEv() | 0; + HEAP32[$$byval_copy >> 2] = $4; + $19 = $16 + (__ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($16, $14, $17, $5, $$byval_copy) | 0) | 0; + $20 = __ZNSt3__214__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE($16, $19, $2) | 0; + $$alloca_mul6 = ($$lobit << 1 | 21) << 2; + $23 = STACKTOP; + STACKTOP = STACKTOP + ((1 * $$alloca_mul6 | 0) + 15 & -16) | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow((1 * $$alloca_mul6 | 0) + 15 & -16 | 0); + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $2); + __ZNSt3__29__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE($16, $20, $19, $23, $6, $7, $$byval_copy); + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$8 >> 2] = HEAP32[$1 >> 2]; + $25 = HEAP32[$6 >> 2] | 0; + $26 = HEAP32[$7 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$8 >> 2]; + $27 = __ZNSt3__216__pad_and_outputIwNS_11char_traitsIwEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $23, $25, $26, $2, $3) | 0; + _llvm_stackrestore($15 | 0); + STACKTOP = sp; + return $27 | 0; +} + +function __ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$alloca_mul = 0, $$alloca_mul6 = 0, $$byval_copy = 0, $$lobit = 0, $10 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $20 = 0, $23 = 0, $25 = 0, $26 = 0, $27 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp; + $5 = sp + 16 | 0; + $6 = sp + 12 | 0; + $7 = sp + 4 | 0; + $8 = sp + 8 | 0; + HEAP8[$5 >> 0] = HEAP8[59189] | 0; + HEAP8[$5 + 1 >> 0] = HEAP8[59190] | 0; + HEAP8[$5 + 2 >> 0] = HEAP8[59191] | 0; + HEAP8[$5 + 3 >> 0] = HEAP8[59192] | 0; + HEAP8[$5 + 4 >> 0] = HEAP8[59193] | 0; + HEAP8[$5 + 5 >> 0] = HEAP8[59194] | 0; + $10 = $2 + 4 | 0; + __ZNSt3__214__num_put_base12__format_intEPcPKcbj($5 + 1 | 0, 59195, 0, HEAP32[$10 >> 2] | 0); + $$lobit = (HEAP32[$10 >> 2] | 0) >>> 9 & 1; + $14 = $$lobit | 12; + $15 = _llvm_stacksave() | 0; + $$alloca_mul = $14; + $16 = STACKTOP; + STACKTOP = STACKTOP + ((1 * $$alloca_mul | 0) + 15 & -16) | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow((1 * $$alloca_mul | 0) + 15 & -16 | 0); + $17 = __ZNSt3__26__clocEv() | 0; + HEAP32[$$byval_copy >> 2] = $4; + $19 = $16 + (__ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($16, $14, $17, $5, $$byval_copy) | 0) | 0; + $20 = __ZNSt3__214__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE($16, $19, $2) | 0; + $$alloca_mul6 = $$lobit << 1 | 21; + $23 = STACKTOP; + STACKTOP = STACKTOP + ((1 * $$alloca_mul6 | 0) + 15 & -16) | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow((1 * $$alloca_mul6 | 0) + 15 & -16 | 0); + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $2); + __ZNSt3__29__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE($16, $20, $19, $23, $6, $7, $$byval_copy); + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$8 >> 2] = HEAP32[$1 >> 2]; + $25 = HEAP32[$6 >> 2] | 0; + $26 = HEAP32[$7 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$8 >> 2]; + $27 = __ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $23, $25, $26, $2, $3) | 0; + _llvm_stackrestore($15 | 0); + STACKTOP = sp; + return $27 | 0; +} + +function __ZNK6vision25GaussianScaleSpacePyramid14effectiveSigmaEmf($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = +$2; + var $10 = 0, $15 = 0, $19 = 0, $29 = 0, $3 = 0, $34 = 0, $38 = 0, $44 = 0.0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + if (!($2 >= 0.0)) { + $10 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 38176) | 0, 37972) | 0, 39072) | 0, 232) | 0, 39079) | 0, 38210) | 0; + __ZNKSt3__28ios_base6getlocEv($3, $10 + (HEAP32[(HEAP32[$10 >> 2] | 0) + -12 >> 2] | 0) | 0); + $15 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66512) | 0; + $19 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$15 >> 2] | 0) + 28 >> 2] & 127]($15, 10) | 0; + __ZNSt3__26localeD2Ev($3); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($10, $19) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($10) | 0; + _abort(); + } + if (+(HEAP32[$0 + 20 >> 2] | 0) > $2) { + $44 = +Math_pow(+(+HEAPF32[$0 + 24 >> 2]), +$2) * +(1 << $1 | 0); + STACKTOP = sp; + return +$44; + } else { + $29 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 38233) | 0, 37972) | 0, 39072) | 0, 233) | 0, 39079) | 0, 38284) | 0; + __ZNKSt3__28ios_base6getlocEv($3, $29 + (HEAP32[(HEAP32[$29 >> 2] | 0) + -12 >> 2] | 0) | 0); + $34 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66512) | 0; + $38 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$34 >> 2] | 0) + 28 >> 2] & 127]($34, 10) | 0; + __ZNSt3__26localeD2Ev($3); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($29, $38) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($29) | 0; + _abort(); + } + return +(0.0); +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E18parseClassEnumTypeEv($0) { + $0 = $0 | 0; + var $$0 = 0, $$byval_copy2 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy2 = sp + 32 | 0; + $1 = sp; + $2 = sp + 24 | 0; + $3 = sp + 16 | 0; + $4 = sp + 8 | 0; + __ZN12_GLOBAL__N_110StringViewC2Ev($1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 55028); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + do if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy2) | 0)) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 55038); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy2) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($1, 55041); + break; + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 55047); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy2) | 0) __ZN12_GLOBAL__N_110StringViewC2EPKc($1, 55050); + } else __ZN12_GLOBAL__N_110StringViewC2EPKc($1, 55031); while (0); + $9 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseNameEPNS5_9NameStateE(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0, 0) | 0; + HEAP32[$$byval_copy2 >> 2] = $9; + if ($9) if (__ZNK12_GLOBAL__N_110StringView5emptyEv($1) | 0) $$0 = $9; else $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_22ElaboratedTypeSpefTypeEJRNS_10StringViewERPNS0_4NodeEEEESB_DpOT0_($0, $1, $$byval_copy2) | 0; else $$0 = 0; + STACKTOP = sp; + return $$0 | 0; +} + +function _ar2GenImageLayer2($0, $1) { + $0 = $0 | 0; + $1 = +$1; + var $$0 = 0, $$087 = 0, $$089 = 0, $$090 = 0, $$091 = 0, $$092 = 0, $$095 = 0, $$096 = 0, $$1 = 0, $$188 = 0, $$197 = 0, $10 = 0, $15 = 0, $16 = 0, $2 = 0, $22 = 0, $26 = 0.0, $29 = 0, $30 = 0, $34 = 0, $35 = 0, $39 = 0.0, $42 = 0, $43 = 0, $47 = 0, $48 = 0, $59 = 0, $6 = 0, $7 = 0.0, $9 = 0, $spec$select = 0, $spec$select98 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = $0 + 4 | 0; + $6 = $0 + 12 | 0; + $7 = +HEAPF32[$6 >> 2]; + $9 = _lroundf(+(HEAP32[$2 >> 2] | 0) * $1 / $7) | 0; + $10 = $0 + 8 | 0; + $15 = _lroundf(+(HEAP32[$10 >> 2] | 0) * $1 / $7) | 0; + $16 = _malloc(16) | 0; + if (!$16) { + _arLog(0, 3, 45930, sp); + _exit(1); + } + HEAP32[$16 + 4 >> 2] = $9; + HEAP32[$16 + 8 >> 2] = $15; + HEAPF32[$16 + 12 >> 2] = $1; + $22 = _malloc(Math_imul($15, $9) | 0) | 0; + HEAP32[$16 >> 2] = $22; + if (!$22) { + _arLog(0, 3, 45930, sp + 8 | 0); + _exit(1); + } + $$091 = 0; + $$096 = $22; + while (1) { + if (($$091 | 0) >= ($15 | 0)) break; + $26 = +HEAPF32[$6 >> 2]; + $29 = _lroundf($26 * +($$091 | 0) / $1) | 0; + $30 = $$091 + 1 | 0; + $34 = _lroundf($26 * +($30 | 0) / $1) | 0; + $35 = HEAP32[$10 >> 2] | 0; + $spec$select = ($34 | 0) > ($35 | 0) ? $35 : $34; + $$092 = 0; + $$197 = $$096; + while (1) { + if (($$092 | 0) >= ($9 | 0)) break; + $39 = +HEAPF32[$6 >> 2]; + $42 = _lroundf($39 * +($$092 | 0) / $1) | 0; + $43 = $$092 + 1 | 0; + $47 = _lroundf($39 * +($43 | 0) / $1) | 0; + $48 = HEAP32[$2 >> 2] | 0; + $spec$select98 = ($47 | 0) > ($48 | 0) ? $48 : $47; + $$0 = 0; + $$087 = 0; + $$089 = $29; + while (1) { + if (($$089 | 0) >= ($spec$select | 0)) break; + $$090 = $42; + $$095 = (HEAP32[$0 >> 2] | 0) + ((Math_imul($$089, $48) | 0) + $42) | 0; + $$1 = $$0; + $$188 = $$087; + while (1) { + if (($$090 | 0) >= ($spec$select98 | 0)) break; + $59 = $$1 + (HEAPU8[$$095 >> 0] | 0) | 0; + $$090 = $$090 + 1 | 0; + $$095 = $$095 + 1 | 0; + $$1 = $59; + $$188 = $$188 + 1 | 0; + } + $$0 = $$1; + $$087 = $$188; + $$089 = $$089 + 1 | 0; + } + HEAP8[$$197 >> 0] = ($$0 | 0) / ($$087 | 0) | 0; + $$092 = $43; + $$197 = $$197 + 1 | 0; + } + $$091 = $30; + $$096 = $$197; + } + STACKTOP = sp; + return $16 | 0; +} + +function _free_pool($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$07181 = 0, $$07182 = 0, $$07286 = 0, $$07287 = 0, $$in7477 = 0, $$in7576 = 0, $11 = 0, $13 = 0, $21 = 0, $23 = 0, $3 = 0, $31 = 0, $32 = 0, $34 = 0, $41 = 0, $45 = 0, $46 = 0, $48 = 0, $5 = 0, $55 = 0, $$in7477$looptemp = 0, $$in7576$looptemp = 0; + $3 = HEAP32[$0 + 4 >> 2] | 0; + if ($1 >>> 0 <= 1) { + if (($1 | 0) == 1) { + $11 = $3 + 68 | 0; + $$07286 = HEAP32[$11 >> 2] | 0; + if ($$07286 | 0) { + $$07287 = $$07286; + do { + $13 = $$07287 + 40 | 0; + if (HEAP32[$13 >> 2] | 0) { + HEAP32[$13 >> 2] = 0; + FUNCTION_TABLE_vii[HEAP32[$$07287 + 56 >> 2] & 255]($0, $$07287 + 48 | 0); + } + $$07287 = HEAP32[$$07287 + 44 >> 2] | 0; + } while (($$07287 | 0) != 0); + } + HEAP32[$11 >> 2] = 0; + $21 = $3 + 72 | 0; + $$07181 = HEAP32[$21 >> 2] | 0; + if ($$07181 | 0) { + $$07182 = $$07181; + do { + $23 = $$07182 + 40 | 0; + if (HEAP32[$23 >> 2] | 0) { + HEAP32[$23 >> 2] = 0; + FUNCTION_TABLE_vii[HEAP32[$$07182 + 56 >> 2] & 255]($0, $$07182 + 48 | 0); + } + $$07182 = HEAP32[$$07182 + 44 >> 2] | 0; + } while (($$07182 | 0) != 0); + } + HEAP32[$21 >> 2] = 0; + } + } else { + $5 = HEAP32[$0 >> 2] | 0; + HEAP32[$5 + 20 >> 2] = 15; + HEAP32[$5 + 24 >> 2] = $1; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $31 = $3 + 60 + ($1 << 2) | 0; + $32 = HEAP32[$31 >> 2] | 0; + HEAP32[$31 >> 2] = 0; + if ($32 | 0) { + $34 = $3 + 76 | 0; + $$in7477 = $32; + do { + $$in7477$looptemp = $$in7477; + $$in7477 = HEAP32[$$in7477 >> 2] | 0; + $41 = (HEAP32[$$in7477$looptemp + 4 >> 2] | 0) + 16 + (HEAP32[$$in7477$looptemp + 8 >> 2] | 0) | 0; + _jpeg_free_large($0, $$in7477$looptemp, $41); + HEAP32[$34 >> 2] = (HEAP32[$34 >> 2] | 0) - $41; + } while (($$in7477 | 0) != 0); + } + $45 = $3 + 52 + ($1 << 2) | 0; + $46 = HEAP32[$45 >> 2] | 0; + HEAP32[$45 >> 2] = 0; + if (!$46) return; + $48 = $3 + 76 | 0; + $$in7576 = $46; + do { + $$in7576$looptemp = $$in7576; + $$in7576 = HEAP32[$$in7576 >> 2] | 0; + $55 = (HEAP32[$$in7576$looptemp + 4 >> 2] | 0) + 16 + (HEAP32[$$in7576$looptemp + 8 >> 2] | 0) | 0; + _jpeg_free_small($0, $$in7576$looptemp, $55); + HEAP32[$48 >> 2] = (HEAP32[$48 >> 2] | 0) - $55; + } while (($$in7576 | 0) != 0); + return; +} + +function __ZNK6vision5Timer19duration_in_secondsEv($0) { + $0 = $0 | 0; + var $1 = 0, $14 = 0, $18 = 0, $2 = 0.0, $20 = 0.0, $27 = 0, $32 = 0, $36 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + $2 = +HEAPF64[$0 >> 3]; + if (!($2 >= 0.0)) { + $9 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 38960) | 0, 38999) | 0, 39072) | 0, 80) | 0, 39079) | 0, 39082) | 0; + __ZNKSt3__28ios_base6getlocEv($1, $9 + (HEAP32[(HEAP32[$9 >> 2] | 0) + -12 >> 2] | 0) | 0); + $14 = __ZNKSt3__26locale9use_facetERNS0_2idE($1, 66512) | 0; + $18 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$14 >> 2] | 0) + 28 >> 2] & 127]($14, 10) | 0; + __ZNSt3__26localeD2Ev($1); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($9, $18) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($9) | 0; + _abort(); + } + $20 = +HEAPF64[$0 + 8 >> 3]; + if (!($20 >= 0.0)) { + $27 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 39109) | 0, 38999) | 0, 39072) | 0, 81) | 0, 39079) | 0, 39147) | 0; + __ZNKSt3__28ios_base6getlocEv($1, $27 + (HEAP32[(HEAP32[$27 >> 2] | 0) + -12 >> 2] | 0) | 0); + $32 = __ZNKSt3__26locale9use_facetERNS0_2idE($1, 66512) | 0; + $36 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$32 >> 2] | 0) + 28 >> 2] & 127]($32, 10) | 0; + __ZNSt3__26localeD2Ev($1); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($27, $36) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($27) | 0; + _abort(); + } else { + STACKTOP = sp; + return +($20 - $2); + } + return +(0.0); +} + +function _get_cpara($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$1 = 0, $11 = 0, $24 = 0, $3 = 0, $4 = 0, $5 = 0, $51 = 0, $6 = 0, $64 = 0, $65 = 0, $71 = 0, $72 = 0, $8 = 0, $9 = 0; + $3 = _arMatrixAlloc(8, 8) | 0; + $4 = _arMatrixAlloc(8, 1) | 0; + $5 = _arMatrixAlloc(8, 1) | 0; + $$0 = 0; + while (1) { + if (($$0 | 0) == 4) break; + $6 = $0 + ($$0 << 4) | 0; + $8 = HEAP32[$3 >> 2] | 0; + $9 = $$0 << 4; + HEAPF64[$8 + ($9 << 3) >> 3] = +HEAPF64[$6 >> 3]; + $11 = $0 + ($$0 << 4) + 8 | 0; + HEAPF64[$8 + (($9 | 1) << 3) >> 3] = +HEAPF64[$11 >> 3]; + HEAPF64[$8 + (($9 | 2) << 3) >> 3] = 1.0; + HEAPF64[$8 + (($9 | 3) << 3) >> 3] = 0.0; + HEAPF64[$8 + (($9 | 4) << 3) >> 3] = 0.0; + HEAPF64[$8 + (($9 | 5) << 3) >> 3] = 0.0; + $24 = $1 + ($$0 << 4) | 0; + HEAPF64[$8 + (($9 | 6) << 3) >> 3] = -(+HEAPF64[$6 >> 3] * +HEAPF64[$24 >> 3]); + HEAPF64[$8 + (($9 | 7) << 3) >> 3] = -(+HEAPF64[$11 >> 3] * +HEAPF64[$24 >> 3]); + HEAPF64[$8 + (($9 | 8) << 3) >> 3] = 0.0; + HEAPF64[$8 + (($9 | 9) << 3) >> 3] = 0.0; + HEAPF64[$8 + (($9 | 10) << 3) >> 3] = 0.0; + HEAPF64[$8 + (($9 | 11) << 3) >> 3] = +HEAPF64[$6 >> 3]; + HEAPF64[$8 + (($9 | 12) << 3) >> 3] = +HEAPF64[$11 >> 3]; + HEAPF64[$8 + (($9 | 13) << 3) >> 3] = 1.0; + $51 = $1 + ($$0 << 4) + 8 | 0; + HEAPF64[$8 + (($9 | 14) << 3) >> 3] = -(+HEAPF64[$6 >> 3] * +HEAPF64[$51 >> 3]); + HEAPF64[$8 + (($9 | 15) << 3) >> 3] = -(+HEAPF64[$11 >> 3] * +HEAPF64[$51 >> 3]); + $64 = HEAP32[$4 >> 2] | 0; + $65 = $$0 << 1; + HEAPF64[$64 + ($65 << 3) >> 3] = +HEAPF64[$24 >> 3]; + HEAPF64[$64 + (($65 | 1) << 3) >> 3] = +HEAPF64[$51 >> 3]; + $$0 = $$0 + 1 | 0; + } + _arMatrixSelfInv($3) | 0; + _arMatrixMul($5, $3, $4) | 0; + $71 = HEAP32[$5 >> 2] | 0; + $$1 = 0; + while (1) { + if (($$1 | 0) == 2) break; + $72 = $$1 * 3 | 0; + HEAPF64[$2 + ($$1 * 24 | 0) >> 3] = +HEAPF64[$71 + ($72 << 3) >> 3]; + HEAPF64[$2 + ($$1 * 24 | 0) + 8 >> 3] = +HEAPF64[$71 + ($72 + 1 << 3) >> 3]; + HEAPF64[$2 + ($$1 * 24 | 0) + 16 >> 3] = +HEAPF64[$71 + ($72 + 2 << 3) >> 3]; + $$1 = $$1 + 1 | 0; + } + HEAPF64[$2 + 48 >> 3] = +HEAPF64[$71 + 48 >> 3]; + HEAPF64[$2 + 56 >> 3] = +HEAPF64[$71 + 56 >> 3]; + HEAPF64[$2 + 64 >> 3] = 1.0; + _arMatrixFree($3) | 0; + _arMatrixFree($4) | 0; + _arMatrixFree($5) | 0; + return; +} + +function __ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$alloca_mul = 0, $$alloca_mul6 = 0, $$byval_copy = 0, $$lobit = 0, $10 = 0, $15 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $28 = 0, $29 = 0, $33 = 0, $35 = 0, $36 = 0, $37 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp + 8 | 0; + $6 = sp; + $7 = sp + 24 | 0; + $8 = sp + 16 | 0; + $9 = sp + 20 | 0; + $10 = $6; + HEAP32[$10 >> 2] = 37; + HEAP32[$10 + 4 >> 2] = 0; + $15 = $2 + 4 | 0; + __ZNSt3__214__num_put_base12__format_intEPcPKcbj($6 + 1 | 0, 59186, 1, HEAP32[$15 >> 2] | 0); + $$lobit = (HEAP32[$15 >> 2] | 0) >>> 9 & 1; + $19 = $$lobit + 23 | 0; + $20 = _llvm_stacksave() | 0; + $$alloca_mul = $19; + $21 = STACKTOP; + STACKTOP = STACKTOP + ((1 * $$alloca_mul | 0) + 15 & -16) | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow((1 * $$alloca_mul | 0) + 15 & -16 | 0); + $22 = __ZNSt3__26__clocEv() | 0; + $23 = $$byval_copy; + HEAP32[$23 >> 2] = $4; + HEAP32[$23 + 4 >> 2] = $5; + $28 = $21 + (__ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($21, $19, $22, $6, $$byval_copy) | 0) | 0; + $29 = __ZNSt3__214__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE($21, $28, $2) | 0; + $$alloca_mul6 = ($$lobit << 1 | 44) + -1 << 2; + $33 = STACKTOP; + STACKTOP = STACKTOP + ((1 * $$alloca_mul6 | 0) + 15 & -16) | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow((1 * $$alloca_mul6 | 0) + 15 & -16 | 0); + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $2); + __ZNSt3__29__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE($21, $29, $28, $33, $7, $8, $$byval_copy); + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$9 >> 2] = HEAP32[$1 >> 2]; + $35 = HEAP32[$7 >> 2] | 0; + $36 = HEAP32[$8 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$9 >> 2]; + $37 = __ZNSt3__216__pad_and_outputIwNS_11char_traitsIwEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $33, $35, $36, $2, $3) | 0; + _llvm_stackrestore($20 | 0); + STACKTOP = sp; + return $37 | 0; +} + +function __ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$alloca_mul = 0, $$alloca_mul6 = 0, $$byval_copy = 0, $$lobit = 0, $10 = 0, $15 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $28 = 0, $29 = 0, $33 = 0, $35 = 0, $36 = 0, $37 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp + 8 | 0; + $6 = sp; + $7 = sp + 24 | 0; + $8 = sp + 16 | 0; + $9 = sp + 20 | 0; + $10 = $6; + HEAP32[$10 >> 2] = 37; + HEAP32[$10 + 4 >> 2] = 0; + $15 = $2 + 4 | 0; + __ZNSt3__214__num_put_base12__format_intEPcPKcbj($6 + 1 | 0, 59186, 1, HEAP32[$15 >> 2] | 0); + $$lobit = (HEAP32[$15 >> 2] | 0) >>> 9 & 1; + $19 = $$lobit + 23 | 0; + $20 = _llvm_stacksave() | 0; + $$alloca_mul = $19; + $21 = STACKTOP; + STACKTOP = STACKTOP + ((1 * $$alloca_mul | 0) + 15 & -16) | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow((1 * $$alloca_mul | 0) + 15 & -16 | 0); + $22 = __ZNSt3__26__clocEv() | 0; + $23 = $$byval_copy; + HEAP32[$23 >> 2] = $4; + HEAP32[$23 + 4 >> 2] = $5; + $28 = $21 + (__ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($21, $19, $22, $6, $$byval_copy) | 0) | 0; + $29 = __ZNSt3__214__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE($21, $28, $2) | 0; + $$alloca_mul6 = ($$lobit << 1 | 44) + -1 | 0; + $33 = STACKTOP; + STACKTOP = STACKTOP + ((1 * $$alloca_mul6 | 0) + 15 & -16) | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow((1 * $$alloca_mul6 | 0) + 15 & -16 | 0); + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $2); + __ZNSt3__29__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE($21, $29, $28, $33, $7, $8, $$byval_copy); + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$9 >> 2] = HEAP32[$1 >> 2]; + $35 = HEAP32[$7 >> 2] | 0; + $36 = HEAP32[$8 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$9 >> 2]; + $37 = __ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $33, $35, $36, $2, $3) | 0; + _llvm_stackrestore($20 | 0); + STACKTOP = sp; + return $37 | 0; +} + +function __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE23__append_forward_unsafeIPcEERS5_T_S9_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$034 = 0, $15 = 0, $22 = 0, $23 = 0, $26 = 0, $27 = 0, $3 = 0, $35 = 0, $36 = 0, $4 = 0, $44 = 0, $49 = 0, $5 = 0, $6 = 0, $7 = 0, $scevgep38 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = $1; + $4 = sp; + $5 = $0 + 11 | 0; + $6 = HEAP8[$5 >> 0] | 0; + $7 = $6 << 24 >> 24 < 0; + if ($7) { + $35 = HEAP32[$0 + 4 >> 2] | 0; + $36 = (HEAP32[$0 + 8 >> 2] & 2147483647) + -1 | 0; + } else { + $35 = $6 & 255; + $36 = 10; + } + $15 = $2 - $3 | 0; + do if ($15 | 0) { + if ($7) { + $22 = HEAP32[$0 >> 2] | 0; + $23 = HEAP32[$0 + 4 >> 2] | 0; + } else { + $22 = $0; + $23 = $6 & 255; + } + if (__ZNSt3__214__ptr_in_rangeIcEEbPKT_S3_S3_($1, $22, $22 + $23 | 0) | 0) { + HEAP32[$4 >> 2] = 0; + HEAP32[$4 + 4 >> 2] = 0; + HEAP32[$4 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initIPcEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeES9_S9_($4, $1, $2); + $26 = HEAP8[$4 + 11 >> 0] | 0; + $27 = $26 << 24 >> 24 < 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm($0, $27 ? HEAP32[$4 >> 2] | 0 : $4, $27 ? HEAP32[$4 + 4 >> 2] | 0 : $26 & 255) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($4); + break; + } + if (($36 - $35 | 0) >>> 0 < $15 >>> 0) __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm($0, $36, $35 + $15 - $36 | 0, $35, $35, 0, 0); + if ((HEAP8[$5 >> 0] | 0) < 0) $44 = HEAP32[$0 >> 2] | 0; else $44 = $0; + $scevgep38 = $2 + ($35 - $3) | 0; + $$0 = $44 + $35 | 0; + $$034 = $1; + while (1) { + if (($$034 | 0) == ($2 | 0)) break; + __ZNSt3__211char_traitsIcE6assignERcRKc($$0, $$034); + $$0 = $$0 + 1 | 0; + $$034 = $$034 + 1 | 0; + } + HEAP8[$4 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($44 + $scevgep38 | 0, $4); + $49 = $35 + $15 | 0; + if ((HEAP8[$5 >> 0] | 0) < 0) { + HEAP32[$0 + 4 >> 2] = $49; + break; + } else { + HEAP8[$5 >> 0] = $49; + break; + } + } while (0); + STACKTOP = sp; + return $0 | 0; +} + +function __ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$alloca_mul = 0, $$alloca_mul6 = 0, $$byval_copy = 0, $10 = 0, $15 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $29 = 0, $30 = 0, $33 = 0, $35 = 0, $36 = 0, $37 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp + 8 | 0; + $6 = sp; + $7 = sp + 24 | 0; + $8 = sp + 16 | 0; + $9 = sp + 20 | 0; + $10 = $6; + HEAP32[$10 >> 2] = 37; + HEAP32[$10 + 4 >> 2] = 0; + $15 = $2 + 4 | 0; + __ZNSt3__214__num_put_base12__format_intEPcPKcbj($6 + 1 | 0, 59186, 0, HEAP32[$15 >> 2] | 0); + $19 = (HEAP32[$15 >> 2] | 0) >>> 9 & 1 | 22; + $20 = $19 + 1 | 0; + $21 = _llvm_stacksave() | 0; + $$alloca_mul = $20; + $22 = STACKTOP; + STACKTOP = STACKTOP + ((1 * $$alloca_mul | 0) + 15 & -16) | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow((1 * $$alloca_mul | 0) + 15 & -16 | 0); + $23 = __ZNSt3__26__clocEv() | 0; + $24 = $$byval_copy; + HEAP32[$24 >> 2] = $4; + HEAP32[$24 + 4 >> 2] = $5; + $29 = $22 + (__ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($22, $20, $23, $6, $$byval_copy) | 0) | 0; + $30 = __ZNSt3__214__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE($22, $29, $2) | 0; + $$alloca_mul6 = ($19 << 1) + -1 << 2; + $33 = STACKTOP; + STACKTOP = STACKTOP + ((1 * $$alloca_mul6 | 0) + 15 & -16) | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow((1 * $$alloca_mul6 | 0) + 15 & -16 | 0); + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $2); + __ZNSt3__29__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE($22, $30, $29, $33, $7, $8, $$byval_copy); + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$9 >> 2] = HEAP32[$1 >> 2]; + $35 = HEAP32[$7 >> 2] | 0; + $36 = HEAP32[$8 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$9 >> 2]; + $37 = __ZNSt3__216__pad_and_outputIwNS_11char_traitsIwEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $33, $35, $36, $2, $3) | 0; + _llvm_stackrestore($21 | 0); + STACKTOP = sp; + return $37 | 0; +} + +function __ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$alloca_mul = 0, $$alloca_mul6 = 0, $$byval_copy = 0, $10 = 0, $15 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $29 = 0, $30 = 0, $33 = 0, $35 = 0, $36 = 0, $37 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp + 8 | 0; + $6 = sp; + $7 = sp + 24 | 0; + $8 = sp + 16 | 0; + $9 = sp + 20 | 0; + $10 = $6; + HEAP32[$10 >> 2] = 37; + HEAP32[$10 + 4 >> 2] = 0; + $15 = $2 + 4 | 0; + __ZNSt3__214__num_put_base12__format_intEPcPKcbj($6 + 1 | 0, 59186, 0, HEAP32[$15 >> 2] | 0); + $19 = (HEAP32[$15 >> 2] | 0) >>> 9 & 1 | 22; + $20 = $19 + 1 | 0; + $21 = _llvm_stacksave() | 0; + $$alloca_mul = $20; + $22 = STACKTOP; + STACKTOP = STACKTOP + ((1 * $$alloca_mul | 0) + 15 & -16) | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow((1 * $$alloca_mul | 0) + 15 & -16 | 0); + $23 = __ZNSt3__26__clocEv() | 0; + $24 = $$byval_copy; + HEAP32[$24 >> 2] = $4; + HEAP32[$24 + 4 >> 2] = $5; + $29 = $22 + (__ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($22, $20, $23, $6, $$byval_copy) | 0) | 0; + $30 = __ZNSt3__214__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE($22, $29, $2) | 0; + $$alloca_mul6 = ($19 << 1) + -1 | 0; + $33 = STACKTOP; + STACKTOP = STACKTOP + ((1 * $$alloca_mul6 | 0) + 15 & -16) | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow((1 * $$alloca_mul6 | 0) + 15 & -16 | 0); + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $2); + __ZNSt3__29__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE($22, $30, $29, $33, $7, $8, $$byval_copy); + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$9 >> 2] = HEAP32[$1 >> 2]; + $35 = HEAP32[$7 >> 2] | 0; + $36 = HEAP32[$8 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$9 >> 2]; + $37 = __ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $33, $35, $36, $2, $3) | 0; + _llvm_stackrestore($21 | 0); + STACKTOP = sp; + return $37 | 0; +} + +function _PCA($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$075 = 0, $$077 = 0, $$078 = 0, $$080 = 0, $$1 = 0, $$176 = 0, $$179 = 0, $$181 = 0, $$2 = 0, $$3 = 0, $20 = 0, $27 = 0, $4 = 0, $6 = 0, $8 = 0; + $4 = HEAP32[$0 + 4 >> 2] | 0; + $6 = HEAP32[$0 + 8 >> 2] | 0; + $8 = ($6 | 0) < ($4 | 0) ? $6 : $4; + L1 : do if (((!(($4 | 0) < 2 | ($6 | 0) < 2) ? (HEAP32[$1 + 8 >> 2] | 0) == ($6 | 0) : 0) ? (HEAP32[$1 + 4 >> 2] | 0) == ($8 | 0) : 0) ? (HEAP32[$2 + 4 >> 2] | 0) == ($8 | 0) : 0) { + $20 = _arMatrixAlloc($8, $8) | 0; + if ((HEAP32[$20 + 4 >> 2] | 0) == ($8 | 0) ? (HEAP32[$20 + 8 >> 2] | 0) == ($8 | 0) : 0) { + $27 = ($4 | 0) < ($6 | 0); + if ($27) { + if ((_x_by_xt($0, $20) | 0) < 0) { + _arMatrixFree($20) | 0; + $$077 = -1; + break; + } + } else if ((_xt_by_x($0, $20) | 0) < 0) { + _arMatrixFree($20) | 0; + $$077 = -1; + break; + } + if ((_QRM($20, $2) | 0) < 0) { + _arMatrixFree($20) | 0; + $$077 = -1; + break; + } + L18 : do if ($27) { + if ((_EV_create($0, $20, $1, $2) | 0) < 0) { + _arMatrixFree($20) | 0; + $$077 = -1; + break L1; + } + } else { + $$075 = 0; + $$078 = HEAP32[$20 >> 2] | 0; + $$080 = HEAP32[$1 >> 2] | 0; + while (1) { + if (($$075 | 0) >= ($8 | 0)) break; + if (+HEAPF64[(HEAP32[$2 >> 2] | 0) + ($$075 << 3) >> 3] < 1.0e-16) break; + $$0 = 0; + $$179 = $$078; + $$181 = $$080; + while (1) { + if (($$0 | 0) >= ($8 | 0)) break; + HEAPF64[$$181 >> 3] = +HEAPF64[$$179 >> 3]; + $$0 = $$0 + 1 | 0; + $$179 = $$179 + 8 | 0; + $$181 = $$181 + 8 | 0; + } + $$075 = $$075 + 1 | 0; + $$078 = $$179; + $$080 = $$181; + } + $$176 = $$075; + $$2 = $$080; + while (1) { + if (($$176 | 0) >= ($8 | 0)) break L18; + HEAPF64[(HEAP32[$2 >> 2] | 0) + ($$176 << 3) >> 3] = 0.0; + $$1 = 0; + $$3 = $$2; + while (1) { + if (($$1 | 0) >= ($8 | 0)) break; + HEAPF64[$$3 >> 3] = 0.0; + $$1 = $$1 + 1 | 0; + $$3 = $$3 + 8 | 0; + } + $$176 = $$176 + 1 | 0; + $$2 = $$3; + } + } while (0); + _arMatrixFree($20) | 0; + $$077 = 0; + break; + } + _arMatrixFree($20) | 0; + $$077 = -1; + } else $$077 = -1; while (0); + return $$077 | 0; +} + +function __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE23__append_forward_unsafeIPwEERS5_T_S9_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$034 = 0, $15 = 0, $16 = 0, $23 = 0, $24 = 0, $28 = 0, $29 = 0, $3 = 0, $37 = 0, $38 = 0, $4 = 0, $46 = 0, $5 = 0, $50 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + $4 = $0 + 8 | 0; + $5 = $4 + 3 | 0; + $6 = HEAP8[$5 >> 0] | 0; + $7 = $6 << 24 >> 24 < 0; + if ($7) { + $37 = HEAP32[$0 + 4 >> 2] | 0; + $38 = (HEAP32[$4 >> 2] & 2147483647) + -1 | 0; + } else { + $37 = $6 & 255; + $38 = 1; + } + $15 = $2 - $1 | 0; + $16 = $15 >> 2; + do if ($15 | 0) { + if ($7) { + $23 = HEAP32[$0 >> 2] | 0; + $24 = HEAP32[$0 + 4 >> 2] | 0; + } else { + $23 = $0; + $24 = $6 & 255; + } + if (__ZNSt3__214__ptr_in_rangeIwEEbPKT_S3_S3_($1, $23, $23 + ($24 << 2) | 0) | 0) { + HEAP32[$3 >> 2] = 0; + HEAP32[$3 + 4 >> 2] = 0; + HEAP32[$3 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initIPwEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeES9_S9_($3, $1, $2); + $28 = HEAP8[$3 + 8 + 3 >> 0] | 0; + $29 = $28 << 24 >> 24 < 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm($0, $29 ? HEAP32[$3 >> 2] | 0 : $3, $29 ? HEAP32[$3 + 4 >> 2] | 0 : $28 & 255) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($3); + break; + } + if (($38 - $37 | 0) >>> 0 < $16 >>> 0) __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm($0, $38, $37 + $16 - $38 | 0, $37, $37, 0, 0); + if ((HEAP8[$5 >> 0] | 0) < 0) $46 = HEAP32[$0 >> 2] | 0; else $46 = $0; + $$0 = $46 + ($37 << 2) | 0; + $$034 = $1; + while (1) { + if (($$034 | 0) == ($2 | 0)) break; + __ZNSt3__211char_traitsIwE6assignERwRKw($$0, $$034); + $$0 = $$0 + 4 | 0; + $$034 = $$034 + 4 | 0; + } + HEAP32[$3 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($$0, $3); + $50 = $37 + $16 | 0; + if ((HEAP8[$5 >> 0] | 0) < 0) { + HEAP32[$0 + 4 >> 2] = $50; + break; + } else { + HEAP8[$5 >> 0] = $50; + break; + } + } while (0); + STACKTOP = sp; + return $0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E18parseTemplateParamEv($0) { + $0 = $0 | 0; + var $$1 = 0, $$2 = 0, $1 = 0, $16 = 0, $18 = 0, $2 = 0, $21 = 0, $22 = 0, $7 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp + 4 | 0; + $2 = sp; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 84) | 0) { + HEAP32[$1 >> 2] = 0; + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0)) if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20parsePositiveIntegerEPm($0, $1) | 0) ? ($7 = (HEAP32[$1 >> 2] | 0) + 1 | 0, HEAP32[$1 >> 2] = $7, __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) : 0) { + $21 = $7; + label = 5; + } else $$1 = 0; else { + $21 = 0; + label = 5; + } + do if ((label | 0) == 5) { + if (HEAP8[$0 + 362 >> 0] | 0) { + $$1 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA5_KcEEEPNS0_4NodeEDpOT0_($0, 51573) | 0; + break; + } + if (HEAP8[$0 + 361 >> 0] | 0) { + $16 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_24ForwardTemplateReferenceEJRmEEEPNS0_4NodeEDpOT0_($0, $1) | 0; + HEAP32[$2 >> 2] = $16; + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EE9push_backERKS3_($0 + 332 | 0, $2); + $$1 = $16; + break; + } + $18 = $0 + 288 | 0; + if ($21 >>> 0 < (__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE4sizeEv($18) | 0) >>> 0) { + $22 = __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EEixEm($18, $21) | 0; + $$1 = HEAP32[$22 >> 2] | 0; + } else $$1 = 0; + } while (0); + $$2 = $$1; + } else $$2 = 0; + STACKTOP = sp; + return $$2 | 0; +} + +function __ZN6vision18EstimateHomographyEPfRKNSt3__26vectorINS_12FeaturePointENS1_9allocatorIS3_EEEES8_RKNS2_INS_7match_tENS4_IS9_EEEERNS_16RobustHomographyIfEEii($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0 = 0, $$036 = 0, $$cast = 0, $10 = 0, $20 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $28 = 0.0, $32 = 0.0, $38 = 0, $46 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $7 = sp + 44 | 0; + $8 = sp + 32 | 0; + $9 = sp; + $10 = $3 + 4 | 0; + __ZNSt3__26vectorIN6vision7Point2dIfEENS_9allocatorIS3_EEEC2Em($7, (HEAP32[$10 >> 2] | 0) - (HEAP32[$3 >> 2] | 0) >> 3); + __ZNSt3__26vectorIN6vision7Point2dIfEENS_9allocatorIS3_EEEC2Em($8, (HEAP32[$10 >> 2] | 0) - (HEAP32[$3 >> 2] | 0) >> 3); + $20 = HEAP32[$3 >> 2] | 0; + $22 = (HEAP32[$10 >> 2] | 0) - $20 >> 3; + $$cast = $20; + $23 = HEAP32[$1 >> 2] | 0; + $24 = HEAP32[$8 >> 2] | 0; + $25 = HEAP32[$2 >> 2] | 0; + $26 = HEAP32[$7 >> 2] | 0; + $$0 = 0; + while (1) { + if (($$0 | 0) == ($22 | 0)) break; + $38 = HEAP32[$$cast + ($$0 << 3) >> 2] | 0; + HEAP32[$24 + ($$0 << 3) >> 2] = HEAP32[$23 + ($38 * 20 | 0) >> 2]; + HEAP32[$24 + ($$0 << 3) + 4 >> 2] = HEAP32[$23 + ($38 * 20 | 0) + 4 >> 2]; + $46 = HEAP32[$$cast + ($$0 << 3) + 4 >> 2] | 0; + HEAP32[$26 + ($$0 << 3) >> 2] = HEAP32[$25 + ($46 * 20 | 0) >> 2]; + HEAP32[$26 + ($$0 << 3) + 4 >> 2] = HEAP32[$25 + ($46 * 20 | 0) + 4 >> 2]; + $$0 = $$0 + 1 | 0; + } + HEAPF32[$9 >> 2] = 0.0; + HEAPF32[$9 + 4 >> 2] = 0.0; + $28 = +($5 | 0); + HEAPF32[$9 + 8 >> 2] = $28; + HEAPF32[$9 + 12 >> 2] = 0.0; + HEAPF32[$9 + 16 >> 2] = $28; + $32 = +($6 | 0); + HEAPF32[$9 + 20 >> 2] = $32; + HEAPF32[$9 + 24 >> 2] = 0.0; + HEAPF32[$9 + 28 >> 2] = $32; + if (__ZN6vision16RobustHomographyIfE4findEPfPKfS4_iS4_i($4, $0, $26, $24, $22, $9, 4) | 0) $$036 = __ZN6vision25CheckHomographyHeuristicsEPfii($0, $5, $6) | 0; else $$036 = 0; + __ZNSt3__213__vector_baseIN6vision7Point2dIfEENS_9allocatorIS3_EEED2Ev($8); + __ZNSt3__213__vector_baseIN6vision7Point2dIfEENS_9allocatorIS3_EEED2Ev($7); + STACKTOP = sp; + return $$036 | 0; +} + +function __ZN6vision21HoughSimilarityVoting4voteEPKfS2_i($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$040 = 0, $$1 = 0, $10 = 0, $12 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $22 = 0, $23 = 0, $24 = 0, $4 = 0, $46 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp + 12 | 0; + $5 = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEE5clearEv($0 + 92 | 0); + if ($3 | 0) { + $10 = $0 + 112 | 0; + __ZNSt3__26vectorIfNS_9allocatorIfEEE6resizeEm($10, $3 << 2); + $12 = $0 + 124 | 0; + __ZNSt3__26vectorIiNS_9allocatorIiEEE6resizeEm($12, $3); + if (HEAP8[$0 + 16 >> 0] | 0) __ZN6vision21HoughSimilarityVoting19autoAdjustXYNumBinsEPKfS2_i($0, $1, $2, $3); + $16 = $0 + 68 | 0; + $17 = $0 + 72 | 0; + $18 = $0 + 76 | 0; + $19 = $0 + 80 | 0; + $$0 = 0; + $$040 = 0; + while (1) { + if (($$040 | 0) >= ($3 | 0)) break; + $22 = $$040 << 2; + $23 = $1 + ($22 << 2) | 0; + $24 = $2 + ($22 << 2) | 0; + __ZNK6vision21HoughSimilarityVoting17mapCorrespondenceERfS1_S1_S1_ffffffff($0, $4, $5, $6, $7, +HEAPF32[$23 >> 2], +HEAPF32[$23 + 4 >> 2], +HEAPF32[$23 + 8 >> 2], +HEAPF32[$23 + 12 >> 2], +HEAPF32[$24 >> 2], +HEAPF32[$24 + 4 >> 2], +HEAPF32[$24 + 8 >> 2], +HEAPF32[$24 + 12 >> 2]); + if (__ZN6vision21HoughSimilarityVoting4voteEffff($0, +HEAPF32[$4 >> 2], +HEAPF32[$5 >> 2], +HEAPF32[$6 >> 2], +HEAPF32[$7 >> 2]) | 0) { + $46 = (HEAP32[$10 >> 2] | 0) + ($$0 << 2 << 2) | 0; + HEAP32[$46 >> 2] = HEAP32[$16 >> 2]; + HEAP32[$46 + 4 >> 2] = HEAP32[$17 >> 2]; + HEAP32[$46 + 8 >> 2] = HEAP32[$18 >> 2]; + HEAP32[$46 + 12 >> 2] = HEAP32[$19 >> 2]; + HEAP32[(HEAP32[$12 >> 2] | 0) + ($$0 << 2) >> 2] = $$040; + $$1 = $$0 + 1 | 0; + } else $$1 = $$0; + $$0 = $$1; + $$040 = $$040 + 1 | 0; + } + __ZNSt3__26vectorIfNS_9allocatorIfEEE6resizeEm($10, $$0 << 2); + __ZNSt3__26vectorIiNS_9allocatorIiEEE6resizeEm($12, $$0); + } + STACKTOP = sp; + return; +} + +function _format_message($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$042 = 0, $$042$in = 0, $$043 = 0, $$1 = 0, $13 = 0, $16 = 0, $2 = 0, $28 = 0, $36 = 0, $38 = 0, $4 = 0, $40 = 0, $42 = 0, $44 = 0, $46 = 0, $48 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $vararg_buffer1 = sp + 8 | 0; + $vararg_buffer = sp; + $2 = HEAP32[$0 >> 2] | 0; + $4 = HEAP32[$2 + 20 >> 2] | 0; + if (($4 | 0) > 0 ? ($4 | 0) <= (HEAP32[$2 + 116 >> 2] | 0) : 0) { + $$042$in = (HEAP32[$2 + 112 >> 2] | 0) + ($4 << 2) | 0; + label = 8; + } else { + $13 = HEAP32[$2 + 120 >> 2] | 0; + if ((($13 | 0) != 0 ? ($16 = HEAP32[$2 + 124 >> 2] | 0, ($4 | 0) >= ($16 | 0)) : 0) ? ($4 | 0) <= (HEAP32[$2 + 128 >> 2] | 0) : 0) { + $$042$in = $13 + ($4 - $16 << 2) | 0; + label = 8; + } else label = 9; + } + if ((label | 0) == 8) { + $$042 = HEAP32[$$042$in >> 2] | 0; + if (!$$042) label = 9; else $$1 = $$042; + } + if ((label | 0) == 9) { + HEAP32[$2 + 24 >> 2] = $4; + $$1 = HEAP32[HEAP32[$2 + 112 >> 2] >> 2] | 0; + } + $$043 = $$1; + L14 : while (1) { + $28 = $$043 + 1 | 0; + switch (HEAP8[$$043 >> 0] | 0) { + case 0: + { + break L14; + break; + } + case 37: + { + label = 12; + break L14; + break; + } + default: + $$043 = $28; + } + } + if ((label | 0) == 12 ? (HEAP8[$28 >> 0] | 0) == 115 : 0) { + HEAP32[$vararg_buffer >> 2] = $2 + 24; + _sprintf($1, $$1, $vararg_buffer) | 0; + STACKTOP = sp; + return; + } + $36 = HEAP32[$2 + 28 >> 2] | 0; + $38 = HEAP32[$2 + 32 >> 2] | 0; + $40 = HEAP32[$2 + 36 >> 2] | 0; + $42 = HEAP32[$2 + 40 >> 2] | 0; + $44 = HEAP32[$2 + 44 >> 2] | 0; + $46 = HEAP32[$2 + 48 >> 2] | 0; + $48 = HEAP32[$2 + 52 >> 2] | 0; + HEAP32[$vararg_buffer1 >> 2] = HEAP32[$2 + 24 >> 2]; + HEAP32[$vararg_buffer1 + 4 >> 2] = $36; + HEAP32[$vararg_buffer1 + 8 >> 2] = $38; + HEAP32[$vararg_buffer1 + 12 >> 2] = $40; + HEAP32[$vararg_buffer1 + 16 >> 2] = $42; + HEAP32[$vararg_buffer1 + 20 >> 2] = $44; + HEAP32[$vararg_buffer1 + 24 >> 2] = $46; + HEAP32[$vararg_buffer1 + 28 >> 2] = $48; + _sprintf($1, $$1, $vararg_buffer1) | 0; + STACKTOP = sp; + return; +} + +function __ZN6vision21OrientationAssignment16computeGradientsEPKNS_25GaussianScaleSpacePyramidE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $11 = 0, $13 = 0, $14 = 0, $2 = 0, $23 = 0, $28 = 0, $3 = 0, $32 = 0, $35 = 0, $36 = 0, $37 = 0, $4 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $3 = $0 + 40 | 0; + $$0 = 0; + while (1) { + $4 = __ZNK6vision25GaussianScaleSpacePyramid6imagesEv($1) | 0; + if ($$0 >>> 0 >= (HEAP32[$4 + 4 >> 2] | 0) - (HEAP32[$4 >> 2] | 0) >> 5 >>> 0) { + label = 3; + break; + } + $11 = __ZNK6vision25GaussianScaleSpacePyramid6imagesEv($1) | 0; + $13 = (HEAP32[$11 >> 2] | 0) + ($$0 << 5) | 0; + $14 = __ZNK6vision5Image5widthEv($13) | 0; + if (($14 | 0) != ((__ZNK6vision5Image4stepEv($13) | 0) >>> 2 | 0)) { + label = 5; + break; + } + $35 = __ZN6vision5Image3getIfEEPT_v((HEAP32[$3 >> 2] | 0) + ($$0 << 5) | 0) | 0; + $36 = __ZNK6vision5Image3getIfEEPKT_v($13) | 0; + $37 = __ZNK6vision5Image5widthEv($13) | 0; + __ZN6vision21ComputePolarGradientsEPfPKfmm($35, $36, $37, __ZNK6vision5Image6heightEv($13) | 0); + $$0 = $$0 + 1 | 0; + } + if ((label | 0) == 3) { + STACKTOP = sp; + return; + } else if ((label | 0) == 5) { + $23 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 31856) | 0, 31917) | 0, 39072) | 0, 96) | 0, 39079) | 0, 32006) | 0; + __ZNKSt3__28ios_base6getlocEv($2, $23 + (HEAP32[(HEAP32[$23 >> 2] | 0) + -12 >> 2] | 0) | 0); + $28 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66512) | 0; + $32 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$28 >> 2] | 0) + 28 >> 2] & 127]($28, 10) | 0; + __ZNSt3__26localeD2Ev($2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($23, $32) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($23) | 0; + _abort(); + } +} + +function ___shgetc($0) { + $0 = $0 | 0; + var $$0 = 0, $$phi$trans$insert28 = 0, $$pre = 0, $1 = 0, $12 = 0, $17 = 0, $2 = 0, $23 = 0, $26 = 0, $28 = 0, $31 = 0, $37 = 0, $39 = 0, $4 = 0, $41 = 0, $43 = 0, $49 = 0, $50 = 0, $56 = 0, $62 = 0, $63 = 0, $66 = 0, $69 = 0, $7 = 0, $70 = 0, $76 = 0, $77 = 0, $78 = 0, $83 = 0, $84 = 0, $89 = 0, label = 0; + $1 = $0 + 112 | 0; + $2 = $1; + $4 = HEAP32[$2 >> 2] | 0; + $7 = HEAP32[$2 + 4 >> 2] | 0; + if (!(($4 | 0) == 0 & ($7 | 0) == 0) ? ($12 = $0 + 120 | 0, $17 = HEAP32[$12 + 4 >> 2] | 0, !(($17 | 0) < ($7 | 0) | (($17 | 0) == ($7 | 0) ? (HEAP32[$12 >> 2] | 0) >>> 0 < $4 >>> 0 : 0))) : 0) label = 4; else { + $23 = ___uflow($0) | 0; + if (($23 | 0) >= 0) { + $26 = $1; + $28 = HEAP32[$26 >> 2] | 0; + $31 = HEAP32[$26 + 4 >> 2] | 0; + $$pre = HEAP32[$0 + 8 >> 2] | 0; + if (!(($28 | 0) == 0 & ($31 | 0) == 0)) { + $37 = HEAP32[$0 + 4 >> 2] | 0; + $39 = $$pre - $37 | 0; + $41 = (($39 | 0) < 0) << 31 >> 31; + $43 = $0 + 120 | 0; + $49 = _i64Subtract($28 | 0, $31 | 0, HEAP32[$43 >> 2] | 0, HEAP32[$43 + 4 >> 2] | 0) | 0; + $50 = getTempRet0() | 0; + $56 = $$pre; + if (($50 | 0) > ($41 | 0) | ($50 | 0) == ($41 | 0) & $49 >>> 0 > $39 >>> 0) { + $89 = $56; + label = 9; + } else { + HEAP32[$0 + 104 >> 2] = $37 + ($49 + -1); + $62 = $56; + } + } else { + $89 = $$pre; + label = 9; + } + if ((label | 0) == 9) { + HEAP32[$0 + 104 >> 2] = $$pre; + $62 = $89; + } + $$phi$trans$insert28 = $0 + 4 | 0; + if (!$62) $84 = HEAP32[$$phi$trans$insert28 >> 2] | 0; else { + $63 = HEAP32[$$phi$trans$insert28 >> 2] | 0; + $66 = $62 + 1 - $63 | 0; + $69 = $0 + 120 | 0; + $70 = $69; + $76 = _i64Add(HEAP32[$70 >> 2] | 0, HEAP32[$70 + 4 >> 2] | 0, $66 | 0, (($66 | 0) < 0) << 31 >> 31 | 0) | 0; + $77 = getTempRet0() | 0; + $78 = $69; + HEAP32[$78 >> 2] = $76; + HEAP32[$78 + 4 >> 2] = $77; + $84 = $63; + } + $83 = $84 + -1 | 0; + if (($23 | 0) == (HEAPU8[$83 >> 0] | 0 | 0)) $$0 = $23; else { + HEAP8[$83 >> 0] = $23; + $$0 = $23; + } + } else label = 4; + } + if ((label | 0) == 4) { + HEAP32[$0 + 104 >> 2] = 0; + $$0 = -1; + } + return $$0 | 0; +} + +function _memcpy(dest, src, num) { + dest = dest | 0; + src = src | 0; + num = num | 0; + var ret = 0, aligned_dest_end = 0, block_aligned_dest_end = 0, dest_end = 0; + if ((num | 0) >= 8192) { + _emscripten_memcpy_big(dest | 0, src | 0, num | 0) | 0; + return dest | 0; + } + ret = dest | 0; + dest_end = dest + num | 0; + if ((dest & 3) == (src & 3)) { + while (dest & 3) { + if (!num) return ret | 0; + HEAP8[dest >> 0] = HEAP8[src >> 0] | 0; + dest = dest + 1 | 0; + src = src + 1 | 0; + num = num - 1 | 0; + } + aligned_dest_end = dest_end & -4 | 0; + block_aligned_dest_end = aligned_dest_end - 64 | 0; + while ((dest | 0) <= (block_aligned_dest_end | 0)) { + HEAP32[dest >> 2] = HEAP32[src >> 2]; + HEAP32[dest + 4 >> 2] = HEAP32[src + 4 >> 2]; + HEAP32[dest + 8 >> 2] = HEAP32[src + 8 >> 2]; + HEAP32[dest + 12 >> 2] = HEAP32[src + 12 >> 2]; + HEAP32[dest + 16 >> 2] = HEAP32[src + 16 >> 2]; + HEAP32[dest + 20 >> 2] = HEAP32[src + 20 >> 2]; + HEAP32[dest + 24 >> 2] = HEAP32[src + 24 >> 2]; + HEAP32[dest + 28 >> 2] = HEAP32[src + 28 >> 2]; + HEAP32[dest + 32 >> 2] = HEAP32[src + 32 >> 2]; + HEAP32[dest + 36 >> 2] = HEAP32[src + 36 >> 2]; + HEAP32[dest + 40 >> 2] = HEAP32[src + 40 >> 2]; + HEAP32[dest + 44 >> 2] = HEAP32[src + 44 >> 2]; + HEAP32[dest + 48 >> 2] = HEAP32[src + 48 >> 2]; + HEAP32[dest + 52 >> 2] = HEAP32[src + 52 >> 2]; + HEAP32[dest + 56 >> 2] = HEAP32[src + 56 >> 2]; + HEAP32[dest + 60 >> 2] = HEAP32[src + 60 >> 2]; + dest = dest + 64 | 0; + src = src + 64 | 0; + } + while ((dest | 0) < (aligned_dest_end | 0)) { + HEAP32[dest >> 2] = HEAP32[src >> 2]; + dest = dest + 4 | 0; + src = src + 4 | 0; + } + } else { + aligned_dest_end = dest_end - 4 | 0; + while ((dest | 0) < (aligned_dest_end | 0)) { + HEAP8[dest >> 0] = HEAP8[src >> 0] | 0; + HEAP8[dest + 1 >> 0] = HEAP8[src + 1 >> 0] | 0; + HEAP8[dest + 2 >> 0] = HEAP8[src + 2 >> 0] | 0; + HEAP8[dest + 3 >> 0] = HEAP8[src + 3 >> 0] | 0; + dest = dest + 4 | 0; + src = src + 4 | 0; + } + } + while ((dest | 0) < (dest_end | 0)) { + HEAP8[dest >> 0] = HEAP8[src >> 0] | 0; + dest = dest + 1 | 0; + src = src + 1 | 0; + } + return ret | 0; +} + +function __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE6assignIPS2_EENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr16is_constructibleIS2_NS_15iterator_traitsIS9_E9referenceEEE5valueEvE4typeES9_S9_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0$i$i = 0, $13 = 0, $14 = 0, $17 = 0, $18 = 0, $21 = 0, $25 = 0, $33 = 0, $34 = 0, $39 = 0, $4 = 0, $42 = 0, $6 = 0, $7 = 0, $9 = 0, $spec$select = 0; + $4 = $1; + $6 = ($2 - $4 | 0) / 20 | 0; + $7 = $0 + 8 | 0; + $9 = HEAP32[$0 >> 2] | 0; + $13 = $9; + do if ($6 >>> 0 > (((HEAP32[$7 >> 2] | 0) - $9 | 0) / 20 | 0) >>> 0) { + __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE13__vdeallocateEv($0); + $34 = __ZNKSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE8max_sizeEv($0) | 0; + if ($34 >>> 0 < $6 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $39 = ((HEAP32[$7 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) | 0) / 20 | 0; + $42 = $39 << 1; + __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE11__vallocateEm($0, $39 >>> 0 < $34 >>> 1 >>> 0 ? ($42 >>> 0 < $6 >>> 0 ? $6 : $42) : $34); + __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE18__construct_at_endIPS2_EENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeES9_S9_m($0, $1, $2, $6); + break; + } + } else { + $14 = $0 + 4 | 0; + $17 = ((HEAP32[$14 >> 2] | 0) - $9 | 0) / 20 | 0; + $18 = $6 >>> 0 > $17 >>> 0; + $spec$select = $18 ? $1 + ($17 * 20 | 0) | 0 : $2; + $21 = $spec$select - $4 | 0; + if ($21 | 0) _memmove($9 | 0, $1 | 0, $21 | 0) | 0; + $25 = $13 + ((($21 | 0) / 20 | 0) * 20 | 0) | 0; + if ($18) { + __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE18__construct_at_endIPS2_EENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeES9_S9_m($0, $spec$select, $2, $6 - (((HEAP32[$14 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) | 0) / 20 | 0) | 0); + break; + } + $$0$i$i = HEAP32[$14 >> 2] | 0; + while (1) { + if (($$0$i$i | 0) == ($25 | 0)) break; + $33 = $$0$i$i + -20 | 0; + __ZN6vision12FeaturePointD2Ev($33); + $$0$i$i = $33; + } + HEAP32[$14 >> 2] = $25; + } while (0); + return; +} + +function __ZL18genBWImageTwoThirdPhiiPiS0_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$073 = 0, $$074 = 0, $$077 = 0, $$078 = 0, $$079 = 0, $$1 = 0, $$176 = 0, $$pn = 0, $10 = 0, $13 = 0, $25 = 0, $34 = 0, $5 = 0, $51 = 0, $6 = 0, $7 = 0, $71 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $5 = ($1 | 0) / 3 | 0; + $6 = $5 << 1; + HEAP32[$3 >> 2] = $6; + $7 = ($2 | 0) / 3 | 0; + $8 = $7 << 1; + HEAP32[$4 >> 2] = $8; + $10 = _malloc(Math_imul($8, $6) | 0) | 0; + if (!$10) { + _arLog(0, 3, 45930, sp); + _exit(1); + } + $$0 = 0; + $$074 = $10; + $$pn = $10; + while (1) { + if (($$0 | 0) >= ($7 | 0)) break; + $13 = $$0 * 3 | 0; + $$073 = 0; + $$077 = $0 + (Math_imul($13 + 2 | 0, $1) | 0) | 0; + $$078 = $0 + (Math_imul($13 + 1 | 0, $1) | 0) | 0; + $$079 = $0 + (Math_imul($13, $1) | 0) | 0; + $$1 = $$074; + $$176 = $$pn + $6 | 0; + while (1) { + if (($$073 | 0) >= ($5 | 0)) break; + $25 = $$079 + 1 | 0; + $34 = $$078 + 1 | 0; + HEAP8[$$1 >> 0] = (((HEAPU8[$25 >> 0] | 0) >>> 1 & 255) + (HEAPU8[$$079 >> 0] | 0) + ((HEAPU8[$$078 >> 0] | 0) >>> 1 & 255) + ((HEAPU8[$34 >> 0] | 0) >>> 2 & 255) << 2 >>> 0) / 9 | 0; + $51 = $$077 + 1 | 0; + HEAP8[$$176 >> 0] = ((((HEAPU8[$34 >> 0] | 0) >>> 2) + ((HEAPU8[$$078 >> 0] | 0) >>> 1) & 255) + (HEAPU8[$$077 >> 0] | 0) + ((HEAPU8[$51 >> 0] | 0) >>> 1 & 255) << 2 >>> 0) / 9 | 0; + $71 = $$078 + 2 | 0; + HEAP8[$$1 + 1 >> 0] = (((HEAPU8[$25 >> 0] | 0) >>> 1 & 255) + (HEAPU8[$$079 + 2 >> 0] | 0) + ((HEAPU8[$34 >> 0] | 0) >>> 2 & 255) + ((HEAPU8[$71 >> 0] | 0) >>> 1 & 255) << 2 >>> 0) / 9 | 0; + HEAP8[$$176 + 1 >> 0] = ((((HEAPU8[$71 >> 0] | 0) >>> 1) + ((HEAPU8[$34 >> 0] | 0) >>> 2) & 255) + ((HEAPU8[$51 >> 0] | 0) >>> 1 & 255) + (HEAPU8[$$077 + 2 >> 0] | 0) << 2 >>> 0) / 9 | 0; + $$073 = $$073 + 1 | 0; + $$077 = $$077 + 3 | 0; + $$078 = $$078 + 3 | 0; + $$079 = $$079 + 3 | 0; + $$1 = $$1 + 2 | 0; + $$176 = $$176 + 2 | 0; + } + $$0 = $$0 + 1 | 0; + $$074 = $$1 + $6 | 0; + $$pn = $$176; + } + STACKTOP = sp; + return $10 | 0; +} + +function __ZN6vision16MatrixInverse3x3IfEEbPT_PKS1_S1_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = +$2; + var $$0 = 0, $11 = 0, $13 = 0, $16 = 0.0, $17 = 0, $19 = 0, $24 = 0.0, $3 = 0.0, $31 = 0.0, $34 = 0, $37 = 0, $40 = 0.0, $47 = 0.0, $54 = 0.0, $6 = 0.0, $61 = 0.0, $68 = 0.0, $7 = 0, $75 = 0.0, $9 = 0; + $3 = +__ZN6vision14Determinant3x3IfEET_PKS1_($1); + if (!(+Math_abs(+$3) <= $2)) { + $6 = 1.0 / $3; + $7 = $1 + 16 | 0; + $9 = $1 + 20 | 0; + $11 = $1 + 28 | 0; + $13 = $1 + 32 | 0; + $16 = $6 * +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_S1_(+HEAPF32[$7 >> 2], +HEAPF32[$9 >> 2], +HEAPF32[$11 >> 2], +HEAPF32[$13 >> 2]); + HEAPF32[$0 >> 2] = $16; + $17 = $1 + 8 | 0; + $19 = $1 + 4 | 0; + $24 = $6 * +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_S1_(+HEAPF32[$17 >> 2], +HEAPF32[$19 >> 2], +HEAPF32[$13 >> 2], +HEAPF32[$11 >> 2]); + HEAPF32[$0 + 4 >> 2] = $24; + $31 = $6 * +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_S1_(+HEAPF32[$19 >> 2], +HEAPF32[$17 >> 2], +HEAPF32[$7 >> 2], +HEAPF32[$9 >> 2]); + HEAPF32[$0 + 8 >> 2] = $31; + $34 = $1 + 12 | 0; + $37 = $1 + 24 | 0; + $40 = $6 * +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_S1_(+HEAPF32[$9 >> 2], +HEAPF32[$34 >> 2], +HEAPF32[$13 >> 2], +HEAPF32[$37 >> 2]); + HEAPF32[$0 + 12 >> 2] = $40; + $47 = $6 * +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_S1_(+HEAPF32[$1 >> 2], +HEAPF32[$17 >> 2], +HEAPF32[$37 >> 2], +HEAPF32[$13 >> 2]); + HEAPF32[$0 + 16 >> 2] = $47; + $54 = $6 * +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_S1_(+HEAPF32[$17 >> 2], +HEAPF32[$1 >> 2], +HEAPF32[$9 >> 2], +HEAPF32[$34 >> 2]); + HEAPF32[$0 + 20 >> 2] = $54; + $61 = $6 * +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_S1_(+HEAPF32[$34 >> 2], +HEAPF32[$7 >> 2], +HEAPF32[$37 >> 2], +HEAPF32[$11 >> 2]); + HEAPF32[$0 + 24 >> 2] = $61; + $68 = $6 * +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_S1_(+HEAPF32[$19 >> 2], +HEAPF32[$1 >> 2], +HEAPF32[$11 >> 2], +HEAPF32[$37 >> 2]); + HEAPF32[$0 + 28 >> 2] = $68; + $75 = $6 * +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_S1_(+HEAPF32[$1 >> 2], +HEAPF32[$19 >> 2], +HEAPF32[$34 >> 2], +HEAPF32[$7 >> 2]); + HEAPF32[$0 + 32 >> 2] = $75; + $$0 = 1; + } else $$0 = 0; + return $$0 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle27ExpandedSpecialSubstitution9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy5 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $$byval_copy5 = sp + 48 | 0; + $2 = sp + 40 | 0; + $3 = sp + 32 | 0; + $4 = sp + 24 | 0; + $5 = sp + 16 | 0; + $6 = sp + 8 | 0; + $7 = sp; + switch (HEAP32[$0 + 8 >> 2] | 0) { + case 0: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51758); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + break; + } + case 1: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 51773); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + break; + } + case 2: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 55532); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + break; + } + case 3: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 55603); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + break; + } + case 4: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($6, 55653); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + break; + } + case 5: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($7, 55703); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$7 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + break; + } + default: + {} + } + STACKTOP = sp; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle19SpecialSubstitution9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy5 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $$byval_copy5 = sp + 48 | 0; + $2 = sp + 40 | 0; + $3 = sp + 32 | 0; + $4 = sp + 24 | 0; + $5 = sp + 16 | 0; + $6 = sp + 8 | 0; + $7 = sp; + switch (HEAP32[$0 + 8 >> 2] | 0) { + case 0: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51758); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + break; + } + case 1: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 51773); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + break; + } + case 2: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 57179); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + break; + } + case 3: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 51791); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + break; + } + case 4: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($6, 51804); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + break; + } + case 5: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($7, 51817); + HEAP32[$$byval_copy5 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$$byval_copy5 + 4 >> 2] = HEAP32[$7 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy5); + break; + } + default: + {} + } + STACKTOP = sp; + return; +} + +function __ZNSt3__210__stdinbufIwE9pbackfailEj($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$07 = 0, $$1 = 0, $$pre$phiZ2D = 0, $10 = 0, $12 = 0, $16 = 0, $17 = 0, $19 = 0, $2 = 0, $21 = 0, $3 = 0, $33 = 0, $34 = 0, $36 = 0, $4 = 0, $5 = 0, $7 = 0, $8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp + 4 | 0; + $5 = sp; + $7 = __ZNSt3__211char_traitsIwE11eq_int_typeEjj($1, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0; + $8 = $0 + 52 | 0; + $10 = (HEAP8[$8 >> 0] | 0) != 0; + do if ($7) if ($10) $$1 = $1; else { + $12 = HEAP32[$0 + 48 >> 2] | 0; + $16 = ((__ZNSt3__211char_traitsIwE11eq_int_typeEjj($12, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) ^ 1) & 1; + HEAP8[$8 >> 0] = $16; + $$1 = $12; + } else { + if ($10) { + $17 = $0 + 48 | 0; + $19 = __ZNSt3__211char_traitsIwE12to_char_typeEj(HEAP32[$17 >> 2] | 0) | 0; + HEAP32[$4 >> 2] = $19; + $21 = HEAP32[$0 + 36 >> 2] | 0; + switch (FUNCTION_TABLE_iiiiiiiii[HEAP32[(HEAP32[$21 >> 2] | 0) + 12 >> 2] & 15]($21, HEAP32[$0 + 40 >> 2] | 0, $4, $4 + 4 | 0, $5, $2, $2 + 8 | 0, $3) | 0) { + case 1: + case 2: + { + label = 11; + break; + } + case 3: + { + HEAP8[$2 >> 0] = HEAP32[$17 >> 2]; + HEAP32[$3 >> 2] = $2 + 1; + label = 8; + break; + } + default: + label = 8; + } + L9 : do if ((label | 0) == 8) { + $33 = $0 + 32 | 0; + while (1) { + $34 = HEAP32[$3 >> 2] | 0; + if ($34 >>> 0 <= $2 >>> 0) { + $$0 = 1; + $$07 = 0; + break L9; + } + $36 = $34 + -1 | 0; + HEAP32[$3 >> 2] = $36; + if ((_ungetc(HEAP8[$36 >> 0] | 0, HEAP32[$33 >> 2] | 0) | 0) == -1) { + label = 11; + break; + } + } + } while (0); + if ((label | 0) == 11) { + $$0 = 0; + $$07 = __ZNSt3__211char_traitsIwE3eofEv() | 0; + } + if ($$0) $$pre$phiZ2D = $17; else { + $$1 = $$07; + break; + } + } else $$pre$phiZ2D = $0 + 48 | 0; + HEAP32[$$pre$phiZ2D >> 2] = $1; + HEAP8[$8 >> 0] = 1; + $$1 = $1; + } while (0); + STACKTOP = sp; + return $$1 | 0; +} + +function __ZNSt3__210__stdinbufIcE9pbackfailEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$07 = 0, $$1 = 0, $$pre$phiZ2D = 0, $10 = 0, $12 = 0, $16 = 0, $17 = 0, $19 = 0, $2 = 0, $21 = 0, $3 = 0, $33 = 0, $34 = 0, $36 = 0, $4 = 0, $5 = 0, $7 = 0, $8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp + 16 | 0; + $3 = sp + 4 | 0; + $4 = sp + 8 | 0; + $5 = sp; + $7 = __ZNSt3__211char_traitsIcE11eq_int_typeEii($1, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0; + $8 = $0 + 52 | 0; + $10 = (HEAP8[$8 >> 0] | 0) != 0; + do if ($7) if ($10) $$1 = $1; else { + $12 = HEAP32[$0 + 48 >> 2] | 0; + $16 = ((__ZNSt3__211char_traitsIcE11eq_int_typeEii($12, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) ^ 1) & 1; + HEAP8[$8 >> 0] = $16; + $$1 = $12; + } else { + if ($10) { + $17 = $0 + 48 | 0; + $19 = __ZNSt3__211char_traitsIcE12to_char_typeEi(HEAP32[$17 >> 2] | 0) | 0; + HEAP8[$4 >> 0] = $19; + $21 = HEAP32[$0 + 36 >> 2] | 0; + switch (FUNCTION_TABLE_iiiiiiiii[HEAP32[(HEAP32[$21 >> 2] | 0) + 12 >> 2] & 15]($21, HEAP32[$0 + 40 >> 2] | 0, $4, $4 + 1 | 0, $5, $2, $2 + 8 | 0, $3) | 0) { + case 1: + case 2: + { + label = 11; + break; + } + case 3: + { + HEAP8[$2 >> 0] = HEAP32[$17 >> 2]; + HEAP32[$3 >> 2] = $2 + 1; + label = 8; + break; + } + default: + label = 8; + } + L9 : do if ((label | 0) == 8) { + $33 = $0 + 32 | 0; + while (1) { + $34 = HEAP32[$3 >> 2] | 0; + if ($34 >>> 0 <= $2 >>> 0) { + $$0 = 1; + $$07 = 0; + break L9; + } + $36 = $34 + -1 | 0; + HEAP32[$3 >> 2] = $36; + if ((_ungetc(HEAP8[$36 >> 0] | 0, HEAP32[$33 >> 2] | 0) | 0) == -1) { + label = 11; + break; + } + } + } while (0); + if ((label | 0) == 11) { + $$0 = 0; + $$07 = __ZNSt3__211char_traitsIcE3eofEv() | 0; + } + if ($$0) $$pre$phiZ2D = $17; else { + $$1 = $$07; + break; + } + } else $$pre$phiZ2D = $0 + 48 | 0; + HEAP32[$$pre$phiZ2D >> 2] = $1; + HEAP8[$8 >> 0] = 1; + $$1 = $1; + } while (0); + STACKTOP = sp; + return $$1 | 0; +} + +function _ar2GetBestMatchingSubFineOpt($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + var $$0 = 0, $$090 = 0, $$091 = 0, $$094 = 0, $$095 = 0, $$1 = 0, $$193 = 0, $$196 = 0, $14 = 0, $16 = 0, $17 = 0, $18 = 0, $27 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $37 = 0, $39 = 0, $40 = 0, $41 = 0, $44 = 0, $48 = 0, $52 = 0, $55 = 0, $68 = 0, $71 = 0, $78 = 0, $storemerge = 0; + $14 = $0 + ((Math_imul($3, $1) | 0) + $2) | 0; + $16 = HEAP32[$4 + 4 >> 2] | 0; + $17 = $1 << 1; + $18 = HEAP32[$4 >> 2] | 0; + $$0 = 0; + $$091 = HEAP32[$4 + 24 >> 2] | 0; + $$094 = $14; + $$095 = 0; + while (1) { + if (($$0 | 0) >= ($16 | 0)) break; + $$090 = 0; + $$1 = $$091; + $$193 = $$094; + $$196 = $$095; + while (1) { + if (($$090 | 0) >= ($18 | 0)) break; + $27 = (Math_imul(HEAPU16[$$1 >> 1] | 0, HEAPU8[$$193 >> 0] | 0) | 0) + $$196 | 0; + $$090 = $$090 + 1 | 0; + $$1 = $$1 + 2 | 0; + $$193 = $$193 + 2 | 0; + $$196 = $27; + } + $$0 = $$0 + 1 | 0; + $$091 = $$1; + $$094 = $$094 + $17 | 0; + $$095 = $$196; + } + $32 = $18 << 1; + $33 = $32 + 8 | 0; + $34 = $7 + -2 | 0; + $35 = $34 + $32 | 0; + $37 = $8 + -2 | 0; + $39 = Math_imul($33, $37 + ($16 << 1) | 0) | 0; + $40 = Math_imul($33, $37) | 0; + $41 = $39 + $35 | 0; + $44 = $40 + $34 | 0; + $48 = $39 + $34 | 0; + $52 = $40 + $35 | 0; + $55 = (HEAP32[$5 + ($44 << 2) >> 2] | 0) + (HEAP32[$5 + ($41 << 2) >> 2] | 0) - (HEAP32[$5 + ($48 << 2) >> 2] | 0) - (HEAP32[$5 + ($52 << 2) >> 2] | 0) | 0; + $68 = HEAP32[$4 + 36 >> 2] | 0; + $71 = (HEAP32[$6 + ($44 << 2) >> 2] | 0) + (HEAP32[$6 + ($41 << 2) >> 2] | 0) - (HEAP32[$6 + ($48 << 2) >> 2] | 0) - (HEAP32[$6 + ($52 << 2) >> 2] | 0) - ((Math_imul($55, $55) | 0) / ($68 | 0) | 0) | 0; + if (!$71) $storemerge = 0; else { + $78 = ($$095 - ((Math_imul(HEAP32[$4 + 32 >> 2] | 0, $55) | 0) / ($68 | 0) | 0) | 0) * 100 | 0; + $storemerge = ((($78 | 0) / (HEAP32[$4 + 28 >> 2] | 0) | 0) * 100 | 0) / (~~+Math_sqrt(+(+($71 | 0))) | 0) | 0; + } + HEAP32[$9 >> 2] = $storemerge; + return; +} + +function _jpeg_huff_decode($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0$lcssa = 0, $$042$lcssa = 0, $$04254 = 0, $$043 = 0, $$044 = 0, $$045 = 0, $$055 = 0, $$1$lcssa = 0, $$146$lcssa = 0, $$14652 = 0, $$153 = 0, $$2 = 0, $$247 = 0, $12 = 0, $16 = 0, $20 = 0, $21 = 0, $22 = 0, $28 = 0, $31 = 0, $32 = 0, $38 = 0, $39 = 0; + do if (($2 | 0) < ($4 | 0)) if (!(_jpeg_fill_bit_buffer($0, $1, $2, $4) | 0)) { + $$043 = -1; + return $$043 | 0; + } else { + $$044 = HEAP32[$0 + 8 >> 2] | 0; + $$045 = HEAP32[$0 + 12 >> 2] | 0; + break; + } else { + $$044 = $1; + $$045 = $2; + } while (0); + $12 = $$045 - $4 | 0; + $16 = $$044 >> $12 & HEAP32[5184 + ($4 << 2) >> 2]; + $20 = $0 + 8 | 0; + $21 = $0 + 12 | 0; + L7 : do if (($16 | 0) > (HEAP32[$3 + ($4 << 2) >> 2] | 0)) { + $$04254 = $4; + $$055 = $16; + $$14652 = $12; + $$153 = $$044; + while (1) { + $22 = $$055 << 1; + if (($$14652 | 0) < 1) { + if (!(_jpeg_fill_bit_buffer($0, $$153, $$14652, 1) | 0)) { + $$043 = -1; + break; + } + $$2 = HEAP32[$20 >> 2] | 0; + $$247 = HEAP32[$21 >> 2] | 0; + } else { + $$2 = $$153; + $$247 = $$14652; + } + $28 = $$247 + -1 | 0; + $31 = $$2 >>> $28 & 1 | $22; + $32 = $$04254 + 1 | 0; + if (($31 | 0) > (HEAP32[$3 + ($32 << 2) >> 2] | 0)) { + $$04254 = $32; + $$055 = $31; + $$14652 = $28; + $$153 = $$2; + } else { + $$0$lcssa = $31; + $$042$lcssa = $32; + $$1$lcssa = $$2; + $$146$lcssa = $28; + break L7; + } + } + return $$043 | 0; + } else { + $$0$lcssa = $16; + $$042$lcssa = $4; + $$1$lcssa = $$044; + $$146$lcssa = $12; + } while (0); + HEAP32[$20 >> 2] = $$1$lcssa; + HEAP32[$21 >> 2] = $$146$lcssa; + if (($$042$lcssa | 0) > 16) { + $38 = HEAP32[$0 + 16 >> 2] | 0; + $39 = HEAP32[$38 >> 2] | 0; + HEAP32[$39 + 20 >> 2] = 121; + FUNCTION_TABLE_vii[HEAP32[$39 + 4 >> 2] & 255]($38, -1); + $$043 = 0; + return $$043 | 0; + } else { + $$043 = HEAPU8[(HEAP32[$3 + 72 + ($$042$lcssa << 2) >> 2] | 0) + $$0$lcssa + ((HEAP32[$3 + 140 >> 2] | 0) + 17) >> 0] | 0; + return $$043 | 0; + } + return 0; +} + +function _addMultiMarker($id, $patt_name) { + $id = $id | 0; + $patt_name = $patt_name | 0; + var $14 = 0, $15 = 0, $3 = 0, $9 = 0, $__end_$i8 = 0, $arMultiMarkerHandle = 0, $call7 = 0, $cond$i$i$i = 0, $id$addr = 0, $marker = 0, $multi_markers = 0, $retval$1 = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp + 8 | 0; + $id$addr = sp + 12 | 0; + $marker = sp; + HEAP32[$id$addr >> 2] = $id; + do if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$1 = -1; else { + $call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0; + if ((HEAP8[$patt_name + 11 >> 0] | 0) < 0) $cond$i$i$i = HEAP32[$patt_name >> 2] | 0; else $cond$i$i$i = $patt_name; + $arMultiMarkerHandle = $call7 + 224 | 0; + if (!(__ZL15loadMultiMarkerPKcP8ARHandlePP12ARPattHandlePP18ARMultiMarkerInfoT($cond$i$i$i, HEAP32[$call7 + 216 >> 2] | 0, $call7 + 220 | 0, $arMultiMarkerHandle) | 0)) { + _arLog(0, 3, 45229, $vararg_buffer); + $retval$1 = -1; + break; + } + $multi_markers = $call7 + 328 | 0; + $__end_$i8 = $call7 + 332 | 0; + $3 = HEAP32[$__end_$i8 >> 2] | 0; + HEAP32[$marker >> 2] = $3 - (HEAP32[$multi_markers >> 2] | 0) >> 3; + HEAP32[$marker + 4 >> 2] = HEAP32[$arMultiMarkerHandle >> 2]; + if ((HEAP32[$call7 + 336 >> 2] | 0) == ($3 | 0)) __ZNSt3__26vectorI12multi_markerNS_9allocatorIS1_EEE21__push_back_slow_pathIRKS1_EEvOT_($multi_markers, $marker); else { + $9 = $marker; + $14 = HEAP32[$9 + 4 >> 2] | 0; + $15 = $3; + HEAP32[$15 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$15 + 4 >> 2] = $14; + HEAP32[$__end_$i8 >> 2] = (HEAP32[$__end_$i8 >> 2] | 0) + 8; + } + $retval$1 = HEAP32[$marker >> 2] | 0; + } while (0); + STACKTOP = sp; + return $retval$1 | 0; +} + +function _fgets($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$05963 = 0, $$06065 = 0, $$06164 = 0, $$1 = 0, $11 = 0, $16 = 0, $19 = 0, $20 = 0, $21 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $30 = 0, $32 = 0, $34 = 0, $35 = 0, $36 = 0, $43 = 0, $50 = 0, $51 = 0, $7 = 0, $9 = 0, label = 0; + if ((HEAP32[$2 + 76 >> 2] | 0) > -1) $16 = ___lockfile($2) | 0; else $16 = 0; + $7 = $1 + -1 | 0; + if (($1 | 0) < 2) { + $9 = $2 + 74 | 0; + $11 = HEAP8[$9 >> 0] | 0; + HEAP8[$9 >> 0] = $11 + 255 | $11; + if ($16 | 0) ___unlockfile($2); + if (!$7) { + HEAP8[$0 >> 0] = 0; + $$0 = $0; + } else $$0 = 0; + } else { + L11 : do if ($7) { + $19 = $2 + 4 | 0; + $20 = $2 + 8 | 0; + $$06065 = $7; + $$06164 = $0; + while (1) { + $21 = HEAP32[$19 >> 2] | 0; + $23 = $21; + $24 = (HEAP32[$20 >> 2] | 0) - $23 | 0; + $25 = _memchr($21, 10, $24) | 0; + $26 = ($25 | 0) == 0; + $30 = $26 ? $24 : 1 - $23 + $25 | 0; + $32 = $30 >>> 0 < $$06065 >>> 0 ? $30 : $$06065; + _memcpy($$06164 | 0, $21 | 0, $32 | 0) | 0; + $34 = (HEAP32[$19 >> 2] | 0) + $32 | 0; + HEAP32[$19 >> 2] = $34; + $35 = $$06164 + $32 | 0; + $36 = $$06065 - $32 | 0; + if (!($26 & ($36 | 0) != 0)) { + $$1 = $35; + label = 17; + break L11; + } + if ($34 >>> 0 >= (HEAP32[$20 >> 2] | 0) >>> 0) { + $43 = ___uflow($2) | 0; + if (($43 | 0) < 0) break; else $50 = $43; + } else { + HEAP32[$19 >> 2] = $34 + 1; + $50 = HEAPU8[$34 >> 0] | 0; + } + $51 = $35 + 1 | 0; + HEAP8[$35 >> 0] = $50; + $$06065 = $36 + -1 | 0; + if (($50 & 255 | 0) == 10 | ($$06065 | 0) == 0) { + $$1 = $51; + label = 17; + break L11; + } else $$06164 = $51; + } + if (($35 | 0) != ($0 | 0) ? (HEAP32[$2 >> 2] & 16 | 0) != 0 : 0) { + $$1 = $35; + label = 17; + } else $$05963 = 0; + } else { + $$1 = $0; + label = 17; + } while (0); + if ((label | 0) == 17) if (!$0) $$05963 = 0; else { + HEAP8[$$1 >> 0] = 0; + $$05963 = $0; + } + if (!$16) $$0 = $$05963; else { + ___unlockfile($2); + $$0 = $$05963; + } + } + return $$0 | 0; +} + +function __ZN6vision27OrthogonalizePivot8x9Basis1IfEEbPT_S2_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $11 = 0, $13 = 0, $15 = 0, $17 = 0.0, $18 = 0.0, $2 = 0, $20 = 0.0, $22 = 0.0, $24 = 0.0, $26 = 0.0, $28 = 0.0, $3 = 0, $30 = 0, $31 = 0, $34 = 0, $4 = 0, $5 = 0, $7 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 36 | 0; + $4 = $1 + 36 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($3, $0, $4); + $5 = $0 + 72 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($5, $0, $1 + 72 | 0); + $7 = $0 + 108 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($7, $0, $1 + 108 | 0); + $9 = $0 + 144 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($9, $0, $1 + 144 | 0); + $11 = $0 + 180 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($11, $0, $1 + 180 | 0); + $13 = $0 + 216 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($13, $0, $1 + 216 | 0); + $15 = $0 + 252 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($15, $0, $1 + 252 | 0); + $17 = +__ZN6vision11SumSquares9IfEET_PKS1_($3); + HEAPF32[$2 >> 2] = $17; + $18 = +__ZN6vision11SumSquares9IfEET_PKS1_($5); + HEAPF32[$2 + 4 >> 2] = $18; + $20 = +__ZN6vision11SumSquares9IfEET_PKS1_($7); + HEAPF32[$2 + 8 >> 2] = $20; + $22 = +__ZN6vision11SumSquares9IfEET_PKS1_($9); + HEAPF32[$2 + 12 >> 2] = $22; + $24 = +__ZN6vision11SumSquares9IfEET_PKS1_($11); + HEAPF32[$2 + 16 >> 2] = $24; + $26 = +__ZN6vision11SumSquares9IfEET_PKS1_($13); + HEAPF32[$2 + 20 >> 2] = $26; + $28 = +__ZN6vision11SumSquares9IfEET_PKS1_($15); + HEAPF32[$2 + 24 >> 2] = $28; + $30 = __ZN6vision9MaxIndex7IfEEiPKT_($2) | 0; + $31 = $2 + ($30 << 2) | 0; + if (+HEAPF32[$31 >> 2] == 0.0) $$0 = 0; else { + $34 = $30 * 9 | 0; + __ZN6vision5Swap9IfEEvPT_S2_($3, $3 + ($34 << 2) | 0); + __ZN6vision5Swap9IfEEvPT_S2_($4, $4 + ($34 << 2) | 0); + __ZN6vision12ScaleVector9IfEEvPT_PKS1_S1_($3, $3, 1.0 / +Math_sqrt(+(+HEAPF32[$31 >> 2]))); + $$0 = 1; + } + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN6vision39HomographyPointsGeometricallyConsistentIfEEbPKT_S3_i($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$062 = 0, $$063 = 0, $$063$phi = 0, $$065 = 0, $$067 = 0, $$068 = 0, $$070 = 0, $$072 = 0, $$4 = 0, $10 = 0, $14 = 0, $15 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $3 = sp + 32 | 0; + $4 = sp + 24 | 0; + $5 = sp + 16 | 0; + $6 = sp + 8 | 0; + $7 = sp; + L1 : do if (($2 | 0) >= 2) { + $9 = $1 + 8 | 0; + $10 = $1 + 16 | 0; + __ZN6vision35MultiplyPointHomographyInhomogenousIfEEvPT_PKS1_S4_($3, $0, $1); + __ZN6vision35MultiplyPointHomographyInhomogenousIfEEvPT_PKS1_S4_($4, $0, $9); + __ZN6vision35MultiplyPointHomographyInhomogenousIfEEvPT_PKS1_S4_($5, $0, $10); + __ZN6vision11CopyVector2IfEEvPT_PKS1_($6, $3); + __ZN6vision11CopyVector2IfEEvPT_PKS1_($7, $4); + if (__ZN6vision40Homography3PointsGeometricallyConsistentIfEEbPKT_S3_S3_S3_S3_S3_($1, $9, $10, $3, $4, $5) | 0) { + $$062 = 3; + $$063 = $5; + $$065 = $4; + $$067 = $3; + $$068 = $10; + $$070 = $9; + $$072 = $1; + while (1) { + if (($$062 | 0) >= ($2 | 0)) break; + $$072 = $$072 + 8 | 0; + $14 = $$070 + 8 | 0; + $15 = $$068 + 8 | 0; + __ZN6vision35MultiplyPointHomographyInhomogenousIfEEvPT_PKS1_S4_($$067, $0, $15); + if (!(__ZN6vision40Homography3PointsGeometricallyConsistentIfEEbPKT_S3_S3_S3_S3_S3_($$072, $14, $15, $$065, $$063, $$067) | 0)) { + $$4 = 0; + break L1; + } else { + $$063$phi = $$067; + $$062 = $$062 + 1 | 0; + $$068 = $15; + $$070 = $14; + $$067 = $$065; + $$065 = $$063; + $$063 = $$063$phi; + } + } + if (__ZN6vision40Homography3PointsGeometricallyConsistentIfEEbPKT_S3_S3_S3_S3_S3_($$070, $$068, $1, $$065, $$063, $6) | 0) $$4 = __ZN6vision40Homography3PointsGeometricallyConsistentIfEEbPKT_S3_S3_S3_S3_S3_($$068, $1, $9, $$063, $6, $7) | 0; else $$4 = 0; + } else $$4 = 0; + } else $$4 = 1; while (0); + STACKTOP = sp; + return $$4 | 0; +} + +function _arGetTransMatSquare($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = +$2; + $3 = $3 | 0; + var $$0 = 0, $$0$in = 0, $$031 = 0.0, $19 = 0, $26 = 0, $34 = 0, $4 = 0, $42 = 0, $49 = 0.0, $5 = 0, $50 = 0.0, $6 = 0, $69 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 288 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(288); + $4 = sp + 192 | 0; + $5 = sp + 96 | 0; + $6 = sp + 264 | 0; + $7 = sp; + $8 = sp + 256 | 0; + do if ((HEAP32[$1 + 12 >> 2] | 0) >= 0) if ((HEAP32[$1 + 8 >> 2] | 0) < 0) { + $$0$in = $1 + 24 | 0; + break; + } else { + $$0$in = $1 + 16 | 0; + break; + } else $$0$in = $1 + 20 | 0; while (0); + $$0 = HEAP32[$$0$in >> 2] | 0; + $19 = (4 - $$0 | 0) % 4 | 0; + HEAPF64[$4 >> 3] = +HEAPF64[$1 + 168 + ($19 << 4) >> 3]; + HEAPF64[$4 + 8 >> 3] = +HEAPF64[$1 + 168 + ($19 << 4) + 8 >> 3]; + $26 = (5 - $$0 | 0) % 4 | 0; + HEAPF64[$4 + 16 >> 3] = +HEAPF64[$1 + 168 + ($26 << 4) >> 3]; + HEAPF64[$4 + 24 >> 3] = +HEAPF64[$1 + 168 + ($26 << 4) + 8 >> 3]; + $34 = (6 - $$0 | 0) % 4 | 0; + HEAPF64[$4 + 32 >> 3] = +HEAPF64[$1 + 168 + ($34 << 4) >> 3]; + HEAPF64[$4 + 40 >> 3] = +HEAPF64[$1 + 168 + ($34 << 4) + 8 >> 3]; + $42 = (7 - $$0 | 0) % 4 | 0; + HEAPF64[$4 + 48 >> 3] = +HEAPF64[$1 + 168 + ($42 << 4) >> 3]; + HEAPF64[$4 + 56 >> 3] = +HEAPF64[$1 + 168 + ($42 << 4) + 8 >> 3]; + $49 = $2 * -.5; + HEAPF64[$5 >> 3] = $49; + $50 = $2 * .5; + HEAPF64[$5 + 8 >> 3] = $50; + HEAPF64[$5 + 16 >> 3] = 0.0; + HEAPF64[$5 + 24 >> 3] = $50; + HEAPF64[$5 + 32 >> 3] = $50; + HEAPF64[$5 + 40 >> 3] = 0.0; + HEAPF64[$5 + 48 >> 3] = $50; + HEAPF64[$5 + 56 >> 3] = $49; + HEAPF64[$5 + 64 >> 3] = 0.0; + HEAPF64[$5 + 72 >> 3] = $49; + HEAPF64[$5 + 80 >> 3] = $49; + HEAPF64[$5 + 88 >> 3] = 0.0; + HEAP32[$6 >> 2] = $4; + HEAP32[$6 + 4 >> 2] = $5; + HEAP32[$6 + 8 >> 2] = 4; + if ((_icpGetInitXw2Xc_from_PlanarData(HEAP32[$0 >> 2] | 0, $4, $5, 4, $7) | 0) < 0) $$031 = 1.0e8; else { + $69 = (_icpPoint(HEAP32[$0 >> 2] | 0, $6, $7, $3, $8) | 0) < 0; + $$031 = $69 ? 1.0e8 : +HEAPF64[$8 >> 3]; + } + STACKTOP = sp; + return +$$031; +} + +function __ZN12_GLOBAL__N_116itanium_demangle13ParameterPackC2ENS0_9NodeArrayE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$05$i = 0, $$05$i1 = 0, $$05$i3 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $2 = 0, $22 = 0, $23 = 0, $28 = 0, $29 = 0, $3 = 0, $8 = 0, $9 = 0, label = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 27, 1, 1, 1); + HEAP32[$0 >> 2] = 17912; + $2 = $0 + 8 | 0; + $3 = $1; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $2; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + $13 = $0 + 5 | 0; + HEAP8[$13 >> 0] = 2; + $14 = $0 + 7 | 0; + HEAP8[$14 >> 0] = 2; + $15 = $0 + 6 | 0; + HEAP8[$15 >> 0] = 2; + $16 = __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray5beginEv($2) | 0; + $17 = __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray3endEv($2) | 0; + $$05$i = $16; + while (1) { + if (($$05$i | 0) == ($17 | 0)) { + label = 4; + break; + } + if (__ZZN12_GLOBAL__N_116itanium_demangle13ParameterPackC1ENS0_9NodeArrayEENKUlPNS0_4NodeEE_clES4_(HEAP32[$$05$i >> 2] | 0) | 0) $$05$i = $$05$i + 4 | 0; else break; + } + if ((label | 0) == 4) HEAP8[$15 >> 0] = 1; + $22 = __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray5beginEv($2) | 0; + $23 = __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray3endEv($2) | 0; + $$05$i1 = $22; + while (1) { + if (($$05$i1 | 0) == ($23 | 0)) { + label = 8; + break; + } + if (__ZZN12_GLOBAL__N_116itanium_demangle13ParameterPackC1ENS0_9NodeArrayEENKUlPNS0_4NodeEE0_clES4_(HEAP32[$$05$i1 >> 2] | 0) | 0) $$05$i1 = $$05$i1 + 4 | 0; else break; + } + if ((label | 0) == 8) HEAP8[$14 >> 0] = 1; + $28 = __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray5beginEv($2) | 0; + $29 = __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray3endEv($2) | 0; + $$05$i3 = $28; + while (1) { + if (($$05$i3 | 0) == ($29 | 0)) { + label = 12; + break; + } + if (__ZZN12_GLOBAL__N_116itanium_demangle13ParameterPackC1ENS0_9NodeArrayEENKUlPNS0_4NodeEE1_clES4_(HEAP32[$$05$i3 >> 2] | 0) | 0) $$05$i3 = $$05$i3 + 4 | 0; else break; + } + if ((label | 0) == 12) HEAP8[$13 >> 0] = 1; + return; +} + +function _prepare_for_output_pass($0) { + $0 = $0 | 0; + var $15 = 0, $2 = 0, $3 = 0, $36 = 0, $74 = 0, $77 = 0, $82 = 0, $83 = 0; + $2 = HEAP32[$0 + 444 >> 2] | 0; + $3 = $2 + 8 | 0; + if (!(HEAP32[$3 >> 2] | 0)) { + $15 = $0 + 84 | 0; + do if (HEAP32[$15 >> 2] | 0 ? (HEAP32[$0 + 136 >> 2] | 0) == 0 : 0) { + if (HEAP32[$0 + 92 >> 2] | 0 ? HEAP32[$0 + 108 >> 2] | 0 : 0) { + HEAP32[$0 + 484 >> 2] = HEAP32[$2 + 24 >> 2]; + HEAP32[$3 >> 2] = 1; + break; + } + if (!(HEAP32[$0 + 100 >> 2] | 0)) { + $36 = HEAP32[$0 >> 2] | 0; + HEAP32[$36 + 20 >> 2] = 47; + FUNCTION_TABLE_vi[HEAP32[$36 >> 2] & 255]($0); + break; + } else { + HEAP32[$0 + 484 >> 2] = HEAP32[$2 + 20 >> 2]; + break; + } + } while (0); + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 + 472 >> 2] >> 2] & 255]($0); + FUNCTION_TABLE_vi[HEAP32[(HEAP32[$0 + 452 >> 2] | 0) + 8 >> 2] & 255]($0); + if (!(HEAP32[$0 + 68 >> 2] | 0)) { + if (!(HEAP32[$2 + 16 >> 2] | 0)) FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 + 480 >> 2] >> 2] & 255]($0); + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 + 476 >> 2] >> 2] & 255]($0); + if (HEAP32[$15 >> 2] | 0) FUNCTION_TABLE_vii[HEAP32[HEAP32[$0 + 484 >> 2] >> 2] & 255]($0, HEAP32[$3 >> 2] | 0); + FUNCTION_TABLE_vii[HEAP32[HEAP32[$0 + 456 >> 2] >> 2] & 255]($0, (HEAP32[$3 >> 2] | 0) == 0 ? 0 : 3); + FUNCTION_TABLE_vii[HEAP32[HEAP32[$0 + 448 >> 2] >> 2] & 255]($0, 0); + } + } else { + HEAP32[$3 >> 2] = 0; + FUNCTION_TABLE_vii[HEAP32[HEAP32[$0 + 484 >> 2] >> 2] & 255]($0, 0); + FUNCTION_TABLE_vii[HEAP32[HEAP32[$0 + 456 >> 2] >> 2] & 255]($0, 2); + FUNCTION_TABLE_vii[HEAP32[HEAP32[$0 + 448 >> 2] >> 2] & 255]($0, 2); + } + $74 = HEAP32[$0 + 8 >> 2] | 0; + if (!$74) return; + $77 = HEAP32[$2 + 12 >> 2] | 0; + HEAP32[$74 + 12 >> 2] = $77; + $82 = ((HEAP32[$3 >> 2] | 0) == 0 ? 1 : 2) + $77 | 0; + $83 = $74 + 16 | 0; + HEAP32[$83 >> 2] = $82; + if (!(HEAP32[$0 + 64 >> 2] | 0)) return; + if (HEAP32[(HEAP32[$0 + 460 >> 2] | 0) + 20 >> 2] | 0) return; + HEAP32[$83 >> 2] = ((HEAP32[$0 + 108 >> 2] | 0) == 0 ? 1 : 2) + $82; + return; +} + +function _jinit_d_coef_controller($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$05257 = 0, $$05356 = 0, $$pre$phiZ2D = 0, $10 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $2 = 0, $24 = 0, $29 = 0, $33 = 0, $34 = 0, $46 = 0, $5 = 0, $spec$select = 0; + $2 = $0 + 4 | 0; + $5 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$2 >> 2] >> 2] & 63]($0, 1, 116) | 0; + HEAP32[$0 + 452 >> 2] = $5; + HEAP32[$5 >> 2] = 197; + HEAP32[$5 + 8 >> 2] = 198; + HEAP32[$5 + 112 >> 2] = 0; + if (!$1) { + $46 = FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$2 >> 2] | 0) + 4 >> 2] & 63]($0, 1, 1280) | 0; + HEAP32[$5 + 32 >> 2] = $46; + HEAP32[$5 + 36 >> 2] = $46 + 128; + HEAP32[$5 + 40 >> 2] = $46 + 256; + HEAP32[$5 + 44 >> 2] = $46 + 384; + HEAP32[$5 + 48 >> 2] = $46 + 512; + HEAP32[$5 + 52 >> 2] = $46 + 640; + HEAP32[$5 + 56 >> 2] = $46 + 768; + HEAP32[$5 + 60 >> 2] = $46 + 896; + HEAP32[$5 + 64 >> 2] = $46 + 1024; + HEAP32[$5 + 68 >> 2] = $46 + 1152; + if (!(HEAP32[$0 + 436 >> 2] | 0)) _memset($46 | 0, 0, 1280) | 0; + HEAP32[$5 + 4 >> 2] = 84; + HEAP32[$5 + 12 >> 2] = 58; + HEAP32[$5 + 16 >> 2] = 0; + return; + } + $10 = $0 + 36 | 0; + if ((HEAP32[$10 >> 2] | 0) > 0) { + $15 = $0 + 224 | 0; + $16 = $5 + 72 | 0; + $$05257 = 0; + $$05356 = HEAP32[$0 + 216 >> 2] | 0; + while (1) { + $17 = $$05356 + 12 | 0; + $18 = HEAP32[$17 >> 2] | 0; + $spec$select = (HEAP32[$15 >> 2] | 0) == 0 ? $18 : $18 * 3 | 0; + $24 = HEAP32[(HEAP32[$2 >> 2] | 0) + 20 >> 2] | 0; + $29 = _jround_up(HEAP32[$$05356 + 28 >> 2] | 0, HEAP32[$$05356 + 8 >> 2] | 0) | 0; + $33 = _jround_up(HEAP32[$$05356 + 32 >> 2] | 0, HEAP32[$17 >> 2] | 0) | 0; + $34 = FUNCTION_TABLE_iiiiiii[$24 & 63]($0, 1, 1, $29, $33, $spec$select) | 0; + HEAP32[$16 + ($$05257 << 2) >> 2] = $34; + $$05257 = $$05257 + 1 | 0; + if (($$05257 | 0) >= (HEAP32[$10 >> 2] | 0)) { + $$pre$phiZ2D = $16; + break; + } else $$05356 = $$05356 + 88 | 0; + } + } else $$pre$phiZ2D = $5 + 72 | 0; + HEAP32[$5 + 4 >> 2] = 83; + HEAP32[$5 + 12 >> 2] = 57; + HEAP32[$5 + 16 >> 2] = $$pre$phiZ2D; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseUnscopedNameEPNS5_9NameStateE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$1 = 0, $$byval_copy1 = 0, $2 = 0, $3 = 0, $7 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 16 | 0; + $2 = sp + 8 | 0; + $3 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 55114); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy1) | 0) ? (__ZN12_GLOBAL__N_110StringViewC2EPKc($3, 55118), HEAP32[$$byval_copy1 >> 2] = HEAP32[$3 >> 2], HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$3 + 4 >> 2], !(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $$byval_copy1) | 0)) : 0) $$1 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20parseUnqualifiedNameEPNS5_9NameStateE(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0, $1) | 0; else { + $7 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20parseUnqualifiedNameEPNS5_9NameStateE(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0, $1) | 0; + HEAP32[$$byval_copy1 >> 2] = $7; + if (!$7) $$0 = 0; else $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_16StdQualifiedNameEJRPNS0_4NodeEEEES9_DpOT0_($0, $$byval_copy1) | 0; + $$1 = $$0; + } + STACKTOP = sp; + return $$1 | 0; +} + +function __ZNSt3__211__stdoutbufIwE8overflowEj($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$032 = 0, $$4 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $28 = 0, $3 = 0, $38 = 0, $4 = 0, $5 = 0, $8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp + 4 | 0; + $5 = sp; + do if (!(__ZNSt3__211char_traitsIwE11eq_int_typeEjj($1, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0)) { + $8 = __ZNSt3__211char_traitsIwE12to_char_typeEj($1) | 0; + HEAP32[$3 >> 2] = $8; + if (HEAP8[$0 + 44 >> 0] | 0) { + if ((_fwrite($3, 4, 1, HEAP32[$0 + 32 >> 2] | 0) | 0) == 1) { + label = 15; + break; + } + $$4 = __ZNSt3__211char_traitsIwE3eofEv() | 0; + break; + } + HEAP32[$4 >> 2] = $2; + $17 = $3 + 4 | 0; + $18 = $0 + 36 | 0; + $19 = $0 + 40 | 0; + $20 = $2 + 8 | 0; + $21 = $2; + $22 = $0 + 32 | 0; + $$032 = $3; + while (1) { + $23 = HEAP32[$18 >> 2] | 0; + $28 = FUNCTION_TABLE_iiiiiiiii[HEAP32[(HEAP32[$23 >> 2] | 0) + 12 >> 2] & 15]($23, HEAP32[$19 >> 2] | 0, $$032, $17, $5, $2, $20, $4) | 0; + if ((HEAP32[$5 >> 2] | 0) == ($$032 | 0)) { + label = 14; + break; + } + if (($28 | 0) == 3) { + label = 8; + break; + } + if ($28 >>> 0 >= 2) { + label = 14; + break; + } + $38 = (HEAP32[$4 >> 2] | 0) - $21 | 0; + if ((_fwrite($2, 1, $38, HEAP32[$22 >> 2] | 0) | 0) != ($38 | 0)) { + label = 14; + break; + } + if (($28 | 0) == 1) $$032 = HEAP32[$5 >> 2] | 0; else { + label = 13; + break; + } + } + if ((label | 0) == 8) if ((_fwrite($$032, 1, 1, HEAP32[$22 >> 2] | 0) | 0) == 1) label = 13; else label = 14; + if ((label | 0) == 13) { + label = 15; + break; + } else if ((label | 0) == 14) { + $$4 = __ZNSt3__211char_traitsIwE3eofEv() | 0; + break; + } + } else label = 15; while (0); + if ((label | 0) == 15) $$4 = __ZNSt3__211char_traitsIwE7not_eofEj($1) | 0; + STACKTOP = sp; + return $$4 | 0; +} + +function __ZNSt3__211__stdoutbufIcE8overflowEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$032 = 0, $$4 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $28 = 0, $3 = 0, $38 = 0, $4 = 0, $5 = 0, $8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp + 4 | 0; + $5 = sp; + do if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($1, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) { + $8 = __ZNSt3__211char_traitsIcE12to_char_typeEi($1) | 0; + HEAP8[$3 >> 0] = $8; + if (HEAP8[$0 + 44 >> 0] | 0) { + if ((_fwrite($3, 1, 1, HEAP32[$0 + 32 >> 2] | 0) | 0) == 1) { + label = 15; + break; + } + $$4 = __ZNSt3__211char_traitsIcE3eofEv() | 0; + break; + } + HEAP32[$4 >> 2] = $2; + $17 = $3 + 1 | 0; + $18 = $0 + 36 | 0; + $19 = $0 + 40 | 0; + $20 = $2 + 8 | 0; + $21 = $2; + $22 = $0 + 32 | 0; + $$032 = $3; + while (1) { + $23 = HEAP32[$18 >> 2] | 0; + $28 = FUNCTION_TABLE_iiiiiiiii[HEAP32[(HEAP32[$23 >> 2] | 0) + 12 >> 2] & 15]($23, HEAP32[$19 >> 2] | 0, $$032, $17, $5, $2, $20, $4) | 0; + if ((HEAP32[$5 >> 2] | 0) == ($$032 | 0)) { + label = 14; + break; + } + if (($28 | 0) == 3) { + label = 8; + break; + } + if ($28 >>> 0 >= 2) { + label = 14; + break; + } + $38 = (HEAP32[$4 >> 2] | 0) - $21 | 0; + if ((_fwrite($2, 1, $38, HEAP32[$22 >> 2] | 0) | 0) != ($38 | 0)) { + label = 14; + break; + } + if (($28 | 0) == 1) $$032 = HEAP32[$5 >> 2] | 0; else { + label = 13; + break; + } + } + if ((label | 0) == 8) if ((_fwrite($$032, 1, 1, HEAP32[$22 >> 2] | 0) | 0) == 1) label = 13; else label = 14; + if ((label | 0) == 13) { + label = 15; + break; + } else if ((label | 0) == 14) { + $$4 = __ZNSt3__211char_traitsIcE3eofEv() | 0; + break; + } + } else label = 15; while (0); + if ((label | 0) == 15) $$4 = __ZNSt3__211char_traitsIcE7not_eofEi($1) | 0; + STACKTOP = sp; + return $$4 | 0; +} + +function __ZN6vision11FindInliersERNSt3__26vectorINS_7match_tENS0_9allocatorIS2_EEEEPKfRKNS1_INS_12FeaturePointENS3_IS9_EEEESD_RKS5_f($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = +$5; + var $$0 = 0, $13 = 0, $14 = 0, $15 = 0, $17 = 0, $23 = 0, $24 = 0, $37 = 0.0, $50 = 0, $51 = 0, $54 = 0, $59 = 0, $6 = 0, $60 = 0, $7 = 0.0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $6 = sp; + $7 = +__ZN6vision3sqrIfEET_S1_($5); + $8 = $4 + 4 | 0; + __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE7reserveEm($0, (HEAP32[$8 >> 2] | 0) - (HEAP32[$4 >> 2] | 0) >> 3); + $13 = $6 + 4 | 0; + $14 = $0 + 4 | 0; + $15 = $0 + 8 | 0; + $$0 = 0; + while (1) { + $17 = HEAP32[$4 >> 2] | 0; + if ($$0 >>> 0 >= (HEAP32[$8 >> 2] | 0) - $17 >> 3 >>> 0) break; + $23 = HEAP32[$17 + ($$0 << 3) + 4 >> 2] | 0; + $24 = HEAP32[$3 >> 2] | 0; + __ZN6vision35MultiplyPointHomographyInhomogenousIfEEvRT_S2_PKS1_S1_S1_($6, $13, $1, +HEAPF32[$24 + ($23 * 20 | 0) >> 2], +HEAPF32[$24 + ($23 * 20 | 0) + 4 >> 2]); + $37 = +__ZN6vision3sqrIfEET_S1_(+HEAPF32[$6 >> 2] - +HEAPF32[(HEAP32[$2 >> 2] | 0) + ((HEAP32[(HEAP32[$4 >> 2] | 0) + ($$0 << 3) >> 2] | 0) * 20 | 0) >> 2]); + do if ($37 + +__ZN6vision3sqrIfEET_S1_(+HEAPF32[$13 >> 2] - +HEAPF32[(HEAP32[$2 >> 2] | 0) + ((HEAP32[(HEAP32[$4 >> 2] | 0) + ($$0 << 3) >> 2] | 0) * 20 | 0) + 4 >> 2]) <= $7) { + $50 = (HEAP32[$4 >> 2] | 0) + ($$0 << 3) | 0; + $51 = HEAP32[$14 >> 2] | 0; + if (($51 | 0) == (HEAP32[$15 >> 2] | 0)) { + __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE21__push_back_slow_pathIRKS2_EEvOT_($0, $50); + break; + } else { + $54 = $50; + $59 = HEAP32[$54 + 4 >> 2] | 0; + $60 = $51; + HEAP32[$60 >> 2] = HEAP32[$54 >> 2]; + HEAP32[$60 + 4 >> 2] = $59; + HEAP32[$14 >> 2] = (HEAP32[$14 >> 2] | 0) + 8; + break; + } + } while (0); + $$0 = $$0 + 1 | 0; + } + STACKTOP = sp; + return; +} + +function _ycck_cmyk_convert($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$07890$us = 0, $$08089$us = 0, $$08188$us = 0, $$091$us = 0, $$in = 0, $$neg83$us = 0, $10 = 0, $12 = 0, $14 = 0, $16 = 0, $18 = 0, $20 = 0, $21 = 0, $22 = 0, $27 = 0, $30 = 0, $33 = 0, $36 = 0, $43 = 0, $46 = 0, $6 = 0, $8 = 0, $$in$looptemp = 0; + $6 = HEAP32[$0 + 480 >> 2] | 0; + $8 = HEAP32[$0 + 112 >> 2] | 0; + $10 = HEAP32[$0 + 336 >> 2] | 0; + $12 = HEAP32[$6 + 8 >> 2] | 0; + $14 = HEAP32[$6 + 12 >> 2] | 0; + $16 = HEAP32[$6 + 16 >> 2] | 0; + $18 = HEAP32[$6 + 20 >> 2] | 0; + if (($4 | 0) <= 0) return; + $20 = $1 + 4 | 0; + $21 = $1 + 8 | 0; + $22 = $1 + 12 | 0; + if (!$8) return; + $$07890$us = $3; + $$091$us = $2; + $$in = $4; + while (1) { + $$in$looptemp = $$in; + $$in = $$in + -1 | 0; + $27 = HEAP32[(HEAP32[$1 >> 2] | 0) + ($$091$us << 2) >> 2] | 0; + $30 = HEAP32[(HEAP32[$20 >> 2] | 0) + ($$091$us << 2) >> 2] | 0; + $33 = HEAP32[(HEAP32[$21 >> 2] | 0) + ($$091$us << 2) >> 2] | 0; + $36 = HEAP32[(HEAP32[$22 >> 2] | 0) + ($$091$us << 2) >> 2] | 0; + $$091$us = $$091$us + 1 | 0; + $$08089$us = HEAP32[$$07890$us >> 2] | 0; + $$08188$us = 0; + while (1) { + $43 = HEAPU8[$30 + $$08188$us >> 0] | 0; + $46 = HEAPU8[$33 + $$08188$us >> 0] | 0; + $$neg83$us = ~HEAP8[$27 + $$08188$us >> 0] & 255; + HEAP8[$$08089$us >> 0] = HEAP8[$10 + ($$neg83$us - (HEAP32[$12 + ($46 << 2) >> 2] | 0)) >> 0] | 0; + HEAP8[$$08089$us + 1 >> 0] = HEAP8[$10 + ($$neg83$us - ((HEAP32[$16 + ($46 << 2) >> 2] | 0) + (HEAP32[$18 + ($43 << 2) >> 2] | 0) >> 16)) >> 0] | 0; + HEAP8[$$08089$us + 2 >> 0] = HEAP8[$10 + ($$neg83$us - (HEAP32[$14 + ($43 << 2) >> 2] | 0)) >> 0] | 0; + HEAP8[$$08089$us + 3 >> 0] = HEAP8[$36 + $$08188$us >> 0] | 0; + $$08188$us = $$08188$us + 1 | 0; + if (($$08188$us | 0) == ($8 | 0)) break; else $$08089$us = $$08089$us + 4 | 0; + } + if (($$in$looptemp | 0) <= 1) break; else $$07890$us = $$07890$us + 4 | 0; + } + return; +} + +function __ZN6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEE11addKeyframeENSt3__210shared_ptrINS_8KeyframeILi96EEEEEi($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$pre$phi$iZ2D = 0, $10 = 0, $11 = 0, $12 = 0, $14 = 0, $16 = 0, $20 = 0, $22 = 0, $3 = 0, $4 = 0, $5 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp + 4 | 0; + $4 = sp; + HEAP32[$4 >> 2] = $2; + $5 = $0 + 72 | 0; + if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEEEENS_22__unordered_map_hasherIiS7_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS7_NS_8equal_toIiEELb1EEENS_9allocatorIS7_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS7_PvEEEERKT_($5, $4) | 0) { + $8 = ___cxa_allocate_exception(16) | 0; + HEAP32[$3 >> 2] = 0; + HEAP32[$3 + 4 >> 2] = 0; + HEAP32[$3 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm($3, 33157, __ZNSt3__211char_traitsIcE6lengthEPKc(33157) | 0); + __ZN6vision9ExceptionC2ERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE($8, $3); + ___cxa_throw($8 | 0, 13208, 5); + } + $10 = __ZNSt3__213unordered_mapIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEENS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS5_EEEEEixERSC_($5, $4) | 0; + $11 = HEAP32[$1 >> 2] | 0; + HEAP32[$3 >> 2] = $11; + $12 = $3 + 4 | 0; + $14 = HEAP32[$1 + 4 >> 2] | 0; + HEAP32[$12 >> 2] = $14; + if (!$14) { + $$pre$phi$iZ2D = $12; + $22 = 0; + } else { + $16 = $14 + 4 | 0; + HEAP32[$16 >> 2] = (HEAP32[$16 >> 2] | 0) + 1; + $$pre$phi$iZ2D = $12; + $22 = HEAP32[$12 >> 2] | 0; + } + HEAP32[$3 >> 2] = HEAP32[$10 >> 2]; + HEAP32[$10 >> 2] = $11; + $20 = $10 + 4 | 0; + HEAP32[$$pre$phi$iZ2D >> 2] = HEAP32[$20 >> 2]; + HEAP32[$20 >> 2] = $22; + __ZNSt3__210shared_ptrIN6vision8KeyframeILi96EEEED2Ev($3); + STACKTOP = sp; + return; +} + +function _EV_create($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$071 = 0, $$072 = 0, $$074 = 0, $$075 = 0, $$077 = 0, $$078 = 0.0, $$079 = 0, $$1 = 0, $$173 = 0, $$176 = 0, $$2 = 0, $$3 = 0, $29 = 0.0, $33 = 0.0, $34 = 0, $42 = 0.0, $5 = 0, $7 = 0; + $5 = HEAP32[$0 + 4 >> 2] | 0; + $7 = HEAP32[$0 + 8 >> 2] | 0; + L1 : do if (((((!(($5 | 0) < 1 | ($7 | 0) < 1) ? (HEAP32[$1 + 4 >> 2] | 0) == ($5 | 0) : 0) ? (HEAP32[$1 + 8 >> 2] | 0) == ($5 | 0) : 0) ? (HEAP32[$2 + 4 >> 2] | 0) == ($5 | 0) : 0) ? (HEAP32[$2 + 8 >> 2] | 0) == ($7 | 0) : 0) ? (HEAP32[$3 + 4 >> 2] | 0) == ($5 | 0) : 0) { + $$072 = 0; + $$075 = HEAP32[$2 >> 2] | 0; + while (1) { + if (($$072 | 0) >= ($5 | 0)) break; + $29 = +HEAPF64[(HEAP32[$3 >> 2] | 0) + ($$072 << 3) >> 3]; + if ($29 < 1.0e-16) break; + $33 = 1.0 / +Math_sqrt(+(+Math_abs(+$29))); + $34 = Math_imul($$072, $5) | 0; + $$071 = 0; + $$176 = $$075; + while (1) { + if (($$071 | 0) == ($7 | 0)) break; + $$0 = 0; + $$077 = (HEAP32[$1 >> 2] | 0) + ($34 << 3) | 0; + $$078 = 0.0; + $$079 = (HEAP32[$0 >> 2] | 0) + ($$071 << 3) | 0; + while (1) { + if (($$0 | 0) == ($5 | 0)) break; + $42 = $$078 + +HEAPF64[$$077 >> 3] * +HEAPF64[$$079 >> 3]; + $$0 = $$0 + 1 | 0; + $$077 = $$077 + 8 | 0; + $$078 = $42; + $$079 = $$079 + ($7 << 3) | 0; + } + HEAPF64[$$176 >> 3] = $33 * $$078; + $$071 = $$071 + 1 | 0; + $$176 = $$176 + 8 | 0; + } + $$072 = $$072 + 1 | 0; + $$075 = $$075 + ($7 << 3) | 0; + } + $$173 = $$072; + $$2 = $$075; + while (1) { + if (($$173 | 0) >= ($5 | 0)) { + $$074 = 0; + break L1; + } + HEAPF64[(HEAP32[$3 >> 2] | 0) + ($$173 << 3) >> 3] = 0.0; + $$1 = 0; + $$3 = $$2; + while (1) { + if (($$1 | 0) >= ($7 | 0)) break; + HEAPF64[$$3 >> 3] = 0.0; + $$1 = $$1 + 1 | 0; + $$3 = $$3 + 8 | 0; + } + $$173 = $$173 + 1 | 0; + $$2 = $$3; + } + } else $$074 = -1; while (0); + return $$074 | 0; +} + +function _icpGetJ_T_S($0) { + $0 = $0 | 0; + var $1 = 0, $10 = 0, $13 = 0, $15 = 0, $17 = 0, $2 = 0, $5 = 0, $7 = 0, $9 = 0, dest = 0, stop = 0; + $1 = $0 + 64 | 0; + dest = $0; + stop = dest + 64 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAPF64[$1 >> 3] = -1.0; + $2 = $0 + 72 | 0; + HEAP32[$2 >> 2] = 0; + HEAP32[$2 + 4 >> 2] = 0; + HEAP32[$2 + 8 >> 2] = 0; + HEAP32[$2 + 12 >> 2] = 0; + HEAP32[$2 + 16 >> 2] = 0; + HEAP32[$2 + 20 >> 2] = 0; + HEAP32[$2 + 24 >> 2] = 0; + HEAP32[$2 + 28 >> 2] = 0; + HEAPF64[$0 + 104 >> 3] = 1.0; + $5 = $0 + 160 | 0; + dest = $0 + 112 | 0; + stop = dest + 48 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAPF64[$5 >> 3] = 1.0; + $7 = $0 + 240 | 0; + dest = $0 + 168 | 0; + stop = dest + 72 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAPF64[$7 >> 3] = -1.0; + $9 = $0 + 296 | 0; + dest = $0 + 248 | 0; + stop = dest + 48 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAPF64[$9 >> 3] = -1.0; + $10 = $0 + 304 | 0; + HEAP32[$10 >> 2] = 0; + HEAP32[$10 + 4 >> 2] = 0; + HEAP32[$10 + 8 >> 2] = 0; + HEAP32[$10 + 12 >> 2] = 0; + HEAP32[$10 + 16 >> 2] = 0; + HEAP32[$10 + 20 >> 2] = 0; + HEAP32[$10 + 24 >> 2] = 0; + HEAP32[$10 + 28 >> 2] = 0; + HEAPF64[$0 + 336 >> 3] = 1.0; + $13 = $0 + 456 | 0; + dest = $0 + 344 | 0; + stop = dest + 112 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAPF64[$13 >> 3] = 1.0; + $15 = $0 + 512 | 0; + dest = $0 + 464 | 0; + stop = dest + 48 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAPF64[$15 >> 3] = 1.0; + $17 = $0 + 568 | 0; + dest = $0 + 520 | 0; + stop = dest + 48 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAPF64[$17 >> 3] = 1.0; + return; +} + +function ___stpcpy($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$lcssa = 0, $$025$lcssa = 0, $$02536 = 0, $$026$lcssa = 0, $$02642 = 0, $$027$lcssa = 0, $$02741 = 0, $$030 = 0, $$037 = 0, $$1 = 0, $$128 = 0, $$22934 = 0, $$235 = 0, $11 = 0, $12 = 0, $16 = 0, $2 = 0, $22 = 0, $23 = 0, $24 = 0, $31 = 0, $34 = 0, $35 = 0, $9 = 0, label = 0; + $2 = $1; + L1 : do if (!(($2 ^ $0) & 3)) { + if (!($2 & 3)) { + $$026$lcssa = $1; + $$027$lcssa = $0; + } else { + $$02642 = $1; + $$02741 = $0; + while (1) { + $9 = HEAP8[$$02642 >> 0] | 0; + HEAP8[$$02741 >> 0] = $9; + if (!($9 << 24 >> 24)) { + $$030 = $$02741; + break L1; + } + $11 = $$02642 + 1 | 0; + $12 = $$02741 + 1 | 0; + if (!($11 & 3)) { + $$026$lcssa = $11; + $$027$lcssa = $12; + break; + } else { + $$02642 = $11; + $$02741 = $12; + } + } + } + $16 = HEAP32[$$026$lcssa >> 2] | 0; + if (!(($16 & -2139062144 ^ -2139062144) & $16 + -16843009)) { + $$02536 = $$027$lcssa; + $$037 = $$026$lcssa; + $24 = $16; + while (1) { + $22 = $$037 + 4 | 0; + $23 = $$02536 + 4 | 0; + HEAP32[$$02536 >> 2] = $24; + $24 = HEAP32[$22 >> 2] | 0; + if (($24 & -2139062144 ^ -2139062144) & $24 + -16843009 | 0) { + $$0$lcssa = $22; + $$025$lcssa = $23; + break; + } else { + $$02536 = $23; + $$037 = $22; + } + } + } else { + $$0$lcssa = $$026$lcssa; + $$025$lcssa = $$027$lcssa; + } + $$1 = $$0$lcssa; + $$128 = $$025$lcssa; + label = 10; + } else { + $$1 = $1; + $$128 = $0; + label = 10; + } while (0); + if ((label | 0) == 10) { + $31 = HEAP8[$$1 >> 0] | 0; + HEAP8[$$128 >> 0] = $31; + if (!($31 << 24 >> 24)) $$030 = $$128; else { + $$22934 = $$128; + $$235 = $$1; + while (1) { + $$235 = $$235 + 1 | 0; + $34 = $$22934 + 1 | 0; + $35 = HEAP8[$$235 >> 0] | 0; + HEAP8[$34 >> 0] = $35; + if (!($35 << 24 >> 24)) { + $$030 = $34; + break; + } else $$22934 = $34; + } + } + } + return $$030 | 0; +} + +function __ZNSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE6assignIPS3_EENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr16is_constructibleIS3_NS_15iterator_traitsISA_E9referenceEEE5valueEvE4typeESA_SA_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $13 = 0, $14 = 0, $17 = 0, $18 = 0, $21 = 0, $31 = 0, $36 = 0, $39 = 0, $4 = 0, $6 = 0, $7 = 0, $9 = 0, $spec$select = 0; + $4 = $1; + $6 = ($2 - $4 | 0) / 12 | 0; + $7 = $0 + 8 | 0; + $9 = HEAP32[$0 >> 2] | 0; + $13 = $9; + do if ($6 >>> 0 > (((HEAP32[$7 >> 2] | 0) - $9 | 0) / 12 | 0) >>> 0) { + __ZNSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE13__vdeallocateEv($0); + $31 = __ZNKSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE8max_sizeEv($0) | 0; + if ($31 >>> 0 < $6 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $36 = ((HEAP32[$7 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) | 0) / 12 | 0; + $39 = $36 << 1; + __ZNSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE11__vallocateEm($0, $36 >>> 0 < $31 >>> 1 >>> 0 ? ($39 >>> 0 < $6 >>> 0 ? $6 : $39) : $31); + __ZNSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE18__construct_at_endIPS3_EENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_m($0, $1, $2, $6); + break; + } + } else { + $14 = $0 + 4 | 0; + $17 = ((HEAP32[$14 >> 2] | 0) - $9 | 0) / 12 | 0; + $18 = $6 >>> 0 > $17 >>> 0; + $spec$select = $18 ? $1 + ($17 * 12 | 0) | 0 : $2; + $21 = $spec$select - $4 | 0; + if ($21 | 0) _memmove($9 | 0, $1 | 0, $21 | 0) | 0; + if ($18) { + __ZNSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE18__construct_at_endIPS3_EENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_m($0, $spec$select, $2, $6 - (((HEAP32[$14 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) | 0) / 12 | 0) | 0); + break; + } else { + HEAP32[$14 >> 2] = $13 + ((($21 | 0) / 12 | 0) * 12 | 0); + break; + } + } while (0); + return; +} + +function __ZNSt3__216__pad_and_outputIwNS_11char_traitsIwEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$038 = 0, $$sroa$0$2 = 0, $10 = 0, $12 = 0, $13 = 0, $14 = 0, $17 = 0, $18 = 0, $19 = 0, $38 = 0, $39 = 0, $6 = 0, $7 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $6 = sp; + $7 = HEAP32[$0 >> 2] | 0; + L1 : do if (!$7) $$sroa$0$2 = 0; else { + $9 = $3; + $10 = $1; + $12 = $9 - $10 >> 2; + $13 = $4 + 12 | 0; + $14 = HEAP32[$13 >> 2] | 0; + $$038 = ($14 | 0) > ($12 | 0) ? $14 - $12 | 0 : 0; + $17 = $2; + $18 = $17 - $10 | 0; + $19 = $18 >> 2; + if (($18 | 0) > 0 ? (FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$7 >> 2] | 0) + 48 >> 2] & 63]($7, $1, $19) | 0) != ($19 | 0) : 0) { + HEAP32[$0 >> 2] = 0; + $$sroa$0$2 = 0; + break; + } + do if (($$038 | 0) > 0) { + HEAP32[$6 >> 2] = 0; + HEAP32[$6 + 4 >> 2] = 0; + HEAP32[$6 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw($6, $$038, $5); + if ((FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$7 >> 2] | 0) + 48 >> 2] & 63]($7, (HEAP8[$6 + 8 + 3 >> 0] | 0) < 0 ? HEAP32[$6 >> 2] | 0 : $6, $$038) | 0) == ($$038 | 0)) { + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($6); + break; + } else { + HEAP32[$0 >> 2] = 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($6); + $$sroa$0$2 = 0; + break L1; + } + } while (0); + $38 = $9 - $17 | 0; + $39 = $38 >> 2; + if (($38 | 0) > 0 ? (FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$7 >> 2] | 0) + 48 >> 2] & 63]($7, $2, $39) | 0) != ($39 | 0) : 0) { + HEAP32[$0 >> 2] = 0; + $$sroa$0$2 = 0; + break; + } + HEAP32[$13 >> 2] = 0; + $$sroa$0$2 = $7; + } while (0); + STACKTOP = sp; + return $$sroa$0$2 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle9ArrayType10printRightERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy3 = 0, $13 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy3 = sp + 32 | 0; + $2 = sp + 24 | 0; + $3 = sp + 16 | 0; + $4 = sp + 8 | 0; + $5 = sp; + if ((__ZNK12_GLOBAL__N_112OutputStream4backEv($1) | 0) << 24 >> 24 != 93) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51966); + HEAP32[$$byval_copy3 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy3 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy3); + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 55925); + HEAP32[$$byval_copy3 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy3 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy3); + $8 = $0 + 12 | 0; + if (!(__ZNK12_GLOBAL__N_116itanium_demangle12NodeOrString8isStringEv($8) | 0)) { + if (__ZNK12_GLOBAL__N_116itanium_demangle12NodeOrString6isNodeEv($8) | 0) __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(__ZNK12_GLOBAL__N_116itanium_demangle12NodeOrString6asNodeEv($8) | 0, $1); + } else { + __ZNK12_GLOBAL__N_116itanium_demangle12NodeOrString8asStringEv($4, $8); + HEAP32[$$byval_copy3 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy3 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy3); + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 51614); + HEAP32[$$byval_copy3 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy3 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy3); + $13 = HEAP32[$0 + 8 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$13 >> 2] | 0) + 20 >> 2] & 255]($13, $1); + STACKTOP = sp; + return; +} + +function _arGetTransMatSquareCont($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = +$3; + $4 = $4 | 0; + var $$0 = 0, $$0$in = 0, $19 = 0, $26 = 0, $34 = 0, $42 = 0, $49 = 0.0, $5 = 0, $50 = 0.0, $6 = 0, $66 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 192 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(192); + $5 = sp + 96 | 0; + $6 = sp; + $7 = sp + 168 | 0; + $8 = sp + 160 | 0; + do if ((HEAP32[$1 + 12 >> 2] | 0) >= 0) if ((HEAP32[$1 + 8 >> 2] | 0) < 0) { + $$0$in = $1 + 24 | 0; + break; + } else { + $$0$in = $1 + 16 | 0; + break; + } else $$0$in = $1 + 20 | 0; while (0); + $$0 = HEAP32[$$0$in >> 2] | 0; + $19 = (4 - $$0 | 0) % 4 | 0; + HEAPF64[$5 >> 3] = +HEAPF64[$1 + 168 + ($19 << 4) >> 3]; + HEAPF64[$5 + 8 >> 3] = +HEAPF64[$1 + 168 + ($19 << 4) + 8 >> 3]; + $26 = (5 - $$0 | 0) % 4 | 0; + HEAPF64[$5 + 16 >> 3] = +HEAPF64[$1 + 168 + ($26 << 4) >> 3]; + HEAPF64[$5 + 24 >> 3] = +HEAPF64[$1 + 168 + ($26 << 4) + 8 >> 3]; + $34 = (6 - $$0 | 0) % 4 | 0; + HEAPF64[$5 + 32 >> 3] = +HEAPF64[$1 + 168 + ($34 << 4) >> 3]; + HEAPF64[$5 + 40 >> 3] = +HEAPF64[$1 + 168 + ($34 << 4) + 8 >> 3]; + $42 = (7 - $$0 | 0) % 4 | 0; + HEAPF64[$5 + 48 >> 3] = +HEAPF64[$1 + 168 + ($42 << 4) >> 3]; + HEAPF64[$5 + 56 >> 3] = +HEAPF64[$1 + 168 + ($42 << 4) + 8 >> 3]; + $49 = $3 * -.5; + HEAPF64[$6 >> 3] = $49; + $50 = $3 * .5; + HEAPF64[$6 + 8 >> 3] = $50; + HEAPF64[$6 + 16 >> 3] = 0.0; + HEAPF64[$6 + 24 >> 3] = $50; + HEAPF64[$6 + 32 >> 3] = $50; + HEAPF64[$6 + 40 >> 3] = 0.0; + HEAPF64[$6 + 48 >> 3] = $50; + HEAPF64[$6 + 56 >> 3] = $49; + HEAPF64[$6 + 64 >> 3] = 0.0; + HEAPF64[$6 + 72 >> 3] = $49; + HEAPF64[$6 + 80 >> 3] = $49; + HEAPF64[$6 + 88 >> 3] = 0.0; + HEAP32[$7 >> 2] = $5; + HEAP32[$7 + 4 >> 2] = $6; + HEAP32[$7 + 8 >> 2] = 4; + $66 = (_icpPoint(HEAP32[$0 >> 2] | 0, $7, $2, $4, $8) | 0) < 0; + STACKTOP = sp; + return +($66 ? 1.0e8 : +HEAPF64[$8 >> 3]); +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13ReferenceType9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy2 = 0, $11 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy2 = sp + 40 | 0; + $2 = sp + 24 | 0; + $3 = sp + 8 | 0; + $4 = sp + 32 | 0; + $5 = sp + 16 | 0; + $6 = sp; + $7 = $0 + 16 | 0; + if (!(HEAP8[$7 >> 0] | 0)) { + __ZN12_GLOBAL__N_114SwapAndRestoreIbEC2ERbb($2, $7, 1); + __ZNK12_GLOBAL__N_116itanium_demangle13ReferenceType8collapseERNS_12OutputStreamE($3, $0, $1); + $11 = HEAP32[$3 + 4 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$11 >> 2] | 0) + 16 >> 2] & 255]($11, $1); + if (__ZNK12_GLOBAL__N_116itanium_demangle4Node8hasArrayERNS_12OutputStreamE($11, $1) | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 51966); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + } + if (!(__ZNK12_GLOBAL__N_116itanium_demangle4Node8hasArrayERNS_12OutputStreamE($11, $1) | 0) ? !(__ZNK12_GLOBAL__N_116itanium_demangle4Node11hasFunctionERNS_12OutputStreamE($11, $1) | 0) : 0) {} else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 51968); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($6, (HEAP32[$3 >> 2] | 0) == 0 ? 51970 : 51972); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + __ZN12_GLOBAL__N_114SwapAndRestoreIbED2Ev($2); + } + STACKTOP = sp; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIdE9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0, $$0$idx = 0, $$034 = 0, $$07$i$i = 0, $$byval_copy = 0, $15 = 0, $18 = 0, $2 = 0, $24 = 0, $26 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $scevgep = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $$byval_copy = sp + 40 | 0; + $2 = sp + 32 | 0; + $3 = sp; + $4 = sp + 48 | 0; + $5 = $0 + 8 | 0; + $6 = __ZNK12_GLOBAL__N_110StringView5beginEv($5) | 0; + if (((__ZNK12_GLOBAL__N_110StringView3endEv($5) | 0) + 1 - $6 | 0) >>> 0 > 16) { + $scevgep = $2 + 8 | 0; + $$0$idx = 0; + $$034 = $2; + while (1) { + if (($$0$idx | 0) == 16) break; + $15 = HEAP8[$6 + $$0$idx >> 0] | 0; + $18 = HEAP8[$6 + ($$0$idx | 1) >> 0] | 0; + HEAP8[$$034 >> 0] = (($18 + -48 | 0) >>> 0 < 10 ? 208 : 169) + $18 + ((($15 + -48 | 0) >>> 0 < 10 ? 0 : 9) + $15 << 4); + $$0$idx = $$0$idx + 2 | 0; + $$034 = $$034 + 1 | 0; + } + $$0$i$i = $scevgep; + $$07$i$i = $2; + while (1) { + $24 = $$0$i$i + -1 | 0; + if ($$07$i$i >>> 0 >= $24 >>> 0) break; + $26 = HEAP8[$$07$i$i >> 0] | 0; + HEAP8[$$07$i$i >> 0] = HEAP8[$24 >> 0] | 0; + HEAP8[$24 >> 0] = $26; + $$0$i$i = $24; + $$07$i$i = $$07$i$i + 1 | 0; + } + HEAP32[$3 >> 2] = 0; + HEAP32[$3 + 4 >> 2] = 0; + HEAP32[$3 + 8 >> 2] = 0; + HEAP32[$3 + 12 >> 2] = 0; + HEAP32[$3 + 16 >> 2] = 0; + HEAP32[$3 + 20 >> 2] = 0; + HEAP32[$3 + 24 >> 2] = 0; + HEAP32[$3 + 28 >> 2] = 0; + HEAPF64[$$byval_copy >> 3] = +HEAPF64[$2 >> 3]; + __ZN12_GLOBAL__N_110StringViewC2EPKcS2_($4, $3, $3 + (_snprintf($3, 32, 52392, $$byval_copy) | 0) | 0); + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + } + STACKTOP = sp; + return; +} + +function __ZN6vision27OrthogonalizePivot8x9Basis2IfEEbPT_S2_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $10 = 0, $12 = 0, $14 = 0, $16 = 0.0, $17 = 0.0, $19 = 0.0, $2 = 0, $21 = 0.0, $23 = 0.0, $25 = 0.0, $27 = 0, $28 = 0, $3 = 0, $31 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 72 | 0; + $4 = $0 + 36 | 0; + $5 = $1 + 72 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($3, $4, $5); + $6 = $0 + 108 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($6, $4, $1 + 108 | 0); + $8 = $0 + 144 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($8, $4, $1 + 144 | 0); + $10 = $0 + 180 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($10, $4, $1 + 180 | 0); + $12 = $0 + 216 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($12, $4, $1 + 216 | 0); + $14 = $0 + 252 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($14, $4, $1 + 252 | 0); + $16 = +__ZN6vision11SumSquares9IfEET_PKS1_($3); + HEAPF32[$2 >> 2] = $16; + $17 = +__ZN6vision11SumSquares9IfEET_PKS1_($6); + HEAPF32[$2 + 4 >> 2] = $17; + $19 = +__ZN6vision11SumSquares9IfEET_PKS1_($8); + HEAPF32[$2 + 8 >> 2] = $19; + $21 = +__ZN6vision11SumSquares9IfEET_PKS1_($10); + HEAPF32[$2 + 12 >> 2] = $21; + $23 = +__ZN6vision11SumSquares9IfEET_PKS1_($12); + HEAPF32[$2 + 16 >> 2] = $23; + $25 = +__ZN6vision11SumSquares9IfEET_PKS1_($14); + HEAPF32[$2 + 20 >> 2] = $25; + $27 = __ZN6vision9MaxIndex6IfEEiPKT_($2) | 0; + $28 = $2 + ($27 << 2) | 0; + if (+HEAPF32[$28 >> 2] == 0.0) $$0 = 0; else { + $31 = $27 * 9 | 0; + __ZN6vision5Swap9IfEEvPT_S2_($3, $3 + ($31 << 2) | 0); + __ZN6vision5Swap9IfEEvPT_S2_($5, $5 + ($31 << 2) | 0); + __ZN6vision12ScaleVector9IfEEvPT_PKS1_S1_($3, $3, 1.0 / +Math_sqrt(+(+HEAPF32[$28 >> 2]))); + $$0 = 1; + } + STACKTOP = sp; + return $$0 | 0; +} + +function _quantize_ord_dither($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$06067$us79 = 0, $$06173 = 0, $$06173$us = 0, $$06269$us77 = 0, $$06366$us80 = 0, $$06465$us81 = 0, $$068$us78 = 0, $11 = 0, $13 = 0, $14 = 0, $15 = 0, $17 = 0, $18 = 0, $24 = 0, $26 = 0, $5 = 0, $7 = 0, $9 = 0; + $5 = HEAP32[$0 + 484 >> 2] | 0; + $7 = HEAP32[$0 + 120 >> 2] | 0; + $9 = HEAP32[$0 + 112 >> 2] | 0; + if (($3 | 0) <= 0) return; + $11 = $5 + 48 | 0; + $13 = $5 + 24 | 0; + $14 = ($9 | 0) == 0; + if (($7 | 0) <= 0) { + $$06173 = 0; + do { + _memset(HEAP32[$2 + ($$06173 << 2) >> 2] | 0, 0, $9 | 0) | 0; + HEAP32[$11 >> 2] = (HEAP32[$11 >> 2] | 0) + 1 & 15; + $$06173 = $$06173 + 1 | 0; + } while (($$06173 | 0) != ($3 | 0)); + return; + } + $$06173$us = 0; + do { + $15 = $2 + ($$06173$us << 2) | 0; + _memset(HEAP32[$15 >> 2] | 0, 0, $9 | 0) | 0; + $17 = HEAP32[$11 >> 2] | 0; + $18 = $1 + ($$06173$us << 2) | 0; + if (!$14) { + $$06269$us77 = 0; + do { + $24 = HEAP32[(HEAP32[$13 >> 2] | 0) + ($$06269$us77 << 2) >> 2] | 0; + $26 = HEAP32[$5 + 52 + ($$06269$us77 << 2) >> 2] | 0; + $$06067$us79 = $9; + $$06366$us80 = HEAP32[$15 >> 2] | 0; + $$06465$us81 = 0; + $$068$us78 = (HEAP32[$18 >> 2] | 0) + $$06269$us77 | 0; + while (1) { + HEAP8[$$06366$us80 >> 0] = (HEAPU8[$$06366$us80 >> 0] | 0) + (HEAPU8[$24 + ((HEAP32[$26 + ($17 << 6) + ($$06465$us81 << 2) >> 2] | 0) + (HEAPU8[$$068$us78 >> 0] | 0)) >> 0] | 0); + $$06067$us79 = $$06067$us79 + -1 | 0; + if (!$$06067$us79) break; else { + $$06366$us80 = $$06366$us80 + 1 | 0; + $$06465$us81 = $$06465$us81 + 1 & 15; + $$068$us78 = $$068$us78 + $7 | 0; + } + } + $$06269$us77 = $$06269$us77 + 1 | 0; + } while (($$06269$us77 | 0) != ($7 | 0)); + } + HEAP32[$11 >> 2] = $17 + 1 & 15; + $$06173$us = $$06173$us + 1 | 0; + } while (($$06173$us | 0) != ($3 | 0)); + return; +} + +function ___fdopen($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $11 = 0, $12 = 0, $16 = 0, $2 = 0, $21 = 0, $26 = 0, $28 = 0, $7 = 0, $8 = 0, $vararg_buffer = 0, $vararg_buffer2 = 0, $vararg_buffer7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $vararg_buffer7 = sp + 24 | 0; + $vararg_buffer2 = sp + 8 | 0; + $vararg_buffer = sp; + $2 = sp + 40 | 0; + if (_strchr(50840, HEAP8[$1 >> 0] | 0) | 0) { + $8 = _malloc(1176) | 0; + if (!$8) $$0 = 0; else { + _memset($8 | 0, 0, 144) | 0; + $11 = (_strchr($1, 43) | 0) == 0; + $12 = HEAP8[$1 >> 0] | 0; + if ($11) HEAP32[$8 >> 2] = $12 << 24 >> 24 == 114 ? 8 : 4; + if ($12 << 24 >> 24 == 97) { + HEAP32[$vararg_buffer >> 2] = $0; + HEAP32[$vararg_buffer + 4 >> 2] = 3; + $16 = ___syscall221(221, $vararg_buffer | 0) | 0; + if (!($16 & 1024)) { + HEAP32[$vararg_buffer2 >> 2] = $0; + HEAP32[$vararg_buffer2 + 4 >> 2] = 4; + HEAP32[$vararg_buffer2 + 8 >> 2] = $16 | 1024; + ___syscall221(221, $vararg_buffer2 | 0) | 0; + } + $21 = HEAP32[$8 >> 2] | 128; + HEAP32[$8 >> 2] = $21; + $28 = $21; + } else $28 = HEAP32[$8 >> 2] | 0; + HEAP32[$8 + 60 >> 2] = $0; + HEAP32[$8 + 44 >> 2] = $8 + 152; + HEAP32[$8 + 48 >> 2] = 1024; + $26 = $8 + 75 | 0; + HEAP8[$26 >> 0] = -1; + if (($28 & 8 | 0) == 0 ? (HEAP32[$vararg_buffer7 >> 2] = $0, HEAP32[$vararg_buffer7 + 4 >> 2] = 21523, HEAP32[$vararg_buffer7 + 8 >> 2] = $2, (___syscall54(54, $vararg_buffer7 | 0) | 0) == 0) : 0) HEAP8[$26 >> 0] = 10; + HEAP32[$8 + 32 >> 2] = 2; + HEAP32[$8 + 36 >> 2] = 1; + HEAP32[$8 + 40 >> 2] = 1; + HEAP32[$8 + 12 >> 2] = 2; + if (!(HEAP32[16328] | 0)) HEAP32[$8 + 76 >> 2] = -1; + ___ofl_add($8) | 0; + $$0 = $8; + } + } else { + $7 = ___errno_location() | 0; + HEAP32[$7 >> 2] = 28; + $$0 = 0; + } + STACKTOP = sp; + return $$0 | 0; +} + +function _setMarkerInfoVertex($id, $markerIndex) { + $id = $id | 0; + $markerIndex = $markerIndex | 0; + var $1 = 0, $10 = 0.0, $11 = 0.0, $4 = 0.0, $5 = 0.0, $6 = 0.0, $7 = 0.0, $8 = 0.0, $9 = 0.0, $arhandle = 0, $id$addr = 0, $retval$1 = 0, $spec$select = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + do if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0) { + $arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0; + $1 = HEAP32[$arhandle >> 2] | 0; + if ((HEAP32[$1 + 44 >> 2] | 0) > ($markerIndex | 0)) { + $spec$select = ($markerIndex | 0) < 0 ? 64312 : $1 + 48 + ($markerIndex << 8) | 0; + $4 = +HEAPF64[7642]; + HEAPF64[$spec$select + 168 >> 3] = $4; + $5 = +HEAPF64[7643]; + HEAPF64[$spec$select + 176 >> 3] = $5; + $6 = +HEAPF64[7644]; + HEAPF64[$spec$select + 184 >> 3] = $6; + $7 = +HEAPF64[7645]; + HEAPF64[$spec$select + 192 >> 3] = $7; + $8 = +HEAPF64[7646]; + HEAPF64[$spec$select + 200 >> 3] = $8; + $9 = +HEAPF64[7647]; + HEAPF64[$spec$select + 208 >> 3] = $9; + $10 = +HEAPF64[7648]; + HEAPF64[$spec$select + 216 >> 3] = $10; + $11 = +HEAPF64[7649]; + HEAPF64[$spec$select + 224 >> 3] = $11; + HEAPF64[$spec$select + 56 >> 3] = ($4 + $6 + $8 + $10) * .25; + HEAPF64[$spec$select + 64 >> 3] = ($5 + $7 + $9 + $11) * .25; + $retval$1 = 0; + break; + } else { + $retval$1 = HEAP32[4226] | 0; + break; + } + } else $retval$1 = HEAP32[4224] | 0; while (0); + STACKTOP = sp; + return $retval$1 | 0; +} + +function _jinit_2pass_quantizer($0) { + $0 = $0 | 0; + var $$054 = 0, $1 = 0, $12 = 0, $17 = 0, $18 = 0, $22 = 0, $31 = 0, $33 = 0, $39 = 0, $4 = 0, $47 = 0, $51 = 0, $61 = 0, $7 = 0; + $1 = $0 + 4 | 0; + $4 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 44) | 0; + HEAP32[$0 + 484 >> 2] = $4; + HEAP32[$4 >> 2] = 134; + HEAP32[$4 + 12 >> 2] = 188; + $7 = $4 + 32 | 0; + HEAP32[$7 >> 2] = 0; + HEAP32[$4 + 40 >> 2] = 0; + if ((HEAP32[$0 + 120 >> 2] | 0) != 3) { + $12 = HEAP32[$0 >> 2] | 0; + HEAP32[$12 + 20 >> 2] = 48; + FUNCTION_TABLE_vi[HEAP32[$12 >> 2] & 255]($0); + } + $17 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 128) | 0; + $18 = $4 + 24 | 0; + HEAP32[$18 >> 2] = $17; + $$054 = 0; + do { + $22 = FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$1 >> 2] | 0) + 4 >> 2] & 63]($0, 1, 4096) | 0; + HEAP32[(HEAP32[$18 >> 2] | 0) + ($$054 << 2) >> 2] = $22; + $$054 = $$054 + 1 | 0; + } while (($$054 | 0) != 32); + HEAP32[$4 + 28 >> 2] = 1; + if (!(HEAP32[$0 + 108 >> 2] | 0)) HEAP32[$4 + 16 >> 2] = 0; else { + $31 = HEAP32[$0 + 96 >> 2] | 0; + if (($31 | 0) >= 8) { + if (($31 | 0) > 256) { + $39 = HEAP32[$0 >> 2] | 0; + HEAP32[$39 + 20 >> 2] = 59; + HEAP32[$39 + 24 >> 2] = 256; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + } else { + $33 = HEAP32[$0 >> 2] | 0; + HEAP32[$33 + 20 >> 2] = 58; + HEAP32[$33 + 24 >> 2] = 8; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $47 = FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$1 >> 2] | 0) + 8 >> 2] & 15]($0, 1, $31, 3) | 0; + HEAP32[$4 + 16 >> 2] = $47; + HEAP32[$4 + 20 >> 2] = $31; + } + $51 = $0 + 88 | 0; + if (!(HEAP32[$51 >> 2] | 0)) return; + HEAP32[$51 >> 2] = 2; + $61 = FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$1 >> 2] | 0) + 4 >> 2] & 63]($0, 1, ((HEAP32[$0 + 112 >> 2] | 0) * 6 | 0) + 12 | 0) | 0; + HEAP32[$7 >> 2] = $61; + _init_error_limit($0); + return; +} + +function ___stdio_write($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$048 = 0, $$049 = 0, $$050 = 0, $$052 = 0, $$153 = 0, $$156$ph = 0, $10 = 0, $14 = 0, $20 = 0, $22 = 0, $27 = 0, $3 = 0, $38 = 0, $39 = 0, $4 = 0, $45 = 0, $5 = 0, $6 = 0, $8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $3 = sp; + $4 = sp + 16 | 0; + $5 = $0 + 28 | 0; + $6 = HEAP32[$5 >> 2] | 0; + HEAP32[$3 >> 2] = $6; + $8 = $0 + 20 | 0; + $10 = (HEAP32[$8 >> 2] | 0) - $6 | 0; + HEAP32[$3 + 4 >> 2] = $10; + HEAP32[$3 + 8 >> 2] = $1; + HEAP32[$3 + 12 >> 2] = $2; + $14 = $0 + 60 | 0; + $$049 = 2; + $$050 = $10 + $2 | 0; + $$052 = $3; + while (1) { + if (!(___wasi_syscall_ret(___wasi_fd_write(HEAP32[$14 >> 2] | 0, $$052 | 0, $$049 | 0, $4 | 0) | 0) | 0)) $20 = HEAP32[$4 >> 2] | 0; else { + HEAP32[$4 >> 2] = -1; + $20 = -1; + } + if (($$050 | 0) == ($20 | 0)) { + label = 6; + break; + } + if (($20 | 0) < 0) { + label = 8; + break; + } + $38 = HEAP32[$$052 + 4 >> 2] | 0; + $39 = $20 >>> 0 > $38 >>> 0; + $$153 = $39 ? $$052 + 8 | 0 : $$052; + $$048 = $20 - ($39 ? $38 : 0) | 0; + HEAP32[$$153 >> 2] = (HEAP32[$$153 >> 2] | 0) + $$048; + $45 = $$153 + 4 | 0; + HEAP32[$45 >> 2] = (HEAP32[$45 >> 2] | 0) - $$048; + $$049 = $$049 + ($39 << 31 >> 31) | 0; + $$050 = $$050 - $20 | 0; + $$052 = $$153; + } + if ((label | 0) == 6) { + $22 = HEAP32[$0 + 44 >> 2] | 0; + HEAP32[$0 + 16 >> 2] = $22 + (HEAP32[$0 + 48 >> 2] | 0); + $27 = $22; + HEAP32[$5 >> 2] = $27; + HEAP32[$8 >> 2] = $27; + $$156$ph = $2; + } else if ((label | 0) == 8) { + HEAP32[$0 + 16 >> 2] = 0; + HEAP32[$5 >> 2] = 0; + HEAP32[$8 >> 2] = 0; + HEAP32[$0 >> 2] = HEAP32[$0 >> 2] | 32; + if (($$049 | 0) == 2) $$156$ph = 0; else $$156$ph = $2 - (HEAP32[$$052 + 4 >> 2] | 0) | 0; + } + STACKTOP = sp; + return $$156$ph | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EEaSEOS4_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $12 = 0, $14 = 0, $2 = 0, $23 = 0, $25 = 0, $26 = 0, $27 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $5 = 0, $9 = 0; + $2 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE8isInlineEv($1) | 0; + $3 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE8isInlineEv($0) | 0; + do if (!$2) if ($3) { + HEAP32[$0 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$0 + 4 >> 2] = HEAP32[$1 + 4 >> 2]; + HEAP32[$0 + 8 >> 2] = HEAP32[$1 + 8 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE11clearInlineEv($1); + break; + } else { + $23 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$1 >> 2] = $23; + $25 = $0 + 4 | 0; + $26 = $1 + 4 | 0; + $27 = HEAP32[$25 >> 2] | 0; + HEAP32[$25 >> 2] = HEAP32[$26 >> 2]; + HEAP32[$26 >> 2] = $27; + $29 = $0 + 8 | 0; + $30 = $1 + 8 | 0; + $31 = HEAP32[$29 >> 2] | 0; + HEAP32[$29 >> 2] = HEAP32[$30 >> 2]; + HEAP32[$30 >> 2] = $31; + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE5clearEv($1); + break; + } else { + if (!$3) { + _free(HEAP32[$0 >> 2] | 0); + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE11clearInlineEv($0); + } + $5 = __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE5beginEv($1) | 0; + $9 = (__ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE3endEv($1) | 0) - $5 | 0; + if ($9 | 0) _memmove(HEAP32[$0 >> 2] | 0, $5 | 0, $9 | 0) | 0; + $12 = HEAP32[$0 >> 2] | 0; + $14 = $12 + ((__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE4sizeEv($1) | 0) << 2) | 0; + HEAP32[$0 + 4 >> 2] = $14; + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE5clearEv($1); + } while (0); + return; +} + +function _ar2ScreenCoord2MarkerCoord($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = +$2; + $3 = +$3; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$055 = 0.0, $$056 = 0.0, $$057 = 0.0, $$058 = 0.0, $$059 = 0.0, $$sink = 0.0, $$sink60 = 0.0, $11 = 0.0, $16 = 0.0, $32 = 0.0, $43 = 0.0, $44 = 0.0, $49 = 0.0, $54 = 0.0, $6 = 0, $66 = 0.0, $7 = 0, $72 = 0.0, $75 = 0.0, $8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $6 = sp + 52 | 0; + $7 = sp + 48 | 0; + $8 = sp; + if ($0) if ((_arParamObserv2IdealLTf($0 + 184 | 0, $2, $3, $6, $7) | 0) < 0) $$0 = -1; else { + _arUtilMatMuldff($0 + 8 | 0, $1, $8) | 0; + $43 = +HEAPF32[$8 + 32 >> 2]; + $44 = +HEAPF32[$6 >> 2]; + $49 = +HEAPF32[$8 + 36 >> 2]; + $54 = +HEAPF32[$7 >> 2]; + $66 = +HEAPF32[$8 + 44 >> 2]; + $$055 = +HEAPF32[$8 + 12 >> 2] - $44 * $66; + $$056 = $49 * $54 - +HEAPF32[$8 + 20 >> 2]; + $$057 = $43 * $54 - +HEAPF32[$8 + 16 >> 2]; + $$058 = $44 * $49 - +HEAPF32[$8 + 4 >> 2]; + $$059 = $43 * $44 - +HEAPF32[$8 >> 2]; + $$sink = +HEAPF32[$8 + 28 >> 2]; + $$sink60 = $54 * $66; + label = 5; + } else { + $11 = +HEAPF32[$1 + 32 >> 2]; + $16 = +HEAPF32[$1 + 36 >> 2]; + $32 = +HEAPF32[$1 + 44 >> 2]; + $$055 = +HEAPF32[$1 + 12 >> 2] - $32 * $2; + $$056 = $16 * $3 - +HEAPF32[$1 + 20 >> 2]; + $$057 = $11 * $3 - +HEAPF32[$1 + 16 >> 2]; + $$058 = $16 * $2 - +HEAPF32[$1 + 4 >> 2]; + $$059 = $11 * $2 - +HEAPF32[$1 >> 2]; + $$sink = +HEAPF32[$1 + 28 >> 2]; + $$sink60 = $32 * $3; + label = 5; + } + if ((label | 0) == 5) { + $72 = $$sink - $$sink60; + $75 = $$059 * $$056 - $$058 * $$057; + if ($75 == 0.0) $$0 = -1; else { + HEAPF32[$4 >> 2] = ($$056 * $$055 - $$058 * $72) / $75; + HEAPF32[$5 >> 2] = ($$059 * $72 - $$057 * $$055) / $75; + $$0 = 0; + } + } + STACKTOP = sp; + return $$0 | 0; +} + +function ___vfprintf_internal($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$1 = 0, $15 = 0, $16 = 0, $21 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $30 = 0, $31 = 0, $37 = 0, $42 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $spec$select = 0, dest = 0, sp = 0, stop = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 224 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(224); + $5 = sp + 208 | 0; + $6 = sp + 160 | 0; + $7 = sp + 80 | 0; + $8 = sp; + dest = $6; + stop = dest + 40 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$5 >> 2] = HEAP32[$2 >> 2]; + if ((_printf_core(0, $1, $5, $7, $6, $3, $4) | 0) < 0) $$0 = -1; else { + if ((HEAP32[$0 + 76 >> 2] | 0) > -1) $42 = ___lockfile($0) | 0; else $42 = 0; + $15 = HEAP32[$0 >> 2] | 0; + $16 = $15 & 32; + if ((HEAP8[$0 + 74 >> 0] | 0) < 1) HEAP32[$0 >> 2] = $15 & -33; + $21 = $0 + 48 | 0; + if (!(HEAP32[$21 >> 2] | 0)) { + $25 = $0 + 44 | 0; + $26 = HEAP32[$25 >> 2] | 0; + HEAP32[$25 >> 2] = $8; + $27 = $0 + 28 | 0; + HEAP32[$27 >> 2] = $8; + $28 = $0 + 20 | 0; + HEAP32[$28 >> 2] = $8; + HEAP32[$21 >> 2] = 80; + $30 = $0 + 16 | 0; + HEAP32[$30 >> 2] = $8 + 80; + $31 = _printf_core($0, $1, $5, $7, $6, $3, $4) | 0; + if (!$26) $$1 = $31; else { + FUNCTION_TABLE_iiii[HEAP32[$0 + 36 >> 2] & 63]($0, 0, 0) | 0; + $spec$select = (HEAP32[$28 >> 2] | 0) == 0 ? -1 : $31; + HEAP32[$25 >> 2] = $26; + HEAP32[$21 >> 2] = 0; + HEAP32[$30 >> 2] = 0; + HEAP32[$27 >> 2] = 0; + HEAP32[$28 >> 2] = 0; + $$1 = $spec$select; + } + } else $$1 = _printf_core($0, $1, $5, $7, $6, $3, $4) | 0; + $37 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $37 | $16; + if ($42 | 0) ___unlockfile($0); + $$0 = ($37 & 32 | 0) == 0 ? $$1 : -1; + } + STACKTOP = sp; + return $$0 | 0; +} + +function _setupAR2($id) { + $id = $id | 0; + var $2 = 0, $ar2Handle = 0, $call23 = 0, $call7 = 0, $call8 = 0, $id$addr = 0, $kpmHandle = 0, $kpmHandle24$pre$phiZ2D = 0, $paramLT = 0, $retval$0 = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $id$addr = sp + 4 | 0; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$0 = -1; else { + $call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0; + $paramLT = $call7 + 192 | 0; + $call8 = _ar2CreateHandleMod(HEAP32[$paramLT >> 2] | 0, HEAP32[$call7 + 472 >> 2] | 0) | 0; + $ar2Handle = $call7 + 236 | 0; + HEAP32[$ar2Handle >> 2] = $call8; + if (!$call8) { + _arLog(0, 3, 45395, $vararg_buffer); + $kpmHandle = $call7 + 232 | 0; + _kpmDeleteHandle($kpmHandle) | 0; + $2 = HEAP32[$ar2Handle >> 2] | 0; + $kpmHandle24$pre$phiZ2D = $kpmHandle; + } else { + $2 = $call8; + $kpmHandle24$pre$phiZ2D = $call7 + 232 | 0; + } + _ar2SetTrackingThresh($2, 5.0) | 0; + _ar2SetSimThresh(HEAP32[$ar2Handle >> 2] | 0, .5) | 0; + _ar2SetSearchFeatureNum(HEAP32[$ar2Handle >> 2] | 0, 16) | 0; + _ar2SetSearchSize(HEAP32[$ar2Handle >> 2] | 0, 6) | 0; + _ar2SetTemplateSize1(HEAP32[$ar2Handle >> 2] | 0, 6) | 0; + _ar2SetTemplateSize2(HEAP32[$ar2Handle >> 2] | 0, 6) | 0; + $call23 = _createKpmHandle(HEAP32[$paramLT >> 2] | 0) | 0; + HEAP32[$kpmHandle24$pre$phiZ2D >> 2] = $call23; + $retval$0 = 0; + } + STACKTOP = sp; + return $retval$0 | 0; +} + +function __ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$sroa$0$2 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $16 = 0, $17 = 0, $35 = 0, $6 = 0, $7 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $6 = sp; + $7 = HEAP32[$0 >> 2] | 0; + L1 : do if (!$7) $$sroa$0$2 = 0; else { + $9 = $3; + $10 = $1; + $11 = $9 - $10 | 0; + $12 = $4 + 12 | 0; + $13 = HEAP32[$12 >> 2] | 0; + $$0 = ($13 | 0) > ($11 | 0) ? $13 - $11 | 0 : 0; + $16 = $2; + $17 = $16 - $10 | 0; + if (($17 | 0) > 0 ? (FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$7 >> 2] | 0) + 48 >> 2] & 63]($7, $1, $17) | 0) != ($17 | 0) : 0) { + HEAP32[$0 >> 2] = 0; + $$sroa$0$2 = 0; + break; + } + do if (($$0 | 0) > 0) { + HEAP32[$6 >> 2] = 0; + HEAP32[$6 + 4 >> 2] = 0; + HEAP32[$6 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc($6, $$0, $5); + if ((FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$7 >> 2] | 0) + 48 >> 2] & 63]($7, (HEAP8[$6 + 11 >> 0] | 0) < 0 ? HEAP32[$6 >> 2] | 0 : $6, $$0) | 0) == ($$0 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($6); + break; + } else { + HEAP32[$0 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($6); + $$sroa$0$2 = 0; + break L1; + } + } while (0); + $35 = $9 - $16 | 0; + if (($35 | 0) > 0 ? (FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$7 >> 2] | 0) + 48 >> 2] & 63]($7, $2, $35) | 0) != ($35 | 0) : 0) { + HEAP32[$0 >> 2] = 0; + $$sroa$0$2 = 0; + break; + } + HEAP32[$12 >> 2] = 0; + $$sroa$0$2 = $7; + } while (0); + STACKTOP = sp; + return $$sroa$0$2 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseCallOffsetEv($0) { + $0 = $0 | 0; + var $$03 = 0, $$ph = 0, $1 = 0, $13 = 0, $14 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp + 8 | 0; + $2 = sp; + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 104) | 0)) if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 118) | 0) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E11parseNumberEb($1, $0, 1); + if (!(__ZNK12_GLOBAL__N_110StringView5emptyEv($1) | 0) ? __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0 : 0) { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E11parseNumberEb($2, $0, 1); + if (__ZNK12_GLOBAL__N_110StringView5emptyEv($2) | 0) $$ph = 1; else $$ph = (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) ^ 1; + $14 = $$ph; + } else $14 = 1; + $$03 = $14; + } else $$03 = 1; else { + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E11parseNumberEb($1, $0, 1); + if (__ZNK12_GLOBAL__N_110StringView5emptyEv($1) | 0) $13 = 1; else $13 = (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 95) | 0) ^ 1; + $$03 = $13; + } + STACKTOP = sp; + return $$03 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseUnresolvedTypeEv($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$2 = 0, $1 = 0, $4 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + switch ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24) { + case 84: + { + $4 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E18parseTemplateParamEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $4; + if (!$4) $$0 = 0; else { + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($0 + 148 | 0, $1); + $$0 = $4; + } + $$2 = $$0; + break; + } + case 68: + { + $8 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseDecltypeEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $8; + if (!$8) $$1 = 0; else { + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($0 + 148 | 0, $1); + $$1 = $8; + } + $$2 = $$1; + break; + } + default: + $$2 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseSubstitutionEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + } + STACKTOP = sp; + return $$2 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIfE9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0, $$0$idx = 0, $$034 = 0, $$07$i$i = 0, $$byval_copy = 0, $15 = 0, $18 = 0, $2 = 0, $24 = 0, $26 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $scevgep = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy = sp + 24 | 0; + $2 = sp + 40 | 0; + $3 = sp; + $4 = sp + 32 | 0; + $5 = $0 + 8 | 0; + $6 = __ZNK12_GLOBAL__N_110StringView5beginEv($5) | 0; + if (((__ZNK12_GLOBAL__N_110StringView3endEv($5) | 0) + 1 - $6 | 0) >>> 0 > 8) { + $scevgep = $2 + 4 | 0; + $$0$idx = 0; + $$034 = $2; + while (1) { + if (($$0$idx | 0) == 8) break; + $15 = HEAP8[$6 + $$0$idx >> 0] | 0; + $18 = HEAP8[$6 + ($$0$idx | 1) >> 0] | 0; + HEAP8[$$034 >> 0] = (($18 + -48 | 0) >>> 0 < 10 ? 208 : 169) + $18 + ((($15 + -48 | 0) >>> 0 < 10 ? 0 : 9) + $15 << 4); + $$0$idx = $$0$idx + 2 | 0; + $$034 = $$034 + 1 | 0; + } + $$0$i$i = $scevgep; + $$07$i$i = $2; + while (1) { + $24 = $$0$i$i + -1 | 0; + if ($$07$i$i >>> 0 >= $24 >>> 0) break; + $26 = HEAP8[$$07$i$i >> 0] | 0; + HEAP8[$$07$i$i >> 0] = HEAP8[$24 >> 0] | 0; + HEAP8[$24 >> 0] = $26; + $$0$i$i = $24; + $$07$i$i = $$07$i$i + 1 | 0; + } + HEAP32[$3 >> 2] = 0; + HEAP32[$3 + 4 >> 2] = 0; + HEAP32[$3 + 8 >> 2] = 0; + HEAP32[$3 + 12 >> 2] = 0; + HEAP32[$3 + 16 >> 2] = 0; + HEAP32[$3 + 20 >> 2] = 0; + HEAPF64[$$byval_copy >> 3] = +HEAPF32[$2 >> 2]; + __ZN12_GLOBAL__N_110StringViewC2EPKcS2_($4, $3, $3 + (_snprintf($3, 24, 52451, $$byval_copy) | 0) | 0); + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + } + STACKTOP = sp; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIeE9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0, $$0$idx = 0, $$034 = 0, $$07$i$i = 0, $$byval_copy = 0, $15 = 0, $18 = 0, $2 = 0, $24 = 0, $26 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $scevgep = 0, dest = 0, sp = 0, stop = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $$byval_copy = sp + 48 | 0; + $2 = sp + 40 | 0; + $3 = sp; + $4 = sp + 56 | 0; + $5 = $0 + 8 | 0; + $6 = __ZNK12_GLOBAL__N_110StringView5beginEv($5) | 0; + if (((__ZNK12_GLOBAL__N_110StringView3endEv($5) | 0) + 1 - $6 | 0) >>> 0 > 20) { + $scevgep = $2 + 8 | 0; + $$0$idx = 0; + $$034 = $2; + while (1) { + if (($$0$idx | 0) == 20) break; + $15 = HEAP8[$6 + $$0$idx >> 0] | 0; + $18 = HEAP8[$6 + ($$0$idx | 1) >> 0] | 0; + HEAP8[$$034 >> 0] = (($18 + -48 | 0) >>> 0 < 10 ? 208 : 169) + $18 + ((($15 + -48 | 0) >>> 0 < 10 ? 0 : 9) + $15 << 4); + $$0$idx = $$0$idx + 2 | 0; + $$034 = $$034 + 1 | 0; + } + $$0$i$i = $scevgep + 2 | 0; + $$07$i$i = $2; + while (1) { + $24 = $$0$i$i + -1 | 0; + if ($$07$i$i >>> 0 >= $24 >>> 0) break; + $26 = HEAP8[$$07$i$i >> 0] | 0; + HEAP8[$$07$i$i >> 0] = HEAP8[$24 >> 0] | 0; + HEAP8[$24 >> 0] = $26; + $$0$i$i = $24; + $$07$i$i = $$07$i$i + 1 | 0; + } + dest = $3; + stop = dest + 40 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAPF64[$$byval_copy >> 3] = +HEAPF64[$2 >> 3]; + __ZN12_GLOBAL__N_110StringViewC2EPKcS2_($4, $3, $3 + (_snprintf($3, 40, 52331, $$byval_copy) | 0) | 0); + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + } + STACKTOP = sp; + return; +} + +function __ZNSt3__2L11init_wweeksEv() { + var $$0$i$i = 0, $4 = 0; + if ((HEAP8[64736] | 0) == 0 ? ___cxa_guard_acquire(64736) | 0 : 0) { + $4 = 64128; + do { + HEAP32[$4 >> 2] = 0; + HEAP32[$4 + 4 >> 2] = 0; + HEAP32[$4 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$4 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $4 = $4 + 12 | 0; + } while (($4 | 0) != 64296); + ___cxa_guard_release(64736); + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64128, 22348) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64140, 22376) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64152, 22404) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64164, 22436) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64176, 22476) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64188, 22512) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64200, 22540) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64212, 22576) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64224, 22592) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64236, 22608) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64248, 22624) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64260, 22640) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64272, 22656) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(64284, 22672) | 0; + return; +} + +function __ZNSt3__2L10init_weeksEv() { + var $$0$i$i = 0, $4 = 0; + if ((HEAP8[64656] | 0) == 0 ? ___cxa_guard_acquire(64656) | 0 : 0) { + $4 = 63632; + do { + HEAP32[$4 >> 2] = 0; + HEAP32[$4 + 4 >> 2] = 0; + HEAP32[$4 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$4 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $4 = $4 + 12 | 0; + } while (($4 | 0) != 63800); + ___cxa_guard_release(64656); + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63632, 59589) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63644, 59596) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63656, 59603) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63668, 59611) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63680, 59621) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63692, 59630) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63704, 59637) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63716, 59646) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63728, 59650) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63740, 59654) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63752, 59658) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63764, 59662) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63776, 59666) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63788, 59670) | 0; + return; +} + +function _arParamLTCreate($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$057 = 0, $$058 = 0, $$059 = 0, $$1 = 0, $$160 = 0, $10 = 0, $15 = 0, $2 = 0, $20 = 0, $21 = 0, $23 = 0, $26 = 0, $28 = 0, $3 = 0, $32 = 0.0, $36 = 0.0, $4 = 0, $5 = 0, $6 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $2 = sp + 24 | 0; + $3 = sp + 16 | 0; + $4 = sp + 8 | 0; + $5 = sp; + $6 = _malloc(208) | 0; + if (!$6) { + _arLog(0, 3, 45930, sp + 32 | 0); + _exit(1); + } + _memcpy($6 | 0, $0 | 0, 184) | 0; + $9 = $1 << 1; + $10 = (HEAP32[$0 >> 2] | 0) + $9 | 0; + HEAP32[$6 + 192 >> 2] = $10; + $15 = (HEAP32[$0 + 4 >> 2] | 0) + $9 | 0; + HEAP32[$6 + 196 >> 2] = $15; + HEAP32[$6 + 200 >> 2] = $1; + HEAP32[$6 + 204 >> 2] = $1; + $20 = Math_imul($10 << 3, $15) | 0; + $21 = _malloc($20) | 0; + HEAP32[$6 + 184 >> 2] = $21; + if (!$21) { + _arLog(0, 3, 45930, sp + 40 | 0); + _exit(1); + } + $23 = _malloc($20) | 0; + HEAP32[$6 + 188 >> 2] = $23; + if (!$23) { + _arLog(0, 3, 45930, sp + 48 | 0); + _exit(1); + } + $26 = $0 + 104 | 0; + $28 = HEAP32[$0 + 176 >> 2] | 0; + $$0 = 0; + $$058 = $23; + $$059 = $21; + while (1) { + if (($$0 | 0) >= ($15 | 0)) break; + $32 = +($$0 - $1 | 0); + $$057 = 0; + $$1 = $$058; + $$160 = $$059; + while (1) { + if (($$057 | 0) >= ($10 | 0)) break; + $36 = +($$057 - $1 | 0); + _arParamIdeal2Observ($26, $36, $32, $4, $5, $28) | 0; + HEAPF32[$$160 >> 2] = +HEAPF64[$4 >> 3]; + HEAPF32[$$160 + 4 >> 2] = +HEAPF64[$5 >> 3]; + _arParamObserv2Ideal($26, $36, $32, $2, $3, $28) | 0; + HEAPF32[$$1 >> 2] = +HEAPF64[$2 >> 3]; + HEAPF32[$$1 + 4 >> 2] = +HEAPF64[$3 >> 3]; + $$057 = $$057 + 1 | 0; + $$1 = $$1 + 8 | 0; + $$160 = $$160 + 8 | 0; + } + $$0 = $$0 + 1 | 0; + $$058 = $$1; + $$059 = $$160; + } + STACKTOP = sp; + return $6 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle22ParameterPackExpansion9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$byval_copy1 = 0, $11 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $$byval_copy1 = sp + 48 | 0; + $2 = sp + 32 | 0; + $3 = sp + 8 | 0; + $4 = sp + 24 | 0; + $5 = sp; + $6 = $1 + 12 | 0; + __ZN12_GLOBAL__N_114SwapAndRestoreIjEC2ERjj($2, $6); + $7 = $1 + 16 | 0; + __ZN12_GLOBAL__N_114SwapAndRestoreIjEC2ERjj($3, $7); + $8 = __ZNK12_GLOBAL__N_112OutputStream18getCurrentPositionEv($1) | 0; + $9 = $0 + 8 | 0; + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$9 >> 2] | 0, $1); + $11 = HEAP32[$7 >> 2] | 0; + L1 : do switch ($11 | 0) { + case -1: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 51510); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + break; + } + case 0: + { + __ZN12_GLOBAL__N_112OutputStream18setCurrentPositionEm($1, $8); + break; + } + default: + { + $$0 = 1; + while (1) { + if ($$0 >>> 0 >= $11 >>> 0) break L1; + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 52152); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + HEAP32[$6 >> 2] = $$0; + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$9 >> 2] | 0, $1); + $$0 = $$0 + 1 | 0; + } + } + } while (0); + __ZN12_GLOBAL__N_114SwapAndRestoreIjED2Ev($3); + __ZN12_GLOBAL__N_114SwapAndRestoreIjED2Ev($2); + STACKTOP = sp; + return; +} + +function _mbtowc($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $13 = 0, $17 = 0, $21 = 0, $23 = 0, $25 = 0, $3 = 0, $33 = 0, $34 = 0, $42 = 0, $47 = 0, $50 = 0, $55 = 0, $59 = 0, $7 = 0, $spec$select = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + L1 : do if (!$1) $$0 = 0; else { + do if ($2 | 0) { + $spec$select = ($0 | 0) == 0 ? $3 : $0; + $7 = HEAP8[$1 >> 0] | 0; + if ($7 << 24 >> 24 > -1) { + HEAP32[$spec$select >> 2] = $7 & 255; + $$0 = $7 << 24 >> 24 != 0 & 1; + break L1; + } + $13 = (___pthread_self_420() | 0) + 188 | 0; + $17 = HEAP8[$1 >> 0] | 0; + if (!(HEAP32[HEAP32[$13 >> 2] >> 2] | 0)) { + HEAP32[$spec$select >> 2] = $17 << 24 >> 24 & 57343; + $$0 = 1; + break L1; + } + $21 = ($17 & 255) + -194 | 0; + if ($21 >>> 0 <= 50) { + $23 = $1 + 1 | 0; + $25 = HEAP32[5728 + ($21 << 2) >> 2] | 0; + if ($2 >>> 0 < 4 ? $25 & -2147483648 >>> (($2 * 6 | 0) + -6 | 0) | 0 : 0) break; + $33 = HEAPU8[$23 >> 0] | 0; + $34 = $33 >>> 3; + if (($34 + -16 | $34 + ($25 >> 26)) >>> 0 <= 7) { + $42 = $33 + -128 | $25 << 6; + if (($42 | 0) >= 0) { + HEAP32[$spec$select >> 2] = $42; + $$0 = 2; + break L1; + } + $47 = (HEAPU8[$1 + 2 >> 0] | 0) + -128 | 0; + if ($47 >>> 0 <= 63) { + $50 = $47 | $42 << 6; + if (($50 | 0) >= 0) { + HEAP32[$spec$select >> 2] = $50; + $$0 = 3; + break L1; + } + $55 = (HEAPU8[$1 + 3 >> 0] | 0) + -128 | 0; + if ($55 >>> 0 <= 63) { + HEAP32[$spec$select >> 2] = $55 | $50 << 6; + $$0 = 4; + break L1; + } + } + } + } + } while (0); + $59 = ___errno_location() | 0; + HEAP32[$59 >> 2] = 25; + $$0 = -1; + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function _teardown($id) { + $id = $id | 0; + var $0 = 0, $3 = 0, $__end_$i = 0, $call7 = 0, $i$0 = 0, $id$addr = 0, $multi_markers = 0, $retval$0 = 0, $videoFrame = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$0 = -1; else { + $call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0; + $videoFrame = $call7 + 196 | 0; + $0 = HEAP32[$videoFrame >> 2] | 0; + if ($0 | 0) { + _free($0); + HEAP32[$videoFrame >> 2] = 0; + HEAP32[$call7 + 200 >> 2] = 0; + } + _deleteHandle($call7); + _arPattDeleteHandle(HEAP32[$call7 + 220 >> 2] | 0) | 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE14__erase_uniqueIiEEmRKT_(65260, $id$addr) | 0; + $multi_markers = $call7 + 328 | 0; + $__end_$i = $call7 + 332 | 0; + $i$0 = 0; + while (1) { + $3 = HEAP32[$multi_markers >> 2] | 0; + if ($i$0 >>> 0 >= (HEAP32[$__end_$i >> 2] | 0) - $3 >> 3 >>> 0) break; + _arMultiFreeConfig(HEAP32[$3 + ($i$0 << 3) + 4 >> 2] | 0) | 0; + $i$0 = $i$0 + 1 | 0; + } + __ZNSt3__213__vector_baseI12multi_markerNS_9allocatorIS1_EEED2Ev($multi_markers); + __ZdlPv($multi_markers); + __ZN12arControllerD2Ev($call7); + __ZdlPv($call7); + $retval$0 = 0; + } + STACKTOP = sp; + return $retval$0 | 0; +} + +function __ZNK6vision21HoughSimilarityVoting14getBinDistanceERfS1_S1_S1_ffffffff($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = +$5; + $6 = +$6; + $7 = +$7; + $8 = +$8; + $9 = +$9; + $10 = +$10; + $11 = +$11; + $12 = +$12; + var $13 = 0, $15 = 0.0, $17 = 0.0, $19 = 0.0, $21 = 0.0, $26 = 0.0, $33 = 0, $38 = 0, $42 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $13 = sp; + $15 = +Math_abs(+($5 - $9)); + HEAPF32[$1 >> 2] = $15; + $17 = +Math_abs(+($6 - $10)); + HEAPF32[$2 >> 2] = $17; + $19 = +Math_abs(+($8 - $12)); + HEAPF32[$4 >> 2] = $19; + $21 = +Math_abs(+($7 - $11)); + $26 = +__ZN6vision4min2IfEET_S1_S1_($21, +(HEAP32[$0 + 60 >> 2] | 0) - $21); + HEAPF32[$3 >> 2] = $26; + if (!($26 >= 0.0)) { + $33 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 36007) | 0, 36227) | 0, 39072) | 0, 333) | 0, 39079) | 0, 36048) | 0; + __ZNKSt3__28ios_base6getlocEv($13, $33 + (HEAP32[(HEAP32[$33 >> 2] | 0) + -12 >> 2] | 0) | 0); + $38 = __ZNKSt3__26locale9use_facetERNS0_2idE($13, 66512) | 0; + $42 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$38 >> 2] | 0) + 28 >> 2] & 127]($38, 10) | 0; + __ZNSt3__26localeD2Ev($13); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($33, $42) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($33) | 0; + _abort(); + } else { + STACKTOP = sp; + return; + } +} + +function __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $10 = 0, $14 = 0, $16 = 0, $17 = 0, $18 = 0, $2 = 0, $21 = 0, $25 = 0, $26 = 0, $28 = 0, $3 = 0, $31 = 0, $37 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 12 | 0; + $2 = sp + 8 | 0; + $3 = sp; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_($3, $0); + if (HEAP8[$3 >> 0] | 0) { + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) | 0); + $10 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66568) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + $14 = $0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) | 0; + $16 = HEAP32[$14 + 24 >> 2] | 0; + $17 = __ZNSt3__211char_traitsIcE3eofEv() | 0; + $18 = $14 + 76 | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($17, HEAP32[$18 >> 2] | 0) | 0) { + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $14); + $21 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66512) | 0; + $25 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$21 >> 2] | 0) + 28 >> 2] & 127]($21, 32) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + $26 = $25 << 24 >> 24; + HEAP32[$18 >> 2] = $26; + $28 = $26; + } else $28 = HEAP32[$18 >> 2] | 0; + $31 = HEAP32[(HEAP32[$10 >> 2] | 0) + 16 >> 2] | 0; + HEAP32[$2 >> 2] = $16; + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + if (!(FUNCTION_TABLE_iiiiii[$31 & 31]($10, $$byval_copy, $14, $28 & 255, $1) | 0)) { + $37 = $0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) | 0; + __ZNSt3__28ios_base5clearEj($37, HEAP32[$37 + 16 >> 2] | 5); + } + } + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev($3); + STACKTOP = sp; + return $0 | 0; +} + +function _sep_upsample($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$05154 = 0, $$05253 = 0, $$1 = 0, $$pre = 0, $10 = 0, $11 = 0, $12 = 0, $14 = 0, $27 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $39 = 0, $40 = 0, $53 = 0, $8 = 0, $9 = 0, $spec$select = 0; + $8 = HEAP32[$0 + 476 >> 2] | 0; + $9 = $8 + 92 | 0; + $10 = HEAP32[$9 >> 2] | 0; + $11 = $0 + 320 | 0; + $12 = HEAP32[$11 >> 2] | 0; + if (($10 | 0) < ($12 | 0)) { + $34 = $10; + $35 = $12; + } else { + $14 = $0 + 36 | 0; + if ((HEAP32[$14 >> 2] | 0) > 0) { + $$05154 = HEAP32[$0 + 216 >> 2] | 0; + $$05253 = 0; + while (1) { + $27 = (HEAP32[$1 + ($$05253 << 2) >> 2] | 0) + ((Math_imul(HEAP32[$8 + 100 + ($$05253 << 2) >> 2] | 0, HEAP32[$2 >> 2] | 0) | 0) << 2) | 0; + FUNCTION_TABLE_viiii[HEAP32[$8 + 52 + ($$05253 << 2) >> 2] & 31]($0, $$05154, $27, $8 + 12 + ($$05253 << 2) | 0); + $$05253 = $$05253 + 1 | 0; + if (($$05253 | 0) >= (HEAP32[$14 >> 2] | 0)) break; else $$05154 = $$05154 + 88 | 0; + } + $$pre = HEAP32[$11 >> 2] | 0; + } else $$pre = $12; + HEAP32[$9 >> 2] = 0; + $34 = 0; + $35 = $$pre; + } + $33 = $35 - $34 | 0; + $36 = $8 + 96 | 0; + $37 = HEAP32[$36 >> 2] | 0; + $spec$select = $33 >>> 0 > $37 >>> 0 ? $37 : $33; + $39 = HEAP32[$5 >> 2] | 0; + $40 = $6 - $39 | 0; + $$1 = $spec$select >>> 0 > $40 >>> 0 ? $40 : $spec$select; + FUNCTION_TABLE_viiiii[HEAP32[(HEAP32[$0 + 480 >> 2] | 0) + 4 >> 2] & 63]($0, $8 + 12 | 0, $34, $4 + ($39 << 2) | 0, $$1); + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + $$1; + HEAP32[$36 >> 2] = (HEAP32[$36 >> 2] | 0) - $$1; + $53 = (HEAP32[$9 >> 2] | 0) + $$1 | 0; + HEAP32[$9 >> 2] = $53; + if (($53 | 0) < (HEAP32[$11 >> 2] | 0)) return; + HEAP32[$2 >> 2] = (HEAP32[$2 >> 2] | 0) + 1; + return; +} + +function __ZNSt3__224__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $14 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $22 = 0, $26 = 0, $27 = 0, $29 = 0, $3 = 0, $38 = 0, $4 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 12 | 0; + $3 = sp; + $4 = sp + 8 | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_($3, $0); + if (HEAP8[$3 >> 0] | 0) { + $8 = (HEAP32[$0 >> 2] | 0) + -12 | 0; + HEAP32[$4 >> 2] = HEAP32[$0 + (HEAP32[$8 >> 2] | 0) + 24 >> 2]; + $14 = $0 + (HEAP32[$8 >> 2] | 0) | 0; + $16 = HEAP32[$14 + 4 >> 2] | 0; + $17 = $1 + $2 | 0; + $18 = __ZNSt3__211char_traitsIcE3eofEv() | 0; + $19 = $14 + 76 | 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($18, HEAP32[$19 >> 2] | 0) | 0) { + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $14); + $22 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66512) | 0; + $26 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$22 >> 2] | 0) + 28 >> 2] & 127]($22, 32) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + $27 = $26 << 24 >> 24; + HEAP32[$19 >> 2] = $27; + $29 = $27; + } else $29 = HEAP32[$19 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + if (!(__ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $1, ($16 & 176 | 0) == 32 ? $17 : $1, $17, $14, $29 & 255) | 0)) { + $38 = $0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) | 0; + __ZNSt3__28ios_base5clearEj($38, HEAP32[$38 + 16 >> 2] | 5); + } + } + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev($3); + STACKTOP = sp; + return $0 | 0; +} + +function _quantize3_ord_dither($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$07076 = 0, $$07178 = 0, $$07178$us = 0, $$07275 = 0, $$07374 = 0, $$077 = 0, $$pre84 = 0, $10 = 0, $12 = 0, $14 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $22 = 0, $29 = 0, $30 = 0, $31 = 0, $36 = 0, $5 = 0, $7 = 0, $8 = 0; + $5 = HEAP32[$0 + 484 >> 2] | 0; + $7 = HEAP32[$5 + 24 >> 2] | 0; + $8 = HEAP32[$7 >> 2] | 0; + $10 = HEAP32[$7 + 4 >> 2] | 0; + $12 = HEAP32[$7 + 8 >> 2] | 0; + $14 = HEAP32[$0 + 112 >> 2] | 0; + if (($3 | 0) <= 0) return; + $16 = $5 + 48 | 0; + $17 = $5 + 52 | 0; + $18 = $5 + 56 | 0; + $19 = $5 + 60 | 0; + $$pre84 = HEAP32[$16 >> 2] | 0; + if (!$14) { + $$07178$us = 0; + $22 = $$pre84; + do { + $22 = $22 + 1 & 15; + $$07178$us = $$07178$us + 1 | 0; + } while (($$07178$us | 0) != ($3 | 0)); + HEAP32[$16 >> 2] = $22; + return; + } + $$07178 = 0; + $36 = $$pre84; + do { + $29 = HEAP32[$17 >> 2] | 0; + $30 = HEAP32[$18 >> 2] | 0; + $31 = HEAP32[$19 >> 2] | 0; + $$07076 = $14; + $$07275 = 0; + $$07374 = HEAP32[$2 + ($$07178 << 2) >> 2] | 0; + $$077 = HEAP32[$1 + ($$07178 << 2) >> 2] | 0; + while (1) { + HEAP8[$$07374 >> 0] = (HEAPU8[$10 + ((HEAP32[$30 + ($36 << 6) + ($$07275 << 2) >> 2] | 0) + (HEAPU8[$$077 + 1 >> 0] | 0)) >> 0] | 0) + (HEAPU8[$8 + ((HEAP32[$29 + ($36 << 6) + ($$07275 << 2) >> 2] | 0) + (HEAPU8[$$077 >> 0] | 0)) >> 0] | 0) + (HEAPU8[$12 + ((HEAP32[$31 + ($36 << 6) + ($$07275 << 2) >> 2] | 0) + (HEAPU8[$$077 + 2 >> 0] | 0)) >> 0] | 0); + $$07076 = $$07076 + -1 | 0; + if (!$$07076) break; else { + $$07275 = $$07275 + 1 & 15; + $$07374 = $$07374 + 1 | 0; + $$077 = $$077 + 3 | 0; + } + } + $36 = $36 + 1 & 15; + HEAP32[$16 >> 2] = $36; + $$07178 = $$07178 + 1 | 0; + } while (($$07178 | 0) != ($3 | 0)); + return; +} + +function __ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0$i$i = 0, $$029 = 0, $$030 = 0, $$07$i$i = 0, $$pre = 0, $$pre$phiZ2D = 0, $13 = 0, $15 = 0, $18 = 0, $19 = 0, $21 = 0, $23 = 0, $25 = 0, $26 = 0, $28 = 0, $4 = 0, $5 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond32 = 0, label = 0; + $4 = $0 + 11 | 0; + $5 = HEAP8[$4 >> 0] | 0; + $7 = $0 + 4 | 0; + $8 = HEAP32[$7 >> 2] | 0; + $9 = $5 & 255; + do if (($5 << 24 >> 24 < 0 ? $8 : $9) | 0) { + if (($1 | 0) == ($2 | 0)) { + $$pre$phiZ2D = $9; + $19 = $5; + $23 = $8; + } else { + $$0$i$i = $2; + $$07$i$i = $1; + while (1) { + $13 = $$0$i$i + -4 | 0; + if ($$07$i$i >>> 0 >= $13 >>> 0) break; + $15 = HEAP32[$$07$i$i >> 2] | 0; + HEAP32[$$07$i$i >> 2] = HEAP32[$13 >> 2]; + HEAP32[$13 >> 2] = $15; + $$0$i$i = $13; + $$07$i$i = $$07$i$i + 4 | 0; + } + $$pre = HEAP8[$4 >> 0] | 0; + $$pre$phiZ2D = $$pre & 255; + $19 = $$pre; + $23 = HEAP32[$7 >> 2] | 0; + } + $18 = $19 << 24 >> 24 < 0; + $21 = $18 ? HEAP32[$0 >> 2] | 0 : $0; + $25 = $2 + -4 | 0; + $26 = $21 + ($18 ? $23 : $$pre$phiZ2D) | 0; + $$029 = $1; + $$030 = $21; + while (1) { + $28 = HEAP8[$$030 >> 0] | 0; + $or$cond32 = $28 << 24 >> 24 > 0 & $28 << 24 >> 24 != 127; + if ($$029 >>> 0 >= $25 >>> 0) break; + if ($or$cond32 ? (HEAP32[$$029 >> 2] | 0) != ($28 << 24 >> 24 | 0) : 0) { + label = 11; + break; + } + $$029 = $$029 + 4 | 0; + $$030 = ($26 - $$030 | 0) > 1 ? $$030 + 1 | 0 : $$030; + } + if ((label | 0) == 11) { + HEAP32[$3 >> 2] = 4; + break; + } + if ($or$cond32 ? ((HEAP32[$25 >> 2] | 0) + -1 | 0) >>> 0 >= $28 << 24 >> 24 >>> 0 : 0) HEAP32[$3 >> 2] = 4; + } while (0); + return; +} + +function _ycc_rgb_convert($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$07177$us = 0, $$07376$us = 0, $$07475$us = 0, $$078$us = 0, $$in = 0, $10 = 0, $12 = 0, $14 = 0, $16 = 0, $18 = 0, $20 = 0, $21 = 0, $26 = 0, $29 = 0, $32 = 0, $37 = 0, $40 = 0, $43 = 0, $6 = 0, $8 = 0, $$in$looptemp = 0; + $6 = HEAP32[$0 + 480 >> 2] | 0; + $8 = HEAP32[$0 + 112 >> 2] | 0; + $10 = HEAP32[$0 + 336 >> 2] | 0; + $12 = HEAP32[$6 + 8 >> 2] | 0; + $14 = HEAP32[$6 + 12 >> 2] | 0; + $16 = HEAP32[$6 + 16 >> 2] | 0; + $18 = HEAP32[$6 + 20 >> 2] | 0; + if (($4 | 0) <= 0) return; + $20 = $1 + 4 | 0; + $21 = $1 + 8 | 0; + if (!$8) return; + $$07177$us = $3; + $$078$us = $2; + $$in = $4; + while (1) { + $$in$looptemp = $$in; + $$in = $$in + -1 | 0; + $26 = HEAP32[(HEAP32[$1 >> 2] | 0) + ($$078$us << 2) >> 2] | 0; + $29 = HEAP32[(HEAP32[$20 >> 2] | 0) + ($$078$us << 2) >> 2] | 0; + $32 = HEAP32[(HEAP32[$21 >> 2] | 0) + ($$078$us << 2) >> 2] | 0; + $$078$us = $$078$us + 1 | 0; + $$07376$us = HEAP32[$$07177$us >> 2] | 0; + $$07475$us = 0; + while (1) { + $37 = HEAPU8[$26 + $$07475$us >> 0] | 0; + $40 = HEAPU8[$29 + $$07475$us >> 0] | 0; + $43 = HEAPU8[$32 + $$07475$us >> 0] | 0; + HEAP8[$$07376$us >> 0] = HEAP8[$10 + ((HEAP32[$12 + ($43 << 2) >> 2] | 0) + $37) >> 0] | 0; + HEAP8[$$07376$us + 1 >> 0] = HEAP8[$10 + (((HEAP32[$16 + ($43 << 2) >> 2] | 0) + (HEAP32[$18 + ($40 << 2) >> 2] | 0) >> 16) + $37) >> 0] | 0; + HEAP8[$$07376$us + 2 >> 0] = HEAP8[$10 + ((HEAP32[$14 + ($40 << 2) >> 2] | 0) + $37) >> 0] | 0; + $$07475$us = $$07475$us + 1 | 0; + if (($$07475$us | 0) == ($8 | 0)) break; else $$07376$us = $$07376$us + 3 | 0; + } + if (($$in$looptemp | 0) <= 1) break; else $$07177$us = $$07177$us + 4 | 0; + } + return; +} + +function __ZNKSt3__28messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0$i = 0, $$0$i$i = 0, $$0$i$i17 = 0, $$0$i22 = 0, $10 = 0, $11 = 0, $16 = 0, $18 = 0, $30 = 0, $31 = 0, $35 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $6 = sp; + HEAP32[$6 >> 2] = 0; + HEAP32[$6 + 4 >> 2] = 0; + HEAP32[$6 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$6 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $10 = HEAP8[$5 + 11 >> 0] | 0; + $11 = $10 << 24 >> 24 < 0; + $16 = $11 ? HEAP32[$5 >> 2] | 0 : $5; + $18 = $16 + ($11 ? HEAP32[$5 + 4 >> 2] | 0 : $10 & 255) | 0; + $$0$i22 = $16; + while (1) { + if ($$0$i22 >>> 0 >= $18 >>> 0) break; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc($6, HEAP8[$$0$i22 >> 0] | 0); + $$0$i22 = $$0$i22 + 1 | 0; + } + $30 = (HEAP8[$6 + 11 >> 0] | 0) < 0 ? HEAP32[$6 >> 2] | 0 : $6; + $31 = _catgets(($2 | 0) == -1 ? -1 : $2 << 1, $3, $4, $30) | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + $$0$i$i17 = 0; + while (1) { + if (($$0$i$i17 | 0) == 3) break; + HEAP32[$0 + ($$0$i$i17 << 2) >> 2] = 0; + $$0$i$i17 = $$0$i$i17 + 1 | 0; + } + $35 = $30 + (_strlen($31) | 0) | 0; + $$0$i = $30; + while (1) { + if ($$0$i >>> 0 >= $35 >>> 0) break; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc($0, HEAP8[$$0$i >> 0] | 0); + $$0$i = $$0$i + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($6); + STACKTOP = sp; + return; +} + +function _jinit_memory_mgr($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $23 = 0, $3 = 0, $31 = 0, $37 = 0, $39 = 0, $4 = 0, $5 = 0, $7 = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $1 = sp + 8 | 0; + $2 = sp + 12 | 0; + $3 = $0 + 4 | 0; + HEAP32[$3 >> 2] = 0; + $4 = _jpeg_mem_init($0) | 0; + HEAP32[$1 >> 2] = $4; + $5 = _jpeg_get_small($0, 84) | 0; + if (!$5) { + _jpeg_mem_term($0); + $7 = HEAP32[$0 >> 2] | 0; + HEAP32[$7 + 20 >> 2] = 56; + HEAP32[$7 + 24 >> 2] = 0; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + HEAP32[$5 >> 2] = 33; + HEAP32[$5 + 4 >> 2] = 34; + HEAP32[$5 + 8 >> 2] = 9; + HEAP32[$5 + 12 >> 2] = 10; + HEAP32[$5 + 16 >> 2] = 39; + HEAP32[$5 + 20 >> 2] = 40; + HEAP32[$5 + 24 >> 2] = 204; + HEAP32[$5 + 28 >> 2] = 21; + HEAP32[$5 + 32 >> 2] = 22; + HEAP32[$5 + 36 >> 2] = 138; + HEAP32[$5 + 40 >> 2] = 205; + HEAP32[$5 + 48 >> 2] = 1e9; + $23 = $5 + 44 | 0; + HEAP32[$23 >> 2] = $4; + HEAP32[$5 + 56 >> 2] = 0; + HEAP32[$5 + 64 >> 2] = 0; + HEAP32[$5 + 52 >> 2] = 0; + HEAP32[$5 + 60 >> 2] = 0; + HEAP32[$5 + 68 >> 2] = 0; + HEAP32[$5 + 72 >> 2] = 0; + HEAP32[$5 + 76 >> 2] = 84; + HEAP32[$3 >> 2] = $5; + $31 = _getenv(50713) | 0; + if (!$31) { + STACKTOP = sp; + return; + } + HEAP8[$2 >> 0] = 120; + HEAP32[$vararg_buffer >> 2] = $1; + HEAP32[$vararg_buffer + 4 >> 2] = $2; + if ((_sscanf($31, 50721, $vararg_buffer) | 0) > 0) { + switch (HEAP8[$2 >> 0] | 0) { + case 77: + case 109: + { + $37 = (HEAP32[$1 >> 2] | 0) * 1e3 | 0; + HEAP32[$1 >> 2] = $37; + $39 = $37; + break; + } + default: + $39 = HEAP32[$1 >> 2] | 0; + } + HEAP32[$23 >> 2] = $39 * 1e3; + } + STACKTOP = sp; + return; +} + +function ___dynamic_cast($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $10 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $4 = 0, $5 = 0, $8 = 0, dest = 0, sp = 0, stop = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $4 = sp; + $5 = HEAP32[$0 >> 2] | 0; + $8 = $0 + (HEAP32[$5 + -8 >> 2] | 0) | 0; + $10 = HEAP32[$5 + -4 >> 2] | 0; + HEAP32[$4 >> 2] = $2; + HEAP32[$4 + 4 >> 2] = $0; + HEAP32[$4 + 8 >> 2] = $1; + HEAP32[$4 + 12 >> 2] = $3; + $14 = $4 + 16 | 0; + $15 = $4 + 20 | 0; + $16 = $4 + 24 | 0; + $17 = $4 + 28 | 0; + $18 = $4 + 32 | 0; + $19 = $4 + 40 | 0; + dest = $14; + stop = dest + 36 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP16[$14 + 36 >> 1] = 0; + HEAP8[$14 + 38 >> 0] = 0; + L1 : do if (__ZL8is_equalPKSt9type_infoS1_b($10, $2, 0) | 0) { + HEAP32[$4 + 48 >> 2] = 1; + FUNCTION_TABLE_viiiiii[HEAP32[(HEAP32[$10 >> 2] | 0) + 20 >> 2] & 7]($10, $4, $8, $8, 1, 0); + $$0 = (HEAP32[$16 >> 2] | 0) == 1 ? $8 : 0; + } else { + FUNCTION_TABLE_viiiii[HEAP32[(HEAP32[$10 >> 2] | 0) + 24 >> 2] & 63]($10, $4, $8, 1, 0); + switch (HEAP32[$4 + 36 >> 2] | 0) { + case 0: + { + $$0 = (HEAP32[$19 >> 2] | 0) == 1 & (HEAP32[$17 >> 2] | 0) == 1 & (HEAP32[$18 >> 2] | 0) == 1 ? HEAP32[$15 >> 2] | 0 : 0; + break L1; + break; + } + case 1: + break; + default: + { + $$0 = 0; + break L1; + } + } + if ((HEAP32[$16 >> 2] | 0) != 1 ? !((HEAP32[$19 >> 2] | 0) == 0 & (HEAP32[$17 >> 2] | 0) == 1 & (HEAP32[$18 >> 2] | 0) == 1) : 0) { + $$0 = 0; + break; + } + $$0 = HEAP32[$14 >> 2] | 0; + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $$sroa$speculated = 0, $11 = 0, $17 = 0, $18 = 0, $23 = 0, $26 = 0, $27 = 0, $29 = 0, $32 = 0, $33 = 0, $39 = 0, $43 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $8 = sp; + if ((1073741806 - $1 | 0) >>> 0 < $2 >>> 0) __ZNKSt3__221__basic_string_commonILb1EE20__throw_length_errorEv($0); + $11 = $0 + 8 | 0; + if ((HEAP8[$11 + 3 >> 0] | 0) < 0) $29 = HEAP32[$0 >> 2] | 0; else $29 = $0; + if ($1 >>> 0 < 536870887) { + $17 = $2 + $1 | 0; + $18 = $1 << 1; + $$sroa$speculated = $17 >>> 0 < $18 >>> 0 ? $18 : $17; + $23 = $$sroa$speculated >>> 0 < 2 ? 2 : $$sroa$speculated + 4 & -4; + if ($23 >>> 0 > 1073741823) _abort(); else $26 = $23; + } else $26 = 1073741807; + $27 = __Znwm($26 << 2) | 0; + if ($4 | 0) __ZNSt3__211char_traitsIwE4copyEPwPKwm($27, $29, $4) | 0; + if ($6 | 0) __ZNSt3__211char_traitsIwE4copyEPwPKwm($27 + ($4 << 2) | 0, $7, $6) | 0; + $32 = $3 - $5 | 0; + $33 = $32 - $4 | 0; + if ($33 | 0) __ZNSt3__211char_traitsIwE4copyEPwPKwm($27 + ($4 << 2) + ($6 << 2) | 0, $29 + ($4 << 2) + ($5 << 2) | 0, $33) | 0; + $39 = $1 + 1 | 0; + if (($39 | 0) != 2) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($29, $39 << 2); + HEAP32[$0 >> 2] = $27; + HEAP32[$11 >> 2] = $26 | -2147483648; + $43 = $32 + $6 | 0; + HEAP32[$0 + 4 >> 2] = $43; + HEAP32[$8 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($27 + ($43 << 2) | 0, $8); + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE8__appendEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $13 = 0, $14 = 0, $18 = 0, $2 = 0, $20 = 0, $23 = 0, $3 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 8 | 0; + $5 = $0 + 4 | 0; + $6 = HEAP32[$5 >> 2] | 0; + do if ((((HEAP32[$3 >> 2] | 0) - $6 | 0) / 36 | 0) >>> 0 < $1 >>> 0) { + $13 = (($6 - (HEAP32[$0 >> 2] | 0) | 0) / 36 | 0) + $1 | 0; + $14 = __ZNKSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE8max_sizeEv($0) | 0; + if ($14 >>> 0 < $13 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $18 = HEAP32[$0 >> 2] | 0; + $20 = ((HEAP32[$3 >> 2] | 0) - $18 | 0) / 36 | 0; + $23 = $20 << 1; + __ZNSt3__214__split_bufferIN6vision25DoGScaleInvariantDetector12FeaturePointERNS_9allocatorIS3_EEEC2EmmS6_($2, $20 >>> 0 < $14 >>> 1 >>> 0 ? ($23 >>> 0 < $13 >>> 0 ? $13 : $23) : $14, ((HEAP32[$5 >> 2] | 0) - $18 | 0) / 36 | 0, $0 + 8 | 0); + __ZNSt3__214__split_bufferIN6vision25DoGScaleInvariantDetector12FeaturePointERNS_9allocatorIS3_EEE18__construct_at_endEm($2, $1); + __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS5_EE($0, $2); + __ZNSt3__214__split_bufferIN6vision25DoGScaleInvariantDetector12FeaturePointERNS_9allocatorIS3_EEED2Ev($2); + break; + } + } else __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE18__construct_at_endEm($0, $1); while (0); + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorINS0_INS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEEENS3_IS7_EEE8__appendEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $13 = 0, $14 = 0, $18 = 0, $2 = 0, $20 = 0, $23 = 0, $3 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 8 | 0; + $5 = $0 + 4 | 0; + $6 = HEAP32[$5 >> 2] | 0; + do if ((((HEAP32[$3 >> 2] | 0) - $6 | 0) / 12 | 0) >>> 0 < $1 >>> 0) { + $13 = (($6 - (HEAP32[$0 >> 2] | 0) | 0) / 12 | 0) + $1 | 0; + $14 = __ZNKSt3__26vectorINS0_INS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEEENS3_IS7_EEE8max_sizeEv($0) | 0; + if ($14 >>> 0 < $13 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $18 = HEAP32[$0 >> 2] | 0; + $20 = ((HEAP32[$3 >> 2] | 0) - $18 | 0) / 12 | 0; + $23 = $20 << 1; + __ZNSt3__214__split_bufferINS_6vectorINS1_INS_4pairIfmEENS_9allocatorIS3_EEEENS4_IS6_EEEERNS4_IS8_EEEC2EmmSA_($2, $20 >>> 0 < $14 >>> 1 >>> 0 ? ($23 >>> 0 < $13 >>> 0 ? $13 : $23) : $14, ((HEAP32[$5 >> 2] | 0) - $18 | 0) / 12 | 0, $0 + 8 | 0); + __ZNSt3__214__split_bufferINS_6vectorINS1_INS_4pairIfmEENS_9allocatorIS3_EEEENS4_IS6_EEEERNS4_IS8_EEE18__construct_at_endEm($2, $1); + __ZNSt3__26vectorINS0_INS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEEENS3_IS7_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS7_RS8_EE($0, $2); + __ZNSt3__214__split_bufferINS_6vectorINS1_INS_4pairIfmEENS_9allocatorIS3_EEEENS4_IS6_EEEERNS4_IS8_EEED2Ev($2); + break; + } + } else __ZNSt3__26vectorINS0_INS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEEENS3_IS7_EEE18__construct_at_endEm($0, $1); while (0); + STACKTOP = sp; + return; +} + +function __ZN6vision18Condition4Points2dIfEEbPT_S2_S2_S2_RS1_S2_PKS1_S5_S5_S5_($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = $9 | 0; + var $$0 = 0, $17 = 0.0, $18 = 0, $20 = 0, $23 = 0, $26 = 0, $29 = 0.0, $32 = 0.0, $34 = 0.0, $36 = 0.0, $38 = 0.0, $40 = 0.0, $42 = 0.0, $44 = 0.0, $46 = 0.0, $66 = 0.0, $71 = 0.0; + $17 = (+HEAPF32[$6 >> 2] + +HEAPF32[$7 >> 2] + +HEAPF32[$8 >> 2] + +HEAPF32[$9 >> 2]) * .25; + HEAPF32[$5 >> 2] = $17; + $18 = $6 + 4 | 0; + $20 = $7 + 4 | 0; + $23 = $8 + 4 | 0; + $26 = $9 + 4 | 0; + $29 = (+HEAPF32[$18 >> 2] + +HEAPF32[$20 >> 2] + +HEAPF32[$23 >> 2] + +HEAPF32[$26 >> 2]) * .25; + HEAPF32[$5 + 4 >> 2] = $29; + $32 = +HEAPF32[$6 >> 2] - $17; + $34 = +HEAPF32[$18 >> 2] - $29; + $36 = +HEAPF32[$7 >> 2] - $17; + $38 = +HEAPF32[$20 >> 2] - $29; + $40 = +HEAPF32[$8 >> 2] - $17; + $42 = +HEAPF32[$23 >> 2] - $29; + $44 = +HEAPF32[$9 >> 2] - $17; + $46 = +HEAPF32[$26 >> 2] - $29; + $66 = (+Math_sqrt(+($32 * $32 + $34 * $34)) + +Math_sqrt(+($36 * $36 + $38 * $38)) + +Math_sqrt(+($40 * $40 + $42 * $42)) + +Math_sqrt(+($44 * $44 + $46 * $46))) * .25; + if ($66 == 0.0) $$0 = 0; else { + $71 = 1.0 / $66 * 1.4142135623730951; + HEAPF32[$4 >> 2] = $71; + HEAPF32[$0 >> 2] = $32 * $71; + HEAPF32[$0 + 4 >> 2] = $34 * +HEAPF32[$4 >> 2]; + HEAPF32[$1 >> 2] = $36 * +HEAPF32[$4 >> 2]; + HEAPF32[$1 + 4 >> 2] = $38 * +HEAPF32[$4 >> 2]; + HEAPF32[$2 >> 2] = $40 * +HEAPF32[$4 >> 2]; + HEAPF32[$2 + 4 >> 2] = $42 * +HEAPF32[$4 >> 2]; + HEAPF32[$3 >> 2] = $44 * +HEAPF32[$4 >> 2]; + HEAPF32[$3 + 4 >> 2] = $46 * +HEAPF32[$4 >> 2]; + $$0 = 1; + } + return $$0 | 0; +} + +function __ZN6vision27OrthogonalizePivot8x9Basis3IfEEbPT_S2_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $10 = 0, $12 = 0, $14 = 0.0, $15 = 0.0, $17 = 0.0, $19 = 0.0, $2 = 0, $21 = 0.0, $23 = 0, $24 = 0, $27 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 108 | 0; + $4 = $0 + 72 | 0; + $5 = $1 + 108 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($3, $4, $5); + $6 = $0 + 144 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($6, $4, $1 + 144 | 0); + $8 = $0 + 180 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($8, $4, $1 + 180 | 0); + $10 = $0 + 216 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($10, $4, $1 + 216 | 0); + $12 = $0 + 252 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($12, $4, $1 + 252 | 0); + $14 = +__ZN6vision11SumSquares9IfEET_PKS1_($3); + HEAPF32[$2 >> 2] = $14; + $15 = +__ZN6vision11SumSquares9IfEET_PKS1_($6); + HEAPF32[$2 + 4 >> 2] = $15; + $17 = +__ZN6vision11SumSquares9IfEET_PKS1_($8); + HEAPF32[$2 + 8 >> 2] = $17; + $19 = +__ZN6vision11SumSquares9IfEET_PKS1_($10); + HEAPF32[$2 + 12 >> 2] = $19; + $21 = +__ZN6vision11SumSquares9IfEET_PKS1_($12); + HEAPF32[$2 + 16 >> 2] = $21; + $23 = __ZN6vision9MaxIndex5IfEEiPKT_($2) | 0; + $24 = $2 + ($23 << 2) | 0; + if (+HEAPF32[$24 >> 2] == 0.0) $$0 = 0; else { + $27 = $23 * 9 | 0; + __ZN6vision5Swap9IfEEvPT_S2_($3, $3 + ($27 << 2) | 0); + __ZN6vision5Swap9IfEEvPT_S2_($5, $5 + ($27 << 2) | 0); + __ZN6vision12ScaleVector9IfEEvPT_PKS1_S1_($3, $3, 1.0 / +Math_sqrt(+(+HEAPF32[$24 >> 2]))); + $$0 = 1; + } + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNSt3__26vectorIhNS_9allocatorIhEEE6assignIPhEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr16is_constructibleIhNS_15iterator_traitsIS7_E9referenceEEE5valueEvE4typeES7_S7_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $12 = 0, $14 = 0, $15 = 0, $18 = 0, $25 = 0, $29 = 0, $32 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = 0, $spec$select = 0; + $4 = $1; + $5 = $2 - $4 | 0; + $6 = $0 + 8 | 0; + $8 = HEAP32[$0 >> 2] | 0; + $11 = $8; + do if ($5 >>> 0 > ((HEAP32[$6 >> 2] | 0) - $8 | 0) >>> 0) { + __ZNSt3__26vectorIhNS_9allocatorIhEEE13__vdeallocateEv($0); + $25 = __ZNKSt3__26vectorIhNS_9allocatorIhEEE8max_sizeEv($0) | 0; + if ($25 >>> 0 < $5 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $29 = (HEAP32[$6 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) | 0; + $32 = $29 << 1; + __ZNSt3__26vectorIhNS_9allocatorIhEEE11__vallocateEm($0, $29 >>> 0 < $25 >>> 1 >>> 0 ? ($32 >>> 0 < $5 >>> 0 ? $5 : $32) : $25); + __ZNSt3__26vectorIhNS_9allocatorIhEEE18__construct_at_endIPhEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeES7_S7_m($0, $1, $2, $5); + break; + } + } else { + $12 = $0 + 4 | 0; + $14 = (HEAP32[$12 >> 2] | 0) - $8 | 0; + $15 = $5 >>> 0 > $14 >>> 0; + $spec$select = $15 ? $1 + $14 | 0 : $2; + $18 = $spec$select - $4 | 0; + if ($18 | 0) _memmove($11 | 0, $1 | 0, $18 | 0) | 0; + if ($15) { + __ZNSt3__26vectorIhNS_9allocatorIhEEE18__construct_at_endIPhEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeES7_S7_m($0, $spec$select, $2, $5 - (HEAP32[$12 >> 2] | 0) + (HEAP32[$0 >> 2] | 0) | 0); + break; + } else { + HEAP32[$12 >> 2] = $11 + $18; + break; + } + } while (0); + return; +} + +function _arImageProcLumaHistAndOtsu($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$062 = 0, $$064 = 0.0, $$067 = 0.0, $$068 = 0.0, $$070 = 0.0, $$169 = 0.0, $$2 = 0, $$266 = 0.0, $$3 = 0, $$pre$phiZ2D = 0, $15 = 0.0, $17 = 0, $21 = 0.0, $25 = 0.0, $3 = 0, $30 = 0.0, $32 = 0.0, $33 = 0, $34 = 0, $indvars$iv = 0, $indvars$iv71 = 0; + $3 = _arImageProcLumaHist($0, $1) | 0; + if (($3 | 0) < 0) $$0 = $3; else { + $$070 = 0.0; + $indvars$iv71 = 1; + do { + $$070 = $$070 + +((Math_imul(HEAP32[$0 + 12 + ($indvars$iv71 << 2) >> 2] | 0, $indvars$iv71) | 0) >>> 0); + $indvars$iv71 = $indvars$iv71 + 1 | 0; + } while (($indvars$iv71 | 0) != 256); + $15 = +(Math_imul(HEAP32[$0 + 8 >> 2] | 0, HEAP32[$0 + 4 >> 2] | 0) | 0); + $$062 = 0; + $$064 = 0.0; + $$067 = 0.0; + $$068 = 0.0; + $indvars$iv = 0; + while (1) { + $17 = HEAP32[$0 + 12 + ($indvars$iv << 2) >> 2] | 0; + $$067 = $$067 + +($17 >>> 0); + if ($$067 != 0.0) { + $21 = $15 - $$067; + if ($21 == 0.0) { + $$3 = $$062; + break; + } + $25 = $$068 + +((Math_imul($17, $indvars$iv) | 0) >>> 0); + $30 = $25 / $$067 - ($$070 - $25) / $21; + $32 = $30 * ($$067 * $21 * $30); + $33 = $32 > $$064; + $34 = $indvars$iv & 255; + $$169 = $25; + $$2 = $33 ? $34 : $$062; + $$266 = $33 ? $32 : $$064; + $$pre$phiZ2D = $34; + } else { + $$169 = $$068; + $$2 = $$062; + $$266 = $$064; + $$pre$phiZ2D = $indvars$iv & 255; + } + if ($$pre$phiZ2D << 24 >> 24 == -1) { + $$3 = $$2; + break; + } else { + $$062 = $$2; + $$064 = $$266; + $$068 = $$169; + $indvars$iv = $indvars$iv + 1 | 0; + } + } + HEAP8[$2 >> 0] = $$3; + $$0 = 0; + } + return $$0 | 0; +} + +function _confidenceCutoff($0) { + $0 = $0 | 0; + var $$0 = 0, $$049 = 0, $$150 = 0, $$2 = 0, $16 = 0, $18 = 0, $28 = 0, $30 = 0, $36 = 0, $4 = 0, $6 = 0; + L1 : do switch (HEAP32[$0 + 24 >> 2] | 0) { + case 1: + case 0: + { + $4 = HEAP32[$0 + 44 >> 2] | 0; + $$049 = 0; + while (1) { + if (($$049 | 0) >= ($4 | 0)) break L1; + $6 = $0 + 48 + ($$049 << 8) + 4 | 0; + if ((HEAP32[$6 >> 2] | 0) > -1 ? +HEAPF64[$0 + 48 + ($$049 << 8) + 32 >> 3] < .5 : 0) { + HEAP32[$0 + 48 + ($$049 << 8) + 8 >> 2] = -1; + HEAP32[$6 >> 2] = -1; + HEAP32[$0 + 48 + ($$049 << 8) + 236 >> 2] = 6; + } + $$049 = $$049 + 1 | 0; + } + break; + } + case 2: + { + $16 = HEAP32[$0 + 44 >> 2] | 0; + $$150 = 0; + while (1) { + if (($$150 | 0) >= ($16 | 0)) break L1; + $18 = $0 + 48 + ($$150 << 8) + 4 | 0; + if ((HEAP32[$18 >> 2] | 0) > -1 ? +HEAPF64[$0 + 48 + ($$150 << 8) + 32 >> 3] < .5 : 0) { + HEAP32[$0 + 48 + ($$150 << 8) + 12 >> 2] = -1; + HEAP32[$18 >> 2] = -1; + HEAP32[$0 + 48 + ($$150 << 8) + 236 >> 2] = 6; + } + $$150 = $$150 + 1 | 0; + } + break; + } + default: + { + $28 = HEAP32[$0 + 44 >> 2] | 0; + $$2 = 0; + while (1) { + if (($$2 | 0) >= ($28 | 0)) break L1; + $30 = $0 + 48 + ($$2 << 8) + 8 | 0; + if ((HEAP32[$30 >> 2] | 0) > -1 ? +HEAPF64[$0 + 48 + ($$2 << 8) + 40 >> 3] < .5 : 0) { + HEAP32[$30 >> 2] = -1; + $$0 = 0; + } else $$0 = 1; + $36 = $0 + 48 + ($$2 << 8) + 12 | 0; + if (((HEAP32[$36 >> 2] | 0) > -1 ? +HEAPF64[$0 + 48 + ($$2 << 8) + 48 >> 3] < .5 : 0) ? (HEAP32[$36 >> 2] = -1, ($$0 | 0) == 0) : 0) HEAP32[$0 + 48 + ($$2 << 8) + 236 >> 2] = 6; + $$2 = $$2 + 1 | 0; + } + } + } while (0); + return; +} + +function _getMultiEachMarkerInfo($id, $multiMarkerId, $markerIndex) { + $id = $id | 0; + $multiMarkerId = $multiMarkerId | 0; + $markerIndex = $markerIndex | 0; + var $2 = 0, $5 = 0, $8 = 0, $call7 = 0, $id$addr = 0, $retval$2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + do if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0) { + $call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0; + $2 = HEAP32[$call7 + 328 >> 2] | 0; + if (($multiMarkerId | 0) < 0 ? 1 : (HEAP32[$call7 + 332 >> 2] | 0) - $2 >> 3 >>> 0 <= $multiMarkerId >>> 0) { + $retval$2 = HEAP32[4225] | 0; + break; + } + $5 = HEAP32[$2 + ($multiMarkerId << 3) + 4 >> 2] | 0; + if (($markerIndex | 0) < 0 ? 1 : (HEAP32[$5 + 4 >> 2] | 0) <= ($markerIndex | 0)) { + $retval$2 = HEAP32[4226] | 0; + break; + } else { + $8 = HEAP32[$5 >> 2] | 0; + _matrixCopy($8 + ($markerIndex * 320 | 0) + 16 | 0, 61136); + _emscripten_asm_const_iiiid(1, HEAP32[$8 + ($markerIndex * 320 | 0) + 304 >> 2] | 0, HEAP32[$8 + ($markerIndex * 320 | 0) >> 2] | 0, HEAP32[$8 + ($markerIndex * 320 | 0) + 4 >> 2] | 0, +(+HEAPF64[$8 + ($markerIndex * 320 | 0) + 8 >> 3])) | 0; + $retval$2 = 0; + break; + } + } else $retval$2 = HEAP32[4224] | 0; while (0); + STACKTOP = sp; + return $retval$2 | 0; +} + +function __ZL15genBWImageQuartPhiiPiS0_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$065 = 0, $$066 = 0, $$067 = 0, $$068 = 0, $$069 = 0, $$070 = 0, $$1 = 0, $11 = 0, $5 = 0, $6 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $5 = ($1 | 0) / 4 | 0; + HEAP32[$3 >> 2] = $5; + $6 = ($2 | 0) / 4 | 0; + HEAP32[$4 >> 2] = $6; + $8 = _malloc(Math_imul($6, $5) | 0) | 0; + if (!$8) { + _arLog(0, 3, 45930, sp); + _exit(1); + } + $$0 = 0; + $$066 = $8; + while (1) { + if (($$0 | 0) >= ($6 | 0)) break; + $11 = $$0 << 2; + $$065 = 0; + $$067 = $0 + (Math_imul($11, $1) | 0) | 0; + $$068 = $0 + (Math_imul($11 | 3, $1) | 0) | 0; + $$069 = $0 + (Math_imul($11 | 2, $1) | 0) | 0; + $$070 = $0 + (Math_imul($11 | 1, $1) | 0) | 0; + $$1 = $$066; + while (1) { + if (($$065 | 0) >= ($5 | 0)) break; + HEAP8[$$1 >> 0] = ((HEAPU8[$$067 + 1 >> 0] | 0) + (HEAPU8[$$067 >> 0] | 0) + (HEAPU8[$$067 + 2 >> 0] | 0) + (HEAPU8[$$067 + 3 >> 0] | 0) + (HEAPU8[$$070 >> 0] | 0) + (HEAPU8[$$070 + 1 >> 0] | 0) + (HEAPU8[$$070 + 2 >> 0] | 0) + (HEAPU8[$$070 + 3 >> 0] | 0) + (HEAPU8[$$069 >> 0] | 0) + (HEAPU8[$$069 + 1 >> 0] | 0) + (HEAPU8[$$069 + 2 >> 0] | 0) + (HEAPU8[$$069 + 3 >> 0] | 0) + (HEAPU8[$$068 >> 0] | 0) + (HEAPU8[$$068 + 1 >> 0] | 0) + (HEAPU8[$$068 + 2 >> 0] | 0) + (HEAPU8[$$068 + 3 >> 0] | 0) | 0) / 16 | 0; + $$065 = $$065 + 1 | 0; + $$067 = $$067 + 4 | 0; + $$068 = $$068 + 4 | 0; + $$069 = $$069 + 4 | 0; + $$070 = $$070 + 4 | 0; + $$1 = $$1 + 1 | 0; + } + $$0 = $$0 + 1 | 0; + $$066 = $$1; + } + STACKTOP = sp; + return $8 | 0; +} + +function __ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$byval_copy = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $17 = 0, $24 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 208 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(208); + $$byval_copy = sp + 184 | 0; + $5 = sp + 192 | 0; + $6 = sp + 160 | 0; + $7 = sp; + $8 = sp + 188 | 0; + HEAP8[$5 >> 0] = HEAP8[59178] | 0; + HEAP8[$5 + 1 >> 0] = HEAP8[59179] | 0; + HEAP8[$5 + 2 >> 0] = HEAP8[59180] | 0; + HEAP8[$5 + 3 >> 0] = HEAP8[59181] | 0; + HEAP8[$5 + 4 >> 0] = HEAP8[59182] | 0; + HEAP8[$5 + 5 >> 0] = HEAP8[59183] | 0; + $9 = __ZNSt3__26__clocEv() | 0; + HEAP32[$$byval_copy >> 2] = $4; + $10 = __ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($6, 20, $9, $5, $$byval_copy) | 0; + $11 = $6 + $10 | 0; + $12 = __ZNSt3__214__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE($6, $11, $2) | 0; + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $2); + $13 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66544) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$13 >> 2] | 0) + 48 >> 2] & 15]($13, $6, $11, $7) | 0; + $17 = $7 + ($10 << 2) | 0; + HEAP32[$8 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$8 >> 2]; + $24 = __ZNSt3__216__pad_and_outputIwNS_11char_traitsIwEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $7, ($12 | 0) == ($11 | 0) ? $17 : $7 + ($12 - $6 << 2) | 0, $17, $2, $3) | 0; + STACKTOP = sp; + return $24 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle8CastExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy2 = 0, $12 = 0, $13 = 0, $18 = 0, $2 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy2 = sp + 32 | 0; + $2 = sp; + $3 = sp + 24 | 0; + $4 = sp + 16 | 0; + $5 = sp + 8 | 0; + $7 = $0 + 8 | 0; + $12 = HEAP32[$7 + 4 >> 2] | 0; + $13 = $2; + HEAP32[$13 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$13 + 4 >> 2] = $12; + HEAP32[$$byval_copy2 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 52150); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + $18 = HEAP32[$0 + 16 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$18 >> 2] | 0) + 16 >> 2] & 255]($18, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 53140); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + $23 = HEAP32[$0 + 20 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$23 >> 2] | 0) + 16 >> 2] & 255]($23, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 51964); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + STACKTOP = sp; + return; +} + +function __ZN6vision25MatrixInverseSymmetric3x3IfEEbPT_PKS1_S1_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = +$2; + var $$0 = 0, $11 = 0, $14 = 0.0, $15 = 0, $17 = 0, $23 = 0.0, $24 = 0, $3 = 0.0, $30 = 0.0, $31 = 0, $36 = 0.0, $44 = 0.0, $45 = 0, $50 = 0.0, $6 = 0.0, $7 = 0, $9 = 0; + $3 = +__ZN6vision23DeterminantSymmetric3x3IfEET_PKS1_($1); + if (!(+Math_abs(+$3) <= $2)) { + $6 = 1.0 / $3; + $7 = $1 + 16 | 0; + $9 = $1 + 20 | 0; + $11 = $1 + 32 | 0; + $14 = $6 * +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_(+HEAPF32[$7 >> 2], +HEAPF32[$9 >> 2], +HEAPF32[$11 >> 2]); + HEAPF32[$0 >> 2] = $14; + $15 = $1 + 8 | 0; + $17 = $1 + 4 | 0; + $23 = $6 * +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_S1_(+HEAPF32[$15 >> 2], +HEAPF32[$17 >> 2], +HEAPF32[$11 >> 2], +HEAPF32[$1 + 28 >> 2]); + $24 = $0 + 4 | 0; + HEAPF32[$24 >> 2] = $23; + $30 = $6 * +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_S1_(+HEAPF32[$17 >> 2], +HEAPF32[$15 >> 2], +HEAPF32[$7 >> 2], +HEAPF32[$9 >> 2]); + $31 = $0 + 8 | 0; + HEAPF32[$31 >> 2] = $30; + $36 = $6 * +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_(+HEAPF32[$1 >> 2], +HEAPF32[$15 >> 2], +HEAPF32[$11 >> 2]); + HEAPF32[$0 + 16 >> 2] = $36; + $44 = $6 * +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_S1_(+HEAPF32[$15 >> 2], +HEAPF32[$1 >> 2], +HEAPF32[$9 >> 2], +HEAPF32[$1 + 12 >> 2]); + $45 = $0 + 20 | 0; + HEAPF32[$45 >> 2] = $44; + $50 = $6 * +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_(+HEAPF32[$1 >> 2], +HEAPF32[$17 >> 2], +HEAPF32[$7 >> 2]); + HEAPF32[$0 + 32 >> 2] = $50; + HEAP32[$0 + 12 >> 2] = HEAP32[$24 >> 2]; + HEAP32[$0 + 24 >> 2] = HEAP32[$31 >> 2]; + HEAP32[$0 + 28 >> 2] = HEAP32[$45 >> 2]; + $$0 = 1; + } else $$0 = 0; + return $$0 | 0; +} + +function __ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$byval_copy = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $17 = 0, $24 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 96 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(96); + $$byval_copy = sp + 72 | 0; + $5 = sp + 80 | 0; + $6 = sp + 48 | 0; + $7 = sp; + $8 = sp + 76 | 0; + HEAP8[$5 >> 0] = HEAP8[59178] | 0; + HEAP8[$5 + 1 >> 0] = HEAP8[59179] | 0; + HEAP8[$5 + 2 >> 0] = HEAP8[59180] | 0; + HEAP8[$5 + 3 >> 0] = HEAP8[59181] | 0; + HEAP8[$5 + 4 >> 0] = HEAP8[59182] | 0; + HEAP8[$5 + 5 >> 0] = HEAP8[59183] | 0; + $9 = __ZNSt3__26__clocEv() | 0; + HEAP32[$$byval_copy >> 2] = $4; + $10 = __ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($6, 20, $9, $5, $$byval_copy) | 0; + $11 = $6 + $10 | 0; + $12 = __ZNSt3__214__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE($6, $11, $2) | 0; + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $2); + $13 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66512) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$13 >> 2] | 0) + 32 >> 2] & 15]($13, $6, $11, $7) | 0; + $17 = $7 + $10 | 0; + HEAP32[$8 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$8 >> 2]; + $24 = __ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_($$byval_copy, $7, ($12 | 0) == ($11 | 0) ? $17 : $7 + ($12 - $6) | 0, $17, $2, $3) | 0; + STACKTOP = sp; + return $24 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseSourceNameEPNS5_9NameStateE($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$byval_copy = 0, $1 = 0, $2 = 0, $3 = 0, $5 = 0, $6 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp + 24 | 0; + $1 = sp + 16 | 0; + $2 = sp + 8 | 0; + $3 = sp; + HEAP32[$1 >> 2] = 0; + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20parsePositiveIntegerEPm($0, $1) | 0) ? ($5 = __ZNK12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E7numLeftEv($0) | 0, $6 = HEAP32[$1 >> 2] | 0, ($6 + -1 | 0) >>> 0 < $5 >>> 0) : 0) { + $9 = HEAP32[$0 >> 2] | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKcS2_($2, $9, $9 + $6 | 0); + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + $6; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 53507); + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + if (__ZNK12_GLOBAL__N_110StringView10startsWithES0_($2, $$byval_copy) | 0) $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA22_KcEEEPNS0_4NodeEDpOT0_($0) | 0; else $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $2) | 0; + $$1 = $$0; + } else $$1 = 0; + STACKTOP = sp; + return $$1 | 0; +} + +function ___mo_lookup($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$090 = 0, $$094 = 0, $$4 = 0, $10 = 0, $13 = 0, $17 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $31 = 0, $35 = 0, $4 = 0, $44 = 0, $46 = 0, $49 = 0, $53 = 0, $63 = 0, $7 = 0; + $4 = (HEAP32[$0 >> 2] | 0) + 1794895138 | 0; + $7 = _swapc(HEAP32[$0 + 8 >> 2] | 0, $4) | 0; + $10 = _swapc(HEAP32[$0 + 12 >> 2] | 0, $4) | 0; + $13 = _swapc(HEAP32[$0 + 16 >> 2] | 0, $4) | 0; + L1 : do if (($7 >>> 0 < $1 >>> 2 >>> 0 ? ($17 = $1 - ($7 << 2) | 0, $10 >>> 0 < $17 >>> 0 & $13 >>> 0 < $17 >>> 0) : 0) ? (($13 | $10) & 3 | 0) == 0 : 0) { + $23 = $10 >>> 2; + $24 = $13 >>> 2; + $$090 = 0; + $$094 = $7; + while (1) { + $25 = $$094 >>> 1; + $26 = $$090 + $25 | 0; + $27 = $26 << 1; + $28 = $27 + $23 | 0; + $31 = _swapc(HEAP32[$0 + ($28 << 2) >> 2] | 0, $4) | 0; + $35 = _swapc(HEAP32[$0 + ($28 + 1 << 2) >> 2] | 0, $4) | 0; + if (!($35 >>> 0 < $1 >>> 0 & $31 >>> 0 < ($1 - $35 | 0) >>> 0)) { + $$4 = 0; + break L1; + } + if (HEAP8[$0 + ($35 + $31) >> 0] | 0) { + $$4 = 0; + break L1; + } + $44 = _strcmp($2, $0 + $35 | 0) | 0; + if (!$44) break; + $63 = ($44 | 0) < 0; + if (($$094 | 0) == 1) { + $$4 = 0; + break L1; + } + $$090 = $63 ? $$090 : $26; + $$094 = $63 ? $25 : $$094 - $25 | 0; + } + $46 = $27 + $24 | 0; + $49 = _swapc(HEAP32[$0 + ($46 << 2) >> 2] | 0, $4) | 0; + $53 = _swapc(HEAP32[$0 + ($46 + 1 << 2) >> 2] | 0, $4) | 0; + if ($53 >>> 0 < $1 >>> 0 & $49 >>> 0 < ($1 - $53 | 0) >>> 0) $$4 = (HEAP8[$0 + ($53 + $49) >> 0] | 0) == 0 ? $0 + $53 | 0 : 0; else $$4 = 0; + } else $$4 = 0; while (0); + return $$4 | 0; +} + +function __ZNK10__cxxabiv120__si_class_type_info16search_below_dstEPNS_19__dynamic_cast_infoEPKvib($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $13 = 0, $19 = 0, $22 = 0, $23 = 0, $25 = 0, $32 = 0, $33 = 0, $44 = 0; + L1 : do if (!(__ZL8is_equalPKSt9type_infoS1_b($0, HEAP32[$1 + 8 >> 2] | 0, $4) | 0)) { + if (!(__ZL8is_equalPKSt9type_infoS1_b($0, HEAP32[$1 >> 2] | 0, $4) | 0)) { + $44 = HEAP32[$0 + 8 >> 2] | 0; + FUNCTION_TABLE_viiiii[HEAP32[(HEAP32[$44 >> 2] | 0) + 24 >> 2] & 63]($44, $1, $2, $3, $4); + break; + } + if ((HEAP32[$1 + 16 >> 2] | 0) != ($2 | 0) ? ($13 = $1 + 20 | 0, (HEAP32[$13 >> 2] | 0) != ($2 | 0)) : 0) { + HEAP32[$1 + 32 >> 2] = $3; + $19 = $1 + 44 | 0; + do if ((HEAP32[$19 >> 2] | 0) != 4) { + $22 = $1 + 52 | 0; + HEAP8[$22 >> 0] = 0; + $23 = $1 + 53 | 0; + HEAP8[$23 >> 0] = 0; + $25 = HEAP32[$0 + 8 >> 2] | 0; + FUNCTION_TABLE_viiiiii[HEAP32[(HEAP32[$25 >> 2] | 0) + 20 >> 2] & 7]($25, $1, $2, $2, 1, $4); + if (HEAP8[$23 >> 0] | 0) { + $32 = (HEAP8[$22 >> 0] | 0) == 0; + HEAP32[$19 >> 2] = 3; + if ($32) break; else break L1; + } else { + HEAP32[$19 >> 2] = 4; + break; + } + } while (0); + HEAP32[$13 >> 2] = $2; + $33 = $1 + 40 | 0; + HEAP32[$33 >> 2] = (HEAP32[$33 >> 2] | 0) + 1; + if ((HEAP32[$1 + 36 >> 2] | 0) != 1) break; + if ((HEAP32[$1 + 24 >> 2] | 0) != 2) break; + HEAP8[$1 + 54 >> 0] = 1; + break; + } + if (($3 | 0) == 1) HEAP32[$1 + 32 >> 2] = 1; + } else __ZNK10__cxxabiv117__class_type_info29process_static_type_below_dstEPNS_19__dynamic_cast_infoEPKvi(0, $1, $2, $3); while (0); + return; +} + +function _jpeg_resync_to_restart($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$034$ph = 0, $$035 = 0, $14 = 0, $17 = 0, $2 = 0, $20 = 0, $23 = 0, $24 = 0, $3 = 0, $32 = 0, $4 = 0, $or$cond37 = 0, $spec$select36 = 0, label = 0; + $2 = $0 + 440 | 0; + $3 = HEAP32[$2 >> 2] | 0; + $4 = HEAP32[$0 >> 2] | 0; + HEAP32[$4 + 20 >> 2] = 124; + HEAP32[$4 + 24 >> 2] = $3; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = $1; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, -1); + $14 = $1 + 1 & 7 | 208; + $17 = $1 + 2 & 7 | 208; + $20 = $1 + 7 & 7 | 208; + $23 = $1 + 6 & 7 | 208; + $$034$ph = $3; + L1 : while (1) { + $24 = ($$034$ph | 0) < 192; + $or$cond37 = ($$034$ph & -8 | 0) != 208 | ($$034$ph | 0) == ($14 | 0) | ($$034$ph | 0) == ($17 | 0); + $spec$select36 = ($$034$ph | 0) == ($20 | 0) | ($$034$ph | 0) == ($23 | 0) ? 2 : 1; + L3 : while (1) { + $$0 = $24 ? 2 : $or$cond37 ? 3 : $spec$select36; + $32 = HEAP32[$0 >> 2] | 0; + HEAP32[$32 + 20 >> 2] = 99; + HEAP32[$32 + 24 >> 2] = $$034$ph; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = $$0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 4); + switch ($$0 & 3) { + case 1: + { + label = 4; + break L1; + break; + } + case 3: + { + $$035 = 1; + label = 7; + break L1; + break; + } + case 2: + { + break L3; + break; + } + default: + {} + } + } + if (!(_next_marker($0) | 0)) { + $$035 = 0; + label = 7; + break; + } + $$034$ph = HEAP32[$2 >> 2] | 0; + } + if ((label | 0) == 4) { + HEAP32[$2 >> 2] = 0; + $$035 = 1; + return $$035 | 0; + } else if ((label | 0) == 7) return $$035 | 0; + return 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle15ConditionalExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy3 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy3 = sp + 32 | 0; + $2 = sp + 24 | 0; + $3 = sp + 16 | 0; + $4 = sp + 8 | 0; + $5 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51968); + HEAP32[$$byval_copy3 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy3 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy3); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 53204); + HEAP32[$$byval_copy3 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy3 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy3); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 12 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 53210); + HEAP32[$$byval_copy3 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy3 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy3); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 16 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 51964); + HEAP32[$$byval_copy3 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy3 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy3); + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE21__push_back_slow_pathIRKS3_EEvOT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $14 = 0, $16 = 0, $19 = 0, $2 = 0, $24 = 0, $25 = 0, $3 = 0, $8 = 0, $9 = 0, dest = 0, sp = 0, src = 0, stop = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 4 | 0; + $8 = (((HEAP32[$3 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) | 0) / 36 | 0) + 1 | 0; + $9 = __ZNKSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE8max_sizeEv($0) | 0; + if ($9 >>> 0 < $8 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $14 = HEAP32[$0 >> 2] | 0; + $16 = ((HEAP32[$0 + 8 >> 2] | 0) - $14 | 0) / 36 | 0; + $19 = $16 << 1; + __ZNSt3__214__split_bufferIN6vision25DoGScaleInvariantDetector12FeaturePointERNS_9allocatorIS3_EEEC2EmmS6_($2, $16 >>> 0 < $9 >>> 1 >>> 0 ? ($19 >>> 0 < $8 >>> 0 ? $8 : $19) : $9, ((HEAP32[$3 >> 2] | 0) - $14 | 0) / 36 | 0, $0 + 8 | 0); + $24 = $2 + 8 | 0; + $25 = HEAP32[$24 >> 2] | 0; + dest = $25; + src = $1; + stop = dest + 36 | 0; + do { + HEAP32[dest >> 2] = HEAP32[src >> 2]; + dest = dest + 4 | 0; + src = src + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$24 >> 2] = $25 + 36; + __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS5_EE($0, $2); + __ZNSt3__214__split_bufferIN6vision25DoGScaleInvariantDetector12FeaturePointERNS_9allocatorIS3_EEED2Ev($2); + STACKTOP = sp; + return; + } +} + +function __ZN6vision25DoGScaleInvariantDetector5allocEPKNS_25GaussianScaleSpacePyramidE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $10 = 0, $12 = 0, $14 = 0, $15 = 0, $17 = 0, $19 = 0, $22 = 0, $23 = 0, $25 = 0, $4 = 0, $6 = 0, $7 = 0, $9 = 0; + __ZN6vision10DoGPyramid5allocEPKNS_25GaussianScaleSpacePyramidE($0 + 32 | 0, $1); + $4 = __ZNK6vision25GaussianScaleSpacePyramid6imagesEv($1) | 0; + $6 = __ZNK6vision5Image5widthEv(HEAP32[$4 >> 2] | 0) | 0; + $7 = __ZNK6vision25GaussianScaleSpacePyramid6imagesEv($1) | 0; + $9 = __ZNK6vision5Image6heightEv(HEAP32[$7 >> 2] | 0) | 0; + $10 = __ZNK6vision25GaussianScaleSpacePyramid10numOctavesEv($1) | 0; + __ZN6vision21OrientationAssignment5allocEmmiiiffif($0 + 92 | 0, $6, $9, $10, __ZNK6vision25GaussianScaleSpacePyramid18numScalesPerOctaveEv($1) | 0, 36, 3.0, 1.5, 5, .800000011920929); + $12 = __ZNK6vision25GaussianScaleSpacePyramid6imagesEv($1) | 0; + $14 = __ZNK6vision5Image5widthEv(HEAP32[$12 >> 2] | 0) | 0; + HEAP32[$0 >> 2] = $14; + $15 = __ZNK6vision25GaussianScaleSpacePyramid6imagesEv($1) | 0; + $17 = __ZNK6vision5Image6heightEv(HEAP32[$15 >> 2] | 0) | 0; + HEAP32[$0 + 4 >> 2] = $17; + $19 = $0 + 16 | 0; + __ZNSt3__26vectorINS0_INS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEEENS3_IS7_EEE6resizeEm($19, HEAP32[$0 + 8 >> 2] | 0); + $22 = $0 + 20 | 0; + $23 = $0 + 12 | 0; + $$0 = 0; + while (1) { + $25 = HEAP32[$19 >> 2] | 0; + if ($$0 >>> 0 >= (((HEAP32[$22 >> 2] | 0) - $25 | 0) / 12 | 0) >>> 0) break; + __ZNSt3__26vectorINS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEE6resizeEm($25 + ($$0 * 12 | 0) | 0, HEAP32[$23 >> 2] | 0); + $$0 = $$0 + 1 | 0; + } + return; +} + +function _init_error_limit($0) { + $0 = $0 | 0; + var $$14042 = 0, $$143 = 0, $$241 = 0, $2 = 0, $47 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 484 >> 2] | 0; + $6 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$0 + 4 >> 2] >> 2] & 63]($0, 1, 2044) | 0; + $7 = $6 + 1020 | 0; + HEAP32[$2 + 40 >> 2] = $7; + HEAP32[$7 >> 2] = 0; + HEAP32[$6 + 1024 >> 2] = 1; + HEAP32[$6 + 1016 >> 2] = -1; + HEAP32[$6 + 1028 >> 2] = 2; + HEAP32[$6 + 1012 >> 2] = -2; + HEAP32[$6 + 1032 >> 2] = 3; + HEAP32[$6 + 1008 >> 2] = -3; + HEAP32[$6 + 1036 >> 2] = 4; + HEAP32[$6 + 1004 >> 2] = -4; + HEAP32[$6 + 1040 >> 2] = 5; + HEAP32[$6 + 1e3 >> 2] = -5; + HEAP32[$6 + 1044 >> 2] = 6; + HEAP32[$6 + 996 >> 2] = -6; + HEAP32[$6 + 1048 >> 2] = 7; + HEAP32[$6 + 992 >> 2] = -7; + HEAP32[$6 + 1052 >> 2] = 8; + HEAP32[$6 + 988 >> 2] = -8; + HEAP32[$6 + 1056 >> 2] = 9; + HEAP32[$6 + 984 >> 2] = -9; + HEAP32[$6 + 1060 >> 2] = 10; + HEAP32[$6 + 980 >> 2] = -10; + HEAP32[$6 + 1064 >> 2] = 11; + HEAP32[$6 + 976 >> 2] = -11; + HEAP32[$6 + 1068 >> 2] = 12; + HEAP32[$6 + 972 >> 2] = -12; + HEAP32[$6 + 1072 >> 2] = 13; + HEAP32[$6 + 968 >> 2] = -13; + HEAP32[$6 + 1076 >> 2] = 14; + HEAP32[$6 + 964 >> 2] = -14; + HEAP32[$6 + 1080 >> 2] = 15; + HEAP32[$6 + 960 >> 2] = -15; + $$14042 = 16; + $$143 = 16; + do { + HEAP32[$7 + ($$14042 << 2) >> 2] = $$143; + HEAP32[$7 + (0 - $$14042 << 2) >> 2] = 0 - $$143; + $$14042 = $$14042 + 1 | 0; + $$143 = ($$14042 & 1 ^ 1) + $$143 | 0; + } while (($$14042 | 0) != 48); + $47 = 0 - $$143 | 0; + $$241 = 48; + do { + HEAP32[$7 + ($$241 << 2) >> 2] = $$143; + HEAP32[$7 + (0 - $$241 << 2) >> 2] = $47; + $$241 = $$241 + 1 | 0; + } while (($$241 | 0) != 256); + return; +} + +function _arMatrixPCA($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$064 = 0, $$065 = 0.0, $$1 = 0, $$2 = 0, $18 = 0, $24 = 0, $27 = 0.0, $32 = 0, $35 = 0, $39 = 0, $40 = 0, $49 = 0, $5 = 0, $7 = 0, $9 = 0; + $5 = HEAP32[$0 + 4 >> 2] | 0; + $7 = HEAP32[$0 + 8 >> 2] | 0; + $9 = ($5 | 0) < ($7 | 0) ? $5 : $7; + L1 : do if (((((!(($5 | 0) < 2 | ($7 | 0) < 2) ? (HEAP32[$1 + 8 >> 2] | 0) == ($7 | 0) : 0) ? (HEAP32[$1 + 4 >> 2] | 0) == ($9 | 0) : 0) ? ($18 = $2 + 4 | 0, (HEAP32[$18 >> 2] | 0) == ($9 | 0)) : 0) ? (HEAP32[$3 + 4 >> 2] | 0) == ($7 | 0) : 0) ? ($24 = _arMatrixAllocDup($0) | 0, ($24 | 0) != 0) : 0) { + $27 = +Math_sqrt(+(+($5 | 0))); + if ((_EX($24, $3) | 0) < 0) { + _arMatrixFree($24) | 0; + $$064 = -1; + break; + } + if ((_CENTER($24, $3) | 0) < 0) { + _arMatrixFree($24) | 0; + $$064 = -1; + break; + } + $32 = Math_imul($7, $5) | 0; + $$0 = 0; + while (1) { + if (($$0 | 0) >= ($32 | 0)) break; + $35 = (HEAP32[$24 >> 2] | 0) + ($$0 << 3) | 0; + HEAPF64[$35 >> 3] = +HEAPF64[$35 >> 3] / $27; + $$0 = $$0 + 1 | 0; + } + $39 = _PCA($24, $1, $2) | 0; + _arMatrixFree($24) | 0; + $40 = HEAP32[$18 >> 2] | 0; + $$065 = 0.0; + $$1 = 0; + while (1) { + if (($$1 | 0) >= ($40 | 0)) break; + $$065 = $$065 + +HEAPF64[(HEAP32[$2 >> 2] | 0) + ($$1 << 3) >> 3]; + $$1 = $$1 + 1 | 0; + } + $$2 = 0; + while (1) { + if (($$2 | 0) >= ($40 | 0)) { + $$064 = $39; + break L1; + } + $49 = (HEAP32[$2 >> 2] | 0) + ($$2 << 3) | 0; + HEAPF64[$49 >> 3] = +HEAPF64[$49 >> 3] / $$065; + $$2 = $$2 + 1 | 0; + } + } else $$064 = -1; while (0); + return $$064 | 0; +} + +function _setup($width, $height, $cameraID) { + $width = $width | 0; + $height = $height | 0; + $cameraID = $cameraID | 0; + var $0 = 0, $call = 0, $call10 = 0, $call7 = 0, $call9 = 0, $id = 0, $mul4 = 0, $vararg_buffer1 = 0, $videoFrame = 0, $videoFrameSize = 0, $videoLuma = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer1 = sp + 8 | 0; + $id = sp + 12 | 0; + $0 = HEAP32[16326] | 0; + HEAP32[16326] = $0 + 1; + HEAP32[$id >> 2] = $0; + $call = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id) | 0; + HEAP32[$call >> 2] = HEAP32[$id >> 2]; + HEAP32[$call + 208 >> 2] = $width; + HEAP32[$call + 212 >> 2] = $height; + $mul4 = Math_imul($width << 2, $height) | 0; + $videoFrameSize = $call + 200 | 0; + HEAP32[$videoFrameSize >> 2] = $mul4; + $call7 = _malloc($mul4) | 0; + $videoFrame = $call + 196 | 0; + HEAP32[$videoFrame >> 2] = $call7; + $call9 = _malloc((HEAP32[$videoFrameSize >> 2] | 0) / 4 | 0) | 0; + $videoLuma = $call + 204 | 0; + HEAP32[$videoLuma >> 2] = $call9; + $call10 = _arPattCreateHandle() | 0; + HEAP32[$call + 220 >> 2] = $call10; + if (!$call10) _arLog(0, 3, 45426, sp); + _setCamera(HEAP32[$id >> 2] | 0, $cameraID) | 0; + HEAP32[$vararg_buffer1 >> 2] = HEAP32[$videoFrameSize >> 2]; + _arLog(0, 1, 45463, $vararg_buffer1); + _emscripten_asm_const_iiiiiii(0, HEAP32[$call >> 2] | 0, HEAP32[$videoFrame >> 2] | 0, HEAP32[$videoFrameSize >> 2] | 0, $call + 344 | 0, 61136, HEAP32[$videoLuma >> 2] | 0) | 0; + STACKTOP = sp; + return HEAP32[$call >> 2] | 0; +} + +function __ZNKSt3__28time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0$i$i = 0, $$0$i$i$i$i = 0, $$sroa$04$0$i = 0, $$sroa$04$1$i = 0, $11 = 0, $14 = 0, $16 = 0, $17 = 0, $23 = 0, $24 = 0, $29 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 416 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(416); + $7 = sp; + $8 = sp + 400 | 0; + HEAP32[$8 >> 2] = $7 + 400; + __ZNKSt3__210__time_put8__do_putEPwRS1_PK2tmcc($0 + 8 | 0, $7, $8, $4, $5, $6); + $11 = HEAP32[$8 >> 2] | 0; + $$0$i$i = $7; + $$sroa$04$0$i = HEAP32[$1 >> 2] | 0; + while (1) { + if (($$0$i$i | 0) == ($11 | 0)) break; + $14 = HEAP32[$$0$i$i >> 2] | 0; + if (!$$sroa$04$0$i) $$sroa$04$1$i = 0; else { + $16 = $$sroa$04$0$i + 24 | 0; + $17 = HEAP32[$16 >> 2] | 0; + if (($17 | 0) == (HEAP32[$$sroa$04$0$i + 28 >> 2] | 0)) { + $23 = HEAP32[(HEAP32[$$sroa$04$0$i >> 2] | 0) + 52 >> 2] | 0; + $24 = __ZNSt3__211char_traitsIwE11to_int_typeEw($14) | 0; + $$0$i$i$i$i = FUNCTION_TABLE_iii[$23 & 127]($$sroa$04$0$i, $24) | 0; + } else { + HEAP32[$16 >> 2] = $17 + 4; + HEAP32[$17 >> 2] = $14; + $$0$i$i$i$i = __ZNSt3__211char_traitsIwE11to_int_typeEw($14) | 0; + } + $29 = __ZNSt3__211char_traitsIwE11eq_int_typeEjj($$0$i$i$i$i, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0; + $$sroa$04$1$i = $29 ? 0 : $$sroa$04$0$i; + } + $$0$i$i = $$0$i$i + 4 | 0; + $$sroa$04$0$i = $$sroa$04$1$i; + } + STACKTOP = sp; + return $$sroa$04$0$i | 0; +} + +function __ZNKSt3__28time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0$i$i = 0, $$0$i$i$i$i = 0, $$sroa$04$0$i = 0, $$sroa$04$1$i = 0, $11 = 0, $14 = 0, $16 = 0, $17 = 0, $23 = 0, $24 = 0, $29 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 112 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(112); + $7 = sp; + $8 = sp + 100 | 0; + HEAP32[$8 >> 2] = $7 + 100; + __ZNKSt3__210__time_put8__do_putEPcRS1_PK2tmcc($0 + 8 | 0, $7, $8, $4, $5, $6); + $11 = HEAP32[$8 >> 2] | 0; + $$0$i$i = $7; + $$sroa$04$0$i = HEAP32[$1 >> 2] | 0; + while (1) { + if (($$0$i$i | 0) == ($11 | 0)) break; + $14 = HEAP8[$$0$i$i >> 0] | 0; + if (!$$sroa$04$0$i) $$sroa$04$1$i = 0; else { + $16 = $$sroa$04$0$i + 24 | 0; + $17 = HEAP32[$16 >> 2] | 0; + if (($17 | 0) == (HEAP32[$$sroa$04$0$i + 28 >> 2] | 0)) { + $23 = HEAP32[(HEAP32[$$sroa$04$0$i >> 2] | 0) + 52 >> 2] | 0; + $24 = __ZNSt3__211char_traitsIcE11to_int_typeEc($14) | 0; + $$0$i$i$i$i = FUNCTION_TABLE_iii[$23 & 127]($$sroa$04$0$i, $24) | 0; + } else { + HEAP32[$16 >> 2] = $17 + 1; + HEAP8[$17 >> 0] = $14; + $$0$i$i$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc($14) | 0; + } + $29 = __ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0; + $$sroa$04$1$i = $29 ? 0 : $$sroa$04$0$i; + } + $$0$i$i = $$0$i$i + 1 | 0; + $$sroa$04$0$i = $$sroa$04$1$i; + } + STACKTOP = sp; + return $$sroa$04$0$i | 0; +} + +function __ZN6vision24OrthogonalizeIdentity8x9IfEEbPT_PKS1_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $12 = 0.0, $15 = 0.0, $18 = 0.0, $2 = 0, $21 = 0.0, $24 = 0.0, $27 = 0.0, $29 = 0, $3 = 0, $4 = 0.0, $6 = 0.0, $9 = 0.0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 384 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(384); + $2 = sp + 336 | 0; + $3 = sp; + $4 = +__ZN6vision24OrthogonalizeIdentity8x9IfEET_PS1_PKS1_i($3, $1, 0); + HEAPF32[$2 >> 2] = $4; + $6 = +__ZN6vision24OrthogonalizeIdentity8x9IfEET_PS1_PKS1_i($3 + 36 | 0, $1, 1); + HEAPF32[$2 + 4 >> 2] = $6; + $9 = +__ZN6vision24OrthogonalizeIdentity8x9IfEET_PS1_PKS1_i($3 + 72 | 0, $1, 2); + HEAPF32[$2 + 8 >> 2] = $9; + $12 = +__ZN6vision24OrthogonalizeIdentity8x9IfEET_PS1_PKS1_i($3 + 108 | 0, $1, 3); + HEAPF32[$2 + 12 >> 2] = $12; + $15 = +__ZN6vision24OrthogonalizeIdentity8x9IfEET_PS1_PKS1_i($3 + 144 | 0, $1, 4); + HEAPF32[$2 + 16 >> 2] = $15; + $18 = +__ZN6vision24OrthogonalizeIdentity8x9IfEET_PS1_PKS1_i($3 + 180 | 0, $1, 5); + HEAPF32[$2 + 20 >> 2] = $18; + $21 = +__ZN6vision24OrthogonalizeIdentity8x9IfEET_PS1_PKS1_i($3 + 216 | 0, $1, 6); + HEAPF32[$2 + 24 >> 2] = $21; + $24 = +__ZN6vision24OrthogonalizeIdentity8x9IfEET_PS1_PKS1_i($3 + 252 | 0, $1, 7); + HEAPF32[$2 + 28 >> 2] = $24; + $27 = +__ZN6vision24OrthogonalizeIdentity8x9IfEET_PS1_PKS1_i($3 + 288 | 0, $1, 8); + HEAPF32[$2 + 32 >> 2] = $27; + $29 = __ZN6vision9MaxIndex9IfEEiPKT_($2) | 0; + if (+HEAPF32[$2 + ($29 << 2) >> 2] == 0.0) $$0 = 0; else { + __ZN6vision11CopyVector9IfEEvPT_PKS1_($0, $3 + ($29 * 9 << 2) | 0); + $$0 = 1; + } + STACKTOP = sp; + return $$0 | 0; +} + +function __ZL28demangling_terminate_handlerv() { + var $0 = 0, $1 = 0, $15 = 0, $16 = 0, $18 = 0, $23 = 0, $27 = 0, $3 = 0, $6 = 0, $8 = 0, $vararg_buffer = 0, $vararg_buffer10 = 0, $vararg_buffer3 = 0, $vararg_buffer7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $vararg_buffer10 = sp + 32 | 0; + $vararg_buffer7 = sp + 24 | 0; + $vararg_buffer3 = sp + 16 | 0; + $vararg_buffer = sp; + $0 = sp + 36 | 0; + $1 = ___cxa_get_globals_fast() | 0; + if ($1 | 0 ? ($3 = HEAP32[$1 >> 2] | 0, $3 | 0) : 0) { + $6 = $3 + 48 | 0; + if (!(__ZN10__cxxabiv121__isOurExceptionClassEPK17_Unwind_Exception($6) | 0)) { + HEAP32[$vararg_buffer7 >> 2] = 50980; + _abort_message(50930, $vararg_buffer7); + } + $8 = __ZN10__cxxabiv119__getExceptionClassEPK17_Unwind_Exception($6) | 0; + if (($8 | 0) == 1126902529 & (getTempRet0() | 0) == 1129074247) $15 = HEAP32[$3 + 44 >> 2] | 0; else $15 = $3 + 80 | 0; + HEAP32[$0 >> 2] = $15; + $16 = HEAP32[$3 >> 2] | 0; + $18 = HEAP32[$16 + 4 >> 2] | 0; + if (FUNCTION_TABLE_iiii[HEAP32[(HEAP32[3470] | 0) + 16 >> 2] & 63](13880, $16, $0) | 0) { + $23 = HEAP32[$0 >> 2] | 0; + $27 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$23 >> 2] | 0) + 8 >> 2] & 127]($23) | 0; + HEAP32[$vararg_buffer >> 2] = 50980; + HEAP32[$vararg_buffer + 4 >> 2] = $18; + HEAP32[$vararg_buffer + 8 >> 2] = $27; + _abort_message(50844, $vararg_buffer); + } else { + HEAP32[$vararg_buffer3 >> 2] = 50980; + HEAP32[$vararg_buffer3 + 4 >> 2] = $18; + _abort_message(50889, $vararg_buffer3); + } + } + _abort_message(50968, $vararg_buffer10); +} + +function __ZNSt3__29__sift_upIRNS_4lessIN6vision17PriorityQueueItemILi96EEEEENS_11__wrap_iterIPS4_EEEEvT0_SA_T_NS_15iterator_traitsISA_E15difference_typeE($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$sroa$0$0$in = 0, $11 = 0, $13 = 0, $18 = 0, $19 = 0, $23 = 0, $28 = 0, $29 = 0, $30 = 0, $30$phi = 0, $37 = 0, $39 = 0, $4 = 0, $44 = 0, $45 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp; + if (($3 | 0) > 1 ? ($7 = ($3 + -2 | 0) / 2 | 0, $8 = HEAP32[$0 >> 2] | 0, $9 = $8 + ($7 << 3) | 0, $11 = (HEAP32[$1 >> 2] | 0) + -8 | 0, HEAP32[$1 >> 2] = $11, __ZNK6vision17PriorityQueueItemILi96EEltERKS1_($9, $11) | 0) : 0) { + $13 = $11; + $18 = HEAP32[$13 + 4 >> 2] | 0; + $19 = $4; + HEAP32[$19 >> 2] = HEAP32[$13 >> 2]; + HEAP32[$19 + 4 >> 2] = $18; + $$0 = $7; + $$sroa$0$0$in = $9; + $30 = $11; + while (1) { + $23 = $$sroa$0$0$in; + $28 = HEAP32[$23 + 4 >> 2] | 0; + $29 = $30; + HEAP32[$29 >> 2] = HEAP32[$23 >> 2]; + HEAP32[$29 + 4 >> 2] = $28; + HEAP32[$1 >> 2] = $$sroa$0$0$in; + if (!$$0) break; + $$0 = ($$0 + -1 | 0) / 2 | 0; + $37 = $8 + ($$0 << 3) | 0; + if (!(__ZNK6vision17PriorityQueueItemILi96EEltERKS1_($37, $4) | 0)) break; else { + $30$phi = $$sroa$0$0$in; + $$sroa$0$0$in = $37; + $30 = $30$phi; + } + } + $39 = $4; + $44 = HEAP32[$39 + 4 >> 2] | 0; + $45 = $$sroa$0$0$in; + HEAP32[$45 >> 2] = HEAP32[$39 >> 2]; + HEAP32[$45 + 4 >> 2] = $44; + __ZN6vision17PriorityQueueItemILi96EED2Ev($4); + } + STACKTOP = sp; + return; +} + +function _post_process_2pass($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$1 = 0, $$pre$phi43Z2D = 0, $$pre$phiZ2D = 0, $10 = 0, $18 = 0, $20 = 0, $22 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $33 = 0, $40 = 0, $45 = 0, $46 = 0, $8 = 0, $9 = 0, $spec$select = 0; + $8 = HEAP32[$0 + 456 >> 2] | 0; + $9 = $8 + 24 | 0; + $10 = HEAP32[$9 >> 2] | 0; + if (!$10) { + $18 = $8 + 20 | 0; + $20 = $8 + 16 | 0; + $22 = FUNCTION_TABLE_iiiiii[HEAP32[(HEAP32[$0 + 4 >> 2] | 0) + 28 >> 2] & 31]($0, HEAP32[$8 + 8 >> 2] | 0, HEAP32[$18 >> 2] | 0, HEAP32[$20 >> 2] | 0, 0) | 0; + HEAP32[$8 + 12 >> 2] = $22; + $$pre$phi43Z2D = $18; + $$pre$phiZ2D = $20; + $26 = HEAP32[$9 >> 2] | 0; + $40 = $22; + } else { + $$pre$phi43Z2D = $8 + 20 | 0; + $$pre$phiZ2D = $8 + 16 | 0; + $26 = $10; + $40 = HEAP32[$8 + 12 >> 2] | 0; + } + $25 = (HEAP32[$$pre$phiZ2D >> 2] | 0) - $26 | 0; + $27 = HEAP32[$5 >> 2] | 0; + $28 = $6 - $27 | 0; + $spec$select = $25 >>> 0 > $28 >>> 0 ? $28 : $25; + $33 = (HEAP32[$0 + 116 >> 2] | 0) - (HEAP32[$$pre$phi43Z2D >> 2] | 0) | 0; + $$1 = $spec$select >>> 0 > $33 >>> 0 ? $33 : $spec$select; + FUNCTION_TABLE_viiii[HEAP32[(HEAP32[$0 + 484 >> 2] | 0) + 4 >> 2] & 31]($0, $40 + ($26 << 2) | 0, $4 + ($27 << 2) | 0, $$1); + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + $$1; + $45 = (HEAP32[$9 >> 2] | 0) + $$1 | 0; + HEAP32[$9 >> 2] = $45; + $46 = HEAP32[$$pre$phiZ2D >> 2] | 0; + if ($45 >>> 0 < $46 >>> 0) return; + HEAP32[$$pre$phi43Z2D >> 2] = (HEAP32[$$pre$phi43Z2D >> 2] | 0) + $46; + HEAP32[$9 >> 2] = 0; + return; +} + +function _ar2GetSearchPoint($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$sink = 0, $10 = 0, $11 = 0, $13 = 0.0, $15 = 0.0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $6 = sp + 20 | 0; + $7 = sp + 16 | 0; + $8 = sp + 12 | 0; + $9 = sp + 8 | 0; + $10 = sp + 4 | 0; + $11 = sp; + $13 = +HEAPF32[$4 + 8 >> 2]; + $15 = +HEAPF32[$4 + 12 >> 2]; + if (($1 | 0) != 0 ? (_ar2MarkerCoord2ScreenCoord($0, $1, $13, $15, $6, $9) | 0) >= 0 : 0) { + HEAP32[$5 >> 2] = ~~+HEAPF32[$6 >> 2]; + HEAP32[$5 + 4 >> 2] = ~~+HEAPF32[$9 >> 2]; + if (($2 | 0) != 0 ? (_ar2MarkerCoord2ScreenCoord($0, $2, $13, $15, $7, $10) | 0) >= 0 : 0) { + HEAP32[$5 + 8 >> 2] = ~~(+HEAPF32[$6 >> 2] * 2.0 - +HEAPF32[$7 >> 2]); + HEAP32[$5 + 12 >> 2] = ~~(+HEAPF32[$9 >> 2] * 2.0 - +HEAPF32[$10 >> 2]); + if (($3 | 0) != 0 ? (_ar2MarkerCoord2ScreenCoord($0, $3, $13, $15, $8, $11) | 0) >= 0 : 0) { + HEAP32[$5 + 16 >> 2] = ~~(+HEAPF32[$8 >> 2] + (+HEAPF32[$6 >> 2] * 3.0 - +HEAPF32[$7 >> 2] * 3.0)); + $$sink = ~~(+HEAPF32[$11 >> 2] + (+HEAPF32[$9 >> 2] * 3.0 - +HEAPF32[$10 >> 2] * 3.0)); + } else label = 10; + } else label = 9; + } else { + HEAP32[$5 >> 2] = -1; + HEAP32[$5 + 4 >> 2] = -1; + label = 9; + } + if ((label | 0) == 9) { + HEAP32[$5 + 8 >> 2] = -1; + HEAP32[$5 + 12 >> 2] = -1; + label = 10; + } + if ((label | 0) == 10) { + HEAP32[$5 + 16 >> 2] = -1; + $$sink = -1; + } + HEAP32[$5 + 20 >> 2] = $$sink; + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorINS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEE8__appendEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $13 = 0, $14 = 0, $18 = 0, $2 = 0, $20 = 0, $23 = 0, $3 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 8 | 0; + $5 = $0 + 4 | 0; + $6 = HEAP32[$5 >> 2] | 0; + do if ((((HEAP32[$3 >> 2] | 0) - $6 | 0) / 12 | 0) >>> 0 < $1 >>> 0) { + $13 = (($6 - (HEAP32[$0 >> 2] | 0) | 0) / 12 | 0) + $1 | 0; + $14 = __ZNKSt3__26vectorINS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEE8max_sizeEv($0) | 0; + if ($14 >>> 0 < $13 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $18 = HEAP32[$0 >> 2] | 0; + $20 = ((HEAP32[$3 >> 2] | 0) - $18 | 0) / 12 | 0; + $23 = $20 << 1; + __ZNSt3__214__split_bufferINS_6vectorINS_4pairIfmEENS_9allocatorIS3_EEEERNS4_IS6_EEEC2EmmS8_($2, $20 >>> 0 < $14 >>> 1 >>> 0 ? ($23 >>> 0 < $13 >>> 0 ? $13 : $23) : $14, ((HEAP32[$5 >> 2] | 0) - $18 | 0) / 12 | 0, $0 + 8 | 0); + __ZNSt3__214__split_bufferINS_6vectorINS_4pairIfmEENS_9allocatorIS3_EEEERNS4_IS6_EEE18__construct_at_endEm($2, $1); + __ZNSt3__26vectorINS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS5_RS6_EE($0, $2); + __ZNSt3__214__split_bufferINS_6vectorINS_4pairIfmEENS_9allocatorIS3_EEEERNS4_IS6_EEED2Ev($2); + break; + } + } else __ZNSt3__26vectorINS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEE18__construct_at_endEm($0, $1); while (0); + STACKTOP = sp; + return; +} + +function __ZN6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEE5queryERKNS_5ImageE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $11 = 0, $14 = 0, $16 = 0, $19 = 0, $2 = 0, $21 = 0, $22 = 0, $25 = 0, $3 = 0, $4 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 92 | 0; + $4 = __ZN6vision25GaussianScaleSpacePyramid6imagesEv($3) | 0; + if (((HEAP32[$4 + 4 >> 2] | 0) != (HEAP32[$4 >> 2] | 0) ? ($9 = __ZN6vision25GaussianScaleSpacePyramid6imagesEv($3) | 0, $11 = __ZNK6vision5Image5widthEv(HEAP32[$9 >> 2] | 0) | 0, ($11 | 0) == (__ZNK6vision5Image5widthEv($1) | 0)) : 0) ? ($14 = __ZN6vision25GaussianScaleSpacePyramid6imagesEv($3) | 0, $16 = __ZNK6vision5Image6heightEv(HEAP32[$14 >> 2] | 0) | 0, ($16 | 0) == (__ZNK6vision5Image6heightEv($1) | 0)) : 0) {} else { + $19 = __ZNK6vision5Image5widthEv($1) | 0; + $21 = __ZN6vision10numOctavesEiii($19, __ZNK6vision5Image6heightEv($1) | 0, 8) | 0; + $22 = __ZNK6vision5Image5widthEv($1) | 0; + __ZN6vision18BinomialPyramid32f5allocEmmi($3, $22, __ZNK6vision5Image6heightEv($1) | 0, $21); + } + __ZN6vision11ScopedTimerC2EPKc($2, 33175); + if (__ZN6vision11ScopedTimercvbEv($2) | 0) __ZN6vision18BinomialPyramid32f5buildERKNS_5ImageE($3, $1); + __ZN6vision11ScopedTimerD2Ev($2); + $25 = __ZN6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEE5queryEPKNS_25GaussianScaleSpacePyramidE($0, $3) | 0; + STACKTOP = sp; + return $25 | 0; +} + +function ___cxa_demangle($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$023 = 0, $$024 = 0, $12 = 0, $15 = 0, $4 = 0, $5 = 0, $8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 4496 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(4496); + $4 = sp; + $5 = sp + 4472 | 0; + if (($0 | 0) != 0 ? ($8 = ($2 | 0) == 0, !(($1 | 0) != 0 & $8)) : 0) { + __ZN12_GLOBAL__N_116itanium_demangle14ManglingParserINS_16DefaultAllocatorEECI2NS0_22AbstractManglingParserIS3_S2_EEEPKcS6_($4, $0, $0 + (_strlen($0) | 0) | 0); + __ZN12_GLOBAL__N_112OutputStreamC2Ev($5); + $12 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E5parseEv($4) | 0; + if ($12) if (__ZN12_GLOBAL__N_122initializeOutputStreamEPcPmRNS_12OutputStreamEm($1, $2, $5) | 0) { + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE($12, $5); + __ZN12_GLOBAL__N_112OutputStreampLEc($5, 0); + if (!$8) { + $15 = __ZNK12_GLOBAL__N_112OutputStream18getCurrentPositionEv($5) | 0; + HEAP32[$2 >> 2] = $15; + } + $$023 = 0; + $$024 = __ZN12_GLOBAL__N_112OutputStream9getBufferEv($5) | 0; + } else { + $$023 = -1; + $$024 = $1; + } else { + $$023 = -2; + $$024 = $1; + } + if ($3 | 0) HEAP32[$3 >> 2] = $$023; + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_ED2Ev($4); + $$0 = ($$023 | 0) == 0 ? $$024 : 0; + } else if (!$3) $$0 = 0; else { + HEAP32[$3 >> 2] = -3; + $$0 = 0; + } + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNSt3__216__selection_sortIRNS_7greaterINS_4pairIfmEEEENS_11__wrap_iterIPS3_EEEEvT0_S9_T_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$sroa$0$0$copyload$i = 0, $$sroa$0$0$copyload6$i$ph = 0, $$sroa$0$0$ptr$i = 0, $11 = 0.0, $12 = 0.0, $20 = 0, $22 = 0, $23 = 0, $24 = 0, $26 = 0, $3 = 0, $4 = 0, $6 = 0, $8 = 0, $9 = 0; + $3 = HEAP32[$1 >> 2] | 0; + $4 = $3 + -8 | 0; + $6 = HEAP32[$0 >> 2] | 0; + while (1) { + if (($6 | 0) == ($4 | 0)) break; + L4 : do if (($6 | 0) == ($3 | 0)) $$sroa$0$0$copyload$i = $3; else { + $$sroa$0$0$copyload6$i$ph = $6; + while (1) { + $8 = $$sroa$0$0$copyload6$i$ph + 4 | 0; + $$sroa$0$0$ptr$i = $$sroa$0$0$copyload6$i$ph; + while (1) { + $9 = $$sroa$0$0$ptr$i + 8 | 0; + if (($9 | 0) == ($3 | 0)) { + $$sroa$0$0$copyload$i = $$sroa$0$0$copyload6$i$ph; + break L4; + } + $11 = +HEAPF32[$$sroa$0$0$copyload6$i$ph >> 2]; + $12 = +HEAPF32[$9 >> 2]; + if ($11 < $12) break; + if (!($12 < $11) ? (HEAP32[$8 >> 2] | 0) >>> 0 < (HEAP32[$$sroa$0$0$ptr$i + 12 >> 2] | 0) >>> 0 : 0) break; + $$sroa$0$0$ptr$i = $9; + } + $$sroa$0$0$copyload6$i$ph = $9; + } + } while (0); + if (($$sroa$0$0$copyload$i | 0) != ($6 | 0)) { + $20 = HEAP32[$6 >> 2] | 0; + HEAP32[$6 >> 2] = HEAP32[$$sroa$0$0$copyload$i >> 2]; + HEAP32[$$sroa$0$0$copyload$i >> 2] = $20; + $22 = $6 + 4 | 0; + $23 = $$sroa$0$0$copyload$i + 4 | 0; + $24 = HEAP32[$22 >> 2] | 0; + HEAP32[$22 >> 2] = HEAP32[$23 >> 2]; + HEAP32[$23 >> 2] = $24; + } + $26 = $6 + 8 | 0; + HEAP32[$0 >> 2] = $26; + $6 = $26; + } + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle19PointerToMemberType9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy2 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy2 = sp + 24 | 0; + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp; + $5 = $0 + 12 | 0; + $6 = HEAP32[$5 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$6 >> 2] | 0) + 16 >> 2] & 255]($6, $1); + if (!(__ZNK12_GLOBAL__N_116itanium_demangle4Node8hasArrayERNS_12OutputStreamE(HEAP32[$5 >> 2] | 0, $1) | 0) ? !(__ZNK12_GLOBAL__N_116itanium_demangle4Node11hasFunctionERNS_12OutputStreamE(HEAP32[$5 >> 2] | 0, $1) | 0) : 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 51966); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + } else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51968); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + } + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 55865); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorI12multi_markerNS_9allocatorIS1_EEE21__push_back_slow_pathIRKS1_EEvOT_($this, $__x) { + $this = $this | 0; + $__x = $__x | 0; + var $11 = 0, $12 = 0, $3 = 0, $6 = 0, $__end_ = 0, $__end_$i = 0, $__v = 0, $add = 0, $call$i = 0, $mul$i = 0, $sub$ptr$sub$i$i$i = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $__v = sp; + $__end_$i = $this + 4 | 0; + $add = ((HEAP32[$__end_$i >> 2] | 0) - (HEAP32[$this >> 2] | 0) >> 3) + 1 | 0; + $call$i = __ZNKSt3__26vectorI12multi_markerNS_9allocatorIS1_EEE8max_sizeEv($this) | 0; + if ($call$i >>> 0 < $add >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($this); else { + $3 = HEAP32[$this >> 2] | 0; + $sub$ptr$sub$i$i$i = (HEAP32[$this + 8 >> 2] | 0) - $3 | 0; + $mul$i = $sub$ptr$sub$i$i$i >> 2; + __ZNSt3__214__split_bufferI12multi_markerRNS_9allocatorIS1_EEEC2EmmS4_($__v, $sub$ptr$sub$i$i$i >> 3 >>> 0 < $call$i >>> 1 >>> 0 ? ($mul$i >>> 0 < $add >>> 0 ? $add : $mul$i) : $call$i, (HEAP32[$__end_$i >> 2] | 0) - $3 >> 3, $this + 8 | 0); + $__end_ = $__v + 8 | 0; + $6 = $__x; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = HEAP32[$__end_ >> 2] | 0; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + HEAP32[$__end_ >> 2] = (HEAP32[$__end_ >> 2] | 0) + 8; + __ZNSt3__26vectorI12multi_markerNS_9allocatorIS1_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS1_RS3_EE($this, $__v); + __ZNSt3__214__split_bufferI12multi_markerRNS_9allocatorIS1_EEED2Ev($__v); + STACKTOP = sp; + return; + } +} + +function _color_quantize($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$04147$us$us101 = 0, $$04252$us$us91 = 0, $$04356 = 0, $$04356$us74 = 0, $$04451$us$us92 = 0, $$04550$us$us93 = 0, $$048$us$us100 = 0, $$146$us$us102 = 0, $11 = 0, $7 = 0, $9 = 0; + $7 = HEAP32[(HEAP32[$0 + 484 >> 2] | 0) + 24 >> 2] | 0; + $9 = HEAP32[$0 + 112 >> 2] | 0; + $11 = HEAP32[$0 + 120 >> 2] | 0; + if (($3 | 0) < 1 | ($9 | 0) == 0) return; + if (($11 | 0) <= 0) { + $$04356 = 0; + do { + _memset(HEAP32[$2 + ($$04356 << 2) >> 2] | 0, 0, $9 | 0) | 0; + $$04356 = $$04356 + 1 | 0; + } while (($$04356 | 0) != ($3 | 0)); + return; + } + $$04356$us74 = 0; + do { + $$04252$us$us91 = $9; + $$04451$us$us92 = HEAP32[$2 + ($$04356$us74 << 2) >> 2] | 0; + $$04550$us$us93 = HEAP32[$1 + ($$04356$us74 << 2) >> 2] | 0; + while (1) { + $$04147$us$us101 = 0; + $$048$us$us100 = 0; + $$146$us$us102 = $$04550$us$us93; + while (1) { + $$048$us$us100 = $$048$us$us100 + (HEAPU8[(HEAP32[$7 + ($$04147$us$us101 << 2) >> 2] | 0) + (HEAPU8[$$146$us$us102 >> 0] | 0) >> 0] | 0) | 0; + $$04147$us$us101 = $$04147$us$us101 + 1 | 0; + if (($$04147$us$us101 | 0) == ($11 | 0)) break; else $$146$us$us102 = $$146$us$us102 + 1 | 0; + } + HEAP8[$$04451$us$us92 >> 0] = $$048$us$us100; + $$04252$us$us91 = $$04252$us$us91 + -1 | 0; + if (!$$04252$us$us91) break; else { + $$04451$us$us92 = $$04451$us$us92 + 1 | 0; + $$04550$us$us93 = $$04550$us$us93 + $11 | 0; + } + } + $$04356$us74 = $$04356$us74 + 1 | 0; + } while (($$04356$us74 | 0) != ($3 | 0)); + return; +} + +function _post_process_prepass($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$phi$trans$insert = 0, $$pre$phi40Z2D = 0, $$pre$phiZ2D = 0, $10 = 0, $20 = 0, $22 = 0, $23 = 0, $29 = 0, $30 = 0, $32 = 0, $33 = 0, $42 = 0, $44 = 0, $45 = 0, $8 = 0, $9 = 0; + $8 = HEAP32[$0 + 456 >> 2] | 0; + $9 = $8 + 24 | 0; + $10 = HEAP32[$9 >> 2] | 0; + if (!$10) { + $20 = $8 + 16 | 0; + $22 = FUNCTION_TABLE_iiiiii[HEAP32[(HEAP32[$0 + 4 >> 2] | 0) + 28 >> 2] & 31]($0, HEAP32[$8 + 8 >> 2] | 0, HEAP32[$8 + 20 >> 2] | 0, HEAP32[$20 >> 2] | 0, 1) | 0; + $23 = $8 + 12 | 0; + HEAP32[$23 >> 2] = $22; + $$pre$phi40Z2D = $20; + $$pre$phiZ2D = $23; + $29 = $22; + $32 = HEAP32[$9 >> 2] | 0; + } else { + $$phi$trans$insert = $8 + 12 | 0; + $$pre$phi40Z2D = $8 + 16 | 0; + $$pre$phiZ2D = $$phi$trans$insert; + $29 = HEAP32[$$phi$trans$insert >> 2] | 0; + $32 = $10; + } + FUNCTION_TABLE_viiiiiii[HEAP32[(HEAP32[$0 + 476 >> 2] | 0) + 4 >> 2] & 7]($0, $1, $2, $3, $29, $9, HEAP32[$$pre$phi40Z2D >> 2] | 0); + $30 = HEAP32[$9 >> 2] | 0; + if ($30 >>> 0 > $32 >>> 0) { + $33 = $30 - $32 | 0; + FUNCTION_TABLE_viiii[HEAP32[(HEAP32[$0 + 484 >> 2] | 0) + 4 >> 2] & 31]($0, (HEAP32[$$pre$phiZ2D >> 2] | 0) + ($32 << 2) | 0, 0, $33); + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + $33; + $44 = HEAP32[$9 >> 2] | 0; + } else $44 = $30; + $42 = HEAP32[$$pre$phi40Z2D >> 2] | 0; + if ($44 >>> 0 < $42 >>> 0) return; + $45 = $8 + 20 | 0; + HEAP32[$45 >> 2] = (HEAP32[$45 >> 2] | 0) + $42; + HEAP32[$9 >> 2] = 0; + return; +} + +function __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $$sroa$speculated = 0, $16 = 0, $17 = 0, $22 = 0, $23 = 0, $25 = 0, $28 = 0, $29 = 0, $35 = 0, $39 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $8 = sp; + if ((-18 - $1 | 0) >>> 0 < $2 >>> 0) __ZNKSt3__221__basic_string_commonILb1EE20__throw_length_errorEv($0); + if ((HEAP8[$0 + 11 >> 0] | 0) < 0) $25 = HEAP32[$0 >> 2] | 0; else $25 = $0; + if ($1 >>> 0 < 2147483623) { + $16 = $2 + $1 | 0; + $17 = $1 << 1; + $$sroa$speculated = $16 >>> 0 < $17 >>> 0 ? $17 : $16; + $22 = $$sroa$speculated >>> 0 < 11 ? 11 : $$sroa$speculated + 16 & -16; + } else $22 = -17; + $23 = __Znwm($22) | 0; + if ($4 | 0) __ZNSt3__211char_traitsIcE4copyEPcPKcm($23, $25, $4) | 0; + if ($6 | 0) __ZNSt3__211char_traitsIcE4copyEPcPKcm($23 + $4 | 0, $7, $6) | 0; + $28 = $3 - $5 | 0; + $29 = $28 - $4 | 0; + if ($29 | 0) __ZNSt3__211char_traitsIcE4copyEPcPKcm($23 + $4 + $6 | 0, $25 + $4 + $5 | 0, $29) | 0; + $35 = $1 + 1 | 0; + if (($35 | 0) != 11) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($25, $35); + HEAP32[$0 >> 2] = $23; + HEAP32[$0 + 8 >> 2] = $22 | -2147483648; + $39 = $28 + $6 | 0; + HEAP32[$0 + 4 >> 2] = $39; + HEAP8[$8 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($23 + $39 | 0, $8); + STACKTOP = sp; + return; +} + +function __ZNK6vision10DoGPyramid15octaveFromIndexEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $14 = 0, $19 = 0, $2 = 0, $23 = 0, $25 = 0, $33 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $5 = HEAP32[$0 >> 2] | 0; + if ((HEAP32[$0 + 4 >> 2] | 0) - $5 >> 5 >>> 0 > $1 >>> 0) { + $25 = __ZNK6vision5Image5widthEv($5) | 0; + $33 = ~~+__ZN6vision5roundIfEET_S1_(+__ZN6vision4log2IfEET_S1_(+((($25 >>> 0) / ((__ZNK6vision5Image5widthEv((HEAP32[$0 >> 2] | 0) + ($1 << 5) | 0) | 0) >>> 0) | 0) >>> 0))); + STACKTOP = sp; + return $33 | 0; + } else { + $14 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 31021) | 0, 28600) | 0, 39072) | 0, 94) | 0, 39079) | 0, 31067) | 0; + __ZNKSt3__28ios_base6getlocEv($2, $14 + (HEAP32[(HEAP32[$14 >> 2] | 0) + -12 >> 2] | 0) | 0); + $19 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66512) | 0; + $23 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$19 >> 2] | 0) + 28 >> 2] & 127]($19, 10) | 0; + __ZNSt3__26localeD2Ev($2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($14, $23) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($14) | 0; + _abort(); + } + return 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle10VectorType9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy2 = 0, $2 = 0, $3 = 0, $4 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy2 = sp + 24 | 0; + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp; + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 55975); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + $7 = $0 + 12 | 0; + if (!(__ZNK12_GLOBAL__N_116itanium_demangle12NodeOrString6isNodeEv($7) | 0)) { + if (__ZNK12_GLOBAL__N_116itanium_demangle12NodeOrString8isStringEv($7) | 0) { + __ZNK12_GLOBAL__N_116itanium_demangle12NodeOrString8asStringEv($3, $7); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + } + } else __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(__ZNK12_GLOBAL__N_116itanium_demangle12NodeOrString6asNodeEv($7) | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 51614); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + STACKTOP = sp; + return; +} + +function _strspn($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$01924 = 0, $$020 = 0, $$1$lcssa = 0, $$121 = 0, $14 = 0, $15 = 0, $19 = 0, $2 = 0, $25 = 0, $27 = 0, $28 = 0, $3 = 0, $36 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + HEAP32[$2 >> 2] = 0; + HEAP32[$2 + 4 >> 2] = 0; + HEAP32[$2 + 8 >> 2] = 0; + HEAP32[$2 + 12 >> 2] = 0; + HEAP32[$2 + 16 >> 2] = 0; + HEAP32[$2 + 20 >> 2] = 0; + HEAP32[$2 + 24 >> 2] = 0; + HEAP32[$2 + 28 >> 2] = 0; + $3 = HEAP8[$1 >> 0] | 0; + do if (!($3 << 24 >> 24)) $$0 = 0; else { + if (!(HEAP8[$1 + 1 >> 0] | 0)) { + $$020 = $0; + while (1) if ((HEAP8[$$020 >> 0] | 0) == $3 << 24 >> 24) $$020 = $$020 + 1 | 0; else break; + $$0 = $$020 - $0 | 0; + break; + } + $$01924 = $1; + $15 = $3; + do { + $14 = $15 & 255; + $19 = $2 + ($14 >>> 5 << 2) | 0; + HEAP32[$19 >> 2] = HEAP32[$19 >> 2] | 1 << ($14 & 31); + $$01924 = $$01924 + 1 | 0; + $15 = HEAP8[$$01924 >> 0] | 0; + } while ($15 << 24 >> 24 != 0); + $25 = HEAP8[$0 >> 0] | 0; + L12 : do if (!($25 << 24 >> 24)) $$1$lcssa = $0; else { + $$121 = $0; + $28 = $25; + while (1) { + $27 = $28 & 255; + if (!(HEAP32[$2 + ($27 >>> 5 << 2) >> 2] & 1 << ($27 & 31))) { + $$1$lcssa = $$121; + break L12; + } + $36 = $$121 + 1 | 0; + $28 = HEAP8[$36 >> 0] | 0; + if (!($28 << 24 >> 24)) { + $$1$lcssa = $36; + break; + } else $$121 = $36; + } + } while (0); + $$0 = $$1$lcssa - $0 | 0; + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle15ClosureTypeName9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy2 = 0, $12 = 0, $13 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy2 = sp + 32 | 0; + $2 = sp + 24 | 0; + $3 = sp; + $4 = sp + 16 | 0; + $5 = sp + 8 | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 55250); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + $7 = $0 + 16 | 0; + $12 = HEAP32[$7 + 4 >> 2] | 0; + $13 = $3; + HEAP32[$13 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$13 + 4 >> 2] = $12; + HEAP32[$$byval_copy2 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 55258); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray14printWithCommaERNS_12OutputStreamE($0 + 8 | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, 51964); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseDecltypeEv($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $1 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + do if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 68) | 0) { + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 116) | 0) ? !(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 84) | 0) : 0) { + $$1 = 0; + break; + } + $6 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$1 >> 2] = $6; + if (($6 | 0) != 0 ? __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0 : 0) $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13EnclosingExprEJRA10_KcRPNS0_4NodeERA2_S8_EEESC_DpOT0_($0, 56097, $1) | 0; else $$0 = 0; + $$1 = $$0; + } else $$1 = 0; while (0); + STACKTOP = sp; + return $$1 | 0; +} + +function __ZNSt3__26vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEE8__appendEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $13 = 0, $14 = 0, $18 = 0, $19 = 0, $2 = 0, $23 = 0, $3 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 8 | 0; + $5 = $0 + 4 | 0; + $6 = HEAP32[$5 >> 2] | 0; + do if ((HEAP32[$3 >> 2] | 0) - $6 >> 2 >>> 0 < $1 >>> 0) { + $13 = ($6 - (HEAP32[$0 >> 2] | 0) >> 2) + $1 | 0; + $14 = __ZNKSt3__26vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEE8max_sizeEv($0) | 0; + if ($14 >>> 0 < $13 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $18 = HEAP32[$0 >> 2] | 0; + $19 = (HEAP32[$3 >> 2] | 0) - $18 | 0; + $23 = $19 >> 1; + __ZNSt3__214__split_bufferIPNS_6locale5facetERNS_15__sso_allocatorIS3_Lm28EEEEC2EmmS6_($2, $19 >> 2 >>> 0 < $14 >>> 1 >>> 0 ? ($23 >>> 0 < $13 >>> 0 ? $13 : $23) : $14, (HEAP32[$5 >> 2] | 0) - $18 >> 2, $0 + 16 | 0); + __ZNSt3__214__split_bufferIPNS_6locale5facetERNS_15__sso_allocatorIS3_Lm28EEEE18__construct_at_endEm($2, $1); + __ZNSt3__26vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS5_EE($0, $2); + __ZNSt3__214__split_bufferIPNS_6locale5facetERNS_15__sso_allocatorIS3_Lm28EEEED2Ev($2); + break; + } + } else __ZNSt3__26vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEE18__construct_at_endEm($0, $1); while (0); + STACKTOP = sp; + return; +} +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_($this, $__k) { + $this = $this | 0; + $__k = $__k | 0; + var $$pn = 0, $0 = 0, $1 = 0, $3 = 0, $4 = 0, $__nd$0 = 0, $cond3$i = 0, $cond3$i29 = 0, $retval$sroa$0$0 = 0, $sub$i23 = 0, $tobool$i25 = 0; + $0 = HEAP32[$__k >> 2] | 0; + $1 = HEAP32[$this + 4 >> 2] | 0; + L1 : do if ($1) { + $sub$i23 = $1 + -1 | 0; + $tobool$i25 = ($sub$i23 & $1 | 0) == 0; + if (!$tobool$i25) if ($0 >>> 0 < $1 >>> 0) $cond3$i29 = $0; else $cond3$i29 = ($0 >>> 0) % ($1 >>> 0) | 0; else $cond3$i29 = $sub$i23 & $0; + $3 = HEAP32[(HEAP32[$this >> 2] | 0) + ($cond3$i29 << 2) >> 2] | 0; + if ($3) { + $$pn = $3; + while (1) { + $__nd$0 = HEAP32[$$pn >> 2] | 0; + if (!$__nd$0) { + $retval$sroa$0$0 = 0; + break L1; + } + $4 = HEAP32[$__nd$0 + 4 >> 2] | 0; + if (($4 | 0) == ($0 | 0)) { + if ((HEAP32[$__nd$0 + 8 >> 2] | 0) == ($0 | 0)) { + $retval$sroa$0$0 = $__nd$0; + break L1; + } + } else { + if (!$tobool$i25) if ($4 >>> 0 < $1 >>> 0) $cond3$i = $4; else $cond3$i = ($4 >>> 0) % ($1 >>> 0) | 0; else $cond3$i = $4 & $sub$i23; + if (($cond3$i | 0) != ($cond3$i29 | 0)) { + $retval$sroa$0$0 = 0; + break L1; + } + } + $$pn = $__nd$0; + } + } else $retval$sroa$0$0 = 0; + } else $retval$sroa$0$0 = 0; while (0); + return $retval$sroa$0$0 | 0; +} + +function __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $14 = 0, $16 = 0, $19 = 0, $2 = 0, $24 = 0, $25 = 0, $3 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 4 | 0; + $8 = (((HEAP32[$3 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) | 0) / 20 | 0) + 1 | 0; + $9 = __ZNKSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE8max_sizeEv($0) | 0; + if ($9 >>> 0 < $8 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $14 = HEAP32[$0 >> 2] | 0; + $16 = ((HEAP32[$0 + 8 >> 2] | 0) - $14 | 0) / 20 | 0; + $19 = $16 << 1; + __ZNSt3__214__split_bufferIN6vision12FeaturePointERNS_9allocatorIS2_EEEC2EmmS5_($2, $16 >>> 0 < $9 >>> 1 >>> 0 ? ($19 >>> 0 < $8 >>> 0 ? $8 : $19) : $9, ((HEAP32[$3 >> 2] | 0) - $14 | 0) / 20 | 0, $0 + 8 | 0); + $24 = $2 + 8 | 0; + $25 = HEAP32[$24 >> 2] | 0; + HEAP32[$25 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$25 + 4 >> 2] = HEAP32[$1 + 4 >> 2]; + HEAP32[$25 + 8 >> 2] = HEAP32[$1 + 8 >> 2]; + HEAP32[$25 + 12 >> 2] = HEAP32[$1 + 12 >> 2]; + HEAP32[$25 + 16 >> 2] = HEAP32[$1 + 16 >> 2]; + HEAP32[$24 >> 2] = (HEAP32[$24 >> 2] | 0) + 20; + __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE($0, $2); + __ZNSt3__214__split_bufferIN6vision12FeaturePointERNS_9allocatorIS2_EEED2Ev($2); + STACKTOP = sp; + return; + } +} + +function __ZNSt3__227__num_get_unsigned_integralIyEET_PKcS3_Rji($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$029 = 0, $10 = 0, $11 = 0, $12 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $23 = 0, $24 = 0, $27 = 0, $28 = 0, $29 = 0, $30 = 0, $4 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp; + do if (($0 | 0) == ($1 | 0)) { + HEAP32[$2 >> 2] = 4; + $27 = 0; + $28 = 0; + } else { + $7 = (HEAP8[$0 >> 0] | 0) == 45; + if ($7) { + $8 = $0 + 1 | 0; + if (($8 | 0) == ($1 | 0)) { + HEAP32[$2 >> 2] = 4; + $27 = 0; + $28 = 0; + break; + } else $$029 = $8; + } else $$029 = $0; + $10 = ___errno_location() | 0; + $11 = HEAP32[$10 >> 2] | 0; + $12 = ___errno_location() | 0; + HEAP32[$12 >> 2] = 0; + $14 = _strtoull_l($$029, $4, $3, __ZNSt3__26__clocEv() | 0) | 0; + $15 = getTempRet0() | 0; + $16 = ___errno_location() | 0; + $17 = HEAP32[$16 >> 2] | 0; + if (!$17) { + $19 = ___errno_location() | 0; + HEAP32[$19 >> 2] = $11; + } + do if ((HEAP32[$4 >> 2] | 0) == ($1 | 0)) if (($17 | 0) == 68) { + HEAP32[$2 >> 2] = 4; + $29 = -1; + $30 = -1; + break; + } else { + $23 = _i64Subtract(0, 0, $14 | 0, $15 | 0) | 0; + $24 = getTempRet0() | 0; + $29 = $7 ? $23 : $14; + $30 = $7 ? $24 : $15; + break; + } else { + HEAP32[$2 >> 2] = 4; + $29 = 0; + $30 = 0; + } while (0); + $27 = $30; + $28 = $29; + } while (0); + setTempRet0($27 | 0); + STACKTOP = sp; + return $28 | 0; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIi7ARParamEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_($this, $__k) { + $this = $this | 0; + $__k = $__k | 0; + var $$pn = 0, $0 = 0, $1 = 0, $3 = 0, $4 = 0, $__nd$0 = 0, $cond3$i = 0, $cond3$i29 = 0, $retval$sroa$0$0 = 0, $sub$i23 = 0, $tobool$i25 = 0; + $0 = HEAP32[$__k >> 2] | 0; + $1 = HEAP32[$this + 4 >> 2] | 0; + L1 : do if ($1) { + $sub$i23 = $1 + -1 | 0; + $tobool$i25 = ($sub$i23 & $1 | 0) == 0; + if (!$tobool$i25) if ($0 >>> 0 < $1 >>> 0) $cond3$i29 = $0; else $cond3$i29 = ($0 >>> 0) % ($1 >>> 0) | 0; else $cond3$i29 = $sub$i23 & $0; + $3 = HEAP32[(HEAP32[$this >> 2] | 0) + ($cond3$i29 << 2) >> 2] | 0; + if ($3) { + $$pn = $3; + while (1) { + $__nd$0 = HEAP32[$$pn >> 2] | 0; + if (!$__nd$0) { + $retval$sroa$0$0 = 0; + break L1; + } + $4 = HEAP32[$__nd$0 + 4 >> 2] | 0; + if (($4 | 0) == ($0 | 0)) { + if ((HEAP32[$__nd$0 + 8 >> 2] | 0) == ($0 | 0)) { + $retval$sroa$0$0 = $__nd$0; + break L1; + } + } else { + if (!$tobool$i25) if ($4 >>> 0 < $1 >>> 0) $cond3$i = $4; else $cond3$i = ($4 >>> 0) % ($1 >>> 0) | 0; else $cond3$i = $4 & $sub$i23; + if (($cond3$i | 0) != ($cond3$i29 | 0)) { + $retval$sroa$0$0 = 0; + break L1; + } + } + $$pn = $__nd$0; + } + } else $retval$sroa$0$0 = 0; + } else $retval$sroa$0$0 = 0; while (0); + return $retval$sroa$0$0 | 0; +} + +function _merged_2v_upsample($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$1 = 0, $$pre34 = 0, $10 = 0, $22 = 0, $23 = 0, $25 = 0, $26 = 0, $7 = 0, $9 = 0, $phitmp = 0, $spec$select = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $7 = sp; + $9 = HEAP32[$0 + 476 >> 2] | 0; + $10 = $9 + 36 | 0; + if (!(HEAP32[$10 >> 2] | 0)) { + $22 = $9 + 44 | 0; + $23 = HEAP32[$22 >> 2] | 0; + $spec$select = $23 >>> 0 < 2 ? $23 : 2; + $25 = HEAP32[$5 >> 2] | 0; + $26 = $6 - $25 | 0; + $$1 = $spec$select >>> 0 > $26 >>> 0 ? $26 : $spec$select; + HEAP32[$7 >> 2] = HEAP32[$4 + ($25 << 2) >> 2]; + if ($$1 >>> 0 > 1) HEAP32[$7 + 4 >> 2] = HEAP32[$4 + ($25 + 1 << 2) >> 2]; else { + HEAP32[$7 + 4 >> 2] = HEAP32[$9 + 32 >> 2]; + HEAP32[$10 >> 2] = 1; + } + FUNCTION_TABLE_viiii[HEAP32[$9 + 12 >> 2] & 31]($0, $1, HEAP32[$2 >> 2] | 0, $7); + $phitmp = (HEAP32[$10 >> 2] | 0) == 0; + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + $$1; + HEAP32[$22 >> 2] = (HEAP32[$22 >> 2] | 0) - $$1; + if (!$phitmp) { + STACKTOP = sp; + return; + } + } else { + _jcopy_sample_rows($9 + 32 | 0, 0, $4 + (HEAP32[$5 >> 2] << 2) | 0, 0, 1, HEAP32[$9 + 40 >> 2] | 0); + HEAP32[$10 >> 2] = 0; + $$pre34 = $9 + 44 | 0; + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + 1; + HEAP32[$$pre34 >> 2] = (HEAP32[$$pre34 >> 2] | 0) + -1; + } + HEAP32[$2 >> 2] = (HEAP32[$2 >> 2] | 0) + 1; + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE8__appendEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $13 = 0, $14 = 0, $18 = 0, $2 = 0, $20 = 0, $23 = 0, $3 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 8 | 0; + $5 = $0 + 4 | 0; + $6 = HEAP32[$5 >> 2] | 0; + do if ((((HEAP32[$3 >> 2] | 0) - $6 | 0) / 20 | 0) >>> 0 < $1 >>> 0) { + $13 = (($6 - (HEAP32[$0 >> 2] | 0) | 0) / 20 | 0) + $1 | 0; + $14 = __ZNKSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE8max_sizeEv($0) | 0; + if ($14 >>> 0 < $13 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $18 = HEAP32[$0 >> 2] | 0; + $20 = ((HEAP32[$3 >> 2] | 0) - $18 | 0) / 20 | 0; + $23 = $20 << 1; + __ZNSt3__214__split_bufferIN6vision12FeaturePointERNS_9allocatorIS2_EEEC2EmmS5_($2, $20 >>> 0 < $14 >>> 1 >>> 0 ? ($23 >>> 0 < $13 >>> 0 ? $13 : $23) : $14, ((HEAP32[$5 >> 2] | 0) - $18 | 0) / 20 | 0, $0 + 8 | 0); + __ZNSt3__214__split_bufferIN6vision12FeaturePointERNS_9allocatorIS2_EEE18__construct_at_endEm($2, $1); + __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE($0, $2); + __ZNSt3__214__split_bufferIN6vision12FeaturePointERNS_9allocatorIS2_EEED2Ev($2); + break; + } + } else __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE18__construct_at_endEm($0, $1); while (0); + STACKTOP = sp; + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE6rehashEm($this, $__n) { + $this = $this | 0; + $__n = $__n | 0; + var $$sroa$speculated = 0, $0 = 0, $__n$addr$0 = 0, $cond = 0, $conv9 = 0, $shl$i = 0; + if (($__n | 0) != 1) if (!($__n + -1 & $__n)) $__n$addr$0 = $__n; else $__n$addr$0 = __ZNSt3__212__next_primeEm($__n) | 0; else $__n$addr$0 = 2; + $0 = HEAP32[$this + 4 >> 2] | 0; + if ($__n$addr$0 >>> 0 <= $0 >>> 0) { + if ($__n$addr$0 >>> 0 < $0 >>> 0) { + $conv9 = ~~+Math_ceil(+(+((HEAP32[$this + 12 >> 2] | 0) >>> 0) / +HEAPF32[$this + 16 >> 2])) >>> 0; + if ($0 >>> 0 > 2 & ($0 + -1 & $0 | 0) == 0) { + $shl$i = 1 << 32 - (Math_clz32($conv9 + -1 | 0) | 0); + $cond = $conv9 >>> 0 < 2 ? $conv9 : $shl$i; + } else $cond = __ZNSt3__212__next_primeEm($conv9) | 0; + $$sroa$speculated = $__n$addr$0 >>> 0 < $cond >>> 0 ? $cond : $__n$addr$0; + if ($$sroa$speculated >>> 0 < $0 >>> 0) __ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE8__rehashEm($this, $$sroa$speculated); + } + } else __ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE8__rehashEm($this, $__n$addr$0); + return; +} + +function __ZNSt3__26vectorIiNS_9allocatorIiEEE8__appendEmRKi($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0$i = 0, $11 = 0, $13 = 0, $20 = 0, $21 = 0, $25 = 0, $26 = 0, $3 = 0, $30 = 0, $4 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $3 = sp; + $4 = $0 + 8 | 0; + $6 = $0 + 4 | 0; + $7 = HEAP32[$6 >> 2] | 0; + $11 = $7; + do if ((HEAP32[$4 >> 2] | 0) - $7 >> 2 >>> 0 < $1 >>> 0) { + $20 = ($7 - (HEAP32[$0 >> 2] | 0) >> 2) + $1 | 0; + $21 = __ZNKSt3__26vectorIiNS_9allocatorIiEEE8max_sizeEv($0) | 0; + if ($21 >>> 0 < $20 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $25 = HEAP32[$0 >> 2] | 0; + $26 = (HEAP32[$4 >> 2] | 0) - $25 | 0; + $30 = $26 >> 1; + __ZNSt3__214__split_bufferIiRNS_9allocatorIiEEEC2EmmS3_($3, $26 >> 2 >>> 0 < $21 >>> 1 >>> 0 ? ($30 >>> 0 < $20 >>> 0 ? $20 : $30) : $21, (HEAP32[$6 >> 2] | 0) - $25 >> 2, $0 + 8 | 0); + __ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE18__construct_at_endEmRKi($3, $1, $2); + __ZNSt3__26vectorIiNS_9allocatorIiEEE26__swap_out_circular_bufferERNS_14__split_bufferIiRS2_EE($0, $3); + __ZNSt3__214__split_bufferIiRNS_9allocatorIiEEED2Ev($3); + break; + } + } else { + $$0$i = $1; + $13 = $11; + while (1) { + HEAP32[$13 >> 2] = HEAP32[$2 >> 2]; + $$0$i = $$0$i + -1 | 0; + if (!$$0$i) break; else $13 = $13 + 4 | 0; + } + HEAP32[$6 >> 2] = $11 + ($1 << 2); + } while (0); + STACKTOP = sp; + return; +} + +function ___strchrnul($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$029$lcssa = 0, $$02936 = 0, $$030$lcssa = 0, $$03039 = 0, $$1 = 0, $10 = 0, $13 = 0, $17 = 0, $18 = 0, $2 = 0, $24 = 0, $25 = 0, $31 = 0, $38 = 0, $39 = 0, $9 = 0; + $2 = $1 & 255; + L1 : do if (!$2) $$0 = $0 + (_strlen($0) | 0) | 0; else { + if (!($0 & 3)) $$030$lcssa = $0; else { + $9 = $1 & 255; + $$03039 = $0; + while (1) { + $10 = HEAP8[$$03039 >> 0] | 0; + if ($10 << 24 >> 24 == 0 ? 1 : $10 << 24 >> 24 == $9 << 24 >> 24) { + $$0 = $$03039; + break L1; + } + $13 = $$03039 + 1 | 0; + if (!($13 & 3)) { + $$030$lcssa = $13; + break; + } else $$03039 = $13; + } + } + $17 = Math_imul($2, 16843009) | 0; + $18 = HEAP32[$$030$lcssa >> 2] | 0; + L10 : do if (!(($18 & -2139062144 ^ -2139062144) & $18 + -16843009)) { + $$02936 = $$030$lcssa; + $25 = $18; + while (1) { + $24 = $25 ^ $17; + if (($24 & -2139062144 ^ -2139062144) & $24 + -16843009 | 0) { + $$029$lcssa = $$02936; + break L10; + } + $31 = $$02936 + 4 | 0; + $25 = HEAP32[$31 >> 2] | 0; + if (($25 & -2139062144 ^ -2139062144) & $25 + -16843009 | 0) { + $$029$lcssa = $31; + break; + } else $$02936 = $31; + } + } else $$029$lcssa = $$030$lcssa; while (0); + $38 = $1 & 255; + $$1 = $$029$lcssa; + while (1) { + $39 = HEAP8[$$1 >> 0] | 0; + if ($39 << 24 >> 24 == 0 ? 1 : $39 << 24 >> 24 == $38 << 24 >> 24) { + $$0 = $$1; + break; + } else $$1 = $$1 + 1 | 0; + } + } while (0); + return $$0 | 0; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIi7ARParamEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE6rehashEm($this, $__n) { + $this = $this | 0; + $__n = $__n | 0; + var $$sroa$speculated = 0, $0 = 0, $__n$addr$0 = 0, $cond = 0, $conv9 = 0, $shl$i = 0; + if (($__n | 0) != 1) if (!($__n + -1 & $__n)) $__n$addr$0 = $__n; else $__n$addr$0 = __ZNSt3__212__next_primeEm($__n) | 0; else $__n$addr$0 = 2; + $0 = HEAP32[$this + 4 >> 2] | 0; + if ($__n$addr$0 >>> 0 <= $0 >>> 0) { + if ($__n$addr$0 >>> 0 < $0 >>> 0) { + $conv9 = ~~+Math_ceil(+(+((HEAP32[$this + 12 >> 2] | 0) >>> 0) / +HEAPF32[$this + 16 >> 2])) >>> 0; + if ($0 >>> 0 > 2 & ($0 + -1 & $0 | 0) == 0) { + $shl$i = 1 << 32 - (Math_clz32($conv9 + -1 | 0) | 0); + $cond = $conv9 >>> 0 < 2 ? $conv9 : $shl$i; + } else $cond = __ZNSt3__212__next_primeEm($conv9) | 0; + $$sroa$speculated = $__n$addr$0 >>> 0 < $cond >>> 0 ? $cond : $__n$addr$0; + if ($$sroa$speculated >>> 0 < $0 >>> 0) __ZNSt3__212__hash_tableINS_17__hash_value_typeIi7ARParamEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE8__rehashEm($this, $$sroa$speculated); + } + } else __ZNSt3__212__hash_tableINS_17__hash_value_typeIi7ARParamEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE8__rehashEm($this, $__n$addr$0); + return; +} + +function __ZN6vision27OrthogonalizePivot8x9Basis4IfEEbPT_S2_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $10 = 0, $12 = 0.0, $13 = 0.0, $15 = 0.0, $17 = 0.0, $19 = 0, $2 = 0, $20 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $3 = $0 + 144 | 0; + $4 = $0 + 108 | 0; + $5 = $1 + 144 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($3, $4, $5); + $6 = $0 + 180 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($6, $4, $1 + 180 | 0); + $8 = $0 + 216 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($8, $4, $1 + 216 | 0); + $10 = $0 + 252 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($10, $4, $1 + 252 | 0); + $12 = +__ZN6vision11SumSquares9IfEET_PKS1_($3); + HEAPF32[$2 >> 2] = $12; + $13 = +__ZN6vision11SumSquares9IfEET_PKS1_($6); + HEAPF32[$2 + 4 >> 2] = $13; + $15 = +__ZN6vision11SumSquares9IfEET_PKS1_($8); + HEAPF32[$2 + 8 >> 2] = $15; + $17 = +__ZN6vision11SumSquares9IfEET_PKS1_($10); + HEAPF32[$2 + 12 >> 2] = $17; + $19 = __ZN6vision9MaxIndex4IfEEiPKT_($2) | 0; + $20 = $2 + ($19 << 2) | 0; + if (+HEAPF32[$20 >> 2] == 0.0) $$0 = 0; else { + $23 = $19 * 9 | 0; + __ZN6vision5Swap9IfEEvPT_S2_($3, $3 + ($23 << 2) | 0); + __ZN6vision5Swap9IfEEvPT_S2_($5, $5 + ($23 << 2) | 0); + __ZN6vision12ScaleVector9IfEEvPT_PKS1_S1_($3, $3, 1.0 / +Math_sqrt(+(+HEAPF32[$20 >> 2]))); + $$0 = 1; + } + STACKTOP = sp; + return $$0 | 0; +} + +function _ar2MarkerCoord2ScreenCoord2($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = +$2; + $3 = +$3; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $39 = 0.0, $40 = 0.0, $41 = 0.0, $42 = 0, $6 = 0, $63 = 0.0, $7 = 0, $73 = 0.0, $8 = 0, $81 = 0.0, $84 = 0.0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $6 = sp; + $7 = sp + 52 | 0; + $8 = sp + 48 | 0; + if ($0) { + _arUtilMatMuldff($0 + 8 | 0, $1, $6) | 0; + $39 = +HEAPF32[$6 + 44 >> 2] + (+HEAPF32[$6 + 32 >> 2] * $2 + +HEAPF32[$6 + 36 >> 2] * $3); + $40 = (+HEAPF32[$6 + 12 >> 2] + (+HEAPF32[$6 >> 2] * $2 + +HEAPF32[$6 + 4 >> 2] * $3)) / $39; + $41 = (+HEAPF32[$6 + 28 >> 2] + (+HEAPF32[$6 + 16 >> 2] * $2 + +HEAPF32[$6 + 20 >> 2] * $3)) / $39; + $42 = $0 + 184 | 0; + if ((_arParamIdeal2ObservLTf($42, $40, $41, $4, $5) | 0) >= 0 ? (_arParamObserv2IdealLTf($42, +HEAPF32[$4 >> 2], +HEAPF32[$5 >> 2], $7, $8) | 0) >= 0 : 0) { + $81 = $40 - +HEAPF32[$7 >> 2]; + $84 = $41 - +HEAPF32[$8 >> 2]; + $$0 = ($81 * $81 + $84 * $84 > 1.0) << 31 >> 31; + } else $$0 = -1; + } else { + $63 = +HEAPF32[$1 + 28 >> 2] + (+HEAPF32[$1 + 16 >> 2] * $2 + +HEAPF32[$1 + 20 >> 2] * $3); + $73 = +HEAPF32[$1 + 44 >> 2] + (+HEAPF32[$1 + 32 >> 2] * $2 + +HEAPF32[$1 + 36 >> 2] * $3); + HEAPF32[$4 >> 2] = (+HEAPF32[$1 + 12 >> 2] + (+HEAPF32[$1 >> 2] * $2 + +HEAPF32[$1 + 4 >> 2] * $3)) / $73; + HEAPF32[$5 >> 2] = $63 / $73; + $$0 = 0; + } + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNSt3__26vectorIhNS_9allocatorIhEEE8__appendEmRKh($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0$i = 0, $12 = 0, $19 = 0, $20 = 0, $24 = 0, $25 = 0, $28 = 0, $3 = 0, $4 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $3 = sp; + $4 = $0 + 8 | 0; + $6 = $0 + 4 | 0; + $7 = HEAP32[$6 >> 2] | 0; + do if (((HEAP32[$4 >> 2] | 0) - $7 | 0) >>> 0 < $1 >>> 0) { + $19 = $7 - (HEAP32[$0 >> 2] | 0) + $1 | 0; + $20 = __ZNKSt3__26vectorIhNS_9allocatorIhEEE8max_sizeEv($0) | 0; + if ($20 >>> 0 < $19 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $24 = HEAP32[$0 >> 2] | 0; + $25 = (HEAP32[$4 >> 2] | 0) - $24 | 0; + $28 = $25 << 1; + __ZNSt3__214__split_bufferIhRNS_9allocatorIhEEEC2EmmS3_($3, $25 >>> 0 < $20 >>> 1 >>> 0 ? ($28 >>> 0 < $19 >>> 0 ? $19 : $28) : $20, (HEAP32[$6 >> 2] | 0) - $24 | 0, $0 + 8 | 0); + __ZNSt3__214__split_bufferIhRNS_9allocatorIhEEE18__construct_at_endEmRKh($3, $1, $2); + __ZNSt3__26vectorIhNS_9allocatorIhEEE26__swap_out_circular_bufferERNS_14__split_bufferIhRS2_EE($0, $3); + __ZNSt3__214__split_bufferIhRNS_9allocatorIhEEED2Ev($3); + break; + } + } else { + $$0$i = $1; + $12 = $7; + do { + HEAP8[$12 >> 0] = HEAP8[$2 >> 0] | 0; + $12 = (HEAP32[$6 >> 2] | 0) + 1 | 0; + HEAP32[$6 >> 2] = $12; + $$0$i = $$0$i + -1 | 0; + } while (($$0$i | 0) != 0); + } while (0); + STACKTOP = sp; + return; +} + +function _jinit_marker_reader($0) { + $0 = $0 | 0; + var $4 = 0, $42 = 0, $5 = 0; + $4 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$0 + 4 >> 2] >> 2] & 63]($0, 0, 172) | 0; + $5 = $0 + 464 | 0; + HEAP32[$5 >> 2] = $4; + HEAP32[$4 >> 2] = 203; + HEAP32[$4 + 4 >> 2] = 86; + HEAP32[$4 + 8 >> 2] = 87; + HEAP32[$4 + 28 >> 2] = 88; + HEAP32[$4 + 96 >> 2] = 0; + HEAP32[$4 + 100 >> 2] = 0; + HEAP32[$4 + 36 >> 2] = 88; + HEAP32[$4 + 104 >> 2] = 0; + HEAP32[$4 + 40 >> 2] = 88; + HEAP32[$4 + 108 >> 2] = 0; + HEAP32[$4 + 44 >> 2] = 88; + HEAP32[$4 + 112 >> 2] = 0; + HEAP32[$4 + 48 >> 2] = 88; + HEAP32[$4 + 116 >> 2] = 0; + HEAP32[$4 + 52 >> 2] = 88; + HEAP32[$4 + 120 >> 2] = 0; + HEAP32[$4 + 56 >> 2] = 88; + HEAP32[$4 + 124 >> 2] = 0; + HEAP32[$4 + 60 >> 2] = 88; + HEAP32[$4 + 128 >> 2] = 0; + HEAP32[$4 + 64 >> 2] = 88; + HEAP32[$4 + 132 >> 2] = 0; + HEAP32[$4 + 68 >> 2] = 88; + HEAP32[$4 + 136 >> 2] = 0; + HEAP32[$4 + 72 >> 2] = 88; + HEAP32[$4 + 140 >> 2] = 0; + HEAP32[$4 + 76 >> 2] = 88; + HEAP32[$4 + 144 >> 2] = 0; + HEAP32[$4 + 80 >> 2] = 88; + HEAP32[$4 + 148 >> 2] = 0; + HEAP32[$4 + 84 >> 2] = 88; + HEAP32[$4 + 152 >> 2] = 0; + HEAP32[$4 + 156 >> 2] = 0; + HEAP32[$4 + 92 >> 2] = 88; + HEAP32[$4 + 160 >> 2] = 0; + HEAP32[$4 + 32 >> 2] = 89; + HEAP32[$4 + 88 >> 2] = 89; + $42 = HEAP32[$5 >> 2] | 0; + HEAP32[$0 + 216 >> 2] = 0; + HEAP32[$0 + 144 >> 2] = 0; + HEAP32[$0 + 440 >> 2] = 0; + HEAP32[$42 + 12 >> 2] = 0; + HEAP32[$42 + 16 >> 2] = 0; + HEAP32[$42 + 24 >> 2] = 0; + HEAP32[$42 + 164 >> 2] = 0; + return; +} + +function __ZNSt3__26vectorIN6vision17PriorityQueueItemILi96EEENS_9allocatorIS3_EEE21__push_back_slow_pathIRKS3_EEvOT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $14 = 0, $15 = 0, $19 = 0, $2 = 0, $24 = 0, $26 = 0, $3 = 0, $31 = 0, $32 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 4 | 0; + $8 = ((HEAP32[$3 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 3) + 1 | 0; + $9 = __ZNKSt3__26vectorIN6vision17PriorityQueueItemILi96EEENS_9allocatorIS3_EEE8max_sizeEv($0) | 0; + if ($9 >>> 0 < $8 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $14 = HEAP32[$0 >> 2] | 0; + $15 = (HEAP32[$0 + 8 >> 2] | 0) - $14 | 0; + $19 = $15 >> 2; + __ZNSt3__214__split_bufferIN6vision17PriorityQueueItemILi96EEERNS_9allocatorIS3_EEEC2EmmS6_($2, $15 >> 3 >>> 0 < $9 >>> 1 >>> 0 ? ($19 >>> 0 < $8 >>> 0 ? $8 : $19) : $9, (HEAP32[$3 >> 2] | 0) - $14 >> 3, $0 + 8 | 0); + $24 = $2 + 8 | 0; + $26 = $1; + $31 = HEAP32[$26 + 4 >> 2] | 0; + $32 = HEAP32[$24 >> 2] | 0; + HEAP32[$32 >> 2] = HEAP32[$26 >> 2]; + HEAP32[$32 + 4 >> 2] = $31; + HEAP32[$24 >> 2] = (HEAP32[$24 >> 2] | 0) + 8; + __ZNSt3__26vectorIN6vision17PriorityQueueItemILi96EEENS_9allocatorIS3_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS5_EE($0, $2); + __ZNSt3__214__split_bufferIN6vision17PriorityQueueItemILi96EEERNS_9allocatorIS3_EEED2Ev($2); + STACKTOP = sp; + return; + } +} + +function _x_by_xt($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$049 = 0, $$050 = 0, $$051 = 0, $$052 = 0, $$053 = 0, $$054 = 0, $$1 = 0, $12 = 0, $14 = 0, $18 = 0, $20 = 0, $23 = 0, $3 = 0, $30 = 0.0, $31 = 0.0, $5 = 0; + $3 = HEAP32[$0 + 4 >> 2] | 0; + $5 = HEAP32[$0 + 8 >> 2] | 0; + L1 : do if ((HEAP32[$1 + 4 >> 2] | 0) == ($3 | 0) ? (HEAP32[$1 + 8 >> 2] | 0) == ($3 | 0) : 0) { + $12 = HEAP32[$1 >> 2] | 0; + $$050 = 0; + $$053 = $12; + while (1) { + if (($$050 | 0) >= ($3 | 0)) { + $$051 = 0; + break L1; + } + $14 = Math_imul($$050, $5) | 0; + $$049 = 0; + $$1 = $$053; + while (1) { + if (($$049 | 0) == ($3 | 0)) break; + L10 : do if ($$049 >>> 0 < $$050 >>> 0) { + $18 = $12 + ((Math_imul($$049, $3) | 0) + $$050 << 3) | 0; + HEAPF64[$$1 >> 3] = +HEAPF64[$18 >> 3]; + } else { + $20 = HEAP32[$0 >> 2] | 0; + $23 = $20 + ((Math_imul($$049, $5) | 0) << 3) | 0; + HEAPF64[$$1 >> 3] = 0.0; + $$0 = 0; + $$052 = $20 + ($14 << 3) | 0; + $$054 = $23; + $31 = 0.0; + while (1) { + if (($$0 | 0) >= ($5 | 0)) break L10; + $30 = $31 + +HEAPF64[$$052 >> 3] * +HEAPF64[$$054 >> 3]; + HEAPF64[$$1 >> 3] = $30; + $$0 = $$0 + 1 | 0; + $$052 = $$052 + 8 | 0; + $$054 = $$054 + 8 | 0; + $31 = $30; + } + } while (0); + $$049 = $$049 + 1 | 0; + $$1 = $$1 + 8 | 0; + } + $$050 = $$050 + 1 | 0; + $$053 = $$053 + ($3 << 3) | 0; + } + } else $$051 = -1; while (0); + return $$051 | 0; +} + +function _fread($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$ = 0, $$0 = 0, $$054 = 0, $$056 = 0, $$15759 = 0, $$160 = 0, $10 = 0, $12 = 0, $18 = 0, $19 = 0, $20 = 0, $29 = 0, $33 = 0, $37 = 0, $4 = 0, $40 = 0, $spec$select = 0, label = 0; + $4 = Math_imul($2, $1) | 0; + $spec$select = ($1 | 0) == 0 ? 0 : $2; + if ((HEAP32[$3 + 76 >> 2] | 0) > -1) $37 = ___lockfile($3) | 0; else $37 = 0; + $10 = $3 + 74 | 0; + $12 = HEAP8[$10 >> 0] | 0; + HEAP8[$10 >> 0] = $12 + 255 | $12; + $18 = $3 + 4 | 0; + $19 = HEAP32[$18 >> 2] | 0; + $20 = (HEAP32[$3 + 8 >> 2] | 0) - $19 | 0; + if (($20 | 0) > 0) { + $$ = $20 >>> 0 < $4 >>> 0 ? $20 : $4; + _memcpy($0 | 0, $19 | 0, $$ | 0) | 0; + HEAP32[$18 >> 2] = (HEAP32[$18 >> 2] | 0) + $$; + $$054 = $4 - $$ | 0; + $$056 = $0 + $$ | 0; + } else { + $$054 = $4; + $$056 = $0; + } + L7 : do if (!$$054) label = 13; else { + $29 = $3 + 32 | 0; + $$15759 = $$056; + $$160 = $$054; + while (1) { + if (___toread($3) | 0) break; + $33 = FUNCTION_TABLE_iiii[HEAP32[$29 >> 2] & 63]($3, $$15759, $$160) | 0; + if (($33 + 1 | 0) >>> 0 < 2) break; + $40 = $$160 - $33 | 0; + if (!$40) { + label = 13; + break L7; + } else { + $$15759 = $$15759 + $33 | 0; + $$160 = $40; + } + } + if ($37 | 0) ___unlockfile($3); + $$0 = (($4 - $$160 | 0) >>> 0) / ($1 >>> 0) | 0; + } while (0); + if ((label | 0) == 13) if (!$37) $$0 = $spec$select; else { + ___unlockfile($3); + $$0 = $spec$select; + } + return $$0 | 0; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS5_EEEEEENS_22__unordered_map_hasherIiS9_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS9_NS_8equal_toIiEELb1EEENS6_IS9_EEE6rehashEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$sroa$speculated = 0, $22 = 0, $27 = 0, $30 = 0, $8 = 0; + if (($1 | 0) != 1) if (!($1 + -1 & $1)) $$0 = $1; else $$0 = __ZNSt3__212__next_primeEm($1) | 0; else $$0 = 2; + $8 = HEAP32[$0 + 4 >> 2] | 0; + if ($$0 >>> 0 <= $8 >>> 0) { + if ($$0 >>> 0 < $8 >>> 0) { + $22 = ~~+Math_ceil(+(+((HEAP32[$0 + 12 >> 2] | 0) >>> 0) / +HEAPF32[$0 + 16 >> 2])) >>> 0; + if ($8 >>> 0 > 2 & ($8 + -1 & $8 | 0) == 0) { + $27 = 1 << 32 - (Math_clz32($22 + -1 | 0) | 0); + $30 = $22 >>> 0 < 2 ? $22 : $27; + } else $30 = __ZNSt3__212__next_primeEm($22) | 0; + $$sroa$speculated = $$0 >>> 0 < $30 >>> 0 ? $30 : $$0; + if ($$sroa$speculated >>> 0 < $8 >>> 0) __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS5_EEEEEENS_22__unordered_map_hasherIiS9_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS9_NS_8equal_toIiEELb1EEENS6_IS9_EEE8__rehashEm($0, $$sroa$speculated); + } + } else __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS5_EEEEEENS_22__unordered_map_hasherIiS9_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS9_NS_8equal_toIiEELb1EEENS6_IS9_EEE8__rehashEm($0, $$0); + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEEEENS_22__unordered_map_hasherIiS7_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS7_NS_8equal_toIiEELb1EEENS_9allocatorIS7_EEE6rehashEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$sroa$speculated = 0, $22 = 0, $27 = 0, $30 = 0, $8 = 0; + if (($1 | 0) != 1) if (!($1 + -1 & $1)) $$0 = $1; else $$0 = __ZNSt3__212__next_primeEm($1) | 0; else $$0 = 2; + $8 = HEAP32[$0 + 4 >> 2] | 0; + if ($$0 >>> 0 <= $8 >>> 0) { + if ($$0 >>> 0 < $8 >>> 0) { + $22 = ~~+Math_ceil(+(+((HEAP32[$0 + 12 >> 2] | 0) >>> 0) / +HEAPF32[$0 + 16 >> 2])) >>> 0; + if ($8 >>> 0 > 2 & ($8 + -1 & $8 | 0) == 0) { + $27 = 1 << 32 - (Math_clz32($22 + -1 | 0) | 0); + $30 = $22 >>> 0 < 2 ? $22 : $27; + } else $30 = __ZNSt3__212__next_primeEm($22) | 0; + $$sroa$speculated = $$0 >>> 0 < $30 >>> 0 ? $30 : $$0; + if ($$sroa$speculated >>> 0 < $8 >>> 0) __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEEEENS_22__unordered_map_hasherIiS7_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS7_NS_8equal_toIiEELb1EEENS_9allocatorIS7_EEE8__rehashEm($0, $$sroa$speculated); + } + } else __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEEEENS_22__unordered_map_hasherIiS7_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS7_NS_8equal_toIiEELb1EEENS_9allocatorIS7_EEE8__rehashEm($0, $$0); + return; +} + +function __ZNSt3__225__num_get_signed_integralIlEET_PKcS3_Rji($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $15 = 0, $4 = 0, $6 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp; + if (($0 | 0) == ($1 | 0)) { + HEAP32[$2 >> 2] = 4; + $$1 = 0; + } else { + $6 = ___errno_location() | 0; + $7 = HEAP32[$6 >> 2] | 0; + $8 = ___errno_location() | 0; + HEAP32[$8 >> 2] = 0; + $10 = _strtoll_l($0, $4, $3, __ZNSt3__26__clocEv() | 0) | 0; + $11 = getTempRet0() | 0; + $12 = ___errno_location() | 0; + $13 = HEAP32[$12 >> 2] | 0; + if (!$13) { + $15 = ___errno_location() | 0; + HEAP32[$15 >> 2] = $7; + } + L7 : do if ((HEAP32[$4 >> 2] | 0) == ($1 | 0)) { + do if (($13 | 0) == 68) { + HEAP32[$2 >> 2] = 4; + if (($11 | 0) > 0 | ($11 | 0) == 0 & $10 >>> 0 > 0) { + $$0 = 2147483647; + break L7; + } + } else { + if (($11 | 0) < -1 | ($11 | 0) == -1 & $10 >>> 0 < 2147483648) { + HEAP32[$2 >> 2] = 4; + break; + } + if (($11 | 0) > 0 | ($11 | 0) == 0 & $10 >>> 0 > 2147483647) { + HEAP32[$2 >> 2] = 4; + $$0 = 2147483647; + break L7; + } else { + $$0 = $10; + break L7; + } + } while (0); + $$0 = -2147483648; + } else { + HEAP32[$2 >> 2] = 4; + $$0 = 0; + } while (0); + $$1 = $$0; + } + STACKTOP = sp; + return $$1 | 0; +} + +function __ZN6vision27OrthogonalizePivot8x9Basis0IfEEbPT_S2_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $11 = 0.0, $14 = 0.0, $17 = 0.0, $2 = 0, $20 = 0.0, $23 = 0.0, $25 = 0, $26 = 0, $3 = 0.0, $4 = 0, $5 = 0.0, $8 = 0.0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = +__ZN6vision11SumSquares9IfEET_PKS1_($1); + HEAPF32[$2 >> 2] = $3; + $4 = $1 + 36 | 0; + $5 = +__ZN6vision11SumSquares9IfEET_PKS1_($4); + HEAPF32[$2 + 4 >> 2] = $5; + $8 = +__ZN6vision11SumSquares9IfEET_PKS1_($1 + 72 | 0); + HEAPF32[$2 + 8 >> 2] = $8; + $11 = +__ZN6vision11SumSquares9IfEET_PKS1_($1 + 108 | 0); + HEAPF32[$2 + 12 >> 2] = $11; + $14 = +__ZN6vision11SumSquares9IfEET_PKS1_($1 + 144 | 0); + HEAPF32[$2 + 16 >> 2] = $14; + $17 = +__ZN6vision11SumSquares9IfEET_PKS1_($1 + 180 | 0); + HEAPF32[$2 + 20 >> 2] = $17; + $20 = +__ZN6vision11SumSquares9IfEET_PKS1_($1 + 216 | 0); + HEAPF32[$2 + 24 >> 2] = $20; + $23 = +__ZN6vision11SumSquares9IfEET_PKS1_($1 + 252 | 0); + HEAPF32[$2 + 28 >> 2] = $23; + $25 = __ZN6vision9MaxIndex8IfEEiPKT_($2) | 0; + $26 = $2 + ($25 << 2) | 0; + if (+HEAPF32[$26 >> 2] == 0.0) $$0 = 0; else { + __ZN6vision5Swap9IfEEvPT_S2_($1, $1 + ($25 * 9 << 2) | 0); + __ZN6vision12ScaleVector9IfEEvPT_PKS1_S1_($0, $1, 1.0 / +Math_sqrt(+(+HEAPF32[$26 >> 2]))); + __ZN6vision10CopyVectorIfEEvPT_PKS1_m($0 + 36 | 0, $4, 63); + $$0 = 1; + } + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20parseFloatingLiteralIeEEPNS0_4NodeEv($0) { + $0 = $0 | 0; + var $$020 = 0, $$3 = 0, $$4 = 0, $1 = 0, $4 = 0, $6 = 0, $7 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + if ((__ZNK12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E7numLeftEv($0) | 0) >>> 0 < 21) $$4 = 0; else { + $4 = HEAP32[$0 >> 2] | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKcS2_($1, $4, $4 + 20 | 0); + $6 = __ZNK12_GLOBAL__N_110StringView5beginEv($1) | 0; + $7 = __ZNK12_GLOBAL__N_110StringView3endEv($1) | 0; + $$020 = $6; + while (1) { + if (($$020 | 0) == ($7 | 0)) { + label = 5; + break; + } + if (!(_isxdigit(HEAP8[$$020 >> 0] | 0) | 0)) { + $$3 = 0; + break; + } else $$020 = $$020 + 1 | 0; + } + if ((label | 0) == 5) { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 20; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_16FloatLiteralImplIeEEJRNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $1) | 0; else $$3 = 0; + } + $$4 = $$3; + } + STACKTOP = sp; + return $$4 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20parseFloatingLiteralIdEEPNS0_4NodeEv($0) { + $0 = $0 | 0; + var $$020 = 0, $$3 = 0, $$4 = 0, $1 = 0, $4 = 0, $6 = 0, $7 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + if ((__ZNK12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E7numLeftEv($0) | 0) >>> 0 < 17) $$4 = 0; else { + $4 = HEAP32[$0 >> 2] | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKcS2_($1, $4, $4 + 16 | 0); + $6 = __ZNK12_GLOBAL__N_110StringView5beginEv($1) | 0; + $7 = __ZNK12_GLOBAL__N_110StringView3endEv($1) | 0; + $$020 = $6; + while (1) { + if (($$020 | 0) == ($7 | 0)) { + label = 5; + break; + } + if (!(_isxdigit(HEAP8[$$020 >> 0] | 0) | 0)) { + $$3 = 0; + break; + } else $$020 = $$020 + 1 | 0; + } + if ((label | 0) == 5) { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 16; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_16FloatLiteralImplIdEEJRNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $1) | 0; else $$3 = 0; + } + $$4 = $$3; + } + STACKTOP = sp; + return $$4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle7NewExprEJRNS2_9NodeArrayERPNS2_4NodeES5_RbS9_EEEPT_DpOT0_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $14 = 0, $15 = 0, $19 = 0, $20 = 0, $25 = 0, $26 = 0, $31 = 0, $33 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $tmpcast$byval_copy = 0, $tmpcast6$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $tmpcast6$byval_copy = sp + 24 | 0; + $tmpcast$byval_copy = sp + 16 | 0; + $6 = sp + 8 | 0; + $7 = sp; + $8 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 32) | 0; + $9 = $1; + $14 = HEAP32[$9 + 4 >> 2] | 0; + $15 = $6; + HEAP32[$15 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$15 + 4 >> 2] = $14; + $19 = HEAP32[$2 >> 2] | 0; + $20 = $3; + $25 = HEAP32[$20 + 4 >> 2] | 0; + $26 = $7; + HEAP32[$26 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$26 + 4 >> 2] = $25; + $31 = (HEAP8[$4 >> 0] | 0) != 0; + $33 = (HEAP8[$5 >> 0] | 0) != 0; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + HEAP32[$tmpcast6$byval_copy >> 2] = HEAP32[$7 >> 2]; + HEAP32[$tmpcast6$byval_copy + 4 >> 2] = HEAP32[$7 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle7NewExprC2ENS0_9NodeArrayEPNS0_4NodeES2_bb($8, $tmpcast$byval_copy, $19, $tmpcast6$byval_copy, $31, $33); + STACKTOP = sp; + return $8 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle7NewExprEJRNS2_9NodeArrayERPNS2_4NodeES4_RbS9_EEEPT_DpOT0_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $14 = 0, $15 = 0, $19 = 0, $20 = 0, $25 = 0, $26 = 0, $31 = 0, $33 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $tmpcast$byval_copy = 0, $tmpcast6$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $tmpcast6$byval_copy = sp + 24 | 0; + $tmpcast$byval_copy = sp + 16 | 0; + $6 = sp + 8 | 0; + $7 = sp; + $8 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 32) | 0; + $9 = $1; + $14 = HEAP32[$9 + 4 >> 2] | 0; + $15 = $6; + HEAP32[$15 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$15 + 4 >> 2] = $14; + $19 = HEAP32[$2 >> 2] | 0; + $20 = $3; + $25 = HEAP32[$20 + 4 >> 2] | 0; + $26 = $7; + HEAP32[$26 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$26 + 4 >> 2] = $25; + $31 = (HEAP8[$4 >> 0] | 0) != 0; + $33 = (HEAP8[$5 >> 0] | 0) != 0; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + HEAP32[$tmpcast6$byval_copy >> 2] = HEAP32[$7 >> 2]; + HEAP32[$tmpcast6$byval_copy + 4 >> 2] = HEAP32[$7 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle7NewExprC2ENS0_9NodeArrayEPNS0_4NodeES2_bb($8, $tmpcast$byval_copy, $19, $tmpcast6$byval_copy, $31, $33); + STACKTOP = sp; + return $8 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20parseFloatingLiteralIfEEPNS0_4NodeEv($0) { + $0 = $0 | 0; + var $$020 = 0, $$3 = 0, $$4 = 0, $1 = 0, $4 = 0, $6 = 0, $7 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + if ((__ZNK12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E7numLeftEv($0) | 0) >>> 0 < 9) $$4 = 0; else { + $4 = HEAP32[$0 >> 2] | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKcS2_($1, $4, $4 + 8 | 0); + $6 = __ZNK12_GLOBAL__N_110StringView5beginEv($1) | 0; + $7 = __ZNK12_GLOBAL__N_110StringView3endEv($1) | 0; + $$020 = $6; + while (1) { + if (($$020 | 0) == ($7 | 0)) { + label = 5; + break; + } + if (!(_isxdigit(HEAP8[$$020 >> 0] | 0) | 0)) { + $$3 = 0; + break; + } else $$020 = $$020 + 1 | 0; + } + if ((label | 0) == 5) { + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 8; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0) $$3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_16FloatLiteralImplIfEEJRNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $1) | 0; else $$3 = 0; + } + $$4 = $$3; + } + STACKTOP = sp; + return $$4 | 0; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $11 = 0, $14 = 0, $21 = 0, $27 = 0, $29 = 0, $37 = 0, $39 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + $7 = $0 + 8 | 0; + $11 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$7 >> 2] | 0) + 8 >> 2] & 127]($7) | 0; + $14 = HEAP8[$11 + 8 + 3 >> 0] | 0; + if ($14 << 24 >> 24 < 0) $29 = HEAP32[$11 + 4 >> 2] | 0; else $29 = $14 & 255; + $21 = HEAP8[$11 + 20 + 3 >> 0] | 0; + if ($21 << 24 >> 24 < 0) $27 = HEAP32[$11 + 16 >> 2] | 0; else $27 = $21 & 255; + do if (($29 | 0) != (0 - $27 | 0)) { + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $37 = (__ZNSt3__214__scan_keywordINS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEPKNS_12basic_stringIwS3_NS_9allocatorIwEEEENS_5ctypeIwEEEET0_RT_SE_SD_SD_RKT1_Rjb($2, $$byval_copy, $11, $11 + 24 | 0, $5, $4, 0) | 0) - $11 | 0; + $39 = HEAP32[$1 >> 2] | 0; + if (($39 | 0) == 12 & ($37 | 0) == 0) { + HEAP32[$1 >> 2] = 0; + break; + } + if (($39 | 0) < 12 & ($37 | 0) == 12) HEAP32[$1 >> 2] = $39 + 12; + } else HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 4; while (0); + STACKTOP = sp; + return; +} + +function __ZN6vision5Swap9IfEEvPT_S2_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $12 = 0, $13 = 0, $14 = 0, $16 = 0, $17 = 0, $18 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $24 = 0, $25 = 0, $26 = 0, $28 = 0, $29 = 0, $30 = 0, $32 = 0, $33 = 0, $34 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = 0, $9 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $4 = $0 + 4 | 0; + HEAP32[$0 >> 2] = HEAP32[$1 >> 2]; + $5 = $1 + 4 | 0; + HEAP32[$1 >> 2] = $2; + $6 = HEAP32[$4 >> 2] | 0; + $8 = $0 + 8 | 0; + HEAP32[$4 >> 2] = HEAP32[$5 >> 2]; + $9 = $1 + 8 | 0; + HEAP32[$5 >> 2] = $6; + $10 = HEAP32[$8 >> 2] | 0; + $12 = $0 + 12 | 0; + HEAP32[$8 >> 2] = HEAP32[$9 >> 2]; + $13 = $1 + 12 | 0; + HEAP32[$9 >> 2] = $10; + $14 = HEAP32[$12 >> 2] | 0; + $16 = $0 + 16 | 0; + HEAP32[$12 >> 2] = HEAP32[$13 >> 2]; + $17 = $1 + 16 | 0; + HEAP32[$13 >> 2] = $14; + $18 = HEAP32[$16 >> 2] | 0; + $20 = $0 + 20 | 0; + HEAP32[$16 >> 2] = HEAP32[$17 >> 2]; + $21 = $1 + 20 | 0; + HEAP32[$17 >> 2] = $18; + $22 = HEAP32[$20 >> 2] | 0; + $24 = $0 + 24 | 0; + HEAP32[$20 >> 2] = HEAP32[$21 >> 2]; + $25 = $1 + 24 | 0; + HEAP32[$21 >> 2] = $22; + $26 = HEAP32[$24 >> 2] | 0; + $28 = $0 + 28 | 0; + HEAP32[$24 >> 2] = HEAP32[$25 >> 2]; + $29 = $1 + 28 | 0; + HEAP32[$25 >> 2] = $26; + $30 = HEAP32[$28 >> 2] | 0; + $32 = $0 + 32 | 0; + HEAP32[$28 >> 2] = HEAP32[$29 >> 2]; + $33 = $1 + 32 | 0; + HEAP32[$29 >> 2] = $30; + $34 = HEAP32[$32 >> 2] | 0; + HEAP32[$32 >> 2] = HEAP32[$33 >> 2]; + HEAP32[$33 >> 2] = $34; + return; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $11 = 0, $13 = 0, $20 = 0, $26 = 0, $28 = 0, $36 = 0, $38 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + $7 = $0 + 8 | 0; + $11 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$7 >> 2] | 0) + 8 >> 2] & 127]($7) | 0; + $13 = HEAP8[$11 + 11 >> 0] | 0; + if ($13 << 24 >> 24 < 0) $28 = HEAP32[$11 + 4 >> 2] | 0; else $28 = $13 & 255; + $20 = HEAP8[$11 + 12 + 11 >> 0] | 0; + if ($20 << 24 >> 24 < 0) $26 = HEAP32[$11 + 16 >> 2] | 0; else $26 = $20 & 255; + do if (($28 | 0) != (0 - $26 | 0)) { + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $36 = (__ZNSt3__214__scan_keywordINS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEPKNS_12basic_stringIcS3_NS_9allocatorIcEEEENS_5ctypeIcEEEET0_RT_SE_SD_SD_RKT1_Rjb($2, $$byval_copy, $11, $11 + 24 | 0, $5, $4, 0) | 0) - $11 | 0; + $38 = HEAP32[$1 >> 2] | 0; + if (($38 | 0) == 12 & ($36 | 0) == 0) { + HEAP32[$1 >> 2] = 0; + break; + } + if (($38 | 0) < 12 & ($36 | 0) == 12) HEAP32[$1 >> 2] = $38 + 12; + } else HEAP32[$4 >> 2] = HEAP32[$4 >> 2] | 4; while (0); + STACKTOP = sp; + return; +} + +function _icpGetJ_U_Xc($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $12 = 0, $15 = 0.0, $20 = 0.0, $21 = 0, $24 = 0, $28 = 0, $3 = 0.0, $34 = 0.0, $35 = 0, $36 = 0.0, $38 = 0, $4 = 0.0, $42 = 0, $48 = 0.0, $50 = 0.0, $6 = 0, $9 = 0.0; + $3 = +HEAPF64[$1 >> 3]; + $4 = +HEAPF64[$2 >> 3]; + $6 = $1 + 8 | 0; + $9 = +HEAPF64[$2 + 8 >> 3]; + $12 = $1 + 16 | 0; + $15 = +HEAPF64[$2 + 16 >> 3]; + $20 = +HEAPF64[$1 + 24 >> 3] + ($3 * $4 + +HEAPF64[$6 >> 3] * $9 + +HEAPF64[$12 >> 3] * $15); + $21 = $1 + 32 | 0; + $24 = $1 + 40 | 0; + $28 = $1 + 48 | 0; + $34 = +HEAPF64[$1 + 56 >> 3] + ($4 * +HEAPF64[$21 >> 3] + $9 * +HEAPF64[$24 >> 3] + $15 * +HEAPF64[$28 >> 3]); + $35 = $1 + 64 | 0; + $36 = +HEAPF64[$35 >> 3]; + $38 = $1 + 72 | 0; + $42 = $1 + 80 | 0; + $48 = +HEAPF64[$1 + 88 >> 3] + ($4 * $36 + $9 * +HEAPF64[$38 >> 3] + $15 * +HEAPF64[$42 >> 3]); + if ($48 == 0.0) $$0 = -1; else { + $50 = $48 * $48; + HEAPF64[$0 >> 3] = ($3 * $48 - $20 * $36) / $50; + HEAPF64[$0 + 8 >> 3] = ($48 * +HEAPF64[$6 >> 3] - $20 * +HEAPF64[$38 >> 3]) / $50; + HEAPF64[$0 + 16 >> 3] = ($48 * +HEAPF64[$12 >> 3] - $20 * +HEAPF64[$42 >> 3]) / $50; + HEAPF64[$0 + 24 >> 3] = ($48 * +HEAPF64[$21 >> 3] - $34 * +HEAPF64[$35 >> 3]) / $50; + HEAPF64[$0 + 32 >> 3] = ($48 * +HEAPF64[$24 >> 3] - $34 * +HEAPF64[$38 >> 3]) / $50; + HEAPF64[$0 + 40 >> 3] = ($48 * +HEAPF64[$28 >> 3] - $34 * +HEAPF64[$42 >> 3]) / $50; + $$0 = 0; + } + return $$0 | 0; +} + +function ___fwritex($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$03846 = 0, $$1 = 0, $$139 = 0, $$141 = 0, $$143 = 0, $10 = 0, $12 = 0, $14 = 0, $23 = 0, $29 = 0, $3 = 0, $32 = 0, $4 = 0, $9 = 0, label = 0; + $3 = $2 + 16 | 0; + $4 = HEAP32[$3 >> 2] | 0; + if (!$4) if (!(___towrite($2) | 0)) { + $12 = HEAP32[$3 >> 2] | 0; + label = 5; + } else $$1 = 0; else { + $12 = $4; + label = 5; + } + L5 : do if ((label | 0) == 5) { + $9 = $2 + 20 | 0; + $10 = HEAP32[$9 >> 2] | 0; + $14 = $10; + if (($12 - $10 | 0) >>> 0 < $1 >>> 0) { + $$1 = FUNCTION_TABLE_iiii[HEAP32[$2 + 36 >> 2] & 63]($2, $0, $1) | 0; + break; + } + L10 : do if ((HEAP8[$2 + 75 >> 0] | 0) < 0 | ($1 | 0) == 0) { + $$139 = 0; + $$141 = $0; + $$143 = $1; + $32 = $14; + } else { + $$03846 = $1; + while (1) { + $23 = $$03846 + -1 | 0; + if ((HEAP8[$0 + $23 >> 0] | 0) == 10) break; + if (!$23) { + $$139 = 0; + $$141 = $0; + $$143 = $1; + $32 = $14; + break L10; + } else $$03846 = $23; + } + $29 = FUNCTION_TABLE_iiii[HEAP32[$2 + 36 >> 2] & 63]($2, $0, $$03846) | 0; + if ($29 >>> 0 < $$03846 >>> 0) { + $$1 = $29; + break L5; + } + $$139 = $$03846; + $$141 = $0 + $$03846 | 0; + $$143 = $1 - $$03846 | 0; + $32 = HEAP32[$9 >> 2] | 0; + } while (0); + _memcpy($32 | 0, $$141 | 0, $$143 | 0) | 0; + HEAP32[$9 >> 2] = (HEAP32[$9 >> 2] | 0) + $$143; + $$1 = $$139 + $$143 | 0; + } while (0); + return $$1 | 0; +} + +function __ZNSt3__26vectorIN6vision5ImageENS_9allocatorIS2_EEE8__appendEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $13 = 0, $14 = 0, $18 = 0, $19 = 0, $2 = 0, $23 = 0, $3 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 8 | 0; + $5 = $0 + 4 | 0; + $6 = HEAP32[$5 >> 2] | 0; + do if ((HEAP32[$3 >> 2] | 0) - $6 >> 5 >>> 0 < $1 >>> 0) { + $13 = ($6 - (HEAP32[$0 >> 2] | 0) >> 5) + $1 | 0; + $14 = __ZNKSt3__26vectorIN6vision5ImageENS_9allocatorIS2_EEE8max_sizeEv($0) | 0; + if ($14 >>> 0 < $13 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $18 = HEAP32[$0 >> 2] | 0; + $19 = (HEAP32[$3 >> 2] | 0) - $18 | 0; + $23 = $19 >> 4; + __ZNSt3__214__split_bufferIN6vision5ImageERNS_9allocatorIS2_EEEC2EmmS5_($2, $19 >> 5 >>> 0 < $14 >>> 1 >>> 0 ? ($23 >>> 0 < $13 >>> 0 ? $13 : $23) : $14, (HEAP32[$5 >> 2] | 0) - $18 >> 5, $0 + 8 | 0); + __ZNSt3__214__split_bufferIN6vision5ImageERNS_9allocatorIS2_EEE18__construct_at_endEm($2, $1); + __ZNSt3__26vectorIN6vision5ImageENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE($0, $2); + __ZNSt3__214__split_bufferIN6vision5ImageERNS_9allocatorIS2_EEED2Ev($2); + break; + } + } else __ZNSt3__26vectorIN6vision5ImageENS_9allocatorIS2_EEE18__construct_at_endEm($0, $1); while (0); + STACKTOP = sp; + return; +} + +function _alloc_barray($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$ = 0, $$04853 = 0, $$04956 = 0, $$054 = 0, $$1$lcssa = 0, $$15155 = 0, $$152 = 0, $15 = 0, $17 = 0, $18 = 0, $21 = 0, $23 = 0, $24 = 0, $5 = 0, $6 = 0, $7 = 0, $9 = 0, $umax = 0, $$15155$looptemp = 0; + $5 = HEAP32[$0 + 4 >> 2] | 0; + $6 = $2 << 7; + $7 = 999999984 / ($6 >>> 0) | 0; + if ($6 >>> 0 > 999999984) { + $9 = HEAP32[$0 >> 2] | 0; + HEAP32[$9 + 20 >> 2] = 72; + FUNCTION_TABLE_vi[HEAP32[$9 >> 2] & 255]($0); + } + $$ = ($7 | 0) < ($3 | 0) ? $7 : $3; + HEAP32[$5 + 80 >> 2] = $$; + $15 = _alloc_small($0, $1, $3 << 2) | 0; + if (!$3) return $15 | 0; + $17 = ~$3; + $$04956 = 0; + $$15155 = $$; + while (1) { + $18 = $3 - $$04956 | 0; + $$15155$looptemp = $$15155; + $$15155 = $$15155 >>> 0 < $18 >>> 0 ? $$15155 : $18; + $21 = _alloc_large($0, $1, Math_imul($6, $$15155) | 0) | 0; + if (!$$15155) $$1$lcssa = $$04956; else { + $23 = $$04956 + $17 | 0; + $24 = ~$$15155$looptemp; + $umax = $23 >>> 0 > $24 >>> 0 ? $23 : $24; + $$04853 = $$15155; + $$054 = $21; + $$152 = $$04956; + while (1) { + HEAP32[$15 + ($$152 << 2) >> 2] = $$054; + $$04853 = $$04853 + -1 | 0; + if (!$$04853) break; else { + $$054 = $$054 + ($2 << 7) | 0; + $$152 = $$152 + 1 | 0; + } + } + $$1$lcssa = $$04956 + -1 - $umax | 0; + } + if ($$1$lcssa >>> 0 >= $3 >>> 0) break; else $$04956 = $$1$lcssa; + } + return $15 | 0; +} + +function __ZNSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE21__push_back_slow_pathIS3_EEvOT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $14 = 0, $16 = 0, $19 = 0, $2 = 0, $24 = 0, $25 = 0, $3 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 4 | 0; + $8 = (((HEAP32[$3 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) | 0) / 12 | 0) + 1 | 0; + $9 = __ZNKSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE8max_sizeEv($0) | 0; + if ($9 >>> 0 < $8 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $14 = HEAP32[$0 >> 2] | 0; + $16 = ((HEAP32[$0 + 8 >> 2] | 0) - $14 | 0) / 12 | 0; + $19 = $16 << 1; + __ZNSt3__214__split_bufferIN6vision7Point3dIfEERNS_9allocatorIS3_EEEC2EmmS6_($2, $16 >>> 0 < $9 >>> 1 >>> 0 ? ($19 >>> 0 < $8 >>> 0 ? $8 : $19) : $9, ((HEAP32[$3 >> 2] | 0) - $14 | 0) / 12 | 0, $0 + 8 | 0); + $24 = $2 + 8 | 0; + $25 = HEAP32[$24 >> 2] | 0; + HEAP32[$25 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$25 + 4 >> 2] = HEAP32[$1 + 4 >> 2]; + HEAP32[$25 + 8 >> 2] = HEAP32[$1 + 8 >> 2]; + HEAP32[$24 >> 2] = (HEAP32[$24 >> 2] | 0) + 12; + __ZNSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS5_EE($0, $2); + __ZNSt3__214__split_bufferIN6vision7Point3dIfEERNS_9allocatorIS3_EEED2Ev($2); + STACKTOP = sp; + return; + } +} + +function __ZNK12_GLOBAL__N_116itanium_demangle15BracedRangeExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy1 = 0, $11 = 0, $2 = 0, $3 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 16 | 0; + $2 = sp + 8 | 0; + $3 = sp; + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 91); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 53398); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 12 >> 2] | 0, $1); + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 93); + $8 = $0 + 16 | 0; + $9 = HEAP32[$8 >> 2] | 0; + if (((__ZNK12_GLOBAL__N_116itanium_demangle4Node7getKindEv($9) | 0) + -65 & 255) < 2) $11 = $9; else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 53404); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + $11 = HEAP32[$8 >> 2] | 0; + } + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE($11, $1); + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorINS_4pairIfiEENS_9allocatorIS2_EEE8__appendEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $13 = 0, $14 = 0, $18 = 0, $19 = 0, $2 = 0, $23 = 0, $3 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 8 | 0; + $5 = $0 + 4 | 0; + $6 = HEAP32[$5 >> 2] | 0; + do if ((HEAP32[$3 >> 2] | 0) - $6 >> 3 >>> 0 < $1 >>> 0) { + $13 = ($6 - (HEAP32[$0 >> 2] | 0) >> 3) + $1 | 0; + $14 = __ZNKSt3__26vectorINS_4pairIfiEENS_9allocatorIS2_EEE8max_sizeEv($0) | 0; + if ($14 >>> 0 < $13 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $18 = HEAP32[$0 >> 2] | 0; + $19 = (HEAP32[$3 >> 2] | 0) - $18 | 0; + $23 = $19 >> 2; + __ZNSt3__214__split_bufferINS_4pairIfiEERNS_9allocatorIS2_EEEC2EmmS5_($2, $19 >> 3 >>> 0 < $14 >>> 1 >>> 0 ? ($23 >>> 0 < $13 >>> 0 ? $13 : $23) : $14, (HEAP32[$5 >> 2] | 0) - $18 >> 3, $0 + 8 | 0); + __ZNSt3__214__split_bufferINS_4pairIfiEERNS_9allocatorIS2_EEE18__construct_at_endEm($2, $1); + __ZNSt3__26vectorINS_4pairIfiEENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE($0, $2); + __ZNSt3__214__split_bufferINS_4pairIfiEERNS_9allocatorIS2_EEED2Ev($2); + break; + } + } else __ZNSt3__26vectorINS_4pairIfiEENS_9allocatorIS2_EEE18__construct_at_endEm($0, $1); while (0); + STACKTOP = sp; + return; +} + +function __ZN6vision21DenormalizeHomographyIfEEvPT_PKS1_S1_S4_S1_S4_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = +$2; + $3 = $3 | 0; + $4 = +$4; + $5 = $5 | 0; + var $10 = 0, $11 = 0.0, $18 = 0.0, $19 = 0.0, $20 = 0, $21 = 0.0, $30 = 0.0, $31 = 0.0, $33 = 0.0, $34 = 0, $36 = 0.0, $40 = 0, $6 = 0, $7 = 0.0, $70 = 0.0, $73 = 0.0, $8 = 0.0; + $6 = $1 + 24 | 0; + $7 = +HEAPF32[$6 >> 2]; + $8 = +HEAPF32[$5 >> 2]; + $10 = $1 + 28 | 0; + $11 = +HEAPF32[$10 >> 2]; + $18 = $7 * $8 + +HEAPF32[$1 >> 2] / $4; + $19 = $8 * $11 + +HEAPF32[$1 + 4 >> 2] / $4; + $20 = $5 + 4 | 0; + $21 = +HEAPF32[$20 >> 2]; + $30 = $7 * $21 + +HEAPF32[$1 + 12 >> 2] / $4; + $31 = $11 * $21 + +HEAPF32[$1 + 16 >> 2] / $4; + $33 = +HEAPF32[$3 >> 2] * $2; + $34 = $3 + 4 | 0; + $36 = +HEAPF32[$34 >> 2] * $2; + HEAPF32[$0 >> 2] = $18 * $2; + HEAPF32[$0 + 4 >> 2] = $19 * $2; + $40 = $1 + 32 | 0; + HEAPF32[$0 + 8 >> 2] = +HEAPF32[$40 >> 2] * +HEAPF32[$5 >> 2] + +HEAPF32[$1 + 8 >> 2] / $4 - $18 * $33 - $19 * $36; + HEAPF32[$0 + 12 >> 2] = $30 * $2; + HEAPF32[$0 + 16 >> 2] = $31 * $2; + HEAPF32[$0 + 20 >> 2] = +HEAPF32[$40 >> 2] * +HEAPF32[$20 >> 2] + +HEAPF32[$1 + 20 >> 2] / $4 - $30 * $33 - $31 * $36; + $70 = +HEAPF32[$6 >> 2] * $2; + HEAPF32[$0 + 24 >> 2] = $70; + $73 = +HEAPF32[$10 >> 2] * $2; + HEAPF32[$0 + 28 >> 2] = $73; + HEAPF32[$0 + 32 >> 2] = +HEAPF32[$40 >> 2] - $70 * +HEAPF32[$3 >> 2] - $73 * +HEAPF32[$34 >> 2]; + return; +} + +function _arLogv($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $10 = 0, $17 = 0, $18 = 0, $19 = 0, $28 = 0, $32 = 0, $4 = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $vararg_buffer = sp + 16 | 0; + $4 = sp; + if ((!(($2 | 0) == 0 | (HEAP32[4186] | 0) > ($1 | 0)) ? HEAP8[$2 >> 0] | 0 : 0) ? (HEAP32[$4 >> 2] = HEAP32[$3 >> 2], $10 = _vsnprintf(0, 0, $2, $4) | 0, $10 | 0) : 0) { + if ($1 >>> 0 < 4) $$0 = (_strlen(HEAP32[1744 + ($1 << 2) >> 2] | 0) | 0) + 3 | 0; else $$0 = 0; + $17 = $$0 + $10 | 0; + $18 = $17 + 1 | 0; + $19 = _malloc($18) | 0; + if ($$0 | 0) { + HEAP32[$vararg_buffer >> 2] = HEAP32[1744 + ($1 << 2) >> 2]; + _snprintf($19, $$0 + 1 | 0, 25625, $vararg_buffer) | 0; + } + _vsnprintf($19 + $$0 | 0, $10 + 1 | 0, $2, $3) | 0; + do if (0) { + if (0 ? ($28 = HEAP32[16308] | 0, $28 >>> 0 < 0) : 0) { + $32 = 0 + $28 | 0; + if ($17 >>> 0 > (-4 - $28 + 0 | 0) >>> 0) { + HEAP8[$32 >> 0] = 46; + HEAP8[$32 + 1 >> 0] = 46; + HEAP8[$32 + 2 >> 0] = 46; + HEAP8[$32 + 3 >> 0] = 0; + HEAP32[16308] = 0; + break; + } else { + _strncpy($32, $19, $18) | 0; + HEAP32[16308] = (HEAP32[16308] | 0) + $17; + break; + } + } + } else _fputs($19, HEAP32[4271] | 0) | 0; while (0); + _free($19); + } + STACKTOP = sp; + return; +} + +function __ZN6vision25CheckHomographyHeuristicsEPfii($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$1 = 0, $10 = 0, $12 = 0.0, $15 = 0.0, $20 = 0.0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 96 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(96); + $3 = sp + 88 | 0; + $4 = sp + 80 | 0; + $5 = sp + 72 | 0; + $6 = sp + 64 | 0; + $7 = sp; + $8 = sp + 56 | 0; + $9 = sp + 48 | 0; + $10 = sp + 40 | 0; + if (__ZN6vision16MatrixInverse3x3IfEEbPT_PKS1_S1_($7, $0, 9.999999747378752e-06) | 0) { + $12 = +($1 | 0); + HEAPF32[$8 >> 2] = $12; + HEAPF32[$8 + 4 >> 2] = 0.0; + HEAPF32[$9 >> 2] = $12; + $15 = +($2 | 0); + HEAPF32[$9 + 4 >> 2] = $15; + HEAPF32[$10 >> 2] = 0.0; + HEAPF32[$10 + 4 >> 2] = $15; + __ZN6vision35MultiplyPointHomographyInhomogenousIfEEvPT_PKS1_S4_($3, $7, 65252); + __ZN6vision35MultiplyPointHomographyInhomogenousIfEEvPT_PKS1_S4_($4, $7, $8); + __ZN6vision35MultiplyPointHomographyInhomogenousIfEEvPT_PKS1_S4_($5, $7, $9); + __ZN6vision35MultiplyPointHomographyInhomogenousIfEEvPT_PKS1_S4_($6, $7, $10); + $20 = +(Math_imul($2, $1) | 0) * .0001; + if (+__ZN6vision20SmallestTriangleAreaIfEET_PKS1_S3_S3_S3_($3, $4, $5, $6) < $20) $$0 = 0; else $$0 = __ZN6vision19QuadrilateralConvexIfEEbPKT_S3_S3_S3_($3, $4, $5, $6) | 0; + $$1 = $$0; + } else $$1 = 0; + STACKTOP = sp; + return $$1 | 0; +} + +function _xt_by_x($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$051 = 0, $$052 = 0, $$053 = 0, $$054 = 0, $$055 = 0, $$056 = 0, $$1 = 0, $12 = 0, $17 = 0, $19 = 0, $26 = 0.0, $27 = 0.0, $3 = 0, $5 = 0; + $3 = HEAP32[$0 + 4 >> 2] | 0; + $5 = HEAP32[$0 + 8 >> 2] | 0; + L1 : do if ((HEAP32[$1 + 4 >> 2] | 0) == ($5 | 0) ? (HEAP32[$1 + 8 >> 2] | 0) == ($5 | 0) : 0) { + $12 = HEAP32[$1 >> 2] | 0; + $$052 = 0; + $$055 = $12; + while (1) { + if (($$052 | 0) >= ($5 | 0)) { + $$053 = 0; + break L1; + } + $$051 = 0; + $$1 = $$055; + while (1) { + if (($$051 | 0) == ($5 | 0)) break; + L10 : do if ($$051 >>> 0 < $$052 >>> 0) { + $17 = $12 + ((Math_imul($$051, $5) | 0) + $$052 << 3) | 0; + HEAPF64[$$1 >> 3] = +HEAPF64[$17 >> 3]; + } else { + $19 = HEAP32[$0 >> 2] | 0; + HEAPF64[$$1 >> 3] = 0.0; + $$0 = 0; + $$054 = $19 + ($$052 << 3) | 0; + $$056 = $19 + ($$051 << 3) | 0; + $27 = 0.0; + while (1) { + if (($$0 | 0) >= ($3 | 0)) break L10; + $26 = $27 + +HEAPF64[$$054 >> 3] * +HEAPF64[$$056 >> 3]; + HEAPF64[$$1 >> 3] = $26; + $$0 = $$0 + 1 | 0; + $$054 = $$054 + ($5 << 3) | 0; + $$056 = $$056 + ($5 << 3) | 0; + $27 = $26; + } + } while (0); + $$051 = $$051 + 1 | 0; + $$1 = $$1 + 8 | 0; + } + $$052 = $$052 + 1 | 0; + $$055 = $$055 + ($5 << 3) | 0; + } + } else $$053 = -1; while (0); + return $$053 | 0; +} + +function __ZNSt3__227__num_get_unsigned_integralItEET_PKcS3_Rji($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$028 = 0, $$029 = 0, $$2 = 0, $10 = 0, $11 = 0, $12 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $4 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp; + do if (($0 | 0) == ($1 | 0)) { + HEAP32[$2 >> 2] = 4; + $$2 = 0; + } else { + $7 = (HEAP8[$0 >> 0] | 0) == 45; + if ($7) { + $8 = $0 + 1 | 0; + if (($8 | 0) == ($1 | 0)) { + HEAP32[$2 >> 2] = 4; + $$2 = 0; + break; + } else $$029 = $8; + } else $$029 = $0; + $10 = ___errno_location() | 0; + $11 = HEAP32[$10 >> 2] | 0; + $12 = ___errno_location() | 0; + HEAP32[$12 >> 2] = 0; + $14 = _strtoull_l($$029, $4, $3, __ZNSt3__26__clocEv() | 0) | 0; + $15 = getTempRet0() | 0; + $16 = ___errno_location() | 0; + $17 = HEAP32[$16 >> 2] | 0; + if (!$17) { + $19 = ___errno_location() | 0; + HEAP32[$19 >> 2] = $11; + } + do if ((HEAP32[$4 >> 2] | 0) == ($1 | 0)) { + if ($15 >>> 0 > 0 | ($15 | 0) == 0 & $14 >>> 0 > 65535 | ($17 | 0) == 68) { + HEAP32[$2 >> 2] = 4; + $$028 = -1; + break; + } + if ($7) $$028 = 0 - $14 & 65535; else $$028 = $14 & 65535; + } else { + HEAP32[$2 >> 2] = 4; + $$028 = 0; + } while (0); + $$2 = $$028; + } while (0); + STACKTOP = sp; + return $$2 | 0; +} + +function _alloc_sarray($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$ = 0, $$04853 = 0, $$04956 = 0, $$054 = 0, $$1$lcssa = 0, $$15155 = 0, $$152 = 0, $14 = 0, $16 = 0, $17 = 0, $20 = 0, $22 = 0, $23 = 0, $5 = 0, $6 = 0, $8 = 0, $umax = 0, $$15155$looptemp = 0; + $5 = HEAP32[$0 + 4 >> 2] | 0; + $6 = 999999984 / ($2 >>> 0) | 0; + if ($2 >>> 0 > 999999984) { + $8 = HEAP32[$0 >> 2] | 0; + HEAP32[$8 + 20 >> 2] = 72; + FUNCTION_TABLE_vi[HEAP32[$8 >> 2] & 255]($0); + } + $$ = ($6 | 0) < ($3 | 0) ? $6 : $3; + HEAP32[$5 + 80 >> 2] = $$; + $14 = _alloc_small($0, $1, $3 << 2) | 0; + if (!$3) return $14 | 0; + $16 = ~$3; + $$04956 = 0; + $$15155 = $$; + while (1) { + $17 = $3 - $$04956 | 0; + $$15155$looptemp = $$15155; + $$15155 = $$15155 >>> 0 < $17 >>> 0 ? $$15155 : $17; + $20 = _alloc_large($0, $1, Math_imul($$15155, $2) | 0) | 0; + if (!$$15155) $$1$lcssa = $$04956; else { + $22 = $$04956 + $16 | 0; + $23 = ~$$15155$looptemp; + $umax = $22 >>> 0 > $23 >>> 0 ? $22 : $23; + $$04853 = $$15155; + $$054 = $20; + $$152 = $$04956; + while (1) { + HEAP32[$14 + ($$152 << 2) >> 2] = $$054; + $$04853 = $$04853 + -1 | 0; + if (!$$04853) break; else { + $$054 = $$054 + $2 | 0; + $$152 = $$152 + 1 | 0; + } + } + $$1$lcssa = $$04956 + -1 - $umax | 0; + } + if ($$1$lcssa >>> 0 >= $3 >>> 0) break; else $$04956 = $$1$lcssa; + } + return $14 | 0; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIiNS_9allocatorIiEEEEEENS_22__unordered_map_hasherIiS6_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS6_NS_8equal_toIiEELb1EEENS3_IS6_EEE6rehashEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$sroa$speculated = 0, $22 = 0, $27 = 0, $30 = 0, $8 = 0; + if (($1 | 0) != 1) if (!($1 + -1 & $1)) $$0 = $1; else $$0 = __ZNSt3__212__next_primeEm($1) | 0; else $$0 = 2; + $8 = HEAP32[$0 + 4 >> 2] | 0; + if ($$0 >>> 0 <= $8 >>> 0) { + if ($$0 >>> 0 < $8 >>> 0) { + $22 = ~~+Math_ceil(+(+((HEAP32[$0 + 12 >> 2] | 0) >>> 0) / +HEAPF32[$0 + 16 >> 2])) >>> 0; + if ($8 >>> 0 > 2 & ($8 + -1 & $8 | 0) == 0) { + $27 = 1 << 32 - (Math_clz32($22 + -1 | 0) | 0); + $30 = $22 >>> 0 < 2 ? $22 : $27; + } else $30 = __ZNSt3__212__next_primeEm($22) | 0; + $$sroa$speculated = $$0 >>> 0 < $30 >>> 0 ? $30 : $$0; + if ($$sroa$speculated >>> 0 < $8 >>> 0) __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIiNS_9allocatorIiEEEEEENS_22__unordered_map_hasherIiS6_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS6_NS_8equal_toIiEELb1EEENS3_IS6_EEE8__rehashEm($0, $$sroa$speculated); + } + } else __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIiNS_9allocatorIiEEEEEENS_22__unordered_map_hasherIiS6_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS6_NS_8equal_toIiEELb1EEENS3_IS6_EEE8__rehashEm($0, $$0); + return; +} + +function __ZL18genBWImageOneThirdPhiiPiS0_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$052 = 0, $$053 = 0, $$054 = 0, $$055 = 0, $$056 = 0, $$1 = 0, $11 = 0, $5 = 0, $6 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $5 = ($1 | 0) / 3 | 0; + HEAP32[$3 >> 2] = $5; + $6 = ($2 | 0) / 3 | 0; + HEAP32[$4 >> 2] = $6; + $8 = _malloc(Math_imul($6, $5) | 0) | 0; + if (!$8) { + _arLog(0, 3, 45930, sp); + _exit(1); + } + $$0 = 0; + $$053 = $8; + while (1) { + if (($$0 | 0) >= ($6 | 0)) break; + $11 = $$0 * 3 | 0; + $$052 = 0; + $$054 = $0 + (Math_imul($11, $1) | 0) | 0; + $$055 = $0 + (Math_imul($11 + 2 | 0, $1) | 0) | 0; + $$056 = $0 + (Math_imul($11 + 1 | 0, $1) | 0) | 0; + $$1 = $$053; + while (1) { + if (($$052 | 0) >= ($5 | 0)) break; + HEAP8[$$1 >> 0] = ((HEAPU8[$$054 + 1 >> 0] | 0) + (HEAPU8[$$054 >> 0] | 0) + (HEAPU8[$$054 + 2 >> 0] | 0) + (HEAPU8[$$056 >> 0] | 0) + (HEAPU8[$$056 + 1 >> 0] | 0) + (HEAPU8[$$056 + 2 >> 0] | 0) + (HEAPU8[$$055 >> 0] | 0) + (HEAPU8[$$055 + 1 >> 0] | 0) + (HEAPU8[$$055 + 2 >> 0] | 0) | 0) / 9 | 0; + $$052 = $$052 + 1 | 0; + $$054 = $$054 + 3 | 0; + $$055 = $$055 + 3 | 0; + $$056 = $$056 + 3 | 0; + $$1 = $$1 + 1 | 0; + } + $$0 = $$0 + 1 | 0; + $$053 = $$1; + } + STACKTOP = sp; + return $8 | 0; +} + +function _jpeg_finish_decompress($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0, $11 = 0, $18 = 0, $2 = 0, $23 = 0, $24 = 0, $33 = 0, label = 0; + $1 = $0 + 20 | 0; + $2 = HEAP32[$1 >> 2] | 0; + if (($2 + -205 | 0) >>> 0 < 2 ? (HEAP32[$0 + 64 >> 2] | 0) == 0 : 0) { + if ((HEAP32[$0 + 140 >> 2] | 0) >>> 0 < (HEAP32[$0 + 116 >> 2] | 0) >>> 0) { + $11 = HEAP32[$0 >> 2] | 0; + HEAP32[$11 + 20 >> 2] = 69; + FUNCTION_TABLE_vi[HEAP32[$11 >> 2] & 255]($0); + } + FUNCTION_TABLE_vi[HEAP32[(HEAP32[$0 + 444 >> 2] | 0) + 4 >> 2] & 255]($0); + HEAP32[$1 >> 2] = 210; + } else label = 6; + L7 : do if ((label | 0) == 6) switch ($2 | 0) { + case 210: + { + break L7; + break; + } + case 207: + { + HEAP32[$1 >> 2] = 210; + break L7; + break; + } + default: + { + $18 = HEAP32[$0 >> 2] | 0; + HEAP32[$18 + 20 >> 2] = 21; + HEAP32[$18 + 24 >> 2] = $2; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + break L7; + } + } while (0); + $23 = $0 + 460 | 0; + $24 = HEAP32[$23 >> 2] | 0; + L13 : do if (!(HEAP32[$24 + 20 >> 2] | 0)) { + $33 = $24; + while (1) { + if (!(FUNCTION_TABLE_ii[HEAP32[$33 >> 2] & 127]($0) | 0)) { + $$0 = 0; + break; + } + $33 = HEAP32[$23 >> 2] | 0; + if (HEAP32[$33 + 20 >> 2] | 0) break L13; + } + return $$0 | 0; + } while (0); + FUNCTION_TABLE_vi[HEAP32[(HEAP32[$0 + 24 >> 2] | 0) + 24 >> 2] & 255]($0); + _jpeg_abort($0); + $$0 = 1; + return $$0 | 0; +} + +function __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE21__push_back_slow_pathIRKS2_EEvOT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $14 = 0, $15 = 0, $19 = 0, $2 = 0, $24 = 0, $26 = 0, $3 = 0, $31 = 0, $32 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 4 | 0; + $8 = ((HEAP32[$3 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 3) + 1 | 0; + $9 = __ZNKSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE8max_sizeEv($0) | 0; + if ($9 >>> 0 < $8 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $14 = HEAP32[$0 >> 2] | 0; + $15 = (HEAP32[$0 + 8 >> 2] | 0) - $14 | 0; + $19 = $15 >> 2; + __ZNSt3__214__split_bufferIN6vision7match_tERNS_9allocatorIS2_EEEC2EmmS5_($2, $15 >> 3 >>> 0 < $9 >>> 1 >>> 0 ? ($19 >>> 0 < $8 >>> 0 ? $8 : $19) : $9, (HEAP32[$3 >> 2] | 0) - $14 >> 3, $0 + 8 | 0); + $24 = $2 + 8 | 0; + $26 = $1; + $31 = HEAP32[$26 + 4 >> 2] | 0; + $32 = HEAP32[$24 >> 2] | 0; + HEAP32[$32 >> 2] = HEAP32[$26 >> 2]; + HEAP32[$32 + 4 >> 2] = $31; + HEAP32[$24 >> 2] = (HEAP32[$24 >> 2] | 0) + 8; + __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE($0, $2); + __ZNSt3__214__split_bufferIN6vision7match_tERNS_9allocatorIS2_EEED2Ev($2); + STACKTOP = sp; + return; + } +} + +function _strcspn($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$01823 = 0, $$019$lcssa$sink = 0, $$01920 = 0, $10 = 0, $12 = 0, $13 = 0, $17 = 0, $2 = 0, $23 = 0, $25 = 0, $26 = 0, $3 = 0, $34 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = HEAP8[$1 >> 0] | 0; + L1 : do if ($3 << 24 >> 24 != 0 ? (HEAP8[$1 + 1 >> 0] | 0) != 0 : 0) { + _memset($2 | 0, 0, 32) | 0; + $10 = HEAP8[$1 >> 0] | 0; + if ($10 << 24 >> 24) { + $$01823 = $1; + $13 = $10; + do { + $12 = $13 & 255; + $17 = $2 + ($12 >>> 5 << 2) | 0; + HEAP32[$17 >> 2] = HEAP32[$17 >> 2] | 1 << ($12 & 31); + $$01823 = $$01823 + 1 | 0; + $13 = HEAP8[$$01823 >> 0] | 0; + } while ($13 << 24 >> 24 != 0); + } + $23 = HEAP8[$0 >> 0] | 0; + if (!($23 << 24 >> 24)) $$019$lcssa$sink = $0; else { + $$01920 = $0; + $26 = $23; + while (1) { + $25 = $26 & 255; + if (HEAP32[$2 + ($25 >>> 5 << 2) >> 2] & 1 << ($25 & 31) | 0) { + $$019$lcssa$sink = $$01920; + break L1; + } + $34 = $$01920 + 1 | 0; + $26 = HEAP8[$34 >> 0] | 0; + if (!($26 << 24 >> 24)) { + $$019$lcssa$sink = $34; + break; + } else $$01920 = $34; + } + } + } else label = 3; while (0); + if ((label | 0) == 3) $$019$lcssa$sink = ___strchrnul($0, $3 << 24 >> 24) | 0; + STACKTOP = sp; + return $$019$lcssa$sink - $0 | 0; +} + +function __ZNSt3__227__num_get_unsigned_integralImEET_PKcS3_Rji($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$028 = 0, $$029 = 0, $$2 = 0, $10 = 0, $11 = 0, $12 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $4 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp; + do if (($0 | 0) == ($1 | 0)) { + HEAP32[$2 >> 2] = 4; + $$2 = 0; + } else { + $7 = (HEAP8[$0 >> 0] | 0) == 45; + if ($7) { + $8 = $0 + 1 | 0; + if (($8 | 0) == ($1 | 0)) { + HEAP32[$2 >> 2] = 4; + $$2 = 0; + break; + } else $$029 = $8; + } else $$029 = $0; + $10 = ___errno_location() | 0; + $11 = HEAP32[$10 >> 2] | 0; + $12 = ___errno_location() | 0; + HEAP32[$12 >> 2] = 0; + $14 = _strtoull_l($$029, $4, $3, __ZNSt3__26__clocEv() | 0) | 0; + $15 = getTempRet0() | 0; + $16 = ___errno_location() | 0; + $17 = HEAP32[$16 >> 2] | 0; + if (!$17) { + $19 = ___errno_location() | 0; + HEAP32[$19 >> 2] = $11; + } + do if ((HEAP32[$4 >> 2] | 0) == ($1 | 0)) if ($15 >>> 0 > 0 | ($15 | 0) == 0 & $14 >>> 0 > 4294967295 | ($17 | 0) == 68) { + HEAP32[$2 >> 2] = 4; + $$028 = -1; + break; + } else { + $$028 = $7 ? 0 - $14 | 0 : $14; + break; + } else { + HEAP32[$2 >> 2] = 4; + $$028 = 0; + } while (0); + $$2 = $$028; + } while (0); + STACKTOP = sp; + return $$2 | 0; +} + +function __ZNSt3__227__num_get_unsigned_integralIjEET_PKcS3_Rji($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$028 = 0, $$029 = 0, $$2 = 0, $10 = 0, $11 = 0, $12 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $4 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp; + do if (($0 | 0) == ($1 | 0)) { + HEAP32[$2 >> 2] = 4; + $$2 = 0; + } else { + $7 = (HEAP8[$0 >> 0] | 0) == 45; + if ($7) { + $8 = $0 + 1 | 0; + if (($8 | 0) == ($1 | 0)) { + HEAP32[$2 >> 2] = 4; + $$2 = 0; + break; + } else $$029 = $8; + } else $$029 = $0; + $10 = ___errno_location() | 0; + $11 = HEAP32[$10 >> 2] | 0; + $12 = ___errno_location() | 0; + HEAP32[$12 >> 2] = 0; + $14 = _strtoull_l($$029, $4, $3, __ZNSt3__26__clocEv() | 0) | 0; + $15 = getTempRet0() | 0; + $16 = ___errno_location() | 0; + $17 = HEAP32[$16 >> 2] | 0; + if (!$17) { + $19 = ___errno_location() | 0; + HEAP32[$19 >> 2] = $11; + } + do if ((HEAP32[$4 >> 2] | 0) == ($1 | 0)) if ($15 >>> 0 > 0 | ($15 | 0) == 0 & $14 >>> 0 > 4294967295 | ($17 | 0) == 68) { + HEAP32[$2 >> 2] = 4; + $$028 = -1; + break; + } else { + $$028 = $7 ? 0 - $14 | 0 : $14; + break; + } else { + HEAP32[$2 >> 2] = 4; + $$028 = 0; + } while (0); + $$2 = $$028; + } while (0); + STACKTOP = sp; + return $$2 | 0; +} + +function _addNFTMarker($id, $datasetPathname) { + $id = $id | 0; + $datasetPathname = $datasetPathname | 0; + var $0 = 0, $call7 = 0, $cond$i$i$i = 0, $id$addr = 0, $retval$1 = 0, $surfaceSetCount = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $id$addr = sp + 4 | 0; + HEAP32[$id$addr >> 2] = $id; + do if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0) { + $call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0; + $surfaceSetCount = $call7 + 244 | 0; + $0 = HEAP32[$surfaceSetCount >> 2] | 0; + if ((HEAP8[$datasetPathname + 11 >> 0] | 0) < 0) $cond$i$i$i = HEAP32[$datasetPathname >> 2] | 0; else $cond$i$i$i = $datasetPathname; + if (!(_loadNFTMarker($call7, $0, $cond$i$i$i) | 0)) { + _arLog(0, 3, 44914, $vararg_buffer); + $retval$1 = -1; + break; + } else { + HEAP32[$surfaceSetCount >> 2] = (HEAP32[$surfaceSetCount >> 2] | 0) + 1; + $retval$1 = $0; + break; + } + } else $retval$1 = -1; while (0); + STACKTOP = sp; + return $retval$1 | 0; +} + +function __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $14 = 0, $15 = 0, $19 = 0, $2 = 0, $24 = 0, $26 = 0, $3 = 0, $31 = 0, $32 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 4 | 0; + $8 = ((HEAP32[$3 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 3) + 1 | 0; + $9 = __ZNKSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE8max_sizeEv($0) | 0; + if ($9 >>> 0 < $8 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $14 = HEAP32[$0 >> 2] | 0; + $15 = (HEAP32[$0 + 8 >> 2] | 0) - $14 | 0; + $19 = $15 >> 2; + __ZNSt3__214__split_bufferIN6vision7match_tERNS_9allocatorIS2_EEEC2EmmS5_($2, $15 >> 3 >>> 0 < $9 >>> 1 >>> 0 ? ($19 >>> 0 < $8 >>> 0 ? $8 : $19) : $9, (HEAP32[$3 >> 2] | 0) - $14 >> 3, $0 + 8 | 0); + $24 = $2 + 8 | 0; + $26 = $1; + $31 = HEAP32[$26 + 4 >> 2] | 0; + $32 = HEAP32[$24 >> 2] | 0; + HEAP32[$32 >> 2] = HEAP32[$26 >> 2]; + HEAP32[$32 + 4 >> 2] = $31; + HEAP32[$24 >> 2] = (HEAP32[$24 >> 2] | 0) + 8; + __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE($0, $2); + __ZNSt3__214__split_bufferIN6vision7match_tERNS_9allocatorIS2_EEED2Ev($2); + STACKTOP = sp; + return; + } +} + +function ___stdio_read($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$cast = 0, $$pr = 0, $12 = 0, $22 = 0, $26 = 0, $29 = 0, $3 = 0, $30 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $3 = sp; + $4 = sp + 16 | 0; + HEAP32[$3 >> 2] = $1; + $5 = $3 + 4 | 0; + $6 = $0 + 48 | 0; + $7 = HEAP32[$6 >> 2] | 0; + HEAP32[$5 >> 2] = $2 - (($7 | 0) != 0 & 1); + $12 = $0 + 44 | 0; + HEAP32[$3 + 8 >> 2] = HEAP32[$12 >> 2]; + HEAP32[$3 + 12 >> 2] = $7; + if (!(___wasi_syscall_ret(___wasi_fd_read(HEAP32[$0 + 60 >> 2] | 0, $3 | 0, 2, $4 | 0) | 0) | 0)) { + $$pr = HEAP32[$4 >> 2] | 0; + if (($$pr | 0) >= 1) { + $26 = HEAP32[$5 >> 2] | 0; + if ($$pr >>> 0 > $26 >>> 0) { + $29 = HEAP32[$12 >> 2] | 0; + $30 = $0 + 4 | 0; + HEAP32[$30 >> 2] = $29; + $$cast = $29; + HEAP32[$0 + 8 >> 2] = $$cast + ($$pr - $26); + if (!(HEAP32[$6 >> 2] | 0)) $$0 = $2; else { + HEAP32[$30 >> 2] = $$cast + 1; + HEAP8[$1 + ($2 + -1) >> 0] = HEAP8[$$cast >> 0] | 0; + $$0 = $2; + } + } else $$0 = $$pr; + } else { + $22 = $$pr; + label = 4; + } + } else { + HEAP32[$4 >> 2] = -1; + $22 = -1; + label = 4; + } + if ((label | 0) == 4) { + HEAP32[$0 >> 2] = $22 & 48 ^ 16 | HEAP32[$0 >> 2]; + $$0 = $22; + } + STACKTOP = sp; + return $$0 | 0; +} + +function _rgb1_gray_convert($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$05356$us = 0, $$05457$us = 0, $$058$us = 0, $$in = 0, $10 = 0, $12 = 0, $13 = 0, $18 = 0, $21 = 0, $24 = 0, $26 = 0, $32 = 0, $36 = 0, $8 = 0, $$in$looptemp = 0; + $8 = HEAP32[(HEAP32[$0 + 480 >> 2] | 0) + 24 >> 2] | 0; + $10 = HEAP32[$0 + 112 >> 2] | 0; + if (($4 | 0) <= 0) return; + $12 = $1 + 4 | 0; + $13 = $1 + 8 | 0; + if (!$10) return; + $$05457$us = $3; + $$058$us = $2; + $$in = $4; + while (1) { + $$in$looptemp = $$in; + $$in = $$in + -1 | 0; + $18 = HEAP32[(HEAP32[$1 >> 2] | 0) + ($$058$us << 2) >> 2] | 0; + $21 = HEAP32[(HEAP32[$12 >> 2] | 0) + ($$058$us << 2) >> 2] | 0; + $24 = HEAP32[(HEAP32[$13 >> 2] | 0) + ($$058$us << 2) >> 2] | 0; + $$058$us = $$058$us + 1 | 0; + $26 = HEAP32[$$05457$us >> 2] | 0; + $$05356$us = 0; + do { + $32 = HEAPU8[$21 + $$05356$us >> 0] | 0; + $36 = $32 + 128 | 0; + HEAP8[$26 + $$05356$us >> 0] = ((HEAP32[$8 + (($32 | 256) << 2) >> 2] | 0) + (HEAP32[$8 + (($36 + (HEAPU8[$18 + $$05356$us >> 0] | 0) & 255) << 2) >> 2] | 0) + (HEAP32[$8 + (($36 + (HEAPU8[$24 + $$05356$us >> 0] | 0) & 255 | 512) << 2) >> 2] | 0) | 0) >>> 16; + $$05356$us = $$05356$us + 1 | 0; + } while (($$05356$us | 0) != ($10 | 0)); + if (($$in$looptemp | 0) <= 1) break; else $$05457$us = $$05457$us + 4 | 0; + } + return; +} + +function __ZNK6vision5Image3getIfEEPKT_m($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $11 = 0, $16 = 0, $2 = 0, $20 = 0, $26 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + if ((HEAP32[$0 + 8 >> 2] | 0) >>> 0 > $1 >>> 0) { + $26 = (HEAP32[$0 + 24 >> 2] | 0) + (Math_imul(HEAP32[$0 + 12 >> 2] | 0, $1) | 0) | 0; + STACKTOP = sp; + return $26 | 0; + } else { + $11 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 27776) | 0, 27813) | 0, 39072) | 0, 124) | 0, 39079) | 0, 27883) | 0; + __ZNKSt3__28ios_base6getlocEv($2, $11 + (HEAP32[(HEAP32[$11 >> 2] | 0) + -12 >> 2] | 0) | 0); + $16 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66512) | 0; + $20 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$16 >> 2] | 0) + 28 >> 2] & 127]($16, 10) | 0; + __ZNSt3__26localeD2Ev($2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($11, $20) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($11) | 0; + _abort(); + } + return 0; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEEEENS_22__unordered_map_hasherIiS7_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS7_NS_8equal_toIiEELb1EEENS_9allocatorIS7_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS7_PvEEEERKT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$028 = 0, $$pn = 0, $$sroa$0$0 = 0, $14 = 0, $15 = 0, $19 = 0, $2 = 0, $25 = 0, $4 = 0, $6 = 0, $8 = 0; + $2 = HEAP32[$1 >> 2] | 0; + $4 = HEAP32[$0 + 4 >> 2] | 0; + L1 : do if ($4) { + $6 = $4 + -1 | 0; + $8 = ($6 & $4 | 0) == 0; + if (!$8) if ($2 >>> 0 < $4 >>> 0) $14 = $2; else $14 = ($2 >>> 0) % ($4 >>> 0) | 0; else $14 = $6 & $2; + $15 = HEAP32[(HEAP32[$0 >> 2] | 0) + ($14 << 2) >> 2] | 0; + if ($15) { + $$pn = $15; + while (1) { + $$028 = HEAP32[$$pn >> 2] | 0; + if (!$$028) { + $$sroa$0$0 = 0; + break L1; + } + $19 = HEAP32[$$028 + 4 >> 2] | 0; + if (($19 | 0) == ($2 | 0)) { + if ((HEAP32[$$028 + 8 >> 2] | 0) == ($2 | 0)) { + $$sroa$0$0 = $$028; + break L1; + } + } else { + if (!$8) if ($19 >>> 0 < $4 >>> 0) $25 = $19; else $25 = ($19 >>> 0) % ($4 >>> 0) | 0; else $25 = $19 & $6; + if (($25 | 0) != ($14 | 0)) { + $$sroa$0$0 = 0; + break L1; + } + } + $$pn = $$028; + } + } else $$sroa$0$0 = 0; + } else $$sroa$0$0 = 0; while (0); + return $$sroa$0$0 | 0; +} + +function __ZNSt3__26vectorINS_4pairIfmEENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $14 = 0, $15 = 0, $19 = 0, $2 = 0, $24 = 0, $26 = 0, $3 = 0, $31 = 0, $32 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 4 | 0; + $8 = ((HEAP32[$3 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 3) + 1 | 0; + $9 = __ZNKSt3__26vectorINS_4pairIfmEENS_9allocatorIS2_EEE8max_sizeEv($0) | 0; + if ($9 >>> 0 < $8 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $14 = HEAP32[$0 >> 2] | 0; + $15 = (HEAP32[$0 + 8 >> 2] | 0) - $14 | 0; + $19 = $15 >> 2; + __ZNSt3__214__split_bufferINS_4pairIfmEERNS_9allocatorIS2_EEEC2EmmS5_($2, $15 >> 3 >>> 0 < $9 >>> 1 >>> 0 ? ($19 >>> 0 < $8 >>> 0 ? $8 : $19) : $9, (HEAP32[$3 >> 2] | 0) - $14 >> 3, $0 + 8 | 0); + $24 = $2 + 8 | 0; + $26 = $1; + $31 = HEAP32[$26 + 4 >> 2] | 0; + $32 = HEAP32[$24 >> 2] | 0; + HEAP32[$32 >> 2] = HEAP32[$26 >> 2]; + HEAP32[$32 + 4 >> 2] = $31; + HEAP32[$24 >> 2] = (HEAP32[$24 >> 2] | 0) + 8; + __ZNSt3__26vectorINS_4pairIfmEENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE($0, $2); + __ZNSt3__214__split_bufferINS_4pairIfmEERNS_9allocatorIS2_EEED2Ev($2); + STACKTOP = sp; + return; + } +} + +function __ZN6vision5Image3getIfEEPT_m($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $11 = 0, $16 = 0, $2 = 0, $20 = 0, $26 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + if ((HEAP32[$0 + 8 >> 2] | 0) >>> 0 > $1 >>> 0) { + $26 = (HEAP32[$0 + 24 >> 2] | 0) + (Math_imul(HEAP32[$0 + 12 >> 2] | 0, $1) | 0) | 0; + STACKTOP = sp; + return $26 | 0; + } else { + $11 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 27776) | 0, 27813) | 0, 39072) | 0, 119) | 0, 39079) | 0, 27883) | 0; + __ZNKSt3__28ios_base6getlocEv($2, $11 + (HEAP32[(HEAP32[$11 >> 2] | 0) + -12 >> 2] | 0) | 0); + $16 = __ZNKSt3__26locale9use_facetERNS0_2idE($2, 66512) | 0; + $20 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$16 >> 2] | 0) + 28 >> 2] & 127]($16, 10) | 0; + __ZNSt3__26localeD2Ev($2); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($11, $20) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($11) | 0; + _abort(); + } + return 0; +} + +function __ZNSt3__26vectorINS0_INS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEEENS3_IS7_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS7_RS8_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i = 0, $10 = 0, $11 = 0, $13 = 0, $15 = 0, $19 = 0, $2 = 0, $21 = 0, $22 = 0, $24 = 0, $25 = 0, $26 = 0, $3 = 0, $5 = 0, $7 = 0, $8 = 0, $9 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $$0$i = HEAP32[$3 >> 2] | 0; + while (1) { + if (($$0$i | 0) == ($2 | 0)) break; + $7 = HEAP32[$5 >> 2] | 0; + $8 = $7 + -12 | 0; + $9 = $$0$i + -12 | 0; + HEAP32[$8 >> 2] = 0; + $10 = $7 + -8 | 0; + HEAP32[$10 >> 2] = 0; + $11 = $7 + -4 | 0; + HEAP32[$11 >> 2] = 0; + HEAP32[$8 >> 2] = HEAP32[$9 >> 2]; + $13 = $$0$i + -8 | 0; + HEAP32[$10 >> 2] = HEAP32[$13 >> 2]; + $15 = $$0$i + -4 | 0; + HEAP32[$11 >> 2] = HEAP32[$15 >> 2]; + HEAP32[$15 >> 2] = 0; + HEAP32[$13 >> 2] = 0; + HEAP32[$9 >> 2] = 0; + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + -12; + $$0$i = $9; + } + $19 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$5 >> 2] = $19; + $21 = $1 + 8 | 0; + $22 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$21 >> 2]; + HEAP32[$21 >> 2] = $22; + $24 = $0 + 8 | 0; + $25 = $1 + 12 | 0; + $26 = HEAP32[$24 >> 2] | 0; + HEAP32[$24 >> 2] = HEAP32[$25 >> 2]; + HEAP32[$25 >> 2] = $26; + HEAP32[$1 >> 2] = HEAP32[$5 >> 2]; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle15IntegerCastExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $13 = 0, $14 = 0, $2 = 0, $3 = 0, $4 = 0, $8 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $tmpcast$byval_copy = sp + 24 | 0; + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51968); + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast$byval_copy); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 51964); + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast$byval_copy); + $8 = $0 + 12 | 0; + $13 = HEAP32[$8 + 4 >> 2] | 0; + $14 = $4; + HEAP32[$14 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$14 + 4 >> 2] = $13; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast$byval_copy); + STACKTOP = sp; + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE5eraseENS_21__hash_const_iteratorIPNS_11__hash_nodeIS3_PvEEEE($this, $__p) { + $this = $this | 0; + $__p = $__p | 0; + var $0 = 0, $2 = 0, $3 = 0, $agg$tmp = 0, $agg$tmp$byval_copy = 0, $agg$tmp$ensured = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $agg$tmp$byval_copy = sp + 16 | 0; + $agg$tmp$ensured = sp + 4 | 0; + $agg$tmp = sp; + $0 = HEAP32[$__p >> 2] | 0; + $2 = HEAP32[$0 >> 2] | 0; + HEAP32[$agg$tmp >> 2] = $0; + HEAP32[$agg$tmp$byval_copy >> 2] = HEAP32[$agg$tmp >> 2]; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE6removeENS_21__hash_const_iteratorIPNS_11__hash_nodeIS3_PvEEEE($agg$tmp$ensured, $this, $agg$tmp$byval_copy); + $3 = HEAP32[$agg$tmp$ensured >> 2] | 0; + HEAP32[$agg$tmp$ensured >> 2] = 0; + if ($3 | 0) { + if (HEAP8[$agg$tmp$ensured + 8 >> 0] | 0) __ZNSt3__24pairIKi12arControllerED2Ev($3 + 8 | 0); + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($3, 496); + } + STACKTOP = sp; + return $2 | 0; +} + +function _getTransMatMultiSquareRobust($id, $multiMarkerId) { + $id = $id | 0; + $multiMarkerId = $multiMarkerId | 0; + var $2 = 0, $5 = 0, $7 = 0, $call7 = 0, $id$addr = 0, $retval$1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + do if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0) { + $call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0; + $2 = HEAP32[$call7 + 328 >> 2] | 0; + if (($multiMarkerId | 0) < 0 ? 1 : (HEAP32[$call7 + 332 >> 2] | 0) - $2 >> 3 >>> 0 <= $multiMarkerId >>> 0) { + $retval$1 = HEAP32[4225] | 0; + break; + } else { + $5 = HEAP32[$2 + ($multiMarkerId << 3) + 4 >> 2] | 0; + $7 = HEAP32[$call7 + 216 >> 2] | 0; + +_arGetTransMatMultiSquareRobust(HEAP32[$call7 + 228 >> 2] | 0, $7 + 48 | 0, HEAP32[$7 + 44 >> 2] | 0, $5); + _matrixCopy($5 + 8 | 0, 61136); + $retval$1 = 0; + break; + } + } else $retval$1 = HEAP32[4224] | 0; while (0); + STACKTOP = sp; + return $retval$1 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle11PostfixExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $13 = 0, $14 = 0, $2 = 0, $3 = 0, $4 = 0, $8 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $tmpcast$byval_copy = sp + 24 | 0; + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51968); + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast$byval_copy); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 51964); + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast$byval_copy); + $8 = $0 + 12 | 0; + $13 = HEAP32[$8 + 4 >> 2] | 0; + $14 = $4; + HEAP32[$14 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$14 + 4 >> 2] = $13; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast$byval_copy); + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorI12multi_markerNS_9allocatorIS1_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS1_RS3_EE($this, $__v) { + $this = $this | 0; + $__v = $__v | 0; + var $$pre$phiZ2D = 0, $0 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = 0, $__begin_2 = 0, $__end_ = 0, $__end_6 = 0, $__value_$i$i$i = 0, $__value_$i$i$i6 = 0, $add$ptr$i = 0, $sub$ptr$sub$i7 = 0; + $0 = HEAP32[$this >> 2] | 0; + $__end_ = $this + 4 | 0; + $__begin_2 = $__v + 4 | 0; + $sub$ptr$sub$i7 = (HEAP32[$__end_ >> 2] | 0) - $0 | 0; + $add$ptr$i = (HEAP32[$__begin_2 >> 2] | 0) + (0 - ($sub$ptr$sub$i7 >> 3) << 3) | 0; + HEAP32[$__begin_2 >> 2] = $add$ptr$i; + if (($sub$ptr$sub$i7 | 0) > 0) { + _memcpy($add$ptr$i | 0, $0 | 0, $sub$ptr$sub$i7 | 0) | 0; + $$pre$phiZ2D = $__begin_2; + $5 = HEAP32[$__begin_2 >> 2] | 0; + } else { + $$pre$phiZ2D = $__begin_2; + $5 = $add$ptr$i; + } + $4 = HEAP32[$this >> 2] | 0; + HEAP32[$this >> 2] = $5; + HEAP32[$$pre$phiZ2D >> 2] = $4; + $__end_6 = $__v + 8 | 0; + $6 = HEAP32[$__end_ >> 2] | 0; + HEAP32[$__end_ >> 2] = HEAP32[$__end_6 >> 2]; + HEAP32[$__end_6 >> 2] = $6; + $__value_$i$i$i6 = $this + 8 | 0; + $__value_$i$i$i = $__v + 12 | 0; + $8 = HEAP32[$__value_$i$i$i6 >> 2] | 0; + HEAP32[$__value_$i$i$i6 >> 2] = HEAP32[$__value_$i$i$i >> 2]; + HEAP32[$__value_$i$i$i >> 2] = $8; + HEAP32[$__v >> 2] = HEAP32[$$pre$phiZ2D >> 2]; + return; +} + +function __ZNSt3__26vectorINS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS5_RS6_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i = 0, $10 = 0, $11 = 0, $13 = 0, $15 = 0, $19 = 0, $2 = 0, $21 = 0, $22 = 0, $24 = 0, $25 = 0, $26 = 0, $3 = 0, $5 = 0, $7 = 0, $8 = 0, $9 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $$0$i = HEAP32[$3 >> 2] | 0; + while (1) { + if (($$0$i | 0) == ($2 | 0)) break; + $7 = HEAP32[$5 >> 2] | 0; + $8 = $7 + -12 | 0; + $9 = $$0$i + -12 | 0; + HEAP32[$8 >> 2] = 0; + $10 = $7 + -8 | 0; + HEAP32[$10 >> 2] = 0; + $11 = $7 + -4 | 0; + HEAP32[$11 >> 2] = 0; + HEAP32[$8 >> 2] = HEAP32[$9 >> 2]; + $13 = $$0$i + -8 | 0; + HEAP32[$10 >> 2] = HEAP32[$13 >> 2]; + $15 = $$0$i + -4 | 0; + HEAP32[$11 >> 2] = HEAP32[$15 >> 2]; + HEAP32[$15 >> 2] = 0; + HEAP32[$13 >> 2] = 0; + HEAP32[$9 >> 2] = 0; + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + -12; + $$0$i = $9; + } + $19 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$5 >> 2] = $19; + $21 = $1 + 8 | 0; + $22 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$21 >> 2]; + HEAP32[$21 >> 2] = $22; + $24 = $0 + 8 | 0; + $25 = $1 + 12 | 0; + $26 = HEAP32[$24 >> 2] | 0; + HEAP32[$24 >> 2] = HEAP32[$25 >> 2]; + HEAP32[$25 >> 2] = $26; + HEAP32[$1 >> 2] = HEAP32[$5 >> 2]; + return; +} + +function _skip_variable($0) { + $0 = $0 | 0; + var $$0 = 0, $$041 = 0, $$043 = 0, $$1 = 0, $$142 = 0, $1 = 0, $11 = 0, $12 = 0, $15 = 0, $2 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $4 = 0; + $1 = $0 + 24 | 0; + $2 = HEAP32[$1 >> 2] | 0; + $3 = $2 + 4 | 0; + $4 = HEAP32[$3 >> 2] | 0; + do if (!$4) if (!(FUNCTION_TABLE_ii[HEAP32[$2 + 12 >> 2] & 127]($0) | 0)) { + $$043 = 0; + return $$043 | 0; + } else { + $$0 = HEAP32[$3 >> 2] | 0; + break; + } else $$0 = $4; while (0); + $$041 = HEAP32[$2 >> 2] | 0; + $11 = $$0 + -1 | 0; + $12 = $$041 + 1 | 0; + $15 = (HEAPU8[$$041 >> 0] | 0) << 8; + do if (!$11) if (!(FUNCTION_TABLE_ii[HEAP32[$2 + 12 >> 2] & 127]($0) | 0)) { + $$043 = 0; + return $$043 | 0; + } else { + $$1 = HEAP32[$3 >> 2] | 0; + $$142 = HEAP32[$2 >> 2] | 0; + break; + } else { + $$1 = $11; + $$142 = $12; + } while (0); + $27 = $15 | (HEAPU8[$$142 >> 0] | 0); + $28 = $27 + -2 | 0; + $29 = HEAP32[$0 >> 2] | 0; + HEAP32[$29 + 20 >> 2] = 93; + HEAP32[$29 + 24 >> 2] = HEAP32[$0 + 440 >> 2]; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = $28; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 1); + HEAP32[$2 >> 2] = $$142 + 1; + HEAP32[$3 >> 2] = $$1 + -1; + if ($27 >>> 0 <= 2) { + $$043 = 1; + return $$043 | 0; + } + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$1 >> 2] | 0) + 16 >> 2] & 255]($0, $28); + $$043 = 1; + return $$043 | 0; +} + +function _getTransMatMultiSquare($id, $multiMarkerId) { + $id = $id | 0; + $multiMarkerId = $multiMarkerId | 0; + var $2 = 0, $5 = 0, $7 = 0, $call7 = 0, $id$addr = 0, $retval$1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + do if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0) { + $call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0; + $2 = HEAP32[$call7 + 328 >> 2] | 0; + if (($multiMarkerId | 0) < 0 ? 1 : (HEAP32[$call7 + 332 >> 2] | 0) - $2 >> 3 >>> 0 <= $multiMarkerId >>> 0) { + $retval$1 = HEAP32[4225] | 0; + break; + } else { + $5 = HEAP32[$2 + ($multiMarkerId << 3) + 4 >> 2] | 0; + $7 = HEAP32[$call7 + 216 >> 2] | 0; + +_arGetTransMatMultiSquare(HEAP32[$call7 + 228 >> 2] | 0, $7 + 48 | 0, HEAP32[$7 + 44 >> 2] | 0, $5); + _matrixCopy($5 + 8 | 0, 61136); + $retval$1 = 0; + break; + } + } else $retval$1 = HEAP32[4224] | 0; while (0); + STACKTOP = sp; + return $retval$1 | 0; +} + +function _get_vertex($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = +$4; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0 = 0, $$071 = 0, $$072 = 0, $$073 = 0.0, $10 = 0, $12 = 0.0, $14 = 0, $16 = 0, $18 = 0.0, $22 = 0.0, $23 = 0, $34 = 0.0, $35 = 0.0, $36 = 0, $45 = 0, $8 = 0, label = 0; + $8 = HEAP32[$1 + ($3 << 2) >> 2] | 0; + $10 = HEAP32[$1 + ($2 << 2) >> 2] | 0; + $12 = +($8 - $10 | 0); + $14 = HEAP32[$0 + ($2 << 2) >> 2] | 0; + $16 = HEAP32[$0 + ($3 << 2) >> 2] | 0; + $18 = +($14 - $16 | 0); + $22 = +((Math_imul($16, $10) | 0) - (Math_imul($14, $8) | 0) | 0); + $23 = $2 + 1 | 0; + $$0 = $23; + $$071 = $23; + $$073 = 0.0; + while (1) { + if (($$071 | 0) >= ($3 | 0)) break; + $34 = $12 * +(HEAP32[$0 + ($$071 << 2) >> 2] | 0) + $18 * +(HEAP32[$1 + ($$071 << 2) >> 2] | 0) + $22; + $35 = $34 * $34; + $36 = $35 > $$073; + $$0 = $36 ? $$071 : $$0; + $$071 = $$071 + 1 | 0; + $$073 = $36 ? $35 : $$073; + } + if ($$073 / ($12 * $12 + $18 * $18) > $4) if (((_get_vertex($0, $1, $2, $$0, $4, $5, $6) | 0) >= 0 ? ($45 = HEAP32[$6 >> 2] | 0, ($45 | 0) <= 5) : 0) ? (HEAP32[$5 + ($45 << 2) >> 2] = $$0, HEAP32[$6 >> 2] = (HEAP32[$6 >> 2] | 0) + 1, (_get_vertex($0, $1, $$0, $3, $4, $5, $6) | 0) >= 0) : 0) label = 8; else $$072 = -1; else label = 8; + if ((label | 0) == 8) $$072 = 0; + return $$072 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseSimpleIdEv($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp + 4 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $4 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseSourceNameEPNS5_9NameStateE($3) | 0; + HEAP32[$1 >> 2] = $4; + if ($4) if ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24 == 73) { + $8 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseTemplateArgsEb($3, 0) | 0; + HEAP32[$2 >> 2] = $8; + if (!$8) $$0 = 0; else $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20NameWithTemplateArgsEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $2) | 0; + $$1 = $$0; + } else $$1 = $4; else $$1 = 0; + STACKTOP = sp; + return $$1 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E24parsePointerToMemberTypeEv($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$2 = 0, $1 = 0, $2 = 0, $4 = 0, $5 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp + 4 | 0; + $2 = sp; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 77) | 0) { + $4 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $5 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($4) | 0; + HEAP32[$1 >> 2] = $5; + if (!$5) $$1 = 0; else { + $7 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseTypeEv($4) | 0; + HEAP32[$2 >> 2] = $7; + if (!$7) $$0 = 0; else $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_19PointerToMemberTypeEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $2) | 0; + $$1 = $$0; + } + $$2 = $$1; + } else $$2 = 0; + STACKTOP = sp; + return $$2 | 0; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEE6rehashEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$sroa$speculated = 0, $22 = 0, $27 = 0, $30 = 0, $8 = 0; + if (($1 | 0) != 1) if (!($1 + -1 & $1)) $$0 = $1; else $$0 = __ZNSt3__212__next_primeEm($1) | 0; else $$0 = 2; + $8 = HEAP32[$0 + 4 >> 2] | 0; + if ($$0 >>> 0 <= $8 >>> 0) { + if ($$0 >>> 0 < $8 >>> 0) { + $22 = ~~+Math_ceil(+(+((HEAP32[$0 + 12 >> 2] | 0) >>> 0) / +HEAPF32[$0 + 16 >> 2])) >>> 0; + if ($8 >>> 0 > 2 & ($8 + -1 & $8 | 0) == 0) { + $27 = 1 << 32 - (Math_clz32($22 + -1 | 0) | 0); + $30 = $22 >>> 0 < 2 ? $22 : $27; + } else $30 = __ZNSt3__212__next_primeEm($22) | 0; + $$sroa$speculated = $$0 >>> 0 < $30 >>> 0 ? $30 : $$0; + if ($$sroa$speculated >>> 0 < $8 >>> 0) __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEE8__rehashEm($0, $$sroa$speculated); + } + } else __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEE8__rehashEm($0, $$0); + return; +} + +function __ZN6vision22SolveHomography4PointsIfEEbPT_PKS1_S4_S4_S4_S4_S4_S4_S4_($0, $1, $2, $3, $4, $5, $6, $7, $8) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + var $$0 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 128 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(128); + $9 = sp; + $10 = sp + 124 | 0; + $11 = sp + 120 | 0; + $12 = sp + 112 | 0; + $13 = sp + 104 | 0; + $14 = sp + 96 | 0; + $15 = sp + 88 | 0; + $16 = sp + 80 | 0; + $17 = sp + 72 | 0; + $18 = sp + 64 | 0; + $19 = sp + 56 | 0; + $20 = sp + 48 | 0; + $21 = sp + 40 | 0; + if ((__ZN6vision18Condition4Points2dIfEEbPT_S2_S2_S2_RS1_S2_PKS1_S5_S5_S5_($14, $15, $16, $17, $10, $12, $1, $2, $3, $4) | 0 ? __ZN6vision18Condition4Points2dIfEEbPT_S2_S2_S2_RS1_S2_PKS1_S5_S5_S5_($18, $19, $20, $21, $11, $13, $5, $6, $7, $8) | 0 : 0) ? __ZN6vision34SolveHomography4PointsInhomogenousIfEEbPT_PKS1_S4_S4_S4_S4_S4_S4_S4_($9, $14, $15, $16, $17, $18, $19, $20, $21) | 0 : 0) { + __ZN6vision21DenormalizeHomographyIfEEvPT_PKS1_S1_S4_S1_S4_($0, $9, +HEAPF32[$10 >> 2], $12, +HEAPF32[$11 >> 2], $13); + $$0 = 1; + } else $$0 = 0; + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle8QualType10printQualsERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy2 = 0, $10 = 0, $13 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy2 = sp + 24 | 0; + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp; + $5 = $0 + 8 | 0; + $6 = HEAP32[$5 >> 2] | 0; + if (!($6 & 1)) $10 = $6; else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 56136); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + $10 = HEAP32[$5 >> 2] | 0; + } + if (!($10 & 2)) $13 = $10; else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 56143); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + $13 = HEAP32[$5 >> 2] | 0; + } + if ($13 & 4 | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 56153); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + } + STACKTOP = sp; + return; +} + +function __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0, $10 = 0, $11 = 0, $13 = 0, $14 = 0, $2 = 0, $21 = 0, $22 = 0, $31 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_($2, $0); + do if (HEAP8[$2 >> 0] | 0) { + $10 = HEAP32[$0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) + 24 >> 2] | 0; + $11 = $10; + if ($10 | 0) { + $13 = $11 + 24 | 0; + $14 = HEAP32[$13 >> 2] | 0; + if (($14 | 0) == (HEAP32[$11 + 28 >> 2] | 0)) { + $21 = HEAP32[(HEAP32[$10 >> 2] | 0) + 52 >> 2] | 0; + $22 = __ZNSt3__211char_traitsIcE11to_int_typeEc($1) | 0; + $$0$i$i = FUNCTION_TABLE_iii[$21 & 127]($11, $22) | 0; + } else { + HEAP32[$13 >> 2] = $14 + 1; + HEAP8[$14 >> 0] = $1; + $$0$i$i = __ZNSt3__211char_traitsIcE11to_int_typeEc($1) | 0; + } + if (!(__ZNSt3__211char_traitsIcE11eq_int_typeEii($$0$i$i, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0)) break; + } + $31 = $0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) | 0; + __ZNSt3__28ios_base5clearEj($31, HEAP32[$31 + 16 >> 2] | 1); + } while (0); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev($2); + STACKTOP = sp; + return $0 | 0; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEE4findIjEENS_15__hash_iteratorIPNS_11__hash_nodeIS2_PvEEEERKT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$028 = 0, $$pn = 0, $$sroa$0$0 = 0, $14 = 0, $15 = 0, $19 = 0, $2 = 0, $25 = 0, $4 = 0, $6 = 0, $8 = 0; + $2 = HEAP32[$1 >> 2] | 0; + $4 = HEAP32[$0 + 4 >> 2] | 0; + L1 : do if ($4) { + $6 = $4 + -1 | 0; + $8 = ($6 & $4 | 0) == 0; + if (!$8) if ($2 >>> 0 < $4 >>> 0) $14 = $2; else $14 = ($2 >>> 0) % ($4 >>> 0) | 0; else $14 = $6 & $2; + $15 = HEAP32[(HEAP32[$0 >> 2] | 0) + ($14 << 2) >> 2] | 0; + if ($15) { + $$pn = $15; + while (1) { + $$028 = HEAP32[$$pn >> 2] | 0; + if (!$$028) { + $$sroa$0$0 = 0; + break L1; + } + $19 = HEAP32[$$028 + 4 >> 2] | 0; + if (($19 | 0) == ($2 | 0)) { + if ((HEAP32[$$028 + 8 >> 2] | 0) == ($2 | 0)) { + $$sroa$0$0 = $$028; + break L1; + } + } else { + if (!$8) if ($19 >>> 0 < $4 >>> 0) $25 = $19; else $25 = ($19 >>> 0) % ($4 >>> 0) | 0; else $25 = $19 & $6; + if (($25 | 0) != ($14 | 0)) { + $$sroa$0$0 = 0; + break L1; + } + } + $$pn = $$028; + } + } else $$sroa$0$0 = 0; + } else $$sroa$0$0 = 0; while (0); + return $$sroa$0$0 | 0; +} + +function __ZN6vision5Timer4stopEv($0) { + $0 = $0 | 0; + var $1 = 0, $14 = 0, $18 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + if (!(+HEAPF64[$0 >> 3] >= 0.0)) { + $9 = __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(__ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(65808, 38960) | 0, 38999) | 0, 39072) | 0, 67) | 0, 39079) | 0, 39082) | 0; + __ZNKSt3__28ios_base6getlocEv($1, $9 + (HEAP32[(HEAP32[$9 >> 2] | 0) + -12 >> 2] | 0) | 0); + $14 = __ZNKSt3__26locale9use_facetERNS0_2idE($1, 66512) | 0; + $18 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$14 >> 2] | 0) + 28 >> 2] & 127]($14, 10) | 0; + __ZNSt3__26localeD2Ev($1); + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc($9, $18) | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($9) | 0; + _abort(); + } else { + _gettimeofday($1 | 0, 0) | 0; + HEAPF64[$0 + 8 >> 3] = +(HEAP32[$1 + 4 >> 2] | 0) * 1.0e-06 + +(HEAP32[$1 >> 2] | 0); + STACKTOP = sp; + return; + } +} + +function __ZNSt3__26vectorIiNS_9allocatorIiEEE8__appendEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $13 = 0, $14 = 0, $18 = 0, $19 = 0, $2 = 0, $23 = 0, $3 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 8 | 0; + $5 = $0 + 4 | 0; + $6 = HEAP32[$5 >> 2] | 0; + do if ((HEAP32[$3 >> 2] | 0) - $6 >> 2 >>> 0 < $1 >>> 0) { + $13 = ($6 - (HEAP32[$0 >> 2] | 0) >> 2) + $1 | 0; + $14 = __ZNKSt3__26vectorIiNS_9allocatorIiEEE8max_sizeEv($0) | 0; + if ($14 >>> 0 < $13 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $18 = HEAP32[$0 >> 2] | 0; + $19 = (HEAP32[$3 >> 2] | 0) - $18 | 0; + $23 = $19 >> 1; + __ZNSt3__214__split_bufferIiRNS_9allocatorIiEEEC2EmmS3_($2, $19 >> 2 >>> 0 < $14 >>> 1 >>> 0 ? ($23 >>> 0 < $13 >>> 0 ? $13 : $23) : $14, (HEAP32[$5 >> 2] | 0) - $18 >> 2, $0 + 8 | 0); + __ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE18__construct_at_endEm($2, $1); + __ZNSt3__26vectorIiNS_9allocatorIiEEE26__swap_out_circular_bufferERNS_14__split_bufferIiRS2_EE($0, $2); + __ZNSt3__214__split_bufferIiRNS_9allocatorIiEEED2Ev($2); + break; + } + } else __ZNSt3__26vectorIiNS_9allocatorIiEEE18__construct_at_endEm($0, $1); while (0); + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorIfNS_9allocatorIfEEE8__appendEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $13 = 0, $14 = 0, $18 = 0, $19 = 0, $2 = 0, $23 = 0, $3 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 8 | 0; + $5 = $0 + 4 | 0; + $6 = HEAP32[$5 >> 2] | 0; + do if ((HEAP32[$3 >> 2] | 0) - $6 >> 2 >>> 0 < $1 >>> 0) { + $13 = ($6 - (HEAP32[$0 >> 2] | 0) >> 2) + $1 | 0; + $14 = __ZNKSt3__26vectorIfNS_9allocatorIfEEE8max_sizeEv($0) | 0; + if ($14 >>> 0 < $13 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $18 = HEAP32[$0 >> 2] | 0; + $19 = (HEAP32[$3 >> 2] | 0) - $18 | 0; + $23 = $19 >> 1; + __ZNSt3__214__split_bufferIfRNS_9allocatorIfEEEC2EmmS3_($2, $19 >> 2 >>> 0 < $14 >>> 1 >>> 0 ? ($23 >>> 0 < $13 >>> 0 ? $13 : $23) : $14, (HEAP32[$5 >> 2] | 0) - $18 >> 2, $0 + 8 | 0); + __ZNSt3__214__split_bufferIfRNS_9allocatorIfEEE18__construct_at_endEm($2, $1); + __ZNSt3__26vectorIfNS_9allocatorIfEEE26__swap_out_circular_bufferERNS_14__split_bufferIfRS2_EE($0, $2); + __ZNSt3__214__split_bufferIfRNS_9allocatorIfEEED2Ev($2); + break; + } + } else __ZNSt3__26vectorIfNS_9allocatorIfEEE18__construct_at_endEm($0, $1); while (0); + STACKTOP = sp; + return; +} + +function _sift($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0$lcssa = 0, $$02934 = 0, $$03133 = 0, $$035 = 0, $$1 = 0, $$130 = 0, $$132 = 0, $13 = 0, $14 = 0, $21 = 0, $5 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 240 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(240); + $5 = sp; + HEAP32[$5 >> 2] = $0; + L1 : do if (($3 | 0) > 1) { + $7 = 0 - $1 | 0; + $$02934 = $0; + $$03133 = $3; + $$035 = 1; + $14 = $0; + while (1) { + $8 = $$02934 + $7 | 0; + $9 = $$03133 + -2 | 0; + $13 = $8 + (0 - (HEAP32[$4 + ($9 << 2) >> 2] | 0)) | 0; + if ((FUNCTION_TABLE_iii[$2 & 127]($14, $13) | 0) > -1 ? (FUNCTION_TABLE_iii[$2 & 127]($14, $8) | 0) > -1 : 0) { + $$0$lcssa = $$035; + break L1; + } + $21 = $5 + ($$035 << 2) | 0; + if ((FUNCTION_TABLE_iii[$2 & 127]($13, $8) | 0) > -1) { + HEAP32[$21 >> 2] = $13; + $$130 = $13; + $$132 = $$03133 + -1 | 0; + } else { + HEAP32[$21 >> 2] = $8; + $$130 = $8; + $$132 = $9; + } + $$1 = $$035 + 1 | 0; + if (($$132 | 0) <= 1) { + $$0$lcssa = $$1; + break L1; + } + $$02934 = $$130; + $$03133 = $$132; + $$035 = $$1; + $14 = HEAP32[$5 >> 2] | 0; + } + } else $$0$lcssa = 1; while (0); + _cycle($1, $5, $$0$lcssa); + STACKTOP = sp; + return; +} + +function _rgb1_rgb_convert($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$04449$us = 0, $$04550$us = 0, $$04748$us = 0, $$051$us = 0, $$in = 0, $14 = 0, $17 = 0, $20 = 0, $27 = 0, $31 = 0, $32 = 0, $6 = 0, $8 = 0, $9 = 0, $$in$looptemp = 0; + $6 = HEAP32[$0 + 112 >> 2] | 0; + if (($4 | 0) <= 0) return; + $8 = $1 + 4 | 0; + $9 = $1 + 8 | 0; + if (!$6) return; + $$04550$us = $3; + $$051$us = $2; + $$in = $4; + while (1) { + $$in$looptemp = $$in; + $$in = $$in + -1 | 0; + $14 = HEAP32[(HEAP32[$1 >> 2] | 0) + ($$051$us << 2) >> 2] | 0; + $17 = HEAP32[(HEAP32[$8 >> 2] | 0) + ($$051$us << 2) >> 2] | 0; + $20 = HEAP32[(HEAP32[$9 >> 2] | 0) + ($$051$us << 2) >> 2] | 0; + $$051$us = $$051$us + 1 | 0; + $$04449$us = 0; + $$04748$us = HEAP32[$$04550$us >> 2] | 0; + while (1) { + $27 = HEAP8[$17 + $$04449$us >> 0] | 0; + $31 = HEAPU8[$20 + $$04449$us >> 0] | 0; + $32 = ($27 & 255) + 128 | 0; + HEAP8[$$04748$us >> 0] = $32 + (HEAPU8[$14 + $$04449$us >> 0] | 0); + HEAP8[$$04748$us + 1 >> 0] = $27; + HEAP8[$$04748$us + 2 >> 0] = $32 + $31; + $$04449$us = $$04449$us + 1 | 0; + if (($$04449$us | 0) == ($6 | 0)) break; else $$04748$us = $$04748$us + 3 | 0; + } + if (($$in$looptemp | 0) <= 1) break; else $$04550$us = $$04550$us + 4 | 0; + } + return; +} + +function __ZNSt3__26vectorIhNS_9allocatorIhEEE8__appendEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $11 = 0, $12 = 0, $16 = 0, $17 = 0, $2 = 0, $20 = 0, $3 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 8 | 0; + $5 = $0 + 4 | 0; + $6 = HEAP32[$5 >> 2] | 0; + do if (((HEAP32[$3 >> 2] | 0) - $6 | 0) >>> 0 < $1 >>> 0) { + $11 = $6 - (HEAP32[$0 >> 2] | 0) + $1 | 0; + $12 = __ZNKSt3__26vectorIhNS_9allocatorIhEEE8max_sizeEv($0) | 0; + if ($12 >>> 0 < $11 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $16 = HEAP32[$0 >> 2] | 0; + $17 = (HEAP32[$3 >> 2] | 0) - $16 | 0; + $20 = $17 << 1; + __ZNSt3__214__split_bufferIhRNS_9allocatorIhEEEC2EmmS3_($2, $17 >>> 0 < $12 >>> 1 >>> 0 ? ($20 >>> 0 < $11 >>> 0 ? $11 : $20) : $12, (HEAP32[$5 >> 2] | 0) - $16 | 0, $0 + 8 | 0); + __ZNSt3__214__split_bufferIhRNS_9allocatorIhEEE18__construct_at_endEm($2, $1); + __ZNSt3__26vectorIhNS_9allocatorIhEEE26__swap_out_circular_bufferERNS_14__split_bufferIhRS2_EE($0, $2); + __ZNSt3__214__split_bufferIhRNS_9allocatorIhEEED2Ev($2); + break; + } + } else __ZNSt3__26vectorIhNS_9allocatorIhEEE18__construct_at_endEm($0, $1); while (0); + STACKTOP = sp; + return; +} + +function _arSetPixelFormat($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$016 = 0, $10 = 0, $11 = 0, $3 = 0, $8 = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + L1 : do if ($0) { + $3 = $0 + 4 | 0; + if ((HEAP32[$3 >> 2] | 0) != ($1 | 0)) { + if ($1 >>> 0 >= 15) { + HEAP32[$vararg_buffer >> 2] = $1; + _arLog(0, 3, 23981, $vararg_buffer); + $$016 = -1; + break; + } + HEAP32[$3 >> 2] = $1; + $8 = _arUtilGetPixelSize($1) | 0; + HEAP32[$0 + 8 >> 2] = $8; + $10 = $0 + 24 | 0; + $11 = HEAP32[$10 >> 2] | 0; + if (!(28704 >>> ($1 & 32767) & 1)) switch ($11 | 0) { + case 1: + { + HEAP32[$10 >> 2] = 4; + $$016 = 0; + break L1; + break; + } + case 4: + { + HEAP32[$10 >> 2] = 3; + $$016 = 0; + break L1; + break; + } + default: + { + $$016 = 0; + break L1; + } + } else switch ($11 | 0) { + case 0: + { + HEAP32[$10 >> 2] = 1; + $$016 = 0; + break L1; + break; + } + case 3: + { + HEAP32[$10 >> 2] = 4; + $$016 = 0; + break L1; + break; + } + default: + { + $$016 = 0; + break L1; + } + } + } else $$016 = 0; + } else $$016 = -1; while (0); + STACKTOP = sp; + return $$016 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray14printWithCommaERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$off0 = 0, $$018 = 0, $$1$off0 = 0, $$byval_copy = 0, $2 = 0, $3 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = $0 + 4 | 0; + $$0$off0 = 1; + $$018 = 0; + while (1) { + if (($$018 | 0) == (HEAP32[$3 >> 2] | 0)) break; + $6 = __ZNK12_GLOBAL__N_112OutputStream18getCurrentPositionEv($1) | 0; + if (!$$0$off0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 52152); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + } + $7 = __ZNK12_GLOBAL__N_112OutputStream18getCurrentPositionEv($1) | 0; + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[(HEAP32[$0 >> 2] | 0) + ($$018 << 2) >> 2] | 0, $1); + if (($7 | 0) == (__ZNK12_GLOBAL__N_112OutputStream18getCurrentPositionEv($1) | 0)) { + __ZN12_GLOBAL__N_112OutputStream18setCurrentPositionEm($1, $6); + $$1$off0 = $$0$off0; + } else $$1$off0 = 0; + $$0$off0 = $$1$off0; + $$018 = $$018 + 1 | 0; + } + STACKTOP = sp; + return; +} +function _fmt_u($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$010$lcssa$off0 = 0, $$012 = 0, $$09$lcssa = 0, $$0914 = 0, $$1$lcssa = 0, $$111 = 0, $12 = 0, $14 = 0, $30 = 0, $8 = 0, $9 = 0, $8$looptemp = 0, $9$looptemp = 0, $$012$looptemp = 0; + if ($1 >>> 0 > 0 | ($1 | 0) == 0 & $0 >>> 0 > 4294967295) { + $$0914 = $2; + $8 = $0; + $9 = $1; + do { + $8$looptemp = $8; + $8 = ___udivdi3($8 | 0, $9 | 0, 10, 0) | 0; + $9$looptemp = $9; + $9 = getTempRet0() | 0; + $12 = ___muldi3($8 | 0, $9 | 0, 10, 0) | 0; + $14 = _i64Subtract($8$looptemp | 0, $9$looptemp | 0, $12 | 0, getTempRet0() | 0) | 0; + getTempRet0() | 0; + $$0914 = $$0914 + -1 | 0; + HEAP8[$$0914 >> 0] = $14 & 255 | 48; + } while ($9$looptemp >>> 0 > 9 | ($9$looptemp | 0) == 9 & $8$looptemp >>> 0 > 4294967295); + $$010$lcssa$off0 = $8; + $$09$lcssa = $$0914; + } else { + $$010$lcssa$off0 = $0; + $$09$lcssa = $2; + } + if (!$$010$lcssa$off0) $$1$lcssa = $$09$lcssa; else { + $$012 = $$010$lcssa$off0; + $$111 = $$09$lcssa; + while (1) { + $$012$looptemp = $$012; + $$012 = ($$012 >>> 0) / 10 | 0; + $30 = $$111 + -1 | 0; + HEAP8[$30 >> 0] = $$012$looptemp - ($$012 * 10 | 0) | 48; + if ($$012$looptemp >>> 0 < 10) { + $$1$lcssa = $30; + break; + } else $$111 = $30; + } + } + return $$1$lcssa | 0; +} + +function _arSetLabelingThreshMode($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$018 = 0, $13 = 0, $3 = 0, $6 = 0, $7 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer1 = sp + 8 | 0; + $vararg_buffer = sp; + if ($0) { + $3 = $0 + 7062388 | 0; + if ((HEAP32[$3 >> 2] | 0) != ($1 | 0)) { + $6 = $0 + 7062408 | 0; + $7 = HEAP32[$6 >> 2] | 0; + if ($7 | 0) { + _arImageProcFinal($7); + HEAP32[$6 >> 2] = 0; + } + switch ($1 | 0) { + case 3: + case 2: + case 1: + { + $13 = _arImageProcInit(HEAP32[$0 + 36 >> 2] | 0, HEAP32[$0 + 40 >> 2] | 0) | 0; + HEAP32[$6 >> 2] = $13; + $$0 = $1; + break; + } + case 4: + { + HEAP32[$0 + 7062404 >> 2] = 1; + HEAP32[$0 + 7062400 >> 2] = 1; + $$0 = 4; + break; + } + case 0: + { + $$0 = $1; + break; + } + default: + { + _arLog(0, 3, 23812, $vararg_buffer); + $$0 = 0; + } + } + HEAP32[$3 >> 2] = $$0; + if ((HEAP32[$0 >> 2] | 0) == 1) { + HEAP32[$vararg_buffer1 >> 2] = HEAP32[16 + ($$0 << 2) >> 2]; + _arLog(0, 3, 23886, $vararg_buffer1); + $$018 = 0; + } else $$018 = 0; + } else $$018 = 0; + } else $$018 = -1; + STACKTOP = sp; + return $$018 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle10AbiTagAttr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy1 = 0, $11 = 0, $16 = 0, $17 = 0, $2 = 0, $3 = 0, $4 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 24 | 0; + $2 = sp + 16 | 0; + $3 = sp; + $4 = sp + 8 | 0; + $6 = HEAP32[$0 + 8 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$6 >> 2] | 0) + 16 >> 2] & 255]($6, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51608); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + $11 = $0 + 12 | 0; + $16 = HEAP32[$11 + 4 >> 2] | 0; + $17 = $3; + HEAP32[$17 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$17 + 4 >> 2] = $16; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 51614); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + STACKTOP = sp; + return; +} + +function __ZN6vision27OrthogonalizePivot8x9Basis5IfEEbPT_S2_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $10 = 0.0, $11 = 0.0, $13 = 0.0, $15 = 0, $16 = 0, $19 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $3 = $0 + 180 | 0; + $4 = $0 + 144 | 0; + $5 = $1 + 180 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($3, $4, $5); + $6 = $0 + 216 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($6, $4, $1 + 216 | 0); + $8 = $0 + 252 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($8, $4, $1 + 252 | 0); + $10 = +__ZN6vision11SumSquares9IfEET_PKS1_($3); + HEAPF32[$2 >> 2] = $10; + $11 = +__ZN6vision11SumSquares9IfEET_PKS1_($6); + HEAPF32[$2 + 4 >> 2] = $11; + $13 = +__ZN6vision11SumSquares9IfEET_PKS1_($8); + HEAPF32[$2 + 8 >> 2] = $13; + $15 = __ZN6vision9MaxIndex3IfEEiPKT_($2) | 0; + $16 = $2 + ($15 << 2) | 0; + if (+HEAPF32[$16 >> 2] == 0.0) $$0 = 0; else { + $19 = $15 * 9 | 0; + __ZN6vision5Swap9IfEEvPT_S2_($3, $3 + ($19 << 2) | 0); + __ZN6vision5Swap9IfEEvPT_S2_($5, $5 + ($19 << 2) | 0); + __ZN6vision12ScaleVector9IfEEvPT_PKS1_S1_($3, $3, 1.0 / +Math_sqrt(+(+HEAPF32[$16 >> 2]))); + $$0 = 1; + } + STACKTOP = sp; + return $$0 | 0; +} + +function _arGetTransMatRobust($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $12 = 0, $13 = 0, $6 = 0, $7 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $6 = sp + 20 | 0; + $7 = sp; + $9 = _malloc($4 << 4) | 0; + HEAP32[$6 >> 2] = $9; + if (!$9) { + _arLog(0, 3, 45930, sp + 8 | 0); + _exit(1); + } + $12 = _malloc($4 * 24 | 0) | 0; + $13 = $6 + 4 | 0; + HEAP32[$13 >> 2] = $12; + if (!$12) { + _arLog(0, 3, 45930, sp + 16 | 0); + _exit(1); + } + $$0 = 0; + while (1) { + if (($$0 | 0) >= ($4 | 0)) break; + HEAPF64[$9 + ($$0 << 4) >> 3] = +HEAPF64[$2 + ($$0 << 4) >> 3]; + HEAPF64[$9 + ($$0 << 4) + 8 >> 3] = +HEAPF64[$2 + ($$0 << 4) + 8 >> 3]; + HEAPF64[$12 + ($$0 * 24 | 0) >> 3] = +HEAPF64[$3 + ($$0 * 24 | 0) >> 3]; + HEAPF64[$12 + ($$0 * 24 | 0) + 8 >> 3] = +HEAPF64[$3 + ($$0 * 24 | 0) + 8 >> 3]; + HEAPF64[$12 + ($$0 * 24 | 0) + 16 >> 3] = +HEAPF64[$3 + ($$0 * 24 | 0) + 16 >> 3]; + $$0 = $$0 + 1 | 0; + } + HEAP32[$6 + 8 >> 2] = $4; + if ((_icpPointRobust(HEAP32[$0 >> 2] | 0, $6, $1, $5, $7) | 0) < 0) HEAPF64[$7 >> 3] = 1.0e8; + _free(HEAP32[$6 >> 2] | 0); + _free(HEAP32[$13 >> 2] | 0); + STACKTOP = sp; + return +(+HEAPF64[$7 >> 3]); +} + +function __ZN6vision24OrthogonalizeIdentity8x9IfEET_PS1_PKS1_i($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0.0, $44 = 0.0, $46 = 0.0, $6 = 0; + __ZN6vision12ScaleVector9IfEEvPT_PKS1_S1_($0, $1, -+HEAPF32[$1 + ($2 << 2) >> 2]); + $6 = $0 + ($2 << 2) | 0; + HEAPF32[$6 >> 2] = +HEAPF32[$6 >> 2] + 1.0; + __ZN6vision23AccumulateScaledVector9IfEEvPT_PKS1_S1_($0, $1 + 36 | 0, -+HEAPF32[$1 + ($2 + 9 << 2) >> 2]); + __ZN6vision23AccumulateScaledVector9IfEEvPT_PKS1_S1_($0, $1 + 72 | 0, -+HEAPF32[$1 + ($2 + 18 << 2) >> 2]); + __ZN6vision23AccumulateScaledVector9IfEEvPT_PKS1_S1_($0, $1 + 108 | 0, -+HEAPF32[$1 + ($2 + 27 << 2) >> 2]); + __ZN6vision23AccumulateScaledVector9IfEEvPT_PKS1_S1_($0, $1 + 144 | 0, -+HEAPF32[$1 + ($2 + 36 << 2) >> 2]); + __ZN6vision23AccumulateScaledVector9IfEEvPT_PKS1_S1_($0, $1 + 180 | 0, -+HEAPF32[$1 + ($2 + 45 << 2) >> 2]); + __ZN6vision23AccumulateScaledVector9IfEEvPT_PKS1_S1_($0, $1 + 216 | 0, -+HEAPF32[$1 + ($2 + 54 << 2) >> 2]); + __ZN6vision23AccumulateScaledVector9IfEEvPT_PKS1_S1_($0, $1 + 252 | 0, -+HEAPF32[$1 + ($2 + 63 << 2) >> 2]); + $44 = +__ZN6vision11SumSquares9IfEET_PKS1_($0); + $46 = +Math_sqrt(+$44); + if ($44 == 0.0) $$0 = 0.0; else { + __ZN6vision12ScaleVector9IfEEvPT_PKS1_S1_($0, $0, 1.0 / $46); + $$0 = $46; + } + return +$$0; +} + +function _arLabeling($0, $1, $2, $3, $4, $5, $6, $7, $8) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + var $$0 = 0, $10 = 0, $11 = 0; + $10 = ($4 | 0) == 1; + $11 = ($8 | 0) != 0; + do if (!$3) if ($10) { + if ($11) { + $$0 = _arLabelingSubDBZ($0, $1, $2, $8, $7) | 0; + break; + } + if (!$6) { + $$0 = _arLabelingSubDBRC($0, $1, $2, $5, $7) | 0; + break; + } else { + $$0 = _arLabelingSubDBIC($0, $1, $2, $5, $7) | 0; + break; + } + } else { + if ($11) { + $$0 = _arLabelingSubDWZ($0, $1, $2, $8, $7) | 0; + break; + } + if (!$6) { + $$0 = _arLabelingSubDWRC($0, $1, $2, $5, $7) | 0; + break; + } else { + $$0 = _arLabelingSubDWIC($0, $1, $2, $5, $7) | 0; + break; + } + } else if ($10) { + if ($11) { + $$0 = _arLabelingSubEBZ($0, $1, $2, $8, $7) | 0; + break; + } + if (!$6) { + $$0 = _arLabelingSubEBRC($0, $1, $2, $5, $7) | 0; + break; + } else { + $$0 = _arLabelingSubEBIC($0, $1, $2, $5, $7) | 0; + break; + } + } else { + if ($11) { + $$0 = _arLabelingSubEWZ($0, $1, $2, $8, $7) | 0; + break; + } + if (!$6) { + $$0 = _arLabelingSubEWRC($0, $1, $2, $5, $7) | 0; + break; + } else { + $$0 = _arLabelingSubEWIC($0, $1, $2, $5, $7) | 0; + break; + } + } while (0); + return $$0 | 0; +} + +function _arMatrixMulf($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$040 = 0, $$041 = 0, $$042 = 0, $$043 = 0, $$044 = 0, $$045 = 0, $$1 = 0, $14 = 0, $20 = 0, $30 = 0.0, $31 = 0.0, $4 = 0, $9 = 0; + $4 = HEAP32[$1 + 8 >> 2] | 0; + L1 : do if ((($4 | 0) == (HEAP32[$2 + 4 >> 2] | 0) ? ($9 = HEAP32[$0 + 4 >> 2] | 0, ($9 | 0) == (HEAP32[$1 + 4 >> 2] | 0)) : 0) ? ($14 = HEAP32[$0 + 8 >> 2] | 0, ($14 | 0) == (HEAP32[$2 + 8 >> 2] | 0)) : 0) { + $$0 = HEAP32[$0 >> 2] | 0; + $$044 = 0; + while (1) { + if (($$044 | 0) >= ($9 | 0)) { + $$045 = 0; + break L1; + } + $20 = Math_imul($$044, $4) | 0; + $$043 = 0; + $$1 = $$0; + while (1) { + if (($$043 | 0) >= ($14 | 0)) break; + HEAPF32[$$1 >> 2] = 0.0; + $$040 = (HEAP32[$2 >> 2] | 0) + ($$043 << 2) | 0; + $$041 = (HEAP32[$1 >> 2] | 0) + ($20 << 2) | 0; + $$042 = 0; + $31 = 0.0; + while (1) { + if (($$042 | 0) >= ($4 | 0)) break; + $30 = $31 + +HEAPF32[$$041 >> 2] * +HEAPF32[$$040 >> 2]; + HEAPF32[$$1 >> 2] = $30; + $$040 = $$040 + ($14 << 2) | 0; + $$041 = $$041 + 4 | 0; + $$042 = $$042 + 1 | 0; + $31 = $30; + } + $$043 = $$043 + 1 | 0; + $$1 = $$1 + 4 | 0; + } + $$0 = $$1; + $$044 = $$044 + 1 | 0; + } + } else $$045 = -1; while (0); + return $$045 | 0; +} + +function _arMatrixMul($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$040 = 0, $$041 = 0, $$042 = 0, $$043 = 0, $$044 = 0, $$045 = 0, $$1 = 0, $14 = 0, $20 = 0, $30 = 0.0, $31 = 0.0, $4 = 0, $9 = 0; + $4 = HEAP32[$1 + 8 >> 2] | 0; + L1 : do if ((($4 | 0) == (HEAP32[$2 + 4 >> 2] | 0) ? ($9 = HEAP32[$0 + 4 >> 2] | 0, ($9 | 0) == (HEAP32[$1 + 4 >> 2] | 0)) : 0) ? ($14 = HEAP32[$0 + 8 >> 2] | 0, ($14 | 0) == (HEAP32[$2 + 8 >> 2] | 0)) : 0) { + $$0 = HEAP32[$0 >> 2] | 0; + $$044 = 0; + while (1) { + if (($$044 | 0) >= ($9 | 0)) { + $$045 = 0; + break L1; + } + $20 = Math_imul($$044, $4) | 0; + $$043 = 0; + $$1 = $$0; + while (1) { + if (($$043 | 0) >= ($14 | 0)) break; + HEAPF64[$$1 >> 3] = 0.0; + $$040 = (HEAP32[$2 >> 2] | 0) + ($$043 << 3) | 0; + $$041 = (HEAP32[$1 >> 2] | 0) + ($20 << 3) | 0; + $$042 = 0; + $31 = 0.0; + while (1) { + if (($$042 | 0) >= ($4 | 0)) break; + $30 = $31 + +HEAPF64[$$041 >> 3] * +HEAPF64[$$040 >> 3]; + HEAPF64[$$1 >> 3] = $30; + $$040 = $$040 + ($14 << 3) | 0; + $$041 = $$041 + 8 | 0; + $$042 = $$042 + 1 | 0; + $31 = $30; + } + $$043 = $$043 + 1 | 0; + $$1 = $$1 + 8 | 0; + } + $$0 = $$1; + $$044 = $$044 + 1 | 0; + } + } else $$045 = -1; while (0); + return $$045 | 0; +} + +function __ZNSt3__26vectorIPKN6vision4NodeILi96EEENS_9allocatorIS5_EEE21__push_back_slow_pathIS5_EEvOT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $14 = 0, $15 = 0, $19 = 0, $2 = 0, $24 = 0, $3 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 4 | 0; + $8 = ((HEAP32[$3 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 2) + 1 | 0; + $9 = __ZNKSt3__26vectorIPKN6vision4NodeILi96EEENS_9allocatorIS5_EEE8max_sizeEv($0) | 0; + if ($9 >>> 0 < $8 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $14 = HEAP32[$0 >> 2] | 0; + $15 = (HEAP32[$0 + 8 >> 2] | 0) - $14 | 0; + $19 = $15 >> 1; + __ZNSt3__214__split_bufferIPKN6vision4NodeILi96EEERNS_9allocatorIS5_EEEC2EmmS8_($2, $15 >> 2 >>> 0 < $9 >>> 1 >>> 0 ? ($19 >>> 0 < $8 >>> 0 ? $8 : $19) : $9, (HEAP32[$3 >> 2] | 0) - $14 >> 2, $0 + 8 | 0); + $24 = $2 + 8 | 0; + HEAP32[HEAP32[$24 >> 2] >> 2] = HEAP32[$1 >> 2]; + HEAP32[$24 >> 2] = (HEAP32[$24 >> 2] | 0) + 4; + __ZNSt3__26vectorIPKN6vision4NodeILi96EEENS_9allocatorIS5_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS5_RS7_EE($0, $2); + __ZNSt3__214__split_bufferIPKN6vision4NodeILi96EEERNS_9allocatorIS5_EEED2Ev($2); + STACKTOP = sp; + return; + } +} + +function _arCreateHandle($0) { + $0 = $0 | 0; + var $1 = 0, $16 = 0, $19 = 0, $27 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = _malloc(7062432) | 0; + if (!$1) { + _arLog(0, 3, 45930, sp); + _exit(1); + } + HEAP32[$1 >> 2] = 0; + HEAP32[$1 + 4834148 >> 2] = 0; + HEAP32[$1 + 7062408 >> 2] = 0; + HEAP32[$1 + 4 >> 2] = -1; + HEAP32[$1 + 8 >> 2] = 0; + HEAP32[$1 + 12 >> 2] = 1; + HEAP32[$1 + 16 >> 2] = 100; + HEAP32[$1 + 20 >> 2] = 0; + HEAP32[$1 + 24 >> 2] = 0; + HEAP32[$1 + 28 >> 2] = 2; + HEAPF64[$1 + 7062416 >> 3] = .5; + HEAP32[$1 + 7062424 >> 2] = 3; + HEAP32[$1 + 32 >> 2] = $0; + $16 = HEAP32[$0 >> 2] | 0; + HEAP32[$1 + 36 >> 2] = $16; + $19 = HEAP32[$0 + 4 >> 2] | 0; + HEAP32[$1 + 40 >> 2] = $19; + HEAP32[$1 + 44 >> 2] = 0; + HEAP32[$1 + 15408 >> 2] = 0; + HEAP32[$1 + 4834152 >> 2] = 0; + HEAP32[$1 + 4818296 >> 2] = 0; + $27 = _malloc(Math_imul($16 << 1, $19) | 0) | 0; + HEAP32[$1 + 4834144 >> 2] = $27; + if (!$27) { + _arLog(0, 3, 45930, sp + 8 | 0); + _exit(1); + } else { + HEAP32[$1 + 7062384 >> 2] = 0; + _arSetDebugMode($1, 0) | 0; + HEAP32[$1 + 7062388 >> 2] = -1; + _arSetLabelingThreshMode($1, 0) | 0; + _arSetLabelingThreshModeAutoInterval($1, 7) | 0; + STACKTOP = sp; + return $1 | 0; + } + return 0; +} + +function ___newlocale($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$03338 = 0, $$03439 = 0, $$036 = 0, $$13537 = 0, $$pre41 = 0, $10 = 0, $12 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $3 = sp; + L1 : do if (!(___loc_is_allocated($2) | 0)) { + $12 = ($2 | 0) != 0; + $$03338 = 0; + $$13537 = 0; + do { + $$pre41 = 1 << $$13537 & $0; + if ($12 & ($$pre41 | 0) == 0) $$0 = HEAP32[$2 + ($$13537 << 2) >> 2] | 0; else $$0 = ___get_locale($$13537, ($$pre41 | 0) == 0 ? 67447 : $1) | 0; + $$03338 = $$03338 + (($$0 | 0) != 0 & 1) | 0; + HEAP32[$3 + ($$13537 << 2) >> 2] = $$0; + $$13537 = $$13537 + 1 | 0; + } while (($$13537 | 0) != 6); + switch ($$03338 & 2147483647 | 0) { + case 0: + { + $$036 = 65372; + break L1; + break; + } + case 1: + { + if ((HEAP32[$3 >> 2] | 0) == 17032) { + $$036 = 17060; + break L1; + } + break; + } + default: + {} + } + $$036 = $2; + } else { + $$03439 = 0; + do { + if (1 << $$03439 & $0 | 0) { + $10 = ___get_locale($$03439, $1) | 0; + HEAP32[$2 + ($$03439 << 2) >> 2] = $10; + } + $$03439 = $$03439 + 1 | 0; + } while (($$03439 | 0) != 6); + $$036 = $2; + } while (0); + STACKTOP = sp; + return $$036 | 0; +} + +function _rgb_gray_convert_53($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$04952$us = 0, $$05053$us = 0, $$054$us = 0, $$in = 0, $10 = 0, $12 = 0, $13 = 0, $18 = 0, $21 = 0, $24 = 0, $26 = 0, $8 = 0, $$in$looptemp = 0; + $8 = HEAP32[(HEAP32[$0 + 480 >> 2] | 0) + 24 >> 2] | 0; + $10 = HEAP32[$0 + 112 >> 2] | 0; + if (($4 | 0) <= 0) return; + $12 = $1 + 4 | 0; + $13 = $1 + 8 | 0; + if (!$10) return; + $$05053$us = $3; + $$054$us = $2; + $$in = $4; + while (1) { + $$in$looptemp = $$in; + $$in = $$in + -1 | 0; + $18 = HEAP32[(HEAP32[$1 >> 2] | 0) + ($$054$us << 2) >> 2] | 0; + $21 = HEAP32[(HEAP32[$12 >> 2] | 0) + ($$054$us << 2) >> 2] | 0; + $24 = HEAP32[(HEAP32[$13 >> 2] | 0) + ($$054$us << 2) >> 2] | 0; + $$054$us = $$054$us + 1 | 0; + $26 = HEAP32[$$05053$us >> 2] | 0; + $$04952$us = 0; + do { + HEAP8[$26 + $$04952$us >> 0] = ((HEAP32[$8 + ((HEAPU8[$21 + $$04952$us >> 0] | 0 | 256) << 2) >> 2] | 0) + (HEAP32[$8 + ((HEAPU8[$18 + $$04952$us >> 0] | 0) << 2) >> 2] | 0) + (HEAP32[$8 + ((HEAPU8[$24 + $$04952$us >> 0] | 0 | 512) << 2) >> 2] | 0) | 0) >>> 16; + $$04952$us = $$04952$us + 1 | 0; + } while (($$04952$us | 0) != ($10 | 0)); + if (($$in$looptemp | 0) <= 1) break; else $$05053$us = $$05053$us + 4 | 0; + } + return; +} + +function __ZNSt3__26vectorIPN6vision4NodeILi96EEENS_9allocatorIS4_EEE21__push_back_slow_pathIRKS4_EEvOT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $14 = 0, $15 = 0, $19 = 0, $2 = 0, $24 = 0, $3 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 4 | 0; + $8 = ((HEAP32[$3 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 2) + 1 | 0; + $9 = __ZNKSt3__26vectorIPN6vision4NodeILi96EEENS_9allocatorIS4_EEE8max_sizeEv($0) | 0; + if ($9 >>> 0 < $8 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $14 = HEAP32[$0 >> 2] | 0; + $15 = (HEAP32[$0 + 8 >> 2] | 0) - $14 | 0; + $19 = $15 >> 1; + __ZNSt3__214__split_bufferIPN6vision4NodeILi96EEERNS_9allocatorIS4_EEEC2EmmS7_($2, $15 >> 2 >>> 0 < $9 >>> 1 >>> 0 ? ($19 >>> 0 < $8 >>> 0 ? $8 : $19) : $9, (HEAP32[$3 >> 2] | 0) - $14 >> 2, $0 + 8 | 0); + $24 = $2 + 8 | 0; + HEAP32[HEAP32[$24 >> 2] >> 2] = HEAP32[$1 >> 2]; + HEAP32[$24 >> 2] = (HEAP32[$24 >> 2] | 0) + 4; + __ZNSt3__26vectorIPN6vision4NodeILi96EEENS_9allocatorIS4_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS4_RS6_EE($0, $2); + __ZNSt3__214__split_bufferIPN6vision4NodeILi96EEERNS_9allocatorIS4_EEED2Ev($2); + STACKTOP = sp; + return; + } +} + +function __ZNK12_GLOBAL__N_116itanium_demangle11PointerType10printRightERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $12 = 0, $2 = 0, $3 = 0, $4 = 0, $8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = $0 + 8 | 0; + $4 = HEAP32[$3 >> 2] | 0; + if ((__ZNK12_GLOBAL__N_116itanium_demangle4Node7getKindEv($4) | 0) << 24 >> 24 == 10) { + if (!(__ZNK12_GLOBAL__N_116itanium_demangle13ObjCProtoName12isObjCObjectEv($4) | 0)) { + $8 = HEAP32[$3 >> 2] | 0; + label = 4; + } + } else { + $8 = $4; + label = 4; + } + if ((label | 0) == 4) { + if (!(__ZNK12_GLOBAL__N_116itanium_demangle4Node8hasArrayERNS_12OutputStreamE($8, $1) | 0) ? !(__ZNK12_GLOBAL__N_116itanium_demangle4Node11hasFunctionERNS_12OutputStreamE(HEAP32[$3 >> 2] | 0, $1) | 0) : 0) {} else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51964); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + } + $12 = HEAP32[$3 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$12 >> 2] | 0) + 20 >> 2] & 255]($12, $1); + } + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorItNS_9allocatorItEEE8__appendEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $13 = 0, $14 = 0, $18 = 0, $19 = 0, $2 = 0, $3 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 8 | 0; + $5 = $0 + 4 | 0; + $6 = HEAP32[$5 >> 2] | 0; + do if ((HEAP32[$3 >> 2] | 0) - $6 >> 1 >>> 0 < $1 >>> 0) { + $13 = ($6 - (HEAP32[$0 >> 2] | 0) >> 1) + $1 | 0; + $14 = __ZNKSt3__26vectorItNS_9allocatorItEEE8max_sizeEv($0) | 0; + if ($14 >>> 0 < $13 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $18 = HEAP32[$0 >> 2] | 0; + $19 = (HEAP32[$3 >> 2] | 0) - $18 | 0; + __ZNSt3__214__split_bufferItRNS_9allocatorItEEEC2EmmS3_($2, $19 >> 1 >>> 0 < $14 >>> 1 >>> 0 ? ($19 >>> 0 < $13 >>> 0 ? $13 : $19) : $14, (HEAP32[$5 >> 2] | 0) - $18 >> 1, $0 + 8 | 0); + __ZNSt3__214__split_bufferItRNS_9allocatorItEEE18__construct_at_endEm($2, $1); + __ZNSt3__26vectorItNS_9allocatorItEEE26__swap_out_circular_bufferERNS_14__split_bufferItRS2_EE($0, $2); + __ZNSt3__214__split_bufferItRNS_9allocatorItEEED2Ev($2); + break; + } + } else __ZNSt3__26vectorItNS_9allocatorItEEE18__construct_at_endEm($0, $1); while (0); + STACKTOP = sp; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle18ArraySubscriptExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy2 = 0, $2 = 0, $3 = 0, $4 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy2 = sp + 24 | 0; + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51968); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 53584); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 12 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 51614); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + STACKTOP = sp; + return; +} + +function _null_convert_55($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$03038$us$us = 0, $$03137$us$us = 0, $$03236$us$us = 0, $$03343$us = 0, $$03439$us$us = 0, $$046$us = 0, $$in = 0, $11 = 0, $6 = 0, $8 = 0, $$in$looptemp = 0; + $6 = HEAP32[$0 + 36 >> 2] | 0; + $8 = HEAP32[$0 + 112 >> 2] | 0; + if (($4 | 0) <= 0) return; + $11 = ($8 | 0) == 0; + if (($6 | 0) <= 0) return; + $$03343$us = $3; + $$046$us = $2; + $$in = $4; + while (1) { + $$in$looptemp = $$in; + $$in = $$in + -1 | 0; + if (!$11) { + $$03439$us$us = 0; + do { + $$03038$us$us = 0; + $$03137$us$us = HEAP32[(HEAP32[$1 + ($$03439$us$us << 2) >> 2] | 0) + ($$046$us << 2) >> 2] | 0; + $$03236$us$us = (HEAP32[$$03343$us >> 2] | 0) + $$03439$us$us | 0; + while (1) { + HEAP8[$$03236$us$us >> 0] = HEAP8[$$03137$us$us >> 0] | 0; + $$03038$us$us = $$03038$us$us + 1 | 0; + if (($$03038$us$us | 0) == ($8 | 0)) break; else { + $$03137$us$us = $$03137$us$us + 1 | 0; + $$03236$us$us = $$03236$us$us + $6 | 0; + } + } + $$03439$us$us = $$03439$us$us + 1 | 0; + } while (($$03439$us$us | 0) != ($6 | 0)); + } + if (($$in$looptemp | 0) <= 1) break; else { + $$03343$us = $$03343$us + 4 | 0; + $$046$us = $$046$us + 1 | 0; + } + } + return; +} + +function _arGetTransMat($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $12 = 0, $13 = 0, $6 = 0, $7 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $6 = sp + 20 | 0; + $7 = sp; + $9 = _malloc($4 << 4) | 0; + HEAP32[$6 >> 2] = $9; + if (!$9) { + _arLog(0, 3, 45930, sp + 8 | 0); + _exit(1); + } + $12 = _malloc($4 * 24 | 0) | 0; + $13 = $6 + 4 | 0; + HEAP32[$13 >> 2] = $12; + if (!$12) { + _arLog(0, 3, 45930, sp + 16 | 0); + _exit(1); + } + $$0 = 0; + while (1) { + if (($$0 | 0) >= ($4 | 0)) break; + HEAPF64[$9 + ($$0 << 4) >> 3] = +HEAPF64[$2 + ($$0 << 4) >> 3]; + HEAPF64[$9 + ($$0 << 4) + 8 >> 3] = +HEAPF64[$2 + ($$0 << 4) + 8 >> 3]; + HEAPF64[$12 + ($$0 * 24 | 0) >> 3] = +HEAPF64[$3 + ($$0 * 24 | 0) >> 3]; + HEAPF64[$12 + ($$0 * 24 | 0) + 8 >> 3] = +HEAPF64[$3 + ($$0 * 24 | 0) + 8 >> 3]; + HEAPF64[$12 + ($$0 * 24 | 0) + 16 >> 3] = +HEAPF64[$3 + ($$0 * 24 | 0) + 16 >> 3]; + $$0 = $$0 + 1 | 0; + } + HEAP32[$6 + 8 >> 2] = $4; + if ((_icpPoint(HEAP32[$0 >> 2] | 0, $6, $1, $5, $7) | 0) < 0) HEAPF64[$7 >> 3] = 1.0e8; + _free(HEAP32[$6 >> 2] | 0); + _free(HEAP32[$13 >> 2] | 0); + STACKTOP = sp; + return +(+HEAPF64[$7 >> 3]); +} + +function __ZNK12_GLOBAL__N_116itanium_demangle14ConversionExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy2 = 0, $2 = 0, $3 = 0, $4 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy2 = sp + 24 | 0; + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51968); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 54555); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray14printWithCommaERNS_12OutputStreamE($0 + 12 | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 51964); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + STACKTOP = sp; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13ObjCProtoName9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy1 = 0, $13 = 0, $14 = 0, $2 = 0, $3 = 0, $4 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 24 | 0; + $2 = sp + 16 | 0; + $3 = sp; + $4 = sp + 8 | 0; + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 52150); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + $8 = $0 + 12 | 0; + $13 = HEAP32[$8 + 4 >> 2] | 0; + $14 = $3; + HEAP32[$14 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$14 + 4 >> 2] = $13; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 52043); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + STACKTOP = sp; + return; +} + +function _updateCandidate($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$0 = 0, $$0$ph = 0, $$060 = 0, $24 = 0, $7 = 0; + $7 = HEAP32[$3 >> 2] | 0; + do if (!$7) { + HEAP32[$4 >> 2] = $0; + HEAP32[$5 >> 2] = $1; + HEAP32[$6 >> 2] = $2; + HEAP32[$3 >> 2] = 1; + } else { + $$060 = 0; + while (1) { + if (($$060 | 0) >= ($7 | 0)) break; + if ((HEAP32[$6 + ($$060 << 2) >> 2] | 0) < ($2 | 0)) break; + $$060 = $$060 + 1 | 0; + } + if (($$060 | 0) == ($7 | 0)) { + if ($7 >>> 0 >= 3) break; + HEAP32[$4 + ($7 << 2) >> 2] = $0; + HEAP32[$5 + ($7 << 2) >> 2] = $1; + HEAP32[$6 + ($7 << 2) >> 2] = $2; + HEAP32[$3 >> 2] = (HEAP32[$3 >> 2] | 0) + 1; + break; + } + if (($7 | 0) == 3) $$0$ph = 2; else { + HEAP32[$3 >> 2] = $7 + 1; + $$0$ph = $7; + } + $$0 = $$0$ph; + while (1) { + if (($$0 | 0) <= ($$060 | 0)) break; + $24 = $$0 + -1 | 0; + HEAP32[$4 + ($$0 << 2) >> 2] = HEAP32[$4 + ($24 << 2) >> 2]; + HEAP32[$5 + ($$0 << 2) >> 2] = HEAP32[$5 + ($24 << 2) >> 2]; + HEAP32[$6 + ($$0 << 2) >> 2] = HEAP32[$6 + ($24 << 2) >> 2]; + $$0 = $24; + } + HEAP32[$4 + ($$0 << 2) >> 2] = $0; + HEAP32[$5 + ($$0 << 2) >> 2] = $1; + HEAP32[$6 + ($$0 << 2) >> 2] = $2; + } while (0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle10PrefixExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy1 = 0, $11 = 0, $12 = 0, $2 = 0, $3 = 0, $4 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 24 | 0; + $2 = sp; + $3 = sp + 16 | 0; + $4 = sp + 8 | 0; + $6 = $0 + 8 | 0; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $2; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 51968); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 16 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 51964); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseDestructorNameEv($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0, $4 = 0, $isdigit = 0, $storemerge = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + $isdigit = (((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) << 24 >> 24) + -48 | 0) >>> 0 < 10; + $4 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + if ($isdigit) $storemerge = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseSimpleIdEv($4) | 0; else $storemerge = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseUnresolvedTypeEv($4) | 0; + HEAP32[$1 >> 2] = $storemerge; + if (!$storemerge) $$0 = 0; else $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8DtorNameEJRPNS0_4NodeEEEES9_DpOT0_($0, $1) | 0; + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle9DotSuffix9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy1 = 0, $13 = 0, $14 = 0, $2 = 0, $3 = 0, $4 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 24 | 0; + $2 = sp + 16 | 0; + $3 = sp; + $4 = sp + 8 | 0; + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 54714); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + $8 = $0 + 12 | 0; + $13 = HEAP32[$8 + 4 >> 2] | 0; + $14 = $3; + HEAP32[$14 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$14 + 4 >> 2] = $13; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 51964); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + STACKTOP = sp; + return; +} + +function _icpUpdateMat($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$028 = 0, $$1 = 0, $$129 = 0, $2 = 0, $26 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 256 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(256); + $2 = sp + 192 | 0; + $3 = sp + 96 | 0; + $4 = sp; + _icpGetQ_from_S($2, $1); + _icpGetMat_from_Q($3, $2); + $$0 = 0; + while (1) { + if (($$0 | 0) == 3) break; + $5 = $0 + ($$0 << 5) | 0; + $6 = $0 + ($$0 << 5) + 8 | 0; + $7 = $0 + ($$0 << 5) + 16 | 0; + $$028 = 0; + while (1) { + if (($$028 | 0) == 4) break; + HEAPF64[$4 + ($$0 << 5) + ($$028 << 3) >> 3] = +HEAPF64[$5 >> 3] * +HEAPF64[$3 + ($$028 << 3) >> 3] + +HEAPF64[$6 >> 3] * +HEAPF64[$3 + 32 + ($$028 << 3) >> 3] + +HEAPF64[$7 >> 3] * +HEAPF64[$3 + 64 + ($$028 << 3) >> 3]; + $$028 = $$028 + 1 | 0; + } + $26 = $4 + ($$0 << 5) + 24 | 0; + HEAPF64[$26 >> 3] = +HEAPF64[$0 + ($$0 << 5) + 24 >> 3] + +HEAPF64[$26 >> 3]; + $$0 = $$0 + 1 | 0; + } + $$1 = 0; + while (1) { + if (($$1 | 0) == 3) break; + $$129 = 0; + while (1) { + if (($$129 | 0) == 4) break; + HEAPF64[$0 + ($$1 << 5) + ($$129 << 3) >> 3] = +HEAPF64[$4 + ($$1 << 5) + ($$129 << 3) >> 3]; + $$129 = $$129 + 1 | 0; + } + $$1 = $$1 + 1 | 0; + } + STACKTOP = sp; + return 0; +} + +function _addMarker($id, $patt_name) { + $id = $id | 0; + $patt_name = $patt_name | 0; + var $call7 = 0, $cond$i$i$i = 0, $id$addr = 0, $patt_id = 0, $retval$1 = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $id$addr = sp + 4 | 0; + HEAP32[$id$addr >> 2] = $id; + do if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0) { + $call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0; + if ((HEAP8[$patt_name + 11 >> 0] | 0) < 0) $cond$i$i$i = HEAP32[$patt_name >> 2] | 0; else $cond$i$i$i = $patt_name; + $patt_id = $call7 + 340 | 0; + if (!(__ZL10loadMarkerPKcPiP8ARHandlePP12ARPattHandle($cond$i$i$i, $patt_id, $call7 + 220 | 0) | 0)) { + _arLog(0, 3, 45305, $vararg_buffer); + $retval$1 = -1; + break; + } else { + $retval$1 = HEAP32[$patt_id >> 2] | 0; + break; + } + } else $retval$1 = -1; while (0); + STACKTOP = sp; + return $retval$1 | 0; +} + +function _memset(ptr, value, num) { + ptr = ptr | 0; + value = value | 0; + num = num | 0; + var end = 0, aligned_end = 0, block_aligned_end = 0, value4 = 0; + end = ptr + num | 0; + value = value & 255; + if ((num | 0) >= 67) { + while (ptr & 3) { + HEAP8[ptr >> 0] = value; + ptr = ptr + 1 | 0; + } + aligned_end = end & -4 | 0; + value4 = value | value << 8 | value << 16 | value << 24; + block_aligned_end = aligned_end - 64 | 0; + while ((ptr | 0) <= (block_aligned_end | 0)) { + HEAP32[ptr >> 2] = value4; + HEAP32[ptr + 4 >> 2] = value4; + HEAP32[ptr + 8 >> 2] = value4; + HEAP32[ptr + 12 >> 2] = value4; + HEAP32[ptr + 16 >> 2] = value4; + HEAP32[ptr + 20 >> 2] = value4; + HEAP32[ptr + 24 >> 2] = value4; + HEAP32[ptr + 28 >> 2] = value4; + HEAP32[ptr + 32 >> 2] = value4; + HEAP32[ptr + 36 >> 2] = value4; + HEAP32[ptr + 40 >> 2] = value4; + HEAP32[ptr + 44 >> 2] = value4; + HEAP32[ptr + 48 >> 2] = value4; + HEAP32[ptr + 52 >> 2] = value4; + HEAP32[ptr + 56 >> 2] = value4; + HEAP32[ptr + 60 >> 2] = value4; + ptr = ptr + 64 | 0; + } + while ((ptr | 0) < (aligned_end | 0)) { + HEAP32[ptr >> 2] = value4; + ptr = ptr + 4 | 0; + } + } + while ((ptr | 0) < (end | 0)) { + HEAP8[ptr >> 0] = value; + ptr = ptr + 1 | 0; + } + return end - num | 0; +} + +function __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$018 = 0, $$019 = 0, $$pn = 0, $19 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $3 = sp + 4 | 0; + HEAP32[$2 >> 2] = $1; + $4 = $0 + 8 | 0; + $5 = $4 + 3 | 0; + $6 = HEAP8[$5 >> 0] | 0; + $7 = $6 << 24 >> 24 < 0; + if ($7) { + $$018 = HEAP32[$0 + 4 >> 2] | 0; + $$019 = (HEAP32[$4 >> 2] & 2147483647) + -1 | 0; + } else { + $$018 = $6 & 255; + $$019 = 1; + } + if (($$018 | 0) == ($$019 | 0)) { + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm($0, $$019, 1, $$019, $$019, 0, 0); + if ((HEAP8[$5 >> 0] | 0) < 0) label = 8; else label = 7; + } else if ($7) label = 8; else label = 7; + if ((label | 0) == 7) { + HEAP8[$5 >> 0] = $$018 + 1; + $$pn = $0; + } else if ((label | 0) == 8) { + $19 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 + 4 >> 2] = $$018 + 1; + $$pn = $19; + } + $$0 = $$pn + ($$018 << 2) | 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($$0, $2); + HEAP32[$3 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($$0 + 4 | 0, $3); + STACKTOP = sp; + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE14__erase_uniqueIiEEmRKT_($this, $__k) { + $this = $this | 0; + $__k = $__k | 0; + var $agg$tmp = 0, $agg$tmp$byval_copy = 0, $call = 0, $retval$0 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $agg$tmp$byval_copy = sp + 4 | 0; + $agg$tmp = sp; + $call = __ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_($this, $__k) | 0; + if (!$call) $retval$0 = 0; else { + HEAP32[$agg$tmp >> 2] = $call; + HEAP32[$agg$tmp$byval_copy >> 2] = HEAP32[$agg$tmp >> 2]; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE5eraseENS_21__hash_const_iteratorIPNS_11__hash_nodeIS3_PvEEEE($this, $agg$tmp$byval_copy) | 0; + $retval$0 = 1; + } + STACKTOP = sp; + return $retval$0 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle15ClosureTypeNameEJRNS2_9NodeArrayERNS_10StringViewEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $12 = 0, $16 = 0, $21 = 0, $22 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $tmpcast$byval_copy = 0, $tmpcast3$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $tmpcast3$byval_copy = sp + 24 | 0; + $tmpcast$byval_copy = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp; + $5 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 24) | 0; + $6 = $1; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $3; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + $16 = $2; + $21 = HEAP32[$16 + 4 >> 2] | 0; + $22 = $4; + HEAP32[$22 >> 2] = HEAP32[$16 >> 2]; + HEAP32[$22 + 4 >> 2] = $21; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + HEAP32[$tmpcast3$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$tmpcast3$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle15ClosureTypeNameC2ENS0_9NodeArrayENS_10StringViewE($5, $tmpcast$byval_copy, $tmpcast3$byval_copy); + STACKTOP = sp; + return $5 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle12TemplateArgs9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy2 = 0, $2 = 0, $3 = 0, $4 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy2 = sp + 24 | 0; + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 52150); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray14printWithCommaERNS_12OutputStreamE($0 + 8 | 0, $1); + if ((__ZNK12_GLOBAL__N_112OutputStream4backEv($1) | 0) << 24 >> 24 == 62) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 51966); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 52043); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + STACKTOP = sp; + return; +} + +function __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$sroa$speculated = 0, $15 = 0, $16 = 0, $21 = 0, $24 = 0, $25 = 0, $27 = 0, $29 = 0, $35 = 0, $9 = 0; + if ((1073741807 - $1 | 0) >>> 0 < $2 >>> 0) __ZNKSt3__221__basic_string_commonILb1EE20__throw_length_errorEv($0); + $9 = $0 + 8 | 0; + if ((HEAP8[$9 + 3 >> 0] | 0) < 0) $27 = HEAP32[$0 >> 2] | 0; else $27 = $0; + if ($1 >>> 0 < 536870887) { + $15 = $2 + $1 | 0; + $16 = $1 << 1; + $$sroa$speculated = $15 >>> 0 < $16 >>> 0 ? $16 : $15; + $21 = $$sroa$speculated >>> 0 < 2 ? 2 : $$sroa$speculated + 4 & -4; + if ($21 >>> 0 > 1073741823) _abort(); else $24 = $21; + } else $24 = 1073741807; + $25 = __Znwm($24 << 2) | 0; + if ($4 | 0) __ZNSt3__211char_traitsIwE4copyEPwPKwm($25, $27, $4) | 0; + $29 = $3 - $5 - $4 | 0; + if ($29 | 0) __ZNSt3__211char_traitsIwE4copyEPwPKwm($25 + ($4 << 2) + ($6 << 2) | 0, $27 + ($4 << 2) + ($5 << 2) | 0, $29) | 0; + $35 = $1 + 1 | 0; + if (($35 | 0) != 2) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($27, $35 << 2); + HEAP32[$0 >> 2] = $25; + HEAP32[$9 >> 2] = $24 | -2147483648; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle10BracedExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $10 = 0, $11 = 0, $13 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + if (!(HEAP8[$0 + 16 >> 0] | 0)) { + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 46); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + } else { + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 91); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 93); + } + $10 = $0 + 12 | 0; + $11 = HEAP32[$10 >> 2] | 0; + if (((__ZNK12_GLOBAL__N_116itanium_demangle4Node7getKindEv($11) | 0) + -65 & 255) < 2) $13 = $11; else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 53404); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + $13 = HEAP32[$10 >> 2] | 0; + } + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE($13, $1); + STACKTOP = sp; + return; +} + +function _getDeltaS_181($H, $dU, $J_U_H, $n) { + $H = $H | 0; + $dU = $dU | 0; + $J_U_H = $J_U_H | 0; + $n = $n | 0; + var $call = 0, $call10 = 0, $call8 = 0, $matH = 0, $matJ = 0, $matU = 0, $ret$0 = 0, $ret$1 = 0, $ret$2 = 0, $ret$3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $matH = sp + 24 | 0; + $matU = sp + 12 | 0; + $matJ = sp; + HEAP32[$matH + 4 >> 2] = 8; + HEAP32[$matH + 8 >> 2] = 1; + HEAP32[$matH >> 2] = $H; + HEAP32[$matU + 4 >> 2] = $n; + HEAP32[$matU + 8 >> 2] = 1; + HEAP32[$matU >> 2] = $dU; + HEAP32[$matJ + 4 >> 2] = $n; + HEAP32[$matJ + 8 >> 2] = 8; + HEAP32[$matJ >> 2] = $J_U_H; + $call = _arMatrixAllocTransf($matJ) | 0; + if (!$call) $ret$3 = -1; else { + $call8 = _arMatrixAllocMulf($call, $matJ) | 0; + if (!$call8) $ret$2 = -1; else { + $call10 = _arMatrixAllocMulf($call, $matU) | 0; + if (!$call10) $ret$1 = -1; else { + if ((_arMatrixSelfInvf($call8) | 0) < 0) $ret$0 = -1; else { + _arMatrixMulf($matH, $call8, $call10) | 0; + $ret$0 = 0; + } + _arMatrixFreef($call10) | 0; + $ret$1 = $ret$0; + } + _arMatrixFreef($call8) | 0; + $ret$2 = $ret$1; + } + _arMatrixFreef($call) | 0; + $ret$3 = $ret$2; + } + STACKTOP = sp; + return $ret$3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle16FunctionEncodingEJRPNS2_4NodeES6_NS2_9NodeArrayES6_RNS2_10QualifiersERNS2_15FunctionRefQualEEEEPT_DpOT0_($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $10 = 0, $11 = 0, $16 = 0, $17 = 0, $21 = 0, $22 = 0, $23 = 0, $7 = 0, $8 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $7 = sp; + $8 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 36) | 0; + $9 = HEAP32[$1 >> 2] | 0; + $10 = HEAP32[$2 >> 2] | 0; + $11 = $3; + $16 = HEAP32[$11 + 4 >> 2] | 0; + $17 = $7; + HEAP32[$17 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$17 + 4 >> 2] = $16; + $21 = HEAP32[$4 >> 2] | 0; + $22 = HEAP32[$5 >> 2] | 0; + $23 = HEAP8[$6 >> 0] | 0; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$7 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$7 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle16FunctionEncodingC2EPKNS0_4NodeES4_NS0_9NodeArrayES4_NS0_10QualifiersENS0_15FunctionRefQualE($8, $9, $10, $tmpcast$byval_copy, $21, $22, $23); + STACKTOP = sp; + return $8 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle10DeleteExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy2 = 0, $2 = 0, $3 = 0, $4 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy2 = sp + 24 | 0; + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp; + if (HEAP8[$0 + 12 >> 0] | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 53698); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + } + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 54494); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + if (HEAP8[$0 + 13 >> 0] | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 54501); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + } + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + STACKTOP = sp; + return; +} + +function _icpGetMat_from_Q($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $12 = 0, $16 = 0, $3 = 0.0, $4 = 0.0, $40 = 0.0, $5 = 0.0, $6 = 0.0, $7 = 0.0, $72 = 0.0; + $3 = +HEAPF64[$1 + 24 >> 3]; + $4 = +Math_cos(+$3); + $5 = 1.0 - $4; + $6 = +Math_sin(+$3); + $7 = +HEAPF64[$1 >> 3]; + HEAPF64[$0 >> 3] = $4 + $7 * $7 * $5; + $12 = $1 + 8 | 0; + $16 = $1 + 16 | 0; + HEAPF64[$0 + 8 >> 3] = $5 * (+HEAPF64[$1 >> 3] * +HEAPF64[$12 >> 3]) - $6 * +HEAPF64[$16 >> 3]; + HEAPF64[$0 + 16 >> 3] = $5 * (+HEAPF64[$1 >> 3] * +HEAPF64[$16 >> 3]) + $6 * +HEAPF64[$12 >> 3]; + HEAPF64[$0 + 24 >> 3] = +HEAPF64[$1 + 32 >> 3]; + HEAPF64[$0 + 32 >> 3] = $5 * (+HEAPF64[$12 >> 3] * +HEAPF64[$1 >> 3]) + $6 * +HEAPF64[$16 >> 3]; + $40 = +HEAPF64[$12 >> 3]; + HEAPF64[$0 + 40 >> 3] = $4 + $5 * ($40 * $40); + HEAPF64[$0 + 48 >> 3] = $5 * (+HEAPF64[$12 >> 3] * +HEAPF64[$16 >> 3]) - $6 * +HEAPF64[$1 >> 3]; + HEAPF64[$0 + 56 >> 3] = +HEAPF64[$1 + 40 >> 3]; + HEAPF64[$0 + 64 >> 3] = $5 * (+HEAPF64[$16 >> 3] * +HEAPF64[$1 >> 3]) - $6 * +HEAPF64[$12 >> 3]; + HEAPF64[$0 + 72 >> 3] = $5 * (+HEAPF64[$16 >> 3] * +HEAPF64[$12 >> 3]) + $6 * +HEAPF64[$1 >> 3]; + $72 = +HEAPF64[$16 >> 3]; + HEAPF64[$0 + 80 >> 3] = $4 + $5 * ($72 * $72); + HEAPF64[$0 + 88 >> 3] = +HEAPF64[$1 + 48 >> 3]; + return; +} + +function __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$018 = 0, $$019 = 0, $$pn = 0, $19 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $3 = sp + 1 | 0; + HEAP8[$2 >> 0] = $1; + $4 = $0 + 11 | 0; + $5 = HEAP8[$4 >> 0] | 0; + $6 = $5 << 24 >> 24 < 0; + if ($6) { + $$018 = HEAP32[$0 + 4 >> 2] | 0; + $$019 = (HEAP32[$0 + 8 >> 2] & 2147483647) + -1 | 0; + } else { + $$018 = $5 & 255; + $$019 = 10; + } + if (($$018 | 0) == ($$019 | 0)) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm($0, $$019, 1, $$019, $$019, 0, 0); + if ((HEAP8[$4 >> 0] | 0) < 0) label = 8; else label = 7; + } else if ($6) label = 8; else label = 7; + if ((label | 0) == 7) { + HEAP8[$4 >> 0] = $$018 + 1; + $$pn = $0; + } else if ((label | 0) == 8) { + $19 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 + 4 >> 2] = $$018 + 1; + $$pn = $19; + } + $$0 = $$pn + $$018 | 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($$0, $2); + HEAP8[$3 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($$0 + 1 | 0, $3); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E26resolveForwardTemplateRefsERNS5_9NameStateE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$017 = 0, $$2 = 0, $11 = 0, $14 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = 0, $9 = 0, label = 0; + $3 = HEAP32[$1 + 12 >> 2] | 0; + $4 = $0 + 332 | 0; + $5 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EE4sizeEv($4) | 0; + $6 = $0 + 288 | 0; + $$017 = $3; + while (1) { + if ($$017 >>> 0 >= $5 >>> 0) { + label = 5; + break; + } + $8 = __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EEixEm($4, $$017) | 0; + $9 = HEAP32[$8 >> 2] | 0; + $11 = HEAP32[$9 + 8 >> 2] | 0; + if ($11 >>> 0 >= (__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE4sizeEv($6) | 0) >>> 0) { + $$2 = 1; + break; + } + $14 = __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EEixEm($6, $11) | 0; + HEAP32[$9 + 12 >> 2] = HEAP32[$14 >> 2]; + $$017 = $$017 + 1 | 0; + } + if ((label | 0) == 5) { + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EE8dropBackEm($4, $3); + $$2 = 0; + } + return $$2 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle14IntegerLiteralEJRNS_10StringViewES5_EEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $12 = 0, $16 = 0, $21 = 0, $22 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $tmpcast$byval_copy = 0, $tmpcast3$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $tmpcast3$byval_copy = sp + 24 | 0; + $tmpcast$byval_copy = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp; + $5 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 24) | 0; + $6 = $1; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $3; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + $16 = $2; + $21 = HEAP32[$16 + 4 >> 2] | 0; + $22 = $4; + HEAP32[$22 >> 2] = HEAP32[$16 >> 2]; + HEAP32[$22 + 4 >> 2] = $21; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + HEAP32[$tmpcast3$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$tmpcast3$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle14IntegerLiteralC2ENS_10StringViewES2_($5, $tmpcast$byval_copy, $tmpcast3$byval_copy); + STACKTOP = sp; + return $5 | 0; +} + +function _loadCamera($cparam_name) { + $cparam_name = $cparam_name | 0; + var $4 = 0, $__size_$i$i$i$i = 0, $cond$i$i$i = 0, $cond$i$i$i6 = 0, $param = 0, $retval$0 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 208 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(208); + $vararg_buffer1 = sp + 192 | 0; + $vararg_buffer = sp + 184 | 0; + $param = sp; + $__size_$i$i$i$i = $cparam_name + 11 | 0; + if ((HEAP8[$__size_$i$i$i$i >> 0] | 0) < 0) $cond$i$i$i = HEAP32[$cparam_name >> 2] | 0; else $cond$i$i$i = $cparam_name; + if ((_arParamLoad($cond$i$i$i, 1, $param, $vararg_buffer) | 0) < 0) { + if ((HEAP8[$__size_$i$i$i$i >> 0] | 0) < 0) $cond$i$i$i6 = HEAP32[$cparam_name >> 2] | 0; else $cond$i$i$i6 = $cparam_name; + HEAP32[$vararg_buffer1 >> 2] = $cond$i$i$i6; + _arLog(0, 3, 44850, $vararg_buffer1); + $retval$0 = -1; + } else { + $4 = HEAP32[16325] | 0; + HEAP32[16325] = $4 + 1; + HEAP32[$vararg_buffer >> 2] = $4; + _memcpy(__ZNSt3__213unordered_mapIi7ARParamNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65280, $vararg_buffer) | 0, $param | 0, 184) | 0; + $retval$0 = HEAP32[$vararg_buffer >> 2] | 0; + } + STACKTOP = sp; + return $retval$0 | 0; +} + +function _getTransMatSquareCont($id, $markerIndex, $markerWidth) { + $id = $id | 0; + $markerIndex = $markerIndex | 0; + $markerWidth = $markerWidth | 0; + var $1 = 0, $call7 = 0, $id$addr = 0, $retval$1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + do if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0) { + $call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0; + $1 = HEAP32[$call7 + 216 >> 2] | 0; + if ((HEAP32[$1 + 44 >> 2] | 0) > ($markerIndex | 0)) { + +_arGetTransMatSquareCont(HEAP32[$call7 + 228 >> 2] | 0, ($markerIndex | 0) < 0 ? 64312 : $1 + 48 + ($markerIndex << 8) | 0, 61136, +($markerWidth | 0), 61136); + $retval$1 = 0; + break; + } else { + $retval$1 = HEAP32[4226] | 0; + break; + } + } else $retval$1 = HEAP32[4224] | 0; while (0); + STACKTOP = sp; + return $retval$1 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13ReferenceType10printRightERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp + 24 | 0; + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp; + $5 = $0 + 16 | 0; + if (!(HEAP8[$5 >> 0] | 0)) { + __ZN12_GLOBAL__N_114SwapAndRestoreIbEC2ERbb($2, $5, 1); + __ZNK12_GLOBAL__N_116itanium_demangle13ReferenceType8collapseERNS_12OutputStreamE($3, $0, $1); + $9 = HEAP32[$3 + 4 >> 2] | 0; + if (!(__ZNK12_GLOBAL__N_116itanium_demangle4Node8hasArrayERNS_12OutputStreamE($9, $1) | 0) ? !(__ZNK12_GLOBAL__N_116itanium_demangle4Node11hasFunctionERNS_12OutputStreamE($9, $1) | 0) : 0) {} else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 51964); + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + } + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$9 >> 2] | 0) + 20 >> 2] & 255]($9, $1); + __ZN12_GLOBAL__N_114SwapAndRestoreIbED2Ev($2); + } + STACKTOP = sp; + return; +} + +function _jpeg_CreateDecompress($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$pre$phiZ2D = 0, $13 = 0, $20 = 0, $21 = 0, $22 = 0, $5 = 0, dest = 0, stop = 0; + HEAP32[$0 + 4 >> 2] = 0; + if (($1 | 0) != 90) { + $5 = HEAP32[$0 >> 2] | 0; + HEAP32[$5 + 20 >> 2] = 13; + HEAP32[$5 + 24 >> 2] = 90; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = $1; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + if (($2 | 0) == 488) $$pre$phiZ2D = $0; else { + $13 = HEAP32[$0 >> 2] | 0; + HEAP32[$13 + 20 >> 2] = 22; + HEAP32[$13 + 24 >> 2] = 488; + HEAP32[(HEAP32[$0 >> 2] | 0) + 28 >> 2] = $2; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + $$pre$phiZ2D = $0; + } + $20 = HEAP32[$0 >> 2] | 0; + $21 = $0 + 12 | 0; + $22 = HEAP32[$21 >> 2] | 0; + _memset($0 + 4 | 0, 0, 484) | 0; + HEAP32[$0 >> 2] = $20; + HEAP32[$21 >> 2] = $22; + HEAP32[$0 + 16 >> 2] = 1; + _jinit_memory_mgr($$pre$phiZ2D); + HEAP32[$0 + 8 >> 2] = 0; + HEAP32[$0 + 24 >> 2] = 0; + HEAP32[$0 + 312 >> 2] = 0; + dest = $0 + 164 | 0; + stop = dest + 48 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + _jinit_marker_reader($0); + _jinit_input_controller($0); + HEAP32[$0 + 20 >> 2] = 200; + return; +} +function _start_pass_dpost($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $19 = 0, $28 = 0, $3 = 0, $35 = 0, $39 = 0, $8 = 0; + $3 = HEAP32[$0 + 456 >> 2] | 0; + L1 : do switch ($1 | 0) { + case 0: + { + if (!(HEAP32[$0 + 84 >> 2] | 0)) { + HEAP32[$3 + 4 >> 2] = HEAP32[(HEAP32[$0 + 476 >> 2] | 0) + 4 >> 2]; + break L1; + } + HEAP32[$3 + 4 >> 2] = 4; + $8 = $3 + 12 | 0; + if (!(HEAP32[$8 >> 2] | 0)) { + $19 = FUNCTION_TABLE_iiiiii[HEAP32[(HEAP32[$0 + 4 >> 2] | 0) + 28 >> 2] & 31]($0, HEAP32[$3 + 8 >> 2] | 0, 0, HEAP32[$3 + 16 >> 2] | 0, 1) | 0; + HEAP32[$8 >> 2] = $19; + } + break; + } + case 3: + { + if (!(HEAP32[$3 + 8 >> 2] | 0)) { + $28 = HEAP32[$0 >> 2] | 0; + HEAP32[$28 + 20 >> 2] = 3; + FUNCTION_TABLE_vi[HEAP32[$28 >> 2] & 255]($0); + } + HEAP32[$3 + 4 >> 2] = 5; + break; + } + case 2: + { + if (!(HEAP32[$3 + 8 >> 2] | 0)) { + $35 = HEAP32[$0 >> 2] | 0; + HEAP32[$35 + 20 >> 2] = 3; + FUNCTION_TABLE_vi[HEAP32[$35 >> 2] & 255]($0); + } + HEAP32[$3 + 4 >> 2] = 6; + break; + } + default: + { + $39 = HEAP32[$0 >> 2] | 0; + HEAP32[$39 + 20 >> 2] = 3; + FUNCTION_TABLE_vi[HEAP32[$39 >> 2] & 255]($0); + } + } while (0); + HEAP32[$3 + 24 >> 2] = 0; + HEAP32[$3 + 20 >> 2] = 0; + return; +} + +function __ZNSt3__225__num_get_signed_integralIxEET_PKcS3_Rji($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $15 = 0, $23 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $4 = 0, $6 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp; + if (($0 | 0) == ($1 | 0)) { + HEAP32[$2 >> 2] = 4; + $26 = 0; + $27 = 0; + } else { + $6 = ___errno_location() | 0; + $7 = HEAP32[$6 >> 2] | 0; + $8 = ___errno_location() | 0; + HEAP32[$8 >> 2] = 0; + $10 = _strtoll_l($0, $4, $3, __ZNSt3__26__clocEv() | 0) | 0; + $11 = getTempRet0() | 0; + $12 = ___errno_location() | 0; + $13 = HEAP32[$12 >> 2] | 0; + if (!$13) { + $15 = ___errno_location() | 0; + HEAP32[$15 >> 2] = $7; + } + if ((HEAP32[$4 >> 2] | 0) == ($1 | 0)) if (($13 | 0) == 68) { + HEAP32[$2 >> 2] = 4; + $23 = ($11 | 0) > 0 | ($11 | 0) == 0 & $10 >>> 0 > 0; + $28 = $23 ? -1 : 0; + $29 = $23 ? 2147483647 : -2147483648; + } else { + $28 = $10; + $29 = $11; + } else { + HEAP32[$2 >> 2] = 4; + $28 = 0; + $29 = 0; + } + $26 = $29; + $27 = $28; + } + setTempRet0($26 | 0); + STACKTOP = sp; + return $27 | 0; +} + +function _vsnprintf($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$014 = 0, $$015 = 0, $11 = 0, $14 = 0, $16 = 0, $17 = 0, $19 = 0, $21 = 0, $4 = 0, $5 = 0, $9 = 0, $spec$select = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 160 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(160); + $4 = sp + 144 | 0; + $5 = sp; + _memcpy($5 | 0, 13736, 144) | 0; + if (($1 + -1 | 0) >>> 0 > 2147483646) if (!$1) { + $$014 = $4; + $$015 = 1; + label = 4; + } else { + $9 = ___errno_location() | 0; + HEAP32[$9 >> 2] = 61; + $$0 = -1; + } else { + $$014 = $0; + $$015 = $1; + label = 4; + } + if ((label | 0) == 4) { + $11 = -2 - $$014 | 0; + $spec$select = $$015 >>> 0 > $11 >>> 0 ? $11 : $$015; + HEAP32[$5 + 48 >> 2] = $spec$select; + $14 = $5 + 20 | 0; + HEAP32[$14 >> 2] = $$014; + HEAP32[$5 + 44 >> 2] = $$014; + $16 = $$014 + $spec$select | 0; + $17 = $5 + 16 | 0; + HEAP32[$17 >> 2] = $16; + HEAP32[$5 + 28 >> 2] = $16; + $19 = _vfprintf($5, $2, $3) | 0; + if (!$spec$select) $$0 = $19; else { + $21 = HEAP32[$14 >> 2] | 0; + HEAP8[$21 + ((($21 | 0) == (HEAP32[$17 >> 2] | 0)) << 31 >> 31) >> 0] = 0; + $$0 = $19; + } + } + STACKTOP = sp; + return $$0 | 0; +} + +function _getTransMatSquare($id, $markerIndex, $markerWidth) { + $id = $id | 0; + $markerIndex = $markerIndex | 0; + $markerWidth = $markerWidth | 0; + var $1 = 0, $call7 = 0, $id$addr = 0, $retval$1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + do if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0) { + $call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0; + $1 = HEAP32[$call7 + 216 >> 2] | 0; + if ((HEAP32[$1 + 44 >> 2] | 0) > ($markerIndex | 0)) { + +_arGetTransMatSquare(HEAP32[$call7 + 228 >> 2] | 0, ($markerIndex | 0) < 0 ? 64312 : $1 + 48 + ($markerIndex << 8) | 0, +($markerWidth | 0), 61136); + $retval$1 = 0; + break; + } else { + $retval$1 = HEAP32[4226] | 0; + break; + } + } else $retval$1 = HEAP32[4224] | 0; while (0); + STACKTOP = sp; + return $retval$1 | 0; +} + +function _icpGetDeltaS($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $13 = 0, $15 = 0, $17 = 0, $4 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $4 = sp + 24 | 0; + $5 = sp + 12 | 0; + $6 = sp; + HEAP32[$4 + 4 >> 2] = 6; + HEAP32[$4 + 8 >> 2] = 1; + HEAP32[$4 >> 2] = $0; + HEAP32[$5 + 4 >> 2] = $3; + HEAP32[$5 + 8 >> 2] = 1; + HEAP32[$5 >> 2] = $1; + HEAP32[$6 + 4 >> 2] = $3; + HEAP32[$6 + 8 >> 2] = 6; + HEAP32[$6 >> 2] = $2; + $13 = _arMatrixAllocTrans($6) | 0; + do if ($13) { + $15 = _arMatrixAllocMul($13, $6) | 0; + if (!$15) { + _arMatrixFree($13) | 0; + $$0 = -1; + break; + } + $17 = _arMatrixAllocMul($13, $5) | 0; + if (!$17) { + _arMatrixFree($13) | 0; + _arMatrixFree($15) | 0; + $$0 = -1; + break; + } + if ((_arMatrixSelfInv($15) | 0) < 0) { + _arMatrixFree($13) | 0; + _arMatrixFree($15) | 0; + _arMatrixFree($17) | 0; + $$0 = -1; + break; + } else { + _arMatrixMul($4, $15, $17) | 0; + _arMatrixFree($13) | 0; + _arMatrixFree($15) | 0; + _arMatrixFree($17) | 0; + $$0 = 0; + break; + } + } else $$0 = -1; while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $12 = 0, $17 = 0, $18 = 0, $23 = 0, $25 = 0, $26 = 0, $6 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + $8 = $0 + 8 | 0; + $12 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$8 >> 2] | 0) + 20 >> 2] & 127]($8) | 0; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + $17 = HEAP8[$12 + 8 + 3 >> 0] | 0; + $18 = $17 << 24 >> 24 < 0; + $23 = $18 ? HEAP32[$12 >> 2] | 0 : $12; + $25 = $23 + (($18 ? HEAP32[$12 + 4 >> 2] | 0 : $17 & 255) << 2) | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $26 = __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_($0, $$byval_copy, $$byval_copy1, $3, $4, $5, $23, $25) | 0; + STACKTOP = sp; + return $26 | 0; +} + +function __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$0$be = 0, $$021 = 0, $$021$be = 0, $$sroa$speculated = 0, $12 = 0, $14 = 0, $22 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0, $7 = 0, $8 = 0; + $3 = __ZNSt3__211char_traitsIwE3eofEv() | 0; + $4 = $0 + 24 | 0; + $5 = $0 + 28 | 0; + $$0 = $1; + $$021 = 0; + while (1) { + if (($$021 | 0) >= ($2 | 0)) break; + $7 = HEAP32[$4 >> 2] | 0; + $8 = HEAP32[$5 >> 2] | 0; + if ($7 >>> 0 < $8 >>> 0) { + $22 = $8 - $7 >> 2; + $23 = $2 - $$021 | 0; + $$sroa$speculated = ($23 | 0) < ($22 | 0) ? $23 : $22; + __ZNSt3__211char_traitsIwE4copyEPwPKwm($7, $$0, $$sroa$speculated) | 0; + HEAP32[$4 >> 2] = (HEAP32[$4 >> 2] | 0) + ($$sroa$speculated << 2); + $$0$be = $$0 + ($$sroa$speculated << 2) | 0; + $$021$be = $$sroa$speculated + $$021 | 0; + } else { + $12 = HEAP32[(HEAP32[$0 >> 2] | 0) + 52 >> 2] | 0; + $14 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$$0 >> 2] | 0) | 0; + if ((FUNCTION_TABLE_iii[$12 & 127]($0, $14) | 0) == ($3 | 0)) break; + $$0$be = $$0 + 4 | 0; + $$021$be = $$021 + 1 | 0; + } + $$0 = $$0$be; + $$021 = $$021$be; + } + return $$021 | 0; +} + +function _rgb_convert_54($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$03338$us = 0, $$03439$us = 0, $$03637$us = 0, $$040$us = 0, $$in = 0, $14 = 0, $17 = 0, $20 = 0, $6 = 0, $8 = 0, $9 = 0, $$in$looptemp = 0; + $6 = HEAP32[$0 + 112 >> 2] | 0; + if (($4 | 0) <= 0) return; + $8 = $1 + 4 | 0; + $9 = $1 + 8 | 0; + if (!$6) return; + $$03439$us = $3; + $$040$us = $2; + $$in = $4; + while (1) { + $$in$looptemp = $$in; + $$in = $$in + -1 | 0; + $14 = HEAP32[(HEAP32[$1 >> 2] | 0) + ($$040$us << 2) >> 2] | 0; + $17 = HEAP32[(HEAP32[$8 >> 2] | 0) + ($$040$us << 2) >> 2] | 0; + $20 = HEAP32[(HEAP32[$9 >> 2] | 0) + ($$040$us << 2) >> 2] | 0; + $$040$us = $$040$us + 1 | 0; + $$03338$us = 0; + $$03637$us = HEAP32[$$03439$us >> 2] | 0; + while (1) { + HEAP8[$$03637$us >> 0] = HEAP8[$14 + $$03338$us >> 0] | 0; + HEAP8[$$03637$us + 1 >> 0] = HEAP8[$17 + $$03338$us >> 0] | 0; + HEAP8[$$03637$us + 2 >> 0] = HEAP8[$20 + $$03338$us >> 0] | 0; + $$03338$us = $$03338$us + 1 | 0; + if (($$03338$us | 0) == ($6 | 0)) break; else $$03637$us = $$03637$us + 3 | 0; + } + if (($$in$looptemp | 0) <= 1) break; else $$03439$us = $$03439$us + 4 | 0; + } + return; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $12 = 0, $16 = 0, $17 = 0, $22 = 0, $24 = 0, $25 = 0, $6 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + $8 = $0 + 8 | 0; + $12 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$8 >> 2] | 0) + 20 >> 2] & 127]($8) | 0; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + $16 = HEAP8[$12 + 11 >> 0] | 0; + $17 = $16 << 24 >> 24 < 0; + $22 = $17 ? HEAP32[$12 >> 2] | 0 : $12; + $24 = $22 + ($17 ? HEAP32[$12 + 4 >> 2] | 0 : $16 & 255) | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $25 = __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_($0, $$byval_copy, $$byval_copy1, $3, $4, $5, $22, $24) | 0; + STACKTOP = sp; + return $25 | 0; +} + +function _jpeg_read_scanlines($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $12 = 0, $13 = 0, $15 = 0, $17 = 0, $22 = 0, $3 = 0, $31 = 0, $5 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + $5 = HEAP32[$0 + 20 >> 2] | 0; + if (($5 | 0) != 205) { + $7 = HEAP32[$0 >> 2] | 0; + HEAP32[$7 + 20 >> 2] = 21; + HEAP32[$7 + 24 >> 2] = $5; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $12 = $0 + 140 | 0; + $13 = HEAP32[$12 >> 2] | 0; + $15 = HEAP32[$0 + 116 >> 2] | 0; + if ($13 >>> 0 >= $15 >>> 0) { + $17 = HEAP32[$0 >> 2] | 0; + HEAP32[$17 + 20 >> 2] = 126; + FUNCTION_TABLE_vii[HEAP32[$17 + 4 >> 2] & 255]($0, -1); + $$0 = 0; + STACKTOP = sp; + return $$0 | 0; + } + $22 = HEAP32[$0 + 8 >> 2] | 0; + if ($22 | 0) { + HEAP32[$22 + 4 >> 2] = $13; + HEAP32[$22 + 8 >> 2] = $15; + FUNCTION_TABLE_vi[HEAP32[$22 >> 2] & 255]($0); + } + HEAP32[$3 >> 2] = 0; + FUNCTION_TABLE_viiii[HEAP32[(HEAP32[$0 + 448 >> 2] | 0) + 4 >> 2] & 31]($0, $1, $3, $2); + $31 = HEAP32[$3 >> 2] | 0; + HEAP32[$12 >> 2] = (HEAP32[$12 >> 2] | 0) + $31; + $$0 = $31; + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13EnclosingExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $11 = 0, $18 = 0, $2 = 0, $23 = 0, $24 = 0, $3 = 0, $5 = 0, $tmpcast4$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $tmpcast4$byval_copy = sp + 16 | 0; + $2 = sp + 8 | 0; + $3 = sp; + $5 = $0 + 8 | 0; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $2; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + HEAP32[$tmpcast4$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast4$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast4$byval_copy); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 16 >> 2] | 0, $1); + $18 = $0 + 20 | 0; + $23 = HEAP32[$18 + 4 >> 2] | 0; + $24 = $3; + HEAP32[$24 >> 2] = HEAP32[$18 >> 2]; + HEAP32[$24 + 4 >> 2] = $23; + HEAP32[$tmpcast4$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast4$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast4$byval_copy); + STACKTOP = sp; + return; +} + +function _EX($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$039 = 0, $$040 = 0, $$041 = 0, $$043 = 0, $$1 = 0, $$142 = 0, $$2 = 0, $23 = 0.0, $25 = 0, $3 = 0, $5 = 0; + $3 = HEAP32[$0 + 4 >> 2] | 0; + $5 = HEAP32[$0 + 8 >> 2] | 0; + L1 : do if (!(($3 | 0) < 1 | ($5 | 0) < 1) ? (HEAP32[$1 + 4 >> 2] | 0) == ($5 | 0) : 0) { + $$039 = 0; + while (1) { + if (($$039 | 0) == ($5 | 0)) break; + HEAPF64[(HEAP32[$1 >> 2] | 0) + ($$039 << 3) >> 3] = 0.0; + $$039 = $$039 + 1 | 0; + } + $$041 = HEAP32[$0 >> 2] | 0; + $$1 = 0; + while (1) { + if (($$1 | 0) == ($3 | 0)) break; + $$0 = 0; + $$043 = HEAP32[$1 >> 2] | 0; + $$142 = $$041; + while (1) { + if (($$0 | 0) == ($5 | 0)) break; + HEAPF64[$$043 >> 3] = +HEAPF64[$$142 >> 3] + +HEAPF64[$$043 >> 3]; + $$0 = $$0 + 1 | 0; + $$043 = $$043 + 8 | 0; + $$142 = $$142 + 8 | 0; + } + $$041 = $$041 + ($5 << 3) | 0; + $$1 = $$1 + 1 | 0; + } + $23 = +($3 | 0); + $$2 = 0; + while (1) { + if (($$2 | 0) == ($5 | 0)) { + $$040 = 0; + break L1; + } + $25 = (HEAP32[$1 >> 2] | 0) + ($$2 << 3) | 0; + HEAPF64[$25 >> 3] = +HEAPF64[$25 >> 3] / $23; + $$2 = $$2 + 1 | 0; + } + } else $$040 = -1; while (0); + return $$040 | 0; +} + +function __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$0$be = 0, $$021 = 0, $$021$be = 0, $$sroa$speculated = 0, $12 = 0, $14 = 0, $21 = 0, $22 = 0, $3 = 0, $4 = 0, $5 = 0, $7 = 0, $8 = 0; + $3 = __ZNSt3__211char_traitsIcE3eofEv() | 0; + $4 = $0 + 24 | 0; + $5 = $0 + 28 | 0; + $$0 = $1; + $$021 = 0; + while (1) { + if (($$021 | 0) >= ($2 | 0)) break; + $7 = HEAP32[$4 >> 2] | 0; + $8 = HEAP32[$5 >> 2] | 0; + if ($7 >>> 0 < $8 >>> 0) { + $21 = $8 - $7 | 0; + $22 = $2 - $$021 | 0; + $$sroa$speculated = ($22 | 0) < ($21 | 0) ? $22 : $21; + __ZNSt3__211char_traitsIcE4copyEPcPKcm($7, $$0, $$sroa$speculated) | 0; + HEAP32[$4 >> 2] = (HEAP32[$4 >> 2] | 0) + $$sroa$speculated; + $$0$be = $$0 + $$sroa$speculated | 0; + $$021$be = $$sroa$speculated + $$021 | 0; + } else { + $12 = HEAP32[(HEAP32[$0 >> 2] | 0) + 52 >> 2] | 0; + $14 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$$0 >> 0] | 0) | 0; + if ((FUNCTION_TABLE_iii[$12 & 127]($0, $14) | 0) == ($3 | 0)) break; + $$0$be = $$0 + 1 | 0; + $$021$be = $$021 + 1 | 0; + } + $$0 = $$0$be; + $$021 = $$021$be; + } + return $$021 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle15UnnamedTypeName9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy1 = 0, $11 = 0, $12 = 0, $2 = 0, $3 = 0, $4 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 24 | 0; + $2 = sp + 16 | 0; + $3 = sp; + $4 = sp + 8 | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 55313); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + $6 = $0 + 8 | 0; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $3; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 55322); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle12FunctionTypeEJRPNS2_4NodeERNS2_9NodeArrayERNS2_10QualifiersERNS2_15FunctionRefQualES6_EEEPT_DpOT0_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $14 = 0, $15 = 0, $19 = 0, $20 = 0, $21 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $6 = sp; + $7 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 32) | 0; + $8 = HEAP32[$1 >> 2] | 0; + $9 = $2; + $14 = HEAP32[$9 + 4 >> 2] | 0; + $15 = $6; + HEAP32[$15 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$15 + 4 >> 2] = $14; + $19 = HEAP32[$3 >> 2] | 0; + $20 = HEAP8[$4 >> 0] | 0; + $21 = HEAP32[$5 >> 2] | 0; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$6 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle12FunctionTypeC2EPKNS0_4NodeENS0_9NodeArrayENS0_10QualifiersENS0_15FunctionRefQualES4_($7, $8, $tmpcast$byval_copy, $19, $20, $21); + STACKTOP = sp; + return $7 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseBinaryExprENS_10StringViewE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp + 4 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0; + $5 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($4) | 0; + HEAP32[$2 >> 2] = $5; + if (!$5) $$1 = 0; else { + $7 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv($4) | 0; + HEAP32[$3 >> 2] = $7; + if (!$7) $$0 = 0; else $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10BinaryExprEJRPNS0_4NodeERNS_10StringViewESA_EEES9_DpOT0_($0, $2, $1, $3) | 0; + $$1 = $$0; + } + STACKTOP = sp; + return $$1 | 0; +} + +function __ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $14 = 0, $15 = 0, $19 = 0, $2 = 0, $24 = 0, $25 = 0, $3 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 4 | 0; + $8 = ((HEAP32[$3 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 2) + 1 | 0; + $9 = __ZNKSt3__26vectorIiNS_9allocatorIiEEE8max_sizeEv($0) | 0; + if ($9 >>> 0 < $8 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $14 = HEAP32[$0 >> 2] | 0; + $15 = (HEAP32[$0 + 8 >> 2] | 0) - $14 | 0; + $19 = $15 >> 1; + __ZNSt3__214__split_bufferIiRNS_9allocatorIiEEEC2EmmS3_($2, $15 >> 2 >>> 0 < $9 >>> 1 >>> 0 ? ($19 >>> 0 < $8 >>> 0 ? $8 : $19) : $9, (HEAP32[$3 >> 2] | 0) - $14 >> 2, $0 + 8 | 0); + $24 = $2 + 8 | 0; + $25 = HEAP32[$24 >> 2] | 0; + HEAP32[$25 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$24 >> 2] = $25 + 4; + __ZNSt3__26vectorIiNS_9allocatorIiEEE26__swap_out_circular_bufferERNS_14__split_bufferIiRS2_EE($0, $2); + __ZNSt3__214__split_bufferIiRNS_9allocatorIiEEED2Ev($2); + STACKTOP = sp; + return; + } +} + +function __ZNK10__cxxabiv117__class_type_info9can_catchEPKNS_16__shim_type_infoERPv($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$2 = 0, $11 = 0, $12 = 0, $13 = 0, $3 = 0, $6 = 0, dest = 0, sp = 0, stop = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 64 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(64); + $3 = sp; + if (!(__ZL8is_equalPKSt9type_infoS1_b($0, $1, 0) | 0)) if (($1 | 0) != 0 ? ($6 = ___dynamic_cast($1, 13904, 13888, 0) | 0, ($6 | 0) != 0) : 0) { + HEAP32[$3 >> 2] = $6; + HEAP32[$3 + 4 >> 2] = 0; + HEAP32[$3 + 8 >> 2] = $0; + HEAP32[$3 + 12 >> 2] = -1; + $11 = $3 + 16 | 0; + $12 = $3 + 24 | 0; + $13 = $3 + 48 | 0; + dest = $11; + stop = dest + 36 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP16[$11 + 36 >> 1] = 0; + HEAP8[$11 + 38 >> 0] = 0; + HEAP32[$13 >> 2] = 1; + FUNCTION_TABLE_viiii[HEAP32[(HEAP32[$6 >> 2] | 0) + 28 >> 2] & 31]($6, $3, HEAP32[$2 >> 2] | 0, 1); + if ((HEAP32[$12 >> 2] | 0) == 1) { + HEAP32[$2 >> 2] = HEAP32[$11 >> 2]; + $$0 = 1; + } else $$0 = 0; + $$2 = $$0; + } else $$2 = 0; else $$2 = 1; + STACKTOP = sp; + return $$2 | 0; +} + +function _wcrtomb($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $13 = 0, $57 = 0, $7 = 0; + do if ($0) { + if ($1 >>> 0 < 128) { + HEAP8[$0 >> 0] = $1; + $$0 = 1; + break; + } + $7 = (___pthread_self_423() | 0) + 188 | 0; + if (!(HEAP32[HEAP32[$7 >> 2] >> 2] | 0)) if (($1 & -128 | 0) == 57216) { + HEAP8[$0 >> 0] = $1; + $$0 = 1; + break; + } else { + $13 = ___errno_location() | 0; + HEAP32[$13 >> 2] = 25; + $$0 = -1; + break; + } + if ($1 >>> 0 < 2048) { + HEAP8[$0 >> 0] = $1 >>> 6 | 192; + HEAP8[$0 + 1 >> 0] = $1 & 63 | 128; + $$0 = 2; + break; + } + if ($1 >>> 0 < 55296 | ($1 & -8192 | 0) == 57344) { + HEAP8[$0 >> 0] = $1 >>> 12 | 224; + HEAP8[$0 + 1 >> 0] = $1 >>> 6 & 63 | 128; + HEAP8[$0 + 2 >> 0] = $1 & 63 | 128; + $$0 = 3; + break; + } + if (($1 + -65536 | 0) >>> 0 < 1048576) { + HEAP8[$0 >> 0] = $1 >>> 18 | 240; + HEAP8[$0 + 1 >> 0] = $1 >>> 12 & 63 | 128; + HEAP8[$0 + 2 >> 0] = $1 >>> 6 & 63 | 128; + HEAP8[$0 + 3 >> 0] = $1 & 63 | 128; + $$0 = 4; + break; + } else { + $57 = ___errno_location() | 0; + HEAP32[$57 >> 2] = 25; + $$0 = -1; + break; + } + } else $$0 = 1; while (0); + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle19parse_discriminatorEPKcS2_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$031 = 0, $$2 = 0, $$pn = 0, $13 = 0, $3 = 0, $5 = 0, $7 = 0; + L1 : do if (($0 | 0) != ($1 | 0)) { + $3 = HEAP8[$0 >> 0] | 0; + if ($3 << 24 >> 24 != 95) { + if ((($3 << 24 >> 24) + -48 | 0) >>> 0 >= 10) { + $$2 = $0; + break; + } + $$pn = $0; + while (1) { + $$pn = $$pn + 1 | 0; + if (($$pn | 0) == ($1 | 0)) { + $$2 = $1; + break L1; + } + if (((HEAP8[$$pn >> 0] | 0) + -48 | 0) >>> 0 >= 10) { + $$2 = $0; + break L1; + } + } + } + $5 = $0 + 1 | 0; + if (($5 | 0) != ($1 | 0)) { + $7 = HEAP8[$5 >> 0] | 0; + if ((($7 << 24 >> 24) + -48 | 0) >>> 0 < 10) { + $$2 = $0 + 2 | 0; + break; + } + if ($7 << 24 >> 24 == 95) { + $$031 = $0 + 2 | 0; + while (1) { + if (($$031 | 0) == ($1 | 0)) { + $$2 = $0; + break L1; + } + $13 = HEAP8[$$031 >> 0] | 0; + if ((($13 << 24 >> 24) + -48 | 0) >>> 0 >= 10) break; + $$031 = $$031 + 1 | 0; + } + return ($13 << 24 >> 24 == 95 ? $$031 + 1 | 0 : $0) | 0; + } else $$2 = $0; + } else $$2 = $0; + } else $$2 = $0; while (0); + return $$2 | 0; +} + +function __ZNSt3__214__num_put_base14__format_floatEPcPKcj($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$022 = 0, $$023$off0 = 0, $$1 = 0, $$2 = 0, $$3 = 0, $$sink = 0, $10 = 0, $11 = 0, $14 = 0, $25 = 0, $9 = 0; + if (!($2 & 2048)) $$0 = $0; else { + HEAP8[$0 >> 0] = 43; + $$0 = $0 + 1 | 0; + } + if (!($2 & 1024)) $$1 = $$0; else { + HEAP8[$$0 >> 0] = 35; + $$1 = $$0 + 1 | 0; + } + $9 = $2 & 260; + $10 = $2 & 16384; + $11 = ($9 | 0) == 260; + if ($11) { + $$023$off0 = 0; + $$2 = $$1; + } else { + HEAP8[$$1 >> 0] = 46; + HEAP8[$$1 + 1 >> 0] = 42; + $$023$off0 = 1; + $$2 = $$1 + 2 | 0; + } + $$022 = $1; + $$3 = $$2; + while (1) { + $14 = HEAP8[$$022 >> 0] | 0; + if (!($14 << 24 >> 24)) break; + HEAP8[$$3 >> 0] = $14; + $$022 = $$022 + 1 | 0; + $$3 = $$3 + 1 | 0; + } + L14 : do switch ($9 & 511) { + case 4: + { + $$sink = $10 >>> 9 & 255 ^ 102; + break; + } + case 256: + { + $$sink = $10 >>> 9 & 255 ^ 101; + break; + } + default: + { + $25 = $10 >>> 9 & 255; + if ($11) { + $$sink = $25 ^ 97; + break L14; + } else { + $$sink = $25 ^ 103; + break L14; + } + } + } while (0); + HEAP8[$$3 >> 0] = $$sink; + return $$023$off0 | 0; +} + +function __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $14 = 0, $15 = 0, $20 = 0, $21 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + $4 = $0 + 8 | 0; + $5 = $4 + 3 | 0; + $6 = HEAP8[$5 >> 0] | 0; + $7 = $6 << 24 >> 24 < 0; + if ($7) { + $14 = HEAP32[$0 + 4 >> 2] | 0; + $15 = (HEAP32[$4 >> 2] & 2147483647) + -1 | 0; + } else { + $14 = $6 & 255; + $15 = 1; + } + if (($15 - $14 | 0) >>> 0 >= $2 >>> 0) { + if ($2 | 0) { + if ($7) $20 = HEAP32[$0 >> 2] | 0; else $20 = $0; + __ZNSt3__211char_traitsIwE4copyEPwPKwm($20 + ($14 << 2) | 0, $1, $2) | 0; + $21 = $14 + $2 | 0; + if ((HEAP8[$5 >> 0] | 0) < 0) HEAP32[$0 + 4 >> 2] = $21; else HEAP8[$5 >> 0] = $21; + HEAP32[$3 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($20 + ($21 << 2) | 0, $3); + } + } else __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw($0, $15, $14 + $2 - $15 | 0, $14, $14, 0, $2, $1); + STACKTOP = sp; + return $0 | 0; +} + +function _fflush($0) { + $0 = $0 | 0; + var $$0 = 0, $$02325 = 0, $$02327 = 0, $$024$lcssa = 0, $$02426 = 0, $$1 = 0, $12 = 0, $26 = 0, $29 = 0, $7 = 0, $phitmp = 0; + do if ($0) { + if ((HEAP32[$0 + 76 >> 2] | 0) <= -1) { + $$0 = ___fflush_unlocked($0) | 0; + break; + } + $phitmp = (___lockfile($0) | 0) == 0; + $7 = ___fflush_unlocked($0) | 0; + if ($phitmp) $$0 = $7; else { + ___unlockfile($0); + $$0 = $7; + } + } else { + if (!(HEAP32[4274] | 0)) $29 = 0; else $29 = _fflush(HEAP32[4274] | 0) | 0; + $12 = ___ofl_lock() | 0; + $$02325 = HEAP32[$12 >> 2] | 0; + if (!$$02325) $$024$lcssa = $29; else { + $$02327 = $$02325; + $$02426 = $29; + while (1) { + if ((HEAP32[$$02327 + 76 >> 2] | 0) > -1) $26 = ___lockfile($$02327) | 0; else $26 = 0; + if ((HEAP32[$$02327 + 20 >> 2] | 0) >>> 0 > (HEAP32[$$02327 + 28 >> 2] | 0) >>> 0) $$1 = ___fflush_unlocked($$02327) | 0 | $$02426; else $$1 = $$02426; + if ($26 | 0) ___unlockfile($$02327); + $$02327 = HEAP32[$$02327 + 56 >> 2] | 0; + if (!$$02327) { + $$024$lcssa = $$1; + break; + } else $$02426 = $$1; + } + } + ___ofl_unlock(); + $$0 = $$024$lcssa; + } while (0); + return $$0 | 0; +} + +function _use_merged_upsample($0) { + $0 = $0 | 0; + var $19 = 0, $39 = 0, $50 = 0; + if (HEAP32[$0 + 308 >> 2] | 0) return 0; + switch (HEAP32[$0 + 40 >> 2] | 0) { + case 7: + case 3: + break; + default: + return 0; + } + if ((HEAP32[$0 + 36 >> 2] | 0) != 3) return 0; + if ((HEAP32[$0 + 44 >> 2] | 0) != 2) return 0; + if ((HEAP32[$0 + 120 >> 2] | 0) != 3) return 0; + if (HEAP32[$0 + 304 >> 2] | 0) return 0; + $19 = HEAP32[$0 + 216 >> 2] | 0; + if ((HEAP32[$19 + 8 >> 2] | 0) != 2) return 0; + if ((HEAP32[$19 + 96 >> 2] | 0) != 1) return 0; + if ((HEAP32[$19 + 184 >> 2] | 0) != 1) return 0; + if ((HEAP32[$19 + 12 >> 2] | 0) > 2) return 0; + if ((HEAP32[$19 + 100 >> 2] | 0) != 1) return 0; + if ((HEAP32[$19 + 188 >> 2] | 0) != 1) return 0; + $39 = HEAP32[$19 + 36 >> 2] | 0; + if (($39 | 0) != (HEAP32[$0 + 324 >> 2] | 0)) return 0; + if ((HEAP32[$19 + 124 >> 2] | 0) != ($39 | 0)) return 0; + if ((HEAP32[$19 + 212 >> 2] | 0) != ($39 | 0)) return 0; + $50 = HEAP32[$19 + 40 >> 2] | 0; + if (($50 | 0) != (HEAP32[$0 + 328 >> 2] | 0)) return 0; + if ((HEAP32[$19 + 128 >> 2] | 0) == ($50 | 0)) return (HEAP32[$19 + 216 >> 2] | 0) == ($50 | 0) | 0; else return 0; + return 0; +} + +function _detectMarker($id) { + $id = $id | 0; + var $buff = 0, $call7 = 0, $id$addr = 0, $retval$0 = 0, dest = 0, sp = 0, stop = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $id$addr = sp + 40 | 0; + $buff = sp; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$0 = HEAP32[4224] | 0; else { + $call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0; + dest = $buff; + stop = dest + 40 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$buff >> 2] = HEAP32[$call7 + 196 >> 2]; + HEAP32[$buff + 16 >> 2] = 1; + HEAP32[$buff + 12 >> 2] = HEAP32[$call7 + 204 >> 2]; + $retval$0 = _arDetectMarker(HEAP32[$call7 + 216 >> 2] | 0, $buff) | 0; + } + STACKTOP = sp; + return $retval$0 | 0; +} + +function __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $15 = 0, $16 = 0, $21 = 0, $24 = 0, $25 = 0, $3 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + if ($1 | 0) { + $5 = $0 + 11 | 0; + $6 = HEAP8[$5 >> 0] | 0; + if ($6 << 24 >> 24 < 0) { + $15 = HEAP32[$0 + 4 >> 2] | 0; + $16 = (HEAP32[$0 + 8 >> 2] & 2147483647) + -1 | 0; + } else { + $15 = $6 & 255; + $16 = 10; + } + if (($16 - $15 | 0) >>> 0 < $1 >>> 0) { + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm($0, $16, $15 + $1 - $16 | 0, $15, $15, 0, 0); + $21 = HEAP8[$5 >> 0] | 0; + } else $21 = $6; + if ($21 << 24 >> 24 < 0) $24 = HEAP32[$0 >> 2] | 0; else $24 = $0; + __ZNSt3__211char_traitsIcE6assignEPcmc($24 + $15 | 0, $1, $2) | 0; + $25 = $15 + $1 | 0; + if ((HEAP8[$5 >> 0] | 0) < 0) HEAP32[$0 + 4 >> 2] = $25; else HEAP8[$5 >> 0] = $25; + HEAP8[$3 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($24 + $25 | 0, $3); + } + STACKTOP = sp; + return $0 | 0; +} + +function __ZNSt3__26vectorIhNS_9allocatorIhEEE21__push_back_slow_pathIRKhEEvOT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $13 = 0, $14 = 0, $17 = 0, $2 = 0, $21 = 0, $3 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $3 = $0 + 4 | 0; + $7 = (HEAP32[$3 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) + 1 | 0; + $8 = __ZNKSt3__26vectorIhNS_9allocatorIhEEE8max_sizeEv($0) | 0; + if ($8 >>> 0 < $7 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $13 = HEAP32[$0 >> 2] | 0; + $14 = (HEAP32[$0 + 8 >> 2] | 0) - $13 | 0; + $17 = $14 << 1; + __ZNSt3__214__split_bufferIhRNS_9allocatorIhEEEC2EmmS3_($2, $14 >>> 0 < $8 >>> 1 >>> 0 ? ($17 >>> 0 < $7 >>> 0 ? $7 : $17) : $8, (HEAP32[$3 >> 2] | 0) - $13 | 0, $0 + 8 | 0); + $21 = $2 + 8 | 0; + HEAP8[HEAP32[$21 >> 2] >> 0] = HEAP8[$1 >> 0] | 0; + HEAP32[$21 >> 2] = (HEAP32[$21 >> 2] | 0) + 1; + __ZNSt3__26vectorIhNS_9allocatorIhEEE26__swap_out_circular_bufferERNS_14__split_bufferIhRS2_EE($0, $2); + __ZNSt3__214__split_bufferIhRNS_9allocatorIhEEED2Ev($2); + STACKTOP = sp; + return; + } +} + +function _setMarkerInfoDir($id, $markerIndex, $dir) { + $id = $id | 0; + $markerIndex = $markerIndex | 0; + $dir = $dir | 0; + var $1 = 0, $arhandle = 0, $id$addr = 0, $retval$1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + do if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0) { + $arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0; + $1 = HEAP32[$arhandle >> 2] | 0; + if ((HEAP32[$1 + 44 >> 2] | 0) > ($markerIndex | 0)) { + HEAP32[(($markerIndex | 0) < 0 ? 64312 : $1 + 48 + ($markerIndex << 8) | 0) + 16 >> 2] = $dir; + $retval$1 = 0; + break; + } else { + $retval$1 = HEAP32[4226] | 0; + break; + } + } else $retval$1 = HEAP32[4224] | 0; while (0); + STACKTOP = sp; + return $retval$1 | 0; +} + +function __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i = 0, $12 = 0, $14 = 0, $15 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $3 = 0, $5 = 0, $8 = 0, $9 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $$0$i = HEAP32[$3 >> 2] | 0; + while (1) { + if (($$0$i | 0) == ($2 | 0)) break; + $8 = (HEAP32[$5 >> 2] | 0) + -20 | 0; + $9 = $$0$i + -20 | 0; + HEAP32[$8 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$8 + 4 >> 2] = HEAP32[$9 + 4 >> 2]; + HEAP32[$8 + 8 >> 2] = HEAP32[$9 + 8 >> 2]; + HEAP32[$8 + 12 >> 2] = HEAP32[$9 + 12 >> 2]; + HEAP32[$8 + 16 >> 2] = HEAP32[$9 + 16 >> 2]; + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + -20; + $$0$i = $9; + } + $12 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$5 >> 2] = $12; + $14 = $1 + 8 | 0; + $15 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$14 >> 2]; + HEAP32[$14 >> 2] = $15; + $17 = $0 + 8 | 0; + $18 = $1 + 12 | 0; + $19 = HEAP32[$17 >> 2] | 0; + HEAP32[$17 >> 2] = HEAP32[$18 >> 2]; + HEAP32[$18 >> 2] = $19; + HEAP32[$1 >> 2] = HEAP32[$5 >> 2]; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E12parseAbiTagsEPNS0_4NodeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$2 = 0, $2 = 0, $3 = 0, $6 = 0, $7 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $3 = sp + 8 | 0; + HEAP32[$2 >> 2] = $1; + $7 = $1; + while (1) { + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 66) | 0)) { + $$2 = $7; + break; + } + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseBareSourceNameEv($3, $0); + if (__ZNK12_GLOBAL__N_110StringView5emptyEv($3) | 0) { + label = 5; + break; + } + $6 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10AbiTagAttrEJRPNS0_4NodeERNS_10StringViewEEEES9_DpOT0_($0, $2, $3) | 0; + HEAP32[$2 >> 2] = $6; + $7 = $6; + } + if ((label | 0) == 5) $$2 = 0; + STACKTOP = sp; + return $$2 | 0; +} + +function __ZN6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEEC2Ev($0) { + $0 = $0 | 0; + var $4 = 0, $7 = 0; + HEAP32[$0 + 12 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = 0; + HEAP32[$0 + 20 >> 2] = 0; + $4 = $0 + 64 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$4 + 4 >> 2] = 0; + HEAP32[$4 + 8 >> 2] = 0; + HEAP32[$4 + 12 >> 2] = 0; + HEAP32[$4 + 16 >> 2] = 0; + HEAP32[$4 + 20 >> 2] = 0; + HEAP32[$0 + 88 >> 2] = 1065353216; + __ZN6vision18BinomialPyramid32fC2Ev($0 + 92 | 0); + $7 = $0 + 160 | 0; + __ZN6vision25DoGScaleInvariantDetectorC2Ev($7); + __ZN6vision14FREAKExtractorC2Ev($0 + 316 | 0); + __ZN6vision20BinaryFeatureMatcherILi96EEC2Ev($0 + 636 | 0); + __ZN6vision21HoughSimilarityVotingC2Ev($0 + 652 | 0); + __ZN6vision16RobustHomographyIfEC2Efiii($0 + 788 | 0, .009999999776482582, 1024, 1064, 50); + __ZN6vision25DoGScaleInvariantDetector21setLaplacianThresholdEf($7, 3.0); + __ZN6vision25DoGScaleInvariantDetector16setEdgeThresholdEf($7, 4.0); + __ZN6vision25DoGScaleInvariantDetector22setMaxNumFeaturePointsEm($7, 500); + HEAPF32[$0 + 4 >> 2] = 3.0; + HEAP32[$0 >> 2] = 8; + HEAP8[$0 + 8 >> 0] = 1; + return; +} + +function __ZL14genBWImageHalfPhiiPiS0_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$041 = 0, $$042 = 0, $$043 = 0, $$044 = 0, $$1 = 0, $11 = 0, $5 = 0, $6 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $5 = ($1 | 0) / 2 | 0; + HEAP32[$3 >> 2] = $5; + $6 = ($2 | 0) / 2 | 0; + HEAP32[$4 >> 2] = $6; + $8 = _malloc(Math_imul($6, $5) | 0) | 0; + if (!$8) { + _arLog(0, 3, 45930, sp); + _exit(1); + } + $$0 = 0; + $$042 = $8; + while (1) { + if (($$0 | 0) >= ($6 | 0)) break; + $11 = $$0 << 1; + $$041 = 0; + $$043 = $0 + (Math_imul($11, $1) | 0) | 0; + $$044 = $0 + (Math_imul($11 | 1, $1) | 0) | 0; + $$1 = $$042; + while (1) { + if (($$041 | 0) >= ($5 | 0)) break; + HEAP8[$$1 >> 0] = ((HEAPU8[$$043 + 1 >> 0] | 0) + (HEAPU8[$$043 >> 0] | 0) + (HEAPU8[$$044 >> 0] | 0) + (HEAPU8[$$044 + 1 >> 0] | 0) | 0) >>> 2; + $$041 = $$041 + 1 | 0; + $$043 = $$043 + 2 | 0; + $$044 = $$044 + 2 | 0; + $$1 = $$1 + 1 | 0; + } + $$0 = $$0 + 1 | 0; + $$042 = $$1; + } + STACKTOP = sp; + return $8 | 0; +} + +function __ZN6vision5Image11shallowCopyERKS0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$pre$phi$iZ2D = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $24 = 0, $26 = 0, $30 = 0, $32 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + HEAP32[$0 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$0 + 4 >> 2] = HEAP32[$1 + 4 >> 2]; + HEAP32[$0 + 8 >> 2] = HEAP32[$1 + 8 >> 2]; + HEAP32[$0 + 12 >> 2] = HEAP32[$1 + 12 >> 2]; + HEAP32[$0 + 16 >> 2] = HEAP32[$1 + 16 >> 2]; + HEAP32[$0 + 20 >> 2] = HEAP32[$1 + 20 >> 2]; + $20 = $0 + 24 | 0; + $21 = HEAP32[$1 + 24 >> 2] | 0; + HEAP32[$2 >> 2] = $21; + $22 = $2 + 4 | 0; + $24 = HEAP32[$1 + 28 >> 2] | 0; + HEAP32[$22 >> 2] = $24; + if (!$24) { + $$pre$phi$iZ2D = $22; + $32 = 0; + } else { + $26 = $24 + 4 | 0; + HEAP32[$26 >> 2] = (HEAP32[$26 >> 2] | 0) + 1; + $$pre$phi$iZ2D = $22; + $32 = HEAP32[$22 >> 2] | 0; + } + HEAP32[$2 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$20 >> 2] = $21; + $30 = $0 + 28 | 0; + HEAP32[$$pre$phi$iZ2D >> 2] = HEAP32[$30 >> 2]; + HEAP32[$30 >> 2] = $32; + __ZNSt3__210shared_ptrIhED2Ev($2); + STACKTOP = sp; + return; +} + +function __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$sroa$speculated = 0, $14 = 0, $15 = 0, $20 = 0, $21 = 0, $23 = 0, $25 = 0, $31 = 0; + if ((-17 - $1 | 0) >>> 0 < $2 >>> 0) __ZNKSt3__221__basic_string_commonILb1EE20__throw_length_errorEv($0); + if ((HEAP8[$0 + 11 >> 0] | 0) < 0) $23 = HEAP32[$0 >> 2] | 0; else $23 = $0; + if ($1 >>> 0 < 2147483623) { + $14 = $2 + $1 | 0; + $15 = $1 << 1; + $$sroa$speculated = $14 >>> 0 < $15 >>> 0 ? $15 : $14; + $20 = $$sroa$speculated >>> 0 < 11 ? 11 : $$sroa$speculated + 16 & -16; + } else $20 = -17; + $21 = __Znwm($20) | 0; + if ($4 | 0) __ZNSt3__211char_traitsIcE4copyEPcPKcm($21, $23, $4) | 0; + $25 = $3 - $5 - $4 | 0; + if ($25 | 0) __ZNSt3__211char_traitsIcE4copyEPcPKcm($21 + $4 + $6 | 0, $23 + $4 + $5 | 0, $25) | 0; + $31 = $1 + 1 | 0; + if (($31 | 0) != 11) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($23, $31); + HEAP32[$0 >> 2] = $21; + HEAP32[$0 + 8 >> 2] = $20 | -2147483648; + return; +} + +function __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $14 = 0, $15 = 0, $20 = 0, $21 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + $4 = $0 + 11 | 0; + $5 = HEAP8[$4 >> 0] | 0; + $6 = $5 << 24 >> 24 < 0; + if ($6) { + $14 = HEAP32[$0 + 4 >> 2] | 0; + $15 = (HEAP32[$0 + 8 >> 2] & 2147483647) + -1 | 0; + } else { + $14 = $5 & 255; + $15 = 10; + } + if (($15 - $14 | 0) >>> 0 >= $2 >>> 0) { + if ($2 | 0) { + if ($6) $20 = HEAP32[$0 >> 2] | 0; else $20 = $0; + __ZNSt3__211char_traitsIcE4copyEPcPKcm($20 + $14 | 0, $1, $2) | 0; + $21 = $14 + $2 | 0; + if ((HEAP8[$4 >> 0] | 0) < 0) HEAP32[$0 + 4 >> 2] = $21; else HEAP8[$4 >> 0] = $21; + HEAP8[$3 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($20 + $21 | 0, $3); + } + } else __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc($0, $15, $14 + $2 - $15 | 0, $14, $14, 0, $2, $1); + STACKTOP = sp; + return $0 | 0; +} + +function _icpGetJ_U_S($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$024 = 0, $$025 = 0, $$026 = 0, $15 = 0.0, $16 = 0.0, $4 = 0, $5 = 0, $6 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 224 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(224); + $4 = sp + 48 | 0; + $5 = sp; + $6 = sp + 192 | 0; + _icpGetJ_Xc_S($4, $6, $2, $3); + L1 : do if ((_icpGetJ_U_Xc($5, $1, $6) | 0) < 0) { + _arLog(0, 3, 24733, sp + 216 | 0); + $$026 = -1; + } else { + $$024 = 0; + while (1) { + if (($$024 | 0) == 2) { + $$026 = 0; + break L1; + } + $$025 = 0; + while (1) { + if (($$025 | 0) == 6) break; + $9 = $0 + ($$024 * 48 | 0) + ($$025 << 3) | 0; + HEAPF64[$9 >> 3] = 0.0; + $$0 = 0; + $16 = 0.0; + while (1) { + if (($$0 | 0) == 3) break; + $15 = $16 + +HEAPF64[$5 + ($$024 * 24 | 0) + ($$0 << 3) >> 3] * +HEAPF64[$4 + ($$0 * 48 | 0) + ($$025 << 3) >> 3]; + HEAPF64[$9 >> 3] = $15; + $$0 = $$0 + 1 | 0; + $16 = $15; + } + $$025 = $$025 + 1 | 0; + } + $$024 = $$024 + 1 | 0; + } + } while (0); + STACKTOP = sp; + return $$026 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseBareSourceNameEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $12 = 0, $17 = 0, $18 = 0, $2 = 0, $3 = 0, $5 = 0, $6 = 0, $8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp + 8 | 0; + $3 = sp; + HEAP32[$2 >> 2] = 0; + if (!(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20parsePositiveIntegerEPm($1, $2) | 0) ? ($5 = __ZNK12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E7numLeftEv($1) | 0, $6 = HEAP32[$2 >> 2] | 0, $5 >>> 0 >= $6 >>> 0) : 0) { + $8 = HEAP32[$1 >> 2] | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKcS2_($3, $8, $8 + $6 | 0); + HEAP32[$1 >> 2] = (HEAP32[$1 >> 2] | 0) + $6; + $12 = $3; + $17 = HEAP32[$12 + 4 >> 2] | 0; + $18 = $0; + HEAP32[$18 >> 2] = HEAP32[$12 >> 2]; + HEAP32[$18 + 4 >> 2] = $17; + } else __ZN12_GLOBAL__N_110StringViewC2Ev($0); + STACKTOP = sp; + return; +} + +function __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $13 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + $4 = $0 + 8 | 0; + $5 = $4 + 3 | 0; + $6 = HEAP8[$5 >> 0] | 0; + $7 = $6 << 24 >> 24 < 0; + if ($7) $11 = (HEAP32[$4 >> 2] & 2147483647) + -1 | 0; else $11 = 1; + do if ($11 >>> 0 >= $2 >>> 0) { + if ($7) $13 = HEAP32[$0 >> 2] | 0; else $13 = $0; + __ZNSt3__211char_traitsIwE4moveEPwPKwm($13, $1, $2) | 0; + HEAP32[$3 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($13 + ($2 << 2) | 0, $3); + if ((HEAP8[$5 >> 0] | 0) < 0) { + HEAP32[$0 + 4 >> 2] = $2; + break; + } else { + HEAP8[$5 >> 0] = $2; + break; + } + } else { + if ($7) $23 = HEAP32[$0 + 4 >> 2] | 0; else $23 = $6 & 255; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw($0, $11, $2 - $11 | 0, $23, 0, $23, $2, $1); + } while (0); + STACKTOP = sp; + return $0 | 0; +} + +function __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initIPKwEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$1 = 0, $$1$ph = 0, $14 = 0, $17 = 0, $3 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + $7 = $2 - $1 >> 2; + if ($7 >>> 0 > 1073741807) __ZNKSt3__221__basic_string_commonILb1EE20__throw_length_errorEv($0); + do if ($7 >>> 0 >= 2) { + $14 = $7 + 4 & -4; + if ($14 >>> 0 > 1073741823) _abort(); else { + $17 = __Znwm($14 << 2) | 0; + HEAP32[$0 >> 2] = $17; + HEAP32[$0 + 8 >> 2] = $14 | -2147483648; + HEAP32[$0 + 4 >> 2] = $7; + $$1$ph = $17; + break; + } + } else { + HEAP8[$0 + 8 + 3 >> 0] = $7; + $$1$ph = $0; + } while (0); + $$0 = $1; + $$1 = $$1$ph; + while (1) { + if (($$0 | 0) == ($2 | 0)) break; + __ZNSt3__211char_traitsIwE6assignERwRKw($$1, $$0); + $$0 = $$0 + 4 | 0; + $$1 = $$1 + 4 | 0; + } + HEAP32[$3 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($$1, $3); + STACKTOP = sp; + return; +} + +function _pass2_no_dither($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$04751 = 0, $$04853 = 0, $$04950 = 0, $$052 = 0, $19 = 0, $23 = 0, $27 = 0, $30 = 0, $31 = 0, $34 = 0, $7 = 0, $9 = 0; + $7 = HEAP32[(HEAP32[$0 + 484 >> 2] | 0) + 24 >> 2] | 0; + $9 = HEAP32[$0 + 112 >> 2] | 0; + if (($3 | 0) < 1 | ($9 | 0) == 0) return; + $$04853 = 0; + do { + $$04751 = $9; + $$04950 = HEAP32[$2 + ($$04853 << 2) >> 2] | 0; + $$052 = HEAP32[$1 + ($$04853 << 2) >> 2] | 0; + while (1) { + $19 = (HEAPU8[$$052 >> 0] | 0) >>> 3; + $23 = (HEAPU8[$$052 + 1 >> 0] | 0) >>> 2; + $27 = (HEAPU8[$$052 + 2 >> 0] | 0) >>> 3; + $30 = (HEAP32[$7 + ($19 << 2) >> 2] | 0) + ($23 << 6) + ($27 << 1) | 0; + $31 = HEAP16[$30 >> 1] | 0; + if (!($31 << 16 >> 16)) { + _fill_inverse_cmap($0, $19, $23, $27); + $34 = HEAP16[$30 >> 1] | 0; + } else $34 = $31; + HEAP8[$$04950 >> 0] = ($34 & 65535) + 255; + $$04751 = $$04751 + -1 | 0; + if (!$$04751) break; else { + $$04950 = $$04950 + 1 | 0; + $$052 = $$052 + 3 | 0; + } + } + $$04853 = $$04853 + 1 | 0; + } while (($$04853 | 0) != ($3 | 0)); + return; +} + +function __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initIPwEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeES9_S9_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$1 = 0, $$1$ph = 0, $14 = 0, $17 = 0, $3 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + $7 = $2 - $1 >> 2; + if ($7 >>> 0 > 1073741807) __ZNKSt3__221__basic_string_commonILb1EE20__throw_length_errorEv($0); + do if ($7 >>> 0 >= 2) { + $14 = $7 + 4 & -4; + if ($14 >>> 0 > 1073741823) _abort(); else { + $17 = __Znwm($14 << 2) | 0; + HEAP32[$0 >> 2] = $17; + HEAP32[$0 + 8 >> 2] = $14 | -2147483648; + HEAP32[$0 + 4 >> 2] = $7; + $$1$ph = $17; + break; + } + } else { + HEAP8[$0 + 8 + 3 >> 0] = $7; + $$1$ph = $0; + } while (0); + $$0 = $1; + $$1 = $$1$ph; + while (1) { + if (($$0 | 0) == ($2 | 0)) break; + __ZNSt3__211char_traitsIwE6assignERwRKw($$1, $$0); + $$0 = $$0 + 4 | 0; + $$1 = $$1 + 4 | 0; + } + HEAP32[$3 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($$1, $3); + STACKTOP = sp; + return; +} + +function _ar2MarkerCoord2ScreenCoord($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = +$2; + $3 = +$3; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $37 = 0.0, $6 = 0, $60 = 0.0, $70 = 0.0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $6 = sp; + if (!$0) { + $60 = +HEAPF32[$1 + 28 >> 2] + (+HEAPF32[$1 + 16 >> 2] * $2 + +HEAPF32[$1 + 20 >> 2] * $3); + $70 = +HEAPF32[$1 + 44 >> 2] + (+HEAPF32[$1 + 32 >> 2] * $2 + +HEAPF32[$1 + 36 >> 2] * $3); + HEAPF32[$4 >> 2] = (+HEAPF32[$1 + 12 >> 2] + (+HEAPF32[$1 >> 2] * $2 + +HEAPF32[$1 + 4 >> 2] * $3)) / $70; + HEAPF32[$5 >> 2] = $60 / $70; + $$0 = 0; + } else { + _arUtilMatMuldff($0 + 8 | 0, $1, $6) | 0; + $37 = +HEAPF32[$6 + 44 >> 2] + (+HEAPF32[$6 + 32 >> 2] * $2 + +HEAPF32[$6 + 36 >> 2] * $3); + $$0 = (_arParamIdeal2ObservLTf($0 + 184 | 0, (+HEAPF32[$6 + 12 >> 2] + (+HEAPF32[$6 >> 2] * $2 + +HEAPF32[$6 + 4 >> 2] * $3)) / $37, (+HEAPF32[$6 + 28 >> 2] + (+HEAPF32[$6 + 16 >> 2] * $2 + +HEAPF32[$6 + 20 >> 2] * $3)) / $37, $4, $5) | 0) >> 31; + } + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle15PixelVectorType9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy2 = 0, $2 = 0, $3 = 0, $4 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy2 = sp + 24 | 0; + $2 = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 56031); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + __ZNK12_GLOBAL__N_116itanium_demangle12NodeOrString8asStringEv($3, $0 + 8 | 0); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 51614); + HEAP32[$$byval_copy2 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy2 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy2); + STACKTOP = sp; + return; +} + +function __ZN6vision21OrientationAssignment5allocEmmiiiffif($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = +$6; + $7 = +$7; + $8 = $8 | 0; + $9 = +$9; + var $$0 = 0, $$024 = 0, $10 = 0, $17 = 0, $21 = 0, $22 = 0, $23 = 0; + HEAP32[$0 >> 2] = $3; + $10 = $0 + 4 | 0; + HEAP32[$10 >> 2] = $4; + HEAP32[$0 + 8 >> 2] = $5; + HEAPF32[$0 + 12 >> 2] = $6; + HEAPF32[$0 + 16 >> 2] = $7; + HEAP32[$0 + 20 >> 2] = $8; + HEAPF32[$0 + 24 >> 2] = $9; + __ZNSt3__26vectorIfNS_9allocatorIfEEE6resizeEm($0 + 28 | 0, $5); + $17 = $0 + 40 | 0; + __ZNSt3__26vectorIN6vision5ImageENS_9allocatorIS2_EEE6resizeEm($17, Math_imul(HEAP32[$10 >> 2] | 0, HEAP32[$0 >> 2] | 0) | 0); + $$024 = 0; + while (1) { + if (($$024 | 0) == ($3 | 0)) break; + $21 = Math_imul($$024, $4) | 0; + $22 = $1 >>> $$024; + $23 = $2 >>> $$024; + $$0 = 0; + while (1) { + if (($$0 | 0) == ($4 | 0)) break; + __ZN6vision5Image5allocENS_9ImageTypeEmmim((HEAP32[$17 >> 2] | 0) + ($$0 + $21 << 5) | 0, 2, $22, $23, -1, 2); + $$0 = $$0 + 1 | 0; + } + $$024 = $$024 + 1 | 0; + } + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EEC2EOS4_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $12 = 0, $3 = 0, $7 = 0; + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EEC2Ev($0); + if (__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE8isInlineEv($1) | 0) { + $3 = __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE5beginEv($1) | 0; + $7 = (__ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE3endEv($1) | 0) - $3 | 0; + if ($7 | 0) _memmove(HEAP32[$0 >> 2] | 0, $3 | 0, $7 | 0) | 0; + $10 = HEAP32[$0 >> 2] | 0; + $12 = $10 + ((__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE4sizeEv($1) | 0) << 2) | 0; + HEAP32[$0 + 4 >> 2] = $12; + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE5clearEv($1); + } else { + HEAP32[$0 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$0 + 4 >> 2] = HEAP32[$1 + 4 >> 2]; + HEAP32[$0 + 8 >> 2] = HEAP32[$1 + 8 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE11clearInlineEv($1); + } + return; +} + +function __ZN6vision5ImageC2EPhNS_9ImageTypeEmmim($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $$sink = 0, $13 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 8 | 0; + $$byval_copy = sp + 4 | 0; + $8 = sp; + HEAP32[$0 >> 2] = $2; + HEAP32[$0 + 4 >> 2] = $3; + HEAP32[$0 + 8 >> 2] = $4; + HEAP32[$0 + 16 >> 2] = $6; + $13 = Math_imul($5, $4) | 0; + HEAP32[$0 + 20 >> 2] = $13; + HEAP32[$8 >> 2] = 0; + HEAP8[$$byval_copy >> 0] = HEAP8[sp + 12 >> 0] | 0; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$8 >> 2]; + __ZNSt3__210shared_ptrIhEC2Ih16NullArrayDeleterIhEEEPT_T0_NS_9enable_ifIXsr14is_convertibleIS6_PhEE5valueENS1_5__natEE4typeE($0 + 24 | 0, $1, $$byval_copy, $$byval_copy1); + if (($5 | 0) < 0) $$sink = Math_imul(Math_imul($6, $3) | 0, __ZN6vision5Image19calculate_unit_sizeENS_9ImageTypeE($2) | 0) | 0; else $$sink = $5; + HEAP32[$0 + 12 >> 2] = $$sink; + STACKTOP = sp; + return; +} + +function _jpeg_idct_2x2($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $13 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $28 = 0, $34 = 0, $35 = 0, $36 = 0, $38 = 0, $52 = 0, $7 = 0, $9 = 0; + $7 = (HEAP32[$0 + 336 >> 2] | 0) + -384 | 0; + $9 = HEAP32[$1 + 84 >> 2] | 0; + $13 = Math_imul(HEAP32[$9 >> 2] | 0, HEAP16[$2 >> 1] | 0) | 0; + $19 = Math_imul(HEAP32[$9 + 32 >> 2] | 0, HEAP16[$2 + 16 >> 1] | 0) | 0; + $20 = $13 + 4100 | 0; + $21 = $19 + $20 | 0; + $22 = $20 - $19 | 0; + $28 = Math_imul(HEAP32[$9 + 4 >> 2] | 0, HEAP16[$2 + 2 >> 1] | 0) | 0; + $34 = Math_imul(HEAP32[$9 + 36 >> 2] | 0, HEAP16[$2 + 18 >> 1] | 0) | 0; + $35 = $34 + $28 | 0; + $36 = $28 - $34 | 0; + $38 = (HEAP32[$3 >> 2] | 0) + $4 | 0; + HEAP8[$38 >> 0] = HEAP8[$7 + (($35 + $21 | 0) >>> 3 & 1023) >> 0] | 0; + HEAP8[$38 + 1 >> 0] = HEAP8[$7 + (($21 - $35 | 0) >>> 3 & 1023) >> 0] | 0; + $52 = (HEAP32[$3 + 4 >> 2] | 0) + $4 | 0; + HEAP8[$52 >> 0] = HEAP8[$7 + (($36 + $22 | 0) >>> 3 & 1023) >> 0] | 0; + HEAP8[$52 + 1 >> 0] = HEAP8[$7 + (($22 - $36 | 0) >>> 3 & 1023) >> 0] | 0; + return; +} + +function __ZN6vision27OrthogonalizePivot8x9Basis6IfEEbPT_S2_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $11 = 0, $12 = 0, $15 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = 0.0, $9 = 0.0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $3 = $0 + 216 | 0; + $4 = $0 + 180 | 0; + $5 = $1 + 216 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($3, $4, $5); + $6 = $0 + 252 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($6, $4, $1 + 252 | 0); + $8 = +__ZN6vision11SumSquares9IfEET_PKS1_($3); + HEAPF32[$2 >> 2] = $8; + $9 = +__ZN6vision11SumSquares9IfEET_PKS1_($6); + HEAPF32[$2 + 4 >> 2] = $9; + $11 = __ZN6vision9MaxIndex2IfEEiPKT_($2) | 0; + $12 = $2 + ($11 << 2) | 0; + if (+HEAPF32[$12 >> 2] == 0.0) $$0 = 0; else { + $15 = $11 * 9 | 0; + __ZN6vision5Swap9IfEEvPT_S2_($3, $3 + ($15 << 2) | 0); + __ZN6vision5Swap9IfEEvPT_S2_($5, $5 + ($15 << 2) | 0); + __ZN6vision12ScaleVector9IfEEvPT_PKS1_S1_($3, $3, 1.0 / +Math_sqrt(+(+HEAPF32[$12 >> 2]))); + $$0 = 1; + } + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN6vision11ScopedTimerD2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $13 = 0.0, $14 = 0, $2 = 0, $7 = 0, $8 = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $vararg_buffer = sp; + $1 = sp + 24 | 0; + __ZN6vision5Timer4stopEv($0); + $2 = __ZN6vision6Logger11getInstanceEv() | 0; + __ZN6vision15get_pretty_timeEv($1); + $7 = (HEAP8[$1 + 11 >> 0] | 0) < 0 ? HEAP32[$1 >> 2] | 0 : $1; + $8 = $0 + 16 | 0; + if ((HEAP8[$8 + 11 >> 0] | 0) < 0) $14 = HEAP32[$8 >> 2] | 0; else $14 = $8; + $13 = +__ZNK6vision5Timer24duration_in_millisecondsEv($0); + HEAP32[$vararg_buffer >> 2] = 39201; + HEAP32[$vararg_buffer + 4 >> 2] = $7; + HEAP32[$vararg_buffer + 8 >> 2] = 39209; + HEAP32[$vararg_buffer + 12 >> 2] = $14; + HEAPF64[$vararg_buffer + 16 >> 3] = $13; + __ZN6vision6Logger5writeENS_19LoggerPriorityLevelEPKcz($2, 8, 39174, $vararg_buffer); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($1); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($8); + STACKTOP = sp; + return; +} + +function __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $13 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + $4 = $0 + 11 | 0; + $5 = HEAP8[$4 >> 0] | 0; + $6 = $5 << 24 >> 24 < 0; + if ($6) $11 = (HEAP32[$0 + 8 >> 2] & 2147483647) + -1 | 0; else $11 = 10; + do if ($11 >>> 0 >= $2 >>> 0) { + if ($6) $13 = HEAP32[$0 >> 2] | 0; else $13 = $0; + __ZNSt3__211char_traitsIcE4moveEPcPKcm($13, $1, $2) | 0; + HEAP8[$3 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($13 + $2 | 0, $3); + if ((HEAP8[$4 >> 0] | 0) < 0) { + HEAP32[$0 + 4 >> 2] = $2; + break; + } else { + HEAP8[$4 >> 0] = $2; + break; + } + } else { + if ($6) $23 = HEAP32[$0 + 4 >> 2] | 0; else $23 = $5 & 255; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc($0, $11, $2 - $11 | 0, $23, 0, $23, $2, $1); + } while (0); + STACKTOP = sp; + return $0 | 0; +} + +function __ZNSt3__26vectorIiNS_9allocatorIiEEE26__swap_out_circular_bufferERNS_14__split_bufferIiRS2_EEPi($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $13 = 0, $15 = 0, $16 = 0, $22 = 0, $24 = 0, $26 = 0, $27 = 0, $28 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = 0; + $3 = $1 + 4 | 0; + $4 = HEAP32[$3 >> 2] | 0; + $5 = HEAP32[$0 >> 2] | 0; + $6 = $2; + $8 = $6 - $5 | 0; + $11 = $4 + (0 - ($8 >> 2) << 2) | 0; + HEAP32[$3 >> 2] = $11; + if (($8 | 0) > 0) _memcpy($11 | 0, $5 | 0, $8 | 0) | 0; + $13 = $0 + 4 | 0; + $15 = $1 + 8 | 0; + $16 = (HEAP32[$13 >> 2] | 0) - $6 | 0; + if (($16 | 0) > 0) { + _memcpy(HEAP32[$15 >> 2] | 0, $2 | 0, $16 | 0) | 0; + HEAP32[$15 >> 2] = (HEAP32[$15 >> 2] | 0) + ($16 >>> 2 << 2); + } + $22 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$3 >> 2] = $22; + $24 = HEAP32[$13 >> 2] | 0; + HEAP32[$13 >> 2] = HEAP32[$15 >> 2]; + HEAP32[$15 >> 2] = $24; + $26 = $0 + 8 | 0; + $27 = $1 + 12 | 0; + $28 = HEAP32[$26 >> 2] | 0; + HEAP32[$26 >> 2] = HEAP32[$27 >> 2]; + HEAP32[$27 >> 2] = $28; + HEAP32[$1 >> 2] = HEAP32[$3 >> 2]; + return $4 | 0; +} + +function _kpmChangePageNoOfRefDataSet($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$028 = 0, $$029 = 0, $10 = 0, $12 = 0, $13 = 0, $19 = 0, $20 = 0, $5 = 0, $6 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + L1 : do if (!$0) { + _arLog(0, 3, 26474, sp); + $$029 = -1; + } else { + $5 = HEAP32[$0 + 4 >> 2] | 0; + $6 = ($1 | 0) == -1; + $$028 = 0; + while (1) { + if (($$028 | 0) >= ($5 | 0)) break; + $12 = (HEAP32[$0 >> 2] | 0) + ($$028 * 132 | 0) + 124 | 0; + $13 = HEAP32[$12 >> 2] | 0; + if (($13 | 0) == ($1 | 0) | $6 & ($13 | 0) > -1) HEAP32[$12 >> 2] = $2; + $$028 = $$028 + 1 | 0; + } + $9 = HEAP32[$0 + 12 >> 2] | 0; + $10 = $0 + 8 | 0; + $$0 = 0; + while (1) { + if (($$0 | 0) >= ($9 | 0)) { + $$029 = 0; + break L1; + } + $19 = (HEAP32[$10 >> 2] | 0) + ($$0 * 12 | 0) + 8 | 0; + $20 = HEAP32[$19 >> 2] | 0; + if (($20 | 0) == ($1 | 0) | $6 & ($20 | 0) > -1) HEAP32[$19 >> 2] = $2; + $$0 = $$0 + 1 | 0; + } + } while (0); + STACKTOP = sp; + return $$029 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10VectorTypeEJRPNS2_4NodeERNS_10StringViewEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $12 = 0, $13 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp; + $5 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $6 = HEAP32[$1 >> 2] | 0; + $7 = $2; + $12 = HEAP32[$7 + 4 >> 2] | 0; + $13 = $4; + HEAP32[$13 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$13 + 4 >> 2] = $12; + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle12NodeOrStringC2ENS_10StringViewE($3, $$byval_copy); + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle10VectorTypeC2EPKNS0_4NodeENS0_12NodeOrStringE($5, $6, $$byval_copy); + STACKTOP = sp; + return $5 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10VectorTypeEJRPNS2_4NodeENS_10StringViewEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $12 = 0, $13 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp + 16 | 0; + $3 = sp + 8 | 0; + $4 = sp; + $5 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $6 = HEAP32[$1 >> 2] | 0; + $7 = $2; + $12 = HEAP32[$7 + 4 >> 2] | 0; + $13 = $4; + HEAP32[$13 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$13 + 4 >> 2] = $12; + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle12NodeOrStringC2ENS_10StringViewE($3, $$byval_copy); + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle10VectorTypeC2EPKNS0_4NodeENS0_12NodeOrStringE($5, $6, $$byval_copy); + STACKTOP = sp; + return $5 | 0; +} + +function _alloc_large($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $11 = 0, $16 = 0, $21 = 0, $22 = 0, $24 = 0, $29 = 0, $32 = 0, $4 = 0, $6 = 0; + $4 = HEAP32[$0 + 4 >> 2] | 0; + if ($2 >>> 0 > 999999984) { + $6 = HEAP32[$0 >> 2] | 0; + HEAP32[$6 + 20 >> 2] = 56; + HEAP32[$6 + 24 >> 2] = 3; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $11 = $2 & 7; + $$0 = (($11 | 0) == 0 ? 0 : 8 - $11 | 0) + $2 | 0; + if ($1 >>> 0 > 1) { + $16 = HEAP32[$0 >> 2] | 0; + HEAP32[$16 + 20 >> 2] = 15; + HEAP32[$16 + 24 >> 2] = $1; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $21 = $$0 + 16 | 0; + $22 = _jpeg_get_large($0, $21) | 0; + if (!$22) { + $24 = HEAP32[$0 >> 2] | 0; + HEAP32[$24 + 20 >> 2] = 56; + HEAP32[$24 + 24 >> 2] = 4; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $29 = $4 + 76 | 0; + HEAP32[$29 >> 2] = (HEAP32[$29 >> 2] | 0) + $21; + $32 = $4 + 60 + ($1 << 2) | 0; + HEAP32[$22 >> 2] = HEAP32[$32 >> 2]; + HEAP32[$22 + 4 >> 2] = $$0; + HEAP32[$22 + 8 >> 2] = 0; + HEAP32[$32 >> 2] = $22; + return $22 + 16 | 0; +} + +function __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initIPKcEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$021 = 0, $$1 = 0, $12 = 0, $13 = 0, $18 = 0, $3 = 0, $4 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = $1; + $4 = sp; + $6 = $2 - $3 | 0; + if ($6 >>> 0 > 4294967279) __ZNKSt3__221__basic_string_commonILb1EE20__throw_length_errorEv($0); + if ($6 >>> 0 < 11) { + HEAP8[$0 + 11 >> 0] = $6; + $$021 = $0; + } else { + $12 = $6 + 16 & -16; + $13 = __Znwm($12) | 0; + HEAP32[$0 >> 2] = $13; + HEAP32[$0 + 8 >> 2] = $12 | -2147483648; + HEAP32[$0 + 4 >> 2] = $6; + $$021 = $13; + } + $18 = $2 - $3 | 0; + $$0 = $1; + $$1 = $$021; + while (1) { + if (($$0 | 0) == ($2 | 0)) break; + __ZNSt3__211char_traitsIcE6assignERcRKc($$1, $$0); + $$0 = $$0 + 1 | 0; + $$1 = $$1 + 1 | 0; + } + HEAP8[$4 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($$021 + $18 | 0, $4); + STACKTOP = sp; + return; +} + +function __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initIPcEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeES9_S9_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$021 = 0, $$1 = 0, $12 = 0, $13 = 0, $18 = 0, $3 = 0, $4 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = $1; + $4 = sp; + $6 = $2 - $3 | 0; + if ($6 >>> 0 > 4294967279) __ZNKSt3__221__basic_string_commonILb1EE20__throw_length_errorEv($0); + if ($6 >>> 0 < 11) { + HEAP8[$0 + 11 >> 0] = $6; + $$021 = $0; + } else { + $12 = $6 + 16 & -16; + $13 = __Znwm($12) | 0; + HEAP32[$0 >> 2] = $13; + HEAP32[$0 + 8 >> 2] = $12 | -2147483648; + HEAP32[$0 + 4 >> 2] = $6; + $$021 = $13; + } + $18 = $2 - $3 | 0; + $$0 = $1; + $$1 = $$021; + while (1) { + if (($$0 | 0) == ($2 | 0)) break; + __ZNSt3__211char_traitsIcE6assignERcRKc($$1, $$0); + $$0 = $$0 + 1 | 0; + $$1 = $$1 + 1 | 0; + } + HEAP8[$4 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($$021 + $18 | 0, $4); + STACKTOP = sp; + return; +} + +function __ZN6vision16Quadratic3PointsIfEEbRT_S2_S2_PKS1_S4_S4_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $10 = 0.0, $11 = 0.0, $12 = 0.0, $13 = 0.0, $17 = 0.0, $21 = 0, $22 = 0.0, $25 = 0, $29 = 0.0, $36 = 0.0, $6 = 0.0, $7 = 0.0, $9 = 0.0, $storemerge = 0.0; + $6 = +HEAPF32[$5 >> 2]; + $7 = +HEAPF32[$4 >> 2]; + $9 = +HEAPF32[$3 >> 2]; + $10 = $6 - $9; + $11 = ($6 - $7) * $10; + $12 = $9 - $7; + $13 = $12 * $10; + if ($12 == 0.0 | ($11 == 0.0 | $13 == 0.0)) { + HEAPF32[$0 >> 2] = 0.0; + HEAPF32[$1 >> 2] = 0.0; + $$0 = 0; + $storemerge = 0.0; + } else { + $17 = $9 * $9; + $21 = $4 + 4 | 0; + $22 = +HEAPF32[$21 >> 2]; + $25 = $3 + 4 | 0; + $29 = (+HEAPF32[$5 + 4 >> 2] - $22) / $11 - (+HEAPF32[$25 >> 2] - $22) / $13; + HEAPF32[$0 >> 2] = $29; + $36 = (+HEAPF32[$25 >> 2] - +HEAPF32[$21 >> 2] + ($7 * $7 - $17) * $29) / $12; + HEAPF32[$1 >> 2] = $36; + $$0 = 1; + $storemerge = +HEAPF32[$25 >> 2] - $17 * +HEAPF32[$0 >> 2] - $36 * +HEAPF32[$3 >> 2]; + } + HEAPF32[$2 >> 2] = $storemerge; + return $$0 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle17VendorExtQualType9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $12 = 0, $13 = 0, $2 = 0, $3 = 0, $7 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $tmpcast$byval_copy = sp + 16 | 0; + $2 = sp + 8 | 0; + $3 = sp; + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51966); + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast$byval_copy); + $7 = $0 + 12 | 0; + $12 = HEAP32[$7 + 4 >> 2] | 0; + $13 = $3; + HEAP32[$13 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$13 + 4 >> 2] = $12; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast$byval_copy); + STACKTOP = sp; + return; +} + +function __ZL15loadMultiMarkerPKcP8ARHandlePP12ARPattHandlePP18ARMultiMarkerInfoT($patt_name, $arHandle, $pattHandle_p, $arMultiConfig) { + $patt_name = $patt_name | 0; + $arHandle = $arHandle | 0; + $pattHandle_p = $pattHandle_p | 0; + $arMultiConfig = $arMultiConfig | 0; + var $call = 0, $retval$0 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $call = _arMultiReadConfigFile($patt_name, HEAP32[$pattHandle_p >> 2] | 0) | 0; + HEAP32[$arMultiConfig >> 2] = $call; + L1 : do if (!$call) { + _arLog(0, 3, 45278, sp); + _arPattDeleteHandle(HEAP32[$pattHandle_p >> 2] | 0) | 0; + $retval$0 = 0; + } else switch (HEAP32[$call + 108 >> 2] | 0) { + case 0: + { + _arSetPatternDetectionMode($arHandle, 0) | 0; + $retval$0 = 1; + break L1; + break; + } + case 1: + { + _arSetPatternDetectionMode($arHandle, 2) | 0; + $retval$0 = 1; + break L1; + break; + } + default: + { + _arSetPatternDetectionMode($arHandle, 3) | 0; + $retval$0 = 1; + break L1; + } + } while (0); + STACKTOP = sp; + return $retval$0 | 0; +} + +function _jinit_d_post_controller($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $13 = 0, $14 = 0, $16 = 0, $18 = 0, $2 = 0, $23 = 0, $26 = 0, $28 = 0, $35 = 0, $36 = 0, $5 = 0, $7 = 0, $8 = 0; + $2 = $0 + 4 | 0; + $5 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$2 >> 2] >> 2] & 63]($0, 1, 28) | 0; + HEAP32[$0 + 456 >> 2] = $5; + HEAP32[$5 >> 2] = 135; + $7 = $5 + 8 | 0; + HEAP32[$7 >> 2] = 0; + $8 = $5 + 12 | 0; + HEAP32[$8 >> 2] = 0; + if (!(HEAP32[$0 + 84 >> 2] | 0)) return; + $13 = HEAP32[$0 + 320 >> 2] | 0; + $14 = $5 + 16 | 0; + HEAP32[$14 >> 2] = $13; + $16 = HEAP32[$2 >> 2] | 0; + if (!$1) { + $35 = Math_imul(HEAP32[$0 + 120 >> 2] | 0, HEAP32[$0 + 112 >> 2] | 0) | 0; + $36 = FUNCTION_TABLE_iiiii[HEAP32[$16 + 8 >> 2] & 15]($0, 1, $35, $13) | 0; + HEAP32[$8 >> 2] = $36; + return; + } else { + $18 = HEAP32[$16 + 16 >> 2] | 0; + $23 = Math_imul(HEAP32[$0 + 120 >> 2] | 0, HEAP32[$0 + 112 >> 2] | 0) | 0; + $26 = _jround_up(HEAP32[$0 + 116 >> 2] | 0, $13) | 0; + $28 = FUNCTION_TABLE_iiiiiii[$18 & 63]($0, 1, 0, $23, $26, HEAP32[$14 >> 2] | 0) | 0; + HEAP32[$7 >> 2] = $28; + return; + } +} + +function _setDebugMode($id, $enable) { + $id = $id | 0; + $enable = $enable | 0; + var $arhandle = 0, $id$addr = 0, $retval$0 = 0, $tobool = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $id$addr = sp + 4 | 0; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$0 = 0; else { + $arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0; + $tobool = ($enable | 0) != 0; + _arSetDebugMode(HEAP32[$arhandle >> 2] | 0, $tobool & 1) | 0; + HEAP32[$vararg_buffer >> 2] = $tobool ? 41742 : 41746; + _arLog(0, 1, 41751, $vararg_buffer); + $retval$0 = $enable; + } + STACKTOP = sp; + return $retval$0 | 0; +} + +function __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$phi$trans$insert = 0, $$pre = 0, $$pre$phi9Z2D = 0, $$pre$phiZ2D = 0, $$pre7 = 0, $13 = 0, $15 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, label = 0; + $3 = $1 + 15 & -16; + $4 = $0 + 4096 | 0; + $5 = HEAP32[$4 >> 2] | 0; + $6 = $5 + 4 | 0; + $7 = HEAP32[$6 >> 2] | 0; + $8 = $7 + $3 | 0; + do if ($8 >>> 0 > 4087) if ($3 >>> 0 > 4088) { + $$0 = __ZN12_GLOBAL__N_120BumpPointerAllocator15allocateMassiveEm($0, $3) | 0; + break; + } else { + __ZN12_GLOBAL__N_120BumpPointerAllocator4growEv($0); + $$pre = HEAP32[$4 >> 2] | 0; + $$phi$trans$insert = $$pre + 4 | 0; + $$pre7 = HEAP32[$$phi$trans$insert >> 2] | 0; + $$pre$phi9Z2D = $$pre7 + $3 | 0; + $$pre$phiZ2D = $$phi$trans$insert; + $13 = $$pre; + $15 = $$pre7; + label = 5; + break; + } else { + $$pre$phi9Z2D = $8; + $$pre$phiZ2D = $6; + $13 = $5; + $15 = $7; + label = 5; + } while (0); + if ((label | 0) == 5) { + HEAP32[$$pre$phiZ2D >> 2] = $$pre$phi9Z2D; + $$0 = $13 + 8 + $15 | 0; + } + return $$0 | 0; +} + +function __ZN6vision18BinomialPyramid32f5allocEmmi($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$022 = 0, $10 = 0, $13 = 0, $14 = 0, $15 = 0, $19 = 0, $4 = 0, $5 = 0; + __ZN6vision25GaussianScaleSpacePyramid9configureEii($0, $3, 3); + $4 = $0 + 4 | 0; + $5 = $0 + 20 | 0; + __ZNSt3__26vectorIN6vision5ImageENS_9allocatorIS2_EEE6resizeEm($4, Math_imul(HEAP32[$5 >> 2] | 0, $3) | 0); + $$022 = 0; + while (1) { + if (($$022 | 0) >= ($3 | 0)) break; + $13 = $1 >>> $$022; + $14 = $2 >>> $$022; + $$0 = 0; + while (1) { + $15 = HEAP32[$5 >> 2] | 0; + if ($$0 >>> 0 >= $15 >>> 0) break; + $19 = (Math_imul($15, $$022) | 0) + $$0 | 0; + __ZN6vision5Image5allocENS_9ImageTypeEmmim((HEAP32[$4 >> 2] | 0) + ($19 << 5) | 0, 2, $13, $14, -1, 1); + $$0 = $$0 + 1 | 0; + } + $$022 = $$022 + 1 | 0; + } + $10 = Math_imul($2, $1) | 0; + __ZNSt3__26vectorItNS_9allocatorItEEE6resizeEm($0 + 32 | 0, $10); + __ZNSt3__26vectorIfNS_9allocatorIfEEE6resizeEm($0 + 44 | 0, $10); + __ZNSt3__26vectorIfNS_9allocatorIfEEE6resizeEm($0 + 56 | 0, $10); + return; +} + +function __ZNSt3__26vectorIN6vision17PriorityQueueItemILi96EEENS_9allocatorIS3_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS5_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i = 0, $10 = 0, $15 = 0, $16 = 0, $2 = 0, $22 = 0, $24 = 0, $25 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $5 = 0, $9 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $$0$i = HEAP32[$3 >> 2] | 0; + while (1) { + if (($$0$i | 0) == ($2 | 0)) break; + $9 = $$0$i + -8 | 0; + $10 = $9; + $15 = HEAP32[$10 + 4 >> 2] | 0; + $16 = (HEAP32[$5 >> 2] | 0) + -8 | 0; + HEAP32[$16 >> 2] = HEAP32[$10 >> 2]; + HEAP32[$16 + 4 >> 2] = $15; + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + -8; + $$0$i = $9; + } + $22 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$5 >> 2] = $22; + $24 = $1 + 8 | 0; + $25 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$24 >> 2]; + HEAP32[$24 >> 2] = $25; + $27 = $0 + 8 | 0; + $28 = $1 + 12 | 0; + $29 = HEAP32[$27 >> 2] | 0; + HEAP32[$27 >> 2] = HEAP32[$28 >> 2]; + HEAP32[$28 >> 2] = $29; + HEAP32[$1 >> 2] = HEAP32[$5 >> 2]; + return; +} + +function _arUtilMatInvf($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$030 = 0, $$1 = 0, $$131 = 0, $12 = 0, $13 = 0, $15 = 0, $2 = 0, $3 = 0; + $2 = _arMatrixAlloc(4, 4) | 0; + $$0 = 0; + while (1) { + if (($$0 | 0) == 3) break; + $3 = $$0 << 2; + $$030 = 0; + while (1) { + if (($$030 | 0) == 4) break; + HEAPF64[(HEAP32[$2 >> 2] | 0) + ($$030 + $3 << 3) >> 3] = +HEAPF32[$0 + ($$0 << 4) + ($$030 << 2) >> 2]; + $$030 = $$030 + 1 | 0; + } + $$0 = $$0 + 1 | 0; + } + $12 = HEAP32[$2 >> 2] | 0; + $13 = $12 + 96 | 0; + HEAP32[$13 >> 2] = 0; + HEAP32[$13 + 4 >> 2] = 0; + HEAP32[$13 + 8 >> 2] = 0; + HEAP32[$13 + 12 >> 2] = 0; + HEAP32[$13 + 16 >> 2] = 0; + HEAP32[$13 + 20 >> 2] = 0; + HEAPF64[$12 + 120 >> 3] = 1.0; + _arMatrixSelfInv($2) | 0; + $$1 = 0; + while (1) { + if (($$1 | 0) == 3) break; + $15 = $$1 << 2; + $$131 = 0; + while (1) { + if (($$131 | 0) == 4) break; + HEAPF32[$1 + ($$1 << 4) + ($$131 << 2) >> 2] = +HEAPF64[(HEAP32[$2 >> 2] | 0) + ($$131 + $15 << 3) >> 3]; + $$131 = $$131 + 1 | 0; + } + $$1 = $$1 + 1 | 0; + } + _arMatrixFree($2) | 0; + return 0; +} + +function _arUtilMatInv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$030 = 0, $$1 = 0, $$131 = 0, $11 = 0, $12 = 0, $14 = 0, $2 = 0, $3 = 0; + $2 = _arMatrixAlloc(4, 4) | 0; + $$0 = 0; + while (1) { + if (($$0 | 0) == 3) break; + $3 = $$0 << 2; + $$030 = 0; + while (1) { + if (($$030 | 0) == 4) break; + HEAPF64[(HEAP32[$2 >> 2] | 0) + ($$030 + $3 << 3) >> 3] = +HEAPF64[$0 + ($$0 << 5) + ($$030 << 3) >> 3]; + $$030 = $$030 + 1 | 0; + } + $$0 = $$0 + 1 | 0; + } + $11 = HEAP32[$2 >> 2] | 0; + $12 = $11 + 96 | 0; + HEAP32[$12 >> 2] = 0; + HEAP32[$12 + 4 >> 2] = 0; + HEAP32[$12 + 8 >> 2] = 0; + HEAP32[$12 + 12 >> 2] = 0; + HEAP32[$12 + 16 >> 2] = 0; + HEAP32[$12 + 20 >> 2] = 0; + HEAPF64[$11 + 120 >> 3] = 1.0; + _arMatrixSelfInv($2) | 0; + $$1 = 0; + while (1) { + if (($$1 | 0) == 3) break; + $14 = $$1 << 2; + $$131 = 0; + while (1) { + if (($$131 | 0) == 4) break; + HEAPF64[$1 + ($$1 << 5) + ($$131 << 3) >> 3] = +HEAPF64[(HEAP32[$2 >> 2] | 0) + ($$131 + $14 << 3) >> 3]; + $$131 = $$131 + 1 | 0; + } + $$1 = $$1 + 1 | 0; + } + _arMatrixFree($2) | 0; + return 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle19SizeofParamPackExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy1 = 0, $2 = 0, $3 = 0, $4 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy1 = sp + 32 | 0; + $2 = sp + 24 | 0; + $3 = sp + 8 | 0; + $4 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 53002); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + __ZN12_GLOBAL__N_116itanium_demangle22ParameterPackExpansionC2EPKNS0_4NodeE($3, HEAP32[$0 + 8 >> 2] | 0); + __ZNK12_GLOBAL__N_116itanium_demangle22ParameterPackExpansion9printLeftERNS_12OutputStreamE($3, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, 51964); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + STACKTOP = sp; + return; +} + +function __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$023 = 0, $$1 = 0, $$pn = 0, $12 = 0, $13 = 0, $15 = 0, $22 = 0, $24 = 0, $3 = 0, $4 = 0, $6 = 0, $7 = 0; + __ZNSt3__211char_traitsIwE3eofEv() | 0; + $3 = $0 + 12 | 0; + $4 = $0 + 16 | 0; + $$0 = $1; + $$023 = 0; + while (1) { + if (($$023 | 0) >= ($2 | 0)) break; + $6 = HEAP32[$3 >> 2] | 0; + $7 = HEAP32[$4 >> 2] | 0; + if ($6 >>> 0 < $7 >>> 0) { + $12 = $7 - $6 >> 2; + $13 = $2 - $$023 | 0; + $15 = ($13 | 0) < ($12 | 0) ? $13 : $12; + __ZNSt3__211char_traitsIwE4copyEPwPKwm($$0, $6, $15) | 0; + HEAP32[$3 >> 2] = (HEAP32[$3 >> 2] | 0) + ($15 << 2); + $$1 = $$0 + ($15 << 2) | 0; + $$pn = $15; + } else { + $22 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$0 >> 2] | 0) + 40 >> 2] & 127]($0) | 0; + if (($22 | 0) == -1) break; + $24 = __ZNSt3__211char_traitsIwE12to_char_typeEj($22) | 0; + HEAP32[$$0 >> 2] = $24; + $$1 = $$0 + 4 | 0; + $$pn = 1; + } + $$0 = $$1; + $$023 = $$pn + $$023 | 0; + } + return $$023 | 0; +} + +function __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $17 = 0, $23 = 0, $29 = 0, $3 = 0.0, $35 = 0, $41 = 0, $47 = 0, $53 = 0; + $3 = +__ZN6vision11DotProduct9IfEET_PKS1_S3_($2, $1); + HEAPF32[$0 >> 2] = +HEAPF32[$0 >> 2] - $3 * +HEAPF32[$1 >> 2]; + $11 = $0 + 4 | 0; + HEAPF32[$11 >> 2] = +HEAPF32[$11 >> 2] - $3 * +HEAPF32[$1 + 4 >> 2]; + $17 = $0 + 8 | 0; + HEAPF32[$17 >> 2] = +HEAPF32[$17 >> 2] - $3 * +HEAPF32[$1 + 8 >> 2]; + $23 = $0 + 12 | 0; + HEAPF32[$23 >> 2] = +HEAPF32[$23 >> 2] - $3 * +HEAPF32[$1 + 12 >> 2]; + $29 = $0 + 16 | 0; + HEAPF32[$29 >> 2] = +HEAPF32[$29 >> 2] - $3 * +HEAPF32[$1 + 16 >> 2]; + $35 = $0 + 20 | 0; + HEAPF32[$35 >> 2] = +HEAPF32[$35 >> 2] - $3 * +HEAPF32[$1 + 20 >> 2]; + $41 = $0 + 24 | 0; + HEAPF32[$41 >> 2] = +HEAPF32[$41 >> 2] - $3 * +HEAPF32[$1 + 24 >> 2]; + $47 = $0 + 28 | 0; + HEAPF32[$47 >> 2] = +HEAPF32[$47 >> 2] - $3 * +HEAPF32[$1 + 28 >> 2]; + $53 = $0 + 32 | 0; + HEAPF32[$53 >> 2] = +HEAPF32[$53 >> 2] - $3 * +HEAPF32[$1 + 32 >> 2]; + return; +} + +function __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS5_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$pre$phiZ2D = 0, $10 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $3 = 0, $5 = 0, $7 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $7 = (HEAP32[$3 >> 2] | 0) - $2 | 0; + $10 = (HEAP32[$5 >> 2] | 0) + ((($7 | 0) / -36 | 0) * 36 | 0) | 0; + HEAP32[$5 >> 2] = $10; + if (($7 | 0) > 0) { + _memcpy($10 | 0, $2 | 0, $7 | 0) | 0; + $$pre$phiZ2D = $5; + $14 = HEAP32[$5 >> 2] | 0; + } else { + $$pre$phiZ2D = $5; + $14 = $10; + } + $13 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $14; + HEAP32[$$pre$phiZ2D >> 2] = $13; + $15 = $1 + 8 | 0; + $16 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$15 >> 2]; + HEAP32[$15 >> 2] = $16; + $18 = $0 + 8 | 0; + $19 = $1 + 12 | 0; + $20 = HEAP32[$18 >> 2] | 0; + HEAP32[$18 >> 2] = HEAP32[$19 >> 2]; + HEAP32[$19 >> 2] = $20; + HEAP32[$1 >> 2] = HEAP32[$$pre$phiZ2D >> 2]; + return; +} + +function _jinit_huff_decoder($0) { + $0 = $0 | 0; + var $$043 = 0, $1 = 0, $12 = 0, $15 = 0, $23 = 0, $24 = 0, $4 = 0; + $1 = $0 + 4 | 0; + $4 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 220) | 0; + HEAP32[$0 + 468 >> 2] = $4; + HEAP32[$4 >> 2] = 195; + HEAP32[$4 + 8 >> 2] = 196; + if (!(HEAP32[$0 + 224 >> 2] | 0)) { + $24 = $4 + 68 | 0; + HEAP32[$24 >> 2] = 0; + HEAP32[$24 + 4 >> 2] = 0; + HEAP32[$24 + 8 >> 2] = 0; + HEAP32[$24 + 12 >> 2] = 0; + HEAP32[$24 + 16 >> 2] = 0; + HEAP32[$4 + 88 >> 2] = 0; + HEAP32[$4 + 92 >> 2] = 0; + HEAP32[$4 + 96 >> 2] = 0; + return; + } + $12 = $0 + 36 | 0; + $15 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, HEAP32[$12 >> 2] << 8) | 0; + HEAP32[$0 + 160 >> 2] = $15; + if ((HEAP32[$12 >> 2] | 0) > 0) { + $$043 = 0; + do { + _memset($15 + ($$043 << 8) | 0, -1, 256) | 0; + $$043 = $$043 + 1 | 0; + } while (($$043 | 0) < (HEAP32[$12 >> 2] | 0)); + } + $23 = $4 + 48 | 0; + HEAP32[$23 >> 2] = 0; + HEAP32[$23 + 4 >> 2] = 0; + HEAP32[$23 + 8 >> 2] = 0; + HEAP32[$23 + 12 >> 2] = 0; + return; +} + +function _getPattRatio($id) { + $id = $id | 0; + var $0 = 0, $arhandle = 0, $cmp = 0, $id$addr = 0, $pattRatio = 0, $retval$0 = 0.0, $retval$1 = 0.0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp + 8 | 0; + $pattRatio = sp; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$1 = -1.0; else { + $arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0; + $0 = HEAP32[$arhandle >> 2] | 0; + if (!$0) $retval$0 = -1.0; else { + $cmp = (_arGetPattRatio($0, $pattRatio) | 0) == 0; + $retval$0 = $cmp ? +HEAPF64[$pattRatio >> 3] : -1.0; + } + $retval$1 = $retval$0; + } + STACKTOP = sp; + return +$retval$1; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E11parseNumberEb($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $12 = 0, $14 = 0, $3 = 0, $6 = 0, label = 0; + $3 = HEAP32[$1 >> 2] | 0; + if ($2) __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($1, 110) | 0; + if ((__ZNK12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E7numLeftEv($1) | 0) != 0 ? ($6 = HEAP32[$1 >> 2] | 0, ((HEAP8[$6 >> 0] | 0) + -48 | 0) >>> 0 < 10) : 0) { + $12 = $6; + while (1) { + if (!(__ZNK12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E7numLeftEv($1) | 0)) break; + if (((HEAP8[$12 >> 0] | 0) + -48 | 0) >>> 0 >= 10) break; + $14 = $12 + 1 | 0; + HEAP32[$1 >> 2] = $14; + $12 = $14; + } + __ZN12_GLOBAL__N_110StringViewC2EPKcS2_($0, $3, $12); + } else __ZN12_GLOBAL__N_110StringViewC2Ev($0); + return; +} + +function _getMultiMarkerNum($id, $multiMarker_id) { + $id = $id | 0; + $multiMarker_id = $multiMarker_id | 0; + var $1 = 0, $call7 = 0, $id$addr = 0, $retval$1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + if (((__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0) != 0 ? ($call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0, ($multiMarker_id | 0) >= 0) : 0) ? ($1 = HEAP32[$call7 + 328 >> 2] | 0, (HEAP32[$call7 + 332 >> 2] | 0) - $1 >> 3 >>> 0 > $multiMarker_id >>> 0) : 0) $retval$1 = HEAP32[(HEAP32[$1 + ($multiMarker_id << 3) + 4 >> 2] | 0) + 4 >> 2] | 0; else $retval$1 = -1; + STACKTOP = sp; + return $retval$1 | 0; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE21__construct_node_hashIRKNS_21piecewise_construct_tEJNS_5tupleIJRKiEEENSJ_IJEEEEEENS_10unique_ptrINS_11__hash_nodeIS3_PvEENS_22__hash_node_destructorINSC_ISR_EEEEEEmOT_DpOT0_($agg$result, $this, $__hash, $__f, $__rest, $__rest1) { + $agg$result = $agg$result | 0; + $this = $this | 0; + $__hash = $__hash | 0; + $__f = $__f | 0; + $__rest = $__rest | 0; + $__rest1 = $__rest1 | 0; + var $call$i$i$i = 0, $second$i$i$i$i$i = 0; + $call$i$i$i = __Znwm(496) | 0; + HEAP32[$agg$result >> 2] = $call$i$i$i; + HEAP32[$agg$result + 4 >> 2] = $this + 8; + HEAP32[$call$i$i$i + 8 >> 2] = HEAP32[HEAP32[$__rest >> 2] >> 2]; + $second$i$i$i$i$i = $call$i$i$i + 16 | 0; + _memset($second$i$i$i$i$i | 0, 0, 480) | 0; + __ZN12arControllerC2Ev($second$i$i$i$i$i); + HEAP8[$agg$result + 8 >> 0] = 1; + HEAP32[$call$i$i$i + 4 >> 2] = $__hash; + HEAP32[$call$i$i$i >> 2] = 0; + return; +} + +function __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$023 = 0, $$1 = 0, $$pn = 0, $11 = 0, $12 = 0, $14 = 0, $21 = 0, $23 = 0, $3 = 0, $4 = 0, $6 = 0, $7 = 0; + __ZNSt3__211char_traitsIcE3eofEv() | 0; + $3 = $0 + 12 | 0; + $4 = $0 + 16 | 0; + $$0 = $1; + $$023 = 0; + while (1) { + if (($$023 | 0) >= ($2 | 0)) break; + $6 = HEAP32[$3 >> 2] | 0; + $7 = HEAP32[$4 >> 2] | 0; + if ($6 >>> 0 < $7 >>> 0) { + $11 = $7 - $6 | 0; + $12 = $2 - $$023 | 0; + $14 = ($12 | 0) < ($11 | 0) ? $12 : $11; + __ZNSt3__211char_traitsIcE4copyEPcPKcm($$0, $6, $14) | 0; + HEAP32[$3 >> 2] = (HEAP32[$3 >> 2] | 0) + $14; + $$1 = $$0 + $14 | 0; + $$pn = $14; + } else { + $21 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$0 >> 2] | 0) + 40 >> 2] & 127]($0) | 0; + if (($21 | 0) == -1) break; + $23 = __ZNSt3__211char_traitsIcE12to_char_typeEi($21) | 0; + HEAP8[$$0 >> 0] = $23; + $$1 = $$0 + 1 | 0; + $$pn = 1; + } + $$0 = $$1; + $$023 = $$pn + $$023 | 0; + } + return $$023 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13EnclosingExprEJRA12_KcRPNS2_4NodeERA2_S4_EEEPT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 24 | 0; + $$byval_copy = sp + 16 | 0; + $4 = sp + 8 | 0; + $5 = sp; + $6 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 28) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, $1); + $7 = HEAP32[$2 >> 2] | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, $3); + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle13EnclosingExprC2ENS_10StringViewEPNS0_4NodeES2_($6, $$byval_copy, $7, $$byval_copy1); + STACKTOP = sp; + return $6 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13EnclosingExprEJRA11_KcRPNS2_4NodeERA2_S4_EEEPT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 24 | 0; + $$byval_copy = sp + 16 | 0; + $4 = sp + 8 | 0; + $5 = sp; + $6 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 28) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, $1); + $7 = HEAP32[$2 >> 2] | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, $3); + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle13EnclosingExprC2ENS_10StringViewEPNS0_4NodeES2_($6, $$byval_copy, $7, $$byval_copy1); + STACKTOP = sp; + return $6 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13EnclosingExprEJRA10_KcRPNS2_4NodeERA2_S4_EEEPT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 24 | 0; + $$byval_copy = sp + 16 | 0; + $4 = sp + 8 | 0; + $5 = sp; + $6 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 28) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, $1); + $7 = HEAP32[$2 >> 2] | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, $3); + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle13EnclosingExprC2ENS_10StringViewEPNS0_4NodeES2_($6, $$byval_copy, $7, $$byval_copy1); + STACKTOP = sp; + return $6 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8FoldExprEJRbRNS_10StringViewERPNS2_4NodeES9_EEEPT_DpOT0_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $14 = 0, $15 = 0, $19 = 0, $20 = 0, $5 = 0, $6 = 0, $8 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $5 = sp; + $6 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 28) | 0; + $8 = (HEAP8[$1 >> 0] | 0) != 0; + $9 = $2; + $14 = HEAP32[$9 + 4 >> 2] | 0; + $15 = $5; + HEAP32[$15 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$15 + 4 >> 2] = $14; + $19 = HEAP32[$3 >> 2] | 0; + $20 = HEAP32[$4 >> 2] | 0; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$5 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8FoldExprC2EbNS_10StringViewEPKNS0_4NodeES5_($6, $8, $tmpcast$byval_copy, $19, $20); + STACKTOP = sp; + return $6 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13EnclosingExprEJRA9_KcRPNS2_4NodeERA2_S4_EEEPT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 24 | 0; + $$byval_copy = sp + 16 | 0; + $4 = sp + 8 | 0; + $5 = sp; + $6 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 28) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, $1); + $7 = HEAP32[$2 >> 2] | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($5, $3); + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$5 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle13EnclosingExprC2ENS_10StringViewEPNS0_4NodeES2_($6, $$byval_copy, $7, $$byval_copy1); + STACKTOP = sp; + return $6 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfENS_10StringViewE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $12 = 0, $13 = 0, $18 = 0, $2 = 0, $3 = 0, $7 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $tmpcast$byval_copy = sp + 16 | 0; + $2 = sp + 8 | 0; + $3 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKcS2_($2, HEAP32[$0 >> 2] | 0, HEAP32[$0 + 4 >> 2] | 0); + $7 = $1; + $12 = HEAP32[$7 + 4 >> 2] | 0; + $13 = $3; + HEAP32[$13 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$13 + 4 >> 2] = $12; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + if (__ZNK12_GLOBAL__N_110StringView10startsWithES0_($2, $tmpcast$byval_copy) | 0) { + $18 = __ZNK12_GLOBAL__N_110StringView4sizeEv($1) | 0; + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + $18; + $$0 = 1; + } else $$0 = 0; + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EE7reserveEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$in = 0, $$pre$phi11Z2D = 0, $11 = 0, $15 = 0, $2 = 0, $5 = 0, $7 = 0, $8 = 0; + $2 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EE4sizeEv($0) | 0; + do if (!(__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EE8isInlineEv($0) | 0)) { + $15 = _realloc(HEAP32[$0 >> 2] | 0, $1 << 2) | 0; + HEAP32[$0 >> 2] = $15; + if (!$15) __ZSt9terminatev(); else { + $$in = $15; + $$pre$phi11Z2D = $0 + 4 | 0; + break; + } + } else { + $5 = _malloc($1 << 2) | 0; + if (!$5) __ZSt9terminatev(); + $7 = HEAP32[$0 >> 2] | 0; + $8 = $0 + 4 | 0; + $11 = (HEAP32[$8 >> 2] | 0) - $7 | 0; + if ($11 | 0) _memmove($5 | 0, $7 | 0, $11 | 0) | 0; + HEAP32[$0 >> 2] = $5; + $$in = $5; + $$pre$phi11Z2D = $8; + } while (0); + HEAP32[$$pre$phi11Z2D >> 2] = $$in + ($2 << 2); + HEAP32[$0 + 8 >> 2] = $$in + ($1 << 2); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle21CtorVtableSpecialName9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy1 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 16 | 0; + $2 = sp + 8 | 0; + $3 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 56899); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 56924); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 12 >> 2] | 0, $1); + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS5_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$pre$phiZ2D = 0, $10 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $3 = 0, $5 = 0, $7 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $7 = (HEAP32[$3 >> 2] | 0) - $2 | 0; + $10 = (HEAP32[$5 >> 2] | 0) + ((($7 | 0) / -12 | 0) * 12 | 0) | 0; + HEAP32[$5 >> 2] = $10; + if (($7 | 0) > 0) { + _memcpy($10 | 0, $2 | 0, $7 | 0) | 0; + $$pre$phiZ2D = $5; + $14 = HEAP32[$5 >> 2] | 0; + } else { + $$pre$phiZ2D = $5; + $14 = $10; + } + $13 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $14; + HEAP32[$$pre$phiZ2D >> 2] = $13; + $15 = $1 + 8 | 0; + $16 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$15 >> 2]; + HEAP32[$15 >> 2] = $16; + $18 = $0 + 8 | 0; + $19 = $1 + 12 | 0; + $20 = HEAP32[$18 >> 2] | 0; + HEAP32[$18 >> 2] = HEAP32[$19 >> 2]; + HEAP32[$19 >> 2] = $20; + HEAP32[$1 >> 2] = HEAP32[$$pre$phiZ2D >> 2]; + return; +} + +function _setPattRatio($id, $ratio) { + $id = $id | 0; + $ratio = +$ratio; + var $0 = 0, $call7 = 0, $conv = 0.0, $id$addr = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $id$addr = sp + 8 | 0; + HEAP32[$id$addr >> 2] = $id; + if (((__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0 ? ($call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0, !($ratio <= 0.0 | $ratio >= 1.0)) : 0) ? ($conv = $ratio, $0 = HEAP32[$call7 + 216 >> 2] | 0, $0 | 0) : 0) ? (_arSetPattRatio($0, $conv) | 0) == 0 : 0) { + HEAPF64[$vararg_buffer >> 3] = $conv; + _arLog(0, 1, 41608, $vararg_buffer); + } + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS5_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$pre$phiZ2D = 0, $11 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $3 = 0, $5 = 0, $7 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $7 = (HEAP32[$3 >> 2] | 0) - $2 | 0; + $11 = (HEAP32[$5 >> 2] | 0) + (0 - ($7 >> 2) << 2) | 0; + HEAP32[$5 >> 2] = $11; + if (($7 | 0) > 0) { + _memcpy($11 | 0, $2 | 0, $7 | 0) | 0; + $$pre$phiZ2D = $5; + $15 = HEAP32[$5 >> 2] | 0; + } else { + $$pre$phiZ2D = $5; + $15 = $11; + } + $14 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $15; + HEAP32[$$pre$phiZ2D >> 2] = $14; + $16 = $1 + 8 | 0; + $17 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$16 >> 2]; + HEAP32[$16 >> 2] = $17; + $19 = $0 + 8 | 0; + $20 = $1 + 12 | 0; + $21 = HEAP32[$19 >> 2] | 0; + HEAP32[$19 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$20 >> 2] = $21; + HEAP32[$1 >> 2] = HEAP32[$$pre$phiZ2D >> 2]; + return; +} + +function __ZN6vision6Logger5writeENS_19LoggerPriorityLevelEPKcz($0, $1, $2, $varargs) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $varargs = $varargs | 0; + var $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $3 = sp; + $4 = sp + 28 | 0; + $5 = sp + 16 | 0; + HEAP32[$3 >> 2] = $varargs; + HEAP32[$5 >> 2] = 0; + HEAP32[$5 + 4 >> 2] = 0; + HEAP32[$5 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm($5, $2, __ZNSt3__211char_traitsIcE6lengthEPKc($2) | 0); + __ZN6vision6detail23create_formatted_stringERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPi($4, $5, $3); + __ZN6vision6Logger5writeENS_19LoggerPriorityLevelERKNSt3__212basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE($0, $1, $4); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($4); + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($5); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle15PixelVectorTypeEJRNS_10StringViewEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $10 = 0, $11 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy = sp + 16 | 0; + $2 = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + $5 = $1; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $3; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle12NodeOrStringC2ENS_10StringViewE($2, $$byval_copy); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle15PixelVectorTypeC2ENS0_12NodeOrStringE($4, $$byval_copy); + STACKTOP = sp; + return $4 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle8CallExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy1 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 16 | 0; + $2 = sp + 8 | 0; + $3 = sp; + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51968); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray14printWithCommaERNS_12OutputStreamE($0 + 12 | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 51964); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorIPKN6vision4NodeILi96EEENS_9allocatorIS5_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS5_RS7_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$pre$phiZ2D = 0, $11 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $3 = 0, $5 = 0, $7 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $7 = (HEAP32[$3 >> 2] | 0) - $2 | 0; + $11 = (HEAP32[$5 >> 2] | 0) + (0 - ($7 >> 2) << 2) | 0; + HEAP32[$5 >> 2] = $11; + if (($7 | 0) > 0) { + _memcpy($11 | 0, $2 | 0, $7 | 0) | 0; + $$pre$phiZ2D = $5; + $15 = HEAP32[$5 >> 2] | 0; + } else { + $$pre$phiZ2D = $5; + $15 = $11; + } + $14 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $15; + HEAP32[$$pre$phiZ2D >> 2] = $14; + $16 = $1 + 8 | 0; + $17 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$16 >> 2]; + HEAP32[$16 >> 2] = $17; + $19 = $0 + 8 | 0; + $20 = $1 + 12 | 0; + $21 = HEAP32[$19 >> 2] | 0; + HEAP32[$19 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$20 >> 2] = $21; + HEAP32[$1 >> 2] = HEAP32[$$pre$phiZ2D >> 2]; + return; +} + +function __ZNSt3__26vectorIPN6vision4NodeILi96EEENS_9allocatorIS4_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS4_RS6_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$pre$phiZ2D = 0, $11 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $3 = 0, $5 = 0, $7 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $7 = (HEAP32[$3 >> 2] | 0) - $2 | 0; + $11 = (HEAP32[$5 >> 2] | 0) + (0 - ($7 >> 2) << 2) | 0; + HEAP32[$5 >> 2] = $11; + if (($7 | 0) > 0) { + _memcpy($11 | 0, $2 | 0, $7 | 0) | 0; + $$pre$phiZ2D = $5; + $15 = HEAP32[$5 >> 2] | 0; + } else { + $$pre$phiZ2D = $5; + $15 = $11; + } + $14 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $15; + HEAP32[$$pre$phiZ2D >> 2] = $14; + $16 = $1 + 8 | 0; + $17 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$16 >> 2]; + HEAP32[$16 >> 2] = $17; + $19 = $0 + 8 | 0; + $20 = $1 + 12 | 0; + $21 = HEAP32[$19 >> 2] | 0; + HEAP32[$19 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$20 >> 2] = $21; + HEAP32[$1 >> 2] = HEAP32[$$pre$phiZ2D >> 2]; + return; +} + +function __ZNSt3__215__num_get_floatIeEET_PKcS3_Rj($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0.0, $$0$ph = 0.0, $$1 = 0.0, $10 = 0, $11 = 0, $13 = 0, $3 = 0, $5 = 0, $6 = 0, $7 = 0, $9 = 0.0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + if (($0 | 0) == ($1 | 0)) { + HEAP32[$2 >> 2] = 4; + $$1 = 0.0; + } else { + $5 = ___errno_location() | 0; + $6 = HEAP32[$5 >> 2] | 0; + $7 = ___errno_location() | 0; + HEAP32[$7 >> 2] = 0; + $9 = +_strtold_l($0, $3, __ZNSt3__26__clocEv() | 0); + $10 = ___errno_location() | 0; + $11 = HEAP32[$10 >> 2] | 0; + if (!$11) { + $13 = ___errno_location() | 0; + HEAP32[$13 >> 2] = $6; + } + if ((HEAP32[$3 >> 2] | 0) == ($1 | 0)) if (($11 | 0) == 68) { + $$0$ph = $9; + label = 6; + } else $$0 = $9; else { + $$0$ph = 0.0; + label = 6; + } + if ((label | 0) == 6) { + HEAP32[$2 >> 2] = 4; + $$0 = $$0$ph; + } + $$1 = $$0; + } + STACKTOP = sp; + return +$$1; +} + +function __ZN6vision20SmallestTriangleAreaIfEET_PKS1_S3_S3_S3_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $10 = 0.0, $11 = 0.0, $13 = 0.0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0.0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $4 = sp + 32 | 0; + $5 = sp + 24 | 0; + $6 = sp + 16 | 0; + $7 = sp + 8 | 0; + $8 = sp; + __ZN6vision10SubVector2IfEEvPT_PKS1_S4_($4, $1, $0); + __ZN6vision10SubVector2IfEEvPT_PKS1_S4_($5, $2, $0); + __ZN6vision10SubVector2IfEEvPT_PKS1_S4_($6, $3, $0); + __ZN6vision10SubVector2IfEEvPT_PKS1_S4_($7, $1, $2); + __ZN6vision10SubVector2IfEEvPT_PKS1_S4_($8, $3, $2); + $9 = +__ZN6vision14AreaOfTriangleIfEET_PKS1_S3_($4, $5); + $10 = +__ZN6vision14AreaOfTriangleIfEET_PKS1_S3_($5, $6); + $11 = +__ZN6vision14AreaOfTriangleIfEET_PKS1_S3_($4, $6); + $13 = +__ZN6vision4min4IfEET_S1_S1_S1_S1_($9, $10, $11, +__ZN6vision14AreaOfTriangleIfEET_PKS1_S3_($7, $8)); + STACKTOP = sp; + return +$13; +} + +function __ZNSt3__215__num_get_floatIfEET_PKcS3_Rj($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0.0, $$0$ph = 0.0, $$1 = 0.0, $10 = 0, $11 = 0, $13 = 0, $3 = 0, $5 = 0, $6 = 0, $7 = 0, $9 = 0.0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + if (($0 | 0) == ($1 | 0)) { + HEAP32[$2 >> 2] = 4; + $$1 = 0.0; + } else { + $5 = ___errno_location() | 0; + $6 = HEAP32[$5 >> 2] | 0; + $7 = ___errno_location() | 0; + HEAP32[$7 >> 2] = 0; + $9 = +_strtof_l($0, $3, __ZNSt3__26__clocEv() | 0); + $10 = ___errno_location() | 0; + $11 = HEAP32[$10 >> 2] | 0; + if (!$11) { + $13 = ___errno_location() | 0; + HEAP32[$13 >> 2] = $6; + } + if ((HEAP32[$3 >> 2] | 0) == ($1 | 0)) if (($11 | 0) == 68) { + $$0$ph = $9; + label = 6; + } else $$0 = $9; else { + $$0$ph = 0.0; + label = 6; + } + if ((label | 0) == 6) { + HEAP32[$2 >> 2] = 4; + $$0 = $$0$ph; + } + $$1 = $$0; + } + STACKTOP = sp; + return +$$1; +} + +function __ZNSt3__215__num_get_floatIdEET_PKcS3_Rj($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0.0, $$0$ph = 0.0, $$1 = 0.0, $10 = 0, $11 = 0, $13 = 0, $3 = 0, $5 = 0, $6 = 0, $7 = 0, $9 = 0.0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + if (($0 | 0) == ($1 | 0)) { + HEAP32[$2 >> 2] = 4; + $$1 = 0.0; + } else { + $5 = ___errno_location() | 0; + $6 = HEAP32[$5 >> 2] | 0; + $7 = ___errno_location() | 0; + HEAP32[$7 >> 2] = 0; + $9 = +_strtod_l($0, $3, __ZNSt3__26__clocEv() | 0); + $10 = ___errno_location() | 0; + $11 = HEAP32[$10 >> 2] | 0; + if (!$11) { + $13 = ___errno_location() | 0; + HEAP32[$13 >> 2] = $6; + } + if ((HEAP32[$3 >> 2] | 0) == ($1 | 0)) if (($11 | 0) == 68) { + $$0$ph = $9; + label = 6; + } else $$0 = $9; else { + $$0$ph = 0.0; + label = 6; + } + if ((label | 0) == 6) { + HEAP32[$2 >> 2] = 4; + $$0 = $$0$ph; + } + $$1 = $$0; + } + STACKTOP = sp; + return +$$1; +} + +function __ZNK10__cxxabiv117__class_type_info29process_static_type_above_dstEPNS_19__dynamic_cast_infoEPKvS4_i($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $10 = 0, $11 = 0, $21 = 0, $22 = 0, $28 = 0, $30 = 0; + HEAP8[$1 + 53 >> 0] = 1; + do if ((HEAP32[$1 + 4 >> 2] | 0) == ($3 | 0)) { + HEAP8[$1 + 52 >> 0] = 1; + $10 = $1 + 16 | 0; + $11 = HEAP32[$10 >> 2] | 0; + if (!$11) { + HEAP32[$10 >> 2] = $2; + HEAP32[$1 + 24 >> 2] = $4; + HEAP32[$1 + 36 >> 2] = 1; + if (!(($4 | 0) == 1 ? (HEAP32[$1 + 48 >> 2] | 0) == 1 : 0)) break; + HEAP8[$1 + 54 >> 0] = 1; + break; + } + if (($11 | 0) != ($2 | 0)) { + $30 = $1 + 36 | 0; + HEAP32[$30 >> 2] = (HEAP32[$30 >> 2] | 0) + 1; + HEAP8[$1 + 54 >> 0] = 1; + break; + } + $21 = $1 + 24 | 0; + $22 = HEAP32[$21 >> 2] | 0; + if (($22 | 0) == 2) { + HEAP32[$21 >> 2] = $4; + $28 = $4; + } else $28 = $22; + if (($28 | 0) == 1 ? (HEAP32[$1 + 48 >> 2] | 0) == 1 : 0) HEAP8[$1 + 54 >> 0] = 1; + } while (0); + return; +} + +function _h2v2_upsample($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$03338 = 0, $$03437 = 0, $$03536 = 0, $$039 = 0, $10 = 0, $11 = 0, $12 = 0, $17 = 0, $22 = 0, $4 = 0, $5 = 0, $8 = 0; + $4 = HEAP32[$3 >> 2] | 0; + $5 = $0 + 320 | 0; + if ((HEAP32[$5 >> 2] | 0) <= 0) return; + $8 = $0 + 112 | 0; + $$03338 = 0; + $$039 = 0; + while (1) { + $10 = HEAP32[$4 + ($$039 << 2) >> 2] | 0; + $11 = HEAP32[$8 >> 2] | 0; + $12 = $10 + $11 | 0; + if (($11 | 0) > 0) { + $$03437 = HEAP32[$2 + ($$03338 << 2) >> 2] | 0; + $$03536 = $10; + while (1) { + $17 = HEAP8[$$03437 >> 0] | 0; + HEAP8[$$03536 >> 0] = $17; + HEAP8[$$03536 + 1 >> 0] = $17; + $$03536 = $$03536 + 2 | 0; + if ($$03536 >>> 0 >= $12 >>> 0) break; else $$03437 = $$03437 + 1 | 0; + } + $22 = HEAP32[$8 >> 2] | 0; + } else $22 = $11; + _jcopy_sample_rows($4, $$039, $4, $$039 | 1, 1, $22); + $$039 = $$039 + 2 | 0; + if (($$039 | 0) >= (HEAP32[$5 >> 2] | 0)) break; else $$03338 = $$03338 + 1 | 0; + } + return; +} + +function __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$pre$phiZ2D = 0, $11 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $3 = 0, $5 = 0, $7 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $7 = (HEAP32[$3 >> 2] | 0) - $2 | 0; + $11 = (HEAP32[$5 >> 2] | 0) + (0 - ($7 >> 3) << 3) | 0; + HEAP32[$5 >> 2] = $11; + if (($7 | 0) > 0) { + _memcpy($11 | 0, $2 | 0, $7 | 0) | 0; + $$pre$phiZ2D = $5; + $15 = HEAP32[$5 >> 2] | 0; + } else { + $$pre$phiZ2D = $5; + $15 = $11; + } + $14 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $15; + HEAP32[$$pre$phiZ2D >> 2] = $14; + $16 = $1 + 8 | 0; + $17 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$16 >> 2]; + HEAP32[$16 >> 2] = $17; + $19 = $0 + 8 | 0; + $20 = $1 + 12 | 0; + $21 = HEAP32[$19 >> 2] | 0; + HEAP32[$19 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$20 >> 2] = $21; + HEAP32[$1 >> 2] = HEAP32[$$pre$phiZ2D >> 2]; + return; +} + +function __ZNSt3__26vectorINS_4pairIfmEENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$pre$phiZ2D = 0, $11 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $3 = 0, $5 = 0, $7 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $7 = (HEAP32[$3 >> 2] | 0) - $2 | 0; + $11 = (HEAP32[$5 >> 2] | 0) + (0 - ($7 >> 3) << 3) | 0; + HEAP32[$5 >> 2] = $11; + if (($7 | 0) > 0) { + _memcpy($11 | 0, $2 | 0, $7 | 0) | 0; + $$pre$phiZ2D = $5; + $15 = HEAP32[$5 >> 2] | 0; + } else { + $$pre$phiZ2D = $5; + $15 = $11; + } + $14 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $15; + HEAP32[$$pre$phiZ2D >> 2] = $14; + $16 = $1 + 8 | 0; + $17 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$16 >> 2]; + HEAP32[$16 >> 2] = $17; + $19 = $0 + 8 | 0; + $20 = $1 + 12 | 0; + $21 = HEAP32[$19 >> 2] | 0; + HEAP32[$19 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$20 >> 2] = $21; + HEAP32[$1 >> 2] = HEAP32[$$pre$phiZ2D >> 2]; + return; +} + +function __ZNSt3__26vectorINS_4pairIfiEENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$pre$phiZ2D = 0, $11 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $3 = 0, $5 = 0, $7 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $7 = (HEAP32[$3 >> 2] | 0) - $2 | 0; + $11 = (HEAP32[$5 >> 2] | 0) + (0 - ($7 >> 3) << 3) | 0; + HEAP32[$5 >> 2] = $11; + if (($7 | 0) > 0) { + _memcpy($11 | 0, $2 | 0, $7 | 0) | 0; + $$pre$phiZ2D = $5; + $15 = HEAP32[$5 >> 2] | 0; + } else { + $$pre$phiZ2D = $5; + $15 = $11; + } + $14 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $15; + HEAP32[$$pre$phiZ2D >> 2] = $14; + $16 = $1 + 8 | 0; + $17 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$16 >> 2]; + HEAP32[$16 >> 2] = $17; + $19 = $0 + 8 | 0; + $20 = $1 + 12 | 0; + $21 = HEAP32[$19 >> 2] | 0; + HEAP32[$19 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$20 >> 2] = $21; + HEAP32[$1 >> 2] = HEAP32[$$pre$phiZ2D >> 2]; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E17parseCVQualifiersEv($0) { + $0 = $0 | 0; + var $1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = 0; + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 114) | 0) __ZN12_GLOBAL__N_116itanium_demangleoRERNS0_10QualifiersES1_($1, 4); + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 86) | 0) __ZN12_GLOBAL__N_116itanium_demangleoRERNS0_10QualifiersES1_($1, 2); + if (__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 75) | 0) __ZN12_GLOBAL__N_116itanium_demangleoRERNS0_10QualifiersES1_($1, 1); + STACKTOP = sp; + return HEAP32[$1 >> 2] | 0; +} + +function __ZNKSt3__27codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$018 = 0, $$019 = 0, $13 = 0, $20 = 0, $21 = 0, $5 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $5 = sp; + HEAP32[$4 >> 2] = $2; + $8 = ___uselocale(HEAP32[$0 + 8 >> 2] | 0) | 0; + $9 = _wcrtomb($5, 0, $1) | 0; + if ($8 | 0) ___uselocale($8) | 0; + L4 : do if (($9 + 1 | 0) >>> 0 >= 2) { + $13 = $9 + -1 | 0; + if ($13 >>> 0 > ($3 - (HEAP32[$4 >> 2] | 0) | 0) >>> 0) $$019 = 1; else { + $$0 = $5; + $$018 = $13; + while (1) { + if (!$$018) { + $$019 = 0; + break L4; + } + $20 = HEAP8[$$0 >> 0] | 0; + $21 = HEAP32[$4 >> 2] | 0; + HEAP32[$4 >> 2] = $21 + 1; + HEAP8[$21 >> 0] = $20; + $$0 = $$0 + 1 | 0; + $$018 = $$018 + -1 | 0; + } + } + } else $$019 = 2; while (0); + STACKTOP = sp; + return $$019 | 0; +} + +function _fill_input_buffer($0) { + $0 = $0 | 0; + var $$0 = 0, $$pre$phi22Z2D = 0, $12 = 0, $15 = 0, $2 = 0, $22 = 0, $23 = 0, $3 = 0, $7 = 0, $9 = 0; + $2 = HEAP32[$0 + 24 >> 2] | 0; + $3 = $2 + 32 | 0; + $7 = _fread(HEAP32[$3 >> 2] | 0, 1, 4096, HEAP32[$2 + 28 >> 2] | 0) | 0; + $9 = $2 + 36 | 0; + if ($7 | 0) { + $$0 = $7; + $22 = HEAP32[$3 >> 2] | 0; + HEAP32[$2 >> 2] = $22; + $23 = $2 + 4 | 0; + HEAP32[$23 >> 2] = $$0; + HEAP32[$9 >> 2] = 0; + return 1; + } + if (!(HEAP32[$9 >> 2] | 0)) $$pre$phi22Z2D = $0; else { + $12 = HEAP32[$0 >> 2] | 0; + HEAP32[$12 + 20 >> 2] = 43; + FUNCTION_TABLE_vi[HEAP32[$12 >> 2] & 255]($0); + $$pre$phi22Z2D = $0; + } + $15 = HEAP32[$0 >> 2] | 0; + HEAP32[$15 + 20 >> 2] = 123; + FUNCTION_TABLE_vii[HEAP32[$15 + 4 >> 2] & 255]($$pre$phi22Z2D, -1); + HEAP8[HEAP32[$3 >> 2] >> 0] = -1; + HEAP8[(HEAP32[$3 >> 2] | 0) + 1 >> 0] = -39; + $$0 = 2; + $22 = HEAP32[$3 >> 2] | 0; + HEAP32[$2 >> 2] = $22; + $23 = $2 + 4 | 0; + HEAP32[$23 >> 2] = $$0; + HEAP32[$9 >> 2] = 0; + return 1; +} + +function _atoi($0) { + $0 = $0 | 0; + var $$0 = 0, $$010$lcssa = 0, $$01015 = 0, $$011 = 0, $$1 = 0, $$112 = 0, $$214 = 0, $$pre$phiZ2D = 0, $14 = 0, $5 = 0, $7 = 0, label = 0; + $$011 = $0; + while (1) { + $5 = $$011 + 1 | 0; + if (!(_isspace(HEAP8[$$011 >> 0] | 0) | 0)) break; else $$011 = $5; + } + $7 = HEAP8[$$011 >> 0] | 0; + switch ($7 | 0) { + case 45: + { + $$0 = 1; + label = 5; + break; + } + case 43: + { + $$0 = 0; + label = 5; + break; + } + default: + { + $$1 = 0; + $$112 = $$011; + $$pre$phiZ2D = $7; + } + } + if ((label | 0) == 5) { + $$1 = $$0; + $$112 = $5; + $$pre$phiZ2D = HEAP8[$5 >> 0] | 0; + } + if (!(_isdigit($$pre$phiZ2D) | 0)) $$010$lcssa = 0; else { + $$01015 = 0; + $$214 = $$112; + while (1) { + $14 = ($$01015 * 10 | 0) + 48 - (HEAP8[$$214 >> 0] | 0) | 0; + $$214 = $$214 + 1 | 0; + if (!(_isdigit(HEAP8[$$214 >> 0] | 0) | 0)) { + $$010$lcssa = $14; + break; + } else $$01015 = $14; + } + } + return (($$1 | 0) == 0 ? 0 - $$010$lcssa | 0 : $$010$lcssa) | 0; +} + +function __ZNK6vision21HoughSimilarityVoting12mapVoteToBinERfS1_S1_S1_ffff($0, $1, $2, $3, $4, $5, $6, $7, $8) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = +$5; + $6 = +$6; + $7 = +$7; + $8 = +$8; + var $11 = 0.0, $13 = 0.0, $19 = 0.0, $22 = 0.0, $24 = 0.0, $30 = 0.0, $41 = 0.0, $43 = 0.0, $49 = 0.0; + $11 = +(HEAP32[$0 + 52 >> 2] | 0); + $13 = +HEAPF32[$0 + 20 >> 2]; + $19 = +__ZN6vision12SafeDivisionIfEET_S1_S1_($5 - $13, +HEAPF32[$0 + 24 >> 2] - $13) * $11; + HEAPF32[$1 >> 2] = $19; + $22 = +(HEAP32[$0 + 56 >> 2] | 0); + $24 = +HEAPF32[$0 + 28 >> 2]; + $30 = +__ZN6vision12SafeDivisionIfEET_S1_S1_($6 - $24, +HEAPF32[$0 + 32 >> 2] - $24) * $22; + HEAPF32[$2 >> 2] = $30; + HEAPF32[$3 >> 2] = ($7 + 3.141592653589793) * .15915494309189535 * +(HEAP32[$0 + 60 >> 2] | 0); + $41 = +(HEAP32[$0 + 64 >> 2] | 0); + $43 = +HEAPF32[$0 + 36 >> 2]; + $49 = +__ZN6vision12SafeDivisionIfEET_S1_S1_($8 - $43, +HEAPF32[$0 + 40 >> 2] - $43) * $41; + HEAPF32[$4 >> 2] = $49; + return; +} + +function __ZN10emscripten8internal7InvokerIiJiNSt3__212basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEE6invokeEPFiiS8_EiPNS0_11BindingTypeIS8_vEUt_E($fn, $args, $args1) { + $fn = $fn | 0; + $args = $args | 0; + $args1 = $args1 | 0; + var $agg$tmp = 0, $call = 0, $call3 = 0, $call4 = 0, $ref$tmp = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $ref$tmp = sp + 12 | 0; + $agg$tmp = sp; + $call = __ZN10emscripten8internal11BindingTypeIivE12fromWireTypeEi($args) | 0; + __ZN10emscripten8internal11BindingTypeINSt3__212basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEvE12fromWireTypeEPNS9_Ut_E($agg$tmp, $args1); + $call3 = FUNCTION_TABLE_iii[$fn & 127]($call, $agg$tmp) | 0; + HEAP32[$ref$tmp >> 2] = $call3; + $call4 = __ZN10emscripten8internal11BindingTypeIivE10toWireTypeERKi($ref$tmp) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($agg$tmp); + STACKTOP = sp; + return $call4 | 0; +} + +function __ZZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parseNestedNameEPNS5_9NameStateEENKUlPNS0_4NodeEE_clES9_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $13 = 0, $2 = 0, $3 = 0, $5 = 0, $6 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + HEAP32[$2 >> 2] = $1; + $3 = HEAP32[$0 >> 2] | 0; + if (!$1) $$0 = 0; else { + $5 = $0 + 4 | 0; + $6 = HEAP32[$5 >> 2] | 0; + if (!(HEAP32[$6 >> 2] | 0)) HEAP32[$6 >> 2] = $1; else { + $9 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10NestedNameEJRPNS0_4NodeESA_EEES9_DpOT0_($3, $6, $2) | 0; + HEAP32[HEAP32[$5 >> 2] >> 2] = $9; + } + $13 = HEAP32[HEAP32[$0 + 8 >> 2] >> 2] | 0; + if ($13 | 0) HEAP8[$13 + 1 >> 0] = 0; + $$0 = (HEAP32[HEAP32[$5 >> 2] >> 2] | 0) != 0; + } + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNSt3__26vectorItNS_9allocatorItEEE26__swap_out_circular_bufferERNS_14__split_bufferItRS2_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$pre$phiZ2D = 0, $11 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $3 = 0, $5 = 0, $7 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $7 = (HEAP32[$3 >> 2] | 0) - $2 | 0; + $11 = (HEAP32[$5 >> 2] | 0) + (0 - ($7 >> 1) << 1) | 0; + HEAP32[$5 >> 2] = $11; + if (($7 | 0) > 0) { + _memcpy($11 | 0, $2 | 0, $7 | 0) | 0; + $$pre$phiZ2D = $5; + $15 = HEAP32[$5 >> 2] | 0; + } else { + $$pre$phiZ2D = $5; + $15 = $11; + } + $14 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $15; + HEAP32[$$pre$phiZ2D >> 2] = $14; + $16 = $1 + 8 | 0; + $17 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$16 >> 2]; + HEAP32[$16 >> 2] = $17; + $19 = $0 + 8 | 0; + $20 = $1 + 12 | 0; + $21 = HEAP32[$19 >> 2] | 0; + HEAP32[$19 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$20 >> 2] = $21; + HEAP32[$1 >> 2] = HEAP32[$$pre$phiZ2D >> 2]; + return; +} + +function __ZNSt3__26vectorIiNS_9allocatorIiEEE26__swap_out_circular_bufferERNS_14__split_bufferIiRS2_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$pre$phiZ2D = 0, $11 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $3 = 0, $5 = 0, $7 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $7 = (HEAP32[$3 >> 2] | 0) - $2 | 0; + $11 = (HEAP32[$5 >> 2] | 0) + (0 - ($7 >> 2) << 2) | 0; + HEAP32[$5 >> 2] = $11; + if (($7 | 0) > 0) { + _memcpy($11 | 0, $2 | 0, $7 | 0) | 0; + $$pre$phiZ2D = $5; + $15 = HEAP32[$5 >> 2] | 0; + } else { + $$pre$phiZ2D = $5; + $15 = $11; + } + $14 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $15; + HEAP32[$$pre$phiZ2D >> 2] = $14; + $16 = $1 + 8 | 0; + $17 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$16 >> 2]; + HEAP32[$16 >> 2] = $17; + $19 = $0 + 8 | 0; + $20 = $1 + 12 | 0; + $21 = HEAP32[$19 >> 2] | 0; + HEAP32[$19 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$20 >> 2] = $21; + HEAP32[$1 >> 2] = HEAP32[$$pre$phiZ2D >> 2]; + return; +} + +function __ZNSt3__26vectorIfNS_9allocatorIfEEE26__swap_out_circular_bufferERNS_14__split_bufferIfRS2_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$pre$phiZ2D = 0, $11 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $3 = 0, $5 = 0, $7 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $7 = (HEAP32[$3 >> 2] | 0) - $2 | 0; + $11 = (HEAP32[$5 >> 2] | 0) + (0 - ($7 >> 2) << 2) | 0; + HEAP32[$5 >> 2] = $11; + if (($7 | 0) > 0) { + _memcpy($11 | 0, $2 | 0, $7 | 0) | 0; + $$pre$phiZ2D = $5; + $15 = HEAP32[$5 >> 2] | 0; + } else { + $$pre$phiZ2D = $5; + $15 = $11; + } + $14 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $15; + HEAP32[$$pre$phiZ2D >> 2] = $14; + $16 = $1 + 8 | 0; + $17 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$16 >> 2]; + HEAP32[$16 >> 2] = $17; + $19 = $0 + 8 | 0; + $20 = $1 + 12 | 0; + $21 = HEAP32[$19 >> 2] | 0; + HEAP32[$19 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$20 >> 2] = $21; + HEAP32[$1 >> 2] = HEAP32[$$pre$phiZ2D >> 2]; + return; +} + +function __ZN6vision23AccumulateScaledVector9IfEEvPT_PKS1_S1_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = +$2; + var $10 = 0, $16 = 0, $22 = 0, $28 = 0, $34 = 0, $40 = 0, $46 = 0, $52 = 0; + HEAPF32[$0 >> 2] = +HEAPF32[$0 >> 2] + +HEAPF32[$1 >> 2] * $2; + $10 = $0 + 4 | 0; + HEAPF32[$10 >> 2] = +HEAPF32[$10 >> 2] + +HEAPF32[$1 + 4 >> 2] * $2; + $16 = $0 + 8 | 0; + HEAPF32[$16 >> 2] = +HEAPF32[$16 >> 2] + +HEAPF32[$1 + 8 >> 2] * $2; + $22 = $0 + 12 | 0; + HEAPF32[$22 >> 2] = +HEAPF32[$22 >> 2] + +HEAPF32[$1 + 12 >> 2] * $2; + $28 = $0 + 16 | 0; + HEAPF32[$28 >> 2] = +HEAPF32[$28 >> 2] + +HEAPF32[$1 + 16 >> 2] * $2; + $34 = $0 + 20 | 0; + HEAPF32[$34 >> 2] = +HEAPF32[$34 >> 2] + +HEAPF32[$1 + 20 >> 2] * $2; + $40 = $0 + 24 | 0; + HEAPF32[$40 >> 2] = +HEAPF32[$40 >> 2] + +HEAPF32[$1 + 24 >> 2] * $2; + $46 = $0 + 28 | 0; + HEAPF32[$46 >> 2] = +HEAPF32[$46 >> 2] + +HEAPF32[$1 + 28 >> 2] * $2; + $52 = $0 + 32 | 0; + HEAPF32[$52 >> 2] = +HEAPF32[$52 >> 2] + +HEAPF32[$1 + 32 >> 2] * $2; + return; +} + +function __ZN12arControllerC2Ev($this) { + $this = $this | 0; + var $__begin_$i$i = 0, $surfaceSets = 0, $videoLuma = 0; + HEAP32[$this + 192 >> 2] = 0; + HEAP32[$this + 196 >> 2] = 0; + $videoLuma = $this + 204 | 0; + HEAP32[$videoLuma >> 2] = 0; + HEAP32[$videoLuma + 4 >> 2] = 0; + HEAP32[$videoLuma + 8 >> 2] = 0; + HEAP32[$videoLuma + 12 >> 2] = 0; + HEAP32[$videoLuma + 16 >> 2] = 0; + HEAP32[$videoLuma + 20 >> 2] = 0; + HEAP32[$this + 240 >> 2] = -2; + HEAP32[$this + 244 >> 2] = 0; + $surfaceSets = $this + 288 | 0; + HEAP32[$surfaceSets >> 2] = 0; + HEAP32[$surfaceSets + 4 >> 2] = 0; + HEAP32[$surfaceSets + 8 >> 2] = 0; + HEAP32[$surfaceSets + 12 >> 2] = 0; + HEAP32[$this + 304 >> 2] = 1065353216; + HEAPF64[$this + 312 >> 3] = .0001; + HEAPF64[$this + 320 >> 3] = 1.0e3; + $__begin_$i$i = $this + 328 | 0; + HEAP32[$__begin_$i$i >> 2] = 0; + HEAP32[$__begin_$i$i + 4 >> 2] = 0; + HEAP32[$__begin_$i$i + 8 >> 2] = 0; + HEAP32[$__begin_$i$i + 12 >> 2] = 0; + HEAP32[$this + 472 >> 2] = 2; + return; +} + +function ___fseeko_unlocked($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $12 = 0, $14 = 0, $16 = 0, $26 = 0, $27 = 0, $9 = 0, label = 0; + if (($3 | 0) == 1) { + $9 = (HEAP32[$0 + 8 >> 2] | 0) - (HEAP32[$0 + 4 >> 2] | 0) | 0; + $12 = _i64Subtract($1 | 0, $2 | 0, $9 | 0, (($9 | 0) < 0) << 31 >> 31 | 0) | 0; + $26 = $12; + $27 = getTempRet0() | 0; + } else { + $26 = $1; + $27 = $2; + } + $14 = $0 + 20 | 0; + $16 = $0 + 28 | 0; + if ((HEAP32[$14 >> 2] | 0) >>> 0 > (HEAP32[$16 >> 2] | 0) >>> 0 ? (FUNCTION_TABLE_iiii[HEAP32[$0 + 36 >> 2] & 63]($0, 0, 0) | 0, (HEAP32[$14 >> 2] | 0) == 0) : 0) $$0 = -1; else { + HEAP32[$0 + 16 >> 2] = 0; + HEAP32[$16 >> 2] = 0; + HEAP32[$14 >> 2] = 0; + FUNCTION_TABLE_iiiii[HEAP32[$0 + 40 >> 2] & 15]($0, $26, $27, $3) | 0; + if ((getTempRet0() | 0) < 0) $$0 = -1; else { + HEAP32[$0 + 8 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 >> 2] = HEAP32[$0 >> 2] & -17; + $$0 = 0; + } + } + return $$0 | 0; +} + +function _setThreshold($id, $threshold) { + $id = $id | 0; + $threshold = $threshold | 0; + var $call7 = 0, $id$addr = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $id$addr = sp + 4 | 0; + HEAP32[$id$addr >> 2] = $id; + if ((__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0 ? ($call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0, $threshold >>> 0 <= 255) : 0) ? (_arSetLabelingThresh(HEAP32[$call7 + 216 >> 2] | 0, $threshold) | 0) == 0 : 0) { + HEAP32[$vararg_buffer >> 2] = $threshold; + _arLog(0, 1, 41674, $vararg_buffer); + } + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorIhNS_9allocatorIhEEE26__swap_out_circular_bufferERNS_14__split_bufferIhRS2_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$pre$phiZ2D = 0, $10 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $3 = 0, $5 = 0, $7 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $7 = (HEAP32[$3 >> 2] | 0) - $2 | 0; + $10 = (HEAP32[$5 >> 2] | 0) + (0 - $7) | 0; + HEAP32[$5 >> 2] = $10; + if (($7 | 0) > 0) { + _memcpy($10 | 0, $2 | 0, $7 | 0) | 0; + $$pre$phiZ2D = $5; + $14 = HEAP32[$5 >> 2] | 0; + } else { + $$pre$phiZ2D = $5; + $14 = $10; + } + $13 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $14; + HEAP32[$$pre$phiZ2D >> 2] = $13; + $15 = $1 + 8 | 0; + $16 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$15 >> 2]; + HEAP32[$15 >> 2] = $16; + $18 = $0 + 8 | 0; + $19 = $1 + 12 | 0; + $20 = HEAP32[$18 >> 2] | 0; + HEAP32[$18 >> 2] = HEAP32[$19 >> 2]; + HEAP32[$19 >> 2] = $20; + HEAP32[$1 >> 2] = HEAP32[$$pre$phiZ2D >> 2]; + return; +} + +function _getThresholdMode($id) { + $id = $id | 0; + var $arhandle = 0, $cmp = 0, $id$addr = 0, $retval$1 = 0, $thresholdMode = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + $thresholdMode = sp + 4 | 0; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$1 = -1; else { + $arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0; + $cmp = (_arGetLabelingThreshMode(HEAP32[$arhandle >> 2] | 0, $thresholdMode) | 0) == 0; + $retval$1 = $cmp ? HEAP32[$thresholdMode >> 2] | 0 : -1; + } + STACKTOP = sp; + return $retval$1 | 0; +} + +function __ZNSt3__211__stdoutbufIwE4syncEv($0) { + $0 = $0 | 0; + var $$2 = 0, $1 = 0, $13 = 0, $15 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp + 8 | 0; + $2 = sp; + $3 = $0 + 36 | 0; + $4 = $0 + 40 | 0; + $5 = $1 + 8 | 0; + $6 = $1; + $7 = $0 + 32 | 0; + L1 : while (1) { + $8 = HEAP32[$3 >> 2] | 0; + $13 = FUNCTION_TABLE_iiiiii[HEAP32[(HEAP32[$8 >> 2] | 0) + 20 >> 2] & 31]($8, HEAP32[$4 >> 2] | 0, $1, $5, $2) | 0; + $15 = (HEAP32[$2 >> 2] | 0) - $6 | 0; + if ((_fwrite($1, 1, $15, HEAP32[$7 >> 2] | 0) | 0) != ($15 | 0)) { + $$2 = -1; + break; + } + switch ($13 | 0) { + case 1: + break; + case 2: + { + $$2 = -1; + break L1; + break; + } + default: + { + label = 4; + break L1; + } + } + } + if ((label | 0) == 4) $$2 = ((_fflush(HEAP32[$7 >> 2] | 0) | 0) != 0) << 31 >> 31; + STACKTOP = sp; + return $$2 | 0; +} + +function __ZNSt3__211__stdoutbufIcE4syncEv($0) { + $0 = $0 | 0; + var $$2 = 0, $1 = 0, $13 = 0, $15 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp + 8 | 0; + $2 = sp; + $3 = $0 + 36 | 0; + $4 = $0 + 40 | 0; + $5 = $1 + 8 | 0; + $6 = $1; + $7 = $0 + 32 | 0; + L1 : while (1) { + $8 = HEAP32[$3 >> 2] | 0; + $13 = FUNCTION_TABLE_iiiiii[HEAP32[(HEAP32[$8 >> 2] | 0) + 20 >> 2] & 31]($8, HEAP32[$4 >> 2] | 0, $1, $5, $2) | 0; + $15 = (HEAP32[$2 >> 2] | 0) - $6 | 0; + if ((_fwrite($1, 1, $15, HEAP32[$7 >> 2] | 0) | 0) != ($15 | 0)) { + $$2 = -1; + break; + } + switch ($13 | 0) { + case 1: + break; + case 2: + { + $$2 = -1; + break L1; + break; + } + default: + { + label = 4; + break L1; + } + } + } + if ((label | 0) == 4) $$2 = ((_fflush(HEAP32[$7 >> 2] | 0) | 0) != 0) << 31 >> 31; + STACKTOP = sp; + return $$2 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13FunctionParam9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $11 = 0, $2 = 0, $3 = 0, $5 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $tmpcast$byval_copy = sp + 16 | 0; + $2 = sp + 8 | 0; + $3 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 54911); + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast$byval_copy); + $5 = $0 + 8 | 0; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $3; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast$byval_copy); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE7reserveEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$in = 0, $$pre$phi11Z2D = 0, $11 = 0, $15 = 0, $2 = 0, $5 = 0, $7 = 0, $8 = 0; + $2 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($0) | 0; + do if (!(__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE8isInlineEv($0) | 0)) { + $15 = _realloc(HEAP32[$0 >> 2] | 0, $1 << 2) | 0; + HEAP32[$0 >> 2] = $15; + if (!$15) __ZSt9terminatev(); else { + $$in = $15; + $$pre$phi11Z2D = $0 + 4 | 0; + break; + } + } else { + $5 = _malloc($1 << 2) | 0; + if (!$5) __ZSt9terminatev(); + $7 = HEAP32[$0 >> 2] | 0; + $8 = $0 + 4 | 0; + $11 = (HEAP32[$8 >> 2] | 0) - $7 | 0; + if ($11 | 0) _memmove($5 | 0, $7 | 0, $11 | 0) | 0; + HEAP32[$0 >> 2] = $5; + $$in = $5; + $$pre$phi11Z2D = $8; + } while (0); + HEAP32[$$pre$phi11Z2D >> 2] = $$in + ($2 << 2); + HEAP32[$0 + 8 >> 2] = $$in + ($1 << 2); + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10BinaryExprEJRPNS2_4NodeERNS_10StringViewES6_EEEPT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $12 = 0, $13 = 0, $17 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $4 = sp; + $5 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 24) | 0; + $6 = HEAP32[$1 >> 2] | 0; + $7 = $2; + $12 = HEAP32[$7 + 4 >> 2] | 0; + $13 = $4; + HEAP32[$13 >> 2] = HEAP32[$7 >> 2]; + HEAP32[$13 + 4 >> 2] = $12; + $17 = HEAP32[$3 >> 2] | 0; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle10BinaryExprC2EPKNS0_4NodeENS_10StringViewES4_($5, $6, $tmpcast$byval_copy, $17); + STACKTOP = sp; + return $5 | 0; +} + +function _getImageProcMode($id) { + $id = $id | 0; + var $arhandle = 0, $cmp = 0, $id$addr = 0, $imageProcMode = 0, $retval$1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + $imageProcMode = sp + 4 | 0; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$1 = -1; else { + $arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0; + $cmp = (_arGetImageProcMode(HEAP32[$arhandle >> 2] | 0, $imageProcMode) | 0) == 0; + $retval$1 = $cmp ? HEAP32[$imageProcMode >> 2] | 0 : -1; + } + STACKTOP = sp; + return $retval$1 | 0; +} + +function __ZN6vision21HoughSimilarityVoting4initEffffiiii($0, $1, $2, $3, $4, $5, $6, $7, $8) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + $3 = +$3; + $4 = +$4; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + var $19 = 0, $21 = 0; + HEAPF32[$0 + 20 >> 2] = $1; + HEAPF32[$0 + 24 >> 2] = $2; + HEAPF32[$0 + 28 >> 2] = $3; + HEAPF32[$0 + 32 >> 2] = $4; + HEAPF32[$0 + 36 >> 2] = -1.0; + HEAPF32[$0 + 40 >> 2] = 1.0; + HEAP32[$0 + 52 >> 2] = $5; + HEAP32[$0 + 56 >> 2] = $6; + HEAP32[$0 + 60 >> 2] = $7; + HEAP32[$0 + 64 >> 2] = $8; + $19 = Math_imul($6, $5) | 0; + HEAP32[$0 + 84 >> 2] = $19; + $21 = Math_imul($19, $7) | 0; + HEAP32[$0 + 88 >> 2] = $21; + HEAPF32[$0 + 44 >> 2] = 10.0; + HEAPF32[$0 + 48 >> 2] = .4342944622039795; + HEAP8[$0 + 16 >> 0] = ($6 | $5 | 0) == 0 & 1; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEE5clearEv($0 + 92 | 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE7reserveEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$in = 0, $$pre$phi11Z2D = 0, $11 = 0, $15 = 0, $2 = 0, $5 = 0, $7 = 0, $8 = 0; + $2 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE4sizeEv($0) | 0; + do if (!(__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE8isInlineEv($0) | 0)) { + $15 = _realloc(HEAP32[$0 >> 2] | 0, $1 << 2) | 0; + HEAP32[$0 >> 2] = $15; + if (!$15) __ZSt9terminatev(); else { + $$in = $15; + $$pre$phi11Z2D = $0 + 4 | 0; + break; + } + } else { + $5 = _malloc($1 << 2) | 0; + if (!$5) __ZSt9terminatev(); + $7 = HEAP32[$0 >> 2] | 0; + $8 = $0 + 4 | 0; + $11 = (HEAP32[$8 >> 2] | 0) - $7 | 0; + if ($11 | 0) _memmove($5 | 0, $7 | 0, $11 | 0) | 0; + HEAP32[$0 >> 2] = $5; + $$in = $5; + $$pre$phi11Z2D = $8; + } while (0); + HEAP32[$$pre$phi11Z2D >> 2] = $$in + ($2 << 2); + HEAP32[$0 + 8 >> 2] = $$in + ($1 << 2); + return; +} + +function _gray_rgb_convert($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$02025$us = 0, $$02126$us = 0, $$02224$us = 0, $$027$us = 0, $$in = 0, $12 = 0, $15 = 0, $6 = 0, $$in$looptemp = 0; + $6 = HEAP32[$0 + 112 >> 2] | 0; + if (($4 | 0) < 1 | ($6 | 0) == 0) return; + $$02126$us = $3; + $$027$us = $2; + $$in = $4; + while (1) { + $$in$looptemp = $$in; + $$in = $$in + -1 | 0; + $12 = HEAP32[(HEAP32[$1 >> 2] | 0) + ($$027$us << 2) >> 2] | 0; + $$02025$us = 0; + $$02224$us = HEAP32[$$02126$us >> 2] | 0; + while (1) { + $15 = HEAP8[$12 + $$02025$us >> 0] | 0; + HEAP8[$$02224$us + 2 >> 0] = $15; + HEAP8[$$02224$us + 1 >> 0] = $15; + HEAP8[$$02224$us >> 0] = $15; + $$02025$us = $$02025$us + 1 | 0; + if (($$02025$us | 0) == ($6 | 0)) break; else $$02224$us = $$02224$us + 3 | 0; + } + if (($$in$looptemp | 0) <= 1) break; else { + $$02126$us = $$02126$us + 4 | 0; + $$027$us = $$027$us + 1 | 0; + } + } + return; +} + +function _strlen($0) { + $0 = $0 | 0; + var $$0 = 0, $$015$lcssa = 0, $$01518 = 0, $$1$lcssa = 0, $$pn = 0, $$pn29 = 0, $1 = 0, $10 = 0, $19 = 0, $22 = 0, $6 = 0, label = 0; + $1 = $0; + L1 : do if (!($1 & 3)) { + $$015$lcssa = $0; + label = 5; + } else { + $$01518 = $0; + $22 = $1; + while (1) { + if (!(HEAP8[$$01518 >> 0] | 0)) { + $$pn = $22; + break L1; + } + $6 = $$01518 + 1 | 0; + $22 = $6; + if (!($22 & 3)) { + $$015$lcssa = $6; + label = 5; + break; + } else $$01518 = $6; + } + } while (0); + if ((label | 0) == 5) { + $$0 = $$015$lcssa; + while (1) { + $10 = HEAP32[$$0 >> 2] | 0; + if (!(($10 & -2139062144 ^ -2139062144) & $10 + -16843009)) $$0 = $$0 + 4 | 0; else break; + } + if (!(($10 & 255) << 24 >> 24)) $$1$lcssa = $$0; else { + $$pn29 = $$0; + while (1) { + $19 = $$pn29 + 1 | 0; + if (!(HEAP8[$19 >> 0] | 0)) { + $$1$lcssa = $19; + break; + } else $$pn29 = $19; + } + } + $$pn = $$1$lcssa; + } + return $$pn - $1 | 0; +} + +function _ar2CreateHandleSubMod($pixFormat, $xsize, $ysize) { + $pixFormat = $pixFormat | 0; + $xsize = $xsize | 0; + $ysize = $ysize | 0; + var $call = 0, $call10 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $call = _malloc(13732) | 0; + if (!$call) { + _arLog(0, 3, 45930, sp); + _exit(1); + } + HEAP32[$call + 20 >> 2] = $pixFormat; + HEAP32[$call + 4 >> 2] = $xsize; + HEAP32[$call + 8 >> 2] = $ysize; + HEAP32[$call + 24 >> 2] = 25; + HEAP32[$call + 28 >> 2] = 11; + HEAP32[$call + 32 >> 2] = 11; + HEAP32[$call + 36 >> 2] = 10; + HEAPF32[$call + 40 >> 2] = .6000000238418579; + HEAPF32[$call + 44 >> 2] = 2.0; + HEAP32[$call + 13280 >> 2] = 1; + $call10 = _malloc(Math_imul($ysize, $xsize) | 0) | 0; + HEAP32[$call + 13300 >> 2] = $call10; + if (!$call10) { + _arLog(0, 3, 45930, sp + 8 | 0); + _exit(1); + } else { + HEAP32[$call + 13304 >> 2] = 0; + STACKTOP = sp; + return $call | 0; + } + return 0; +} + +function _getLabelingMode($id) { + $id = $id | 0; + var $arhandle = 0, $cmp = 0, $id$addr = 0, $labelingMode = 0, $retval$1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + $labelingMode = sp + 4 | 0; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$1 = -1; else { + $arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0; + $cmp = (_arGetLabelingMode(HEAP32[$arhandle >> 2] | 0, $labelingMode) | 0) == 0; + $retval$1 = $cmp ? HEAP32[$labelingMode >> 2] | 0 : -1; + } + STACKTOP = sp; + return $retval$1 | 0; +} + +function _color_quantize3($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$04347 = 0, $$04449 = 0, $$04546 = 0, $$048 = 0, $10 = 0, $12 = 0, $14 = 0, $7 = 0, $8 = 0; + $7 = HEAP32[(HEAP32[$0 + 484 >> 2] | 0) + 24 >> 2] | 0; + $8 = HEAP32[$7 >> 2] | 0; + $10 = HEAP32[$7 + 4 >> 2] | 0; + $12 = HEAP32[$7 + 8 >> 2] | 0; + $14 = HEAP32[$0 + 112 >> 2] | 0; + if (($3 | 0) < 1 | ($14 | 0) == 0) return; + $$04449 = 0; + do { + $$04347 = $14; + $$04546 = HEAP32[$2 + ($$04449 << 2) >> 2] | 0; + $$048 = HEAP32[$1 + ($$04449 << 2) >> 2] | 0; + while (1) { + HEAP8[$$04546 >> 0] = (HEAPU8[$10 + (HEAPU8[$$048 + 1 >> 0] | 0) >> 0] | 0) + (HEAPU8[$8 + (HEAPU8[$$048 >> 0] | 0) >> 0] | 0) + (HEAPU8[$12 + (HEAPU8[$$048 + 2 >> 0] | 0) >> 0] | 0); + $$04347 = $$04347 + -1 | 0; + if (!$$04347) break; else { + $$04546 = $$04546 + 1 | 0; + $$048 = $$048 + 3 | 0; + } + } + $$04449 = $$04449 + 1 | 0; + } while (($$04449 | 0) != ($3 | 0)); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle19PointerToMemberType10printRightERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, $8 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = $0 + 12 | 0; + if (!(__ZNK12_GLOBAL__N_116itanium_demangle4Node8hasArrayERNS_12OutputStreamE(HEAP32[$3 >> 2] | 0, $1) | 0) ? !(__ZNK12_GLOBAL__N_116itanium_demangle4Node11hasFunctionERNS_12OutputStreamE(HEAP32[$3 >> 2] | 0, $1) | 0) : 0) {} else { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51964); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + } + $8 = HEAP32[$3 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$8 >> 2] | 0) + 20 >> 2] & 255]($8, $1); + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $11 = 0, $17 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + $7 = $0 + 8 | 0; + $11 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$7 >> 2] | 0) + 4 >> 2] & 127]($7) | 0; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $17 = (__ZNSt3__214__scan_keywordINS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEPKNS_12basic_stringIwS3_NS_9allocatorIwEEEENS_5ctypeIwEEEET0_RT_SE_SD_SD_RKT1_Rjb($2, $$byval_copy, $11, $11 + 288 | 0, $5, $4, 0) | 0) - $11 | 0; + if (($17 | 0) < 288) HEAP32[$1 >> 2] = (($17 | 0) / 12 | 0 | 0) % 12 | 0; + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $11 = 0, $17 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + $7 = $0 + 8 | 0; + $11 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$7 >> 2] | 0) + 4 >> 2] & 127]($7) | 0; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $17 = (__ZNSt3__214__scan_keywordINS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEPKNS_12basic_stringIcS3_NS_9allocatorIcEEEENS_5ctypeIcEEEET0_RT_SE_SD_SD_RKT1_Rjb($2, $$byval_copy, $11, $11 + 288 | 0, $5, $4, 0) | 0) - $11 | 0; + if (($17 | 0) < 288) HEAP32[$1 >> 2] = (($17 | 0) / 12 | 0 | 0) % 12 | 0; + STACKTOP = sp; + return; +} + +function __ZNKSt3__210__time_put8__do_putEPwRS1_PK2tmcc($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $11 = 0, $16 = 0, $18 = 0, $19 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 128 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(128); + $6 = sp; + $7 = sp + 116 | 0; + $8 = sp + 104 | 0; + $9 = sp + 112 | 0; + HEAP32[$7 >> 2] = $6 + 100; + __ZNKSt3__210__time_put8__do_putEPcRS1_PK2tmcc($0, $6, $7, $3, $4, $5); + $11 = $8; + HEAP32[$11 >> 2] = 0; + HEAP32[$11 + 4 >> 2] = 0; + HEAP32[$9 >> 2] = $6; + $16 = __ZNSt3__212_GLOBAL__N_17countofIwEEmPKT_S4_($1, HEAP32[$2 >> 2] | 0) | 0; + $18 = ___uselocale(HEAP32[$0 >> 2] | 0) | 0; + $19 = _mbsrtowcs($1, $9, $16, $8) | 0; + if ($18 | 0) ___uselocale($18) | 0; + if (($19 | 0) == -1) __ZNSt3__221__throw_runtime_errorEPKc(0); else { + HEAP32[$2 >> 2] = $1 + ($19 << 2); + STACKTOP = sp; + return; + } +} + +function __ZNK10__cxxabiv117__class_type_info16search_below_dstEPNS_19__dynamic_cast_infoEPKvib($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $13 = 0, $19 = 0; + do if (!(__ZL8is_equalPKSt9type_infoS1_b($0, HEAP32[$1 + 8 >> 2] | 0, $4) | 0)) { + if (__ZL8is_equalPKSt9type_infoS1_b($0, HEAP32[$1 >> 2] | 0, $4) | 0) { + if ((HEAP32[$1 + 16 >> 2] | 0) != ($2 | 0) ? ($13 = $1 + 20 | 0, (HEAP32[$13 >> 2] | 0) != ($2 | 0)) : 0) { + HEAP32[$1 + 32 >> 2] = $3; + HEAP32[$13 >> 2] = $2; + $19 = $1 + 40 | 0; + HEAP32[$19 >> 2] = (HEAP32[$19 >> 2] | 0) + 1; + if ((HEAP32[$1 + 36 >> 2] | 0) == 1 ? (HEAP32[$1 + 24 >> 2] | 0) == 2 : 0) HEAP8[$1 + 54 >> 0] = 1; + HEAP32[$1 + 44 >> 2] = 4; + break; + } + if (($3 | 0) == 1) HEAP32[$1 + 32 >> 2] = 1; + } + } else __ZNK10__cxxabiv117__class_type_info29process_static_type_below_dstEPNS_19__dynamic_cast_infoEPKvi(0, $1, $2, $3); while (0); + return; +} + +function _setPatternDetectionMode($id, $mode) { + $id = $id | 0; + $mode = $mode | 0; + var $arhandle = 0, $id$addr = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $id$addr = sp + 4 | 0; + HEAP32[$id$addr >> 2] = $id; + if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0 ? ($arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0, (_arSetPatternDetectionMode(HEAP32[$arhandle >> 2] | 0, $mode) | 0) == 0) : 0) { + HEAP32[$vararg_buffer >> 2] = $mode; + _arLog(0, 1, 41639, $vararg_buffer); + } + STACKTOP = sp; + return; +} + +function _getThreshold($id) { + $id = $id | 0; + var $arhandle = 0, $cmp = 0, $id$addr = 0, $retval$1 = 0, $threshold = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + $threshold = sp + 4 | 0; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$1 = -1; else { + $arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0; + $cmp = (_arGetLabelingThresh(HEAP32[$arhandle >> 2] | 0, $threshold) | 0) == 0; + $retval$1 = $cmp ? HEAP32[$threshold >> 2] | 0 : -1; + } + STACKTOP = sp; + return $retval$1 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20parsePositiveIntegerEPm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $10 = 0, $12 = 0, $7 = 0; + HEAP32[$1 >> 2] = 0; + L1 : do if (((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) + -48 & 255) > 9) $$0 = 1; else { + $7 = 0; + while (1) { + if (((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0) + -48 & 255) >= 10) { + $$0 = 0; + break L1; + } + HEAP32[$1 >> 2] = $7 * 10; + $10 = ((__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E7consumeEv($0) | 0) << 24 >> 24) + -48 | 0; + $12 = $10 + (HEAP32[$1 >> 2] | 0) | 0; + HEAP32[$1 >> 2] = $12; + $7 = $12; + } + } while (0); + return $$0 | 0; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $10 = 0, $16 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + $7 = $0 + 8 | 0; + $10 = FUNCTION_TABLE_ii[HEAP32[HEAP32[$7 >> 2] >> 2] & 127]($7) | 0; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $16 = (__ZNSt3__214__scan_keywordINS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEPKNS_12basic_stringIwS3_NS_9allocatorIwEEEENS_5ctypeIwEEEET0_RT_SE_SD_SD_RKT1_Rjb($2, $$byval_copy, $10, $10 + 168 | 0, $5, $4, 0) | 0) - $10 | 0; + if (($16 | 0) < 168) HEAP32[$1 >> 2] = (($16 | 0) / 12 | 0 | 0) % 7 | 0; + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $10 = 0, $16 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + $7 = $0 + 8 | 0; + $10 = FUNCTION_TABLE_ii[HEAP32[HEAP32[$7 >> 2] >> 2] & 127]($7) | 0; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $16 = (__ZNSt3__214__scan_keywordINS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEPKNS_12basic_stringIcS3_NS_9allocatorIcEEEENS_5ctypeIcEEEET0_RT_SE_SD_SD_RKT1_Rjb($2, $$byval_copy, $10, $10 + 168 | 0, $5, $4, 0) | 0) - $10 | 0; + if (($16 | 0) < 168) HEAP32[$1 >> 2] = (($16 | 0) / 12 | 0 | 0) % 7 | 0; + STACKTOP = sp; + return; +} + +function _getPatternDetectionMode($id) { + $id = $id | 0; + var $arhandle = 0, $cmp = 0, $id$addr = 0, $mode = 0, $retval$1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + $mode = sp + 4 | 0; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$1 = -1; else { + $arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0; + $cmp = (_arGetPatternDetectionMode(HEAP32[$arhandle >> 2] | 0, $mode) | 0) == 0; + $retval$1 = $cmp ? HEAP32[$mode >> 2] | 0 : -1; + } + STACKTOP = sp; + return $retval$1 | 0; +} + +function __ZNSt3__29__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $10 = 0, $14 = 0, $18 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $5 = sp; + __ZNKSt3__28ios_base6getlocEv($5, $1); + $6 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66544) | 0; + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$6 >> 2] | 0) + 48 >> 2] & 15]($6, 12928, 12960, $2) | 0; + $10 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66552) | 0; + $14 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$10 >> 2] | 0) + 12 >> 2] & 127]($10) | 0; + HEAP32[$3 >> 2] = $14; + $18 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$10 >> 2] | 0) + 16 >> 2] & 127]($10) | 0; + HEAP32[$4 >> 2] = $18; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$10 >> 2] | 0) + 20 >> 2] & 255]($0, $10); + __ZNSt3__26localeD2Ev($5); + STACKTOP = sp; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle16FunctionEncoding9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, $4 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = $0 + 8 | 0; + $4 = HEAP32[$3 >> 2] | 0; + if ($4 | 0 ? (FUNCTION_TABLE_vii[HEAP32[(HEAP32[$4 >> 2] | 0) + 16 >> 2] & 255]($4, $1), !(__ZNK12_GLOBAL__N_116itanium_demangle4Node15hasRHSComponentERNS_12OutputStreamE(HEAP32[$3 >> 2] | 0, $1) | 0)) : 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51966); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + } + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 12 >> 2] | 0, $1); + STACKTOP = sp; + return; +} + +function _setThresholdMode($id, $mode) { + $id = $id | 0; + $mode = $mode | 0; + var $arhandle = 0, $id$addr = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $id$addr = sp + 4 | 0; + HEAP32[$id$addr >> 2] = $id; + if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0 ? ($arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0, (_arSetLabelingThreshMode(HEAP32[$arhandle >> 2] | 0, $mode) | 0) == 0) : 0) { + HEAP32[$vararg_buffer >> 2] = $mode; + _arLog(0, 1, 41700, $vararg_buffer); + } + STACKTOP = sp; + return; +} + +function __ZNSt3__29__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $10 = 0, $14 = 0, $18 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $5 = sp; + __ZNKSt3__28ios_base6getlocEv($5, $1); + $6 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66512) | 0; + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$6 >> 2] | 0) + 32 >> 2] & 15]($6, 12928, 12960, $2) | 0; + $10 = __ZNKSt3__26locale9use_facetERNS0_2idE($5, 66528) | 0; + $14 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$10 >> 2] | 0) + 12 >> 2] & 127]($10) | 0; + HEAP8[$3 >> 0] = $14; + $18 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$10 >> 2] | 0) + 16 >> 2] & 127]($10) | 0; + HEAP8[$4 >> 0] = $18; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$10 >> 2] | 0) + 20 >> 2] & 255]($0, $10); + __ZNSt3__26localeD2Ev($5); + STACKTOP = sp; + return; +} + +function __ZN6vision29SolveNullVector8x9DestructiveIfEEbPT_S2_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 288 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(288); + $2 = sp; + if (((((((__ZN6vision27OrthogonalizePivot8x9Basis0IfEEbPT_S2_($2, $1) | 0 ? __ZN6vision27OrthogonalizePivot8x9Basis1IfEEbPT_S2_($2, $1) | 0 : 0) ? __ZN6vision27OrthogonalizePivot8x9Basis2IfEEbPT_S2_($2, $1) | 0 : 0) ? __ZN6vision27OrthogonalizePivot8x9Basis3IfEEbPT_S2_($2, $1) | 0 : 0) ? __ZN6vision27OrthogonalizePivot8x9Basis4IfEEbPT_S2_($2, $1) | 0 : 0) ? __ZN6vision27OrthogonalizePivot8x9Basis5IfEEbPT_S2_($2, $1) | 0 : 0) ? __ZN6vision27OrthogonalizePivot8x9Basis6IfEEbPT_S2_($2, $1) | 0 : 0) ? __ZN6vision27OrthogonalizePivot8x9Basis7IfEEbPT_S2_($2, $1) | 0 : 0) $$0 = __ZN6vision24OrthogonalizeIdentity8x9IfEEbPT_PKS1_($0, $2) | 0; else $$0 = 0; + STACKTOP = sp; + return $$0 | 0; +} + +function _setImageProcMode($id, $mode) { + $id = $id | 0; + $mode = $mode | 0; + var $arhandle = 0, $id$addr = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $id$addr = sp + 4 | 0; + HEAP32[$id$addr >> 2] = $id; + if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0 ? ($arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0, (_arSetImageProcMode(HEAP32[$arhandle >> 2] | 0, $mode) | 0) == 0) : 0) { + HEAP32[$vararg_buffer >> 2] = $mode; + _arLog(0, 1, 41549, $vararg_buffer); + } + STACKTOP = sp; + return; +} + +function __ZNK10__cxxabiv121__vmi_class_type_info27has_unambiguous_public_baseEPNS_19__dynamic_cast_infoEPvi($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $10 = 0, $13 = 0, $9 = 0; + L1 : do if (!(__ZL8is_equalPKSt9type_infoS1_b($0, HEAP32[$1 + 8 >> 2] | 0, 0) | 0)) { + $9 = HEAP32[$0 + 12 >> 2] | 0; + $10 = $0 + 16 + ($9 << 3) | 0; + __ZNK10__cxxabiv122__base_class_type_info27has_unambiguous_public_baseEPNS_19__dynamic_cast_infoEPvi($0 + 16 | 0, $1, $2, $3); + if (($9 | 0) > 1) { + $13 = $1 + 54 | 0; + $$0 = $0 + 24 | 0; + do { + __ZNK10__cxxabiv122__base_class_type_info27has_unambiguous_public_baseEPNS_19__dynamic_cast_infoEPvi($$0, $1, $2, $3); + if (HEAP8[$13 >> 0] | 0) break L1; + $$0 = $$0 + 8 | 0; + } while ($$0 >>> 0 < $10 >>> 0); + } + } else __ZNK10__cxxabiv117__class_type_info24process_found_base_classEPNS_19__dynamic_cast_infoEPvi(0, $1, $2, $3); while (0); + return; +} + +function _setLabelingMode($id, $mode) { + $id = $id | 0; + $mode = $mode | 0; + var $arhandle = 0, $id$addr = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $id$addr = sp + 4 | 0; + HEAP32[$id$addr >> 2] = $id; + if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0 ? ($arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0, (_arSetLabelingMode(HEAP32[$arhandle >> 2] | 0, $mode) | 0) == 0) : 0) { + HEAP32[$vararg_buffer >> 2] = $mode; + _arLog(0, 1, 41578, $vararg_buffer); + } + STACKTOP = sp; + return; +} + +function _h2v1_upsample($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$02528 = 0, $$02627 = 0, $$029 = 0, $10 = 0, $11 = 0, $12 = 0, $17 = 0, $23 = 0, $24 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = 0; + $4 = HEAP32[$3 >> 2] | 0; + $5 = $0 + 320 | 0; + $6 = HEAP32[$5 >> 2] | 0; + if (($6 | 0) <= 0) return; + $8 = $0 + 112 | 0; + $$029 = 0; + $24 = $6; + while (1) { + $10 = HEAP32[$4 + ($$029 << 2) >> 2] | 0; + $11 = HEAP32[$8 >> 2] | 0; + $12 = $10 + $11 | 0; + if (($11 | 0) > 0) { + $$02528 = HEAP32[$2 + ($$029 << 2) >> 2] | 0; + $$02627 = $10; + while (1) { + $17 = HEAP8[$$02528 >> 0] | 0; + HEAP8[$$02627 >> 0] = $17; + HEAP8[$$02627 + 1 >> 0] = $17; + $$02627 = $$02627 + 2 | 0; + if ($$02627 >>> 0 >= $12 >>> 0) break; else $$02528 = $$02528 + 1 | 0; + } + $23 = HEAP32[$5 >> 2] | 0; + } else $23 = $24; + $$029 = $$029 + 1 | 0; + if (($$029 | 0) >= ($23 | 0)) break; else $24 = $23; + } + return; +} + +function _ar2GetImageValue($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = +$3; + $4 = +$4; + $5 = $5 | 0; + var $$0 = 0, $12 = 0.0, $16 = 0, $19 = 0, $22 = 0, $29 = 0, $33 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $6 = sp + 4 | 0; + $7 = sp; + if ((((_ar2ScreenCoord2MarkerCoord($0, $1, $3, $4, $6, $7) | 0) >= 0 ? ($12 = +HEAPF32[$2 + 12 >> 2], $16 = ~~(+HEAPF32[$6 >> 2] * $12 / 25.399999618530273 + .5), ($16 | 0) >= 0) : 0) ? ($19 = HEAP32[$2 + 4 >> 2] | 0, ($19 | 0) > ($16 | 0)) : 0) ? ($22 = HEAP32[$2 + 8 >> 2] | 0, $29 = ~~(+($22 | 0) - $12 * +HEAPF32[$7 >> 2] / 25.399999618530273 + .5), ($29 | 0) > -1 & ($22 | 0) > ($29 | 0)) : 0) { + $33 = (Math_imul($19, $29) | 0) + $16 | 0; + HEAP8[$5 >> 0] = HEAP8[(HEAP32[$2 >> 2] | 0) + $33 >> 0] | 0; + $$0 = 0; + } else $$0 = -1; + STACKTOP = sp; + return $$0 | 0; +} + +function _fputc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $13 = 0, $14 = 0, $20 = 0, $21 = 0, $26 = 0, $27 = 0, $33 = 0, $7 = 0, $8 = 0, label = 0; + if ((HEAP32[$1 + 76 >> 2] | 0) >= 0 ? (___lockfile($1) | 0) != 0 : 0) { + $20 = $0 & 255; + $21 = $0 & 255; + if (($21 | 0) != (HEAP8[$1 + 75 >> 0] | 0) ? ($26 = $1 + 20 | 0, $27 = HEAP32[$26 >> 2] | 0, $27 >>> 0 < (HEAP32[$1 + 16 >> 2] | 0) >>> 0) : 0) { + HEAP32[$26 >> 2] = $27 + 1; + HEAP8[$27 >> 0] = $20; + $33 = $21; + } else $33 = ___overflow($1, $0) | 0; + ___unlockfile($1); + $$0 = $33; + } else label = 3; + do if ((label | 0) == 3) { + $7 = $0 & 255; + $8 = $0 & 255; + if (($8 | 0) != (HEAP8[$1 + 75 >> 0] | 0) ? ($13 = $1 + 20 | 0, $14 = HEAP32[$13 >> 2] | 0, $14 >>> 0 < (HEAP32[$1 + 16 >> 2] | 0) >>> 0) : 0) { + HEAP32[$13 >> 2] = $14 + 1; + HEAP8[$14 >> 0] = $7; + $$0 = $8; + break; + } + $$0 = ___overflow($1, $0) | 0; + } while (0); + return $$0 | 0; +} + +function __ZNSt3__26vectorIN6vision5ImageENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i = 0, $12 = 0, $14 = 0, $15 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $3 = 0, $5 = 0, $9 = 0; + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $$0$i = HEAP32[$3 >> 2] | 0; + while (1) { + if (($$0$i | 0) == ($2 | 0)) break; + $9 = $$0$i + -32 | 0; + __ZN6vision5ImageC2ERKS0_((HEAP32[$5 >> 2] | 0) + -32 | 0, $9); + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + -32; + $$0$i = $9; + } + $12 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$5 >> 2] = $12; + $14 = $1 + 8 | 0; + $15 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$14 >> 2]; + HEAP32[$14 >> 2] = $15; + $17 = $0 + 8 | 0; + $18 = $1 + 12 | 0; + $19 = HEAP32[$17 >> 2] | 0; + HEAP32[$17 >> 2] = HEAP32[$18 >> 2]; + HEAP32[$18 >> 2] = $19; + HEAP32[$1 >> 2] = HEAP32[$5 >> 2]; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E19parseIntegerLiteralENS_10StringViewE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E11parseNumberEb($2, $0, 1); + if (!(__ZNK12_GLOBAL__N_110StringView5emptyEv($2) | 0) ? __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, 69) | 0 : 0) $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_14IntegerLiteralEJRNS_10StringViewES9_EEEPNS0_4NodeEDpOT0_($0, $1, $2) | 0; else $$0 = 0; + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle22ElaboratedTypeSpefTypeEJRNS_10StringViewERPNS2_4NodeEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $11 = 0, $15 = 0, $3 = 0, $4 = 0, $5 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = $1; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $3; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + $15 = HEAP32[$2 >> 2] | 0; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle22ElaboratedTypeSpefTypeC2ENS_10StringViewEPNS0_4NodeE($4, $tmpcast$byval_copy, $15); + STACKTOP = sp; + return $4 | 0; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIi7ARParamEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE21__construct_node_hashIRKNS_21piecewise_construct_tEJNS_5tupleIJRKiEEENSJ_IJEEEEEENS_10unique_ptrINS_11__hash_nodeIS3_PvEENS_22__hash_node_destructorINSC_ISR_EEEEEEmOT_DpOT0_($agg$result, $this, $__hash, $__f, $__rest, $__rest1) { + $agg$result = $agg$result | 0; + $this = $this | 0; + $__hash = $__hash | 0; + $__f = $__f | 0; + $__rest = $__rest | 0; + $__rest1 = $__rest1 | 0; + var $call$i$i$i = 0; + $call$i$i$i = __Znwm(200) | 0; + HEAP32[$agg$result >> 2] = $call$i$i$i; + HEAP32[$agg$result + 4 >> 2] = $this + 8; + HEAP32[$call$i$i$i + 8 >> 2] = HEAP32[HEAP32[$__rest >> 2] >> 2]; + _memset($call$i$i$i + 16 | 0, 0, 184) | 0; + HEAP8[$agg$result + 8 >> 0] = 1; + HEAP32[$call$i$i$i + 4 >> 2] = $__hash; + HEAP32[$call$i$i$i >> 2] = 0; + return; +} + +function __ZNSt3__219__double_or_nothingIwEEvRNS_10unique_ptrIT_PFvPvEEERPS2_S9_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$pr = 0, $11 = 0, $13 = 0, $16 = 0, $17 = 0, $25 = 0, $3 = 0, $5 = 0, $7 = 0, $8 = 0, $9 = 0; + $3 = $0 + 4 | 0; + $5 = (HEAP32[$3 >> 2] | 0) != 214; + $7 = HEAP32[$0 >> 2] | 0; + $8 = $7; + $9 = (HEAP32[$2 >> 2] | 0) - $8 | 0; + $11 = $9 << 1; + $13 = $9 >>> 0 < 2147483647 ? (($11 | 0) == 0 ? 4 : $11) : -1; + $16 = (HEAP32[$1 >> 2] | 0) - $8 >> 2; + $17 = _realloc($5 ? $7 : 0, $13) | 0; + if (!$17) __ZSt17__throw_bad_allocv(); + if (!$5) { + $$pr = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $17; + if (!$$pr) $25 = $17; else { + FUNCTION_TABLE_vi[HEAP32[$3 >> 2] & 255]($$pr); + $25 = HEAP32[$0 >> 2] | 0; + } + } else { + HEAP32[$0 >> 2] = $17; + $25 = $17; + } + HEAP32[$3 >> 2] = 215; + HEAP32[$1 >> 2] = $25 + ($16 << 2); + HEAP32[$2 >> 2] = (HEAP32[$0 >> 2] | 0) + ($13 >>> 2 << 2); + return; +} + +function __ZNSt3__219__double_or_nothingIjEEvRNS_10unique_ptrIT_PFvPvEEERPS2_S9_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$pr = 0, $11 = 0, $13 = 0, $16 = 0, $17 = 0, $25 = 0, $3 = 0, $5 = 0, $7 = 0, $8 = 0, $9 = 0; + $3 = $0 + 4 | 0; + $5 = (HEAP32[$3 >> 2] | 0) != 214; + $7 = HEAP32[$0 >> 2] | 0; + $8 = $7; + $9 = (HEAP32[$2 >> 2] | 0) - $8 | 0; + $11 = $9 << 1; + $13 = $9 >>> 0 < 2147483647 ? (($11 | 0) == 0 ? 4 : $11) : -1; + $16 = (HEAP32[$1 >> 2] | 0) - $8 >> 2; + $17 = _realloc($5 ? $7 : 0, $13) | 0; + if (!$17) __ZSt17__throw_bad_allocv(); + if (!$5) { + $$pr = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $17; + if (!$$pr) $25 = $17; else { + FUNCTION_TABLE_vi[HEAP32[$3 >> 2] & 255]($$pr); + $25 = HEAP32[$0 >> 2] | 0; + } + } else { + HEAP32[$0 >> 2] = $17; + $25 = $17; + } + HEAP32[$3 >> 2] = 215; + HEAP32[$1 >> 2] = $25 + ($16 << 2); + HEAP32[$2 >> 2] = (HEAP32[$0 >> 2] | 0) + ($13 >>> 2 << 2); + return; +} + +function _kpmDeleteHandle($0) { + $0 = $0 | 0; + var $$0 = 0, $$in = 0, $$in17 = 0, $$in18 = 0, $$in19 = 0, $1 = 0, $12 = 0, $15 = 0, $17 = 0, $3 = 0, $6 = 0, $9 = 0; + $1 = HEAP32[$0 >> 2] | 0; + if (!$1) $$0 = -1; else { + $3 = HEAP32[$1 >> 2] | 0; + if (!$3) $$in = $1; else { + __ZN6vision20VisualDatabaseFacadeD2Ev($3); + __ZdlPv($3); + $$in = HEAP32[$0 >> 2] | 0; + } + $6 = HEAP32[$$in + 28 >> 2] | 0; + if (!$6) $$in17 = $$in; else { + _free($6); + $$in17 = HEAP32[$0 >> 2] | 0; + } + $9 = HEAP32[$$in17 + 36 >> 2] | 0; + if (!$9) $$in18 = $$in17; else { + _free($9); + $$in18 = HEAP32[$0 >> 2] | 0; + } + $12 = HEAP32[$$in18 + 52 >> 2] | 0; + if (!$12) $$in19 = $$in18; else { + _free($12); + $$in19 = HEAP32[$0 >> 2] | 0; + } + $15 = HEAP32[$$in19 + 44 >> 2] | 0; + if (!$15) $17 = $$in19; else { + _free($15); + $17 = HEAP32[$0 >> 2] | 0; + } + _free($17); + HEAP32[$0 >> 2] = 0; + $$0 = 0; + } + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10parseSeqIdEPm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$08 = 0, $$sink15 = 0, $2 = 0, $6 = 0; + $2 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0; + if ($2 << 24 >> 24 > 47 ? $2 << 24 >> 24 < 58 | ($2 + -65 & 255) < 26 : 0) { + $$0 = 0; + while (1) { + $6 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, 0) | 0; + if ($6 << 24 >> 24 <= 47) break; + if ($6 << 24 >> 24 >= 58) if (($6 + -65 & 255) < 26) $$sink15 = -55; else break; else $$sink15 = -48; + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + 1; + $$0 = ($$0 * 36 | 0) + $$sink15 + ($6 << 24 >> 24) | 0; + } + HEAP32[$1 >> 2] = $$0; + $$08 = 0; + } else $$08 = 1; + return $$08 | 0; +} + +function __ZN6vision40Homography4PointsGeometricallyConsistentIfEEbPKT_S3_S3_S3_S3_S3_S3_S3_($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $$0 = 0, $14 = 0, $19 = 0, $24 = 0, $9 = 0; + $9 = +__ZN6vision13LinePointSideIfEET_PKS1_S3_S3_($0, $1, $2) > 0.0; + if ((!($9 ^ +__ZN6vision13LinePointSideIfEET_PKS1_S3_S3_($4, $5, $6) > 0.0) ? ($14 = +__ZN6vision13LinePointSideIfEET_PKS1_S3_S3_($1, $2, $3) > 0.0, !($14 ^ +__ZN6vision13LinePointSideIfEET_PKS1_S3_S3_($5, $6, $7) > 0.0)) : 0) ? ($19 = +__ZN6vision13LinePointSideIfEET_PKS1_S3_S3_($2, $3, $0) > 0.0, !($19 ^ +__ZN6vision13LinePointSideIfEET_PKS1_S3_S3_($6, $7, $4) > 0.0)) : 0) { + $24 = +__ZN6vision13LinePointSideIfEET_PKS1_S3_S3_($3, $0, $1) > 0.0; + $$0 = $24 ^ +__ZN6vision13LinePointSideIfEET_PKS1_S3_S3_($7, $4, $5) > 0.0 ^ 1; + } else $$0 = 0; + return $$0 | 0; +} + +function _getMatrixCodeType($id) { + $id = $id | 0; + var $arhandle = 0, $id$addr = 0, $matrixType = 0, $retval$0 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + $matrixType = sp + 4 | 0; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$0 = -1; else { + $arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0; + _arGetMatrixCodeType(HEAP32[$arhandle >> 2] | 0, $matrixType) | 0; + $retval$0 = HEAP32[$matrixType >> 2] | 0; + } + STACKTOP = sp; + return $retval$0 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle12CtorDtorName9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy1 = 0, $2 = 0, $3 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 16 | 0; + $2 = sp + 8 | 0; + $3 = sp; + if (HEAP8[$0 + 12 >> 0] | 0) { + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 52685); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + } + $8 = HEAP32[$0 + 8 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$8 >> 2] | 0) + 24 >> 2] & 255]($3, $8); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + STACKTOP = sp; + return; +} + +function __ZN6vision14CompareFREAK84EPhPKf($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$018 = 0, $$019 = 0, $$1 = 0, $2 = 0, $3 = 0, $indvars$iv = 0, $indvars$iv$next23 = 0, $indvars$iv20 = 0, $indvars$iv22 = 0; + __ZN6vision10ZeroVectorIhEEvPT_m($0, 84); + $$018 = 0; + $$019 = 0; + $indvars$iv = 36; + $indvars$iv20 = 35; + $indvars$iv22 = 36; + while (1) { + if (($$018 | 0) == 37) break; + $2 = $$018 + 1 | 0; + $3 = $1 + ($$018 << 2) | 0; + $$0 = $2; + $$1 = $$019; + while (1) { + if (($$1 | 0) == ($indvars$iv22 | 0)) break; + __ZN6vision17bitstring_set_bitEPhih($0, $$1, +HEAPF32[$3 >> 2] < +HEAPF32[$1 + ($$0 << 2) >> 2] & 1); + $$0 = $$0 + 1 | 0; + $$1 = $$1 + 1 | 0; + } + $indvars$iv$next23 = $indvars$iv22 + $indvars$iv20 | 0; + $$018 = $2; + $$019 = $$019 + $indvars$iv | 0; + $indvars$iv = $indvars$iv + -1 | 0; + $indvars$iv20 = $indvars$iv20 + -1 | 0; + $indvars$iv22 = $indvars$iv$next23; + } + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle12NoexceptSpec9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy1 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $$byval_copy1 = sp + 16 | 0; + $2 = sp + 8 | 0; + $3 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 56458); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, 51964); + HEAP32[$$byval_copy1 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy1 + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy1); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle17VendorExtQualTypeEJRPNS2_4NodeERNS_10StringViewEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $12 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = HEAP32[$1 >> 2] | 0; + $6 = $2; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $3; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle17VendorExtQualTypeC2EPKNS0_4NodeENS_10StringViewE($4, $5, $tmpcast$byval_copy); + STACKTOP = sp; + return $4 | 0; +} + +function __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $14 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + $4 = $0 + 11 | 0; + $5 = HEAP8[$4 >> 0] | 0; + $6 = $5 << 24 >> 24 < 0; + if ($6) $11 = HEAP32[$0 + 4 >> 2] | 0; else $11 = $5 & 255; + do if ($11 >>> 0 >= $1 >>> 0) if ($6) { + $14 = (HEAP32[$0 >> 2] | 0) + $1 | 0; + HEAP8[$3 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($14, $3); + HEAP32[$0 + 4 >> 2] = $1; + break; + } else { + HEAP8[$3 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($0 + $1 | 0, $3); + HEAP8[$4 >> 0] = $1; + break; + } else __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc($0, $1 - $11 | 0, $2) | 0; while (0); + STACKTOP = sp; + return; +} + +function ___overflow($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $10 = 0, $12 = 0, $13 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $9 = 0, label = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $3 = $1 & 255; + HEAP8[$2 >> 0] = $3; + $4 = $0 + 16 | 0; + $5 = HEAP32[$4 >> 2] | 0; + if (!$5) if (!(___towrite($0) | 0)) { + $12 = HEAP32[$4 >> 2] | 0; + label = 4; + } else $$0 = -1; else { + $12 = $5; + label = 4; + } + do if ((label | 0) == 4) { + $9 = $0 + 20 | 0; + $10 = HEAP32[$9 >> 2] | 0; + if ($10 >>> 0 < $12 >>> 0 ? ($13 = $1 & 255, ($13 | 0) != (HEAP8[$0 + 75 >> 0] | 0)) : 0) { + HEAP32[$9 >> 2] = $10 + 1; + HEAP8[$10 >> 0] = $3; + $$0 = $13; + break; + } + if ((FUNCTION_TABLE_iiii[HEAP32[$0 + 36 >> 2] & 63]($0, $2, 1) | 0) == 1) $$0 = HEAPU8[$2 >> 0] | 0; else $$0 = -1; + } while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN6vision25DoGScaleInvariantDetectorC2Ev($0) { + $0 = $0 | 0; + var $11 = 0, $14 = 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 10; + HEAP32[$0 + 12 >> 2] = 10; + HEAP32[$0 + 16 >> 2] = 0; + HEAP32[$0 + 20 >> 2] = 0; + HEAP32[$0 + 24 >> 2] = 0; + HEAP8[$0 + 28 >> 0] = 1; + __ZN6vision10DoGPyramidC2Ev($0 + 32 | 0); + HEAPF32[$0 + 52 >> 2] = 0.0; + HEAPF32[$0 + 56 >> 2] = 10.0; + $11 = $0 + 60 | 0; + HEAP32[$11 >> 2] = 0; + HEAP32[$11 + 4 >> 2] = 0; + HEAP32[$11 + 8 >> 2] = 0; + HEAP32[$11 + 12 >> 2] = 0; + HEAP32[$11 + 16 >> 2] = 0; + HEAP32[$11 + 20 >> 2] = 0; + HEAPF32[$0 + 88 >> 2] = 9.0; + __ZN6vision21OrientationAssignmentC2Ev($0 + 92 | 0); + $14 = $0 + 144 | 0; + HEAP32[$14 >> 2] = 0; + HEAP32[$0 + 148 >> 2] = 0; + HEAP32[$0 + 152 >> 2] = 0; + __ZN6vision25DoGScaleInvariantDetector22setMaxNumFeaturePointsEm($0, 5e3); + __ZNSt3__26vectorIfNS_9allocatorIfEEE6resizeEm($14, 36); + return; +} + +function __ZL19kpmCreateHandleCoreP9ARParamLTiii($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $13 = 0, $4 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = _calloc(1, 4156) | 0; + if (!$4) { + _arLog(0, 3, 45930, sp); + _exit(1); + } else { + $6 = __Znwm(4) | 0; + __ZN6vision20VisualDatabaseFacadeC2Ev($6); + HEAP32[$4 >> 2] = $6; + HEAP32[$4 + 4 >> 2] = $0; + HEAP32[$4 + 8 >> 2] = $3; + HEAP32[$4 + 12 >> 2] = $1; + HEAP32[$4 + 16 >> 2] = $2; + HEAP32[$4 + 20 >> 2] = 1; + HEAP32[$4 + 24 >> 2] = -1; + $13 = $4 + 28 | 0; + HEAP32[$13 >> 2] = 0; + HEAP32[$13 + 4 >> 2] = 0; + HEAP32[$13 + 8 >> 2] = 0; + HEAP32[$13 + 12 >> 2] = 0; + HEAP32[$13 + 16 >> 2] = 0; + HEAP32[$13 + 20 >> 2] = 0; + HEAP32[$13 + 24 >> 2] = 0; + HEAP32[$13 + 28 >> 2] = 0; + STACKTOP = sp; + return $4 | 0; + } + return 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle15IntegerCastExprEJRPNS2_4NodeERNS_10StringViewEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $12 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = HEAP32[$1 >> 2] | 0; + $6 = $2; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $3; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle15IntegerCastExprC2EPKNS0_4NodeENS_10StringViewE($4, $5, $tmpcast$byval_copy); + STACKTOP = sp; + return $4 | 0; +} + +function _cycle($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$02527 = 0, $$026 = 0, $10 = 0, $11 = 0, $18 = 0, $3 = 0, $5 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 256 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(256); + $3 = sp; + L1 : do if (($2 | 0) >= 2 ? ($5 = $1 + ($2 << 2) | 0, HEAP32[$5 >> 2] = $3, $0 | 0) : 0) { + $$02527 = $0; + $10 = $3; + while (1) { + $8 = $$02527 >>> 0 < 256 ? $$02527 : 256; + _memcpy($10 | 0, HEAP32[$1 >> 2] | 0, $8 | 0) | 0; + $$026 = 0; + do { + $11 = $1 + ($$026 << 2) | 0; + $$026 = $$026 + 1 | 0; + _memcpy(HEAP32[$11 >> 2] | 0, HEAP32[$1 + ($$026 << 2) >> 2] | 0, $8 | 0) | 0; + HEAP32[$11 >> 2] = (HEAP32[$11 >> 2] | 0) + $8; + } while (($$026 | 0) != ($2 | 0)); + $18 = $$02527 - $8 | 0; + if (!$18) break L1; + $$02527 = $18; + $10 = HEAP32[$5 >> 2] | 0; + } + } while (0); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle14ConversionExprEJRPNS2_4NodeERNS2_9NodeArrayEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $12 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = HEAP32[$1 >> 2] | 0; + $6 = $2; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $3; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle14ConversionExprC2EPKNS0_4NodeENS0_9NodeArrayE($4, $5, $tmpcast$byval_copy); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13ObjCProtoNameEJRPNS2_4NodeERNS_10StringViewEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $12 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = HEAP32[$1 >> 2] | 0; + $6 = $2; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $3; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle13ObjCProtoNameC2EPKNS0_4NodeENS_10StringViewE($4, $5, $tmpcast$byval_copy); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle14ConversionExprEJRPNS2_4NodeENS2_9NodeArrayEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $12 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = HEAP32[$1 >> 2] | 0; + $6 = $2; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $3; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle14ConversionExprC2EPKNS0_4NodeENS0_9NodeArrayE($4, $5, $tmpcast$byval_copy); + STACKTOP = sp; + return $4 | 0; +} + +function _arPattDeleteHandle($0) { + $0 = $0 | 0; + var $$0 = 0, $$024 = 0, $$025 = 0, $12 = 0, $14 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0; + if (!$0) $$025 = -1; else { + $2 = $0 + 4 | 0; + $3 = $0 + 8 | 0; + $4 = $0 + 12 | 0; + $5 = $0 + 20 | 0; + $$024 = 0; + while (1) { + if (($$024 | 0) >= (HEAP32[$2 >> 2] | 0)) break; + if (HEAP32[(HEAP32[$3 >> 2] | 0) + ($$024 << 2) >> 2] | 0) _arPattFree($0, $$024) | 0; + $12 = $$024 << 2; + $$0 = 0; + while (1) { + if (($$0 | 0) == 4) break; + $14 = $$0 + $12 | 0; + _free(HEAP32[(HEAP32[$4 >> 2] | 0) + ($14 << 2) >> 2] | 0); + _free(HEAP32[(HEAP32[$5 >> 2] | 0) + ($14 << 2) >> 2] | 0); + $$0 = $$0 + 1 | 0; + } + $$024 = $$024 + 1 | 0; + } + _free(HEAP32[$4 >> 2] | 0); + _free(HEAP32[$5 >> 2] | 0); + _free(HEAP32[$3 >> 2] | 0); + _free(HEAP32[$0 + 16 >> 2] | 0); + _free(HEAP32[$0 + 24 >> 2] | 0); + _free($0); + $$025 = 0; + } + return $$025 | 0; +} + +function __ZNSt3__219__double_or_nothingIcEEvRNS_10unique_ptrIT_PFvPvEEERPS2_S9_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$pr = 0, $11 = 0, $13 = 0, $15 = 0, $16 = 0, $23 = 0, $3 = 0, $5 = 0, $7 = 0, $8 = 0, $9 = 0; + $3 = $0 + 4 | 0; + $5 = (HEAP32[$3 >> 2] | 0) != 214; + $7 = HEAP32[$0 >> 2] | 0; + $8 = $7; + $9 = (HEAP32[$2 >> 2] | 0) - $8 | 0; + $11 = $9 << 1; + $13 = $9 >>> 0 < 2147483647 ? (($11 | 0) == 0 ? 1 : $11) : -1; + $15 = (HEAP32[$1 >> 2] | 0) - $8 | 0; + $16 = _realloc($5 ? $7 : 0, $13) | 0; + if (!$16) __ZSt17__throw_bad_allocv(); + if (!$5) { + $$pr = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $16; + if (!$$pr) $23 = $16; else { + FUNCTION_TABLE_vi[HEAP32[$3 >> 2] & 255]($$pr); + $23 = HEAP32[$0 >> 2] | 0; + } + } else { + HEAP32[$0 >> 2] = $16; + $23 = $16; + } + HEAP32[$3 >> 2] = 215; + HEAP32[$1 >> 2] = $23 + $15; + HEAP32[$2 >> 2] = (HEAP32[$0 >> 2] | 0) + $13; + return; +} + +function __ZNSt3__214__split_bufferI12multi_markerRNS_9allocatorIS1_EEEC2EmmS4_($this, $__cap, $__start, $__a) { + $this = $this | 0; + $__cap = $__cap | 0; + $__start = $__start | 0; + $__a = $__a | 0; + var $__value_$i1$i = 0, $add$ptr = 0, $cond = 0, $exception$i$i$i = 0; + $__value_$i1$i = $this + 12 | 0; + HEAP32[$__value_$i1$i >> 2] = 0; + HEAP32[$this + 16 >> 2] = $__a; + do if ($__cap) if ($__cap >>> 0 > 536870911) { + $exception$i$i$i = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($exception$i$i$i, 41481); + HEAP32[$exception$i$i$i >> 2] = 17472; + ___cxa_throw($exception$i$i$i | 0, 13960, 22); + } else { + $cond = __Znwm($__cap << 3) | 0; + break; + } else $cond = 0; while (0); + HEAP32[$this >> 2] = $cond; + $add$ptr = $cond + ($__start << 3) | 0; + HEAP32[$this + 8 >> 2] = $add$ptr; + HEAP32[$this + 4 >> 2] = $add$ptr; + HEAP32[$__value_$i1$i >> 2] = $cond + ($__cap << 3); + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle9ArrayTypeEJRPNS2_4NodeERNS2_12NodeOrStringEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $12 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = HEAP32[$1 >> 2] | 0; + $6 = $2; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $3; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle9ArrayTypeC2EPKNS0_4NodeENS0_12NodeOrStringE($4, $5, $tmpcast$byval_copy); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10PrefixExprEJRNS_10StringViewERPNS2_4NodeEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $11 = 0, $15 = 0, $3 = 0, $4 = 0, $5 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = $1; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $3; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + $15 = HEAP32[$2 >> 2] | 0; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle10PrefixExprC2ENS_10StringViewEPNS0_4NodeE($4, $tmpcast$byval_copy, $15); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle12InitListExprEJRPNS2_4NodeENS2_9NodeArrayEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $12 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = HEAP32[$1 >> 2] | 0; + $6 = $2; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $3; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle12InitListExprC2EPKNS0_4NodeENS0_9NodeArrayE($4, $5, $tmpcast$byval_copy); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10AbiTagAttrEJRPNS2_4NodeERNS_10StringViewEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $12 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = HEAP32[$1 >> 2] | 0; + $6 = $2; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $3; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle10AbiTagAttrC2EPNS0_4NodeENS_10StringViewE($4, $5, $tmpcast$byval_copy); + STACKTOP = sp; + return $4 | 0; +} + +function _arImageProcLumaHistAndCDFAndPercentile($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = +$2; + $3 = $3 | 0; + var $$0 = 0, $$024 = 0, $$025 = 0, $15 = 0, $16 = 0, $18 = 0, $22 = 0, $23 = 0, $6 = 0; + if (!($2 < 0.0 | $2 > 1.0)) { + $6 = _arImageProcLumaHistAndCDF($0, $1) | 0; + if (($6 | 0) < 0) $$025 = $6; else { + $15 = ~~(+(Math_imul(HEAP32[$0 + 8 >> 2] | 0, HEAP32[$0 + 4 >> 2] | 0) | 0) * $2) >>> 0; + $$024 = 0; + while (1) { + $16 = $$024 & 255; + $18 = HEAP32[$0 + 1036 + ($16 << 2) >> 2] | 0; + if ($18 >>> 0 < $15 >>> 0) $$024 = $$024 + 1 << 24 >> 24; else break; + } + $$0 = $$024; + $22 = $18; + while (1) { + $23 = $$0 + 1 << 24 >> 24; + if (($22 | 0) != ($15 | 0)) break; + $$0 = $23; + $22 = HEAP32[$0 + 1036 + (($23 & 255) << 2) >> 2] | 0; + } + HEAP8[$3 >> 0] = (($$0 & 255) + $16 | 0) >>> 1; + $$025 = 0; + } + } else $$025 = -1; + return $$025 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle10MemberExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $11 = 0, $12 = 0, $2 = 0, $6 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + $6 = $0 + 12 | 0; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $2; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast$byval_copy); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 20 >> 2] | 0, $1); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle9DotSuffixEJRPNS2_4NodeENS_10StringViewEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $12 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = HEAP32[$1 >> 2] | 0; + $6 = $2; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $3; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle9DotSuffixC2EPKNS0_4NodeENS_10StringViewE($4, $5, $tmpcast$byval_copy); + STACKTOP = sp; + return $4 | 0; +} + +function __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $10 = 0, $13 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + if ($2 >>> 0 > 1073741807) __ZNKSt3__221__basic_string_commonILb1EE20__throw_length_errorEv($0); + do if ($2 >>> 0 >= 2) { + $10 = $2 + 4 & -4; + if ($10 >>> 0 > 1073741823) _abort(); else { + $13 = __Znwm($10 << 2) | 0; + HEAP32[$0 >> 2] = $13; + HEAP32[$0 + 8 >> 2] = $10 | -2147483648; + HEAP32[$0 + 4 >> 2] = $2; + $$0 = $13; + break; + } + } else { + HEAP8[$0 + 8 + 3 >> 0] = $2; + $$0 = $0; + } while (0); + __ZNSt3__211char_traitsIwE4copyEPwPKwm($$0, $1, $2) | 0; + HEAP32[$3 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($$0 + ($2 << 2) | 0, $3); + STACKTOP = sp; + return; +} + +function _getDebugMode($id) { + $id = $id | 0; + var $arhandle = 0, $enable = 0, $id$addr = 0, $retval$0 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + $enable = sp + 4 | 0; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$0 = 0; else { + $arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0; + _arGetDebugMode(HEAP32[$arhandle >> 2] | 0, $enable) | 0; + $retval$0 = HEAP32[$enable >> 2] | 0; + } + STACKTOP = sp; + return $retval$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E15parsePrefixExprENS_10StringViewE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $4 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $4 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9parseExprEv(__ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) | 0) | 0; + HEAP32[$2 >> 2] = $4; + if (!$4) $$0 = 0; else $$0 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10PrefixExprEJRNS_10StringViewERPNS0_4NodeEEEESB_DpOT0_($0, $1, $2) | 0; + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $10 = 0, $13 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + if ($1 >>> 0 > 1073741807) __ZNKSt3__221__basic_string_commonILb1EE20__throw_length_errorEv($0); + do if ($1 >>> 0 >= 2) { + $10 = $1 + 4 & -4; + if ($10 >>> 0 > 1073741823) _abort(); else { + $13 = __Znwm($10 << 2) | 0; + HEAP32[$0 >> 2] = $13; + HEAP32[$0 + 8 >> 2] = $10 | -2147483648; + HEAP32[$0 + 4 >> 2] = $1; + $$0 = $13; + break; + } + } else { + HEAP8[$0 + 8 + 3 >> 0] = $1; + $$0 = $0; + } while (0); + __ZNSt3__211char_traitsIwE6assignEPwmw($$0, $1, $2) | 0; + HEAP32[$3 >> 2] = 0; + __ZNSt3__211char_traitsIwE6assignERwRKw($$0 + ($1 << 2) | 0, $3); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8CallExprEJRPNS2_4NodeENS2_9NodeArrayEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $12 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = HEAP32[$1 >> 2] | 0; + $6 = $2; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $3; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8CallExprC2EPKNS0_4NodeENS0_9NodeArrayE($4, $5, $tmpcast$byval_copy); + STACKTOP = sp; + return $4 | 0; +} + +function ___strerror_l($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$012$lcssa = 0, $$01214 = 0, $$016 = 0, $$113 = 0, $$115 = 0, $$115$ph = 0, $6 = 0, label = 0, $$113$looptemp = 0; + $$016 = 0; + while (1) { + if ((HEAPU8[10528 + $$016 >> 0] | 0) == ($0 | 0)) { + label = 4; + break; + } + $6 = $$016 + 1 | 0; + if (($6 | 0) == 87) { + $$115$ph = 87; + label = 5; + break; + } else $$016 = $6; + } + if ((label | 0) == 4) if (!$$016) $$012$lcssa = 10624; else { + $$115$ph = $$016; + label = 5; + } + if ((label | 0) == 5) { + $$01214 = 10624; + $$115 = $$115$ph; + while (1) { + $$113 = $$01214; + do { + $$113$looptemp = $$113; + $$113 = $$113 + 1 | 0; + } while ((HEAP8[$$113$looptemp >> 0] | 0) != 0); + $$115 = $$115 + -1 | 0; + if (!$$115) { + $$012$lcssa = $$113; + break; + } else $$01214 = $$113; + } + } + return ___lctrans($$012$lcssa, HEAP32[$1 + 20 >> 2] | 0) | 0; +} + +function __ZN6vision14ExtractFREAK84EPhPKNS_25GaussianScaleSpacePyramidERKNS_12FeaturePointEPKfS8_S8_S8_S8_S8_ffffffff($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + $9 = +$9; + $10 = +$10; + $11 = +$11; + $12 = +$12; + $13 = +$13; + $14 = +$14; + $15 = +$15; + $16 = +$16; + var $$0 = 0, $17 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 160 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(160); + $17 = sp; + if (__ZN6vision20SamplePyramidFREAK84EPfPKNS_25GaussianScaleSpacePyramidERKNS_12FeaturePointEPKfS8_S8_S8_S8_S8_ffffffff($17, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16) | 0) { + __ZN6vision14CompareFREAK84EPhPKf($0, $17); + $$0 = 1; + } else $$0 = 0; + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_($0, $$byval_copy, $$byval_copy1, $3, $4, $5, 13152, 13184) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_($0, $$byval_copy, $$byval_copy1, $3, $4, $5, 59714, 59722) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function _byteswap($0) { + $0 = $0 | 0; + var $$0 = 0, $$020 = 0, $$1 = 0, $1 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 192 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(192); + $1 = sp; + _byteSwapInt($0, $1); + _byteSwapInt($0 + 4 | 0, $1 + 4 | 0); + $$0 = 0; + while (1) { + if (($$0 | 0) == 3) break; + $$020 = 0; + while (1) { + if (($$020 | 0) == 4) break; + _byteSwapDouble($0 + 8 + ($$0 << 5) + ($$020 << 3) | 0, $1 + 8 + ($$0 << 5) + ($$020 << 3) | 0); + $$020 = $$020 + 1 | 0; + } + $$0 = $$0 + 1 | 0; + } + $8 = $0 + 176 | 0; + $$1 = 0; + while (1) { + $9 = HEAP32[$8 >> 2] | 0; + if (($$1 | 0) >= (HEAP32[1712 + ($9 + -1 << 3) >> 2] | 0)) break; + _byteSwapDouble($0 + 104 + ($$1 << 3) | 0, $1 + 104 + ($$1 << 3) | 0); + $$1 = $$1 + 1 | 0; + } + HEAP32[$1 + 176 >> 2] = $9; + _memcpy($0 | 0, $1 | 0, 184) | 0; + STACKTOP = sp; + return; +} + +function __ZN6vision14FREAKExtractor7extractERNS_18BinaryFeatureStoreEPKNS_25GaussianScaleSpacePyramidERKNSt3__26vectorINS_12FeaturePointENS6_9allocatorIS8_EEEE($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + __ZN6vision18BinaryFeatureStore21setNumBytesPerFeatureEi($1, 96); + __ZN6vision18BinaryFeatureStore6resizeEm($1, ((HEAP32[$3 + 4 >> 2] | 0) - (HEAP32[$3 >> 2] | 0) | 0) / 20 | 0); + __ZN6vision14ExtractFREAK84ERNS_18BinaryFeatureStoreEPKNS_25GaussianScaleSpacePyramidERKNSt3__26vectorINS_12FeaturePointENS5_9allocatorIS7_EEEEPKfSE_SE_SE_SE_SE_ffffffff($1, $2, $3, $0, $0 + 48 | 0, $0 + 96 | 0, $0 + 144 | 0, $0 + 192 | 0, $0 + 240 | 0, +HEAPF32[$0 + 288 >> 2], +HEAPF32[$0 + 292 >> 2], +HEAPF32[$0 + 296 >> 2], +HEAPF32[$0 + 300 >> 2], +HEAPF32[$0 + 304 >> 2], +HEAPF32[$0 + 308 >> 2], +HEAPF32[$0 + 312 >> 2], +HEAPF32[$0 + 316 >> 2]); + return; +} + +function _post_process_1pass($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $11 = 0, $13 = 0, $19 = 0, $7 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $7 = sp; + $9 = HEAP32[$0 + 456 >> 2] | 0; + $11 = $6 - (HEAP32[$5 >> 2] | 0) | 0; + $13 = HEAP32[$9 + 16 >> 2] | 0; + HEAP32[$7 >> 2] = 0; + $19 = $9 + 12 | 0; + FUNCTION_TABLE_viiiiiii[HEAP32[(HEAP32[$0 + 476 >> 2] | 0) + 4 >> 2] & 7]($0, $1, $2, $3, HEAP32[$19 >> 2] | 0, $7, $11 >>> 0 > $13 >>> 0 ? $13 : $11); + FUNCTION_TABLE_viiii[HEAP32[(HEAP32[$0 + 484 >> 2] | 0) + 4 >> 2] & 31]($0, HEAP32[$19 >> 2] | 0, $4 + (HEAP32[$5 >> 2] << 2) | 0, HEAP32[$7 >> 2] | 0); + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + (HEAP32[$7 >> 2] | 0); + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $3); + $7 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66544) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$6 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE($0, $5 + 16 | 0, $1, $$byval_copy, $4, $7); + STACKTOP = sp; + return HEAP32[$1 >> 2] | 0; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $3); + $7 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66544) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$6 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE($0, $5 + 24 | 0, $1, $$byval_copy, $4, $7); + STACKTOP = sp; + return HEAP32[$1 >> 2] | 0; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $3); + $7 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66512) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$6 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE($0, $5 + 16 | 0, $1, $$byval_copy, $4, $7); + STACKTOP = sp; + return HEAP32[$1 >> 2] | 0; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $3); + $7 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66512) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$6 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE($0, $5 + 24 | 0, $1, $$byval_copy, $4, $7); + STACKTOP = sp; + return HEAP32[$1 >> 2] | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIfEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIdEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIfEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIdEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function _read_restart_marker($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0, $12 = 0, $13 = 0, $2 = 0, $26 = 0, $6 = 0, $9 = 0; + $1 = $0 + 440 | 0; + $2 = HEAP32[$1 >> 2] | 0; + do if (!$2) if (!(_next_marker($0) | 0)) { + $$0 = 0; + return $$0 | 0; + } else { + $12 = HEAP32[$1 >> 2] | 0; + break; + } else $12 = $2; while (0); + $6 = $0 + 464 | 0; + $9 = HEAP32[(HEAP32[$6 >> 2] | 0) + 20 >> 2] | 0; + if (($12 | 0) != ($9 + 208 | 0)) { + if (!(FUNCTION_TABLE_iii[HEAP32[(HEAP32[$0 + 24 >> 2] | 0) + 20 >> 2] & 127]($0, $9) | 0)) { + $$0 = 0; + return $$0 | 0; + } + } else { + $13 = HEAP32[$0 >> 2] | 0; + HEAP32[$13 + 20 >> 2] = 100; + HEAP32[$13 + 24 >> 2] = $9; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0, 3); + HEAP32[$1 >> 2] = 0; + } + $26 = (HEAP32[$6 >> 2] | 0) + 20 | 0; + HEAP32[$26 >> 2] = (HEAP32[$26 >> 2] | 0) + 1 & 7; + $$0 = 1; + return $$0 | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedIjEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedIjEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedIyEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedItEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedImEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedIyEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedItEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedImEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE7reserveEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $5 = HEAP32[$0 >> 2] | 0; + if ((((HEAP32[$0 + 8 >> 2] | 0) - $5 | 0) / 36 | 0) >>> 0 < $1 >>> 0) { + __ZNSt3__214__split_bufferIN6vision25DoGScaleInvariantDetector12FeaturePointERNS_9allocatorIS3_EEEC2EmmS6_($2, $1, ((HEAP32[$0 + 4 >> 2] | 0) - $5 | 0) / 36 | 0, $0 + 8 | 0); + __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS5_EE($0, $2); + __ZNSt3__214__split_bufferIN6vision25DoGScaleInvariantDetector12FeaturePointERNS_9allocatorIS3_EEED2Ev($2); + } + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $3); + $7 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66544) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$6 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE($0, $5 + 20 | 0, $1, $$byval_copy, $4, $7); + STACKTOP = sp; + return HEAP32[$1 >> 2] | 0; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + __ZNKSt3__28ios_base6getlocEv($$byval_copy, $3); + $7 = __ZNKSt3__26locale9use_facetERNS0_2idE($$byval_copy, 66512) | 0; + __ZNSt3__26localeD2Ev($$byval_copy); + HEAP32[$6 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE($0, $5 + 20 | 0, $1, $$byval_copy, $4, $7); + STACKTOP = sp; + return HEAP32[$1 >> 2] | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__do_get_signedIxEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__do_get_signedIlEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__do_get_signedIxEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $$byval_copy1 = 0, $10 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy1 = sp + 12 | 0; + $$byval_copy = sp + 8 | 0; + $6 = sp + 4 | 0; + $7 = sp; + HEAP32[$6 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + HEAP32[$$byval_copy1 >> 2] = HEAP32[$7 >> 2]; + $10 = __ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__do_get_signedIlEES4_S4_S4_RNS_8ios_baseERjRT_($0, $$byval_copy, $$byval_copy1, $3, $4, $5) | 0; + STACKTOP = sp; + return $10 | 0; +} + +function _frexp($0, $1) { + $0 = +$0; + $1 = $1 | 0; + var $$0 = 0.0, $$016 = 0.0, $2 = 0, $3 = 0, $4 = 0, $9 = 0.0, $storemerge = 0; + HEAPF64[tempDoublePtr >> 3] = $0; + $2 = HEAP32[tempDoublePtr >> 2] | 0; + $3 = HEAP32[tempDoublePtr + 4 >> 2] | 0; + $4 = _bitshift64Lshr($2 | 0, $3 | 0, 52) | 0; + getTempRet0() | 0; + switch ($4 & 2047) { + case 0: + { + if ($0 != 0.0) { + $9 = +_frexp($0 * 18446744073709551616.0, $1); + $$016 = $9; + $storemerge = (HEAP32[$1 >> 2] | 0) + -64 | 0; + } else { + $$016 = $0; + $storemerge = 0; + } + HEAP32[$1 >> 2] = $storemerge; + $$0 = $$016; + break; + } + case 2047: + { + $$0 = $0; + break; + } + default: + { + HEAP32[$1 >> 2] = ($4 & 2047) + -1022; + HEAP32[tempDoublePtr >> 2] = $2; + HEAP32[tempDoublePtr + 4 >> 2] = $3 & -2146435073 | 1071644672; + $$0 = +HEAPF64[tempDoublePtr >> 3]; + } + } + return +$$0; +} + +function _jinit_arith_decoder($0) { + $0 = $0 | 0; + var $$036 = 0, $1 = 0, $14 = 0, $17 = 0, $4 = 0, $8 = 0, dest = 0, stop = 0; + $1 = $0 + 4 | 0; + $4 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 192) | 0; + HEAP32[$0 + 468 >> 2] = $4; + HEAP32[$4 >> 2] = 193; + HEAP32[$4 + 8 >> 2] = 194; + $8 = $4 + 188 | 0; + dest = $4 + 60 | 0; + stop = dest + 128 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP8[$8 >> 0] = 113; + if (!(HEAP32[$0 + 224 >> 2] | 0)) return; + $14 = $0 + 36 | 0; + $17 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, HEAP32[$14 >> 2] << 8) | 0; + HEAP32[$0 + 160 >> 2] = $17; + if ((HEAP32[$14 >> 2] | 0) <= 0) return; + $$036 = 0; + do { + _memset($17 + ($$036 << 8) | 0, -1, 256) | 0; + $$036 = $$036 + 1 | 0; + } while (($$036 | 0) < (HEAP32[$14 >> 2] | 0)); + return; +} + +function _scalbn($0, $1) { + $0 = +$0; + $1 = $1 | 0; + var $$0 = 0.0, $$020 = 0, $10 = 0.0, $12 = 0, $14 = 0, $17 = 0, $18 = 0, $3 = 0.0, $5 = 0, $7 = 0; + if (($1 | 0) <= 1023) if (($1 | 0) < -1022) { + $10 = $0 * 2.2250738585072014e-308; + $12 = ($1 | 0) < -2044; + $14 = $1 + 2044 | 0; + $$0 = $12 ? $10 * 2.2250738585072014e-308 : $10; + $$020 = $12 ? (($14 | 0) > -1022 ? $14 : -1022) : $1 + 1022 | 0; + } else { + $$0 = $0; + $$020 = $1; + } else { + $3 = $0 * 8988465674311579538646525.0e283; + $5 = ($1 | 0) > 2046; + $7 = $1 + -2046 | 0; + $$0 = $5 ? $3 * 8988465674311579538646525.0e283 : $3; + $$020 = $5 ? (($7 | 0) < 1023 ? $7 : 1023) : $1 + -1023 | 0; + } + $17 = _bitshift64Shl($$020 + 1023 | 0, 0, 52) | 0; + $18 = getTempRet0() | 0; + HEAP32[tempDoublePtr >> 2] = $17; + HEAP32[tempDoublePtr + 4 >> 2] = $18; + return +($$0 * +HEAPF64[tempDoublePtr >> 3]); +} + +function _ungetc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$1 = 0, $$pr = 0, $15 = 0, $17 = 0, $19 = 0, $7 = 0, $8 = 0, label = 0; + do if (($0 | 0) != -1) { + if ((HEAP32[$1 + 76 >> 2] | 0) > -1) $17 = ___lockfile($1) | 0; else $17 = 0; + $7 = $1 + 4 | 0; + $8 = HEAP32[$7 >> 2] | 0; + if (!$8) { + ___toread($1) | 0; + $$pr = HEAP32[$7 >> 2] | 0; + if ($$pr | 0) { + $15 = $$pr; + label = 6; + } + } else { + $15 = $8; + label = 6; + } + if ((label | 0) == 6 ? $15 >>> 0 > ((HEAP32[$1 + 44 >> 2] | 0) + -8 | 0) >>> 0 : 0) { + $19 = $15 + -1 | 0; + HEAP32[$7 >> 2] = $19; + HEAP8[$19 >> 0] = $0; + HEAP32[$1 >> 2] = HEAP32[$1 >> 2] & -17; + if (!$17) { + $$1 = $0; + break; + } + ___unlockfile($1); + $$1 = $0; + break; + } + if ($17) { + ___unlockfile($1); + $$1 = -1; + } else $$1 = -1; + } else $$1 = -1; while (0); + return $$1 | 0; +} + +function __ZN6vision27AddHomographyPointContraintIfEEvPT_PKS1_S4_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $29 = 0, $5 = 0; + HEAPF32[$0 >> 2] = -+HEAPF32[$1 >> 2]; + $5 = $1 + 4 | 0; + HEAPF32[$0 + 4 >> 2] = -+HEAPF32[$5 >> 2]; + HEAPF32[$0 + 8 >> 2] = -1.0; + __ZN6vision11ZeroVector3IfEEvPT_($0 + 12 | 0); + HEAPF32[$0 + 24 >> 2] = +HEAPF32[$2 >> 2] * +HEAPF32[$1 >> 2]; + HEAPF32[$0 + 28 >> 2] = +HEAPF32[$2 >> 2] * +HEAPF32[$5 >> 2]; + HEAP32[$0 + 32 >> 2] = HEAP32[$2 >> 2]; + __ZN6vision11ZeroVector3IfEEvPT_($0 + 36 | 0); + HEAPF32[$0 + 48 >> 2] = -+HEAPF32[$1 >> 2]; + HEAPF32[$0 + 52 >> 2] = -+HEAPF32[$5 >> 2]; + HEAPF32[$0 + 56 >> 2] = -1.0; + $29 = $2 + 4 | 0; + HEAPF32[$0 + 60 >> 2] = +HEAPF32[$29 >> 2] * +HEAPF32[$1 >> 2]; + HEAPF32[$0 + 64 >> 2] = +HEAPF32[$29 >> 2] * +HEAPF32[$5 >> 2]; + HEAP32[$0 + 68 >> 2] = HEAP32[$29 >> 2]; + return; +} + +function _prescan_quantize($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$03032 = 0, $$03134 = 0, $$033 = 0, $27 = 0, $28 = 0, $29 = 0, $7 = 0, $9 = 0; + $7 = HEAP32[(HEAP32[$0 + 484 >> 2] | 0) + 24 >> 2] | 0; + $9 = HEAP32[$0 + 112 >> 2] | 0; + if (($3 | 0) < 1 | ($9 | 0) == 0) return; + $$03134 = 0; + do { + $$03032 = $9; + $$033 = HEAP32[$1 + ($$03134 << 2) >> 2] | 0; + while (1) { + $27 = (HEAP32[$7 + ((HEAPU8[$$033 >> 0] | 0) >>> 3 << 2) >> 2] | 0) + ((HEAPU8[$$033 + 1 >> 0] | 0) >>> 2 << 6) + ((HEAPU8[$$033 + 2 >> 0] | 0) >>> 3 << 1) | 0; + $28 = HEAP16[$27 >> 1] | 0; + $29 = $28 + 1 << 16 >> 16; + HEAP16[$27 >> 1] = $29 << 16 >> 16 == 0 ? $28 : $29; + $$03032 = $$03032 + -1 | 0; + if (!$$03032) break; else $$033 = $$033 + 3 | 0; + } + $$03134 = $$03134 + 1 | 0; + } while (($$03134 | 0) != ($3 | 0)); + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle12InitListExprEJDnNS2_9NodeArrayEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $11 = 0, $3 = 0, $4 = 0, $5 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = $2; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $3; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle12InitListExprC2EPKNS0_4NodeENS0_9NodeArrayE($4, 0, $tmpcast$byval_copy); + STACKTOP = sp; + return $4 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle22ElaboratedTypeSpefType9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $4 = $0 + 8 | 0; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $2; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast$byval_copy); + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 32); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 16 >> 2] | 0, $1); + STACKTOP = sp; + return; +} + +function __ZN10emscripten8internal7InvokerIiJiiiEE6invokeEPFiiiiEiii($fn, $args, $args1, $args3) { + $fn = $fn | 0; + $args = $args | 0; + $args1 = $args1 | 0; + $args3 = $args3 | 0; + var $call = 0, $call5 = 0, $call6 = 0, $call7 = 0, $call8 = 0, $ref$tmp = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $ref$tmp = sp; + $call = __ZN10emscripten8internal11BindingTypeIivE12fromWireTypeEi($args) | 0; + $call5 = __ZN10emscripten8internal11BindingTypeIivE12fromWireTypeEi($args1) | 0; + $call6 = __ZN10emscripten8internal11BindingTypeIivE12fromWireTypeEi($args3) | 0; + $call7 = FUNCTION_TABLE_iiii[$fn & 63]($call, $call5, $call6) | 0; + HEAP32[$ref$tmp >> 2] = $call7; + $call8 = __ZN10emscripten8internal11BindingTypeIivE10toWireTypeERKi($ref$tmp) | 0; + STACKTOP = sp; + return $call8 | 0; +} + +function __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$pre$phiZ2D = 0, $16 = 0, $17 = 0, $19 = 0, $20 = 0, $3 = 0, $6 = 0, $9 = 0; + $3 = $1 + 4 | 0; + HEAP32[$3 >> 2] = (HEAP32[$3 >> 2] | 0) + 1; + $6 = $0 + 8 | 0; + $9 = HEAP32[$6 >> 2] | 0; + if ((HEAP32[$0 + 12 >> 2] | 0) - $9 >> 2 >>> 0 > $2 >>> 0) { + $$pre$phiZ2D = $6; + $16 = $9; + } else { + __ZNSt3__26vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEE6resizeEm($6, $2 + 1 | 0); + $$pre$phiZ2D = $6; + $16 = HEAP32[$6 >> 2] | 0; + } + $17 = HEAP32[$16 + ($2 << 2) >> 2] | 0; + if ($17 | 0 ? ($19 = $17 + 4 | 0, $20 = HEAP32[$19 >> 2] | 0, HEAP32[$19 >> 2] = $20 + -1, ($20 | 0) == 0) : 0) FUNCTION_TABLE_vi[HEAP32[(HEAP32[$17 >> 2] | 0) + 8 >> 2] & 255]($17); + HEAP32[(HEAP32[$$pre$phiZ2D >> 2] | 0) + ($2 << 2) >> 2] = $1; + return; +} + +function __ZN10emscripten8internal7InvokerIiJNSt3__212basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEE6invokeEPFiS8_EPNS0_11BindingTypeIS8_vEUt_E($fn, $args) { + $fn = $fn | 0; + $args = $args | 0; + var $agg$tmp = 0, $call = 0, $call1 = 0, $ref$tmp = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $ref$tmp = sp + 12 | 0; + $agg$tmp = sp; + __ZN10emscripten8internal11BindingTypeINSt3__212basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEvE12fromWireTypeEPNS9_Ut_E($agg$tmp, $args); + $call = FUNCTION_TABLE_ii[$fn & 127]($agg$tmp) | 0; + HEAP32[$ref$tmp >> 2] = $call; + $call1 = __ZN10emscripten8internal11BindingTypeIivE10toWireTypeERKi($ref$tmp) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($agg$tmp); + STACKTOP = sp; + return $call1 | 0; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$byval_copy = 0, $6 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 4) | 0; + if (!(HEAP32[$4 >> 2] & 4)) { + if (($8 | 0) < 69) $$0 = $8 + 2e3 | 0; else $$0 = ($8 | 0) < 100 ? $8 + 1900 | 0 : $8; + HEAP32[$1 >> 2] = $$0 + -1900; + } + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $$byval_copy = 0, $6 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 4) | 0; + if (!(HEAP32[$4 >> 2] & 4)) { + if (($8 | 0) < 69) $$0 = $8 + 2e3 | 0; else $$0 = ($8 | 0) < 100 ? $8 + 1900 | 0 : $8; + HEAP32[$1 >> 2] = $$0 + -1900; + } + STACKTOP = sp; + return; +} + +function _getMarkerNum($id) { + $id = $id | 0; + var $arhandle = 0, $id$addr = 0, $retval$0$in = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$0$in = 16896; else { + $arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0; + $retval$0$in = (HEAP32[$arhandle >> 2] | 0) + 44 | 0; + } + STACKTOP = sp; + return HEAP32[$retval$0$in >> 2] | 0; +} + +function ___ftello_unlocked($0) { + $0 = $0 | 0; + var $11 = 0, $12 = 0, $13 = 0, $19 = 0, $22 = 0, $23 = 0, $28 = 0, $31 = 0, $33 = 0, $34 = 0; + if (!(HEAP32[$0 >> 2] & 128)) $11 = 1; else $11 = (HEAP32[$0 + 20 >> 2] | 0) >>> 0 > (HEAP32[$0 + 28 >> 2] | 0) >>> 0 ? 2 : 1; + $12 = FUNCTION_TABLE_iiiii[HEAP32[$0 + 40 >> 2] & 15]($0, 0, 0, $11) | 0; + $13 = getTempRet0() | 0; + if (($13 | 0) < 0) { + $33 = $13; + $34 = $12; + } else { + $19 = (HEAP32[$0 + 8 >> 2] | 0) - (HEAP32[$0 + 4 >> 2] | 0) | 0; + $22 = _i64Subtract($12 | 0, $13 | 0, $19 | 0, (($19 | 0) < 0) << 31 >> 31 | 0) | 0; + $23 = getTempRet0() | 0; + $28 = (HEAP32[$0 + 20 >> 2] | 0) - (HEAP32[$0 + 28 >> 2] | 0) | 0; + $31 = _i64Add($22 | 0, $23 | 0, $28 | 0, (($28 | 0) < 0) << 31 >> 31 | 0) | 0; + $33 = getTempRet0() | 0; + $34 = $31; + } + setTempRet0($33 | 0); + return $34 | 0; +} + +function _setProjectionNearPlane($id, $projectionNearPlane) { + $id = $id | 0; + $projectionNearPlane = +$projectionNearPlane; + var $id$addr = 0, $nearPlane = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0) { + $nearPlane = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 312 | 0; + HEAPF64[$nearPlane >> 3] = $projectionNearPlane; + } + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle21StructuredBindingNameEJNS2_9NodeArrayEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $2; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle21StructuredBindingNameC2ENS0_9NodeArrayE($3, $tmpcast$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle20TemplateArgumentPackEJRNS2_9NodeArrayEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $2; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle20TemplateArgumentPackC2ENS0_9NodeArrayE($3, $tmpcast$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle16FloatLiteralImplIfEEJRNS_10StringViewEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $2; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIfEC2ENS_10StringViewE($3, $tmpcast$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle16FloatLiteralImplIeEEJRNS_10StringViewEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $2; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIeEC2ENS_10StringViewE($3, $tmpcast$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle16FloatLiteralImplIdEEJRNS_10StringViewEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $2; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIdEC2ENS_10StringViewE($3, $tmpcast$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function _getProcessingImage($id) { + $id = $id | 0; + var $arhandle = 0, $id$addr = 0, $retval$0 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$0 = 0; else { + $arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0; + $retval$0 = HEAP32[(HEAP32[$arhandle >> 2] | 0) + 4834148 >> 2] | 0; + } + STACKTOP = sp; + return $retval$0 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle20DynamicExceptionSpecEJNS2_9NodeArrayEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $2; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle20DynamicExceptionSpecC2ENS0_9NodeArrayE($3, $tmpcast$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function _getMultiMarkerCount($id) { + $id = $id | 0; + var $call7 = 0, $id$addr = 0, $retval$0 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$0 = -1; else { + $call7 = __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0; + $retval$0 = (HEAP32[$call7 + 332 >> 2] | 0) - (HEAP32[$call7 + 328 >> 2] | 0) >> 3; + } + STACKTOP = sp; + return $retval$0 | 0; +} +function __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($0) { + $0 = $0 | 0; + var $1 = 0, $16 = 0, $25 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + if (HEAP32[$0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) + 24 >> 2] | 0) { + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_($1, $0); + if (HEAP8[$1 >> 0] | 0 ? ($16 = HEAP32[$0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) + 24 >> 2] | 0, (FUNCTION_TABLE_ii[HEAP32[(HEAP32[$16 >> 2] | 0) + 24 >> 2] & 127]($16) | 0) == -1) : 0) { + $25 = $0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) | 0; + __ZNSt3__28ios_base5clearEj($25, HEAP32[$25 + 16 >> 2] | 1); + } + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev($1); + } + STACKTOP = sp; + return $0 | 0; +} + +function __ZN10emscripten8functionIiJiNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEJEEEvPKcPFT_DpT0_EDpT1_($name, $fn) { + $name = $name | 0; + $fn = $fn | 0; + var $args = 0, $call = 0, $call1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $args = sp; + $call = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiiNSt3__212basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEE8getCountEv($args) | 0; + $call1 = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiiNSt3__212basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEE8getTypesEv($args) | 0; + __embind_register_function($name | 0, $call | 0, $call1 | 0, __ZN10emscripten8internal19getGenericSignatureIJiiiiEEEPKcv() | 0, 31, $fn | 0); + STACKTOP = sp; + return; +} + +function _setProjectionFarPlane($id, $projectionFarPlane) { + $id = $id | 0; + $projectionFarPlane = +$projectionFarPlane; + var $farPlane = 0, $id$addr = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0) { + $farPlane = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 320 | 0; + HEAPF64[$farPlane >> 3] = $projectionFarPlane; + } + STACKTOP = sp; + return; +} + +function __ZN10emscripten8functionIiJNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEJEEEvPKcPFT_DpT0_EDpT1_($name, $fn) { + $name = $name | 0; + $fn = $fn | 0; + var $args = 0, $call = 0, $call1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $args = sp; + $call = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiNSt3__212basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEE8getCountEv($args) | 0; + $call1 = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiNSt3__212basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEE8getTypesEv($args) | 0; + __embind_register_function($name | 0, $call | 0, $call1 | 0, __ZN10emscripten8internal19getGenericSignatureIJiiiEEEPKcv() | 0, 55, $fn | 0); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle15UnnamedTypeNameEJRNS_10StringViewEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $2; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle15UnnamedTypeNameC2ENS_10StringViewE($3, $tmpcast$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function _strtox($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $18 = 0, $21 = 0, $22 = 0, $3 = 0, $4 = 0, $5 = 0, $8 = 0.0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 144 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(144); + $3 = sp; + _memset($3 | 0, 0, 144) | 0; + $4 = $3 + 4 | 0; + HEAP32[$4 >> 2] = $0; + $5 = $3 + 8 | 0; + HEAP32[$5 >> 2] = -1; + HEAP32[$3 + 44 >> 2] = $0; + HEAP32[$3 + 76 >> 2] = -1; + ___shlim($3, 0, 0); + $8 = +___floatscan($3, $2, 1); + $10 = $3 + 120 | 0; + $18 = (HEAP32[$4 >> 2] | 0) - (HEAP32[$5 >> 2] | 0) | 0; + $21 = _i64Add(HEAP32[$10 >> 2] | 0, HEAP32[$10 + 4 >> 2] | 0, $18 | 0, (($18 | 0) < 0) << 31 >> 31 | 0) | 0; + $22 = getTempRet0() | 0; + if ($1 | 0) HEAP32[$1 >> 2] = ($21 | 0) == 0 & ($22 | 0) == 0 ? $0 : $0 + $21 | 0; + STACKTOP = sp; + return +$8; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13FunctionParamEJRNS_10StringViewEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $2; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle13FunctionParamC2ENS_10StringViewE($3, $tmpcast$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 2) | 0; + $9 = HEAP32[$4 >> 2] | 0; + if (($8 + -1 | 0) >>> 0 < 12 & ($9 & 4 | 0) == 0) HEAP32[$1 >> 2] = $8; else HEAP32[$4 >> 2] = $9 | 4; + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 2) | 0; + $9 = HEAP32[$4 >> 2] | 0; + if (($8 + -1 | 0) >>> 0 < 12 & ($9 & 4 | 0) == 0) HEAP32[$1 >> 2] = $8; else HEAP32[$4 >> 2] = $9 | 4; + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorINS0_INS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEEENS3_IS7_EEE6resizeEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0, $12 = 0, $14 = 0, $2 = 0, $3 = 0, $4 = 0, $6 = 0, $8 = 0, $9 = 0; + $2 = $0 + 4 | 0; + $3 = HEAP32[$2 >> 2] | 0; + $4 = HEAP32[$0 >> 2] | 0; + $6 = ($3 - $4 | 0) / 12 | 0; + $8 = $4; + $9 = $3; + if ($6 >>> 0 >= $1 >>> 0) { + if ($6 >>> 0 > $1 >>> 0) { + $12 = $8 + ($1 * 12 | 0) | 0; + $$0$i$i = $9; + while (1) { + if (($$0$i$i | 0) == ($12 | 0)) break; + $14 = $$0$i$i + -12 | 0; + __ZNSt3__213__vector_baseINS_6vectorINS_4pairIfmEENS_9allocatorIS3_EEEENS4_IS6_EEED2Ev($14); + $$0$i$i = $14; + } + HEAP32[$2 >> 2] = $12; + } + } else __ZNSt3__26vectorINS0_INS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEEENS3_IS7_EEE8__appendEm($0, $1 - $6 | 0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle20PostfixQualifiedType9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $14 = 0, $15 = 0, $2 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $4 = HEAP32[$0 + 8 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$4 >> 2] | 0) + 16 >> 2] & 255]($4, $1); + $9 = $0 + 12 | 0; + $14 = HEAP32[$9 + 4 >> 2] | 0; + $15 = $2; + HEAP32[$15 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$15 + 4 >> 2] = $14; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast$byval_copy); + STACKTOP = sp; + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEE5clearEv($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0, $4 = 0, $7 = 0; + $1 = $0 + 12 | 0; + if (HEAP32[$1 >> 2] | 0) { + $4 = $0 + 8 | 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEE17__deallocate_nodeEPNS_16__hash_node_baseIPNS_11__hash_nodeIS2_PvEEEE($0, HEAP32[$4 >> 2] | 0); + HEAP32[$4 >> 2] = 0; + $7 = HEAP32[$0 + 4 >> 2] | 0; + $$0 = 0; + while (1) { + if (($$0 | 0) == ($7 | 0)) break; + HEAP32[(HEAP32[$0 >> 2] | 0) + ($$0 << 2) >> 2] = 0; + $$0 = $$0 + 1 | 0; + } + HEAP32[$1 >> 2] = 0; + } + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13ParameterPackEJNS2_9NodeArrayEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $2; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle13ParameterPackC2ENS0_9NodeArrayE($3, $tmpcast$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13NodeArrayNodeEJNS2_9NodeArrayEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $2; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle13NodeArrayNodeC2ENS0_9NodeArrayE($3, $tmpcast$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10MemberExprEJRPNS2_4NodeERA3_KcS6_EEEPT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$byval_copy = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $4 = sp; + $5 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 24) | 0; + $6 = HEAP32[$1 >> 2] | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, $2); + $7 = HEAP32[$3 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle10MemberExprC2EPKNS0_4NodeENS_10StringViewES4_($5, $6, $$byval_copy, $7); + STACKTOP = sp; + return $5 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10MemberExprEJRPNS2_4NodeERA2_KcS6_EEEPT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$byval_copy = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $4 = sp; + $5 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 24) | 0; + $6 = HEAP32[$1 >> 2] | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, $2); + $7 = HEAP32[$3 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle10MemberExprC2EPKNS0_4NodeENS_10StringViewES4_($5, $6, $$byval_copy, $7); + STACKTOP = sp; + return $5 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle12TemplateArgsEJNS2_9NodeArrayEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $2; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle12TemplateArgsC2ENS0_9NodeArrayE($3, $tmpcast$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle12EnableIfAttrEJNS2_9NodeArrayEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $2; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle12EnableIfAttrC2ENS0_9NodeArrayE($3, $tmpcast$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 2) | 0; + $9 = HEAP32[$4 >> 2] | 0; + if (($8 + -1 | 0) >>> 0 < 31 & ($9 & 4 | 0) == 0) HEAP32[$1 >> 2] = $8; else HEAP32[$4 >> 2] = $9 | 4; + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 3) | 0; + $9 = HEAP32[$4 >> 2] | 0; + if (($8 | 0) < 366 & ($9 & 4 | 0) == 0) HEAP32[$1 >> 2] = $8; else HEAP32[$4 >> 2] = $9 | 4; + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 2) | 0; + $9 = HEAP32[$4 >> 2] | 0; + if (($8 + -1 | 0) >>> 0 < 31 & ($9 & 4 | 0) == 0) HEAP32[$1 >> 2] = $8; else HEAP32[$4 >> 2] = $9 | 4; + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 3) | 0; + $9 = HEAP32[$4 >> 2] | 0; + if (($8 | 0) < 366 & ($9 & 4 | 0) == 0) HEAP32[$1 >> 2] = $8; else HEAP32[$4 >> 2] = $9 | 4; + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8CastExprEJRA17_KcRPNS2_4NodeES9_EEEPT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$byval_copy = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $4 = sp; + $5 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 24) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, $1); + $6 = HEAP32[$2 >> 2] | 0; + $7 = HEAP32[$3 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8CastExprC2ENS_10StringViewEPKNS0_4NodeES5_($5, $$byval_copy, $6, $7); + STACKTOP = sp; + return $5 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8CastExprEJRA13_KcRPNS2_4NodeES9_EEEPT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$byval_copy = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $4 = sp; + $5 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 24) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, $1); + $6 = HEAP32[$2 >> 2] | 0; + $7 = HEAP32[$3 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8CastExprC2ENS_10StringViewEPKNS0_4NodeES5_($5, $$byval_copy, $6, $7); + STACKTOP = sp; + return $5 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8CastExprEJRA12_KcRPNS2_4NodeES9_EEEPT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$byval_copy = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $4 = sp; + $5 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 24) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, $1); + $6 = HEAP32[$2 >> 2] | 0; + $7 = HEAP32[$3 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8CastExprC2ENS_10StringViewEPKNS0_4NodeES5_($5, $$byval_copy, $6, $7); + STACKTOP = sp; + return $5 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8CastExprEJRA11_KcRPNS2_4NodeES9_EEEPT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$byval_copy = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $4 = sp; + $5 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 24) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($4, $1); + $6 = HEAP32[$2 >> 2] | 0; + $7 = HEAP32[$3 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$4 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$4 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8CastExprC2ENS_10StringViewEPKNS0_4NodeES5_($5, $$byval_copy, $6, $7); + STACKTOP = sp; + return $5 | 0; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 2) | 0; + $9 = HEAP32[$4 >> 2] | 0; + if (($8 | 0) < 13 & ($9 & 4 | 0) == 0) HEAP32[$1 >> 2] = $8 + -1; else HEAP32[$4 >> 2] = $9 | 4; + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 2) | 0; + $9 = HEAP32[$4 >> 2] | 0; + if (($8 | 0) < 13 & ($9 & 4 | 0) == 0) HEAP32[$1 >> 2] = $8 + -1; else HEAP32[$4 >> 2] = $9 | 4; + STACKTOP = sp; + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS5_EEEEEENS_22__unordered_map_hasherIiS9_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS9_NS_8equal_toIiEELb1EEENS6_IS9_EEE21__construct_node_hashIRKNS_21piecewise_construct_tEJNS_5tupleIJRKiEEENSO_IJEEEEEENS_10unique_ptrINS_11__hash_nodeIS9_PvEENS_22__hash_node_destructorINS6_ISW_EEEEEEmOT_DpOT0_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $7 = 0; + $7 = __Znwm(24) | 0; + HEAP32[$0 >> 2] = $7; + HEAP32[$0 + 4 >> 2] = $1 + 8; + HEAP32[$7 + 8 >> 2] = HEAP32[HEAP32[$4 >> 2] >> 2]; + HEAP32[$7 + 12 >> 2] = 0; + HEAP32[$7 + 16 >> 2] = 0; + HEAP32[$7 + 20 >> 2] = 0; + HEAP8[$0 + 8 >> 0] = 1; + HEAP32[$7 + 4 >> 2] = $2; + HEAP32[$7 >> 2] = 0; + return; +} + +function __ZN6vision19downsample_bilinearEPfPKfmm($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$030 = 0, $$031 = 0, $$032 = 0, $$033 = 0, $$1 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = 0; + $4 = $2 >>> 1; + $5 = $3 >>> 1; + $6 = $2 << 1; + $$030 = 0; + $$033 = $0; + while (1) { + if (($$030 | 0) == ($5 | 0)) break; + $8 = $1 + ((Math_imul($6, $$030) | 0) << 2) | 0; + $$0 = 0; + $$031 = $8 + ($2 << 2) | 0; + $$032 = $8; + $$1 = $$033; + while (1) { + if (($$0 | 0) == ($4 | 0)) break; + HEAPF32[$$1 >> 2] = (+HEAPF32[$$032 >> 2] + +HEAPF32[$$032 + 4 >> 2] + +HEAPF32[$$031 >> 2] + +HEAPF32[$$031 + 4 >> 2]) * .25; + $$0 = $$0 + 1 | 0; + $$031 = $$031 + 8 | 0; + $$032 = $$032 + 8 | 0; + $$1 = $$1 + 4 | 0; + } + $$030 = $$030 + 1 | 0; + $$033 = $$033 + ($4 << 2) | 0; + } + return; +} + +function _icpGetQ_from_S($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$sink = 0.0, $$sink1 = 0.0, $11 = 0.0, $14 = 0.0, $2 = 0.0, $4 = 0, $5 = 0.0, $8 = 0, $9 = 0.0; + $2 = +HEAPF64[$1 >> 3]; + $4 = $1 + 8 | 0; + $5 = +HEAPF64[$4 >> 3]; + $8 = $1 + 16 | 0; + $9 = +HEAPF64[$8 >> 3]; + $11 = $2 * $2 + $5 * $5 + $9 * $9; + if ($11 == 0.0) { + HEAPF64[$0 >> 3] = 1.0; + HEAPF64[$0 + 8 >> 3] = 0.0; + $$sink = 0.0; + $$sink1 = 0.0; + } else { + $14 = +Math_sqrt(+$11); + HEAPF64[$0 >> 3] = $2 / $14; + HEAPF64[$0 + 8 >> 3] = +HEAPF64[$4 >> 3] / $14; + $$sink = $14; + $$sink1 = +HEAPF64[$8 >> 3] / $14; + } + HEAPF64[$0 + 16 >> 3] = $$sink1; + HEAPF64[$0 + 24 >> 3] = $$sink; + HEAPF64[$0 + 32 >> 3] = +HEAPF64[$1 + 24 >> 3]; + HEAPF64[$0 + 40 >> 3] = +HEAPF64[$1 + 32 >> 3]; + HEAPF64[$0 + 48 >> 3] = +HEAPF64[$1 + 40 >> 3]; + return; +} + +function _getProjectionNearPlane($id) { + $id = $id | 0; + var $id$addr = 0, $nearPlane = 0, $retval$0 = 0.0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$0 = -1.0; else { + $nearPlane = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 312 | 0; + $retval$0 = +HEAPF64[$nearPlane >> 3]; + } + STACKTOP = sp; + return +$retval$0; +} + +function _fclose($0) { + $0 = $0 | 0; + var $$pre = 0, $10 = 0, $15 = 0, $21 = 0, $25 = 0, $27 = 0, $30 = 0, $7 = 0, $8 = 0; + if ((HEAP32[$0 + 76 >> 2] | 0) > -1) $30 = ___lockfile($0) | 0; else $30 = 0; + ___unlist_locked_file($0); + $7 = (HEAP32[$0 >> 2] & 1 | 0) != 0; + if (!$7) { + $8 = ___ofl_lock() | 0; + $10 = HEAP32[$0 + 52 >> 2] | 0; + $$pre = $0 + 56 | 0; + if ($10 | 0) HEAP32[$10 + 56 >> 2] = HEAP32[$$pre >> 2]; + $15 = HEAP32[$$pre >> 2] | 0; + if ($15 | 0) HEAP32[$15 + 52 >> 2] = $10; + if ((HEAP32[$8 >> 2] | 0) == ($0 | 0)) HEAP32[$8 >> 2] = $15; + ___ofl_unlock(); + } + $21 = _fflush($0) | 0; + $25 = FUNCTION_TABLE_ii[HEAP32[$0 + 12 >> 2] & 127]($0) | 0 | $21; + $27 = HEAP32[$0 + 96 >> 2] | 0; + if ($27 | 0) _free($27); + if ($7) { + if ($30 | 0) ___unlockfile($0); + } else _free($0); + return $25 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRNS_10StringViewEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $2; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $tmpcast$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 1) | 0; + $9 = HEAP32[$4 >> 2] | 0; + if (($8 | 0) < 7 & ($9 & 4 | 0) == 0) HEAP32[$1 >> 2] = $8; else HEAP32[$4 >> 2] = $9 | 4; + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 2) | 0; + $9 = HEAP32[$4 >> 2] | 0; + if (($8 | 0) < 61 & ($9 & 4 | 0) == 0) HEAP32[$1 >> 2] = $8; else HEAP32[$4 >> 2] = $9 | 4; + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 2) | 0; + $9 = HEAP32[$4 >> 2] | 0; + if (($8 | 0) < 60 & ($9 & 4 | 0) == 0) HEAP32[$1 >> 2] = $8; else HEAP32[$4 >> 2] = $9 | 4; + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 1) | 0; + $9 = HEAP32[$4 >> 2] | 0; + if (($8 | 0) < 7 & ($9 & 4 | 0) == 0) HEAP32[$1 >> 2] = $8; else HEAP32[$4 >> 2] = $9 | 4; + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 2) | 0; + $9 = HEAP32[$4 >> 2] | 0; + if (($8 | 0) < 61 & ($9 & 4 | 0) == 0) HEAP32[$1 >> 2] = $8; else HEAP32[$4 >> 2] = $9 | 4; + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 2) | 0; + $9 = HEAP32[$4 >> 2] | 0; + if (($8 | 0) < 60 & ($9 & 4 | 0) == 0) HEAP32[$1 >> 2] = $8; else HEAP32[$4 >> 2] = $9 | 4; + STACKTOP = sp; + return; +} + +function _getProjectionFarPlane($id) { + $id = $id | 0; + var $farPlane = 0, $id$addr = 0, $retval$0 = 0.0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + if (!(__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0)) $retval$0 = -1.0; else { + $farPlane = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 320 | 0; + $retval$0 = +HEAPF64[$farPlane >> 3]; + } + STACKTOP = sp; + return +$retval$0; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 2) | 0; + $9 = HEAP32[$4 >> 2] | 0; + if (($8 | 0) < 24 & ($9 & 4 | 0) == 0) HEAP32[$1 >> 2] = $8; else HEAP32[$4 >> 2] = $9 | 4; + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 2) | 0; + $9 = HEAP32[$4 >> 2] | 0; + if (($8 | 0) < 24 & ($9 & 4 | 0) == 0) HEAP32[$1 >> 2] = $8; else HEAP32[$4 >> 2] = $9 | 4; + STACKTOP = sp; + return; +} + +function _kpmFopen($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $11 = 0, $5 = 0, $9 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer1 = sp + 8 | 0; + $vararg_buffer = sp; + do if ($0) { + if (!$1) { + $$0 = _fopen($0, $2) | 0; + break; + } + $5 = _strlen($0) | 0; + $9 = _malloc($5 + 2 + (_strlen($1) | 0) | 0) | 0; + if (!$9) { + _arLog(0, 3, 45930, $vararg_buffer); + _exit(1); + } else { + HEAP32[$vararg_buffer1 >> 2] = $0; + HEAP32[$vararg_buffer1 + 4 >> 2] = $1; + _sprintf($9, 26699, $vararg_buffer1) | 0; + $11 = _fopen($9, $2) | 0; + _free($9); + $$0 = $11; + break; + } + } else $$0 = 0; while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10VectorTypeEJRPNS2_4NodeES6_EEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = HEAP32[$1 >> 2] | 0; + __ZN12_GLOBAL__N_116itanium_demangle12NodeOrStringC2EPNS0_4NodeE($3, HEAP32[$2 >> 2] | 0); + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle10VectorTypeC2EPKNS0_4NodeENS0_12NodeOrStringE($4, $5, $$byval_copy); + STACKTOP = sp; + return $4 | 0; +} + +function _setMatrixCodeType($id, $type) { + $id = $id | 0; + $type = $type | 0; + var $arhandle = 0, $id$addr = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0) { + $arhandle = (__ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0) + 216 | 0; + _arSetMatrixCodeType(HEAP32[$arhandle >> 2] | 0, $type) | 0; + } + STACKTOP = sp; + return; +} + +function _fopen($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $11 = 0, $13 = 0, $6 = 0, $9 = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + if (_strchr(50840, HEAP8[$1 >> 0] | 0) | 0) { + $9 = ___fmodeflags($1) | 0 | 32768; + HEAP32[$vararg_buffer >> 2] = $0; + HEAP32[$vararg_buffer + 4 >> 2] = $9; + HEAP32[$vararg_buffer + 8 >> 2] = 438; + $11 = ___syscall_ret(___syscall5(5, $vararg_buffer | 0) | 0) | 0; + if (($11 | 0) >= 0) { + $13 = ___fdopen($11, $1) | 0; + if (!$13) { + ___wasi_fd_close($11 | 0) | 0; + $$0 = 0; + } else $$0 = $13; + } else $$0 = 0; + } else { + $6 = ___errno_location() | 0; + HEAP32[$6 >> 2] = 28; + $$0 = 0; + } + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $10 = 0, $3 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + if ($2 >>> 0 > 4294967279) __ZNKSt3__221__basic_string_commonILb1EE20__throw_length_errorEv($0); + if ($2 >>> 0 < 11) { + HEAP8[$0 + 11 >> 0] = $2; + $$0 = $0; + } else { + $9 = $2 + 16 & -16; + $10 = __Znwm($9) | 0; + HEAP32[$0 >> 2] = $10; + HEAP32[$0 + 8 >> 2] = $9 | -2147483648; + HEAP32[$0 + 4 >> 2] = $2; + $$0 = $10; + } + __ZNSt3__211char_traitsIcE4copyEPcPKcm($$0, $1, $2) | 0; + HEAP8[$3 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($$0 + $2 | 0, $3); + STACKTOP = sp; + return; +} + +function __ZN6vision5Image19calculate_unit_sizeENS_9ImageTypeE($0) { + $0 = $0 | 0; + var $$08 = 0, $1 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + switch ($0 | 0) { + case 1: + { + $$08 = $0; + break; + } + case 2: + { + $$08 = 4; + break; + } + default: + { + $2 = ___cxa_allocate_exception(16) | 0; + HEAP32[$1 >> 2] = 0; + HEAP32[$1 + 4 >> 2] = 0; + HEAP32[$1 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm($1, 38846, __ZNSt3__211char_traitsIcE6lengthEPKc(38846) | 0); + __ZN6vision9ExceptionC2ERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE($2, $1); + ___cxa_throw($2 | 0, 13208, 5); + } + } + STACKTOP = sp; + return $$08 | 0; +} + +function __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $10 = 0, $3 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + if ($1 >>> 0 > 4294967279) __ZNKSt3__221__basic_string_commonILb1EE20__throw_length_errorEv($0); + if ($1 >>> 0 < 11) { + HEAP8[$0 + 11 >> 0] = $1; + $$0 = $0; + } else { + $9 = $1 + 16 & -16; + $10 = __Znwm($9) | 0; + HEAP32[$0 >> 2] = $10; + HEAP32[$0 + 8 >> 2] = $9 | -2147483648; + HEAP32[$0 + 4 >> 2] = $1; + $$0 = $10; + } + __ZNSt3__211char_traitsIcE6assignEPcmc($$0, $1, $2) | 0; + HEAP8[$3 >> 0] = 0; + __ZNSt3__211char_traitsIcE6assignERcRKc($$0 + $1 | 0, $3); + STACKTOP = sp; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle11SpecialName9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $4 = $0 + 8 | 0; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $2; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast$byval_copy); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 16 >> 2] | 0, $1); + STACKTOP = sp; + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIiNS_9allocatorIiEEEEEENS_22__unordered_map_hasherIiS6_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS6_NS_8equal_toIiEELb1EEENS3_IS6_EEE21__construct_node_hashIRKNS_21piecewise_construct_tEJNS_5tupleIJRKiEEENSL_IJEEEEEENS_10unique_ptrINS_11__hash_nodeIS6_PvEENS_22__hash_node_destructorINS3_IST_EEEEEEmOT_DpOT0_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $7 = 0; + $7 = __Znwm(24) | 0; + HEAP32[$0 >> 2] = $7; + HEAP32[$0 + 4 >> 2] = $1 + 8; + HEAP32[$7 + 8 >> 2] = HEAP32[HEAP32[$4 >> 2] >> 2]; + HEAP32[$7 + 12 >> 2] = 0; + HEAP32[$7 + 16 >> 2] = 0; + HEAP32[$7 + 20 >> 2] = 0; + HEAP8[$0 + 8 >> 0] = 1; + HEAP32[$7 + 4 >> 2] = $2; + HEAP32[$7 >> 2] = 0; + return; +} + +function _arMatrixTrans($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$024 = 0, $$025 = 0, $$026 = 0, $$027 = 0, $$1 = 0, $3 = 0, $8 = 0; + $3 = HEAP32[$0 + 4 >> 2] | 0; + L1 : do if (($3 | 0) == (HEAP32[$1 + 8 >> 2] | 0) ? ($8 = HEAP32[$0 + 8 >> 2] | 0, ($8 | 0) == (HEAP32[$1 + 4 >> 2] | 0)) : 0) { + $$0 = HEAP32[$0 >> 2] | 0; + $$026 = 0; + while (1) { + if (($$026 | 0) >= ($3 | 0)) { + $$027 = 0; + break L1; + } + $$024 = (HEAP32[$1 >> 2] | 0) + ($$026 << 3) | 0; + $$025 = 0; + $$1 = $$0; + while (1) { + if (($$025 | 0) >= ($8 | 0)) break; + HEAPF64[$$1 >> 3] = +HEAPF64[$$024 >> 3]; + $$024 = $$024 + ($3 << 3) | 0; + $$025 = $$025 + 1 | 0; + $$1 = $$1 + 8 | 0; + } + $$0 = $$1; + $$026 = $$026 + 1 | 0; + } + } else $$027 = -1; while (0); + return $$027 | 0; +} + +function _arMatrixTransf($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$024 = 0, $$025 = 0, $$026 = 0, $$027 = 0, $$1 = 0, $3 = 0, $8 = 0; + $3 = HEAP32[$0 + 4 >> 2] | 0; + L1 : do if (($3 | 0) == (HEAP32[$1 + 8 >> 2] | 0) ? ($8 = HEAP32[$0 + 8 >> 2] | 0, ($8 | 0) == (HEAP32[$1 + 4 >> 2] | 0)) : 0) { + $$0 = HEAP32[$0 >> 2] | 0; + $$026 = 0; + while (1) { + if (($$026 | 0) >= ($3 | 0)) { + $$027 = 0; + break L1; + } + $$024 = (HEAP32[$1 >> 2] | 0) + ($$026 << 2) | 0; + $$025 = 0; + $$1 = $$0; + while (1) { + if (($$025 | 0) >= ($8 | 0)) break; + HEAP32[$$1 >> 2] = HEAP32[$$024 >> 2]; + $$024 = $$024 + ($3 << 2) | 0; + $$025 = $$025 + 1 | 0; + $$1 = $$1 + 4 | 0; + } + $$0 = $$1; + $$026 = $$026 + 1 | 0; + } + } else $$027 = -1; while (0); + return $$027 | 0; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEEEENS_22__unordered_map_hasherIiS7_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS7_NS_8equal_toIiEELb1EEENS_9allocatorIS7_EEE21__construct_node_hashIRKNS_21piecewise_construct_tEJNS_5tupleIJRKiEEENSN_IJEEEEEENS_10unique_ptrINS_11__hash_nodeIS7_PvEENS_22__hash_node_destructorINSG_ISV_EEEEEEmOT_DpOT0_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $7 = 0; + $7 = __Znwm(20) | 0; + HEAP32[$0 >> 2] = $7; + HEAP32[$0 + 4 >> 2] = $1 + 8; + HEAP32[$7 + 8 >> 2] = HEAP32[HEAP32[$4 >> 2] >> 2]; + HEAP32[$7 + 12 >> 2] = 0; + HEAP32[$7 + 16 >> 2] = 0; + HEAP8[$0 + 8 >> 0] = 1; + HEAP32[$7 + 4 >> 2] = $2; + HEAP32[$7 >> 2] = 0; + return; +} + +function __ZN6vision26SmoothOrientationHistogramIfEEvPT_PKS1_mS4_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0.0, $$033 = 0, $21 = 0.0, $28 = 0, $4 = 0.0, $5 = 0, $6 = 0, $8 = 0, $9 = 0; + $4 = +HEAPF32[$1 >> 2]; + $5 = $2 + -1 | 0; + $6 = $1 + ($5 << 2) | 0; + $8 = $3 + 4 | 0; + $9 = $3 + 8 | 0; + $$0 = +HEAPF32[$6 >> 2]; + $$033 = 0; + while (1) { + if (($$033 | 0) == ($5 | 0)) break; + $21 = +HEAPF32[$1 + ($$033 << 2) >> 2]; + $28 = $$033 + 1 | 0; + HEAPF32[$0 + ($$033 << 2) >> 2] = $$0 * +HEAPF32[$3 >> 2] + $21 * +HEAPF32[$8 >> 2] + +HEAPF32[$9 >> 2] * +HEAPF32[$1 + ($28 << 2) >> 2]; + $$0 = $21; + $$033 = $28; + } + HEAPF32[$0 + ($5 << 2) >> 2] = $$0 * +HEAPF32[$3 >> 2] + +HEAPF32[$8 >> 2] * +HEAPF32[$6 >> 2] + $4 * +HEAPF32[$9 >> 2]; + return; +} + +function __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $18 = 0, $2 = 0, $24 = 0, $30 = 0, $34 = 0, $6 = 0; + $1 = $0 + 4 | 0; + $2 = HEAP32[$1 >> 2] | 0; + $6 = $2 + (HEAP32[(HEAP32[$2 >> 2] | 0) + -12 >> 2] | 0) | 0; + if ((((HEAP32[$6 + 24 >> 2] | 0 ? (HEAP32[$6 + 16 >> 2] | 0) == 0 : 0) ? HEAP32[$6 + 4 >> 2] & 8192 | 0 : 0) ? !(__ZSt18uncaught_exceptionv() | 0) : 0) ? ($18 = HEAP32[$1 >> 2] | 0, $24 = HEAP32[$18 + (HEAP32[(HEAP32[$18 >> 2] | 0) + -12 >> 2] | 0) + 24 >> 2] | 0, (FUNCTION_TABLE_ii[HEAP32[(HEAP32[$24 >> 2] | 0) + 24 >> 2] & 127]($24) | 0) == -1) : 0) { + $30 = HEAP32[$1 >> 2] | 0; + $34 = $30 + (HEAP32[(HEAP32[$30 >> 2] | 0) + -12 >> 2] | 0) | 0; + __ZNSt3__28ios_base5clearEj($34, HEAP32[$34 + 16 >> 2] | 1); + } + return; +} + +function __ZNKSt3__27codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$029 = 0, $$030 = 0, $$034 = 0, $$sink = 0, $12 = 0, $13 = 0, $5 = 0, $6 = 0; + $5 = $3; + $6 = $0 + 8 | 0; + $$029 = 0; + $$030 = 0; + $$034 = $2; + L1 : while (1) { + if (($$034 | 0) == ($3 | 0) | $$029 >>> 0 >= $4 >>> 0) break; + $12 = ___uselocale(HEAP32[$6 >> 2] | 0) | 0; + $13 = _mbrlen($$034, $5 - $$034 | 0, $1) | 0; + if ($12 | 0) ___uselocale($12) | 0; + switch ($13 | 0) { + case -2: + case -1: + { + break L1; + break; + } + case 0: + { + $$sink = 1; + break; + } + default: + $$sink = $13; + } + $$029 = $$029 + 1 | 0; + $$030 = $$sink + $$030 | 0; + $$034 = $$034 + $$sink | 0; + } + return $$030 | 0; +} + +function __ZNSt3__214__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $6 = 0, label = 0; + L1 : do switch ((HEAP32[$2 + 4 >> 2] & 176) << 24 >> 24) { + case 16: + { + $6 = HEAP8[$0 >> 0] | 0; + switch ($6 << 24 >> 24) { + case 43: + case 45: + { + $$0 = $0 + 1 | 0; + break L1; + break; + } + default: + {} + } + if (($1 - $0 | 0) > 1 & $6 << 24 >> 24 == 48) { + switch (HEAP8[$0 + 1 >> 0] | 0) { + case 88: + case 120: + break; + default: + { + label = 7; + break L1; + } + } + $$0 = $0 + 2 | 0; + } else label = 7; + break; + } + case 32: + { + $$0 = $1; + break; + } + default: + label = 7; + } while (0); + if ((label | 0) == 7) $$0 = $0; + return $$0 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13ReferenceType8collapseERNS_12OutputStreamE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$in = 0, $13 = 0, $17 = 0, $19 = 0, $21 = 0, $22 = 0, $5 = 0, $6 = 0, $7 = 0; + $5 = HEAP32[$1 + 12 >> 2] | 0; + HEAP32[$0 >> 2] = $5; + $6 = $0 + 4 | 0; + $7 = HEAP32[$1 + 8 >> 2] | 0; + HEAP32[$6 >> 2] = $7; + $$in = $7; + $21 = $5; + while (1) { + $13 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$$in >> 2] | 0) + 12 >> 2] & 127]($$in, $2) | 0; + if ((__ZNK12_GLOBAL__N_116itanium_demangle4Node7getKindEv($13) | 0) << 24 >> 24 != 12) break; + $17 = HEAP32[$13 + 8 >> 2] | 0; + HEAP32[$6 >> 2] = $17; + $19 = HEAP32[$13 + 12 >> 2] | 0; + $22 = ($19 | 0) < ($21 | 0) ? $19 : $21; + HEAP32[$0 >> 2] = $22; + $$in = $17; + $21 = $22; + } + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle20PostfixQualifiedTypeEJRPNS2_4NodeERA11_KcEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = HEAP32[$1 >> 2] | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, $2); + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle20PostfixQualifiedTypeC2EPNS0_4NodeENS_10StringViewE($4, $5, $$byval_copy); + STACKTOP = sp; + return $4 | 0; +} + +function _arUtilReplaceExt($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$023 = 0, $$024 = 0, $$1 = 0, $$2 = 0, $6 = 0, $9 = 0, label = 0; + $$0 = 0; + $$023 = 0; + L1 : while (1) { + switch (HEAP8[$0 + $$023 >> 0] | 0) { + case 0: + { + break L1; + break; + } + case 46: + { + $$1 = $$023; + break; + } + default: + $$1 = $$0; + } + $$0 = $$1; + $$023 = $$023 + 1 | 0; + } + $6 = $0 + $$023 | 0; + $9 = (_strlen($2) | 0) + 2 | 0; + if (!$$0) if (($9 + $$023 | 0) > ($1 | 0)) $$024 = -1; else { + HEAP8[$6 >> 0] = 46; + $$2 = $$023; + label = 9; + } else if (($9 + $$0 | 0) > ($1 | 0)) $$024 = -1; else { + $$2 = $$0; + label = 9; + } + if ((label | 0) == 9) { + HEAP8[$0 + ($$2 + 1) >> 0] = 0; + _strcat($0, $2) | 0; + $$024 = 0; + } + return $$024 | 0; +} + +function ___fflush_unlocked($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $17 = 0, $3 = 0, label = 0; + $1 = $0 + 20 | 0; + $3 = $0 + 28 | 0; + if ((HEAP32[$1 >> 2] | 0) >>> 0 > (HEAP32[$3 >> 2] | 0) >>> 0 ? (FUNCTION_TABLE_iiii[HEAP32[$0 + 36 >> 2] & 63]($0, 0, 0) | 0, (HEAP32[$1 >> 2] | 0) == 0) : 0) $$0 = -1; else { + $10 = $0 + 4 | 0; + $11 = HEAP32[$10 >> 2] | 0; + $12 = $0 + 8 | 0; + $13 = HEAP32[$12 >> 2] | 0; + if ($11 >>> 0 < $13 >>> 0) { + $17 = $11 - $13 | 0; + FUNCTION_TABLE_iiiii[HEAP32[$0 + 40 >> 2] & 15]($0, $17, (($17 | 0) < 0) << 31 >> 31, 1) | 0; + getTempRet0() | 0; + } + HEAP32[$0 + 16 >> 2] = 0; + HEAP32[$3 >> 2] = 0; + HEAP32[$1 >> 2] = 0; + HEAP32[$12 >> 2] = 0; + HEAP32[$10 >> 2] = 0; + $$0 = 0; + } + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle20PostfixQualifiedTypeEJRPNS2_4NodeERA9_KcEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = HEAP32[$1 >> 2] | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, $2); + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle20PostfixQualifiedTypeC2EPNS0_4NodeENS_10StringViewE($4, $5, $$byval_copy); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEED2Ev($0) { + $0 = $0 | 0; + __ZN6vision16RobustHomographyIfED2Ev($0 + 788 | 0); + __ZN6vision21HoughSimilarityVotingD2Ev($0 + 652 | 0); + __ZN6vision20BinaryFeatureMatcherILi96EED2Ev($0 + 636 | 0); + __ZN6vision14FREAKExtractorD2Ev($0 + 316 | 0); + __ZN6vision25DoGScaleInvariantDetectorD2Ev($0 + 160 | 0); + __ZN6vision18BinomialPyramid32fD2Ev($0 + 92 | 0); + __ZNSt3__213unordered_mapIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEENS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS5_EEEEED2Ev($0 + 72 | 0); + __ZNSt3__210shared_ptrIN6vision8KeyframeILi96EEEED2Ev($0 + 64 | 0); + __ZNSt3__213__vector_baseIN6vision7match_tENS_9allocatorIS2_EEED2Ev($0 + 12 | 0); + return; +} + +function _kpmDeleteRefDataSet($0) { + $0 = $0 | 0; + var $$0 = 0, $$013 = 0, $10 = 0, $2 = 0, $4 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + if ($0) { + $2 = HEAP32[$0 >> 2] | 0; + if (!$2) $$013 = 0; else { + $4 = HEAP32[$2 >> 2] | 0; + if ($4 | 0) _free($4); + $$0 = 0; + while (1) { + $6 = HEAP32[$0 >> 2] | 0; + $10 = $6 + 8 | 0; + if (($$0 | 0) >= (HEAP32[$6 + 12 >> 2] | 0)) break; + _free(HEAP32[(HEAP32[$10 >> 2] | 0) + ($$0 * 12 | 0) >> 2] | 0); + $$0 = $$0 + 1 | 0; + } + _free(HEAP32[$10 >> 2] | 0); + _free(HEAP32[$0 >> 2] | 0); + HEAP32[$0 >> 2] = 0; + $$013 = 0; + } + } else { + _arLog(0, 3, 26264, sp); + $$013 = -1; + } + STACKTOP = sp; + return $$013 | 0; +} + +function __ZNK12_GLOBAL__N_110StringView10startsWithES0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$0$i$i = 0, $$08$i$i = 0, $2 = 0, $5 = 0, $6 = 0; + $2 = __ZNK12_GLOBAL__N_110StringView4sizeEv($1) | 0; + L1 : do if ($2 >>> 0 > (__ZNK12_GLOBAL__N_110StringView4sizeEv($0) | 0) >>> 0) $$0 = 0; else { + $5 = __ZNK12_GLOBAL__N_110StringView5beginEv($1) | 0; + $6 = __ZNK12_GLOBAL__N_110StringView3endEv($1) | 0; + $$0$i$i = __ZNK12_GLOBAL__N_110StringView5beginEv($0) | 0; + $$08$i$i = $5; + while (1) { + if (($$08$i$i | 0) == ($6 | 0)) { + $$0 = 1; + break L1; + } + if ((HEAP8[$$08$i$i >> 0] | 0) != (HEAP8[$$0$i$i >> 0] | 0)) { + $$0 = 0; + break L1; + } + $$0$i$i = $$0$i$i + 1 | 0; + $$08$i$i = $$08$i$i + 1 | 0; + } + } while (0); + return $$0 | 0; +} + +function __ZN6vision14FREAKExtractorC2Ev($0) { + $0 = $0 | 0; + __ZN6vision10CopyVectorIfEEvPT_PKS1_m($0, 1760, 12); + __ZN6vision10CopyVectorIfEEvPT_PKS1_m($0 + 48 | 0, 1808, 12); + __ZN6vision10CopyVectorIfEEvPT_PKS1_m($0 + 96 | 0, 1856, 12); + __ZN6vision10CopyVectorIfEEvPT_PKS1_m($0 + 144 | 0, 1904, 12); + __ZN6vision10CopyVectorIfEEvPT_PKS1_m($0 + 192 | 0, 1952, 12); + __ZN6vision10CopyVectorIfEEvPT_PKS1_m($0 + 240 | 0, 2e3, 12); + HEAPF32[$0 + 288 >> 2] = .10000000149011612; + HEAPF32[$0 + 292 >> 2] = .17499999701976776; + HEAPF32[$0 + 296 >> 2] = .25; + HEAPF32[$0 + 300 >> 2] = .32499998807907104; + HEAPF32[$0 + 304 >> 2] = .4000000059604645; + HEAPF32[$0 + 308 >> 2] = .4749999940395355; + HEAPF32[$0 + 312 >> 2] = .550000011920929; + HEAPF32[$0 + 316 >> 2] = 7.0; + return; +} + +function __ZN6vision18BinomialPyramid32f18apply_filter_twiceERNS_5ImageERKS1_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $3 = sp; + $5 = HEAP32[$0 + 56 >> 2] | 0; + $6 = __ZNK6vision5Image4typeEv($2) | 0; + $7 = __ZNK6vision5Image5widthEv($2) | 0; + $8 = __ZNK6vision5Image6heightEv($2) | 0; + __ZN6vision5ImageC2EPhNS_9ImageTypeEmmim($3, $5, $6, $7, $8, __ZNK6vision5Image4stepEv($2) | 0, 1); + __ZN6vision18BinomialPyramid32f12apply_filterERNS_5ImageERKS1_($0, $3, $2); + __ZN6vision18BinomialPyramid32f12apply_filterERNS_5ImageERKS1_($0, $1, $3); + __ZN6vision5ImageD2Ev($3); + STACKTOP = sp; + return; +} + +function _jpeg_read_header($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$pre$phiZ2D = 0, $10 = 0, $12 = 0, $3 = 0, $5 = 0; + $3 = HEAP32[$0 + 20 >> 2] | 0; + if (($3 & -2 | 0) != 200) { + $5 = HEAP32[$0 >> 2] | 0; + HEAP32[$5 + 20 >> 2] = 21; + HEAP32[$5 + 24 >> 2] = $3; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + } + $10 = _jpeg_consume_input($0) | 0; + switch ($10 | 0) { + case 1: + { + $$0 = 1; + return $$0 | 0; + } + case 2: + { + if (!$1) $$pre$phiZ2D = $0; else { + $12 = HEAP32[$0 >> 2] | 0; + HEAP32[$12 + 20 >> 2] = 53; + FUNCTION_TABLE_vi[HEAP32[$12 >> 2] & 255]($0); + $$pre$phiZ2D = $0; + } + _jpeg_abort($$pre$phiZ2D); + $$0 = 2; + return $$0 | 0; + } + default: + { + $$0 = $10; + return $$0 | 0; + } + } + return 0; +} + +function __ZNSt3__26vectorINS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEE6resizeEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0, $12 = 0, $14 = 0, $2 = 0, $3 = 0, $4 = 0, $6 = 0, $8 = 0, $9 = 0; + $2 = $0 + 4 | 0; + $3 = HEAP32[$2 >> 2] | 0; + $4 = HEAP32[$0 >> 2] | 0; + $6 = ($3 - $4 | 0) / 12 | 0; + $8 = $4; + $9 = $3; + if ($6 >>> 0 >= $1 >>> 0) { + if ($6 >>> 0 > $1 >>> 0) { + $12 = $8 + ($1 * 12 | 0) | 0; + $$0$i$i = $9; + while (1) { + if (($$0$i$i | 0) == ($12 | 0)) break; + $14 = $$0$i$i + -12 | 0; + __ZNSt3__213__vector_baseINS_4pairIfmEENS_9allocatorIS2_EEED2Ev($14); + $$0$i$i = $14; + } + HEAP32[$2 >> 2] = $12; + } + } else __ZNSt3__26vectorINS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEE8__appendEm($0, $1 - $6 | 0); + return; +} + +function _cat($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $10 = 0, $3 = 0, $4 = 0, $6 = 0, $7 = 0, $8 = 0; + do if ($0) { + $4 = _fopen($0, 26308) | 0; + if ($4) { + _fseek($4, 0, 2) | 0; + $6 = _ftell($4) | 0; + _fseek($4, 0, 0) | 0; + $7 = $6 + 1 | 0; + $8 = _malloc($7) | 0; + if (!$8) { + _fclose($4) | 0; + $10 = ___errno_location() | 0; + HEAP32[$10 >> 2] = 48; + $$0 = 0; + break; + } + if (!(_fread($8, $6, 1, $4) | 0)) { + _free($8); + _fclose($4) | 0; + $$0 = 0; + break; + } + HEAP8[$8 + $6 >> 0] = 0; + _fclose($4) | 0; + if (!$1) $$0 = $8; else { + HEAP32[$1 >> 2] = $7; + $$0 = $8; + } + } else $$0 = 0; + } else { + $3 = ___errno_location() | 0; + HEAP32[$3 >> 2] = 28; + $$0 = 0; + } while (0); + return $$0 | 0; +} + +function __ZNSt3__26locale5__impD2Ev($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0, $11 = 0, $13 = 0, $14 = 0, $2 = 0, $4 = 0; + HEAP32[$0 >> 2] = 23288; + $1 = $0 + 8 | 0; + $2 = $0 + 12 | 0; + $$0 = 0; + while (1) { + $4 = HEAP32[$1 >> 2] | 0; + if ($$0 >>> 0 >= (HEAP32[$2 >> 2] | 0) - $4 >> 2 >>> 0) break; + $11 = HEAP32[$4 + ($$0 << 2) >> 2] | 0; + if ($11 | 0 ? ($13 = $11 + 4 | 0, $14 = HEAP32[$13 >> 2] | 0, HEAP32[$13 >> 2] = $14 + -1, ($14 | 0) == 0) : 0) FUNCTION_TABLE_vi[HEAP32[(HEAP32[$11 >> 2] | 0) + 8 >> 2] & 255]($11); + $$0 = $$0 + 1 | 0; + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($0 + 144 | 0); + __ZNSt3__213__vector_baseIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEED2Ev($1); + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13QualifiedName9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 53698); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 12 >> 2] | 0, $1); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_1eqERKNS_10StringViewES2_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0, $$08$i$i = 0, $14 = 0, $2 = 0, $5 = 0, $6 = 0; + $2 = __ZNK12_GLOBAL__N_110StringView4sizeEv($0) | 0; + L1 : do if (($2 | 0) == (__ZNK12_GLOBAL__N_110StringView4sizeEv($1) | 0)) { + $5 = __ZNK12_GLOBAL__N_110StringView5beginEv($0) | 0; + $6 = __ZNK12_GLOBAL__N_110StringView3endEv($0) | 0; + $$0$i$i = __ZNK12_GLOBAL__N_110StringView5beginEv($1) | 0; + $$08$i$i = $5; + while (1) { + if (($$08$i$i | 0) == ($6 | 0)) { + $14 = 1; + break L1; + } + if ((HEAP8[$$08$i$i >> 0] | 0) != (HEAP8[$$0$i$i >> 0] | 0)) { + $14 = 0; + break L1; + } + $$0$i$i = $$0$i$i + 1 | 0; + $$08$i$i = $$08$i$i + 1 | 0; + } + } else $14 = 0; while (0); + return $14 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA41_KcRPNS2_4NodeEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, $1); + $5 = HEAP32[$2 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle11SpecialNameC2ENS_10StringViewEPKNS0_4NodeE($4, $$byval_copy, $5); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA34_KcRPNS2_4NodeEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, $1); + $5 = HEAP32[$2 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle11SpecialNameC2ENS_10StringViewEPKNS0_4NodeE($4, $$byval_copy, $5); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA27_KcRPNS2_4NodeEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, $1); + $5 = HEAP32[$2 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle11SpecialNameC2ENS_10StringViewEPKNS0_4NodeE($4, $$byval_copy, $5); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA25_KcRPNS2_4NodeEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, $1); + $5 = HEAP32[$2 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle11SpecialNameC2ENS_10StringViewEPKNS0_4NodeE($4, $$byval_copy, $5); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA22_KcRPNS2_4NodeEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, $1); + $5 = HEAP32[$2 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle11SpecialNameC2ENS_10StringViewEPKNS0_4NodeE($4, $$byval_copy, $5); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA20_KcRPNS2_4NodeEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, $1); + $5 = HEAP32[$2 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle11SpecialNameC2ENS_10StringViewEPKNS0_4NodeE($4, $$byval_copy, $5); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA19_KcRPNS2_4NodeEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, $1); + $5 = HEAP32[$2 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle11SpecialNameC2ENS_10StringViewEPKNS0_4NodeE($4, $$byval_copy, $5); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA18_KcRPNS2_4NodeEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, $1); + $5 = HEAP32[$2 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle11SpecialNameC2ENS_10StringViewEPKNS0_4NodeE($4, $$byval_copy, $5); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA14_KcRPNS2_4NodeEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, $1); + $5 = HEAP32[$2 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle11SpecialNameC2ENS_10StringViewEPKNS0_4NodeE($4, $$byval_copy, $5); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA12_KcRPNS2_4NodeEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, $1); + $5 = HEAP32[$2 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle11SpecialNameC2ENS_10StringViewEPKNS0_4NodeE($4, $$byval_copy, $5); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA9_KcRPNS2_4NodeEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, $1); + $5 = HEAP32[$2 >> 2] | 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle11SpecialNameC2ENS_10StringViewEPKNS0_4NodeE($4, $$byval_copy, $5); + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11PostfixExprEJRPNS2_4NodeERA3_KcEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$byval_copy = 0, $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $3 = sp; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + $5 = HEAP32[$1 >> 2] | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($3, $2); + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle11PostfixExprC2EPKNS0_4NodeENS_10StringViewE($4, $5, $$byval_copy); + STACKTOP = sp; + return $4 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle10NestedName9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 53698); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 12 >> 2] | 0, $1); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_EC2EPKcS7_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + HEAP32[$0 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = $2; + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EEC2Ev($0 + 8 | 0); + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EEC2Ev($0 + 148 | 0); + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EEC2Ev($0 + 288 | 0); + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EEC2Ev($0 + 332 | 0); + HEAP8[$0 + 360 >> 0] = 1; + HEAP8[$0 + 361 >> 0] = 0; + HEAP8[$0 + 362 >> 0] = 0; + __ZN12_GLOBAL__N_116DefaultAllocatorC2Ev($0 + 368 | 0); + return; +} + +function __ZNKSt3__210__time_put8__do_putEPcRS1_PK2tmcc($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $12 = 0, $15 = 0, $6 = 0, $7 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $6 = sp; + HEAP8[$6 >> 0] = 37; + $7 = $6 + 1 | 0; + HEAP8[$7 >> 0] = $4; + $8 = $6 + 2 | 0; + HEAP8[$8 >> 0] = $5; + HEAP8[$6 + 3 >> 0] = 0; + if ($5 << 24 >> 24) { + HEAP8[$7 >> 0] = $5; + HEAP8[$8 >> 0] = $4; + } + $12 = __ZNSt3__212_GLOBAL__N_17countofIcEEmPKT_S4_($1, HEAP32[$2 >> 2] | 0) | 0; + $15 = $1 + (_strftime_l($1 | 0, $12 | 0, $6 | 0, $3 | 0, HEAP32[$0 >> 2] | 0) | 0) | 0; + HEAP32[$2 >> 2] = $15; + STACKTOP = sp; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle9LocalName9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 53698); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 12 >> 2] | 0, $1); + STACKTOP = sp; + return; +} + +function __ZNSt3__26locale2id5__getEv($0) { + $0 = $0 | 0; + var $$byval_copy = 0, $1 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $$byval_copy = sp + 32 | 0; + $1 = sp + 24 | 0; + $2 = sp; + $3 = sp + 16 | 0; + HEAP32[$3 >> 2] = 212; + HEAP32[$3 + 4 >> 2] = 0; + HEAP32[$$byval_copy >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$3 + 4 >> 2]; + __ZNSt3__212_GLOBAL__N_111__fake_bindC2EMNS_6locale2idEFvvEPS3_($2, $$byval_copy, $0); + if ((HEAP32[$0 >> 2] | 0) != -1) { + HEAP32[$$byval_copy >> 2] = $2; + HEAP32[$1 >> 2] = $$byval_copy; + __ZNSt3__211__call_onceERVmPvPFvS2_E($0, $1, 213); + } + STACKTOP = sp; + return (HEAP32[$0 + 4 >> 2] | 0) + -1 | 0; +} + +function __ZN6vision14Determinant3x3IfEET_PKS1_($0) { + $0 = $0 | 0; + var $1 = 0, $10 = 0, $13 = 0, $16 = 0.0, $21 = 0.0, $3 = 0, $5 = 0, $7 = 0, $9 = 0.0; + $1 = $0 + 16 | 0; + $3 = $0 + 20 | 0; + $5 = $0 + 28 | 0; + $7 = $0 + 32 | 0; + $9 = +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_S1_(+HEAPF32[$1 >> 2], +HEAPF32[$3 >> 2], +HEAPF32[$5 >> 2], +HEAPF32[$7 >> 2]); + $10 = $0 + 12 | 0; + $13 = $0 + 24 | 0; + $16 = +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_S1_(+HEAPF32[$10 >> 2], +HEAPF32[$3 >> 2], +HEAPF32[$13 >> 2], +HEAPF32[$7 >> 2]); + $21 = +__ZN6vision11Cofactor2x2IfEET_S1_S1_S1_S1_(+HEAPF32[$10 >> 2], +HEAPF32[$1 >> 2], +HEAPF32[$13 >> 2], +HEAPF32[$5 >> 2]); + return +($9 * +HEAPF32[$0 >> 2] - $16 * +HEAPF32[$0 + 4 >> 2] + $21 * +HEAPF32[$0 + 8 >> 2]); +} + +function _strtox_735($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $10 = 0, $12 = 0, $13 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 144 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(144); + $5 = sp; + HEAP32[$5 >> 2] = 0; + $6 = $5 + 4 | 0; + HEAP32[$6 >> 2] = $0; + HEAP32[$5 + 44 >> 2] = $0; + $10 = $5 + 8 | 0; + HEAP32[$10 >> 2] = ($0 | 0) < 0 ? -1 : $0 + 2147483647 | 0; + HEAP32[$5 + 76 >> 2] = -1; + ___shlim($5, 0, 0); + $12 = ___intscan($5, $2, 1, $3, $4) | 0; + $13 = getTempRet0() | 0; + if ($1 | 0) HEAP32[$1 >> 2] = $0 + ((HEAP32[$6 >> 2] | 0) + (HEAP32[$5 + 120 >> 2] | 0) - (HEAP32[$10 >> 2] | 0)); + setTempRet0($13 | 0); + STACKTOP = sp; + return $12 | 0; +} + +function __ZNSt3__211__stdoutbufIwE6xsputnEPKwl($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$010 = 0, $$011 = 0, $12 = 0, $14 = 0, $15 = 0; + L1 : do if (!(HEAP8[$0 + 44 >> 0] | 0)) { + $$0 = 0; + $$011 = $1; + while (1) { + if (($$0 | 0) >= ($2 | 0)) { + $$010 = $$0; + break L1; + } + $12 = HEAP32[(HEAP32[$0 >> 2] | 0) + 52 >> 2] | 0; + $14 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$$011 >> 2] | 0) | 0; + $15 = FUNCTION_TABLE_iii[$12 & 127]($0, $14) | 0; + if (($15 | 0) == (__ZNSt3__211char_traitsIwE3eofEv() | 0)) { + $$010 = $$0; + break L1; + } + $$0 = $$0 + 1 | 0; + $$011 = $$011 + 4 | 0; + } + } else $$010 = _fwrite($1, 4, $2, HEAP32[$0 + 32 >> 2] | 0) | 0; while (0); + return $$010 | 0; +} + +function __ZNSt3__214__num_put_base12__format_intEPcPKcbj($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$013 = 0, $$2 = 0, $$2$ph = 0, $$sink = 0, $10 = 0; + if (!($3 & 2048)) $$0 = $0; else { + HEAP8[$0 >> 0] = 43; + $$0 = $0 + 1 | 0; + } + if (!($3 & 512)) $$2$ph = $$0; else { + HEAP8[$$0 >> 0] = 35; + $$2$ph = $$0 + 1 | 0; + } + $$013 = $1; + $$2 = $$2$ph; + while (1) { + $10 = HEAP8[$$013 >> 0] | 0; + if (!($10 << 24 >> 24)) break; + HEAP8[$$2 >> 0] = $10; + $$013 = $$013 + 1 | 0; + $$2 = $$2 + 1 | 0; + } + switch ($3 & 74) { + case 64: + { + $$sink = 111; + break; + } + case 8: + { + $$sink = $3 >>> 9 & 32 ^ 120; + break; + } + default: + $$sink = $2 ? 100 : 117; + } + HEAP8[$$2 >> 0] = $$sink; + return; +} + +function __ZNSt3__211__stdoutbufIcE6xsputnEPKcl($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$010 = 0, $$011 = 0, $12 = 0, $14 = 0, $15 = 0; + L1 : do if (!(HEAP8[$0 + 44 >> 0] | 0)) { + $$0 = 0; + $$011 = $1; + while (1) { + if (($$0 | 0) >= ($2 | 0)) { + $$010 = $$0; + break L1; + } + $12 = HEAP32[(HEAP32[$0 >> 2] | 0) + 52 >> 2] | 0; + $14 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$$011 >> 0] | 0) | 0; + $15 = FUNCTION_TABLE_iii[$12 & 127]($0, $14) | 0; + if (($15 | 0) == (__ZNSt3__211char_traitsIcE3eofEv() | 0)) { + $$010 = $$0; + break L1; + } + $$0 = $$0 + 1 | 0; + $$011 = $$011 + 1 | 0; + } + } else $$010 = _fwrite($1, 1, $2, HEAP32[$0 + 32 >> 2] | 0) | 0; while (0); + return $$010 | 0; +} + +function _skip_input_data($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$lcssa = 0, $$013 = 0, $$lcssa = 0, $10 = 0, $12 = 0, $3 = 0, $5 = 0, $6 = 0, $8 = 0, $9 = 0; + $3 = HEAP32[$0 + 24 >> 2] | 0; + if (($1 | 0) <= 0) return; + $5 = $3 + 4 | 0; + $6 = HEAP32[$5 >> 2] | 0; + if (($6 | 0) < ($1 | 0)) { + $8 = $3 + 12 | 0; + $$013 = $1; + $10 = $6; + while (1) { + $9 = $$013 - $10 | 0; + FUNCTION_TABLE_ii[HEAP32[$8 >> 2] & 127]($0) | 0; + $12 = HEAP32[$5 >> 2] | 0; + if (($9 | 0) > ($12 | 0)) { + $$013 = $9; + $10 = $12; + } else { + $$0$lcssa = $9; + $$lcssa = $12; + break; + } + } + } else { + $$0$lcssa = $1; + $$lcssa = $6; + } + HEAP32[$3 >> 2] = (HEAP32[$3 >> 2] | 0) + $$0$lcssa; + HEAP32[$5 >> 2] = $$lcssa - $$0$lcssa; + return; +} + +function _arPattLoad($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $4 = 0, $6 = 0, $7 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer1 = sp + 8 | 0; + $vararg_buffer = sp; + $2 = _cat($1, 0) | 0; + if (!$2) { + HEAP32[$vararg_buffer >> 2] = $1; + _arLog(0, 3, 24397, $vararg_buffer); + $4 = ___errno_location() | 0; + $6 = _strerror(HEAP32[$4 >> 2] | 0) | 0; + HEAP32[$vararg_buffer1 >> 2] = 67447; + HEAP32[$vararg_buffer1 + 4 >> 2] = $6; + _arLog(0, 3, 25953, $vararg_buffer1); + $$0 = -1; + } else { + $7 = _arPattLoadFromBuffer($0, $2) | 0; + _free($2); + $$0 = $7; + } + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS5_EEEEEENS_22__unordered_map_hasherIiS9_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS9_NS_8equal_toIiEELb1EEENS6_IS9_EEED2Ev($0) { + $0 = $0 | 0; + var $3 = 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS5_EEEEEENS_22__unordered_map_hasherIiS9_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS9_NS_8equal_toIiEELb1EEENS6_IS9_EEE17__deallocate_nodeEPNS_16__hash_node_baseIPNS_11__hash_nodeIS9_PvEEEE($0, HEAP32[$0 + 8 >> 2] | 0); + $3 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = 0; + if ($3 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($3, HEAP32[$0 + 4 >> 2] << 2); + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEEEENS_22__unordered_map_hasherIiS7_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS7_NS_8equal_toIiEELb1EEENS_9allocatorIS7_EEED2Ev($0) { + $0 = $0 | 0; + var $3 = 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEEEENS_22__unordered_map_hasherIiS7_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS7_NS_8equal_toIiEELb1EEENS_9allocatorIS7_EEE17__deallocate_nodeEPNS_16__hash_node_baseIPNS_11__hash_nodeIS7_PvEEEE($0, HEAP32[$0 + 8 >> 2] | 0); + $3 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = 0; + if ($3 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($3, HEAP32[$0 + 4 >> 2] << 2); + return; +} + +function _arUtilMatMuldff($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$023 = 0, $28 = 0, $3 = 0, $4 = 0, $5 = 0; + $$0 = 0; + while (1) { + if (($$0 | 0) == 3) break; + $3 = $0 + ($$0 << 5) | 0; + $4 = $0 + ($$0 << 5) + 8 | 0; + $5 = $0 + ($$0 << 5) + 16 | 0; + $$023 = 0; + while (1) { + if (($$023 | 0) == 4) break; + HEAPF32[$2 + ($$0 << 4) + ($$023 << 2) >> 2] = +HEAPF32[$1 + ($$023 << 2) >> 2] * +HEAPF64[$3 >> 3] + +HEAPF32[$1 + 16 + ($$023 << 2) >> 2] * +HEAPF64[$4 >> 3] + +HEAPF32[$1 + 32 + ($$023 << 2) >> 2] * +HEAPF64[$5 >> 3]; + $$023 = $$023 + 1 | 0; + } + $28 = $2 + ($$0 << 4) + 12 | 0; + HEAPF32[$28 >> 2] = +HEAPF32[$28 >> 2] + +HEAPF64[$0 + ($$0 << 5) + 24 >> 3]; + $$0 = $$0 + 1 | 0; + } + return 0; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 4) | 0; + if (!(HEAP32[$4 >> 2] & 4)) HEAP32[$1 >> 2] = $8 + -1900; + STACKTOP = sp; + return; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$byval_copy = 0, $6 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 4 | 0; + $6 = sp; + HEAP32[$6 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$$byval_copy >> 2] = HEAP32[$6 >> 2]; + $8 = __ZNSt3__220__get_up_to_n_digitsIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEiRT0_S5_RjRKNS_5ctypeIT_EEi($2, $$byval_copy, $4, $5, 4) | 0; + if (!(HEAP32[$4 >> 2] & 4)) HEAP32[$1 >> 2] = $8 + -1900; + STACKTOP = sp; + return; +} + +function _arUtilMatMulf($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$023 = 0, $24 = 0, $3 = 0, $4 = 0, $5 = 0; + $$0 = 0; + while (1) { + if (($$0 | 0) == 3) break; + $3 = $0 + ($$0 << 4) | 0; + $4 = $0 + ($$0 << 4) + 4 | 0; + $5 = $0 + ($$0 << 4) + 8 | 0; + $$023 = 0; + while (1) { + if (($$023 | 0) == 4) break; + HEAPF32[$2 + ($$0 << 4) + ($$023 << 2) >> 2] = +HEAPF32[$3 >> 2] * +HEAPF32[$1 + ($$023 << 2) >> 2] + +HEAPF32[$4 >> 2] * +HEAPF32[$1 + 16 + ($$023 << 2) >> 2] + +HEAPF32[$5 >> 2] * +HEAPF32[$1 + 32 + ($$023 << 2) >> 2]; + $$023 = $$023 + 1 | 0; + } + $24 = $2 + ($$0 << 4) + 12 | 0; + HEAPF32[$24 >> 2] = +HEAPF32[$0 + ($$0 << 4) + 12 >> 2] + +HEAPF32[$24 >> 2]; + $$0 = $$0 + 1 | 0; + } + return 0; +} + +function _arUtilMatMul($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$023 = 0, $24 = 0, $3 = 0, $4 = 0, $5 = 0; + $$0 = 0; + while (1) { + if (($$0 | 0) == 3) break; + $3 = $0 + ($$0 << 5) | 0; + $4 = $0 + ($$0 << 5) + 8 | 0; + $5 = $0 + ($$0 << 5) + 16 | 0; + $$023 = 0; + while (1) { + if (($$023 | 0) == 4) break; + HEAPF64[$2 + ($$0 << 5) + ($$023 << 3) >> 3] = +HEAPF64[$3 >> 3] * +HEAPF64[$1 + ($$023 << 3) >> 3] + +HEAPF64[$4 >> 3] * +HEAPF64[$1 + 32 + ($$023 << 3) >> 3] + +HEAPF64[$5 >> 3] * +HEAPF64[$1 + 64 + ($$023 << 3) >> 3]; + $$023 = $$023 + 1 | 0; + } + $24 = $2 + ($$0 << 5) + 24 | 0; + HEAPF64[$24 >> 3] = +HEAPF64[$0 + ($$0 << 5) + 24 >> 3] + +HEAPF64[$24 >> 3]; + $$0 = $$0 + 1 | 0; + } + return 0; +} + +function _process_data_simple_main($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$pre$phiZ2D = 0, $15 = 0, $22 = 0, $5 = 0, $6 = 0, $8 = 0, $9 = 0; + $5 = HEAP32[$0 + 448 >> 2] | 0; + $6 = $5 + 48 | 0; + $8 = $5 + 52 | 0; + $9 = HEAP32[$8 >> 2] | 0; + do if ((HEAP32[$6 >> 2] | 0) >>> 0 >= $9 >>> 0) { + $15 = $5 + 8 | 0; + if (!(FUNCTION_TABLE_iii[HEAP32[(HEAP32[$0 + 452 >> 2] | 0) + 12 >> 2] & 127]($0, $15) | 0)) return; else { + HEAP32[$6 >> 2] = 0; + $$pre$phiZ2D = $15; + $22 = HEAP32[$8 >> 2] | 0; + break; + } + } else { + $$pre$phiZ2D = $5 + 8 | 0; + $22 = $9; + } while (0); + FUNCTION_TABLE_viiiiiii[HEAP32[(HEAP32[$0 + 456 >> 2] | 0) + 4 >> 2] & 7]($0, $$pre$phiZ2D, $6, $22, $1, $2, $3); + return; +} + +function __ZNSt3__210shared_ptrIN6vision8KeyframeILi96EEEEC2IS3_EEPT_NS_9enable_ifIXsr14is_convertibleIS7_PS3_EE5valueENS4_5__natEE4typeE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + HEAP32[$0 >> 2] = $1; + $3 = __Znwm(16) | 0; + HEAP32[$3 + 4 >> 2] = 0; + HEAP32[$3 + 8 >> 2] = 0; + HEAP32[$3 >> 2] = 16820; + HEAP32[$3 + 12 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = $3; + HEAP32[$vararg_buffer >> 2] = $1; + HEAP32[$vararg_buffer + 4 >> 2] = $1; + __ZNSt3__210shared_ptrIN6vision8KeyframeILi96EEEE18__enable_weak_thisEz($0, $vararg_buffer); + STACKTOP = sp; + return; +} + +function _request_virt_sarray($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$sink = 0, $14 = 0, $20 = 0, $7 = 0, $9 = 0; + $7 = HEAP32[$0 + 4 >> 2] | 0; + if (($1 | 0) == 1) $$sink = 1; else { + $9 = HEAP32[$0 >> 2] | 0; + HEAP32[$9 + 20 >> 2] = 15; + HEAP32[$9 + 24 >> 2] = $1; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + $$sink = $1; + } + $14 = _alloc_small($0, $$sink, 128) | 0; + HEAP32[$14 >> 2] = 0; + HEAP32[$14 + 4 >> 2] = $4; + HEAP32[$14 + 8 >> 2] = $3; + HEAP32[$14 + 12 >> 2] = $5; + HEAP32[$14 + 32 >> 2] = $2; + HEAP32[$14 + 40 >> 2] = 0; + $20 = $7 + 68 | 0; + HEAP32[$14 + 44 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$20 >> 2] = $14; + return $14 | 0; +} + +function _request_virt_barray($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$sink = 0, $14 = 0, $20 = 0, $7 = 0, $9 = 0; + $7 = HEAP32[$0 + 4 >> 2] | 0; + if (($1 | 0) == 1) $$sink = 1; else { + $9 = HEAP32[$0 >> 2] | 0; + HEAP32[$9 + 20 >> 2] = 15; + HEAP32[$9 + 24 >> 2] = $1; + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 >> 2] >> 2] & 255]($0); + $$sink = $1; + } + $14 = _alloc_small($0, $$sink, 128) | 0; + HEAP32[$14 >> 2] = 0; + HEAP32[$14 + 4 >> 2] = $4; + HEAP32[$14 + 8 >> 2] = $3; + HEAP32[$14 + 12 >> 2] = $5; + HEAP32[$14 + 32 >> 2] = $2; + HEAP32[$14 + 40 >> 2] = 0; + $20 = $7 + 72 | 0; + HEAP32[$14 + 44 >> 2] = HEAP32[$20 >> 2]; + HEAP32[$20 >> 2] = $14; + return $14 | 0; +} + +function _arSetDebugMode($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $13 = 0, $6 = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + do if ($0) if ((HEAP32[$0 >> 2] | 0) != ($1 | 0)) { + HEAP32[$0 >> 2] = $1; + if (!$1) { + $6 = $0 + 4834148 | 0; + _free(HEAP32[$6 >> 2] | 0); + HEAP32[$6 >> 2] = 0; + $$0 = 0; + break; + } + $13 = _malloc(Math_imul(HEAP32[$0 + 40 >> 2] | 0, HEAP32[$0 + 36 >> 2] | 0) | 0) | 0; + HEAP32[$0 + 4834148 >> 2] = $13; + if (!$13) { + _arLog(0, 3, 45930, $vararg_buffer); + _exit(1); + } else $$0 = 0; + } else $$0 = 0; else $$0 = -1; while (0); + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNSt3__26vectorIPN6vision4NodeILi96EEENS_9allocatorIS4_EEE7reserveEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $5 = HEAP32[$0 >> 2] | 0; + if ((HEAP32[$0 + 8 >> 2] | 0) - $5 >> 2 >>> 0 < $1 >>> 0) { + __ZNSt3__214__split_bufferIPN6vision4NodeILi96EEERNS_9allocatorIS4_EEEC2EmmS7_($2, $1, (HEAP32[$0 + 4 >> 2] | 0) - $5 >> 2, $0 + 8 | 0); + __ZNSt3__26vectorIPN6vision4NodeILi96EEENS_9allocatorIS4_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS4_RS6_EE($0, $2); + __ZNSt3__214__split_bufferIPN6vision4NodeILi96EEERNS_9allocatorIS4_EEED2Ev($2); + } + STACKTOP = sp; + return; +} + +function __ZN6vision28BinaryHierarchicalClusteringILi96EE5buildEPKhi($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$cast = 0, $3 = 0, $6 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + __ZNSt3__26vectorIiNS_9allocatorIiEEEC2Em($3, $2); + $6 = HEAP32[$3 >> 2] | 0; + $8 = (HEAP32[$3 + 4 >> 2] | 0) - $6 >> 2; + $$cast = $6; + $$0 = 0; + while (1) { + if (($$0 | 0) == ($8 | 0)) break; + HEAP32[$$cast + ($$0 << 2) >> 2] = $$0; + $$0 = $$0 + 1 | 0; + } + __ZN6vision28BinaryHierarchicalClusteringILi96EE5buildEPKhiPKii($0, $1, $2, $$cast, $8); + __ZNSt3__213__vector_baseIiNS_9allocatorIiEEED2Ev($3); + STACKTOP = sp; + return; +} + +function __ZN6vision19NormalizeHomographyIfEEvPT_($0) { + $0 = $0 | 0; + var $1 = 0, $12 = 0, $15 = 0, $18 = 0, $21 = 0, $24 = 0, $3 = 0.0, $6 = 0, $9 = 0; + $1 = $0 + 32 | 0; + $3 = 1.0 / +HEAPF32[$1 >> 2]; + HEAPF32[$0 >> 2] = +HEAPF32[$0 >> 2] * $3; + $6 = $0 + 4 | 0; + HEAPF32[$6 >> 2] = $3 * +HEAPF32[$6 >> 2]; + $9 = $0 + 8 | 0; + HEAPF32[$9 >> 2] = $3 * +HEAPF32[$9 >> 2]; + $12 = $0 + 12 | 0; + HEAPF32[$12 >> 2] = $3 * +HEAPF32[$12 >> 2]; + $15 = $0 + 16 | 0; + HEAPF32[$15 >> 2] = $3 * +HEAPF32[$15 >> 2]; + $18 = $0 + 20 | 0; + HEAPF32[$18 >> 2] = $3 * +HEAPF32[$18 >> 2]; + $21 = $0 + 24 | 0; + HEAPF32[$21 >> 2] = $3 * +HEAPF32[$21 >> 2]; + $24 = $0 + 28 | 0; + HEAPF32[$24 >> 2] = $3 * +HEAPF32[$24 >> 2]; + HEAPF32[$1 >> 2] = 1.0; + return; +} + +function _CENTER($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$025 = 0, $$026 = 0, $$027 = 0, $$028 = 0, $$1 = 0, $3 = 0, $5 = 0; + $3 = HEAP32[$0 + 4 >> 2] | 0; + $5 = HEAP32[$0 + 8 >> 2] | 0; + L1 : do if ((HEAP32[$1 + 4 >> 2] | 0) == ($5 | 0)) { + $$025 = 0; + $$027 = HEAP32[$0 >> 2] | 0; + while (1) { + if (($$025 | 0) >= ($3 | 0)) { + $$026 = 0; + break L1; + } + $$0 = 0; + $$028 = HEAP32[$1 >> 2] | 0; + $$1 = $$027; + while (1) { + if (($$0 | 0) >= ($5 | 0)) break; + HEAPF64[$$1 >> 3] = +HEAPF64[$$1 >> 3] - +HEAPF64[$$028 >> 3]; + $$0 = $$0 + 1 | 0; + $$028 = $$028 + 8 | 0; + $$1 = $$1 + 8 | 0; + } + $$025 = $$025 + 1 | 0; + $$027 = $$1; + } + } else $$026 = -1; while (0); + return $$026 | 0; +} + +function __ZN6vision34SolveHomography4PointsInhomogenousIfEEbPT_PKS1_S4_S4_S4_S4_S4_S4_S4_($0, $1, $2, $3, $4, $5, $6, $7, $8) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + var $$0 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 288 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(288); + $9 = sp; + __ZN6vision40Homography4PointsInhomogeneousConstraintIfEEvPT_PKS1_S4_S4_S4_S4_S4_S4_S4_($9, $1, $2, $3, $4, $5, $6, $7, $8); + if (__ZN6vision29SolveNullVector8x9DestructiveIfEEbPT_S2_($0, $9) | 0) $$0 = !(+Math_abs(+(+__ZN6vision14Determinant3x3IfEET_PKS1_($0))) < 1.0e-05); else $$0 = 0; + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle7NewExprC2ENS0_9NodeArrayEPNS0_4NodeES2_bb($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $14 = 0, $15 = 0, $21 = 0, $26 = 0, $27 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 51, 1, 1, 1); + HEAP32[$0 >> 2] = 18616; + $9 = $1; + $14 = HEAP32[$9 + 4 >> 2] | 0; + $15 = $0 + 8 | 0; + HEAP32[$15 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$15 + 4 >> 2] = $14; + HEAP32[$0 + 16 >> 2] = $2; + $21 = $3; + $26 = HEAP32[$21 + 4 >> 2] | 0; + $27 = $0 + 20 | 0; + HEAP32[$27 >> 2] = HEAP32[$21 >> 2]; + HEAP32[$27 + 4 >> 2] = $26; + HEAP8[$0 + 28 >> 0] = $4 & 1; + HEAP8[$0 + 29 >> 0] = $5 & 1; + return; +} + +function __ZNSt3__210shared_ptrIhEC2Ih16NullArrayDeleterIhEEEPT_T0_NS_9enable_ifIXsr14is_convertibleIS6_PhEE5valueENS1_5__natEE4typeE($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $4 = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + HEAP32[$0 >> 2] = $1; + $4 = __Znwm(16) | 0; + HEAP32[$4 + 4 >> 2] = 0; + HEAP32[$4 + 8 >> 2] = 0; + HEAP32[$4 >> 2] = 16876; + HEAP32[$4 + 12 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = $4; + HEAP32[$vararg_buffer >> 2] = $1; + HEAP32[$vararg_buffer + 4 >> 2] = $1; + __ZNSt3__210shared_ptrIhE18__enable_weak_thisEz($0, $vararg_buffer); + STACKTOP = sp; + return; +} + +function _icpGetU_from_X_by_MatX2U($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $21 = 0.0, $3 = 0.0, $36 = 0.0, $5 = 0.0, $7 = 0.0; + $3 = +HEAPF64[$2 >> 3]; + $5 = +HEAPF64[$2 + 8 >> 3]; + $7 = +HEAPF64[$2 + 16 >> 3]; + $21 = +HEAPF64[$1 + 88 >> 3] + ($3 * +HEAPF64[$1 + 64 >> 3] + $5 * +HEAPF64[$1 + 72 >> 3] + $7 * +HEAPF64[$1 + 80 >> 3]); + if ($21 == 0.0) $$0 = -1; else { + $36 = +HEAPF64[$1 + 56 >> 3] + ($3 * +HEAPF64[$1 + 32 >> 3] + $5 * +HEAPF64[$1 + 40 >> 3] + $7 * +HEAPF64[$1 + 48 >> 3]); + HEAPF64[$0 >> 3] = (+HEAPF64[$1 + 24 >> 3] + ($3 * +HEAPF64[$1 >> 3] + $5 * +HEAPF64[$1 + 8 >> 3] + $7 * +HEAPF64[$1 + 16 >> 3])) / $21; + HEAPF64[$0 + 8 >> 3] = $36 / $21; + $$0 = 0; + } + return $$0 | 0; +} + +function __ZL10loadMarkerPKcPiP8ARHandlePP12ARPattHandle($patt_name, $patt_id, $pattHandle_p) { + $patt_name = $patt_name | 0; + $patt_id = $patt_id | 0; + $pattHandle_p = $pattHandle_p | 0; + var $call = 0, $retval$0 = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + $call = _arPattLoad(HEAP32[$pattHandle_p >> 2] | 0, $patt_name) | 0; + HEAP32[$patt_id >> 2] = $call; + if (($call | 0) < 0) { + HEAP32[$vararg_buffer >> 2] = $patt_name; + _arLog(0, 3, 45349, $vararg_buffer); + _arPattDeleteHandle(HEAP32[$pattHandle_p >> 2] | 0) | 0; + $retval$0 = 0; + } else $retval$0 = 1; + STACKTOP = sp; + return $retval$0 | 0; +} + +function _arMatrixDup($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$021 = 0, $$022 = 0, $13 = 0, $16 = 0, $3 = 0, $8 = 0; + $3 = HEAP32[$0 + 4 >> 2] | 0; + L1 : do if (($3 | 0) == (HEAP32[$1 + 4 >> 2] | 0) ? ($8 = HEAP32[$0 + 8 >> 2] | 0, ($8 | 0) == (HEAP32[$1 + 8 >> 2] | 0)) : 0) { + $$021 = 0; + while (1) { + if (($$021 | 0) >= ($3 | 0)) { + $$022 = 0; + break L1; + } + $13 = Math_imul($$021, $8) | 0; + $$0 = 0; + while (1) { + if (($$0 | 0) >= ($8 | 0)) break; + $16 = $$0 + $13 | 0; + HEAPF64[(HEAP32[$0 >> 2] | 0) + ($16 << 3) >> 3] = +HEAPF64[(HEAP32[$1 >> 2] | 0) + ($16 << 3) >> 3]; + $$0 = $$0 + 1 | 0; + } + $$021 = $$021 + 1 | 0; + } + } else $$022 = -1; while (0); + return $$022 | 0; +} + +function __ZNSt3__214__split_bufferINS_6vectorINS1_INS_4pairIfmEENS_9allocatorIS3_EEEENS4_IS6_EEEERNS4_IS8_EEEC2EmmSA_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $4 = 0, $8 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + do if ($1) if ($1 >>> 0 > 357913941) { + $8 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($8, 41481); + HEAP32[$8 >> 2] = 17472; + ___cxa_throw($8 | 0, 13960, 22); + } else { + $11 = __Znwm($1 * 12 | 0) | 0; + break; + } else $11 = 0; while (0); + HEAP32[$0 >> 2] = $11; + $12 = $11 + ($2 * 12 | 0) | 0; + HEAP32[$0 + 8 >> 2] = $12; + HEAP32[$0 + 4 >> 2] = $12; + HEAP32[$4 >> 2] = $11 + ($1 * 12 | 0); + return; +} + +function __ZNSt3__214__split_bufferIN6vision25DoGScaleInvariantDetector12FeaturePointERNS_9allocatorIS3_EEEC2EmmS6_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $4 = 0, $8 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + do if ($1) if ($1 >>> 0 > 119304647) { + $8 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($8, 41481); + HEAP32[$8 >> 2] = 17472; + ___cxa_throw($8 | 0, 13960, 22); + } else { + $11 = __Znwm($1 * 36 | 0) | 0; + break; + } else $11 = 0; while (0); + HEAP32[$0 >> 2] = $11; + $12 = $11 + ($2 * 36 | 0) | 0; + HEAP32[$0 + 8 >> 2] = $12; + HEAP32[$0 + 4 >> 2] = $12; + HEAP32[$4 >> 2] = $11 + ($1 * 36 | 0); + return; +} + +function __ZNSt3__211__stdoutbufIwEC2EP8_IO_FILEP11__mbstate_t($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $14 = 0, $3 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEEC2Ev($0); + HEAP32[$0 >> 2] = 20888; + HEAP32[$0 + 32 >> 2] = $1; + __ZNSt3__26localeC2ERKS0_($3, $0 + 4 | 0); + $7 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66824) | 0; + __ZNSt3__26localeD2Ev($3); + HEAP32[$0 + 36 >> 2] = $7; + HEAP32[$0 + 40 >> 2] = $2; + $14 = (FUNCTION_TABLE_ii[HEAP32[(HEAP32[$7 >> 2] | 0) + 28 >> 2] & 127]($7) | 0) & 1; + HEAP8[$0 + 44 >> 0] = $14; + STACKTOP = sp; + return; +} + +function __ZNSt3__211__stdoutbufIcEC2EP8_IO_FILEP11__mbstate_t($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $14 = 0, $3 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEEC2Ev($0); + HEAP32[$0 >> 2] = 20952; + HEAP32[$0 + 32 >> 2] = $1; + __ZNSt3__26localeC2ERKS0_($3, $0 + 4 | 0); + $7 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66816) | 0; + __ZNSt3__26localeD2Ev($3); + HEAP32[$0 + 36 >> 2] = $7; + HEAP32[$0 + 40 >> 2] = $2; + $14 = (FUNCTION_TABLE_ii[HEAP32[(HEAP32[$7 >> 2] | 0) + 28 >> 2] & 127]($7) | 0) & 1; + HEAP8[$0 + 44 >> 0] = $14; + STACKTOP = sp; + return; +} + +function __ZN10emscripten8internal7InvokerIiJiiEE6invokeEPFiiiEii($fn, $args, $args1) { + $fn = $fn | 0; + $args = $args | 0; + $args1 = $args1 | 0; + var $call = 0, $call3 = 0, $call4 = 0, $call5 = 0, $ref$tmp = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $ref$tmp = sp; + $call = __ZN10emscripten8internal11BindingTypeIivE12fromWireTypeEi($args) | 0; + $call3 = __ZN10emscripten8internal11BindingTypeIivE12fromWireTypeEi($args1) | 0; + $call4 = FUNCTION_TABLE_iii[$fn & 127]($call, $call3) | 0; + HEAP32[$ref$tmp >> 2] = $call4; + $call5 = __ZN10emscripten8internal11BindingTypeIivE10toWireTypeERKi($ref$tmp) | 0; + STACKTOP = sp; + return $call5 | 0; +} + +function __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE6resizeEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0, $12 = 0, $14 = 0, $2 = 0, $3 = 0, $4 = 0, $6 = 0, $8 = 0, $9 = 0; + $2 = $0 + 4 | 0; + $3 = HEAP32[$2 >> 2] | 0; + $4 = HEAP32[$0 >> 2] | 0; + $6 = ($3 - $4 | 0) / 20 | 0; + $8 = $4; + $9 = $3; + if ($6 >>> 0 >= $1 >>> 0) { + if ($6 >>> 0 > $1 >>> 0) { + $12 = $8 + ($1 * 20 | 0) | 0; + $$0$i$i = $9; + while (1) { + if (($$0$i$i | 0) == ($12 | 0)) break; + $14 = $$0$i$i + -20 | 0; + __ZN6vision12FeaturePointD2Ev($14); + $$0$i$i = $14; + } + HEAP32[$2 >> 2] = $12; + } + } else __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE8__appendEm($0, $1 - $6 | 0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle20DynamicExceptionSpec9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 56394); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray14printWithCommaERNS_12OutputStreamE($0 + 8 | 0, $1); + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 41); + STACKTOP = sp; + return; +} + +function _jinit_inverse_dct($0) { + $0 = $0 | 0; + var $$02021 = 0, $$022 = 0, $1 = 0, $11 = 0, $14 = 0, $4 = 0, $6 = 0; + $1 = $0 + 4 | 0; + $4 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 84) | 0; + HEAP32[$0 + 472 >> 2] = $4; + HEAP32[$4 >> 2] = 192; + $6 = $0 + 36 | 0; + if ((HEAP32[$6 >> 2] | 0) <= 0) return; + $11 = $4 + 44 | 0; + $$02021 = 0; + $$022 = HEAP32[$0 + 216 >> 2] | 0; + while (1) { + $14 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$1 >> 2] >> 2] & 63]($0, 1, 256) | 0; + HEAP32[$$022 + 84 >> 2] = $14; + _memset($14 | 0, 0, 256) | 0; + HEAP32[$11 + ($$02021 << 2) >> 2] = -1; + $$02021 = $$02021 + 1 | 0; + if (($$02021 | 0) >= (HEAP32[$6 >> 2] | 0)) break; else $$022 = $$022 + 88 | 0; + } + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiP14AR2SurfaceSetTEENS_22__unordered_map_hasherIiS4_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS4_NS_8equal_toIiEELb1EEENS_9allocatorIS4_EEED2Ev($this) { + $this = $this | 0; + var $1 = 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIiP14AR2SurfaceSetTEENS_22__unordered_map_hasherIiS4_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS4_NS_8equal_toIiEELb1EEENS_9allocatorIS4_EEE17__deallocate_nodeEPNS_16__hash_node_baseIPNS_11__hash_nodeIS4_PvEEEE($this, HEAP32[$this + 8 >> 2] | 0); + $1 = HEAP32[$this >> 2] | 0; + HEAP32[$this >> 2] = 0; + if ($1 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($1, HEAP32[$this + 4 >> 2] << 2); + return; +} + +function __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE7reserveEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $2 = sp; + $5 = HEAP32[$0 >> 2] | 0; + if ((HEAP32[$0 + 8 >> 2] | 0) - $5 >> 3 >>> 0 < $1 >>> 0) { + __ZNSt3__214__split_bufferIN6vision7match_tERNS_9allocatorIS2_EEEC2EmmS5_($2, $1, (HEAP32[$0 + 4 >> 2] | 0) - $5 >> 3, $0 + 8 | 0); + __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE($0, $2); + __ZNSt3__214__split_bufferIN6vision7match_tERNS_9allocatorIS2_EEED2Ev($2); + } + STACKTOP = sp; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle12EnableIfAttr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 56677); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray14printWithCommaERNS_12OutputStreamE($0 + 8 | 0, $1); + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 93); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E20popTrailingNodeArrayEm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0, $5 = 0; + $3 = $1 + 8 | 0; + $5 = (__ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE5beginEv($3) | 0) + ($2 << 2) | 0; + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13makeNodeArrayIPPNS0_4NodeEEENS0_9NodeArrayET_SB_($0, $1, $5, __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE3endEv($3) | 0); + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE8dropBackEm($3, $2); + return; +} + +function __ZNSt3__214__split_bufferINS_6vectorINS_4pairIfmEENS_9allocatorIS3_EEEERNS4_IS6_EEEC2EmmS8_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $4 = 0, $8 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + do if ($1) if ($1 >>> 0 > 357913941) { + $8 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($8, 41481); + HEAP32[$8 >> 2] = 17472; + ___cxa_throw($8 | 0, 13960, 22); + } else { + $11 = __Znwm($1 * 12 | 0) | 0; + break; + } else $11 = 0; while (0); + HEAP32[$0 >> 2] = $11; + $12 = $11 + ($2 * 12 | 0) | 0; + HEAP32[$0 + 8 >> 2] = $12; + HEAP32[$0 + 4 >> 2] = $12; + HEAP32[$4 >> 2] = $11 + ($1 * 12 | 0); + return; +} + +function __ZNSt3__210__stdinbufIwEC2EP8_IO_FILEP11__mbstate_t($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $3 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEEC2Ev($0); + HEAP32[$0 >> 2] = 21016; + HEAP32[$0 + 32 >> 2] = $1; + HEAP32[$0 + 40 >> 2] = $2; + $7 = __ZNSt3__211char_traitsIwE3eofEv() | 0; + HEAP32[$0 + 48 >> 2] = $7; + HEAP8[$0 + 52 >> 0] = 0; + $11 = HEAP32[(HEAP32[$0 >> 2] | 0) + 8 >> 2] | 0; + __ZNSt3__26localeC2ERKS0_($3, $0 + 4 | 0); + FUNCTION_TABLE_vii[$11 & 255]($0, $3); + __ZNSt3__26localeD2Ev($3); + STACKTOP = sp; + return; +} + +function __ZNSt3__210__stdinbufIcEC2EP8_IO_FILEP11__mbstate_t($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $3 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEEC2Ev($0); + HEAP32[$0 >> 2] = 21080; + HEAP32[$0 + 32 >> 2] = $1; + HEAP32[$0 + 40 >> 2] = $2; + $7 = __ZNSt3__211char_traitsIcE3eofEv() | 0; + HEAP32[$0 + 48 >> 2] = $7; + HEAP8[$0 + 52 >> 0] = 0; + $11 = HEAP32[(HEAP32[$0 >> 2] | 0) + 8 >> 2] | 0; + __ZNSt3__26localeC2ERKS0_($3, $0 + 4 | 0); + FUNCTION_TABLE_vii[$11 & 255]($0, $3); + __ZNSt3__26localeD2Ev($3); + STACKTOP = sp; + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIiNS_9allocatorIiEEEEEENS_22__unordered_map_hasherIiS6_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS6_NS_8equal_toIiEELb1EEENS3_IS6_EEED2Ev($0) { + $0 = $0 | 0; + var $3 = 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIiNS_9allocatorIiEEEEEENS_22__unordered_map_hasherIiS6_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS6_NS_8equal_toIiEELb1EEENS3_IS6_EEE17__deallocate_nodeEPNS_16__hash_node_baseIPNS_11__hash_nodeIS6_PvEEEE($0, HEAP32[$0 + 8 >> 2] | 0); + $3 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = 0; + if ($3 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($3, HEAP32[$0 + 4 >> 2] << 2); + return; +} + +function __ZN6vision9MaxIndex9IfEEiPKT_($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$2 = 0, $$3 = 0, $$4 = 0, $$5 = 0, $$6 = 0; + $$0 = +HEAPF32[$0 + 4 >> 2] > +HEAPF32[$0 >> 2] & 1; + $$1 = +HEAPF32[$0 + 8 >> 2] > +HEAPF32[$0 + ($$0 << 2) >> 2] ? 2 : $$0; + $$2 = +HEAPF32[$0 + 12 >> 2] > +HEAPF32[$0 + ($$1 << 2) >> 2] ? 3 : $$1; + $$3 = +HEAPF32[$0 + 16 >> 2] > +HEAPF32[$0 + ($$2 << 2) >> 2] ? 4 : $$2; + $$4 = +HEAPF32[$0 + 20 >> 2] > +HEAPF32[$0 + ($$3 << 2) >> 2] ? 5 : $$3; + $$5 = +HEAPF32[$0 + 24 >> 2] > +HEAPF32[$0 + ($$4 << 2) >> 2] ? 6 : $$4; + $$6 = +HEAPF32[$0 + 28 >> 2] > +HEAPF32[$0 + ($$5 << 2) >> 2] ? 7 : $$5; + return (+HEAPF32[$0 + 32 >> 2] > +HEAPF32[$0 + ($$6 << 2) >> 2] ? 8 : $$6) | 0; +} + +function _pad_667($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0$lcssa = 0, $$011 = 0, $14 = 0, $5 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 256 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(256); + $5 = sp; + if (($2 | 0) > ($3 | 0) & ($4 & 73728 | 0) == 0) { + $9 = $2 - $3 | 0; + _memset($5 | 0, $1 << 24 >> 24 | 0, ($9 >>> 0 < 256 ? $9 : 256) | 0) | 0; + if ($9 >>> 0 > 255) { + $14 = $2 - $3 | 0; + $$011 = $9; + do { + _out($0, $5, 256); + $$011 = $$011 + -256 | 0; + } while ($$011 >>> 0 > 255); + $$0$lcssa = $14 & 255; + } else $$0$lcssa = $9; + _out($0, $5, $$0$lcssa); + } + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE18__construct_at_endIPS2_EENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeES9_S9_m($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0$i = 0, $4 = 0, $6 = 0; + $4 = $0 + 4 | 0; + $$0$i = $1; + while (1) { + if (($$0$i | 0) == ($2 | 0)) break; + $6 = HEAP32[$4 >> 2] | 0; + HEAP32[$6 >> 2] = HEAP32[$$0$i >> 2]; + HEAP32[$6 + 4 >> 2] = HEAP32[$$0$i + 4 >> 2]; + HEAP32[$6 + 8 >> 2] = HEAP32[$$0$i + 8 >> 2]; + HEAP32[$6 + 12 >> 2] = HEAP32[$$0$i + 12 >> 2]; + HEAP32[$6 + 16 >> 2] = HEAP32[$$0$i + 16 >> 2]; + HEAP32[$4 >> 2] = (HEAP32[$4 >> 2] | 0) + 20; + $$0$i = $$0$i + 20 | 0; + } + return; +} + +function __ZN6vision23DeterminantSymmetric3x3IfEET_PKS1_($0) { + $0 = $0 | 0; + var $1 = 0, $10 = 0.0, $12 = 0, $14 = 0.0, $15 = 0, $16 = 0.0, $18 = 0.0, $19 = 0.0, $2 = 0.0, $22 = 0.0, $3 = 0, $6 = 0.0; + $1 = $0 + 32 | 0; + $2 = +HEAPF32[$1 >> 2]; + $3 = $0 + 4 | 0; + $6 = $2 * +__ZN6vision3sqrIfEET_S1_(+HEAPF32[$3 >> 2]); + $10 = +HEAPF32[$0 + 8 >> 2]; + $12 = $0 + 20 | 0; + $14 = +HEAPF32[$3 >> 2] * 2.0 * $10 * +HEAPF32[$12 >> 2]; + $15 = $0 + 16 | 0; + $16 = +HEAPF32[$15 >> 2]; + $18 = $16 * +__ZN6vision3sqrIfEET_S1_($10); + $19 = +HEAPF32[$0 >> 2]; + $22 = $19 * +__ZN6vision3sqrIfEET_S1_(+HEAPF32[$12 >> 2]); + return +($14 - $6 - $18 - $22 + +HEAPF32[$0 >> 2] * +HEAPF32[$15 >> 2] * +HEAPF32[$1 >> 2]); +} + +function __ZNSt3__214__split_bufferIN6vision17PriorityQueueItemILi96EEERNS_9allocatorIS3_EEEC2EmmS6_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $4 = 0, $8 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + do if ($1) if ($1 >>> 0 > 536870911) { + $8 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($8, 41481); + HEAP32[$8 >> 2] = 17472; + ___cxa_throw($8 | 0, 13960, 22); + } else { + $11 = __Znwm($1 << 3) | 0; + break; + } else $11 = 0; while (0); + HEAP32[$0 >> 2] = $11; + $12 = $11 + ($2 << 3) | 0; + HEAP32[$0 + 8 >> 2] = $12; + HEAP32[$0 + 4 >> 2] = $12; + HEAP32[$4 >> 2] = $11 + ($1 << 3); + return; +} + +function __ZNSt3__214__split_bufferIN6vision12FeaturePointERNS_9allocatorIS2_EEEC2EmmS5_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $4 = 0, $8 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + do if ($1) if ($1 >>> 0 > 214748364) { + $8 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($8, 41481); + HEAP32[$8 >> 2] = 17472; + ___cxa_throw($8 | 0, 13960, 22); + } else { + $11 = __Znwm($1 * 20 | 0) | 0; + break; + } else $11 = 0; while (0); + HEAP32[$0 >> 2] = $11; + $12 = $11 + ($2 * 20 | 0) | 0; + HEAP32[$0 + 8 >> 2] = $12; + HEAP32[$0 + 4 >> 2] = $12; + HEAP32[$4 >> 2] = $11 + ($1 * 20 | 0); + return; +} + +function __ZNKSt3__27collateIcE10do_compareEPKcS3_S3_S3_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$011 = 0, $$012 = 0, $7 = 0, $8 = 0, label = 0; + $$011 = $3; + $$012 = $1; + while (1) { + if (($$011 | 0) == ($4 | 0)) { + label = 7; + break; + } + if (($$012 | 0) == ($2 | 0)) { + $$0 = -1; + break; + } + $7 = HEAP8[$$012 >> 0] | 0; + $8 = HEAP8[$$011 >> 0] | 0; + if ($7 << 24 >> 24 < $8 << 24 >> 24) { + $$0 = -1; + break; + } + if ($8 << 24 >> 24 < $7 << 24 >> 24) { + $$0 = 1; + break; + } + $$011 = $$011 + 1 | 0; + $$012 = $$012 + 1 | 0; + } + if ((label | 0) == 7) $$0 = ($$012 | 0) != ($2 | 0) & 1; + return $$0 | 0; +} + +function _realloc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$1 = 0, $11 = 0, $14 = 0, $17 = 0, $22 = 0, $5 = 0; + if (!$0) { + $$1 = _malloc($1) | 0; + return $$1 | 0; + } + if ($1 >>> 0 > 4294967231) { + $5 = ___errno_location() | 0; + HEAP32[$5 >> 2] = 48; + $$1 = 0; + return $$1 | 0; + } + $11 = _try_realloc_chunk($0 + -8 | 0, $1 >>> 0 < 11 ? 16 : $1 + 11 & -8) | 0; + if ($11 | 0) { + $$1 = $11 + 8 | 0; + return $$1 | 0; + } + $14 = _malloc($1) | 0; + if (!$14) { + $$1 = 0; + return $$1 | 0; + } + $17 = HEAP32[$0 + -4 >> 2] | 0; + $22 = ($17 & -8) - (($17 & 3 | 0) == 0 ? 8 : 4) | 0; + _memcpy($14 | 0, $0 | 0, ($22 >>> 0 < $1 >>> 0 ? $22 : $1) | 0) | 0; + _free($0); + $$1 = $14; + return $$1 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle8NameType9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $4 = 0, $9 = 0, $tmpcast$byval_copy = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $tmpcast$byval_copy = sp + 8 | 0; + $2 = sp; + $4 = $0 + 8 | 0; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $2; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$tmpcast$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$tmpcast$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $tmpcast$byval_copy); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle16FunctionEncodingC2EPKNS0_4NodeES4_NS0_9NodeArrayES4_NS0_10QualifiersENS0_15FunctionRefQualE($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $10 = 0, $15 = 0, $16 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 18, 0, 1, 0); + HEAP32[$0 >> 2] = 20420; + HEAP32[$0 + 8 >> 2] = $1; + HEAP32[$0 + 12 >> 2] = $2; + $10 = $3; + $15 = HEAP32[$10 + 4 >> 2] | 0; + $16 = $0 + 16 | 0; + HEAP32[$16 >> 2] = HEAP32[$10 >> 2]; + HEAP32[$16 + 4 >> 2] = $15; + HEAP32[$0 + 24 >> 2] = $4; + HEAP32[$0 + 28 >> 2] = $5; + HEAP8[$0 + 32 >> 0] = $6; + return; +} + +function __ZNSt3__214__split_bufferIN6vision7Point3dIfEERNS_9allocatorIS3_EEEC2EmmS6_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $4 = 0, $8 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + do if ($1) if ($1 >>> 0 > 357913941) { + $8 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($8, 41481); + HEAP32[$8 >> 2] = 17472; + ___cxa_throw($8 | 0, 13960, 22); + } else { + $11 = __Znwm($1 * 12 | 0) | 0; + break; + } else $11 = 0; while (0); + HEAP32[$0 >> 2] = $11; + $12 = $11 + ($2 * 12 | 0) | 0; + HEAP32[$0 + 8 >> 2] = $12; + HEAP32[$0 + 4 >> 2] = $12; + HEAP32[$4 >> 2] = $11 + ($1 * 12 | 0); + return; +} + +function _jpeg_stdio_src($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $11 = 0, $14 = 0, $2 = 0, $3 = 0, $5 = 0, $8 = 0; + $2 = $0 + 24 | 0; + $3 = HEAP32[$2 >> 2] | 0; + if (!$3) { + $5 = $0 + 4 | 0; + $8 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$5 >> 2] >> 2] & 63]($0, 0, 40) | 0; + HEAP32[$2 >> 2] = $8; + $11 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$5 >> 2] >> 2] & 63]($0, 0, 4096) | 0; + HEAP32[$8 + 32 >> 2] = $11; + $14 = HEAP32[$2 >> 2] | 0; + } else $14 = $3; + HEAP32[$14 + 8 >> 2] = 201; + HEAP32[$14 + 12 >> 2] = 85; + HEAP32[$14 + 16 >> 2] = 137; + HEAP32[$14 + 20 >> 2] = 71; + HEAP32[$14 + 24 >> 2] = 202; + HEAP32[$14 + 28 >> 2] = $1; + HEAP32[$14 + 4 >> 2] = 0; + HEAP32[$14 >> 2] = 0; + return; +} + +function __ZNK6vision21HoughSimilarityVoting23getMaximumNumberOfVotesERfRi($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$sroa$09$0 = 0, $$sroa$09$0$in = 0, $10 = 0.0, $14 = 0.0, $15 = 0.0, $5 = 0, $6 = 0; + HEAPF32[$1 >> 2] = 0.0; + HEAP32[$2 >> 2] = -1; + $$sroa$09$0$in = $0 + 100 | 0; + $10 = 0.0; + while (1) { + $$sroa$09$0 = HEAP32[$$sroa$09$0$in >> 2] | 0; + if (!$$sroa$09$0) break; + $5 = $$sroa$09$0; + $6 = $5 + 12 | 0; + if ($10 < +((HEAP32[$6 >> 2] | 0) >>> 0)) { + HEAP32[$2 >> 2] = HEAP32[$5 + 8 >> 2]; + $14 = +((HEAP32[$6 >> 2] | 0) >>> 0); + HEAPF32[$1 >> 2] = $14; + $15 = $14; + } else $15 = $10; + $$sroa$09$0$in = $$sroa$09$0; + $10 = $15; + } + return; +} + +function __ZN6vision32CauchyProjectiveReprojectionCostIfEET_PKS1_S3_S3_S1_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = +$3; + var $18 = 0.0, $4 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp + 8 | 0; + $5 = sp; + $6 = $4 + 4 | 0; + __ZN6vision35MultiplyPointHomographyInhomogenousIfEEvRT_S2_PKS1_S1_S1_($4, $6, $0, +HEAPF32[$1 >> 2], +HEAPF32[$1 + 4 >> 2]); + HEAPF32[$5 >> 2] = +HEAPF32[$4 >> 2] - +HEAPF32[$2 >> 2]; + HEAPF32[$5 + 4 >> 2] = +HEAPF32[$6 >> 2] - +HEAPF32[$2 + 4 >> 2]; + $18 = +__ZN6vision10CauchyCostIfEET_PKS1_S1_($5, $3); + STACKTOP = sp; + return +$18; +} + +function ___toread($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0, $15 = 0, $23 = 0, $3 = 0, $7 = 0, $9 = 0; + $1 = $0 + 74 | 0; + $3 = HEAP8[$1 >> 0] | 0; + HEAP8[$1 >> 0] = $3 + 255 | $3; + $7 = $0 + 20 | 0; + $9 = $0 + 28 | 0; + if ((HEAP32[$7 >> 2] | 0) >>> 0 > (HEAP32[$9 >> 2] | 0) >>> 0) FUNCTION_TABLE_iiii[HEAP32[$0 + 36 >> 2] & 63]($0, 0, 0) | 0; + HEAP32[$0 + 16 >> 2] = 0; + HEAP32[$9 >> 2] = 0; + HEAP32[$7 >> 2] = 0; + $15 = HEAP32[$0 >> 2] | 0; + if (!($15 & 4)) { + $23 = (HEAP32[$0 + 44 >> 2] | 0) + (HEAP32[$0 + 48 >> 2] | 0) | 0; + HEAP32[$0 + 8 >> 2] = $23; + HEAP32[$0 + 4 >> 2] = $23; + $$0 = $15 << 27 >> 31; + } else { + HEAP32[$0 >> 2] = $15 | 32; + $$0 = -1; + } + return $$0 | 0; +} + +function __ZNSt3__210shared_ptrIhEC2IhEEPT_NS_9enable_ifIXsr14is_convertibleIS4_PhEE5valueENS1_5__natEE4typeE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + HEAP32[$0 >> 2] = $1; + $3 = __Znwm(16) | 0; + HEAP32[$3 + 4 >> 2] = 0; + HEAP32[$3 + 8 >> 2] = 0; + HEAP32[$3 >> 2] = 16848; + HEAP32[$3 + 12 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = $3; + HEAP32[$vararg_buffer >> 2] = $1; + HEAP32[$vararg_buffer + 4 >> 2] = $1; + __ZNSt3__210shared_ptrIhE18__enable_weak_thisEz($0, $vararg_buffer); + STACKTOP = sp; + return; +} + +function _getc($0) { + $0 = $0 | 0; + var $$0 = 0, $15 = 0, $16 = 0, $24 = 0, $6 = 0, $7 = 0, label = 0; + if ((HEAP32[$0 + 76 >> 2] | 0) >= 0 ? (___lockfile($0) | 0) != 0 : 0) { + $15 = $0 + 4 | 0; + $16 = HEAP32[$15 >> 2] | 0; + if ($16 >>> 0 < (HEAP32[$0 + 8 >> 2] | 0) >>> 0) { + HEAP32[$15 >> 2] = $16 + 1; + $24 = HEAPU8[$16 >> 0] | 0; + } else $24 = ___uflow($0) | 0; + $$0 = $24; + } else label = 3; + do if ((label | 0) == 3) { + $6 = $0 + 4 | 0; + $7 = HEAP32[$6 >> 2] | 0; + if ($7 >>> 0 < (HEAP32[$0 + 8 >> 2] | 0) >>> 0) { + HEAP32[$6 >> 2] = $7 + 1; + $$0 = HEAPU8[$7 >> 0] | 0; + break; + } else { + $$0 = ___uflow($0) | 0; + break; + } + } while (0); + return $$0 | 0; +} + +function __ZNSt3__214__split_bufferIPKN6vision4NodeILi96EEERNS_9allocatorIS5_EEEC2EmmS8_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $4 = 0, $8 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + do if ($1) if ($1 >>> 0 > 1073741823) { + $8 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($8, 41481); + HEAP32[$8 >> 2] = 17472; + ___cxa_throw($8 | 0, 13960, 22); + } else { + $11 = __Znwm($1 << 2) | 0; + break; + } else $11 = 0; while (0); + HEAP32[$0 >> 2] = $11; + $12 = $11 + ($2 << 2) | 0; + HEAP32[$0 + 8 >> 2] = $12; + HEAP32[$0 + 4 >> 2] = $12; + HEAP32[$4 >> 2] = $11 + ($1 << 2); + return; +} + +function __ZNSt3__26vectorIN6vision5ImageENS_9allocatorIS2_EEE6resizeEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0, $12 = 0, $14 = 0, $2 = 0, $3 = 0, $4 = 0, $6 = 0, $8 = 0, $9 = 0; + $2 = $0 + 4 | 0; + $3 = HEAP32[$2 >> 2] | 0; + $4 = HEAP32[$0 >> 2] | 0; + $6 = $3 - $4 >> 5; + $8 = $4; + $9 = $3; + if ($6 >>> 0 >= $1 >>> 0) { + if ($6 >>> 0 > $1 >>> 0) { + $12 = $8 + ($1 << 5) | 0; + $$0$i$i = $9; + while (1) { + if (($$0$i$i | 0) == ($12 | 0)) break; + $14 = $$0$i$i + -32 | 0; + __ZN6vision5ImageD2Ev($14); + $$0$i$i = $14; + } + HEAP32[$2 >> 2] = $12; + } + } else __ZNSt3__26vectorIN6vision5ImageENS_9allocatorIS2_EEE8__appendEm($0, $1 - $6 | 0); + return; +} + +function __ZNSt3__214__split_bufferIPN6vision4NodeILi96EEERNS_9allocatorIS4_EEEC2EmmS7_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $4 = 0, $8 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + do if ($1) if ($1 >>> 0 > 1073741823) { + $8 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($8, 41481); + HEAP32[$8 >> 2] = 17472; + ___cxa_throw($8 | 0, 13960, 22); + } else { + $11 = __Znwm($1 << 2) | 0; + break; + } else $11 = 0; while (0); + HEAP32[$0 >> 2] = $11; + $12 = $11 + ($2 << 2) | 0; + HEAP32[$0 + 8 >> 2] = $12; + HEAP32[$0 + 4 >> 2] = $12; + HEAP32[$4 >> 2] = $11 + ($1 << 2); + return; +} + +function __ZN6vision28BinaryHierarchicalClusteringILi96EE5buildEPKhiPKii($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $10 = 0, $5 = 0, $7 = 0, $8 = 0; + $5 = __Znwm(128) | 0; + __ZN6vision4NodeILi96EEC2Ei($5, __ZN6vision28BinaryHierarchicalClusteringILi96EE10nextNodeIdEv($0) | 0); + $7 = $0 + 8 | 0; + $8 = HEAP32[$7 >> 2] | 0; + HEAP32[$7 >> 2] = $5; + if (!$8) $10 = $5; else { + __ZN6vision4NodeILi96EED2Ev($8); + __ZdlPv($8); + $10 = HEAP32[$7 >> 2] | 0; + } + __ZN6vision4NodeILi96EE4leafEb($10, 0); + __ZN6vision28BinaryHierarchicalClusteringILi96EE5buildEPNS_4NodeILi96EEEPKhiPKii($0, HEAP32[$7 >> 2] | 0, $1, $2, $3, $4); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle12FunctionType9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $4 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $4 = HEAP32[$0 + 8 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$4 >> 2] | 0) + 16 >> 2] & 255]($4, $1); + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 51966); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + STACKTOP = sp; + return; +} + +function __ZNSt3__214__split_bufferIN6vision7match_tERNS_9allocatorIS2_EEEC2EmmS5_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $4 = 0, $8 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + do if ($1) if ($1 >>> 0 > 536870911) { + $8 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($8, 41481); + HEAP32[$8 >> 2] = 17472; + ___cxa_throw($8 | 0, 13960, 22); + } else { + $11 = __Znwm($1 << 3) | 0; + break; + } else $11 = 0; while (0); + HEAP32[$0 >> 2] = $11; + $12 = $11 + ($2 << 3) | 0; + HEAP32[$0 + 8 >> 2] = $12; + HEAP32[$0 + 4 >> 2] = $12; + HEAP32[$4 >> 2] = $11 + ($1 << 3); + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA22_KcEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, $1); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA19_KcEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, $1); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA18_KcEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, $1); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA16_KcEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, $1); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA15_KcEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, $1); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA14_KcEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, $1); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA13_KcEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, $1); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA12_KcEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, $1); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA11_KcEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, $1); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA10_KcEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, $1); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZNSt3__214__split_bufferIN6vision5ImageERNS_9allocatorIS2_EEEC2EmmS5_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $4 = 0, $8 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + do if ($1) if ($1 >>> 0 > 134217727) { + $8 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($8, 41481); + HEAP32[$8 >> 2] = 17472; + ___cxa_throw($8 | 0, 13960, 22); + } else { + $11 = __Znwm($1 << 5) | 0; + break; + } else $11 = 0; while (0); + HEAP32[$0 >> 2] = $11; + $12 = $11 + ($2 << 5) | 0; + HEAP32[$0 + 8 >> 2] = $12; + HEAP32[$0 + 4 >> 2] = $12; + HEAP32[$4 >> 2] = $11 + ($1 << 5); + return; +} + +function __ZN6vision8KeyframeILi96EE10buildIndexEv($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $3 = 0, $4 = 0; + $1 = $0 + 36 | 0; + __ZN6vision28BinaryHierarchicalClusteringILi96EE16setNumHypothesesEi($1, 128); + __ZN6vision28BinaryHierarchicalClusteringILi96EE13setNumCentersEi($1, 8); + __ZN6vision28BinaryHierarchicalClusteringILi96EE16setMaxNodesToPopEi($1, 8); + __ZN6vision28BinaryHierarchicalClusteringILi96EE21setMinFeaturesPerNodeEi($1, 16); + $2 = $0 + 8 | 0; + $3 = __ZN6vision18BinaryFeatureStore8featuresEv($2) | 0; + $4 = HEAP32[$3 >> 2] | 0; + __ZN6vision28BinaryHierarchicalClusteringILi96EE5buildEPKhi($1, $4, __ZNK6vision18BinaryFeatureStore4sizeEv($2) | 0); + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA9_KcEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, $1); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA8_KcEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, $1); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA7_KcEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, $1); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA6_KcEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, $1); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA5_KcEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, $1); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA4_KcEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, $1); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($3, $$byval_copy); + STACKTOP = sp; + return $3 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle8DtorName9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, $4 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 52685); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + $4 = HEAP32[$0 + 8 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$4 >> 2] | 0) + 16 >> 2] & 255]($4, $1); + STACKTOP = sp; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle22ConversionOperatorType9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 54318); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + STACKTOP = sp; + return; +} + +function __ZNSt3__214__split_bufferINS_4pairIfmEERNS_9allocatorIS2_EEEC2EmmS5_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $4 = 0, $8 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + do if ($1) if ($1 >>> 0 > 536870911) { + $8 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($8, 41481); + HEAP32[$8 >> 2] = 17472; + ___cxa_throw($8 | 0, 13960, 22); + } else { + $11 = __Znwm($1 << 3) | 0; + break; + } else $11 = 0; while (0); + HEAP32[$0 >> 2] = $11; + $12 = $11 + ($2 << 3) | 0; + HEAP32[$0 + 8 >> 2] = $12; + HEAP32[$0 + 4 >> 2] = $12; + HEAP32[$4 >> 2] = $11 + ($1 << 3); + return; +} + +function __ZNSt3__214__split_bufferINS_4pairIfiEERNS_9allocatorIS2_EEEC2EmmS5_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $4 = 0, $8 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + do if ($1) if ($1 >>> 0 > 536870911) { + $8 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($8, 41481); + HEAP32[$8 >> 2] = 17472; + ___cxa_throw($8 | 0, 13960, 22); + } else { + $11 = __Znwm($1 << 3) | 0; + break; + } else $11 = 0; while (0); + HEAP32[$0 >> 2] = $11; + $12 = $11 + ($2 << 3) | 0; + HEAP32[$0 + 8 >> 2] = $12; + HEAP32[$0 + 4 >> 2] = $12; + HEAP32[$4 >> 2] = $11 + ($1 << 3); + return; +} + +function __ZNKSt3__27collateIwE10do_compareEPKwS3_S3_S3_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$011 = 0, $$012 = 0, $7 = 0, $8 = 0, label = 0; + $$011 = $3; + $$012 = $1; + while (1) { + if (($$011 | 0) == ($4 | 0)) { + label = 7; + break; + } + if (($$012 | 0) == ($2 | 0)) { + $$0 = -1; + break; + } + $7 = HEAP32[$$012 >> 2] | 0; + $8 = HEAP32[$$011 >> 2] | 0; + if (($7 | 0) < ($8 | 0)) { + $$0 = -1; + break; + } + if (($8 | 0) < ($7 | 0)) { + $$0 = 1; + break; + } + $$011 = $$011 + 4 | 0; + $$012 = $$012 + 4 | 0; + } + if ((label | 0) == 7) $$0 = ($$012 | 0) != ($2 | 0) & 1; + return $$0 | 0; +} + +function _arVecHousehold($0) { + $0 = $0 | 0; + var $$0 = 0, $$020 = 0.0, $$1 = 0.0, $11 = 0.0, $13 = 0, $15 = 0, $2 = 0.0, $4 = 0, $5 = 0.0, $8 = 0.0; + $2 = +Math_sqrt(+(+_arVecInnerproduct($0, $0))); + L1 : do if ($2 != 0.0) { + $4 = HEAP32[$0 >> 2] | 0; + $5 = +HEAPF64[$4 >> 3]; + $$020 = $5 < 0.0 ? -$2 : $2; + $8 = $5 + $$020; + HEAPF64[$4 >> 3] = $8; + $11 = 1.0 / +Math_sqrt(+($$020 * $8)); + $13 = HEAP32[$0 + 4 >> 2] | 0; + $$0 = 0; + while (1) { + if (($$0 | 0) >= ($13 | 0)) { + $$1 = $$020; + break L1; + } + $15 = $4 + ($$0 << 3) | 0; + HEAPF64[$15 >> 3] = $11 * +HEAPF64[$15 >> 3]; + $$0 = $$0 + 1 | 0; + } + } else $$1 = $2; while (0); + return +-$$1; +} + +function __ZNSt3__214__split_bufferIPNS_6locale5facetERNS_15__sso_allocatorIS3_Lm28EEEED2Ev($0) { + $0 = $0 | 0; + var $11 = 0, $2 = 0, $3 = 0, $5 = 0, $6 = 0, $7 = 0, $9 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + $5 = HEAP32[$3 >> 2] | 0; + while (1) { + if (($5 | 0) == ($2 | 0)) break; + $6 = $5 + -4 | 0; + HEAP32[$3 >> 2] = $6; + $5 = $6; + } + $7 = HEAP32[$0 >> 2] | 0; + $9 = $7; + do if ($7 | 0) { + $11 = HEAP32[$0 + 16 >> 2] | 0; + if (($7 | 0) == ($11 | 0)) { + HEAP8[$11 + 112 >> 0] = 0; + break; + } else { + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $9 | 0); + break; + } + } while (0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle19GlobalQualifiedName9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 53698); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + STACKTOP = sp; + return; +} + +function _saveSetjmp(env, label, table, size) { + env = env | 0; + label = label | 0; + table = table | 0; + size = size | 0; + var i = 0; + setjmpId = setjmpId + 1 | 0; + HEAP32[env >> 2] = setjmpId; + while ((i | 0) < (size | 0)) { + if (!(HEAP32[table + (i << 3) >> 2] | 0)) { + HEAP32[table + (i << 3) >> 2] = setjmpId; + HEAP32[table + ((i << 3) + 4) >> 2] = label; + HEAP32[table + ((i << 3) + 8) >> 2] = 0; + setTempRet0(size | 0); + return table | 0; + } + i = i + 1 | 0; + } + size = size * 2 | 0; + table = _realloc(table | 0, 8 * (size + 1 | 0) | 0) | 0; + table = _saveSetjmp(env | 0, label | 0, table | 0, size | 0) | 0; + setTempRet0(size | 0); + return table | 0; +} + +function _detectNFTMarker($id) { + $id = $id | 0; + var $id$addr = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $id$addr = sp; + HEAP32[$id$addr >> 2] = $id; + if (__ZNSt3__212__hash_tableINS_17__hash_value_typeIi12arControllerEENS_22__unordered_map_hasherIiS3_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS3_NS_8equal_toIiEELb1EEENS_9allocatorIS3_EEE4findIiEENS_15__hash_iteratorIPNS_11__hash_nodeIS3_PvEEEERKT_(65260, $id$addr) | 0) __ZNSt3__213unordered_mapIi12arControllerNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS1_EEEEEixERS8_(65260, $id$addr) | 0; + STACKTOP = sp; + return -1; +} + +function _strtok($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$010 = 0, $10 = 0, $3 = 0, $6 = 0, label = 0; + if (!$0) { + $3 = HEAP32[16358] | 0; + if (!$3) $$0 = 0; else { + $$010 = $3; + label = 3; + } + } else { + $$010 = $0; + label = 3; + } + do if ((label | 0) == 3) { + $6 = $$010 + (_strspn($$010, $1) | 0) | 0; + if (!(HEAP8[$6 >> 0] | 0)) { + HEAP32[16358] = 0; + $$0 = 0; + break; + } + $10 = $6 + (_strcspn($6, $1) | 0) | 0; + HEAP32[16358] = $10; + if (!(HEAP8[$10 >> 0] | 0)) { + HEAP32[16358] = 0; + $$0 = $6; + break; + } else { + HEAP32[16358] = $10 + 1; + HEAP8[$10 >> 0] = 0; + $$0 = $6; + break; + } + } while (0); + return $$0 | 0; +} + +function _ar2GenTemplate($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $13 = 0, $2 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = _malloc(40) | 0; + if (!$2) { + _arLog(0, 3, 45930, sp); + _exit(1); + } + HEAP32[$2 + 16 >> 2] = $0; + HEAP32[$2 + 8 >> 2] = $0; + HEAP32[$2 + 20 >> 2] = $1; + HEAP32[$2 + 12 >> 2] = $1; + $9 = $0 + 1 + $1 | 0; + HEAP32[$2 >> 2] = $9; + HEAP32[$2 + 4 >> 2] = $9; + $13 = _malloc(Math_imul($9 << 1, $9) | 0) | 0; + HEAP32[$2 + 24 >> 2] = $13; + if (!$13) { + _arLog(0, 3, 45930, sp + 8 | 0); + _exit(1); + } else { + STACKTOP = sp; + return $2 | 0; + } + return 0; +} + +function __ZNSt3__2L11init_wam_pmEv() { + var $$0$i$i = 0, $4 = 0; + if ((HEAP8[64704] | 0) == 0 ? ___cxa_guard_acquire(64704) | 0 : 0) { + $4 = 63808; + do { + HEAP32[$4 >> 2] = 0; + HEAP32[$4 + 4 >> 2] = 0; + HEAP32[$4 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$4 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $4 = $4 + 12 | 0; + } while (($4 | 0) != 63832); + ___cxa_guard_release(64704); + } + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(63808, 21804) | 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw(63820, 21816) | 0; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle16StdQualifiedName9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 55121); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + STACKTOP = sp; + return; +} + +function __ZNSt3__2L10init_am_pmEv() { + var $$0$i$i = 0, $4 = 0; + if ((HEAP8[64624] | 0) == 0 ? ___cxa_guard_acquire(64624) | 0 : 0) { + $4 = 63312; + do { + HEAP32[$4 >> 2] = 0; + HEAP32[$4 + 4 >> 2] = 0; + HEAP32[$4 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$4 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + $4 = $4 + 12 | 0; + } while (($4 | 0) != 63336); + ___cxa_guard_release(64624); + } + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63312, 59453) | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(63324, 59456) | 0; + return; +} + +function __ZNKSt3__27codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $10 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $8 = sp + 4 | 0; + $9 = sp; + HEAP32[$8 >> 2] = $2; + HEAP32[$9 >> 2] = $5; + $10 = __ZNSt3__2L13utf16_to_utf8EPKtS1_RS1_PhS3_RS3_mNS_12codecvt_modeE($2, $3, $8, $5, $6, $9, 1114111, 0) | 0; + HEAP32[$4 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$9 >> 2]; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle15LiteralOperator9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 54238); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + STACKTOP = sp; + return; +} + +function __ZNKSt3__27codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $10 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $8 = sp + 4 | 0; + $9 = sp; + HEAP32[$8 >> 2] = $2; + HEAP32[$9 >> 2] = $5; + $10 = __ZNSt3__2L13utf8_to_utf16EPKhS1_RS1_PtS3_RS3_mNS_12codecvt_modeE($2, $3, $8, $5, $6, $9, 1114111, 0) | 0; + HEAP32[$4 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$9 >> 2]; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNKSt3__27codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $10 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $8 = sp + 4 | 0; + $9 = sp; + HEAP32[$8 >> 2] = $2; + HEAP32[$9 >> 2] = $5; + $10 = __ZNSt3__2L12ucs4_to_utf8EPKjS1_RS1_PhS3_RS3_mNS_12codecvt_modeE($2, $3, $8, $5, $6, $9, 1114111, 0) | 0; + HEAP32[$4 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$9 >> 2]; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle27ExpandedSpecialSubstitution11getBaseNameEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + switch (HEAP32[$1 + 8 >> 2] | 0) { + case 0: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($0, 51703); + break; + } + case 1: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($0, 51713); + break; + } + case 2: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($0, 51713); + break; + } + case 3: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($0, 55489); + break; + } + case 4: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($0, 55503); + break; + } + case 5: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($0, 55517); + break; + } + default: + {} + } + return; +} + +function __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE13__vdeallocateEv($0) { + $0 = $0 | 0; + var $$0$i$i$i = 0, $1 = 0, $3 = 0, $6 = 0, $7 = 0, $8 = 0; + $1 = HEAP32[$0 >> 2] | 0; + if ($1 | 0) { + $3 = $0 + 4 | 0; + $$0$i$i$i = HEAP32[$3 >> 2] | 0; + while (1) { + if (($$0$i$i$i | 0) == ($1 | 0)) break; + $6 = $$0$i$i$i + -20 | 0; + __ZN6vision12FeaturePointD2Ev($6); + $$0$i$i$i = $6; + } + HEAP32[$3 >> 2] = $1; + $7 = HEAP32[$0 >> 2] | 0; + $8 = $0 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$8 >> 2] | 0) - $7 | 0); + HEAP32[$8 >> 2] = 0; + HEAP32[$3 >> 2] = 0; + HEAP32[$0 >> 2] = 0; + } + return; +} + +function __ZNKSt3__27codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + var $10 = 0, $8 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $8 = sp + 4 | 0; + $9 = sp; + HEAP32[$8 >> 2] = $2; + HEAP32[$9 >> 2] = $5; + $10 = __ZNSt3__2L12utf8_to_ucs4EPKhS1_RS1_PjS3_RS3_mNS_12codecvt_modeE($2, $3, $8, $5, $6, $9, 1114111, 0) | 0; + HEAP32[$4 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$7 >> 2] = HEAP32[$9 >> 2]; + STACKTOP = sp; + return $10 | 0; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEED2Ev($0) { + $0 = $0 | 0; + var $3 = 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEE17__deallocate_nodeEPNS_16__hash_node_baseIPNS_11__hash_nodeIS2_PvEEEE($0, HEAP32[$0 + 8 >> 2] | 0); + $3 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = 0; + if ($3 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($3, HEAP32[$0 + 4 >> 2] << 2); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle24ForwardTemplateReference13getSyntaxNodeERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $11 = 0, $2 = 0, $3 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $3 = $0 + 16 | 0; + if (!(HEAP8[$3 >> 0] | 0)) { + __ZN12_GLOBAL__N_114SwapAndRestoreIbEC2ERbb($2, $3, 1); + $7 = HEAP32[$0 + 12 >> 2] | 0; + $11 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$7 >> 2] | 0) + 12 >> 2] & 127]($7, $1) | 0; + __ZN12_GLOBAL__N_114SwapAndRestoreIbED2Ev($2); + $$0 = $11; + } else $$0 = $0; + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNSt3__26vectorIN6vision17PriorityQueueItemILi96EEENS_9allocatorIS3_EEE11__vallocateEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $5 = 0, $7 = 0; + if ((__ZNKSt3__26vectorIN6vision17PriorityQueueItemILi96EEENS_9allocatorIS3_EEE8max_sizeEv($0) | 0) >>> 0 < $1 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); + if ($1 >>> 0 > 536870911) { + $5 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($5, 41481); + HEAP32[$5 >> 2] = 17472; + ___cxa_throw($5 | 0, 13960, 22); + } else { + $7 = __Znwm($1 << 3) | 0; + HEAP32[$0 + 4 >> 2] = $7; + HEAP32[$0 >> 2] = $7; + HEAP32[$0 + 8 >> 2] = $7 + ($1 << 3); + return; + } +} + +function __ZNSt3__214__split_bufferIiRNS_9allocatorIiEEEC2EmmS3_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $4 = 0, $8 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + do if ($1) if ($1 >>> 0 > 1073741823) { + $8 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($8, 41481); + HEAP32[$8 >> 2] = 17472; + ___cxa_throw($8 | 0, 13960, 22); + } else { + $11 = __Znwm($1 << 2) | 0; + break; + } else $11 = 0; while (0); + HEAP32[$0 >> 2] = $11; + $12 = $11 + ($2 << 2) | 0; + HEAP32[$0 + 8 >> 2] = $12; + HEAP32[$0 + 4 >> 2] = $12; + HEAP32[$4 >> 2] = $11 + ($1 << 2); + return; +} + +function __ZNSt3__214__split_bufferIfRNS_9allocatorIfEEEC2EmmS3_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $4 = 0, $8 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + do if ($1) if ($1 >>> 0 > 1073741823) { + $8 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($8, 41481); + HEAP32[$8 >> 2] = 17472; + ___cxa_throw($8 | 0, 13960, 22); + } else { + $11 = __Znwm($1 << 2) | 0; + break; + } else $11 = 0; while (0); + HEAP32[$0 >> 2] = $11; + $12 = $11 + ($2 << 2) | 0; + HEAP32[$0 + 8 >> 2] = $12; + HEAP32[$0 + 4 >> 2] = $12; + HEAP32[$4 >> 2] = $11 + ($1 << 2); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle9ThrowExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 52789); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + STACKTOP = sp; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle24ForwardTemplateReference19hasRHSComponentSlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $3 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $3 = $0 + 16 | 0; + if (!(HEAP8[$3 >> 0] | 0)) { + __ZN12_GLOBAL__N_114SwapAndRestoreIbEC2ERbb($2, $3, 1); + $8 = __ZNK12_GLOBAL__N_116itanium_demangle4Node15hasRHSComponentERNS_12OutputStreamE(HEAP32[$0 + 12 >> 2] | 0, $1) | 0; + __ZN12_GLOBAL__N_114SwapAndRestoreIbED2Ev($2); + $$0 = $8; + } else $$0 = 0; + STACKTOP = sp; + return $$0 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle19SpecialSubstitution11getBaseNameEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + switch (HEAP32[$1 + 8 >> 2] | 0) { + case 0: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($0, 51703); + break; + } + case 1: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($0, 51713); + break; + } + case 2: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($0, 51726); + break; + } + case 3: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($0, 51733); + break; + } + case 4: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($0, 51741); + break; + } + case 5: + { + __ZN12_GLOBAL__N_110StringViewC2EPKc($0, 51749); + break; + } + default: + {} + } + return; +} + +function __ZZNK12_GLOBAL__N_116itanium_demangle8FoldExpr9printLeftERNS_12OutputStreamEENKUlvE_clEv($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + $3 = HEAP32[$0 + 4 >> 2] | 0; + __ZN12_GLOBAL__N_112OutputStreampLEc(HEAP32[$0 >> 2] | 0, 40); + __ZN12_GLOBAL__N_116itanium_demangle22ParameterPackExpansionC2EPKNS0_4NodeE($1, HEAP32[$3 + 8 >> 2] | 0); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE($1, HEAP32[$0 >> 2] | 0); + __ZN12_GLOBAL__N_112OutputStreampLEc(HEAP32[$0 >> 2] | 0, 41); + STACKTOP = sp; + return; +} + +function _strncat($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0$lcssa = 0, $$01013 = 0, $$01112 = 0, $$014 = 0, $10 = 0, $4 = 0, $6 = 0; + $4 = $0 + (_strlen($0) | 0) | 0; + L1 : do if (!$2) $$0$lcssa = $4; else { + $$01013 = $2; + $$01112 = $1; + $$014 = $4; + while (1) { + $6 = HEAP8[$$01112 >> 0] | 0; + if (!($6 << 24 >> 24)) { + $$0$lcssa = $$014; + break L1; + } + $$01013 = $$01013 + -1 | 0; + $10 = $$014 + 1 | 0; + HEAP8[$$014 >> 0] = $6; + if (!$$01013) { + $$0$lcssa = $10; + break; + } else { + $$01112 = $$01112 + 1 | 0; + $$014 = $10; + } + } + } while (0); + HEAP8[$$0$lcssa >> 0] = 0; + return $0 | 0; +} + +function __ZNSt3__214__split_bufferItRNS_9allocatorItEEEC2EmmS3_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $4 = 0, $8 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + do if ($1) if (($1 | 0) < 0) { + $8 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($8, 41481); + HEAP32[$8 >> 2] = 17472; + ___cxa_throw($8 | 0, 13960, 22); + } else { + $11 = __Znwm($1 << 1) | 0; + break; + } else $11 = 0; while (0); + HEAP32[$0 >> 2] = $11; + $12 = $11 + ($2 << 1) | 0; + HEAP32[$0 + 8 >> 2] = $12; + HEAP32[$0 + 4 >> 2] = $12; + HEAP32[$4 >> 2] = $11 + ($1 << 1); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle24ForwardTemplateReference15hasFunctionSlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $3 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $3 = $0 + 16 | 0; + if (!(HEAP8[$3 >> 0] | 0)) { + __ZN12_GLOBAL__N_114SwapAndRestoreIbEC2ERbb($2, $3, 1); + $8 = __ZNK12_GLOBAL__N_116itanium_demangle4Node11hasFunctionERNS_12OutputStreamE(HEAP32[$0 + 12 >> 2] | 0, $1) | 0; + __ZN12_GLOBAL__N_114SwapAndRestoreIbED2Ev($2); + $$0 = $8; + } else $$0 = 0; + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN10emscripten8functionIiJiiiEJEEEvPKcPFT_DpT0_EDpT1_($name, $fn) { + $name = $name | 0; + $fn = $fn | 0; + var $args = 0, $call = 0, $call1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $args = sp; + $call = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiiiiEE8getCountEv($args) | 0; + $call1 = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiiiiEE8getTypesEv($args) | 0; + __embind_register_function($name | 0, $call | 0, $call1 | 0, __ZN10emscripten8internal19getGenericSignatureIJiiiiiEEEPKcv() | 0, 8, $fn | 0); + STACKTOP = sp; + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEE21__construct_node_hashINS_4pairIjjEEJEEENS_10unique_ptrINS_11__hash_nodeIS2_PvEENS_22__hash_node_destructorINSB_ISK_EEEEEEmOT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $5 = 0; + $5 = __Znwm(16) | 0; + HEAP32[$0 >> 2] = $5; + HEAP32[$0 + 4 >> 2] = $1 + 8; + HEAP32[$5 + 8 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$5 + 12 >> 2] = HEAP32[$3 + 4 >> 2]; + HEAP8[$0 + 8 >> 0] = 1; + HEAP32[$5 + 4 >> 2] = $2; + HEAP32[$5 >> 2] = 0; + return; +} + +function __ZN10emscripten8functionIiJiiEJEEEvPKcPFT_DpT0_EDpT1_($name, $fn) { + $name = $name | 0; + $fn = $fn | 0; + var $args = 0, $call = 0, $call1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $args = sp; + $call = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiiiEE8getCountEv($args) | 0; + $call1 = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiiiEE8getTypesEv($args) | 0; + __embind_register_function($name | 0, $call | 0, $call1 | 0, __ZN10emscripten8internal19getGenericSignatureIJiiiiEEEPKcv() | 0, 32, $fn | 0); + STACKTOP = sp; + return; +} + +function __ZN10emscripten8functionIvJiiEJEEEvPKcPFT_DpT0_EDpT1_($name, $fn) { + $name = $name | 0; + $fn = $fn | 0; + var $args = 0, $call = 0, $call1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $args = sp; + $call = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJviiEE8getCountEv($args) | 0; + $call1 = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJviiEE8getTypesEv($args) | 0; + __embind_register_function($name | 0, $call | 0, $call1 | 0, __ZN10emscripten8internal19getGenericSignatureIJviiiEEEPKcv() | 0, 2, $fn | 0); + STACKTOP = sp; + return; +} + +function __ZN10emscripten8functionIvJifEJEEEvPKcPFT_DpT0_EDpT1_($name, $fn) { + $name = $name | 0; + $fn = $fn | 0; + var $args = 0, $call = 0, $call1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $args = sp; + $call = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJvifEE8getCountEv($args) | 0; + $call1 = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJvifEE8getTypesEv($args) | 0; + __embind_register_function($name | 0, $call | 0, $call1 | 0, __ZN10emscripten8internal19getGenericSignatureIJviifEEEPKcv() | 0, 2, $fn | 0); + STACKTOP = sp; + return; +} + +function __ZN10emscripten8functionIvJidEJEEEvPKcPFT_DpT0_EDpT1_($name, $fn) { + $name = $name | 0; + $fn = $fn | 0; + var $args = 0, $call = 0, $call1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $args = sp; + $call = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJvidEE8getCountEv($args) | 0; + $call1 = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJvidEE8getTypesEv($args) | 0; + __embind_register_function($name | 0, $call | 0, $call1 | 0, __ZN10emscripten8internal19getGenericSignatureIJviidEEEPKcv() | 0, 1, $fn | 0); + STACKTOP = sp; + return; +} + +function __ZNSt3__214__split_bufferIPNS_6locale5facetERNS_15__sso_allocatorIS3_Lm28EEEEC2EmmS6_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $13 = 0, $14 = 0, $4 = 0, $7 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + do if ($1) { + $7 = $3 + 112 | 0; + if ($1 >>> 0 < 29 & (HEAP8[$7 >> 0] | 0) == 0) { + HEAP8[$7 >> 0] = 1; + $13 = $3; + break; + } else { + $13 = __Znwm($1 << 2) | 0; + break; + } + } else $13 = 0; while (0); + HEAP32[$0 >> 2] = $13; + $14 = $13 + ($2 << 2) | 0; + HEAP32[$0 + 8 >> 2] = $14; + HEAP32[$0 + 4 >> 2] = $14; + HEAP32[$4 >> 2] = $13 + ($1 << 2); + return; +} + +function __ZN6vision6detail23create_formatted_stringERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPi($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 2048 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(2048); + $3 = sp; + _vsnprintf($3, 2048, (HEAP8[$1 + 11 >> 0] | 0) < 0 ? HEAP32[$1 >> 2] | 0 : $1, $2) | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm($0, $3, __ZNSt3__211char_traitsIcE6lengthEPKc($3) | 0); + STACKTOP = sp; + return; +} + +function __ZNSt3__213__vector_baseINS_6vectorINS1_INS_4pairIfmEENS_9allocatorIS3_EEEENS4_IS6_EEEENS4_IS8_EEED2Ev($0) { + $0 = $0 | 0; + var $$0$i$i = 0, $1 = 0, $3 = 0, $6 = 0, $7 = 0; + $1 = HEAP32[$0 >> 2] | 0; + if ($1 | 0) { + $3 = $0 + 4 | 0; + $$0$i$i = HEAP32[$3 >> 2] | 0; + while (1) { + if (($$0$i$i | 0) == ($1 | 0)) break; + $6 = $$0$i$i + -12 | 0; + __ZNSt3__213__vector_baseINS_6vectorINS_4pairIfmEENS_9allocatorIS3_EEEENS4_IS6_EEED2Ev($6); + $$0$i$i = $6; + } + HEAP32[$3 >> 2] = $1; + $7 = HEAP32[$0 >> 2] | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 8 >> 2] | 0) - $7 | 0); + } + return; +} + +function __ZN6vision16Multiply_3x3_3x1IfEEvPT_PKS1_S4_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $14 = 0, $8 = 0; + $8 = $2 + 4 | 0; + $14 = $2 + 8 | 0; + HEAPF32[$0 >> 2] = +HEAPF32[$1 >> 2] * +HEAPF32[$2 >> 2] + +HEAPF32[$1 + 4 >> 2] * +HEAPF32[$8 >> 2] + +HEAPF32[$1 + 8 >> 2] * +HEAPF32[$14 >> 2]; + HEAPF32[$0 + 4 >> 2] = +HEAPF32[$1 + 12 >> 2] * +HEAPF32[$2 >> 2] + +HEAPF32[$1 + 16 >> 2] * +HEAPF32[$8 >> 2] + +HEAPF32[$1 + 20 >> 2] * +HEAPF32[$14 >> 2]; + HEAPF32[$0 + 8 >> 2] = +HEAPF32[$1 + 24 >> 2] * +HEAPF32[$2 >> 2] + +HEAPF32[$1 + 28 >> 2] * +HEAPF32[$8 >> 2] + +HEAPF32[$1 + 32 >> 2] * +HEAPF32[$14 >> 2]; + return; +} + +function __ZN10emscripten8functionIvJiEJEEEvPKcPFT_DpT0_EDpT1_($name, $fn) { + $name = $name | 0; + $fn = $fn | 0; + var $args = 0, $call = 0, $call1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $args = sp; + $call = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJviEE8getCountEv($args) | 0; + $call1 = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJviEE8getTypesEv($args) | 0; + __embind_register_function($name | 0, $call | 0, $call1 | 0, __ZN10emscripten8internal19getGenericSignatureIJviiEEEPKcv() | 0, 132, $fn | 0); + STACKTOP = sp; + return; +} + +function __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE11__vallocateEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $5 = 0, $7 = 0; + if ((__ZNKSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE8max_sizeEv($0) | 0) >>> 0 < $1 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); + if ($1 >>> 0 > 214748364) { + $5 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($5, 41481); + HEAP32[$5 >> 2] = 17472; + ___cxa_throw($5 | 0, 13960, 22); + } else { + $7 = __Znwm($1 * 20 | 0) | 0; + HEAP32[$0 + 4 >> 2] = $7; + HEAP32[$0 >> 2] = $7; + HEAP32[$0 + 8 >> 2] = $7 + ($1 * 20 | 0); + return; + } +} + +function __ZNK12_GLOBAL__N_116itanium_demangle8BoolExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$byval_copy = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $$byval_copy = sp + 8 | 0; + $2 = sp; + if (!(HEAP8[$0 + 8 >> 0] | 0)) __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 61026); else __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 61032); + HEAP32[$$byval_copy >> 2] = HEAP32[$2 >> 2]; + HEAP32[$$byval_copy + 4 >> 2] = HEAP32[$2 + 4 >> 2]; + __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($1, $$byval_copy); + STACKTOP = sp; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle24ForwardTemplateReference12hasArraySlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $3 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $3 = $0 + 16 | 0; + if (!(HEAP8[$3 >> 0] | 0)) { + __ZN12_GLOBAL__N_114SwapAndRestoreIbEC2ERbb($2, $3, 1); + $8 = __ZNK12_GLOBAL__N_116itanium_demangle4Node8hasArrayERNS_12OutputStreamE(HEAP32[$0 + 12 >> 2] | 0, $1) | 0; + __ZN12_GLOBAL__N_114SwapAndRestoreIbED2Ev($2); + $$0 = $8; + } else $$0 = 0; + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN10emscripten8functionIiJiEJEEEvPKcPFT_DpT0_EDpT1_($name, $fn) { + $name = $name | 0; + $fn = $fn | 0; + var $args = 0, $call = 0, $call1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $args = sp; + $call = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiiEE8getCountEv($args) | 0; + $call1 = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiiEE8getTypesEv($args) | 0; + __embind_register_function($name | 0, $call | 0, $call1 | 0, __ZN10emscripten8internal19getGenericSignatureIJiiiEEEPKcv() | 0, 54, $fn | 0); + STACKTOP = sp; + return; +} + +function __ZN10emscripten8functionIdJiEJEEEvPKcPFT_DpT0_EDpT1_($name, $fn) { + $name = $name | 0; + $fn = $fn | 0; + var $args = 0, $call = 0, $call1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $args = sp; + $call = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJdiEE8getCountEv($args) | 0; + $call1 = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJdiEE8getTypesEv($args) | 0; + __embind_register_function($name | 0, $call | 0, $call1 | 0, __ZN10emscripten8internal19getGenericSignatureIJdiiEEEPKcv() | 0, 1, $fn | 0); + STACKTOP = sp; + return; +} + +function __ZNK10__cxxabiv117__class_type_info24process_found_base_classEPNS_19__dynamic_cast_infoEPvi($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $10 = 0, $13 = 0, $4 = 0, $5 = 0; + $4 = $1 + 16 | 0; + $5 = HEAP32[$4 >> 2] | 0; + do if ($5) { + if (($5 | 0) != ($2 | 0)) { + $13 = $1 + 36 | 0; + HEAP32[$13 >> 2] = (HEAP32[$13 >> 2] | 0) + 1; + HEAP32[$1 + 24 >> 2] = 2; + HEAP8[$1 + 54 >> 0] = 1; + break; + } + $10 = $1 + 24 | 0; + if ((HEAP32[$10 >> 2] | 0) == 2) HEAP32[$10 >> 2] = $3; + } else { + HEAP32[$4 >> 2] = $2; + HEAP32[$1 + 24 >> 2] = $3; + HEAP32[$1 + 36 >> 2] = 1; + } while (0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EE9push_backERKS3_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $11 = 0, $2 = 0, $3 = 0, $9 = 0; + $2 = $0 + 4 | 0; + $3 = HEAP32[$2 >> 2] | 0; + if (($3 | 0) == (HEAP32[$0 + 8 >> 2] | 0)) { + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EE7reserveEm($0, (__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EE4sizeEv($0) | 0) << 1); + $11 = HEAP32[$2 >> 2] | 0; + } else $11 = $3; + $9 = HEAP32[$1 >> 2] | 0; + HEAP32[$2 >> 2] = $11 + 4; + HEAP32[$11 >> 2] = $9; + return; +} + +function __ZN10emscripten8functionIiJEJEEEvPKcPFT_DpT0_EDpT1_($name, $fn) { + $name = $name | 0; + $fn = $fn | 0; + var $args = 0, $call = 0, $call1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $args = sp; + $call = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiEE8getCountEv($args) | 0; + $call1 = __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiEE8getTypesEv($args) | 0; + __embind_register_function($name | 0, $call | 0, $call1 | 0, __ZN10emscripten8internal19getGenericSignatureIJiiEEEPKcv() | 0, 82, $fn | 0); + STACKTOP = sp; + return; +} + +function _kpmUtilResizeImage($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0; + switch ($3 | 0) { + case 1: + { + $$0 = __ZL14genBWImageFullPhiiPiS0_($0, $1, $2, $4, $5) | 0; + break; + } + case 5: + { + $$0 = __ZL18genBWImageTwoThirdPhiiPiS0_($0, $1, $2, $4, $5) | 0; + break; + } + case 2: + { + $$0 = __ZL14genBWImageHalfPhiiPiS0_($0, $1, $2, $4, $5) | 0; + break; + } + case 4: + { + $$0 = __ZL18genBWImageOneThirdPhiiPiS0_($0, $1, $2, $4, $5) | 0; + break; + } + default: + $$0 = __ZL15genBWImageQuartPhiiPiS0_($0, $1, $2, $4, $5) | 0; + } + return $$0 | 0; +} + +function __ZNSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE11__vallocateEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $5 = 0, $7 = 0; + if ((__ZNKSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE8max_sizeEv($0) | 0) >>> 0 < $1 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); + if ($1 >>> 0 > 357913941) { + $5 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($5, 41481); + HEAP32[$5 >> 2] = 17472; + ___cxa_throw($5 | 0, 13960, 22); + } else { + $7 = __Znwm($1 * 12 | 0) | 0; + HEAP32[$0 + 4 >> 2] = $7; + HEAP32[$0 >> 2] = $7; + HEAP32[$0 + 8 >> 2] = $7 + ($1 * 12 | 0); + return; + } +} + +function __ZN12_GLOBAL__N_116itanium_demangle13EnclosingExprC2ENS_10StringViewEPNS0_4NodeES2_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $10 = 0, $11 = 0, $17 = 0, $22 = 0, $23 = 0, $5 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 47, 1, 1, 1); + HEAP32[$0 >> 2] = 18396; + $5 = $1; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $0 + 8 | 0; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + HEAP32[$0 + 16 >> 2] = $2; + $17 = $3; + $22 = HEAP32[$17 + 4 >> 2] | 0; + $23 = $0 + 20 | 0; + HEAP32[$23 >> 2] = HEAP32[$17 >> 2]; + HEAP32[$23 + 4 >> 2] = $22; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle12FunctionTypeC2EPKNS0_4NodeENS0_9NodeArrayENS0_10QualifiersENS0_15FunctionRefQualES4_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $13 = 0, $14 = 0, $8 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 15, 0, 1, 0); + HEAP32[$0 >> 2] = 20200; + HEAP32[$0 + 8 >> 2] = $1; + $8 = $2; + $13 = HEAP32[$8 + 4 >> 2] | 0; + $14 = $0 + 12 | 0; + HEAP32[$14 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$14 + 4 >> 2] = $13; + HEAP32[$0 + 20 >> 2] = $3; + HEAP8[$0 + 24 >> 0] = $4; + HEAP32[$0 + 28 >> 2] = $5; + return; +} + +function _icpCreateHandle($0) { + $0 = $0 | 0; + var $$0 = 0, $$022 = 0, $$023 = 0, $1 = 0; + $1 = _malloc(136) | 0; + if (!$1) $$023 = 0; else { + $$0 = 0; + while (1) { + if (($$0 | 0) == 3) break; + $$022 = 0; + while (1) { + if (($$022 | 0) == 4) break; + HEAPF64[$1 + ($$0 << 5) + ($$022 << 3) >> 3] = +HEAPF64[$0 + ($$0 << 5) + ($$022 << 3) >> 3]; + $$022 = $$022 + 1 | 0; + } + $$0 = $$0 + 1 | 0; + } + HEAP32[$1 + 96 >> 2] = 10; + HEAPF64[$1 + 104 >> 3] = .10000000149011612; + HEAPF64[$1 + 112 >> 3] = .9900000095367432; + HEAPF64[$1 + 120 >> 3] = 4.0; + HEAPF64[$1 + 128 >> 3] = .5; + $$023 = $1; + } + return $$023 | 0; +} + +function _arParamObserv2IdealLTf($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $14 = 0, $17 = 0, $28 = 0, $9 = 0; + $9 = (HEAP32[$0 + 16 >> 2] | 0) + ~~($1 + .5) | 0; + $14 = (HEAP32[$0 + 20 >> 2] | 0) + ~~($2 + .5) | 0; + if ((($9 | 0) >= 0 ? ($17 = HEAP32[$0 + 8 >> 2] | 0, !(($14 | 0) < 0 | ($9 | 0) >= ($17 | 0))) : 0) ? ($14 | 0) < (HEAP32[$0 + 12 >> 2] | 0) : 0) { + $28 = (HEAP32[$0 + 4 >> 2] | 0) + ((Math_imul($17, $14) | 0) + $9 << 1 << 2) | 0; + HEAP32[$3 >> 2] = HEAP32[$28 >> 2]; + HEAP32[$4 >> 2] = HEAP32[$28 + 4 >> 2]; + $$0 = 0; + } else $$0 = -1; + return $$0 | 0; +} + +function __ZN6vision28BinaryHierarchicalClusteringILi96EEC2Ev($0) { + $0 = $0 | 0; + var $3 = 0, $4 = 0; + HEAP32[$0 >> 2] = 1234; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + $3 = $0 + 12 | 0; + __ZN6vision14BinarykMedoidsILi96EEC2ERi($3, $0); + $4 = $0 + 72 | 0; + HEAP32[$0 + 100 >> 2] = 0; + HEAP32[$0 + 104 >> 2] = 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$4 + 4 >> 2] = 0; + HEAP32[$4 + 8 >> 2] = 0; + HEAP32[$4 + 12 >> 2] = 0; + HEAP32[$4 + 16 >> 2] = 0; + HEAP32[$4 + 20 >> 2] = 0; + HEAP32[$0 + 108 >> 2] = 16; + __ZN6vision14BinarykMedoidsILi96EE4setkEi($3, 8); + __ZN6vision14BinarykMedoidsILi96EE16setNumHypothesesEi($3, 1); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13ObjCProtoName12isObjCObjectEv($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $4 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp + 8 | 0; + $2 = sp; + $4 = HEAP32[$0 + 8 >> 2] | 0; + if ((__ZNK12_GLOBAL__N_116itanium_demangle4Node7getKindEv($4) | 0) << 24 >> 24 == 7) { + __ZNK12_GLOBAL__N_116itanium_demangle8NameType7getNameEv($1, $4); + __ZN12_GLOBAL__N_110StringViewC2EPKc($2, 52025); + $8 = __ZN12_GLOBAL__N_1eqERKNS_10StringViewES2_($1, $2) | 0; + } else $8 = 0; + STACKTOP = sp; + return $8 | 0; +} + +function ___stdio_seek($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $17 = 0, $21 = 0, $22 = 0, $4 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp; + if (!(___wasi_syscall_ret(___wasi_fd_seek(HEAP32[$0 + 60 >> 2] | 0, $1 | 0, $2 | 0, $3 & 255 | 0, $4 | 0) | 0) | 0)) { + $11 = $4; + $21 = HEAP32[$11 + 4 >> 2] | 0; + $22 = HEAP32[$11 >> 2] | 0; + } else { + $17 = $4; + HEAP32[$17 >> 2] = -1; + HEAP32[$17 + 4 >> 2] = -1; + $21 = -1; + $22 = -1; + } + setTempRet0($21 | 0); + STACKTOP = sp; + return $22 | 0; +} + +function __ZNSt3__26vectorIN6vision7Point2dIfEENS_9allocatorIS3_EEE11__vallocateEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $5 = 0, $7 = 0; + if ((__ZNKSt3__26vectorIN6vision7Point2dIfEENS_9allocatorIS3_EEE8max_sizeEv($0) | 0) >>> 0 < $1 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); + if ($1 >>> 0 > 536870911) { + $5 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($5, 41481); + HEAP32[$5 >> 2] = 17472; + ___cxa_throw($5 | 0, 13960, 22); + } else { + $7 = __Znwm($1 << 3) | 0; + HEAP32[$0 + 4 >> 2] = $7; + HEAP32[$0 >> 2] = $7; + HEAP32[$0 + 8 >> 2] = $7 + ($1 << 3); + return; + } +} + +function _arParamIdeal2ObservLTf($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $14 = 0, $17 = 0, $27 = 0, $9 = 0; + $9 = (HEAP32[$0 + 16 >> 2] | 0) + ~~($1 + .5) | 0; + $14 = (HEAP32[$0 + 20 >> 2] | 0) + ~~($2 + .5) | 0; + if ((($9 | 0) >= 0 ? ($17 = HEAP32[$0 + 8 >> 2] | 0, !(($14 | 0) < 0 | ($9 | 0) >= ($17 | 0))) : 0) ? ($14 | 0) < (HEAP32[$0 + 12 >> 2] | 0) : 0) { + $27 = (HEAP32[$0 >> 2] | 0) + ((Math_imul($17, $14) | 0) + $9 << 1 << 2) | 0; + HEAP32[$3 >> 2] = HEAP32[$27 >> 2]; + HEAP32[$4 >> 2] = HEAP32[$27 + 4 >> 2]; + $$0 = 0; + } else $$0 = -1; + return $$0 | 0; +} + +function __ZNSt3__26vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEE11__vallocateEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i$in = 0, $4 = 0; + if ((__ZNKSt3__26vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEE8max_sizeEv($0) | 0) >>> 0 < $1 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); + $4 = $0 + 128 | 0; + if ($1 >>> 0 < 29 & (HEAP8[$4 >> 0] | 0) == 0) { + HEAP8[$4 >> 0] = 1; + $$0$i$i$in = $0 + 16 | 0; + } else $$0$i$i$in = __Znwm($1 << 2) | 0; + HEAP32[$0 + 4 >> 2] = $$0$i$i$in; + HEAP32[$0 >> 2] = $$0$i$i$in; + HEAP32[$0 + 8 >> 2] = $$0$i$i$in + ($1 << 2); + return; +} + +function __ZN6vision9MaxIndex8IfEEiPKT_($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$2 = 0, $$3 = 0, $$4 = 0, $$5 = 0; + $$0 = +HEAPF32[$0 + 4 >> 2] > +HEAPF32[$0 >> 2] & 1; + $$1 = +HEAPF32[$0 + 8 >> 2] > +HEAPF32[$0 + ($$0 << 2) >> 2] ? 2 : $$0; + $$2 = +HEAPF32[$0 + 12 >> 2] > +HEAPF32[$0 + ($$1 << 2) >> 2] ? 3 : $$1; + $$3 = +HEAPF32[$0 + 16 >> 2] > +HEAPF32[$0 + ($$2 << 2) >> 2] ? 4 : $$2; + $$4 = +HEAPF32[$0 + 20 >> 2] > +HEAPF32[$0 + ($$3 << 2) >> 2] ? 5 : $$3; + $$5 = +HEAPF32[$0 + 24 >> 2] > +HEAPF32[$0 + ($$4 << 2) >> 2] ? 6 : $$4; + return (+HEAPF32[$0 + 28 >> 2] > +HEAPF32[$0 + ($$5 << 2) >> 2] ? 7 : $$5) | 0; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS5_EEEEEENS_22__unordered_map_hasherIiS9_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS9_NS_8equal_toIiEELb1EEENS6_IS9_EEE17__deallocate_nodeEPNS_16__hash_node_baseIPNS_11__hash_nodeIS9_PvEEEE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $3 = 0; + $$0 = $1; + while (1) { + if (!$$0) break; + $3 = HEAP32[$$0 >> 2] | 0; + __ZNSt3__24pairIKiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS5_EEEEED2Ev($$0 + 8 | 0); + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($$0, 24); + $$0 = $3; + } + return; +} + +function _strcmp($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$011 = 0, $$0710 = 0, $$lcssa = 0, $$lcssa8 = 0, $2 = 0, $3 = 0, $8 = 0, $9 = 0; + $2 = HEAP8[$0 >> 0] | 0; + $3 = HEAP8[$1 >> 0] | 0; + if ($2 << 24 >> 24 == 0 ? 1 : $2 << 24 >> 24 != $3 << 24 >> 24) { + $$lcssa = $3; + $$lcssa8 = $2; + } else { + $$011 = $1; + $$0710 = $0; + do { + $$0710 = $$0710 + 1 | 0; + $$011 = $$011 + 1 | 0; + $8 = HEAP8[$$0710 >> 0] | 0; + $9 = HEAP8[$$011 >> 0] | 0; + } while (!($8 << 24 >> 24 == 0 ? 1 : $8 << 24 >> 24 != $9 << 24 >> 24)); + $$lcssa = $9; + $$lcssa8 = $8; + } + return ($$lcssa8 & 255) - ($$lcssa & 255) | 0; +} + +function __ZNSt3__29__num_getIwE17__stage2_int_prepERNS_8ios_baseERw($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0, $4 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + __ZNKSt3__28ios_base6getlocEv($3, $1); + $4 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66552) | 0; + $8 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$4 >> 2] | 0) + 16 >> 2] & 127]($4) | 0; + HEAP32[$2 >> 2] = $8; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$4 >> 2] | 0) + 20 >> 2] & 255]($0, $4); + __ZNSt3__26localeD2Ev($3); + STACKTOP = sp; + return; +} + +function __ZNSt3__29__num_getIcE17__stage2_int_prepERNS_8ios_baseERc($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0, $4 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + __ZNKSt3__28ios_base6getlocEv($3, $1); + $4 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66528) | 0; + $8 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$4 >> 2] | 0) + 16 >> 2] & 127]($4) | 0; + HEAP8[$2 >> 0] = $8; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$4 >> 2] | 0) + 20 >> 2] & 255]($0, $4); + __ZNSt3__26localeD2Ev($3); + STACKTOP = sp; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack13getSyntaxNodeERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $12 = 0, $3 = 0, $4 = 0, $7 = 0; + __ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack23initializePackExpansionERNS_12OutputStreamE($0, $1); + $3 = HEAP32[$1 + 12 >> 2] | 0; + $4 = $0 + 8 | 0; + if ($3 >>> 0 < (__ZNK12_GLOBAL__N_116itanium_demangle9NodeArray4sizeEv($4) | 0) >>> 0) { + $7 = __ZNK12_GLOBAL__N_116itanium_demangle9NodeArrayixEm($4, $3) | 0; + $12 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$7 >> 2] | 0) + 12 >> 2] & 127]($7, $1) | 0; + } else $12 = $0; + return $12 | 0; +} + +function __ZN6vision14SampleReceptorEPKNS_25GaussianScaleSpacePyramidEffii($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + $3 = $3 | 0; + $4 = $4 | 0; + var $10 = 0.0, $5 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $5 = sp + 4 | 0; + $6 = sp; + $7 = __ZNK6vision25GaussianScaleSpacePyramid3getEmm($0, $3, $4) | 0; + __ZN6vision25bilinear_downsample_pointERfS0_ffi($5, $6, $1, $2, $3); + $10 = +__ZN6vision14SampleReceptorERKNS_5ImageEff($7, +HEAPF32[$5 >> 2], +HEAPF32[$6 >> 2]); + STACKTOP = sp; + return +$10; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEEEENS_22__unordered_map_hasherIiS7_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS7_NS_8equal_toIiEELb1EEENS_9allocatorIS7_EEE17__deallocate_nodeEPNS_16__hash_node_baseIPNS_11__hash_nodeIS7_PvEEEE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $3 = 0; + $$0 = $1; + while (1) { + if (!$$0) break; + $3 = HEAP32[$$0 >> 2] | 0; + __ZNSt3__24pairIKiNS_10shared_ptrIN6vision8KeyframeILi96EEEEEED2Ev($$0 + 8 | 0); + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($$0, 20); + $$0 = $3; + } + return; +} + +function __ZNK6vision20VisualDatabaseFacade21getQueryFeaturePointsEv($0) { + $0 = $0 | 0; + var $1 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + __ZNK6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEE13queryKeyframeEv($1, HEAP32[HEAP32[$0 >> 2] >> 2] | 0); + $6 = __ZN6vision18BinaryFeatureStore6pointsEv(__ZN6vision8KeyframeILi96EE5storeEv(HEAP32[$1 >> 2] | 0) | 0) | 0; + __ZNSt3__210shared_ptrIN6vision8KeyframeILi96EEEED2Ev($1); + STACKTOP = sp; + return $6 | 0; +} + +function __ZNSt3__213__vector_baseINS_6vectorINS_4pairIfmEENS_9allocatorIS3_EEEENS4_IS6_EEED2Ev($0) { + $0 = $0 | 0; + var $$0$i$i = 0, $1 = 0, $3 = 0, $6 = 0, $7 = 0; + $1 = HEAP32[$0 >> 2] | 0; + if ($1 | 0) { + $3 = $0 + 4 | 0; + $$0$i$i = HEAP32[$3 >> 2] | 0; + while (1) { + if (($$0$i$i | 0) == ($1 | 0)) break; + $6 = $$0$i$i + -12 | 0; + __ZNSt3__213__vector_baseINS_4pairIfmEENS_9allocatorIS2_EEED2Ev($6); + $$0$i$i = $6; + } + HEAP32[$3 >> 2] = $1; + $7 = HEAP32[$0 >> 2] | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 8 >> 2] | 0) - $7 | 0); + } + return; +} + +function __ZNSt3__210__stdinbufIwE5imbueERKNS_6localeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $15 = 0, $2 = 0, $3 = 0, $7 = 0, $8 = 0, $9 = 0; + $2 = __ZNKSt3__26locale9use_facetERNS0_2idE($1, 66824) | 0; + $3 = $0 + 36 | 0; + HEAP32[$3 >> 2] = $2; + $7 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$2 >> 2] | 0) + 24 >> 2] & 127]($2) | 0; + $8 = $0 + 44 | 0; + HEAP32[$8 >> 2] = $7; + $9 = HEAP32[$3 >> 2] | 0; + $15 = (FUNCTION_TABLE_ii[HEAP32[(HEAP32[$9 >> 2] | 0) + 28 >> 2] & 127]($9) | 0) & 1; + HEAP8[$0 + 53 >> 0] = $15; + if ((HEAP32[$8 >> 2] | 0) > 8) __ZNSt3__221__throw_runtime_errorEPKc(58820); else return; +} + +function __ZNSt3__210__stdinbufIcE5imbueERKNS_6localeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $15 = 0, $2 = 0, $3 = 0, $7 = 0, $8 = 0, $9 = 0; + $2 = __ZNKSt3__26locale9use_facetERNS0_2idE($1, 66816) | 0; + $3 = $0 + 36 | 0; + HEAP32[$3 >> 2] = $2; + $7 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$2 >> 2] | 0) + 24 >> 2] & 127]($2) | 0; + $8 = $0 + 44 | 0; + HEAP32[$8 >> 2] = $7; + $9 = HEAP32[$3 >> 2] | 0; + $15 = (FUNCTION_TABLE_ii[HEAP32[(HEAP32[$9 >> 2] | 0) + 28 >> 2] & 127]($9) | 0) & 1; + HEAP8[$0 + 53 >> 0] = $15; + if ((HEAP32[$8 >> 2] | 0) > 8) __ZNSt3__221__throw_runtime_errorEPKc(58820); else return; +} + +function __ZN6vision21HoughSimilarityVotingC2Ev($0) { + $0 = $0 | 0; + var $3 = 0, $4 = 0, dest = 0, stop = 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + HEAP32[$0 + 12 >> 2] = 0; + HEAP8[$0 + 16 >> 0] = 1; + $3 = $0 + 108 | 0; + dest = $0 + 20 | 0; + stop = dest + 88 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + HEAP32[$3 >> 2] = 1065353216; + $4 = $0 + 112 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$4 + 4 >> 2] = 0; + HEAP32[$4 + 8 >> 2] = 0; + HEAP32[$4 + 12 >> 2] = 0; + HEAP32[$4 + 16 >> 2] = 0; + HEAP32[$4 + 20 >> 2] = 0; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack19hasRHSComponentSlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $4 = 0, $9 = 0; + __ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack23initializePackExpansionERNS_12OutputStreamE($0, $1); + $3 = HEAP32[$1 + 12 >> 2] | 0; + $4 = $0 + 8 | 0; + if ($3 >>> 0 < (__ZNK12_GLOBAL__N_116itanium_demangle9NodeArray4sizeEv($4) | 0) >>> 0) $9 = __ZNK12_GLOBAL__N_116itanium_demangle4Node15hasRHSComponentERNS_12OutputStreamE(__ZNK12_GLOBAL__N_116itanium_demangle9NodeArrayixEm($4, $3) | 0, $1) | 0; else $9 = 0; + return $9 | 0; +} + +function __ZN6vision35MultiplyPointHomographyInhomogenousIfEEvPT_PKS1_S4_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0.0, $15 = 0.0, $5 = 0.0, $9 = 0; + $5 = +HEAPF32[$2 >> 2]; + $9 = $2 + 4 | 0; + $10 = +HEAPF32[$9 >> 2]; + $15 = +HEAPF32[$1 + 32 >> 2] + (+HEAPF32[$1 + 24 >> 2] * $5 + +HEAPF32[$1 + 28 >> 2] * $10); + HEAPF32[$0 >> 2] = (+HEAPF32[$1 + 8 >> 2] + ($5 * +HEAPF32[$1 >> 2] + $10 * +HEAPF32[$1 + 4 >> 2])) / $15; + HEAPF32[$0 + 4 >> 2] = (+HEAPF32[$1 + 20 >> 2] + (+HEAPF32[$1 + 12 >> 2] * +HEAPF32[$2 >> 2] + +HEAPF32[$1 + 16 >> 2] * +HEAPF32[$9 >> 2])) / $15; + return; +} + +function __ZNSt3__214__split_bufferI12multi_markerRNS_9allocatorIS1_EEED2Ev($this) { + $this = $this | 0; + var $0 = 0, $1 = 0, $2 = 0, $__end_$i$i$i = 0, $incdec$ptr$i$i$i = 0; + $0 = HEAP32[$this + 4 >> 2] | 0; + $__end_$i$i$i = $this + 8 | 0; + $1 = HEAP32[$__end_$i$i$i >> 2] | 0; + while (1) { + if (($1 | 0) == ($0 | 0)) break; + $incdec$ptr$i$i$i = $1 + -8 | 0; + HEAP32[$__end_$i$i$i >> 2] = $incdec$ptr$i$i$i; + $1 = $incdec$ptr$i$i$i; + } + $2 = HEAP32[$this >> 2] | 0; + if ($2 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($2, (HEAP32[$this + 12 >> 2] | 0) - $2 | 0); + return; +} + +function __ZNSt3__214__split_bufferINS_6vectorINS1_INS_4pairIfmEENS_9allocatorIS3_EEEENS4_IS6_EEEERNS4_IS8_EEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0, $4 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + while (1) { + $4 = HEAP32[$3 >> 2] | 0; + if (($4 | 0) == ($2 | 0)) break; + $6 = $4 + -12 | 0; + HEAP32[$3 >> 2] = $6; + __ZNSt3__213__vector_baseINS_6vectorINS_4pairIfmEENS_9allocatorIS3_EEEENS4_IS6_EEED2Ev($6); + } + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $7 | 0); + return; +} + +function __ZN6vision19QuadrilateralConvexIfEEbPKT_S3_S3_S3_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $12 = 0, $16 = 0, $18 = 0, $5 = 0, $8 = 0; + $5 = +__ZN6vision13LinePointSideIfEET_PKS1_S3_S3_($0, $1, $2) > 0.0; + $8 = +__ZN6vision13LinePointSideIfEET_PKS1_S3_S3_($1, $2, $3) > 0.0; + $12 = +__ZN6vision13LinePointSideIfEET_PKS1_S3_S3_($2, $3, $0) > 0.0; + $16 = +__ZN6vision13LinePointSideIfEET_PKS1_S3_S3_($3, $0, $1) > 0.0; + $18 = ($8 ? 1 : -1) + ($5 ? 1 : -1) + ($12 ? 1 : -1) + ($16 ? 1 : -1) | 0; + return ((($18 | 0) > -1 ? $18 : 0 - $18 | 0) | 0) == 4 | 0; +} + +function __ZN6vision18VisualDatabaseImplC2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + HEAP32[$0 + 12 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = 0; + HEAP32[$0 + 20 >> 2] = 1065353216; + $2 = __Znwm(840) | 0; + __ZN6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEEC2Ev($2); + $3 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $2; + if ($3 | 0) { + __ZN6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEED2Ev($3); + __ZdlPv($3); + } + return; +} + +function __ZN6vision16RobustHomographyIfE4findEPfPKfS4_iS4_i($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + var $7 = 0; + $7 = $0 + 12 | 0; + __ZNSt3__26vectorIiNS_9allocatorIiEEE6resizeEm($7, $4); + return __ZN6vision26PreemptiveRobustHomographyIfEEbPT_PKS1_S4_iS4_iRNSt3__26vectorIS1_NS5_9allocatorIS1_EEEERNS6_IiNS7_IiEEEERNS6_INS5_4pairIS1_iEENS7_ISF_EEEES1_iii($1, $2, $3, $4, $5, $6, $0, $7, $0 + 24 | 0, +HEAPF32[$0 + 36 >> 2], HEAP32[$0 + 40 >> 2] | 0, HEAP32[$0 + 44 >> 2] | 0, HEAP32[$0 + 48 >> 2] | 0) | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack15hasFunctionSlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $4 = 0, $9 = 0; + __ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack23initializePackExpansionERNS_12OutputStreamE($0, $1); + $3 = HEAP32[$1 + 12 >> 2] | 0; + $4 = $0 + 8 | 0; + if ($3 >>> 0 < (__ZNK12_GLOBAL__N_116itanium_demangle9NodeArray4sizeEv($4) | 0) >>> 0) $9 = __ZNK12_GLOBAL__N_116itanium_demangle4Node11hasFunctionERNS_12OutputStreamE(__ZNK12_GLOBAL__N_116itanium_demangle9NodeArrayixEm($4, $3) | 0, $1) | 0; else $9 = 0; + return $9 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle24ForwardTemplateReference10printRightERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $3 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $3 = $0 + 16 | 0; + if (!(HEAP8[$3 >> 0] | 0)) { + __ZN12_GLOBAL__N_114SwapAndRestoreIbEC2ERbb($2, $3, 1); + $7 = HEAP32[$0 + 12 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$7 >> 2] | 0) + 20 >> 2] & 255]($7, $1); + __ZN12_GLOBAL__N_114SwapAndRestoreIbED2Ev($2); + } + STACKTOP = sp; + return; +} + +function __ZN6vision25DoGScaleInvariantDetectorD2Ev($0) { + $0 = $0 | 0; + __ZNSt3__213__vector_baseIfNS_9allocatorIfEEED2Ev($0 + 144 | 0); + __ZN6vision21OrientationAssignmentD2Ev($0 + 92 | 0); + __ZNSt3__213__vector_baseIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEED2Ev($0 + 72 | 0); + __ZNSt3__213__vector_baseIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEED2Ev($0 + 60 | 0); + __ZN6vision10DoGPyramidD2Ev($0 + 32 | 0); + __ZNSt3__213__vector_baseINS_6vectorINS1_INS_4pairIfmEENS_9allocatorIS3_EEEENS4_IS6_EEEENS4_IS8_EEED2Ev($0 + 16 | 0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle24ForwardTemplateReference9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $3 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $3 = $0 + 16 | 0; + if (!(HEAP8[$3 >> 0] | 0)) { + __ZN12_GLOBAL__N_114SwapAndRestoreIbEC2ERbb($2, $3, 1); + $7 = HEAP32[$0 + 12 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$7 >> 2] | 0) + 16 >> 2] & 255]($7, $1); + __ZN12_GLOBAL__N_114SwapAndRestoreIbED2Ev($2); + } + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle15ClosureTypeNameC2ENS0_9NodeArrayENS_10StringViewE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $15 = 0, $20 = 0, $21 = 0, $4 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 40, 1, 1, 1); + HEAP32[$0 >> 2] = 19628; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $0 + 8 | 0; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + $15 = $2; + $20 = HEAP32[$15 + 4 >> 2] | 0; + $21 = $0 + 16 | 0; + HEAP32[$21 >> 2] = HEAP32[$15 >> 2]; + HEAP32[$21 + 4 >> 2] = $20; + return; +} + +function _wmemmove($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$01416 = 0, $$018 = 0, $$117 = 0, $$in = 0; + if ($0 - $1 >> 2 >>> 0 >= $2 >>> 0) { + if ($2 | 0) { + $$01416 = $1; + $$018 = $0; + $$117 = $2; + while (1) { + $$117 = $$117 + -1 | 0; + HEAP32[$$018 >> 2] = HEAP32[$$01416 >> 2]; + if (!$$117) break; else { + $$01416 = $$01416 + 4 | 0; + $$018 = $$018 + 4 | 0; + } + } + } + } else { + $$in = $2; + do { + $$in = $$in + -1 | 0; + HEAP32[$0 + ($$in << 2) >> 2] = HEAP32[$1 + ($$in << 2) >> 2]; + } while (($$in | 0) != 0); + } + return $0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_ED2Ev($0) { + $0 = $0 | 0; + __ZN12_GLOBAL__N_116DefaultAllocatorD2Ev($0 + 368 | 0); + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EED2Ev($0 + 332 | 0); + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EED2Ev($0 + 288 | 0); + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EED2Ev($0 + 148 | 0); + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EED2Ev($0 + 8 | 0); + return; +} + +function _ar2FreeImageSet($0) { + $0 = $0 | 0; + var $$0 = 0, $$012 = 0, $2 = 0, $5 = 0, $8 = 0; + if (($0 | 0) != 0 ? ($2 = HEAP32[$0 >> 2] | 0, ($2 | 0) != 0) : 0) { + $$0 = 0; + $5 = $2; + while (1) { + $8 = HEAP32[$5 >> 2] | 0; + if (($$0 | 0) >= (HEAP32[$5 + 4 >> 2] | 0)) break; + _free(HEAP32[HEAP32[$8 + ($$0 << 2) >> 2] >> 2] | 0); + _free(HEAP32[(HEAP32[HEAP32[$0 >> 2] >> 2] | 0) + ($$0 << 2) >> 2] | 0); + $$0 = $$0 + 1 | 0; + $5 = HEAP32[$0 >> 2] | 0; + } + _free($8); + _free(HEAP32[$0 >> 2] | 0); + HEAP32[$0 >> 2] = 0; + $$012 = 0; + } else $$012 = -1; + return $$012 | 0; +} + +function ___fmodeflags($0) { + $0 = $0 | 0; + var $$0 = 0, $$2 = 0, $$4 = 0, $2 = 0, $3 = 0, $6 = 0, $9 = 0, $spec$select = 0, $spec$select13 = 0; + $2 = (_strchr($0, 43) | 0) == 0; + $3 = HEAP8[$0 >> 0] | 0; + $$0 = $2 ? $3 << 24 >> 24 != 114 & 1 : 2; + $6 = (_strchr($0, 120) | 0) == 0; + $spec$select = $6 ? $$0 : $$0 | 128; + $9 = (_strchr($0, 101) | 0) == 0; + $$2 = $9 ? $spec$select : $spec$select | 524288; + $spec$select13 = $3 << 24 >> 24 == 114 ? $$2 : $$2 | 64; + $$4 = $3 << 24 >> 24 == 119 ? $spec$select13 | 512 : $spec$select13; + return ($3 << 24 >> 24 == 97 ? $$4 | 1024 : $$4) | 0; +} + +function __ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $5 = 0, $7 = 0; + if ((__ZNKSt3__26vectorIiNS_9allocatorIiEEE8max_sizeEv($0) | 0) >>> 0 < $1 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); + if ($1 >>> 0 > 1073741823) { + $5 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($5, 41481); + HEAP32[$5 >> 2] = 17472; + ___cxa_throw($5 | 0, 13960, 22); + } else { + $7 = __Znwm($1 << 2) | 0; + HEAP32[$0 + 4 >> 2] = $7; + HEAP32[$0 >> 2] = $7; + HEAP32[$0 + 8 >> 2] = $7 + ($1 << 2); + return; + } +} + +function __ZNSt3__26vectorIfNS_9allocatorIfEEE11__vallocateEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $5 = 0, $7 = 0; + if ((__ZNKSt3__26vectorIfNS_9allocatorIfEEE8max_sizeEv($0) | 0) >>> 0 < $1 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); + if ($1 >>> 0 > 1073741823) { + $5 = ___cxa_allocate_exception(8) | 0; + __ZNSt11logic_errorC2EPKc($5, 41481); + HEAP32[$5 >> 2] = 17472; + ___cxa_throw($5 | 0, 13960, 22); + } else { + $7 = __Znwm($1 << 2) | 0; + HEAP32[$0 + 4 >> 2] = $7; + HEAP32[$0 >> 2] = $7; + HEAP32[$0 + 8 >> 2] = $7 + ($1 << 2); + return; + } +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack12hasArraySlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $4 = 0, $9 = 0; + __ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack23initializePackExpansionERNS_12OutputStreamE($0, $1); + $3 = HEAP32[$1 + 12 >> 2] | 0; + $4 = $0 + 8 | 0; + if ($3 >>> 0 < (__ZNK12_GLOBAL__N_116itanium_demangle9NodeArray4sizeEv($4) | 0) >>> 0) $9 = __ZNK12_GLOBAL__N_116itanium_demangle4Node8hasArrayERNS_12OutputStreamE(__ZNK12_GLOBAL__N_116itanium_demangle9NodeArrayixEm($4, $3) | 0, $1) | 0; else $9 = 0; + return $9 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_16FunctionEncodingEJRPNS0_4NodeESA_NS0_9NodeArrayESA_RNS0_10QualifiersERNS0_15FunctionRefQualEEEES9_DpOT0_($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle16FunctionEncodingEJRPNS2_4NodeES6_NS2_9NodeArrayES6_RNS2_10QualifiersERNS2_15FunctionRefQualEEEEPT_DpOT0_($0 + 368 | 0, $1, $2, $3, $4, $5, $6) | 0; +} + +function _jpeg_idct_2x1($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $11 = 0, $16 = 0, $22 = 0, $7 = 0, $9 = 0; + $7 = (HEAP32[$0 + 336 >> 2] | 0) + -384 | 0; + $9 = HEAP32[$1 + 84 >> 2] | 0; + $11 = (HEAP32[$3 >> 2] | 0) + $4 | 0; + $16 = (Math_imul(HEAP32[$9 >> 2] | 0, HEAP16[$2 >> 1] | 0) | 0) + 4100 | 0; + $22 = Math_imul(HEAP32[$9 + 4 >> 2] | 0, HEAP16[$2 + 2 >> 1] | 0) | 0; + HEAP8[$11 >> 0] = HEAP8[$7 + (($22 + $16 | 0) >>> 3 & 1023) >> 0] | 0; + HEAP8[$11 + 1 >> 0] = HEAP8[$7 + (($16 - $22 | 0) >>> 3 & 1023) >> 0] | 0; + return; +} + +function _jpeg_idct_1x2($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $14 = 0, $20 = 0, $7 = 0, $9 = 0; + $7 = (HEAP32[$0 + 336 >> 2] | 0) + -384 | 0; + $9 = HEAP32[$1 + 84 >> 2] | 0; + $14 = (Math_imul(HEAP32[$9 >> 2] | 0, HEAP16[$2 >> 1] | 0) | 0) + 4100 | 0; + $20 = Math_imul(HEAP32[$9 + 32 >> 2] | 0, HEAP16[$2 + 16 >> 1] | 0) | 0; + HEAP8[(HEAP32[$3 >> 2] | 0) + $4 >> 0] = HEAP8[$7 + (($20 + $14 | 0) >>> 3 & 1023) >> 0] | 0; + HEAP8[(HEAP32[$3 + 4 >> 2] | 0) + $4 >> 0] = HEAP8[$7 + (($14 - $20 | 0) >>> 3 & 1023) >> 0] | 0; + return; +} + +function __ZN10emscripten8internal7InvokerIiJiEE6invokeEPFiiEi($fn, $args) { + $fn = $fn | 0; + $args = $args | 0; + var $call = 0, $call1 = 0, $call2 = 0, $ref$tmp = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $ref$tmp = sp; + $call = __ZN10emscripten8internal11BindingTypeIivE12fromWireTypeEi($args) | 0; + $call1 = FUNCTION_TABLE_ii[$fn & 127]($call) | 0; + HEAP32[$ref$tmp >> 2] = $call1; + $call2 = __ZN10emscripten8internal11BindingTypeIivE10toWireTypeERKi($ref$tmp) | 0; + STACKTOP = sp; + return $call2 | 0; +} + +function __ZZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13parseEncodingEvENKUlvE_clEv($0) { + $0 = $0 | 0; + var $1 = 0, $4 = 0; + $1 = HEAP32[$0 >> 2] | 0; + if (__ZNK12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E7numLeftEv($1) | 0 ? ($4 = __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($1, 0) | 0, $4 << 24 >> 24 != 69) : 0) return $4 << 24 >> 24 == 46 | $4 << 24 >> 24 == 95 | 0; + return 1; +} + +function __ZN6vision12ScaleVector9IfEEvPT_PKS1_S1_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = +$2; + HEAPF32[$0 >> 2] = +HEAPF32[$1 >> 2] * $2; + HEAPF32[$0 + 4 >> 2] = +HEAPF32[$1 + 4 >> 2] * $2; + HEAPF32[$0 + 8 >> 2] = +HEAPF32[$1 + 8 >> 2] * $2; + HEAPF32[$0 + 12 >> 2] = +HEAPF32[$1 + 12 >> 2] * $2; + HEAPF32[$0 + 16 >> 2] = +HEAPF32[$1 + 16 >> 2] * $2; + HEAPF32[$0 + 20 >> 2] = +HEAPF32[$1 + 20 >> 2] * $2; + HEAPF32[$0 + 24 >> 2] = +HEAPF32[$1 + 24 >> 2] * $2; + HEAPF32[$0 + 28 >> 2] = +HEAPF32[$1 + 28 >> 2] * $2; + HEAPF32[$0 + 32 >> 2] = +HEAPF32[$1 + 32 >> 2] * $2; + return; +} + +function __ZN6vision40Homography4PointsInhomogeneousConstraintIfEEvPT_PKS1_S4_S4_S4_S4_S4_S4_S4_($0, $1, $2, $3, $4, $5, $6, $7, $8) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + $8 = $8 | 0; + __ZN6vision27AddHomographyPointContraintIfEEvPT_PKS1_S4_($0, $1, $5); + __ZN6vision27AddHomographyPointContraintIfEEvPT_PKS1_S4_($0 + 72 | 0, $2, $6); + __ZN6vision27AddHomographyPointContraintIfEEvPT_PKS1_S4_($0 + 144 | 0, $3, $7); + __ZN6vision27AddHomographyPointContraintIfEEvPT_PKS1_S4_($0 + 216 | 0, $4, $8); + return; +} + +function ___shlim($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $12 = 0, $14 = 0, $16 = 0, $4 = 0, $9 = 0; + $4 = $0 + 112 | 0; + HEAP32[$4 >> 2] = $1; + HEAP32[$4 + 4 >> 2] = $2; + $9 = HEAP32[$0 + 8 >> 2] | 0; + $11 = HEAP32[$0 + 4 >> 2] | 0; + $12 = $9 - $11 | 0; + $14 = (($12 | 0) < 0) << 31 >> 31; + $16 = $0 + 120 | 0; + HEAP32[$16 >> 2] = $12; + HEAP32[$16 + 4 >> 2] = $14; + if ((($1 | 0) != 0 | ($2 | 0) != 0) & (($14 | 0) > ($2 | 0) | ($14 | 0) == ($2 | 0) & $12 >>> 0 > $1 >>> 0)) HEAP32[$0 + 104 >> 2] = $11 + $1; else HEAP32[$0 + 104 >> 2] = $9; + return; +} + +function __ZN6vision20VisualDatabaseFacade5queryEPhmm($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $4 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 32 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(32); + $4 = sp; + __ZN6vision5ImageC2EPhNS_9ImageTypeEmmim($4, $1, 1, $2, $3, $2, 1); + $7 = __ZN6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEE5queryERKNS_5ImageE(HEAP32[HEAP32[$0 >> 2] >> 2] | 0, $4) | 0; + __ZN6vision5ImageD2Ev($4); + STACKTOP = sp; + return $7 | 0; +} + +function __ZNSt3__213__vector_baseIN6vision17PriorityQueueItemILi96EEENS_9allocatorIS3_EEED2Ev($0) { + $0 = $0 | 0; + var $$0$i$i = 0, $1 = 0, $3 = 0, $6 = 0, $7 = 0; + $1 = HEAP32[$0 >> 2] | 0; + if ($1 | 0) { + $3 = $0 + 4 | 0; + $$0$i$i = HEAP32[$3 >> 2] | 0; + while (1) { + if (($$0$i$i | 0) == ($1 | 0)) break; + $6 = $$0$i$i + -8 | 0; + __ZN6vision17PriorityQueueItemILi96EED2Ev($6); + $$0$i$i = $6; + } + HEAP32[$3 >> 2] = $1; + $7 = HEAP32[$0 >> 2] | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 8 >> 2] | 0) - $7 | 0); + } + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE9push_backERKS3_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $11 = 0, $2 = 0, $3 = 0, $9 = 0; + $2 = $0 + 4 | 0; + $3 = HEAP32[$2 >> 2] | 0; + if (($3 | 0) == (HEAP32[$0 + 8 >> 2] | 0)) { + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE7reserveEm($0, (__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($0) | 0) << 1); + $11 = HEAP32[$2 >> 2] | 0; + } else $11 = $3; + $9 = HEAP32[$1 >> 2] | 0; + HEAP32[$2 >> 2] = $11 + 4; + HEAP32[$11 >> 2] = $9; + return; +} + +function __ZN10emscripten8internal7InvokerIdJiEE6invokeEPFdiEi($fn, $args) { + $fn = $fn | 0; + $args = $args | 0; + var $call = 0, $call1 = 0.0, $call2 = 0.0, $ref$tmp = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $ref$tmp = sp; + $call = __ZN10emscripten8internal11BindingTypeIivE12fromWireTypeEi($args) | 0; + $call1 = +FUNCTION_TABLE_di[$fn & 3]($call); + HEAPF64[$ref$tmp >> 3] = $call1; + $call2 = +__ZN10emscripten8internal11BindingTypeIdvE10toWireTypeERKd($ref$tmp); + STACKTOP = sp; + return +$call2; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14IntegerLiteralC2ENS_10StringViewES2_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $15 = 0, $20 = 0, $21 = 0, $4 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 61, 1, 1, 1); + HEAP32[$0 >> 2] = 18176; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $0 + 8 | 0; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + $15 = $2; + $20 = HEAP32[$15 + 4 >> 2] | 0; + $21 = $0 + 16 | 0; + HEAP32[$21 >> 2] = HEAP32[$15 >> 2]; + HEAP32[$21 + 4 >> 2] = $20; + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIiNS_9allocatorIiEEEEEENS_22__unordered_map_hasherIiS6_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS6_NS_8equal_toIiEELb1EEENS3_IS6_EEE17__deallocate_nodeEPNS_16__hash_node_baseIPNS_11__hash_nodeIS6_PvEEEE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $3 = 0; + $$0 = $1; + while (1) { + if (!$$0) break; + $3 = HEAP32[$$0 >> 2] | 0; + __ZNSt3__24pairIKiNS_6vectorIiNS_9allocatorIiEEEEED2Ev($$0 + 8 | 0); + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($$0, 24); + $$0 = $3; + } + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE9push_backERKS3_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $11 = 0, $2 = 0, $3 = 0, $9 = 0; + $2 = $0 + 4 | 0; + $3 = HEAP32[$2 >> 2] | 0; + if (($3 | 0) == (HEAP32[$0 + 8 >> 2] | 0)) { + __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE7reserveEm($0, (__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE4sizeEv($0) | 0) << 1); + $11 = HEAP32[$2 >> 2] | 0; + } else $11 = $3; + $9 = HEAP32[$1 >> 2] | 0; + HEAP32[$2 >> 2] = $11 + 4; + HEAP32[$11 >> 2] = $9; + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIiP14AR2SurfaceSetTEENS_22__unordered_map_hasherIiS4_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS4_NS_8equal_toIiEELb1EEENS_9allocatorIS4_EEE17__deallocate_nodeEPNS_16__hash_node_baseIPNS_11__hash_nodeIS4_PvEEEE($this, $__np) { + $this = $this | 0; + $__np = $__np | 0; + var $0 = 0, $__np$addr$0 = 0; + $__np$addr$0 = $__np; + while (1) { + if (!$__np$addr$0) break; + $0 = HEAP32[$__np$addr$0 >> 2] | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($__np$addr$0, 16); + $__np$addr$0 = $0; + } + return; +} + +function __ZNSt3__26vectorIiNS_9allocatorIiEEE12__move_rangeEPiS4_S4_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $16 = 0, $18 = 0, $4 = 0, $5 = 0, $8 = 0, $9 = 0; + $4 = $0 + 4 | 0; + $5 = HEAP32[$4 >> 2] | 0; + $8 = $5 - $3 | 0; + $9 = $8 >> 2; + $$0 = $1 + ($9 << 2) | 0; + $16 = $5; + while (1) { + if ($$0 >>> 0 >= $2 >>> 0) break; + HEAP32[$16 >> 2] = HEAP32[$$0 >> 2]; + $18 = $16 + 4 | 0; + HEAP32[$4 >> 2] = $18; + $$0 = $$0 + 4 | 0; + $16 = $18; + } + if ($8 | 0) _memmove($5 + (0 - $9 << 2) | 0, $1 | 0, $8 | 0) | 0; + return; +} + +function __ZNK10__cxxabiv120__si_class_type_info16search_above_dstEPNS_19__dynamic_cast_infoEPKvS4_ib($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $10 = 0; + if (__ZL8is_equalPKSt9type_infoS1_b($0, HEAP32[$1 + 8 >> 2] | 0, $5) | 0) __ZNK10__cxxabiv117__class_type_info29process_static_type_above_dstEPNS_19__dynamic_cast_infoEPKvS4_i(0, $1, $2, $3, $4); else { + $10 = HEAP32[$0 + 8 >> 2] | 0; + FUNCTION_TABLE_viiiiii[HEAP32[(HEAP32[$10 >> 2] | 0) + 20 >> 2] & 7]($10, $1, $2, $3, $4, $5); + } + return; +} + +function _deleteHandle($arc) { + $arc = $arc | 0; + var $0 = 0, $ar3DHandle = 0, $arhandle = 0, $paramLT = 0; + $arhandle = $arc + 216 | 0; + $0 = HEAP32[$arhandle >> 2] | 0; + if ($0 | 0) { + _arPattDetach($0) | 0; + _arDeleteHandle(HEAP32[$arhandle >> 2] | 0) | 0; + HEAP32[$arhandle >> 2] = 0; + } + $ar3DHandle = $arc + 228 | 0; + if (HEAP32[$ar3DHandle >> 2] | 0) { + _ar3DDeleteHandle($ar3DHandle) | 0; + HEAP32[$ar3DHandle >> 2] = 0; + } + $paramLT = $arc + 192 | 0; + if (HEAP32[$paramLT >> 2] | 0) { + _arParamLTFree($paramLT) | 0; + HEAP32[$paramLT >> 2] = 0; + } + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack10printRightERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $4 = 0, $7 = 0; + __ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack23initializePackExpansionERNS_12OutputStreamE($0, $1); + $3 = HEAP32[$1 + 12 >> 2] | 0; + $4 = $0 + 8 | 0; + if ($3 >>> 0 < (__ZNK12_GLOBAL__N_116itanium_demangle9NodeArray4sizeEv($4) | 0) >>> 0) { + $7 = __ZNK12_GLOBAL__N_116itanium_demangle9NodeArrayixEm($4, $3) | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$7 >> 2] | 0) + 20 >> 2] & 255]($7, $1); + } + return; +} + +function _fwrite($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $13 = 0, $15 = 0, $4 = 0, $phitmp = 0, $spec$select = 0; + $4 = Math_imul($2, $1) | 0; + $spec$select = ($1 | 0) == 0 ? 0 : $2; + if ((HEAP32[$3 + 76 >> 2] | 0) > -1) { + $phitmp = (___lockfile($3) | 0) == 0; + $11 = ___fwritex($0, $4, $3) | 0; + if ($phitmp) $13 = $11; else { + ___unlockfile($3); + $13 = $11; + } + } else $13 = ___fwritex($0, $4, $3) | 0; + if (($13 | 0) == ($4 | 0)) $15 = $spec$select; else $15 = ($13 >>> 0) / ($1 >>> 0) | 0; + return $15 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $4 = 0, $7 = 0; + __ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack23initializePackExpansionERNS_12OutputStreamE($0, $1); + $3 = HEAP32[$1 + 12 >> 2] | 0; + $4 = $0 + 8 | 0; + if ($3 >>> 0 < (__ZNK12_GLOBAL__N_116itanium_demangle9NodeArray4sizeEv($4) | 0) >>> 0) { + $7 = __ZNK12_GLOBAL__N_116itanium_demangle9NodeArrayixEm($4, $3) | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$7 >> 2] | 0) + 16 >> 2] & 255]($7, $1); + } + return; +} + +function __ZNSt3__214__split_bufferINS_6vectorINS_4pairIfmEENS_9allocatorIS3_EEEERNS4_IS6_EEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0, $4 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + while (1) { + $4 = HEAP32[$3 >> 2] | 0; + if (($4 | 0) == ($2 | 0)) break; + $6 = $4 + -12 | 0; + HEAP32[$3 >> 2] = $6; + __ZNSt3__213__vector_baseINS_4pairIfmEENS_9allocatorIS2_EEED2Ev($6); + } + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $7 | 0); + return; +} + +function _store_int($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $7 = 0; + L1 : do if ($0 | 0) switch ($1 | 0) { + case -2: + { + HEAP8[$0 >> 0] = $2; + break L1; + break; + } + case -1: + { + HEAP16[$0 >> 1] = $2; + break L1; + break; + } + case 0: + { + HEAP32[$0 >> 2] = $2; + break L1; + break; + } + case 1: + { + HEAP32[$0 >> 2] = $2; + break L1; + break; + } + case 3: + { + $7 = $0; + HEAP32[$7 >> 2] = $2; + HEAP32[$7 + 4 >> 2] = $3; + break L1; + break; + } + default: + break L1; + } while (0); + return; +} + +function __ZNSt3__213__vector_baseIN6vision12FeaturePointENS_9allocatorIS2_EEED2Ev($0) { + $0 = $0 | 0; + var $$0$i$i = 0, $1 = 0, $3 = 0, $6 = 0, $7 = 0; + $1 = HEAP32[$0 >> 2] | 0; + if ($1 | 0) { + $3 = $0 + 4 | 0; + $$0$i$i = HEAP32[$3 >> 2] | 0; + while (1) { + if (($$0$i$i | 0) == ($1 | 0)) break; + $6 = $$0$i$i + -20 | 0; + __ZN6vision12FeaturePointD2Ev($6); + $$0$i$i = $6; + } + HEAP32[$3 >> 2] = $1; + $7 = HEAP32[$0 >> 2] | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 8 >> 2] | 0) - $7 | 0); + } + return; +} + +function __ZN6vision4NodeILi96EED2Ev($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0, $11 = 0, $2 = 0, $4 = 0; + $1 = $0 + 104 | 0; + $2 = $0 + 108 | 0; + $$0 = 0; + while (1) { + $4 = HEAP32[$1 >> 2] | 0; + if ($$0 >>> 0 >= (HEAP32[$2 >> 2] | 0) - $4 >> 2 >>> 0) break; + $11 = HEAP32[$4 + ($$0 << 2) >> 2] | 0; + if ($11 | 0) { + __ZN6vision4NodeILi96EED2Ev($11); + __ZdlPv($11); + } + $$0 = $$0 + 1 | 0; + } + __ZNSt3__213__vector_baseIiNS_9allocatorIiEEED2Ev($0 + 116 | 0); + __ZNSt3__213__vector_baseIPN6vision4NodeILi96EEENS_9allocatorIS4_EEED2Ev($1); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_12FunctionTypeEJRPNS0_4NodeERNS0_9NodeArrayERNS0_10QualifiersERNS0_15FunctionRefQualESA_EEES9_DpOT0_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle12FunctionTypeEJRPNS2_4NodeERNS2_9NodeArrayERNS2_10QualifiersERNS2_15FunctionRefQualES6_EEEPT_DpOT0_($0 + 368 | 0, $1, $2, $3, $4, $5) | 0; +} + +function __ZNK10__cxxabiv122__base_class_type_info27has_unambiguous_public_baseEPNS_19__dynamic_cast_infoEPvi($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$pre = 0, $11 = 0, $5 = 0; + $$pre = HEAP32[$0 + 4 >> 2] | 0; + if ($2) { + $5 = $$pre >> 8; + if (!($$pre & 1)) $$0 = $5; else $$0 = HEAP32[(HEAP32[$2 >> 2] | 0) + $5 >> 2] | 0; + } else $$0 = 0; + $11 = HEAP32[$0 >> 2] | 0; + FUNCTION_TABLE_viiii[HEAP32[(HEAP32[$11 >> 2] | 0) + 28 >> 2] & 31]($11, $1, $2 + $$0 | 0, ($$pre & 2 | 0) == 0 ? 2 : $3); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle8FoldExprC2EbNS_10StringViewEPKNS0_4NodeES5_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $14 = 0, $15 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 57, 1, 1, 1); + HEAP32[$0 >> 2] = 19364; + HEAP32[$0 + 8 >> 2] = $3; + HEAP32[$0 + 12 >> 2] = $4; + $9 = $2; + $14 = HEAP32[$9 + 4 >> 2] | 0; + $15 = $0 + 16 | 0; + HEAP32[$15 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$15 + 4 >> 2] = $14; + HEAP8[$0 + 24 >> 0] = $1 & 1; + return; +} + +function __ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE18__construct_at_endINS_11__wrap_iterIPKiEEEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESB_SB_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $3 = 0, $4 = 0, $6 = 0, $7 = 0; + $3 = HEAP32[$2 >> 2] | 0; + $4 = $0 + 8 | 0; + $6 = HEAP32[$1 >> 2] | 0; + while (1) { + if (($6 | 0) == ($3 | 0)) break; + $7 = HEAP32[$4 >> 2] | 0; + HEAP32[$7 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$4 >> 2] = $7 + 4; + $10 = $6 + 4 | 0; + HEAP32[$1 >> 2] = $10; + $6 = $10; + } + return; +} + +function _fmt_x($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$05$lcssa = 0, $$056 = 0, $14 = 0, $15 = 0, $8 = 0; + if (($0 | 0) == 0 & ($1 | 0) == 0) $$05$lcssa = $2; else { + $$056 = $2; + $15 = $1; + $8 = $0; + while (1) { + $14 = $$056 + -1 | 0; + HEAP8[$14 >> 0] = HEAPU8[6672 + ($8 & 15) >> 0] | 0 | $3; + $8 = _bitshift64Lshr($8 | 0, $15 | 0, 4) | 0; + $15 = getTempRet0() | 0; + if (($8 | 0) == 0 & ($15 | 0) == 0) { + $$05$lcssa = $14; + break; + } else $$056 = $14; + } + } + return $$05$lcssa | 0; +} + +function __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE4swapERS6_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = 0, $9 = 0; + $2 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$1 >> 2] = $2; + $4 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $6 = HEAP32[$4 >> 2] | 0; + HEAP32[$4 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$5 >> 2] = $6; + $8 = $0 + 8 | 0; + $9 = $1 + 8 | 0; + $10 = HEAP32[$8 >> 2] | 0; + HEAP32[$8 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$9 >> 2] = $10; + return; +} + +function _arImageProcLumaHist($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$013 = 0, $12 = 0, $8 = 0; + L1 : do if (($0 | 0) != 0 & ($1 | 0) != 0) { + _memset($0 + 12 | 0, 0, 1024) | 0; + $8 = $1 + (Math_imul(HEAP32[$0 + 8 >> 2] | 0, HEAP32[$0 + 4 >> 2] | 0) | 0) | 0; + $$0 = $1; + while (1) { + if ($$0 >>> 0 >= $8 >>> 0) { + $$013 = 0; + break L1; + } + $12 = $0 + 12 + ((HEAPU8[$$0 >> 0] | 0) << 2) | 0; + HEAP32[$12 >> 2] = (HEAP32[$12 >> 2] | 0) + 1; + $$0 = $$0 + 1 | 0; + } + } else $$013 = -1; while (0); + return $$013 | 0; +} + +function __ZNK10__cxxabiv122__base_class_type_info16search_above_dstEPNS_19__dynamic_cast_infoEPKvS4_ib($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$0 = 0, $14 = 0, $7 = 0, $8 = 0; + $7 = HEAP32[$0 + 4 >> 2] | 0; + $8 = $7 >> 8; + if (!($7 & 1)) $$0 = $8; else $$0 = HEAP32[(HEAP32[$3 >> 2] | 0) + $8 >> 2] | 0; + $14 = HEAP32[$0 >> 2] | 0; + FUNCTION_TABLE_viiiiii[HEAP32[(HEAP32[$14 >> 2] | 0) + 20 >> 2] & 7]($14, $1, $2, $3 + $$0 | 0, ($7 & 2 | 0) == 0 ? 2 : $4, $5); + return; +} + +function __ZN6vision15get_pretty_timeEv($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 272 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(272); + $1 = sp + 256 | 0; + $2 = sp; + _time($1 | 0) | 0; + _strftime($2 | 0, 256, 38335, _localtime($1 | 0) | 0) | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm($0, $2, __ZNSt3__211char_traitsIcE6lengthEPKc($2) | 0); + STACKTOP = sp; + return; +} + +function ___muldi3($a$0, $a$1, $b$0, $b$1) { + $a$0 = $a$0 | 0; + $a$1 = $a$1 | 0; + $b$0 = $b$0 | 0; + $b$1 = $b$1 | 0; + var $x_sroa_0_0_extract_trunc = 0, $y_sroa_0_0_extract_trunc = 0, $1$0 = 0, $1$1 = 0; + $x_sroa_0_0_extract_trunc = $a$0; + $y_sroa_0_0_extract_trunc = $b$0; + $1$0 = ___muldsi3($x_sroa_0_0_extract_trunc, $y_sroa_0_0_extract_trunc) | 0; + $1$1 = getTempRet0() | 0; + return (setTempRet0((Math_imul($a$1, $y_sroa_0_0_extract_trunc) | 0) + (Math_imul($b$1, $x_sroa_0_0_extract_trunc) | 0) + $1$1 | $1$1 & 0 | 0), $1$0 | 0 | 0) | 0; +} +function __ZNSt3__213__vector_baseIN6vision5ImageENS_9allocatorIS2_EEED2Ev($0) { + $0 = $0 | 0; + var $$0$i$i = 0, $1 = 0, $3 = 0, $6 = 0, $7 = 0; + $1 = HEAP32[$0 >> 2] | 0; + if ($1 | 0) { + $3 = $0 + 4 | 0; + $$0$i$i = HEAP32[$3 >> 2] | 0; + while (1) { + if (($$0$i$i | 0) == ($1 | 0)) break; + $6 = $$0$i$i + -32 | 0; + __ZN6vision5ImageD2Ev($6); + $$0$i$i = $6; + } + HEAP32[$3 >> 2] = $1; + $7 = HEAP32[$0 >> 2] | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 8 >> 2] | 0) - $7 | 0); + } + return; +} + +function __ZN6vision9MaxIndex7IfEEiPKT_($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$2 = 0, $$3 = 0, $$4 = 0; + $$0 = +HEAPF32[$0 + 4 >> 2] > +HEAPF32[$0 >> 2] & 1; + $$1 = +HEAPF32[$0 + 8 >> 2] > +HEAPF32[$0 + ($$0 << 2) >> 2] ? 2 : $$0; + $$2 = +HEAPF32[$0 + 12 >> 2] > +HEAPF32[$0 + ($$1 << 2) >> 2] ? 3 : $$1; + $$3 = +HEAPF32[$0 + 16 >> 2] > +HEAPF32[$0 + ($$2 << 2) >> 2] ? 4 : $$2; + $$4 = +HEAPF32[$0 + 20 >> 2] > +HEAPF32[$0 + ($$3 << 2) >> 2] ? 5 : $$3; + return (+HEAPF32[$0 + 24 >> 2] > +HEAPF32[$0 + ($$4 << 2) >> 2] ? 6 : $$4) | 0; +} + +function ___string_read($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$027 = 0, $14 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $spec$select = 0; + $3 = $0 + 84 | 0; + $4 = HEAP32[$3 >> 2] | 0; + $5 = $2 + 256 | 0; + $6 = _memchr($4, 0, $5) | 0; + $$027 = ($6 | 0) == 0 ? $5 : $6 - $4 | 0; + $spec$select = $$027 >>> 0 < $2 >>> 0 ? $$027 : $2; + _memcpy($1 | 0, $4 | 0, $spec$select | 0) | 0; + HEAP32[$0 + 4 >> 2] = $4 + $spec$select; + $14 = $4 + $$027 | 0; + HEAP32[$0 + 8 >> 2] = $14; + HEAP32[$3 >> 2] = $14; + return $spec$select | 0; +} + +function __ZNSt3__214__split_bufferIN6vision17PriorityQueueItemILi96EEERNS_9allocatorIS3_EEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0, $4 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + while (1) { + $4 = HEAP32[$3 >> 2] | 0; + if (($4 | 0) == ($2 | 0)) break; + $6 = $4 + -8 | 0; + HEAP32[$3 >> 2] = $6; + __ZN6vision17PriorityQueueItemILi96EED2Ev($6); + } + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $7 | 0); + return; +} + +function __ZNKSt3__29__num_getIwE12__do_widen_pIwEEPKT_RNS_8ios_baseEPS3_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0, $4 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + __ZNKSt3__28ios_base6getlocEv($3, $1); + $4 = __ZNKSt3__26locale9use_facetERNS0_2idE($3, 66544) | 0; + FUNCTION_TABLE_iiiii[HEAP32[(HEAP32[$4 >> 2] | 0) + 48 >> 2] & 15]($4, 12928, 12954, $2) | 0; + __ZNSt3__26localeD2Ev($3); + STACKTOP = sp; + return $2 | 0; +} + +function _sbrk($0) { + $0 = $0 | 0; + var $$2 = 0, $1 = 0, $10 = 0, $2 = 0, $3 = 0, $5 = 0; + $1 = _emscripten_get_sbrk_ptr() | 0; + $2 = HEAP32[$1 >> 2] | 0; + $3 = $2 + $0 | 0; + if (($3 | 0) < 0) { + $5 = ___errno_location() | 0; + HEAP32[$5 >> 2] = 48; + $$2 = -1; + return $$2 | 0; + } + if ($3 >>> 0 > (_emscripten_get_heap_size() | 0) >>> 0 ? (_emscripten_resize_heap($3 | 0) | 0) == 0 : 0) { + $10 = ___errno_location() | 0; + HEAP32[$10 >> 2] = 48; + $$2 = -1; + return $$2 | 0; + } + HEAP32[$1 >> 2] = $3; + $$2 = $2; + return $$2 | 0; +} + +function __ZNKSt3__25ctypeIwE11do_scan_notEtPKwS3_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$0$lcssa = 0, $7 = 0; + $$0 = $2; + while (1) { + if (($$0 | 0) == ($3 | 0)) { + $$0$lcssa = $3; + break; + } + if ((HEAP32[$$0 >> 2] | 0) >>> 0 >= 128) { + $$0$lcssa = $$0; + break; + } + $7 = __ZNSt3__25ctypeIcE13classic_tableEv() | 0; + if (!((HEAP16[$7 + (HEAP32[$$0 >> 2] << 1) >> 1] & $1) << 16 >> 16)) { + $$0$lcssa = $$0; + break; + } + $$0 = $$0 + 4 | 0; + } + return $$0$lcssa | 0; +} + +function _ar2GetTransMatHomography_176($initConv, $pos2d, $pos3d, $num, $conv, $robustMode, $inlierProb) { + $initConv = $initConv | 0; + $pos2d = $pos2d | 0; + $pos3d = $pos3d | 0; + $num = $num | 0; + $conv = $conv | 0; + $robustMode = $robustMode | 0; + $inlierProb = +$inlierProb; + var $retval$0 = 0.0; + if (!$robustMode) $retval$0 = +_ar2GetTransMatHomography2_177($initConv, $pos2d, $pos3d, $num, $conv); else $retval$0 = +_ar2GetTransMatHomographyRobust_178($initConv, $pos2d, $pos3d, $num, $conv, $inlierProb); + return +$retval$0; +} + +function __ZNSt3__214__split_bufferIN6vision25DoGScaleInvariantDetector12FeaturePointERNS_9allocatorIS3_EEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $3 = 0, dest = 0, stop = 0; + $2 = $0 + 8 | 0; + $$0 = $1; + $3 = HEAP32[$2 >> 2] | 0; + do { + dest = $3; + stop = dest + 36 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + $3 = (HEAP32[$2 >> 2] | 0) + 36 | 0; + HEAP32[$2 >> 2] = $3; + $$0 = $$0 + -1 | 0; + } while (($$0 | 0) != 0); + return; +} + +function __ZN6vision11DotProduct9IfEET_PKS1_S3_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return +(+HEAPF32[$0 >> 2] * +HEAPF32[$1 >> 2] + +HEAPF32[$0 + 4 >> 2] * +HEAPF32[$1 + 4 >> 2] + +HEAPF32[$0 + 8 >> 2] * +HEAPF32[$1 + 8 >> 2] + +HEAPF32[$0 + 12 >> 2] * +HEAPF32[$1 + 12 >> 2] + +HEAPF32[$0 + 16 >> 2] * +HEAPF32[$1 + 16 >> 2] + +HEAPF32[$0 + 20 >> 2] * +HEAPF32[$1 + 20 >> 2] + +HEAPF32[$0 + 24 >> 2] * +HEAPF32[$1 + 24 >> 2] + +HEAPF32[$0 + 28 >> 2] * +HEAPF32[$1 + 28 >> 2] + +HEAPF32[$0 + 32 >> 2] * +HEAPF32[$1 + 32 >> 2]); +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E13makeNodeArrayIPPNS0_4NodeEEENS0_9NodeArrayET_SB_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $6 = 0, $7 = 0, $9 = 0; + $6 = $3 - $2 | 0; + $7 = $6 >> 2; + $9 = __ZN12_GLOBAL__N_116DefaultAllocator17allocateNodeArrayEm($1 + 368 | 0, $7) | 0; + if ($6 | 0) _memmove($9 | 0, $2 | 0, $6 | 0) | 0; + __ZN12_GLOBAL__N_116itanium_demangle9NodeArrayC2EPPNS0_4NodeEm($0, $9, $7); + return; +} + +function __ZNK10__cxxabiv122__base_class_type_info16search_below_dstEPNS_19__dynamic_cast_infoEPKvib($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $13 = 0, $6 = 0, $7 = 0; + $6 = HEAP32[$0 + 4 >> 2] | 0; + $7 = $6 >> 8; + if (!($6 & 1)) $$0 = $7; else $$0 = HEAP32[(HEAP32[$2 >> 2] | 0) + $7 >> 2] | 0; + $13 = HEAP32[$0 >> 2] | 0; + FUNCTION_TABLE_viiiii[HEAP32[(HEAP32[$13 >> 2] | 0) + 24 >> 2] & 63]($13, $1, $2 + $$0 | 0, ($6 & 2 | 0) == 0 ? 2 : $3, $4); + return; +} + +function _emit_message($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $13 = 0, $2 = 0, $4 = 0, $5 = 0, label = 0; + $2 = HEAP32[$0 >> 2] | 0; + if (($1 | 0) >= 0) { + if ((HEAP32[$2 + 104 >> 2] | 0) < ($1 | 0)) return; + FUNCTION_TABLE_vi[HEAP32[$2 + 8 >> 2] & 255]($0); + return; + } + $4 = $2 + 108 | 0; + $5 = HEAP32[$4 >> 2] | 0; + if (($5 | 0) != 0 ? (HEAP32[$2 + 104 >> 2] | 0) <= 2 : 0) $13 = $5; else { + FUNCTION_TABLE_vi[HEAP32[$2 + 8 >> 2] & 255]($0); + $13 = HEAP32[$4 >> 2] | 0; + } + HEAP32[$4 >> 2] = $13 + 1; + return; +} + +function __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $3 = 0, dest = 0, stop = 0; + $2 = $0 + 4 | 0; + $$0 = $1; + $3 = HEAP32[$2 >> 2] | 0; + do { + dest = $3; + stop = dest + 36 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + $3 = (HEAP32[$2 >> 2] | 0) + 36 | 0; + HEAP32[$2 >> 2] = $3; + $$0 = $$0 + -1 | 0; + } while (($$0 | 0) != 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle10AbiTagAttrC2EPNS0_4NodeENS_10StringViewE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $11 = 0, $16 = 0, $17 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 8, HEAP8[$1 + 5 >> 0] | 0, HEAP8[$1 + 6 >> 0] | 0, HEAP8[$1 + 7 >> 0] | 0); + HEAP32[$0 >> 2] = 17560; + HEAP32[$0 + 8 >> 2] = $1; + $11 = $2; + $16 = HEAP32[$11 + 4 >> 2] | 0; + $17 = $0 + 12 | 0; + HEAP32[$17 >> 2] = HEAP32[$11 >> 2]; + HEAP32[$17 + 4 >> 2] = $16; + return; +} + +function __ZL14genBWImageFullPhiiPiS0_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + HEAP32[$3 >> 2] = $1; + HEAP32[$4 >> 2] = $2; + $5 = Math_imul($2, $1) | 0; + $6 = _malloc($5) | 0; + if (!$6) { + _arLog(0, 3, 45930, sp); + _exit(1); + } else { + _memcpy($6 | 0, $0 | 0, $5 | 0) | 0; + STACKTOP = sp; + return $6 | 0; + } + return 0; +} + +function __ZNSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE4swapERS5_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = 0, $9 = 0; + $2 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$1 >> 2] = $2; + $4 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $6 = HEAP32[$4 >> 2] | 0; + HEAP32[$4 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$5 >> 2] = $6; + $8 = $0 + 8 | 0; + $9 = $1 + 8 | 0; + $10 = HEAP32[$8 >> 2] | 0; + HEAP32[$8 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$9 >> 2] = $10; + return; +} + +function __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE6resizeEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $4 = 0, $6 = 0, $8 = 0; + $2 = $0 + 4 | 0; + $4 = HEAP32[$0 >> 2] | 0; + $6 = ((HEAP32[$2 >> 2] | 0) - $4 | 0) / 36 | 0; + $8 = $4; + if ($6 >>> 0 >= $1 >>> 0) { + if ($6 >>> 0 > $1 >>> 0) HEAP32[$2 >> 2] = $8 + ($1 * 36 | 0); + } else __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE8__appendEm($0, $1 - $6 | 0); + return; +} + +function __ZNK10__cxxabiv120__si_class_type_info27has_unambiguous_public_baseEPNS_19__dynamic_cast_infoEPvi($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $8 = 0; + if (__ZL8is_equalPKSt9type_infoS1_b($0, HEAP32[$1 + 8 >> 2] | 0, 0) | 0) __ZNK10__cxxabiv117__class_type_info24process_found_base_classEPNS_19__dynamic_cast_infoEPvi(0, $1, $2, $3); else { + $8 = HEAP32[$0 + 8 >> 2] | 0; + FUNCTION_TABLE_viiii[HEAP32[(HEAP32[$8 >> 2] | 0) + 28 >> 2] & 31]($8, $1, $2, $3); + } + return; +} + +function _arUtilGetDirectoryNameFromPath($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $14 = 0, $7 = 0; + do if (($0 | 0) != 0 & ($1 | 0) != 0 & ($2 | 0) != 0) { + $7 = _strrchr($1, 47) | 0; + if (!$7) { + HEAP8[$0 >> 0] = 0; + $$0 = $0; + break; + } + $14 = $7 + (($3 | 0) != 0 & 1) - $1 | 0; + if (($14 + 1 | 0) >>> 0 <= $2 >>> 0) { + _strncpy($0, $1, $14) | 0; + HEAP8[$0 + $14 >> 0] = 0; + $$0 = $0; + } else $$0 = 0; + } else $$0 = 0; while (0); + return $$0 | 0; +} + +function __ZNSt3__26vectorIiNS_9allocatorIiEEE18__construct_at_endINS_11__wrap_iterIPKiEEEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_m($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $5 = 0, $6 = 0, $8 = 0, $9 = 0; + $5 = HEAP32[$2 >> 2] | 0; + $6 = $0 + 4 | 0; + $8 = HEAP32[$1 >> 2] | 0; + while (1) { + if (($8 | 0) == ($5 | 0)) break; + $9 = HEAP32[$6 >> 2] | 0; + HEAP32[$9 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$6 >> 2] = $9 + 4; + $8 = $8 + 4 | 0; + } + return; +} + +function __ZNSt3__214__split_bufferIN6vision25DoGScaleInvariantDetector12FeaturePointERNS_9allocatorIS3_EEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0, $5 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + $5 = HEAP32[$3 >> 2] | 0; + while (1) { + if (($5 | 0) == ($2 | 0)) break; + $6 = $5 + -36 | 0; + HEAP32[$3 >> 2] = $6; + $5 = $6; + } + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $7 | 0); + return; +} + +function __ZNSt3__214__split_bufferIN6vision12FeaturePointERNS_9allocatorIS2_EEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0, $4 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + while (1) { + $4 = HEAP32[$3 >> 2] | 0; + if (($4 | 0) == ($2 | 0)) break; + $6 = $4 + -20 | 0; + HEAP32[$3 >> 2] = $6; + __ZN6vision12FeaturePointD2Ev($6); + } + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $7 | 0); + return; +} + +function __ZNKSt3__27codecvtIwc11__mbstate_tE11do_encodingEv($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0, $10 = 0, $3 = 0, $4 = 0, $7 = 0, $9 = 0; + $1 = $0 + 8 | 0; + $3 = ___uselocale(HEAP32[$1 >> 2] | 0) | 0; + $4 = _mbtowc(0, 0, 4) | 0; + if ($3 | 0) ___uselocale($3) | 0; + if (!$4) { + $7 = HEAP32[$1 >> 2] | 0; + if (!$7) $$0 = 1; else { + $9 = ___uselocale($7) | 0; + $10 = ___ctype_get_mb_cur_max() | 0; + if ($9 | 0) ___uselocale($9) | 0; + return ($10 | 0) == 1 | 0; + } + } else $$0 = -1; + return $$0 | 0; +} + +function _vasprintf($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $3 = 0, $4 = 0, $6 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + HEAP32[$3 >> 2] = HEAP32[$2 >> 2]; + $4 = _vsnprintf(0, 0, $1, $3) | 0; + if (($4 | 0) >= 0 ? ($6 = $4 + 1 | 0, $7 = _malloc($6) | 0, HEAP32[$0 >> 2] = $7, ($7 | 0) != 0) : 0) $$0 = _vsnprintf($7, $6, $1, $2) | 0; else $$0 = -1; + STACKTOP = sp; + return $$0 | 0; +} + +function _jcopy_sample_rows($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $$01922 = 0, $$02021 = 0, $$023 = 0; + if (($4 | 0) <= 0) return; + $$01922 = $0 + ($1 << 2) | 0; + $$02021 = $2 + ($3 << 2) | 0; + $$023 = $4; + while (1) { + _memcpy(HEAP32[$$02021 >> 2] | 0, HEAP32[$$01922 >> 2] | 0, $5 | 0) | 0; + if (($$023 | 0) > 1) { + $$01922 = $$01922 + 4 | 0; + $$02021 = $$02021 + 4 | 0; + $$023 = $$023 + -1 | 0; + } else break; + } + return; +} + +function __ZN6vision6Logger5writeENS_19LoggerPriorityLevelERKNSt3__212basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $11 = 0, $3 = 0, $5 = 0; + $3 = $0 + 4 | 0; + $$0 = 0; + while (1) { + $5 = HEAP32[$0 >> 2] | 0; + if ($$0 >>> 0 >= (HEAP32[$3 >> 2] | 0) - $5 >> 3 >>> 0) break; + $11 = HEAP32[$5 + ($$0 << 3) >> 2] | 0; + FUNCTION_TABLE_viii[HEAP32[(HEAP32[$11 >> 2] | 0) + 8 >> 2] & 3]($11, $1, $2); + $$0 = $$0 + 1 | 0; + } + return; +} + +function __ZN12_GLOBAL__N_112OutputStream4growEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $11 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = 0, $spec$store$select = 0; + $4 = (HEAP32[$0 + 4 >> 2] | 0) + $1 | 0; + $5 = $0 + 8 | 0; + $6 = HEAP32[$5 >> 2] | 0; + if ($4 >>> 0 >= $6 >>> 0 ? ($8 = $6 << 1, $spec$store$select = $8 >>> 0 < $4 >>> 0 ? $4 : $8, HEAP32[$5 >> 2] = $spec$store$select, $11 = _realloc(HEAP32[$0 >> 2] | 0, $spec$store$select) | 0, HEAP32[$0 >> 2] = $11, ($11 | 0) == 0) : 0) __ZSt9terminatev(); + return; +} + +function __ZN12_GLOBAL__N_120register_memory_viewItEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDINS_11memory_viewItEEvE3getEv() | 0; + $3 = __ZN12_GLOBAL__N_118getTypedArrayIndexItEENS_15TypedArrayIndexEv() | 0; + __embind_register_memory_view($2 | 0, $3 | 0, HEAP32[$1 >> 2] | 0); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_120register_memory_viewIsEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDINS_11memory_viewIsEEvE3getEv() | 0; + $3 = __ZN12_GLOBAL__N_118getTypedArrayIndexIsEENS_15TypedArrayIndexEv() | 0; + __embind_register_memory_view($2 | 0, $3 | 0, HEAP32[$1 >> 2] | 0); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_120register_memory_viewImEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDINS_11memory_viewImEEvE3getEv() | 0; + $3 = __ZN12_GLOBAL__N_118getTypedArrayIndexImEENS_15TypedArrayIndexEv() | 0; + __embind_register_memory_view($2 | 0, $3 | 0, HEAP32[$1 >> 2] | 0); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_120register_memory_viewIlEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDINS_11memory_viewIlEEvE3getEv() | 0; + $3 = __ZN12_GLOBAL__N_118getTypedArrayIndexIlEENS_15TypedArrayIndexEv() | 0; + __embind_register_memory_view($2 | 0, $3 | 0, HEAP32[$1 >> 2] | 0); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_120register_memory_viewIjEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDINS_11memory_viewIjEEvE3getEv() | 0; + $3 = __ZN12_GLOBAL__N_118getTypedArrayIndexIjEENS_15TypedArrayIndexEv() | 0; + __embind_register_memory_view($2 | 0, $3 | 0, HEAP32[$1 >> 2] | 0); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_120register_memory_viewIiEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDINS_11memory_viewIiEEvE3getEv() | 0; + $3 = __ZN12_GLOBAL__N_118getTypedArrayIndexIiEENS_15TypedArrayIndexEv() | 0; + __embind_register_memory_view($2 | 0, $3 | 0, HEAP32[$1 >> 2] | 0); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_120register_memory_viewIhEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDINS_11memory_viewIhEEvE3getEv() | 0; + $3 = __ZN12_GLOBAL__N_118getTypedArrayIndexIhEENS_15TypedArrayIndexEv() | 0; + __embind_register_memory_view($2 | 0, $3 | 0, HEAP32[$1 >> 2] | 0); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_120register_memory_viewIfEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDINS_11memory_viewIfEEvE3getEv() | 0; + $3 = __ZN12_GLOBAL__N_118getTypedArrayIndexIfEENS_15TypedArrayIndexEv() | 0; + __embind_register_memory_view($2 | 0, $3 | 0, HEAP32[$1 >> 2] | 0); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_120register_memory_viewIeEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDINS_11memory_viewIeEEvE3getEv() | 0; + $3 = __ZN12_GLOBAL__N_118getTypedArrayIndexIeEENS_15TypedArrayIndexEv() | 0; + __embind_register_memory_view($2 | 0, $3 | 0, HEAP32[$1 >> 2] | 0); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_120register_memory_viewIdEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDINS_11memory_viewIdEEvE3getEv() | 0; + $3 = __ZN12_GLOBAL__N_118getTypedArrayIndexIdEENS_15TypedArrayIndexEv() | 0; + __embind_register_memory_view($2 | 0, $3 | 0, HEAP32[$1 >> 2] | 0); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_120register_memory_viewIcEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDINS_11memory_viewIcEEvE3getEv() | 0; + $3 = __ZN12_GLOBAL__N_118getTypedArrayIndexIcEENS_15TypedArrayIndexEv() | 0; + __embind_register_memory_view($2 | 0, $3 | 0, HEAP32[$1 >> 2] | 0); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_120register_memory_viewIaEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDINS_11memory_viewIaEEvE3getEv() | 0; + $3 = __ZN12_GLOBAL__N_118getTypedArrayIndexIaEENS_15TypedArrayIndexEv() | 0; + __embind_register_memory_view($2 | 0, $3 | 0, HEAP32[$1 >> 2] | 0); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle10MemberExprC2EPKNS0_4NodeENS_10StringViewES4_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $6 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 46, 1, 1, 1); + HEAP32[$0 >> 2] = 18880; + HEAP32[$0 + 8 >> 2] = $1; + $6 = $2; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $0 + 12 | 0; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + HEAP32[$0 + 20 >> 2] = $3; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle10BinaryExprC2EPKNS0_4NodeENS_10StringViewES4_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $11 = 0, $12 = 0, $6 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 42, 1, 1, 1); + HEAP32[$0 >> 2] = 19320; + HEAP32[$0 + 8 >> 2] = $1; + $6 = $2; + $11 = HEAP32[$6 + 4 >> 2] | 0; + $12 = $0 + 12 | 0; + HEAP32[$12 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$12 + 4 >> 2] = $11; + HEAP32[$0 + 20 >> 2] = $3; + return; +} + +function __ZN6vision35MultiplyPointHomographyInhomogenousIfEEvRT_S2_PKS1_S1_S1_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = +$3; + $4 = +$4; + var $14 = 0.0; + $14 = +HEAPF32[$2 + 32 >> 2] + (+HEAPF32[$2 + 24 >> 2] * $3 + +HEAPF32[$2 + 28 >> 2] * $4); + HEAPF32[$0 >> 2] = (+HEAPF32[$2 + 8 >> 2] + (+HEAPF32[$2 >> 2] * $3 + +HEAPF32[$2 + 4 >> 2] * $4)) / $14; + HEAPF32[$1 >> 2] = (+HEAPF32[$2 + 20 >> 2] + (+HEAPF32[$2 + 12 >> 2] * $3 + +HEAPF32[$2 + 16 >> 2] * $4)) / $14; + return; +} + +function __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + if ((HEAP8[$1 + 11 >> 0] | 0) < 0) __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm($0, HEAP32[$1 >> 2] | 0, HEAP32[$1 + 4 >> 2] | 0); else { + HEAP32[$0 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$0 + 4 >> 2] = HEAP32[$1 + 4 >> 2]; + HEAP32[$0 + 8 >> 2] = HEAP32[$1 + 8 >> 2]; + } + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle8CastExprC2ENS_10StringViewEPKNS0_4NodeES5_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $10 = 0, $11 = 0, $5 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 48, 1, 1, 1); + HEAP32[$0 >> 2] = 18528; + $5 = $1; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $0 + 8 | 0; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + HEAP32[$0 + 16 >> 2] = $2; + HEAP32[$0 + 20 >> 2] = $3; + return; +} + +function __ZNSt3__213__lower_boundIRNS_6__lessIjmEEPKjmEET0_S6_S6_RKT1_T_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$014 = 0, $10 = 0, $11 = 0, $13 = 0, $8 = 0; + $8 = HEAP32[$2 >> 2] | 0; + $$0 = $0; + $$014 = $1 - $0 >> 2; + while (1) { + if (!$$014) break; + $10 = $$014 >>> 1; + $11 = $$0 + ($10 << 2) | 0; + $13 = (HEAP32[$11 >> 2] | 0) >>> 0 < $8 >>> 0; + $$0 = $13 ? $11 + 4 | 0 : $$0; + $$014 = $13 ? $$014 + -1 - $10 | 0 : $10; + } + return $$0 | 0; +} + +function ___towrite($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0, $14 = 0, $3 = 0, $7 = 0; + $1 = $0 + 74 | 0; + $3 = HEAP8[$1 >> 0] | 0; + HEAP8[$1 >> 0] = $3 + 255 | $3; + $7 = HEAP32[$0 >> 2] | 0; + if (!($7 & 8)) { + HEAP32[$0 + 8 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + $14 = HEAP32[$0 + 44 >> 2] | 0; + HEAP32[$0 + 28 >> 2] = $14; + HEAP32[$0 + 20 >> 2] = $14; + HEAP32[$0 + 16 >> 2] = $14 + (HEAP32[$0 + 48 >> 2] | 0); + $$0 = 0; + } else { + HEAP32[$0 >> 2] = $7 | 32; + $$0 = -1; + } + return $$0 | 0; +} + +function __ZNSt3__26vectorIiNS_9allocatorIiEEE4swapERS3_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $10 = 0, $2 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = 0, $9 = 0; + $2 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = HEAP32[$1 >> 2]; + HEAP32[$1 >> 2] = $2; + $4 = $0 + 4 | 0; + $5 = $1 + 4 | 0; + $6 = HEAP32[$4 >> 2] | 0; + HEAP32[$4 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$5 >> 2] = $6; + $8 = $0 + 8 | 0; + $9 = $1 + 8 | 0; + $10 = HEAP32[$8 >> 2] | 0; + HEAP32[$8 >> 2] = HEAP32[$9 >> 2]; + HEAP32[$9 >> 2] = $10; + return; +} + +function __ZNSt3__214__split_bufferIN6vision5ImageERNS_9allocatorIS2_EEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0, $4 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + while (1) { + $4 = HEAP32[$3 >> 2] | 0; + if (($4 | 0) == ($2 | 0)) break; + $6 = $4 + -32 | 0; + HEAP32[$3 >> 2] = $6; + __ZN6vision5ImageD2Ev($6); + } + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $7 | 0); + return; +} + +function __ZN6vision28BinaryHierarchicalClusteringILi96EED2Ev($0) { + $0 = $0 | 0; + var $4 = 0, $5 = 0; + __ZNSt3__214priority_queueIN6vision17PriorityQueueItemILi96EEENS_6vectorIS3_NS_9allocatorIS3_EEEENS_4lessIS3_EEED2Ev($0 + 84 | 0); + __ZNSt3__213__vector_baseIiNS_9allocatorIiEEED2Ev($0 + 72 | 0); + __ZN6vision14BinarykMedoidsILi96EED2Ev($0 + 12 | 0); + $4 = $0 + 8 | 0; + $5 = HEAP32[$4 >> 2] | 0; + HEAP32[$4 >> 2] = 0; + if ($5 | 0) { + __ZN6vision4NodeILi96EED2Ev($5); + __ZdlPv($5); + } + return; +} + +function _fmt_o($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0$lcssa = 0, $$06 = 0, $10 = 0, $11 = 0, $7 = 0; + if (($0 | 0) == 0 & ($1 | 0) == 0) $$0$lcssa = $2; else { + $$06 = $2; + $11 = $1; + $7 = $0; + while (1) { + $10 = $$06 + -1 | 0; + HEAP8[$10 >> 0] = $7 & 7 | 48; + $7 = _bitshift64Lshr($7 | 0, $11 | 0, 3) | 0; + $11 = getTempRet0() | 0; + if (($7 | 0) == 0 & ($11 | 0) == 0) { + $$0$lcssa = $10; + break; + } else $$06 = $10; + } + } + return $$0$lcssa | 0; +} + +function _ar2SetInitTrans($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$016 = 0, $$017 = 0; + if (!$0) $$017 = -1; else { + HEAP32[$0 + 152 >> 2] = 1; + $$0 = 0; + while (1) { + if (($$0 | 0) == 3) break; + $$016 = 0; + while (1) { + if (($$016 | 0) == 4) break; + HEAP32[$0 + 8 + ($$0 << 4) + ($$016 << 2) >> 2] = HEAP32[$1 + ($$0 << 4) + ($$016 << 2) >> 2]; + $$016 = $$016 + 1 | 0; + } + $$0 = $$0 + 1 | 0; + } + HEAP32[$0 + 168 >> 2] = -1; + $$017 = 0; + } + return $$017 | 0; +} + +function __ZNSt3__219__libcpp_snprintf_lEPcmP15__locale_structPKcz($0, $1, $2, $3, $varargs) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $varargs = $varargs | 0; + var $4 = 0, $5 = 0, $6 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $4 = sp; + HEAP32[$4 >> 2] = $varargs; + $5 = ___uselocale($2) | 0; + $6 = _vsnprintf($0, $1, $3, $4) | 0; + if ($5 | 0) ___uselocale($5) | 0; + STACKTOP = sp; + return $6 | 0; +} + +function __ZN6vision29SolveSymmetricLinearSystem3x3IfEEbPT_PKS1_S4_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 48 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(48); + $3 = sp; + if (__ZN6vision25MatrixInverseSymmetric3x3IfEEbPT_PKS1_S1_($3, $1, 1.1920928955078125e-07) | 0) { + __ZN6vision16Multiply_3x3_3x1IfEEvPT_PKS1_S4_($0, $3, $2); + $$0 = 1; + } else $$0 = 0; + STACKTOP = sp; + return $$0 | 0; +} + +function _get_buff($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $6 = 0, $7 = 0; + L1 : while (1) { + if (!(_fgets($0, 256, $1) | 0)) break; + $$0 = _strlen($0) | 0; + L4 : while (1) { + if (!$$0) break; + $6 = $$0 + -1 | 0; + $7 = $0 + $6 | 0; + switch (HEAP8[$7 >> 0] | 0) { + case 13: + case 10: + break; + default: + break L4; + } + HEAP8[$7 >> 0] = 0; + $$0 = $6; + } + switch (HEAP8[$0 >> 0] | 0) { + case 0: + case 35: + break; + default: + break L1; + } + } + return; +} + +function __ZNKSt3__25ctypeIwE5do_isEPKwS3_Pt($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$08 = 0, $13 = 0, $7 = 0; + $$0 = $3; + $$08 = $1; + while (1) { + if (($$08 | 0) == ($2 | 0)) break; + if ((HEAP32[$$08 >> 2] | 0) >>> 0 < 128) { + $7 = __ZNSt3__25ctypeIcE13classic_tableEv() | 0; + $13 = HEAPU16[$7 + (HEAP32[$$08 >> 2] << 1) >> 1] | 0; + } else $13 = 0; + HEAP16[$$0 >> 1] = $13; + $$0 = $$0 + 2 | 0; + $$08 = $$08 + 4 | 0; + } + return $2 | 0; +} + +function __ZNK6vision20VisualDatabaseFacade18get3DFeaturePointsEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + HEAP32[$2 >> 2] = $1; + $5 = __ZNSt3__213unordered_mapIiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS4_EEEENS_4hashIiEENS_8equal_toIiEENS5_INS_4pairIKiS7_EEEEEixERSD_((HEAP32[$0 >> 2] | 0) + 4 | 0, $2) | 0; + STACKTOP = sp; + return $5 | 0; +} + +function __ZNKSt3__25ctypeIwE10do_scan_isEtPKwS3_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$0$lcssa = 0, $7 = 0; + $$0 = $2; + while (1) { + if (($$0 | 0) == ($3 | 0)) { + $$0$lcssa = $3; + break; + } + if ((HEAP32[$$0 >> 2] | 0) >>> 0 < 128 ? ($7 = __ZNSt3__25ctypeIcE13classic_tableEv() | 0, (HEAP16[$7 + (HEAP32[$$0 >> 2] << 1) >> 1] & $1) << 16 >> 16) : 0) { + $$0$lcssa = $$0; + break; + } + $$0 = $$0 + 4 | 0; + } + return $$0$lcssa | 0; +} + +function __ZN6vision18BinaryFeatureStore6resizeEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + $5 = Math_imul(HEAP32[$0 >> 2] | 0, $1) | 0; + HEAP8[$2 >> 0] = 0; + __ZNSt3__26vectorIhNS_9allocatorIhEEE6resizeEmRKh($0 + 4 | 0, $5, $2); + __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE6resizeEm($0 + 16 | 0, $1); + STACKTOP = sp; + return; +} + +function __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE5uflowEv($0) { + $0 = $0 | 0; + var $$0 = 0, $4 = 0, $8 = 0, $9 = 0; + $4 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$0 >> 2] | 0) + 36 >> 2] & 127]($0) | 0; + if (($4 | 0) == (__ZNSt3__211char_traitsIwE3eofEv() | 0)) $$0 = __ZNSt3__211char_traitsIwE3eofEv() | 0; else { + $8 = $0 + 12 | 0; + $9 = HEAP32[$8 >> 2] | 0; + HEAP32[$8 >> 2] = $9 + 4; + $$0 = __ZNSt3__211char_traitsIwE11to_int_typeEw(HEAP32[$9 >> 2] | 0) | 0; + } + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_122initializeOutputStreamEPcPmRNS_12OutputStreamEm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$010 = 0, $$09 = 0, $4 = 0, label = 0; + if (!$0) { + $4 = _malloc(1024) | 0; + if (!$4) $$09 = 0; else { + $$0 = 1024; + $$010 = $4; + label = 4; + } + } else { + $$0 = HEAP32[$1 >> 2] | 0; + $$010 = $0; + label = 4; + } + if ((label | 0) == 4) { + __ZN12_GLOBAL__N_112OutputStream5resetEPcm($2, $$010, $$0); + $$09 = 1; + } + return $$09 | 0; +} + +function __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE5uflowEv($0) { + $0 = $0 | 0; + var $$0 = 0, $4 = 0, $8 = 0, $9 = 0; + $4 = FUNCTION_TABLE_ii[HEAP32[(HEAP32[$0 >> 2] | 0) + 36 >> 2] & 127]($0) | 0; + if (($4 | 0) == (__ZNSt3__211char_traitsIcE3eofEv() | 0)) $$0 = __ZNSt3__211char_traitsIcE3eofEv() | 0; else { + $8 = $0 + 12 | 0; + $9 = HEAP32[$8 >> 2] | 0; + HEAP32[$8 >> 2] = $9 + 1; + $$0 = __ZNSt3__211char_traitsIcE11to_int_typeEc(HEAP8[$9 >> 0] | 0) | 0; + } + return $$0 | 0; +} + +function __ZNSt3__214__split_bufferIPKN6vision4NodeILi96EEERNS_9allocatorIS5_EEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0, $5 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + $5 = HEAP32[$3 >> 2] | 0; + while (1) { + if (($5 | 0) == ($2 | 0)) break; + $6 = $5 + -4 | 0; + HEAP32[$3 >> 2] = $6; + $5 = $6; + } + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $7 | 0); + return; +} + +function __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEE17__deallocate_nodeEPNS_16__hash_node_baseIPNS_11__hash_nodeIS2_PvEEEE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $3 = 0; + $$0 = $1; + while (1) { + if (!$$0) break; + $3 = HEAP32[$$0 >> 2] | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($$0, 16); + $$0 = $3; + } + return; +} + +function __ZNSt3__214__split_bufferIPN6vision4NodeILi96EEERNS_9allocatorIS4_EEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0, $5 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + $5 = HEAP32[$3 >> 2] | 0; + while (1) { + if (($5 | 0) == ($2 | 0)) break; + $6 = $5 + -4 | 0; + HEAP32[$3 >> 2] = $6; + $5 = $6; + } + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $7 | 0); + return; +} + +function __ZNSt3__214__split_bufferIN6vision7Point3dIfEERNS_9allocatorIS3_EEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0, $5 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + $5 = HEAP32[$3 >> 2] | 0; + while (1) { + if (($5 | 0) == ($2 | 0)) break; + $6 = $5 + -12 | 0; + HEAP32[$3 >> 2] = $6; + $5 = $6; + } + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $7 | 0); + return; +} + +function __ZNSt3__28ios_base4initEPv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $11 = 0, dest = 0, stop = 0; + HEAP32[$0 + 24 >> 2] = $1; + HEAP32[$0 + 16 >> 2] = ($1 | 0) == 0 & 1; + HEAP32[$0 + 20 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 4098; + HEAP32[$0 + 12 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 6; + $11 = $0 + 28 | 0; + dest = $0 + 32 | 0; + stop = dest + 40 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + __ZNSt3__26localeC2Ev($11); + return; +} + +function __ZNSt3__214__split_bufferIN6vision7match_tERNS_9allocatorIS2_EEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0, $5 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + $5 = HEAP32[$3 >> 2] | 0; + while (1) { + if (($5 | 0) == ($2 | 0)) break; + $6 = $5 + -8 | 0; + HEAP32[$3 >> 2] = $6; + $5 = $6; + } + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $7 | 0); + return; +} + +function _arg_n($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $10 = 0, $2 = 0, $9 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + HEAP32[$2 >> 2] = HEAP32[$0 >> 2]; + $$0 = $1; + while (1) { + $9 = (HEAP32[$2 >> 2] | 0) + (4 - 1) & ~(4 - 1); + $10 = HEAP32[$9 >> 2] | 0; + HEAP32[$2 >> 2] = $9 + 4; + if ($$0 >>> 0 > 1) $$0 = $$0 + -1 | 0; else break; + } + STACKTOP = sp; + return $10 | 0; +} + +function __ZN6vision10SimilarityIfEEvPT_S1_S1_S1_S1_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + $3 = +$3; + $4 = +$4; + var $6 = 0.0, $8 = 0.0; + $6 = +Math_cos(+$3) * $4; + $8 = +Math_sin(+$3) * $4; + HEAPF32[$0 >> 2] = $6; + HEAPF32[$0 + 4 >> 2] = -$8; + HEAPF32[$0 + 8 >> 2] = $1; + HEAPF32[$0 + 12 >> 2] = $8; + HEAPF32[$0 + 16 >> 2] = $6; + HEAPF32[$0 + 20 >> 2] = $2; + HEAPF32[$0 + 24 >> 2] = 0.0; + HEAPF32[$0 + 28 >> 2] = 0.0; + HEAPF32[$0 + 32 >> 2] = 1.0; + return; +} + +function __ZNSt3__214__split_bufferINS_4pairIfmEERNS_9allocatorIS2_EEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0, $5 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + $5 = HEAP32[$3 >> 2] | 0; + while (1) { + if (($5 | 0) == ($2 | 0)) break; + $6 = $5 + -8 | 0; + HEAP32[$3 >> 2] = $6; + $5 = $6; + } + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $7 | 0); + return; +} + +function __ZNSt3__214__split_bufferINS_4pairIfiEERNS_9allocatorIS2_EEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0, $5 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + $5 = HEAP32[$3 >> 2] | 0; + while (1) { + if (($5 | 0) == ($2 | 0)) break; + $6 = $5 + -8 | 0; + HEAP32[$3 >> 2] = $6; + $5 = $6; + } + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $7 | 0); + return; +} + +function __ZNSt3__219__libcpp_asprintf_lEPPcP15__locale_structPKcz($0, $1, $2, $varargs) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $varargs = $varargs | 0; + var $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + HEAP32[$3 >> 2] = $varargs; + $4 = ___uselocale($1) | 0; + $5 = _vasprintf($0, $2, $3) | 0; + if ($4 | 0) ___uselocale($4) | 0; + STACKTOP = sp; + return $5 | 0; +} + +function _arImageProcLumaHistAndCDF($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$017 = 0, $2 = 0, $indvars$iv = 0; + $2 = _arImageProcLumaHist($0, $1) | 0; + if (($2 | 0) < 0) $$0 = $2; else { + $$017 = 0; + $indvars$iv = 0; + do { + $$017 = (HEAP32[$0 + 12 + ($indvars$iv << 2) >> 2] | 0) + $$017 | 0; + HEAP32[$0 + 1036 + ($indvars$iv << 2) >> 2] = $$017; + $indvars$iv = $indvars$iv + 1 | 0; + } while (($indvars$iv | 0) != 256); + $$0 = 0; + } + return $$0 | 0; +} + +function _ar2FreeFeatureSet($0) { + $0 = $0 | 0; + var $$0 = 0, $$09 = 0, $1 = 0, $4 = 0, $7 = 0; + $1 = HEAP32[$0 >> 2] | 0; + if (!$1) $$09 = -1; else { + $$0 = 0; + $4 = $1; + while (1) { + $7 = HEAP32[$4 >> 2] | 0; + if (($$0 | 0) >= (HEAP32[$4 + 4 >> 2] | 0)) break; + _free(HEAP32[$7 + ($$0 * 20 | 0) >> 2] | 0); + $$0 = $$0 + 1 | 0; + $4 = HEAP32[$0 >> 2] | 0; + } + _free($7); + _free(HEAP32[$0 >> 2] | 0); + HEAP32[$0 >> 2] = 0; + $$09 = 0; + } + return $$09 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle12InitListExpr9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0; + $3 = HEAP32[$0 + 8 >> 2] | 0; + if ($3 | 0) __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE($3, $1); + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 123); + __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray14printWithCommaERNS_12OutputStreamE($0 + 12 | 0, $1); + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 125); + return; +} + +function __ZNSt3__217__libcpp_sscanf_lEPKcP15__locale_structS1_z($0, $1, $2, $varargs) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $varargs = $varargs | 0; + var $3 = 0, $4 = 0, $5 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + HEAP32[$3 >> 2] = $varargs; + $4 = ___uselocale($1) | 0; + $5 = _vsscanf($0, $2, $3) | 0; + if ($4 | 0) ___uselocale($4) | 0; + STACKTOP = sp; + return $5 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_7NewExprEJRNS0_9NodeArrayERPNS0_4NodeES9_RbSD_EEESB_DpOT0_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle7NewExprEJRNS2_9NodeArrayERPNS2_4NodeES5_RbS9_EEEPT_DpOT0_($0 + 368 | 0, $1, $2, $3, $4, $5) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_7NewExprEJRNS0_9NodeArrayERPNS0_4NodeES8_RbSD_EEESB_DpOT0_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle7NewExprEJRNS2_9NodeArrayERPNS2_4NodeES4_RbS9_EEEPT_DpOT0_($0 + 368 | 0, $1, $2, $3, $4, $5) | 0; +} + +function ___ftello($0) { + $0 = $0 | 0; + var $10 = 0, $4 = 0, $7 = 0, $8 = 0, $9 = 0, $phitmp = 0; + if ((HEAP32[$0 + 76 >> 2] | 0) > -1) { + $phitmp = (___lockfile($0) | 0) == 0; + $7 = ___ftello_unlocked($0) | 0; + $8 = getTempRet0() | 0; + if ($phitmp) { + $10 = $7; + $9 = $8; + } else { + ___unlockfile($0); + $10 = $7; + $9 = $8; + } + } else { + $4 = ___ftello_unlocked($0) | 0; + $10 = $4; + $9 = getTempRet0() | 0; + } + setTempRet0($9 | 0); + return $10 | 0; +} + +function __ZN12_GLOBAL__N_112OutputStreampLENS_10StringViewE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $5 = 0, $7 = 0; + $2 = __ZNK12_GLOBAL__N_110StringView4sizeEv($1) | 0; + if ($2 | 0) { + __ZN12_GLOBAL__N_112OutputStream4growEm($0, $2); + $5 = $0 + 4 | 0; + $7 = (HEAP32[$0 >> 2] | 0) + (HEAP32[$5 >> 2] | 0) | 0; + _memmove($7 | 0, __ZNK12_GLOBAL__N_110StringView5beginEv($1) | 0, $2 | 0) | 0; + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + $2; + } + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle20PostfixQualifiedTypeC2EPNS0_4NodeENS_10StringViewE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $11 = 0, $5 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 5, 1, 1, 1); + HEAP32[$0 >> 2] = 17692; + HEAP32[$0 + 8 >> 2] = $1; + $5 = $2; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $0 + 12 | 0; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22ElaboratedTypeSpefTypeC2ENS_10StringViewEPNS0_4NodeE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $4 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 6, 1, 1, 1); + HEAP32[$0 >> 2] = 19496; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $0 + 8 | 0; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$0 + 16 >> 2] = $2; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle17VendorExtQualTypeC2EPKNS0_4NodeENS_10StringViewE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $11 = 0, $5 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 2, 1, 1, 1); + HEAP32[$0 >> 2] = 20112; + HEAP32[$0 + 8 >> 2] = $1; + $5 = $2; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $0 + 12 | 0; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + return; +} + +function _getint($0) { + $0 = $0 | 0; + var $$0$lcssa = 0, $$04 = 0, $11 = 0, $12 = 0, $7 = 0; + if (!(_isdigit(HEAP8[HEAP32[$0 >> 2] >> 0] | 0) | 0)) $$0$lcssa = 0; else { + $$04 = 0; + while (1) { + $7 = HEAP32[$0 >> 2] | 0; + $11 = ($$04 * 10 | 0) + -48 + (HEAP8[$7 >> 0] | 0) | 0; + $12 = $7 + 1 | 0; + HEAP32[$0 >> 2] = $12; + if (!(_isdigit(HEAP8[$12 >> 0] | 0) | 0)) { + $$0$lcssa = $11; + break; + } else $$04 = $11; + } + } + return $$0$lcssa | 0; +} + +function __ZNSt3__214__split_bufferItRNS_9allocatorItEEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0, $5 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + $5 = HEAP32[$3 >> 2] | 0; + while (1) { + if (($5 | 0) == ($2 | 0)) break; + $6 = $5 + -2 | 0; + HEAP32[$3 >> 2] = $6; + $5 = $6; + } + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $7 | 0); + return; +} + +function __ZNSt3__214__split_bufferIiRNS_9allocatorIiEEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0, $5 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + $5 = HEAP32[$3 >> 2] | 0; + while (1) { + if (($5 | 0) == ($2 | 0)) break; + $6 = $5 + -4 | 0; + HEAP32[$3 >> 2] = $6; + $5 = $6; + } + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $7 | 0); + return; +} + +function __ZNSt3__214__split_bufferIhRNS_9allocatorIhEEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0, $5 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + $5 = HEAP32[$3 >> 2] | 0; + while (1) { + if (($5 | 0) == ($2 | 0)) break; + $6 = $5 + -1 | 0; + HEAP32[$3 >> 2] = $6; + $5 = $6; + } + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $7 | 0); + return; +} + +function __ZNSt3__214__split_bufferIfRNS_9allocatorIfEEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0, $5 = 0, $6 = 0, $7 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + $3 = $0 + 8 | 0; + $5 = HEAP32[$3 >> 2] | 0; + while (1) { + if (($5 | 0) == ($2 | 0)) break; + $6 = $5 + -4 | 0; + HEAP32[$3 >> 2] = $6; + $5 = $6; + } + $7 = HEAP32[$0 >> 2] | 0; + if ($7 | 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($7, (HEAP32[$0 + 12 >> 2] | 0) - $7 | 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle15IntegerCastExprC2EPKNS0_4NodeENS_10StringViewE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $11 = 0, $5 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 60, 1, 1, 1); + HEAP32[$0 >> 2] = 17956; + HEAP32[$0 + 8 >> 2] = $1; + $5 = $2; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $0 + 12 | 0; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + return; +} + +function __ZN10emscripten8internal11BindingTypeINSt3__212basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEvE12fromWireTypeEPNS9_Ut_E($agg$result, $v) { + $agg$result = $agg$result | 0; + $v = $v | 0; + var $0 = 0; + $0 = HEAP32[$v >> 2] | 0; + HEAP32[$agg$result >> 2] = 0; + HEAP32[$agg$result + 4 >> 2] = 0; + HEAP32[$agg$result + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm($agg$result, $v + 4 | 0, $0); + return; +} + +function _ar2CreateHandleMod($cparamLT, $pixFormat) { + $cparamLT = $cparamLT | 0; + $pixFormat = $pixFormat | 0; + var $call = 0, $call4 = 0; + $call = _ar2CreateHandleSubMod($pixFormat, HEAP32[$cparamLT >> 2] | 0, HEAP32[$cparamLT + 4 >> 2] | 0) | 0; + HEAP32[$call >> 2] = 1; + HEAP32[$call + 12 >> 2] = $cparamLT; + $call4 = _icpCreateHandle($cparamLT + 8 | 0) | 0; + HEAP32[$call + 16 >> 2] = $call4; + _icpSetInlierProbability($call4, 0.0) | 0; + return $call | 0; +} + +function __ZNSt3__26vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEE6resizeEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $4 = 0, $6 = 0, $8 = 0; + $2 = $0 + 4 | 0; + $4 = HEAP32[$0 >> 2] | 0; + $6 = (HEAP32[$2 >> 2] | 0) - $4 >> 2; + $8 = $4; + if ($6 >>> 0 >= $1 >>> 0) { + if ($6 >>> 0 > $1 >>> 0) HEAP32[$2 >> 2] = $8 + ($1 << 2); + } else __ZNSt3__26vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEE8__appendEm($0, $1 - $6 | 0); + return; +} + +function __ZNKSt3__25ctypeIcE10do_toupperEPcPKc($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $12 = 0, $4 = 0, $6 = 0; + $$0 = $1; + while (1) { + if (($$0 | 0) == ($2 | 0)) break; + $4 = HEAP8[$$0 >> 0] | 0; + if ($4 << 24 >> 24 > -1) { + $6 = __ZNSt3__25ctypeIcE21__classic_upper_tableEv() | 0; + $12 = HEAP32[$6 + (HEAP8[$$0 >> 0] << 2) >> 2] & 255; + } else $12 = $4; + HEAP8[$$0 >> 0] = $12; + $$0 = $$0 + 1 | 0; + } + return $2 | 0; +} + +function __ZNKSt3__25ctypeIcE10do_tolowerEPcPKc($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $12 = 0, $4 = 0, $6 = 0; + $$0 = $1; + while (1) { + if (($$0 | 0) == ($2 | 0)) break; + $4 = HEAP8[$$0 >> 0] | 0; + if ($4 << 24 >> 24 > -1) { + $6 = __ZNSt3__25ctypeIcE21__classic_lower_tableEv() | 0; + $12 = HEAP32[$6 + (HEAP8[$$0 >> 0] << 2) >> 2] & 255; + } else $12 = $4; + HEAP8[$$0 >> 0] = $12; + $$0 = $$0 + 1 | 0; + } + return $2 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14ConversionExprC2EPKNS0_4NodeENS0_9NodeArrayE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $11 = 0, $5 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 55, 1, 1, 1); + HEAP32[$0 >> 2] = 19188; + HEAP32[$0 + 8 >> 2] = $1; + $5 = $2; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $0 + 12 | 0; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle13ObjCProtoNameC2EPKNS0_4NodeENS_10StringViewE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $11 = 0, $5 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 10, 1, 1, 1); + HEAP32[$0 >> 2] = 20156; + HEAP32[$0 + 8 >> 2] = $1; + $5 = $2; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $0 + 12 | 0; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle10VectorTypeC2EPKNS0_4NodeENS0_12NodeOrStringE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $11 = 0, $5 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 25, 1, 1, 1); + HEAP32[$0 >> 2] = 19980; + HEAP32[$0 + 8 >> 2] = $1; + $5 = $2; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $0 + 12 | 0; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + return; +} + +function _ar2ReadJpegImage2($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = _malloc(20) | 0; + if (!$1) { + _arLog(0, 3, 45930, sp); + _exit(1); + } + $7 = _jpgread($0, $1 + 8 | 0, $1 + 12 | 0, $1 + 4 | 0, $1 + 16 | 0) | 0; + HEAP32[$1 >> 2] = $7; + if (!$7) { + _free($1); + $$0 = 0; + } else $$0 = $1; + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle9ArrayTypeC2EPKNS0_4NodeENS0_12NodeOrStringE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $11 = 0, $5 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 14, 0, 0, 1); + HEAP32[$0 >> 2] = 19936; + HEAP32[$0 + 8 >> 2] = $1; + $5 = $2; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $0 + 12 | 0; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle12InitListExprC2EPKNS0_4NodeENS0_9NodeArrayE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $11 = 0, $5 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 56, 1, 1, 1); + HEAP32[$0 >> 2] = 18308; + HEAP32[$0 + 8 >> 2] = $1; + $5 = $2; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $0 + 12 | 0; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle11PostfixExprC2EPKNS0_4NodeENS_10StringViewE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $11 = 0, $5 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 44, 1, 1, 1); + HEAP32[$0 >> 2] = 18660; + HEAP32[$0 + 8 >> 2] = $1; + $5 = $2; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $0 + 12 | 0; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + return; +} + +function __ZNSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE18__construct_at_endIPS3_EENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_m($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $4 = 0, $7 = 0; + $4 = $0 + 4 | 0; + $7 = $2 - $1 | 0; + if (($7 | 0) > 0) { + _memcpy(HEAP32[$4 >> 2] | 0, $1 | 0, $7 | 0) | 0; + HEAP32[$4 >> 2] = (HEAP32[$4 >> 2] | 0) + ((($7 >>> 0) / 12 | 0) * 12 | 0); + } + return; +} + +function __ZNKSt3__25ctypeIwE10do_toupperEPwPKw($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $10 = 0, $4 = 0, $6 = 0; + $$0 = $1; + while (1) { + if (($$0 | 0) == ($2 | 0)) break; + $4 = HEAP32[$$0 >> 2] | 0; + if ($4 >>> 0 < 128) { + $6 = __ZNSt3__25ctypeIcE21__classic_upper_tableEv() | 0; + $10 = HEAP32[$6 + (HEAP32[$$0 >> 2] << 2) >> 2] | 0; + } else $10 = $4; + HEAP32[$$0 >> 2] = $10; + $$0 = $$0 + 4 | 0; + } + return $2 | 0; +} + +function __ZNKSt3__25ctypeIwE10do_tolowerEPwPKw($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $10 = 0, $4 = 0, $6 = 0; + $$0 = $1; + while (1) { + if (($$0 | 0) == ($2 | 0)) break; + $4 = HEAP32[$$0 >> 2] | 0; + if ($4 >>> 0 < 128) { + $6 = __ZNSt3__25ctypeIcE21__classic_lower_tableEv() | 0; + $10 = HEAP32[$6 + (HEAP32[$$0 >> 2] << 2) >> 2] | 0; + } else $10 = $4; + HEAP32[$$0 >> 2] = $10; + $$0 = $$0 + 4 | 0; + } + return $2 | 0; +} + +function __ZN6vision9MaxIndex6IfEEiPKT_($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$2 = 0, $$3 = 0; + $$0 = +HEAPF32[$0 + 4 >> 2] > +HEAPF32[$0 >> 2] & 1; + $$1 = +HEAPF32[$0 + 8 >> 2] > +HEAPF32[$0 + ($$0 << 2) >> 2] ? 2 : $$0; + $$2 = +HEAPF32[$0 + 12 >> 2] > +HEAPF32[$0 + ($$1 << 2) >> 2] ? 3 : $$1; + $$3 = +HEAPF32[$0 + 16 >> 2] > +HEAPF32[$0 + ($$2 << 2) >> 2] ? 4 : $$2; + return (+HEAPF32[$0 + 20 >> 2] > +HEAPF32[$0 + ($$3 << 2) >> 2] ? 5 : $$3) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle11SpecialNameC2ENS_10StringViewEPKNS0_4NodeE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $4 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 20, 1, 1, 1); + HEAP32[$0 >> 2] = 20332; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $0 + 8 | 0; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$0 + 16 >> 2] = $2; + return; +} + +function __ZN10emscripten8internal7InvokerIiJEE6invokeEPFivE($fn) { + $fn = $fn | 0; + var $call = 0, $call1 = 0, $ref$tmp = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $ref$tmp = sp; + $call = FUNCTION_TABLE_i[$fn & 1]() | 0; + HEAP32[$ref$tmp >> 2] = $call; + $call1 = __ZN10emscripten8internal11BindingTypeIivE10toWireTypeERKi($ref$tmp) | 0; + STACKTOP = sp; + return $call1 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle9DotSuffixC2EPKNS0_4NodeENS_10StringViewE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $11 = 0, $5 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 1, 1, 1, 1); + HEAP32[$0 >> 2] = 20376; + HEAP32[$0 + 8 >> 2] = $1; + $5 = $2; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $0 + 12 | 0; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle8CallExprC2EPKNS0_4NodeENS0_9NodeArrayE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $11 = 0, $5 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 50, 1, 1, 1); + HEAP32[$0 >> 2] = 19232; + HEAP32[$0 + 8 >> 2] = $1; + $5 = $2; + $10 = HEAP32[$5 + 4 >> 2] | 0; + $11 = $0 + 12 | 0; + HEAP32[$11 >> 2] = HEAP32[$5 >> 2]; + HEAP32[$11 + 4 >> 2] = $10; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle10PrefixExprC2ENS_10StringViewEPNS0_4NodeE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0, $4 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 53, 1, 1, 1); + HEAP32[$0 >> 2] = 19276; + $4 = $1; + $9 = HEAP32[$4 + 4 >> 2] | 0; + $10 = $0 + 8 | 0; + HEAP32[$10 >> 2] = HEAP32[$4 >> 2]; + HEAP32[$10 + 4 >> 2] = $9; + HEAP32[$0 + 16 >> 2] = $2; + return; +} + +function _output_message($0) { + $0 = $0 | 0; + var $1 = 0, $5 = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 208 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(208); + $vararg_buffer = sp + 200 | 0; + $1 = sp; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 12 >> 2] & 255]($0, $1); + $5 = HEAP32[4271] | 0; + HEAP32[$vararg_buffer >> 2] = $1; + _fprintf($5, 50727, $vararg_buffer) | 0; + STACKTOP = sp; + return; +} + +function __ZNSt3__28numpunctIwEC2Em($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0, $6 = 0; + HEAP32[$0 + 4 >> 2] = $1 + -1; + HEAP32[$0 >> 2] = 23400; + HEAP32[$0 + 8 >> 2] = 46; + HEAP32[$0 + 12 >> 2] = 44; + $6 = $0 + 16 | 0; + HEAP32[$6 >> 2] = 0; + HEAP32[$6 + 4 >> 2] = 0; + HEAP32[$6 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$6 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8FoldExprEJRbRNS_10StringViewERPNS0_4NodeESD_EEESC_DpOT0_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8FoldExprEJRbRNS_10StringViewERPNS2_4NodeES9_EEEPT_DpOT0_($0 + 368 | 0, $1, $2, $3, $4) | 0; +} + +function __ZN6vision12ArrayShuffleIiEEvPT_iiRi($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $7 = 0, $8 = 0, $9 = 0; + $$0 = 0; + while (1) { + if (($$0 | 0) >= ($2 | 0)) break; + $7 = $0 + ($$0 << 2) | 0; + $8 = $0 + (((__ZN6vision10FastRandomERi($3) | 0) % ($1 | 0) | 0) << 2) | 0; + $9 = HEAP32[$7 >> 2] | 0; + HEAP32[$7 >> 2] = HEAP32[$8 >> 2]; + HEAP32[$8 >> 2] = $9; + $$0 = $$0 + 1 | 0; + } + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9NameStateC2EPS5_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $7 = 0; + HEAP8[$0 >> 0] = 0; + HEAP8[$0 + 1 >> 0] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP8[$0 + 8 >> 0] = 0; + $7 = __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EE4sizeEv($1 + 332 | 0) | 0; + HEAP32[$0 + 12 >> 2] = $7; + return; +} + +function __ZNSt3__26vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEEC2Em($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + HEAP8[$0 + 128 >> 0] = 0; + if ($1 | 0) { + __ZNSt3__26vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEE11__vallocateEm($0, $1); + __ZNSt3__26vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEE18__construct_at_endEm($0, $1); + } + return; +} + +function _arVecInnerproduct($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $$013 = 0.0, $15 = 0.0, $3 = 0; + $3 = HEAP32[$0 + 4 >> 2] | 0; + if (($3 | 0) != (HEAP32[$1 + 4 >> 2] | 0)) _exit(0); + $$0 = 0; + $$013 = 0.0; + while (1) { + if (($$0 | 0) >= ($3 | 0)) break; + $15 = $$013 + +HEAPF64[(HEAP32[$0 >> 2] | 0) + ($$0 << 3) >> 3] * +HEAPF64[(HEAP32[$1 >> 2] | 0) + ($$0 << 3) >> 3]; + $$0 = $$0 + 1 | 0; + $$013 = $15; + } + return +$$013; +} + +function __ZNSt3__28numpunctIcEC2Em($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0, $6 = 0; + HEAP32[$0 + 4 >> 2] = $1 + -1; + HEAP32[$0 >> 2] = 23360; + HEAP8[$0 + 8 >> 0] = 46; + HEAP8[$0 + 9 >> 0] = 44; + $6 = $0 + 12 | 0; + HEAP32[$6 >> 2] = 0; + HEAP32[$6 + 4 >> 2] = 0; + HEAP32[$6 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$6 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle15ConditionalExprEJRPNS2_4NodeES6_S6_EEEPT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $4 = 0; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_116itanium_demangle15ConditionalExprC2EPKNS0_4NodeES4_S4_($4, HEAP32[$1 >> 2] | 0, HEAP32[$2 >> 2] | 0, HEAP32[$3 >> 2] | 0); + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle15BracedRangeExprEJRPNS2_4NodeES6_S6_EEEPT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $4 = 0; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_116itanium_demangle15BracedRangeExprC2EPKNS0_4NodeES4_S4_($4, HEAP32[$1 >> 2] | 0, HEAP32[$2 >> 2] | 0, HEAP32[$3 >> 2] | 0); + return $4 | 0; +} + +function __ZNSt3__213__vector_baseIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEED2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0; + $1 = HEAP32[$0 >> 2] | 0; + $3 = $1; + do if ($1 | 0) { + HEAP32[$0 + 4 >> 2] = $3; + if (($1 | 0) == ($0 + 16 | 0)) { + HEAP8[$0 + 128 >> 0] = 0; + break; + } else { + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($1, (HEAP32[$0 + 8 >> 2] | 0) - $3 | 0); + break; + } + } while (0); + return; +} + +function __ZNKSt3__25ctypeIwE9do_narrowEPKwS3_cPc($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$09 = 0, $10 = 0, $8 = 0; + $8 = ($2 - $1 | 0) >>> 2; + $$0 = $4; + $$09 = $1; + while (1) { + if (($$09 | 0) == ($2 | 0)) break; + $10 = HEAP32[$$09 >> 2] | 0; + HEAP8[$$0 >> 0] = $10 >>> 0 < 128 ? $10 & 255 : $3; + $$0 = $$0 + 1 | 0; + $$09 = $$09 + 4 | 0; + } + return $1 + ($8 << 2) | 0; +} + +function ___muldsi3($a, $b) { + $a = $a | 0; + $b = $b | 0; + var $1 = 0, $2 = 0, $3 = 0, $6 = 0, $8 = 0, $11 = 0, $12 = 0; + $1 = $a & 65535; + $2 = $b & 65535; + $3 = Math_imul($2, $1) | 0; + $6 = $a >>> 16; + $8 = ($3 >>> 16) + (Math_imul($2, $6) | 0) | 0; + $11 = $b >>> 16; + $12 = Math_imul($11, $1) | 0; + return (setTempRet0(($8 >>> 16) + (Math_imul($11, $6) | 0) + ((($8 & 65535) + $12 | 0) >>> 16) | 0), $8 + $12 << 16 | $3 & 65535 | 0) | 0; +} + +function __ZNSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE13__vdeallocateEv($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0, $4 = 0, $5 = 0; + $1 = HEAP32[$0 >> 2] | 0; + $3 = $1; + if ($1 | 0) { + $4 = $0 + 4 | 0; + HEAP32[$4 >> 2] = $3; + $5 = $0 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($1, (HEAP32[$5 >> 2] | 0) - $3 | 0); + HEAP32[$5 >> 2] = 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 >> 2] = 0; + } + return; +} + +function __ZN6vision35MultiplyPointSimilarityInhomogenousIfEEvPT_PKS1_S4_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $8 = 0; + $8 = $2 + 4 | 0; + HEAPF32[$0 >> 2] = +HEAPF32[$1 + 8 >> 2] + (+HEAPF32[$1 >> 2] * +HEAPF32[$2 >> 2] + +HEAPF32[$1 + 4 >> 2] * +HEAPF32[$8 >> 2]); + HEAPF32[$0 + 4 >> 2] = +HEAPF32[$1 + 20 >> 2] + (+HEAPF32[$1 + 12 >> 2] * +HEAPF32[$2 >> 2] + +HEAPF32[$1 + 16 >> 2] * +HEAPF32[$8 >> 2]); + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10DeleteExprEJRPNS2_4NodeERbbEEEPT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $4 = 0; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_116itanium_demangle10DeleteExprC2EPNS0_4NodeEbb($4, HEAP32[$1 >> 2] | 0, (HEAP8[$2 >> 0] | 0) != 0, (HEAP8[$3 >> 0] | 0) != 0); + return $4 | 0; +} + +function ___cxa_can_catch($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + HEAP32[$3 >> 2] = HEAP32[$2 >> 2]; + $8 = FUNCTION_TABLE_iiii[HEAP32[(HEAP32[$0 >> 2] | 0) + 16 >> 2] & 63]($0, $1, $3) | 0; + if ($8) HEAP32[$2 >> 2] = HEAP32[$3 >> 2]; + STACKTOP = sp; + return $8 & 1 | 0; +} + +function __ZN6vision18VisualDatabaseImplD2Ev($0) { + $0 = $0 | 0; + var $2 = 0; + __ZNSt3__213unordered_mapIiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS4_EEEENS_4hashIiEENS_8equal_toIiEENS5_INS_4pairIKiS7_EEEEED2Ev($0 + 4 | 0); + $2 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = 0; + if ($2 | 0) { + __ZN6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEED2Ev($2); + __ZdlPv($2); + } + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle12CtorDtorNameEJRPNS2_4NodeEbRiEEEPT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $4 = 0; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_116itanium_demangle12CtorDtorNameC2EPKNS0_4NodeEbi($4, HEAP32[$1 >> 2] | 0, (HEAP8[$2 >> 0] | 0) != 0, HEAP32[$3 >> 2] | 0); + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10BracedExprEJRPNS2_4NodeES6_bEEEPT_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $4 = 0; + $4 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_116itanium_demangle10BracedExprC2EPKNS0_4NodeES4_b($4, HEAP32[$1 >> 2] | 0, HEAP32[$2 >> 2] | 0, (HEAP8[$3 >> 0] | 0) != 0); + return $4 | 0; +} + +function _shl($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $10 = 0, $3 = 0, $5 = 0, $7 = 0; + $3 = $0 + 4 | 0; + if ($1 >>> 0 > 31) { + $5 = HEAP32[$0 >> 2] | 0; + HEAP32[$3 >> 2] = $5; + HEAP32[$0 >> 2] = 0; + $$0 = $1 + -32 | 0; + $10 = 0; + $7 = $5; + } else { + $$0 = $1; + $10 = HEAP32[$0 >> 2] | 0; + $7 = HEAP32[$3 >> 2] | 0; + } + HEAP32[$3 >> 2] = $10 >>> (32 - $$0 | 0) | $7 << $$0; + HEAP32[$0 >> 2] = $10 << $$0; + return; +} + +function __ZN12_GLOBAL__N_116register_integerIsEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDIsvE3getEv() | 0; + __embind_register_integer($2 | 0, HEAP32[$1 >> 2] | 0, 2, -32768 << 16 >> 16 | 0, 32767 << 16 >> 16 | 0); + STACKTOP = sp; + return; +} + +function _memmove(dest, src, num) { + dest = dest | 0; + src = src | 0; + num = num | 0; + var ret = 0; + if ((src | 0) < (dest | 0) & (dest | 0) < (src + num | 0)) { + ret = dest; + src = src + num | 0; + dest = dest + num | 0; + while ((num | 0) > 0) { + dest = dest - 1 | 0; + src = src - 1 | 0; + num = num - 1 | 0; + HEAP8[dest >> 0] = HEAP8[src >> 0] | 0; + } + dest = ret; + } else _memcpy(dest, src, num) | 0; + return dest | 0; +} + +function __ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE18__construct_at_endEmRKi($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$promoted = 0, $3 = 0, $5 = 0; + $3 = $0 + 8 | 0; + $$promoted = HEAP32[$3 >> 2] | 0; + $$0 = $1; + $5 = $$promoted; + while (1) { + HEAP32[$5 >> 2] = HEAP32[$2 >> 2]; + $$0 = $$0 + -1 | 0; + if (!$$0) break; else $5 = $5 + 4 | 0; + } + HEAP32[$3 >> 2] = $$promoted + ($1 << 2); + return; +} + +function __ZNSt3__26vectorIN6vision17PriorityQueueItemILi96EEENS_9allocatorIS3_EEEC2Em($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + if ($1 | 0) { + __ZNSt3__26vectorIN6vision17PriorityQueueItemILi96EEENS_9allocatorIS3_EEE11__vallocateEm($0, $1); + __ZNSt3__26vectorIN6vision17PriorityQueueItemILi96EEENS_9allocatorIS3_EEE18__construct_at_endEm($0, $1); + } + return; +} + +function _vsscanf($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0, $8 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 144 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(144); + $3 = sp; + _memset($3 | 0, 0, 144) | 0; + HEAP32[$3 + 32 >> 2] = 35; + HEAP32[$3 + 44 >> 2] = $0; + HEAP32[$3 + 76 >> 2] = -1; + HEAP32[$3 + 84 >> 2] = $0; + $8 = _vfscanf($3, $1, $2) | 0; + STACKTOP = sp; + return $8 | 0; +} + +function __ZN12_GLOBAL__N_116register_integerIcEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDIcvE3getEv() | 0; + __embind_register_integer($2 | 0, HEAP32[$1 >> 2] | 0, 1, -128 << 24 >> 24 | 0, 127 << 24 >> 24 | 0); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116register_integerIaEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDIavE3getEv() | 0; + __embind_register_integer($2 | 0, HEAP32[$1 >> 2] | 0, 1, -128 << 24 >> 24 | 0, 127 << 24 >> 24 | 0); + STACKTOP = sp; + return; +} + +function _shr($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $10 = 0, $3 = 0, $5 = 0, $7 = 0; + $3 = $0 + 4 | 0; + if ($1 >>> 0 > 31) { + $5 = HEAP32[$3 >> 2] | 0; + HEAP32[$0 >> 2] = $5; + HEAP32[$3 >> 2] = 0; + $$0 = $1 + -32 | 0; + $10 = 0; + $7 = $5; + } else { + $$0 = $1; + $10 = HEAP32[$3 >> 2] | 0; + $7 = HEAP32[$0 >> 2] | 0; + } + HEAP32[$0 >> 2] = $10 << 32 - $$0 | $7 >>> $$0; + HEAP32[$3 >> 2] = $10 >>> $$0; + return; +} + +function __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $11 = 0, $6 = 0; + HEAP8[$0 >> 0] = 0; + HEAP32[$0 + 4 >> 2] = $1; + $6 = $1 + (HEAP32[(HEAP32[$1 >> 2] | 0) + -12 >> 2] | 0) | 0; + if (!(HEAP32[$6 + 16 >> 2] | 0)) { + $11 = HEAP32[$6 + 72 >> 2] | 0; + if ($11 | 0) __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv($11) | 0; + HEAP8[$0 >> 0] = 1; + } + return; +} + +function __ZN6vision16ComputeEdgeScoreERfPKf($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $15 = 0.0, $2 = 0, $6 = 0.0, $9 = 0.0; + $2 = $1 + 16 | 0; + $6 = +HEAPF32[$1 >> 2] * +HEAPF32[$2 >> 2]; + $9 = $6 - +__ZN6vision3sqrIfEET_S1_(+HEAPF32[$1 + 4 >> 2]); + if ($9 == 0.0) $$0 = 0; else { + $15 = +__ZN6vision3sqrIfEET_S1_(+HEAPF32[$1 >> 2] + +HEAPF32[$2 >> 2]) / $9; + HEAPF32[$0 >> 2] = $15; + $$0 = 1; + } + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13ReferenceTypeEJRPNS2_4NodeENS2_13ReferenceKindEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_116itanium_demangle13ReferenceTypeC2EPKNS0_4NodeENS0_13ReferenceKindE($3, HEAP32[$1 >> 2] | 0, HEAP32[$2 >> 2] | 0); + return $3 | 0; +} + +function _jpeg_std_error($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 209; + HEAP32[$0 + 4 >> 2] = 139; + HEAP32[$0 + 8 >> 2] = 210; + HEAP32[$0 + 12 >> 2] = 140; + HEAP32[$0 + 16 >> 2] = 211; + HEAP32[$0 + 104 >> 2] = 0; + HEAP32[$0 + 108 >> 2] = 0; + HEAP32[$0 + 20 >> 2] = 0; + HEAP32[$0 + 112 >> 2] = 2064; + HEAP32[$0 + 116 >> 2] = 126; + HEAP32[$0 + 120 >> 2] = 0; + HEAP32[$0 + 124 >> 2] = 0; + HEAP32[$0 + 128 >> 2] = 0; + return $0 | 0; +} + +function __ZNSt3__26vectorIiNS_9allocatorIiEEE6resizeEmRKi($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0, $5 = 0, $7 = 0, $9 = 0; + $3 = $0 + 4 | 0; + $5 = HEAP32[$0 >> 2] | 0; + $7 = (HEAP32[$3 >> 2] | 0) - $5 >> 2; + $9 = $5; + if ($7 >>> 0 >= $1 >>> 0) { + if ($7 >>> 0 > $1 >>> 0) HEAP32[$3 >> 2] = $9 + ($1 << 2); + } else __ZNSt3__26vectorIiNS_9allocatorIiEEE8__appendEmRKi($0, $1 - $7 | 0, $2); + return; +} + +function __ZNSt3__26vectorINS_4pairIfiEENS_9allocatorIS2_EEE6resizeEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $4 = 0, $6 = 0, $8 = 0; + $2 = $0 + 4 | 0; + $4 = HEAP32[$0 >> 2] | 0; + $6 = (HEAP32[$2 >> 2] | 0) - $4 >> 3; + $8 = $4; + if ($6 >>> 0 >= $1 >>> 0) { + if ($6 >>> 0 > $1 >>> 0) HEAP32[$2 >> 2] = $8 + ($1 << 3); + } else __ZNSt3__26vectorINS_4pairIfiEENS_9allocatorIS2_EEE8__appendEm($0, $1 - $6 | 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10BinaryExprEJRPNS0_4NodeERNS_10StringViewESA_EEES9_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10BinaryExprEJRPNS2_4NodeERNS_10StringViewES6_EEEPT_DpOT0_($0 + 368 | 0, $1, $2, $3) | 0; +} + +function _start_input_pass($0) { + $0 = $0 | 0; + var $$sink = 0, $11 = 0, $3 = 0; + HEAP32[$0 + 148 >> 2] = 0; + $3 = HEAP32[$0 + 452 >> 2] | 0; + if ((HEAP32[$0 + 340 >> 2] | 0) > 1) $$sink = 1; else { + $11 = HEAP32[$0 + 344 >> 2] | 0; + $$sink = HEAP32[((HEAP32[$0 + 332 >> 2] | 0) == 1 ? $11 + 76 | 0 : $11 + 12 | 0) >> 2] | 0; + } + HEAP32[$3 + 28 >> 2] = $$sink; + HEAP32[$3 + 20 >> 2] = 0; + HEAP32[$3 + 24 >> 2] = 0; + return; +} + +function __ZN6vision22SampleReceptorBilinearERKNS_5ImageEff($0, $1, $2) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + var $6 = 0.0; + $6 = +__ZN6vision10ClipScalarIfEET_S1_S1_S1_($1, 0.0, +(((__ZNK6vision5Image5widthEv($0) | 0) + -2 | 0) >>> 0)); + return +(+__ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($0, $6, +__ZN6vision10ClipScalarIfEET_S1_S1_S1_($2, 0.0, +(((__ZNK6vision5Image6heightEv($0) | 0) + -2 | 0) >>> 0)))); +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_15ClosureTypeNameEJRNS0_9NodeArrayERNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle15ClosureTypeNameEJRNS2_9NodeArrayERNS_10StringViewEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN6vision27OrthogonalizePivot8x9Basis7IfEEbPT_S2_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $5 = 0.0; + $2 = $0 + 252 | 0; + __ZN6vision21AccumulateProjection9IfEEvPT_PKS1_S4_($2, $0 + 216 | 0, $1 + 252 | 0); + $5 = +__ZN6vision11SumSquares9IfEET_PKS1_($2); + if ($5 == 0.0) $$0 = 0; else { + __ZN6vision12ScaleVector9IfEEvPT_PKS1_S1_($2, $2, 1.0 / +Math_sqrt(+$5)); + $$0 = 1; + } + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_22ElaboratedTypeSpefTypeEJRNS_10StringViewERPNS0_4NodeEEEESB_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle22ElaboratedTypeSpefTypeEJRNS_10StringViewERPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZNSt3__26vectorIhNS_9allocatorIhEEE6resizeEmRKh($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0, $5 = 0, $6 = 0, $8 = 0; + $3 = $0 + 4 | 0; + $5 = HEAP32[$0 >> 2] | 0; + $6 = (HEAP32[$3 >> 2] | 0) - $5 | 0; + $8 = $5; + if ($6 >>> 0 >= $1 >>> 0) { + if ($6 >>> 0 > $1 >>> 0) HEAP32[$3 >> 2] = $8 + $1; + } else __ZNSt3__26vectorIhNS_9allocatorIhEEE8__appendEmRKh($0, $1 - $6 | 0, $2); + return; +} + +function __ZNSt3__28ios_base16__call_callbacksENS0_5eventE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $4 = 0, $5 = 0, $7 = 0; + $4 = $0 + 32 | 0; + $5 = $0 + 36 | 0; + $$0 = HEAP32[$0 + 40 >> 2] | 0; + while (1) { + if (!$$0) break; + $7 = $$0 + -1 | 0; + FUNCTION_TABLE_viii[HEAP32[(HEAP32[$4 >> 2] | 0) + ($7 << 2) >> 2] & 3]($1, $0, HEAP32[(HEAP32[$5 >> 2] | 0) + ($7 << 2) >> 2] | 0); + $$0 = $7; + } + return; +} + +function __ZNSt3__26vectorIhNS_9allocatorIhEEE13__vdeallocateEv($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0, $4 = 0, $5 = 0; + $1 = HEAP32[$0 >> 2] | 0; + $3 = $1; + if ($1 | 0) { + $4 = $0 + 4 | 0; + HEAP32[$4 >> 2] = $3; + $5 = $0 + 8 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($1, (HEAP32[$5 >> 2] | 0) - $3 | 0); + HEAP32[$5 >> 2] = 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 >> 2] = 0; + } + return; +} + +function _ar3DCreateHandle2($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = _malloc(4) | 0; + if (!$1) { + _arLog(0, 3, 45930, sp); + _exit(1); + } + $3 = _icpCreateHandle($0) | 0; + HEAP32[$1 >> 2] = $3; + if (!$3) { + _free($1); + $$0 = 0; + } else $$0 = $1; + STACKTOP = sp; + return $$0 | 0; +} + +function _ar2GetVectorAngle($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $12 = 0.0, $15 = 0.0, $6 = 0.0; + $6 = +HEAPF32[$1 >> 2] - +HEAPF32[$0 >> 2]; + $12 = +HEAPF32[$1 + 4 >> 2] - +HEAPF32[$0 + 4 >> 2]; + $15 = +Math_sqrt(+($6 * $6 + $12 * $12)); + if (!($15 == 0.0)) { + HEAPF32[$2 >> 2] = $12 / $15; + HEAPF32[$3 >> 2] = (+HEAPF32[$1 >> 2] - +HEAPF32[$0 >> 2]) / $15; + } + return; +} + +function __ZNK10__cxxabiv117__class_type_info16search_above_dstEPNS_19__dynamic_cast_infoEPKvS4_ib($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + if (__ZL8is_equalPKSt9type_infoS1_b($0, HEAP32[$1 + 8 >> 2] | 0, $5) | 0) __ZNK10__cxxabiv117__class_type_info29process_static_type_above_dstEPNS_19__dynamic_cast_infoEPKvS4_i(0, $1, $2, $3, $4); + return; +} + +function _arLog($0, $1, $2, $varargs) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $varargs = $varargs | 0; + var $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + if (($2 | 0) != 0 & (HEAP32[4186] | 0) <= ($1 | 0) ? HEAP8[$2 >> 0] | 0 : 0) { + HEAP32[$3 >> 2] = $varargs; + _arLogv(0, $1, $2, $3); + } + STACKTOP = sp; + return; +} + +function __ZNSt3__214__split_bufferIhRNS_9allocatorIhEEEC2EmmS3_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $4 = 0, $8 = 0, $9 = 0; + $4 = $0 + 12 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = $3; + if (!$1) $8 = 0; else $8 = __Znwm($1) | 0; + HEAP32[$0 >> 2] = $8; + $9 = $8 + $2 | 0; + HEAP32[$0 + 8 >> 2] = $9; + HEAP32[$0 + 4 >> 2] = $9; + HEAP32[$4 >> 2] = $8 + $1; + return; +} + +function _copysign($0, $1) { + $0 = +$0; + $1 = +$1; + var $2 = 0, $3 = 0, $8 = 0; + HEAPF64[tempDoublePtr >> 3] = $0; + $2 = HEAP32[tempDoublePtr >> 2] | 0; + $3 = HEAP32[tempDoublePtr + 4 >> 2] | 0; + HEAPF64[tempDoublePtr >> 3] = $1; + $8 = HEAP32[tempDoublePtr + 4 >> 2] & -2147483648 | $3 & 2147483647; + HEAP32[tempDoublePtr >> 2] = $2; + HEAP32[tempDoublePtr + 4 >> 2] = $8; + return +(+HEAPF64[tempDoublePtr >> 3]); +} + +function __ZN12_GLOBAL__N_116register_integerIlEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDIlvE3getEv() | 0; + __embind_register_integer($2 | 0, HEAP32[$1 >> 2] | 0, 4, -2147483648, 2147483647); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116register_integerIiEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDIivE3getEv() | 0; + __embind_register_integer($2 | 0, HEAP32[$1 >> 2] | 0, 4, -2147483648, 2147483647); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_17VendorExtQualTypeEJRPNS0_4NodeERNS_10StringViewEEEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle17VendorExtQualTypeEJRPNS2_4NodeERNS_10StringViewEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8QualTypeEJRPNS2_4NodeERNS2_10QualifiersEEEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_116itanium_demangle8QualTypeC2EPKNS0_4NodeENS0_10QualifiersE($3, HEAP32[$1 >> 2] | 0, HEAP32[$2 >> 2] | 0); + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13ReferenceTypeEJRPNS0_4NodeENS0_13ReferenceKindEEEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13ReferenceTypeEJRPNS2_4NodeENS2_13ReferenceKindEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle21CtorVtableSpecialNameEJRPNS2_4NodeES6_EEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_116itanium_demangle21CtorVtableSpecialNameC2EPKNS0_4NodeES4_($3, HEAP32[$1 >> 2] | 0, HEAP32[$2 >> 2] | 0); + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_15IntegerCastExprEJRPNS0_4NodeERNS_10StringViewEEEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle15IntegerCastExprEJRPNS2_4NodeERNS_10StringViewEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_15ConditionalExprEJRPNS0_4NodeESA_SA_EEES9_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle15ConditionalExprEJRPNS2_4NodeES6_S6_EEEPT_DpOT0_($0 + 368 | 0, $1, $2, $3) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_15BracedRangeExprEJRPNS0_4NodeESA_SA_EEES9_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle15BracedRangeExprEJRPNS2_4NodeES6_S6_EEEPT_DpOT0_($0 + 368 | 0, $1, $2, $3) | 0; +} + +function __ZN6vision16RobustHomographyIfE4initEfiii($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = +$1; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + __ZNSt3__26vectorIfNS_9allocatorIfEEE6resizeEm($0, $2 * 9 | 0); + __ZNSt3__26vectorINS_4pairIfiEENS_9allocatorIS2_EEE6resizeEm($0 + 24 | 0, $2); + HEAPF32[$0 + 36 >> 2] = $1; + HEAP32[$0 + 40 >> 2] = $2; + HEAP32[$0 + 44 >> 2] = $3; + HEAP32[$0 + 48 >> 2] = $4; + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle20NameWithTemplateArgsEJRPNS2_4NodeES6_EEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_116itanium_demangle20NameWithTemplateArgsC2EPNS0_4NodeES3_($3, HEAP32[$1 >> 2] | 0, HEAP32[$2 >> 2] | 0); + return $3 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle19PointerToMemberTypeEJRPNS2_4NodeES6_EEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_116itanium_demangle19PointerToMemberTypeC2EPKNS0_4NodeES4_($3, HEAP32[$1 >> 2] | 0, HEAP32[$2 >> 2] | 0); + return $3 | 0; +} + +function _rand() { + var $0 = 0, $10 = 0, $14 = 0, $6 = 0, $8 = 0, $9 = 0; + $0 = 64568; + $6 = ___muldi3(HEAP32[$0 >> 2] | 0, HEAP32[$0 + 4 >> 2] | 0, 1284865837, 1481765933) | 0; + $8 = _i64Add($6 | 0, getTempRet0() | 0, 1, 0) | 0; + $9 = getTempRet0() | 0; + $10 = 64568; + HEAP32[$10 >> 2] = $8; + HEAP32[$10 + 4 >> 2] = $9; + $14 = _bitshift64Lshr($8 | 0, $9 | 0, 33) | 0; + getTempRet0() | 0; + return $14 | 0; +} + +function ___unlist_locked_file($0) { + $0 = $0 | 0; + var $$pre = 0, $$sink = 0, $10 = 0, $5 = 0; + if (HEAP32[$0 + 68 >> 2] | 0) { + $5 = HEAP32[$0 + 132 >> 2] | 0; + $$pre = $0 + 128 | 0; + if ($5 | 0) HEAP32[$5 + 128 >> 2] = HEAP32[$$pre >> 2]; + $10 = HEAP32[$$pre >> 2] | 0; + if (!$10) $$sink = (___pthread_self_603() | 0) + 232 | 0; else $$sink = $10 + 132 | 0; + HEAP32[$$sink >> 2] = $5; + } + return; +} + +function __ZNSt3__218__libcpp_refstringC2EPKc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $4 = 0, $7 = 0; + $2 = _strlen($1) | 0; + $4 = __Znwm($2 + 13 | 0) | 0; + HEAP32[$4 >> 2] = $2; + HEAP32[$4 + 4 >> 2] = $2; + HEAP32[$4 + 8 >> 2] = 0; + $7 = __ZNSt3__215__refstring_imp12_GLOBAL__N_113data_from_repEPNS1_9_Rep_baseE($4) | 0; + _memcpy($7 | 0, $1 | 0, $2 + 1 | 0) | 0; + HEAP32[$0 >> 2] = $7; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13EnclosingExprEJRA10_KcRPNS0_4NodeERA2_S8_EEESC_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13EnclosingExprEJRA10_KcRPNS2_4NodeERA2_S4_EEEPT_DpOT0_($0 + 368 | 0, $1, $2, 51964) | 0; +} + +function ___munmap($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $4 = 0, $vararg_buffer = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $vararg_buffer = sp; + HEAP32[$vararg_buffer >> 2] = $0; + HEAP32[$vararg_buffer + 4 >> 2] = $1; + $4 = ___syscall_ret(___syscall91(91, $vararg_buffer | 0) | 0) | 0; + STACKTOP = sp; + return $4 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_27ExpandedSpecialSubstitutionEJRNS0_14SpecialSubKindEEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle27ExpandedSpecialSubstitutionEJRNS2_14SpecialSubKindEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_14ConversionExprEJRPNS0_4NodeERNS0_9NodeArrayEEEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle14ConversionExprEJRPNS2_4NodeERNS2_9NodeArrayEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13ObjCProtoNameEJRPNS0_4NodeERNS_10StringViewEEEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13ObjCProtoNameEJRPNS2_4NodeERNS_10StringViewEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10MemberExprEJRPNS0_4NodeERA3_KcSA_EEES9_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10MemberExprEJRPNS2_4NodeERA3_KcS6_EEEPT_DpOT0_($0 + 368 | 0, $1, $2, $3) | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle18ArraySubscriptExprEJRPNS2_4NodeES6_EEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_116itanium_demangle18ArraySubscriptExprC2EPKNS0_4NodeES4_($3, HEAP32[$1 >> 2] | 0, HEAP32[$2 >> 2] | 0); + return $3 | 0; +} + +function __ZNSt3__26vectorIhNS_9allocatorIhEEE18__construct_at_endIPhEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeES7_S7_m($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $4 = 0, $7 = 0; + $4 = $0 + 4 | 0; + $7 = $2 - $1 | 0; + if (($7 | 0) > 0) { + _memcpy(HEAP32[$4 >> 2] | 0, $1 | 0, $7 | 0) | 0; + HEAP32[$4 >> 2] = (HEAP32[$4 >> 2] | 0) + $7; + } + return; +} + +function __ZNSt3__26vectorIN6vision17PriorityQueueItemILi96EEENS_9allocatorIS3_EEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $3 = 0; + $2 = $0 + 4 | 0; + $$0 = $1; + $3 = HEAP32[$2 >> 2] | 0; + do { + __ZN6vision17PriorityQueueItemILi96EEC2Ev($3); + $3 = (HEAP32[$2 >> 2] | 0) + 8 | 0; + HEAP32[$2 >> 2] = $3; + $$0 = $$0 + -1 | 0; + } while (($$0 | 0) != 0); + return; +} + +function __ZNSt3__211__stdoutbufIwE5imbueERKNS_6localeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $12 = 0, $5 = 0; + FUNCTION_TABLE_ii[HEAP32[(HEAP32[$0 >> 2] | 0) + 24 >> 2] & 127]($0) | 0; + $5 = __ZNKSt3__26locale9use_facetERNS0_2idE($1, 66824) | 0; + HEAP32[$0 + 36 >> 2] = $5; + $12 = (FUNCTION_TABLE_ii[HEAP32[(HEAP32[$5 >> 2] | 0) + 28 >> 2] & 127]($5) | 0) & 1; + HEAP8[$0 + 44 >> 0] = $12; + return; +} + +function __ZNSt3__211__stdoutbufIcE5imbueERKNS_6localeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $12 = 0, $5 = 0; + FUNCTION_TABLE_ii[HEAP32[(HEAP32[$0 >> 2] | 0) + 24 >> 2] & 127]($0) | 0; + $5 = __ZNKSt3__26locale9use_facetERNS0_2idE($1, 66816) | 0; + HEAP32[$0 + 36 >> 2] = $5; + $12 = (FUNCTION_TABLE_ii[HEAP32[(HEAP32[$5 >> 2] | 0) + 28 >> 2] & 127]($5) | 0) & 1; + HEAP8[$0 + 44 >> 0] = $12; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13EnclosingExprEJRA9_KcRPNS0_4NodeERA2_S8_EEESC_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13EnclosingExprEJRA9_KcRPNS2_4NodeERA2_S4_EEEPT_DpOT0_($0 + 368 | 0, $1, $2, 51964) | 0; +} + +function __ZN6vision4NodeILi96EEC2EiPKh($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $4 = 0; + HEAP32[$0 >> 2] = $1; + HEAP8[$0 + 100 >> 0] = 1; + $4 = $0 + 104 | 0; + HEAP32[$4 >> 2] = 0; + HEAP32[$4 + 4 >> 2] = 0; + HEAP32[$4 + 8 >> 2] = 0; + HEAP32[$4 + 12 >> 2] = 0; + HEAP32[$4 + 16 >> 2] = 0; + HEAP32[$4 + 20 >> 2] = 0; + __ZN6vision10CopyVectorIhEEvPT_PKS1_m($0 + 4 | 0, $2, 96); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_14ConversionExprEJRPNS0_4NodeENS0_9NodeArrayEEEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle14ConversionExprEJRPNS2_4NodeENS2_9NodeArrayEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZNSt3__213unordered_mapIiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS4_EEEENS_4hashIiEENS_8equal_toIiEENS5_INS_4pairIKiS7_EEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS5_EEEEEENS_22__unordered_map_hasherIiS9_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS9_NS_8equal_toIiEELb1EEENS6_IS9_EEED2Ev($0); + return; +} + +function __ZNSt3__213unordered_mapIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEENS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS5_EEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_10shared_ptrIN6vision8KeyframeILi96EEEEEEENS_22__unordered_map_hasherIiS7_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS7_NS_8equal_toIiEELb1EEENS_9allocatorIS7_EEED2Ev($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle21StructuredBindingNameC2ENS0_9NodeArrayE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $8 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 41, 1, 1, 1); + HEAP32[$0 >> 2] = 19584; + $3 = $1; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $0 + 8 | 0; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_9ArrayTypeEJRPNS0_4NodeERNS0_12NodeOrStringEEEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle9ArrayTypeEJRPNS2_4NodeERNS2_12NodeOrStringEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle20TemplateArgumentPackC2ENS0_9NodeArrayE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $8 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 28, 1, 1, 1); + HEAP32[$0 >> 2] = 18220; + $3 = $1; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $0 + 8 | 0; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle20DynamicExceptionSpecC2ENS0_9NodeArrayE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $8 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 17, 1, 1, 1); + HEAP32[$0 >> 2] = 20244; + $3 = $1; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $0 + 8 | 0; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIfEC2ENS_10StringViewE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $8 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 62, 1, 1, 1); + HEAP32[$0 >> 2] = 18088; + $3 = $1; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $0 + 8 | 0; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIdEC2ENS_10StringViewE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $8 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 63, 1, 1, 1); + HEAP32[$0 >> 2] = 18044; + $3 = $1; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $0 + 8 | 0; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + return; +} + +function _calloc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $3 = 0, $8 = 0; + if ($0) { + $3 = Math_imul($1, $0) | 0; + if (($1 | $0) >>> 0 > 65535) $$0 = (($3 >>> 0) / ($0 >>> 0) | 0 | 0) == ($1 | 0) ? $3 : -1; else $$0 = $3; + } else $$0 = 0; + $8 = _malloc($$0) | 0; + if (!$8) return $8 | 0; + if (!(HEAP32[$8 + -4 >> 2] & 3)) return $8 | 0; + _memset($8 | 0, 0, $$0 | 0) | 0; + return $8 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIeEC2ENS_10StringViewE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $8 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 64, 1, 1, 1); + HEAP32[$0 >> 2] = 18e3; + $3 = $1; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $0 + 8 | 0; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle15PixelVectorTypeC2ENS0_12NodeOrStringE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $8 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 26, 1, 1, 1); + HEAP32[$0 >> 2] = 20024; + $3 = $1; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $0 + 8 | 0; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + return; +} + +function __ZNSt3__26vectorItNS_9allocatorItEEE6resizeEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $4 = 0, $6 = 0, $8 = 0; + $2 = $0 + 4 | 0; + $4 = HEAP32[$0 >> 2] | 0; + $6 = (HEAP32[$2 >> 2] | 0) - $4 >> 1; + $8 = $4; + if ($6 >>> 0 >= $1 >>> 0) { + if ($6 >>> 0 > $1 >>> 0) HEAP32[$2 >> 2] = $8 + ($1 << 1); + } else __ZNSt3__26vectorItNS_9allocatorItEEE8__appendEm($0, $1 - $6 | 0); + return; +} + +function __ZNSt3__26vectorIiNS_9allocatorIiEEE6resizeEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $4 = 0, $6 = 0, $8 = 0; + $2 = $0 + 4 | 0; + $4 = HEAP32[$0 >> 2] | 0; + $6 = (HEAP32[$2 >> 2] | 0) - $4 >> 2; + $8 = $4; + if ($6 >>> 0 >= $1 >>> 0) { + if ($6 >>> 0 > $1 >>> 0) HEAP32[$2 >> 2] = $8 + ($1 << 2); + } else __ZNSt3__26vectorIiNS_9allocatorIiEEE8__appendEm($0, $1 - $6 | 0); + return; +} + +function __ZNSt3__26vectorIfNS_9allocatorIfEEE6resizeEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $4 = 0, $6 = 0, $8 = 0; + $2 = $0 + 4 | 0; + $4 = HEAP32[$0 >> 2] | 0; + $6 = (HEAP32[$2 >> 2] | 0) - $4 >> 2; + $8 = $4; + if ($6 >>> 0 >= $1 >>> 0) { + if ($6 >>> 0 > $1 >>> 0) HEAP32[$2 >> 2] = $8 + ($1 << 2); + } else __ZNSt3__26vectorIfNS_9allocatorIfEEE8__appendEm($0, $1 - $6 | 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_12InitListExprEJRPNS0_4NodeENS0_9NodeArrayEEEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle12InitListExprEJRPNS2_4NodeENS2_9NodeArrayEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10VectorTypeEJRPNS0_4NodeERNS_10StringViewEEEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10VectorTypeEJRPNS2_4NodeERNS_10StringViewEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10PrefixExprEJRNS_10StringViewERPNS0_4NodeEEEESB_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10PrefixExprEJRNS_10StringViewERPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10AbiTagAttrEJRPNS0_4NodeERNS_10StringViewEEEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10AbiTagAttrEJRPNS2_4NodeERNS_10StringViewEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZNKSt3__220__time_get_c_storageIwE3__xEv($0) { + $0 = $0 | 0; + if ((HEAP8[64672] | 0) == 0 ? ___cxa_guard_acquire(64672) | 0 : 0) { + HEAP32[16666] = 0; + HEAP32[16667] = 0; + HEAP32[16668] = 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm(66664, 21636, __ZNSt3__211char_traitsIwE6lengthEPKw(21636) | 0); + ___cxa_guard_release(64672); + } + return 66664; +} + +function __ZNKSt3__220__time_get_c_storageIwE3__rEv($0) { + $0 = $0 | 0; + if ((HEAP8[64680] | 0) == 0 ? ___cxa_guard_acquire(64680) | 0 : 0) { + HEAP32[16669] = 0; + HEAP32[16670] = 0; + HEAP32[16671] = 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm(66676, 21672, __ZNSt3__211char_traitsIwE6lengthEPKw(21672) | 0); + ___cxa_guard_release(64680); + } + return 66676; +} + +function __ZNKSt3__220__time_get_c_storageIwE3__cEv($0) { + $0 = $0 | 0; + if ((HEAP8[64688] | 0) == 0 ? ___cxa_guard_acquire(64688) | 0 : 0) { + HEAP32[16672] = 0; + HEAP32[16673] = 0; + HEAP32[16674] = 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm(66688, 21720, __ZNSt3__211char_traitsIwE6lengthEPKw(21720) | 0); + ___cxa_guard_release(64688); + } + return 66688; +} + +function __ZNKSt3__220__time_get_c_storageIcE3__xEv($0) { + $0 = $0 | 0; + if ((HEAP8[64592] | 0) == 0 ? ___cxa_guard_acquire(64592) | 0 : 0) { + HEAP32[16649] = 0; + HEAP32[16650] = 0; + HEAP32[16651] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(66596, 59411, __ZNSt3__211char_traitsIcE6lengthEPKc(59411) | 0); + ___cxa_guard_release(64592); + } + return 66596; +} + +function __ZNKSt3__220__time_get_c_storageIcE3__rEv($0) { + $0 = $0 | 0; + if ((HEAP8[64600] | 0) == 0 ? ___cxa_guard_acquire(64600) | 0 : 0) { + HEAP32[16652] = 0; + HEAP32[16653] = 0; + HEAP32[16654] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(66608, 59420, __ZNSt3__211char_traitsIcE6lengthEPKc(59420) | 0); + ___cxa_guard_release(64600); + } + return 66608; +} + +function __ZNKSt3__220__time_get_c_storageIcE3__cEv($0) { + $0 = $0 | 0; + if ((HEAP8[64608] | 0) == 0 ? ___cxa_guard_acquire(64608) | 0 : 0) { + HEAP32[16655] = 0; + HEAP32[16656] = 0; + HEAP32[16657] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(66620, 59432, __ZNSt3__211char_traitsIcE6lengthEPKc(59432) | 0); + ___cxa_guard_release(64608); + } + return 66620; +} + +function __ZNKSt3__220__time_get_c_storageIcE3__XEv($0) { + $0 = $0 | 0; + if ((HEAP8[64584] | 0) == 0 ? ___cxa_guard_acquire(64584) | 0 : 0) { + HEAP32[16646] = 0; + HEAP32[16647] = 0; + HEAP32[16648] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(66584, 59402, __ZNSt3__211char_traitsIcE6lengthEPKc(59402) | 0); + ___cxa_guard_release(64584); + } + return 66584; +} + +function __ZN12_GLOBAL__N_116register_integerItEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDItvE3getEv() | 0; + __embind_register_integer($2 | 0, HEAP32[$1 >> 2] | 0, 2, 0, 65535); + STACKTOP = sp; + return; +} + +function ___fseeko($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $10 = 0, $9 = 0, $phitmp = 0; + if ((HEAP32[$0 + 76 >> 2] | 0) > -1) { + $phitmp = (___lockfile($0) | 0) == 0; + $9 = ___fseeko_unlocked($0, $1, $2, $3) | 0; + if ($phitmp) $10 = $9; else { + ___unlockfile($0); + $10 = $9; + } + } else $10 = ___fseeko_unlocked($0, $1, $2, $3) | 0; + return $10 | 0; +} + +function __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEEC2Em($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + if ($1 | 0) { + __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE11__vallocateEm($0, $1); + __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE18__construct_at_endEm($0, $1); + } + return; +} +function __ZNKSt3__220__time_get_c_storageIwE3__XEv($0) { + $0 = $0 | 0; + if ((HEAP8[64664] | 0) == 0 ? ___cxa_guard_acquire(64664) | 0 : 0) { + HEAP32[16663] = 0; + HEAP32[16664] = 0; + HEAP32[16665] = 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm(66652, 21600, __ZNSt3__211char_traitsIwE6lengthEPKw(21600) | 0); + ___cxa_guard_release(64664); + } + return 66652; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_14IntegerLiteralEJRNS_10StringViewES9_EEEPNS0_4NodeEDpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle14IntegerLiteralEJRNS_10StringViewES5_EEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_12CtorDtorNameEJRPNS0_4NodeEbRiEEES9_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle12CtorDtorNameEJRPNS2_4NodeEbRiEEEPT_DpOT0_($0 + 368 | 0, $1, $2, $3) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10VectorTypeEJRPNS0_4NodeENS_10StringViewEEEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10VectorTypeEJRPNS2_4NodeENS_10StringViewEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle15UnnamedTypeNameC2ENS_10StringViewE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $8 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 39, 1, 1, 1); + HEAP32[$0 >> 2] = 19672; + $3 = $1; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $0 + 8 | 0; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle27ExpandedSpecialSubstitutionEJRNS2_14SpecialSubKindEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 12) | 0; + __ZN12_GLOBAL__N_116itanium_demangle27ExpandedSpecialSubstitutionC2ENS0_14SpecialSubKindE($2, HEAP32[$1 >> 2] | 0); + return $2 | 0; +} + +function __ZN12_GLOBAL__N_116register_integerIhEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDIhvE3getEv() | 0; + __embind_register_integer($2 | 0, HEAP32[$1 >> 2] | 0, 1, 0, 255); + STACKTOP = sp; + return; +} + +function _merged_1v_upsample($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + FUNCTION_TABLE_viiii[HEAP32[(HEAP32[$0 + 476 >> 2] | 0) + 12 >> 2] & 31]($0, $1, HEAP32[$2 >> 2] | 0, $4 + (HEAP32[$5 >> 2] << 2) | 0); + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + 1; + HEAP32[$2 >> 2] = (HEAP32[$2 >> 2] | 0) + 1; + return; +} + +function __ZNKSt3__212_GLOBAL__N_111__fake_bindclEv($0) { + $0 = $0 | 0; + var $$unpack = 0, $$unpack2 = 0, $10 = 0, $3 = 0; + $$unpack = HEAP32[$0 + 4 >> 2] | 0; + $$unpack2 = HEAP32[$0 + 8 >> 2] | 0; + $3 = (HEAP32[$0 >> 2] | 0) + ($$unpack2 >> 1) | 0; + if (!($$unpack2 & 1)) $10 = $$unpack; else $10 = HEAP32[(HEAP32[$3 >> 2] | 0) + $$unpack >> 2] | 0; + FUNCTION_TABLE_vi[$10 & 255]($3); + return; +} + +function __ZN12_GLOBAL__N_116register_integerImEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDImvE3getEv() | 0; + __embind_register_integer($2 | 0, HEAP32[$1 >> 2] | 0, 4, 0, -1); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116register_integerIjEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDIjvE3getEv() | 0; + __embind_register_integer($2 | 0, HEAP32[$1 >> 2] | 0, 4, 0, -1); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8QualTypeEJRPNS0_4NodeERNS0_10QualifiersEEEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8QualTypeEJRPNS2_4NodeERNS2_10QualifiersEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10BracedExprEJRPNS0_4NodeESA_bEEES9_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10BracedExprEJRPNS2_4NodeES6_bEEEPT_DpOT0_($0 + 368 | 0, $1, $2, $3) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle13FunctionParamC2ENS_10StringViewE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $8 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 54, 1, 1, 1); + HEAP32[$0 >> 2] = 19408; + $3 = $1; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $0 + 8 | 0; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13QualifiedNameEJRPNS2_4NodeES6_EEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_116itanium_demangle13QualifiedNameC2EPKNS0_4NodeES4_($3, HEAP32[$1 >> 2] | 0, HEAP32[$2 >> 2] | 0); + return $3 | 0; +} + +function __ZNSt3__26vectorIhNS_9allocatorIhEEE11__vallocateEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $4 = 0; + if ((__ZNKSt3__26vectorIhNS_9allocatorIhEEE8max_sizeEv($0) | 0) >>> 0 < $1 >>> 0) __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0); else { + $4 = __Znwm($1) | 0; + HEAP32[$0 + 4 >> 2] = $4; + HEAP32[$0 >> 2] = $4; + HEAP32[$0 + 8 >> 2] = $4 + $1; + return; + } +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_9DotSuffixEJRPNS0_4NodeENS_10StringViewEEEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle9DotSuffixEJRPNS2_4NodeENS_10StringViewEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_21CtorVtableSpecialNameEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle21CtorVtableSpecialNameEJRPNS2_4NodeES6_EEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10DeleteExprEJRPNS0_4NodeERbbEEES9_DpOT0_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10DeleteExprEJRPNS2_4NodeERbbEEEPT_DpOT0_($0 + 368 | 0, $1, $2, $3) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle13NodeArrayNodeC2ENS0_9NodeArrayE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $8 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 0, 1, 1, 1); + HEAP32[$0 >> 2] = 18352; + $3 = $1; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $0 + 8 | 0; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle12TemplateArgsC2ENS0_9NodeArrayE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $8 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 30, 1, 1, 1); + HEAP32[$0 >> 2] = 17868; + $3 = $1; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $0 + 8 | 0; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + return; +} + +function _arMatrixAllocf($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $6 = 0; + $2 = _malloc(12) | 0; + do if ($2) { + $6 = _malloc(Math_imul($0 << 2, $1) | 0) | 0; + HEAP32[$2 >> 2] = $6; + if (!$6) { + _free($2); + $$0 = 0; + break; + } else { + HEAP32[$2 + 4 >> 2] = $0; + HEAP32[$2 + 8 >> 2] = $1; + $$0 = $2; + break; + } + } else $$0 = 0; while (0); + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle12EnableIfAttrC2ENS0_9NodeArrayE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $8 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 9, 1, 1, 1); + HEAP32[$0 >> 2] = 20464; + $3 = $1; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $0 + 8 | 0; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + return; +} + +function __ZN10emscripten8internal7InvokerIvJiiEE6invokeEPFviiEii($fn, $args, $args1) { + $fn = $fn | 0; + $args = $args | 0; + $args1 = $args1 | 0; + var $call = 0, $call3 = 0; + $call = __ZN10emscripten8internal11BindingTypeIivE12fromWireTypeEi($args) | 0; + $call3 = __ZN10emscripten8internal11BindingTypeIivE12fromWireTypeEi($args1) | 0; + FUNCTION_TABLE_vii[$fn & 255]($call, $call3); + return; +} + +function _arMatrixAlloc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $6 = 0; + $2 = _malloc(12) | 0; + do if ($2) { + $6 = _malloc(Math_imul($0 << 3, $1) | 0) | 0; + HEAP32[$2 >> 2] = $6; + if (!$6) { + _free($2); + $$0 = 0; + break; + } else { + HEAP32[$2 + 4 >> 2] = $0; + HEAP32[$2 + 8 >> 2] = $1; + $$0 = $2; + break; + } + } else $$0 = 0; while (0); + return $$0 | 0; +} + +function __ZNSt3__26vectorIhNS_9allocatorIhEEE6resizeEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $4 = 0, $5 = 0, $7 = 0; + $2 = $0 + 4 | 0; + $4 = HEAP32[$0 >> 2] | 0; + $5 = (HEAP32[$2 >> 2] | 0) - $4 | 0; + $7 = $4; + if ($5 >>> 0 >= $1 >>> 0) { + if ($5 >>> 0 > $1 >>> 0) HEAP32[$2 >> 2] = $7 + $1; + } else __ZNSt3__26vectorIhNS_9allocatorIhEEE8__appendEm($0, $1 - $5 | 0); + return; +} + +function __ZNSt3__214__split_bufferIN6vision12FeaturePointERNS_9allocatorIS2_EEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $3 = 0; + $2 = $0 + 8 | 0; + $$0 = $1; + $3 = HEAP32[$2 >> 2] | 0; + do { + __ZN6vision12FeaturePointC2Ev($3); + $3 = (HEAP32[$2 >> 2] | 0) + 20 | 0; + HEAP32[$2 >> 2] = $3; + $$0 = $$0 + -1 | 0; + } while (($$0 | 0) != 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20NameWithTemplateArgsEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle20NameWithTemplateArgsEJRPNS2_4NodeES6_EEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13EnclosingExprEJRA12_KcRPNS0_4NodeERA2_S8_EEESC_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13EnclosingExprEJRA12_KcRPNS2_4NodeERA2_S4_EEEPT_DpOT0_($0 + 368 | 0, 52940, $1, 51964) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13EnclosingExprEJRA11_KcRPNS0_4NodeERA2_S8_EEESC_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13EnclosingExprEJRA11_KcRPNS2_4NodeERA2_S4_EEEPT_DpOT0_($0 + 368 | 0, 53268, $1, 51964) | 0; +} + +function __ZNSt3__210shared_ptrIN6vision8KeyframeILi96EEEED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $4 = 0, $5 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + if ($2 | 0 ? ($4 = $2 + 4 | 0, $5 = HEAP32[$4 >> 2] | 0, HEAP32[$4 >> 2] = $5 + -1, ($5 | 0) == 0) : 0) { + FUNCTION_TABLE_vi[HEAP32[(HEAP32[$2 >> 2] | 0) + 8 >> 2] & 255]($2); + __ZNSt3__219__shared_weak_count14__release_weakEv($2); + } + return; +} + +function __ZNKSt3__25ctypeIcE9do_narrowEPKcS3_cPc($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $$0 = 0, $$09 = 0, $6 = 0; + $$0 = $4; + $$09 = $1; + while (1) { + if (($$09 | 0) == ($2 | 0)) break; + $6 = HEAP8[$$09 >> 0] | 0; + HEAP8[$$0 >> 0] = $6 << 24 >> 24 > -1 ? $6 : $3; + $$0 = $$0 + 1 | 0; + $$09 = $$09 + 1 | 0; + } + return $2 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10MemberExprEJRPNS0_4NodeERA2_KcSA_EEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10MemberExprEJRPNS2_4NodeERA2_KcS6_EEEPT_DpOT0_($0 + 368 | 0, $1, 53642, $2) | 0; +} + +function __ZNSt3__214__split_bufferIhRNS_9allocatorIhEEE18__construct_at_endEmRKh($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $3 = 0, $5 = 0; + $3 = $0 + 8 | 0; + $$0 = $1; + $5 = HEAP32[$3 >> 2] | 0; + do { + HEAP8[$5 >> 0] = HEAP8[$2 >> 0] | 0; + $5 = (HEAP32[$3 >> 2] | 0) + 1 | 0; + HEAP32[$3 >> 2] = $5; + $$0 = $$0 + -1 | 0; + } while (($$0 | 0) != 0); + return; +} + +function __ZN6vision22bilinear_interpolationIfEET_RKNS_5ImageEff($0, $1, $2) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + var $3 = 0, $4 = 0, $5 = 0; + $3 = __ZNK6vision5Image3getEv($0) | 0; + $4 = __ZNK6vision5Image5widthEv($0) | 0; + $5 = __ZNK6vision5Image6heightEv($0) | 0; + return +(+__ZN6vision22bilinear_interpolationIfEET_PKS1_mmmff($3, $4, $5, __ZNK6vision5Image4stepEv($0) | 0, $1, $2)); +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8CallExprEJRPNS0_4NodeENS0_9NodeArrayEEEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8CallExprEJRPNS2_4NodeENS2_9NodeArrayEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_19PointerToMemberTypeEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle19PointerToMemberTypeEJRPNS2_4NodeES6_EEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZNSt3__26vectorIN6vision7Point2dIfEENS_9allocatorIS3_EEEC2Em($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + if ($1 | 0) { + __ZNSt3__26vectorIN6vision7Point2dIfEENS_9allocatorIS3_EEE11__vallocateEm($0, $1); + __ZNSt3__26vectorIN6vision7Point2dIfEENS_9allocatorIS3_EEE18__construct_at_endEm($0, $1); + } + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle8NameTypeC2ENS_10StringViewE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $8 = 0, $9 = 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 7, 1, 1, 1); + HEAP32[$0 >> 2] = 18792; + $3 = $1; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $0 + 8 | 0; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10NestedNameEJRPNS2_4NodeES6_EEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_116itanium_demangle10NestedNameC2EPNS0_4NodeES3_($3, HEAP32[$1 >> 2] | 0, HEAP32[$2 >> 2] | 0); + return $3 | 0; +} + +function __ZN6vision11ScopedTimerC2EPKc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + __ZN6vision5TimerC2Ev($0); + $2 = $0 + 16 | 0; + HEAP32[$2 >> 2] = 0; + HEAP32[$2 + 4 >> 2] = 0; + HEAP32[$2 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm($2, $1, __ZNSt3__211char_traitsIcE6lengthEPKc($1) | 0); + __ZN6vision5Timer5startEv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_19SpecialSubstitutionEJNS0_14SpecialSubKindEEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle19SpecialSubstitutionEJNS2_14SpecialSubKindEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_18ArraySubscriptExprEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle18ArraySubscriptExprEJRPNS2_4NodeES6_EEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_12InitListExprEJDnNS0_9NodeArrayEEEEPNS0_4NodeEDpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle12InitListExprEJDnNS2_9NodeArrayEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZNK6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEE13queryKeyframeEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $6 = 0, $8 = 0; + HEAP32[$0 >> 2] = HEAP32[$1 + 64 >> 2]; + $6 = HEAP32[$1 + 68 >> 2] | 0; + HEAP32[$0 + 4 >> 2] = $6; + if ($6 | 0) { + $8 = $6 + 4 | 0; + HEAP32[$8 >> 2] = (HEAP32[$8 >> 2] | 0) + 1; + } + return; +} + +function __ZN6vision16SequentialVectorIiEEvPT_iS1_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $4 = 0, $5 = 0; + L1 : do if (($1 | 0) >= 1) { + HEAP32[$0 >> 2] = $2; + $$0 = 1; + $5 = $2; + while (1) { + if (($$0 | 0) == ($1 | 0)) break L1; + $4 = $5 + 1 | 0; + HEAP32[$0 + ($$0 << 2) >> 2] = $4; + $$0 = $$0 + 1 | 0; + $5 = $4; + } + } while (0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle8QualTypeC2EPKNS0_4NodeENS0_10QualifiersE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 3, HEAP8[$1 + 5 >> 0] | 0, HEAP8[$1 + 6 >> 0] | 0, HEAP8[$1 + 7 >> 0] | 0); + HEAP32[$0 >> 2] = 20068; + HEAP32[$0 + 8 >> 2] = $2; + HEAP32[$0 + 12 >> 2] = $1; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8CastExprEJRA17_KcRPNS0_4NodeESD_EEESC_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8CastExprEJRA17_KcRPNS2_4NodeES9_EEEPT_DpOT0_($0 + 368 | 0, 53187, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8CastExprEJRA13_KcRPNS0_4NodeESD_EEESC_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8CastExprEJRA13_KcRPNS2_4NodeES9_EEEPT_DpOT0_($0 + 368 | 0, 54481, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8CastExprEJRA12_KcRPNS0_4NodeESD_EEESC_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8CastExprEJRA12_KcRPNS2_4NodeES9_EEEPT_DpOT0_($0 + 368 | 0, 53128, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8CastExprEJRA11_KcRPNS0_4NodeESD_EEESC_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8CastExprEJRA11_KcRPNS2_4NodeES9_EEEPT_DpOT0_($0 + 368 | 0, 54653, $1, $2) | 0; +} + +function __ZN10emscripten8internal7InvokerIvJifEE6invokeEPFvifEif($fn, $args, $args1) { + $fn = $fn | 0; + $args = $args | 0; + $args1 = +$args1; + var $call = 0, $call3 = 0.0; + $call = __ZN10emscripten8internal11BindingTypeIivE12fromWireTypeEi($args) | 0; + $call3 = +__ZN10emscripten8internal11BindingTypeIfvE12fromWireTypeEf($args1); + FUNCTION_TABLE_vid[$fn & 3]($call, $call3); + return; +} + +function __ZN10emscripten8internal7InvokerIvJidEE6invokeEPFvidEid($fn, $args, $args1) { + $fn = $fn | 0; + $args = $args | 0; + $args1 = +$args1; + var $call = 0, $call3 = 0.0; + $call = __ZN10emscripten8internal11BindingTypeIivE12fromWireTypeEi($args) | 0; + $call3 = +__ZN10emscripten8internal11BindingTypeIdvE12fromWireTypeEd($args1); + FUNCTION_TABLE_vid[$fn & 3]($call, $call3); + return; +} + +function _arUtilRemoveExt($0) { + $0 = $0 | 0; + var $$0 = 0, $$011 = 0, $$1 = 0; + $$0 = -1; + $$011 = 0; + L1 : while (1) { + switch (HEAP8[$0 + $$011 >> 0] | 0) { + case 0: + { + break L1; + break; + } + case 46: + { + $$1 = $$011; + break; + } + default: + $$1 = $$0; + } + $$0 = $$1; + $$011 = $$011 + 1 | 0; + } + if (($$0 | 0) != -1) HEAP8[$0 + $$0 >> 0] = 0; + return 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20PostfixQualifiedTypeEJRPNS0_4NodeERA11_KcEEES9_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle20PostfixQualifiedTypeEJRPNS2_4NodeERA11_KcEEEPT_DpOT0_($0 + 368 | 0, $1, 51887) | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle9LocalNameEJRPNS2_4NodeES6_EEEPT_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0; + $3 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 16) | 0; + __ZN12_GLOBAL__N_116itanium_demangle9LocalNameC2EPNS0_4NodeES3_($3, HEAP32[$1 >> 2] | 0, HEAP32[$2 >> 2] | 0); + return $3 | 0; +} + +function __ZN12_GLOBAL__N_114register_floatIfEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDIfvE3getEv() | 0; + __embind_register_float($2 | 0, HEAP32[$1 >> 2] | 0, 4); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_114register_floatIdEEvPKc($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $0; + $2 = __ZN10emscripten8internal6TypeIDIdvE3getEv() | 0; + __embind_register_float($2 | 0, HEAP32[$1 >> 2] | 0, 8); + STACKTOP = sp; + return; +} + +function _arUtilGetPixelSize($0) { + $0 = $0 | 0; + var $$0 = 0; + switch ($0 | 0) { + case 1: + case 0: + { + $$0 = 3; + break; + } + case 6: + case 4: + case 3: + case 2: + { + $$0 = 4; + break; + } + case 14: + case 13: + case 12: + case 5: + { + $$0 = 1; + break; + } + case 11: + case 10: + case 9: + case 8: + case 7: + { + $$0 = 2; + break; + } + default: + $$0 = 0; + } + return $$0 | 0; +} + +function __ZNSt3__214__split_bufferIPNS_6locale5facetERNS_15__sso_allocatorIS3_Lm28EEEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $3 = 0; + $2 = $0 + 8 | 0; + $$0 = $1; + $3 = HEAP32[$2 >> 2] | 0; + do { + HEAP32[$3 >> 2] = 0; + $3 = (HEAP32[$2 >> 2] | 0) + 4 | 0; + HEAP32[$2 >> 2] = $3; + $$0 = $$0 + -1 | 0; + } while (($$0 | 0) != 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E9consumeIfEc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0; + $2 = HEAP32[$0 >> 2] | 0; + if (($2 | 0) != (HEAP32[$0 + 4 >> 2] | 0) ? (HEAP8[$2 >> 0] | 0) == $1 << 24 >> 24 : 0) { + HEAP32[$0 >> 2] = $2 + 1; + $$0 = 1; + } else $$0 = 0; + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20PostfixQualifiedTypeEJRPNS0_4NodeERA9_KcEEES9_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle20PostfixQualifiedTypeEJRPNS2_4NodeERA9_KcEEEPT_DpOT0_($0 + 368 | 0, $1, 51955) | 0; +} + +function __ZNSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $3 = 0; + $2 = $0 + 4 | 0; + $$0 = $1; + $3 = HEAP32[$2 >> 2] | 0; + do { + __ZN6vision12FeaturePointC2Ev($3); + $3 = (HEAP32[$2 >> 2] | 0) + 20 | 0; + HEAP32[$2 >> 2] = $3; + $$0 = $$0 + -1 | 0; + } while (($$0 | 0) != 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA34_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA34_KcRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle13ReferenceTypeC2EPKNS0_4NodeENS0_13ReferenceKindE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 12, HEAP8[$1 + 5 >> 0] | 0, 1, 1); + HEAP32[$0 >> 2] = 17736; + HEAP32[$0 + 8 >> 2] = $1; + HEAP32[$0 + 12 >> 2] = $2; + HEAP8[$0 + 16 >> 0] = 0; + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle19SpecialSubstitutionEJNS2_14SpecialSubKindEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 12) | 0; + __ZN12_GLOBAL__N_116itanium_demangle19SpecialSubstitutionC2ENS0_14SpecialSubKindE($2, HEAP32[$1 >> 2] | 0); + return $2 | 0; +} + +function _sn_write($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $5 = 0, $6 = 0, $7 = 0, $spec$select = 0; + $5 = $0 + 20 | 0; + $6 = HEAP32[$5 >> 2] | 0; + $7 = (HEAP32[$0 + 16 >> 2] | 0) - $6 | 0; + $spec$select = $7 >>> 0 > $2 >>> 0 ? $2 : $7; + _memcpy($6 | 0, $1 | 0, $spec$select | 0) | 0; + HEAP32[$5 >> 2] = (HEAP32[$5 >> 2] | 0) + $spec$select; + return $2 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_21StructuredBindingNameEJNS0_9NodeArrayEEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle21StructuredBindingNameEJNS2_9NodeArrayEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20TemplateArgumentPackEJRNS0_9NodeArrayEEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle20TemplateArgumentPackEJRNS2_9NodeArrayEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_16FloatLiteralImplIfEEJRNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle16FloatLiteralImplIfEEJRNS_10StringViewEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_16FloatLiteralImplIeEEJRNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle16FloatLiteralImplIeEEJRNS_10StringViewEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_16FloatLiteralImplIdEEJRNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle16FloatLiteralImplIdEEJRNS_10StringViewEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11PostfixExprEJRPNS0_4NodeERA3_KcEEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11PostfixExprEJRPNS2_4NodeERA3_KcEEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function ___memrchr($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$in = 0, $4 = 0; + L1 : do if (!$2) $$0 = 0; else { + $4 = $1 & 255; + $$in = $2; + while (1) { + $$in = $$in + -1 | 0; + if ((HEAP8[$0 + $$in >> 0] | 0) == $4 << 24 >> 24) break; + if (!$$in) { + $$0 = 0; + break L1; + } + } + $$0 = $0 + $$in | 0; + } while (0); + return $$0 | 0; +} + +function _reset_input_controller($0) { + $0 = $0 | 0; + var $2 = 0; + $2 = HEAP32[$0 + 460 >> 2] | 0; + HEAP32[$2 >> 2] = 90; + HEAP32[$2 + 16 >> 2] = 0; + HEAP32[$2 + 20 >> 2] = 0; + HEAP32[$2 + 24 >> 2] = 1; + FUNCTION_TABLE_vi[HEAP32[(HEAP32[$0 >> 2] | 0) + 16 >> 2] & 255]($0); + FUNCTION_TABLE_vi[HEAP32[HEAP32[$0 + 464 >> 2] >> 2] & 255]($0); + HEAP32[$0 + 160 >> 2] = 0; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_20DynamicExceptionSpecEJNS0_9NodeArrayEEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle20DynamicExceptionSpecEJNS2_9NodeArrayEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13QualifiedNameEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13QualifiedNameEJRPNS2_4NodeES6_EEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function ___getTypeName($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $7 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp + 4 | 0; + $2 = sp; + HEAP32[$2 >> 2] = $0; + HEAP32[$1 >> 2] = HEAP32[$2 >> 2]; + $7 = ___strdup(HEAP32[(HEAP32[$1 >> 2] | 0) + 4 >> 2] | 0) | 0; + STACKTOP = sp; + return $7 | 0; +} + +function __Znwm($0) { + $0 = $0 | 0; + var $$lcssa = 0, $2 = 0, $4 = 0, $spec$store$select = 0; + $spec$store$select = ($0 | 0) == 0 ? 1 : $0; + while (1) { + $2 = _malloc($spec$store$select) | 0; + if ($2 | 0) { + $$lcssa = $2; + break; + } + $4 = __ZSt15get_new_handlerv() | 0; + if (!$4) { + $$lcssa = 0; + break; + } + FUNCTION_TABLE_v[$4 & 3](); + } + return $$lcssa | 0; +} + +function __ZNSt3__214__split_bufferIN6vision5ImageERNS_9allocatorIS2_EEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $3 = 0; + $2 = $0 + 8 | 0; + $$0 = $1; + $3 = HEAP32[$2 >> 2] | 0; + do { + __ZN6vision5ImageC2Ev($3); + $3 = (HEAP32[$2 >> 2] | 0) + 32 | 0; + HEAP32[$2 >> 2] = $3; + $$0 = $$0 + -1 | 0; + } while (($$0 | 0) != 0); + return; +} + +function _jinit_input_controller($0) { + $0 = $0 | 0; + var $4 = 0; + $4 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$0 + 4 >> 2] >> 2] & 63]($0, 0, 28) | 0; + HEAP32[$0 + 460 >> 2] = $4; + HEAP32[$4 >> 2] = 90; + HEAP32[$4 + 4 >> 2] = 206; + HEAP32[$4 + 8 >> 2] = 207; + HEAP32[$4 + 12 >> 2] = 208; + HEAP32[$4 + 16 >> 2] = 0; + HEAP32[$4 + 20 >> 2] = 0; + HEAP32[$4 + 24 >> 2] = 1; + return; +} + +function __ZNSt3__26vectorIN6vision7Point2dIfEENS_9allocatorIS3_EEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $3 = 0; + $2 = $0 + 4 | 0; + $$0 = $1; + $3 = HEAP32[$2 >> 2] | 0; + do { + __ZN6vision7Point2dIfEC2Ev($3); + $3 = (HEAP32[$2 >> 2] | 0) + 8 | 0; + HEAP32[$2 >> 2] = $3; + $$0 = $$0 + -1 | 0; + } while (($$0 | 0) != 0); + return; +} + +function __ZN6vision9MaxIndex5IfEEiPKT_($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0, $$2 = 0; + $$0 = +HEAPF32[$0 + 4 >> 2] > +HEAPF32[$0 >> 2] & 1; + $$1 = +HEAPF32[$0 + 8 >> 2] > +HEAPF32[$0 + ($$0 << 2) >> 2] ? 2 : $$0; + $$2 = +HEAPF32[$0 + 12 >> 2] > +HEAPF32[$0 + ($$1 << 2) >> 2] ? 3 : $$1; + return (+HEAPF32[$0 + 16 >> 2] > +HEAPF32[$0 + ($$2 << 2) >> 2] ? 4 : $$2) | 0; +} + +function __ZNSt3__26vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $3 = 0; + $2 = $0 + 4 | 0; + $$0 = $1; + $3 = HEAP32[$2 >> 2] | 0; + do { + HEAP32[$3 >> 2] = 0; + $3 = (HEAP32[$2 >> 2] | 0) + 4 | 0; + HEAP32[$2 >> 2] = $3; + $$0 = $$0 + -1 | 0; + } while (($$0 | 0) != 0); + return; +} + +function __ZN6vision4NodeILi96EEC2Ei($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0; + HEAP32[$0 >> 2] = $1; + HEAP8[$0 + 100 >> 0] = 1; + $3 = $0 + 104 | 0; + HEAP32[$3 >> 2] = 0; + HEAP32[$3 + 4 >> 2] = 0; + HEAP32[$3 + 8 >> 2] = 0; + HEAP32[$3 + 12 >> 2] = 0; + HEAP32[$3 + 16 >> 2] = 0; + HEAP32[$3 + 20 >> 2] = 0; + __ZN6vision10ZeroVectorIhEEvPT_m($0 + 4 | 0, 96); + return; +} + +function _matrixCopy($src, $dst) { + $src = $src | 0; + $dst = $dst | 0; + var $i$0 = 0, $j$0 = 0; + $i$0 = 0; + while (1) { + if (($i$0 | 0) == 3) break; + $j$0 = 0; + while (1) { + if (($j$0 | 0) == 4) break; + HEAPF64[$dst + ($i$0 << 5) + ($j$0 << 3) >> 3] = +HEAPF64[$src + ($i$0 << 5) + ($j$0 << 3) >> 3]; + $j$0 = $j$0 + 1 | 0; + } + $i$0 = $i$0 + 1 | 0; + } + return; +} + +function __ZNK10__cxxabiv117__class_type_info27has_unambiguous_public_baseEPNS_19__dynamic_cast_infoEPvi($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + if (__ZL8is_equalPKSt9type_infoS1_b($0, HEAP32[$1 + 8 >> 2] | 0, 0) | 0) __ZNK10__cxxabiv117__class_type_info24process_found_base_classEPNS_19__dynamic_cast_infoEPvi(0, $1, $2, $3); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_15UnnamedTypeNameEJRNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle15UnnamedTypeNameEJRNS_10StringViewEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_15PixelVectorTypeEJRNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle15PixelVectorTypeEJRNS_10StringViewEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10VectorTypeEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10VectorTypeEJRPNS2_4NodeES6_EEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_10NestedNameEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle10NestedNameEJRPNS2_4NodeES6_EEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function ___uflow($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + if ((___toread($0) | 0) == 0 ? (FUNCTION_TABLE_iiii[HEAP32[$0 + 32 >> 2] & 63]($0, $1, 1) | 0) == 1 : 0) $$0 = HEAPU8[$1 >> 0] | 0; else $$0 = -1; + STACKTOP = sp; + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle12NodeOrStringC2ENS_10StringViewE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $3 = 0, $4 = 0; + $2 = __ZNK12_GLOBAL__N_110StringView5beginEv($1) | 0; + $3 = __ZNK12_GLOBAL__N_110StringView3endEv($1) | 0; + $4 = ($3 | 0) == 0; + HEAP32[$0 >> 2] = $4 ? $2 + 1 | 0 : $2; + HEAP32[$0 + 4 >> 2] = $4 ? $3 + 1 | 0 : $3; + return; +} + +function __ZNKSt3__27collateIwE7do_hashEPKwS3_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$020 = 0, $6 = 0, $7 = 0; + $$0 = 0; + $$020 = $1; + while (1) { + if (($$020 | 0) == ($2 | 0)) break; + $6 = (HEAP32[$$020 >> 2] | 0) + ($$0 << 4) | 0; + $7 = $6 & -268435456; + $$0 = ($7 >>> 24 | $7) ^ $6; + $$020 = $$020 + 4 | 0; + } + return $$0 | 0; +} + +function __ZNKSt3__27collateIwE12do_transformEPKwS3_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initIPKwEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_($0, $2, $3); + return; +} + +function __ZNKSt3__27collateIcE12do_transformEPKcS3_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initIPKcEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_($0, $2, $3); + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle22ParameterPackExpansionEJRPNS2_4NodeEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 12) | 0; + __ZN12_GLOBAL__N_116itanium_demangle22ParameterPackExpansionC2EPKNS0_4NodeE($2, HEAP32[$1 >> 2] | 0); + return $2 | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle22ConversionOperatorTypeEJRPNS2_4NodeEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 12) | 0; + __ZN12_GLOBAL__N_116itanium_demangle22ConversionOperatorTypeC2EPKNS0_4NodeE($2, HEAP32[$1 >> 2] | 0); + return $2 | 0; +} + +function __ZNKSt3__27collateIcE7do_hashEPKcS3_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$020 = 0, $7 = 0, $8 = 0; + $$0 = 0; + $$020 = $1; + while (1) { + if (($$020 | 0) == ($2 | 0)) break; + $7 = ($$0 << 4) + (HEAP8[$$020 >> 0] | 0) | 0; + $8 = $7 & -268435456; + $$0 = ($8 >>> 24 | $8) ^ $7; + $$020 = $$020 + 1 | 0; + } + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_9LocalNameEJRPNS0_4NodeESA_EEES9_DpOT0_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle9LocalNameEJRPNS2_4NodeES6_EEEPT_DpOT0_($0 + 368 | 0, $1, $2) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_22ParameterPackExpansionEJRPNS0_4NodeEEEES9_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle22ParameterPackExpansionEJRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_22ConversionOperatorTypeEJRPNS0_4NodeEEEES9_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle22ConversionOperatorTypeEJRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13FunctionParamEJRNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13FunctionParamEJRNS_10StringViewEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle15ConditionalExprC2EPKNS0_4NodeES4_S4_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 45, 1, 1, 1); + HEAP32[$0 >> 2] = 18572; + HEAP32[$0 + 8 >> 2] = $1; + HEAP32[$0 + 12 >> 2] = $2; + HEAP32[$0 + 16 >> 2] = $3; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle15BracedRangeExprC2EPKNS0_4NodeES4_S4_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 66, 1, 1, 1); + HEAP32[$0 >> 2] = 18704; + HEAP32[$0 + 8 >> 2] = $1; + HEAP32[$0 + 12 >> 2] = $2; + HEAP32[$0 + 16 >> 2] = $3; + return; +} + +function __ZNSt3__210shared_ptrIhED2Ev($0) { + $0 = $0 | 0; + var $2 = 0, $4 = 0, $5 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + if ($2 | 0 ? ($4 = $2 + 4 | 0, $5 = HEAP32[$4 >> 2] | 0, HEAP32[$4 >> 2] = $5 + -1, ($5 | 0) == 0) : 0) { + FUNCTION_TABLE_vi[HEAP32[(HEAP32[$2 >> 2] | 0) + 8 >> 2] & 255]($2); + __ZNSt3__219__shared_weak_count14__release_weakEv($2); + } + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA41_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA41_KcRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, 56858, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA27_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA27_KcRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, 56987, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA25_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA25_KcRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, 56773, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA22_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA22_KcRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, 56818, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA20_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA20_KcRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, 56798, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA19_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA19_KcRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, 57014, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA18_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA18_KcRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, 56840, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA14_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA14_KcRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, 57033, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA12_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA12_KcRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, 57056, $1) | 0; +} + +function __ZNSt3__26vectorIN6vision5ImageENS_9allocatorIS2_EEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $3 = 0; + $2 = $0 + 4 | 0; + $$0 = $1; + $3 = HEAP32[$2 >> 2] | 0; + do { + __ZN6vision5ImageC2Ev($3); + $3 = (HEAP32[$2 >> 2] | 0) + 32 | 0; + HEAP32[$2 >> 2] = $3; + $$0 = $$0 + -1 | 0; + } while (($$0 | 0) != 0); + return; +} + +function __ZN6vision40Homography3PointsGeometricallyConsistentIfEEbPKT_S3_S3_S3_S3_S3_($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $7 = 0; + $7 = +__ZN6vision13LinePointSideIfEET_PKS1_S3_S3_($0, $1, $2) > 0.0; + return $7 ^ +__ZN6vision13LinePointSideIfEET_PKS1_S3_S3_($3, $4, $5) > 0.0 ^ 1 | 0; +} + +function __ZNSt3__25ctypeIcEC2EPKtbm($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $10 = 0, $7 = 0; + HEAP32[$0 + 4 >> 2] = $3 + -1; + HEAP32[$0 >> 2] = 23308; + $7 = $0 + 8 | 0; + HEAP32[$7 >> 2] = $1; + HEAP8[$0 + 12 >> 0] = $2 & 1; + if (!$1) { + $10 = __ZNSt3__25ctypeIcE13classic_tableEv() | 0; + HEAP32[$7 >> 2] = $10; + } + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack23initializePackExpansionERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $6 = 0; + $2 = $1 + 16 | 0; + if ((HEAP32[$2 >> 2] | 0) == -1) { + $6 = __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray4sizeEv($0 + 8 | 0) | 0; + HEAP32[$2 >> 2] = $6; + HEAP32[$1 + 12 >> 2] = 0; + } + return; +} + +function __ZN6vision25bilinear_downsample_pointERfS0_S0_fffi($0, $1, $2, $3, $4, $5, $6) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = +$3; + $4 = +$4; + $5 = +$5; + $6 = $6 | 0; + var $11 = 0.0, $9 = 0.0; + $9 = 1.0 / +(1 << $6 | 0); + $11 = $9 * .5 + -.5; + HEAPF32[$0 >> 2] = $9 * $3 + $11; + HEAPF32[$1 >> 2] = $9 * $4 + $11; + HEAPF32[$2 >> 2] = $9 * $5; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11SpecialNameEJRA9_KcRPNS0_4NodeEEEESC_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11SpecialNameEJRA9_KcRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, 57047, $1) | 0; +} + +function __ZNSt3__218__libcpp_refstringD2Ev($0) { + $0 = $0 | 0; + var $3 = 0, $4 = 0, $5 = 0; + if (__ZNKSt3__218__libcpp_refstring15__uses_refcountEv($0) | 0 ? ($3 = __ZNSt3__215__refstring_imp12_GLOBAL__N_113rep_from_dataEPKc(HEAP32[$0 >> 2] | 0) | 0, $4 = $3 + 8 | 0, $5 = HEAP32[$4 >> 2] | 0, HEAP32[$4 >> 2] = $5 + -1, ($5 | 0) < 1) : 0) __ZdlPv($3); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13ParameterPackEJNS0_9NodeArrayEEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13ParameterPackEJNS2_9NodeArrayEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_13NodeArrayNodeEJNS0_9NodeArrayEEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle13NodeArrayNodeEJNS2_9NodeArrayEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle12CtorDtorNameC2EPKNS0_4NodeEbi($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 37, 1, 1, 1); + HEAP32[$0 >> 2] = 19760; + HEAP32[$0 + 8 >> 2] = $1; + HEAP8[$0 + 12 >> 0] = $2 & 1; + HEAP32[$0 + 16 >> 2] = $3; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle10DeleteExprC2EPNS0_4NodeEbb($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 52, 1, 1, 1); + HEAP32[$0 >> 2] = 19144; + HEAP32[$0 + 8 >> 2] = $1; + HEAP8[$0 + 12 >> 0] = $2 & 1; + HEAP8[$0 + 13 >> 0] = $3 & 1; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle10BracedExprC2EPKNS0_4NodeES4_b($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 65, 1, 1, 1); + HEAP32[$0 >> 2] = 18748; + HEAP32[$0 + 8 >> 2] = $1; + HEAP32[$0 + 12 >> 2] = $2; + HEAP8[$0 + 16 >> 0] = $3 & 1; + return; +} + +function __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $11 = 0, $6 = 0; + $6 = $0; + HEAP32[$6 >> 2] = 0; + HEAP32[$6 + 4 >> 2] = 0; + $11 = $0 + 8 | 0; + HEAP32[$11 >> 2] = -1; + HEAP32[$11 + 4 >> 2] = -1; + return; +} + +function __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $11 = 0, $6 = 0; + $6 = $0; + HEAP32[$6 >> 2] = 0; + HEAP32[$6 + 4 >> 2] = 0; + $11 = $0 + 8 | 0; + HEAP32[$11 >> 2] = -1; + HEAP32[$11 + 4 >> 2] = -1; + return; +} + +function __ZNSt3__213unordered_mapIiP14AR2SurfaceSetTNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS2_EEEEED2Ev($this) { + $this = $this | 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIiP14AR2SurfaceSetTEENS_22__unordered_map_hasherIiS4_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS4_NS_8equal_toIiEELb1EEENS_9allocatorIS4_EEED2Ev($this); + return; +} + +function __ZN6vision16RobustHomographyIfEC2Efiii($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = +$1; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var dest = 0, stop = 0; + dest = $0; + stop = dest + 36 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + __ZN6vision16RobustHomographyIfE4initEfiii($0, $1, $2, $3, $4); + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle19SizeofParamPackExprEJRPNS2_4NodeEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 12) | 0; + __ZN12_GLOBAL__N_116itanium_demangle19SizeofParamPackExprC2EPKNS0_4NodeE($2, HEAP32[$1 >> 2] | 0); + return $2 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_19SizeofParamPackExprEJRPNS0_4NodeEEEES9_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle19SizeofParamPackExprEJRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_19GlobalQualifiedNameEJRPNS0_4NodeEEEES9_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle19GlobalQualifiedNameEJRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_12TemplateArgsEJNS0_9NodeArrayEEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle12TemplateArgsEJNS2_9NodeArrayEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_12EnableIfAttrEJNS0_9NodeArrayEEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle12EnableIfAttrEJNS2_9NodeArrayEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle19GlobalQualifiedNameEJRPNS2_4NodeEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 12) | 0; + __ZN12_GLOBAL__N_116itanium_demangle19GlobalQualifiedNameC2EPNS0_4NodeE($2, HEAP32[$1 >> 2] | 0); + return $2 | 0; +} + +function _wmemcpy($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$058 = 0, $$067 = 0, $$09 = 0; + if ($2 | 0) { + $$058 = $2; + $$067 = $1; + $$09 = $0; + while (1) { + $$058 = $$058 + -1 | 0; + HEAP32[$$09 >> 2] = HEAP32[$$067 >> 2]; + if (!$$058) break; else { + $$067 = $$067 + 4 | 0; + $$09 = $$09 + 4 | 0; + } + } + } + return $0 | 0; +} + +function _snprintf($0, $1, $2, $varargs) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $varargs = $varargs | 0; + var $3 = 0, $4 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $3 = sp; + HEAP32[$3 >> 2] = $varargs; + $4 = _vsnprintf($0, $1, $2, $3) | 0; + STACKTOP = sp; + return $4 | 0; +} + +function __ZNSt3__213unordered_mapIiNS_6vectorIiNS_9allocatorIiEEEENS_4hashIiEENS_8equal_toIiEENS2_INS_4pairIKiS4_EEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIiNS_6vectorIiNS_9allocatorIiEEEEEENS_22__unordered_map_hasherIiS6_NS_4hashIiEELb1EEENS_21__unordered_map_equalIiS6_NS_8equal_toIiEELb1EEENS3_IS6_EEED2Ev($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_24ForwardTemplateReferenceEJRmEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle24ForwardTemplateReferenceEJRmEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function _rewind($0) { + $0 = $0 | 0; + var $phitmp = 0; + if ((HEAP32[$0 + 76 >> 2] | 0) > -1) { + $phitmp = (___lockfile($0) | 0) == 0; + ___fseeko_unlocked($0, 0, 0, 0) | 0; + HEAP32[$0 >> 2] = HEAP32[$0 >> 2] & -33; + if (!$phitmp) ___unlockfile($0); + } else { + ___fseeko_unlocked($0, 0, 0, 0) | 0; + HEAP32[$0 >> 2] = HEAP32[$0 >> 2] & -33; + } + return; +} + +function __ZN6vision25GaussianScaleSpacePyramid9configureEii($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $10 = 0.0, $exp2 = 0.0; + HEAP32[$0 + 16 >> 2] = $1; + HEAP32[$0 + 20 >> 2] = $2; + $exp2 = +_llvm_exp2_f32(+(1.0 / +($2 + -1 | 0))); + HEAPF32[$0 + 24 >> 2] = $exp2; + $10 = 1.0 / +Math_log(+$exp2); + HEAPF32[$0 + 28 >> 2] = $10; + return; +} + +function _jpeg_idct_1x1($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $17 = 0; + $17 = (HEAP32[$0 + 336 >> 2] | 0) + -384 + (((Math_imul(HEAP32[HEAP32[$1 + 84 >> 2] >> 2] | 0, HEAP16[$2 >> 1] | 0) | 0) + 4100 | 0) >>> 3 & 1023) | 0; + HEAP8[(HEAP32[$3 >> 2] | 0) + $4 >> 0] = HEAP8[$17 >> 0] | 0; + return; +} + +function __ZNSt3__214__split_bufferINS_6vectorINS1_INS_4pairIfmEENS_9allocatorIS3_EEEENS4_IS6_EEEERNS4_IS8_EEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$promoted = 0, $2 = 0; + $2 = $0 + 8 | 0; + $$promoted = HEAP32[$2 >> 2] | 0; + _memset($$promoted | 0, 0, $1 * 12 | 0) | 0; + HEAP32[$2 >> 2] = $$promoted + ($1 * 12 | 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRNS_10StringViewEEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRNS_10StringViewEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_16StdQualifiedNameEJRPNS0_4NodeEEEES9_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle16StdQualifiedNameEJRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle16StdQualifiedNameEJRPNS2_4NodeEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 12) | 0; + __ZN12_GLOBAL__N_116itanium_demangle16StdQualifiedNameC2EPNS0_4NodeE($2, HEAP32[$1 >> 2] | 0); + return $2 | 0; +} + +function __ZN12_GLOBAL__N_120BumpPointerAllocator15allocateMassiveEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $6 = 0; + $3 = _malloc($1 + 8 | 0) | 0; + if (!$3) __ZSt9terminatev(); else { + $6 = HEAP32[$0 + 4096 >> 2] | 0; + HEAP32[$3 >> 2] = HEAP32[$6 >> 2]; + HEAP32[$3 + 4 >> 2] = 0; + HEAP32[$6 >> 2] = $3; + return $3 + 8 | 0; + } + return 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle15LiteralOperatorEJRPNS2_4NodeEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 12) | 0; + __ZN12_GLOBAL__N_116itanium_demangle15LiteralOperatorC2EPKNS0_4NodeE($2, HEAP32[$1 >> 2] | 0); + return $2 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_15LiteralOperatorEJRPNS0_4NodeEEEES9_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle15LiteralOperatorEJRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN10emscripten8constantIiEEvPKcRKT_($name, $v) { + $name = $name | 0; + $v = $v | 0; + var $call = 0; + $call = __ZN10emscripten8internal6TypeIDIRKivE3getEv() | 0; + __embind_register_constant($name | 0, $call | 0, +(+__ZN10emscripten8internal14asGenericValueIiEEdT_(__ZN10emscripten8internal11BindingTypeIivE10toWireTypeERKi($v) | 0))); + return; +} + +function __ZNSt3__214__split_bufferIhRNS_9allocatorIhEEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $3 = 0; + $2 = $0 + 8 | 0; + $$0 = $1; + $3 = HEAP32[$2 >> 2] | 0; + do { + HEAP8[$3 >> 0] = 0; + $3 = (HEAP32[$2 >> 2] | 0) + 1 | 0; + HEAP32[$2 >> 2] = $3; + $$0 = $$0 + -1 | 0; + } while (($$0 | 0) != 0); + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle24ForwardTemplateReferenceEJRmEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 20) | 0; + __ZN12_GLOBAL__N_116itanium_demangle24ForwardTemplateReferenceC2Em($2, HEAP32[$1 >> 2] | 0); + return $2 | 0; +} + +function __ZN10emscripten8constantIdEEvPKcRKT_($name, $v) { + $name = $name | 0; + $v = $v | 0; + var $call = 0; + $call = __ZN10emscripten8internal6TypeIDIRKdvE3getEv() | 0; + __embind_register_constant($name | 0, $call | 0, +(+__ZN10emscripten8internal14asGenericValueIdEEdT_(+__ZN10emscripten8internal11BindingTypeIdvE10toWireTypeERKd($v)))); + return; +} + +function _arDeleteHandle($0) { + $0 = $0 | 0; + var $$0 = 0, $2 = 0, $3 = 0; + if (!$0) $$0 = -1; else { + $2 = $0 + 7062408 | 0; + $3 = HEAP32[$2 >> 2] | 0; + if ($3 | 0) { + _arImageProcFinal($3); + HEAP32[$2 >> 2] = 0; + } + _free(HEAP32[$0 + 4834144 >> 2] | 0); + _free(HEAP32[$0 + 4834148 >> 2] | 0); + _free($0); + $$0 = 0; + } + return $$0 | 0; +} + +function __ZNSt3__213__vector_baseIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEED2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0; + $1 = HEAP32[$0 >> 2] | 0; + $3 = $1; + if ($1 | 0) { + HEAP32[$0 + 4 >> 2] = $3; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($1, (HEAP32[$0 + 8 >> 2] | 0) - $3 | 0); + } + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle12NoexceptSpecEJRPNS2_4NodeEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 12) | 0; + __ZN12_GLOBAL__N_116itanium_demangle12NoexceptSpecC2EPKNS0_4NodeE($2, HEAP32[$1 >> 2] | 0); + return $2 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle20NameWithTemplateArgs9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1); + __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE(HEAP32[$0 + 12 >> 2] | 0, $1); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_12NoexceptSpecEJRPNS0_4NodeEEEES9_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle12NoexceptSpecEJRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11PointerTypeEJRPNS2_4NodeEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 12) | 0; + __ZN12_GLOBAL__N_116itanium_demangle11PointerTypeC2EPKNS0_4NodeE($2, HEAP32[$1 >> 2] | 0); + return $2 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_11PointerTypeEJRPNS0_4NodeEEEES9_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle11PointerTypeEJRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN6vision18BinomialPyramid32fD2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 16756; + __ZNSt3__213__vector_baseIfNS_9allocatorIfEEED2Ev($0 + 56 | 0); + __ZNSt3__213__vector_baseIfNS_9allocatorIfEEED2Ev($0 + 44 | 0); + __ZNSt3__213__vector_baseItNS_9allocatorItEEED2Ev($0 + 32 | 0); + __ZN6vision25GaussianScaleSpacePyramidD2Ev($0); + return; +} + +function _abort_message($0, $varargs) { + $0 = $0 | 0; + $varargs = $varargs | 0; + var $1 = 0, $2 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + HEAP32[$1 >> 2] = $varargs; + $2 = HEAP32[4271] | 0; + _vfprintf($2, $0, $1) | 0; + _fputc(10, $2) | 0; + _abort(); +} + +function __ZNK12_GLOBAL__N_116itanium_demangle8QualType9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0; + $3 = HEAP32[$0 + 12 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$3 >> 2] | 0) + 16 >> 2] & 255]($3, $1); + __ZNK12_GLOBAL__N_116itanium_demangle8QualType10printQualsERNS_12OutputStreamE($0, $1); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle21StructuredBindingName9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 91); + __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray14printWithCommaERNS_12OutputStreamE($0 + 8 | 0, $1); + __ZN12_GLOBAL__N_112OutputStreampLEc($1, 93); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle19PointerToMemberTypeC2EPKNS0_4NodeES4_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 13, HEAP8[$2 + 5 >> 0] | 0, 1, 1); + HEAP32[$0 >> 2] = 19892; + HEAP32[$0 + 8 >> 2] = $1; + HEAP32[$0 + 12 >> 2] = $2; + return; +} + +function _ferror($0) { + $0 = $0 | 0; + var $$lobit = 0, $$lobit9 = 0, $phitmp = 0; + if ((HEAP32[$0 + 76 >> 2] | 0) > -1) { + $phitmp = (___lockfile($0) | 0) == 0; + $$lobit = (HEAP32[$0 >> 2] | 0) >>> 5 & 1; + if ($phitmp) $$lobit9 = $$lobit; else $$lobit9 = $$lobit; + } else $$lobit9 = (HEAP32[$0 >> 2] | 0) >>> 5 & 1; + return $$lobit9 | 0; +} + +function __ZNSt3__26vectorIhNS_9allocatorIhEEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0, $3 = 0; + $2 = $0 + 4 | 0; + $$0 = $1; + $3 = HEAP32[$2 >> 2] | 0; + do { + HEAP8[$3 >> 0] = 0; + $3 = (HEAP32[$2 >> 2] | 0) + 1 | 0; + HEAP32[$2 >> 2] = $3; + $$0 = $$0 + -1 | 0; + } while (($$0 | 0) != 0); + return; +} + +function __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEEC2Ev($0) { + $0 = $0 | 0; + var $2 = 0; + HEAP32[$0 >> 2] = 20632; + __ZNSt3__26localeC2Ev($0 + 4 | 0); + $2 = $0 + 8 | 0; + HEAP32[$2 >> 2] = 0; + HEAP32[$2 + 4 >> 2] = 0; + HEAP32[$2 + 8 >> 2] = 0; + HEAP32[$2 + 12 >> 2] = 0; + HEAP32[$2 + 16 >> 2] = 0; + HEAP32[$2 + 20 >> 2] = 0; + return; +} + +function __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEEC2Ev($0) { + $0 = $0 | 0; + var $2 = 0; + HEAP32[$0 >> 2] = 20568; + __ZNSt3__26localeC2Ev($0 + 4 | 0); + $2 = $0 + 8 | 0; + HEAP32[$2 >> 2] = 0; + HEAP32[$2 + 4 >> 2] = 0; + HEAP32[$2 + 8 >> 2] = 0; + HEAP32[$2 + 12 >> 2] = 0; + HEAP32[$2 + 16 >> 2] = 0; + HEAP32[$2 + 20 >> 2] = 0; + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle9ThrowExprEJRPNS2_4NodeEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 12) | 0; + __ZN12_GLOBAL__N_116itanium_demangle9ThrowExprC2EPKNS0_4NodeE($2, HEAP32[$1 >> 2] | 0); + return $2 | 0; +} + +function _ar2GetTriangleArea($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $19 = 0.0, $4 = 0.0, $9 = 0.0; + $4 = +HEAPF32[$0 >> 2]; + $9 = +HEAPF32[$0 + 4 >> 2]; + $19 = ((+HEAPF32[$1 >> 2] - $4) * (+HEAPF32[$2 + 4 >> 2] - $9) - (+HEAPF32[$1 + 4 >> 2] - $9) * (+HEAPF32[$2 >> 2] - $4)) * .5; + return +($19 < 0.0 ? -$19 : $19); +} + +function __ZNSt3__26vectorINS0_INS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEEENS3_IS7_EEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$promoted = 0, $2 = 0; + $2 = $0 + 4 | 0; + $$promoted = HEAP32[$2 >> 2] | 0; + _memset($$promoted | 0, 0, $1 * 12 | 0) | 0; + HEAP32[$2 >> 2] = $$promoted + ($1 * 12 | 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_9ThrowExprEJRPNS0_4NodeEEEES9_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle9ThrowExprEJRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZNSt3__214__split_bufferINS_6vectorINS_4pairIfmEENS_9allocatorIS3_EEEERNS4_IS6_EEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$promoted = 0, $2 = 0; + $2 = $0 + 8 | 0; + $$promoted = HEAP32[$2 >> 2] | 0; + _memset($$promoted | 0, 0, $1 * 12 | 0) | 0; + HEAP32[$2 >> 2] = $$promoted + ($1 * 12 | 0); + return; +} + +function __ZN6vision5ImageC2ERKS0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + HEAP32[$0 + 12 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = 0; + HEAP32[$0 + 20 >> 2] = 0; + HEAP32[$0 + 24 >> 2] = 0; + HEAP32[$0 + 28 >> 2] = 0; + __ZN6vision5Image11shallowCopyERKS0_($0, $1); + return; +} + +function __ZN12_GLOBAL__N_120BumpPointerAllocator5resetEv($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0; + $1 = $0 + 4096 | 0; + while (1) { + $2 = HEAP32[$1 >> 2] | 0; + if (!$2) break; + HEAP32[$1 >> 2] = HEAP32[$2 >> 2]; + if (($0 | 0) != ($2 | 0)) _free($2); + } + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$1 >> 2] = $0; + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8DtorNameEJRPNS2_4NodeEEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 12) | 0; + __ZN12_GLOBAL__N_116itanium_demangle8DtorNameC2EPKNS0_4NodeE($2, HEAP32[$1 >> 2] | 0); + return $2 | 0; +} + +function __ZN6vision14BinarykMedoidsILi96EED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__213__vector_baseIiNS_9allocatorIiEEED2Ev($0 + 48 | 0); + __ZNSt3__213__vector_baseIiNS_9allocatorIiEEED2Ev($0 + 36 | 0); + __ZNSt3__213__vector_baseIiNS_9allocatorIiEEED2Ev($0 + 24 | 0); + __ZNSt3__213__vector_baseIiNS_9allocatorIiEEED2Ev($0 + 12 | 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8DtorNameEJRPNS0_4NodeEEEES9_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8DtorNameEJRPNS2_4NodeEEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function _sprintf($0, $1, $varargs) { + $0 = $0 | 0; + $1 = $1 | 0; + $varargs = $varargs | 0; + var $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + HEAP32[$2 >> 2] = $varargs; + $3 = _vsprintf($0, $1, $2) | 0; + STACKTOP = sp; + return $3 | 0; +} + +function _fprintf($0, $1, $varargs) { + $0 = $0 | 0; + $1 = $1 | 0; + $varargs = $varargs | 0; + var $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + HEAP32[$2 >> 2] = $varargs; + $3 = _vfprintf($0, $1, $2) | 0; + STACKTOP = sp; + return $3 | 0; +} + +function _a_ctz_l_730($0) { + $0 = $0 | 0; + var $$068 = 0, $$07 = 0, $$09 = 0, $4 = 0; + if ($0) if (!($0 & 1)) { + $$068 = $0; + $$09 = 0; + while (1) { + $4 = $$09 + 1 | 0; + if (!($$068 & 2)) { + $$068 = $$068 >>> 1; + $$09 = $4; + } else { + $$07 = $4; + break; + } + } + } else $$07 = 0; else $$07 = 32; + return $$07 | 0; +} + +function __ZN6vision5Timer5startEv($0) { + $0 = $0 | 0; + var $1 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $1 = sp; + _gettimeofday($1 | 0, 0) | 0; + HEAPF64[$0 >> 3] = +(HEAP32[$1 + 4 >> 2] | 0) * 1.0e-06 + +(HEAP32[$1 >> 2] | 0); + STACKTOP = sp; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4lookEj($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $4 = 0; + $4 = HEAP32[$0 >> 2] | 0; + if (((HEAP32[$0 + 4 >> 2] | 0) - $4 | 0) >>> 0 > $1 >>> 0) $$0 = HEAP8[$4 + $1 >> 0] | 0; else $$0 = 0; + return $$0 | 0; +} + +function __ZSt9terminatev() { + var $0 = 0, $2 = 0; + $0 = ___cxa_get_globals_fast() | 0; + if (($0 | 0 ? ($2 = HEAP32[$0 >> 2] | 0, $2 | 0) : 0) ? __ZN10__cxxabiv121__isOurExceptionClassEPK17_Unwind_Exception($2 + 48 | 0) | 0 : 0) __ZSt11__terminatePFvvE(HEAP32[$2 + 12 >> 2] | 0); + __ZSt11__terminatePFvvE(__ZSt13get_terminatev() | 0); +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA18_KcEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA18_KcEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA15_KcEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA15_KcEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA14_KcEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA14_KcEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA13_KcEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA13_KcEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA12_KcEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA12_KcEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA11_KcEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA11_KcEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA10_KcEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA10_KcEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function _sscanf($0, $1, $varargs) { + $0 = $0 | 0; + $1 = $1 | 0; + $varargs = $varargs | 0; + var $2 = 0, $3 = 0, sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + $2 = sp; + HEAP32[$2 >> 2] = $varargs; + $3 = _vsscanf($0, $1, $2) | 0; + STACKTOP = sp; + return $3 | 0; +} + +function _jpeg_abort($0) { + $0 = $0 | 0; + var $2 = 0, $9 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + if (!$2) return; + FUNCTION_TABLE_vii[HEAP32[$2 + 36 >> 2] & 255]($0, 1); + $9 = $0 + 20 | 0; + if (!(HEAP32[$0 + 16 >> 2] | 0)) { + HEAP32[$9 >> 2] = 100; + return; + } else { + HEAP32[$9 >> 2] = 200; + HEAP32[$0 + 312 >> 2] = 0; + return; + } +} + +function __ZNK12_GLOBAL__N_116itanium_demangle4Node11hasFunctionERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $3 = 0; + $3 = HEAP8[$0 + 7 >> 0] | 0; + if ($3 << 24 >> 24 == 2) $$0 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$0 >> 2] | 0) + 8 >> 2] & 127]($0, $1) | 0; else $$0 = $3 << 24 >> 24 == 0; + return $$0 | 0; +} + +function __ZNSt3__212_GLOBAL__N_111__fake_bindC2EMNS_6locale2idEFvvEPS3_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$unpack = 0, $$unpack5 = 0; + $$unpack = HEAP32[$1 >> 2] | 0; + $$unpack5 = HEAP32[$1 + 4 >> 2] | 0; + HEAP32[$0 >> 2] = $2; + HEAP32[$0 + 4 >> 2] = $$unpack; + HEAP32[$0 + 8 >> 2] = $$unpack5; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA9_KcEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA9_KcEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA6_KcEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA6_KcEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA5_KcEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA5_KcEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA4_KcEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA4_KcEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14ManglingParserINS_16DefaultAllocatorEECI2NS0_22AbstractManglingParserIS3_S2_EEEPKcS6_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_EC2EPKcS7_($0, $1, $2); + return; +} + +function __ZNSt3__213__vector_baseI12multi_markerNS_9allocatorIS1_EEED2Ev($this) { + $this = $this | 0; + var $0 = 0, $1 = 0; + $0 = HEAP32[$this >> 2] | 0; + $1 = $0; + if ($0 | 0) { + HEAP32[$this + 4 >> 2] = $1; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($0, (HEAP32[$this + 8 >> 2] | 0) - $1 | 0); + } + return; +} + +function __ZNKSt3__210moneypunctIwLb1EE16do_positive_signEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$0 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + return; +} + +function __ZNKSt3__210moneypunctIwLb0EE16do_positive_signEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$0 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + return; +} + +function __ZNKSt3__210moneypunctIcLb1EE16do_positive_signEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$0 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + return; +} + +function __ZNKSt3__210moneypunctIcLb0EE16do_positive_signEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$0 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E7consumeEv($0) { + $0 = $0 | 0; + var $1 = 0, $7 = 0; + $1 = HEAP32[$0 >> 2] | 0; + if (($1 | 0) == (HEAP32[$0 + 4 >> 2] | 0)) $7 = 0; else { + HEAP32[$0 >> 2] = $1 + 1; + $7 = HEAP8[$1 >> 0] | 0; + } + return $7 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle4Node8hasArrayERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $3 = 0; + $3 = HEAP8[$0 + 6 >> 0] | 0; + if ($3 << 24 >> 24 == 2) $$0 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 127]($0, $1) | 0; else $$0 = $3 << 24 >> 24 == 0; + return $$0 | 0; +} + +function __ZNKSt3__27codecvtIwc11__mbstate_tE13do_max_lengthEv($0) { + $0 = $0 | 0; + var $2 = 0, $4 = 0, $5 = 0, $7 = 0; + $2 = HEAP32[$0 + 8 >> 2] | 0; + if ($2) { + $4 = ___uselocale($2) | 0; + $5 = ___ctype_get_mb_cur_max() | 0; + if (!$4) $7 = $5; else { + ___uselocale($4) | 0; + $7 = $5; + } + } else $7 = 1; + return $7 | 0; +} + +function __ZNKSt3__210moneypunctIwLb1EE14do_curr_symbolEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$0 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + return; +} + +function __ZNKSt3__210moneypunctIwLb0EE14do_curr_symbolEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$0 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + return; +} + +function __ZNKSt3__210moneypunctIcLb1EE14do_curr_symbolEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$0 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + return; +} + +function __ZNKSt3__210moneypunctIcLb0EE14do_curr_symbolEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$0 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle4Node15hasRHSComponentERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $3 = 0; + $3 = HEAP8[$0 + 5 >> 0] | 0; + if ($3 << 24 >> 24 == 2) $$0 = FUNCTION_TABLE_iii[HEAP32[HEAP32[$0 >> 2] >> 2] & 127]($0, $1) | 0; else $$0 = $3 << 24 >> 24 == 0; + return $$0 | 0; +} + +function _arParamLTFree($0) { + $0 = $0 | 0; + var $$0 = 0, $2 = 0; + if (($0 | 0) != 0 ? ($2 = HEAP32[$0 >> 2] | 0, ($2 | 0) != 0) : 0) { + _free(HEAP32[$2 + 184 >> 2] | 0); + _free(HEAP32[(HEAP32[$0 >> 2] | 0) + 188 >> 2] | 0); + _free(HEAP32[$0 >> 2] | 0); + HEAP32[$0 >> 2] = 0; + $$0 = 0; + } else $$0 = -1; + return $$0 | 0; +} + +function __ZNKSt3__210moneypunctIwLb1EE11do_groupingEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$0 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + return; +} + +function __ZNKSt3__210moneypunctIwLb0EE11do_groupingEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$0 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + return; +} + +function __ZNKSt3__210moneypunctIcLb1EE11do_groupingEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$0 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + return; +} + +function __ZNKSt3__210moneypunctIcLb0EE11do_groupingEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0$i$i = 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + $$0$i$i = 0; + while (1) { + if (($$0$i$i | 0) == 3) break; + HEAP32[$0 + ($$0$i$i << 2) >> 2] = 0; + $$0$i$i = $$0$i$i + 1 | 0; + } + return; +} + +function __ZNK12_GLOBAL__N_110StringView9dropFrontEm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0; + $3 = __ZNK12_GLOBAL__N_110StringView4sizeEv($1) | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKcS2_($0, (HEAP32[$1 >> 2] | 0) + ($3 >>> 0 > $2 >>> 0 ? $2 : $3 + -1 | 0) | 0, HEAP32[$1 + 4 >> 2] | 0); + return; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiiNSt3__212basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEE8getTypesEv($this) { + $this = $this | 0; + return __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJiiNSt3__212basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEE3getEv() | 0; +} + +function __ZNSt3__26vectorIiNS_9allocatorIiEEEC2Em($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + if ($1 | 0) { + __ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateEm($0, $1); + __ZNSt3__26vectorIiNS_9allocatorIiEEE18__construct_at_endEm($0, $1); + } + return; +} + +function __ZNSt3__26vectorIfNS_9allocatorIfEEEC2Em($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + if ($1 | 0) { + __ZNSt3__26vectorIfNS_9allocatorIfEEE11__vallocateEm($0, $1); + __ZNSt3__26vectorIfNS_9allocatorIfEEE18__construct_at_endEm($0, $1); + } + return; +} + +function __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $4 = 0, $9 = 0; + $4 = $0; + HEAP32[$4 >> 2] = 0; + HEAP32[$4 + 4 >> 2] = 0; + $9 = $0 + 8 | 0; + HEAP32[$9 >> 2] = -1; + HEAP32[$9 + 4 >> 2] = -1; + return; +} + +function __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $4 = 0, $9 = 0; + $4 = $0; + HEAP32[$4 >> 2] = 0; + HEAP32[$4 + 4 >> 2] = 0; + $9 = $0 + 8 | 0; + HEAP32[$9 >> 2] = -1; + HEAP32[$9 + 4 >> 2] = -1; + return; +} + +function __ZNKSt3__25ctypeIcE8do_widenEPKcS3_Pc($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$07 = 0; + $$0 = $3; + $$07 = $1; + while (1) { + if (($$07 | 0) == ($2 | 0)) break; + HEAP8[$$0 >> 0] = HEAP8[$$07 >> 0] | 0; + $$0 = $$0 + 1 | 0; + $$07 = $$07 + 1 | 0; + } + return $2 | 0; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiNSt3__212basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEE8getTypesEv($this) { + $this = $this | 0; + return __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJiNSt3__212basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEE3getEv() | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle21CtorVtableSpecialNameC2EPKNS0_4NodeES4_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 21, 1, 1, 1); + HEAP32[$0 >> 2] = 20508; + HEAP32[$0 + 8 >> 2] = $1; + HEAP32[$0 + 12 >> 2] = $2; + return; +} + +function __ZNK10__cxxabiv117__class_type_info29process_static_type_below_dstEPNS_19__dynamic_cast_infoEPKvi($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $7 = 0; + if ((HEAP32[$1 + 4 >> 2] | 0) == ($2 | 0) ? ($7 = $1 + 28 | 0, (HEAP32[$7 >> 2] | 0) != 1) : 0) HEAP32[$7 >> 2] = $3; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8BoolExprEJiEEEPNS0_4NodeEDpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8BoolExprEJiEEEPT_DpOT0_($0 + 368 | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8BoolExprEJiEEEPT_DpOT0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, 12) | 0; + __ZN12_GLOBAL__N_116itanium_demangle8BoolExprC2Eb($2, (HEAP32[$1 >> 2] | 0) != 0); + return $2 | 0; +} + +function __ZNSt3__26vectorINS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$promoted = 0, $2 = 0; + $2 = $0 + 4 | 0; + $$promoted = HEAP32[$2 >> 2] | 0; + _memset($$promoted | 0, 0, $1 * 12 | 0) | 0; + HEAP32[$2 >> 2] = $$promoted + ($1 * 12 | 0); + return; +} + +function __ZNSt3__213__vector_baseIPKN6vision4NodeILi96EEENS_9allocatorIS5_EEED2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0; + $1 = HEAP32[$0 >> 2] | 0; + $3 = $1; + if ($1 | 0) { + HEAP32[$0 + 4 >> 2] = $3; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($1, (HEAP32[$0 + 8 >> 2] | 0) - $3 | 0); + } + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle20NameWithTemplateArgsC2EPNS0_4NodeES3_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 32, 1, 1, 1); + HEAP32[$0 >> 2] = 17824; + HEAP32[$0 + 8 >> 2] = $1; + HEAP32[$0 + 12 >> 2] = $2; + return; +} + +function _arVecAlloc($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0, $4 = 0; + $1 = _malloc(8) | 0; + do if ($1) { + $4 = _malloc($0 << 3) | 0; + HEAP32[$1 >> 2] = $4; + if (!$4) { + _free($1); + $$0 = 0; + break; + } else { + HEAP32[$1 + 4 >> 2] = $0; + $$0 = $1; + break; + } + } else $$0 = 0; while (0); + return $$0 | 0; +} + +function __ZNSt3__213__vector_baseIPN6vision4NodeILi96EEENS_9allocatorIS4_EEED2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0; + $1 = HEAP32[$0 >> 2] | 0; + $3 = $1; + if ($1 | 0) { + HEAP32[$0 + 4 >> 2] = $3; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($1, (HEAP32[$0 + 8 >> 2] | 0) - $3 | 0); + } + return; +} + +function __ZNKSt3__25ctypeIwE8do_widenEPKcS3_Pw($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $$0 = 0, $$07 = 0; + $$0 = $3; + $$07 = $1; + while (1) { + if (($$07 | 0) == ($2 | 0)) break; + HEAP32[$$0 >> 2] = HEAP8[$$07 >> 0]; + $$0 = $$0 + 4 | 0; + $$07 = $$07 + 1 | 0; + } + return $2 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle18ArraySubscriptExprC2EPKNS0_4NodeES4_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 43, 1, 1, 1); + HEAP32[$0 >> 2] = 18836; + HEAP32[$0 + 8 >> 2] = $1; + HEAP32[$0 + 12 >> 2] = $2; + return; +} + +function __ZNSt3__28ios_baseD2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 20552; + __ZNSt3__28ios_base16__call_callbacksENS0_5eventE($0, 0); + __ZNSt3__26localeD2Ev($0 + 28 | 0); + _free(HEAP32[$0 + 32 >> 2] | 0); + _free(HEAP32[$0 + 36 >> 2] | 0); + _free(HEAP32[$0 + 48 >> 2] | 0); + _free(HEAP32[$0 + 60 >> 2] | 0); + return; +} + +function __ZN6vision25GaussianScaleSpacePyramidC2Ev($0) { + $0 = $0 | 0; + var $1 = 0; + HEAP32[$0 >> 2] = 16772; + $1 = $0 + 4 | 0; + HEAP32[$1 >> 2] = 0; + HEAP32[$1 + 4 >> 2] = 0; + HEAP32[$1 + 8 >> 2] = 0; + HEAP32[$1 + 12 >> 2] = 0; + HEAP32[$1 + 16 >> 2] = 0; + HEAP32[$1 + 20 >> 2] = 0; + HEAP32[$1 + 24 >> 2] = 0; + return; +} + +function __ZN6vision10numOctavesEiii($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0, $$010 = 0, $$09 = 0; + $$0 = 0; + $$010 = $1; + $$09 = $0; + while (1) { + if (($$010 | 0) < ($2 | 0) | ($$09 | 0) < ($2 | 0)) break; + $$0 = $$0 + 1 | 0; + $$010 = $$010 >> 1; + $$09 = $$09 >> 1; + } + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle24ForwardTemplateReferenceC2Em($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 31, 2, 2, 2); + HEAP32[$0 >> 2] = 19452; + HEAP32[$0 + 8 >> 2] = $1; + HEAP32[$0 + 12 >> 2] = 0; + HEAP8[$0 + 16 >> 0] = 0; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA22_KcEEEPNS0_4NodeEDpOT0_($0) { + $0 = $0 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA22_KcEEEPT_DpOT0_($0 + 368 | 0, 53518) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA19_KcEEEPNS0_4NodeEDpOT0_($0) { + $0 = $0 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA19_KcEEEPT_DpOT0_($0 + 368 | 0, 56107) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA16_KcEEEPNS0_4NodeEDpOT0_($0) { + $0 = $0 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA16_KcEEEPT_DpOT0_($0 + 368 | 0, 54302) | 0; +} + +function _testSetjmp(id, table, size) { + id = id | 0; + table = table | 0; + size = size | 0; + var i = 0, curr = 0; + while ((i | 0) < (size | 0)) { + curr = HEAP32[table + (i << 3) >> 2] | 0; + if (!curr) break; + if ((curr | 0) == (id | 0)) return HEAP32[table + ((i << 3) + 4) >> 2] | 0; + i = i + 1 | 0; + } + return 0; +} + +function __ZNSt3__213__vector_baseIN6vision7Point3dIfEENS_9allocatorIS3_EEED2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0; + $1 = HEAP32[$0 >> 2] | 0; + $3 = $1; + if ($1 | 0) { + HEAP32[$0 + 4 >> 2] = $3; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($1, (HEAP32[$0 + 8 >> 2] | 0) - $3 | 0); + } + return; +} + +function __ZNSt3__213__vector_baseIN6vision7Point2dIfEENS_9allocatorIS3_EEED2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0; + $1 = HEAP32[$0 >> 2] | 0; + $3 = $1; + if ($1 | 0) { + HEAP32[$0 + 4 >> 2] = $3; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($1, (HEAP32[$0 + 8 >> 2] | 0) - $3 | 0); + } + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA8_KcEEEPNS0_4NodeEDpOT0_($0) { + $0 = $0 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA8_KcEEEPT_DpOT0_($0 + 368 | 0, 52254) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E4makeINS0_8NameTypeEJRA7_KcEEEPNS0_4NodeEDpOT0_($0) { + $0 = $0 | 0; + return __ZN12_GLOBAL__N_116DefaultAllocator8makeNodeINS_16itanium_demangle8NameTypeEJRA7_KcEEEPT_DpOT0_($0 + 368 | 0, 57172) | 0; +} + +function __ZNSt3__213unordered_mapIjjNS_4hashIjEENS_8equal_toIjEENS_9allocatorINS_4pairIKjjEEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__212__hash_tableINS_17__hash_value_typeIjjEENS_22__unordered_map_hasherIjS2_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS2_NS_8equal_toIjEELb1EEENS_9allocatorIS2_EEED2Ev($0); + return; +} + +function __ZNSt3__213__vector_baseIN6vision7match_tENS_9allocatorIS2_EEED2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0; + $1 = HEAP32[$0 >> 2] | 0; + $3 = $1; + if ($1 | 0) { + HEAP32[$0 + 4 >> 2] = $3; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($1, (HEAP32[$0 + 8 >> 2] | 0) - $3 | 0); + } + return; +} + +function __ZN6vision21HoughSimilarityVotingD2Ev($0) { + $0 = $0 | 0; + __ZNSt3__213__vector_baseIiNS_9allocatorIiEEED2Ev($0 + 124 | 0); + __ZNSt3__213__vector_baseIfNS_9allocatorIfEEED2Ev($0 + 112 | 0); + __ZNSt3__213unordered_mapIjjNS_4hashIjEENS_8equal_toIjEENS_9allocatorINS_4pairIKjjEEEEED2Ev($0 + 92 | 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle13QualifiedNameC2EPKNS0_4NodeES4_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 22, 1, 1, 1); + HEAP32[$0 >> 2] = 19100; + HEAP32[$0 + 8 >> 2] = $1; + HEAP32[$0 + 12 >> 2] = $2; + return; +} + +function dynCall_iiiiiiiii(index, a1, a2, a3, a4, a5, a6, a7, a8) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + a3 = a3 | 0; + a4 = a4 | 0; + a5 = a5 | 0; + a6 = a6 | 0; + a7 = a7 | 0; + a8 = a8 | 0; + return FUNCTION_TABLE_iiiiiiiii[index & 15](a1 | 0, a2 | 0, a3 | 0, a4 | 0, a5 | 0, a6 | 0, a7 | 0, a8 | 0) | 0; +} + +function __ZN6vision13LinePointSideIfEET_PKS1_S3_S3_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $4 = 0.0, $9 = 0.0; + $4 = +HEAPF32[$0 >> 2]; + $9 = +HEAPF32[$0 + 4 >> 2]; + return +((+HEAPF32[$1 >> 2] - $4) * (+HEAPF32[$2 + 4 >> 2] - $9) - (+HEAPF32[$1 + 4 >> 2] - $9) * (+HEAPF32[$2 >> 2] - $4)); +} + +function __ZNSt3__219__shared_weak_count14__release_weakEv($0) { + $0 = $0 | 0; + var $1 = 0, $7 = 0; + $1 = $0 + 8 | 0; + if ((HEAP32[$1 >> 2] | 0) != 0 ? ($7 = HEAP32[$1 >> 2] | 0, HEAP32[$1 >> 2] = $7 + -1, ($7 | 0) != 0) : 0) {} else FUNCTION_TABLE_vi[HEAP32[(HEAP32[$0 >> 2] | 0) + 16 >> 2] & 255]($0); + return; +} + +function __ZN53EmscriptenBindingInitializer_native_and_builtin_typesC2Ev($0) { + $0 = $0 | 0; + var sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + HEAP32[sp >> 2] = $0; + ___embind_register_native_and_builtin_types(); + STACKTOP = sp; + return; +} + +function __ZNSt3__213__vector_baseINS_4pairIfmEENS_9allocatorIS2_EEED2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0; + $1 = HEAP32[$0 >> 2] | 0; + $3 = $1; + if ($1 | 0) { + HEAP32[$0 + 4 >> 2] = $3; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($1, (HEAP32[$0 + 8 >> 2] | 0) - $3 | 0); + } + return; +} + +function __ZNSt3__213__vector_baseINS_4pairIfiEENS_9allocatorIS2_EEED2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0; + $1 = HEAP32[$0 >> 2] | 0; + $3 = $1; + if ($1 | 0) { + HEAP32[$0 + 4 >> 2] = $3; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($1, (HEAP32[$0 + 8 >> 2] | 0) - $3 | 0); + } + return; +} + +function __ZNKSt3__28messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $8 = 0; + $8 = _catopen((HEAP8[$1 + 11 >> 0] | 0) < 0 ? HEAP32[$1 >> 2] | 0 : $1, 1) | 0; + return $8 >>> (($8 | 0) != (-1 | 0) & 1) | 0; +} + +function __ZNKSt3__28messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $8 = 0; + $8 = _catopen((HEAP8[$1 + 11 >> 0] | 0) < 0 ? HEAP32[$1 >> 2] | 0 : $1, 1) | 0; + return $8 >>> (($8 | 0) != (-1 | 0) & 1) | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle4Node5printERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 16 >> 2] & 255]($0, $1); + if ((HEAP8[$0 + 5 >> 0] | 0) != 1) FUNCTION_TABLE_vii[HEAP32[(HEAP32[$0 >> 2] | 0) + 20 >> 2] & 255]($0, $1); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + HEAP32[$0 >> 2] = 17604; + HEAP8[$0 + 4 >> 0] = $1; + HEAP8[$0 + 5 >> 0] = $2; + HEAP8[$0 + 6 >> 0] = $3; + HEAP8[$0 + 7 >> 0] = $4; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle10NestedNameC2EPNS0_4NodeES3_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 23, 1, 1, 1); + HEAP32[$0 >> 2] = 19848; + HEAP32[$0 + 8 >> 2] = $1; + HEAP32[$0 + 12 >> 2] = $2; + return; +} + +function __ZNSt3__214__split_bufferINS_4pairIfiEERNS_9allocatorIS2_EEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$promoted = 0, $2 = 0; + $2 = $0 + 8 | 0; + $$promoted = HEAP32[$2 >> 2] | 0; + _memset($$promoted | 0, 0, $1 << 3 | 0) | 0; + HEAP32[$2 >> 2] = $$promoted + ($1 << 3); + return; +} + +function __ZNKSt3__28numpunctIwE12do_falsenameEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm($0, 23432, __ZNSt3__211char_traitsIwE6lengthEPKw(23432) | 0); + return; +} + +function __ZNKSt3__28numpunctIcE12do_falsenameEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm($0, 61026, __ZNSt3__211char_traitsIcE6lengthEPKc(61026) | 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle9LocalNameC2EPNS0_4NodeES3_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 24, 1, 1, 1); + HEAP32[$0 >> 2] = 19716; + HEAP32[$0 + 8 >> 2] = $1; + HEAP32[$0 + 12 >> 2] = $2; + return; +} + +function _get_buff_380($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0; + L1 : while (1) { + $2 = _fgets($0, 256, $1) | 0; + if (!$2) { + $$0 = 0; + break; + } + switch (HEAP8[$0 >> 0] | 0) { + case 35: + case 10: + break; + default: + { + $$0 = $2; + break L1; + } + } + } + return $$0 | 0; +} + +function _get_buff_345($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $2 = 0; + L1 : while (1) { + $2 = _fgets($0, 256, $1) | 0; + if (!$2) { + $$0 = 0; + break; + } + switch (HEAP8[$0 >> 0] | 0) { + case 35: + case 10: + break; + default: + { + $$0 = $2; + break L1; + } + } + } + return $$0 | 0; +} + +function __ZNKSt3__28numpunctIwE11do_truenameEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm($0, 23456, __ZNSt3__211char_traitsIwE6lengthEPKw(23456) | 0); + return; +} + +function __ZNKSt3__28numpunctIcE11do_truenameEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm($0, 61032, __ZNSt3__211char_traitsIcE6lengthEPKc(61032) | 0); + return; +} + +function __ZN6vision20VisualDatabaseFacadeC2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0; + HEAP32[$0 >> 2] = 0; + $1 = __Znwm(24) | 0; + __ZN6vision18VisualDatabaseImplC2Ev($1); + $2 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = $1; + if ($2 | 0) { + __ZN6vision18VisualDatabaseImplD2Ev($2); + __ZdlPv($2); + } + return; +} + +function __ZN6vision23bilinear_upsample_pointERfS0_ffi($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = +$2; + $3 = +$3; + $4 = $4 | 0; + var $10 = 0.0, $8 = 0.0; + $8 = +_ldexp(1.0, $4 + -1 | 0) + -.5; + $10 = +(1 << $4 | 0); + HEAPF32[$0 >> 2] = $10 * $2 + $8; + HEAPF32[$1 >> 2] = $10 * $3 + $8; + return; +} + +function __ZN6vision18BinomialPyramid32fC2Ev($0) { + $0 = $0 | 0; + var dest = 0, stop = 0; + __ZN6vision25GaussianScaleSpacePyramidC2Ev($0); + HEAP32[$0 >> 2] = 16756; + dest = $0 + 32 | 0; + stop = dest + 36 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + return; +} + +function _arMatrixAllocMulf($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $6 = 0; + $6 = _arMatrixAllocf(HEAP32[$0 + 4 >> 2] | 0, HEAP32[$1 + 8 >> 2] | 0) | 0; + if ($6) if ((_arMatrixMulf($6, $0, $1) | 0) < 0) { + _arMatrixFreef($6) | 0; + $$0 = 0; + } else $$0 = $6; else $$0 = 0; + return $$0 | 0; +} + +function __ZNSt3__26vectorINS_4pairIfiEENS_9allocatorIS2_EEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$promoted = 0, $2 = 0; + $2 = $0 + 4 | 0; + $$promoted = HEAP32[$2 >> 2] | 0; + _memset($$promoted | 0, 0, $1 << 3 | 0) | 0; + HEAP32[$2 >> 2] = $$promoted + ($1 << 3); + return; +} + +function __ZN6vision11CopyVector9IfEEvPT_PKS1_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var dest = 0, src = 0, stop = 0; + dest = $0; + src = $1; + stop = dest + 36 | 0; + do { + HEAP32[dest >> 2] = HEAP32[src >> 2]; + dest = dest + 4 | 0; + src = src + 4 | 0; + } while ((dest | 0) < (stop | 0)); + return; +} + +function _arMatrixAllocMul($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $6 = 0; + $6 = _arMatrixAlloc(HEAP32[$0 + 4 >> 2] | 0, HEAP32[$1 + 8 >> 2] | 0) | 0; + if ($6) if ((_arMatrixMul($6, $0, $1) | 0) < 0) { + _arMatrixFree($6) | 0; + $$0 = 0; + } else $$0 = $6; else $$0 = 0; + return $$0 | 0; +} + +function _reset_marker_reader($0) { + $0 = $0 | 0; + var $2 = 0; + $2 = HEAP32[$0 + 464 >> 2] | 0; + HEAP32[$0 + 216 >> 2] = 0; + HEAP32[$0 + 144 >> 2] = 0; + HEAP32[$0 + 440 >> 2] = 0; + HEAP32[$2 + 12 >> 2] = 0; + HEAP32[$2 + 16 >> 2] = 0; + HEAP32[$2 + 24 >> 2] = 0; + HEAP32[$2 + 164 >> 2] = 0; + return; +} + +function __ZNSt3__213__vector_baseItNS_9allocatorItEEED2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0; + $1 = HEAP32[$0 >> 2] | 0; + $3 = $1; + if ($1 | 0) { + HEAP32[$0 + 4 >> 2] = $3; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($1, (HEAP32[$0 + 8 >> 2] | 0) - $3 | 0); + } + return; +} + +function __ZNSt3__213__vector_baseIiNS_9allocatorIiEEED2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0; + $1 = HEAP32[$0 >> 2] | 0; + $3 = $1; + if ($1 | 0) { + HEAP32[$0 + 4 >> 2] = $3; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($1, (HEAP32[$0 + 8 >> 2] | 0) - $3 | 0); + } + return; +} + +function __ZNSt3__213__vector_baseIhNS_9allocatorIhEEED2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0; + $1 = HEAP32[$0 >> 2] | 0; + $3 = $1; + if ($1 | 0) { + HEAP32[$0 + 4 >> 2] = $3; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($1, (HEAP32[$0 + 8 >> 2] | 0) - $3 | 0); + } + return; +} + +function __ZNSt3__213__vector_baseIfNS_9allocatorIfEEED2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0; + $1 = HEAP32[$0 >> 2] | 0; + $3 = $1; + if ($1 | 0) { + HEAP32[$0 + 4 >> 2] = $3; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($1, (HEAP32[$0 + 8 >> 2] | 0) - $3 | 0); + } + return; +} + +function __ZN6vision13Similarity2x2IfEEvPT_S1_S1_($0, $1, $2) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + var $4 = 0.0, $6 = 0.0; + $4 = +Math_cos(+$1) * $2; + $6 = +Math_sin(+$1) * $2; + HEAPF32[$0 >> 2] = $4; + HEAPF32[$0 + 4 >> 2] = -$6; + HEAPF32[$0 + 8 >> 2] = $6; + HEAPF32[$0 + 12 >> 2] = $4; + return; +} + +function __ZNSt3__214__split_bufferItRNS_9allocatorItEEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$promoted = 0, $2 = 0; + $2 = $0 + 8 | 0; + $$promoted = HEAP32[$2 >> 2] | 0; + _memset($$promoted | 0, 0, $1 << 1 | 0) | 0; + HEAP32[$2 >> 2] = $$promoted + ($1 << 1); + return; +} + +function __ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$promoted = 0, $2 = 0; + $2 = $0 + 8 | 0; + $$promoted = HEAP32[$2 >> 2] | 0; + _memset($$promoted | 0, 0, $1 << 2 | 0) | 0; + HEAP32[$2 >> 2] = $$promoted + ($1 << 2); + return; +} + +function __ZNSt3__214__split_bufferIfRNS_9allocatorIfEEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$promoted = 0, $2 = 0; + $2 = $0 + 8 | 0; + $$promoted = HEAP32[$2 >> 2] | 0; + _memset($$promoted | 0, 0, $1 << 2 | 0) | 0; + HEAP32[$2 >> 2] = $$promoted + ($1 << 2); + return; +} + +function __ZN12_GLOBAL__N_112OutputStreampLEc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $3 = 0, $4 = 0; + __ZN12_GLOBAL__N_112OutputStream4growEm($0, 1); + $2 = HEAP32[$0 >> 2] | 0; + $3 = $0 + 4 | 0; + $4 = HEAP32[$3 >> 2] | 0; + HEAP32[$3 >> 2] = $4 + 1; + HEAP8[$2 + $4 >> 0] = $1; + return; +} + +function __ZNSt3__214__num_get_base10__get_baseERNS_8ios_baseE($0) { + $0 = $0 | 0; + var $$0 = 0; + switch (HEAP32[$0 + 4 >> 2] & 74) { + case 64: + { + $$0 = 8; + break; + } + case 8: + { + $$0 = 16; + break; + } + case 0: + { + $$0 = 0; + break; + } + default: + $$0 = 10; + } + return $$0 | 0; +} + +function __ZN6vision25bilinear_downsample_pointERfS0_ffi($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = +$2; + $3 = +$3; + $4 = $4 | 0; + var $7 = 0.0, $9 = 0.0; + $7 = 1.0 / +(1 << $4 | 0); + $9 = $7 * .5 + -.5; + HEAPF32[$0 >> 2] = $7 * $2 + $9; + HEAPF32[$1 >> 2] = $7 * $3 + $9; + return; +} + +function __ZN6vision17HammingDistance32Ejj($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $5 = 0, $9 = 0; + $2 = $1 ^ $0; + $5 = $2 - ($2 >>> 1 & 1431655765) | 0; + $9 = ($5 >>> 2 & 858993459) + ($5 & 858993459) | 0; + return (Math_imul(($9 >>> 4) + $9 & 252645135, 16843009) | 0) >>> 24 | 0; +} + +function __ZN6vision9MaxIndex4IfEEiPKT_($0) { + $0 = $0 | 0; + var $$0 = 0, $$1 = 0; + $$0 = +HEAPF32[$0 + 4 >> 2] > +HEAPF32[$0 >> 2] & 1; + $$1 = +HEAPF32[$0 + 8 >> 2] > +HEAPF32[$0 + ($$0 << 2) >> 2] ? 2 : $$0; + return (+HEAPF32[$0 + 12 >> 2] > +HEAPF32[$0 + ($$1 << 2) >> 2] ? 3 : $$1) | 0; +} + +function __ZN6vision12FeaturePointC2Effffb($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + $3 = +$3; + $4 = +$4; + $5 = $5 | 0; + HEAPF32[$0 >> 2] = $1; + HEAPF32[$0 + 4 >> 2] = $2; + HEAPF32[$0 + 8 >> 2] = $3; + HEAPF32[$0 + 12 >> 2] = $4; + HEAP8[$0 + 16 >> 0] = $5 & 1; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle27ExpandedSpecialSubstitutionC2ENS0_14SpecialSubKindE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 35, 1, 1, 1); + HEAP32[$0 >> 2] = 19804; + HEAP32[$0 + 8 >> 2] = $1; + return; +} + +function _ftell($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0, $2 = 0, $8 = 0; + $1 = ___ftello($0) | 0; + $2 = getTempRet0() | 0; + if (($2 | 0) > 0 | ($2 | 0) == 0 & $1 >>> 0 > 2147483647) { + $8 = ___errno_location() | 0; + HEAP32[$8 >> 2] = 61; + $$0 = -1; + } else $$0 = $1; + return $$0 | 0; +} + +function __ZNKSt3__25ctypeIwE5do_isEtw($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $5 = 0, $9 = 0; + if ($2 >>> 0 < 128) { + $5 = (__ZNSt3__25ctypeIcE13classic_tableEv() | 0) + ($2 << 1) | 0; + $9 = (HEAP16[$5 >> 1] & $1) << 16 >> 16 != 0; + } else $9 = 0; + return $9 | 0; +} + +function _finish_output_pass($0) { + $0 = $0 | 0; + var $10 = 0, $2 = 0; + $2 = HEAP32[$0 + 444 >> 2] | 0; + if (HEAP32[$0 + 84 >> 2] | 0) FUNCTION_TABLE_vi[HEAP32[(HEAP32[$0 + 484 >> 2] | 0) + 8 >> 2] & 255]($0); + $10 = $2 + 12 | 0; + HEAP32[$10 >> 2] = (HEAP32[$10 >> 2] | 0) + 1; + return; +} + +function __ZNSt3__26vectorItNS_9allocatorItEEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$promoted = 0, $2 = 0; + $2 = $0 + 4 | 0; + $$promoted = HEAP32[$2 >> 2] | 0; + _memset($$promoted | 0, 0, $1 << 1 | 0) | 0; + HEAP32[$2 >> 2] = $$promoted + ($1 << 1); + return; +} + +function __ZNSt3__26vectorIiNS_9allocatorIiEEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$promoted = 0, $2 = 0; + $2 = $0 + 4 | 0; + $$promoted = HEAP32[$2 >> 2] | 0; + _memset($$promoted | 0, 0, $1 << 2 | 0) | 0; + HEAP32[$2 >> 2] = $$promoted + ($1 << 2); + return; +} + +function __ZNSt3__26vectorIfNS_9allocatorIfEEE18__construct_at_endEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$promoted = 0, $2 = 0; + $2 = $0 + 4 | 0; + $$promoted = HEAP32[$2 >> 2] | 0; + _memset($$promoted | 0, 0, $1 << 2 | 0) | 0; + HEAP32[$2 >> 2] = $$promoted + ($1 << 2); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle11PointerTypeC2EPKNS0_4NodeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 11, HEAP8[$1 + 5 >> 0] | 0, 1, 1); + HEAP32[$0 >> 2] = 17780; + HEAP32[$0 + 8 >> 2] = $1; + return; +} + +function dynCall_iiiiiiii(index, a1, a2, a3, a4, a5, a6, a7) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + a3 = a3 | 0; + a4 = a4 | 0; + a5 = a5 | 0; + a6 = a6 | 0; + a7 = a7 | 0; + return FUNCTION_TABLE_iiiiiiii[index & 7](a1 | 0, a2 | 0, a3 | 0, a4 | 0, a5 | 0, a6 | 0, a7 | 0) | 0; +} + +function _arMatrixAllocTransf($0) { + $0 = $0 | 0; + var $$0 = 0, $5 = 0; + $5 = _arMatrixAllocf(HEAP32[$0 + 8 >> 2] | 0, HEAP32[$0 + 4 >> 2] | 0) | 0; + if ($5) if ((_arMatrixTransf($5, $0) | 0) < 0) { + _arMatrixFreef($5) | 0; + $$0 = 0; + } else $$0 = $5; else $$0 = 0; + return $$0 | 0; +} + +function __ZNSt3__27codecvtIwc11__mbstate_tED2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0; + HEAP32[$0 >> 2] = 23240; + $1 = $0 + 8 | 0; + $2 = HEAP32[$1 >> 2] | 0; + if (($2 | 0) != (__ZNSt3__26__clocEv() | 0)) _freelocale(HEAP32[$1 >> 2] | 0); + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZN6vision21OrientationAssignmentC2Ev($0) { + $0 = $0 | 0; + var dest = 0, stop = 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + dest = $0 + 12 | 0; + stop = dest + 40 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + return; +} + +function __ZNKSt3__25ctypeIcE10do_tolowerEc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $5 = 0, $8 = 0; + if ($1 << 24 >> 24 > -1) { + $5 = (__ZNSt3__25ctypeIcE21__classic_lower_tableEv() | 0) + ($1 << 24 >> 24 << 2) | 0; + $8 = HEAP32[$5 >> 2] & 255; + } else $8 = $1; + return $8 | 0; +} + +function __ZN12arControllerD2Ev($this) { + $this = $this | 0; + __ZNSt3__213__vector_baseI12multi_markerNS_9allocatorIS1_EEED2Ev($this + 328 | 0); + __ZNSt3__213unordered_mapIiP14AR2SurfaceSetTNS_4hashIiEENS_8equal_toIiEENS_9allocatorINS_4pairIKiS2_EEEEED2Ev($this + 288 | 0); + return; +} + +function __ZN12_GLOBAL__N_120BumpPointerAllocator4growEv($0) { + $0 = $0 | 0; + var $1 = 0, $3 = 0; + $1 = _malloc(4096) | 0; + if (!$1) __ZSt9terminatev(); else { + $3 = $0 + 4096 | 0; + HEAP32[$1 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$1 + 4 >> 2] = 0; + HEAP32[$3 >> 2] = $1; + return; + } +} + +function __ZNK12_GLOBAL__N_116itanium_demangle20TemplateArgumentPack11getElementsEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $8 = 0, $9 = 0; + $3 = $1 + 8 | 0; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $0; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle19SpecialSubstitutionC2ENS0_14SpecialSubKindE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 36, 1, 1, 1); + HEAP32[$0 >> 2] = 17648; + HEAP32[$0 + 8 >> 2] = $1; + return; +} + +function _wmemset($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$056 = 0, $$07 = 0; + if ($2 | 0) { + $$056 = $2; + $$07 = $0; + while (1) { + $$056 = $$056 + -1 | 0; + HEAP32[$$07 >> 2] = $1; + if (!$$056) break; else $$07 = $$07 + 4 | 0; + } + } + return $0 | 0; +} + +function _arMatrixAllocTrans($0) { + $0 = $0 | 0; + var $$0 = 0, $5 = 0; + $5 = _arMatrixAlloc(HEAP32[$0 + 8 >> 2] | 0, HEAP32[$0 + 4 >> 2] | 0) | 0; + if ($5) if ((_arMatrixTrans($5, $0) | 0) < 0) { + _arMatrixFree($5) | 0; + $$0 = 0; + } else $$0 = $5; else $$0 = 0; + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EED2Ev($0) { + $0 = $0 | 0; + if (!(__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EE8isInlineEv($0) | 0)) _free(HEAP32[$0 >> 2] | 0); + return; +} + +function __ZNSt3__220__shared_ptr_pointerIPN6vision8KeyframeILi96EEENS_14default_deleteIS3_EENS_9allocatorIS3_EEE16__on_zero_sharedEv($0) { + $0 = $0 | 0; + var $2 = 0; + $2 = HEAP32[$0 + 12 >> 2] | 0; + if ($2 | 0) { + __ZN6vision8KeyframeILi96EED2Ev($2); + __ZdlPv($2); + } + return; +} + +function __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev($0) { + $0 = $0 | 0; + var $1 = 0; + $1 = $0 + 8 | 0; + if ((HEAP8[$1 + 3 >> 0] | 0) < 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$0 >> 2] | 0, HEAP32[$1 >> 2] << 2); + return; +} + +function __ZNKSt3__27codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + HEAP32[$4 >> 2] = $2; + HEAP32[$7 >> 2] = $5; + return 3; +} + +function __ZNSt3__2lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZNSt3__224__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m($0, $1, __ZNSt3__211char_traitsIcE6lengthEPKc($1) | 0) | 0; +} + +function __ZNKSt3__27codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_($0, $1, $2, $3, $4, $5, $6, $7) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + $6 = $6 | 0; + $7 = $7 | 0; + HEAP32[$4 >> 2] = $2; + HEAP32[$7 >> 2] = $5; + return 3; +} + +function __ZNKSt3__25ctypeIcE10do_toupperEc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $5 = 0, $8 = 0; + if ($1 << 24 >> 24 > -1) { + $5 = (__ZNSt3__25ctypeIcE21__classic_upper_tableEv() | 0) + (($1 & 255) << 2) | 0; + $8 = HEAP32[$5 >> 2] & 255; + } else $8 = $1; + return $8 | 0; +} + +function _arPattFree($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $4 = 0; + $4 = (HEAP32[$0 + 8 >> 2] | 0) + ($1 << 2) | 0; + if (!(HEAP32[$4 >> 2] | 0)) $$0 = -1; else { + HEAP32[$4 >> 2] = 0; + HEAP32[$0 >> 2] = (HEAP32[$0 >> 2] | 0) + -1; + $$0 = 1; + } + return $$0 | 0; +} + +function __ZNSt3__211__call_onceERVmPvPFvS2_E($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + do {} while ((HEAP32[$0 >> 2] | 0) == 1); + if (!(HEAP32[$0 >> 2] | 0)) { + HEAP32[$0 >> 2] = 1; + FUNCTION_TABLE_vi[$2 & 255]($1); + HEAP32[$0 >> 2] = -1; + } else {} + return; +} + +function _bitshift64Shl(low, high, bits) { + low = low | 0; + high = high | 0; + bits = bits | 0; + if ((bits | 0) < 32) { + setTempRet0(high << bits | (low & (1 << bits) - 1 << 32 - bits) >>> 32 - bits | 0); + return low << bits; + } + setTempRet0(low << bits - 32 | 0); + return 0; +} + +function _arMatrixAllocDup($0) { + $0 = $0 | 0; + var $$0 = 0, $5 = 0; + $5 = _arMatrixAlloc(HEAP32[$0 + 4 >> 2] | 0, HEAP32[$0 + 8 >> 2] | 0) | 0; + if ($5) if ((_arMatrixDup($5, $0) | 0) < 0) { + _arMatrixFree($5) | 0; + $$0 = 0; + } else $$0 = $5; else $$0 = 0; + return $$0 | 0; +} + +function __ZN6vision14BinarykMedoidsILi96EEC2ERi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var dest = 0, stop = 0; + HEAP32[$0 >> 2] = $1; + dest = $0 + 4 | 0; + stop = dest + 56 | 0; + do { + HEAP32[dest >> 2] = 0; + dest = dest + 4 | 0; + } while ((dest | 0) < (stop | 0)); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22ParameterPackExpansionC2EPKNS0_4NodeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 29, 1, 1, 1); + HEAP32[$0 >> 2] = 18484; + HEAP32[$0 + 8 >> 2] = $1; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EEixEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return (__ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EE5beginEv($0) | 0) + ($1 << 2) | 0; +} + +function __ZN6vision16RobustHomographyIfED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__213__vector_baseINS_4pairIfiEENS_9allocatorIS2_EEED2Ev($0 + 24 | 0); + __ZNSt3__213__vector_baseIiNS_9allocatorIiEEED2Ev($0 + 12 | 0); + __ZNSt3__213__vector_baseIfNS_9allocatorIfEEED2Ev($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22ConversionOperatorTypeC2EPKNS0_4NodeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 4, 1, 1, 1); + HEAP32[$0 >> 2] = 19012; + HEAP32[$0 + 8 >> 2] = $1; + return; +} + +function dynCall_viiiiiii(index, a1, a2, a3, a4, a5, a6, a7) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + a3 = a3 | 0; + a4 = a4 | 0; + a5 = a5 | 0; + a6 = a6 | 0; + a7 = a7 | 0; + FUNCTION_TABLE_viiiiiii[index & 7](a1 | 0, a2 | 0, a3 | 0, a4 | 0, a5 | 0, a6 | 0, a7 | 0); +} + +function __ZN12_GLOBAL__N_116itanium_demangle19SizeofParamPackExprC2EPKNS0_4NodeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 49, 1, 1, 1); + HEAP32[$0 >> 2] = 18440; + HEAP32[$0 + 8 >> 2] = $1; + return; +} + +function _ar2GetRegionArea($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $5 = 0, $6 = 0.0; + $5 = $0 + ($2 << 3) | 0; + $6 = +_ar2GetTriangleArea($0, $0 + ($1 << 3) | 0, $5); + return +($6 + +_ar2GetTriangleArea($0, $5, $0 + ($3 << 3) | 0)); +} + +function __ZN12_GLOBAL__N_116itanium_demangle19GlobalQualifiedNameC2EPNS0_4NodeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 33, 1, 1, 1); + HEAP32[$0 >> 2] = 18924; + HEAP32[$0 + 8 >> 2] = $1; + return; +} + +function _ar2SetSearchFeatureNum($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $spec$select = 0; + $spec$select = ($1 | 0) < 40 ? $1 : 40; + if (!$0) $$0 = -1; else { + HEAP32[$0 + 36 >> 2] = ($spec$select | 0) > 3 ? $spec$select : 3; + $$0 = 0; + } + return $$0 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle19PointerToMemberType19hasRHSComponentSlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZNK12_GLOBAL__N_116itanium_demangle4Node15hasRHSComponentERNS_12OutputStreamE(HEAP32[$0 + 12 >> 2] | 0, $1) | 0; +} + +function _bitshift64Lshr(low, high, bits) { + low = low | 0; + high = high | 0; + bits = bits | 0; + if ((bits | 0) < 32) { + setTempRet0(high >>> bits | 0); + return low >>> bits | (high & (1 << bits) - 1) << 32 - bits; + } + setTempRet0(0); + return high >>> bits - 32 | 0; +} + +function __ZNKSt3__210moneypunctIwLb1EE16do_negative_signEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw($0, 1, 45); + return; +} + +function __ZNKSt3__210moneypunctIwLb0EE16do_negative_signEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw($0, 1, 45); + return; +} + +function __ZNKSt3__210moneypunctIcLb1EE16do_negative_signEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc($0, 1, 45); + return; +} + +function __ZNKSt3__210moneypunctIcLb0EE16do_negative_signEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc($0, 1, 45); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle8NameType11getBaseNameEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $8 = 0, $9 = 0; + $3 = $1 + 8 | 0; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $0; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + return; +} + +function __ZN6vision5ImageC2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + HEAP32[$0 + 12 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = 0; + HEAP32[$0 + 20 >> 2] = 0; + HEAP32[$0 + 24 >> 2] = 0; + HEAP32[$0 + 28 >> 2] = 0; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle16StdQualifiedNameC2EPNS0_4NodeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 34, 1, 1, 1); + HEAP32[$0 >> 2] = 19540; + HEAP32[$0 + 8 >> 2] = $1; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle15LiteralOperatorC2EPKNS0_4NodeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 19, 1, 1, 1); + HEAP32[$0 >> 2] = 18968; + HEAP32[$0 + 8 >> 2] = $1; + return; +} + +function __ZNSt3__26localeD2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $3 = 0; + $1 = HEAP32[$0 >> 2] | 0; + $2 = $1 + 4 | 0; + $3 = HEAP32[$2 >> 2] | 0; + HEAP32[$2 >> 2] = $3 + -1; + if (!$3) FUNCTION_TABLE_vi[HEAP32[(HEAP32[$1 >> 2] | 0) + 8 >> 2] & 255]($1); + return; +} + +function __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm($0, $1, __ZNSt3__211char_traitsIwE6lengthEPKw($1) | 0) | 0; +} + +function __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm($0, $1, __ZNSt3__211char_traitsIcE6lengthEPKc($1) | 0) | 0; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_8time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEjEERT_T0_() { + HEAP32[16245] = 0; + HEAP32[16244] = 23484; + __ZNSt3__220__time_get_c_storageIcEC2Ev(64984); + HEAP32[16244] = 21440; + HEAP32[16246] = 21488; + return; +} + +function __ZN6vision25DoGScaleInvariantDetector22setMaxNumFeaturePointsEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 + 84 >> 2] = $1; + __ZNSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE7reserveEm($0 + 60 | 0, $1); + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_8time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEjEERT_T0_() { + HEAP32[16249] = 0; + HEAP32[16248] = 23484; + __ZNSt3__220__time_get_c_storageIwEC2Ev(65e3); + HEAP32[16248] = 21524; + HEAP32[16250] = 21572; + return; +} + +function __ZNKSt3__220__time_get_c_storageIwE8__monthsEv($0) { + $0 = $0 | 0; + if ((HEAP8[64712] | 0) == 0 ? ___cxa_guard_acquire(64712) | 0 : 0) { + __ZNSt3__2L12init_wmonthsEv(); + HEAP32[16676] = 63840; + ___cxa_guard_release(64712); + } + return HEAP32[16676] | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle12NoexceptSpecC2EPKNS0_4NodeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 16, 1, 1, 1); + HEAP32[$0 >> 2] = 20288; + HEAP32[$0 + 8 >> 2] = $1; + return; +} + +function __ZNKSt3__220__time_get_c_storageIcE8__monthsEv($0) { + $0 = $0 | 0; + if ((HEAP8[64632] | 0) == 0 ? ___cxa_guard_acquire(64632) | 0 : 0) { + __ZNSt3__2L11init_monthsEv(); + HEAP32[16659] = 63344; + ___cxa_guard_release(64632); + } + return HEAP32[16659] | 0; +} + +function __ZNKSt3__25ctypeIwE10do_toupperEw($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $4 = 0, $6 = 0; + if ($1 >>> 0 < 128) { + $4 = (__ZNSt3__25ctypeIcE21__classic_upper_tableEv() | 0) + ($1 << 2) | 0; + $6 = HEAP32[$4 >> 2] | 0; + } else $6 = $1; + return $6 | 0; +} + +function __ZNKSt3__25ctypeIwE10do_tolowerEw($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $4 = 0, $6 = 0; + if ($1 >>> 0 < 128) { + $4 = (__ZNSt3__25ctypeIcE21__classic_lower_tableEv() | 0) + ($1 << 2) | 0; + $6 = HEAP32[$4 >> 2] | 0; + } else $6 = $1; + return $6 | 0; +} + +function __ZNKSt3__220__time_get_c_storageIwE7__weeksEv($0) { + $0 = $0 | 0; + if ((HEAP8[64728] | 0) == 0 ? ___cxa_guard_acquire(64728) | 0 : 0) { + __ZNSt3__2L11init_wweeksEv(); + HEAP32[16677] = 64128; + ___cxa_guard_release(64728); + } + return HEAP32[16677] | 0; +} + +function __ZNKSt3__220__time_get_c_storageIwE7__am_pmEv($0) { + $0 = $0 | 0; + if ((HEAP8[64696] | 0) == 0 ? ___cxa_guard_acquire(64696) | 0 : 0) { + __ZNSt3__2L11init_wam_pmEv(); + HEAP32[16675] = 63808; + ___cxa_guard_release(64696); + } + return HEAP32[16675] | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle8NameType7getNameEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0, $8 = 0, $9 = 0; + $3 = $1 + 8 | 0; + $8 = HEAP32[$3 + 4 >> 2] | 0; + $9 = $0; + HEAP32[$9 >> 2] = HEAP32[$3 >> 2]; + HEAP32[$9 + 4 >> 2] = $8; + return; +} + +function __ZN6vision9ExceptionC2ERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 16788; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_($0 + 4 | 0, $1); + return; +} + +function _finish_pass_huff($0) { + $0 = $0 | 0; + var $3 = 0, $8 = 0; + $3 = (HEAP32[$0 + 468 >> 2] | 0) + 16 | 0; + $8 = (HEAP32[$0 + 464 >> 2] | 0) + 24 | 0; + HEAP32[$8 >> 2] = (HEAP32[$8 >> 2] | 0) + ((HEAP32[$3 >> 2] | 0) / 8 | 0); + HEAP32[$3 >> 2] = 0; + return; +} + +function __ZNKSt3__220__time_get_c_storageIcE7__weeksEv($0) { + $0 = $0 | 0; + if ((HEAP8[64648] | 0) == 0 ? ___cxa_guard_acquire(64648) | 0 : 0) { + __ZNSt3__2L10init_weeksEv(); + HEAP32[16660] = 63632; + ___cxa_guard_release(64648); + } + return HEAP32[16660] | 0; +} + +function __ZNKSt3__220__time_get_c_storageIcE7__am_pmEv($0) { + $0 = $0 | 0; + if ((HEAP8[64616] | 0) == 0 ? ___cxa_guard_acquire(64616) | 0 : 0) { + __ZNSt3__2L10init_am_pmEv(); + HEAP32[16658] = 63312; + ___cxa_guard_release(64616); + } + return HEAP32[16658] | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13ReferenceType19hasRHSComponentSlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZNK12_GLOBAL__N_116itanium_demangle4Node15hasRHSComponentERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1) | 0; +} + +function __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($0) { + $0 = $0 | 0; + if ((HEAP8[$0 + 11 >> 0] | 0) < 0) __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm(HEAP32[$0 >> 2] | 0, HEAP32[$0 + 8 >> 2] & 2147483647); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle9ThrowExprC2EPKNS0_4NodeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 58, 1, 1, 1); + HEAP32[$0 >> 2] = 18264; + HEAP32[$0 + 8 >> 2] = $1; + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_8time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEjEERT_T0_() { + var $0 = 0; + HEAP32[16257] = 0; + HEAP32[16256] = 23484; + $0 = __ZNSt3__26__clocEv() | 0; + HEAP32[16258] = $0; + HEAP32[16256] = 22720; + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_8time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEjEERT_T0_() { + var $0 = 0; + HEAP32[16253] = 0; + HEAP32[16252] = 23484; + $0 = __ZNSt3__26__clocEv() | 0; + HEAP32[16254] = $0; + HEAP32[16252] = 22696; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle11PointerType19hasRHSComponentSlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZNK12_GLOBAL__N_116itanium_demangle4Node15hasRHSComponentERNS_12OutputStreamE(HEAP32[$0 + 8 >> 2] | 0, $1) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle8DtorNameC2EPKNS0_4NodeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 38, 1, 1, 1); + HEAP32[$0 >> 2] = 19056; + HEAP32[$0 + 8 >> 2] = $1; + return; +} + +function __ZNKSt3__27codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + return __ZNSt3__2L20utf8_to_utf16_lengthEPKhS1_mmNS_12codecvt_modeE($2, $3, $4, 1114111, 0) | 0; +} + +function dynCall_iiiiiii(index, a1, a2, a3, a4, a5, a6) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + a3 = a3 | 0; + a4 = a4 | 0; + a5 = a5 | 0; + a6 = a6 | 0; + return FUNCTION_TABLE_iiiiiii[index & 63](a1 | 0, a2 | 0, a3 | 0, a4 | 0, a5 | 0, a6 | 0) | 0; +} + +function __ZNKSt3__27codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + return __ZNSt3__2L19utf8_to_ucs4_lengthEPKhS1_mmNS_12codecvt_modeE($2, $3, $4, 1114111, 0) | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle8QualType19hasRHSComponentSlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZNK12_GLOBAL__N_116itanium_demangle4Node15hasRHSComponentERNS_12OutputStreamE(HEAP32[$0 + 12 >> 2] | 0, $1) | 0; +} + +function __ZNSt3__26locale5__imp7installINS_9money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66792) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_9money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66784) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_9money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66776) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_9money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66768) | 0); + return; +} + +function _pntz($0) { + $0 = $0 | 0; + var $3 = 0, $7 = 0; + $3 = _a_ctz_l_730((HEAP32[$0 >> 2] | 0) + -1 | 0) | 0; + if (!$3) { + $7 = _a_ctz_l_730(HEAP32[$0 + 4 >> 2] | 0) | 0; + return (($7 | 0) == 0 ? 0 : $7 + 32 | 0) | 0; + } else return $3 | 0; + return 0; +} + +function __ZNSt3__26locale5__imp7installINS_8time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66728) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_8time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66720) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_8time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66712) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_8time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66644) | 0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle8QualType10printRightERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0; + $3 = HEAP32[$0 + 12 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$3 >> 2] | 0) + 20 >> 2] & 255]($3, $1); + return; +} + +function __ZN6vision18BinaryFeatureStoreC2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + HEAP32[$0 + 12 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = 0; + HEAP32[$0 + 20 >> 2] = 0; + HEAP32[$0 + 24 >> 2] = 0; + return; +} + +function __ZN10emscripten8internal7InvokerIvJiEE6invokeEPFviEi($fn, $args) { + $fn = $fn | 0; + $args = $args | 0; + var $call = 0; + $call = __ZN10emscripten8internal11BindingTypeIivE12fromWireTypeEi($args) | 0; + FUNCTION_TABLE_vi[$fn & 255]($call); + return; +} + +function __ZNSt3__26locale5__imp7installINS_7num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66576) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_7num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66568) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_7num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66560) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_7num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66536) | 0); + return; +} + +function __ZN6vision22bilinear_interpolationIfEET_PKS1_mmmff($0, $1, $2, $3, $4, $5) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = +$4; + $5 = +$5; + return +(+__ZN6vision22bilinear_interpolationIffEET0_PKT_mmmff($0, $1, $2, $3, $4, $5)); +} + +function __ZNSt3__211char_traitsIwE7not_eofEj($0) { + $0 = $0 | 0; + var $5 = 0; + if (__ZNSt3__211char_traitsIwE11eq_int_typeEjj($0, __ZNSt3__211char_traitsIwE3eofEv() | 0) | 0) $5 = ~(__ZNSt3__211char_traitsIwE3eofEv() | 0); else $5 = $0; + return $5 | 0; +} + +function __ZNSt3__211char_traitsIcE7not_eofEi($0) { + $0 = $0 | 0; + var $5 = 0; + if (__ZNSt3__211char_traitsIcE11eq_int_typeEii($0, __ZNSt3__211char_traitsIcE3eofEv() | 0) | 0) $5 = ~(__ZNSt3__211char_traitsIcE3eofEv() | 0); else $5 = $0; + return $5 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle9ArrayType9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0; + $3 = HEAP32[$0 + 8 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$3 >> 2] | 0) + 16 >> 2] & 255]($3, $1); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle8BoolExprC2Eb($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_116itanium_demangle4NodeC2ENS1_4KindENS1_5CacheES3_S3_($0, 59, 1, 1, 1); + HEAP32[$0 >> 2] = 18132; + HEAP8[$0 + 8 >> 0] = $1 & 1; + return; +} + +function dynCall_iiiiiid(index, a1, a2, a3, a4, a5, a6) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + a3 = a3 | 0; + a4 = a4 | 0; + a5 = a5 | 0; + a6 = +a6; + return FUNCTION_TABLE_iiiiiid[index & 3](a1 | 0, a2 | 0, a3 | 0, a4 | 0, a5 | 0, +a6) | 0; +} + +function dynCall_iidiiii(index, a1, a2, a3, a4, a5, a6) { + index = index | 0; + a1 = a1 | 0; + a2 = +a2; + a3 = a3 | 0; + a4 = a4 | 0; + a5 = a5 | 0; + a6 = a6 | 0; + return FUNCTION_TABLE_iidiiii[index & 1](a1 | 0, +a2, a3 | 0, a4 | 0, a5 | 0, a6 | 0) | 0; +} + +function ___ofl_add($0) { + $0 = $0 | 0; + var $1 = 0, $4 = 0; + $1 = ___ofl_lock() | 0; + HEAP32[$0 + 56 >> 2] = HEAP32[$1 >> 2]; + $4 = HEAP32[$1 >> 2] | 0; + if ($4 | 0) HEAP32[$4 + 52 >> 2] = $0; + HEAP32[$1 >> 2] = $0; + ___ofl_unlock(); + return $0 | 0; +} + +function __ZNKSt3__220__shared_ptr_pointerIPN6vision8KeyframeILi96EEENS_14default_deleteIS3_EENS_9allocatorIS3_EEE13__get_deleterERKSt9type_info($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return ((HEAP32[$1 + 4 >> 2] | 0) == 34519 ? $0 + 12 | 0 : 0) | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle20NameWithTemplateArgs11getBaseNameEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0; + $3 = HEAP32[$1 + 8 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$3 >> 2] | 0) + 24 >> 2] & 255]($0, $3); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle8QualType15hasFunctionSlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZNK12_GLOBAL__N_116itanium_demangle4Node11hasFunctionERNS_12OutputStreamE(HEAP32[$0 + 12 >> 2] | 0, $1) | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle19GlobalQualifiedName11getBaseNameEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0; + $3 = HEAP32[$1 + 8 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$3 >> 2] | 0) + 24 >> 2] & 255]($0, $3); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle20TemplateArgumentPack9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray14printWithCommaERNS_12OutputStreamE($0 + 8 | 0, $1); + return; +} + +function __ZNSt3__214priority_queueIN6vision17PriorityQueueItemILi96EEENS_6vectorIS3_NS_9allocatorIS3_EEEENS_4lessIS3_EEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__213__vector_baseIN6vision17PriorityQueueItemILi96EEENS_9allocatorIS3_EEED2Ev($0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle16StdQualifiedName11getBaseNameEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0; + $3 = HEAP32[$1 + 8 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$3 >> 2] | 0) + 24 >> 2] & 255]($0, $3); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EEC2Ev($0) { + $0 = $0 | 0; + var $1 = 0; + $1 = $0 + 12 | 0; + HEAP32[$0 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = $1; + HEAP32[$0 + 8 >> 2] = $0 + 28; + return; +} + +function dynCall_viiiiii(index, a1, a2, a3, a4, a5, a6) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + a3 = a3 | 0; + a4 = a4 | 0; + a5 = a5 | 0; + a6 = a6 | 0; + FUNCTION_TABLE_viiiiii[index & 7](a1 | 0, a2 | 0, a3 | 0, a4 | 0, a5 | 0, a6 | 0); +} + +function __ZNSt3__26locale8__globalEv() { + if ((HEAP8[65224] | 0) == 0 ? ___cxa_guard_acquire(65224) | 0 : 0) { + __ZNSt3__26locale5__imp11make_globalEv() | 0; + HEAP32[16715] = 66856; + ___cxa_guard_release(65224); + } + return HEAP32[16715] | 0; +} + +function __ZNSt3__26locale7classicEv() { + if ((HEAP8[65056] | 0) == 0 ? ___cxa_guard_acquire(65056) | 0 : 0) { + __ZNSt3__26locale5__imp12make_classicEv() | 0; + HEAP32[16713] = 66848; + ___cxa_guard_release(65056); + } + return HEAP32[16713] | 0; +} + +function __ZNSt3__26__clocEv() { + var $4 = 0; + if ((HEAP8[64576] | 0) == 0 ? ___cxa_guard_acquire(64576) | 0 : 0) { + $4 = ___newlocale(2147483647, 58971, 0) | 0; + HEAP32[16630] = $4; + ___cxa_guard_release(64576); + } + return HEAP32[16630] | 0; +} + +function __ZL8is_equalPKSt9type_infoS1_b($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0; + if ($2) $$0 = (_strcmp(HEAP32[$0 + 4 >> 2] | 0, HEAP32[$1 + 4 >> 2] | 0) | 0) == 0; else $$0 = ($0 | 0) == ($1 | 0); + return $$0 | 0; +} + +function __ZNSt3__26localeC2Ev($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0, $3 = 0; + $1 = __ZNSt3__26locale8__globalEv() | 0; + $2 = HEAP32[$1 >> 2] | 0; + HEAP32[$0 >> 2] = $2; + $3 = $2 + 4 | 0; + HEAP32[$3 >> 2] = (HEAP32[$3 >> 2] | 0) + 1; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13QualifiedName11getBaseNameEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0; + $3 = HEAP32[$1 + 12 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$3 >> 2] | 0) + 24 >> 2] & 255]($0, $3); + return; +} + +function __ZN10emscripten8internal6TypeIDINSt3__212basic_stringIwNS2_11char_traitsIwEENS2_9allocatorIwEEEEvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDINSt3__212basic_stringIwNS2_11char_traitsIwEENS2_9allocatorIwEEEEE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDINSt3__212basic_stringIhNS2_11char_traitsIhEENS2_9allocatorIhEEEEvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDINSt3__212basic_stringIhNS2_11char_traitsIhEENS2_9allocatorIhEEEEE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDINSt3__212basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDINSt3__212basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEE3getEv() | 0; +} + +function ___uselocale($0) { + $0 = $0 | 0; + var $2 = 0, $3 = 0; + $2 = (___pthread_self_234() | 0) + 188 | 0; + $3 = HEAP32[$2 >> 2] | 0; + if ($0 | 0) HEAP32[$2 >> 2] = ($0 | 0) == (-1 | 0) ? 65348 : $0; + return (($3 | 0) == 65348 ? -1 : $3) | 0; +} + +function __ZN6vision10SubVector2IfEEvPT_PKS1_S4_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + HEAPF32[$0 >> 2] = +HEAPF32[$1 >> 2] - +HEAPF32[$2 >> 2]; + HEAPF32[$0 + 4 >> 2] = +HEAPF32[$1 + 4 >> 2] - +HEAPF32[$2 + 4 >> 2]; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle8QualType12hasArraySlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZNK12_GLOBAL__N_116itanium_demangle4Node8hasArrayERNS_12OutputStreamE(HEAP32[$0 + 12 >> 2] | 0, $1) | 0; +} + +function __ZN6vision22QuadraticCriticalPointIfEEbRT_S1_S1_S1_($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + $3 = +$3; + var $$0 = 0; + if ($1 == 0.0) $$0 = 0; else { + HEAPF32[$0 >> 2] = -$2 / ($1 * 2.0); + $$0 = 1; + } + return $$0 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle10NestedName11getBaseNameEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0; + $3 = HEAP32[$1 + 12 >> 2] | 0; + FUNCTION_TABLE_vii[HEAP32[(HEAP32[$3 >> 2] | 0) + 24 >> 2] & 255]($0, $3); + return; +} + +function __ZN6vision20VisualDatabaseFacade9matchedIdEv($0) { + $0 = $0 | 0; + return __ZNK6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEE9matchedIdEv(HEAP32[HEAP32[$0 >> 2] >> 2] | 0) | 0; +} + +function __ZNSt3__220__shared_ptr_pointerIPN6vision8KeyframeILi96EEENS_14default_deleteIS3_EENS_9allocatorIS3_EEE21__on_zero_shared_weakEv($0) { + $0 = $0 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($0, 16); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle13NodeArrayNode9printLeftERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray14printWithCommaERNS_12OutputStreamE($0 + 8 | 0, $1); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EED2Ev($0) { + $0 = $0 | 0; + if (!(__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE8isInlineEv($0) | 0)) _free(HEAP32[$0 >> 2] | 0); + return; +} + +function __ZNK6vision20VisualDatabaseFacade7inliersEv($0) { + $0 = $0 | 0; + return __ZNK6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEE7inliersEv(HEAP32[HEAP32[$0 >> 2] >> 2] | 0) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EED2Ev($0) { + $0 = $0 | 0; + if (!(__ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE8isInlineEv($0) | 0)) _free(HEAP32[$0 >> 2] | 0); + return; +} + +function __ZN6vision10FastMedianIfiEENSt3__24pairIT_T0_EEPS5_i($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + __ZN6vision11PartialSortIfiEENSt3__24pairIT_T0_EEPS5_ii($0, $1, $2, ($2 & 1) + -1 + (($2 | 0) / 2 | 0) | 0); + return; +} + +function __ZNKSt3__27codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + var $7 = 0; + $7 = $3 - $2 | 0; + return ($7 >>> 0 < $4 >>> 0 ? $7 : $4) | 0; +} + +function __ZN6vision11CopyVector2IfEEvPT_PKS1_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $7 = 0, $8 = 0; + $2 = $1; + $7 = HEAP32[$2 + 4 >> 2] | 0; + $8 = $0; + HEAP32[$8 >> 2] = HEAP32[$2 >> 2]; + HEAP32[$8 + 4 >> 2] = $7; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE11clearInlineEv($0) { + $0 = $0 | 0; + var $1 = 0; + $1 = $0 + 12 | 0; + HEAP32[$0 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = $1; + HEAP32[$0 + 8 >> 2] = $0 + 44; + return; +} + +function __ZN6vision8KeyframeILi96EEC2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + __ZN6vision18BinaryFeatureStoreC2Ev($0 + 8 | 0); + __ZN6vision28BinaryHierarchicalClusteringILi96EEC2Ev($0 + 36 | 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EEixEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return (__ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE5beginEv($0) | 0) + ($1 << 2) | 0; +} + +function _kpmGetResult($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $$0 = 0; + if (!$0) $$0 = -1; else { + HEAP32[$1 >> 2] = HEAP32[$0 + 52 >> 2]; + HEAP32[$2 >> 2] = HEAP32[$0 + 56 >> 2]; + $$0 = 0; + } + return $$0 | 0; +} + +function _ar3DDeleteHandle($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0; + $1 = HEAP32[$0 >> 2] | 0; + if (!$1) $$0 = -1; else { + _icpDeleteHandle($1) | 0; + _free(HEAP32[$0 >> 2] | 0); + HEAP32[$0 >> 2] = 0; + $$0 = 0; + } + return $$0 | 0; +} + +function __ZN12_GLOBAL__N_114SwapAndRestoreIPKcEC2ERS2_S2_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + HEAP32[$0 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = HEAP32[$1 >> 2]; + HEAP8[$0 + 8 >> 0] = 1; + HEAP32[$1 >> 2] = $2; + return; +} + +function __ZSt11__terminatePFvvE($0) { + $0 = $0 | 0; + var sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + FUNCTION_TABLE_v[$0 & 3](); + _abort_message(51119, sp); +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EEixEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return (__ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE5beginEv($0) | 0) + ($1 << 2) | 0; +} + +function __ZN12_GLOBAL__N_114SwapAndRestoreIbEC2ERbb($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + HEAP32[$0 >> 2] = $1; + HEAP8[$0 + 4 >> 0] = HEAP8[$1 >> 0] | 0; + HEAP8[$0 + 5 >> 0] = 1; + HEAP8[$1 >> 0] = $2 & 1; + return; +} + +function _arPattAttach($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0, $3 = 0; + if (($0 | 0) != 0 ? ($3 = $0 + 7062384 | 0, (HEAP32[$3 >> 2] | 0) == 0) : 0) { + HEAP32[$3 >> 2] = $1; + $$0 = 0; + } else $$0 = -1; + return $$0 | 0; +} + +function _jpeg_destroy($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0; + $1 = $0 + 4 | 0; + $2 = HEAP32[$1 >> 2] | 0; + if ($2 | 0) FUNCTION_TABLE_vi[HEAP32[$2 + 40 >> 2] & 255]($0); + HEAP32[$1 >> 2] = 0; + HEAP32[$0 + 20 >> 2] = 0; + return; +} + +function dynCall_iiiiii(index, a1, a2, a3, a4, a5) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + a3 = a3 | 0; + a4 = a4 | 0; + a5 = a5 | 0; + return FUNCTION_TABLE_iiiiii[index & 31](a1 | 0, a2 | 0, a3 | 0, a4 | 0, a5 | 0) | 0; +} +function stackAlloc(size) { + size = size | 0; + var ret = 0; + ret = STACKTOP; + STACKTOP = STACKTOP + size | 0; + STACKTOP = STACKTOP + 15 & -16; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(size | 0); + return ret | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EEC2Ev($0) { + $0 = $0 | 0; + var $1 = 0; + $1 = $0 + 12 | 0; + HEAP32[$0 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = $1; + HEAP32[$0 + 8 >> 2] = $0 + 140; + return; +} + +function __ZNSt3__27codecvtIwc11__mbstate_tEC2Em($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $5 = 0; + HEAP32[$0 + 4 >> 2] = $1 + -1; + HEAP32[$0 >> 2] = 23240; + $5 = __ZNSt3__26__clocEv() | 0; + HEAP32[$0 + 8 >> 2] = $5; + return; +} + +function __ZN6vision18BinaryFeatureStoreD2Ev($0) { + $0 = $0 | 0; + __ZNSt3__213__vector_baseIN6vision12FeaturePointENS_9allocatorIS2_EEED2Ev($0 + 16 | 0); + __ZNSt3__213__vector_baseIhNS_9allocatorIhEEED2Ev($0 + 4 | 0); + return; +} + +function _pop_arg_long_double($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $7 = 0, $8 = 0.0; + $7 = (HEAP32[$1 >> 2] | 0) + (8 - 1) & ~(8 - 1); + $8 = +HEAPF64[$7 >> 3]; + HEAP32[$1 >> 2] = $7 + 8; + HEAPF64[$0 >> 3] = $8; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EEC2Ev($0) { + $0 = $0 | 0; + var $1 = 0; + $1 = $0 + 12 | 0; + HEAP32[$0 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = $1; + HEAP32[$0 + 8 >> 2] = $0 + 44; + return; +} + +function __ZNSt3__211char_traitsIcE6assignEPcmc($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + if ($1 | 0) _memset($0 | 0, (__ZNSt3__211char_traitsIcE11to_int_typeEc($2) | 0) & 255 | 0, $1 | 0) | 0; + return $0 | 0; +} + +function __ZNSt3__220__shared_ptr_pointerIPh16NullArrayDeleterIhENS_9allocatorIhEEE16__on_zero_sharedEv($0) { + $0 = $0 | 0; + var $1 = 0; + $1 = $0 + 12 | 0; + __ZNK16NullArrayDeleterIhEclEPh($1, HEAP32[$1 >> 2] | 0); + return; +} + +function __ZN6vision17bitstring_set_bitEPhih($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $7 = 0; + $7 = $0 + (($1 | 0) / 8 | 0) | 0; + HEAP8[$7 >> 0] = ($2 & 255) << ($1 & 7) | (HEAPU8[$7 >> 0] | 0); + return; +} + +function dynCall_iiiiid(index, a1, a2, a3, a4, a5) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + a3 = a3 | 0; + a4 = a4 | 0; + a5 = +a5; + return FUNCTION_TABLE_iiiiid[index & 7](a1 | 0, a2 | 0, a3 | 0, a4 | 0, +a5) | 0; +} + +function _arSetLabelingThreshModeAutoInterval($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (!$0) $$0 = -1; else { + HEAP32[$0 + 7062392 >> 2] = $1; + HEAP32[$0 + 7062396 >> 2] = 0; + $$0 = 0; + } + return $$0 | 0; +} + +function __ZNKSt3__220__shared_ptr_pointerIPhNS_14default_deleteIhEENS_9allocatorIhEEE13__get_deleterERKSt9type_info($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return ((HEAP32[$1 + 4 >> 2] | 0) == 38743 ? $0 + 12 | 0 : 0) | 0; +} + +function __ZN6vision21OrientationAssignmentD2Ev($0) { + $0 = $0 | 0; + __ZNSt3__213__vector_baseIN6vision5ImageENS_9allocatorIS2_EEED2Ev($0 + 40 | 0); + __ZNSt3__213__vector_baseIfNS_9allocatorIfEEED2Ev($0 + 28 | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_7codecvtIDsc11__mbstate_tEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66832) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_7codecvtIDic11__mbstate_tEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66840) | 0); + return; +} + +function __ZNSt3__25ctypeIcED2Ev($0) { + $0 = $0 | 0; + var $2 = 0; + HEAP32[$0 >> 2] = 23308; + $2 = HEAP32[$0 + 8 >> 2] | 0; + if ($2 | 0 ? HEAP8[$0 + 12 >> 0] | 0 : 0) __ZdaPv($2); + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_7codecvtIwc11__mbstate_tEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66824) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_7codecvtIcc11__mbstate_tEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66816) | 0); + return; +} + +function __ZNKSt3__220__shared_ptr_pointerIPh16NullArrayDeleterIhENS_9allocatorIhEEE13__get_deleterERKSt9type_info($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return ((HEAP32[$1 + 4 >> 2] | 0) == 38865 ? $0 + 12 | 0 : 0) | 0; +} + +function dynCall_viiiii(index, a1, a2, a3, a4, a5) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + a3 = a3 | 0; + a4 = a4 | 0; + a5 = a5 | 0; + FUNCTION_TABLE_viiiii[index & 63](a1 | 0, a2 | 0, a3 | 0, a4 | 0, a5 | 0); +} + +function _byteSwapDouble($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + $$0 = 0; + while (1) { + if (($$0 | 0) == 8) break; + HEAP8[$1 + $$0 >> 0] = HEAP8[$0 + (7 - $$0) >> 0] | 0; + $$0 = $$0 + 1 | 0; + } + return; +} + +function __ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEED1Ev($0) { + $0 = $0 | 0; + __ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEED2Ev($0, 20872); + __ZNSt3__29basic_iosIwNS_11char_traitsIwEEED2Ev($0 + 4 | 0); + return; +} + +function __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEED1Ev($0) { + $0 = $0 | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEED2Ev($0, 20824); + __ZNSt3__29basic_iosIcNS_11char_traitsIcEEED2Ev($0 + 4 | 0); + return; +} + +function __ZNSt3__213basic_istreamIwNS_11char_traitsIwEEED1Ev($0) { + $0 = $0 | 0; + __ZNSt3__213basic_istreamIwNS_11char_traitsIwEEED2Ev($0, 20776); + __ZNSt3__29basic_iosIwNS_11char_traitsIwEEED2Ev($0 + 8 | 0); + return; +} + +function __ZNSt3__213basic_istreamIcNS_11char_traitsIcEEED1Ev($0) { + $0 = $0 | 0; + __ZNSt3__213basic_istreamIcNS_11char_traitsIcEEED2Ev($0, 20728); + __ZNSt3__29basic_iosIcNS_11char_traitsIcEEED2Ev($0 + 8 | 0); + return; +} + +function _process_data_crank_post($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + FUNCTION_TABLE_viiiiiii[HEAP32[(HEAP32[$0 + 456 >> 2] | 0) + 4 >> 2] & 7]($0, 0, 0, 0, $1, $2, $3); + return; +} + +function __ZNKSt3__26locale9use_facetERNS0_2idE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = HEAP32[$0 >> 2] | 0; + return __ZNKSt3__26locale5__imp9use_facetEl($2, __ZNSt3__26locale2id5__getEv($1) | 0) | 0; +} + +function __ZN6vision10DoGPyramid3getEmm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $6 = 0; + $6 = (Math_imul(HEAP32[$0 + 16 >> 2] | 0, $1) | 0) + $2 | 0; + return (HEAP32[$0 >> 2] | 0) + ($6 << 5) | 0; +} + +function _arGetLabelingThreshMode($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (($0 | 0) != 0 & ($1 | 0) != 0) { + HEAP32[$1 >> 2] = HEAP32[$0 + 7062388 >> 2]; + $$0 = 0; + } else $$0 = -1; + return $$0 | 0; +} + +function __ZNSt3__26localeC2ERKS0_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0, $3 = 0; + $2 = HEAP32[$1 >> 2] | 0; + HEAP32[$0 >> 2] = $2; + $3 = $2 + 4 | 0; + HEAP32[$3 >> 2] = (HEAP32[$3 >> 2] | 0) + 1; + return; +} + +function __ZNK12_GLOBAL__N_112OutputStream4backEv($0) { + $0 = $0 | 0; + var $2 = 0, $8 = 0; + $2 = HEAP32[$0 + 4 >> 2] | 0; + if (!$2) $8 = 0; else $8 = HEAP8[(HEAP32[$0 >> 2] | 0) + ($2 + -1) >> 0] | 0; + return $8 | 0; +} + +function _grayscale_convert_52($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + _jcopy_sample_rows(HEAP32[$1 >> 2] | 0, $2, $3, 0, $4, HEAP32[$0 + 112 >> 2] | 0); + return; +} + +function _byteSwapInt($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + $$0 = 0; + while (1) { + if (($$0 | 0) == 4) break; + HEAP8[$1 + $$0 >> 0] = HEAP8[$0 + (3 - $$0) >> 0] | 0; + $$0 = $$0 + 1 | 0; + } + return; +} + +function ___lctrans_impl($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (!$1) $$0 = 0; else $$0 = ___mo_lookup(HEAP32[$1 >> 2] | 0, HEAP32[$1 + 4 >> 2] | 0, $0) | 0; + return (($$0 | 0) == 0 ? $0 : $$0) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EE8dropBackEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 + 4 >> 2] = (HEAP32[$0 >> 2] | 0) + ($1 << 2); + return; +} + +function _self_destruct($0) { + $0 = $0 | 0; + var $1 = 0; + _free_pool($0, 1); + _free_pool($0, 0); + $1 = $0 + 4 | 0; + _jpeg_free_small($0, HEAP32[$1 >> 2] | 0, 84); + HEAP32[$1 >> 2] = 0; + _jpeg_mem_term($0); + return; +} + +function _arImageProcInit($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = _malloc(2064) | 0; + if ($2 | 0) { + HEAP32[$2 >> 2] = 0; + HEAP32[$2 + 4 >> 2] = $0; + HEAP32[$2 + 8 >> 2] = $1; + } + return $2 | 0; +} + +function __ZNSt3__26locale5__imp7installINS_10moneypunctIwLb1EEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66760) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_10moneypunctIwLb0EEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66752) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_10moneypunctIcLb1EEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66744) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_10moneypunctIcLb0EEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66736) | 0); + return; +} + +function _jpeg_open_backing_store($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0; + $3 = HEAP32[$0 >> 2] | 0; + HEAP32[$3 + 20 >> 2] = 51; + FUNCTION_TABLE_vi[HEAP32[$3 >> 2] & 255]($0); + return; +} + +function _arPattDetach($0) { + $0 = $0 | 0; + var $$0 = 0, $2 = 0; + if (($0 | 0) != 0 ? ($2 = $0 + 7062384 | 0, (HEAP32[$2 >> 2] | 0) != 0) : 0) { + HEAP32[$2 >> 2] = 0; + $$0 = 0; + } else $$0 = -1; + return $$0 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E7numLeftEv($0) { + $0 = $0 | 0; + return (HEAP32[$0 + 4 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) | 0; +} + +function __ZN6vision20VisualDatabaseFacadeD2Ev($0) { + $0 = $0 | 0; + var $1 = 0; + $1 = HEAP32[$0 >> 2] | 0; + HEAP32[$0 >> 2] = 0; + if ($1 | 0) { + __ZN6vision18VisualDatabaseImplD2Ev($1); + __ZdlPv($1); + } + return; +} + +function _arGetMatrixCodeType($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (($0 | 0) != 0 & ($1 | 0) != 0) { + HEAP32[$1 >> 2] = HEAP32[$0 + 7062424 >> 2]; + $$0 = 0; + } else $$0 = -1; + return $$0 | 0; +} + +function __ZNSt3__220__shared_ptr_pointerIPhNS_14default_deleteIhEENS_9allocatorIhEEE21__on_zero_shared_weakEv($0) { + $0 = $0 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($0, 16); + return; +} + +function __ZTv0_n12_NSt3__213basic_ostreamIwNS_11char_traitsIwEEED1Ev($0) { + $0 = $0 | 0; + __ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEED1Ev($0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) | 0); + return; +} + +function __ZTv0_n12_NSt3__213basic_ostreamIwNS_11char_traitsIwEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEED0Ev($0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) | 0); + return; +} + +function __ZTv0_n12_NSt3__213basic_ostreamIcNS_11char_traitsIcEEED1Ev($0) { + $0 = $0 | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEED1Ev($0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) | 0); + return; +} + +function __ZTv0_n12_NSt3__213basic_ostreamIcNS_11char_traitsIcEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEED0Ev($0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) | 0); + return; +} + +function __ZTv0_n12_NSt3__213basic_istreamIwNS_11char_traitsIwEEED1Ev($0) { + $0 = $0 | 0; + __ZNSt3__213basic_istreamIwNS_11char_traitsIwEEED1Ev($0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) | 0); + return; +} + +function __ZTv0_n12_NSt3__213basic_istreamIwNS_11char_traitsIwEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__213basic_istreamIwNS_11char_traitsIwEEED0Ev($0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) | 0); + return; +} + +function __ZTv0_n12_NSt3__213basic_istreamIcNS_11char_traitsIcEEED1Ev($0) { + $0 = $0 | 0; + __ZNSt3__213basic_istreamIcNS_11char_traitsIcEEED1Ev($0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) | 0); + return; +} + +function __ZTv0_n12_NSt3__213basic_istreamIcNS_11char_traitsIcEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__213basic_istreamIcNS_11char_traitsIcEEED0Ev($0 + (HEAP32[(HEAP32[$0 >> 2] | 0) + -12 >> 2] | 0) | 0); + return; +} + +function __ZNSt3__220__shared_ptr_pointerIPh16NullArrayDeleterIhENS_9allocatorIhEEE21__on_zero_shared_weakEv($0) { + $0 = $0 | 0; + __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($0, 16); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle12NodeOrString8asStringEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_110StringViewC2EPKcS2_($0, HEAP32[$1 >> 2] | 0, HEAP32[$1 + 4 >> 2] | 0); + return; +} + +function __ZN12_GLOBAL__N_114SwapAndRestoreIjEC2ERjj($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = HEAP32[$1 >> 2]; + HEAP8[$0 + 8 >> 0] = 1; + HEAP32[$1 >> 2] = -1; + return; +} + +function _i64Subtract(a, b, c, d) { + a = a | 0; + b = b | 0; + c = c | 0; + d = d | 0; + var h = 0; + h = b - d >>> 0; + h = b - d - (c >>> 0 > a >>> 0 | 0) >>> 0; + return (setTempRet0(h | 0), a - c >>> 0 | 0) | 0; +} + +function ___strdup($0) { + $0 = $0 | 0; + var $$0 = 0, $2 = 0, $3 = 0; + $2 = (_strlen($0) | 0) + 1 | 0; + $3 = _malloc($2) | 0; + if (!$3) $$0 = 0; else $$0 = _memcpy($3 | 0, $0 | 0, $2 | 0) | 0; + return $$0 | 0; +} + +function __ZNSt3__28numpunctIwED2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 23400; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($0 + 16 | 0); + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__28numpunctIcED2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 23360; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($0 + 12 | 0); + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNKSt3__29__num_getIwE10__do_widenERNS_8ios_baseEPw($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZNKSt3__29__num_getIwE12__do_widen_pIwEEPKT_RNS_8ios_baseEPS3_($0, $1, $2) | 0; +} + +function _arSetPattRatio($0, $1) { + $0 = $0 | 0; + $1 = +$1; + var $$0 = 0; + if (($0 | 0) != 0 ? !($1 <= 0.0 | $1 >= 1.0) : 0) { + HEAPF64[$0 + 7062416 >> 3] = $1; + $$0 = 0; + } else $$0 = -1; + return $$0 | 0; +} + +function _arGetLabelingThresh($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (($0 | 0) != 0 & ($1 | 0) != 0) { + HEAP32[$1 >> 2] = HEAP32[$0 + 16 >> 2]; + $$0 = 0; + } else $$0 = -1; + return $$0 | 0; +} + +function __ZNSt3__26locale5__imp7installINS_8numpunctIwEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66552) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_8numpunctIcEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66528) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_8messagesIwEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66808) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_8messagesIcEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66800) | 0); + return; +} + +function __ZN6vision9MaxIndex3IfEEiPKT_($0) { + $0 = $0 | 0; + var $$0 = 0; + $$0 = +HEAPF32[$0 + 4 >> 2] > +HEAPF32[$0 >> 2] & 1; + return (+HEAPF32[$0 + 8 >> 2] > +HEAPF32[$0 + ($$0 << 2) >> 2] ? 2 : $$0) | 0; +} + +function ___wasi_syscall_ret($0) { + $0 = $0 | 0; + var $$0 = 0, $3 = 0; + if (!($0 << 16 >> 16)) $$0 = 0; else { + $3 = ___errno_location() | 0; + HEAP32[$3 >> 2] = $0 & 65535; + $$0 = -1; + } + return $$0 | 0; +} + +function __ZNSt3__26locale5__imp7installINS_7collateIwEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66504) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_7collateIcEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66496) | 0); + return; +} + +function _arGetLabelingMode($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (($0 | 0) != 0 & ($1 | 0) != 0) { + HEAP32[$1 >> 2] = HEAP32[$0 + 12 >> 2]; + $$0 = 0; + } else $$0 = -1; + return $$0 | 0; +} + +function _ar2GetResolution($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + if (!$0) _ar2GetResolution2(0, $1, $2, $3) | 0; else _ar2GetResolution2($0, $1, $2, $3) | 0; + return 0; +} + +function __ZN6vision14AreaOfTriangleIfEET_PKS1_S3_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return +(+Math_abs(+(+HEAPF32[$0 >> 2] * +HEAPF32[$1 + 4 >> 2] - +HEAPF32[$0 + 4 >> 2] * +HEAPF32[$1 >> 2])) * .5); +} + +function __ZNSt3__26locale5__imp7installINS_5ctypeIwEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66544) | 0); + return; +} + +function __ZNSt3__26locale5__imp7installINS_5ctypeIcEEEEvPT_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26locale5__imp7installEPNS0_5facetEl($0, $1, __ZNSt3__26locale2id5__getEv(66512) | 0); + return; +} + +function ___syscall_ret($0) { + $0 = $0 | 0; + var $$0 = 0, $3 = 0; + if ($0 >>> 0 > 4294963200) { + $3 = ___errno_location() | 0; + HEAP32[$3 >> 2] = 0 - $0; + $$0 = -1; + } else $$0 = $0; + return $$0 | 0; +} + +function dynCall_iiiii(index, a1, a2, a3, a4) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + a3 = a3 | 0; + a4 = a4 | 0; + return FUNCTION_TABLE_iiiii[index & 15](a1 | 0, a2 | 0, a3 | 0, a4 | 0) | 0; +} + +function __ZNSt3__28time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__210__time_putD2Ev($0 + 8 | 0); + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__28time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__210__time_putD2Ev($0 + 8 | 0); + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__211char_traitsIwE4moveEPwPKwm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $5 = 0; + if (!$2) $5 = $0; else { + _wmemmove($0, $1, $2) | 0; + $5 = $0; + } + return $5 | 0; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiiiiEE8getTypesEv($this) { + $this = $this | 0; + return __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJiiiiEEEE3getEv() | 0; +} + +function __ZNK10__cxxabiv123__fundamental_type_info9can_catchEPKNS_16__shim_type_infoERPv($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZL8is_equalPKSt9type_infoS1_b($0, $1, 0) | 0; +} + +function __ZNSt3__211char_traitsIwE6assignEPwmw($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $5 = 0; + if (!$1) $5 = $0; else { + _wmemset($0, $2, $1) | 0; + $5 = $0; + } + return $5 | 0; +} + +function __ZNSt3__211char_traitsIwE4copyEPwPKwm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $5 = 0; + if (!$2) $5 = $0; else { + _wmemcpy($0, $1, $2) | 0; + $5 = $0; + } + return $5 | 0; +} + +function __ZN6vision28BinaryHierarchicalClusteringILi96EE10nextNodeIdEv($0) { + $0 = $0 | 0; + var $1 = 0, $2 = 0; + $1 = $0 + 4 | 0; + $2 = HEAP32[$1 >> 2] | 0; + HEAP32[$1 >> 2] = $2 + 1; + return $2 | 0; +} + +function _arSetPatternDetectionMode($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (($0 | 0) != 0 & $1 >>> 0 < 5) { + HEAP32[$0 + 24 >> 2] = $1; + $$0 = 0; + } else $$0 = -1; + return $$0 | 0; +} + +function __ZNKSt3__29__num_getIcE10__do_widenERNS_8ios_baseEPc($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return __ZNKSt3__29__num_getIcE12__do_widen_pERNS_8ios_baseEPc($0, $1, $2) | 0; +} + +function __ZNKSt3__210moneypunctIwLb1EE13do_pos_formatEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP8[$0 >> 0] = 2; + HEAP8[$0 + 1 >> 0] = 3; + HEAP8[$0 + 2 >> 0] = 0; + HEAP8[$0 + 3 >> 0] = 4; + return; +} + +function __ZNKSt3__210moneypunctIwLb1EE13do_neg_formatEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP8[$0 >> 0] = 2; + HEAP8[$0 + 1 >> 0] = 3; + HEAP8[$0 + 2 >> 0] = 0; + HEAP8[$0 + 3 >> 0] = 4; + return; +} + +function __ZNKSt3__210moneypunctIwLb0EE13do_pos_formatEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP8[$0 >> 0] = 2; + HEAP8[$0 + 1 >> 0] = 3; + HEAP8[$0 + 2 >> 0] = 0; + HEAP8[$0 + 3 >> 0] = 4; + return; +} + +function __ZNKSt3__210moneypunctIwLb0EE13do_neg_formatEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP8[$0 >> 0] = 2; + HEAP8[$0 + 1 >> 0] = 3; + HEAP8[$0 + 2 >> 0] = 0; + HEAP8[$0 + 3 >> 0] = 4; + return; +} + +function __ZNKSt3__210moneypunctIcLb1EE13do_pos_formatEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP8[$0 >> 0] = 2; + HEAP8[$0 + 1 >> 0] = 3; + HEAP8[$0 + 2 >> 0] = 0; + HEAP8[$0 + 3 >> 0] = 4; + return; +} + +function __ZNKSt3__210moneypunctIcLb1EE13do_neg_formatEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP8[$0 >> 0] = 2; + HEAP8[$0 + 1 >> 0] = 3; + HEAP8[$0 + 2 >> 0] = 0; + HEAP8[$0 + 3 >> 0] = 4; + return; +} + +function __ZNKSt3__210moneypunctIcLb0EE13do_pos_formatEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP8[$0 >> 0] = 2; + HEAP8[$0 + 1 >> 0] = 3; + HEAP8[$0 + 2 >> 0] = 0; + HEAP8[$0 + 3 >> 0] = 4; + return; +} + +function __ZNKSt3__210moneypunctIcLb0EE13do_neg_formatEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP8[$0 >> 0] = 2; + HEAP8[$0 + 1 >> 0] = 3; + HEAP8[$0 + 2 >> 0] = 0; + HEAP8[$0 + 3 >> 0] = 4; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle12NodeOrString8isStringEv($0) { + $0 = $0 | 0; + var $6 = 0; + if (!(HEAP32[$0 + 4 >> 2] | 0)) $6 = 0; else $6 = (HEAP32[$0 >> 2] | 0) != 0; + return $6 | 0; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJviiEE8getTypesEv($this) { + $this = $this | 0; + return __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJviiEEEE3getEv() | 0; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJvifEE8getTypesEv($this) { + $this = $this | 0; + return __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJvifEEEE3getEv() | 0; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJvidEE8getTypesEv($this) { + $this = $this | 0; + return __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJvidEEEE3getEv() | 0; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiiiEE8getTypesEv($this) { + $this = $this | 0; + return __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJiiiEEEE3getEv() | 0; +} + +function __ZN6vision20BinaryFeatureMatcherILi96EEC2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + HEAPF32[$0 + 12 >> 2] = .699999988079071; + return; +} + +function _start_pass_upsample($0) { + $0 = $0 | 0; + var $2 = 0; + $2 = HEAP32[$0 + 476 >> 2] | 0; + HEAP32[$2 + 92 >> 2] = HEAP32[$0 + 320 >> 2]; + HEAP32[$2 + 96 >> 2] = HEAP32[$0 + 116 >> 2]; + return; +} + +function __ZNSt3__24pairIKiNS_6vectorIN6vision7Point3dIfEENS_9allocatorIS5_EEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__213__vector_baseIN6vision7Point3dIfEENS_9allocatorIS3_EEED2Ev($0 + 4 | 0); + return; +} + +function __ZNSt3__217__call_once_proxyINS_5tupleIJONS_12_GLOBAL__N_111__fake_bindEEEEEEvPv($0) { + $0 = $0 | 0; + __ZNKSt3__212_GLOBAL__N_111__fake_bindclEv(HEAP32[HEAP32[$0 >> 2] >> 2] | 0); + return; +} + +function __ZNKSt3__27codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + HEAP32[$4 >> 2] = $2; + return 3; +} + +function __ZNKSt3__27codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + HEAP32[$4 >> 2] = $2; + return 3; +} + +function __ZN6vision6Logger11getInstanceEv() { + if ((HEAP8[64304] | 0) == 0 ? ___cxa_guard_acquire(64304) | 0 : 0) { + __ZN6vision6LoggerC2Ev(65240); + ___cxa_guard_release(64304); + } + return 65240; +} + +function __ZN6vision28BinaryHierarchicalClusteringILi96EE16setNumHypothesesEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN6vision14BinarykMedoidsILi96EE16setNumHypothesesEi($0 + 12 | 0, $1); + return; +} + +function _arGetDebugMode($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (($0 | 0) != 0 & ($1 | 0) != 0) { + HEAP32[$1 >> 2] = HEAP32[$0 >> 2]; + $$0 = 0; + } else $$0 = -1; + return $$0 | 0; +} + +function __ZNSt3__220__shared_ptr_pointerIPN6vision8KeyframeILi96EEENS_14default_deleteIS3_EENS_9allocatorIS3_EEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__214__shared_countD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNKSt3__27codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_($0, $1, $2, $3, $4) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + HEAP32[$4 >> 2] = $2; + return 3; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle12NodeOrString6isNodeEv($0) { + $0 = $0 | 0; + var $6 = 0; + if (!(HEAP32[$0 >> 2] | 0)) $6 = 0; else $6 = (HEAP32[$0 + 4 >> 2] | 0) == 0; + return $6 | 0; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJviEE8getTypesEv($this) { + $this = $this | 0; + return __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJviEEEE3getEv() | 0; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiiEE8getTypesEv($this) { + $this = $this | 0; + return __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJiiEEEE3getEv() | 0; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJdiEE8getTypesEv($this) { + $this = $this | 0; + return __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJdiEEEE3getEv() | 0; +} + +function __ZN6vision4min4IfEET_S1_S1_S1_S1_($0, $1, $2, $3) { + $0 = +$0; + $1 = +$1; + $2 = +$2; + $3 = +$3; + return +(+__ZN6vision4min2IfEET_S1_S1_(+__ZN6vision4min3IfEET_S1_S1_S1_($0, $1, $2), $3)); +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE8pop_backEv($0) { + $0 = $0 | 0; + var $1 = 0; + $1 = $0 + 4 | 0; + HEAP32[$1 >> 2] = (HEAP32[$1 >> 2] | 0) + -4; + return; +} + +function ___DOUBLE_BITS_670($0) { + $0 = +$0; + var $1 = 0; + HEAPF64[tempDoublePtr >> 3] = $0; + $1 = HEAP32[tempDoublePtr >> 2] | 0; + setTempRet0(HEAP32[tempDoublePtr + 4 >> 2] | 0); + return $1 | 0; +} + +function ___DOUBLE_BITS_273($0) { + $0 = +$0; + var $1 = 0; + HEAPF64[tempDoublePtr >> 3] = $0; + $1 = HEAP32[tempDoublePtr >> 2] | 0; + setTempRet0(HEAP32[tempDoublePtr + 4 >> 2] | 0); + return $1 | 0; +} + +function _arSetLabelingThresh($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (($0 | 0) == 0 | $1 >>> 0 > 255) $$0 = -1; else { + HEAP32[$0 + 16 >> 2] = $1; + $$0 = 0; + } + return $$0 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EE4sizeEv($0) { + $0 = $0 | 0; + return (HEAP32[$0 + 4 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 2 | 0; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiEE8getTypesEv($this) { + $this = $this | 0; + return __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJiEEEE3getEv() | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE8dropBackEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 + 4 >> 2] = (HEAP32[$0 >> 2] | 0) + ($1 << 2); + return; +} + +function b13(p0, p1, p2, p3, p4, p5, p6, p7) { + p0 = p0 | 0; + p1 = p1 | 0; + p2 = p2 | 0; + p3 = p3 | 0; + p4 = p4 | 0; + p5 = p5 | 0; + p6 = p6 | 0; + p7 = p7 | 0; + nullFunc_iiiiiiiii(13); + return 0; +} + +function __ZN6vision12FeaturePointC2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + HEAP32[$0 + 12 >> 2] = 0; + HEAP8[$0 + 16 >> 0] = 1; + return; +} + +function __ZN6vision10ClipScalarIfEET_S1_S1_S1_($0, $1, $2) { + $0 = +$0; + $1 = +$1; + $2 = +$2; + var $$0 = 0.0; + if (!($0 < $1)) if ($0 > $2) $$0 = $2; else $$0 = $0; else $$0 = $1; + return +$$0; +} + +function __ZN6vision10DoGPyramidC2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + HEAP32[$0 + 12 >> 2] = 0; + HEAP32[$0 + 16 >> 2] = 0; + return; +} + +function _arSetImageProcMode($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (($0 | 0) != 0 & $1 >>> 0 < 2) { + HEAP32[$0 + 20 >> 2] = $1; + $$0 = 0; + } else $$0 = -1; + return $$0 | 0; +} + +function __ZNK6vision18BinaryFeatureStore7featureEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0; + $3 = Math_imul(HEAP32[$0 >> 2] | 0, $1) | 0; + return (HEAP32[$0 + 4 >> 2] | 0) + $3 | 0; +} + +function __ZN12_GLOBAL__N_112OutputStream5resetEPcm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 >> 2] = $1; + HEAP32[$0 + 8 >> 2] = $2; + return; +} + +function _jpeg_alloc_quant_table($0) { + $0 = $0 | 0; + var $4 = 0; + $4 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$0 + 4 >> 2] >> 2] & 63]($0, 0, 132) | 0; + HEAP32[$4 + 128 >> 2] = 0; + return $4 | 0; +} + +function _arSetLabelingMode($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (($0 | 0) != 0 & $1 >>> 0 < 2) { + HEAP32[$0 + 12 >> 2] = $1; + $$0 = 0; + } else $$0 = -1; + return $$0 | 0; +} + +function __ZN6vision7Point3dIfEC2Efff($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + $3 = +$3; + HEAPF32[$0 >> 2] = $1; + HEAPF32[$0 + 4 >> 2] = $2; + HEAPF32[$0 + 8 >> 2] = $3; + return; +} + +function __ZN6vision18BinaryFeatureStore7featureEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0; + $3 = Math_imul(HEAP32[$0 >> 2] | 0, $1) | 0; + return (HEAP32[$0 + 4 >> 2] | 0) + $3 | 0; +} + +function dynCall_viiii(index, a1, a2, a3, a4) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + a3 = a3 | 0; + a4 = a4 | 0; + FUNCTION_TABLE_viiii[index & 31](a1 | 0, a2 | 0, a3 | 0, a4 | 0); +} + +function _jpeg_alloc_huff_table($0) { + $0 = $0 | 0; + var $4 = 0; + $4 = FUNCTION_TABLE_iiii[HEAP32[HEAP32[$0 + 4 >> 2] >> 2] & 63]($0, 0, 280) | 0; + HEAP32[$4 + 276 >> 2] = 0; + return $4 | 0; +} + +function __ZN6vision21HoughSimilarityVoting26setObjectCenterInReferenceEff($0, $1, $2) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + HEAPF32[$0 + 8 >> 2] = $1; + HEAPF32[$0 + 12 >> 2] = $2; + return; +} + +function __ZN6vision14BinarykMedoidsILi96EE4setkEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 + 4 >> 2] = $1; + __ZNSt3__26vectorIiNS_9allocatorIiEEE6resizeEm($0 + 12 | 0, $1); + return; +} + +function _strtoull_l($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $4 = 0; + $4 = _strtoull($0, $1, $2) | 0; + setTempRet0(getTempRet0() | 0); + return $4 | 0; +} + +function __ZNK6vision9Exception4whatEv($0) { + $0 = $0 | 0; + var $1 = 0, $6 = 0; + $1 = $0 + 4 | 0; + if ((HEAP8[$1 + 11 >> 0] | 0) < 0) $6 = HEAP32[$1 >> 2] | 0; else $6 = $1; + return $6 | 0; +} + +function __ZN12_GLOBAL__N_110StringViewC2EPKc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $4 = 0; + HEAP32[$0 >> 2] = $1; + $4 = $1 + (_strlen($1) | 0) | 0; + HEAP32[$0 + 4 >> 2] = $4; + return; +} + +function _icpDeleteHandle($0) { + $0 = $0 | 0; + var $$0 = 0, $1 = 0; + $1 = HEAP32[$0 >> 2] | 0; + if (!$1) $$0 = -1; else { + _free($1); + HEAP32[$0 >> 2] = 0; + $$0 = 0; + } + return $$0 | 0; +} + +function _strtoll_l($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + var $4 = 0; + $4 = _strtoll($0, $1, $2) | 0; + setTempRet0(getTempRet0() | 0); + return $4 | 0; +} + +function _arGetPatternDetectionMode($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (!$0) $$0 = -1; else { + HEAP32[$1 >> 2] = HEAP32[$0 + 24 >> 2]; + $$0 = 0; + } + return $$0 | 0; +} + +function __ZNSt3__28time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__210__time_putD2Ev($0 + 8 | 0); + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__28time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__210__time_putD2Ev($0 + 8 | 0); + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiiNSt3__212basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEE8getCountEv($this) { + $this = $this | 0; + return 3; +} + +function __ZN6vision8KeyframeILi96EED2Ev($0) { + $0 = $0 | 0; + __ZN6vision28BinaryHierarchicalClusteringILi96EED2Ev($0 + 36 | 0); + __ZN6vision18BinaryFeatureStoreD2Ev($0 + 8 | 0); + return; +} + +function _strtoll($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0; + $3 = _strtox_735($0, $1, $2, 0, -2147483648) | 0; + setTempRet0(getTempRet0() | 0); + return $3 | 0; +} + +function __ZNKSt3__28numpunctIwE11do_groupingEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_($0, $1 + 16 | 0); + return; +} + +function __ZNKSt3__28numpunctIcE11do_groupingEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_($0, $1 + 12 | 0); + return; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiNSt3__212basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEE8getCountEv($this) { + $this = $this | 0; + return 2; +} + +function __ZN6vision25GaussianScaleSpacePyramidD2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 16772; + __ZNSt3__213__vector_baseIN6vision5ImageENS_9allocatorIS2_EEED2Ev($0 + 4 | 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle9NodeArrayC2EPPNS0_4NodeEm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + HEAP32[$0 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = $2; + return; +} + +function _start_pass_merged_upsample($0) { + $0 = $0 | 0; + var $2 = 0; + $2 = HEAP32[$0 + 476 >> 2] | 0; + HEAP32[$2 + 36 >> 2] = 0; + HEAP32[$2 + 44 >> 2] = HEAP32[$0 + 116 >> 2]; + return; +} + +function _i64Add(a, b, c, d) { + a = a | 0; + b = b | 0; + c = c | 0; + d = d | 0; + var l = 0; + l = a + c >>> 0; + return (setTempRet0(b + d + (l >>> 0 < a >>> 0 | 0) >>> 0 | 0), l | 0) | 0; +} + +function _arGetPattRatio($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (!$0) $$0 = -1; else { + HEAPF64[$1 >> 3] = +HEAPF64[$0 + 7062416 >> 3]; + $$0 = 0; + } + return $$0 | 0; +} + +function ___cxa_pure_virtual() { + var sp = 0; + sp = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16); + _abort_message(51262, sp); +} + +function __ZNSt3__210__time_putD2Ev($0) { + $0 = $0 | 0; + var $1 = 0; + $1 = HEAP32[$0 >> 2] | 0; + if (($1 | 0) != (__ZNSt3__26__clocEv() | 0)) _freelocale(HEAP32[$0 >> 2] | 0); + return; +} + +function __ZN6vision21HoughSimilarityVoting21setRefImageDimensionsEii($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + HEAP32[$0 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = $2; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EE8isInlineEv($0) { + $0 = $0 | 0; + return (HEAP32[$0 >> 2] | 0) == ($0 + 12 | 0) | 0; +} + +function __ZN6vision17PriorityQueueItemILi96EEC2EPKNS_4NodeILi96EEEj($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + HEAP32[$0 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = $2; + return; +} + +function __ZNK6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEE9matchedIdEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 24 >> 2] | 0; +} + +function __ZN6vision28BinaryHierarchicalClusteringILi96EE13setNumCentersEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN6vision14BinarykMedoidsILi96EE4setkEi($0 + 12 | 0, $1); + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocator17allocateNodeArrayEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN12_GLOBAL__N_120BumpPointerAllocator8allocateEm($0, $1 << 2) | 0; +} + +function _arGetImageProcMode($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (!$0) $$0 = -1; else { + HEAP32[$1 >> 2] = HEAP32[$0 + 20 >> 2]; + $$0 = 0; + } + return $$0 | 0; +} + +function __ZN6vision10FastRandomERi($0) { + $0 = $0 | 0; + var $3 = 0; + $3 = ((HEAP32[$0 >> 2] | 0) * 214013 | 0) + 2531011 | 0; + HEAP32[$0 >> 2] = $3; + return $3 >>> 16 & 32767 | 0; +} + +function _strtoull($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + var $3 = 0; + $3 = _strtox_735($0, $1, $2, -1, -1) | 0; + setTempRet0(getTempRet0() | 0); + return $3 | 0; +} + +function __ZN6vision10FastMedianIfEET_PS1_i($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return +(+__ZN6vision11PartialSortIfEET_PS1_ii($0, $1, ($1 & 1) + -1 + (($1 | 0) / 2 | 0) | 0)); +} + +function __ZN6vision10CauchyCostIfEET_PKS1_S1_($0, $1) { + $0 = $0 | 0; + $1 = +$1; + return +(+__ZN6vision10CauchyCostIfEET_S1_S1_S1_(+HEAPF32[$0 >> 2], +HEAPF32[$0 + 4 >> 2], $1)); +} + +function __ZN6vision14SampleReceptorERKNS_5ImageEff($0, $1, $2) { + $0 = $0 | 0; + $1 = +$1; + $2 = +$2; + return +(+__ZN6vision22SampleReceptorBilinearERKNS_5ImageEff($0, $1, $2)); +} + +function b12(p0, p1, p2, p3, p4, p5, p6) { + p0 = p0 | 0; + p1 = p1 | 0; + p2 = p2 | 0; + p3 = p3 | 0; + p4 = p4 | 0; + p5 = p5 | 0; + p6 = p6 | 0; + nullFunc_iiiiiiii(12); + return 0; +} + +function _new_color_map_1_quant($0) { + $0 = $0 | 0; + var $1 = 0; + $1 = HEAP32[$0 >> 2] | 0; + HEAP32[$1 + 20 >> 2] = 47; + FUNCTION_TABLE_vi[HEAP32[$1 >> 2] & 255]($0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE4sizeEv($0) { + $0 = $0 | 0; + return (HEAP32[$0 + 4 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 2 | 0; +} + +function _finish_input_pass($0) { + $0 = $0 | 0; + FUNCTION_TABLE_vi[HEAP32[(HEAP32[$0 + 468 >> 2] | 0) + 8 >> 2] & 255]($0); + HEAP32[HEAP32[$0 + 460 >> 2] >> 2] = 90; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE4sizeEv($0) { + $0 = $0 | 0; + return (HEAP32[$0 + 4 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 2 | 0; +} + +function dynCall_iiii(index, a1, a2, a3) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + a3 = a3 | 0; + return FUNCTION_TABLE_iiii[index & 63](a1 | 0, a2 | 0, a3 | 0) | 0; +} + +function _arSetMatrixCodeType($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (!$0) $$0 = -1; else { + HEAP32[$0 + 7062424 >> 2] = $1; + $$0 = 0; + } + return $$0 | 0; +} + +function _arGetTransMatMultiSquareRobust($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + return +(+_arGetTransMatMultiSquare2($0, $1, $2, $3, 1)); +} + +function __ZNSt3__24pairIKiNS_10shared_ptrIN6vision8KeyframeILi96EEEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__210shared_ptrIN6vision8KeyframeILi96EEEED2Ev($0 + 4 | 0); + return; +} + +function __ZNK6vision17PriorityQueueItemILi96EEltERKS1_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return (HEAP32[$0 + 4 >> 2] | 0) >>> 0 > (HEAP32[$1 + 4 >> 2] | 0) >>> 0 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE5emptyEv($0) { + $0 = $0 | 0; + return (HEAP32[$0 >> 2] | 0) == (HEAP32[$0 + 4 >> 2] | 0) | 0; +} + +function __ZN6vision9ExceptionD2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 16788; + __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($0 + 4 | 0); + return; +} + +function __ZN6vision4min3IfEET_S1_S1_S1_($0, $1, $2) { + $0 = +$0; + $1 = +$1; + $2 = +$2; + return +(+__ZN6vision4min2IfEET_S1_S1_(+__ZN6vision4min2IfEET_S1_S1_($0, $1), $2)); +} + +function _icpSetInlierProbability($0, $1) { + $0 = $0 | 0; + $1 = +$1; + var $$0 = 0; + if (!$0) $$0 = -1; else { + HEAPF64[$0 + 128 >> 3] = $1; + $$0 = 0; + } + return $$0 | 0; +} + +function ___udivdi3($a$0, $a$1, $b$0, $b$1) { + $a$0 = $a$0 | 0; + $a$1 = $a$1 | 0; + $b$0 = $b$0 | 0; + $b$1 = $b$1 | 0; + return ___udivmoddi4($a$0, $a$1, $b$0, $b$1, 0) | 0; +} + +function _strchr($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = ___strchrnul($0, $1) | 0; + return ((HEAP8[$2 >> 0] | 0) == ($1 & 255) << 24 >> 24 ? $2 : 0) | 0; +} + +function __ZNSt3__220__shared_ptr_pointerIPhNS_14default_deleteIhEENS_9allocatorIhEEE16__on_zero_sharedEv($0) { + $0 = $0 | 0; + __ZdlPv(HEAP32[$0 + 12 >> 2] | 0); + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_9money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEjEERT_T0_() { + HEAP32[16243] = 0; + HEAP32[16242] = 23052; + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_9money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEjEERT_T0_() { + HEAP32[16241] = 0; + HEAP32[16240] = 23024; + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_9money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEjEERT_T0_() { + HEAP32[16239] = 0; + HEAP32[16238] = 22996; + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_9money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEjEERT_T0_() { + HEAP32[16237] = 0; + HEAP32[16236] = 22968; + return; +} + +function __ZNSt3__211char_traitsIcE4moveEPcPKcm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + if ($2 | 0) _memmove($0 | 0, $1 | 0, $2 | 0) | 0; + return $0 | 0; +} + +function _compE_180($a, $b) { + $a = $a | 0; + $b = $b | 0; + var $sub = 0.0; + $sub = +HEAPF32[$a >> 2] - +HEAPF32[$b >> 2]; + return ($sub < 0.0 ? -1 : $sub > 0.0 & 1) | 0; +} + +function _arImageProcLumaHistAndCDFAndMedian($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return _arImageProcLumaHistAndCDFAndPercentile($0, $1, .5, $2) | 0; +} + +function __ZNSt3__220__shared_ptr_pointerIPhNS_14default_deleteIhEENS_9allocatorIhEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__214__shared_countD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__211char_traitsIcE4copyEPcPKcm($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + if ($2 | 0) _memcpy($0 | 0, $1 | 0, $2 | 0) | 0; + return $0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22AbstractManglingParserINS0_14ManglingParserINS_16DefaultAllocatorEEES3_E10getDerivedEv($0) { + $0 = $0 | 0; + return $0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle12NodeOrStringC2EPNS0_4NodeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = 0; + return; +} + +function _ar2SetTemplateSize2($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (!$0) $$0 = -1; else { + HEAP32[$0 + 32 >> 2] = $1; + $$0 = 0; + } + return $$0 | 0; +} + +function _ar2SetTemplateSize1($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (!$0) $$0 = -1; else { + HEAP32[$0 + 28 >> 2] = $1; + $$0 = 0; + } + return $$0 | 0; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_7num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEjEERT_T0_() { + HEAP32[16227] = 0; + HEAP32[16226] = 21388; + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_7num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEjEERT_T0_() { + HEAP32[16225] = 0; + HEAP32[16224] = 21336; + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_7num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEjEERT_T0_() { + HEAP32[16223] = 0; + HEAP32[16222] = 21272; + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_7num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEjEERT_T0_() { + HEAP32[16221] = 0; + HEAP32[16220] = 21208; + return; +} + +function _arGetTransMatMultiSquare($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + return +(+_arGetTransMatMultiSquare2($0, $1, $2, $3, 0)); +} + +function _ar2SetTrackingThresh($0, $1) { + $0 = $0 | 0; + $1 = +$1; + var $$0 = 0; + if (!$0) $$0 = -1; else { + HEAPF32[$0 + 44 >> 2] = $1; + $$0 = 0; + } + return $$0 | 0; +} + +function __ZZN12_GLOBAL__N_116itanium_demangle13ParameterPackC1ENS0_9NodeArrayEENKUlPNS0_4NodeEE1_clES4_($0) { + $0 = $0 | 0; + return (HEAP8[$0 + 5 >> 0] | 0) == 1 | 0; +} + +function __ZZN12_GLOBAL__N_116itanium_demangle13ParameterPackC1ENS0_9NodeArrayEENKUlPNS0_4NodeEE0_clES4_($0) { + $0 = $0 | 0; + return (HEAP8[$0 + 7 >> 0] | 0) == 1 | 0; +} + +function __ZNSt3__220__shared_ptr_pointerIPh16NullArrayDeleterIhENS_9allocatorIhEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__214__shared_countD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__217_DeallocateCaller27__do_deallocate_handle_sizeEPvm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__217_DeallocateCaller9__do_callEPv($0); + return; +} + +function __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEED2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEED2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNK6vision14VisualDatabaseINS_14FREAKExtractorENS_18BinaryFeatureStoreENS_20BinaryFeatureMatcherILi96EEEE7inliersEv($0) { + $0 = $0 | 0; + return $0 + 12 | 0; +} + +function __ZZN12_GLOBAL__N_116itanium_demangle13ParameterPackC1ENS0_9NodeArrayEENKUlPNS0_4NodeEE_clES4_($0) { + $0 = $0 | 0; + return (HEAP8[$0 + 6 >> 0] | 0) == 1 | 0; +} + +function __ZNSt3__28ios_base33__set_badbit_and_consider_rethrowEv($0) { + $0 = $0 | 0; + var $1 = 0; + $1 = $0 + 16 | 0; + HEAP32[$1 >> 2] = HEAP32[$1 >> 2] | 1; + return; +} + +function __ZN6vision8fastexp6IfEET_S1_($0) { + $0 = +$0; + return +((((((($0 + 6.0) * $0 + 30.0) * $0 + 120.0) * $0 + 360.0) * $0 + 720.0) * $0 + 720.0) * .0013888888); +} + +function _ar2SetSearchSize($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (!$0) $$0 = -1; else { + HEAP32[$0 + 24 >> 2] = $1; + $$0 = 0; + } + return $$0 | 0; +} + +function b23(p0, p1, p2, p3, p4, p5, p6) { + p0 = p0 | 0; + p1 = p1 | 0; + p2 = p2 | 0; + p3 = p3 | 0; + p4 = p4 | 0; + p5 = p5 | 0; + p6 = p6 | 0; + nullFunc_viiiiiii(23); +} + +function _arMatrixSelfInvf($0) { + $0 = $0 | 0; + var $3 = 0; + $3 = HEAP32[$0 + 4 >> 2] | 0; + return ((_minvf(HEAP32[$0 >> 2] | 0, $3, $3) | 0) == 0) << 31 >> 31 | 0; +} + +function _icpGetXw2XcCleanup_221($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + _free($0); + _free($1); + _free($2); + _free($3); + return; +} + +function __ZNSt3__26locale5facet16__on_zero_sharedEv($0) { + $0 = $0 | 0; + if ($0 | 0) FUNCTION_TABLE_vi[HEAP32[(HEAP32[$0 >> 2] | 0) + 4 >> 2] & 255]($0); + return; +} + +function __ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEED1Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEED1Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__213basic_istreamIwNS_11char_traitsIwEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__213basic_istreamIwNS_11char_traitsIwEEED1Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__213basic_istreamIcNS_11char_traitsIcEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__213basic_istreamIcNS_11char_traitsIcEEED1Ev($0); + __ZdlPv($0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE8isInlineEv($0) { + $0 = $0 | 0; + return (HEAP32[$0 >> 2] | 0) == ($0 + 12 | 0) | 0; +} + +function __ZN12_GLOBAL__N_110StringViewC2EPKcS2_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + HEAP32[$0 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = $2; + return; +} + +function _arMatrixSelfInv($0) { + $0 = $0 | 0; + var $3 = 0; + $3 = HEAP32[$0 + 4 >> 2] | 0; + return ((_minv(HEAP32[$0 >> 2] | 0, $3, $3) | 0) == 0) << 31 >> 31 | 0; +} + +function _ar2SetSimThresh($0, $1) { + $0 = $0 | 0; + $1 = +$1; + var $$0 = 0; + if (!$0) $$0 = -1; else { + HEAPF32[$0 + 40 >> 2] = $1; + $$0 = 0; + } + return $$0 | 0; +} + +function __ZNSt3__214__ptr_in_rangeIwEEbPKT_S3_S3_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return $1 >>> 0 <= $0 >>> 0 & $0 >>> 0 < $2 >>> 0 | 0; +} + +function __ZNSt3__214__ptr_in_rangeIcEEbPKT_S3_S3_($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return $1 >>> 0 <= $0 >>> 0 & $0 >>> 0 < $2 >>> 0 | 0; +} + +function __ZNSt11logic_errorC2EPKc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = 17452; + __ZNSt3__218__libcpp_refstringC2EPKc($0 + 4 | 0, $1); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE8isInlineEv($0) { + $0 = $0 | 0; + return (HEAP32[$0 >> 2] | 0) == ($0 + 12 | 0) | 0; +} + +function __ZN12_GLOBAL__N_114SwapAndRestoreIbED2Ev($0) { + $0 = $0 | 0; + if (HEAP8[$0 + 5 >> 0] | 0) HEAP8[HEAP32[$0 >> 2] >> 0] = HEAP8[$0 + 4 >> 0] | 0; + return; +} + +function __ZN12_GLOBAL__N_114SwapAndRestoreIPKcED2Ev($0) { + $0 = $0 | 0; + if (HEAP8[$0 + 8 >> 0] | 0) HEAP32[HEAP32[$0 >> 2] >> 2] = HEAP32[$0 + 4 >> 2]; + return; +} + +function dynCall_viii(index, a1, a2, a3) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + a3 = a3 | 0; + FUNCTION_TABLE_viii[index & 3](a1 | 0, a2 | 0, a3 | 0); +} + +function ___cxa_is_pointer_type($0) { + $0 = $0 | 0; + var $3 = 0; + if (!$0) $3 = 0; else $3 = (___dynamic_cast($0, 13904, 13992, 0) | 0) != 0 & 1; + return $3 | 0; +} + +function __ZNSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__26locale2id6__initEv($0) { + $0 = $0 | 0; + var $1 = 0; + $1 = HEAP32[16631] | 0; + HEAP32[16631] = $1 + 1; + HEAP32[$0 + 4 >> 2] = $1 + 1; + return; +} + +function __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJiiNSt3__212basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEE3getEv() { + return 16984; +} + +function __ZNSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_120BumpPointerAllocatorC2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 4096 >> 2] = $0; + return; +} + +function __ZN12_GLOBAL__N_114SwapAndRestoreIjED2Ev($0) { + $0 = $0 | 0; + if (HEAP8[$0 + 8 >> 0] | 0) HEAP32[HEAP32[$0 >> 2] >> 2] = HEAP32[$0 + 4 >> 2]; + return; +} + +function __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJiNSt3__212basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEE3getEv() { + return 16964; +} + +function _wcslen($0) { + $0 = $0 | 0; + var $$0 = 0; + $$0 = $0; + while (1) if (!(HEAP32[$$0 >> 2] | 0)) break; else $$0 = $$0 + 4 | 0; + return $$0 - $0 >> 2 | 0; +} + +function __ZNSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle9NodeArrayixEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return HEAP32[(HEAP32[$0 >> 2] | 0) + ($1 << 2) >> 2] | 0; +} + +function __ZN6vision28BinaryHierarchicalClusteringILi96EE21setMinFeaturesPerNodeEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 + 108 >> 2] = $1; + return; +} + +function _fputs($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $2 = 0; + $2 = _strlen($0) | 0; + return ((_fwrite($0, 1, $2, $1) | 0) != ($2 | 0)) << 31 >> 31 | 0; +} + +function _compE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $4 = 0.0; + $4 = +HEAPF64[$0 >> 3] - +HEAPF64[$1 >> 3]; + return ($4 < 0.0 ? -1 : $4 > 0.0 & 1) | 0; +} + +function __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE9pbackfailEj($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZNSt3__211char_traitsIwE3eofEv() | 0; +} + +function __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZNSt3__211char_traitsIcE3eofEv() | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangleoRERNS0_10QualifiersES1_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = HEAP32[$0 >> 2] | $1; + return; +} + +function b11(p0, p1, p2, p3, p4, p5) { + p0 = p0 | 0; + p1 = p1 | 0; + p2 = p2 | 0; + p3 = p3 | 0; + p4 = p4 | 0; + p5 = p5 | 0; + nullFunc_iiiiiii(11); + return 0; +} + +function __ZNSt3__24pairIKiNS_6vectorIiNS_9allocatorIiEEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__213__vector_baseIiNS_9allocatorIiEEED2Ev($0 + 4 | 0); + return; +} + +function __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE8overflowEj($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZNSt3__211char_traitsIwE3eofEv() | 0; +} + +function __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE8overflowEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZNSt3__211char_traitsIcE3eofEv() | 0; +} + +function __ZN6vision20BinaryFeatureMatcherILi96EED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__213__vector_baseIN6vision7match_tENS_9allocatorIS2_EEED2Ev($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_24ForwardTemplateReferenceELm4EE5beginEv($0) { + $0 = $0 | 0; + return HEAP32[$0 >> 2] | 0; +} + +function __ZN10emscripten8internal6TypeIDINS_11memory_viewItEEvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDINS_11memory_viewItEEE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDINS_11memory_viewIsEEvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIsEEE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDINS_11memory_viewImEEvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDINS_11memory_viewImEEE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDINS_11memory_viewIlEEvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIlEEE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDINS_11memory_viewIjEEvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIjEEE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDINS_11memory_viewIiEEvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIiEEE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDINS_11memory_viewIhEEvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIhEEE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDINS_11memory_viewIfEEvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIfEEE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDINS_11memory_viewIeEEvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIeEEE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDINS_11memory_viewIdEEvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIdEEE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDINS_11memory_viewIcEEvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIcEEE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDINS_11memory_viewIaEEvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIaEEE3getEv() | 0; +} + +function dynCall_viid(index, a1, a2, a3) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + a3 = +a3; + FUNCTION_TABLE_viid[index & 3](a1 | 0, a2 | 0, +a3); +} + +function ___cxx_global_var_init_1() { + HEAP32[16320] = 0; + HEAP32[16321] = 0; + HEAP32[16322] = 0; + HEAP32[16323] = 0; + HEAP32[16324] = 1065353216; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE5clearEv($0) { + $0 = $0 | 0; + HEAP32[$0 + 4 >> 2] = HEAP32[$0 >> 2]; + return; +} + +function __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEED2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 20632; + __ZNSt3__26localeD2Ev($0 + 4 | 0); + return; +} + +function __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEED2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 20568; + __ZNSt3__26localeD2Ev($0 + 4 | 0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle4Node11getBaseNameEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZN12_GLOBAL__N_110StringViewC2Ev($0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle16FunctionEncoding19hasRHSComponentSlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return 1; +} + +function __ZN6vision10CopyVectorIiEEvPT_PKS1_m($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + _memcpy($0 | 0, $1 | 0, $2 << 2 | 0) | 0; + return; +} + +function __ZN6vision10CopyVectorIfEEvPT_PKS1_m($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + _memcpy($0 | 0, $1 | 0, $2 << 2 | 0) | 0; + return; +} + +function b10(p0, p1, p2, p3, p4, p5) { + p0 = p0 | 0; + p1 = p1 | 0; + p2 = p2 | 0; + p3 = p3 | 0; + p4 = p4 | 0; + p5 = +p5; + nullFunc_iiiiiid(10); + return 0; +} + +function ___cxx_global_var_init() { + HEAP32[16315] = 0; + HEAP32[16316] = 0; + HEAP32[16317] = 0; + HEAP32[16318] = 0; + HEAP32[16319] = 1065353216; + return; +} + +function ___ctype_get_mb_cur_max() { + var $1 = 0; + $1 = (___pthread_self() | 0) + 188 | 0; + return ((HEAP32[HEAP32[$1 >> 2] >> 2] | 0) == 0 ? 1 : 4) | 0; +} + +function __ZN6vision28BinaryHierarchicalClusteringILi96EE16setMaxNodesToPopEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 + 104 >> 2] = $1; + return; +} + +function __ZNSt3__26locale5__imp12make_classicEv() { + __ZNSt3__212_GLOBAL__N_14makeINS_6locale5__impEjEERT_T0_(); + HEAP32[16712] = 65064; + return 66848; +} + +function __ZNK6vision18BinaryFeatureStore4sizeEv($0) { + $0 = $0 | 0; + return ((HEAP32[$0 + 20 >> 2] | 0) - (HEAP32[$0 + 16 >> 2] | 0) | 0) / 20 | 0 | 0; +} + +function establishStackSpace(stackBase, stackMax) { + stackBase = stackBase | 0; + stackMax = stackMax | 0; + STACKTOP = stackBase; + STACK_MAX = stackMax; +} + +function b4(p0, p1, p2, p3, p4, p5) { + p0 = p0 | 0; + p1 = +p1; + p2 = p2 | 0; + p3 = p3 | 0; + p4 = p4 | 0; + p5 = p5 | 0; + nullFunc_iidiiii(4); + return 0; +} + +function _kpmCreateHandle($0) { + $0 = $0 | 0; + return __ZL19kpmCreateHandleCoreP9ARParamLTiii($0, HEAP32[$0 >> 2] | 0, HEAP32[$0 + 4 >> 2] | 0, 1) | 0; +} + +function __ZN6vision10CauchyCostIfEET_S1_S1_S1_($0, $1, $2) { + $0 = +$0; + $1 = +$1; + $2 = +$2; + return +(+Math_log(+(($0 * $0 + $1 * $1) * $2 + 1.0))); +} + +function __ZNK12_GLOBAL__N_116itanium_demangle16FunctionEncoding15hasFunctionSlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return 1; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle12FunctionType19hasRHSComponentSlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return 1; +} + +function __ZN6vision15HammingDistanceILi96EEEjPKhS2_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return __ZN6vision18HammingDistance768EPKjS1_($0, $1) | 0; +} + +function _reset_error_mgr($0) { + $0 = $0 | 0; + var $1 = 0; + $1 = HEAP32[$0 >> 2] | 0; + HEAP32[$1 + 108 >> 2] = 0; + HEAP32[$1 + 20 >> 2] = 0; + return; +} + +function __ZN6vision10CopyVectorIhEEvPT_PKS1_m($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + _memcpy($0 | 0, $1 | 0, $2 | 0) | 0; + return; +} + +function _strerror($0) { + $0 = $0 | 0; + var $2 = 0; + $2 = (___pthread_self_105() | 0) + 188 | 0; + return ___strerror_l($0, HEAP32[$2 >> 2] | 0) | 0; +} + +function __ZNKSt3__26vectorIN6vision25DoGScaleInvariantDetector12FeaturePointENS_9allocatorIS3_EEE8max_sizeEv($0) { + $0 = $0 | 0; + return 119304647; +} + +function __ZN6vision7match_tC2Eii($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + HEAP32[$0 >> 2] = $1; + HEAP32[$0 + 4 >> 2] = $2; + return; +} + +function __ZNSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNKSt3__26locale5__imp9use_facetEl($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return HEAP32[(HEAP32[$0 + 8 >> 2] | 0) + ($1 << 2) >> 2] | 0; +} + +function __ZNK6vision25GaussianScaleSpacePyramid4sizeEv($0) { + $0 = $0 | 0; + return (HEAP32[$0 + 8 >> 2] | 0) - (HEAP32[$0 + 4 >> 2] | 0) >> 5 | 0; +} + +function dynCall_iii(index, a1, a2) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + return FUNCTION_TABLE_iii[index & 127](a1 | 0, a2 | 0) | 0; +} + +function __ZNSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray3endEv($0) { + $0 = $0 | 0; + return (HEAP32[$0 >> 2] | 0) + (HEAP32[$0 + 4 >> 2] << 2) | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle9ArrayType19hasRHSComponentSlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return 1; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle12FunctionType15hasFunctionSlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return 1; +} + +function b22(p0, p1, p2, p3, p4, p5) { + p0 = p0 | 0; + p1 = p1 | 0; + p2 = p2 | 0; + p3 = p3 | 0; + p4 = p4 | 0; + p5 = p5 | 0; + nullFunc_viiiiii(22); +} + +function _dot($0, $1, $2, $3, $4, $5) { + $0 = +$0; + $1 = +$1; + $2 = +$2; + $3 = +$3; + $4 = +$4; + $5 = +$5; + return +($0 * $3 + $1 * $4 + $2 * $5); +} + +function __ZNSt3__28ios_base5clearEj($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 + 16 >> 2] = (HEAP32[$0 + 24 >> 2] | 0) == 0 | $1; + return; +} + +function __ZNSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__210shared_ptrIN6vision8KeyframeILi96EEEE18__enable_weak_thisEz($0, $varargs) { + $0 = $0 | 0; + $varargs = $varargs | 0; + return; +} + +function __ZNKSt3__26vectorINS0_INS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEEENS3_IS7_EEE8max_sizeEv($0) { + $0 = $0 | 0; + return 357913941; +} + +function __ZN6vision25DoGScaleInvariantDetector21setLaplacianThresholdEf($0, $1) { + $0 = $0 | 0; + $1 = +$1; + HEAPF32[$0 + 52 >> 2] = $1; + return; +} + +function __ZNKSt3__25ctypeIwE9do_narrowEwc($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return ($1 >>> 0 < 128 ? $1 & 255 : $2) | 0; +} + +function __ZNK6vision10DoGPyramid14scaleFromIndexEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return ($1 | 0) % (HEAP32[$0 + 16 >> 2] | 0) | 0 | 0; +} + +function __ZN6vision11ZeroVector3IfEEvPT_($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + return; +} + +function __ZNSt3__211__stdoutbufIwED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEED2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__211__stdoutbufIcED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEED2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNKSt3__25ctypeIcE9do_narrowEcc($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return ($1 << 24 >> 24 > -1 ? $1 : $2) | 0; +} + +function __ZNK6vision18BinaryFeatureStore5pointEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return (HEAP32[$0 + 16 >> 2] | 0) + ($1 * 20 | 0) | 0; +} + +function __ZN6vision25GaussianScaleSpacePyramidD0Ev($0) { + $0 = $0 | 0; + __ZN6vision25GaussianScaleSpacePyramidD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZN6vision11Cofactor2x2IfEET_S1_S1_S1_S1_($0, $1, $2, $3) { + $0 = +$0; + $1 = +$1; + $2 = +$2; + $3 = +$3; + return +($0 * $3 - $1 * $2); +} + +function __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return $0 | 0; +} + +function __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return $0 | 0; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_7codecvtIwc11__mbstate_tEEjEERT_T0_() { + __ZNSt3__27codecvtIwc11__mbstate_tEC2Em(64792, 1); + return; +} + +function __ZNSt3__210__stdinbufIwED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEED2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__210__stdinbufIcED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEED2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNK6vision5Timer24duration_in_millisecondsEv($0) { + $0 = $0 | 0; + return +(+__ZNK6vision5Timer19duration_in_secondsEv($0) * 1.0e3); +} + +function __ZN6vision18BinaryFeatureStore5pointEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return (HEAP32[$0 + 16 >> 2] | 0) + ($1 * 20 | 0) | 0; +} + +function __ZN10__cxxabiv123__fundamental_type_infoD0Ev($0) { + $0 = $0 | 0; + __ZN10__cxxabiv116__shim_type_infoD2Ev($0); + __ZdlPv($0); + return; +} + +function dynCall_dii(index, a1, a2) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + return +FUNCTION_TABLE_dii[index & 1](a1 | 0, a2 | 0); +} + +function _error_exit($0) { + $0 = $0 | 0; + FUNCTION_TABLE_vi[HEAP32[(HEAP32[$0 >> 2] | 0) + 8 >> 2] & 255]($0); + _jpeg_destroy($0); + _exit(1); +} + +function __ZNK12_GLOBAL__N_116itanium_demangle4Node19hasRHSComponentSlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return 0; +} + +function _wctomb($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $$0 = 0; + if (!$0) $$0 = 0; else $$0 = _wcrtomb($0, $1, 0) | 0; + return $$0 | 0; +} + +function _swapc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0; + $3 = _llvm_bswap_i32($0 | 0) | 0; + return (($1 | 0) == 0 ? $0 : $3) | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle4Node13getSyntaxNodeERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return $0 | 0; +} + +function __ZN6vision25DoGScaleInvariantDetector16setEdgeThresholdEf($0, $1) { + $0 = $0 | 0; + $1 = +$1; + HEAPF32[$0 + 56 >> 2] = $1; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle12NodeOrStringC2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + return; +} + +function __ZN10__cxxabiv121__vmi_class_type_infoD0Ev($0) { + $0 = $0 | 0; + __ZN10__cxxabiv116__shim_type_infoD2Ev($0); + __ZdlPv($0); + return; +} + +function _setThrew(threw, value) { + threw = threw | 0; + value = value | 0; + if (!__THREW__) { + __THREW__ = threw; + threwValue = value; + } +} + +function __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE9underflowEv($0) { + $0 = $0 | 0; + return __ZNSt3__211char_traitsIwE3eofEv() | 0; +} + +function __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE9underflowEv($0) { + $0 = $0 | 0; + return __ZNSt3__211char_traitsIcE3eofEv() | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle9ArrayType12hasArraySlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return 1; +} + +function __ZN10__cxxabiv120__si_class_type_infoD0Ev($0) { + $0 = $0 | 0; + __ZN10__cxxabiv116__shim_type_infoD2Ev($0); + __ZdlPv($0); + return; +} + +function __GLOBAL__sub_I_ARToolKitJS_cpp() { + ___cxx_global_var_init(); + ___cxx_global_var_init_1(); + ___cxx_global_var_init_40(); + return; +} + +function _jround_up($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var $3 = 0; + $3 = $0 + -1 + $1 | 0; + return $3 - (($3 | 0) % ($1 | 0) | 0) | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE3endEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 4 >> 2] | 0; +} + +function __ZN10emscripten8internal11LightTypeIDINSt3__212basic_stringIwNS2_11char_traitsIwEENS2_9allocatorIwEEEEE3getEv() { + return 15328; +} + +function __ZN10emscripten8internal11LightTypeIDINSt3__212basic_stringIhNS2_11char_traitsIhEENS2_9allocatorIhEEEEE3getEv() { + return 15352; +} + +function __ZN10emscripten8internal11LightTypeIDINSt3__212basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEE3getEv() { + return 13272; +} + +function ___cxa_guard_release($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 0; + __ZN10__cxxabiv112_GLOBAL__N_115set_initializedEPj($0); + return; +} + +function __ZNSt3__27codecvtIwc11__mbstate_tED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__27codecvtIwc11__mbstate_tED2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle4Node15hasFunctionSlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return 0; +} + +function __ZN6vision14BinarykMedoidsILi96EE16setNumHypothesesEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 + 8 >> 2] = $1; + return; +} + +function __ZN6vision10DoGPyramidD2Ev($0) { + $0 = $0 | 0; + __ZNSt3__213__vector_baseIN6vision5ImageENS_9allocatorIS2_EEED2Ev($0); + return; +} + +function __ZN12_GLOBAL__N_120BumpPointerAllocatorD2Ev($0) { + $0 = $0 | 0; + __ZN12_GLOBAL__N_120BumpPointerAllocator5resetEv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE3endEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 4 >> 2] | 0; +} + +function __ZN12_GLOBAL__N_112OutputStream18setCurrentPositionEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 + 4 >> 2] = $1; + return; +} + +function _out($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + if (!(HEAP32[$0 >> 2] & 32)) ___fwritex($1, $2, $0) | 0; + return; +} + +function ___emscripten_stdout_seek($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + setTempRet0(0); + return 0; +} + +function __ZNSt3__26locale5__imp11make_globalEv() { + __ZNSt3__26localeC2ERKS0_(66856, __ZNSt3__26locale7classicEv() | 0); + return 66856; +} + +function __ZNSt11logic_errorD2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 17452; + __ZNSt3__218__libcpp_refstringD2Ev($0 + 4 | 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle9NodeArrayC2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm32EE5beginEv($0) { + $0 = $0 | 0; + return HEAP32[$0 >> 2] | 0; +} + +function __ZN10__cxxabiv117__class_type_infoD0Ev($0) { + $0 = $0 | 0; + __ZN10__cxxabiv116__shim_type_infoD2Ev($0); + __ZdlPv($0); + return; +} + +function dynCall_vii(index, a1, a2) { + index = index | 0; + a1 = a1 | 0; + a2 = a2 | 0; + FUNCTION_TABLE_vii[index & 255](a1 | 0, a2 | 0); +} + +function b9(p0, p1, p2, p3, p4) { + p0 = p0 | 0; + p1 = p1 | 0; + p2 = p2 | 0; + p3 = p3 | 0; + p4 = p4 | 0; + nullFunc_iiiiii(9); + return 0; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_7codecvtIDsc11__mbstate_tEEjEERT_T0_() { + HEAP32[16203] = 0; + HEAP32[16202] = 23620; + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_7codecvtIDic11__mbstate_tEEjEERT_T0_() { + HEAP32[16205] = 0; + HEAP32[16204] = 23668; + return; +} + +function __ZNKSt3__29__num_getIcE12__do_widen_pERNS_8ios_baseEPc($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return 12928; +} + +function __ZN6vision18BinaryFeatureStore21setNumBytesPerFeatureEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = $1; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14PODSmallVectorIPNS0_4NodeELm8EE5beginEv($0) { + $0 = $0 | 0; + return HEAP32[$0 >> 2] | 0; +} + +function _fseek($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return ___fseeko($0, $1, (($1 | 0) < 0) << 31 >> 31, $2) | 0; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_7codecvtIcc11__mbstate_tEEjEERT_T0_() { + HEAP32[16197] = 0; + HEAP32[16196] = 23572; + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle4Node12hasArraySlowERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return 0; +} + +function __ZN6vision6LoggerC2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + HEAP32[$0 + 8 >> 2] = 0; + return; +} + +function _mbrlen($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return _mbrtowc(0, $0, $1, ($2 | 0) == 0 ? 65428 : $2) | 0; +} + +function _jcopy_block_row($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + _memcpy($1 | 0, $0 | 0, $2 << 7 | 0) | 0; + return; +} + +function _fullsize_upsample($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + HEAP32[$3 >> 2] = $2; + return; +} + +function __ZNSt3__25ctypeIcE21__classic_upper_tableEv() { + var $0 = 0; + $0 = ___ctype_toupper_loc() | 0; + return HEAP32[$0 >> 2] | 0; +} + +function __ZNSt3__25ctypeIcE21__classic_lower_tableEv() { + var $0 = 0; + $0 = ___ctype_tolower_loc() | 0; + return HEAP32[$0 >> 2] | 0; +} + +function __ZNSt3__211char_traitsIcE6assignERcRKc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP8[$0 >> 0] = HEAP8[$1 >> 0] | 0; + return; +} + +function __ZNKSt3__26vectorIN6vision17PriorityQueueItemILi96EEENS_9allocatorIS3_EEE8max_sizeEv($0) { + $0 = $0 | 0; + return 536870911; +} + +function b8(p0, p1, p2, p3, p4) { + p0 = p0 | 0; + p1 = p1 | 0; + p2 = p2 | 0; + p3 = p3 | 0; + p4 = +p4; + nullFunc_iiiiid(8); + return 0; +} + +function ___cxa_guard_acquire($0) { + $0 = $0 | 0; + return ((__ZN10__cxxabiv112_GLOBAL__N_114is_initializedEPj($0) | 0) ^ 1) & 1 | 0; +} + +function __ZNK12_GLOBAL__N_110StringView5emptyEv($0) { + $0 = $0 | 0; + return (HEAP32[$0 >> 2] | 0) == (HEAP32[$0 + 4 >> 2] | 0) | 0; +} + +function __ZN10emscripten8internal6TypeIDINS_3valEvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDINS_3valEE3getEv() | 0; +} + +function __ZNSt3__211char_traitsIwE6assignERwRKw($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = HEAP32[$1 >> 2]; + return; +} + +function __ZNKSt3__28ios_base6getlocEv($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + __ZNSt3__26localeC2ERKS0_($0, $1 + 28 | 0); + return; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle4Node10printRightERNS_12OutputStreamE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return; +} + +function __ZNK12_GLOBAL__N_110StringView4sizeEv($0) { + $0 = $0 | 0; + return (HEAP32[$0 + 4 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) | 0; +} + +function __ZN12_GLOBAL__N_112OutputStreamC2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 + 12 >> 2] = -1; + HEAP32[$0 + 16 >> 2] = -1; + return; +} + +function ___stdio_close($0) { + $0 = $0 | 0; + return (___wasi_fd_close(_dummy_560(HEAP32[$0 + 60 >> 2] | 0) | 0) | 0) & 65535 | 0; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_5ctypeIcEEDnbjEERT_T0_T1_T2_() { + __ZNSt3__25ctypeIcEC2EPKtbm(64760, 0, 0, 1); + return; +} + +function __ZNKSt3__26vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEE8max_sizeEv($0) { + $0 = $0 | 0; + return 1073741823; +} + +function __ZN6vision18BinomialPyramid32fD0Ev($0) { + $0 = $0 | 0; + __ZN6vision18BinomialPyramid32fD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocatorD2Ev($0) { + $0 = $0 | 0; + __ZN12_GLOBAL__N_120BumpPointerAllocatorD2Ev($0); + return; +} + +function __ZN12_GLOBAL__N_116DefaultAllocatorC2Ev($0) { + $0 = $0 | 0; + __ZN12_GLOBAL__N_120BumpPointerAllocatorC2Ev($0); + return; +} + +function _vfprintf($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return ___vfprintf_internal($0, $1, $2, 1, 141) | 0; +} + +function _noop_upsample($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + HEAP32[$3 >> 2] = 0; + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_10moneypunctIwLb1EEEjEERT_T0_() { + HEAP32[16235] = 0; + HEAP32[16234] = 22912; + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_10moneypunctIwLb0EEEjEERT_T0_() { + HEAP32[16233] = 0; + HEAP32[16232] = 22856; + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_10moneypunctIcLb1EEEjEERT_T0_() { + HEAP32[16231] = 0; + HEAP32[16230] = 22800; + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_10moneypunctIcLb0EEEjEERT_T0_() { + HEAP32[16229] = 0; + HEAP32[16228] = 22744; + return; +} + +function __ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv($0) { + $0 = $0 | 0; + return 2; +} + +function __ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv($0) { + $0 = $0 | 0; + return 2; +} + +function __ZNKSt3__26vectorINS0_INS_4pairIfmEENS_9allocatorIS2_EEEENS3_IS5_EEE8max_sizeEv($0) { + $0 = $0 | 0; + return 357913941; +} + +function __ZNK6vision10DoGPyramid4sizeEv($0) { + $0 = $0 | 0; + return (HEAP32[$0 + 4 >> 2] | 0) - (HEAP32[$0 >> 2] | 0) >> 5 | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray5emptyEv($0) { + $0 = $0 | 0; + return (HEAP32[$0 + 4 >> 2] | 0) == 0 | 0; +} + +function __ZN10__cxxabiv112_GLOBAL__N_115set_initializedEPj($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = HEAP32[$0 >> 2] | 1; + return; +} + +function dynCall_vid(index, a1, a2) { + index = index | 0; + a1 = a1 | 0; + a2 = +a2; + FUNCTION_TABLE_vid[index & 3](a1 | 0, +a2); +} + +function _llvm_bswap_i32(x) { + x = x | 0; + return (x & 255) << 24 | (x >> 8 & 255) << 16 | (x >> 16 & 255) << 8 | x >>> 24 | 0; +} + +function __ZN6vision17PriorityQueueItemILi96EEC2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + return; +} + +function b21(p0, p1, p2, p3, p4) { + p0 = p0 | 0; + p1 = p1 | 0; + p2 = p2 | 0; + p3 = p3 | 0; + p4 = p4 | 0; + nullFunc_viiiii(21); +} + +function _mbsinit($0) { + $0 = $0 | 0; + var $4 = 0; + if (!$0) $4 = 1; else $4 = (HEAP32[$0 >> 2] | 0) == 0 & 1; + return $4 | 0; +} + +function _ar2UtilReplaceExt($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return _arUtilReplaceExt($0, $1, $2) | 0; +} + +function __ZNSt3__27codecvtIDsc11__mbstate_tED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__27codecvtIDic11__mbstate_tED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__217__widen_from_utf8ILm32EED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return; +} + +function __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return; +} + +function __ZN6vision10ZeroVectorIfEEvPT_m($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + _memset($0 | 0, 0, $1 << 2 | 0) | 0; + return; +} + +function __ZNSt3__27codecvtIcc11__mbstate_tED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__216__narrow_to_utf8ILm32EED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiiiiEE8getCountEv($this) { + $this = $this | 0; + return 4; +} + +function __ZN6vision11Cofactor2x2IfEET_S1_S1_S1_($0, $1, $2) { + $0 = +$0; + $1 = +$1; + $2 = +$2; + return +($0 * $2 - $1 * $1); +} + +function _srand($0) { + $0 = $0 | 0; + var $2 = 0; + $2 = 64568; + HEAP32[$2 >> 2] = $0 + -1; + HEAP32[$2 + 4 >> 2] = 0; + return; +} + +function __ZNSt3__24pairIKi12arControllerED2Ev($this) { + $this = $this | 0; + __ZN12arControllerD2Ev($this + 8 | 0); + return; +} + +function __ZNSt3__210__stdinbufIwE9underflowEv($0) { + $0 = $0 | 0; + return __ZNSt3__210__stdinbufIwE9__getcharEb($0, 0) | 0; +} + +function __ZNSt3__210__stdinbufIcE9underflowEv($0) { + $0 = $0 | 0; + return __ZNSt3__210__stdinbufIcE9__getcharEb($0, 0) | 0; +} + +function __ZNK6vision25GaussianScaleSpacePyramid18numScalesPerOctaveEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 20 >> 2] | 0; +} + +function __ZNK6vision10DoGPyramid3getEm($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return (HEAP32[$0 >> 2] | 0) + ($1 << 5) | 0; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJviiEE8getCountEv($this) { + $this = $this | 0; + return 3; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJvifEE8getCountEv($this) { + $this = $this | 0; + return 3; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJvidEE8getCountEv($this) { + $this = $this | 0; + return 3; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiiiEE8getCountEv($this) { + $this = $this | 0; + return 3; +} + +function __ZN6vision11SumSquares9IfEET_PKS1_($0) { + $0 = $0 | 0; + return +(+__ZN6vision11DotProduct9IfEET_PKS1_S3_($0, $0)); +} + +function __ZNSt3__215__refstring_imp12_GLOBAL__N_113data_from_repEPNS1_9_Rep_baseE($0) { + $0 = $0 | 0; + return $0 + 12 | 0; +} + +function __ZNSt3__211char_traitsIwE11eq_int_typeEjj($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return ($0 | 0) == ($1 | 0) | 0; +} + +function __ZNSt3__211char_traitsIcE11eq_int_typeEii($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return ($0 | 0) == ($1 | 0) | 0; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJviEE8getCountEv($this) { + $this = $this | 0; + return 2; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiiEE8getCountEv($this) { + $this = $this | 0; + return 2; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJdiEE8getCountEv($this) { + $this = $this | 0; + return 2; +} + +function _vsprintf($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return _vsnprintf($0, 2147483647, $1, $2) | 0; +} + +function __ZNKSt3__26vectorIPKN6vision4NodeILi96EEENS_9allocatorIS5_EEE8max_sizeEv($0) { + $0 = $0 | 0; + return 1073741823; +} + +function __ZNK10emscripten8internal12WithPoliciesIJEE11ArgTypeListIJiEE8getCountEv($this) { + $this = $this | 0; + return 1; +} + +function __ZN6vision8KeyframeILi96EE9setHeightEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 + 4 >> 2] = $1; + return; +} + +function __ZN10emscripten8internal6TypeIDIRKivE3getEv() { + return __ZN10emscripten8internal11LightTypeIDIRKiE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDIRKdvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDIRKdE3getEv() | 0; +} + +function ___loc_is_allocated($0) { + $0 = $0 | 0; + return ($0 | 0) != 17060 & (($0 | 0) != 0 & ($0 | 0) != 65372) & 1 | 0; +} + +function ___cxx_global_var_init_713() { + __ZN53EmscriptenBindingInitializer_native_and_builtin_typesC2Ev(67446); + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_8messagesIwEEjEERT_T0_() { + HEAP32[16263] = 0; + HEAP32[16262] = 23112; + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_8messagesIcEEjEERT_T0_() { + HEAP32[16261] = 0; + HEAP32[16260] = 23080; + return; +} + +function __ZNSt3__210shared_ptrIhE18__enable_weak_thisEz($0, $varargs) { + $0 = $0 | 0; + $varargs = $varargs | 0; + return; +} + +function __ZNKSt3__26vectorIPN6vision4NodeILi96EEENS_9allocatorIS4_EEE8max_sizeEv($0) { + $0 = $0 | 0; + return 1073741823; +} + +function __ZNKSt3__26vectorIN6vision12FeaturePointENS_9allocatorIS2_EEE8max_sizeEv($0) { + $0 = $0 | 0; + return 214748364; +} + +function __ZNKSt3__26vectorI12multi_markerNS_9allocatorIS1_EEE8max_sizeEv($this) { + $this = $this | 0; + return 536870911; +} + +function __ZNKSt11logic_error4whatEv($0) { + $0 = $0 | 0; + return __ZNKSt3__218__libcpp_refstring5c_strEv($0 + 4 | 0) | 0; +} + +function __ZNK12_GLOBAL__N_110StringViewixEm($0) { + $0 = $0 | 0; + return __ZNK12_GLOBAL__N_110StringView5beginEv($0) | 0; +} + +function __ZN6vision10ZeroVectorIhEEvPT_m($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + _memset($0 | 0, 0, $1 | 0) | 0; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle27ExpandedSpecialSubstitutionD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_7collateIwEEjEERT_T0_() { + HEAP32[16189] = 0; + HEAP32[16188] = 21176; + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_7collateIcEEjEERT_T0_() { + HEAP32[16187] = 0; + HEAP32[16186] = 21144; + return; +} + +function __ZNSt3__210__stdinbufIwE5uflowEv($0) { + $0 = $0 | 0; + return __ZNSt3__210__stdinbufIwE9__getcharEb($0, 1) | 0; +} + +function __ZNSt3__210__stdinbufIcE5uflowEv($0) { + $0 = $0 | 0; + return __ZNSt3__210__stdinbufIcE9__getcharEb($0, 1) | 0; +} + +function __ZN6vision4min2IiEET_S1_S1_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return (($0 | 0) < ($1 | 0) ? $0 : $1) | 0; +} + +function __ZN6vision4max2IiEET_S1_S1_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return (($0 | 0) > ($1 | 0) ? $0 : $1) | 0; +} + +function __ZN12_GLOBAL__N_110StringViewC2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 0; + HEAP32[$0 + 4 >> 2] = 0; + return; +} + +function __ZNSt3__25ctypeIcE13classic_tableEv() { + var $0 = 0; + $0 = ___ctype_b_loc() | 0; + return HEAP32[$0 >> 2] | 0; +} + +function __ZNSt3__210moneypunctIwLb1EED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__210moneypunctIwLb0EED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__210moneypunctIcLb1EED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__210moneypunctIcLb0EED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function dynCall_ii(index, a1) { + index = index | 0; + a1 = a1 | 0; + return FUNCTION_TABLE_ii[index & 127](a1 | 0) | 0; +} + +function _strncpy($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + ___stpncpy($0, $1, $2) | 0; + return $0 | 0; +} + +function _jpeg_mem_available($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + return $2 | 0; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_6locale5__impEjEERT_T0_() { + __ZNSt3__26locale5__impC2Em(65064, 1); + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_5ctypeIwEEjEERT_T0_() { + HEAP32[16195] = 0; + HEAP32[16194] = 23504; + return; +} + +function __ZNKSt3__26vectorIN6vision7Point3dIfEENS_9allocatorIS3_EEE8max_sizeEv($0) { + $0 = $0 | 0; + return 357913941; +} + +function __ZNKSt3__26vectorIN6vision7Point2dIfEENS_9allocatorIS3_EEE8max_sizeEv($0) { + $0 = $0 | 0; + return 536870911; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle12NodeOrString6asNodeEv($0) { + $0 = $0 | 0; + return HEAP32[$0 >> 2] | 0; +} + +function __ZN6vision7Point2dIfEC2Ev($0) { + $0 = $0 | 0; + HEAPF32[$0 >> 2] = 0.0; + HEAPF32[$0 + 4 >> 2] = 0.0; + return; +} + +function __ZN6vision4NodeILi96EE4leafEb($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP8[$0 + 100 >> 0] = $1 & 1; + return; +} + +function __ZN6vision12SafeDivisionIfEET_S1_S1_($0, $1) { + $0 = +$0; + $1 = +$1; + return +($0 / ($1 == 0.0 ? 1.0 : $1)); +} + +function __ZN12_GLOBAL__N_116itanium_demangle24ForwardTemplateReferenceD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN10emscripten8internal6TypeIDIvvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDIvE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDItvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDItE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDIsvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDIsE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDImvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDImE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDIlvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDIlE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDIjvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDIjE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDIivE3getEv() { + return __ZN10emscripten8internal11LightTypeIDIiE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDIhvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDIhE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDIfvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDIfE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDIdvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDIdE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDIcvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDIcE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDIbvE3getEv() { + return __ZN10emscripten8internal11LightTypeIDIbE3getEv() | 0; +} + +function __ZN10emscripten8internal6TypeIDIavE3getEv() { + return __ZN10emscripten8internal11LightTypeIDIaE3getEv() | 0; +} + +function __ZNSt3__212_GLOBAL__N_17countofIwEEmPKT_S4_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return $1 - $0 >> 2 | 0; +} + +function __ZNK12_GLOBAL__N_112OutputStream18getCurrentPositionEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 4 >> 2] | 0; +} + +function __ZN6vision8KeyframeILi96EE8setWidthEi($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + HEAP32[$0 >> 2] = $1; + return; +} + +function __ZN10emscripten8internal11BindingTypeIdvE10toWireTypeERKd($v) { + $v = $v | 0; + return +(+HEAPF64[$v >> 3]); +} + +function __ZN10__cxxabiv112_GLOBAL__N_114is_initializedEPj($0) { + $0 = $0 | 0; + return (HEAP8[$0 >> 0] | 0) != 0 | 0; +} + +function b7(p0, p1, p2, p3) { + p0 = p0 | 0; + p1 = p1 | 0; + p2 = p2 | 0; + p3 = p3 | 0; + nullFunc_iiiii(7); + return 0; +} + +function _strcat($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + _strcpy($0 + (_strlen($0) | 0) | 0, $1) | 0; + return $0 | 0; +} + +function _norm($0, $1, $2) { + $0 = +$0; + $1 = +$1; + $2 = +$2; + return +(+Math_sqrt(+($0 * $0 + $1 * $1 + $2 * $2))); +} + +function _arImageProcFinal($0) { + $0 = $0 | 0; + if ($0 | 0) { + _free(HEAP32[$0 >> 2] | 0); + _free($0); + } + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_8numpunctIwEEjEERT_T0_() { + __ZNSt3__28numpunctIwEC2Em(64848, 1); + return; +} + +function __ZNSt3__212_GLOBAL__N_14makeINS_8numpunctIcEEjEERT_T0_() { + __ZNSt3__28numpunctIcEC2Em(64824, 1); + return; +} + +function __ZNK6vision25GaussianScaleSpacePyramid10numOctavesEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 16 >> 2] | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray4sizeEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 4 >> 2] | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22ParameterPackExpansionD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22ElaboratedTypeSpefTypeD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle22ConversionOperatorTypeD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN10emscripten8internal11BindingTypeIivE10toWireTypeERKi($v) { + $v = $v | 0; + return HEAP32[$v >> 2] | 0; +} + +function __ZN10__cxxabiv119__getExceptionClassEPK17_Unwind_Exception($0) { + $0 = $0 | 0; + setTempRet0(0); + return 0; +} + +function _isxdigit($0) { + $0 = $0 | 0; + return ((($0 | 32) + -97 | 0) >>> 0 < 6 | (_isdigit($0) | 0) != 0) & 1 | 0; +} + +function _arMatrixFreef($0) { + $0 = $0 | 0; + if ($0 | 0) { + _free(HEAP32[$0 >> 2] | 0); + _free($0); + } + return 0; +} + +function __ZNSt3__29basic_iosIwNS_11char_traitsIwEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__28ios_baseD2Ev($0); + return; +} + +function __ZNSt3__29basic_iosIcNS_11char_traitsIcEEED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__28ios_baseD2Ev($0); + return; +} + +function __ZNKSt3__26vectorIN6vision7match_tENS_9allocatorIS2_EEE8max_sizeEv($0) { + $0 = $0 | 0; + return 536870911; +} + +function __ZNK6vision28BinaryHierarchicalClusteringILi96EE12reverseIndexEv($0) { + $0 = $0 | 0; + return $0 + 72 | 0; +} + +function __ZN6vision5TimerC2Ev($0) { + $0 = $0 | 0; + HEAPF64[$0 >> 3] = -1.0; + HEAPF64[$0 + 8 >> 3] = -1.0; + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle21StructuredBindingNameD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle21CtorVtableSpecialNameD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function _strrchr($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return ___memrchr($0, $1, (_strlen($0) | 0) + 1 | 0) | 0; +} + +function _arMatrixFree($0) { + $0 = $0 | 0; + if ($0 | 0) { + _free(HEAP32[$0 >> 2] | 0); + _free($0); + } + return 0; +} + +function __ZNK6vision21HoughSimilarityVoting24getSubBinLocationIndicesEv($0) { + $0 = $0 | 0; + return $0 + 124 | 0; +} + +function __ZN6vision9MaxIndex2IfEEiPKT_($0) { + $0 = $0 | 0; + return +HEAPF32[$0 + 4 >> 2] > +HEAPF32[$0 >> 2] | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle20TemplateArgumentPackD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle20PostfixQualifiedTypeD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle20NameWithTemplateArgsD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle20DynamicExceptionSpecD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function dynCall_di(index, a1) { + index = index | 0; + a1 = a1 | 0; + return +FUNCTION_TABLE_di[index & 3](a1 | 0); +} + +function _do_read($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return ___string_read($0, $1, $2) | 0; +} + +function __ZNSt3__26locale5facetD0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__26locale5__impD0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5__impD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNKSt3__26vectorIN6vision5ImageENS_9allocatorIS2_EEE8max_sizeEv($0) { + $0 = $0 | 0; + return 134217727; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle9NodeArray5beginEv($0) { + $0 = $0 | 0; + return HEAP32[$0 >> 2] | 0; +} + +function __ZNK12_GLOBAL__N_116itanium_demangle4Node7getKindEv($0) { + $0 = $0 | 0; + return HEAP8[$0 + 4 >> 0] | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle19SpecialSubstitutionD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle19SizeofParamPackExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle19PointerToMemberTypeD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle19GlobalQualifiedNameD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIfED0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIeED0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIdED0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function _new_color_map_2_quant($0) { + $0 = $0 | 0; + HEAP32[(HEAP32[$0 + 484 >> 2] | 0) + 28 >> 2] = 1; + return; +} + +function __ZNSt3__28messagesIwED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__28messagesIcED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__212_GLOBAL__N_17countofIcEEmPKT_S4_($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return $1 - $0 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle18ArraySubscriptExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZNSt3__28numpunctIwED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__28numpunctIwED2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__28numpunctIcED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__28numpunctIcED2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__215__refstring_imp12_GLOBAL__N_113rep_from_dataEPKc($0) { + $0 = $0 | 0; + return $0 + -12 | 0; +} + +function __ZNKSt3__26vectorINS_4pairIfmEENS_9allocatorIS2_EEE8max_sizeEv($0) { + $0 = $0 | 0; + return 536870911; +} + +function __ZNKSt3__26vectorINS_4pairIfiEENS_9allocatorIS2_EEE8max_sizeEv($0) { + $0 = $0 | 0; + return 536870911; +} + +function __ZN12_GLOBAL__N_116itanium_demangle17VendorExtQualTypeD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZNK6vision25DoGScaleInvariantDetector6heightEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 4 >> 2] | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle16StdQualifiedNameD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle16FunctionEncodingD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function ___cxx_global_var_init_40() { + __ZN46EmscriptenBindingInitializer_constant_bindingsC2Ev(0); + return; +} + +function __ZNSt3__27collateIwED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__27collateIwED2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__27collateIcED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__27collateIcED2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__25ctypeIwED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZN6vision9ExceptionD0Ev($0) { + $0 = $0 | 0; + __ZN6vision9ExceptionD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle15UnnamedTypeNameD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle15PixelVectorTypeD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle15LiteralOperatorD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle15IntegerCastExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle15ConditionalExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle15ClosureTypeNameD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle15BracedRangeExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function _jdiv_round_up($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return ($0 + -1 + $1 | 0) / ($1 | 0) | 0 | 0; +} + +function __ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEED2Ev($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return; +} + +function __ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEED2Ev($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return; +} + +function __ZNSt3__213basic_istreamIwNS_11char_traitsIwEEED2Ev($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return; +} + +function __ZNSt3__213basic_istreamIcNS_11char_traitsIcEEED2Ev($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return; +} + +function __ZNK6vision21HoughSimilarityVoting18getSubBinLocationsEv($0) { + $0 = $0 | 0; + return $0 + 112 | 0; +} + +function __ZNK6vision10DoGPyramid17numScalePerOctaveEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 16 >> 2] | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14IntegerLiteralD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle14ConversionExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function dynCall_vi(index, a1) { + index = index | 0; + a1 = a1 | 0; + FUNCTION_TABLE_vi[index & 255](a1 | 0); +} + +function b20(p0, p1, p2, p3) { + p0 = p0 | 0; + p1 = p1 | 0; + p2 = p2 | 0; + p3 = p3 | 0; + nullFunc_viiii(20); +} + +function _createKpmHandle($cparamLT) { + $cparamLT = $cparamLT | 0; + return _kpmCreateHandle($cparamLT) | 0; +} + +function _catgets($0, $1, $2, $3) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + $3 = $3 | 0; + return $3 | 0; +} + +function __ZNK6vision17PriorityQueueItemILi96EE4distEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 4 >> 2] | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle13ReferenceTypeD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle13QualifiedNameD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle13ParameterPackD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle13ObjCProtoNameD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle13NodeArrayNodeD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle13FunctionParamD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle13EnclosingExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function ___clang_call_terminate($0) { + $0 = $0 | 0; + ___cxa_begin_catch($0 | 0) | 0; + __ZSt9terminatev(); +} + +function __ZNSt12length_errorD0Ev($0) { + $0 = $0 | 0; + __ZNSt11logic_errorD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNKSt3__28numpunctIwE16do_thousands_sepEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 12 >> 2] | 0; +} + +function __ZNKSt3__25ctypeIwE8do_widenEc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return $1 << 24 >> 24 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle12TemplateArgsD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle12NoexceptSpecD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle12InitListExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle12FunctionTypeD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle12EnableIfAttrD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle12CtorDtorNameD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function _strtold_l($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return +(+_strtold($0, $1)); +} + +function __ZNSt3__28ios_baseD0Ev($0) { + $0 = $0 | 0; + __ZNSt3__28ios_baseD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__25ctypeIcED0Ev($0) { + $0 = $0 | 0; + __ZNSt3__25ctypeIcED2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNSt3__210moneypunctIwLb1EED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__210moneypunctIwLb0EED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__210moneypunctIcLb1EED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__210moneypunctIcLb0EED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt11logic_errorD0Ev($0) { + $0 = $0 | 0; + __ZNSt11logic_errorD2Ev($0); + __ZdlPv($0); + return; +} + +function __ZNKSt3__28numpunctIwE16do_decimal_pointEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 8 >> 2] | 0; +} + +function __ZNK6vision4NodeILi96EE4leafEv($0) { + $0 = $0 | 0; + return (HEAP8[$0 + 100 >> 0] | 0) != 0 | 0; +} + +function __ZNK6vision25DoGScaleInvariantDetector5widthEv($0) { + $0 = $0 | 0; + return HEAP32[$0 >> 2] | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle11SpecialNameD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle11PostfixExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle11PointerTypeD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZNKSt3__28numpunctIcE16do_thousands_sepEv($0) { + $0 = $0 | 0; + return HEAP8[$0 + 9 >> 0] | 0; +} + +function __ZNKSt3__28numpunctIcE16do_decimal_pointEv($0) { + $0 = $0 | 0; + return HEAP8[$0 + 8 >> 0] | 0; +} + +function __ZNKSt3__221__basic_string_commonILb1EE20__throw_length_errorEv($0) { + $0 = $0 | 0; + _abort(); +} + +function __ZN6vision5ImageD2Ev($0) { + $0 = $0 | 0; + __ZNSt3__210shared_ptrIhED2Ev($0 + 24 | 0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle10VectorTypeD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle10PrefixExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle10NestedNameD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle10MemberExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle10DeleteExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle10BracedExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle10BinaryExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle10AbiTagAttrD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function _strtof_l($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return +(+_strtof($0, $1)); +} + +function _strtod_l($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + return +(+_strtod($0, $1)); +} + +function __ZNSt3__220__time_get_c_storageIwEC2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 23752; + return; +} + +function __ZNSt3__220__time_get_c_storageIcEC2Ev($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 23716; + return; +} + +function __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv($0) { + $0 = $0 | 0; + _abort(); +} + +function __ZNK6vision17PriorityQueueItemILi96EE4nodeEv($0) { + $0 = $0 | 0; + return HEAP32[$0 >> 2] | 0; +} + +function __ZN10emscripten8internal11BindingTypeIivE12fromWireTypeEi($v) { + $v = $v | 0; + return $v | 0; +} + +function _jpeg_free_small($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + _free($1); + return; +} + +function _jpeg_free_large($0, $1, $2) { + $0 = $0 | 0; + $1 = $1 | 0; + $2 = $2 | 0; + _free($1); + return; +} + +function __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE9showmanycEv($0) { + $0 = $0 | 0; + return 0; +} + +function __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE9showmanycEv($0) { + $0 = $0 | 0; + return 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle9ThrowExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle9LocalNameD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle9DotSuffixD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle9ArrayTypeD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_112OutputStream9getBufferEv($0) { + $0 = $0 | 0; + return HEAP32[$0 >> 2] | 0; +} + +function _llvm_cttz_i32(x) { + x = x | 0; + return (x ? 31 - (Math_clz32(x ^ x - 1) | 0) | 0 : 32) | 0; +} + +function _init_source($0) { + $0 = $0 | 0; + HEAP32[(HEAP32[$0 + 24 >> 2] | 0) + 36 >> 2] = 1; + return; +} + +function __ZNK6vision14BinarykMedoidsILi96EE1kEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 4 >> 2] | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle8QualTypeD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle8NameTypeD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle8FoldExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle8DtorNameD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle8CastExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle8CallExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN12_GLOBAL__N_116itanium_demangle8BoolExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZN10__cxxabiv121__isOurExceptionClassEPK17_Unwind_Exception($0) { + $0 = $0 | 0; + return 0; +} + +function __ZNK6vision25DoGScaleInvariantDetector8featuresEv($0) { + $0 = $0 | 0; + return $0 + 60 | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle7NewExprD0Ev($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function _icpGetXw2XcCleanup($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + _free($0); + _free($1); + return; +} + +function _arMultiFreeConfig($0) { + $0 = $0 | 0; + _free(HEAP32[$0 >> 2] | 0); + _free($0); + return 0; +} + +function __ZNKSt3__210moneypunctIwLb1EE16do_thousands_sepEv($0) { + $0 = $0 | 0; + return 2147483647; +} + +function __ZNKSt3__210moneypunctIwLb1EE16do_decimal_pointEv($0) { + $0 = $0 | 0; + return 2147483647; +} + +function __ZNKSt3__210moneypunctIwLb0EE16do_thousands_sepEv($0) { + $0 = $0 | 0; + return 2147483647; +} + +function __ZNKSt3__210moneypunctIwLb0EE16do_decimal_pointEv($0) { + $0 = $0 | 0; + return 2147483647; +} + +function __ZNK6vision8KeyframeILi96EE6heightEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 4 >> 2] | 0; +} + +function __ZNK6vision14BinarykMedoidsILi96EE10assignmentEv($0) { + $0 = $0 | 0; + return $0 + 24 | 0; +} + +function __ZNK12_GLOBAL__N_110StringView3endEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 4 >> 2] | 0; +} + +function __ZN6vision4min2IfEET_S1_S1_($0, $1) { + $0 = +$0; + $1 = +$1; + return +($0 < $1 ? $0 : $1); +} + +function __ZN6vision4max2IfEET_S1_S1_($0, $1) { + $0 = +$0; + $1 = +$1; + return +($0 > $1 ? $0 : $1); +} + +function __ZN10emscripten8internal14asGenericValueIiEEdT_($t) { + $t = $t | 0; + return +(+($t | 0)); +} + +function __ZNSt3__28messagesIwED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__28messagesIcED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNKSt3__26vectorItNS_9allocatorItEEE8max_sizeEv($0) { + $0 = $0 | 0; + return 2147483647; +} + +function __ZNKSt3__26vectorIiNS_9allocatorIiEEE8max_sizeEv($0) { + $0 = $0 | 0; + return 1073741823; +} + +function __ZNKSt3__26vectorIhNS_9allocatorIhEEE8max_sizeEv($0) { + $0 = $0 | 0; + return 2147483647; +} + +function __ZNKSt3__26vectorIfNS_9allocatorIfEEE8max_sizeEv($0) { + $0 = $0 | 0; + return 1073741823; +} + +function __ZN6vision4log2IfEET_S1_($0) { + $0 = +$0; + return +(+Math_log(+$0) / .6931471824645996); +} + +function __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJviiEEEE3getEv() { + return 16920; +} + +function __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJvifEEEE3getEv() { + return 16908; +} + +function __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJvidEEEE3getEv() { + return 16940; +} + +function __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJiiiiEEEE3getEv() { + return 2048; +} + +function __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJiiiEEEE3getEv() { + return 16972; +} + +function b6(p0, p1, p2) { + p0 = p0 | 0; + p1 = p1 | 0; + p2 = p2 | 0; + nullFunc_iiii(6); + return 0; +} + +function _isspace($0) { + $0 = $0 | 0; + return (($0 | 0) == 32 | ($0 + -9 | 0) >>> 0 < 5) & 1 | 0; +} + +function __ZNSt3__27collateIwED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__27collateIcED2Ev($0) { + $0 = $0 | 0; + __ZNSt3__26locale5facetD2Ev($0); + return; +} + +function __ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE4syncEv($0) { + $0 = $0 | 0; + return 0; +} + +function __ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE4syncEv($0) { + $0 = $0 | 0; + return 0; +} + +function __ZNKSt3__27codecvtIDsc11__mbstate_tE16do_always_noconvEv($0) { + $0 = $0 | 0; + return 0; +} + +function __ZNKSt3__27codecvtIDic11__mbstate_tE16do_always_noconvEv($0) { + $0 = $0 | 0; + return 0; +} + +function __ZNKSt3__218__libcpp_refstring5c_strEv($0) { + $0 = $0 | 0; + return HEAP32[$0 >> 2] | 0; +} + +function __ZNK6vision25GaussianScaleSpacePyramid6imagesEv($0) { + $0 = $0 | 0; + return $0 + 4 | 0; +} + +function __ZNK12_GLOBAL__N_110StringView5beginEv($0) { + $0 = $0 | 0; + return HEAP32[$0 >> 2] | 0; +} + +function __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJviEEEE3getEv() { + return 16956; +} + +function __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJiiEEEE3getEv() { + return 16996; +} + +function __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJdiEEEE3getEv() { + return 16932; +} + +function __ZN10emscripten8internal11BindingTypeIfvE12fromWireTypeEf($v) { + $v = +$v; + return +$v; +} + +function __ZN10emscripten8internal11BindingTypeIdvE12fromWireTypeEd($v) { + $v = +$v; + return +$v; +} + +function __ZNKSt3__27codecvtIwc11__mbstate_tE16do_always_noconvEv($0) { + $0 = $0 | 0; + return 0; +} + +function __ZNKSt3__27codecvtIcc11__mbstate_tE16do_always_noconvEv($0) { + $0 = $0 | 0; + return 1; +} + +function __ZNK6vision20BinaryFeatureMatcherILi96EE7matchesEv($0) { + $0 = $0 | 0; + return $0 | 0; +} + +function __ZN6vision25GaussianScaleSpacePyramid6imagesEv($0) { + $0 = $0 | 0; + return $0 + 4 | 0; +} + +function __ZN10emscripten8internal14ArgArrayGetterINS0_8TypeListIJiEEEE3getEv() { + return 16952; +} + +function _strcpy($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + ___stpcpy($0, $1) | 0; + return $0 | 0; +} + +function _freelocale($0) { + $0 = $0 | 0; + if (___loc_is_allocated($0) | 0) _free($0); + return; +} + +function ___lctrans($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return ___lctrans_impl($0, $1) | 0; +} + +function __ZNSt3__217_DeallocateCaller9__do_callEPv($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function __ZNKSt3__27codecvtIDsc11__mbstate_tE13do_max_lengthEv($0) { + $0 = $0 | 0; + return 4; +} + +function __ZNKSt3__27codecvtIDic11__mbstate_tE13do_max_lengthEv($0) { + $0 = $0 | 0; + return 4; +} + +function __ZNKSt3__25ctypeIcE8do_widenEc($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return $1 | 0; +} + +function __ZNK6vision8KeyframeILi96EE5widthEv($0) { + $0 = $0 | 0; + return HEAP32[$0 >> 2] | 0; +} + +function __ZNK6vision5Image3getIfEEPKT_v($0) { + $0 = $0 | 0; + return HEAP32[$0 + 24 >> 2] | 0; +} + +function __ZN10emscripten8internal11LightTypeIDINS_11memory_viewItEEE3getEv() { + return 15280; +} + +function __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIsEEE3getEv() { + return 15288; +} + +function __ZN10emscripten8internal11LightTypeIDINS_11memory_viewImEEE3getEv() { + return 15248; +} + +function __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIlEEE3getEv() { + return 15256; +} + +function __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIjEEE3getEv() { + return 15264; +} + +function __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIiEEE3getEv() { + return 15272; +} + +function __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIhEEE3getEv() { + return 15296; +} + +function __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIfEEE3getEv() { + return 15240; +} + +function __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIeEEE3getEv() { + return 15224; +} + +function __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIdEEE3getEv() { + return 15232; +} + +function __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIcEEE3getEv() { + return 15312; +} + +function __ZN10emscripten8internal11LightTypeIDINS_11memory_viewIaEEE3getEv() { + return 15304; +} + +function __ZNSt3__211char_traitsIcE12to_char_typeEi($0) { + $0 = $0 | 0; + return $0 & 255 | 0; +} + +function __ZNKSt3__27codecvtIcc11__mbstate_tE13do_max_lengthEv($0) { + $0 = $0 | 0; + return 1; +} + +function __ZSt18uncaught_exceptionv() { + return (__ZSt19uncaught_exceptionsv() | 0) > 0 | 0; +} + +function __ZNSt3__211char_traitsIcE11to_int_typeEc($0) { + $0 = $0 | 0; + return $0 & 255 | 0; +} + +function __ZNKSt3__27codecvtIDsc11__mbstate_tE11do_encodingEv($0) { + $0 = $0 | 0; + return 0; +} + +function __ZNKSt3__27codecvtIDic11__mbstate_tE11do_encodingEv($0) { + $0 = $0 | 0; + return 0; +} + +function __ZNKSt3__210moneypunctIcLb1EE16do_thousands_sepEv($0) { + $0 = $0 | 0; + return 127; +} + +function __ZNKSt3__210moneypunctIcLb1EE16do_decimal_pointEv($0) { + $0 = $0 | 0; + return 127; +} + +function __ZNKSt3__210moneypunctIcLb0EE16do_thousands_sepEv($0) { + $0 = $0 | 0; + return 127; +} + +function __ZNKSt3__210moneypunctIcLb0EE16do_decimal_pointEv($0) { + $0 = $0 | 0; + return 127; +} + +function __ZNK6vision5Image8channelsEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 16 >> 2] | 0; +} + +function __ZN6vision5Image3getIfEEPT_v($0) { + $0 = $0 | 0; + return HEAP32[$0 + 24 >> 2] | 0; +} + +function _roundf(d) { + d = +d; + return d >= 0.0 ? +Math_floor(d + .5) : +Math_ceil(d - .5); +} + +function _arVecFree($0) { + $0 = $0 | 0; + _free(HEAP32[$0 >> 2] | 0); + _free($0); + return 0; +} + +function __ZNSt3__211char_traitsIwE6lengthEPKw($0) { + $0 = $0 | 0; + return _wcslen($0) | 0; +} + +function __ZNSt3__211char_traitsIcE6lengthEPKc($0) { + $0 = $0 | 0; + return _strlen($0) | 0; +} + +function __ZNKSt3__27codecvtIcc11__mbstate_tE11do_encodingEv($0) { + $0 = $0 | 0; + return 1; +} + +function __ZNK6vision4NodeILi96EE12reverseIndexEv($0) { + $0 = $0 | 0; + return $0 + 116 | 0; +} + +function __ZNK6vision18BinaryFeatureStore6pointsEv($0) { + $0 = $0 | 0; + return $0 + 16 | 0; +} + +function __ZN6vision18BinaryFeatureStore8featuresEv($0) { + $0 = $0 | 0; + return $0 + 4 | 0; +} + +function dynCall_i(index) { + index = index | 0; + return FUNCTION_TABLE_i[index & 1]() | 0; +} + +function _my_error_exit($0) { + $0 = $0 | 0; + _longjmp((HEAP32[$0 >> 2] | 0) + 132 | 0, 1); +} + +function _ar3DCreateHandle($0) { + $0 = $0 | 0; + return _ar3DCreateHandle2($0 + 8 | 0) | 0; +} + +function __ZNKSt3__28messagesIwE8do_closeEl($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return; +} + +function __ZNKSt3__28messagesIcE8do_closeEl($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return; +} + +function __ZNKSt3__218__libcpp_refstring15__uses_refcountEv($0) { + $0 = $0 | 0; + return 1; +} + +function __ZN6vision4NodeILi96EE12reverseIndexEv($0) { + $0 = $0 | 0; + return $0 + 116 | 0; +} + +function __ZN6vision18BinaryFeatureStore6pointsEv($0) { + $0 = $0 | 0; + return $0 + 16 | 0; +} + +function __ZNK6vision5Image6heightEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 8 >> 2] | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle4NodeD0Ev($0) { + $0 = $0 | 0; + _llvm_trap(); +} + +function b19(p0, p1, p2) { + p0 = p0 | 0; + p1 = p1 | 0; + p2 = p2 | 0; + nullFunc_viii(19); +} + +function __ZNKSt3__210moneypunctIwLb1EE14do_frac_digitsEv($0) { + $0 = $0 | 0; + return 0; +} + +function __ZNKSt3__210moneypunctIwLb0EE14do_frac_digitsEv($0) { + $0 = $0 | 0; + return 0; +} + +function __ZNKSt3__210moneypunctIcLb1EE14do_frac_digitsEv($0) { + $0 = $0 | 0; + return 0; +} + +function __ZNKSt3__210moneypunctIcLb0EE14do_frac_digitsEv($0) { + $0 = $0 | 0; + return 0; +} + +function __ZNK6vision5Image5widthEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 4 >> 2] | 0; +} + +function __ZNK6vision5Image4stepEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 12 >> 2] | 0; +} + +function __ZN6vision5roundIfEET_S1_($0) { + $0 = +$0; + return +(+Math_floor(+($0 + .5))); +} + +function __ZN12_GLOBAL__N_118getTypedArrayIndexItEENS_15TypedArrayIndexEv() { + return 3; +} + +function __ZN12_GLOBAL__N_118getTypedArrayIndexIsEENS_15TypedArrayIndexEv() { + return 2; +} + +function __ZN12_GLOBAL__N_118getTypedArrayIndexImEENS_15TypedArrayIndexEv() { + return 5; +} + +function __ZN12_GLOBAL__N_118getTypedArrayIndexIlEENS_15TypedArrayIndexEv() { + return 4; +} + +function __ZN12_GLOBAL__N_118getTypedArrayIndexIjEENS_15TypedArrayIndexEv() { + return 5; +} + +function __ZN12_GLOBAL__N_118getTypedArrayIndexIiEENS_15TypedArrayIndexEv() { + return 4; +} + +function __ZN12_GLOBAL__N_118getTypedArrayIndexIhEENS_15TypedArrayIndexEv() { + return 1; +} + +function __ZN12_GLOBAL__N_118getTypedArrayIndexIfEENS_15TypedArrayIndexEv() { + return 6; +} + +function __ZN12_GLOBAL__N_118getTypedArrayIndexIeEENS_15TypedArrayIndexEv() { + return 7; +} + +function __ZN12_GLOBAL__N_118getTypedArrayIndexIdEENS_15TypedArrayIndexEv() { + return 7; +} + +function __ZN12_GLOBAL__N_118getTypedArrayIndexIcEENS_15TypedArrayIndexEv() { + return 0; +} + +function __ZN12_GLOBAL__N_118getTypedArrayIndexIaEENS_15TypedArrayIndexEv() { + return 0; +} + +function __ZN10emscripten8internal19getGenericSignatureIJiiiiiEEEPKcv() { + return 45420; +} + +function _strtold($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return +(+_strtox($0, $1, 2)); +} + +function _jpeg_get_small($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return _malloc($1) | 0; +} + +function _jpeg_get_large($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return _malloc($1) | 0; +} + +function __ZNSt3__211char_traitsIwE12to_char_typeEj($0) { + $0 = $0 | 0; + return $0 | 0; +} + +function __ZNK6vision5Image3getEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 24 >> 2] | 0; +} + +function __ZNK16NullArrayDeleterIhEclEPh($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return; +} + +function __ZN10emscripten8internal19getGenericSignatureIJviiiEEEPKcv() { + return 41695; +} + +function __ZN10emscripten8internal19getGenericSignatureIJviifEEEPKcv() { + return 41603; +} + +function __ZN10emscripten8internal19getGenericSignatureIJviidEEEPKcv() { + return 41730; +} + +function __ZN10emscripten8internal19getGenericSignatureIJiiiiEEEPKcv() { + return 44909; +} + +function __ZN10emscripten8internal14asGenericValueIdEEdT_($t) { + $t = +$t; + return +$t; +} + +function _strtof($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return +(+_strtox($0, $1, 0)); +} + +function _strtod($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return +(+_strtox($0, $1, 1)); +} + +function _setLogLevel($level) { + $level = $level | 0; + HEAP32[4186] = $level; + return; +} + +function __ZNSt3__211char_traitsIwE11to_int_typeEw($0) { + $0 = $0 | 0; + return $0 | 0; +} + +function __ZNK6vision8KeyframeILi96EE5indexEv($0) { + $0 = $0 | 0; + return $0 + 36 | 0; +} + +function __ZN6vision5Image3getEv($0) { + $0 = $0 | 0; + return HEAP32[$0 + 24 >> 2] | 0; +} + +function __ZN10emscripten8internal19getGenericSignatureIJviiEEEPKcv() { + return 41738; +} + +function __ZN10emscripten8internal19getGenericSignatureIJiiiEEEPKcv() { + return 44745; +} + +function __ZN10emscripten8internal19getGenericSignatureIJdiiEEEPKcv() { + return 41726; +} + +function b18(p0, p1, p2) { + p0 = p0 | 0; + p1 = p1 | 0; + p2 = +p2; + nullFunc_viid(18); +} + +function _isxdigit_l($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return _isxdigit($0) | 0; +} + +function __ZNK6vision8KeyframeILi96EE5storeEv($0) { + $0 = $0 | 0; + return $0 + 8 | 0; +} + +function __ZN6vision4NodeILi96EE8childrenEv($0) { + $0 = $0 | 0; + return $0 + 104 | 0; +} + +function __ZN10emscripten8internal19getGenericSignatureIJiiEEEPKcv() { + return 41735; +} + +function ___emscripten_environ_constructor() { + ___buildEnvironment(65460); + return; +} + +function __ZN6vision8KeyframeILi96EE5storeEv($0) { + $0 = $0 | 0; + return $0 + 8 | 0; +} + +function _isdigit_l($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return _isdigit($0) | 0; +} + +function __ZNK6vision5Image4typeEv($0) { + $0 = $0 | 0; + return HEAP32[$0 >> 2] | 0; +} + +function __ZN12_GLOBAL__N_116itanium_demangle4NodeD2Ev($0) { + $0 = $0 | 0; + return; +} + +function _jpeg_destroy_decompress($0) { + $0 = $0 | 0; + _jpeg_destroy($0); + return; +} + +function _copysignl($0, $1) { + $0 = +$0; + $1 = +$1; + return +(+_copysign($0, $1)); +} + +function ___cxx_global_var_init_834() { + __ZNSt3__28ios_base4InitC2Ev(0); + return; +} + +function __ZSt19uncaught_exceptionsv() { + return ___cxa_uncaught_exceptions() | 0; +} + +function __ZN10emscripten8internal11LightTypeIDINS_3valEE3getEv() { + return 15320; +} + +function _scalbnl($0, $1) { + $0 = +$0; + $1 = $1 | 0; + return +(+_scalbn($0, $1)); +} + +function __ZNK10__cxxabiv116__shim_type_info5noop2Ev($0) { + $0 = $0 | 0; + return; +} + +function __ZNK10__cxxabiv116__shim_type_info5noop1Ev($0) { + $0 = $0 | 0; + return; +} + +function b1(p0, p1) { + p0 = p0 | 0; + p1 = p1 | 0; + nullFunc_dii(1); + return 0.0; +} + +function _ar2UtilRemoveExt($0) { + $0 = $0 | 0; + return _arUtilRemoveExt($0) | 0; +} + +function dynCall_v(index) { + index = index | 0; + FUNCTION_TABLE_v[index & 3](); +} + +function _ldexp($0, $1) { + $0 = +$0; + $1 = $1 | 0; + return +(+_scalbn($0, $1)); +} + +function __ZN6vision17PriorityQueueItemILi96EED2Ev($0) { + $0 = $0 | 0; + return; +} + +function b5(p0, p1) { + p0 = p0 | 0; + p1 = p1 | 0; + nullFunc_iii(5); + return 0; +} + +function ___cxa_guard_abort($0) { + $0 = $0 | 0; + HEAP32[$0 >> 2] = 0; + return; +} + +function __ZNK6vision10DoGPyramid6imagesEv($0) { + $0 = $0 | 0; + return $0 | 0; +} + +function __ZNSt3__221__throw_runtime_errorEPKc($0) { + $0 = $0 | 0; + _abort(); +} + +function __ZN10emscripten8internal11LightTypeIDIRKiE3getEv() { + return 14080; +} + +function __ZN10emscripten8internal11LightTypeIDIRKdE3getEv() { + return 14120; +} + +function __GLOBAL__sub_I_bind_cpp() { + ___cxx_global_var_init_713(); + return; +} + +function _pthread_cond_wait($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return 0; +} + +function _islower($0) { + $0 = $0 | 0; + return ($0 + -97 | 0) >>> 0 < 26 | 0; +} + +function _isdigit($0) { + $0 = $0 | 0; + return ($0 + -48 | 0) >>> 0 < 10 | 0; +} + +function __ZN10__cxxabiv116__shim_type_infoD2Ev($0) { + $0 = $0 | 0; + return; +} + +function __ZN10emscripten8internal11LightTypeIDIvE3getEv() { + return 14024; +} + +function __ZN10emscripten8internal11LightTypeIDItE3getEv() { + return 14072; +} + +function __ZN10emscripten8internal11LightTypeIDIsE3getEv() { + return 14064; +} + +function __ZN10emscripten8internal11LightTypeIDImE3getEv() { + return 14104; +} + +function __ZN10emscripten8internal11LightTypeIDIlE3getEv() { + return 14096; +} + +function __ZN10emscripten8internal11LightTypeIDIjE3getEv() { + return 14088; +} + +function __ZN10emscripten8internal11LightTypeIDIiE3getEv() { + return 14080; +} + +function __ZN10emscripten8internal11LightTypeIDIhE3getEv() { + return 14048; +} + +function __ZN10emscripten8internal11LightTypeIDIfE3getEv() { + return 14112; +} + +function __ZN10emscripten8internal11LightTypeIDIdE3getEv() { + return 14120; +} + +function __ZN10emscripten8internal11LightTypeIDIcE3getEv() { + return 14040; +} + +function __ZN10emscripten8internal11LightTypeIDIbE3getEv() { + return 14032; +} + +function __ZN10emscripten8internal11LightTypeIDIaE3getEv() { + return 14056; +} + +function _fmodl($0, $1) { + $0 = +$0; + $1 = +$1; + return +(+_fmod($0, $1)); +} + +function _arPattCreateHandle() { + return _arPattCreateHandle2(16, 50) | 0; +} + +function _catopen($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + return -1 | 0; +} + +function __GLOBAL__I_000101() { + ___cxx_global_var_init_834(); + return; +} + +function __ZN6vision3sqrIfEET_S1_($0) { + $0 = +$0; + return +($0 * $0); +} + +function b17(p0, p1) { + p0 = p0 | 0; + p1 = p1 | 0; + nullFunc_vii(17); +} + +function __ZN6vision14FREAKExtractorD2Ev($0) { + $0 = $0 | 0; + return; +} + +function __ZN6vision11ScopedTimercvbEv($0) { + $0 = $0 | 0; + return 1; +} + +function __ZNSt3__214__shared_countD2Ev($0) { + $0 = $0 | 0; + return; +} + +function __ZN6vision12FeaturePointD2Ev($0) { + $0 = $0 | 0; + return; +} + +function b16(p0, p1) { + p0 = p0 | 0; + p1 = +p1; + nullFunc_vid(16); +} + +function ___emscripten_stdout_close($0) { + $0 = $0 | 0; + return 0; +} + +function __ZNSt3__26locale5facetD2Ev($0) { + $0 = $0 | 0; + return; +} + +function __ZNSt3__212__do_nothingEPv($0) { + $0 = $0 | 0; + return; +} + +function _pthread_cond_broadcast($0) { + $0 = $0 | 0; + return 0; +} + +function _lroundf($0) { + $0 = +$0; + return ~~+_roundf(+$0) | 0; +} + +function stackRestore(top) { + top = top | 0; + STACKTOP = top; +} + +function b0(p0) { + p0 = p0 | 0; + nullFunc_di(0); + return 0.0; +} + +function _pthread_mutex_unlock($0) { + $0 = $0 | 0; + return 0; +} + +function ___pthread_self_603() { + return _pthread_self() | 0; +} + +function ___pthread_self_423() { + return _pthread_self() | 0; +} + +function ___pthread_self_420() { + return _pthread_self() | 0; +} + +function ___pthread_self_417() { + return _pthread_self() | 0; +} + +function ___pthread_self_414() { + return _pthread_self() | 0; +} + +function ___pthread_self_234() { + return _pthread_self() | 0; +} + +function ___pthread_self_105() { + return _pthread_self() | 0; +} + +function b3(p0) { + p0 = p0 | 0; + nullFunc_ii(3); + return 0; +} + +function _pthread_mutex_lock($0) { + $0 = $0 | 0; + return 0; +} + +function _dummy_consume_data($0) { + $0 = $0 | 0; + return 0; +} + +function __Znam($0) { + $0 = $0 | 0; + return __Znwm($0) | 0; +} + +function __ZdaPv($0) { + $0 = $0 | 0; + __ZdlPv($0); + return; +} + +function _finish_pass_1_quant($0) { + $0 = $0 | 0; + return; +} + +function __ZNSt9type_infoD2Ev($0) { + $0 = $0 | 0; + return; +} + +function __ZNSt9exceptionD2Ev($0) { + $0 = $0 | 0; + return; +} + +function ___pthread_self() { + return _pthread_self() | 0; +} + +function __ZdlPv($0) { + $0 = $0 | 0; + _free($0); + return; +} + +function __ZNSt3__211char_traitsIwE3eofEv() { + return -1; +} + +function __ZNSt3__211char_traitsIcE3eofEv() { + return -1; +} + +function _start_pass_dcolor($0) { + $0 = $0 | 0; + return; +} + +function ___ofl_lock() { + ___lock(65416); + return 65424; +} + +function _dummy_560($0) { + $0 = $0 | 0; + return $0 | 0; +} + +function _jpeg_mem_init($0) { + $0 = $0 | 0; + return 0; +} + +function ___ofl_unlock() { + ___unlock(65416); + return; +} + +function _jpeg_mem_term($0) { + $0 = $0 | 0; + return; +} + +function _emscripten_get_sbrk_ptr() { + return 67472; +} + +function _getLogLevel() { + return HEAP32[4186] | 0; +} + +function _finish_pass2($0) { + $0 = $0 | 0; + return; +} + +function ___unlockfile($0) { + $0 = $0 | 0; + return; +} + +function ___lockfile($0) { + $0 = $0 | 0; + return 1; +} + +function ___cxa_get_globals_fast() { + return 65436; +} + +function b15(p0) { + p0 = p0 | 0; + nullFunc_vi(15); +} + +function _term_source($0) { + $0 = $0 | 0; + return; +} + +function _finish_pass($0) { + $0 = $0 | 0; + return; +} + +function ___cxa_uncaught_exceptions() { + return 0; +} + +function __GLOBAL__sub_I_iostream_cpp() { + return; +} + +function _catclose($0) { + $0 = $0 | 0; + return 0; +} + +function __ZSt17__throw_bad_allocv() { + _abort(); +} + +function ___ctype_toupper_loc() { + return 17352; +} + +function ___ctype_tolower_loc() { + return 17348; +} + +function __ZSt15get_new_handlerv() { + return 0; +} + +function ___errno_location() { + return 65396; +} + +function __ZSt13get_terminatev() { + return 2; +} + +function stackSave() { + return STACKTOP | 0; +} + +function b2() { + nullFunc_i(2); + return 0; +} + +function __get_timezone() { + return 65456; +} + +function __get_daylight() { + return 65452; +} + +function ___ctype_b_loc() { + return 17344; +} + +function _pthread_self() { + return 17100; +} + +function __get_environ() { + return 65460; +} + +function __get_tzname() { + return 65444; +} + +function b14() { + nullFunc_v(14); +} + +function _dummy_405() { + return; +} + +// EMSCRIPTEN_END_FUNCS +var FUNCTION_TABLE_di = [b0,_getProjectionNearPlane,_getProjectionFarPlane,_getPattRatio]; +var FUNCTION_TABLE_dii = [b1,__ZN10emscripten8internal7InvokerIdJiEE6invokeEPFdiEi]; +var FUNCTION_TABLE_i = [b2,_getLogLevel]; +var FUNCTION_TABLE_ii = [b3,__ZNK6vision9Exception4whatEv,___stdio_close,___emscripten_stdout_close,__ZNKSt11logic_error4whatEv,__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE4syncEv,__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE9showmanycEv,__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE9underflowEv,__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE5uflowEv,__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE4syncEv,__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE9showmanycEv,__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE9underflowEv,__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE5uflowEv,__ZNSt3__211__stdoutbufIwE4syncEv,__ZNSt3__211__stdoutbufIcE4syncEv,__ZNSt3__210__stdinbufIwE9underflowEv,__ZNSt3__210__stdinbufIwE5uflowEv,__ZNSt3__210__stdinbufIcE9underflowEv,__ZNSt3__210__stdinbufIcE5uflowEv,__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv,__ZNKSt3__220__time_get_c_storageIcE7__weeksEv,__ZNKSt3__220__time_get_c_storageIcE8__monthsEv,__ZNKSt3__220__time_get_c_storageIcE7__am_pmEv,__ZNKSt3__220__time_get_c_storageIcE3__cEv,__ZNKSt3__220__time_get_c_storageIcE3__rEv,__ZNKSt3__220__time_get_c_storageIcE3__xEv,__ZNKSt3__220__time_get_c_storageIcE3__XEv,__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv,__ZNKSt3__220__time_get_c_storageIwE7__weeksEv +,__ZNKSt3__220__time_get_c_storageIwE8__monthsEv,__ZNKSt3__220__time_get_c_storageIwE7__am_pmEv,__ZNKSt3__220__time_get_c_storageIwE3__cEv,__ZNKSt3__220__time_get_c_storageIwE3__rEv,__ZNKSt3__220__time_get_c_storageIwE3__xEv,__ZNKSt3__220__time_get_c_storageIwE3__XEv,__ZNKSt3__210moneypunctIcLb0EE16do_decimal_pointEv,__ZNKSt3__210moneypunctIcLb0EE16do_thousands_sepEv,__ZNKSt3__210moneypunctIcLb0EE14do_frac_digitsEv,__ZNKSt3__210moneypunctIcLb1EE16do_decimal_pointEv,__ZNKSt3__210moneypunctIcLb1EE16do_thousands_sepEv,__ZNKSt3__210moneypunctIcLb1EE14do_frac_digitsEv,__ZNKSt3__210moneypunctIwLb0EE16do_decimal_pointEv,__ZNKSt3__210moneypunctIwLb0EE16do_thousands_sepEv,__ZNKSt3__210moneypunctIwLb0EE14do_frac_digitsEv,__ZNKSt3__210moneypunctIwLb1EE16do_decimal_pointEv,__ZNKSt3__210moneypunctIwLb1EE16do_thousands_sepEv,__ZNKSt3__210moneypunctIwLb1EE14do_frac_digitsEv,__ZNKSt3__27codecvtIDic11__mbstate_tE11do_encodingEv,__ZNKSt3__27codecvtIDic11__mbstate_tE16do_always_noconvEv,__ZNKSt3__27codecvtIDic11__mbstate_tE13do_max_lengthEv,__ZNKSt3__27codecvtIwc11__mbstate_tE11do_encodingEv,__ZNKSt3__27codecvtIwc11__mbstate_tE16do_always_noconvEv,__ZNKSt3__27codecvtIwc11__mbstate_tE13do_max_lengthEv,__ZNKSt3__28numpunctIcE16do_decimal_pointEv,__ZNKSt3__28numpunctIcE16do_thousands_sepEv,__ZNKSt3__28numpunctIwE16do_decimal_pointEv,__ZNKSt3__28numpunctIwE16do_thousands_sepEv,__ZNKSt3__27codecvtIcc11__mbstate_tE11do_encodingEv,__ZNKSt3__27codecvtIcc11__mbstate_tE16do_always_noconvEv +,__ZNKSt3__27codecvtIcc11__mbstate_tE13do_max_lengthEv,__ZNKSt3__27codecvtIDsc11__mbstate_tE11do_encodingEv,__ZNKSt3__27codecvtIDsc11__mbstate_tE16do_always_noconvEv,__ZNKSt3__27codecvtIDsc11__mbstate_tE13do_max_lengthEv,_jpeg_std_error,_jpeg_start_decompress,_malloc,_jpeg_finish_decompress,_teardown,_setupAR2,_getMultiMarkerCount,_loadCamera,_detectMarker,_getMarkerNum,_detectNFTMarker,_getDebugMode,_getProcessingImage,_getThresholdMode,_getThreshold,_getPatternDetectionMode,_getMatrixCodeType,_getLabelingMode,_getImageProcMode,__ZN10emscripten8internal7InvokerIiJEE6invokeEPFivE,_consume_data,_dummy_consume_data,_fill_input_buffer,_read_markers,_read_restart_marker,_skip_variable +,_get_interesting_appn,_consume_markers,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3,b3 +,b3,b3,b3,b3,b3,b3,b3,b3,b3]; +var FUNCTION_TABLE_iidiiii = [b4,_fmt_fp]; +var FUNCTION_TABLE_iii = [b5,__ZNKSt3__220__shared_ptr_pointerIPN6vision8KeyframeILi96EEENS_14default_deleteIS3_EENS_9allocatorIS3_EEE13__get_deleterERKSt9type_info,__ZNKSt3__220__shared_ptr_pointerIPhNS_14default_deleteIhEENS_9allocatorIhEEE13__get_deleterERKSt9type_info,__ZNKSt3__220__shared_ptr_pointerIPh16NullArrayDeleterIhENS_9allocatorIhEEE13__get_deleterERKSt9type_info,__ZNK12_GLOBAL__N_116itanium_demangle4Node19hasRHSComponentSlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle4Node12hasArraySlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle4Node15hasFunctionSlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle4Node13getSyntaxNodeERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle13ReferenceType19hasRHSComponentSlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle11PointerType19hasRHSComponentSlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack19hasRHSComponentSlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack12hasArraySlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack15hasFunctionSlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack13getSyntaxNodeERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle24ForwardTemplateReference19hasRHSComponentSlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle24ForwardTemplateReference12hasArraySlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle24ForwardTemplateReference15hasFunctionSlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle24ForwardTemplateReference13getSyntaxNodeERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle19PointerToMemberType19hasRHSComponentSlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle9ArrayType19hasRHSComponentSlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle9ArrayType12hasArraySlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle8QualType19hasRHSComponentSlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle8QualType12hasArraySlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle8QualType15hasFunctionSlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle12FunctionType19hasRHSComponentSlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle12FunctionType15hasFunctionSlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle16FunctionEncoding19hasRHSComponentSlowERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle16FunctionEncoding15hasFunctionSlowERNS_12OutputStreamE,__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi +,__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE8overflowEi,__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE9pbackfailEj,__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE8overflowEj,__ZNSt3__211__stdoutbufIwE8overflowEj,__ZNSt3__211__stdoutbufIcE8overflowEi,__ZNSt3__210__stdinbufIwE9pbackfailEj,__ZNSt3__210__stdinbufIcE9pbackfailEi,__ZNKSt3__25ctypeIcE10do_toupperEc,__ZNKSt3__25ctypeIcE10do_tolowerEc,__ZNKSt3__25ctypeIcE8do_widenEc,__ZNKSt3__25ctypeIwE10do_toupperEw,__ZNKSt3__25ctypeIwE10do_tolowerEw,__ZNKSt3__25ctypeIwE8do_widenEc,_compE,_jpeg_read_header,_addMarker,_addMultiMarker,_addNFTMarker,_getMultiMarkerNum,_setMarkerInfoVertex,_getTransMatMultiSquare,_getTransMatMultiSquareRobust,_getMarkerInfo,_getNFTMarkerInfo,_setDebugMode,__ZN10emscripten8internal7InvokerIiJiEE6invokeEPFiiEi,__ZN10emscripten8internal7InvokerIiJNSt3__212basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEE6invokeEPFiS8_EPNS0_11BindingTypeIS8_vEUt_E,_compE_180,_decompress_data,_decompress_onepass +,_decompress_smooth_data,_decode_mcu_DC_first_62,_decode_mcu_AC_first_63,_decode_mcu_DC_refine_64,_decode_mcu_AC_refine_65,_decode_mcu_66,_decode_mcu_sub,_decode_mcu_DC_first,_decode_mcu_AC_first,_decode_mcu_DC_refine,_decode_mcu_AC_refine,_decode_mcu,_jpeg_resync_to_restart,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5 +,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5,b5 +,b5,b5,b5,b5,b5,b5,b5,b5,b5]; +var FUNCTION_TABLE_iiii = [b6,___stdio_write,___stdio_read,_sn_write,__ZNK10__cxxabiv117__class_type_info9can_catchEPKNS_16__shim_type_infoERPv,__ZNK10__cxxabiv123__fundamental_type_info9can_catchEPKNS_16__shim_type_infoERPv,__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl,__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl,__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl,__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl,__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl,__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl,__ZNSt3__211__stdoutbufIwE6xsputnEPKwl,__ZNSt3__211__stdoutbufIcE6xsputnEPKcl,__ZNKSt3__27collateIcE7do_hashEPKcS3_,__ZNKSt3__27collateIwE7do_hashEPKwS3_,__ZNKSt3__28messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE,__ZNKSt3__28messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE,__ZNKSt3__25ctypeIcE10do_toupperEPcPKc,__ZNKSt3__25ctypeIcE10do_tolowerEPcPKc,__ZNKSt3__25ctypeIcE9do_narrowEcc,__ZNKSt3__25ctypeIwE5do_isEtw,__ZNKSt3__25ctypeIwE10do_toupperEPwPKw,__ZNKSt3__25ctypeIwE10do_tolowerEPwPKw,__ZNKSt3__25ctypeIwE9do_narrowEwc,_jpeg_read_scanlines,_setup,_setMarkerInfoDir,_getTransMatSquare +,_getTransMatSquareCont,_getMultiEachMarkerInfo,__ZN10emscripten8internal7InvokerIiJiNSt3__212basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEE6invokeEPFiiS8_EiPNS0_11BindingTypeIS8_vEUt_E,__ZN10emscripten8internal7InvokerIiJiiEE6invokeEPFiiiEii,_alloc_small,_alloc_large,_do_read,b6,b6,b6,b6,b6,b6,b6,b6,b6,b6,b6,b6,b6,b6,b6,b6,b6,b6,b6,b6,b6,b6,b6 +,b6,b6,b6,b6,b6]; +var FUNCTION_TABLE_iiiii = [b7,___stdio_seek,___emscripten_stdout_seek,__ZNKSt3__25ctypeIcE8do_widenEPKcS3_Pc,__ZNKSt3__25ctypeIwE5do_isEPKwS3_Pt,__ZNKSt3__25ctypeIwE10do_scan_isEtPKwS3_,__ZNKSt3__25ctypeIwE11do_scan_notEtPKwS3_,__ZNKSt3__25ctypeIwE8do_widenEPKcS3_Pw,__ZN10emscripten8internal7InvokerIiJiiiEE6invokeEPFiiiiEiii,_alloc_sarray,_alloc_barray,b7,b7,b7,b7,b7]; +var FUNCTION_TABLE_iiiiid = [b8,__ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd,__ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce,__ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd,__ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe,b8,b8,b8]; +var FUNCTION_TABLE_iiiiii = [b9,__ZNKSt3__27collateIcE10do_compareEPKcS3_S3_S3_,__ZNKSt3__27collateIwE10do_compareEPKwS3_S3_S3_,__ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb,__ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl,__ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm,__ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv,__ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb,__ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl,__ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm,__ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv,__ZNKSt3__27codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_,__ZNKSt3__27codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m,__ZNKSt3__27codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_,__ZNKSt3__27codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m,__ZNKSt3__25ctypeIcE9do_narrowEPKcS3_cPc,__ZNKSt3__25ctypeIwE9do_narrowEPKwS3_cPc,__ZNKSt3__27codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_,__ZNKSt3__27codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m,__ZNKSt3__27codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_,__ZNKSt3__27codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m,_access_virt_sarray,_access_virt_barray,b9,b9,b9,b9,b9,b9 +,b9,b9,b9]; +var FUNCTION_TABLE_iiiiiid = [b10,__ZNKSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce,__ZNKSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe,b10]; +var FUNCTION_TABLE_iiiiiii = [b11,__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb,__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl,__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx,__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt,__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_,__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm,__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy,__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf,__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd,__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe,__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv,__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb,__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl,__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx,__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt,__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_,__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm,__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy,__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf,__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd,__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe,__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv,__ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx,__ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy,__ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx,__ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy,__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm,__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm +,__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm,__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm,__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm,__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm,__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm,__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm,__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm,__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm,__ZNKSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE,__ZNKSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE,_request_virt_sarray,_request_virt_barray,b11,b11,b11,b11,b11,b11,b11,b11,b11,b11,b11,b11,b11,b11,b11,b11,b11,b11 +,b11,b11,b11,b11,b11]; +var FUNCTION_TABLE_iiiiiiii = [b12,__ZNKSt3__28time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc,__ZNKSt3__28time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc,__ZNKSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe,__ZNKSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE,__ZNKSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe,__ZNKSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE,b12]; +var FUNCTION_TABLE_iiiiiiiii = [b13,__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc,__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc,__ZNKSt3__27codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_,__ZNKSt3__27codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_,__ZNKSt3__27codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_,__ZNKSt3__27codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_,__ZNKSt3__27codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_,__ZNKSt3__27codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_,__ZNKSt3__27codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_,__ZNKSt3__27codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_,b13,b13,b13,b13,b13]; +var FUNCTION_TABLE_v = [b14,___cxa_pure_virtual,__ZL28demangling_terminate_handlerv,b14]; +var FUNCTION_TABLE_vi = [b15,__ZN6vision18BinomialPyramid32fD2Ev,__ZN6vision18BinomialPyramid32fD0Ev,__ZN6vision25GaussianScaleSpacePyramidD2Ev,__ZN6vision25GaussianScaleSpacePyramidD0Ev,__ZN6vision9ExceptionD2Ev,__ZN6vision9ExceptionD0Ev,__ZNSt3__214__shared_countD2Ev,__ZNSt3__220__shared_ptr_pointerIPN6vision8KeyframeILi96EEENS_14default_deleteIS3_EENS_9allocatorIS3_EEED0Ev,__ZNSt3__220__shared_ptr_pointerIPN6vision8KeyframeILi96EEENS_14default_deleteIS3_EENS_9allocatorIS3_EEE16__on_zero_sharedEv,__ZNSt3__220__shared_ptr_pointerIPN6vision8KeyframeILi96EEENS_14default_deleteIS3_EENS_9allocatorIS3_EEE21__on_zero_shared_weakEv,__ZNSt3__220__shared_ptr_pointerIPhNS_14default_deleteIhEENS_9allocatorIhEEED0Ev,__ZNSt3__220__shared_ptr_pointerIPhNS_14default_deleteIhEENS_9allocatorIhEEE16__on_zero_sharedEv,__ZNSt3__220__shared_ptr_pointerIPhNS_14default_deleteIhEENS_9allocatorIhEEE21__on_zero_shared_weakEv,__ZNSt3__220__shared_ptr_pointerIPh16NullArrayDeleterIhENS_9allocatorIhEEED0Ev,__ZNSt3__220__shared_ptr_pointerIPh16NullArrayDeleterIhENS_9allocatorIhEEE16__on_zero_sharedEv,__ZNSt3__220__shared_ptr_pointerIPh16NullArrayDeleterIhENS_9allocatorIhEEE21__on_zero_shared_weakEv,__ZN10__cxxabiv116__shim_type_infoD2Ev,__ZN10__cxxabiv117__class_type_infoD0Ev,__ZNK10__cxxabiv116__shim_type_info5noop1Ev,__ZNK10__cxxabiv116__shim_type_info5noop2Ev,__ZN10__cxxabiv120__si_class_type_infoD0Ev,__ZNSt11logic_errorD2Ev,__ZNSt11logic_errorD0Ev,__ZNSt12length_errorD0Ev,__ZN10__cxxabiv123__fundamental_type_infoD0Ev,__ZN10__cxxabiv121__vmi_class_type_infoD0Ev,__ZN12_GLOBAL__N_116itanium_demangle4NodeD2Ev,__ZN12_GLOBAL__N_116itanium_demangle10AbiTagAttrD0Ev +,__ZN12_GLOBAL__N_116itanium_demangle4NodeD0Ev,__ZN12_GLOBAL__N_116itanium_demangle19SpecialSubstitutionD0Ev,__ZN12_GLOBAL__N_116itanium_demangle20PostfixQualifiedTypeD0Ev,__ZN12_GLOBAL__N_116itanium_demangle13ReferenceTypeD0Ev,__ZN12_GLOBAL__N_116itanium_demangle11PointerTypeD0Ev,__ZN12_GLOBAL__N_116itanium_demangle20NameWithTemplateArgsD0Ev,__ZN12_GLOBAL__N_116itanium_demangle12TemplateArgsD0Ev,__ZN12_GLOBAL__N_116itanium_demangle13ParameterPackD0Ev,__ZN12_GLOBAL__N_116itanium_demangle15IntegerCastExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIeED0Ev,__ZN12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIdED0Ev,__ZN12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIfED0Ev,__ZN12_GLOBAL__N_116itanium_demangle8BoolExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle14IntegerLiteralD0Ev,__ZN12_GLOBAL__N_116itanium_demangle20TemplateArgumentPackD0Ev,__ZN12_GLOBAL__N_116itanium_demangle9ThrowExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle12InitListExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle13NodeArrayNodeD0Ev,__ZN12_GLOBAL__N_116itanium_demangle13EnclosingExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle19SizeofParamPackExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle22ParameterPackExpansionD0Ev,__ZN12_GLOBAL__N_116itanium_demangle8CastExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle15ConditionalExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle7NewExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle11PostfixExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle15BracedRangeExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle10BracedExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle8NameTypeD0Ev,__ZN12_GLOBAL__N_116itanium_demangle18ArraySubscriptExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle10MemberExprD0Ev +,__ZN12_GLOBAL__N_116itanium_demangle19GlobalQualifiedNameD0Ev,__ZN12_GLOBAL__N_116itanium_demangle15LiteralOperatorD0Ev,__ZN12_GLOBAL__N_116itanium_demangle22ConversionOperatorTypeD0Ev,__ZN12_GLOBAL__N_116itanium_demangle8DtorNameD0Ev,__ZN12_GLOBAL__N_116itanium_demangle13QualifiedNameD0Ev,__ZN12_GLOBAL__N_116itanium_demangle10DeleteExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle14ConversionExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle8CallExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle10PrefixExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle10BinaryExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle8FoldExprD0Ev,__ZN12_GLOBAL__N_116itanium_demangle13FunctionParamD0Ev,__ZN12_GLOBAL__N_116itanium_demangle24ForwardTemplateReferenceD0Ev,__ZN12_GLOBAL__N_116itanium_demangle22ElaboratedTypeSpefTypeD0Ev,__ZN12_GLOBAL__N_116itanium_demangle16StdQualifiedNameD0Ev,__ZN12_GLOBAL__N_116itanium_demangle21StructuredBindingNameD0Ev,__ZN12_GLOBAL__N_116itanium_demangle15ClosureTypeNameD0Ev,__ZN12_GLOBAL__N_116itanium_demangle15UnnamedTypeNameD0Ev,__ZN12_GLOBAL__N_116itanium_demangle9LocalNameD0Ev,__ZN12_GLOBAL__N_116itanium_demangle12CtorDtorNameD0Ev,__ZN12_GLOBAL__N_116itanium_demangle27ExpandedSpecialSubstitutionD0Ev,__ZN12_GLOBAL__N_116itanium_demangle10NestedNameD0Ev,__ZN12_GLOBAL__N_116itanium_demangle19PointerToMemberTypeD0Ev,__ZN12_GLOBAL__N_116itanium_demangle9ArrayTypeD0Ev,__ZN12_GLOBAL__N_116itanium_demangle10VectorTypeD0Ev,__ZN12_GLOBAL__N_116itanium_demangle15PixelVectorTypeD0Ev,__ZN12_GLOBAL__N_116itanium_demangle8QualTypeD0Ev,__ZN12_GLOBAL__N_116itanium_demangle17VendorExtQualTypeD0Ev,__ZN12_GLOBAL__N_116itanium_demangle13ObjCProtoNameD0Ev,__ZN12_GLOBAL__N_116itanium_demangle12FunctionTypeD0Ev +,__ZN12_GLOBAL__N_116itanium_demangle20DynamicExceptionSpecD0Ev,__ZN12_GLOBAL__N_116itanium_demangle12NoexceptSpecD0Ev,__ZN12_GLOBAL__N_116itanium_demangle11SpecialNameD0Ev,__ZN12_GLOBAL__N_116itanium_demangle9DotSuffixD0Ev,__ZN12_GLOBAL__N_116itanium_demangle16FunctionEncodingD0Ev,__ZN12_GLOBAL__N_116itanium_demangle12EnableIfAttrD0Ev,__ZN12_GLOBAL__N_116itanium_demangle21CtorVtableSpecialNameD0Ev,__ZNSt3__28ios_baseD2Ev,__ZNSt3__28ios_baseD0Ev,__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEED2Ev,__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEED0Ev,__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEED2Ev,__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEED0Ev,__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEED1Ev,__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEED0Ev,__ZTv0_n12_NSt3__213basic_istreamIcNS_11char_traitsIcEEED1Ev,__ZTv0_n12_NSt3__213basic_istreamIcNS_11char_traitsIcEEED0Ev,__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEED1Ev,__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEED0Ev,__ZTv0_n12_NSt3__213basic_istreamIwNS_11char_traitsIwEEED1Ev,__ZTv0_n12_NSt3__213basic_istreamIwNS_11char_traitsIwEEED0Ev,__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEED1Ev,__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEED0Ev,__ZTv0_n12_NSt3__213basic_ostreamIcNS_11char_traitsIcEEED1Ev,__ZTv0_n12_NSt3__213basic_ostreamIcNS_11char_traitsIcEEED0Ev,__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEED1Ev,__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEED0Ev,__ZTv0_n12_NSt3__213basic_ostreamIwNS_11char_traitsIwEEED1Ev,__ZTv0_n12_NSt3__213basic_ostreamIwNS_11char_traitsIwEEED0Ev,__ZNSt3__211__stdoutbufIwED0Ev +,__ZNSt3__211__stdoutbufIcED0Ev,__ZNSt3__210__stdinbufIwED0Ev,__ZNSt3__210__stdinbufIcED0Ev,__ZNSt3__27collateIcED2Ev,__ZNSt3__27collateIcED0Ev,__ZNSt3__26locale5facet16__on_zero_sharedEv,__ZNSt3__27collateIwED2Ev,__ZNSt3__27collateIwED0Ev,__ZNSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev,__ZNSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev,__ZNSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev,__ZNSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev,__ZNSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev,__ZNSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev,__ZNSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev,__ZNSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev,__ZNSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev,__ZNSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev,__ZNSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev,__ZNSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev,__ZNSt3__28time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev,__ZNSt3__28time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev,__ZNSt3__28time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev,__ZNSt3__28time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev,__ZNSt3__210moneypunctIcLb0EED2Ev,__ZNSt3__210moneypunctIcLb0EED0Ev,__ZNSt3__210moneypunctIcLb1EED2Ev,__ZNSt3__210moneypunctIcLb1EED0Ev,__ZNSt3__210moneypunctIwLb0EED2Ev,__ZNSt3__210moneypunctIwLb0EED0Ev +,__ZNSt3__210moneypunctIwLb1EED2Ev,__ZNSt3__210moneypunctIwLb1EED0Ev,__ZNSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev,__ZNSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev,__ZNSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev,__ZNSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev,__ZNSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev,__ZNSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev,__ZNSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev,__ZNSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev,__ZNSt3__28messagesIcED2Ev,__ZNSt3__28messagesIcED0Ev,__ZNSt3__28messagesIwED2Ev,__ZNSt3__28messagesIwED0Ev,__ZNSt3__26locale5facetD2Ev,__ZNSt3__216__narrow_to_utf8ILm32EED0Ev,__ZNSt3__217__widen_from_utf8ILm32EED0Ev,__ZNSt3__27codecvtIwc11__mbstate_tED2Ev,__ZNSt3__27codecvtIwc11__mbstate_tED0Ev,__ZNSt3__26locale5__impD2Ev,__ZNSt3__26locale5__impD0Ev,__ZNSt3__25ctypeIcED2Ev,__ZNSt3__25ctypeIcED0Ev,__ZNSt3__28numpunctIcED2Ev,__ZNSt3__28numpunctIcED0Ev,__ZNSt3__28numpunctIwED2Ev,__ZNSt3__28numpunctIwED0Ev,__ZNSt3__26locale5facetD0Ev,__ZNSt3__25ctypeIwED0Ev,__ZNSt3__27codecvtIcc11__mbstate_tED0Ev +,__ZNSt3__27codecvtIDsc11__mbstate_tED0Ev,__ZNSt3__27codecvtIDic11__mbstate_tED0Ev,_my_error_exit,_jpeg_destroy_decompress,_setLogLevel,_prepare_for_output_pass,_finish_output_pass,_finish_pass_1_quant,_new_color_map_1_quant,_new_color_map_2_quant,_start_pass_merged_upsample,_start_pass_dcolor,_start_pass_upsample,_start_pass_51,_start_pass,_finish_pass,_start_pass_huff_decoder,_finish_pass_huff,_start_input_pass,_start_output_pass,_finish_pass1,_finish_pass2,_init_source,_term_source,_reset_marker_reader,_realize_virt_arrays,_self_destruct,_reset_input_controller,_start_input_pass_79,_finish_input_pass +,_error_exit,_output_message,_reset_error_mgr,__ZNSt3__26locale2id6__initEv,__ZNSt3__217__call_once_proxyINS_5tupleIJONS_12_GLOBAL__N_111__fake_bindEEEEEEvPv,__ZNSt3__212__do_nothingEPv,_free,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15 +,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15,b15]; +var FUNCTION_TABLE_vid = [b16,_setProjectionNearPlane,_setProjectionFarPlane,_setPattRatio]; +var FUNCTION_TABLE_vii = [b17,__ZNK12_GLOBAL__N_116itanium_demangle10AbiTagAttr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle4Node10printRightERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle4Node11getBaseNameEv,__ZNK12_GLOBAL__N_116itanium_demangle19SpecialSubstitution9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle19SpecialSubstitution11getBaseNameEv,__ZNK12_GLOBAL__N_116itanium_demangle20PostfixQualifiedType9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle13ReferenceType9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle13ReferenceType10printRightERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle11PointerType9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle11PointerType10printRightERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle20NameWithTemplateArgs9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle20NameWithTemplateArgs11getBaseNameEv,__ZNK12_GLOBAL__N_116itanium_demangle12TemplateArgs9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle13ParameterPack10printRightERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle15IntegerCastExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIeE9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIdE9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle16FloatLiteralImplIfE9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle8BoolExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle14IntegerLiteral9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle20TemplateArgumentPack9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle9ThrowExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle12InitListExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle13NodeArrayNode9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle13EnclosingExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle19SizeofParamPackExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle22ParameterPackExpansion9printLeftERNS_12OutputStreamE +,__ZNK12_GLOBAL__N_116itanium_demangle8CastExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle15ConditionalExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle7NewExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle11PostfixExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle15BracedRangeExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle10BracedExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle8NameType9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle8NameType11getBaseNameEv,__ZNK12_GLOBAL__N_116itanium_demangle18ArraySubscriptExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle10MemberExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle19GlobalQualifiedName9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle19GlobalQualifiedName11getBaseNameEv,__ZNK12_GLOBAL__N_116itanium_demangle15LiteralOperator9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle22ConversionOperatorType9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle8DtorName9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle13QualifiedName9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle13QualifiedName11getBaseNameEv,__ZNK12_GLOBAL__N_116itanium_demangle10DeleteExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle14ConversionExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle8CallExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle10PrefixExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle10BinaryExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle8FoldExpr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle13FunctionParam9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle24ForwardTemplateReference9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle24ForwardTemplateReference10printRightERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle22ElaboratedTypeSpefType9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle16StdQualifiedName9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle16StdQualifiedName11getBaseNameEv,__ZNK12_GLOBAL__N_116itanium_demangle21StructuredBindingName9printLeftERNS_12OutputStreamE +,__ZNK12_GLOBAL__N_116itanium_demangle15ClosureTypeName9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle15UnnamedTypeName9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle9LocalName9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle12CtorDtorName9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle27ExpandedSpecialSubstitution9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle27ExpandedSpecialSubstitution11getBaseNameEv,__ZNK12_GLOBAL__N_116itanium_demangle10NestedName9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle10NestedName11getBaseNameEv,__ZNK12_GLOBAL__N_116itanium_demangle19PointerToMemberType9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle19PointerToMemberType10printRightERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle9ArrayType9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle9ArrayType10printRightERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle10VectorType9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle15PixelVectorType9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle8QualType9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle8QualType10printRightERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle17VendorExtQualType9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle13ObjCProtoName9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle12FunctionType9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle12FunctionType10printRightERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle20DynamicExceptionSpec9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle12NoexceptSpec9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle11SpecialName9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle9DotSuffix9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle16FunctionEncoding9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle16FunctionEncoding10printRightERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle12EnableIfAttr9printLeftERNS_12OutputStreamE,__ZNK12_GLOBAL__N_116itanium_demangle21CtorVtableSpecialName9printLeftERNS_12OutputStreamE,__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE,__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE +,__ZNSt3__211__stdoutbufIwE5imbueERKNS_6localeE,__ZNSt3__211__stdoutbufIcE5imbueERKNS_6localeE,__ZNSt3__210__stdinbufIwE5imbueERKNS_6localeE,__ZNSt3__210__stdinbufIcE5imbueERKNS_6localeE,__ZNKSt3__210moneypunctIcLb0EE11do_groupingEv,__ZNKSt3__210moneypunctIcLb0EE14do_curr_symbolEv,__ZNKSt3__210moneypunctIcLb0EE16do_positive_signEv,__ZNKSt3__210moneypunctIcLb0EE16do_negative_signEv,__ZNKSt3__210moneypunctIcLb0EE13do_pos_formatEv,__ZNKSt3__210moneypunctIcLb0EE13do_neg_formatEv,__ZNKSt3__210moneypunctIcLb1EE11do_groupingEv,__ZNKSt3__210moneypunctIcLb1EE14do_curr_symbolEv,__ZNKSt3__210moneypunctIcLb1EE16do_positive_signEv,__ZNKSt3__210moneypunctIcLb1EE16do_negative_signEv,__ZNKSt3__210moneypunctIcLb1EE13do_pos_formatEv,__ZNKSt3__210moneypunctIcLb1EE13do_neg_formatEv,__ZNKSt3__210moneypunctIwLb0EE11do_groupingEv,__ZNKSt3__210moneypunctIwLb0EE14do_curr_symbolEv,__ZNKSt3__210moneypunctIwLb0EE16do_positive_signEv,__ZNKSt3__210moneypunctIwLb0EE16do_negative_signEv,__ZNKSt3__210moneypunctIwLb0EE13do_pos_formatEv,__ZNKSt3__210moneypunctIwLb0EE13do_neg_formatEv,__ZNKSt3__210moneypunctIwLb1EE11do_groupingEv,__ZNKSt3__210moneypunctIwLb1EE14do_curr_symbolEv,__ZNKSt3__210moneypunctIwLb1EE16do_positive_signEv,__ZNKSt3__210moneypunctIwLb1EE16do_negative_signEv,__ZNKSt3__210moneypunctIwLb1EE13do_pos_formatEv,__ZNKSt3__210moneypunctIwLb1EE13do_neg_formatEv,__ZNKSt3__28messagesIcE8do_closeEl,__ZNKSt3__28messagesIwE8do_closeEl +,__ZNKSt3__28numpunctIcE11do_groupingEv,__ZNKSt3__28numpunctIcE11do_truenameEv,__ZNKSt3__28numpunctIcE12do_falsenameEv,__ZNKSt3__28numpunctIwE11do_groupingEv,__ZNKSt3__28numpunctIwE11do_truenameEv,__ZNKSt3__28numpunctIwE12do_falsenameEv,_jpeg_stdio_src,_setThresholdMode,_setThreshold,_setPatternDetectionMode,_setMatrixCodeType,_setLabelingMode,_setImageProcMode,__ZN10emscripten8internal7InvokerIvJiEE6invokeEPFviEi,_start_pass_1_quant,_start_pass_2_quant,_start_pass_dpost,_start_pass_main,_skip_input_data,_free_pool,_emit_message,_format_message,_pop_arg_long_double,b17,b17,b17,b17,b17,b17,b17 +,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17 +,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17 +,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17 +,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17,b17]; +var FUNCTION_TABLE_viid = [b18,__ZN10emscripten8internal7InvokerIvJidEE6invokeEPFvidEid,__ZN10emscripten8internal7InvokerIvJifEE6invokeEPFvifEif,b18]; +var FUNCTION_TABLE_viii = [b19,_jpeg_CreateDecompress,__ZN10emscripten8internal7InvokerIvJiiEE6invokeEPFviiEii,b19]; +var FUNCTION_TABLE_viiii = [b20,__ZNK10__cxxabiv117__class_type_info27has_unambiguous_public_baseEPNS_19__dynamic_cast_infoEPvi,__ZNK10__cxxabiv120__si_class_type_info27has_unambiguous_public_baseEPNS_19__dynamic_cast_infoEPvi,__ZNK10__cxxabiv121__vmi_class_type_info27has_unambiguous_public_baseEPNS_19__dynamic_cast_infoEPvi,__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj,__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj,__ZNKSt3__27collateIcE12do_transformEPKcS3_,__ZNKSt3__27collateIwE12do_transformEPKwS3_,_arLog,_h2v2_merged_upsample,_h2v1_merged_upsample,_noop_upsample,_fullsize_upsample,_h2v1_upsample,_h2v2_upsample,_int_upsample,_process_data_context_main,_process_data_simple_main,_process_data_crank_post,_prescan_quantize,_pass2_fs_dither,_pass2_no_dither,_color_quantize3,_color_quantize,_quantize3_ord_dither,_quantize_ord_dither,_quantize_fs_dither,b20,b20 +,b20,b20,b20]; +var FUNCTION_TABLE_viiiii = [b21,__ZNK10__cxxabiv117__class_type_info16search_below_dstEPNS_19__dynamic_cast_infoEPKvib,__ZNK10__cxxabiv120__si_class_type_info16search_below_dstEPNS_19__dynamic_cast_infoEPKvib,__ZNK10__cxxabiv121__vmi_class_type_info16search_below_dstEPNS_19__dynamic_cast_infoEPKvib,_grayscale_convert_52,_rgb_gray_convert_53,_rgb1_gray_convert,_gray_rgb_convert,_ycc_rgb_convert,_rgb_convert_54,_rgb1_rgb_convert,_ycck_cmyk_convert,_null_convert_55,_jpeg_idct_1x1,_jpeg_idct_2x2,_jpeg_idct_3x3,_jpeg_idct_4x4,_jpeg_idct_5x5,_jpeg_idct_6x6,_jpeg_idct_7x7,_jpeg_idct_9x9,_jpeg_idct_10x10,_jpeg_idct_11x11,_jpeg_idct_12x12,_jpeg_idct_13x13,_jpeg_idct_14x14,_jpeg_idct_15x15,_jpeg_idct_16x16,_jpeg_idct_16x8 +,_jpeg_idct_14x7,_jpeg_idct_12x6,_jpeg_idct_10x5,_jpeg_idct_8x4,_jpeg_idct_6x3,_jpeg_idct_4x2,_jpeg_idct_2x1,_jpeg_idct_8x16,_jpeg_idct_7x14,_jpeg_idct_6x12,_jpeg_idct_5x10,_jpeg_idct_4x8,_jpeg_idct_3x6,_jpeg_idct_2x4,_jpeg_idct_1x2,_jpeg_idct_islow,_jpeg_idct_ifast,_jpeg_idct_float,b21,b21,b21,b21,b21,b21,b21,b21,b21,b21,b21,b21 +,b21,b21,b21,b21,b21]; +var FUNCTION_TABLE_viiiiii = [b22,__ZNK10__cxxabiv117__class_type_info16search_above_dstEPNS_19__dynamic_cast_infoEPKvS4_ib,__ZNK10__cxxabiv120__si_class_type_info16search_above_dstEPNS_19__dynamic_cast_infoEPKvS4_ib,__ZNK10__cxxabiv121__vmi_class_type_info16search_above_dstEPNS_19__dynamic_cast_infoEPKvS4_ib,__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj,__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj,__ZNKSt3__28messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE,__ZNKSt3__28messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE]; +var FUNCTION_TABLE_viiiiiii = [b23,_merged_2v_upsample,_merged_1v_upsample,_sep_upsample,_post_process_1pass,_post_process_prepass,_post_process_2pass,b23]; + + return { __GLOBAL__I_000101: __GLOBAL__I_000101, __GLOBAL__sub_I_ARToolKitJS_cpp: __GLOBAL__sub_I_ARToolKitJS_cpp, __GLOBAL__sub_I_bind_cpp: __GLOBAL__sub_I_bind_cpp, __GLOBAL__sub_I_iostream_cpp: __GLOBAL__sub_I_iostream_cpp, __ZSt18uncaught_exceptionv: __ZSt18uncaught_exceptionv, ___cxa_can_catch: ___cxa_can_catch, ___cxa_demangle: ___cxa_demangle, ___cxa_is_pointer_type: ___cxa_is_pointer_type, ___embind_register_native_and_builtin_types: ___embind_register_native_and_builtin_types, ___emscripten_environ_constructor: ___emscripten_environ_constructor, ___errno_location: ___errno_location, ___getTypeName: ___getTypeName, ___muldi3: ___muldi3, ___udivdi3: ___udivdi3, __get_daylight: __get_daylight, __get_environ: __get_environ, __get_timezone: __get_timezone, __get_tzname: __get_tzname, _bitshift64Lshr: _bitshift64Lshr, _bitshift64Shl: _bitshift64Shl, _emscripten_get_sbrk_ptr: _emscripten_get_sbrk_ptr, _emscripten_replace_memory: _emscripten_replace_memory, _fflush: _fflush, _free: _free, _i64Add: _i64Add, _i64Subtract: _i64Subtract, _llvm_bswap_i32: _llvm_bswap_i32, _malloc: _malloc, _memcpy: _memcpy, _memmove: _memmove, _memset: _memset, _realloc: _realloc, _roundf: _roundf, _saveSetjmp: _saveSetjmp, _setThrew: _setThrew, _testSetjmp: _testSetjmp, dynCall_di: dynCall_di, dynCall_dii: dynCall_dii, dynCall_i: dynCall_i, dynCall_ii: dynCall_ii, dynCall_iidiiii: dynCall_iidiiii, dynCall_iii: dynCall_iii, dynCall_iiii: dynCall_iiii, dynCall_iiiii: dynCall_iiiii, dynCall_iiiiid: dynCall_iiiiid, dynCall_iiiiii: dynCall_iiiiii, dynCall_iiiiiid: dynCall_iiiiiid, dynCall_iiiiiii: dynCall_iiiiiii, dynCall_iiiiiiii: dynCall_iiiiiiii, dynCall_iiiiiiiii: dynCall_iiiiiiiii, dynCall_v: dynCall_v, dynCall_vi: dynCall_vi, dynCall_vid: dynCall_vid, dynCall_vii: dynCall_vii, dynCall_viid: dynCall_viid, dynCall_viii: dynCall_viii, dynCall_viiii: dynCall_viiii, dynCall_viiiii: dynCall_viiiii, dynCall_viiiiii: dynCall_viiiiii, dynCall_viiiiiii: dynCall_viiiiiii, establishStackSpace: establishStackSpace, stackAlloc: stackAlloc, stackRestore: stackRestore, stackSave: stackSave }; +}) +// EMSCRIPTEN_END_ASM +(asmGlobalArg, asmLibraryArg, buffer); + +var real___GLOBAL__I_000101 = asm["__GLOBAL__I_000101"]; +asm["__GLOBAL__I_000101"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real___GLOBAL__I_000101.apply(null, arguments); +}; + +var real___GLOBAL__sub_I_ARToolKitJS_cpp = asm["__GLOBAL__sub_I_ARToolKitJS_cpp"]; +asm["__GLOBAL__sub_I_ARToolKitJS_cpp"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real___GLOBAL__sub_I_ARToolKitJS_cpp.apply(null, arguments); +}; + +var real___GLOBAL__sub_I_bind_cpp = asm["__GLOBAL__sub_I_bind_cpp"]; +asm["__GLOBAL__sub_I_bind_cpp"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real___GLOBAL__sub_I_bind_cpp.apply(null, arguments); +}; + +var real___GLOBAL__sub_I_iostream_cpp = asm["__GLOBAL__sub_I_iostream_cpp"]; +asm["__GLOBAL__sub_I_iostream_cpp"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real___GLOBAL__sub_I_iostream_cpp.apply(null, arguments); +}; + +var real___ZSt18uncaught_exceptionv = asm["__ZSt18uncaught_exceptionv"]; +asm["__ZSt18uncaught_exceptionv"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real___ZSt18uncaught_exceptionv.apply(null, arguments); +}; + +var real____cxa_can_catch = asm["___cxa_can_catch"]; +asm["___cxa_can_catch"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real____cxa_can_catch.apply(null, arguments); +}; + +var real____cxa_demangle = asm["___cxa_demangle"]; +asm["___cxa_demangle"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real____cxa_demangle.apply(null, arguments); +}; + +var real____cxa_is_pointer_type = asm["___cxa_is_pointer_type"]; +asm["___cxa_is_pointer_type"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real____cxa_is_pointer_type.apply(null, arguments); +}; + +var real____embind_register_native_and_builtin_types = asm["___embind_register_native_and_builtin_types"]; +asm["___embind_register_native_and_builtin_types"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real____embind_register_native_and_builtin_types.apply(null, arguments); +}; + +var real____emscripten_environ_constructor = asm["___emscripten_environ_constructor"]; +asm["___emscripten_environ_constructor"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real____emscripten_environ_constructor.apply(null, arguments); +}; + +var real____errno_location = asm["___errno_location"]; +asm["___errno_location"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real____errno_location.apply(null, arguments); +}; + +var real____getTypeName = asm["___getTypeName"]; +asm["___getTypeName"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real____getTypeName.apply(null, arguments); +}; + +var real____muldi3 = asm["___muldi3"]; +asm["___muldi3"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real____muldi3.apply(null, arguments); +}; + +var real____udivdi3 = asm["___udivdi3"]; +asm["___udivdi3"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real____udivdi3.apply(null, arguments); +}; + +var real___get_daylight = asm["__get_daylight"]; +asm["__get_daylight"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real___get_daylight.apply(null, arguments); +}; + +var real___get_environ = asm["__get_environ"]; +asm["__get_environ"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real___get_environ.apply(null, arguments); +}; + +var real___get_timezone = asm["__get_timezone"]; +asm["__get_timezone"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real___get_timezone.apply(null, arguments); +}; + +var real___get_tzname = asm["__get_tzname"]; +asm["__get_tzname"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real___get_tzname.apply(null, arguments); +}; + +var real__bitshift64Lshr = asm["_bitshift64Lshr"]; +asm["_bitshift64Lshr"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__bitshift64Lshr.apply(null, arguments); +}; + +var real__bitshift64Shl = asm["_bitshift64Shl"]; +asm["_bitshift64Shl"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__bitshift64Shl.apply(null, arguments); +}; + +var real__emscripten_get_sbrk_ptr = asm["_emscripten_get_sbrk_ptr"]; +asm["_emscripten_get_sbrk_ptr"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_get_sbrk_ptr.apply(null, arguments); +}; + +var real__fflush = asm["_fflush"]; +asm["_fflush"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__fflush.apply(null, arguments); +}; + +var real__free = asm["_free"]; +asm["_free"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__free.apply(null, arguments); +}; + +var real__i64Add = asm["_i64Add"]; +asm["_i64Add"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__i64Add.apply(null, arguments); +}; + +var real__i64Subtract = asm["_i64Subtract"]; +asm["_i64Subtract"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__i64Subtract.apply(null, arguments); +}; + +var real__llvm_bswap_i32 = asm["_llvm_bswap_i32"]; +asm["_llvm_bswap_i32"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__llvm_bswap_i32.apply(null, arguments); +}; + +var real__malloc = asm["_malloc"]; +asm["_malloc"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__malloc.apply(null, arguments); +}; + +var real__memmove = asm["_memmove"]; +asm["_memmove"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__memmove.apply(null, arguments); +}; + +var real__realloc = asm["_realloc"]; +asm["_realloc"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__realloc.apply(null, arguments); +}; + +var real__roundf = asm["_roundf"]; +asm["_roundf"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__roundf.apply(null, arguments); +}; + +var real__saveSetjmp = asm["_saveSetjmp"]; +asm["_saveSetjmp"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__saveSetjmp.apply(null, arguments); +}; + +var real__setThrew = asm["_setThrew"]; +asm["_setThrew"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__setThrew.apply(null, arguments); +}; + +var real__testSetjmp = asm["_testSetjmp"]; +asm["_testSetjmp"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__testSetjmp.apply(null, arguments); +}; + +var real_establishStackSpace = asm["establishStackSpace"]; +asm["establishStackSpace"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_establishStackSpace.apply(null, arguments); +}; + +var real_stackAlloc = asm["stackAlloc"]; +asm["stackAlloc"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_stackAlloc.apply(null, arguments); +}; + +var real_stackRestore = asm["stackRestore"]; +asm["stackRestore"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_stackRestore.apply(null, arguments); +}; + +var real_stackSave = asm["stackSave"]; +asm["stackSave"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_stackSave.apply(null, arguments); +}; +var __GLOBAL__I_000101 = Module["__GLOBAL__I_000101"] = asm["__GLOBAL__I_000101"]; +var __GLOBAL__sub_I_ARToolKitJS_cpp = Module["__GLOBAL__sub_I_ARToolKitJS_cpp"] = asm["__GLOBAL__sub_I_ARToolKitJS_cpp"]; +var __GLOBAL__sub_I_bind_cpp = Module["__GLOBAL__sub_I_bind_cpp"] = asm["__GLOBAL__sub_I_bind_cpp"]; +var __GLOBAL__sub_I_iostream_cpp = Module["__GLOBAL__sub_I_iostream_cpp"] = asm["__GLOBAL__sub_I_iostream_cpp"]; +var __ZSt18uncaught_exceptionv = Module["__ZSt18uncaught_exceptionv"] = asm["__ZSt18uncaught_exceptionv"]; +var ___cxa_can_catch = Module["___cxa_can_catch"] = asm["___cxa_can_catch"]; +var ___cxa_demangle = Module["___cxa_demangle"] = asm["___cxa_demangle"]; +var ___cxa_is_pointer_type = Module["___cxa_is_pointer_type"] = asm["___cxa_is_pointer_type"]; +var ___embind_register_native_and_builtin_types = Module["___embind_register_native_and_builtin_types"] = asm["___embind_register_native_and_builtin_types"]; +var ___emscripten_environ_constructor = Module["___emscripten_environ_constructor"] = asm["___emscripten_environ_constructor"]; +var ___errno_location = Module["___errno_location"] = asm["___errno_location"]; +var ___getTypeName = Module["___getTypeName"] = asm["___getTypeName"]; +var ___muldi3 = Module["___muldi3"] = asm["___muldi3"]; +var ___udivdi3 = Module["___udivdi3"] = asm["___udivdi3"]; +var __get_daylight = Module["__get_daylight"] = asm["__get_daylight"]; +var __get_environ = Module["__get_environ"] = asm["__get_environ"]; +var __get_timezone = Module["__get_timezone"] = asm["__get_timezone"]; +var __get_tzname = Module["__get_tzname"] = asm["__get_tzname"]; +var _bitshift64Lshr = Module["_bitshift64Lshr"] = asm["_bitshift64Lshr"]; +var _bitshift64Shl = Module["_bitshift64Shl"] = asm["_bitshift64Shl"]; +var _emscripten_get_sbrk_ptr = Module["_emscripten_get_sbrk_ptr"] = asm["_emscripten_get_sbrk_ptr"]; +var _emscripten_replace_memory = Module["_emscripten_replace_memory"] = asm["_emscripten_replace_memory"]; +var _fflush = Module["_fflush"] = asm["_fflush"]; +var _free = Module["_free"] = asm["_free"]; +var _i64Add = Module["_i64Add"] = asm["_i64Add"]; +var _i64Subtract = Module["_i64Subtract"] = asm["_i64Subtract"]; +var _llvm_bswap_i32 = Module["_llvm_bswap_i32"] = asm["_llvm_bswap_i32"]; +var _malloc = Module["_malloc"] = asm["_malloc"]; +var _memcpy = Module["_memcpy"] = asm["_memcpy"]; +var _memmove = Module["_memmove"] = asm["_memmove"]; +var _memset = Module["_memset"] = asm["_memset"]; +var _realloc = Module["_realloc"] = asm["_realloc"]; +var _roundf = Module["_roundf"] = asm["_roundf"]; +var _saveSetjmp = Module["_saveSetjmp"] = asm["_saveSetjmp"]; +var _setThrew = Module["_setThrew"] = asm["_setThrew"]; +var _testSetjmp = Module["_testSetjmp"] = asm["_testSetjmp"]; +var establishStackSpace = Module["establishStackSpace"] = asm["establishStackSpace"]; +var stackAlloc = Module["stackAlloc"] = asm["stackAlloc"]; +var stackRestore = Module["stackRestore"] = asm["stackRestore"]; +var stackSave = Module["stackSave"] = asm["stackSave"]; +var dynCall_di = Module["dynCall_di"] = asm["dynCall_di"]; +var dynCall_dii = Module["dynCall_dii"] = asm["dynCall_dii"]; +var dynCall_i = Module["dynCall_i"] = asm["dynCall_i"]; +var dynCall_ii = Module["dynCall_ii"] = asm["dynCall_ii"]; +var dynCall_iidiiii = Module["dynCall_iidiiii"] = asm["dynCall_iidiiii"]; +var dynCall_iii = Module["dynCall_iii"] = asm["dynCall_iii"]; +var dynCall_iiii = Module["dynCall_iiii"] = asm["dynCall_iiii"]; +var dynCall_iiiii = Module["dynCall_iiiii"] = asm["dynCall_iiiii"]; +var dynCall_iiiiid = Module["dynCall_iiiiid"] = asm["dynCall_iiiiid"]; +var dynCall_iiiiii = Module["dynCall_iiiiii"] = asm["dynCall_iiiiii"]; +var dynCall_iiiiiid = Module["dynCall_iiiiiid"] = asm["dynCall_iiiiiid"]; +var dynCall_iiiiiii = Module["dynCall_iiiiiii"] = asm["dynCall_iiiiiii"]; +var dynCall_iiiiiiii = Module["dynCall_iiiiiiii"] = asm["dynCall_iiiiiiii"]; +var dynCall_iiiiiiiii = Module["dynCall_iiiiiiiii"] = asm["dynCall_iiiiiiiii"]; +var dynCall_v = Module["dynCall_v"] = asm["dynCall_v"]; +var dynCall_vi = Module["dynCall_vi"] = asm["dynCall_vi"]; +var dynCall_vid = Module["dynCall_vid"] = asm["dynCall_vid"]; +var dynCall_vii = Module["dynCall_vii"] = asm["dynCall_vii"]; +var dynCall_viid = Module["dynCall_viid"] = asm["dynCall_viid"]; +var dynCall_viii = Module["dynCall_viii"] = asm["dynCall_viii"]; +var dynCall_viiii = Module["dynCall_viiii"] = asm["dynCall_viiii"]; +var dynCall_viiiii = Module["dynCall_viiiii"] = asm["dynCall_viiiii"]; +var dynCall_viiiiii = Module["dynCall_viiiiii"] = asm["dynCall_viiiiii"]; +var dynCall_viiiiiii = Module["dynCall_viiiiiii"] = asm["dynCall_viiiiiii"]; +; + + + +// === Auto-generated postamble setup entry stuff === + +Module['asm'] = asm; + +if (!Object.getOwnPropertyDescriptor(Module, "intArrayFromString")) Module["intArrayFromString"] = function() { abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "intArrayToString")) Module["intArrayToString"] = function() { abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "ccall")) Module["ccall"] = function() { abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "cwrap")) Module["cwrap"] = function() { abort("'cwrap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "setValue")) Module["setValue"] = function() { abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "getValue")) Module["getValue"] = function() { abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "allocate")) Module["allocate"] = function() { abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "getMemory")) Module["getMemory"] = function() { abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "AsciiToString")) Module["AsciiToString"] = function() { abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stringToAscii")) Module["stringToAscii"] = function() { abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "UTF8ArrayToString")) Module["UTF8ArrayToString"] = function() { abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "UTF8ToString")) Module["UTF8ToString"] = function() { abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8Array")) Module["stringToUTF8Array"] = function() { abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8")) Module["stringToUTF8"] = function() { abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF8")) Module["lengthBytesUTF8"] = function() { abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "UTF16ToString")) Module["UTF16ToString"] = function() { abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF16")) Module["stringToUTF16"] = function() { abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF16")) Module["lengthBytesUTF16"] = function() { abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "UTF32ToString")) Module["UTF32ToString"] = function() { abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF32")) Module["stringToUTF32"] = function() { abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF32")) Module["lengthBytesUTF32"] = function() { abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8")) Module["allocateUTF8"] = function() { abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function() { abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "addOnPreRun")) Module["addOnPreRun"] = function() { abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "addOnInit")) Module["addOnInit"] = function() { abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "addOnPreMain")) Module["addOnPreMain"] = function() { abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "addOnExit")) Module["addOnExit"] = function() { abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "addOnPostRun")) Module["addOnPostRun"] = function() { abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "writeStringToMemory")) Module["writeStringToMemory"] = function() { abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "writeArrayToMemory")) Module["writeArrayToMemory"] = function() { abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "writeAsciiToMemory")) Module["writeAsciiToMemory"] = function() { abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "addRunDependency")) Module["addRunDependency"] = function() { abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "removeRunDependency")) Module["removeRunDependency"] = function() { abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "ENV")) Module["ENV"] = function() { abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS")) Module["FS"] = function() { abort("'FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS_createFolder")) Module["FS_createFolder"] = function() { abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS_createPath")) Module["FS_createPath"] = function() { abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS_createDataFile")) Module["FS_createDataFile"] = function() { abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS_createPreloadedFile")) Module["FS_createPreloadedFile"] = function() { abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS_createLazyFile")) Module["FS_createLazyFile"] = function() { abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS_createLink")) Module["FS_createLink"] = function() { abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS_createDevice")) Module["FS_createDevice"] = function() { abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS_unlink")) Module["FS_unlink"] = function() { abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "GL")) Module["GL"] = function() { abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "dynamicAlloc")) Module["dynamicAlloc"] = function() { abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "loadDynamicLibrary")) Module["loadDynamicLibrary"] = function() { abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "loadWebAssemblyModule")) Module["loadWebAssemblyModule"] = function() { abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "getLEB")) Module["getLEB"] = function() { abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "getFunctionTables")) Module["getFunctionTables"] = function() { abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "alignFunctionTables")) Module["alignFunctionTables"] = function() { abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "registerFunctions")) Module["registerFunctions"] = function() { abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "addFunction")) Module["addFunction"] = function() { abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "removeFunction")) Module["removeFunction"] = function() { abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "getFuncWrapper")) Module["getFuncWrapper"] = function() { abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "prettyPrint")) Module["prettyPrint"] = function() { abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "makeBigInt")) Module["makeBigInt"] = function() { abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "dynCall")) Module["dynCall"] = function() { abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "getCompilerSetting")) Module["getCompilerSetting"] = function() { abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stackSave")) Module["stackSave"] = function() { abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stackRestore")) Module["stackRestore"] = function() { abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stackAlloc")) Module["stackAlloc"] = function() { abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "establishStackSpace")) Module["establishStackSpace"] = function() { abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "print")) Module["print"] = function() { abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "printErr")) Module["printErr"] = function() { abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "getTempRet0")) Module["getTempRet0"] = function() { abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "setTempRet0")) Module["setTempRet0"] = function() { abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "callMain")) Module["callMain"] = function() { abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "abort")) Module["abort"] = function() { abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "Pointer_stringify")) Module["Pointer_stringify"] = function() { abort("'Pointer_stringify' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "warnOnce")) Module["warnOnce"] = function() { abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +Module["writeStackCookie"] = writeStackCookie; +Module["checkStackCookie"] = checkStackCookie; +Module["abortStackOverflow"] = abortStackOverflow; +if (!Object.getOwnPropertyDescriptor(Module, "intArrayFromBase64")) Module["intArrayFromBase64"] = function() { abort("'intArrayFromBase64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "tryParseAsDataURI")) Module["tryParseAsDataURI"] = function() { abort("'tryParseAsDataURI' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NORMAL")) Object.defineProperty(Module, "ALLOC_NORMAL", { configurable: true, get: function() { abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") } }); +if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_STACK")) Object.defineProperty(Module, "ALLOC_STACK", { configurable: true, get: function() { abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") } }); +if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_DYNAMIC")) Object.defineProperty(Module, "ALLOC_DYNAMIC", { configurable: true, get: function() { abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") } }); +if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NONE")) Object.defineProperty(Module, "ALLOC_NONE", { configurable: true, get: function() { abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") } }); +if (!Object.getOwnPropertyDescriptor(Module, "calledRun")) Object.defineProperty(Module, "calledRun", { configurable: true, get: function() { abort("'calledRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") } }); + +if (memoryInitializer) { + if (!isDataURI(memoryInitializer)) { + memoryInitializer = locateFile(memoryInitializer); + } + if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) { + var data = readBinary(memoryInitializer); + HEAPU8.set(data, GLOBAL_BASE); + } else { + addRunDependency('memory initializer'); + var applyMemoryInitializer = function(data) { + if (data.byteLength) data = new Uint8Array(data); + for (var i = 0; i < data.length; i++) { + assert(HEAPU8[GLOBAL_BASE + i] === 0, "area for memory initializer should not have been touched before it's loaded"); + } + HEAPU8.set(data, GLOBAL_BASE); + // Delete the typed array that contains the large blob of the memory initializer request response so that + // we won't keep unnecessary memory lying around. However, keep the XHR object itself alive so that e.g. + // its .status field can still be accessed later. + if (Module['memoryInitializerRequest']) delete Module['memoryInitializerRequest'].response; + removeRunDependency('memory initializer'); + }; + var doBrowserLoad = function() { + readAsync(memoryInitializer, applyMemoryInitializer, function() { + throw 'could not load memory initializer ' + memoryInitializer; + }); + }; + var memoryInitializerBytes = tryParseAsDataURI(memoryInitializer); + if (memoryInitializerBytes) { + applyMemoryInitializer(memoryInitializerBytes.buffer); + } else + if (Module['memoryInitializerRequest']) { + // a network request has already been created, just use that + var useRequest = function() { + var request = Module['memoryInitializerRequest']; + var response = request.response; + if (request.status !== 200 && request.status !== 0) { + var data = tryParseAsDataURI(Module['memoryInitializerRequestURL']); + if (data) { + response = data.buffer; + } else { + // If you see this warning, the issue may be that you are using locateFile and defining it in JS. That + // means that the HTML file doesn't know about it, and when it tries to create the mem init request early, does it to the wrong place. + // Look in your browser's devtools network console to see what's going on. + console.warn('a problem seems to have happened with Module.memoryInitializerRequest, status: ' + request.status + ', retrying ' + memoryInitializer); + doBrowserLoad(); + return; + } + } + applyMemoryInitializer(response); + }; + if (Module['memoryInitializerRequest'].response) { + setTimeout(useRequest, 0); // it's already here; but, apply it asynchronously + } else { + Module['memoryInitializerRequest'].addEventListener('load', useRequest); // wait for it + } + } else { + // fetch it from the network ourselves + doBrowserLoad(); + } + } +} + + +var calledRun; + + +/** + * @constructor + * @this {ExitStatus} + */ +function ExitStatus(status) { + this.name = "ExitStatus"; + this.message = "Program terminated with exit(" + status + ")"; + this.status = status; +} + +var calledMain = false; + + +dependenciesFulfilled = function runCaller() { + // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false) + if (!calledRun) run(); + if (!calledRun) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled +}; + + + + + +/** @type {function(Array=)} */ +function run(args) { + args = args || arguments_; + + if (runDependencies > 0) { + return; + } + + writeStackCookie(); + + preRun(); + + if (runDependencies > 0) return; // a preRun added a dependency, run will be called later + + function doRun() { + // run may have just been called through dependencies being fulfilled just in this very frame, + // or while the async setStatus time below was happening + if (calledRun) return; + calledRun = true; + + if (ABORT) return; + + initRuntime(); + + preMain(); + + if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized'](); + + assert(!Module['_main'], 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'); + + postRun(); + } + + if (Module['setStatus']) { + Module['setStatus']('Running...'); + setTimeout(function() { + setTimeout(function() { + Module['setStatus'](''); + }, 1); + doRun(); + }, 1); + } else + { + doRun(); + } + checkStackCookie(); +} +Module['run'] = run; + +function checkUnflushedContent() { + // Compiler settings do not allow exiting the runtime, so flushing + // the streams is not possible. but in ASSERTIONS mode we check + // if there was something to flush, and if so tell the user they + // should request that the runtime be exitable. + // Normally we would not even include flush() at all, but in ASSERTIONS + // builds we do so just for this check, and here we see if there is any + // content to flush, that is, we check if there would have been + // something a non-ASSERTIONS build would have not seen. + // How we flush the streams depends on whether we are in SYSCALLS_REQUIRE_FILESYSTEM=0 + // mode (which has its own special function for this; otherwise, all + // the code is inside libc) + var print = out; + var printErr = err; + var has = false; + out = err = function(x) { + has = true; + } + try { // it doesn't matter if it fails + var flush = Module['_fflush']; + if (flush) flush(0); + // also flush in the JS FS layer + ['stdout', 'stderr'].forEach(function(name) { + var info = FS.analyzePath('/dev/' + name); + if (!info) return; + var stream = info.object; + var rdev = stream.rdev; + var tty = TTY.ttys[rdev]; + if (tty && tty.output && tty.output.length) { + has = true; + } + }); + } catch(e) {} + out = print; + err = printErr; + if (has) { + warnOnce('stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.'); + } +} + +function exit(status, implicit) { + checkUnflushedContent(); + + // if this is just main exit-ing implicitly, and the status is 0, then we + // don't need to do anything here and can just leave. if the status is + // non-zero, though, then we need to report it. + // (we may have warned about this earlier, if a situation justifies doing so) + if (implicit && noExitRuntime && status === 0) { + return; + } + + if (noExitRuntime) { + // if exit() was called, we may warn the user if the runtime isn't actually being shut down + if (!implicit) { + err('program exited (with status: ' + status + '), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)'); + } + } else { + + ABORT = true; + EXITSTATUS = status; + + exitRuntime(); + + if (Module['onExit']) Module['onExit'](status); + } + + quit_(status, new ExitStatus(status)); +} + +if (Module['preInit']) { + if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']]; + while (Module['preInit'].length > 0) { + Module['preInit'].pop()(); + } +} + + + noExitRuntime = true; + +run(); + + + + + +// {{MODULE_ADDITIONS}} + + + + + + diff --git a/jsartoolkit5/build/artoolkit.min.js b/jsartoolkit5/build/artoolkit.min.js new file mode 100644 index 0000000..4ba176b --- /dev/null +++ b/jsartoolkit5/build/artoolkit.min.js @@ -0,0 +1,22 @@ +var Module=typeof Module!=="undefined"?Module:{};(function(){"use strict";var scope;if(typeof window!=="undefined"){scope=window}else{scope=self}if(scope.artoolkit_wasm_url){var downloadWasm=function(url){return new Promise(function(resolve,reject){var wasmXHR=new XMLHttpRequest;wasmXHR.open("GET",url,true);wasmXHR.responseType="arraybuffer";wasmXHR.onload=function(){resolve(wasmXHR.response)};wasmXHR.onerror=function(){reject("error "+wasmXHR.status)};wasmXHR.send(null)})};var wasm=downloadWasm(scope.artoolkit_wasm_url);Module.instantiateWasm=function(imports,successCallback){console.log("instantiateWasm: instantiating synchronously");wasm.then(function(wasmBinary){console.log("wasm download finished, begin instantiating");var wasmInstantiate=WebAssembly.instantiate(new Uint8Array(wasmBinary),imports).then(function(output){console.log("wasm instantiation succeeded");successCallback(output.instance)}).catch(function(e){console.log("wasm instantiation failed! "+e)})});return{}}}var ARController=function(width,height,cameraPara){this.id=undefined;var w=width,h=height;this.orientation="landscape";this.listeners={};if(typeof width!=="number"){var image=width;cameraPara=height;w=image.videoWidth||image.width;h=image.videoHeight||image.height;this.image=image}this.width=w;this.height=h;this.nftMarkerCount=0;this.defaultMarkerWidth=1;this.patternMarkers={};this.barcodeMarkers={};this.nftMarkers={};this.transform_mat=new Float32Array(16);this.transformGL_RH=new Float64Array(16);if(typeof document!=="undefined"){this.canvas=document.createElement("canvas");this.canvas.width=w;this.canvas.height=h;this.ctx=this.canvas.getContext("2d")}this.videoWidth=w;this.videoHeight=h;this.videoSize=this.videoWidth*this.videoHeight;this.framepointer=null;this.framesize=null;this.dataHeap=null;this.videoLuma=null;this.camera_mat=null;this.marker_transform_mat=null;this.videoLumaPointer=null;this._bwpointer=undefined;this._lumaCtx=undefined;if(typeof cameraPara==="string"){this.cameraParam=new ARCameraParam(cameraPara,function(){this._initialize()}.bind(this),function(err){console.error("ARController: Failed to load ARCameraParam",err);this.onload(err)}.bind(this))}else{this.cameraParam=cameraPara;this._initialize()}};ARController.prototype.dispose=function(){if(this.id>-1){artoolkit.teardown(this.id)}if(this.image&&this.image.srcObject){ARController._teardownVideo(this.image)}for(var t in this){this[t]=null}};ARController.prototype.process=function(image){var result=this.detectMarker(image);if(result!=0){console.error("detectMarker error: "+result)}var markerNum=this.getMarkerNum();var k,o;for(k in this.patternMarkers){o=this.patternMarkers[k];o.inPrevious=o.inCurrent;o.inCurrent=false}for(k in this.barcodeMarkers){o=this.barcodeMarkers[k];o.inPrevious=o.inCurrent;o.inCurrent=false}for(k in this.nftMarkers){o=this.nftMarkers[k];o.inPrevious=o.inCurrent;o.inCurrent=false}for(var i=0;i-1&&(markerInfo.id===markerInfo.idPatt||markerInfo.idMatrix===-1)){visible=this.trackPatternMarkerId(markerInfo.idPatt);markerType=artoolkit.PATTERN_MARKER;if(markerInfo.dir!==markerInfo.dirPatt){this.setMarkerInfoDir(i,markerInfo.dirPatt)}}else if(markerInfo.idMatrix>-1){visible=this.trackBarcodeMarkerId(markerInfo.idMatrix);markerType=artoolkit.BARCODE_MARKER;if(markerInfo.dir!==markerInfo.dirMatrix){this.setMarkerInfoDir(i,markerInfo.dirMatrix)}}if(markerType!==artoolkit.UNKNOWN_MARKER&&visible.inPrevious){this.getTransMatSquareCont(i,visible.markerWidth,visible.matrix,visible.matrix)}else{this.getTransMatSquare(i,visible.markerWidth,visible.matrix)}visible.inCurrent=true;this.transMatToGLMat(visible.matrix,this.transform_mat);this.transformGL_RH=this.arglCameraViewRHf(this.transform_mat);this.dispatchEvent({name:"getMarker",target:this,data:{index:i,type:markerType,marker:markerInfo,matrix:this.transform_mat,matrixGL_RH:this.transformGL_RH}})}var nftMarkerCount=this.nftMarkerCount;this.detectNFTMarker();var MARKER_LOST_TIME=200;for(var i=0;i=0){visible=true;this.dispatchEvent({name:"getMultiMarker",target:this,data:{multiMarkerId:i,matrix:this.transform_mat,matrixGL_RH:this.transformGL_RH}});break}}if(visible){for(var j=0;j-1){this.listeners[name].splice(index,1)}}};ARController.prototype.dispatchEvent=function(event){var listeners=this.listeners[event.name];if(listeners){for(var i=0;i>3;q+=4}}if(this.dataHeap){this.dataHeap.set(data);return true}return false};ARController.prototype._debugMarker=function(marker){var vertex,pos;vertex=marker.vertex;var ctx=this.ctx;ctx.strokeStyle="red";ctx.beginPath();ctx.moveTo(vertex[0][0],vertex[0][1]);ctx.lineTo(vertex[1][0],vertex[1][1]);ctx.stroke();ctx.beginPath();ctx.moveTo(vertex[2][0],vertex[2][1]);ctx.lineTo(vertex[3][0],vertex[3][1]);ctx.stroke();ctx.strokeStyle="green";ctx.beginPath();ctx.lineTo(vertex[1][0],vertex[1][1]);ctx.lineTo(vertex[2][0],vertex[2][1]);ctx.stroke();ctx.beginPath();ctx.moveTo(vertex[3][0],vertex[3][1]);ctx.lineTo(vertex[0][0],vertex[0][1]);ctx.stroke();pos=marker.pos;ctx.beginPath();ctx.arc(pos[0],pos[1],8,0,Math.PI*2);ctx.fillStyle="red";ctx.fill()};ARController.getUserMedia=function(configuration){var facing=configuration.facingMode||"environment";var onSuccess=configuration.onSuccess;var onError=configuration.onError||function(err){console.error("ARController.getUserMedia",err)};var video=document.createElement("video");var readyToPlay=false;var eventNames=["touchstart","touchend","touchmove","touchcancel","click","mousedown","mouseup","mousemove","keydown","keyup","keypress","scroll"];var play=function(){if(readyToPlay){video.play().then(function(){onSuccess(video)}).catch(function(error){onError(error);ARController._teardownVideo(video)});if(!video.paused){eventNames.forEach(function(eventName){window.removeEventListener(eventName,play,true)})}}};eventNames.forEach(function(eventName){window.addEventListener(eventName,play,true)});var success=function(stream){if(window.URL.createObjectURL){try{video.srcObject=stream}catch(ex){}}video.srcObject=stream;readyToPlay=true;video.autoplay=true;video.playsInline=true;play()};var constraints={};var mediaDevicesConstraints={};if(configuration.width){mediaDevicesConstraints.width=configuration.width;if(typeof configuration.width==="object"){if(configuration.width.max){constraints.maxWidth=configuration.width.max}if(configuration.width.min){constraints.minWidth=configuration.width.min}}else{constraints.maxWidth=configuration.width}}if(configuration.height){mediaDevicesConstraints.height=configuration.height;if(typeof configuration.height==="object"){if(configuration.height.max){constraints.maxHeight=configuration.height.max}if(configuration.height.min){constraints.minHeight=configuration.height.min}}else{constraints.maxHeight=configuration.height}}mediaDevicesConstraints.facingMode=facing;mediaDevicesConstraints.deviceId=configuration.deviceId;navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;var hdConstraints={audio:false,video:constraints};if(navigator.mediaDevices||window.MediaStreamTrack.getSources){if(navigator.mediaDevices){navigator.mediaDevices.getUserMedia({audio:false,video:mediaDevicesConstraints}).then(success,onError)}else{window.MediaStreamTrack.getSources(function(sources){var facingDir=mediaDevicesConstraints.facingMode;if(facing&&facing.exact){facingDir=facing.exact}for(var i=0;i-1){writeStringToFS(filename,url,writeCallback)}else{ajax(url,filename,writeCallback,errorCallback)}}function writeStringToFS(target,string,callback){var byteArray=new Uint8Array(string.length);for(var i=0;i1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){var data=tryParseAsDataURI(f);if(data){return intArrayToString(data)}return read(f)}}readBinary=function readBinary(f){var data;data=tryParseAsDataURI(f);if(data){return data}if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function shell_read(url){try{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText}catch(err){var data=tryParseAsDataURI(url);if(data){return intArrayToString(data)}throw err}};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){try{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}catch(err){var data=tryParseAsDataURI(url);if(data){return data}throw err}}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}var data=tryParseAsDataURI(url);if(data){onload(data.buffer);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function dynamicAlloc(size){var ret=HEAP32[DYNAMICTOP_PTR>>2];var end=ret+size+15&-16;if(end>_emscripten_get_heap_size()){abort()}HEAP32[DYNAMICTOP_PTR>>2]=end;return ret}function getNativeTypeSize(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return 4}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0,"getNativeTypeSize invalid bits "+bits+", type "+type);return bits/8}else{return 0}}}}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var jsCallStartIndex=1;var functionPointers=new Array(0);var funcWrappers={};function dynCall(sig,ptr,args){if(args&&args.length){return Module["dynCall_"+sig].apply(null,[ptr].concat(args))}else{return Module["dynCall_"+sig].call(null,ptr)}}var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};var GLOBAL_BASE=8;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];function setValue(ptr,value,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":HEAP8[ptr>>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;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;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i>2]=0}stop=ret+size;while(ptr>0]=0}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret)}else{HEAPU8.set(new Uint8Array(slab),ret)}return ret}var i=0,type,typeSize,previousType;while(i=endIdx))++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function allocateUTF8(str){var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8Array(str,HEAP8,ret,size);return ret}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=57888,DYNAMIC_BASE=5300768,DYNAMICTOP_PTR=57696;var INITIAL_TOTAL_MEMORY=Module["TOTAL_MEMORY"]||268435456;if(Module["buffer"]){buffer=Module["buffer"]}else{buffer=new ArrayBuffer(INITIAL_TOTAL_MEMORY)}INITIAL_TOTAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){runtimeExited=true}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var Math_abs=Math.abs;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_min=Math.min;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";throw what}var memoryInitializer=null;var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var tempDouble;var tempI64;var ASM_CONSTS=[function($0,$1,$2,$3,$4,$5){if(!artoolkit["frameMalloc"]){artoolkit["frameMalloc"]={}}var frameMalloc=artoolkit["frameMalloc"];frameMalloc["framepointer"]=$1;frameMalloc["framesize"]=$2;frameMalloc["camera"]=$3;frameMalloc["transform"]=$4;frameMalloc["videoLumaPointer"]=$5},function($0,$1,$2,$3){if(!artoolkit["multiEachMarkerInfo"]){artoolkit["multiEachMarkerInfo"]={}}var multiEachMarker=artoolkit["multiEachMarkerInfo"];multiEachMarker["visible"]=$0;multiEachMarker["pattId"]=$1;multiEachMarker["pattType"]=$2;multiEachMarker["width"]=$3},function($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){var $a=arguments;var i=12;if(!artoolkit["markerInfo"]){artoolkit["markerInfo"]={pos:[0,0],line:[[0,0,0],[0,0,0],[0,0,0],[0,0,0]],vertex:[[0,0],[0,0],[0,0],[0,0]]}}var markerInfo=artoolkit["markerInfo"];markerInfo["area"]=$0;markerInfo["id"]=$1;markerInfo["idPatt"]=$2;markerInfo["idMatrix"]=$3;markerInfo["dir"]=$4;markerInfo["dirPatt"]=$5;markerInfo["dirMatrix"]=$6;markerInfo["cf"]=$7;markerInfo["cfPatt"]=$8;markerInfo["cfMatrix"]=$9;markerInfo["pos"][0]=$10;markerInfo["pos"][1]=$11;markerInfo["line"][0][0]=$a[i++];markerInfo["line"][0][1]=$a[i++];markerInfo["line"][0][2]=$a[i++];markerInfo["line"][1][0]=$a[i++];markerInfo["line"][1][1]=$a[i++];markerInfo["line"][1][2]=$a[i++];markerInfo["line"][2][0]=$a[i++];markerInfo["line"][2][1]=$a[i++];markerInfo["line"][2][2]=$a[i++];markerInfo["line"][3][0]=$a[i++];markerInfo["line"][3][1]=$a[i++];markerInfo["line"][3][2]=$a[i++];markerInfo["vertex"][0][0]=$a[i++];markerInfo["vertex"][0][1]=$a[i++];markerInfo["vertex"][1][0]=$a[i++];markerInfo["vertex"][1][1]=$a[i++];markerInfo["vertex"][2][0]=$a[i++];markerInfo["vertex"][2][1]=$a[i++];markerInfo["vertex"][3][0]=$a[i++];markerInfo["vertex"][3][1]=$a[i++];markerInfo["errorCorrected"]=$a[i++]},function($0,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13){var $a=arguments;var i=0;if(!artoolkit["NFTMarkerInfo"]){artoolkit["NFTMarkerInfo"]={id:0,error:-1,found:0,pose:[0,0,0,0,0,0,0,0,0,0,0,0]}}var markerInfo=artoolkit["NFTMarkerInfo"];markerInfo["id"]=$a[i++];markerInfo["error"]=$a[i++];markerInfo["found"]=1;markerInfo["pose"][0]=$a[i++];markerInfo["pose"][1]=$a[i++];markerInfo["pose"][2]=$a[i++];markerInfo["pose"][3]=$a[i++];markerInfo["pose"][4]=$a[i++];markerInfo["pose"][5]=$a[i++];markerInfo["pose"][6]=$a[i++];markerInfo["pose"][7]=$a[i++];markerInfo["pose"][8]=$a[i++];markerInfo["pose"][9]=$a[i++];markerInfo["pose"][10]=$a[i++];markerInfo["pose"][11]=$a[i++]},function($0){var $a=arguments;var i=0;if(!artoolkit["NFTMarkerInfo"]){artoolkit["NFTMarkerInfo"]={id:0,error:-1,found:0,pose:[0,0,0,0,0,0,0,0,0,0,0,0]}}var markerInfo=artoolkit["NFTMarkerInfo"];markerInfo["id"]=$a[i++];markerInfo["error"]=-1;markerInfo["found"]=0;markerInfo["pose"][0]=0;markerInfo["pose"][1]=0;markerInfo["pose"][2]=0;markerInfo["pose"][3]=0;markerInfo["pose"][4]=0;markerInfo["pose"][5]=0;markerInfo["pose"][6]=0;markerInfo["pose"][7]=0;markerInfo["pose"][8]=0;markerInfo["pose"][9]=0;markerInfo["pose"][10]=0;markerInfo["pose"][11]=0}];function _emscripten_asm_const_iiiiiii(code,a0,a1,a2,a3,a4,a5){return ASM_CONSTS[code](a0,a1,a2,a3,a4,a5)}function _emscripten_asm_const_iiiid(code,a0,a1,a2,a3){return ASM_CONSTS[code](a0,a1,a2,a3)}function _emscripten_asm_const_iiddddddddddddd(code,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13){return ASM_CONSTS[code](a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)}function _emscripten_asm_const_ii(code,a0){return ASM_CONSTS[code](a0)}function _emscripten_asm_const_iiiiiiiidddddddddddddddddddddddddi(code,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32){return ASM_CONSTS[code](a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32)}__ATINIT__.push({func:function(){__GLOBAL__I_000101()}},{func:function(){__GLOBAL__sub_I_ARToolKitJS_cpp()}},{func:function(){___emscripten_environ_constructor()}},{func:function(){__GLOBAL__sub_I_bind_cpp()}},{func:function(){__GLOBAL__sub_I_iostream_cpp()}});memoryInitializer="data:application/octet-stream;base64,AAAAAAAAAACKTQAAkU0AAJ1NAACnTQAAtU0AAAAAAAAAAAAAAAAAAP//////////AAAAAAEAAAABAAAAAQAAAAAAAAD/////AAAAAAEAAAABAAAAAQAAAAAAAAD///////////////8AAAABAAEBAQACBP//BQMBAAL/Bgf/AwECAgMCAwIDAwD/BAYHBf8BBAUEBAUFBAUHBgYGBwcHBv8CBAYHBQP/AAEBAQEBAQABAQEAAAEBAQEBAAEBAAEBAQABAQEBAAEBAAEBAQEAAQEBAAEBAAEBAQEBAAABAQEAAQEBAQEBAAD//wP/BQb//wkK/wz//w//ERL/FP//Fxj//xv/HR7//wEC/wT//wcI//8L/w0O/xD//xP/FRb//xka/xz//x8BAAAAAgAAAAQAAAAIAAAAEAAAAAUAAAAKAAAAFAAAAA0AAAAaAAAAEQAAAAcAAAAOAAAAHAAAAB0AAAAfAAAAGwAAABMAAAADAAAABgAAAAwAAAAYAAAAFQAAAA8AAAAeAAAAGQAAABcAAAALAAAAFgAAAAkAAAASAAAAAAAAAAEAAAACAAAABAAAAAgAAAADAAAABgAAAAwAAAALAAAABQAAAAoAAAAHAAAADgAAAA8AAAANAAAACQAAAAAAAAD/////AAAAAAEAAAASAAAAAgAAAAUAAAATAAAACwAAAAMAAAAdAAAABgAAABsAAAAUAAAACAAAAAwAAAAXAAAABAAAAAoAAAAeAAAAEQAAAAcAAAAWAAAAHAAAABoAAAAVAAAAGQAAAAkAAAAQAAAADQAAAA4AAAAYAAAADwAAAP////8AAAAAAQAAAAQAAAACAAAACAAAAAUAAAAKAAAAAwAAAA4AAAAJAAAABwAAAAYAAAANAAAACwAAAAwAAAABAAAAAgAAAAQAAAAIAAAAEAAAACAAAABAAAAAAwAAAAYAAAAMAAAAGAAAADAAAABgAAAAQwAAAAUAAAAKAAAAFAAAACgAAABQAAAAIwAAAEYAAAAPAAAAHgAAADwAAAB4AAAAcwAAAGUAAABJAAAAEQAAACIAAABEAAAACwAAABYAAAAsAAAAWAAAADMAAABmAAAATwAAAB0AAAA6AAAAdAAAAGsAAABVAAAAKQAAAFIAAAAnAAAATgAAAB8AAAA+AAAAfAAAAHsAAAB1AAAAaQAAAFEAAAAhAAAAQgAAAAcAAAAOAAAAHAAAADgAAABwAAAAYwAAAEUAAAAJAAAAEgAAACQAAABIAAAAEwAAACYAAABMAAAAGwAAADYAAABsAAAAWwAAADUAAABqAAAAVwAAAC0AAABaAAAANwAAAG4AAABfAAAAPQAAAHoAAAB3AAAAbQAAAFkAAAAxAAAAYgAAAEcAAAANAAAAGgAAADQAAABoAAAAUwAAACUAAABKAAAAFwAAAC4AAABcAAAAOwAAAHYAAABvAAAAXQAAADkAAAByAAAAZwAAAE0AAAAZAAAAMgAAAGQAAABLAAAAFQAAACoAAABUAAAAKwAAAFYAAAAvAAAAXgAAAD8AAAB+AAAAfwAAAH0AAAB5AAAAcQAAAGEAAABBAAAAAAAAAP////8AAAAAAQAAAAcAAAACAAAADgAAAAgAAAA4AAAAAwAAAD8AAAAPAAAAHwAAAAkAAABaAAAAOQAAABUAAAAEAAAAHAAAAEAAAABDAAAAEAAAAHAAAAAgAAAAYQAAAAoAAABsAAAAWwAAAEYAAAA6AAAAJgAAABYAAAAvAAAABQAAADYAAAAdAAAAEwAAAEEAAABfAAAARAAAAC0AAAARAAAAKwAAAHEAAABzAAAAIQAAAE0AAABiAAAAdQAAAAsAAABXAAAAbQAAACMAAABcAAAASgAAAEcAAABPAAAAOwAAAGgAAAAnAAAAZAAAABcAAABSAAAAMAAAAHcAAAAGAAAAfgAAADcAAAANAAAAHgAAAD4AAAAUAAAAWQAAAEIAAAAbAAAAYAAAAG8AAABFAAAAawAAAC4AAAAlAAAAEgAAADUAAAAsAAAAXgAAAHIAAAAqAAAAdAAAAEwAAAAiAAAAVgAAAE4AAABJAAAAYwAAAGcAAAB2AAAAUQAAAAwAAAB9AAAAWAAAAD0AAABuAAAAGgAAACQAAABqAAAAXQAAADQAAABLAAAAKQAAAEgAAABVAAAAUAAAAGYAAAA8AAAAfAAAAGkAAAAZAAAAKAAAADMAAABlAAAAVAAAABgAAAB7AAAAUwAAADIAAAAxAAAAegAAAHgAAAB5AAAABAAAAIgAAAAFAAAAkAAAAAYAAACYAAAACQAAALAAAAA3VAAAPVQAAEJUAABKVAAAAAAAALK+uT4S3KC+kL45PhLcoL6Qvjm+AAAAgLK+ub4S3KA+kL45vhLcoD6Qvjk+0nIYvwAAAADScpi+OgYEv9JymD46BgS/0nIYPwAAAIDScpg+OgYEP9JymL46BgQ/AAAAgFa4Pb9mTSQ/Vri9vmZNJD9WuL0+AAAAAFa4PT9mTSS/Vri9PmZNJL9WuL2+DOlYPwAAAIAM6dg+mdk7Pwzp2L6Z2Ts/DOlYvwAAAAAM6di+mdk7vwzp2D6Z2Tu/AAAAAPxTbj/xZU6/DVTuPvFlTr8NVO6+AAAAgPxTbr/xZU4/DVTuvvFlTj8NVO4+AACAvwAAAAAAAAC/0LNdvwAAAD/Qs12/AACAPwAAAIAAAAA/0LNdPwAAAL/Qs10/ADcAAAA3AAAANwAAADcAANWjAADrowAAC6QAADCkAABKpAAAaaQAAH6kAACbpAAAxaQAAAWlAAAkpQAAO6UAAFGlAABlpQAAoqUAANKlAADupQAAEaYAAEimAAB/pgAAlqYAALamAADgpgAALacAAEinAABzpwAAj6cAALSnAADapwAA/6cAABKoAAAnqAAAOqgAAE2oAAByqAAAh6gAAJuoAAC8qAAA0qgAAAGpAAApqQAASqkAAGupAACaqQAAq6kAAMepAAAFqgAALKoAAFOqAABnqgAAlaoAAL2qAADZqgAA/qoAACCrAABKqwAAdasAAJOrAADBqwAA6asAABCsAAA7rAAAaKwAAJisAADCrAAA76wAABKtAAAwrQAATq0AAIStAACurQAAza0AAPCtAAAXrgAALK4AAECuAAB1rgAAha4AAMOuAAAFrwAAL68AAFuvAACCrwAAnq8AAMmvAADkrwAA+K8AAA+wAAAcsAAARLAAAHmwAAC1sAAA47AAAASxAAArsQAARLEAAGyxAACPsQAAp7EAAMuxAADwsQAA9rEAAC+yAABpsgAAiLIAAJeyAAC0sgAA0rIAAO+yAAAIswAAIbMAAGOzAACdswAA07MAAAe0AAAbtAAAMrQAAFi0AAB/tAAAwbQAAP20AAAutQAAUrUAAIC1AACbtQAA07UAAP61AAAAAAAAAAAAAAEAAAAIAAAAEAAAAAkAAAACAAAAAwAAAAoAAAARAAAAGAAAACAAAAAZAAAAEgAAAAsAAAAEAAAABQAAAAwAAAATAAAAGgAAACEAAAAoAAAAMAAAACkAAAAiAAAAGwAAABQAAAANAAAABgAAAAcAAAAOAAAAFQAAABwAAAAjAAAAKgAAADEAAAA4AAAAOQAAADIAAAArAAAAJAAAAB0AAAAWAAAADwAAABcAAAAeAAAAJQAAACwAAAAzAAAAOgAAADsAAAA0AAAALQAAACYAAAAfAAAAJwAAAC4AAAA1AAAAPAAAAD0AAAA2AAAALwAAADcAAAA+AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAAAAAAAAQAAAAgAAAAQAAAACQAAAAIAAAADAAAACgAAABEAAAAYAAAAIAAAABkAAAASAAAACwAAAAQAAAAFAAAADAAAABMAAAAaAAAAIQAAACgAAAAwAAAAKQAAACIAAAAbAAAAFAAAAA0AAAAGAAAADgAAABUAAAAcAAAAIwAAACoAAAAxAAAAMgAAACsAAAAkAAAAHQAAABYAAAAeAAAAJQAAACwAAAAzAAAANAAAAC0AAAAmAAAALgAAADUAAAA2AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAAAAAAAAAAAAAAAAAAAAAAABAAAACAAAABAAAAAJAAAAAgAAAAMAAAAKAAAAEQAAABgAAAAgAAAAGQAAABIAAAALAAAABAAAAAUAAAAMAAAAEwAAABoAAAAhAAAAKAAAACkAAAAiAAAAGwAAABQAAAANAAAAFQAAABwAAAAjAAAAKgAAACsAAAAkAAAAHQAAACUAAAAsAAAALQAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAAAAAAAAQAAAAgAAAAQAAAACQAAAAIAAAADAAAACgAAABEAAAAYAAAAIAAAABkAAAASAAAACwAAAAQAAAAMAAAAEwAAABoAAAAhAAAAIgAAABsAAAAUAAAAHAAAACMAAAAkAAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAAAAAAAAAAAAAAAAAAAAAAABAAAACAAAABAAAAAJAAAAAgAAAAMAAAAKAAAAEQAAABgAAAAZAAAAEgAAAAsAAAATAAAAGgAAABsAAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAAAAAAAEAAAAIAAAAEAAAAAkAAAACAAAACgAAABEAAAASAAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAAAAAAAAAAAAAAAAAAAAAAABAAAACAAAAAkAAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAgQEdWg4ChiUQAxQREgQLCBQF2AMXBtoBGQflABwIbwAeCTYAIQoaACMLDQAJDAYACg0DAAwNAQCPD39aJBAlPyYR8iwnEnwgKBO5FyoUghErFe8MLRahCS4XLwcwGFwFMRkGBDMaAwM0G0ACNhyxATgdRAE5HvUAOx+3ADwgigA+IWgAPyJOACAjOwAhCSwApSXhWkAmTEhBJw06QyjxLkQpHyZFKjMfRiuoGUgsGBVJLXcRSi50Dksv+wtNMPgJTjFhCE8yBgcwM80FMjTeBDI1DwQzNmMDNDfUAjU4XAI2OfgBNzqkATg7YAE5PCUBOj32ADs+ywA9P6sAPSCPAMFBEltQQgRNUUMsQVJE2DdTRegvVEY8KVZHeSNXSN8eV0mpGkhKThdISyQUSkycEUpNaw9LTlENTU+2C00wQArQUTJYWFIcTVlTjkNaVN07W1XuNFxWri5dV5opVkcWJdhZcFVfWqlMYFvZRGFcIj5jXSQ4Y160Ml1WFy7fYKhWZWFGT2Zi5UdnY89BaGQ9PGNdXjdpZjFSamcPTGtoOUZnY15B6WonVmxr51BtZ4VLbm2XVW9rT1DubxBacG0iVfBv61lxcR1aAAAAAAAAAAAAAAAAAQAAAAIAAAADAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAAGAAAAAwAAAAcAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAABgAAAAIAAAAEAAAABwAAAAwAAAADAAAACAAAAAsAAAANAAAACQAAAAoAAAAOAAAADwAAAAAAAAABAAAABQAAAAYAAAAOAAAAAgAAAAQAAAAHAAAADQAAAA8AAAADAAAACAAAAAwAAAAQAAAAFQAAAAkAAAALAAAAEQAAABQAAAAWAAAACgAAABIAAAATAAAAFwAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAUAAAAGAAAADgAAAA8AAAACAAAABAAAAAcAAAANAAAAEAAAABkAAAADAAAACAAAAAwAAAARAAAAGAAAABoAAAAJAAAACwAAABIAAAAXAAAAGwAAACAAAAAKAAAAEwAAABYAAAAcAAAAHwAAACEAAAAUAAAAFQAAAB0AAAAeAAAAIgAAACMAAAAAAAAAAQAAAAUAAAAGAAAADgAAAA8AAAAbAAAAAgAAAAQAAAAHAAAADQAAABAAAAAaAAAAHAAAAAMAAAAIAAAADAAAABEAAAAZAAAAHQAAACYAAAAJAAAACwAAABIAAAAYAAAAHgAAACUAAAAnAAAACgAAABMAAAAXAAAAHwAAACQAAAAoAAAALQAAABQAAAAWAAAAIAAAACMAAAApAAAALAAAAC4AAAAVAAAAIQAAACIAAAAqAAAAKwAAAC8AAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAABgAAAA4AAAAPAAAAGwAAABwAAAACAAAABAAAAAcAAAANAAAAEAAAABoAAAAdAAAAKgAAAAMAAAAIAAAADAAAABEAAAAZAAAAHgAAACkAAAArAAAACQAAAAsAAAASAAAAGAAAAB8AAAAoAAAALAAAADUAAAAKAAAAEwAAABcAAAAgAAAAJwAAAC0AAAA0AAAANgAAABQAAAAWAAAAIQAAACYAAAAuAAAAMwAAADcAAAA8AAAAFQAAACIAAAAlAAAALwAAADIAAAA4AAAAOwAAAD0AAAAjAAAAJAAAADAAAAAxAAAAOQAAADoAAAA+AAAAPwAAAAAAAAABAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAAAQMVYn1NCSwBASTKjIqgRxVghe/xzYmjFWL9FCzB+GJ9T/HNBbVRin1OzQUEtEhdCS2JoVGJ+WEJLITu6KMMUAEDFWJ9TQksAQEkyoyKoEUkyv0WzQSE7STKCJzcb4A2jIgswQS26KKMiNxu/Eo4JqBF+GBIXwxSoEeANjgnfBAAAAAAAAPA/72FIsVAx9j/Kb02Rruf0P6oRbO9i0PI/AAAAAAAA8D87v6fAaSTpP7sgx3t6UeE/Xaty3lWo0T8AwDDwDMw8/APDM/MPzz//gECwcIxMvHyDQ7Nzj0+/fyDgENAs7BzcI+MT0y/vH9+gYJBQrGycXKNjk1Ovb59fCMg4+ATENPQLyzv7B8c394hIuHiERLR0i0u7e4dHt3co6BjYJOQU1CvrG9sn5xfXqGiYWKRklFSra5tbp2eXVwLCMvIOzj7+AcEx8Q3NPf2CQrJyjk6+foFBsXGNTb19IuIS0i7uHt4h4RHRLe0d3aJiklKubp5eoWGRUa1tnV0Kyjr6BsY29gnJOfkFxTX1ikq6eoZGtnaJSbl5hUW1dSrqGtom5hbWKekZ2SXlFdWqappapmaWVqlpmVmlZZVV3hIElQAAAAD///////////////8AAAAAAAAAAAAAAAACAADAAwAAwAQAAMAFAADABgAAwAcAAMAIAADACQAAwAoAAMALAADADAAAwA0AAMAOAADADwAAwBAAAMARAADAEgAAwBMAAMAUAADAFQAAwBYAAMAXAADAGAAAwBkAAMAaAADAGwAAwBwAAMAdAADAHgAAwB8AAMAAAACzAQAAwwIAAMMDAADDBAAAwwUAAMMGAADDBwAAwwgAAMMJAADDCgAAwwsAAMMMAADDDQAA0w4AAMMPAADDAAAMuwEADMMCAAzDAwAMwwQADNMAAAAA/////////////////////////////////////////////////////////////////wABAgMEBQYHCAn/////////CgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiP///////8KCwwNDg8QERITFBUWFxgZGhscHR4fICEiI/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAARAAoAERERAAAAAAUAAAAAAAAJAAAAAAsAAAAAAAAAABEADwoREREDCgcAARMJCwsAAAkGCwAACwAGEQAAABEREQAAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAARAAoKERERAAoAAAIACQsAAAAJAAsAAAsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAMAAAAAAkMAAAAAAAMAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAA0AAAAEDQAAAAAJDgAAAAAADgAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAPAAAAAA8AAAAACRAAAAAAABAAABAAABIAAAASEhIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAABISEgAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAAoAAAAACgAAAAAJCwAAAAAACwAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAwAAAAACQwAAAAAAAwAAAwAADAxMjM0NTY3ODlBQkNERUYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgACAAIAAgACAAIAAgACAAIAAyACIAIgAiACIAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAFgBMAEwATABMAEwATABMAEwATABMAEwATABMAEwATACNgI2AjYCNgI2AjYCNgI2AjYCNgEwATABMAEwATABMAEwAjVCNUI1QjVCNUI1QjFCMUIxQjFCMUIxQjFCMUIxQjFCMUIxQjFCMUIxQjFCMUIxQjFCMUEwATABMAEwATABMAI1gjWCNYI1gjWCNYIxgjGCMYIxgjGCMYIxgjGCMYIxgjGCMYIxgjGCMYIxgjGCMYIxgjGBMAEwATABMACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACQAAAAlAAAAJgAAACcAAAAoAAAAKQAAACoAAAArAAAALAAAAC0AAAAuAAAALwAAADAAAAAxAAAAMgAAADMAAAA0AAAANQAAADYAAAA3AAAAOAAAADkAAAA6AAAAOwAAADwAAAA9AAAAPgAAAD8AAABAAAAAYQAAAGIAAABjAAAAZAAAAGUAAABmAAAAZwAAAGgAAABpAAAAagAAAGsAAABsAAAAbQAAAG4AAABvAAAAcAAAAHEAAAByAAAAcwAAAHQAAAB1AAAAdgAAAHcAAAB4AAAAeQAAAHoAAABbAAAAXAAAAF0AAABeAAAAXwAAAGAAAABhAAAAYgAAAGMAAABkAAAAZQAAAGYAAABnAAAAaAAAAGkAAABqAAAAawAAAGwAAABtAAAAbgAAAG8AAABwAAAAcQAAAHIAAABzAAAAdAAAAHUAAAB2AAAAdwAAAHgAAAB5AAAAegAAAHsAAAB8AAAAfQAAAH4AAAB/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACQAAAAlAAAAJgAAACcAAAAoAAAAKQAAACoAAAArAAAALAAAAC0AAAAuAAAALwAAADAAAAAxAAAAMgAAADMAAAA0AAAANQAAADYAAAA3AAAAOAAAADkAAAA6AAAAOwAAADwAAAA9AAAAPgAAAD8AAABAAAAAQQAAAEIAAABDAAAARAAAAEUAAABGAAAARwAAAEgAAABJAAAASgAAAEsAAABMAAAATQAAAE4AAABPAAAAUAAAAFEAAABSAAAAUwAAAFQAAABVAAAAVgAAAFcAAABYAAAAWQAAAFoAAABbAAAAXAAAAF0AAABeAAAAXwAAAGAAAABBAAAAQgAAAEMAAABEAAAARQAAAEYAAABHAAAASAAAAEkAAABKAAAASwAAAEwAAABNAAAATgAAAE8AAABQAAAAUQAAAFIAAABTAAAAVAAAAFUAAABWAAAAVwAAAFgAAABZAAAAWgAAAHsAAAB8AAAAfQAAAH4AAAB/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZEkQ7Aj8sRxQ9MzAKGwZGS0U3D0kOjhcDQB08aSs2H0otHAEgJSkhCAwVFiIuEDg+CzQxGGR0dXYvQQl/OREjQzJCiYqLBQQmKCcNKh41jAcaSJMTlJUAAAAAAAAAAABJbGxlZ2FsIGJ5dGUgc2VxdWVuY2UARG9tYWluIGVycm9yAFJlc3VsdCBub3QgcmVwcmVzZW50YWJsZQBOb3QgYSB0dHkAUGVybWlzc2lvbiBkZW5pZWQAT3BlcmF0aW9uIG5vdCBwZXJtaXR0ZWQATm8gc3VjaCBmaWxlIG9yIGRpcmVjdG9yeQBObyBzdWNoIHByb2Nlc3MARmlsZSBleGlzdHMAVmFsdWUgdG9vIGxhcmdlIGZvciBkYXRhIHR5cGUATm8gc3BhY2UgbGVmdCBvbiBkZXZpY2UAT3V0IG9mIG1lbW9yeQBSZXNvdXJjZSBidXN5AEludGVycnVwdGVkIHN5c3RlbSBjYWxsAFJlc291cmNlIHRlbXBvcmFyaWx5IHVuYXZhaWxhYmxlAEludmFsaWQgc2VlawBDcm9zcy1kZXZpY2UgbGluawBSZWFkLW9ubHkgZmlsZSBzeXN0ZW0ARGlyZWN0b3J5IG5vdCBlbXB0eQBDb25uZWN0aW9uIHJlc2V0IGJ5IHBlZXIAT3BlcmF0aW9uIHRpbWVkIG91dABDb25uZWN0aW9uIHJlZnVzZWQASG9zdCBpcyBkb3duAEhvc3QgaXMgdW5yZWFjaGFibGUAQWRkcmVzcyBpbiB1c2UAQnJva2VuIHBpcGUASS9PIGVycm9yAE5vIHN1Y2ggZGV2aWNlIG9yIGFkZHJlc3MAQmxvY2sgZGV2aWNlIHJlcXVpcmVkAE5vIHN1Y2ggZGV2aWNlAE5vdCBhIGRpcmVjdG9yeQBJcyBhIGRpcmVjdG9yeQBUZXh0IGZpbGUgYnVzeQBFeGVjIGZvcm1hdCBlcnJvcgBJbnZhbGlkIGFyZ3VtZW50AEFyZ3VtZW50IGxpc3QgdG9vIGxvbmcAU3ltYm9saWMgbGluayBsb29wAEZpbGVuYW1lIHRvbyBsb25nAFRvbyBtYW55IG9wZW4gZmlsZXMgaW4gc3lzdGVtAE5vIGZpbGUgZGVzY3JpcHRvcnMgYXZhaWxhYmxlAEJhZCBmaWxlIGRlc2NyaXB0b3IATm8gY2hpbGQgcHJvY2VzcwBCYWQgYWRkcmVzcwBGaWxlIHRvbyBsYXJnZQBUb28gbWFueSBsaW5rcwBObyBsb2NrcyBhdmFpbGFibGUAUmVzb3VyY2UgZGVhZGxvY2sgd291bGQgb2NjdXIAU3RhdGUgbm90IHJlY292ZXJhYmxlAFByZXZpb3VzIG93bmVyIGRpZWQAT3BlcmF0aW9uIGNhbmNlbGVkAEZ1bmN0aW9uIG5vdCBpbXBsZW1lbnRlZABObyBtZXNzYWdlIG9mIGRlc2lyZWQgdHlwZQBJZGVudGlmaWVyIHJlbW92ZWQARGV2aWNlIG5vdCBhIHN0cmVhbQBObyBkYXRhIGF2YWlsYWJsZQBEZXZpY2UgdGltZW91dABPdXQgb2Ygc3RyZWFtcyByZXNvdXJjZXMATGluayBoYXMgYmVlbiBzZXZlcmVkAFByb3RvY29sIGVycm9yAEJhZCBtZXNzYWdlAEZpbGUgZGVzY3JpcHRvciBpbiBiYWQgc3RhdGUATm90IGEgc29ja2V0AERlc3RpbmF0aW9uIGFkZHJlc3MgcmVxdWlyZWQATWVzc2FnZSB0b28gbGFyZ2UAUHJvdG9jb2wgd3JvbmcgdHlwZSBmb3Igc29ja2V0AFByb3RvY29sIG5vdCBhdmFpbGFibGUAUHJvdG9jb2wgbm90IHN1cHBvcnRlZABTb2NrZXQgdHlwZSBub3Qgc3VwcG9ydGVkAE5vdCBzdXBwb3J0ZWQAUHJvdG9jb2wgZmFtaWx5IG5vdCBzdXBwb3J0ZWQAQWRkcmVzcyBmYW1pbHkgbm90IHN1cHBvcnRlZCBieSBwcm90b2NvbABBZGRyZXNzIG5vdCBhdmFpbGFibGUATmV0d29yayBpcyBkb3duAE5ldHdvcmsgdW5yZWFjaGFibGUAQ29ubmVjdGlvbiByZXNldCBieSBuZXR3b3JrAENvbm5lY3Rpb24gYWJvcnRlZABObyBidWZmZXIgc3BhY2UgYXZhaWxhYmxlAFNvY2tldCBpcyBjb25uZWN0ZWQAU29ja2V0IG5vdCBjb25uZWN0ZWQAQ2Fubm90IHNlbmQgYWZ0ZXIgc29ja2V0IHNodXRkb3duAE9wZXJhdGlvbiBhbHJlYWR5IGluIHByb2dyZXNzAE9wZXJhdGlvbiBpbiBwcm9ncmVzcwBTdGFsZSBmaWxlIGhhbmRsZQBSZW1vdGUgSS9PIGVycm9yAFF1b3RhIGV4Y2VlZGVkAE5vIG1lZGl1bSBmb3VuZABXcm9uZyBtZWRpdW0gdHlwZQBObyBlcnJvciBpbmZvcm1hdGlvbgAAAAAAAAoAAABkAAAA6AMAABAnAACghgEAQEIPAICWmAAA4fUFTENfQ1RZUEUAAAAATENfTlVNRVJJQwAATENfVElNRQAAAAAATENfQ09MTEFURQAATENfTU9ORVRBUlkATENfTUVTU0FHRVMAAAAAAAAAAAAAAAAAAgAAAAMAAAAFAAAABwAAAAsAAAANAAAAEQAAABMAAAAXAAAAHQAAAB8AAAAlAAAAKQAAACsAAAAvAAAANQAAADsAAAA9AAAAQwAAAEcAAABJAAAATwAAAFMAAABZAAAAYQAAAGUAAABnAAAAawAAAG0AAABxAAAAfwAAAIMAAACJAAAAiwAAAJUAAACXAAAAnQAAAKMAAACnAAAArQAAALMAAAC1AAAAvwAAAMEAAADFAAAAxwAAANMAAAABAAAACwAAAA0AAAARAAAAEwAAABcAAAAdAAAAHwAAACUAAAApAAAAKwAAAC8AAAA1AAAAOwAAAD0AAABDAAAARwAAAEkAAABPAAAAUwAAAFkAAABhAAAAZQAAAGcAAABrAAAAbQAAAHEAAAB5AAAAfwAAAIMAAACJAAAAiwAAAI8AAACVAAAAlwAAAJ0AAACjAAAApwAAAKkAAACtAAAAswAAALUAAAC7AAAAvwAAAMEAAADFAAAAxwAAANEAAAAwMTIzNDU2Nzg5YWJjZGVmQUJDREVGeFgrLXBQaUluTgAAAAAAAAAAAAAAAAAAAAAlAAAAbQAAAC8AAAAlAAAAZAAAAC8AAAAlAAAAeQAAACUAAABZAAAALQAAACUAAABtAAAALQAAACUAAABkAAAAJQAAAEkAAAA6AAAAJQAAAE0AAAA6AAAAJQAAAFMAAAAgAAAAJQAAAHAAAAAAAAAAJQAAAEgAAAA6AAAAJQAAAE0AAAAAAAAAAAAAAAAAAAAlAAAASAAAADoAAAAlAAAATQAAADoAAAAlAAAAUwAAACUAAABIAAAAOgAAACUAAABNAAAAOgAAACUAAABTAAAApD8AABVdAADMPwAAiWkAAIAzAAAAAAAAzD8AAHRsAAA4NgAAAAAAAMw/AAAjdwAAGD0AAAAAAADMPwAAi4cAABg9AAAAAAAAzD8AAP+HAAAYPQAAAAAAADhAAADlngAAAAAAAAEAAADwMwAAAAAAAKQ/AAAknwAABQAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAABG4QAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAA//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAIyQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAIAAAAYzQAAAAQAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACv////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApD8AAEe3AADMPwAAp7cAAFA2AAAAAAAAzD8AAFS3AABgNgAAAAAAAKQ/AAB1twAAzD8AAIK3AABANgAAAAAAAMw/AADxtwAAODYAAAAAAADMPwAAAbgAAHg2AAAAAAAAzD8AABK4AABQNgAAAAAAAMw/AAA0uAAAmDYAAAAAAADMPwAAWLgAAFA2AAAAAAAAHEAAAIC4AAAcQAAAgrgAABxAAACEuAAAHEAAAIa4AAAcQAAAiLgAABxAAACKuAAAHEAAAIy4AAAcQAAAjrgAABxAAACQuAAAHEAAAA3BAAAcQAAAkrgAABxAAACUuAAAHEAAAJa4AADMPwAAmLgAAEA2AAAAAAAApD8AANu7AACkPwAA+rsAAKQ/AAAZvAAApD8AADi8AACkPwAAV7wAAKQ/AAB2vAAApD8AAJW8AACkPwAAtLwAAKQ/AADTvAAApD8AAPK8AACkPwAAEb0AAKQ/AAAwvQAApD8AAE+9AAA4QAAAYr0AAAAAAAABAAAA8DMAAAAAAAA4QAAAob0AAAAAAAABAAAA8DMAAAAAAADMPwAA8r0AAOg3AAAAAAAApD8AAOC9AADMPwAAHL4AAOg3AAAAAAAApD8AAEa+AACkPwAAd74AADhAAACovgAAAAAAAAEAAADYNwAAA/T//zhAAADXvgAAAAAAAAEAAADwNwAAA/T//zhAAAAGvwAAAAAAAAEAAADYNwAAA/T//zhAAAA1vwAAAAAAAAEAAADwNwAAA/T//8w/AABkvwAACDgAAAAAAADMPwAAfb8AAAA4AAAAAAAAzD8AALy/AAAIOAAAAAAAAMw/AADUvwAAADgAAAAAAADMPwAA7L8AAMA4AAAAAAAAzD8AAADAAAAQPQAAAAAAAMw/AAAWwAAAwDgAAAAAAAA4QAAAL8AAAAAAAAACAAAAwDgAAAIAAAAAOQAAAAAAADhAAABzwAAAAAAAAAEAAAAYOQAAAAAAAKQ/AACJwAAAOEAAAKLAAAAAAAAAAgAAAMA4AAACAAAAQDkAAAAAAAA4QAAA5sAAAAAAAAABAAAAGDkAAAAAAAA4QAAAD8EAAAAAAAACAAAAwDgAAAIAAAB4OQAAAAAAADhAAABTwQAAAAAAAAEAAACQOQAAAAAAAKQ/AABpwQAAOEAAAILBAAAAAAAAAgAAAMA4AAACAAAAuDkAAAAAAAA4QAAAxsEAAAAAAAABAAAAkDkAAAAAAAA4QAAAHMMAAAAAAAADAAAAwDgAAAIAAAD4OQAAAgAAAAA6AAAACAAApD8AAIPDAACkPwAAYcMAADhAAACWwwAAAAAAAAMAAADAOAAAAgAAAPg5AAACAAAAMDoAAAAIAACkPwAA28MAADhAAAD9wwAAAAAAAAIAAADAOAAAAgAAAFg6AAAACAAApD8AAELEAAA4QAAAV8QAAAAAAAACAAAAwDgAAAIAAABYOgAAAAgAADhAAACcxAAAAAAAAAIAAADAOAAAAgAAAKA6AAACAAAApD8AALjEAAA4QAAAzcQAAAAAAAACAAAAwDgAAAIAAACgOgAAAgAAADhAAADpxAAAAAAAAAIAAADAOAAAAgAAAKA6AAACAAAAOEAAAAXFAAAAAAAAAgAAAMA4AAACAAAAoDoAAAIAAAA4QAAAMMUAAAAAAAACAAAAwDgAAAIAAAAoOwAAAAAAAKQ/AAB2xQAAOEAAAJrFAAAAAAAAAgAAAMA4AAACAAAAUDsAAAAAAACkPwAA4MUAADhAAAD/xQAAAAAAAAIAAADAOAAAAgAAAHg7AAAAAAAApD8AAEXGAAA4QAAAXsYAAAAAAAACAAAAwDgAAAIAAACgOwAAAAAAAKQ/AACkxgAAOEAAAL3GAAAAAAAAAgAAAMA4AAACAAAAyDsAAAIAAACkPwAA0sYAADhAAABpxwAAAAAAAAIAAADAOAAAAgAAAMg7AAACAAAAzD8AAOrGAAAAPAAAAAAAADhAAAANxwAAAAAAAAIAAADAOAAAAgAAACA8AAACAAAApD8AADDHAADMPwAAR8cAAAA8AAAAAAAAOEAAAH7HAAAAAAAAAgAAAMA4AAACAAAAIDwAAAIAAAA4QAAAoMcAAAAAAAACAAAAwDgAAAIAAAAgPAAAAgAAADhAAADCxwAAAAAAAAIAAADAOAAAAgAAACA8AAACAAAAzD8AAOXHAADAOAAAAAAAADhAAAD7xwAAAAAAAAIAAADAOAAAAgAAAMg8AAACAAAApD8AAA3IAAA4QAAAIsgAAAAAAAACAAAAwDgAAAIAAADIPAAAAgAAAMw/AAA/yAAAwDgAAAAAAADMPwAAVMgAAMA4AAAAAAAApD8AAGnIAAA4QAAAgsgAAAAAAAABAAAAED0AAAAAAAABAAAAAAAAAIgzAAABAAAAAgAAAAAAAACAMwAAAwAAAAQAAAAAAAAAmDMAAAUAAAAGAAAAAQAAALlSjD6OWuc+uVKMPgAAAACoMwAABwAAAAgAAAAJAAAAAQAAAAoAAAAAAAAAuDMAAAcAAAALAAAADAAAAAIAAAANAAAAAAAAAMgzAAAHAAAADgAAAA8AAAADAAAAEAAAAP/////+/////f///8g2AAAANwAAIDcAAMg2AAAANwAAADcAACg3AAAANwAAyDYAAAA3AAAoNwAAADcAAMg2AAAANwAAADcAANgzAAAANwAAADcAAAA3AAAANwAAADcAANgzAAAANwAAADcAAAEAAAAAAAAAAgAAAEAGAACAPgAAAAAAAIgTAABAFgAAFAAAAEMuVVRGLTgAAAAAAAAAAAAAAAAAUD4AAAAAAAAAAAAAAAAAAAAAAAAAAAAA+DMAAIg0AAAYNQAAGDUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFNkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgGwAAIB8AACAlAABfcIkA/wkvDwAAAABANgAAEQAAABIAAAATAAAAFAAAAAQAAAABAAAAAQAAAAEAAAAAAAAAaDYAABEAAAAVAAAAEwAAABQAAAAEAAAAAgAAAAIAAAACAAAAAAAAAHg2AAAWAAAAFwAAAAQAAAAAAAAAiDYAABYAAAAYAAAABAAAAAAAAAC4NgAAEQAAABkAAAATAAAAFAAAAAUAAAAAAAAAMDcAABEAAAAaAAAAEwAAABQAAAAEAAAAAwAAAAMAAAADAAAAAAAAAOg3AAAbAAAAHAAAAAAAAAAAOAAAHQAAAB4AAAABAAAABgAAAAQAAAAEAAAABQAAAAYAAAAHAAAABwAAAAgAAAAEAAAACAAAAAUAAAAAAAAACDgAAB8AAAAgAAAAAgAAAAkAAAAFAAAABQAAAAkAAAAKAAAACgAAAAsAAAAMAAAABgAAAAsAAAAHAAAACAAAAAAAAAAQOAAAIQAAACIAAAD4////+P///xA4AAAjAAAAJAAAAPRAAAAIQQAACAAAAAAAAAAoOAAAJQAAACYAAAD4////+P///yg4AAAnAAAAKAAAACRBAAA4QQAABAAAAAAAAABAOAAAKQAAACoAAAD8/////P///0A4AAArAAAALAAAAFRBAABoQQAABAAAAAAAAABYOAAALQAAAC4AAAD8/////P///1g4AAAvAAAAMAAAAIRBAACYQQAAAAAAAHA4AAAfAAAAMQAAAAMAAAAJAAAABQAAAAUAAAANAAAACgAAAAoAAAALAAAADAAAAAYAAAAMAAAACAAAAAAAAACAOAAAHQAAADIAAAAEAAAABgAAAAQAAAAEAAAADgAAAAYAAAAHAAAABwAAAAgAAAAEAAAADQAAAAkAAAAAAAAAkDgAAB8AAAAzAAAABQAAAAkAAAAFAAAABQAAAAkAAAAKAAAACgAAAA8AAAAQAAAACgAAAAsAAAAHAAAAAAAAAKA4AAAdAAAANAAAAAYAAAAGAAAABAAAAAQAAAAFAAAABgAAAAcAAAARAAAAEgAAAAsAAAAIAAAABQAAAAAAAACwOAAANQAAADYAAAA3AAAAAQAAAAYAAAAOAAAAAAAAANA4AAA4AAAAOQAAADcAAAACAAAABwAAAA8AAAAAAAAA4DgAADoAAAA7AAAANwAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAAAAAAACA5AAA8AAAAPQAAADcAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAAAAAAABYOQAAPgAAAD8AAAA3AAAAAwAAAAQAAAAXAAAABQAAABgAAAABAAAAAgAAAAYAAAAAAAAAmDkAAEAAAABBAAAANwAAAAcAAAAIAAAAGQAAAAkAAAAaAAAAAwAAAAQAAAAKAAAAAAAAANA5AABCAAAAQwAAADcAAAATAAAAGwAAABwAAAAdAAAAHgAAAB8AAAABAAAA+P///9A5AAAUAAAAFQAAABYAAAAXAAAAGAAAABkAAAAaAAAAAAAAAAg6AABEAAAARQAAADcAAAAbAAAAIAAAACEAAAAiAAAAIwAAACQAAAACAAAA+P///wg6AAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAJQAAAEgAAAA6AAAAJQAAAE0AAAA6AAAAJQAAAFMAAAAAAAAAJQAAAG0AAAAvAAAAJQAAAGQAAAAvAAAAJQAAAHkAAAAAAAAAJQAAAEkAAAA6AAAAJQAAAE0AAAA6AAAAJQAAAFMAAAAgAAAAJQAAAHAAAAAAAAAAJQAAAGEAAAAgAAAAJQAAAGIAAAAgAAAAJQAAAGQAAAAgAAAAJQAAAEgAAAA6AAAAJQAAAE0AAAA6AAAAJQAAAFMAAAAgAAAAJQAAAFkAAAAAAAAAQQAAAE0AAAAAAAAAUAAAAE0AAAAAAAAASgAAAGEAAABuAAAAdQAAAGEAAAByAAAAeQAAAAAAAABGAAAAZQAAAGIAAAByAAAAdQAAAGEAAAByAAAAeQAAAAAAAABNAAAAYQAAAHIAAABjAAAAaAAAAAAAAABBAAAAcAAAAHIAAABpAAAAbAAAAAAAAABNAAAAYQAAAHkAAAAAAAAASgAAAHUAAABuAAAAZQAAAAAAAABKAAAAdQAAAGwAAAB5AAAAAAAAAEEAAAB1AAAAZwAAAHUAAABzAAAAdAAAAAAAAABTAAAAZQAAAHAAAAB0AAAAZQAAAG0AAABiAAAAZQAAAHIAAAAAAAAATwAAAGMAAAB0AAAAbwAAAGIAAABlAAAAcgAAAAAAAABOAAAAbwAAAHYAAABlAAAAbQAAAGIAAABlAAAAcgAAAAAAAABEAAAAZQAAAGMAAABlAAAAbQAAAGIAAABlAAAAcgAAAAAAAABKAAAAYQAAAG4AAAAAAAAARgAAAGUAAABiAAAAAAAAAE0AAABhAAAAcgAAAAAAAABBAAAAcAAAAHIAAAAAAAAASgAAAHUAAABuAAAAAAAAAEoAAAB1AAAAbAAAAAAAAABBAAAAdQAAAGcAAAAAAAAAUwAAAGUAAABwAAAAAAAAAE8AAABjAAAAdAAAAAAAAABOAAAAbwAAAHYAAAAAAAAARAAAAGUAAABjAAAAAAAAAFMAAAB1AAAAbgAAAGQAAABhAAAAeQAAAAAAAABNAAAAbwAAAG4AAABkAAAAYQAAAHkAAAAAAAAAVAAAAHUAAABlAAAAcwAAAGQAAABhAAAAeQAAAAAAAABXAAAAZQAAAGQAAABuAAAAZQAAAHMAAABkAAAAYQAAAHkAAAAAAAAAVAAAAGgAAAB1AAAAcgAAAHMAAABkAAAAYQAAAHkAAAAAAAAARgAAAHIAAABpAAAAZAAAAGEAAAB5AAAAAAAAAFMAAABhAAAAdAAAAHUAAAByAAAAZAAAAGEAAAB5AAAAAAAAAFMAAAB1AAAAbgAAAAAAAABNAAAAbwAAAG4AAAAAAAAAVAAAAHUAAABlAAAAAAAAAFcAAABlAAAAZAAAAAAAAABUAAAAaAAAAHUAAAAAAAAARgAAAHIAAABpAAAAAAAAAFMAAABhAAAAdAAAAAAAAAAAAAAAODoAAEYAAABHAAAANwAAAAEAAAAAAAAAYDoAAEgAAABJAAAANwAAAAIAAAAAAAAAgDoAAEoAAABLAAAANwAAACMAAAAkAAAABwAAAAgAAAAJAAAACgAAACUAAAALAAAADAAAAAAAAACoOgAATAAAAE0AAAA3AAAAJgAAACcAAAANAAAADgAAAA8AAAAQAAAAKAAAABEAAAASAAAAAAAAAMg6AABOAAAATwAAADcAAAApAAAAKgAAABMAAAAUAAAAFQAAABYAAAArAAAAFwAAABgAAAAAAAAA6DoAAFAAAABRAAAANwAAACwAAAAtAAAAGQAAABoAAAAbAAAAHAAAAC4AAAAdAAAAHgAAAAAAAAAIOwAAUgAAAFMAAAA3AAAAAwAAAAQAAAAAAAAAMDsAAFQAAABVAAAANwAAAAUAAAAGAAAAAAAAAFg7AABWAAAAVwAAADcAAAABAAAAJQAAAAAAAACAOwAAWAAAAFkAAAA3AAAAAgAAACYAAAAAAAAAqDsAAFoAAABbAAAANwAAABAAAAAGAAAAHwAAAAAAAADQOwAAXAAAAF0AAAA3AAAAEQAAAAcAAAAgAAAAAAAAACg8AABeAAAAXwAAADcAAAADAAAABAAAAAsAAAAvAAAAMAAAAAwAAAAxAAAAAAAAAPA7AABeAAAAYAAAADcAAAADAAAABAAAAAsAAAAvAAAAMAAAAAwAAAAxAAAAAAAAAFg8AABhAAAAYgAAADcAAAAFAAAABgAAAA0AAAAyAAAAMwAAAA4AAAA0AAAAAAAAAJg8AABjAAAAZAAAADcAAAAAAAAAqDwAAGUAAABmAAAANwAAAAwAAAASAAAADQAAABMAAAAOAAAAAwAAABQAAAAPAAAAAAAAAPA8AABnAAAAaAAAADcAAAA1AAAANgAAACEAAAAiAAAAIwAAAAAAAAAAPQAAaQAAAGoAAAA3AAAANwAAADgAAAAkAAAAJQAAACYAAABmAAAAYQAAAGwAAABzAAAAZQAAAAAAAAB0AAAAcgAAAHUAAABlAAAAAAAAAAAAAADAOAAAXgAAAGsAAAA3AAAAAAAAANA8AABeAAAAbAAAADcAAAAVAAAABAAAAAUAAAAGAAAADwAAABYAAAAQAAAAFwAAABEAAAAHAAAAGAAAABAAAAAAAAAAODwAAF4AAABtAAAANwAAAAcAAAAIAAAAEQAAADkAAAA6AAAAEgAAADsAAAAAAAAAeDwAAF4AAABuAAAANwAAAAkAAAAKAAAAEwAAADwAAAA9AAAAFAAAAD4AAAAAAAAAADwAAF4AAABvAAAANwAAAAMAAAAEAAAACwAAAC8AAAAwAAAADAAAADEAAAAAAAAAADoAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAAAAAAMDoAABwAAAAdAAAAHgAAAB8AAAAgAAAAIQAAACIAAABFcnJvcjogbGFiZWxpbmcgd29yayBvdmVyZmxvdy4KAFVua25vd24gb3IgdW5zdXBwb3J0ZWQgbGFiZWxpbmcgdGhyZXNob2xkIG1vZGUgcmVxdWVzdGVkLiBTZXQgdG8gbWFudWFsLgoATGFiZWxpbmcgdGhyZXNob2xkIG1vZGUgc2V0IHRvICVzLgoATUFOVUFMAEFVVE9fTUVESUFOAEFVVE9fT1RTVQBBVVRPX0FEQVBUSVZFAEFVVE9fQlJBQ0tFVElORwBFcnJvcjogVW5zdXBwb3J0ZWQgcGl4ZWwgZm9ybWF0ICglZCkgcmVxdWVzdGVkLgoAQXV0byB0aHJlc2hvbGQgKGJyYWNrZXQpIG1hcmtlciBjb3VudHMgLVslM2Q6ICUzZF0gWyUzZDogJTNkXSBbJTNkOiAlM2RdKy4KAEF1dG8gdGhyZXNob2xkIChicmFja2V0KSBhZGp1c3RlZCB0aHJlc2hvbGQgdG8gJWQuCgBtZWRpYW4AT3RzdQBBdXRvIHRocmVzaG9sZCAoJXMpIGFkanVzdGVkIHRocmVzaG9sZCB0byAlZC4KAD8/PyAxCgA/Pz8gMgoAPz8/IDMKAEVycm9yOiB1bnN1cHBvcnRlZCBwaXhlbCBmb3JtYXQuCgBFcnJvcjogTlVMTCBwYXR0SGFuZGxlLgoARXJyb3I6IGNhbid0IGxvYWQgcGF0dGVybiBmcm9tIE5VTEwgYnVmZmVyLgoARXJyb3I6IG91dCBvZiBtZW1vcnkuCgAgCQoNAFBhdHRlcm4gRGF0YSByZWFkIGVycm9yISEKAEVycm9yIHJlYWRpbmcgcGF0dGVybiBmaWxlICclcycuCgBFcnJvciAoJWQpOiB1bmFibGUgdG8gb3BlbiBjYW1lcmEgcGFyYW1ldGVycyBmaWxlICIlcyIgZm9yIHJlYWRpbmcuCgBFcnJvciAoJWQpOiB1bmFibGUgdG8gZGV0ZXJtaW5lIGZpbGUgbGVuZ3RoLgBFcnJvcjogc3VwcGxpZWQgZmlsZSBkb2VzIG5vdCBhcHBlYXIgdG8gYmUgYW4gQVJUb29sS2l0IGNhbWVyYSBwYXJhbWV0ZXIgZmlsZS4KAEVycm9yICglZCk6IHVuYWJsZSB0byByZWFkIGZyb20gZmlsZS4AYXJnbENhbWVyYUZydXN0dW1SSCgpOiBhclBhcmFtRGVjb21wTWF0KCkgaW5kaWNhdGVkIHBhcmFtZXRlciBlcnJvci4KAEVycm9yOiBpY3BHZXRKX1VfWGMARXJyb3IgMTogaWNwR2V0SW5pdFh3MlhjCgBFcnJvciAyOiBpY3BHZXRJbml0WHcyWGMKAEVycm9yIDM6IGljcEdldEluaXRYdzJYYwoARXJyb3IgNDogaWNwR2V0SW5pdFh3MlhjCgBFcnJvciA1OiBpY3BHZXRJbml0WHcyWGMKAEVycm9yIDY6IGljcEdldEluaXRYdzJYYwoARXJyb3IgNzogaWNwR2V0SW5pdFh3MlhjCgBFcnJvcjogdW5hYmxlIHRvIG9wZW4gbXVsdGltYXJrZXIgY29uZmlnIGZpbGUgJyVzJy4KAEVycm9yIHByb2Nlc3NpbmcgbXVsdGltYXJrZXIgY29uZmlnIGZpbGUgJyVzJzogRmlyc3QgbGluZSBtdXN0IGJlIG51bWJlciBvZiBtYXJrZXIgY29uZmlncyB0byByZWFkLgoAJWxsdSVjAEVycm9yIHByb2Nlc3NpbmcgbXVsdGltYXJrZXIgY29uZmlnIGZpbGUgJyVzJzogcGF0dGVybiAnJXMnIHNwZWNpZmllZCBpbiBtdWx0aW1hcmtlciBjb25maWd1cmF0aW9uIHdoaWxlIGluIGJhcmNvZGUtb25seSBtb2RlLgoARXJyb3IgcHJvY2Vzc2luZyBtdWx0aW1hcmtlciBjb25maWcgZmlsZSAnJXMnOiBVbmFibGUgdG8gZGV0ZXJtaW5lIGRpcmVjdG9yeSBuYW1lLgoARXJyb3IgcHJvY2Vzc2luZyBtdWx0aW1hcmtlciBjb25maWcgZmlsZSAnJXMnOiBVbmFibGUgdG8gbG9hZCBwYXR0ZXJuICclcycuCgAlbGYARXJyb3IgcHJvY2Vzc2luZyBtdWx0aW1hcmtlciBjb25maWcgZmlsZSAnJXMnLCBtYXJrZXIgZGVmaW5pdGlvbiAlM2Q6IEZpcnN0IGxpbmUgbXVzdCBiZSBwYXR0ZXJuIHdpZHRoLgoAJWxmICVsZiAlbGYgJWxmACVmICVmAEVycm9yIHByb2Nlc3NpbmcgbXVsdGltYXJrZXIgY29uZmlnIGZpbGUgJyVzJywgbWFya2VyIGRlZmluaXRpb24gJTNkOiBMaW5lcyAyIC0gNCBtdXN0IGJlIG1hcmtlciB0cmFuc2Zvcm0uCgBbJXNdIABkZWJ1ZwBpbmZvAHdhcm5pbmcAZXJyb3IAJXMlcwAuaXNldABFcnJvcjogdW5hYmxlIHRvIG9wZW4gZmlsZSAnJXMlcycgZm9yIHJlYWRpbmcuCgBFcnJvciByZWFkaW5nIGltYWdlU2V0LgoASW1hZ2VzZXQgY29udGFpbnMgJWQgaW1hZ2VzLgoARmFsbGluZyBiYWNrIHRvIHJlYWRpbmcgJyVzJXMnIGluIEFSVG9vbEtpdCB2NC54IGZvcm1hdC4KAEVycm9yIHJlYWRpbmcgSlBFRyBmaWxlLgoARXJyb3IgcmVhZGluZyBKUEVHIGZpbGUgaGVhZGVyLgoAJWYARmlsZSBvcGVuIGVycm9yLiAlcwoAUmVhZCBlcnJvciEhCgByAEVycm9yIG9wZW5pbmcgZmlsZSAnJXMnOiAAJXMlcwoAJWQACiMjIyBTdXJmYWNlIE5vLiVkICMjIwoAJXMAICBSZWFkIEltYWdlU2V0LgoARXJyb3Igb3BlbmluZyBmaWxlICclcy5pc2V0Jy4KACAgICBlbmQuCgAgIFJlYWQgRmVhdHVyZVNldC4KAEVycm9yIG9wZW5pbmcgZmlsZSAnJXMuZnNldCcuCgAgIFJlYWQgTWFya2VyU2V0LgoAbXJrAEVycm9yIG9wZW5pbmcgZmlsZSAnJXMubXJrJy4KACVmICVmICVmICVmAFRyYW5zZm9ybWF0aW9uIG1hdHJpeCByZWFkIGVycm9yISEKAGpwZwBrcG1EZWxldGVSZWZEYXRhU2V0KCk6IE5VTEwgcmVmRGF0YVNldFB0cjEvcmVmRGF0YVNldFB0cjIuCgBrcG1EZWxldGVSZWZEYXRhU2V0KCk6IE5VTEwgcmVmRGF0YVNldFB0ci4KAHJiAGtwbUxvYWRSZWZEYXRhU2V0KCk6IE5VTEwgZmlsZW5hbWUvcmVmRGF0YVNldFB0ci4KAEVycm9yIGxvYWRpbmcgS1BNIGRhdGE6IHVuYWJsZSB0byBvcGVuIGZpbGUgJyVzJXMlcycgZm9yIHJlYWRpbmcuCgBFcnJvciBsb2FkaW5nIEtQTSBkYXRhOiBlcnJvciByZWFkaW5nIGRhdGEuCgBrcG1DaGFuZ2VQYWdlTm9PZlJlZkRhdGFTZXQoKTogTlVMTCByZWZEYXRhU2V0LgoAa3BtU2V0UmVmRGF0YVNldCgpOiBOVUxMIGtwbUhhbmRsZS9yZWZEYXRhU2V0LgoAa3BtU2V0UmVmRGF0YVNldCgpOiByZWZEYXRhU2V0LgoAcG9pbnRzLSVkCgBrcG1NYXRjaGluZygpOiBOVUxMIGtwbUhhbmRsZS9pbkltYWdlTHVtYS4KAFBhZ2VbJWRdICBwcmU6JTNkLCBhZnQ6JTNkLCBlcnJvciA9ICVmCgAlcy4lcwBBc3NlcnRpb24gYHB5cmFtaWQtPnNpemUoKSA+IDBgIGZhaWxlZCBpbiAAL3NyYy9lbXNjcmlwdGVuL2FydG9vbGtpdDUvbGliL1NSQy9LUE0vRnJlYWtNYXRjaGVyL2RldGVjdG9ycy9Eb0dfc2NhbGVfaW52YXJpYW50X2RldGVjdG9yLmNwcABQeXJhbWlkIGlzIG5vdCBhbGxvY2F0ZWQAT2N0YXZlIG91dCBvZiByYW5nZQBTY2FsZSBvdXQgb2YgcmFuZ2UAQXNzZXJ0aW9uIGBtSW1hZ2VzLnNpemUoKSA+IDBgIGZhaWxlZCBpbiAATGFwbGFjaWFuIHB5cmFtaWQgaGFzIG5vdCBiZWVuIGFsbG9jYXRlZABBc3NlcnRpb24gYHB5cmFtaWQtPm51bU9jdGF2ZXMoKSA+IDBgIGZhaWxlZCBpbiAAUHlyYW1pZCBkb2VzIG5vdCBjb250YWluIGFueSBsZXZlbHMAQXNzZXJ0aW9uIGBkeW5hbWljX2Nhc3Q8Y29uc3QgQmlub21pYWxQeXJhbWlkMzJmKj4ocHlyYW1pZClgIGZhaWxlZCBpbiAAT25seSBiaW5vbWlhbCBweXJhbWlkIGlzIHN1cHBvcnRlZABBc3NlcnRpb24gYGQudHlwZSgpID09IElNQUdFX0YzMmAgZmFpbGVkIGluIABPbmx5IEYzMiBpbWFnZXMgc3VwcG9ydGVkAEFzc2VydGlvbiBgaW0xLnR5cGUoKSA9PSBJTUFHRV9GMzJgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGBpbTIudHlwZSgpID09IElNQUdFX0YzMmAgZmFpbGVkIGluIABBc3NlcnRpb24gYGQuY2hhbm5lbHMoKSA9PSAxYCBmYWlsZWQgaW4gAE9ubHkgc2luZ2xlIGNoYW5uZWwgaW1hZ2VzIHN1cHBvcnRlZABBc3NlcnRpb24gYGltMS5jaGFubmVscygpID09IDFgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGBpbTIuY2hhbm5lbHMoKSA9PSAxYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgZC53aWR0aCgpID09IGltMi53aWR0aCgpYCBmYWlsZWQgaW4gAEltYWdlcyBtdXN0IGhhdmUgdGhlIHNhbWUgd2lkdGgAQXNzZXJ0aW9uIGBkLmhlaWdodCgpID09IGltMi5oZWlnaHQoKWAgZmFpbGVkIGluIABJbWFnZXMgbXVzdCBoYXZlIHRoZSBzYW1lIGhlaWdodABBc3NlcnRpb24gYGltMS53aWR0aCgpID09IGltMi53aWR0aCgpYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgaW0xLmhlaWdodCgpID09IGltMi5oZWlnaHQoKWAgZmFpbGVkIGluIABBc3NlcnRpb24gYHJvdyA8IG1IZWlnaHRgIGZhaWxlZCBpbiAAL3NyYy9lbXNjcmlwdGVuL2FydG9vbGtpdDUvbGliL1NSQy9LUE0vRnJlYWtNYXRjaGVyL2ZyYW1ld29yay9pbWFnZS5oAHJvdyBvdXQgb2YgYm91bmRzAE42dmlzaW9uMjVHYXVzc2lhblNjYWxlU3BhY2VQeXJhbWlkRQBEb0cgUHlyYW1pZABOb24tbWF4IHN1cHByZXNzaW9uAFN1YnBpeGVsAHBydW5lRmVhdHVyZXMARmluZCBPcmllbnRhdGlvbnMAQXNzZXJ0aW9uIGBtQnVja2V0cy5zaXplKCkgPT0gbU51bUJ1Y2tldHNYYCBmYWlsZWQgaW4gAEJ1Y2tldHMgYXJlIG5vdCBhbGxvY2F0ZWQAQXNzZXJ0aW9uIGBtQnVja2V0c1swXS5zaXplKCkgPT0gbU51bUJ1Y2tldHNZYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgbUZlYXR1cmVQb2ludHMuc2l6ZSgpIDw9IG1NYXhOdW1GZWF0dXJlUG9pbnRzYCBmYWlsZWQgaW4gAFRvbyBtYW55IGZlYXR1cmUgcG9pbnRzAEFzc2VydGlvbiBgYnVja2V0WzBdLmZpcnN0ID49IGJ1Y2tldFtuXS5maXJzdGAgZmFpbGVkIGluIABudGhfZWxlbWVudCBmYWlsZWQAQXNzZXJ0aW9uIGBrcC5zY2FsZSA8IG1MYXBsYWNpYW5QeXJhbWlkLm51bVNjYWxlUGVyT2N0YXZlKClgIGZhaWxlZCBpbiAARmVhdHVyZSBwb2ludCBzY2FsZSBpcyBvdXQgb2YgYm91bmRzAEFzc2VydGlvbiBga3Auc2NvcmUgPT0gbGFwMS5nZXQ8ZmxvYXQ+KHkpW3hdYCBmYWlsZWQgaW4gAFNjb3JlIGlzIG5vdCBjb25zaXN0ZW50IHdpdGggdGhlIERvRyBpbWFnZQBBc3NlcnRpb24gYGxhcDAuaGVpZ2h0KCkgPT0gbGFwMS5oZWlnaHQoKSA9PSBsYXAyLmhlaWdodCgpYCBmYWlsZWQgaW4gAC9zcmMvZW1zY3JpcHRlbi9hcnRvb2xraXQ1L2xpYi9TUkMvS1BNL0ZyZWFrTWF0Y2hlci9kZXRlY3RvcnMvRG9HX3NjYWxlX2ludmFyaWFudF9kZXRlY3Rvci5oAFdpZHRoL2hlaWdodCBhcmUgbm90IGNvbnNpc3RlbnQAQXNzZXJ0aW9uIGAobGFwMC5oZWlnaHQoKSA9PSBsYXAxLmhlaWdodCgpKSAmJiAoKGxhcDEuaGVpZ2h0KCk+PjEpID09IGxhcDIuaGVpZ2h0KCkpYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgKChsYXAwLndpZHRoKCk+PjEpID09IGxhcDEud2lkdGgoKSkgJiYgKGxhcDEud2lkdGgoKSA9PSBsYXAyLndpZHRoKCkpYCBmYWlsZWQgaW4gAEltYWdlIHNpemVzIGFyZSBpbmNvbnNpc3RlbnQAQXNzZXJ0aW9uIGAoeC0xKSA+PSAwICYmICh4KzEpIDwgbGFwMS53aWR0aCgpYCBmYWlsZWQgaW4gAHggb3V0IG9mIGJvdW5kcwBBc3NlcnRpb24gYCh5LTEpID49IDAgJiYgKHkrMSkgPCBsYXAxLmhlaWdodCgpYCBmYWlsZWQgaW4gAHkgb3V0IG9mIGJvdW5kcwBBc3NlcnRpb24gYChsYXAwLndpZHRoKCk+PjEpID09IGxhcDEud2lkdGgoKWAgZmFpbGVkIGluIABJbWFnZSBkaW1lbnNpb25zIGluY29uc2lzdGVudABBc3NlcnRpb24gYChsYXAwLndpZHRoKCk+PjEpID09IGxhcDIud2lkdGgoKWAgZmFpbGVkIGluIABBc3NlcnRpb24gYChsYXAwLmhlaWdodCgpPj4xKSA9PSBsYXAxLmhlaWdodCgpYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgKGxhcDAuaGVpZ2h0KCk+PjEpID09IGxhcDIuaGVpZ2h0KClgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGAoaW50KXN0ZDo6Zmxvb3IoeCkgPT0gKGludCl4YCBmYWlsZWQgaW4gAC9zcmMvZW1zY3JpcHRlbi9hcnRvb2xraXQ1L2xpYi9TUkMvS1BNL0ZyZWFrTWF0Y2hlci9kZXRlY3RvcnMvaW50ZXJwb2xhdGUuaABmbG9vcigpIGFuZCBjYXN0IG5vdCB0aGUgc2FtZQBBc3NlcnRpb24gYChpbnQpc3RkOjpmbG9vcih5KSA9PSAoaW50KXlgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGB5cCA+PSAwICYmIHlwIDwgaGVpZ2h0YCBmYWlsZWQgaW4gAHlwIG91dCBvZiBib3VuZHMAQXNzZXJ0aW9uIGB5cF9wbHVzXzEgPj0gMCAmJiB5cF9wbHVzXzEgPCBoZWlnaHRgIGZhaWxlZCBpbiAAeXBfcGx1c18xIG91dCBvZiBib3VuZHMAQXNzZXJ0aW9uIGB4cCA+PSAwICYmIHhwIDwgd2lkdGhgIGZhaWxlZCBpbiAAeHAgb3V0IG9mIGJvdW5kcwBBc3NlcnRpb24gYHhwX3BsdXNfMSA+PSAwICYmIHhwX3BsdXNfMSA8IHdpZHRoYCBmYWlsZWQgaW4gAHhwX3BsdXNfMSBvdXQgb2YgYm91bmRzAEFzc2VydGlvbiBgdzAgPj0gMCAmJiB3MCA8PSAxLjAwMDFgIGZhaWxlZCBpbiAAT3V0IG9mIHJhbmdlAEFzc2VydGlvbiBgdzEgPj0gMCAmJiB3MSA8PSAxLjAwMDFgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGB3MiA+PSAwICYmIHcyIDw9IDEuMDAwMWAgZmFpbGVkIGluIABBc3NlcnRpb24gYHczID49IDAgJiYgdzMgPD0gMS4wMDAxYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgKHcwK3cxK3cyK3czKSA8PSAxLjAwMDFgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGAoeC0xKSA+PSAwICYmICh4KzEpIDwgaW0ud2lkdGgoKWAgZmFpbGVkIGluIABBc3NlcnRpb24gYCh5LTEpID49IDAgJiYgKHkrMSkgPCBpbS5oZWlnaHQoKWAgZmFpbGVkIGluIABBc3NlcnRpb24gYGxhcDAud2lkdGgoKSA9PSBsYXAxLndpZHRoKClgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGBsYXAwLmhlaWdodCgpID09IGxhcDEuaGVpZ2h0KClgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGB4X2Rpdl8yLTAuNWYgPj0gMGAgZmFpbGVkIGluIAB4X2Rpdl8yIG91dCBvZiBib3VuZHMgb3V0IG9mIGJvdW5kcyBmb3IgaW50ZXJwb2xhdGlvbgBBc3NlcnRpb24gYHlfZGl2XzItMC41ZiA+PSAwYCBmYWlsZWQgaW4gAHlfZGl2XzIgb3V0IG9mIGJvdW5kcyBvdXQgb2YgYm91bmRzIGZvciBpbnRlcnBvbGF0aW9uAEFzc2VydGlvbiBgeF9kaXZfMiswLjVmIDwgbGFwMi53aWR0aCgpYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgeV9kaXZfMiswLjVmIDwgbGFwMi5oZWlnaHQoKWAgZmFpbGVkIGluIABBc3NlcnRpb24gYGxhcDAud2lkdGgoKSA9PSBsYXAyLndpZHRoKClgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGBsYXAwLmhlaWdodCgpID09IGxhcDIuaGVpZ2h0KClgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGBpbTAuaGVpZ2h0KCkgPT0gaW0xLmhlaWdodCgpYCBmYWlsZWQgaW4gAEhlaWdodCBpcyBpbmNvbnNpc3RlbnQAQXNzZXJ0aW9uIGBpbTAuaGVpZ2h0KCkgPT0gaW0yLmhlaWdodCgpYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgKGltMS5oZWlnaHQoKT4+MSkgPT0gaW0yLmhlaWdodCgpYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgKGltMC5oZWlnaHQoKT4+MSkgPT0gaW0xLmhlaWdodCgpYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgKGltMC5oZWlnaHQoKT4+MSkgPT0gaW0yLmhlaWdodCgpYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgaW5kZXggPCBtSW1hZ2VzLnNpemUoKWAgZmFpbGVkIGluIABJbmRleCBpcyBvdXQgb2YgcmFuZ2UATjZ2aXNpb24xOEJpbm9taWFsUHlyYW1pZDMyZkUAQXNzZXJ0aW9uIGB3aWR0aCA+PSA1YCBmYWlsZWQgaW4gAC9zcmMvZW1zY3JpcHRlbi9hcnRvb2xraXQ1L2xpYi9TUkMvS1BNL0ZyZWFrTWF0Y2hlci9kZXRlY3RvcnMvZ2F1c3NpYW5fc2NhbGVfc3BhY2VfcHlyYW1pZC5jcHAASW1hZ2UgaXMgdG9vIHNtYWxsAEFzc2VydGlvbiBgaGVpZ2h0ID49IDVgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGBpbWFnZS50eXBlKCkgPT0gSU1BR0VfVUlOVDhgIGZhaWxlZCBpbiAASW1hZ2UgbXVzdCBiZSBncmF5c2NhbGUAQXNzZXJ0aW9uIGBpbWFnZS5jaGFubmVscygpID09IDFgIGZhaWxlZCBpbiAASW1hZ2UgbXVzdCBoYXZlIDEgY2hhbm5lbABBc3NlcnRpb24gYG1QeXJhbWlkLnNpemUoKSA9PSBtTnVtT2N0YXZlcyptTnVtU2NhbGVzUGVyT2N0YXZlYCBmYWlsZWQgaW4gAFB5cmFtaWQgaGFzIG5vdCBiZWVuIGFsbG9jYXRlZCB5ZXQAQXNzZXJ0aW9uIGBpbWFnZS53aWR0aCgpID09IG1QeXJhbWlkWzBdLndpZHRoKClgIGZhaWxlZCBpbiAASW1hZ2Ugb2Ygd3Jvbmcgc2l6ZSBmb3IgcHlyYW1pZABBc3NlcnRpb24gYGltYWdlLmhlaWdodCgpID09IG1QeXJhbWlkWzBdLmhlaWdodCgpYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgZHN0LnR5cGUoKSA9PSBJTUFHRV9GMzJgIGZhaWxlZCBpbiAARGVzdGluYXRpb24gaW1hZ2Ugc2hvdWxkIGJlIGEgZmxvYXQAVW5rbm93biBpbWFnZSB0eXBlAFVuc3VwcG9ydGVkIGltYWdlIHR5cGUATjZ2aXNpb245RXhjZXB0aW9uRQBBc3NlcnRpb24gYGltLndpZHRoKCkgPT0gaW0uc3RlcCgpL3NpemVvZihmbG9hdClgIGZhaWxlZCBpbiAAL3NyYy9lbXNjcmlwdGVuL2FydG9vbGtpdDUvbGliL1NSQy9LUE0vRnJlYWtNYXRjaGVyL2RldGVjdG9ycy9vcmllbnRhdGlvbl9hc3NpZ25tZW50LmNwcABTdGVwIHNpemUgbXVzdCBiZSBlcXVhbCB0byB3aWR0aCBmb3Igbm93AEFzc2VydGlvbiBgeCA+PSAwYCBmYWlsZWQgaW4gAHggbXVzdCBiZSBwb3NpdGl2ZQBBc3NlcnRpb24gYHggPCBtR3JhZGllbnRzW29jdGF2ZSptTnVtU2NhbGVzUGVyT2N0YXZlK3NjYWxlXS53aWR0aCgpYCBmYWlsZWQgaW4gAHggbXVzdCBiZSBsZXNzIHRoYW4gdGhlIGltYWdlIHdpZHRoAEFzc2VydGlvbiBgeSA+PSAwYCBmYWlsZWQgaW4gAHkgbXVzdCBiZSBwb3NpdGl2ZQBBc3NlcnRpb24gYHkgPCBtR3JhZGllbnRzW29jdGF2ZSptTnVtU2NhbGVzUGVyT2N0YXZlK3NjYWxlXS5oZWlnaHQoKWAgZmFpbGVkIGluIAB5IG11c3QgYmUgbGVzcyB0aGFuIHRoZSBpbWFnZSBoZWlnaHQAQXNzZXJ0aW9uIGBnLmNoYW5uZWxzKCkgPT0gMmAgZmFpbGVkIGluIABOdW1iZXIgb2YgY2hhbm5lbHMgc2hvdWxkIGJlIDIAQXNzZXJ0aW9uIGBtYXhfaGVpZ2h0ID4gMGAgZmFpbGVkIGluIABNYXhpbXVtIGJpbiBzaG91bGQgYmUgcG9zaXRpdmUAQXNzZXJ0aW9uIGBoaXN0ICE9IE5VTExgIGZhaWxlZCBpbiAAL3NyYy9lbXNjcmlwdGVuL2FydG9vbGtpdDUvbGliL1NSQy9LUE0vRnJlYWtNYXRjaGVyL2RldGVjdG9ycy9vcmllbnRhdGlvbl9hc3NpZ25tZW50LmgASGlzdG9ncmFtIHBvaW50ZXIgaXMgTlVMTABBc3NlcnRpb24gYChmYmluKzAuNWYpID4gMCAmJiAoZmJpbi0wLjVmKSA8IG51bV9iaW5zYCBmYWlsZWQgaW4gAERlY2ltYWwgYmluIHBvc2l0aW9uIGluZGV4IG91dCBvZiByYW5nZQBBc3NlcnRpb24gYG1hZ25pdHVkZSA+PSAwYCBmYWlsZWQgaW4gAE1hZ25pdHVkZSBjYW5ub3QgYmUgbmVnYXRpdmUAQXNzZXJ0aW9uIGBudW1fYmlucyA+PSAwYCBmYWlsZWQgaW4gAE51bWJlciBiaW5zIG11c3QgYmUgcG9zaXRpdmUAQXNzZXJ0aW9uIGB3MSA+PSAwYCBmYWlsZWQgaW4gAHcxIG11c3QgYmUgcG9zaXRpdmUAQXNzZXJ0aW9uIGB3MiA+PSAwYCBmYWlsZWQgaW4gAHcyIG11c3QgYmUgcG9zaXRpdmUAQXNzZXJ0aW9uIGBiMSA+PSAwICYmIGIxIDwgbnVtX2JpbnNgIGZhaWxlZCBpbiAAYjEgYmluIGluZGV4IG91dCBvZiByYW5nZQBBc3NlcnRpb24gYGIyID49IDAgJiYgYjIgPCBudW1fYmluc2AgZmFpbGVkIGluIABiMiBiaW4gaW5kZXggb3V0IG9mIHJhbmdlAElEIGFscmVhZHkgZXhpc3RzAEJ1aWxkIFB5cmFtaWQARXh0cmFjdCBGZWF0dXJlcwBBc3NlcnRpb24gYGFzc2lnbm1lbnQuc2l6ZSgpID09IG51bV9pbmRpY2VzYCBmYWlsZWQgaW4gAC9zcmMvZW1zY3JpcHRlbi9hcnRvb2xraXQ1L2xpYi9TUkMvS1BNL0ZyZWFrTWF0Y2hlci9tYXRjaGVycy9iaW5hcnlfaGllcmFyY2hpY2FsX2NsdXN0ZXJpbmcuaABBc3NpZ25tZW50IHNpemUgd3JvbmcAQXNzZXJ0aW9uIGBhc3NpZ25tZW50W2ldICE9IC0xYCBmYWlsZWQgaW4gAEFzc2lnbm1lbnQgaXMgaW52YWxpZABBc3NlcnRpb24gYGFzc2lnbm1lbnRbaV0gPCBudW1faW5kaWNlc2AgZmFpbGVkIGluIABBc3NpZ25tZW50IG91dCBvZiByYW5nZQBBc3NlcnRpb24gYGluZGljZXNbYXNzaWdubWVudFtpXV0gPCBudW1fZmVhdHVyZXNgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGBpdC0+c2Vjb25kLnNpemUoKSAhPSAwYCBmYWlsZWQgaW4gAENsdXN0ZXIgbXVzdCBoYXZlIGF0bGVhc2V0IDEgZmVhdHVyZQBBc3NlcnRpb24gYG1LID09IG1DZW50ZXJzLnNpemUoKWAgZmFpbGVkIGluIAAvc3JjL2Vtc2NyaXB0ZW4vYXJ0b29sa2l0NS9saWIvU1JDL0tQTS9GcmVha01hdGNoZXIvbWF0Y2hlcnMva21lZG9pZHMuaABrIHNob3VsZCBtYXRjaCB0aGUgbnVtYmVyIG9mIGNsdXN0ZXIgY2VudGVycwBBc3NlcnRpb24gYG51bV9mZWF0dXJlcyA+IDBgIGZhaWxlZCBpbiAATnVtYmVyIG9mIGZlYXR1cmVzIG11c3QgYmUgcG9zaXRpdmUAQXNzZXJ0aW9uIGBudW1faW5kaWNlcyA8PSBudW1fZmVhdHVyZXNgIGZhaWxlZCBpbiAATW9yZSBpbmRpY2VzIHRoYW4gZmVhdHVyZXMAQXNzZXJ0aW9uIGBudW1faW5kaWNlcyA+PSBtS2AgZmFpbGVkIGluIABOb3QgZW5vdWdoIGZlYXR1cmVzAEFzc2lnbm1lbnQgc2l6ZSBpcyBpbmNvcnJlY3QAQXNzZXJ0aW9uIGBudW1fY2VudGVycyA+IDBgIGZhaWxlZCBpbiAAVGhlcmUgbXVzdCBiZSBhdCBsZWFzdCAxIGNlbnRlcgAvc3JjL2Vtc2NyaXB0ZW4vYXJ0b29sa2l0NS9saWIvU1JDL0tQTS9GcmVha01hdGNoZXIvbWF0Y2hlcnMvdmlzdWFsX2RhdGFiYXNlLmgAQXNzZXJ0aW9uIGBkZXRlY3RvcmAgZmFpbGVkIGluIABEZXRlY3RvciBpcyBOVUxMAEFzc2VydGlvbiBgcHlyYW1pZC0+aW1hZ2VzKCkuc2l6ZSgpID4gMGAgZmFpbGVkIGluIABQeXJhbWlkIGlzIGVtcHR5AEFzc2VydGlvbiBgcHlyYW1pZC0+aW1hZ2VzKClbMF0ud2lkdGgoKSA9PSBkZXRlY3Rvci0+d2lkdGgoKWAgZmFpbGVkIGluIABQeXJhbWlkIGFuZCBkZXRlY3RvciBzaXplIG1pc21hdGNoAEFzc2VydGlvbiBgcHlyYW1pZC0+aW1hZ2VzKClbMF0uaGVpZ2h0KCkgPT0gZGV0ZWN0b3ItPmhlaWdodCgpYCBmYWlsZWQgaW4gAE5TdDNfXzIxNGRlZmF1bHRfZGVsZXRlSU42dmlzaW9uOEtleWZyYW1lSUxpOTZFRUVFRQBOU3QzX18yMjBfX3NoYXJlZF9wdHJfcG9pbnRlcklQTjZ2aXNpb244S2V5ZnJhbWVJTGk5NkVFRU5TXzE0ZGVmYXVsdF9kZWxldGVJUzNfRUVOU185YWxsb2NhdG9ySVMzX0VFRUUAWyVzXSBbJXNdIFslc10gOiBGb3VuZCAlZCBmZWF0dXJlcyBpbiBxdWVyeQBib29sIHZpc2lvbjo6VmlzdWFsRGF0YWJhc2U8dmlzaW9uOjpGUkVBS0V4dHJhY3RvciwgdmlzaW9uOjpCaW5hcnlGZWF0dXJlU3RvcmUsIHZpc2lvbjo6QmluYXJ5RmVhdHVyZU1hdGNoZXI8OTY+ID46OnF1ZXJ5KGNvbnN0IHZpc2lvbjo6R2F1c3NpYW5TY2FsZVNwYWNlUHlyYW1pZCAqKSBbRkVBVFVSRV9FWFRSQUNUT1IgPSB2aXNpb246OkZSRUFLRXh0cmFjdG9yLCBTVE9SRSA9IHZpc2lvbjo6QmluYXJ5RmVhdHVyZVN0b3JlLCBNQVRDSEVSID0gdmlzaW9uOjpCaW5hcnlGZWF0dXJlTWF0Y2hlcjw5Nj5dAEZpbmQgTWF0Y2hlcyAoMSkASG91Z2ggVm90aW5nICgxKQBGaW5kIEhvdWdoIE1hdGNoZXMgKDEpAEVzdGltYXRlIEhvbW9ncmFwaHkgKDEpAEZpbmQgSW5saWVycyAoMSkARmluZCBNYXRjaGVzICgyKQBIb3VnaCBWb3RpbmcgKDIpAEZpbmQgSG91Z2ggTWF0Y2hlcyAoMikARXN0aW1hdGUgSG9tb2dyYXBoeSAoMikARmluZCBJbmxpZXJzICgyKQBBc3NlcnRpb24gYDBgIGZhaWxlZCBpbiAAL3NyYy9lbXNjcmlwdGVuL2FydG9vbGtpdDUvbGliL1NSQy9LUE0vRnJlYWtNYXRjaGVyL21hdGNoZXJzL2ZlYXR1cmVfbWF0Y2hlci1pbmxpbmUuaABGYWlsZWQgdG8gY29tcHV0ZSBtYXRyaXggaW52ZXJzZQBBc3NlcnRpb24gYGJlc3RfaW5kZXggIT0gc3RkOjpudW1lcmljX2xpbWl0czxzaXplX3Q+OjptYXgoKWAgZmFpbGVkIGluIABTb21ldGhpbmcgc3RyYW5nZQBBc3NlcnRpb24gYG1NYXRjaGVzLnNpemUoKSA8PSBmZWF0dXJlczEtPnNpemUoKWAgZmFpbGVkIGluIABOdW1iZXIgb2YgbWF0Y2hlcyBzaG91bGQgYmUgbG93ZXIAQXNzZXJ0aW9uIGBoeXAuc2l6ZSgpID49IDkqbWF4X251bV9oeXBvdGhlc2VzYCBmYWlsZWQgaW4gAC9zcmMvZW1zY3JpcHRlbi9hcnRvb2xraXQ1L2xpYi9TUkMvS1BNL0ZyZWFrTWF0Y2hlci9ob21vZ3JhcGh5X2VzdGltYXRpb24vcm9idXN0X2hvbW9ncmFwaHkuaABoeXAgdmVjdG9yIHNob3VsZCBiZSBvZiBzaXplIDkqbWF4X251bV9oeXBvdGhlc2VzAEFzc2VydGlvbiBgdG1wX2kuc2l6ZSgpID49IG51bV9wb2ludHNgIGZhaWxlZCBpbiAAdG1wX2kgdmVjdG9yIHNob3VsZCBiZSBvZiBzaXplIG51bV9wb2ludHMAQXNzZXJ0aW9uIGBoeXBfY29zdHMuc2l6ZSgpID49IG1heF9udW1faHlwb3RoZXNlc2AgZmFpbGVkIGluIABoeXBfY29zdHMgdmVjdG9yIHNob3VsZCBiZSBvZiBzaXplIG1heF9udW1faHlwb3RoZXNlcwBBc3NlcnRpb24gYG4gPD0gaW5fbWF0Y2hlcy5zaXplKClgIGZhaWxlZCBpbiAAU2hvdWxkIGJlIHRoZSBzYW1lAEFzc2VydGlvbiBgZGlzdEJpbkFuZ2xlID49IDBgIGZhaWxlZCBpbiAAZGlzdEJpbkFuZ2xlIG11c3Qgbm90IGJlIG5lZ2F0aXZlAEFzc2VydGlvbiBgbVJvb3QuZ2V0KClgIGZhaWxlZCBpbiAAUm9vdCBjYW5ub3QgYmUgTlVMTABBc3NlcnRpb24gYG1pbmkgIT0gLTFgIGZhaWxlZCBpbiAATWluaW11bSBpbmRleCBub3Qgc2V0AEFzc2VydGlvbiBgeCA+PSBtTWluWGAgZmFpbGVkIGluIAAvc3JjL2Vtc2NyaXB0ZW4vYXJ0b29sa2l0NS9saWIvU1JDL0tQTS9GcmVha01hdGNoZXIvbWF0Y2hlcnMvaG91Z2hfc2ltaWxhcml0eV92b3RpbmcuaAB4IG91dCBvZiByYW5nZQBBc3NlcnRpb24gYHggPCBtTWF4WGAgZmFpbGVkIGluIABBc3NlcnRpb24gYHkgPj0gbU1pbllgIGZhaWxlZCBpbiAAeSBvdXQgb2YgcmFuZ2UAQXNzZXJ0aW9uIGB5IDwgbU1heFlgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGBhbmdsZSA+IC1QSWAgZmFpbGVkIGluIABhbmdsZSBvdXQgb2YgcmFuZ2UAQXNzZXJ0aW9uIGBhbmdsZSA8PSBQSWAgZmFpbGVkIGluIABBc3NlcnRpb24gYHNjYWxlID49IG1NaW5TY2FsZWAgZmFpbGVkIGluIABzY2FsZSBvdXQgb2YgcmFuZ2UAQXNzZXJ0aW9uIGBzY2FsZSA8IG1NYXhTY2FsZWAgZmFpbGVkIGluIABBc3NlcnRpb24gYGluZGV4ID49IDBgIGZhaWxlZCBpbiAAaW5kZXggb3V0IG9mIHJhbmdlAEFzc2VydGlvbiBgYmluWCA+PSAwYCBmYWlsZWQgaW4gAGJpblggb3V0IG9mIHJhbmdlAEFzc2VydGlvbiBgYmluWCA8IG1OdW1YQmluc2AgZmFpbGVkIGluIABBc3NlcnRpb24gYGJpblkgPj0gMGAgZmFpbGVkIGluIABiaW5ZIG91dCBvZiByYW5nZQBBc3NlcnRpb24gYGJpblkgPCBtTnVtWUJpbnNgIGZhaWxlZCBpbiAAQXNzZXJ0aW9uIGBiaW5BbmdsZSA+PSAwYCBmYWlsZWQgaW4gAGJpbkFuZ2xlIG91dCBvZiByYW5nZQBBc3NlcnRpb24gYGJpbkFuZ2xlIDwgbU51bUFuZ2xlQmluc2AgZmFpbGVkIGluIABBc3NlcnRpb24gYGJpblNjYWxlID49IDBgIGZhaWxlZCBpbiAAYmluU2NhbGUgb3V0IG9mIHJhbmdlAEFzc2VydGlvbiBgYmluU2NhbGUgPCBtTnVtU2NhbGVCaW5zYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgaW5kZXggPD0gKGJpblggKyBiaW5ZKm1OdW1YQmlucyArIGJpbkFuZ2xlKm1OdW1YQmlucyptTnVtWUJpbnMgKyBiaW5TY2FsZSptTnVtWEJpbnMqbU51bVlCaW5zKm1OdW1BbmdsZUJpbnMpYCBmYWlsZWQgaW4gAEFzc2VydGlvbiBgc2l6ZSA+IDBgIGZhaWxlZCBpbiAAL3NyYy9lbXNjcmlwdGVuL2FydG9vbGtpdDUvbGliL1NSQy9LUE0vRnJlYWtNYXRjaGVyL21hdGNoZXJzL2hvdWdoX3NpbWlsYXJpdHlfdm90aW5nLmNwcABzaXplIG11c3QgYmUgcG9zaXRpdmUAQXNzZXJ0aW9uIGBtUmVmSW1hZ2VXaWR0aCA+IDBgIGZhaWxlZCBpbiAAd2lkdGggbXVzdCBiZSBwb3NpdGl2ZQBBc3NlcnRpb24gYG1SZWZJbWFnZUhlaWdodCA+IDBgIGZhaWxlZCBpbiAAaGVpZ2h0IG11c3QgYmUgcG9zaXRpdmUAQXNzZXJ0aW9uIGBuID4gMGAgZmFpbGVkIGluIAAvc3JjL2Vtc2NyaXB0ZW4vYXJ0b29sa2l0NS9saWIvU1JDL0tQTS9GcmVha01hdGNoZXIvdXRpbHMvcGFydGlhbF9zb3J0LmgAbiBtdXN0IGJlIHBvc2l0aXZlAEFzc2VydGlvbiBgayA+IDBgIGZhaWxlZCBpbiAAayBtdXN0IGJlIHBvc2l0aXZlAEFzc2VydGlvbiBgcHlyYW1pZGAgZmFpbGVkIGluIAAvc3JjL2Vtc2NyaXB0ZW4vYXJ0b29sa2l0NS9saWIvU1JDL0tQTS9GcmVha01hdGNoZXIvbWF0Y2hlcnMvZnJlYWsuaABQeXJhbWlkIGlzIE5VTEwAQXNzZXJ0aW9uIGBzdG9yZS5zaXplKCkgPT0gcG9pbnRzLnNpemUoKWAgZmFpbGVkIGluIABGZWF0dXJlIHN0b3JlIGhhcyBub3QgYmVlbiBhbGxvY2F0ZWQAQXNzZXJ0aW9uIGBudW1fcG9pbnRzID09IHBvaW50cy5zaXplKClgIGZhaWxlZCBpbiAAU2hvdWxkIGJlIHNhbWUgc2l6ZQBBc3NlcnRpb24gYG9jdGF2ZSA+PSAwYCBmYWlsZWQgaW4gAC9zcmMvZW1zY3JpcHRlbi9hcnRvb2xraXQ1L2xpYi9TUkMvS1BNL0ZyZWFrTWF0Y2hlci9kZXRlY3RvcnMvZ2F1c3NpYW5fc2NhbGVfc3BhY2VfcHlyYW1pZC5oAE9jdGF2ZSBtdXN0IGJlIHBvc2l0aXZlAEFzc2VydGlvbiBgb2N0YXZlIDwgbU51bU9jdGF2ZXNgIGZhaWxlZCBpbiAAT2N0YXZlIG11c3QgYmUgbGVzcyB0aGFuIG51bWJlciBvZiBvY3RhdmVzAEFzc2VydGlvbiBgc2NhbGUgPj0gMGAgZmFpbGVkIGluIABTY2FsZSBtdXN0IGJlIHBvc2l0aXZlAEFzc2VydGlvbiBgc2NhbGUgPCBtTnVtU2NhbGVzUGVyT2N0YXZlYCBmYWlsZWQgaW4gAFNjYWxlIG11c3QgYmUgbGVzcyB0aGFuIG51bWJlciBvZiBzY2FsZSBwZXIgb2N0YXZlACVtLSVkLSVZLSVILSVNLSVTAEFzc2VydGlvbiBgd2lkdGggPiAwYCBmYWlsZWQgaW4gAC9zcmMvZW1zY3JpcHRlbi9hcnRvb2xraXQ1L2xpYi9TUkMvS1BNL0ZyZWFrTWF0Y2hlci9mcmFtZXdvcmsvaW1hZ2UuY3BwAFdpZHRoIGNhbm5vdCBiZSB6ZXJvAEFzc2VydGlvbiBgaGVpZ2h0ID4gMGAgZmFpbGVkIGluIABIZWlnaHQgY2Fubm90IGJlIHplcm8AQXNzZXJ0aW9uIGBzdGVwID49IHdpZHRoYCBmYWlsZWQgaW4gAFN0ZXAgbXVzdCBiZSBncmVhdGVyIHRoYW4gb3IgZXF1YWwgdGhlIHdpZHRoAEFzc2VydGlvbiBgY2hhbm5lbHMgPiAwYCBmYWlsZWQgaW4gAE51bWJlciBvZiBjaGFubmVscyBjYW5ub3QgYmUgemVybwBBc3NlcnRpb24gYG1EYXRhLmdldCgpYCBmYWlsZWQgaW4gAERhdGEgcG9pbnRlciBpcyBOVUxMAE5TdDNfXzIxNGRlZmF1bHRfZGVsZXRlSWhFRQBOU3QzX18yMjBfX3NoYXJlZF9wdHJfcG9pbnRlcklQaE5TXzE0ZGVmYXVsdF9kZWxldGVJaEVFTlNfOWFsbG9jYXRvckloRUVFRQBJbnZhbGlkIGltYWdlIHR5cGUAMTZOdWxsQXJyYXlEZWxldGVySWhFAE5TdDNfXzIyMF9fc2hhcmVkX3B0cl9wb2ludGVySVBoMTZOdWxsQXJyYXlEZWxldGVySWhFTlNfOWFsbG9jYXRvckloRUVFRQBBc3NlcnRpb24gYG1TdGFydFRpbWUgPj0gMGAgZmFpbGVkIGluIAAvc3JjL2Vtc2NyaXB0ZW4vYXJ0b29sa2l0NS9saWIvU1JDL0tQTS9GcmVha01hdGNoZXIvZnJhbWV3b3JrL3RpbWVycy5jcHAAIGxpbmUgADogAENsb2NrIGhhcyBub3QgYmVlbiBzdGFydGVkAEFzc2VydGlvbiBgbVN0b3BUaW1lID49IDBgIGZhaWxlZCBpbiAAQ2xvY2sgaGFzIG5vdCBiZWVuIHN0b3BwZWQAWyVzXSBbJXNdIFslc10gOiAlczogJWYgbXMAIElORk8gIAB2aXNpb246OlNjb3BlZFRpbWVyOjp+U2NvcGVkVGltZXIoKQBzZXR1cAB0ZWFyZG93bgBzZXR1cEFSMgBfYWRkTWFya2VyAF9hZGRNdWx0aU1hcmtlcgBfYWRkTkZUTWFya2VyAGdldE11bHRpTWFya2VyTnVtAGdldE11bHRpTWFya2VyQ291bnQAX2xvYWRDYW1lcmEAc2V0TWFya2VySW5mb0RpcgBzZXRNYXJrZXJJbmZvVmVydGV4AGdldFRyYW5zTWF0U3F1YXJlAGdldFRyYW5zTWF0U3F1YXJlQ29udABnZXRUcmFuc01hdE11bHRpU3F1YXJlAGdldFRyYW5zTWF0TXVsdGlTcXVhcmVSb2J1c3QAZGV0ZWN0TWFya2VyAGdldE1hcmtlck51bQBkZXRlY3RORlRNYXJrZXIAZ2V0TXVsdGlFYWNoTWFya2VyAGdldE1hcmtlcgBnZXRORlRNYXJrZXIAc2V0RGVidWdNb2RlAGdldERlYnVnTW9kZQBnZXRQcm9jZXNzaW5nSW1hZ2UAc2V0TG9nTGV2ZWwAZ2V0TG9nTGV2ZWwAc2V0UHJvamVjdGlvbk5lYXJQbGFuZQBnZXRQcm9qZWN0aW9uTmVhclBsYW5lAHNldFByb2plY3Rpb25GYXJQbGFuZQBnZXRQcm9qZWN0aW9uRmFyUGxhbmUAc2V0VGhyZXNob2xkTW9kZQBnZXRUaHJlc2hvbGRNb2RlAHNldFRocmVzaG9sZABnZXRUaHJlc2hvbGQAc2V0UGF0dGVybkRldGVjdGlvbk1vZGUAZ2V0UGF0dGVybkRldGVjdGlvbk1vZGUAc2V0UGF0dFJhdGlvAGdldFBhdHRSYXRpbwBzZXRNYXRyaXhDb2RlVHlwZQBnZXRNYXRyaXhDb2RlVHlwZQBzZXRMYWJlbGluZ01vZGUAZ2V0TGFiZWxpbmdNb2RlAHNldEltYWdlUHJvY01vZGUAZ2V0SW1hZ2VQcm9jTW9kZQBFUlJPUl9BUkNPTlRST0xMRVJfTk9UX0ZPVU5EAEVSUk9SX01VTFRJTUFSS0VSX05PVF9GT1VORABFUlJPUl9NQVJLRVJfSU5ERVhfT1VUX09GX0JPVU5EUwBBUl9ERUJVR19ESVNBQkxFAEFSX0RFQlVHX0VOQUJMRQBBUl9ERUZBVUxUX0RFQlVHX01PREUAQVJfTEFCRUxJTkdfV0hJVEVfUkVHSU9OAEFSX0xBQkVMSU5HX0JMQUNLX1JFR0lPTgBBUl9ERUZBVUxUX0xBQkVMSU5HX01PREUAQVJfREVGQVVMVF9MQUJFTElOR19USFJFU0gAQVJfSU1BR0VfUFJPQ19GUkFNRV9JTUFHRQBBUl9JTUFHRV9QUk9DX0ZJRUxEX0lNQUdFAEFSX0RFRkFVTFRfSU1BR0VfUFJPQ19NT0RFAEFSX1RFTVBMQVRFX01BVENISU5HX0NPTE9SAEFSX1RFTVBMQVRFX01BVENISU5HX01PTk8AQVJfTUFUUklYX0NPREVfREVURUNUSU9OAEFSX1RFTVBMQVRFX01BVENISU5HX0NPTE9SX0FORF9NQVRSSVgAQVJfVEVNUExBVEVfTUFUQ0hJTkdfTU9OT19BTkRfTUFUUklYAEFSX0RFRkFVTFRfUEFUVEVSTl9ERVRFQ1RJT05fTU9ERQBBUl9VU0VfVFJBQ0tJTkdfSElTVE9SWQBBUl9OT1VTRV9UUkFDS0lOR19ISVNUT1JZAEFSX1VTRV9UUkFDS0lOR19ISVNUT1JZX1YyAEFSX0RFRkFVTFRfTUFSS0VSX0VYVFJBQ1RJT05fTU9ERQBBUl9NQVhfTE9PUF9DT1VOVABBUl9MT09QX0JSRUFLX1RIUkVTSABBUl9MT0dfTEVWRUxfREVCVUcAQVJfTE9HX0xFVkVMX0lORk8AQVJfTE9HX0xFVkVMX1dBUk4AQVJfTE9HX0xFVkVMX0VSUk9SAEFSX0xPR19MRVZFTF9SRUxfSU5GTwBBUl9NQVRSSVhfQ09ERV8zeDMAQVJfTUFUUklYX0NPREVfM3gzX0hBTU1JTkc2MwBBUl9NQVRSSVhfQ09ERV8zeDNfUEFSSVRZNjUAQVJfTUFUUklYX0NPREVfNHg0AEFSX01BVFJJWF9DT0RFXzR4NF9CQ0hfMTNfOV8zAEFSX01BVFJJWF9DT0RFXzR4NF9CQ0hfMTNfNV81AEFSX0xBQkVMSU5HX1RIUkVTSF9NT0RFX01BTlVBTABBUl9MQUJFTElOR19USFJFU0hfTU9ERV9BVVRPX01FRElBTgBBUl9MQUJFTElOR19USFJFU0hfTU9ERV9BVVRPX09UU1UAQVJfTEFCRUxJTkdfVEhSRVNIX01PREVfQVVUT19BREFQVElWRQBBUl9NQVJLRVJfSU5GT19DVVRPRkZfUEhBU0VfTk9ORQBBUl9NQVJLRVJfSU5GT19DVVRPRkZfUEhBU0VfUEFUVEVSTl9FWFRSQUNUSU9OAEFSX01BUktFUl9JTkZPX0NVVE9GRl9QSEFTRV9NQVRDSF9HRU5FUklDAEFSX01BUktFUl9JTkZPX0NVVE9GRl9QSEFTRV9NQVRDSF9DT05UUkFTVABBUl9NQVJLRVJfSU5GT19DVVRPRkZfUEhBU0VfTUFUQ0hfQkFSQ09ERV9OT1RfRk9VTkQAQVJfTUFSS0VSX0lORk9fQ1VUT0ZGX1BIQVNFX01BVENIX0JBUkNPREVfRURDX0ZBSUwAQVJfTUFSS0VSX0lORk9fQ1VUT0ZGX1BIQVNFX01BVENIX0NPTkZJREVOQ0UAQVJfTUFSS0VSX0lORk9fQ1VUT0ZGX1BIQVNFX1BPU0VfRVJST1IAQVJfTUFSS0VSX0lORk9fQ1VUT0ZGX1BIQVNFX1BPU0VfRVJST1JfTVVMVEkAQVJfTUFSS0VSX0lORk9fQ1VUT0ZGX1BIQVNFX0hFVVJJU1RJQ19UUk9VQkxFU09NRV9NQVRSSVhfQ09ERVMAYWxsb2NhdG9yPFQ+OjphbGxvY2F0ZShzaXplX3QgbikgJ24nIGV4Y2VlZHMgbWF4aW11bSBzdXBwb3J0ZWQgc2l6ZQBJbWFnZSBwcm9jLiBtb2RlIHNldCB0byAlZC4KAExhYmVsaW5nIG1vZGUgc2V0IHRvICVkCgB2aWlmAFBhdHRlcm4gcmF0aW8gc2l6ZSBzZXQgdG8gJWYuCgBQYXR0ZXJuIGRldGVjdGlvbiBtb2RlIHNldCB0byAlZC4KAFRocmVzaG9sZCBzZXQgdG8gJWQKAHZpaWkAVGhyZXNob2xkIG1vZGUgc2V0IHRvICVkCgBkaWkAdmlpZABpaQB2aWkAb24uAG9mZi4ARGVidWcgbW9kZSBzZXQgdG8gJXMKAFRyYWNraW5nIGxvc3QuICVkCgBUcmFja2VkIHBhZ2UgJWQgKG1heCAlZCkuCgB7IHZhciAkYSA9IGFyZ3VtZW50czsgdmFyIGkgPSAwOyBpZiAoIWFydG9vbGtpdFsiTkZUTWFya2VySW5mbyJdKSB7IGFydG9vbGtpdFsiTkZUTWFya2VySW5mbyJdID0gKHsgaWQ6IDAsIGVycm9yOiAtMSwgZm91bmQ6IDAsIHBvc2U6IFswLDAsMCwwLCAwLDAsMCwwLCAwLDAsMCwwXSB9KTsgfSB2YXIgbWFya2VySW5mbyA9IGFydG9vbGtpdFsiTkZUTWFya2VySW5mbyJdOyBtYXJrZXJJbmZvWyJpZCJdID0gJGFbaSsrXTsgbWFya2VySW5mb1siZXJyb3IiXSA9ICRhW2krK107IG1hcmtlckluZm9bImZvdW5kIl0gPSAxOyBtYXJrZXJJbmZvWyJwb3NlIl1bMF0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJwb3NlIl1bMV0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJwb3NlIl1bMl0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJwb3NlIl1bM10gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJwb3NlIl1bNF0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJwb3NlIl1bNV0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJwb3NlIl1bNl0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJwb3NlIl1bN10gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJwb3NlIl1bOF0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJwb3NlIl1bOV0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJwb3NlIl1bMTBdID0gJGFbaSsrXTsgbWFya2VySW5mb1sicG9zZSJdWzExXSA9ICRhW2krK107IH0AeyB2YXIgJGEgPSBhcmd1bWVudHM7IHZhciBpID0gMDsgaWYgKCFhcnRvb2xraXRbIk5GVE1hcmtlckluZm8iXSkgeyBhcnRvb2xraXRbIk5GVE1hcmtlckluZm8iXSA9ICh7IGlkOiAwLCBlcnJvcjogLTEsIGZvdW5kOiAwLCBwb3NlOiBbMCwwLDAsMCwgMCwwLDAsMCwgMCwwLDAsMF0gfSk7IH0gdmFyIG1hcmtlckluZm8gPSBhcnRvb2xraXRbIk5GVE1hcmtlckluZm8iXTsgbWFya2VySW5mb1siaWQiXSA9ICRhW2krK107IG1hcmtlckluZm9bImVycm9yIl0gPSAtMTsgbWFya2VySW5mb1siZm91bmQiXSA9IDA7IG1hcmtlckluZm9bInBvc2UiXVswXSA9IDA7IG1hcmtlckluZm9bInBvc2UiXVsxXSA9IDA7IG1hcmtlckluZm9bInBvc2UiXVsyXSA9IDA7IG1hcmtlckluZm9bInBvc2UiXVszXSA9IDA7IG1hcmtlckluZm9bInBvc2UiXVs0XSA9IDA7IG1hcmtlckluZm9bInBvc2UiXVs1XSA9IDA7IG1hcmtlckluZm9bInBvc2UiXVs2XSA9IDA7IG1hcmtlckluZm9bInBvc2UiXVs3XSA9IDA7IG1hcmtlckluZm9bInBvc2UiXVs4XSA9IDA7IG1hcmtlckluZm9bInBvc2UiXVs5XSA9IDA7IG1hcmtlckluZm9bInBvc2UiXVsxMF0gPSAwOyBtYXJrZXJJbmZvWyJwb3NlIl1bMTFdID0gMDsgfQB7IHZhciAkYSA9IGFyZ3VtZW50czsgdmFyIGkgPSAxMjsgaWYgKCFhcnRvb2xraXRbIm1hcmtlckluZm8iXSkgeyBhcnRvb2xraXRbIm1hcmtlckluZm8iXSA9ICh7IHBvczogWzAsMF0sIGxpbmU6IFtbMCwwLDBdLCBbMCwwLDBdLCBbMCwwLDBdLCBbMCwwLDBdXSwgdmVydGV4OiBbWzAsMF0sIFswLDBdLCBbMCwwXSwgWzAsMF1dIH0pOyB9IHZhciBtYXJrZXJJbmZvID0gYXJ0b29sa2l0WyJtYXJrZXJJbmZvIl07IG1hcmtlckluZm9bImFyZWEiXSA9ICQwOyBtYXJrZXJJbmZvWyJpZCJdID0gJDE7IG1hcmtlckluZm9bImlkUGF0dCJdID0gJDI7IG1hcmtlckluZm9bImlkTWF0cml4Il0gPSAkMzsgbWFya2VySW5mb1siZGlyIl0gPSAkNDsgbWFya2VySW5mb1siZGlyUGF0dCJdID0gJDU7IG1hcmtlckluZm9bImRpck1hdHJpeCJdID0gJDY7IG1hcmtlckluZm9bImNmIl0gPSAkNzsgbWFya2VySW5mb1siY2ZQYXR0Il0gPSAkODsgbWFya2VySW5mb1siY2ZNYXRyaXgiXSA9ICQ5OyBtYXJrZXJJbmZvWyJwb3MiXVswXSA9ICQxMDsgbWFya2VySW5mb1sicG9zIl1bMV0gPSAkMTE7IG1hcmtlckluZm9bImxpbmUiXVswXVswXSA9ICRhW2krK107IG1hcmtlckluZm9bImxpbmUiXVswXVsxXSA9ICRhW2krK107IG1hcmtlckluZm9bImxpbmUiXVswXVsyXSA9ICRhW2krK107IG1hcmtlckluZm9bImxpbmUiXVsxXVswXSA9ICRhW2krK107IG1hcmtlckluZm9bImxpbmUiXVsxXVsxXSA9ICRhW2krK107IG1hcmtlckluZm9bImxpbmUiXVsxXVsyXSA9ICRhW2krK107IG1hcmtlckluZm9bImxpbmUiXVsyXVswXSA9ICRhW2krK107IG1hcmtlckluZm9bImxpbmUiXVsyXVsxXSA9ICRhW2krK107IG1hcmtlckluZm9bImxpbmUiXVsyXVsyXSA9ICRhW2krK107IG1hcmtlckluZm9bImxpbmUiXVszXVswXSA9ICRhW2krK107IG1hcmtlckluZm9bImxpbmUiXVszXVsxXSA9ICRhW2krK107IG1hcmtlckluZm9bImxpbmUiXVszXVsyXSA9ICRhW2krK107IG1hcmtlckluZm9bInZlcnRleCJdWzBdWzBdID0gJGFbaSsrXTsgbWFya2VySW5mb1sidmVydGV4Il1bMF1bMV0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJ2ZXJ0ZXgiXVsxXVswXSA9ICRhW2krK107IG1hcmtlckluZm9bInZlcnRleCJdWzFdWzFdID0gJGFbaSsrXTsgbWFya2VySW5mb1sidmVydGV4Il1bMl1bMF0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJ2ZXJ0ZXgiXVsyXVsxXSA9ICRhW2krK107IG1hcmtlckluZm9bInZlcnRleCJdWzNdWzBdID0gJGFbaSsrXTsgbWFya2VySW5mb1sidmVydGV4Il1bM11bMV0gPSAkYVtpKytdOyBtYXJrZXJJbmZvWyJlcnJvckNvcnJlY3RlZCJdID0gJGFbaSsrXTsgfQB7IGlmICghYXJ0b29sa2l0WyJtdWx0aUVhY2hNYXJrZXJJbmZvIl0pIHsgYXJ0b29sa2l0WyJtdWx0aUVhY2hNYXJrZXJJbmZvIl0gPSAoe30pOyB9IHZhciBtdWx0aUVhY2hNYXJrZXIgPSBhcnRvb2xraXRbIm11bHRpRWFjaE1hcmtlckluZm8iXTsgbXVsdGlFYWNoTWFya2VyWyd2aXNpYmxlJ10gPSAkMDsgbXVsdGlFYWNoTWFya2VyWydwYXR0SWQnXSA9ICQxOyBtdWx0aUVhY2hNYXJrZXJbJ3BhdHRUeXBlJ10gPSAkMjsgbXVsdGlFYWNoTWFya2VyWyd3aWR0aCddID0gJDM7IH0AaWlpAE5TdDNfXzIxMmJhc2ljX3N0cmluZ0ljTlNfMTFjaGFyX3RyYWl0c0ljRUVOU185YWxsb2NhdG9ySWNFRUVFAE5TdDNfXzIyMV9fYmFzaWNfc3RyaW5nX2NvbW1vbklMYjFFRUUAbG9hZENhbWVyYSgpOiBFcnJvciBsb2FkaW5nIHBhcmFtZXRlciBmaWxlICVzIGZvciBjYW1lcmEuCgBpaWlpAEFSVG9vbEtpdEpTKCk6IFVuYWJsZSB0byBzZXQgdXAgTkZUIG1hcmtlci4KAFJlYWRpbmcgJXMuZnNldDMKAGZzZXQzAEVycm9yIHJlYWRpbmcgS1BNIGRhdGEgZnJvbSAlcy5mc2V0MwoAICBBc3NpZ25lZCBwYWdlIG5vLiAlZC4KAEVycm9yOiBrcG1DaGFuZ2VQYWdlTm9PZlJlZkRhdGFTZXQKAEVycm9yOiBrcG1NZXJnZVJlZkRhdGFTZXQKACAgRG9uZS4KAFJlYWRpbmcgJXMuZnNldAoAZnNldABFcnJvciByZWFkaW5nIGRhdGEgZnJvbSAlcy5mc2V0CgBFcnJvcjoga3BtU2V0UmVmRGF0YVNldAoATG9hZGluZyBvZiBORlQgZGF0YSBjb21wbGV0ZS4KAEFSVG9vbEtpdEpTKCk6IFVuYWJsZSB0byBzZXQgdXAgQVIgbXVsdGltYXJrZXIuCgBjb25maWcgZGF0YSBsb2FkIGVycm9yICEhCgBBUlRvb2xLaXRKUygpOiBVbmFibGUgdG8gc2V0IHVwIEFSIG1hcmtlci4KAGxvYWRNYXJrZXIoKTogRXJyb3IgbG9hZGluZyBwYXR0ZXJuIGZpbGUgJXMuCgBFcnJvcjogYXIyQ3JlYXRlSGFuZGxlLgoAaWlpaWkAc2V0dXAoKTogRXJyb3I6IGFyUGF0dENyZWF0ZUhhbmRsZS4KAEFsbG9jYXRlZCB2aWRlb0ZyYW1lU2l6ZSAlZAoAeyBpZiAoIWFydG9vbGtpdFsiZnJhbWVNYWxsb2MiXSkgeyBhcnRvb2xraXRbImZyYW1lTWFsbG9jIl0gPSAoe30pOyB9IHZhciBmcmFtZU1hbGxvYyA9IGFydG9vbGtpdFsiZnJhbWVNYWxsb2MiXTsgZnJhbWVNYWxsb2NbImZyYW1lcG9pbnRlciJdID0gJDE7IGZyYW1lTWFsbG9jWyJmcmFtZXNpemUiXSA9ICQyOyBmcmFtZU1hbGxvY1siY2FtZXJhIl0gPSAkMzsgZnJhbWVNYWxsb2NbInRyYW5zZm9ybSJdID0gJDQ7IGZyYW1lTWFsbG9jWyJ2aWRlb0x1bWFQb2ludGVyIl0gPSAkNTsgfQAqKiogQ2FtZXJhIFBhcmFtZXRlciByZXNpemVkIGZyb20gJWQsICVkLiAqKioKAHNldENhbWVyYSgpOiBFcnJvcjogYXJQYXJhbUxUQ3JlYXRlLgoAc2V0Q2FtZXJhKCk6IEVycm9yOiBhckNyZWF0ZUhhbmRsZS4KAHNldENhbWVyYSgpOiBFcnJvciBjcmVhdGluZyAzRCBoYW5kbGUAT3V0IG9mIG1lbW9yeSEhCgBFcnJvcjogbWFsbG9jCgAjIyMgRmVhdHVyZSBjYW5kaWRhdGVzIGZvciB0cmFja2luZyBhcmUgb3ZlcmZsb3cuCgBCb2d1cyBtZXNzYWdlIGNvZGUgJWQAQUxJR05fVFlQRSBpcyB3cm9uZywgcGxlYXNlIGZpeABNQVhfQUxMT0NfQ0hVTksgaXMgd3JvbmcsIHBsZWFzZSBmaXgAQm9ndXMgYnVmZmVyIGNvbnRyb2wgbW9kZQBJbnZhbGlkIGNvbXBvbmVudCBJRCAlZCBpbiBTT1MASW52YWxpZCBjcm9wIHJlcXVlc3QARENUIGNvZWZmaWNpZW50IG91dCBvZiByYW5nZQBEQ1Qgc2NhbGVkIGJsb2NrIHNpemUgJWR4JWQgbm90IHN1cHBvcnRlZABDb21wb25lbnQgaW5kZXggJWQ6IG1pc21hdGNoaW5nIHNhbXBsaW5nIHJhdGlvICVkOiVkLCAlZDolZCwgJWMAQm9ndXMgSHVmZm1hbiB0YWJsZSBkZWZpbml0aW9uAEJvZ3VzIGlucHV0IGNvbG9yc3BhY2UAQm9ndXMgSlBFRyBjb2xvcnNwYWNlAEJvZ3VzIG1hcmtlciBsZW5ndGgAV3JvbmcgSlBFRyBsaWJyYXJ5IHZlcnNpb246IGxpYnJhcnkgaXMgJWQsIGNhbGxlciBleHBlY3RzICVkAFNhbXBsaW5nIGZhY3RvcnMgdG9vIGxhcmdlIGZvciBpbnRlcmxlYXZlZCBzY2FuAEludmFsaWQgbWVtb3J5IHBvb2wgY29kZSAlZABVbnN1cHBvcnRlZCBKUEVHIGRhdGEgcHJlY2lzaW9uICVkAEludmFsaWQgcHJvZ3Jlc3NpdmUgcGFyYW1ldGVycyBTcz0lZCBTZT0lZCBBaD0lZCBBbD0lZABJbnZhbGlkIHByb2dyZXNzaXZlIHBhcmFtZXRlcnMgYXQgc2NhbiBzY3JpcHQgZW50cnkgJWQAQm9ndXMgc2FtcGxpbmcgZmFjdG9ycwBJbnZhbGlkIHNjYW4gc2NyaXB0IGF0IGVudHJ5ICVkAEltcHJvcGVyIGNhbGwgdG8gSlBFRyBsaWJyYXJ5IGluIHN0YXRlICVkAEpQRUcgcGFyYW1ldGVyIHN0cnVjdCBtaXNtYXRjaDogbGlicmFyeSB0aGlua3Mgc2l6ZSBpcyAldSwgY2FsbGVyIGV4cGVjdHMgJXUAQm9ndXMgdmlydHVhbCBhcnJheSBhY2Nlc3MAQnVmZmVyIHBhc3NlZCB0byBKUEVHIGxpYnJhcnkgaXMgdG9vIHNtYWxsAFN1c3BlbnNpb24gbm90IGFsbG93ZWQgaGVyZQBDQ0lSNjAxIHNhbXBsaW5nIG5vdCBpbXBsZW1lbnRlZCB5ZXQAVG9vIG1hbnkgY29sb3IgY29tcG9uZW50czogJWQsIG1heCAlZABVbnN1cHBvcnRlZCBjb2xvciBjb252ZXJzaW9uIHJlcXVlc3QAQm9ndXMgREFDIGluZGV4ICVkAEJvZ3VzIERBQyB2YWx1ZSAweCV4AEJvZ3VzIERIVCBpbmRleCAlZABCb2d1cyBEUVQgaW5kZXggJWQARW1wdHkgSlBFRyBpbWFnZSAoRE5MIG5vdCBzdXBwb3J0ZWQpAFJlYWQgZnJvbSBFTVMgZmFpbGVkAFdyaXRlIHRvIEVNUyBmYWlsZWQARGlkbid0IGV4cGVjdCBtb3JlIHRoYW4gb25lIHNjYW4ASW5wdXQgZmlsZSByZWFkIGVycm9yAE91dHB1dCBmaWxlIHdyaXRlIGVycm9yIC0tLSBvdXQgb2YgZGlzayBzcGFjZT8ARnJhY3Rpb25hbCBzYW1wbGluZyBub3QgaW1wbGVtZW50ZWQgeWV0AEh1ZmZtYW4gY29kZSBzaXplIHRhYmxlIG92ZXJmbG93AE1pc3NpbmcgSHVmZm1hbiBjb2RlIHRhYmxlIGVudHJ5AE1heGltdW0gc3VwcG9ydGVkIGltYWdlIGRpbWVuc2lvbiBpcyAldSBwaXhlbHMARW1wdHkgaW5wdXQgZmlsZQBQcmVtYXR1cmUgZW5kIG9mIGlucHV0IGZpbGUAQ2Fubm90IHRyYW5zY29kZSBkdWUgdG8gbXVsdGlwbGUgdXNlIG9mIHF1YW50aXphdGlvbiB0YWJsZSAlZABTY2FuIHNjcmlwdCBkb2VzIG5vdCB0cmFuc21pdCBhbGwgZGF0YQBJbnZhbGlkIGNvbG9yIHF1YW50aXphdGlvbiBtb2RlIGNoYW5nZQBOb3QgaW1wbGVtZW50ZWQgeWV0AFJlcXVlc3RlZCBmZWF0dXJlIHdhcyBvbWl0dGVkIGF0IGNvbXBpbGUgdGltZQBBcml0aG1ldGljIHRhYmxlIDB4JTAyeCB3YXMgbm90IGRlZmluZWQAQmFja2luZyBzdG9yZSBub3Qgc3VwcG9ydGVkAEh1ZmZtYW4gdGFibGUgMHglMDJ4IHdhcyBub3QgZGVmaW5lZABKUEVHIGRhdGFzdHJlYW0gY29udGFpbnMgbm8gaW1hZ2UAUXVhbnRpemF0aW9uIHRhYmxlIDB4JTAyeCB3YXMgbm90IGRlZmluZWQATm90IGEgSlBFRyBmaWxlOiBzdGFydHMgd2l0aCAweCUwMnggMHglMDJ4AEluc3VmZmljaWVudCBtZW1vcnkgKGNhc2UgJWQpAENhbm5vdCBxdWFudGl6ZSBtb3JlIHRoYW4gJWQgY29sb3IgY29tcG9uZW50cwBDYW5ub3QgcXVhbnRpemUgdG8gZmV3ZXIgdGhhbiAlZCBjb2xvcnMAQ2Fubm90IHF1YW50aXplIHRvIG1vcmUgdGhhbiAlZCBjb2xvcnMASW52YWxpZCBKUEVHIGZpbGUgc3RydWN0dXJlOiAlcyBiZWZvcmUgU09GAEludmFsaWQgSlBFRyBmaWxlIHN0cnVjdHVyZTogdHdvIFNPRiBtYXJrZXJzAEludmFsaWQgSlBFRyBmaWxlIHN0cnVjdHVyZTogbWlzc2luZyBTT1MgbWFya2VyAFVuc3VwcG9ydGVkIEpQRUcgcHJvY2VzczogU09GIHR5cGUgMHglMDJ4AEludmFsaWQgSlBFRyBmaWxlIHN0cnVjdHVyZTogdHdvIFNPSSBtYXJrZXJzAEZhaWxlZCB0byBjcmVhdGUgdGVtcG9yYXJ5IGZpbGUgJXMAUmVhZCBmYWlsZWQgb24gdGVtcG9yYXJ5IGZpbGUAU2VlayBmYWlsZWQgb24gdGVtcG9yYXJ5IGZpbGUAV3JpdGUgZmFpbGVkIG9uIHRlbXBvcmFyeSBmaWxlIC0tLSBvdXQgb2YgZGlzayBzcGFjZT8AQXBwbGljYXRpb24gdHJhbnNmZXJyZWQgdG9vIGZldyBzY2FubGluZXMAVW5zdXBwb3J0ZWQgbWFya2VyIHR5cGUgMHglMDJ4AFZpcnR1YWwgYXJyYXkgY29udHJvbGxlciBtZXNzZWQgdXAASW1hZ2UgdG9vIHdpZGUgZm9yIHRoaXMgaW1wbGVtZW50YXRpb24AUmVhZCBmcm9tIFhNUyBmYWlsZWQAV3JpdGUgdG8gWE1TIGZhaWxlZABDb3B5cmlnaHQgKEMpIDIwMTgsIFRob21hcyBHLiBMYW5lLCBHdWlkbyBWb2xsYmVkaW5nADljICAxNC1KYW4tMjAxOABDYXV0aW9uOiBxdWFudGl6YXRpb24gdGFibGVzIGFyZSB0b28gY29hcnNlIGZvciBiYXNlbGluZSBKUEVHAEFkb2JlIEFQUDE0IG1hcmtlcjogdmVyc2lvbiAlZCwgZmxhZ3MgMHglMDR4IDB4JTA0eCwgdHJhbnNmb3JtICVkAFVua25vd24gQVBQMCBtYXJrZXIgKG5vdCBKRklGKSwgbGVuZ3RoICV1AFVua25vd24gQVBQMTQgbWFya2VyIChub3QgQWRvYmUpLCBsZW5ndGggJXUARGVmaW5lIEFyaXRobWV0aWMgVGFibGUgMHglMDJ4OiAweCUwMngARGVmaW5lIEh1ZmZtYW4gVGFibGUgMHglMDJ4AERlZmluZSBRdWFudGl6YXRpb24gVGFibGUgJWQgIHByZWNpc2lvbiAlZABEZWZpbmUgUmVzdGFydCBJbnRlcnZhbCAldQBGcmVlZCBFTVMgaGFuZGxlICV1AE9idGFpbmVkIEVNUyBoYW5kbGUgJXUARW5kIE9mIEltYWdlACAgICAgICAgJTNkICUzZCAlM2QgJTNkICUzZCAlM2QgJTNkICUzZABKRklGIEFQUDAgbWFya2VyOiB2ZXJzaW9uICVkLiUwMmQsIGRlbnNpdHkgJWR4JWQgICVkAFdhcm5pbmc6IHRodW1ibmFpbCBpbWFnZSBzaXplIGRvZXMgbm90IG1hdGNoIGRhdGEgbGVuZ3RoICV1AEpGSUYgZXh0ZW5zaW9uIG1hcmtlcjogdHlwZSAweCUwMngsIGxlbmd0aCAldQAgICAgd2l0aCAlZCB4ICVkIHRodW1ibmFpbCBpbWFnZQBNaXNjZWxsYW5lb3VzIG1hcmtlciAweCUwMngsIGxlbmd0aCAldQBVbmV4cGVjdGVkIG1hcmtlciAweCUwMngAICAgICAgICAlNHUgJTR1ICU0dSAlNHUgJTR1ICU0dSAlNHUgJTR1AFF1YW50aXppbmcgdG8gJWQgPSAlZColZColZCBjb2xvcnMAUXVhbnRpemluZyB0byAlZCBjb2xvcnMAU2VsZWN0ZWQgJWQgY29sb3JzIGZvciBxdWFudGl6YXRpb24AQXQgbWFya2VyIDB4JTAyeCwgcmVjb3ZlcnkgYWN0aW9uICVkAFJTVCVkAFNtb290aGluZyBub3Qgc3VwcG9ydGVkIHdpdGggbm9uc3RhbmRhcmQgc2FtcGxpbmcgcmF0aW9zAFN0YXJ0IE9mIEZyYW1lIDB4JTAyeDogd2lkdGg9JXUsIGhlaWdodD0ldSwgY29tcG9uZW50cz0lZAAgICAgQ29tcG9uZW50ICVkOiAlZGh4JWR2IHE9JWQAU3RhcnQgb2YgSW1hZ2UAU3RhcnQgT2YgU2NhbjogJWQgY29tcG9uZW50cwAgICAgQ29tcG9uZW50ICVkOiBkYz0lZCBhYz0lZAAgIFNzPSVkLCBTZT0lZCwgQWg9JWQsIEFsPSVkAENsb3NlZCB0ZW1wb3JhcnkgZmlsZSAlcwBPcGVuZWQgdGVtcG9yYXJ5IGZpbGUgJXMASkZJRiBleHRlbnNpb24gbWFya2VyOiBKUEVHLWNvbXByZXNzZWQgdGh1bWJuYWlsIGltYWdlLCBsZW5ndGggJXUASkZJRiBleHRlbnNpb24gbWFya2VyOiBwYWxldHRlIHRodW1ibmFpbCBpbWFnZSwgbGVuZ3RoICV1AEpGSUYgZXh0ZW5zaW9uIG1hcmtlcjogUkdCIHRodW1ibmFpbCBpbWFnZSwgbGVuZ3RoICV1AFVucmVjb2duaXplZCBjb21wb25lbnQgSURzICVkICVkICVkLCBhc3N1bWluZyBZQ2JDcgBGcmVlZCBYTVMgaGFuZGxlICV1AE9idGFpbmVkIFhNUyBoYW5kbGUgJXUAVW5rbm93biBBZG9iZSBjb2xvciB0cmFuc2Zvcm0gY29kZSAlZABDb3JydXB0IEpQRUcgZGF0YTogYmFkIGFyaXRobWV0aWMgY29kZQBJbmNvbnNpc3RlbnQgcHJvZ3Jlc3Npb24gc2VxdWVuY2UgZm9yIGNvbXBvbmVudCAlZCBjb2VmZmljaWVudCAlZABDb3JydXB0IEpQRUcgZGF0YTogJXUgZXh0cmFuZW91cyBieXRlcyBiZWZvcmUgbWFya2VyIDB4JTAyeABDb3JydXB0IEpQRUcgZGF0YTogcHJlbWF0dXJlIGVuZCBvZiBkYXRhIHNlZ21lbnQAQ29ycnVwdCBKUEVHIGRhdGE6IGJhZCBIdWZmbWFuIGNvZGUAV2FybmluZzogdW5rbm93biBKRklGIHJldmlzaW9uIG51bWJlciAlZC4lMDJkAFByZW1hdHVyZSBlbmQgb2YgSlBFRyBmaWxlAENvcnJ1cHQgSlBFRyBkYXRhOiBmb3VuZCBtYXJrZXIgMHglMDJ4IGluc3RlYWQgb2YgUlNUJWQASW52YWxpZCBTT1MgcGFyYW1ldGVycyBmb3Igc2VxdWVudGlhbCBKUEVHAEFwcGxpY2F0aW9uIHRyYW5zZmVycmVkIHRvbyBtYW55IHNjYW5saW5lcwBTT1MATFNFAEpQRUdNRU0AJWxkJWMAJXMKAAABAgQHAwYFAC0rICAgMFgweAAobnVsbCkALTBYKzBYIDBYLTB4KzB4IDB4AGluZgBJTkYATkFOAC4AaW5maW5pdHkAbmFuAExDX0FMTABMQU5HAEMuVVRGLTgAUE9TSVgATVVTTF9MT0NQQVRIAHJ3YQB0ZXJtaW5hdGluZyB3aXRoICVzIGV4Y2VwdGlvbiBvZiB0eXBlICVzOiAlcwB0ZXJtaW5hdGluZyB3aXRoICVzIGV4Y2VwdGlvbiBvZiB0eXBlICVzAHRlcm1pbmF0aW5nIHdpdGggJXMgZm9yZWlnbiBleGNlcHRpb24AdGVybWluYXRpbmcAdW5jYXVnaHQAU3Q5ZXhjZXB0aW9uAE4xMF9fY3h4YWJpdjExNl9fc2hpbV90eXBlX2luZm9FAFN0OXR5cGVfaW5mbwBOMTBfX2N4eGFiaXYxMjBfX3NpX2NsYXNzX3R5cGVfaW5mb0UATjEwX19jeHhhYml2MTE3X19jbGFzc190eXBlX2luZm9FAHRlcm1pbmF0ZV9oYW5kbGVyIHVuZXhwZWN0ZWRseSByZXR1cm5lZABTdDExbG9naWNfZXJyb3IAU3QxMmxlbmd0aF9lcnJvcgBOMTBfX2N4eGFiaXYxMTdfX3BiYXNlX3R5cGVfaW5mb0UATjEwX19jeHhhYml2MTE5X19wb2ludGVyX3R5cGVfaW5mb0UATjEwX19jeHhhYml2MTIzX19mdW5kYW1lbnRhbF90eXBlX2luZm9FAHYAYgBjAGgAYQBzAHQAaQBqAG0AZgBkAE4xMF9fY3h4YWJpdjEyMV9fdm1pX2NsYXNzX3R5cGVfaW5mb0UAdm9pZABib29sAGNoYXIAc2lnbmVkIGNoYXIAdW5zaWduZWQgY2hhcgBzaG9ydAB1bnNpZ25lZCBzaG9ydABpbnQAdW5zaWduZWQgaW50AGxvbmcAdW5zaWduZWQgbG9uZwBmbG9hdABkb3VibGUAc3RkOjpzdHJpbmcAc3RkOjpiYXNpY19zdHJpbmc8dW5zaWduZWQgY2hhcj4Ac3RkOjp3c3RyaW5nAGVtc2NyaXB0ZW46OnZhbABlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxjaGFyPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxzaWduZWQgY2hhcj4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dW5zaWduZWQgY2hhcj4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8c2hvcnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIHNob3J0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIGludD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8bG9uZz4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dW5zaWduZWQgbG9uZz4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50OF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50OF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50MTZfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50MzJfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dWludDMyX3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGZsb2F0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxkb3VibGU+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGxvbmcgZG91YmxlPgBOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0llRUUATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJZEVFAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWZFRQBOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0ltRUUATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJbEVFAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWpFRQBOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lpRUUATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJdEVFAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SXNFRQBOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0loRUUATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJYUVFAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWNFRQBOMTBlbXNjcmlwdGVuM3ZhbEUATlN0M19fMjEyYmFzaWNfc3RyaW5nSXdOU18xMWNoYXJfdHJhaXRzSXdFRU5TXzlhbGxvY2F0b3JJd0VFRUUATlN0M19fMjEyYmFzaWNfc3RyaW5nSWhOU18xMWNoYXJfdHJhaXRzSWhFRU5TXzlhbGxvY2F0b3JJaEVFRUUATlN0M19fMjhpb3NfYmFzZUUATlN0M19fMjliYXNpY19pb3NJY05TXzExY2hhcl90cmFpdHNJY0VFRUUATlN0M19fMjliYXNpY19pb3NJd05TXzExY2hhcl90cmFpdHNJd0VFRUUATlN0M19fMjE1YmFzaWNfc3RyZWFtYnVmSWNOU18xMWNoYXJfdHJhaXRzSWNFRUVFAE5TdDNfXzIxNWJhc2ljX3N0cmVhbWJ1Zkl3TlNfMTFjaGFyX3RyYWl0c0l3RUVFRQBOU3QzX18yMTNiYXNpY19pc3RyZWFtSWNOU18xMWNoYXJfdHJhaXRzSWNFRUVFAE5TdDNfXzIxM2Jhc2ljX2lzdHJlYW1Jd05TXzExY2hhcl90cmFpdHNJd0VFRUUATlN0M19fMjEzYmFzaWNfb3N0cmVhbUljTlNfMTFjaGFyX3RyYWl0c0ljRUVFRQBOU3QzX18yMTNiYXNpY19vc3RyZWFtSXdOU18xMWNoYXJfdHJhaXRzSXdFRUVFAE5TdDNfXzIxMV9fc3Rkb3V0YnVmSXdFRQBOU3QzX18yMTFfX3N0ZG91dGJ1ZkljRUUAdW5zdXBwb3J0ZWQgbG9jYWxlIGZvciBzdGFuZGFyZCBpbnB1dABOU3QzX18yMTBfX3N0ZGluYnVmSXdFRQBOU3QzX18yMTBfX3N0ZGluYnVmSWNFRQBOU3QzX18yN2NvbGxhdGVJY0VFAE5TdDNfXzI2bG9jYWxlNWZhY2V0RQBOU3QzX18yN2NvbGxhdGVJd0VFACVwAEMATlN0M19fMjdudW1fZ2V0SWNOU18xOWlzdHJlYW1idWZfaXRlcmF0b3JJY05TXzExY2hhcl90cmFpdHNJY0VFRUVFRQBOU3QzX18yOV9fbnVtX2dldEljRUUATlN0M19fMjE0X19udW1fZ2V0X2Jhc2VFAE5TdDNfXzI3bnVtX2dldEl3TlNfMTlpc3RyZWFtYnVmX2l0ZXJhdG9ySXdOU18xMWNoYXJfdHJhaXRzSXdFRUVFRUUATlN0M19fMjlfX251bV9nZXRJd0VFACVwAAAAAEwAbGwAJQAAAAAAbABOU3QzX18yN251bV9wdXRJY05TXzE5b3N0cmVhbWJ1Zl9pdGVyYXRvckljTlNfMTFjaGFyX3RyYWl0c0ljRUVFRUVFAE5TdDNfXzI5X19udW1fcHV0SWNFRQBOU3QzX18yMTRfX251bV9wdXRfYmFzZUUATlN0M19fMjdudW1fcHV0SXdOU18xOW9zdHJlYW1idWZfaXRlcmF0b3JJd05TXzExY2hhcl90cmFpdHNJd0VFRUVFRQBOU3QzX18yOV9fbnVtX3B1dEl3RUUAJUg6JU06JVMAJW0vJWQvJXkAJUk6JU06JVMgJXAAJWEgJWIgJWQgJUg6JU06JVMgJVkAQU0AUE0ASmFudWFyeQBGZWJydWFyeQBNYXJjaABBcHJpbABNYXkASnVuZQBKdWx5AEF1Z3VzdABTZXB0ZW1iZXIAT2N0b2JlcgBOb3ZlbWJlcgBEZWNlbWJlcgBKYW4ARmViAE1hcgBBcHIASnVuAEp1bABBdWcAU2VwAE9jdABOb3YARGVjAFN1bmRheQBNb25kYXkAVHVlc2RheQBXZWRuZXNkYXkAVGh1cnNkYXkARnJpZGF5AFNhdHVyZGF5AFN1bgBNb24AVHVlAFdlZABUaHUARnJpAFNhdAAlbS8lZC8leSVZLSVtLSVkJUk6JU06JVMgJXAlSDolTSVIOiVNOiVTJUg6JU06JVNOU3QzX18yOHRpbWVfZ2V0SWNOU18xOWlzdHJlYW1idWZfaXRlcmF0b3JJY05TXzExY2hhcl90cmFpdHNJY0VFRUVFRQBOU3QzX18yMjBfX3RpbWVfZ2V0X2Nfc3RvcmFnZUljRUUATlN0M19fMjl0aW1lX2Jhc2VFAE5TdDNfXzI4dGltZV9nZXRJd05TXzE5aXN0cmVhbWJ1Zl9pdGVyYXRvckl3TlNfMTFjaGFyX3RyYWl0c0l3RUVFRUVFAE5TdDNfXzIyMF9fdGltZV9nZXRfY19zdG9yYWdlSXdFRQBOU3QzX18yOHRpbWVfcHV0SWNOU18xOW9zdHJlYW1idWZfaXRlcmF0b3JJY05TXzExY2hhcl90cmFpdHNJY0VFRUVFRQBOU3QzX18yMTBfX3RpbWVfcHV0RQBOU3QzX18yOHRpbWVfcHV0SXdOU18xOW9zdHJlYW1idWZfaXRlcmF0b3JJd05TXzExY2hhcl90cmFpdHNJd0VFRUVFRQBOU3QzX18yMTBtb25leXB1bmN0SWNMYjBFRUUATlN0M19fMjEwbW9uZXlfYmFzZUUATlN0M19fMjEwbW9uZXlwdW5jdEljTGIxRUVFAE5TdDNfXzIxMG1vbmV5cHVuY3RJd0xiMEVFRQBOU3QzX18yMTBtb25leXB1bmN0SXdMYjFFRUUAMDEyMzQ1Njc4OQAlTGYATlN0M19fMjltb25leV9nZXRJY05TXzE5aXN0cmVhbWJ1Zl9pdGVyYXRvckljTlNfMTFjaGFyX3RyYWl0c0ljRUVFRUVFAE5TdDNfXzIxMV9fbW9uZXlfZ2V0SWNFRQAwMTIzNDU2Nzg5AE5TdDNfXzI5bW9uZXlfZ2V0SXdOU18xOWlzdHJlYW1idWZfaXRlcmF0b3JJd05TXzExY2hhcl90cmFpdHNJd0VFRUVFRQBOU3QzX18yMTFfX21vbmV5X2dldEl3RUUAJS4wTGYATlN0M19fMjltb25leV9wdXRJY05TXzE5b3N0cmVhbWJ1Zl9pdGVyYXRvckljTlNfMTFjaGFyX3RyYWl0c0ljRUVFRUVFAE5TdDNfXzIxMV9fbW9uZXlfcHV0SWNFRQBOU3QzX18yOW1vbmV5X3B1dEl3TlNfMTlvc3RyZWFtYnVmX2l0ZXJhdG9ySXdOU18xMWNoYXJfdHJhaXRzSXdFRUVFRUUATlN0M19fMjExX19tb25leV9wdXRJd0VFAE5TdDNfXzI4bWVzc2FnZXNJY0VFAE5TdDNfXzIxM21lc3NhZ2VzX2Jhc2VFAE5TdDNfXzIxN19fd2lkZW5fZnJvbV91dGY4SUxtMzJFRUUATlN0M19fMjdjb2RlY3Z0SURpYzExX19tYnN0YXRlX3RFRQBOU3QzX18yMTJjb2RlY3Z0X2Jhc2VFAE5TdDNfXzIxNl9fbmFycm93X3RvX3V0ZjhJTG0zMkVFRQBOU3QzX18yOG1lc3NhZ2VzSXdFRQBOU3QzX18yN2NvZGVjdnRJY2MxMV9fbWJzdGF0ZV90RUUATlN0M19fMjdjb2RlY3Z0SXdjMTFfX21ic3RhdGVfdEVFAE5TdDNfXzI3Y29kZWN2dElEc2MxMV9fbWJzdGF0ZV90RUUATlN0M19fMjZsb2NhbGU1X19pbXBFAE5TdDNfXzI1Y3R5cGVJY0VFAE5TdDNfXzIxMGN0eXBlX2Jhc2VFAE5TdDNfXzI1Y3R5cGVJd0VFAGZhbHNlAHRydWUATlN0M19fMjhudW1wdW5jdEljRUUATlN0M19fMjhudW1wdW5jdEl3RUUATlN0M19fMjE0X19zaGFyZWRfY291bnRFAE5TdDNfXzIxOV9fc2hhcmVkX3dlYWtfY291bnRF";var tempDoublePtr=57872;function demangle(func){return func}function demangleAll(text){var regex=/\b__Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}var ENV={};function ___buildEnvironment(environ){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]="web_user";ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";ENV["_"]=thisProgram;poolPtr=getMemory(TOTAL_ENV_SIZE);envPtr=getMemory(MAX_ENV_VALUES*4);HEAP32[envPtr>>2]=poolPtr;HEAP32[environ>>2]=envPtr}else{envPtr=HEAP32[environ>>2];poolPtr=HEAP32[envPtr>>2]}var strings=[];var totalSize=0;for(var key in ENV){if(typeof ENV[key]==="string"){var line=key+"="+ENV[key];strings.push(line);totalSize+=line.length}}if(totalSize>TOTAL_ENV_SIZE){throw new Error("Environment size exceeded TOTAL_ENV_SIZE!")}var ptrSize=4;for(var i=0;i>2]=poolPtr;poolPtr+=line.length+1}HEAP32[envPtr+strings.length*ptrSize>>2]=0}function ___cxa_allocate_exception(size){return _malloc(size)}var ___exception_infos={};var ___exception_caught=[];function ___exception_addRef(ptr){if(!ptr)return;var info=___exception_infos[ptr];info.refcount++}function ___exception_deAdjust(adjusted){if(!adjusted||___exception_infos[adjusted])return adjusted;for(var key in ___exception_infos){var ptr=+key;var adj=___exception_infos[ptr].adjusted;var len=adj.length;for(var i=0;i>2]=value;return value}function ___map_file(pathname,size){___setErrNo(63);return-1}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};var MEMFS={ops_table:null,mount:function(mount){return MEMFS.createNode(null,"/",16384|511,0)},createNode:function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node}return node},getFileDataAsRegularArray:function(node){if(node.contents&&node.contents.subarray){var arr=[];for(var i=0;i=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);return},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0;return}if(!node.contents||node.contents.subarray){var oldContents=node.contents;node.contents=new Uint8Array(new ArrayBuffer(newSize));if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize;return}if(!node.contents)node.contents=[];if(node.contents.length>newSize)node.contents.length=newSize;else while(node.contents.length=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){if(!FS.FSNode){FS.FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};FS.FSNode.prototype={};var readMode=292|73;var writeMode=146;Object.defineProperties(FS.FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}})}var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},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){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.indexOf("r")!==-1&&!(node.mode&292)){return 2}else if(perms.indexOf("w")!==-1&&!(node.mode&146)){return 2}else if(perms.indexOf("x")!==-1&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var err=FS.nodePermissions(dir,"x");if(err)return err;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var err=FS.nodePermissions(dir,"wx");if(err){return err}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}})}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){console.log("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(err){FS.syncFSRequests--;return callback(err)}function done(err){if(err){if(!done.errored){done.errored=true;return doCallback(err)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.indexOf(current.mount)!==-1){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var err=FS.mayCreate(parent,name);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;console.log("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(29)}return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(29)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags){var buffer=new Uint8Array(HEAPU8.subarray(addr,addr+len));FS.msync(stream,buffer,0,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:0,get:function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(){var ret=UTF8ToString(SYSCALLS.get());return ret},getStreamFromFD:function(fd){if(fd===undefined)fd=SYSCALLS.get();var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(){var low=SYSCALLS.get(),high=SYSCALLS.get();return low},getZero:function(){SYSCALLS.get()}};function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),cmd=SYSCALLS.get();switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:___setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),op=SYSCALLS.get();switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_syscall_munmap(addr,len){if(addr===-1||len===0){return-28}var info=SYSCALLS.mappings[addr];if(!info)return 0;if(len===info.len){var stream=FS.getStream(info.fd);SYSCALLS.doMsync(addr,stream,len,info.flags);FS.munmap(stream);SYSCALLS.mappings[addr]=null;if(info.allocated){_free(info.malloc)}}return 0}function ___syscall91(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get();return __emscripten_syscall_munmap(addr,len)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___unlock(){}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function ___wasi_fd_close(){return _fd_close.apply(null,arguments)}function _fd_read(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function ___wasi_fd_read(){return _fd_read.apply(null,arguments)}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function ___wasi_fd_seek(){return _fd_seek.apply(null,arguments)}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function ___wasi_fd_write(){return _fd_write.apply(null,arguments)}function getShiftFromSize(size){switch(size){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+size)}}function embind_init_charCodes(){var codes=new Array(256);for(var i=0;i<256;++i){codes[i]=String.fromCharCode(i)}embind_charCodes=codes}var embind_charCodes=undefined;function readLatin1String(ptr){var ret="";var c=ptr;while(HEAPU8[c]){ret+=embind_charCodes[HEAPU8[c++]]}return ret}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}else{return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var BindingError=undefined;function throwBindingError(message){throw new BindingError(message)}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i>shift])},destructorFunction:null})}function __embind_register_constant(name,type,value){name=readLatin1String(name);whenDependentTypesAreResolved([],[type],function(type){type=type[0];Module[name]=type["fromWireType"](value);return[]})}var emval_free_list=[];var emval_handle_array=[{},{value:undefined},{value:null},{value:true},{value:false}];function __emval_decref(handle){if(handle>4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i>2])}function __embind_register_emval(rawType,name){name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(handle){var rv=emval_handle_array[handle].value;__emval_decref(handle);return rv},"toWireType":function(destructors,value){return __emval_register(value)},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:null})}function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function new_(constructor,argumentList){if(!(constructor instanceof Function)){throw new TypeError("new_ called with constructor type "+typeof constructor+" which is not a function")}var dummy=createNamedFunction(constructor.name||"unknownFunctionName",function(){});dummy.prototype=constructor.prototype;var obj=new dummy;var r=constructor.apply(obj,argumentList);return r instanceof Object?r:obj}function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function craftInvokerFunction(humanName,argTypes,classType,cppInvokerFunc,cppTargetFunc){var argCount=argTypes.length;if(argCount<2){throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!")}var isClassMethodFunc=argTypes[1]!==null&&classType!==null;var needsDestructorStack=false;for(var i=1;i0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i>2)+i])}return array}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function embind__requireFunction(signature,rawFunction){signature=readLatin1String(signature);function makeDynCaller(dynCall){var args=[];for(var i=1;i>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=function(value){return value};if(minRange===0){var bitshift=32-8*size;fromWireType=function(value){return value<>>bitshift}}var isUnsignedType=name.indexOf("unsigned")!=-1;registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(valuemaxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0},"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(heap["buffer"],data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var str;if(stdStringIsUTF8){var endChar=HEAPU8[value+4+length];var endCharSwap=0;if(endChar!=0){endCharSwap=endChar;HEAPU8[value+4+length]=0}var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i;if(HEAPU8[currentBytePtr]==0){var stringSegment=UTF8ToString(decodeStartPtr);if(str===undefined)str=stringSegment;else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}if(endCharSwap!=0)HEAPU8[value+4+length]=endCharSwap}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr+4,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+4+i]=charCode}}else{for(var i=0;i>2];var a=new Array(length);var start=value+4>>shift;for(var i=0;i>2]=length;var start=ptr+4>>shift;for(var i=0;i>2]=now/1e3|0;HEAP32[ptr+4>>2]=now%1e3*1e3|0;return 0}function _llvm_exp2_f32(x){return Math.pow(2,x)}function _llvm_stackrestore(p){var self=_llvm_stacksave;var ret=self.LLVM_SAVEDSTACKS[p];self.LLVM_SAVEDSTACKS.splice(p,1);stackRestore(ret)}function _llvm_stacksave(){var self=_llvm_stacksave;if(!self.LLVM_SAVEDSTACKS){self.LLVM_SAVEDSTACKS=[]}self.LLVM_SAVEDSTACKS.push(stackSave());return self.LLVM_SAVEDSTACKS.length-1}var ___tm_current=57728;var ___tm_timezone=(stringToUTF8("GMT",57776,4),57776);function _tzset(){if(_tzset.called)return;_tzset.called=true;HEAP32[__get_timezone()>>2]=(new Date).getTimezoneOffset()*60;var currentYear=(new Date).getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);HEAP32[__get_daylight()>>2]=Number(winter.getTimezoneOffset()!=summer.getTimezoneOffset());function extractZone(date){var match=date.toTimeString().match(/\(([A-Za-z ]+)\)$/);return match?match[1]:"GMT"}var winterName=extractZone(winter);var summerName=extractZone(summer);var winterNamePtr=allocate(intArrayFromString(winterName),"i8",ALLOC_NORMAL);var summerNamePtr=allocate(intArrayFromString(summerName),"i8",ALLOC_NORMAL);if(summer.getTimezoneOffset()>2]=winterNamePtr;HEAP32[__get_tzname()+4>>2]=summerNamePtr}else{HEAP32[__get_tzname()>>2]=summerNamePtr;HEAP32[__get_tzname()+4>>2]=winterNamePtr}}function _localtime_r(time,tmPtr){_tzset();var date=new Date(HEAP32[time>>2]*1e3);HEAP32[tmPtr>>2]=date.getSeconds();HEAP32[tmPtr+4>>2]=date.getMinutes();HEAP32[tmPtr+8>>2]=date.getHours();HEAP32[tmPtr+12>>2]=date.getDate();HEAP32[tmPtr+16>>2]=date.getMonth();HEAP32[tmPtr+20>>2]=date.getFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getDay();var start=new Date(date.getFullYear(),0,1);var yday=(date.getTime()-start.getTime())/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+36>>2]=-(date.getTimezoneOffset()*60);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[tmPtr+32>>2]=dst;var zonePtr=HEAP32[__get_tzname()+(dst?4:0)>>2];HEAP32[tmPtr+40>>2]=zonePtr;return tmPtr}function _localtime(time){return _localtime_r(time,___tm_current)}function _longjmp(env,value){_setThrew(env,value||1);throw"longjmp"}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]);return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.indexOf(rule)>=0){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret}return ret}FS.staticInit();embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");InternalError=Module["InternalError"]=extendError(Error,"InternalError");init_emval();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");var ASSERTIONS=false;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}function intArrayToString(array){var ret=[];for(var i=0;i255){if(ASSERTIONS){assert(false,"Character code "+chr+" ("+String.fromCharCode(chr)+") at offset "+i+" not in 0x00-0xFF.")}chr&=255}ret.push(String.fromCharCode(chr))}return ret.join("")}var decodeBase64=typeof atob==="function"?atob:function(input){var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{enc1=keyStr.indexOf(input.charAt(i++));enc2=keyStr.indexOf(input.charAt(i++));enc3=keyStr.indexOf(input.charAt(i++));enc4=keyStr.indexOf(input.charAt(i++));chr1=enc1<<2|enc2>>4;chr2=(enc2&15)<<4|enc3>>2;chr3=(enc3&3)<<6|enc4;output=output+String.fromCharCode(chr1);if(enc3!==64){output=output+String.fromCharCode(chr2)}if(enc4!==64){output=output+String.fromCharCode(chr3)}}while(i>2]=b;Se(0,3,20325,e);a=zy(c[(mx()|0)>>2]|0)|0;c[f>>2]=57671;c[f+4>>2]=a;Se(0,3,21881,f);a=-1}else{a=pd(a,d)|0;EO(d)}yb=g;return a|0}function rd(a,b){a=a|0;b=b|0;b=(c[a+8>>2]|0)+(b<<2)|0;if(!(c[b>>2]|0))b=-1;else{c[b>>2]=0;c[a>>2]=(c[a>>2]|0)+-1;b=1}return b|0}function sd(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,h=0,i=0;d=0;while(1){if((d|0)==3)break;f=a+(d<<5)|0;h=a+(d<<5)+8|0;i=a+(d<<5)+16|0;e=0;while(1){if((e|0)==4)break;g[c+(d<<5)+(e<<3)>>3]=+g[f>>3]*+g[b+(e<<3)>>3]+ +g[h>>3]*+g[b+32+(e<<3)>>3]+ +g[i>>3]*+g[b+64+(e<<3)>>3];e=e+1|0}i=c+(d<<5)+24|0;g[i>>3]=+g[a+(d<<5)+24>>3]+ +g[i>>3];d=d+1|0}return 0}function td(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,h=0,i=0,j=0;d=0;while(1){if((d|0)==3)break;h=a+(d<<5)|0;i=a+(d<<5)+8|0;j=a+(d<<5)+16|0;e=0;while(1){if((e|0)==4)break;f[c+(d<<4)+(e<<2)>>2]=+f[b+(e<<2)>>2]*+g[h>>3]+ +f[b+16+(e<<2)>>2]*+g[i>>3]+ +f[b+32+(e<<2)>>2]*+g[j>>3];e=e+1|0}j=c+(d<<4)+12|0;f[j>>2]=+f[j>>2]+ +g[a+(d<<5)+24>>3];d=d+1|0}return 0}function ud(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0;d=0;while(1){if((d|0)==3)break;g=a+(d<<4)|0;h=a+(d<<4)+4|0;i=a+(d<<4)+8|0;e=0;while(1){if((e|0)==4)break;f[c+(d<<4)+(e<<2)>>2]=+f[g>>2]*+f[b+(e<<2)>>2]+ +f[h>>2]*+f[b+16+(e<<2)>>2]+ +f[i>>2]*+f[b+32+(e<<2)>>2];e=e+1|0}i=c+(d<<4)+12|0;f[i>>2]=+f[a+(d<<4)+12>>2]+ +f[i>>2];d=d+1|0}return 0}function vd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0;h=Bd(4,4)|0;d=0;while(1){if((d|0)==3)break;f=d<<2;e=0;while(1){if((e|0)==4)break;g[(c[h>>2]|0)+(e+f<<3)>>3]=+g[a+(d<<5)+(e<<3)>>3];e=e+1|0}d=d+1|0}d=c[h>>2]|0;f=d+96|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[f+20>>2]=0;g[d+120>>3]=1.0;Vd(h)|0;d=0;while(1){if((d|0)==3)break;a=d<<2;e=0;while(1){if((e|0)==4)break;g[b+(d<<5)+(e<<3)>>3]=+g[(c[h>>2]|0)+(e+a<<3)>>3];e=e+1|0}d=d+1|0}Jd(h)|0;return 0}function wd(a,b){a=a|0;b=b|0;var d=0,e=0,h=0,i=0;i=Bd(4,4)|0;d=0;while(1){if((d|0)==3)break;h=d<<2;e=0;while(1){if((e|0)==4)break;g[(c[i>>2]|0)+(e+h<<3)>>3]=+f[a+(d<<4)+(e<<2)>>2];e=e+1|0}d=d+1|0}d=c[i>>2]|0;h=d+96|0;c[h>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;c[h+16>>2]=0;c[h+20>>2]=0;g[d+120>>3]=1.0;Vd(i)|0;d=0;while(1){if((d|0)==3)break;a=d<<2;e=0;while(1){if((e|0)==4)break;f[b+(d<<4)+(e<<2)>>2]=+g[(c[i>>2]|0)+(e+a<<3)>>3];e=e+1|0}d=d+1|0}Jd(i)|0;return 0}function xd(a){a=a|0;switch(a|0){case 1:case 0:{a=3;break}case 6:case 4:case 3:case 2:{a=4;break}case 14:case 13:case 12:case 5:{a=1;break}case 11:case 10:case 9:case 8:case 7:{a=2;break}default:a=0}return a|0}function yd(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;var f=0;do if((b|0)!=0&(c|0)!=0&(d|0)!=0){f=Mz(c,47)|0;if(!f){a[b>>0]=0;break}e=f+((e|0)!=0&1)-c|0;if((e+1|0)>>>0<=d>>>0){Uz(b,c,e)|0;a[b+e>>0]=0}else b=0}else b=0;while(0);return b|0}function zd(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=0;h=0;a:while(1){switch(a[b+h>>0]|0){case 0:break a;case 46:{e=h;break}default:{}}h=h+1|0}f=b+h|0;g=(Oy(d)|0)+2|0;if(!e)if((g+h|0)>(c|0))e=-1;else{a[f>>0]=46;e=h;i=9}else if((g+e|0)>(c|0))e=-1;else i=9;if((i|0)==9){a[b+(e+1)>>0]=0;_z(b,d)|0;e=0}return e|0}function Ad(b){b=b|0;var c=0,d=0;c=-1;d=0;a:while(1){switch(a[b+d>>0]|0){case 0:break a;case 46:{c=d;break}default:{}}d=d+1|0}if((c|0)!=-1)a[b+c>>0]=0;return 0}function Bd(a,b){a=a|0;b=b|0;var d=0,e=0;d=DO(12)|0;do if(d){e=DO(B(a<<3,b)|0)|0;c[d>>2]=e;if(!e){EO(d);d=0;break}else{c[d+4>>2]=a;c[d+8>>2]=b;break}}else d=0;while(0);return d|0}function Cd(a,b){a=a|0;b=b|0;var d=0,e=0;d=DO(12)|0;do if(d){e=DO(B(a<<2,b)|0)|0;c[d>>2]=e;if(!e){EO(d);d=0;break}else{c[d+4>>2]=a;c[d+8>>2]=b;break}}else d=0;while(0);return d|0}function Dd(a){a=a|0;var b=0;b=Bd(c[a+4>>2]|0,c[a+8>>2]|0)|0;if(b){if((Id(b,a)|0)<0){Jd(b)|0;b=0}}else b=0;return b|0}function Ed(a,b){a=a|0;b=b|0;var d=0;d=Bd(c[a+4>>2]|0,c[b+8>>2]|0)|0;if(d){if((Ld(d,a,b)|0)<0){Jd(d)|0;d=0}}else d=0;return d|0}function Fd(a,b){a=a|0;b=b|0;var d=0;d=Cd(c[a+4>>2]|0,c[b+8>>2]|0)|0;if(d){if((Md(d,a,b)|0)<0){Kd(d)|0;d=0}}else d=0;return d|0}function Gd(a){a=a|0;var b=0;b=Bd(c[a+8>>2]|0,c[a+4>>2]|0)|0;if(b){if((Zd(b,a)|0)<0){Jd(b)|0;b=0}}else b=0;return b|0}function Hd(a){a=a|0;var b=0;b=Cd(c[a+8>>2]|0,c[a+4>>2]|0)|0;if(b){if((_d(b,a)|0)<0){Kd(b)|0;b=0}}else b=0;return b|0}function Id(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0,i=0,j=0;h=c[a+4>>2]|0;a:do if((h|0)==(c[b+4>>2]|0)?(i=c[a+8>>2]|0,(i|0)==(c[b+8>>2]|0)):0){e=0;while(1){if((e|0)>=(h|0)){d=0;break a}f=B(e,i)|0;d=0;while(1){if((d|0)>=(i|0))break;j=d+f|0;g[(c[a>>2]|0)+(j<<3)>>3]=+g[(c[b>>2]|0)+(j<<3)>>3];d=d+1|0}e=e+1|0}}else d=-1;while(0);return d|0}function Jd(a){a=a|0;if(a|0){EO(c[a>>2]|0);EO(a)}return 0}function Kd(a){a=a|0;if(a|0){EO(c[a>>2]|0);EO(a)}return 0}function Ld(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0,p=0.0;n=c[b+8>>2]|0;a:do if(((n|0)==(c[d+4>>2]|0)?(o=c[a+4>>2]|0,(o|0)==(c[b+4>>2]|0)):0)?(m=c[a+8>>2]|0,(m|0)==(c[d+8>>2]|0)):0){a=c[a>>2]|0;k=0;while(1){if((k|0)>=(o|0)){a=0;break a}l=B(k,n)|0;j=0;while(1){if((j|0)>=(m|0))break;g[a>>3]=0.0;e=(c[d>>2]|0)+(j<<3)|0;f=(c[b>>2]|0)+(l<<3)|0;h=0;i=0.0;while(1){if((h|0)>=(n|0))break;p=i+ +g[f>>3]*+g[e>>3];g[a>>3]=p;e=e+(m<<3)|0;f=f+8|0;h=h+1|0;i=p}j=j+1|0;a=a+8|0}k=k+1|0}}else a=-1;while(0);return a|0}function Md(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,g=0,h=0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0,p=0.0;n=c[b+8>>2]|0;a:do if(((n|0)==(c[d+4>>2]|0)?(o=c[a+4>>2]|0,(o|0)==(c[b+4>>2]|0)):0)?(m=c[a+8>>2]|0,(m|0)==(c[d+8>>2]|0)):0){a=c[a>>2]|0;k=0;while(1){if((k|0)>=(o|0)){a=0;break a}l=B(k,n)|0;j=0;while(1){if((j|0)>=(m|0))break;f[a>>2]=0.0;e=(c[d>>2]|0)+(j<<2)|0;g=(c[b>>2]|0)+(l<<2)|0;h=0;i=0.0;while(1){if((h|0)>=(n|0))break;p=i+ +f[g>>2]*+f[e>>2];f[a>>2]=p;e=e+(m<<2)|0;g=g+4|0;h=h+1|0;i=p}j=j+1|0;a=a+4|0}k=k+1|0}}else a=-1;while(0);return a|0}function Nd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0.0,i=0,j=0,k=0,l=0;i=c[a+4>>2]|0;j=c[a+8>>2]|0;f=(i|0)<(j|0)?i:j;a:do if(((((!((i|0)<2|(j|0)<2)?(c[b+8>>2]|0)==(j|0):0)?(c[b+4>>2]|0)==(f|0):0)?(k=d+4|0,(c[k>>2]|0)==(f|0)):0)?(c[e+4>>2]|0)==(j|0):0)?(l=Dd(a)|0,(l|0)!=0):0){h=+u(+(+(i|0)));if((Od(l,e)|0)<0){Jd(l)|0;a=-1;break}if((Pd(l,e)|0)<0){Jd(l)|0;a=-1;break}f=B(j,i)|0;a=0;while(1){if((a|0)>=(f|0))break;j=(c[l>>2]|0)+(a<<3)|0;g[j>>3]=+g[j>>3]/h;a=a+1|0}a=Qd(l,b,d)|0;Jd(l)|0;e=c[k>>2]|0;h=0.0;f=0;while(1){if((f|0)>=(e|0))break;h=h+ +g[(c[d>>2]|0)+(f<<3)>>3];f=f+1|0}f=0;while(1){if((f|0)>=(e|0))break a;l=(c[d>>2]|0)+(f<<3)|0;g[l>>3]=+g[l>>3]/h;f=f+1|0}}else a=-1;while(0);return a|0}function Od(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0,h=0,i=0,j=0,k=0;j=c[a+4>>2]|0;k=c[a+8>>2]|0;a:do if(!((j|0)<1|(k|0)<1)?(c[b+4>>2]|0)==(k|0):0){d=0;while(1){if((d|0)==(k|0))break;g[(c[b>>2]|0)+(d<<3)>>3]=0.0;d=d+1|0}a=c[a>>2]|0;h=0;while(1){if((h|0)==(j|0))break;d=0;f=c[b>>2]|0;i=a;while(1){if((d|0)==(k|0))break;g[f>>3]=+g[i>>3]+ +g[f>>3];d=d+1|0;f=f+8|0;i=i+8|0}a=a+(k<<3)|0;h=h+1|0}e=+(j|0);d=0;while(1){if((d|0)==(k|0)){d=0;break a}j=(c[b>>2]|0)+(d<<3)|0;g[j>>3]=+g[j>>3]/e;d=d+1|0}}else d=-1;while(0);return d|0}function Pd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0,i=0;h=c[a+4>>2]|0;i=c[a+8>>2]|0;a:do if((c[b+4>>2]|0)==(i|0)){f=0;a=c[a>>2]|0;while(1){if((f|0)>=(h|0)){a=0;break a}d=0;e=c[b>>2]|0;while(1){if((d|0)>=(i|0))break;g[a>>3]=+g[a>>3]-+g[e>>3];d=d+1|0;e=e+8|0;a=a+8|0}f=f+1|0}}else a=-1;while(0);return a|0}function Qd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0,i=0;e=c[a+4>>2]|0;f=c[a+8>>2]|0;i=(f|0)<(e|0)?f:e;a:do if(((!((e|0)<2|(f|0)<2)?(c[b+8>>2]|0)==(f|0):0)?(c[b+4>>2]|0)==(i|0):0)?(c[d+4>>2]|0)==(i|0):0){h=Bd(i,i)|0;if((c[h+4>>2]|0)==(i|0)?(c[h+8>>2]|0)==(i|0):0){e=(e|0)<(f|0);if(e){if((Rd(a,h)|0)<0){Jd(h)|0;e=-1;break}}else if((Sd(a,h)|0)<0){Jd(h)|0;e=-1;break}if((Td(h,d)|0)<0){Jd(h)|0;e=-1;break}b:do if(e){if((Ud(a,h,b,d)|0)<0){Jd(h)|0;e=-1;break a}}else{a=0;f=c[h>>2]|0;e=c[b>>2]|0;while(1){if((a|0)>=(i|0))break;if(+g[(c[d>>2]|0)+(a<<3)>>3]<1.0e-16)break;b=0;while(1){if((b|0)>=(i|0))break;g[e>>3]=+g[f>>3];b=b+1|0;f=f+8|0;e=e+8|0}a=a+1|0}while(1){if((a|0)>=(i|0))break b;g[(c[d>>2]|0)+(a<<3)>>3]=0.0;f=0;while(1){if((f|0)>=(i|0))break;g[e>>3]=0.0;f=f+1|0;e=e+8|0}a=a+1|0}}while(0);Jd(h)|0;e=0;break}Jd(h)|0;e=-1}else e=-1;while(0);return e|0}function Rd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0.0,n=0,o=0,p=0.0;n=c[a+4>>2]|0;o=c[a+8>>2]|0;a:do if((c[b+4>>2]|0)==(n|0)?(c[b+8>>2]|0)==(n|0):0){k=c[b>>2]|0;e=0;h=k;while(1){if((e|0)>=(n|0)){b=0;break a}l=B(e,o)|0;d=0;j=h;while(1){if((d|0)==(n|0))break;b:do if(d>>>0>>0)g[j>>3]=+g[k+((B(d,n)|0)+e<<3)>>3];else{f=c[a>>2]|0;i=f+((B(d,o)|0)<<3)|0;g[j>>3]=0.0;b=0;f=f+(l<<3)|0;m=0.0;while(1){if((b|0)>=(o|0))break b;p=m+ +g[f>>3]*+g[i>>3];g[j>>3]=p;b=b+1|0;f=f+8|0;i=i+8|0;m=p}}while(0);d=d+1|0;j=j+8|0}e=e+1|0;h=h+(n<<3)|0}}else b=-1;while(0);return b|0}function Sd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0,i=0,j=0,k=0,l=0.0,m=0,n=0,o=0.0;m=c[a+4>>2]|0;n=c[a+8>>2]|0;a:do if((c[b+4>>2]|0)==(n|0)?(c[b+8>>2]|0)==(n|0):0){k=c[b>>2]|0;e=0;h=k;while(1){if((e|0)>=(n|0)){b=0;break a}d=0;j=h;while(1){if((d|0)==(n|0))break;b:do if(d>>>0>>0)g[j>>3]=+g[k+((B(d,n)|0)+e<<3)>>3];else{i=c[a>>2]|0;g[j>>3]=0.0;b=0;f=i+(e<<3)|0;i=i+(d<<3)|0;l=0.0;while(1){if((b|0)>=(m|0))break b;o=l+ +g[f>>3]*+g[i>>3];g[j>>3]=o;b=b+1|0;f=f+(n<<3)|0;i=i+(n<<3)|0;l=o}}while(0);d=d+1|0;j=j+8|0}e=e+1|0;h=h+(n<<3)|0}}else b=-1;while(0);return b|0}function Td(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0.0,i=0,j=0.0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0,q=0,r=0,s=0,v=0,w=0,x=0,y=0,z=0,A=0,C=0,D=0,E=0,F=0,G=0.0,H=0.0,I=0.0,J=0,K=0;F=yb;yb=yb+16|0;d=F;E=c[a+4>>2]|0;do if((!((E|0)<2?1:(E|0)!=(c[a+8>>2]|0))?(c[b+4>>2]|0)==(E|0):0)?(C=oe(E)|0,(C|0)!=0):0){D=E+-1|0;c[d+4>>2]=D;c[d>>2]=(c[C>>2]|0)+8;if((se(a,b,d)|0)<0){pe(C)|0;d=-1;break}A=c[C>>2]|0;g[A>>3]=0.0;y=D;while(1){if((y|0)<=0)break;z=y;while(1){if((z|0)<=0)break;n=+t(+(+g[A+(z<<3)>>3]));x=c[b>>2]|0;d=z+-1|0;o=+t(+(+g[x+(d<<3)>>3]));if(n>(o+ +t(+(+g[x+(z<<3)>>3])))*1.0e-06)z=d;else break}q=y+-1|0;a:do if((z|0)!=(y|0)){r=A+(y<<3)|0;s=A+(z+1<<3)|0;p=0;do{if(p>>>0>99)break a;p=p+1|0;v=c[b>>2]|0;w=v+(q<<3)|0;x=v+(y<<3)|0;h=+g[x>>3];o=(+g[w>>3]-h)*.5;m=+g[r>>3];m=m*m;j=+u(+(m+o*o));l=z;n=+g[s>>3];j=+g[v+(z<<3)>>3]-h+m/(o+(o<0.0?-j:j));while(1){if((l|0)>=(y|0))break;h=+t(+j);if(h>=+t(+n))if(h>1.0e-16){h=-n/j;o=1.0/+u(+(h*h+1.0));m=o;o=h*o}else{m=1.0;o=0.0}else{m=-j/n;o=1.0/+u(+(m*m+1.0));m=m*o}f=v+(l<<3)|0;I=+g[f>>3];k=l+1|0;d=v+(k<<3)|0;H=+g[d>>3];h=I-H;i=A+(k<<3)|0;G=o*(o*h+m*2.0*+g[i>>3]);g[f>>3]=I-G;g[d>>3]=H+G;d=A+(l<<3)|0;if((l|0)>(z|0))g[d>>3]=m*+g[d>>3]-n*o;I=+g[i>>3];g[i>>3]=I+o*(m*h-o*2.0*I);e=B(l,E)|0;f=B(k,E)|0;d=0;h=n;while(1){if((d|0)==(E|0))break;J=c[a>>2]|0;K=J+(d+e<<3)|0;j=+g[K>>3];J=J+(d+f<<3)|0;h=+g[J>>3];g[K>>3]=m*j-o*h;g[J>>3]=o*j+m*h;d=d+1|0}if((l|0)<(q|0)){j=+g[i>>3];K=A+(l+2<<3)|0;h=+g[K>>3];g[K>>3]=m*h;h=-(o*h)}l=k;n=h}H=+t(+(+g[r>>3]));I=+t(+(+g[w>>3]))}while(H>(I+ +t(+(+g[x>>3])))*1.0e-06)}while(0);y=q}d=0;while(1){if((d|0)==(D|0))break;f=c[b>>2]|0;i=f+(d<<3)|0;j=+g[i>>3];l=d+1|0;h=j;k=d;e=l;while(1){if((e|0)>=(E|0))break;I=+g[f+(e<<3)>>3];K=I>h;h=K?I:h;k=K?e:k;e=e+1|0}g[f+(k<<3)>>3]=j;g[i>>3]=h;e=c[a>>2]|0;f=e+((B(d,E)|0)<<3)|0;d=e+((B(k,E)|0)<<3)|0;e=0;while(1){if((e|0)==(E|0))break;I=+g[d>>3];g[d>>3]=+g[f>>3];g[f>>3]=I;f=f+8|0;d=d+8|0;e=e+1|0}d=l}pe(C)|0;d=0}else d=-1;while(0);yb=F;return d|0}function Ud(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0.0,j=0,k=0,l=0,m=0,n=0.0,o=0,p=0,q=0,r=0.0;p=c[a+4>>2]|0;q=c[a+8>>2]|0;a:do if(((((!((p|0)<1|(q|0)<1)?(c[b+4>>2]|0)==(p|0):0)?(c[b+8>>2]|0)==(p|0):0)?(c[d+4>>2]|0)==(p|0):0)?(c[d+8>>2]|0)==(q|0):0)?(c[e+4>>2]|0)==(p|0):0){h=0;d=c[d>>2]|0;while(1){if((h|0)>=(p|0))break;i=+g[(c[e>>2]|0)+(h<<3)>>3];if(i<1.0e-16)break;n=1.0/+u(+(+t(+i)));o=B(h,p)|0;j=0;m=d;while(1){if((j|0)==(q|0))break;f=0;k=(c[b>>2]|0)+(o<<3)|0;i=0.0;l=(c[a>>2]|0)+(j<<3)|0;while(1){if((f|0)==(p|0))break;r=i+ +g[k>>3]*+g[l>>3];f=f+1|0;k=k+8|0;i=r;l=l+(q<<3)|0}g[m>>3]=n*i;j=j+1|0;m=m+8|0}h=h+1|0;d=d+(q<<3)|0}while(1){if((h|0)>=(p|0)){d=0;break a}g[(c[e>>2]|0)+(h<<3)>>3]=0.0;f=0;while(1){if((f|0)>=(q|0))break;g[d>>3]=0.0;f=f+1|0;d=d+8|0}h=h+1|0}}else d=-1;while(0);return d|0}function Vd(a){a=a|0;var b=0;b=c[a+4>>2]|0;return ((Wd(c[a>>2]|0,b,b)|0)==0)<<31>>31|0}function Wd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0,i=0,j=0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0;q=yb;yb=yb+2e3|0;p=q;a:do if((b|0)>500)a=0;else{switch(b|0){case 0:{a=0;break a}case 1:{g[a>>3]=1.0/+g[a>>3];break a}default:{}}e=0;while(1){if((e|0)>=(b|0))break;c[p+(e<<2)>>2]=e;e=e+1|0}o=a+(b+-1<<3)|0;l=0;n=o;while(1){if((l|0)>=(b|0))break;m=a+((B(l,d)|0)<<3)|0;k=0.0;e=m;i=-1;f=l;while(1){if((f|0)==(b|0))break;r=+t(+(+g[e>>3]));j=k>2]|0;f=p+(l<<2)|0;c[e>>2]=c[f>>2];c[f>>2]=h;f=0;h=m;e=a+((B(i,d)|0)<<3)|0;while(1){if((f|0)==(b|0))break;r=+g[e>>3];g[e>>3]=+g[h>>3];g[h>>3]=r;f=f+1|0;h=h+8|0;e=e+8|0}k=+g[m>>3];e=1;f=m;while(1){if((e|0)==(b|0))break;j=f+8|0;g[f>>3]=+g[j>>3]/k;e=e+1|0;f=j}g[n>>3]=1.0/k;e=0;j=o;while(1){if((e|0)==(b|0))break;if((e|0)!=(l|0)){i=a+((B(e,d)|0)<<3)|0;k=+g[i>>3];f=m;h=1;while(1){if((h|0)==(b|0))break;s=i+8|0;g[i>>3]=+g[s>>3]-k*+g[f>>3];f=f+8|0;h=h+1|0;i=s}g[j>>3]=-(k*+g[n>>3])}e=e+1|0;j=j+(d<<3)|0}l=l+1|0;n=n+(d<<3)|0}j=0;while(1){if((j|0)>=(b|0))break a;i=j;while(1){e=p+(i<<2)|0;if((i|0)>=(b|0))break;if((c[e>>2]|0)==(j|0))break;i=i+1|0}c[e>>2]=c[p+(j<<2)>>2];f=0;h=a+(j<<3)|0;e=a+(i<<3)|0;while(1){if((f|0)>=(b|0))break;r=+g[e>>3];g[e>>3]=+g[h>>3];g[h>>3]=r;f=f+1|0;h=h+(d<<3)|0;e=e+(d<<3)|0}j=j+1|0}}while(0);yb=q;return a|0}function Xd(a){a=a|0;var b=0;b=c[a+4>>2]|0;return ((Yd(c[a>>2]|0,b,b)|0)==0)<<31>>31|0}function Yd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0;q=yb;yb=yb+2e3|0;p=q;a:do if((b|0)>500)a=0;else{switch(b|0){case 0:{a=0;break a}case 1:{f[a>>2]=1.0/+f[a>>2];break a}default:{}}e=0;while(1){if((e|0)>=(b|0))break;c[p+(e<<2)>>2]=e;e=e+1|0}o=a+(b+-1<<2)|0;l=0;n=o;while(1){if((l|0)>=(b|0))break;m=a+((B(l,d)|0)<<2)|0;k=0.0;e=m;i=-1;g=l;while(1){if((g|0)==(b|0))break;r=+t(+(+f[e>>2]));j=k>2]|0;g=p+(l<<2)|0;c[e>>2]=c[g>>2];c[g>>2]=h;g=0;h=m;e=a+((B(i,d)|0)<<2)|0;while(1){if((g|0)==(b|0))break;j=c[e>>2]|0;c[e>>2]=c[h>>2];c[h>>2]=j;g=g+1|0;h=h+4|0;e=e+4|0}k=+f[m>>2];e=1;g=m;while(1){if((e|0)==(b|0))break;j=g+4|0;f[g>>2]=+f[j>>2]/k;e=e+1|0;g=j}f[n>>2]=1.0/k;e=0;j=o;while(1){if((e|0)==(b|0))break;if((e|0)!=(l|0)){i=a+((B(e,d)|0)<<2)|0;k=+f[i>>2];g=m;h=1;while(1){if((h|0)==(b|0))break;s=i+4|0;f[i>>2]=+f[s>>2]-k*+f[g>>2];g=g+4|0;h=h+1|0;i=s}f[j>>2]=-(k*+f[n>>2])}e=e+1|0;j=j+(d<<2)|0}l=l+1|0;n=n+(d<<2)|0}j=0;while(1){if((j|0)>=(b|0))break a;i=j;while(1){e=p+(i<<2)|0;if((i|0)>=(b|0))break;if((c[e>>2]|0)==(j|0))break;i=i+1|0}c[e>>2]=c[p+(j<<2)>>2];g=0;h=a+(j<<2)|0;e=a+(i<<2)|0;while(1){if((g|0)>=(b|0))break;s=c[e>>2]|0;c[e>>2]=c[h>>2];c[h>>2]=s;g=g+1|0;h=h+(d<<2)|0;e=e+(d<<2)|0}j=j+1|0}}while(0);yb=q;return a|0}function Zd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0,i=0;h=c[a+4>>2]|0;a:do if((h|0)==(c[b+8>>2]|0)?(i=c[a+8>>2]|0,(i|0)==(c[b+4>>2]|0)):0){a=c[a>>2]|0;f=0;while(1){if((f|0)>=(h|0)){a=0;break a}d=(c[b>>2]|0)+(f<<3)|0;e=0;while(1){if((e|0)>=(i|0))break;g[a>>3]=+g[d>>3];d=d+(h<<3)|0;e=e+1|0;a=a+8|0}f=f+1|0}}else a=-1;while(0);return a|0}function _d(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;g=c[a+4>>2]|0;a:do if((g|0)==(c[b+8>>2]|0)?(h=c[a+8>>2]|0,(h|0)==(c[b+4>>2]|0)):0){a=c[a>>2]|0;f=0;while(1){if((f|0)>=(g|0)){a=0;break a}d=(c[b>>2]|0)+(f<<2)|0;e=0;while(1){if((e|0)>=(h|0))break;c[a>>2]=c[d>>2];d=d+(g<<2)|0;e=e+1|0;a=a+4|0}f=f+1|0}}else a=-1;while(0);return a|0}function $d(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0;h=+(b|0)/+(c[a>>2]|0);f=+(d|0)/+(c[a+4>>2]|0);c[e>>2]=b;c[e+4>>2]=d;b=0;while(1){if((b|0)==4)break;g[e+8+(b<<3)>>3]=h*+g[a+8+(b<<3)>>3];g[e+40+(b<<3)>>3]=f*+g[a+40+(b<<3)>>3];g[e+72+(b<<3)>>3]=+g[a+72+(b<<3)>>3];b=b+1|0}b=c[a+176>>2]|0;switch(b|0){case 4:{g[e+104>>3]=+g[a+104>>3];g[e+112>>3]=+g[a+112>>3];g[e+120>>3]=+g[a+120>>3];g[e+128>>3]=+g[a+128>>3];g[e+136>>3]=h*+g[a+136>>3];g[e+144>>3]=f*+g[a+144>>3];g[e+152>>3]=h*+g[a+152>>3];g[e+160>>3]=f*+g[a+160>>3];g[e+168>>3]=+g[a+168>>3];i=9;break}case 3:{g[e+104>>3]=h*+g[a+104>>3];g[e+112>>3]=f*+g[a+112>>3];g[e+120>>3]=+g[a+120>>3];g[e+128>>3]=+g[a+128>>3];g[e+136>>3]=+g[a+136>>3]/(h*f);g[e+144>>3]=+g[a+144>>3]/(f*(h*h*f));i=9;break}case 2:{g[e+104>>3]=h*+g[a+104>>3];g[e+112>>3]=f*+g[a+112>>3];g[e+120>>3]=+g[a+120>>3];g[e+128>>3]=+g[a+128>>3]/(h*f);g[e+136>>3]=+g[a+136>>3]/(f*(h*h*f));i=9;break}case 1:{g[e+104>>3]=h*+g[a+104>>3];g[e+112>>3]=f*+g[a+112>>3];g[e+120>>3]=+g[a+120>>3];g[e+128>>3]=+g[a+128>>3]/(h*f);i=9;break}default:b=-1}if((i|0)==9){c[e+176>>2]=b;b=0}return b|0}function ae(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,h=0,i=0.0,j=0.0,k=0,l=0,m=0,n=0.0,o=0.0,p=0,q=0,r=0.0,s=0,t=0,u=0,v=0,w=0.0;h=yb;yb=yb+96|0;f=h;a:do if(!(+g[a+88>>3]>=0.0)){d=0;while(1){if((d|0)==3)break a;e=0;while(1){if((e|0)==4)break;g[f+(d<<5)+(e<<3)>>3]=-+g[a+(d<<5)+(e<<3)>>3];e=e+1|0}d=d+1|0}}else{d=0;while(1){if((d|0)==3)break a;e=0;while(1){if((e|0)==4)break;g[f+(d<<5)+(e<<3)>>3]=+g[a+(d<<5)+(e<<3)>>3];e=e+1|0}d=d+1|0}}while(0);d=0;while(1){if((d|0)==3)break;e=0;while(1){if((e|0)==4)break;g[b+(d<<5)+(e<<3)>>3]=0.0;e=e+1|0}d=d+1|0}i=+g[f+64>>3];n=+g[f+72>>3];o=+g[f+80>>3];w=+be(i,n,o);a=b+80|0;g[a>>3]=w;w=i/w;u=c+64|0;g[u>>3]=w;n=n/+g[a>>3];s=c+72|0;g[s>>3]=n;o=o/+g[a>>3];p=c+80|0;g[p>>3]=o;m=c+88|0;g[m>>3]=+g[f+88>>3]/+g[a>>3];i=+g[f+32>>3];j=+g[f+40>>3];r=+g[f+48>>3];o=+ce(w,n,o,i,j,r);l=b+48|0;g[l>>3]=o;i=i-o*+g[u>>3];j=j-o*+g[s>>3];o=r-o*+g[p>>3];r=+be(i,j,o);k=b+40|0;g[k>>3]=r;v=c+32|0;g[v>>3]=i/r;t=c+40|0;g[t>>3]=j/+g[k>>3];q=c+48|0;g[q>>3]=o/+g[k>>3];o=+g[f>>3];j=+g[f+8>>3];r=+g[f+16>>3];i=+ce(+g[u>>3],+g[s>>3],+g[p>>3],o,j,r);d=b+16|0;g[d>>3]=i;n=+ce(+g[v>>3],+g[t>>3],+g[q>>3],o,j,r);e=b+8|0;g[e>>3]=n;o=o-n*+g[v>>3]-i*+g[u>>3];j=j-n*+g[t>>3]-i*+g[s>>3];i=r-n*+g[q>>3]-i*+g[p>>3];n=+be(o,j,i);g[b>>3]=n;g[c>>3]=o/n;g[c+8>>3]=j/+g[b>>3];g[c+16>>3]=i/+g[b>>3];i=+g[m>>3];j=(+g[f+56>>3]-+g[l>>3]*i)/+g[k>>3];g[c+56>>3]=j;g[c+24>>3]=(+g[f+24>>3]-j*+g[e>>3]-i*+g[d>>3])/+g[b>>3];d=0;while(1){if((d|0)==3)break;e=0;while(1){if((e|0)==3)break;v=b+(d<<5)+(e<<3)|0;g[v>>3]=+g[v>>3]/+g[a>>3];e=e+1|0}d=d+1|0}yb=h;return 0}function be(a,b,c){a=+a;b=+b;c=+c;return +(+u(+(a*a+b*b+c*c)))}function ce(a,b,c,d,e,f){a=+a;b=+b;c=+c;d=+d;e=+e;f=+f;return +(a*d+b*e+c*f)}function de(a,b,c,d,e,f){a=a|0;b=+b;c=+c;d=d|0;e=e|0;f=f|0;var h=0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0;switch(f|0){case 4:{t=+g[a>>3];v=+g[a+8>>3];r=+g[a+16>>3];s=+g[a+24>>3];x=+g[a+32>>3];y=+g[a+40>>3];z=+g[a+48>>3];A=+g[a+56>>3];w=+g[a+64>>3];q=(b-z)/x;l=(c-A)/y;m=r*2.0;n=s*6.0;o=s*2.0;p=r*6.0;i=q;j=l;k=q*q;b=l*l;f=1;while(1){if(!(b!=0.0|k!=0.0)){c=0.0;b=0.0;break}D=b+k;C=t*D+1.0+D*(v*D);c=k*3.0;B=b*c;c=i-(s*(D+k*2.0)+(j*(m*i)+i*C)-q)/(n*i+(m*j+(t*(b+c)+1.0+v*(b*b+(k*(k*5.0)+B)))));i=o*c;b=j-(r*(b*2.0+D)+j*C+j*i-l)/(p*j+(t*(k+b*3.0)+1.0+v*(b*(b*5.0)+(k*k+B)))+i);if((f|0)==4)break;i=c;j=b;k=c*c;b=b*b;f=f+1|0}g[d>>3]=z+x*c/w;b=A+y*b/w;h=22;break}case 3:{p=+g[a>>3];b=(b-p)/+g[a+24>>3];h=a+8|0;c=c-+g[h>>3];k=+g[a+32>>3]/1.0e8;l=+g[a+40>>3]/1.0e8/1.0e5;i=b*b+c*c;m=+u(+i);n=k*3.0;o=l*5.0;f=1;j=m;while(1){if(!(j!=0.0)){c=0.0;b=0.0;break}D=j-(j*(1.0-k*i-i*(l*i))-m)/(1.0-n*i-i*(o*i));b=b*D/j;c=c*D/j;if((f|0)==3)break;j=b*b+c*c;i=j;f=f+1|0;j=+u(+j)}a=a+16|0;g[d>>3]=p+b/+g[a>>3];b=c/+g[a>>3]+ +g[h>>3];h=22;break}case 2:{p=+g[a>>3];b=b-p;h=a+8|0;c=c-+g[h>>3];k=+g[a+24>>3]/1.0e8;l=+g[a+32>>3]/1.0e8/1.0e5;i=b*b+c*c;m=+u(+i);n=k*3.0;o=l*5.0;f=1;j=m;while(1){if(!(j!=0.0)){c=0.0;b=0.0;break}D=j-(j*(1.0-k*i-i*(l*i))-m)/(1.0-n*i-i*(o*i));b=b*D/j;c=c*D/j;if((f|0)==3)break;i=b*b+c*c;f=f+1|0;j=+u(+i)}a=a+16|0;g[d>>3]=p+b/+g[a>>3];b=c/+g[a>>3]+ +g[h>>3];h=22;break}case 1:{n=+g[a>>3];b=b-n;h=a+8|0;c=c-+g[h>>3];k=+g[a+24>>3]/1.0e8;i=b*b+c*c;l=+u(+i);m=k*3.0;f=1;j=l;while(1){if(!(j!=0.0)){c=0.0;b=0.0;break}D=j-(j*(1.0-k*i)-l)/(1.0-m*i);b=b*D/j;c=c*D/j;if((f|0)==3)break;i=b*b+c*c;f=f+1|0;j=+u(+i)}a=a+16|0;g[d>>3]=n+b/+g[a>>3];b=c/+g[a>>3]+ +g[h>>3];h=22;break}default:f=-1}if((h|0)==22){g[e>>3]=b;f=0}return f|0}function ee(a,b,c,d,e,f){a=a|0;b=+b;c=+c;d=d|0;e=e|0;f=f|0;var h=0.0,i=0.0,j=0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0;a:do switch(f|0){case 4:{h=+g[a+16>>3];l=+g[a+24>>3];o=+g[a+32>>3];m=+g[a+40>>3];p=+g[a+48>>3];n=+g[a+56>>3];i=+g[a+64>>3];k=(b-p)*i/o;c=(c-n)*i/m;i=k*k+c*c;b=+g[a>>3]*i+1.0+i*(+g[a+8>>3]*i);g[d>>3]=p+o*(l*(i+k*(k*2.0))+(c*(h*2.0*k)+k*b));b=n+m*(c*(l*2.0*k)+(h*(i+c*(c*2.0))+c*b));j=12;break}case 3:{i=+g[a>>3];p=+g[a+16>>3];h=(b-i)*p;f=a+8|0;b=p*(c-+g[f>>3]);if(h==0.0&b==0.0){g[d>>3]=i;b=+g[f>>3];j=12;break a}else{p=h*h+b*b;p=1.0-p*(+g[a+32>>3]/1.0e8)-p*(p*(+g[a+40>>3]/1.0e8/1.0e5));g[d>>3]=i+ +g[a+24>>3]*(h*p);b=+g[f>>3]+b*p;j=12;break a}}case 2:{i=+g[a>>3];p=+g[a+16>>3];h=(b-i)*p;f=a+8|0;b=p*(c-+g[f>>3]);if(h==0.0&b==0.0){g[d>>3]=i;b=+g[f>>3];j=12;break a}else{p=h*h+b*b;p=1.0-p*(+g[a+24>>3]/1.0e8)-p*(p*(+g[a+32>>3]/1.0e8/1.0e5));g[d>>3]=i+h*p;b=+g[f>>3]+b*p;j=12;break a}}case 1:{i=+g[a>>3];p=+g[a+16>>3];h=(b-i)*p;f=a+8|0;b=p*(c-+g[f>>3]);if(h==0.0&b==0.0){g[d>>3]=i;b=+g[f>>3];j=12;break a}else{p=1.0-(h*h+b*b)*(+g[a+24>>3]/1.0e8);g[d>>3]=i+h*p;b=+g[f>>3]+b*p;j=12;break a}}default:f=-1}while(0);if((j|0)==12){g[e>>3]=b;f=0}return f|0}function fe(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;g=yb;yb=yb+192|0;f=g;ge(a,f);ge(a+4|0,f+4|0);b=0;while(1){if((b|0)==3)break;d=0;while(1){if((d|0)==4)break;he(a+8+(b<<5)+(d<<3)|0,f+8+(b<<5)+(d<<3)|0);d=d+1|0}b=b+1|0}d=a+176|0;b=0;while(1){e=c[d>>2]|0;if((b|0)>=(c[1712+(e+-1<<3)>>2]|0))break;he(a+104+(b<<3)|0,f+104+(b<<3)|0);b=b+1|0}c[f+176>>2]=e;YO(a|0,f|0,184)|0;yb=g;return}function ge(b,c){b=b|0;c=c|0;var d=0;d=0;while(1){if((d|0)==4)break;a[c+d>>0]=a[b+(3-d)>>0]|0;d=d+1|0}return}function he(b,c){b=b|0;c=c|0;var d=0;d=0;while(1){if((d|0)==8)break;a[c+d>>0]=a[b+(7-d)>>0]|0;d=d+1|0}return}function ie(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=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.0;s=yb;yb=yb+256|0;n=s+248|0;l=s+240|0;k=s+232|0;j=s+224|0;i=s+216|0;h=s+208|0;f=s+200|0;p=s;q=s+16|0;do if((a|0)!=0&(b|0)>0&(d|0)!=0){r=pz(a,22236)|0;if(!r){c[f>>2]=c[(mx()|0)>>2];c[f+4>>2]=a;Se(0,3,20359,f);a=zy(c[(mx()|0)>>2]|0)|0;c[h>>2]=57671;c[h+4>>2]=a;Se(0,3,21881,h);a=-1;break}Iz(r,0,2)|0;a:do if(!(zz(r)|0)){h=fA(r)|0;gA(r);f=0;while(1){if(f>>>0>=4){o=9;break}a=c[1712+(f<<3)+4>>2]|0;f=f+1|0;if(!((h|0)%(a|0)|0)){m=f;break}}do if((o|0)==9)if((f|0)==4){Se(0,3,20473,k);a=-1;break a}else{m=0;a=c[1712+(0<<3)+4>>2]|0;break}while(0);if((eA(q,a,1,r)|0)!=1){c[l>>2]=c[(mx()|0)>>2];Se(0,3,20553,l);a=zy(c[(mx()|0)>>2]|0)|0;c[n>>2]=57671;c[n+4>>2]=a;Se(0,3,21881,n);a=-1;break}j=q+176|0;c[j>>2]=m;fe(q);k=(m|0)==1;l=q+120|0;if(k){t=+g[l>>3];i=q+128|0;g[l>>3]=+g[i>>3];g[i>>3]=t}else i=q+128|0;YO(d|0,q|0,184)|0;c[p>>2]=e;f=d+176|0;a=1;while(1){if((a|0)>=(b|0)){a=0;break a}e=(c[p>>2]|0)+(4-1)&~(4-1);h=c[e>>2]|0;c[p>>2]=e+4;c[h+176>>2]=c[f>>2];if((eA(q,c[1712+((c[f>>2]|0)+-1<<3)+4>>2]|0,1,r)|0)!=1){a=-1;break a}c[j>>2]=m;fe(q);if(k){t=+g[l>>3];g[l>>3]=+g[i>>3];g[i>>3]=t}YO(h|0,q|0,184)|0;a=a+1|0}}else{c[i>>2]=c[(mx()|0)>>2];Se(0,3,20428,i);a=zy(c[(mx()|0)>>2]|0)|0;c[j>>2]=57671;c[j+4>>2]=a;Se(0,3,21881,j);a=-1}while(0);vz(r)|0}else a=-1;while(0);yb=s;return a|0}function je(a,b,d,e){a=a|0;b=+b;d=+d;e=e|0;var f=0,h=0.0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0;o=yb;yb=yb+416|0;j=o+304|0;m=o+208|0;k=o+128|0;n=o;l=c[a>>2]|0;f=c[a+4>>2]|0;a:do if((ae(a+8|0,j,m)|0)<0)Se(0,3,20591,o+400|0);else{i=+(f+-1|0);a=0;while(1){if((a|0)==4)break;f=j+32+(a<<3)|0;g[f>>3]=+g[j+64+(a<<3)>>3]*i-+g[f>>3];a=a+1|0}h=+g[j+80>>3];f=0;while(1){if((f|0)==3)break;a=0;while(1){if((a|0)==3)break;g[k+(f*24|0)+(a<<3)>>3]=+g[j+(f<<5)+(a<<3)>>3]/h;a=a+1|0}f=f+1|0}h=+(l+-1|0);g[n>>3]=+g[k>>3]*2.0/h;g[n+8>>3]=+g[k+8>>3]*2.0/h;g[n+16>>3]=-(+g[k+16>>3]*2.0/h+-1.0);f=n+24|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;g[n+40>>3]=-(+g[k+32>>3]*2.0/i);g[n+48>>3]=-(+g[k+40>>3]*2.0/i+-1.0);f=n+56|0;h=b-d;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[f+20>>2]=0;g[n+80>>3]=(b+d)/h;g[n+88>>3]=d*2.0*b/h;f=n+96|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;g[n+112>>3]=-1.0;g[n+120>>3]=0.0;h=+g[m+24>>3];i=+g[m+56>>3];b=+g[m+88>>3];f=0;while(1){if((f|0)==4)break a;d=+g[n+(f<<5)>>3];j=n+(f<<5)+8|0;k=n+(f<<5)+16|0;a=0;while(1){if((a|0)==3)break;g[e+((a<<2)+f<<3)>>3]=d*+g[m+(a<<3)>>3]+ +g[j>>3]*+g[m+32+(a<<3)>>3]+ +g[k>>3]*+g[m+64+(a<<3)>>3];a=a+1|0}g[e+(f+12<<3)>>3]=+g[n+(f<<5)+24>>3]+(d*h+ +g[j>>3]*i+ +g[k>>3]*b);f=f+1|0}}while(0);yb=o;return}function ke(a,b){a=a|0;b=b|0;var d=0,e=0,h=0.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.0;s=yb;yb=yb+64|0;n=s+24|0;o=s+16|0;p=s+8|0;q=s;r=DO(208)|0;if(!r){Se(0,3,41858,s+32|0);Ea(1)}YO(r|0,a|0,184)|0;m=b<<1;l=(c[a>>2]|0)+m|0;c[r+192>>2]=l;m=(c[a+4>>2]|0)+m|0;c[r+196>>2]=m;c[r+200>>2]=b;c[r+204>>2]=b;d=B(l<<3,m)|0;e=DO(d)|0;c[r+184>>2]=e;if(!e){Se(0,3,41858,s+40|0);Ea(1)}d=DO(d)|0;c[r+188>>2]=d;if(!d){Se(0,3,41858,s+48|0);Ea(1)}k=a+104|0;j=c[a+176>>2]|0;i=0;a=e;while(1){if((i|0)>=(m|0))break;h=+(i-b|0);e=0;while(1){if((e|0)>=(l|0))break;t=+(e-b|0);ee(k,t,h,p,q,j)|0;f[a>>2]=+g[p>>3];f[a+4>>2]=+g[q>>3];de(k,t,h,n,o,j)|0;f[d>>2]=+g[n>>3];f[d+4>>2]=+g[o>>3];e=e+1|0;d=d+8|0;a=a+8|0}i=i+1|0}yb=s;return r|0}function le(a){a=a|0;var b=0;if((a|0)!=0?(b=c[a>>2]|0,(b|0)!=0):0){EO(c[b+184>>2]|0);EO(c[(c[a>>2]|0)+188>>2]|0);EO(c[a>>2]|0);c[a>>2]=0;a=0}else a=-1;return a|0}function me(a,b,d,e,f){a=a|0;b=+b;d=+d;e=e|0;f=f|0;var g=0,h=0,i=0;h=(c[a+16>>2]|0)+~~(b+.5)|0;g=(c[a+20>>2]|0)+~~(d+.5)|0;if(((h|0)>=0?(i=c[a+8>>2]|0,!((g|0)<0|(h|0)>=(i|0))):0)?(g|0)<(c[a+12>>2]|0):0){g=(c[a>>2]|0)+((B(i,g)|0)+h<<1<<2)|0;c[e>>2]=c[g>>2];c[f>>2]=c[g+4>>2];g=0}else g=-1;return g|0}function ne(a,b,d,e,f){a=a|0;b=+b;d=+d;e=e|0;f=f|0;var g=0,h=0,i=0;h=(c[a+16>>2]|0)+~~(b+.5)|0;g=(c[a+20>>2]|0)+~~(d+.5)|0;if(((h|0)>=0?(i=c[a+8>>2]|0,!((g|0)<0|(h|0)>=(i|0))):0)?(g|0)<(c[a+12>>2]|0):0){g=(c[a+4>>2]|0)+((B(i,g)|0)+h<<1<<2)|0;c[e>>2]=c[g>>2];c[f>>2]=c[g+4>>2];g=0}else g=-1;return g|0}function oe(a){a=a|0;var b=0,d=0;b=DO(8)|0;do if(b){d=DO(a<<3)|0;c[b>>2]=d;if(!d){EO(b);b=0;break}else{c[b+4>>2]=a;break}}else b=0;while(0);return b|0}function pe(a){a=a|0;EO(c[a>>2]|0);EO(a);return 0}function qe(a){a=a|0;var b=0.0,d=0,e=0.0,f=0,h=0;b=+u(+(+re(a,a)));a:do if(b!=0.0){f=c[a>>2]|0;e=+g[f>>3];b=e<0.0?-b:b;e=e+b;g[f>>3]=e;e=1.0/+u(+(b*e));d=c[a+4>>2]|0;a=0;while(1){if((a|0)>=(d|0))break a;h=f+(a<<3)|0;g[h>>3]=e*+g[h>>3];a=a+1|0}}while(0);return +-b}function re(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0,h=0.0;f=c[a+4>>2]|0;if((f|0)!=(c[b+4>>2]|0))Ea(0);d=0;e=0.0;while(1){if((d|0)>=(f|0))break;h=e+ +g[(c[a>>2]|0)+(d<<3)>>3]*+g[(c[b>>2]|0)+(d<<3)>>3];d=d+1|0;e=h}return +e}function se(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0,i=0.0,j=0,k=0,l=0,m=0,n=0.0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;x=yb;yb=yb+16|0;u=x+8|0;v=x;w=c[a+8>>2]|0;a:do if(((w|0)==(c[a+4>>2]|0)?(w|0)==(c[b+4>>2]|0):0)?(w|0)==((c[d+4>>2]|0)+1|0):0){r=w+-2|0;s=u+4|0;t=v+4|0;l=0;while(1){if((l|0)>=(r|0))break;m=(c[a>>2]|0)+((B(l,w)|0)<<3)|0;g[(c[b>>2]|0)+(l<<3)>>3]=+g[m+(l<<3)>>3];j=w-l+-1|0;c[s>>2]=j;p=l+1|0;k=m+(p<<3)|0;c[u>>2]=k;o=+qe(u);g[(c[d>>2]|0)+(l<<3)>>3]=o;b:do if(!(o==0.0)){h=p;while(1){if((h|0)>=(w|0))break;e=p;i=0.0;while(1){if(e>>>0>=h>>>0)break;o=+g[(c[a>>2]|0)+((B(e,w)|0)+h<<3)>>3];o=i+o*+g[m+(e<<3)>>3];e=e+1|0;i=o}f=B(h,w)|0;e=h;while(1){if((e|0)>=(w|0))break;o=i+ +g[(c[a>>2]|0)+(e+f<<3)>>3]*+g[m+(e<<3)>>3];e=e+1|0;i=o}g[(c[b>>2]|0)+(h<<3)>>3]=i;h=h+1|0}c[t>>2]=j;c[s>>2]=j;c[u>>2]=k;c[v>>2]=(c[b>>2]|0)+(p<<3);o=+re(u,v)*.5;e=w;while(1){e=e+-1|0;if((e|0)<=(l|0))break b;i=+g[m+(e<<3)>>3];h=c[b>>2]|0;j=h+(e<<3)|0;n=+g[j>>3]-o*i;g[j>>3]=n;j=B(e,w)|0;f=e;while(1){if((f|0)>=(w|0))break;k=(c[a>>2]|0)+(f+j<<3)|0;g[k>>3]=+g[k>>3]-(i*+g[h+(f<<3)>>3]+n*+g[m+(f<<3)>>3]);f=f+1|0}}}while(0);l=p}if((w|0)<=1)if((w|0)==1){h=0;e=c[a>>2]|0;f=c[b>>2]|0;q=27}else j=w;else{e=c[a>>2]|0;q=B(r,w)|0;f=c[b>>2]|0;g[f+(r<<3)>>3]=+g[e+(q+r<<3)>>3];h=w+-1|0;g[(c[d>>2]|0)+(r<<3)>>3]=+g[e+(h+q<<3)>>3];q=27}if((q|0)==27){j=w;i=+g[e+((B(h,w)|0)+h<<3)>>3];e=f+(h<<3)|0;q=28}while(1){if((q|0)==28)g[e>>3]=i;d=j+-1|0;if((j|0)<=0){e=0;break a}m=(c[a>>2]|0)+((B(d,w)|0)<<3)|0;c:do if((j|0)<=(r|0)){h=w-d+-1|0;k=m+(j<<3)|0;e=j;while(1){if((e|0)>=(w|0))break c;c[t>>2]=h;c[s>>2]=h;c[u>>2]=k;l=B(e,w)|0;c[v>>2]=(c[a>>2]|0)+(l+j<<3);i=+re(u,v);f=j;while(1){if((f|0)>=(w|0))break;q=(c[a>>2]|0)+(f+l<<3)|0;g[q>>3]=+g[q>>3]-i*+g[m+(f<<3)>>3];f=f+1|0}e=e+1|0}}while(0);e=0;while(1){if((e|0)>=(w|0))break;g[m+(e<<3)>>3]=0.0;e=e+1|0}j=d;i=1.0;e=m+(d<<3)|0;q=28}}else e=-1;while(0);yb=x;return e|0}function te(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,h=0.0,i=0.0;f=+g[c>>3];h=+g[c+8>>3];e=+g[c+16>>3];d=+g[b+88>>3]+(f*+g[b+64>>3]+h*+g[b+72>>3]+e*+g[b+80>>3]);if(d==0.0)c=-1;else{i=+g[b+56>>3]+(f*+g[b+32>>3]+h*+g[b+40>>3]+e*+g[b+48>>3]);g[a>>3]=(+g[b+24>>3]+(f*+g[b>>3]+h*+g[b+8>>3]+e*+g[b+16>>3]))/d;g[a+8>>3]=i/d;c=0}return c|0}function ue(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0,h=0,i=0,j=0,k=0.0;j=yb;yb=yb+224|0;h=j+48|0;i=j;f=j+192|0;ve(h,f,c,d);a:do if((we(i,b,f)|0)<0){Se(0,3,20661,j+216|0);b=-1}else{c=0;while(1){if((c|0)==2){b=0;break a}d=0;while(1){if((d|0)==6)break;f=a+(c*48|0)+(d<<3)|0;g[f>>3]=0.0;b=0;e=0.0;while(1){if((b|0)==3)break;k=e+ +g[i+(c*24|0)+(b<<3)>>3]*+g[h+(b*48|0)+(d<<3)>>3];g[f>>3]=k;b=b+1|0;e=k}d=d+1|0}c=c+1|0}}while(0);yb=j;return b|0}function ve(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0.0,h=0,i=0,j=0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;j=yb;yb=yb+864|0;h=j+576|0;i=j;u=c+8|0;e=d+8|0;n=+g[e>>3];t=c+16|0;v=d+16|0;l=+g[v>>3];g[b>>3]=+g[c+24>>3]+(+g[c>>3]*+g[d>>3]+ +g[u>>3]*n+ +g[t>>3]*l);s=c+32|0;o=+g[d>>3];r=c+40|0;q=c+48|0;g[b+8>>3]=+g[c+56>>3]+(+g[s>>3]*o+n*+g[r>>3]+l*+g[q>>3]);p=c+64|0;d=c+72|0;n=+g[e>>3];e=c+80|0;g[b+16>>3]=+g[c+88>>3]+(o*+g[p>>3]+ +g[d>>3]*n+l*+g[e>>3]);l=+g[c>>3];g[h>>3]=o*l;g[h+8>>3]=n*l;m=+g[v>>3];g[h+16>>3]=l*m;k=+g[u>>3];g[h+24>>3]=o*k;g[h+32>>3]=n*k;g[h+40>>3]=m*k;f=+g[t>>3];g[h+48>>3]=o*f;g[h+56>>3]=n*f;g[h+64>>3]=m*f;g[h+72>>3]=l;g[h+80>>3]=k;g[h+88>>3]=f;f=+g[s>>3];g[h+96>>3]=o*f;g[h+104>>3]=n*f;g[h+112>>3]=m*f;k=+g[r>>3];g[h+120>>3]=o*k;g[h+128>>3]=n*k;g[h+136>>3]=m*k;l=+g[q>>3];g[h+144>>3]=o*l;g[h+152>>3]=n*l;g[h+160>>3]=m*l;g[h+168>>3]=f;g[h+176>>3]=k;g[h+184>>3]=l;l=+g[p>>3];g[h+192>>3]=o*l;g[h+200>>3]=n*l;g[h+208>>3]=m*l;k=+g[d>>3];g[h+216>>3]=o*k;g[h+224>>3]=n*k;g[h+232>>3]=m*k;f=+g[e>>3];g[h+240>>3]=o*f;g[h+248>>3]=n*f;g[h+256>>3]=m*f;g[h+264>>3]=l;g[h+272>>3]=k;g[h+280>>3]=f;xe(i);c=0;while(1){if((c|0)==3)break;d=0;while(1){if((d|0)==6)break;e=a+(c*48|0)+(d<<3)|0;g[e>>3]=0.0;b=0;f=0.0;while(1){if((b|0)==12)break;o=f+ +g[h+(c*96|0)+(b<<3)>>3]*+g[i+(b*48|0)+(d<<3)>>3];g[e>>3]=o;b=b+1|0;f=o}d=d+1|0}c=c+1|0}yb=j;return}function we(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0,h=0,i=0.0,j=0,k=0.0,l=0,m=0,n=0,o=0.0,p=0,q=0.0,r=0.0;o=+g[b>>3];r=+g[c>>3];p=b+8|0;q=+g[c+8>>3];n=b+16|0;d=+g[c+16>>3];e=+g[b+24>>3]+(o*r+ +g[p>>3]*q+ +g[n>>3]*d);c=b+32|0;f=b+40|0;h=b+48|0;i=+g[b+56>>3]+(r*+g[c>>3]+q*+g[f>>3]+d*+g[h>>3]);j=b+64|0;k=+g[j>>3];l=b+72|0;m=b+80|0;d=+g[b+88>>3]+(r*k+q*+g[l>>3]+d*+g[m>>3]);if(d==0.0)c=-1;else{r=d*d;g[a>>3]=(o*d-e*k)/r;g[a+8>>3]=(d*+g[p>>3]-e*+g[l>>3])/r;g[a+16>>3]=(d*+g[n>>3]-e*+g[m>>3])/r;g[a+24>>3]=(d*+g[c>>3]-i*+g[j>>3])/r;g[a+32>>3]=(d*+g[f>>3]-i*+g[l>>3])/r;g[a+40>>3]=(d*+g[h>>3]-i*+g[m>>3])/r;c=0}return c|0}function xe(a){a=a|0;var b=0,d=0,e=0;b=a+64|0;d=a;e=d+64|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(e|0));g[b>>3]=-1.0;b=a+72|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;g[a+104>>3]=1.0;b=a+160|0;d=a+112|0;e=d+48|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(e|0));g[b>>3]=1.0;b=a+240|0;d=a+168|0;e=d+72|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(e|0));g[b>>3]=-1.0;b=a+296|0;d=a+248|0;e=d+48|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(e|0));g[b>>3]=-1.0;b=a+304|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;g[a+336>>3]=1.0;b=a+456|0;d=a+344|0;e=d+112|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(e|0));g[b>>3]=1.0;b=a+512|0;d=a+464|0;e=d+48|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(e|0));g[b>>3]=1.0;b=a+568|0;d=a+520|0;e=d+48|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(e|0));g[b>>3]=1.0;return}function ye(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=yb;yb=yb+48|0;h=i+24|0;g=i+12|0;f=i;c[h+4>>2]=6;c[h+8>>2]=1;c[h>>2]=a;c[g+4>>2]=e;c[g+8>>2]=1;c[g>>2]=b;c[f+4>>2]=e;c[f+8>>2]=6;c[f>>2]=d;d=Gd(f)|0;do if(d){b=Ed(d,f)|0;if(!b){Jd(d)|0;a=-1;break}a=Ed(d,g)|0;if(!a){Jd(d)|0;Jd(b)|0;a=-1;break}if((Vd(b)|0)<0){Jd(d)|0;Jd(b)|0;Jd(a)|0;a=-1;break}else{Ld(h,b,a)|0;Jd(d)|0;Jd(b)|0;Jd(a)|0;a=0;break}}else a=-1;while(0);yb=i;return a|0}function ze(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,h=0,i=0,j=0;j=yb;yb=yb+256|0;f=j+192|0;h=j+96|0;i=j;Ae(f,b);Be(h,f);b=0;while(1){if((b|0)==3)break;d=a+(b<<5)|0;e=a+(b<<5)+8|0;f=a+(b<<5)+16|0;c=0;while(1){if((c|0)==4)break;g[i+(b<<5)+(c<<3)>>3]=+g[d>>3]*+g[h+(c<<3)>>3]+ +g[e>>3]*+g[h+32+(c<<3)>>3]+ +g[f>>3]*+g[h+64+(c<<3)>>3];c=c+1|0}f=i+(b<<5)+24|0;g[f>>3]=+g[a+(b<<5)+24>>3]+ +g[f>>3];b=b+1|0}b=0;while(1){if((b|0)==3)break;c=0;while(1){if((c|0)==4)break;g[a+(b<<5)+(c<<3)>>3]=+g[i+(b<<5)+(c<<3)>>3];c=c+1|0}b=b+1|0}yb=j;return 0}function Ae(a,b){a=a|0;b=b|0;var c=0.0,d=0.0,e=0,f=0,h=0.0;d=+g[b>>3];e=b+8|0;h=+g[e>>3];f=b+16|0;c=+g[f>>3];c=d*d+h*h+c*c;if(c==0.0){g[a>>3]=1.0;g[a+8>>3]=0.0;d=0.0;c=0.0}else{c=+u(+c);g[a>>3]=d/c;g[a+8>>3]=+g[e>>3]/c;d=c;c=+g[f>>3]/c}g[a+16>>3]=c;g[a+24>>3]=d;g[a+32>>3]=+g[b+24>>3];g[a+40>>3]=+g[b+32>>3];g[a+48>>3]=+g[b+40>>3];return}function Be(a,b){a=a|0;b=b|0;var c=0.0,d=0.0,e=0.0,f=0,h=0,i=0.0;c=+g[b+24>>3];e=+w(+c);d=1.0-e;c=+x(+c);i=+g[b>>3];g[a>>3]=e+i*i*d;h=b+8|0;f=b+16|0;g[a+8>>3]=d*(+g[b>>3]*+g[h>>3])-c*+g[f>>3];g[a+16>>3]=d*(+g[b>>3]*+g[f>>3])+c*+g[h>>3];g[a+24>>3]=+g[b+32>>3];g[a+32>>3]=d*(+g[h>>3]*+g[b>>3])+c*+g[f>>3];i=+g[h>>3];g[a+40>>3]=e+d*(i*i);g[a+48>>3]=d*(+g[h>>3]*+g[f>>3])-c*+g[b>>3];g[a+56>>3]=+g[b+40>>3];g[a+64>>3]=d*(+g[f>>3]*+g[b>>3])-c*+g[h>>3];g[a+72>>3]=d*(+g[f>>3]*+g[h>>3])+c*+g[b>>3];c=+g[f>>3];g[a+80>>3]=e+d*(c*c);g[a+88>>3]=+g[b+48>>3];return}function Ce(a){a=a|0;var b=0,d=0,e=0;b=DO(136)|0;if(!b)b=0;else{d=0;while(1){if((d|0)==3)break;e=0;while(1){if((e|0)==4)break;g[b+(d<<5)+(e<<3)>>3]=+g[a+(d<<5)+(e<<3)>>3];e=e+1|0}d=d+1|0}c[b+96>>2]=10;g[b+104>>3]=.10000000149011612;g[b+112>>3]=.9900000095367432;g[b+120>>3]=4.0;g[b+128>>3]=.5}return b|0}function De(a){a=a|0;var b=0;b=c[a>>2]|0;if(!b)a=-1;else{EO(b);c[a>>2]=0;a=0}return a|0}function Ee(a,b){a=a|0;b=+b;if(!a)a=-1;else{g[a+128>>3]=b;a=0}return a|0}function Fe(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=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.0,z=0.0;x=yb;yb=yb+176|0;j=x+168|0;i=x+160|0;s=x+144|0;t=x+48|0;u=x;v=b+8|0;h=c[v>>2]|0;do if((h|0)>=3){w=DO(h*96|0)|0;if(!w){Se(0,3,41875,i);h=-1;break}r=DO(h<<4)|0;if(!r){Se(0,3,41875,j);EO(w);h=-1;break}h=0;while(1){if((h|0)==3)break;i=0;while(1){if((i|0)==4)break;g[e+(h<<5)+(i<<3)>>3]=+g[d+(h<<5)+(i<<3)>>3];i=i+1|0}h=h+1|0}d=b+4|0;m=s+8|0;n=a+104|0;o=a+96|0;p=a+120|0;q=a+112|0;l=0.0;j=0;a:while(1){sd(a,e,t)|0;k=0.0;i=0;while(1){h=c[v>>2]|0;if((i|0)>=(h|0))break;if((te(s,t,(c[d>>2]|0)+(i*24|0)|0)|0)<0){i=16;break a}h=c[b>>2]|0;z=+g[h+(i<<4)>>3]-+g[s>>3];y=+g[h+(i<<4)+8>>3]-+g[m>>3];h=i<<1;g[r+(h<<3)>>3]=z;g[r+((h|1)<<3)>>3]=y;k=k+(z*z+y*y);i=i+1|0}k=k/+(h|0);if(k<+g[n>>3]){i=31;break}if((j|0?k<+g[p>>3]:0)?k/l>+g[q>>3]:0){i=31;break}if((j|0)==(c[o>>2]|0)){i=31;break}i=0;while(1){if((i|0)>=(h|0))break;if((ue(w+(i*12<<3)|0,a,e,(c[d>>2]|0)+(i*24|0)|0)|0)<0){i=27;break a}i=i+1|0;h=c[v>>2]|0}if((ye(u,r,w,h<<1)|0)<0){i=29;break}ze(e,u)|0;l=k;j=j+1|0}if((i|0)==16){Ge(w,r);h=-1;break}else if((i|0)==27){Ge(w,r);h=-1;break}else if((i|0)==29){Ge(w,r);h=-1;break}else if((i|0)==31){g[f>>3]=k;EO(w);EO(r);h=0;break}}else h=-1;while(0);yb=x;return h|0}function Ge(a,b){a=a|0;b=b|0;EO(a);EO(b);return}function He(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.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;F=yb;yb=yb+192|0;l=F+184|0;k=F+176|0;j=F+168|0;h=F+160|0;A=F+144|0;B=F+48|0;C=F;D=b+8|0;i=c[D>>2]|0;do if((i|0)>=4){m=~~(+g[a+128>>3]*+(i|0))+-1|0;m=(m|0)>3?m:3;E=DO(i*96|0)|0;if(!E){Se(0,3,41875,h);h=-1;break}z=DO(i<<4)|0;if(!z){Se(0,3,41875,j);EO(E);h=-1;break}h=i<<3;y=DO(h)|0;if(!y){Se(0,3,41875,k);EO(E);EO(z);h=-1;break}x=DO(h)|0;if(!x){Se(0,3,41875,l);EO(E);EO(z);EO(y);h=-1;break}h=0;while(1){if((h|0)==3)break;i=0;while(1){if((i|0)==4)break;g[e+(h<<5)+(i<<3)>>3]=+g[d+(h<<5)+(i<<3)>>3];i=i+1|0}h=h+1|0}v=b+4|0;w=A+8|0;d=x+(m<<3)|0;m=a+104|0;s=a+96|0;t=a+120|0;u=a+112|0;q=0.0;l=0;a:while(1){sd(a,e,B)|0;h=0;while(1){i=c[D>>2]|0;if((h|0)>=(i|0))break;if((te(A,B,(c[v>>2]|0)+(h*24|0)|0)|0)<0){i=20;break a}k=c[b>>2]|0;p=+g[k+(h<<4)>>3]-+g[A>>3];r=+g[k+(h<<4)+8>>3]-+g[w>>3];k=h<<1;g[z+(k<<3)>>3]=p;g[z+((k|1)<<3)>>3]=r;r=p*p+r*r;g[x+(h<<3)>>3]=r;g[y+(h<<3)>>3]=r;h=h+1|0}my(x,i,8,18);r=+g[d>>3]*4.0;r=r<16.0?16.0:r;i=c[D>>2]|0;p=r/6.0;o=0.0;h=0;while(1){if((h|0)>=(i|0))break;n=+g[x+(h<<3)>>3];if(n>r)n=p;else{n=1.0-n/r;n=p*(1.0-n*(n*n))}o=o+n;h=h+1|0}o=o/+(i|0);if(o<+g[m>>3]){i=44;break}if((l|0?o<+g[t>>3]:0)?o/q>+g[u>>3]:0){i=44;break}if((l|0)==(c[s>>2]|0)){i=44;break}h=0;k=0;while(1){if((k|0)>=(i|0))break;n=+g[y+(k<<3)>>3];if(n<=r){j=h*6|0;i=E+(j<<3)|0;if((ue(i,a,e,(c[v>>2]|0)+(k*24|0)|0)|0)<0){i=36;break a}q=1.0-n/r;q=q*q;g[i>>3]=q*+g[i>>3];i=E+((j|1)<<3)|0;g[i>>3]=q*+g[i>>3];i=E+(j+2<<3)|0;g[i>>3]=q*+g[i>>3];i=E+(j+3<<3)|0;g[i>>3]=q*+g[i>>3];i=E+(j+4<<3)|0;g[i>>3]=q*+g[i>>3];i=E+(j+5<<3)|0;g[i>>3]=q*+g[i>>3];i=E+(j+6<<3)|0;g[i>>3]=q*+g[i>>3];i=E+(j+7<<3)|0;g[i>>3]=q*+g[i>>3];i=E+(j+8<<3)|0;g[i>>3]=q*+g[i>>3];i=E+(j+9<<3)|0;g[i>>3]=q*+g[i>>3];i=E+(j+10<<3)|0;g[i>>3]=q*+g[i>>3];i=E+(j+11<<3)|0;g[i>>3]=q*+g[i>>3];i=k<<1;g[z+(h<<3)>>3]=q*+g[z+(i<<3)>>3];g[z+(h+1<<3)>>3]=q*+g[z+((i|1)<<3)>>3];h=h+2|0;i=c[D>>2]|0}k=k+1|0}if((h|0)<6){i=40;break}if((ye(C,z,E,h)|0)<0){i=42;break}ze(e,C)|0;q=o;l=l+1|0}if((i|0)==20){Ie(E,z,y,x);h=-1;break}else if((i|0)==36){Ie(E,z,y,x);h=-1;break}else if((i|0)==40){Ie(E,z,y,x);h=-1;break}else if((i|0)==42){Ie(E,z,y,x);h=-1;break}else if((i|0)==44){g[f>>3]=o;EO(E);EO(z);EO(y);EO(x);h=0;break}}else h=-1;while(0);yb=F;return h|0}function Ie(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;EO(a);EO(b);EO(c);EO(d);return}function Je(a,b){a=a|0;b=b|0;var c=0.0;c=+g[a>>3]-+g[b>>3];return (c<0.0?-1:c>0.0&1)|0}function Ke(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var 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,v=0,w=0,x=0,y=0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0;t=yb;yb=yb+128|0;s=t+120|0;p=t+112|0;o=t+104|0;m=t+96|0;l=t+88|0;j=t+80|0;i=t+72|0;r=t;a:do if((e|0)>=4){h=0;while(1){if((h|0)>=(e|0))break;if(+g[d+(h*24|0)+16>>3]!=0.0){h=-1;break a}else h=h+1|0}if((((((((!(+g[a>>3]==0.0)?!(+g[a+32>>3]!=0.0):0)?(q=a+40|0,!(+g[q>>3]==0.0)):0)?!(+g[a+64>>3]!=0.0):0)?!(+g[a+72>>3]!=0.0):0)?!(+g[a+80>>3]!=1.0):0)?!(+g[a+24>>3]!=0.0):0)?!(+g[a+56>>3]!=0.0):0)?!(+g[a+88>>3]!=0.0):0){h=e<<1;n=Bd(h,8)|0;if(!n){Se(0,3,20681,i);h=-1;break}k=Bd(h,1)|0;if(!k){Jd(n)|0;Se(0,3,20707,j);h=-1;break}h=0;while(1){if((h|0)==(e|0))break;y=d+(h*24|0)|0;j=c[n>>2]|0;i=h<<4;g[j+(i<<3)>>3]=+g[y>>3];x=d+(h*24|0)+8|0;g[j+((i|1)<<3)>>3]=+g[x>>3];g[j+((i|2)<<3)>>3]=1.0;g[j+((i|3)<<3)>>3]=0.0;g[j+((i|4)<<3)>>3]=0.0;g[j+((i|5)<<3)>>3]=0.0;w=b+(h<<4)|0;g[j+((i|6)<<3)>>3]=-(+g[y>>3]*+g[w>>3]);g[j+((i|7)<<3)>>3]=-(+g[x>>3]*+g[w>>3]);g[j+((i|8)<<3)>>3]=0.0;g[j+((i|9)<<3)>>3]=0.0;g[j+((i|10)<<3)>>3]=0.0;g[j+((i|11)<<3)>>3]=+g[y>>3];g[j+((i|12)<<3)>>3]=+g[x>>3];g[j+((i|13)<<3)>>3]=1.0;v=b+(h<<4)+8|0;g[j+((i|14)<<3)>>3]=-(+g[y>>3]*+g[v>>3]);g[j+((i|15)<<3)>>3]=-(+g[x>>3]*+g[v>>3]);i=c[k>>2]|0;j=h<<1;g[i+(j<<3)>>3]=+g[w>>3];g[i+((j|1)<<3)>>3]=+g[v>>3];h=h+1|0}b=Gd(n)|0;if(!b){Jd(n)|0;Jd(k)|0;Se(0,3,20733,l);h=-1;break}j=Ed(b,n)|0;if(!j){Jd(n)|0;Jd(k)|0;Jd(b)|0;Se(0,3,20759,m);h=-1;break}i=Ed(b,k)|0;if(!i){Jd(n)|0;Jd(k)|0;Jd(b)|0;Jd(j)|0;Se(0,3,20785,o);h=-1;break}if((Vd(j)|0)<0){Jd(n)|0;Jd(k)|0;Jd(b)|0;Jd(j)|0;Jd(i)|0;Se(0,3,20811,p);h=-1;break}h=Ed(j,i)|0;if(!h){Jd(n)|0;Jd(k)|0;Jd(b)|0;Jd(j)|0;Jd(i)|0;Se(0,3,20837,s);h=-1;break}else{p=c[h>>2]|0;H=+g[p+48>>3];w=r+16|0;E=+g[a+48>>3];A=+g[q>>3];K=(+g[p+24>>3]-H*E)/A;s=r+8|0;D=+g[a+16>>3];C=+g[a+8>>3];B=+g[a>>3];N=(+g[p>>3]-H*D-K*C)/B;I=+g[p+56>>3];v=r+40|0;L=(+g[p+32>>3]-E*I)/A;x=r+32|0;J=(+g[p+8>>3]-D*I-C*L)/B;y=r+24|0;A=(+g[p+40>>3]-E)/A;E=+g[p+16>>3];Jd(n)|0;Jd(k)|0;Jd(b)|0;Jd(j)|0;Jd(i)|0;Jd(h)|0;M=+u(+(H*H+(K*K+N*N)));z=+u(+(I*I+(L*L+J*J)));g[r>>3]=N/M;g[s>>3]=K/M;g[w>>3]=H/M;g[y>>3]=J/z;g[x>>3]=L/z;g[v>>3]=I/z;z=(M+z)*.5;Le(r);M=+g[s>>3];I=+g[v>>3];L=+g[w>>3];J=+g[x>>3];H=M*I-L*J;K=+g[y>>3];N=+g[r>>3];G=L*K-I*N;O=J*N-M*K;F=+u(+(O*O+(H*H+G*G)));H=H/F;g[r+48>>3]=H;G=G/F;g[r+56>>3]=G;F=O/F;g[r+64>>3]=F;g[f>>3]=N;g[f+32>>3]=M;g[f+64>>3]=L;g[f+8>>3]=K;g[f+40>>3]=J;g[f+72>>3]=I;g[f+16>>3]=H;g[f+48>>3]=G;g[f+80>>3]=F;g[f+24>>3]=(E-D-C*A)/B/z;g[f+56>>3]=A/z;g[f+88>>3]=1.0/z;h=0;break}}else h=-1}else h=-1;while(0);yb=t;return h|0}function Le(a){a=a|0;var b=0.0,c=0.0,d=0.0,e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0,L=0,M=0,N=0,O=0,P=0;l=+g[a>>3];L=a+8|0;o=+g[L>>3];M=a+16|0;p=+g[M>>3];N=a+24|0;B=+g[N>>3];O=a+32|0;C=+g[O>>3];K=a+40|0;f=+g[K>>3];b=o*f-p*C;c=p*B-l*f;d=l*C-o*B;e=+u(+(d*d+(b*b+c*c)));do if(!(e==0.0)){m=b/e;k=c/e;j=d/e;A=l*B+o*C+p*f;A=A<0.0?-A:A;A=(+u(+(A+1.0))+ +u(+(1.0-A)))*.5;d=l*k;b=o*m;c=d-b;if(c!=0.0){n=0;y=m;h=l;i=o;z=k;e=p}else{P=l*j-p*m!=0.0;i=P?p:o;h=P?l:p;z=P?j:k;y=P?m:j;d=h*z;c=i*y;n=P?1:2;b=c;c=d-c;e=P?o:l;j=P?k:m}if(!(c==0.0)?(t=(i*j-e*z)/c,v=A*z/c,x=b-d,w=(h*j-e*y)/x,x=A*y/x,r=t*t+w*w+1.0,s=t*v+w*x,q=s*s-r*(v*v+x*x+-1.0),!(q<0.0)):0){d=+u(+q);h=(d-s)/r;i=v+t*h;e=x+w*h;d=(-s-d)/r;c=v+t*d;b=x+w*d;switch(n&3){case 1:{t=b;s=d;q=c;r=e;p=h;o=i;l=y;m=j;b=z;break}case 2:{t=c;s=b;q=d;r=i;p=e;o=h;l=j;m=z;b=y;break}default:{t=d;s=b;q=c;r=h;p=e;o=i;l=y;m=z;b=j}}c=B*m;d=C*l;e=c-d;if(e!=0.0){n=0;h=l;i=B;j=C;k=m}else{P=B*b-f*l!=0.0;j=P?f:C;i=P?B:f;k=P?b:m;h=P?l:b;f=i*k;e=j*h;n=P?1:2;c=f;d=e;e=f-e;f=P?C:B;b=P?m:l}if(!(e==0.0)?(G=(j*b-f*k)/e,H=A*k/e,J=d-c,I=(i*b-f*h)/J,J=A*h/J,E=G*G+I*I+1.0,F=G*H+I*J,D=F*F-E*(H*H+J*J+-1.0),!(D<0.0)):0){j=+u(+D);h=(j-F)/E;d=H+G*h;i=J+I*h;j=(-F-j)/E;c=H+G*j;b=J+I*j;switch(n&3){case 1:{l=b;b=j;j=c;k=i;i=h;h=d;break}case 2:{l=c;k=d;break}default:{l=j;j=c;k=h;h=d}}f=o*h+p*i+r*k;f=f<0.0?-f:f;e=o*j+p*b+r*l;e=e<0.0?-e:e;d=q*h+s*i+t*k;d=d<0.0?-d:d;c=q*j+s*b+t*l;c=c<0.0?-c:c;if(f>3]=o;g[L>>3]=p;g[M>>3]=r;g[N>>3]=h;g[O>>3]=i;g[K>>3]=k;break}else{g[a>>3]=q;g[L>>3]=s;g[M>>3]=t;g[N>>3]=j;g[O>>3]=b;g[K>>3]=l;break}else{g[a>>3]=q;g[L>>3]=s;g[M>>3]=t;if(d>3]=h;g[O>>3]=i;g[K>>3]=k;break}else{g[N>>3]=j;g[O>>3]=b;g[K>>3]=l;break}}else if(e>3]=o;g[L>>3]=p;g[M>>3]=r;g[N>>3]=j;g[O>>3]=b;g[K>>3]=l;break}else{g[a>>3]=q;g[L>>3]=s;g[M>>3]=t;g[N>>3]=j;g[O>>3]=b;g[K>>3]=l;break}else{g[a>>3]=q;g[L>>3]=s;g[M>>3]=t;if(d>3]=h;g[O>>3]=i;g[K>>3]=k;break}else{g[N>>3]=j;g[O>>3]=b;g[K>>3]=l;break}}}}}while(0);return}function Me(a){a=a|0;EO(c[a>>2]|0);EO(a);return 0}function Ne(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return +(+Oe(a,b,c,d,0))}function Oe(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0.0,i=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,y=0,z=0,A=0,B=0,C=0;C=yb;yb=yb+208|0;w=C+200|0;v=C+192|0;y=C+96|0;x=C;z=e+4|0;i=c[z>>2]|0;u=e+112|0;p=e+120|0;o=0;while(1){if((o|0)>=(i|0))break;q=c[e>>2]|0;r=q+(o*320|0)|0;if(!(c[q+(o*320|0)+4>>2]|0)){j=-1;k=0;while(1){if((k|0)>=(d|0))break;if((c[b+(k<<8)+8>>2]|0)==(c[r>>2]|0)?(l=+g[b+(k<<8)+40>>3],!(l<+g[u>>3])):0)if(!((j|0)!=-1?!(+g[b+(j<<8)+40>>3]>2]=j;if((j|0)>-1)c[b+(j<<8)+16>>2]=c[b+(j<<8)+20>>2]}else{n=q+(o*320|0)+312|0;m=0;j=-1;while(1){if((m|0)>=(d|0))break;k=c[b+(m<<8)+12>>2]|0;if((k|0)==0?(t=b+(m<<8)+248|0,s=c[t>>2]|0,t=c[t+4>>2]|0,!((s|0)==0&(t|0)==0)):0){k=n;if((s|0)==(c[k>>2]|0)?(t|0)==(c[k+4>>2]|0):0)B=20}else if((k|0)==(c[r>>2]|0))B=20;if((B|0)==20){B=0;h=+g[b+(m<<8)+48>>3];if(!(h<+g[p>>3]))if(!((j|0)!=-1?!(+g[b+(j<<8)+48>>3]>2]=j;if((j|0)>-1)c[b+(j<<8)+16>>2]=c[b+(j<<8)+24>>2]}o=o+1|0}p=0;n=0;j=0;o=0;while(1){if((o|0)>=(i|0))break;i=c[e>>2]|0;k=c[i+(o*320|0)+304>>2]|0;do if((k|0)<0){k=p;i=n}else{m=b+(k<<8)|0;if(+Sc(a,m,+g[i+(o*320|0)+8>>3],x)>4.0){c[(c[e>>2]|0)+(o*320|0)+304>>2]=-1;i=b+(k<<8)+236|0;if(c[i>>2]|0){k=p;i=n;break}c[i>>2]=7;k=p;i=n;break}k=c[m>>2]|0;a:do if((p|0)==0|(n|0)<(k|0)){i=0;while(1){if((i|0)==3){i=k;j=o;break a}j=0;while(1){if((j|0)==4)break;g[y+(i<<5)+(j<<3)>>3]=+g[x+(i<<5)+(j<<3)>>3];j=j+1|0}i=i+1|0}}else i=n;while(0);k=p+1|0}while(0);p=k;n=i;o=o+1|0;i=c[z>>2]|0}b:do if((p|0)!=0?(p|0)>=(c[e+128>>2]|0):0){sd(y,(c[e>>2]|0)+(j*320|0)+112|0,x)|0;o=p<<2;q=DO(p<<6)|0;if(!q){Se(0,3,41858,v);Ea(1)}p=DO(p*96|0)|0;if(!p){Se(0,3,41858,w);Ea(1)}n=c[z>>2]|0;m=0;i=0;while(1){if((m|0)>=(n|0))break;j=c[e>>2]|0;k=c[j+(m*320|0)+304>>2]|0;if((k|0)>=0){v=c[b+(k<<8)+16>>2]|0;u=(4-v|0)%4|0;w=i<<3;g[q+(w<<3)>>3]=+g[b+(k<<8)+168+(u<<4)>>3];g[q+((w|1)<<3)>>3]=+g[b+(k<<8)+168+(u<<4)+8>>3];u=(5-v|0)%4|0;g[q+((w|2)<<3)>>3]=+g[b+(k<<8)+168+(u<<4)>>3];g[q+((w|3)<<3)>>3]=+g[b+(k<<8)+168+(u<<4)+8>>3];u=(6-v|0)%4|0;g[q+((w|4)<<3)>>3]=+g[b+(k<<8)+168+(u<<4)>>3];g[q+((w|5)<<3)>>3]=+g[b+(k<<8)+168+(u<<4)+8>>3];v=(7-v|0)%4|0;g[q+((w|6)<<3)>>3]=+g[b+(k<<8)+168+(v<<4)>>3];g[q+((w|7)<<3)>>3]=+g[b+(k<<8)+168+(v<<4)+8>>3];w=i*12|0;g[p+(w<<3)>>3]=+g[j+(m*320|0)+208>>3];g[p+((w|1)<<3)>>3]=+g[j+(m*320|0)+216>>3];g[p+((w|2)<<3)>>3]=+g[j+(m*320|0)+224>>3];g[p+((w|3)<<3)>>3]=+g[j+(m*320|0)+232>>3];g[p+(w+4<<3)>>3]=+g[j+(m*320|0)+240>>3];g[p+(w+5<<3)>>3]=+g[j+(m*320|0)+248>>3];g[p+(w+6<<3)>>3]=+g[j+(m*320|0)+256>>3];g[p+(w+7<<3)>>3]=+g[j+(m*320|0)+264>>3];g[p+(w+8<<3)>>3]=+g[j+(m*320|0)+272>>3];g[p+(w+9<<3)>>3]=+g[j+(m*320|0)+280>>3];g[p+(w+10<<3)>>3]=+g[j+(m*320|0)+288>>3];g[p+(w+11<<3)>>3]=+g[j+(m*320|0)+296>>3];i=i+1|0}m=m+1|0}m=e+104|0;j=(f|0)!=0;if(!(c[m>>2]|0)){i=e+8|0;h=+Uc(a,x,q,p,o,i);if(j&h>=20.0){Ee(c[a>>2]|0,.8)|0;h=+Vc(a,x,q,p,o,i);if(h>=20.0){Ee(c[a>>2]|0,.6)|0;h=+Vc(a,x,q,p,o,i);if(h>=20.0){Ee(c[a>>2]|0,.4)|0;h=+Vc(a,x,q,p,o,i);if(h>=20.0){Ee(c[a>>2]|0,0.0)|0;h=+Vc(a,x,q,p,o,i)}}}}EO(p);EO(q)}else{h=+Uc(a,x,q,p,o,y);k=e+8|0;l=+Uc(a,k,q,p,o,k);i=h>3]=+g[y+(j<<5)+(i<<3)>>3];i=i+1|0}j=j+1|0}}else h=l;while(0);if(h>=20.0){Ee(c[a>>2]|0,.8)|0;h=+Vc(a,x,q,p,o,y);l=+Vc(a,k,q,p,o,k);e:do if(h>3]=+g[y+(j<<5)+(i<<3)>>3];i=i+1|0}j=j+1|0}}else h=l;while(0);if(h>=20.0){Ee(c[a>>2]|0,.6)|0;h=+Vc(a,x,q,p,o,y);l=+Vc(a,k,q,p,o,k);f:do if(h>3]=+g[y+(j<<5)+(i<<3)>>3];i=i+1|0}j=j+1|0}}else h=l;while(0);if(h>=20.0){Ee(c[a>>2]|0,.4)|0;h=+Vc(a,x,q,p,o,y);l=+Vc(a,k,q,p,o,k);g:do if(h>3]=+g[y+(j<<5)+(i<<3)>>3];i=i+1|0}j=j+1|0}}else h=l;while(0);if(h>=20.0){Ee(c[a>>2]|0,0.0)|0;h=+Vc(a,x,q,p,o,y);l=+Vc(a,k,q,p,o,k);if(h>3]=+g[y+(j<<5)+(i<<3)>>3];i=i+1|0}j=j+1|0}}else h=l}}}}}else if(i){i=0;while(1){if((i|0)==3)break c;j=0;while(1){if((j|0)==4)break;g[e+8+(i<<5)+(j<<3)>>3]=+g[y+(i<<5)+(j<<3)>>3];j=j+1|0}i=i+1|0}}else h=l;while(0);EO(p);EO(q)}if(h<20.0){c[m>>2]=1;break}c[m>>2]=0;j=c[z>>2]|0;i=0;while(1){if((i|0)>=(j|0))break b;k=c[(c[e>>2]|0)+(i*320|0)+304>>2]|0;if((k|0)>=0?(A=b+(k<<8)+236|0,(c[A>>2]|0)==0):0)c[A>>2]=8;i=i+1|0}}else B=45;while(0);if((B|0)==45){c[e+104>>2]=0;h=-1.0}yb=C;return +h}function Pe(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return +(+Oe(a,b,c,d,1))}function Qe(a,b){a=a|0;b=b|0;var d=0,e=0,f=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,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0.0,V=0.0;T=yb;yb=yb+2528|0;S=T+2512|0;Q=T+2504|0;G=T+2488|0;P=T+2480|0;F=T+2472|0;E=T+2456|0;O=T+2448|0;D=T+2440|0;N=T+2432|0;M=T+2424|0;L=T+2416|0;C=T+2408|0;h=T+2400|0;f=T+2392|0;H=T+2384|0;e=T+2376|0;d=T+2368|0;z=T+2304|0;I=T+2048|0;J=T;A=T+2524|0;R=T+2520|0;B=T+2516|0;K=pz(a,21853)|0;do if(!K){c[d>>2]=a;Se(0,3,20863,d);d=zy(c[(mx()|0)>>2]|0)|0;c[e>>2]=57671;c[e+4>>2]=d;Se(0,3,21881,e);d=0}else{Re(I,K);c[H>>2]=R;if((Az(I,21887,H)|0)!=1){c[f>>2]=a;Se(0,3,20916,f);vz(K)|0;d=0;break}d=c[R>>2]|0;y=DO(d*320|0)|0;if(!y){Se(0,3,41858,h);Ea(1)}p=(b|0)==0;q=z+8|0;r=z+16|0;s=z+24|0;t=z+32|0;u=z+40|0;v=z+48|0;w=z+56|0;x=0;f=0;a:while(1){if((x|0)>=(d|0)){d=31;break}Re(I,K);d=y+(x*320|0)|0;e=y+(x*320|0)+312|0;c[C>>2]=e;c[C+4>>2]=A;if((Az(I,21017,C)|0)!=1){if(p){d=11;break}if(!(yd(J,a,2048,1)|0)){d=13;break}qA(J,I,2047-(Oy(J)|0)|0)|0;o=qd(b,J)|0;c[d>>2]=o;if((o|0)<0){d=15;break}else{d=1;e=0}}else{e=c[e>>2]|0;c[d>>2]=(e&-32768|0)==0&0==0?e&32767:0;d=2;e=1}c[y+(x*320|0)+4>>2]=e;f=f|d;Re(I,K);e=y+(x*320|0)+8|0;c[D>>2]=e;if((Az(I,21313,D)|0)!=1){d=18;break}Re(I,K);m=y+(x*320|0)+16|0;n=y+(x*320|0)+24|0;o=y+(x*320|0)+40|0;c[E>>2]=m;c[E+4>>2]=n;c[E+8>>2]=y+(x*320|0)+32;c[E+12>>2]=o;if((Az(I,21422,E)|0)==4)d=1;else{c[F>>2]=H;c[F+4>>2]=B;if((Az(I,21438,F)|0)!=2){d=23;break}d=0}do{Re(I,K);c[G>>2]=y+(x*320|0)+16+(d<<5);c[G+4>>2]=y+(x*320|0)+16+(d<<5)+8;c[G+8>>2]=y+(x*320|0)+16+(d<<5)+16;c[G+12>>2]=y+(x*320|0)+16+(d<<5)+24;if((Az(I,21422,G)|0)!=4){d=25;break a}d=d+1|0}while(d>>>0<3);vd(m,y+(x*320|0)+112|0)|0;V=+g[e>>3];U=V*-.5;g[z>>3]=U;V=V*.5;g[q>>3]=V;g[r>>3]=V;g[s>>3]=V;g[t>>3]=V;g[u>>3]=U;g[v>>3]=U;g[w>>3]=U;e=y+(x*320|0)+48|0;h=y+(x*320|0)+56|0;i=y+(x*320|0)+72|0;j=y+(x*320|0)+80|0;k=y+(x*320|0)+88|0;l=y+(x*320|0)+104|0;d=0;while(1){if((d|0)==4)break;U=+g[z+(d<<4)>>3];V=+g[z+(d<<4)+8>>3];g[y+(x*320|0)+208+(d*24|0)>>3]=+g[o>>3]+(+g[m>>3]*U+ +g[n>>3]*V);g[y+(x*320|0)+208+(d*24|0)+8>>3]=+g[i>>3]+(U*+g[e>>3]+V*+g[h>>3]);g[y+(x*320|0)+208+(d*24|0)+16>>3]=+g[l>>3]+(U*+g[j>>3]+V*+g[k>>3]);d=d+1|0}x=x+1|0;d=c[R>>2]|0}if((d|0)==11){c[L>>2]=a;c[L+4>>2]=I;Se(0,3,21024,L)}else if((d|0)==13){c[M>>2]=a;Se(0,3,21152,M)}else if((d|0)==15){c[N>>2]=a;c[N+4>>2]=J;Se(0,3,21236,N)}else if((d|0)==18){c[O>>2]=a;c[O+4>>2]=x+1;Se(0,3,21317,O)}else if((d|0)==23){c[P>>2]=a;c[P+4>>2]=x+1;Se(0,3,21444,P)}else if((d|0)==25){c[Q>>2]=a;c[Q+4>>2]=x+1;Se(0,3,21444,Q)}else if((d|0)==31){vz(K)|0;d=DO(136)|0;if(!d){Se(0,3,41858,S);Ea(1)}c[d>>2]=y;c[d+4>>2]=c[R>>2];c[d+128>>2]=0;c[d+104>>2]=0;do if((f&3|0)!=3){e=d+108|0;if(!(f&1)){c[e>>2]=1;break}else{c[e>>2]=0;break}}else c[d+108>>2]=2;while(0);g[d+112>>3]=.5;g[d+120>>3]=.5;break}vz(K)|0;EO(y);d=0}while(0);yb=T;return d|0}function Re(b,c){b=b|0;c=c|0;var d=0,e=0;a:while(1){if(!(yz(b,256,c)|0))break;d=Oy(b)|0;b:while(1){if(!d)break;d=d+-1|0;e=b+d|0;switch(a[e>>0]|0){case 13:case 10:break;default:break b}a[e>>0]=0}switch(a[b>>0]|0){case 0:case 35:break;default:break a}}return}function Se(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0;g=yb;yb=yb+16|0;b=g;if((e|0)!=0&(c[3916]|0)<=(d|0)?a[e>>0]|0:0){c[b>>2]=f;Te(0,d,e,b)}yb=g;return}function Te(b,d,e,f){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;l=yb;yb=yb+32|0;j=l+16|0;b=l;if((!((e|0)==0|(c[3916]|0)>(d|0))?a[e>>0]|0:0)?(c[b>>2]=c[f>>2],k=Hx(0,0,e,b)|0,k|0):0){if(d>>>0<4)b=(Oy(c[1744+(d<<2)>>2]|0)|0)+3|0;else b=0;g=b+k|0;h=g+1|0;i=DO(h)|0;if(b|0){c[j>>2]=c[1744+(d<<2)>>2];$y(i,b+1|0,21553,j)|0}Hx(i+b|0,k+1|0,e,f)|0;do if(0){if(0?(m=c[13864]|0,m>>>0<0):0){b=0+m|0;if(g>>>0>(-4-m+0|0)>>>0){a[b>>0]=46;a[b+1>>0]=46;a[b+2>>0]=46;a[b+3>>0]=0;c[13864]=0;break}else{Uz(b,i,h)|0;c[13864]=(c[13864]|0)+g;break}}}else iz(i,c[4001]|0)|0;while(0);EO(i)}yb=l;return}function Ue(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;do if(b){e=pz(b,22236)|0;if(e){Iz(e,0,2)|0;f=fA(e)|0;Iz(e,0,0)|0;g=f+1|0;b=DO(g)|0;if(!b){vz(e)|0;c[(mx()|0)>>2]=48;b=0;break}if(!(eA(b,f,1,e)|0)){EO(b);vz(e)|0;b=0;break}a[b+f>>0]=0;vz(e)|0;if(d)c[d>>2]=g}else b=0}else{c[(mx()|0)>>2]=28;b=0}while(0);return b|0}function Ve(a,b){a=a|0;b=+b;if(!a)a=-1;else{f[a+40>>2]=b;a=0}return a|0}function We(a,b){a=a|0;b=+b;if(!a)a=-1;else{f[a+44>>2]=b;a=0}return a|0}function Xe(a,b){a=a|0;b=b|0;if(!a)a=-1;else{c[a+24>>2]=b;a=0}return a|0}function Ye(a,b){a=a|0;b=b|0;b=(b|0)<40?b:40;if(!a)b=-1;else{c[a+36>>2]=(b|0)>3?b:3;b=0}return b|0}function Ze(a,b){a=a|0;b=b|0;if(!a)a=-1;else{c[a+28>>2]=b;a=0}return a|0}function _e(a,b){a=a|0;b=b|0;if(!a)a=-1;else{c[a+32>>2]=b;a=0}return a|0}function $e(b,e){b=b|0;e=+e;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.0,C=0;z=yb;yb=yb+16|0;w=b+4|0;x=b+12|0;A=+f[x>>2];y=gz(+(c[w>>2]|0)*e/A)|0;t=b+8|0;u=gz(+(c[t>>2]|0)*e/A)|0;v=DO(16)|0;if(!v){Se(0,3,41858,z);Ea(1)}c[v+4>>2]=y;c[v+8>>2]=u;f[v+12>>2]=e;g=DO(B(u,y)|0)|0;c[v>>2]=g;if(!g){Se(0,3,41858,z+8|0);Ea(1)}h=0;while(1){if((h|0)>=(u|0))break;A=+f[x>>2];s=gz(A*+(h|0)/e)|0;h=h+1|0;r=gz(A*+(h|0)/e)|0;i=c[t>>2]|0;r=(r|0)>(i|0)?i:r;i=0;while(1){if((i|0)>=(y|0))break;A=+f[x>>2];q=gz(A*+(i|0)/e)|0;i=i+1|0;p=gz(A*+(i|0)/e)|0;o=c[w>>2]|0;p=(p|0)>(o|0)?o:p;j=0;k=0;l=s;while(1){if((l|0)>=(r|0))break;m=q;n=(c[b>>2]|0)+((B(l,o)|0)+q)|0;while(1){if((m|0)>=(p|0))break;C=j+(d[n>>0]|0)|0;m=m+1|0;n=n+1|0;j=C;k=k+1|0}l=l+1|0}a[g>>0]=(j|0)/(k|0)|0;g=g+1|0}}yb=z;return v|0}function af(a){a=a|0;var b=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;q=yb;yb=yb+96|0;m=q+72|0;l=q+64|0;k=q+56|0;j=q+48|0;i=q+40|0;h=q+32|0;g=q+24|0;e=q+16|0;b=q+8|0;n=q+80|0;d=DO((Oy(a)|0)+6|0)|0;if(!d){Se(0,3,41858,q);Ea(1)}c[b>>2]=a;c[b+4>>2]=21589;Fx(d,21584,b)|0;p=pz(d,22236)|0;EO(d);a:do if(!p){c[e>>2]=a;c[e+4>>2]=21589;Se(0,3,21595,e);b=0}else{b=DO(8)|0;if(!b){Se(0,3,41858,g);Ea(1)}d=b+4|0;if((eA(d,4,1,p)|0)==1?(o=c[d>>2]|0,(o|0)>=1):0){c[i>>2]=o;Se(0,1,21668,i);e=o<<2;g=DO(e)|0;c[b>>2]=g;if(!g){Se(0,3,41858,j);Ea(1)}j=DO(16)|0;c[g>>2]=j;if(!j){Se(0,3,41858,k);Ea(1)}d=df(p)|0;if(!d){c[l>>2]=a;c[l+4>>2]=21589;Se(0,2,21698,l);EO(c[g>>2]|0);EO(g);EO(b);gA(p);b=bf(p)|0;break}if((c[d+4>>2]|0)!=1){c[m>>2]=a;c[m+4>>2]=21589;Se(0,2,21698,m);EO(c[g>>2]|0);EO(g);EO(b);EO(d);vz(p)|0;b=0;break}m=c[g>>2]|0;c[m+4>>2]=c[d+8>>2];c[m+8>>2]=c[d+12>>2];c[m+12>>2]=c[d+16>>2];c[m>>2]=c[d>>2];EO(d);Iz(p,4-e|0,2)|0;e=1;while(1){if((e|0)>=(o|0)){d=29;break}if((eA(n,4,1,p)|0)!=1){d=21;break}m=$e(c[g>>2]|0,+f[n>>2])|0;c[g+(e<<2)>>2]=m;if(!m){d=25;break}e=e+1|0}b:do if((d|0)==21){d=0;while(1){if((d|0)==(e|0))break b;o=g+(d<<2)|0;EO(c[c[o>>2]>>2]|0);EO(c[o>>2]|0);d=d+1|0}}else if((d|0)==25){d=0;while(1){if((d|0)==(e|0))break b;o=g+(d<<2)|0;EO(c[c[o>>2]>>2]|0);EO(c[o>>2]|0);d=d+1|0}}else if((d|0)==29){vz(p)|0;break a}while(0);EO(g)}else Se(0,3,21643,h);EO(b);vz(p)|0;b=0}while(0);yb=q;return b|0}function bf(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;l=yb;yb=yb+48|0;h=l+32|0;g=l+24|0;f=l+16|0;e=l+8|0;b=DO(8)|0;if(!b){Se(0,3,41858,l);Ea(1)}d=b+4|0;a:do if((eA(d,4,1,a)|0)==1?(k=c[d>>2]|0,(k|0)>=1):0){j=DO(k<<2)|0;c[b>>2]=j;if(!j){Se(0,3,41858,f);Ea(1)}d=0;while(1){if((d|0)>=(k|0))break;f=DO(16)|0;c[j+(d<<2)>>2]=f;if(!f){i=12;break}else d=d+1|0}if((i|0)==12){Se(0,3,41858,g);Ea(1)}e=0;while(1){if((e|0)>=(k|0)){i=44;break}d=j+(e<<2)|0;if((eA((c[d>>2]|0)+4|0,4,1,a)|0)!=1){i=15;break}if((eA((c[d>>2]|0)+8|0,4,1,a)|0)!=1){i=22;break}if((eA((c[d>>2]|0)+12|0,4,1,a)|0)!=1){i=29;break}i=c[d>>2]|0;i=DO(B(c[i+8>>2]|0,c[i+4>>2]|0)|0)|0;c[c[d>>2]>>2]=i;if(!i){i=36;break}g=c[d>>2]|0;g=eA(c[g>>2]|0,1,B(c[g+8>>2]|0,c[g+4>>2]|0)|0,a)|0;i=c[d>>2]|0;e=e+1|0;if((g|0)!=(B(c[i+8>>2]|0,c[i+4>>2]|0)|0)){i=38;break}}b:do if((i|0)==15){d=0;while(1){if((d|0)==(e|0))break;EO(c[c[j+(d<<2)>>2]>>2]|0);d=d+1|0}d=0;while(1){if((d|0)==(k|0))break b;EO(c[j+(d<<2)>>2]|0);d=d+1|0}}else if((i|0)==22){d=0;while(1){if((d|0)==(e|0))break;EO(c[c[j+(d<<2)>>2]>>2]|0);d=d+1|0}d=0;while(1){if((d|0)==(k|0))break b;EO(c[j+(d<<2)>>2]|0);d=d+1|0}}else if((i|0)==29){d=0;while(1){if((d|0)==(e|0))break;EO(c[c[j+(d<<2)>>2]>>2]|0);d=d+1|0}d=0;while(1){if((d|0)==(k|0))break b;EO(c[j+(d<<2)>>2]|0);d=d+1|0}}else if((i|0)==36){Se(0,3,41858,h);Ea(1)}else if((i|0)==38){d=0;while(1){if((d|0)==(e|0))break;EO(c[c[j+(d<<2)>>2]>>2]|0);d=d+1|0}d=0;while(1){if((d|0)==(k|0))break b;EO(c[j+(d<<2)>>2]|0);d=d+1|0}}else if((i|0)==44){vz(a)|0;break a}while(0);EO(j);i=46}else i=5;while(0);if((i|0)==5){Se(0,3,21643,e);i=46}if((i|0)==46){EO(b);vz(a)|0;b=0}yb=l;return b|0}function cf(a){a=a|0;var b=0,d=0,e=0;if((a|0)!=0?(b=c[a>>2]|0,(b|0)!=0):0){e=0;while(1){d=c[b>>2]|0;if((e|0)>=(c[b+4>>2]|0))break;EO(c[c[d+(e<<2)>>2]>>2]|0);EO(c[(c[c[a>>2]>>2]|0)+(e<<2)>>2]|0);e=e+1|0;b=c[a>>2]|0}EO(d);EO(c[a>>2]|0);c[a>>2]=0;b=0}else b=-1;return b|0}function df(a){a=a|0;var b=0,d=0;d=yb;yb=yb+16|0;b=DO(20)|0;if(!b){Se(0,3,41858,d);Ea(1)}a=ef(a,b+8|0,b+12|0,b+4|0,b+16|0)|0;c[b>>2]=a;if(!a){EO(b);b=0}yb=d;return b|0}function ef(d,e,g,h,k){d=d|0;e=e|0;g=g|0;h=h|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,C=0,D=0,N=0;N=yb;yb=yb+832|0;z=N+528|0;y=N+520|0;x=N+512|0;A=4;D=DO(40)|0;c[D>>2]=0;C=N+24|0;n=N+536|0;w=N;_O(C|0,0,488)|0;i=0;o=G(63,n|0)|0;l=i;i=0;if((l|0)!=0&(j|0)!=0){m=WO(c[l>>2]|0,D|0,A|0)|0;if(!m)Qa(l|0,j|0);E(j|0)}else m=-1;l=F()|0;if((m|0)!=1){c[C>>2]=o;c[n>>2]=112;D=VO(n+132|0,1,D|0,A|0)|0;A=F()|0;i=0;l=i;i=0;if((l|0)!=0&(j|0)!=0){m=WO(c[l>>2]|0,D|0,A|0)|0;if(!m)Qa(l|0,j|0);E(j|0)}else m=-1;l=F()|0;if((m|0)==1)m=l;else m=0}else m=l;a:while(1){if(m|0){i=0;J(113,C|0);l=i;i=0;if((l|0)!=0&(j|0)!=0){m=WO(c[l>>2]|0,D|0,A|0)|0;if(!m)Qa(l|0,j|0);E(j|0)}else m=-1;l=F()|0;if((m|0)==1){m=l;continue}i=0;M(8,0,3,21756,x|0);l=i;i=0;if((l|0)!=0&(j|0)!=0){m=WO(c[l>>2]|0,D|0,A|0)|0;if(!m)Qa(l|0,j|0);E(j|0)}else m=-1;l=F()|0;if((m|0)==1){m=l;continue}else{m=7;break}}i=0;L(1,C|0,90,488);l=i;i=0;if((l|0)!=0&(j|0)!=0){m=WO(c[l>>2]|0,D|0,A|0)|0;if(!m)Qa(l|0,j|0);E(j|0)}else m=-1;l=F()|0;if((m|0)==1){m=l;continue}i=0;K(39,C|0,d|0);l=i;i=0;if((l|0)!=0&(j|0)!=0){m=WO(c[l>>2]|0,D|0,A|0)|0;if(!m)Qa(l|0,j|0);E(j|0)}else m=-1;l=F()|0;if((m|0)==1){m=l;continue}i=0;m=H(19,C|0,1)|0;l=i;i=0;if((l|0)!=0&(j|0)!=0){n=WO(c[l>>2]|0,D|0,A|0)|0;if(!n)Qa(l|0,j|0);E(j|0)}else n=-1;l=F()|0;if((n|0)==1){m=l;continue}if((m|0)!=1){i=0;M(8,0,3,21782,y|0);l=i;i=0;if((l|0)!=0&(j|0)!=0){m=WO(c[l>>2]|0,D|0,A|0)|0;if(!m)Qa(l|0,j|0);E(j|0)}else m=-1;l=F()|0;if((m|0)==1){m=l;continue}i=0;J(113,C|0);l=i;i=0;if((l|0)!=0&(j|0)!=0){m=WO(c[l>>2]|0,D|0,A|0)|0;if(!m)Qa(l|0,j|0);E(j|0)}else m=-1;l=F()|0;if((m|0)==1){m=l;continue}else{m=14;break}}i=0;G(64,C|0)|0;l=i;i=0;if((l|0)!=0&(j|0)!=0){m=WO(c[l>>2]|0,D|0,A|0)|0;if(!m)Qa(l|0,j|0);E(j|0)}else m=-1;l=F()|0;if((m|0)==1){m=l;continue}t=C+36|0;u=C+28|0;s=B(c[u>>2]|0,c[t>>2]|0)|0;v=C+32|0;l=B(s,c[v>>2]|0)|0;i=0;l=G(65,l|0)|0;m=i;i=0;if((m|0)!=0&(j|0)!=0){n=WO(c[m>>2]|0,D|0,A|0)|0;if(!n)Qa(m|0,j|0);E(j|0)}else n=-1;m=F()|0;if((n|0)==1)continue;if(!l){i=0;M(8,0,3,41858,z|0);l=i;i=0;if((l|0)!=0&(j|0)!=0){m=WO(c[l>>2]|0,D|0,A|0)|0;if(!m)Qa(l|0,j|0);E(j|0)}else m=-1;l=F()|0;if((m|0)==1){m=l;continue}i=0;J(113,C|0);l=i;i=0;if((l|0)!=0&(j|0)!=0){m=WO(c[l>>2]|0,D|0,A|0)|0;if(!m)Qa(l|0,j|0);E(j|0)}else m=-1;l=F()|0;if((m|0)==1){m=l;continue}else{m=20;break}}q=C+140|0;r=C+116|0;p=0;while(1){if((c[q>>2]|0)>>>0>=(c[r>>2]|0)>>>0)break;m=0;while(1){if((m|0)==5)break;c[w+(m<<2)>>2]=l+(B(m+p|0,s)|0);m=m+1|0}i=0;n=I(25,C|0,w|0,5)|0;m=i;i=0;if((m|0)!=0&(j|0)!=0){o=WO(c[m>>2]|0,D|0,A|0)|0;if(!o)Qa(m|0,j|0);E(j|0)}else o=-1;m=F()|0;if((o|0)==1)continue a;p=n+p|0}i=0;G(66,C|0)|0;m=i;i=0;if((m|0)!=0&(j|0)!=0){n=WO(c[m>>2]|0,D|0,A|0)|0;if(!n)Qa(m|0,j|0);E(j|0)}else n=-1;m=F()|0;if((n|0)==1)continue;i=0;J(113,C|0);m=i;i=0;if((m|0)!=0&(j|0)!=0){n=WO(c[m>>2]|0,D|0,A|0)|0;if(!n)Qa(m|0,j|0);E(j|0)}else n=-1;m=F()|0;if((n|0)!=1){m=30;break}}b:do if((m|0)==7)l=0;else if((m|0)==14)l=0;else if((m|0)==20)l=0;else if((m|0)==30){if(e|0)c[e>>2]=c[u>>2];if(g|0)c[g>>2]=c[v>>2];if(h|0)c[h>>2]=c[t>>2];if(k){m=a[C+290>>0]|0;switch(m<<24>>24){case 1:{m=b[C+292>>1]|0;if(m<<16>>16==(b[C+294>>1]|0)){f[k>>2]=+(m&65535);break b}break}case 2:{m=b[C+292>>1]|0;if(m<<16>>16==(b[C+294>>1]|0)){f[k>>2]=+(m&65535)*2.5399999618530273;break b}break}default:if(((m&255)>2?(b[C+292>>1]|0)==0:0)?(b[C+294>>1]|0)==0:0){f[k>>2]=+(m&255);break b}}f[k>>2]=0.0}}while(0);EO(D|0);yb=N;return l|0}function ff(a){a=a|0;Qa((c[a>>2]|0)+132|0,1)}function gf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=yb;yb=yb+1088|0;m=o+1072|0;l=o+1064|0;n=o+1056|0;g=o+1048|0;f=o+1040|0;e=o+1032|0;h=o+1024|0;i=o+768|0;j=o+512|0;k=o;c[h>>2]=a;c[h+4>>2]=b;Fx(k,22627,h)|0;k=pz(k,21853)|0;if(!k)a=0;else{a=DO(8)|0;if(!a){Se(0,3,41858,e);Ea(1)}a:do if(hf(i,k)|0){h=a+4|0;c[f>>2]=h;if((Az(i,21887,f)|0)!=1){EO(a);a=0;break}b=c[h>>2]|0;if((b|0)<1){EO(a);a=0;break}f=DO(b*56|0)|0;c[a>>2]=f;if(!f){Se(0,3,41858,g);Ea(1)}f=0;b:while(1){if((f|0)>=(b|0))break a;if(!(hf(i,k)|0)){b=15;break}c[n>>2]=j;if((Az(i,21914,n)|0)!=1){b=17;break}g=qd(d,j)|0;e=c[a>>2]|0;c[e+(f*56|0)+4>>2]=g;if((g|0)<0){b=19;break}if(!(hf(i,k)|0)){b=21;break}c[l>>2]=(c[a>>2]|0)+(f*56|0);if((Az(i,21815,l)|0)!=1){b=24;break}b=0;while(1){if(b>>>0>=3)break;if(!(hf(i,k)|0)){b=27;break b}g=c[a>>2]|0;c[m>>2]=g+(f*56|0)+8+(b<<4);c[m+4>>2]=g+(f*56|0)+8+(b<<4)+4;c[m+8>>2]=g+(f*56|0)+8+(b<<4)+8;c[m+12>>2]=g+(f*56|0)+8+(b<<4)+12;if((Az(i,22080,m)|0)==4)b=b+1|0;else{b=29;break b}}f=f+1|0;b=c[h>>2]|0}if((b|0)==15){EO(c[a>>2]|0);EO(a);a=0;break}else if((b|0)==17){EO(c[a>>2]|0);EO(a);a=0;break}else if((b|0)==19){EO(e);EO(a);a=0;break}else if((b|0)==21){EO(c[a>>2]|0);EO(a);a=0;break}else if((b|0)==24){EO(c[a>>2]|0);EO(a);a=0;break}else if((b|0)==27){EO(c[a>>2]|0);EO(a);a=0;break}else if((b|0)==29){EO(c[a>>2]|0);EO(a);a=0;break}}else{EO(a);a=0}while(0);vz(k)|0}yb=o;return a|0}function hf(b,c){b=b|0;c=c|0;var d=0;a:while(1){d=yz(b,256,c)|0;if(!d){d=0;break}switch(a[b>>0]|0){case 35:case 10:break;default:break a}}return d|0}function jf(a,b){a=a|0;b=b|0;var 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;v=yb;yb=yb+640|0;s=v+624|0;r=v+616|0;q=v+608|0;p=v+600|0;o=v+592|0;n=v+584|0;m=v+576|0;l=v+568|0;k=v+560|0;j=v+552|0;g=v+544|0;f=v+536|0;e=v+528|0;d=v+520|0;i=v+512|0;t=v;c[i>>2]=a;c[i+4>>2]=b;Fx(t,22627,i)|0;t=pz(t,22236)|0;if(!t){c[d>>2]=a;Se(0,3,21818,d);b=0}else{b=DO(8)|0;if(!b){Se(0,3,41858,e);Ea(1)}a=b+4|0;a:do if((eA(a,4,1,t)|0)==1){h=c[a>>2]|0;i=DO(h*20|0)|0;c[b>>2]=i;if(!i){Se(0,3,41858,g);Ea(1)}g=0;b:while(1){if((g|0)>=(h|0))break a;if((eA(i+(g*20|0)+8|0,4,1,t)|0)!=1){u=12;break}if((eA(i+(g*20|0)+12|0,4,1,t)|0)!=1){u=15;break}if((eA(i+(g*20|0)+16|0,4,1,t)|0)!=1){u=17;break}e=i+(g*20|0)+4|0;if((eA(e,4,1,t)|0)!=1){u=19;break}a=c[e>>2]|0;d=DO(a*20|0)|0;f=i+(g*20|0)|0;c[f>>2]=d;if(!d){u=22;break}d=0;while(1){if((d|0)>=(a|0))break;if((eA((c[f>>2]|0)+(d*20|0)|0,4,1,t)|0)!=1){u=25;break b}if((eA((c[f>>2]|0)+(d*20|0)+4|0,4,1,t)|0)!=1){u=27;break b}if((eA((c[f>>2]|0)+(d*20|0)+8|0,4,1,t)|0)!=1){u=29;break b}if((eA((c[f>>2]|0)+(d*20|0)+12|0,4,1,t)|0)!=1){u=31;break b}if((eA((c[f>>2]|0)+(d*20|0)+16|0,4,1,t)|0)!=1){u=34;break b}d=d+1|0;a=c[e>>2]|0}g=g+1|0}switch(u|0){case 12:{Se(0,3,21839,j);break}case 15:{Se(0,3,21839,k);break}case 17:{Se(0,3,21839,l);break}case 19:{Se(0,3,21839,m);break}case 22:{Se(0,3,41858,n);Ea(1);break}case 25:{Se(0,3,21839,o);break}case 27:{Se(0,3,21839,p);break}case 29:{Se(0,3,21839,q);break}case 31:{Se(0,3,21839,r);break}case 34:{Se(0,3,21839,s);break}}a=0;while(1){if((a|0)==(g|0))break;EO(c[i+(a*20|0)>>2]|0);a=a+1|0}EO(i);u=39}else{Se(0,3,21839,f);u=39}while(0);if((u|0)==39){EO(b);b=0}vz(t)|0}yb=v;return b|0}function kf(a){a=a|0;var b=0,d=0,e=0;b=c[a>>2]|0;if(!b)b=-1;else{e=0;while(1){d=c[b>>2]|0;if((e|0)>=(c[b+4>>2]|0))break;EO(c[d+(e*20|0)>>2]|0);e=e+1|0;b=c[a>>2]|0}EO(d);EO(c[a>>2]|0);c[a>>2]=0;b=0}return b|0}function lf(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if(!a)mf(0,b,c,d)|0;else mf(a,b,c,d)|0;return 0}function mf(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,g=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0;m=yb;yb=yb+48|0;e=m;if(!a){t=+f[c>>2];w=+f[c+4>>2];s=+f[b>>2];o=t*s;v=+f[b+4>>2];n=w*v;p=+f[b+12>>2];i=+f[b+16>>2];q=t*i;g=+f[b+20>>2];k=w*g;r=+f[b+28>>2];z=+f[b+32>>2];x=t*z;h=+f[b+36>>2];j=w*h;y=+f[b+44>>2];l=y+(x+j);t=t+10.0;j=y+(t*z+j);w=w+10.0;h=y+(x+w*h);g=(r+(q+w*g))/h;h=(p+(o+w*v))/h;i=(r+(t*i+k))/j;j=(p+(t*s+n))/j;k=(r+(q+k))/l;l=(p+(o+n))/l}else{td(a+8|0,b,e)|0;s=+f[c>>2];q=+f[c+4>>2];t=+f[e>>2];y=s*t;r=+f[e+4>>2];z=q*r;x=+f[e+12>>2];i=+f[e+16>>2];w=s*i;g=+f[e+20>>2];k=q*g;v=+f[e+28>>2];n=+f[e+32>>2];p=s*n;h=+f[e+36>>2];j=q*h;o=+f[e+44>>2];l=o+(p+j);s=s+10.0;j=o+(s*n+j);q=q+10.0;h=o+(p+q*h);g=(v+(w+q*g))/h;h=(x+(y+q*r))/h;i=(v+(s*i+k))/j;j=(x+(s*t+z))/j;k=(v+(w+k))/l;l=(x+(y+z))/l}x=j-l;y=i-k;y=x*x+y*y;x=h-l;z=g-k;z=x*x+z*z;e=y>2]=+u(+(e?z:y))*2.5399999618530273;f[d+4>>2]=+u(+(e?y:z))*2.5399999618530273;yb=m;return 0}function nf(a,b,d,e,g,h){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0,z=0,A=0,B=0.0,C=0,D=0,E=0,F=0,G=0;G=yb;yb=yb+32|0;l=G+20|0;j=G+16|0;i=G+12|0;k=G+8|0;C=G+4|0;D=G;a:do if((d|0)<0)d=-1;else switch(d|0){case 0:{q=+((g|0)/8|0|0);r=+((g*7|0)/8|0|0);s=+((h|0)/8|0|0);t=+((h*7|0)/8|0|0);p=+((g|0)/2|0|0);o=+((h|0)/2|0|0);m=0.0;i=0;d=-1;b:while(1){switch(c[a+(i*24|0)+12>>2]|0){case -1:break b;case 0:{n=+f[a+(i*24|0)+16>>2];if((!(nr)?(u=+f[a+(i*24|0)+20>>2],!(ut)):0)?(B=n-p,v=u-o,v=B*B+v*v,v>m):0){m=v;d=i}break}default:{}}i=i+1|0}if((d|0)==-1){d=-1;break a}c[a+(d*24|0)+12>>2]=1;break a}case 1:{r=+((g|0)/8|0|0);p=+((g*7|0)/8|0|0);q=+((h|0)/8|0|0);o=+((h*7|0)/8|0|0);g=e+4|0;d=-1;i=0;m=0.0;c:while(1){switch(c[a+(i*24|0)+12>>2]|0){case -1:break c;case 0:{n=+f[a+(i*24|0)+16>>2];if((!(np)?(s=+f[a+(i*24|0)+20>>2],!(so)):0)?(B=n-+f[e>>2],t=s-+f[g>>2],t=B*B+t*t,t>m):0){d=i;m=t}break}default:{}}i=i+1|0}if((d|0)==-1){d=-1;break a}c[a+(d*24|0)+12>>2]=1;break a}case 2:{r=+((g|0)/8|0|0);p=+((g*7|0)/8|0|0);q=+((h|0)/8|0|0);o=+((h*7|0)/8|0|0);g=e+12|0;j=e+4|0;k=e+8|0;d=-1;i=0;m=0.0;d:while(1){switch(c[a+(i*24|0)+12>>2]|0){case -1:break d;case 0:{n=+f[a+(i*24|0)+16>>2];if((!(np)?(x=+f[a+(i*24|0)+20>>2],!(xo)):0)?(w=+f[e>>2],B=+f[j>>2],w=(n-w)*(+f[g>>2]-B)-(x-B)*(+f[k>>2]-w),w=w*w,w>m):0){d=i;m=w}break}default:{}}i=i+1|0}if((d|0)==-1){d=-1;break a}c[a+(d*24|0)+12>>2]=1;break a}case 3:{of(e,e+8|0,l,j);of(e,e+16|0,i,k);B=+((g|0)/8|0|0);w=+((g*7|0)/8|0|0);x=+((h|0)/8|0|0);v=+((h*7|0)/8|0|0);z=e+24|0;A=e+28|0;u=+f[i>>2];t=+f[j>>2];m=u*t;s=+f[k>>2];r=+f[l>>2];q=s*r;h=!(m-q>=0.0);y=!(q-m>=0.0);l=h?2:1;b=h?1:2;d=-1;k=0;m=0.0;e:while(1){f:do switch(c[a+(k*24|0)+12>>2]|0){case -1:break e;case 0:{n=+f[a+(k*24|0)+16>>2];if(!(nw)?(E=a+(k*24|0)+20|0,q=+f[E>>2],!(qv)):0){f[z>>2]=n;c[A>>2]=c[E>>2];of(e,z,C,D);q=+f[C>>2];if(!h){n=+f[D>>2];if(!(t*q-r*n>=0.0))F=39;else{g=!(s*q-u*n>=0.0);i=g?2:3;g=g?3:2;j=1}}else{n=+f[D>>2];F=39}do if((F|0)==39){F=0;o=s*q;p=u*n;if(y|!(o-p>=0.0))if(p-o>=0.0?!(r*n-t*q>=0.0):1)break f;else{i=b;g=l;j=3;break}else{g=!(t*q-r*n>=0.0);i=g?1:3;g=g?3:1;j=2;break}}while(0);n=+pf(e,j,g,i);if(n>m){d=k;m=n}}break}default:{}}while(0);k=k+1|0}if((d|0)!=-1)c[a+(d*24|0)+12>>2]=1;break a}default:{l=0;g:while(1){d=b+(l*24|0)+12|0;h:do switch(c[d>>2]|0){case -1:break g;case 0:{c[d>>2]=1;i=b+(l*24|0)|0;g=b+(l*24|0)+4|0;j=b+(l*24|0)+8|0;d=0;while(1){k=a+(d*24|0)+12|0;switch(c[k>>2]|0){case -1:break h;case 0:{if(((c[i>>2]|0)==(c[a+(d*24|0)>>2]|0)?(c[g>>2]|0)==(c[a+(d*24|0)+4>>2]|0):0)?(c[j>>2]|0)==(c[a+(d*24|0)+8>>2]|0):0){F=55;break g}break}default:{}}d=d+1|0}}default:{}}while(0);l=l+1|0}if((F|0)==55){c[k>>2]=1;break a}c[b+12>>2]=-1;d=c[13865]|0;if(!d){Yz(Ta(0)|0);d=c[13865]|0}d=d+1|0;c[13865]=(d|0)==128?0:d;d=0;i=0;i:while(1){switch(c[a+(i*24|0)+12>>2]|0){case -1:break i;case 0:{d=d+1|0;break}default:{}}i=i+1|0}if(!d){d=-1;break a}k=~~(+(d|0)*+(Zz()|0)*4.656612873077393e-10);d=0;i=0;j:while(1){g=a+(d*24|0)+12|0;j=c[g>>2]|0;switch(j|0){case -1:{d=j;break a}case 0:{if((i|0)==(k|0))break j;i=i+1|0;break}default:{}}d=d+1|0}c[g>>2]=1;break a}}while(0);yb=G;return d|0}function of(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,g=0.0;g=+f[b>>2]-+f[a>>2];e=+f[b+4>>2]-+f[a+4>>2];g=+u(+(g*g+e*e));if(!(g==0.0)){f[c>>2]=e/g;f[d>>2]=(+f[b>>2]-+f[a>>2])/g}return}function pf(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0;c=a+(c<<3)|0;e=+qf(a,a+(b<<3)|0,c);return +(e+ +qf(a,c,a+(d<<3)|0))}function qf(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0;d=+f[a>>2];e=+f[a+4>>2];d=((+f[b>>2]-d)*(+f[c+4>>2]-e)-(+f[b+4>>2]-e)*(+f[c>>2]-d))*.5;return +(d<0.0?-d:d)}function rf(b,d,e){b=b|0;d=d|0;e=e|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,J=0,K=0,L=0,M=0;M=yb;yb=yb+1248|0;L=M+1232|0;K=M+1224|0;J=M+1208|0;I=M+1200|0;H=M+1184|0;G=M+1176|0;F=M+1160|0;E=M+1152|0;D=M+1144|0;C=M+1136|0;B=M+1128|0;A=M+1120|0;z=M+1112|0;y=M+1104|0;x=M+1096|0;w=M+1088|0;v=M+1080|0;u=M+1072|0;p=M+1064|0;l=M+1056|0;k=M+1048|0;j=M+1040|0;i=M+1032|0;h=M+1024|0;r=M+768|0;s=M+512|0;t=M+1236|0;g=M;do if(((d|0)!=0?(a[d>>0]|0)!=0:0)?(Dx(d,41063)|0)!=0:0){c[h>>2]=b;c[h+4>>2]=d;Fx(g,22627,h)|0;d=pz(g,21853)|0;if(!d){c[i>>2]=b;Se(0,3,21855,i);q=zy(c[(mx()|0)>>2]|0)|0;c[j>>2]=57671;c[j+4>>2]=q;Se(0,3,21881,j);q=0;break}else{n=d;d=1;m=8;break}}else m=4;while(0);if((m|0)==4){Uz(s,b,255)|0;a[s+255>>0]=0;n=0;d=0;m=8}do if((m|0)==8){o=DO(1140)|0;if(!o){Se(0,3,41858,k);Ea(1)}k=(d|0)!=0;if(k){if(!(sf(r,n)|0)){vz(n)|0;EO(o);q=0;break}c[l>>2]=t;if((Az(r,21887,l)|0)!=1){vz(n)|0;EO(o);q=0;break}d=c[t>>2]|0;if((d|0)<1){vz(n)|0;EO(o);q=0;break}}else d=1;c[o+4>>2]=d;c[o+152>>2]=0;j=DO(d*112|0)|0;c[o>>2]=j;if(!j){Se(0,3,41858,p);Ea(1)}i=(e|0)==0;g=0;a:while(1){c[t>>2]=g;if((g|0)>=(d|0)){m=57;break}c[u>>2]=g+1;Se(0,1,21890,u);if(k){if(!(sf(r,n)|0)){m=57;break}c[v>>2]=s;if((Az(r,21914,v)|0)!=1){m=57;break}Gf(s)|0}Se(0,1,21917,w);p=af(s)|0;c[j+((c[t>>2]|0)*112|0)>>2]=p;if(!p){m=26;break}Se(0,1,21966,y);Se(0,1,21976,z);p=jf(s,41063)|0;c[j+((c[t>>2]|0)*112|0)+4>>2]=p;if(!p){m=29;break}Se(0,1,21966,B);if(i)c[j+((c[t>>2]|0)*112|0)+8>>2]=0;else{Se(0,1,22027,C);Gf(s)|0;p=gf(s,22046,e)|0;c[j+((c[t>>2]|0)*112|0)+8>>2]=p;if(!p){m=33;break}Se(0,1,21966,E)}b:do if(k){if(!(sf(r,n)|0)){m=57;break a}p=c[t>>2]|0;c[F>>2]=j+(p*112|0)+12;c[F+4>>2]=j+(p*112|0)+16;c[F+8>>2]=j+(p*112|0)+20;c[F+12>>2]=j+(p*112|0)+24;if((Az(r,22080,F)|0)!=4){m=40;break a}if(!(sf(r,n)|0)){m=57;break a}p=c[t>>2]|0;c[H>>2]=j+(p*112|0)+28;c[H+4>>2]=j+(p*112|0)+32;c[H+8>>2]=j+(p*112|0)+36;c[H+12>>2]=j+(p*112|0)+40;if((Az(r,22080,H)|0)!=4){m=43;break a}if(!(sf(r,n)|0)){m=57;break a}p=c[t>>2]|0;c[J>>2]=j+(p*112|0)+44;c[J+4>>2]=j+(p*112|0)+48;c[J+8>>2]=j+(p*112|0)+52;c[J+12>>2]=j+(p*112|0)+56;if((Az(r,22080,J)|0)!=4){m=47;break a}g=c[t>>2]|0}else{g=c[t>>2]|0;b=0;while(1){if((b|0)==3)break b;h=0;while(1){if((h|0)==4)break;f[j+(g*112|0)+12+(b<<4)+(h<<2)>>2]=(b|0)==(h|0)?1.0:0.0;h=h+1|0}b=b+1|0}}while(0);wd(j+(g*112|0)+12|0,j+(g*112|0)+60|0)|0;Ff(s,256,22128)|0;g=DO(256)|0;c[j+((c[t>>2]|0)*112|0)+108>>2]=g;if(!g){m=55;break}Uz(g,s,256)|0;g=(c[t>>2]|0)+1|0}if((m|0)==26){c[x>>2]=s;Se(0,3,21935,x);EO(j);EO(o);if(!n){q=0;break}vz(n)|0;q=0;break}else if((m|0)==29){c[A>>2]=s;Se(0,3,21996,A);cf(j+((c[t>>2]|0)*112|0)|0)|0;EO(j);EO(o);if(!n){q=0;break}vz(n)|0;q=0;break}else if((m|0)==33){c[D>>2]=s;Se(0,3,22050,D);kf(j+((c[t>>2]|0)*112|0)+4|0)|0;cf(j+((c[t>>2]|0)*112|0)|0)|0;EO(j);EO(o);if(!n){q=0;break}vz(n)|0;q=0;break}else if((m|0)==40){Se(0,3,22092,G);vz(n)|0;Ea(0)}else if((m|0)==43){Se(0,3,22092,I);vz(n)|0;Ea(0)}else if((m|0)==47){Se(0,3,22092,K);vz(n)|0;Ea(0)}else if((m|0)==55){Se(0,3,41858,L);Ea(1)}else if((m|0)==57){if(n|0)vz(n)|0;if((c[t>>2]|0)>=(d|0)){q=o;break}Ea(0)}}while(0);yb=M;return q|0}function sf(b,c){b=b|0;c=c|0;var d=0;a:while(1){d=yz(b,256,c)|0;if(!d){d=0;break}switch(a[b>>0]|0){case 35:case 10:break;default:break a}}return d|0}function tf(a,b){a=a|0;b=b|0;var d=0,e=0;if(!a)d=-1;else{c[a+152>>2]=1;d=0;while(1){if((d|0)==3)break;e=0;while(1){if((e|0)==4)break;c[a+8+(d<<4)+(e<<2)>>2]=c[b+(d<<4)+(e<<2)>>2];e=e+1|0}d=d+1|0}c[a+168>>2]=-1;d=0}return d|0}function uf(b,e,g,h,i,j,k,l,m,n,o,p){b=b|0;e=e|0;g=g|0;h=h|0;i=i|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,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;X=yb;yb=yb+80|0;F=X+8|0;E=X;M=X+72|0;P=X+60|0;R=X+48|0;D=X+36|0;S=X+32|0;T=X+24|0;U=X+16|0;V=j+16|0;A=c[V>>2]|0;W=j+20|0;x=c[W>>2]|0;y=g+-1|0;z=h+-1|0;w=0;while(1){if(w>>>0>=3)break;q=c[m+(w<<3)>>2]|0;if((q|0)<0)break;u=q&-4|2;q=((c[m+(w<<3)+4>>2]|0)/4|0)<<2|2;v=u-k|0;v=(v|0)>0?v:0;u=u+k|0;u=(u|0)<(g|0)?u:y;t=q-l|0;q=q+l|0;q=(q|0)<(h|0)?q:z;t=(t|0)>0?t:0;while(1){if((t|0)>(q|0))break;r=v;s=e+((B(t,g)|0)+v)|0;while(1){if((r|0)>(u|0))break;a[s>>0]=0;r=r+1|0;s=s+1|0}t=t+1|0}w=w+1|0}c[M>>2]=0;C=x<<1;z=A<<1;K=j+12|0;L=j+8|0;r=1;y=0;while(1){if(y>>>0>=3){J=28;break}q=c[m+(y<<3)>>2]|0;if((q|0)<0){J=14;break}x=q&-4|2;u=((c[m+(y<<3)+4>>2]|0)/4|0)<<2|2;v=u+l|0;w=x-k|0;x=x+k|0;q=r;u=u-l|0;a:while(1){if((u|0)>(v|0))break;b:do if((u|0)>=(z|0)){if((u+C|0)>=(h|0))break a;t=B(u,g)|0;s=w;while(1){if((s|0)>(x|0))break b;if((s|0)>=(c[L>>2]<<1|0)){if(((c[K>>2]<<1)+s|0)>=(g|0))break b;r=e+(s+t)|0;if(!(a[r>>0]|0)){a[r>>0]=1;vf(b,g,i,j,s,u,S);wf(s,u,c[S>>2]|0,M,P,R,D);q=0}}s=s+4|0}}while(0);u=u+4|0}r=q;y=y+1|0}if((J|0)==14)if(!r)J=28;else q=-1;if((J|0)==28){I=j+4|0;q=B((c[j>>2]<<3)+32|0,(c[I>>2]<<1)+8|0)|0;H=DO(q)|0;if(!H){Se(0,3,41858,E);Ea(1)}G=DO(q)|0;if(!G){Se(0,3,41858,F);Ea(1)}F=j+36|0;r=0;E=0;q=-1;while(1){if((E|0)>=(c[M>>2]|0))break;u=c[j>>2]|0;s=c[I>>2]|0;c:do if((c[F>>2]|0)==(B(s,u)|0)){switch(i|0){case 5:case 12:case 13:case 14:break;default:{J=40;break c}}l=R+(E<<2)|0;k=c[l>>2]|0;m=k+-3-(c[V>>2]<<1)|0;if((((m|0)>=0?(k+3+(c[W>>2]<<1)|0)<(h|0):0)?(N=P+(E<<2)|0,O=c[N>>2]|0,Q=O+-3-(c[L>>2]<<1)|0,(Q|0)>=0):0)?(O+3+(c[K>>2]<<1)|0)<(g|0):0){k=(s<<1)+6|0;t=(u<<2)+16|0;v=G;w=H;s=0;while(1){if((s|0)>=(t|0))break;c[w>>2]=0;c[v>>2]=0;v=v+4|0;w=w+4|0;s=s+1|0}D=(u<<1)+6|0;e=b+(Q+(B(m,g)|0))|0;z=G;A=H;s=w;C=0;while(1){if((C|0)>=(k|0))break;y=s+8|0;u=v;t=0;while(1){if((t|0)==2)break;c[s>>2]=0;c[u>>2]=0;c[T+(t<<2)>>2]=0;c[U+(t<<2)>>2]=0;u=u+4|0;s=s+4|0;t=t+1|0}x=e;u=z+8|0;w=A+8|0;v=v+8|0;s=y;t=0;while(1){if((t|0)>=(D|0))break;y=t&1;A=T+(y<<2)|0;z=(c[A>>2]|0)+(d[x>>0]|0)|0;c[A>>2]=z;A=d[x>>0]|0;A=B(A,A)|0;y=U+(y<<2)|0;A=A+(c[y>>2]|0)|0;c[y>>2]=A;c[s>>2]=(c[w>>2]|0)+z;c[v>>2]=(c[u>>2]|0)+A;x=x+1|0;u=u+4|0;w=w+4|0;v=v+4|0;s=s+4|0;t=t+1|0}e=e+g|0;z=u;A=w;C=C+1|0}u=0;while(1){if((u|0)==7)break c;v=u+m|0;w=u+2|0;x=u+-3|0;t=0;while(1){if((t|0)==7)break;xf(b,g,t+Q|0,v,j,H,G,t+2|0,w,S);s=c[S>>2]|0;if((s|0)>(r|0)){c[n>>2]=t+-3+(c[N>>2]|0);c[o>>2]=x+(c[l>>2]|0);f[p>>2]=+(s|0)/1.0e4;q=0;r=s}t=t+1|0}u=u+1|0}}else J=40}else J=40;while(0);d:do if((J|0)==40){J=0;v=c[R+(E<<2)>>2]|0;w=v+3|0;x=P+(E<<2)|0;v=v+-3|0;while(1){if((v|0)>(w|0))break d;e:do if((v|0)>=(c[V>>2]<<1|0)){if(((c[W>>2]<<1)+v|0)>=(h|0))break d;t=c[x>>2]|0;u=t+3|0;t=t+-3|0;while(1){if((t|0)>(u|0))break e;if((t|0)>=(c[L>>2]<<1|0)){if(((c[K>>2]<<1)+t|0)>=(g|0))break e;vf(b,g,i,j,t,v,S);s=c[S>>2]|0;if((s|0)>(r|0)){c[n>>2]=t;c[o>>2]=v;f[p>>2]=+(s|0)/1.0e4;r=s;q=0}}t=t+1|0}}while(0);v=v+1|0}}while(0);E=E+1|0}EO(H);EO(G)}yb=X;return q|0}function vf(a,e,f,g,h,i,j){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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,v=0,w=0;l=c[g+24>>2]|0;a:do switch(f|0){case 5:case 12:case 13:case 14:{s=0-(c[g+8>>2]|0)|0;t=c[g+12>>2]|0;q=0-(c[g+16>>2]|0)|0;v=c[g+20>>2]|0;w=e<<1;m=l;p=a+((s<<1)+h+(B((q<<1)+i|0,e)|0))|0;l=0;f=0;k=0;while(1){if((q|0)>(v|0)){m=l;break a}r=s;n=m;o=p;while(1){if((r|0)>(t|0))break;m=b[n>>1]|0;if(m<<16>>16!=4096){i=d[o>>0]|0;l=l+i|0;f=(B(i,i)|0)+f|0;k=(B(i,m&65535)|0)+k|0}r=r+1|0;n=n+2|0;o=o+2|0}m=n;p=p+w|0;q=q+1|0}}default:{if(f>>>0<2){s=c[g+20>>2]|0;t=g+8|0;v=g+12|0;r=0-(c[g+16>>2]|0)|0;m=0;f=0;k=0;while(1){if((r|0)>(s|0))break a;w=(B((r<<1)+i|0,e)|0)+h|0;p=c[t>>2]|0;q=c[v>>2]|0;o=0-p|0;p=a+((w-(p<<1)|0)*3|0)|0;while(1){if((o|0)>(q|0))break;n=b[l>>1]|0;if(n<<16>>16!=4096){w=(((d[p+1>>0]|0)+(d[p>>0]|0)+(d[p+2>>0]|0)|0)>>>0)/3|0;m=w+m|0;f=(B(w,w)|0)+f|0;k=(B(w,n&65535)|0)+k|0}o=o+1|0;p=p+6|0;l=l+2|0}r=r+1|0}}if((f|1|0)==3){s=c[g+20>>2]|0;t=g+8|0;v=g+12|0;r=0-(c[g+16>>2]|0)|0;m=0;f=0;k=0;while(1){if((r|0)>(s|0))break a;w=(B((r<<1)+i|0,e)|0)+h|0;p=c[t>>2]|0;q=c[v>>2]|0;o=0-p|0;p=a+(w-(p<<1)<<2)|0;while(1){if((o|0)>(q|0))break;n=b[l>>1]|0;if(n<<16>>16!=4096){w=(((d[p+1>>0]|0)+(d[p>>0]|0)+(d[p+2>>0]|0)|0)>>>0)/3|0;m=w+m|0;f=(B(w,w)|0)+f|0;k=(B(w,n&65535)|0)+k|0}o=o+1|0;p=p+8|0;l=l+2|0}r=r+1|0}}if((f|2|0)==6){s=c[g+20>>2]|0;t=g+8|0;v=g+12|0;r=0-(c[g+16>>2]|0)|0;m=l;l=0;f=0;k=0;while(1){if((r|0)>(s|0)){m=l;break a}w=(B((r<<1)+i|0,e)|0)+h|0;p=c[t>>2]|0;q=c[v>>2]|0;o=0-p|0;p=a+(w-(p<<1)<<2)|0;while(1){if((o|0)>(q|0))break;n=b[m>>1]|0;if(n<<16>>16!=4096){w=(((d[p+2>>0]|0)+(d[p+1>>0]|0)+(d[p+3>>0]|0)|0)>>>0)/3|0;l=w+l|0;f=(B(w,w)|0)+f|0;k=(B(w,n&65535)|0)+k|0}o=o+1|0;p=p+8|0;m=m+2|0}r=r+1|0}}switch(f|0){case 7:{s=c[g+20>>2]|0;t=g+8|0;v=g+12|0;m=0;f=0;k=0;r=0-(c[g+16>>2]|0)|0;while(1){if((r|0)>(s|0))break a;w=(B((r<<1)+i|0,e)|0)+h|0;p=c[t>>2]|0;q=c[v>>2]|0;o=0-p|0;p=a+(w-(p<<1)<<1)|0;while(1){if((o|0)>(q|0))break;n=b[l>>1]|0;if(n<<16>>16!=4096){w=d[p+1>>0]|0;m=m+w|0;f=(B(w,w)|0)+f|0;k=(B(w,n&65535)|0)+k|0}o=o+1|0;p=p+4|0;l=l+2|0}r=r+1|0}}case 8:{s=c[g+20>>2]|0;t=g+8|0;v=g+12|0;m=0;f=0;k=0;q=0-(c[g+16>>2]|0)|0;while(1){if((q|0)>(s|0))break a;w=(B((q<<1)+i|0,e)|0)+h|0;p=c[t>>2]|0;r=c[v>>2]|0;o=0-p|0;p=a+(w-(p<<1)<<1)|0;while(1){if((o|0)>(r|0))break;n=b[l>>1]|0;if(n<<16>>16!=4096){w=d[p>>0]|0;m=m+w|0;f=(B(w,w)|0)+f|0;k=(B(w,n&65535)|0)+k|0}l=l+2|0;o=o+1|0;p=p+4|0}q=q+1|0}}default:{m=0;f=0;k=0;break a}}}}while(0);l=c[g+36>>2]|0;f=f-((B(m,m)|0)/(l|0)|0)|0;if(!f)f=0;else{i=(k-((B(c[g+32>>2]|0,m)|0)/(l|0)|0)|0)*100|0;f=(((i|0)/(c[g+28>>2]|0)|0)*100|0)/(~~+u(+(+(f|0)))|0)|0}c[j>>2]=f;return}function wf(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 i=0,j=0;i=c[e>>2]|0;do if(!i){c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[e>>2]=1}else{j=0;while(1){if((j|0)>=(i|0))break;if((c[h+(j<<2)>>2]|0)<(d|0))break;j=j+1|0}if((j|0)==(i|0)){if(i>>>0>=3)break;c[f+(i<<2)>>2]=a;c[g+(i<<2)>>2]=b;c[h+(i<<2)>>2]=d;c[e>>2]=(c[e>>2]|0)+1;break}if((i|0)==3)i=2;else c[e>>2]=i+1;while(1){if((i|0)<=(j|0))break;e=i+-1|0;c[f+(i<<2)>>2]=c[f+(e<<2)>>2];c[g+(i<<2)>>2]=c[g+(e<<2)>>2];c[h+(i<<2)>>2]=c[h+(e<<2)>>2];i=e}c[f+(i<<2)>>2]=a;c[g+(i<<2)>>2]=b;c[h+(i<<2)>>2]=d}while(0);return}function xf(a,b,f,g,h,i,j,k,l,m){a=a|0;b=b|0;f=f|0;g=g|0;h=h|0;i=i|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;o=a+((B(g,b)|0)+f)|0;r=c[h+4>>2]|0;p=b<<1;q=c[h>>2]|0;b=0;a=c[h+24>>2]|0;s=0;while(1){if((b|0)>=(r|0))break;n=0;f=o;g=s;while(1){if((n|0)>=(q|0))break;s=(B(e[a>>1]|0,d[f>>0]|0)|0)+g|0;n=n+1|0;a=a+2|0;f=f+2|0;g=s}b=b+1|0;o=o+p|0;s=g}a=q<<1;q=a+8|0;g=k+-2|0;a=g+a|0;f=l+-2|0;l=B(q,f+(r<<1)|0)|0;f=B(q,f)|0;k=l+a|0;r=f+g|0;l=l+g|0;a=f+a|0;f=(c[i+(r<<2)>>2]|0)+(c[i+(k<<2)>>2]|0)-(c[i+(l<<2)>>2]|0)-(c[i+(a<<2)>>2]|0)|0;g=c[h+36>>2]|0;a=(c[j+(r<<2)>>2]|0)+(c[j+(k<<2)>>2]|0)-(c[j+(l<<2)>>2]|0)-(c[j+(a<<2)>>2]|0)-((B(f,f)|0)/(g|0)|0)|0;if(!a)a=0;else{j=(s-((B(c[h+32>>2]|0,f)|0)/(g|0)|0)|0)*100|0;a=(((j|0)/(c[h+28>>2]|0)|0)*100|0)/(~~+u(+(+(a|0)))|0)|0}c[m>>2]=a;return}function yf(a,b){a=a|0;b=b|0;var d=0,e=0;e=yb;yb=yb+16|0;d=DO(40)|0;if(!d){Se(0,3,41858,e);Ea(1)}c[d+16>>2]=a;c[d+8>>2]=a;c[d+20>>2]=b;c[d+12>>2]=b;b=a+1+b|0;c[d>>2]=b;c[d+4>>2]=b;b=DO(B(b<<1,b)|0)|0;c[d+24>>2]=b;if(!b){Se(0,3,41858,e+8|0);Ea(1)}else{yb=e;return d|0}return 0}function zf(d,e,g,i,j,k){d=d|0;e=e|0;g=g|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0.0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,C=0,D=0;D=yb;yb=yb+80|0;l=D+60|0;m=D+56|0;z=D+52|0;A=D+48|0;x=D;C=D+64|0;a:do if(!d){x=c[i>>2]|0;y=c[x+(j*20|0)+8>>2]|0;c[l>>2]=y;p=+f[x+(j*20|0)+12>>2];f[m>>2]=p;if((Cf(0,e,(c[h>>2]=y,+f[h>>2]),p,z,A)|0)<0)d=-1;else{s=~~(+f[z>>2]+.5);l=c[k+16>>2]|0;t=k+20|0;v=k+8|0;w=k+12|0;r=i+8|0;q=0-l|0;i=~~(+f[A>>2]+.5)-(l<<1)|0;l=0;j=0;d=0;m=c[k+24>>2]|0;while(1){if((q|0)>(c[t>>2]|0)){n=25;break a}o=c[v>>2]|0;p=+(i|0);n=0-o|0;o=s-(o<<1)|0;while(1){if((n|0)>(c[w>>2]|0))break;if((Ef(0,e,c[(c[g>>2]|0)+(c[r>>2]<<2)>>2]|0,+(o|0),p,C)|0)<0)b[m>>1]=4096;else{A=a[C>>0]|0;b[m>>1]=A&255;A=A&255;l=l+1|0;j=(B(A,A)|0)+j|0;d=d+A|0}n=n+1|0;o=o+2|0;m=m+2|0}q=q+1|0;i=i+2|0}}}else{td(d+8|0,e,x)|0;w=c[i>>2]|0;e=c[w+(j*20|0)+8>>2]|0;c[l>>2]=e;p=+f[w+(j*20|0)+12>>2];f[m>>2]=p;if((Cf(0,x,(c[h>>2]=e,+f[h>>2]),p,l,m)|0)>=0?(y=d+184|0,(me(y,+f[l>>2],+f[m>>2],z,A)|0)>=0):0){s=~~(+f[z>>2]+.5);o=c[k+16>>2]|0;t=k+20|0;v=k+8|0;w=k+12|0;r=i+8|0;l=0;n=0-o|0;o=~~(+f[A>>2]+.5)-(o<<1)|0;j=0;d=0;m=c[k+24>>2]|0;while(1){if((n|0)>(c[t>>2]|0)){n=25;break a}q=c[v>>2]|0;p=+(o|0);i=0-q|0;q=s-(q<<1)|0;while(1){if((i|0)>(c[w>>2]|0))break;do if((ne(y,+(q|0),p,z,A)|0)>=0)if((Ef(0,x,c[(c[g>>2]|0)+(c[r>>2]<<2)>>2]|0,+f[z>>2],+f[A>>2],C)|0)<0){b[m>>1]=4096;break}else{e=a[C>>0]|0;b[m>>1]=e&255;e=e&255;l=l+1|0;j=(B(e,e)|0)+j|0;d=d+e|0;break}else b[m>>1]=4096;while(0);i=i+1|0;q=q+2|0;m=m+2|0}n=n+1|0;o=o+2|0}}else d=-1}while(0);if((n|0)==25)if(!l)d=-1;else{c[k+28>>2]=~~+u(+(+(j-((B(d,d)|0)/(l|0)|0)|0)));c[k+32>>2]=d;c[k+36>>2]=l;d=0}yb=D;return d|0}function Af(a,b,d,e,g,h){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=h|0;var i=0.0,j=0,k=0,l=0.0,m=0,n=0,o=0,p=0,q=0,r=0;r=yb;yb=yb+32|0;m=r+20|0;n=r+16|0;o=r+12|0;p=r+8|0;j=r+4|0;k=r;l=+f[g+8>>2];i=+f[g+12>>2];if((b|0)!=0?(Cf(a,b,l,i,m,p)|0)>=0:0){c[h>>2]=~~+f[m>>2];c[h+4>>2]=~~+f[p>>2];if((d|0)!=0?(Cf(a,d,l,i,n,j)|0)>=0:0){c[h+8>>2]=~~(+f[m>>2]*2.0-+f[n>>2]);c[h+12>>2]=~~(+f[p>>2]*2.0-+f[j>>2]);if((e|0)!=0?(Cf(a,e,l,i,o,k)|0)>=0:0){c[h+16>>2]=~~(+f[o>>2]+(+f[m>>2]*3.0-+f[n>>2]*3.0));g=~~(+f[k>>2]+(+f[p>>2]*3.0-+f[j>>2]*3.0))}else q=10}else q=9}else{c[h>>2]=-1;c[h+4>>2]=-1;q=9}if((q|0)==9){c[h+8>>2]=-1;c[h+12>>2]=-1;q=10}if((q|0)==10){c[h+16>>2]=-1;g=-1}c[h+20>>2]=g;yb=r;return}function Bf(a,b,c,d,e,g){a=a|0;b=b|0;c=+c;d=+d;e=e|0;g=g|0;var h=0,i=0.0,j=0,k=0,l=0,m=0.0;l=yb;yb=yb+64|0;h=l;j=l+52|0;k=l+48|0;if(a){td(a+8|0,b,h)|0;m=+f[h+44>>2]+(+f[h+32>>2]*c+ +f[h+36>>2]*d);i=(+f[h+12>>2]+(+f[h>>2]*c+ +f[h+4>>2]*d))/m;c=(+f[h+28>>2]+(+f[h+16>>2]*c+ +f[h+20>>2]*d))/m;b=a+184|0;if((me(b,i,c,e,g)|0)>=0?(ne(b,+f[e>>2],+f[g>>2],j,k)|0)>=0:0){i=i-+f[j>>2];m=c-+f[k>>2];b=(i*i+m*m>1.0)<<31>>31}else b=-1}else{i=+f[b+28>>2]+(+f[b+16>>2]*c+ +f[b+20>>2]*d);m=+f[b+44>>2]+(+f[b+32>>2]*c+ +f[b+36>>2]*d);f[e>>2]=(+f[b+12>>2]+(+f[b>>2]*c+ +f[b+4>>2]*d))/m;f[g>>2]=i/m;b=0}yb=l;return b|0}function Cf(a,b,c,d,e,g){a=a|0;b=b|0;c=+c;d=+d;e=e|0;g=g|0;var h=0,i=0,j=0.0,k=0.0;i=yb;yb=yb+48|0;h=i;if(!a){k=+f[b+28>>2]+(+f[b+16>>2]*c+ +f[b+20>>2]*d);j=+f[b+44>>2]+(+f[b+32>>2]*c+ +f[b+36>>2]*d);f[e>>2]=(+f[b+12>>2]+(+f[b>>2]*c+ +f[b+4>>2]*d))/j;f[g>>2]=k/j;a=0}else{td(a+8|0,b,h)|0;k=+f[h+44>>2]+(+f[h+32>>2]*c+ +f[h+36>>2]*d);a=(me(a+184|0,(+f[h+12>>2]+(+f[h>>2]*c+ +f[h+4>>2]*d))/k,(+f[h+28>>2]+(+f[h+16>>2]*c+ +f[h+20>>2]*d))/k,e,g)|0)>>31}yb=i;return a|0}function Df(a,b,c,d,e,g){a=a|0;b=b|0;c=+c;d=+d;e=e|0;g=g|0;var h=0.0,i=0,j=0,k=0.0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0.0;r=yb;yb=yb+64|0;i=r+52|0;j=r+48|0;l=r;if(a)if((ne(a+184|0,c,d,i,j)|0)<0)a=-1;else{td(a+8|0,b,l)|0;h=+f[l+32>>2];k=+f[i>>2];p=+f[l+36>>2];d=+f[j>>2];c=+f[l+44>>2];m=+f[l+12>>2]-k*c;n=p*d-+f[l+20>>2];o=h*d-+f[l+16>>2];p=k*p-+f[l+4>>2];k=h*k-+f[l>>2];h=+f[l+28>>2];c=d*c;q=5}else{k=+f[b+32>>2];p=+f[b+36>>2];s=+f[b+44>>2];m=+f[b+12>>2]-s*c;n=p*d-+f[b+20>>2];o=k*d-+f[b+16>>2];p=p*c-+f[b+4>>2];k=k*c-+f[b>>2];h=+f[b+28>>2];c=s*d;q=5}if((q|0)==5){c=h-c;h=k*n-p*o;if(h==0.0)a=-1;else{f[e>>2]=(n*m-p*c)/h;f[g>>2]=(k*c-o*m)/h;a=0}}yb=r;return a|0}function Ef(b,d,e,g,h,i){b=b|0;d=d|0;e=e|0;g=+g;h=+h;i=i|0;var j=0.0,k=0,l=0,m=0,n=0,o=0,p=0;p=yb;yb=yb+16|0;n=p+4|0;o=p;if((((Df(b,d,g,h,n,o)|0)>=0?(j=+f[e+12>>2],k=~~(+f[n>>2]*j/25.399999618530273+.5),(k|0)>=0):0)?(l=c[e+4>>2]|0,(l|0)>(k|0)):0)?(n=c[e+8>>2]|0,m=~~(+(n|0)-j*+f[o>>2]/25.399999618530273+.5),(m|0)>-1&(n|0)>(m|0)):0){b=(B(l,m)|0)+k|0;a[i>>0]=a[(c[e>>2]|0)+b>>0]|0;b=0}else b=-1;yb=p;return b|0}function Ff(a,b,c){a=a|0;b=b|0;c=c|0;return zd(a,b,c)|0}function Gf(a){a=a|0;return Ad(a)|0}function Hf(a){a=a|0;return If(a,c[a>>2]|0,c[a+4>>2]|0,1)|0}function If(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=yb;yb=yb+16|0;f=FO(1,4156)|0;if(!f){Se(0,3,41858,g);Ea(1)}else{h=rB(4)|0;Gj(h);c[f>>2]=h;c[f+4>>2]=a;c[f+8>>2]=e;c[f+12>>2]=b;c[f+16>>2]=d;c[f+20>>2]=1;c[f+24>>2]=-1;e=f+28|0;c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[e+20>>2]=0;c[e+24>>2]=0;c[e+28>>2]=0;yb=g;return f|0}return 0}function Jf(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;if(!b)b=-1;else{d=c[b>>2]|0;if(d){lk(d);QA(d);b=c[a>>2]|0}d=c[b+28>>2]|0;if(d){EO(d);b=c[a>>2]|0}d=c[b+36>>2]|0;if(d){EO(d);b=c[a>>2]|0}d=c[b+52>>2]|0;if(d){EO(d);b=c[a>>2]|0}d=c[b+44>>2]|0;if(d){EO(d);b=c[a>>2]|0}EO(b);c[a>>2]=0;b=0}return b|0}function Kf(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;d=b;if(b|0){c[a+4>>2]=d;Nf(b,(c[a+8>>2]|0)-d|0)}return}function Lf(a){a=a|0;var b=0,d=0,e=0,f=0;d=c[a>>2]|0;if(d|0){e=a+4|0;b=c[e>>2]|0;while(1){if((b|0)==(d|0))break;f=b+-20|0;Mf(f);b=f}c[e>>2]=d;f=c[a>>2]|0;Nf(f,(c[a+8>>2]|0)-f|0)}return}function Mf(a){a=a|0;return}function Nf(a,b){a=a|0;b=b|0;Pf(a);return}function Of(a){a=a|0;P(a|0)|0;SA()}function Pf(a){a=a|0;QA(a);return}function Qf(a,b){a=a|0;b=b|0;var 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;s=yb;yb=yb+48|0;r=s+40|0;p=s+32|0;m=s+24|0;k=s+16|0;f=s+8|0;e=s;if((a|0)!=0&(b|0)!=0){e=c[a>>2]|0;do if(!e){e=DO(16)|0;c[a>>2]=e;if(!e){Se(0,3,41858,f);Ea(1)}else{c[e+4>>2]=0;c[e>>2]=0;c[e+12>>2]=0;c[e+8>>2]=0;l=e;d=e;break}}else{l=e;d=e}while(0);f=c[b>>2]|0;if(!f)d=0;else{g=c[l+4>>2]|0;h=c[f+4>>2]|0;i=h+g|0;j=DO(i*132|0)|0;if(!j){Se(0,3,41858,k);Ea(1)}e=0;while(1){if((e|0)>=(g|0))break;YO(j+(e*132|0)|0,(c[l>>2]|0)+(e*132|0)|0,132)|0;e=e+1|0}e=0;while(1){if((e|0)>=(h|0))break;YO(j+((e+g|0)*132|0)|0,(c[f>>2]|0)+(e*132|0)|0,132)|0;e=e+1|0}e=c[l>>2]|0;if(e){EO(e);d=c[a>>2]|0}c[d>>2]=j;h=c[a>>2]|0;c[h+4>>2]=i;k=c[h+12>>2]|0;g=c[b>>2]|0;l=c[g+12>>2]|0;g=g+8|0;h=h+8|0;d=0;f=0;while(1){if((f|0)>=(l|0))break;e=0;while(1){if((e|0)>=(k|0))break;if((c[(c[g>>2]|0)+(f*12|0)+8>>2]|0)==(c[(c[h>>2]|0)+(e*12|0)+8>>2]|0)){q=23;break}else e=e+1|0}if((q|0)==23){q=0;d=d+1|0}f=f+1|0}n=l+k-d|0;o=DO(n*12|0)|0;if(!o){Se(0,3,41858,m);Ea(1)}j=0;while(1){if((j|0)>=(k|0))break;h=(c[a>>2]|0)+8|0;d=c[h>>2]|0;g=d+(j*12|0)+8|0;c[o+(j*12|0)+8>>2]=c[g>>2];d=c[d+(j*12|0)+4>>2]|0;f=0;while(1){if((f|0)>=(l|0))break;e=c[(c[b>>2]|0)+8>>2]|0;if((c[e+(f*12|0)+8>>2]|0)==(c[g>>2]|0))d=(c[e+(f*12|0)+4>>2]|0)+d|0;f=f+1|0}i=o+(j*12|0)|0;m=DO(d*12|0)|0;c[i>>2]=m;if(!m){q=36;break}h=c[(c[h>>2]|0)+(j*12|0)+4>>2]|0;e=0;while(1){if((e|0)>=(h|0))break;g=(c[(c[(c[a>>2]|0)+8>>2]|0)+(j*12|0)>>2]|0)+(e*12|0)|0;m=(c[i>>2]|0)+(e*12|0)|0;c[m>>2]=c[g>>2];c[m+4>>2]=c[g+4>>2];c[m+8>>2]=c[g+8>>2];e=e+1|0}g=0;while(1){if((g|0)>=(l|0))break;e=c[(c[b>>2]|0)+8>>2]|0;if((c[e+(g*12|0)+8>>2]|0)==(c[(c[(c[a>>2]|0)+8>>2]|0)+(j*12|0)+8>>2]|0)){q=43;break}g=g+1|0}a:do if((q|0)==43){q=0;f=0;while(1){if((f|0)>=(c[e+(g*12|0)+4>>2]|0))break a;t=(c[e+(g*12|0)>>2]|0)+(f*12|0)|0;m=(c[i>>2]|0)+((f+h|0)*12|0)|0;c[m>>2]=c[t>>2];c[m+4>>2]=c[t+4>>2];c[m+8>>2]=c[t+8>>2];f=f+1|0;e=c[(c[b>>2]|0)+8>>2]|0}}while(0);c[o+(j*12|0)+4>>2]=d;j=j+1|0}if((q|0)==36){Se(0,3,41858,p);Ea(1)}d=0;j=0;while(1){if((j|0)>=(l|0))break;f=c[(c[b>>2]|0)+8>>2]|0;g=c[f+(j*12|0)+8>>2]|0;e=0;while(1){if((e|0)>=(k|0)){q=53;break}if((g|0)==(c[(c[(c[a>>2]|0)+8>>2]|0)+(e*12|0)+8>>2]|0)){q=52;break}else e=e+1|0}if((q|0)==52){q=0;d=d+1|0}else if((q|0)==53){q=0;h=j+k-d|0;i=o+(h*12|0)|0;c[o+(h*12|0)+8>>2]=g;f=c[f+(j*12|0)+4>>2]|0;t=DO(f*12|0)|0;c[i>>2]=t;if(!t){q=55;break}e=0;while(1){if((e|0)>=(f|0))break;p=(c[(c[(c[b>>2]|0)+8>>2]|0)+(j*12|0)>>2]|0)+(e*12|0)|0;t=(c[i>>2]|0)+(e*12|0)|0;c[t>>2]=c[p>>2];c[t+4>>2]=c[p+4>>2];c[t+8>>2]=c[p+8>>2];e=e+1|0}c[o+(h*12|0)+4>>2]=f}j=j+1|0}if((q|0)==55){Se(0,3,41858,r);Ea(1)}e=c[a>>2]|0;d=e+8|0;g=c[d>>2]|0;if(g){f=0;d=g;while(1){if((f|0)>=(c[e+12>>2]|0))break;EO(c[d+(f*12|0)>>2]|0);t=c[a>>2]|0;f=f+1|0;e=t;d=c[t+8>>2]|0}EO(d);d=(c[a>>2]|0)+8|0}c[d>>2]=o;c[(c[a>>2]|0)+12>>2]=n;Rf(b)|0;d=0}}else{Se(0,3,22132,e);d=-1}yb=s;return d|0}function Rf(a){a=a|0;var b=0,d=0,e=0,f=0;e=yb;yb=yb+16|0;if(a){b=c[a>>2]|0;if(!b)b=0;else{b=c[b>>2]|0;if(b|0)EO(b);b=0;while(1){f=c[a>>2]|0;d=f+8|0;if((b|0)>=(c[f+12>>2]|0))break;EO(c[(c[d>>2]|0)+(b*12|0)>>2]|0);b=b+1|0}EO(c[d>>2]|0);EO(c[a>>2]|0);c[a>>2]=0;b=0}}else{Se(0,3,22192,e);b=-1}yb=e;return b|0}function Sf(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;p=yb;yb=yb+64|0;o=p+56|0;n=p+48|0;l=p+40|0;k=p+32|0;j=p+24|0;i=p+8|0;h=p;g=p+60|0;a[g>>0]=a[22236]|0;a[g+1>>0]=a[22237]|0;a[g+2>>0]=a[22238]|0;a:do if((b|0)!=0&(e|0)!=0){m=Fg(b,d,g)|0;if(!m){f=(d|0)!=0;c[i>>2]=b;c[i+4>>2]=f?46716:57671;c[i+8>>2]=f?d:57671;Se(0,3,22290,i);f=-1;break}i=FO(1,16)|0;if(!i){Se(0,3,41858,j);Ea(1)}h=i+4|0;b:do if((eA(h,4,1,m)|0)==1?(f=c[h>>2]|0,(f|0)>=1):0){j=DO(f*132|0)|0;c[i>>2]=j;if(!j){Se(0,3,41858,k);Ea(1)}g=0;while(1){if((g|0)>=(f|0))break;if((eA((c[i>>2]|0)+(g*132|0)|0,8,1,m)|0)!=1)break b;if((eA((c[i>>2]|0)+(g*132|0)+8|0,8,1,m)|0)!=1)break b;if((eA((c[i>>2]|0)+(g*132|0)+16|0,108,1,m)|0)!=1)break b;if((eA((c[i>>2]|0)+(g*132|0)+124|0,4,1,m)|0)!=1)break b;if((eA((c[i>>2]|0)+(g*132|0)+128|0,4,1,m)|0)!=1)break b;g=g+1|0;f=c[h>>2]|0}b=i+12|0;if((eA(b,4,1,m)|0)==1){f=c[b>>2]|0;if((f|0)<1){c[i+8>>2]=0;break}k=DO(f*12|0)|0;d=i+8|0;c[d>>2]=k;if(!k){Se(0,3,41858,l);Ea(1)}h=0;while(1){if((h|0)>=(f|0)){f=32;break}if((eA((c[d>>2]|0)+(h*12|0)+8|0,4,1,m)|0)!=1)break b;if((eA((c[d>>2]|0)+(h*12|0)+4|0,4,1,m)|0)!=1)break b;l=c[d>>2]|0;f=c[l+(h*12|0)+4>>2]|0;g=DO(f*12|0)|0;c[l+(h*12|0)>>2]=g;if(!g){f=29;break}if((eA(g,12,f,m)|0)!=(f|0))break b;h=h+1|0;f=c[b>>2]|0}if((f|0)==29){Se(0,3,41858,n);Ea(1)}else if((f|0)==32){c[e>>2]=i;vz(m)|0;f=0;break a}}}while(0);Se(0,3,22357,o);f=c[i+8>>2]|0;if(f|0)EO(f);f=c[i>>2]|0;if(f|0)EO(f);EO(i);vz(m)|0;f=-1}else{Se(0,3,22239,h);f=-1}while(0);yb=p;return f|0}function Tf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=yb;yb=yb+16|0;a:do if(!a){Se(0,3,22402,j);e=-1}else{g=c[a+4>>2]|0;i=(b|0)==-1;e=0;while(1){if((e|0)>=(g|0))break;f=(c[a>>2]|0)+(e*132|0)+124|0;h=c[f>>2]|0;if((h|0)==(b|0)|i&(h|0)>-1)c[f>>2]=d;e=e+1|0}h=c[a+12>>2]|0;f=a+8|0;e=0;while(1){if((e|0)>=(h|0)){e=0;break a}g=(c[f>>2]|0)+(e*12|0)+8|0;a=c[g>>2]|0;if((a|0)==(b|0)|i&(a|0)>-1)c[g>>2]=d;e=e+1|0}}while(0);yb=j;return e|0}function Uf(){return -1}function Vf(a,b){a=a|0;b=b|0;return Xf(a,b,Wf(b)|0)|0}function Wf(a){a=a|0;return Oy(a)|0}function Xf(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;l=yb;yb=yb+16|0;g=l+12|0;j=l;k=l+8|0;LE(j,b);if(a[j>>0]|0){h=(c[b>>2]|0)+-12|0;c[k>>2]=c[b+(c[h>>2]|0)+24>>2];h=b+(c[h>>2]|0)|0;i=c[h+4>>2]|0;f=d+e|0;m=Uf()|0;e=h+76|0;if(Yf(m,c[e>>2]|0)|0){GE(g,h);m=VF(g,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,32)|0;WF(g);m=m<<24>>24;c[e>>2]=m;e=m}else e=c[e>>2]|0;c[g>>2]=c[k>>2];if(!(Zf(g,d,(i&176|0)==32?f:d,f,h,e&255)|0)){m=b+(c[(c[b>>2]|0)+-12>>2]|0)|0;EE(m,c[m+16>>2]|5)}}ME(j);yb=l;return b|0}function Yf(a,b){a=a|0;b=b|0;return (a|0)==(b|0)|0}function Zf(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 i=0,j=0,k=0,l=0,m=0,n=0;n=yb;yb=yb+16|0;m=n;i=c[b>>2]|0;a:do if(!i)i=0;else{k=d;j=f-k|0;l=g+12|0;g=c[l>>2]|0;g=(g|0)>(j|0)?g-j|0:0;j=e;k=j-k|0;if((k|0)>0?(Hb[c[(c[i>>2]|0)+48>>2]&63](i,d,k)|0)!=(k|0):0){c[b>>2]=0;i=0;break}do if((g|0)>0){c[m>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;fO(m,g,h);if((Hb[c[(c[i>>2]|0)+48>>2]&63](i,(a[m+11>>0]|0)<0?c[m>>2]|0:m,g)|0)==(g|0)){hO(m);break}else{c[b>>2]=0;hO(m);i=0;break a}}while(0);f=f-j|0;if((f|0)>0?(Hb[c[(c[i>>2]|0)+48>>2]&63](i,e,f)|0)!=(f|0):0){c[b>>2]=0;i=0;break}c[l>>2]=0}while(0);yb=n;return i|0}function _f(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;j=yb;yb=yb+16|0;g=d;i=j;f=e-g|0;if(f>>>0>4294967279)cO(b);if(f>>>0<11){a[b+11>>0]=f;h=b}else{k=f+16&-16;h=rB(k)|0;c[b>>2]=h;c[b+8>>2]=k|-2147483648;c[b+4>>2]=f}f=e-g|0;b=h;while(1){if((d|0)==(e|0))break;$f(b,d);d=d+1|0;b=b+1|0}a[i>>0]=0;$f(h+f|0,i);yb=j;return}function $f(b,c){b=b|0;c=c|0;a[b>>0]=a[c>>0]|0;return}function ag(a){a=a|0;return a&255|0}function bg(a){a=a|0;if(Yf(a,Uf()|0)|0)a=~(Uf()|0);return a|0}function cg(a){a=a|0;return a&255|0}function dg(b,d){b=b|0;d=d|0;var e=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,A=0;A=yb;yb=yb+112|0;z=A+48|0;p=A+40|0;n=A+32|0;l=A+24|0;h=A+16|0;g=A+8|0;e=A;v=A+96|0;w=A+84|0;x=A+72|0;y=A+52|0;a:do if((b|0)!=0&(d|0)!=0){i=d+4|0;e=c[i>>2]|0;if(!e){Se(0,3,22499,g);e=-1;break}u=b+28|0;g=c[u>>2]|0;if(g){EO(g);e=c[i>>2]|0;if(!e){c[u>>2]=0;e=0}else j=7}else j=7;b:do if((j|0)==7){t=DO(e*132|0)|0;c[u>>2]=t;if(!t){Se(0,3,41858,h);Ea(1)}g=0;while(1){if((g|0)>=(e|0))break b;YO((c[u>>2]|0)+(g*132|0)|0,(c[d>>2]|0)+(g*132|0)|0,132)|0;g=g+1|0;e=c[i>>2]|0}}while(0);m=b+32|0;c[m>>2]=e;t=b+36|0;e=c[t>>2]|0;if(e|0){i=b+40|0;h=0;while(1){if((h|0)>=(c[i>>2]|0))break;g=c[e+(h*12|0)>>2]|0;if(g){EO(g);e=c[t>>2]|0}h=h+1|0}EO(e)}k=d+12|0;e=c[k>>2]|0;c:do if(!e){c[t>>2]=0;o=0}else{s=DO(e*12|0)|0;c[t>>2]=s;if(!s){Se(0,3,41858,l);Ea(1)}d=d+8|0;j=0;while(1){if((j|0)>=(e|0)){o=e;break c}i=c[d>>2]|0;g=c[t>>2]|0;c[g+(j*12|0)+8>>2]=c[i+(j*12|0)+8>>2];h=i+(j*12|0)+4|0;c[g+(j*12|0)+4>>2]=c[h>>2];h=c[h>>2]|0;if(!h)c[i+(j*12|0)>>2]=0;else{s=DO(h*12|0)|0;c[g+(j*12|0)>>2]=s;if(!s)break;g=0;e=i;while(1){if((g|0)>=(c[e+(j*12|0)+4>>2]|0))break;r=(c[e+(j*12|0)>>2]|0)+(g*12|0)|0;s=(c[(c[t>>2]|0)+(j*12|0)>>2]|0)+(g*12|0)|0;c[s>>2]=c[r>>2];c[s+4>>2]=c[r+4>>2];c[s+8>>2]=c[r+8>>2];g=g+1|0;e=c[d>>2]|0}e=c[k>>2]|0}j=j+1|0}Se(0,3,41858,n);Ea(1)}while(0);s=b+40|0;c[s>>2]=o;i=b+52|0;e=c[i>>2]|0;if(e|0){EO(e);c[i>>2]=0;c[b+56>>2]=0}g=c[k>>2]|0;d:do if((g|0)>0){c[b+56>>2]=g;h=DO(g*68|0)|0;c[i>>2]=h;if(!h){Se(0,3,41858,p);Ea(1)}e=0;while(1){if((e|0)==(g|0))break d;c[h+(e*68|0)+64>>2]=0;e=e+1|0}}while(0);l=c[m>>2]|0;if(!l)e=0;else{m=v+4|0;n=v+8|0;o=w+4|0;p=w+8|0;q=x+4|0;r=x+8|0;k=0;e=0;while(1){if((k|0)>=(c[s>>2]|0)){e=0;break a}d=0;while(1){if((d|0)>=(c[(c[t>>2]|0)+(k*12|0)+4>>2]|0))break;c[v>>2]=0;c[m>>2]=0;c[n>>2]=0;c[w>>2]=0;c[o>>2]=0;c[p>>2]=0;c[x>>2]=0;c[q>>2]=0;c[r>>2]=0;j=0;while(1){if((j|0)>=(l|0))break;g=c[u>>2]|0;i=c[t>>2]|0;e:do if((c[g+(j*132|0)+128>>2]|0)==(c[(c[i+(k*12|0)>>2]|0)+(d*12|0)+8>>2]|0)?(c[g+(j*132|0)+124>>2]|0)==(c[i+(k*12|0)+8>>2]|0):0){eg(y,+f[g+(j*132|0)>>2],+f[g+(j*132|0)+4>>2],+f[g+(j*132|0)+112>>2],+f[g+(j*132|0)+116>>2],(c[g+(j*132|0)+120>>2]|0)!=0);g=c[m>>2]|0;if(g>>>0<(c[n>>2]|0)>>>0){c[g>>2]=c[y>>2];c[g+4>>2]=c[y+4>>2];c[g+8>>2]=c[y+8>>2];c[g+12>>2]=c[y+12>>2];c[g+16>>2]=c[y+16>>2];c[m>>2]=g+20}else fg(v,y);Mf(y);g=c[u>>2]|0;gg(y,+f[g+(j*132|0)+8>>2],+f[g+(j*132|0)+12>>2],0.0);g=c[o>>2]|0;if(g>>>0<(c[p>>2]|0)>>>0){c[g>>2]=c[y>>2];c[g+4>>2]=c[y+4>>2];c[g+8>>2]=c[y+8>>2];c[o>>2]=(c[o>>2]|0)+12}else hg(w,y);g=0;while(1){if(g>>>0>=96)break e;h=(c[u>>2]|0)+(j*132|0)+16+g|0;i=c[q>>2]|0;if((i|0)==(c[r>>2]|0))ig(x,h);else{a[i>>0]=a[h>>0]|0;c[q>>2]=(c[q>>2]|0)+1}g=g+1|0}}while(0);j=j+1|0}c[z>>2]=((c[m>>2]|0)-(c[v>>2]|0)|0)/20|0;Se(0,1,22532,z);j=c[t>>2]|0;c[b+60+(e<<2)>>2]=c[j+(k*12|0)+8>>2];j=c[j+(k*12|0)>>2]|0;cm(c[b>>2]|0,v,x,w,c[j+(d*12|0)>>2]|0,c[j+(d*12|0)+4>>2]|0,e);Kf(x);jg(w);Lf(v);d=d+1|0;e=e+1|0}k=k+1|0}}}else{Se(0,3,22451,e);e=-1}while(0);yb=A;return e|0}function eg(b,c,d,e,g,h){b=b|0;c=+c;d=+d;e=+e;g=+g;h=h|0;f[b>>2]=c;f[b+4>>2]=d;f[b+8>>2]=e;f[b+12>>2]=g;a[b+16>>0]=h&1;return}function fg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=yb;yb=yb+32|0;d=h;e=a+4|0;f=(((c[e>>2]|0)-(c[a>>2]|0)|0)/20|0)+1|0;g=sg(a)|0;if(g>>>0>>0)CO(a);else{i=c[a>>2]|0;k=((c[a+8>>2]|0)-i|0)/20|0;j=k<<1;tg(d,k>>>0>>1>>>0?(j>>>0>>0?f:j):g,((c[e>>2]|0)-i|0)/20|0,a+8|0);g=d+8|0;f=c[g>>2]|0;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];c[f+16>>2]=c[b+16>>2];c[g>>2]=(c[g>>2]|0)+20;ug(a,d);vg(d);yb=h;return}}function gg(a,b,c,d){a=a|0;b=+b;c=+c;d=+d;f[a>>2]=b;f[a+4>>2]=c;f[a+8>>2]=d;return}function hg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=yb;yb=yb+32|0;d=h;e=a+4|0;f=(((c[e>>2]|0)-(c[a>>2]|0)|0)/12|0)+1|0;g=og(a)|0;if(g>>>0>>0)CO(a);else{i=c[a>>2]|0;k=((c[a+8>>2]|0)-i|0)/12|0;j=k<<1;pg(d,k>>>0>>1>>>0?(j>>>0>>0?f:j):g,((c[e>>2]|0)-i|0)/12|0,a+8|0);g=d+8|0;f=c[g>>2]|0;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[g>>2]=(c[g>>2]|0)+12;qg(a,d);rg(d);yb=h;return}}function ig(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;i=yb;yb=yb+32|0;e=i;f=b+4|0;g=(c[f>>2]|0)-(c[b>>2]|0)+1|0;h=kg(b)|0;if(h>>>0>>0)CO(b);else{j=c[b>>2]|0;l=(c[b+8>>2]|0)-j|0;k=l<<1;lg(e,l>>>0>>1>>>0?(k>>>0>>0?g:k):h,(c[f>>2]|0)-j|0,b+8|0);h=e+8|0;a[c[h>>2]>>0]=a[d>>0]|0;c[h>>2]=(c[h>>2]|0)+1;mg(b,e);ng(e);yb=i;return}}function jg(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;d=b;if(b|0){c[a+4>>2]=d;Nf(b,(c[a+8>>2]|0)-d|0)}return}function kg(a){a=a|0;return 2147483647}function lg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;if(!b)e=0;else e=rB(b)|0;c[a>>2]=e;d=e+d|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+b;return}function mg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[a>>2]|0;h=a+4|0;g=b+4|0;f=(c[h>>2]|0)-e|0;d=(c[g>>2]|0)+(0-f)|0;c[g>>2]=d;if((f|0)>0){YO(d|0,e|0,f|0)|0;e=g;d=c[g>>2]|0}else e=g;g=c[a>>2]|0;c[a>>2]=d;c[e>>2]=g;g=b+8|0;f=c[h>>2]|0;c[h>>2]=c[g>>2];c[g>>2]=f;g=a+8|0;h=b+12|0;a=c[g>>2]|0;c[g>>2]=c[h>>2];c[h>>2]=a;c[b>>2]=c[e>>2];return}function ng(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a+4>>2]|0;d=a+8|0;e=c[d>>2]|0;while(1){if((e|0)==(b|0))break;f=e+-1|0;c[d>>2]=f;e=f}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function og(a){a=a|0;return 357913941}function pg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;do if(b)if(b>>>0>357913941){f=O(8)|0;bO(f,37409);c[f>>2]=16392;Q(f|0,13960,22)}else{e=rB(b*12|0)|0;break}else e=0;while(0);c[a>>2]=e;d=e+(d*12|0)|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+(b*12|0);return}function qg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[a>>2]|0;h=a+4|0;g=b+4|0;f=(c[h>>2]|0)-e|0;d=(c[g>>2]|0)+(((f|0)/-12|0)*12|0)|0;c[g>>2]=d;if((f|0)>0){YO(d|0,e|0,f|0)|0;e=g;d=c[g>>2]|0}else e=g;g=c[a>>2]|0;c[a>>2]=d;c[e>>2]=g;g=b+8|0;f=c[h>>2]|0;c[h>>2]=c[g>>2];c[g>>2]=f;g=a+8|0;h=b+12|0;a=c[g>>2]|0;c[g>>2]=c[h>>2];c[h>>2]=a;c[b>>2]=c[e>>2];return}function rg(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a+4>>2]|0;d=a+8|0;e=c[d>>2]|0;while(1){if((e|0)==(b|0))break;f=e+-12|0;c[d>>2]=f;e=f}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function sg(a){a=a|0;return 214748364}function tg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;do if(b)if(b>>>0>214748364){f=O(8)|0;bO(f,37409);c[f>>2]=16392;Q(f|0,13960,22)}else{e=rB(b*20|0)|0;break}else e=0;while(0);c[a>>2]=e;d=e+(d*20|0)|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+(b*20|0);return}function ug(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;e=c[a>>2]|0;f=a+4|0;g=b+4|0;d=c[f>>2]|0;while(1){if((d|0)==(e|0))break;i=(c[g>>2]|0)+-20|0;h=d+-20|0;c[i>>2]=c[h>>2];c[i+4>>2]=c[h+4>>2];c[i+8>>2]=c[h+8>>2];c[i+12>>2]=c[h+12>>2];c[i+16>>2]=c[h+16>>2];c[g>>2]=(c[g>>2]|0)+-20;d=h}i=c[a>>2]|0;c[a>>2]=c[g>>2];c[g>>2]=i;i=b+8|0;h=c[f>>2]|0;c[f>>2]=c[i>>2];c[i>>2]=h;f=a+8|0;i=b+12|0;h=c[f>>2]|0;c[f>>2]=c[i>>2];c[i>>2]=h;c[b>>2]=c[g>>2];return}function vg(a){a=a|0;var b=0,d=0,e=0;b=c[a+4>>2]|0;d=a+8|0;while(1){e=c[d>>2]|0;if((e|0)==(b|0))break;e=e+-20|0;c[d>>2]=e;Mf(e)}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function wg(a,b){a=a|0;b=b|0;var d=0,e=0,h=0,i=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;u=yb;yb=yb+48|0;r=u+16|0;o=u+8|0;d=u;e=u+44|0;h=u+40|0;do if((a|0)!=0&(b|0)!=0){i=c[a+12>>2]|0;j=c[a+16>>2]|0;m=c[a+20>>2]|0;n=(m|0)==1;if(!n){d=zg(b,i,j,m,e,h)|0;if(!d){d=-1;break}else{s=d;t=1}}else{s=b;t=0}Cm(c[a>>2]|0,s,i,j)|0;j=dp(c[a>>2]|0)|0;j=(c[j+4>>2]|0)-(c[j>>2]|0)|0;d=(j|0)/20|0;i=a+48|0;c[i>>2]=d;a:do if(!j){e=c[a+56>>2]|0;b=a+52|0;d=0;while(1){if((d|0)>=(e|0))break a;c[(c[b>>2]|0)+(d*68|0)+60>>2]=-1;d=d+1|0}}else{j=a+44|0;b=c[j>>2]|0;if(b){EO(b);d=c[i>>2]|0}h=DO(d<<3)|0;c[j>>2]=h;if(!h){Se(0,3,41858,o);Ea(1)}e=dp(c[a>>2]|0)|0;b:do if(n){h=a+4|0;d=0;while(1){if((d|0)>=(c[i>>2]|0))break b;b=c[e>>2]|0;k=+f[b+(d*20|0)>>2];l=+f[b+(d*20|0)+4>>2];b=c[h>>2]|0;if(!b){o=c[j>>2]|0;f[o+(d<<3)>>2]=k;f[o+(d<<3)+4>>2]=l}else{o=c[j>>2]|0;ne(b+184|0,k,l,o+(d<<3)|0,o+(d<<3)+4|0)|0}d=d+1|0}}else switch(m|0){case 5:{h=a+4|0;d=0;while(1){if((d|0)>=(c[i>>2]|0))break b;b=c[e>>2]|0;k=+f[b+(d*20|0)>>2];l=+f[b+(d*20|0)+4>>2];b=c[h>>2]|0;if(!b){o=c[j>>2]|0;f[o+(d<<3)>>2]=k*1.5;f[o+(d<<3)+4>>2]=l*1.5}else{o=c[j>>2]|0;ne(b+184|0,k*1.5,l*1.5,o+(d<<3)|0,o+(d<<3)+4|0)|0}d=d+1|0}}case 2:{h=a+4|0;d=0;while(1){if((d|0)>=(c[i>>2]|0))break b;b=c[e>>2]|0;k=+f[b+(d*20|0)>>2];l=+f[b+(d*20|0)+4>>2];b=c[h>>2]|0;if(!b){o=c[j>>2]|0;f[o+(d<<3)>>2]=k*2.0;f[o+(d<<3)+4>>2]=l*2.0}else{o=c[j>>2]|0;ne(b+184|0,k*2.0,l*2.0,o+(d<<3)|0,o+(d<<3)+4|0)|0}d=d+1|0}}case 4:{h=a+4|0;d=0;while(1){if((d|0)>=(c[i>>2]|0))break b;b=c[e>>2]|0;k=+f[b+(d*20|0)>>2];l=+f[b+(d*20|0)+4>>2];b=c[h>>2]|0;if(!b){o=c[j>>2]|0;f[o+(d<<3)>>2]=k*3.0;f[o+(d<<3)+4>>2]=l*3.0}else{o=c[j>>2]|0;ne(b+184|0,k*3.0,l*3.0,o+(d<<3)|0,o+(d<<3)+4|0)|0}d=d+1|0}}default:{h=a+4|0;d=0;while(1){if((d|0)>=(c[i>>2]|0))break b;b=c[e>>2]|0;k=+f[b+(d*20|0)>>2];l=+f[b+(d*20|0)+4>>2];b=c[h>>2]|0;if(!b){o=c[j>>2]|0;f[o+(d<<3)>>2]=k*4.0;f[o+(d<<3)+4>>2]=l*4.0}else{o=c[j>>2]|0;ne(b+184|0,k*4.0,l*4.0,o+(d<<3)|0,o+(d<<3)+4|0)|0}d=d+1|0}}}while(0);i=a+56|0;j=a+36|0;b=a+52|0;d=0;while(1){e=c[i>>2]|0;if((d|0)>=(e|0))break a;o=c[b>>2]|0;c[o+(d*68|0)+48>>2]=c[(c[j>>2]|0)+(d*12|0)+8>>2];c[o+(d*68|0)+60>>2]=-1;if(((c[o+(d*68|0)+64>>2]|0)==0?(p=fp(c[a>>2]|0)|0,q=ap(c[a>>2]|0)|0,(q|0)>=0):0)?(e=c[h>>2]|0,m=cp(c[a>>2]|0,q)|0,n=dp(c[a>>2]|0)|0,o=c[b>>2]|0,(xg(e,p,m,n,o+(d*68|0)|0,o+(d*68|0)+52|0)|0)==0):0){n=c[b>>2]|0;c[n+(d*68|0)+60>>2]=0;o=(c[p+4>>2]|0)-(c[p>>2]|0)>>3;c[n+(d*68|0)+56>>2]=o;c[n+(d*68|0)+48>>2]=c[a+60+(q<<2)>>2];l=+f[n+(d*68|0)+52>>2];c[r>>2]=d;c[r+4>>2]=o;c[r+8>>2]=o;g[r+16>>3]=l;Se(0,1,22587,r)}d=d+1|0}}while(0);d=0;while(1){if((d|0)>=(e|0))break;c[(c[b>>2]|0)+(d*68|0)+64>>2]=0;d=d+1|0}if(!t)d=0;else{EO(s);d=0}}else{Se(0,3,22543,d);d=-1}while(0);yb=u;return d|0}function xg(a,b,d,e,h,i){a=a|0;b=b|0;d=d|0;e=e|0;h=h|0;i=i|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.0;u=yb;yb=yb+240|0;k=u+208|0;j=u+200|0;s=u+224|0;p=u+212|0;q=u+96|0;t=u+192|0;r=u;l=c[b>>2]|0;b=(c[b+4>>2]|0)-l|0;m=b>>3;do if(m>>>0<4)b=-1;else{o=DO(b<<1)|0;if(!o){Se(0,3,41858,j);Ea(1)}n=DO(m*24|0)|0;if(!n){Se(0,3,41858,k);Ea(1)}e=c[e>>2]|0;j=c[d>>2]|0;b=0;while(1){if((b|0)==(m|0))break;d=c[l+(b<<3)>>2]|0;g[o+(b<<4)>>3]=+f[e+(d*20|0)>>2];g[o+(b<<4)+8>>3]=+f[e+(d*20|0)+4>>2];d=c[l+(b<<3)+4>>2]|0;g[n+(b*24|0)>>3]=+f[j+(d*12|0)>>2];g[n+(b*24|0)+8>>3]=+f[j+(d*12|0)+4>>2];g[n+(b*24|0)+16>>3]=0.0;b=b+1|0}c[p+8>>2]=m;c[p>>2]=o;c[p+4>>2]=n;b=a+8|0;if((Ke(b,o,n,m,q)|0)<0){EO(o);EO(n);b=-1;break}b=Ce(b)|0;c[s>>2]=b;if(!b){EO(o);EO(n);b=-1;break}if((Fe(b,p,q,r,t)|0)<0){EO(o);EO(n);De(s)|0;b=-1}else{j=0;while(1){if((j|0)==3)break;b=0;while(1){if((b|0)==4)break;f[h+(j<<4)+(b<<2)>>2]=+g[r+(j<<5)+(b<<3)>>3];b=b+1|0}j=j+1|0}De(s)|0;EO(o);EO(n);v=+g[t>>3];f[i>>2]=v;b=(v>10.0)<<31>>31}}while(0);yb=u;return b|0}function yg(a,b,d){a=a|0;b=b|0;d=d|0;if(!a)a=-1;else{c[b>>2]=c[a+52>>2];c[d>>2]=c[a+56>>2];a=0}return a|0}function zg(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;switch(d|0){case 1:{a=Ag(a,b,c,e,f)|0;break}case 5:{a=Bg(a,b,c,e,f)|0;break}case 2:{a=Cg(a,b,c,e,f)|0;break}case 4:{a=Dg(a,b,c,e,f)|0;break}default:a=Eg(a,b,c,e,f)|0}return a|0}function Ag(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;g=yb;yb=yb+16|0;c[e>>2]=b;c[f>>2]=d;b=B(d,b)|0;d=DO(b)|0;if(!d){Se(0,3,41858,g);Ea(1)}else{YO(d|0,a|0,b|0)|0;yb=g;return d|0}return 0}function Bg(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;q=yb;yb=yb+16|0;o=(e|0)/3|0;p=o<<1;c[g>>2]=p;n=(f|0)/3|0;m=n<<1;c[h>>2]=m;m=DO(B(m,p)|0)|0;if(!m){Se(0,3,41858,q);Ea(1)}h=0;f=m;g=m;while(1){if((h|0)>=(n|0))break;l=h*3|0;i=0;j=b+(B(l+2|0,e)|0)|0;k=b+(B(l+1|0,e)|0)|0;l=b+(B(l,e)|0)|0;g=g+p|0;while(1){if((i|0)>=(o|0))break;u=l+1|0;s=k+1|0;a[f>>0]=(((d[u>>0]|0)>>>1&255)+(d[l>>0]|0)+((d[k>>0]|0)>>>1&255)+((d[s>>0]|0)>>>2&255)<<2>>>0)/9|0;r=j+1|0;a[g>>0]=((((d[s>>0]|0)>>>2)+((d[k>>0]|0)>>>1)&255)+(d[j>>0]|0)+((d[r>>0]|0)>>>1&255)<<2>>>0)/9|0;t=k+2|0;a[f+1>>0]=(((d[u>>0]|0)>>>1&255)+(d[l+2>>0]|0)+((d[s>>0]|0)>>>2&255)+((d[t>>0]|0)>>>1&255)<<2>>>0)/9|0;a[g+1>>0]=((((d[t>>0]|0)>>>1)+((d[s>>0]|0)>>>2)&255)+((d[r>>0]|0)>>>1&255)+(d[j+2>>0]|0)<<2>>>0)/9|0;i=i+1|0;j=j+3|0;k=k+3|0;l=l+3|0;f=f+2|0;g=g+2|0}h=h+1|0;f=f+p|0}yb=q;return m|0}function Cg(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0;n=yb;yb=yb+16|0;m=(e|0)/2|0;c[g>>2]=m;l=(f|0)/2|0;c[h>>2]=l;k=DO(B(l,m)|0)|0;if(!k){Se(0,3,41858,n);Ea(1)}g=0;f=k;while(1){if((g|0)>=(l|0))break;j=g<<1;h=0;i=b+(B(j,e)|0)|0;j=b+(B(j|1,e)|0)|0;while(1){if((h|0)>=(m|0))break;a[f>>0]=((d[i+1>>0]|0)+(d[i>>0]|0)+(d[j>>0]|0)+(d[j+1>>0]|0)|0)>>>2;h=h+1|0;i=i+2|0;j=j+2|0;f=f+1|0}g=g+1|0}yb=n;return k|0}function Dg(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=yb;yb=yb+16|0;n=(e|0)/3|0;c[g>>2]=n;m=(f|0)/3|0;c[h>>2]=m;l=DO(B(m,n)|0)|0;if(!l){Se(0,3,41858,o);Ea(1)}g=0;f=l;while(1){if((g|0)>=(m|0))break;k=g*3|0;h=0;i=b+(B(k,e)|0)|0;j=b+(B(k+2|0,e)|0)|0;k=b+(B(k+1|0,e)|0)|0;while(1){if((h|0)>=(n|0))break;a[f>>0]=((d[i+1>>0]|0)+(d[i>>0]|0)+(d[i+2>>0]|0)+(d[k>>0]|0)+(d[k+1>>0]|0)+(d[k+2>>0]|0)+(d[j>>0]|0)+(d[j+1>>0]|0)+(d[j+2>>0]|0)|0)/9|0;h=h+1|0;i=i+3|0;j=j+3|0;k=k+3|0;f=f+1|0}g=g+1|0}yb=o;return l|0}function Eg(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;p=yb;yb=yb+16|0;o=(e|0)/4|0;c[g>>2]=o;n=(f|0)/4|0;c[h>>2]=n;m=DO(B(n,o)|0)|0;if(!m){Se(0,3,41858,p);Ea(1)}g=0;f=m;while(1){if((g|0)>=(n|0))break;l=g<<2;h=0;i=b+(B(l,e)|0)|0;j=b+(B(l|3,e)|0)|0;k=b+(B(l|2,e)|0)|0;l=b+(B(l|1,e)|0)|0;while(1){if((h|0)>=(o|0))break;a[f>>0]=((d[i+1>>0]|0)+(d[i>>0]|0)+(d[i+2>>0]|0)+(d[i+3>>0]|0)+(d[l>>0]|0)+(d[l+1>>0]|0)+(d[l+2>>0]|0)+(d[l+3>>0]|0)+(d[k>>0]|0)+(d[k+1>>0]|0)+(d[k+2>>0]|0)+(d[k+3>>0]|0)+(d[j>>0]|0)+(d[j+1>>0]|0)+(d[j+2>>0]|0)+(d[j+3>>0]|0)|0)/16|0;h=h+1|0;i=i+4|0;j=j+4|0;k=k+4|0;l=l+4|0;f=f+1|0}g=g+1|0}yb=p;return m|0}function Fg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=yb;yb=yb+16|0;h=i+8|0;g=i;do if(a){if(!b){e=pz(a,d)|0;break}f=Oy(a)|0;f=DO(f+2+(Oy(b)|0)|0)|0;if(!f){Se(0,3,41858,g);Ea(1)}else{c[h>>2]=a;c[h+4>>2]=b;Fx(f,22627,h)|0;e=pz(f,d)|0;EO(f);break}}else e=0;while(0);yb=i;return e|0}function Gg(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;c[a+16>>2]=0;return}function Hg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;m=yb;yb=yb+16|0;d=m;if(!(Ig(b)|0)){l=Vf(Vf(NE(Vf(Vf(Vf(56032,22633)|0,22676)|0,35e3)|0,53)|0,35007)|0,22771)|0;GE(d,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);k=VF(d,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(d);OE(l,k)|0;KE(l)|0;ua()}i=Kg(Jg(b,0,0)|0)|0;j=Lg(Jg(b,0,0)|0)|0;k=Mg(Jg(b,0,0)|0)|0;l=a+12|0;c[l>>2]=Ng(b)|0;b=(Og(b)|0)+-1|0;e=a+16|0;c[e>>2]=b;Pg(a,B(c[l>>2]|0,b)|0);b=0;while(1){if(b>>>0>=(c[l>>2]|0)>>>0)break;f=j>>>b;g=k>>>b;d=0;while(1){h=c[e>>2]|0;if(d>>>0>=h>>>0)break;h=(B(h,b)|0)+d|0;aq((c[a>>2]|0)+(h<<5)|0,i,f,g,-1,1);d=d+1|0}b=b+1|0}yb=m;return}function Ig(a){a=a|0;return (c[a+8>>2]|0)-(c[a+4>>2]|0)>>5|0}function Jg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=yb;yb=yb+16|0;f=g;if((c[a+16>>2]|0)>>>0<=b>>>0){e=Vf(Vf(NE(Vf(Vf(Vf(56032,34017)|0,33900)|0,35e3)|0,218)|0,35007)|0,22796)|0;GE(f,e+(c[(c[e>>2]|0)+-12>>2]|0)|0);h=VF(f,56736)|0;h=Gb[c[(c[h>>2]|0)+28>>2]&63](h,10)|0;WF(f);OE(e,h)|0;KE(e)|0;ua()}e=c[a+20>>2]|0;if(e>>>0>d>>>0){h=(B(e,b)|0)+d|0;yb=g;return (c[a+4>>2]|0)+(h<<5)|0}else{h=Vf(Vf(NE(Vf(Vf(Vf(56032,34161)|0,33900)|0,35e3)|0,219)|0,35007)|0,22816)|0;GE(f,h+(c[(c[h>>2]|0)+-12>>2]|0)|0);g=VF(f,56736)|0;g=Gb[c[(c[g>>2]|0)+28>>2]&63](g,10)|0;WF(f);OE(h,g)|0;KE(h)|0;ua()}return 0}function Kg(a){a=a|0;return c[a>>2]|0}function Lg(a){a=a|0;return c[a+4>>2]|0}function Mg(a){a=a|0;return c[a+8>>2]|0}function Ng(a){a=a|0;return c[a+16>>2]|0}function Og(a){a=a|0;return c[a+20>>2]|0}function Pg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=a+4|0;d=c[g>>2]|0;f=c[a>>2]|0;e=d-f>>5;if(e>>>0>=b>>>0){if(e>>>0>b>>>0){a=f+(b<<5)|0;while(1){if((d|0)==(a|0))break;f=d+-32|0;pq(f);d=f}c[g>>2]=a}}else Qg(a,b-e|0);return}function Qg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=yb;yb=yb+32|0;f=i;g=a+8|0;h=a+4|0;d=c[h>>2]|0;do if((c[g>>2]|0)-d>>5>>>0>>0){d=(d-(c[a>>2]|0)>>5)+b|0;e=Sg(a)|0;if(e>>>0>>0)CO(a);else{j=c[a>>2]|0;k=(c[g>>2]|0)-j|0;g=k>>4;Tg(f,k>>5>>>0>>1>>>0?(g>>>0>>0?d:g):e,(c[h>>2]|0)-j>>5,a+8|0);Ug(f,b);Vg(a,f);Wg(f);break}}else Rg(a,b);while(0);yb=i;return}function Rg(a,b){a=a|0;b=b|0;var d=0;d=a+4|0;a=b;b=c[d>>2]|0;do{Yp(b);b=(c[d>>2]|0)+32|0;c[d>>2]=b;a=a+-1|0}while((a|0)!=0);return}function Sg(a){a=a|0;return 134217727}function Tg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;do if(b)if(b>>>0>134217727){f=O(8)|0;bO(f,37409);c[f>>2]=16392;Q(f|0,13960,22)}else{e=rB(b<<5)|0;break}else e=0;while(0);c[a>>2]=e;d=e+(d<<5)|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+(b<<5);return}function Ug(a,b){a=a|0;b=b|0;var d=0;d=a+8|0;a=b;b=c[d>>2]|0;do{Yp(b);b=(c[d>>2]|0)+32|0;c[d>>2]=b;a=a+-1|0}while((a|0)!=0);return}function Vg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[a>>2]|0;f=a+4|0;g=b+4|0;d=c[f>>2]|0;while(1){if((d|0)==(e|0))break;h=d+-32|0;$p((c[g>>2]|0)+-32|0,h);c[g>>2]=(c[g>>2]|0)+-32;d=h}e=c[a>>2]|0;c[a>>2]=c[g>>2];c[g>>2]=e;e=b+8|0;h=c[f>>2]|0;c[f>>2]=c[e>>2];c[e>>2]=h;e=a+8|0;h=b+12|0;f=c[e>>2]|0;c[e>>2]=c[h>>2];c[h>>2]=f;c[b>>2]=c[g>>2];return}function Wg(a){a=a|0;var b=0,d=0,e=0;b=c[a+4>>2]|0;d=a+8|0;while(1){e=c[d>>2]|0;if((e|0)==(b|0))break;e=e+-32|0;c[d>>2]=e;pq(e)}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function Xg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=yb;yb=yb+16|0;d=h;if((c[a+4>>2]|0)==(c[a>>2]|0)){g=Vf(Vf(NE(Vf(Vf(Vf(56032,22835)|0,22676)|0,35e3)|0,72)|0,35007)|0,22877)|0;GE(d,g+(c[(c[g>>2]|0)+-12>>2]|0)|0);f=VF(d,56736)|0;f=Gb[c[(c[f>>2]|0)+28>>2]&63](f,10)|0;WF(d);OE(g,f)|0;KE(g)|0;ua()}if((Ng(b)|0)<=0){g=Vf(Vf(NE(Vf(Vf(Vf(56032,22918)|0,22676)|0,35e3)|0,73)|0,35007)|0,22967)|0;GE(d,g+(c[(c[g>>2]|0)+-12>>2]|0)|0);f=VF(d,56736)|0;f=Gb[c[(c[f>>2]|0)+28>>2]&63](f,10)|0;WF(d);OE(g,f)|0;KE(g)|0;ua()}if(b|0?LA(b,13184,13192,0)|0:0){f=a+12|0;g=a+16|0;e=0;while(1){if(e>>>0>=(c[f>>2]|0)>>>0)break;d=0;while(1){if(d>>>0>=(c[g>>2]|0)>>>0)break;k=Yg(a,e,d)|0;j=Jg(b,e,d)|0;i=d+1|0;Zg(0,k,j,Jg(b,e,i)|0);d=i}e=e+1|0}yb=h;return}k=Vf(Vf(NE(Vf(Vf(Vf(56032,23003)|0,22676)|0,35e3)|0,74)|0,35007)|0,23075)|0;GE(d,k+(c[(c[k>>2]|0)+-12>>2]|0)|0);j=VF(d,56736)|0;j=Gb[c[(c[j>>2]|0)+28>>2]&63](j,10)|0;WF(d);OE(k,j)|0;KE(k)|0;ua()}function Yg(a,b,d){a=a|0;b=b|0;d=d|0;d=(B(c[a+16>>2]|0,b)|0)+d|0;return (c[a>>2]|0)+(d<<5)|0}function Zg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var g=0,h=0,i=0,j=0,k=0;k=yb;yb=yb+16|0;a=k;if((Kg(b)|0)!=2){j=Vf(Vf(NE(Vf(Vf(Vf(56032,23110)|0,22676)|0,35e3)|0,86)|0,35007)|0,23155)|0;GE(a,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(a,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(a);OE(j,i)|0;KE(j)|0;ua()}if((Kg(d)|0)!=2){j=Vf(Vf(NE(Vf(Vf(Vf(56032,23181)|0,22676)|0,35e3)|0,87)|0,35007)|0,23155)|0;GE(a,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(a,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(a);OE(j,i)|0;KE(j)|0;ua()}if((Kg(e)|0)!=2){j=Vf(Vf(NE(Vf(Vf(Vf(56032,23228)|0,22676)|0,35e3)|0,88)|0,35007)|0,23155)|0;GE(a,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(a,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(a);OE(j,i)|0;KE(j)|0;ua()}if((_g(b)|0)!=1){j=Vf(Vf(NE(Vf(Vf(Vf(56032,23275)|0,22676)|0,35e3)|0,89)|0,35007)|0,23316)|0;GE(a,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(a,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(a);OE(j,i)|0;KE(j)|0;ua()}if((_g(d)|0)!=1){j=Vf(Vf(NE(Vf(Vf(Vf(56032,23353)|0,22676)|0,35e3)|0,90)|0,35007)|0,23316)|0;GE(a,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(a,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(a);OE(j,i)|0;KE(j)|0;ua()}if((_g(e)|0)!=1){j=Vf(Vf(NE(Vf(Vf(Vf(56032,23396)|0,22676)|0,35e3)|0,91)|0,35007)|0,23316)|0;GE(a,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(a,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(a);OE(j,i)|0;KE(j)|0;ua()}j=Lg(b)|0;if((j|0)!=(Lg(e)|0)){j=Vf(Vf(NE(Vf(Vf(Vf(56032,23439)|0,22676)|0,35e3)|0,92)|0,35007)|0,23487)|0;GE(a,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(a,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(a);OE(j,i)|0;KE(j)|0;ua()}j=Mg(b)|0;if((j|0)!=(Mg(e)|0)){j=Vf(Vf(NE(Vf(Vf(Vf(56032,23519)|0,22676)|0,35e3)|0,93)|0,35007)|0,23569)|0;GE(a,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(a,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(a);OE(j,i)|0;KE(j)|0;ua()}j=Lg(d)|0;if((j|0)!=(Lg(e)|0)){j=Vf(Vf(NE(Vf(Vf(Vf(56032,23602)|0,22676)|0,35e3)|0,94)|0,35007)|0,23487)|0;GE(a,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(a,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(a);OE(j,i)|0;KE(j)|0;ua()}j=Mg(d)|0;if((j|0)!=(Mg(e)|0)){j=Vf(Vf(NE(Vf(Vf(Vf(56032,23652)|0,22676)|0,35e3)|0,95)|0,35007)|0,23569)|0;GE(a,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(a,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(a);OE(j,i)|0;KE(j)|0;ua()}g=0;while(1){if(g>>>0>=(Mg(d)|0)>>>0)break;h=$g(b,g)|0;i=ah(d,g)|0;j=ah(e,g)|0;a=0;while(1){if(a>>>0>=(Lg(d)|0)>>>0)break;f[h+(a<<2)>>2]=+f[i+(a<<2)>>2]-+f[j+(a<<2)>>2];a=a+1|0}g=g+1|0}yb=k;return}function _g(a){a=a|0;return c[a+16>>2]|0}function $g(a,b){a=a|0;b=b|0;var d=0,e=0;e=yb;yb=yb+16|0;d=e;if((c[a+8>>2]|0)>>>0>b>>>0){d=(c[a+24>>2]|0)+(B(c[a+12>>2]|0,b)|0)|0;yb=e;return d|0}else{e=Vf(Vf(NE(Vf(Vf(Vf(56032,23704)|0,23741)|0,35e3)|0,119)|0,35007)|0,23811)|0;GE(d,e+(c[(c[e>>2]|0)+-12>>2]|0)|0);b=VF(d,56736)|0;b=Gb[c[(c[b>>2]|0)+28>>2]&63](b,10)|0;WF(d);OE(e,b)|0;KE(e)|0;ua()}return 0}function ah(a,b){a=a|0;b=b|0;var d=0,e=0;e=yb;yb=yb+16|0;d=e;if((c[a+8>>2]|0)>>>0>b>>>0){d=(c[a+24>>2]|0)+(B(c[a+12>>2]|0,b)|0)|0;yb=e;return d|0}else{e=Vf(Vf(NE(Vf(Vf(Vf(56032,23704)|0,23741)|0,35e3)|0,124)|0,35007)|0,23811)|0;GE(d,e+(c[(c[e>>2]|0)+-12>>2]|0)|0);b=VF(d,56736)|0;b=Gb[c[(c[b>>2]|0)+28>>2]&63](b,10)|0;WF(d);OE(e,b)|0;KE(e)|0;ua()}return 0}function bh(b){b=b|0;var d=0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=10;c[b+12>>2]=10;c[b+16>>2]=0;c[b+20>>2]=0;c[b+24>>2]=0;a[b+28>>0]=1;Gg(b+32|0);f[b+52>>2]=0.0;f[b+56>>2]=10.0;d=b+60|0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[d+16>>2]=0;c[d+20>>2]=0;f[b+88>>2]=9.0;qj(b+92|0);d=b+144|0;c[d>>2]=0;c[b+148>>2]=0;c[b+152>>2]=0;ch(b,5e3);dh(d,36);return}function ch(a,b){a=a|0;b=b|0;c[a+84>>2]=b;sh(a+60|0,b);return}function dh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=a+4|0;f=c[a>>2]|0;e=(c[d>>2]|0)-f>>2;if(e>>>0>=b>>>0){if(e>>>0>b>>>0)c[d>>2]=f+(b<<2)}else lh(a,b-e|0);return}function eh(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;d=b;if(b|0){c[a+4>>2]=d;Nf(b,(c[a+8>>2]|0)-d|0)}return}function fh(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;d=b;if(b|0){c[a+4>>2]=d;Nf(b,(c[a+8>>2]|0)-d|0)}return}function gh(a){a=a|0;kh(a);return}function hh(a){a=a|0;var b=0,d=0,e=0,f=0;d=c[a>>2]|0;if(d|0){e=a+4|0;b=c[e>>2]|0;while(1){if((b|0)==(d|0))break;f=b+-12|0;ih(f);b=f}c[e>>2]=d;f=c[a>>2]|0;Nf(f,(c[a+8>>2]|0)-f|0)}return}function ih(a){a=a|0;var b=0,d=0,e=0,f=0;d=c[a>>2]|0;if(d|0){e=a+4|0;b=c[e>>2]|0;while(1){if((b|0)==(d|0))break;f=b+-12|0;jh(f);b=f}c[e>>2]=d;f=c[a>>2]|0;Nf(f,(c[a+8>>2]|0)-f|0)}return}function jh(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;d=b;if(b|0){c[a+4>>2]=d;Nf(b,(c[a+8>>2]|0)-d|0)}return}function kh(a){a=a|0;var b=0,d=0,e=0,f=0;d=c[a>>2]|0;if(d|0){e=a+4|0;b=c[e>>2]|0;while(1){if((b|0)==(d|0))break;f=b+-32|0;pq(f);b=f}c[e>>2]=d;f=c[a>>2]|0;Nf(f,(c[a+8>>2]|0)-f|0)}return}function lh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=yb;yb=yb+32|0;f=i;g=a+8|0;h=a+4|0;d=c[h>>2]|0;do if((c[g>>2]|0)-d>>2>>>0>>0){d=(d-(c[a>>2]|0)>>2)+b|0;e=nh(a)|0;if(e>>>0>>0)CO(a);else{j=c[a>>2]|0;k=(c[g>>2]|0)-j|0;g=k>>1;oh(f,k>>2>>>0>>1>>>0?(g>>>0>>0?d:g):e,(c[h>>2]|0)-j>>2,a+8|0);ph(f,b);qh(a,f);rh(f);break}}else mh(a,b);while(0);yb=i;return}function mh(a,b){a=a|0;b=b|0;var d=0;a=a+4|0;d=c[a>>2]|0;_O(d|0,0,b<<2|0)|0;c[a>>2]=d+(b<<2);return}function nh(a){a=a|0;return 1073741823}function oh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;do if(b)if(b>>>0>1073741823){f=O(8)|0;bO(f,37409);c[f>>2]=16392;Q(f|0,13960,22)}else{e=rB(b<<2)|0;break}else e=0;while(0);c[a>>2]=e;d=e+(d<<2)|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+(b<<2);return}function ph(a,b){a=a|0;b=b|0;var d=0;a=a+8|0;d=c[a>>2]|0;_O(d|0,0,b<<2|0)|0;c[a>>2]=d+(b<<2);return}function qh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[a>>2]|0;h=a+4|0;g=b+4|0;f=(c[h>>2]|0)-e|0;d=(c[g>>2]|0)+(0-(f>>2)<<2)|0;c[g>>2]=d;if((f|0)>0){YO(d|0,e|0,f|0)|0;e=g;d=c[g>>2]|0}else e=g;g=c[a>>2]|0;c[a>>2]=d;c[e>>2]=g;g=b+8|0;f=c[h>>2]|0;c[h>>2]=c[g>>2];c[g>>2]=f;g=a+8|0;h=b+12|0;a=c[g>>2]|0;c[g>>2]=c[h>>2];c[h>>2]=a;c[b>>2]=c[e>>2];return}function rh(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a+4>>2]|0;d=a+8|0;e=c[d>>2]|0;while(1){if((e|0)==(b|0))break;f=e+-4|0;c[d>>2]=f;e=f}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function sh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=yb;yb=yb+32|0;d=f;e=c[a>>2]|0;if((((c[a+8>>2]|0)-e|0)/36|0)>>>0>>0){th(d,b,((c[a+4>>2]|0)-e|0)/36|0,a+8|0);uh(a,d);vh(d)}yb=f;return}function th(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;do if(b)if(b>>>0>119304647){f=O(8)|0;bO(f,37409);c[f>>2]=16392;Q(f|0,13960,22)}else{e=rB(b*36|0)|0;break}else e=0;while(0);c[a>>2]=e;d=e+(d*36|0)|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+(b*36|0);return}function uh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[a>>2]|0;h=a+4|0;g=b+4|0;f=(c[h>>2]|0)-e|0;d=(c[g>>2]|0)+(((f|0)/-36|0)*36|0)|0;c[g>>2]=d;if((f|0)>0){YO(d|0,e|0,f|0)|0;e=g;d=c[g>>2]|0}else e=g;g=c[a>>2]|0;c[a>>2]=d;c[e>>2]=g;g=b+8|0;f=c[h>>2]|0;c[h>>2]=c[g>>2];c[g>>2]=f;g=a+8|0;h=b+12|0;a=c[g>>2]|0;c[g>>2]=c[h>>2];c[h>>2]=a;c[b>>2]=c[e>>2];return}function vh(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a+4>>2]|0;d=a+8|0;e=c[d>>2]|0;while(1){if((e|0)==(b|0))break;f=e+-36|0;c[d>>2]=f;e=f}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function wh(a){a=a|0;eh(a+144|0);rj(a+92|0);fh(a+72|0);fh(a+60|0);gh(a+32|0);hh(a+16|0);return} +function Lz(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;if((e|0)==1){g=(c[a+8>>2]|0)-(c[a+4>>2]|0)|0;b=NO(b|0,d|0,g|0,((g|0)<0)<<31>>31|0)|0;d=F()|0}f=a+20|0;g=a+28|0;if((c[f>>2]|0)>>>0>(c[g>>2]|0)>>>0?(Hb[c[a+36>>2]&63](a,0,0)|0,(c[f>>2]|0)==0):0)b=-1;else{c[a+16>>2]=0;c[g>>2]=0;c[f>>2]=0;Ib[c[a+40>>2]&15](a,b,d,e)|0;if((F()|0)<0)b=-1;else{c[a+8>>2]=0;c[a+4>>2]=0;c[a>>2]=c[a>>2]&-17;b=0}}return b|0}function Mz(a,b){a=a|0;b=b|0;return Nz(a,b,(Oy(a)|0)+1|0)|0}function Nz(b,c,d){b=b|0;c=c|0;d=d|0;a:do if(!d)d=0;else{c=c&255;while(1){d=d+-1|0;if((a[b+d>>0]|0)==c<<24>>24)break;if(!d){d=0;break a}}d=b+d|0}while(0);return d|0}function Oz(a,b,c){a=a|0;b=b|0;c=c|0;return Vy(0,a,b,(c|0)==0?55652:c)|0}function Pz(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;n=yb;yb=yb+1040|0;k=n;l=n+1024|0;j=c[b>>2]|0;c[l>>2]=j;m=(a|0)!=0;h=m?e:256;i=m?a:k;g=j;a:do if((h|0)!=0&(j|0)!=0){e=0;j=i;while(1){a=d>>>2;i=a>>>0>=h>>>0;if(!(d>>>0>131|i)){i=j;break a}a=i?h:a;d=d-a|0;a=Qz(j,l,a,f)|0;if((a|0)==-1)break;i=(j|0)==(k|0);h=h-(i?0:a)|0;i=i?j:j+(a<<2)|0;e=a+e|0;g=c[l>>2]|0;if((h|0)!=0&(g|0)!=0)j=i;else break a}e=-1;i=j;h=0;g=c[l>>2]|0}else e=0;while(0);b:do if((g|0)!=0?(h|0)!=0&(d|0)!=0:0){while(1){a=Vy(i,g,d,f)|0;if((a+2|0)>>>0<3)break;g=(c[l>>2]|0)+a|0;c[l>>2]=g;d=d-a|0;h=h+-1|0;e=e+1|0;if(!((h|0)!=0&(d|0)!=0))break b;else i=i+4|0}switch(a|0){case -1:{e=a;break b}case 0:{c[l>>2]=0;break b}default:{c[f>>2]=0;break b}}}while(0);if(m)c[b>>2]=c[l>>2];yb=n;return e|0}function Qz(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;h=c[e>>2]|0;if((g|0)!=0?(i=c[g>>2]|0,(i|0)!=0):0)if(!b){j=h;g=f;l=26}else{c[g>>2]=0;k=f;j=h;l=48}else l=5;a:do if((l|0)==5){g=(b|0)!=0;if(c[c[(Rz()|0)+188>>2]>>2]|0)if(g){g=f;l=33;break}else{g=f;l=15;break}if(!g){f=Oy(h)|0;l=63;break}b:do if(f){g=f;while(1){i=a[h>>0]|0;if(!(i<<24>>24))break;h=h+1|0;c[b>>2]=i<<24>>24&57343;g=g+-1|0;if(!g)break b;else b=b+4|0}c[b>>2]=0;c[e>>2]=0;f=f-g|0;l=63;break a}while(0);c[e>>2]=h;l=63}while(0);c:while(1){d:do if((l|0)==15){while(1){i=a[h>>0]|0;if(((i&255)+-1|0)>>>0<127?(h&3|0)==0:0){l=c[h>>2]|0;i=l&255;if(!((l+-16843009|l)&-2139062144)){do{h=h+4|0;g=g+-4|0;i=c[h>>2]|0}while(!((i+-16843009|i)&-2139062144|0));i=i&255}}i=i&255;if((i+-1|0)>>>0>=127)break;g=g+-1|0;h=h+1|0}i=i+-194|0;if(i>>>0>50)l=57;else{i=c[5728+(i<<2)>>2]|0;j=h+1|0;l=26;continue c}}else if((l|0)==26){l=(d[j>>0]|0)>>>3;if((l+-16|l+(i>>26))>>>0>7){h=j;l=56}else{h=j+1|0;if(i&33554432){if((a[h>>0]&-64)<<24>>24!=-128){h=j;l=56;break}h=j+2|0;if(i&524288){if((a[h>>0]&-64)<<24>>24!=-128){h=j;l=56;break}h=j+3|0}}g=g+-1|0;l=15;continue c}}else if((l|0)==33){l=0;e:do if(g){while(1){i=d[h>>0]|0;j=i+-1|0;if(j>>>0<127){if((h&3|0)==0&g>>>0>4){while(1){i=c[h>>2]|0;if((i+-16843009|i)&-2139062144|0){l=42;break}c[b>>2]=i&255;c[b+4>>2]=d[h+1>>0];c[b+8>>2]=d[h+2>>0];j=h+4|0;i=b+16|0;c[b+12>>2]=d[h+3>>0];g=g+-4|0;if(g>>>0>4){b=i;h=j}else{l=41;break}}if((l|0)==41){b=i;h=j;i=a[j>>0]|0}else if((l|0)==42)i=i&255;i=i&255;j=i+-1|0;l=44}}else l=44;if((l|0)==44){l=0;if(j>>>0>=127)break}h=h+1|0;c[b>>2]=i;g=g+-1|0;if(!g)break e;else b=b+4|0}i=i+-194|0;if(i>>>0>50){l=57;break d}i=c[5728+(i<<2)>>2]|0;k=g;j=h+1|0;l=48;continue c}while(0);c[e>>2]=h;l=63;continue c}else if((l|0)==48){l=0;g=d[j>>0]|0;h=g>>>3;if((h+-16|h+(i>>26))>>>0>7){h=j;g=k;l=56}else{h=j+1|0;g=g+-128|i<<6;do if((g|0)<0){i=(d[h>>0]|0)+-128|0;if(i>>>0<=63){h=j+2|0;g=i|g<<6;if((g|0)>=0)break;i=(d[h>>0]|0)+-128|0;if(i>>>0<=63){h=j+3|0;g=i|g<<6;break}}c[(mx()|0)>>2]=25;h=j+-1|0;break d}while(0);c[b>>2]=g;b=b+4|0;g=k+-1|0;l=33;continue c}}else if((l|0)==63)return f|0;while(0);if((l|0)==56){h=h+-1|0;if(!i)l=57;else{f=b;l=61}}if((l|0)==57)if(!(a[h>>0]|0)){if(b|0){c[b>>2]=0;c[e>>2]=0}f=f-g|0;l=63;continue}else{f=b;l=61}if((l|0)==61){c[(mx()|0)>>2]=25;if(!f){f=-1;l=63;continue}}c[e>>2]=h;f=-1;l=63}return 0}function Rz(){return _x()|0}function Sz(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;l=yb;yb=yb+272|0;i=l;j=l+256|0;f=c[b>>2]|0;c[j>>2]=f;k=(a|0)!=0;g=k?e:256;h=k?a:i;e=f;a:do if((g|0)!=0&(f|0)!=0){f=0;a=e;while(1){e=d>>>0>=g>>>0;if(!(e|d>>>0>32)){e=a;break a}e=e?g:d;d=d-e|0;e=Tz(h,j,e,0)|0;if((e|0)==-1)break;a=(h|0)==(i|0);g=g-(a?0:e)|0;h=a?h:h+e|0;f=e+f|0;e=c[j>>2]|0;if((g|0)!=0&(e|0)!=0)a=e;else break a}f=-1;g=0;e=c[j>>2]|0}else f=0;while(0);b:do if((e|0)!=0?(g|0)!=0&(d|0)!=0:0){while(1){a=Yx(h,c[e>>2]|0,0)|0;if((a+1|0)>>>0<2)break;e=(c[j>>2]|0)+4|0;c[j>>2]=e;d=d+-1|0;g=g-a|0;f=a+f|0;if(!((g|0)!=0&(d|0)!=0))break b;else h=h+a|0}if(!a)c[j>>2]=0;else f=-1}while(0);if(k)c[b>>2]=c[j>>2];yb=l;return f|0}function Tz(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;j=yb;yb=yb+16|0;i=j;a:do if(!b){e=c[d>>2]|0;f=c[e>>2]|0;if(!f)e=0;else{b=e;e=0;do{if(f>>>0>127){f=Yx(i,f,0)|0;if((f|0)==-1){e=-1;break a}}else f=1;e=f+e|0;b=b+4|0;f=c[b>>2]|0}while((f|0)!=0)}}else{b:do if(e>>>0>3){f=e;g=c[d>>2]|0;while(1){h=c[g>>2]|0;if((h+-1|0)>>>0>126){if(!h)break;h=Yx(b,h,0)|0;if((h|0)==-1){e=-1;break a}b=b+h|0;f=f-h|0}else{a[b>>0]=h;b=b+1|0;f=f+-1|0;g=c[d>>2]|0}g=g+4|0;c[d>>2]=g;if(f>>>0<=3)break b}a[b>>0]=0;c[d>>2]=0;e=e-f|0;break a}else f=e;while(0);if(f){g=c[d>>2]|0;while(1){h=c[g>>2]|0;if((h+-1|0)>>>0>126){if(!h){g=20;break}h=Yx(i,h,0)|0;if((h|0)==-1){e=-1;break a}if(f>>>0>>0){g=23;break}Yx(b,c[g>>2]|0,0)|0;b=b+h|0;f=f-h|0}else{a[b>>0]=h;b=b+1|0;f=f+-1|0;g=c[d>>2]|0}g=g+4|0;c[d>>2]=g;if(!f)break a}if((g|0)==20){a[b>>0]=0;c[d>>2]=0;e=e-f|0;break}else if((g|0)==23){e=e-f|0;break}}}while(0);yb=j;return e|0}function Uz(a,b,c){a=a|0;b=b|0;c=c|0;Vz(a,b,c)|0;return a|0}function Vz(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=d;a:do if(!((g^b)&3)){f=(e|0)!=0;if(f&(g&3|0)!=0)do{g=a[d>>0]|0;a[b>>0]=g;if(!(g<<24>>24))break a;e=e+-1|0;d=d+1|0;b=b+1|0;f=(e|0)!=0}while(f&(d&3|0)!=0);if(f){if(a[d>>0]|0){b:do if(e>>>0>3){f=d;while(1){d=c[f>>2]|0;if((d&-2139062144^-2139062144)&d+-16843009|0){d=f;break b}c[b>>2]=d;e=e+-4|0;d=f+4|0;b=b+4|0;if(e>>>0>3)f=d;else break}}while(0);h=13}}else e=0}else h=13;while(0);c:do if((h|0)==13)if(!e)e=0;else while(1){h=a[d>>0]|0;a[b>>0]=h;if(!(h<<24>>24))break c;e=e+-1|0;b=b+1|0;if(!e){e=0;break}else d=d+1|0}while(0);_O(b|0,0,e|0)|0;return b|0}function Wz(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;g=yb;yb=yb+32|0;f=g;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[f+20>>2]=0;c[f+24>>2]=0;c[f+28>>2]=0;e=a[d>>0]|0;do if(!(e<<24>>24))d=0;else{if(!(a[d+1>>0]|0)){d=b;while(1)if((a[d>>0]|0)==e<<24>>24)d=d+1|0;else break;d=d-b|0;break}do{i=e&255;h=f+(i>>>5<<2)|0;c[h>>2]=c[h>>2]|1<<(i&31);d=d+1|0;e=a[d>>0]|0}while(e<<24>>24!=0);e=a[b>>0]|0;a:do if(!(e<<24>>24))d=b;else{d=b;do{i=e&255;if(!(c[f+(i>>>5<<2)>>2]&1<<(i&31)))break a;d=d+1|0;e=a[d>>0]|0}while(e<<24>>24!=0)}while(0);d=d-b|0}while(0);yb=g;return d|0}function Xz(a){a=a|0;var b=0,e=0,f=0;if((c[a+76>>2]|0)>=0?(Nx(a)|0)!=0:0){b=a+4|0;e=c[b>>2]|0;if(e>>>0<(c[a+8>>2]|0)>>>0){c[b>>2]=e+1;b=d[e>>0]|0}else b=yx(a)|0}else f=3;do if((f|0)==3){b=a+4|0;e=c[b>>2]|0;if(e>>>0<(c[a+8>>2]|0)>>>0){c[b>>2]=e+1;b=d[e>>0]|0;break}else{b=yx(a)|0;break}}while(0);return b|0}function Yz(a){a=a|0;var b=0;b=54792;c[b>>2]=a+-1;c[b+4>>2]=0;return}function Zz(){var a=0,b=0,d=0;b=54792;b=LO(c[b>>2]|0,c[b+4>>2]|0,1284865837,1481765933)|0;b=MO(b|0,F()|0,1,0)|0;a=F()|0;d=54792;c[d>>2]=b;c[d+4>>2]=a;a=RO(b|0,a|0,33)|0;F()|0;return a|0}function _z(a,b){a=a|0;b=b|0;az(a+(Oy(a)|0)|0,b)|0;return a|0}function $z(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=yb;yb=yb+16|0;e=h;c[e>>2]=c[d>>2];e=Hx(0,0,b,e)|0;if((e|0)>=0?(f=e+1|0,g=DO(f)|0,c[a>>2]=g,(g|0)!=0):0)a=Hx(g,f,b,d)|0;else a=-1;yb=h;return a|0}function aA(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;do if((b|0)!=-1){if((c[d+76>>2]|0)>-1)g=Nx(d)|0;else g=0;h=d+4|0;e=c[h>>2]|0;if(!e){zx(d)|0;e=c[h>>2]|0;if(e|0){f=e;i=6}}else{f=e;i=6}if((i|0)==6?f>>>0>((c[d+44>>2]|0)+-8|0)>>>0:0){i=f+-1|0;c[h>>2]=i;a[i>>0]=b;c[d>>2]=c[d>>2]&-17;if(!g)break;Ox(d);break}if(g){Ox(d);b=-1}else b=-1}else b=-1;while(0);return b|0}function bA(a){a=a|0;var b=0,d=0,e=0;if((c[a+76>>2]|0)>-1){e=(Nx(a)|0)==0;d=cA(a)|0;b=F()|0;if(e)a=d;else{Ox(a);a=d}}else{a=cA(a)|0;b=F()|0}E(b|0);return a|0}function cA(a){a=a|0;var b=0,d=0,e=0;if(!(c[a>>2]&128))b=1;else b=(c[a+20>>2]|0)>>>0>(c[a+28>>2]|0)>>>0?2:1;b=Ib[c[a+40>>2]&15](a,0,0,b)|0;d=F()|0;if((d|0)>=0){e=(c[a+8>>2]|0)-(c[a+4>>2]|0)|0;e=NO(b|0,d|0,e|0,((e|0)<0)<<31>>31|0)|0;d=F()|0;b=(c[a+20>>2]|0)-(c[a+28>>2]|0)|0;b=MO(e|0,d|0,b|0,((b|0)<0)<<31>>31|0)|0;d=F()|0}E(d|0);return b|0}function dA(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;if((c[d+76>>2]|0)>=0?(Nx(d)|0)!=0:0){f=b&255;e=b&255;if((e|0)!=(a[d+75>>0]|0)?(i=d+20|0,j=c[i>>2]|0,j>>>0<(c[d+16>>2]|0)>>>0):0){c[i>>2]=j+1;a[j>>0]=f}else e=mz(d,b)|0;Ox(d)}else k=3;do if((k|0)==3){f=b&255;e=b&255;if((e|0)!=(a[d+75>>0]|0)?(g=d+20|0,h=c[g>>2]|0,h>>>0<(c[d+16>>2]|0)>>>0):0){c[g>>2]=h+1;a[h>>0]=f;break}e=mz(d,b)|0}while(0);return e|0}function eA(b,d,e,f){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;k=B(e,d)|0;e=(d|0)==0?0:e;if((c[f+76>>2]|0)>-1)j=Nx(f)|0;else j=0;g=f+74|0;h=a[g>>0]|0;a[g>>0]=h+255|h;g=f+4|0;h=c[g>>2]|0;i=(c[f+8>>2]|0)-h|0;if((i|0)>0){i=i>>>0>>0?i:k;YO(b|0,h|0,i|0)|0;c[g>>2]=(c[g>>2]|0)+i;g=k-i|0;b=b+i|0}else g=k;a:do if(!g)l=13;else{i=f+32|0;while(1){if(zx(f)|0)break;h=Hb[c[i>>2]&63](f,b,g)|0;if((h+1|0)>>>0<2)break;g=g-h|0;if(!g){l=13;break a}else b=b+h|0}if(j|0)Ox(f);e=((k-g|0)>>>0)/(d>>>0)|0}while(0);if((l|0)==13)if(j)Ox(f);return e|0}function fA(a){a=a|0;var b=0;a=bA(a)|0;b=F()|0;if((b|0)>0|(b|0)==0&a>>>0>2147483647){c[(mx()|0)>>2]=61;a=-1}return a|0}function gA(a){a=a|0;var b=0;if((c[a+76>>2]|0)>-1){b=(Nx(a)|0)==0;Lz(a,0,0,0)|0;c[a>>2]=c[a>>2]&-33;if(!b)Ox(a)}else{Lz(a,0,0,0)|0;c[a>>2]=c[a>>2]&-33}return}function hA(a,b){a=a|0;b=b|0;return +(+iA(a,b,1))}function iA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0,h=0,i=0;g=yb;yb=yb+144|0;e=g;_O(e|0,0,144)|0;i=e+4|0;c[i>>2]=a;h=e+8|0;c[h>>2]=-1;c[e+44>>2]=a;c[e+76>>2]=-1;ux(e,0,0);f=+By(e,d,1);e=e+120|0;d=(c[i>>2]|0)-(c[h>>2]|0)|0;d=MO(c[e>>2]|0,c[e+4>>2]|0,d|0,((d|0)<0)<<31>>31|0)|0;e=F()|0;if(b|0)c[b>>2]=(d|0)==0&(e|0)==0?a:a+d|0;yb=g;return +f}function jA(b){b=b|0;var c=0,d=0,e=0,f=0,g=0;while(1){e=b+1|0;if(!(xx(a[b>>0]|0)|0))break;else b=e}d=a[b>>0]|0;switch(d|0){case 45:{b=1;f=5;break}case 43:{b=0;f=5;break}default:{g=0;c=b;b=d}}if((f|0)==5){g=b;c=e;b=a[e>>0]|0}if(!(Ex(b)|0))b=0;else{b=0;do{b=(b*10|0)+48-(a[c>>0]|0)|0;c=c+1|0}while((Ex(a[c>>0]|0)|0)!=0)}return ((g|0)==0?0-b|0:b)|0}function kA(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;h=yb;yb=yb+32|0;f=h;e=a[d>>0]|0;a:do if(e<<24>>24!=0?(a[d+1>>0]|0)!=0:0){_O(f|0,0,32)|0;e=a[d>>0]|0;if(e<<24>>24)do{j=e&255;i=f+(j>>>5<<2)|0;c[i>>2]=c[i>>2]|1<<(j&31);d=d+1|0;e=a[d>>0]|0}while(e<<24>>24!=0);d=a[b>>0]|0;if(!(d<<24>>24))e=b;else{e=b;do{j=d&255;if(c[f+(j>>>5<<2)>>2]&1<<(j&31)|0)break a;e=e+1|0;d=a[e>>0]|0}while(d<<24>>24!=0)}}else g=3;while(0);if((g|0)==3)e=Ry(b,e<<24>>24)|0;yb=h;return e-b|0}function lA(a,b){a=a|0;b=b|0;return +(+iA(a,b,0))}function mA(a,b){a=a|0;b=b|0;return +(+iA(a,b,2))}function nA(a,b,c){a=a|0;b=b|0;c=c|0;return +(+lA(a,b))}function oA(a,b,c){a=a|0;b=b|0;c=c|0;return +(+hA(a,b))}function pA(a,b,c){a=a|0;b=b|0;c=c|0;return +(+mA(a,b))}function qA(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;e=b+(Oy(b)|0)|0;a:do if(d)while(1){g=a[c>>0]|0;if(!(g<<24>>24))break a;d=d+-1|0;f=e+1|0;a[e>>0]=g;if(!d){e=f;break}else{c=c+1|0;e=f}}while(0);a[e>>0]=0;return b|0}function rA(b,d){b=b|0;d=d|0;var e=0;if(!b){b=c[13914]|0;if(!b)b=0;else e=3}else e=3;do if((e|0)==3){b=b+(Wz(b,d)|0)|0;if(!(a[b>>0]|0)){c[13914]=0;b=0;break}d=b+(kA(b,d)|0)|0;c[13914]=d;if(!(a[d>>0]|0)){c[13914]=0;break}else{c[13914]=d+1;a[d>>0]=0;break}}while(0);return b|0}function sA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;if(d|0){e=a;while(1){d=d+-1|0;c[e>>2]=b;if(!d)break;else e=e+4|0}}return a|0}function tA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;if(a-b>>2>>>0>=d>>>0){if(d|0){e=a;while(1){d=d+-1|0;c[e>>2]=c[b>>2];if(!d)break;else{b=b+4|0;e=e+4|0}}}}else do{d=d+-1|0;c[a+(d<<2)>>2]=c[b+(d<<2)>>2]}while((d|0)!=0);return a|0}function uA(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0;e=yb;yb=yb+48|0;g=e+32|0;b=e+24|0;h=e+16|0;f=e;e=e+36|0;a=vA()|0;if(a|0?(d=c[a>>2]|0,d|0):0){a=d+48|0;if(!(wA(a)|0)){c[b>>2]=46910;yA(46860,b)}b=xA(a)|0;if((b|0)==1126902529&(F()|0)==1129074247)a=c[d+44>>2]|0;else a=d+80|0;c[e>>2]=a;d=c[d>>2]|0;a=c[d+4>>2]|0;if(Hb[c[(c[3470]|0)+16>>2]&63](13880,d,e)|0){h=c[e>>2]|0;h=Eb[c[(c[h>>2]|0)+8>>2]&127](h)|0;c[f>>2]=46910;c[f+4>>2]=a;c[f+8>>2]=h;yA(46774,f)}else{c[h>>2]=46910;c[h+4>>2]=a;yA(46819,h)}}yA(46898,g)}function vA(){return 55660}function wA(a){a=a|0;return 0}function xA(a){a=a|0;E(0);return 0}function yA(a,b){a=a|0;b=b|0;var d=0;d=yb;yb=yb+16|0;c[d>>2]=b;b=c[4001]|0;Ix(b,a,d)|0;dA(10,b)|0;ua()}function zA(a){a=a|0;return}function AA(a){a=a|0;zA(a);QA(a);return}function BA(a){a=a|0;return}function CA(a){a=a|0;return}function DA(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0;l=yb;yb=yb+64|0;j=l;if(!(HA(d,e,0)|0))if((e|0)!=0?(k=LA(e,13904,13888,0)|0,(k|0)!=0):0){c[j>>2]=k;c[j+4>>2]=0;c[j+8>>2]=d;c[j+12>>2]=-1;d=j+16|0;e=j+24|0;g=j+48|0;h=d;i=h+36|0;do{c[h>>2]=0;h=h+4|0}while((h|0)<(i|0));b[d+36>>1]=0;a[d+38>>0]=0;c[g>>2]=1;Vb[c[(c[k>>2]|0)+28>>2]&31](k,j,c[f>>2]|0,1);if((c[e>>2]|0)==1){c[f>>2]=c[d>>2];d=1}else d=0}else d=0;else d=1;yb=l;return d|0}function EA(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;if(HA(a,c[b+8>>2]|0,g)|0)KA(0,b,d,e,f);return}function FA(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;do if(!(HA(b,c[d+8>>2]|0,g)|0)){if(HA(b,c[d>>2]|0,g)|0){if((c[d+16>>2]|0)!=(e|0)?(h=d+20|0,(c[h>>2]|0)!=(e|0)):0){c[d+32>>2]=f;c[h>>2]=e;g=d+40|0;c[g>>2]=(c[g>>2]|0)+1;if((c[d+36>>2]|0)==1?(c[d+24>>2]|0)==2:0)a[d+54>>0]=1;c[d+44>>2]=4;break}if((f|0)==1)c[d+32>>2]=1}}else JA(0,d,e,f);while(0);return}function GA(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;if(HA(a,c[b+8>>2]|0,0)|0)IA(0,b,d,e);return}function HA(a,b,d){a=a|0;b=b|0;d=d|0;if(d)a=(Dx(c[a+4>>2]|0,c[b+4>>2]|0)|0)==0;else a=(a|0)==(b|0);return a|0}function IA(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0;b=d+16|0;g=c[b>>2]|0;do if(g){if((g|0)!=(e|0)){f=d+36|0;c[f>>2]=(c[f>>2]|0)+1;c[d+24>>2]=2;a[d+54>>0]=1;break}b=d+24|0;if((c[b>>2]|0)==2)c[b>>2]=f}else{c[b>>2]=e;c[d+24>>2]=f;c[d+36>>2]=1}while(0);return}function JA(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;if((c[b+4>>2]|0)==(d|0)?(f=b+28|0,(c[f>>2]|0)!=1):0)c[f>>2]=e;return}function KA(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;a[d+53>>0]=1;do if((c[d+4>>2]|0)==(f|0)){a[d+52>>0]=1;b=d+16|0;f=c[b>>2]|0;if(!f){c[b>>2]=e;c[d+24>>2]=g;c[d+36>>2]=1;if(!((g|0)==1?(c[d+48>>2]|0)==1:0))break;a[d+54>>0]=1;break}if((f|0)!=(e|0)){g=d+36|0;c[g>>2]=(c[g>>2]|0)+1;a[d+54>>0]=1;break}f=d+24|0;b=c[f>>2]|0;if((b|0)==2){c[f>>2]=g;b=g}if((b|0)==1?(c[d+48>>2]|0)==1:0)a[d+54>>0]=1}while(0);return}function LA(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;p=yb;yb=yb+64|0;n=p;m=c[d>>2]|0;o=d+(c[m+-8>>2]|0)|0;m=c[m+-4>>2]|0;c[n>>2]=f;c[n+4>>2]=d;c[n+8>>2]=e;c[n+12>>2]=g;d=n+16|0;e=n+20|0;g=n+24|0;h=n+28|0;i=n+32|0;j=n+40|0;k=d;l=k+36|0;do{c[k>>2]=0;k=k+4|0}while((k|0)<(l|0));b[d+36>>1]=0;a[d+38>>0]=0;a:do if(HA(m,f,0)|0){c[n+48>>2]=1;Xb[c[(c[m>>2]|0)+20>>2]&7](m,n,o,o,1,0);d=(c[g>>2]|0)==1?o:0}else{Wb[c[(c[m>>2]|0)+24>>2]&63](m,n,o,1,0);switch(c[n+36>>2]|0){case 0:{d=(c[j>>2]|0)==1&(c[h>>2]|0)==1&(c[i>>2]|0)==1?c[e>>2]|0:0;break a}case 1:break;default:{d=0;break a}}if((c[g>>2]|0)!=1?!((c[j>>2]|0)==0&(c[h>>2]|0)==1&(c[i>>2]|0)==1):0){d=0;break}d=c[d>>2]|0}while(0);yb=p;return d|0}function MA(a){a=a|0;zA(a);QA(a);return}function NA(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;if(HA(a,c[b+8>>2]|0,g)|0)KA(0,b,d,e,f);else{a=c[a+8>>2]|0;Xb[c[(c[a>>2]|0)+20>>2]&7](a,b,d,e,f,g)}return}function OA(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;a:do if(!(HA(b,c[d+8>>2]|0,g)|0)){if(!(HA(b,c[d>>2]|0,g)|0)){i=c[b+8>>2]|0;Wb[c[(c[i>>2]|0)+24>>2]&63](i,d,e,f,g);break}if((c[d+16>>2]|0)!=(e|0)?(i=d+20|0,(c[i>>2]|0)!=(e|0)):0){c[d+32>>2]=f;f=d+44|0;do if((c[f>>2]|0)!=4){h=d+52|0;a[h>>0]=0;j=d+53|0;a[j>>0]=0;b=c[b+8>>2]|0;Xb[c[(c[b>>2]|0)+20>>2]&7](b,d,e,e,1,g);if(a[j>>0]|0){j=(a[h>>0]|0)==0;c[f>>2]=3;if(j)break;else break a}else{c[f>>2]=4;break}}while(0);c[i>>2]=e;j=d+40|0;c[j>>2]=(c[j>>2]|0)+1;if((c[d+36>>2]|0)!=1)break;if((c[d+24>>2]|0)!=2)break;a[d+54>>0]=1;break}if((f|0)==1)c[d+32>>2]=1}else JA(0,d,e,f);while(0);return}function PA(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;if(HA(a,c[b+8>>2]|0,0)|0)IA(0,b,d,e);else{a=c[a+8>>2]|0;Vb[c[(c[a>>2]|0)+28>>2]&31](a,b,d,e)}return}function QA(a){a=a|0;EO(a);return}function RA(a){a=a|0;return}function SA(){var a=0,b=0;a=vA()|0;if((a|0?(b=c[a>>2]|0,b|0):0)?wA(b+48|0)|0:0)TA(c[b+12>>2]|0);TA(UA()|0)}function TA(a){a=a|0;var b=0;b=yb;yb=yb+16|0;Pb[a&1]();yA(47049,b)}function UA(){return 1}function VA(a){a=a|0;return}function WA(a){a=a|0;c[a>>2]=16372;_A(a+4|0);return}function XA(a){a=a|0;WA(a);QA(a);return}function YA(a){a=a|0;return ZA(a+4|0)|0}function ZA(a){a=a|0;return c[a>>2]|0}function _A(a){a=a|0;var b=0,d=0;if($A(a)|0?(b=aB(c[a>>2]|0)|0,d=b+8|0,a=c[d>>2]|0,c[d>>2]=a+-1,(a|0)<1):0)QA(b);return}function $A(a){a=a|0;return 1}function aB(a){a=a|0;return a+-12|0}function bB(a){a=a|0;WA(a);QA(a);return}function cB(a){a=a|0;zA(a);QA(a);return}function dB(a,b,c){a=a|0;b=b|0;c=c|0;return HA(a,b,0)|0}function eB(a){a=a|0;zA(a);QA(a);return}function fB(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 i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;if(HA(b,c[d+8>>2]|0,h)|0)KA(0,d,e,f,g);else{r=d+52|0;j=a[r>>0]|0;q=d+53|0;i=a[q>>0]|0;p=c[b+12>>2]|0;m=b+16+(p<<3)|0;a[r>>0]=0;a[q>>0]=0;jB(b+16|0,d,e,f,g,h);k=a[r>>0]|0;j=k|j;l=a[q>>0]|0;i=l|i;a:do if((p|0)>1){n=d+24|0;o=b+8|0;p=d+54|0;b=b+24|0;do{i=i&1;j=j&1;if(a[p>>0]|0)break a;if(!(k<<24>>24)){if(l<<24>>24?(c[o>>2]&1|0)==0:0)break a}else{if((c[n>>2]|0)==1)break a;if(!(c[o>>2]&2))break a}a[r>>0]=0;a[q>>0]=0;jB(b,d,e,f,g,h);k=a[r>>0]|0;j=k|j;l=a[q>>0]|0;i=l|i;b=b+8|0}while(b>>>0>>0)}while(0);a[r>>0]=j<<24>>24!=0&1;a[q>>0]=i<<24>>24!=0&1}return}function gB(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;a:do if(!(HA(b,c[d+8>>2]|0,g)|0)){if(!(HA(b,c[d>>2]|0,g)|0)){p=c[b+12>>2]|0;k=b+16+(p<<3)|0;kB(b+16|0,d,e,f,g);h=b+24|0;if((p|0)<=1)break;b=c[b+8>>2]|0;if((b&2|0)==0?(j=d+36|0,(c[j>>2]|0)!=1):0){if(!(b&1)){b=d+54|0;while(1){if(a[b>>0]|0)break a;if((c[j>>2]|0)==1)break a;kB(h,d,e,f,g);h=h+8|0;if(h>>>0>=k>>>0)break a}}b=d+24|0;i=d+54|0;while(1){if(a[i>>0]|0)break a;if((c[j>>2]|0)==1?(c[b>>2]|0)==1:0)break a;kB(h,d,e,f,g);h=h+8|0;if(h>>>0>=k>>>0)break a}}b=d+54|0;while(1){if(a[b>>0]|0)break a;kB(h,d,e,f,g);h=h+8|0;if(h>>>0>=k>>>0)break a}}if((c[d+16>>2]|0)!=(e|0)?(p=d+20|0,(c[p>>2]|0)!=(e|0)):0){c[d+32>>2]=f;o=d+44|0;if((c[o>>2]|0)!=4){j=b+16+(c[b+12>>2]<<3)|0;k=d+52|0;f=d+53|0;l=d+54|0;m=b+8|0;n=d+24|0;h=0;i=b+16|0;b=0;b:while(1){if(i>>>0>=j>>>0){i=18;break}a[k>>0]=0;a[f>>0]=0;jB(i,d,e,e,1,g);if(a[l>>0]|0){i=18;break}do if(a[f>>0]|0){if(!(a[k>>0]|0))if(!(c[m>>2]&1)){i=19;break b}else{b=1;break}if((c[n>>2]|0)==1){h=1;i=19;break b}if(!(c[m>>2]&2)){h=1;i=19;break b}else{h=1;b=1}}while(0);i=i+8|0}if((i|0)==18)if(b)i=19;else b=4;if((i|0)==19)b=3;c[o>>2]=b;if(h&1)break}c[p>>2]=e;e=d+40|0;c[e>>2]=(c[e>>2]|0)+1;if((c[d+36>>2]|0)!=1)break;if((c[d+24>>2]|0)!=2)break;a[d+54>>0]=1;break}if((f|0)==1)c[d+32>>2]=1}else JA(0,d,e,f);while(0);return}function hB(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;a:do if(!(HA(b,c[d+8>>2]|0,0)|0)){h=c[b+12>>2]|0;g=b+16+(h<<3)|0;iB(b+16|0,d,e,f);if((h|0)>1){h=d+54|0;b=b+24|0;do{iB(b,d,e,f);if(a[h>>0]|0)break a;b=b+8|0}while(b>>>0>>0)}}else IA(0,d,e,f);while(0);return}function iB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=c[a+4>>2]|0;if(d){f=g>>8;if(g&1)f=c[(c[d>>2]|0)+f>>2]|0}else f=0;a=c[a>>2]|0;Vb[c[(c[a>>2]|0)+28>>2]&31](a,b,d+f|0,(g&2|0)==0?2:e);return}function jB(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 h=0,i=0;i=c[a+4>>2]|0;h=i>>8;if(i&1)h=c[(c[e>>2]|0)+h>>2]|0;a=c[a>>2]|0;Xb[c[(c[a>>2]|0)+20>>2]&7](a,b,d,e+h|0,(i&2|0)==0?2:f,g);return}function kB(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;h=c[a+4>>2]|0;g=h>>8;if(h&1)g=c[(c[d>>2]|0)+g>>2]|0;a=c[a>>2]|0;Wb[c[(c[a>>2]|0)+24>>2]&63](a,b,d+g|0,(h&2|0)==0?2:e,f);return}function lB(a){a=a|0;return ((mB(a)|0)^1)&1|0}function mB(b){b=b|0;return (a[b>>0]|0)!=0|0}function nB(a){a=a|0;c[a>>2]=0;oB(a);return}function oB(a){a=a|0;c[a>>2]=c[a>>2]|1;return}function pB(a){a=a|0;c[a>>2]=0;return}function qB(){return 0}function rB(a){a=a|0;var b=0;b=(a|0)==0?1:a;while(1){a=DO(b)|0;if(a|0)break;a=qB()|0;if(!a){a=0;break}Pb[a&1]()}return a|0}function sB(a){a=a|0;return rB(a)|0}function tB(a){a=a|0;QA(a);return}function uB(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=yb;yb=yb+16|0;e=f;c[e>>2]=c[d>>2];a=Hb[c[(c[a>>2]|0)+16>>2]&63](a,b,e)|0;if(a)c[d>>2]=c[e>>2];yb=f;return a&1|0}function vB(a){a=a|0;if(!a)a=0;else a=(LA(a,13904,13992,0)|0)!=0&1;return a|0}function wB(){return 0}function xB(){N(55684);return}function yB(){return 55668}function zB(){return 55676}function AB(){return 55680}function BB(){return 55684}function CB(){DB();return}function DB(){EB(57670);return}function EB(a){a=a|0;var b=0;b=yb;yb=yb+16|0;c[b>>2]=a;FB();yb=b;return}function FB(){pa(GB()|0,47294);ga(HB()|0,47299,1,1,0);IB(47304);JB(47309);KB(47321);LB(47335);MB(47341);NB(47356);OB(47360);PB(47373);QB(47378);RB(47392);SB(47398);na(TB()|0,47405);na(UB()|0,47417);oa(VB()|0,4,47450);ia(WB()|0,47463);XB(47479);YB(47509);ZB(47546);_B(47585);$B(47616);aC(47656);bC(47685);cC(47723);dC(47753);YB(47792);ZB(47824);_B(47857);$B(47890);aC(47924);bC(47957);eC(47991);fC(48022);gC(48054);return}function GB(){return qD()|0}function HB(){return pD()|0}function IB(a){a=a|0;var b=0,d=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;a=nD()|0;la(a|0,c[d>>2]|0,1,-128<<24>>24|0,127<<24>>24|0);yb=b;return}function JB(a){a=a|0;var b=0,d=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;a=lD()|0;la(a|0,c[d>>2]|0,1,-128<<24>>24|0,127<<24>>24|0);yb=b;return}function KB(a){a=a|0;var b=0,d=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;a=jD()|0;la(a|0,c[d>>2]|0,1,0,255);yb=b;return}function LB(a){a=a|0;var b=0,d=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;a=hD()|0;la(a|0,c[d>>2]|0,2,-32768<<16>>16|0,32767<<16>>16|0);yb=b;return}function MB(a){a=a|0;var b=0,d=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;a=fD()|0;la(a|0,c[d>>2]|0,2,0,65535);yb=b;return}function NB(a){a=a|0;var b=0,d=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;a=dD()|0;la(a|0,c[d>>2]|0,4,-2147483648,2147483647);yb=b;return}function OB(a){a=a|0;var b=0,d=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;a=bD()|0;la(a|0,c[d>>2]|0,4,0,-1);yb=b;return}function PB(a){a=a|0;var b=0,d=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;a=$C()|0;la(a|0,c[d>>2]|0,4,-2147483648,2147483647);yb=b;return}function QB(a){a=a|0;var b=0,d=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;a=ZC()|0;la(a|0,c[d>>2]|0,4,0,-1);yb=b;return}function RB(a){a=a|0;var b=0,d=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;a=XC()|0;ja(a|0,c[d>>2]|0,4);yb=b;return}function SB(a){a=a|0;var b=0,d=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;a=VC()|0;ja(a|0,c[d>>2]|0,8);yb=b;return}function TB(){return UC()|0}function UB(){return TC()|0}function VB(){return SC()|0}function WB(){return RC()|0}function XB(a){a=a|0;var b=0,d=0,e=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;e=OC()|0;a=PC()|0;ma(e|0,a|0,c[d>>2]|0);yb=b;return}function YB(a){a=a|0;var b=0,d=0,e=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;e=LC()|0;a=MC()|0;ma(e|0,a|0,c[d>>2]|0);yb=b;return}function ZB(a){a=a|0;var b=0,d=0,e=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;e=IC()|0;a=JC()|0;ma(e|0,a|0,c[d>>2]|0);yb=b;return}function _B(a){a=a|0;var b=0,d=0,e=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;e=FC()|0;a=GC()|0;ma(e|0,a|0,c[d>>2]|0);yb=b;return}function $B(a){a=a|0;var b=0,d=0,e=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;e=CC()|0;a=DC()|0;ma(e|0,a|0,c[d>>2]|0);yb=b;return}function aC(a){a=a|0;var b=0,d=0,e=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;e=zC()|0;a=AC()|0;ma(e|0,a|0,c[d>>2]|0);yb=b;return}function bC(a){a=a|0;var b=0,d=0,e=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;e=wC()|0;a=xC()|0;ma(e|0,a|0,c[d>>2]|0);yb=b;return}function cC(a){a=a|0;var b=0,d=0,e=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;e=tC()|0;a=uC()|0;ma(e|0,a|0,c[d>>2]|0);yb=b;return}function dC(a){a=a|0;var b=0,d=0,e=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;e=qC()|0;a=rC()|0;ma(e|0,a|0,c[d>>2]|0);yb=b;return}function eC(a){a=a|0;var b=0,d=0,e=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;e=nC()|0;a=oC()|0;ma(e|0,a|0,c[d>>2]|0);yb=b;return}function fC(a){a=a|0;var b=0,d=0,e=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;e=kC()|0;a=lC()|0;ma(e|0,a|0,c[d>>2]|0);yb=b;return}function gC(a){a=a|0;var b=0,d=0,e=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=a;e=hC()|0;a=iC()|0;ma(e|0,a|0,c[d>>2]|0);yb=b;return}function hC(){return jC()|0}function iC(){return 7}function jC(){return 14144}function kC(){return mC()|0}function lC(){return 7}function mC(){return 14152}function nC(){return pC()|0}function oC(){return 6}function pC(){return 14160}function qC(){return sC()|0}function rC(){return 5}function sC(){return 14168}function tC(){return vC()|0}function uC(){return 4}function vC(){return 14176}function wC(){return yC()|0}function xC(){return 5}function yC(){return 14184}function zC(){return BC()|0}function AC(){return 4}function BC(){return 14192}function CC(){return EC()|0}function DC(){return 3}function EC(){return 14200}function FC(){return HC()|0}function GC(){return 2}function HC(){return 14208}function IC(){return KC()|0}function JC(){return 1}function KC(){return 14216}function LC(){return NC()|0}function MC(){return 0}function NC(){return 14224}function OC(){return QC()|0}function PC(){return 0}function QC(){return 14232}function RC(){return 14240}function SC(){return 14248}function TC(){return 14272}function UC(){return 13272}function VC(){return WC()|0}function WC(){return 14120}function XC(){return YC()|0}function YC(){return 14112}function ZC(){return _C()|0}function _C(){return 14104}function $C(){return aD()|0}function aD(){return 14096}function bD(){return cD()|0}function cD(){return 14088}function dD(){return eD()|0}function eD(){return 14080}function fD(){return gD()|0}function gD(){return 14072}function hD(){return iD()|0}function iD(){return 14064}function jD(){return kD()|0}function kD(){return 14048}function lD(){return mD()|0}function mD(){return 14056}function nD(){return oD()|0}function oD(){return 14040}function pD(){return 14032}function qD(){return 14024}function rD(a){a=a|0;var b=0,d=0,e=0;b=yb;yb=yb+16|0;d=b+4|0;e=b;c[e>>2]=a;c[d>>2]=c[e>>2];a=hz(c[(c[d>>2]|0)+4>>2]|0)|0;yb=b;return a|0}function sD(a){a=a|0;return 0}function tD(a){a=a|0;return 0}function uD(a,b){a=a|0;b=b|0;return 0}function vD(a){a=a|0;return 0}function wD(){return (xD()|0)>0|0}function xD(){return wB()|0}function yD(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;k=yb;yb=yb+16|0;d=k;i=k+8|0;e=k+4|0;c[i>>2]=a;do if(a>>>0>=212){h=(a>>>0)/210|0;b=h*210|0;c[e>>2]=a-b;a=0;g=(zD(12736,12928,e,d)|0)-12736>>2;a:while(1){f=(c[12736+(g<<2)>>2]|0)+b|0;b=5;while(1){if(b>>>0>=47){j=6;break}d=c[12544+(b<<2)>>2]|0;e=(f>>>0)/(d>>>0)|0;if(e>>>0>>0){j=107;break a}if((f|0)==(B(e,d)|0))break;else b=b+1|0}b:do if((j|0)==6){j=0;e=211;c:while(1){b=(f>>>0)/(e>>>0)|0;do if(b>>>0>=e>>>0)if((f|0)!=(B(b,e)|0)){b=e+10|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>=b>>>0)if((f|0)!=(B(d,b)|0)){b=e+12|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>=b>>>0)if((f|0)!=(B(d,b)|0)){b=e+16|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>=b>>>0)if((f|0)!=(B(d,b)|0)){b=e+18|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>=b>>>0)if((f|0)!=(B(d,b)|0)){b=e+22|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>=b>>>0)if((f|0)!=(B(d,b)|0)){b=e+28|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>=b>>>0)if((f|0)==(B(d,b)|0))d=9;else{b=e+30|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+36|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+40|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+42|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+46|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+52|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+58|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+60|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+66|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+70|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+72|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+78|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+82|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+88|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+96|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+100|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+102|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+106|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+108|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+112|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+120|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+126|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+130|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+136|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+138|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+142|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+148|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+150|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+156|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+162|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+166|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+168|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+172|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+178|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+180|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+186|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+190|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+192|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+196|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+198|0;d=(f>>>0)/(b>>>0)|0;if(d>>>0>>0){d=1;a=f;break}if((f|0)==(B(d,b)|0)){d=9;break}b=e+208|0;d=(f>>>0)/(b>>>0)|0;l=d>>>0>>0;d=(f|0)==(B(d,b)|0);b=l|d?b:e+210|0;d=l?1:d?9:0;a=l?f:a}else{d=1;a=f}}else d=9;else{d=1;a=f}}else d=9;else{d=1;a=f}}else d=9;else{d=1;a=f}}else d=9;else{d=1;a=f}}else d=9;else{d=1;a=f}}else{b=e;d=9}else{b=e;d=1;a=f}while(0);switch(d&15){case 9:break b;case 0:{e=b;break}default:break c}}if(d){j=108;break a}}while(0);l=g+1|0;f=(l|0)==48;b=h+(f&1)|0;h=b;b=b*210|0;g=f?0:l}if((j|0)==107){c[i>>2]=f;a=f;break}else if((j|0)==108){c[i>>2]=f;break}}else a=c[(zD(12544,12736,i,d)|0)>>2]|0;while(0);yb=k;return a|0}function zD(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=c[d>>2]|0;e=a;d=b-a>>2;while(1){if(!d)break;b=d>>>1;g=e+(b<<2)|0;a=(c[g>>2]|0)>>>0>>0;e=a?g+4|0:e;d=a?d+-1-b|0:b}return e|0}function AD(a){a=a|0;BD(a);return}function BD(a){a=a|0;c[a>>2]=16480;CD(a,0);WF(a+28|0);EO(c[a+32>>2]|0);EO(c[a+36>>2]|0);EO(c[a+48>>2]|0);EO(c[a+60>>2]|0);return}function CD(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=a+32|0;f=a+36|0;d=c[a+40>>2]|0;while(1){if(!d)break;g=d+-1|0;Ub[c[(c[e>>2]|0)+(g<<2)>>2]&3](b,a,c[(c[f>>2]|0)+(g<<2)>>2]|0);d=g}return}function DD(a){a=a|0;BD(a);QA(a);return}function ED(a){a=a|0;BD(a);return}function FD(a){a=a|0;c[a>>2]=16496;WF(a+4|0);return}function GD(a){a=a|0;FD(a);QA(a);return}function HD(a,b){a=a|0;b=b|0;return}function ID(a,b,c){a=a|0;b=b|0;c=c|0;return a|0}function JD(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;return}function KD(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;return}function LD(a){a=a|0;return 0}function MD(a){a=a|0;return 0}function ND(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;Uf()|0;i=b+12|0;j=b+16|0;h=0;while(1){if((h|0)>=(e|0))break;f=c[i>>2]|0;g=c[j>>2]|0;if(f>>>0>>0){g=g-f|0;k=e-h|0;g=(k|0)<(g|0)?k:g;TD(d,f,g)|0;c[i>>2]=(c[i>>2]|0)+g;d=d+g|0;f=g}else{f=Eb[c[(c[b>>2]|0)+40>>2]&127](b)|0;if((f|0)==-1)break;a[d>>0]=cg(f)|0;d=d+1|0;f=1}h=f+h|0}return h|0}function OD(a){a=a|0;return Uf()|0}function PD(b){b=b|0;var d=0;d=Eb[c[(c[b>>2]|0)+36>>2]&127](b)|0;if((d|0)==(Uf()|0))b=Uf()|0;else{d=b+12|0;b=c[d>>2]|0;c[d>>2]=b+1;b=ag(a[b>>0]|0)|0}return b|0}function QD(a,b){a=a|0;b=b|0;return Uf()|0}function RD(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0;i=Uf()|0;j=b+24|0;k=b+28|0;f=0;while(1){if((f|0)>=(e|0))break;g=c[j>>2]|0;h=c[k>>2]|0;if(g>>>0>>0){h=h-g|0;l=e-f|0;h=(l|0)<(h|0)?l:h;TD(g,d,h)|0;c[j>>2]=(c[j>>2]|0)+h;d=d+h|0;f=h+f|0}else{h=c[(c[b>>2]|0)+52>>2]|0;l=ag(a[d>>0]|0)|0;if((Gb[h&63](b,l)|0)==(i|0))break;d=d+1|0;f=f+1|0}}return f|0}function SD(a,b){a=a|0;b=b|0;return Uf()|0}function TD(a,b,c){a=a|0;b=b|0;c=c|0;if(c|0)YO(a|0,b|0,c|0)|0;return a|0}function UD(a){a=a|0;c[a>>2]=16560;WF(a+4|0);return}function VD(a){a=a|0;UD(a);QA(a);return}function WD(a,b){a=a|0;b=b|0;return}function XD(a,b,c){a=a|0;b=b|0;c=c|0;return a|0}function YD(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;return}function ZD(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;return}function _D(a){a=a|0;return 0}function $D(a){a=a|0;return 0}function aE(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;gE()|0;h=a+12|0;i=a+16|0;g=0;while(1){if((g|0)>=(d|0))break;e=c[h>>2]|0;f=c[i>>2]|0;if(e>>>0>>0){f=f-e>>2;j=d-g|0;f=(j|0)<(f|0)?j:f;iE(b,e,f)|0;c[h>>2]=(c[h>>2]|0)+(f<<2);b=b+(f<<2)|0;e=f}else{e=Eb[c[(c[a>>2]|0)+40>>2]&127](a)|0;if((e|0)==-1)break;c[b>>2]=jE(e)|0;b=b+4|0;e=1}g=e+g|0}return g|0}function bE(a){a=a|0;return gE()|0}function cE(a){a=a|0;var b=0;b=Eb[c[(c[a>>2]|0)+36>>2]&127](a)|0;if((b|0)==(gE()|0))a=gE()|0;else{b=a+12|0;a=c[b>>2]|0;c[b>>2]=a+4;a=hE(c[a>>2]|0)|0}return a|0}function dE(a,b){a=a|0;b=b|0;return gE()|0}function eE(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=gE()|0;i=a+24|0;j=a+28|0;e=0;while(1){if((e|0)>=(d|0))break;f=c[i>>2]|0;g=c[j>>2]|0;if(f>>>0>>0){g=g-f>>2;k=d-e|0;g=(k|0)<(g|0)?k:g;iE(f,b,g)|0;c[i>>2]=(c[i>>2]|0)+(g<<2);b=b+(g<<2)|0;e=g+e|0}else{g=c[(c[a>>2]|0)+52>>2]|0;k=hE(c[b>>2]|0)|0;if((Gb[g&63](a,k)|0)==(h|0))break;b=b+4|0;e=e+1|0}}return e|0}function fE(a,b){a=a|0;b=b|0;return gE()|0}function gE(){return -1}function hE(a){a=a|0;return a|0}function iE(a,b,c){a=a|0;b=b|0;c=c|0;if(c)ez(a,b,c)|0;return a|0}function jE(a){a=a|0;return a|0}function kE(a){a=a|0;oE(a,16656);AD(a+8|0);return}function lE(a){a=a|0;kE(a);QA(a);return}function mE(a){a=a|0;kE(a+(c[(c[a>>2]|0)+-12>>2]|0)|0);return}function nE(a){a=a|0;lE(a+(c[(c[a>>2]|0)+-12>>2]|0)|0);return}function oE(a,b){a=a|0;b=b|0;return}function pE(a){a=a|0;tE(a,16704);ED(a+8|0);return}function qE(a){a=a|0;pE(a);QA(a);return}function rE(a){a=a|0;pE(a+(c[(c[a>>2]|0)+-12>>2]|0)|0);return}function sE(a){a=a|0;qE(a+(c[(c[a>>2]|0)+-12>>2]|0)|0);return}function tE(a,b){a=a|0;b=b|0;return}function uE(a){a=a|0;yE(a,16752);AD(a+4|0);return}function vE(a){a=a|0;uE(a);QA(a);return}function wE(a){a=a|0;uE(a+(c[(c[a>>2]|0)+-12>>2]|0)|0);return}function xE(a){a=a|0;vE(a+(c[(c[a>>2]|0)+-12>>2]|0)|0);return}function yE(a,b){a=a|0;b=b|0;return}function zE(a){a=a|0;DE(a,16800);ED(a+4|0);return}function AE(a){a=a|0;zE(a);QA(a);return}function BE(a){a=a|0;zE(a+(c[(c[a>>2]|0)+-12>>2]|0)|0);return}function CE(a){a=a|0;AE(a+(c[(c[a>>2]|0)+-12>>2]|0)|0);return}function DE(a,b){a=a|0;b=b|0;return}function EE(a,b){a=a|0;b=b|0;c[a+16>>2]=(c[a+24>>2]|0)==0|b;return}function FE(a,b){a=a|0;b=b|0;var d=0;c[a+24>>2]=b;c[a+16>>2]=(b|0)==0&1;c[a+20>>2]=0;c[a+4>>2]=4098;c[a+12>>2]=0;c[a+8>>2]=6;d=a+28|0;b=a+32|0;a=b+40|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(a|0));WN(d);return}function GE(a,b){a=a|0;b=b|0;UN(a,b+28|0);return}function HE(a,b){a=a|0;b=b|0;return (a|0)==(b|0)|0}function IE(a){a=a|0;c[a>>2]=16496;WN(a+4|0);a=a+8|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;c[a+16>>2]=0;c[a+20>>2]=0;return}function JE(a){a=a|0;c[a>>2]=16560;WN(a+4|0);a=a+8|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;c[a+16>>2]=0;c[a+20>>2]=0;return}function KE(b){b=b|0;var d=0,e=0,f=0;e=yb;yb=yb+16|0;d=e;if(c[b+(c[(c[b>>2]|0)+-12>>2]|0)+24>>2]|0){LE(d,b);if(a[d>>0]|0?(f=c[b+(c[(c[b>>2]|0)+-12>>2]|0)+24>>2]|0,(Eb[c[(c[f>>2]|0)+24>>2]&127](f)|0)==-1):0){f=b+(c[(c[b>>2]|0)+-12>>2]|0)|0;EE(f,c[f+16>>2]|1)}ME(d)}yb=e;return b|0}function LE(b,d){b=b|0;d=d|0;a[b>>0]=0;c[b+4>>2]=d;d=d+(c[(c[d>>2]|0)+-12>>2]|0)|0;if(!(c[d+16>>2]|0)){d=c[d+72>>2]|0;if(d|0)KE(d)|0;a[b>>0]=1}return}function ME(a){a=a|0;var b=0;a=a+4|0;b=c[a>>2]|0;b=b+(c[(c[b>>2]|0)+-12>>2]|0)|0;if((((c[b+24>>2]|0?(c[b+16>>2]|0)==0:0)?c[b+4>>2]&8192|0:0)?!(wD()|0):0)?(b=c[a>>2]|0,b=c[b+(c[(c[b>>2]|0)+-12>>2]|0)+24>>2]|0,(Eb[c[(c[b>>2]|0)+24>>2]&127](b)|0)==-1):0){b=c[a>>2]|0;b=b+(c[(c[b>>2]|0)+-12>>2]|0)|0;EE(b,c[b+16>>2]|1)}return}function NE(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;l=yb;yb=yb+16|0;f=l+12|0;j=l+8|0;k=l;LE(k,b);if(a[k>>0]|0){GE(f,b+(c[(c[b>>2]|0)+-12>>2]|0)|0);g=VF(f,56792)|0;WF(f);h=b+(c[(c[b>>2]|0)+-12>>2]|0)|0;i=c[h+24>>2]|0;m=Uf()|0;e=h+76|0;if(Yf(m,c[e>>2]|0)|0){GE(f,h);m=VF(f,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,32)|0;WF(f);m=m<<24>>24;c[e>>2]=m;e=m}else e=c[e>>2]|0;m=c[(c[g>>2]|0)+16>>2]|0;c[j>>2]=i;c[f>>2]=c[j>>2];if(!(Kb[m&31](g,f,h,e&255,d)|0)){m=b+(c[(c[b>>2]|0)+-12>>2]|0)|0;EE(m,c[m+16>>2]|5)}}ME(k);yb=l;return b|0}function OE(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=yb;yb=yb+16|0;i=j;LE(i,b);do if(a[i>>0]|0){e=c[b+(c[(c[b>>2]|0)+-12>>2]|0)+24>>2]|0;f=e;if(e|0){g=f+24|0;h=c[g>>2]|0;if((h|0)==(c[f+28>>2]|0)){h=c[(c[e>>2]|0)+52>>2]|0;d=ag(d)|0;d=Gb[h&63](f,d)|0}else{c[g>>2]=h+1;a[h>>0]=d;d=ag(d)|0}if(!(Yf(d,Uf()|0)|0))break}h=b+(c[(c[b>>2]|0)+-12>>2]|0)|0;EE(h,c[h+16>>2]|1)}while(0);ME(i);yb=j;return b|0}function PE(a){a=a|0;a=a+16|0;c[a>>2]=c[a>>2]|1;return}function QE(){SE();return}function RE(){return}function SE(){TE(0);return}function TE(a){a=a|0;var b=0,d=0;b=c[4002]|0;UE(56368,b,56424);c[13922]=16628;c[13924]=16648;c[13923]=0;FE(55696,56368);c[13942]=0;c[13943]=Uf()|0;VE(56432,b,56488);c[13944]=16676;c[13946]=16696;c[13945]=0;FE(55784,56432);c[13964]=0;c[13965]=gE()|0;b=c[4003]|0;WE(56496,b,56544);c[13966]=16724;c[13967]=16744;FE(55868,56496);c[13985]=0;c[13986]=Uf()|0;XE(56552,b,56600);c[13987]=16772;c[13988]=16792;FE(55952,56552);c[14006]=0;c[14007]=gE()|0;b=c[4001]|0;WE(56608,b,56656);c[14008]=16724;c[14009]=16744;FE(56036,56608);c[14027]=0;c[14028]=Uf()|0;a=c[56032+(c[(c[14008]|0)+-12>>2]|0)+24>>2]|0;c[14050]=16724;c[14051]=16744;FE(56204,a);c[14069]=0;c[14070]=Uf()|0;XE(56664,b,56712);c[14029]=16772;c[14030]=16792;FE(56120,56664);c[14048]=0;c[14049]=gE()|0;b=c[56116+(c[(c[14029]|0)+-12>>2]|0)+24>>2]|0;c[14071]=16772;c[14072]=16792;FE(56288,b);c[14090]=0;c[14091]=gE()|0;c[55688+(c[(c[13922]|0)+-12>>2]|0)+72>>2]=55864;c[55776+(c[(c[13944]|0)+-12>>2]|0)+72>>2]=55948;b=(c[14008]|0)+-12|0;a=56032+(c[b>>2]|0)+4|0;c[a>>2]=c[a>>2]|8192;a=(c[14029]|0)+-12|0;d=56116+(c[a>>2]|0)+4|0;c[d>>2]=c[d>>2]|8192;c[56032+(c[b>>2]|0)+72>>2]=55864;c[56116+(c[a>>2]|0)+72>>2]=55948;return}function UE(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=yb;yb=yb+16|0;g=f;IE(b);c[b>>2]=17008;c[b+32>>2]=d;c[b+40>>2]=e;c[b+48>>2]=Uf()|0;a[b+52>>0]=0;e=c[(c[b>>2]|0)+8>>2]|0;UN(g,b+4|0);Sb[e&63](b,g);WF(g);yb=f;return}function VE(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=yb;yb=yb+16|0;g=f;JE(b);c[b>>2]=16944;c[b+32>>2]=d;c[b+40>>2]=e;c[b+48>>2]=gE()|0;a[b+52>>0]=0;e=c[(c[b>>2]|0)+8>>2]|0;UN(g,b+4|0);Sb[e&63](b,g);WF(g);yb=f;return}function WE(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=yb;yb=yb+16|0;g=f;IE(b);c[b>>2]=16880;c[b+32>>2]=d;UN(g,b+4|0);d=VF(g,57040)|0;WF(g);c[b+36>>2]=d;c[b+40>>2]=e;a[b+44>>0]=(Eb[c[(c[d>>2]|0)+28>>2]&127](d)|0)&1;yb=f;return}function XE(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=yb;yb=yb+16|0;g=f;JE(b);c[b>>2]=16816;c[b+32>>2]=d;UN(g,b+4|0);d=VF(g,57048)|0;WF(g);c[b+36>>2]=d;c[b+40>>2]=e;a[b+44>>0]=(Eb[c[(c[d>>2]|0)+28>>2]&127](d)|0)&1;yb=f;return}function YE(a){a=a|0;UD(a);QA(a);return}function ZE(b,d){b=b|0;d=d|0;Eb[c[(c[b>>2]|0)+24>>2]&127](b)|0;d=VF(d,57048)|0;c[b+36>>2]=d;a[b+44>>0]=(Eb[c[(c[d>>2]|0)+28>>2]&127](d)|0)&1;return}function _E(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;k=yb;yb=yb+16|0;d=k+8|0;e=k;f=a+36|0;g=a+40|0;h=d+8|0;i=d;b=a+32|0;a:while(1){a=c[f>>2]|0;a=Kb[c[(c[a>>2]|0)+20>>2]&31](a,c[g>>2]|0,d,h,e)|0;l=(c[e>>2]|0)-i|0;if((jz(d,1,l,c[b>>2]|0)|0)!=(l|0)){a=-1;break}switch(a|0){case 1:break;case 2:{a=-1;break a}default:{j=4;break a}}}if((j|0)==4)a=((wz(c[b>>2]|0)|0)!=0)<<31>>31;yb=k;return a|0}function $E(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;a:do if(!(a[b+44>>0]|0)){f=0;while(1){if((f|0)>=(e|0))break a;h=c[(c[b>>2]|0)+52>>2]|0;g=hE(c[d>>2]|0)|0;g=Gb[h&63](b,g)|0;if((g|0)==(gE()|0))break a;f=f+1|0;d=d+4|0}}else f=jz(d,4,e,c[b+32>>2]|0)|0;while(0);return f|0}function aF(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=yb;yb=yb+32|0;l=o+16|0;f=o+8|0;m=o+4|0;n=o;do if(!(HE(d,gE()|0)|0)){c[f>>2]=jE(d)|0;if(a[b+44>>0]|0){if((jz(f,4,1,c[b+32>>2]|0)|0)==1){e=15;break}b=gE()|0;break}c[m>>2]=l;e=f+4|0;g=b+36|0;h=b+40|0;i=l+8|0;j=l;k=b+32|0;while(1){b=c[g>>2]|0;b=Ob[c[(c[b>>2]|0)+12>>2]&15](b,c[h>>2]|0,f,e,n,l,i,m)|0;if((c[n>>2]|0)==(f|0)){e=14;break}if((b|0)==3){e=8;break}if(b>>>0>=2){e=14;break}f=(c[m>>2]|0)-j|0;if((jz(l,1,f,c[k>>2]|0)|0)!=(f|0)){e=14;break}if((b|0)==1)f=c[n>>2]|0;else{e=13;break}}if((e|0)==8)if((jz(f,1,1,c[k>>2]|0)|0)==1)e=13;else e=14;if((e|0)==13){e=15;break}else if((e|0)==14){b=gE()|0;break}}else e=15;while(0);if((e|0)==15)b=bF(d)|0;yb=o;return b|0}function bF(a){a=a|0;if(HE(a,gE()|0)|0)a=~(gE()|0);return a|0}function cF(a){a=a|0;FD(a);QA(a);return}function dF(b,d){b=b|0;d=d|0;Eb[c[(c[b>>2]|0)+24>>2]&127](b)|0;d=VF(d,57040)|0;c[b+36>>2]=d;a[b+44>>0]=(Eb[c[(c[d>>2]|0)+28>>2]&127](d)|0)&1;return}function eF(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;k=yb;yb=yb+16|0;d=k+8|0;e=k;f=a+36|0;g=a+40|0;h=d+8|0;i=d;b=a+32|0;a:while(1){a=c[f>>2]|0;a=Kb[c[(c[a>>2]|0)+20>>2]&31](a,c[g>>2]|0,d,h,e)|0;l=(c[e>>2]|0)-i|0;if((jz(d,1,l,c[b>>2]|0)|0)!=(l|0)){a=-1;break}switch(a|0){case 1:break;case 2:{a=-1;break a}default:{j=4;break a}}}if((j|0)==4)a=((wz(c[b>>2]|0)|0)!=0)<<31>>31;yb=k;return a|0}function fF(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;a:do if(!(a[b+44>>0]|0)){f=0;while(1){if((f|0)>=(e|0))break a;h=c[(c[b>>2]|0)+52>>2]|0;g=ag(a[d>>0]|0)|0;g=Gb[h&63](b,g)|0;if((g|0)==(Uf()|0))break a;f=f+1|0;d=d+1|0}}else f=jz(d,1,e,c[b+32>>2]|0)|0;while(0);return f|0}function gF(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=yb;yb=yb+32|0;l=o+16|0;f=o+8|0;m=o+4|0;n=o;do if(!(Yf(d,Uf()|0)|0)){a[f>>0]=cg(d)|0;if(a[b+44>>0]|0){if((jz(f,1,1,c[b+32>>2]|0)|0)==1){e=15;break}b=Uf()|0;break}c[m>>2]=l;e=f+1|0;g=b+36|0;h=b+40|0;i=l+8|0;j=l;k=b+32|0;while(1){b=c[g>>2]|0;b=Ob[c[(c[b>>2]|0)+12>>2]&15](b,c[h>>2]|0,f,e,n,l,i,m)|0;if((c[n>>2]|0)==(f|0)){e=14;break}if((b|0)==3){e=8;break}if(b>>>0>=2){e=14;break}f=(c[m>>2]|0)-j|0;if((jz(l,1,f,c[k>>2]|0)|0)!=(f|0)){e=14;break}if((b|0)==1)f=c[n>>2]|0;else{e=13;break}}if((e|0)==8)if((jz(f,1,1,c[k>>2]|0)|0)==1)e=13;else e=14;if((e|0)==13){e=15;break}else if((e|0)==14){b=Uf()|0;break}}else e=15;while(0);if((e|0)==15)b=bg(d)|0;yb=o;return b|0}function hF(a){a=a|0;UD(a);QA(a);return}function iF(b,d){b=b|0;d=d|0;var e=0,f=0;f=VF(d,57048)|0;e=b+36|0;c[e>>2]=f;d=b+44|0;c[d>>2]=Eb[c[(c[f>>2]|0)+24>>2]&127](f)|0;e=c[e>>2]|0;a[b+53>>0]=(Eb[c[(c[e>>2]|0)+28>>2]&127](e)|0)&1;if((c[d>>2]|0)>8)lJ(49046);else return}function jF(a){a=a|0;return mF(a,0)|0}function kF(a){a=a|0;return mF(a,1)|0}function lF(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;l=yb;yb=yb+32|0;h=l+16|0;i=l+8|0;f=l+4|0;g=l;j=HE(d,gE()|0)|0;k=b+52|0;e=(a[k>>0]|0)!=0;do if(j)if(e)e=d;else{e=c[b+48>>2]|0;a[k>>0]=((HE(e,gE()|0)|0)^1)&1}else{if(e){j=b+48|0;c[f>>2]=jE(c[j>>2]|0)|0;e=c[b+36>>2]|0;switch(Ob[c[(c[e>>2]|0)+12>>2]&15](e,c[b+40>>2]|0,f,f+4|0,g,h,h+8|0,i)|0){case 1:case 2:{g=11;break}case 3:{a[h>>0]=c[j>>2];c[i>>2]=h+1;g=8;break}default:g=8}a:do if((g|0)==8){e=b+32|0;while(1){f=c[i>>2]|0;if(f>>>0<=h>>>0){f=1;e=0;break a}b=f+-1|0;c[i>>2]=b;if((aA(a[b>>0]|0,c[e>>2]|0)|0)==-1){g=11;break}}}while(0);if((g|0)==11){f=0;e=gE()|0}if(f)e=j;else break}else e=b+48|0;c[e>>2]=d;a[k>>0]=1;e=d}while(0);yb=l;return e|0}function mF(b,d){b=b|0;d=d|0;var 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;r=yb;yb=yb+32|0;p=r+16|0;q=r+8|0;l=r+4|0;m=r;g=b+52|0;if(a[g>>0]|0){f=b+48|0;e=c[f>>2]|0;if(d){c[f>>2]=gE()|0;a[g>>0]=0}}else{e=c[b+44>>2]|0;e=(e|0)>1?e:1;o=b+32|0;f=0;while(1){if(f>>>0>=e>>>0){n=9;break}g=Xz(c[o>>2]|0)|0;if((g|0)==-1){n=8;break}a[p+f>>0]=g;f=f+1|0}if((n|0)==8)e=gE()|0;else if((n|0)==9){do if(!(a[b+53>>0]|0)){i=b+40|0;j=b+36|0;k=q+4|0;a:while(1){s=c[i>>2]|0;g=s;f=c[g>>2]|0;g=c[g+4>>2]|0;t=c[j>>2]|0;h=p+e|0;switch(Ob[c[(c[t>>2]|0)+16>>2]&15](t,s,p,h,l,q,k,m)|0){case 3:{n=15;break a}case 2:{n=17;break a}case 1:break;default:break a}t=c[i>>2]|0;c[t>>2]=f;c[t+4>>2]=g;if((e|0)==8){n=17;break}f=Xz(c[o>>2]|0)|0;if((f|0)==-1){n=17;break}a[h>>0]=f;e=e+1|0}if((n|0)==15)c[q>>2]=a[p>>0];else if((n|0)==17){e=gE()|0;break}n=19}else{c[q>>2]=a[p>>0];n=19}while(0);b:do if((n|0)==19){c:do if(d)c[b+48>>2]=hE(c[q>>2]|0)|0;else{do{if((e|0)<=0)break c;e=e+-1|0;t=hE(a[p+e>>0]|0)|0}while((aA(t,c[o>>2]|0)|0)!=-1);e=gE()|0;break b}while(0);e=hE(c[q>>2]|0)|0}while(0)}}yb=r;return e|0}function nF(a){a=a|0;FD(a);QA(a);return}function oF(b,d){b=b|0;d=d|0;var e=0,f=0;f=VF(d,57040)|0;e=b+36|0;c[e>>2]=f;d=b+44|0;c[d>>2]=Eb[c[(c[f>>2]|0)+24>>2]&127](f)|0;e=c[e>>2]|0;a[b+53>>0]=(Eb[c[(c[e>>2]|0)+28>>2]&127](e)|0)&1;if((c[d>>2]|0)>8)lJ(49046);else return}function pF(a){a=a|0;return sF(a,0)|0}function qF(a){a=a|0;return sF(a,1)|0}function rF(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;l=yb;yb=yb+32|0;h=l+16|0;i=l+4|0;f=l+8|0;g=l;j=Yf(d,Uf()|0)|0;k=b+52|0;e=(a[k>>0]|0)!=0;do if(j)if(e)e=d;else{e=c[b+48>>2]|0;a[k>>0]=((Yf(e,Uf()|0)|0)^1)&1}else{if(e){j=b+48|0;a[f>>0]=cg(c[j>>2]|0)|0;e=c[b+36>>2]|0;switch(Ob[c[(c[e>>2]|0)+12>>2]&15](e,c[b+40>>2]|0,f,f+1|0,g,h,h+8|0,i)|0){case 1:case 2:{g=11;break}case 3:{a[h>>0]=c[j>>2];c[i>>2]=h+1;g=8;break}default:g=8}a:do if((g|0)==8){e=b+32|0;while(1){f=c[i>>2]|0;if(f>>>0<=h>>>0){f=1;e=0;break a}b=f+-1|0;c[i>>2]=b;if((aA(a[b>>0]|0,c[e>>2]|0)|0)==-1){g=11;break}}}while(0);if((g|0)==11){f=0;e=Uf()|0}if(f)e=j;else break}else e=b+48|0;c[e>>2]=d;a[k>>0]=1;e=d}while(0);yb=l;return e|0}function sF(b,d){b=b|0;d=d|0;var 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;r=yb;yb=yb+32|0;p=r+16|0;q=r+8|0;l=r+4|0;m=r;g=b+52|0;if(a[g>>0]|0){f=b+48|0;e=c[f>>2]|0;if(d){c[f>>2]=Uf()|0;a[g>>0]=0}}else{e=c[b+44>>2]|0;e=(e|0)>1?e:1;o=b+32|0;f=0;while(1){if(f>>>0>=e>>>0){n=9;break}g=Xz(c[o>>2]|0)|0;if((g|0)==-1){n=8;break}a[p+f>>0]=g;f=f+1|0}if((n|0)==8)e=Uf()|0;else if((n|0)==9){do if(!(a[b+53>>0]|0)){i=b+40|0;j=b+36|0;k=q+1|0;a:while(1){s=c[i>>2]|0;g=s;f=c[g>>2]|0;g=c[g+4>>2]|0;t=c[j>>2]|0;h=p+e|0;switch(Ob[c[(c[t>>2]|0)+16>>2]&15](t,s,p,h,l,q,k,m)|0){case 3:{n=15;break a}case 2:{n=17;break a}case 1:break;default:break a}t=c[i>>2]|0;c[t>>2]=f;c[t+4>>2]=g;if((e|0)==8){n=17;break}f=Xz(c[o>>2]|0)|0;if((f|0)==-1){n=17;break}a[h>>0]=f;e=e+1|0}if((n|0)==15)a[q>>0]=a[p>>0]|0;else if((n|0)==17){e=Uf()|0;break}n=19}else{a[q>>0]=a[p>>0]|0;n=19}while(0);b:do if((n|0)==19){c:do if(d)c[b+48>>2]=ag(a[q>>0]|0)|0;else{do{if((e|0)<=0)break c;e=e+-1|0;t=ag(a[p+e>>0]|0)|0}while((aA(t,c[o>>2]|0)|0)!=-1);e=Uf()|0;break b}while(0);e=ag(a[q>>0]|0)|0}while(0)}}yb=r;return e|0}function tF(a){a=a|0;AF(a);return}function uF(a){a=a|0;tF(a);QA(a);return}function vF(a){a=a|0;if(a|0)Qb[c[(c[a>>2]|0)+4>>2]&255](a);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;b=c;while(1){if((e|0)==(f|0)){h=7;break}if((b|0)==(d|0)){b=-1;break}c=a[b>>0]|0;g=a[e>>0]|0;if(c<<24>>24>24){b=-1;break}if(g<<24>>24>24){b=1;break}e=e+1|0;b=b+1|0}if((h|0)==7)b=(b|0)!=(d|0)&1;return b|0}function xF(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;zF(a,d,e);return}function yF(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0;b=0;while(1){if((c|0)==(d|0))break;e=(b<<4)+(a[c>>0]|0)|0;f=e&-268435456;b=(f>>>24|f)^e;c=c+1|0}return b|0}function zF(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;j=yb;yb=yb+16|0;g=d;i=j;f=e-g|0;if(f>>>0>4294967279)cO(b);if(f>>>0<11){a[b+11>>0]=f;h=b}else{k=f+16&-16;h=rB(k)|0;c[b>>2]=h;c[b+8>>2]=k|-2147483648;c[b+4>>2]=f}f=e-g|0;b=h;while(1){if((d|0)==(e|0))break;$f(b,d);d=d+1|0;b=b+1|0}a[i>>0]=0;$f(h+f|0,i);yb=j;return}function AF(a){a=a|0;return}function BF(a){a=a|0;AF(a);return}function CF(a){a=a|0;BF(a);QA(a);return}function DF(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;a=b;while(1){if((e|0)==(f|0)){h=7;break}if((a|0)==(d|0)){a=-1;break}b=c[a>>2]|0;g=c[e>>2]|0;if((b|0)<(g|0)){a=-1;break}if((g|0)<(b|0)){a=1;break}e=e+4|0;a=a+4|0}if((h|0)==7)a=(a|0)!=(d|0)&1;return a|0}function EF(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;GF(a,d,e);return}function FF(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;a=0;while(1){if((b|0)==(d|0))break;e=(c[b>>2]|0)+(a<<4)|0;f=e&-268435456;a=(f>>>24|f)^e;b=b+4|0}return a|0}function GF(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=yb;yb=yb+16|0;i=j;h=e-d>>2;if(h>>>0>1073741807)cO(b);do if(h>>>0>=2){g=h+4&-4;if(g>>>0>1073741823)ua();else{f=rB(g<<2)|0;c[b>>2]=f;c[b+8>>2]=g|-2147483648;c[b+4>>2]=h;break}}else{a[b+8+3>>0]=h;f=b}while(0);while(1){if((d|0)==(e|0))break;HF(f,d);d=d+4|0;f=f+4|0}c[i>>2]=0;HF(f,i);yb=j;return}function HF(a,b){a=a|0;b=b|0;c[a>>2]=c[b>>2];return}function IF(a){a=a|0;AF(a);return}function JF(a){a=a|0;AF(a);QA(a);return}function KF(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 i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=yb;yb=yb+48|0;i=o+40|0;n=o;j=o+32|0;k=o+36|0;l=o+28|0;m=o+24|0;if(!(c[f+4>>2]&1)){c[j>>2]=-1;m=c[(c[b>>2]|0)+16>>2]|0;c[k>>2]=c[d>>2];c[l>>2]=c[e>>2];c[n>>2]=c[k>>2];c[i>>2]=c[l>>2];c[d>>2]=Mb[m&63](b,n,i,f,g,j)|0;switch(c[j>>2]|0){case 0:{a[h>>0]=0;break}case 1:{a[h>>0]=1;break}default:{a[h>>0]=1;c[g>>2]=4}}i=c[d>>2]|0}else{GE(i,f);l=VF(i,56736)|0;WF(i);GE(i,f);b=VF(i,56752)|0;WF(i);Sb[c[(c[b>>2]|0)+24>>2]&63](n,b);Sb[c[(c[b>>2]|0)+28>>2]&63](n+12|0,b);c[m>>2]=c[e>>2];b=n+24|0;c[i>>2]=c[m>>2];a[h>>0]=(DG(d,i,n,b,l,g,1)|0)==(n|0)&1;i=c[d>>2]|0;do{b=b+-12|0;hO(b)}while((b|0)!=(n|0))}yb=o;return i|0}function LF(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=BG(a,j,i,e,f,g)|0;yb=h;return g|0}function MF(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=zG(a,j,i,e,f,g)|0;yb=h;return g|0}function NF(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=xG(a,j,i,e,f,g)|0;yb=h;return g|0}function OF(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=vG(a,j,i,e,f,g)|0;yb=h;return g|0}function PF(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=tG(a,j,i,e,f,g)|0;yb=h;return g|0}function QF(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=nG(a,j,i,e,f,g)|0;yb=h;return g|0}function RF(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=lG(a,j,i,e,f,g)|0;yb=h;return g|0}function SF(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=jG(a,j,i,e,f,g)|0;yb=h;return g|0}function TF(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=eG(a,j,i,e,f,g)|0;yb=h;return g|0}function UF(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 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;y=yb;yb=yb+240|0;v=y+192|0;t=y+160|0;w=y+220|0;x=y+208|0;u=y+204|0;q=y;r=y+200|0;s=y+196|0;c[w>>2]=0;c[w+4>>2]=0;c[w+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[w+(b<<2)>>2]=0;b=b+1|0}GE(x,f);b=VF(x,56736)|0;Ib[c[(c[b>>2]|0)+32>>2]&15](b,12928,12954,t)|0;WF(x);c[x>>2]=0;c[x+4>>2]=0;c[x+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[x+(b<<2)>>2]=0;b=b+1|0}p=x+11|0;o=x+8|0;if((a[p>>0]|0)<0)b=(c[o>>2]&2147483647)+-1|0;else b=10;mO(x,b,0);b=(a[p>>0]|0)<0?c[x>>2]|0:x;c[u>>2]=b;c[r>>2]=q;c[s>>2]=0;n=x+4|0;j=c[d>>2]|0;i=j;a:while(1){if(j){f=c[j+12>>2]|0;if((f|0)==(c[j+16>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=ag(a[f>>0]|0)|0;if(Yf(f,Uf()|0)|0){c[d>>2]=0;m=0;k=1;j=0}else{m=i;k=0}}else{m=0;k=1;j=0}i=c[e>>2]|0;do if(i){f=c[i+12>>2]|0;if((f|0)==(c[i+16>>2]|0))f=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else f=ag(a[f>>0]|0)|0;if(!(Yf(f,Uf()|0)|0))if(k)break;else break a;else{c[e>>2]=0;z=22;break}}else z=22;while(0);if((z|0)==22){z=0;if(k){i=0;break}else i=0}f=a[p>>0]|0;f=f<<24>>24<0?c[n>>2]|0:f&255;if((c[u>>2]|0)==(b+f|0)){mO(x,f<<1,0);if((a[p>>0]|0)<0)b=(c[o>>2]&2147483647)+-1|0;else b=10;mO(x,b,0);b=(a[p>>0]|0)<0?c[x>>2]|0:x;c[u>>2]=b+f}k=j+12|0;f=c[k>>2]|0;l=j+16|0;if((f|0)==(c[l>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=ag(a[f>>0]|0)|0;if(XF(f&255,16,b,u,s,0,w,q,r,t)|0)break;f=c[k>>2]|0;if((f|0)==(c[l>>2]|0))Eb[c[(c[j>>2]|0)+40>>2]&127](j)|0;else{c[k>>2]=f+1;ag(a[f>>0]|0)|0}i=m}mO(x,(c[u>>2]|0)-b|0,0);t=(a[p>>0]|0)<0?c[x>>2]|0:x;u=YF()|0;c[v>>2]=h;if((ZF(t,u,49194,v)|0)!=1)c[g>>2]=4;if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[m>>2]|0)+36>>2]&127](j)|0;else b=ag(a[b>>0]|0)|0;if(Yf(b,Uf()|0)|0){c[d>>2]=0;f=1}else f=0}else f=1;do if(i){b=c[i+12>>2]|0;if((b|0)==(c[i+16>>2]|0))b=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else b=ag(a[b>>0]|0)|0;if(!(Yf(b,Uf()|0)|0))if(f)break;else{z=52;break}else{c[e>>2]=0;z=50;break}}else z=50;while(0);if((z|0)==50?f:0)z=52;if((z|0)==52)c[g>>2]=c[g>>2]|2;z=c[d>>2]|0;hO(x);hO(w);yb=y;return z|0}function VF(a,b){a=a|0;b=b|0;a=c[a>>2]|0;return $F(a,_F(b)|0)|0}function WF(a){a=a|0;var b=0,d=0;a=c[a>>2]|0;d=a+4|0;b=c[d>>2]|0;c[d>>2]=b+-1;if(!b)Qb[c[(c[a>>2]|0)+8>>2]&255](a);return}function XF(b,d,e,f,g,h,i,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0;o=c[f>>2]|0;p=(o|0)==(e|0);do if(p){m=(a[l+24>>0]|0)==b<<24>>24;if(!m?(a[l+25>>0]|0)!=b<<24>>24:0){n=5;break}c[f>>2]=e+1;a[e>>0]=m?43:45;c[g>>2]=0;m=0}else n=5;while(0);a:do if((n|0)==5){n=a[i+11>>0]|0;if(b<<24>>24==h<<24>>24?((n<<24>>24<0?c[i+4>>2]|0:n&255)|0)!=0:0){m=c[k>>2]|0;if((m-j|0)>=160){m=0;break}f=c[g>>2]|0;c[k>>2]=m+4;c[m>>2]=f;c[g>>2]=0;m=0;break}i=l+26|0;h=0;while(1){m=l+h|0;if((h|0)==26){m=i;break}if((a[m>>0]|0)==b<<24>>24)break;else h=h+1|0}m=m-l|0;if((m|0)>23)m=-1;else{switch(d|0){case 10:case 8:{if((m|0)>=(d|0)){m=-1;break a}break}case 16:{if((m|0)>=22){if(p){m=-1;break a}if((o-e|0)>=3){m=-1;break a}if((a[o+-1>>0]|0)!=48){m=-1;break a}c[g>>2]=0;m=a[12928+m>>0]|0;c[f>>2]=o+1;a[o>>0]=m;m=0;break a}break}default:{}}m=a[12928+m>>0]|0;c[f>>2]=o+1;a[o>>0]=m;c[g>>2]=(c[g>>2]|0)+1;m=0}}while(0);return m|0}function YF(){if((a[54800]|0)==0?lB(54800)|0:0){c[14186]=_y(2147483647,49197,0)|0;nB(54800)}return c[14186]|0}function ZF(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=yb;yb=yb+16|0;g=f;c[g>>2]=e;e=cz(b)|0;b=Bz(a,d,g)|0;if(e|0)cz(e)|0;yb=f;return b|0}function _F(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=yb;yb=yb+48|0;b=f+32|0;d=f+24|0;e=f;g=f+16|0;c[g>>2]=143;c[g+4>>2]=0;c[b>>2]=c[g>>2];c[b+4>>2]=c[g+4>>2];bG(e,b,a);if((c[a>>2]|0)!=-1){c[b>>2]=e;c[d>>2]=b;ZN(a,d,144)}yb=f;return (c[a+4>>2]|0)+-1|0}function $F(a,b){a=a|0;b=b|0;return c[(c[a+8>>2]|0)+(b<<2)>>2]|0}function aG(a){a=a|0;var b=0;b=c[14187]|0;c[14187]=b+1;c[a+4>>2]=b+1;return}function bG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=c[b>>2]|0;b=c[b+4>>2]|0;c[a>>2]=d;c[a+4>>2]=e;c[a+8>>2]=b;return}function cG(a){a=a|0;dG(c[c[a>>2]>>2]|0);return}function dG(a){a=a|0;var b=0,d=0,e=0;b=c[a+4>>2]|0;e=c[a+8>>2]|0;d=(c[a>>2]|0)+(e>>1)|0;if(!(e&1))a=b;else a=c[(c[d>>2]|0)+b>>2]|0;Qb[a&255](d);return}function eG(b,d,e,f,h,i){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|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=yb;yb=yb+240|0;s=D+160|0;t=D+231|0;u=D+230|0;C=D+216|0;B=D+204|0;v=D+200|0;w=D;x=D+196|0;y=D+192|0;z=D+229|0;r=D+228|0;fG(C,f,s,t,u);c[B>>2]=0;c[B+4>>2]=0;c[B+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[B+(b<<2)>>2]=0;b=b+1|0}p=B+11|0;q=B+8|0;if((a[p>>0]|0)<0)b=(c[q>>2]&2147483647)+-1|0;else b=10;mO(B,b,0);b=(a[p>>0]|0)<0?c[B>>2]|0:B;c[v>>2]=b;c[x>>2]=w;c[y>>2]=0;a[z>>0]=1;a[r>>0]=69;o=B+4|0;k=c[d>>2]|0;j=k;a:while(1){if(k){f=c[k+12>>2]|0;if((f|0)==(c[k+16>>2]|0))f=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else f=ag(a[f>>0]|0)|0;if(Yf(f,Uf()|0)|0){c[d>>2]=0;n=0;l=1;k=0}else{n=j;l=0}}else{n=0;l=1;k=0}j=c[e>>2]|0;do if(j){f=c[j+12>>2]|0;if((f|0)==(c[j+16>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=ag(a[f>>0]|0)|0;if(!(Yf(f,Uf()|0)|0))if(l)break;else break a;else{c[e>>2]=0;E=19;break}}else E=19;while(0);if((E|0)==19){E=0;if(l){j=0;break}else j=0}f=a[p>>0]|0;f=f<<24>>24<0?c[o>>2]|0:f&255;if((c[v>>2]|0)==(b+f|0)){mO(B,f<<1,0);if((a[p>>0]|0)<0)b=(c[q>>2]&2147483647)+-1|0;else b=10;mO(B,b,0);b=(a[p>>0]|0)<0?c[B>>2]|0:B;c[v>>2]=b+f}l=k+12|0;f=c[l>>2]|0;m=k+16|0;if((f|0)==(c[m>>2]|0))f=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else f=ag(a[f>>0]|0)|0;if(gG(f&255,z,r,b,v,a[t>>0]|0,a[u>>0]|0,C,w,x,y,s)|0)break;f=c[l>>2]|0;if((f|0)==(c[m>>2]|0))Eb[c[(c[k>>2]|0)+40>>2]&127](k)|0;else{c[l>>2]=f+1;ag(a[f>>0]|0)|0}j=n}u=a[C+11>>0]|0;if(!((a[z>>0]|0)==0?1:((u<<24>>24<0?c[C+4>>2]|0:u&255)|0)==0)?(A=c[x>>2]|0,(A-w|0)<160):0){z=c[y>>2]|0;c[x>>2]=A+4;c[A>>2]=z}g[i>>3]=+hG(b,c[v>>2]|0,h);iG(C,w,c[x>>2]|0,h);if(k){b=c[k+12>>2]|0;if((b|0)==(c[k+16>>2]|0))b=Eb[c[(c[n>>2]|0)+36>>2]&127](k)|0;else b=ag(a[b>>0]|0)|0;if(Yf(b,Uf()|0)|0){c[d>>2]=0;f=1}else f=0}else f=1;do if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else b=ag(a[b>>0]|0)|0;if(!(Yf(b,Uf()|0)|0))if(f)break;else{E=50;break}else{c[e>>2]=0;E=48;break}}else E=48;while(0);if((E|0)==48?f:0)E=50;if((E|0)==50)c[h>>2]=c[h>>2]|2;E=c[d>>2]|0;hO(B);hO(C);yb=D;return E|0}function fG(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;h=yb;yb=yb+16|0;i=h;GE(i,d);d=VF(i,56736)|0;Ib[c[(c[d>>2]|0)+32>>2]&15](d,12928,12960,e)|0;e=VF(i,56752)|0;a[f>>0]=Eb[c[(c[e>>2]|0)+12>>2]&127](e)|0;a[g>>0]=Eb[c[(c[e>>2]|0)+16>>2]&127](e)|0;Sb[c[(c[e>>2]|0)+20>>2]&63](b,e);WF(i);yb=h;return}function gG(b,d,e,f,g,h,i,j,k,l,m,n){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;var o=0,p=0;a:do if(b<<24>>24==h<<24>>24)if(a[d>>0]|0){a[d>>0]=0;e=c[g>>2]|0;c[g>>2]=e+1;a[e>>0]=46;g=a[j+11>>0]|0;if(((g<<24>>24<0?c[j+4>>2]|0:g&255)|0)!=0?(o=c[l>>2]|0,(o-k|0)<160):0){k=c[m>>2]|0;c[l>>2]=o+4;c[o>>2]=k;o=0}else o=0}else o=-1;else{if(b<<24>>24==i<<24>>24?(i=a[j+11>>0]|0,(i<<24>>24<0?c[j+4>>2]|0:i&255)|0):0){if(!(a[d>>0]|0)){o=-1;break}o=c[l>>2]|0;if((o-k|0)>=160){o=0;break}k=c[m>>2]|0;c[l>>2]=o+4;c[o>>2]=k;c[m>>2]=0;o=0;break}i=n+32|0;h=0;while(1){o=n+h|0;if((h|0)==32){o=i;break}if((a[o>>0]|0)==b<<24>>24)break;else h=h+1|0}h=o-n|0;if((h|0)>31)o=-1;else{i=a[12928+h>>0]|0;switch(h|0){case 24:case 25:{o=c[g>>2]|0;if((o|0)!=(f|0)?(a[o+-1>>0]&95)!=(a[e>>0]&127):0){o=-1;break a}c[g>>2]=o+1;a[o>>0]=i;o=0;break a}case 23:case 22:{a[e>>0]=80;o=c[g>>2]|0;c[g>>2]=o+1;a[o>>0]=i;o=0;break a}default:{o=i&95;if((((o|0)==(a[e>>0]|0)?(a[e>>0]=o|128,a[d>>0]|0):0)?(a[d>>0]=0,e=a[j+11>>0]|0,(e<<24>>24<0?c[j+4>>2]|0:e&255)|0):0)?(p=c[l>>2]|0,(p-k|0)<160):0){k=c[m>>2]|0;c[l>>2]=p+4;c[p>>2]=k}l=c[g>>2]|0;c[g>>2]=l+1;a[l>>0]=i;if((h|0)>21){o=0;break a}c[m>>2]=(c[m>>2]|0)+1;o=0;break a}}}}while(0);return o|0}function hG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,h=0,i=0;i=yb;yb=yb+16|0;f=i;if((a|0)==(b|0)){c[d>>2]=4;e=0.0}else{g=c[(mx()|0)>>2]|0;c[(mx()|0)>>2]=0;e=+pA(a,f,YF()|0);a=c[(mx()|0)>>2]|0;if(!a)c[(mx()|0)>>2]=g;if((c[f>>2]|0)==(b|0)){if((a|0)==68)h=6}else{e=0.0;h=6}if((h|0)==6)c[d>>2]=4}yb=i;return +e}function iG(b,d,e,f){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;j=b+11|0;h=a[j>>0]|0;k=b+4|0;g=c[k>>2]|0;i=h&255;do if((h<<24>>24<0?g:i)|0){if((d|0)!=(e|0)){g=e;h=d;while(1){g=g+-4|0;if(h>>>0>=g>>>0)break;i=c[h>>2]|0;c[h>>2]=c[g>>2];c[g>>2]=i;h=h+4|0}h=a[j>>0]|0;i=h&255;g=c[k>>2]|0}j=h<<24>>24<0;b=j?c[b>>2]|0:b;k=e+-4|0;j=b+(j?g:i)|0;g=b;while(1){h=a[g>>0]|0;i=h<<24>>24>0&h<<24>>24!=127;if(d>>>0>=k>>>0)break;if(i?(c[d>>2]|0)!=(h<<24>>24|0):0){l=11;break}d=d+4|0;g=(j-g|0)>1?g+1|0:g}if((l|0)==11){c[f>>2]=4;break}if(i?((c[k>>2]|0)+-1|0)>>>0>=h<<24>>24>>>0:0)c[f>>2]=4}while(0);return}function jG(b,d,e,f,h,i){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|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=yb;yb=yb+240|0;s=D+160|0;t=D+231|0;u=D+230|0;C=D+216|0;B=D+204|0;v=D+200|0;w=D;x=D+196|0;y=D+192|0;z=D+229|0;r=D+228|0;fG(C,f,s,t,u);c[B>>2]=0;c[B+4>>2]=0;c[B+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[B+(b<<2)>>2]=0;b=b+1|0}p=B+11|0;q=B+8|0;if((a[p>>0]|0)<0)b=(c[q>>2]&2147483647)+-1|0;else b=10;mO(B,b,0);b=(a[p>>0]|0)<0?c[B>>2]|0:B;c[v>>2]=b;c[x>>2]=w;c[y>>2]=0;a[z>>0]=1;a[r>>0]=69;o=B+4|0;k=c[d>>2]|0;j=k;a:while(1){if(k){f=c[k+12>>2]|0;if((f|0)==(c[k+16>>2]|0))f=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else f=ag(a[f>>0]|0)|0;if(Yf(f,Uf()|0)|0){c[d>>2]=0;n=0;l=1;k=0}else{n=j;l=0}}else{n=0;l=1;k=0}j=c[e>>2]|0;do if(j){f=c[j+12>>2]|0;if((f|0)==(c[j+16>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=ag(a[f>>0]|0)|0;if(!(Yf(f,Uf()|0)|0))if(l)break;else break a;else{c[e>>2]=0;E=19;break}}else E=19;while(0);if((E|0)==19){E=0;if(l){j=0;break}else j=0}f=a[p>>0]|0;f=f<<24>>24<0?c[o>>2]|0:f&255;if((c[v>>2]|0)==(b+f|0)){mO(B,f<<1,0);if((a[p>>0]|0)<0)b=(c[q>>2]&2147483647)+-1|0;else b=10;mO(B,b,0);b=(a[p>>0]|0)<0?c[B>>2]|0:B;c[v>>2]=b+f}l=k+12|0;f=c[l>>2]|0;m=k+16|0;if((f|0)==(c[m>>2]|0))f=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else f=ag(a[f>>0]|0)|0;if(gG(f&255,z,r,b,v,a[t>>0]|0,a[u>>0]|0,C,w,x,y,s)|0)break;f=c[l>>2]|0;if((f|0)==(c[m>>2]|0))Eb[c[(c[k>>2]|0)+40>>2]&127](k)|0;else{c[l>>2]=f+1;ag(a[f>>0]|0)|0}j=n}u=a[C+11>>0]|0;if(!((a[z>>0]|0)==0?1:((u<<24>>24<0?c[C+4>>2]|0:u&255)|0)==0)?(A=c[x>>2]|0,(A-w|0)<160):0){z=c[y>>2]|0;c[x>>2]=A+4;c[A>>2]=z}g[i>>3]=+kG(b,c[v>>2]|0,h);iG(C,w,c[x>>2]|0,h);if(k){b=c[k+12>>2]|0;if((b|0)==(c[k+16>>2]|0))b=Eb[c[(c[n>>2]|0)+36>>2]&127](k)|0;else b=ag(a[b>>0]|0)|0;if(Yf(b,Uf()|0)|0){c[d>>2]=0;f=1}else f=0}else f=1;do if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else b=ag(a[b>>0]|0)|0;if(!(Yf(b,Uf()|0)|0))if(f)break;else{E=50;break}else{c[e>>2]=0;E=48;break}}else E=48;while(0);if((E|0)==48?f:0)E=50;if((E|0)==50)c[h>>2]=c[h>>2]|2;E=c[d>>2]|0;hO(B);hO(C);yb=D;return E|0}function kG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,h=0,i=0;i=yb;yb=yb+16|0;f=i;if((a|0)==(b|0)){c[d>>2]=4;e=0.0}else{g=c[(mx()|0)>>2]|0;c[(mx()|0)>>2]=0;e=+oA(a,f,YF()|0);a=c[(mx()|0)>>2]|0;if(!a)c[(mx()|0)>>2]=g;if((c[f>>2]|0)==(b|0)){if((a|0)==68)h=6}else{e=0.0;h=6}if((h|0)==6)c[d>>2]=4}yb=i;return +e}function lG(b,d,e,g,h,i){b=b|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|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=yb;yb=yb+240|0;s=D+160|0;t=D+231|0;u=D+230|0;C=D+216|0;B=D+204|0;v=D+200|0;w=D;x=D+196|0;y=D+192|0;z=D+229|0;r=D+228|0;fG(C,g,s,t,u);c[B>>2]=0;c[B+4>>2]=0;c[B+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[B+(b<<2)>>2]=0;b=b+1|0}p=B+11|0;q=B+8|0;if((a[p>>0]|0)<0)b=(c[q>>2]&2147483647)+-1|0;else b=10;mO(B,b,0);b=(a[p>>0]|0)<0?c[B>>2]|0:B;c[v>>2]=b;c[x>>2]=w;c[y>>2]=0;a[z>>0]=1;a[r>>0]=69;o=B+4|0;k=c[d>>2]|0;j=k;a:while(1){if(k){g=c[k+12>>2]|0;if((g|0)==(c[k+16>>2]|0))g=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else g=ag(a[g>>0]|0)|0;if(Yf(g,Uf()|0)|0){c[d>>2]=0;n=0;l=1;k=0}else{n=j;l=0}}else{n=0;l=1;k=0}j=c[e>>2]|0;do if(j){g=c[j+12>>2]|0;if((g|0)==(c[j+16>>2]|0))g=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else g=ag(a[g>>0]|0)|0;if(!(Yf(g,Uf()|0)|0))if(l)break;else break a;else{c[e>>2]=0;E=19;break}}else E=19;while(0);if((E|0)==19){E=0;if(l){j=0;break}else j=0}g=a[p>>0]|0;g=g<<24>>24<0?c[o>>2]|0:g&255;if((c[v>>2]|0)==(b+g|0)){mO(B,g<<1,0);if((a[p>>0]|0)<0)b=(c[q>>2]&2147483647)+-1|0;else b=10;mO(B,b,0);b=(a[p>>0]|0)<0?c[B>>2]|0:B;c[v>>2]=b+g}l=k+12|0;g=c[l>>2]|0;m=k+16|0;if((g|0)==(c[m>>2]|0))g=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else g=ag(a[g>>0]|0)|0;if(gG(g&255,z,r,b,v,a[t>>0]|0,a[u>>0]|0,C,w,x,y,s)|0)break;g=c[l>>2]|0;if((g|0)==(c[m>>2]|0))Eb[c[(c[k>>2]|0)+40>>2]&127](k)|0;else{c[l>>2]=g+1;ag(a[g>>0]|0)|0}j=n}u=a[C+11>>0]|0;if(!((a[z>>0]|0)==0?1:((u<<24>>24<0?c[C+4>>2]|0:u&255)|0)==0)?(A=c[x>>2]|0,(A-w|0)<160):0){z=c[y>>2]|0;c[x>>2]=A+4;c[A>>2]=z}f[i>>2]=+mG(b,c[v>>2]|0,h);iG(C,w,c[x>>2]|0,h);if(k){b=c[k+12>>2]|0;if((b|0)==(c[k+16>>2]|0))b=Eb[c[(c[n>>2]|0)+36>>2]&127](k)|0;else b=ag(a[b>>0]|0)|0;if(Yf(b,Uf()|0)|0){c[d>>2]=0;g=1}else g=0}else g=1;do if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else b=ag(a[b>>0]|0)|0;if(!(Yf(b,Uf()|0)|0))if(g)break;else{E=50;break}else{c[e>>2]=0;E=48;break}}else E=48;while(0);if((E|0)==48?g:0)E=50;if((E|0)==50)c[h>>2]=c[h>>2]|2;E=c[d>>2]|0;hO(B);hO(C);yb=D;return E|0}function mG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,h=0,i=0;i=yb;yb=yb+16|0;f=i;if((a|0)==(b|0)){c[d>>2]=4;e=0.0}else{g=c[(mx()|0)>>2]|0;c[(mx()|0)>>2]=0;e=+nA(a,f,YF()|0);a=c[(mx()|0)>>2]|0;if(!a)c[(mx()|0)>>2]=g;if((c[f>>2]|0)==(b|0)){if((a|0)==68)h=6}else{e=0.0;h=6}if((h|0)==6)c[d>>2]=4}yb=i;return +e}function nG(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 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;B=yb;yb=yb+240|0;r=B+224|0;y=B+212|0;z=B+200|0;s=B+196|0;t=B;v=B+192|0;w=B+188|0;x=oG(f)|0;q=pG(b,f,B+160|0)|0;qG(y,f,r);c[z>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[z+(b<<2)>>2]=0;b=b+1|0}o=z+11|0;p=z+8|0;if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b;c[v>>2]=t;c[w>>2]=0;n=z+4|0;j=c[d>>2]|0;i=j;a:while(1){if(j){f=c[j+12>>2]|0;if((f|0)==(c[j+16>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=ag(a[f>>0]|0)|0;if(Yf(f,Uf()|0)|0){c[d>>2]=0;m=0;k=1;j=0}else{m=i;k=0}}else{m=0;k=1;j=0}i=c[e>>2]|0;do if(i){f=c[i+12>>2]|0;if((f|0)==(c[i+16>>2]|0))f=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else f=ag(a[f>>0]|0)|0;if(!(Yf(f,Uf()|0)|0))if(k)break;else break a;else{c[e>>2]=0;A=19;break}}else A=19;while(0);if((A|0)==19){A=0;if(k){i=0;break}else i=0}f=a[o>>0]|0;f=f<<24>>24<0?c[n>>2]|0:f&255;if((c[s>>2]|0)==(b+f|0)){mO(z,f<<1,0);if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b+f}k=j+12|0;f=c[k>>2]|0;l=j+16|0;if((f|0)==(c[l>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=ag(a[f>>0]|0)|0;if(XF(f&255,x,b,s,w,a[r>>0]|0,y,t,v,q)|0)break;f=c[k>>2]|0;if((f|0)==(c[l>>2]|0))Eb[c[(c[j>>2]|0)+40>>2]&127](j)|0;else{c[k>>2]=f+1;ag(a[f>>0]|0)|0}i=m}r=a[y+11>>0]|0;if((r<<24>>24<0?c[y+4>>2]|0:r&255)|0?(u=c[v>>2]|0,(u-t|0)<160):0){w=c[w>>2]|0;c[v>>2]=u+4;c[u>>2]=w}w=rG(b,c[s>>2]|0,g,x)|0;x=F()|0;c[h>>2]=w;c[h+4>>2]=x;iG(y,t,c[v>>2]|0,g);if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[m>>2]|0)+36>>2]&127](j)|0;else b=ag(a[b>>0]|0)|0;if(Yf(b,Uf()|0)|0){c[d>>2]=0;f=1}else f=0}else f=1;do if(i){b=c[i+12>>2]|0;if((b|0)==(c[i+16>>2]|0))b=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else b=ag(a[b>>0]|0)|0;if(!(Yf(b,Uf()|0)|0))if(f)break;else{A=50;break}else{c[e>>2]=0;A=48;break}}else A=48;while(0);if((A|0)==48?f:0)A=50;if((A|0)==50)c[g>>2]=c[g>>2]|2;A=c[d>>2]|0;hO(z);hO(y);yb=B;return A|0}function oG(a){a=a|0;switch(c[a+4>>2]&74){case 64:{a=8;break}case 8:{a=16;break}case 0:{a=0;break}default:a=10}return a|0}function pG(a,b,c){a=a|0;b=b|0;c=c|0;return sG(a,b,c)|0}function qG(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=yb;yb=yb+16|0;g=f;GE(g,d);d=VF(g,56752)|0;a[e>>0]=Eb[c[(c[d>>2]|0)+16>>2]&127](d)|0;Sb[c[(c[d>>2]|0)+20>>2]&63](b,d);WF(g);yb=f;return}function rG(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;k=yb;yb=yb+16|0;i=k;do if((b|0)==(d|0)){c[e>>2]=4;f=0;b=0}else{j=(a[b>>0]|0)==45;if(j){b=b+1|0;if((b|0)==(d|0)){c[e>>2]=4;f=0;b=0;break}}h=c[(mx()|0)>>2]|0;c[(mx()|0)>>2]=0;b=rx(b,i,f,YF()|0)|0;g=F()|0;f=c[(mx()|0)>>2]|0;if(!f)c[(mx()|0)>>2]=h;do if((c[i>>2]|0)==(d|0))if((f|0)==68){c[e>>2]=4;b=-1;f=-1;break}else{i=NO(0,0,b|0,g|0)|0;f=F()|0;b=j?i:b;f=j?f:g;break}else{c[e>>2]=4;b=0;f=0}while(0)}while(0);E(f|0);yb=k;return b|0}function sG(a,b,c){a=a|0;b=b|0;c=c|0;return 12928}function tG(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 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;B=yb;yb=yb+240|0;r=B+224|0;y=B+212|0;z=B+200|0;s=B+196|0;t=B;v=B+192|0;w=B+188|0;x=oG(f)|0;q=pG(b,f,B+160|0)|0;qG(y,f,r);c[z>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[z+(b<<2)>>2]=0;b=b+1|0}o=z+11|0;p=z+8|0;if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b;c[v>>2]=t;c[w>>2]=0;n=z+4|0;j=c[d>>2]|0;i=j;a:while(1){if(j){f=c[j+12>>2]|0;if((f|0)==(c[j+16>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=ag(a[f>>0]|0)|0;if(Yf(f,Uf()|0)|0){c[d>>2]=0;m=0;k=1;j=0}else{m=i;k=0}}else{m=0;k=1;j=0}i=c[e>>2]|0;do if(i){f=c[i+12>>2]|0;if((f|0)==(c[i+16>>2]|0))f=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else f=ag(a[f>>0]|0)|0;if(!(Yf(f,Uf()|0)|0))if(k)break;else break a;else{c[e>>2]=0;A=19;break}}else A=19;while(0);if((A|0)==19){A=0;if(k){i=0;break}else i=0}f=a[o>>0]|0;f=f<<24>>24<0?c[n>>2]|0:f&255;if((c[s>>2]|0)==(b+f|0)){mO(z,f<<1,0);if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b+f}k=j+12|0;f=c[k>>2]|0;l=j+16|0;if((f|0)==(c[l>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=ag(a[f>>0]|0)|0;if(XF(f&255,x,b,s,w,a[r>>0]|0,y,t,v,q)|0)break;f=c[k>>2]|0;if((f|0)==(c[l>>2]|0))Eb[c[(c[j>>2]|0)+40>>2]&127](j)|0;else{c[k>>2]=f+1;ag(a[f>>0]|0)|0}i=m}r=a[y+11>>0]|0;if((r<<24>>24<0?c[y+4>>2]|0:r&255)|0?(u=c[v>>2]|0,(u-t|0)<160):0){w=c[w>>2]|0;c[v>>2]=u+4;c[u>>2]=w}c[h>>2]=uG(b,c[s>>2]|0,g,x)|0;iG(y,t,c[v>>2]|0,g);if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[m>>2]|0)+36>>2]&127](j)|0;else b=ag(a[b>>0]|0)|0;if(Yf(b,Uf()|0)|0){c[d>>2]=0;f=1}else f=0}else f=1;do if(i){b=c[i+12>>2]|0;if((b|0)==(c[i+16>>2]|0))b=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else b=ag(a[b>>0]|0)|0;if(!(Yf(b,Uf()|0)|0))if(f)break;else{A=50;break}else{c[e>>2]=0;A=48;break}}else A=48;while(0);if((A|0)==48?f:0)A=50;if((A|0)==50)c[g>>2]=c[g>>2]|2;A=c[d>>2]|0;hO(z);hO(y);yb=B;return A|0}function uG(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;k=yb;yb=yb+16|0;i=k;do if((b|0)==(d|0)){c[e>>2]=4;b=0}else{j=(a[b>>0]|0)==45;if(j){b=b+1|0;if((b|0)==(d|0)){c[e>>2]=4;b=0;break}}h=c[(mx()|0)>>2]|0;c[(mx()|0)>>2]=0;b=rx(b,i,f,YF()|0)|0;f=F()|0;g=c[(mx()|0)>>2]|0;if(!g)c[(mx()|0)>>2]=h;do if((c[i>>2]|0)==(d|0))if(f>>>0>0|(f|0)==0&b>>>0>4294967295|(g|0)==68){c[e>>2]=4;b=-1;break}else{b=j?0-b|0:b;break}else{c[e>>2]=4;b=0}while(0)}while(0);yb=k;return b|0}function vG(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 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;B=yb;yb=yb+240|0;r=B+224|0;y=B+212|0;z=B+200|0;s=B+196|0;t=B;v=B+192|0;w=B+188|0;x=oG(f)|0;q=pG(b,f,B+160|0)|0;qG(y,f,r);c[z>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[z+(b<<2)>>2]=0;b=b+1|0}o=z+11|0;p=z+8|0;if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b;c[v>>2]=t;c[w>>2]=0;n=z+4|0;j=c[d>>2]|0;i=j;a:while(1){if(j){f=c[j+12>>2]|0;if((f|0)==(c[j+16>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=ag(a[f>>0]|0)|0;if(Yf(f,Uf()|0)|0){c[d>>2]=0;m=0;k=1;j=0}else{m=i;k=0}}else{m=0;k=1;j=0}i=c[e>>2]|0;do if(i){f=c[i+12>>2]|0;if((f|0)==(c[i+16>>2]|0))f=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else f=ag(a[f>>0]|0)|0;if(!(Yf(f,Uf()|0)|0))if(k)break;else break a;else{c[e>>2]=0;A=19;break}}else A=19;while(0);if((A|0)==19){A=0;if(k){i=0;break}else i=0}f=a[o>>0]|0;f=f<<24>>24<0?c[n>>2]|0:f&255;if((c[s>>2]|0)==(b+f|0)){mO(z,f<<1,0);if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b+f}k=j+12|0;f=c[k>>2]|0;l=j+16|0;if((f|0)==(c[l>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=ag(a[f>>0]|0)|0;if(XF(f&255,x,b,s,w,a[r>>0]|0,y,t,v,q)|0)break;f=c[k>>2]|0;if((f|0)==(c[l>>2]|0))Eb[c[(c[j>>2]|0)+40>>2]&127](j)|0;else{c[k>>2]=f+1;ag(a[f>>0]|0)|0}i=m}r=a[y+11>>0]|0;if((r<<24>>24<0?c[y+4>>2]|0:r&255)|0?(u=c[v>>2]|0,(u-t|0)<160):0){w=c[w>>2]|0;c[v>>2]=u+4;c[u>>2]=w}c[h>>2]=wG(b,c[s>>2]|0,g,x)|0;iG(y,t,c[v>>2]|0,g);if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[m>>2]|0)+36>>2]&127](j)|0;else b=ag(a[b>>0]|0)|0;if(Yf(b,Uf()|0)|0){c[d>>2]=0;f=1}else f=0}else f=1;do if(i){b=c[i+12>>2]|0;if((b|0)==(c[i+16>>2]|0))b=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else b=ag(a[b>>0]|0)|0;if(!(Yf(b,Uf()|0)|0))if(f)break;else{A=50;break}else{c[e>>2]=0;A=48;break}}else A=48;while(0);if((A|0)==48?f:0)A=50;if((A|0)==50)c[g>>2]=c[g>>2]|2;A=c[d>>2]|0;hO(z);hO(y);yb=B;return A|0}function wG(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;k=yb;yb=yb+16|0;i=k;do if((b|0)==(d|0)){c[e>>2]=4;b=0}else{j=(a[b>>0]|0)==45;if(j){b=b+1|0;if((b|0)==(d|0)){c[e>>2]=4;b=0;break}}h=c[(mx()|0)>>2]|0;c[(mx()|0)>>2]=0;b=rx(b,i,f,YF()|0)|0;f=F()|0;g=c[(mx()|0)>>2]|0;if(!g)c[(mx()|0)>>2]=h;do if((c[i>>2]|0)==(d|0))if(f>>>0>0|(f|0)==0&b>>>0>4294967295|(g|0)==68){c[e>>2]=4;b=-1;break}else{b=j?0-b|0:b;break}else{c[e>>2]=4;b=0}while(0)}while(0);yb=k;return b|0}function xG(d,e,f,g,h,i){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;C=yb;yb=yb+240|0;s=C+224|0;z=C+212|0;A=C+200|0;t=C+196|0;u=C;w=C+192|0;x=C+188|0;y=oG(g)|0;r=pG(d,g,C+160|0)|0;qG(z,g,s);c[A>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;d=0;while(1){if((d|0)==3)break;c[A+(d<<2)>>2]=0;d=d+1|0}p=A+11|0;q=A+8|0;if((a[p>>0]|0)<0)d=(c[q>>2]&2147483647)+-1|0;else d=10;mO(A,d,0);d=(a[p>>0]|0)<0?c[A>>2]|0:A;c[t>>2]=d;c[w>>2]=u;c[x>>2]=0;o=A+4|0;k=c[e>>2]|0;j=k;a:while(1){if(k){g=c[k+12>>2]|0;if((g|0)==(c[k+16>>2]|0))g=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else g=ag(a[g>>0]|0)|0;if(Yf(g,Uf()|0)|0){c[e>>2]=0;n=0;l=1;k=0}else{n=j;l=0}}else{n=0;l=1;k=0}j=c[f>>2]|0;do if(j){g=c[j+12>>2]|0;if((g|0)==(c[j+16>>2]|0))g=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else g=ag(a[g>>0]|0)|0;if(!(Yf(g,Uf()|0)|0))if(l)break;else break a;else{c[f>>2]=0;B=19;break}}else B=19;while(0);if((B|0)==19){B=0;if(l){j=0;break}else j=0}g=a[p>>0]|0;g=g<<24>>24<0?c[o>>2]|0:g&255;if((c[t>>2]|0)==(d+g|0)){mO(A,g<<1,0);if((a[p>>0]|0)<0)d=(c[q>>2]&2147483647)+-1|0;else d=10;mO(A,d,0);d=(a[p>>0]|0)<0?c[A>>2]|0:A;c[t>>2]=d+g}l=k+12|0;g=c[l>>2]|0;m=k+16|0;if((g|0)==(c[m>>2]|0))g=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else g=ag(a[g>>0]|0)|0;if(XF(g&255,y,d,t,x,a[s>>0]|0,z,u,w,r)|0)break;g=c[l>>2]|0;if((g|0)==(c[m>>2]|0))Eb[c[(c[k>>2]|0)+40>>2]&127](k)|0;else{c[l>>2]=g+1;ag(a[g>>0]|0)|0}j=n}s=a[z+11>>0]|0;if((s<<24>>24<0?c[z+4>>2]|0:s&255)|0?(v=c[w>>2]|0,(v-u|0)<160):0){x=c[x>>2]|0;c[w>>2]=v+4;c[v>>2]=x}b[i>>1]=yG(d,c[t>>2]|0,h,y)|0;iG(z,u,c[w>>2]|0,h);if(k){d=c[k+12>>2]|0;if((d|0)==(c[k+16>>2]|0))d=Eb[c[(c[n>>2]|0)+36>>2]&127](k)|0;else d=ag(a[d>>0]|0)|0;if(Yf(d,Uf()|0)|0){c[e>>2]=0;g=1}else g=0}else g=1;do if(j){d=c[j+12>>2]|0;if((d|0)==(c[j+16>>2]|0))d=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else d=ag(a[d>>0]|0)|0;if(!(Yf(d,Uf()|0)|0))if(g)break;else{B=50;break}else{c[f>>2]=0;B=48;break}}else B=48;while(0);if((B|0)==48?g:0)B=50;if((B|0)==50)c[h>>2]=c[h>>2]|2;B=c[e>>2]|0;hO(A);hO(z);yb=C;return B|0}function yG(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;k=yb;yb=yb+16|0;i=k;do if((b|0)==(d|0)){c[e>>2]=4;b=0}else{j=(a[b>>0]|0)==45;if(j){b=b+1|0;if((b|0)==(d|0)){c[e>>2]=4;b=0;break}}h=c[(mx()|0)>>2]|0;c[(mx()|0)>>2]=0;b=rx(b,i,f,YF()|0)|0;f=F()|0;g=c[(mx()|0)>>2]|0;if(!g)c[(mx()|0)>>2]=h;do if((c[i>>2]|0)==(d|0)){if(f>>>0>0|(f|0)==0&b>>>0>65535|(g|0)==68){c[e>>2]=4;b=-1;break}if(j)b=0-b&65535;else b=b&65535}else{c[e>>2]=4;b=0}while(0)}while(0);yb=k;return b|0}function zG(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 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;B=yb;yb=yb+240|0;r=B+224|0;y=B+212|0;z=B+200|0;s=B+196|0;t=B;v=B+192|0;w=B+188|0;x=oG(f)|0;q=pG(b,f,B+160|0)|0;qG(y,f,r);c[z>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[z+(b<<2)>>2]=0;b=b+1|0}o=z+11|0;p=z+8|0;if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b;c[v>>2]=t;c[w>>2]=0;n=z+4|0;j=c[d>>2]|0;i=j;a:while(1){if(j){f=c[j+12>>2]|0;if((f|0)==(c[j+16>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=ag(a[f>>0]|0)|0;if(Yf(f,Uf()|0)|0){c[d>>2]=0;m=0;k=1;j=0}else{m=i;k=0}}else{m=0;k=1;j=0}i=c[e>>2]|0;do if(i){f=c[i+12>>2]|0;if((f|0)==(c[i+16>>2]|0))f=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else f=ag(a[f>>0]|0)|0;if(!(Yf(f,Uf()|0)|0))if(k)break;else break a;else{c[e>>2]=0;A=19;break}}else A=19;while(0);if((A|0)==19){A=0;if(k){i=0;break}else i=0}f=a[o>>0]|0;f=f<<24>>24<0?c[n>>2]|0:f&255;if((c[s>>2]|0)==(b+f|0)){mO(z,f<<1,0);if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b+f}k=j+12|0;f=c[k>>2]|0;l=j+16|0;if((f|0)==(c[l>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=ag(a[f>>0]|0)|0;if(XF(f&255,x,b,s,w,a[r>>0]|0,y,t,v,q)|0)break;f=c[k>>2]|0;if((f|0)==(c[l>>2]|0))Eb[c[(c[j>>2]|0)+40>>2]&127](j)|0;else{c[k>>2]=f+1;ag(a[f>>0]|0)|0}i=m}r=a[y+11>>0]|0;if((r<<24>>24<0?c[y+4>>2]|0:r&255)|0?(u=c[v>>2]|0,(u-t|0)<160):0){w=c[w>>2]|0;c[v>>2]=u+4;c[u>>2]=w}w=AG(b,c[s>>2]|0,g,x)|0;x=F()|0;c[h>>2]=w;c[h+4>>2]=x;iG(y,t,c[v>>2]|0,g);if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[m>>2]|0)+36>>2]&127](j)|0;else b=ag(a[b>>0]|0)|0;if(Yf(b,Uf()|0)|0){c[d>>2]=0;f=1}else f=0}else f=1;do if(i){b=c[i+12>>2]|0;if((b|0)==(c[i+16>>2]|0))b=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else b=ag(a[b>>0]|0)|0;if(!(Yf(b,Uf()|0)|0))if(f)break;else{A=50;break}else{c[e>>2]=0;A=48;break}}else A=48;while(0);if((A|0)==48?f:0)A=50;if((A|0)==50)c[g>>2]=c[g>>2]|2;A=c[d>>2]|0;hO(z);hO(y);yb=B;return A|0}function AG(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=yb;yb=yb+16|0;g=i;if((a|0)==(b|0)){c[d>>2]=4;e=0;a=0}else{h=c[(mx()|0)>>2]|0;c[(mx()|0)>>2]=0;a=Ax(a,g,e,YF()|0)|0;e=F()|0;f=c[(mx()|0)>>2]|0;if(!f)c[(mx()|0)>>2]=h;if((c[g>>2]|0)==(b|0)){if((f|0)==68){c[d>>2]=4;e=(e|0)>0|(e|0)==0&a>>>0>0;a=e?-1:0;e=e?2147483647:-2147483648}}else{c[d>>2]=4;a=0;e=0}}E(e|0);yb=i;return a|0}function BG(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 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;B=yb;yb=yb+240|0;r=B+224|0;y=B+212|0;z=B+200|0;s=B+196|0;t=B;v=B+192|0;w=B+188|0;x=oG(f)|0;q=pG(b,f,B+160|0)|0;qG(y,f,r);c[z>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[z+(b<<2)>>2]=0;b=b+1|0}o=z+11|0;p=z+8|0;if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b;c[v>>2]=t;c[w>>2]=0;n=z+4|0;j=c[d>>2]|0;i=j;a:while(1){if(j){f=c[j+12>>2]|0;if((f|0)==(c[j+16>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=ag(a[f>>0]|0)|0;if(Yf(f,Uf()|0)|0){c[d>>2]=0;m=0;k=1;j=0}else{m=i;k=0}}else{m=0;k=1;j=0}i=c[e>>2]|0;do if(i){f=c[i+12>>2]|0;if((f|0)==(c[i+16>>2]|0))f=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else f=ag(a[f>>0]|0)|0;if(!(Yf(f,Uf()|0)|0))if(k)break;else break a;else{c[e>>2]=0;A=19;break}}else A=19;while(0);if((A|0)==19){A=0;if(k){i=0;break}else i=0}f=a[o>>0]|0;f=f<<24>>24<0?c[n>>2]|0:f&255;if((c[s>>2]|0)==(b+f|0)){mO(z,f<<1,0);if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b+f}k=j+12|0;f=c[k>>2]|0;l=j+16|0;if((f|0)==(c[l>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=ag(a[f>>0]|0)|0;if(XF(f&255,x,b,s,w,a[r>>0]|0,y,t,v,q)|0)break;f=c[k>>2]|0;if((f|0)==(c[l>>2]|0))Eb[c[(c[j>>2]|0)+40>>2]&127](j)|0;else{c[k>>2]=f+1;ag(a[f>>0]|0)|0}i=m}r=a[y+11>>0]|0;if((r<<24>>24<0?c[y+4>>2]|0:r&255)|0?(u=c[v>>2]|0,(u-t|0)<160):0){w=c[w>>2]|0;c[v>>2]=u+4;c[u>>2]=w}c[h>>2]=CG(b,c[s>>2]|0,g,x)|0;iG(y,t,c[v>>2]|0,g);if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[m>>2]|0)+36>>2]&127](j)|0;else b=ag(a[b>>0]|0)|0;if(Yf(b,Uf()|0)|0){c[d>>2]=0;f=1}else f=0}else f=1;do if(i){b=c[i+12>>2]|0;if((b|0)==(c[i+16>>2]|0))b=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else b=ag(a[b>>0]|0)|0;if(!(Yf(b,Uf()|0)|0))if(f)break;else{A=50;break}else{c[e>>2]=0;A=48;break}}else A=48;while(0);if((A|0)==48?f:0)A=50;if((A|0)==50)c[g>>2]=c[g>>2]|2;A=c[d>>2]|0;hO(z);hO(y);yb=B;return A|0}function CG(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=yb;yb=yb+16|0;g=i;if((a|0)==(b|0)){c[d>>2]=4;a=0}else{h=c[(mx()|0)>>2]|0;c[(mx()|0)>>2]=0;a=Ax(a,g,e,YF()|0)|0;e=F()|0;f=c[(mx()|0)>>2]|0;if(!f)c[(mx()|0)>>2]=h;a:do if((c[g>>2]|0)==(b|0)){do if((f|0)==68){c[d>>2]=4;if((e|0)>0|(e|0)==0&a>>>0>0){a=2147483647;break a}}else{if((e|0)<-1|(e|0)==-1&a>>>0<2147483648){c[d>>2]=4;break}if((e|0)>0|(e|0)==0&a>>>0>2147483647){c[d>>2]=4;a=2147483647;break a}else break a}while(0);a=-2147483648}else{c[d>>2]=4;a=0}while(0)}yb=i;return a|0}function DG(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;w=yb;yb=yb+112|0;k=w;l=(f-e|0)/12|0;if(l>>>0>100){k=DO(l)|0;if(!k)_N();else{j=k;u=k}}else{j=k;u=0}n=e;o=j;k=0;while(1){if((n|0)==(f|0))break;m=a[n+11>>0]|0;if(m<<24>>24<0)m=c[n+4>>2]|0;else m=m&255;if(!m){a[o>>0]=2;l=l+-1|0;k=k+1|0}else a[o>>0]=1;n=n+12|0;o=o+1|0}t=0;r=k;while(1){k=c[b>>2]|0;do if(k){m=c[k+12>>2]|0;if((m|0)==(c[k+16>>2]|0))k=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else k=ag(a[m>>0]|0)|0;if(Yf(k,Uf()|0)|0){c[b>>2]=0;o=1;break}else{o=(c[b>>2]|0)==0;break}}else o=1;while(0);m=c[d>>2]|0;if(m){k=c[m+12>>2]|0;if((k|0)==(c[m+16>>2]|0))k=Eb[c[(c[m>>2]|0)+36>>2]&127](m)|0;else k=ag(a[k>>0]|0)|0;if(Yf(k,Uf()|0)|0){c[d>>2]=0;k=1;m=0}else k=0}else{k=1;m=0}n=c[b>>2]|0;if(!((l|0)!=0&(o^k)))break;k=c[n+12>>2]|0;if((k|0)==(c[n+16>>2]|0))k=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else k=ag(a[k>>0]|0)|0;k=k&255;if(!i)k=Gb[c[(c[g>>2]|0)+12>>2]&63](g,k)|0;s=t+1|0;p=e;o=0;q=j;while(1){if((p|0)==(f|0))break;do if((a[q>>0]|0)==1){n=p+11|0;if((a[n>>0]|0)<0)m=c[p>>2]|0;else m=p;m=a[m+t>>0]|0;if(!i)m=Gb[c[(c[g>>2]|0)+12>>2]&63](g,m)|0;if(k<<24>>24!=m<<24>>24){a[q>>0]=0;m=o;n=r;l=l+-1|0;break}m=a[n>>0]|0;if(m<<24>>24<0)m=c[p+4>>2]|0;else m=m&255;if((m|0)==(s|0)){a[q>>0]=2;m=1;n=r+1|0;l=l+-1|0}else{m=1;n=r}}else{m=o;n=r}while(0);p=p+12|0;o=m;q=q+1|0;r=n}a:do if(o){k=c[b>>2]|0;m=k+12|0;n=c[m>>2]|0;if((n|0)==(c[k+16>>2]|0))Eb[c[(c[k>>2]|0)+40>>2]&127](k)|0;else{c[m>>2]=n+1;ag(a[n>>0]|0)|0}if((r+l|0)>>>0>1){n=e;o=j;k=r;while(1){if((n|0)==(f|0))break a;if((a[o>>0]|0)==2){m=a[n+11>>0]|0;if(m<<24>>24<0)m=c[n+4>>2]|0;else m=m&255;if((m|0)!=(s|0)){a[o>>0]=0;k=k+-1|0}}n=n+12|0;o=o+1|0}}else k=r}else k=r;while(0);t=s;r=k}do if(n){k=c[n+12>>2]|0;if((k|0)==(c[n+16>>2]|0))k=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else k=ag(a[k>>0]|0)|0;if(Yf(k,Uf()|0)|0){c[b>>2]=0;l=1;break}else{l=(c[b>>2]|0)==0;break}}else l=1;while(0);do if(m){k=c[m+12>>2]|0;if((k|0)==(c[m+16>>2]|0))k=Eb[c[(c[m>>2]|0)+36>>2]&127](m)|0;else k=ag(a[k>>0]|0)|0;if(!(Yf(k,Uf()|0)|0))if(l)break;else{v=79;break}else{c[d>>2]=0;v=41;break}}else v=41;while(0);if((v|0)==41?l:0)v=79;if((v|0)==79)c[h>>2]=c[h>>2]|2;while(1){if((e|0)==(f|0)){v=84;break}if((a[j>>0]|0)==2)break;e=e+12|0;j=j+1|0}if((v|0)==84){c[h>>2]=c[h>>2]|4;e=f}EO(u);yb=w;return e|0}function EG(a){a=a|0;AF(a);return}function FG(a){a=a|0;AF(a);QA(a);return}function GG(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 i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=yb;yb=yb+48|0;i=o+40|0;n=o;j=o+32|0;k=o+36|0;l=o+28|0;m=o+24|0;if(!(c[f+4>>2]&1)){c[j>>2]=-1;m=c[(c[b>>2]|0)+16>>2]|0;c[k>>2]=c[d>>2];c[l>>2]=c[e>>2];c[n>>2]=c[k>>2];c[i>>2]=c[l>>2];c[d>>2]=Mb[m&63](b,n,i,f,g,j)|0;switch(c[j>>2]|0){case 0:{a[h>>0]=0;break}case 1:{a[h>>0]=1;break}default:{a[h>>0]=1;c[g>>2]=4}}i=c[d>>2]|0}else{GE(i,f);l=VF(i,56768)|0;WF(i);GE(i,f);b=VF(i,56776)|0;WF(i);Sb[c[(c[b>>2]|0)+24>>2]&63](n,b);Sb[c[(c[b>>2]|0)+28>>2]&63](n+12|0,b);c[m>>2]=c[e>>2];b=n+24|0;c[i>>2]=c[m>>2];a[h>>0]=(eH(d,i,n,b,l,g,1)|0)==(n|0)&1;i=c[d>>2]|0;do{b=b+-12|0;uO(b)}while((b|0)!=(n|0))}yb=o;return i|0}function HG(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=dH(a,j,i,e,f,g)|0;yb=h;return g|0}function IG(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=cH(a,j,i,e,f,g)|0;yb=h;return g|0}function JG(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=bH(a,j,i,e,f,g)|0;yb=h;return g|0}function KG(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=aH(a,j,i,e,f,g)|0;yb=h;return g|0}function LG(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=$G(a,j,i,e,f,g)|0;yb=h;return g|0}function MG(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=XG(a,j,i,e,f,g)|0;yb=h;return g|0}function NG(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=WG(a,j,i,e,f,g)|0;yb=h;return g|0}function OG(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=VG(a,j,i,e,f,g)|0;yb=h;return g|0}function PG(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=SG(a,j,i,e,f,g)|0;yb=h;return g|0}function QG(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 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;y=yb;yb=yb+304|0;v=y+264|0;t=y+160|0;w=y+292|0;x=y+280|0;u=y+276|0;q=y;r=y+272|0;s=y+268|0;c[w>>2]=0;c[w+4>>2]=0;c[w+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[w+(b<<2)>>2]=0;b=b+1|0}GE(x,f);b=VF(x,56768)|0;Ib[c[(c[b>>2]|0)+48>>2]&15](b,12928,12954,t)|0;WF(x);c[x>>2]=0;c[x+4>>2]=0;c[x+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[x+(b<<2)>>2]=0;b=b+1|0}p=x+11|0;o=x+8|0;if((a[p>>0]|0)<0)b=(c[o>>2]&2147483647)+-1|0;else b=10;mO(x,b,0);b=(a[p>>0]|0)<0?c[x>>2]|0:x;c[u>>2]=b;c[r>>2]=q;c[s>>2]=0;n=x+4|0;j=c[d>>2]|0;i=j;a:while(1){if(j){f=c[j+12>>2]|0;if((f|0)==(c[j+16>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=hE(c[f>>2]|0)|0;if(HE(f,gE()|0)|0){c[d>>2]=0;m=0;k=1;j=0}else{m=i;k=0}}else{m=0;k=1;j=0}i=c[e>>2]|0;do if(i){f=c[i+12>>2]|0;if((f|0)==(c[i+16>>2]|0))f=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else f=hE(c[f>>2]|0)|0;if(!(HE(f,gE()|0)|0))if(k)break;else break a;else{c[e>>2]=0;z=22;break}}else z=22;while(0);if((z|0)==22){z=0;if(k){i=0;break}else i=0}f=a[p>>0]|0;f=f<<24>>24<0?c[n>>2]|0:f&255;if((c[u>>2]|0)==(b+f|0)){mO(x,f<<1,0);if((a[p>>0]|0)<0)b=(c[o>>2]&2147483647)+-1|0;else b=10;mO(x,b,0);b=(a[p>>0]|0)<0?c[x>>2]|0:x;c[u>>2]=b+f}k=j+12|0;f=c[k>>2]|0;l=j+16|0;if((f|0)==(c[l>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=hE(c[f>>2]|0)|0;if(RG(f,16,b,u,s,0,w,q,r,t)|0)break;f=c[k>>2]|0;if((f|0)==(c[l>>2]|0))Eb[c[(c[j>>2]|0)+40>>2]&127](j)|0;else{c[k>>2]=f+4;hE(c[f>>2]|0)|0}i=m}mO(x,(c[u>>2]|0)-b|0,0);t=(a[p>>0]|0)<0?c[x>>2]|0:x;u=YF()|0;c[v>>2]=h;if((ZF(t,u,49194,v)|0)!=1)c[g>>2]=4;if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[m>>2]|0)+36>>2]&127](j)|0;else b=hE(c[b>>2]|0)|0;if(HE(b,gE()|0)|0){c[d>>2]=0;f=1}else f=0}else f=1;do if(i){b=c[i+12>>2]|0;if((b|0)==(c[i+16>>2]|0))b=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else b=hE(c[b>>2]|0)|0;if(!(HE(b,gE()|0)|0))if(f)break;else{z=52;break}else{c[e>>2]=0;z=50;break}}else z=50;while(0);if((z|0)==50?f:0)z=52;if((z|0)==52)c[g>>2]=c[g>>2]|2;z=c[d>>2]|0;hO(x);hO(w);yb=y;return z|0}function RG(b,d,e,f,g,h,i,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0;o=c[f>>2]|0;p=(o|0)==(e|0);do if(p){m=(c[l+96>>2]|0)==(b|0);if(!m?(c[l+100>>2]|0)!=(b|0):0){n=5;break}c[f>>2]=e+1;a[e>>0]=m?43:45;c[g>>2]=0;m=0}else n=5;while(0);a:do if((n|0)==5){n=a[i+11>>0]|0;if((b|0)==(h|0)?((n<<24>>24<0?c[i+4>>2]|0:n&255)|0)!=0:0){m=c[k>>2]|0;if((m-j|0)>=160){m=0;break}f=c[g>>2]|0;c[k>>2]=m+4;c[m>>2]=f;c[g>>2]=0;m=0;break}i=l+104|0;h=0;while(1){m=l+(h<<2)|0;if((h|0)==26){m=i;break}if((c[m>>2]|0)==(b|0))break;else h=h+1|0}m=m-l|0;h=m>>2;if((m|0)>92)m=-1;else{switch(d|0){case 10:case 8:{if((h|0)>=(d|0)){m=-1;break a}break}case 16:{if((m|0)>=88){if(p){m=-1;break a}if((o-e|0)>=3){m=-1;break a}if((a[o+-1>>0]|0)!=48){m=-1;break a}c[g>>2]=0;m=a[12928+h>>0]|0;c[f>>2]=o+1;a[o>>0]=m;m=0;break a}break}default:{}}m=a[12928+h>>0]|0;c[f>>2]=o+1;a[o>>0]=m;c[g>>2]=(c[g>>2]|0)+1;m=0}}while(0);return m|0}function SG(b,d,e,f,h,i){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|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=yb;yb=yb+336|0;s=D+160|0;t=D+328|0;u=D+324|0;C=D+312|0;B=D+300|0;v=D+296|0;w=D;x=D+292|0;y=D+288|0;z=D+333|0;r=D+332|0;TG(C,f,s,t,u);c[B>>2]=0;c[B+4>>2]=0;c[B+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[B+(b<<2)>>2]=0;b=b+1|0}p=B+11|0;q=B+8|0;if((a[p>>0]|0)<0)b=(c[q>>2]&2147483647)+-1|0;else b=10;mO(B,b,0);b=(a[p>>0]|0)<0?c[B>>2]|0:B;c[v>>2]=b;c[x>>2]=w;c[y>>2]=0;a[z>>0]=1;a[r>>0]=69;o=B+4|0;k=c[d>>2]|0;j=k;a:while(1){if(k){f=c[k+12>>2]|0;if((f|0)==(c[k+16>>2]|0))f=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else f=hE(c[f>>2]|0)|0;if(HE(f,gE()|0)|0){c[d>>2]=0;n=0;l=1;k=0}else{n=j;l=0}}else{n=0;l=1;k=0}j=c[e>>2]|0;do if(j){f=c[j+12>>2]|0;if((f|0)==(c[j+16>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=hE(c[f>>2]|0)|0;if(!(HE(f,gE()|0)|0))if(l)break;else break a;else{c[e>>2]=0;E=19;break}}else E=19;while(0);if((E|0)==19){E=0;if(l){j=0;break}else j=0}f=a[p>>0]|0;f=f<<24>>24<0?c[o>>2]|0:f&255;if((c[v>>2]|0)==(b+f|0)){mO(B,f<<1,0);if((a[p>>0]|0)<0)b=(c[q>>2]&2147483647)+-1|0;else b=10;mO(B,b,0);b=(a[p>>0]|0)<0?c[B>>2]|0:B;c[v>>2]=b+f}l=k+12|0;f=c[l>>2]|0;m=k+16|0;if((f|0)==(c[m>>2]|0))f=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else f=hE(c[f>>2]|0)|0;if(UG(f,z,r,b,v,c[t>>2]|0,c[u>>2]|0,C,w,x,y,s)|0)break;f=c[l>>2]|0;if((f|0)==(c[m>>2]|0))Eb[c[(c[k>>2]|0)+40>>2]&127](k)|0;else{c[l>>2]=f+4;hE(c[f>>2]|0)|0}j=n}u=a[C+11>>0]|0;if(!((a[z>>0]|0)==0?1:((u<<24>>24<0?c[C+4>>2]|0:u&255)|0)==0)?(A=c[x>>2]|0,(A-w|0)<160):0){z=c[y>>2]|0;c[x>>2]=A+4;c[A>>2]=z}g[i>>3]=+hG(b,c[v>>2]|0,h);iG(C,w,c[x>>2]|0,h);if(k){b=c[k+12>>2]|0;if((b|0)==(c[k+16>>2]|0))b=Eb[c[(c[n>>2]|0)+36>>2]&127](k)|0;else b=hE(c[b>>2]|0)|0;if(HE(b,gE()|0)|0){c[d>>2]=0;f=1}else f=0}else f=1;do if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else b=hE(c[b>>2]|0)|0;if(!(HE(b,gE()|0)|0))if(f)break;else{E=50;break}else{c[e>>2]=0;E=48;break}}else E=48;while(0);if((E|0)==48?f:0)E=50;if((E|0)==50)c[h>>2]=c[h>>2]|2;E=c[d>>2]|0;hO(B);hO(C);yb=D;return E|0}function TG(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=yb;yb=yb+16|0;h=g;GE(h,b);b=VF(h,56768)|0;Ib[c[(c[b>>2]|0)+48>>2]&15](b,12928,12960,d)|0;d=VF(h,56776)|0;c[e>>2]=Eb[c[(c[d>>2]|0)+12>>2]&127](d)|0;c[f>>2]=Eb[c[(c[d>>2]|0)+16>>2]&127](d)|0;Sb[c[(c[d>>2]|0)+20>>2]&63](a,d);WF(h);yb=g;return}function UG(b,d,e,f,g,h,i,j,k,l,m,n){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;var o=0,p=0;a:do if((b|0)==(h|0))if(a[d>>0]|0){a[d>>0]=0;e=c[g>>2]|0;c[g>>2]=e+1;a[e>>0]=46;g=a[j+11>>0]|0;if(((g<<24>>24<0?c[j+4>>2]|0:g&255)|0)!=0?(o=c[l>>2]|0,(o-k|0)<160):0){k=c[m>>2]|0;c[l>>2]=o+4;c[o>>2]=k;o=0}else o=0}else o=-1;else{if((b|0)==(i|0)?(i=a[j+11>>0]|0,(i<<24>>24<0?c[j+4>>2]|0:i&255)|0):0){if(!(a[d>>0]|0)){o=-1;break}o=c[l>>2]|0;if((o-k|0)>=160){o=0;break}k=c[m>>2]|0;c[l>>2]=o+4;c[o>>2]=k;c[m>>2]=0;o=0;break}i=n+128|0;h=0;while(1){o=n+(h<<2)|0;if((h|0)==32){o=i;break}if((c[o>>2]|0)==(b|0))break;else h=h+1|0}h=o-n|0;if((h|0)<=124){i=a[12928+(h>>2)>>0]|0;n=h+-88|0;switch(n>>>2|n<<30|0){case 2:case 3:{o=c[g>>2]|0;if((o|0)!=(f|0)?(a[o+-1>>0]&95)!=(a[e>>0]&127):0){o=-1;break a}c[g>>2]=o+1;a[o>>0]=i;o=0;break a}case 1:case 0:{a[e>>0]=80;break}default:{o=i&95;if((((o|0)==(a[e>>0]|0)?(a[e>>0]=o|128,a[d>>0]|0):0)?(a[d>>0]=0,e=a[j+11>>0]|0,(e<<24>>24<0?c[j+4>>2]|0:e&255)|0):0)?(p=c[l>>2]|0,(p-k|0)<160):0){k=c[m>>2]|0;c[l>>2]=p+4;c[p>>2]=k}}}l=c[g>>2]|0;c[g>>2]=l+1;a[l>>0]=i;if((h|0)>84)o=0;else{c[m>>2]=(c[m>>2]|0)+1;o=0}}else o=-1}while(0);return o|0}function VG(b,d,e,f,h,i){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|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=yb;yb=yb+336|0;s=D+160|0;t=D+328|0;u=D+324|0;C=D+312|0;B=D+300|0;v=D+296|0;w=D;x=D+292|0;y=D+288|0;z=D+333|0;r=D+332|0;TG(C,f,s,t,u);c[B>>2]=0;c[B+4>>2]=0;c[B+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[B+(b<<2)>>2]=0;b=b+1|0}p=B+11|0;q=B+8|0;if((a[p>>0]|0)<0)b=(c[q>>2]&2147483647)+-1|0;else b=10;mO(B,b,0);b=(a[p>>0]|0)<0?c[B>>2]|0:B;c[v>>2]=b;c[x>>2]=w;c[y>>2]=0;a[z>>0]=1;a[r>>0]=69;o=B+4|0;k=c[d>>2]|0;j=k;a:while(1){if(k){f=c[k+12>>2]|0;if((f|0)==(c[k+16>>2]|0))f=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else f=hE(c[f>>2]|0)|0;if(HE(f,gE()|0)|0){c[d>>2]=0;n=0;l=1;k=0}else{n=j;l=0}}else{n=0;l=1;k=0}j=c[e>>2]|0;do if(j){f=c[j+12>>2]|0;if((f|0)==(c[j+16>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=hE(c[f>>2]|0)|0;if(!(HE(f,gE()|0)|0))if(l)break;else break a;else{c[e>>2]=0;E=19;break}}else E=19;while(0);if((E|0)==19){E=0;if(l){j=0;break}else j=0}f=a[p>>0]|0;f=f<<24>>24<0?c[o>>2]|0:f&255;if((c[v>>2]|0)==(b+f|0)){mO(B,f<<1,0);if((a[p>>0]|0)<0)b=(c[q>>2]&2147483647)+-1|0;else b=10;mO(B,b,0);b=(a[p>>0]|0)<0?c[B>>2]|0:B;c[v>>2]=b+f}l=k+12|0;f=c[l>>2]|0;m=k+16|0;if((f|0)==(c[m>>2]|0))f=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else f=hE(c[f>>2]|0)|0;if(UG(f,z,r,b,v,c[t>>2]|0,c[u>>2]|0,C,w,x,y,s)|0)break;f=c[l>>2]|0;if((f|0)==(c[m>>2]|0))Eb[c[(c[k>>2]|0)+40>>2]&127](k)|0;else{c[l>>2]=f+4;hE(c[f>>2]|0)|0}j=n}u=a[C+11>>0]|0;if(!((a[z>>0]|0)==0?1:((u<<24>>24<0?c[C+4>>2]|0:u&255)|0)==0)?(A=c[x>>2]|0,(A-w|0)<160):0){z=c[y>>2]|0;c[x>>2]=A+4;c[A>>2]=z}g[i>>3]=+kG(b,c[v>>2]|0,h);iG(C,w,c[x>>2]|0,h);if(k){b=c[k+12>>2]|0;if((b|0)==(c[k+16>>2]|0))b=Eb[c[(c[n>>2]|0)+36>>2]&127](k)|0;else b=hE(c[b>>2]|0)|0;if(HE(b,gE()|0)|0){c[d>>2]=0;f=1}else f=0}else f=1;do if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else b=hE(c[b>>2]|0)|0;if(!(HE(b,gE()|0)|0))if(f)break;else{E=50;break}else{c[e>>2]=0;E=48;break}}else E=48;while(0);if((E|0)==48?f:0)E=50;if((E|0)==50)c[h>>2]=c[h>>2]|2;E=c[d>>2]|0;hO(B);hO(C);yb=D;return E|0}function WG(b,d,e,g,h,i){b=b|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|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=yb;yb=yb+336|0;s=D+160|0;t=D+328|0;u=D+324|0;C=D+312|0;B=D+300|0;v=D+296|0;w=D;x=D+292|0;y=D+288|0;z=D+333|0;r=D+332|0;TG(C,g,s,t,u);c[B>>2]=0;c[B+4>>2]=0;c[B+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[B+(b<<2)>>2]=0;b=b+1|0}p=B+11|0;q=B+8|0;if((a[p>>0]|0)<0)b=(c[q>>2]&2147483647)+-1|0;else b=10;mO(B,b,0);b=(a[p>>0]|0)<0?c[B>>2]|0:B;c[v>>2]=b;c[x>>2]=w;c[y>>2]=0;a[z>>0]=1;a[r>>0]=69;o=B+4|0;k=c[d>>2]|0;j=k;a:while(1){if(k){g=c[k+12>>2]|0;if((g|0)==(c[k+16>>2]|0))g=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else g=hE(c[g>>2]|0)|0;if(HE(g,gE()|0)|0){c[d>>2]=0;n=0;l=1;k=0}else{n=j;l=0}}else{n=0;l=1;k=0}j=c[e>>2]|0;do if(j){g=c[j+12>>2]|0;if((g|0)==(c[j+16>>2]|0))g=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else g=hE(c[g>>2]|0)|0;if(!(HE(g,gE()|0)|0))if(l)break;else break a;else{c[e>>2]=0;E=19;break}}else E=19;while(0);if((E|0)==19){E=0;if(l){j=0;break}else j=0}g=a[p>>0]|0;g=g<<24>>24<0?c[o>>2]|0:g&255;if((c[v>>2]|0)==(b+g|0)){mO(B,g<<1,0);if((a[p>>0]|0)<0)b=(c[q>>2]&2147483647)+-1|0;else b=10;mO(B,b,0);b=(a[p>>0]|0)<0?c[B>>2]|0:B;c[v>>2]=b+g}l=k+12|0;g=c[l>>2]|0;m=k+16|0;if((g|0)==(c[m>>2]|0))g=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else g=hE(c[g>>2]|0)|0;if(UG(g,z,r,b,v,c[t>>2]|0,c[u>>2]|0,C,w,x,y,s)|0)break;g=c[l>>2]|0;if((g|0)==(c[m>>2]|0))Eb[c[(c[k>>2]|0)+40>>2]&127](k)|0;else{c[l>>2]=g+4;hE(c[g>>2]|0)|0}j=n}u=a[C+11>>0]|0;if(!((a[z>>0]|0)==0?1:((u<<24>>24<0?c[C+4>>2]|0:u&255)|0)==0)?(A=c[x>>2]|0,(A-w|0)<160):0){z=c[y>>2]|0;c[x>>2]=A+4;c[A>>2]=z}f[i>>2]=+mG(b,c[v>>2]|0,h);iG(C,w,c[x>>2]|0,h);if(k){b=c[k+12>>2]|0;if((b|0)==(c[k+16>>2]|0))b=Eb[c[(c[n>>2]|0)+36>>2]&127](k)|0;else b=hE(c[b>>2]|0)|0;if(HE(b,gE()|0)|0){c[d>>2]=0;g=1}else g=0}else g=1;do if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else b=hE(c[b>>2]|0)|0;if(!(HE(b,gE()|0)|0))if(g)break;else{E=50;break}else{c[e>>2]=0;E=48;break}}else E=48;while(0);if((E|0)==48?g:0)E=50;if((E|0)==50)c[h>>2]=c[h>>2]|2;E=c[d>>2]|0;hO(B);hO(C);yb=D;return E|0}function XG(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 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;B=yb;yb=yb+304|0;r=B+300|0;y=B+288|0;z=B+276|0;s=B+272|0;t=B;v=B+268|0;w=B+264|0;x=oG(f)|0;q=YG(b,f,B+160|0)|0;ZG(y,f,r);c[z>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[z+(b<<2)>>2]=0;b=b+1|0}o=z+11|0;p=z+8|0;if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b;c[v>>2]=t;c[w>>2]=0;n=z+4|0;j=c[d>>2]|0;i=j;a:while(1){if(j){f=c[j+12>>2]|0;if((f|0)==(c[j+16>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=hE(c[f>>2]|0)|0;if(HE(f,gE()|0)|0){c[d>>2]=0;m=0;k=1;j=0}else{m=i;k=0}}else{m=0;k=1;j=0}i=c[e>>2]|0;do if(i){f=c[i+12>>2]|0;if((f|0)==(c[i+16>>2]|0))f=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else f=hE(c[f>>2]|0)|0;if(!(HE(f,gE()|0)|0))if(k)break;else break a;else{c[e>>2]=0;A=19;break}}else A=19;while(0);if((A|0)==19){A=0;if(k){i=0;break}else i=0}f=a[o>>0]|0;f=f<<24>>24<0?c[n>>2]|0:f&255;if((c[s>>2]|0)==(b+f|0)){mO(z,f<<1,0);if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b+f}k=j+12|0;f=c[k>>2]|0;l=j+16|0;if((f|0)==(c[l>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=hE(c[f>>2]|0)|0;if(RG(f,x,b,s,w,c[r>>2]|0,y,t,v,q)|0)break;f=c[k>>2]|0;if((f|0)==(c[l>>2]|0))Eb[c[(c[j>>2]|0)+40>>2]&127](j)|0;else{c[k>>2]=f+4;hE(c[f>>2]|0)|0}i=m}r=a[y+11>>0]|0;if((r<<24>>24<0?c[y+4>>2]|0:r&255)|0?(u=c[v>>2]|0,(u-t|0)<160):0){w=c[w>>2]|0;c[v>>2]=u+4;c[u>>2]=w}w=rG(b,c[s>>2]|0,g,x)|0;x=F()|0;c[h>>2]=w;c[h+4>>2]=x;iG(y,t,c[v>>2]|0,g);if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[m>>2]|0)+36>>2]&127](j)|0;else b=hE(c[b>>2]|0)|0;if(HE(b,gE()|0)|0){c[d>>2]=0;f=1}else f=0}else f=1;do if(i){b=c[i+12>>2]|0;if((b|0)==(c[i+16>>2]|0))b=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else b=hE(c[b>>2]|0)|0;if(!(HE(b,gE()|0)|0))if(f)break;else{A=50;break}else{c[e>>2]=0;A=48;break}}else A=48;while(0);if((A|0)==48?f:0)A=50;if((A|0)==50)c[g>>2]=c[g>>2]|2;A=c[d>>2]|0;hO(z);hO(y);yb=B;return A|0}function YG(a,b,c){a=a|0;b=b|0;c=c|0;return _G(a,b,c)|0}function ZG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=yb;yb=yb+16|0;f=e;GE(f,b);b=VF(f,56776)|0;c[d>>2]=Eb[c[(c[b>>2]|0)+16>>2]&127](b)|0;Sb[c[(c[b>>2]|0)+20>>2]&63](a,b);WF(f);yb=e;return}function _G(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;a=yb;yb=yb+16|0;e=a;GE(e,b);b=VF(e,56768)|0;Ib[c[(c[b>>2]|0)+48>>2]&15](b,12928,12954,d)|0;WF(e);yb=a;return d|0}function $G(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 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;B=yb;yb=yb+304|0;r=B+300|0;y=B+288|0;z=B+276|0;s=B+272|0;t=B;v=B+268|0;w=B+264|0;x=oG(f)|0;q=YG(b,f,B+160|0)|0;ZG(y,f,r);c[z>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[z+(b<<2)>>2]=0;b=b+1|0}o=z+11|0;p=z+8|0;if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b;c[v>>2]=t;c[w>>2]=0;n=z+4|0;j=c[d>>2]|0;i=j;a:while(1){if(j){f=c[j+12>>2]|0;if((f|0)==(c[j+16>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=hE(c[f>>2]|0)|0;if(HE(f,gE()|0)|0){c[d>>2]=0;m=0;k=1;j=0}else{m=i;k=0}}else{m=0;k=1;j=0}i=c[e>>2]|0;do if(i){f=c[i+12>>2]|0;if((f|0)==(c[i+16>>2]|0))f=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else f=hE(c[f>>2]|0)|0;if(!(HE(f,gE()|0)|0))if(k)break;else break a;else{c[e>>2]=0;A=19;break}}else A=19;while(0);if((A|0)==19){A=0;if(k){i=0;break}else i=0}f=a[o>>0]|0;f=f<<24>>24<0?c[n>>2]|0:f&255;if((c[s>>2]|0)==(b+f|0)){mO(z,f<<1,0);if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b+f}k=j+12|0;f=c[k>>2]|0;l=j+16|0;if((f|0)==(c[l>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=hE(c[f>>2]|0)|0;if(RG(f,x,b,s,w,c[r>>2]|0,y,t,v,q)|0)break;f=c[k>>2]|0;if((f|0)==(c[l>>2]|0))Eb[c[(c[j>>2]|0)+40>>2]&127](j)|0;else{c[k>>2]=f+4;hE(c[f>>2]|0)|0}i=m}r=a[y+11>>0]|0;if((r<<24>>24<0?c[y+4>>2]|0:r&255)|0?(u=c[v>>2]|0,(u-t|0)<160):0){w=c[w>>2]|0;c[v>>2]=u+4;c[u>>2]=w}c[h>>2]=uG(b,c[s>>2]|0,g,x)|0;iG(y,t,c[v>>2]|0,g);if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[m>>2]|0)+36>>2]&127](j)|0;else b=hE(c[b>>2]|0)|0;if(HE(b,gE()|0)|0){c[d>>2]=0;f=1}else f=0}else f=1;do if(i){b=c[i+12>>2]|0;if((b|0)==(c[i+16>>2]|0))b=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else b=hE(c[b>>2]|0)|0;if(!(HE(b,gE()|0)|0))if(f)break;else{A=50;break}else{c[e>>2]=0;A=48;break}}else A=48;while(0);if((A|0)==48?f:0)A=50;if((A|0)==50)c[g>>2]=c[g>>2]|2;A=c[d>>2]|0;hO(z);hO(y);yb=B;return A|0}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 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;B=yb;yb=yb+304|0;r=B+300|0;y=B+288|0;z=B+276|0;s=B+272|0;t=B;v=B+268|0;w=B+264|0;x=oG(f)|0;q=YG(b,f,B+160|0)|0;ZG(y,f,r);c[z>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[z+(b<<2)>>2]=0;b=b+1|0}o=z+11|0;p=z+8|0;if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b;c[v>>2]=t;c[w>>2]=0;n=z+4|0;j=c[d>>2]|0;i=j;a:while(1){if(j){f=c[j+12>>2]|0;if((f|0)==(c[j+16>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=hE(c[f>>2]|0)|0;if(HE(f,gE()|0)|0){c[d>>2]=0;m=0;k=1;j=0}else{m=i;k=0}}else{m=0;k=1;j=0}i=c[e>>2]|0;do if(i){f=c[i+12>>2]|0;if((f|0)==(c[i+16>>2]|0))f=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else f=hE(c[f>>2]|0)|0;if(!(HE(f,gE()|0)|0))if(k)break;else break a;else{c[e>>2]=0;A=19;break}}else A=19;while(0);if((A|0)==19){A=0;if(k){i=0;break}else i=0}f=a[o>>0]|0;f=f<<24>>24<0?c[n>>2]|0:f&255;if((c[s>>2]|0)==(b+f|0)){mO(z,f<<1,0);if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b+f}k=j+12|0;f=c[k>>2]|0;l=j+16|0;if((f|0)==(c[l>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=hE(c[f>>2]|0)|0;if(RG(f,x,b,s,w,c[r>>2]|0,y,t,v,q)|0)break;f=c[k>>2]|0;if((f|0)==(c[l>>2]|0))Eb[c[(c[j>>2]|0)+40>>2]&127](j)|0;else{c[k>>2]=f+4;hE(c[f>>2]|0)|0}i=m}r=a[y+11>>0]|0;if((r<<24>>24<0?c[y+4>>2]|0:r&255)|0?(u=c[v>>2]|0,(u-t|0)<160):0){w=c[w>>2]|0;c[v>>2]=u+4;c[u>>2]=w}c[h>>2]=wG(b,c[s>>2]|0,g,x)|0;iG(y,t,c[v>>2]|0,g);if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[m>>2]|0)+36>>2]&127](j)|0;else b=hE(c[b>>2]|0)|0;if(HE(b,gE()|0)|0){c[d>>2]=0;f=1}else f=0}else f=1;do if(i){b=c[i+12>>2]|0;if((b|0)==(c[i+16>>2]|0))b=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else b=hE(c[b>>2]|0)|0;if(!(HE(b,gE()|0)|0))if(f)break;else{A=50;break}else{c[e>>2]=0;A=48;break}}else A=48;while(0);if((A|0)==48?f:0)A=50;if((A|0)==50)c[g>>2]=c[g>>2]|2;A=c[d>>2]|0;hO(z);hO(y);yb=B;return A|0}function bH(d,e,f,g,h,i){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;C=yb;yb=yb+304|0;s=C+300|0;z=C+288|0;A=C+276|0;t=C+272|0;u=C;w=C+268|0;x=C+264|0;y=oG(g)|0;r=YG(d,g,C+160|0)|0;ZG(z,g,s);c[A>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;d=0;while(1){if((d|0)==3)break;c[A+(d<<2)>>2]=0;d=d+1|0}p=A+11|0;q=A+8|0;if((a[p>>0]|0)<0)d=(c[q>>2]&2147483647)+-1|0;else d=10;mO(A,d,0);d=(a[p>>0]|0)<0?c[A>>2]|0:A;c[t>>2]=d;c[w>>2]=u;c[x>>2]=0;o=A+4|0;k=c[e>>2]|0;j=k;a:while(1){if(k){g=c[k+12>>2]|0;if((g|0)==(c[k+16>>2]|0))g=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else g=hE(c[g>>2]|0)|0;if(HE(g,gE()|0)|0){c[e>>2]=0;n=0;l=1;k=0}else{n=j;l=0}}else{n=0;l=1;k=0}j=c[f>>2]|0;do if(j){g=c[j+12>>2]|0;if((g|0)==(c[j+16>>2]|0))g=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else g=hE(c[g>>2]|0)|0;if(!(HE(g,gE()|0)|0))if(l)break;else break a;else{c[f>>2]=0;B=19;break}}else B=19;while(0);if((B|0)==19){B=0;if(l){j=0;break}else j=0}g=a[p>>0]|0;g=g<<24>>24<0?c[o>>2]|0:g&255;if((c[t>>2]|0)==(d+g|0)){mO(A,g<<1,0);if((a[p>>0]|0)<0)d=(c[q>>2]&2147483647)+-1|0;else d=10;mO(A,d,0);d=(a[p>>0]|0)<0?c[A>>2]|0:A;c[t>>2]=d+g}l=k+12|0;g=c[l>>2]|0;m=k+16|0;if((g|0)==(c[m>>2]|0))g=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else g=hE(c[g>>2]|0)|0;if(RG(g,y,d,t,x,c[s>>2]|0,z,u,w,r)|0)break;g=c[l>>2]|0;if((g|0)==(c[m>>2]|0))Eb[c[(c[k>>2]|0)+40>>2]&127](k)|0;else{c[l>>2]=g+4;hE(c[g>>2]|0)|0}j=n}s=a[z+11>>0]|0;if((s<<24>>24<0?c[z+4>>2]|0:s&255)|0?(v=c[w>>2]|0,(v-u|0)<160):0){x=c[x>>2]|0;c[w>>2]=v+4;c[v>>2]=x}b[i>>1]=yG(d,c[t>>2]|0,h,y)|0;iG(z,u,c[w>>2]|0,h);if(k){d=c[k+12>>2]|0;if((d|0)==(c[k+16>>2]|0))d=Eb[c[(c[n>>2]|0)+36>>2]&127](k)|0;else d=hE(c[d>>2]|0)|0;if(HE(d,gE()|0)|0){c[e>>2]=0;g=1}else g=0}else g=1;do if(j){d=c[j+12>>2]|0;if((d|0)==(c[j+16>>2]|0))d=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else d=hE(c[d>>2]|0)|0;if(!(HE(d,gE()|0)|0))if(g)break;else{B=50;break}else{c[f>>2]=0;B=48;break}}else B=48;while(0);if((B|0)==48?g:0)B=50;if((B|0)==50)c[h>>2]=c[h>>2]|2;B=c[e>>2]|0;hO(A);hO(z);yb=C;return B|0}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 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;B=yb;yb=yb+304|0;r=B+300|0;y=B+288|0;z=B+276|0;s=B+272|0;t=B;v=B+268|0;w=B+264|0;x=oG(f)|0;q=YG(b,f,B+160|0)|0;ZG(y,f,r);c[z>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[z+(b<<2)>>2]=0;b=b+1|0}o=z+11|0;p=z+8|0;if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b;c[v>>2]=t;c[w>>2]=0;n=z+4|0;j=c[d>>2]|0;i=j;a:while(1){if(j){f=c[j+12>>2]|0;if((f|0)==(c[j+16>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=hE(c[f>>2]|0)|0;if(HE(f,gE()|0)|0){c[d>>2]=0;m=0;k=1;j=0}else{m=i;k=0}}else{m=0;k=1;j=0}i=c[e>>2]|0;do if(i){f=c[i+12>>2]|0;if((f|0)==(c[i+16>>2]|0))f=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else f=hE(c[f>>2]|0)|0;if(!(HE(f,gE()|0)|0))if(k)break;else break a;else{c[e>>2]=0;A=19;break}}else A=19;while(0);if((A|0)==19){A=0;if(k){i=0;break}else i=0}f=a[o>>0]|0;f=f<<24>>24<0?c[n>>2]|0:f&255;if((c[s>>2]|0)==(b+f|0)){mO(z,f<<1,0);if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b+f}k=j+12|0;f=c[k>>2]|0;l=j+16|0;if((f|0)==(c[l>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=hE(c[f>>2]|0)|0;if(RG(f,x,b,s,w,c[r>>2]|0,y,t,v,q)|0)break;f=c[k>>2]|0;if((f|0)==(c[l>>2]|0))Eb[c[(c[j>>2]|0)+40>>2]&127](j)|0;else{c[k>>2]=f+4;hE(c[f>>2]|0)|0}i=m}r=a[y+11>>0]|0;if((r<<24>>24<0?c[y+4>>2]|0:r&255)|0?(u=c[v>>2]|0,(u-t|0)<160):0){w=c[w>>2]|0;c[v>>2]=u+4;c[u>>2]=w}w=AG(b,c[s>>2]|0,g,x)|0;x=F()|0;c[h>>2]=w;c[h+4>>2]=x;iG(y,t,c[v>>2]|0,g);if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[m>>2]|0)+36>>2]&127](j)|0;else b=hE(c[b>>2]|0)|0;if(HE(b,gE()|0)|0){c[d>>2]=0;f=1}else f=0}else f=1;do if(i){b=c[i+12>>2]|0;if((b|0)==(c[i+16>>2]|0))b=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else b=hE(c[b>>2]|0)|0;if(!(HE(b,gE()|0)|0))if(f)break;else{A=50;break}else{c[e>>2]=0;A=48;break}}else A=48;while(0);if((A|0)==48?f:0)A=50;if((A|0)==50)c[g>>2]=c[g>>2]|2;A=c[d>>2]|0;hO(z);hO(y);yb=B;return A|0}function dH(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 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;B=yb;yb=yb+304|0;r=B+300|0;y=B+288|0;z=B+276|0;s=B+272|0;t=B;v=B+268|0;w=B+264|0;x=oG(f)|0;q=YG(b,f,B+160|0)|0;ZG(y,f,r);c[z>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[z+(b<<2)>>2]=0;b=b+1|0}o=z+11|0;p=z+8|0;if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b;c[v>>2]=t;c[w>>2]=0;n=z+4|0;j=c[d>>2]|0;i=j;a:while(1){if(j){f=c[j+12>>2]|0;if((f|0)==(c[j+16>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=hE(c[f>>2]|0)|0;if(HE(f,gE()|0)|0){c[d>>2]=0;m=0;k=1;j=0}else{m=i;k=0}}else{m=0;k=1;j=0}i=c[e>>2]|0;do if(i){f=c[i+12>>2]|0;if((f|0)==(c[i+16>>2]|0))f=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else f=hE(c[f>>2]|0)|0;if(!(HE(f,gE()|0)|0))if(k)break;else break a;else{c[e>>2]=0;A=19;break}}else A=19;while(0);if((A|0)==19){A=0;if(k){i=0;break}else i=0}f=a[o>>0]|0;f=f<<24>>24<0?c[n>>2]|0:f&255;if((c[s>>2]|0)==(b+f|0)){mO(z,f<<1,0);if((a[o>>0]|0)<0)b=(c[p>>2]&2147483647)+-1|0;else b=10;mO(z,b,0);b=(a[o>>0]|0)<0?c[z>>2]|0:z;c[s>>2]=b+f}k=j+12|0;f=c[k>>2]|0;l=j+16|0;if((f|0)==(c[l>>2]|0))f=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else f=hE(c[f>>2]|0)|0;if(RG(f,x,b,s,w,c[r>>2]|0,y,t,v,q)|0)break;f=c[k>>2]|0;if((f|0)==(c[l>>2]|0))Eb[c[(c[j>>2]|0)+40>>2]&127](j)|0;else{c[k>>2]=f+4;hE(c[f>>2]|0)|0}i=m}r=a[y+11>>0]|0;if((r<<24>>24<0?c[y+4>>2]|0:r&255)|0?(u=c[v>>2]|0,(u-t|0)<160):0){w=c[w>>2]|0;c[v>>2]=u+4;c[u>>2]=w}c[h>>2]=CG(b,c[s>>2]|0,g,x)|0;iG(y,t,c[v>>2]|0,g);if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[m>>2]|0)+36>>2]&127](j)|0;else b=hE(c[b>>2]|0)|0;if(HE(b,gE()|0)|0){c[d>>2]=0;f=1}else f=0}else f=1;do if(i){b=c[i+12>>2]|0;if((b|0)==(c[i+16>>2]|0))b=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else b=hE(c[b>>2]|0)|0;if(!(HE(b,gE()|0)|0))if(f)break;else{A=50;break}else{c[e>>2]=0;A=48;break}}else A=48;while(0);if((A|0)==48?f:0)A=50;if((A|0)==50)c[g>>2]=c[g>>2]|2;A=c[d>>2]|0;hO(z);hO(y);yb=B;return A|0}function eH(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;w=yb;yb=yb+112|0;k=w;l=(f-e|0)/12|0;if(l>>>0>100){k=DO(l)|0;if(!k)_N();else{j=k;u=k}}else{j=k;u=0}k=0;n=e;o=j;while(1){if((n|0)==(f|0))break;m=a[n+8+3>>0]|0;if(m<<24>>24<0)m=c[n+4>>2]|0;else m=m&255;if(!m){a[o>>0]=2;k=k+1|0;l=l+-1|0}else a[o>>0]=1;n=n+12|0;o=o+1|0}t=0;r=k;while(1){k=c[b>>2]|0;do if(k){m=c[k+12>>2]|0;if((m|0)==(c[k+16>>2]|0))k=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else k=hE(c[m>>2]|0)|0;if(HE(k,gE()|0)|0){c[b>>2]=0;o=1;break}else{o=(c[b>>2]|0)==0;break}}else o=1;while(0);m=c[d>>2]|0;if(m){k=c[m+12>>2]|0;if((k|0)==(c[m+16>>2]|0))k=Eb[c[(c[m>>2]|0)+36>>2]&127](m)|0;else k=hE(c[k>>2]|0)|0;if(HE(k,gE()|0)|0){c[d>>2]=0;k=1;m=0}else k=0}else{k=1;m=0}n=c[b>>2]|0;if(!((l|0)!=0&(o^k)))break;k=c[n+12>>2]|0;if((k|0)==(c[n+16>>2]|0))k=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else k=hE(c[k>>2]|0)|0;if(!i)k=Gb[c[(c[g>>2]|0)+28>>2]&63](g,k)|0;s=t+1|0;p=e;o=0;q=j;while(1){if((p|0)==(f|0))break;do if((a[q>>0]|0)==1){n=p+8+3|0;if((a[n>>0]|0)<0)m=c[p>>2]|0;else m=p;m=c[m+(t<<2)>>2]|0;if(!i)m=Gb[c[(c[g>>2]|0)+28>>2]&63](g,m)|0;if((k|0)!=(m|0)){a[q>>0]=0;m=o;n=r;l=l+-1|0;break}m=a[n>>0]|0;if(m<<24>>24<0)m=c[p+4>>2]|0;else m=m&255;if((m|0)==(s|0)){a[q>>0]=2;m=1;n=r+1|0;l=l+-1|0}else{m=1;n=r}}else{m=o;n=r}while(0);p=p+12|0;o=m;q=q+1|0;r=n}a:do if(o){k=c[b>>2]|0;m=k+12|0;n=c[m>>2]|0;if((n|0)==(c[k+16>>2]|0))Eb[c[(c[k>>2]|0)+40>>2]&127](k)|0;else{c[m>>2]=n+4;hE(c[n>>2]|0)|0}if((r+l|0)>>>0>1){n=e;o=j;k=r;while(1){if((n|0)==(f|0))break a;if((a[o>>0]|0)==2){m=a[n+8+3>>0]|0;if(m<<24>>24<0)m=c[n+4>>2]|0;else m=m&255;if((m|0)!=(s|0)){a[o>>0]=0;k=k+-1|0}}n=n+12|0;o=o+1|0}}else k=r}else k=r;while(0);t=s;r=k}do if(n){k=c[n+12>>2]|0;if((k|0)==(c[n+16>>2]|0))k=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else k=hE(c[k>>2]|0)|0;if(HE(k,gE()|0)|0){c[b>>2]=0;l=1;break}else{l=(c[b>>2]|0)==0;break}}else l=1;while(0);do if(m){k=c[m+12>>2]|0;if((k|0)==(c[m+16>>2]|0))k=Eb[c[(c[m>>2]|0)+36>>2]&127](m)|0;else k=hE(c[k>>2]|0)|0;if(!(HE(k,gE()|0)|0))if(l)break;else{v=79;break}else{c[d>>2]=0;v=41;break}}else v=41;while(0);if((v|0)==41?l:0)v=79;if((v|0)==79)c[h>>2]=c[h>>2]|2;while(1){if((e|0)==(f|0)){v=84;break}if((a[j>>0]|0)==2)break;e=e+12|0;j=j+1|0}if((v|0)==84){c[h>>2]=c[h>>2]|4;e=f}EO(u);yb=w;return e|0}function fH(a){a=a|0;AF(a);return}function gH(a){a=a|0;AF(a);QA(a);return}function hH(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;l=yb;yb=yb+16|0;k=l+4|0;h=l;if(!(c[e+4>>2]&1)){j=c[(c[b>>2]|0)+24>>2]|0;c[h>>2]=c[d>>2];c[k>>2]=c[h>>2];b=Kb[j&31](b,k,e,f,g&1)|0}else{GE(k,e);b=VF(k,56752)|0;WF(k);e=c[b>>2]|0;if(g)Sb[c[e+24>>2]&63](k,b);else Sb[c[e+28>>2]&63](k,b);i=k+11|0;b=a[i>>0]|0;e=c[k>>2]|0;j=k+4|0;g=b<<24>>24<0?e:k;while(1){h=b<<24>>24<0;if((g|0)==((h?e:k)+(h?c[j>>2]|0:b&255)|0))break;b=a[g>>0]|0;e=c[d>>2]|0;if(e|0){f=e+24|0;h=c[f>>2]|0;if((h|0)==(c[e+28>>2]|0)){h=c[(c[e>>2]|0)+52>>2]|0;b=ag(b)|0;b=Gb[h&63](e,b)|0}else{c[f>>2]=h+1;a[h>>0]=b;b=ag(b)|0}if(Yf(b,Uf()|0)|0)c[d>>2]=0}g=g+1|0;b=a[i>>0]|0;e=c[k>>2]|0}b=c[d>>2]|0;hO(k)}yb=l;return b|0}function iH(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;b=yb;yb=yb+32|0;j=b;n=b+16|0;m=b+12|0;l=b+4|0;k=b+8|0;a[n>>0]=a[49415]|0;a[n+1>>0]=a[49416]|0;a[n+2>>0]=a[49417]|0;a[n+3>>0]=a[49418]|0;a[n+4>>0]=a[49419]|0;a[n+5>>0]=a[49420]|0;p=e+4|0;uH(n+1|0,49421,1,c[p>>2]|0);p=(c[p>>2]|0)>>>9&1;q=p+13|0;h=Na()|0;o=yb;yb=yb+((1*q|0)+15&-16)|0;i=YF()|0;c[j>>2]=g;g=o+(pH(o,q,i,n,j)|0)|0;n=qH(o,g,e)|0;i=yb;yb=yb+((1*((p<<1|24)+-1|0)|0)+15&-16)|0;GE(j,e);vH(o,n,g,i,m,l,j);WF(j);c[k>>2]=c[d>>2];d=c[m>>2]|0;g=c[l>>2]|0;c[j>>2]=c[k>>2];g=Zf(j,i,d,g,e,f)|0;Ma(h|0);yb=b;return g|0}function jH(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 h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;a=yb;yb=yb+32|0;j=a+8|0;i=a;m=a+24|0;l=a+16|0;k=a+20|0;o=i;c[o>>2]=37;c[o+4>>2]=0;o=d+4|0;uH(i+1|0,49412,1,c[o>>2]|0);o=(c[o>>2]|0)>>>9&1;q=o+23|0;h=Na()|0;n=yb;yb=yb+((1*q|0)+15&-16)|0;p=YF()|0;r=j;c[r>>2]=f;c[r+4>>2]=g;f=n+(pH(n,q,p,i,j)|0)|0;g=qH(n,f,d)|0;i=yb;yb=yb+((1*((o<<1|44)+-1|0)|0)+15&-16)|0;GE(j,d);vH(n,g,f,i,m,l,j);WF(j);c[k>>2]=c[b>>2];f=c[m>>2]|0;g=c[l>>2]|0;c[j>>2]=c[k>>2];g=Zf(j,i,f,g,d,e)|0;Ma(h|0);yb=a;return g|0}function kH(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;b=yb;yb=yb+32|0;j=b;n=b+16|0;m=b+12|0;l=b+4|0;k=b+8|0;a[n>>0]=a[49415]|0;a[n+1>>0]=a[49416]|0;a[n+2>>0]=a[49417]|0;a[n+3>>0]=a[49418]|0;a[n+4>>0]=a[49419]|0;a[n+5>>0]=a[49420]|0;p=e+4|0;uH(n+1|0,49421,0,c[p>>2]|0);p=(c[p>>2]|0)>>>9&1;q=p|12;h=Na()|0;o=yb;yb=yb+((1*q|0)+15&-16)|0;i=YF()|0;c[j>>2]=g;g=o+(pH(o,q,i,n,j)|0)|0;n=qH(o,g,e)|0;i=yb;yb=yb+((1*(p<<1|21)|0)+15&-16)|0;GE(j,e);vH(o,n,g,i,m,l,j);WF(j);c[k>>2]=c[d>>2];d=c[m>>2]|0;g=c[l>>2]|0;c[j>>2]=c[k>>2];g=Zf(j,i,d,g,e,f)|0;Ma(h|0);yb=b;return g|0}function lH(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 h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;a=yb;yb=yb+32|0;j=a+8|0;i=a;m=a+24|0;l=a+16|0;k=a+20|0;o=i;c[o>>2]=37;c[o+4>>2]=0;o=d+4|0;uH(i+1|0,49412,0,c[o>>2]|0);o=(c[o>>2]|0)>>>9&1|22;q=o+1|0;h=Na()|0;n=yb;yb=yb+((1*q|0)+15&-16)|0;p=YF()|0;r=j;c[r>>2]=f;c[r+4>>2]=g;f=n+(pH(n,q,p,i,j)|0)|0;g=qH(n,f,d)|0;i=yb;yb=yb+((1*((o<<1)+-1|0)|0)+15&-16)|0;GE(j,d);vH(n,g,f,i,m,l,j);WF(j);c[k>>2]=c[b>>2];f=c[m>>2]|0;g=c[l>>2]|0;c[j>>2]=c[k>>2];g=Zf(j,i,f,g,d,e)|0;Ma(h|0);yb=a;return g|0}function mH(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;var 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;v=yb;yb=yb+176|0;r=v+168|0;m=v+144|0;l=v+128|0;i=v+120|0;h=v+104|0;k=v+96|0;o=v+64|0;n=v+164|0;p=v;u=v+160|0;s=v+156|0;t=v+152|0;j=k;c[j>>2]=37;c[j+4>>2]=0;j=rH(k+1|0,57671,c[d+4>>2]|0)|0;c[n>>2]=o;a=YF()|0;if(j){c[h>>2]=c[d+8>>2];g[h+8>>3]=f;a=pH(o,30,a,k,h)|0}else{g[i>>3]=f;a=pH(o,30,a,k,i)|0}if((a|0)>29){a=YF()|0;if(j){c[l>>2]=c[d+8>>2];g[l+8>>3]=f;h=sH(n,a,k,l)|0}else{g[m>>3]=f;h=sH(n,a,k,m)|0}a=c[n>>2]|0;if(!a)_N();else{q=h;y=a;z=a}}else{q=a;y=0;z=c[n>>2]|0}h=z+q|0;i=qH(z,h,d)|0;if((z|0)!=(o|0)){a=DO(q<<1)|0;if(!a)_N();else{w=a;x=a}}else{w=p;x=0}GE(r,d);tH(z,i,h,w,u,s,r);WF(r);c[t>>2]=c[b>>2];b=c[u>>2]|0;z=c[s>>2]|0;c[r>>2]=c[t>>2];z=Zf(r,w,b,z,d,e)|0;EO(x);EO(y);yb=v;return z|0} +function nH(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;var 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;v=yb;yb=yb+176|0;r=v+168|0;m=v+144|0;l=v+128|0;i=v+120|0;h=v+104|0;k=v+96|0;o=v+64|0;n=v+164|0;p=v;u=v+160|0;s=v+156|0;t=v+152|0;j=k;c[j>>2]=37;c[j+4>>2]=0;j=rH(k+1|0,49410,c[d+4>>2]|0)|0;c[n>>2]=o;a=YF()|0;if(j){c[h>>2]=c[d+8>>2];g[h+8>>3]=f;a=pH(o,30,a,k,h)|0}else{g[i>>3]=f;a=pH(o,30,a,k,i)|0}if((a|0)>29){a=YF()|0;if(j){c[l>>2]=c[d+8>>2];g[l+8>>3]=f;h=sH(n,a,k,l)|0}else{g[m>>3]=f;h=sH(n,a,k,m)|0}a=c[n>>2]|0;if(!a)_N();else{q=h;y=a;z=a}}else{q=a;y=0;z=c[n>>2]|0}h=z+q|0;i=qH(z,h,d)|0;if((z|0)!=(o|0)){a=DO(q<<1)|0;if(!a)_N();else{w=a;x=a}}else{w=p;x=0}GE(r,d);tH(z,i,h,w,u,s,r);WF(r);c[t>>2]=c[b>>2];b=c[u>>2]|0;z=c[s>>2]|0;c[r>>2]=c[t>>2];z=Zf(r,w,b,z,d,e)|0;EO(x);EO(y);yb=v;return z|0}function oH(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;b=yb;yb=yb+96|0;l=b+72|0;k=b+80|0;h=b+48|0;j=b;m=b+76|0;a[k>>0]=a[49404]|0;a[k+1>>0]=a[49405]|0;a[k+2>>0]=a[49406]|0;a[k+3>>0]=a[49407]|0;a[k+4>>0]=a[49408]|0;a[k+5>>0]=a[49409]|0;i=YF()|0;c[l>>2]=g;g=pH(h,20,i,k,l)|0;k=h+g|0;i=qH(h,k,e)|0;GE(l,e);n=VF(l,56736)|0;WF(l);Ib[c[(c[n>>2]|0)+32>>2]&15](n,h,k,j)|0;g=j+g|0;c[m>>2]=c[d>>2];c[l>>2]=c[m>>2];g=Zf(l,j,(i|0)==(k|0)?g:j+(i-h)|0,g,e,f)|0;yb=b;return g|0}function pH(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=yb;yb=yb+16|0;h=g;c[h>>2]=f;f=cz(d)|0;d=Hx(a,b,e,h)|0;if(f|0)cz(f)|0;yb=g;return d|0}function qH(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;a:do switch((c[e+4>>2]&176)<<24>>24){case 16:{e=a[b>>0]|0;switch(e<<24>>24){case 43:case 45:{b=b+1|0;break a}default:{}}if((d-b|0)>1&e<<24>>24==48){switch(a[b+1>>0]|0){case 88:case 120:break;default:{f=7;break a}}b=b+2|0}else f=7;break}case 32:{b=d;break}default:f=7}while(0);return b|0}function rH(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0;if(d&2048){a[b>>0]=43;b=b+1|0}if(d&1024){a[b>>0]=35;b=b+1|0}g=d&260;e=d&16384;f=(g|0)==260;if(f)h=0;else{a[b>>0]=46;a[b+1>>0]=42;h=1;b=b+2|0}while(1){d=a[c>>0]|0;if(!(d<<24>>24))break;a[b>>0]=d;c=c+1|0;b=b+1|0}a:do switch(g&511){case 4:{d=e>>>9&255^102;break}case 256:{d=e>>>9&255^101;break}default:{d=e>>>9&255;if(f){d=d^97;break a}else{d=d^103;break a}}}while(0);a[b>>0]=d;return h|0}function sH(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=yb;yb=yb+16|0;g=f;c[g>>2]=e;e=cz(b)|0;b=$z(a,d,g)|0;if(e|0)cz(e)|0;yb=f;return b|0}function tH(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;v=yb;yb=yb+16|0;s=v;t=VF(i,56736)|0;r=VF(i,56752)|0;Sb[c[(c[r>>2]|0)+20>>2]&63](s,r);c[h>>2]=f;i=a[b>>0]|0;switch(i<<24>>24){case 43:case 45:{q=Gb[c[(c[t>>2]|0)+28>>2]&63](t,i)|0;j=c[h>>2]|0;c[h>>2]=j+1;a[j>>0]=q;j=b+1|0;break}default:j=b}q=e;a:do if((q-j|0)>1?(a[j>>0]|0)==48:0){i=j+1|0;switch(a[i>>0]|0){case 88:case 120:break;default:{u=4;break a}}o=Gb[c[(c[t>>2]|0)+28>>2]&63](t,48)|0;p=c[h>>2]|0;c[h>>2]=p+1;a[p>>0]=o;j=j+2|0;p=Gb[c[(c[t>>2]|0)+28>>2]&63](t,a[i>>0]|0)|0;i=c[h>>2]|0;c[h>>2]=i+1;a[i>>0]=p;i=j;while(1){if(i>>>0>=e>>>0)break a;p=a[i>>0]|0;if(!(Yy(p,YF()|0)|0))break a;i=i+1|0}}else u=4;while(0);b:do if((u|0)==4){i=j;while(1){if(i>>>0>=e>>>0)break b;p=a[i>>0]|0;if(!(Xy(p,YF()|0)|0))break b;i=i+1|0}}while(0);o=s+11|0;n=a[o>>0]|0;p=s+4|0;c:do if((n<<24>>24<0?c[p>>2]|0:n&255)|0){d:do if((j|0)!=(i|0)){k=i;l=j;while(1){k=k+-1|0;if(l>>>0>=k>>>0)break d;n=a[l>>0]|0;a[l>>0]=a[k>>0]|0;a[k>>0]=n;l=l+1|0}}while(0);n=Eb[c[(c[r>>2]|0)+16>>2]&127](r)|0;m=j;l=0;k=0;while(1){if(m>>>0>=i>>>0)break;w=a[((a[o>>0]|0)<0?c[s>>2]|0:s)+k>>0]|0;if(w<<24>>24>0&(l|0)==(w<<24>>24|0)){l=c[h>>2]|0;c[h>>2]=l+1;a[l>>0]=n;l=a[o>>0]|0;k=k+(k>>>0<((l<<24>>24<0?c[p>>2]|0:l&255)+-1|0)>>>0&1)|0;l=0}x=Gb[c[(c[t>>2]|0)+28>>2]&63](t,a[m>>0]|0)|0;w=c[h>>2]|0;c[h>>2]=w+1;a[w>>0]=x;m=m+1|0;l=l+1|0}k=f+(j-b)|0;j=c[h>>2]|0;if((k|0)==(j|0))k=t;else while(1){j=j+-1|0;if(k>>>0>=j>>>0){k=t;break c}x=a[k>>0]|0;a[k>>0]=a[j>>0]|0;a[j>>0]=x;k=k+1|0}}else{Ib[c[(c[t>>2]|0)+32>>2]&15](t,j,i,c[h>>2]|0)|0;c[h>>2]=(c[h>>2]|0)+(i-j);k=t}while(0);while(1){if(i>>>0>=e>>>0)break;j=a[i>>0]|0;if(j<<24>>24==46){u=32;break}w=Gb[c[(c[k>>2]|0)+28>>2]&63](t,j)|0;x=c[h>>2]|0;c[h>>2]=x+1;a[x>>0]=w;i=i+1|0}if((u|0)==32){w=Eb[c[(c[r>>2]|0)+12>>2]&127](r)|0;x=c[h>>2]|0;c[h>>2]=x+1;a[x>>0]=w;i=i+1|0}Ib[c[(c[t>>2]|0)+32>>2]&15](t,i,e,c[h>>2]|0)|0;x=(c[h>>2]|0)+(q-i)|0;c[h>>2]=x;c[g>>2]=(d|0)==(e|0)?x:f+(d-b)|0;hO(s);yb=v;return}function uH(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;var f=0;if(e&2048){a[b>>0]=43;b=b+1|0}if(e&512){a[b>>0]=35;b=b+1|0}f=b;while(1){b=a[c>>0]|0;if(!(b<<24>>24))break;a[f>>0]=b;c=c+1|0;f=f+1|0}switch(e&74){case 64:{b=111;break}case 8:{b=e>>>9&32^120;break}default:b=d?100:117}a[f>>0]=b;return}function vH(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;r=yb;yb=yb+16|0;q=r;p=VF(i,56736)|0;l=VF(i,56752)|0;Sb[c[(c[l>>2]|0)+20>>2]&63](q,l);n=q+11|0;m=a[n>>0]|0;o=q+4|0;if((m<<24>>24<0?c[o>>2]|0:m&255)|0){c[h>>2]=f;i=a[b>>0]|0;switch(i<<24>>24){case 43:case 45:{m=Gb[c[(c[p>>2]|0)+28>>2]&63](p,i)|0;i=c[h>>2]|0;c[h>>2]=i+1;a[i>>0]=m;i=b+1|0;break}default:i=b}a:do if((e-i|0)>1?(a[i>>0]|0)==48:0){j=i+1|0;switch(a[j>>0]|0){case 88:case 120:break;default:break a}m=Gb[c[(c[p>>2]|0)+28>>2]&63](p,48)|0;k=c[h>>2]|0;c[h>>2]=k+1;a[k>>0]=m;k=Gb[c[(c[p>>2]|0)+28>>2]&63](p,a[j>>0]|0)|0;m=c[h>>2]|0;c[h>>2]=m+1;a[m>>0]=k;i=i+2|0}while(0);b:do if((i|0)!=(e|0)){j=e;k=i;while(1){j=j+-1|0;if(k>>>0>=j>>>0)break b;m=a[k>>0]|0;a[k>>0]=a[j>>0]|0;a[j>>0]=m;k=k+1|0}}while(0);m=Eb[c[(c[l>>2]|0)+16>>2]&127](l)|0;l=i;j=0;k=0;while(1){if(l>>>0>=e>>>0)break;s=a[((a[n>>0]|0)<0?c[q>>2]|0:q)+j>>0]|0;if(s<<24>>24!=0&(k|0)==(s<<24>>24|0)){k=c[h>>2]|0;c[h>>2]=k+1;a[k>>0]=m;k=a[n>>0]|0;j=j+(j>>>0<((k<<24>>24<0?c[o>>2]|0:k&255)+-1|0)>>>0&1)|0;k=0}t=Gb[c[(c[p>>2]|0)+28>>2]&63](p,a[l>>0]|0)|0;s=c[h>>2]|0;c[h>>2]=s+1;a[s>>0]=t;l=l+1|0;k=k+1|0}i=f+(i-b)|0;j=c[h>>2]|0;if((i|0)!=(j|0)){while(1){j=j+-1|0;if(i>>>0>=j>>>0)break;t=a[i>>0]|0;a[i>>0]=a[j>>0]|0;a[j>>0]=t;i=i+1|0}i=c[h>>2]|0}}else{Ib[c[(c[p>>2]|0)+32>>2]&15](p,b,e,f)|0;i=f+(e-b)|0;c[h>>2]=i}c[g>>2]=(d|0)==(e|0)?i:f+(d-b)|0;hO(q);yb=r;return}function wH(a){a=a|0;AF(a);return}function xH(a){a=a|0;AF(a);QA(a);return}function yH(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;l=yb;yb=yb+16|0;k=l+4|0;h=l;if(!(c[e+4>>2]&1)){j=c[(c[b>>2]|0)+24>>2]|0;c[h>>2]=c[d>>2];c[k>>2]=c[h>>2];b=Kb[j&31](b,k,e,f,g&1)|0}else{GE(k,e);b=VF(k,56776)|0;WF(k);e=c[b>>2]|0;if(g)Sb[c[e+24>>2]&63](k,b);else Sb[c[e+28>>2]&63](k,b);i=k+8+3|0;b=a[i>>0]|0;e=c[k>>2]|0;j=k+4|0;g=b<<24>>24<0?e:k;while(1){h=b<<24>>24<0;if((g|0)==((h?e:k)+((h?c[j>>2]|0:b&255)<<2)|0))break;b=c[g>>2]|0;e=c[d>>2]|0;if(e|0){f=e+24|0;h=c[f>>2]|0;if((h|0)==(c[e+28>>2]|0)){h=c[(c[e>>2]|0)+52>>2]|0;b=hE(b)|0;b=Gb[h&63](e,b)|0}else{c[f>>2]=h+4;c[h>>2]=b;b=hE(b)|0}if(HE(b,gE()|0)|0)c[d>>2]=0}g=g+4|0;b=a[i>>0]|0;e=c[k>>2]|0}b=c[d>>2]|0;uO(k)}yb=l;return b|0}function zH(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;b=yb;yb=yb+32|0;j=b;n=b+16|0;m=b+12|0;l=b+4|0;k=b+8|0;a[n>>0]=a[49415]|0;a[n+1>>0]=a[49416]|0;a[n+2>>0]=a[49417]|0;a[n+3>>0]=a[49418]|0;a[n+4>>0]=a[49419]|0;a[n+5>>0]=a[49420]|0;p=e+4|0;uH(n+1|0,49421,1,c[p>>2]|0);p=(c[p>>2]|0)>>>9&1;q=p+13|0;h=Na()|0;o=yb;yb=yb+((1*q|0)+15&-16)|0;i=YF()|0;c[j>>2]=g;g=o+(pH(o,q,i,n,j)|0)|0;n=qH(o,g,e)|0;i=yb;yb=yb+((1*((p<<1|24)+-1<<2)|0)+15&-16)|0;GE(j,e);IH(o,n,g,i,m,l,j);WF(j);c[k>>2]=c[d>>2];d=c[m>>2]|0;g=c[l>>2]|0;c[j>>2]=c[k>>2];g=GH(j,i,d,g,e,f)|0;Ma(h|0);yb=b;return g|0}function AH(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 h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;a=yb;yb=yb+32|0;j=a+8|0;i=a;m=a+24|0;l=a+16|0;k=a+20|0;o=i;c[o>>2]=37;c[o+4>>2]=0;o=d+4|0;uH(i+1|0,49412,1,c[o>>2]|0);o=(c[o>>2]|0)>>>9&1;q=o+23|0;h=Na()|0;n=yb;yb=yb+((1*q|0)+15&-16)|0;p=YF()|0;r=j;c[r>>2]=f;c[r+4>>2]=g;f=n+(pH(n,q,p,i,j)|0)|0;g=qH(n,f,d)|0;i=yb;yb=yb+((1*((o<<1|44)+-1<<2)|0)+15&-16)|0;GE(j,d);IH(n,g,f,i,m,l,j);WF(j);c[k>>2]=c[b>>2];f=c[m>>2]|0;g=c[l>>2]|0;c[j>>2]=c[k>>2];g=GH(j,i,f,g,d,e)|0;Ma(h|0);yb=a;return g|0}function BH(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;b=yb;yb=yb+32|0;j=b;n=b+16|0;m=b+12|0;l=b+4|0;k=b+8|0;a[n>>0]=a[49415]|0;a[n+1>>0]=a[49416]|0;a[n+2>>0]=a[49417]|0;a[n+3>>0]=a[49418]|0;a[n+4>>0]=a[49419]|0;a[n+5>>0]=a[49420]|0;p=e+4|0;uH(n+1|0,49421,0,c[p>>2]|0);p=(c[p>>2]|0)>>>9&1;q=p|12;h=Na()|0;o=yb;yb=yb+((1*q|0)+15&-16)|0;i=YF()|0;c[j>>2]=g;g=o+(pH(o,q,i,n,j)|0)|0;n=qH(o,g,e)|0;i=yb;yb=yb+((1*((p<<1|21)<<2)|0)+15&-16)|0;GE(j,e);IH(o,n,g,i,m,l,j);WF(j);c[k>>2]=c[d>>2];d=c[m>>2]|0;g=c[l>>2]|0;c[j>>2]=c[k>>2];g=GH(j,i,d,g,e,f)|0;Ma(h|0);yb=b;return g|0}function CH(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 h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;a=yb;yb=yb+32|0;j=a+8|0;i=a;m=a+24|0;l=a+16|0;k=a+20|0;o=i;c[o>>2]=37;c[o+4>>2]=0;o=d+4|0;uH(i+1|0,49412,0,c[o>>2]|0);o=(c[o>>2]|0)>>>9&1|22;q=o+1|0;h=Na()|0;n=yb;yb=yb+((1*q|0)+15&-16)|0;p=YF()|0;r=j;c[r>>2]=f;c[r+4>>2]=g;f=n+(pH(n,q,p,i,j)|0)|0;g=qH(n,f,d)|0;i=yb;yb=yb+((1*((o<<1)+-1<<2)|0)+15&-16)|0;GE(j,d);IH(n,g,f,i,m,l,j);WF(j);c[k>>2]=c[b>>2];f=c[m>>2]|0;g=c[l>>2]|0;c[j>>2]=c[k>>2];g=GH(j,i,f,g,d,e)|0;Ma(h|0);yb=a;return g|0}function DH(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;var 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;x=yb;yb=yb+352|0;r=x+344|0;m=x+320|0;l=x+304|0;i=x+296|0;h=x+280|0;k=x+272|0;o=x+240|0;n=x+340|0;p=x;u=x+336|0;s=x+332|0;t=x+328|0;j=k;c[j>>2]=37;c[j+4>>2]=0;j=rH(k+1|0,57671,c[d+4>>2]|0)|0;c[n>>2]=o;a=YF()|0;if(j){c[h>>2]=c[d+8>>2];g[h+8>>3]=f;a=pH(o,30,a,k,h)|0}else{g[i>>3]=f;a=pH(o,30,a,k,i)|0}if((a|0)>29){a=YF()|0;if(j){c[l>>2]=c[d+8>>2];g[l+8>>3]=f;h=sH(n,a,k,l)|0}else{g[m>>3]=f;h=sH(n,a,k,m)|0}a=c[n>>2]|0;if(!a)_N();else{q=h;z=a;w=a}}else{q=a;z=0;w=c[n>>2]|0}h=w+q|0;i=qH(w,h,d)|0;do if((w|0)!=(o|0)){a=DO(q<<3)|0;if(!a)_N();else{v=a;y=0;A=a;break}}else{v=p;y=1;A=0}while(0);GE(r,d);HH(w,i,h,v,u,s,r);WF(r);c[t>>2]=c[b>>2];w=c[u>>2]|0;a=c[s>>2]|0;c[r>>2]=c[t>>2];a=GH(r,v,w,a,d,e)|0;c[b>>2]=a;if(!y)EO(A);EO(z);yb=x;return a|0}function EH(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;var 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;x=yb;yb=yb+352|0;r=x+344|0;m=x+320|0;l=x+304|0;i=x+296|0;h=x+280|0;k=x+272|0;o=x+240|0;n=x+340|0;p=x;u=x+336|0;s=x+332|0;t=x+328|0;j=k;c[j>>2]=37;c[j+4>>2]=0;j=rH(k+1|0,49410,c[d+4>>2]|0)|0;c[n>>2]=o;a=YF()|0;if(j){c[h>>2]=c[d+8>>2];g[h+8>>3]=f;a=pH(o,30,a,k,h)|0}else{g[i>>3]=f;a=pH(o,30,a,k,i)|0}if((a|0)>29){a=YF()|0;if(j){c[l>>2]=c[d+8>>2];g[l+8>>3]=f;h=sH(n,a,k,l)|0}else{g[m>>3]=f;h=sH(n,a,k,m)|0}a=c[n>>2]|0;if(!a)_N();else{q=h;z=a;w=a}}else{q=a;z=0;w=c[n>>2]|0}h=w+q|0;i=qH(w,h,d)|0;do if((w|0)!=(o|0)){a=DO(q<<3)|0;if(!a)_N();else{v=a;y=0;A=a;break}}else{v=p;y=1;A=0}while(0);GE(r,d);HH(w,i,h,v,u,s,r);WF(r);c[t>>2]=c[b>>2];w=c[u>>2]|0;a=c[s>>2]|0;c[r>>2]=c[t>>2];a=GH(r,v,w,a,d,e)|0;c[b>>2]=a;if(!y)EO(A);EO(z);yb=x;return a|0}function FH(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;b=yb;yb=yb+208|0;l=b+184|0;k=b+192|0;h=b+160|0;j=b;m=b+188|0;a[k>>0]=a[49404]|0;a[k+1>>0]=a[49405]|0;a[k+2>>0]=a[49406]|0;a[k+3>>0]=a[49407]|0;a[k+4>>0]=a[49408]|0;a[k+5>>0]=a[49409]|0;i=YF()|0;c[l>>2]=g;g=pH(h,20,i,k,l)|0;k=h+g|0;i=qH(h,k,e)|0;GE(l,e);n=VF(l,56768)|0;WF(l);Ib[c[(c[n>>2]|0)+48>>2]&15](n,h,k,j)|0;g=j+(g<<2)|0;c[m>>2]=c[d>>2];c[l>>2]=c[m>>2];g=GH(l,j,(i|0)==(k|0)?g:j+(i-h<<2)|0,g,e,f)|0;yb=b;return g|0}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 i=0,j=0,k=0,l=0,m=0,n=0,o=0;n=yb;yb=yb+16|0;m=n;i=c[b>>2]|0;a:do if(!i)i=0;else{o=d;j=f-o>>2;l=g+12|0;g=c[l>>2]|0;g=(g|0)>(j|0)?g-j|0:0;j=e;o=j-o|0;k=o>>2;if((o|0)>0?(Hb[c[(c[i>>2]|0)+48>>2]&63](i,d,k)|0)!=(k|0):0){c[b>>2]=0;i=0;break}do if((g|0)>0){c[m>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;sO(m,g,h);if((Hb[c[(c[i>>2]|0)+48>>2]&63](i,(a[m+8+3>>0]|0)<0?c[m>>2]|0:m,g)|0)==(g|0)){uO(m);break}else{c[b>>2]=0;uO(m);i=0;break a}}while(0);o=f-j|0;f=o>>2;if((o|0)>0?(Hb[c[(c[i>>2]|0)+48>>2]&63](i,e,f)|0)!=(f|0):0){c[b>>2]=0;i=0;break}c[l>>2]=0}while(0);yb=n;return i|0}function HH(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;v=yb;yb=yb+16|0;s=v;t=VF(i,56768)|0;q=VF(i,56776)|0;Sb[c[(c[q>>2]|0)+20>>2]&63](s,q);c[h>>2]=f;i=a[b>>0]|0;switch(i<<24>>24){case 43:case 45:{r=Gb[c[(c[t>>2]|0)+44>>2]&63](t,i)|0;i=c[h>>2]|0;c[h>>2]=i+4;c[i>>2]=r;i=b+1|0;break}default:i=b}r=e;a:do if((r-i|0)>1?(a[i>>0]|0)==48:0){j=i+1|0;switch(a[j>>0]|0){case 88:case 120:break;default:{u=4;break a}}o=Gb[c[(c[t>>2]|0)+44>>2]&63](t,48)|0;p=c[h>>2]|0;c[h>>2]=p+4;c[p>>2]=o;i=i+2|0;p=Gb[c[(c[t>>2]|0)+44>>2]&63](t,a[j>>0]|0)|0;j=c[h>>2]|0;c[h>>2]=j+4;c[j>>2]=p;j=i;while(1){if(j>>>0>=e>>>0)break a;p=a[j>>0]|0;if(!(Yy(p,YF()|0)|0))break a;j=j+1|0}}else u=4;while(0);b:do if((u|0)==4){j=i;while(1){if(j>>>0>=e>>>0)break b;p=a[j>>0]|0;if(!(Xy(p,YF()|0)|0))break b;j=j+1|0}}while(0);o=s+11|0;n=a[o>>0]|0;p=s+4|0;c:do if((n<<24>>24<0?c[p>>2]|0:n&255)|0){d:do if((i|0)!=(j|0)){k=j;l=i;while(1){k=k+-1|0;if(l>>>0>=k>>>0)break d;n=a[l>>0]|0;a[l>>0]=a[k>>0]|0;a[k>>0]=n;l=l+1|0}}while(0);n=Eb[c[(c[q>>2]|0)+16>>2]&127](q)|0;m=i;k=0;l=0;while(1){if(m>>>0>=j>>>0)break;w=a[((a[o>>0]|0)<0?c[s>>2]|0:s)+k>>0]|0;if(w<<24>>24>0&(l|0)==(w<<24>>24|0)){l=c[h>>2]|0;c[h>>2]=l+4;c[l>>2]=n;l=a[o>>0]|0;k=k+(k>>>0<((l<<24>>24<0?c[p>>2]|0:l&255)+-1|0)>>>0&1)|0;l=0}x=Gb[c[(c[t>>2]|0)+44>>2]&63](t,a[m>>0]|0)|0;w=c[h>>2]|0;c[h>>2]=w+4;c[w>>2]=x;m=m+1|0;l=l+1|0}i=f+(i-b<<2)|0;l=c[h>>2]|0;if((i|0)==(l|0))k=t;else{k=l;while(1){k=k+-4|0;if(i>>>0>=k>>>0){k=t;i=l;break c}x=c[i>>2]|0;c[i>>2]=c[k>>2];c[k>>2]=x;i=i+4|0}}}else{Ib[c[(c[t>>2]|0)+48>>2]&15](t,i,j,c[h>>2]|0)|0;i=(c[h>>2]|0)+(j-i<<2)|0;c[h>>2]=i;k=t}while(0);while(1){if(j>>>0>=e>>>0)break;i=a[j>>0]|0;if(i<<24>>24==46){u=32;break}w=Gb[c[(c[k>>2]|0)+44>>2]&63](t,i)|0;x=c[h>>2]|0;i=x+4|0;c[h>>2]=i;c[x>>2]=w;j=j+1|0}if((u|0)==32){w=Eb[c[(c[q>>2]|0)+12>>2]&127](q)|0;x=c[h>>2]|0;i=x+4|0;c[h>>2]=i;c[x>>2]=w;j=j+1|0}Ib[c[(c[t>>2]|0)+48>>2]&15](t,j,e,i)|0;x=(c[h>>2]|0)+(r-j<<2)|0;c[h>>2]=x;c[g>>2]=(d|0)==(e|0)?x:f+(d-b<<2)|0;hO(s);yb=v;return}function IH(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;r=yb;yb=yb+16|0;q=r;p=VF(i,56768)|0;l=VF(i,56776)|0;Sb[c[(c[l>>2]|0)+20>>2]&63](q,l);n=q+11|0;m=a[n>>0]|0;o=q+4|0;if((m<<24>>24<0?c[o>>2]|0:m&255)|0){c[h>>2]=f;i=a[b>>0]|0;switch(i<<24>>24){case 43:case 45:{m=Gb[c[(c[p>>2]|0)+44>>2]&63](p,i)|0;i=c[h>>2]|0;c[h>>2]=i+4;c[i>>2]=m;i=b+1|0;break}default:i=b}a:do if((e-i|0)>1?(a[i>>0]|0)==48:0){j=i+1|0;switch(a[j>>0]|0){case 88:case 120:break;default:break a}m=Gb[c[(c[p>>2]|0)+44>>2]&63](p,48)|0;k=c[h>>2]|0;c[h>>2]=k+4;c[k>>2]=m;k=Gb[c[(c[p>>2]|0)+44>>2]&63](p,a[j>>0]|0)|0;m=c[h>>2]|0;c[h>>2]=m+4;c[m>>2]=k;i=i+2|0}while(0);b:do if((i|0)!=(e|0)){j=e;k=i;while(1){j=j+-1|0;if(k>>>0>=j>>>0)break b;m=a[k>>0]|0;a[k>>0]=a[j>>0]|0;a[j>>0]=m;k=k+1|0}}while(0);m=Eb[c[(c[l>>2]|0)+16>>2]&127](l)|0;l=i;j=0;k=0;while(1){if(l>>>0>=e>>>0)break;s=a[((a[n>>0]|0)<0?c[q>>2]|0:q)+j>>0]|0;if(s<<24>>24!=0&(k|0)==(s<<24>>24|0)){k=c[h>>2]|0;c[h>>2]=k+4;c[k>>2]=m;k=a[n>>0]|0;j=j+(j>>>0<((k<<24>>24<0?c[o>>2]|0:k&255)+-1|0)>>>0&1)|0;k=0}t=Gb[c[(c[p>>2]|0)+44>>2]&63](p,a[l>>0]|0)|0;s=c[h>>2]|0;c[h>>2]=s+4;c[s>>2]=t;l=l+1|0;k=k+1|0}i=f+(i-b<<2)|0;j=c[h>>2]|0;if((i|0)!=(j|0)){while(1){j=j+-4|0;if(i>>>0>=j>>>0)break;t=c[i>>2]|0;c[i>>2]=c[j>>2];c[j>>2]=t;i=i+4|0}i=c[h>>2]|0}}else{Ib[c[(c[p>>2]|0)+48>>2]&15](p,b,e,f)|0;i=f+(e-b<<2)|0;c[h>>2]=i}c[g>>2]=(d|0)==(e|0)?i:f+(d-b<<2)|0;hO(q);yb=r;return}function JH(a){a=a|0;AF(a);return}function KH(a){a=a|0;AF(a);QA(a);return}function LH(a){a=a|0;return 2}function MH(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=cI(a,j,i,e,f,g,49940,49948)|0;yb=h;return g|0}function NH(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 i=0,j=0,k=0,l=0,m=0,n=0,o=0;i=yb;yb=yb+16|0;j=i+12|0;k=i+8|0;m=i+4|0;l=i;n=b+8|0;n=Eb[c[(c[n>>2]|0)+20>>2]&127](n)|0;c[m>>2]=c[d>>2];c[l>>2]=c[e>>2];e=a[n+11>>0]|0;o=e<<24>>24<0;d=o?c[n>>2]|0:n;e=d+(o?c[n+4>>2]|0:e&255)|0;c[k>>2]=c[m>>2];c[j>>2]=c[l>>2];h=cI(b,k,j,f,g,h,d,e)|0;yb=i;return h|0}function OH(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 h=0,i=0,j=0;h=yb;yb=yb+16|0;i=h+4|0;j=h;GE(i,e);e=VF(i,56736)|0;WF(i);c[j>>2]=c[d>>2];c[i>>2]=c[j>>2];aI(a,g+24|0,b,i,f,e);yb=h;return c[b>>2]|0}function PH(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 h=0,i=0,j=0;h=yb;yb=yb+16|0;i=h+4|0;j=h;GE(i,e);e=VF(i,56736)|0;WF(i);c[j>>2]=c[d>>2];c[i>>2]=c[j>>2];bI(a,g+16|0,b,i,f,e);yb=h;return c[b>>2]|0}function QH(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 h=0,i=0,j=0;h=yb;yb=yb+16|0;i=h+4|0;j=h;GE(i,e);e=VF(i,56736)|0;WF(i);c[j>>2]=c[d>>2];c[i>>2]=c[j>>2];nI(a,g+20|0,b,i,f,e);yb=h;return c[b>>2]|0}function RH(b,d,e,f,g,h,i,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;R=yb;yb=yb+144|0;k=R+128|0;j=R+112|0;P=R+124|0;Q=R+120|0;l=R+116|0;m=R+108|0;n=R+104|0;o=R+100|0;p=R+96|0;q=R+92|0;r=R+88|0;s=R+84|0;t=R+80|0;u=R+76|0;v=R+72|0;w=R+68|0;x=R+64|0;y=R+60|0;z=R+56|0;A=R+52|0;B=R+48|0;C=R+44|0;D=R+40|0;E=R+36|0;F=R+32|0;G=R+28|0;H=R+24|0;I=R+20|0;J=R+16|0;K=R+12|0;L=R+8|0;M=R+4|0;N=R;c[g>>2]=0;GE(k,f);O=VF(k,56736)|0;WF(k);do switch(i<<24>>24|0){case 65:case 97:{c[P>>2]=c[e>>2];c[k>>2]=c[P>>2];aI(b,h+24|0,d,k,g,O);S=26;break}case 104:case 66:case 98:{c[Q>>2]=c[e>>2];c[k>>2]=c[Q>>2];bI(b,h+16|0,d,k,g,O);S=26;break}case 99:{Q=b+8|0;Q=Eb[c[(c[Q>>2]|0)+12>>2]&127](Q)|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];S=a[Q+11>>0]|0;e=S<<24>>24<0;i=e?c[Q>>2]|0:Q;S=i+(e?c[Q+4>>2]|0:S&255)|0;c[j>>2]=c[l>>2];c[k>>2]=c[m>>2];c[d>>2]=cI(b,j,k,f,g,h,i,S)|0;S=26;break}case 101:case 100:{c[n>>2]=c[e>>2];c[k>>2]=c[n>>2];dI(b,h+12|0,d,k,g,O);S=26;break}case 68:{c[o>>2]=c[d>>2];c[p>>2]=c[e>>2];c[j>>2]=c[o>>2];c[k>>2]=c[p>>2];c[d>>2]=cI(b,j,k,f,g,h,49900,49908)|0;S=26;break}case 70:{c[q>>2]=c[d>>2];c[r>>2]=c[e>>2];c[j>>2]=c[q>>2];c[k>>2]=c[r>>2];c[d>>2]=cI(b,j,k,f,g,h,49908,49916)|0;S=26;break}case 72:{c[s>>2]=c[e>>2];c[k>>2]=c[s>>2];eI(b,h+8|0,d,k,g,O);S=26;break}case 73:{c[t>>2]=c[e>>2];c[k>>2]=c[t>>2];fI(b,h+8|0,d,k,g,O);S=26;break}case 106:{c[u>>2]=c[e>>2];c[k>>2]=c[u>>2];gI(b,h+28|0,d,k,g,O);S=26;break}case 109:{c[v>>2]=c[e>>2];c[k>>2]=c[v>>2];hI(b,h+16|0,d,k,g,O);S=26;break}case 77:{c[w>>2]=c[e>>2];c[k>>2]=c[w>>2];iI(b,h+4|0,d,k,g,O);S=26;break}case 116:case 110:{c[x>>2]=c[e>>2];c[k>>2]=c[x>>2];jI(b,d,k,g,O);S=26;break}case 112:{c[y>>2]=c[e>>2];c[k>>2]=c[y>>2];kI(b,h+8|0,d,k,g,O);S=26;break}case 114:{c[z>>2]=c[d>>2];c[A>>2]=c[e>>2];c[j>>2]=c[z>>2];c[k>>2]=c[A>>2];c[d>>2]=cI(b,j,k,f,g,h,49916,49927)|0;S=26;break}case 82:{c[B>>2]=c[d>>2];c[C>>2]=c[e>>2];c[j>>2]=c[B>>2];c[k>>2]=c[C>>2];c[d>>2]=cI(b,j,k,f,g,h,49927,49932)|0;S=26;break}case 83:{c[D>>2]=c[e>>2];c[k>>2]=c[D>>2];lI(b,h,d,k,g,O);S=26;break}case 84:{c[E>>2]=c[d>>2];c[F>>2]=c[e>>2];c[j>>2]=c[E>>2];c[k>>2]=c[F>>2];c[d>>2]=cI(b,j,k,f,g,h,49932,49940)|0;S=26;break}case 119:{c[G>>2]=c[e>>2];c[k>>2]=c[G>>2];mI(b,h+24|0,d,k,g,O);S=26;break}case 120:{i=c[(c[b>>2]|0)+20>>2]|0;c[H>>2]=c[d>>2];c[I>>2]=c[e>>2];c[j>>2]=c[H>>2];c[k>>2]=c[I>>2];j=Mb[i&63](b,j,k,f,g,h)|0;break}case 88:{Q=b+8|0;Q=Eb[c[(c[Q>>2]|0)+24>>2]&127](Q)|0;c[J>>2]=c[d>>2];c[K>>2]=c[e>>2];S=a[Q+11>>0]|0;e=S<<24>>24<0;i=e?c[Q>>2]|0:Q;S=i+(e?c[Q+4>>2]|0:S&255)|0;c[j>>2]=c[J>>2];c[k>>2]=c[K>>2];c[d>>2]=cI(b,j,k,f,g,h,i,S)|0;S=26;break}case 121:{c[L>>2]=c[e>>2];c[k>>2]=c[L>>2];nI(b,h+20|0,d,k,g,O);S=26;break}case 89:{c[M>>2]=c[e>>2];c[k>>2]=c[M>>2];oI(b,h+20|0,d,k,g,O);S=26;break}case 37:{c[N>>2]=c[e>>2];c[k>>2]=c[N>>2];pI(b,d,k,g,O);S=26;break}default:{c[g>>2]=c[g>>2]|4;S=26}}while(0);if((S|0)==26)j=c[d>>2]|0;yb=R;return j|0}function SH(b){b=b|0;if((a[54872]|0)==0?lB(54872)|0:0){$H();c[14216]=53856;nB(54872)}return c[14216]|0}function TH(b){b=b|0;if((a[54856]|0)==0?lB(54856)|0:0){_H();c[14215]=53568;nB(54856)}return c[14215]|0}function UH(b){b=b|0;if((a[54840]|0)==0?lB(54840)|0:0){ZH();c[14214]=53536;nB(54840)}return c[14214]|0}function VH(b){b=b|0;if((a[54832]|0)==0?lB(54832)|0:0){c[14211]=0;c[14212]=0;c[14213]=0;eO(56844,49658,Wf(49658)|0);nB(54832)}return 56844}function WH(b){b=b|0;if((a[54824]|0)==0?lB(54824)|0:0){c[14208]=0;c[14209]=0;c[14210]=0;eO(56832,49646,Wf(49646)|0);nB(54824)}return 56832}function XH(b){b=b|0;if((a[54816]|0)==0?lB(54816)|0:0){c[14205]=0;c[14206]=0;c[14207]=0;eO(56820,49637,Wf(49637)|0);nB(54816)}return 56820}function YH(b){b=b|0;if((a[54808]|0)==0?lB(54808)|0:0){c[14202]=0;c[14203]=0;c[14204]=0;eO(56808,49628,Wf(49628)|0);nB(54808)}return 56808}function ZH(){var b=0,d=0;if((a[54848]|0)==0?lB(54848)|0:0){d=53536;do{c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[d+(b<<2)>>2]=0;b=b+1|0}d=d+12|0}while((d|0)!=53560);nB(54848)}lO(53536,49679)|0;lO(53548,49682)|0;return}function _H(){var b=0,d=0;if((a[54864]|0)==0?lB(54864)|0:0){d=53568;do{c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[d+(b<<2)>>2]=0;b=b+1|0}d=d+12|0}while((d|0)!=53856);nB(54864)}lO(53568,49685)|0;lO(53580,49693)|0;lO(53592,49702)|0;lO(53604,49708)|0;lO(53616,49714)|0;lO(53628,49718)|0;lO(53640,49723)|0;lO(53652,49728)|0;lO(53664,49735)|0;lO(53676,49745)|0;lO(53688,49753)|0;lO(53700,49762)|0;lO(53712,49771)|0;lO(53724,49775)|0;lO(53736,49779)|0;lO(53748,49783)|0;lO(53760,49714)|0;lO(53772,49787)|0;lO(53784,49791)|0;lO(53796,49795)|0;lO(53808,49799)|0;lO(53820,49803)|0;lO(53832,49807)|0;lO(53844,49811)|0;return}function $H(){var b=0,d=0;if((a[54880]|0)==0?lB(54880)|0:0){d=53856;do{c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[d+(b<<2)>>2]=0;b=b+1|0}d=d+12|0}while((d|0)!=54024);nB(54880)}lO(53856,49815)|0;lO(53868,49822)|0;lO(53880,49829)|0;lO(53892,49837)|0;lO(53904,49847)|0;lO(53916,49856)|0;lO(53928,49863)|0;lO(53940,49872)|0;lO(53952,49876)|0;lO(53964,49880)|0;lO(53976,49884)|0;lO(53988,49888)|0;lO(54e3,49892)|0;lO(54012,49896)|0;return}function aI(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 h=0,i=0,j=0;h=yb;yb=yb+16|0;i=h+4|0;j=h;a=a+8|0;a=Eb[c[c[a>>2]>>2]&127](a)|0;c[j>>2]=c[e>>2];c[i>>2]=c[j>>2];a=(DG(d,i,a,a+168|0,g,f,0)|0)-a|0;if((a|0)<168)c[b>>2]=((a|0)/12|0|0)%7|0;yb=h;return}function bI(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 h=0,i=0,j=0;h=yb;yb=yb+16|0;i=h+4|0;j=h;a=a+8|0;a=Eb[c[(c[a>>2]|0)+4>>2]&127](a)|0;c[j>>2]=c[e>>2];c[i>>2]=c[j>>2];a=(DG(d,i,a,a+288|0,g,f,0)|0)-a|0;if((a|0)<288)c[b>>2]=((a|0)/12|0|0)%12|0;yb=h;return}function cI(d,e,f,g,h,i,j,k){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;z=yb;yb=yb+16|0;s=z+12|0;r=z+8|0;w=z+4|0;x=z;GE(s,g);t=VF(s,56736)|0;WF(s);c[h>>2]=0;u=t+8|0;m=0;a:while(1){l=c[e>>2]|0;if(!((j|0)!=(k|0)&(m|0)==0))break;n=l;if(l){m=c[l+12>>2]|0;if((m|0)==(c[l+16>>2]|0))m=Eb[c[(c[l>>2]|0)+36>>2]&127](l)|0;else m=ag(a[m>>0]|0)|0;if(Yf(m,Uf()|0)|0){c[e>>2]=0;l=0;o=1;q=0}else{o=0;q=n}}else{l=0;o=1;q=n}p=c[f>>2]|0;m=p;do if(p){n=c[p+12>>2]|0;if((n|0)==(c[p+16>>2]|0))n=Eb[c[(c[p>>2]|0)+36>>2]&127](p)|0;else n=ag(a[n>>0]|0)|0;if(!(Yf(n,Uf()|0)|0))if(o)break;else{y=63;break a}else{c[f>>2]=0;m=0;y=15;break}}else y=15;while(0);if((y|0)==15){y=0;if(o){y=63;break}else p=0}b:do if((Hb[c[(c[t>>2]|0)+36>>2]&63](t,a[j>>0]|0,0)|0)<<24>>24==37){p=j+1|0;if((p|0)==(k|0)){y=63;break a}n=Hb[c[(c[t>>2]|0)+36>>2]&63](t,a[p>>0]|0,0)|0;switch(n<<24>>24){case 48:case 69:{j=j+2|0;if((j|0)==(k|0)){y=63;break a}o=n;l=Hb[c[(c[t>>2]|0)+36>>2]&63](t,a[j>>0]|0,0)|0;j=p;break}default:{o=0;l=n}}p=c[(c[d>>2]|0)+36>>2]|0;c[w>>2]=q;c[x>>2]=m;c[r>>2]=c[w>>2];c[s>>2]=c[x>>2];c[e>>2]=Ob[p&15](d,r,s,g,h,i,l,o)|0;j=j+2|0}else{m=a[j>>0]|0;if(m<<24>>24>-1?(v=c[u>>2]|0,b[v+(m<<24>>24<<1)>>1]&8192):0){do{j=j+1|0;if((j|0)==(k|0)){j=k;break}m=a[j>>0]|0;if(m<<24>>24<=-1)break}while((b[v+(m<<24>>24<<1)>>1]&8192)!=0);while(1){if(l){m=c[l+12>>2]|0;if((m|0)==(c[l+16>>2]|0))m=Eb[c[(c[l>>2]|0)+36>>2]&127](l)|0;else m=ag(a[m>>0]|0)|0;if(Yf(m,Uf()|0)|0){c[e>>2]=0;l=0;n=1}else n=0}else{l=0;n=1}do if(p){m=c[p+12>>2]|0;if((m|0)==(c[p+16>>2]|0))m=Eb[c[(c[p>>2]|0)+36>>2]&127](p)|0;else m=ag(a[m>>0]|0)|0;if(!(Yf(m,Uf()|0)|0))if(n)break;else break b;else{c[f>>2]=0;y=42;break}}else y=42;while(0);if((y|0)==42){y=0;if(n)break b;else p=0}n=l+12|0;m=c[n>>2]|0;o=l+16|0;if((m|0)==(c[o>>2]|0))m=Eb[c[(c[l>>2]|0)+36>>2]&127](l)|0;else m=ag(a[m>>0]|0)|0;if((m&255)<<24>>24<=-1)break b;if(!(b[(c[u>>2]|0)+(m<<24>>24<<1)>>1]&8192))break b;m=c[n>>2]|0;if((m|0)==(c[o>>2]|0))Eb[c[(c[l>>2]|0)+40>>2]&127](l)|0;else{c[n>>2]=m+1;ag(a[m>>0]|0)|0}}}n=l+12|0;m=c[n>>2]|0;o=l+16|0;if((m|0)==(c[o>>2]|0))m=Eb[c[(c[l>>2]|0)+36>>2]&127](l)|0;else m=ag(a[m>>0]|0)|0;q=Gb[c[(c[t>>2]|0)+12>>2]&63](t,m&255)|0;if(q<<24>>24!=(Gb[c[(c[t>>2]|0)+12>>2]&63](t,a[j>>0]|0)|0)<<24>>24){c[h>>2]=4;break}m=c[n>>2]|0;if((m|0)==(c[o>>2]|0))Eb[c[(c[l>>2]|0)+40>>2]&127](l)|0;else{c[n>>2]=m+1;ag(a[m>>0]|0)|0}j=j+1|0}while(0);m=c[h>>2]|0}if((y|0)==63)c[h>>2]=4;if(l){j=c[l+12>>2]|0;if((j|0)==(c[l+16>>2]|0))j=Eb[c[(c[l>>2]|0)+36>>2]&127](l)|0;else j=ag(a[j>>0]|0)|0;if(Yf(j,Uf()|0)|0){c[e>>2]=0;l=0;n=1}else n=0}else{l=0;n=1}j=c[f>>2]|0;do if(j){m=c[j+12>>2]|0;if((m|0)==(c[j+16>>2]|0))j=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else j=ag(a[m>>0]|0)|0;if(!(Yf(j,Uf()|0)|0))if(n)break;else{y=78;break}else{c[f>>2]=0;y=76;break}}else y=76;while(0);if((y|0)==76?n:0)y=78;if((y|0)==78)c[h>>2]=c[h>>2]|2;yb=z;return l|0}function dI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=qI(d,a,f,g,2)|0;d=c[f>>2]|0;if((a+-1|0)>>>0<31&(d&4|0)==0)c[b>>2]=a;else c[f>>2]=d|4;yb=h;return}function eI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=qI(d,a,f,g,2)|0;d=c[f>>2]|0;if((a|0)<24&(d&4|0)==0)c[b>>2]=a;else c[f>>2]=d|4;yb=h;return}function fI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=qI(d,a,f,g,2)|0;d=c[f>>2]|0;if((a+-1|0)>>>0<12&(d&4|0)==0)c[b>>2]=a;else c[f>>2]=d|4;yb=h;return}function gI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=qI(d,a,f,g,3)|0;d=c[f>>2]|0;if((a|0)<366&(d&4|0)==0)c[b>>2]=a;else c[f>>2]=d|4;yb=h;return}function hI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=qI(d,a,f,g,2)|0;d=c[f>>2]|0;if((a|0)<13&(d&4|0)==0)c[b>>2]=a+-1;else c[f>>2]=d|4;yb=h;return}function iI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=qI(d,a,f,g,2)|0;d=c[f>>2]|0;if((a|0)<60&(d&4|0)==0)c[b>>2]=a;else c[f>>2]=d|4;yb=h;return}function jI(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0;j=h+8|0;a:while(1){d=c[e>>2]|0;do if(d){h=c[d+12>>2]|0;if((h|0)==(c[d+16>>2]|0))d=Eb[c[(c[d>>2]|0)+36>>2]&127](d)|0;else d=ag(a[h>>0]|0)|0;if(Yf(d,Uf()|0)|0){c[e>>2]=0;h=1;break}else{h=(c[e>>2]|0)==0;break}}else h=1;while(0);i=c[f>>2]|0;do if(i){d=c[i+12>>2]|0;if((d|0)==(c[i+16>>2]|0))d=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else d=ag(a[d>>0]|0)|0;if(!(Yf(d,Uf()|0)|0))if(h)break;else break a;else{c[f>>2]=0;k=15;break}}else k=15;while(0);if((k|0)==15){k=0;if(h){i=0;break}else i=0}d=c[e>>2]|0;h=c[d+12>>2]|0;if((h|0)==(c[d+16>>2]|0))d=Eb[c[(c[d>>2]|0)+36>>2]&127](d)|0;else d=ag(a[h>>0]|0)|0;if((d&255)<<24>>24<=-1)break;if(!(b[(c[j>>2]|0)+(d<<24>>24<<1)>>1]&8192))break;d=c[e>>2]|0;h=d+12|0;i=c[h>>2]|0;if((i|0)==(c[d+16>>2]|0))Eb[c[(c[d>>2]|0)+40>>2]&127](d)|0;else{c[h>>2]=i+1;ag(a[i>>0]|0)|0}}d=c[e>>2]|0;do if(d){h=c[d+12>>2]|0;if((h|0)==(c[d+16>>2]|0))d=Eb[c[(c[d>>2]|0)+36>>2]&127](d)|0;else d=ag(a[h>>0]|0)|0;if(Yf(d,Uf()|0)|0){c[e>>2]=0;h=1;break}else{h=(c[e>>2]|0)==0;break}}else h=1;while(0);do if(i){d=c[i+12>>2]|0;if((d|0)==(c[i+16>>2]|0))d=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else d=ag(a[d>>0]|0)|0;if(!(Yf(d,Uf()|0)|0))if(h)break;else{k=41;break}else{c[f>>2]=0;k=39;break}}else k=39;while(0);if((k|0)==39?h:0)k=41;if((k|0)==41)c[g>>2]=c[g>>2]|2;return}function kI(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 i=0,j=0,k=0,l=0,m=0;m=yb;yb=yb+16|0;k=m+4|0;l=m;j=b+8|0;j=Eb[c[(c[j>>2]|0)+8>>2]&127](j)|0;b=a[j+11>>0]|0;if(b<<24>>24<0)i=c[j+4>>2]|0;else i=b&255;b=a[j+12+11>>0]|0;if(b<<24>>24<0)b=c[j+16>>2]|0;else b=b&255;do if((i|0)!=(0-b|0)){c[l>>2]=c[f>>2];c[k>>2]=c[l>>2];b=(DG(e,k,j,j+24|0,h,g,0)|0)-j|0;i=c[d>>2]|0;if((i|0)==12&(b|0)==0){c[d>>2]=0;break}if((i|0)<12&(b|0)==12)c[d>>2]=i+12}else c[g>>2]=c[g>>2]|4;while(0);yb=m;return}function lI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=qI(d,a,f,g,2)|0;d=c[f>>2]|0;if((a|0)<61&(d&4|0)==0)c[b>>2]=a;else c[f>>2]=d|4;yb=h;return}function mI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=qI(d,a,f,g,1)|0;d=c[f>>2]|0;if((a|0)<7&(d&4|0)==0)c[b>>2]=a;else c[f>>2]=d|4;yb=h;return}function nI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=qI(d,a,f,g,4)|0;if(!(c[f>>2]&4)){if((a|0)<69)a=a+2e3|0;else a=(a|0)<100?a+1900|0:a;c[b>>2]=a+-1900}yb=h;return}function oI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=qI(d,a,f,g,4)|0;if(!(c[f>>2]&4))c[b>>2]=a+-1900;yb=h;return}function pI(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;b=c[d>>2]|0;do if(b){h=c[b+12>>2]|0;if((h|0)==(c[b+16>>2]|0))b=Eb[c[(c[b>>2]|0)+36>>2]&127](b)|0;else b=ag(a[h>>0]|0)|0;if(Yf(b,Uf()|0)|0){c[d>>2]=0;i=1;break}else{i=(c[d>>2]|0)==0;break}}else i=1;while(0);h=c[e>>2]|0;do if(h){b=c[h+12>>2]|0;if((b|0)==(c[h+16>>2]|0))b=Eb[c[(c[h>>2]|0)+36>>2]&127](h)|0;else b=ag(a[b>>0]|0)|0;if(!(Yf(b,Uf()|0)|0))if(i){j=h;k=17;break}else{k=16;break}else{c[e>>2]=0;k=14;break}}else k=14;while(0);if((k|0)==14)if(i)k=16;else{j=0;k=17}a:do if((k|0)==16)c[f>>2]=c[f>>2]|6;else if((k|0)==17){b=c[d>>2]|0;h=c[b+12>>2]|0;if((h|0)==(c[b+16>>2]|0))b=Eb[c[(c[b>>2]|0)+36>>2]&127](b)|0;else b=ag(a[h>>0]|0)|0;if((Hb[c[(c[g>>2]|0)+36>>2]&63](g,b&255,0)|0)<<24>>24!=37){c[f>>2]=c[f>>2]|4;break}b=c[d>>2]|0;h=b+12|0;i=c[h>>2]|0;if((i|0)==(c[b+16>>2]|0))Eb[c[(c[b>>2]|0)+40>>2]&127](b)|0;else{c[h>>2]=i+1;ag(a[i>>0]|0)|0}b=c[d>>2]|0;do if(b){h=c[b+12>>2]|0;if((h|0)==(c[b+16>>2]|0))b=Eb[c[(c[b>>2]|0)+36>>2]&127](b)|0;else b=ag(a[h>>0]|0)|0;if(Yf(b,Uf()|0)|0){c[d>>2]=0;h=1;break}else{h=(c[d>>2]|0)==0;break}}else h=1;while(0);do if(j){b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0))b=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else b=ag(a[b>>0]|0)|0;if(!(Yf(b,Uf()|0)|0))if(h)break a;else break;else{c[e>>2]=0;k=38;break}}else k=38;while(0);if((k|0)==38?!h:0)break;c[f>>2]=c[f>>2]|2}while(0);return}function qI(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;i=c[d>>2]|0;do if(i){j=c[i+12>>2]|0;if((j|0)==(c[i+16>>2]|0))i=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else i=ag(a[j>>0]|0)|0;if(Yf(i,Uf()|0)|0){c[d>>2]=0;k=1;break}else{k=(c[d>>2]|0)==0;break}}else k=1;while(0);j=c[e>>2]|0;do if(j){i=c[j+12>>2]|0;if((i|0)==(c[j+16>>2]|0))i=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else i=ag(a[i>>0]|0)|0;if(!(Yf(i,Uf()|0)|0))if(k){q=17;break}else{q=16;break}else{c[e>>2]=0;q=14;break}}else q=14;while(0);if((q|0)==14)if(k)q=16;else{j=0;q=17}a:do if((q|0)==16){c[f>>2]=c[f>>2]|6;i=0}else if((q|0)==17){i=c[d>>2]|0;k=c[i+12>>2]|0;if((k|0)==(c[i+16>>2]|0))i=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else i=ag(a[k>>0]|0)|0;k=i&255;if(k<<24>>24>-1?(p=g+8|0,b[(c[p>>2]|0)+(i<<24>>24<<1)>>1]&2048):0){i=(Hb[c[(c[g>>2]|0)+36>>2]&63](g,k,0)|0)<<24>>24;k=c[d>>2]|0;l=k+12|0;m=c[l>>2]|0;if((m|0)==(c[k+16>>2]|0))Eb[c[(c[k>>2]|0)+40>>2]&127](k)|0;else{c[l>>2]=m+1;ag(a[m>>0]|0)|0}n=j;m=j;while(1){i=i+-48|0;o=h+-1|0;j=c[d>>2]|0;do if(j){k=c[j+12>>2]|0;if((k|0)==(c[j+16>>2]|0))j=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else j=ag(a[k>>0]|0)|0;if(Yf(j,Uf()|0)|0){c[d>>2]=0;l=1;break}else{l=(c[d>>2]|0)==0;break}}else l=1;while(0);if(m){j=c[m+12>>2]|0;if((j|0)==(c[m+16>>2]|0))j=Eb[c[(c[m>>2]|0)+36>>2]&127](m)|0;else j=ag(a[j>>0]|0)|0;if(Yf(j,Uf()|0)|0){c[e>>2]=0;j=1;n=0;m=0}else j=0}else{j=1;m=0}k=c[d>>2]|0;if(!((h|0)>1&(l^j)))break;j=c[k+12>>2]|0;if((j|0)==(c[k+16>>2]|0))j=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else j=ag(a[j>>0]|0)|0;k=j&255;if(k<<24>>24<=-1)break a;if(!(b[(c[p>>2]|0)+(j<<24>>24<<1)>>1]&2048))break a;i=(i*10|0)+((Hb[c[(c[g>>2]|0)+36>>2]&63](g,k,0)|0)<<24>>24)|0;j=c[d>>2]|0;k=j+12|0;l=c[k>>2]|0;if((l|0)==(c[j+16>>2]|0))Eb[c[(c[j>>2]|0)+40>>2]&127](j)|0;else{c[k>>2]=l+1;ag(a[l>>0]|0)|0}h=o}do if(k){j=c[k+12>>2]|0;if((j|0)==(c[k+16>>2]|0))j=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else j=ag(a[j>>0]|0)|0;if(Yf(j,Uf()|0)|0){c[d>>2]=0;k=1;break}else{k=(c[d>>2]|0)==0;break}}else k=1;while(0);do if(n){j=c[n+12>>2]|0;if((j|0)==(c[n+16>>2]|0))j=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else j=ag(a[j>>0]|0)|0;if(!(Yf(j,Uf()|0)|0))if(k)break a;else break;else{c[e>>2]=0;q=63;break}}else q=63;while(0);if((q|0)==63?!k:0)break;c[f>>2]=c[f>>2]|2;break}c[f>>2]=c[f>>2]|4;i=0}while(0);return i|0}function rI(a){a=a|0;AF(a);return}function sI(a){a=a|0;AF(a);QA(a);return}function tI(a){a=a|0;return 2}function uI(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+16|0;i=h+12|0;j=h+8|0;l=h+4|0;k=h;c[l>>2]=c[b>>2];c[k>>2]=c[d>>2];c[j>>2]=c[l>>2];c[i>>2]=c[k>>2];g=NI(a,j,i,e,f,g,13152,13184)|0;yb=h;return g|0}function vI(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 i=0,j=0,k=0,l=0,m=0,n=0,o=0;i=yb;yb=yb+16|0;j=i+12|0;k=i+8|0;m=i+4|0;l=i;n=b+8|0;n=Eb[c[(c[n>>2]|0)+20>>2]&127](n)|0;c[m>>2]=c[d>>2];c[l>>2]=c[e>>2];e=a[n+8+3>>0]|0;o=e<<24>>24<0;d=o?c[n>>2]|0:n;e=d+((o?c[n+4>>2]|0:e&255)<<2)|0;c[k>>2]=c[m>>2];c[j>>2]=c[l>>2];h=NI(b,k,j,f,g,h,d,e)|0;yb=i;return h|0}function wI(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 h=0,i=0,j=0;h=yb;yb=yb+16|0;i=h+4|0;j=h;GE(i,e);e=VF(i,56768)|0;WF(i);c[j>>2]=c[d>>2];c[i>>2]=c[j>>2];LI(a,g+24|0,b,i,f,e);yb=h;return c[b>>2]|0}function xI(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 h=0,i=0,j=0;h=yb;yb=yb+16|0;i=h+4|0;j=h;GE(i,e);e=VF(i,56768)|0;WF(i);c[j>>2]=c[d>>2];c[i>>2]=c[j>>2];MI(a,g+16|0,b,i,f,e);yb=h;return c[b>>2]|0}function yI(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 h=0,i=0,j=0;h=yb;yb=yb+16|0;i=h+4|0;j=h;GE(i,e);e=VF(i,56768)|0;WF(i);c[j>>2]=c[d>>2];c[i>>2]=c[j>>2];YI(a,g+20|0,b,i,f,e);yb=h;return c[b>>2]|0}function zI(b,d,e,f,g,h,i,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;R=yb;yb=yb+144|0;k=R+128|0;j=R+112|0;P=R+124|0;Q=R+120|0;l=R+116|0;m=R+108|0;n=R+104|0;o=R+100|0;p=R+96|0;q=R+92|0;r=R+88|0;s=R+84|0;t=R+80|0;u=R+76|0;v=R+72|0;w=R+68|0;x=R+64|0;y=R+60|0;z=R+56|0;A=R+52|0;B=R+48|0;C=R+44|0;D=R+40|0;E=R+36|0;F=R+32|0;G=R+28|0;H=R+24|0;I=R+20|0;J=R+16|0;K=R+12|0;L=R+8|0;M=R+4|0;N=R;c[g>>2]=0;GE(k,f);O=VF(k,56768)|0;WF(k);do switch(i<<24>>24|0){case 65:case 97:{c[P>>2]=c[e>>2];c[k>>2]=c[P>>2];LI(b,h+24|0,d,k,g,O);S=26;break}case 104:case 66:case 98:{c[Q>>2]=c[e>>2];c[k>>2]=c[Q>>2];MI(b,h+16|0,d,k,g,O);S=26;break}case 99:{Q=b+8|0;Q=Eb[c[(c[Q>>2]|0)+12>>2]&127](Q)|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];S=a[Q+8+3>>0]|0;e=S<<24>>24<0;i=e?c[Q>>2]|0:Q;S=i+((e?c[Q+4>>2]|0:S&255)<<2)|0;c[j>>2]=c[l>>2];c[k>>2]=c[m>>2];c[d>>2]=NI(b,j,k,f,g,h,i,S)|0;S=26;break}case 101:case 100:{c[n>>2]=c[e>>2];c[k>>2]=c[n>>2];OI(b,h+12|0,d,k,g,O);S=26;break}case 68:{c[o>>2]=c[d>>2];c[p>>2]=c[e>>2];c[j>>2]=c[o>>2];c[k>>2]=c[p>>2];c[d>>2]=NI(b,j,k,f,g,h,12976,13008)|0;S=26;break}case 70:{c[q>>2]=c[d>>2];c[r>>2]=c[e>>2];c[j>>2]=c[q>>2];c[k>>2]=c[r>>2];c[d>>2]=NI(b,j,k,f,g,h,13008,13040)|0;S=26;break}case 72:{c[s>>2]=c[e>>2];c[k>>2]=c[s>>2];PI(b,h+8|0,d,k,g,O);S=26;break}case 73:{c[t>>2]=c[e>>2];c[k>>2]=c[t>>2];QI(b,h+8|0,d,k,g,O);S=26;break}case 106:{c[u>>2]=c[e>>2];c[k>>2]=c[u>>2];RI(b,h+28|0,d,k,g,O);S=26;break}case 109:{c[v>>2]=c[e>>2];c[k>>2]=c[v>>2];SI(b,h+16|0,d,k,g,O);S=26;break}case 77:{c[w>>2]=c[e>>2];c[k>>2]=c[w>>2];TI(b,h+4|0,d,k,g,O);S=26;break}case 116:case 110:{c[x>>2]=c[e>>2];c[k>>2]=c[x>>2];UI(b,d,k,g,O);S=26;break}case 112:{c[y>>2]=c[e>>2];c[k>>2]=c[y>>2];VI(b,h+8|0,d,k,g,O);S=26;break}case 114:{c[z>>2]=c[d>>2];c[A>>2]=c[e>>2];c[j>>2]=c[z>>2];c[k>>2]=c[A>>2];c[d>>2]=NI(b,j,k,f,g,h,13040,13084)|0;S=26;break}case 82:{c[B>>2]=c[d>>2];c[C>>2]=c[e>>2];c[j>>2]=c[B>>2];c[k>>2]=c[C>>2];c[d>>2]=NI(b,j,k,f,g,h,13088,13108)|0;S=26;break}case 83:{c[D>>2]=c[e>>2];c[k>>2]=c[D>>2];WI(b,h,d,k,g,O);S=26;break}case 84:{c[E>>2]=c[d>>2];c[F>>2]=c[e>>2];c[j>>2]=c[E>>2];c[k>>2]=c[F>>2];c[d>>2]=NI(b,j,k,f,g,h,13120,13152)|0;S=26;break}case 119:{c[G>>2]=c[e>>2];c[k>>2]=c[G>>2];XI(b,h+24|0,d,k,g,O);S=26;break}case 120:{i=c[(c[b>>2]|0)+20>>2]|0;c[H>>2]=c[d>>2];c[I>>2]=c[e>>2];c[j>>2]=c[H>>2];c[k>>2]=c[I>>2];j=Mb[i&63](b,j,k,f,g,h)|0;break}case 88:{Q=b+8|0;Q=Eb[c[(c[Q>>2]|0)+24>>2]&127](Q)|0;c[J>>2]=c[d>>2];c[K>>2]=c[e>>2];S=a[Q+8+3>>0]|0;e=S<<24>>24<0;i=e?c[Q>>2]|0:Q;S=i+((e?c[Q+4>>2]|0:S&255)<<2)|0;c[j>>2]=c[J>>2];c[k>>2]=c[K>>2];c[d>>2]=NI(b,j,k,f,g,h,i,S)|0;S=26;break}case 121:{c[L>>2]=c[e>>2];c[k>>2]=c[L>>2];YI(b,h+20|0,d,k,g,O);S=26;break}case 89:{c[M>>2]=c[e>>2];c[k>>2]=c[M>>2];ZI(b,h+20|0,d,k,g,O);S=26;break}case 37:{c[N>>2]=c[e>>2];c[k>>2]=c[N>>2];_I(b,d,k,g,O);S=26;break}default:{c[g>>2]=c[g>>2]|4;S=26}}while(0);if((S|0)==26)j=c[d>>2]|0;yb=R;return j|0}function AI(b){b=b|0;if((a[54952]|0)==0?lB(54952)|0:0){KI();c[14233]=54352;nB(54952)}return c[14233]|0}function BI(b){b=b|0;if((a[54936]|0)==0?lB(54936)|0:0){JI();c[14232]=54064;nB(54936)}return c[14232]|0}function CI(b){b=b|0;if((a[54920]|0)==0?lB(54920)|0:0){II();c[14231]=54032;nB(54920)}return c[14231]|0}function DI(b){b=b|0;if((a[54912]|0)==0?lB(54912)|0:0){c[14228]=0;c[14229]=0;c[14230]=0;rO(56912,17648,HI(17648)|0);nB(54912)}return 56912}function EI(b){b=b|0;if((a[54904]|0)==0?lB(54904)|0:0){c[14225]=0;c[14226]=0;c[14227]=0;rO(56900,17600,HI(17600)|0);nB(54904)}return 56900}function FI(b){b=b|0;if((a[54896]|0)==0?lB(54896)|0:0){c[14222]=0;c[14223]=0;c[14224]=0;rO(56888,17564,HI(17564)|0);nB(54896)}return 56888}function GI(b){b=b|0;if((a[54888]|0)==0?lB(54888)|0:0){c[14219]=0;c[14220]=0;c[14221]=0;rO(56876,17528,HI(17528)|0);nB(54888)}return 56876}function HI(a){a=a|0;return jy(a)|0}function II(){var b=0,d=0;if((a[54928]|0)==0?lB(54928)|0:0){d=54032;do{c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[d+(b<<2)>>2]=0;b=b+1|0}d=d+12|0}while((d|0)!=54056);nB(54928)}yO(54032,17732)|0;yO(54044,17744)|0;return}function JI(){var b=0,d=0;if((a[54944]|0)==0?lB(54944)|0:0){d=54064;do{c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[d+(b<<2)>>2]=0;b=b+1|0}d=d+12|0}while((d|0)!=54352);nB(54944)}yO(54064,17756)|0;yO(54076,17788)|0;yO(54088,17824)|0;yO(54100,17848)|0;yO(54112,17872)|0;yO(54124,17888)|0;yO(54136,17908)|0;yO(54148,17928)|0;yO(54160,17956)|0;yO(54172,17996)|0;yO(54184,18028)|0;yO(54196,18064)|0;yO(54208,18100)|0;yO(54220,18116)|0;yO(54232,18132)|0;yO(54244,18148)|0;yO(54256,17872)|0;yO(54268,18164)|0;yO(54280,18180)|0;yO(54292,18196)|0;yO(54304,18212)|0;yO(54316,18228)|0;yO(54328,18244)|0;yO(54340,18260)|0;return}function KI(){var b=0,d=0;if((a[54960]|0)==0?lB(54960)|0:0){d=54352;do{c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[d+(b<<2)>>2]=0;b=b+1|0}d=d+12|0}while((d|0)!=54520);nB(54960)}yO(54352,18276)|0;yO(54364,18304)|0;yO(54376,18332)|0;yO(54388,18364)|0;yO(54400,18404)|0;yO(54412,18440)|0;yO(54424,18468)|0;yO(54436,18504)|0;yO(54448,18520)|0;yO(54460,18536)|0;yO(54472,18552)|0;yO(54484,18568)|0;yO(54496,18584)|0;yO(54508,18600)|0;return}function LI(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 h=0,i=0,j=0;h=yb;yb=yb+16|0;i=h+4|0;j=h;a=a+8|0;a=Eb[c[c[a>>2]>>2]&127](a)|0;c[j>>2]=c[e>>2];c[i>>2]=c[j>>2];a=(eH(d,i,a,a+168|0,g,f,0)|0)-a|0;if((a|0)<168)c[b>>2]=((a|0)/12|0|0)%7|0;yb=h;return}function MI(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 h=0,i=0,j=0;h=yb;yb=yb+16|0;i=h+4|0;j=h;a=a+8|0;a=Eb[c[(c[a>>2]|0)+4>>2]&127](a)|0;c[j>>2]=c[e>>2];c[i>>2]=c[j>>2];a=(eH(d,i,a,a+288|0,g,f,0)|0)-a|0;if((a|0)<288)c[b>>2]=((a|0)/12|0|0)%12|0;yb=h;return}function NI(a,b,d,e,f,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;v=yb;yb=yb+16|0;q=v+12|0;p=v+8|0;s=v+4|0;t=v;GE(q,e);r=VF(q,56768)|0;WF(q);c[f>>2]=0;k=0;a:while(1){j=c[b>>2]|0;if(!((h|0)!=(i|0)&(k|0)==0))break;l=j;if(j){k=c[j+12>>2]|0;if((k|0)==(c[j+16>>2]|0))k=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else k=hE(c[k>>2]|0)|0;if(HE(k,gE()|0)|0){c[b>>2]=0;j=0;m=1;o=0}else{m=0;o=l}}else{j=0;m=1;o=l}n=c[d>>2]|0;k=n;do if(n){l=c[n+12>>2]|0;if((l|0)==(c[n+16>>2]|0))l=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else l=hE(c[l>>2]|0)|0;if(!(HE(l,gE()|0)|0))if(m)break;else{u=60;break a}else{c[d>>2]=0;k=0;u=15;break}}else u=15;while(0);if((u|0)==15){u=0;if(m){u=60;break}else n=0}b:do if((Hb[c[(c[r>>2]|0)+52>>2]&63](r,c[h>>2]|0,0)|0)<<24>>24==37){n=h+4|0;if((n|0)==(i|0)){u=60;break a}l=Hb[c[(c[r>>2]|0)+52>>2]&63](r,c[n>>2]|0,0)|0;switch(l<<24>>24){case 48:case 69:{h=h+8|0;if((h|0)==(i|0)){u=60;break a}m=l;j=Hb[c[(c[r>>2]|0)+52>>2]&63](r,c[h>>2]|0,0)|0;h=n;break}default:{m=0;j=l}}n=c[(c[a>>2]|0)+36>>2]|0;c[s>>2]=o;c[t>>2]=k;c[p>>2]=c[s>>2];c[q>>2]=c[t>>2];c[b>>2]=Ob[n&15](a,p,q,e,f,g,j,m)|0;h=h+8|0}else{if(!(Hb[c[(c[r>>2]|0)+12>>2]&63](r,8192,c[h>>2]|0)|0)){l=j+12|0;k=c[l>>2]|0;m=j+16|0;if((k|0)==(c[m>>2]|0))k=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else k=hE(c[k>>2]|0)|0;o=Gb[c[(c[r>>2]|0)+28>>2]&63](r,k)|0;if((o|0)!=(Gb[c[(c[r>>2]|0)+28>>2]&63](r,c[h>>2]|0)|0)){c[f>>2]=4;break}k=c[l>>2]|0;if((k|0)==(c[m>>2]|0))Eb[c[(c[j>>2]|0)+40>>2]&127](j)|0;else{c[l>>2]=k+4;hE(c[k>>2]|0)|0}h=h+4|0;break}do{h=h+4|0;if((h|0)==(i|0)){h=i;break}}while(Hb[c[(c[r>>2]|0)+12>>2]&63](r,8192,c[h>>2]|0)|0);while(1){if(j){k=c[j+12>>2]|0;if((k|0)==(c[j+16>>2]|0))k=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else k=hE(c[k>>2]|0)|0;if(HE(k,gE()|0)|0){c[b>>2]=0;j=0;l=1}else l=0}else{j=0;l=1}do if(n){k=c[n+12>>2]|0;if((k|0)==(c[n+16>>2]|0))k=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else k=hE(c[k>>2]|0)|0;if(!(HE(k,gE()|0)|0))if(l)break;else break b;else{c[d>>2]=0;u=40;break}}else u=40;while(0);if((u|0)==40){u=0;if(l)break b;else n=0}l=j+12|0;k=c[l>>2]|0;m=j+16|0;if((k|0)==(c[m>>2]|0))k=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else k=hE(c[k>>2]|0)|0;if(!(Hb[c[(c[r>>2]|0)+12>>2]&63](r,8192,k)|0))break b;k=c[l>>2]|0;if((k|0)==(c[m>>2]|0))Eb[c[(c[j>>2]|0)+40>>2]&127](j)|0;else{c[l>>2]=k+4;hE(c[k>>2]|0)|0}}}while(0);k=c[f>>2]|0}if((u|0)==60)c[f>>2]=4;if(j){h=c[j+12>>2]|0;if((h|0)==(c[j+16>>2]|0))h=Eb[c[(c[j>>2]|0)+36>>2]&127](j)|0;else h=hE(c[h>>2]|0)|0;if(HE(h,gE()|0)|0){c[b>>2]=0;j=0;l=1}else l=0}else{j=0;l=1}h=c[d>>2]|0;do if(h){k=c[h+12>>2]|0;if((k|0)==(c[h+16>>2]|0))h=Eb[c[(c[h>>2]|0)+36>>2]&127](h)|0;else h=hE(c[k>>2]|0)|0;if(!(HE(h,gE()|0)|0))if(l)break;else{u=75;break}else{c[d>>2]=0;u=73;break}}else u=73;while(0);if((u|0)==73?l:0)u=75;if((u|0)==75)c[f>>2]=c[f>>2]|2;yb=v;return j|0}function OI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=$I(d,a,f,g,2)|0;d=c[f>>2]|0;if((a+-1|0)>>>0<31&(d&4|0)==0)c[b>>2]=a;else c[f>>2]=d|4;yb=h;return}function PI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=$I(d,a,f,g,2)|0;d=c[f>>2]|0;if((a|0)<24&(d&4|0)==0)c[b>>2]=a;else c[f>>2]=d|4;yb=h;return}function QI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=$I(d,a,f,g,2)|0;d=c[f>>2]|0;if((a+-1|0)>>>0<12&(d&4|0)==0)c[b>>2]=a;else c[f>>2]=d|4;yb=h;return}function RI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=$I(d,a,f,g,3)|0;d=c[f>>2]|0;if((a|0)<366&(d&4|0)==0)c[b>>2]=a;else c[f>>2]=d|4;yb=h;return}function SI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=$I(d,a,f,g,2)|0;d=c[f>>2]|0;if((a|0)<13&(d&4|0)==0)c[b>>2]=a+-1;else c[f>>2]=d|4;yb=h;return}function TI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=$I(d,a,f,g,2)|0;d=c[f>>2]|0;if((a|0)<60&(d&4|0)==0)c[b>>2]=a;else c[f>>2]=d|4;yb=h;return}function UI(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;a:while(1){a=c[b>>2]|0;do if(a){g=c[a+12>>2]|0;if((g|0)==(c[a+16>>2]|0))a=Eb[c[(c[a>>2]|0)+36>>2]&127](a)|0;else a=hE(c[g>>2]|0)|0;if(HE(a,gE()|0)|0){c[b>>2]=0;h=1;break}else{h=(c[b>>2]|0)==0;break}}else h=1;while(0);g=c[d>>2]|0;do if(g){a=c[g+12>>2]|0;if((a|0)==(c[g+16>>2]|0))a=Eb[c[(c[g>>2]|0)+36>>2]&127](g)|0;else a=hE(c[a>>2]|0)|0;if(!(HE(a,gE()|0)|0))if(h){h=g;break}else{h=g;break a}else{c[d>>2]=0;i=15;break}}else i=15;while(0);if((i|0)==15){i=0;if(h){h=0;break}else h=0}a=c[b>>2]|0;g=c[a+12>>2]|0;if((g|0)==(c[a+16>>2]|0))a=Eb[c[(c[a>>2]|0)+36>>2]&127](a)|0;else a=hE(c[g>>2]|0)|0;if(!(Hb[c[(c[f>>2]|0)+12>>2]&63](f,8192,a)|0))break;a=c[b>>2]|0;g=a+12|0;h=c[g>>2]|0;if((h|0)==(c[a+16>>2]|0))Eb[c[(c[a>>2]|0)+40>>2]&127](a)|0;else{c[g>>2]=h+4;hE(c[h>>2]|0)|0}}a=c[b>>2]|0;do if(a){g=c[a+12>>2]|0;if((g|0)==(c[a+16>>2]|0))a=Eb[c[(c[a>>2]|0)+36>>2]&127](a)|0;else a=hE(c[g>>2]|0)|0;if(HE(a,gE()|0)|0){c[b>>2]=0;g=1;break}else{g=(c[b>>2]|0)==0;break}}else g=1;while(0);do if(h){a=c[h+12>>2]|0;if((a|0)==(c[h+16>>2]|0))a=Eb[c[(c[h>>2]|0)+36>>2]&127](h)|0;else a=hE(c[a>>2]|0)|0;if(!(HE(a,gE()|0)|0))if(g)break;else{i=40;break}else{c[d>>2]=0;i=38;break}}else i=38;while(0);if((i|0)==38?g:0)i=40;if((i|0)==40)c[e>>2]=c[e>>2]|2;return}function VI(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 i=0,j=0,k=0,l=0,m=0;m=yb;yb=yb+16|0;k=m+4|0;l=m;j=b+8|0;j=Eb[c[(c[j>>2]|0)+8>>2]&127](j)|0;b=a[j+8+3>>0]|0;if(b<<24>>24<0)i=c[j+4>>2]|0;else i=b&255;b=a[j+20+3>>0]|0;if(b<<24>>24<0)b=c[j+16>>2]|0;else b=b&255;do if((i|0)!=(0-b|0)){c[l>>2]=c[f>>2];c[k>>2]=c[l>>2];b=(eH(e,k,j,j+24|0,h,g,0)|0)-j|0;i=c[d>>2]|0;if((i|0)==12&(b|0)==0){c[d>>2]=0;break}if((i|0)<12&(b|0)==12)c[d>>2]=i+12}else c[g>>2]=c[g>>2]|4;while(0);yb=m;return}function WI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=$I(d,a,f,g,2)|0;d=c[f>>2]|0;if((a|0)<61&(d&4|0)==0)c[b>>2]=a;else c[f>>2]=d|4;yb=h;return}function XI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=$I(d,a,f,g,1)|0;d=c[f>>2]|0;if((a|0)<7&(d&4|0)==0)c[b>>2]=a;else c[f>>2]=d|4;yb=h;return}function YI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=$I(d,a,f,g,4)|0;if(!(c[f>>2]&4)){if((a|0)<69)a=a+2e3|0;else a=(a|0)<100?a+1900|0:a;c[b>>2]=a+-1900}yb=h;return}function ZI(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 h=0,i=0;h=yb;yb=yb+16|0;a=h+4|0;i=h;c[i>>2]=c[e>>2];c[a>>2]=c[i>>2];a=$I(d,a,f,g,4)|0;if(!(c[f>>2]&4))c[b>>2]=a+-1900;yb=h;return}function _I(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;a=c[b>>2]|0;do if(a){g=c[a+12>>2]|0;if((g|0)==(c[a+16>>2]|0))a=Eb[c[(c[a>>2]|0)+36>>2]&127](a)|0;else a=hE(c[g>>2]|0)|0;if(HE(a,gE()|0)|0){c[b>>2]=0;h=1;break}else{h=(c[b>>2]|0)==0;break}}else h=1;while(0);g=c[d>>2]|0;do if(g){a=c[g+12>>2]|0;if((a|0)==(c[g+16>>2]|0))a=Eb[c[(c[g>>2]|0)+36>>2]&127](g)|0;else a=hE(c[a>>2]|0)|0;if(!(HE(a,gE()|0)|0))if(h){i=g;j=17;break}else{j=16;break}else{c[d>>2]=0;j=14;break}}else j=14;while(0);if((j|0)==14)if(h)j=16;else{i=0;j=17}a:do if((j|0)==16)c[e>>2]=c[e>>2]|6;else if((j|0)==17){a=c[b>>2]|0;g=c[a+12>>2]|0;if((g|0)==(c[a+16>>2]|0))a=Eb[c[(c[a>>2]|0)+36>>2]&127](a)|0;else a=hE(c[g>>2]|0)|0;if((Hb[c[(c[f>>2]|0)+52>>2]&63](f,a,0)|0)<<24>>24!=37){c[e>>2]=c[e>>2]|4;break}a=c[b>>2]|0;g=a+12|0;h=c[g>>2]|0;if((h|0)==(c[a+16>>2]|0))Eb[c[(c[a>>2]|0)+40>>2]&127](a)|0;else{c[g>>2]=h+4;hE(c[h>>2]|0)|0}a=c[b>>2]|0;do if(a){g=c[a+12>>2]|0;if((g|0)==(c[a+16>>2]|0))a=Eb[c[(c[a>>2]|0)+36>>2]&127](a)|0;else a=hE(c[g>>2]|0)|0;if(HE(a,gE()|0)|0){c[b>>2]=0;g=1;break}else{g=(c[b>>2]|0)==0;break}}else g=1;while(0);do if(i){a=c[i+12>>2]|0;if((a|0)==(c[i+16>>2]|0))a=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else a=hE(c[a>>2]|0)|0;if(!(HE(a,gE()|0)|0))if(g)break a;else break;else{c[d>>2]=0;j=38;break}}else j=38;while(0);if((j|0)==38?!g:0)break;c[e>>2]=c[e>>2]|2}while(0);return}function $I(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;g=c[a>>2]|0;do if(g){h=c[g+12>>2]|0;if((h|0)==(c[g+16>>2]|0))g=Eb[c[(c[g>>2]|0)+36>>2]&127](g)|0;else g=hE(c[h>>2]|0)|0;if(HE(g,gE()|0)|0){c[a>>2]=0;i=1;break}else{i=(c[a>>2]|0)==0;break}}else i=1;while(0);h=c[b>>2]|0;do if(h){g=c[h+12>>2]|0;if((g|0)==(c[h+16>>2]|0))g=Eb[c[(c[h>>2]|0)+36>>2]&127](h)|0;else g=hE(c[g>>2]|0)|0;if(!(HE(g,gE()|0)|0))if(i){n=17;break}else{n=16;break}else{c[b>>2]=0;n=14;break}}else n=14;while(0);if((n|0)==14)if(i)n=16;else{h=0;n=17}a:do if((n|0)==16){c[d>>2]=c[d>>2]|6;g=0}else if((n|0)==17){g=c[a>>2]|0;i=c[g+12>>2]|0;if((i|0)==(c[g+16>>2]|0))g=Eb[c[(c[g>>2]|0)+36>>2]&127](g)|0;else g=hE(c[i>>2]|0)|0;if(!(Hb[c[(c[e>>2]|0)+12>>2]&63](e,2048,g)|0)){c[d>>2]=c[d>>2]|4;g=0;break}g=(Hb[c[(c[e>>2]|0)+52>>2]&63](e,g,0)|0)<<24>>24;i=c[a>>2]|0;j=i+12|0;k=c[j>>2]|0;if((k|0)==(c[i+16>>2]|0))Eb[c[(c[i>>2]|0)+40>>2]&127](i)|0;else{c[j>>2]=k+4;hE(c[k>>2]|0)|0}l=h;k=h;while(1){g=g+-48|0;m=f+-1|0;h=c[a>>2]|0;do if(h){i=c[h+12>>2]|0;if((i|0)==(c[h+16>>2]|0))h=Eb[c[(c[h>>2]|0)+36>>2]&127](h)|0;else h=hE(c[i>>2]|0)|0;if(HE(h,gE()|0)|0){c[a>>2]=0;j=1;break}else{j=(c[a>>2]|0)==0;break}}else j=1;while(0);if(k){h=c[k+12>>2]|0;if((h|0)==(c[k+16>>2]|0))h=Eb[c[(c[k>>2]|0)+36>>2]&127](k)|0;else h=hE(c[h>>2]|0)|0;if(HE(h,gE()|0)|0){c[b>>2]=0;h=1;l=0;k=0}else h=0}else{h=1;k=0}i=c[a>>2]|0;if(!((f|0)>1&(j^h)))break;h=c[i+12>>2]|0;if((h|0)==(c[i+16>>2]|0))h=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else h=hE(c[h>>2]|0)|0;if(!(Hb[c[(c[e>>2]|0)+12>>2]&63](e,2048,h)|0))break a;g=(g*10|0)+((Hb[c[(c[e>>2]|0)+52>>2]&63](e,h,0)|0)<<24>>24)|0;h=c[a>>2]|0;i=h+12|0;j=c[i>>2]|0;if((j|0)==(c[h+16>>2]|0))Eb[c[(c[h>>2]|0)+40>>2]&127](h)|0;else{c[i>>2]=j+4;hE(c[j>>2]|0)|0}f=m}do if(i){h=c[i+12>>2]|0;if((h|0)==(c[i+16>>2]|0))h=Eb[c[(c[i>>2]|0)+36>>2]&127](i)|0;else h=hE(c[h>>2]|0)|0;if(HE(h,gE()|0)|0){c[a>>2]=0;i=1;break}else{i=(c[a>>2]|0)==0;break}}else i=1;while(0);do if(l){h=c[l+12>>2]|0;if((h|0)==(c[l+16>>2]|0))h=Eb[c[(c[l>>2]|0)+36>>2]&127](l)|0;else h=hE(c[h>>2]|0)|0;if(!(HE(h,gE()|0)|0))if(i)break a;else break;else{c[b>>2]=0;n=61;break}}else n=61;while(0);if((n|0)==61?!i:0)break;c[d>>2]=c[d>>2]|2}while(0);return g|0}function aJ(a){a=a|0;fJ(a+8|0);AF(a);return}function bJ(a){a=a|0;fJ(a+8|0);AF(a);QA(a);return}function cJ(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0;j=yb;yb=yb+112|0;e=j;f=j+100|0;c[f>>2]=e+100;dJ(b+8|0,e,f,g,h,i);i=c[f>>2]|0;h=e;e=c[d>>2]|0;while(1){if((h|0)==(i|0))break;f=a[h>>0]|0;if(!e)e=0;else{b=e+24|0;g=c[b>>2]|0;if((g|0)==(c[e+28>>2]|0)){d=c[(c[e>>2]|0)+52>>2]|0;f=ag(f)|0;f=Gb[d&63](e,f)|0}else{c[b>>2]=g+1;a[g>>0]=f;f=ag(f)|0}d=Yf(f,Uf()|0)|0;e=d?0:e}h=h+1|0}yb=j;return e|0}function dJ(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 i=0,j=0,k=0,l=0;l=yb;yb=yb+16|0;i=l;a[i>>0]=37;j=i+1|0;a[j>>0]=g;k=i+2|0;a[k>>0]=h;a[i+3>>0]=0;if(h<<24>>24){a[j>>0]=h;a[k>>0]=g}k=eJ(d,c[e>>2]|0)|0;c[e>>2]=d+(Sa(d|0,k|0,i|0,f|0,c[b>>2]|0)|0);yb=l;return}function eJ(a,b){a=a|0;b=b|0;return b-a|0}function fJ(a){a=a|0;var b=0;b=c[a>>2]|0;if((b|0)!=(YF()|0))Ty(c[a>>2]|0);return}function gJ(a){a=a|0;fJ(a+8|0);AF(a);return}function hJ(a){a=a|0;fJ(a+8|0);AF(a);QA(a);return}function iJ(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 i=0;i=yb;yb=yb+416|0;d=i;e=i+400|0;c[e>>2]=d+400;jJ(a+8|0,d,e,f,g,h);h=c[e>>2]|0;g=d;d=c[b>>2]|0;while(1){if((g|0)==(h|0))break;e=c[g>>2]|0;if(!d)d=0;else{a=d+24|0;f=c[a>>2]|0;if((f|0)==(c[d+28>>2]|0)){b=c[(c[d>>2]|0)+52>>2]|0;e=hE(e)|0;e=Gb[b&63](d,e)|0}else{c[a>>2]=f+4;c[f>>2]=e;e=hE(e)|0}b=HE(e,gE()|0)|0;d=b?0:d}g=g+4|0}yb=i;return d|0}function jJ(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 h=0,i=0,j=0,k=0,l=0;h=yb;yb=yb+128|0;k=h;l=h+116|0;i=h+104|0;j=h+112|0;c[l>>2]=k+100;dJ(a,k,l,e,f,g);e=i;c[e>>2]=0;c[e+4>>2]=0;c[j>>2]=k;e=kJ(b,c[d>>2]|0)|0;a=cz(c[a>>2]|0)|0;e=Qz(b,j,e,i)|0;if(a|0)cz(a)|0;if((e|0)==-1)lJ(0);else{c[d>>2]=b+(e<<2);yb=h;return}}function kJ(a,b){a=a|0;b=b|0;return b-a>>2|0}function lJ(a){a=a|0;ua()}function mJ(a){a=a|0;AF(a);return}function nJ(a){a=a|0;AF(a);QA(a);return}function oJ(a){a=a|0;return 127}function pJ(a){a=a|0;return 127}function qJ(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[a+(b<<2)>>2]=0;b=b+1|0}return}function rJ(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[a+(b<<2)>>2]=0;b=b+1|0}return}function sJ(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[a+(b<<2)>>2]=0;b=b+1|0}return}function tJ(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;fO(a,1,45);return}function uJ(a){a=a|0;return 0}function vJ(b,c){b=b|0;c=c|0;a[b>>0]=2;a[b+1>>0]=3;a[b+2>>0]=0;a[b+3>>0]=4;return}function wJ(b,c){b=b|0;c=c|0;a[b>>0]=2;a[b+1>>0]=3;a[b+2>>0]=0;a[b+3>>0]=4;return}function xJ(a){a=a|0;AF(a);return}function yJ(a){a=a|0;AF(a);QA(a);return}function zJ(a){a=a|0;return 127}function AJ(a){a=a|0;return 127}function BJ(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[a+(b<<2)>>2]=0;b=b+1|0}return}function CJ(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[a+(b<<2)>>2]=0;b=b+1|0}return}function DJ(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[a+(b<<2)>>2]=0;b=b+1|0}return}function EJ(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;fO(a,1,45);return}function FJ(a){a=a|0;return 0}function GJ(b,c){b=b|0;c=c|0;a[b>>0]=2;a[b+1>>0]=3;a[b+2>>0]=0;a[b+3>>0]=4;return}function HJ(b,c){b=b|0;c=c|0;a[b>>0]=2;a[b+1>>0]=3;a[b+2>>0]=0;a[b+3>>0]=4;return}function IJ(a){a=a|0;AF(a);return}function JJ(a){a=a|0;AF(a);QA(a);return}function KJ(a){a=a|0;return 2147483647}function LJ(a){a=a|0;return 2147483647}function MJ(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[a+(b<<2)>>2]=0;b=b+1|0}return}function NJ(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[a+(b<<2)>>2]=0;b=b+1|0}return}function OJ(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[a+(b<<2)>>2]=0;b=b+1|0}return}function PJ(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;sO(a,1,45);return}function QJ(a){a=a|0;return 0}function RJ(b,c){b=b|0;c=c|0;a[b>>0]=2;a[b+1>>0]=3;a[b+2>>0]=0;a[b+3>>0]=4;return}function SJ(b,c){b=b|0;c=c|0;a[b>>0]=2;a[b+1>>0]=3;a[b+2>>0]=0;a[b+3>>0]=4;return}function TJ(a){a=a|0;AF(a);return}function UJ(a){a=a|0;AF(a);QA(a);return}function VJ(a){a=a|0;return 2147483647}function WJ(a){a=a|0;return 2147483647}function XJ(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[a+(b<<2)>>2]=0;b=b+1|0}return}function YJ(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[a+(b<<2)>>2]=0;b=b+1|0}return}function ZJ(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[a+(b<<2)>>2]=0;b=b+1|0}return}function _J(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;sO(a,1,45);return}function $J(a){a=a|0;return 0}function aK(b,c){b=b|0;c=c|0;a[b>>0]=2;a[b+1>>0]=3;a[b+2>>0]=0;a[b+3>>0]=4;return}function bK(b,c){b=b|0;c=c|0;a[b>>0]=2;a[b+1>>0]=3;a[b+2>>0]=0;a[b+3>>0]=4;return}function cK(a){a=a|0;AF(a);return}function dK(a){a=a|0;AF(a);QA(a);return}function eK(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;v=yb;yb=yb+256|0;n=v+240|0;q=v+216|0;m=v+112|0;u=v+232|0;p=v+228|0;s=v+224|0;j=v+250|0;w=v+220|0;o=v;c[u>>2]=m;c[u+4>>2]=145;GE(s,g);b=VF(s,56736)|0;a[j>>0]=0;c[w>>2]=c[e>>2];l=c[g+4>>2]|0;c[n>>2]=c[w>>2];if(hK(d,n,f,s,l,h,j,b,u,p,m+100|0)|0){Ib[c[(c[b>>2]|0)+32>>2]&15](b,50465,50475,n)|0;l=c[p>>2]|0;f=c[u>>2]|0;b=l-f|0;if((b|0)>98){b=DO(b+2|0)|0;if(!b)_N();else{k=b;r=b}}else{k=o;r=0}if(!(a[j>>0]|0))b=k;else{a[k>>0]=45;b=k+1|0}k=n+10|0;m=n;j=f;g=b;b=l;while(1){if(j>>>0>=b>>>0)break;f=a[j>>0]|0;b=n;while(1){if((b|0)==(k|0)){b=k;break}if((a[b>>0]|0)==f<<24>>24)break;b=b+1|0}a[g>>0]=a[50465+(b-m)>>0]|0;j=j+1|0;g=g+1|0;b=c[p>>2]|0}a[g>>0]=0;c[q>>2]=i;if((Az(o,50476,q)|0)!=1)lJ(0);if(r|0)EO(r)}b=c[d>>2]|0;do if(b){f=c[b+12>>2]|0;if((f|0)==(c[b+16>>2]|0))b=Eb[c[(c[b>>2]|0)+36>>2]&127](b)|0;else b=ag(a[f>>0]|0)|0;if(Yf(b,Uf()|0)|0){c[d>>2]=0;g=1;break}else{g=(c[d>>2]|0)==0;break}}else g=1;while(0);b=c[e>>2]|0;do if(b){f=c[b+12>>2]|0;if((f|0)==(c[b+16>>2]|0))b=Eb[c[(c[b>>2]|0)+36>>2]&127](b)|0;else b=ag(a[f>>0]|0)|0;if(!(Yf(b,Uf()|0)|0))if(g)break;else{t=34;break}else{c[e>>2]=0;t=32;break}}else t=32;while(0);if((t|0)==32?g:0)t=34;if((t|0)==34)c[h>>2]=c[h>>2]|2;f=c[d>>2]|0;WF(s);b=c[u>>2]|0;c[u>>2]=0;if(b|0)Qb[c[u+4>>2]&255](b);yb=v;return f|0}function fK(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=yb;yb=yb+128|0;j=s+120|0;b=s;r=s+112|0;m=s+108|0;p=s+100|0;k=s+124|0;n=s+104|0;c[r>>2]=b;c[r+4>>2]=145;GE(p,g);l=VF(p,56736)|0;a[k>>0]=0;o=c[e>>2]|0;c[n>>2]=o;g=c[g+4>>2]|0;c[j>>2]=c[n>>2];n=o;if(hK(d,j,f,p,g,h,k,l,r,m,b+100|0)|0){b=i+11|0;if((a[b>>0]|0)<0){f=c[i>>2]|0;a[j>>0]=0;$f(f,j);c[i+4>>2]=0}else{a[j>>0]=0;$f(i,j);a[b>>0]=0}if(a[k>>0]|0)qO(i,Gb[c[(c[l>>2]|0)+28>>2]&63](l,45)|0);k=Gb[c[(c[l>>2]|0)+28>>2]&63](l,48)|0;g=c[m>>2]|0;j=g+-1|0;b=c[r>>2]|0;while(1){if(b>>>0>=j>>>0)break;if((a[b>>0]|0)!=k<<24>>24)break;b=b+1|0}iK(i,b,g)|0}b=c[d>>2]|0;do if(b){g=c[b+12>>2]|0;if((g|0)==(c[b+16>>2]|0))b=Eb[c[(c[b>>2]|0)+36>>2]&127](b)|0;else b=ag(a[g>>0]|0)|0;if(Yf(b,Uf()|0)|0){c[d>>2]=0;g=1;break}else{g=(c[d>>2]|0)==0;break}}else g=1;while(0);do if(o){b=c[n+12>>2]|0;if((b|0)==(c[n+16>>2]|0))b=Eb[c[(c[o>>2]|0)+36>>2]&127](n)|0;else b=ag(a[b>>0]|0)|0;if(!(Yf(b,Uf()|0)|0))if(g)break;else{q=27;break}else{c[e>>2]=0;q=25;break}}else q=25;while(0);if((q|0)==25?g:0)q=27;if((q|0)==27)c[h>>2]=c[h>>2]|2;g=c[d>>2]|0;WF(p);b=c[r>>2]|0;c[r>>2]=0;if(b|0)Qb[c[r+4>>2]&255](b);yb=s;return g|0}function gK(a){a=a|0;return}function hK(e,f,g,h,i,j,k,l,m,n,o){e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;Y=yb;yb=yb+512|0;I=Y+488|0;O=Y;X=Y+480|0;Q=Y+472|0;J=Y+468|0;K=Y+496|0;L=Y+493|0;M=Y+492|0;S=Y+456|0;T=Y+444|0;U=Y+432|0;V=Y+420|0;W=Y+408|0;N=Y+404|0;R=Y+400|0;c[I>>2]=o;c[X>>2]=O;c[X+4>>2]=145;c[Q>>2]=O;c[J>>2]=O+400;c[S>>2]=0;c[S+4>>2]=0;c[S+8>>2]=0;o=0;while(1){if((o|0)==3)break;c[S+(o<<2)>>2]=0;o=o+1|0}c[T>>2]=0;c[T+4>>2]=0;c[T+8>>2]=0;o=0;while(1){if((o|0)==3)break;c[T+(o<<2)>>2]=0;o=o+1|0}c[U>>2]=0;c[U+4>>2]=0;c[U+8>>2]=0;o=0;while(1){if((o|0)==3)break;c[U+(o<<2)>>2]=0;o=o+1|0}c[V>>2]=0;c[V+4>>2]=0;c[V+8>>2]=0;o=0;while(1){if((o|0)==3)break;c[V+(o<<2)>>2]=0;o=o+1|0}c[W>>2]=0;c[W+4>>2]=0;c[W+8>>2]=0;o=0;while(1){if((o|0)==3)break;c[W+(o<<2)>>2]=0;o=o+1|0}kK(g,h,K,L,M,S,T,U,V,N);c[n>>2]=c[m>>2];B=l+8|0;C=U+11|0;D=U+4|0;E=V+11|0;F=V+4|0;G=S+11|0;H=S+4|0;v=(i&512|0)!=0;w=T+11|0;x=K+3|0;y=T+4|0;z=W+11|0;A=W+4|0;O=0;u=0;a:while(1){if(u>>>0>=4){P=243;break}o=c[e>>2]|0;do if(o){g=c[o+12>>2]|0;if((g|0)==(c[o+16>>2]|0))o=Eb[c[(c[o>>2]|0)+36>>2]&127](o)|0;else o=ag(a[g>>0]|0)|0;if(Yf(o,Uf()|0)|0){c[e>>2]=0;h=1;break}else{h=(c[e>>2]|0)==0;break}}else h=1;while(0);g=c[f>>2]|0;do if(g){o=c[g+12>>2]|0;if((o|0)==(c[g+16>>2]|0))o=Eb[c[(c[g>>2]|0)+36>>2]&127](g)|0;else o=ag(a[o>>0]|0)|0;if(!(Yf(o,Uf()|0)|0))if(h){t=g;break}else{P=243;break a}else{c[f>>2]=0;P=31;break}}else P=31;while(0);if((P|0)==31){P=0;if(h){P=243;break}else t=0}b:do switch(a[K+u>>0]|0){case 1:{if((u|0)==3)o=O;else{o=c[e>>2]|0;g=c[o+12>>2]|0;if((g|0)==(c[o+16>>2]|0))o=Eb[c[(c[o>>2]|0)+36>>2]&127](o)|0;else o=ag(a[g>>0]|0)|0;if((o&255)<<24>>24<=-1){P=45;break a}if(!(b[(c[B>>2]|0)+(o<<24>>24<<1)>>1]&8192)){P=45;break a}o=c[e>>2]|0;g=o+12|0;h=c[g>>2]|0;if((h|0)==(c[o+16>>2]|0))o=Eb[c[(c[o>>2]|0)+40>>2]&127](o)|0;else{c[g>>2]=h+1;o=ag(a[h>>0]|0)|0}qO(W,o&255);P=47}break}case 0:{if((u|0)==3)o=O;else P=47;break}case 3:{o=a[C>>0]|0;o=o<<24>>24<0?c[D>>2]|0:o&255;l=a[E>>0]|0;l=l<<24>>24<0?c[F>>2]|0:l&255;if((o|0)==(0-l|0))o=O;else{i=(o|0)==0;o=c[e>>2]|0;g=c[o+12>>2]|0;h=(g|0)==(c[o+16>>2]|0);if(i|(l|0)==0){if(h)o=Eb[c[(c[o>>2]|0)+36>>2]&127](o)|0;else o=ag(a[g>>0]|0)|0;o=o&255;if(i){if((a[((a[E>>0]|0)<0?c[V>>2]|0:V)>>0]|0)!=o<<24>>24){o=O;break b}o=c[e>>2]|0;g=o+12|0;h=c[g>>2]|0;if((h|0)==(c[o+16>>2]|0))Eb[c[(c[o>>2]|0)+40>>2]&127](o)|0;else{c[g>>2]=h+1;ag(a[h>>0]|0)|0}a[k>>0]=1;o=a[E>>0]|0;o=(o<<24>>24<0?c[F>>2]|0:o&255)>>>0>1?V:O;break b}if((a[((a[C>>0]|0)<0?c[U>>2]|0:U)>>0]|0)!=o<<24>>24){a[k>>0]=1;o=O;break b}o=c[e>>2]|0;g=o+12|0;h=c[g>>2]|0;if((h|0)==(c[o+16>>2]|0))Eb[c[(c[o>>2]|0)+40>>2]&127](o)|0;else{c[g>>2]=h+1;ag(a[h>>0]|0)|0}o=a[C>>0]|0;o=(o<<24>>24<0?c[D>>2]|0:o&255)>>>0>1?U:O;break b}if(h)o=Eb[c[(c[o>>2]|0)+36>>2]&127](o)|0;else o=ag(a[g>>0]|0)|0;g=c[e>>2]|0;h=g+12|0;l=c[h>>2]|0;i=(l|0)==(c[g+16>>2]|0);if((a[((a[C>>0]|0)<0?c[U>>2]|0:U)>>0]|0)==(o&255)<<24>>24){if(i)Eb[c[(c[g>>2]|0)+40>>2]&127](g)|0;else{c[h>>2]=l+1;ag(a[l>>0]|0)|0}o=a[C>>0]|0;o=(o<<24>>24<0?c[D>>2]|0:o&255)>>>0>1?U:O;break b}if(i)o=Eb[c[(c[g>>2]|0)+36>>2]&127](g)|0;else o=ag(a[l>>0]|0)|0;if((a[((a[E>>0]|0)<0?c[V>>2]|0:V)>>0]|0)!=(o&255)<<24>>24){P=105;break a}o=c[e>>2]|0;g=o+12|0;h=c[g>>2]|0;if((h|0)==(c[o+16>>2]|0))Eb[c[(c[o>>2]|0)+40>>2]&127](o)|0;else{c[g>>2]=h+1;ag(a[h>>0]|0)|0}a[k>>0]=1;o=a[E>>0]|0;o=(o<<24>>24<0?c[F>>2]|0:o&255)>>>0>1?V:O}break}case 2:{if(u>>>0<2|(O|0)!=0){o=a[w>>0]|0;h=o<<24>>24<0;g=c[T>>2]|0;l=h?g:T;i=l;if(!u)h=i;else{s=i;P=110}}else{if(!(v|(u|0)==2&(a[x>>0]|0)!=0)){o=0;break b}o=a[w>>0]|0;h=o<<24>>24<0;g=c[T>>2]|0;s=h?g:T;l=s;P=110}c:do if((P|0)==110){P=0;if((d[K+(u+-1)>>0]|0)<2){i=l+(h?c[y>>2]|0:o&255)|0;h=s;while(1){p=h;if((i|0)==(p|0))break;q=a[p>>0]|0;if(q<<24>>24<=-1)break;if(!(b[(c[B>>2]|0)+(q<<24>>24<<1)>>1]&8192))break;h=p+1|0}q=h-s|0;p=a[z>>0]|0;r=p<<24>>24<0;i=c[A>>2]|0;p=p&255;if(q>>>0<=(r?i:p)>>>0){Z=(c[W>>2]|0)+i|0;i=W+p|0;p=r?Z:i;i=r?Z+(0-q)|0:i+(0-q)|0;while(1){if((i|0)==(p|0))break c;if((a[i>>0]|0)!=(a[l>>0]|0)){h=s;break c}l=l+1|0;i=i+1|0}}else h=s}else h=s}while(0);i=h;h=t;d:while(1){Z=o<<24>>24<0;if((i|0)==((Z?g:T)+(Z?c[y>>2]|0:o&255)|0))break;o=c[e>>2]|0;do if(o){g=c[o+12>>2]|0;if((g|0)==(c[o+16>>2]|0))o=Eb[c[(c[o>>2]|0)+36>>2]&127](o)|0;else o=ag(a[g>>0]|0)|0;if(Yf(o,Uf()|0)|0){c[e>>2]=0;g=1;break}else{g=(c[e>>2]|0)==0;break}}else g=1;while(0);do if(h){o=c[h+12>>2]|0;if((o|0)==(c[h+16>>2]|0))o=Eb[c[(c[h>>2]|0)+36>>2]&127](h)|0;else o=ag(a[o>>0]|0)|0;if(!(Yf(o,Uf()|0)|0))if(g){l=h;break}else break d;else{c[f>>2]=0;P=136;break}}else P=136;while(0);if((P|0)==136){P=0;if(g)break;else l=0}o=c[e>>2]|0;g=c[o+12>>2]|0;if((g|0)==(c[o+16>>2]|0))o=Eb[c[(c[o>>2]|0)+36>>2]&127](o)|0;else o=ag(a[g>>0]|0)|0;if((a[i>>0]|0)!=(o&255)<<24>>24)break;o=c[e>>2]|0;g=o+12|0;h=c[g>>2]|0;if((h|0)==(c[o+16>>2]|0))Eb[c[(c[o>>2]|0)+40>>2]&127](o)|0;else{c[g>>2]=h+1;ag(a[h>>0]|0)|0}i=i+1|0;o=a[w>>0]|0;g=c[T>>2]|0;h=l}if(v?(Z=a[w>>0]|0,t=Z<<24>>24<0,(i|0)!=((t?c[T>>2]|0:T)+(t?c[y>>2]|0:Z&255)|0)):0){P=148;break a}else o=O;break}case 4:{i=0;l=t;o=t;e:while(1){g=c[e>>2]|0;do if(g){h=c[g+12>>2]|0;if((h|0)==(c[g+16>>2]|0))g=Eb[c[(c[g>>2]|0)+36>>2]&127](g)|0;else g=ag(a[h>>0]|0)|0;if(Yf(g,Uf()|0)|0){c[e>>2]=0;h=1;break}else{h=(c[e>>2]|0)==0;break}}else h=1;while(0);do if(l){g=c[l+12>>2]|0;if((g|0)==(c[l+16>>2]|0))g=Eb[c[(c[l>>2]|0)+36>>2]&127](l)|0;else g=ag(a[g>>0]|0)|0;if(!(Yf(g,Uf()|0)|0))if(h){p=l;break}else{l=o;break e}else{c[f>>2]=0;o=0;P=162;break}}else P=162;while(0);if((P|0)==162){P=0;if(h){l=o;break}else p=0}g=c[e>>2]|0;h=c[g+12>>2]|0;if((h|0)==(c[g+16>>2]|0))g=Eb[c[(c[g>>2]|0)+36>>2]&127](g)|0;else g=ag(a[h>>0]|0)|0;h=g&255;if(h<<24>>24>-1?(b[(c[B>>2]|0)+(g<<24>>24<<1)>>1]&2048)!=0:0){g=c[n>>2]|0;if((g|0)==(c[I>>2]|0)){lK(m,n,I);g=c[n>>2]|0}c[n>>2]=g+1;a[g>>0]=h;g=i+1|0}else{Z=a[G>>0]|0;if(!((a[M>>0]|0)==h<<24>>24&(i|0?((Z<<24>>24<0?c[H>>2]|0:Z&255)|0)!=0:0))){l=o;break}g=c[Q>>2]|0;if((g|0)==(c[J>>2]|0)){mK(X,Q,J);g=c[Q>>2]|0}c[Q>>2]=g+4;c[g>>2]=i;g=0}h=c[e>>2]|0;l=h+12|0;i=c[l>>2]|0;if((i|0)==(c[h+16>>2]|0))Eb[c[(c[h>>2]|0)+40>>2]&127](h)|0;else{c[l>>2]=i+1;ag(a[i>>0]|0)|0}i=g;l=p}o=c[Q>>2]|0;if(i|0?(c[X>>2]|0)!=(o|0):0){if((o|0)==(c[J>>2]|0)){mK(X,Q,J);o=c[Q>>2]|0}c[Q>>2]=o+4;c[o>>2]=i}f:do if((c[N>>2]|0)>0){o=c[e>>2]|0;do if(o){g=c[o+12>>2]|0;if((g|0)==(c[o+16>>2]|0))o=Eb[c[(c[o>>2]|0)+36>>2]&127](o)|0;else o=ag(a[g>>0]|0)|0;if(Yf(o,Uf()|0)|0){c[e>>2]=0;g=1;break}else{g=(c[e>>2]|0)==0;break}}else g=1;while(0);do if(l){o=c[l+12>>2]|0;if((o|0)==(c[l+16>>2]|0))o=Eb[c[(c[l>>2]|0)+36>>2]&127](l)|0;else o=ag(a[o>>0]|0)|0;if(!(Yf(o,Uf()|0)|0))if(g)break;else{P=204;break a}else{c[f>>2]=0;P=198;break}}else P=198;while(0);if((P|0)==198){P=0;if(g){P=204;break a}else l=0}o=c[e>>2]|0;g=c[o+12>>2]|0;if((g|0)==(c[o+16>>2]|0))o=Eb[c[(c[o>>2]|0)+36>>2]&127](o)|0;else o=ag(a[g>>0]|0)|0;if((a[L>>0]|0)!=(o&255)<<24>>24){P=204;break a}o=c[e>>2]|0;g=o+12|0;h=c[g>>2]|0;if((h|0)==(c[o+16>>2]|0))Eb[c[(c[o>>2]|0)+40>>2]&127](o)|0;else{c[g>>2]=h+1;ag(a[h>>0]|0)|0}h=l;while(1){if((c[N>>2]|0)<=0)break f;o=c[e>>2]|0;do if(o){g=c[o+12>>2]|0;if((g|0)==(c[o+16>>2]|0))o=Eb[c[(c[o>>2]|0)+36>>2]&127](o)|0;else o=ag(a[g>>0]|0)|0;if(Yf(o,Uf()|0)|0){c[e>>2]=0;g=1;break}else{g=(c[e>>2]|0)==0;break}}else g=1;while(0);do if(h){o=c[h+12>>2]|0;if((o|0)==(c[h+16>>2]|0))o=Eb[c[(c[h>>2]|0)+36>>2]&127](h)|0;else o=ag(a[o>>0]|0)|0;if(!(Yf(o,Uf()|0)|0))if(g){l=h;break}else{P=230;break a}else{c[f>>2]=0;P=223;break}}else P=223;while(0);if((P|0)==223){P=0;if(g){P=230;break a}else l=0}o=c[e>>2]|0;g=c[o+12>>2]|0;if((g|0)==(c[o+16>>2]|0))o=Eb[c[(c[o>>2]|0)+36>>2]&127](o)|0;else o=ag(a[g>>0]|0)|0;if((o&255)<<24>>24<=-1){P=230;break a}if(!(b[(c[B>>2]|0)+(o<<24>>24<<1)>>1]&2048)){P=230;break a}if((c[n>>2]|0)==(c[I>>2]|0))lK(m,n,I);o=c[e>>2]|0;g=c[o+12>>2]|0;if((g|0)==(c[o+16>>2]|0))o=Eb[c[(c[o>>2]|0)+36>>2]&127](o)|0;else o=ag(a[g>>0]|0)|0;g=c[n>>2]|0;c[n>>2]=g+1;a[g>>0]=o;c[N>>2]=(c[N>>2]|0)+-1;o=c[e>>2]|0;g=o+12|0;h=c[g>>2]|0;if((h|0)==(c[o+16>>2]|0))Eb[c[(c[o>>2]|0)+40>>2]&127](o)|0;else{c[g>>2]=h+1;ag(a[h>>0]|0)|0}h=l}}while(0);if((c[n>>2]|0)==(c[m>>2]|0)){P=241;break a}else o=O;break}default:o=O}while(0);g:do if((P|0)==47){P=0;h=t;while(1){o=c[e>>2]|0;do if(o){g=c[o+12>>2]|0;if((g|0)==(c[o+16>>2]|0))o=Eb[c[(c[o>>2]|0)+36>>2]&127](o)|0;else o=ag(a[g>>0]|0)|0;if(Yf(o,Uf()|0)|0){c[e>>2]=0;g=1;break}else{g=(c[e>>2]|0)==0;break}}else g=1;while(0);do if(h){o=c[h+12>>2]|0;if((o|0)==(c[h+16>>2]|0))o=Eb[c[(c[h>>2]|0)+36>>2]&127](h)|0;else o=ag(a[o>>0]|0)|0;if(!(Yf(o,Uf()|0)|0))if(g){l=h;break}else{o=O;break g}else{c[f>>2]=0;P=61;break}}else P=61;while(0);if((P|0)==61){P=0;if(g){o=O;break g}else l=0}o=c[e>>2]|0;g=c[o+12>>2]|0;if((g|0)==(c[o+16>>2]|0))o=Eb[c[(c[o>>2]|0)+36>>2]&127](o)|0;else o=ag(a[g>>0]|0)|0;if((o&255)<<24>>24<=-1){o=O;break g}if(!(b[(c[B>>2]|0)+(o<<24>>24<<1)>>1]&8192)){o=O;break g}o=c[e>>2]|0;g=o+12|0;h=c[g>>2]|0;if((h|0)==(c[o+16>>2]|0))o=Eb[c[(c[o>>2]|0)+40>>2]&127](o)|0;else{c[g>>2]=h+1;o=ag(a[h>>0]|0)|0}qO(W,o&255);h=l}}while(0);O=o;u=u+1|0}h:do if((P|0)==45){c[j>>2]=c[j>>2]|4;g=0}else if((P|0)==105){c[j>>2]=c[j>>2]|4;g=0}else if((P|0)==148){c[j>>2]=c[j>>2]|4;g=0}else if((P|0)==204){c[j>>2]=c[j>>2]|4;g=0}else if((P|0)==230){c[j>>2]=c[j>>2]|4;g=0}else if((P|0)==241){c[j>>2]=c[j>>2]|4;g=0}else if((P|0)==243){i:do if(O|0){i=O+11|0;p=O+4|0;l=1;j:while(1){o=a[i>>0]|0;if(o<<24>>24<0)o=c[p>>2]|0;else o=o&255;if(l>>>0>=o>>>0)break i;o=c[e>>2]|0;do if(o){g=c[o+12>>2]|0;if((g|0)==(c[o+16>>2]|0))o=Eb[c[(c[o>>2]|0)+36>>2]&127](o)|0;else o=ag(a[g>>0]|0)|0;if(Yf(o,Uf()|0)|0){c[e>>2]=0;h=1;break}else{h=(c[e>>2]|0)==0;break}}else h=1;while(0);o=c[f>>2]|0;do if(o){g=c[o+12>>2]|0;if((g|0)==(c[o+16>>2]|0))o=Eb[c[(c[o>>2]|0)+36>>2]&127](o)|0;else o=ag(a[g>>0]|0)|0;if(!(Yf(o,Uf()|0)|0))if(h)break;else break j;else{c[f>>2]=0;P=262;break}}else P=262;while(0);if((P|0)==262?(P=0,h):0)break;o=c[e>>2]|0;g=c[o+12>>2]|0;if((g|0)==(c[o+16>>2]|0))o=Eb[c[(c[o>>2]|0)+36>>2]&127](o)|0;else o=ag(a[g>>0]|0)|0;if((a[i>>0]|0)<0)g=c[O>>2]|0;else g=O;if((a[g+l>>0]|0)!=(o&255)<<24>>24)break;o=c[e>>2]|0;g=o+12|0;h=c[g>>2]|0;if((h|0)==(c[o+16>>2]|0))Eb[c[(c[o>>2]|0)+40>>2]&127](o)|0;else{c[g>>2]=h+1;ag(a[h>>0]|0)|0}l=l+1|0}c[j>>2]=c[j>>2]|4;g=0;break h}while(0);g=c[X>>2]|0;o=c[Q>>2]|0;if((g|0)!=(o|0)){c[R>>2]=0;iG(S,g,o,R);if(!(c[R>>2]|0)){g=1;break}else{c[j>>2]=c[j>>2]|4;g=0;break}}else g=1}while(0);hO(W);hO(V);hO(U);hO(T);hO(S);o=c[X>>2]|0;c[X>>2]=0;if(o|0)Qb[c[X+4>>2]&255](o);yb=Y;return g|0}function iK(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=yb;yb=yb+16|0;j=d;m=o;n=b+11|0;h=a[n>>0]|0;f=h<<24>>24<0;if(f){l=c[b+4>>2]|0;i=(c[b+8>>2]&2147483647)+-1|0}else{l=h&255;i=10}k=e-j|0;do if(k|0){if(f){g=c[b>>2]|0;f=c[b+4>>2]|0}else{g=b;f=h&255}if(jK(d,g,g+f|0)|0){c[m>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;_f(m,d,e);n=a[m+11>>0]|0;l=n<<24>>24<0;pO(b,l?c[m>>2]|0:m,l?c[m+4>>2]|0:n&255)|0;hO(m);break}if((i-l|0)>>>0>>0)oO(b,i,l+k-i|0,l,l,0,0);if((a[n>>0]|0)<0)h=c[b>>2]|0;else h=b;g=e+(l-j)|0;f=h+l|0;while(1){if((d|0)==(e|0))break;$f(f,d);f=f+1|0;d=d+1|0}a[m>>0]=0;$f(h+g|0,m);d=l+k|0;if((a[n>>0]|0)<0){c[b+4>>2]=d;break}else{a[n>>0]=d;break}}while(0);yb=o;return b|0}function jK(a,b,c){a=a|0;b=b|0;c=c|0;return b>>>0<=a>>>0&a>>>0>>0|0}function kK(b,d,e,f,g,h,i,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0;o=yb;yb=yb+16|0;m=o+12|0;n=o;if(b){d=VF(d,56968)|0;Sb[c[(c[d>>2]|0)+44>>2]&63](m,d);b=c[m>>2]|0;a[e>>0]=b;a[e+1>>0]=b>>8;a[e+2>>0]=b>>16;a[e+3>>0]=b>>24;Sb[c[(c[d>>2]|0)+32>>2]&63](n,d);b=k+11|0;if((a[b>>0]|0)<0){e=c[k>>2]|0;a[m>>0]=0;$f(e,m);c[k+4>>2]=0;if((a[b>>0]|0)<0){e=k+8|0;Nf(c[k>>2]|0,c[e>>2]&2147483647);c[e>>2]=0}}else{a[m>>0]=0;$f(k,m);a[b>>0]=0};c[k>>2]=c[n>>2];c[k+4>>2]=c[n+4>>2];c[k+8>>2]=c[n+8>>2];b=0;while(1){if((b|0)==3)break;c[n+(b<<2)>>2]=0;b=b+1|0}hO(n);Sb[c[(c[d>>2]|0)+28>>2]&63](n,d);b=j+11|0;if((a[b>>0]|0)<0){k=c[j>>2]|0;a[m>>0]=0;$f(k,m);c[j+4>>2]=0;if((a[b>>0]|0)<0){k=j+8|0;Nf(c[j>>2]|0,c[k>>2]&2147483647);c[k>>2]=0}}else{a[m>>0]=0;$f(j,m);a[b>>0]=0};c[j>>2]=c[n>>2];c[j+4>>2]=c[n+4>>2];c[j+8>>2]=c[n+8>>2];b=0;while(1){if((b|0)==3)break;c[n+(b<<2)>>2]=0;b=b+1|0}hO(n);a[f>>0]=Eb[c[(c[d>>2]|0)+12>>2]&127](d)|0;a[g>>0]=Eb[c[(c[d>>2]|0)+16>>2]&127](d)|0;Sb[c[(c[d>>2]|0)+20>>2]&63](n,d);b=h+11|0;if((a[b>>0]|0)<0){g=c[h>>2]|0;a[m>>0]=0;$f(g,m);c[h+4>>2]=0;if((a[b>>0]|0)<0){g=h+8|0;Nf(c[h>>2]|0,c[g>>2]&2147483647);c[g>>2]=0}}else{a[m>>0]=0;$f(h,m);a[b>>0]=0};c[h>>2]=c[n>>2];c[h+4>>2]=c[n+4>>2];c[h+8>>2]=c[n+8>>2];b=0;while(1){if((b|0)==3)break;c[n+(b<<2)>>2]=0;b=b+1|0}hO(n);Sb[c[(c[d>>2]|0)+24>>2]&63](n,d);b=i+11|0;if((a[b>>0]|0)<0){h=c[i>>2]|0;a[m>>0]=0;$f(h,m);c[i+4>>2]=0;if((a[b>>0]|0)<0){m=i+8|0;Nf(c[i>>2]|0,c[m>>2]&2147483647);c[m>>2]=0}}else{a[m>>0]=0;$f(i,m);a[b>>0]=0};c[i>>2]=c[n>>2];c[i+4>>2]=c[n+4>>2];c[i+8>>2]=c[n+8>>2];b=0;while(1){if((b|0)==3)break;c[n+(b<<2)>>2]=0;b=b+1|0}hO(n);b=Eb[c[(c[d>>2]|0)+36>>2]&127](d)|0}else{d=VF(d,56960)|0;Sb[c[(c[d>>2]|0)+44>>2]&63](m,d);b=c[m>>2]|0;a[e>>0]=b;a[e+1>>0]=b>>8;a[e+2>>0]=b>>16;a[e+3>>0]=b>>24;Sb[c[(c[d>>2]|0)+32>>2]&63](n,d);b=k+11|0;if((a[b>>0]|0)<0){e=c[k>>2]|0;a[m>>0]=0;$f(e,m);c[k+4>>2]=0;if((a[b>>0]|0)<0){e=k+8|0;Nf(c[k>>2]|0,c[e>>2]&2147483647);c[e>>2]=0}}else{a[m>>0]=0;$f(k,m);a[b>>0]=0};c[k>>2]=c[n>>2];c[k+4>>2]=c[n+4>>2];c[k+8>>2]=c[n+8>>2];b=0;while(1){if((b|0)==3)break;c[n+(b<<2)>>2]=0;b=b+1|0}hO(n);Sb[c[(c[d>>2]|0)+28>>2]&63](n,d);b=j+11|0;if((a[b>>0]|0)<0){k=c[j>>2]|0;a[m>>0]=0;$f(k,m);c[j+4>>2]=0;if((a[b>>0]|0)<0){k=j+8|0;Nf(c[j>>2]|0,c[k>>2]&2147483647);c[k>>2]=0}}else{a[m>>0]=0;$f(j,m);a[b>>0]=0};c[j>>2]=c[n>>2];c[j+4>>2]=c[n+4>>2];c[j+8>>2]=c[n+8>>2];b=0;while(1){if((b|0)==3)break;c[n+(b<<2)>>2]=0;b=b+1|0}hO(n);a[f>>0]=Eb[c[(c[d>>2]|0)+12>>2]&127](d)|0;a[g>>0]=Eb[c[(c[d>>2]|0)+16>>2]&127](d)|0;Sb[c[(c[d>>2]|0)+20>>2]&63](n,d);b=h+11|0;if((a[b>>0]|0)<0){g=c[h>>2]|0;a[m>>0]=0;$f(g,m);c[h+4>>2]=0;if((a[b>>0]|0)<0){g=h+8|0;Nf(c[h>>2]|0,c[g>>2]&2147483647);c[g>>2]=0}}else{a[m>>0]=0;$f(h,m);a[b>>0]=0};c[h>>2]=c[n>>2];c[h+4>>2]=c[n+4>>2];c[h+8>>2]=c[n+8>>2];b=0;while(1){if((b|0)==3)break;c[n+(b<<2)>>2]=0;b=b+1|0}hO(n);Sb[c[(c[d>>2]|0)+24>>2]&63](n,d);b=i+11|0;if((a[b>>0]|0)<0){h=c[i>>2]|0;a[m>>0]=0;$f(h,m);c[i+4>>2]=0;if((a[b>>0]|0)<0){m=i+8|0;Nf(c[i>>2]|0,c[m>>2]&2147483647);c[m>>2]=0}}else{a[m>>0]=0;$f(i,m);a[b>>0]=0};c[i>>2]=c[n>>2];c[i+4>>2]=c[n+4>>2];c[i+8>>2]=c[n+8>>2];b=0;while(1){if((b|0)==3)break;c[n+(b<<2)>>2]=0;b=b+1|0}hO(n);b=Eb[c[(c[d>>2]|0)+36>>2]&127](d)|0}c[l>>2]=b;yb=o;return}function lK(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;i=a+4|0;f=(c[i>>2]|0)!=145;e=c[a>>2]|0;h=e;j=(c[d>>2]|0)-h|0;g=j<<1;g=j>>>0<2147483647?((g|0)==0?1:g):-1;h=(c[b>>2]|0)-h|0;e=GO(f?e:0,g)|0;if(!e)_N();if(!f){f=c[a>>2]|0;c[a>>2]=e;if(f){Qb[c[i>>2]&255](f);e=c[a>>2]|0}}else c[a>>2]=e;c[i>>2]=146;c[b>>2]=e+h;c[d>>2]=(c[a>>2]|0)+g;return}function mK(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;i=a+4|0;f=(c[i>>2]|0)!=145;e=c[a>>2]|0;h=e;j=(c[d>>2]|0)-h|0;g=j<<1;g=j>>>0<2147483647?((g|0)==0?4:g):-1;h=(c[b>>2]|0)-h>>2;e=GO(f?e:0,g)|0;if(!e)_N();if(!f){f=c[a>>2]|0;c[a>>2]=e;if(f){Qb[c[i>>2]&255](f);e=c[a>>2]|0}}else c[a>>2]=e;c[i>>2]=146;c[b>>2]=e+(h<<2);c[d>>2]=(c[a>>2]|0)+(g>>>2<<2);return}function nK(a){a=a|0;AF(a);return}function oK(a){a=a|0;AF(a);QA(a);return}function pK(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;v=yb;yb=yb+592|0;n=v+512|0;q=v+552|0;m=v+112|0;u=v+568|0;p=v+564|0;s=v+560|0;j=v+576|0;w=v+556|0;o=v;c[u>>2]=m;c[u+4>>2]=145;GE(s,g);b=VF(s,56768)|0;a[j>>0]=0;c[w>>2]=c[e>>2];l=c[g+4>>2]|0;c[n>>2]=c[w>>2];if(rK(d,n,f,s,l,h,j,b,u,p,m+400|0)|0){Ib[c[(c[b>>2]|0)+48>>2]&15](b,50575,50585,n)|0;l=c[p>>2]|0;f=c[u>>2]|0;b=l-f|0;if((b|0)>392){b=DO((b>>>2)+2|0)|0;if(!b)_N();else{k=b;r=b}}else{k=o;r=0}if(!(a[j>>0]|0))b=k;else{a[k>>0]=45;b=k+1|0}k=n+40|0;m=n;j=f;g=b;b=l;while(1){if(j>>>0>=b>>>0)break;f=c[j>>2]|0;b=n;while(1){if((b|0)==(k|0)){b=k;break}if((c[b>>2]|0)==(f|0))break;b=b+4|0}a[g>>0]=a[50575+(b-m>>2)>>0]|0;j=j+4|0;g=g+1|0;b=c[p>>2]|0}a[g>>0]=0;c[q>>2]=i;if((Az(o,50476,q)|0)!=1)lJ(0);if(r|0)EO(r)}b=c[d>>2]|0;do if(b){f=c[b+12>>2]|0;if((f|0)==(c[b+16>>2]|0))b=Eb[c[(c[b>>2]|0)+36>>2]&127](b)|0;else b=hE(c[f>>2]|0)|0;if(HE(b,gE()|0)|0){c[d>>2]=0;g=1;break}else{g=(c[d>>2]|0)==0;break}}else g=1;while(0);b=c[e>>2]|0;do if(b){f=c[b+12>>2]|0;if((f|0)==(c[b+16>>2]|0))b=Eb[c[(c[b>>2]|0)+36>>2]&127](b)|0;else b=hE(c[f>>2]|0)|0;if(!(HE(b,gE()|0)|0))if(g)break;else{t=34;break}else{c[e>>2]=0;t=32;break}}else t=32;while(0);if((t|0)==32?g:0)t=34;if((t|0)==34)c[h>>2]=c[h>>2]|2;f=c[d>>2]|0;WF(s);b=c[u>>2]|0;c[u>>2]=0;if(b|0)Qb[c[u+4>>2]&255](b);yb=v;return f|0}function qK(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=yb;yb=yb+432|0;j=s+424|0;b=s;r=s+416|0;m=s+408|0;p=s+400|0;k=s+428|0;n=s+404|0;c[r>>2]=b;c[r+4>>2]=145;GE(p,g);l=VF(p,56768)|0;a[k>>0]=0;o=c[e>>2]|0;c[n>>2]=o;g=c[g+4>>2]|0;c[j>>2]=c[n>>2];n=o;if(rK(d,j,f,p,g,h,k,l,r,m,b+400|0)|0){b=i+8+3|0;if((a[b>>0]|0)<0){f=c[i>>2]|0;c[j>>2]=0;HF(f,j);c[i+4>>2]=0}else{c[j>>2]=0;HF(i,j);a[b>>0]=0}if(a[k>>0]|0)BO(i,Gb[c[(c[l>>2]|0)+44>>2]&63](l,45)|0);k=Gb[c[(c[l>>2]|0)+44>>2]&63](l,48)|0;g=c[m>>2]|0;j=g+-4|0;b=c[r>>2]|0;while(1){if(b>>>0>=j>>>0)break;if((c[b>>2]|0)!=(k|0))break;b=b+4|0}sK(i,b,g)|0}b=c[d>>2]|0;do if(b){g=c[b+12>>2]|0;if((g|0)==(c[b+16>>2]|0))b=Eb[c[(c[b>>2]|0)+36>>2]&127](b)|0;else b=hE(c[g>>2]|0)|0;if(HE(b,gE()|0)|0){c[d>>2]=0;g=1;break}else{g=(c[d>>2]|0)==0;break}}else g=1;while(0);do if(o){b=c[n+12>>2]|0;if((b|0)==(c[n+16>>2]|0))b=Eb[c[(c[o>>2]|0)+36>>2]&127](n)|0;else b=hE(c[b>>2]|0)|0;if(!(HE(b,gE()|0)|0))if(g)break;else{q=27;break}else{c[e>>2]=0;q=25;break}}else q=25;while(0);if((q|0)==25?g:0)q=27;if((q|0)==27)c[h>>2]=c[h>>2]|2;g=c[d>>2]|0;WF(p);b=c[r>>2]|0;c[r>>2]=0;if(b|0)Qb[c[r+4>>2]&255](b);yb=s;return g|0}function rK(b,e,f,g,h,i,j,k,l,m,n){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;X=yb;yb=yb+512|0;H=X+496|0;N=X;W=X+488|0;P=X+480|0;I=X+476|0;J=X+500|0;K=X+472|0;L=X+468|0;R=X+456|0;S=X+444|0;T=X+432|0;U=X+420|0;V=X+408|0;M=X+404|0;Q=X+400|0;c[H>>2]=n;c[W>>2]=N;c[W+4>>2]=145;c[P>>2]=N;c[I>>2]=N+400;c[R>>2]=0;c[R+4>>2]=0;c[R+8>>2]=0;n=0;while(1){if((n|0)==3)break;c[R+(n<<2)>>2]=0;n=n+1|0}c[S>>2]=0;c[S+4>>2]=0;c[S+8>>2]=0;n=0;while(1){if((n|0)==3)break;c[S+(n<<2)>>2]=0;n=n+1|0}c[T>>2]=0;c[T+4>>2]=0;c[T+8>>2]=0;n=0;while(1){if((n|0)==3)break;c[T+(n<<2)>>2]=0;n=n+1|0}c[U>>2]=0;c[U+4>>2]=0;c[U+8>>2]=0;n=0;while(1){if((n|0)==3)break;c[U+(n<<2)>>2]=0;n=n+1|0}c[V>>2]=0;c[V+4>>2]=0;c[V+8>>2]=0;n=0;while(1){if((n|0)==3)break;c[V+(n<<2)>>2]=0;n=n+1|0}vK(f,g,J,K,L,R,S,T,U,M);c[m>>2]=c[l>>2];B=T+8+3|0;C=T+4|0;D=U+8+3|0;E=U+4|0;F=R+11|0;G=R+4|0;v=(h&512|0)!=0;w=S+8+3|0;x=J+3|0;y=S+4|0;z=V+8+3|0;A=V+4|0;N=0;u=0;a:while(1){if(u>>>0>=4){O=239;break}n=c[b>>2]|0;do if(n){f=c[n+12>>2]|0;if((f|0)==(c[n+16>>2]|0))n=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else n=hE(c[f>>2]|0)|0;if(HE(n,gE()|0)|0){c[b>>2]=0;g=1;break}else{g=(c[b>>2]|0)==0;break}}else g=1;while(0);f=c[e>>2]|0;do if(f){n=c[f+12>>2]|0;if((n|0)==(c[f+16>>2]|0))n=Eb[c[(c[f>>2]|0)+36>>2]&127](f)|0;else n=hE(c[n>>2]|0)|0;if(!(HE(n,gE()|0)|0))if(g){t=f;break}else{O=239;break a}else{c[e>>2]=0;O=31;break}}else O=31;while(0);if((O|0)==31){O=0;if(g){O=239;break}else t=0}b:do switch(a[J+u>>0]|0){case 1:{if((u|0)==3)n=N;else{n=c[b>>2]|0;f=c[n+12>>2]|0;if((f|0)==(c[n+16>>2]|0))n=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else n=hE(c[f>>2]|0)|0;if(!(Hb[c[(c[k>>2]|0)+12>>2]&63](k,8192,n)|0)){O=44;break a}n=c[b>>2]|0;f=n+12|0;g=c[f>>2]|0;if((g|0)==(c[n+16>>2]|0))n=Eb[c[(c[n>>2]|0)+40>>2]&127](n)|0;else{c[f>>2]=g+4;n=hE(c[g>>2]|0)|0}BO(V,n);O=46}break}case 0:{if((u|0)==3)n=N;else O=46;break}case 3:{n=a[B>>0]|0;n=n<<24>>24<0?c[C>>2]|0:n&255;h=a[D>>0]|0;h=h<<24>>24<0?c[E>>2]|0:h&255;if((n|0)==(0-h|0))n=N;else{o=(n|0)==0;n=c[b>>2]|0;f=c[n+12>>2]|0;g=(f|0)==(c[n+16>>2]|0);if(o|(h|0)==0){if(g)n=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else n=hE(c[f>>2]|0)|0;if(o){if((n|0)!=(c[((a[D>>0]|0)<0?c[U>>2]|0:U)>>2]|0)){n=N;break b}n=c[b>>2]|0;f=n+12|0;g=c[f>>2]|0;if((g|0)==(c[n+16>>2]|0))Eb[c[(c[n>>2]|0)+40>>2]&127](n)|0;else{c[f>>2]=g+4;hE(c[g>>2]|0)|0}a[j>>0]=1;n=a[D>>0]|0;n=(n<<24>>24<0?c[E>>2]|0:n&255)>>>0>1?U:N;break b}if((n|0)!=(c[((a[B>>0]|0)<0?c[T>>2]|0:T)>>2]|0)){a[j>>0]=1;n=N;break b}n=c[b>>2]|0;f=n+12|0;g=c[f>>2]|0;if((g|0)==(c[n+16>>2]|0))Eb[c[(c[n>>2]|0)+40>>2]&127](n)|0;else{c[f>>2]=g+4;hE(c[g>>2]|0)|0}n=a[B>>0]|0;n=(n<<24>>24<0?c[C>>2]|0:n&255)>>>0>1?T:N;break b}if(g)n=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else n=hE(c[f>>2]|0)|0;f=c[b>>2]|0;g=f+12|0;h=c[g>>2]|0;o=(h|0)==(c[f+16>>2]|0);if((n|0)==(c[((a[B>>0]|0)<0?c[T>>2]|0:T)>>2]|0)){if(o)Eb[c[(c[f>>2]|0)+40>>2]&127](f)|0;else{c[g>>2]=h+4;hE(c[h>>2]|0)|0}n=a[B>>0]|0;n=(n<<24>>24<0?c[C>>2]|0:n&255)>>>0>1?T:N;break b}if(o)n=Eb[c[(c[f>>2]|0)+36>>2]&127](f)|0;else n=hE(c[h>>2]|0)|0;if((n|0)!=(c[((a[D>>0]|0)<0?c[U>>2]|0:U)>>2]|0)){O=103;break a}n=c[b>>2]|0;f=n+12|0;g=c[f>>2]|0;if((g|0)==(c[n+16>>2]|0))Eb[c[(c[n>>2]|0)+40>>2]&127](n)|0;else{c[f>>2]=g+4;hE(c[g>>2]|0)|0}a[j>>0]=1;n=a[D>>0]|0;n=(n<<24>>24<0?c[E>>2]|0:n&255)>>>0>1?U:N}break}case 2:{if(u>>>0<2|(N|0)!=0){f=a[w>>0]|0;g=c[S>>2]|0;n=f<<24>>24<0?g:S;if(u)O=108}else{if(!(v|(u|0)==2&(a[x>>0]|0)!=0)){n=0;break b}f=a[w>>0]|0;g=c[S>>2]|0;n=f<<24>>24<0?g:S;O=108}c:do if((O|0)==108){O=0;if((d[J+(u+-1)>>0]|0)<2){h=f;while(1){s=h<<24>>24<0;f=n;if(((s?g:S)+((s?c[y>>2]|0:h&255)<<2)|0)==(f|0)){f=h;break}if(!(Hb[c[(c[k>>2]|0)+12>>2]&63](k,8192,c[f>>2]|0)|0)){O=112;break}n=f+4|0;h=a[w>>0]|0;g=c[S>>2]|0}if((O|0)==112){O=0;f=a[w>>0]|0;g=c[S>>2]|0}o=f<<24>>24<0?g:S;s=o;q=n-s>>2;p=a[z>>0]|0;r=p<<24>>24<0;h=c[A>>2]|0;p=p&255;if(q>>>0>(r?h:p)>>>0)n=s;else{Y=(c[V>>2]|0)+(h<<2)|0;h=V+(p<<2)|0;p=r?Y:h;h=(r?Y:h)+(0-q<<2)|0;while(1){if((h|0)==(p|0))break c;if((c[h>>2]|0)!=(c[o>>2]|0)){n=s;break c}o=o+4|0;h=h+4|0}}}}while(0);o=n;h=t;d:while(1){Y=f<<24>>24<0;if((o|0)==((Y?g:S)+((Y?c[y>>2]|0:f&255)<<2)|0))break;n=c[b>>2]|0;do if(n){f=c[n+12>>2]|0;if((f|0)==(c[n+16>>2]|0))n=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else n=hE(c[f>>2]|0)|0;if(HE(n,gE()|0)|0){c[b>>2]=0;f=1;break}else{f=(c[b>>2]|0)==0;break}}else f=1;while(0);do if(h){n=c[h+12>>2]|0;if((n|0)==(c[h+16>>2]|0))n=Eb[c[(c[h>>2]|0)+36>>2]&127](h)|0;else n=hE(c[n>>2]|0)|0;if(!(HE(n,gE()|0)|0))if(f)break;else break d;else{c[e>>2]=0;O=134;break}}else O=134;while(0);if((O|0)==134){O=0;if(f)break;else h=0}n=c[b>>2]|0;f=c[n+12>>2]|0;if((f|0)==(c[n+16>>2]|0))n=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else n=hE(c[f>>2]|0)|0;if((n|0)!=(c[o>>2]|0))break;n=c[b>>2]|0;f=n+12|0;g=c[f>>2]|0;if((g|0)==(c[n+16>>2]|0))Eb[c[(c[n>>2]|0)+40>>2]&127](n)|0;else{c[f>>2]=g+4;hE(c[g>>2]|0)|0}o=o+4|0;f=a[w>>0]|0;g=c[S>>2]|0}if(v?(Y=a[w>>0]|0,t=Y<<24>>24<0,(o|0)!=((t?c[S>>2]|0:S)+((t?c[y>>2]|0:Y&255)<<2)|0)):0){O=146;break a}else n=N;break}case 4:{o=0;h=t;n=t;e:while(1){f=c[b>>2]|0;do if(f){g=c[f+12>>2]|0;if((g|0)==(c[f+16>>2]|0))f=Eb[c[(c[f>>2]|0)+36>>2]&127](f)|0;else f=hE(c[g>>2]|0)|0;if(HE(f,gE()|0)|0){c[b>>2]=0;g=1;break}else{g=(c[b>>2]|0)==0;break}}else g=1;while(0);do if(h){f=c[h+12>>2]|0;if((f|0)==(c[h+16>>2]|0))f=Eb[c[(c[h>>2]|0)+36>>2]&127](h)|0;else f=hE(c[f>>2]|0)|0;if(!(HE(f,gE()|0)|0))if(g){p=h;break}else{h=n;break e}else{c[e>>2]=0;n=0;O=160;break}}else O=160;while(0);if((O|0)==160){O=0;if(g){h=n;break}else p=0}f=c[b>>2]|0;g=c[f+12>>2]|0;if((g|0)==(c[f+16>>2]|0))g=Eb[c[(c[f>>2]|0)+36>>2]&127](f)|0;else g=hE(c[g>>2]|0)|0;if(Hb[c[(c[k>>2]|0)+12>>2]&63](k,2048,g)|0){f=c[m>>2]|0;if((f|0)==(c[H>>2]|0)){wK(l,m,H);f=c[m>>2]|0}c[m>>2]=f+4;c[f>>2]=g;f=o+1|0}else{Y=a[F>>0]|0;if(!((g|0)==(c[L>>2]|0)&(o|0?((Y<<24>>24<0?c[G>>2]|0:Y&255)|0)!=0:0))){h=n;break}f=c[P>>2]|0;if((f|0)==(c[I>>2]|0)){mK(W,P,I);f=c[P>>2]|0}c[P>>2]=f+4;c[f>>2]=o;f=0}g=c[b>>2]|0;h=g+12|0;o=c[h>>2]|0;if((o|0)==(c[g+16>>2]|0))Eb[c[(c[g>>2]|0)+40>>2]&127](g)|0;else{c[h>>2]=o+4;hE(c[o>>2]|0)|0}o=f;h=p}n=c[P>>2]|0;if(o|0?(c[W>>2]|0)!=(n|0):0){if((n|0)==(c[I>>2]|0)){mK(W,P,I);n=c[P>>2]|0}c[P>>2]=n+4;c[n>>2]=o}f:do if((c[M>>2]|0)>0){n=c[b>>2]|0;do if(n){f=c[n+12>>2]|0;if((f|0)==(c[n+16>>2]|0))n=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else n=hE(c[f>>2]|0)|0;if(HE(n,gE()|0)|0){c[b>>2]=0;f=1;break}else{f=(c[b>>2]|0)==0;break}}else f=1;while(0);do if(h){n=c[h+12>>2]|0;if((n|0)==(c[h+16>>2]|0))n=Eb[c[(c[h>>2]|0)+36>>2]&127](h)|0;else n=hE(c[n>>2]|0)|0;if(!(HE(n,gE()|0)|0))if(f)break;else{O=201;break a}else{c[e>>2]=0;O=195;break}}else O=195;while(0);if((O|0)==195){O=0;if(f){O=201;break a}else h=0}n=c[b>>2]|0;f=c[n+12>>2]|0;if((f|0)==(c[n+16>>2]|0))n=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else n=hE(c[f>>2]|0)|0;if((n|0)!=(c[K>>2]|0)){O=201;break a}n=c[b>>2]|0;f=n+12|0;g=c[f>>2]|0;if((g|0)==(c[n+16>>2]|0))Eb[c[(c[n>>2]|0)+40>>2]&127](n)|0;else{c[f>>2]=g+4;hE(c[g>>2]|0)|0}g=h;while(1){if((c[M>>2]|0)<=0)break f;n=c[b>>2]|0;do if(n){f=c[n+12>>2]|0;if((f|0)==(c[n+16>>2]|0))n=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else n=hE(c[f>>2]|0)|0;if(HE(n,gE()|0)|0){c[b>>2]=0;f=1;break}else{f=(c[b>>2]|0)==0;break}}else f=1;while(0);do if(g){n=c[g+12>>2]|0;if((n|0)==(c[g+16>>2]|0))n=Eb[c[(c[g>>2]|0)+36>>2]&127](g)|0;else n=hE(c[n>>2]|0)|0;if(!(HE(n,gE()|0)|0))if(f){h=g;break}else{O=226;break a}else{c[e>>2]=0;O=220;break}}else O=220;while(0);if((O|0)==220){O=0;if(f){O=226;break a}else h=0}n=c[b>>2]|0;f=c[n+12>>2]|0;if((f|0)==(c[n+16>>2]|0))n=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else n=hE(c[f>>2]|0)|0;if(!(Hb[c[(c[k>>2]|0)+12>>2]&63](k,2048,n)|0)){O=226;break a}if((c[m>>2]|0)==(c[H>>2]|0))wK(l,m,H);n=c[b>>2]|0;f=c[n+12>>2]|0;if((f|0)==(c[n+16>>2]|0))n=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else n=hE(c[f>>2]|0)|0;f=c[m>>2]|0;c[m>>2]=f+4;c[f>>2]=n;c[M>>2]=(c[M>>2]|0)+-1;n=c[b>>2]|0;f=n+12|0;g=c[f>>2]|0;if((g|0)==(c[n+16>>2]|0))Eb[c[(c[n>>2]|0)+40>>2]&127](n)|0;else{c[f>>2]=g+4;hE(c[g>>2]|0)|0}g=h}}while(0);if((c[m>>2]|0)==(c[l>>2]|0)){O=237;break a}else n=N;break}default:n=N}while(0);g:do if((O|0)==46){O=0;g=t;while(1){n=c[b>>2]|0;do if(n){f=c[n+12>>2]|0;if((f|0)==(c[n+16>>2]|0))n=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else n=hE(c[f>>2]|0)|0;if(HE(n,gE()|0)|0){c[b>>2]=0;f=1;break}else{f=(c[b>>2]|0)==0;break}}else f=1;while(0);do if(g){n=c[g+12>>2]|0;if((n|0)==(c[g+16>>2]|0))n=Eb[c[(c[g>>2]|0)+36>>2]&127](g)|0;else n=hE(c[n>>2]|0)|0;if(!(HE(n,gE()|0)|0))if(f){h=g;break}else{n=N;break g}else{c[e>>2]=0;O=60;break}}else O=60;while(0);if((O|0)==60){O=0;if(f){n=N;break g}else h=0}n=c[b>>2]|0;f=c[n+12>>2]|0;if((f|0)==(c[n+16>>2]|0))n=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else n=hE(c[f>>2]|0)|0;if(!(Hb[c[(c[k>>2]|0)+12>>2]&63](k,8192,n)|0)){n=N;break g}n=c[b>>2]|0;f=n+12|0;g=c[f>>2]|0;if((g|0)==(c[n+16>>2]|0))n=Eb[c[(c[n>>2]|0)+40>>2]&127](n)|0;else{c[f>>2]=g+4;n=hE(c[g>>2]|0)|0}BO(V,n);g=h}}while(0);N=n;u=u+1|0}h:do if((O|0)==44){c[i>>2]=c[i>>2]|4;f=0}else if((O|0)==103){c[i>>2]=c[i>>2]|4;f=0}else if((O|0)==146){c[i>>2]=c[i>>2]|4;f=0}else if((O|0)==201){c[i>>2]=c[i>>2]|4;f=0}else if((O|0)==226){c[i>>2]=c[i>>2]|4;f=0}else if((O|0)==237){c[i>>2]=c[i>>2]|4;f=0}else if((O|0)==239){i:do if(N|0){o=N+8+3|0;p=N+4|0;h=1;j:while(1){n=a[o>>0]|0;if(n<<24>>24<0)n=c[p>>2]|0;else n=n&255;if(h>>>0>=n>>>0)break i;n=c[b>>2]|0;do if(n){f=c[n+12>>2]|0;if((f|0)==(c[n+16>>2]|0))n=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else n=hE(c[f>>2]|0)|0;if(HE(n,gE()|0)|0){c[b>>2]=0;g=1;break}else{g=(c[b>>2]|0)==0;break}}else g=1;while(0);n=c[e>>2]|0;do if(n){f=c[n+12>>2]|0;if((f|0)==(c[n+16>>2]|0))n=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else n=hE(c[f>>2]|0)|0;if(!(HE(n,gE()|0)|0))if(g)break;else break j;else{c[e>>2]=0;O=258;break}}else O=258;while(0);if((O|0)==258?(O=0,g):0)break;n=c[b>>2]|0;f=c[n+12>>2]|0;if((f|0)==(c[n+16>>2]|0))n=Eb[c[(c[n>>2]|0)+36>>2]&127](n)|0;else n=hE(c[f>>2]|0)|0;if((a[o>>0]|0)<0)f=c[N>>2]|0;else f=N;if((n|0)!=(c[f+(h<<2)>>2]|0))break;n=c[b>>2]|0;f=n+12|0;g=c[f>>2]|0;if((g|0)==(c[n+16>>2]|0))Eb[c[(c[n>>2]|0)+40>>2]&127](n)|0;else{c[f>>2]=g+4;hE(c[g>>2]|0)|0}h=h+1|0}c[i>>2]=c[i>>2]|4;f=0;break h}while(0);f=c[W>>2]|0;n=c[P>>2]|0;if((f|0)!=(n|0)){c[Q>>2]=0;iG(R,f,n,Q);if(!(c[Q>>2]|0)){f=1;break}else{c[i>>2]=c[i>>2]|4;f=0;break}}else f=1}while(0);uO(V);uO(U);uO(T);uO(S);hO(R);n=c[W>>2]|0;c[W>>2]=0;if(n|0)Qb[c[W+4>>2]&255](n);yb=X;return f|0}function sK(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;n=yb;yb=yb+16|0;k=n;f=b+8|0;m=f+3|0;i=a[m>>0]|0;g=i<<24>>24<0;if(g){l=c[b+4>>2]|0;h=(c[f>>2]&2147483647)+-1|0}else{l=i&255;h=1}f=e-d|0;j=f>>2;do if(f|0){if(g){g=c[b>>2]|0;f=c[b+4>>2]|0}else{g=b;f=i&255}if(tK(d,g,g+(f<<2)|0)|0){c[k>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;uK(k,d,e);m=a[k+8+3>>0]|0;l=m<<24>>24<0;AO(b,l?c[k>>2]|0:k,l?c[k+4>>2]|0:m&255)|0;uO(k);break}if((h-l|0)>>>0>>0)zO(b,h,l+j-h|0,l,l,0,0);if((a[m>>0]|0)<0)f=c[b>>2]|0;else f=b;f=f+(l<<2)|0;while(1){if((d|0)==(e|0))break;HF(f,d);f=f+4|0;d=d+4|0}c[k>>2]=0;HF(f,k);d=l+j|0;if((a[m>>0]|0)<0){c[b+4>>2]=d;break}else{a[m>>0]=d;break}}while(0);yb=n;return b|0}function tK(a,b,c){a=a|0;b=b|0;c=c|0;return b>>>0<=a>>>0&a>>>0>>0|0}function uK(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=yb;yb=yb+16|0;i=j;h=e-d>>2;if(h>>>0>1073741807)cO(b);do if(h>>>0>=2){g=h+4&-4;if(g>>>0>1073741823)ua();else{f=rB(g<<2)|0;c[b>>2]=f;c[b+8>>2]=g|-2147483648;c[b+4>>2]=h;break}}else{a[b+8+3>>0]=h;f=b}while(0);while(1){if((d|0)==(e|0))break;HF(f,d);d=d+4|0;f=f+4|0}c[i>>2]=0;HF(f,i);yb=j;return}function vK(b,d,e,f,g,h,i,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0;p=yb;yb=yb+16|0;n=p+12|0;o=p;if(b){m=VF(d,56984)|0;Sb[c[(c[m>>2]|0)+44>>2]&63](n,m);b=c[n>>2]|0;a[e>>0]=b;a[e+1>>0]=b>>8;a[e+2>>0]=b>>16;a[e+3>>0]=b>>24;Sb[c[(c[m>>2]|0)+32>>2]&63](o,m);b=k+8|0;d=b+3|0;if((a[d>>0]|0)<0){e=c[k>>2]|0;c[n>>2]=0;HF(e,n);c[k+4>>2]=0;if((a[d>>0]|0)<0){Nf(c[k>>2]|0,c[b>>2]<<2);c[b>>2]=0}}else{c[n>>2]=0;HF(k,n);a[d>>0]=0};c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}uO(o);Sb[c[(c[m>>2]|0)+28>>2]&63](o,m);b=j+8|0;d=b+3|0;if((a[d>>0]|0)<0){k=c[j>>2]|0;c[n>>2]=0;HF(k,n);c[j+4>>2]=0;if((a[d>>0]|0)<0){Nf(c[j>>2]|0,c[b>>2]<<2);c[b>>2]=0}}else{c[n>>2]=0;HF(j,n);a[d>>0]=0};c[j>>2]=c[o>>2];c[j+4>>2]=c[o+4>>2];c[j+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}uO(o);c[f>>2]=Eb[c[(c[m>>2]|0)+12>>2]&127](m)|0;c[g>>2]=Eb[c[(c[m>>2]|0)+16>>2]&127](m)|0;Sb[c[(c[m>>2]|0)+20>>2]&63](o,m);b=h+11|0;if((a[b>>0]|0)<0){g=c[h>>2]|0;a[n>>0]=0;$f(g,n);c[h+4>>2]=0;if((a[b>>0]|0)<0){g=h+8|0;Nf(c[h>>2]|0,c[g>>2]&2147483647);c[g>>2]=0}}else{a[n>>0]=0;$f(h,n);a[b>>0]=0};c[h>>2]=c[o>>2];c[h+4>>2]=c[o+4>>2];c[h+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}hO(o);Sb[c[(c[m>>2]|0)+24>>2]&63](o,m);b=i+8|0;d=b+3|0;if((a[d>>0]|0)<0){h=c[i>>2]|0;c[n>>2]=0;HF(h,n);c[i+4>>2]=0;if((a[d>>0]|0)<0){Nf(c[i>>2]|0,c[b>>2]<<2);c[b>>2]=0}}else{c[n>>2]=0;HF(i,n);a[d>>0]=0};c[i>>2]=c[o>>2];c[i+4>>2]=c[o+4>>2];c[i+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}uO(o);b=Eb[c[(c[m>>2]|0)+36>>2]&127](m)|0}else{m=VF(d,56976)|0;Sb[c[(c[m>>2]|0)+44>>2]&63](n,m);b=c[n>>2]|0;a[e>>0]=b;a[e+1>>0]=b>>8;a[e+2>>0]=b>>16;a[e+3>>0]=b>>24;Sb[c[(c[m>>2]|0)+32>>2]&63](o,m);b=k+8|0;d=b+3|0;if((a[d>>0]|0)<0){e=c[k>>2]|0;c[n>>2]=0;HF(e,n);c[k+4>>2]=0;if((a[d>>0]|0)<0){Nf(c[k>>2]|0,c[b>>2]<<2);c[b>>2]=0}}else{c[n>>2]=0;HF(k,n);a[d>>0]=0};c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}uO(o);Sb[c[(c[m>>2]|0)+28>>2]&63](o,m);b=j+8|0;d=b+3|0;if((a[d>>0]|0)<0){k=c[j>>2]|0;c[n>>2]=0;HF(k,n);c[j+4>>2]=0;if((a[d>>0]|0)<0){Nf(c[j>>2]|0,c[b>>2]<<2);c[b>>2]=0}}else{c[n>>2]=0;HF(j,n);a[d>>0]=0};c[j>>2]=c[o>>2];c[j+4>>2]=c[o+4>>2];c[j+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}uO(o);c[f>>2]=Eb[c[(c[m>>2]|0)+12>>2]&127](m)|0;c[g>>2]=Eb[c[(c[m>>2]|0)+16>>2]&127](m)|0;Sb[c[(c[m>>2]|0)+20>>2]&63](o,m);b=h+11|0;if((a[b>>0]|0)<0){g=c[h>>2]|0;a[n>>0]=0;$f(g,n);c[h+4>>2]=0;if((a[b>>0]|0)<0){g=h+8|0;Nf(c[h>>2]|0,c[g>>2]&2147483647);c[g>>2]=0}}else{a[n>>0]=0;$f(h,n);a[b>>0]=0};c[h>>2]=c[o>>2];c[h+4>>2]=c[o+4>>2];c[h+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}hO(o);Sb[c[(c[m>>2]|0)+24>>2]&63](o,m);b=i+8|0;d=b+3|0;if((a[d>>0]|0)<0){h=c[i>>2]|0;c[n>>2]=0;HF(h,n);c[i+4>>2]=0;if((a[d>>0]|0)<0){Nf(c[i>>2]|0,c[b>>2]<<2);c[b>>2]=0}}else{c[n>>2]=0;HF(i,n);a[d>>0]=0};c[i>>2]=c[o>>2];c[i+4>>2]=c[o+4>>2];c[i+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}uO(o);b=Eb[c[(c[m>>2]|0)+36>>2]&127](m)|0}c[l>>2]=b;yb=p;return}function wK(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;i=a+4|0;f=(c[i>>2]|0)!=145;e=c[a>>2]|0;h=e;j=(c[d>>2]|0)-h|0;g=j<<1;g=j>>>0<2147483647?((g|0)==0?4:g):-1;h=(c[b>>2]|0)-h>>2;e=GO(f?e:0,g)|0;if(!e)_N();if(!f){f=c[a>>2]|0;c[a>>2]=e;if(f){Qb[c[i>>2]&255](f);e=c[a>>2]|0}}else c[a>>2]=e;c[i>>2]=146;c[b>>2]=e+(h<<2);c[d>>2]=(c[a>>2]|0)+(g>>>2<<2);return}function xK(a){a=a|0;AF(a);return}function yK(a){a=a|0;AF(a);QA(a);return}function zK(b,d,e,f,h,i){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=+i;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;E=yb;yb=yb+416|0;q=E+336|0;k=E+328|0;b=E+224|0;l=E+400|0;j=E+112|0;D=E+396|0;r=E+408|0;s=E+405|0;t=E+404|0;A=E+384|0;B=E+372|0;C=E+360|0;o=E+356|0;p=E;u=E+352|0;v=E+344|0;w=E+348|0;c[l>>2]=b;g[q>>3]=i;b=$y(b,100,50681,q)|0;if(b>>>0>99){b=YF()|0;g[k>>3]=i;b=sH(l,b,50681,k)|0;j=c[l>>2]|0;if(!j)_N();k=DO(b)|0;if(!k)_N();else{x=k;z=b;G=k;H=j}}else{x=j;z=b;G=0;H=0}GE(D,f);n=VF(D,56736)|0;m=c[l>>2]|0;Ib[c[(c[n>>2]|0)+32>>2]&15](n,m,m+z|0,x)|0;if(!z)m=0;else m=(a[c[l>>2]>>0]|0)==45;c[A>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[A+(b<<2)>>2]=0;b=b+1|0}c[B>>2]=0;c[B+4>>2]=0;c[B+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[B+(b<<2)>>2]=0;b=b+1|0}c[C>>2]=0;c[C+4>>2]=0;c[C+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[C+(b<<2)>>2]=0;b=b+1|0}BK(e,m,D,r,s,t,A,B,C,o);l=c[o>>2]|0;if((z|0)>(l|0)){k=a[C+11>>0]|0;b=a[B+11>>0]|0;b=b<<24>>24<0?c[B+4>>2]|0:b&255;j=l+1+(z-l<<1)|0;k=k<<24>>24<0?c[C+4>>2]|0:k&255}else{k=a[C+11>>0]|0;b=a[B+11>>0]|0;b=b<<24>>24<0?c[B+4>>2]|0:b&255;j=l+2|0;k=k<<24>>24<0?c[C+4>>2]|0:k&255}b=j+k+b|0;if(b>>>0>100){b=DO(b)|0;if(!b)_N();else{y=b;F=b}}else{y=p;F=0}CK(y,u,v,c[f+4>>2]|0,x,x+z|0,n,m,r,a[s>>0]|0,a[t>>0]|0,A,B,C,l);c[w>>2]=c[d>>2];d=c[u>>2]|0;b=c[v>>2]|0;c[q>>2]=c[w>>2];b=Zf(q,y,d,b,f,h)|0;if(F|0)EO(F);hO(C);hO(B);hO(A);WF(D);if(G|0)EO(G);if(H|0)EO(H);yb=E;return b|0}function AK(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 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;C=yb;yb=yb+176|0;p=C+156|0;B=C+152|0;u=C+164|0;v=C+161|0;w=C+160|0;y=C+140|0;z=C+128|0;A=C+116|0;l=C+112|0;n=C;q=C+108|0;r=C+104|0;s=C+100|0;GE(B,f);t=VF(B,56736)|0;i=h+11|0;o=a[i>>0]|0;b=o<<24>>24<0;j=h+4|0;if(!((b?c[j>>2]|0:o&255)|0))o=0;else{o=a[(b?c[h>>2]|0:h)>>0]|0;o=o<<24>>24==(Gb[c[(c[t>>2]|0)+28>>2]&63](t,45)|0)<<24>>24};c[y>>2]=0;c[y+4>>2]=0;c[y+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[y+(b<<2)>>2]=0;b=b+1|0}c[z>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[z+(b<<2)>>2]=0;b=b+1|0}c[A>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[A+(b<<2)>>2]=0;b=b+1|0}BK(e,o,B,u,v,w,y,z,A,l);k=a[i>>0]|0;m=k<<24>>24<0;k=m?c[j>>2]|0:k&255;j=c[l>>2]|0;if((k|0)>(j|0)){e=a[A+11>>0]|0;b=a[z+11>>0]|0;b=b<<24>>24<0?c[z+4>>2]|0:b&255;i=j+1+(k-j<<1)|0;e=e<<24>>24<0?c[A+4>>2]|0:e&255}else{e=a[A+11>>0]|0;b=a[z+11>>0]|0;b=b<<24>>24<0?c[z+4>>2]|0:b&255;i=j+2|0;e=e<<24>>24<0?c[A+4>>2]|0:e&255}b=i+e+b|0;if(b>>>0>100){b=DO(b)|0;if(!b)_N();else{x=b;D=b}}else{x=n;D=0}h=m?c[h>>2]|0:h;CK(x,q,r,c[f+4>>2]|0,h,h+k|0,t,o,u,a[v>>0]|0,a[w>>0]|0,y,z,A,j);c[s>>2]=c[d>>2];h=c[q>>2]|0;b=c[r>>2]|0;c[p>>2]=c[s>>2];b=Zf(p,x,h,b,f,g)|0;if(D|0)EO(D);hO(A);hO(z);hO(y);WF(B);yb=C;return b|0}function BK(b,d,e,f,g,h,i,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0;p=yb;yb=yb+16|0;n=p+12|0;o=p;if(b){m=VF(e,56968)|0;if(d){Sb[c[(c[m>>2]|0)+44>>2]&63](n,m);b=c[n>>2]|0;a[f>>0]=b;a[f+1>>0]=b>>8;a[f+2>>0]=b>>16;a[f+3>>0]=b>>24;Sb[c[(c[m>>2]|0)+32>>2]&63](o,m);b=k+11|0;if((a[b>>0]|0)<0){f=c[k>>2]|0;a[n>>0]=0;$f(f,n);c[k+4>>2]=0;if((a[b>>0]|0)<0){f=k+8|0;Nf(c[k>>2]|0,c[f>>2]&2147483647);c[f>>2]=0}}else{a[n>>0]=0;$f(k,n);a[b>>0]=0};c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}hO(o);e=m}else{Sb[c[(c[m>>2]|0)+40>>2]&63](n,m);b=c[n>>2]|0;a[f>>0]=b;a[f+1>>0]=b>>8;a[f+2>>0]=b>>16;a[f+3>>0]=b>>24;Sb[c[(c[m>>2]|0)+28>>2]&63](o,m);b=k+11|0;if((a[b>>0]|0)<0){f=c[k>>2]|0;a[n>>0]=0;$f(f,n);c[k+4>>2]=0;if((a[b>>0]|0)<0){f=k+8|0;Nf(c[k>>2]|0,c[f>>2]&2147483647);c[f>>2]=0}}else{a[n>>0]=0;$f(k,n);a[b>>0]=0};c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}hO(o);e=m}a[g>>0]=Eb[c[(c[m>>2]|0)+12>>2]&127](m)|0;a[h>>0]=Eb[c[(c[m>>2]|0)+16>>2]&127](m)|0;Sb[c[(c[e>>2]|0)+20>>2]&63](o,m);b=i+11|0;if((a[b>>0]|0)<0){h=c[i>>2]|0;a[n>>0]=0;$f(h,n);c[i+4>>2]=0;if((a[b>>0]|0)<0){h=i+8|0;Nf(c[i>>2]|0,c[h>>2]&2147483647);c[h>>2]=0}}else{a[n>>0]=0;$f(i,n);a[b>>0]=0};c[i>>2]=c[o>>2];c[i+4>>2]=c[o+4>>2];c[i+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}hO(o);Sb[c[(c[e>>2]|0)+24>>2]&63](o,m);b=j+11|0;if((a[b>>0]|0)<0){i=c[j>>2]|0;a[n>>0]=0;$f(i,n);c[j+4>>2]=0;if((a[b>>0]|0)<0){n=j+8|0;Nf(c[j>>2]|0,c[n>>2]&2147483647);c[n>>2]=0}}else{a[n>>0]=0;$f(j,n);a[b>>0]=0};c[j>>2]=c[o>>2];c[j+4>>2]=c[o+4>>2];c[j+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}hO(o);b=Eb[c[(c[m>>2]|0)+36>>2]&127](m)|0}else{m=VF(e,56960)|0;if(d){Sb[c[(c[m>>2]|0)+44>>2]&63](n,m);b=c[n>>2]|0;a[f>>0]=b;a[f+1>>0]=b>>8;a[f+2>>0]=b>>16;a[f+3>>0]=b>>24;Sb[c[(c[m>>2]|0)+32>>2]&63](o,m);b=k+11|0;if((a[b>>0]|0)<0){f=c[k>>2]|0;a[n>>0]=0;$f(f,n);c[k+4>>2]=0;if((a[b>>0]|0)<0){f=k+8|0;Nf(c[k>>2]|0,c[f>>2]&2147483647);c[f>>2]=0}}else{a[n>>0]=0;$f(k,n);a[b>>0]=0};c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}hO(o);e=m}else{Sb[c[(c[m>>2]|0)+40>>2]&63](n,m);b=c[n>>2]|0;a[f>>0]=b;a[f+1>>0]=b>>8;a[f+2>>0]=b>>16;a[f+3>>0]=b>>24;Sb[c[(c[m>>2]|0)+28>>2]&63](o,m);b=k+11|0;if((a[b>>0]|0)<0){f=c[k>>2]|0;a[n>>0]=0;$f(f,n);c[k+4>>2]=0;if((a[b>>0]|0)<0){f=k+8|0;Nf(c[k>>2]|0,c[f>>2]&2147483647);c[f>>2]=0}}else{a[n>>0]=0;$f(k,n);a[b>>0]=0};c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}hO(o);e=m}a[g>>0]=Eb[c[(c[m>>2]|0)+12>>2]&127](m)|0;a[h>>0]=Eb[c[(c[m>>2]|0)+16>>2]&127](m)|0;Sb[c[(c[e>>2]|0)+20>>2]&63](o,m);b=i+11|0;if((a[b>>0]|0)<0){h=c[i>>2]|0;a[n>>0]=0;$f(h,n);c[i+4>>2]=0;if((a[b>>0]|0)<0){h=i+8|0;Nf(c[i>>2]|0,c[h>>2]&2147483647);c[h>>2]=0}}else{a[n>>0]=0;$f(i,n);a[b>>0]=0};c[i>>2]=c[o>>2];c[i+4>>2]=c[o+4>>2];c[i+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}hO(o);Sb[c[(c[e>>2]|0)+24>>2]&63](o,m);b=j+11|0;if((a[b>>0]|0)<0){i=c[j>>2]|0;a[n>>0]=0;$f(i,n);c[j+4>>2]=0;if((a[b>>0]|0)<0){n=j+8|0;Nf(c[j>>2]|0,c[n>>2]&2147483647);c[n>>2]=0}}else{a[n>>0]=0;$f(j,n);a[b>>0]=0};c[j>>2]=c[o>>2];c[j+4>>2]=c[o+4>>2];c[j+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}hO(o);b=Eb[c[(c[m>>2]|0)+36>>2]&127](m)|0}c[l>>2]=b;yb=p;return}function CK(d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;c[f>>2]=d;y=q+11|0;G=q+4|0;z=p+11|0;A=p+4|0;B=(g&512|0)==0;C=j+8|0;D=(r|0)>0;E=o+11|0;F=o+4|0;x=0;while(1){if((x|0)==4)break;a:do switch(a[l+x>>0]|0){case 0:{c[e>>2]=c[f>>2];break}case 1:{c[e>>2]=c[f>>2];v=Gb[c[(c[j>>2]|0)+28>>2]&63](j,32)|0;w=c[f>>2]|0;c[f>>2]=w+1;a[w>>0]=v;break}case 3:{w=a[y>>0]|0;s=w<<24>>24<0;if((s?c[G>>2]|0:w&255)|0){v=a[(s?c[q>>2]|0:q)>>0]|0;w=c[f>>2]|0;c[f>>2]=w+1;a[w>>0]=v}break}case 2:{t=a[z>>0]|0;s=t<<24>>24<0;t=s?c[A>>2]|0:t&255;if(!(B|(t|0)==0)){w=s?c[p>>2]|0:p;u=w+t|0;s=c[f>>2]|0;t=w;while(1){if((t|0)==(u|0))break;a[s>>0]=a[t>>0]|0;s=s+1|0;t=t+1|0}c[f>>2]=s}break}case 4:{t=c[f>>2]|0;h=k?h+1|0:h;u=h;while(1){if(u>>>0>=i>>>0)break;s=a[u>>0]|0;if(s<<24>>24<=-1)break;if(!(b[(c[C>>2]|0)+(s<<24>>24<<1)>>1]&2048))break;u=u+1|0}if(D){v=r;while(1){s=(v|0)>0;if(!(u>>>0>h>>>0&s))break;w=u+-1|0;H=a[w>>0]|0;s=c[f>>2]|0;c[f>>2]=s+1;a[s>>0]=H;v=v+-1|0;u=w}if(s)w=Gb[c[(c[j>>2]|0)+28>>2]&63](j,48)|0;else w=0;s=v;while(1){v=c[f>>2]|0;c[f>>2]=v+1;if((s|0)<=0)break;a[v>>0]=w;s=s+-1|0}a[v>>0]=m}b:do if((u|0)==(h|0)){w=Gb[c[(c[j>>2]|0)+28>>2]&63](j,48)|0;H=c[f>>2]|0;c[f>>2]=H+1;a[H>>0]=w}else{H=a[E>>0]|0;s=H<<24>>24<0;if(!((s?c[F>>2]|0:H&255)|0))s=-1;else s=a[(s?c[o>>2]|0:o)>>0]|0;v=0;w=0;while(1){if((u|0)==(h|0))break b;if((w|0)==(s|0)){H=c[f>>2]|0;c[f>>2]=H+1;a[H>>0]=n;v=v+1|0;H=a[E>>0]|0;s=H<<24>>24<0;if(v>>>0<(s?c[F>>2]|0:H&255)>>>0){s=a[(s?c[o>>2]|0:o)+v>>0]|0;s=s<<24>>24==127?-1:s<<24>>24;w=0}else{s=w;w=0}}H=u+-1|0;J=a[H>>0]|0;I=c[f>>2]|0;c[f>>2]=I+1;a[I>>0]=J;w=w+1|0;u=H}}while(0);s=c[f>>2]|0;if((t|0)!=(s|0))while(1){s=s+-1|0;if(t>>>0>=s>>>0)break a;J=a[t>>0]|0;a[t>>0]=a[s>>0]|0;a[s>>0]=J;t=t+1|0}break}default:{}}while(0);x=x+1|0}h=a[y>>0]|0;s=h<<24>>24<0;h=s?c[G>>2]|0:h&255;if(h>>>0>1){J=s?c[q>>2]|0:q;t=J+h|0;s=c[f>>2]|0;h=J;while(1){h=h+1|0;if((h|0)==(t|0))break;a[s>>0]=a[h>>0]|0;s=s+1|0}c[f>>2]=s}switch((g&176)<<24>>24){case 32:{c[e>>2]=c[f>>2];break}case 16:break;default:c[e>>2]=d}return}function DK(a){a=a|0;AF(a);return}function EK(a){a=a|0;AF(a);QA(a);return}function FK(b,d,e,f,h,i){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=+i;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;E=yb;yb=yb+992|0;q=E+912|0;k=E+904|0;b=E+800|0;l=E+984|0;j=E+400|0;D=E+980|0;r=E+988|0;s=E+976|0;t=E+972|0;A=E+960|0;B=E+948|0;C=E+936|0;o=E+932|0;p=E;u=E+928|0;v=E+920|0;w=E+924|0;c[l>>2]=b;g[q>>3]=i;b=$y(b,100,50681,q)|0;if(b>>>0>99){b=YF()|0;g[k>>3]=i;b=sH(l,b,50681,k)|0;j=c[l>>2]|0;if(!j)_N();k=DO(b<<2)|0;if(!k)_N();else{x=k;z=b;G=k;H=j}}else{x=j;z=b;G=0;H=0}GE(D,f);n=VF(D,56768)|0;m=c[l>>2]|0;Ib[c[(c[n>>2]|0)+48>>2]&15](n,m,m+z|0,x)|0;if(!z)m=0;else m=(a[c[l>>2]>>0]|0)==45;c[A>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[A+(b<<2)>>2]=0;b=b+1|0}c[B>>2]=0;c[B+4>>2]=0;c[B+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[B+(b<<2)>>2]=0;b=b+1|0}c[C>>2]=0;c[C+4>>2]=0;c[C+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[C+(b<<2)>>2]=0;b=b+1|0}HK(e,m,D,r,s,t,A,B,C,o);l=c[o>>2]|0;if((z|0)>(l|0)){k=a[C+8+3>>0]|0;b=a[B+8+3>>0]|0;b=b<<24>>24<0?c[B+4>>2]|0:b&255;j=l+1+(z-l<<1)|0;k=k<<24>>24<0?c[C+4>>2]|0:k&255}else{k=a[C+8+3>>0]|0;b=a[B+8+3>>0]|0;b=b<<24>>24<0?c[B+4>>2]|0:b&255;j=l+2|0;k=k<<24>>24<0?c[C+4>>2]|0:k&255}b=j+k+b|0;if(b>>>0>100){b=DO(b<<2)|0;if(!b)_N();else{y=b;F=b}}else{y=p;F=0}IK(y,u,v,c[f+4>>2]|0,x,x+(z<<2)|0,n,m,r,c[s>>2]|0,c[t>>2]|0,A,B,C,l);c[w>>2]=c[d>>2];d=c[u>>2]|0;b=c[v>>2]|0;c[q>>2]=c[w>>2];b=GH(q,y,d,b,f,h)|0;if(F|0)EO(F);uO(C);uO(B);hO(A);WF(D);if(G|0)EO(G);if(H|0)EO(H);yb=E;return b|0}function GK(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 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;C=yb;yb=yb+480|0;p=C+464|0;B=C+460|0;u=C+468|0;v=C+456|0;w=C+452|0;y=C+440|0;z=C+428|0;A=C+416|0;l=C+412|0;n=C;q=C+408|0;r=C+404|0;s=C+400|0;GE(B,f);t=VF(B,56768)|0;i=h+8+3|0;o=a[i>>0]|0;b=o<<24>>24<0;j=h+4|0;if(!((b?c[j>>2]|0:o&255)|0))o=0;else{o=c[(b?c[h>>2]|0:h)>>2]|0;o=(o|0)==(Gb[c[(c[t>>2]|0)+44>>2]&63](t,45)|0)};c[y>>2]=0;c[y+4>>2]=0;c[y+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[y+(b<<2)>>2]=0;b=b+1|0}c[z>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[z+(b<<2)>>2]=0;b=b+1|0}c[A>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[A+(b<<2)>>2]=0;b=b+1|0}HK(e,o,B,u,v,w,y,z,A,l);k=a[i>>0]|0;m=k<<24>>24<0;k=m?c[j>>2]|0:k&255;j=c[l>>2]|0;if((k|0)>(j|0)){e=a[A+8+3>>0]|0;b=a[z+8+3>>0]|0;b=b<<24>>24<0?c[z+4>>2]|0:b&255;i=j+1+(k-j<<1)|0;e=e<<24>>24<0?c[A+4>>2]|0:e&255}else{e=a[A+8+3>>0]|0;b=a[z+8+3>>0]|0;b=b<<24>>24<0?c[z+4>>2]|0:b&255;i=j+2|0;e=e<<24>>24<0?c[A+4>>2]|0:e&255}b=i+e+b|0;if(b>>>0>100){b=DO(b<<2)|0;if(!b)_N();else{x=b;D=b}}else{x=n;D=0}h=m?c[h>>2]|0:h;IK(x,q,r,c[f+4>>2]|0,h,h+(k<<2)|0,t,o,u,c[v>>2]|0,c[w>>2]|0,y,z,A,j);c[s>>2]=c[d>>2];h=c[q>>2]|0;b=c[r>>2]|0;c[p>>2]=c[s>>2];b=GH(p,x,h,b,f,g)|0;if(D|0)EO(D);uO(A);uO(z);hO(y);WF(B);yb=C;return b|0}function HK(b,d,e,f,g,h,i,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0;p=yb;yb=yb+16|0;n=p+12|0;o=p;if(b){m=VF(e,56984)|0;if(d){Sb[c[(c[m>>2]|0)+44>>2]&63](n,m);b=c[n>>2]|0;a[f>>0]=b;a[f+1>>0]=b>>8;a[f+2>>0]=b>>16;a[f+3>>0]=b>>24;Sb[c[(c[m>>2]|0)+32>>2]&63](o,m);b=k+8|0;e=b+3|0;if((a[e>>0]|0)<0){f=c[k>>2]|0;c[n>>2]=0;HF(f,n);c[k+4>>2]=0;if((a[e>>0]|0)<0){Nf(c[k>>2]|0,c[b>>2]<<2);c[b>>2]=0}}else{c[n>>2]=0;HF(k,n);a[e>>0]=0};c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}uO(o)}else{Sb[c[(c[m>>2]|0)+40>>2]&63](n,m);b=c[n>>2]|0;a[f>>0]=b;a[f+1>>0]=b>>8;a[f+2>>0]=b>>16;a[f+3>>0]=b>>24;Sb[c[(c[m>>2]|0)+28>>2]&63](o,m);b=k+8|0;e=b+3|0;if((a[e>>0]|0)<0){f=c[k>>2]|0;c[n>>2]=0;HF(f,n);c[k+4>>2]=0;if((a[e>>0]|0)<0){Nf(c[k>>2]|0,c[b>>2]<<2);c[b>>2]=0}}else{c[n>>2]=0;HF(k,n);a[e>>0]=0};c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}uO(o)}c[g>>2]=Eb[c[(c[m>>2]|0)+12>>2]&127](m)|0;c[h>>2]=Eb[c[(c[m>>2]|0)+16>>2]&127](m)|0;Sb[c[(c[m>>2]|0)+20>>2]&63](o,m);b=i+11|0;if((a[b>>0]|0)<0){h=c[i>>2]|0;a[n>>0]=0;$f(h,n);c[i+4>>2]=0;if((a[b>>0]|0)<0){h=i+8|0;Nf(c[i>>2]|0,c[h>>2]&2147483647);c[h>>2]=0}}else{a[n>>0]=0;$f(i,n);a[b>>0]=0};c[i>>2]=c[o>>2];c[i+4>>2]=c[o+4>>2];c[i+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}hO(o);Sb[c[(c[m>>2]|0)+24>>2]&63](o,m);b=j+8|0;e=b+3|0;if((a[e>>0]|0)<0){i=c[j>>2]|0;c[n>>2]=0;HF(i,n);c[j+4>>2]=0;if((a[e>>0]|0)<0){Nf(c[j>>2]|0,c[b>>2]<<2);c[b>>2]=0}}else{c[n>>2]=0;HF(j,n);a[e>>0]=0};c[j>>2]=c[o>>2];c[j+4>>2]=c[o+4>>2];c[j+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}uO(o);b=Eb[c[(c[m>>2]|0)+36>>2]&127](m)|0}else{m=VF(e,56976)|0;if(d){Sb[c[(c[m>>2]|0)+44>>2]&63](n,m);b=c[n>>2]|0;a[f>>0]=b;a[f+1>>0]=b>>8;a[f+2>>0]=b>>16;a[f+3>>0]=b>>24;Sb[c[(c[m>>2]|0)+32>>2]&63](o,m);b=k+8|0;e=b+3|0;if((a[e>>0]|0)<0){f=c[k>>2]|0;c[n>>2]=0;HF(f,n);c[k+4>>2]=0;if((a[e>>0]|0)<0){Nf(c[k>>2]|0,c[b>>2]<<2);c[b>>2]=0}}else{c[n>>2]=0;HF(k,n);a[e>>0]=0};c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}uO(o)}else{Sb[c[(c[m>>2]|0)+40>>2]&63](n,m);b=c[n>>2]|0;a[f>>0]=b;a[f+1>>0]=b>>8;a[f+2>>0]=b>>16;a[f+3>>0]=b>>24;Sb[c[(c[m>>2]|0)+28>>2]&63](o,m);b=k+8|0;e=b+3|0;if((a[e>>0]|0)<0){f=c[k>>2]|0;c[n>>2]=0;HF(f,n);c[k+4>>2]=0;if((a[e>>0]|0)<0){Nf(c[k>>2]|0,c[b>>2]<<2);c[b>>2]=0}}else{c[n>>2]=0;HF(k,n);a[e>>0]=0};c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}uO(o)}c[g>>2]=Eb[c[(c[m>>2]|0)+12>>2]&127](m)|0;c[h>>2]=Eb[c[(c[m>>2]|0)+16>>2]&127](m)|0;Sb[c[(c[m>>2]|0)+20>>2]&63](o,m);b=i+11|0;if((a[b>>0]|0)<0){h=c[i>>2]|0;a[n>>0]=0;$f(h,n);c[i+4>>2]=0;if((a[b>>0]|0)<0){h=i+8|0;Nf(c[i>>2]|0,c[h>>2]&2147483647);c[h>>2]=0}}else{a[n>>0]=0;$f(i,n);a[b>>0]=0};c[i>>2]=c[o>>2];c[i+4>>2]=c[o+4>>2];c[i+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}hO(o);Sb[c[(c[m>>2]|0)+24>>2]&63](o,m);b=j+8|0;e=b+3|0;if((a[e>>0]|0)<0){i=c[j>>2]|0;c[n>>2]=0;HF(i,n);c[j+4>>2]=0;if((a[e>>0]|0)<0){Nf(c[j>>2]|0,c[b>>2]<<2);c[b>>2]=0}}else{c[n>>2]=0;HF(j,n);a[e>>0]=0};c[j>>2]=c[o>>2];c[j+4>>2]=c[o+4>>2];c[j+8>>2]=c[o+8>>2];b=0;while(1){if((b|0)==3)break;c[o+(b<<2)>>2]=0;b=b+1|0}uO(o);b=Eb[c[(c[m>>2]|0)+36>>2]&127](m)|0}c[l>>2]=b;yb=p;return}function IK(b,d,e,f,g,h,i,j,k,l,m,n,o,p,q){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;var 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;c[e>>2]=b;z=p+8+3|0;G=p+4|0;A=o+8+3|0;B=o+4|0;C=(f&512|0)==0;D=(q|0)>0;E=n+11|0;F=n+4|0;y=0;while(1){if((y|0)==4)break;a:do switch(a[k+y>>0]|0){case 0:{c[d>>2]=c[e>>2];break}case 1:{c[d>>2]=c[e>>2];w=Gb[c[(c[i>>2]|0)+44>>2]&63](i,32)|0;x=c[e>>2]|0;c[e>>2]=x+4;c[x>>2]=w;break}case 3:{x=a[z>>0]|0;r=x<<24>>24<0;if((r?c[G>>2]|0:x&255)|0){w=c[(r?c[p>>2]|0:p)>>2]|0;x=c[e>>2]|0;c[e>>2]=x+4;c[x>>2]=w}break}case 2:{v=a[A>>0]|0;r=v<<24>>24<0;v=r?c[B>>2]|0:v&255;if(!(C|(v|0)==0)){u=r?c[o>>2]|0:o;s=u+(v<<2)|0;t=c[e>>2]|0;r=t;while(1){if((u|0)==(s|0))break;c[r>>2]=c[u>>2];r=r+4|0;u=u+4|0}c[e>>2]=t+(v<<2)}break}case 4:{s=c[e>>2]|0;g=j?g+4|0:g;r=g;while(1){if(r>>>0>=h>>>0)break;if(!(Hb[c[(c[i>>2]|0)+12>>2]&63](i,2048,c[r>>2]|0)|0))break;r=r+4|0}if(D){u=q;while(1){t=(u|0)>0;if(!(r>>>0>g>>>0&t))break;x=r+-4|0;v=c[x>>2]|0;w=c[e>>2]|0;c[e>>2]=w+4;c[w>>2]=v;u=u+-1|0;r=x}if(t)w=Gb[c[(c[i>>2]|0)+44>>2]&63](i,48)|0;else w=0;v=c[e>>2]|0;while(1){t=v+4|0;if((u|0)<=0)break;c[v>>2]=w;u=u+-1|0;v=t}c[e>>2]=t;c[v>>2]=l;t=r}else t=r;if((t|0)==(g|0)){w=Gb[c[(c[i>>2]|0)+44>>2]&63](i,48)|0;x=c[e>>2]|0;r=x+4|0;c[e>>2]=r;c[x>>2]=w}else{x=a[E>>0]|0;r=x<<24>>24<0;if(!((r?c[F>>2]|0:x&255)|0))r=-1;else r=a[(r?c[n>>2]|0:n)>>0]|0;u=0;v=0;x=t;while(1){if((x|0)==(g|0))break;t=c[e>>2]|0;if((v|0)==(r|0)){w=t+4|0;c[e>>2]=w;c[t>>2]=m;t=u+1|0;u=a[E>>0]|0;r=u<<24>>24<0;if(t>>>0<(r?c[F>>2]|0:u&255)>>>0){r=a[(r?c[n>>2]|0:n)+t>>0]|0;r=r<<24>>24==127?-1:r<<24>>24;u=t;v=0;t=w}else{r=v;u=t;v=0;t=w}}w=x+-4|0;H=c[w>>2]|0;c[e>>2]=t+4;c[t>>2]=H;v=v+1|0;x=w}r=c[e>>2]|0}if((s|0)!=(r|0))while(1){r=r+-4|0;if(s>>>0>=r>>>0)break a;H=c[s>>2]|0;c[s>>2]=c[r>>2];c[r>>2]=H;s=s+4|0}break}default:{}}while(0);y=y+1|0}r=a[z>>0]|0;g=r<<24>>24<0;r=g?c[G>>2]|0:r&255;if(r>>>0>1){s=c[p>>2]|0;u=g?s+4|0:G;r=(g?s:p)+(r<<2)|0;s=c[e>>2]|0;t=r-u|0;g=s;while(1){if((u|0)==(r|0))break;c[g>>2]=c[u>>2];g=g+4|0;u=u+4|0}c[e>>2]=s+(t>>>2<<2)}switch((f&176)<<24>>24){case 32:{c[d>>2]=c[e>>2];break}case 16:break;default:c[d>>2]=b}return}function JK(a){a=a|0;AF(a);return}function KK(a){a=a|0;AF(a);QA(a);return}function LK(b,d,e){b=b|0;d=d|0;e=e|0;e=Ny((a[d+11>>0]|0)<0?c[d>>2]|0:d,1)|0;return e>>>((e|0)!=(-1|0)&1)|0}function MK(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 i=0,j=0,k=0,l=0;j=yb;yb=yb+16|0;i=j;c[i>>2]=0;c[i+4>>2]=0;c[i+8>>2]=0;d=0;while(1){if((d|0)==3)break;c[i+(d<<2)>>2]=0;d=d+1|0}k=a[h+11>>0]|0;l=k<<24>>24<0;d=l?c[h>>2]|0:h;h=d+(l?c[h+4>>2]|0:k&255)|0;while(1){if(d>>>0>=h>>>0)break;qO(i,a[d>>0]|0);d=d+1|0}d=(a[i+11>>0]|0)<0?c[i>>2]|0:i;e=My((e|0)==-1?-1:e<<1,f,g,d)|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;h=0;while(1){if((h|0)==3)break;c[b+(h<<2)>>2]=0;h=h+1|0}h=d+(Oy(e)|0)|0;while(1){if(d>>>0>=h>>>0)break;qO(b,a[d>>0]|0);d=d+1|0}hO(i);yb=j;return}function NK(a,b){a=a|0;b=b|0;return}function OK(a){a=a|0;AF(a);return}function PK(a){a=a|0;AF(a);QA(a);return}function QK(b,d,e){b=b|0;d=d|0;e=e|0;e=Ny((a[d+11>>0]|0)<0?c[d>>2]|0:d,1)|0;return e>>>((e|0)!=(-1|0)&1)|0}function RK(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 i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=yb;yb=yb+176|0;p=t+168|0;q=t;r=t+164|0;s=t+160|0;n=t+128|0;l=t+152|0;o=t+144|0;c[n>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;d=0;while(1){if((d|0)==3)break;c[n+(d<<2)>>2]=0;d=d+1|0}c[l+4>>2]=0;c[l>>2]=19072;j=a[h+8+3>>0]|0;k=j<<24>>24<0;d=k?c[h>>2]|0:h;j=d+((k?c[h+4>>2]|0:j&255)<<2)|0;k=q+32|0;h=d;d=0;while(1){if(!((d|0)!=2&h>>>0>>0))break;c[s>>2]=h;i=Ob[c[(c[l>>2]|0)+12>>2]&15](l,p,h,j,s,q,k,r)|0;if((i|0)==2?1:(c[s>>2]|0)==(h|0)){m=8;break}d=q;while(1){if(d>>>0>=(c[r>>2]|0)>>>0)break;qO(n,a[d>>0]|0);d=d+1|0}h=c[s>>2]|0;d=i}if((m|0)==8)lJ(0);AF(l);i=(a[n+11>>0]|0)<0?c[n>>2]|0:n;h=My((e|0)==-1?-1:e<<1,f,g,i)|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;d=0;while(1){if((d|0)==3)break;c[b+(d<<2)>>2]=0;d=d+1|0}c[o+4>>2]=0;c[o>>2]=19120;j=i+(Oy(h)|0)|0;k=j;l=q+128|0;h=i;d=0;while(1){if(!((d|0)!=2&h>>>0>>0)){m=23;break}c[s>>2]=h;i=Ob[c[(c[o>>2]|0)+16>>2]&15](o,p,h,(k-h|0)>32?h+32|0:j,s,q,l,r)|0;if((i|0)==2?1:(c[s>>2]|0)==(h|0)){m=19;break}d=q;while(1){if(d>>>0>=(c[r>>2]|0)>>>0)break;BO(b,c[d>>2]|0);d=d+4|0}h=c[s>>2]|0;d=i}if((m|0)==19)lJ(0);else if((m|0)==23){AF(o);hO(n);yb=t;return}}function SK(a,b){a=a|0;b=b|0;return}function TK(a){a=a|0;AF(a);QA(a);return}function UK(a,b,d,e,f,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0;b=yb;yb=yb+16|0;j=b+4|0;a=b;c[j>>2]=d;c[a>>2]=g;h=bL(d,e,j,g,h,a,1114111,0)|0;c[f>>2]=c[j>>2];c[i>>2]=c[a>>2];yb=b;return h|0}function VK(a,b,d,e,f,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0;b=yb;yb=yb+16|0;j=b+4|0;a=b;c[j>>2]=d;c[a>>2]=g;h=aL(d,e,j,g,h,a,1114111,0)|0;c[f>>2]=c[j>>2];c[i>>2]=c[a>>2];yb=b;return h|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;return 3}function XK(a){a=a|0;return 0}function YK(a){a=a|0;return 0}function ZK(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return $K(c,d,e,1114111,0)|0}function _K(a){a=a|0;return 4}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,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=c;if((((g&4|0)!=0?(o-b|0)>2:0)?(a[b>>0]|0)==-17:0)?(a[b+1>>0]|0)==-69:0)g=(a[b+2>>0]|0)==-65?b+3|0:b;else g=b;n=0;a:while(1){if(!(n>>>0>>0&g>>>0>>0))break;k=a[g>>0]|0;m=k&255;do if(k<<24>>24<=-1){if((k&255)<194)break a;if((k&255)<224){if((o-g|0)<2)break a;h=d[g+1>>0]|0;if((h&192|0)!=128)break a;if((h&63|m<<6&1984)>>>0>f>>>0)break a;g=g+2|0;break}if((k&255)<240){if((o-g|0)<3)break a;i=a[g+1>>0]|0;h=a[g+2>>0]|0;switch(k<<24>>24){case -32:{if((i&-32)<<24>>24!=-96)break a;break}case -19:{if((i&-32)<<24>>24!=-128)break a;break}default:if((i&-64)<<24>>24!=-128)break a}h=h&255;if((h&192|0)!=128)break a;if(((i&63)<<6|m<<12&61440|h&63)>>>0>f>>>0)break a;else{g=g+3|0;break}}if((k&255)>=245)break a;if((o-g|0)<4)break a;l=a[g+1>>0]|0;h=a[g+2>>0]|0;j=a[g+3>>0]|0;switch(k<<24>>24){case -16:{if((l+112&255)>=48)break a;break}case -12:{if((l&-16)<<24>>24!=-128)break a;break}default:if((l&-64)<<24>>24!=-128)break a}i=h&255;if((i&192|0)!=128)break a;h=j&255;if((h&192|0)!=128)break a;if(((l&63)<<12|m<<18&1835008|i<<6&4032|h&63)>>>0>f>>>0)break a;else g=g+4|0}else{if(m>>>0>f>>>0)break a;g=g+1|0}while(0);n=n+1|0}return g-b|0}function aL(b,e,f,g,h,i,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0;c[f>>2]=b;c[i>>2]=g;if(k&4){b=c[f>>2]|0;g=e;if((((g-b|0)>2?(a[b>>0]|0)==-17:0)?(a[b+1>>0]|0)==-69:0)?(a[b+2>>0]|0)==-65:0)c[f>>2]=b+3}else g=e;a:while(1){p=c[f>>2]|0;if(p>>>0>=e>>>0){b=0;break}q=c[i>>2]|0;if(q>>>0>=h>>>0){b=1;break}n=a[p>>0]|0;b=n&255;do if(n<<24>>24>-1)if(b>>>0>j>>>0){b=2;break a}else k=1;else{if((n&255)<194){b=2;break a}if((n&255)<224){if((g-p|0)<2){b=1;break a}k=d[p+1>>0]|0;if((k&192|0)!=128){b=2;break a}b=k&63|b<<6&1984;if(b>>>0>j>>>0){b=2;break a}else{k=2;break}}if((n&255)<240){if((g-p|0)<3){b=1;break a}l=a[p+1>>0]|0;k=a[p+2>>0]|0;switch(n<<24>>24){case -32:{if((l&-32)<<24>>24!=-96){b=2;break a}break}case -19:{if((l&-32)<<24>>24!=-128){b=2;break a}break}default:if((l&-64)<<24>>24!=-128){b=2;break a}}k=k&255;if((k&192|0)!=128){b=2;break a}b=(l&63)<<6|b<<12&61440|k&63;if(b>>>0>j>>>0){b=2;break a}else{k=3;break}}if((n&255)>=245){b=2;break a}if((g-p|0)<4){b=1;break a}o=a[p+1>>0]|0;k=a[p+2>>0]|0;m=a[p+3>>0]|0;switch(n<<24>>24){case -16:{if((o+112&255)>=48){b=2;break a}break}case -12:{if((o&-16)<<24>>24!=-128){b=2;break a}break}default:if((o&-64)<<24>>24!=-128){b=2;break a}}l=k&255;if((l&192|0)!=128){b=2;break a}k=m&255;if((k&192|0)!=128){b=2;break a}b=(o&63)<<12|b<<18&1835008|l<<6&4032|k&63;if(b>>>0>j>>>0){b=2;break a}else k=4}while(0);c[q>>2]=b;c[f>>2]=p+k;c[i>>2]=(c[i>>2]|0)+4}return b|0}function bL(b,d,e,f,g,h,i,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0;c[e>>2]=b;c[h>>2]=f;l=g;if(j&2)if((l-f|0)<3)b=1;else{c[h>>2]=f+1;a[f>>0]=-17;k=c[h>>2]|0;c[h>>2]=k+1;a[k>>0]=-69;k=c[h>>2]|0;c[h>>2]=k+1;a[k>>0]=-65;k=4}else k=4;a:do if((k|0)==4){b=c[e>>2]|0;while(1){if(b>>>0>=d>>>0){b=0;break a}f=c[b>>2]|0;if(f>>>0>i>>>0|(f&-2048|0)==55296){b=2;break a}do if(f>>>0>=128){if(f>>>0<2048){b=c[h>>2]|0;if((l-b|0)<2){b=1;break a}c[h>>2]=b+1;a[b>>0]=f>>>6|192;k=c[h>>2]|0;c[h>>2]=k+1;a[k>>0]=f&63|128;break}b=c[h>>2]|0;g=l-b|0;if(f>>>0<65536){if((g|0)<3){b=1;break a}c[h>>2]=b+1;a[b>>0]=f>>>12|224;k=c[h>>2]|0;c[h>>2]=k+1;a[k>>0]=f>>>6&63|128;k=c[h>>2]|0;c[h>>2]=k+1;a[k>>0]=f&63|128;break}else{if((g|0)<4){b=1;break a}c[h>>2]=b+1;a[b>>0]=f>>>18|240;k=c[h>>2]|0;c[h>>2]=k+1;a[k>>0]=f>>>12&63|128;k=c[h>>2]|0;c[h>>2]=k+1;a[k>>0]=f>>>6&63|128;k=c[h>>2]|0;c[h>>2]=k+1;a[k>>0]=f&63|128;break}}else{b=c[h>>2]|0;if((l-b|0)<1){b=1;break a}c[h>>2]=b+1;a[b>>0]=f}while(0);b=(c[e>>2]|0)+4|0;c[e>>2]=b}}while(0);return b|0}function cL(a){a=a|0;AF(a);QA(a);return}function dL(a,b,d,e,f,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;c[f>>2]=d;c[i>>2]=g;return 3}function eL(a,b,d,e,f,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;c[f>>2]=d;c[i>>2]=g;return 3}function fL(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;c[f>>2]=d;return 3}function gL(a){a=a|0;return 1}function hL(a){a=a|0;return 1}function iL(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;d=d-c|0;return (d>>>0>>0?d:e)|0}function jL(a){a=a|0;return 1}function kL(b,d,e,f,g,h,i,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;q=yb;yb=yb+16|0;p=q;n=q+8|0;k=e;while(1){if((k|0)==(f|0)){k=f;break}if(!(c[k>>2]|0))break;k=k+4|0}c[j>>2]=h;c[g>>2]=e;m=i;o=b+8|0;a:while(1){if((h|0)==(i|0)|(e|0)==(f|0)){k=36;break}r=d;l=c[r+4>>2]|0;b=p;c[b>>2]=c[r>>2];c[b+4>>2]=l;b=cz(c[o>>2]|0)|0;l=Sz(h,g,k-e>>2,m-h|0,d)|0;if(b|0)cz(b)|0;switch(l|0){case -1:{k=10;break a}case 0:{e=1;k=33;break a}default:{}}h=(c[j>>2]|0)+l|0;c[j>>2]=h;if((h|0)==(i|0)){k=34;break}if((k|0)==(f|0)){k=f;e=c[g>>2]|0}else{h=cz(c[o>>2]|0)|0;e=Yx(n,0,d)|0;if(h|0)cz(h)|0;if((e|0)==-1){e=2;k=32;break}if(e>>>0>(m-(c[j>>2]|0)|0)>>>0){e=1;k=32;break}h=n;while(1){if(!e)break;l=a[h>>0]|0;r=c[j>>2]|0;c[j>>2]=r+1;a[r>>0]=l;h=h+1|0;e=e+-1|0}e=(c[g>>2]|0)+4|0;c[g>>2]=e;k=e;while(1){if((k|0)==(f|0)){k=f;break}if(!(c[k>>2]|0))break;k=k+4|0}h=c[j>>2]|0}}if((k|0)==10){c[j>>2]=h;while(1){if((e|0)==(c[g>>2]|0))break;r=c[e>>2]|0;k=cz(c[o>>2]|0)|0;h=Yx(h,r,p)|0;if(k|0)cz(k)|0;if((h|0)==-1)break;h=(c[j>>2]|0)+h|0;c[j>>2]=h;e=e+4|0}c[g>>2]=e;e=2;k=33}else if((k|0)==32)k=33;else if((k|0)==34){e=c[g>>2]|0;k=36}if((k|0)!=33)if((k|0)==36)e=(e|0)!=(f|0)&1;yb=q;return e|0} +function Zb(a){a=a|0;var b=0;b=yb;yb=yb+a|0;yb=yb+15&-16;return b|0}function _b(){return yb|0}function $b(a){a=a|0;yb=a}function ac(a,b){a=a|0;b=b|0;yb=a;zb=b}function bc(a,e,f,h,i){a=a|0;e=e|0;f=f|0;h=h|0;i=i|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.0;y=yb;yb=yb+16|0;v=y;x=(e|0)/2|0;w=(f|0)/2|0;m=c[i>>2]|0;u=w+-1|0;f=m;j=m+((B(u,x)|0)<<1)|0;k=0;while(1){if((k|0)>=(x|0))break;b[j>>1]=0;b[f>>1]=0;f=f+2|0;j=j+2|0;k=k+1|0}t=x+-1|0;f=m;j=m+(t<<1)|0;k=0;while(1){if((k|0)>=(w|0))break;b[j>>1]=0;b[f>>1]=0;f=f+(x<<1)|0;j=j+(x<<1)|0;k=k+1|0}l=i+1179664|0;s=0-x|0;j=a+((e<<1)+2)|0;r=1;o=0;k=m+(x+1<<1)|0;a:while(1){if((r|0)>=(u|0)){j=59;break}q=j;f=o;p=1;while(1){if((p|0)>=(t|0))break;do if((d[q>>0]|0|0)>(h|0))b[k>>1]=0;else{a=k+(s<<1)|0;j=b[a>>1]|0;if(j<<16>>16>0){b[k>>1]=j;o=(j<<16>>16)*7|0;n=i+1310736+(o+-7<<2)|0;c[n>>2]=(c[n>>2]|0)+1;n=i+1310736+(o+-6<<2)|0;c[n>>2]=(c[n>>2]|0)+p;n=i+1310736+(o+-5<<2)|0;c[n>>2]=(c[n>>2]|0)+r;c[i+1310736+(o+-1<<2)>>2]=r;break}n=b[a+2>>1]|0;o=n<<16>>16;j=b[a+-2>>1]|0;m=j<<16>>16;a=j<<16>>16>0;if(n<<16>>16<=0){if(a){b[k>>1]=j;j=m*7|0;a=i+1310736+(j+-7<<2)|0;c[a>>2]=(c[a>>2]|0)+1;a=i+1310736+(j+-6<<2)|0;c[a>>2]=(c[a>>2]|0)+p;a=i+1310736+(j+-5<<2)|0;c[a>>2]=(c[a>>2]|0)+r;a=i+1310736+(j+-3<<2)|0;if((c[a>>2]|0)<(p|0))c[a>>2]=p;c[i+1310736+(j+-1<<2)>>2]=r;break}j=b[k+-2>>1]|0;if(j<<16>>16>0){b[k>>1]=j;j=(j<<16>>16)*7|0;o=i+1310736+(j+-7<<2)|0;c[o>>2]=(c[o>>2]|0)+1;o=i+1310736+(j+-6<<2)|0;c[o>>2]=(c[o>>2]|0)+p;o=i+1310736+(j+-5<<2)|0;c[o>>2]=(c[o>>2]|0)+r;j=i+1310736+(j+-3<<2)|0;if((c[j>>2]|0)>=(p|0))break;c[j>>2]=p;break}else{j=f+1|0;if((f|0)>32767){j=54;break a}b[k>>1]=j;c[i+1179664+(f<<2)>>2]=j<<16>>16;f=f*7|0;c[i+1310736+(f<<2)>>2]=1;c[i+1310736+(f+1<<2)>>2]=p;c[i+1310736+(f+2<<2)>>2]=r;c[i+1310736+(f+3<<2)>>2]=p;c[i+1310736+(f+4<<2)>>2]=p;c[i+1310736+(f+5<<2)>>2]=r;c[i+1310736+(f+6<<2)>>2]=r;f=j;break}}if(a){j=c[i+1179664+(o+-1<<2)>>2]|0;n=c[i+1179664+(m+-1<<2)>>2]|0;b:do if((j|0)<=(n|0)){b[k>>1]=j;if((j|0)<(n|0)){a=l;m=0;while(1){if((m|0)>=(f|0))break b;if((c[a>>2]|0)==(n|0))c[a>>2]=j;a=a+4|0;m=m+1|0}}}else{b[k>>1]=n;a=l;m=0;while(1){if((m|0)>=(f|0)){j=n;break b}if((c[a>>2]|0)==(j|0))c[a>>2]=n;a=a+4|0;m=m+1|0}}while(0);o=(j<<16>>16)*7|0;n=i+1310736+(o+-7<<2)|0;c[n>>2]=(c[n>>2]|0)+1;n=i+1310736+(o+-6<<2)|0;c[n>>2]=(c[n>>2]|0)+p;n=i+1310736+(o+-5<<2)|0;c[n>>2]=(c[n>>2]|0)+r;c[i+1310736+(o+-1<<2)>>2]=r;break}a=b[k+-2>>1]|0;if(a<<16>>16<=0){b[k>>1]=n;j=o*7|0;a=i+1310736+(j+-7<<2)|0;c[a>>2]=(c[a>>2]|0)+1;a=i+1310736+(j+-6<<2)|0;c[a>>2]=(c[a>>2]|0)+p;a=i+1310736+(j+-5<<2)|0;c[a>>2]=(c[a>>2]|0)+r;a=i+1310736+(j+-4<<2)|0;if((c[a>>2]|0)>(p|0))c[a>>2]=p;c[i+1310736+(j+-1<<2)>>2]=r;break}j=c[i+1179664+(o+-1<<2)>>2]|0;n=c[i+1179664+((a<<16>>16)+-1<<2)>>2]|0;c:do if((j|0)<=(n|0)){b[k>>1]=j;if((j|0)<(n|0)){a=l;m=0;while(1){if((m|0)>=(f|0))break c;if((c[a>>2]|0)==(n|0))c[a>>2]=j;a=a+4|0;m=m+1|0}}}else{b[k>>1]=n;a=l;m=0;while(1){if((m|0)>=(f|0)){j=n;break c}if((c[a>>2]|0)==(j|0))c[a>>2]=n;a=a+4|0;m=m+1|0}}while(0);o=(j<<16>>16)*7|0;n=i+1310736+(o+-7<<2)|0;c[n>>2]=(c[n>>2]|0)+1;n=i+1310736+(o+-6<<2)|0;c[n>>2]=(c[n>>2]|0)+p;o=i+1310736+(o+-5<<2)|0;c[o>>2]=(c[o>>2]|0)+r}while(0);q=q+2|0;p=p+1|0;k=k+2|0}j=q+e+4|0;r=r+1|0;o=f;k=k+4|0}d:do if((j|0)==54){Se(0,3,19708,v);f=-1}else if((j|0)==59){m=i+12|0;f=1;a=1;while(1){if((a|0)>(o|0))break;j=c[l>>2]|0;if((j|0)==(a|0))k=f+1|0;else{k=f;f=c[i+1179664+(j+-1<<2)>>2]|0}c[l>>2]=f;f=k;a=a+1|0;l=l+4|0}n=i+8|0;j=f+-1|0;c[n>>2]=j;if(!j)f=0;else{_O(m|0,0,j<<2|0)|0;_O(i+655376|0,0,j<<4|0)|0;f=0;while(1){if((f|0)>=(j|0))break;v=f<<2;c[i+131084+(v<<2)>>2]=x;c[i+131084+((v|1)<<2)>>2]=0;c[i+131084+((v|2)<<2)>>2]=w;c[i+131084+((v|3)<<2)>>2]=0;f=f+1|0}a=0;while(1){if((a|0)>=(o|0))break;k=(c[i+1179664+(a<<2)>>2]|0)+-1|0;l=a*7|0;f=i+12+(k<<2)|0;c[f>>2]=(c[f>>2]|0)+(c[i+1310736+(l<<2)>>2]|0);f=k<<1;j=i+655376+(f<<3)|0;g[j>>3]=+g[j>>3]+ +(c[i+1310736+(l+1<<2)>>2]|0);f=i+655376+((f|1)<<3)|0;g[f>>3]=+g[f>>3]+ +(c[i+1310736+(l+2<<2)>>2]|0);k=k<<2;f=i+131084+(k<<2)|0;j=c[i+1310736+(l+3<<2)>>2]|0;if((c[f>>2]|0)>(j|0))c[f>>2]=j;f=i+131084+((k|1)<<2)|0;j=c[i+1310736+(l+4<<2)>>2]|0;if((c[f>>2]|0)<(j|0))c[f>>2]=j;f=i+131084+((k|2)<<2)|0;j=c[i+1310736+(l+5<<2)>>2]|0;if((c[f>>2]|0)>(j|0))c[f>>2]=j;j=i+131084+((k|3)<<2)|0;f=c[i+1310736+(l+6<<2)>>2]|0;if((c[j>>2]|0)<(f|0))c[j>>2]=f;a=a+1|0}j=c[n>>2]|0;f=0;while(1){if((f|0)>=(j|0)){f=0;break d}z=+(c[i+12+(f<<2)>>2]|0);x=f<<1;w=i+655376+(x<<3)|0;g[w>>3]=+g[w>>3]/z;x=i+655376+((x|1)<<3)|0;g[x>>3]=+g[x>>3]/z;f=f+1|0}}}while(0);yb=y;return f|0}function cc(a,e,f,h,i){a=a|0;e=e|0;f=f|0;h=h|0;i=i|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.0;x=yb;yb=yb+16|0;w=x;n=c[i>>2]|0;v=f+-1|0;j=n;k=n+((B(v,e)|0)<<1)|0;l=0;while(1){if((l|0)>=(e|0))break;b[k>>1]=0;b[j>>1]=0;j=j+2|0;k=k+2|0;l=l+1|0}u=e+-1|0;j=n;k=n+(u<<1)|0;l=0;while(1){if((l|0)>=(f|0))break;b[k>>1]=0;b[j>>1]=0;j=j+(e<<1)|0;k=k+(e<<1)|0;l=l+1|0}m=i+1179664|0;l=e+1|0;t=0-e|0;k=a+l|0;s=1;p=0;l=n+(l<<1)|0;a:while(1){if((s|0)>=(v|0)){k=59;break}r=k;j=p;q=1;while(1){if((q|0)>=(u|0))break;do if((d[r>>0]|0|0)>(h|0))b[l>>1]=0;else{a=l+(t<<1)|0;k=b[a>>1]|0;if(k<<16>>16>0){b[l>>1]=k;p=(k<<16>>16)*7|0;o=i+1310736+(p+-7<<2)|0;c[o>>2]=(c[o>>2]|0)+1;o=i+1310736+(p+-6<<2)|0;c[o>>2]=(c[o>>2]|0)+q;o=i+1310736+(p+-5<<2)|0;c[o>>2]=(c[o>>2]|0)+s;c[i+1310736+(p+-1<<2)>>2]=s;break}o=b[a+2>>1]|0;p=o<<16>>16;k=b[a+-2>>1]|0;n=k<<16>>16;a=k<<16>>16>0;if(o<<16>>16<=0){if(a){b[l>>1]=k;k=n*7|0;a=i+1310736+(k+-7<<2)|0;c[a>>2]=(c[a>>2]|0)+1;a=i+1310736+(k+-6<<2)|0;c[a>>2]=(c[a>>2]|0)+q;a=i+1310736+(k+-5<<2)|0;c[a>>2]=(c[a>>2]|0)+s;a=i+1310736+(k+-3<<2)|0;if((c[a>>2]|0)<(q|0))c[a>>2]=q;c[i+1310736+(k+-1<<2)>>2]=s;break}k=b[l+-2>>1]|0;if(k<<16>>16>0){b[l>>1]=k;k=(k<<16>>16)*7|0;p=i+1310736+(k+-7<<2)|0;c[p>>2]=(c[p>>2]|0)+1;p=i+1310736+(k+-6<<2)|0;c[p>>2]=(c[p>>2]|0)+q;p=i+1310736+(k+-5<<2)|0;c[p>>2]=(c[p>>2]|0)+s;k=i+1310736+(k+-3<<2)|0;if((c[k>>2]|0)>=(q|0))break;c[k>>2]=q;break}else{k=j+1|0;if((j|0)>32767){k=54;break a}b[l>>1]=k;c[i+1179664+(j<<2)>>2]=k<<16>>16;j=j*7|0;c[i+1310736+(j<<2)>>2]=1;c[i+1310736+(j+1<<2)>>2]=q;c[i+1310736+(j+2<<2)>>2]=s;c[i+1310736+(j+3<<2)>>2]=q;c[i+1310736+(j+4<<2)>>2]=q;c[i+1310736+(j+5<<2)>>2]=s;c[i+1310736+(j+6<<2)>>2]=s;j=k;break}}if(a){k=c[i+1179664+(p+-1<<2)>>2]|0;o=c[i+1179664+(n+-1<<2)>>2]|0;b:do if((k|0)<=(o|0)){b[l>>1]=k;if((k|0)<(o|0)){a=m;n=0;while(1){if((n|0)>=(j|0))break b;if((c[a>>2]|0)==(o|0))c[a>>2]=k;a=a+4|0;n=n+1|0}}}else{b[l>>1]=o;a=m;n=0;while(1){if((n|0)>=(j|0)){k=o;break b}if((c[a>>2]|0)==(k|0))c[a>>2]=o;a=a+4|0;n=n+1|0}}while(0);p=(k<<16>>16)*7|0;o=i+1310736+(p+-7<<2)|0;c[o>>2]=(c[o>>2]|0)+1;o=i+1310736+(p+-6<<2)|0;c[o>>2]=(c[o>>2]|0)+q;o=i+1310736+(p+-5<<2)|0;c[o>>2]=(c[o>>2]|0)+s;c[i+1310736+(p+-1<<2)>>2]=s;break}k=b[l+-2>>1]|0;if(k<<16>>16<=0){b[l>>1]=o;k=p*7|0;a=i+1310736+(k+-7<<2)|0;c[a>>2]=(c[a>>2]|0)+1;a=i+1310736+(k+-6<<2)|0;c[a>>2]=(c[a>>2]|0)+q;a=i+1310736+(k+-5<<2)|0;c[a>>2]=(c[a>>2]|0)+s;a=i+1310736+(k+-4<<2)|0;if((c[a>>2]|0)>(q|0))c[a>>2]=q;c[i+1310736+(k+-1<<2)>>2]=s;break}o=c[i+1179664+(p+-1<<2)>>2]|0;k=c[i+1179664+((k<<16>>16)+-1<<2)>>2]|0;c:do if((o|0)<=(k|0)){b[l>>1]=o;if((o|0)<(k|0)){a=m;n=0;while(1){if((n|0)>=(j|0)){k=o;break c}if((c[a>>2]|0)==(k|0))c[a>>2]=o;a=a+4|0;n=n+1|0}}else k=o}else{b[l>>1]=k;a=m;n=0;while(1){if((n|0)>=(j|0))break c;if((c[a>>2]|0)==(o|0))c[a>>2]=k;a=a+4|0;n=n+1|0}}while(0);p=(k<<16>>16)*7|0;o=i+1310736+(p+-7<<2)|0;c[o>>2]=(c[o>>2]|0)+1;o=i+1310736+(p+-6<<2)|0;c[o>>2]=(c[o>>2]|0)+q;p=i+1310736+(p+-5<<2)|0;c[p>>2]=(c[p>>2]|0)+s}while(0);r=r+1|0;q=q+1|0;l=l+2|0}k=r+2|0;s=s+1|0;p=j;l=l+4|0}d:do if((k|0)==54){Se(0,3,19708,w);j=-1}else if((k|0)==59){n=i+12|0;j=1;a=1;while(1){if((a|0)>(p|0))break;k=c[m>>2]|0;if((k|0)==(a|0))l=j+1|0;else{l=j;j=c[i+1179664+(k+-1<<2)>>2]|0}c[m>>2]=j;j=l;a=a+1|0;m=m+4|0}o=i+8|0;k=j+-1|0;c[o>>2]=k;if(!k)j=0;else{_O(n|0,0,k<<2|0)|0;_O(i+655376|0,0,k<<4|0)|0;j=0;while(1){if((j|0)>=(k|0))break;w=j<<2;c[i+131084+(w<<2)>>2]=e;c[i+131084+((w|1)<<2)>>2]=0;c[i+131084+((w|2)<<2)>>2]=f;c[i+131084+((w|3)<<2)>>2]=0;j=j+1|0}a=0;while(1){if((a|0)>=(p|0))break;l=(c[i+1179664+(a<<2)>>2]|0)+-1|0;m=a*7|0;j=i+12+(l<<2)|0;c[j>>2]=(c[j>>2]|0)+(c[i+1310736+(m<<2)>>2]|0);j=l<<1;k=i+655376+(j<<3)|0;g[k>>3]=+g[k>>3]+ +(c[i+1310736+(m+1<<2)>>2]|0);j=i+655376+((j|1)<<3)|0;g[j>>3]=+g[j>>3]+ +(c[i+1310736+(m+2<<2)>>2]|0);l=l<<2;j=i+131084+(l<<2)|0;k=c[i+1310736+(m+3<<2)>>2]|0;if((c[j>>2]|0)>(k|0))c[j>>2]=k;j=i+131084+((l|1)<<2)|0;k=c[i+1310736+(m+4<<2)>>2]|0;if((c[j>>2]|0)<(k|0))c[j>>2]=k;j=i+131084+((l|2)<<2)|0;k=c[i+1310736+(m+5<<2)>>2]|0;if((c[j>>2]|0)>(k|0))c[j>>2]=k;k=i+131084+((l|3)<<2)|0;j=c[i+1310736+(m+6<<2)>>2]|0;if((c[k>>2]|0)<(j|0))c[k>>2]=j;a=a+1|0}k=c[o>>2]|0;j=0;while(1){if((j|0)>=(k|0)){j=0;break d}y=+(c[i+12+(j<<2)>>2]|0);f=j<<1;e=i+655376+(f<<3)|0;g[e>>3]=+g[e>>3]/y;f=i+655376+((f|1)<<3)|0;g[f>>3]=+g[f>>3]/y;j=j+1|0}}}while(0);yb=x;return j|0}function dc(a,e,f,h,i){a=a|0;e=e|0;f=f|0;h=h|0;i=i|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.0;x=yb;yb=yb+16|0;w=x;n=c[i>>2]|0;v=f+-1|0;j=n;k=0;l=n+((B(v,e)|0)<<1)|0;while(1){if((k|0)>=(e|0))break;b[l>>1]=0;b[j>>1]=0;j=j+2|0;k=k+1|0;l=l+2|0}u=e+-1|0;j=n;k=0;l=n+(u<<1)|0;while(1){if((k|0)>=(f|0))break;b[l>>1]=0;b[j>>1]=0;j=j+(e<<1)|0;k=k+1|0;l=l+(e<<1)|0}m=i+1179664|0;l=e+1|0;t=0-e|0;a=a+l|0;k=h+l|0;s=1;o=0;l=n+(l<<1)|0;a:while(1){if((s|0)>=(v|0)){k=59;break}q=k;j=o;p=1;r=l;while(1){if((p|0)>=(u|0))break;do if((d[a>>0]|0)>(d[q>>0]|0))b[r>>1]=0;else{l=r+(t<<1)|0;k=b[l>>1]|0;if(k<<16>>16>0){b[r>>1]=k;o=(k<<16>>16)*7|0;n=i+1310736+(o+-7<<2)|0;c[n>>2]=(c[n>>2]|0)+1;n=i+1310736+(o+-6<<2)|0;c[n>>2]=(c[n>>2]|0)+p;n=i+1310736+(o+-5<<2)|0;c[n>>2]=(c[n>>2]|0)+s;c[i+1310736+(o+-1<<2)>>2]=s;break}n=b[l+2>>1]|0;o=n<<16>>16;k=b[l+-2>>1]|0;h=k<<16>>16;l=k<<16>>16>0;if(n<<16>>16<=0){if(l){b[r>>1]=k;k=h*7|0;l=i+1310736+(k+-7<<2)|0;c[l>>2]=(c[l>>2]|0)+1;l=i+1310736+(k+-6<<2)|0;c[l>>2]=(c[l>>2]|0)+p;l=i+1310736+(k+-5<<2)|0;c[l>>2]=(c[l>>2]|0)+s;l=i+1310736+(k+-3<<2)|0;if((c[l>>2]|0)<(p|0))c[l>>2]=p;c[i+1310736+(k+-1<<2)>>2]=s;break}k=b[r+-2>>1]|0;if(k<<16>>16>0){b[r>>1]=k;k=(k<<16>>16)*7|0;o=i+1310736+(k+-7<<2)|0;c[o>>2]=(c[o>>2]|0)+1;o=i+1310736+(k+-6<<2)|0;c[o>>2]=(c[o>>2]|0)+p;o=i+1310736+(k+-5<<2)|0;c[o>>2]=(c[o>>2]|0)+s;k=i+1310736+(k+-3<<2)|0;if((c[k>>2]|0)>=(p|0))break;c[k>>2]=p;break}else{k=j+1|0;if((j|0)>32767){k=54;break a}b[r>>1]=k;c[i+1179664+(j<<2)>>2]=k<<16>>16;j=j*7|0;c[i+1310736+(j<<2)>>2]=1;c[i+1310736+(j+1<<2)>>2]=p;c[i+1310736+(j+2<<2)>>2]=s;c[i+1310736+(j+3<<2)>>2]=p;c[i+1310736+(j+4<<2)>>2]=p;c[i+1310736+(j+5<<2)>>2]=s;c[i+1310736+(j+6<<2)>>2]=s;j=k;break}}if(l){k=c[i+1179664+(o+-1<<2)>>2]|0;n=c[i+1179664+(h+-1<<2)>>2]|0;b:do if((k|0)<=(n|0)){b[r>>1]=k;if((k|0)<(n|0)){l=m;h=0;while(1){if((h|0)>=(j|0))break b;if((c[l>>2]|0)==(n|0))c[l>>2]=k;l=l+4|0;h=h+1|0}}}else{b[r>>1]=n;l=m;h=0;while(1){if((h|0)>=(j|0)){k=n;break b}if((c[l>>2]|0)==(k|0))c[l>>2]=n;l=l+4|0;h=h+1|0}}while(0);o=(k<<16>>16)*7|0;n=i+1310736+(o+-7<<2)|0;c[n>>2]=(c[n>>2]|0)+1;n=i+1310736+(o+-6<<2)|0;c[n>>2]=(c[n>>2]|0)+p;n=i+1310736+(o+-5<<2)|0;c[n>>2]=(c[n>>2]|0)+s;c[i+1310736+(o+-1<<2)>>2]=s;break}l=b[r+-2>>1]|0;if(l<<16>>16<=0){b[r>>1]=n;k=o*7|0;l=i+1310736+(k+-7<<2)|0;c[l>>2]=(c[l>>2]|0)+1;l=i+1310736+(k+-6<<2)|0;c[l>>2]=(c[l>>2]|0)+p;l=i+1310736+(k+-5<<2)|0;c[l>>2]=(c[l>>2]|0)+s;l=i+1310736+(k+-4<<2)|0;if((c[l>>2]|0)>(p|0))c[l>>2]=p;c[i+1310736+(k+-1<<2)>>2]=s;break}k=c[i+1179664+(o+-1<<2)>>2]|0;n=c[i+1179664+((l<<16>>16)+-1<<2)>>2]|0;c:do if((k|0)<=(n|0)){b[r>>1]=k;if((k|0)<(n|0)){l=m;h=0;while(1){if((h|0)>=(j|0))break c;if((c[l>>2]|0)==(n|0))c[l>>2]=k;l=l+4|0;h=h+1|0}}}else{b[r>>1]=n;l=m;h=0;while(1){if((h|0)>=(j|0)){k=n;break c}if((c[l>>2]|0)==(k|0))c[l>>2]=n;l=l+4|0;h=h+1|0}}while(0);o=(k<<16>>16)*7|0;n=i+1310736+(o+-7<<2)|0;c[n>>2]=(c[n>>2]|0)+1;n=i+1310736+(o+-6<<2)|0;c[n>>2]=(c[n>>2]|0)+p;o=i+1310736+(o+-5<<2)|0;c[o>>2]=(c[o>>2]|0)+s}while(0);a=a+1|0;q=q+1|0;p=p+1|0;r=r+2|0}a=a+2|0;k=q+2|0;s=s+1|0;o=j;l=r+4|0}d:do if((k|0)==54){Se(0,3,19708,w);j=-1}else if((k|0)==59){h=i+12|0;j=1;a=1;while(1){if((a|0)>(o|0))break;k=c[m>>2]|0;if((k|0)==(a|0))l=j+1|0;else{l=j;j=c[i+1179664+(k+-1<<2)>>2]|0}c[m>>2]=j;j=l;a=a+1|0;m=m+4|0}n=i+8|0;k=j+-1|0;c[n>>2]=k;if(!k)j=0;else{_O(h|0,0,k<<2|0)|0;_O(i+655376|0,0,k<<4|0)|0;j=0;while(1){if((j|0)>=(k|0))break;w=j<<2;c[i+131084+(w<<2)>>2]=e;c[i+131084+((w|1)<<2)>>2]=0;c[i+131084+((w|2)<<2)>>2]=f;c[i+131084+((w|3)<<2)>>2]=0;j=j+1|0}a=0;while(1){if((a|0)>=(o|0))break;l=(c[i+1179664+(a<<2)>>2]|0)+-1|0;m=a*7|0;j=i+12+(l<<2)|0;c[j>>2]=(c[j>>2]|0)+(c[i+1310736+(m<<2)>>2]|0);j=l<<1;k=i+655376+(j<<3)|0;g[k>>3]=+g[k>>3]+ +(c[i+1310736+(m+1<<2)>>2]|0);j=i+655376+((j|1)<<3)|0;g[j>>3]=+g[j>>3]+ +(c[i+1310736+(m+2<<2)>>2]|0);l=l<<2;j=i+131084+(l<<2)|0;k=c[i+1310736+(m+3<<2)>>2]|0;if((c[j>>2]|0)>(k|0))c[j>>2]=k;j=i+131084+((l|1)<<2)|0;k=c[i+1310736+(m+4<<2)>>2]|0;if((c[j>>2]|0)<(k|0))c[j>>2]=k;j=i+131084+((l|2)<<2)|0;k=c[i+1310736+(m+5<<2)>>2]|0;if((c[j>>2]|0)>(k|0))c[j>>2]=k;k=i+131084+((l|3)<<2)|0;j=c[i+1310736+(m+6<<2)>>2]|0;if((c[k>>2]|0)<(j|0))c[k>>2]=j;a=a+1|0}k=c[n>>2]|0;j=0;while(1){if((j|0)>=(k|0)){j=0;break d}y=+(c[i+12+(j<<2)>>2]|0);f=j<<1;e=i+655376+(f<<3)|0;g[e>>3]=+g[e>>3]/y;f=i+655376+((f|1)<<3)|0;g[f>>3]=+g[f>>3]/y;j=j+1|0}}}while(0);yb=x;return j|0}function ec(a,e,f,h,i){a=a|0;e=e|0;f=f|0;h=h|0;i=i|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.0;y=yb;yb=yb+16|0;v=y;x=(e|0)/2|0;w=(f|0)/2|0;m=c[i>>2]|0;u=w+-1|0;f=m;j=m+((B(u,x)|0)<<1)|0;k=0;while(1){if((k|0)>=(x|0))break;b[j>>1]=0;b[f>>1]=0;f=f+2|0;j=j+2|0;k=k+1|0}t=x+-1|0;f=m;j=m+(t<<1)|0;k=0;while(1){if((k|0)>=(w|0))break;b[j>>1]=0;b[f>>1]=0;f=f+(x<<1)|0;j=j+(x<<1)|0;k=k+1|0}l=i+1179664|0;s=0-x|0;j=a+((e<<1)+2)|0;r=1;o=0;k=m+(x+1<<1)|0;a:while(1){if((r|0)>=(u|0)){j=59;break}q=j;f=o;p=1;while(1){if((p|0)>=(t|0))break;do if((d[q>>0]|0|0)>(h|0)){a=k+(s<<1)|0;j=b[a>>1]|0;if(j<<16>>16>0){b[k>>1]=j;o=(j<<16>>16)*7|0;n=i+1310736+(o+-7<<2)|0;c[n>>2]=(c[n>>2]|0)+1;n=i+1310736+(o+-6<<2)|0;c[n>>2]=(c[n>>2]|0)+p;n=i+1310736+(o+-5<<2)|0;c[n>>2]=(c[n>>2]|0)+r;c[i+1310736+(o+-1<<2)>>2]=r;break}n=b[a+2>>1]|0;o=n<<16>>16;j=b[a+-2>>1]|0;m=j<<16>>16;a=j<<16>>16>0;if(n<<16>>16<=0){if(a){b[k>>1]=j;j=m*7|0;a=i+1310736+(j+-7<<2)|0;c[a>>2]=(c[a>>2]|0)+1;a=i+1310736+(j+-6<<2)|0;c[a>>2]=(c[a>>2]|0)+p;a=i+1310736+(j+-5<<2)|0;c[a>>2]=(c[a>>2]|0)+r;a=i+1310736+(j+-3<<2)|0;if((c[a>>2]|0)<(p|0))c[a>>2]=p;c[i+1310736+(j+-1<<2)>>2]=r;break}j=b[k+-2>>1]|0;if(j<<16>>16>0){b[k>>1]=j;j=(j<<16>>16)*7|0;o=i+1310736+(j+-7<<2)|0;c[o>>2]=(c[o>>2]|0)+1;o=i+1310736+(j+-6<<2)|0;c[o>>2]=(c[o>>2]|0)+p;o=i+1310736+(j+-5<<2)|0;c[o>>2]=(c[o>>2]|0)+r;j=i+1310736+(j+-3<<2)|0;if((c[j>>2]|0)>=(p|0))break;c[j>>2]=p;break}else{j=f+1|0;if((f|0)>32767){j=54;break a}b[k>>1]=j;c[i+1179664+(f<<2)>>2]=j<<16>>16;f=f*7|0;c[i+1310736+(f<<2)>>2]=1;c[i+1310736+(f+1<<2)>>2]=p;c[i+1310736+(f+2<<2)>>2]=r;c[i+1310736+(f+3<<2)>>2]=p;c[i+1310736+(f+4<<2)>>2]=p;c[i+1310736+(f+5<<2)>>2]=r;c[i+1310736+(f+6<<2)>>2]=r;f=j;break}}if(a){j=c[i+1179664+(o+-1<<2)>>2]|0;n=c[i+1179664+(m+-1<<2)>>2]|0;b:do if((j|0)<=(n|0)){b[k>>1]=j;if((j|0)<(n|0)){a=l;m=0;while(1){if((m|0)>=(f|0))break b;if((c[a>>2]|0)==(n|0))c[a>>2]=j;a=a+4|0;m=m+1|0}}}else{b[k>>1]=n;a=l;m=0;while(1){if((m|0)>=(f|0)){j=n;break b}if((c[a>>2]|0)==(j|0))c[a>>2]=n;a=a+4|0;m=m+1|0}}while(0);o=(j<<16>>16)*7|0;n=i+1310736+(o+-7<<2)|0;c[n>>2]=(c[n>>2]|0)+1;n=i+1310736+(o+-6<<2)|0;c[n>>2]=(c[n>>2]|0)+p;n=i+1310736+(o+-5<<2)|0;c[n>>2]=(c[n>>2]|0)+r;c[i+1310736+(o+-1<<2)>>2]=r;break}a=b[k+-2>>1]|0;if(a<<16>>16<=0){b[k>>1]=n;j=o*7|0;a=i+1310736+(j+-7<<2)|0;c[a>>2]=(c[a>>2]|0)+1;a=i+1310736+(j+-6<<2)|0;c[a>>2]=(c[a>>2]|0)+p;a=i+1310736+(j+-5<<2)|0;c[a>>2]=(c[a>>2]|0)+r;a=i+1310736+(j+-4<<2)|0;if((c[a>>2]|0)>(p|0))c[a>>2]=p;c[i+1310736+(j+-1<<2)>>2]=r;break}j=c[i+1179664+(o+-1<<2)>>2]|0;n=c[i+1179664+((a<<16>>16)+-1<<2)>>2]|0;c:do if((j|0)<=(n|0)){b[k>>1]=j;if((j|0)<(n|0)){a=l;m=0;while(1){if((m|0)>=(f|0))break c;if((c[a>>2]|0)==(n|0))c[a>>2]=j;a=a+4|0;m=m+1|0}}}else{b[k>>1]=n;a=l;m=0;while(1){if((m|0)>=(f|0)){j=n;break c}if((c[a>>2]|0)==(j|0))c[a>>2]=n;a=a+4|0;m=m+1|0}}while(0);o=(j<<16>>16)*7|0;n=i+1310736+(o+-7<<2)|0;c[n>>2]=(c[n>>2]|0)+1;n=i+1310736+(o+-6<<2)|0;c[n>>2]=(c[n>>2]|0)+p;o=i+1310736+(o+-5<<2)|0;c[o>>2]=(c[o>>2]|0)+r}else b[k>>1]=0;while(0);q=q+2|0;p=p+1|0;k=k+2|0}j=q+e+4|0;r=r+1|0;o=f;k=k+4|0}d:do if((j|0)==54){Se(0,3,19708,v);f=-1}else if((j|0)==59){m=i+12|0;f=1;a=1;while(1){if((a|0)>(o|0))break;j=c[l>>2]|0;if((j|0)==(a|0))k=f+1|0;else{k=f;f=c[i+1179664+(j+-1<<2)>>2]|0}c[l>>2]=f;f=k;a=a+1|0;l=l+4|0}n=i+8|0;j=f+-1|0;c[n>>2]=j;if(!j)f=0;else{_O(m|0,0,j<<2|0)|0;_O(i+655376|0,0,j<<4|0)|0;f=0;while(1){if((f|0)>=(j|0))break;v=f<<2;c[i+131084+(v<<2)>>2]=x;c[i+131084+((v|1)<<2)>>2]=0;c[i+131084+((v|2)<<2)>>2]=w;c[i+131084+((v|3)<<2)>>2]=0;f=f+1|0}a=0;while(1){if((a|0)>=(o|0))break;k=(c[i+1179664+(a<<2)>>2]|0)+-1|0;l=a*7|0;f=i+12+(k<<2)|0;c[f>>2]=(c[f>>2]|0)+(c[i+1310736+(l<<2)>>2]|0);f=k<<1;j=i+655376+(f<<3)|0;g[j>>3]=+g[j>>3]+ +(c[i+1310736+(l+1<<2)>>2]|0);f=i+655376+((f|1)<<3)|0;g[f>>3]=+g[f>>3]+ +(c[i+1310736+(l+2<<2)>>2]|0);k=k<<2;f=i+131084+(k<<2)|0;j=c[i+1310736+(l+3<<2)>>2]|0;if((c[f>>2]|0)>(j|0))c[f>>2]=j;f=i+131084+((k|1)<<2)|0;j=c[i+1310736+(l+4<<2)>>2]|0;if((c[f>>2]|0)<(j|0))c[f>>2]=j;f=i+131084+((k|2)<<2)|0;j=c[i+1310736+(l+5<<2)>>2]|0;if((c[f>>2]|0)>(j|0))c[f>>2]=j;j=i+131084+((k|3)<<2)|0;f=c[i+1310736+(l+6<<2)>>2]|0;if((c[j>>2]|0)<(f|0))c[j>>2]=f;a=a+1|0}j=c[n>>2]|0;f=0;while(1){if((f|0)>=(j|0)){f=0;break d}z=+(c[i+12+(f<<2)>>2]|0);x=f<<1;w=i+655376+(x<<3)|0;g[w>>3]=+g[w>>3]/z;x=i+655376+((x|1)<<3)|0;g[x>>3]=+g[x>>3]/z;f=f+1|0}}}while(0);yb=y;return f|0}function fc(a,e,f,h,i){a=a|0;e=e|0;f=f|0;h=h|0;i=i|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.0;x=yb;yb=yb+16|0;w=x;n=c[i>>2]|0;v=f+-1|0;j=n;k=n+((B(v,e)|0)<<1)|0;l=0;while(1){if((l|0)>=(e|0))break;b[k>>1]=0;b[j>>1]=0;j=j+2|0;k=k+2|0;l=l+1|0}u=e+-1|0;j=n;k=n+(u<<1)|0;l=0;while(1){if((l|0)>=(f|0))break;b[k>>1]=0;b[j>>1]=0;j=j+(e<<1)|0;k=k+(e<<1)|0;l=l+1|0}m=i+1179664|0;l=e+1|0;t=0-e|0;k=a+l|0;s=1;p=0;l=n+(l<<1)|0;a:while(1){if((s|0)>=(v|0)){k=59;break}r=k;j=p;q=1;while(1){if((q|0)>=(u|0))break;do if((d[r>>0]|0|0)>(h|0)){a=l+(t<<1)|0;k=b[a>>1]|0;if(k<<16>>16>0){b[l>>1]=k;p=(k<<16>>16)*7|0;o=i+1310736+(p+-7<<2)|0;c[o>>2]=(c[o>>2]|0)+1;o=i+1310736+(p+-6<<2)|0;c[o>>2]=(c[o>>2]|0)+q;o=i+1310736+(p+-5<<2)|0;c[o>>2]=(c[o>>2]|0)+s;c[i+1310736+(p+-1<<2)>>2]=s;break}o=b[a+2>>1]|0;p=o<<16>>16;k=b[a+-2>>1]|0;n=k<<16>>16;a=k<<16>>16>0;if(o<<16>>16<=0){if(a){b[l>>1]=k;k=n*7|0;a=i+1310736+(k+-7<<2)|0;c[a>>2]=(c[a>>2]|0)+1;a=i+1310736+(k+-6<<2)|0;c[a>>2]=(c[a>>2]|0)+q;a=i+1310736+(k+-5<<2)|0;c[a>>2]=(c[a>>2]|0)+s;a=i+1310736+(k+-3<<2)|0;if((c[a>>2]|0)<(q|0))c[a>>2]=q;c[i+1310736+(k+-1<<2)>>2]=s;break}k=b[l+-2>>1]|0;if(k<<16>>16>0){b[l>>1]=k;k=(k<<16>>16)*7|0;p=i+1310736+(k+-7<<2)|0;c[p>>2]=(c[p>>2]|0)+1;p=i+1310736+(k+-6<<2)|0;c[p>>2]=(c[p>>2]|0)+q;p=i+1310736+(k+-5<<2)|0;c[p>>2]=(c[p>>2]|0)+s;k=i+1310736+(k+-3<<2)|0;if((c[k>>2]|0)>=(q|0))break;c[k>>2]=q;break}else{k=j+1|0;if((j|0)>32767){k=54;break a}b[l>>1]=k;c[i+1179664+(j<<2)>>2]=k<<16>>16;j=j*7|0;c[i+1310736+(j<<2)>>2]=1;c[i+1310736+(j+1<<2)>>2]=q;c[i+1310736+(j+2<<2)>>2]=s;c[i+1310736+(j+3<<2)>>2]=q;c[i+1310736+(j+4<<2)>>2]=q;c[i+1310736+(j+5<<2)>>2]=s;c[i+1310736+(j+6<<2)>>2]=s;j=k;break}}if(a){k=c[i+1179664+(p+-1<<2)>>2]|0;o=c[i+1179664+(n+-1<<2)>>2]|0;b:do if((k|0)<=(o|0)){b[l>>1]=k;if((k|0)<(o|0)){a=m;n=0;while(1){if((n|0)>=(j|0))break b;if((c[a>>2]|0)==(o|0))c[a>>2]=k;a=a+4|0;n=n+1|0}}}else{b[l>>1]=o;a=m;n=0;while(1){if((n|0)>=(j|0)){k=o;break b}if((c[a>>2]|0)==(k|0))c[a>>2]=o;a=a+4|0;n=n+1|0}}while(0);p=(k<<16>>16)*7|0;o=i+1310736+(p+-7<<2)|0;c[o>>2]=(c[o>>2]|0)+1;o=i+1310736+(p+-6<<2)|0;c[o>>2]=(c[o>>2]|0)+q;o=i+1310736+(p+-5<<2)|0;c[o>>2]=(c[o>>2]|0)+s;c[i+1310736+(p+-1<<2)>>2]=s;break}k=b[l+-2>>1]|0;if(k<<16>>16<=0){b[l>>1]=o;k=p*7|0;a=i+1310736+(k+-7<<2)|0;c[a>>2]=(c[a>>2]|0)+1;a=i+1310736+(k+-6<<2)|0;c[a>>2]=(c[a>>2]|0)+q;a=i+1310736+(k+-5<<2)|0;c[a>>2]=(c[a>>2]|0)+s;a=i+1310736+(k+-4<<2)|0;if((c[a>>2]|0)>(q|0))c[a>>2]=q;c[i+1310736+(k+-1<<2)>>2]=s;break}o=c[i+1179664+(p+-1<<2)>>2]|0;k=c[i+1179664+((k<<16>>16)+-1<<2)>>2]|0;c:do if((o|0)<=(k|0)){b[l>>1]=o;if((o|0)<(k|0)){a=m;n=0;while(1){if((n|0)>=(j|0)){k=o;break c}if((c[a>>2]|0)==(k|0))c[a>>2]=o;a=a+4|0;n=n+1|0}}else k=o}else{b[l>>1]=k;a=m;n=0;while(1){if((n|0)>=(j|0))break c;if((c[a>>2]|0)==(o|0))c[a>>2]=k;a=a+4|0;n=n+1|0}}while(0);p=(k<<16>>16)*7|0;o=i+1310736+(p+-7<<2)|0;c[o>>2]=(c[o>>2]|0)+1;o=i+1310736+(p+-6<<2)|0;c[o>>2]=(c[o>>2]|0)+q;p=i+1310736+(p+-5<<2)|0;c[p>>2]=(c[p>>2]|0)+s}else b[l>>1]=0;while(0);r=r+1|0;q=q+1|0;l=l+2|0}k=r+2|0;s=s+1|0;p=j;l=l+4|0}d:do if((k|0)==54){Se(0,3,19708,w);j=-1}else if((k|0)==59){n=i+12|0;j=1;a=1;while(1){if((a|0)>(p|0))break;k=c[m>>2]|0;if((k|0)==(a|0))l=j+1|0;else{l=j;j=c[i+1179664+(k+-1<<2)>>2]|0}c[m>>2]=j;j=l;a=a+1|0;m=m+4|0}o=i+8|0;k=j+-1|0;c[o>>2]=k;if(!k)j=0;else{_O(n|0,0,k<<2|0)|0;_O(i+655376|0,0,k<<4|0)|0;j=0;while(1){if((j|0)>=(k|0))break;w=j<<2;c[i+131084+(w<<2)>>2]=e;c[i+131084+((w|1)<<2)>>2]=0;c[i+131084+((w|2)<<2)>>2]=f;c[i+131084+((w|3)<<2)>>2]=0;j=j+1|0}a=0;while(1){if((a|0)>=(p|0))break;l=(c[i+1179664+(a<<2)>>2]|0)+-1|0;m=a*7|0;j=i+12+(l<<2)|0;c[j>>2]=(c[j>>2]|0)+(c[i+1310736+(m<<2)>>2]|0);j=l<<1;k=i+655376+(j<<3)|0;g[k>>3]=+g[k>>3]+ +(c[i+1310736+(m+1<<2)>>2]|0);j=i+655376+((j|1)<<3)|0;g[j>>3]=+g[j>>3]+ +(c[i+1310736+(m+2<<2)>>2]|0);l=l<<2;j=i+131084+(l<<2)|0;k=c[i+1310736+(m+3<<2)>>2]|0;if((c[j>>2]|0)>(k|0))c[j>>2]=k;j=i+131084+((l|1)<<2)|0;k=c[i+1310736+(m+4<<2)>>2]|0;if((c[j>>2]|0)<(k|0))c[j>>2]=k;j=i+131084+((l|2)<<2)|0;k=c[i+1310736+(m+5<<2)>>2]|0;if((c[j>>2]|0)>(k|0))c[j>>2]=k;k=i+131084+((l|3)<<2)|0;j=c[i+1310736+(m+6<<2)>>2]|0;if((c[k>>2]|0)<(j|0))c[k>>2]=j;a=a+1|0}k=c[o>>2]|0;j=0;while(1){if((j|0)>=(k|0)){j=0;break d}y=+(c[i+12+(j<<2)>>2]|0);f=j<<1;e=i+655376+(f<<3)|0;g[e>>3]=+g[e>>3]/y;f=i+655376+((f|1)<<3)|0;g[f>>3]=+g[f>>3]/y;j=j+1|0}}}while(0);yb=x;return j|0}function gc(a,e,f,h,i){a=a|0;e=e|0;f=f|0;h=h|0;i=i|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.0;x=yb;yb=yb+16|0;w=x;n=c[i>>2]|0;v=f+-1|0;j=n;k=0;l=n+((B(v,e)|0)<<1)|0;while(1){if((k|0)>=(e|0))break;b[l>>1]=0;b[j>>1]=0;j=j+2|0;k=k+1|0;l=l+2|0}u=e+-1|0;j=n;k=0;l=n+(u<<1)|0;while(1){if((k|0)>=(f|0))break;b[l>>1]=0;b[j>>1]=0;j=j+(e<<1)|0;k=k+1|0;l=l+(e<<1)|0}m=i+1179664|0;l=e+1|0;t=0-e|0;a=a+l|0;k=h+l|0;s=1;o=0;l=n+(l<<1)|0;a:while(1){if((s|0)>=(v|0)){k=59;break}q=k;j=o;p=1;r=l;while(1){if((p|0)>=(u|0))break;do if((d[a>>0]|0)>(d[q>>0]|0)){l=r+(t<<1)|0;k=b[l>>1]|0;if(k<<16>>16>0){b[r>>1]=k;o=(k<<16>>16)*7|0;n=i+1310736+(o+-7<<2)|0;c[n>>2]=(c[n>>2]|0)+1;n=i+1310736+(o+-6<<2)|0;c[n>>2]=(c[n>>2]|0)+p;n=i+1310736+(o+-5<<2)|0;c[n>>2]=(c[n>>2]|0)+s;c[i+1310736+(o+-1<<2)>>2]=s;break}n=b[l+2>>1]|0;o=n<<16>>16;k=b[l+-2>>1]|0;h=k<<16>>16;l=k<<16>>16>0;if(n<<16>>16<=0){if(l){b[r>>1]=k;k=h*7|0;l=i+1310736+(k+-7<<2)|0;c[l>>2]=(c[l>>2]|0)+1;l=i+1310736+(k+-6<<2)|0;c[l>>2]=(c[l>>2]|0)+p;l=i+1310736+(k+-5<<2)|0;c[l>>2]=(c[l>>2]|0)+s;l=i+1310736+(k+-3<<2)|0;if((c[l>>2]|0)<(p|0))c[l>>2]=p;c[i+1310736+(k+-1<<2)>>2]=s;break}k=b[r+-2>>1]|0;if(k<<16>>16>0){b[r>>1]=k;k=(k<<16>>16)*7|0;o=i+1310736+(k+-7<<2)|0;c[o>>2]=(c[o>>2]|0)+1;o=i+1310736+(k+-6<<2)|0;c[o>>2]=(c[o>>2]|0)+p;o=i+1310736+(k+-5<<2)|0;c[o>>2]=(c[o>>2]|0)+s;k=i+1310736+(k+-3<<2)|0;if((c[k>>2]|0)>=(p|0))break;c[k>>2]=p;break}else{k=j+1|0;if((j|0)>32767){k=54;break a}b[r>>1]=k;c[i+1179664+(j<<2)>>2]=k<<16>>16;j=j*7|0;c[i+1310736+(j<<2)>>2]=1;c[i+1310736+(j+1<<2)>>2]=p;c[i+1310736+(j+2<<2)>>2]=s;c[i+1310736+(j+3<<2)>>2]=p;c[i+1310736+(j+4<<2)>>2]=p;c[i+1310736+(j+5<<2)>>2]=s;c[i+1310736+(j+6<<2)>>2]=s;j=k;break}}if(l){k=c[i+1179664+(o+-1<<2)>>2]|0;n=c[i+1179664+(h+-1<<2)>>2]|0;b:do if((k|0)<=(n|0)){b[r>>1]=k;if((k|0)<(n|0)){l=m;h=0;while(1){if((h|0)>=(j|0))break b;if((c[l>>2]|0)==(n|0))c[l>>2]=k;l=l+4|0;h=h+1|0}}}else{b[r>>1]=n;l=m;h=0;while(1){if((h|0)>=(j|0)){k=n;break b}if((c[l>>2]|0)==(k|0))c[l>>2]=n;l=l+4|0;h=h+1|0}}while(0);o=(k<<16>>16)*7|0;n=i+1310736+(o+-7<<2)|0;c[n>>2]=(c[n>>2]|0)+1;n=i+1310736+(o+-6<<2)|0;c[n>>2]=(c[n>>2]|0)+p;n=i+1310736+(o+-5<<2)|0;c[n>>2]=(c[n>>2]|0)+s;c[i+1310736+(o+-1<<2)>>2]=s;break}l=b[r+-2>>1]|0;if(l<<16>>16<=0){b[r>>1]=n;k=o*7|0;l=i+1310736+(k+-7<<2)|0;c[l>>2]=(c[l>>2]|0)+1;l=i+1310736+(k+-6<<2)|0;c[l>>2]=(c[l>>2]|0)+p;l=i+1310736+(k+-5<<2)|0;c[l>>2]=(c[l>>2]|0)+s;l=i+1310736+(k+-4<<2)|0;if((c[l>>2]|0)>(p|0))c[l>>2]=p;c[i+1310736+(k+-1<<2)>>2]=s;break}k=c[i+1179664+(o+-1<<2)>>2]|0;n=c[i+1179664+((l<<16>>16)+-1<<2)>>2]|0;c:do if((k|0)<=(n|0)){b[r>>1]=k;if((k|0)<(n|0)){l=m;h=0;while(1){if((h|0)>=(j|0))break c;if((c[l>>2]|0)==(n|0))c[l>>2]=k;l=l+4|0;h=h+1|0}}}else{b[r>>1]=n;l=m;h=0;while(1){if((h|0)>=(j|0)){k=n;break c}if((c[l>>2]|0)==(k|0))c[l>>2]=n;l=l+4|0;h=h+1|0}}while(0);o=(k<<16>>16)*7|0;n=i+1310736+(o+-7<<2)|0;c[n>>2]=(c[n>>2]|0)+1;n=i+1310736+(o+-6<<2)|0;c[n>>2]=(c[n>>2]|0)+p;o=i+1310736+(o+-5<<2)|0;c[o>>2]=(c[o>>2]|0)+s}else b[r>>1]=0;while(0);a=a+1|0;q=q+1|0;p=p+1|0;r=r+2|0}a=a+2|0;k=q+2|0;s=s+1|0;o=j;l=r+4|0}d:do if((k|0)==54){Se(0,3,19708,w);j=-1}else if((k|0)==59){h=i+12|0;j=1;a=1;while(1){if((a|0)>(o|0))break;k=c[m>>2]|0;if((k|0)==(a|0))l=j+1|0;else{l=j;j=c[i+1179664+(k+-1<<2)>>2]|0}c[m>>2]=j;j=l;a=a+1|0;m=m+4|0}n=i+8|0;k=j+-1|0;c[n>>2]=k;if(!k)j=0;else{_O(h|0,0,k<<2|0)|0;_O(i+655376|0,0,k<<4|0)|0;j=0;while(1){if((j|0)>=(k|0))break;w=j<<2;c[i+131084+(w<<2)>>2]=e;c[i+131084+((w|1)<<2)>>2]=0;c[i+131084+((w|2)<<2)>>2]=f;c[i+131084+((w|3)<<2)>>2]=0;j=j+1|0}a=0;while(1){if((a|0)>=(o|0))break;l=(c[i+1179664+(a<<2)>>2]|0)+-1|0;m=a*7|0;j=i+12+(l<<2)|0;c[j>>2]=(c[j>>2]|0)+(c[i+1310736+(m<<2)>>2]|0);j=l<<1;k=i+655376+(j<<3)|0;g[k>>3]=+g[k>>3]+ +(c[i+1310736+(m+1<<2)>>2]|0);j=i+655376+((j|1)<<3)|0;g[j>>3]=+g[j>>3]+ +(c[i+1310736+(m+2<<2)>>2]|0);l=l<<2;j=i+131084+(l<<2)|0;k=c[i+1310736+(m+3<<2)>>2]|0;if((c[j>>2]|0)>(k|0))c[j>>2]=k;j=i+131084+((l|1)<<2)|0;k=c[i+1310736+(m+4<<2)>>2]|0;if((c[j>>2]|0)<(k|0))c[j>>2]=k;j=i+131084+((l|2)<<2)|0;k=c[i+1310736+(m+5<<2)>>2]|0;if((c[j>>2]|0)>(k|0))c[j>>2]=k;k=i+131084+((l|3)<<2)|0;j=c[i+1310736+(m+6<<2)>>2]|0;if((c[k>>2]|0)<(j|0))c[k>>2]=j;a=a+1|0}k=c[n>>2]|0;j=0;while(1){if((j|0)>=(k|0)){j=0;break d}y=+(c[i+12+(j<<2)>>2]|0);f=j<<1;e=i+655376+(f<<3)|0;g[e>>3]=+g[e>>3]/y;f=i+655376+((f|1)<<3)|0;g[f>>3]=+g[f>>3]/y;j=j+1|0}}}while(0);yb=x;return j|0}function hc(e,f,h,i,j){e=e|0;f=f|0;h=h|0;i=i|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,C=0.0;A=yb;yb=yb+16|0;x=A;z=(f|0)/2|0;y=(h|0)/2|0;n=c[j>>2]|0;w=y+-1|0;h=n;k=n+((B(w,z)|0)<<1)|0;l=0;while(1){if((l|0)>=(z|0))break;b[k>>1]=0;b[h>>1]=0;h=h+2|0;k=k+2|0;l=l+1|0}v=z+-1|0;h=n;k=n+(v<<1)|0;l=0;while(1){if((l|0)>=(y|0))break;b[k>>1]=0;b[h>>1]=0;h=h+(z<<1)|0;k=k+(z<<1)|0;l=l+1|0}m=j+1179664|0;s=z+1|0;u=0-z|0;k=e+((f<<1)+2)|0;t=1;p=0;l=(c[j+4>>2]|0)+s|0;e=n+(s<<1)|0;a:while(1){if((t|0)>=(w|0)){k=59;break}r=k;h=p;s=l;q=1;while(1){if((q|0)>=(v|0))break;do if((d[r>>0]|0|0)>(i|0)){b[e>>1]=0;a[s>>0]=0}else{a[s>>0]=-1;l=e+(u<<1)|0;k=b[l>>1]|0;if(k<<16>>16>0){b[e>>1]=k;p=(k<<16>>16)*7|0;o=j+1310736+(p+-7<<2)|0;c[o>>2]=(c[o>>2]|0)+1;o=j+1310736+(p+-6<<2)|0;c[o>>2]=(c[o>>2]|0)+q;o=j+1310736+(p+-5<<2)|0;c[o>>2]=(c[o>>2]|0)+t;c[j+1310736+(p+-1<<2)>>2]=t;break}o=b[l+2>>1]|0;p=o<<16>>16;k=b[l+-2>>1]|0;n=k<<16>>16;l=k<<16>>16>0;if(o<<16>>16<=0){if(l){b[e>>1]=k;k=n*7|0;l=j+1310736+(k+-7<<2)|0;c[l>>2]=(c[l>>2]|0)+1;l=j+1310736+(k+-6<<2)|0;c[l>>2]=(c[l>>2]|0)+q;l=j+1310736+(k+-5<<2)|0;c[l>>2]=(c[l>>2]|0)+t;l=j+1310736+(k+-3<<2)|0;if((c[l>>2]|0)<(q|0))c[l>>2]=q;c[j+1310736+(k+-1<<2)>>2]=t;break}k=b[e+-2>>1]|0;if(k<<16>>16>0){b[e>>1]=k;k=(k<<16>>16)*7|0;p=j+1310736+(k+-7<<2)|0;c[p>>2]=(c[p>>2]|0)+1;p=j+1310736+(k+-6<<2)|0;c[p>>2]=(c[p>>2]|0)+q;p=j+1310736+(k+-5<<2)|0;c[p>>2]=(c[p>>2]|0)+t;k=j+1310736+(k+-3<<2)|0;if((c[k>>2]|0)>=(q|0))break;c[k>>2]=q;break}else{k=h+1|0;if((h|0)>32767){k=54;break a}b[e>>1]=k;c[j+1179664+(h<<2)>>2]=k<<16>>16;h=h*7|0;c[j+1310736+(h<<2)>>2]=1;c[j+1310736+(h+1<<2)>>2]=q;c[j+1310736+(h+2<<2)>>2]=t;c[j+1310736+(h+3<<2)>>2]=q;c[j+1310736+(h+4<<2)>>2]=q;c[j+1310736+(h+5<<2)>>2]=t;c[j+1310736+(h+6<<2)>>2]=t;h=k;break}}if(l){k=c[j+1179664+(p+-1<<2)>>2]|0;o=c[j+1179664+(n+-1<<2)>>2]|0;b:do if((k|0)<=(o|0)){b[e>>1]=k;if((k|0)<(o|0)){l=m;n=0;while(1){if((n|0)>=(h|0))break b;if((c[l>>2]|0)==(o|0))c[l>>2]=k;l=l+4|0;n=n+1|0}}}else{b[e>>1]=o;l=m;n=0;while(1){if((n|0)>=(h|0)){k=o;break b}if((c[l>>2]|0)==(k|0))c[l>>2]=o;l=l+4|0;n=n+1|0}}while(0);p=(k<<16>>16)*7|0;o=j+1310736+(p+-7<<2)|0;c[o>>2]=(c[o>>2]|0)+1;o=j+1310736+(p+-6<<2)|0;c[o>>2]=(c[o>>2]|0)+q;o=j+1310736+(p+-5<<2)|0;c[o>>2]=(c[o>>2]|0)+t;c[j+1310736+(p+-1<<2)>>2]=t;break}l=b[e+-2>>1]|0;if(l<<16>>16<=0){b[e>>1]=o;k=p*7|0;l=j+1310736+(k+-7<<2)|0;c[l>>2]=(c[l>>2]|0)+1;l=j+1310736+(k+-6<<2)|0;c[l>>2]=(c[l>>2]|0)+q;l=j+1310736+(k+-5<<2)|0;c[l>>2]=(c[l>>2]|0)+t;l=j+1310736+(k+-4<<2)|0;if((c[l>>2]|0)>(q|0))c[l>>2]=q;c[j+1310736+(k+-1<<2)>>2]=t;break}k=c[j+1179664+(p+-1<<2)>>2]|0;o=c[j+1179664+((l<<16>>16)+-1<<2)>>2]|0;c:do if((k|0)<=(o|0)){b[e>>1]=k;if((k|0)<(o|0)){l=m;n=0;while(1){if((n|0)>=(h|0))break c;if((c[l>>2]|0)==(o|0))c[l>>2]=k;l=l+4|0;n=n+1|0}}}else{b[e>>1]=o;l=m;n=0;while(1){if((n|0)>=(h|0)){k=o;break c}if((c[l>>2]|0)==(k|0))c[l>>2]=o;l=l+4|0;n=n+1|0}}while(0);p=(k<<16>>16)*7|0;o=j+1310736+(p+-7<<2)|0;c[o>>2]=(c[o>>2]|0)+1;o=j+1310736+(p+-6<<2)|0;c[o>>2]=(c[o>>2]|0)+q;p=j+1310736+(p+-5<<2)|0;c[p>>2]=(c[p>>2]|0)+t}while(0);r=r+2|0;s=s+1|0;q=q+1|0;e=e+2|0}k=r+f+4|0;t=t+1|0;p=h;l=s+2|0;e=e+4|0}d:do if((k|0)==54){Se(0,3,19708,x);h=-1}else if((k|0)==59){n=j+12|0;h=1;e=1;while(1){if((e|0)>(p|0))break;k=c[m>>2]|0;if((k|0)==(e|0))l=h+1|0;else{l=h;h=c[j+1179664+(k+-1<<2)>>2]|0}c[m>>2]=h;h=l;e=e+1|0;m=m+4|0}o=j+8|0;k=h+-1|0;c[o>>2]=k;if(!k)h=0;else{_O(n|0,0,k<<2|0)|0;_O(j+655376|0,0,k<<4|0)|0;h=0;while(1){if((h|0)>=(k|0))break;x=h<<2;c[j+131084+(x<<2)>>2]=z;c[j+131084+((x|1)<<2)>>2]=0;c[j+131084+((x|2)<<2)>>2]=y;c[j+131084+((x|3)<<2)>>2]=0;h=h+1|0}e=0;while(1){if((e|0)>=(p|0))break;l=(c[j+1179664+(e<<2)>>2]|0)+-1|0;m=e*7|0;h=j+12+(l<<2)|0;c[h>>2]=(c[h>>2]|0)+(c[j+1310736+(m<<2)>>2]|0);h=l<<1;k=j+655376+(h<<3)|0;g[k>>3]=+g[k>>3]+ +(c[j+1310736+(m+1<<2)>>2]|0);h=j+655376+((h|1)<<3)|0;g[h>>3]=+g[h>>3]+ +(c[j+1310736+(m+2<<2)>>2]|0);l=l<<2;h=j+131084+(l<<2)|0;k=c[j+1310736+(m+3<<2)>>2]|0;if((c[h>>2]|0)>(k|0))c[h>>2]=k;h=j+131084+((l|1)<<2)|0;k=c[j+1310736+(m+4<<2)>>2]|0;if((c[h>>2]|0)<(k|0))c[h>>2]=k;h=j+131084+((l|2)<<2)|0;k=c[j+1310736+(m+5<<2)>>2]|0;if((c[h>>2]|0)>(k|0))c[h>>2]=k;k=j+131084+((l|3)<<2)|0;h=c[j+1310736+(m+6<<2)>>2]|0;if((c[k>>2]|0)<(h|0))c[k>>2]=h;e=e+1|0}k=c[o>>2]|0;h=0;while(1){if((h|0)>=(k|0)){h=0;break d}C=+(c[j+12+(h<<2)>>2]|0);z=h<<1;y=j+655376+(z<<3)|0;g[y>>3]=+g[y>>3]/C;z=j+655376+((z|1)<<3)|0;g[z>>3]=+g[z>>3]/C;h=h+1|0}}}while(0);yb=A;return h|0}function ic(e,f,h,i,j){e=e|0;f=f|0;h=h|0;i=i|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.0;z=yb;yb=yb+16|0;y=z;o=c[j>>2]|0;x=h+-1|0;k=o;l=o+((B(x,f)|0)<<1)|0;m=0;while(1){if((m|0)>=(f|0))break;b[l>>1]=0;b[k>>1]=0;k=k+2|0;l=l+2|0;m=m+1|0}w=f+-1|0;k=o;l=o+(w<<1)|0;m=0;while(1){if((m|0)>=(h|0))break;b[l>>1]=0;b[k>>1]=0;k=k+(f<<1)|0;l=l+(f<<1)|0;m=m+1|0}n=j+1179664|0;t=f+1|0;v=0-f|0;l=e+t|0;u=1;q=0;m=(c[j+4>>2]|0)+t|0;e=o+(t<<1)|0;a:while(1){if((u|0)>=(x|0)){l=59;break}s=l;k=q;t=m;r=1;while(1){if((r|0)>=(w|0))break;do if((d[s>>0]|0|0)>(i|0)){b[e>>1]=0;a[t>>0]=0}else{a[t>>0]=-1;m=e+(v<<1)|0;l=b[m>>1]|0;if(l<<16>>16>0){b[e>>1]=l;q=(l<<16>>16)*7|0;p=j+1310736+(q+-7<<2)|0;c[p>>2]=(c[p>>2]|0)+1;p=j+1310736+(q+-6<<2)|0;c[p>>2]=(c[p>>2]|0)+r;p=j+1310736+(q+-5<<2)|0;c[p>>2]=(c[p>>2]|0)+u;c[j+1310736+(q+-1<<2)>>2]=u;break}p=b[m+2>>1]|0;q=p<<16>>16;l=b[m+-2>>1]|0;o=l<<16>>16;m=l<<16>>16>0;if(p<<16>>16<=0){if(m){b[e>>1]=l;l=o*7|0;m=j+1310736+(l+-7<<2)|0;c[m>>2]=(c[m>>2]|0)+1;m=j+1310736+(l+-6<<2)|0;c[m>>2]=(c[m>>2]|0)+r;m=j+1310736+(l+-5<<2)|0;c[m>>2]=(c[m>>2]|0)+u;m=j+1310736+(l+-3<<2)|0;if((c[m>>2]|0)<(r|0))c[m>>2]=r;c[j+1310736+(l+-1<<2)>>2]=u;break}l=b[e+-2>>1]|0;if(l<<16>>16>0){b[e>>1]=l;l=(l<<16>>16)*7|0;q=j+1310736+(l+-7<<2)|0;c[q>>2]=(c[q>>2]|0)+1;q=j+1310736+(l+-6<<2)|0;c[q>>2]=(c[q>>2]|0)+r;q=j+1310736+(l+-5<<2)|0;c[q>>2]=(c[q>>2]|0)+u;l=j+1310736+(l+-3<<2)|0;if((c[l>>2]|0)>=(r|0))break;c[l>>2]=r;break}else{l=k+1|0;if((k|0)>32767){l=54;break a}b[e>>1]=l;c[j+1179664+(k<<2)>>2]=l<<16>>16;k=k*7|0;c[j+1310736+(k<<2)>>2]=1;c[j+1310736+(k+1<<2)>>2]=r;c[j+1310736+(k+2<<2)>>2]=u;c[j+1310736+(k+3<<2)>>2]=r;c[j+1310736+(k+4<<2)>>2]=r;c[j+1310736+(k+5<<2)>>2]=u;c[j+1310736+(k+6<<2)>>2]=u;k=l;break}}if(m){l=c[j+1179664+(q+-1<<2)>>2]|0;p=c[j+1179664+(o+-1<<2)>>2]|0;b:do if((l|0)<=(p|0)){b[e>>1]=l;if((l|0)<(p|0)){m=n;o=0;while(1){if((o|0)>=(k|0))break b;if((c[m>>2]|0)==(p|0))c[m>>2]=l;m=m+4|0;o=o+1|0}}}else{b[e>>1]=p;m=n;o=0;while(1){if((o|0)>=(k|0)){l=p;break b}if((c[m>>2]|0)==(l|0))c[m>>2]=p;m=m+4|0;o=o+1|0}}while(0);q=(l<<16>>16)*7|0;p=j+1310736+(q+-7<<2)|0;c[p>>2]=(c[p>>2]|0)+1;p=j+1310736+(q+-6<<2)|0;c[p>>2]=(c[p>>2]|0)+r;p=j+1310736+(q+-5<<2)|0;c[p>>2]=(c[p>>2]|0)+u;c[j+1310736+(q+-1<<2)>>2]=u;break}m=b[e+-2>>1]|0;if(m<<16>>16<=0){b[e>>1]=p;l=q*7|0;m=j+1310736+(l+-7<<2)|0;c[m>>2]=(c[m>>2]|0)+1;m=j+1310736+(l+-6<<2)|0;c[m>>2]=(c[m>>2]|0)+r;m=j+1310736+(l+-5<<2)|0;c[m>>2]=(c[m>>2]|0)+u;m=j+1310736+(l+-4<<2)|0;if((c[m>>2]|0)>(r|0))c[m>>2]=r;c[j+1310736+(l+-1<<2)>>2]=u;break}l=c[j+1179664+(q+-1<<2)>>2]|0;p=c[j+1179664+((m<<16>>16)+-1<<2)>>2]|0;c:do if((l|0)<=(p|0)){b[e>>1]=l;if((l|0)<(p|0)){m=n;o=0;while(1){if((o|0)>=(k|0))break c;if((c[m>>2]|0)==(p|0))c[m>>2]=l;m=m+4|0;o=o+1|0}}}else{b[e>>1]=p;m=n;o=0;while(1){if((o|0)>=(k|0)){l=p;break c}if((c[m>>2]|0)==(l|0))c[m>>2]=p;m=m+4|0;o=o+1|0}}while(0);q=(l<<16>>16)*7|0;p=j+1310736+(q+-7<<2)|0;c[p>>2]=(c[p>>2]|0)+1;p=j+1310736+(q+-6<<2)|0;c[p>>2]=(c[p>>2]|0)+r;q=j+1310736+(q+-5<<2)|0;c[q>>2]=(c[q>>2]|0)+u}while(0);s=s+1|0;t=t+1|0;r=r+1|0;e=e+2|0}l=s+2|0;u=u+1|0;q=k;m=t+2|0;e=e+4|0}d:do if((l|0)==54){Se(0,3,19708,y);k=-1}else if((l|0)==59){o=j+12|0;k=1;e=1;while(1){if((e|0)>(q|0))break;l=c[n>>2]|0;if((l|0)==(e|0))m=k+1|0;else{m=k;k=c[j+1179664+(l+-1<<2)>>2]|0}c[n>>2]=k;k=m;e=e+1|0;n=n+4|0}p=j+8|0;l=k+-1|0;c[p>>2]=l;if(!l)k=0;else{_O(o|0,0,l<<2|0)|0;_O(j+655376|0,0,l<<4|0)|0;k=0;while(1){if((k|0)>=(l|0))break;y=k<<2;c[j+131084+(y<<2)>>2]=f;c[j+131084+((y|1)<<2)>>2]=0;c[j+131084+((y|2)<<2)>>2]=h;c[j+131084+((y|3)<<2)>>2]=0;k=k+1|0}e=0;while(1){if((e|0)>=(q|0))break;m=(c[j+1179664+(e<<2)>>2]|0)+-1|0;n=e*7|0;k=j+12+(m<<2)|0;c[k>>2]=(c[k>>2]|0)+(c[j+1310736+(n<<2)>>2]|0);k=m<<1;l=j+655376+(k<<3)|0;g[l>>3]=+g[l>>3]+ +(c[j+1310736+(n+1<<2)>>2]|0);k=j+655376+((k|1)<<3)|0;g[k>>3]=+g[k>>3]+ +(c[j+1310736+(n+2<<2)>>2]|0);m=m<<2;k=j+131084+(m<<2)|0;l=c[j+1310736+(n+3<<2)>>2]|0;if((c[k>>2]|0)>(l|0))c[k>>2]=l;k=j+131084+((m|1)<<2)|0;l=c[j+1310736+(n+4<<2)>>2]|0;if((c[k>>2]|0)<(l|0))c[k>>2]=l;k=j+131084+((m|2)<<2)|0;l=c[j+1310736+(n+5<<2)>>2]|0;if((c[k>>2]|0)>(l|0))c[k>>2]=l;l=j+131084+((m|3)<<2)|0;k=c[j+1310736+(n+6<<2)>>2]|0;if((c[l>>2]|0)<(k|0))c[l>>2]=k;e=e+1|0}l=c[p>>2]|0;k=0;while(1){if((k|0)>=(l|0)){k=0;break d}A=+(c[j+12+(k<<2)>>2]|0);h=k<<1;f=j+655376+(h<<3)|0;g[f>>3]=+g[f>>3]/A;h=j+655376+((h|1)<<3)|0;g[h>>3]=+g[h>>3]/A;k=k+1|0}}}while(0);yb=z;return k|0}function jc(e,f,h,i,j){e=e|0;f=f|0;h=h|0;i=i|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.0;z=yb;yb=yb+16|0;y=z;p=c[j>>2]|0;x=h+-1|0;k=p;l=0;m=p+((B(x,f)|0)<<1)|0;while(1){if((l|0)>=(f|0))break;b[m>>1]=0;b[k>>1]=0;k=k+2|0;l=l+1|0;m=m+2|0}w=f+-1|0;k=p;l=0;m=p+(w<<1)|0;while(1){if((l|0)>=(h|0))break;b[m>>1]=0;b[k>>1]=0;k=k+(f<<1)|0;l=l+1|0;m=m+(f<<1)|0}n=j+1179664|0;t=f+1|0;v=0-f|0;o=e+t|0;l=i+t|0;u=1;q=0;m=(c[j+4>>2]|0)+t|0;e=p+(t<<1)|0;a:while(1){if((u|0)>=(x|0)){l=59;break}r=l;k=q;s=m;q=1;t=e;while(1){if((q|0)>=(w|0))break;do if((d[o>>0]|0)>(d[r>>0]|0)){b[t>>1]=0;a[s>>0]=0}else{a[s>>0]=-1;m=t+(v<<1)|0;l=b[m>>1]|0;if(l<<16>>16>0){b[t>>1]=l;p=(l<<16>>16)*7|0;i=j+1310736+(p+-7<<2)|0;c[i>>2]=(c[i>>2]|0)+1;i=j+1310736+(p+-6<<2)|0;c[i>>2]=(c[i>>2]|0)+q;i=j+1310736+(p+-5<<2)|0;c[i>>2]=(c[i>>2]|0)+u;c[j+1310736+(p+-1<<2)>>2]=u;break}i=b[m+2>>1]|0;p=i<<16>>16;l=b[m+-2>>1]|0;e=l<<16>>16;m=l<<16>>16>0;if(i<<16>>16<=0){if(m){b[t>>1]=l;l=e*7|0;m=j+1310736+(l+-7<<2)|0;c[m>>2]=(c[m>>2]|0)+1;m=j+1310736+(l+-6<<2)|0;c[m>>2]=(c[m>>2]|0)+q;m=j+1310736+(l+-5<<2)|0;c[m>>2]=(c[m>>2]|0)+u;m=j+1310736+(l+-3<<2)|0;if((c[m>>2]|0)<(q|0))c[m>>2]=q;c[j+1310736+(l+-1<<2)>>2]=u;break}l=b[t+-2>>1]|0;if(l<<16>>16>0){b[t>>1]=l;l=(l<<16>>16)*7|0;p=j+1310736+(l+-7<<2)|0;c[p>>2]=(c[p>>2]|0)+1;p=j+1310736+(l+-6<<2)|0;c[p>>2]=(c[p>>2]|0)+q;p=j+1310736+(l+-5<<2)|0;c[p>>2]=(c[p>>2]|0)+u;l=j+1310736+(l+-3<<2)|0;if((c[l>>2]|0)>=(q|0))break;c[l>>2]=q;break}else{l=k+1|0;if((k|0)>32767){l=54;break a}b[t>>1]=l;c[j+1179664+(k<<2)>>2]=l<<16>>16;k=k*7|0;c[j+1310736+(k<<2)>>2]=1;c[j+1310736+(k+1<<2)>>2]=q;c[j+1310736+(k+2<<2)>>2]=u;c[j+1310736+(k+3<<2)>>2]=q;c[j+1310736+(k+4<<2)>>2]=q;c[j+1310736+(k+5<<2)>>2]=u;c[j+1310736+(k+6<<2)>>2]=u;k=l;break}}if(m){l=c[j+1179664+(p+-1<<2)>>2]|0;i=c[j+1179664+(e+-1<<2)>>2]|0;b:do if((l|0)<=(i|0)){b[t>>1]=l;if((l|0)<(i|0)){m=n;e=0;while(1){if((e|0)>=(k|0))break b;if((c[m>>2]|0)==(i|0))c[m>>2]=l;m=m+4|0;e=e+1|0}}}else{b[t>>1]=i;m=n;e=0;while(1){if((e|0)>=(k|0)){l=i;break b}if((c[m>>2]|0)==(l|0))c[m>>2]=i;m=m+4|0;e=e+1|0}}while(0);p=(l<<16>>16)*7|0;i=j+1310736+(p+-7<<2)|0;c[i>>2]=(c[i>>2]|0)+1;i=j+1310736+(p+-6<<2)|0;c[i>>2]=(c[i>>2]|0)+q;i=j+1310736+(p+-5<<2)|0;c[i>>2]=(c[i>>2]|0)+u;c[j+1310736+(p+-1<<2)>>2]=u;break}m=b[t+-2>>1]|0;if(m<<16>>16<=0){b[t>>1]=i;l=p*7|0;m=j+1310736+(l+-7<<2)|0;c[m>>2]=(c[m>>2]|0)+1;m=j+1310736+(l+-6<<2)|0;c[m>>2]=(c[m>>2]|0)+q;m=j+1310736+(l+-5<<2)|0;c[m>>2]=(c[m>>2]|0)+u;m=j+1310736+(l+-4<<2)|0;if((c[m>>2]|0)>(q|0))c[m>>2]=q;c[j+1310736+(l+-1<<2)>>2]=u;break}l=c[j+1179664+(p+-1<<2)>>2]|0;i=c[j+1179664+((m<<16>>16)+-1<<2)>>2]|0;c:do if((l|0)<=(i|0)){b[t>>1]=l;if((l|0)<(i|0)){m=n;e=0;while(1){if((e|0)>=(k|0))break c;if((c[m>>2]|0)==(i|0))c[m>>2]=l;m=m+4|0;e=e+1|0}}}else{b[t>>1]=i;m=n;e=0;while(1){if((e|0)>=(k|0)){l=i;break c}if((c[m>>2]|0)==(l|0))c[m>>2]=i;m=m+4|0;e=e+1|0}}while(0);p=(l<<16>>16)*7|0;i=j+1310736+(p+-7<<2)|0;c[i>>2]=(c[i>>2]|0)+1;i=j+1310736+(p+-6<<2)|0;c[i>>2]=(c[i>>2]|0)+q;p=j+1310736+(p+-5<<2)|0;c[p>>2]=(c[p>>2]|0)+u}while(0);o=o+1|0;r=r+1|0;s=s+1|0;q=q+1|0;t=t+2|0}o=o+2|0;l=r+2|0;u=u+1|0;q=k;m=s+2|0;e=t+4|0}d:do if((l|0)==54){Se(0,3,19708,y);k=-1}else if((l|0)==59){i=j+12|0;k=1;e=1;while(1){if((e|0)>(q|0))break;l=c[n>>2]|0;if((l|0)==(e|0))m=k+1|0;else{m=k;k=c[j+1179664+(l+-1<<2)>>2]|0}c[n>>2]=k;k=m;e=e+1|0;n=n+4|0}o=j+8|0;l=k+-1|0;c[o>>2]=l;if(!l)k=0;else{_O(i|0,0,l<<2|0)|0;_O(j+655376|0,0,l<<4|0)|0;k=0;while(1){if((k|0)>=(l|0))break;y=k<<2;c[j+131084+(y<<2)>>2]=f;c[j+131084+((y|1)<<2)>>2]=0;c[j+131084+((y|2)<<2)>>2]=h;c[j+131084+((y|3)<<2)>>2]=0;k=k+1|0}e=0;while(1){if((e|0)>=(q|0))break;m=(c[j+1179664+(e<<2)>>2]|0)+-1|0;n=e*7|0;k=j+12+(m<<2)|0;c[k>>2]=(c[k>>2]|0)+(c[j+1310736+(n<<2)>>2]|0);k=m<<1;l=j+655376+(k<<3)|0;g[l>>3]=+g[l>>3]+ +(c[j+1310736+(n+1<<2)>>2]|0);k=j+655376+((k|1)<<3)|0;g[k>>3]=+g[k>>3]+ +(c[j+1310736+(n+2<<2)>>2]|0);m=m<<2;k=j+131084+(m<<2)|0;l=c[j+1310736+(n+3<<2)>>2]|0;if((c[k>>2]|0)>(l|0))c[k>>2]=l;k=j+131084+((m|1)<<2)|0;l=c[j+1310736+(n+4<<2)>>2]|0;if((c[k>>2]|0)<(l|0))c[k>>2]=l;k=j+131084+((m|2)<<2)|0;l=c[j+1310736+(n+5<<2)>>2]|0;if((c[k>>2]|0)>(l|0))c[k>>2]=l;l=j+131084+((m|3)<<2)|0;k=c[j+1310736+(n+6<<2)>>2]|0;if((c[l>>2]|0)<(k|0))c[l>>2]=k;e=e+1|0}l=c[o>>2]|0;k=0;while(1){if((k|0)>=(l|0)){k=0;break d}A=+(c[j+12+(k<<2)>>2]|0);h=k<<1;f=j+655376+(h<<3)|0;g[f>>3]=+g[f>>3]/A;h=j+655376+((h|1)<<3)|0;g[h>>3]=+g[h>>3]/A;k=k+1|0}}}while(0);yb=z;return k|0}function kc(e,f,h,i,j){e=e|0;f=f|0;h=h|0;i=i|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,C=0.0;A=yb;yb=yb+16|0;x=A;z=(f|0)/2|0;y=(h|0)/2|0;n=c[j>>2]|0;w=y+-1|0;h=n;k=n+((B(w,z)|0)<<1)|0;l=0;while(1){if((l|0)>=(z|0))break;b[k>>1]=0;b[h>>1]=0;h=h+2|0;k=k+2|0;l=l+1|0}v=z+-1|0;h=n;k=n+(v<<1)|0;l=0;while(1){if((l|0)>=(y|0))break;b[k>>1]=0;b[h>>1]=0;h=h+(z<<1)|0;k=k+(z<<1)|0;l=l+1|0}m=j+1179664|0;s=z+1|0;u=0-z|0;k=e+((f<<1)+2)|0;t=1;p=0;l=(c[j+4>>2]|0)+s|0;e=n+(s<<1)|0;a:while(1){if((t|0)>=(w|0)){k=59;break}r=k;h=p;s=l;q=1;while(1){if((q|0)>=(v|0))break;do if((d[r>>0]|0|0)>(i|0)){a[s>>0]=-1;l=e+(u<<1)|0;k=b[l>>1]|0;if(k<<16>>16>0){b[e>>1]=k;p=(k<<16>>16)*7|0;o=j+1310736+(p+-7<<2)|0;c[o>>2]=(c[o>>2]|0)+1;o=j+1310736+(p+-6<<2)|0;c[o>>2]=(c[o>>2]|0)+q;o=j+1310736+(p+-5<<2)|0;c[o>>2]=(c[o>>2]|0)+t;c[j+1310736+(p+-1<<2)>>2]=t;break}o=b[l+2>>1]|0;p=o<<16>>16;k=b[l+-2>>1]|0;n=k<<16>>16;l=k<<16>>16>0;if(o<<16>>16<=0){if(l){b[e>>1]=k;k=n*7|0;l=j+1310736+(k+-7<<2)|0;c[l>>2]=(c[l>>2]|0)+1;l=j+1310736+(k+-6<<2)|0;c[l>>2]=(c[l>>2]|0)+q;l=j+1310736+(k+-5<<2)|0;c[l>>2]=(c[l>>2]|0)+t;l=j+1310736+(k+-3<<2)|0;if((c[l>>2]|0)<(q|0))c[l>>2]=q;c[j+1310736+(k+-1<<2)>>2]=t;break}k=b[e+-2>>1]|0;if(k<<16>>16>0){b[e>>1]=k;k=(k<<16>>16)*7|0;p=j+1310736+(k+-7<<2)|0;c[p>>2]=(c[p>>2]|0)+1;p=j+1310736+(k+-6<<2)|0;c[p>>2]=(c[p>>2]|0)+q;p=j+1310736+(k+-5<<2)|0;c[p>>2]=(c[p>>2]|0)+t;k=j+1310736+(k+-3<<2)|0;if((c[k>>2]|0)>=(q|0))break;c[k>>2]=q;break}else{k=h+1|0;if((h|0)>32767){k=54;break a}b[e>>1]=k;c[j+1179664+(h<<2)>>2]=k<<16>>16;h=h*7|0;c[j+1310736+(h<<2)>>2]=1;c[j+1310736+(h+1<<2)>>2]=q;c[j+1310736+(h+2<<2)>>2]=t;c[j+1310736+(h+3<<2)>>2]=q;c[j+1310736+(h+4<<2)>>2]=q;c[j+1310736+(h+5<<2)>>2]=t;c[j+1310736+(h+6<<2)>>2]=t;h=k;break}}if(l){k=c[j+1179664+(p+-1<<2)>>2]|0;o=c[j+1179664+(n+-1<<2)>>2]|0;b:do if((k|0)<=(o|0)){b[e>>1]=k;if((k|0)<(o|0)){l=m;n=0;while(1){if((n|0)>=(h|0))break b;if((c[l>>2]|0)==(o|0))c[l>>2]=k;l=l+4|0;n=n+1|0}}}else{b[e>>1]=o;l=m;n=0;while(1){if((n|0)>=(h|0)){k=o;break b}if((c[l>>2]|0)==(k|0))c[l>>2]=o;l=l+4|0;n=n+1|0}}while(0);p=(k<<16>>16)*7|0;o=j+1310736+(p+-7<<2)|0;c[o>>2]=(c[o>>2]|0)+1;o=j+1310736+(p+-6<<2)|0;c[o>>2]=(c[o>>2]|0)+q;o=j+1310736+(p+-5<<2)|0;c[o>>2]=(c[o>>2]|0)+t;c[j+1310736+(p+-1<<2)>>2]=t;break}l=b[e+-2>>1]|0;if(l<<16>>16<=0){b[e>>1]=o;k=p*7|0;l=j+1310736+(k+-7<<2)|0;c[l>>2]=(c[l>>2]|0)+1;l=j+1310736+(k+-6<<2)|0;c[l>>2]=(c[l>>2]|0)+q;l=j+1310736+(k+-5<<2)|0;c[l>>2]=(c[l>>2]|0)+t;l=j+1310736+(k+-4<<2)|0;if((c[l>>2]|0)>(q|0))c[l>>2]=q;c[j+1310736+(k+-1<<2)>>2]=t;break}k=c[j+1179664+(p+-1<<2)>>2]|0;o=c[j+1179664+((l<<16>>16)+-1<<2)>>2]|0;c:do if((k|0)<=(o|0)){b[e>>1]=k;if((k|0)<(o|0)){l=m;n=0;while(1){if((n|0)>=(h|0))break c;if((c[l>>2]|0)==(o|0))c[l>>2]=k;l=l+4|0;n=n+1|0}}}else{b[e>>1]=o;l=m;n=0;while(1){if((n|0)>=(h|0)){k=o;break c}if((c[l>>2]|0)==(k|0))c[l>>2]=o;l=l+4|0;n=n+1|0}}while(0);p=(k<<16>>16)*7|0;o=j+1310736+(p+-7<<2)|0;c[o>>2]=(c[o>>2]|0)+1;o=j+1310736+(p+-6<<2)|0;c[o>>2]=(c[o>>2]|0)+q;p=j+1310736+(p+-5<<2)|0;c[p>>2]=(c[p>>2]|0)+t}else{b[e>>1]=0;a[s>>0]=0}while(0);r=r+2|0;s=s+1|0;q=q+1|0;e=e+2|0}k=r+f+4|0;t=t+1|0;p=h;l=s+2|0;e=e+4|0}d:do if((k|0)==54){Se(0,3,19708,x);h=-1}else if((k|0)==59){n=j+12|0;h=1;e=1;while(1){if((e|0)>(p|0))break;k=c[m>>2]|0;if((k|0)==(e|0))l=h+1|0;else{l=h;h=c[j+1179664+(k+-1<<2)>>2]|0}c[m>>2]=h;h=l;e=e+1|0;m=m+4|0}o=j+8|0;k=h+-1|0;c[o>>2]=k;if(!k)h=0;else{_O(n|0,0,k<<2|0)|0;_O(j+655376|0,0,k<<4|0)|0;h=0;while(1){if((h|0)>=(k|0))break;x=h<<2;c[j+131084+(x<<2)>>2]=z;c[j+131084+((x|1)<<2)>>2]=0;c[j+131084+((x|2)<<2)>>2]=y;c[j+131084+((x|3)<<2)>>2]=0;h=h+1|0}e=0;while(1){if((e|0)>=(p|0))break;l=(c[j+1179664+(e<<2)>>2]|0)+-1|0;m=e*7|0;h=j+12+(l<<2)|0;c[h>>2]=(c[h>>2]|0)+(c[j+1310736+(m<<2)>>2]|0);h=l<<1;k=j+655376+(h<<3)|0;g[k>>3]=+g[k>>3]+ +(c[j+1310736+(m+1<<2)>>2]|0);h=j+655376+((h|1)<<3)|0;g[h>>3]=+g[h>>3]+ +(c[j+1310736+(m+2<<2)>>2]|0);l=l<<2;h=j+131084+(l<<2)|0;k=c[j+1310736+(m+3<<2)>>2]|0;if((c[h>>2]|0)>(k|0))c[h>>2]=k;h=j+131084+((l|1)<<2)|0;k=c[j+1310736+(m+4<<2)>>2]|0;if((c[h>>2]|0)<(k|0))c[h>>2]=k;h=j+131084+((l|2)<<2)|0;k=c[j+1310736+(m+5<<2)>>2]|0;if((c[h>>2]|0)>(k|0))c[h>>2]=k;k=j+131084+((l|3)<<2)|0;h=c[j+1310736+(m+6<<2)>>2]|0;if((c[k>>2]|0)<(h|0))c[k>>2]=h;e=e+1|0}k=c[o>>2]|0;h=0;while(1){if((h|0)>=(k|0)){h=0;break d}C=+(c[j+12+(h<<2)>>2]|0);z=h<<1;y=j+655376+(z<<3)|0;g[y>>3]=+g[y>>3]/C;z=j+655376+((z|1)<<3)|0;g[z>>3]=+g[z>>3]/C;h=h+1|0}}}while(0);yb=A;return h|0}function lc(e,f,h,i,j){e=e|0;f=f|0;h=h|0;i=i|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.0;z=yb;yb=yb+16|0;y=z;o=c[j>>2]|0;x=h+-1|0;k=o;l=o+((B(x,f)|0)<<1)|0;m=0;while(1){if((m|0)>=(f|0))break;b[l>>1]=0;b[k>>1]=0;k=k+2|0;l=l+2|0;m=m+1|0}w=f+-1|0;k=o;l=o+(w<<1)|0;m=0;while(1){if((m|0)>=(h|0))break;b[l>>1]=0;b[k>>1]=0;k=k+(f<<1)|0;l=l+(f<<1)|0;m=m+1|0}n=j+1179664|0;t=f+1|0;v=0-f|0;l=e+t|0;u=1;q=0;m=(c[j+4>>2]|0)+t|0;e=o+(t<<1)|0;a:while(1){if((u|0)>=(x|0)){l=59;break}s=l;k=q;t=m;r=1;while(1){if((r|0)>=(w|0))break;do if((d[s>>0]|0|0)>(i|0)){a[t>>0]=-1;m=e+(v<<1)|0;l=b[m>>1]|0;if(l<<16>>16>0){b[e>>1]=l;q=(l<<16>>16)*7|0;p=j+1310736+(q+-7<<2)|0;c[p>>2]=(c[p>>2]|0)+1;p=j+1310736+(q+-6<<2)|0;c[p>>2]=(c[p>>2]|0)+r;p=j+1310736+(q+-5<<2)|0;c[p>>2]=(c[p>>2]|0)+u;c[j+1310736+(q+-1<<2)>>2]=u;break}p=b[m+2>>1]|0;q=p<<16>>16;l=b[m+-2>>1]|0;o=l<<16>>16;m=l<<16>>16>0;if(p<<16>>16<=0){if(m){b[e>>1]=l;l=o*7|0;m=j+1310736+(l+-7<<2)|0;c[m>>2]=(c[m>>2]|0)+1;m=j+1310736+(l+-6<<2)|0;c[m>>2]=(c[m>>2]|0)+r;m=j+1310736+(l+-5<<2)|0;c[m>>2]=(c[m>>2]|0)+u;m=j+1310736+(l+-3<<2)|0;if((c[m>>2]|0)<(r|0))c[m>>2]=r;c[j+1310736+(l+-1<<2)>>2]=u;break}l=b[e+-2>>1]|0;if(l<<16>>16>0){b[e>>1]=l;l=(l<<16>>16)*7|0;q=j+1310736+(l+-7<<2)|0;c[q>>2]=(c[q>>2]|0)+1;q=j+1310736+(l+-6<<2)|0;c[q>>2]=(c[q>>2]|0)+r;q=j+1310736+(l+-5<<2)|0;c[q>>2]=(c[q>>2]|0)+u;l=j+1310736+(l+-3<<2)|0;if((c[l>>2]|0)>=(r|0))break;c[l>>2]=r;break}else{l=k+1|0;if((k|0)>32767){l=54;break a}b[e>>1]=l;c[j+1179664+(k<<2)>>2]=l<<16>>16;k=k*7|0;c[j+1310736+(k<<2)>>2]=1;c[j+1310736+(k+1<<2)>>2]=r;c[j+1310736+(k+2<<2)>>2]=u;c[j+1310736+(k+3<<2)>>2]=r;c[j+1310736+(k+4<<2)>>2]=r;c[j+1310736+(k+5<<2)>>2]=u;c[j+1310736+(k+6<<2)>>2]=u;k=l;break}}if(m){l=c[j+1179664+(q+-1<<2)>>2]|0;p=c[j+1179664+(o+-1<<2)>>2]|0;b:do if((l|0)<=(p|0)){b[e>>1]=l;if((l|0)<(p|0)){m=n;o=0;while(1){if((o|0)>=(k|0))break b;if((c[m>>2]|0)==(p|0))c[m>>2]=l;m=m+4|0;o=o+1|0}}}else{b[e>>1]=p;m=n;o=0;while(1){if((o|0)>=(k|0)){l=p;break b}if((c[m>>2]|0)==(l|0))c[m>>2]=p;m=m+4|0;o=o+1|0}}while(0);q=(l<<16>>16)*7|0;p=j+1310736+(q+-7<<2)|0;c[p>>2]=(c[p>>2]|0)+1;p=j+1310736+(q+-6<<2)|0;c[p>>2]=(c[p>>2]|0)+r;p=j+1310736+(q+-5<<2)|0;c[p>>2]=(c[p>>2]|0)+u;c[j+1310736+(q+-1<<2)>>2]=u;break}m=b[e+-2>>1]|0;if(m<<16>>16<=0){b[e>>1]=p;l=q*7|0;m=j+1310736+(l+-7<<2)|0;c[m>>2]=(c[m>>2]|0)+1;m=j+1310736+(l+-6<<2)|0;c[m>>2]=(c[m>>2]|0)+r;m=j+1310736+(l+-5<<2)|0;c[m>>2]=(c[m>>2]|0)+u;m=j+1310736+(l+-4<<2)|0;if((c[m>>2]|0)>(r|0))c[m>>2]=r;c[j+1310736+(l+-1<<2)>>2]=u;break}l=c[j+1179664+(q+-1<<2)>>2]|0;p=c[j+1179664+((m<<16>>16)+-1<<2)>>2]|0;c:do if((l|0)<=(p|0)){b[e>>1]=l;if((l|0)<(p|0)){m=n;o=0;while(1){if((o|0)>=(k|0))break c;if((c[m>>2]|0)==(p|0))c[m>>2]=l;m=m+4|0;o=o+1|0}}}else{b[e>>1]=p;m=n;o=0;while(1){if((o|0)>=(k|0)){l=p;break c}if((c[m>>2]|0)==(l|0))c[m>>2]=p;m=m+4|0;o=o+1|0}}while(0);q=(l<<16>>16)*7|0;p=j+1310736+(q+-7<<2)|0;c[p>>2]=(c[p>>2]|0)+1;p=j+1310736+(q+-6<<2)|0;c[p>>2]=(c[p>>2]|0)+r;q=j+1310736+(q+-5<<2)|0;c[q>>2]=(c[q>>2]|0)+u}else{b[e>>1]=0;a[t>>0]=0}while(0);s=s+1|0;t=t+1|0;r=r+1|0;e=e+2|0}l=s+2|0;u=u+1|0;q=k;m=t+2|0;e=e+4|0}d:do if((l|0)==54){Se(0,3,19708,y);k=-1}else if((l|0)==59){o=j+12|0;k=1;e=1;while(1){if((e|0)>(q|0))break;l=c[n>>2]|0;if((l|0)==(e|0))m=k+1|0;else{m=k;k=c[j+1179664+(l+-1<<2)>>2]|0}c[n>>2]=k;k=m;e=e+1|0;n=n+4|0}p=j+8|0;l=k+-1|0;c[p>>2]=l;if(!l)k=0;else{_O(o|0,0,l<<2|0)|0;_O(j+655376|0,0,l<<4|0)|0;k=0;while(1){if((k|0)>=(l|0))break;y=k<<2;c[j+131084+(y<<2)>>2]=f;c[j+131084+((y|1)<<2)>>2]=0;c[j+131084+((y|2)<<2)>>2]=h;c[j+131084+((y|3)<<2)>>2]=0;k=k+1|0}e=0;while(1){if((e|0)>=(q|0))break;m=(c[j+1179664+(e<<2)>>2]|0)+-1|0;n=e*7|0;k=j+12+(m<<2)|0;c[k>>2]=(c[k>>2]|0)+(c[j+1310736+(n<<2)>>2]|0);k=m<<1;l=j+655376+(k<<3)|0;g[l>>3]=+g[l>>3]+ +(c[j+1310736+(n+1<<2)>>2]|0);k=j+655376+((k|1)<<3)|0;g[k>>3]=+g[k>>3]+ +(c[j+1310736+(n+2<<2)>>2]|0);m=m<<2;k=j+131084+(m<<2)|0;l=c[j+1310736+(n+3<<2)>>2]|0;if((c[k>>2]|0)>(l|0))c[k>>2]=l;k=j+131084+((m|1)<<2)|0;l=c[j+1310736+(n+4<<2)>>2]|0;if((c[k>>2]|0)<(l|0))c[k>>2]=l;k=j+131084+((m|2)<<2)|0;l=c[j+1310736+(n+5<<2)>>2]|0;if((c[k>>2]|0)>(l|0))c[k>>2]=l;l=j+131084+((m|3)<<2)|0;k=c[j+1310736+(n+6<<2)>>2]|0;if((c[l>>2]|0)<(k|0))c[l>>2]=k;e=e+1|0}l=c[p>>2]|0;k=0;while(1){if((k|0)>=(l|0)){k=0;break d}A=+(c[j+12+(k<<2)>>2]|0);h=k<<1;f=j+655376+(h<<3)|0;g[f>>3]=+g[f>>3]/A;h=j+655376+((h|1)<<3)|0;g[h>>3]=+g[h>>3]/A;k=k+1|0}}}while(0);yb=z;return k|0}function mc(e,f,h,i,j){e=e|0;f=f|0;h=h|0;i=i|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.0;z=yb;yb=yb+16|0;y=z;p=c[j>>2]|0;x=h+-1|0;k=p;l=0;m=p+((B(x,f)|0)<<1)|0;while(1){if((l|0)>=(f|0))break;b[m>>1]=0;b[k>>1]=0;k=k+2|0;l=l+1|0;m=m+2|0}w=f+-1|0;k=p;l=0;m=p+(w<<1)|0;while(1){if((l|0)>=(h|0))break;b[m>>1]=0;b[k>>1]=0;k=k+(f<<1)|0;l=l+1|0;m=m+(f<<1)|0}n=j+1179664|0;t=f+1|0;v=0-f|0;o=e+t|0;l=i+t|0;u=1;q=0;m=(c[j+4>>2]|0)+t|0;e=p+(t<<1)|0;a:while(1){if((u|0)>=(x|0)){l=59;break}r=l;k=q;s=m;q=1;t=e;while(1){if((q|0)>=(w|0))break;do if((d[o>>0]|0)>(d[r>>0]|0)){a[s>>0]=-1;m=t+(v<<1)|0;l=b[m>>1]|0;if(l<<16>>16>0){b[t>>1]=l;p=(l<<16>>16)*7|0;i=j+1310736+(p+-7<<2)|0;c[i>>2]=(c[i>>2]|0)+1;i=j+1310736+(p+-6<<2)|0;c[i>>2]=(c[i>>2]|0)+q;i=j+1310736+(p+-5<<2)|0;c[i>>2]=(c[i>>2]|0)+u;c[j+1310736+(p+-1<<2)>>2]=u;break}i=b[m+2>>1]|0;p=i<<16>>16;l=b[m+-2>>1]|0;e=l<<16>>16;m=l<<16>>16>0;if(i<<16>>16<=0){if(m){b[t>>1]=l;l=e*7|0;m=j+1310736+(l+-7<<2)|0;c[m>>2]=(c[m>>2]|0)+1;m=j+1310736+(l+-6<<2)|0;c[m>>2]=(c[m>>2]|0)+q;m=j+1310736+(l+-5<<2)|0;c[m>>2]=(c[m>>2]|0)+u;m=j+1310736+(l+-3<<2)|0;if((c[m>>2]|0)<(q|0))c[m>>2]=q;c[j+1310736+(l+-1<<2)>>2]=u;break}l=b[t+-2>>1]|0;if(l<<16>>16>0){b[t>>1]=l;l=(l<<16>>16)*7|0;p=j+1310736+(l+-7<<2)|0;c[p>>2]=(c[p>>2]|0)+1;p=j+1310736+(l+-6<<2)|0;c[p>>2]=(c[p>>2]|0)+q;p=j+1310736+(l+-5<<2)|0;c[p>>2]=(c[p>>2]|0)+u;l=j+1310736+(l+-3<<2)|0;if((c[l>>2]|0)>=(q|0))break;c[l>>2]=q;break}else{l=k+1|0;if((k|0)>32767){l=54;break a}b[t>>1]=l;c[j+1179664+(k<<2)>>2]=l<<16>>16;k=k*7|0;c[j+1310736+(k<<2)>>2]=1;c[j+1310736+(k+1<<2)>>2]=q;c[j+1310736+(k+2<<2)>>2]=u;c[j+1310736+(k+3<<2)>>2]=q;c[j+1310736+(k+4<<2)>>2]=q;c[j+1310736+(k+5<<2)>>2]=u;c[j+1310736+(k+6<<2)>>2]=u;k=l;break}}if(m){l=c[j+1179664+(p+-1<<2)>>2]|0;i=c[j+1179664+(e+-1<<2)>>2]|0;b:do if((l|0)<=(i|0)){b[t>>1]=l;if((l|0)<(i|0)){m=n;e=0;while(1){if((e|0)>=(k|0))break b;if((c[m>>2]|0)==(i|0))c[m>>2]=l;m=m+4|0;e=e+1|0}}}else{b[t>>1]=i;m=n;e=0;while(1){if((e|0)>=(k|0)){l=i;break b}if((c[m>>2]|0)==(l|0))c[m>>2]=i;m=m+4|0;e=e+1|0}}while(0);p=(l<<16>>16)*7|0;i=j+1310736+(p+-7<<2)|0;c[i>>2]=(c[i>>2]|0)+1;i=j+1310736+(p+-6<<2)|0;c[i>>2]=(c[i>>2]|0)+q;i=j+1310736+(p+-5<<2)|0;c[i>>2]=(c[i>>2]|0)+u;c[j+1310736+(p+-1<<2)>>2]=u;break}m=b[t+-2>>1]|0;if(m<<16>>16<=0){b[t>>1]=i;l=p*7|0;m=j+1310736+(l+-7<<2)|0;c[m>>2]=(c[m>>2]|0)+1;m=j+1310736+(l+-6<<2)|0;c[m>>2]=(c[m>>2]|0)+q;m=j+1310736+(l+-5<<2)|0;c[m>>2]=(c[m>>2]|0)+u;m=j+1310736+(l+-4<<2)|0;if((c[m>>2]|0)>(q|0))c[m>>2]=q;c[j+1310736+(l+-1<<2)>>2]=u;break}l=c[j+1179664+(p+-1<<2)>>2]|0;i=c[j+1179664+((m<<16>>16)+-1<<2)>>2]|0;c:do if((l|0)<=(i|0)){b[t>>1]=l;if((l|0)<(i|0)){m=n;e=0;while(1){if((e|0)>=(k|0))break c;if((c[m>>2]|0)==(i|0))c[m>>2]=l;m=m+4|0;e=e+1|0}}}else{b[t>>1]=i;m=n;e=0;while(1){if((e|0)>=(k|0)){l=i;break c}if((c[m>>2]|0)==(l|0))c[m>>2]=i;m=m+4|0;e=e+1|0}}while(0);p=(l<<16>>16)*7|0;i=j+1310736+(p+-7<<2)|0;c[i>>2]=(c[i>>2]|0)+1;i=j+1310736+(p+-6<<2)|0;c[i>>2]=(c[i>>2]|0)+q;p=j+1310736+(p+-5<<2)|0;c[p>>2]=(c[p>>2]|0)+u}else{b[t>>1]=0;a[s>>0]=0}while(0);o=o+1|0;r=r+1|0;s=s+1|0;q=q+1|0;t=t+2|0}o=o+2|0;l=r+2|0;u=u+1|0;q=k;m=s+2|0;e=t+4|0}d:do if((l|0)==54){Se(0,3,19708,y);k=-1}else if((l|0)==59){i=j+12|0;k=1;e=1;while(1){if((e|0)>(q|0))break;l=c[n>>2]|0;if((l|0)==(e|0))m=k+1|0;else{m=k;k=c[j+1179664+(l+-1<<2)>>2]|0}c[n>>2]=k;k=m;e=e+1|0;n=n+4|0}o=j+8|0;l=k+-1|0;c[o>>2]=l;if(!l)k=0;else{_O(i|0,0,l<<2|0)|0;_O(j+655376|0,0,l<<4|0)|0;k=0;while(1){if((k|0)>=(l|0))break;y=k<<2;c[j+131084+(y<<2)>>2]=f;c[j+131084+((y|1)<<2)>>2]=0;c[j+131084+((y|2)<<2)>>2]=h;c[j+131084+((y|3)<<2)>>2]=0;k=k+1|0}e=0;while(1){if((e|0)>=(q|0))break;m=(c[j+1179664+(e<<2)>>2]|0)+-1|0;n=e*7|0;k=j+12+(m<<2)|0;c[k>>2]=(c[k>>2]|0)+(c[j+1310736+(n<<2)>>2]|0);k=m<<1;l=j+655376+(k<<3)|0;g[l>>3]=+g[l>>3]+ +(c[j+1310736+(n+1<<2)>>2]|0);k=j+655376+((k|1)<<3)|0;g[k>>3]=+g[k>>3]+ +(c[j+1310736+(n+2<<2)>>2]|0);m=m<<2;k=j+131084+(m<<2)|0;l=c[j+1310736+(n+3<<2)>>2]|0;if((c[k>>2]|0)>(l|0))c[k>>2]=l;k=j+131084+((m|1)<<2)|0;l=c[j+1310736+(n+4<<2)>>2]|0;if((c[k>>2]|0)<(l|0))c[k>>2]=l;k=j+131084+((m|2)<<2)|0;l=c[j+1310736+(n+5<<2)>>2]|0;if((c[k>>2]|0)>(l|0))c[k>>2]=l;l=j+131084+((m|3)<<2)|0;k=c[j+1310736+(n+6<<2)>>2]|0;if((c[l>>2]|0)<(k|0))c[l>>2]=k;e=e+1|0}l=c[o>>2]|0;k=0;while(1){if((k|0)>=(l|0)){k=0;break d}A=+(c[j+12+(k<<2)>>2]|0);h=k<<1;f=j+655376+(h<<3)|0;g[f>>3]=+g[f>>3]/A;h=j+655376+((h|1)<<3)|0;g[h>>3]=+g[h>>3]/A;k=k+1|0}}}while(0);yb=z;return k|0}function nc(a){a=a|0;return oc(a+8|0)|0}function oc(a){a=a|0;var b=0,d=0;d=yb;yb=yb+16|0;b=DO(4)|0;if(!b){Se(0,3,41858,d);Ea(1)}a=Ce(a)|0;c[b>>2]=a;if(!a){EO(b);b=0}yb=d;return b|0}function pc(a){a=a|0;var b=0;b=c[a>>2]|0;if(!b)a=-1;else{De(b)|0;EO(c[a>>2]|0);c[a>>2]=0;a=0}return a|0}function qc(a){a=a|0;var b=0,d=0,e=0;d=yb;yb=yb+16|0;b=DO(7062432)|0;if(!b){Se(0,3,41858,d);Ea(1)}c[b>>2]=0;c[b+4834148>>2]=0;c[b+7062408>>2]=0;c[b+4>>2]=-1;c[b+8>>2]=0;c[b+12>>2]=1;c[b+16>>2]=100;c[b+20>>2]=0;c[b+24>>2]=0;c[b+28>>2]=2;g[b+7062416>>3]=.5;c[b+7062424>>2]=3;c[b+32>>2]=a;e=c[a>>2]|0;c[b+36>>2]=e;a=c[a+4>>2]|0;c[b+40>>2]=a;c[b+44>>2]=0;c[b+15408>>2]=0;c[b+4834152>>2]=0;c[b+4818296>>2]=0;a=DO(B(e<<1,a)|0)|0;c[b+4834144>>2]=a;if(!a){Se(0,3,41858,d+8|0);Ea(1)}else{c[b+7062384>>2]=0;rc(b,0)|0;c[b+7062388>>2]=-1;sc(b,0)|0;tc(b,7)|0;yb=d;return b|0}return 0}function rc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=yb;yb=yb+16|0;e=f;do if(a)if((c[a>>2]|0)!=(b|0)){c[a>>2]=b;if(!b){d=a+4834148|0;EO(c[d>>2]|0);c[d>>2]=0;d=0;break}b=DO(B(c[a+40>>2]|0,c[a+36>>2]|0)|0)|0;c[a+4834148>>2]=b;if(!b){Se(0,3,41858,e);Ea(1)}else d=0}else d=0;else d=-1;while(0);yb=f;return d|0}function sc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=yb;yb=yb+16|0;h=i+8|0;f=i;if(a){g=a+7062388|0;if((c[g>>2]|0)!=(b|0)){d=a+7062408|0;e=c[d>>2]|0;if(e|0){Xc(e);c[d>>2]=0}switch(b|0){case 3:case 2:case 1:{c[d>>2]=Wc(c[a+36>>2]|0,c[a+40>>2]|0)|0;break}case 4:{c[a+7062404>>2]=1;c[a+7062400>>2]=1;b=4;break}case 0:break;default:{Se(0,3,19740,f);b=0}}c[g>>2]=b;if((c[a>>2]|0)==1){c[h>>2]=c[16+(b<<2)>>2];Se(0,3,19814,h);b=0}else b=0}else b=0}else b=-1;yb=i;return b|0}function tc(a,b){a=a|0;b=b|0;if(!a)a=-1;else{c[a+7062392>>2]=b;c[a+7062396>>2]=0;a=0}return a|0}function uc(a){a=a|0;var b=0,d=0;if(!a)a=-1;else{b=a+7062408|0;d=c[b>>2]|0;if(d|0){Xc(d);c[b>>2]=0}EO(c[a+4834144>>2]|0);EO(c[a+4834148>>2]|0);EO(a);a=0}return a|0}function vc(a,b){a=a|0;b=b|0;if((a|0)!=0&(b|0)!=0){c[b>>2]=c[a>>2];a=0}else a=-1;return a|0}function wc(a,b){a=a|0;b=b|0;if((a|0)!=0&b>>>0<2){c[a+12>>2]=b;a=0}else a=-1;return a|0}function xc(a,b){a=a|0;b=b|0;if((a|0)!=0&(b|0)!=0){c[b>>2]=c[a+12>>2];a=0}else a=-1;return a|0}function yc(a,b){a=a|0;b=b|0;if((a|0)==0|b>>>0>255)a=-1;else{c[a+16>>2]=b;a=0}return a|0}function zc(a,b){a=a|0;b=b|0;if((a|0)!=0&(b|0)!=0){c[b>>2]=c[a+16>>2];a=0}else a=-1;return a|0}function Ac(a,b){a=a|0;b=b|0;if((a|0)!=0&(b|0)!=0){c[b>>2]=c[a+7062388>>2];a=0}else a=-1;return a|0}function Bc(a,b){a=a|0;b=b|0;if((a|0)!=0&b>>>0<2){c[a+20>>2]=b;a=0}else a=-1;return a|0}function Cc(a,b){a=a|0;b=b|0;if(!a)a=-1;else{c[b>>2]=c[a+20>>2];a=0}return a|0}function Dc(a,b){a=a|0;b=b|0;if((a|0)!=0&b>>>0<5){c[a+24>>2]=b;a=0}else a=-1;return a|0}function Ec(a,b){a=a|0;b=b|0;if(!a)a=-1;else{c[a+7062424>>2]=b;a=0}return a|0}function Fc(a,b){a=a|0;b=b|0;if((a|0)!=0&(b|0)!=0){c[b>>2]=c[a+7062424>>2];a=0}else a=-1;return a|0}function Gc(a,b){a=a|0;b=b|0;if(!a)a=-1;else{c[b>>2]=c[a+24>>2];a=0}return a|0}function Hc(a,b){a=a|0;b=+b;if((a|0)!=0?!(b<=0.0|b>=1.0):0){g[a+7062416>>3]=b;a=0}else a=-1;return a|0}function Ic(a,b){a=a|0;b=b|0;if(!a)a=-1;else{g[b>>3]=+g[a+7062416>>3];a=0}return a|0}function Jc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=yb;yb=yb+16|0;e=f;a:do if(a){d=a+4|0;if((c[d>>2]|0)!=(b|0)){if(b>>>0>=15){c[e>>2]=b;Se(0,3,19909,e);a=-1;break}c[d>>2]=b;c[a+8>>2]=xd(b)|0;a=a+24|0;d=c[a>>2]|0;if(!(28704>>>(b&32767)&1))switch(d|0){case 1:{c[a>>2]=4;a=0;break a}case 4:{c[a>>2]=3;a=0;break a}default:{a=0;break a}}else switch(d|0){case 0:{c[a>>2]=1;a=0;break a}case 3:{c[a>>2]=4;a=0;break a}default:{a=0;break a}}}else a=0}else a=-1;while(0);yb=f;return a|0}function Kc(a,b){a=a|0;b=b|0;var e=0,f=0,h=0,i=0,j=0,k=0,l=0.0,m=0.0,n=0,o=0.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.0,O=0,P=0,Q=0.0,R=0.0;P=yb;yb=yb+64|0;L=P+32|0;F=P+24|0;y=P;J=P+52|0;C=P+40|0;a:do if((a|0)!=0&(b|0)!=0){O=a+44|0;c[O>>2]=0;K=a+7062388|0;e=c[K>>2]|0;b:do if((e|0)==4){H=a+7062396|0;e=c[H>>2]|0;do if((e|0)>0)c[H>>2]=e+-1;else{B=a+16|0;D=c[B>>2]|0;E=a+7062400|0;z=(c[E>>2]|0)+D|0;z=(z|0)<255?z:255;c[J>>2]=z;G=a+7062404|0;A=D-(c[G>>2]|0)|0;A=(A|0)>0?A:0;c[J+4>>2]=A;c[J+8>>2]=D;f=b+12|0;h=a+36|0;i=a+40|0;j=a+12|0;k=a+20|0;n=a+4834144|0;p=a+15416|0;q=a+15408|0;r=a+4|0;s=a+7062384|0;t=a+24|0;u=a+32|0;v=a+7062416|0;w=a+48|0;x=a+7062424|0;e=0;while(1){if(e>>>0>=3)break;if((cd(c[f>>2]|0,c[h>>2]|0,c[i>>2]|0,c[a>>2]|0,c[j>>2]|0,c[J+(e<<2)>>2]|0,c[k>>2]|0,n,0)|0)<0){M=29;break}if((Mc(c[h>>2]|0,c[i>>2]|0,n,c[k>>2]|0,1e6,70,1.0,p,q)|0)<0){M=29;break}if((Rc(c[b>>2]|0,c[h>>2]|0,c[i>>2]|0,c[r>>2]|0,p,c[q>>2]|0,c[s>>2]|0,c[k>>2]|0,c[t>>2]|0,(c[u>>2]|0)+184|0,+g[v>>3],w,O,c[x>>2]|0)|0)<0){M=29;break}c[C+(e<<2)>>2]=c[O>>2];e=e+1|0}if((M|0)==29){e=-1;break a}if((c[a>>2]|0)==1){x=c[C+4>>2]|0;h=c[C+8>>2]|0;f=c[C>>2]|0;c[y>>2]=A;c[y+4>>2]=x;c[y+8>>2]=D;c[y+12>>2]=h;c[y+16>>2]=z;c[y+20>>2]=f;Se(0,3,19958,y)}else{f=c[C>>2]|0;h=c[C+8>>2]|0}e=c[C+4>>2]|0;if((f|0)>(h|0)|(e|0)>(h|0)){f=(f|0)<(e|0)?A:z;c[B>>2]=f;e=f-D|0;if((e|0)>0){c[E>>2]=e;e=1}else{c[E>>2]=1;e=0-e|0}c[G>>2]=e;if((c[a>>2]|0)==1){c[F>>2]=f;Se(0,3,20034,F);c[H>>2]=c[a+7062392>>2];break}else{c[H>>2]=c[a+7062392>>2];break}}e=c[E>>2]|0;f=c[G>>2]|0;do if((e|0)>=(f|0))if((e|0)>(f|0)){c[G>>2]=f+1;break}else{e=e+1|0;c[E>>2]=e;c[G>>2]=f+1;break}else{e=e+1|0;c[E>>2]=e}while(0);if((e+D|0)>254){c[E>>2]=1;e=1}if((D|0)<=(e|0))c[G>>2]=1;c[H>>2]=c[a+7062392>>2];break b}while(0);h=c[K>>2]|0;M=33}else{h=e;M=33}while(0);if((M|0)==33){c:do switch(h|0){case 3:{f=a+7062408|0;h=b+12|0;e=bd(c[f>>2]|0,c[h>>2]|0,9,-7)|0;if((e|0)<0)break a;e=c[f>>2]|0;k=a+4834144|0;e=cd(c[h>>2]|0,c[e+4>>2]|0,c[e+8>>2]|0,c[a>>2]|0,c[a+12>>2]|0,0,0,k,c[e>>2]|0)|0;if((e|0)<0)break a;e=a+36|0;f=a+40|0;h=a+20|0;break}case 2:case 1:{i=a+7062396|0;e=c[i>>2]|0;if((e|0)>0){c[i>>2]=e+-1;M=48;break c}e=c[a+7062408>>2]|0;f=c[b+12>>2]|0;if((h|0)==1)e=$c(e,f,J)|0;else e=ad(e,f,J)|0;if((e|0)<0)break a;e=a+16|0;if((c[a>>2]|0)==1?(I=d[J>>0]|0,(c[e>>2]|0)!=(I|0)):0){c[L>>2]=(c[K>>2]|0)==1?20086:20093;c[L+4>>2]=I;Se(0,3,20098,L)}c[e>>2]=d[J>>0];c[i>>2]=c[a+7062392>>2];M=48;break}default:M=48}while(0);if((M|0)==48){e=a+36|0;f=a+40|0;h=a+20|0;k=a+4834144|0;if((cd(c[b+12>>2]|0,c[e>>2]|0,c[f>>2]|0,c[a>>2]|0,c[a+12>>2]|0,c[a+16>>2]|0,c[h>>2]|0,k,0)|0)<0){e=-1;break}}i=a+15416|0;j=a+15408|0;if((Mc(c[e>>2]|0,c[f>>2]|0,k,c[h>>2]|0,1e6,70,1.0,i,j)|0)<0){e=-1;break}if((Rc(c[b>>2]|0,c[e>>2]|0,c[f>>2]|0,c[a+4>>2]|0,i,c[j>>2]|0,c[a+7062384>>2]|0,c[h>>2]|0,c[a+24>>2]|0,(c[a+32>>2]|0)+184|0,+g[a+7062416>>3],a+48|0,O,c[a+7062424>>2]|0)|0)<0){e=-1;break}}s=a+28|0;if((c[s>>2]|0)==1){Lc(a);e=0;break}t=a+4818296|0;q=c[t>>2]|0;r=a+24|0;p=0;while(1){if((p|0)>=(q|0))break;h=c[O>>2]|0;i=a+4818304+(p*264|0)|0;j=a+4818304+(p*264|0)+56|0;k=a+4818304+(p*264|0)+64|0;f=0;n=-1;l=.5;while(1){if((f|0)>=(h|0))break;m=+(c[a+48+(f<<8)>>2]|0);o=+(c[i>>2]|0)/m;if(!(o<.7|o>1.43)?(o=+g[a+48+(f<<8)+56>>3]-+g[j>>3],N=+g[a+48+(f<<8)+64>>3]-+g[k>>3],N=(o*o+N*N)/m,N-1){k=c[r>>2]|0;switch(k|0){case 2:case 1:case 0:break;case 4:case 3:{f=a+48+(n<<8)+40|0;m=+g[a+4818304+(p*264|0)+40>>3];if(!(+g[f>>3]>3];if(!(+g[e>>3]>3]}g[f>>3]=m;c[a+48+(n<<8)+8>>2]=c[a+4818304+(p*264|0)+8>>2];g[e>>3]=l;c[a+48+(n<<8)+12>>2]=c[a+4818304+(p*264|0)+12>>2];f=0;h=-1;m=1.0e8;while(1){if((f|0)==4)break;e=0;l=0.0;while(1){if((e|0)==4)break;b=e+f&3;Q=+g[a+4818304+(p*264|0)+168+(e<<4)>>3]-+g[a+48+(n<<8)+168+(b<<4)>>3];o=+g[a+4818304+(p*264|0)+168+(e<<4)+8>>3]-+g[a+48+(n<<8)+168+(b<<4)+8>>3];e=e+1|0;l=l+(Q*Q+o*o)}b=l>2]=(b+(c[a+4818304+(p*264|0)+20>>2]|0)|0)%4|0;c[a+48+(n<<8)+24>>2]=(b+(c[a+4818304+(p*264|0)+24>>2]|0)|0)%4|0;break d}default:{e=-1;break a}}e=a+48+(n<<8)+32|0;o=+g[a+4818304+(p*264|0)+32>>3];if(+g[e>>3]>3]=o;i=c[a+4818304+(p*264|0)+4>>2]|0;c[a+48+(n<<8)+4>>2]=i;j=a+4818304+(p*264|0)+16|0;f=-1;l=1.0e8;h=0;while(1){if((h|0)==4)break;e=0;m=0.0;while(1){if((e|0)==4)break;b=e+h&3;R=+g[a+4818304+(p*264|0)+168+(e<<4)>>3]-+g[a+48+(n<<8)+168+(b<<4)>>3];Q=+g[a+4818304+(p*264|0)+168+(e<<4)+8>>3]-+g[a+48+(n<<8)+168+(b<<4)+8>>3];e=e+1|0;m=m+(R*R+Q*Q)}if(m>2]|0)|0)%4|0;l=m}else e=f;f=e;h=h+1|0}c[a+48+(n<<8)+16>>2]=f;if(k>>>0<2){c[a+48+(n<<8)+8>>2]=i;g[a+48+(n<<8)+40>>3]=o;c[a+48+(n<<8)+20>>2]=f;break}else{c[a+48+(n<<8)+12>>2]=i;g[a+48+(n<<8)+48>>3]=o;c[a+48+(n<<8)+24>>2]=f;break}}}while(0);p=p+1|0}Lc(a);f=0;e=0;while(1){if((f|0)>=(c[t>>2]|0))break;M=a+4818304+(f*264|0)+256|0;b=c[M>>2]|0;c[M>>2]=b+1;if((b|0)<3){if((f|0)!=(e|0))YO(a+4818304+(e*264|0)|0,a+4818304+(f*264|0)|0,264)|0;e=e+1|0}f=f+1|0}c[t>>2]=e;f=c[O>>2]|0;k=0;while(1){if((k|0)>=(f|0))break;j=a+48+(k<<8)|0;h=c[a+48+(k<<8)+4>>2]|0;if((h|0)>=0){i=0;while(1){if((i|0)>=(e|0))break;if((c[a+4818304+(i*264|0)+4>>2]|0)==(h|0))break;i=i+1|0}if((i|0)==(e|0)){if((e|0)==60)break;e=e+1|0;c[t>>2]=e}YO(a+4818304+(i*264|0)|0,j|0,256)|0;c[a+4818304+(i*264|0)+256>>2]=1}k=k+1|0}if((c[s>>2]|0)==2)e=0;else{n=0;while(1){if((n|0)>=(e|0)){e=0;break a}i=a+4818304+(n*264|0)|0;j=a+4818304+(n*264|0)+56|0;k=a+4818304+(n*264|0)+64|0;h=0;while(1){if((h|0)>=(f|0))break;l=+(c[a+48+(h<<8)>>2]|0);R=+(c[i>>2]|0)/l;if(!(R<.7|R>1.43)?(Q=+g[a+48+(h<<8)+56>>3]-+g[j>>3],R=+g[a+48+(h<<8)+64>>3]-+g[k>>3],(Q*Q+R*R)/l<.5):0)break;h=h+1|0}if((h|0)==(f|0)){YO(a+48+(f<<8)|0,a+4818304+(n*264|0)|0,256)|0;f=f+1|0;c[O>>2]=f;e=c[t>>2]|0}n=n+1|0}}}else e=-1;while(0);yb=P;return e|0}function Lc(a){a=a|0;var b=0,d=0,e=0,f=0;a:do switch(c[a+24>>2]|0){case 1:case 0:{d=c[a+44>>2]|0;b=0;while(1){if((b|0)>=(d|0))break a;e=a+48+(b<<8)+4|0;if((c[e>>2]|0)>-1?+g[a+48+(b<<8)+32>>3]<.5:0){c[a+48+(b<<8)+8>>2]=-1;c[e>>2]=-1;c[a+48+(b<<8)+236>>2]=6}b=b+1|0}}case 2:{d=c[a+44>>2]|0;b=0;while(1){if((b|0)>=(d|0))break a;e=a+48+(b<<8)+4|0;if((c[e>>2]|0)>-1?+g[a+48+(b<<8)+32>>3]<.5:0){c[a+48+(b<<8)+12>>2]=-1;c[e>>2]=-1;c[a+48+(b<<8)+236>>2]=6}b=b+1|0}}default:{f=c[a+44>>2]|0;e=0;while(1){if((e|0)>=(f|0))break a;b=a+48+(e<<8)+8|0;if((c[b>>2]|0)>-1?+g[a+48+(e<<8)+40>>3]<.5:0){c[b>>2]=-1;b=0}else b=1;d=a+48+(e<<8)+12|0;if(((c[d>>2]|0)>-1?+g[a+48+(e<<8)+48>>3]<.5:0)?(c[d>>2]=-1,(b|0)==0):0)c[a+48+(e<<8)+236>>2]=6;e=e+1|0}}}while(0);return}function Mc(a,b,d,e,f,h,i,j,k){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=+i;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.0;r=(e|0)==1;if(r){a=(a|0)/2|0;b=(b|0)/2|0;f=(f|0)/4|0;h=(h|0)/4|0}c[k>>2]=0;n=d+8|0;o=a+-2|0;b=b+-2|0;l=d+1179664|0;e=0;while(1){if((e|0)>=(c[n>>2]|0)){q=5;break}m=d+12+(e<<2)|0;s=c[m>>2]|0;if(((((((!((s|0)<(h|0)|(s|0)>(f|0))?(p=d+131084+(e<<4)|0,(c[p>>2]|0)!=1):0)?(c[d+131084+(e<<4)+4>>2]|0)!=(o|0):0)?(c[d+131084+(e<<4)+8>>2]|0)!=1:0)?(c[d+131084+(e<<4)+12>>2]|0)!=(b|0):0)?(Nc(c[d>>2]|0,a,0,l,e+1|0,p,j+((c[k>>2]|0)*80048|0)|0)|0)>=0:0)?(Oc(c[m>>2]|0,j+((c[k>>2]|0)*80048|0)|0,i)|0)>=0:0)?(c[j+((c[k>>2]|0)*80048|0)>>2]=c[m>>2],s=c[k>>2]|0,g[j+(s*80048|0)+8>>3]=+g[d+655376+(e<<4)>>3],g[j+(s*80048|0)+16>>3]=+g[d+655376+(e<<4)+8>>3],s=s+1|0,c[k>>2]=s,(s|0)==60):0){e=60;break}e=e+1|0}if((q|0)==5)e=c[k>>2]|0;a=0;while(1){if((a|0)>=(e|0))break;l=a+1|0;m=j+(a*80048|0)+8|0;n=j+(a*80048|0)+16|0;h=j+(a*80048|0)|0;f=l;while(1){if((f|0)>=(e|0))break;t=+g[m>>3]-+g[j+(f*80048|0)+8>>3];i=+g[n>>3]-+g[j+(f*80048|0)+16>>3];i=t*t+i*i;e=c[h>>2]|0;a=j+(f*80048|0)|0;b=c[a>>2]|0;if((e|0)>(b|0)){if(i<+((e|0)/4|0|0))c[a>>2]=0}else if(i<+((b|0)/4|0|0))c[h>>2]=0;f=f+1|0;e=c[k>>2]|0}a=l}f=0;while(1){if((f|0)>=(e|0))break;if(!(c[j+(f*80048|0)>>2]|0)){b=f;while(1){a=b+1|0;if((a|0)>=(e|0))break;YO(j+(b*80048|0)|0,j+(a*80048|0)|0,80048)|0;b=a;e=c[k>>2]|0}e=e+-1|0;c[k>>2]=e}f=f+1|0}a:do if(r){b=0;while(1){if((b|0)>=(e|0))break a;c[j>>2]=c[j>>2]<<2;a=j+8|0;g[a>>3]=+g[a>>3]*2.0;a=j+16|0;g[a>>3]=+g[a>>3]*2.0;a=c[j+24>>2]|0;e=0;while(1){if((e|0)>=(a|0))break;s=j+28+(e<<2)|0;c[s>>2]=c[s>>2]<<1;s=j+40028+(e<<2)|0;c[s>>2]=c[s>>2]<<1;e=e+1|0}j=j+80048|0;b=b+1|0;e=c[k>>2]|0}}while(0);return 0}function Nc(a,d,e,f,g,h,i){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;w=yb;yb=yb+80032|0;n=w+80016|0;m=w+80008|0;j=w+8e4|0;u=w+4e4|0;v=w;s=c[h+8>>2]|0;t=B(s,d)|0;e=c[h>>2]|0;h=c[h+4>>2]|0;r=e;e=a+(t+e<<1)|0;while(1){if((r|0)>(h|0)){t=7;break}t=b[e>>1]|0;if(t<<16>>16>0?(c[f+((t<<16>>16)+-1<<2)>>2]|0)==(g|0):0){t=6;break}r=r+1|0;e=e+2|0}do if((t|0)==6)if((r|0)!=-1){o=i+24|0;c[o>>2]=1;p=i+28|0;c[p>>2]=r;q=i+40028|0;c[q>>2]=s;g=5;e=s;l=r;f=1;while(1){k=a+((B(e,d)|0)+l<<1)|0;j=0;e=g+5|0;while(1){g=(e|0)%8|0;if(j>>>0>=8){t=13;break}e=c[48+(g<<2)>>2]|0;x=B(e,d)|0;h=c[80+(g<<2)>>2]|0;if((b[k+(x+h<<1)>>1]|0)>0)break;j=j+1|0;e=g+1|0}if((t|0)==13){t=0;if((j|0)==8){t=15;break}h=c[80+(g<<2)>>2]|0;e=c[48+(g<<2)>>2]|0}c[i+28+(f<<2)>>2]=h+l;j=c[o>>2]|0;c[i+40028+(j<<2)>>2]=e+(c[i+40028+(j+-1<<2)>>2]|0);j=c[o>>2]|0;h=i+28+(j<<2)|0;if((c[h>>2]|0)==(r|0)?(c[i+40028+(j<<2)>>2]|0)==(s|0):0){t=18;break}f=j+1|0;c[o>>2]=f;if((f|0)==9999){t=21;break}e=c[i+40028+(j<<2)>>2]|0;l=c[h>>2]|0}if((t|0)==15){Se(0,3,20152,m);e=-1;break}else if((t|0)==18){f=0;e=0;h=1;while(1){if((h|0)>=(j|0))break;x=(c[i+28+(h<<2)>>2]|0)-r|0;x=B(x,x)|0;d=(c[i+40028+(h<<2)>>2]|0)-s|0;x=(B(d,d)|0)+x|0;d=(x|0)>(e|0);f=d?h:f;e=d?x:e;h=h+1|0}e=0;while(1){if((e|0)>=(f|0))break;c[u+(e<<2)>>2]=c[i+28+(e<<2)>>2];c[v+(e<<2)>>2]=c[i+40028+(e<<2)>>2];e=e+1|0}h=f;e=j;while(1){if((h|0)>=(e|0))break;e=h-f|0;c[i+28+(e<<2)>>2]=c[i+28+(h<<2)>>2];c[i+40028+(e<<2)>>2]=c[i+40028+(h<<2)>>2];h=h+1|0;e=c[o>>2]|0}e=0;while(1){if((e|0)>=(f|0))break;x=e-f|0;c[i+28+((c[o>>2]|0)+x<<2)>>2]=c[u+(e<<2)>>2];c[i+40028+((c[o>>2]|0)+x<<2)>>2]=c[v+(e<<2)>>2];e=e+1|0}c[i+28+(c[o>>2]<<2)>>2]=c[p>>2];c[i+40028+(c[o>>2]<<2)>>2]=c[q>>2];c[o>>2]=(c[o>>2]|0)+1;e=0;break}else if((t|0)==21){Se(0,3,20159,n);e=-1;break}}else t=7;while(0);if((t|0)==7){Se(0,3,20145,j);e=-1}yb=w;return e|0}function Oc(a,b,d){a=a|0;b=b|0;d=+d;var 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;r=yb;yb=yb+96|0;o=r+48|0;k=r+92|0;p=r;l=r+88|0;m=b+28|0;j=c[m>>2]|0;n=b+40028|0;h=c[n>>2]|0;q=b+24|0;i=(c[q>>2]|0)+-1|0;f=1;g=0;e=0;while(1){if((f|0)>=(i|0))break;t=(c[b+28+(f<<2)>>2]|0)-j|0;t=B(t,t)|0;u=(c[b+40028+(f<<2)>>2]|0)-h|0;t=(B(u,u)|0)+t|0;u=(t|0)>(g|0);s=u?f:e;f=f+1|0;g=u?t:g;e=s}d=+(a|0)/.75*.01*d;c[k>>2]=0;c[l>>2]=0;a:do if((Pc(m,n,0,e,d,o,k)|0)>=0?(Pc(m,n,e,(c[q>>2]|0)+-1|0,d,p,l)|0)>=0:0){f=c[k>>2]|0;g=c[l>>2]|0;do if((f|0)==1&(g|0)==1){f=c[p>>2]|0;g=c[o>>2]|0}else{if((f|0)>1&(g|0)==0){f=(e|0)/2|0;c[l>>2]=0;c[k>>2]=0;if((Pc(m,n,0,f,d,o,k)|0)<0){e=-1;break a}if((Pc(m,n,f,e,d,p,l)|0)<0){e=-1;break a}if(!((c[k>>2]|0)==1&(c[l>>2]|0)==1)){e=-1;break a}f=e;g=c[o>>2]|0;e=c[p>>2]|0;break}if(!((f|0)==0&(g|0)>1)){e=-1;break a}f=(e+-1+(c[q>>2]|0)|0)/2|0;c[l>>2]=0;c[k>>2]=0;if((Pc(m,n,e,f,d,o,k)|0)<0){e=-1;break a}if((Pc(m,n,f,(c[q>>2]|0)+-1|0,d,p,l)|0)<0){e=-1;break a}if(!((c[k>>2]|0)==1&(c[l>>2]|0)==1)){e=-1;break a}f=c[p>>2]|0;g=e;e=c[o>>2]|0}while(0);c[b+80028>>2]=0;c[b+80032>>2]=g;c[b+80036>>2]=e;c[b+80040>>2]=f;c[b+80044>>2]=(c[q>>2]|0)+-1;e=0}else e=-1;while(0);yb=r;return e|0}function Pc(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;g=g|0;h=h|0;var i=0,j=0,k=0.0,l=0.0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0.0;j=c[b+(e<<2)>>2]|0;q=c[b+(d<<2)>>2]|0;l=+(j-q|0);i=c[a+(d<<2)>>2]|0;r=c[a+(e<<2)>>2]|0;m=+(i-r|0);n=+((B(r,q)|0)-(B(i,j)|0)|0);j=d+1|0;i=j;k=0.0;while(1){if((j|0)>=(e|0))break;s=l*+(c[a+(j<<2)>>2]|0)+m*+(c[b+(j<<2)>>2]|0)+n;s=s*s;r=s>k;i=r?j:i;j=j+1|0;k=r?s:k}if(k/(l*l+m*m)>f)if(((Pc(a,b,d,i,f,g,h)|0)>=0?(o=c[h>>2]|0,(o|0)<=5):0)?(c[g+(o<<2)>>2]=i,c[h>>2]=(c[h>>2]|0)+1,(Pc(a,b,i,e,f,g,h)|0)>=0):0)p=8;else i=-1;else p=8;if((p|0)==8)i=0;return i|0}function Qc(a,b,d,e,h,i,j){a=a|0;b=b|0;d=d|0;e=e|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0.0,n=0,o=0.0,p=0.0,q=0,r=0,s=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;y=yb;yb=yb+16|0;r=y+4|0;s=y;x=oe(2)|0;u=oe(2)|0;v=Bd(2,2)|0;k=0;a:while(1){if(k>>>0>=4){q=10;break}l=k+1|0;q=c[e+(l<<2)>>2]|0;n=c[e+(k<<2)>>2]|0;p=+(q+1-n|0)*.05+.5;n=~~(p+ +(n|0));q=~~(+(q|0)-p)-n|0;w=Bd(q+1|0,2)|0;d=0;while(1){if((d|0)>(q|0))break;z=d+n|0;if((ne(h,+(c[a+(z<<2)>>2]|0),+(c[b+(z<<2)>>2]|0),r,s)|0)<0){q=6;break a}A=c[w>>2]|0;z=d<<1;g[A+(z<<3)>>3]=+f[r>>2];g[A+((z|1)<<3)>>3]=+f[s>>2];d=d+1|0}if((Nd(w,v,x,u)|0)<0){q=14;break}A=c[v>>2]|0;o=+g[A+8>>3];g[i+(k*24|0)>>3]=o;p=-+g[A>>3];g[i+(k*24|0)+8>>3]=p;A=c[u>>2]|0;g[i+(k*24|0)+16>>3]=-(o*+g[A>>3]+ +g[A+8>>3]*p);Jd(w)|0;k=l}b:do if((q|0)==6)q=14;else if((q|0)==10){Jd(v)|0;pe(u)|0;pe(x)|0;d=0;while(1){if(d>>>0>=4){d=0;break b}k=d+3&3;l=i+(k*24|0)|0;m=+g[i+(d*24|0)+8>>3];n=i+(d*24|0)|0;o=+g[i+(k*24|0)+8>>3];p=+g[l>>3]*m-+g[n>>3]*o;if(+t(+p)<.0001){d=-1;break b}A=i+(d*24|0)+16|0;z=i+(k*24|0)+16|0;g[j+(d<<4)>>3]=(o*+g[A>>3]-m*+g[z>>3])/p;g[j+(d<<4)+8>>3]=(+g[n>>3]*+g[z>>3]-+g[l>>3]*+g[A>>3])/p;d=d+1|0}}while(0);if((q|0)==14){Jd(w)|0;Jd(v)|0;pe(u)|0;pe(x)|0;d=-1}yb=y;return d|0}function Rc(a,b,d,e,h,i,j,k,l,m,n,o,p,q){a=a|0;b=b|0;d=d|0;e=e|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;n=+n;o=o|0;p=p|0;q=q|0;var 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;G=yb;yb=yb+16|0;A=G+4|0;B=G;C=l>>>0<2;D=(l|0)==2;z=0;r=0;while(1){if((z|0)>=(i|0))break;c[o+(r<<8)>>2]=c[h+(z*80048|0)>>2];if((ne(m,+g[h+(z*80048|0)+8>>3],+g[h+(z*80048|0)+16>>3],A,B)|0)>=0?(g[o+(r<<8)+56>>3]=+f[A>>2],g[o+(r<<8)+64>>3]=+f[B>>2],E=o+(r<<8)+168|0,(Qc(h+(z*80048|0)+28|0,h+(z*80048|0)+40028|0,c[h+(z*80048|0)+24>>2]|0,h+(z*80048|0)+80028|0,m,o+(r<<8)+72|0,E)|0)>=0):0){v=o+(r<<8)+8|0;s=o+(r<<8)+20|0;t=o+(r<<8)+40|0;w=o+(r<<8)+12|0;y=o+(r<<8)+24|0;x=o+(r<<8)+48|0;u=md(j,k,l,a,b,d,e,m,E,n,v,s,t,w,y,x,q,o+(r<<8)+240|0,o+(r<<8)+248|0)|0;switch(u|0){case 0:{F=12;break}case -1:{u=2;F=12;break}case -2:{u=3;F=12;break}case -3:{u=4;F=12;break}case -4:{u=5;F=12;break}case -5:{u=9;F=12;break}case -6:{u=1;F=12;break}default:{}}if((F|0)==12){F=0;c[o+(r<<8)+236>>2]=u}if(!C){if(D){c[o+(r<<8)+4>>2]=c[w>>2];t=x;s=y;F=17}}else{c[o+(r<<8)+4>>2]=c[v>>2];F=17}if((F|0)==17){F=0;c[o+(r<<8)+16>>2]=c[s>>2];g[o+(r<<8)+32>>3]=+g[t>>3]}r=r+1|0}z=z+1|0}c[p>>2]=r;yb=G;return 0}function Sc(a,b,d,e){a=a|0;b=b|0;d=+d;e=e|0;var f=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0.0,o=0;m=yb;yb=yb+288|0;h=m+192|0;i=m+96|0;j=m+264|0;k=m;l=m+256|0;do if((c[b+12>>2]|0)>=0)if((c[b+8>>2]|0)<0){f=b+24|0;break}else{f=b+16|0;break}else f=b+20|0;while(0);f=c[f>>2]|0;o=(4-f|0)%4|0;g[h>>3]=+g[b+168+(o<<4)>>3];g[h+8>>3]=+g[b+168+(o<<4)+8>>3];o=(5-f|0)%4|0;g[h+16>>3]=+g[b+168+(o<<4)>>3];g[h+24>>3]=+g[b+168+(o<<4)+8>>3];o=(6-f|0)%4|0;g[h+32>>3]=+g[b+168+(o<<4)>>3];g[h+40>>3]=+g[b+168+(o<<4)+8>>3];f=(7-f|0)%4|0;g[h+48>>3]=+g[b+168+(f<<4)>>3];g[h+56>>3]=+g[b+168+(f<<4)+8>>3];n=d*-.5;g[i>>3]=n;d=d*.5;g[i+8>>3]=d;g[i+16>>3]=0.0;g[i+24>>3]=d;g[i+32>>3]=d;g[i+40>>3]=0.0;g[i+48>>3]=d;g[i+56>>3]=n;g[i+64>>3]=0.0;g[i+72>>3]=n;g[i+80>>3]=n;g[i+88>>3]=0.0;c[j>>2]=h;c[j+4>>2]=i;c[j+8>>2]=4;if((Ke(c[a>>2]|0,h,i,4,k)|0)<0)d=1.0e8;else{o=(Fe(c[a>>2]|0,j,k,e,l)|0)<0;d=o?1.0e8:+g[l>>3]}yb=m;return +d}function Tc(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=+e;f=f|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0.0,o=0;m=yb;yb=yb+192|0;i=m+96|0;j=m;k=m+168|0;l=m+160|0;do if((c[b+12>>2]|0)>=0)if((c[b+8>>2]|0)<0){h=b+24|0;break}else{h=b+16|0;break}else h=b+20|0;while(0);h=c[h>>2]|0;o=(4-h|0)%4|0;g[i>>3]=+g[b+168+(o<<4)>>3];g[i+8>>3]=+g[b+168+(o<<4)+8>>3];o=(5-h|0)%4|0;g[i+16>>3]=+g[b+168+(o<<4)>>3];g[i+24>>3]=+g[b+168+(o<<4)+8>>3];o=(6-h|0)%4|0;g[i+32>>3]=+g[b+168+(o<<4)>>3];g[i+40>>3]=+g[b+168+(o<<4)+8>>3];h=(7-h|0)%4|0;g[i+48>>3]=+g[b+168+(h<<4)>>3];g[i+56>>3]=+g[b+168+(h<<4)+8>>3];n=e*-.5;g[j>>3]=n;e=e*.5;g[j+8>>3]=e;g[j+16>>3]=0.0;g[j+24>>3]=e;g[j+32>>3]=e;g[j+40>>3]=0.0;g[j+48>>3]=e;g[j+56>>3]=n;g[j+64>>3]=0.0;g[j+72>>3]=n;g[j+80>>3]=n;g[j+88>>3]=0.0;c[k>>2]=i;c[k+4>>2]=j;c[k+8>>2]=4;k=(Fe(c[a>>2]|0,k,d,f,l)|0)<0;yb=m;return +(k?1.0e8:+g[l>>3])}function Uc(a,b,d,e,f,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=yb;yb=yb+32|0;l=o+20|0;m=o;n=DO(f<<4)|0;c[l>>2]=n;if(!n){Se(0,3,41858,o+8|0);Ea(1)}j=DO(f*24|0)|0;k=l+4|0;c[k>>2]=j;if(!j){Se(0,3,41858,o+16|0);Ea(1)}i=0;while(1){if((i|0)>=(f|0))break;g[n+(i<<4)>>3]=+g[d+(i<<4)>>3];g[n+(i<<4)+8>>3]=+g[d+(i<<4)+8>>3];g[j+(i*24|0)>>3]=+g[e+(i*24|0)>>3];g[j+(i*24|0)+8>>3]=+g[e+(i*24|0)+8>>3];g[j+(i*24|0)+16>>3]=+g[e+(i*24|0)+16>>3];i=i+1|0}c[l+8>>2]=f;if((Fe(c[a>>2]|0,l,b,h,m)|0)<0)g[m>>3]=1.0e8;EO(c[l>>2]|0);EO(c[k>>2]|0);yb=o;return +(+g[m>>3])}function Vc(a,b,d,e,f,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=yb;yb=yb+32|0;l=o+20|0;m=o;n=DO(f<<4)|0;c[l>>2]=n;if(!n){Se(0,3,41858,o+8|0);Ea(1)}j=DO(f*24|0)|0;k=l+4|0;c[k>>2]=j;if(!j){Se(0,3,41858,o+16|0);Ea(1)}i=0;while(1){if((i|0)>=(f|0))break;g[n+(i<<4)>>3]=+g[d+(i<<4)>>3];g[n+(i<<4)+8>>3]=+g[d+(i<<4)+8>>3];g[j+(i*24|0)>>3]=+g[e+(i*24|0)>>3];g[j+(i*24|0)+8>>3]=+g[e+(i*24|0)+8>>3];g[j+(i*24|0)+16>>3]=+g[e+(i*24|0)+16>>3];i=i+1|0}c[l+8>>2]=f;if((He(c[a>>2]|0,l,b,h,m)|0)<0)g[m>>3]=1.0e8;EO(c[l>>2]|0);EO(c[k>>2]|0);yb=o;return +(+g[m>>3])}function Wc(a,b){a=a|0;b=b|0;var d=0;d=DO(2064)|0;if(d|0){c[d>>2]=0;c[d+4>>2]=a;c[d+8>>2]=b}return d|0}function Xc(a){a=a|0;if(a|0){EO(c[a>>2]|0);EO(a)}return}function Yc(a,b){a=a|0;b=b|0;var e=0,f=0;a:do if((a|0)!=0&(b|0)!=0){_O(a+12|0,0,1024)|0;e=b+(B(c[a+8>>2]|0,c[a+4>>2]|0)|0)|0;while(1){if(b>>>0>=e>>>0){b=0;break a}f=a+12+((d[b>>0]|0)<<2)|0;c[f>>2]=(c[f>>2]|0)+1;b=b+1|0}}else b=-1;while(0);return b|0}function Zc(a,b){a=a|0;b=b|0;var d=0;b=Yc(a,b)|0;if((b|0)>=0){b=0;d=0;do{b=(c[a+12+(d<<2)>>2]|0)+b|0;c[a+1036+(d<<2)>>2]=b;d=d+1|0}while((d|0)!=256);b=0}return b|0}function _c(b,d,e,f){b=b|0;d=d|0;e=+e;f=f|0;var g=0,h=0,i=0,j=0;if(!(e<0.0|e>1.0)){d=Zc(b,d)|0;if((d|0)>=0){i=~~(+(B(c[b+8>>2]|0,c[b+4>>2]|0)|0)*e)>>>0;d=0;while(1){j=d&255;g=c[b+1036+(j<<2)>>2]|0;if(g>>>0>>0)d=d+1<<24>>24;else break}while(1){h=d+1<<24>>24;if((g|0)!=(i|0))break;d=h;g=c[b+1036+((h&255)<<2)>>2]|0}a[f>>0]=((d&255)+j|0)>>>1;d=0}}else d=-1;return d|0}function $c(a,b,c){a=a|0;b=b|0;c=c|0;return _c(a,b,.5,c)|0}function ad(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0,m=0.0,n=0,o=0.0;d=Yc(b,d)|0;if((d|0)>=0){m=0.0;d=1;do{m=m+ +((B(c[b+12+(d<<2)>>2]|0,d)|0)>>>0);d=d+1|0}while((d|0)!=256);k=+(B(c[b+8>>2]|0,c[b+4>>2]|0)|0);d=0;h=0.0;j=0.0;g=0.0;l=0;while(1){f=c[b+12+(l<<2)>>2]|0;j=j+ +(f>>>0);if(j!=0.0){i=k-j;if(i==0.0)break;g=g+ +((B(f,l)|0)>>>0);o=g/j-(m-g)/i;i=o*(j*i*o);n=i>h;f=l&255;d=n?f:d;h=n?i:h}else f=l&255;if(f<<24>>24==-1)break;else l=l+1|0}a[e>>0]=d;d=0}return d|0}function bd(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;h=Yc(b,e)|0;a:do if((h|0)>=0){if(!(c[b>>2]|0)){h=b+4|0;i=b+8|0;s=DO(B(c[i>>2]|0,c[h>>2]|0)|0)|0;c[b>>2]=s;if(!s){h=-1;break}else{s=h;r=i}}else{s=b+4|0;r=b+8|0}p=f>>1;q=0-p|0;o=0;while(1){h=c[r>>2]|0;if((o|0)>=(h|0))break;l=0;while(1){n=c[s>>2]|0;if((l|0)>=(n|0))break;m=q;f=0;h=0;while(1){if((m|0)>(p|0))break;i=m+o|0;b:do if((i|0)>=0?(i|0)<(c[r>>2]|0):0){k=B(i,n)|0;j=q;i=f;while(1){if((j|0)>(p|0))break b;f=j+l|0;if((f|0)>-1&(f|0)<(n|0)){i=i+1|0;h=h+(d[e+(f+k)>>0]|0)|0}j=j+1|0}}else i=f;while(0);m=m+1|0;f=i}a[(c[b>>2]|0)+((B(n,o)|0)+l)>>0]=(h|0)/(f|0)|0;l=l+1|0}o=o+1|0}if(!g)h=0;else{i=0;while(1){if((i|0)>=(B(h,c[s>>2]|0)|0)){h=0;break a}h=(c[b>>2]|0)+i|0;a[h>>0]=(d[h>>0]|0)+g;i=i+1|0;h=c[r>>2]|0}}}while(0);return h|0}function cd(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;var j=0;e=(e|0)==1;j=(i|0)!=0;do if(!d)if(e){if(j){e=dc(a,b,c,i,h)|0;break}if(!g){e=cc(a,b,c,f,h)|0;break}else{e=bc(a,b,c,f,h)|0;break}}else{if(j){e=gc(a,b,c,i,h)|0;break}if(!g){e=fc(a,b,c,f,h)|0;break}else{e=ec(a,b,c,f,h)|0;break}}else if(e){if(j){e=jc(a,b,c,i,h)|0;break}if(!g){e=ic(a,b,c,f,h)|0;break}else{e=hc(a,b,c,f,h)|0;break}}else{if(j){e=mc(a,b,c,i,h)|0;break}if(!g){e=lc(a,b,c,f,h)|0;break}else{e=kc(a,b,c,f,h)|0;break}}while(0);return e|0}function dd(a,b){a=a|0;b=b|0;var d=0;if((a|0)!=0?(d=a+7062384|0,(c[d>>2]|0)==0):0){c[d>>2]=b;a=0}else a=-1;return a|0}function ed(a){a=a|0;var b=0;if((a|0)!=0?(b=a+7062384|0,(c[b>>2]|0)!=0):0){c[b>>2]=0;a=0}else a=-1;return a|0}function fd(){return gd(16,50)|0}function gd(a,b){a=a|0;b=b|0;var 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;q=yb;yb=yb+64|0;p=q+56|0;o=q+48|0;i=q+40|0;h=q+32|0;g=q+24|0;f=q+16|0;e=q+8|0;d=q;a:do if(!((a+-16|0)>>>0>48|(b|0)<1)){m=DO(32)|0;if(!m){Se(0,3,41858,d);Ea(1)}c[m>>2]=0;c[m+4>>2]=b;c[m+28>>2]=a;l=DO(b<<2)|0;c[m+8>>2]=l;if(!l){Se(0,3,41858,e);Ea(1)}d=b<<4;k=DO(d)|0;c[m+12>>2]=k;if(!k){Se(0,3,41858,f);Ea(1)}f=DO(d)|0;j=m+20|0;c[j>>2]=f;if(!f){Se(0,3,41858,g);Ea(1)}d=b<<5;g=DO(d)|0;c[m+16>>2]=g;if(!g){Se(0,3,41858,h);Ea(1)}h=DO(d)|0;c[m+24>>2]=h;if(!h){Se(0,3,41858,i);Ea(1)}g=B(a,a)|0;f=g*12|0;g=g<<2;e=0;b:while(1){if((e|0)>=(b|0)){n=m;break a}c[l+(e<<2)>>2]=0;a=e<<2;d=0;while(1){if(d>>>0>=4)break;i=DO(f)|0;h=d+a|0;c[k+(h<<2)>>2]=i;if(!i){d=19;break b}i=DO(g)|0;c[(c[j>>2]|0)+(h<<2)>>2]=i;if(!i){d=21;break b}else d=d+1|0}e=e+1|0}if((d|0)==19){Se(0,3,41858,o);Ea(1)}else if((d|0)==21){Se(0,3,41858,p);Ea(1)}}else n=0;while(0);yb=q;return n|0}function hd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;if(!a)b=-1;else{f=a+4|0;g=a+8|0;h=a+12|0;i=a+20|0;d=0;while(1){if((d|0)>=(c[f>>2]|0))break;if(c[(c[g>>2]|0)+(d<<2)>>2]|0)rd(a,d)|0;e=d<<2;b=0;while(1){if((b|0)==4)break;j=b+e|0;EO(c[(c[h>>2]|0)+(j<<2)>>2]|0);EO(c[(c[i>>2]|0)+(j<<2)>>2]|0);b=b+1|0}d=d+1|0}EO(c[h>>2]|0);EO(c[i>>2]|0);EO(c[g>>2]|0);EO(c[a+16>>2]|0);EO(c[a+24>>2]|0);EO(a);b=0}return b|0}function id(b,e,f,h,i,j,k){b=b|0;e=e|0;f=f|0;h=h|0;i=i|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;u=yb;yb=yb+32|0;p=u+24|0;o=u;t=u+16|0;a:do if((e+-3|0)>>>0>5){c[f>>2]=-1;c[h>>2]=0;g[i>>3]=-1.0;l=-1}else{c[o>>2]=0;s=e+-1|0;c[o+4>>2]=B(s,e)|0;q=B(e,e)|0;c[o+8>>2]=q+-1;c[o+12>>2]=s;l=0;m=0;n=-1;while(1){if((l|0)==4)break;r=a[b+(c[o+(l<<2)>>2]|0)>>0]|0;l=l+1|0;m=(r&255)>(m&255)?r:m;n=(r&255)<(n&255)?r:n}m=m&255;l=n&255;if((m-l|0)<30){c[f>>2]=-1;c[h>>2]=0;g[i>>3]=-1.0;l=-2;break}n=(m+l|0)>>>1;l=0;while(1){if((l|0)==4)break;a[p+l>>0]=n>>>0>(d[b+(c[o+(l<<2)>>2]|0)>>0]|0)>>>0&1;l=l+1|0}m=0;while(1){if(m>>>0>=4){l=18;break}l=m+1|0;if(((a[p+m>>0]|0)==1?(a[p+(l&3)>>0]|0)==1:0)?(a[p+(m+2&3)>>0]|0)==0:0){l=17;break}m=l}if((l|0)==17)c[h>>2]=m;else if((l|0)==18?(m|0)==4:0){c[f>>2]=-1;c[h>>2]=0;g[i>>3]=-1.0;l=-3;break}r=255;l=0;while(1){if((l|0)==(q|0))break;o=b+l|0;m=d[o>>0]|0;p=m-n|0;p=(p|0)<0?0-p|0:p;a[o>>0]=n>>>0>m>>>0&1;r=(p|0)<(r|0)?p:r;l=l+1|0}l=c[h>>2]|0;b:do switch(l|0){case 0:{n=l;m=0;l=0;while(1){if((n|0)>=(e|0))break b;p=(n|0)==(s|0);q=B(n,e)|0;o=0;while(1){if((o|0)==(e|0))break;if((o|n|0)!=0?!(p&((o|0)==0|(o|0)==(s|0))):0){m=SO(m|0,l|0,1)|0;l=F()|0;m=m|(a[b+(o+q)>>0]|0)!=0}o=o+1|0}n=n+1|0}}case 1:{o=0;m=0;l=0;while(1){if((o|0)>=(e|0))break b;p=(o|0)==0;q=(o|0)==(s|0);n=s;while(1){if((n|0)<=-1)break;h=(n|0)==(s|0);if(!(p&h)?!(q&(h|(n|0)==0)):0){m=SO(m|0,l|0,1)|0;l=F()|0;m=m|(a[b+((B(n,e)|0)+o)>>0]|0)!=0}n=n+-1|0}o=o+1|0}}case 2:{n=s;m=0;l=0;while(1){if((n|0)<=-1)break b;q=(n|0)==(s|0)|(n|0)==0;p=B(n,e)|0;o=s;while(1){if((o|0)<=-1)break;if(!(q&(o|0)==(s|0)|(o|n|0)==0)){m=SO(m|0,l|0,1)|0;l=F()|0;m=m|(a[b+(o+p)>>0]|0)!=0}o=o+-1|0}n=n+-1|0}}case 3:{o=s;m=0;l=0;while(1){if((o|0)<=-1)break b;p=(o|0)==(s|0);q=(o|0)==0;n=0;while(1){if((n|0)>=(e|0))break;if(!(p&(n|0)==0|(n|o|0)==0|q&(n|0)==(s|0))){m=SO(m|0,l|0,1)|0;l=F()|0;m=m|(a[b+((B(n,e)|0)+o)>>0]|0)!=0}n=n+1|0}o=o+-1|0}}default:{m=0;l=0}}while(0);g[i>>3]=(r|0)>30?1.0:+(r|0)/30.0;switch(j|0){case 259:{k=a[240+m>>0]|0;s=k<<24>>24;j=t;c[j>>2]=s;c[j+4>>2]=((s|0)<0)<<31>>31;if(k<<24>>24<0){c[f>>2]=-1;g[i>>3]=-1.0;l=-4;break a}break}case 515:{l=a[112+m>>0]|0;s=l<<24>>24;j=t;c[j>>2]=s;c[j+4>>2]=((s|0)<0)<<31>>31;if(k|0)c[k>>2]=d[176+m>>0];if(l<<24>>24<0){c[f>>2]=-1;g[i>>3]=-1.0;l=-4;break a}break}case 772:case 1028:case 1029:case 1285:{l=kd(j,m,l,0,t)|0;if((l|0)<0){c[f>>2]=-1;g[i>>3]=-1.0;l=-4;break a}if((k|0)!=0&(l|0)!=0)c[k>>2]=l;break}default:{k=t;c[k>>2]=m;c[k+4>>2]=l}}c[f>>2]=c[t>>2];l=0}while(0);yb=u;return l|0}function jd(b,d,e,f,h,i,j){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0.0,w=0,x=0,y=0,z=0,A=0.0;z=yb;yb=yb+16|0;l=z+8|0;k=z;a:do if((b|0)==0|(f|0)<1){c[h>>2]=0;c[i>>2]=0;g[j>>3]=-1.0;d=-1}else switch(d|0){case 0:{x=B(f,f)|0;w=x*3|0;x=DO(x*12|0)|0;if(!x){Se(0,3,41858,k);Ea(1)}d=0;k=0;while(1){if((d|0)==(w|0))break;t=k+(~a[e+d>>0]&255)|0;d=d+1|0;k=t}l=(k>>>0)/(w>>>0)|0;d=0;k=0;while(1){if((k|0)==(w|0))break;t=(~a[e+k>>0]&255)-l|0;c[x+(k<<2)>>2]=t;d=(B(t,t)|0)+d|0;k=k+1|0}v=+u(+(+(d|0)));if(v/(+(f|0)*1.7320508)<15.0){c[h>>2]=0;c[i>>2]=0;g[j>>3]=-1.0;EO(x);d=-2;break a}r=c[b>>2]|0;s=b+8|0;t=b+12|0;q=b+16|0;m=0.0;p=0;d=-1;e=-1;k=-1;while(1){if((p|0)>=(r|0))break;l=c[s>>2]|0;b:while(1){d=d+1|0;switch(c[l+(d<<2)>>2]|0){case 0:break;case 2:{l=e;break b}default:{y=18;break b}}}c:do if((y|0)==18){y=0;o=d<<2;n=0;l=e;while(1){if((n|0)==4)break c;b=n+o|0;e=0;f=0;while(1){if((f|0)==(w|0))break;e=(B(c[(c[(c[t>>2]|0)+(b<<2)>>2]|0)+(f<<2)>>2]|0,c[x+(f<<2)>>2]|0)|0)+e|0;f=f+1|0}A=+(e|0)/+g[(c[q>>2]|0)+(b<<3)>>3]/v;f=A>m;b=f?n:k;n=n+1|0;m=f?A:m;l=f?d:l;k=b}}while(0);p=p+1|0;e=l}c[i>>2]=k;c[h>>2]=e;g[j>>3]=m;EO(x);d=0;break a}case 1:{w=B(f,f)|0;x=DO(w<<2)|0;if(!x){Se(0,3,41858,l);Ea(1)}d=0;k=0;while(1){if((k|0)==(w|0))break;d=d+(~a[e+k>>0]&255)|0;k=k+1|0}l=(d>>>0)/(w>>>0)|0;d=0;k=0;while(1){if((k|0)==(w|0))break;t=(~a[e+k>>0]&255)-l|0;c[x+(k<<2)>>2]=t;d=(B(t,t)|0)+d|0;k=k+1|0}v=+u(+(+(d|0)));if(v/+(f|0)<15.0){c[h>>2]=0;c[i>>2]=0;g[j>>3]=-1.0;EO(x);d=-2;break a}r=c[b>>2]|0;s=b+8|0;t=b+20|0;q=b+24|0;p=0;d=-1;m=0.0;e=-1;k=-1;while(1){if((p|0)>=(r|0))break;l=c[s>>2]|0;d:while(1){d=d+1|0;switch(c[l+(d<<2)>>2]|0){case 0:break;case 2:{l=e;break d}default:{y=40;break d}}}e:do if((y|0)==40){y=0;o=d<<2;n=0;l=e;while(1){if((n|0)==4)break e;b=n+o|0;e=0;f=0;while(1){if((f|0)==(w|0))break;e=(B(c[(c[(c[t>>2]|0)+(b<<2)>>2]|0)+(f<<2)>>2]|0,c[x+(f<<2)>>2]|0)|0)+e|0;f=f+1|0}A=+(e|0)/+g[(c[q>>2]|0)+(b<<3)>>3]/v;f=A>m;b=f?n:k;n=n+1|0;m=f?A:m;l=f?d:l;k=b}}while(0);p=p+1|0;e=l}c[i>>2]=k;c[h>>2]=e;g[j>>3]=m;EO(x);d=0;break a}default:{d=-1;break a}}while(0);yb=z;return d|0}function kd(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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,C=0,D=0,E=0,G=0,H=0,I=0;I=yb;yb=yb+2384|0;l=I+2320|0;D=I+880|0;A=I+800|0;H=I+720|0;C=I+640|0;y=I+560|0;G=I+48|0;E=I;switch(b|0){case 2830:{l=g;u=1200;x=688;m=120;n=127;w=64;o=9;i=8;break}case 772:{j=624;k=432;m=13;n=15;b=9;o=1;i=5;break}case 1028:{j=624;k=432;m=13;n=15;b=5;o=2;i=5;break}case 1029:{b=12;g=2;i=4;break}case 1285:{b=7;g=3;i=4;break}default:b=-1}if((i|0)==4){j=496;k=304;m=22;n=31;o=g;i=5}a:do if((i|0)==5){i=0;g=f;while(1){if((i|0)==(m|0)){u=j;x=k;w=b;i=8;break a}a[l+i>>0]=e&1;x=RO(e|0,g|0,1)|0;i=i+1|0;e=x;g=F()|0}}while(0);b:do if((i|0)==8){t=o<<1;g=0;i=1;while(1){if((i|0)>(t|0))break;j=y+(i<<2)|0;c[j>>2]=0;e=0;b=0;while(1){if((e|0)>=(m|0))break;if(a[l+e>>0]|0){b=b^c[x+(((B(e,i)|0)%(n|0)|0)<<2)>>2];c[j>>2]=b}e=e+1|0}c[j>>2]=c[u+(b<<2)>>2];g=(b|0)==0?g:1;i=i+1|0}v=(g|0)!=0;c:do if(v){c[A>>2]=0;g=c[y+4>>2]|0;c[A+4>>2]=g;c[D>>2]=0;c[D+72>>2]=1;b=1;while(1){if((b|0)>=(t|0))break;c[D+(b<<2)>>2]=-1;c[D+72+(b<<2)>>2]=0;b=b+1|0}c[H>>2]=0;c[H+4>>2]=0;c[C>>2]=-1;c[C+4>>2]=0;s=0;r=0;while(1){f=s;s=s+1|0;d:do if((g|0)==-1){f=f+2|0;c[H+(f<<2)>>2]=r;b=0;while(1){if((b|0)>(r|0)){q=r;break d}q=D+(s*72|0)+(b<<2)|0;p=c[q>>2]|0;c[D+(f*72|0)+(b<<2)>>2]=p;c[q>>2]=c[u+(p<<2)>>2];b=b+1|0}}else{e=f;while(1){b=(e|0)>0;if(b&(c[A+(e<<2)>>2]|0)==-1)e=e+-1|0;else break}if(b){b=e;i=e;while(1){j=i;i=i+-1|0;if((c[A+(i<<2)>>2]|0)==-1)e=b;else e=(c[C+(b<<2)>>2]|0)<(c[C+(i<<2)>>2]|0)?i:b;if((j|0)<=1)break;else b=e}}i=H+(e<<2)|0;p=s-e|0;q=p+(c[i>>2]|0)|0;f=f+2|0;q=(r|0)>(q|0)?r:q;c[H+(f<<2)>>2]=q;b=0;while(1){if((b|0)>=(t|0))break;c[D+(f*72|0)+(b<<2)>>2]=0;b=b+1|0}j=g+n|0;k=A+(e<<2)|0;g=c[i>>2]|0;b=0;while(1){if((b|0)>(g|0))break;i=c[D+(e*72|0)+(b<<2)>>2]|0;if((i|0)!=-1)c[D+(f*72|0)+(p+b<<2)>>2]=c[x+(((j+i-(c[k>>2]|0)|0)%(n|0)|0)<<2)>>2];b=b+1|0}b=0;while(1){if((b|0)>(r|0))break d;p=D+(s*72|0)+(b<<2)|0;k=c[p>>2]|0;j=D+(f*72|0)+(b<<2)|0;c[j>>2]=c[j>>2]^k;c[p>>2]=c[u+(k<<2)>>2];b=b+1|0}}while(0);c[C+(f<<2)>>2]=s-q;if((s|0)>=(t|0))break;b=c[y+(f<<2)>>2]|0;if((b|0)==-1)b=0;else b=c[x+(b<<2)>>2]|0;i=A+(f<<2)|0;c[i>>2]=b;e=1;while(1){if((e|0)>(q|0))break;g=c[y+(f-e<<2)>>2]|0;if((g|0)!=-1?(z=c[D+(f*72|0)+(e<<2)>>2]|0,(z|0)!=0):0){b=b^c[x+((((c[u+(z<<2)>>2]|0)+g|0)%(n|0)|0)<<2)>>2];c[i>>2]=b}e=e+1|0}g=c[u+(b<<2)>>2]|0;c[i>>2]=g;if((q|0)>(o|0))break;else r=q}if((q|0)>(o|0)){b=-1;break b}b=0;while(1){if((b|0)>(q|0))break;C=D+(f*72|0)+(b<<2)|0;c[C>>2]=c[u+(c[C>>2]<<2)>>2];b=b+1|0}b=1;while(1){if((b|0)>(q|0))break;c[E+(b<<2)>>2]=c[D+(f*72|0)+(b<<2)>>2];b=b+1|0}b=0;k=1;while(1){if((n|0)<(k|0))break;j=1;g=1;while(1){if((j|0)>(q|0))break;e=E+(j<<2)|0;i=c[e>>2]|0;if((i|0)!=-1){D=(i+j|0)%(n|0)|0;c[e>>2]=D;g=c[x+(D<<2)>>2]^g}j=j+1|0}if(!g){c[G+(b<<2)>>2]=n-k;b=b+1|0}k=k+1|0}if((b|0)!=(q|0)){b=-1;break b}b=0;while(1){if((b|0)>=(q|0))break c;E=l+(c[G+(b<<2)>>2]|0)|0;a[E>>0]=a[E>>0]^1;b=b+1|0}}else f=0;while(0);b=h;c[b>>2]=0;c[b+4>>2]=0;b=m-w|0;g=1;e=0;i=0;j=0;while(1){if((b|0)>=(m|0))break;E=LO(g|0,e|0,d[l+b>>0]|0,0)|0;E=MO(E|0,F()|0,i|0,j|0)|0;G=F()|0;D=h;c[D>>2]=E;c[D+4>>2]=G;D=SO(g|0,e|0,1)|0;b=b+1|0;g=D;e=F()|0;i=E;j=G}if(v)b=c[H+(f<<2)>>2]|0;else b=0}while(0);yb=I;return b|0}function ld(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;f=Bd(8,8)|0;h=Bd(8,1)|0;i=Bd(8,1)|0;e=0;while(1){if((e|0)==4)break;o=a+(e<<4)|0;j=c[f>>2]|0;k=e<<4;g[j+(k<<3)>>3]=+g[o>>3];n=a+(e<<4)+8|0;g[j+((k|1)<<3)>>3]=+g[n>>3];g[j+((k|2)<<3)>>3]=1.0;g[j+((k|3)<<3)>>3]=0.0;g[j+((k|4)<<3)>>3]=0.0;g[j+((k|5)<<3)>>3]=0.0;m=b+(e<<4)|0;g[j+((k|6)<<3)>>3]=-(+g[o>>3]*+g[m>>3]);g[j+((k|7)<<3)>>3]=-(+g[n>>3]*+g[m>>3]);g[j+((k|8)<<3)>>3]=0.0;g[j+((k|9)<<3)>>3]=0.0;g[j+((k|10)<<3)>>3]=0.0;g[j+((k|11)<<3)>>3]=+g[o>>3];g[j+((k|12)<<3)>>3]=+g[n>>3];g[j+((k|13)<<3)>>3]=1.0;l=b+(e<<4)+8|0;g[j+((k|14)<<3)>>3]=-(+g[o>>3]*+g[l>>3]);g[j+((k|15)<<3)>>3]=-(+g[n>>3]*+g[l>>3]);k=c[h>>2]|0;j=e<<1;g[k+(j<<3)>>3]=+g[m>>3];g[k+((j|1)<<3)>>3]=+g[l>>3];e=e+1|0}Vd(f)|0;Ld(i,f,h)|0;a=c[i>>2]|0;e=0;while(1){if((e|0)==2)break;o=e*3|0;g[d+(e*24|0)>>3]=+g[a+(o<<3)>>3];g[d+(e*24|0)+8>>3]=+g[a+(o+1<<3)>>3];g[d+(e*24|0)+16>>3]=+g[a+(o+2<<3)>>3];e=e+1|0}g[d+48>>3]=+g[a+48>>3];g[d+56>>3]=+g[a+56>>3];g[d+64>>3]=1.0;Jd(f)|0;Jd(h)|0;Jd(i)|0;return}function md(a,b,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=+k;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;r=r|0;s=s|0;t=t|0;var u=0,v=0,w=0;w=yb;yb=yb+12304|0;v=w;u=w+12288|0;do if((d+-2|0)>>>0<3){if((r|0)!=2830){u=r&255;if((nd(b,2,u,u*3|0,e,f,g,h,i,j,k,v)|0)<0){c[o>>2]=-1;r=-6;break}u=id(v,u,o,p,q,r,s)|0;if(!t){r=u;break}r=t;c[r>>2]=0;c[r+4>>2]=0;r=u;break}if((nd(b,2,14,42,e,f,g,h,i,j,.875,v)|0)<0){c[o>>2]=-1;r=-6;break}r=od(v,u,p,q,s)|0;if((r|0)<0){c[o>>2]=-1;break}p=u;u=c[p>>2]|0;p=c[p+4>>2]|0;if((u|0)==-1&(p|0)==-1){c[o>>2]=-1;r=-5;break}c[o>>2]=(u&-32768|0)==0&0==0?u&32767:0;if(t){c[t>>2]=u;c[t+4>>2]=p}}else r=1;while(0);a:do switch(d|0){case 0:case 1:case 3:case 4:{if(!a){c[l>>2]=-1;u=-1;break a}u=a+28|0;p=c[u>>2]|0;q=p<<2;switch(d|0){case 0:case 3:if((nd(b,0,p,q,e,f,g,h,i,j,k,v)|0)<0){c[l>>2]=-1;u=-6;break a}else{u=jd(a,0,v,c[u>>2]|0,l,m,n)|0;break a}default:if((nd(b,1,p,q,e,f,g,h,i,j,k,v)|0)<0){c[l>>2]=-1;u=-6;break a}else{u=jd(a,1,v,c[u>>2]|0,l,m,n)|0;break a}}}default:u=1}while(0);if((r|0)!=1)u=(u|0)==1?r:(u&r|0)<0?u:0;yb=w;return u|0}function nd(b,e,h,i,j,k,l,m,n,o,p,q){b=b|0;e=e|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=+p;q=q|0;var r=0,s=0,t=0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0.0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0.0,T=0.0,U=0.0,V=0.0,W=0,X=0;R=yb;yb=yb+256|0;A=R+232|0;z=R+224|0;D=R+216|0;C=R+208|0;s=R+144|0;t=R+80|0;N=R;O=R+240|0;P=R+236|0;g[s>>3]=100.0;g[s+8>>3]=100.0;g[s+16>>3]=110.0;g[s+24>>3]=100.0;g[s+32>>3]=110.0;g[s+40>>3]=110.0;g[s+48>>3]=100.0;g[s+56>>3]=110.0;r=0;while(1){if((r|0)==4)break;g[t+(r<<4)>>3]=+g[o+(r<<4)>>3];g[t+(r<<4)+8>>3]=+g[o+(r<<4)+8>>3];r=r+1|0}ld(s,t,N);y=+g[t>>3];T=+g[t+16>>3];w=y-T;I=+g[t+8>>3];S=+g[t+24>>3];u=I-S;r=~~(w*w+u*u);u=+g[t+32>>3];w=+g[t+48>>3];V=u-w;v=+g[t+40>>3];x=+g[t+56>>3];U=v-x;L=~~(V*V+U*U);u=T-u;v=S-v;t=~~(u*u+v*v);y=w-y;I=x-I;M=~~(y*y+I*I);r=~~(+(((L|0)>(r|0)?L:r)|0)*p*p);t=~~(+(((M|0)>(t|0)?M:t)|0)*p*p);if(!b){s=h;while(1)if((s|0)<(i|0)&(B(s,s)|0)<(r|0))s=s<<1;else break;r=h;while(1)if((r|0)<(i|0)&(B(r,r)|0)<(t|0))r=r<<1;else break}else{s=h;while(1)if((s|0)<(i|0)&(B(s<<2,s)|0)<(r|0))s=s<<1;else break;r=h;while(1)if((r|0)<(i|0)&(B(r<<2,r)|0)<(t|0))r=r<<1;else break}M=(s|0)>(i|0)?i:s;J=(r|0)>(i|0)?i:r;K=(M|0)/(h|0)|0;L=(J|0)/(h|0)|0;u=(1.0-p)*.5*10.0;I=p*10.0;H=B(h,h)|0;a:do if(!e){H=H*3|0;r=FO(H,4)|0;if(!r){Se(0,3,41858,C);Ea(1)}b:do switch(m|0){case 0:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break b;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){t=((B(t,k)|0)+s|0)*3|0;b=((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)|0)*3|0;s=r+(b<<2)|0;c[s>>2]=(c[s>>2]|0)+(d[j+(t+2)>>0]|0);s=r+(b+1<<2)|0;c[s>>2]=(c[s>>2]|0)+(d[j+(t+1)>>0]|0);b=r+(b+2<<2)|0;c[b>>2]=(c[b>>2]|0)+(d[j+t>>0]|0)}i=i+1|0}o=o+1|0}}case 1:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break b;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){t=((B(t,k)|0)+s|0)*3|0;b=((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)|0)*3|0;s=r+(b<<2)|0;c[s>>2]=(c[s>>2]|0)+(d[j+t>>0]|0);s=r+(b+1<<2)|0;c[s>>2]=(c[s>>2]|0)+(d[j+(t+1)>>0]|0);b=r+(b+2<<2)|0;c[b>>2]=(c[b>>2]|0)+(d[j+(t+2)>>0]|0)}i=i+1|0}o=o+1|0}}case 2:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break b;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){t=(B(t,k)|0)+s<<2;b=((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)|0)*3|0;s=r+(b<<2)|0;c[s>>2]=(c[s>>2]|0)+(d[j+(t|2)>>0]|0);s=r+(b+1<<2)|0;c[s>>2]=(c[s>>2]|0)+(d[j+(t|1)>>0]|0);b=r+(b+2<<2)|0;c[b>>2]=(c[b>>2]|0)+(d[j+t>>0]|0)}i=i+1|0}o=o+1|0}}case 3:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break b;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){t=(B(t,k)|0)+s<<2;b=((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)|0)*3|0;s=r+(b<<2)|0;c[s>>2]=(c[s>>2]|0)+(d[j+t>>0]|0);s=r+(b+1<<2)|0;c[s>>2]=(c[s>>2]|0)+(d[j+(t|1)>>0]|0);b=r+(b+2<<2)|0;c[b>>2]=(c[b>>2]|0)+(d[j+(t|2)>>0]|0)}i=i+1|0}o=o+1|0}}case 4:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break b;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){t=(B(t,k)|0)+s<<2;b=((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)|0)*3|0;s=r+(b<<2)|0;c[s>>2]=(c[s>>2]|0)+(d[j+(t|1)>>0]|0);s=r+(b+1<<2)|0;c[s>>2]=(c[s>>2]|0)+(d[j+(t|2)>>0]|0);b=r+(b+2<<2)|0;c[b>>2]=(c[b>>2]|0)+(d[j+(t|3)>>0]|0)}i=i+1|0}o=o+1|0}}case 5:case 12:case 13:case 14:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break b;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){t=d[j+((B(t,k)|0)+s)>>0]|0;b=((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)|0)*3|0;s=r+(b<<2)|0;c[s>>2]=(c[s>>2]|0)+t;s=r+(b+1<<2)|0;c[s>>2]=(c[s>>2]|0)+t;b=r+(b+2<<2)|0;c[b>>2]=(c[b>>2]|0)+t}i=i+1|0}o=o+1|0}}case 6:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break b;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){t=(B(t,k)|0)+s<<2;b=((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)|0)*3|0;s=r+(b<<2)|0;c[s>>2]=(c[s>>2]|0)+(d[j+(t|3)>>0]|0);s=r+(b+1<<2)|0;c[s>>2]=(c[s>>2]|0)+(d[j+(t|2)>>0]|0);b=r+(b+2<<2)|0;c[b>>2]=(c[b>>2]|0)+(d[j+(t|1)>>0]|0)}i=i+1|0}o=o+1|0}}case 7:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break b;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){X=B(t,k)|0;W=(s&65534)+X<<1;T=+((d[j+W>>0]|0)+-128|0);V=+((d[j+(W+2)>>0]|0)+-128|0);U=+((d[j+(X+s<<1|1)>>0]|0)+-16|0)*298.0820007324219;X=~~(T*516.4110107421875+U)>>8;W=~~(U-T*100.29100036621094-V*208.1199951171875)>>8;t=~~(U+V*408.5830078125)>>8;X=(X|0)>0?X:0;b=((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)|0)*3|0;s=r+(b<<2)|0;c[s>>2]=((X|0)<255?X:255)+(c[s>>2]|0);W=(W|0)>0?W:0;s=r+(b+1<<2)|0;c[s>>2]=((W|0)<255?W:255)+(c[s>>2]|0);t=(t|0)>0?t:0;b=r+(b+2<<2)|0;c[b>>2]=((t|0)<255?t:255)+(c[b>>2]|0)}i=i+1|0}o=o+1|0}}case 8:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break b;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){t=B(t,k)|0;W=(s&65534)+t<<1;T=+((d[j+(W|1)>>0]|0)+-128|0);V=+((d[j+(W+3)>>0]|0)+-128|0);U=+((d[j+(t+s<<1)>>0]|0)+-16|0)*298.0820007324219;s=~~(U+T*516.4110107421875)>>8;t=~~(U-T*100.29100036621094-V*208.1199951171875)>>8;W=~~(U+V*408.5830078125)>>8;s=(s|0)>0?s:0;X=((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)|0)*3|0;b=r+(X<<2)|0;c[b>>2]=((s|0)<255?s:255)+(c[b>>2]|0);t=(t|0)>0?t:0;b=r+(X+1<<2)|0;c[b>>2]=((t|0)<255?t:255)+(c[b>>2]|0);W=(W|0)>0?W:0;X=r+(X+2<<2)|0;c[X>>2]=((W|0)<255?W:255)+(c[X>>2]|0)}i=i+1|0}o=o+1|0}}case 9:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;i=0;while(1){if((i|0)>=(J|0))break b;v=w+I*(+(i|0)+.5)/x;o=0;while(1){if((o|0)>=(M|0))break;u=w+I*(+(o|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){W=(B(t,k)|0)+s<<1;t=a[j+(W|1)>>0]|0;X=((B((i|0)/(L|0)|0,h)|0)+((o|0)/(K|0)|0)|0)*3|0;b=r+(X<<2)|0;c[b>>2]=(c[b>>2]|0)+((t<<3&255|4)&255);W=a[j+W>>0]|0;b=r+(X+1<<2)|0;c[b>>2]=((t&-32&255)>>>3|W<<5&255|2)+(c[b>>2]|0);X=r+(X+2<<2)|0;c[X>>2]=(c[X>>2]|0)+((W&-8|4)&255)}o=o+1|0}i=i+1|0}}case 10:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break b;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){W=(B(t,k)|0)+s<<1;t=a[j+(W|1)>>0]|0;X=((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)|0)*3|0;b=r+(X<<2)|0;c[b>>2]=(c[b>>2]|0)+((t<<2&255|4)&255);W=a[j+W>>0]|0;b=r+(X+1<<2)|0;c[b>>2]=((t&-64&255)>>>3|W<<5&255|4)+(c[b>>2]|0);X=r+(X+2<<2)|0;c[X>>2]=(c[X>>2]|0)+((W&-8|4)&255)}i=i+1|0}o=o+1|0}}case 11:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break b;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){W=(B(t,k)|0)+s<<1;X=((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)|0)*3|0;b=r+(X<<2)|0;c[b>>2]=(c[b>>2]|0)+((a[j+(W|1)>>0]&-16|8)&255);W=a[j+W>>0]|0;b=r+(X+1<<2)|0;c[b>>2]=(c[b>>2]|0)+((W<<4&255|8)&255);X=r+(X+2<<2)|0;c[X>>2]=(c[X>>2]|0)+((W&-16|8)&255)}i=i+1|0}o=o+1|0}}default:{Se(0,3,20166,D);Q=306;break a}}while(0);t=B(L,K)|0;s=0;while(1){if((s|0)==(H|0))break;a[q+s>>0]=((c[r+(s<<2)>>2]|0)>>>0)/(t>>>0)|0;s=s+1|0}EO(r);r=0}else{r=FO(H,4)|0;if(!r){Se(0,3,41858,z);Ea(1)}c:do if(m>>>0<2){w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break c;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){W=((B(t,k)|0)+s|0)*3|0;X=r+((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)<<2)|0;c[X>>2]=(c[X>>2]|0)+((((d[j+(W+1)>>0]|0)+(d[j+W>>0]|0)+(d[j+(W+2)>>0]|0)|0)>>>0)/3|0)}i=i+1|0}o=o+1|0}}else{if((m|1|0)==3){w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break c;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){W=(B(t,k)|0)+s<<2;X=r+((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)<<2)|0;c[X>>2]=(c[X>>2]|0)+((((d[j+(W|1)>>0]|0)+(d[j+W>>0]|0)+(d[j+(W|2)>>0]|0)|0)>>>0)/3|0)}i=i+1|0}o=o+1|0}}if((m|2|0)==6){w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break c;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){W=(B(t,k)|0)+s<<2;X=r+((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)<<2)|0;c[X>>2]=(c[X>>2]|0)+((((d[j+(W|2)>>0]|0)+(d[j+(W|1)>>0]|0)+(d[j+(W|3)>>0]|0)|0)>>>0)/3|0)}i=i+1|0}o=o+1|0}}switch(m|0){case 5:case 12:case 13:case 14:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break c;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){W=d[j+((B(t,k)|0)+s)>>0]|0;X=r+((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)<<2)|0;c[X>>2]=(c[X>>2]|0)+W}i=i+1|0}o=o+1|0}}case 7:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break c;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){W=d[j+((B(t,k)|0)+s<<1|1)>>0]|0;X=r+((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)<<2)|0;c[X>>2]=(c[X>>2]|0)+W}i=i+1|0}o=o+1|0}}case 8:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break c;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){W=d[j+((B(t,k)|0)+s<<1)>>0]|0;X=r+((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)<<2)|0;c[X>>2]=(c[X>>2]|0)+W}i=i+1|0}o=o+1|0}}case 9:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break c;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){W=(B(t,k)|0)+s<<1;b=d[j+W>>0]|0;W=d[j+(W|1)>>0]|0;X=r+((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)<<2)|0;c[X>>2]=((((b<<5&224|W>>>3&28|2)+(b&248|4)+(W<<3&248|4)|0)>>>0)/3|0)+(c[X>>2]|0)}i=i+1|0}o=o+1|0}}case 10:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break c;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){W=(B(t,k)|0)+s<<1;b=d[j+W>>0]|0;W=d[j+(W|1)>>0]|0;X=r+((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)<<2)|0;c[X>>2]=((((b<<5&224|W>>>3&24|4)+(b&248|4)+(W<<2&248|4)|0)>>>0)/3|0)+(c[X>>2]|0)}i=i+1|0}o=o+1|0}}case 11:{w=u+100.0;x=+(J|0);y=+(M|0);z=N+48|0;A=N+56|0;C=N+64|0;D=N+8|0;m=N+16|0;E=N+24|0;F=N+32|0;G=N+40|0;e=(b|0)==1;o=0;while(1){if((o|0)>=(J|0))break c;v=w+I*(+(o|0)+.5)/x;i=0;while(1){if((i|0)>=(M|0))break;u=w+I*(+(i|0)+.5)/y;p=+g[C>>3]+(u*+g[z>>3]+v*+g[A>>3]);if(p==0.0){Q=306;break a}V=(+g[m>>3]+(u*+g[N>>3]+v*+g[D>>3]))/p;f[O>>2]=V;u=(+g[G>>3]+(u*+g[E>>3]+v*+g[F>>3]))/p;f[P>>2]=u;me(n,V,u,O,P)|0;u=+f[O>>2];if(e){s=((~~(u+1.0)|0)/2|0)<<1;t=((~~(+f[P>>2]+1.0)|0)/2|0)<<1}else{s=~~(u+.5);t=~~(+f[P>>2]+.5)}if((s|0)>-1?(t|0)<(l|0)&((t|0)>-1&(s|0)<(k|0)):0){W=(B(t,k)|0)+s<<1;b=d[j+W>>0]|0;X=r+((B((o|0)/(L|0)|0,h)|0)+((i|0)/(K|0)|0)<<2)|0;c[X>>2]=((((b<<4&240|8)+(b&240|8)+((a[j+(W|1)>>0]&-16|8)&255)|0)>>>0)/3|0)+(c[X>>2]|0)}i=i+1|0}o=o+1|0}}default:{Se(0,3,20166,A);Q=306;break a}}}while(0);t=B(L,K)|0;s=0;while(1){if((s|0)==(H|0))break;a[q+s>>0]=((c[r+(s<<2)>>2]|0)>>>0)/(t>>>0)|0;s=s+1|0}EO(r);r=0}while(0);if((Q|0)==306){EO(r);r=-1}yb=R;return r|0}function od(b,e,f,h,i){b=b|0;e=e|0;f=f|0;h=h|0;i=i|0;var 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,v=0,w=0,x=0,y=0;y=yb;yb=yb+160|0;o=y+152|0;n=y+128|0;x=y+144|0;w=y;c[n>>2]=0;c[n+4>>2]=182;c[n+8>>2]=195;c[n+12>>2]=13;j=0;l=0;m=-1;while(1){if((j|0)==4)break;v=a[b+(c[n+(j<<2)>>2]|0)>>0]|0;j=j+1|0;l=(v&255)>(l&255)?v:l;m=(v&255)<(m&255)?v:m}l=l&255;j=m&255;a:do if((l-j|0)>=30){v=(l+j|0)>>>1;j=0;while(1){if((j|0)==4)break;a[o+j>>0]=v>>>0>(d[b+(c[n+(j<<2)>>2]|0)>>0]|0)>>>0&1;j=j+1|0}u=0;while(1){if(u>>>0>=4)break;j=u+1|0;if(((a[o+u>>0]|0)==1?(a[o+(j&3)>>0]|0)==1:0)?(a[o+(u+2&3)>>0]|0)==0:0)break;u=j}b:do switch(u&2147483647|0){case 4:{c[f>>2]=0;g[h>>3]=-1.0;j=-3;break a}case 0:{l=119;n=0;j=255;while(1){if((n|0)==14){p=57;break b}o=n+-3|0;p=(n&2147483646|0)==12;q=n*14|0;m=0;while(1){if((m|0)==14)break;if(((m+-3|o)>>>0>=8?(r=m&2147483646,((m|n)&2147483646|0)!=0):0)?!(p&((r|0)==0|(r|0)==12)):0){t=(d[b+(m+q)>>0]|0)-v|0;a[w+l>>0]=t>>>31;t=(t|0)>-1?t:0-t|0;l=l+-1|0;j=(t|0)<(j|0)?t:j}m=m+1|0}n=n+1|0}}case 1:{l=119;j=255;n=0;while(1){if((n|0)==14){p=57;break b}o=n+-3|0;q=n&2147483646;p=(q|0)==0;q=(q|0)==12;m=13;while(1){if((m|0)<=-1)break;if(((m+-3|o)>>>0>=8?(s=(m&-2|0)==12,!(p&s)):0)?!(q&(m>>>0<2|s)):0){t=(d[b+((m*14|0)+n)>>0]|0)-v|0;a[w+l>>0]=t>>>31;t=(t|0)>-1?t:0-t|0;l=l+-1|0;j=(t|0)<(j|0)?t:j}m=m+-1|0}n=n+1|0}}case 2:{m=13;l=119;j=255;while(1){if((m|0)<=-1){p=57;break b}n=m+-3|0;q=m>>>0<2|(m&-2|0)==12;p=m*14|0;o=13;while(1){if((o|0)<=-1)break;if((o+-3|n)>>>0>=8?!((o|m)>>>0<2|q&(o&-2|0)==12):0){t=(d[b+(o+p)>>0]|0)-v|0;a[w+l>>0]=t>>>31;t=(t|0)>-1?t:0-t|0;l=l+-1|0;j=(t|0)<(j|0)?t:j}o=o+-1|0}m=m+-1|0}}case 3:{n=13;l=119;j=255;while(1){if((n|0)<=-1){p=57;break b}o=n+-3|0;p=n&-2;q=(p|0)==12;r=(p|0)==0;m=0;while(1){if((m|0)==14)break;if(((m+-3|o)>>>0>=8?(t=m&2147483646,!(q&(t|0)==0)):0)?!((t|p|0)==0|r&(t|0)==12):0){s=(d[b+((m*14|0)+n)>>0]|0)-v|0;a[w+l>>0]=s>>>31;s=(s|0)>-1?s:0-s|0;l=l+-1|0;j=(s|0)<(j|0)?s:j}m=m+1|0}n=n+-1|0}}default:{c[f>>2]=u;k=1.0}}while(0);if((p|0)==57){c[f>>2]=u;k=(j|0)>30?1.0:+(j|0)/30.0}g[h>>3]=k;j=kd(2830,0,0,w,x)|0;if((j|0)<0)j=-4;else{if(i|0)c[i>>2]=j;i=x;x=c[i+4>>2]|0;j=e;c[j>>2]=c[i>>2];c[j+4>>2]=x;j=0}}else{c[f>>2]=0;g[h>>3]=-1.0;j=-2}while(0);yb=y;return j|0}function pd(a,b){a=a|0;b=b|0;var d=0,e=0,f=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,v=0,w=0,x=0,y=0,z=0,A=0,C=0.0;A=yb;yb=yb+32|0;z=A+24|0;f=A+16|0;d=A+8|0;do if(a){if(!b){Se(0,3,20225,d);d=-1;break}y=a+8|0;e=c[a+4>>2]|0;d=0;while(1){if((d|0)>=(e|0))break;if(!(c[(c[y>>2]|0)+(d<<2)>>2]|0))break;d=d+1|0}if((d|0)!=(e|0)){x=hz(b)|0;if(!x){Se(0,3,20270,f);d=-1;break}p=a+28|0;q=a+12|0;r=d<<2;s=a+20|0;t=a+16|0;v=a+24|0;e=rA(x,20293)|0;o=0;a:while(1){if(o>>>0>=4){e=36;break}w=o+r|0;b=0;n=0;while(1){if(n>>>0>=3)break;l=(n|0)==0;m=(n|0)==2;k=0;f=c[p>>2]|0;while(1){if((k|0)>=(f|0))break;j=0;while(1){if((j|0)>=(f|0))break;if(!e){e=21;break a}f=jA(e)|0;e=rA(0,20293)|0;f=255-f|0;c[(c[(c[q>>2]|0)+(w<<2)>>2]|0)+((((B(c[p>>2]|0,k)|0)+j|0)*3|0)+n<<2)>>2]=f;h=c[(c[s>>2]|0)+(w<<2)>>2]|0;i=h+((B(c[p>>2]|0,k)|0)+j<<2)|0;if(!l){c[i>>2]=(c[i>>2]|0)+f;if(m){i=h+((B(c[p>>2]|0,k)|0)+j<<2)|0;c[i>>2]=(c[i>>2]|0)/3|0}}else c[i>>2]=f;j=j+1|0;b=f+b|0;f=c[p>>2]|0}k=k+1|0}n=n+1|0}i=c[p>>2]|0;j=(b|0)/(B(i*3|0,i)|0)|0;b=0;f=0;while(1){if(f>>>0>=(B(i*3|0,i)|0)>>>0)break;n=(c[(c[q>>2]|0)+(w<<2)>>2]|0)+(f<<2)|0;i=(c[n>>2]|0)-j|0;c[n>>2]=i;i=(B(i,i)|0)+b|0;b=i;f=f+1|0;i=c[p>>2]|0}C=+u(+(+(b|0)));g[(c[t>>2]|0)+(w<<3)>>3]=C==0.0?1.0e-07:C;f=0;h=0;b=i;while(1){if(h>>>0>=(B(b,b)|0)>>>0)break;n=(c[(c[s>>2]|0)+(w<<2)>>2]|0)+(h<<2)|0;b=(c[n>>2]|0)-j|0;c[n>>2]=b;b=(B(b,b)|0)+f|0;f=b;h=h+1|0;b=c[p>>2]|0}C=+u(+(+(f|0)));g[(c[v>>2]|0)+(w<<3)>>3]=C==0.0?1.0e-07:C;o=o+1|0}if((e|0)==21){Se(0,3,20298,z);EO(x);d=-1;break}else if((e|0)==36){EO(x);c[(c[y>>2]|0)+(d<<2)>>2]=1;c[a>>2]=(c[a>>2]|0)+1;break}}else d=-1}else{Se(0,3,20200,A);d=-1}while(0);yb=A;return d|0} +function rw(f){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,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;Pa=yb;yb=yb+256|0;ga=Pa;Na=f+440|0;Oa=f+464|0;oa=f+24|0;ua=f+232|0;va=f+248|0;wa=f+264|0;pa=f+280|0;qa=f+40|0;ra=f+304|0;sa=f+308|0;ta=f+284|0;ha=f+288|0;ia=f+289|0;ja=f+290|0;ka=f+292|0;la=f+294|0;ma=f+296|0;na=f+300|0;Ja=f+36|0;Ka=f+216|0;g=c[Na>>2]|0;a:while(1){do if(!g){if(c[(c[Oa>>2]|0)+12>>2]|0){if(!(ow(f)|0)){xa=0;Aa=350;break a}g=c[Na>>2]|0;break}m=c[oa>>2]|0;n=m+4|0;g=c[n>>2]|0;if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0}k=c[m>>2]|0;g=g+-1|0;h=k+1|0;k=a[k>>0]|0;l=k&255;if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}j=c[n>>2]|0;h=c[m>>2]|0}else j=g;V=a[h>>0]|0;g=V&255;if(k<<24>>24!=-1|V<<24>>24!=-40){V=c[f>>2]|0;c[V+20>>2]=55;c[V+24>>2]=l;c[(c[f>>2]|0)+28>>2]=g;Qb[c[c[f>>2]>>2]&255](f)}c[Na>>2]=g;c[m>>2]=h+1;c[n>>2]=j+-1}while(0);do switch(g|0){case 218:{Aa=25;break a}case 217:{Aa=75;break a}case 216:{g=c[f>>2]|0;c[g+20>>2]=104;Sb[c[g+4>>2]&63](f,1);g=(c[Oa>>2]|0)+12|0;if(c[g>>2]|0){g=c[f>>2]|0;c[g+20>>2]=64;Qb[c[g>>2]&255](f);g=(c[Oa>>2]|0)+12|0}h=ua;j=h+16|0;do{a[h>>0]=0;h=h+1|0}while((h|0)<(j|0));h=va;j=h+16|0;do{a[h>>0]=1;h=h+1|0}while((h|0)<(j|0));h=wa;j=h+16|0;do{a[h>>0]=5;h=h+1|0}while((h|0)<(j|0));c[pa>>2]=0;c[qa>>2]=0;c[ra>>2]=0;c[sa>>2]=0;c[ta>>2]=0;a[ha>>0]=1;a[ia>>0]=1;a[ja>>0]=0;b[ka>>1]=1;b[la>>1]=1;c[ma>>2]=0;a[na>>0]=0;c[g>>2]=1;break}case 192:{if(!(ww(f,1,0,0)|0)){xa=0;Aa=350;break a}break}case 193:{if(!(ww(f,0,0,0)|0)){xa=0;Aa=350;break a}break}case 194:{if(!(ww(f,0,1,0)|0)){xa=0;Aa=350;break a}break}case 201:{if(!(ww(f,0,0,1)|0)){xa=0;Aa=350;break a}break}case 202:{if(!(ww(f,0,1,1)|0)){xa=0;Aa=350;break a}break}case 207:case 206:case 205:case 203:case 200:case 199:case 198:case 197:case 195:{V=c[f>>2]|0;c[V+20>>2]=63;c[V+24>>2]=g;Qb[c[c[f>>2]>>2]&255](f);break}case 204:{p=c[oa>>2]|0;q=p+4|0;g=c[q>>2]|0;if(!g){if(!(Eb[c[p+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[q>>2]|0}j=c[p>>2]|0;g=g+-1|0;h=j+1|0;j=d[j>>0]<<8;if(!g){if(!(Eb[c[p+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[q>>2]|0;h=c[p>>2]|0}V=j|d[h>>0];j=V+-2|0;k=g+-1|0;g=h+1|0;if(V>>>0>2){o=p+12|0;n=j;h=k;while(1){if(!h){if(!(Eb[c[o>>2]&127](f)|0)){xa=0;Aa=350;break a}h=c[q>>2]|0;g=c[p>>2]|0}h=h+-1|0;j=g+1|0;l=a[g>>0]|0;m=l&255;if(!h){if(!(Eb[c[o>>2]&127](f)|0)){xa=0;Aa=350;break a}h=c[q>>2]|0;k=c[p>>2]|0}else k=j;g=a[k>>0]|0;j=g&255;V=c[f>>2]|0;c[V+20>>2]=81;c[V+24>>2]=m;c[(c[f>>2]|0)+28>>2]=j;Sb[c[(c[f>>2]|0)+4>>2]&63](f,1);if((l&255)<=31)if((l&255)<=15){U=j&15;a[f+232+m>>0]=U;V=(g&255)>>>4;a[f+248+m>>0]=V;if(U>>>0>(V&255)>>>0){V=c[f>>2]|0;c[V+20>>2]=30;c[V+24>>2]=j;Qb[c[c[f>>2]>>2]&255](f)}}else Aa=93;else{Aa=c[f>>2]|0;c[Aa+20>>2]=29;c[Aa+24>>2]=m;Qb[c[c[f>>2]>>2]&255](f);Aa=93}if((Aa|0)==93){Aa=0;a[m+-16+(f+264)>>0]=g}j=n+-2|0;h=h+-1|0;g=k+1|0;if((n|0)>2)n=j;else break}}else h=k;if(j|0){V=c[f>>2]|0;c[V+20>>2]=12;Qb[c[V>>2]&255](f)}c[p>>2]=g;c[q>>2]=h;break}case 196:{U=c[oa>>2]|0;V=U+4|0;g=c[V>>2]|0;if(!g){if(!(Eb[c[U+12>>2]&127](f)|0)){Aa=174;break a}g=c[V>>2]|0}k=c[U>>2]|0;g=g+-1|0;h=k+1|0;k=d[k>>0]<<8;if(!g){if(!(Eb[c[U+12>>2]&127](f)|0)){Aa=174;break a}g=c[V>>2]|0;j=c[U>>2]|0}else j=h;h=g+-1|0;g=j+1|0;T=k|d[j>>0];j=T+-2|0;if(T>>>0>18){T=U+12|0;do{if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}S=d[g>>0]|0;R=c[f>>2]|0;c[R+20>>2]=82;c[R+24>>2]=S;Sb[c[(c[f>>2]|0)+4>>2]&63](f,1);h=h+-1|0;g=g+1|0;if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}R=a[g>>0]|0;N=R&255;h=h+-1|0;g=g+1|0;if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}Q=a[g>>0]|0;L=Q&255;k=L+N|0;h=h+-1|0;g=g+1|0;if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}P=a[g>>0]|0;K=P&255;k=k+K|0;h=h+-1|0;g=g+1|0;if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}O=a[g>>0]|0;I=O&255;k=k+I|0;h=h+-1|0;g=g+1|0;if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}M=a[g>>0]|0;G=M&255;k=k+G|0;h=h+-1|0;g=g+1|0;if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}J=a[g>>0]|0;E=J&255;k=k+E|0;h=h+-1|0;g=g+1|0;if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}H=a[g>>0]|0;C=H&255;k=k+C|0;h=h+-1|0;g=g+1|0;if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}F=a[g>>0]|0;A=F&255;k=k+A|0;h=h+-1|0;g=g+1|0;if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}D=a[g>>0]|0;y=D&255;k=k+y|0;h=h+-1|0;g=g+1|0;if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}B=a[g>>0]|0;w=B&255;k=k+w|0;h=h+-1|0;g=g+1|0;if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}z=a[g>>0]|0;u=z&255;k=k+u|0;h=h+-1|0;g=g+1|0;if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}x=a[g>>0]|0;s=x&255;k=k+s|0;h=h+-1|0;g=g+1|0;if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}v=a[g>>0]|0;q=v&255;k=k+q|0;h=h+-1|0;g=g+1|0;if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}t=a[g>>0]|0;o=t&255;k=k+o|0;h=h+-1|0;g=g+1|0;if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}r=a[g>>0]|0;l=r&255;k=k+l|0;h=h+-1|0;g=g+1|0;if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}p=a[g>>0]|0;Qa=p&255;n=k+Qa|0;h=h+-1|0;g=g+1|0;m=j+-17|0;k=c[f>>2]|0;c[k+24>>2]=N;c[k+28>>2]=L;c[k+32>>2]=K;c[k+36>>2]=I;c[k+40>>2]=G;c[k+44>>2]=E;c[k+48>>2]=C;c[k+52>>2]=A;c[k+20>>2]=88;Sb[c[k+4>>2]&63](f,2);N=c[f>>2]|0;c[N+24>>2]=y;c[N+28>>2]=w;c[N+32>>2]=u;c[N+36>>2]=s;c[N+40>>2]=q;c[N+44>>2]=o;c[N+48>>2]=l;c[N+52>>2]=Qa;c[N+20>>2]=88;Sb[c[N+4>>2]&63](f,2);if(n>>>0>256|(m|0)<(n|0)){Qa=c[f>>2]|0;c[Qa+20>>2]=9;Qb[c[Qa>>2]&255](f)}_O(ga|0,0,256)|0;if(!n)j=0;else{k=0;while(1){if(!h){if(!(Eb[c[T>>2]&127](f)|0)){Aa=174;break a}h=c[V>>2]|0;g=c[U>>2]|0}h=h+-1|0;j=g+1|0;a[ga+k>>0]=a[g>>0]|0;k=k+1|0;if(k>>>0>=n>>>0){g=j;j=n;break}else g=j}}j=m-j|0;Qa=(S&16|0)==0;l=S+-16|0;k=Qa?S:l;l=Qa?f+180+(S<<2)|0:f+196+(l<<2)|0;if(k>>>0>3){Qa=c[f>>2]|0;c[Qa+20>>2]=31;c[Qa+24>>2]=k;Qb[c[c[f>>2]>>2]&255](f)}k=c[l>>2]|0;if(!k){k=hw(f)|0;c[l>>2]=k}a[k>>0]=0;a[k+1>>0]=R;a[k+2>>0]=Q;a[k+3>>0]=P;a[k+4>>0]=O;a[k+5>>0]=M;a[k+6>>0]=J;a[k+7>>0]=H;a[k+8>>0]=F;a[k+9>>0]=D;a[k+10>>0]=B;a[k+11>>0]=z;a[k+12>>0]=x;a[k+13>>0]=v;a[k+14>>0]=t;a[k+15>>0]=r;a[k+16>>0]=p;YO((c[l>>2]|0)+17|0,ga|0,256)|0}while((j|0)>16)}if(j|0){Qa=c[f>>2]|0;c[Qa+20>>2]=12;Qb[c[Qa>>2]&255](f)}c[U>>2]=g;c[V>>2]=h;break}case 219:{q=c[oa>>2]|0;r=q+4|0;g=c[r>>2]|0;if(!g){if(!(Eb[c[q+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[r>>2]|0}l=c[q>>2]|0;g=g+-1|0;h=l+1|0;l=d[l>>0]<<8;if(!g){if(!(Eb[c[q+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[r>>2]|0;k=c[q>>2]|0}else k=h;j=g+-1|0;h=k+1|0;Qa=l|d[k>>0];g=Qa+-2|0;if(Qa>>>0>2){p=q+12|0;while(1){o=g+-1|0;if(!j){if(!(Eb[c[p>>2]&127](f)|0)){xa=0;Aa=350;break a}j=c[r>>2]|0;h=c[q>>2]|0}k=d[h>>0]|0;m=k>>>4;k=k&15;Qa=c[f>>2]|0;c[Qa+20>>2]=83;c[Qa+24>>2]=k;c[(c[f>>2]|0)+28>>2]=m;Sb[c[(c[f>>2]|0)+4>>2]&63](f,1);if(k>>>0>3){Qa=c[f>>2]|0;c[Qa+20>>2]=32;c[Qa+24>>2]=k;Qb[c[c[f>>2]>>2]&255](f)}k=f+164+(k<<2)|0;l=c[k>>2]|0;if(!l){l=xw(f)|0;c[k>>2]=l}n=(m|0)!=0;if(n)if((g|0)<129){b[l>>1]=1;b[l+2>>1]=1;b[l+4>>1]=1;b[l+6>>1]=1;b[l+8>>1]=1;b[l+10>>1]=1;b[l+12>>1]=1;b[l+14>>1]=1;b[l+16>>1]=1;b[l+18>>1]=1;b[l+20>>1]=1;b[l+22>>1]=1;b[l+24>>1]=1;b[l+26>>1]=1;b[l+28>>1]=1;b[l+30>>1]=1;b[l+32>>1]=1;b[l+34>>1]=1;b[l+36>>1]=1;b[l+38>>1]=1;b[l+40>>1]=1;b[l+42>>1]=1;b[l+44>>1]=1;b[l+46>>1]=1;b[l+48>>1]=1;b[l+50>>1]=1;b[l+52>>1]=1;b[l+54>>1]=1;b[l+56>>1]=1;b[l+58>>1]=1;b[l+60>>1]=1;b[l+62>>1]=1;b[l+64>>1]=1;b[l+66>>1]=1;b[l+68>>1]=1;b[l+70>>1]=1;b[l+72>>1]=1;b[l+74>>1]=1;b[l+76>>1]=1;b[l+78>>1]=1;b[l+80>>1]=1;b[l+82>>1]=1;b[l+84>>1]=1;b[l+86>>1]=1;b[l+88>>1]=1;b[l+90>>1]=1;b[l+92>>1]=1;b[l+94>>1]=1;b[l+96>>1]=1;b[l+98>>1]=1;b[l+100>>1]=1;b[l+102>>1]=1;b[l+104>>1]=1;b[l+106>>1]=1;b[l+108>>1]=1;b[l+110>>1]=1;b[l+112>>1]=1;b[l+114>>1]=1;b[l+116>>1]=1;b[l+118>>1]=1;b[l+120>>1]=1;b[l+122>>1]=1;b[l+124>>1]=1;b[l+126>>1]=1;ba=o>>1;Aa=196}else Aa=203;else if((g|0)<65){b[l>>1]=1;b[l+2>>1]=1;b[l+4>>1]=1;b[l+6>>1]=1;b[l+8>>1]=1;b[l+10>>1]=1;b[l+12>>1]=1;b[l+14>>1]=1;b[l+16>>1]=1;b[l+18>>1]=1;b[l+20>>1]=1;b[l+22>>1]=1;b[l+24>>1]=1;b[l+26>>1]=1;b[l+28>>1]=1;b[l+30>>1]=1;b[l+32>>1]=1;b[l+34>>1]=1;b[l+36>>1]=1;b[l+38>>1]=1;b[l+40>>1]=1;b[l+42>>1]=1;b[l+44>>1]=1;b[l+46>>1]=1;b[l+48>>1]=1;b[l+50>>1]=1;b[l+52>>1]=1;b[l+54>>1]=1;b[l+56>>1]=1;b[l+58>>1]=1;b[l+60>>1]=1;b[l+62>>1]=1;b[l+64>>1]=1;b[l+66>>1]=1;b[l+68>>1]=1;b[l+70>>1]=1;b[l+72>>1]=1;b[l+74>>1]=1;b[l+76>>1]=1;b[l+78>>1]=1;b[l+80>>1]=1;b[l+82>>1]=1;b[l+84>>1]=1;b[l+86>>1]=1;b[l+88>>1]=1;b[l+90>>1]=1;b[l+92>>1]=1;b[l+94>>1]=1;b[l+96>>1]=1;b[l+98>>1]=1;b[l+100>>1]=1;b[l+102>>1]=1;b[l+104>>1]=1;b[l+106>>1]=1;b[l+108>>1]=1;b[l+110>>1]=1;b[l+112>>1]=1;b[l+114>>1]=1;b[l+116>>1]=1;b[l+118>>1]=1;b[l+120>>1]=1;b[l+122>>1]=1;b[l+124>>1]=1;b[l+126>>1]=1;ba=o;Aa=196}else Aa=203;b:do if((Aa|0)==196){Aa=0;switch(ba|0){case 4:{g=3792;break}case 9:{g=3680;break}case 16:{g=3552;break}case 25:{g=3376;break}case 36:{g=3168;break}case 49:{g=2896;break}default:{j=j+-1|0;g=h+1|0;if((ba|0)>0){Z=2576;_=ba;$=g;aa=j;Aa=205;break b}else{Y=ba;X=j;W=g;break b}}}Z=g;_=ba;$=h+1|0;aa=j+-1|0;Aa=205}else if((Aa|0)==203){Z=2576;_=64;$=h+1|0;aa=j+-1|0;Aa=205}while(0);c:do if((Aa|0)==205){Aa=0;if(!n){j=0;h=$;g=aa;while(1){if(!g){if(!(Eb[c[p>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[r>>2]|0;h=c[q>>2]|0}b[l+(c[Z+(j<<2)>>2]<<1)>>1]=d[h>>0]|0;j=j+1|0;g=g+-1|0;h=h+1|0;if((j|0)>=(_|0)){Y=_;X=g;W=h;break c}}}m=0;h=$;g=aa;while(1){if(!g){if(!(Eb[c[p>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[r>>2]|0;h=c[q>>2]|0}g=g+-1|0;j=h+1|0;k=d[h>>0]<<8;if(!g){if(!(Eb[c[p>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[r>>2]|0;h=c[q>>2]|0}else h=j;b[l+(c[Z+(m<<2)>>2]<<1)>>1]=k|d[h>>0];m=m+1|0;g=g+-1|0;h=h+1|0;if((m|0)>=(_|0)){Y=_;X=g;W=h;break}}}while(0);h=c[f>>2]|0;d:do if((c[h+104>>2]|0)>1){g=0;while(1){c[h+24>>2]=e[l+(g<<1)>>1];c[h+28>>2]=e[l+((g|1)<<1)>>1];c[h+32>>2]=e[l+((g|2)<<1)>>1];c[h+36>>2]=e[l+((g|3)<<1)>>1];c[h+40>>2]=e[l+((g|4)<<1)>>1];c[h+44>>2]=e[l+((g|5)<<1)>>1];c[h+48>>2]=e[l+((g|6)<<1)>>1];c[h+52>>2]=e[l+((g|7)<<1)>>1];c[h+20>>2]=95;Sb[c[h+4>>2]&63](f,2);g=g+8|0;if(g>>>0>=64)break d;h=c[f>>2]|0}}while(0);g=o-Y+(n?0-Y|0:0)|0;if((g|0)>0){h=W;j=X}else{j=X;h=W;break}}}if(g|0){Qa=c[f>>2]|0;c[Qa+20>>2]=12;Qb[c[Qa>>2]&255](f)}c[q>>2]=h;c[r>>2]=j;break}case 221:{l=c[oa>>2]|0;m=l+4|0;g=c[m>>2]|0;if(!g){if(!(Eb[c[l+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[m>>2]|0}k=c[l>>2]|0;g=g+-1|0;h=k+1|0;k=d[k>>0]<<8;if(!g){if(!(Eb[c[l+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[m>>2]|0;j=c[l>>2]|0}else j=h;g=g+-1|0;h=j+1|0;if((k|d[j>>0]|0)!=4){Qa=c[f>>2]|0;c[Qa+20>>2]=12;Qb[c[Qa>>2]&255](f)}if(!g){if(!(Eb[c[l+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[m>>2]|0;h=c[l>>2]|0}j=g+-1|0;g=h+1|0;k=d[h>>0]<<8;if(!j){if(!(Eb[c[l+12>>2]&127](f)|0)){xa=0;Aa=350;break a}h=c[m>>2]|0;g=c[l>>2]|0}else h=j;Qa=k|d[g>>0];V=c[f>>2]|0;c[V+20>>2]=84;c[V+24>>2]=Qa;Sb[c[(c[f>>2]|0)+4>>2]&63](f,1);c[pa>>2]=Qa;c[l>>2]=g+1;c[m>>2]=h+-1;break}case 248:{m=c[oa>>2]|0;h=c[m>>2]|0;n=m+4|0;g=c[n>>2]|0;if(!(c[(c[Oa>>2]|0)+16>>2]|0)){Qa=c[f>>2]|0;c[Qa+20>>2]=60;Uz(Qa+24|0,46637,80)|0;Qb[c[c[f>>2]>>2]&255](f)}do if((c[Ja>>2]|0)>=3){if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;h=c[m>>2]|0}g=g+-1|0;j=h+1|0;k=d[h>>0]<<8;if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;j=c[m>>2]|0}g=g+-1|0;h=j+1|0;if((k|d[j>>0]|0)!=24){Qa=c[f>>2]|0;c[Qa+20>>2]=12;Qb[c[Qa>>2]&255](f)}if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;h=c[m>>2]|0}g=g+-1|0;j=h+1|0;if((a[h>>0]|0)!=13){Qa=c[f>>2]|0;c[Qa+20>>2]=70;c[Qa+24>>2]=c[Na>>2];Qb[c[c[f>>2]>>2]&255](f)}if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;h=c[m>>2]|0}else h=j;g=g+-1|0;j=h+1|0;k=d[h>>0]<<8;if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;j=c[m>>2]|0}g=g+-1|0;h=j+1|0;if((k|d[j>>0]|0)==255){if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;h=c[m>>2]|0}g=g+-1|0;j=h+1|0;if((a[h>>0]|0)==3){if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;j=c[m>>2]|0}g=g+-1|0;h=j+1|0;k=c[Ka>>2]|0;if((c[k+88>>2]|0)==(d[j>>0]|0)){if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;h=c[m>>2]|0;l=c[Ka>>2]|0}else l=k;g=g+-1|0;j=h+1|0;if((c[l>>2]|0)==(d[h>>0]|0)){if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;k=c[m>>2]|0;h=c[Ka>>2]|0}else{k=j;h=l}g=g+-1|0;j=k+1|0;if((c[h+176>>2]|0)!=(d[k>>0]|0)){ca=g;da=j;Aa=335;break}if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;j=c[m>>2]|0}g=g+-1|0;h=j+1|0;if((a[j>>0]|0)!=-128){ca=g;da=h;Aa=335;break}if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;h=c[m>>2]|0}g=g+-1|0;j=h+1|0;k=d[h>>0]<<8;if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;j=c[m>>2]|0}g=g+-1|0;h=j+1|0;if(k|d[j>>0]|0){ca=g;da=h;Aa=335;break}if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;h=c[m>>2]|0}g=g+-1|0;j=h+1|0;k=d[h>>0]<<8;if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;j=c[m>>2]|0}g=g+-1|0;h=j+1|0;if(k|d[j>>0]|0){ca=g;da=h;Aa=335;break}if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;h=c[m>>2]|0}g=g+-1|0;j=h+1|0;if(a[h>>0]|0){ca=g;da=j;Aa=335;break}if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;h=c[m>>2]|0}else h=j;g=g+-1|0;j=h+1|0;k=d[h>>0]<<8;if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;j=c[m>>2]|0}g=g+-1|0;h=j+1|0;if((k|d[j>>0]|0)!=1){ca=g;da=h;Aa=335;break}if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;h=c[m>>2]|0}g=g+-1|0;j=h+1|0;k=d[h>>0]<<8;if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;j=c[m>>2]|0}g=g+-1|0;h=j+1|0;if(k|d[j>>0]|0){ca=g;da=h;Aa=335;break}if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;h=c[m>>2]|0}g=g+-1|0;j=h+1|0;if(a[h>>0]|0){ca=g;da=j;Aa=335;break}if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;h=c[m>>2]|0}else h=j;g=g+-1|0;j=h+1|0;k=d[h>>0]<<8;if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;j=c[m>>2]|0}g=g+-1|0;h=j+1|0;if((k|d[j>>0]|0)!=1){ca=g;da=h;Aa=335;break}if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;h=c[m>>2]|0}g=g+-1|0;j=h+1|0;k=d[h>>0]<<8;if(!g){if(!(Eb[c[m+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[n>>2]|0;j=c[m>>2]|0}g=g+-1|0;h=j+1|0;if(!(k|d[j>>0])){ea=g;fa=h}else{ca=g;da=h;Aa=335}}else{ca=g;da=j;Aa=335}}else{ca=g;da=h;Aa=335}}else{ca=g;da=j;Aa=335}}else{ca=g;da=h;Aa=335}}else{ca=g;da=h;Aa=335}while(0);if((Aa|0)==335){Aa=0;ea=c[f>>2]|0;c[ea+20>>2]=28;Qb[c[ea>>2]&255](f);ea=ca;fa=da}c[ra>>2]=1;c[m>>2]=fa;c[n>>2]=ea;break}case 239:case 238:case 237:case 236:case 235:case 234:case 233:case 232:case 231:case 230:case 229:case 228:case 227:case 226:case 225:case 224:{if(!(Eb[c[(c[Oa>>2]|0)+32+(g+-224<<2)>>2]&127](f)|0)){xa=0;Aa=350;break a}break}case 254:{if(!(Eb[c[(c[Oa>>2]|0)+28>>2]&127](f)|0)){xa=0;Aa=350;break a}break}case 1:case 215:case 214:case 213:case 212:case 211:case 210:case 209:case 208:{Qa=c[f>>2]|0;c[Qa+20>>2]=94;c[Qa+24>>2]=g;Sb[c[(c[f>>2]|0)+4>>2]&63](f,1);break}case 220:{k=c[oa>>2]|0;l=k+4|0;g=c[l>>2]|0;if(!g){if(!(Eb[c[k+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[l>>2]|0}h=c[k>>2]|0;g=g+-1|0;j=h+1|0;h=d[h>>0]<<8;if(!g){if(!(Eb[c[k+12>>2]&127](f)|0)){xa=0;Aa=350;break a}g=c[l>>2]|0;j=c[k>>2]|0}Qa=h|d[j>>0];h=Qa+-2|0;V=c[f>>2]|0;c[V+20>>2]=93;c[V+24>>2]=c[Na>>2];c[(c[f>>2]|0)+28>>2]=h;Sb[c[(c[f>>2]|0)+4>>2]&63](f,1);c[k>>2]=j+1;c[l>>2]=g+-1;if(Qa>>>0>2)Sb[c[(c[oa>>2]|0)+16>>2]&63](f,h);break}default:{Qa=c[f>>2]|0;c[Qa+20>>2]=70;c[Qa+24>>2]=g;Qb[c[c[f>>2]>>2]&255](f)}}while(0);c[Na>>2]=0;g=0}if((Aa|0)==25){q=c[oa>>2]|0;h=c[q>>2]|0;r=q+4|0;g=c[r>>2]|0;if(!(c[(c[Oa>>2]|0)+16>>2]|0)){Qa=c[f>>2]|0;c[Qa+20>>2]=60;Uz(Qa+24|0,46633,80)|0;Qb[c[c[f>>2]>>2]&255](f)}do if(!g)if(!(Eb[c[q+12>>2]&127](f)|0)){Qa=0;yb=Pa;return Qa|0}else{g=c[r>>2]|0;h=c[q>>2]|0;break}while(0);g=g+-1|0;j=h+1|0;k=d[h>>0]<<8;do if(!g)if(!(Eb[c[q+12>>2]&127](f)|0)){Qa=0;yb=Pa;return Qa|0}else{g=c[r>>2]|0;h=c[q>>2]|0;break}else h=j;while(0);g=g+-1|0;j=h+1|0;l=k|d[h>>0];do if(!g)if(!(Eb[c[q+12>>2]&127](f)|0)){Qa=0;yb=Pa;return Qa|0}else{h=c[r>>2]|0;k=c[q>>2]|0;break}else{h=g;k=j}while(0);m=a[k>>0]|0;p=m&255;Qa=c[f>>2]|0;c[Qa+20>>2]=105;c[Qa+24>>2]=p;Sb[c[(c[f>>2]|0)+4>>2]&63](f,1);do if(!((m&255)>4|(l|0)!=((p<<1)+6|0))){if(m<<24>>24){c[f+340>>2]=p;i=h+-1|0;ya=k+1|0;za=i;i=(i|0)==0;Aa=42;break}if(c[f+224>>2]|0){c[f+340>>2]=p;g=h+-1|0;if(!g){Ha=1;Aa=64}else{Fa=g;La=k+1|0;Ma=1}}else Aa=41}else Aa=41;while(0);if((Aa|0)==41){j=c[f>>2]|0;c[j+20>>2]=12;Qb[c[j>>2]&255](f);c[f+340>>2]=p;j=h+-1|0;g=k+1|0;h=(j|0)==0;if(!(m<<24>>24)){Da=j;Ea=g;Ga=h;Ia=1;Aa=63}else{ya=g;za=j;i=h;Aa=42}}e:do if((Aa|0)==42){n=q+12|0;o=f+344|0;m=0;g=ya;h=za;while(1){if(i){if(!(Eb[c[n>>2]&127](f)|0)){xa=0;Aa=350;break}h=c[r>>2]|0;g=c[q>>2]|0}l=h+-1|0;i=g+1|0;h=d[g>>0]|0;f:do if(m){g=0;while(1){if((c[c[f+344+(g<<2)>>2]>>2]|0)==(h|0))break;g=g+1|0;if(g>>>0>=m>>>0)break f}g=c[c[o>>2]>>2]|0;if(m>>>0>1){h=1;do{Qa=c[c[f+344+(h<<2)>>2]>>2]|0;g=(Qa|0)>(g|0)?Qa:g;h=h+1|0}while((h|0)!=(m|0))}h=g+1|0}while(0);g=c[Ka>>2]|0;k=c[Ja>>2]|0;g:do if((k|0)>0){j=0;while(1){if((h|0)==(c[g>>2]|0)){Ca=g;break g}j=j+1|0;g=g+88|0;if((j|0)>=(k|0)){Ba=g;Aa=58;break}}}else{Ba=g;Aa=58}while(0);if((Aa|0)==58){Aa=0;Ca=c[f>>2]|0;c[Ca+20>>2]=4;c[Ca+24>>2]=h;Qb[c[c[f>>2]>>2]&255](f);Ca=Ba}c[f+344+(m<<2)>>2]=Ca;if(!l){if(!(Eb[c[n>>2]&127](f)|0)){xa=0;Aa=350;break}g=c[r>>2]|0;i=c[q>>2]|0}else g=l;h=d[i>>0]|0;za=Ca+20|0;c[za>>2]=h>>>4;Qa=Ca+24|0;c[Qa>>2]=h&15;h=c[f>>2]|0;c[h+24>>2]=c[Ca>>2];c[h+28>>2]=c[za>>2];c[h+32>>2]=c[Qa>>2];c[h+20>>2]=106;Sb[c[h+4>>2]&63](f,1);m=m+1|0;h=g+-1|0;g=i+1|0;i=(h|0)==0;if(m>>>0>=p>>>0){Da=h;Ea=g;Ga=i;Ia=0;Aa=63;break e}}if((Aa|0)==350){yb=Pa;return xa|0}}while(0);if((Aa|0)==63)if(Ga){Ha=Ia;Aa=64}else{Fa=Da;La=Ea;Ma=Ia}do if((Aa|0)==64)if(!(Eb[c[q+12>>2]&127](f)|0)){Qa=0;yb=Pa;return Qa|0}else{Fa=c[r>>2]|0;La=c[q>>2]|0;Ma=Ha;break}while(0);g=Fa+-1|0;h=La+1|0;k=f+412|0;c[k>>2]=d[La>>0];do if(!g)if(!(Eb[c[q+12>>2]&127](f)|0)){Qa=0;yb=Pa;return Qa|0}else{g=c[r>>2]|0;i=c[q>>2]|0;break}else i=h;while(0);h=g+-1|0;g=i+1|0;j=f+416|0;c[j>>2]=d[i>>0];do if(!h)if(!(Eb[c[q+12>>2]&127](f)|0)){Qa=0;yb=Pa;return Qa|0}else{h=c[r>>2]|0;g=c[q>>2]|0;break}while(0);Qa=d[g>>0]|0;Ka=f+420|0;c[Ka>>2]=Qa>>>4;La=f+424|0;c[La>>2]=Qa&15;Qa=c[f>>2]|0;c[Qa+24>>2]=c[k>>2];c[Qa+28>>2]=c[j>>2];c[Qa+32>>2]=c[Ka>>2];c[Qa+36>>2]=c[La>>2];c[Qa+20>>2]=107;Sb[c[Qa+4>>2]&63](f,1);c[(c[Oa>>2]|0)+20>>2]=0;if(!Ma){Qa=f+144|0;c[Qa>>2]=(c[Qa>>2]|0)+1}c[q>>2]=g+1;c[r>>2]=h+-1;c[Na>>2]=0;Qa=1;yb=Pa;return Qa|0}else if((Aa|0)==75){Qa=c[f>>2]|0;c[Qa+20>>2]=87;Sb[c[Qa+4>>2]&63](f,1);c[Na>>2]=0;Qa=2;yb=Pa;return Qa|0}else if((Aa|0)==174){Qa=0;yb=Pa;return Qa|0}else if((Aa|0)==350){yb=Pa;return xa|0}return 0}function sw(a){a=a|0;var b=0,d=0,e=0,f=0;f=a+440|0;b=c[f>>2]|0;do if(!b)if(!(ow(a)|0)){f=0;return f|0}else{b=c[f>>2]|0;break}while(0);d=a+464|0;e=c[(c[d>>2]|0)+20>>2]|0;if((b|0)!=(e+208|0)){if(!(Gb[c[(c[a+24>>2]|0)+20>>2]&63](a,e)|0)){f=0;return f|0}}else{b=c[a>>2]|0;c[b+20>>2]=100;c[b+24>>2]=e;Sb[c[(c[a>>2]|0)+4>>2]&63](a,3);c[f>>2]=0}f=(c[d>>2]|0)+20|0;c[f>>2]=(c[f>>2]|0)+1&7;f=1;return f|0}function tw(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;g=a+24|0;h=c[g>>2]|0;i=h+4|0;b=c[i>>2]|0;do if(!b)if(!(Eb[c[h+12>>2]&127](a)|0)){i=0;return i|0}else{b=c[i>>2]|0;break}while(0);e=c[h>>2]|0;b=b+-1|0;f=e+1|0;e=(d[e>>0]|0)<<8;do if(!b)if(!(Eb[c[h+12>>2]&127](a)|0)){i=0;return i|0}else{b=c[i>>2]|0;f=c[h>>2]|0;break}while(0);j=e|(d[f>>0]|0);e=j+-2|0;k=c[a>>2]|0;c[k+20>>2]=93;c[k+24>>2]=c[a+440>>2];c[(c[a>>2]|0)+28>>2]=e;Sb[c[(c[a>>2]|0)+4>>2]&63](a,1);c[h>>2]=f+1;c[i>>2]=b+-1;if(j>>>0<=2){k=1;return k|0}Sb[c[(c[g>>2]|0)+16>>2]&63](a,e);k=1;return k|0}function uw(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;p=yb;yb=yb+16|0;l=p;m=b+24|0;n=c[m>>2]|0;o=n+4|0;e=c[o>>2]|0;do if(!e)if(!(Eb[c[n+12>>2]&127](b)|0)){o=0;yb=p;return o|0}else{e=c[o>>2]|0;break}while(0);g=c[n>>2]|0;e=e+-1|0;f=g+1|0;g=d[g>>0]<<8;do if(!e)if(!(Eb[c[n+12>>2]&127](b)|0)){o=0;yb=p;return o|0}else{e=c[o>>2]|0;f=c[n>>2]|0;break}while(0);j=g|d[f>>0];k=j+-2|0;j=j>>>0>15?14:j>>>0>2?k:0;g=e+-1|0;e=f+1|0;a:do if(!j)f=g;else{i=n+12|0;h=0;f=g;while(1){if(!f){if(!(Eb[c[i>>2]&127](b)|0)){e=0;break}f=c[o>>2]|0;e=c[n>>2]|0}a[l+h>>0]=a[e>>0]|0;h=h+1|0;f=f+-1|0;e=e+1|0;if(h>>>0>=j>>>0)break a}yb=p;return e|0}while(0);g=k-j|0;h=c[b+440>>2]|0;b:do switch(h|0){case 224:{vw(b,l,j,g);break}case 238:{if((((j>>>0>11&(a[l>>0]|0)==65?(a[l+1>>0]|0)==100:0)?(a[l+2>>0]|0)==111:0)?(a[l+3>>0]|0)==98:0)?(a[l+4>>0]|0)==101:0){h=d[l+7>>0]<<8|d[l+8>>0];i=d[l+9>>0]<<8|d[l+10>>0];k=a[l+11>>0]|0;j=c[b>>2]|0;c[j+24>>2]=d[l+5>>0]<<8|d[l+6>>0];c[j+28>>2]=h;c[j+32>>2]=i;c[j+36>>2]=k&255;c[j+20>>2]=78;Sb[c[j+4>>2]&63](b,1);c[b+296>>2]=1;a[b+300>>0]=k;break b}l=c[b>>2]|0;c[l+20>>2]=80;c[l+24>>2]=k;Sb[c[(c[b>>2]|0)+4>>2]&63](b,1);break}default:{l=c[b>>2]|0;c[l+20>>2]=70;c[l+24>>2]=h;Qb[c[c[b>>2]>>2]&255](b)}}while(0);c[n>>2]=e;c[o>>2]=f;if((g|0)<=0){o=1;yb=p;return o|0}Sb[c[(c[m>>2]|0)+16>>2]&63](b,g);o=1;yb=p;return o|0}function vw(e,f,g,h){e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;r=h+g|0;if(g>>>0>13){if((a[f>>0]|0)==74)if((((a[f+1>>0]|0)==70?(a[f+2>>0]|0)==73:0)?(a[f+3>>0]|0)==70:0)?(a[f+4>>0]|0)==0:0){c[e+284>>2]=1;j=a[f+5>>0]|0;k=e+288|0;a[k>>0]=j;l=a[f+6>>0]|0;m=e+289|0;a[m>>0]=l;h=a[f+7>>0]|0;p=e+290|0;a[p>>0]=h;i=(d[f+8>>0]<<8|d[f+9>>0])&65535;n=e+292|0;b[n>>1]=i;g=(d[f+10>>0]<<8|d[f+11>>0])&65535;o=e+294|0;b[o>>1]=g;if((j+-1&255)<2)q=e;else{q=c[e>>2]|0;c[q+20>>2]=122;c[q+24>>2]=j&255;c[(c[e>>2]|0)+28>>2]=d[m>>0];Sb[c[(c[e>>2]|0)+4>>2]&63](e,-1);q=e;j=a[k>>0]|0;l=a[m>>0]|0;i=b[n>>1]|0;g=b[o>>1]|0;h=a[p>>0]|0}p=c[e>>2]|0;c[p+24>>2]=j&255;c[p+28>>2]=l&255;c[p+32>>2]=i&65535;c[p+36>>2]=g&65535;c[p+40>>2]=h&255;c[p+20>>2]=89;Sb[c[p+4>>2]&63](q,1);h=f+12|0;i=a[h>>0]|0;j=f+13|0;g=a[j>>0]|0;if((g|i)<<24>>24){i=c[e>>2]|0;c[i+20>>2]=92;c[i+24>>2]=d[h>>0];c[(c[e>>2]|0)+28>>2]=d[j>>0];Sb[c[(c[e>>2]|0)+4>>2]&63](q,1);i=a[h>>0]|0;g=a[j>>0]|0}h=r+-14|0;if((h|0)==(B((i&255)*3|0,g&255)|0))return;r=c[e>>2]|0;c[r+20>>2]=90;c[r+24>>2]=h;Sb[c[(c[e>>2]|0)+4>>2]&63](q,1);return}else i=16}else if(g>>>0>5?(a[f>>0]|0)==74:0)i=16;if(((((i|0)==16?(a[f+1>>0]|0)==70:0)?(a[f+2>>0]|0)==88:0)?(a[f+3>>0]|0)==88:0)?(a[f+4>>0]|0)==0:0){h=f+5|0;switch(a[h>>0]|0){case 16:{q=c[e>>2]|0;c[q+20>>2]=110;c[q+24>>2]=r;Sb[c[(c[e>>2]|0)+4>>2]&63](e,1);return}case 17:{q=c[e>>2]|0;c[q+20>>2]=111;c[q+24>>2]=r;Sb[c[(c[e>>2]|0)+4>>2]&63](e,1);return}case 19:{q=c[e>>2]|0;c[q+20>>2]=112;c[q+24>>2]=r;Sb[c[(c[e>>2]|0)+4>>2]&63](e,1);return}default:{q=c[e>>2]|0;c[q+20>>2]=91;c[q+24>>2]=d[h>>0];c[(c[e>>2]|0)+28>>2]=r;Sb[c[(c[e>>2]|0)+4>>2]&63](e,1);return}}}q=c[e>>2]|0;c[q+20>>2]=79;c[q+24>>2]=r;Sb[c[(c[e>>2]|0)+4>>2]&63](e,1);return}function ww(a,b,e,f){a=a|0;b=b|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;o=c[a+24>>2]|0;h=c[o>>2]|0;p=o+4|0;g=c[p>>2]|0;c[a+220>>2]=b;c[a+224>>2]=e;c[a+228>>2]=f;do if(!g)if(!(Eb[c[o+12>>2]&127](a)|0)){p=0;return p|0}else{g=c[p>>2]|0;h=c[o>>2]|0;break}while(0);g=g+-1|0;b=h+1|0;e=(d[h>>0]|0)<<8;do if(!g)if(!(Eb[c[o+12>>2]&127](a)|0)){p=0;return p|0}else{g=c[p>>2]|0;h=c[o>>2]|0;break}else h=b;while(0);g=g+-1|0;b=h+1|0;j=e|(d[h>>0]|0);do if(!g)if(!(Eb[c[o+12>>2]&127](a)|0)){p=0;return p|0}else{g=c[p>>2]|0;h=c[o>>2]|0;break}else h=b;while(0);g=g+-1|0;b=h+1|0;c[a+212>>2]=d[h>>0];do if(!g)if(!(Eb[c[o+12>>2]&127](a)|0)){p=0;return p|0}else{g=c[p>>2]|0;h=c[o>>2]|0;break}else h=b;while(0);g=g+-1|0;b=h+1|0;h=(d[h>>0]|0)<<8;i=a+32|0;c[i>>2]=h;do if(!g)if(!(Eb[c[o+12>>2]&127](a)|0)){p=0;return p|0}else{g=c[p>>2]|0;b=c[o>>2]|0;e=c[i>>2]|0;break}else e=h;while(0);g=g+-1|0;h=b+1|0;c[i>>2]=e+(d[b>>0]|0);do if(!g)if(!(Eb[c[o+12>>2]&127](a)|0)){p=0;return p|0}else{g=c[p>>2]|0;h=c[o>>2]|0;break}while(0);g=g+-1|0;b=h+1|0;h=(d[h>>0]|0)<<8;f=a+28|0;c[f>>2]=h;do if(!g)if(!(Eb[c[o+12>>2]&127](a)|0)){p=0;return p|0}else{g=c[p>>2]|0;b=c[o>>2]|0;h=c[f>>2]|0;break}while(0);g=g+-1|0;e=b+1|0;c[f>>2]=h+(d[b>>0]|0);do if(!g)if(!(Eb[c[o+12>>2]&127](a)|0)){p=0;return p|0}else{b=c[p>>2]|0;e=c[o>>2]|0;break}else b=g;while(0);m=a+36|0;c[m>>2]=d[e>>0];h=j+-8|0;n=c[a>>2]|0;c[n+24>>2]=c[a+440>>2];c[n+28>>2]=c[f>>2];c[n+32>>2]=c[i>>2];c[n+36>>2]=c[m>>2];c[n+20>>2]=102;Sb[c[n+4>>2]&63](a,1);n=a+464|0;if(c[(c[n>>2]|0)+16>>2]|0){l=c[a>>2]|0;c[l+20>>2]=61;Qb[c[l>>2]&255](a)}if(((c[i>>2]|0)!=0?(c[f>>2]|0)!=0:0)?(k=c[m>>2]|0,(k|0)>=1):0)g=k;else{g=c[a>>2]|0;c[g+20>>2]=33;Qb[c[g>>2]&255](a);g=c[m>>2]|0}if((h|0)!=(g*3|0)){l=c[a>>2]|0;c[l+20>>2]=12;Qb[c[l>>2]&255](a)}l=a+216|0;if(!(c[l>>2]|0))c[l>>2]=Hb[c[c[a+4>>2]>>2]&63](a,1,(c[m>>2]|0)*88|0)|0;b=b+-1|0;g=e+1|0;a:do if((c[m>>2]|0)>0){k=o+12|0;j=0;while(1){if(!b){if(!(Eb[c[k>>2]&127](a)|0)){g=0;h=57;break}b=c[p>>2]|0;g=c[o>>2]|0}f=b+-1|0;h=g+1|0;e=d[g>>0]|0;i=c[l>>2]|0;b:do if(!j)b=e;else{g=i;b=0;while(1){if((c[g>>2]|0)==(e|0))break;b=b+1|0;g=g+88|0;if(b>>>0>=j>>>0){b=e;i=g;break b}}b=c[i>>2]|0;g=i+88|0;if(j>>>0>1){e=1;while(1){q=c[g>>2]|0;b=(q|0)>(b|0)?q:b;e=e+1|0;if((e|0)==(j|0))break;else g=g+88|0}g=i+(j*88|0)|0}b=b+1|0;i=g}while(0);c[i>>2]=b;c[i+4>>2]=j;if(!f){if(!(Eb[c[k>>2]&127](a)|0)){g=0;h=57;break}g=c[p>>2]|0;h=c[o>>2]|0}else g=f;g=g+-1|0;b=h+1|0;q=d[h>>0]|0;e=i+8|0;c[e>>2]=q>>>4;f=i+12|0;c[f>>2]=q&15;if(!g){if(!(Eb[c[k>>2]&127](a)|0)){g=0;h=57;break}g=c[p>>2]|0;h=c[o>>2]|0}else h=b;q=i+16|0;c[q>>2]=d[h>>0];b=c[a>>2]|0;c[b+24>>2]=c[i>>2];c[b+28>>2]=c[e>>2];c[b+32>>2]=c[f>>2];c[b+36>>2]=c[q>>2];c[b+20>>2]=103;Sb[c[b+4>>2]&63](a,1);j=j+1|0;b=g+-1|0;g=h+1|0;if((j|0)>=(c[m>>2]|0))break a}if((h|0)==57)return g|0}while(0);c[(c[n>>2]|0)+16>>2]=1;c[o>>2]=g;c[p>>2]=b;q=1;return q|0}function xw(a){a=a|0;a=Hb[c[c[a+4>>2]>>2]&63](a,0,132)|0;c[a+128>>2]=0;return a|0}function yw(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=yb;yb=yb+16|0;j=k;g=k+8|0;h=k+12|0;d=b+4|0;c[d>>2]=0;e=zw(b)|0;c[g>>2]=e;f=Aw(b,84)|0;if(!f){Bw(b);i=c[b>>2]|0;c[i+20>>2]=56;c[i+24>>2]=0;Qb[c[c[b>>2]>>2]&255](b)}c[f>>2]=33;c[f+4>>2]=34;c[f+8>>2]=9;c[f+12>>2]=10;c[f+16>>2]=39;c[f+20>>2]=40;c[f+24>>2]=135;c[f+28>>2]=21;c[f+32>>2]=22;c[f+36>>2]=52;c[f+40>>2]=136;c[f+48>>2]=1e9;i=f+44|0;c[i>>2]=e;c[f+56>>2]=0;c[f+64>>2]=0;c[f+52>>2]=0;c[f+60>>2]=0;c[f+68>>2]=0;c[f+72>>2]=0;c[f+76>>2]=84;c[d>>2]=f;b=Ja(46641)|0;if(!b){yb=k;return}a[h>>0]=120;c[j>>2]=g;c[j+4>>2]=h;if((Az(b,46649,j)|0)>0){switch(a[h>>0]|0){case 77:case 109:{b=(c[g>>2]|0)*1e3|0;c[g>>2]=b;break}default:b=c[g>>2]|0}c[i>>2]=b*1e3}yb=k;return}function zw(a){a=a|0;return 0}function Aw(a,b){a=a|0;b=b|0;return DO(b)|0}function Bw(a){a=a|0;return}function Cw(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=c[a+4>>2]|0;if(d>>>0>999999984){j=c[a>>2]|0;c[j+20>>2]=56;c[j+24>>2]=1;Qb[c[c[a>>2]>>2]&255](a)}j=d&7;j=((j|0)==0?0:8-j|0)+d|0;if(b>>>0>1){i=c[a>>2]|0;c[i+20>>2]=15;c[i+24>>2]=b;Qb[c[c[a>>2]>>2]&255](a)}i=k+52+(b<<2)|0;d=c[i>>2]|0;a:do if(!d){d=0;f=9}else while(1){if((c[d+8>>2]|0)>>>0>=j>>>0)break a;e=c[d>>2]|0;if(!e){f=9;break}else d=e}while(0);do if((f|0)==9){h=(d|0)==0;b=c[(h?15936:15944)+(b<<2)>>2]|0;e=999999984-j|0;b=b>>>0>e>>>0?e:b;e=b+j|0;g=e+16|0;f=Aw(a,g)|0;if(!f){do{if(b>>>0<100){g=c[a>>2]|0;c[g+20>>2]=56;c[g+24>>2]=2;Qb[c[c[a>>2]>>2]&255](a)}b=b>>>1;e=b+j|0;g=e+16|0;f=Aw(a,g)|0}while(!(f|0));b=g}else b=g;k=k+76|0;c[k>>2]=(c[k>>2]|0)+b;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=e;if(h){c[i>>2]=f;d=f;break}else{c[d>>2]=f;d=f;break}}while(0);i=d+4|0;k=c[i>>2]|0;c[i>>2]=k+j;i=d+8|0;c[i>>2]=(c[i>>2]|0)-j;return d+16+k|0}function Dw(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=c[a+4>>2]|0;if(d>>>0>999999984){f=c[a>>2]|0;c[f+20>>2]=56;c[f+24>>2]=3;Qb[c[c[a>>2]>>2]&255](a)}f=d&7;d=((f|0)==0?0:8-f|0)+d|0;if(b>>>0>1){f=c[a>>2]|0;c[f+20>>2]=15;c[f+24>>2]=b;Qb[c[c[a>>2]>>2]&255](a)}e=d+16|0;f=Rw(a,e)|0;if(!f){h=c[a>>2]|0;c[h+20>>2]=56;c[h+24>>2]=4;Qb[c[c[a>>2]>>2]&255](a)}h=g+76|0;c[h>>2]=(c[h>>2]|0)+e;h=g+60+(b<<2)|0;c[f>>2]=c[h>>2];c[f+4>>2]=d;c[f+8>>2]=0;c[h>>2]=f;return f+16|0}function Ew(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;g=c[a+4>>2]|0;f=999999984/(d>>>0)|0;if(d>>>0>999999984){m=c[a>>2]|0;c[m+20>>2]=72;Qb[c[m>>2]&255](a)}h=(f|0)<(e|0)?f:e;c[g+80>>2]=h;l=Cw(a,b,e<<2)|0;if(!e)return l|0;m=~e;f=0;do{i=e-f|0;g=h;h=h>>>0>>0?h:i;i=Dw(a,b,B(h,d)|0)|0;if(h){j=f+m|0;k=~g;k=j>>>0>k>>>0?j:k;j=h;g=i;i=f;while(1){c[l+(i<<2)>>2]=g;j=j+-1|0;if(!j)break;else{g=g+d|0;i=i+1|0}}f=f+-1-k|0}}while(f>>>0>>0);return l|0}function Fw(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;g=c[a+4>>2]|0;n=d<<7;f=999999984/(n>>>0)|0;if(n>>>0>999999984){m=c[a>>2]|0;c[m+20>>2]=72;Qb[c[m>>2]&255](a)}h=(f|0)<(e|0)?f:e;c[g+80>>2]=h;l=Cw(a,b,e<<2)|0;if(!e)return l|0;m=~e;f=0;do{i=e-f|0;g=h;h=h>>>0>>0?h:i;i=Dw(a,b,B(n,h)|0)|0;if(h){j=f+m|0;k=~g;k=j>>>0>k>>>0?j:k;j=h;g=i;i=f;while(1){c[l+(i<<2)>>2]=g;j=j+-1|0;if(!j)break;else{g=g+(d<<7)|0;i=i+1|0}}f=f+-1-k|0}}while(f>>>0>>0);return l|0}function Gw(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 h=0,i=0;h=c[a+4>>2]|0;if((b|0)==1)b=1;else{i=c[a>>2]|0;c[i+20>>2]=15;c[i+24>>2]=b;Qb[c[c[a>>2]>>2]&255](a)}i=Cw(a,b,128)|0;c[i>>2]=0;c[i+4>>2]=f;c[i+8>>2]=e;c[i+12>>2]=g;c[i+32>>2]=d;c[i+40>>2]=0;h=h+68|0;c[i+44>>2]=c[h>>2];c[h>>2]=i;return i|0}function Hw(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 h=0,i=0;h=c[a+4>>2]|0;if((b|0)==1)b=1;else{i=c[a>>2]|0;c[i+20>>2]=15;c[i+24>>2]=b;Qb[c[c[a>>2]>>2]&255](a)}i=Cw(a,b,128)|0;c[i>>2]=0;c[i+4>>2]=f;c[i+8>>2]=e;c[i+12>>2]=g;c[i+32>>2]=d;c[i+40>>2]=0;h=h+72|0;c[i+44>>2]=c[h>>2];c[h>>2]=i;return i|0}function Iw(a){a=a|0;var b=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;u=a+4|0;s=c[u>>2]|0;f=s+68|0;b=c[f>>2]|0;if(!b){d=0;e=0}else{d=0;e=0;do{if(!(c[b>>2]|0)){t=c[b+8>>2]|0;d=(B(t,c[b+12>>2]|0)|0)+d|0;e=(B(c[b+4>>2]|0,t)|0)+e|0}b=c[b+44>>2]|0}while((b|0)!=0)}r=s+72|0;b=c[r>>2]|0;if(!b)b=e;else{do{if(!(c[b>>2]|0)){t=c[b+8>>2]|0;d=(B(c[b+12>>2]<<7,t)|0)+d|0;e=(B(t<<7,c[b+4>>2]|0)|0)+e|0}b=c[b+44>>2]|0}while((b|0)!=0);b=e}if((d|0)<1)return;e=Pw(a,d,b,c[s+76>>2]|0)|0;if((e|0)<(b|0)){t=(e|0)/(d|0)|0;t=(t|0)>1?t:1}else t=1e9;b=c[f>>2]|0;if(b|0){q=s+80|0;do{if(!(c[b>>2]|0)){e=c[b+4>>2]|0;d=c[b+12>>2]|0;if(((((e+-1|0)>>>0)/(d>>>0)|0)+1|0)>(t|0)){p=b+16|0;c[p>>2]=B(d,t)|0;d=b+8|0;Qw(a,b+48|0,B(c[d>>2]|0,e)|0);c[b+40>>2]=1;e=c[p>>2]|0}else{c[b+16>>2]=e;d=b+8|0}p=c[d>>2]|0;f=c[u>>2]|0;d=999999984/(p>>>0)|0;if(p>>>0>999999984){o=c[a>>2]|0;c[o+20>>2]=72;Qb[c[o>>2]&255](a)}g=(d|0)<(e|0)?d:e;c[f+80>>2]=g;n=Cw(a,1,e<<2)|0;if(e|0){o=~e;d=0;do{f=e-d|0;j=g;g=g>>>0>>0?g:f;f=B(g,p)|0;i=c[u>>2]|0;if(f>>>0>999999984){m=c[a>>2]|0;c[m+20>>2]=56;c[m+24>>2]=3;Qb[c[c[a>>2]>>2]&255](a)}h=f&7;f=((h|0)==0?0:8-h|0)+f|0;h=f+16|0;m=Rw(a,h)|0;if(!m){l=c[a>>2]|0;c[l+20>>2]=56;c[l+24>>2]=4;Qb[c[c[a>>2]>>2]&255](a)}l=i+76|0;c[l>>2]=(c[l>>2]|0)+h;l=i+64|0;c[m>>2]=c[l>>2];c[m+4>>2]=f;c[m+8>>2]=0;c[l>>2]=m;if(g){l=d+o|0;j=~j;k=l>>>0>j>>>0;i=g;f=m+16|0;h=d;while(1){c[n+(h<<2)>>2]=f;i=i+-1|0;if(!i)break;else{f=f+p|0;h=h+1|0}}d=d+-1-(k?l:j)|0}}while(d>>>0>>0)}c[b>>2]=n;c[b+20>>2]=c[q>>2];c[b+24>>2]=0;c[b+28>>2]=0;c[b+36>>2]=0}b=c[b+44>>2]|0}while((b|0)!=0)}b=c[r>>2]|0;if(!b)return;r=s+80|0;do{if(!(c[b>>2]|0)){e=c[b+4>>2]|0;d=c[b+12>>2]|0;if(((((e+-1|0)>>>0)/(d>>>0)|0)+1|0)>(t|0)){s=b+16|0;c[s>>2]=B(d,t)|0;d=b+8|0;Qw(a,b+48|0,B(e<<7,c[d>>2]|0)|0);c[b+40>>2]=1;e=c[s>>2]|0}else{c[b+16>>2]=e;d=b+8|0}p=c[d>>2]|0;f=c[u>>2]|0;q=p<<7;d=999999984/(q>>>0)|0;if(q>>>0>999999984){s=c[a>>2]|0;c[s+20>>2]=72;Qb[c[s>>2]&255](a)}g=(d|0)<(e|0)?d:e;c[f+80>>2]=g;n=Cw(a,1,e<<2)|0;if(e|0){o=~e;d=0;do{f=e-d|0;j=g;g=g>>>0>>0?g:f;f=B(g,q)|0;h=c[u>>2]|0;if(f>>>0>999999984){s=c[a>>2]|0;c[s+20>>2]=56;c[s+24>>2]=3;Qb[c[c[a>>2]>>2]&255](a)}i=f|16;m=Rw(a,i)|0;if(!m){s=c[a>>2]|0;c[s+20>>2]=56;c[s+24>>2]=4;Qb[c[c[a>>2]>>2]&255](a)}s=h+76|0;c[s>>2]=(c[s>>2]|0)+i;s=h+64|0;c[m>>2]=c[s>>2];c[m+4>>2]=f;c[m+8>>2]=0;c[s>>2]=m;if(g){l=d+o|0;j=~j;k=l>>>0>j>>>0;i=g;f=m+16|0;h=d;while(1){c[n+(h<<2)>>2]=f;i=i+-1|0;if(!i)break;else{f=f+(p<<7)|0;h=h+1|0}}d=d+-1-(k?l:j)|0}}while(d>>>0>>0)}c[b>>2]=n;c[b+20>>2]=c[r>>2];c[b+24>>2]=0;c[b+28>>2]=0;c[b+36>>2]=0}b=c[b+44>>2]|0}while((b|0)!=0);return}function Jw(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;w=e+d|0;s=b+4|0;if(!((w>>>0<=(c[s>>2]|0)>>>0?(c[b+12>>2]|0)>>>0>=e>>>0:0)?(c[b>>2]|0)!=0:0)){x=c[a>>2]|0;c[x+20>>2]=23;Qb[c[x>>2]&255](a)}x=b+24|0;n=c[x>>2]|0;if(!(n>>>0<=d>>>0?w>>>0<=((c[b+16>>2]|0)+n|0)>>>0:0))v=7;a:do if((v|0)==7){if(!(c[b+40>>2]|0)){n=c[a>>2]|0;c[n+20>>2]=71;Qb[c[n>>2]&255](a)}k=b+36|0;if(c[k>>2]|0){l=c[b+8>>2]|0;e=c[x>>2]|0;m=b+20|0;n=b+16|0;g=c[n>>2]|0;b:do if((g|0)>0?(o=b+28|0,p=b+48|0,q=b+52|0,h=c[m>>2]|0,h=(h|0)<(g|0)?h:g,j=(c[o>>2]|0)-e|0,j=(h|0)<(j|0)?h:j,h=(c[s>>2]|0)-e|0,h=(j|0)<(h|0)?j:h,(h|0)>=1):0){i=B(e,l)|0;j=0;e=h;while(1){h=B(e,l)|0;Wb[c[q>>2]&63](a,p,c[(c[b>>2]|0)+(j<<2)>>2]|0,i,h);e=c[m>>2]|0;j=e+j|0;g=c[n>>2]|0;if((g|0)<=(j|0))break b;y=g-j|0;y=(e|0)<(y|0)?e:y;e=j+(c[x>>2]|0)|0;g=(c[o>>2]|0)-e|0;g=(y|0)<(g|0)?y:g;e=(c[s>>2]|0)-e|0;e=(g|0)<(e|0)?g:e;if((e|0)<1)break;else i=h+i|0}}while(0);c[k>>2]=0}k=b+16|0;e=c[k>>2]|0;if((c[x>>2]|0)>>>0>>0)g=d;else{g=w-e|0;g=(g|0)>0?g:0}c[x>>2]=g;l=c[b+8>>2]|0;m=b+20|0;if((e|0)>0?(t=b+28|0,u=b+48|0,r=c[m>>2]|0,r=(r|0)<(e|0)?r:e,y=(c[t>>2]|0)-g|0,y=(r|0)<(y|0)?r:y,r=(c[s>>2]|0)-g|0,r=(y|0)<(r|0)?y:r,(r|0)>=1):0){i=B(l,g)|0;j=0;e=r;while(1){h=B(e,l)|0;Wb[c[u>>2]&63](a,u,c[(c[b>>2]|0)+(j<<2)>>2]|0,i,h);g=c[m>>2]|0;j=g+j|0;e=c[k>>2]|0;if((e|0)<=(j|0))break a;r=e-j|0;r=(g|0)<(r|0)?g:r;e=j+(c[x>>2]|0)|0;y=(c[t>>2]|0)-e|0;y=(r|0)<(y|0)?r:y;e=(c[s>>2]|0)-e|0;e=(y|0)<(e|0)?y:e;if((e|0)<1)break;else i=h+i|0}}}while(0);h=b+28|0;e=c[h>>2]|0;do if(e>>>0>>0){g=(f|0)==0;if(e>>>0>>0)if(g){e=d;g=0}else{e=c[a>>2]|0;c[e+20>>2]=23;Qb[c[e>>2]&255](a);e=d;v=28}else if(g)g=0;else v=28;if((v|0)==28){c[h>>2]=w;g=1}if(!(c[b+32>>2]|0)){if(g)break;y=c[a>>2]|0;c[y+20>>2]=23;Qb[c[y>>2]&255](a);break}h=c[b+8>>2]|0;g=c[x>>2]|0;e=e-g|0;g=w-g|0;if(e>>>0>>0)do{_O(c[(c[b>>2]|0)+(e<<2)>>2]|0,0,h|0)|0;e=e+1|0}while((e|0)!=(g|0))}while(0);if(!f){f=c[b>>2]|0;y=c[x>>2]|0;y=d-y|0;y=f+(y<<2)|0;return y|0}c[b+36>>2]=1;f=c[b>>2]|0;y=c[x>>2]|0;y=d-y|0;y=f+(y<<2)|0;return y|0}function Kw(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;w=e+d|0;s=b+4|0;if(!((w>>>0<=(c[s>>2]|0)>>>0?(c[b+12>>2]|0)>>>0>=e>>>0:0)?(c[b>>2]|0)!=0:0)){x=c[a>>2]|0;c[x+20>>2]=23;Qb[c[x>>2]&255](a)}x=b+24|0;n=c[x>>2]|0;if(!(n>>>0<=d>>>0?w>>>0<=((c[b+16>>2]|0)+n|0)>>>0:0))v=7;a:do if((v|0)==7){if(!(c[b+40>>2]|0)){n=c[a>>2]|0;c[n+20>>2]=71;Qb[c[n>>2]&255](a)}k=b+36|0;if(c[k>>2]|0){l=c[b+8>>2]<<7;e=c[x>>2]|0;m=b+20|0;n=b+16|0;g=c[n>>2]|0;b:do if((g|0)>0?(o=b+28|0,p=b+48|0,q=b+52|0,h=c[m>>2]|0,h=(h|0)<(g|0)?h:g,j=(c[o>>2]|0)-e|0,j=(h|0)<(j|0)?h:j,h=(c[s>>2]|0)-e|0,h=(j|0)<(h|0)?j:h,(h|0)>=1):0){i=B(e,l)|0;j=0;e=h;while(1){h=B(e,l)|0;Wb[c[q>>2]&63](a,p,c[(c[b>>2]|0)+(j<<2)>>2]|0,i,h);e=c[m>>2]|0;j=e+j|0;g=c[n>>2]|0;if((g|0)<=(j|0))break b;y=g-j|0;y=(e|0)<(y|0)?e:y;e=j+(c[x>>2]|0)|0;g=(c[o>>2]|0)-e|0;g=(y|0)<(g|0)?y:g;e=(c[s>>2]|0)-e|0;e=(g|0)<(e|0)?g:e;if((e|0)<1)break;else i=h+i|0}}while(0);c[k>>2]=0}k=b+16|0;e=c[k>>2]|0;if((c[x>>2]|0)>>>0>>0)g=d;else{g=w-e|0;g=(g|0)>0?g:0}c[x>>2]=g;l=c[b+8>>2]<<7;m=b+20|0;if((e|0)>0?(t=b+28|0,u=b+48|0,r=c[m>>2]|0,r=(r|0)<(e|0)?r:e,y=(c[t>>2]|0)-g|0,y=(r|0)<(y|0)?r:y,r=(c[s>>2]|0)-g|0,r=(y|0)<(r|0)?y:r,(r|0)>=1):0){i=B(l,g)|0;j=0;e=r;while(1){h=B(e,l)|0;Wb[c[u>>2]&63](a,u,c[(c[b>>2]|0)+(j<<2)>>2]|0,i,h);e=c[m>>2]|0;j=e+j|0;g=c[k>>2]|0;if((g|0)<=(j|0))break a;r=g-j|0;r=(e|0)<(r|0)?e:r;e=j+(c[x>>2]|0)|0;y=(c[t>>2]|0)-e|0;y=(r|0)<(y|0)?r:y;e=(c[s>>2]|0)-e|0;e=(y|0)<(e|0)?y:e;if((e|0)<1)break;else i=h+i|0}}}while(0);h=b+28|0;e=c[h>>2]|0;do if(e>>>0>>0){g=(f|0)==0;if(e>>>0>>0)if(g){e=d;g=0}else{e=c[a>>2]|0;c[e+20>>2]=23;Qb[c[e>>2]&255](a);e=d;v=28}else if(g)g=0;else v=28;if((v|0)==28){c[h>>2]=w;g=1}if(!(c[b+32>>2]|0)){if(g)break;y=c[a>>2]|0;c[y+20>>2]=23;Qb[c[y>>2]&255](a);break}h=c[b+8>>2]<<7;g=c[x>>2]|0;e=e-g|0;g=w-g|0;if(e>>>0>>0)do{_O(c[(c[b>>2]|0)+(e<<2)>>2]|0,0,h|0)|0;e=e+1|0}while((e|0)!=(g|0))}while(0);if(!f){f=c[b>>2]|0;y=c[x>>2]|0;y=d-y|0;y=f+(y<<2)|0;return y|0}c[b+36>>2]=1;f=c[b>>2]|0;y=c[x>>2]|0;y=d-y|0;y=f+(y<<2)|0;return y|0}function Lw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;g=c[a+4>>2]|0;if(b>>>0<=1){if((b|0)==1){f=g+68|0;d=c[f>>2]|0;if(d|0)do{e=d+40|0;if(c[e>>2]|0){c[e>>2]=0;Sb[c[d+56>>2]&63](a,d+48|0)}d=c[d+44>>2]|0}while((d|0)!=0);c[f>>2]=0;f=g+72|0;d=c[f>>2]|0;if(d|0)do{e=d+40|0;if(c[e>>2]|0){c[e>>2]=0;Sb[c[d+56>>2]&63](a,d+48|0)}d=c[d+44>>2]|0}while((d|0)!=0);c[f>>2]=0}}else{f=c[a>>2]|0;c[f+20>>2]=15;c[f+24>>2]=b;Qb[c[c[a>>2]>>2]&255](a)}f=g+60+(b<<2)|0;d=c[f>>2]|0;c[f>>2]=0;if(d|0){e=g+76|0;do{h=d;d=c[d>>2]|0;f=(c[h+4>>2]|0)+16+(c[h+8>>2]|0)|0;Ow(a,h,f);c[e>>2]=(c[e>>2]|0)-f}while((d|0)!=0)}h=g+52+(b<<2)|0;d=c[h>>2]|0;c[h>>2]=0;if(!d)return;e=g+76|0;do{g=d;d=c[d>>2]|0;h=(c[g+4>>2]|0)+16+(c[g+8>>2]|0)|0;Nw(a,g,h);c[e>>2]=(c[e>>2]|0)-h}while((d|0)!=0);return}function Mw(a){a=a|0;var b=0;Lw(a,1);Lw(a,0);b=a+4|0;Nw(a,c[b>>2]|0,84);c[b>>2]=0;Bw(a);return}function Nw(a,b,c){a=a|0;b=b|0;c=c|0;EO(b);return}function Ow(a,b,c){a=a|0;b=b|0;c=c|0;EO(b);return}function Pw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return c|0}function Qw(a,b,d){a=a|0;b=b|0;d=d|0;d=c[a>>2]|0;c[d+20>>2]=51;Qb[c[d>>2]&255](a);return}function Rw(a,b){a=a|0;b=b|0;return DO(b)|0}function Sw(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;c[a+4>>2]=0;if((b|0)!=90){e=c[a>>2]|0;c[e+20>>2]=13;c[e+24>>2]=90;c[(c[a>>2]|0)+28>>2]=b;Qb[c[c[a>>2]>>2]&255](a)}if((d|0)==488)b=a;else{b=c[a>>2]|0;c[b+20>>2]=22;c[b+24>>2]=488;c[(c[a>>2]|0)+28>>2]=d;Qb[c[c[a>>2]>>2]&255](a);b=a}f=c[a>>2]|0;d=a+12|0;e=c[d>>2]|0;_O(a+4|0,0,484)|0;c[a>>2]=f;c[d>>2]=e;c[a+16>>2]=1;yw(b);c[a+8>>2]=0;c[a+24>>2]=0;c[a+312>>2]=0;b=a+164|0;d=b+48|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(d|0));pw(a);Tw(a);c[a+20>>2]=200;return}function Tw(a){a=a|0;var b=0;b=Hb[c[c[a+4>>2]>>2]&63](a,0,28)|0;c[a+460>>2]=b;c[b>>2]=90;c[b+4>>2]=137;c[b+8>>2]=138;c[b+12>>2]=139;c[b+16>>2]=0;c[b+20>>2]=0;c[b+24>>2]=1;return}function Uw(a){a=a|0;var b=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,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;G=a+460|0;b=c[G>>2]|0;H=b+20|0;if(c[H>>2]|0){a=2;return a|0}I=a+464|0;K=b+24|0;L=a+340|0;F=b+16|0;l=a+32|0;m=a+212|0;n=a+28|0;o=a+36|0;p=a+316|0;q=a+320|0;r=a+216|0;s=a+220|0;t=a+224|0;u=a+324|0;v=a+328|0;w=a+428|0;x=a+432|0;y=a+436|0;z=a+416|0;A=a+332|0;C=a+412|0;D=a+420|0;E=a+424|0;a:while(1){b=Eb[c[(c[I>>2]|0)+4>>2]&127](a)|0;switch(b|0){case 2:{k=58;break a}case 1:break;default:{k=63;break a}}b:do switch(c[K>>2]|0){case 0:{if(!(c[F>>2]|0)){j=c[a>>2]|0;c[j+20>>2]=36;Qb[c[j>>2]&255](a)}if(c[L>>2]|0){k=57;break a}break}case 1:{if(!((c[l>>2]|0)<=65500?(c[n>>2]|0)<=65500:0)){j=c[a>>2]|0;c[j+20>>2]=42;c[j+24>>2]=65500;Qb[c[c[a>>2]>>2]&255](a)}b=c[m>>2]|0;if((b+-8|0)>>>0>4){j=c[a>>2]|0;c[j+20>>2]=16;c[j+24>>2]=b;Qb[c[c[a>>2]>>2]&255](a)}b=c[o>>2]|0;if((b|0)>10){j=c[a>>2]|0;c[j+20>>2]=27;c[j+24>>2]=b;c[(c[a>>2]|0)+28>>2]=10;Qb[c[c[a>>2]>>2]&255](a);b=c[o>>2]|0}c[p>>2]=1;c[q>>2]=1;if((b|0)>0){i=0;j=c[r>>2]|0;f=1;h=1;while(1){d=j+8|0;e=c[d>>2]|0;g=j+12|0;if((e+-1|0)>>>0<=3?(J=c[g>>2]|0,(J+-1|0)>>>0<=3):0)d=J;else{h=c[a>>2]|0;c[h+20>>2]=19;Qb[c[h>>2]&255](a);h=c[p>>2]|0;e=c[d>>2]|0;f=c[q>>2]|0;d=c[g>>2]|0;b=c[o>>2]|0}h=(h|0)>(e|0)?h:e;c[p>>2]=h;f=(f|0)>(d|0)?f:d;c[q>>2]=f;i=i+1|0;if((i|0)>=(b|0)){d=b;break}else j=j+88|0}}else d=b;c:do if(!(c[s>>2]|0)){if(c[t>>2]|0?c[L>>2]|0:0){k=22;break}do switch(c[z>>2]|0){case 0:{c[w>>2]=1;c[x>>2]=2576;c[y>>2]=0;b=1;break c}case 3:{c[w>>2]=2;c[x>>2]=3792;c[y>>2]=3;b=2;break c}case 8:{c[w>>2]=3;c[x>>2]=3680;c[y>>2]=8;b=3;break c}case 15:{c[w>>2]=4;c[x>>2]=3552;c[y>>2]=15;b=4;break c}case 24:{c[w>>2]=5;c[x>>2]=3376;c[y>>2]=24;b=5;break c}case 35:{c[w>>2]=6;c[x>>2]=3168;c[y>>2]=35;b=6;break c}case 48:{c[w>>2]=7;c[x>>2]=2896;c[y>>2]=48;b=7;break c}case 63:{c[w>>2]=8;c[x>>2]=2576;c[y>>2]=63;b=8;break c}case 80:{c[w>>2]=9;c[x>>2]=2576;c[y>>2]=63;b=9;break c}case 99:{c[w>>2]=10;c[x>>2]=2576;c[y>>2]=63;b=10;break c}case 120:{c[w>>2]=11;c[x>>2]=2576;c[y>>2]=63;b=11;break c}case 143:{c[w>>2]=12;c[x>>2]=2576;c[y>>2]=63;b=12;break c}case 168:{c[w>>2]=13;c[x>>2]=2576;c[y>>2]=63;b=13;break c}case 195:{c[w>>2]=14;c[x>>2]=2576;c[y>>2]=63;b=14;break c}case 224:{c[w>>2]=15;c[x>>2]=2576;c[y>>2]=63;b=15;break c}case 255:{c[w>>2]=16;c[x>>2]=2576;c[y>>2]=63;b=16;break c}default:{b=c[a>>2]|0;c[b+20>>2]=17;c[b+24>>2]=c[C>>2];c[(c[a>>2]|0)+28>>2]=c[z>>2];c[(c[a>>2]|0)+32>>2]=c[D>>2];c[(c[a>>2]|0)+36>>2]=c[E>>2];Qb[c[c[a>>2]>>2]&255](a);b=c[w>>2]|0;d=c[o>>2]|0;break c}}while(0)}else k=22;while(0);if((k|0)==22){c[w>>2]=8;c[x>>2]=2576;c[y>>2]=63;b=8}c[u>>2]=b;c[v>>2]=b;if((d|0)>0){d=0;e=c[r>>2]|0;while(1){c[e+36>>2]=b;c[e+40>>2]=b;k=e+8|0;j=B(c[k>>2]|0,c[n>>2]|0)|0;c[e+28>>2]=fw(j,B(c[p>>2]|0,b)|0)|0;b=e+12|0;j=B(c[b>>2]|0,c[l>>2]|0)|0;c[e+32>>2]=fw(j,B(c[w>>2]|0,c[q>>2]|0)|0)|0;k=B(c[k>>2]|0,c[n>>2]|0)|0;c[e+44>>2]=fw(k,c[p>>2]|0)|0;b=B(c[b>>2]|0,c[l>>2]|0)|0;c[e+48>>2]=fw(b,c[q>>2]|0)|0;c[e+52>>2]=1;c[e+80>>2]=0;b=d+1|0;if((b|0)>=(c[o>>2]|0))break;d=b;e=e+88|0;b=c[w>>2]|0}b=c[w>>2]|0}c[A>>2]=fw(c[l>>2]|0,B(b,c[q>>2]|0)|0)|0;b=c[L>>2]|0;if((b|0)>=(c[o>>2]|0)?(c[t>>2]|0)==0:0){c[(c[G>>2]|0)+16>>2]=0;k=50;break b}c[(c[G>>2]|0)+16>>2]=1;k=50;break}default:{b=c[L>>2]|0;k=50}}while(0);if((k|0)==50){k=0;if(b|0){k=52;break}c[K>>2]=2}}if((k|0)==52){c[K>>2]=0;a=1;return a|0}else if((k|0)==57){Ww(a);a=1;return a|0}else if((k|0)==58){c[H>>2]=1;if(!(c[K>>2]|0)){d=a+152|0;b=c[a+144>>2]|0;if((c[d>>2]|0)<=(b|0)){a=2;return a|0}c[d>>2]=b;a=2;return a|0}else{if(!(c[(c[I>>2]|0)+16>>2]|0)){a=2;return a|0}L=c[a>>2]|0;c[L+20>>2]=62;Qb[c[L>>2]&255](a);a=2;return a|0}}else if((k|0)==63)return b|0;return 0}function Vw(a){a=a|0;var b=0;b=c[a+460>>2]|0;c[b>>2]=90;c[b+16>>2]=0;c[b+20>>2]=0;c[b+24>>2]=1;Qb[c[(c[a>>2]|0)+16>>2]&255](a);Qb[c[c[a+464>>2]>>2]&255](a);c[a+160>>2]=0;return}function Ww(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=a+340|0;b=c[h>>2]|0;if((b|0)!=1){if((b+-1|0)>>>0>3){g=c[a>>2]|0;c[g+20>>2]=27;c[g+24>>2]=b;c[(c[a>>2]|0)+28>>2]=4;Qb[c[c[a>>2]>>2]&255](a)}f=a+428|0;c[a+360>>2]=fw(c[a+28>>2]|0,B(c[f>>2]|0,c[a+316>>2]|0)|0)|0;c[a+364>>2]=fw(c[a+32>>2]|0,B(c[f>>2]|0,c[a+320>>2]|0)|0)|0;f=a+368|0;c[f>>2]=0;if((c[h>>2]|0)<=0){g=a+468|0;g=c[g>>2]|0;g=c[g>>2]|0;Qb[g&255](a);g=a+452|0;h=c[g>>2]|0;h=c[h>>2]|0;Qb[h&255](a);g=c[g>>2]|0;g=g+4|0;g=c[g>>2]|0;h=a+460|0;h=c[h>>2]|0;c[h>>2]=g;return}d=0;e=0;while(1){g=c[a+344+(d<<2)>>2]|0;k=c[g+8>>2]|0;c[g+56>>2]=k;j=c[g+12>>2]|0;c[g+60>>2]=j;b=B(j,k)|0;c[g+64>>2]=b;c[g+68>>2]=B(c[g+36>>2]|0,k)|0;i=((c[g+28>>2]|0)>>>0)%(k>>>0)|0;c[g+72>>2]=(i|0)==0?k:i;i=((c[g+32>>2]|0)>>>0)%(j>>>0)|0;c[g+76>>2]=(i|0)==0?j:i;if((b+e|0)>10){k=c[a>>2]|0;c[k+20>>2]=14;Qb[c[k>>2]&255](a)}if((b|0)>0)while(1){k=c[f>>2]|0;c[f>>2]=k+1;c[a+372+(k<<2)>>2]=d;if((b|0)>1)b=b+-1|0;else break}d=d+1|0;b=c[h>>2]|0;if((d|0)>=(b|0))break;e=c[f>>2]|0}if((b|0)<=0){j=a+468|0;j=c[j>>2]|0;j=c[j>>2]|0;Qb[j&255](a);j=a+452|0;k=c[j>>2]|0;k=c[k>>2]|0;Qb[k&255](a);j=c[j>>2]|0;j=j+4|0;j=c[j>>2]|0;k=a+460|0;k=c[k>>2]|0;c[k>>2]=j;return}}else{b=c[a+344>>2]|0;c[a+360>>2]=c[b+28>>2];k=c[b+32>>2]|0;c[a+364>>2]=k;c[b+56>>2]=1;c[b+60>>2]=1;c[b+64>>2]=1;c[b+68>>2]=c[b+36>>2];c[b+72>>2]=1;j=c[b+12>>2]|0;k=(k>>>0)%(j>>>0)|0;c[b+76>>2]=(k|0)==0?j:k;c[a+368>>2]=1;c[a+372>>2]=0;b=1}g=a+4|0;f=0;do{d=c[a+344+(f<<2)>>2]|0;e=d+80|0;if(!(c[e>>2]|0)){d=c[d+16>>2]|0;b=a+164+(d<<2)|0;if(!(d>>>0<=3?(c[b>>2]|0)!=0:0)){k=c[a>>2]|0;c[k+20>>2]=54;c[k+24>>2]=d;Qb[c[c[a>>2]>>2]&255](a)}k=Hb[c[c[g>>2]>>2]&63](a,1,132)|0;YO(k|0,c[b>>2]|0,132)|0;c[e>>2]=k;b=c[h>>2]|0}f=f+1|0}while((f|0)<(b|0));j=a+468|0;j=c[j>>2]|0;j=c[j>>2]|0;Qb[j&255](a);j=a+452|0;k=c[j>>2]|0;k=c[k>>2]|0;Qb[k&255](a);j=c[j>>2]|0;j=j+4|0;j=c[j>>2]|0;k=a+460|0;k=c[k>>2]|0;c[k>>2]=j;return}function Xw(a){a=a|0;Qb[c[(c[a+468>>2]|0)+8>>2]&255](a);c[c[a+460>>2]>>2]=90;return}function Yw(a){a=a|0;Zw(a);return}function Zw(a){a=a|0;var b=0,d=0;b=a+4|0;d=c[b>>2]|0;if(d|0)Qb[c[d+40>>2]&255](a);c[b>>2]=0;c[a+20>>2]=0;return}function _w(a){a=a|0;var b=0;b=c[a+4>>2]|0;if(!b)return;Sb[c[b+36>>2]&63](a,1);b=a+20|0;if(!(c[a+16>>2]|0)){c[b>>2]=100;return}else{c[b>>2]=200;c[a+312>>2]=0;return}}function $w(a,b){a=a|0;b=b|0;var d=0,e=0;d=c[a+20>>2]|0;if((d&-2|0)!=200){e=c[a>>2]|0;c[e+20>>2]=21;c[e+24>>2]=d;Qb[c[c[a>>2]>>2]&255](a)}d=ax(a)|0;switch(d|0){case 1:{e=1;return e|0}case 2:{if(b){e=c[a>>2]|0;c[e+20>>2]=53;Qb[c[e>>2]&255](a)}_w(a);e=2;return e|0}default:{e=d;return e|0}}return 0}function ax(b){b=b|0;var d=0,e=0,f=0,h=0,i=0;i=b+20|0;d=c[i>>2]|0;switch(d|0){case 200:{d=b+460|0;Qb[c[(c[d>>2]|0)+4>>2]&255](b);Qb[c[(c[b+24>>2]|0)+8>>2]&255](b);c[i>>2]=201;break}case 201:{d=b+460|0;break}case 210:case 208:case 207:case 206:case 205:case 204:case 203:{i=Eb[c[c[b+460>>2]>>2]&127](b)|0;return i|0}case 202:{i=1;return i|0}default:{i=c[b>>2]|0;c[i+20>>2]=21;c[i+24>>2]=d;Qb[c[c[b>>2]>>2]&255](b);i=0;return i|0}}d=Eb[c[c[d>>2]>>2]&127](b)|0;if((d|0)!=1){i=d;return i|0}d=c[b+36>>2]|0;a:do switch(d|0){case 1:{e=d;break}case 3:{f=c[b+216>>2]|0;d=c[f>>2]|0;e=c[f+88>>2]|0;f=c[f+176>>2]|0;h=(d|0)==1;if(!(h&(e|0)==2&(f|0)==3))if(!(h&(e|0)==34&(f|0)==35))if(!((d|0)==82&(e|0)==71&(f|0)==66))if(!((d|0)==114&(e|0)==103&(f|0)==98))if(!(c[b+284>>2]|0)){if(!(c[b+296>>2]|0)){h=c[b>>2]|0;c[h+24>>2]=d;c[h+28>>2]=e;c[h+32>>2]=f;c[h+20>>2]=113;Sb[c[h+4>>2]&63](b,1);e=2;d=3;break a}d=a[b+300>>0]|0;switch(d<<24>>24){case 0:{e=2;d=2;break a}case 1:{e=2;d=3;break a}default:{e=c[b>>2]|0;c[e+20>>2]=116;c[e+24>>2]=d&255;Sb[c[(c[b>>2]|0)+4>>2]&63](b,-1);e=2;d=3;break a}}}else{e=2;d=3}else{e=2;d=6}else{e=2;d=2}else{e=2;d=7}else{e=2;d=3}break}case 4:{if(!(c[b+296>>2]|0)){e=4;d=4}else{d=a[b+300>>0]|0;switch(d<<24>>24){case 0:{e=4;d=4;break a}case 2:{e=4;d=5;break a}default:{e=c[b>>2]|0;c[e+20>>2]=116;c[e+24>>2]=d&255;Sb[c[(c[b>>2]|0)+4>>2]&63](b,-1);e=4;d=5;break a}}}break}default:{e=0;d=0}}while(0);c[b+40>>2]=d;c[b+44>>2]=e;h=c[b+428>>2]|0;c[b+48>>2]=h;c[b+52>>2]=h;g[b+56>>3]=1.0;c[b+64>>2]=0;c[b+68>>2]=0;c[b+72>>2]=0;c[b+76>>2]=1;c[b+80>>2]=1;c[b+84>>2]=0;c[b+88>>2]=2;c[b+92>>2]=1;c[b+96>>2]=256;c[b+136>>2]=0;c[b+100>>2]=0;c[b+104>>2]=0;c[b+108>>2]=0;c[i>>2]=202;i=1;return i|0}function bx(a){a=a|0;var b=0,d=0,e=0;b=a+20|0;d=c[b>>2]|0;if((d+-205|0)>>>0<2?(c[a+64>>2]|0)==0:0){if((c[a+140>>2]|0)>>>0<(c[a+116>>2]|0)>>>0){d=c[a>>2]|0;c[d+20>>2]=69;Qb[c[d>>2]&255](a)}Qb[c[(c[a+444>>2]|0)+4>>2]&255](a);c[b>>2]=210}else e=6;a:do if((e|0)==6)switch(d|0){case 210:break a;case 207:{c[b>>2]=210;break a}default:{e=c[a>>2]|0;c[e+20>>2]=21;c[e+24>>2]=d;Qb[c[c[a>>2]>>2]&255](a);break a}}while(0);d=a+460|0;b=c[d>>2]|0;b:do if(!(c[b+20>>2]|0)){while(1){if(!(Eb[c[b>>2]&127](a)|0)){b=0;break}b=c[d>>2]|0;if(c[b+20>>2]|0)break b}return b|0}while(0);Qb[c[(c[a+24>>2]|0)+24>>2]&255](a);_w(a);a=1;return a|0}function cx(a){a=a|0;c[a>>2]=140;c[a+4>>2]=53;c[a+8>>2]=141;c[a+12>>2]=54;c[a+16>>2]=142;c[a+104>>2]=0;c[a+108>>2]=0;c[a+20>>2]=0;c[a+112>>2]=2064;c[a+116>>2]=126;c[a+120>>2]=0;c[a+124>>2]=0;c[a+128>>2]=0;return a|0}function dx(a){a=a|0;Qb[c[(c[a>>2]|0)+8>>2]&255](a);Zw(a);Ea(1)}function ex(a,b){a=a|0;b=b|0;var d=0,e=0;d=c[a>>2]|0;if((b|0)>=0){if((c[d+104>>2]|0)<(b|0))return;Qb[c[d+8>>2]&255](a);return}e=d+108|0;b=c[e>>2]|0;if(!((b|0)!=0?(c[d+104>>2]|0)<=2:0)){Qb[c[d+8>>2]&255](a);b=c[e>>2]|0}c[e>>2]=b+1;return}function fx(a){a=a|0;var b=0,d=0,e=0;b=yb;yb=yb+208|0;d=b+200|0;e=b;Sb[c[(c[a>>2]|0)+12>>2]&63](a,e);a=c[4001]|0;c[d>>2]=e;Jz(a,46655,d)|0;yb=b;return}function gx(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;k=yb;yb=yb+48|0;j=k+8|0;i=k;h=c[b>>2]|0;f=c[h+20>>2]|0;if((f|0)>0?(f|0)<=(c[h+116>>2]|0):0){b=(c[h+112>>2]|0)+(f<<2)|0;g=8}else{b=c[h+120>>2]|0;if(((b|0)!=0?(e=c[h+124>>2]|0,(f|0)>=(e|0)):0)?(f|0)<=(c[h+128>>2]|0):0){b=b+(f-e<<2)|0;g=8}else g=9}if((g|0)==8){b=c[b>>2]|0;if(!b)g=9}if((g|0)==9){c[h+24>>2]=f;b=c[c[h+112>>2]>>2]|0}e=b;a:while(1){f=e+1|0;switch(a[e>>0]|0){case 0:break a;case 37:{g=12;break a}default:e=f}}if((g|0)==12?(a[f>>0]|0)==115:0){c[i>>2]=h+24;Fx(d,b,i)|0;yb=k;return}n=c[h+28>>2]|0;m=c[h+32>>2]|0;l=c[h+36>>2]|0;e=c[h+40>>2]|0;f=c[h+44>>2]|0;g=c[h+48>>2]|0;i=c[h+52>>2]|0;c[j>>2]=c[h+24>>2];c[j+4>>2]=n;c[j+8>>2]=m;c[j+12>>2]=l;c[j+16>>2]=e;c[j+20>>2]=f;c[j+24>>2]=g;c[j+28>>2]=i;Fx(d,b,j)|0;yb=k;return}function hx(a){a=a|0;a=c[a>>2]|0;c[a+108>>2]=0;c[a+20>>2]=0;return}function ix(a){a=a|0;return (aa(nx(c[a+60>>2]|0)|0)|0)&65535|0}function jx(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;l=yb;yb=yb+32|0;h=l;i=l+16|0;j=a+28|0;f=c[j>>2]|0;c[h>>2]=f;k=a+20|0;f=(c[k>>2]|0)-f|0;c[h+4>>2]=f;c[h+8>>2]=b;c[h+12>>2]=d;e=a+60|0;g=2;b=f+d|0;while(1){if(!(lx(da(c[e>>2]|0,h|0,g|0,i|0)|0)|0))f=c[i>>2]|0;else{c[i>>2]=-1;f=-1}if((b|0)==(f|0)){b=6;break}if((f|0)<0){b=8;break}p=c[h+4>>2]|0;n=f>>>0>p>>>0;m=n?h+8|0:h;p=f-(n?p:0)|0;c[m>>2]=(c[m>>2]|0)+p;o=m+4|0;c[o>>2]=(c[o>>2]|0)-p;g=g+(n<<31>>31)|0;b=b-f|0;h=m}if((b|0)==6){p=c[a+44>>2]|0;c[a+16>>2]=p+(c[a+48>>2]|0);c[j>>2]=p;c[k>>2]=p}else if((b|0)==8){c[a+16>>2]=0;c[j>>2]=0;c[k>>2]=0;c[a>>2]=c[a>>2]|32;if((g|0)==2)d=0;else d=d-(c[h+4>>2]|0)|0}yb=l;return d|0}function kx(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=yb;yb=yb+16|0;f=g;if(!(lx(ca(c[a+60>>2]|0,b|0,d|0,e&255|0,f|0)|0)|0)){b=f;a=c[b+4>>2]|0;b=c[b>>2]|0}else{a=f;c[a>>2]=-1;c[a+4>>2]=-1;a=-1;b=-1}E(a|0);yb=g;return b|0}function lx(a){a=a|0;if(!(a<<16>>16))a=0;else{c[(mx()|0)>>2]=a&65535;a=-1}return a|0}function mx(){return 55620}function nx(a){a=a|0;return a|0}function ox(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;l=yb;yb=yb+32|0;i=l;f=l+16|0;c[i>>2]=d;g=i+4|0;j=b+48|0;m=c[j>>2]|0;c[g>>2]=e-((m|0)!=0&1);h=b+44|0;c[i+8>>2]=c[h>>2];c[i+12>>2]=m;if(!(lx(ba(c[b+60>>2]|0,i|0,2,f|0)|0)|0)){f=c[f>>2]|0;if((f|0)>=1){i=c[g>>2]|0;if(f>>>0>i>>>0){g=c[h>>2]|0;h=b+4|0;c[h>>2]=g;c[b+8>>2]=g+(f-i);if(!(c[j>>2]|0))f=e;else{c[h>>2]=g+1;a[d+(e+-1)>>0]=a[g>>0]|0;f=e}}}else k=4}else{c[f>>2]=-1;f=-1;k=4}if((k|0)==4)c[b>>2]=f&48^16|c[b>>2];yb=l;return f|0}function px(a){a=a|0;return 0}function qx(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;E(0);return 0}function rx(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;d=sx(a,b,c)|0;E(F()|0);return d|0}function sx(a,b,c){a=a|0;b=b|0;c=c|0;c=tx(a,b,c,-1,-1)|0;E(F()|0);return c|0}function tx(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;j=yb;yb=yb+144|0;h=j;c[h>>2]=0;i=h+4|0;c[i>>2]=a;c[h+44>>2]=a;g=h+8|0;c[g>>2]=(a|0)<0?-1:a+2147483647|0;c[h+76>>2]=-1;ux(h,0,0);d=vx(h,d,1,e,f)|0;e=F()|0;if(b|0)c[b>>2]=a+((c[i>>2]|0)+(c[h+120>>2]|0)-(c[g>>2]|0));E(e|0);yb=j;return d|0}function ux(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;f=a+112|0;c[f>>2]=b;c[f+4>>2]=d;f=c[a+8>>2]|0;e=c[a+4>>2]|0;g=f-e|0;h=((g|0)<0)<<31>>31;i=a+120|0;c[i>>2]=g;c[i+4>>2]=h;if(((b|0)!=0|(d|0)!=0)&((h|0)>(d|0)|(h|0)==(d|0)&g>>>0>b>>>0))c[a+104>>2]=e+b;else c[a+104>>2]=f;return}function vx(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;a:do if(e>>>0>36){c[(mx()|0)>>2]=28;h=0;g=0}else{r=b+4|0;q=b+104|0;do{i=c[r>>2]|0;if(i>>>0<(c[q>>2]|0)>>>0){c[r>>2]=i+1;i=d[i>>0]|0}else i=wx(b)|0}while((xx(i)|0)!=0);b:do switch(i|0){case 43:case 45:{i=((i|0)==45)<<31>>31;j=c[r>>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;p=i;i=d[j>>0]|0;break b}else{p=i;i=wx(b)|0;break b}}default:p=0}while(0);j=(e|0)==0;do if((e|16|0)==16&(i|0)==48){i=c[r>>2]|0;if(i>>>0<(c[q>>2]|0)>>>0){c[r>>2]=i+1;i=d[i>>0]|0}else i=wx(b)|0;if((i|32|0)!=120)if(j){o=8;n=47;break}else{n=32;break}i=c[r>>2]|0;if(i>>>0<(c[q>>2]|0)>>>0){c[r>>2]=i+1;i=d[i>>0]|0}else i=wx(b)|0;if((d[5937+i>>0]|0)>15){g=(c[q>>2]|0)==0;if(!g)c[r>>2]=(c[r>>2]|0)+-1;if(!f){ux(b,0,0);h=0;g=0;break a}if(g){h=0;g=0;break a}c[r>>2]=(c[r>>2]|0)+-1;h=0;g=0;break a}else{o=16;n=47}}else{e=j?10:e;if(e>>>0>(d[5937+i>>0]|0)>>>0)n=32;else{if(c[q>>2]|0)c[r>>2]=(c[r>>2]|0)+-1;ux(b,0,0);c[(mx()|0)>>2]=28;h=0;g=0;break a}}while(0);c:do if((n|0)==32)if((e|0)==10){e=i+-48|0;if(e>>>0<10){i=0;do{i=(i*10|0)+e|0;e=c[r>>2]|0;if(e>>>0<(c[q>>2]|0)>>>0){c[r>>2]=e+1;j=d[e>>0]|0}else j=wx(b)|0;e=j+-48|0}while(e>>>0<10&i>>>0<429496729);if(e>>>0<10){m=0;do{f=LO(i|0,m|0,10,0)|0;k=F()|0;l=((e|0)<0)<<31>>31;o=~l;if(k>>>0>o>>>0|(k|0)==(o|0)&f>>>0>~e>>>0){f=10;e=m;n=76;break c}i=MO(f|0,k|0,e|0,l|0)|0;m=F()|0;e=c[r>>2]|0;if(e>>>0<(c[q>>2]|0)>>>0){c[r>>2]=e+1;j=d[e>>0]|0}else j=wx(b)|0;e=j+-48|0}while(e>>>0<10&(m>>>0<429496729|(m|0)==429496729&i>>>0<2576980378));if(e>>>0>9){j=p;e=m}else{f=10;e=m;n=76}}else{j=p;e=0}}else{j=p;e=0;i=0}}else{o=e;n=47}while(0);d:do if((n|0)==47){if(!(o+-1&o)){n=a[46659+((o*23|0)>>>5&7)>>0]|0;f=a[5937+i>>0]|0;e=f&255;if(o>>>0>e>>>0){i=0;do{i=e|i<>2]|0;if(e>>>0<(c[q>>2]|0)>>>0){c[r>>2]=e+1;j=d[e>>0]|0}else j=wx(b)|0;f=a[5937+j>>0]|0;e=f&255}while(i>>>0<134217728&o>>>0>e>>>0);k=e;e=0}else{j=i;k=e;e=0;i=0}l=RO(-1,-1,n|0)|0;m=F()|0;if(o>>>0<=k>>>0|(m>>>0>>0|(m|0)==(e|0)&l>>>0>>0)){f=o;n=76;break}while(1){i=SO(i|0,e|0,n|0)|0;e=F()|0;i=i|f&255;j=c[r>>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;j=d[j>>0]|0}else j=wx(b)|0;f=a[5937+j>>0]|0;if(o>>>0<=(f&255)>>>0|(e>>>0>m>>>0|(e|0)==(m|0)&i>>>0>l>>>0)){f=o;n=76;break d}}}e=a[5937+i>>0]|0;f=e&255;if(o>>>0>f>>>0){i=0;do{i=f+(B(i,o)|0)|0;e=c[r>>2]|0;if(e>>>0<(c[q>>2]|0)>>>0){c[r>>2]=e+1;j=d[e>>0]|0}else j=wx(b)|0;e=a[5937+j>>0]|0;f=e&255}while(i>>>0<119304647&o>>>0>f>>>0);k=e;e=0}else{j=i;k=e;i=0;e=0}if(o>>>0>f>>>0){m=QO(-1,-1,o|0,0)|0;n=F()|0;f=k;while(1){if(e>>>0>n>>>0|(e|0)==(n|0)&i>>>0>m>>>0){f=o;n=76;break d}k=LO(i|0,e|0,o|0,0)|0;l=F()|0;f=f&255;if(l>>>0>4294967295|(l|0)==-1&k>>>0>~f>>>0){f=o;n=76;break d}i=MO(k|0,l|0,f|0,0)|0;e=F()|0;j=c[r>>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;j=d[j>>0]|0}else j=wx(b)|0;f=a[5937+j>>0]|0;if(o>>>0<=(f&255)>>>0){f=o;n=76;break}}}else{f=o;n=76}}while(0);if((n|0)==76)if(f>>>0>(d[5937+j>>0]|0)>>>0){do{i=c[r>>2]|0;if(i>>>0<(c[q>>2]|0)>>>0){c[r>>2]=i+1;i=d[i>>0]|0}else i=wx(b)|0}while(f>>>0>(d[5937+i>>0]|0)>>>0);c[(mx()|0)>>2]=68;j=(g&1|0)==0&0==0?p:0;e=h;i=g}else j=p;if(c[q>>2]|0)c[r>>2]=(c[r>>2]|0)+-1;if(!(e>>>0>>0|(e|0)==(h|0)&i>>>0>>0)){if(!((g&1|0)!=0|0!=0|(j|0)!=0)){c[(mx()|0)>>2]=68;g=MO(g|0,h|0,-1,-1)|0;h=F()|0;break}if(e>>>0>h>>>0|(e|0)==(h|0)&i>>>0>g>>>0){c[(mx()|0)>>2]=68;break}}g=((j|0)<0)<<31>>31;g=NO(i^j|0,e^g|0,j|0,g|0)|0;h=F()|0}while(0);E(h|0);return g|0}function wx(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;g=b+112|0;f=g;e=c[f>>2]|0;f=c[f+4>>2]|0;if(!((e|0)==0&(f|0)==0)?(i=b+120|0,h=c[i+4>>2]|0,!((h|0)<(f|0)|((h|0)==(f|0)?(c[i>>2]|0)>>>0>>0:0))):0)j=4;else{e=yx(b)|0;if((e|0)>=0){f=c[g>>2]|0;g=c[g+4>>2]|0;i=c[b+8>>2]|0;if(!((f|0)==0&(g|0)==0)){h=c[b+4>>2]|0;k=i-h|0;l=((k|0)<0)<<31>>31;m=b+120|0;f=NO(f|0,g|0,c[m>>2]|0,c[m+4>>2]|0)|0;m=F()|0;g=i;if((m|0)>(l|0)|(m|0)==(l|0)&f>>>0>k>>>0)j=9;else c[b+104>>2]=h+(f+-1)}else{g=i;j=9}if((j|0)==9)c[b+104>>2]=i;f=b+4|0;if(!g)f=c[f>>2]|0;else{f=c[f>>2]|0;k=g+1-f|0;m=b+120|0;l=m;k=MO(c[l>>2]|0,c[l+4>>2]|0,k|0,((k|0)<0)<<31>>31|0)|0;l=F()|0;c[m>>2]=k;c[m+4>>2]=l}f=f+-1|0;if((e|0)!=(d[f>>0]|0|0))a[f>>0]=e}else j=4}if((j|0)==4){c[b+104>>2]=0;e=-1}return e|0}function xx(a){a=a|0;return ((a|0)==32|(a+-9|0)>>>0<5)&1|0}function yx(a){a=a|0;var b=0,e=0;e=yb;yb=yb+16|0;b=e;if((zx(a)|0)==0?(Hb[c[a+32>>2]&63](a,b,1)|0)==1:0)a=d[b>>0]|0;else a=-1;yb=e;return a|0}function zx(b){b=b|0;var d=0,e=0;d=b+74|0;e=a[d>>0]|0;a[d>>0]=e+255|e;d=b+20|0;e=b+28|0;if((c[d>>2]|0)>>>0>(c[e>>2]|0)>>>0)Hb[c[b+36>>2]&63](b,0,0)|0;c[b+16>>2]=0;c[e>>2]=0;c[d>>2]=0;d=c[b>>2]|0;if(!(d&4)){e=(c[b+44>>2]|0)+(c[b+48>>2]|0)|0;c[b+8>>2]=e;c[b+4>>2]=e;d=d<<27>>31}else{c[b>>2]=d|32;d=-1}return d|0}function Ax(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;d=Bx(a,b,c)|0;E(F()|0);return d|0}function Bx(a,b,c){a=a|0;b=b|0;c=c|0;c=tx(a,b,c,0,-2147483648)|0;E(F()|0);return c|0}function Cx(a,b){a=+a;b=+b;var d=0,e=0;g[h>>3]=a;e=c[h>>2]|0;d=c[h+4>>2]|0;g[h>>3]=b;d=c[h+4>>2]&-2147483648|d&2147483647;c[h>>2]=e;c[h+4>>2]=d;return +(+g[h>>3])}function Dx(b,c){b=b|0;c=c|0;var d=0,e=0;d=a[b>>0]|0;e=a[c>>0]|0;if(d<<24>>24==0?1:d<<24>>24!=e<<24>>24)b=e;else{do{b=b+1|0;c=c+1|0;d=a[b>>0]|0;e=a[c>>0]|0}while(!(d<<24>>24==0?1:d<<24>>24!=e<<24>>24));b=e}return (d&255)-(b&255)|0}function Ex(a){a=a|0;return (a+-48|0)>>>0<10|0}function Fx(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=yb;yb=yb+16|0;f=e;c[f>>2]=d;d=Gx(a,b,f)|0;yb=e;return d|0}function Gx(a,b,c){a=a|0;b=b|0;c=c|0;return Hx(a,2147483647,b,c)|0}function Hx(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;j=yb;yb=yb+160|0;g=j+144|0;i=j;YO(i|0,13736,144)|0;if((d+-1|0)>>>0>2147483646)if(!d){b=g;d=1;h=4}else{c[(mx()|0)>>2]=61;d=-1}else h=4;if((h|0)==4){h=-2-b|0;h=d>>>0>h>>>0?h:d;c[i+48>>2]=h;g=i+20|0;c[g>>2]=b;c[i+44>>2]=b;d=b+h|0;b=i+16|0;c[b>>2]=d;c[i+28>>2]=d;d=Ix(i,e,f)|0;if(h){i=c[g>>2]|0;a[i+(((i|0)==(c[b>>2]|0))<<31>>31)>>0]=0}}yb=j;return d|0}function Ix(a,b,c){a=a|0;b=b|0;c=c|0;return Lx(a,b,c,1,55)|0}function Jx(b,e,f,g,h,i){b=b|0;e=+e;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,C=0,D=0,E=0,G=0,H=0;H=yb;yb=yb+560|0;l=H+32|0;u=H+536|0;G=H;E=G;m=H+540|0;c[u>>2]=0;D=m+12|0;by(e)|0;j=F()|0;if((j|0)<0){e=-e;by(e)|0;C=1;A=46685;j=F()|0}else{C=(h&2049|0)!=0&1;A=(h&2048|0)==0?((h&1|0)==0?46686:46691):46688}do if(0==0&(j&2146435072|0)==2146435072){G=(i&32|0)!=0;j=C+3|0;Wx(b,32,f,j,h&-65537);Px(b,A,C);Px(b,e!=e|0.0!=0.0?(G?46727:46712):G?46704:46708,3);Wx(b,32,f,j,h^8192)}else{q=+cy(e,u)*2.0;j=q!=0.0;if(j)c[u>>2]=(c[u>>2]|0)+-1;t=i|32;if((t|0)==97){o=i&32;r=(o|0)==0?A:A+9|0;p=C|2;j=12-g|0;do if(!(g>>>0>11|(j|0)==0)){e=8.0;do{j=j+-1|0;e=e*16.0}while((j|0)!=0);if((a[r>>0]|0)==45){e=-(e+(-q-e));break}else{e=q+e-e;break}}else e=q;while(0);k=c[u>>2]|0;j=(k|0)<0?0-k|0:k;j=Ux(j,((j|0)<0)<<31>>31,D)|0;if((j|0)==(D|0)){j=m+11|0;a[j>>0]=48}a[j+-1>>0]=(k>>31&2)+43;n=j+-2|0;a[n>>0]=i+15;k=(g|0)<1;l=(h&8|0)==0;m=G;do{C=~~e;j=m+1|0;a[m>>0]=o|d[6672+C>>0];e=(e-+(C|0))*16.0;if((j-E|0)==1?!(l&(k&e==0.0)):0){a[j>>0]=46;m=m+2|0}else m=j}while(e!=0.0);if((g|0)!=0?(-2-E+m|0)<(g|0):0){k=D;l=n;j=g+2+k-l|0}else{k=D;l=n;j=k-E-l+m|0}D=j+p|0;Wx(b,32,f,D,h);Px(b,r,p);Wx(b,48,f,D,h^65536);E=m-E|0;Px(b,G,E);G=k-l|0;Wx(b,48,j-(E+G)|0,0,0);Px(b,n,G);Wx(b,32,f,D,h^8192);j=D;break}k=(g|0)<0?6:g;if(j){j=(c[u>>2]|0)+-28|0;c[u>>2]=j;e=q*268435456.0}else{e=q;j=c[u>>2]|0}z=(j|0)<0?l:l+288|0;l=z;do{x=~~e>>>0;c[l>>2]=x;l=l+4|0;e=(e-+(x>>>0))*1.0e9}while(e!=0.0);x=z;if((j|0)>0){o=z;while(1){n=(j|0)<29?j:29;j=l+-4|0;if(j>>>0>=o>>>0){m=0;do{s=SO(c[j>>2]|0,0,n|0)|0;s=MO(s|0,F()|0,m|0,0)|0;v=F()|0;m=QO(s|0,v|0,1e9,0)|0;w=LO(m|0,F()|0,1e9,0)|0;w=NO(s|0,v|0,w|0,F()|0)|0;F()|0;c[j>>2]=w;j=j+-4|0}while(j>>>0>=o>>>0);if(m){w=o+-4|0;c[w>>2]=m;m=w}else m=o}else m=o;a:do if(l>>>0>m>>>0){j=l;while(1){l=j+-4|0;if(c[l>>2]|0){l=j;break a}if(l>>>0>m>>>0)j=l;else break}}while(0);j=(c[u>>2]|0)-n|0;c[u>>2]=j;if((j|0)>0)o=m;else break}}else m=z;if((j|0)<0){g=((k+25|0)/9|0)+1|0;s=(t|0)==102;do{r=0-j|0;r=(r|0)<9?r:9;if(m>>>0>>0){n=(1<>>r;p=0;j=m;do{w=c[j>>2]|0;c[j>>2]=(w>>>r)+p;p=B(w&n,o)|0;j=j+4|0}while(j>>>0>>0);m=(c[m>>2]|0)==0?m+4|0:m;if(p){c[l>>2]=p;l=l+4|0}}else m=(c[m>>2]|0)==0?m+4|0:m;j=s?z:m;l=(l-j>>2|0)>(g|0)?j+(g<<2)|0:l;j=(c[u>>2]|0)+r|0;c[u>>2]=j}while((j|0)<0);s=m}else s=m;if(s>>>0>>0){j=(x-s>>2)*9|0;n=c[s>>2]|0;if(n>>>0>=10){m=10;do{m=m*10|0;j=j+1|0}while(n>>>0>=m>>>0)}}else j=0;v=(t|0)==103;w=(k|0)!=0;m=k-((t|0)==102?0:j)+((w&v)<<31>>31)|0;if((m|0)<(((l-x>>2)*9|0)+-9|0)){u=m+9216|0;m=(u|0)/9|0;g=z+4+(m+-1024<<2)|0;m=u-(m*9|0)|0;if((m|0)<8){n=10;while(1){n=n*10|0;if((m|0)<7)m=m+1|0;else break}}else n=10;p=c[g>>2]|0;m=(p>>>0)/(n>>>0)|0;r=p-(B(m,n)|0)|0;o=(g+4|0)==(l|0);if(!(o&(r|0)==0)){q=(m&1|0)==0?9007199254740992.0:9007199254740994.0;u=n>>>1;e=r>>>0>>0?.5:o&(r|0)==(u|0)?1.0:1.5;if(C){u=(a[A>>0]|0)==45;e=u?-e:e;q=u?-q:q}m=p-r|0;c[g>>2]=m;if(q+e!=q){u=m+n|0;c[g>>2]=u;if(u>>>0>999999999){n=g;j=s;while(1){m=n+-4|0;c[n>>2]=0;if(m>>>0>>0){j=j+-4|0;c[j>>2]=0}u=(c[m>>2]|0)+1|0;c[m>>2]=u;if(u>>>0>999999999)n=m;else{n=j;break}}}else{m=g;n=s}j=(x-n>>2)*9|0;p=c[n>>2]|0;if(p>>>0>=10){o=10;do{o=o*10|0;j=j+1|0}while(p>>>0>=o>>>0)}}else{m=g;n=s}}else{m=g;n=s}u=m+4|0;l=l>>>0>u>>>0?u:l}else n=s;g=0-j|0;b:do if(l>>>0>n>>>0)while(1){m=l+-4|0;if(c[m>>2]|0){u=l;t=1;break b}if(m>>>0>n>>>0)l=m;else{u=m;t=0;break}}else{u=l;t=0}while(0);do if(v){k=k+((w^1)&1)|0;if((k|0)>(j|0)&(j|0)>-5){o=i+-1|0;k=k+-1-j|0}else{o=i+-2|0;k=k+-1|0}if(!(h&8)){if(t?(y=c[u+-4>>2]|0,(y|0)!=0):0)if(!((y>>>0)%10|0)){m=0;l=10;do{l=l*10|0;m=m+1|0}while(!((y>>>0)%(l>>>0)|0|0))}else m=0;else m=9;l=((u-x>>2)*9|0)+-9|0;if((o|32|0)==102){i=l-m|0;i=(i|0)>0?i:0;k=(k|0)<(i|0)?k:i;break}else{i=l+j-m|0;i=(i|0)>0?i:0;k=(k|0)<(i|0)?k:i;break}}}else o=i;while(0);s=(k|0)!=0;p=s?1:h>>>3&1;r=(o|32|0)==102;if(r){v=0;j=(j|0)>0?j:0}else{l=(j|0)<0?g:j;l=Ux(l,((l|0)<0)<<31>>31,D)|0;m=D;if((m-l|0)<2)do{l=l+-1|0;a[l>>0]=48}while((m-l|0)<2);a[l+-1>>0]=(j>>31&2)+43;j=l+-2|0;a[j>>0]=o;v=j;j=m-j|0}j=C+1+k+p+j|0;Wx(b,32,f,j,h);Px(b,A,C);Wx(b,48,f,j,h^65536);if(r){p=n>>>0>z>>>0?z:n;r=G+9|0;n=r;o=G+8|0;m=p;do{l=Ux(c[m>>2]|0,0,r)|0;if((m|0)==(p|0)){if((l|0)==(r|0)){a[o>>0]=48;l=o}}else if(l>>>0>G>>>0){_O(G|0,48,l-E|0)|0;do l=l+-1|0;while(l>>>0>G>>>0)}Px(b,l,n-l|0);m=m+4|0}while(m>>>0<=z>>>0);if(!((h&8|0)==0&(s^1)))Px(b,46716,1);if(m>>>0>>0&(k|0)>0)while(1){l=Ux(c[m>>2]|0,0,r)|0;if(l>>>0>G>>>0){_O(G|0,48,l-E|0)|0;do l=l+-1|0;while(l>>>0>G>>>0)}Px(b,l,(k|0)<9?k:9);m=m+4|0;l=k+-9|0;if(!(m>>>0>>0&(k|0)>9)){k=l;break}else k=l}Wx(b,48,k+9|0,9,0)}else{u=t?u:n+4|0;if(n>>>0>>0&(k|0)>-1){g=G+9|0;s=(h&8|0)==0;t=g;p=0-E|0;r=G+8|0;o=n;do{l=Ux(c[o>>2]|0,0,g)|0;if((l|0)==(g|0)){a[r>>0]=48;l=r}do if((o|0)==(n|0)){m=l+1|0;Px(b,l,1);if(s&(k|0)<1){l=m;break}Px(b,46716,1);l=m}else{if(l>>>0<=G>>>0)break;_O(G|0,48,l+p|0)|0;do l=l+-1|0;while(l>>>0>G>>>0)}while(0);E=t-l|0;Px(b,l,(k|0)>(E|0)?E:k);k=k-E|0;o=o+4|0}while(o>>>0>>0&(k|0)>-1)}Wx(b,48,k+18|0,18,0);Px(b,v,D-v|0)}Wx(b,32,f,j,h^8192)}while(0);yb=H;return ((j|0)<(f|0)?f:j)|0}function Kx(a,b){a=a|0;b=b|0;var d=0.0,e=0;e=(c[b>>2]|0)+(8-1)&~(8-1);d=+g[e>>3];c[b>>2]=e+8;g[a>>3]=d;return}function Lx(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var 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;t=yb;yb=yb+224|0;p=t+208|0;q=t+160|0;r=t+80|0;s=t;h=q;i=h+40|0;do{c[h>>2]=0;h=h+4|0}while((h|0)<(i|0));c[p>>2]=c[e>>2];if((Mx(0,d,p,r,q,f,g)|0)<0)e=-1;else{if((c[b+76>>2]|0)>-1)o=Nx(b)|0;else o=0;e=c[b>>2]|0;n=e&32;if((a[b+74>>0]|0)<1)c[b>>2]=e&-33;h=b+48|0;if(!(c[h>>2]|0)){i=b+44|0;j=c[i>>2]|0;c[i>>2]=s;k=b+28|0;c[k>>2]=s;l=b+20|0;c[l>>2]=s;c[h>>2]=80;m=b+16|0;c[m>>2]=s+80;e=Mx(b,d,p,r,q,f,g)|0;if(j){Hb[c[b+36>>2]&63](b,0,0)|0;e=(c[l>>2]|0)==0?-1:e;c[i>>2]=j;c[h>>2]=0;c[m>>2]=0;c[k>>2]=0;c[l>>2]=0}}else e=Mx(b,d,p,r,q,f,g)|0;h=c[b>>2]|0;c[b>>2]=h|n;if(o|0)Ox(b);e=(h&32|0)==0?e:-1}yb=t;return e|0}function Mx(d,e,f,h,i,j,k){d=d|0;e=e|0;f=f|0;h=h|0;i=i|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,G=0,H=0,I=0,J=0,K=0;J=yb;yb=yb+64|0;G=J+56|0;I=J+40|0;A=J;C=J+48|0;D=J+60|0;c[G>>2]=e;x=(d|0)!=0;y=A+40|0;z=y;A=A+39|0;B=C+4|0;l=0;e=0;n=0;a:while(1){do{do if((e|0)>-1)if((l|0)>(2147483647-e|0)){c[(mx()|0)>>2]=61;e=-1;break}else{e=l+e|0;break}while(0);r=c[G>>2]|0;l=a[r>>0]|0;if(!(l<<24>>24)){w=92;break a}m=r;b:while(1){switch(l<<24>>24){case 37:{w=10;break b}case 0:{l=m;break b}default:{}}v=m+1|0;c[G>>2]=v;l=a[v>>0]|0;m=v}c:do if((w|0)==10){w=0;l=m;do{if((a[m+1>>0]|0)!=37)break c;l=l+1|0;m=m+2|0;c[G>>2]=m}while((a[m>>0]|0)==37)}while(0);l=l-r|0;if(x)Px(d,r,l)}while((l|0)!=0);v=(Ex(a[(c[G>>2]|0)+1>>0]|0)|0)==0;m=c[G>>2]|0;if(!v?(a[m+2>>0]|0)==36:0){t=(a[m+1>>0]|0)+-48|0;p=1;l=3}else{t=-1;p=n;l=1}l=m+l|0;c[G>>2]=l;m=a[l>>0]|0;n=(m<<24>>24)+-32|0;if(n>>>0>31|(1<>2]=l;m=a[l>>0]|0;n=(m<<24>>24)+-32|0}while(!(n>>>0>31|(1<>24==42){if((Ex(a[l+1>>0]|0)|0)!=0?(H=c[G>>2]|0,(a[H+2>>0]|0)==36):0){l=H+1|0;c[i+((a[l>>0]|0)+-48<<2)>>2]=10;l=c[h+((a[l>>0]|0)+-48<<3)>>2]|0;n=1;m=H+3|0}else{if(p|0){e=-1;break}if(x){v=(c[f>>2]|0)+(4-1)&~(4-1);l=c[v>>2]|0;c[f>>2]=v+4}else l=0;n=0;m=(c[G>>2]|0)+1|0}c[G>>2]=m;v=(l|0)<0;u=v?0-l|0:l;o=v?o|8192:o;v=n}else{l=Qx(G)|0;if((l|0)<0){e=-1;break}u=l;v=p;m=c[G>>2]|0}do if((a[m>>0]|0)==46){l=m+1|0;if((a[l>>0]|0)!=42){c[G>>2]=l;l=Qx(G)|0;m=c[G>>2]|0;break}if(Ex(a[m+2>>0]|0)|0?(E=c[G>>2]|0,(a[E+3>>0]|0)==36):0){l=E+2|0;c[i+((a[l>>0]|0)+-48<<2)>>2]=10;l=c[h+((a[l>>0]|0)+-48<<3)>>2]|0;m=E+4|0;c[G>>2]=m;break}if(v|0){e=-1;break a}if(x){s=(c[f>>2]|0)+(4-1)&~(4-1);l=c[s>>2]|0;c[f>>2]=s+4}else l=0;m=(c[G>>2]|0)+2|0;c[G>>2]=m}else l=-1;while(0);s=0;while(1){if(((a[m>>0]|0)+-65|0)>>>0>57){e=-1;break a}n=m;m=m+1|0;c[G>>2]=m;n=a[(a[n>>0]|0)+-65+(6208+(s*58|0))>>0]|0;p=n&255;if((p+-1|0)>>>0>=8)break;else s=p}if(!(n<<24>>24)){e=-1;break}q=(t|0)>-1;do if(n<<24>>24==19)if(q){e=-1;break a}else w=54;else{if(q){c[i+(t<<2)>>2]=p;q=h+(t<<3)|0;t=c[q+4>>2]|0;w=I;c[w>>2]=c[q>>2];c[w+4>>2]=t;w=54;break}if(!x){e=0;break a}Rx(I,p,f,k);m=c[G>>2]|0;w=55}while(0);if((w|0)==54){w=0;if(x)w=55;else l=0}d:do if((w|0)==55){w=0;m=a[m+-1>>0]|0;m=(s|0)!=0&(m&15|0)==3?m&-33:m;n=o&-65537;t=(o&8192|0)==0?o:n;e:do switch(m|0){case 110:switch((s&255)<<24>>24){case 0:{c[c[I>>2]>>2]=e;l=0;break d}case 1:{c[c[I>>2]>>2]=e;l=0;break d}case 2:{l=c[I>>2]|0;c[l>>2]=e;c[l+4>>2]=((e|0)<0)<<31>>31;l=0;break d}case 3:{b[c[I>>2]>>1]=e;l=0;break d}case 4:{a[c[I>>2]>>0]=e;l=0;break d}case 6:{c[c[I>>2]>>2]=e;l=0;break d}case 7:{l=c[I>>2]|0;c[l>>2]=e;c[l+4>>2]=((e|0)<0)<<31>>31;l=0;break d}default:{l=0;break d}}case 112:{m=120;l=l>>>0>8?l:8;n=t|8;w=67;break}case 88:case 120:{n=t;w=67;break}case 111:{q=I;q=Tx(c[q>>2]|0,c[q+4>>2]|0,y)|0;n=z-q|0;o=0;p=46668;l=(t&8|0)==0|(l|0)>(n|0)?l:n+1|0;n=t;w=73;break}case 105:case 100:{n=I;m=c[n>>2]|0;n=c[n+4>>2]|0;if((n|0)<0){m=NO(0,0,m|0,n|0)|0;n=F()|0;o=I;c[o>>2]=m;c[o+4>>2]=n;o=1;p=46668;w=72;break e}else{o=(t&2049|0)!=0&1;p=(t&2048|0)==0?((t&1|0)==0?46668:46670):46669;w=72;break e}}case 117:{n=I;o=0;p=46668;m=c[n>>2]|0;n=c[n+4>>2]|0;w=72;break}case 99:{a[A>>0]=c[I>>2];r=A;o=0;p=46668;q=1;m=n;l=z;break}case 115:{s=c[I>>2]|0;s=(s|0)==0?46678:s;t=Vx(s,0,l)|0;K=(t|0)==0;r=s;o=0;p=46668;q=K?l:t-s|0;m=n;l=K?s+l|0:t;break}case 67:{c[C>>2]=c[I>>2];c[B>>2]=0;c[I>>2]=C;p=-1;w=79;break}case 83:{if(!l){Wx(d,32,u,0,t);l=0;w=89}else{p=l;w=79}break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{l=Fb[j&1](d,+g[I>>3],u,l,t,m)|0;break d}default:{o=0;p=46668;q=l;m=t;l=z}}while(0);f:do if((w|0)==67){q=I;q=Sx(c[q>>2]|0,c[q+4>>2]|0,y,m&32)|0;p=I;p=(n&8|0)==0|(c[p>>2]|0)==0&(c[p+4>>2]|0)==0;o=p?0:2;p=p?46668:46668+(m>>>4)|0;w=73}else if((w|0)==72){q=Ux(m,n,y)|0;n=t;w=73}else if((w|0)==79){w=0;o=c[I>>2]|0;l=0;while(1){m=c[o>>2]|0;if(!m)break;m=Xx(D,m)|0;n=(m|0)<0;if(n|m>>>0>(p-l|0)>>>0){w=83;break}l=m+l|0;if(p>>>0>l>>>0)o=o+4|0;else break}if((w|0)==83){w=0;if(n){e=-1;break a}}Wx(d,32,u,l,t);if(!l){l=0;w=89}else{n=c[I>>2]|0;o=0;while(1){m=c[n>>2]|0;if(!m){w=89;break f}m=Xx(D,m)|0;o=m+o|0;if((o|0)>(l|0)){w=89;break f}Px(d,D,m);if(o>>>0>=l>>>0){w=89;break}else n=n+4|0}}}while(0);if((w|0)==73){w=0;m=I;m=(c[m>>2]|0)!=0|(c[m+4>>2]|0)!=0;K=(l|0)!=0|m;m=z-q+((m^1)&1)|0;r=K?q:y;q=K?((l|0)>(m|0)?l:m):0;m=(l|0)>-1?n&-65537:n;l=z}else if((w|0)==89){w=0;Wx(d,32,u,l,t^8192);l=(u|0)>(l|0)?u:l;break}t=l-r|0;s=(q|0)<(t|0)?t:q;K=s+o|0;l=(u|0)<(K|0)?K:u;Wx(d,32,l,K,m);Px(d,p,o);Wx(d,48,l,K,m^65536);Wx(d,48,s,t,0);Px(d,r,t);Wx(d,32,l,K,m^8192)}while(0);n=v}g:do if((w|0)==92)if(!d)if(!n)e=0;else{e=1;while(1){l=c[i+(e<<2)>>2]|0;if(!l)break;Rx(h+(e<<3)|0,l,f,k);e=e+1|0;if(e>>>0>=10){e=1;break g}}while(1){if(c[i+(e<<2)>>2]|0){e=-1;break g}e=e+1|0;if(e>>>0>=10){e=1;break}}}while(0);yb=J;return e|0}function Nx(a){a=a|0;return 1}function Ox(a){a=a|0;return}function Px(a,b,d){a=a|0;b=b|0;d=d|0;if(!(c[a>>2]&32))$x(b,d,a)|0;return}function Qx(b){b=b|0;var d=0,e=0;if(!(Ex(a[c[b>>2]>>0]|0)|0))d=0;else{d=0;do{e=c[b>>2]|0;d=(d*10|0)+-48+(a[e>>0]|0)|0;e=e+1|0;c[b>>2]=e}while((Ex(a[e>>0]|0)|0)!=0)}return d|0}function Rx(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0.0;a:do if(b>>>0<=20)do switch(b|0){case 9:{b=(c[d>>2]|0)+(4-1)&~(4-1);e=c[b>>2]|0;c[d>>2]=b+4;c[a>>2]=e;break a}case 10:{e=(c[d>>2]|0)+(4-1)&~(4-1);b=c[e>>2]|0;c[d>>2]=e+4;e=a;c[e>>2]=b;c[e+4>>2]=((b|0)<0)<<31>>31;break a}case 11:{e=(c[d>>2]|0)+(4-1)&~(4-1);b=c[e>>2]|0;c[d>>2]=e+4;e=a;c[e>>2]=b;c[e+4>>2]=0;break a}case 12:{e=(c[d>>2]|0)+(8-1)&~(8-1);b=e;f=c[b>>2]|0;b=c[b+4>>2]|0;c[d>>2]=e+8;e=a;c[e>>2]=f;c[e+4>>2]=b;break a}case 13:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;e=(e&65535)<<16>>16;f=a;c[f>>2]=e;c[f+4>>2]=((e|0)<0)<<31>>31;break a}case 14:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;f=a;c[f>>2]=e&65535;c[f+4>>2]=0;break a}case 15:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;e=(e&255)<<24>>24;f=a;c[f>>2]=e;c[f+4>>2]=((e|0)<0)<<31>>31;break a}case 16:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;f=a;c[f>>2]=e&255;c[f+4>>2]=0;break a}case 17:{f=(c[d>>2]|0)+(8-1)&~(8-1);h=+g[f>>3];c[d>>2]=f+8;g[a>>3]=h;break a}case 18:{Sb[e&63](a,d);break a}default:break a}while(0);while(0);return}function Sx(b,c,e,f){b=b|0;c=c|0;e=e|0;f=f|0;if(!((b|0)==0&(c|0)==0))do{e=e+-1|0;a[e>>0]=d[6672+(b&15)>>0]|0|f;b=RO(b|0,c|0,4)|0;c=F()|0}while(!((b|0)==0&(c|0)==0));return e|0}function Tx(b,c,d){b=b|0;c=c|0;d=d|0;if(!((b|0)==0&(c|0)==0))do{d=d+-1|0;a[d>>0]=b&7|48;b=RO(b|0,c|0,3)|0;c=F()|0}while(!((b|0)==0&(c|0)==0));return d|0}function Ux(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;if(c>>>0>0|(c|0)==0&b>>>0>4294967295){do{e=b;b=QO(b|0,c|0,10,0)|0;f=c;c=F()|0;g=LO(b|0,c|0,10,0)|0;g=NO(e|0,f|0,g|0,F()|0)|0;F()|0;d=d+-1|0;a[d>>0]=g&255|48}while(f>>>0>9|(f|0)==9&e>>>0>4294967295);c=b}else c=b;if(c)do{g=c;c=(c>>>0)/10|0;d=d+-1|0;a[d>>0]=g-(c*10|0)|48}while(g>>>0>=10);return d|0}function Vx(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=d&255;f=(e|0)!=0;a:do if(f&(b&3|0)!=0){g=d&255;while(1){if((a[b>>0]|0)==g<<24>>24){i=6;break a}b=b+1|0;e=e+-1|0;f=(e|0)!=0;if(!(f&(b&3|0)!=0)){i=5;break}}}else i=5;while(0);if((i|0)==5)if(f)i=6;else i=16;b:do if((i|0)==6){g=d&255;if((a[b>>0]|0)==g<<24>>24)if(!e){i=16;break}else break;f=B(h,16843009)|0;c:do if(e>>>0>3)while(1){h=c[b>>2]^f;if((h&-2139062144^-2139062144)&h+-16843009|0)break c;b=b+4|0;e=e+-4|0;if(e>>>0<=3){i=11;break}}else i=11;while(0);if((i|0)==11)if(!e){i=16;break}while(1){if((a[b>>0]|0)==g<<24>>24)break b;e=e+-1|0;if(!e){i=16;break}else b=b+1|0}}while(0);if((i|0)==16)b=0;return b|0}function Wx(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;g=yb;yb=yb+256|0;f=g;if((c|0)>(d|0)&(e&73728|0)==0){e=c-d|0;_O(f|0,b<<24>>24|0,(e>>>0<256?e:256)|0)|0;if(e>>>0>255){b=c-d|0;do{Px(a,f,256);e=e+-256|0}while(e>>>0>255);e=b&255}Px(a,f,e)}yb=g;return}function Xx(a,b){a=a|0;b=b|0;if(!a)a=0;else a=Yx(a,b,0)|0;return a|0}function Yx(b,d,e){b=b|0;d=d|0;e=e|0;do if(b){if(d>>>0<128){a[b>>0]=d;b=1;break}if(!(c[c[(Zx()|0)+188>>2]>>2]|0))if((d&-128|0)==57216){a[b>>0]=d;b=1;break}else{c[(mx()|0)>>2]=25;b=-1;break}if(d>>>0<2048){a[b>>0]=d>>>6|192;a[b+1>>0]=d&63|128;b=2;break}if(d>>>0<55296|(d&-8192|0)==57344){a[b>>0]=d>>>12|224;a[b+1>>0]=d>>>6&63|128;a[b+2>>0]=d&63|128;b=3;break}if((d+-65536|0)>>>0<1048576){a[b>>0]=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;b=4;break}else{c[(mx()|0)>>2]=25;b=-1;break}}else b=1;while(0);return b|0}function Zx(){return _x()|0}function _x(){return 16020}function $x(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=e+16|0;g=c[f>>2]|0;if(!g)if(!(ay(e)|0)){g=c[f>>2]|0;h=5}else f=0;else h=5;a:do if((h|0)==5){j=e+20|0;i=c[j>>2]|0;f=i;if((g-i|0)>>>0>>0){f=Hb[c[e+36>>2]&63](e,b,d)|0;break}b:do if((a[e+75>>0]|0)<0|(d|0)==0){h=0;g=b}else{i=d;while(1){g=i+-1|0;if((a[b+g>>0]|0)==10)break;if(!g){h=0;g=b;break b}else i=g}f=Hb[c[e+36>>2]&63](e,b,i)|0;if(f>>>0>>0)break a;h=i;g=b+i|0;d=d-i|0;f=c[j>>2]|0}while(0);YO(f|0,g|0,d|0)|0;c[j>>2]=(c[j>>2]|0)+d;f=h+d|0}while(0);return f|0}function ay(b){b=b|0;var d=0,e=0;d=b+74|0;e=a[d>>0]|0;a[d>>0]=e+255|e;d=c[b>>2]|0;if(!(d&8)){c[b+8>>2]=0;c[b+4>>2]=0;e=c[b+44>>2]|0;c[b+28>>2]=e;c[b+20>>2]=e;c[b+16>>2]=e+(c[b+48>>2]|0);b=0}else{c[b>>2]=d|32;b=-1}return b|0}function by(a){a=+a;var b=0;g[h>>3]=a;b=c[h>>2]|0;E(c[h+4>>2]|0);return b|0}function cy(a,b){a=+a;b=b|0;var d=0,e=0,f=0;g[h>>3]=a;d=c[h>>2]|0;e=c[h+4>>2]|0;f=RO(d|0,e|0,52)|0;F()|0;switch(f&2047){case 0:{if(a!=0.0){a=+cy(a*18446744073709551616.0,b);d=(c[b>>2]|0)+-64|0}else d=0;c[b>>2]=d;break}case 2047:break;default:{c[b>>2]=(f&2047)+-1022;c[h>>2]=d;c[h+4>>2]=e&-2146435073|1071644672;a=+g[h>>3]}}return +a}function dy(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=a+20|0;f=c[e>>2]|0;a=(c[a+16>>2]|0)-f|0;a=a>>>0>d>>>0?d:a;YO(f|0,b|0,a|0)|0;c[e>>2]=(c[e>>2]|0)+a;return d|0}function ey(){return 16264}function fy(){var a=0;a=(c[c[(gy()|0)+188>>2]>>2]|0)==0;return (a?1:4)|0}function gy(){return _x()|0}function hy(){return 16268}function iy(){return 16272}function jy(a){a=a|0;var b=0;b=a;while(1)if(!(c[b>>2]|0))break;else b=b+4|0;return b-a>>2|0}function ky(a){a=a|0;return (((a|32)+-97|0)>>>0<6|(Ex(a)|0)!=0)&1|0}function ly(a){a=a|0;if(a>>>0>4294963200){c[(mx()|0)>>2]=0-a;a=-1}return a|0}function my(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;m=yb;yb=yb+208|0;j=m;k=m+192|0;h=B(d,b)|0;i=k;c[i>>2]=1;c[i+4>>2]=0;a:do if(h|0){i=0-d|0;c[j+4>>2]=d;c[j>>2]=d;f=2;b=d;g=d;while(1){b=b+d+g|0;c[j+(f<<2)>>2]=b;if(b>>>0>>0){n=g;f=f+1|0;g=b;b=n}else break}g=a+h+i|0;if(g>>>0>a>>>0){h=g;f=1;b=1;do{do if((b&3|0)!=3){b=f+-1|0;if((c[j+(b<<2)>>2]|0)>>>0<(h-a|0)>>>0)ny(a,d,e,f,j);else py(a,d,e,k,f,0,j);if((f|0)==1){qy(k,1);f=0;break}else{qy(k,b);f=1;break}}else{ny(a,d,e,f,j);oy(k,2);f=f+2|0}while(0);b=c[k>>2]|1;c[k>>2]=b;a=a+d|0}while(a>>>0>>0)}else{f=1;b=1}py(a,d,e,k,f,0,j);g=k+4|0;while(1){if((f|0)==1&(b|0)==1)if(!(c[g>>2]|0))break a;else l=19;else if((f|0)<2)l=19;else{qy(k,2);n=f+-2|0;c[k>>2]=c[k>>2]^7;oy(k,1);py(a+(0-(c[j+(n<<2)>>2]|0))+i|0,d,e,k,f+-1|0,1,j);qy(k,1);b=c[k>>2]|1;c[k>>2]=b;a=a+i|0;py(a,d,e,k,n,1,j);f=n}if((l|0)==19){l=0;b=ry(k)|0;oy(k,b);a=a+i|0;f=b+f|0;b=c[k>>2]|0}}}while(0);yb=m;return}function ny(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;m=yb;yb=yb+240|0;l=m;c[l>>2]=a;a:do if((e|0)>1){k=0-b|0;i=a;g=e;e=1;h=a;while(1){i=i+k|0;j=g+-2|0;a=i+(0-(c[f+(j<<2)>>2]|0))|0;if((Gb[d&63](h,a)|0)>-1?(Gb[d&63](h,i)|0)>-1:0)break a;h=l+(e<<2)|0;if((Gb[d&63](a,i)|0)>-1){c[h>>2]=a;g=g+-1|0}else{c[h>>2]=i;a=i;g=j}e=e+1|0;if((g|0)<=1)break a;i=a;h=c[l>>2]|0}}else e=1;while(0);ty(b,l,e);yb=m;return}function oy(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=a+4|0;if(b>>>0>31){e=c[f>>2]|0;c[a>>2]=e;c[f>>2]=0;b=b+-32|0;d=0}else{d=c[f>>2]|0;e=c[a>>2]|0}c[a>>2]=d<<32-b|e>>>b;c[f>>2]=d>>>b;return}function py(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 i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;o=yb;yb=yb+240|0;m=o+232|0;n=o;p=c[e>>2]|0;c[m>>2]=p;j=c[e+4>>2]|0;k=m+4|0;c[k>>2]=j;c[n>>2]=a;a:do if((p|0)!=1|(j|0)!=0?(l=0-b|0,i=a+(0-(c[h+(f<<2)>>2]|0))|0,(Gb[d&63](i,a)|0)>=1):0){e=1;g=(g|0)==0;j=i;while(1){if(g&(f|0)>1){g=a+l|0;i=c[h+(f+-2<<2)>>2]|0;if((Gb[d&63](g,j)|0)>-1){i=10;break a}if((Gb[d&63](g+(0-i)|0,j)|0)>-1){i=10;break a}}g=e+1|0;c[n+(e<<2)>>2]=j;p=ry(m)|0;oy(m,p);f=p+f|0;if(!((c[m>>2]|0)!=1|(c[k>>2]|0)!=0)){e=g;a=j;i=10;break a}a=j+(0-(c[h+(f<<2)>>2]|0))|0;if((Gb[d&63](a,c[n>>2]|0)|0)<1){a=j;e=g;g=0;i=9;break}else{p=j;e=g;g=1;j=a;a=p}}}else{e=1;i=9}while(0);if((i|0)==9?(g|0)==0:0)i=10;if((i|0)==10){ty(b,n,e);ny(a,b,d,f,h)}yb=o;return}function qy(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=a+4|0;if(b>>>0>31){e=c[a>>2]|0;c[f>>2]=e;c[a>>2]=0;b=b+-32|0;d=0}else{d=c[a>>2]|0;e=c[f>>2]|0}c[f>>2]=d>>>(32-b|0)|e<>2]=d<>2]|0)+-1|0)|0;if(!b){b=sy(c[a+4>>2]|0)|0;return ((b|0)==0?0:b+32|0)|0}else return b|0;return 0}function sy(a){a=a|0;var b=0;if(a)if(!(a&1)){b=a;a=0;while(1){a=a+1|0;if(!(b&2))b=b>>>1;else break}}else a=0;else a=32;return a|0}function ty(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=yb;yb=yb+256|0;e=h;a:do if((d|0)>=2?(g=b+(d<<2)|0,c[g>>2]=e,a|0):0)while(1){f=a>>>0<256?a:256;YO(e|0,c[b>>2]|0,f|0)|0;e=0;do{i=b+(e<<2)|0;e=e+1|0;YO(c[i>>2]|0,c[b+(e<<2)>>2]|0,f|0)|0;c[i>>2]=(c[i>>2]|0)+f}while((e|0)!=(d|0));a=a-f|0;if(!a)break a;e=c[g>>2]|0}while(0);yb=h;return}function uy(b,e){b=b|0;e=e|0;var f=0,g=0;f=0;while(1){if((d[10528+f>>0]|0)==(b|0)){g=4;break}f=f+1|0;if((f|0)==87){b=87;g=5;break}}if((g|0)==4)if(!f)f=10624;else{b=f;g=5}if((g|0)==5){f=10624;do{do{g=f;f=f+1|0}while((a[g>>0]|0)!=0);b=b+-1|0}while((b|0)!=0)}return vy(f,c[e+20>>2]|0)|0}function vy(a,b){a=a|0;b=b|0;return wy(a,b)|0}function wy(a,b){a=a|0;b=b|0;if(!b)b=0;else b=xy(c[b>>2]|0,c[b+4>>2]|0,a)|0;return ((b|0)==0?a:b)|0}function xy(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=(c[b>>2]|0)+1794895138|0;h=yy(c[b+8>>2]|0,o)|0;f=yy(c[b+12>>2]|0,o)|0;g=yy(c[b+16>>2]|0,o)|0;a:do if((h>>>0>>2>>>0?(n=d-(h<<2)|0,f>>>0>>0&g>>>0>>0):0)?((g|f)&3|0)==0:0){n=f>>>2;m=g>>>2;l=0;while(1){j=h>>>1;k=l+j|0;i=k<<1;g=i+n|0;f=yy(c[b+(g<<2)>>2]|0,o)|0;g=yy(c[b+(g+1<<2)>>2]|0,o)|0;if(!(g>>>0>>0&f>>>0<(d-g|0)>>>0)){f=0;break a}if(a[b+(g+f)>>0]|0){f=0;break a}f=Dx(e,b+g|0)|0;if(!f)break;f=(f|0)<0;if((h|0)==1){f=0;break a}l=f?l:k;h=f?j:h-j|0}f=i+m|0;g=yy(c[b+(f<<2)>>2]|0,o)|0;f=yy(c[b+(f+1<<2)>>2]|0,o)|0;if(f>>>0>>0&g>>>0<(d-f|0)>>>0)f=(a[b+(f+g)>>0]|0)==0?b+f|0:0;else f=0}else f=0;while(0);return f|0}function yy(a,b){a=a|0;b=b|0;var c=0;c=UO(a|0)|0;return ((b|0)==0?a:c)|0}function zy(a){a=a|0;return uy(a,c[(Ay()|0)+188>>2]|0)|0}function Ay(){return _x()|0}function By(b,e,f){b=b|0;e=e|0;f=f|0;var g=0.0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;switch(e|0){case 0:{l=-149;m=24;j=4;break}case 1:{l=-1074;m=53;j=4;break}case 2:{l=-1074;m=53;j=4;break}default:g=0.0}a:do if((j|0)==4){o=b+4|0;n=b+104|0;do{e=c[o>>2]|0;if(e>>>0<(c[n>>2]|0)>>>0){c[o>>2]=e+1;e=d[e>>0]|0}else e=wx(b)|0}while((xx(e)|0)!=0);b:do switch(e|0){case 43:case 45:{i=1-(((e|0)==45&1)<<1)|0;e=c[o>>2]|0;if(e>>>0<(c[n>>2]|0)>>>0){c[o>>2]=e+1;h=d[e>>0]|0;break b}else{h=wx(b)|0;break b}}default:{h=e;i=1}}while(0);e=0;while(1){if((h|32|0)!=(a[46718+e>>0]|0))break;do if(e>>>0<7){h=c[o>>2]|0;if(h>>>0<(c[n>>2]|0)>>>0){c[o>>2]=h+1;h=d[h>>0]|0;break}else{h=wx(b)|0;break}}while(0);e=e+1|0;if(e>>>0>=8){e=8;break}}c:do switch(e&2147483647|0){case 8:break;case 3:{j=23;break}default:{k=(f|0)!=0;if(k&e>>>0>3)if((e|0)==8)break c;else{j=23;break c}d:do if(!e){e=0;while(1){if((h|32|0)!=(a[46727+e>>0]|0))break d;do if(e>>>0<2){h=c[o>>2]|0;if(h>>>0<(c[n>>2]|0)>>>0){c[o>>2]=h+1;h=d[h>>0]|0;break}else{h=wx(b)|0;break}}while(0);e=e+1|0;if(e>>>0>=3){e=3;break}}}while(0);switch(e|0){case 3:{e=c[o>>2]|0;if(e>>>0<(c[n>>2]|0)>>>0){c[o>>2]=e+1;e=d[e>>0]|0}else e=wx(b)|0;if((e|0)!=40){if(!(c[n>>2]|0)){g=q;break a}c[o>>2]=(c[o>>2]|0)+-1;g=q;break a}e=1;while(1){h=c[o>>2]|0;if(h>>>0<(c[n>>2]|0)>>>0){c[o>>2]=h+1;h=d[h>>0]|0}else h=wx(b)|0;if(!((h+-48|0)>>>0<10|(h+-65|0)>>>0<26)?!((h|0)==95|(h+-97|0)>>>0<26):0)break;e=e+1|0}if((h|0)==41){g=q;break a}h=(c[n>>2]|0)==0;if(!h)c[o>>2]=(c[o>>2]|0)+-1;if(!k){c[(mx()|0)>>2]=28;ux(b,0,0);g=0.0;break a}if(!e){g=q;break a}while(1){e=e+-1|0;if(!h)c[o>>2]=(c[o>>2]|0)+-1;if(!e){g=q;break a}}}case 0:{if((h|0)==48){e=c[o>>2]|0;if(e>>>0<(c[n>>2]|0)>>>0){c[o>>2]=e+1;e=d[e>>0]|0}else e=wx(b)|0;if((e|32|0)==120){g=+Cy(b,m,l,i,f);break a}if(!(c[n>>2]|0))e=48;else{c[o>>2]=(c[o>>2]|0)+-1;e=48}}else e=h;g=+Dy(b,e,m,l,i,f);break a}default:{if(c[n>>2]|0)c[o>>2]=(c[o>>2]|0)+-1;c[(mx()|0)>>2]=28;ux(b,0,0);g=0.0;break a}}}}while(0);if((j|0)==23){h=(c[n>>2]|0)==0;if(!h)c[o>>2]=(c[o>>2]|0)+-1;if((f|0)!=0&e>>>0>3)do{if(!h)c[o>>2]=(c[o>>2]|0)+-1;e=e+-1|0}while(e>>>0>3)}g=+(i|0)*r}while(0);return +g}function Cy(a,b,e,f,g){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;var h=0.0,i=0,j=0,k=0.0,l=0,m=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;y=a+4|0;i=c[y>>2]|0;x=a+104|0;if(i>>>0<(c[x>>2]|0)>>>0){c[y>>2]=i+1;i=d[i>>0]|0}else i=wx(a)|0;j=0;a:while(1){switch(i|0){case 46:{w=10;break a}case 48:break;default:{p=0;m=j;l=0;j=0;break a}}i=c[y>>2]|0;if(i>>>0<(c[x>>2]|0)>>>0){c[y>>2]=i+1;i=d[i>>0]|0}else i=wx(a)|0;j=1}if((w|0)==10){i=c[y>>2]|0;if(i>>>0<(c[x>>2]|0)>>>0){c[y>>2]=i+1;i=d[i>>0]|0}else i=wx(a)|0;if((i|0)==48){l=0;j=0;do{i=c[y>>2]|0;if(i>>>0<(c[x>>2]|0)>>>0){c[y>>2]=i+1;i=d[i>>0]|0}else i=wx(a)|0;l=MO(l|0,j|0,-1,-1)|0;j=F()|0}while((i|0)==48);p=1;m=1}else{p=1;m=j;l=0;j=0}}o=0;n=1.0;h=0.0;v=0;s=p;t=m;u=0;m=0;while(1){q=i+-48|0;p=i|32;if(q>>>0>=10){r=(i|0)==46;if(!(r|(p+-97|0)>>>0<6))break;if(r)if(!s){s=1;k=n;q=v;r=t;l=m;j=u;p=u}else{i=46;break}else w=24}else w=24;if((w|0)==24){w=0;i=(i|0)>57?p+-87|0:q;do if(!((u|0)<0|(u|0)==0&m>>>0<8))if((u|0)<0|(u|0)==0&m>>>0<14){n=n*.0625;k=n;h=h+n*+(i|0);i=v;break}else{i=(o|0)!=0|(i|0)==0;o=i?o:1;k=n;h=i?h:h+n*.5;i=v;break}else{k=n;i=i+(v<<4)|0}while(0);m=MO(m|0,u|0,1,0)|0;q=i;r=1;p=F()|0}i=c[y>>2]|0;if(i>>>0<(c[x>>2]|0)>>>0){c[y>>2]=i+1;i=d[i>>0]|0}else i=wx(a)|0;n=k;v=q;t=r;u=p}do if(!t){i=(c[x>>2]|0)==0;if(!i)c[y>>2]=(c[y>>2]|0)+-1;if(g){if(!i?(c[y>>2]=(c[y>>2]|0)+-1,!((s|0)==0|i)):0)c[y>>2]=(c[y>>2]|0)+-1}else ux(a,0,0);h=+(f|0)*0.0}else{o=(s|0)==0;p=o?m:l;o=o?u:j;if((u|0)<0|(u|0)==0&m>>>0<8){j=v;l=u;do{j=j<<4;w=m;m=MO(m|0,l|0,1,0)|0;v=l;l=F()|0}while((v|0)<0|(v|0)==0&w>>>0<7);m=j}else m=v;if((i|32|0)==112){j=Ey(a,g)|0;i=F()|0;if((j|0)==0&(i|0)==-2147483648){if(!g){ux(a,0,0);h=0.0;break}if(!(c[x>>2]|0)){j=0;i=0}else{c[y>>2]=(c[y>>2]|0)+-1;j=0;i=0}}}else if(!(c[x>>2]|0)){j=0;i=0}else{c[y>>2]=(c[y>>2]|0)+-1;j=0;i=0}l=SO(p|0,o|0,2)|0;l=MO(l|0,F()|0,-32,-1)|0;l=MO(l|0,F()|0,j|0,i|0)|0;i=F()|0;if(!m){h=+(f|0)*0.0;break}y=0-e|0;g=((y|0)<0)<<31>>31;if((i|0)>(g|0)|(i|0)==(g|0)&l>>>0>y>>>0){c[(mx()|0)>>2]=68;h=+(f|0)*1797693134862315708145274.0e284*1797693134862315708145274.0e284;break}y=e+-106|0;g=((y|0)<0)<<31>>31;if((i|0)<(g|0)|(i|0)==(g|0)&l>>>0>>0){c[(mx()|0)>>2]=68;h=+(f|0)*2.2250738585072014e-308*2.2250738585072014e-308;break}if((m|0)>-1){j=m;do{y=!(h>=.5);j=j<<1|(y^1)&1;h=h+(y?h:h+-1.0);l=MO(l|0,i|0,-1,-1)|0;i=F()|0}while((j|0)>-1);n=h;m=j}else n=h;y=((b|0)<0)<<31>>31;e=NO(32,0,e|0,((e|0)<0)<<31>>31|0)|0;i=MO(e|0,F()|0,l|0,i|0)|0;e=F()|0;if((e|0)<(y|0)|(e|0)==(y|0)&i>>>0>>0)if((i|0)>0)w=65;else{j=0;i=84;w=67}else{i=b;w=65}if((w|0)==65)if((i|0)<53){j=i;i=84-i|0;w=67}else{k=0.0;h=+(f|0)}if((w|0)==67){h=+(f|0);k=+Gy(+Fy(1.0,i),h);i=j}f=(m&1|0)==0&(n!=0.0&(i|0)<32);h=(f?0.0:n)*h+(k+h*+((m+(f&1)|0)>>>0))-k;if(!(h!=0.0))c[(mx()|0)>>2]=68;h=+Iy(h,l)}while(0);return +h}function Dy(a,b,e,f,g,h){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0.0,j=0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0,u=0.0,v=0,w=0,x=0,y=0,z=0,A=0,C=0,D=0,E=0,G=0,H=0,I=0,J=0.0;I=yb;yb=yb+512|0;E=I;G=f+e|0;H=0-G|0;D=a+4|0;C=a+104|0;j=0;a:while(1){switch(b|0){case 46:{z=7;break a}case 48:break;default:{v=0;p=j;j=0;o=0;break a}}b=c[D>>2]|0;if(b>>>0<(c[C>>2]|0)>>>0){c[D>>2]=b+1;b=d[b>>0]|0}else b=wx(a)|0;j=1}if((z|0)==7){b=c[D>>2]|0;if(b>>>0<(c[C>>2]|0)>>>0){c[D>>2]=b+1;b=d[b>>0]|0}else b=wx(a)|0;if((b|0)==48){j=0;b=0;while(1){j=MO(j|0,b|0,-1,-1)|0;o=F()|0;b=c[D>>2]|0;if(b>>>0<(c[C>>2]|0)>>>0){c[D>>2]=b+1;b=d[b>>0]|0}else b=wx(a)|0;if((b|0)==48)b=o;else{v=1;p=1;break}}}else{v=1;p=j;j=0;o=0}}c[E>>2]=0;n=b+-48|0;m=(b|0)==46;b:do if(m|n>>>0<10){A=E+496|0;w=0;l=0;s=0;x=v;y=p;z=n;p=0;n=0;c:while(1){do if(m)if(!x){x=1;j=p;o=n}else break c;else{p=MO(p|0,n|0,1,0)|0;n=F()|0;v=(b|0)!=48;if((l|0)>=125){if(!v)break;c[A>>2]=c[A>>2]|1;break}m=E+(l<<2)|0;if(!w)b=z;else b=b+-48+((c[m>>2]|0)*10|0)|0;c[m>>2]=b;w=w+1|0;y=(w|0)==9;w=y?0:w;l=l+(y&1)|0;s=v?p:s;y=1}while(0);b=c[D>>2]|0;if(b>>>0<(c[C>>2]|0)>>>0){c[D>>2]=b+1;b=d[b>>0]|0}else b=wx(a)|0;z=b+-48|0;m=(b|0)==46;if(!(m|z>>>0<10)){v=x;m=y;z=31;break b}}b=w;m=(y|0)!=0;z=39}else{w=0;l=0;s=0;m=p;p=0;n=0;z=31}while(0);do if((z|0)==31){A=(v|0)==0;j=A?p:j;o=A?n:o;m=(m|0)!=0;if(!(m&(b|32|0)==101))if((b|0)>-1){b=w;z=39;break}else{b=w;z=41;break}m=Ey(a,h)|0;b=F()|0;if((m|0)==0&(b|0)==-2147483648){if(!h){ux(a,0,0);i=0.0;break}if(!(c[C>>2]|0)){m=0;b=0}else{c[D>>2]=(c[D>>2]|0)+-1;m=0;b=0}}j=MO(m|0,b|0,j|0,o|0)|0;b=w;o=F()|0;z=43}while(0);if((z|0)==39)if(c[C>>2]|0){c[D>>2]=(c[D>>2]|0)+-1;if(m)z=43;else z=42}else z=41;if((z|0)==41)if(m)z=43;else z=42;do if((z|0)==42){c[(mx()|0)>>2]=28;ux(a,0,0);i=0.0}else if((z|0)==43){m=c[E>>2]|0;if(!m){i=+(g|0)*0.0;break}if(((n|0)<0|(n|0)==0&p>>>0<10)&((j|0)==(p|0)&(o|0)==(n|0))?(e|0)>30|(m>>>e|0)==0:0){i=+(g|0)*+(m>>>0);break}a=(f|0)/-2|0;D=((a|0)<0)<<31>>31;if((o|0)>(D|0)|(o|0)==(D|0)&j>>>0>a>>>0){c[(mx()|0)>>2]=68;i=+(g|0)*1797693134862315708145274.0e284*1797693134862315708145274.0e284;break}a=f+-106|0;D=((a|0)<0)<<31>>31;if((o|0)<(D|0)|(o|0)==(D|0)&j>>>0>>0){c[(mx()|0)>>2]=68;i=+(g|0)*2.2250738585072014e-308*2.2250738585072014e-308;break}if(b){if((b|0)<9){n=E+(l<<2)|0;m=c[n>>2]|0;while(1){m=m*10|0;if((b|0)>=8)break;else b=b+1|0}c[n>>2]=m}l=l+1|0}if((s|0)<9?(s|0)<=(j|0)&(j|0)<18:0){if((j|0)==9){i=+(g|0)*+((c[E>>2]|0)>>>0);break}if((j|0)<9){i=+(g|0)*+((c[E>>2]|0)>>>0)/+(c[12432+(8-j<<2)>>2]|0);break}a=e+27+(B(j,-3)|0)|0;b=c[E>>2]|0;if((a|0)>30|(b>>>a|0)==0){i=+(g|0)*+(b>>>0)*+(c[12432+(j+-10<<2)>>2]|0);break}}b=(j|0)%9|0;if(!b)m=0;else{s=(j|0)>-1?b:b+9|0;o=c[12432+(8-s<<2)>>2]|0;if(l){p=1e9/(o|0)|0;n=0;m=0;b=0;do{C=E+(b<<2)|0;D=c[C>>2]|0;a=(D>>>0)/(o>>>0)|0;D=D-(B(a,o)|0)|0;a=a+n|0;c[C>>2]=a;n=B(p,D)|0;a=(b|0)==(m|0)&(a|0)==0;j=a?j+-9|0:j;m=a?m+1&127:m;b=b+1|0}while((b|0)!=(l|0));if(!n)b=l;else{c[E+(l<<2)>>2]=n;b=l+1|0}}else{m=0;b=0}l=b;j=9-s+j|0}b=0;d:while(1){v=(j|0)<18;w=(j|0)==18;x=E+(m<<2)|0;while(1){if(!v){if(!w)break d;if((c[x>>2]|0)>>>0>=9007199){j=18;break d}}n=0;y=l;l=l+127|0;while(1){p=l&127;o=E+(p<<2)|0;l=SO(c[o>>2]|0,0,29)|0;l=MO(l|0,F()|0,n|0,0)|0;n=F()|0;if(n>>>0>0|(n|0)==0&l>>>0>1e9){s=QO(l|0,n|0,1e9,0)|0;a=LO(s|0,F()|0,1e9,0)|0;l=NO(l|0,n|0,a|0,F()|0)|0;F()|0}else s=0;c[o>>2]=l;a=(p|0)==(m|0);o=(p|0)!=(y+127&127|0)|a?y:(l|0)==0?p:y;if(a)break;else{n=s;y=o;l=p+-1|0}}b=b+-29|0;if(!s)l=y;else break}m=m+127&127;l=o+127&127;n=E+((o+126&127)<<2)|0;if((m|0)==(o|0))c[n>>2]=c[n>>2]|c[E+(l<<2)>>2];else l=y;c[E+(m<<2)>>2]=s;j=j+9|0}e:while(1){w=l+1&127;x=E+((l+127&127)<<2)|0;while(1){p=(j|0)==18;v=(j|0)>27?9:1;y=m;while(1){o=0;while(1){m=o+y&127;if((m|0)==(l|0)){z=92;break}m=c[E+(m<<2)>>2]|0;n=c[16276+(o<<2)>>2]|0;if(m>>>0>>0){z=92;break}if(m>>>0>n>>>0)break;if((o+1|0)>>>0<2)o=1;else{z=92;break}}if((z|0)==92?(z=0,p):0)break e;b=v+b|0;if((y|0)==(l|0))y=l;else break}p=(1<>>v;o=0;m=y;n=y;do{C=E+(n<<2)|0;D=c[C>>2]|0;a=(D>>>v)+o|0;c[C>>2]=a;o=B(D&p,s)|0;a=(n|0)==(m|0)&(a|0)==0;j=a?j+-9|0:j;m=a?m+1&127:m;n=n+1&127}while((n|0)!=(l|0));if(o|0){if((w|0)!=(m|0))break;c[x>>2]=c[x>>2]|1}}c[E+(l<<2)>>2]=o;l=w}i=0.0;j=l;m=0;do{n=m+y&127;l=j+1&127;if((n|0)==(j|0)){c[E+(l+-1<<2)>>2]=0;j=l}i=i*1.0e9+ +((c[E+(n<<2)>>2]|0)>>>0);m=m+1|0}while((m|0)!=2);u=+(g|0);k=i*u;n=b+53|0;o=n-f|0;p=(o|0)<(e|0);m=p?((o|0)>0?o:0):e;if((m|0)<53){J=+Gy(+Fy(1.0,105-m|0),k);q=+Hy(k,+Fy(1.0,53-m|0));r=J;i=q;q=J+(k-q)}else{r=0.0;i=0.0;q=k}l=y+2&127;if((l|0)!=(j|0)){l=c[E+(l<<2)>>2]|0;do if(l>>>0>=5e8){if((l|0)!=5e8){i=u*.75+i;break}if((y+3&127|0)==(j|0)){i=u*.5+i;break}else{i=u*.75+i;break}}else{if((l|0)==0?(y+3&127|0)==(j|0):0)break;i=u*.25+i}while(0);if((53-m|0)>1?!(+Hy(i,1.0)!=0.0):0)k=i+1.0;else k=i}else k=i;i=q+k-r;do if((n&2147483647|0)>(-2-G|0)){G=!(+t(+i)>=9007199254740992.0);b=b+((G^1)&1)|0;i=G?i:i*.5;if((b+50|0)<=(H|0)?!(k!=0.0&(p&((m|0)!=(o|0)|G))):0)break;c[(mx()|0)>>2]=68}while(0);i=+Iy(i,b)}while(0);yb=I;return +i}function Ey(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;i=a+4|0;e=c[i>>2]|0;j=a+104|0;if(e>>>0<(c[j>>2]|0)>>>0){c[i>>2]=e+1;f=d[e>>0]|0}else f=wx(a)|0;switch(f|0){case 43:case 45:{g=(f|0)==45&1;e=c[i>>2]|0;if(e>>>0<(c[j>>2]|0)>>>0){c[i>>2]=e+1;e=d[e>>0]|0}else e=wx(a)|0;f=e+-48|0;if((b|0)!=0&f>>>0>9)if(!(c[j>>2]|0)){f=0;e=-2147483648}else{c[i>>2]=(c[i>>2]|0)+-1;k=14}else k=12;break}default:{g=0;e=f;f=f+-48|0;k=12}}if((k|0)==12)if(f>>>0>9)k=14;else{f=0;do{f=e+-48+(f*10|0)|0;e=c[i>>2]|0;if(e>>>0<(c[j>>2]|0)>>>0){c[i>>2]=e+1;e=d[e>>0]|0}else e=wx(a)|0;b=e+-48|0}while(b>>>0<10&(f|0)<214748364);h=((f|0)<0)<<31>>31;if(b>>>0<10){do{l=LO(f|0,h|0,10,0)|0;b=F()|0;e=MO(e|0,((e|0)<0)<<31>>31|0,-48,-1)|0;f=MO(e|0,F()|0,l|0,b|0)|0;h=F()|0;e=c[i>>2]|0;if(e>>>0<(c[j>>2]|0)>>>0){c[i>>2]=e+1;e=d[e>>0]|0}else e=wx(a)|0;b=e+-48|0}while(b>>>0<10&((h|0)<21474836|(h|0)==21474836&f>>>0<2061584302));if(b>>>0<10){do{e=c[i>>2]|0;if(e>>>0<(c[j>>2]|0)>>>0){c[i>>2]=e+1;e=d[e>>0]|0}else e=wx(a)|0}while((e+-48|0)>>>0<10);e=h}else e=h}else e=h;if(c[j>>2]|0)c[i>>2]=(c[i>>2]|0)+-1;j=(g|0)==0;i=NO(0,0,f|0,e|0)|0;l=F()|0;f=j?f:i;e=j?e:l}if((k|0)==14)if(!(c[j>>2]|0)){f=0;e=-2147483648}else{c[i>>2]=(c[i>>2]|0)+-1;f=0;e=-2147483648}E(e|0);return f|0}function Fy(a,b){a=+a;b=b|0;var d=0,e=0;if((b|0)<=1023){if((b|0)<-1022){a=a*2.2250738585072014e-308;e=(b|0)<-2044;d=b+2044|0;a=e?a*2.2250738585072014e-308:a;b=e?((d|0)>-1022?d:-1022):b+1022|0}}else{a=a*8988465674311579538646525.0e283;d=(b|0)>2046;e=b+-2046|0;a=d?a*8988465674311579538646525.0e283:a;b=d?((e|0)<1023?e:1023):b+-1023|0}d=SO(b+1023|0,0,52)|0;e=F()|0;c[h>>2]=d;c[h+4>>2]=e;return +(a*+g[h>>3])}function Gy(a,b){a=+a;b=+b;return +(+Cx(a,b))}function Hy(a,b){a=+a;b=+b;return +(+Jy(a,b))}function Iy(a,b){a=+a;b=b|0;return +(+Fy(a,b))}function Jy(a,b){a=+a;b=+b;var d=0,e=0,f=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;g[h>>3]=a;j=c[h>>2]|0;l=c[h+4>>2]|0;g[h>>3]=b;n=c[h>>2]|0;o=c[h+4>>2]|0;e=RO(j|0,l|0,52)|0;F()|0;e=e&2047;m=RO(n|0,o|0,52)|0;F()|0;m=m&2047;p=l&-2147483648;i=SO(n|0,o|0,1)|0;k=F()|0;a:do if(!((i|0)==0&(k|0)==0)?(f=Ky(b)|0,d=(F()|0)&2147483647,!((e|0)==2047|(d>>>0>2146435072|(d|0)==2146435072&f>>>0>0))):0){d=SO(j|0,l|0,1)|0;f=F()|0;if(!(f>>>0>k>>>0|(f|0)==(k|0)&d>>>0>i>>>0))return +((d|0)==(i|0)&(f|0)==(k|0)?a*0.0:a);if(!e){d=SO(j|0,l|0,12)|0;f=F()|0;if((f|0)>-1|(f|0)==-1&d>>>0>4294967295){e=0;do{e=e+-1|0;d=SO(d|0,f|0,1)|0;f=F()|0}while((f|0)>-1|(f|0)==-1&d>>>0>4294967295)}else e=0;j=SO(j|0,l|0,1-e|0)|0;i=F()|0}else i=l&1048575|1048576;if(!m){f=SO(n|0,o|0,12)|0;k=F()|0;if((k|0)>-1|(k|0)==-1&f>>>0>4294967295){d=0;do{d=d+-1|0;f=SO(f|0,k|0,1)|0;k=F()|0}while((k|0)>-1|(k|0)==-1&f>>>0>4294967295)}else d=0;n=SO(n|0,o|0,1-d|0)|0;m=d;l=F()|0}else l=o&1048575|1048576;f=NO(j|0,i|0,n|0,l|0)|0;d=F()|0;k=(d|0)>-1|(d|0)==-1&f>>>0>4294967295;b:do if((e|0)>(m|0)){while(1){if(k){if((f|0)==0&(d|0)==0)break}else{f=j;d=i}j=SO(f|0,d|0,1)|0;i=F()|0;e=e+-1|0;f=NO(j|0,i|0,n|0,l|0)|0;d=F()|0;k=(d|0)>-1|(d|0)==-1&f>>>0>4294967295;if((e|0)<=(m|0))break b}b=a*0.0;break a}while(0);if(k){if((f|0)==0&(d|0)==0){b=a*0.0;break}}else{d=i;f=j}if(d>>>0<1048576|(d|0)==1048576&f>>>0<0)do{f=SO(f|0,d|0,1)|0;d=F()|0;e=e+-1|0}while(d>>>0<1048576|(d|0)==1048576&f>>>0<0);if((e|0)>0){o=MO(f|0,d|0,0,-1048576)|0;d=F()|0;e=SO(e|0,0,52)|0;d=d|(F()|0);e=o|e}else{e=RO(f|0,d|0,1-e|0)|0;d=F()|0}c[h>>2]=e;c[h+4>>2]=d|p;b=+g[h>>3]}else q=3;while(0);if((q|0)==3){b=a*b;b=b/b}return +b}function Ky(a){a=+a;var b=0;g[h>>3]=a;b=c[h>>2]|0;E(c[h+4>>2]|0);return b|0}function Ly(a){a=a|0;return 0}function My(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return d|0}function Ny(a,b){a=a|0;b=b|0;return -1|0}function Oy(b){b=b|0;var d=0,e=0,f=0;f=b;a:do if(!(f&3))e=5;else{d=f;while(1){if(!(a[b>>0]|0)){b=d;break a}b=b+1|0;d=b;if(!(d&3)){e=5;break}}}while(0);if((e|0)==5){while(1){d=c[b>>2]|0;if(!((d&-2139062144^-2139062144)&d+-16843009))b=b+4|0;else break}if((d&255)<<24>>24)do b=b+1|0;while((a[b>>0]|0)!=0)}return b-f|0}function Py(a,b){a=a|0;b=b|0;var d=0,e=0;d=yb;yb=yb+16|0;e=d;c[e>>2]=a;c[e+4>>2]=b;b=ly(_(91,e|0)|0)|0;yb=d;return b|0}function Qy(b,c){b=b|0;c=c|0;b=Ry(b,c)|0;return ((a[b>>0]|0)==(c&255)<<24>>24?b:0)|0}function Ry(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;f=d&255;a:do if(!f)b=b+(Oy(b)|0)|0;else{if(b&3){e=d&255;do{g=a[b>>0]|0;if(g<<24>>24==0?1:g<<24>>24==e<<24>>24)break a;b=b+1|0}while((b&3|0)!=0)}f=B(f,16843009)|0;e=c[b>>2]|0;b:do if(!((e&-2139062144^-2139062144)&e+-16843009))do{g=e^f;if((g&-2139062144^-2139062144)&g+-16843009|0)break b;b=b+4|0;e=c[b>>2]|0}while(!((e&-2139062144^-2139062144)&e+-16843009|0));while(0);e=d&255;while(1){g=a[b>>0]|0;if(g<<24>>24==0?1:g<<24>>24==e<<24>>24)break;else b=b+1|0}}while(0);return b|0}function Sy(){return}function Ty(a){a=a|0;if(Uy(a)|0)EO(a);return}function Uy(a){a=a|0;return (a|0)!=15980&((a|0)!=0&(a|0)!=55596)&1|0}function Vy(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;l=yb;yb=yb+16|0;h=l;j=(g|0)==0?55624:g;g=c[j>>2]|0;a:do if(!e)if(!g)g=0;else k=19;else{i=(b|0)==0?h:b;if(!f)g=-2;else{if(!g){g=a[e>>0]|0;if(g<<24>>24>-1){c[i>>2]=g&255;g=g<<24>>24!=0&1;break}h=(c[c[(Wy()|0)+188>>2]>>2]|0)==0;g=a[e>>0]|0;if(h){c[i>>2]=g<<24>>24&57343;g=1;break}g=(g&255)+-194|0;if(g>>>0>50){k=19;break}g=c[5728+(g<<2)>>2]|0;h=f+-1|0;if(h){e=e+1|0;k=11}}else{h=f;k=11}b:do if((k|0)==11){b=d[e>>0]|0;m=b>>>3;if((m+-16|m+(g>>26))>>>0>7){k=19;break a}g=b+-128|g<<6;b=h+-1|0;if((g|0)<0)do{e=e+1|0;if(!b)break b;h=a[e>>0]|0;if((h&-64)<<24>>24!=-128){k=19;break a}g=(h&255)+-128|g<<6;b=b+-1|0}while((g|0)<0);c[j>>2]=0;c[i>>2]=g;g=f-b|0;break a}while(0);c[j>>2]=g;g=-2}}while(0);if((k|0)==19){c[j>>2]=0;c[(mx()|0)>>2]=25;g=-1}yb=l;return g|0}function Wy(){return _x()|0}function Xy(a,b){a=a|0;b=b|0;return Ex(a)|0}function Yy(a,b){a=a|0;b=b|0;return ky(a)|0}function Zy(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=yb;yb=yb+272|0;m=o;n=o+256|0;do if(!(a[d>>0]|0)){d=Ja(46731)|0;if(d|0?a[d>>0]|0:0)break;d=Ja(12464+(b*12|0)|0)|0;if(d|0?a[d>>0]|0:0)break;d=Ja(46738)|0;if(d|0?a[d>>0]|0:0)break;d=46743}while(0);e=0;a:while(1){switch(a[d+e>>0]|0){case 47:case 0:break a;default:{}}e=e+1|0;if(e>>>0>=15){e=15;break}}f=a[d>>0]|0;if(f<<24>>24!=46?(a[d+e>>0]|0)==0:0)if(f<<24>>24==67)l=15;else{k=d;l=16}else{d=46743;l=15}if((l|0)==15)if(!(a[d+1>>0]|0))l=18;else{k=d;l=16}b:do if((l|0)==16)if((Dx(k,46743)|0)!=0?(Dx(k,46751)|0)!=0:0){d=c[13907]|0;if(d|0)do{if(!(Dx(k,d+8|0)|0))break b;d=c[d+24>>2]|0}while((d|0)!=0);U(55632);d=c[13907]|0;c:do if(d|0){while(1){if(!(Dx(k,d+8|0)|0))break;d=c[d+24>>2]|0;if(!d)break c}$(55632);break b}while(0);d:do if(((c[13885]|0)==0?(g=Ja(46757)|0,(g|0)!=0):0)?(a[g>>0]|0)!=0:0){i=254-e|0;j=e+1|0;f=g;while(1){h=Ry(f,58)|0;d=a[h>>0]|0;g=h-f+((d<<24>>24!=0)<<31>>31)|0;if(g>>>0>>0){YO(m|0,f|0,g|0)|0;f=m+g|0;a[f>>0]=47;YO(f+1|0,k|0,e|0)|0;a[m+(j+g)>>0]=0;f=V(m|0,n|0)|0;if(f|0)break;d=a[h>>0]|0}f=h+(d<<24>>24!=0&1)|0;if(!(a[f>>0]|0)){l=41;break d}}d=DO(28)|0;if(!d){Py(f,c[n>>2]|0)|0;l=41;break}else{c[d>>2]=f;c[d+4>>2]=c[n>>2];n=d+8|0;YO(n|0,k|0,e|0)|0;a[n+e>>0]=0;c[d+24>>2]=c[13907];c[13907]=d;break}}else l=41;while(0);if((l|0)==41){d=DO(28)|0;if(d){c[d>>2]=c[3988];c[d+4>>2]=c[3989];n=d+8|0;YO(n|0,k|0,e|0)|0;a[n+e>>0]=0;c[d+24>>2]=c[13907];c[13907]=d}}$(55632);d=(b|0)==0&(d|0)==0?15952:d}else{d=k;l=18}while(0);do if((l|0)==18){if((b|0)==0?(a[d+1>>0]|0)==46:0){d=15952;break}d=0}while(0);yb=o;return d|0}function _y(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=yb;yb=yb+32|0;i=j;a:do if(!(Uy(d)|0)){h=(d|0)!=0;f=0;g=0;do{e=1<>2]|0;else e=Zy(g,(e|0)==0?57671:b)|0;f=f+((e|0)!=0&1)|0;c[i+(g<<2)>>2]=e;g=g+1|0}while((g|0)!=6);switch(f&2147483647|0){case 0:{d=55596;break a}case 1:{if((c[i>>2]|0)==15952){d=15980;break a}break}default:{}}}else{e=0;do{if(1<>2]=Zy(e,b)|0;e=e+1|0}while((e|0)!=6)}while(0);yb=j;return d|0}function $y(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=yb;yb=yb+16|0;g=f;c[g>>2]=e;e=Hx(a,b,d,g)|0;yb=f;return e|0}function az(a,b){a=a|0;b=b|0;bz(a,b)|0;return a|0}function bz(b,d){b=b|0;d=d|0;var e=0,f=0;e=d;a:do if(!((e^b)&3)){if(e&3)do{e=a[d>>0]|0;a[b>>0]=e;if(!(e<<24>>24))break a;d=d+1|0;b=b+1|0}while((d&3|0)!=0);e=c[d>>2]|0;if(!((e&-2139062144^-2139062144)&e+-16843009)){f=b;while(1){d=d+4|0;b=f+4|0;c[f>>2]=e;e=c[d>>2]|0;if((e&-2139062144^-2139062144)&e+-16843009|0)break;else f=b}}f=10}else f=10;while(0);if((f|0)==10){f=a[d>>0]|0;a[b>>0]=f;if(f<<24>>24)do{d=d+1|0;b=b+1|0;f=a[d>>0]|0;a[b>>0]=f}while(f<<24>>24!=0)}return b|0}function cz(a){a=a|0;var b=0,d=0;b=(dz()|0)+188|0;d=c[b>>2]|0;if(a|0)c[b>>2]=(a|0)==(-1|0)?55572:a;return ((d|0)==55572?-1:d)|0}function dz(){return _x()|0}function ez(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;if(d|0){e=a;while(1){d=d+-1|0;c[e>>2]=c[b>>2];if(!d)break;else{b=b+4|0;e=e+4|0}}}return a|0}function fz(a,b){a=+a;b=b|0;return +(+Fy(a,b))}function gz(a){a=+a;return ~~+$O(+a)|0}function hz(a){a=a|0;var b=0,c=0;b=(Oy(a)|0)+1|0;c=DO(b)|0;if(!c)a=0;else a=YO(c|0,a|0,b|0)|0;return a|0}function iz(a,b){a=a|0;b=b|0;var c=0;c=Oy(a)|0;return ((jz(a,1,c,b)|0)!=(c|0))<<31>>31|0}function jz(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=B(d,b)|0;d=(b|0)==0?0:d;if((c[e+76>>2]|0)>-1){g=(Nx(e)|0)==0;a=$x(a,f,e)|0;if(!g)Ox(e)}else a=$x(a,f,e)|0;if((a|0)!=(f|0))d=(a>>>0)/(b>>>0)|0;return d|0}function kz(a){a=a|0;var b=0;if(c[a+68>>2]|0){b=c[a+132>>2]|0;a=a+128|0;if(b|0)c[b+128>>2]=c[a>>2];a=c[a>>2]|0;if(!a)a=(lz()|0)+232|0;else a=a+132|0;c[a>>2]=b}return}function lz(){return _x()|0}function mz(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0;l=yb;yb=yb+16|0;j=l;k=e&255;a[j>>0]=k;g=b+16|0;h=c[g>>2]|0;if(!h)if(!(ay(b)|0)){h=c[g>>2]|0;i=4}else f=-1;else i=4;do if((i|0)==4){i=b+20|0;g=c[i>>2]|0;if(g>>>0>>0?(f=e&255,(f|0)!=(a[b+75>>0]|0)):0){c[i>>2]=g+1;a[g>>0]=k;break}if((Hb[c[b+36>>2]&63](b,j,1)|0)==1)f=d[j>>0]|0;else f=-1}while(0);yb=l;return f|0}function nz(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;j=yb;yb=yb+16|0;g=j;a:do if(!e)b=0;else{do if(f|0){i=(b|0)==0?g:b;b=a[e>>0]|0;if(b<<24>>24>-1){c[i>>2]=b&255;b=b<<24>>24!=0&1;break a}h=(c[c[(oz()|0)+188>>2]>>2]|0)==0;b=a[e>>0]|0;if(h){c[i>>2]=b<<24>>24&57343;b=1;break a}b=(b&255)+-194|0;if(b>>>0<=50){g=e+1|0;h=c[5728+(b<<2)>>2]|0;if(f>>>0<4?h&-2147483648>>>((f*6|0)+-6|0)|0:0)break;b=d[g>>0]|0;f=b>>>3;if((f+-16|f+(h>>26))>>>0<=7){b=b+-128|h<<6;if((b|0)>=0){c[i>>2]=b;b=2;break a}g=(d[e+2>>0]|0)+-128|0;if(g>>>0<=63){g=g|b<<6;if((g|0)>=0){c[i>>2]=g;b=3;break a}b=(d[e+3>>0]|0)+-128|0;if(b>>>0<=63){c[i>>2]=b|g<<6;b=4;break a}}}}}while(0);c[(mx()|0)>>2]=25;b=-1}while(0);yb=j;return b|0}function oz(){return _x()|0}function pz(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;f=yb;yb=yb+16|0;e=f;if(Qy(46770,a[d>>0]|0)|0){g=qz(d)|0|32768;c[e>>2]=b;c[e+4>>2]=g;c[e+8>>2]=438;e=ly(Y(5,e|0)|0)|0;if((e|0)>=0){b=rz(e,d)|0;if(!b){aa(e|0)|0;b=0}}else b=0}else{c[(mx()|0)>>2]=28;b=0}yb=f;return b|0}function qz(b){b=b|0;var c=0,d=0,e=0;d=(Qy(b,43)|0)==0;c=a[b>>0]|0;d=d?c<<24>>24!=114&1:2;e=(Qy(b,120)|0)==0;d=e?d:d|128;b=(Qy(b,101)|0)==0;b=b?d:d|524288;b=c<<24>>24==114?b:b|64;b=c<<24>>24==119?b|512:b;return (c<<24>>24==97?b|1024:b)|0}function rz(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;j=yb;yb=yb+48|0;i=j+24|0;g=j+8|0;f=j;h=j+40|0;if(Qy(46770,a[d>>0]|0)|0){e=DO(1176)|0;if(!e)e=0;else{_O(e|0,0,144)|0;k=(Qy(d,43)|0)==0;d=a[d>>0]|0;if(k)c[e>>2]=d<<24>>24==114?8:4;if(d<<24>>24==97){c[f>>2]=b;c[f+4>>2]=3;d=X(221,f|0)|0;if(!(d&1024)){c[g>>2]=b;c[g+4>>2]=4;c[g+8>>2]=d|1024;X(221,g|0)|0}f=c[e>>2]|128;c[e>>2]=f}else f=c[e>>2]|0;c[e+60>>2]=b;c[e+44>>2]=e+152;c[e+48>>2]=1024;d=e+75|0;a[d>>0]=-1;if((f&8|0)==0?(c[i>>2]=b,c[i+4>>2]=21523,c[i+8>>2]=h,(Z(54,i|0)|0)==0):0)a[d>>0]=10;c[e+32>>2]=2;c[e+36>>2]=1;c[e+40>>2]=1;c[e+12>>2]=2;if(!(c[13884]|0))c[e+76>>2]=-1;sz(e)|0}}else{c[(mx()|0)>>2]=28;e=0}yb=j;return e|0}function sz(a){a=a|0;var b=0,d=0;b=tz()|0;c[a+56>>2]=c[b>>2];d=c[b>>2]|0;if(d|0)c[d+52>>2]=a;c[b>>2]=a;uz();return a|0}function tz(){U(55640);return 55648}function uz(){$(55640);return}function vz(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if((c[a+76>>2]|0)>-1)f=Nx(a)|0;else f=0;kz(a);g=(c[a>>2]&1|0)!=0;if(!g){e=tz()|0;d=c[a+52>>2]|0;b=a+56|0;if(d|0)c[d+56>>2]=c[b>>2];b=c[b>>2]|0;if(b|0)c[b+52>>2]=d;if((c[e>>2]|0)==(a|0))c[e>>2]=b;uz()}b=wz(a)|0;b=Eb[c[a+12>>2]&127](a)|0|b;d=c[a+96>>2]|0;if(d|0)EO(d);if(g){if(f|0)Ox(a)}else EO(a);return b|0}function wz(a){a=a|0;var b=0,d=0;do if(a){if((c[a+76>>2]|0)<=-1){b=xz(a)|0;break}d=(Nx(a)|0)==0;b=xz(a)|0;if(!d)Ox(a)}else{if(!(c[4004]|0))b=0;else b=wz(c[4004]|0)|0;a=c[(tz()|0)>>2]|0;if(a)do{if((c[a+76>>2]|0)>-1)d=Nx(a)|0;else d=0;if((c[a+20>>2]|0)>>>0>(c[a+28>>2]|0)>>>0)b=xz(a)|0|b;if(d|0)Ox(a);a=c[a+56>>2]|0}while((a|0)!=0);uz()}while(0);return b|0}function xz(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=a+20|0;h=a+28|0;if((c[b>>2]|0)>>>0>(c[h>>2]|0)>>>0?(Hb[c[a+36>>2]&63](a,0,0)|0,(c[b>>2]|0)==0):0)a=-1;else{d=a+4|0;e=c[d>>2]|0;f=a+8|0;g=c[f>>2]|0;if(e>>>0>>0){g=e-g|0;Ib[c[a+40>>2]&15](a,g,((g|0)<0)<<31>>31,1)|0;F()|0}c[a+16>>2]=0;c[h>>2]=0;c[b>>2]=0;c[f>>2]=0;c[d>>2]=0;a=0}return a|0}function yz(b,e,f){b=b|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;if((c[f+76>>2]|0)>-1)m=Nx(f)|0;else m=0;g=e+-1|0;if((e|0)<2){n=f+74|0;l=a[n>>0]|0;a[n>>0]=l+255|l;if(m|0)Ox(f);if(!g)a[b>>0]=0;else b=0}else{a:do if(g){k=f+4|0;l=f+8|0;e=b;while(1){h=c[k>>2]|0;o=h;p=(c[l>>2]|0)-o|0;j=Vx(h,10,p)|0;i=(j|0)==0;j=i?p:1-o+j|0;j=j>>>0>>0?j:g;YO(e|0,h|0,j|0)|0;h=(c[k>>2]|0)+j|0;c[k>>2]=h;e=e+j|0;j=g-j|0;if(!(i&(j|0)!=0)){n=17;break a}if(h>>>0>=(c[l>>2]|0)>>>0){g=yx(f)|0;if((g|0)<0)break;else h=g}else{c[k>>2]=h+1;h=d[h>>0]|0}i=e+1|0;a[e>>0]=h;g=j+-1|0;if((h&255|0)==10|(g|0)==0){e=i;n=17;break a}else e=i}if((e|0)!=(b|0)?(c[f>>2]&16|0)!=0:0)n=17;else b=0}else{e=b;n=17}while(0);if((n|0)==17)if(!b)b=0;else a[e>>0]=0;if(m)Ox(f)}return b|0}function zz(a){a=a|0;var b=0;if((c[a+76>>2]|0)>-1){b=(Nx(a)|0)==0;a=(c[a>>2]|0)>>>5&1}else a=(c[a>>2]|0)>>>5&1;return a|0}function Az(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=yb;yb=yb+16|0;f=e;c[f>>2]=d;d=Bz(a,b,f)|0;yb=e;return d|0}function Bz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=yb;yb=yb+144|0;f=e;_O(f|0,0,144)|0;c[f+32>>2]=35;c[f+44>>2]=a;c[f+76>>2]=-1;c[f+84>>2]=a;d=Dz(f,b,d)|0;yb=e;return d|0}function Cz(a,b,c){a=a|0;b=b|0;c=c|0;return Hz(a,b,c)|0}function Dz(e,h,i){e=e|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0.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,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;Q=yb;yb=yb+288|0;K=Q+264|0;L=Q;M=Q+260|0;N=Q+272|0;if((c[e+76>>2]|0)>-1)P=Nx(e)|0;else P=0;j=a[h>>0]|0;a:do if(j<<24>>24){B=e+4|0;C=e+104|0;D=e+120|0;E=e+8|0;G=L+10|0;H=L+33|0;I=L+46|0;J=L+94|0;A=K+4|0;m=h;h=0;k=0;l=j;j=0;u=0;v=0;b:while(1){c:do if(!(xx(l&255)|0)){n=(a[m>>0]|0)==37;d:do if(n){l=m+1|0;o=a[l>>0]|0;e:do switch(o<<24>>24){case 37:break d;case 42:{z=0;l=m+2|0;break}default:{if(Ex(o&255)|0?(a[m+2>>0]|0)==36:0){z=Ez(i,(d[l>>0]|0)+-48|0)|0;l=m+3|0;break e}y=(c[i>>2]|0)+(4-1)&~(4-1);z=c[y>>2]|0;c[i>>2]=y+4}}while(0);if(!(Ex(d[l>>0]|0)|0)){r=0;o=l}else{m=0;do{m=(m*10|0)+-48+(d[l>>0]|0)|0;l=l+1|0}while((Ex(d[l>>0]|0)|0)!=0);r=m;o=l}n=a[o>>0]|0;q=o+1|0;if(n<<24>>24==109){l=(z|0)!=0&1;k=0;m=q;o=o+2|0;n=a[q>>0]|0;j=0}else{l=0;m=o;o=q}switch(n<<24>>24){case 104:{y=(a[o>>0]|0)==104;n=y?-2:-1;m=y?m+2|0:o;break}case 108:{y=(a[o>>0]|0)==108;n=y?3:1;m=y?m+2|0:o;break}case 106:{n=3;m=o;break}case 116:case 122:{n=1;m=o;break}case 76:{n=2;m=o;break}case 110:case 112:case 67:case 83:case 91:case 99:case 115:case 88:case 71:case 70:case 69:case 65:case 103:case 102:case 101:case 97:case 120:case 117:case 111:case 105:case 100:{n=0;break}default:{O=143;break b}}s=d[m>>0]|0;t=(s&47|0)==3;s=t?s|32:s;t=t?1:n;q=s&255;switch(q<<24>>24){case 99:{y=(r|0)>1?r:1;break}case 91:{y=r;break}case 110:{Fz(z,t,u,v);n=u;o=v;break c}default:{ux(e,0,0);do{n=c[B>>2]|0;if(n>>>0<(c[C>>2]|0)>>>0){c[B>>2]=n+1;n=d[n>>0]|0}else n=wx(e)|0}while((xx(n)|0)!=0);if(!(c[C>>2]|0))n=c[B>>2]|0;else{n=(c[B>>2]|0)+-1|0;c[B>>2]=n}x=D;y=n-(c[E>>2]|0)|0;u=MO(c[x>>2]|0,c[x+4>>2]|0,u|0,v|0)|0;u=MO(u|0,F()|0,y|0,((y|0)<0)<<31>>31|0)|0;y=r;v=F()|0}}x=((y|0)<0)<<31>>31;ux(e,y,x);o=c[B>>2]|0;n=c[C>>2]|0;if(o>>>0>>0)c[B>>2]=o+1;else{if((wx(e)|0)<0){O=143;break b}n=c[C>>2]|0}if(n|0)c[B>>2]=(c[B>>2]|0)+-1;f:do switch(q<<24>>24){case 91:case 99:case 115:{w=(s|0)==99;g:do if((s|16|0)==115){_O(L|0,-1,257)|0;a[L>>0]=0;if((s|0)==115){a[H>>0]=0;b[G>>1]=0;b[G+2>>1]=0;a[G+4>>0]=0}}else{s=m+1|0;r=(a[s>>0]|0)==94;n=r&1;m=r?m+2|0:s;_O(L|0,n|0,257)|0;a[L>>0]=0;switch(a[m>>0]|0){case 45:{q=(n^1)&255;a[I>>0]=q;m=m+1|0;break}case 93:{q=(n^1)&255;a[J>>0]=q;m=m+1|0;break}default:q=(n^1)&255}while(1){n=a[m>>0]|0;h:do switch(n<<24>>24){case 0:{O=143;break b}case 93:break g;case 45:{o=m+1|0;n=a[o>>0]|0;switch(n<<24>>24){case 93:case 0:{n=45;break h}default:{}}m=a[m+-1>>0]|0;if((m&255)<(n&255)){m=m&255;do{m=m+1|0;a[L+m>>0]=q;n=a[o>>0]|0}while(m>>>0<(n&255)>>>0);m=o}else m=o;break}default:{}}while(0);a[L+((n&255)+1)>>0]=q;m=m+1|0}}while(0);n=w?y+1|0:31;s=(t|0)==1;t=(l|0)!=0;i:do if(s){if(t){j=DO(n<<2)|0;if(!j){k=0;j=0;O=143;break b}}else j=z;c[K>>2]=0;c[A>>2]=0;k=0;j:while(1){q=(j|0)==0;do{k:while(1){o=c[B>>2]|0;if(o>>>0<(c[C>>2]|0)>>>0){c[B>>2]=o+1;o=d[o>>0]|0}else o=wx(e)|0;if(!(a[L+(o+1)>>0]|0))break j;a[N>>0]=o;switch(Vy(M,N,1,K)|0){case -1:{k=0;O=143;break b}case -2:break;default:break k}}if(!q){c[j+(k<<2)>>2]=c[M>>2];k=k+1|0}}while(!(t&(k|0)==(n|0)));n=n<<1|1;o=GO(j,n<<2)|0;if(!o){k=0;O=143;break b}else j=o}if(!(Gz(K)|0)){k=0;O=143;break b}else{q=k;k=0;r=j}}else{if(t){k=DO(n)|0;if(!k){k=0;j=0;O=143;break b}j=0;while(1){q=j;do{j=c[B>>2]|0;if(j>>>0<(c[C>>2]|0)>>>0){c[B>>2]=j+1;j=d[j>>0]|0}else j=wx(e)|0;if(!(a[L+(j+1)>>0]|0)){r=0;j=0;break i}r=q;q=q+1|0;a[k+r>>0]=j}while((q|0)!=(n|0));n=n<<1|1;o=GO(k,n)|0;if(!o){j=0;O=143;break b}else{j=q;k=o}}}if(!z)while(1){j=c[B>>2]|0;if(j>>>0<(c[C>>2]|0)>>>0){c[B>>2]=j+1;j=d[j>>0]|0}else j=wx(e)|0;if(!(a[L+(j+1)>>0]|0)){q=0;k=0;r=0;j=0;break i}}k=0;while(1){j=c[B>>2]|0;if(j>>>0<(c[C>>2]|0)>>>0){c[B>>2]=j+1;j=d[j>>0]|0}else j=wx(e)|0;if(!(a[L+(j+1)>>0]|0)){q=k;k=z;r=0;j=0;break i}a[z+k>>0]=j;k=k+1|0}}while(0);if(!(c[C>>2]|0))n=c[B>>2]|0;else{n=(c[B>>2]|0)+-1|0;c[B>>2]=n}o=D;n=n-(c[E>>2]|0)|0;n=MO(c[o>>2]|0,c[o+4>>2]|0,n|0,((n|0)<0)<<31>>31|0)|0;o=F()|0;if((n|0)==0&(o|0)==0)break b;if(!((n|0)==(y|0)&(o|0)==(x|0)|w^1))break b;do if(t)if(s){c[z>>2]=r;break}else{c[z>>2]=k;break}while(0);if(!w){if(r|0)c[r+(q<<2)>>2]=0;if(!k){k=0;break f}a[k+q>>0]=0}break}case 120:case 88:case 112:{n=16;O=131;break}case 111:{n=8;O=131;break}case 117:case 100:{n=10;O=131;break}case 105:{n=0;O=131;break}case 71:case 103:case 70:case 102:case 69:case 101:case 65:case 97:{p=+By(e,t,0);y=D;w=c[y>>2]|0;y=c[y+4>>2]|0;x=(c[B>>2]|0)-(c[E>>2]|0)|0;x=NO(0,0,x|0,((x|0)<0)<<31>>31|0)|0;if((w|0)==(x|0)&(y|0)==(F()|0))break b;if(z)switch(t|0){case 0:{f[z>>2]=p;break f}case 1:{g[z>>3]=p;break f}case 2:{g[z>>3]=p;break f}default:break f}break}default:{}}while(0);do if((O|0)==131){O=0;n=vx(e,n,0,-1,-1)|0;o=F()|0;y=D;w=c[y>>2]|0;y=c[y+4>>2]|0;x=(c[B>>2]|0)-(c[E>>2]|0)|0;x=NO(0,0,x|0,((x|0)<0)<<31>>31|0)|0;if((w|0)==(x|0)&(y|0)==(F()|0))break b;if((z|0)!=0&(s|0)==112){c[z>>2]=n;break}else{Fz(z,t,n,o);break}}while(0);o=D;n=(c[B>>2]|0)-(c[E>>2]|0)|0;o=MO(c[o>>2]|0,c[o+4>>2]|0,u|0,v|0)|0;n=MO(o|0,F()|0,n|0,((n|0)<0)<<31>>31|0)|0;h=h+((z|0)!=0&1)|0;o=F()|0;break c}while(0);m=m+(n&1)|0;ux(e,0,0);l=c[B>>2]|0;if(l>>>0<(c[C>>2]|0)>>>0){c[B>>2]=l+1;l=d[l>>0]|0}else l=wx(e)|0;if((l|0)!=(d[m>>0]|0)){O=23;break b}n=MO(u|0,v|0,1,0)|0;o=F()|0}else{while(1){l=m+1|0;if(!(xx(d[l>>0]|0)|0))break;else m=l}ux(e,0,0);do{l=c[B>>2]|0;if(l>>>0<(c[C>>2]|0)>>>0){c[B>>2]=l+1;l=d[l>>0]|0}else l=wx(e)|0}while((xx(l)|0)!=0);if(!(c[C>>2]|0))l=c[B>>2]|0;else{l=(c[B>>2]|0)+-1|0;c[B>>2]=l}o=D;n=l-(c[E>>2]|0)|0;o=MO(c[o>>2]|0,c[o+4>>2]|0,u|0,v|0)|0;n=MO(o|0,F()|0,n|0,((n|0)<0)<<31>>31|0)|0;o=F()|0}while(0);m=m+1|0;l=a[m>>0]|0;if(!(l<<24>>24))break a;else{u=n;v=o}}if((O|0)==23){if(c[C>>2]|0)c[B>>2]=(c[B>>2]|0)+-1;if((h|0)!=0|(l|0)>-1)break;else{l=0;h=k;O=144}}else if((O|0)==143)if(!h){h=k;O=144}if((O|0)==144){k=h;h=-1}if(l){EO(k);EO(j)}}else h=0;while(0);if(P|0)Ox(e);yb=Q;return h|0}function Ez(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=yb;yb=yb+16|0;d=e;c[d>>2]=c[a>>2];while(1){f=(c[d>>2]|0)+(4-1)&~(4-1);a=c[f>>2]|0;c[d>>2]=f+4;if(b>>>0>1)b=b+-1|0;else break}yb=e;return a|0}function Fz(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;a:do if(d|0)switch(e|0){case -2:{a[d>>0]=f;break a}case -1:{b[d>>1]=f;break a}case 0:{c[d>>2]=f;break a}case 1:{c[d>>2]=f;break a}case 3:{e=d;c[e>>2]=f;c[e+4>>2]=g;break a}default:break a}while(0);return}function Gz(a){a=a|0;if(!a)a=1;else a=(c[a>>2]|0)==0&1;return a|0}function Hz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=a+84|0;g=c[e>>2]|0;h=d+256|0;f=Vx(g,0,h)|0;f=(f|0)==0?h:f-g|0;d=f>>>0>>0?f:d;YO(b|0,g|0,d|0)|0;c[a+4>>2]=g+d;b=g+f|0;c[a+8>>2]=b;c[e>>2]=b;return d|0}function Iz(a,b,c){a=a|0;b=b|0;c=c|0;return Kz(a,b,((b|0)<0)<<31>>31,c)|0}function Jz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=yb;yb=yb+16|0;f=e;c[f>>2]=d;d=Ix(a,b,f)|0;yb=e;return d|0}function Kz(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;if((c[a+76>>2]|0)>-1){f=(Nx(a)|0)==0;b=Lz(a,b,d,e)|0;if(!f)Ox(a)}else b=Lz(a,b,d,e)|0;return b|0} +function Ct(a,b,d,e,g,h){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=h|0;var i=0.0,j=0,k=0,l=0.0,m=0,n=0,o=0,p=0.0,q=0,r=0,s=0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;B=yb;yb=yb+80|0;A=B+48|0;w=B;x=B+76|0;y=B+72|0;z=B+64|0;u=B+56|0;v=e+4|0;t=+(a|0);p=+(b|0);q=z+4|0;r=u+4|0;s=h+4812|0;j=0;k=0;o=0;a:while(1){if((o|0)>=(c[v>>2]|0)){b=28;break}b=0;while(1){if((b|0)==3)break;a=0;while(1){if((a|0)==4)break;c[w+(b<<4)+(a<<2)>>2]=c[d+(o*48|0)+(b<<4)+(a<<2)>>2];a=a+1|0}b=b+1|0}a=j;b=k;n=0;j=c[(c[e>>2]|0)+(o*112|0)+4>>2]|0;while(1){if((n|0)>=(c[j+4>>2]|0))break;m=0;k=j;while(1){j=c[k>>2]|0;if((m|0)>=(c[j+(n*20|0)+4>>2]|0))break;k=c[j+(n*20|0)>>2]|0;k=(Bf(0,w,+f[k+(m*20|0)+8>>2],+f[k+(m*20|0)+12>>2],x,y)|0)<0;i=+f[x>>2];do if(!(k|i<0.0)?(l=+f[y>>2],!(l>=p)&(!(i>=t)&!(l<0.0))):0){j=c[(c[c[(c[e>>2]|0)+(o*112|0)+4>>2]>>2]|0)+(n*20|0)>>2]|0;c[z>>2]=c[j+(m*20|0)+8>>2];c[q>>2]=c[j+(m*20|0)+12>>2];lf(0,w,z,u)|0;i=+f[r>>2];j=c[c[(c[e>>2]|0)+(o*112|0)+4>>2]>>2]|0;l=+f[j+(n*20|0)+12>>2];if(i<=l?i>=+f[j+(n*20|0)+16>>2]:0){if((b|0)==200){b=18;break a}c[g+(b*24|0)>>2]=o;c[g+(b*24|0)+4>>2]=n;c[g+(b*24|0)+8>>2]=m;c[g+(b*24|0)+16>>2]=c[x>>2];c[g+(b*24|0)+20>>2]=c[y>>2];c[g+(b*24|0)+12>>2]=0;b=b+1|0;break}if(i<=l*2.0?i>=+f[j+(n*20|0)+16>>2]*.5:0)if((a|0)==200){c[s>>2]=-1;a=200;break}else{c[h+(a*24|0)>>2]=o;c[h+(a*24|0)+4>>2]=n;c[h+(a*24|0)+8>>2]=m;c[h+(a*24|0)+16>>2]=c[x>>2];c[h+(a*24|0)+20>>2]=c[y>>2];c[h+(a*24|0)+12>>2]=0;a=a+1|0;break}}while(0);m=m+1|0;k=c[(c[e>>2]|0)+(o*112|0)+4>>2]|0}n=n+1|0;j=k}j=a;k=b;o=o+1|0}if((b|0)==18){Se(0,3,41890,A);a=g+4812|0}else if((b|0)==28){c[g+(k*24|0)+12>>2]=-1;a=h+(j*24|0)+12|0}c[a>>2]=-1;yb=B;return}function Dt(a,b,d,e,h,i,j){a=a|0;b=b|0;d=d|0;e=e|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0.0,n=0.0,o=0.0,p=0,q=0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0.0,y=0.0;w=yb;yb=yb+224|0;s=w+212|0;t=w+96|0;v=w;u=w+192|0;l=DO(h<<4)|0;c[s>>2]=l;if(!l){Se(0,3,41858,w+200|0);Ea(1)}p=DO(h*24|0)|0;q=s+4|0;c[q>>2]=p;if(!p){Se(0,3,41858,w+208|0);Ea(1)}k=0;o=0.0;n=0.0;m=0.0;while(1){if((k|0)>=(h|0))break;r=m+ +f[e+(k*12|0)>>2];x=n+ +f[e+(k*12|0)+4>>2];y=o+ +f[e+(k*12|0)+8>>2];k=k+1|0;o=y;n=x;m=r}y=+(h|0);r=m/y;n=n/y;m=o/y;k=0;while(1){if((k|0)>=(h|0))break;g[l+(k<<4)>>3]=+f[d+(k<<3)>>2];g[l+(k<<4)+8>>3]=+f[d+(k<<3)+4>>2];g[p+(k*24|0)>>3]=+f[e+(k*12|0)>>2]-r;g[p+(k*24|0)+8>>3]=+f[e+(k*12|0)+4>>2]-n;g[p+(k*24|0)+16>>3]=+f[e+(k*12|0)+8>>2]-m;k=k+1|0}c[s+8>>2]=h;k=0;while(1){if((k|0)==3)break;l=0;while(1){if((l|0)==3)break;g[t+(k<<5)+(l<<3)>>3]=+f[b+(k<<4)+(l<<2)>>2];l=l+1|0}k=k+1|0}g[t+24>>3]=+f[b+12>>2]+(r*+f[b>>2]+n*+f[b+4>>2]+m*+f[b+8>>2]);g[t+56>>3]=+f[b+28>>2]+(r*+f[b+16>>2]+n*+f[b+20>>2]+m*+f[b+24>>2]);g[t+88>>3]=+f[b+44>>2]+(r*+f[b+32>>2]+n*+f[b+36>>2]+m*+f[b+40>>2]);if(!j){if((Fe(a,s,t,v,u)|0)<0)g[u>>3]=1.0e8}else if((He(a,s,t,v,u)|0)<0)g[u>>3]=1.0e8;EO(c[s>>2]|0);EO(c[q>>2]|0);k=0;while(1){if((k|0)==3)break;l=0;while(1){if((l|0)==3)break;f[i+(k<<4)+(l<<2)>>2]=+g[v+(k<<5)+(l<<3)>>3];l=l+1|0}k=k+1|0}x=n;y=m;f[i+12>>2]=+g[v+24>>3]-+g[v>>3]*r-+g[v+8>>3]*x-+g[v+16>>3]*y;f[i+28>>2]=+g[v+56>>3]-+g[v+32>>3]*r-+g[v+40>>3]*x-+g[v+48>>3]*y;f[i+44>>2]=+g[v+88>>3]-+g[v+64>>3]*r-+g[v+72>>3]*x-+g[v+80>>3]*y;yb=w;return +(+g[u>>3])}function Et(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;if(!f)g=+Ft(a,b,c,d,e);else g=+Gt(a,b,c,d,e,g);return +g}function Ft(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var g=0.0,h=0,i=0,j=0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0.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,L=0.0,M=0.0,N=0.0;H=yb;yb=yb+48|0;i=H+40|0;h=H+32|0;F=H;do if((d|0)>=4?(j=a+44|0,!(+f[j>>2]==0.0)):0){G=DO(d<<6)|0;if(!G){Se(0,3,41875,h);g=-1.0;break}E=DO(d<<3)|0;if(!E){Se(0,3,41875,i);EO(G);g=-1.0;break}h=0;while(1){if((h|0)==3)break;i=0;while(1){if((i|0)==4)break;f[e+(h<<4)+(i<<2)>>2]=+f[a+(h<<4)+(i<<2)>>2]/+f[j>>2];i=i+1|0}h=h+1|0}a=e+4|0;j=e+12|0;q=e+16|0;r=e+20|0;s=e+28|0;t=e+32|0;u=e+36|0;v=+(d|0);w=d<<1;x=F+4|0;y=F+8|0;z=F+12|0;A=F+16|0;B=F+20|0;C=F+24|0;D=F+28|0;p=0.0;i=0;a:while(1){g=0.0;h=0;while(1){if((h|0)>=(d|0))break;k=+f[c+(h*12|0)>>2];l=+f[c+(h*12|0)+4>>2];m=+f[j>>2]+(+f[e>>2]*k+ +f[a>>2]*l);n=+f[s>>2]+(k*+f[q>>2]+l*+f[r>>2]);o=k*+f[t>>2]+l*+f[u>>2]+1.0;if(o==0.0){h=17;break a}L=o*o;J=+f[b+(h<<3)>>2]-m/o;I=+f[b+(h<<3)+4>>2]-n/o;K=h<<1;f[E+(K<<2)>>2]=J;f[E+((K|1)<<2)>>2]=I;N=k/o;K=h<<4;f[G+(K<<2)>>2]=N;M=l/o;f[G+((K|1)<<2)>>2]=M;o=1.0/o;f[G+((K|2)<<2)>>2]=o;f[G+((K|3)<<2)>>2]=0.0;f[G+((K|4)<<2)>>2]=0.0;f[G+((K|5)<<2)>>2]=0.0;f[G+((K|6)<<2)>>2]=-(k*m)/L;f[G+((K|7)<<2)>>2]=-(l*m)/L;f[G+((K|8)<<2)>>2]=0.0;f[G+((K|9)<<2)>>2]=0.0;f[G+((K|10)<<2)>>2]=0.0;f[G+((K|11)<<2)>>2]=N;f[G+((K|12)<<2)>>2]=M;f[G+((K|13)<<2)>>2]=o;f[G+((K|14)<<2)>>2]=-(k*n)/L;f[G+((K|15)<<2)>>2]=-(l*n)/L;g=g+(J*J+I*I);h=h+1|0}g=g/v;if(g<.10000000149011612){h=26;break}if((i|0)!=0&g<4.0){if((i|0)==10|g/p>.9900000095367432){h=26;break}}else if((i|0)==10){h=26;break}if((It(F,E,G,w)|0)<0){h=24;break}f[e>>2]=+f[F>>2]+ +f[e>>2];f[a>>2]=+f[x>>2]+ +f[a>>2];f[j>>2]=+f[y>>2]+ +f[j>>2];f[q>>2]=+f[z>>2]+ +f[q>>2];f[r>>2]=+f[A>>2]+ +f[r>>2];f[s>>2]=+f[B>>2]+ +f[s>>2];f[t>>2]=+f[C>>2]+ +f[t>>2];f[u>>2]=+f[D>>2]+ +f[u>>2];p=g;i=i+1|0}if((h|0)==17){EO(G);EO(E);g=1.0e8;break}else if((h|0)==24){EO(G);EO(E);g=1.0e8;break}else if((h|0)==26){EO(G);EO(E);break}}else g=1.0e8;while(0);yb=H;return +g}function Gt(a,b,c,d,e,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=+g;var h=0,i=0,j=0,k=0,l=0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.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.0,H=0,I=0,J=0,K=0.0,L=0.0,M=0.0,N=0,O=0;J=yb;yb=yb+64|0;k=J+56|0;j=J+48|0;i=J+40|0;h=J+32|0;I=J;do if((d|0)>=4?(l=a+44|0,!(+f[l>>2]==0.0)):0){G=+(d|0);m=~~(G*g)+-1|0;m=(m|0)>4?m:4;H=DO(d<<6)|0;if(!H){Se(0,3,41875,h);g=-1.0;break}F=DO(d<<3)|0;if(!F){Se(0,3,41875,i);EO(H);g=-1.0;break}h=d<<2;E=DO(h)|0;if(!E){Se(0,3,41875,j);EO(H);EO(F);g=-1.0;break}D=DO(h)|0;if(!D){Se(0,3,41875,k);EO(H);EO(F);EO(E);g=-1.0;break}h=0;while(1){if((h|0)==3)break;i=0;while(1){if((i|0)==4)break;f[e+(h<<4)+(i<<2)>>2]=+f[a+(h<<4)+(i<<2)>>2]/+f[l>>2];i=i+1|0}h=h+1|0}w=e+4|0;x=e+12|0;y=e+16|0;z=e+20|0;A=e+28|0;B=e+32|0;C=e+36|0;k=D+(m<<2)|0;a=I+4|0;l=I+8|0;m=I+12|0;s=I+16|0;t=I+20|0;u=I+24|0;v=I+28|0;r=0.0;j=0;a:while(1){h=0;while(1){if((h|0)>=(d|0))break;g=+f[c+(h*12|0)>>2];n=+f[c+(h*12|0)+4>>2];o=+f[x>>2]+(+f[e>>2]*g+ +f[w>>2]*n);p=+f[A>>2]+(g*+f[y>>2]+n*+f[z>>2]);q=g*+f[B>>2]+n*+f[C>>2]+1.0;if(q==0.0){h=21;break a}K=q*q;L=+f[b+(h<<3)>>2]-o/q;M=+f[b+(h<<3)+4>>2]-p/q;i=h<<1;f[F+(i<<2)>>2]=L;f[F+((i|1)<<2)>>2]=M;M=L*L+M*M;f[D+(h<<2)>>2]=M;f[E+(h<<2)>>2]=M;M=g/q;i=h<<4;f[H+(i<<2)>>2]=M;L=n/q;f[H+((i|1)<<2)>>2]=L;q=1.0/q;f[H+((i|2)<<2)>>2]=q;f[H+((i|3)<<2)>>2]=0.0;f[H+((i|4)<<2)>>2]=0.0;f[H+((i|5)<<2)>>2]=0.0;f[H+((i|6)<<2)>>2]=-(g*o)/K;f[H+((i|7)<<2)>>2]=-(n*o)/K;f[H+((i|8)<<2)>>2]=0.0;f[H+((i|9)<<2)>>2]=0.0;f[H+((i|10)<<2)>>2]=0.0;f[H+((i|11)<<2)>>2]=M;f[H+((i|12)<<2)>>2]=L;f[H+((i|13)<<2)>>2]=q;f[H+((i|14)<<2)>>2]=-(g*p)/K;f[H+((i|15)<<2)>>2]=-(n*p)/K;h=h+1|0}my(D,d,4,32);p=+f[k>>2]*4.0;p=p<16.0?16.0:p;o=p/6.0;n=0.0;h=0;while(1){if((h|0)==(d|0))break;g=+f[D+(h<<2)>>2];if(g>p)g=o;else{g=1.0-g/p;g=o*(1.0-g*(g*g))}n=n+g;h=h+1|0}g=n/G;if(g<.10000000149011612){h=42;break}if((j|0)!=0&g<4.0){if((j|0)==10|g/r>.9900000095367432){h=42;break}}else if((j|0)==10){h=42;break}h=0;i=0;while(1){if((i|0)==(d|0))break;n=+f[E+(i<<2)>>2];if(n<=p){M=1.0-n/p;M=M*M;O=i<<4;N=h<<3;f[H+(N<<2)>>2]=M*+f[H+(O<<2)>>2];f[H+((N|1)<<2)>>2]=M*+f[H+((O|1)<<2)>>2];f[H+((N|2)<<2)>>2]=M*+f[H+((O|2)<<2)>>2];f[H+((N|3)<<2)>>2]=M*+f[H+((O|3)<<2)>>2];f[H+((N|4)<<2)>>2]=M*+f[H+((O|4)<<2)>>2];f[H+((N|5)<<2)>>2]=M*+f[H+((O|5)<<2)>>2];f[H+((N|6)<<2)>>2]=M*+f[H+((O|6)<<2)>>2];f[H+((N|7)<<2)>>2]=M*+f[H+((O|7)<<2)>>2];f[H+(N+8<<2)>>2]=M*+f[H+((O|8)<<2)>>2];f[H+(N+9<<2)>>2]=M*+f[H+((O|9)<<2)>>2];f[H+(N+10<<2)>>2]=M*+f[H+((O|10)<<2)>>2];f[H+(N+11<<2)>>2]=M*+f[H+((O|11)<<2)>>2];f[H+(N+12<<2)>>2]=M*+f[H+((O|12)<<2)>>2];f[H+(N+13<<2)>>2]=M*+f[H+((O|13)<<2)>>2];f[H+(N+14<<2)>>2]=M*+f[H+((O|14)<<2)>>2];f[H+(N+15<<2)>>2]=M*+f[H+((O|15)<<2)>>2];N=i<<1;f[F+(h<<2)>>2]=M*+f[F+(N<<2)>>2];f[F+(h+1<<2)>>2]=M*+f[F+((N|1)<<2)>>2];h=h+2|0}i=i+1|0}if((h|0)<6){h=38;break}if((It(I,F,H,h)|0)<0){h=40;break}f[e>>2]=+f[I>>2]+ +f[e>>2];f[w>>2]=+f[a>>2]+ +f[w>>2];f[x>>2]=+f[l>>2]+ +f[x>>2];f[y>>2]=+f[m>>2]+ +f[y>>2];f[z>>2]=+f[s>>2]+ +f[z>>2];f[A>>2]=+f[t>>2]+ +f[A>>2];f[B>>2]=+f[u>>2]+ +f[B>>2];f[C>>2]=+f[v>>2]+ +f[C>>2];r=g;j=j+1|0}if((h|0)==21){EO(H);EO(F);EO(E);EO(D);g=1.0e8;break}else if((h|0)==38){EO(H);EO(F);EO(E);EO(D);g=-1.0;break}else if((h|0)==40){EO(H);EO(F);EO(E);EO(D);g=1.0e8;break}else if((h|0)==42){EO(H);EO(F);EO(E);EO(D);break}}else g=1.0e8;while(0);yb=J;return +g}function Ht(a,b){a=a|0;b=b|0;var c=0.0;c=+f[a>>2]-+f[b>>2];return (c<0.0?-1:c>0.0&1)|0}function It(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=yb;yb=yb+48|0;h=i+24|0;g=i+12|0;f=i;c[h+4>>2]=8;c[h+8>>2]=1;c[h>>2]=a;c[g+4>>2]=e;c[g+8>>2]=1;c[g>>2]=b;c[f+4>>2]=e;c[f+8>>2]=8;c[f>>2]=d;e=Hd(f)|0;if(!e)a=-1;else{d=Fd(e,f)|0;if(!d)a=-1;else{b=Fd(e,g)|0;if(!b)a=-1;else{if((Xd(d)|0)<0)a=-1;else{Md(h,d,b)|0;a=0}Kd(b)|0}Kd(d)|0}Kd(e)|0}yb=i;return a|0}function Jt(a,b,d,e,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0;s=yb;yb=yb+32|0;j=s;q=s+28|0;r=s+24|0;o=c[d>>2]|0;p=c[d+4>>2]|0;n=c[d+8>>2]|0;d=c[h>>2]|0;if(!d){d=yf(c[a+28>>2]|0,c[a+32>>2]|0)|0;c[h>>2]=d}k=a+12|0;m=a+48+(o*48|0)|0;l=c[b>>2]|0;if((zf(c[k>>2]|0,m,c[l+(o*112|0)>>2]|0,(c[c[l+(o*112|0)+4>>2]>>2]|0)+(p*20|0)|0,n,d)|0)>=0?(l=c[h>>2]|0,d=c[l+28>>2]|0,t=+(B(d,d)|0),!(+(B((c[l+16>>2]|0)+1+(c[l+20>>2]|0)|0,(c[l+8>>2]|0)+1+(c[l+12>>2]|0)|0)|0)*5.0*5.0>t)):0){l=c[b+152>>2]|0;do if((l|0)!=1){d=c[k>>2]|0;k=a+528+(o*48|0)|0;if((l|0)==2){Af(d,m,k,0,(c[(c[c[(c[b>>2]|0)+(o*112|0)+4>>2]>>2]|0)+(p*20|0)>>2]|0)+(n*20|0)|0,j);break}else{Af(d,m,k,a+1008+(o*48|0)|0,(c[(c[c[(c[b>>2]|0)+(o*112|0)+4>>2]>>2]|0)+(p*20|0)>>2]|0)+(n*20|0)|0,j);break}}else Af(c[k>>2]|0,m,0,0,(c[(c[c[(c[b>>2]|0)+(o*112|0)+4>>2]>>2]|0)+(p*20|0)>>2]|0)+(n*20|0)|0,j);while(0);m=c[a+24>>2]|0;if((uf(e,g,c[a+4>>2]|0,c[a+8>>2]|0,c[a+20>>2]|0,c[h>>2]|0,m,m,j,q,r,i)|0)>=0){f[i+4>>2]=+(c[q>>2]|0);f[i+8>>2]=+(c[r>>2]|0);r=c[b>>2]|0;j=c[(c[c[r+(o*112|0)+4>>2]>>2]|0)+(p*20|0)>>2]|0;q=j+(n*20|0)+8|0;j=j+(n*20|0)+12|0;f[i+12>>2]=+f[r+(o*112|0)+24>>2]+(+f[r+(o*112|0)+12>>2]*+f[q>>2]+ +f[r+(o*112|0)+16>>2]*+f[j>>2]);f[i+16>>2]=+f[r+(o*112|0)+40>>2]+(+f[r+(o*112|0)+28>>2]*+f[q>>2]+ +f[r+(o*112|0)+32>>2]*+f[j>>2]);f[i+20>>2]=+f[r+(o*112|0)+56>>2]+(+f[r+(o*112|0)+44>>2]*+f[q>>2]+ +f[r+(o*112|0)+48>>2]*+f[j>>2]);j=0}else j=-1}else j=-1;yb=s;return j|0}function Kt(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=a+20|0;b=c[k>>2]|0;a:do switch(b|0){case 202:{Lt(a);if(!(c[a+64>>2]|0)){c[k>>2]=203;d=6;break a}c[k>>2]=207;k=1;return k|0}case 203:{d=6;break}case 204:{b=a+444|0;break}default:{d=c[a>>2]|0;c[d+20>>2]=21;c[d+24>>2]=b;Qb[c[c[a>>2]>>2]&255](a);d=17}}while(0);if((d|0)==6){g=a+460|0;b:do if(c[(c[g>>2]|0)+16>>2]|0){e=a+8|0;f=a+332|0;b=c[e>>2]|0;c:while(1){if(b|0)Qb[c[b>>2]&255](a);b=Eb[c[c[g>>2]>>2]&127](a)|0;switch(b|0){case 2:break b;case 0:break c;default:{}}d=c[e>>2]|0;if((b|2|0)==3&(d|0)!=0?(h=d+4|0,j=(c[h>>2]|0)+1|0,c[h>>2]=j,h=d+8|0,i=c[h>>2]|0,(j|0)>=(i|0)):0)c[h>>2]=(c[f>>2]|0)+i;b=d}return b|0}while(0);c[a+152>>2]=c[a+144>>2];d=17}if((d|0)==17){b=a+444|0;if((c[k>>2]|0)!=204){Qb[c[c[b>>2]>>2]&255](a);c[a+140>>2]=0;c[k>>2]=204}}d=c[b>>2]|0;d:do if(c[d+8>>2]|0){g=a+140|0;h=a+116|0;i=a+8|0;j=a+448|0;f=c[g>>2]|0;e:while(1){e=c[h>>2]|0;if(f>>>0>>0){do{d=c[i>>2]|0;if(!d)d=f;else{c[d+4>>2]=f;c[d+8>>2]=e;Qb[c[d>>2]&255](a);d=c[g>>2]|0}Vb[c[(c[j>>2]|0)+4>>2]&31](a,0,g,0);f=c[g>>2]|0;if((f|0)==(d|0)){b=0;break e}e=c[h>>2]|0}while(f>>>0>>0);d=c[b>>2]|0}Qb[c[d+4>>2]&255](a);Qb[c[c[b>>2]>>2]&255](a);c[g>>2]=0;d=c[b>>2]|0;if(!(c[d+8>>2]|0))break d;else f=0}return b|0}while(0);c[k>>2]=(c[a+68>>2]|0)==0?205:206;k=1;return k|0}function Lt(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=b+4|0;i=Hb[c[c[k>>2]>>2]&63](b,1,28)|0;c[b+444>>2]=i;c[i>>2]=115;c[i+4>>2]=116;c[i+8>>2]=0;d=c[b+212>>2]|0;if((d|0)!=8){j=c[b>>2]|0;c[j+20>>2]=16;c[j+24>>2]=d;Qb[c[c[b>>2]>>2]&255](b)}Ot(b);e=Hb[c[c[k>>2]>>2]&63](b,1,1280)|0;_O(e|0,0,512)|0;f=e+512|0;c[b+336>>2]=f;d=0;do{a[f+d>>0]=d;d=d+1|0}while((d|0)!=256);_O(e+768|0,-1,512)|0;if(!(((c[b+116>>2]|0)!=0?(c[b+112>>2]|0)!=0:0)?(g=b+120|0,(c[g>>2]|0)>=1):0)){g=c[b>>2]|0;c[g+20>>2]=33;Qb[c[g>>2]&255](b);g=b+120|0}j=i+12|0;c[j>>2]=0;h=i+16|0;c[h>>2]=Pt(b)|0;f=i+20|0;c[f>>2]=0;d=i+24|0;c[d>>2]=0;do if(!(c[b+84>>2]|0)){c[b+100>>2]=0;c[b+104>>2]=0;c[b+108>>2]=0;e=b+68|0}else{if(!(c[b+64>>2]|0)){c[b+100>>2]=0;c[b+104>>2]=0;c[b+108>>2]=0}e=b+68|0;if(c[e>>2]|0){i=c[b>>2]|0;c[i+20>>2]=48;Qb[c[i>>2]&255](b)}do if((c[g>>2]|0)==3){if(c[b+136>>2]|0){c[b+104>>2]=1;break}if(!(c[b+92>>2]|0)){c[b+100>>2]=1;break}else{c[b+108>>2]=1;break}}else{c[b+100>>2]=1;c[b+104>>2]=0;c[b+108>>2]=0;c[b+136>>2]=0}while(0);if(c[b+100>>2]|0){Qt(b);c[f>>2]=c[b+484>>2]}if((c[b+108>>2]|0)==0?(c[b+104>>2]|0)==0:0)break;Rt(b);c[d>>2]=c[b+484>>2]}while(0);if(!(c[e>>2]|0)){if(!(c[h>>2]|0)){Tt(b);Ut(b)}else St(b);Vt(b,c[b+108>>2]|0)}Wt(b);if(!(c[b+228>>2]|0))Yt(b);else Xt(b);f=b+460|0;if(!(c[(c[f>>2]|0)+16>>2]|0))d=(c[b+64>>2]|0)!=0&1;else d=1;Zt(b,d);if(!(c[e>>2]|0))_t(b,0);Qb[c[(c[k>>2]|0)+24>>2]&255](b);Qb[c[(c[f>>2]|0)+8>>2]&255](b);d=c[b+8>>2]|0;if(!d)return;if(c[b+64>>2]|0)return;if(!(c[(c[f>>2]|0)+16>>2]|0))return;k=c[b+36>>2]|0;k=(c[b+224>>2]|0)==0?k:(k*3|0)+2|0;c[d+4>>2]=0;c[d+8>>2]=B(k,c[b+332>>2]|0)|0;c[d+12>>2]=0;c[d+16>>2]=(c[b+108>>2]|0)==0?2:3;c[j>>2]=(c[j>>2]|0)+1;return}function Mt(a){a=a|0;var b=0,d=0,e=0,f=0;d=c[a+444>>2]|0;e=d+8|0;if(!(c[e>>2]|0)){b=a+84|0;do if(c[b>>2]|0?(c[a+136>>2]|0)==0:0){if(c[a+92>>2]|0?c[a+108>>2]|0:0){c[a+484>>2]=c[d+24>>2];c[e>>2]=1;break}if(!(c[a+100>>2]|0)){f=c[a>>2]|0;c[f+20>>2]=47;Qb[c[f>>2]&255](a);break}else{c[a+484>>2]=c[d+20>>2];break}}while(0);Qb[c[c[a+472>>2]>>2]&255](a);Qb[c[(c[a+452>>2]|0)+8>>2]&255](a);if(!(c[a+68>>2]|0)){if(!(c[d+16>>2]|0))Qb[c[c[a+480>>2]>>2]&255](a);Qb[c[c[a+476>>2]>>2]&255](a);if(c[b>>2]|0)Sb[c[c[a+484>>2]>>2]&63](a,c[e>>2]|0);Sb[c[c[a+456>>2]>>2]&63](a,(c[e>>2]|0)==0?0:3);Sb[c[c[a+448>>2]>>2]&63](a,0)}}else{c[e>>2]=0;Sb[c[c[a+484>>2]>>2]&63](a,0);Sb[c[c[a+456>>2]>>2]&63](a,2);Sb[c[c[a+448>>2]>>2]&63](a,2)}b=c[a+8>>2]|0;if(!b)return;d=c[d+12>>2]|0;c[b+12>>2]=d;d=((c[e>>2]|0)==0?1:2)+d|0;b=b+16|0;c[b>>2]=d;if(!(c[a+64>>2]|0))return;if(c[(c[a+460>>2]|0)+20>>2]|0)return;c[b>>2]=((c[a+108>>2]|0)==0?1:2)+d;return}function Nt(a){a=a|0;var b=0;b=c[a+444>>2]|0;if(c[a+84>>2]|0)Qb[c[(c[a+484>>2]|0)+8>>2]&255](a);b=b+12|0;c[b>>2]=(c[b>>2]|0)+1;return}function Ot(a){a=a|0;var b=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;b=c[a+20>>2]|0;if((b|0)!=202){t=c[a>>2]|0;c[t+20>>2]=21;c[t+24>>2]=b;Qb[c[c[a>>2]>>2]&255](a)}ew(a);d=c[a+216>>2]|0;t=a+36|0;b=c[t>>2]|0;o=(b|0)>0;if(o){p=c[a+324>>2]|0;q=(c[a+76>>2]|0)==0?4:8;r=a+320|0;s=c[a+328>>2]|0;if((p|0)>(q|0)){k=(s|0)>(q|0);l=p<<1;i=d;j=0;while(1){m=i+36|0;c[m>>2]=p;a:do if(k)e=s;else{h=c[r>>2]|0;g=c[i+12>>2]|0;f=1;e=s;do{f=f<<1;if((h|0)%(B(f,g)|0)|0|0)break a;e=B(s,f)|0}while((e|0)<=(q|0))}while(0);f=i+40|0;c[f>>2]=e;g=e<<1;if((p|0)<=(g|0)){if((e|0)>(l|0))c[f>>2]=l}else c[m>>2]=g;j=j+1|0;if((j|0)>=(b|0))break;else i=i+88|0}}else{m=c[a+316>>2]|0;n=(s|0)>(q|0);k=d;l=0;while(1){g=c[k+8>>2]|0;f=1;e=p;do{f=f<<1;if((m|0)%(B(f,g)|0)|0|0)break;e=B(p,f)|0}while((e|0)<=(q|0));j=k+36|0;c[j>>2]=e;b:do if(n)g=s;else{h=c[r>>2]|0;i=c[k+12>>2]|0;f=1;g=s;do{f=f<<1;if((h|0)%(B(f,i)|0)|0|0)break b;g=B(s,f)|0}while((g|0)<=(q|0))}while(0);h=k+40|0;c[h>>2]=g;f=g<<1;if((e|0)<=(f|0)){e=e<<1;if((g|0)>(e|0))c[h>>2]=e}else c[j>>2]=f;l=l+1|0;if((l|0)>=(b|0))break;else k=k+88|0}}if(o){f=a+28|0;g=a+316|0;h=a+428|0;i=a+32|0;j=a+320|0;e=0;while(1){b=B(B(c[d+8>>2]|0,c[f>>2]|0)|0,c[d+36>>2]|0)|0;c[d+44>>2]=fw(b,B(c[h>>2]|0,c[g>>2]|0)|0)|0;b=B(B(c[d+12>>2]|0,c[i>>2]|0)|0,c[d+40>>2]|0)|0;c[d+48>>2]=fw(b,B(c[h>>2]|0,c[j>>2]|0)|0)|0;e=e+1|0;b=c[t>>2]|0;if((e|0)>=(b|0))break;else d=d+88|0}}}d=c[a+44>>2]|0;switch(d|0){case 1:{b=d;break}case 6:case 2:{b=3;break}case 7:case 3:{b=3;break}case 5:case 4:{b=4;break}default:{}}c[a+120>>2]=b;c[a+124>>2]=(c[a+84>>2]|0)==0?b:1;if(!(Pt(a)|0)){t=1;a=a+128|0;c[a>>2]=t;return}t=c[a+320>>2]|0;a=a+128|0;c[a>>2]=t;return}function Pt(a){a=a|0;var b=0,d=0;if(c[a+308>>2]|0)return 0;switch(c[a+40>>2]|0){case 7:case 3:break;default:return 0}if((c[a+36>>2]|0)!=3)return 0;if((c[a+44>>2]|0)!=2)return 0;if((c[a+120>>2]|0)!=3)return 0;if(c[a+304>>2]|0)return 0;d=c[a+216>>2]|0;if((c[d+8>>2]|0)!=2)return 0;if((c[d+96>>2]|0)!=1)return 0;if((c[d+184>>2]|0)!=1)return 0;if((c[d+12>>2]|0)>2)return 0;if((c[d+100>>2]|0)!=1)return 0;if((c[d+188>>2]|0)!=1)return 0;b=c[d+36>>2]|0;if((b|0)!=(c[a+324>>2]|0))return 0;if((c[d+124>>2]|0)!=(b|0))return 0;if((c[d+212>>2]|0)!=(b|0))return 0;b=c[d+40>>2]|0;if((b|0)!=(c[a+328>>2]|0))return 0;if((c[d+128>>2]|0)==(b|0))return (c[d+216>>2]|0)==(b|0)|0;else return 0;return 0}function Qt(b){b=b|0;var 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;s=b+4|0;t=Hb[c[c[s>>2]>>2]&63](b,1,88)|0;r=b+484|0;c[r>>2]=t;c[t>>2]=47;c[t+8>>2]=117;c[t+12>>2]=118;c[t+68>>2]=0;c[t+52>>2]=0;t=b+120|0;if((c[t>>2]|0)>4){n=c[b>>2]|0;c[n+20>>2]=57;c[n+24>>2]=4;Qb[c[c[b>>2]>>2]&255](b)}d=b+96|0;e=c[d>>2]|0;if((e|0)>256){e=c[b>>2]|0;c[e+20>>2]=59;c[e+24>>2]=256;Qb[c[c[b>>2]>>2]&255](b);e=c[d>>2]|0}n=c[r>>2]|0;l=n+32|0;k=c[t>>2]|0;if((k|0)>1){h=1;while(1){g=h+1|0;f=1;d=g;do{d=B(d,g)|0;f=f+1|0}while((f|0)!=(k|0));if((d|0)>(e|0)){f=h;break}else h=g}}else{f=(e|0)>1?e:1;d=f+1|0}if(f>>>0<2){j=c[b>>2]|0;c[j+20>>2]=58;c[j+24>>2]=d;Qb[c[c[b>>2]>>2]&255](b)}a:do if((k|0)>0){h=1;d=0;do{c[n+32+(d<<2)>>2]=f;h=B(h,f)|0;d=d+1|0}while((d|0)!=(k|0));if((c[b+44>>2]|0)==2){g=0;d=0;f=h;while(1){h=n+32+(c[15924+(d<<2)>>2]<<2)|0;j=c[h>>2]|0;i=j+1|0;j=B((f|0)/(j|0)|0,i)|0;if((j|0)<=(e|0)){c[h>>2]=i;d=d+1|0;if((d|0)<(k|0)){g=1;f=j}else{d=1;f=j;m=22}}else{d=g;m=22}if((m|0)==22){m=0;if(!d)break a;else{g=0;d=0}}}}else{g=0;d=0;f=h;while(1){h=n+32+(d<<2)|0;j=c[h>>2]|0;i=j+1|0;j=B((f|0)/(j|0)|0,i)|0;if((j|0)<=(e|0)){c[h>>2]=i;d=d+1|0;if((d|0)<(k|0)){g=1;f=j}else{d=1;f=j;m=26}}else{d=g;m=26}if((m|0)==26){m=0;if(!d)break a;else{g=0;d=0}}}}}else f=1;while(0);d=c[b>>2]|0;if((c[t>>2]|0)==3){c[d+24>>2]=f;c[d+28>>2]=c[l>>2];c[d+32>>2]=c[n+36>>2];c[d+36>>2]=c[n+40>>2];c[d+20>>2]=96;Sb[c[d+4>>2]&63](b,1)}else{c[d+20>>2]=97;c[d+24>>2]=f;Sb[c[(c[b>>2]|0)+4>>2]&63](b,1)}m=Ib[c[(c[s>>2]|0)+8>>2]&15](b,1,f,c[t>>2]|0)|0;d=c[t>>2]|0;if((d|0)>0){k=0;l=f;do{j=c[n+32+(k<<2)>>2]|0;i=l;l=(l|0)/(j|0)|0;if((j|0)>0?(o=j+-1|0,p=(o|0)/2|0,q=m+(k<<2)|0,(l|0)>0):0){g=0;do{d=B(g,l)|0;if((d|0)<(f|0)){h=(((g*255|0)+p|0)/(o|0)|0)&255;do{e=0;do{a[(c[q>>2]|0)+(e+d)>>0]=h;e=e+1|0}while((e|0)!=(l|0));d=d+i|0}while((d|0)<(f|0))}g=g+1|0}while((g|0)!=(j|0));d=c[t>>2]|0}k=k+1|0}while((k|0)<(d|0))}c[n+16>>2]=m;c[n+20>>2]=f;_v(b);if((c[b+88>>2]|0)!=2)return;e=c[r>>2]|0;f=(c[b+112>>2]<<1)+4|0;if((c[t>>2]|0)<=0)return;d=0;do{c[e+68+(d<<2)>>2]=Hb[c[(c[s>>2]|0)+4>>2]&63](b,1,f)|0;d=d+1|0}while((d|0)<(c[t>>2]|0));return}function Rt(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;f=a+4|0;e=Hb[c[c[f>>2]>>2]&63](a,1,44)|0;c[a+484>>2]=e;c[e>>2]=48;c[e+12>>2]=119;g=e+32|0;c[g>>2]=0;c[e+40>>2]=0;if((c[a+120>>2]|0)!=3){d=c[a>>2]|0;c[d+20>>2]=48;Qb[c[d>>2]&255](a)}d=e+24|0;c[d>>2]=Hb[c[c[f>>2]>>2]&63](a,1,128)|0;b=0;do{h=Hb[c[(c[f>>2]|0)+4>>2]&63](a,1,4096)|0;c[(c[d>>2]|0)+(b<<2)>>2]=h;b=b+1|0}while((b|0)!=32);c[e+28>>2]=1;if(!(c[a+108>>2]|0))c[e+16>>2]=0;else{b=c[a+96>>2]|0;if((b|0)>=8){if((b|0)>256){h=c[a>>2]|0;c[h+20>>2]=59;c[h+24>>2]=256;Qb[c[c[a>>2]>>2]&255](a)}}else{h=c[a>>2]|0;c[h+20>>2]=58;c[h+24>>2]=8;Qb[c[c[a>>2]>>2]&255](a)}c[e+16>>2]=Ib[c[(c[f>>2]|0)+8>>2]&15](a,1,b,3)|0;c[e+20>>2]=b}b=a+88|0;if(!(c[b>>2]|0))return;c[b>>2]=2;c[g>>2]=Hb[c[(c[f>>2]|0)+4>>2]&63](a,1,((c[a+112>>2]|0)*6|0)+12|0)|0;Pv(a);return}function St(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;g=a+4|0;b=Hb[c[c[g>>2]>>2]&63](a,1,48)|0;f=a+476|0;c[f>>2]=b;c[b>>2]=120;c[b+8>>2]=0;d=B(c[a+120>>2]|0,c[a+112>>2]|0)|0;c[b+40>>2]=d;e=b+4|0;if((c[a+320>>2]|0)==2){c[e>>2]=1;c[b+12>>2]=9;c[b+32>>2]=Hb[c[(c[g>>2]|0)+4>>2]&63](a,1,d)|0;b=c[f>>2]|0}else{c[e>>2]=2;c[b+12>>2]=10;c[b+32>>2]=0}d=(c[a+40>>2]|0)==7;e=b+16|0;c[e>>2]=Hb[c[c[g>>2]>>2]&63](a,1,1024)|0;f=b+20|0;c[f>>2]=Hb[c[c[g>>2]>>2]&63](a,1,1024)|0;h=b+24|0;c[h>>2]=Hb[c[c[g>>2]>>2]&63](a,1,1024)|0;g=Hb[c[c[g>>2]>>2]&63](a,1,1024)|0;c[b+28>>2]=g;e=c[e>>2]|0;f=c[f>>2]|0;a=c[h>>2]|0;if(d){b=0;d=-128;while(1){c[e+(b<<2)>>2]=(d*183763|0)+32768>>16;c[f+(b<<2)>>2]=(d*232260|0)+32768>>16;c[a+(b<<2)>>2]=B(d,-93603)|0;c[g+(b<<2)>>2]=(B(d,-45107)|0)+32768;b=b+1|0;if((b|0)==256)break;else d=d+1|0}return}else{b=0;d=-128;while(1){c[e+(b<<2)>>2]=(d*91881|0)+32768>>16;c[f+(b<<2)>>2]=(d*116130|0)+32768>>16;c[a+(b<<2)>>2]=B(d,-46802)|0;c[g+(b<<2)>>2]=(B(d,-22553)|0)+32768;b=b+1|0;if((b|0)==256)break;else d=d+1|0}return}}function Tt(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=a+4|0;e=Hb[c[c[b>>2]>>2]&63](a,1,28)|0;g=a+480|0;c[g>>2]=e;c[e>>2]=121;h=a+40|0;switch(c[h>>2]|0){case 1:{if((c[a+36>>2]|0)!=1){f=c[a>>2]|0;c[f+20>>2]=11;Qb[c[f>>2]&255](a)}break}case 7:case 6:case 3:case 2:{if((c[a+36>>2]|0)!=3){f=c[a>>2]|0;c[f+20>>2]=11;Qb[c[f>>2]&255](a)}break}case 5:case 4:{if((c[a+36>>2]|0)!=4){f=c[a>>2]|0;c[f+20>>2]=11;Qb[c[f>>2]&255](a)}break}default:if((c[a+36>>2]|0)<1){f=c[a>>2]|0;c[f+20>>2]=11;Qb[c[f>>2]&255](a)}}d=a+304|0;a:do if(c[d>>2]|0){switch(c[h>>2]|0){case 6:case 2:break a;default:{}}f=c[a>>2]|0;c[f+20>>2]=28;Qb[c[f>>2]&255](a)}while(0);f=c[a+44>>2]|0;b:do switch(f|0){case 1:{c[a+120>>2]=1;switch(c[h>>2]|0){case 7:case 3:case 1:{c[e+4>>2]=4;d=c[a+36>>2]|0;if((d|0)<=1)break b;e=c[a+216>>2]|0;b=1;do{c[e+(b*88|0)+52>>2]=0;b=b+1|0}while((b|0)<(d|0));break}case 2:{switch(c[d>>2]|0){case 0:{c[e+4>>2]=5;break}case 1:{c[e+4>>2]=6;break}default:{h=c[a>>2]|0;c[h+20>>2]=28;Qb[c[h>>2]&255](a)}}h=c[g>>2]|0;d=Hb[c[c[b>>2]>>2]&63](a,1,3072)|0;c[h+24>>2]=d;b=0;do{c[d+(b<<2)>>2]=b*19595;c[d+(b+256<<2)>>2]=b*38470;c[d+(b+512<<2)>>2]=(b*7471|0)+32768;b=b+1|0}while((b|0)!=256);break}default:{h=c[a>>2]|0;c[h+20>>2]=28;Qb[c[h>>2]&255](a);break b}}break}case 2:{c[a+120>>2]=3;switch(c[h>>2]|0){case 1:{c[e+4>>2]=7;break b}case 3:{c[e+4>>2]=8;d=c[g>>2]|0;f=d+8|0;c[f>>2]=Hb[c[c[b>>2]>>2]&63](a,1,1024)|0;g=d+12|0;c[g>>2]=Hb[c[c[b>>2]>>2]&63](a,1,1024)|0;h=d+16|0;c[h>>2]=Hb[c[c[b>>2]>>2]&63](a,1,1024)|0;e=Hb[c[c[b>>2]>>2]&63](a,1,1024)|0;c[d+20>>2]=e;f=c[f>>2]|0;g=c[g>>2]|0;h=c[h>>2]|0;b=0;d=-128;while(1){c[f+(b<<2)>>2]=(d*91881|0)+32768>>16;c[g+(b<<2)>>2]=(d*116130|0)+32768>>16;c[h+(b<<2)>>2]=B(d,-46802)|0;c[e+(b<<2)>>2]=(B(d,-22553)|0)+32768;b=b+1|0;if((b|0)==256)break;else d=d+1|0}break}case 7:{c[e+4>>2]=8;d=c[g>>2]|0;f=d+8|0;c[f>>2]=Hb[c[c[b>>2]>>2]&63](a,1,1024)|0;g=d+12|0;c[g>>2]=Hb[c[c[b>>2]>>2]&63](a,1,1024)|0;h=d+16|0;c[h>>2]=Hb[c[c[b>>2]>>2]&63](a,1,1024)|0;e=Hb[c[c[b>>2]>>2]&63](a,1,1024)|0;c[d+20>>2]=e;f=c[f>>2]|0;g=c[g>>2]|0;h=c[h>>2]|0;b=0;d=-128;while(1){c[f+(b<<2)>>2]=(d*183763|0)+32768>>16;c[g+(b<<2)>>2]=(d*232260|0)+32768>>16;c[h+(b<<2)>>2]=B(d,-93603)|0;c[e+(b<<2)>>2]=(B(d,-45107)|0)+32768;b=b+1|0;if((b|0)==256)break;else d=d+1|0}break}case 2:switch(c[d>>2]|0){case 0:{c[e+4>>2]=9;break b}case 1:{c[e+4>>2]=10;break b}default:{h=c[a>>2]|0;c[h+20>>2]=28;Qb[c[h>>2]&255](a);break b}}default:{h=c[a>>2]|0;c[h+20>>2]=28;Qb[c[h>>2]&255](a);break b}}break}case 6:{c[a+120>>2]=3;if((c[h>>2]|0)!=6){h=c[a>>2]|0;c[h+20>>2]=28;Qb[c[h>>2]&255](a);break b}switch(c[d>>2]|0){case 0:{c[e+4>>2]=9;break b}case 1:{c[e+4>>2]=10;break b}default:{h=c[a>>2]|0;c[h+20>>2]=28;Qb[c[h>>2]&255](a);break b}}}case 4:{c[a+120>>2]=4;switch(c[h>>2]|0){case 5:{c[e+4>>2]=11;d=c[g>>2]|0;f=d+8|0;c[f>>2]=Hb[c[c[b>>2]>>2]&63](a,1,1024)|0;g=d+12|0;c[g>>2]=Hb[c[c[b>>2]>>2]&63](a,1,1024)|0;h=d+16|0;c[h>>2]=Hb[c[c[b>>2]>>2]&63](a,1,1024)|0;e=Hb[c[c[b>>2]>>2]&63](a,1,1024)|0;c[d+20>>2]=e;f=c[f>>2]|0;g=c[g>>2]|0;h=c[h>>2]|0;b=0;d=-128;while(1){c[f+(b<<2)>>2]=(d*91881|0)+32768>>16;c[g+(b<<2)>>2]=(d*116130|0)+32768>>16;c[h+(b<<2)>>2]=B(d,-46802)|0;c[e+(b<<2)>>2]=(B(d,-22553)|0)+32768;b=b+1|0;if((b|0)==256)break;else d=d+1|0}break}case 4:{c[e+4>>2]=12;break b}default:{h=c[a>>2]|0;c[h+20>>2]=28;Qb[c[h>>2]&255](a);break b}}break}default:if((f|0)==(c[h>>2]|0)){c[a+120>>2]=c[a+36>>2];c[e+4>>2]=12;break b}else{h=c[a>>2]|0;c[h+20>>2]=28;Qb[c[h>>2]&255](a);break b}}while(0);if(c[a+84>>2]|0){h=1;a=a+124|0;c[a>>2]=h;return}h=c[a+120>>2]|0;a=a+124|0;c[a>>2]=h;return}function Ut(b){b=b|0;var 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;m=b+4|0;d=Hb[c[c[m>>2]>>2]&63](b,1,160)|0;c[b+476>>2]=d;c[d>>2]=122;c[d+4>>2]=3;c[d+8>>2]=0;if(c[b+308>>2]|0){w=c[b>>2]|0;c[w+20>>2]=26;Qb[c[w>>2]&255](b)}n=b+36|0;if((c[n>>2]|0)<=0)return;o=b+324|0;p=b+328|0;q=b+316|0;r=b+320|0;s=d+100|0;t=d+52|0;u=b+112|0;v=d+12|0;w=d+140|0;h=d+150|0;f=c[b+216>>2]|0;g=0;while(1){i=B(c[f+36>>2]|0,c[f+8>>2]|0)|0;i=(i|0)/(c[o>>2]|0)|0;j=B(c[f+40>>2]|0,c[f+12>>2]|0)|0;j=(j|0)/(c[p>>2]|0)|0;k=c[q>>2]|0;l=c[r>>2]|0;c[s+(g<<2)>>2]=j;do if(!(c[f+52>>2]|0))c[t+(g<<2)>>2]=11;else{d=(j|0)==(l|0);if((i|0)==(k|0)&d){c[t+(g<<2)>>2]=12;break}e=(i<<1|0)==(k|0);do if(e&d)c[t+(g<<2)>>2]=13;else{if(e&(j<<1|0)==(l|0)){c[t+(g<<2)>>2]=14;break}d=(k|0)/(i|0)|0;if((k-(B(d,i)|0)|0)==0?(x=(l|0)/(j|0)|0,(l-(B(x,j)|0)|0)==0):0){c[t+(g<<2)>>2]=15;a[w+g>>0]=d;a[h+g>>0]=x;break}l=c[b>>2]|0;c[l+20>>2]=39;Qb[c[l>>2]&255](b)}while(0);k=c[(c[m>>2]|0)+8>>2]|0;l=fu(c[u>>2]|0,c[q>>2]|0)|0;c[v+(g<<2)>>2]=Ib[k&15](b,1,l,c[r>>2]|0)|0}while(0);g=g+1|0;if((g|0)>=(c[n>>2]|0))break;else f=f+88|0}return}function Vt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;f=a+4|0;d=Hb[c[c[f>>2]>>2]&63](a,1,28)|0;c[a+456>>2]=d;c[d>>2]=49;h=d+8|0;c[h>>2]=0;i=d+12|0;c[i>>2]=0;if(!(c[a+84>>2]|0))return;g=c[a+320>>2]|0;e=d+16|0;c[e>>2]=g;d=c[f>>2]|0;if(!b){h=B(c[a+120>>2]|0,c[a+112>>2]|0)|0;c[i>>2]=Ib[c[d+8>>2]&15](a,1,h,g)|0;return}else{f=c[d+16>>2]|0;b=B(c[a+120>>2]|0,c[a+112>>2]|0)|0;i=fu(c[a+116>>2]|0,g)|0;c[h>>2]=Mb[f&63](a,1,0,b,i,c[e>>2]|0)|0;return}}function Wt(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;f=a+4|0;b=Hb[c[c[f>>2]>>2]&63](a,1,84)|0;c[a+472>>2]=b;c[b>>2]=123;g=a+36|0;if((c[g>>2]|0)<=0)return;e=b+44|0;b=0;d=c[a+216>>2]|0;while(1){h=Hb[c[c[f>>2]>>2]&63](a,1,256)|0;c[d+84>>2]=h;_O(h|0,0,256)|0;c[e+(b<<2)>>2]=-1;b=b+1|0;if((b|0)>=(c[g>>2]|0))break;else d=d+88|0}return}function Xt(b){b=b|0;var d=0,e=0,f=0,g=0;g=b+4|0;e=Hb[c[c[g>>2]>>2]&63](b,1,192)|0;c[b+468>>2]=e;c[e>>2]=124;c[e+8>>2]=125;d=e+188|0;e=e+60|0;f=e+128|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(f|0));a[d>>0]=113;if(!(c[b+224>>2]|0))return;f=b+36|0;e=Hb[c[c[g>>2]>>2]&63](b,1,c[f>>2]<<8)|0;c[b+160>>2]=e;if((c[f>>2]|0)<=0)return;d=0;do{_O(e+(d<<8)|0,-1,256)|0;d=d+1|0}while((d|0)<(c[f>>2]|0));return}function Yt(a){a=a|0;var b=0,d=0,e=0,f=0;b=a+4|0;f=Hb[c[c[b>>2]>>2]&63](a,1,220)|0;c[a+468>>2]=f;c[f>>2]=126;c[f+8>>2]=127;if(!(c[a+224>>2]|0)){e=f+68|0;c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[f+88>>2]=0;c[f+92>>2]=0;c[f+96>>2]=0;return}e=a+36|0;d=Hb[c[c[b>>2]>>2]&63](a,1,c[e>>2]<<8)|0;c[a+160>>2]=d;if((c[e>>2]|0)>0){b=0;do{_O(d+(b<<8)|0,-1,256)|0;b=b+1|0}while((b|0)<(c[e>>2]|0))}f=f+48|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;return}function Zt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;h=a+4|0;i=Hb[c[c[h>>2]>>2]&63](a,1,116)|0;c[a+452>>2]=i;c[i>>2]=128;c[i+8>>2]=129;c[i+112>>2]=0;if(!b){b=Hb[c[(c[h>>2]|0)+4>>2]&63](a,1,1280)|0;c[i+32>>2]=b;c[i+36>>2]=b+128;c[i+40>>2]=b+256;c[i+44>>2]=b+384;c[i+48>>2]=b+512;c[i+52>>2]=b+640;c[i+56>>2]=b+768;c[i+60>>2]=b+896;c[i+64>>2]=b+1024;c[i+68>>2]=b+1152;if(!(c[a+436>>2]|0))_O(b|0,0,1280)|0;c[i+4>>2]=84;c[i+12>>2]=34;c[i+16>>2]=0;return}f=a+36|0;if((c[f>>2]|0)>0){g=a+224|0;b=i+72|0;d=0;e=c[a+216>>2]|0;while(1){k=e+12|0;j=c[k>>2]|0;j=(c[g>>2]|0)==0?j:j*3|0;m=c[(c[h>>2]|0)+20>>2]|0;l=fu(c[e+28>>2]|0,c[e+8>>2]|0)|0;k=fu(c[e+32>>2]|0,c[k>>2]|0)|0;c[b+(d<<2)>>2]=Mb[m&63](a,1,1,l,k,j)|0;d=d+1|0;if((d|0)>=(c[f>>2]|0))break;else e=e+88|0}}else b=i+72|0;c[i+4>>2]=83;c[i+12>>2]=33;c[i+16>>2]=b;return}function _t(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;l=a+4|0;j=Hb[c[c[l>>2]>>2]&63](a,1,80)|0;d=a+448|0;c[d>>2]=j;c[j>>2]=50;if(b|0){k=c[a>>2]|0;c[k+20>>2]=3;Qb[c[k>>2]&255](a)}k=a+328|0;e=c[k>>2]|0;if(!(c[(c[a+476>>2]|0)+8>>2]|0)){c[j+52>>2]=e;b=a+36|0;h=e;g=b;b=c[b>>2]|0;d=e}else{if((e|0)<2){e=c[a>>2]|0;c[e+20>>2]=48;Qb[c[e>>2]&255](a);e=c[k>>2]|0}h=c[d>>2]|0;i=a+36|0;f=Hb[c[c[l>>2]>>2]&63](a,1,c[i>>2]<<3)|0;g=h+60|0;c[g>>2]=f;b=c[i>>2]|0;h=h+64|0;c[h>>2]=f+(b<<2);if((b|0)>0){f=e+4|0;d=c[a+216>>2]|0;e=0;while(1){m=B(c[d+40>>2]|0,c[d+12>>2]|0)|0;m=(m|0)/(c[k>>2]|0)|0;b=B(m,f)|0;m=(Hb[c[c[l>>2]>>2]&63](a,1,b<<3)|0)+(m<<2)|0;c[(c[g>>2]|0)+(e<<2)>>2]=m;c[(c[h>>2]|0)+(e<<2)>>2]=m+(b<<2);e=e+1|0;b=c[i>>2]|0;if((e|0)>=(b|0))break;else d=d+88|0}}d=c[k>>2]|0;h=d+2|0;g=i}if((b|0)<=0)return;f=j+8|0;b=0;e=c[a+216>>2]|0;while(1){m=(B(c[e+40>>2]|0,c[e+12>>2]|0)|0)/(d|0)|0;j=B(c[e+36>>2]|0,c[e+28>>2]|0)|0;m=B(m,h)|0;c[f+(b<<2)>>2]=Ib[c[(c[l>>2]|0)+8>>2]&15](a,1,j,m)|0;b=b+1|0;if((b|0)>=(c[g>>2]|0))break;e=e+88|0;d=c[k>>2]|0}return}function $t(a,b){a=a|0;b=b|0;var 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;r=c[a+448>>2]|0;switch(b|0){case 0:{b=r+4|0;if(!(c[(c[a+476>>2]|0)+8>>2]|0)){c[b>>2]=17;c[r+48>>2]=c[r+52>>2];return}c[b>>2]=16;l=c[a+328>>2]|0;m=c[a+36>>2]|0;if((m|0)>0){n=r+60|0;o=r+64|0;p=l+2|0;q=l+-2|0;h=c[a+216>>2]|0;i=0;while(1){j=(B(c[h+40>>2]|0,c[h+12>>2]|0)|0)/(l|0)|0;k=c[(c[n>>2]|0)+(i<<2)>>2]|0;f=c[(c[o>>2]|0)+(i<<2)>>2]|0;g=c[r+8+(i<<2)>>2]|0;a=B(j,p)|0;if((a|0)>0){b=0;do{e=c[g+(b<<2)>>2]|0;c[f+(b<<2)>>2]=e;c[k+(b<<2)>>2]=e;b=b+1|0}while((b|0)!=(a|0))}a=j<<1;if((j|0)>0){d=B(j,l)|0;e=B(j,q)|0;b=0;do{s=b+d|0;t=b+e|0;c[f+(t<<2)>>2]=c[g+(s<<2)>>2];c[f+(s<<2)>>2]=c[g+(t<<2)>>2];b=b+1|0}while((b|0)<(a|0));b=0;do{c[k+(b-j<<2)>>2]=c[k>>2];b=b+1|0}while((b|0)!=(j|0))}i=i+1|0;if((i|0)==(m|0))break;else h=h+88|0}}c[r+68>>2]=0;c[r+72>>2]=0;c[r+76>>2]=0;c[r+56>>2]=0;return}case 2:{c[r+4>>2]=18;return}default:{t=c[a>>2]|0;c[t+20>>2]=3;Qb[c[t>>2]&255](a);return}}}function au(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var 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;v=a+448|0;w=c[v>>2]|0;y=w+56|0;do if(!(c[y>>2]|0))if(!(Gb[c[(c[a+452>>2]|0)+12>>2]&63](a,c[w+60+(c[w+68>>2]<<2)>>2]|0)|0))return;else{c[y>>2]=1;x=w+76|0;c[x>>2]=(c[x>>2]|0)+1;break}while(0);x=w+72|0;switch(c[x>>2]|0){case 2:{f=w+48|0;g=w+52|0;Yb[c[(c[a+456>>2]|0)+4>>2]&7](a,c[w+60+(c[w+68>>2]<<2)>>2]|0,f,c[g>>2]|0,b,d,e);if((c[f>>2]|0)>>>0<(c[g>>2]|0)>>>0)return;c[x>>2]=0;if((c[d>>2]|0)>>>0>>0)h=9;else return;break}case 0:{f=w+48|0;g=w+52|0;h=9;break}case 1:{u=w+48|0;t=w+52|0;break}default:return}if((h|0)==9){c[f>>2]=0;p=c[a+328>>2]|0;c[g>>2]=p+-1;if((c[w+76>>2]|0)==(c[a+332>>2]|0)?(i=c[v>>2]|0,r=c[a+36>>2]|0,(r|0)>0):0){q=i+52|0;l=i+60+(c[i+68>>2]<<2)|0;j=c[a+216>>2]|0;k=0;while(1){u=B(c[j+40>>2]|0,c[j+12>>2]|0)|0;h=(u|0)/(p|0)|0;o=((c[j+48>>2]|0)>>>0)%(u>>>0)|0;o=(o|0)==0?u:o;if(!k)c[q>>2]=((o+-1|0)/(h|0)|0)+1;m=c[(c[l>>2]|0)+(k<<2)>>2]|0;n=h<<1;if((h|0)>0){i=m+(o+-1<<2)|0;h=0;do{c[m+(h+o<<2)>>2]=c[i>>2];h=h+1|0}while((h|0)<(n|0))}k=k+1|0;if((k|0)==(r|0))break;else j=j+88|0}}c[x>>2]=1;u=f;t=g}s=w+68|0;Yb[c[(c[a+456>>2]|0)+4>>2]&7](a,c[w+60+(c[s>>2]<<2)>>2]|0,u,c[t>>2]|0,b,d,e);if((c[u>>2]|0)>>>0<(c[t>>2]|0)>>>0)return;if((c[w+76>>2]|0)==1){g=c[v>>2]|0;f=c[a+328>>2]|0;r=c[a+36>>2]|0;if((r|0)>0){b=g+60|0;o=g+64|0;p=f+1|0;q=f+2|0;h=c[a+216>>2]|0;i=0;while(1){j=(B(c[h+40>>2]|0,c[h+12>>2]|0)|0)/(f|0)|0;k=c[(c[b>>2]|0)+(i<<2)>>2]|0;l=c[(c[o>>2]|0)+(i<<2)>>2]|0;if((j|0)>0){m=B(j,p)|0;n=B(j,q)|0;g=0;do{w=g+m|0;a=g-j|0;c[k+(a<<2)>>2]=c[k+(w<<2)>>2];c[l+(a<<2)>>2]=c[l+(w<<2)>>2];a=g+n|0;c[k+(a<<2)>>2]=c[k+(g<<2)>>2];c[l+(a<<2)>>2]=c[l+(g<<2)>>2];g=g+1|0}while((g|0)!=(j|0))}i=i+1|0;if((i|0)==(r|0))break;else h=h+88|0}}}else f=c[a+328>>2]|0;c[s>>2]=c[s>>2]^1;c[y>>2]=0;c[u>>2]=f+1;c[t>>2]=f+2;c[x>>2]=2;return}function bu(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=c[a+448>>2]|0;i=f+48|0;h=f+52|0;g=c[h>>2]|0;do if((c[i>>2]|0)>>>0>=g>>>0){f=f+8|0;if(!(Gb[c[(c[a+452>>2]|0)+12>>2]&63](a,f)|0))return;else{c[i>>2]=0;g=c[h>>2]|0;break}}else f=f+8|0;while(0);Yb[c[(c[a+456>>2]|0)+4>>2]&7](a,f,i,g,b,d,e);return}function cu(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;Yb[c[(c[a+456>>2]|0)+4>>2]&7](a,0,0,0,b,d,e);return}function du(a){a=a|0;var b=0,d=0;c[a+148>>2]=0;b=c[a+452>>2]|0;if((c[a+340>>2]|0)>1)a=1;else{d=c[a+344>>2]|0;a=c[((c[a+332>>2]|0)==1?d+76|0:d+12|0)>>2]|0}c[b+28>>2]=a;c[b+20>>2]=0;c[b+24>>2]=0;return}function eu(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;k=c[a+452>>2]|0;if(!(c[k+16>>2]|0)){l=a+156|0;c[l>>2]=0;return}a:do if(((c[a+80>>2]|0)!=0?(c[a+224>>2]|0)!=0:0)?(j=a+160|0,(c[j>>2]|0)!=0):0){d=k+112|0;e=c[d>>2]|0;if(!e){i=a+36|0;e=Hb[c[c[a+4>>2]>>2]&63](a,1,(c[i>>2]|0)*24|0)|0;c[d>>2]=e}else i=a+36|0;if((c[i>>2]|0)>0){f=0;g=c[a+216>>2]|0;h=0;while(1){d=c[g+80>>2]|0;if(!d){l=20;break a}if(!(b[d>>1]|0)){l=20;break a}if(!(b[d+2>>1]|0)){l=20;break a}if(!(b[d+16>>1]|0)){l=20;break a}if(!(b[d+32>>1]|0)){l=20;break a}if(!(b[d+18>>1]|0)){l=20;break a}if(!(b[d+4>>1]|0)){l=20;break a}d=c[j>>2]|0;if((c[d+(h<<8)>>2]|0)<0){l=20;break a}m=d+(h<<8)+4|0;c[e+4>>2]=c[m>>2];m=c[m>>2]|0;n=d+(h<<8)+8|0;c[e+8>>2]=c[n>>2];m=c[n>>2]|m;n=d+(h<<8)+12|0;c[e+12>>2]=c[n>>2];n=m|c[n>>2];m=d+(h<<8)+16|0;c[e+16>>2]=c[m>>2];m=n|c[m>>2];d=d+(h<<8)+20|0;c[e+20>>2]=c[d>>2];f=(m|c[d>>2]|0)==0?f:1;h=h+1|0;if((h|0)>=(c[i>>2]|0))break;else{g=g+88|0;e=e+24|0}}if(f)d=35;else l=20}else l=20}else l=20;while(0);if((l|0)==20)d=33;c[k+12>>2]=d;n=a+156|0;c[n>>2]=0;return}function fu(a,b){a=a|0;b=b|0;a=a+-1+b|0;return a-((a|0)%(b|0)|0)|0}function gu(a){a=a|0;var b=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;z=yb;yb=yb+16|0;u=z;x=a+452|0;v=c[x>>2]|0;y=a+340|0;if((c[y>>2]|0)>0){d=a+4|0;e=a+148|0;b=0;do{r=c[a+344+(b<<2)>>2]|0;t=c[r+12>>2]|0;s=B(t,c[e>>2]|0)|0;c[u+(b<<2)>>2]=Kb[c[(c[d>>2]|0)+32>>2]&31](a,c[v+72+(c[r+4>>2]<<2)>>2]|0,s,t,1)|0;b=b+1|0}while((b|0)<(c[y>>2]|0))}o=v+24|0;b=c[o>>2]|0;p=v+28|0;f=c[p>>2]|0;a:do if((b|0)<(f|0)){q=v+20|0;r=a+360|0;s=a+468|0;t=v+32|0;d=c[q>>2]|0;e=c[r>>2]|0;b:while(1){if(d>>>0>>0){do{n=c[y>>2]|0;if((n|0)>0){e=0;m=0;do{l=c[a+344+(m<<2)>>2]|0;j=c[l+56>>2]|0;k=B(j,d)|0;l=c[l+60>>2]|0;if((l|0)>0?(w=c[u+(m<<2)>>2]|0,(j|0)>0):0){i=0;do{f=0;g=(c[w+(i+b<<2)>>2]|0)+(k<<7)|0;h=e;while(1){c[v+32+(h<<2)>>2]=g;f=f+1|0;if((f|0)==(j|0))break;else{g=g+128|0;h=h+1|0}}e=j+e|0;i=i+1|0}while((i|0)<(l|0))}m=m+1|0}while((m|0)<(n|0))}if(!(Gb[c[(c[s>>2]|0)+4>>2]&63](a,t)|0))break b;d=d+1|0;e=c[r>>2]|0}while(d>>>0>>0);f=c[p>>2]|0}c[q>>2]=0;b=b+1|0;if((b|0)<(f|0))d=0;else break a}c[o>>2]=b;c[q>>2]=d;y=0;yb=z;return y|0}while(0);d=a+148|0;b=(c[d>>2]|0)+1|0;c[d>>2]=b;d=c[a+332>>2]|0;if(b>>>0>=d>>>0){Qb[c[(c[a+460>>2]|0)+12>>2]&255](a);y=4;yb=z;return y|0}e=c[x>>2]|0;if((c[y>>2]|0)>1)b=1;else{y=c[a+344>>2]|0;b=c[(b>>>0<(d+-1|0)>>>0?y+12|0:y+76|0)>>2]|0}c[e+28>>2]=b;c[e+20>>2]=0;c[e+24>>2]=0;y=3;yb=z;return y|0}function hu(a,b){a=a|0;b=b|0;var 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;v=c[a+452>>2]|0;w=a+332|0;x=(c[w>>2]|0)+-1|0;g=a+144|0;h=a+152|0;i=a+460|0;d=a+148|0;u=a+156|0;while(1){e=c[g>>2]|0;f=c[h>>2]|0;if((e|0)>=(f|0)){if((e|0)!=(f|0))break;if((c[d>>2]|0)>>>0>(c[u>>2]|0)>>>0)break}if(!(Eb[c[c[i>>2]>>2]&127](a)|0)){d=0;j=20;break}}if((j|0)==20)return d|0;q=a+36|0;if((c[q>>2]|0)>0){r=a+4|0;s=a+472|0;o=c[a+216>>2]|0;p=0;while(1){if(c[o+52>>2]|0){d=o+12|0;t=c[d>>2]|0;n=B(t,c[u>>2]|0)|0;t=Kb[c[(c[r>>2]|0)+32>>2]&31](a,c[v+72+(p<<2)>>2]|0,n,t,0)|0;if((c[u>>2]|0)>>>0>>0)i=c[d>>2]|0;else{n=c[d>>2]|0;i=((c[o+32>>2]|0)>>>0)%(n>>>0)|0;i=(i|0)==0?n:i}k=c[(c[s>>2]|0)+4+(p<<2)>>2]|0;if((i|0)>0){l=o+28|0;m=o+40|0;n=o+36|0;h=c[b+(p<<2)>>2]|0;j=0;d=c[l>>2]|0;while(1){if(!d)d=0;else{e=0;f=c[t+(j<<2)>>2]|0;g=0;while(1){Wb[k&63](a,o,f,h,e);g=g+1|0;d=c[l>>2]|0;if(g>>>0>=d>>>0)break;else{e=(c[n>>2]|0)+e|0;f=f+128|0}}}j=j+1|0;if((j|0)==(i|0))break;else h=h+(c[m>>2]<<2)|0}}}p=p+1|0;if((p|0)>=(c[q>>2]|0))break;else o=o+88|0}}x=(c[u>>2]|0)+1|0;c[u>>2]=x;x=x>>>0<(c[w>>2]|0)>>>0?3:4;return x|0}function iu(a){a=a|0;return 0}function ju(a,b){a=a|0;b=b|0;var 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,A=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;N=a+452|0;I=c[N>>2]|0;J=(c[a+360>>2]|0)+-1|0;M=a+332|0;f=c[M>>2]|0;K=f+-1|0;G=I+24|0;d=c[G>>2]|0;H=I+28|0;g=c[H>>2]|0;do if((d|0)<(g|0)){y=I+20|0;z=a+436|0;A=a+468|0;C=I+32|0;D=a+368|0;E=a+340|0;F=a+472|0;e=a+148|0;x=d;f=g;d=c[y>>2]|0;a:while(1){if(d>>>0<=J>>>0){do{if(c[z>>2]|0)_O(c[C>>2]|0,0,c[D>>2]<<7|0)|0;if(!(Gb[c[(c[A>>2]|0)+4>>2]&63](a,C)|0))break a;f=c[E>>2]|0;if((f|0)>0){w=d>>>0>>0;g=0;v=0;do{m=c[a+344+(v<<2)>>2]|0;b:do if(c[m+52>>2]|0){h=c[m+4>>2]|0;n=c[(c[F>>2]|0)+4+(h<<2)>>2]|0;o=m+56|0;p=c[(w?o:m+72|0)>>2]|0;q=m+40|0;i=c[q>>2]|0;r=B(c[m+68>>2]|0,d)|0;s=m+60|0;l=c[s>>2]|0;if((l|0)>0){t=m+76|0;u=m+36|0;if((p|0)<=0){i=c[o>>2]|0;h=0;while(1){g=i+g|0;h=h+1|0;if((h|0)>=(l|0))break b}}j=(c[b+(h<<2)>>2]|0)+((B(i,x)|0)<<2)|0;k=0;h=l;f=i;while(1){if(!((c[e>>2]|0)>>>0>=K>>>0?(k+x|0)>=(c[t>>2]|0):0)){f=r;h=0;while(1){Wb[n&63](a,m,c[I+32+(h+g<<2)>>2]|0,j,f);h=h+1|0;if((h|0)==(p|0))break;else f=(c[u>>2]|0)+f|0}f=c[q>>2]|0;h=c[s>>2]|0}g=(c[o>>2]|0)+g|0;k=k+1|0;if((k|0)>=(h|0))break;else j=j+(f<<2)|0}f=c[E>>2]|0}}else g=(c[m+64>>2]|0)+g|0;while(0);v=v+1|0}while((v|0)<(f|0))}d=d+1|0}while(d>>>0<=J>>>0);f=c[H>>2]|0}c[y>>2]=0;d=x+1|0;if((d|0)<(f|0)){x=d;d=0}else{L=30;break}}if((L|0)==30){f=c[M>>2]|0;break}c[G>>2]=x;c[y>>2]=d;a=0;return a|0}else e=a+148|0;while(0);d=a+156|0;c[d>>2]=(c[d>>2]|0)+1;d=(c[e>>2]|0)+1|0;c[e>>2]=d;if(d>>>0>=f>>>0){Qb[c[(c[a+460>>2]|0)+12>>2]&255](a);a=4;return a|0}e=c[N>>2]|0;if((c[a+340>>2]|0)>1)d=1;else{a=c[a+344>>2]|0;d=c[(d>>>0<(f+-1|0)>>>0?a+12|0:a+76|0)>>2]|0}c[e+28>>2]=d;c[e+20>>2]=0;c[e+24>>2]=0;a=3;return a|0}function ku(a,d){a=a|0;d=d|0;var 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,A=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;oa=yb;yb=yb+128|0;ka=oa;la=c[a+452>>2]|0;na=a+332|0;ma=(c[na>>2]|0)+-1|0;n=a+144|0;f=c[n>>2]|0;i=a+152|0;g=c[i>>2]|0;a:do if((f|0)<=(g|0)){j=a+460|0;k=a+412|0;l=a+148|0;m=a+156|0;while(1){h=c[j>>2]|0;if(c[h+20>>2]|0)break a;if((f|0)==(g|0)?(c[l>>2]|0)>>>0>((c[m>>2]|0)+((c[k>>2]|0)==0&1)|0)>>>0:0)break a;if(!(Eb[c[h>>2]&127](a)|0)){f=0;break}f=c[n>>2]|0;g=c[i>>2]|0;if((f|0)>(g|0))break a}yb=oa;return f|0}while(0);ba=a+36|0;if((c[ba>>2]|0)>0){f=a+156|0;ca=a+4|0;da=la+112|0;ea=a+472|0;fa=ka+2|0;ga=ka+16|0;ha=ka+32|0;ia=ka+18|0;ja=ka+4|0;_=0;$=c[a+216>>2]|0;while(1){if(c[$+52>>2]|0){h=c[f>>2]|0;if(h>>>0>>0){i=c[$+12>>2]|0;g=i<<1;j=0;aa=i}else{i=c[$+12>>2]|0;aa=((c[$+32>>2]|0)>>>0)%(i>>>0)|0;aa=(aa|0)==0?i:aa;g=aa;j=1}if(!h){Y=Kb[c[(c[ca>>2]|0)+32>>2]&31](a,c[la+72+(_<<2)>>2]|0,0,g,0)|0;g=1}else{Y=B(i,h+-1|0)|0;Y=Kb[c[(c[ca>>2]|0)+32>>2]&31](a,c[la+72+(_<<2)>>2]|0,Y,i+g|0,0)|0;Y=Y+(c[$+12>>2]<<2)|0;g=0}i=(c[da>>2]|0)+(_*6<<2)|0;o=c[$+80>>2]|0;l=e[o>>1]|0;h=e[o+2>>1]|0;k=e[o+16>>1]|0;m=e[o+32>>1]|0;n=e[o+18>>1]|0;o=e[o+4>>1]|0;Z=c[(c[ea>>2]|0)+4+(_<<2)>>2]|0;if((aa|0)>0){X=(g|0)!=0;N=(j|0)!=0;O=aa+-1|0;P=$+28|0;Q=i+4|0;R=i+8|0;S=i+12|0;T=l*36|0;U=h<<7;V=i+16|0;W=k<<7;M=h<<8;J=i+20|0;K=l*9|0;L=m<<7;H=k<<8;I=$+36|0;F=l*5|0;G=n<<7;D=m<<8;E=o<<7;C=n<<8;y=o<<8;z=$+40|0;w=0;x=c[d+(_<<2)>>2]|0;while(1){g=c[Y+(w<<2)>>2]|0;if(X&(w|0)==0)h=g;else h=c[Y+(w+-1<<2)>>2]|0;if(N&(w|0)==(O|0))i=g;else i=c[Y+(w+1<<2)>>2]|0;l=b[h>>1]|0;q=b[g>>1]|0;k=b[i>>1]|0;A=(c[P>>2]|0)+-1|0;s=k;t=q;u=l;v=0;r=0;p=i;while(1){lu(g,ka,1);if(v>>>0>>0){m=b[p+128>>1]|0;n=b[g+128>>1]|0;o=b[h+128>>1]|0}else{m=s;n=t;o=u}i=c[Q>>2]|0;if((i|0)!=0&(b[fa>>1]|0)==0){j=B(T,q-n|0)|0;if((j|0)>-1){j=(j+U|0)/(M|0)|0;pa=1<0?((j|0)<(pa|0)?j:pa+-1|0):j}else{pa=(U-j|0)/(M|0)|0;j=1<0?((pa|0)<(j|0)?pa:j+-1|0):pa)|0}b[fa>>1]=i}i=c[R>>2]|0;if((i|0)!=0&(b[ga>>1]|0)==0){j=B(T,u-s|0)|0;if((j|0)>-1){pa=(j+W|0)/(H|0)|0;j=1<0?((pa|0)<(j|0)?pa:j+-1|0):pa}else{pa=(W-j|0)/(H|0)|0;j=1<0?((pa|0)<(j|0)?pa:j+-1|0):pa)|0}b[ga>>1]=i}i=c[S>>2]|0;if((i|0)!=0&(b[ha>>1]|0)==0){j=B(K,u-(t<<1)+s|0)|0;if((j|0)>-1){pa=(j+L|0)/(D|0)|0;j=1<0?((pa|0)<(j|0)?pa:j+-1|0):pa}else{pa=(L-j|0)/(D|0)|0;j=1<0?((pa|0)<(j|0)?pa:j+-1|0):pa)|0}b[ha>>1]=i}j=c[V>>2]|0;if((j|0)!=0&(b[ia>>1]|0)==0){i=B(F,l-k-o+m|0)|0;if((i|0)>-1){i=(i+G|0)/(C|0)|0;pa=1<0?((i|0)<(pa|0)?i:pa+-1|0):i}else{i=(G-i|0)/(C|0)|0;pa=1<0?((i|0)<(pa|0)?i:pa+-1|0):i)|0}b[ia>>1]=i}j=c[J>>2]|0;if((j|0)!=0&(b[ja>>1]|0)==0){i=B(K,q-(t<<1)+n|0)|0;if((i|0)>-1){i=(i+E|0)/(y|0)|0;pa=1<0?((i|0)<(pa|0)?i:pa+-1|0):i}else{i=(E-i|0)/(y|0)|0;pa=1<0?((i|0)<(pa|0)?i:pa+-1|0):i)|0}b[ja>>1]=i}Wb[Z&63](a,$,ka,x,r);v=v+1|0;if(v>>>0>A>>>0)break;else{l=u;q=t;k=s;s=m;t=n;u=o;g=g+128|0;r=(c[I>>2]|0)+r|0;h=h+128|0;p=p+128|0}}w=w+1|0;if((w|0)==(aa|0))break;else x=x+(c[z>>2]<<2)|0}}}_=_+1|0;if((_|0)>=(c[ba>>2]|0))break;else $=$+88|0}}else f=a+156|0;pa=(c[f>>2]|0)+1|0;c[f>>2]=pa;pa=pa>>>0<(c[na>>2]|0)>>>0?3:4;yb=oa;return pa|0}function lu(a,b,c){a=a|0;b=b|0;c=c|0;YO(b|0,a|0,c<<7|0)|0;return}function mu(a){a=a|0;var b=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;n=c[a+468>>2]|0;m=a+412|0;f=c[m>>2]|0;d=(f|0)==0;if(!(c[a+224>>2]|0)){if((d?(c[a+420>>2]|0)==0:0)?(c[a+424>>2]|0)==0:0){m=c[a+416>>2]|0;if((c[a+220>>2]|0)!=0|(m|0)<64?(m|0)!=(c[a+436>>2]|0):0)e=38}else e=38;if((e|0)==38){m=c[a>>2]|0;c[m+20>>2]=125;Sb[c[m+4>>2]&63](a,-1)}g=a+436|0;c[n+4>>2]=(c[g>>2]|0)==63?40:41;d=a+340|0;if((c[d>>2]|0)>0){b=0;do{e=c[a+344+(b<<2)>>2]|0;m=c[e+20>>2]|0;su(a,1,m,n+68+(m<<2)|0);if(c[g>>2]|0){m=c[e+24>>2]|0;su(a,0,m,n+84+(m<<2)|0)}c[n+24+(b<<2)>>2]=0;b=b+1|0}while((b|0)<(c[d>>2]|0))}f=a+368|0;if((c[f>>2]|0)<=0){m=n+16|0;c[m>>2]=0;m=n+12|0;c[m>>2]=0;m=n+40|0;c[m>>2]=0;a=a+280|0;a=c[a>>2]|0;n=n+44|0;c[n>>2]=a;return}e=0;do{b=c[a+344+(c[a+372+(e<<2)>>2]<<2)>>2]|0;c[n+100+(e<<2)>>2]=c[n+68+(c[b+20>>2]<<2)>>2];c[n+140+(e<<2)>>2]=c[n+84+(c[b+24>>2]<<2)>>2];a:do if(!(c[b+52>>2]|0))b=0;else{d=c[b+40>>2]|0;b=c[b+36>>2]|0;switch(c[g>>2]|0){case 0:{b=1;break a}case 3:{b=(c[4336+(((d|0)!=1&1)<<3)+(((b|0)!=1&1)<<2)>>2]|0)+1|0;break a}case 8:{m=d+-1|0;b=b+-1|0;b=(c[4352+((m>>>0<2?m:2)*12|0)+((b>>>0<2?b:2)<<2)>>2]|0)+1|0;break a}case 15:{m=d+-1|0;b=b+-1|0;b=(c[4400+((m>>>0<3?m:3)<<4)+((b>>>0<3?b:3)<<2)>>2]|0)+1|0;break a}case 24:{m=d+-1|0;b=b+-1|0;b=(c[4464+((m>>>0<4?m:4)*20|0)+((b>>>0<4?b:4)<<2)>>2]|0)+1|0;break a}case 35:{m=d+-1|0;b=b+-1|0;b=(c[4576+((m>>>0<5?m:5)*24|0)+((b>>>0<5?b:5)<<2)>>2]|0)+1|0;break a}case 48:{m=d+-1|0;b=b+-1|0;b=(c[4720+((m>>>0<6?m:6)*28|0)+((b>>>0<6?b:6)<<2)>>2]|0)+1|0;break a}default:{m=d+-1|0;b=b+-1|0;b=(c[4928+((m>>>0<7?m:7)<<5)+((b>>>0<7?b:7)<<2)>>2]|0)+1|0;break a}}}while(0);c[n+180+(e<<2)>>2]=b;e=e+1|0}while((e|0)<(c[f>>2]|0));m=n+16|0;c[m>>2]=0;m=n+12|0;c[m>>2]=0;m=n+40|0;c[m>>2]=0;a=a+280|0;a=c[a>>2]|0;n=n+44|0;c[n>>2]=a;return}k=a+416|0;b=c[k>>2]|0;if(d)if(!b)e=7;else e=11;else if(((b|0)>=(f|0)?(b|0)<=(c[a+436>>2]|0):0)?(c[a+340>>2]|0)==1:0)e=7;else e=11;do if((e|0)==7){b=c[a+420>>2]|0;if(b){b=b+-1|0;if((b|0)!=(c[a+424>>2]|0)){e=11;break}}else b=c[a+424>>2]|0;if((b|0)>13)e=11}while(0);if((e|0)==11){l=c[a>>2]|0;c[l+20>>2]=17;c[l+24>>2]=f;c[(c[a>>2]|0)+28>>2]=c[k>>2];c[(c[a>>2]|0)+32>>2]=c[a+420>>2];c[(c[a>>2]|0)+36>>2]=c[a+424>>2];Qb[c[c[a>>2]>>2]&255](a)}l=a+340|0;b=c[l>>2]|0;if((b|0)>0){i=a+160|0;g=a+420|0;j=a+424|0;h=0;do{e=c[(c[a+344+(h<<2)>>2]|0)+4>>2]|0;f=c[i>>2]|0;b=c[m>>2]|0;if(b){if((c[f+(e<<8)>>2]|0)<0){b=c[a>>2]|0;c[b+20>>2]=118;c[b+24>>2]=e;c[(c[a>>2]|0)+28>>2]=0;Sb[c[(c[a>>2]|0)+4>>2]&63](a,-1);b=c[m>>2]|0}}else b=0;if((b|0)<=(c[k>>2]|0))while(1){d=f+(e<<8)+(b<<2)|0;o=c[d>>2]|0;if((c[g>>2]|0)!=(((o|0)>0?o:0)|0)){o=c[a>>2]|0;c[o+20>>2]=118;c[o+24>>2]=e;c[(c[a>>2]|0)+28>>2]=b;Sb[c[(c[a>>2]|0)+4>>2]&63](a,-1)}c[d>>2]=c[j>>2];if((b|0)<(c[k>>2]|0))b=b+1|0;else break}h=h+1|0;b=c[l>>2]|0}while((h|0)<(b|0))}else g=a+420|0;e=c[m>>2]|0;o=(e|0)==0;c[n+4>>2]=(c[g>>2]|0)==0?(o?36:37):o?38:39;b:do if((b|0)>0){f=n+64|0;b=0;while(1){d=c[a+344+(b<<2)>>2]|0;if(!e){if(!(c[g>>2]|0)){o=c[d+20>>2]|0;su(a,1,o,n+48+(o<<2)|0)}}else{k=c[d+24>>2]|0;o=n+48+(k<<2)|0;su(a,0,k,o);c[f>>2]=c[o>>2]}c[n+24+(b<<2)>>2]=0;b=b+1|0;if((b|0)>=(c[l>>2]|0))break b;e=c[m>>2]|0}}while(0);c[n+20>>2]=0;o=n+16|0;c[o>>2]=0;o=n+12|0;c[o>>2]=0;o=n+40|0;c[o>>2]=0;a=a+280|0;a=c[a>>2]|0;o=n+44|0;c[o>>2]=a;return}function nu(a){a=a|0;var b=0;b=(c[a+468>>2]|0)+16|0;a=(c[a+464>>2]|0)+24|0;c[a>>2]=(c[a>>2]|0)+((c[b>>2]|0)/8|0);c[b>>2]=0;return}function ou(a,e){a=a|0;e=e|0;var 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,A=0;A=yb;yb=yb+48|0;x=A+20|0;y=A;z=c[a+468>>2]|0;t=c[a+424>>2]|0;i=a+280|0;if(c[i>>2]|0?(g=z+44|0,(c[g>>2]|0)==0):0){v=z+16|0;w=c[a+464>>2]|0;u=w+24|0;c[u>>2]=(c[u>>2]|0)+((c[v>>2]|0)/8|0);c[v>>2]=0;if(!(Eb[c[w+8>>2]&127](a)|0)){z=0;yb=A;return z|0}h=a+340|0;if((c[h>>2]|0)>0){f=0;do{c[z+24+(f<<2)>>2]=0;f=f+1|0}while((f|0)<(c[h>>2]|0))}c[z+20>>2]=0;c[g>>2]=c[i>>2];if(!(c[a+440>>2]|0))c[z+40>>2]=0}if(!(c[z+40>>2]|0)){c[x+16>>2]=a;r=a+24|0;h=c[r>>2]|0;g=c[h>>2]|0;c[x>>2]=g;f=c[h+4>>2]|0;s=x+4|0;c[s>>2]=f;u=z+12|0;i=c[u>>2]|0;v=z+16|0;j=c[v>>2]|0;w=z+20|0;c[y>>2]=c[w>>2];c[y+4>>2]=c[w+4>>2];c[y+8>>2]=c[w+8>>2];c[y+12>>2]=c[w+12>>2];c[y+16>>2]=c[w+16>>2];q=a+368|0;do if((c[q>>2]|0)>0){o=x+8|0;p=x+12|0;l=0;while(1){m=c[e+(l<<2)>>2]|0;n=c[a+372+(l<<2)>>2]|0;h=c[z+48+(c[(c[a+344+(n<<2)>>2]|0)+20>>2]<<2)>>2]|0;if((j|0)<8){if(!(vu(x,i,j,0)|0)){f=0;k=28;break}i=c[o>>2]|0;j=c[p>>2]|0;if((j|0)<8){f=1;k=17}else k=15}else k=15;if((k|0)==15){k=0;f=i>>j+-8&255;g=c[h+144+(f<<2)>>2]|0;if(!g){f=9;k=17}else{f=d[h+1168+f>>0]|0;j=j-g|0}}if((k|0)==17){f=wu(x,i,j,h,f)|0;if((f|0)<0){f=0;k=28;break}j=c[p>>2]|0;i=c[o>>2]|0}if(!f)f=0;else{if((j|0)<(f|0)){if(!(vu(x,i,j,f)|0)){f=0;k=28;break}j=c[p>>2]|0;i=c[o>>2]|0}j=j-f|0;k=c[5184+(f<<2)>>2]|0;h=i>>j&k;f=h-((h|0)>(c[5184+(f+-1<<2)>>2]|0)?0:k)|0}k=y+4+(n<<2)|0;n=(c[k>>2]|0)+f|0;c[k>>2]=n;b[m>>1]=n<=(c[q>>2]|0)){k=25;break}}if((k|0)==25){h=c[r>>2]|0;g=c[x>>2]|0;f=c[s>>2]|0;break}else if((k|0)==28){yb=A;return f|0}}while(0);c[h>>2]=g;c[h+4>>2]=f;c[u>>2]=i;c[v>>2]=j;c[w>>2]=c[y>>2];c[w+4>>2]=c[y+4>>2];c[w+8>>2]=c[y+8>>2];c[w+12>>2]=c[y+12>>2];c[w+16>>2]=c[y+16>>2]}z=z+44|0;c[z>>2]=(c[z>>2]|0)+-1;z=1;yb=A;return z|0}function pu(a,e){a=a|0;e=e|0;var 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;y=yb;yb=yb+32|0;w=y;x=c[a+468>>2]|0;h=a+280|0;if(c[h>>2]|0?(i=x+44|0,(c[i>>2]|0)==0):0){u=x+16|0;v=c[a+464>>2]|0;t=v+24|0;c[t>>2]=(c[t>>2]|0)+((c[u>>2]|0)/8|0);c[u>>2]=0;if(!(Eb[c[v+8>>2]&127](a)|0)){x=0;yb=y;return x|0}g=a+340|0;if((c[g>>2]|0)>0){f=0;do{c[x+24+(f<<2)>>2]=0;f=f+1|0}while((f|0)<(c[g>>2]|0))}c[x+20>>2]=0;c[i>>2]=c[h>>2];if(!(c[a+440>>2]|0))c[x+40>>2]=0}if(!(c[x+40>>2]|0)){v=x+20|0;f=c[v>>2]|0;if(!f){c[w+16>>2]=a;r=a+24|0;t=c[r>>2]|0;c[w>>2]=c[t>>2];s=w+4|0;c[s>>2]=c[t+4>>2];t=x+12|0;g=c[t>>2]|0;u=x+16|0;h=c[u>>2]|0;n=c[a+416>>2]|0;o=c[a+424>>2]|0;p=c[a+432>>2]|0;k=c[e>>2]|0;l=c[x+64>>2]|0;f=c[a+412>>2]|0;a:do if((f|0)<=(n|0)){q=w+8|0;m=w+12|0;j=f;b:while(1){if((h|0)<8){if(!(vu(w,g,h,0)|0)){f=0;a=36;break}g=c[q>>2]|0;h=c[m>>2]|0;if((h|0)<8){f=1;a=19}else a=17}else a=17;if((a|0)==17){a=0;f=g>>h+-8&255;i=c[l+144+(f<<2)>>2]|0;if(!i){f=9;a=19}else{f=d[l+1168+f>>0]|0;h=h-i|0}}if((a|0)==19){f=wu(w,g,h,l,f)|0;if((f|0)<0){f=0;a=36;break}h=c[m>>2]|0;g=c[q>>2]|0}e=f>>>4;i=f&15;if(!i){switch(e&268435455|0){case 0:{f=0;break a}case 15:break;default:{a=27;break b}}f=j+15|0}else{f=e+j|0;if((h|0)<(i|0)){if(!(vu(w,g,h,i)|0)){f=0;a=36;break}h=c[m>>2]|0;g=c[q>>2]|0}h=h-i|0;j=c[5184+(i<<2)>>2]|0;a=g>>h&j;b[k+(c[p+(f<<2)>>2]<<1)>>1]=a-((a|0)>(c[5184+(i+-1<<2)>>2]|0)?0:j)<>2]|0;g=c[q>>2]|0;break}else f=h;while(0);h=f-e|0;f=i+-1+(g>>h&c[5184+(e<<2)>>2])|0;break}else if((a|0)==36){yb=y;return f|0}}else f=0;while(0);r=c[r>>2]|0;c[r>>2]=c[w>>2];c[r+4>>2]=c[s>>2];c[t>>2]=g;c[u>>2]=h}else f=f+-1|0;c[v>>2]=f}x=x+44|0;c[x>>2]=(c[x>>2]|0)+-1;x=1;yb=y;return x|0}function qu(a,d){a=a|0;d=d|0;var 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;s=yb;yb=yb+32|0;q=s;r=c[a+468>>2]|0;h=a+280|0;if(c[h>>2]|0?(i=r+44|0,(c[i>>2]|0)==0):0){o=r+16|0;p=c[a+464>>2]|0;n=p+24|0;c[n>>2]=(c[n>>2]|0)+((c[o>>2]|0)/8|0);c[o>>2]=0;if(!(Eb[c[p+8>>2]&127](a)|0)){r=0;yb=s;return r|0}g=a+340|0;if((c[g>>2]|0)>0){f=0;do{c[r+24+(f<<2)>>2]=0;f=f+1|0}while((f|0)<(c[g>>2]|0))}c[r+20>>2]=0;c[i>>2]=c[h>>2];if(!(c[a+440>>2]|0))c[r+40>>2]=0}c[q+16>>2]=a;m=a+24|0;h=c[m>>2]|0;g=c[h>>2]|0;c[q>>2]=g;f=c[h+4>>2]|0;n=q+4|0;c[n>>2]=f;o=r+12|0;i=c[o>>2]|0;p=r+16|0;j=c[p>>2]|0;l=1<>2];k=a+368|0;do if((c[k>>2]|0)>0){h=q+8|0;a=q+12|0;g=0;f=j;while(1){if((f|0)<1){if(!(vu(q,i,f,1)|0)){f=0;a=19;break}f=c[a>>2]|0;i=c[h>>2]|0}f=f+-1|0;if(1<>2]|0;b[j>>1]=l|(e[j>>1]|0)}g=g+1|0;if((g|0)>=(c[k>>2]|0)){a=17;break}}if((a|0)==17){j=f;h=c[m>>2]|0;g=c[q>>2]|0;f=c[n>>2]|0;break}else if((a|0)==19){yb=s;return f|0}}while(0);c[h>>2]=g;c[h+4>>2]=f;c[o>>2]=i;c[p>>2]=j;r=r+44|0;c[r>>2]=(c[r>>2]|0)+-1;r=1;yb=s;return r|0}function ru(a,e){a=a|0;e=e|0;var 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,A=0,B=0,C=0,D=0,E=0,F=0,G=0;G=yb;yb=yb+288|0;E=G+256|0;D=G;F=c[a+468>>2]|0;h=a+280|0;if(c[h>>2]|0?(i=F+44|0,(c[i>>2]|0)==0):0){z=F+16|0;A=c[a+464>>2]|0;y=A+24|0;c[y>>2]=(c[y>>2]|0)+((c[z>>2]|0)/8|0);c[z>>2]=0;if(!(Eb[c[A+8>>2]&127](a)|0)){F=0;yb=G;return F|0}g=a+340|0;if((c[g>>2]|0)>0){f=0;do{c[F+24+(f<<2)>>2]=0;f=f+1|0}while((f|0)<(c[g>>2]|0))}c[F+20>>2]=0;c[i>>2]=c[h>>2];if(!(c[a+440>>2]|0))c[F+40>>2]=0}do if(!(c[F+40>>2]|0)){q=c[a+416>>2]|0;s=c[a+424>>2]|0;r=1<>2]|0;c[E+16>>2]=a;w=a+24|0;y=c[w>>2]|0;c[E>>2]=c[y>>2];x=E+4|0;c[x>>2]=c[y+4>>2];y=F+12|0;j=c[y>>2]|0;z=F+16|0;g=c[z>>2]|0;A=F+20|0;h=c[A>>2]|0;u=c[e>>2]|0;l=c[F+64>>2]|0;i=c[a+412>>2]|0;o=E+8|0;p=E+12|0;a:do if(!h){f=0;b:while(1){if((g|0)<8){if(!(vu(E,j,g,0)|0))break a;j=c[o>>2]|0;g=c[p>>2]|0;if((g|0)<8){h=1;v=17}else v=15}else v=15;if((v|0)==15){v=0;h=j>>g+-8&255;e=c[l+144+(h<<2)>>2]|0;if(!e){h=9;v=17}else{h=d[l+1168+h>>0]|0;g=g-e|0}}if((v|0)==17){v=0;g=wu(E,j,g,l,h)|0;if((g|0)<0)break a;h=g;g=c[p>>2]|0;j=c[o>>2]|0}e=h>>>4;switch(h&15){case 0:{if((e|0)==15)k=0;else break b;break}case 1:{v=21;break}default:{v=c[a>>2]|0;c[v+20>>2]=121;Sb[c[v+4>>2]&63](a,-1);v=21}}if((v|0)==21){v=0;if((g|0)<1){if(!(vu(E,j,g,1)|0))break a;g=c[p>>2]|0;j=c[o>>2]|0}g=g+-1|0;k=(1<>2]<<1)|0;do if(!(b[e>>1]|0))if((h|0)<1)break c;else h=h+-1|0;else{if((g|0)<1){if(!(vu(E,j,g,1)|0))break a;g=c[p>>2]|0;j=c[o>>2]|0}g=g+-1|0;if((1<>1]|0,n=m<<16>>16,(r&n|0)==0):0)if(m<<16>>16>-1){b[e>>1]=r+n;break}else{b[e>>1]=s+n;break}}while(0);e=i+1|0;if((i|0)<(q|0))i=e;else{i=e;break}}if(k){e=c[t+(i<<2)>>2]|0;b[u+(e<<1)>>1]=k;c[D+(f<<2)>>2]=e;f=f+1|0}if((i|0)<(q|0))i=i+1|0;else{h=0;f=j;v=58;break a}}h=1<>2]|0;j=c[o>>2]|0}g=g-e|0;h=(j>>g&c[5184+(e<<2)>>2])+h|0;if(!h){h=0;f=j;v=58}else v=46}else{h=1;v=46}}else{f=0;v=46}while(0);d:do if((v|0)==46){while(1){e=u+(c[t+(i<<2)>>2]<<1)|0;do if(b[e>>1]|0){if((g|0)<1){if(!(vu(E,j,g,1)|0))break d;g=c[p>>2]|0;j=c[o>>2]|0}g=g+-1|0;if((1<>1]|0,C=B<<16>>16,(r&C|0)==0):0)if(B<<16>>16>-1){b[e>>1]=r+C;break}else{b[e>>1]=s+C;break}}while(0);if((i|0)<(q|0))i=i+1|0;else break}h=h+-1|0;f=j;v=58}while(0);if((v|0)==58){D=c[w>>2]|0;c[D>>2]=c[E>>2];c[D+4>>2]=c[x>>2];c[y>>2]=f;c[z>>2]=g;c[A>>2]=h;break}if(!f){F=0;yb=G;return F|0}do{f=f+-1|0;b[u+(c[D+(f<<2)>>2]<<1)>>1]=0}while((f|0)!=0);f=0;yb=G;return f|0}while(0);F=F+44|0;c[F>>2]=(c[F>>2]|0)+-1;F=1;yb=G;return F|0}function su(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;q=yb;yb=yb+1312|0;k=q+1040|0;p=q;if(f>>>0>3){o=c[b>>2]|0;c[o+20>>2]=52;c[o+24>>2]=f;Qb[c[c[b>>2]>>2]&255](b)}n=(e|0)!=0;o=c[(n?b+180+(f<<2)|0:b+196+(f<<2)|0)>>2]|0;if(!o){m=c[b>>2]|0;c[m+20>>2]=52;c[m+24>>2]=f;Qb[c[c[b>>2]>>2]&255](b)}e=c[g>>2]|0;if(!e){l=Hb[c[c[b+4>>2]>>2]&63](b,1,1424)|0;c[g>>2]=l;m=b}else{m=b;l=e}c[l+140>>2]=o;j=a[o+1>>0]|0;e=j&255;if(!(j<<24>>24))e=0;else _O(k|0,1,e|0)|0;f=a[o+2>>0]|0;g=f&255;h=e+g|0;if(h>>>0>256){j=c[b>>2]|0;c[j+20>>2]=9;Qb[c[j>>2]&255](m)}if(f<<24>>24){_O(k+e|0,2,g|0)|0;e=h}f=a[o+3>>0]|0;g=f&255;h=e+g|0;if((h|0)>256){j=c[b>>2]|0;c[j+20>>2]=9;Qb[c[j>>2]&255](m)}if(f<<24>>24){_O(k+e|0,3,g|0)|0;e=h}f=a[o+4>>0]|0;g=f&255;h=e+g|0;if((h|0)>256){j=c[b>>2]|0;c[j+20>>2]=9;Qb[c[j>>2]&255](m)}if(f<<24>>24){_O(k+e|0,4,g|0)|0;e=h}f=a[o+5>>0]|0;g=f&255;h=e+g|0;if((h|0)>256){j=c[b>>2]|0;c[j+20>>2]=9;Qb[c[j>>2]&255](m)}if(f<<24>>24){_O(k+e|0,5,g|0)|0;e=h}f=a[o+6>>0]|0;g=f&255;h=e+g|0;if((h|0)>256){j=c[b>>2]|0;c[j+20>>2]=9;Qb[c[j>>2]&255](m)}if(f<<24>>24){_O(k+e|0,6,g|0)|0;e=h}f=a[o+7>>0]|0;g=f&255;h=e+g|0;if((h|0)>256){j=c[b>>2]|0;c[j+20>>2]=9;Qb[c[j>>2]&255](m)}if(f<<24>>24){_O(k+e|0,7,g|0)|0;e=h}f=a[o+8>>0]|0;g=f&255;h=e+g|0;if((h|0)>256){j=c[b>>2]|0;c[j+20>>2]=9;Qb[c[j>>2]&255](m)}if(f<<24>>24){_O(k+e|0,8,g|0)|0;e=h}f=a[o+9>>0]|0;g=f&255;h=e+g|0;if((h|0)>256){j=c[b>>2]|0;c[j+20>>2]=9;Qb[c[j>>2]&255](m)}if(f<<24>>24){_O(k+e|0,9,g|0)|0;e=h}f=a[o+10>>0]|0;g=f&255;h=e+g|0;if((h|0)>256){j=c[b>>2]|0;c[j+20>>2]=9;Qb[c[j>>2]&255](m)}if(f<<24>>24){_O(k+e|0,10,g|0)|0;e=h}f=a[o+11>>0]|0;g=f&255;h=e+g|0;if((h|0)>256){j=c[b>>2]|0;c[j+20>>2]=9;Qb[c[j>>2]&255](m)}if(f<<24>>24){_O(k+e|0,11,g|0)|0;e=h}f=a[o+12>>0]|0;g=f&255;h=e+g|0;if((h|0)>256){j=c[b>>2]|0;c[j+20>>2]=9;Qb[c[j>>2]&255](m)}if(f<<24>>24){_O(k+e|0,12,g|0)|0;e=h}f=a[o+13>>0]|0;g=f&255;h=e+g|0;if((h|0)>256){j=c[b>>2]|0;c[j+20>>2]=9;Qb[c[j>>2]&255](m)}if(f<<24>>24){_O(k+e|0,13,g|0)|0;e=h}f=a[o+14>>0]|0;g=f&255;h=e+g|0;if((h|0)>256){j=c[b>>2]|0;c[j+20>>2]=9;Qb[c[j>>2]&255](m)}if(f<<24>>24){_O(k+e|0,14,g|0)|0;e=h}f=a[o+15>>0]|0;g=f&255;h=e+g|0;if((h|0)>256){j=c[b>>2]|0;c[j+20>>2]=9;Qb[c[j>>2]&255](m)}if(f<<24>>24){_O(k+e|0,15,g|0)|0;e=h}f=a[o+16>>0]|0;g=f&255;h=e+g|0;if((h|0)>256){j=c[b>>2]|0;c[j+20>>2]=9;Qb[c[j>>2]&255](m)}if(!(f<<24>>24))h=e;else _O(k+e|0,16,g|0)|0;a[k+h>>0]=0;f=a[k>>0]|0;if(f<<24>>24){g=0;j=f<<24>>24;e=0;while(1){if((j|0)==(f<<24>>24|0)){f=g;while(1){i=e+1|0;c[p+(e<<2)>>2]=f;e=f+1|0;f=a[k+i>>0]|0;if((j|0)==(f<<24>>24|0)){f=e;e=i}else{g=e;e=i;break}}}if((g|0)>=(1<>2]|0;c[i+20>>2]=9;Qb[c[i>>2]&255](m)}if(!(f<<24>>24))break;else{g=g<<1;j=j+1|0}}}e=o+1|0;if(!(a[e>>0]|0)){f=0;e=-1}else{c[l+76>>2]=0-(c[p>>2]|0);e=d[e>>0]|0;f=e;e=c[p+(e+-1<<2)>>2]|0}c[l+4>>2]=e;e=o+2|0;if(!(a[e>>0]|0))e=-1;else{c[l+80>>2]=f-(c[p+(f<<2)>>2]|0);e=f+(d[e>>0]|0)|0;f=e;e=c[p+(e+-1<<2)>>2]|0}c[l+8>>2]=e;e=o+3|0;if(!(a[e>>0]|0))e=-1;else{c[l+84>>2]=f-(c[p+(f<<2)>>2]|0);e=f+(d[e>>0]|0)|0;f=e;e=c[p+(e+-1<<2)>>2]|0}c[l+12>>2]=e;e=o+4|0;if(!(a[e>>0]|0))e=-1;else{c[l+88>>2]=f-(c[p+(f<<2)>>2]|0);e=f+(d[e>>0]|0)|0;f=e;e=c[p+(e+-1<<2)>>2]|0}c[l+16>>2]=e;e=o+5|0;if(!(a[e>>0]|0))e=-1;else{c[l+92>>2]=f-(c[p+(f<<2)>>2]|0);e=f+(d[e>>0]|0)|0;f=e;e=c[p+(e+-1<<2)>>2]|0}c[l+20>>2]=e;e=o+6|0;if(!(a[e>>0]|0))e=-1;else{c[l+96>>2]=f-(c[p+(f<<2)>>2]|0);e=f+(d[e>>0]|0)|0;f=e;e=c[p+(e+-1<<2)>>2]|0}c[l+24>>2]=e;e=o+7|0;if(!(a[e>>0]|0))e=-1;else{c[l+100>>2]=f-(c[p+(f<<2)>>2]|0);e=f+(d[e>>0]|0)|0;f=e;e=c[p+(e+-1<<2)>>2]|0}c[l+28>>2]=e;e=o+8|0;if(!(a[e>>0]|0))e=-1;else{c[l+104>>2]=f-(c[p+(f<<2)>>2]|0);e=f+(d[e>>0]|0)|0;f=e;e=c[p+(e+-1<<2)>>2]|0}c[l+32>>2]=e;e=o+9|0;if(!(a[e>>0]|0))e=-1;else{c[l+108>>2]=f-(c[p+(f<<2)>>2]|0);e=f+(d[e>>0]|0)|0;f=e;e=c[p+(e+-1<<2)>>2]|0}c[l+36>>2]=e;e=o+10|0;if(!(a[e>>0]|0))e=-1;else{c[l+112>>2]=f-(c[p+(f<<2)>>2]|0);e=f+(d[e>>0]|0)|0;f=e;e=c[p+(e+-1<<2)>>2]|0}c[l+40>>2]=e;e=o+11|0;if(!(a[e>>0]|0))e=-1;else{c[l+116>>2]=f-(c[p+(f<<2)>>2]|0);e=f+(d[e>>0]|0)|0;f=e;e=c[p+(e+-1<<2)>>2]|0}c[l+44>>2]=e;e=o+12|0;if(!(a[e>>0]|0))e=-1;else{c[l+120>>2]=f-(c[p+(f<<2)>>2]|0);e=f+(d[e>>0]|0)|0;f=e;e=c[p+(e+-1<<2)>>2]|0}c[l+48>>2]=e;e=o+13|0;if(!(a[e>>0]|0))e=-1;else{c[l+124>>2]=f-(c[p+(f<<2)>>2]|0);e=f+(d[e>>0]|0)|0;f=e;e=c[p+(e+-1<<2)>>2]|0}c[l+52>>2]=e;e=o+14|0;if(!(a[e>>0]|0))e=-1;else{c[l+128>>2]=f-(c[p+(f<<2)>>2]|0);e=f+(d[e>>0]|0)|0;f=e;e=c[p+(e+-1<<2)>>2]|0}c[l+56>>2]=e;e=o+15|0;if(!(a[e>>0]|0))e=-1;else{c[l+132>>2]=f-(c[p+(f<<2)>>2]|0);e=f+(d[e>>0]|0)|0;f=e;e=c[p+(e+-1<<2)>>2]|0}c[l+60>>2]=e;e=o+16|0;if(!(a[e>>0]|0))e=-1;else{c[l+136>>2]=f-(c[p+(f<<2)>>2]|0);e=c[p+(f+(d[e>>0]|0)+-1<<2)>>2]|0}c[l+64>>2]=e;c[l+68>>2]=1048575;_O(l+144|0,0,1024)|0;k=o+1|0;if(!(a[k>>0]|0))e=0;else{j=1;e=0;while(1){i=o+17+e|0;f=128;g=c[p+(e<<2)>>2]<<7;while(1){c[l+144+(g<<2)>>2]=1;a[l+1168+g>>0]=a[i>>0]|0;if((f|0)>1){f=f+-1|0;g=g+1|0}else break}e=e+1|0;if(j>>>0<(d[k>>0]|0)>>>0)j=j+1|0;else break}}k=o+2|0;if(a[k>>0]|0){j=1;while(1){i=o+17+e|0;f=64;g=c[p+(e<<2)>>2]<<6;while(1){c[l+144+(g<<2)>>2]=2;a[l+1168+g>>0]=a[i>>0]|0;if((f|0)>1){f=f+-1|0;g=g+1|0}else break}e=e+1|0;if(j>>>0<(d[k>>0]|0)>>>0)j=j+1|0;else break}}g=o+3|0;if(a[g>>0]|0){f=1;while(1){k=c[p+(e<<2)>>2]<<5;j=o+17+e|0;c[l+144+(k<<2)>>2]=3;a[l+1168+k>>0]=a[j>>0]|0;i=k|1;c[l+144+(i<<2)>>2]=3;a[l+1168+i>>0]=a[j>>0]|0;i=i+1|0;c[l+144+(i<<2)>>2]=3;a[l+1168+i>>0]=a[j>>0]|0;i=k|3;c[l+144+(i<<2)>>2]=3;a[l+1168+i>>0]=a[j>>0]|0;r=i+1|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+2|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;i=i+3|0;c[l+144+(i<<2)>>2]=3;a[l+1168+i>>0]=a[j>>0]|0;i=k|7;c[l+144+(i<<2)>>2]=3;a[l+1168+i>>0]=a[j>>0]|0;r=i+1|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+2|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+3|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+4|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+5|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+6|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;i=i+7|0;c[l+144+(i<<2)>>2]=3;a[l+1168+i>>0]=a[j>>0]|0;i=k|15;c[l+144+(i<<2)>>2]=3;a[l+1168+i>>0]=a[j>>0]|0;r=i+1|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+2|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+3|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+4|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+5|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+6|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+7|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+8|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+9|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+10|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+11|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+12|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+13|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;r=i+14|0;c[l+144+(r<<2)>>2]=3;a[l+1168+r>>0]=a[j>>0]|0;i=i+15|0;c[l+144+(i<<2)>>2]=3;a[l+1168+i>>0]=a[j>>0]|0;k=k|31;c[l+144+(k<<2)>>2]=3;a[l+1168+k>>0]=a[j>>0]|0;e=e+1|0;if(f>>>0<(d[g>>0]|0)>>>0)f=f+1|0;else break}}g=o+4|0;if(a[g>>0]|0){f=1;while(1){r=c[p+(e<<2)>>2]<<4;k=o+17+e|0;c[l+144+(r<<2)>>2]=4;a[l+1168+r>>0]=a[k>>0]|0;j=r|1;c[l+144+(j<<2)>>2]=4;a[l+1168+j>>0]=a[k>>0]|0;j=j+1|0;c[l+144+(j<<2)>>2]=4;a[l+1168+j>>0]=a[k>>0]|0;j=r|3;c[l+144+(j<<2)>>2]=4;a[l+1168+j>>0]=a[k>>0]|0;i=j+1|0;c[l+144+(i<<2)>>2]=4;a[l+1168+i>>0]=a[k>>0]|0;i=j+2|0;c[l+144+(i<<2)>>2]=4;a[l+1168+i>>0]=a[k>>0]|0;j=j+3|0;c[l+144+(j<<2)>>2]=4;a[l+1168+j>>0]=a[k>>0]|0;j=r|7;c[l+144+(j<<2)>>2]=4;a[l+1168+j>>0]=a[k>>0]|0;i=j+1|0;c[l+144+(i<<2)>>2]=4;a[l+1168+i>>0]=a[k>>0]|0;i=j+2|0;c[l+144+(i<<2)>>2]=4;a[l+1168+i>>0]=a[k>>0]|0;i=j+3|0;c[l+144+(i<<2)>>2]=4;a[l+1168+i>>0]=a[k>>0]|0;i=j+4|0;c[l+144+(i<<2)>>2]=4;a[l+1168+i>>0]=a[k>>0]|0;i=j+5|0;c[l+144+(i<<2)>>2]=4;a[l+1168+i>>0]=a[k>>0]|0;i=j+6|0;c[l+144+(i<<2)>>2]=4;a[l+1168+i>>0]=a[k>>0]|0;j=j+7|0;c[l+144+(j<<2)>>2]=4;a[l+1168+j>>0]=a[k>>0]|0;r=r|15;c[l+144+(r<<2)>>2]=4;a[l+1168+r>>0]=a[k>>0]|0;e=e+1|0;if(f>>>0<(d[g>>0]|0)>>>0)f=f+1|0;else break}}g=o+5|0;if(a[g>>0]|0){f=1;while(1){r=c[p+(e<<2)>>2]<<3;k=o+17+e|0;c[l+144+(r<<2)>>2]=5;a[l+1168+r>>0]=a[k>>0]|0;j=r|1;c[l+144+(j<<2)>>2]=5;a[l+1168+j>>0]=a[k>>0]|0;j=j+1|0;c[l+144+(j<<2)>>2]=5;a[l+1168+j>>0]=a[k>>0]|0;j=r|3;c[l+144+(j<<2)>>2]=5;a[l+1168+j>>0]=a[k>>0]|0;i=j+1|0;c[l+144+(i<<2)>>2]=5;a[l+1168+i>>0]=a[k>>0]|0;i=j+2|0;c[l+144+(i<<2)>>2]=5;a[l+1168+i>>0]=a[k>>0]|0;j=j+3|0;c[l+144+(j<<2)>>2]=5;a[l+1168+j>>0]=a[k>>0]|0;r=r|7;c[l+144+(r<<2)>>2]=5;a[l+1168+r>>0]=a[k>>0]|0;e=e+1|0;if(f>>>0<(d[g>>0]|0)>>>0)f=f+1|0;else break}}g=o+6|0;if(a[g>>0]|0){f=1;while(1){r=c[p+(e<<2)>>2]<<2;k=o+17+e|0;c[l+144+(r<<2)>>2]=6;a[l+1168+r>>0]=a[k>>0]|0;j=r|1;c[l+144+(j<<2)>>2]=6;a[l+1168+j>>0]=a[k>>0]|0;j=j+1|0;c[l+144+(j<<2)>>2]=6;a[l+1168+j>>0]=a[k>>0]|0;r=r|3;c[l+144+(r<<2)>>2]=6;a[l+1168+r>>0]=a[k>>0]|0;e=e+1|0;if(f>>>0<(d[g>>0]|0)>>>0)f=f+1|0;else break}}g=o+7|0;if(a[g>>0]|0){f=1;while(1){r=c[p+(e<<2)>>2]<<1;k=o+17+e|0;c[l+144+(r<<2)>>2]=7;a[l+1168+r>>0]=a[k>>0]|0;r=r|1;c[l+144+(r<<2)>>2]=7;a[l+1168+r>>0]=a[k>>0]|0;e=e+1|0;if(f>>>0<(d[g>>0]|0)>>>0)f=f+1|0;else break}}g=o+8|0;if(a[g>>0]|0){f=1;while(1){r=c[p+(e<<2)>>2]|0;c[l+144+(r<<2)>>2]=8;a[l+1168+r>>0]=a[o+17+e>>0]|0;if(f>>>0<(d[g>>0]|0)>>>0){f=f+1|0;e=e+1|0}else break}}if(!(n&(h|0)>0)){yb=q;return}e=0;do{if((d[o+17+e>>0]|0)>15){r=c[b>>2]|0;c[r+20>>2]=9;Qb[c[r>>2]&255](m)}e=e+1|0}while((e|0)!=(h|0));yb=q;return}function tu(a,e){a=a|0;e=e|0;var 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,A=0,B=0;A=yb;yb=yb+48|0;x=A+20|0;y=A;z=c[a+468>>2]|0;h=a+280|0;if(c[h>>2]|0?(i=z+44|0,(c[i>>2]|0)==0):0){v=z+16|0;w=c[a+464>>2]|0;u=w+24|0;c[u>>2]=(c[u>>2]|0)+((c[v>>2]|0)/8|0);c[v>>2]=0;if(!(Eb[c[w+8>>2]&127](a)|0)){z=0;yb=A;return z|0}g=a+340|0;if((c[g>>2]|0)>0){f=0;do{c[z+24+(f<<2)>>2]=0;f=f+1|0}while((f|0)<(c[g>>2]|0))}c[z+20>>2]=0;c[i>>2]=c[h>>2];if(!(c[a+440>>2]|0))c[z+40>>2]=0}if(!(c[z+40>>2]|0)){c[x+16>>2]=a;s=a+24|0;h=c[s>>2]|0;g=c[h>>2]|0;c[x>>2]=g;f=c[h+4>>2]|0;t=x+4|0;c[t>>2]=f;u=z+12|0;j=c[u>>2]|0;v=z+16|0;i=c[v>>2]|0;w=z+20|0;c[y>>2]=c[w>>2];c[y+4>>2]=c[w+4>>2];c[y+8>>2]=c[w+8>>2];c[y+12>>2]=c[w+12>>2];c[y+16>>2]=c[w+16>>2];r=a+368|0;do if((c[r>>2]|0)>0){p=x+8|0;q=x+12|0;o=0;a:while(1){l=c[e+(o<<2)>>2]|0;h=c[z+100+(o<<2)>>2]|0;if((i|0)<8){if(!(vu(x,j,i,0)|0)){f=0;m=67;break}j=c[p>>2]|0;i=c[q>>2]|0;if((i|0)<8){f=1;m=17}else m=15}else m=15;if((m|0)==15){m=0;f=j>>i+-8&255;g=c[h+144+(f<<2)>>2]|0;if(!g){f=9;m=17}else{f=d[h+1168+f>>0]|0;i=i-g|0}}if((m|0)==17){f=wu(x,j,i,h,f)|0;if((f|0)<0){f=0;m=67;break}j=c[p>>2]|0;i=c[q>>2]|0}n=c[z+140+(o<<2)>>2]|0;k=c[z+180+(o<<2)>>2]|0;g=(f|0)!=0;b:do if(!k)if(g){if((i|0)<(f|0)){if(!(vu(x,j,i,f)|0)){f=0;m=67;break a}j=c[p>>2]|0;i=c[q>>2]|0}i=i-f|0;f=1;m=48}else{f=1;m=48}else{if(g){if((i|0)<(f|0)){if(!(vu(x,j,i,f)|0)){f=0;m=67;break a}j=c[p>>2]|0;i=c[q>>2]|0}i=i-f|0;m=c[5184+(f<<2)>>2]|0;h=j>>i&m;f=h-((h|0)>(c[5184+(f+-1<<2)>>2]|0)?0:m)|0}else f=0;h=y+4+(c[a+372+(o<<2)>>2]<<2)|0;m=(c[h>>2]|0)+f|0;c[h>>2]=m;b[l>>1]=m;if((k|0)>1){f=1;do{if((i|0)<8){if(!(vu(x,j,i,0)|0)){f=0;m=67;break a}j=c[p>>2]|0;i=c[q>>2]|0;if((i|0)<8){g=1;m=32}else m=30}else m=30;if((m|0)==30){m=0;h=j>>i+-8&255;g=c[n+144+(h<<2)>>2]|0;if(!g){g=9;m=32}else{i=i-g|0;g=d[n+1168+h>>0]|0}}if((m|0)==32){m=0;g=wu(x,j,i,n,g)|0;if((g|0)<0){f=0;m=67;break a}j=c[p>>2]|0;i=c[q>>2]|0}h=g>>>4;g=g&15;if(!g){if((h|0)!=15)break b;g=f+15|0}else{f=h+f|0;if((i|0)<(g|0)){if(!(vu(x,j,i,g)|0)){f=0;m=67;break a}j=c[p>>2]|0;i=c[q>>2]|0}i=i-g|0;h=c[5184+(g<<2)>>2]|0;B=j>>i&h;b[l+(c[2576+(f<<2)>>2]<<1)>>1]=B-((B|0)>(c[5184+(g+-1<<2)>>2]|0)?0:h);g=f}f=g+1|0}while((f|0)<(k|0));if((g|0)<63)m=48}else{f=1;m=48}}while(0);c:do if((m|0)==48){h=f;do{if((i|0)<8){if(!(vu(x,j,i,0)|0)){f=0;m=67;break a}j=c[p>>2]|0;i=c[q>>2]|0;if((i|0)<8){f=1;m=54}else m=52}else m=52;if((m|0)==52){m=0;f=j>>i+-8&255;g=c[n+144+(f<<2)>>2]|0;if(!g){f=9;m=54}else{f=d[n+1168+f>>0]|0;i=i-g|0}}if((m|0)==54){f=wu(x,j,i,n,f)|0;if((f|0)<0){f=0;m=67;break a}j=c[p>>2]|0;i=c[q>>2]|0}g=f>>>4;f=f&15;if(!f)if((g|0)==15)f=15;else break c;else{if((i|0)<(f|0)){if(!(vu(x,j,i,f)|0)){f=0;m=67;break a}j=c[p>>2]|0;i=c[q>>2]|0}i=i-f|0;f=g}h=h+1+f|0}while((h|0)<64)}while(0);o=o+1|0;if((o|0)>=(c[r>>2]|0)){m=64;break}}if((m|0)==64){h=c[s>>2]|0;g=c[x>>2]|0;f=c[t>>2]|0;break}else if((m|0)==67){yb=A;return f|0}}while(0);c[h>>2]=g;c[h+4>>2]=f;c[u>>2]=j;c[v>>2]=i;c[w>>2]=c[y>>2];c[w+4>>2]=c[y+4>>2];c[w+8>>2]=c[y+8>>2];c[w+12>>2]=c[y+12>>2];c[w+16>>2]=c[y+16>>2]}B=z+44|0;c[B>>2]=(c[B>>2]|0)+-1;B=1;yb=A;return B|0}function uu(a,e){a=a|0;e=e|0;var 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,A=0,B=0,C=0;C=yb;yb=yb+48|0;z=C+20|0;A=C;B=c[a+468>>2]|0;h=a+280|0;if(c[h>>2]|0?(i=B+44|0,(c[i>>2]|0)==0):0){x=B+16|0;y=c[a+464>>2]|0;w=y+24|0;c[w>>2]=(c[w>>2]|0)+((c[x>>2]|0)/8|0);c[x>>2]=0;if(!(Eb[c[y+8>>2]&127](a)|0)){B=0;yb=C;return B|0}g=a+340|0;if((c[g>>2]|0)>0){f=0;do{c[B+24+(f<<2)>>2]=0;f=f+1|0}while((f|0)<(c[g>>2]|0))}c[B+20>>2]=0;c[i>>2]=c[h>>2];if(!(c[a+440>>2]|0))c[B+40>>2]=0}if(!(c[B+40>>2]|0)){r=c[a+432>>2]|0;s=c[a+436>>2]|0;c[z+16>>2]=a;u=a+24|0;h=c[u>>2]|0;g=c[h>>2]|0;c[z>>2]=g;f=c[h+4>>2]|0;v=z+4|0;c[v>>2]=f;w=B+12|0;j=c[w>>2]|0;x=B+16|0;i=c[x>>2]|0;y=B+20|0;c[A>>2]=c[y>>2];c[A+4>>2]=c[y+4>>2];c[A+8>>2]=c[y+8>>2];c[A+12>>2]=c[y+12>>2];c[A+16>>2]=c[y+16>>2];t=a+368|0;do if((c[t>>2]|0)>0){p=z+8|0;q=z+12|0;o=0;a:while(1){l=c[e+(o<<2)>>2]|0;h=c[B+100+(o<<2)>>2]|0;if((i|0)<8){if(!(vu(z,j,i,0)|0)){f=0;m=67;break}j=c[p>>2]|0;i=c[q>>2]|0;if((i|0)<8){f=1;m=17}else m=15}else m=15;if((m|0)==15){m=0;f=j>>i+-8&255;g=c[h+144+(f<<2)>>2]|0;if(!g){f=9;m=17}else{f=d[h+1168+f>>0]|0;i=i-g|0}}if((m|0)==17){f=wu(z,j,i,h,f)|0;if((f|0)<0){f=0;m=67;break}j=c[p>>2]|0;i=c[q>>2]|0}n=c[B+140+(o<<2)>>2]|0;k=c[B+180+(o<<2)>>2]|0;g=(f|0)!=0;b:do if(!k)if(g){if((i|0)<(f|0)){if(!(vu(z,j,i,f)|0)){f=0;m=67;break a}j=c[p>>2]|0;i=c[q>>2]|0}i=i-f|0;f=1;m=47}else{f=1;m=47}else{if(g){if((i|0)<(f|0)){if(!(vu(z,j,i,f)|0)){f=0;m=67;break a}j=c[p>>2]|0;i=c[q>>2]|0}i=i-f|0;m=c[5184+(f<<2)>>2]|0;h=j>>i&m;f=h-((h|0)>(c[5184+(f+-1<<2)>>2]|0)?0:m)|0}else f=0;h=A+4+(c[a+372+(o<<2)>>2]<<2)|0;m=(c[h>>2]|0)+f|0;c[h>>2]=m;b[l>>1]=m;if((k|0)>1){f=1;while(1){if((i|0)<8){if(!(vu(z,j,i,0)|0)){f=0;m=67;break a}j=c[p>>2]|0;i=c[q>>2]|0;if((i|0)<8){g=1;m=32}else m=30}else m=30;if((m|0)==30){m=0;h=j>>i+-8&255;g=c[n+144+(h<<2)>>2]|0;if(!g){g=9;m=32}else{i=i-g|0;g=d[n+1168+h>>0]|0}}if((m|0)==32){m=0;g=wu(z,j,i,n,g)|0;if((g|0)<0){f=0;m=67;break a}j=c[p>>2]|0;i=c[q>>2]|0}h=g>>>4;g=g&15;if(!g){if((h|0)!=15)break b;f=f+15|0}else{f=h+f|0;if((i|0)<(g|0)){if(!(vu(z,j,i,g)|0)){f=0;m=67;break a}j=c[p>>2]|0;i=c[q>>2]|0}i=i-g|0;m=c[5184+(g<<2)>>2]|0;h=j>>i&m;b[l+(c[r+(f<<2)>>2]<<1)>>1]=h-((h|0)>(c[5184+(g+-1<<2)>>2]|0)?0:m)}f=f+1|0;if((f|0)>=(k|0)){m=47;break}}}else{f=1;m=47}}while(0);c:do if((m|0)==47)if((f|0)<=(s|0)){h=f;do{if((i|0)<8){if(!(vu(z,j,i,0)|0)){f=0;m=67;break a}j=c[p>>2]|0;i=c[q>>2]|0;if((i|0)<8){f=1;m=54}else m=52}else m=52;if((m|0)==52){m=0;f=j>>i+-8&255;g=c[n+144+(f<<2)>>2]|0;if(!g){f=9;m=54}else{f=d[n+1168+f>>0]|0;i=i-g|0}}if((m|0)==54){f=wu(z,j,i,n,f)|0;if((f|0)<0){f=0;m=67;break a}j=c[p>>2]|0;i=c[q>>2]|0}g=f>>>4;f=f&15;if(!f)if((g|0)==15)f=15;else break c;else{if((i|0)<(f|0)){if(!(vu(z,j,i,f)|0)){f=0;m=67;break a}j=c[p>>2]|0;i=c[q>>2]|0}i=i-f|0;f=g}h=h+1+f|0}while((h|0)<=(s|0))}while(0);o=o+1|0;if((o|0)>=(c[t>>2]|0)){m=64;break}}if((m|0)==64){h=c[u>>2]|0;g=c[z>>2]|0;f=c[v>>2]|0;break}else if((m|0)==67){yb=C;return f|0}}while(0);c[h>>2]=g;c[h+4>>2]=f;c[w>>2]=j;c[x>>2]=i;c[y>>2]=c[A>>2];c[y+4>>2]=c[A+4>>2];c[y+8>>2]=c[A+8>>2];c[y+12>>2]=c[A+12>>2];c[y+16>>2]=c[A+16>>2]}B=B+44|0;c[B>>2]=(c[B>>2]|0)+-1;B=1;yb=C;return B|0}function vu(b,d,e,f){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;g=c[b>>2]|0;n=b+4|0;h=c[n>>2]|0;m=c[b+16>>2]|0;l=m+440|0;a:do if(!(c[l>>2]|0)){if((e|0)<25){k=m+24|0;j=e;b:while(1){if(!h){if(!(Eb[c[(c[k>>2]|0)+12>>2]&127](m)|0)){g=0;o=20;break}g=c[k>>2]|0;h=c[g+4>>2]|0;g=c[g>>2]|0}h=h+-1|0;i=g+1|0;e=a[g>>0]|0;g=e&255;c:do if(e<<24>>24==-1){g=i;while(1){if(!h){if(!(Eb[c[(c[k>>2]|0)+12>>2]&127](m)|0)){g=0;o=20;break b}e=c[k>>2]|0;h=c[e+4>>2]|0;e=c[e>>2]|0}else e=g;h=h+-1|0;g=e+1|0;e=a[e>>0]|0;switch(e<<24>>24){case 0:{e=255;break c}case -1:break;default:{o=13;break b}}}}else{e=g;g=i}while(0);d=e|d<<8;e=j+8|0;if((j|0)<17)j=e;else break a}if((o|0)==13){c[l>>2]=e&255;e=j;i=h;o=15;break}else if((o|0)==20)return g|0}}else{i=h;o=15}while(0);if((o|0)==15)if((e|0)<(f|0)){h=m+468|0;if(!(c[(c[h>>2]|0)+40>>2]|0)){o=c[m>>2]|0;c[o+20>>2]=120;Sb[c[o+4>>2]&63](m,-1);c[(c[h>>2]|0)+40>>2]=1}d=d<<25-e;e=25;h=i}else h=i;c[b>>2]=g;c[n>>2]=h;c[b+8>>2]=d;c[b+12>>2]=e;o=1;return o|0}function wu(a,b,e,f,g){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;do if((e|0)<(g|0))if(!(vu(a,b,e,g)|0)){f=-1;return f|0}else{b=c[a+8>>2]|0;e=c[a+12>>2]|0;break}while(0);e=e-g|0;h=b>>e&c[5184+(g<<2)>>2];i=a+8|0;j=a+12|0;a:do if((h|0)>(c[f+(g<<2)>>2]|0)){while(1){h=h<<1;if((e|0)<1){if(!(vu(a,b,e,1)|0)){e=-1;break}b=c[i>>2]|0;e=c[j>>2]|0}e=e+-1|0;h=b>>>e&1|h;g=g+1|0;if((h|0)<=(c[f+(g<<2)>>2]|0))break a}return e|0}while(0);c[i>>2]=b;c[j>>2]=e;if((g|0)>16){f=c[a+16>>2]|0;a=c[f>>2]|0;c[a+20>>2]=121;Sb[c[a+4>>2]&63](f,-1);f=0;return f|0}else{f=d[(c[f+72+(g<<2)>>2]|0)+h+((c[f+140>>2]|0)+17)>>0]|0;return f|0}return 0}function xu(b){b=b|0;var 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;o=c[b+468>>2]|0;p=b+224|0;q=b+412|0;f=c[q>>2]|0;e=(f|0)==0;do if(c[p>>2]|0){m=b+416|0;d=c[m>>2]|0;if(e)if(!d)n=7;else n=11;else if(((d|0)>=(f|0)?(d|0)<=(c[b+436>>2]|0):0)?(c[b+340>>2]|0)==1:0)n=7;else n=11;do if((n|0)==7){d=c[b+420>>2]|0;if(d){d=d+-1|0;if((d|0)!=(c[b+424>>2]|0)){n=11;break}}else d=c[b+424>>2]|0;if((d|0)>13)n=11}while(0);if((n|0)==11){l=c[b>>2]|0;c[l+20>>2]=17;c[l+24>>2]=f;c[(c[b>>2]|0)+28>>2]=c[m>>2];c[(c[b>>2]|0)+32>>2]=c[b+420>>2];c[(c[b>>2]|0)+36>>2]=c[b+424>>2];Qb[c[c[b>>2]>>2]&255](b)}l=b+340|0;d=c[l>>2]|0;if((d|0)>0){j=b+160|0;g=b+420|0;k=b+424|0;i=0;do{f=c[(c[b+344+(i<<2)>>2]|0)+4>>2]|0;h=c[j>>2]|0;d=c[q>>2]|0;if(d){if((c[h+(f<<8)>>2]|0)<0){d=c[b>>2]|0;c[d+20>>2]=118;c[d+24>>2]=f;c[(c[b>>2]|0)+28>>2]=0;Sb[c[(c[b>>2]|0)+4>>2]&63](b,-1);d=c[q>>2]|0}}else d=0;if((d|0)<=(c[m>>2]|0))while(1){e=h+(f<<8)+(d<<2)|0;r=c[e>>2]|0;if((c[g>>2]|0)!=(((r|0)>0?r:0)|0)){r=c[b>>2]|0;c[r+20>>2]=118;c[r+24>>2]=f;c[(c[b>>2]|0)+28>>2]=d;Sb[c[(c[b>>2]|0)+4>>2]&63](b,-1)}c[e>>2]=c[k>>2];if((d|0)<(c[m>>2]|0))d=d+1|0;else break}i=i+1|0;d=c[l>>2]|0}while((i|0)<(d|0))}else g=b+420|0;e=(c[q>>2]|0)==0;f=o+4|0;if(!(c[g>>2]|0))if(e){c[f>>2]=42;k=l;break}else{c[f>>2]=43;k=l;break}else if(e){c[f>>2]=44;k=l;break}else{c[f>>2]=45;k=l;break}}else{if((e?(c[b+420>>2]|0)==0:0)?(c[b+424>>2]|0)==0:0){r=c[b+416>>2]|0;if((r|0)<64?(r|0)!=(c[b+436>>2]|0):0)n=36}else n=36;if((n|0)==36){r=c[b>>2]|0;c[r+20>>2]=125;Sb[c[r+4>>2]&63](b,-1)}c[o+4>>2]=46;d=b+340|0;k=d;d=c[d>>2]|0}while(0);if((d|0)<=0){q=o+12|0;c[q>>2]=0;q=o+16|0;c[q>>2]=0;q=o+20|0;c[q>>2]=-16;q=b+280|0;q=c[q>>2]|0;r=o+56|0;c[r>>2]=q;return}h=b+436|0;i=b+420|0;j=b+4|0;g=0;do{f=c[b+344+(g<<2)>>2]|0;if(c[p>>2]|0)if(!(c[q>>2]|0)){if(!(c[i>>2]|0))n=43}else n=50;else n=43;do if((n|0)==43){n=0;d=c[f+20>>2]|0;if(d>>>0>15){r=c[b>>2]|0;c[r+20>>2]=50;c[r+24>>2]=d;Qb[c[c[b>>2]>>2]&255](b)}e=o+60+(d<<2)|0;d=c[e>>2]|0;if(!d){d=Hb[c[c[j>>2]>>2]&63](b,1,64)|0;c[e>>2]=d}e=d+64|0;do{a[d>>0]=0;d=d+1|0}while((d|0)<(e|0));c[o+24+(g<<2)>>2]=0;c[o+40+(g<<2)>>2]=0;if(!(c[p>>2]|0))if(!(c[h>>2]|0))break;else{n=50;break}else if(!(c[q>>2]|0))break;else{n=50;break}}while(0);if((n|0)==50){n=0;d=c[f+24>>2]|0;if(d>>>0>15){r=c[b>>2]|0;c[r+20>>2]=50;c[r+24>>2]=d;Qb[c[c[b>>2]>>2]&255](b)}e=o+124+(d<<2)|0;d=c[e>>2]|0;if(!d){d=Hb[c[c[j>>2]>>2]&63](b,1,256)|0;c[e>>2]=d}_O(d|0,0,256)|0}g=g+1|0}while((g|0)<(c[k>>2]|0));q=o+12|0;c[q>>2]=0;q=o+16|0;c[q>>2]=0;q=o+20|0;c[q>>2]=-16;q=b+280|0;q=c[q>>2]|0;r=o+56|0;c[r>>2]=q;return}function yu(a){a=a|0;return}function zu(e,f){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;s=c[e+468>>2]|0;p=e+280|0;if(c[p>>2]|0){q=s+56|0;g=c[q>>2]|0;if(!g){if(!(Eb[c[(c[e+464>>2]|0)+8>>2]&127](e)|0)){r=c[e>>2]|0;c[r+20>>2]=25;Qb[c[r>>2]&255](e)}h=e+340|0;if((c[h>>2]|0)>0){i=e+224|0;j=e+412|0;k=e+436|0;l=e+420|0;g=0;do{m=c[e+344+(g<<2)>>2]|0;if(c[i>>2]|0)if(!(c[j>>2]|0)){if(!(c[l>>2]|0))t=10}else t=13;else t=10;do if((t|0)==10){t=0;n=c[s+60+(c[m+20>>2]<<2)>>2]|0;o=n+64|0;do{a[n>>0]=0;n=n+1|0}while((n|0)<(o|0));c[s+24+(g<<2)>>2]=0;c[s+40+(g<<2)>>2]=0;if(!(c[i>>2]|0))if(!(c[k>>2]|0))break;else{t=13;break}else if(!(c[j>>2]|0))break;else{t=13;break}}while(0);if((t|0)==13){t=0;_O(c[s+124+(c[m+24>>2]<<2)>>2]|0,0,256)|0}g=g+1|0}while((g|0)<(c[h>>2]|0))}c[s+12>>2]=0;c[s+16>>2]=0;c[s+20>>2]=-16;g=c[p>>2]|0;c[q>>2]=g}c[q>>2]=g+-1}o=s+20|0;if((c[o>>2]|0)==-1)return 1;p=e+368|0;if((c[p>>2]|0)<=0)return 1;q=e+424|0;n=0;a:while(1){r=c[f+(n<<2)>>2]|0;l=c[e+372+(n<<2)>>2]|0;j=c[(c[e+344+(l<<2)>>2]|0)+20>>2]|0;h=s+60+(j<<2)|0;k=s+40+(l<<2)|0;g=(c[h>>2]|0)+(c[k>>2]|0)|0;if(!(Eu(e,g)|0)){c[k>>2]=0;g=c[s+24+(l<<2)>>2]|0}else{m=Eu(e,g+1|0)|0;i=g+2+m|0;g=Eu(e,i)|0;if(g){h=(c[h>>2]|0)+20|0;if(!(Eu(e,h)|0))i=h;else while(1){g=g<<1;if((g|0)==32768)break a;h=h+1|0;if(!(Eu(e,h)|0)){i=h;break}}}else g=0;do if((g|0)>=(1<<(d[e+232+j>>0]|0)>>1|0)){h=m<<2;if((g|0)>(1<<(d[e+248+j>>0]|0)>>1|0)){h=h+12|0;break}else{h=h+4|0;break}}else h=0;while(0);c[k>>2]=h;i=i+14|0;h=g>>1;if(h)do{k=(Eu(e,i)|0)==0;g=(k?0:h)|g;h=h>>1}while((h|0)!=0);l=s+24+(l<<2)|0;g=(c[l>>2]|0)+((m|0)==0?g+1|0:~g)|0;c[l>>2]=g}b[r>>1]=g<>2];n=n+1|0;if((n|0)>=(c[p>>2]|0)){t=37;break}}if((t|0)==37)return 1;t=c[e>>2]|0;c[t+20>>2]=117;Sb[c[t+4>>2]&63](e,-1);c[o>>2]=-1;return 1}function Au(e,f){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;s=c[e+468>>2]|0;p=e+280|0;if(c[p>>2]|0){q=s+56|0;g=c[q>>2]|0;if(!g){if(!(Eb[c[(c[e+464>>2]|0)+8>>2]&127](e)|0)){t=c[e>>2]|0;c[t+20>>2]=25;Qb[c[t>>2]&255](e)}h=e+340|0;if((c[h>>2]|0)>0){i=e+224|0;j=e+412|0;k=e+436|0;l=e+420|0;g=0;do{m=c[e+344+(g<<2)>>2]|0;if(c[i>>2]|0)if(!(c[j>>2]|0)){if(!(c[l>>2]|0))r=10}else r=13;else r=10;do if((r|0)==10){r=0;n=c[s+60+(c[m+20>>2]<<2)>>2]|0;o=n+64|0;do{a[n>>0]=0;n=n+1|0}while((n|0)<(o|0));c[s+24+(g<<2)>>2]=0;c[s+40+(g<<2)>>2]=0;if(!(c[i>>2]|0))if(!(c[k>>2]|0))break;else{r=13;break}else if(!(c[j>>2]|0))break;else{r=13;break}}while(0);if((r|0)==13){r=0;_O(c[s+124+(c[m+24>>2]<<2)>>2]|0,0,256)|0}g=g+1|0}while((g|0)<(c[h>>2]|0))}c[s+12>>2]=0;c[s+16>>2]=0;c[s+20>>2]=-16;g=c[p>>2]|0;c[q>>2]=g}c[q>>2]=g+-1}t=s+20|0;if((c[t>>2]|0)==-1)return 1;r=c[e+432>>2]|0;p=c[f>>2]|0;o=c[(c[e+344>>2]|0)+24>>2]|0;q=s+124+(o<<2)|0;l=s+188|0;m=e+416|0;n=e+424|0;o=e+264+o|0;h=(c[e+412>>2]|0)+-1|0;a:while(1){g=(c[q>>2]|0)+(h*3|0)|0;if(Eu(e,g)|0){r=36;break}j=h+1|0;if(!(Eu(e,g+1|0)|0)){i=g;h=j;while(1){if((h|0)>=(c[m>>2]|0)){r=23;break a}g=i+3|0;j=h+1|0;if(!(Eu(e,i+4|0)|0)){i=g;h=j}else break}}k=Eu(e,l)|0;i=g+2|0;g=Eu(e,i)|0;if(g){if(Eu(e,i)|0){g=g<<1;h=(c[q>>2]|0)+((h|0)<(d[o>>0]|0|0)?189:217)|0;if(Eu(e,h)|0)do{g=g<<1;if((g|0)==32768){r=30;break a}h=h+1|0}while((Eu(e,h)|0)!=0)}else h=i;i=h+14|0;h=g>>1;if(h)do{s=(Eu(e,i)|0)==0;g=(s?0:h)|g;h=h>>1}while((h|0)!=0)}else g=0;b[p+(c[r+(j<<2)>>2]<<1)>>1]=((k|0)==0?g+1|0:~g)<>2];if((j|0)<(c[m>>2]|0))h=j;else{r=36;break}}if((r|0)==23){s=c[e>>2]|0;c[s+20>>2]=117;Sb[c[s+4>>2]&63](e,-1);c[t>>2]=-1;return 1}else if((r|0)==30){s=c[e>>2]|0;c[s+20>>2]=117;Sb[c[s+4>>2]&63](e,-1);c[t>>2]=-1;return 1}else if((r|0)==36)return 1;return 0}function Bu(d,f){d=d|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;r=c[d+468>>2]|0;p=d+280|0;if(c[p>>2]|0){s=r+56|0;g=c[s>>2]|0;if(!g){if(!(Eb[c[(c[d+464>>2]|0)+8>>2]&127](d)|0)){o=c[d>>2]|0;c[o+20>>2]=25;Qb[c[o>>2]&255](d)}h=d+340|0;if((c[h>>2]|0)>0){i=d+224|0;j=d+412|0;k=d+436|0;l=d+420|0;g=0;do{m=c[d+344+(g<<2)>>2]|0;if(c[i>>2]|0)if(!(c[j>>2]|0)){if(!(c[l>>2]|0))q=10}else q=13;else q=10;do if((q|0)==10){q=0;n=c[r+60+(c[m+20>>2]<<2)>>2]|0;o=n+64|0;do{a[n>>0]=0;n=n+1|0}while((n|0)<(o|0));c[r+24+(g<<2)>>2]=0;c[r+40+(g<<2)>>2]=0;if(!(c[i>>2]|0))if(!(c[k>>2]|0))break;else{q=13;break}else if(!(c[j>>2]|0))break;else{q=13;break}}while(0);if((q|0)==13){q=0;_O(c[r+124+(c[m+24>>2]<<2)>>2]|0,0,256)|0}g=g+1|0}while((g|0)<(c[h>>2]|0))}c[r+12>>2]=0;c[r+16>>2]=0;c[r+20>>2]=-16;g=c[p>>2]|0;c[s>>2]=g}c[s>>2]=g+-1}h=r+188|0;i=1<>2];j=d+368|0;if((c[j>>2]|0)<=0)return 1;g=0;do{if(Eu(d,h)|0){s=c[f+(g<<2)>>2]|0;b[s>>1]=i|(e[s>>1]|0)}g=g+1|0}while((g|0)<(c[j>>2]|0));return 1}function Cu(d,e){d=d|0;e=e|0;var 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;q=c[d+468>>2]|0;o=d+280|0;if(c[o>>2]|0){p=q+56|0;f=c[p>>2]|0;if(!f){if(!(Eb[c[(c[d+464>>2]|0)+8>>2]&127](d)|0)){s=c[d>>2]|0;c[s+20>>2]=25;Qb[c[s>>2]&255](d)}g=d+340|0;if((c[g>>2]|0)>0){h=d+224|0;i=d+412|0;j=d+436|0;k=d+420|0;f=0;do{l=c[d+344+(f<<2)>>2]|0;if(c[h>>2]|0)if(!(c[i>>2]|0)){if(!(c[k>>2]|0))t=10}else t=13;else t=10;do if((t|0)==10){t=0;m=c[q+60+(c[l+20>>2]<<2)>>2]|0;n=m+64|0;do{a[m>>0]=0;m=m+1|0}while((m|0)<(n|0));c[q+24+(f<<2)>>2]=0;c[q+40+(f<<2)>>2]=0;if(!(c[h>>2]|0))if(!(c[j>>2]|0))break;else{t=13;break}else if(!(c[i>>2]|0))break;else{t=13;break}}while(0);if((t|0)==13){t=0;_O(c[q+124+(c[l+24>>2]<<2)>>2]|0,0,256)|0}f=f+1|0}while((f|0)<(c[g>>2]|0))}c[q+12>>2]=0;c[q+16>>2]=0;c[q+20>>2]=-16;f=c[o>>2]|0;c[p>>2]=f}c[p>>2]=f+-1}r=q+20|0;if((c[r>>2]|0)==-1)return 1;s=c[d+432>>2]|0;n=c[e>>2]|0;g=c[(c[d+344>>2]|0)+24>>2]|0;p=c[d+424>>2]|0;o=1<>2]|0;while(1){if(b[n+(c[s+(f<<2)>>2]<<1)>>1]|0)break;f=f+-1|0;if(!f){f=0;break}}m=q+124+(g<<2)|0;j=q+188|0;k=o&65535;l=p&65535;g=(c[d+412>>2]|0)+-1|0;a:while(1){h=(c[m>>2]|0)+(g*3|0)|0;if((g|0)>=(f|0)?Eu(d,h)|0:0){t=38;break}g=g+1|0;i=n+(c[s+(g<<2)>>2]<<1)|0;b:do if(!(b[i>>1]|0)){while(1){if(Eu(d,h+1|0)|0)break;if((g|0)>=(c[e>>2]|0)){t=35;break a}h=h+3|0;g=g+1|0;i=n+(c[s+(g<<2)>>2]<<1)|0;if(b[i>>1]|0){t=26;break b}}if(!(Eu(d,j)|0)){b[i>>1]=k;break}else{b[i>>1]=l;break}}else t=26;while(0);do if((t|0)==26){t=0;if(Eu(d,h+2|0)|0){q=b[i>>1]|0;h=q<<16>>16;if(q<<16>>16<0){b[i>>1]=p+h;break}else{b[i>>1]=o+h;break}}}while(0);if((g|0)>=(c[e>>2]|0)){t=38;break}}if((t|0)==35){t=c[d>>2]|0;c[t+20>>2]=117;Sb[c[t+4>>2]&63](d,-1);c[r>>2]=-1;return 1}else if((t|0)==38)return 1;return 0}function Du(e,f){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;v=c[e+468>>2]|0;p=e+280|0;if(c[p>>2]|0){q=v+56|0;g=c[q>>2]|0;if(!g){if(!(Eb[c[(c[e+464>>2]|0)+8>>2]&127](e)|0)){u=c[e>>2]|0;c[u+20>>2]=25;Qb[c[u>>2]&255](e)}h=e+340|0;if((c[h>>2]|0)>0){i=e+224|0;j=e+412|0;k=e+436|0;l=e+420|0;g=0;do{m=c[e+344+(g<<2)>>2]|0;if(c[i>>2]|0)if(!(c[j>>2]|0)){if(!(c[l>>2]|0))r=10}else r=13;else r=10;do if((r|0)==10){r=0;n=c[v+60+(c[m+20>>2]<<2)>>2]|0;o=n+64|0;do{a[n>>0]=0;n=n+1|0}while((n|0)<(o|0));c[v+24+(g<<2)>>2]=0;c[v+40+(g<<2)>>2]=0;if(!(c[i>>2]|0))if(!(c[k>>2]|0))break;else{r=13;break}else if(!(c[j>>2]|0))break;else{r=13;break}}while(0);if((r|0)==13){r=0;_O(c[v+124+(c[m+24>>2]<<2)>>2]|0,0,256)|0}g=g+1|0}while((g|0)<(c[h>>2]|0))}c[v+12>>2]=0;c[v+16>>2]=0;c[v+20>>2]=-16;g=c[p>>2]|0;c[q>>2]=g}c[q>>2]=g+-1}u=v+20|0;if((c[u>>2]|0)==-1)return 1;p=c[e+432>>2]|0;q=e+368|0;if((c[q>>2]|0)<=0)return 1;r=e+436|0;s=v+188|0;o=0;a:while(1){t=c[f+(o<<2)>>2]|0;l=c[e+372+(o<<2)>>2]|0;n=c[e+344+(l<<2)>>2]|0;j=c[n+20>>2]|0;h=v+60+(j<<2)|0;k=v+40+(l<<2)|0;g=(c[h>>2]|0)+(c[k>>2]|0)|0;if(!(Eu(e,g)|0)){c[k>>2]=0;g=c[v+24+(l<<2)>>2]|0}else{m=Eu(e,g+1|0)|0;i=g+2+m|0;g=Eu(e,i)|0;if(g){h=(c[h>>2]|0)+20|0;if(!(Eu(e,h)|0))i=h;else while(1){g=g<<1;if((g|0)==32768){r=26;break a}h=h+1|0;if(!(Eu(e,h)|0)){i=h;break}}}else g=0;do if((g|0)>=(1<<(d[e+232+j>>0]|0)>>1|0)){h=m<<2;if((g|0)>(1<<(d[e+248+j>>0]|0)>>1|0)){h=h+12|0;break}else{h=h+4|0;break}}else h=0;while(0);c[k>>2]=h;i=i+14|0;h=g>>1;if(h)do{k=(Eu(e,i)|0)==0;g=(k?0:h)|g;h=h>>1}while((h|0)!=0);l=v+24+(l<<2)|0;g=(c[l>>2]|0)+((m|0)==0?g+1|0:~g)|0;c[l>>2]=g}b[t>>1]=g;b:do if(c[r>>2]|0){m=c[n+24>>2]|0;l=v+124+(m<<2)|0;m=e+264+m|0;g=0;while(1){h=(c[l>>2]|0)+(g*3|0)|0;if(Eu(e,h)|0)break b;j=g+1|0;if(!(Eu(e,h+1|0)|0)){i=h;g=j;while(1){if((g|0)>=(c[r>>2]|0)){r=42;break a}h=i+3|0;j=g+1|0;if(!(Eu(e,i+4|0)|0)){i=h;g=j}else break}}k=Eu(e,s)|0;h=h+2|0;i=Eu(e,h)|0;if(i){if(Eu(e,h)|0){i=i<<1;h=(c[l>>2]|0)+((g|0)<(d[m>>0]|0|0)?189:217)|0;if(!(Eu(e,h)|0))g=i;else{g=i;do{g=g<<1;if((g|0)==32768){r=49;break a}h=h+1|0}while((Eu(e,h)|0)!=0)}}else g=i;i=h+14|0;h=g>>1;if(h)do{n=(Eu(e,i)|0)==0;g=(n?0:h)|g;h=h>>1}while((h|0)!=0)}else g=0;b[t+(c[p+(j<<2)>>2]<<1)>>1]=(k|0)==0?g+1|0:g^65535;if((j|0)<(c[r>>2]|0))g=j;else break}}while(0);o=o+1|0;if((o|0)>=(c[q>>2]|0)){r=56;break}}if((r|0)==26){v=c[e>>2]|0;c[v+20>>2]=117;Sb[c[v+4>>2]&63](e,-1);c[u>>2]=-1;return 1}else if((r|0)==42){v=c[e>>2]|0;c[v+20>>2]=117;Sb[c[v+4>>2]&63](e,-1);c[u>>2]=-1;return 1}else if((r|0)==49){v=c[e>>2]|0;c[v+20>>2]=117;Sb[c[v+4>>2]&63](e,-1);c[u>>2]=-1;return 1}else if((r|0)==56)return 1;return 0}function Eu(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;g=c[b+468>>2]|0;m=g+16|0;f=c[m>>2]|0;k=g+20|0;if((f|0)<32768){h=b+440|0;j=b+24|0;i=g+12|0;f=c[k>>2]|0;while(1){g=f+-1|0;c[k>>2]=g;if((f|0)<1){if(!(c[h>>2]|0)){f=c[j>>2]|0;g=f+4|0;if((c[g>>2]|0)==0?(Eb[c[f+12>>2]&127](b)|0)==0:0){l=c[b>>2]|0;c[l+20>>2]=25;Qb[c[l>>2]&255](b)}c[g>>2]=(c[g>>2]|0)+-1;l=c[f>>2]|0;c[f>>2]=l+1;l=a[l>>0]|0;f=l&255;a:do if(l<<24>>24==-1){b:while(1){f=c[j>>2]|0;g=f+4|0;if((c[g>>2]|0)==0?(Eb[c[f+12>>2]&127](b)|0)==0:0){l=c[b>>2]|0;c[l+20>>2]=25;Qb[c[l>>2]&255](b)}c[g>>2]=(c[g>>2]|0)+-1;l=c[f>>2]|0;c[f>>2]=l+1;f=a[l>>0]|0;switch(f<<24>>24){case 0:{f=255;break a}case -1:break;default:break b}}c[h>>2]=f&255;f=0}while(0);g=c[k>>2]|0}else f=0;c[i>>2]=c[i>>2]<<8|f;f=g+8|0;c[k>>2]=f;if((g|0)<-8){f=g+9|0;c[k>>2]=f;if(!f){c[m>>2]=32768;g=0}else g=f}else g=f}f=c[m>>2]<<1;c[m>>2]=f;if((f|0)<32768)f=g;else break}}else{i=g+12|0;g=c[k>>2]|0}j=d[e>>0]|0;b=c[3872+((j&127)<<2)>>2]|0;k=b>>8;l=b>>16;h=f-l|0;c[m>>2]=h;f=h<>2]|0;if((g|0)>=(f|0)){c[i>>2]=g-f;c[m>>2]=l;f=j&128;if((h|0)<(l|0)){a[e>>0]=f^k;e=j;e=e>>7;return e|0}else{a[e>>0]=f^b;e=j^128;e=e>>7;return e|0}}if((h|0)>=32768){e=j;e=e>>7;return e|0}f=j&128;if((h|0)<(l|0)){a[e>>0]=f^b;e=j^128;e=e>>7;return e|0}else{a[e>>0]=f^k;e=j;e=e>>7;return e|0}return 0}function Fu(a){a=a|0;var d=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.0,u=0;n=c[a+472>>2]|0;o=a+36|0;if((c[o>>2]|0)<=0)return;r=a+72|0;l=0;m=c[a+216>>2]|0;i=0;j=0;while(1){d=c[m+36>>2]|0;h=m+40|0;a:do switch((d<<8)+(c[h>>2]|0)|0){case 257:{d=0;k=13;break}case 514:{d=0;k=14;break}case 771:{d=0;k=15;break}case 1028:{d=0;k=16;break}case 1285:{d=0;k=17;break}case 1542:{d=0;k=18;break}case 1799:{d=0;k=19;break}case 2313:{d=0;k=20;break}case 2570:{d=0;k=21;break}case 2827:{d=0;k=22;break}case 3084:{d=0;k=23;break}case 3341:{d=0;k=24;break}case 3598:{d=0;k=25;break}case 3855:{d=0;k=26;break}case 4112:{d=0;k=27;break}case 4104:{d=0;k=28;break}case 3591:{d=0;k=29;break}case 3078:{d=0;k=30;break}case 2565:{d=0;k=31;break}case 2052:{d=0;k=32;break}case 1539:{d=0;k=33;break}case 1026:{d=0;k=34;break}case 513:{d=0;k=35;break}case 2064:{d=0;k=36;break}case 1806:{d=0;k=37;break}case 1548:{d=0;k=38;break}case 1290:{d=0;k=39;break}case 1032:{d=0;k=40;break}case 774:{d=0;k=41;break}case 516:{d=0;k=42;break}case 258:{d=0;k=43;break}case 2056:{d=c[r>>2]|0;switch(d|0){case 0:{k=44;break a}case 1:{k=45;break a}case 2:{k=46;break a}default:{d=c[a>>2]|0;c[d+20>>2]=49;Qb[c[d>>2]&255](a);d=i;k=j;break a}}}default:{k=c[a>>2]|0;c[k+20>>2]=7;c[k+24>>2]=d;c[(c[a>>2]|0)+28>>2]=c[h>>2];Qb[c[c[a>>2]>>2]&255](a);d=i;k=j}}while(0);c[n+4+(l<<2)>>2]=k;b:do if((c[m+52>>2]|0?(p=n+44+(l<<2)|0,(c[p>>2]|0)!=(d|0)):0)?(q=c[m+80>>2]|0,q|0):0){c[p>>2]=d;switch(d|0){case 0:{i=c[m+84>>2]|0;h=0;do{c[i+(h<<2)>>2]=e[q+(h<<1)>>1];h=h+1|0}while((h|0)!=64);break}case 1:{i=c[m+84>>2]|0;h=0;do{c[i+(h<<2)>>2]=(B(b[5248+(h<<1)>>1]|0,e[q+(h<<1)>>1]|0)|0)+2048>>12;h=h+1|0}while((h|0)!=64);break}case 2:{j=c[m+84>>2]|0;h=0;i=0;while(1){t=+g[5376+(h<<3)>>3];f[j+(i<<2)>>2]=t*+(e[q+(i<<1)>>1]|0)*.125;s=i|1;f[j+(s<<2)>>2]=t*+(e[q+(s<<1)>>1]|0)*1.387039845*.125;s=s+1|0;f[j+(s<<2)>>2]=t*+(e[q+(s<<1)>>1]|0)*1.306562965*.125;s=i|3;f[j+(s<<2)>>2]=t*+(e[q+(s<<1)>>1]|0)*1.175875602*.125;u=s+1|0;f[j+(u<<2)>>2]=t*+(e[q+(u<<1)>>1]|0)*.125;u=s+2|0;f[j+(u<<2)>>2]=t*+(e[q+(u<<1)>>1]|0)*.785694958*.125;s=s+3|0;f[j+(s<<2)>>2]=t*+(e[q+(s<<1)>>1]|0)*.5411961*.125;s=i|7;f[j+(s<<2)>>2]=t*+(e[q+(s<<1)>>1]|0)*.275899379*.125;h=h+1|0;if((h|0)==8)break;else i=i+8|0}break}default:{u=c[a>>2]|0;c[u+20>>2]=49;Qb[c[u>>2]&255](a);break b}}}while(0);l=l+1|0;if((l|0)>=(c[o>>2]|0))break;else{m=m+88|0;i=d;j=k}}return}function Gu(d,e,g,h,i){d=d|0;e=e|0;g=g|0;h=h|0;i=i|0;var j=0,k=0.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.0,x=0.0,y=0.0,z=0.0;q=yb;yb=yb+256|0;j=q;o=c[d+336>>2]|0;n=j;m=c[e+84>>2]|0;l=8;while(1){e=b[g+16>>1]|0;d=b[g+32>>1]|0;if(!((e|d)<<16>>16))if(((((b[g+48>>1]|0)==0?(b[g+64>>1]|0)==0:0)?(b[g+80>>1]|0)==0:0)?(b[g+96>>1]|0)==0:0)?(b[g+112>>1]|0)==0:0){k=+f[m>>2]*+(b[g>>1]|0);f[n>>2]=k;f[n+32>>2]=k;f[n+64>>2]=k;f[n+96>>2]=k;f[n+128>>2]=k;f[n+160>>2]=k;f[n+192>>2]=k;d=56}else{d=0;p=9}else p=9;if((p|0)==9){p=0;r=+f[m>>2]*+(b[g>>1]|0);x=+f[m+64>>2]*+(d<<16>>16);w=+f[m+128>>2]*+(b[g+64>>1]|0);t=+f[m+192>>2]*+(b[g+96>>1]|0);v=r+w;w=r-w;r=x+t;t=(x-t)*1.4142135381698608-r;x=v+r;r=v-r;v=w+t;t=w-t;w=+f[m+32>>2]*+(e<<16>>16);u=+f[m+96>>2]*+(b[g+48>>1]|0);z=+f[m+160>>2]*+(b[g+80>>1]|0);k=+f[m+224>>2]*+(b[g+112>>1]|0);s=u+z;u=z-u;z=w+k;k=w-k;w=s+z;y=(u+k)*1.8477590084075928;u=y-u*2.613126039505005-w;s=(z-s)*1.4142135381698608-u;k=y-k*1.0823922157287598-s;f[n>>2]=x+w;f[n+224>>2]=x-w;f[n+32>>2]=v+u;f[n+192>>2]=v-u;f[n+64>>2]=t+s;f[n+160>>2]=t-s;f[n+96>>2]=r+k;k=r-k;d=32}f[n+(d<<2)>>2]=k;if(l>>>0>1){n=n+4|0;m=m+4|0;g=g+2|0;l=l+-1|0}else break}e=o+-384|0;d=0;while(1){p=(c[h+(d<<2)>>2]|0)+i|0;s=+f[j>>2]+512.5;t=+f[j+16>>2];u=s+t;t=s-t;s=+f[j+8>>2];w=+f[j+24>>2];y=s+w;w=(s-w)*1.4142135381698608-y;s=u+y;y=u-y;u=t+w;w=t-w;t=+f[j+20>>2];v=+f[j+12>>2];x=t+v;v=t-v;t=+f[j+4>>2];z=+f[j+28>>2];k=t+z;z=t-z;t=x+k;r=(v+z)*1.8477590084075928;v=r-v*2.613126039505005-t;x=(k-x)*1.4142135381698608-v;z=r-z*1.0823922157287598-x;a[p>>0]=a[e+(~~(s+t)&1023)>>0]|0;a[p+7>>0]=a[e+(~~(s-t)&1023)>>0]|0;a[p+1>>0]=a[e+(~~(u+v)&1023)>>0]|0;a[p+6>>0]=a[e+(~~(u-v)&1023)>>0]|0;a[p+2>>0]=a[e+(~~(w+x)&1023)>>0]|0;a[p+5>>0]=a[e+(~~(w-x)&1023)>>0]|0;a[p+3>>0]=a[e+(~~(y+z)&1023)>>0]|0;a[p+4>>0]=a[e+(~~(y-z)&1023)>>0]|0;d=d+1|0;if((d|0)==8)break;else j=j+32|0}yb=q;return}function Hu(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;o=yb;yb=yb+256|0;m=o;l=c[d+336>>2]|0;k=m;j=c[e+84>>2]|0;i=8;while(1){e=b[f+16>>1]|0;d=b[f+32>>1]|0;if(!((e|d)<<16>>16))if(((((b[f+48>>1]|0)==0?(b[f+64>>1]|0)==0:0)?(b[f+80>>1]|0)==0:0)?(b[f+96>>1]|0)==0:0)?(b[f+112>>1]|0)==0:0){d=B(c[j>>2]|0,b[f>>1]|0)|0;c[k>>2]=d;c[k+32>>2]=d;c[k+64>>2]=d;c[k+96>>2]=d;c[k+128>>2]=d;c[k+160>>2]=d;c[k+192>>2]=d;e=56}else{d=0;n=9}else n=9;if((n|0)==9){n=0;p=B(c[j>>2]|0,b[f>>1]|0)|0;u=B(c[j+64>>2]|0,d<<16>>16)|0;t=B(c[j+128>>2]|0,b[f+64>>1]|0)|0;q=B(c[j+192>>2]|0,b[f+96>>1]|0)|0;s=t+p|0;t=p-t|0;p=q+u|0;q=((u-q|0)*362>>8)-p|0;u=p+s|0;p=s-p|0;s=q+t|0;q=t-q|0;t=B(c[j+32>>2]|0,e<<16>>16)|0;r=B(c[j+96>>2]|0,b[f+48>>1]|0)|0;w=B(c[j+160>>2]|0,b[f+80>>1]|0)|0;d=B(c[j+224>>2]|0,b[f+112>>1]|0)|0;e=w+r|0;r=w-r|0;w=d+t|0;d=t-d|0;t=w+e|0;v=(d+r|0)*473>>8;r=v-(r*669>>8)-t|0;e=((w-e|0)*362>>8)-r|0;d=v-(d*277>>8)-e|0;c[k>>2]=t+u;c[k+224>>2]=u-t;c[k+32>>2]=r+s;c[k+192>>2]=s-r;c[k+64>>2]=e+q;c[k+160>>2]=q-e;c[k+96>>2]=d+p;d=p-d|0;e=32}c[k+(e<<2)>>2]=d;if(i>>>0>1){k=k+4|0;j=j+4|0;f=f+2|0;i=i+-1|0}else break}l=l+-384|0;k=0;e=m;while(1){f=(c[g+(k<<2)>>2]|0)+h|0;i=(c[e>>2]|0)+16400|0;j=c[e+4>>2]|0;d=c[e+8>>2]|0;if(!(j|d))if(((((c[e+12>>2]|0)==0?(c[e+16>>2]|0)==0:0)?(c[e+20>>2]|0)==0:0)?(c[e+24>>2]|0)==0:0)?(c[e+28>>2]|0)==0:0){w=a[l+(i>>>5&1023)>>0]|0;a[f>>0]=w;_O(f+1|0,w|0,7)|0}else{d=0;n=19}else n=19;if((n|0)==19){n=0;w=c[e+16>>2]|0;r=w+i|0;w=i-w|0;t=c[e+24>>2]|0;v=t+d|0;t=((d-t|0)*362>>8)-v|0;p=v+r|0;v=r-v|0;r=t+w|0;t=w-t|0;w=c[e+20>>2]|0;s=c[e+12>>2]|0;u=s+w|0;s=w-s|0;w=c[e+28>>2]|0;i=w+j|0;w=j-w|0;q=i+u|0;m=(w+s|0)*473>>8;s=m-(s*669>>8)-q|0;u=((i-u|0)*362>>8)-s|0;w=m-(w*277>>8)-u|0;a[f>>0]=a[l+((q+p|0)>>>5&1023)>>0]|0;a[f+7>>0]=a[l+((p-q|0)>>>5&1023)>>0]|0;a[f+1>>0]=a[l+((s+r|0)>>>5&1023)>>0]|0;a[f+6>>0]=a[l+((r-s|0)>>>5&1023)>>0]|0;a[f+2>>0]=a[l+((u+t|0)>>>5&1023)>>0]|0;a[f+5>>0]=a[l+((t-u|0)>>>5&1023)>>0]|0;a[f+3>>0]=a[l+((w+v|0)>>>5&1023)>>0]|0;a[f+4>>0]=a[l+((v-w|0)>>>5&1023)>>0]|0}k=k+1|0;if((k|0)==8)break;else e=e+32|0}yb=o;return}function Iu(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0;d=(c[d+336>>2]|0)+-384|0;i=c[e+84>>2]|0;e=(B(c[i>>2]|0,b[f>>1]|0)|0)+4100|0;f=B(c[i+32>>2]|0,b[f+16>>1]|0)|0;a[(c[g>>2]|0)+h>>0]=a[d+((f+e|0)>>>3&1023)>>0]|0;a[(c[g+4>>2]|0)+h>>0]=a[d+((e-f|0)>>>3&1023)>>0]|0;return}function Ju(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;i=yb;yb=yb+32|0;j=i;d=c[d+336>>2]|0;k=c[e+84>>2]|0;n=B(c[k>>2]|0,b[f>>1]|0)|0;q=B(c[k+64>>2]|0,b[f+32>>1]|0)|0;e=q+n<<13;q=n-q<<13;n=B(c[k+32>>2]|0,b[f+16>>1]|0)|0;l=B(c[k+96>>2]|0,b[f+48>>1]|0)|0;p=(l+n|0)*4433|0;n=p+(n*6270|0)|0;l=p+(B(l,-15137)|0)|0;p=n+e|0;c[j>>2]=p;c[j+24>>2]=e-n;n=l+q|0;c[j+8>>2]=n;l=q-l|0;c[j+16>>2]=l;q=B(c[k+4>>2]|0,b[f+2>>1]|0)|0;e=B(c[k+68>>2]|0,b[f+34>>1]|0)|0;m=e+q<<13;e=q-e<<13;q=B(c[k+36>>2]|0,b[f+18>>1]|0)|0;k=B(c[k+100>>2]|0,b[f+50>>1]|0)|0;o=(k+q|0)*4433|0;f=o+(q*6270|0)|0;k=o+(B(k,-15137)|0)|0;o=f+m|0;c[j+4>>2]=o;f=m-f|0;c[j+28>>2]=f;m=k+e|0;c[j+12>>2]=m;k=e-k|0;c[j+20>>2]=k;e=d+-384|0;d=(c[g>>2]|0)+h|0;p=p+33587200|0;a[d>>0]=a[e+((p+o|0)>>>16&1023)>>0]|0;a[d+1>>0]=a[e+((p-o|0)>>>16&1023)>>0]|0;d=(c[g+4>>2]|0)+h|0;n=n+33587200|0;a[d>>0]=a[e+((n+m|0)>>>16&1023)>>0]|0;a[d+1>>0]=a[e+((n-m|0)>>>16&1023)>>0]|0;d=(c[g+8>>2]|0)+h|0;l=l+33587200|0;a[d>>0]=a[e+((l+k|0)>>>16&1023)>>0]|0;a[d+1>>0]=a[e+((l-k|0)>>>16&1023)>>0]|0;h=(c[g+12>>2]|0)+h|0;g=(c[j+24>>2]|0)+33587200|0;a[h>>0]=a[e+((g+f|0)>>>16&1023)>>0]|0;a[h+1>>0]=a[e+((g-f|0)>>>16&1023)>>0]|0;yb=i;return}function Ku(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;i=yb;yb=yb+80|0;j=i;m=c[d+336>>2]|0;k=c[e+84>>2]|0;t=B(b[f>>1]<<13,c[k>>2]|0)|0|1024;q=B((b[f+64>>1]|0)*5793|0,c[k+128>>2]|0)|0;r=q+t|0;t=(B(q,-2)|0)+t>>11;q=B((b[f+32>>1]|0)*10033|0,c[k+64>>2]|0)|0;l=q+r|0;q=r-q|0;r=B(c[k+32>>2]|0,b[f+16>>1]|0)|0;s=B(c[k+96>>2]|0,b[f+48>>1]|0)|0;e=B(c[k+160>>2]|0,b[f+80>>1]|0)|0;n=(e+r|0)*2998|0;d=n+(s+r<<13)|0;n=n+(e-s<<13)|0;e=r-s-e<<2;c[j>>2]=d+l>>11;c[j+60>>2]=l-d>>11;d=j+12|0;c[d>>2]=e+t;c[j+48>>2]=t-e;c[j+24>>2]=n+q>>11;c[j+36>>2]=q-n>>11;n=j+4|0;q=B(b[f+2>>1]<<13,c[k+4>>2]|0)|0|1024;e=B((b[f+66>>1]|0)*5793|0,c[k+132>>2]|0)|0;t=e+q|0;q=(B(e,-2)|0)+q>>11;e=B((b[f+34>>1]|0)*10033|0,c[k+68>>2]|0)|0;l=e+t|0;e=t-e|0;t=B(c[k+36>>2]|0,b[f+18>>1]|0)|0;s=B(c[k+100>>2]|0,b[f+50>>1]|0)|0;r=B(c[k+164>>2]|0,b[f+82>>1]|0)|0;o=(r+t|0)*2998|0;p=o+(s+t<<13)|0;o=o+(r-s<<13)|0;r=t-s-r<<2;c[n>>2]=p+l>>11;c[j+64>>2]=l-p>>11;c[j+16>>2]=r+q;c[j+52>>2]=q-r;c[j+28>>2]=o+e>>11;c[j+40>>2]=e-o>>11;o=B(b[f+4>>1]<<13,c[k+8>>2]|0)|0|1024;e=B((b[f+68>>1]|0)*5793|0,c[k+136>>2]|0)|0;r=e+o|0;o=(B(e,-2)|0)+o>>11;e=B((b[f+36>>1]|0)*10033|0,c[k+72>>2]|0)|0;q=e+r|0;e=r-e|0;r=B(c[k+40>>2]|0,b[f+20>>1]|0)|0;p=B(c[k+104>>2]|0,b[f+52>>1]|0)|0;k=B(c[k+168>>2]|0,b[f+84>>1]|0)|0;f=(k+r|0)*2998|0;l=f+(p+r<<13)|0;f=f+(k-p<<13)|0;k=r-p-k<<2;p=l+q>>11;c[j+8>>2]=p;c[j+68>>2]=q-l>>11;l=k+o|0;c[j+20>>2]=l;c[j+56>>2]=o-k;k=f+e>>11;c[j+32>>2]=k;c[j+44>>2]=e-f>>11;f=m+-384|0;e=(c[g>>2]|0)+h|0;m=(c[j>>2]<<13)+134348800|0;o=m+(p*5793|0)|0;m=(B(p,-11586)|0)+m|0;n=(c[n>>2]|0)*10033|0;a[e>>0]=a[f+((o+n|0)>>>18&1023)>>0]|0;a[e+2>>0]=a[f+((o-n|0)>>>18&1023)>>0]|0;a[e+1>>0]=a[f+(m>>>18&1023)>>0]|0;e=(c[g+4>>2]|0)+h|0;d=(c[d>>2]<<13)+134348800|0;m=d+(l*5793|0)|0;d=(B(l,-11586)|0)+d|0;l=(c[j+16>>2]|0)*10033|0;a[e>>0]=a[f+((m+l|0)>>>18&1023)>>0]|0;a[e+2>>0]=a[f+((m-l|0)>>>18&1023)>>0]|0;a[e+1>>0]=a[f+(d>>>18&1023)>>0]|0;e=(c[g+8>>2]|0)+h|0;d=(c[j+24>>2]<<13)+134348800|0;l=d+(k*5793|0)|0;d=(B(k,-11586)|0)+d|0;k=(c[j+28>>2]|0)*10033|0;a[e>>0]=a[f+((l+k|0)>>>18&1023)>>0]|0;a[e+2>>0]=a[f+((l-k|0)>>>18&1023)>>0]|0;a[e+1>>0]=a[f+(d>>>18&1023)>>0]|0;e=(c[g+12>>2]|0)+h|0;d=(c[j+36>>2]<<13)+134348800|0;k=c[j+44>>2]|0;l=d+(k*5793|0)|0;d=(B(k,-11586)|0)+d|0;k=(c[j+40>>2]|0)*10033|0;a[e>>0]=a[f+((l+k|0)>>>18&1023)>>0]|0;a[e+2>>0]=a[f+((l-k|0)>>>18&1023)>>0]|0;a[e+1>>0]=a[f+(d>>>18&1023)>>0]|0;e=(c[g+16>>2]|0)+h|0;d=(c[j+48>>2]<<13)+134348800|0;k=c[j+56>>2]|0;l=d+(k*5793|0)|0;d=(B(k,-11586)|0)+d|0;k=(c[j+52>>2]|0)*10033|0;a[e>>0]=a[f+((l+k|0)>>>18&1023)>>0]|0;a[e+2>>0]=a[f+((l-k|0)>>>18&1023)>>0]|0;a[e+1>>0]=a[f+(d>>>18&1023)>>0]|0;h=(c[g+20>>2]|0)+h|0;g=(c[j+60>>2]<<13)+134348800|0;e=c[j+68>>2]|0;d=g+(e*5793|0)|0;g=(B(e,-11586)|0)+g|0;e=(c[j+64>>2]|0)*10033|0;a[h>>0]=a[f+((d+e|0)>>>18&1023)>>0]|0;a[h+2>>0]=a[f+((d-e|0)>>>18&1023)>>0]|0;a[h+1>>0]=a[f+(g>>>18&1023)>>0]|0;yb=i;return}function Lu(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;o=yb;yb=yb+128|0;m=o;l=c[d+336>>2]|0;k=m;j=c[e+84>>2]|0;i=4;while(1){e=b[f+16>>1]|0;d=b[f+32>>1]|0;if(!((e|d)<<16>>16))if(((((b[f+48>>1]|0)==0?(b[f+64>>1]|0)==0:0)?(b[f+80>>1]|0)==0:0)?(b[f+96>>1]|0)==0:0)?(b[f+112>>1]|0)==0:0){d=B(b[f>>1]<<2,c[j>>2]|0)|0;c[k>>2]=d;c[k+16>>2]=d;c[k+32>>2]=d;c[k+48>>2]=d;c[k+64>>2]=d;c[k+80>>2]=d;c[k+96>>2]=d;e=28}else{d=0;n=9}else n=9;if((n|0)==9){n=0;x=B(b[f+64>>1]<<13,c[j+128>>2]|0)|0;p=B(b[f>>1]<<13,c[j>>2]|0)|0|1024;s=x+p|0;x=p-x|0;p=B(c[j+64>>2]|0,d<<16>>16)|0;q=B(c[j+192>>2]|0,b[f+96>>1]|0)|0;u=(q+p|0)*4433|0;p=u+(p*6270|0)|0;q=u+(B(q,-15137)|0)|0;u=p+s|0;p=s-p|0;s=q+x|0;q=x-q|0;d=B(c[j+224>>2]|0,b[f+112>>1]|0)|0;x=B(c[j+160>>2]|0,b[f+80>>1]|0)|0;v=B(c[j+96>>2]|0,b[f+48>>1]|0)|0;t=B(c[j+32>>2]|0,e<<16>>16)|0;r=v+d|0;e=t+x|0;w=(e+r|0)*9633|0;r=w+(B(r,-16069)|0)|0;e=w+(B(e,-3196)|0)|0;w=B(t+d|0,-7373)|0;d=w+(d*2446|0)+r|0;t=w+(t*12299|0)+e|0;w=B(v+x|0,-20995)|0;e=w+(x*16819|0)+e|0;r=w+(v*25172|0)+r|0;c[k>>2]=t+u>>11;c[k+112>>2]=u-t>>11;c[k+16>>2]=r+s>>11;c[k+96>>2]=s-r>>11;c[k+32>>2]=e+q>>11;c[k+80>>2]=q-e>>11;c[k+48>>2]=d+p>>11;d=p-d>>11;e=16}c[k+(e<<2)>>2]=d;if(i>>>0>1){k=k+4|0;j=j+4|0;f=f+2|0;i=i+-1|0}else break}u=l+-384|0;x=(c[g>>2]|0)+h|0;s=(c[m>>2]|0)+16400|0;v=c[m+8>>2]|0;w=s+v<<13;v=s-v<<13;s=c[m+4>>2]|0;t=c[m+12>>2]|0;r=(t+s|0)*4433|0;s=r+(s*6270|0)|0;t=r+(B(t,-15137)|0)|0;a[x>>0]=a[u+((s+w|0)>>>18&1023)>>0]|0;a[x+3>>0]=a[u+((w-s|0)>>>18&1023)>>0]|0;a[x+1>>0]=a[u+((t+v|0)>>>18&1023)>>0]|0;a[x+2>>0]=a[u+((v-t|0)>>>18&1023)>>0]|0;x=(c[g+4>>2]|0)+h|0;t=(c[m+16>>2]|0)+16400|0;v=c[m+24>>2]|0;s=t+v<<13;v=t-v<<13;t=c[m+20>>2]|0;w=c[m+28>>2]|0;r=(w+t|0)*4433|0;t=r+(t*6270|0)|0;w=r+(B(w,-15137)|0)|0;a[x>>0]=a[u+((t+s|0)>>>18&1023)>>0]|0;a[x+3>>0]=a[u+((s-t|0)>>>18&1023)>>0]|0;a[x+1>>0]=a[u+((w+v|0)>>>18&1023)>>0]|0;a[x+2>>0]=a[u+((v-w|0)>>>18&1023)>>0]|0;x=(c[g+8>>2]|0)+h|0;w=(c[m+32>>2]|0)+16400|0;v=c[m+40>>2]|0;t=w+v<<13;v=w-v<<13;w=c[m+36>>2]|0;s=c[m+44>>2]|0;r=(s+w|0)*4433|0;w=r+(w*6270|0)|0;s=r+(B(s,-15137)|0)|0;a[x>>0]=a[u+((w+t|0)>>>18&1023)>>0]|0;a[x+3>>0]=a[u+((t-w|0)>>>18&1023)>>0]|0;a[x+1>>0]=a[u+((s+v|0)>>>18&1023)>>0]|0;a[x+2>>0]=a[u+((v-s|0)>>>18&1023)>>0]|0;x=(c[g+12>>2]|0)+h|0;s=(c[m+48>>2]|0)+16400|0;v=c[m+56>>2]|0;w=s+v<<13;v=s-v<<13;s=c[m+52>>2]|0;t=c[m+60>>2]|0;r=(t+s|0)*4433|0;s=r+(s*6270|0)|0;t=r+(B(t,-15137)|0)|0;a[x>>0]=a[u+((s+w|0)>>>18&1023)>>0]|0;a[x+3>>0]=a[u+((w-s|0)>>>18&1023)>>0]|0;a[x+1>>0]=a[u+((t+v|0)>>>18&1023)>>0]|0;a[x+2>>0]=a[u+((v-t|0)>>>18&1023)>>0]|0;x=(c[g+16>>2]|0)+h|0;t=(c[m+64>>2]|0)+16400|0;v=c[m+72>>2]|0;s=t+v<<13;v=t-v<<13;t=c[m+68>>2]|0;w=c[m+76>>2]|0;r=(w+t|0)*4433|0;t=r+(t*6270|0)|0;w=r+(B(w,-15137)|0)|0;a[x>>0]=a[u+((t+s|0)>>>18&1023)>>0]|0;a[x+3>>0]=a[u+((s-t|0)>>>18&1023)>>0]|0;a[x+1>>0]=a[u+((w+v|0)>>>18&1023)>>0]|0;a[x+2>>0]=a[u+((v-w|0)>>>18&1023)>>0]|0;x=(c[g+20>>2]|0)+h|0;w=(c[m+80>>2]|0)+16400|0;v=c[m+88>>2]|0;t=w+v<<13;v=w-v<<13;w=c[m+84>>2]|0;s=c[m+92>>2]|0;r=(s+w|0)*4433|0;w=r+(w*6270|0)|0;s=r+(B(s,-15137)|0)|0;a[x>>0]=a[u+((w+t|0)>>>18&1023)>>0]|0;a[x+3>>0]=a[u+((t-w|0)>>>18&1023)>>0]|0;a[x+1>>0]=a[u+((s+v|0)>>>18&1023)>>0]|0;a[x+2>>0]=a[u+((v-s|0)>>>18&1023)>>0]|0;x=(c[g+24>>2]|0)+h|0;s=(c[m+96>>2]|0)+16400|0;v=c[m+104>>2]|0;w=s+v<<13;v=s-v<<13;s=c[m+100>>2]|0;t=c[m+108>>2]|0;r=(t+s|0)*4433|0;s=r+(s*6270|0)|0;t=r+(B(t,-15137)|0)|0;a[x>>0]=a[u+((s+w|0)>>>18&1023)>>0]|0;a[x+3>>0]=a[u+((w-s|0)>>>18&1023)>>0]|0;a[x+1>>0]=a[u+((t+v|0)>>>18&1023)>>0]|0;a[x+2>>0]=a[u+((v-t|0)>>>18&1023)>>0]|0;x=(c[g+28>>2]|0)+h|0;t=(c[m+112>>2]|0)+16400|0;v=c[m+120>>2]|0;s=t+v<<13;v=t-v<<13;t=c[m+116>>2]|0;w=c[m+124>>2]|0;r=(w+t|0)*4433|0;t=r+(t*6270|0)|0;w=r+(B(w,-15137)|0)|0;a[x>>0]=a[u+((t+s|0)>>>18&1023)>>0]|0;a[x+3>>0]=a[u+((s-t|0)>>>18&1023)>>0]|0;a[x+1>>0]=a[u+((w+v|0)>>>18&1023)>>0]|0;a[x+2>>0]=a[u+((v-w|0)>>>18&1023)>>0]|0;yb=o;return}function Mu(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;m=yb;yb=yb+208|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){r=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;n=B(c[j+128>>2]|0,b[d+64>>1]|0)|0;t=(n*9373|0)+r|0;w=(B(n,-3580)|0)+r|0;r=(B(n,-11586)|0)+r>>11;n=B(c[j+64>>2]|0,b[d+32>>1]|0)|0;p=B(c[j+192>>2]|0,b[d+96>>1]|0)|0;v=(p+n|0)*6810|0;n=v+(n*4209|0)|0;p=v+(B(p,-17828)|0)|0;v=n+t|0;n=t-n|0;t=p+w|0;p=w-p|0;w=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;x=B(c[j+96>>2]|0,b[d+48>>1]|0)|0;s=B(c[j+160>>2]|0,b[d+80>>1]|0)|0;q=B(c[j+224>>2]|0,b[d+112>>1]|0)|0;o=q+x|0;q=x-q|0;x=q*2531|0;y=s<<13;z=o*7791|0;f=x+y|0;u=z+(w*11443|0)+f|0;f=(w*1812|0)-z+f|0;o=o*4815|0;x=y-x-(q<<12)|0;q=w-s-q<<2;s=(w*10323|0)-o-x|0;o=x+((w*5260|0)-o)|0;c[k>>2]=u+v>>11;c[k+180>>2]=v-u>>11;c[k+20>>2]=s+t>>11;c[k+160>>2]=t-s>>11;c[k+40>>2]=q+r;c[k+140>>2]=r-q;c[k+60>>2]=o+p>>11;c[k+120>>2]=p-o>>11;c[k+80>>2]=f+n>>11;c[k+100>>2]=n-f>>11;e=e+1|0;if((e|0)==5)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){z=(c[g+(d<<2)>>2]|0)+h|0;y=(c[i>>2]<<13)+134348800|0;x=c[i+8>>2]|0;v=c[i+16>>2]|0;w=(v+x|0)*6476|0;v=x-v|0;x=(v*2896|0)+y|0;u=x+w|0;w=x-w|0;y=(B(v,-11584)|0)+y|0;v=c[i+4>>2]|0;x=c[i+12>>2]|0;t=(x+v|0)*6810|0;v=t+(v*4209|0)|0;x=t+(B(x,-17828)|0)|0;a[z>>0]=a[e+((v+u|0)>>>18&1023)>>0]|0;a[z+4>>0]=a[e+((u-v|0)>>>18&1023)>>0]|0;a[z+1>>0]=a[e+((x+w|0)>>>18&1023)>>0]|0;a[z+3>>0]=a[e+((w-x|0)>>>18&1023)>>0]|0;a[z+2>>0]=a[e+(y>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==10)break;else i=i+20|0}yb=m;return}function Nu(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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,C=0;m=yb;yb=yb+288|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){n=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;z=B((b[d+64>>1]|0)*10033|0,c[j+128>>2]|0)|0;y=z+n|0;z=n-z|0;t=B(c[j+64>>2]|0,b[d+32>>1]|0)|0;r=B(b[d+96>>1]<<13,c[j+192>>2]|0)|0;p=(t<<13)-r|0;v=p+n|0;p=n-p|0;n=r+(t*11190|0)|0;x=n+y|0;n=y-n|0;r=(t*2998|0)-r|0;t=r+z|0;r=z-r|0;z=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;y=B(c[j+96>>2]|0,b[d+48>>1]|0)|0;o=B(c[j+160>>2]|0,b[d+80>>1]|0)|0;u=B(c[j+224>>2]|0,b[d+112>>1]|0)|0;C=y*10703|0;A=B(y,-4433)|0;s=o+z|0;f=(u+s|0)*7053|0;s=f+(s*2139|0)|0;w=C+(z*2295|0)+s|0;q=B(u+o|0,-8565)|0;s=(B(o,-12112)|0)+A+q+s|0;q=(u*12998|0)-C+f+q|0;f=A+(B(z,-5540)|0)+(B(u,-16244)|0)+f|0;u=z-u|0;o=y-o|0;y=(u+o|0)*4433|0;u=y+(u*6270|0)|0;o=y+(B(o,-15137)|0)|0;c[k>>2]=w+x>>11;c[k+264>>2]=x-w>>11;c[k+24>>2]=u+v>>11;c[k+240>>2]=v-u>>11;c[k+48>>2]=s+t>>11;c[k+216>>2]=t-s>>11;c[k+72>>2]=q+r>>11;c[k+192>>2]=r-q>>11;c[k+96>>2]=o+p>>11;c[k+168>>2]=p-o>>11;c[k+120>>2]=f+n>>11;c[k+144>>2]=n-f>>11;e=e+1|0;if((e|0)==6)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){C=(c[g+(d<<2)>>2]|0)+h|0;z=(c[i>>2]<<13)+134348800|0;x=(c[i+16>>2]|0)*5793|0;t=z+x|0;x=z-x-x|0;z=(c[i+8>>2]|0)*10033|0;v=t+z|0;z=t-z|0;t=c[i+4>>2]|0;u=c[i+12>>2]|0;y=c[i+20>>2]|0;A=(y+t|0)*2998|0;w=A+(u+t<<13)|0;A=A+(y-u<<13)|0;y=t-u-y<<13;a[C>>0]=a[e+((w+v|0)>>>18&1023)>>0]|0;a[C+5>>0]=a[e+((v-w|0)>>>18&1023)>>0]|0;a[C+1>>0]=a[e+((y+x|0)>>>18&1023)>>0]|0;a[C+4>>0]=a[e+((x-y|0)>>>18&1023)>>0]|0;a[C+2>>0]=a[e+((A+z|0)>>>18&1023)>>0]|0;a[C+3>>0]=a[e+((z-A|0)>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==12)break;else i=i+24|0}yb=m;return}function Ou(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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,C=0,D=0,E=0,F=0;m=yb;yb=yb+400|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){t=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;r=B(c[j+128>>2]|0,b[d+64>>1]|0)|0;x=(r*10438|0)+t|0;v=(r*2578|0)+t|0;f=(B(r,-7223)|0)+t|0;t=(B(r,-11586)|0)+t>>11;r=B(c[j+64>>2]|0,b[d+32>>1]|0)|0;z=B(c[j+192>>2]|0,b[d+96>>1]|0)|0;p=(z+r|0)*9058|0;n=p+(r*2237|0)|0;p=p+(B(z,-14084)|0)|0;r=(B(z,-11295)|0)+(r*5027|0)|0;z=n+x|0;n=x-n|0;x=p+v|0;p=v-p|0;v=r+f|0;r=f-r|0;f=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;D=B(c[j+96>>2]|0,b[d+48>>1]|0)|0;A=B(c[j+160>>2]|0,b[d+80>>1]|0)|0;s=B(c[j+224>>2]|0,b[d+112>>1]|0)|0;q=s<<13;F=A+f|0;w=(D+f|0)*10935|0;E=F*9810|0;y=w+(B(f,-9232)|0)+E+q|0;F=F*6164|0;C=f-D|0;o=(C*3826|0)-q|0;f=F+(B(f,-8693)|0)+o|0;u=(B(A+D|0,-1297)|0)-q|0;w=w+(B(D,-3474)|0)+u|0;u=E+(B(A,-19447)|0)+u|0;E=(A-D|0)*11512|0;q=E+(B(A,-13850)|0)+F+q|0;o=E+(D*5529|0)+o|0;s=C-A+s<<2;c[k>>2]=y+z>>11;c[k+364>>2]=z-y>>11;c[k+28>>2]=w+x>>11;c[k+336>>2]=x-w>>11;c[k+56>>2]=u+v>>11;c[k+308>>2]=v-u>>11;c[k+84>>2]=s+t;c[k+280>>2]=t-s;c[k+112>>2]=q+r>>11;c[k+252>>2]=r-q>>11;c[k+140>>2]=o+p>>11;c[k+224>>2]=p-o>>11;c[k+168>>2]=f+n>>11;c[k+196>>2]=n-f>>11;e=e+1|0;if((e|0)==7)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){F=(c[g+(d<<2)>>2]|0)+h|0;E=(c[i>>2]<<13)+134348800|0;t=c[i+8>>2]|0;C=c[i+16>>2]|0;v=c[i+24>>2]|0;u=(C-v|0)*7223|0;A=(t-C|0)*2578|0;x=(B(C,-15083)|0)+E+A+u|0;D=v+t|0;z=(D*10438|0)+E|0;v=u+(B(v,-637)|0)+z|0;z=A+(B(t,-20239)|0)+z|0;t=c[i+4>>2]|0;A=c[i+12>>2]|0;u=c[i+20>>2]|0;s=(A+t|0)*7663|0;w=(t-A|0)*1395|0;A=B(u+A|0,-11295)|0;y=s+w+A|0;t=(u+t|0)*5027|0;w=s-w+t|0;A=t+(u*15326|0)+A|0;a[F>>0]=a[e+((w+v|0)>>>18&1023)>>0]|0;a[F+6>>0]=a[e+((v-w|0)>>>18&1023)>>0]|0;a[F+1>>0]=a[e+((y+x|0)>>>18&1023)>>0]|0;a[F+5>>0]=a[e+((x-y|0)>>>18&1023)>>0]|0;a[F+2>>0]=a[e+((A+z|0)>>>18&1023)>>0]|0;a[F+4>>0]=a[e+((z-A|0)>>>18&1023)>>0]|0;a[F+3>>0]=a[e+((((C-D|0)*11585|0)+E|0)>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==14)break;else i=i+28|0}yb=m;return}function Pu(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;m=yb;yb=yb+512|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){r=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;v=B(c[j+128>>2]|0,b[d+64>>1]|0)|0;f=v*10703|0;v=v*4433|0;z=f+r|0;f=r-f|0;x=v+r|0;v=r-v|0;r=B(c[j+64>>2]|0,b[d+32>>1]|0)|0;t=B(c[j+192>>2]|0,b[d+96>>1]|0)|0;o=r-t|0;C=o*2260|0;o=o*11363|0;n=o+(t*20995|0)|0;p=C+(r*7373|0)|0;r=o+(B(r,-4926)|0)|0;t=C+(B(t,-4176)|0)|0;C=n+z|0;n=z-n|0;z=p+x|0;p=x-p|0;x=r+v|0;r=v-r|0;v=t+f|0;t=f-t|0;f=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;o=B(c[j+96>>2]|0,b[d+48>>1]|0)|0;E=B(c[j+160>>2]|0,b[d+80>>1]|0)|0;G=B(c[j+224>>2]|0,b[d+112>>1]|0)|0;D=E+f|0;y=(o+f|0)*11086|0;w=D*10217|0;q=(G+f|0)*8956|0;s=(f-G|0)*7350|0;D=D*5461|0;u=(f-o|0)*3363|0;A=y+(B(f,-18730)|0)+w+q|0;f=u+(B(f,-15038)|0)+D+s|0;J=(E+o|0)*1136|0;F=(E-o|0)*11529|0;H=G+o|0;I=B(H,-5461)|0;y=y+(o*589|0)+J+I|0;H=B(H,-10217)|0;o=u+(o*16154|0)+F+H|0;u=B(G+E|0,-11086)|0;w=J+(B(E,-9222)|0)+w+u|0;u=I+(G*8728|0)+q+u|0;q=(G-E|0)*3363|0;s=H+(G*25733|0)+s+q|0;q=F+(B(E,-6278)|0)+D+q|0;c[k>>2]=A+C>>11;c[k+480>>2]=C-A>>11;c[k+32>>2]=y+z>>11;c[k+448>>2]=z-y>>11;c[k+64>>2]=w+x>>11;c[k+416>>2]=x-w>>11;c[k+96>>2]=u+v>>11;c[k+384>>2]=v-u>>11;c[k+128>>2]=s+t>>11;c[k+352>>2]=t-s>>11;c[k+160>>2]=q+r>>11;c[k+320>>2]=r-q>>11;c[k+192>>2]=o+p>>11;c[k+288>>2]=p-o>>11;c[k+224>>2]=f+n>>11;c[k+256>>2]=n-f>>11;e=e+1|0;if((e|0)==8)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){J=(c[g+(d<<2)>>2]|0)+h|0;H=(c[i>>2]|0)+16400|0;I=c[i+16>>2]|0;D=H+I<<13;I=H-I<<13;H=c[i+8>>2]|0;F=c[i+24>>2]|0;A=(F+H|0)*4433|0;H=A+(H*6270|0)|0;F=A+(B(F,-15137)|0)|0;A=H+D|0;H=D-H|0;D=F+I|0;F=I-F|0;I=c[i+28>>2]|0;x=c[i+20>>2]|0;z=c[i+12>>2]|0;C=c[i+4>>2]|0;E=z+I|0;G=C+x|0;y=(G+E|0)*9633|0;E=y+(B(E,-16069)|0)|0;G=y+(B(G,-3196)|0)|0;y=B(C+I|0,-7373)|0;I=y+(I*2446|0)+E|0;C=y+(C*12299|0)+G|0;y=B(z+x|0,-20995)|0;G=y+(x*16819|0)+G|0;E=y+(z*25172|0)+E|0;a[J>>0]=a[e+((C+A|0)>>>18&1023)>>0]|0;a[J+7>>0]=a[e+((A-C|0)>>>18&1023)>>0]|0;a[J+1>>0]=a[e+((E+D|0)>>>18&1023)>>0]|0;a[J+6>>0]=a[e+((D-E|0)>>>18&1023)>>0]|0;a[J+2>>0]=a[e+((G+F|0)>>>18&1023)>>0]|0;a[J+5>>0]=a[e+((F-G|0)>>>18&1023)>>0]|0;a[J+3>>0]=a[e+((I+H|0)>>>18&1023)>>0]|0;a[J+4>>0]=a[e+((H-I|0)>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==16)break;else i=i+32|0}yb=m;return}function Qu(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0;d=(c[d+336>>2]|0)+-384|0;i=c[e+84>>2]|0;h=(c[g>>2]|0)+h|0;e=(B(c[i>>2]|0,b[f>>1]|0)|0)+4100|0;g=B(c[i+4>>2]|0,b[f+2>>1]|0)|0;a[h>>0]=a[d+((g+e|0)>>>3&1023)>>0]|0;a[h+1>>0]=a[d+((e-g|0)>>>3&1023)>>0]|0;return}function Ru(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;i=yb;yb=yb+32|0;r=i;p=c[d+336>>2]|0;k=c[e+84>>2]|0;d=B(c[k>>2]|0,b[f>>1]|0)|0;e=B(c[k+32>>2]|0,b[f+16>>1]|0)|0;q=e+d|0;c[r>>2]=q;j=r+16|0;c[j>>2]=d-e;e=B(c[k+4>>2]|0,b[f+2>>1]|0)|0;d=B(c[k+36>>2]|0,b[f+18>>1]|0)|0;o=d+e|0;c[r+4>>2]=o;d=e-d|0;c[r+20>>2]=d;e=B(c[k+8>>2]|0,b[f+4>>1]|0)|0;l=B(c[k+40>>2]|0,b[f+20>>1]|0)|0;n=l+e|0;c[r+8>>2]=n;l=e-l|0;c[r+24>>2]=l;e=B(c[k+12>>2]|0,b[f+6>>1]|0)|0;k=B(c[k+44>>2]|0,b[f+22>>1]|0)|0;m=k+e|0;c[r+12>>2]=m;k=e-k|0;c[r+28>>2]=k;e=p+-384|0;f=(c[g>>2]|0)+h|0;q=q+4100|0;p=q+n<<13;n=q-n<<13;q=(m+o|0)*4433|0;o=q+(o*6270|0)|0;m=q+(B(m,-15137)|0)|0;a[f>>0]=a[e+((o+p|0)>>>16&1023)>>0]|0;a[f+3>>0]=a[e+((p-o|0)>>>16&1023)>>0]|0;a[f+1>>0]=a[e+((m+n|0)>>>16&1023)>>0]|0;a[f+2>>0]=a[e+((n-m|0)>>>16&1023)>>0]|0;h=(c[g+4>>2]|0)+h|0;f=(c[j>>2]|0)+4100|0;j=f+l<<13;f=f-l<<13;g=(k+d|0)*4433|0;d=g+(d*6270|0)|0;g=g+(B(k,-15137)|0)|0;a[h>>0]=a[e+((d+j|0)>>>16&1023)>>0]|0;a[h+3>>0]=a[e+((j-d|0)>>>16&1023)>>0]|0;a[h+1>>0]=a[e+((g+f|0)>>>16&1023)>>0]|0;a[h+2>>0]=a[e+((f-g|0)>>>16&1023)>>0]|0;yb=i;return}function Su(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;i=yb;yb=yb+80|0;k=i;q=c[d+336>>2]|0;e=c[e+84>>2]|0;s=B(b[f>>1]<<13,c[e>>2]|0)|0|1024;n=B((b[f+32>>1]|0)*5793|0,c[e+64>>2]|0)|0;l=n+s|0;s=(B(n,-2)|0)+s|0;n=B((b[f+16>>1]|0)*10033|0,c[e+32>>2]|0)|0;c[k>>2]=n+l>>11;c[k+48>>2]=l-n>>11;n=k+24|0;c[n>>2]=s>>11;s=k+4|0;l=B(b[f+2>>1]<<13,c[e+4>>2]|0)|0|1024;r=B((b[f+34>>1]|0)*5793|0,c[e+68>>2]|0)|0;p=r+l|0;l=(B(r,-2)|0)+l|0;r=B((b[f+18>>1]|0)*10033|0,c[e+36>>2]|0)|0;c[s>>2]=r+p>>11;c[k+52>>2]=p-r>>11;c[k+28>>2]=l>>11;l=B(b[f+4>>1]<<13,c[e+8>>2]|0)|0|1024;r=B((b[f+36>>1]|0)*5793|0,c[e+72>>2]|0)|0;p=r+l|0;l=(B(r,-2)|0)+l|0;r=B((b[f+20>>1]|0)*10033|0,c[e+40>>2]|0)|0;c[k+8>>2]=r+p>>11;c[k+56>>2]=p-r>>11;c[k+32>>2]=l>>11;l=B(b[f+6>>1]<<13,c[e+12>>2]|0)|0|1024;r=B((b[f+38>>1]|0)*5793|0,c[e+76>>2]|0)|0;p=r+l|0;l=(B(r,-2)|0)+l|0;r=B((b[f+22>>1]|0)*10033|0,c[e+44>>2]|0)|0;c[k+12>>2]=r+p>>11;c[k+60>>2]=p-r>>11;c[k+36>>2]=l>>11;l=B(b[f+8>>1]<<13,c[e+16>>2]|0)|0|1024;r=B((b[f+40>>1]|0)*5793|0,c[e+80>>2]|0)|0;p=r+l|0;l=(B(r,-2)|0)+l|0;r=B((b[f+24>>1]|0)*10033|0,c[e+48>>2]|0)|0;c[k+16>>2]=r+p>>11;c[k+64>>2]=p-r>>11;c[k+40>>2]=l>>11;l=B(b[f+10>>1]<<13,c[e+20>>2]|0)|0|1024;r=B((b[f+42>>1]|0)*5793|0,c[e+84>>2]|0)|0;p=r+l|0;l=(B(r,-2)|0)+l|0;e=B((b[f+26>>1]|0)*10033|0,c[e+52>>2]|0)|0;c[k+20>>2]=e+p>>11;c[k+68>>2]=p-e>>11;l=l>>11;c[k+44>>2]=l;e=q+-384|0;f=(c[g>>2]|0)+h|0;q=(c[k>>2]<<13)+134348800|0;p=(c[k+16>>2]|0)*5793|0;r=q+p|0;p=q-p-p|0;q=(c[k+8>>2]|0)*10033|0;d=r+q|0;q=r-q|0;s=c[s>>2]|0;r=c[k+12>>2]|0;o=c[k+20>>2]|0;m=(o+s|0)*2998|0;j=m+(r+s<<13)|0;m=m+(o-r<<13)|0;o=s-r-o<<13;a[f>>0]=a[e+((j+d|0)>>>18&1023)>>0]|0;a[f+5>>0]=a[e+((d-j|0)>>>18&1023)>>0]|0;a[f+1>>0]=a[e+((o+p|0)>>>18&1023)>>0]|0;a[f+4>>0]=a[e+((p-o|0)>>>18&1023)>>0]|0;a[f+2>>0]=a[e+((m+q|0)>>>18&1023)>>0]|0;a[f+3>>0]=a[e+((q-m|0)>>>18&1023)>>0]|0;f=(c[g+4>>2]|0)+h|0;n=(c[n>>2]<<13)+134348800|0;m=(c[k+40>>2]|0)*5793|0;q=n+m|0;m=n-m-m|0;n=(c[k+32>>2]|0)*10033|0;o=q+n|0;n=q-n|0;q=c[k+28>>2]|0;p=c[k+36>>2]|0;j=(l+q|0)*2998|0;d=j+(p+q<<13)|0;j=j+(l-p<<13)|0;l=q-p-l<<13;a[f>>0]=a[e+((d+o|0)>>>18&1023)>>0]|0;a[f+5>>0]=a[e+((o-d|0)>>>18&1023)>>0]|0;a[f+1>>0]=a[e+((l+m|0)>>>18&1023)>>0]|0;a[f+4>>0]=a[e+((m-l|0)>>>18&1023)>>0]|0;a[f+2>>0]=a[e+((j+n|0)>>>18&1023)>>0]|0;a[f+3>>0]=a[e+((n-j|0)>>>18&1023)>>0]|0;h=(c[g+8>>2]|0)+h|0;f=(c[k+48>>2]<<13)+134348800|0;j=(c[k+64>>2]|0)*5793|0;n=f+j|0;j=f-j-j|0;f=(c[k+56>>2]|0)*10033|0;l=n+f|0;f=n-f|0;n=c[k+52>>2]|0;m=c[k+60>>2]|0;d=c[k+68>>2]|0;g=(d+n|0)*2998|0;k=g+(m+n<<13)|0;g=g+(d-m<<13)|0;d=n-m-d<<13;a[h>>0]=a[e+((k+l|0)>>>18&1023)>>0]|0;a[h+5>>0]=a[e+((l-k|0)>>>18&1023)>>0]|0;a[h+1>>0]=a[e+((d+j|0)>>>18&1023)>>0]|0;a[h+4>>0]=a[e+((j-d|0)>>>18&1023)>>0]|0;a[h+2>>0]=a[e+((g+f|0)>>>18&1023)>>0]|0;a[h+3>>0]=a[e+((f-g|0)>>>18&1023)>>0]|0;yb=i;return} +function Jm(b,d,e,g){b=b|0;d=d|0;e=e|0;g=g|0;var 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;y=yb;yb=yb+16|0;v=y;w=b+4|0;c[w>>2]=c[b>>2];do if((yk(d)|0)!=0?(yk(e)|0)!=0:0){Wm(b,yk(d)|0);t=b+8|0;u=b+12|0;s=0;a:while(1){if(s>>>0>=(yk(d)|0)>>>0)break;n=Xm(d,s)|0;wo(g,n)|0;q=Ym(d,s)|0;o=xo(g)|0;p=o+4|0;q=q+16|0;l=0;m=-1;j=-1;i=2147483647;while(1){h=c[o>>2]|0;if(l>>>0>=(c[p>>2]|0)-h>>2>>>0)break;k=a[q>>0]|0;do if(k<<24>>24==(a[(Ym(e,c[h+(l<<2)>>2]|0)|0)+16>>0]|0)){h=wl(n,Xm(e,c[(c[o>>2]|0)+(l<<2)>>2]|0)|0)|0;if(h>>>0>>0){k=h;h=m;i=c[(c[o>>2]|0)+(l<<2)>>2]|0;break}else{k=m;h=h>>>0>>0?h:j;break}}else{k=m;h=j}while(0);l=l+1|0;m=k;j=h}do if((m|0)!=-1){if((i|0)==-1){x=15;break a}if((j|0)==-1){_m(v,s,i);h=c[w>>2]|0;if(h>>>0<(c[t>>2]|0)>>>0){o=v;p=c[o+4>>2]|0;q=h;c[q>>2]=c[o>>2];c[q+4>>2]=p;c[w>>2]=(c[w>>2]|0)+8}else $m(b,v);break}if(+(m>>>0)/+(j>>>0)<+f[u>>2]){_m(v,s,i);h=c[w>>2]|0;if(h>>>0<(c[t>>2]|0)>>>0){o=v;p=c[o+4>>2]|0;q=h;c[q>>2]=c[o>>2];c[q+4>>2]=p;c[w>>2]=(c[w>>2]|0)+8}else $m(b,v)}}while(0);s=s+1|0}if((x|0)==15){x=Vf(Vf(NE(Vf(Vf(Vf(56032,31276)|0,31157)|0,35e3)|0,160)|0,35007)|0,31348)|0;GE(v,x+(c[(c[x>>2]|0)+-12>>2]|0)|0);g=VF(v,56736)|0;g=Gb[c[(c[g>>2]|0)+28>>2]&63](g,10)|0;WF(v);OE(x,g)|0;KE(x)|0;ua()}x=(c[w>>2]|0)-(c[b>>2]|0)>>3;if(x>>>0>(yk(d)|0)>>>0){x=Vf(Vf(NE(Vf(Vf(Vf(56032,31366)|0,31157)|0,35e3)|0,175)|0,35007)|0,31426)|0;GE(v,x+(c[(c[x>>2]|0)+-12>>2]|0)|0);w=VF(v,56736)|0;w=Gb[c[(c[w>>2]|0)+28>>2]&63](w,10)|0;WF(v);OE(x,w)|0;KE(x)|0;ua()}else{r=(c[w>>2]|0)-(c[b>>2]|0)>>3;break}}else r=0;while(0);yb=y;return r|0}function Km(b,d,e){b=b|0;d=d|0;e=e|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;t=yb;yb=yb+16|0;r=t;s=b+4|0;c[s>>2]=c[b>>2];do if((yk(d)|0)!=0?(yk(e)|0)!=0:0){Wm(b,yk(d)|0);p=b+8|0;q=b+12|0;o=0;while(1){if(o>>>0>=(yk(d)|0)>>>0)break;l=Xm(d,o)|0;m=(Ym(d,o)|0)+16|0;i=0;j=-1;g=2147483647;h=-1;while(1){if(i>>>0>=(yk(e)|0)>>>0)break;k=a[m>>0]|0;if(k<<24>>24==(a[(Ym(e,i)|0)+16>>0]|0)){u=wl(l,Xm(e,i)|0)|0;v=u>>>0>>0;k=v?u:j;g=v?i:g;h=v?j:u>>>0>>0?u:h}else k=j;i=i+1|0;j=k}do if((j|0)!=-1){if((h|0)==-1){_m(r,o,g);g=c[s>>2]|0;if(g>>>0<(c[p>>2]|0)>>>0){m=r;u=c[m+4>>2]|0;v=g;c[v>>2]=c[m>>2];c[v+4>>2]=u;c[s>>2]=(c[s>>2]|0)+8}else $m(b,r);break}if(+(j>>>0)/+(h>>>0)<+f[q>>2]){_m(r,o,g);g=c[s>>2]|0;if(g>>>0<(c[p>>2]|0)>>>0){m=r;u=c[m+4>>2]|0;v=g;c[v>>2]=c[m>>2];c[v+4>>2]=u;c[s>>2]=(c[s>>2]|0)+8}else $m(b,r)}}while(0);o=o+1|0}v=(c[s>>2]|0)-(c[b>>2]|0)>>3;if(v>>>0>(yk(d)|0)>>>0){v=Vf(Vf(NE(Vf(Vf(Vf(56032,31366)|0,31157)|0,35e3)|0,112)|0,35007)|0,31426)|0;GE(r,v+(c[(c[v>>2]|0)+-12>>2]|0)|0);u=VF(r,56736)|0;u=Gb[c[(c[u>>2]|0)+28>>2]&63](u,10)|0;WF(r);OE(v,u)|0;KE(v)|0;ua()}else{n=(c[s>>2]|0)-(c[b>>2]|0)>>3;break}}else n=0;while(0);yb=t;return n|0}function Lm(a){a=a|0;return a|0}function Mm(a){a=a|0;return c[a>>2]|0}function Nm(a){a=a|0;return c[a+4>>2]|0}function Om(a,b,d,e,g,h,i,j){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|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.0,A=0.0;u=yb;yb=yb+32|0;s=u+20|0;t=u+8|0;o=u+4|0;p=u;q=e+4|0;so(s,(c[q>>2]|0)-(c[e>>2]|0)>>1);so(t,(c[q>>2]|0)-(c[e>>2]|0)>>1);n=c[e>>2]|0;r=(c[q>>2]|0)-n>>3;m=c[b>>2]|0;d=c[d>>2]|0;k=c[s>>2]|0;l=c[t>>2]|0;b=0;while(1){if((b|0)==(r|0))break;y=c[n+(b<<3)>>2]|0;w=c[n+(b<<3)+4>>2]|0;v=b<<2;x=k+(v<<2)|0;c[x>>2]=c[m+(y*20|0)>>2];c[x+4>>2]=c[m+(y*20|0)+4>>2];c[x+8>>2]=c[m+(y*20|0)+8>>2];c[x+12>>2]=c[m+(y*20|0)+12>>2];v=l+(v<<2)|0;c[v>>2]=c[d+(w*20|0)>>2];c[v+4>>2]=c[d+(w*20|0)+4>>2];c[v+8>>2]=c[d+(w*20|0)+8>>2];c[v+12>>2]=c[d+(w*20|0)+12>>2];b=b+1|0}A=+(g|0);A=A*.20000000298023224+A;z=+(h|0);z=z*.20000000298023224+z;mp(a,-A,A,-z,z,0,0,12,10);to(a,+(i>>1|0),+(j>>1|0));uo(a,i,j);op(a,c[s>>2]|0,c[t>>2]|0,(c[q>>2]|0)-(c[e>>2]|0)>>3);Dp(a,o,p);y=+f[o>>2]<3.0?-1:c[p>>2]|0;eh(t);eh(s);yb=u;return y|0}function Pm(a,b,d,e,g){a=a|0;b=b|0;d=d|0;e=e|0;g=+g;var 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;v=yb;yb=yb+48|0;h=v+32|0;r=v+28|0;s=v+24|0;t=v+20|0;u=v+16|0;n=v+12|0;o=v+8|0;p=v+4|0;q=v;oo(b,n,o,p,q,e);l=a+4|0;c[l>>2]=c[a>>2];m=po(b)|0;m=(c[m+4>>2]|0)-(c[m>>2]|0)>>2;e=qo(b)|0;if(m>>>0>(c[d+4>>2]|0)-(c[d>>2]|0)>>3>>>0){k=Vf(Vf(NE(Vf(Vf(Vf(56032,31870)|0,30067)|0,35e3)|0,342)|0,35007)|0,31916)|0;GE(h,k+(c[(c[k>>2]|0)+-12>>2]|0)|0);j=VF(h,56736)|0;j=Gb[c[(c[j>>2]|0)+28>>2]&63](j,10)|0;WF(h);OE(k,j)|0;KE(k)|0;ua()}k=a+8|0;e=c[e>>2]|0;h=0;while(1){if((h|0)>=(m|0))break;ro(b,r,s,t,u,+f[e>>2],+f[e+4>>2],+f[e+8>>2],+f[e+12>>2],+(c[n>>2]|0)+.5,+(c[o>>2]|0)+.5,+(c[p>>2]|0)+.5,+(c[q>>2]|0)+.5);do if((+f[r>>2]>2]>2]>2]>2]|0)+(h<<2)>>2]|0;i=(c[d>>2]|0)+(i<<3)|0;j=c[l>>2]|0;if((j|0)==(c[k>>2]|0)){fn(a,i);break}else{w=i;i=c[w+4>>2]|0;c[j>>2]=c[w>>2];c[j+4>>2]=i;c[l>>2]=(c[l>>2]|0)+8;break}}while(0);e=e+16|0;h=h+1|0}yb=v;return}function Qm(a,b,d,e,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0;q=yb;yb=yb+64|0;o=q+44|0;p=q+32|0;n=q;m=e+4|0;gn(o,(c[m>>2]|0)-(c[e>>2]|0)>>3);gn(p,(c[m>>2]|0)-(c[e>>2]|0)>>3);l=c[e>>2]|0;m=(c[m>>2]|0)-l>>3;j=c[b>>2]|0;k=c[p>>2]|0;b=c[d>>2]|0;d=c[o>>2]|0;e=0;while(1){if((e|0)==(m|0))break;r=c[l+(e<<3)>>2]|0;c[k+(e<<3)>>2]=c[j+(r*20|0)>>2];c[k+(e<<3)+4>>2]=c[j+(r*20|0)+4>>2];r=c[l+(e<<3)+4>>2]|0;c[d+(e<<3)>>2]=c[b+(r*20|0)>>2];c[d+(e<<3)+4>>2]=c[b+(r*20|0)+4>>2];e=e+1|0}f[n>>2]=0.0;f[n+4>>2]=0.0;s=+(h|0);f[n+8>>2]=s;f[n+12>>2]=0.0;f[n+16>>2]=s;s=+(i|0);f[n+20>>2]=s;f[n+24>>2]=0.0;f[n+28>>2]=s;if(hn(g,a,d,k,m,n,4)|0)e=kn(a,h,i)|0;else e=0;jn(p);jn(o);yb=q;return e|0}function Rm(a,b,d,e,g,h){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=+h;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0;q=yb;yb=yb+16|0;p=q;h=+hi(h);o=g+4|0;Wm(a,(c[o>>2]|0)-(c[g>>2]|0)>>3);l=p+4|0;m=a+4|0;n=a+8|0;k=0;while(1){i=c[g>>2]|0;if(k>>>0>=(c[o>>2]|0)-i>>3>>>0)break;j=c[i+(k<<3)+4>>2]|0;i=c[e>>2]|0;Zm(p,l,b,+f[i+(j*20|0)>>2],+f[i+(j*20|0)+4>>2]);r=+hi(+f[p>>2]-+f[(c[d>>2]|0)+((c[(c[g>>2]|0)+(k<<3)>>2]|0)*20|0)>>2]);do if(r+ +hi(+f[l>>2]-+f[(c[d>>2]|0)+((c[(c[g>>2]|0)+(k<<3)>>2]|0)*20|0)+4>>2])<=h){i=(c[g>>2]|0)+(k<<3)|0;j=c[m>>2]|0;if((j|0)==(c[n>>2]|0)){fn(a,i);break}else{s=i;i=c[s+4>>2]|0;c[j>>2]=c[s>>2];c[j+4>>2]=i;c[m>>2]=(c[m>>2]|0)+8;break}}while(0);k=k+1|0}yb=q;return}function Sm(b,d,e,g,h){b=b|0;d=d|0;e=e|0;g=g|0;h=+h;var 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.0,B=0;z=yb;yb=yb+64|0;u=z+40|0;v=z;w=z+52|0;x=z+48|0;t=b+4|0;c[t>>2]=c[b>>2];do if((yk(d)|0)!=0?(yk(e)|0)!=0:0){h=+hi(h);if(!(Vm(v,g,0.0)|0)){r=Vf(Vf(NE(Vf(Vf(Vf(56032,31132)|0,31157)|0,35e3)|0,196)|0,35007)|0,31243)|0;GE(u,r+(c[(c[r>>2]|0)+-12>>2]|0)|0);q=VF(u,56736)|0;q=Gb[c[(c[q>>2]|0)+28>>2]&63](q,10)|0;WF(u);OE(r,q)|0;KE(r)|0;ua()}Wm(b,yk(d)|0);q=b+8|0;r=b+12|0;p=0;a:while(1){if(p>>>0>=(yk(d)|0)>>>0)break;n=Xm(d,p)|0;o=Ym(d,p)|0;Zm(w,x,v,+f[o>>2],+f[o+4>>2]);o=o+16|0;l=0;m=-1;j=-1;i=2147483647;while(1){if(l>>>0>=(yk(e)|0)>>>0)break;g=Ym(e,l)|0;if((a[o>>0]|0)==(a[g+16>>0]|0)?(A=+hi(+f[w>>2]-+f[g>>2]),!(A+ +hi(+f[x>>2]-+f[g+4>>2])>h)):0){g=xl(n,Xm(e,l)|0)|0;B=g>>>0>>0;k=B?g:m;g=B?m:g>>>0>>0?g:j;i=B?l:i}else{k=m;g=j}l=l+1|0;m=k;j=g}do if((m|0)!=-1){if((i|0)==-1){y=16;break a}if((j|0)==-1){_m(u,p,i);g=c[t>>2]|0;if(g>>>0<(c[q>>2]|0)>>>0){n=u;o=c[n+4>>2]|0;B=g;c[B>>2]=c[n>>2];c[B+4>>2]=o;c[t>>2]=(c[t>>2]|0)+8}else $m(b,u);break}if(+(m>>>0)/+(j>>>0)<+f[r>>2]){_m(u,p,i);g=c[t>>2]|0;if(g>>>0<(c[q>>2]|0)>>>0){n=u;o=c[n+4>>2]|0;B=g;c[B>>2]=c[n>>2];c[B+4>>2]=o;c[t>>2]=(c[t>>2]|0)+8}else $m(b,u)}}while(0);p=p+1|0}if((y|0)==16){B=Vf(Vf(NE(Vf(Vf(Vf(56032,31276)|0,31157)|0,35e3)|0,241)|0,35007)|0,31348)|0;GE(u,B+(c[(c[B>>2]|0)+-12>>2]|0)|0);y=VF(u,56736)|0;y=Gb[c[(c[y>>2]|0)+28>>2]&63](y,10)|0;WF(u);OE(B,y)|0;KE(B)|0;ua()}B=(c[t>>2]|0)-(c[b>>2]|0)>>3;if(B>>>0>(yk(d)|0)>>>0){B=Vf(Vf(NE(Vf(Vf(Vf(56032,31366)|0,31157)|0,35e3)|0,256)|0,35007)|0,31426)|0;GE(u,B+(c[(c[B>>2]|0)+-12>>2]|0)|0);y=VF(u,56736)|0;y=Gb[c[(c[y>>2]|0)+28>>2]&63](y,10)|0;WF(u);OE(B,y)|0;KE(B)|0;ua()}else{s=(c[t>>2]|0)-(c[b>>2]|0)>>3;break}}else s=0;while(0);yb=z;return s|0}function Tm(a,b){a=a|0;b=b|0;var d=0;d=a+36|0;do{c[a>>2]=c[b>>2];a=a+4|0;b=b+4|0}while((a|0)<(d|0));return}function Um(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=c[a>>2]|0;c[a>>2]=c[b>>2];c[b>>2]=f;f=a+4|0;d=b+4|0;e=c[f>>2]|0;c[f>>2]=c[d>>2];c[d>>2]=e;d=a+8|0;b=b+8|0;a=c[d>>2]|0;c[d>>2]=c[b>>2];c[b>>2]=a;return}function Vm(a,b,c){a=a|0;b=b|0;c=+c;var d=0.0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=+en(b);if(!(+t(+d)<=c)){d=1.0/d;e=b+16|0;k=b+20|0;j=b+28|0;m=b+32|0;f[a>>2]=d*+vi(+f[e>>2],+f[k>>2],+f[j>>2],+f[m>>2]);l=b+8|0;h=b+4|0;f[a+4>>2]=d*+vi(+f[l>>2],+f[h>>2],+f[m>>2],+f[j>>2]);f[a+8>>2]=d*+vi(+f[h>>2],+f[l>>2],+f[e>>2],+f[k>>2]);g=b+12|0;i=b+24|0;f[a+12>>2]=d*+vi(+f[k>>2],+f[g>>2],+f[m>>2],+f[i>>2]);f[a+16>>2]=d*+vi(+f[b>>2],+f[l>>2],+f[i>>2],+f[m>>2]);f[a+20>>2]=d*+vi(+f[l>>2],+f[b>>2],+f[k>>2],+f[g>>2]);f[a+24>>2]=d*+vi(+f[g>>2],+f[e>>2],+f[i>>2],+f[j>>2]);f[a+28>>2]=d*+vi(+f[h>>2],+f[b>>2],+f[j>>2],+f[i>>2]);f[a+32>>2]=d*+vi(+f[b>>2],+f[h>>2],+f[g>>2],+f[e>>2]);a=1}else a=0;return a|0}function Wm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=yb;yb=yb+32|0;d=f;e=c[a>>2]|0;if((c[a+8>>2]|0)-e>>3>>>0>>0){bn(d,b,(c[a+4>>2]|0)-e>>3,a+8|0);cn(a,d);dn(d)}yb=f;return}function Xm(a,b){a=a|0;b=b|0;b=B(c[a>>2]|0,b)|0;return (c[a+4>>2]|0)+b|0}function Ym(a,b){a=a|0;b=b|0;return (c[a+16>>2]|0)+(b*20|0)|0}function Zm(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=+d;e=+e;var g=0.0;g=+f[c+32>>2]+(+f[c+24>>2]*d+ +f[c+28>>2]*e);f[a>>2]=(+f[c+8>>2]+(+f[c>>2]*d+ +f[c+4>>2]*e))/g;f[b>>2]=(+f[c+20>>2]+(+f[c+12>>2]*d+ +f[c+16>>2]*e))/g;return}function _m(a,b,d){a=a|0;b=b|0;d=d|0;c[a>>2]=b;c[a+4>>2]=d;return}function $m(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=yb;yb=yb+32|0;d=h;e=a+4|0;f=((c[e>>2]|0)-(c[a>>2]|0)>>3)+1|0;g=an(a)|0;if(g>>>0>>0)CO(a);else{i=c[a>>2]|0;k=(c[a+8>>2]|0)-i|0;j=k>>2;bn(d,k>>3>>>0>>1>>>0?(j>>>0>>0?f:j):g,(c[e>>2]|0)-i>>3,a+8|0);g=d+8|0;e=c[b+4>>2]|0;f=c[g>>2]|0;c[f>>2]=c[b>>2];c[f+4>>2]=e;c[g>>2]=(c[g>>2]|0)+8;cn(a,d);dn(d);yb=h;return}}function an(a){a=a|0;return 536870911}function bn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;do if(b)if(b>>>0>536870911){f=O(8)|0;bO(f,37409);c[f>>2]=16392;Q(f|0,13960,22)}else{e=rB(b<<3)|0;break}else e=0;while(0);c[a>>2]=e;d=e+(d<<3)|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+(b<<3);return}function cn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[a>>2]|0;h=a+4|0;g=b+4|0;f=(c[h>>2]|0)-e|0;d=(c[g>>2]|0)+(0-(f>>3)<<3)|0;c[g>>2]=d;if((f|0)>0){YO(d|0,e|0,f|0)|0;e=g;d=c[g>>2]|0}else e=g;g=c[a>>2]|0;c[a>>2]=d;c[e>>2]=g;g=b+8|0;f=c[h>>2]|0;c[h>>2]=c[g>>2];c[g>>2]=f;g=a+8|0;h=b+12|0;a=c[g>>2]|0;c[g>>2]=c[h>>2];c[h>>2]=a;c[b>>2]=c[e>>2];return}function dn(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a+4>>2]|0;d=a+8|0;e=c[d>>2]|0;while(1){if((e|0)==(b|0))break;f=e+-8|0;c[d>>2]=f;e=f}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function en(a){a=a|0;var b=0.0,c=0.0,d=0.0,e=0,g=0,h=0,i=0,j=0,k=0;h=a+16|0;k=a+20|0;e=a+28|0;j=a+32|0;d=+vi(+f[h>>2],+f[k>>2],+f[e>>2],+f[j>>2]);i=a+12|0;g=a+24|0;c=+vi(+f[i>>2],+f[k>>2],+f[g>>2],+f[j>>2]);b=+vi(+f[i>>2],+f[h>>2],+f[g>>2],+f[e>>2]);return +(d*+f[a>>2]-c*+f[a+4>>2]+b*+f[a+8>>2])}function fn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=yb;yb=yb+32|0;d=h;e=a+4|0;f=((c[e>>2]|0)-(c[a>>2]|0)>>3)+1|0;g=an(a)|0;if(g>>>0>>0)CO(a);else{i=c[a>>2]|0;k=(c[a+8>>2]|0)-i|0;j=k>>2;bn(d,k>>3>>>0>>1>>>0?(j>>>0>>0?f:j):g,(c[e>>2]|0)-i>>3,a+8|0);g=d+8|0;e=c[b+4>>2]|0;f=c[g>>2]|0;c[f>>2]=c[b>>2];c[f+4>>2]=e;c[g>>2]=(c[g>>2]|0)+8;cn(a,d);dn(d);yb=h;return}}function gn(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;if(b|0){lo(a,b);mo(a,b)}return}function hn(a,b,d,e,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|0;var j=0;j=a+12|0;Tk(j,g);return un(b,d,e,g,h,i,a,j,a+24|0,+f[a+36>>2],c[a+40>>2]|0,c[a+44>>2]|0,c[a+48>>2]|0)|0}function jn(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;d=b;if(b|0){c[a+4>>2]=d;Nf(b,(c[a+8>>2]|0)-d|0)}return}function kn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0.0;m=yb;yb=yb+96|0;e=m+88|0;g=m+80|0;h=m+72|0;i=m+64|0;j=m;k=m+56|0;l=m+48|0;d=m+40|0;if(Vm(j,a,9.999999747378752e-06)|0){n=+(b|0);f[k>>2]=n;f[k+4>>2]=0.0;f[l>>2]=n;n=+(c|0);f[l+4>>2]=n;f[d>>2]=0.0;f[d+4>>2]=n;ln(e,j,55476);ln(g,j,k);ln(h,j,l);ln(i,j,d);n=+(B(c,b)|0)*.0001;if(+mn(e,g,h,i)>2];e=c+4|0;g=+f[e>>2];d=+f[b+32>>2]+(+f[b+24>>2]*h+ +f[b+28>>2]*g);f[a>>2]=(+f[b+8>>2]+(h*+f[b>>2]+g*+f[b+4>>2]))/d;f[a+4>>2]=(+f[b+20>>2]+(+f[b+12>>2]*+f[c>>2]+ +f[b+16>>2]*+f[e>>2]))/d;return}function mn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0,g=0,h=0,i=0.0,j=0.0,k=0,l=0,m=0;f=yb;yb=yb+48|0;l=f+32|0;m=f+24|0;k=f+16|0;h=f+8|0;g=f;pn(l,b,a);pn(m,c,a);pn(k,d,a);pn(h,b,c);pn(g,d,c);j=+qn(l,m);i=+qn(m,k);e=+qn(l,k);e=+rn(j,i,e,+qn(h,g));yb=f;return +e}function nn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=+on(a,b,c)>0.0;f=+on(b,c,d)>0.0;c=+on(c,d,a)>0.0;d=+on(d,a,b)>0.0;d=(f?1:-1)+(e?1:-1)+(c?1:-1)+(d?1:-1)|0;return (((d|0)>-1?d:0-d|0)|0)==4|0}function on(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0;d=+f[a>>2];e=+f[a+4>>2];return +((+f[b>>2]-d)*(+f[c+4>>2]-e)-(+f[b+4>>2]-e)*(+f[c>>2]-d))}function pn(a,b,c){a=a|0;b=b|0;c=c|0;f[a>>2]=+f[b>>2]-+f[c>>2];f[a+4>>2]=+f[b+4>>2]-+f[c+4>>2];return}function qn(a,b){a=a|0;b=b|0;return +(+t(+(+f[a>>2]*+f[b+4>>2]-+f[a+4>>2]*+f[b>>2]))*.5)}function rn(a,b,c,d){a=+a;b=+b;c=+c;d=+d;return +(+tn(+sn(a,b,c),d))}function sn(a,b,c){a=+a;b=+b;c=+c;return +(+tn(+tn(a,b),c))}function tn(a,b){a=+a;b=+b;return +(a>2]|0)-(c[i>>2]|0)>>2>>>0<(m*9|0)>>>0){z=Vf(Vf(NE(Vf(Vf(Vf(56032,31460)|0,31518)|0,35e3)|0,119)|0,35007)|0,31612)|0;GE(y,z+(c[(c[z>>2]|0)+-12>>2]|0)|0);x=VF(y,56736)|0;x=Gb[c[(c[x>>2]|0)+28>>2]&63](x,10)|0;WF(y);OE(z,x)|0;KE(z)|0;ua()}x=c[j>>2]|0;z=x;if((c[j+4>>2]|0)-x>>2>>>0>>0){x=Vf(Vf(NE(Vf(Vf(Vf(56032,31662)|0,31518)|0,35e3)|0,120)|0,35007)|0,31712)|0;GE(y,x+(c[(c[x>>2]|0)+-12>>2]|0)|0);u=VF(y,56736)|0;u=Gb[c[(c[u>>2]|0)+28>>2]&63](u,10)|0;WF(y);OE(x,u)|0;KE(x)|0;ua()}if((c[k+4>>2]|0)-(c[k>>2]|0)>>3>>>0>>0){x=Vf(Vf(NE(Vf(Vf(Vf(56032,31754)|0,31518)|0,35e3)|0,121)|0,35007)|0,31816)|0;GE(y,x+(c[(c[x>>2]|0)+-12>>2]|0)|0);u=VF(y,56736)|0;u=Gb[c[(c[u>>2]|0)+28>>2]&63](u,10)|0;WF(y);OE(x,u)|0;KE(x)|0;ua()}if((e|0)>=4){c[w>>2]=1234;l=+hi(l);x=zj(o,e)|0;rl(z,e,0);sl(z,e,e,w);q=z+4|0;r=z+8|0;s=z+12|0;t=(h|0)>0;o=0;u=0;while(1){if(!((u|0)<(m|0)&(o|0)<(n|0)))break;sl(z,e,4,w);D=c[z>>2]<<1;C=c[q>>2]<<1;B=c[r>>2]<<1;j=c[s>>2]<<1;do if(vn(b+(D<<2)|0,b+(C<<2)|0,b+(B<<2)|0,b+(j<<2)|0,d+(D<<2)|0,d+(C<<2)|0,d+(B<<2)|0,d+(j<<2)|0)|0?(v=u*9|0,j=c[z>>2]<<1,B=c[q>>2]<<1,C=c[r>>2]<<1,D=c[s>>2]<<1,wn((c[i>>2]|0)+(v<<2)|0,b+(j<<2)|0,b+(B<<2)|0,b+(C<<2)|0,b+(D<<2)|0,d+(j<<2)|0,d+(B<<2)|0,d+(C<<2)|0,d+(D<<2)|0)|0):0){if(t?!(xn((c[i>>2]|0)+(v<<2)|0,g,h)|0):0){j=u;break}j=u+1|0}else j=u;while(0);o=o+1|0;u=j}l=1.0/l;if(u){o=c[k>>2]|0;j=0;while(1){if((j|0)>=(u|0))break;f[o+(j<<3)>>2]=0.0;c[o+(j<<3)+4>>2]=j;j=j+1|0}t=0;while(1){if(!((u|0)>2&(t|0)<(e|0)))break;r=(zj(x,e-t|0)|0)+t|0;q=0;j=c[k>>2]|0;while(1){if((q|0)==(u|0))break;s=(c[i>>2]|0)+((c[j+(q<<3)+4>>2]|0)*9<<2)|0;o=t;while(1){if((o|0)>=(r|0))break;j=c[z+(o<<2)>>2]<<1;p=+zn(s,b+(j<<2)|0,d+(j<<2)|0,l);j=c[k>>2]|0;D=j+(q<<3)|0;f[D>>2]=p+ +f[D>>2];o=o+1|0}q=q+1|0}yn(y,j,u);t=r;u=u>>1}q=c[k>>2]|0;o=1;l=+f[q>>2];j=c[q+4>>2]|0;while(1){if((o|0)>=(u|0))break;p=+f[q+(o<<3)>>2];if(p>2]|0}o=o+1|0}Tm(a,(c[i>>2]|0)+(j*9<<2)|0);An(a);j=1}else j=0}else j=0;yb=A;return j|0}function vn(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;var i=0;i=+on(a,b,c)>0.0;if((!(i^+on(e,f,g)>0.0)?(i=+on(b,c,d)>0.0,!(i^+on(f,g,h)>0.0)):0)?(i=+on(c,d,a)>0.0,!(i^+on(g,h,e)>0.0)):0){a=+on(d,a,b)>0.0;a=a^+on(h,e,f)>0.0^1}else a=0;return a|0}function wn(a,b,c,d,e,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|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;x=yb;yb=yb+128|0;w=x;k=x+124|0;l=x+120|0;m=x+112|0;n=x+104|0;o=x+96|0;p=x+88|0;q=x+80|0;r=x+72|0;s=x+64|0;t=x+56|0;u=x+48|0;v=x+40|0;if((Gn(o,p,q,r,k,m,b,c,d,e)|0?Gn(s,t,u,v,l,n,g,h,i,j)|0:0)?Hn(w,o,p,q,r,s,t,u,v)|0:0){In(a,w,+f[k>>2],m,+f[l>>2],n);a=1}else a=0;yb=x;return a|0}function xn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;n=yb;yb=yb+48|0;f=n+32|0;e=n+24|0;d=n+16|0;k=n+8|0;l=n;a:do if((c|0)>=2){m=b+8|0;g=b+16|0;ln(f,a,b);ln(e,a,m);ln(d,a,g);En(k,f);En(l,e);if(Fn(b,m,g,f,e,d)|0){j=3;i=f;f=m;h=b;while(1){if((j|0)>=(c|0))break;h=h+8|0;f=f+8|0;g=g+8|0;ln(i,a,g);if(!(Fn(h,f,g,e,d,i)|0)){d=0;break a}else{o=i;j=j+1|0;i=e;e=d;d=o}}if(Fn(f,g,b,e,d,k)|0)d=Fn(g,b,m,d,k,l)|0;else d=0}else d=0}else d=1;while(0);yb=n;return d|0}function yn(a,b,c){a=a|0;b=b|0;c=c|0;Dn(a,b,c,(c&1)+-1+((c|0)/2|0)|0);return}function zn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=+d;var e=0,g=0,h=0,i=0;e=yb;yb=yb+16|0;i=e+8|0;g=e;h=i+4|0;Zm(i,h,a,+f[b>>2],+f[b+4>>2]);f[g>>2]=+f[i>>2]-+f[c>>2];f[g+4>>2]=+f[h>>2]-+f[c+4>>2];d=+Bn(g,d);yb=e;return +d}function An(a){a=a|0;var b=0,c=0.0,d=0;b=a+32|0;c=1.0/+f[b>>2];f[a>>2]=+f[a>>2]*c;d=a+4|0;f[d>>2]=c*+f[d>>2];d=a+8|0;f[d>>2]=c*+f[d>>2];d=a+12|0;f[d>>2]=c*+f[d>>2];d=a+16|0;f[d>>2]=c*+f[d>>2];d=a+20|0;f[d>>2]=c*+f[d>>2];d=a+24|0;f[d>>2]=c*+f[d>>2];a=a+28|0;f[a>>2]=c*+f[a>>2];f[b>>2]=1.0;return}function Bn(a,b){a=a|0;b=+b;return +(+Cn(+f[a>>2],+f[a+4>>2],b))}function Cn(a,b,c){a=+a;b=+b;c=+c;return +(+z(+((a*a+b*b)*c+1.0)))}function Dn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var g=0,h=0,i=0.0,j=0,k=0.0,l=0,m=0,n=0.0,o=0,p=0,q=0,r=0,s=0,t=0;s=yb;yb=yb+16|0;g=s;if((d|0)<=0){r=Vf(Vf(NE(Vf(Vf(Vf(56032,33419)|0,33448)|0,35e3)|0,82)|0,35007)|0,33521)|0;GE(g,r+(c[(c[r>>2]|0)+-12>>2]|0)|0);q=VF(g,56736)|0;q=Gb[c[(c[q>>2]|0)+28>>2]&63](q,10)|0;WF(g);OE(r,q)|0;KE(r)|0;ua()}if((e|0)<=0){r=Vf(Vf(NE(Vf(Vf(Vf(56032,33540)|0,33448)|0,35e3)|0,83)|0,35007)|0,33569)|0;GE(g,r+(c[(c[r>>2]|0)+-12>>2]|0)|0);q=VF(g,56736)|0;q=Gb[c[(c[q>>2]|0)+28>>2]&63](q,10)|0;WF(g);OE(r,q)|0;KE(r)|0;ua()}p=e+-1|0;q=b+(p<<3)|0;r=b+(p<<3)+4|0;l=d+-1|0;m=0;while(1){if((m|0)>=(l|0))break;n=+f[q>>2];o=c[r>>2]|0;g=m;d=l;do{while(1){j=b+(g<<3)|0;k=+f[j>>2];if(!(k>2]|0)>=(o|0))break}g=g+1|0}while(1){h=b+(d<<3)|0;i=+f[h>>2];if(!(n=(c[b+(d<<3)+4>>2]|0))break}d=d+-1|0}if((g|0)<=(d|0)){f[j>>2]=i;f[h>>2]=k;t=b+(g<<3)+4|0;j=b+(d<<3)+4|0;h=c[t>>2]|0;c[t>>2]=c[j>>2];c[j>>2]=h;g=g+1|0;d=d+-1|0}}while((g|0)<=(d|0));l=(g|0)<(e|0)?l:d;m=(d|0)<(p|0)?g:m}b=q;e=c[b+4>>2]|0;t=a;c[t>>2]=c[b>>2];c[t+4>>2]=e;yb=s;return}function En(a,b){a=a|0;b=b|0;var d=0,e=0;e=b;d=c[e+4>>2]|0;b=a;c[b>>2]=c[e>>2];c[b+4>>2]=d;return}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;c=+on(a,b,c)>0.0;return c^+on(d,e,f)>0.0^1|0}function Gn(a,b,c,d,e,g,h,i,j,k){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,v=0,w=0,x=0,y=0;l=(+f[h>>2]+ +f[i>>2]+ +f[j>>2]+ +f[k>>2])*.25;f[g>>2]=l;y=h+4|0;x=i+4|0;w=j+4|0;v=k+4|0;m=(+f[y>>2]+ +f[x>>2]+ +f[w>>2]+ +f[v>>2])*.25;f[g+4>>2]=m;s=+f[h>>2]-l;t=+f[y>>2]-m;q=+f[i>>2]-l;r=+f[x>>2]-m;o=+f[j>>2]-l;p=+f[w>>2]-m;l=+f[k>>2]-l;m=+f[v>>2]-m;n=(+u(+(s*s+t*t))+ +u(+(q*q+r*r))+ +u(+(o*o+p*p))+ +u(+(l*l+m*m)))*.25;if(n==0.0)g=0;else{n=1.0/n*1.4142135623730951;f[e>>2]=n;f[a>>2]=s*n;f[a+4>>2]=t*+f[e>>2];f[b>>2]=q*+f[e>>2];f[b+4>>2]=r*+f[e>>2];f[c>>2]=o*+f[e>>2];f[c+4>>2]=p*+f[e>>2];f[d>>2]=l*+f[e>>2];f[d+4>>2]=m*+f[e>>2];g=1}return g|0}function Hn(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;var j=0,k=0;j=yb;yb=yb+288|0;k=j;Jn(k,b,c,d,e,f,g,h,i);if(Kn(a,k)|0)a=!(+t(+(+en(a)))<1.0e-05);else a=0;yb=j;return a|0}function In(a,b,c,d,e,g){a=a|0;b=b|0;c=+c;d=d|0;e=+e;g=g|0;var h=0,i=0.0,j=0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0,q=0.0,r=0.0;l=b+24|0;o=+f[l>>2];q=+f[g>>2];k=b+28|0;n=+f[k>>2];r=o*q+ +f[b>>2]/e;q=q*n+ +f[b+4>>2]/e;p=g+4|0;m=+f[p>>2];o=o*m+ +f[b+12>>2]/e;m=n*m+ +f[b+16>>2]/e;n=+f[d>>2]*c;h=d+4|0;i=+f[h>>2]*c;f[a>>2]=r*c;f[a+4>>2]=q*c;j=b+32|0;f[a+8>>2]=+f[j>>2]*+f[g>>2]+ +f[b+8>>2]/e-r*n-q*i;f[a+12>>2]=o*c;f[a+16>>2]=m*c;f[a+20>>2]=+f[j>>2]*+f[p>>2]+ +f[b+20>>2]/e-o*n-m*i;i=+f[l>>2]*c;f[a+24>>2]=i;e=+f[k>>2]*c;f[a+28>>2]=e;f[a+32>>2]=+f[j>>2]-i*+f[d>>2]-e*+f[h>>2];return}function Jn(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;jo(a,b,f);jo(a+72|0,c,g);jo(a+144|0,d,h);jo(a+216|0,e,i);return}function Kn(a,b){a=a|0;b=b|0;var c=0,d=0;d=yb;yb=yb+288|0;c=d;if(((((((Ln(c,b)|0?Mn(c,b)|0:0)?Nn(c,b)|0:0)?On(c,b)|0:0)?Pn(c,b)|0:0)?Qn(c,b)|0:0)?Rn(c,b)|0:0)?Sn(c,b)|0:0)a=Tn(a,c)|0;else a=0;yb=d;return a|0}function Ln(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0;g=yb;yb=yb+32|0;d=g;f[d>>2]=+Yn(b);e=b+36|0;f[d+4>>2]=+Yn(e);f[d+8>>2]=+Yn(b+72|0);f[d+12>>2]=+Yn(b+108|0);f[d+16>>2]=+Yn(b+144|0);f[d+20>>2]=+Yn(b+180|0);f[d+24>>2]=+Yn(b+216|0);f[d+28>>2]=+Yn(b+252|0);c=ho(d)|0;d=d+(c<<2)|0;if(+f[d>>2]==0.0)a=0;else{ao(b,b+(c*9<<2)|0);Wn(a,b,1.0/+u(+(+f[d>>2])));io(a+36|0,e,63);a=1}yb=g;return a|0}function Mn(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;e=yb;yb=yb+32|0;g=e;c=a+36|0;d=b+36|0;_n(c,a,d);m=a+72|0;_n(m,a,b+72|0);l=a+108|0;_n(l,a,b+108|0);k=a+144|0;_n(k,a,b+144|0);j=a+180|0;_n(j,a,b+180|0);i=a+216|0;_n(i,a,b+216|0);h=a+252|0;_n(h,a,b+252|0);f[g>>2]=+Yn(c);f[g+4>>2]=+Yn(m);f[g+8>>2]=+Yn(l);f[g+12>>2]=+Yn(k);f[g+16>>2]=+Yn(j);f[g+20>>2]=+Yn(i);f[g+24>>2]=+Yn(h);a=go(g)|0;b=g+(a<<2)|0;if(+f[b>>2]==0.0)a=0;else{a=a*9|0;ao(c,c+(a<<2)|0);ao(d,d+(a<<2)|0);Wn(c,c,1.0/+u(+(+f[b>>2])));a=1}yb=e;return a|0}function Nn(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;e=yb;yb=yb+32|0;g=e;c=a+72|0;l=a+36|0;d=b+72|0;_n(c,l,d);k=a+108|0;_n(k,l,b+108|0);j=a+144|0;_n(j,l,b+144|0);i=a+180|0;_n(i,l,b+180|0);h=a+216|0;_n(h,l,b+216|0);a=a+252|0;_n(a,l,b+252|0);f[g>>2]=+Yn(c);f[g+4>>2]=+Yn(k);f[g+8>>2]=+Yn(j);f[g+12>>2]=+Yn(i);f[g+16>>2]=+Yn(h);f[g+20>>2]=+Yn(a);a=fo(g)|0;b=g+(a<<2)|0;if(+f[b>>2]==0.0)a=0;else{a=a*9|0;ao(c,c+(a<<2)|0);ao(d,d+(a<<2)|0);Wn(c,c,1.0/+u(+(+f[b>>2])));a=1}yb=e;return a|0}function On(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0;e=yb;yb=yb+32|0;g=e;c=a+108|0;k=a+72|0;d=b+108|0;_n(c,k,d);j=a+144|0;_n(j,k,b+144|0);i=a+180|0;_n(i,k,b+180|0);h=a+216|0;_n(h,k,b+216|0);a=a+252|0;_n(a,k,b+252|0);f[g>>2]=+Yn(c);f[g+4>>2]=+Yn(j);f[g+8>>2]=+Yn(i);f[g+12>>2]=+Yn(h);f[g+16>>2]=+Yn(a);a=eo(g)|0;b=g+(a<<2)|0;if(+f[b>>2]==0.0)a=0;else{a=a*9|0;ao(c,c+(a<<2)|0);ao(d,d+(a<<2)|0);Wn(c,c,1.0/+u(+(+f[b>>2])));a=1}yb=e;return a|0}function Pn(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0;e=yb;yb=yb+16|0;g=e;c=a+144|0;j=a+108|0;d=b+144|0;_n(c,j,d);i=a+180|0;_n(i,j,b+180|0);h=a+216|0;_n(h,j,b+216|0);a=a+252|0;_n(a,j,b+252|0);f[g>>2]=+Yn(c);f[g+4>>2]=+Yn(i);f[g+8>>2]=+Yn(h);f[g+12>>2]=+Yn(a);a=co(g)|0;b=g+(a<<2)|0;if(+f[b>>2]==0.0)a=0;else{a=a*9|0;ao(c,c+(a<<2)|0);ao(d,d+(a<<2)|0);Wn(c,c,1.0/+u(+(+f[b>>2])));a=1}yb=e;return a|0}function Qn(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0;e=yb;yb=yb+16|0;g=e;c=a+180|0;i=a+144|0;d=b+180|0;_n(c,i,d);h=a+216|0;_n(h,i,b+216|0);a=a+252|0;_n(a,i,b+252|0);f[g>>2]=+Yn(c);f[g+4>>2]=+Yn(h);f[g+8>>2]=+Yn(a);a=bo(g)|0;b=g+(a<<2)|0;if(+f[b>>2]==0.0)a=0;else{a=a*9|0;ao(c,c+(a<<2)|0);ao(d,d+(a<<2)|0);Wn(c,c,1.0/+u(+(+f[b>>2])));a=1}yb=e;return a|0}function Rn(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0;e=yb;yb=yb+16|0;g=e;c=a+216|0;h=a+180|0;d=b+216|0;_n(c,h,d);a=a+252|0;_n(a,h,b+252|0);f[g>>2]=+Yn(c);f[g+4>>2]=+Yn(a);a=$n(g)|0;b=g+(a<<2)|0;if(+f[b>>2]==0.0)a=0;else{a=a*9|0;ao(c,c+(a<<2)|0);ao(d,d+(a<<2)|0);Wn(c,c,1.0/+u(+(+f[b>>2])));a=1}yb=e;return a|0}function Sn(a,b){a=a|0;b=b|0;var c=0.0,d=0;d=a+252|0;_n(d,a+216|0,b+252|0);c=+Yn(d);if(c==0.0)a=0;else{Wn(d,d,1.0/+u(+c));a=1}return a|0}function Tn(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;d=yb;yb=yb+384|0;e=d+336|0;c=d;f[e>>2]=+Un(c,b,0);f[e+4>>2]=+Un(c+36|0,b,1);f[e+8>>2]=+Un(c+72|0,b,2);f[e+12>>2]=+Un(c+108|0,b,3);f[e+16>>2]=+Un(c+144|0,b,4);f[e+20>>2]=+Un(c+180|0,b,5);f[e+24>>2]=+Un(c+216|0,b,6);f[e+28>>2]=+Un(c+252|0,b,7);f[e+32>>2]=+Un(c+288|0,b,8);b=Vn(e)|0;if(+f[e+(b<<2)>>2]==0.0)b=0;else{Tm(a,c+(b*9<<2)|0);b=1}yb=d;return b|0}function Un(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,g=0;Wn(a,b,-+f[b+(c<<2)>>2]);g=a+(c<<2)|0;f[g>>2]=+f[g>>2]+1.0;Xn(a,b+36|0,-+f[b+(c+9<<2)>>2]);Xn(a,b+72|0,-+f[b+(c+18<<2)>>2]);Xn(a,b+108|0,-+f[b+(c+27<<2)>>2]);Xn(a,b+144|0,-+f[b+(c+36<<2)>>2]);Xn(a,b+180|0,-+f[b+(c+45<<2)>>2]);Xn(a,b+216|0,-+f[b+(c+54<<2)>>2]);Xn(a,b+252|0,-+f[b+(c+63<<2)>>2]);e=+Yn(a);d=+u(+e);if(e==0.0)d=0.0;else Wn(a,a,1.0/d);return +d}function Vn(a){a=a|0;var b=0;b=+f[a+4>>2]>+f[a>>2]&1;b=+f[a+8>>2]>+f[a+(b<<2)>>2]?2:b;b=+f[a+12>>2]>+f[a+(b<<2)>>2]?3:b;b=+f[a+16>>2]>+f[a+(b<<2)>>2]?4:b;b=+f[a+20>>2]>+f[a+(b<<2)>>2]?5:b;b=+f[a+24>>2]>+f[a+(b<<2)>>2]?6:b;b=+f[a+28>>2]>+f[a+(b<<2)>>2]?7:b;return (+f[a+32>>2]>+f[a+(b<<2)>>2]?8:b)|0}function Wn(a,b,c){a=a|0;b=b|0;c=+c;f[a>>2]=+f[b>>2]*c;f[a+4>>2]=+f[b+4>>2]*c;f[a+8>>2]=+f[b+8>>2]*c;f[a+12>>2]=+f[b+12>>2]*c;f[a+16>>2]=+f[b+16>>2]*c;f[a+20>>2]=+f[b+20>>2]*c;f[a+24>>2]=+f[b+24>>2]*c;f[a+28>>2]=+f[b+28>>2]*c;f[a+32>>2]=+f[b+32>>2]*c;return}function Xn(a,b,c){a=a|0;b=b|0;c=+c;var d=0;f[a>>2]=+f[a>>2]+ +f[b>>2]*c;d=a+4|0;f[d>>2]=+f[d>>2]+ +f[b+4>>2]*c;d=a+8|0;f[d>>2]=+f[d>>2]+ +f[b+8>>2]*c;d=a+12|0;f[d>>2]=+f[d>>2]+ +f[b+12>>2]*c;d=a+16|0;f[d>>2]=+f[d>>2]+ +f[b+16>>2]*c;d=a+20|0;f[d>>2]=+f[d>>2]+ +f[b+20>>2]*c;d=a+24|0;f[d>>2]=+f[d>>2]+ +f[b+24>>2]*c;d=a+28|0;f[d>>2]=+f[d>>2]+ +f[b+28>>2]*c;a=a+32|0;f[a>>2]=+f[a>>2]+ +f[b+32>>2]*c;return}function Yn(a){a=a|0;return +(+Zn(a,a))}function Zn(a,b){a=a|0;b=b|0;return +(+f[a>>2]*+f[b>>2]+ +f[a+4>>2]*+f[b+4>>2]+ +f[a+8>>2]*+f[b+8>>2]+ +f[a+12>>2]*+f[b+12>>2]+ +f[a+16>>2]*+f[b+16>>2]+ +f[a+20>>2]*+f[b+20>>2]+ +f[a+24>>2]*+f[b+24>>2]+ +f[a+28>>2]*+f[b+28>>2]+ +f[a+32>>2]*+f[b+32>>2])}function _n(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+Zn(c,b);f[a>>2]=+f[a>>2]-d*+f[b>>2];c=a+4|0;f[c>>2]=+f[c>>2]-d*+f[b+4>>2];c=a+8|0;f[c>>2]=+f[c>>2]-d*+f[b+8>>2];c=a+12|0;f[c>>2]=+f[c>>2]-d*+f[b+12>>2];c=a+16|0;f[c>>2]=+f[c>>2]-d*+f[b+16>>2];c=a+20|0;f[c>>2]=+f[c>>2]-d*+f[b+20>>2];c=a+24|0;f[c>>2]=+f[c>>2]-d*+f[b+24>>2];c=a+28|0;f[c>>2]=+f[c>>2]-d*+f[b+28>>2];c=a+32|0;f[c>>2]=+f[c>>2]-d*+f[b+32>>2];return}function $n(a){a=a|0;return +f[a+4>>2]>+f[a>>2]|0}function ao(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=c[a>>2]|0;f=a+4|0;c[a>>2]=c[b>>2];d=b+4|0;c[b>>2]=g;g=c[f>>2]|0;e=a+8|0;c[f>>2]=c[d>>2];f=b+8|0;c[d>>2]=g;d=c[e>>2]|0;g=a+12|0;c[e>>2]=c[f>>2];e=b+12|0;c[f>>2]=d;f=c[g>>2]|0;d=a+16|0;c[g>>2]=c[e>>2];g=b+16|0;c[e>>2]=f;e=c[d>>2]|0;f=a+20|0;c[d>>2]=c[g>>2];d=b+20|0;c[g>>2]=e;g=c[f>>2]|0;e=a+24|0;c[f>>2]=c[d>>2];f=b+24|0;c[d>>2]=g;d=c[e>>2]|0;g=a+28|0;c[e>>2]=c[f>>2];e=b+28|0;c[f>>2]=d;f=c[g>>2]|0;d=a+32|0;c[g>>2]=c[e>>2];b=b+32|0;c[e>>2]=f;a=c[d>>2]|0;c[d>>2]=c[b>>2];c[b>>2]=a;return}function bo(a){a=a|0;var b=0;b=+f[a+4>>2]>+f[a>>2]&1;return (+f[a+8>>2]>+f[a+(b<<2)>>2]?2:b)|0}function co(a){a=a|0;var b=0;b=+f[a+4>>2]>+f[a>>2]&1;b=+f[a+8>>2]>+f[a+(b<<2)>>2]?2:b;return (+f[a+12>>2]>+f[a+(b<<2)>>2]?3:b)|0}function eo(a){a=a|0;var b=0;b=+f[a+4>>2]>+f[a>>2]&1;b=+f[a+8>>2]>+f[a+(b<<2)>>2]?2:b;b=+f[a+12>>2]>+f[a+(b<<2)>>2]?3:b;return (+f[a+16>>2]>+f[a+(b<<2)>>2]?4:b)|0}function fo(a){a=a|0;var b=0;b=+f[a+4>>2]>+f[a>>2]&1;b=+f[a+8>>2]>+f[a+(b<<2)>>2]?2:b;b=+f[a+12>>2]>+f[a+(b<<2)>>2]?3:b;b=+f[a+16>>2]>+f[a+(b<<2)>>2]?4:b;return (+f[a+20>>2]>+f[a+(b<<2)>>2]?5:b)|0}function go(a){a=a|0;var b=0;b=+f[a+4>>2]>+f[a>>2]&1;b=+f[a+8>>2]>+f[a+(b<<2)>>2]?2:b;b=+f[a+12>>2]>+f[a+(b<<2)>>2]?3:b;b=+f[a+16>>2]>+f[a+(b<<2)>>2]?4:b;b=+f[a+20>>2]>+f[a+(b<<2)>>2]?5:b;return (+f[a+24>>2]>+f[a+(b<<2)>>2]?6:b)|0}function ho(a){a=a|0;var b=0;b=+f[a+4>>2]>+f[a>>2]&1;b=+f[a+8>>2]>+f[a+(b<<2)>>2]?2:b;b=+f[a+12>>2]>+f[a+(b<<2)>>2]?3:b;b=+f[a+16>>2]>+f[a+(b<<2)>>2]?4:b;b=+f[a+20>>2]>+f[a+(b<<2)>>2]?5:b;b=+f[a+24>>2]>+f[a+(b<<2)>>2]?6:b;return (+f[a+28>>2]>+f[a+(b<<2)>>2]?7:b)|0}function io(a,b,c){a=a|0;b=b|0;c=c|0;YO(a|0,b|0,c<<2|0)|0;return}function jo(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;f[a>>2]=-+f[b>>2];e=b+4|0;f[a+4>>2]=-+f[e>>2];f[a+8>>2]=-1.0;ko(a+12|0);f[a+24>>2]=+f[d>>2]*+f[b>>2];f[a+28>>2]=+f[d>>2]*+f[e>>2];c[a+32>>2]=c[d>>2];ko(a+36|0);f[a+48>>2]=-+f[b>>2];f[a+52>>2]=-+f[e>>2];f[a+56>>2]=-1.0;d=d+4|0;f[a+60>>2]=+f[d>>2]*+f[b>>2];f[a+64>>2]=+f[d>>2]*+f[e>>2];c[a+68>>2]=c[d>>2];return}function ko(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;return}function lo(a,b){a=a|0;b=b|0;var d=0;if((pj(a)|0)>>>0>>0)CO(a);if(b>>>0>536870911){b=O(8)|0;bO(b,37409);c[b>>2]=16392;Q(b|0,13960,22)}else{d=rB(b<<3)|0;c[a+4>>2]=d;c[a>>2]=d;c[a+8>>2]=d+(b<<3);return}}function mo(a,b){a=a|0;b=b|0;var d=0;d=a+4|0;a=b;b=c[d>>2]|0;do{no(b);b=(c[d>>2]|0)+8|0;c[d>>2]=b;a=a+-1|0}while((a|0)!=0);return}function no(a){a=a|0;f[a>>2]=0.0;f[a+4>>2]=0.0;return}function oo(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 h=0,i=0,j=0,k=0,l=0,m=0,n=0;k=yb;yb=yb+16|0;j=k;i=a+88|0;n=a+84|0;h=a+52|0;m=(((g|0)%(c[i>>2]|0)|0|0)%(c[n>>2]|0)|0|0)%(c[h>>2]|0)|0;c[b>>2]=m;m=(((g-m|0)%(c[i>>2]|0)|0|0)%(c[n>>2]|0)|0|0)/(c[h>>2]|0)|0;c[d>>2]=m;m=g-(c[b>>2]|0)-(B(c[h>>2]|0,m)|0)|0;m=((m|0)%(c[i>>2]|0)|0|0)/(c[n>>2]|0)|0;c[e>>2]=m;l=B(c[h>>2]|0,c[d>>2]|0)|0;g=g-(c[b>>2]|0)-((B(c[n>>2]|0,m)|0)+l)|0;i=(g|0)/(c[i>>2]|0)|0;c[f>>2]=i;g=c[b>>2]|0;if((g|0)<=-1){n=Vf(Vf(NE(Vf(Vf(Vf(56032,32616)|0,32155)|0,35e3)|0,190)|0,35007)|0,32649)|0;GE(j,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(j,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(j);OE(n,m)|0;KE(n)|0;ua()}if((g|0)>=(c[h>>2]|0)){n=Vf(Vf(NE(Vf(Vf(Vf(56032,32667)|0,32155)|0,35e3)|0,191)|0,35007)|0,32649)|0;GE(j,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(j,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(j);OE(n,m)|0;KE(n)|0;ua()}g=c[d>>2]|0;if((g|0)<=-1){n=Vf(Vf(NE(Vf(Vf(Vf(56032,32707)|0,32155)|0,35e3)|0,192)|0,35007)|0,32740)|0;GE(j,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(j,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(j);OE(n,m)|0;KE(n)|0;ua()}if((g|0)>=(c[a+56>>2]|0)){n=Vf(Vf(NE(Vf(Vf(Vf(56032,32758)|0,32155)|0,35e3)|0,193)|0,35007)|0,32740)|0;GE(j,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(j,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(j);OE(n,m)|0;KE(n)|0;ua()}g=c[e>>2]|0;if((g|0)<=-1){n=Vf(Vf(NE(Vf(Vf(Vf(56032,32798)|0,32155)|0,35e3)|0,194)|0,35007)|0,32835)|0;GE(j,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(j,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(j);OE(n,m)|0;KE(n)|0;ua()}if((g|0)>=(c[a+60>>2]|0)){n=Vf(Vf(NE(Vf(Vf(Vf(56032,32857)|0,32155)|0,35e3)|0,195)|0,35007)|0,32835)|0;GE(j,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(j,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(j);OE(n,m)|0;KE(n)|0;ua()}if((i|0)<=-1){n=Vf(Vf(NE(Vf(Vf(Vf(56032,32905)|0,32155)|0,35e3)|0,196)|0,35007)|0,32942)|0;GE(j,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(j,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(j);OE(n,m)|0;KE(n)|0;ua()}if((i|0)<(c[a+64>>2]|0)){yb=k;return}else{n=Vf(Vf(NE(Vf(Vf(Vf(56032,32964)|0,32155)|0,35e3)|0,197)|0,35007)|0,32942)|0;GE(j,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(j,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(j);OE(n,m)|0;KE(n)|0;ua()}}function po(a){a=a|0;return a+124|0}function qo(a){a=a|0;return a+112|0}function ro(a,b,d,e,g,h,i,j,k,l,m,n,o){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=+h;i=+i;j=+j;k=+k;l=+l;m=+m;n=+n;o=+o;var p=0,q=0;q=yb;yb=yb+16|0;p=q;f[b>>2]=+t(+(h-l));f[d>>2]=+t(+(i-m));f[g>>2]=+t(+(k-o));l=+t(+(j-n));l=+tn(l,+(c[a+60>>2]|0)-l);f[e>>2]=l;if(!(l>=0.0)){q=Vf(Vf(NE(Vf(Vf(Vf(56032,31935)|0,32155)|0,35e3)|0,333)|0,35007)|0,31976)|0;GE(p,q+(c[(c[q>>2]|0)+-12>>2]|0)|0);g=VF(p,56736)|0;g=Gb[c[(c[g>>2]|0)+28>>2]&63](g,10)|0;WF(p);OE(q,g)|0;KE(q)|0;ua()}else{yb=q;return}}function so(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;if(b|0){vo(a,b);mh(a,b)}return}function to(a,b,c){a=a|0;b=+b;c=+c;f[a+8>>2]=b;f[a+12>>2]=c;return}function uo(a,b,d){a=a|0;b=b|0;d=d|0;c[a>>2]=b;c[a+4>>2]=d;return}function vo(a,b){a=a|0;b=b|0;var d=0;if((nh(a)|0)>>>0>>0)CO(a);if(b>>>0>1073741823){b=O(8)|0;bO(b,37409);c[b>>2]=16392;Q(b|0,13960,22)}else{d=rB(b<<2)|0;c[a+4>>2]=d;c[a>>2]=d;c[a+8>>2]=d+(b<<2);return}}function wo(a,b){a=a|0;b=b|0;var 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;t=yb;yb=yb+48|0;j=t+8|0;i=t+32|0;h=t+28|0;k=t+24|0;p=t+20|0;q=t+16|0;r=t;s=a+8|0;if(!(c[s>>2]|0)){o=Vf(Vf(NE(Vf(Vf(Vf(56032,32010)|0,29190)|0,35e3)|0,405)|0,35007)|0,32045)|0;GE(j,o+(c[(c[o>>2]|0)+-12>>2]|0)|0);n=VF(j,56736)|0;n=Gb[c[(c[n>>2]|0)+28>>2]&63](n,10)|0;WF(j);OE(o,n)|0;KE(o)|0;ua()}c[a+100>>2]=0;l=a+72|0;m=a+76|0;c[m>>2]=c[l>>2];n=a+84|0;o=a+88|0;e=c[o>>2]|0;while(1){d=c[n>>2]|0;f=d;if((d|0)==(e|0))break;g=e-f|0;if((g|0)>8){e=e+-8|0;u=d;v=c[u>>2]|0;u=c[u+4>>2]|0;x=j;c[x>>2]=v;c[x+4>>2]=u;x=e;w=c[x+4>>2]|0;c[d>>2]=c[x>>2];c[d+4>>2]=w;d=e;c[d>>2]=v;c[d+4>>2]=u;Wl(j);c[k>>2]=f;c[p>>2]=e;c[q>>2]=f;c[h>>2]=c[k>>2];c[i>>2]=c[p>>2];c[j>>2]=c[q>>2];yo(h,i,r,(g>>>3)+-1|0,j);e=c[o>>2]|0}d=0;while(1){if((d|0)==-1)break;x=d+-1|0;Wl(e+(x<<3)|0);d=x}e=e+-8|0;c[o>>2]=e}zo(a,n,c[s>>2]|0,b);yb=t;return (c[m>>2]|0)-(c[l>>2]|0)>>2|0}function xo(a){a=a|0;return a+72|0}function yo(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;m=yb;yb=yb+16|0;l=m;j=c[f>>2]|0;k=c[a>>2]|0;b=j-k|0;i=j;h=j;if((e|0)>=2?(n=(e+-2|0)/2|0,(n|0)>=(b>>3|0)):0){b=b>>2|1;a=k+(b<<3)|0;d=a;g=b+1|0;if((g|0)<(e|0)){o=a+8|0;a=Mo(a,o)|0;b=a?g:b;d=a?o:d}if(!(Mo(d,i)|0)){o=c[j+4>>2]|0;i=l;c[i>>2]=c[j>>2];c[i+4>>2]=o;i=d;while(1){o=h;h=i;g=h;j=c[g+4>>2]|0;c[o>>2]=c[g>>2];c[o+4>>2]=j;c[f>>2]=i;if((n|0)<(b|0))break;b=b<<1|1;a=k+(b<<3)|0;d=a;g=b+1|0;if((g|0)<(e|0)){o=a+8|0;j=Mo(a,o)|0;b=j?g:b;d=j?o:d}if(Mo(d,l)|0)break;else i=d}e=l;f=c[e+4>>2]|0;o=i;c[o>>2]=c[e>>2];c[o+4>>2]=f;Wl(l)}}yb=m;return}function zo(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var 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;t=yb;yb=yb+64|0;m=t+8|0;l=t+56|0;k=t+52|0;n=t+44|0;o=t+36|0;p=t+28|0;q=t;g=t+48|0;h=t+40|0;f=t+32|0;r=t+16|0;if(Ao(d)|0){c[g>>2]=c[a+76>>2];c[h>>2]=c[(Bo(d)|0)>>2];c[f>>2]=c[(Bo(d)|0)+4>>2];c[k>>2]=c[g>>2];c[l>>2]=c[h>>2];c[m>>2]=c[f>>2];Co(a+72|0,k,l,m)|0}else{c[r>>2]=0;h=r+4|0;c[h>>2]=0;c[r+8>>2]=0;Do(d,r,b,e);f=0;while(1){g=c[r>>2]|0;if(f>>>0>=(c[h>>2]|0)-g>>2>>>0)break;zo(a,b,c[g+(f<<2)>>2]|0,e);f=f+1|0}i=a+100|0;if((c[i>>2]|0)<(c[a+104>>2]|0)?(j=c[b>>2]|0,s=b+4|0,(j|0)!=(c[s>>2]|0)):0){d=Eo(j)|0;f=c[b>>2]|0;g=c[s>>2]|0;h=g-f|0;if((h|0)>8){j=f;g=g+-8|0;u=j;v=c[u>>2]|0;u=c[u+4>>2]|0;x=m;c[x>>2]=v;c[x+4>>2]=u;x=g;w=c[x+4>>2]|0;c[j>>2]=c[x>>2];c[j+4>>2]=w;j=g;c[j>>2]=v;c[j+4>>2]=u;Wl(m);c[n>>2]=f;c[o>>2]=g;c[p>>2]=f;c[k>>2]=c[n>>2];c[l>>2]=c[o>>2];c[m>>2]=c[p>>2];yo(k,l,q,(h>>>3)+-1|0,m);g=c[s>>2]|0}f=0;while(1){if((f|0)==-1)break;x=f+-1|0;Wl(g+(x<<3)|0);f=x}c[s>>2]=g+-8;c[i>>2]=(c[i>>2]|0)+1;zo(a,b,d,e)}Fo(r)}yb=t;return}function Ao(b){b=b|0;return (a[b+100>>0]|0)!=0|0}function Bo(a){a=a|0;return a+116|0}function Co(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var 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;s=yb;yb=yb+48|0;p=s+40|0;o=s+36|0;q=s+32|0;r=s+28|0;j=s+8|0;k=s+4|0;l=s;f=c[a>>2]|0;g=f;b=f+((c[b>>2]|0)-g>>2<<2)|0;d=c[d>>2]|0;f=c[e>>2]|0;n=f-d|0;m=n>>2;a:do if((n|0)>0){h=a+8|0;n=c[a+4>>2]|0;i=n;if((m|0)>((c[h>>2]|0)-i>>2|0)){e=(i-g>>2)+m|0;g=jl(a)|0;if(g>>>0>>0)CO(a);else{r=c[a>>2]|0;n=(c[h>>2]|0)-r|0;q=n>>1;kl(j,n>>2>>>0>>1>>>0?(q>>>0>>0?e:q):g,b-r>>2,a+8|0);c[k>>2]=d;c[l>>2]=f;c[o>>2]=c[k>>2];c[p>>2]=c[l>>2];_o(j,o,p);b=$o(a,j,b)|0;ml(j);break}}g=i-b|0;h=g>>2;e=d+(h<<2)|0;if((m|0)>(h|0)){c[q>>2]=e;c[r>>2]=f;c[o>>2]=c[q>>2];c[p>>2]=c[r>>2];Yo(a,o,p,m-h|0);if((g|0)>0)f=e;else break}Zo(a,b,n,b+(m<<2)|0);e=b;while(1){if((d|0)==(f|0))break a;c[e>>2]=c[d>>2];e=e+4|0;d=d+4|0}}while(0);yb=s;return b|0}function Do(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var 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;t=yb;yb=yb+48|0;n=t+8|0;m=t+36|0;o=t+32|0;p=t+28|0;q=t;r=t+16|0;s=a+104|0;Go(r,(c[a+108>>2]|0)-(c[s>>2]|0)>>2);l=r+4|0;a=-1;f=0;k=-1;while(1){if(f>>>0>=(c[l>>2]|0)-(c[r>>2]|0)>>3>>>0)break;i=wl((c[(c[s>>2]|0)+(f<<2)>>2]|0)+4|0,e)|0;Ho(n,c[(c[s>>2]|0)+(f<<2)>>2]|0,i);g=n;j=c[g+4>>2]|0;h=(c[r>>2]|0)+(f<<3)|0;c[h>>2]=c[g>>2];c[h+4>>2]=j;Wl(n);h=i>>>0>>0;j=h?f:k;a=h?i:a;f=f+1|0;k=j}if((k|0)==-1){j=Vf(Vf(NE(Vf(Vf(Vf(56032,32065)|0,29190)|0,35e3)|0,155)|0,35007)|0,32099)|0;GE(n,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(n,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(n);OE(j,i)|0;KE(j)|0;ua()}a=c[(c[s>>2]|0)+(k<<2)>>2]|0;c[n>>2]=a;i=b+4|0;f=c[i>>2]|0;j=b+8|0;if(f>>>0<(c[j>>2]|0)>>>0){c[f>>2]=a;c[i>>2]=(c[i>>2]|0)+4}else Io(b,n);g=d+4|0;h=d+8|0;e=0;while(1){a=c[r>>2]|0;if(e>>>0>=(c[l>>2]|0)-a>>3>>>0)break;do if((e|0)!=(k|0)){f=Jo(a+(e<<3)|0)|0;if((f|0)==(Jo((c[r>>2]|0)+(k<<3)|0)|0)){a=c[(c[s>>2]|0)+(e<<2)>>2]|0;c[n>>2]=a;f=c[i>>2]|0;if(f>>>0<(c[j>>2]|0)>>>0){c[f>>2]=a;c[i>>2]=(c[i>>2]|0)+4}else Io(b,n);break}else{a=(c[r>>2]|0)+(e<<3)|0;f=c[g>>2]|0;if((f|0)==(c[h>>2]|0)){Ko(d,a);a=c[g>>2]|0}else{v=a;u=c[v+4>>2]|0;a=f;c[a>>2]=c[v>>2];c[a+4>>2]=u;a=(c[g>>2]|0)+8|0;c[g>>2]=a}v=c[d>>2]|0;c[o>>2]=v;c[p>>2]=a;c[m>>2]=c[o>>2];c[n>>2]=c[p>>2];Lo(m,n,q,a-v>>3);break}}while(0);e=e+1|0}Vl(r);yb=t;return}function Eo(a){a=a|0;return c[a>>2]|0}function Fo(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;d=b;if(b|0){c[a+4>>2]=d;Nf(b,(c[a+8>>2]|0)-d|0)}return}function Go(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;if(b|0){Vo(a,b);Wo(a,b)}return}function Ho(a,b,d){a=a|0;b=b|0;d=d|0;c[a>>2]=b;c[a+4>>2]=d;return}function Io(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=yb;yb=yb+32|0;d=h;e=a+4|0;f=((c[e>>2]|0)-(c[a>>2]|0)>>2)+1|0;g=Ro(a)|0;if(g>>>0>>0)CO(a);else{i=c[a>>2]|0;k=(c[a+8>>2]|0)-i|0;j=k>>1;So(d,k>>2>>>0>>1>>>0?(j>>>0>>0?f:j):g,(c[e>>2]|0)-i>>2,a+8|0);g=d+8|0;c[c[g>>2]>>2]=c[b>>2];c[g>>2]=(c[g>>2]|0)+4;To(a,d);Uo(d);yb=h;return}}function Jo(a){a=a|0;return c[a+4>>2]|0}function Ko(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=yb;yb=yb+32|0;d=h;e=a+4|0;f=((c[e>>2]|0)-(c[a>>2]|0)>>3)+1|0;g=No(a)|0;if(g>>>0>>0)CO(a);else{i=c[a>>2]|0;k=(c[a+8>>2]|0)-i|0;j=k>>2;Oo(d,k>>3>>>0>>1>>>0?(j>>>0>>0?f:j):g,(c[e>>2]|0)-i>>3,a+8|0);g=d+8|0;e=c[b+4>>2]|0;f=c[g>>2]|0;c[f>>2]=c[b>>2];c[f+4>>2]=e;c[g>>2]=(c[g>>2]|0)+8;Po(a,d);Qo(d);yb=h;return}}function Lo(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;j=yb;yb=yb+16|0;i=j;if((e|0)>1?(g=(e+-2|0)/2|0,k=c[a>>2]|0,h=k+(g<<3)|0,f=(c[b>>2]|0)+-8|0,c[b>>2]=f,Mo(h,f)|0):0){a=f;e=c[a+4>>2]|0;d=i;c[d>>2]=c[a>>2];c[d+4>>2]=e;d=h;while(1){a=d;e=c[a+4>>2]|0;h=f;c[h>>2]=c[a>>2];c[h+4>>2]=e;c[b>>2]=d;if(!g)break;g=(g+-1|0)/2|0;f=k+(g<<3)|0;if(!(Mo(f,i)|0))break;else{h=d;d=f;f=h}}h=i;b=c[h+4>>2]|0;k=d;c[k>>2]=c[h>>2];c[k+4>>2]=b;Wl(i)}yb=j;return}function Mo(a,b){a=a|0;b=b|0;return (c[a+4>>2]|0)>>>0>(c[b+4>>2]|0)>>>0|0}function No(a){a=a|0;return 536870911}function Oo(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;do if(b)if(b>>>0>536870911){f=O(8)|0;bO(f,37409);c[f>>2]=16392;Q(f|0,13960,22)}else{e=rB(b<<3)|0;break}else e=0;while(0);c[a>>2]=e;d=e+(d<<3)|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+(b<<3);return}function Po(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=c[a>>2]|0;f=a+4|0;g=b+4|0;d=c[f>>2]|0;while(1){if((d|0)==(e|0))break;h=d+-8|0;k=h;j=c[k+4>>2]|0;i=(c[g>>2]|0)+-8|0;c[i>>2]=c[k>>2];c[i+4>>2]=j;c[g>>2]=(c[g>>2]|0)+-8;d=h}i=c[a>>2]|0;c[a>>2]=c[g>>2];c[g>>2]=i;i=b+8|0;k=c[f>>2]|0;c[f>>2]=c[i>>2];c[i>>2]=k;i=a+8|0;k=b+12|0;j=c[i>>2]|0;c[i>>2]=c[k>>2];c[k>>2]=j;c[b>>2]=c[g>>2];return}function Qo(a){a=a|0;var b=0,d=0,e=0;b=c[a+4>>2]|0;d=a+8|0;while(1){e=c[d>>2]|0;if((e|0)==(b|0))break;e=e+-8|0;c[d>>2]=e;Wl(e)}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function Ro(a){a=a|0;return 1073741823}function So(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;do if(b)if(b>>>0>1073741823){f=O(8)|0;bO(f,37409);c[f>>2]=16392;Q(f|0,13960,22)}else{e=rB(b<<2)|0;break}else e=0;while(0);c[a>>2]=e;d=e+(d<<2)|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+(b<<2);return}function To(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[a>>2]|0;h=a+4|0;g=b+4|0;f=(c[h>>2]|0)-e|0;d=(c[g>>2]|0)+(0-(f>>2)<<2)|0;c[g>>2]=d;if((f|0)>0){YO(d|0,e|0,f|0)|0;e=g;d=c[g>>2]|0}else e=g;g=c[a>>2]|0;c[a>>2]=d;c[e>>2]=g;g=b+8|0;f=c[h>>2]|0;c[h>>2]=c[g>>2];c[g>>2]=f;g=a+8|0;h=b+12|0;a=c[g>>2]|0;c[g>>2]=c[h>>2];c[h>>2]=a;c[b>>2]=c[e>>2];return}function Uo(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a+4>>2]|0;d=a+8|0;e=c[d>>2]|0;while(1){if((e|0)==(b|0))break;f=e+-4|0;c[d>>2]=f;e=f}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function Vo(a,b){a=a|0;b=b|0;var d=0;if((No(a)|0)>>>0>>0)CO(a);if(b>>>0>536870911){b=O(8)|0;bO(b,37409);c[b>>2]=16392;Q(b|0,13960,22)}else{d=rB(b<<3)|0;c[a+4>>2]=d;c[a>>2]=d;c[a+8>>2]=d+(b<<3);return}}function Wo(a,b){a=a|0;b=b|0;var d=0;d=a+4|0;a=b;b=c[d>>2]|0;do{Xo(b);b=(c[d>>2]|0)+8|0;c[d>>2]=b;a=a+-1|0}while((a|0)!=0);return}function Xo(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;return}function Yo(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=c[d>>2]|0;e=a+4|0;d=c[b>>2]|0;while(1){if((d|0)==(f|0))break;b=c[e>>2]|0;c[b>>2]=c[d>>2];c[e>>2]=b+4;d=d+4|0}return}function Zo(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;h=a+4|0;i=c[h>>2]|0;f=i-e|0;g=f>>2;a=b+(g<<2)|0;e=i;while(1){if(a>>>0>=d>>>0)break;c[e>>2]=c[a>>2];j=e+4|0;c[h>>2]=j;a=a+4|0;e=j}if(f|0)ZO(i+(0-g<<2)|0,b|0,f|0)|0;return}function _o(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=c[d>>2]|0;d=a+8|0;a=c[b>>2]|0;while(1){if((a|0)==(e|0))break;f=c[d>>2]|0;c[f>>2]=c[a>>2];c[d>>2]=f+4;f=a+4|0;c[b>>2]=f;a=f}return}function $o(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;i=b+4|0;j=c[i>>2]|0;f=c[a>>2]|0;h=d;g=h-f|0;e=j+(0-(g>>2)<<2)|0;c[i>>2]=e;if((g|0)>0)YO(e|0,f|0,g|0)|0;f=a+4|0;g=b+8|0;e=(c[f>>2]|0)-h|0;if((e|0)>0){YO(c[g>>2]|0,d|0,e|0)|0;c[g>>2]=(c[g>>2]|0)+(e>>>2<<2)}h=c[a>>2]|0;c[a>>2]=c[i>>2];c[i>>2]=h;h=c[f>>2]|0;c[f>>2]=c[g>>2];c[g>>2]=h;h=a+8|0;d=b+12|0;a=c[h>>2]|0;c[h>>2]=c[d>>2];c[d>>2]=a;c[b>>2]=c[i>>2];return j|0}function ap(a){a=a|0;return bp(c[c[a>>2]>>2]|0)|0}function bp(a){a=a|0;return c[a+24>>2]|0}function cp(a,b){a=a|0;b=b|0;var d=0,e=0;d=yb;yb=yb+16|0;e=d;c[e>>2]=b;b=km((c[a>>2]|0)+4|0,e)|0;yb=d;return b|0}function dp(a){a=a|0;var b=0,d=0;b=yb;yb=yb+16|0;d=b;ep(d,c[c[a>>2]>>2]|0);a=em(xk(c[d>>2]|0)|0)|0;Pj(d);yb=b;return a|0}function ep(a,b){a=a|0;b=b|0;c[a>>2]=c[b+64>>2];b=c[b+68>>2]|0;c[a+4>>2]=b;if(b|0){a=b+4|0;c[a>>2]=(c[a>>2]|0)+1}return}function fp(a){a=a|0;return gp(c[c[a>>2]>>2]|0)|0}function gp(a){a=a|0;return a+12|0}function hp(b){b=b|0;var d=0,e=0,f=0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;a[b+16>>0]=1;d=b+108|0;e=b+20|0;f=e+88|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(f|0));c[d>>2]=1065353216;f=b+112|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[f+20>>2]=0;return}function ip(a){a=a|0;Vj(a+124|0);eh(a+112|0);jp(a+92|0);return}function jp(a){a=a|0;kp(a);return}function kp(a){a=a|0;var b=0;lp(a,c[a+8>>2]|0);b=c[a>>2]|0;c[a>>2]=0;if(b|0)Nf(b,c[a+4>>2]<<2);return}function lp(a,b){a=a|0;b=b|0;while(1){if(!b)break;a=c[b>>2]|0;Nf(b,16);b=a}return}function mp(b,d,e,g,h,i,j,k,l){b=b|0;d=+d;e=+e;g=+g;h=+h;i=i|0;j=j|0;k=k|0;l=l|0;f[b+20>>2]=d;f[b+24>>2]=e;f[b+28>>2]=g;f[b+32>>2]=h;f[b+36>>2]=-1.0;f[b+40>>2]=1.0;c[b+52>>2]=i;c[b+56>>2]=j;c[b+60>>2]=k;c[b+64>>2]=l;l=B(j,i)|0;c[b+84>>2]=l;c[b+88>>2]=B(l,k)|0;f[b+44>>2]=10.0;f[b+48>>2]=.4342944622039795;a[b+16>>0]=(j|i|0)==0&1;np(b+92|0);return}function np(a){a=a|0;var b=0,d=0,e=0;d=a+12|0;if(c[d>>2]|0){e=a+8|0;lp(a,c[e>>2]|0);c[e>>2]=0;e=c[a+4>>2]|0;b=0;while(1){if((b|0)==(e|0))break;c[(c[a>>2]|0)+(b<<2)>>2]=0;b=b+1|0}c[d>>2]=0}return}function op(b,d,e,g){b=b|0;d=d|0;e=e|0;g=g|0;var 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;t=yb;yb=yb+16|0;p=t+12|0;q=t+8|0;r=t+4|0;s=t;np(b+92|0);if(g|0){j=b+112|0;dh(j,g<<2);k=b+124|0;Tk(k,g);if(a[b+16>>0]|0)pp(b,d,e,g);l=b+68|0;m=b+72|0;n=b+76|0;o=b+80|0;h=0;i=0;while(1){if((i|0)>=(g|0))break;u=i<<2;v=d+(u<<2)|0;u=e+(u<<2)|0;qp(b,p,q,r,s,+f[v>>2],+f[v+4>>2],+f[v+8>>2],+f[v+12>>2],+f[u>>2],+f[u+4>>2],+f[u+8>>2],+f[u+12>>2]);if(rp(b,+f[p>>2],+f[q>>2],+f[r>>2],+f[s>>2])|0){v=(c[j>>2]|0)+(h<<2<<2)|0;c[v>>2]=c[l>>2];c[v+4>>2]=c[m>>2];c[v+8>>2]=c[n>>2];c[v+12>>2]=c[o>>2];c[(c[k>>2]|0)+(h<<2)>>2]=i;h=h+1|0}i=i+1|0}dh(j,h<<2);Tk(k,h)}yb=t;return}function pp(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var g=0,h=0.0,i=0,j=0,k=0,l=0,m=0,n=0,o=0.0;l=yb;yb=yb+16|0;g=l+12|0;k=l;i=a+4|0;j=yj(c[a>>2]|0,c[i>>2]|0)|0;so(k,e);if((e|0)<=0){m=Vf(Vf(NE(Vf(Vf(Vf(56032,33144)|0,33176)|0,35e3)|0,208)|0,35007)|0,33265)|0;GE(g,m+(c[(c[m>>2]|0)+-12>>2]|0)|0);n=VF(g,56736)|0;n=Gb[c[(c[n>>2]|0)+28>>2]&63](n,10)|0;WF(g);OE(m,n)|0;KE(m)|0;ua()}if((c[a>>2]|0)<=0){n=Vf(Vf(NE(Vf(Vf(Vf(56032,33287)|0,33176)|0,35e3)|0,209)|0,35007)|0,33329)|0;GE(g,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(g,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(g);OE(n,m)|0;KE(n)|0;ua()}if((c[i>>2]|0)<=0){n=Vf(Vf(NE(Vf(Vf(Vf(56032,33352)|0,33176)|0,35e3)|0,210)|0,35007)|0,33395)|0;GE(g,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(g,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(g);OE(n,m)|0;KE(n)|0;ua()}h=+(j|0);g=0;while(1){if((g|0)==(e|0))break;n=g<<2;o=+zp(+f[b+(n<<2)+12>>2],+f[d+(n<<2)+12>>2])*h;f[(c[k>>2]|0)+(g<<2)>>2]=o;g=g+1|0}m=c[k>>2]|0;o=+Bp(m,(c[k+4>>2]|0)-m>>2)*.25;m=a+52|0;c[m>>2]=yj(5,~~+A(+((+f[a+24>>2]-+f[a+20>>2])/o)))|0;n=yj(5,~~+A(+((+f[a+32>>2]-+f[a+28>>2])/o)))|0;c[a+56>>2]=n;n=B(c[m>>2]|0,n)|0;c[a+84>>2]=n;c[a+88>>2]=B(c[a+60>>2]|0,n)|0;eh(k);yb=l;return}function qp(a,b,d,e,g,h,i,j,k,l,m,n,o){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=+h;i=+i;j=+j;k=+k;l=+l;m=+m;n=+n;o=+o;var p=0,q=0,r=0,s=0,t=0;s=yb;yb=yb+32|0;q=s+16|0;r=s;n=j-n;f[e>>2]=n;j=n;if(!(j<=-3.141592653589793)){if(j>3.141592653589793){n=j+-6.283185307179586;p=5}}else{n=j+6.283185307179586;p=5}if((p|0)==5)f[e>>2]=n;if(!(n>-3.141592653589793)){p=Vf(Vf(NE(Vf(Vf(Vf(56032,32372)|0,32155)|0,35e3)|0,468)|0,35007)|0,32407)|0;GE(q,p+(c[(c[p>>2]|0)+-12>>2]|0)|0);t=VF(q,56736)|0;t=Gb[c[(c[t>>2]|0)+28>>2]&63](t,10)|0;WF(q);OE(p,t)|0;KE(p)|0;ua()}if(!(n<=3.141592653589793)){t=Vf(Vf(NE(Vf(Vf(Vf(56032,32426)|0,32155)|0,35e3)|0,469)|0,35007)|0,32407)|0;GE(q,t+(c[(c[t>>2]|0)+-12>>2]|0)|0);s=VF(q,56736)|0;s=Gb[c[(c[s>>2]|0)+28>>2]&63](s,10)|0;WF(q);OE(t,s)|0;KE(t)|0;ua()}else{n=+zp(k,o);f[g>>2]=n;Ap(r,+f[e>>2],n);n=+z(+(+f[g>>2]));f[g>>2]=n*+f[a+48>>2];n=+f[r>>2];j=+f[r+4>>2];o=+f[r+8>>2];k=+f[r+12>>2];g=a+8|0;t=a+12|0;f[b>>2]=h-(n*l+j*m)+(n*+f[g>>2]+j*+f[t>>2]);f[d>>2]=i-(o*l+k*m)+(o*+f[g>>2]+k*+f[t>>2]);yb=s;return}}function rp(a,b,d,e,g){a=a|0;b=+b;d=+d;e=+e;g=+g;var h=0,i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,t=0.0,u=0,v=0,w=0,x=0;x=yb;yb=yb+16|0;h=x;t=+f[a+20>>2];if((((((!(t>b)?(m=+f[a+24>>2],!(m<=b)):0)?(n=+f[a+28>>2],!(n>d)):0)?(o=+f[a+32>>2],!(o<=d)):0)?(p=e,!(p<=-3.141592653589793|p>3.141592653589793)):0)?(q=+f[a+36>>2],!(q>g)):0)?(r=+f[a+40>>2],!(r<=g)):0){if(!(t<=b)){l=Vf(Vf(NE(Vf(Vf(Vf(56032,32121)|0,32155)|0,35e3)|0,360)|0,35007)|0,32242)|0;GE(h,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);k=VF(h,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(h);OE(l,k)|0;KE(l)|0;ua()}if(!(m>b)){l=Vf(Vf(NE(Vf(Vf(Vf(56032,32257)|0,32155)|0,35e3)|0,361)|0,35007)|0,32242)|0;GE(h,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);k=VF(h,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(h);OE(l,k)|0;KE(l)|0;ua()}if(!(n<=d)){l=Vf(Vf(NE(Vf(Vf(Vf(56032,32290)|0,32155)|0,35e3)|0,362)|0,35007)|0,32324)|0;GE(h,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);k=VF(h,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(h);OE(l,k)|0;KE(l)|0;ua()}if(!(o>d)){l=Vf(Vf(NE(Vf(Vf(Vf(56032,32339)|0,32155)|0,35e3)|0,363)|0,35007)|0,32324)|0;GE(h,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);k=VF(h,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(h);OE(l,k)|0;KE(l)|0;ua()}if(!(p>-3.141592653589793)){l=Vf(Vf(NE(Vf(Vf(Vf(56032,32372)|0,32155)|0,35e3)|0,364)|0,35007)|0,32407)|0;GE(h,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);k=VF(h,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(h);OE(l,k)|0;KE(l)|0;ua()}if(!(p<=3.141592653589793)){l=Vf(Vf(NE(Vf(Vf(Vf(56032,32426)|0,32155)|0,35e3)|0,365)|0,35007)|0,32407)|0;GE(h,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);k=VF(h,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(h);OE(l,k)|0;KE(l)|0;ua()}if(!(q<=g)){l=Vf(Vf(NE(Vf(Vf(Vf(56032,32461)|0,32155)|0,35e3)|0,366)|0,35007)|0,32503)|0;GE(h,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);k=VF(h,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(h);OE(l,k)|0;KE(l)|0;ua()}if(!(r>g)){l=Vf(Vf(NE(Vf(Vf(Vf(56032,32522)|0,32155)|0,35e3)|0,367)|0,35007)|0,32503)|0;GE(h,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);k=VF(h,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(h);OE(l,k)|0;KE(l)|0;ua()}h=a+68|0;i=a+72|0;l=a+76|0;j=a+80|0;sp(a,h,i,l,j,b,d,e,g);h=~~+s(+(+f[h>>2]+-.5));i=~~+s(+(+f[i>>2]+-.5));l=~~+s(+(+f[l>>2]+-.5));j=~~+s(+(+f[j>>2]+-.5));k=c[a+60>>2]|0;l=(k+l|0)%(k|0)|0;if((((h|0)>=0?(u=h+1|0,!((i|0)<0?1:(u|0)>=(c[a+52>>2]|0))):0)?(v=i+1|0,!((j|0)<0?1:(v|0)>=(c[a+56>>2]|0))):0)?(w=j+1|0,(w|0)<(c[a+64>>2]|0)):0){k=(l+1|0)%(k|0)|0;up(a,tp(a,h,i,l,j)|0,1);up(a,tp(a,u,i,l,j)|0,1);up(a,tp(a,u,v,l,j)|0,1);up(a,tp(a,u,v,k,j)|0,1);up(a,tp(a,u,v,k,w)|0,1);up(a,tp(a,u,v,l,w)|0,1);up(a,tp(a,u,i,k,j)|0,1);up(a,tp(a,u,i,k,w)|0,1);up(a,tp(a,u,i,l,w)|0,1);up(a,tp(a,h,v,l,j)|0,1);up(a,tp(a,h,v,k,j)|0,1);up(a,tp(a,h,v,k,w)|0,1);up(a,tp(a,h,v,l,w)|0,1);up(a,tp(a,h,i,k,j)|0,1);up(a,tp(a,h,i,k,w)|0,1);up(a,tp(a,h,i,l,w)|0,1);h=1}else h=0}else h=0;yb=x;return h|0}function sp(a,b,d,e,g,h,i,j,k){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=+h;i=+i;j=+j;k=+k;var l=0.0,m=0.0;l=+(c[a+52>>2]|0);m=+f[a+20>>2];f[b>>2]=+zp(h-m,+f[a+24>>2]-m)*l;h=+(c[a+56>>2]|0);l=+f[a+28>>2];f[d>>2]=+zp(i-l,+f[a+32>>2]-l)*h;f[e>>2]=(j+3.141592653589793)*.15915494309189535*+(c[a+60>>2]|0);j=+(c[a+64>>2]|0);i=+f[a+36>>2];f[g>>2]=+zp(k-i,+f[a+40>>2]-i)*j;return}function tp(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;k=yb;yb=yb+16|0;h=k;if((b|0)<=-1){j=Vf(Vf(NE(Vf(Vf(Vf(56032,32616)|0,32155)|0,35e3)|0,165)|0,35007)|0,32649)|0;GE(h,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(h,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(h);OE(j,i)|0;KE(j)|0;ua()}g=c[a+52>>2]|0;if((g|0)<=(b|0)){j=Vf(Vf(NE(Vf(Vf(Vf(56032,32667)|0,32155)|0,35e3)|0,166)|0,35007)|0,32649)|0;GE(h,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(h,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(h);OE(j,i)|0;KE(j)|0;ua()}if((d|0)<=-1){j=Vf(Vf(NE(Vf(Vf(Vf(56032,32707)|0,32155)|0,35e3)|0,167)|0,35007)|0,32740)|0;GE(h,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(h,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(h);OE(j,i)|0;KE(j)|0;ua()}i=c[a+56>>2]|0;if((i|0)<=(d|0)){j=Vf(Vf(NE(Vf(Vf(Vf(56032,32758)|0,32155)|0,35e3)|0,168)|0,35007)|0,32740)|0;GE(h,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);l=VF(h,56736)|0;l=Gb[c[(c[l>>2]|0)+28>>2]&63](l,10)|0;WF(h);OE(j,l)|0;KE(j)|0;ua()}if((e|0)<=-1){l=Vf(Vf(NE(Vf(Vf(Vf(56032,32798)|0,32155)|0,35e3)|0,169)|0,35007)|0,32835)|0;GE(h,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);j=VF(h,56736)|0;j=Gb[c[(c[j>>2]|0)+28>>2]&63](j,10)|0;WF(h);OE(l,j)|0;KE(l)|0;ua()}j=c[a+60>>2]|0;if((j|0)<=(e|0)){l=Vf(Vf(NE(Vf(Vf(Vf(56032,32857)|0,32155)|0,35e3)|0,170)|0,35007)|0,32835)|0;GE(h,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);m=VF(h,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(h);OE(l,m)|0;KE(l)|0;ua()}if((f|0)<=-1){m=Vf(Vf(NE(Vf(Vf(Vf(56032,32905)|0,32155)|0,35e3)|0,171)|0,35007)|0,32942)|0;GE(h,m+(c[(c[m>>2]|0)+-12>>2]|0)|0);l=VF(h,56736)|0;l=Gb[c[(c[l>>2]|0)+28>>2]&63](l,10)|0;WF(h);OE(m,l)|0;KE(m)|0;ua()}if((c[a+64>>2]|0)<=(f|0)){m=Vf(Vf(NE(Vf(Vf(Vf(56032,32964)|0,32155)|0,35e3)|0,172)|0,35007)|0,32942)|0;GE(h,m+(c[(c[m>>2]|0)+-12>>2]|0)|0);l=VF(h,56736)|0;l=Gb[c[(c[l>>2]|0)+28>>2]&63](l,10)|0;WF(h);OE(m,l)|0;KE(m)|0;ua()}m=(B(g,d)|0)+b|0;l=(B(c[a+84>>2]|0,e)|0)+m|0;a=l+(B(c[a+88>>2]|0,f)|0)|0;if((a|0)>((B(B(i,g)|0,(B(j,f)|0)+e|0)|0)+m|0)){m=Vf(Vf(NE(Vf(Vf(Vf(56032,33012)|0,32155)|0,35e3)|0,176)|0,35007)|0,32597)|0;GE(h,m+(c[(c[m>>2]|0)+-12>>2]|0)|0);l=VF(h,56736)|0;l=Gb[c[(c[l>>2]|0)+28>>2]&63](l,10)|0;WF(h);OE(m,l)|0;KE(m)|0;ua()}else{yb=k;return a|0}return 0}function up(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,g=0,h=0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=yb;yb=yb+32|0;e=s+8|0;n=s;if((b|0)<=-1){r=Vf(Vf(NE(Vf(Vf(Vf(56032,32563)|0,32155)|0,35e3)|0,290)|0,35007)|0,32597)|0;GE(e,r+(c[(c[r>>2]|0)+-12>>2]|0)|0);q=VF(e,56736)|0;q=Gb[c[(c[q>>2]|0)+28>>2]&63](q,10)|0;WF(e);OE(r,q)|0;KE(r)|0;ua()}r=a+92|0;c[e>>2]=b;g=vp(r,e)|0;if(!g){c[n>>2]=b;c[n+4>>2]=d;p=a+96|0;k=c[p>>2]|0;q=(k|0)==0;a:do if(!q){l=k+-1|0;m=(l&k|0)==0;if(!m)if(k>>>0>b>>>0)d=b;else d=(b>>>0)%(k>>>0)|0;else d=l&b;g=c[(c[r>>2]|0)+(d<<2)>>2]|0;if(!g)o=19;else do{g=c[g>>2]|0;if(!g){o=19;break a}h=c[g+4>>2]|0;if((h|0)!=(b|0)){if(!m){if(h>>>0>=k>>>0)h=(h>>>0)%(k>>>0)|0}else h=h&l;if((h|0)!=(d|0)){o=19;break a}}}while((c[g+8>>2]|0)!=(b|0))}else{d=0;o=19}while(0);if((o|0)==19){wp(e,r,b,n);l=a+104|0;i=+(((c[l>>2]|0)+1|0)>>>0);j=+f[a+108>>2];do if(q|j*+(k>>>0)>>0<3|(k+-1&k|0)!=0)&1;g=~~+A(+(i/j))>>>0;xp(r,d>>>0>>0?g:d);d=c[p>>2]|0;g=d+-1|0;if(!(g&d)){k=d;d=g&b;break}if(d>>>0>b>>>0){k=d;d=b}else{k=d;d=(b>>>0)%(d>>>0)|0}}while(0);g=c[(c[r>>2]|0)+(d<<2)>>2]|0;if(!g){h=a+100|0;c[c[e>>2]>>2]=c[h>>2];c[h>>2]=c[e>>2];c[(c[r>>2]|0)+(d<<2)>>2]=h;h=c[e>>2]|0;d=c[h>>2]|0;if(d){d=c[d+4>>2]|0;g=k+-1|0;if(g&k){if(d>>>0>=k>>>0)d=(d>>>0)%(k>>>0)|0}else d=d&g;c[(c[r>>2]|0)+(d<<2)>>2]=h}}else{c[c[e>>2]>>2]=c[g>>2];c[g>>2]=c[e>>2]}c[l>>2]=(c[l>>2]|0)+1;c[e>>2]=0}}else{r=g+12|0;c[r>>2]=(c[r>>2]|0)+d}yb=s;return}function vp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[b>>2]|0;f=c[a+4>>2]|0;a:do if(f){g=f+-1|0;h=(g&f|0)==0;if(!h)if(e>>>0>>0)d=e;else d=(e>>>0)%(f>>>0)|0;else d=g&e;b=c[(c[a>>2]|0)+(d<<2)>>2]|0;if(b)while(1){b=c[b>>2]|0;if(!b){b=0;break a}a=c[b+4>>2]|0;if((a|0)==(e|0)){if((c[b+8>>2]|0)==(e|0))break a}else{if(!h){if(a>>>0>=f>>>0)a=(a>>>0)%(f>>>0)|0}else a=a&g;if((a|0)!=(d|0)){b=0;break a}}}else b=0}else b=0;while(0);return b|0}function wp(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0;g=rB(16)|0;c[b>>2]=g;c[b+4>>2]=d+8;c[g+8>>2]=c[f>>2];c[g+12>>2]=c[f+4>>2];a[b+8>>0]=1;c[g+4>>2]=e;c[g>>2]=0;return}function xp(a,b){a=a|0;b=b|0;var d=0,e=0,g=0;if((b|0)!=1){if(b+-1&b)b=yD(b)|0}else b=2;e=c[a+4>>2]|0;if(b>>>0<=e>>>0){if(b>>>0>>0){d=~~+A(+(+((c[a+12>>2]|0)>>>0)/+f[a+16>>2]))>>>0;if(e>>>0>2&(e+-1&e|0)==0){g=1<<32-(C(d+-1|0)|0);d=d>>>0<2?d:g}else d=yD(d)|0;b=b>>>0>>0?d:b;if(b>>>0>>0)yp(a,b)}}else yp(a,b);return}function yp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=a+4|0;a:do if(b){if(b>>>0>1073741823){a=O(8)|0;bO(a,37409);c[a>>2]=16392;Q(a|0,13960,22)}l=rB(b<<2)|0;d=c[a>>2]|0;c[a>>2]=l;if(d|0)Nf(d,c[a+4>>2]<<2);c[e>>2]=b;d=0;while(1){if((d|0)==(b|0))break;c[(c[a>>2]|0)+(d<<2)>>2]=0;d=d+1|0}f=a+8|0;d=c[f>>2]|0;if(d|0){e=c[d+4>>2]|0;k=b+-1|0;l=(k&b|0)==0;if(!l){if(e>>>0>=b>>>0)e=(e>>>0)%(b>>>0)|0}else e=e&k;c[(c[a>>2]|0)+(e<<2)>>2]=f;while(1){j=d;b:while(1){while(1){d=c[j>>2]|0;if(!d)break a;f=c[d+4>>2]|0;if(!l){if(f>>>0>=b>>>0)f=(f>>>0)%(b>>>0)|0}else f=f&k;if((f|0)==(e|0))break;g=(c[a>>2]|0)+(f<<2)|0;if(!(c[g>>2]|0))break b;h=d+8|0;g=d;while(1){i=c[g>>2]|0;if(!i)break;if((c[h>>2]|0)==(c[i+8>>2]|0))g=i;else break}c[j>>2]=i;c[g>>2]=c[c[(c[a>>2]|0)+(f<<2)>>2]>>2];c[c[(c[a>>2]|0)+(f<<2)>>2]>>2]=d}j=d}c[g>>2]=j;e=f}}}else{d=c[a>>2]|0;c[a>>2]=0;if(d|0)Nf(d,c[a+4>>2]<<2);c[e>>2]=0}while(0);return}function zp(a,b){a=+a;b=+b;return +(a/(b==0.0?1.0:b))}function Ap(a,b,c){a=a|0;b=+b;c=+c;var d=0.0;d=+w(+b)*c;c=+x(+b)*c;f[a>>2]=d;f[a+4>>2]=-c;f[a+8>>2]=c;f[a+12>>2]=d;return}function Bp(a,b){a=a|0;b=b|0;return +(+Cp(a,b,(b&1)+-1+((b|0)/2|0)|0))}function Cp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,g=0,h=0.0,i=0,j=0.0,k=0,l=0,m=0,n=0,o=0.0,p=0,q=0,r=0;r=yb;yb=yb+16|0;e=r;if((b|0)<=0){q=Vf(Vf(NE(Vf(Vf(Vf(56032,33419)|0,33448)|0,35e3)|0,53)|0,35007)|0,33521)|0;GE(e,q+(c[(c[q>>2]|0)+-12>>2]|0)|0);p=VF(e,56736)|0;p=Gb[c[(c[p>>2]|0)+28>>2]&63](p,10)|0;WF(e);OE(q,p)|0;KE(q)|0;ua()}if((d|0)<=0){q=Vf(Vf(NE(Vf(Vf(Vf(56032,33540)|0,33448)|0,35e3)|0,54)|0,35007)|0,33569)|0;GE(e,q+(c[(c[q>>2]|0)+-12>>2]|0)|0);p=VF(e,56736)|0;p=Gb[c[(c[p>>2]|0)+28>>2]&63](p,10)|0;WF(e);OE(q,p)|0;KE(q)|0;ua()}p=d+-1|0;q=a+(p<<2)|0;m=b+-1|0;n=0;while(1){o=+f[q>>2];if((n|0)>=(m|0))break;e=n;b=m;do{while(1){i=a+(e<<2)|0;j=+f[i>>2];k=e+1|0;if(j>2];l=b+-1|0;if(o>2]=h;f[g>>2]=j;e=k;b=l}}while((e|0)<=(b|0));m=(e|0)<(d|0)?m:b;n=(b|0)<(p|0)?e:n}yb=r;return +o}function Dp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,g=0,h=0;f[b>>2]=0.0;c[d>>2]=-1;a=a+100|0;e=0.0;while(1){a=c[a>>2]|0;if(!a)break;g=a;h=g+12|0;if(e<+((c[h>>2]|0)>>>0)){c[d>>2]=c[g+8>>2];e=+((c[h>>2]|0)>>>0);f[b>>2]=e}}return}function Ep(a){a=a|0;io(a,1760,12);io(a+48|0,1808,12);io(a+96|0,1856,12);io(a+144|0,1904,12);io(a+192|0,1952,12);io(a+240|0,2e3,12);f[a+288>>2]=.10000000149011612;f[a+292>>2]=.17499999701976776;f[a+296>>2]=.25;f[a+300>>2]=.32499998807907104;f[a+304>>2]=.4000000059604645;f[a+308>>2]=.4749999940395355;f[a+312>>2]=.550000011920929;f[a+316>>2]=7.0;return}function Fp(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;dm(b,96);Gp(b,((c[e+4>>2]|0)-(c[e>>2]|0)|0)/20|0);Hp(b,d,e,a,a+48|0,a+96|0,a+144|0,a+192|0,a+240|0,+f[a+288>>2],+f[a+292>>2],+f[a+296>>2],+f[a+300>>2],+f[a+304>>2],+f[a+308>>2],+f[a+312>>2],+f[a+316>>2]);return}function Gp(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;e=yb;yb=yb+16|0;f=e;g=B(c[b>>2]|0,d)|0;a[f>>0]=0;Up(b+4|0,g,f);fm(b+16|0,d);yb=e;return}function Hp(b,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=+l;m=+m;n=+n;o=+o;p=+p;q=+q;r=+r;s=+s;var t=0,u=0,v=0,w=0,x=0,y=0,z=0;z=yb;yb=yb+16|0;x=z;if(!d){y=Vf(Vf(NE(Vf(Vf(Vf(56032,33588)|0,33619)|0,35e3)|0,537)|0,35007)|0,33688)|0;GE(x,y+(c[(c[y>>2]|0)+-12>>2]|0)|0);w=VF(x,56736)|0;w=Gb[c[(c[w>>2]|0)+28>>2]&63](w,10)|0;WF(x);OE(y,w)|0;KE(y)|0;ua()}w=yk(b)|0;y=e+4|0;v=c[y>>2]|0;u=c[e>>2]|0;if((w|0)!=((v-u|0)/20|0|0)){w=Vf(Vf(NE(Vf(Vf(Vf(56032,33704)|0,33619)|0,35e3)|0,538)|0,35007)|0,33757)|0;GE(x,w+(c[(c[w>>2]|0)+-12>>2]|0)|0);t=VF(x,56736)|0;t=Gb[c[(c[t>>2]|0)+28>>2]&63](t,10)|0;WF(x);OE(w,t)|0;KE(w)|0;ua()}w=0;t=0;while(1){u=(v-u|0)/20|0;if(w>>>0>=u>>>0)break;v=Ip(b,t)|0;if(Jp(v,d,(c[e>>2]|0)+(w*20|0)|0,f,g,h,i,j,k,l,m,n,o,p,q,r,s)|0){u=(c[e>>2]|0)+(w*20|0)|0;v=Kp(b,t)|0;c[v>>2]=c[u>>2];c[v+4>>2]=c[u+4>>2];c[v+8>>2]=c[u+8>>2];c[v+12>>2]=c[u+12>>2];a[v+16>>0]=a[u+16>>0]|0;t=t+1|0}w=w+1|0;u=c[e>>2]|0;v=c[y>>2]|0}if((t|0)==(u|0)){Gp(b,t);yb=z;return}else{z=Vf(Vf(NE(Vf(Vf(Vf(56032,33794)|0,33619)|0,35e3)|0,617)|0,35007)|0,33845)|0;GE(x,z+(c[(c[z>>2]|0)+-12>>2]|0)|0);k=VF(x,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(x);OE(z,k)|0;KE(z)|0;ua()}}function Ip(a,b){a=a|0;b=b|0;b=B(c[a>>2]|0,b)|0;return (c[a+4>>2]|0)+b|0}function Jp(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){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;k=+k;l=+l;m=+m;n=+n;o=+o;p=+p;q=+q;var r=0,s=0;s=yb;yb=yb+160|0;r=s;if(Lp(r,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q)|0){Mp(a,r);a=1}else a=0;yb=s;return a|0}function Kp(a,b){a=a|0;b=b|0;return (c[a+16>>2]|0)+(b*20|0)|0}function Lp(a,b,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=+l;m=+m;n=+n;o=+o;p=+p;q=+q;r=+r;s=+s;var t=0,u=0,v=0,w=0.0,x=0.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;t=yb;yb=yb+336|0;aa=t+288|0;y=t+240|0;D=t+192|0;I=t+144|0;N=t+96|0;S=t+48|0;X=t;v=t+328|0;u=t+324|0;x=+f[d+12>>2]*s;x=x<1.0?1.0:x;Op(aa,+f[d>>2],+f[d+4>>2],+f[d+8>>2],x);w=+f[aa+8>>2];s=+f[aa+20>>2];Pp(y,aa,e);C=y+8|0;Pp(C,aa,e+8|0);B=y+16|0;Pp(B,aa,e+16|0);A=y+24|0;Pp(A,aa,e+24|0);z=y+32|0;Pp(z,aa,e+32|0);d=y+40|0;Pp(d,aa,e+40|0);Pp(D,aa,g);H=D+8|0;Pp(H,aa,g+8|0);G=D+16|0;Pp(G,aa,g+16|0);F=D+24|0;Pp(F,aa,g+24|0);E=D+32|0;Pp(E,aa,g+32|0);e=D+40|0;Pp(e,aa,g+40|0);Pp(I,aa,h);M=I+8|0;Pp(M,aa,h+8|0);L=I+16|0;Pp(L,aa,h+16|0);K=I+24|0;Pp(K,aa,h+24|0);J=I+32|0;Pp(J,aa,h+32|0);g=I+40|0;Pp(g,aa,h+40|0);Pp(N,aa,i);R=N+8|0;Pp(R,aa,i+8|0);Q=N+16|0;Pp(Q,aa,i+16|0);P=N+24|0;Pp(P,aa,i+24|0);O=N+32|0;Pp(O,aa,i+32|0);h=N+40|0;Pp(h,aa,i+40|0);Pp(S,aa,j);W=S+8|0;Pp(W,aa,j+8|0);V=S+16|0;Pp(V,aa,j+16|0);U=S+24|0;Pp(U,aa,j+24|0);T=S+32|0;Pp(T,aa,j+32|0);i=S+40|0;Pp(i,aa,j+40|0);Pp(X,aa,k);$=X+8|0;Pp($,aa,k+8|0);_=X+16|0;Pp(_,aa,k+16|0);Z=X+24|0;Pp(Z,aa,k+24|0);Y=X+32|0;Pp(Y,aa,k+32|0);j=X+40|0;Pp(j,aa,k+40|0);Qp(b,v,u,x*r);f[a>>2]=+Rp(b,+f[X>>2],+f[X+4>>2],c[v>>2]|0,c[u>>2]|0);f[a+4>>2]=+Rp(b,+f[$>>2],+f[X+12>>2],c[v>>2]|0,c[u>>2]|0);f[a+8>>2]=+Rp(b,+f[_>>2],+f[X+20>>2],c[v>>2]|0,c[u>>2]|0);f[a+12>>2]=+Rp(b,+f[Z>>2],+f[X+28>>2],c[v>>2]|0,c[u>>2]|0);f[a+16>>2]=+Rp(b,+f[Y>>2],+f[X+36>>2],c[v>>2]|0,c[u>>2]|0);f[a+20>>2]=+Rp(b,+f[j>>2],+f[X+44>>2],c[v>>2]|0,c[u>>2]|0);Qp(b,v,u,x*q);f[a+24>>2]=+Rp(b,+f[S>>2],+f[S+4>>2],c[v>>2]|0,c[u>>2]|0);f[a+28>>2]=+Rp(b,+f[W>>2],+f[S+12>>2],c[v>>2]|0,c[u>>2]|0);f[a+32>>2]=+Rp(b,+f[V>>2],+f[S+20>>2],c[v>>2]|0,c[u>>2]|0);f[a+36>>2]=+Rp(b,+f[U>>2],+f[S+28>>2],c[v>>2]|0,c[u>>2]|0);f[a+40>>2]=+Rp(b,+f[T>>2],+f[S+36>>2],c[v>>2]|0,c[u>>2]|0);f[a+44>>2]=+Rp(b,+f[i>>2],+f[S+44>>2],c[v>>2]|0,c[u>>2]|0);Qp(b,v,u,x*p);f[a+48>>2]=+Rp(b,+f[N>>2],+f[N+4>>2],c[v>>2]|0,c[u>>2]|0);f[a+52>>2]=+Rp(b,+f[R>>2],+f[N+12>>2],c[v>>2]|0,c[u>>2]|0);f[a+56>>2]=+Rp(b,+f[Q>>2],+f[N+20>>2],c[v>>2]|0,c[u>>2]|0);f[a+60>>2]=+Rp(b,+f[P>>2],+f[N+28>>2],c[v>>2]|0,c[u>>2]|0);f[a+64>>2]=+Rp(b,+f[O>>2],+f[N+36>>2],c[v>>2]|0,c[u>>2]|0);f[a+68>>2]=+Rp(b,+f[h>>2],+f[N+44>>2],c[v>>2]|0,c[u>>2]|0);Qp(b,v,u,x*o);f[a+72>>2]=+Rp(b,+f[I>>2],+f[I+4>>2],c[v>>2]|0,c[u>>2]|0);f[a+76>>2]=+Rp(b,+f[M>>2],+f[I+12>>2],c[v>>2]|0,c[u>>2]|0);f[a+80>>2]=+Rp(b,+f[L>>2],+f[I+20>>2],c[v>>2]|0,c[u>>2]|0);f[a+84>>2]=+Rp(b,+f[K>>2],+f[I+28>>2],c[v>>2]|0,c[u>>2]|0);f[a+88>>2]=+Rp(b,+f[J>>2],+f[I+36>>2],c[v>>2]|0,c[u>>2]|0);f[a+92>>2]=+Rp(b,+f[g>>2],+f[I+44>>2],c[v>>2]|0,c[u>>2]|0);Qp(b,v,u,x*n);f[a+96>>2]=+Rp(b,+f[D>>2],+f[D+4>>2],c[v>>2]|0,c[u>>2]|0);f[a+100>>2]=+Rp(b,+f[H>>2],+f[D+12>>2],c[v>>2]|0,c[u>>2]|0);f[a+104>>2]=+Rp(b,+f[G>>2],+f[D+20>>2],c[v>>2]|0,c[u>>2]|0);f[a+108>>2]=+Rp(b,+f[F>>2],+f[D+28>>2],c[v>>2]|0,c[u>>2]|0);f[a+112>>2]=+Rp(b,+f[E>>2],+f[D+36>>2],c[v>>2]|0,c[u>>2]|0);f[a+116>>2]=+Rp(b,+f[e>>2],+f[D+44>>2],c[v>>2]|0,c[u>>2]|0);Qp(b,v,u,x*m);f[a+120>>2]=+Rp(b,+f[y>>2],+f[y+4>>2],c[v>>2]|0,c[u>>2]|0);f[a+124>>2]=+Rp(b,+f[C>>2],+f[y+12>>2],c[v>>2]|0,c[u>>2]|0);f[a+128>>2]=+Rp(b,+f[B>>2],+f[y+20>>2],c[v>>2]|0,c[u>>2]|0);f[a+132>>2]=+Rp(b,+f[A>>2],+f[y+28>>2],c[v>>2]|0,c[u>>2]|0);f[a+136>>2]=+Rp(b,+f[z>>2],+f[y+36>>2],c[v>>2]|0,c[u>>2]|0);f[a+140>>2]=+Rp(b,+f[d>>2],+f[y+44>>2],c[v>>2]|0,c[u>>2]|0);Qp(b,v,u,x*l);f[a+144>>2]=+Rp(b,w,s,c[v>>2]|0,c[u>>2]|0);yb=t;return 1}function Mp(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0;Gl(a,84);c=0;g=0;i=36;j=35;k=36;while(1){if((c|0)==37)break;h=c+1|0;e=b+(c<<2)|0;c=h;d=g;while(1){if((d|0)==(k|0))break;Np(a,d,+f[e>>2]<+f[b+(c<<2)>>2]&1);c=c+1|0;d=d+1|0}e=k+j|0;c=h;g=g+i|0;i=i+-1|0;j=j+-1|0;k=e}return}function Np(b,c,e){b=b|0;c=c|0;e=e|0;b=b+((c|0)/8|0)|0;a[b>>0]=(e&255)<<(c&7)|(d[b>>0]|0);return}function Op(a,b,c,d,e){a=a|0;b=+b;c=+c;d=+d;e=+e;var g=0.0;g=+w(+d)*e;e=+x(+d)*e;f[a>>2]=g;f[a+4>>2]=-e;f[a+8>>2]=b;f[a+12>>2]=e;f[a+16>>2]=g;f[a+20>>2]=c;f[a+24>>2]=0.0;f[a+28>>2]=0.0;f[a+32>>2]=1.0;return}function Pp(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=c+4|0;f[a>>2]=+f[b+8>>2]+(+f[b>>2]*+f[c>>2]+ +f[b+4>>2]*+f[d>>2]);f[a+4>>2]=+f[b+20>>2]+(+f[b+12>>2]*+f[c>>2]+ +f[b+16>>2]*+f[d>>2]);return}function Qp(a,b,d,e){a=a|0;b=b|0;d=d|0;e=+e;var g=0,h=0,i=0,j=0,k=0,l=0,m=0;m=yb;yb=yb+16|0;l=m;g=~~+s(+(+Mi(e)));c[b>>2]=g;e=+z(+(e/+(1<>2]*e);c[d>>2]=g;j=a+20|0;if(((c[j>>2]|0)+-1|0)==(g|0)){c[b>>2]=(c[b>>2]|0)+1;c[d>>2]=0;g=0}h=c[b>>2]|0;if((h|0)>=0){i=c[a+16>>2]|0;if((h|0)<(i|0))h=g;else{c[b>>2]=i+-1;g=(c[j>>2]|0)+-1|0;k=7}}else{c[b>>2]=0;g=0;k=7}if((k|0)==7){c[d>>2]=g;h=g}g=c[b>>2]|0;if((g|0)<=-1){k=Vf(Vf(NE(Vf(Vf(Vf(56032,33865)|0,33900)|0,35e3)|0,268)|0,35007)|0,33993)|0;GE(l,k+(c[(c[k>>2]|0)+-12>>2]|0)|0);b=VF(l,56736)|0;b=Gb[c[(c[b>>2]|0)+28>>2]&63](b,10)|0;WF(l);OE(k,b)|0;KE(k)|0;ua()}if((g|0)>=(c[a+16>>2]|0)){a=Vf(Vf(NE(Vf(Vf(Vf(56032,34017)|0,33900)|0,35e3)|0,269)|0,35007)|0,34061)|0;GE(l,a+(c[(c[a>>2]|0)+-12>>2]|0)|0);k=VF(l,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(l);OE(a,k)|0;KE(a)|0;ua()}if((h|0)<=-1){a=Vf(Vf(NE(Vf(Vf(Vf(56032,34104)|0,33900)|0,35e3)|0,270)|0,35007)|0,34138)|0;GE(l,a+(c[(c[a>>2]|0)+-12>>2]|0)|0);k=VF(l,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(l);OE(a,k)|0;KE(a)|0;ua()}if((h|0)<(c[j>>2]|0)){yb=m;return}else{m=Vf(Vf(NE(Vf(Vf(Vf(56032,34161)|0,33900)|0,35e3)|0,271)|0,35007)|0,34212)|0;GE(l,m+(c[(c[m>>2]|0)+-12>>2]|0)|0);a=VF(l,56736)|0;a=Gb[c[(c[a>>2]|0)+28>>2]&63](a,10)|0;WF(l);OE(m,a)|0;KE(m)|0;ua()}}function Rp(a,b,c,d,e){a=a|0;b=+b;c=+c;d=d|0;e=e|0;var g=0,h=0,i=0;g=yb;yb=yb+16|0;i=g+4|0;h=g;e=Jg(a,d,e)|0;ki(i,h,b,c,d);c=+Sp(e,+f[i>>2],+f[h>>2]);yb=g;return +c}function Sp(a,b,c){a=a|0;b=+b;c=+c;return +(+Tp(a,b,c))}function Tp(a,b,c){a=a|0;b=+b;c=+c;b=+Xh(b,0.0,+(((Lg(a)|0)+-2|0)>>>0));return +(+Ai(a,b,+Xh(c,0.0,+(((Mg(a)|0)+-2|0)>>>0))))}function Up(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=a+4|0;g=c[a>>2]|0;f=(c[e>>2]|0)-g|0;if(f>>>0>=b>>>0){if(f>>>0>b>>>0)c[e>>2]=g+b}else Vp(a,b-f|0,d);return}function Vp(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;k=yb;yb=yb+32|0;h=k;i=b+8|0;j=b+4|0;f=c[j>>2]|0;do if(((c[i>>2]|0)-f|0)>>>0>>0){f=f-(c[b>>2]|0)+d|0;g=kg(b)|0;if(g>>>0>>0)CO(b);else{l=c[b>>2]|0;m=(c[i>>2]|0)-l|0;i=m<<1;lg(h,m>>>0>>1>>>0?(i>>>0>>0?f:i):g,(c[j>>2]|0)-l|0,b+8|0);Wp(h,d,e);mg(b,h);ng(h);break}}else do{a[f>>0]=a[e>>0]|0;f=(c[j>>2]|0)+1|0;c[j>>2]=f;d=d+-1|0}while((d|0)!=0);while(0);yb=k;return}function Wp(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;f=b+8|0;b=d;d=c[f>>2]|0;do{a[d>>0]=a[e>>0]|0;d=(c[f>>2]|0)+1|0;c[f>>2]=d;b=b+-1|0}while((b|0)!=0);return}function Xp(a){a=a|0;var b=0,d=0,e=0;b=yb;yb=yb+272|0;e=b+256|0;d=b;Ta(e|0)|0;Ra(d|0,256,34263,Oa(e|0)|0)|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;eO(a,d,Wf(d)|0);yb=b;return}function Yp(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;c[a+16>>2]=0;c[a+20>>2]=0;c[a+24>>2]=0;c[a+28>>2]=0;return}function Zp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=yb;yb=yb+16|0;f=i;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];c[a+16>>2]=c[b+16>>2];c[a+20>>2]=c[b+20>>2];g=a+24|0;h=c[b+24>>2]|0;c[f>>2]=h;e=f+4|0;b=c[b+28>>2]|0;c[e>>2]=b;if(!b){d=e;b=0}else{d=b+4|0;c[d>>2]=(c[d>>2]|0)+1;d=e;b=c[e>>2]|0}c[f>>2]=c[g>>2];c[g>>2]=h;h=a+28|0;c[d>>2]=c[h>>2];c[h>>2]=b;_p(f);yb=i;return}function _p(a){a=a|0;var b=0,d=0;a=c[a+4>>2]|0;if(a|0?(d=a+4|0,b=c[d>>2]|0,c[d>>2]=b+-1,(b|0)==0):0){Qb[c[(c[a>>2]|0)+8>>2]&255](a);YN(a)}return}function $p(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;c[a+16>>2]=0;c[a+20>>2]=0;c[a+24>>2]=0;c[a+28>>2]=0;Zp(a,b);return}function aq(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 h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;l=yb;yb=yb+32|0;i=l+16|0;j=l+8|0;k=l;if(!d){h=Vf(Vf(NE(Vf(Vf(Vf(56032,34281)|0,34314)|0,35e3)|0,127)|0,35007)|0,34386)|0;GE(i,h+(c[(c[h>>2]|0)+-12>>2]|0)|0);m=VF(i,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(i);OE(h,m)|0;KE(h)|0;ua()}if(!e){m=Vf(Vf(NE(Vf(Vf(Vf(56032,34407)|0,34314)|0,35e3)|0,128)|0,35007)|0,34441)|0;GE(i,m+(c[(c[m>>2]|0)+-12>>2]|0)|0);h=VF(i,56736)|0;h=Gb[c[(c[h>>2]|0)+28>>2]&63](h,10)|0;WF(i);OE(m,h)|0;KE(m)|0;ua()}if(f>>>0>>0){m=Vf(Vf(NE(Vf(Vf(Vf(56032,34463)|0,34314)|0,35e3)|0,129)|0,35007)|0,34500)|0;GE(i,m+(c[(c[m>>2]|0)+-12>>2]|0)|0);h=VF(i,56736)|0;h=Gb[c[(c[h>>2]|0)+28>>2]&63](h,10)|0;WF(i);OE(m,h)|0;KE(m)|0;ua()}if(!g){m=Vf(Vf(NE(Vf(Vf(Vf(56032,34545)|0,34314)|0,35e3)|0,130)|0,35007)|0,34581)|0;GE(i,m+(c[(c[m>>2]|0)+-12>>2]|0)|0);h=VF(i,56736)|0;h=Gb[c[(c[h>>2]|0)+28>>2]&63](h,10)|0;WF(i);OE(m,h)|0;KE(m)|0;ua()}if((f|0)<0)f=B(B(g,d)|0,bq(b)|0)|0;c[a+12>>2]=f;f=B(f,e)|0;h=a+20|0;if((c[h>>2]|0)!=(f|0)?(m=a+24|0,o=sB(f)|0,c[k>>2]=0,c[i>>2]=c[k>>2],cq(j,o,i),o=c[j>>2]|0,c[j>>2]=c[m>>2],c[m>>2]=o,o=j+4|0,k=a+28|0,n=c[o>>2]|0,c[o>>2]=c[k>>2],c[k>>2]=n,_p(j),(c[m>>2]|0)==0):0){o=Vf(Vf(NE(Vf(Vf(Vf(56032,34615)|0,34314)|0,35e3)|0,149)|0,35007)|0,34650)|0;GE(i,o+(c[(c[o>>2]|0)+-12>>2]|0)|0);n=VF(i,56736)|0;n=Gb[c[(c[n>>2]|0)+28>>2]&63](n,10)|0;WF(i);OE(o,n)|0;KE(o)|0;ua()}c[a>>2]=b;c[a+4>>2]=d;c[a+8>>2]=e;c[a+16>>2]=g;c[h>>2]=f;yb=l;return}function bq(a){a=a|0;var b=0,d=0;d=yb;yb=yb+16|0;b=d;switch(a|0){case 1:break;case 2:{a=4;break}default:{d=O(16)|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;eO(b,34774,Wf(34774)|0);kj(d,b);Q(d|0,13208,5)}}yb=d;return a|0}function cq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;d=yb;yb=yb+16|0;e=d;c[a>>2]=b;f=rB(16)|0;c[f+4>>2]=0;c[f+8>>2]=0;c[f>>2]=15768;c[f+12>>2]=b;c[a+4>>2]=f;c[e>>2]=b;c[e+4>>2]=b;dq(a,e);yb=d;return}function dq(a,b){a=a|0;b=b|0;return}function eq(a){a=a|0;XN(a);QA(a);return}function fq(a){a=a|0;QA(c[a+12>>2]|0);return}function gq(a,b){a=a|0;b=b|0;return ((c[b+4>>2]|0)==34671?a+12|0:0)|0}function hq(a){a=a|0;Nf(a,16);return}function iq(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0;j=yb;yb=yb+16|0;k=j+8|0;l=j+4|0;m=j;c[b>>2]=e;c[b+4>>2]=f;c[b+8>>2]=g;c[b+16>>2]=i;c[b+20>>2]=B(h,g)|0;c[m>>2]=0;a[l>>0]=a[j+12>>0]|0;c[k>>2]=c[m>>2];jq(b+24|0,d,l,k);if((h|0)<0)h=B(B(i,f)|0,bq(e)|0)|0;c[b+12>>2]=h;yb=j;return}function jq(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;e=yb;yb=yb+16|0;d=e;c[a>>2]=b;f=rB(16)|0;c[f+4>>2]=0;c[f+8>>2]=0;c[f>>2]=15796;c[f+12>>2]=b;c[a+4>>2]=f;c[d>>2]=b;c[d+4>>2]=b;dq(a,d);yb=e;return}function kq(a,b){a=a|0;b=b|0;return}function lq(a){a=a|0;XN(a);QA(a);return}function mq(a){a=a|0;a=a+12|0;kq(a,c[a>>2]|0);return}function nq(a,b){a=a|0;b=b|0;return ((c[b+4>>2]|0)==34793?a+12|0:0)|0}function oq(a){a=a|0;Nf(a,16);return}function pq(a){a=a|0;_p(a+24|0);return}function qq(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;return}function rq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;f=a+4|0;e=0;while(1){g=c[a>>2]|0;if(e>>>0>=(c[f>>2]|0)-g>>3>>>0)break;g=c[g+(e<<3)>>2]|0;Ub[c[(c[g>>2]|0)+8>>2]&3](g,b,d);e=e+1|0}return}function sq(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=yb;yb=yb+48|0;i=f;h=f+28|0;g=f+16|0;c[i>>2]=e;c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;eO(g,d,Wf(d)|0);tq(h,g,i);rq(a,b,h);hO(h);hO(g);yb=f;return}function tq(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=yb;yb=yb+2048|0;g=f;Hx(g,2048,(a[d+11>>0]|0)<0?c[d>>2]|0:d,e)|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;eO(b,g,Wf(g)|0);yb=f;return}function uq(a){a=a|0;g[a>>3]=-1.0;g[a+8>>3]=-1.0;return}function vq(a){a=a|0;var b=0,d=0;b=yb;yb=yb+16|0;d=b;Ka(d|0,0)|0;g[a>>3]=+(c[d+4>>2]|0)*1.0e-06+ +(c[d>>2]|0);yb=b;return}function wq(a){a=a|0;var b=0,d=0;d=yb;yb=yb+16|0;b=d;if(!(+g[a>>3]>=0.0)){d=Vf(Vf(NE(Vf(Vf(Vf(56032,34888)|0,34927)|0,35e3)|0,67)|0,35007)|0,35010)|0;GE(b,d+(c[(c[d>>2]|0)+-12>>2]|0)|0);a=VF(b,56736)|0;a=Gb[c[(c[a>>2]|0)+28>>2]&63](a,10)|0;WF(b);OE(d,a)|0;KE(d)|0;ua()}else{Ka(b|0,0)|0;g[a+8>>3]=+(c[b+4>>2]|0)*1.0e-06+ +(c[b>>2]|0);yb=d;return}}function xq(a){a=a|0;var b=0.0,d=0,e=0.0,f=0,h=0,i=0;f=yb;yb=yb+16|0;d=f;e=+g[a>>3];if(!(e>=0.0)){h=Vf(Vf(NE(Vf(Vf(Vf(56032,34888)|0,34927)|0,35e3)|0,80)|0,35007)|0,35010)|0;GE(d,h+(c[(c[h>>2]|0)+-12>>2]|0)|0);i=VF(d,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(d);OE(h,i)|0;KE(h)|0;ua()}b=+g[a+8>>3];if(!(b>=0.0)){i=Vf(Vf(NE(Vf(Vf(Vf(56032,35037)|0,34927)|0,35e3)|0,81)|0,35007)|0,35075)|0;GE(d,i+(c[(c[i>>2]|0)+-12>>2]|0)|0);h=VF(d,56736)|0;h=Gb[c[(c[h>>2]|0)+28>>2]&63](h,10)|0;WF(d);OE(i,h)|0;KE(i)|0;ua()}else{yb=f;return +(b-e)}return +(0.0)}function yq(a){a=a|0;return +(+xq(a)*1.0e3)}function zq(a,b){a=a|0;b=b|0;var d=0;uq(a);d=a+16|0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;eO(d,b,Wf(b)|0);vq(a);return}function Aq(b){b=b|0;var d=0,e=0,f=0,h=0,i=0,j=0,k=0,l=0.0;k=yb;yb=yb+48|0;j=k;d=k+24|0;wq(b);f=wk()|0;Xp(d);h=(a[d+11>>0]|0)<0?c[d>>2]|0:d;i=b+16|0;if((a[i+11>>0]|0)<0)e=c[i>>2]|0;else e=i;l=+yq(b);c[j>>2]=35129;c[j+4>>2]=h;c[j+8>>2]=35137;c[j+12>>2]=e;g[j+16>>3]=l;sq(f,8,35102,j);hO(d);hO(i);yb=k;return}function Bq(){Cq();Dq();Eq();return}function Cq(){c[13871]=0;c[13872]=0;c[13873]=0;c[13874]=0;c[13875]=1065353216;return}function Dq(){c[13876]=0;c[13877]=0;c[13878]=0;c[13879]=0;c[13880]=1065353216;return}function Eq(){Fq(0);return}function Fq(a){a=a|0;var b=0;a=yb;yb=yb+16|0;b=a;Hq(35173,26);Jq(35179,67);Jq(35188,68);Mq(35197,20);Mq(35208,21);Mq(35224,22);Qq(35238,23);Jq(35256,69);Tq(35276,70);Hq(35288,27);Qq(35305,24);Hq(35325,28);Hq(35343,29);Qq(35365,25);Qq(35388,26);Jq(35417,71);Jq(35430,72);Jq(35443,73);Hq(35459,30);Qq(35478,27);Qq(35488,28);Qq(35501,29);Jq(35514,74);Jq(35527,75);ir(35546,114);kr(35558,1);mr(35570,1);or(35593,1);mr(35616,2);or(35638,2);sr(35660,40);Jq(35677,76);sr(35694,41);Jq(35707,77);sr(35720,42);Jq(35744,78);zr(35768,3);or(35781,3);sr(35794,43);Jq(35812,79);sr(35830,44);Jq(35846,80);sr(35862,45);Jq(35879,81);Hr(35896,15816);Hr(35925,15820);Hr(35953,15824);c[b>>2]=0;Hr(35986,b);c[b>>2]=1;Hr(36003,b);c[b>>2]=0;Hr(36019,b);c[b>>2]=0;Hr(36041,b);c[b>>2]=1;Hr(36066,b);c[b>>2]=1;Hr(36091,b);c[b>>2]=100;Hr(36116,b);c[b>>2]=0;Hr(36143,b);c[b>>2]=1;Hr(36169,b);c[b>>2]=0;Hr(36195,b);c[b>>2]=0;Hr(36222,b);c[b>>2]=1;Hr(36249,b);c[b>>2]=2;Hr(36275,b);c[b>>2]=3;Hr(36300,b);c[b>>2]=4;Hr(36338,b);c[b>>2]=0;Hr(36375,b);c[b>>2]=0;Hr(36409,b);c[b>>2]=1;Hr(36433,b);c[b>>2]=2;Hr(36459,b);c[b>>2]=2;Hr(36486,b);c[b>>2]=5;Hr(36520,b);g[b>>3]=.5;Ir(36538,b);c[b>>2]=0;Hr(36559,b);c[b>>2]=1;Hr(36578,b);c[b>>2]=2;Hr(36596,b);c[b>>2]=3;Hr(36614,b);c[b>>2]=4;Hr(36633,b);c[b>>2]=3;Hr(36655,b);c[b>>2]=515;Hr(36674,b);c[b>>2]=259;Hr(36703,b);c[b>>2]=4;Hr(36731,b);c[b>>2]=772;Hr(36750,b);c[b>>2]=1028;Hr(36780,b);c[b>>2]=0;Hr(36810,b);c[b>>2]=1;Hr(36841,b);c[b>>2]=2;Hr(36877,b);c[b>>2]=3;Hr(36911,b);c[b>>2]=0;Hr(36949,b);c[b>>2]=1;Hr(36982,b);c[b>>2]=2;Hr(37029,b);c[b>>2]=3;Hr(37071,b);c[b>>2]=4;Hr(37114,b);c[b>>2]=5;Hr(37166,b);c[b>>2]=6;Hr(37217,b);c[b>>2]=7;Hr(37262,b);c[b>>2]=8;Hr(37301,b);c[b>>2]=9;Hr(37346,b);yb=a;return}function Gq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;i=yb;yb=yb+16|0;h=i+8|0;f=i+12|0;g=c[13882]|0;c[13882]=g+1;c[f>>2]=g;g=Sr(55484,f)|0;c[g>>2]=c[f>>2];c[g+208>>2]=a;c[g+212>>2]=b;e=B(a<<2,b)|0;a=g+200|0;c[a>>2]=e;b=g+196|0;c[b>>2]=DO(e)|0;e=g+204|0;c[e>>2]=DO((c[a>>2]|0)/4|0)|0;j=fd()|0;c[g+220>>2]=j;if(!j)Se(0,3,41354,i);wt(c[f>>2]|0,d)|0;c[h>>2]=c[a>>2];Se(0,1,41391,h);za(0,c[g>>2]|0,c[b>>2]|0,c[a>>2]|0,g+344|0,51360,c[e>>2]|0)|0;yb=i;return c[g>>2]|0}function Hq(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=yb;yb=yb+16|0;d=c;e=rt(d)|0;d=st(d)|0;ka(a|0,e|0,d|0,tt()|0,8,b|0);yb=c;return}function Iq(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;g=yb;yb=yb+16|0;d=g;c[d>>2]=a;if(!(Rr(55484,d)|0))a=-1;else{f=Sr(55484,d)|0;a=f+196|0;b=c[a>>2]|0;if(b|0){EO(b);c[a>>2]=0;c[f+200>>2]=0}nt(f);hd(c[f+220>>2]|0)|0;ot(55484,d)|0;b=f+328|0;d=f+332|0;a=0;while(1){e=c[b>>2]|0;if(a>>>0>=(c[d>>2]|0)-e>>3>>>0)break;Me(c[e+(a<<3)+4>>2]|0)|0;a=a+1|0}Xr(b);QA(b);Wr(f);QA(f);a=0}yb=g;return a|0}function Jq(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=yb;yb=yb+16|0;d=c;e=jt(d)|0;d=kt(d)|0;ka(a|0,e|0,d|0,Ls()|0,30,b|0);yb=c;return}function Kq(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;g=yb;yb=yb+16|0;f=g;b=g+4|0;c[b>>2]=a;if(!(Rr(55484,b)|0))a=-1;else{b=Sr(55484,b)|0;e=b+192|0;a=yt(c[e>>2]|0,c[b+472>>2]|0)|0;d=b+236|0;c[d>>2]=a;if(!a){Se(0,3,41323,f);b=b+232|0;Jf(b)|0;a=c[d>>2]|0}else b=b+232|0;We(a,5.0)|0;Ve(c[d>>2]|0,.5)|0;Ye(c[d>>2]|0,16)|0;Xe(c[d>>2]|0,6)|0;Ze(c[d>>2]|0,6)|0;_e(c[d>>2]|0,6)|0;c[b>>2]=it(c[e>>2]|0)|0;a=0}yb=g;return a|0}function Lq(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;g=yb;yb=yb+16|0;f=g;e=g+4|0;c[e>>2]=b;do if(Rr(55484,e)|0){e=Sr(55484,e)|0;if((a[d+11>>0]|0)<0)d=c[d>>2]|0;b=e+340|0;if(!(ht(d,b,e+220|0)|0)){Se(0,3,41233,f);b=-1;break}else{b=c[b>>2]|0;break}}else b=-1;while(0);yb=g;return b|0}function Mq(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=yb;yb=yb+16|0;d=c;e=dt(d)|0;d=et(d)|0;ka(a|0,e|0,d|0,Vs()|0,31,b|0);yb=c;return}function Nq(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=yb;yb=yb+16|0;g=j+8|0;e=j+12|0;i=j;c[e>>2]=b;do if(!(Rr(55484,e)|0))b=-1;else{h=Sr(55484,e)|0;if((a[d+11>>0]|0)<0)b=c[d>>2]|0;else b=d;f=h+224|0;if(!(Zs(b,c[h+216>>2]|0,h+220|0,f)|0)){Se(0,3,41157,g);b=-1;break}b=h+328|0;e=h+332|0;d=c[e>>2]|0;c[i>>2]=d-(c[b>>2]|0)>>3;c[i+4>>2]=c[f>>2];if((c[h+336>>2]|0)==(d|0))_s(b,i);else{f=i;g=c[f+4>>2]|0;h=d;c[h>>2]=c[f>>2];c[h+4>>2]=g;c[e>>2]=(c[e>>2]|0)+8}b=c[i>>2]|0}while(0);yb=j;return b|0}function Oq(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=yb;yb=yb+16|0;h=i;e=i+4|0;c[e>>2]=b;do if(Rr(55484,e)|0){f=Sr(55484,e)|0;g=f+244|0;b=c[g>>2]|0;if((a[d+11>>0]|0)<0)e=c[d>>2]|0;else e=d;if(!(Ys(f,b,e)|0)){Se(0,3,40842,h);b=-1;break}else{c[g>>2]=(c[g>>2]|0)+1;break}}else b=-1;while(0);yb=i;return b|0}function Pq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=yb;yb=yb+16|0;e=g;c[e>>2]=a;if(((Rr(55484,e)|0)!=0?(f=Sr(55484,e)|0,(b|0)>=0):0)?(d=c[f+328>>2]|0,(c[f+332>>2]|0)-d>>3>>>0>b>>>0):0)a=c[(c[d+(b<<3)+4>>2]|0)+4>>2]|0;else a=-1;yb=g;return a|0}function Qq(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=yb;yb=yb+16|0;d=c;e=Ts(d)|0;d=Us(d)|0;ka(a|0,e|0,d|0,Vs()|0,32,b|0);yb=c;return}function Rq(a){a=a|0;var b=0,d=0;d=yb;yb=yb+16|0;b=d;c[b>>2]=a;if(!(Rr(55484,b)|0))a=-1;else{a=Sr(55484,b)|0;a=(c[a+332>>2]|0)-(c[a+328>>2]|0)>>3}yb=d;return a|0}function Sq(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=yb;yb=yb+208|0;h=i+192|0;g=i+184|0;d=i;e=b+11|0;if((a[e>>0]|0)<0)f=c[b>>2]|0;else f=b;if((ie(f,1,d,g)|0)<0){if((a[e>>0]|0)<0)b=c[b>>2]|0;c[h>>2]=b;Se(0,3,40778,h);b=-1}else{b=c[13881]|0;c[13881]=b+1;c[g>>2]=b;YO(Ps(55504,g)|0,d|0,184)|0;b=c[g>>2]|0}yb=i;return b|0}function Tq(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=yb;yb=yb+16|0;d=c;e=Js(d)|0;d=Ks(d)|0;ka(a|0,e|0,d|0,Ls()|0,31,b|0);yb=c;return}function Uq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=yb;yb=yb+16|0;e=f;c[e>>2]=a;do if(Rr(55484,e)|0){a=c[(Sr(55484,e)|0)+216>>2]|0;if((c[a+44>>2]|0)>(b|0)){c[((b|0)<0?54536:a+48+(b<<8)|0)+16>>2]=d;a=0;break}else{a=c[3956]|0;break}}else a=c[3954]|0;while(0);yb=f;return a|0}function Vq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0;e=yb;yb=yb+16|0;d=e;c[d>>2]=a;do if(Rr(55484,d)|0){a=c[(Sr(55484,d)|0)+216>>2]|0;if((c[a+44>>2]|0)>(b|0)){a=(b|0)<0?54536:a+48+(b<<8)|0;n=+g[6420];g[a+168>>3]=n;j=+g[6421];g[a+176>>3]=j;m=+g[6422];g[a+184>>3]=m;i=+g[6423];g[a+192>>3]=i;l=+g[6424];g[a+200>>3]=l;h=+g[6425];g[a+208>>3]=h;k=+g[6426];g[a+216>>3]=k;f=+g[6427];g[a+224>>3]=f;g[a+56>>3]=(n+m+l+k)*.25;g[a+64>>3]=(j+i+h+f)*.25;a=0;break}else{a=c[3956]|0;break}}else a=c[3954]|0;while(0);yb=e;return a|0}function Wq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=yb;yb=yb+16|0;e=f;c[e>>2]=a;do if(Rr(55484,e)|0){a=Sr(55484,e)|0;e=c[a+216>>2]|0;if((c[e+44>>2]|0)>(b|0)){+Sc(c[a+228>>2]|0,(b|0)<0?54536:e+48+(b<<8)|0,+(d|0),51360);a=0;break}else{a=c[3956]|0;break}}else a=c[3954]|0;while(0);yb=f;return a|0}function Xq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=yb;yb=yb+16|0;e=f;c[e>>2]=a;do if(Rr(55484,e)|0){a=Sr(55484,e)|0;e=c[a+216>>2]|0;if((c[e+44>>2]|0)>(b|0)){+Tc(c[a+228>>2]|0,(b|0)<0?54536:e+48+(b<<8)|0,51360,+(d|0),51360);a=0;break}else{a=c[3956]|0;break}}else a=c[3954]|0;while(0);yb=f;return a|0}function Yq(a,b){a=a|0;b=b|0;var d=0,e=0;e=yb;yb=yb+16|0;d=e;c[d>>2]=a;do if(Rr(55484,d)|0){d=Sr(55484,d)|0;a=c[d+328>>2]|0;if((b|0)<0?1:(c[d+332>>2]|0)-a>>3>>>0<=b>>>0){a=c[3955]|0;break}else{a=c[a+(b<<3)+4>>2]|0;b=c[d+216>>2]|0;+Ne(c[d+228>>2]|0,b+48|0,c[b+44>>2]|0,a);Is(a+8|0,51360);a=0;break}}else a=c[3954]|0;while(0);yb=e;return a|0}function Zq(a,b){a=a|0;b=b|0;var d=0,e=0;e=yb;yb=yb+16|0;d=e;c[d>>2]=a;do if(Rr(55484,d)|0){d=Sr(55484,d)|0;a=c[d+328>>2]|0;if((b|0)<0?1:(c[d+332>>2]|0)-a>>3>>>0<=b>>>0){a=c[3955]|0;break}else{a=c[a+(b<<3)+4>>2]|0;b=c[d+216>>2]|0;+Pe(c[d+228>>2]|0,b+48|0,c[b+44>>2]|0,a);Is(a+8|0,51360);a=0;break}}else a=c[3954]|0;while(0);yb=e;return a|0}function _q(a){a=a|0;var b=0,d=0,e=0,f=0;f=yb;yb=yb+48|0;b=f+40|0;e=f;c[b>>2]=a;if(!(Rr(55484,b)|0))a=c[3954]|0;else{a=Sr(55484,b)|0;b=e;d=b+40|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(d|0));c[e>>2]=c[a+196>>2];c[e+16>>2]=1;c[e+12>>2]=c[a+204>>2];a=Kc(c[a+216>>2]|0,e)|0}yb=f;return a|0}function $q(a){a=a|0;var b=0,d=0;d=yb;yb=yb+16|0;b=d;c[b>>2]=a;if(!(Rr(55484,b)|0))a=15816;else a=(c[(Sr(55484,b)|0)+216>>2]|0)+44|0;yb=d;return c[a>>2]|0}function ar(a){a=a|0;var b=0,d=0;d=yb;yb=yb+16|0;b=d;c[b>>2]=a;if(Rr(55484,b)|0)Sr(55484,b)|0;yb=d;return -1}function br(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=yb;yb=yb+16|0;e=f;c[e>>2]=a;do if(Rr(55484,e)|0){e=Sr(55484,e)|0;a=c[e+328>>2]|0;if((b|0)<0?1:(c[e+332>>2]|0)-a>>3>>>0<=b>>>0){a=c[3955]|0;break}a=c[a+(b<<3)+4>>2]|0;if((d|0)<0?1:(c[a+4>>2]|0)<=(d|0)){a=c[3956]|0;break}else{a=c[a>>2]|0;Is(a+(d*320|0)+16|0,51360);ya(1,c[a+(d*320|0)+304>>2]|0,c[a+(d*320|0)>>2]|0,c[a+(d*320|0)+4>>2]|0,+(+g[a+(d*320|0)+8>>3]))|0;a=0;break}}else a=c[3954]|0;while(0);yb=f;return a|0}function cr(a,b){a=a|0;b=b|0;var d=0,e=0;e=yb;yb=yb+16|0;d=e;c[d>>2]=a;do if(Rr(55484,d)|0){a=c[(Sr(55484,d)|0)+216>>2]|0;if((c[a+44>>2]|0)>(b|0)){a=(b|0)<0?54536:a+48+(b<<8)|0;Aa(2,c[a>>2]|0,c[a+4>>2]|0,c[a+8>>2]|0,c[a+12>>2]|0,c[a+16>>2]|0,c[a+20>>2]|0,c[a+24>>2]|0,+(+g[a+32>>3]),+(+g[a+40>>3]),+(+g[a+48>>3]),+(+g[a+56>>3]),+(+g[a+64>>3]),+(+g[a+72>>3]),+(+g[a+80>>3]),+(+g[a+88>>3]),+(+g[a+96>>3]),+(+g[a+104>>3]),+(+g[a+112>>3]),+(+g[a+120>>3]),+(+g[a+128>>3]),+(+g[a+136>>3]),+(+g[a+144>>3]),+(+g[a+152>>3]),+(+g[a+160>>3]),+(+g[a+168>>3]),+(+g[a+176>>3]),+(+g[a+184>>3]),+(+g[a+192>>3]),+(+g[a+200>>3]),+(+g[a+208>>3]),+(+g[a+216>>3]),+(+g[a+224>>3]),c[a+240>>2]|0)|0;a=0;break}else{a=c[3956]|0;break}}else a=c[3954]|0;while(0);yb=e;return a|0}function dr(a,b){a=a|0;b=b|0;var d=0,e=0,g=0.0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;r=yb;yb=yb+80|0;q=r+56|0;p=r+48|0;d=r+72|0;i=r+76|0;e=r+68|0;n=r;o=r+64|0;c[d>>2]=a;do if(!(Rr(55484,d)|0))a=c[3954]|0;else{k=Sr(55484,d)|0;l=k+244|0;if((c[l>>2]|0)<=(b|0)){a=c[3956]|0;break}c[i>>2]=0;c[e>>2]=-1;f[o>>2]=-1.0;m=k+240|0;a=c[m>>2]|0;do if((a|0)==-2){j=k+232|0;wg(c[j>>2]|0,c[k+204>>2]|0)|0;yg(c[j>>2]|0,i,e)|0;e=c[e>>2]|0;j=c[i>>2]|0;a=-1;d=0;while(1){if((d|0)>=(e|0))break;do if((c[j+(d*68|0)+48>>2]|0)==(b|0)?(c[j+(d*68|0)+60>>2]|0)==0:0){if((a|0)==-1)a=c[j+(d*68|0)+52>>2]|0;else{g=+f[j+(d*68|0)+52>>2];if(!(+f[o>>2]>g))break;a=(f[h>>2]=g,c[h>>2]|0)}c[o>>2]=a;a=d}while(0);d=d+1|0}if((a|0)<=-1){c[m>>2]=-2;d=30;break}i=c[j+48>>2]|0;c[m>>2]=i;e=0;while(1){if((e|0)==3)break;d=0;while(1){if((d|0)==4)break;c[n+(e<<4)+(d<<2)>>2]=c[j+(a*68|0)+(e<<4)+(d<<2)>>2];d=d+1|0}e=e+1|0}tf(c[k+248+(i<<2)>>2]|0,n)|0;a=c[m>>2]|0;d=25}else d=25;while(0);do if((d|0)==25)if((a|0)>-1){a=At(c[k+236>>2]|0,c[k+248+(a<<2)>>2]|0,c[k+196>>2]|0,n,o)|0;if((a|0)<0){c[p>>2]=a;Se(0,1,37701,p);c[m>>2]=-2;d=30;break}p=(c[l>>2]|0)+-1|0;c[q>>2]=c[k+248+(c[m>>2]<<2)>>2];c[q+4>>2]=p;Se(0,1,37720,q);if((c[m>>2]|0)>-1)xa(3,b|0,+(+f[o>>2]),+(+f[n>>2]),+(+f[n+4>>2]),+(+f[n+8>>2]),+(+f[n+12>>2]),+(+f[n+16>>2]),+(+f[n+20>>2]),+(+f[n+24>>2]),+(+f[n+28>>2]),+(+f[n+32>>2]),+(+f[n+36>>2]),+(+f[n+40>>2]),+(+f[n+44>>2]))|0;else d=30}else d=30;while(0);if((d|0)==30)wa(4,b|0)|0;a=0}while(0);yb=r;return a|0}function er(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=yb;yb=yb+16|0;e=f;d=f+4|0;c[d>>2]=a;if(!(Rr(55484,d)|0))b=0;else{a=(b|0)!=0;rc(c[(Sr(55484,d)|0)+216>>2]|0,a&1)|0;c[e>>2]=a?37670:37674;Se(0,1,37679,e)}yb=f;return b|0}function fr(a){a=a|0;var b=0,d=0,e=0;e=yb;yb=yb+16|0;b=e;d=e+4|0;c[b>>2]=a;if(!(Rr(55484,b)|0))a=0;else{vc(c[(Sr(55484,b)|0)+216>>2]|0,d)|0;a=c[d>>2]|0}yb=e;return a|0}function gr(a){a=a|0;var b=0,d=0;d=yb;yb=yb+16|0;b=d;c[b>>2]=a;if(!(Rr(55484,b)|0))a=0;else a=c[(c[(Sr(55484,b)|0)+216>>2]|0)+4834148>>2]|0;yb=d;return a|0}function hr(a){a=a|0;c[3916]=a;return}function ir(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=yb;yb=yb+16|0;d=c;e=Ds(d)|0;d=Es(d)|0;ka(a|0,e|0,d|0,Fs()|0,46,b|0);yb=c;return}function jr(){return c[3916]|0}function kr(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=yb;yb=yb+16|0;d=c;e=ys(d)|0;d=zs(d)|0;ka(a|0,e|0,d|0,As()|0,82,b|0);yb=c;return}function lr(a,b){a=a|0;b=+b;var d=0,e=0;e=yb;yb=yb+16|0;d=e;c[d>>2]=a;if(Rr(55484,d)|0)g[(Sr(55484,d)|0)+312>>3]=b;yb=e;return}function mr(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=yb;yb=yb+16|0;d=c;e=ss(d)|0;d=ts(d)|0;ka(a|0,e|0,d|0,us()|0,1,b|0);yb=c;return}function nr(a){a=a|0;var b=0.0,d=0,e=0;e=yb;yb=yb+16|0;d=e;c[d>>2]=a;if(!(Rr(55484,d)|0))b=-1.0;else b=+g[(Sr(55484,d)|0)+312>>3];yb=e;return +b}function or(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=yb;yb=yb+16|0;d=c;e=ns(d)|0;d=os(d)|0;ka(a|0,e|0,d|0,ps()|0,1,b|0);yb=c;return}function pr(a,b){a=a|0;b=+b;var d=0,e=0;e=yb;yb=yb+16|0;d=e;c[d>>2]=a;if(Rr(55484,d)|0)g[(Sr(55484,d)|0)+320>>3]=b;yb=e;return}function qr(a){a=a|0;var b=0.0,d=0,e=0;e=yb;yb=yb+16|0;d=e;c[d>>2]=a;if(!(Rr(55484,d)|0))b=-1.0;else b=+g[(Sr(55484,d)|0)+320>>3];yb=e;return +b}function rr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=yb;yb=yb+16|0;e=f;d=f+4|0;c[d>>2]=a;if(Rr(55484,d)|0?(sc(c[(Sr(55484,d)|0)+216>>2]|0,b)|0)==0:0){c[e>>2]=b;Se(0,1,37628,e)}yb=f;return}function sr(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=yb;yb=yb+16|0;d=c;e=is(d)|0;d=js(d)|0;ka(a|0,e|0,d|0,ks()|0,2,b|0);yb=c;return}function tr(a){a=a|0;var b=0,d=0,e=0;e=yb;yb=yb+16|0;b=e;d=e+4|0;c[b>>2]=a;if(!(Rr(55484,b)|0))a=-1;else{a=(Ac(c[(Sr(55484,b)|0)+216>>2]|0,d)|0)==0;a=a?c[d>>2]|0:-1}yb=e;return a|0}function ur(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=yb;yb=yb+16|0;f=g;d=g+4|0;c[d>>2]=a;if((Rr(55484,d)|0?(e=Sr(55484,d)|0,b>>>0<=255):0)?(yc(c[e+216>>2]|0,b)|0)==0:0){c[f>>2]=b;Se(0,1,37602,f)}yb=g;return}function vr(a){a=a|0;var b=0,d=0,e=0;e=yb;yb=yb+16|0;b=e;d=e+4|0;c[b>>2]=a;if(!(Rr(55484,b)|0))a=-1;else{a=(zc(c[(Sr(55484,b)|0)+216>>2]|0,d)|0)==0;a=a?c[d>>2]|0:-1}yb=e;return a|0}function wr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=yb;yb=yb+16|0;e=f;d=f+4|0;c[d>>2]=a;if(Rr(55484,d)|0?(Dc(c[(Sr(55484,d)|0)+216>>2]|0,b)|0)==0:0){c[e>>2]=b;Se(0,1,37567,e)}yb=f;return}function xr(a){a=a|0;var b=0,d=0,e=0;e=yb;yb=yb+16|0;b=e;d=e+4|0;c[b>>2]=a;if(!(Rr(55484,b)|0))a=-1;else{a=(Gc(c[(Sr(55484,b)|0)+216>>2]|0,d)|0)==0;a=a?c[d>>2]|0:-1}yb=e;return a|0}function yr(a,b){a=a|0;b=+b;var d=0,e=0,f=0,h=0.0,i=0,j=0;j=yb;yb=yb+16|0;i=j;e=j+8|0;c[e>>2]=a;if(((Rr(55484,e)|0?(f=Sr(55484,e)|0,!(b<=0.0|b>=1.0)):0)?(h=b,d=c[f+216>>2]|0,d|0):0)?(Hc(d,h)|0)==0:0){g[i>>3]=h;Se(0,1,37536,i)}yb=j;return}function zr(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=yb;yb=yb+16|0;d=c;e=bs(d)|0;d=cs(d)|0;ka(a|0,e|0,d|0,ds()|0,2,b|0);yb=c;return}function Ar(a){a=a|0;var b=0.0,d=0,e=0,f=0;f=yb;yb=yb+16|0;d=f+8|0;e=f;c[d>>2]=a;if(!(Rr(55484,d)|0))b=-1.0;else{a=c[(Sr(55484,d)|0)+216>>2]|0;if(!a)b=-1.0;else{d=(Ic(a,e)|0)==0;b=d?+g[e>>3]:-1.0}}yb=f;return +b}function Br(a,b){a=a|0;b=b|0;var d=0,e=0;e=yb;yb=yb+16|0;d=e;c[d>>2]=a;if(Rr(55484,d)|0)Ec(c[(Sr(55484,d)|0)+216>>2]|0,b)|0;yb=e;return}function Cr(a){a=a|0;var b=0,d=0,e=0;e=yb;yb=yb+16|0;b=e;d=e+4|0;c[b>>2]=a;if(!(Rr(55484,b)|0))a=-1;else{Fc(c[(Sr(55484,b)|0)+216>>2]|0,d)|0;a=c[d>>2]|0}yb=e;return a|0}function Dr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=yb;yb=yb+16|0;e=f;d=f+4|0;c[d>>2]=a;if(Rr(55484,d)|0?(wc(c[(Sr(55484,d)|0)+216>>2]|0,b)|0)==0:0){c[e>>2]=b;Se(0,1,37506,e)}yb=f;return}function Er(a){a=a|0;var b=0,d=0,e=0;e=yb;yb=yb+16|0;b=e;d=e+4|0;c[b>>2]=a;if(!(Rr(55484,b)|0))a=-1;else{a=(xc(c[(Sr(55484,b)|0)+216>>2]|0,d)|0)==0;a=a?c[d>>2]|0:-1}yb=e;return a|0}function Fr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=yb;yb=yb+16|0;e=f;d=f+4|0;c[d>>2]=a;if(Rr(55484,d)|0?(Bc(c[(Sr(55484,d)|0)+216>>2]|0,b)|0)==0:0){c[e>>2]=b;Se(0,1,37477,e)}yb=f;return}function Gr(a){a=a|0;var b=0,d=0,e=0;e=yb;yb=yb+16|0;b=e;d=e+4|0;c[b>>2]=a;if(!(Rr(55484,b)|0))a=-1;else{a=(Cc(c[(Sr(55484,b)|0)+216>>2]|0,d)|0)==0;a=a?c[d>>2]|0:-1}yb=e;return a|0}function Hr(a,b){a=a|0;b=b|0;var c=0;c=Nr()|0;ha(a|0,c|0,+(+Pr(Or(b)|0)));return}function Ir(a,b){a=a|0;b=b|0;var c=0;c=Jr()|0;ha(a|0,c|0,+(+Lr(+Kr(b))));return}function Jr(){return Mr()|0}function Kr(a){a=a|0;return +(+g[a>>3])}function Lr(a){a=+a;return +a}function Mr(){return 14120}function Nr(){return Qr()|0}function Or(a){a=a|0;return c[a>>2]|0}function Pr(a){a=a|0;return +(+(a|0))}function Qr(){return 14080}function Rr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[b>>2]|0;f=c[a+4>>2]|0;a:do if(f){g=f+-1|0;h=(g&f|0)==0;if(!h)if(e>>>0>>0)d=e;else d=(e>>>0)%(f>>>0)|0;else d=g&e;b=c[(c[a>>2]|0)+(d<<2)>>2]|0;if(b)while(1){b=c[b>>2]|0;if(!b){b=0;break a}a=c[b+4>>2]|0;if((a|0)==(e|0)){if((c[b+8>>2]|0)==(e|0))break a}else{if(!h){if(a>>>0>=f>>>0)a=(a>>>0)%(f>>>0)|0}else a=a&g;if((a|0)!=(d|0)){b=0;break a}}}else b=0}else b=0;while(0);return b|0}function Sr(a,b){a=a|0;b=b|0;var d=0,e=0,g=0.0,h=0.0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=yb;yb=yb+32|0;r=s+4|0;l=s;m=s+16|0;c[l>>2]=b;q=c[b>>2]|0;o=a+4|0;i=c[o>>2]|0;p=(i|0)==0;a:do if(!p){k=i+-1|0;e=(k&i|0)==0;if(!e)if(q>>>0>>0)j=q;else j=(q>>>0)%(i>>>0)|0;else j=k&q;b=c[(c[a>>2]|0)+(j<<2)>>2]|0;if(!b){b=j;n=16}else do{b=c[b>>2]|0;if(!b){b=j;n=16;break a}d=c[b+4>>2]|0;if((d|0)!=(q|0)){if(!e){if(d>>>0>=i>>>0)d=(d>>>0)%(i>>>0)|0}else d=d&k;if((d|0)!=(j|0)){b=j;n=16;break a}}}while((c[b+8>>2]|0)!=(q|0))}else{b=0;n=16}while(0);if((n|0)==16){Tr(r,a,q,57661,l,m);j=a+12|0;g=+(((c[j>>2]|0)+1|0)>>>0);h=+f[a+16>>2];do if(p|h*+(i>>>0)>>0<3|(i+-1&i|0)!=0)&1;d=~~+A(+(g/h))>>>0;Ur(a,b>>>0>>0?d:b);b=c[o>>2]|0;d=b+-1|0;if(!(d&b)){i=b;b=d&q;break}if(q>>>0>>0){i=b;b=q}else{i=b;b=(q>>>0)%(b>>>0)|0}}while(0);d=c[(c[a>>2]|0)+(b<<2)>>2]|0;if(!d){e=a+8|0;c[c[r>>2]>>2]=c[e>>2];c[e>>2]=c[r>>2];c[(c[a>>2]|0)+(b<<2)>>2]=e;e=c[r>>2]|0;b=c[e>>2]|0;if(!b)b=r;else{b=c[b+4>>2]|0;d=i+-1|0;if(d&i){if(b>>>0>=i>>>0)b=(b>>>0)%(i>>>0)|0}else b=b&d;c[(c[a>>2]|0)+(b<<2)>>2]=e;b=r}}else{c[c[r>>2]>>2]=c[d>>2];c[d>>2]=c[r>>2];b=r}r=c[b>>2]|0;c[j>>2]=(c[j>>2]|0)+1;c[b>>2]=0;b=r}yb=s;return b+16|0}function Tr(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;h=rB(496)|0;c[b>>2]=h;c[b+4>>2]=d+8;c[h+8>>2]=c[c[g>>2]>>2];g=h+16|0;_O(g|0,0,480)|0;as(g);a[b+8>>0]=1;c[h+4>>2]=e;c[h>>2]=0;return}function Ur(a,b){a=a|0;b=b|0;var d=0,e=0,g=0;if((b|0)!=1){if(b+-1&b)b=yD(b)|0}else b=2;e=c[a+4>>2]|0;if(b>>>0<=e>>>0){if(b>>>0>>0){d=~~+A(+(+((c[a+12>>2]|0)>>>0)/+f[a+16>>2]))>>>0;if(e>>>0>2&(e+-1&e|0)==0){g=1<<32-(C(d+-1|0)|0);d=d>>>0<2?d:g}else d=yD(d)|0;b=b>>>0>>0?d:b;if(b>>>0>>0)$r(a,b)}}else $r(a,b);return}function Vr(a){a=a|0;Wr(a+8|0);return}function Wr(a){a=a|0;Xr(a+328|0);Yr(a+288|0);return}function Xr(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;d=b;if(b|0){c[a+4>>2]=d;Nf(b,(c[a+8>>2]|0)-d|0)}return}function Yr(a){a=a|0;Zr(a);return}function Zr(a){a=a|0;var b=0;_r(a,c[a+8>>2]|0);b=c[a>>2]|0;c[a>>2]=0;if(b|0)Nf(b,c[a+4>>2]<<2);return}function _r(a,b){a=a|0;b=b|0;while(1){if(!b)break;a=c[b>>2]|0;Nf(b,16);b=a}return}function $r(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=a+4|0;a:do if(b){if(b>>>0>1073741823){a=O(8)|0;bO(a,37409);c[a>>2]=16392;Q(a|0,13960,22)}l=rB(b<<2)|0;d=c[a>>2]|0;c[a>>2]=l;if(d|0)Nf(d,c[a+4>>2]<<2);c[e>>2]=b;d=0;while(1){if((d|0)==(b|0))break;c[(c[a>>2]|0)+(d<<2)>>2]=0;d=d+1|0}f=a+8|0;d=c[f>>2]|0;if(d|0){e=c[d+4>>2]|0;k=b+-1|0;l=(k&b|0)==0;if(!l){if(e>>>0>=b>>>0)e=(e>>>0)%(b>>>0)|0}else e=e&k;c[(c[a>>2]|0)+(e<<2)>>2]=f;while(1){j=d;b:while(1){while(1){d=c[j>>2]|0;if(!d)break a;f=c[d+4>>2]|0;if(!l){if(f>>>0>=b>>>0)f=(f>>>0)%(b>>>0)|0}else f=f&k;if((f|0)==(e|0))break;g=(c[a>>2]|0)+(f<<2)|0;if(!(c[g>>2]|0))break b;h=d+8|0;g=d;while(1){i=c[g>>2]|0;if(!i)break;if((c[h>>2]|0)==(c[i+8>>2]|0))g=i;else break}c[j>>2]=i;c[g>>2]=c[c[(c[a>>2]|0)+(f<<2)>>2]>>2];c[c[(c[a>>2]|0)+(f<<2)>>2]>>2]=d}j=d}c[g>>2]=j;e=f}}}else{d=c[a>>2]|0;c[a>>2]=0;if(d|0)Nf(d,c[a+4>>2]<<2);c[e>>2]=0}while(0);return}function as(a){a=a|0;var b=0;c[a+192>>2]=0;c[a+196>>2]=0;b=a+204|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;c[a+240>>2]=-2;c[a+244>>2]=0;b=a+288|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[a+304>>2]=1065353216;g[a+312>>3]=.0001;g[a+320>>3]=1.0e3;b=a+328|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[a+472>>2]=2;return}function bs(a){a=a|0;return 3}function cs(a){a=a|0;return hs()|0}function ds(){return 37531}function es(a,b,c){a=a|0;b=b|0;c=+c;b=fs(b)|0;c=+gs(c);Rb[a&3](b,c);return}function fs(a){a=a|0;return a|0}function gs(a){a=+a;return +a}function hs(){return 15828}function is(a){a=a|0;return 3}function js(a){a=a|0;return ms()|0}function ks(){return 37623}function ls(a,b,c){a=a|0;b=b|0;c=c|0;b=fs(b)|0;c=fs(c)|0;Sb[a&63](b,c);return}function ms(){return 15840}function ns(a){a=a|0;return 2}function os(a){a=a|0;return rs()|0}function ps(){return 37654}function qs(a,b){a=a|0;b=b|0;var c=0.0,d=0,e=0;d=yb;yb=yb+16|0;e=d;b=fs(b)|0;g[e>>3]=+Bb[a&3](b);c=+Kr(e);yb=d;return +c}function rs(){return 15852}function ss(a){a=a|0;return 3}function ts(a){a=a|0;return xs()|0}function us(){return 37658}function vs(a,b,c){a=a|0;b=b|0;c=+c;b=fs(b)|0;c=+ws(c);Rb[a&3](b,c);return}function ws(a){a=+a;return +a}function xs(){return 15860}function ys(a){a=a|0;return 1}function zs(a){a=a|0;return Cs()|0}function As(){return 37663}function Bs(a){a=a|0;var b=0,d=0;b=yb;yb=yb+16|0;d=b;c[d>>2]=Db[a&1]()|0;a=Or(d)|0;yb=b;return a|0}function Cs(){return 15872}function Ds(a){a=a|0;return 2}function Es(a){a=a|0;return Hs()|0}function Fs(){return 37666}function Gs(a,b){a=a|0;b=b|0;b=fs(b)|0;Qb[a&255](b);return}function Hs(){return 15876}function Is(a,b){a=a|0;b=b|0;var c=0,d=0;d=0;while(1){if((d|0)==3)break;c=0;while(1){if((c|0)==4)break;g[b+(d<<5)+(c<<3)>>3]=+g[a+(d<<5)+(c<<3)>>3];c=c+1|0}d=d+1|0}return}function Js(a){a=a|0;return 2}function Ks(a){a=a|0;return Os()|0}function Ls(){return 40673}function Ms(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=yb;yb=yb+16|0;f=d+12|0;e=d;Ns(e,b);c[f>>2]=Eb[a&127](e)|0;b=Or(f)|0;hO(e);yb=d;return b|0}function Ns(a,b){a=a|0;b=b|0;var d=0;d=c[b>>2]|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;eO(a,b+4|0,d);return}function Os(){return 15884}function Ps(a,b){a=a|0;b=b|0;var d=0,e=0,g=0.0,h=0.0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=yb;yb=yb+32|0;r=s+4|0;l=s;m=s+16|0;c[l>>2]=b;q=c[b>>2]|0;o=a+4|0;i=c[o>>2]|0;p=(i|0)==0;a:do if(!p){k=i+-1|0;e=(k&i|0)==0;if(!e)if(q>>>0>>0)j=q;else j=(q>>>0)%(i>>>0)|0;else j=k&q;b=c[(c[a>>2]|0)+(j<<2)>>2]|0;if(!b){b=j;n=16}else do{b=c[b>>2]|0;if(!b){b=j;n=16;break a}d=c[b+4>>2]|0;if((d|0)!=(q|0)){if(!e){if(d>>>0>=i>>>0)d=(d>>>0)%(i>>>0)|0}else d=d&k;if((d|0)!=(j|0)){b=j;n=16;break a}}}while((c[b+8>>2]|0)!=(q|0))}else{b=0;n=16}while(0);if((n|0)==16){Qs(r,a,q,57661,l,m);j=a+12|0;g=+(((c[j>>2]|0)+1|0)>>>0);h=+f[a+16>>2];do if(p|h*+(i>>>0)>>0<3|(i+-1&i|0)!=0)&1;d=~~+A(+(g/h))>>>0;Rs(a,b>>>0>>0?d:b);b=c[o>>2]|0;d=b+-1|0;if(!(d&b)){i=b;b=d&q;break}if(q>>>0>>0){i=b;b=q}else{i=b;b=(q>>>0)%(b>>>0)|0}}while(0);d=c[(c[a>>2]|0)+(b<<2)>>2]|0;if(!d){e=a+8|0;c[c[r>>2]>>2]=c[e>>2];c[e>>2]=c[r>>2];c[(c[a>>2]|0)+(b<<2)>>2]=e;e=c[r>>2]|0;b=c[e>>2]|0;if(!b)b=r;else{b=c[b+4>>2]|0;d=i+-1|0;if(d&i){if(b>>>0>=i>>>0)b=(b>>>0)%(i>>>0)|0}else b=b&d;c[(c[a>>2]|0)+(b<<2)>>2]=e;b=r}}else{c[c[r>>2]>>2]=c[d>>2];c[d>>2]=c[r>>2];b=r}r=c[b>>2]|0;c[j>>2]=(c[j>>2]|0)+1;c[b>>2]=0;b=r}yb=s;return b+16|0}function Qs(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;h=rB(200)|0;c[b>>2]=h;c[b+4>>2]=d+8;c[h+8>>2]=c[c[g>>2]>>2];_O(h+16|0,0,184)|0;a[b+8>>0]=1;c[h+4>>2]=e;c[h>>2]=0;return}function Rs(a,b){a=a|0;b=b|0;var d=0,e=0,g=0;if((b|0)!=1){if(b+-1&b)b=yD(b)|0}else b=2;e=c[a+4>>2]|0;if(b>>>0<=e>>>0){if(b>>>0>>0){d=~~+A(+(+((c[a+12>>2]|0)>>>0)/+f[a+16>>2]))>>>0;if(e>>>0>2&(e+-1&e|0)==0){g=1<<32-(C(d+-1|0)|0);d=d>>>0<2?d:g}else d=yD(d)|0;b=b>>>0>>0?d:b;if(b>>>0>>0)Ss(a,b)}}else Ss(a,b);return}function Ss(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=a+4|0;a:do if(b){if(b>>>0>1073741823){a=O(8)|0;bO(a,37409);c[a>>2]=16392;Q(a|0,13960,22)}l=rB(b<<2)|0;d=c[a>>2]|0;c[a>>2]=l;if(d|0)Nf(d,c[a+4>>2]<<2);c[e>>2]=b;d=0;while(1){if((d|0)==(b|0))break;c[(c[a>>2]|0)+(d<<2)>>2]=0;d=d+1|0}f=a+8|0;d=c[f>>2]|0;if(d|0){e=c[d+4>>2]|0;k=b+-1|0;l=(k&b|0)==0;if(!l){if(e>>>0>=b>>>0)e=(e>>>0)%(b>>>0)|0}else e=e&k;c[(c[a>>2]|0)+(e<<2)>>2]=f;while(1){j=d;b:while(1){while(1){d=c[j>>2]|0;if(!d)break a;f=c[d+4>>2]|0;if(!l){if(f>>>0>=b>>>0)f=(f>>>0)%(b>>>0)|0}else f=f&k;if((f|0)==(e|0))break;g=(c[a>>2]|0)+(f<<2)|0;if(!(c[g>>2]|0))break b;h=d+8|0;g=d;while(1){i=c[g>>2]|0;if(!i)break;if((c[h>>2]|0)==(c[i+8>>2]|0))g=i;else break}c[j>>2]=i;c[g>>2]=c[c[(c[a>>2]|0)+(f<<2)>>2]>>2];c[c[(c[a>>2]|0)+(f<<2)>>2]>>2]=d}j=d}c[g>>2]=j;e=f}}}else{d=c[a>>2]|0;c[a>>2]=0;if(d|0)Nf(d,c[a+4>>2]<<2);c[e>>2]=0}while(0);return}function Ts(a){a=a|0;return 3}function Us(a){a=a|0;return Xs()|0}function Vs(){return 40837}function Ws(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=yb;yb=yb+16|0;f=e;b=fs(b)|0;d=fs(d)|0;c[f>>2]=Gb[a&63](b,d)|0;d=Or(f)|0;yb=e;return d|0}function Xs(){return 15892}function Ys(a,b,d){a=a|0;b=b|0;d=d|0;var 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;r=yb;yb=yb+96|0;n=r+80|0;m=r+72|0;l=r+64|0;k=r+56|0;j=r+48|0;i=r+40|0;q=r+32|0;p=r+24|0;o=r+16|0;h=r+8|0;s=r;e=r+88|0;f=r+84|0;g=c[a+232>>2]|0;c[e>>2]=0;c[s>>2]=d;Se(0,1,40887,s);do if((Sf(d,40905,f)|0)>=0){c[o>>2]=b;Se(0,1,40949,o);if((Tf(c[f>>2]|0,-1,b)|0)<0){Se(0,3,40974,p);a=0;break}if((Qf(e,f)|0)<0){Se(0,3,41010,q);a=0;break}Se(0,1,41037,i);c[j>>2]=d;Se(0,1,41046,j);s=rf(d,41063,0)|0;c[a+248+(b<<2)>>2]=s;if(!s){c[k>>2]=d;Se(0,3,41068,k)}Se(0,1,41037,l);if((b|0)==10)Ea(-1);if((dg(g,c[e>>2]|0)|0)<0){Se(0,3,41101,m);a=0;break}else{Rf(e)|0;Se(0,1,41126,n);a=1;break}}else{c[h>>2]=d;Se(0,3,40911,h);a=0}while(0);yb=r;return a|0}function Zs(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=yb;yb=yb+16|0;a=Qe(a,c[d>>2]|0)|0;c[e>>2]=a;a:do if(!a){Se(0,3,41206,f);hd(c[d>>2]|0)|0;a=0}else switch(c[a+108>>2]|0){case 0:{Dc(b,0)|0;a=1;break a}case 1:{Dc(b,2)|0;a=1;break a}default:{Dc(b,3)|0;a=1;break a}}while(0);yb=f;return a|0}function _s(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=yb;yb=yb+32|0;d=h;e=a+4|0;f=((c[e>>2]|0)-(c[a>>2]|0)>>3)+1|0;g=$s(a)|0;if(g>>>0>>0)CO(a);else{i=c[a>>2]|0;k=(c[a+8>>2]|0)-i|0;j=k>>2;at(d,k>>3>>>0>>1>>>0?(j>>>0>>0?f:j):g,(c[e>>2]|0)-i>>3,a+8|0);g=d+8|0;e=c[b+4>>2]|0;f=c[g>>2]|0;c[f>>2]=c[b>>2];c[f+4>>2]=e;c[g>>2]=(c[g>>2]|0)+8;bt(a,d);ct(d);yb=h;return}}function $s(a){a=a|0;return 536870911}function at(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;do if(b)if(b>>>0>536870911){f=O(8)|0;bO(f,37409);c[f>>2]=16392;Q(f|0,13960,22)}else{e=rB(b<<3)|0;break}else e=0;while(0);c[a>>2]=e;d=e+(d<<3)|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+(b<<3);return}function bt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[a>>2]|0;h=a+4|0;g=b+4|0;f=(c[h>>2]|0)-e|0;d=(c[g>>2]|0)+(0-(f>>3)<<3)|0;c[g>>2]=d;if((f|0)>0){YO(d|0,e|0,f|0)|0;e=g;d=c[g>>2]|0}else e=g;g=c[a>>2]|0;c[a>>2]=d;c[e>>2]=g;g=b+8|0;f=c[h>>2]|0;c[h>>2]=c[g>>2];c[g>>2]=f;g=a+8|0;h=b+12|0;a=c[g>>2]|0;c[g>>2]=c[h>>2];c[h>>2]=a;c[b>>2]=c[e>>2];return}function ct(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a+4>>2]|0;d=a+8|0;e=c[d>>2]|0;while(1){if((e|0)==(b|0))break;f=e+-8|0;c[d>>2]=f;e=f}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function dt(a){a=a|0;return 3}function et(a){a=a|0;return gt()|0}function ft(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=yb;yb=yb+16|0;g=e+12|0;f=e;b=fs(b)|0;Ns(f,d);c[g>>2]=Gb[a&63](b,f)|0;d=Or(g)|0;hO(f);yb=e;return d|0}function gt(){return 15904}function ht(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;f=yb;yb=yb+16|0;e=f;g=qd(c[d>>2]|0,a)|0;c[b>>2]=g;if((g|0)<0){c[e>>2]=a;Se(0,3,41277,e);hd(c[d>>2]|0)|0;a=0}else a=1;yb=f;return a|0}function it(a){a=a|0;return Hf(a)|0}function jt(a){a=a|0;return 2}function kt(a){a=a|0;return mt()|0}function lt(a,b){a=a|0;b=b|0;var d=0,e=0;d=yb;yb=yb+16|0;e=d;b=fs(b)|0;c[e>>2]=Eb[a&127](b)|0;b=Or(e)|0;yb=d;return b|0}function mt(){return 15916}function nt(a){a=a|0;var b=0,d=0;b=a+216|0;d=c[b>>2]|0;if(d|0){ed(d)|0;uc(c[b>>2]|0)|0;c[b>>2]=0}b=a+228|0;if(c[b>>2]|0){pc(b)|0;c[b>>2]=0}b=a+192|0;if(c[b>>2]|0){le(b)|0;c[b>>2]=0}return}function ot(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=yb;yb=yb+16|0;d=f+4|0;e=f;b=Rr(a,b)|0;if(!b)b=0;else{c[e>>2]=b;c[d>>2]=c[e>>2];pt(a,d)|0;b=1}yb=f;return b|0}function pt(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;g=yb;yb=yb+32|0;h=g+16|0;f=g+4|0;i=g;d=c[d>>2]|0;e=c[d>>2]|0;c[i>>2]=d;c[h>>2]=c[i>>2];qt(f,b,h);d=c[f>>2]|0;c[f>>2]=0;if(d|0){if(a[f+8>>0]|0)Vr(d+8|0);Nf(d,496)}yb=g;return e|0}function qt(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=c[e>>2]|0;l=c[d+4>>2]|0;e=c[o+4>>2]|0;m=l+-1|0;i=(m&l|0)==0;if(!i)if(e>>>0>>0)j=e;else j=(e>>>0)%(l>>>0)|0;else j=m&e;f=(c[d>>2]|0)+(j<<2)|0;n=c[f>>2]|0;while(1){e=c[n>>2]|0;if((e|0)==(o|0))break;else n=e}k=d+8|0;if((n|0)!=(k|0)){e=c[n+4>>2]|0;if(!i){if(e>>>0>=l>>>0)e=(e>>>0)%(l>>>0)|0}else e=e&m;if((e|0)==(j|0))g=o;else h=14}else h=14;do if((h|0)==14){e=c[o>>2]|0;if(e|0){e=c[e+4>>2]|0;if(!i){if(e>>>0>=l>>>0)e=(e>>>0)%(l>>>0)|0}else e=e&m;if((e|0)==(j|0)){g=o;break}}c[f>>2]=0;g=o}while(0);f=c[g>>2]|0;e=f;if(f){f=c[f+4>>2]|0;if(!i){if(f>>>0>=l>>>0)f=(f>>>0)%(l>>>0)|0}else f=f&m;if((f|0)!=(j|0)){c[(c[d>>2]|0)+(f<<2)>>2]=n;e=c[o>>2]|0}}c[n>>2]=e;c[g>>2]=0;d=d+12|0;c[d>>2]=(c[d>>2]|0)+-1;c[b>>2]=o;c[b+4>>2]=k;a[b+8>>0]=1;return}function rt(a){a=a|0;return 4}function st(a){a=a|0;return vt()|0}function tt(){return 41348}function ut(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=yb;yb=yb+16|0;g=f;b=fs(b)|0;d=fs(d)|0;e=fs(e)|0;c[g>>2]=Hb[a&63](b,d,e)|0;e=Or(g)|0;yb=f;return e|0}function vt(){return 2048}function wt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0;m=yb;yb=yb+48|0;l=m+24|0;k=m+16|0;i=m+8|0;f=m;d=m+32|0;e=m+28|0;c[d>>2]=a;c[e>>2]=b;do if((Rr(55484,d)|0)!=0?(j=Sr(55484,d)|0,(xt(55504,e)|0)!=0):0){h=j+8|0;YO(h|0,Ps(55504,e)|0,184)|0;a=c[h>>2]|0;b=j+208|0;d=c[j+12>>2]|0;e=j+212|0;if(!((a|0)==(c[b>>2]|0)?(d|0)==(c[e>>2]|0):0)){c[f>>2]=a;c[f+4>>2]=d;Se(0,2,41698,f);$d(h,c[b>>2]|0,c[e>>2]|0,h)|0}nt(j);a=ke(h,15)|0;d=j+192|0;c[d>>2]=a;if(!a){Se(0,3,41745,i);a=-1;break}a=qc(a)|0;b=j+216|0;c[b>>2]=a;if(!a){Se(0,3,41783,k);a=-1;break}Jc(a,c[j+472>>2]|0)|0;k=nc(h)|0;c[j+228>>2]=k;if(!k){Se(0,3,41820,l);a=-1;break}else{dd(c[b>>2]|0,c[j+220>>2]|0)|0;je(c[d>>2]|0,+g[j+312>>3],+g[j+320>>3],j+344|0);c[j+232>>2]=it(c[d>>2]|0)|0;a=0;break}}else a=-1;while(0);yb=m;return a|0}function xt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[b>>2]|0;f=c[a+4>>2]|0;a:do if(f){g=f+-1|0;h=(g&f|0)==0;if(!h)if(e>>>0>>0)d=e;else d=(e>>>0)%(f>>>0)|0;else d=g&e;b=c[(c[a>>2]|0)+(d<<2)>>2]|0;if(b)while(1){b=c[b>>2]|0;if(!b){b=0;break a}a=c[b+4>>2]|0;if((a|0)==(e|0)){if((c[b+8>>2]|0)==(e|0))break a}else{if(!h){if(a>>>0>=f>>>0)a=(a>>>0)%(f>>>0)|0}else a=a&g;if((a|0)!=(d|0)){b=0;break a}}}else b=0}else b=0;while(0);return b|0}function yt(a,b){a=a|0;b=b|0;b=zt(b,c[a>>2]|0,c[a+4>>2]|0)|0;c[b>>2]=1;c[b+12>>2]=a;a=Ce(a+8|0)|0;c[b+16>>2]=a;Ee(a,0.0)|0;return b|0}function zt(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,g=0;g=yb;yb=yb+16|0;e=DO(13732)|0;if(!e){Se(0,3,41858,g);Ea(1)}c[e+20>>2]=a;c[e+4>>2]=b;c[e+8>>2]=d;c[e+24>>2]=25;c[e+28>>2]=11;c[e+32>>2]=11;c[e+36>>2]=10;f[e+40>>2]=.6000000238418579;f[e+44>>2]=2.0;c[e+13280>>2]=1;d=DO(B(d,b)|0)|0;c[e+13300>>2]=d;if(!d){Se(0,3,41858,g+8|0);Ea(1)}else{c[e+13304>>2]=0;yb=g;return e|0}return 0}function At(a,b,d,e,h){a=a|0;b=b|0;d=d|0;e=e|0;h=h|0;var 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.0;D=yb;yb=yb+48|0;x=D;y=D+40|0;z=D+32|0;a:do if((a|0)!=0&(b|0)!=0&(d|0)!=0&(e|0)!=0&(h|0)!=0){C=b+152|0;if((c[C>>2]|0)<1)i=-2;else{f[h>>2]=0.0;j=b+4|0;B=b+8|0;k=b+56|0;l=b+104|0;i=0;while(1){if((i|0)>=(c[j>>2]|0))break;ud(B,(c[b>>2]|0)+(i*112|0)+12|0,a+48+(i*48|0)|0)|0;if((c[C>>2]|0)>1?(ud(k,(c[b>>2]|0)+(i*112|0)+12|0,a+528+(i*48|0)|0)|0,(c[C>>2]|0)>2):0)ud(l,(c[b>>2]|0)+(i*112|0)+12|0,a+1008+(i*48|0)|0)|0;i=i+1|0}if((c[a>>2]|0)==1){q=a+12|0;r=a+2672|0;n=a+7496|0;Bt(c[q>>2]|0,a+48|0,b,r,n);o=a+4|0;p=a+8|0}else{o=a+4|0;p=a+8|0;r=a+2672|0;n=a+7496|0;Ct(c[o>>2]|0,c[p>>2]|0,a+48|0,b,r,n);q=a+12|0}s=a+36|0;t=a+13280|0;u=b+156|0;v=a+1488|0;w=a+40|0;A=0;i=r;j=0;while(1){if((j|0)>=(c[s>>2]|0))break;m=0;l=A;k=i;while(1){if((m|0)>=(c[t>>2]|0))break;if((j|0)==(c[s>>2]|0))break;i=nf(k,u,l,v,c[o>>2]|0,c[p>>2]|0)|0;if((i|0)<0){if((k|0)!=(r|0))break;i=nf(n,u,l,v,c[o>>2]|0,c[p>>2]|0)|0;if((i|0)<0){k=n;break}else k=n}E=k+(i*24|0)|0;c[x+(m<<2)>>2]=E;c[a+1488+(l<<3)>>2]=c[k+(i*24|0)+16>>2];c[a+1488+(l<<3)+4>>2]=c[k+(i*24|0)+20>>2];c[a+13284+(m*52|0)>>2]=a;c[a+13284+(m*52|0)+4>>2]=b;c[a+13284+(m*52|0)+8>>2]=E;c[a+13284+(m*52|0)+12>>2]=d;i=l+1|0;m=m+1|0;l=(i|0)==5?A:i;j=j+1|0}if(!m)break;l=0;i=A;while(1){if((l|0)==(m|0))break;E=a+13284+(l*52|0)+24|0;A=Jt(c[a+13284+(l*52|0)>>2]|0,c[a+13284+(l*52|0)+4>>2]|0,c[a+13284+(l*52|0)+8>>2]|0,c[a+13284+(l*52|0)+12>>2]|0,c[a+13284+(l*52|0)+16>>2]|0,a+13284+(l*52|0)+20|0,E)|0;c[a+13284+(l*52|0)+48>>2]=A;if((A|0)==0?+f[E>>2]>+f[w>>2]:0){if((c[a>>2]|0)==1){E=c[q>>2]|0;de(E+104|0,+f[a+13284+(l*52|0)+28>>2],+f[a+13284+(l*52|0)+32>>2],y,z,c[E+176>>2]|0)|0;f[a+1872+(i<<3)>>2]=+g[y>>3];f[a+1872+(i<<3)+4>>2]=+g[z>>3]}else{c[a+1872+(i<<3)>>2]=c[a+13284+(l*52|0)+28>>2];c[a+1872+(i<<3)+4>>2]=c[a+13284+(l*52|0)+32>>2]}c[a+2192+(i*12|0)>>2]=c[a+13284+(l*52|0)+36>>2];c[a+2192+(i*12|0)+4>>2]=c[a+13284+(l*52|0)+40>>2];c[a+2192+(i*12|0)+8>>2]=c[a+13284+(l*52|0)+44>>2];E=c[x+(l<<2)>>2]|0;c[a+1488+(i<<3)>>2]=c[E+16>>2];c[a+1488+(i<<3)+4>>2]=c[E+20>>2];c[a+12320+(i*24|0)>>2]=c[E>>2];c[a+12320+(i*24|0)+4>>2]=c[E+4>>2];c[a+12320+(i*24|0)+8>>2]=c[E+8>>2];c[a+12320+(i*24|0)+12>>2]=0;i=i+1|0}l=l+1|0}A=i;i=k}i=0;while(1){if((i|0)>=(A|0))break;E=b+156+(i*24|0)|0;z=a+12320+(i*24|0)|0;c[E>>2]=c[z>>2];c[E+4>>2]=c[z+4>>2];c[E+8>>2]=c[z+8>>2];c[E+12>>2]=c[z+12>>2];c[E+16>>2]=c[z+16>>2];c[E+20>>2]=c[z+20>>2];i=i+1|0}c[b+156+(A*24|0)+12>>2]=-1;i=(A|0)<3;if((c[a>>2]|0)==1){if(i){c[C>>2]=0;i=-3;break}j=a+16|0;k=a+1872|0;l=a+2192|0;F=+Dt(c[j>>2]|0,B,k,l,A,e,0);f[h>>2]=F;i=a+44|0;if((((F>+f[i>>2]?(Ee(c[j>>2]|0,.800000011920929)|0,F=+Dt(c[j>>2]|0,e,k,l,A,e,1),f[h>>2]=F,F>+f[i>>2]):0)?(Ee(c[j>>2]|0,.6000000238418579)|0,F=+Dt(c[j>>2]|0,e,k,l,A,e,1),f[h>>2]=F,F>+f[i>>2]):0)?(Ee(c[j>>2]|0,.4000000059604645)|0,F=+Dt(c[j>>2]|0,e,k,l,A,e,1),f[h>>2]=F,F>+f[i>>2]):0)?(Ee(c[j>>2]|0,0.0)|0,F=+Dt(c[j>>2]|0,e,k,l,A,e,1),f[h>>2]=F,F>+f[i>>2]):0){c[C>>2]=0;i=-4;break}}else{if(i){c[C>>2]=0;i=-3;break}j=a+1872|0;k=a+2192|0;F=+Et(B,j,k,A,e,0,1.0);f[h>>2]=F;i=a+44|0;if((((F>+f[i>>2]?(F=+Et(e,j,k,A,e,1,.800000011920929),f[h>>2]=F,F>+f[i>>2]):0)?(F=+Et(e,j,k,A,e,1,.6000000238418579),f[h>>2]=F,F>+f[i>>2]):0)?(F=+Et(e,j,k,A,e,1,.4000000059604645),f[h>>2]=F,F>+f[i>>2]):0)?(F=+Et(e,j,k,A,e,1,0.0),f[h>>2]=F,F>+f[i>>2]):0){c[C>>2]=0;i=-4;break}}c[C>>2]=(c[C>>2]|0)+1;i=0;while(1){if((i|0)==3)break;j=0;while(1){if((j|0)==4)break;c[b+104+(i<<4)+(j<<2)>>2]=c[b+56+(i<<4)+(j<<2)>>2];j=j+1|0}i=i+1|0}i=0;while(1){if((i|0)==3)break;j=0;while(1){if((j|0)==4)break;c[b+56+(i<<4)+(j<<2)>>2]=c[b+8+(i<<4)+(j<<2)>>2];j=j+1|0}i=i+1|0}i=0;while(1){if((i|0)==3){i=0;break a}j=0;while(1){if((j|0)==4)break;c[b+8+(i<<4)+(j<<2)>>2]=c[e+(i<<4)+(j<<2)>>2];j=j+1|0}i=i+1|0}}}else i=-1;while(0);yb=D;return i|0}function Bt(a,b,d,e,g){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0.0,k=0,l=0,m=0.0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=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.0,L=0,M=0.0,N=0,O=0,P=0,Q=0,R=0.0,S=0.0;Q=yb;yb=yb+80|0;P=Q+48|0;I=Q;J=Q+76|0;L=Q+72|0;N=Q+64|0;O=Q+56|0;q=d+4|0;r=+(c[a>>2]|0);s=+(c[a+4>>2]|0);t=I+4|0;v=I+12|0;w=I+16|0;x=I+20|0;y=I+28|0;z=I+32|0;A=I+36|0;B=I+44|0;C=I+8|0;D=I+24|0;E=I+40|0;F=N+4|0;G=O+4|0;H=g+4812|0;k=0;l=0;p=0;a:while(1){if((p|0)>=(c[q>>2]|0)){i=29;break}i=0;while(1){if((i|0)==3)break;h=0;while(1){if((h|0)==4)break;c[I+(i<<4)+(h<<2)>>2]=c[b+(p*48|0)+(i<<4)+(h<<2)>>2];h=h+1|0}i=i+1|0}h=k;i=l;o=0;k=c[(c[d>>2]|0)+(p*112|0)+4>>2]|0;while(1){if((o|0)>=(c[k+4>>2]|0))break;n=0;l=k;while(1){k=c[l>>2]|0;if((n|0)>=(c[k+(o*20|0)+4>>2]|0))break;l=c[k+(o*20|0)>>2]|0;l=(Bf(a,I,+f[l+(n*20|0)+8>>2],+f[l+(n*20|0)+12>>2],J,L)|0)<0;j=+f[J>>2];do if((!(l|j<0.0)?(m=+f[L>>2],!(m>=s)&(!(j>=r)&!(m<0.0))):0)?(l=c[(c[c[(c[d>>2]|0)+(p*112|0)+4>>2]>>2]|0)+(o*20|0)>>2]|0,K=+f[l+(n*20|0)+8>>2],M=+f[l+(n*20|0)+12>>2],R=+f[v>>2]+(+f[I>>2]*K+ +f[t>>2]*M),j=+f[y>>2]+(K*+f[w>>2]+M*+f[x>>2]),S=+f[B>>2]+(K*+f[z>>2]+M*+f[A>>2]),m=+u(+(R*R+j*j+S*S)),!(+f[E>>2]*(S/m)+(+f[C>>2]*(R/m)+ +f[D>>2]*(j/m))>-.10000000149011612)):0){f[N>>2]=K;f[F>>2]=M;lf(a,I,N,O)|0;j=+f[G>>2];k=c[c[(c[d>>2]|0)+(p*112|0)+4>>2]>>2]|0;m=+f[k+(o*20|0)+12>>2];if(j<=m?j>=+f[k+(o*20|0)+16>>2]:0){if((i|0)==200){i=19;break a}c[e+(i*24|0)>>2]=p;c[e+(i*24|0)+4>>2]=o;c[e+(i*24|0)+8>>2]=n;c[e+(i*24|0)+16>>2]=c[J>>2];c[e+(i*24|0)+20>>2]=c[L>>2];c[e+(i*24|0)+12>>2]=0;i=i+1|0;break}if(j<=m*2.0?j>=+f[k+(o*20|0)+16>>2]*.5:0)if((h|0)==200){c[H>>2]=-1;h=200;break}else{c[g+(h*24|0)>>2]=p;c[g+(h*24|0)+4>>2]=o;c[g+(h*24|0)+8>>2]=n;c[g+(h*24|0)+16>>2]=c[J>>2];c[g+(h*24|0)+20>>2]=c[L>>2];c[g+(h*24|0)+12>>2]=0;h=h+1|0;break}}while(0);n=n+1|0;l=c[(c[d>>2]|0)+(p*112|0)+4>>2]|0}o=o+1|0;k=l}k=h;l=i;p=p+1|0}if((i|0)==19){Se(0,3,41890,P);h=e+4812|0}else if((i|0)==29){c[e+(l*24|0)+12>>2]=-1;h=g+(k*24|0)+12|0}c[h>>2]=-1;yb=Q;return} +function xh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;Hg(a+32|0,b);d=Lg(c[(yh(b)|0)>>2]|0)|0;f=Mg(c[(yh(b)|0)>>2]|0)|0;e=Ng(b)|0;sj(a+92|0,d,f,e,Og(b)|0,36,3.0,1.5,5,.800000011920929);c[a>>2]=Lg(c[(yh(b)|0)>>2]|0)|0;c[a+4>>2]=Mg(c[(yh(b)|0)>>2]|0)|0;e=a+16|0;zh(e,c[a+8>>2]|0);f=a+20|0;a=a+12|0;b=0;while(1){d=c[e>>2]|0;if(b>>>0>=(((c[f>>2]|0)-d|0)/12|0)>>>0)break;Ah(d+(b*12|0)|0,c[a>>2]|0);b=b+1|0}return}function yh(a){a=a|0;return a+4|0}function zh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=a+4|0;d=c[g>>2]|0;f=c[a>>2]|0;e=(d-f|0)/12|0;if(e>>>0>=b>>>0){if(e>>>0>b>>>0){a=f+(b*12|0)|0;while(1){if((d|0)==(a|0))break;f=d+-12|0;ih(f);d=f}c[g>>2]=a}}else Ih(a,b-e|0);return}function Ah(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=a+4|0;d=c[g>>2]|0;f=c[a>>2]|0;e=(d-f|0)/12|0;if(e>>>0>=b>>>0){if(e>>>0>b>>>0){a=f+(b*12|0)|0;while(1){if((d|0)==(a|0))break;f=d+-12|0;jh(f);d=f}c[g>>2]=a}}else Bh(a,b-e|0);return}function Bh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=yb;yb=yb+32|0;f=i;g=a+8|0;h=a+4|0;d=c[h>>2]|0;do if((((c[g>>2]|0)-d|0)/12|0)>>>0>>0){d=((d-(c[a>>2]|0)|0)/12|0)+b|0;e=Dh(a)|0;if(e>>>0>>0)CO(a);else{j=c[a>>2]|0;k=((c[g>>2]|0)-j|0)/12|0;g=k<<1;Eh(f,k>>>0>>1>>>0?(g>>>0>>0?d:g):e,((c[h>>2]|0)-j|0)/12|0,a+8|0);Fh(f,b);Gh(a,f);Hh(f);break}}else Ch(a,b);while(0);yb=i;return}function Ch(a,b){a=a|0;b=b|0;var d=0;a=a+4|0;d=c[a>>2]|0;_O(d|0,0,b*12|0)|0;c[a>>2]=d+(b*12|0);return}function Dh(a){a=a|0;return 357913941}function Eh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;do if(b)if(b>>>0>357913941){f=O(8)|0;bO(f,37409);c[f>>2]=16392;Q(f|0,13960,22)}else{e=rB(b*12|0)|0;break}else e=0;while(0);c[a>>2]=e;d=e+(d*12|0)|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+(b*12|0);return}function Fh(a,b){a=a|0;b=b|0;var d=0;a=a+8|0;d=c[a>>2]|0;_O(d|0,0,b*12|0)|0;c[a>>2]=d+(b*12|0);return}function Gh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=c[a>>2]|0;f=a+4|0;g=b+4|0;d=c[f>>2]|0;while(1){if((d|0)==(e|0))break;k=c[g>>2]|0;i=k+-12|0;h=d+-12|0;c[i>>2]=0;j=k+-8|0;c[j>>2]=0;k=k+-4|0;c[k>>2]=0;c[i>>2]=c[h>>2];i=d+-8|0;c[j>>2]=c[i>>2];j=d+-4|0;c[k>>2]=c[j>>2];c[j>>2]=0;c[i>>2]=0;c[h>>2]=0;c[g>>2]=(c[g>>2]|0)+-12;d=h}i=c[a>>2]|0;c[a>>2]=c[g>>2];c[g>>2]=i;i=b+8|0;k=c[f>>2]|0;c[f>>2]=c[i>>2];c[i>>2]=k;i=a+8|0;k=b+12|0;j=c[i>>2]|0;c[i>>2]=c[k>>2];c[k>>2]=j;c[b>>2]=c[g>>2];return}function Hh(a){a=a|0;var b=0,d=0,e=0;b=c[a+4>>2]|0;d=a+8|0;while(1){e=c[d>>2]|0;if((e|0)==(b|0))break;e=e+-12|0;c[d>>2]=e;jh(e)}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function Ih(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=yb;yb=yb+32|0;f=i;g=a+8|0;h=a+4|0;d=c[h>>2]|0;do if((((c[g>>2]|0)-d|0)/12|0)>>>0>>0){d=((d-(c[a>>2]|0)|0)/12|0)+b|0;e=Kh(a)|0;if(e>>>0>>0)CO(a);else{j=c[a>>2]|0;k=((c[g>>2]|0)-j|0)/12|0;g=k<<1;Lh(f,k>>>0>>1>>>0?(g>>>0>>0?d:g):e,((c[h>>2]|0)-j|0)/12|0,a+8|0);Mh(f,b);Nh(a,f);Oh(f);break}}else Jh(a,b);while(0);yb=i;return}function Jh(a,b){a=a|0;b=b|0;var d=0;a=a+4|0;d=c[a>>2]|0;_O(d|0,0,b*12|0)|0;c[a>>2]=d+(b*12|0);return}function Kh(a){a=a|0;return 357913941}function Lh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;do if(b)if(b>>>0>357913941){f=O(8)|0;bO(f,37409);c[f>>2]=16392;Q(f|0,13960,22)}else{e=rB(b*12|0)|0;break}else e=0;while(0);c[a>>2]=e;d=e+(d*12|0)|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+(b*12|0);return}function Mh(a,b){a=a|0;b=b|0;var d=0;a=a+8|0;d=c[a>>2]|0;_O(d|0,0,b*12|0)|0;c[a>>2]=d+(b*12|0);return}function Nh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=c[a>>2]|0;f=a+4|0;g=b+4|0;d=c[f>>2]|0;while(1){if((d|0)==(e|0))break;k=c[g>>2]|0;i=k+-12|0;h=d+-12|0;c[i>>2]=0;j=k+-8|0;c[j>>2]=0;k=k+-4|0;c[k>>2]=0;c[i>>2]=c[h>>2];i=d+-8|0;c[j>>2]=c[i>>2];j=d+-4|0;c[k>>2]=c[j>>2];c[j>>2]=0;c[i>>2]=0;c[h>>2]=0;c[g>>2]=(c[g>>2]|0)+-12;d=h}i=c[a>>2]|0;c[a>>2]=c[g>>2];c[g>>2]=i;i=b+8|0;k=c[f>>2]|0;c[f>>2]=c[i>>2];c[i>>2]=k;i=a+8|0;k=b+12|0;j=c[i>>2]|0;c[i>>2]=c[k>>2];c[k>>2]=j;c[b>>2]=c[g>>2];return}function Oh(a){a=a|0;var b=0,d=0,e=0;b=c[a+4>>2]|0;d=a+8|0;while(1){e=c[d>>2]|0;if((e|0)==(b|0))break;e=e+-12|0;c[d>>2]=e;ih(e)}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function Ph(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=yb;yb=yb+32|0;d=e;if((Ng(b)|0)<=0){f=Vf(Vf(NE(Vf(Vf(Vf(56032,22918)|0,22676)|0,35e3)|0,147)|0,35007)|0,22967)|0;GE(d,f+(c[(c[f>>2]|0)+-12>>2]|0)|0);g=VF(d,56736)|0;g=Gb[c[(c[g>>2]|0)+28>>2]&63](g,10)|0;WF(d);OE(f,g)|0;KE(f)|0;ua()}zq(d,23866);if(Qh(d)|0)Xg(a+32|0,b);Aq(d);zq(d,23878);if(Qh(d)|0)Rh(a,b,a+32|0);Aq(d);zq(d,23898);if(Qh(d)|0)Sh(a,b);Aq(d);zq(d,23907);if(Qh(d)|0)Th(a);Aq(d);zq(d,23921);if(Qh(d)|0)Uh(a,b);Aq(d);yb=e;return}function Qh(a){a=a|0;return 1}function Rh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,g=0.0,h=0,i=0,j=0.0,k=0,l=0,m=0.0,n=0,o=0,p=0,q=0,r=0,t=0,u=0,v=0,w=0,x=0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.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.0,ga=0,ha=0,ia=0.0;ha=yb;yb=yb+48|0;aa=ha;ca=a+60|0;da=a+64|0;c[da>>2]=c[ca>>2];fa=+hi(+f[a+52>>2]);V=a+32|0;W=aa+12|0;Y=aa+16|0;Z=aa+24|0;_=aa+28|0;$=aa+4|0;F=a+68|0;G=aa+12|0;H=aa+16|0;I=aa+24|0;J=aa+28|0;K=aa+4|0;L=aa+12|0;M=aa+16|0;N=aa+24|0;O=aa+28|0;P=aa+4|0;a=1;a:while(1){if(a>>>0>=((Ii(V)|0)+-1|0)>>>0){ga=3;break}Q=Ji(d,a+-1|0)|0;R=Ji(d,a)|0;S=a+1|0;T=Ji(d,S)|0;U=Ki(d,a)|0;E=Li(d,a)|0;D=Lg(Q)|0;b:do if((D|0)==(Lg(R)|0)?(D=Lg(Q)|0,(D|0)==(Lg(T)|0)):0){D=Mg(Q)|0;if((D|0)!=(Mg(R)|0)){ga=7;break a}D=Mg(Q)|0;if((D|0)!=(Mg(T)|0)){ga=9;break a}k=(Lg(R)|0)+-1|0;l=(Mg(R)|0)+-1|0;m=+(E|0);a=1;while(1){if(a>>>0>=l>>>0)break b;v=a+-1|0;n=ah(Q,v)|0;o=ah(Q,a)|0;p=a+1|0;q=ah(Q,p)|0;r=ah(R,v)|0;t=ah(R,a)|0;u=ah(R,p)|0;v=ah(T,v)|0;w=ah(T,a)|0;x=ah(T,p)|0;j=+(a>>>0);i=1;while(1){if(i>>>0>=k>>>0)break;a=t+(i<<2)|0;do if(!(+hi(+f[a>>2])>2];h=i+-1|0;e=+f[n+(h<<2)>>2];do if(((((g>e?g>+f[n+(i<<2)>>2]:0)?(X=i+1|0,g>+f[n+(X<<2)>>2]):0)?g>+f[o+(h<<2)>>2]:0)?g>+f[o+(i<<2)>>2]:0)?g>+f[o+(X<<2)>>2]:0){if(!(g>+f[q+(h<<2)>>2])){ga=42;break}if(!(g>+f[q+(i<<2)>>2])){ga=42;break}if(!(g>+f[q+(X<<2)>>2])){ga=42;break}if(!(g>+f[r+(h<<2)>>2])){ga=42;break}if(!(g>+f[r+(i<<2)>>2])){ga=42;break}if(!(g>+f[r+(X<<2)>>2])){ga=42;break}if(!(g>+f[t+(h<<2)>>2])){ga=42;break}if(!(g>+f[t+(X<<2)>>2])){ga=42;break}if(!(g>+f[u+(h<<2)>>2])){ga=42;break}if(!(g>+f[u+(i<<2)>>2])){ga=42;break}if(!(g>+f[u+(X<<2)>>2])){ga=42;break}if(!(g>+f[v+(h<<2)>>2])){ga=42;break}if(!(g>+f[v+(i<<2)>>2])){ga=42;break}if(!(g>+f[v+(X<<2)>>2])){ga=42;break}if(!(g>+f[w+(h<<2)>>2])){ga=42;break}if(!(g>+f[w+(i<<2)>>2])){ga=42;break}if(!(g>+f[w+(X<<2)>>2])){ga=42;break}if(!(g>+f[x+(h<<2)>>2])){ga=42;break}if(!(g>+f[x+(i<<2)>>2])){ga=42;break}if(!(g>+f[x+(X<<2)>>2]))ga=42}else ga=42;while(0);if((ga|0)==42){ga=0;if(!(g>2]))break;a=i+1|0;if(!(g<+f[n+(a<<2)>>2]))break;if(!(g<+f[o+(h<<2)>>2]))break;if(!(g<+f[o+(i<<2)>>2]))break;if(!(g<+f[o+(a<<2)>>2]))break;if(!(g<+f[q+(h<<2)>>2]))break;if(!(g<+f[q+(i<<2)>>2]))break;if(!(g<+f[q+(a<<2)>>2]))break;if(!(g<+f[r+(h<<2)>>2]))break;if(!(g<+f[r+(i<<2)>>2]))break;if(!(g<+f[r+(a<<2)>>2]))break;if(!(g<+f[t+(h<<2)>>2]))break;if(!(g<+f[t+(a<<2)>>2]))break;if(!(g<+f[u+(h<<2)>>2]))break;if(!(g<+f[u+(i<<2)>>2]))break;if(!(g<+f[u+(a<<2)>>2]))break;if(!(g<+f[v+(h<<2)>>2]))break;if(!(g<+f[v+(i<<2)>>2]))break;if(!(g<+f[v+(a<<2)>>2]))break;if(!(g<+f[w+(h<<2)>>2]))break;if(!(g<+f[w+(i<<2)>>2]))break;if(!(g<+f[w+(a<<2)>>2]))break;if(!(g<+f[x+(h<<2)>>2]))break;if(!(g<+f[x+(i<<2)>>2]))break;if(!(g<+f[x+(a<<2)>>2]))break}c[W>>2]=U;c[Y>>2]=E;f[Z>>2]=g;f[_>>2]=+qi(b,U,m);pi(aa,$,+(i>>>0),j,U);a=c[da>>2]|0;if((a|0)==(c[F>>2]|0)){Yh(ca,aa);break}else{h=aa;D=a+36|0;do{c[a>>2]=c[h>>2];a=a+4|0;h=h+4|0}while((a|0)<(D|0));c[da>>2]=(c[da>>2]|0)+36;break}}while(0);i=i+1|0}a=p}}else ga=72;while(0);c:do if((ga|0)==72){ga=0;D=Lg(Q)|0;if((D|0)==(Lg(R)|0)?(D=(Lg(R)|0)>>>1,(D|0)==(Lg(T)|0)):0){D=Mg(Q)|0;if((D|0)!=(Mg(R)|0)){ga=75;break a}D=(Mg(R)|0)>>>1;if((D|0)!=(Mg(T)|0)){ga=77;break a}l=~~+s(+((+(((Lg(T)|0)+-1|0)>>>0)+-.5)*2.0+.5))>>>0;n=~~+s(+((+(((Mg(T)|0)+-1|0)>>>0)+-.5)*2.0+.5))>>>0;C=+(E|0);a=2;while(1){if(a>>>0>=n>>>0)break c;t=a+-1|0;o=ah(Q,t)|0;p=ah(Q,a)|0;q=a+1|0;r=ah(Q,q)|0;t=ah(R,t)|0;u=ah(R,a)|0;v=ah(R,q)|0;y=+(a>>>0);z=y*.5+-.25;A=z+-.5;B=z+.5;k=2;while(1){if(k>>>0>=l>>>0)break;i=u+(k<<2)|0;do if(!(+hi(+f[i>>2])>>0);m=j*.5+-.25;e=+f[i>>2];h=k+-1|0;a=o+(h<<2)|0;do if(((e>+f[a>>2]?e>+f[o+(k<<2)>>2]:0)?(ba=k+1|0,e>+f[o+(ba<<2)>>2]):0)?e>+f[p+(h<<2)>>2]:0){if(!(e>+f[p+(k<<2)>>2])){ga=110;break}if(!(e>+f[p+(ba<<2)>>2])){ga=110;break}if(!(e>+f[r+(h<<2)>>2])){ga=110;break}if(!(e>+f[r+(k<<2)>>2])){ga=110;break}if(!(e>+f[r+(ba<<2)>>2])){ga=110;break}if(!(e>+f[t+(h<<2)>>2])){ga=110;break}if(!(e>+f[t+(k<<2)>>2])){ga=110;break}if(!(e>+f[t+(ba<<2)>>2])){ga=110;break}if(!(e>+f[u+(h<<2)>>2])){ga=110;break}if(!(e>+f[u+(ba<<2)>>2])){ga=110;break}if(!(e>+f[v+(h<<2)>>2])){ga=110;break}if(!(e>+f[v+(k<<2)>>2])){ga=110;break}if(!(e>+f[v+(ba<<2)>>2])){ga=110;break}g=m+-.5;if(!(e>+Ai(T,g,A))){ga=110;break}e=+f[i>>2];if(!(e>+Ai(T,m,A))){ga=110;break}ia=+f[i>>2];e=m+.5;if(!(ia>+Ai(T,e,A))){ga=110;break}ia=+f[i>>2];if(!(ia>+Ai(T,g,z))){ga=110;break}ia=+f[i>>2];if(!(ia>+Ai(T,m,z))){ga=110;break}ia=+f[i>>2];if(!(ia>+Ai(T,e,z))){ga=110;break}ia=+f[i>>2];if(!(ia>+Ai(T,g,B))){ga=110;break}ia=+f[i>>2];if(!(ia>+Ai(T,m,B))){ga=110;break}ia=+f[i>>2];if(!(ia>+Ai(T,e,B)))ga=110}else ga=110;while(0);if((ga|0)==110){ga=0;e=+f[i>>2];if(!(e<+f[a>>2]))break;if(!(e<+f[o+(k<<2)>>2]))break;a=k+1|0;if(!(e<+f[o+(a<<2)>>2]))break;if(!(e<+f[p+(h<<2)>>2]))break;if(!(e<+f[p+(k<<2)>>2]))break;if(!(e<+f[p+(a<<2)>>2]))break;if(!(e<+f[r+(h<<2)>>2]))break;if(!(e<+f[r+(k<<2)>>2]))break;if(!(e<+f[r+(a<<2)>>2]))break;if(!(e<+f[t+(h<<2)>>2]))break;if(!(e<+f[t+(k<<2)>>2]))break;if(!(e<+f[t+(a<<2)>>2]))break;if(!(e<+f[u+(h<<2)>>2]))break;if(!(e<+f[u+(a<<2)>>2]))break;if(!(e<+f[v+(h<<2)>>2]))break;if(!(e<+f[v+(k<<2)>>2]))break;if(!(e<+f[v+(a<<2)>>2]))break;g=m+-.5;if(!(e<+Ai(T,g,A)))break;ia=+f[i>>2];if(!(ia<+Ai(T,m,A)))break;ia=+f[i>>2];e=m+.5;if(!(ia<+Ai(T,e,A)))break;ia=+f[i>>2];if(!(ia<+Ai(T,g,z)))break;ia=+f[i>>2];if(!(ia<+Ai(T,m,z)))break;ia=+f[i>>2];if(!(ia<+Ai(T,e,z)))break;ia=+f[i>>2];if(!(ia<+Ai(T,g,B)))break;ia=+f[i>>2];if(!(ia<+Ai(T,m,B)))break;ia=+f[i>>2];if(!(ia<+Ai(T,e,B)))break}c[G>>2]=U;c[H>>2]=E;c[I>>2]=c[i>>2];f[J>>2]=+qi(b,U,C);pi(aa,K,j,y,U);a=c[da>>2]|0;if((a|0)==(c[F>>2]|0)){Yh(ca,aa);break}else{h=aa;D=a+36|0;do{c[a>>2]=c[h>>2];a=a+4|0;h=h+4|0}while((a|0)<(D|0));c[da>>2]=(c[da>>2]|0)+36;break}}while(0);k=k+1|0}a=q}}D=(Lg(Q)|0)>>>1;if((D|0)==(Lg(R)|0)?(D=(Lg(Q)|0)>>>1,(D|0)==(Lg(T)|0)):0){D=(Mg(Q)|0)>>>1;if((D|0)!=(Mg(R)|0)){ga=144;break a}D=(Mg(Q)|0)>>>1;if((D|0)!=(Mg(T)|0)){ga=146;break a}l=(Lg(R)|0)+-1|0;n=(Mg(R)|0)+-1|0;A=+(E|0);a=1;while(1){if(a>>>0>=n>>>0)break c;t=a+-1|0;o=ah(R,t)|0;p=ah(R,a)|0;q=a+1|0;r=ah(R,q)|0;t=ah(T,t)|0;u=ah(T,a)|0;v=ah(T,q)|0;B=+(a<<1>>>0)+.5;m=+(a>>>0);y=B+-2.0;z=B+2.0;k=1;while(1){if(k>>>0>=l>>>0)break;i=p+(k<<2)|0;do if(!(+hi(+f[i>>2])>>0)+.5;e=+f[i>>2];h=k+-1|0;a=o+(h<<2)|0;do if(((e>+f[a>>2]?e>+f[o+(k<<2)>>2]:0)?(ea=k+1|0,e>+f[o+(ea<<2)>>2]):0)?e>+f[p+(h<<2)>>2]:0){if(!(e>+f[p+(ea<<2)>>2])){ga=179;break}if(!(e>+f[r+(h<<2)>>2])){ga=179;break}if(!(e>+f[r+(k<<2)>>2])){ga=179;break}if(!(e>+f[r+(ea<<2)>>2])){ga=179;break}if(!(e>+f[t+(h<<2)>>2])){ga=179;break}if(!(e>+f[t+(k<<2)>>2])){ga=179;break}if(!(e>+f[t+(ea<<2)>>2])){ga=179;break}if(!(e>+f[u+(h<<2)>>2])){ga=179;break}if(!(e>+f[u+(k<<2)>>2])){ga=179;break}if(!(e>+f[u+(ea<<2)>>2])){ga=179;break}if(!(e>+f[v+(h<<2)>>2])){ga=179;break}if(!(e>+f[v+(k<<2)>>2])){ga=179;break}if(!(e>+f[v+(ea<<2)>>2])){ga=179;break}g=j+-2.0;if(!(e>+Ai(Q,g,y))){ga=179;break}ia=+f[i>>2];if(!(ia>+Ai(Q,j,y))){ga=179;break}ia=+f[i>>2];e=j+2.0;if(!(ia>+Ai(Q,e,y))){ga=179;break}ia=+f[i>>2];if(!(ia>+Ai(Q,g,B))){ga=179;break}ia=+f[i>>2];if(!(ia>+Ai(Q,j,B))){ga=179;break}ia=+f[i>>2];if(!(ia>+Ai(Q,e,B))){ga=179;break}ia=+f[i>>2];if(!(ia>+Ai(Q,g,z))){ga=179;break}ia=+f[i>>2];if(!(ia>+Ai(Q,j,z))){ga=179;break}ia=+f[i>>2];if(!(ia>+Ai(Q,e,z)))ga=179}else ga=179;while(0);if((ga|0)==179){ga=0;e=+f[i>>2];if(!(e<+f[a>>2]))break;if(!(e<+f[o+(k<<2)>>2]))break;a=k+1|0;if(!(e<+f[o+(a<<2)>>2]))break;if(!(e<+f[p+(h<<2)>>2]))break;if(!(e<+f[p+(a<<2)>>2]))break;if(!(e<+f[r+(h<<2)>>2]))break;if(!(e<+f[r+(k<<2)>>2]))break;if(!(e<+f[r+(a<<2)>>2]))break;if(!(e<+f[t+(h<<2)>>2]))break;if(!(e<+f[t+(k<<2)>>2]))break;if(!(e<+f[t+(a<<2)>>2]))break;if(!(e<+f[u+(h<<2)>>2]))break;if(!(e<+f[u+(k<<2)>>2]))break;if(!(e<+f[u+(a<<2)>>2]))break;if(!(e<+f[v+(h<<2)>>2]))break;if(!(e<+f[v+(k<<2)>>2]))break;if(!(e<+f[v+(a<<2)>>2]))break;g=j+-2.0;if(!(e<+Ai(Q,g,y)))break;ia=+f[i>>2];if(!(ia<+Ai(Q,j,y)))break;ia=+f[i>>2];e=j+2.0;if(!(ia<+Ai(Q,e,y)))break;ia=+f[i>>2];if(!(ia<+Ai(Q,g,B)))break;ia=+f[i>>2];if(!(ia<+Ai(Q,j,B)))break;ia=+f[i>>2];if(!(ia<+Ai(Q,e,B)))break;ia=+f[i>>2];if(!(ia<+Ai(Q,g,z)))break;ia=+f[i>>2];if(!(ia<+Ai(Q,j,z)))break;ia=+f[i>>2];if(!(ia<+Ai(Q,e,z)))break}c[L>>2]=U;c[M>>2]=E;c[N>>2]=c[i>>2];f[O>>2]=+qi(b,U,A);pi(aa,P,+(k>>>0),m,U);a=c[da>>2]|0;if((a|0)==(c[F>>2]|0)){Yh(ca,aa);break}else{h=aa;D=a+36|0;do{c[a>>2]=c[h>>2];a=a+4|0;h=h+4|0}while((a|0)<(D|0));c[da>>2]=(c[da>>2]|0)+36;break}}while(0);k=k+1|0}a=q}}}while(0);a=S}if((ga|0)==3){yb=ha;return}else if((ga|0)==7){ha=Vf(Vf(NE(Vf(Vf(Vf(56032,26651)|0,22676)|0,35e3)|0,192)|0,35007)|0,26703)|0;GE(aa,ha+(c[(c[ha>>2]|0)+-12>>2]|0)|0);ga=VF(aa,56736)|0;ga=Gb[c[(c[ga>>2]|0)+28>>2]&63](ga,10)|0;WF(aa);OE(ha,ga)|0;KE(ha)|0;ua()}else if((ga|0)==9){ha=Vf(Vf(NE(Vf(Vf(Vf(56032,26726)|0,22676)|0,35e3)|0,193)|0,35007)|0,26703)|0;GE(aa,ha+(c[(c[ha>>2]|0)+-12>>2]|0)|0);ga=VF(aa,56736)|0;ga=Gb[c[(c[ga>>2]|0)+28>>2]&63](ga,10)|0;WF(aa);OE(ha,ga)|0;KE(ha)|0;ua()}else if((ga|0)==75){ha=Vf(Vf(NE(Vf(Vf(Vf(56032,26651)|0,22676)|0,35e3)|0,277)|0,35007)|0,26703)|0;GE(aa,ha+(c[(c[ha>>2]|0)+-12>>2]|0)|0);ga=VF(aa,56736)|0;ga=Gb[c[(c[ga>>2]|0)+28>>2]&63](ga,10)|0;WF(aa);OE(ha,ga)|0;KE(ha)|0;ua()}else if((ga|0)==77){ha=Vf(Vf(NE(Vf(Vf(Vf(56032,26778)|0,22676)|0,35e3)|0,278)|0,35007)|0,26703)|0;GE(aa,ha+(c[(c[ha>>2]|0)+-12>>2]|0)|0);ga=VF(aa,56736)|0;ga=Gb[c[(c[ga>>2]|0)+28>>2]&63](ga,10)|0;WF(aa);OE(ha,ga)|0;KE(ha)|0;ua()}else if((ga|0)==144){ha=Vf(Vf(NE(Vf(Vf(Vf(56032,26835)|0,22676)|0,35e3)|0,362)|0,35007)|0,26703)|0;GE(aa,ha+(c[(c[ha>>2]|0)+-12>>2]|0)|0);ga=VF(aa,56736)|0;ga=Gb[c[(c[ga>>2]|0)+28>>2]&63](ga,10)|0;WF(aa);OE(ha,ga)|0;KE(ha)|0;ua()}else if((ga|0)==146){ha=Vf(Vf(NE(Vf(Vf(Vf(56032,26892)|0,22676)|0,35e3)|0,363)|0,35007)|0,26703)|0;GE(aa,ha+(c[(c[ha>>2]|0)+-12>>2]|0)|0);ga=VF(aa,56736)|0;ga=Gb[c[(c[ga>>2]|0)+28>>2]&63](ga,10)|0;WF(aa);OE(ha,ga)|0;KE(ha)|0;ua()}}function Sh(a,b){a=a|0;b=b|0;var d=0,e=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.0,u=0.0,v=0.0,w=0.0,x=0,y=0,z=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0.0,M=0.0,N=0.0;J=yb;yb=yb+80|0;I=J+68|0;A=J;C=J+56|0;D=J+44|0;E=J+40|0;F=J+36|0;s=+hi(+f[a+52>>2]);H=a+56|0;w=+hi(+f[H>>2]+1.0);w=w/+f[H>>2];H=a+60|0;x=a+64|0;y=a+32|0;z=D+4|0;o=a+88|0;p=C+4|0;q=C+8|0;r=D+8|0;m=0;n=0;while(1){l=c[H>>2]|0;i=l;if(n>>>0>=(((c[x>>2]|0)-l|0)/36|0)>>>0){a=3;break}d=i+(n*36|0)|0;a=i+(n*36|0)+16|0;l=c[a>>2]|0;if((l|0)>=(ji(y)|0)){a=5;break}j=i+(n*36|0)+12|0;l=c[j>>2]|0;l=B(ji(y)|0,l)|0;l=l+(c[a>>2]|0)|0;k=i+(n*36|0)+4|0;ki(E,F,+f[d>>2],+f[k>>2],c[j>>2]|0);e=~~(+f[E>>2]+.5);g=~~(+f[F>>2]+.5);K=(c[(li(y)|0)>>2]|0)+(l+-1<<5)|0;h=(c[(li(y)|0)>>2]|0)+(l<<5)|0;if(((mi(A,C,K,h,(c[(li(y)|0)>>2]|0)+(l+1<<5)|0,e,g)|0?ni(D,A,C)|0:0)?(L=+hi(+f[D>>2]),L=L+ +hi(+f[z>>2]),!(L>+f[o>>2])):0)?(G=i+(n*36|0)+32|0,oi(G,A)|0):0){l=i+(n*36|0)+24|0;L=+f[l>>2];if(!(L==+f[(ah(h,g)|0)+(e<<2)>>2])){a=11;break}N=+f[(ah(h,g)|0)+(e<<2)>>2];M=+f[D>>2];L=+f[z>>2];f[l>>2]=N-(+f[C>>2]*M+ +f[p>>2]*L+ +f[q>>2]*+f[r>>2]);pi(d,k,M+ +f[E>>2],L+ +f[F>>2],c[j>>2]|0);L=+f[r>>2]+ +(c[a>>2]|0);a=i+(n*36|0)+20|0;f[a>>2]=L;f[a>>2]=+Xh(L,0.0,+(ji(y)|0));if(((((+t(+(+f[G>>2]))>2])>=s:0)?(u=+f[d>>2],u>=0.0):0)?u<+((Lg(c[(li(y)|0)>>2]|0)|0)>>>0):0)?(v=+f[k>>2],v>=0.0):0)?v<+((Mg(c[(li(y)|0)>>2]|0)|0)>>>0):0){f[i+(n*36|0)+28>>2]=+qi(b,c[j>>2]|0,+f[a>>2]);a=m+1|0;g=(c[H>>2]|0)+(m*36|0)|0;e=g+36|0;do{c[g>>2]=c[d>>2];g=g+4|0;d=d+4|0}while((g|0)<(e|0))}else a=m}else a=m;m=a;n=n+1|0}if((a|0)==3){ii(H,m);yb=J;return}else if((a|0)==5){K=Vf(Vf(NE(Vf(Vf(Vf(56032,24248)|0,22676)|0,35e3)|0,489)|0,35007)|0,24320)|0;GE(I,K+(c[(c[K>>2]|0)+-12>>2]|0)|0);J=VF(I,56736)|0;J=Gb[c[(c[J>>2]|0)+28>>2]&63](J,10)|0;WF(I);OE(K,J)|0;KE(K)|0;ua()}else if((a|0)==11){K=Vf(Vf(NE(Vf(Vf(Vf(56032,24357)|0,22676)|0,35e3)|0,526)|0,35007)|0,24414)|0;GE(I,K+(c[(c[K>>2]|0)+-12>>2]|0)|0);J=VF(I,56736)|0;J=Gb[c[(c[J>>2]|0)+28>>2]&63](J,10)|0;WF(I);OE(K,J)|0;KE(K)|0;ua()}}function Th(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;l=yb;yb=yb+16|0;d=l+12|0;h=l;i=a+60|0;j=a+64|0;k=a+84|0;e=c[k>>2]|0;do if((((c[j>>2]|0)-(c[i>>2]|0)|0)/36|0)>>>0>e>>>0){f=a+16|0;b=c[f>>2]|0;g=((c[a+20>>2]|0)-b|0)/12|0;if((g|0)!=(c[a+8>>2]|0)){m=Vf(Vf(NE(Vf(Vf(Vf(56032,23939)|0,22676)|0,35e3)|0,454)|0,35007)|0,23994)|0;GE(d,m+(c[(c[m>>2]|0)+-12>>2]|0)|0);n=VF(d,56736)|0;n=Gb[c[(c[n>>2]|0)+28>>2]&63](n,10)|0;WF(d);OE(m,n)|0;KE(m)|0;ua()}b=((c[b+4>>2]|0)-(c[b>>2]|0)|0)/12|0;if((b|0)!=(c[a+12>>2]|0)){n=Vf(Vf(NE(Vf(Vf(Vf(56032,24020)|0,22676)|0,35e3)|0,455)|0,35007)|0,23994)|0;GE(d,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(d,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(d);OE(n,m)|0;KE(n)|0;ua()}c[h>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;_h(f,h,i,g,b,c[a>>2]|0,c[a+4>>2]|0,e);Vh(i,h);if((((c[j>>2]|0)-(c[i>>2]|0)|0)/36|0)>>>0>(c[k>>2]|0)>>>0){n=Vf(Vf(NE(Vf(Vf(Vf(56032,24078)|0,22676)|0,35e3)|0,469)|0,35007)|0,24147)|0;GE(d,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(d,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(d);OE(n,m)|0;KE(n)|0;ua()}else{fh(h);break}}while(0);yb=l;return}function Uh(b,d){b=b|0;d=d|0;var e=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.0;w=yb;yb=yb+64|0;l=w+48|0;s=w+44|0;t=w+40|0;u=w+36|0;v=w;a:do if(!(a[b+28>>0]|0)){g=c[b+60>>2]|0;e=((c[b+64>>2]|0)-g|0)/36|0;b=0;while(1){if((b|0)==(e|0))break a;f[g+(b*36|0)+8>>2]=0.0;b=b+1|0}}else{k=b+72|0;m=b+76|0;c[m>>2]=c[k>>2];n=b+60|0;o=b+64|0;sh(k,(c[o>>2]|0)-(c[n>>2]|0)|0);p=b+92|0;tj(p,d);q=b+144|0;r=v+8|0;j=b+80|0;i=0;while(1){h=c[n>>2]|0;b=h;if(i>>>0>=(((c[o>>2]|0)-h|0)/36|0)>>>0)break;Wh(s,t,u,+f[b+(i*36|0)>>2],+f[b+(i*36|0)+4>>2],+f[b+(i*36|0)+28>>2],c[b+(i*36|0)+12>>2]|0);x=+f[s>>2];f[s>>2]=+Xh(x,0.0,+(((Lg(Jg(d,c[(c[n>>2]|0)+(i*36|0)+12>>2]|0,0)|0)|0)+-1|0)>>>0));x=+f[t>>2];x=+Xh(x,0.0,+(((Mg(Jg(d,c[(c[n>>2]|0)+(i*36|0)+12>>2]|0,0)|0)|0)+-1|0)>>>0));f[t>>2]=x;h=c[n>>2]|0;wj(p,c[q>>2]|0,l,c[h+(i*36|0)+12>>2]|0,c[h+(i*36|0)+16>>2]|0,+f[s>>2],x,+f[u>>2]);h=0;while(1){if((h|0)>=(c[l>>2]|0))break;b=v;e=(c[n>>2]|0)+(i*36|0)|0;g=b+36|0;do{c[b>>2]=c[e>>2];b=b+4|0;e=e+4|0}while((b|0)<(g|0));c[r>>2]=c[(c[q>>2]|0)+(h<<2)>>2];b=c[m>>2]|0;if((b|0)==(c[j>>2]|0))Yh(k,v);else{e=v;g=b+36|0;do{c[b>>2]=c[e>>2];b=b+4|0;e=e+4|0}while((b|0)<(g|0));c[m>>2]=(c[m>>2]|0)+36}h=h+1|0}i=i+1|0}Vh(n,k)}while(0);yb=w;return}function Vh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=c[a>>2]|0;c[a>>2]=c[b>>2];c[b>>2]=f;f=a+4|0;d=b+4|0;e=c[f>>2]|0;c[f>>2]=c[d>>2];c[d>>2]=e;d=a+8|0;b=b+8|0;a=c[d>>2]|0;c[d>>2]=c[b>>2];c[b>>2]=a;return}function Wh(a,b,c,d,e,g,h){a=a|0;b=b|0;c=c|0;d=+d;e=+e;g=+g;h=h|0;var i=0.0,j=0.0;i=1.0/+(1<>2]=i*d+j;f[b>>2]=i*e+j;f[c>>2]=i*g;return}function Xh(a,b,c){a=+a;b=+b;c=+c;if(!(ac)a=c}else a=b;return +a}function Yh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;j=yb;yb=yb+32|0;i=j;d=a+4|0;e=(((c[d>>2]|0)-(c[a>>2]|0)|0)/36|0)+1|0;f=Zh(a)|0;if(f>>>0>>0)CO(a);else{g=c[a>>2]|0;k=((c[a+8>>2]|0)-g|0)/36|0;h=k<<1;th(i,k>>>0>>1>>>0?(h>>>0>>0?e:h):f,((c[d>>2]|0)-g|0)/36|0,a+8|0);f=i+8|0;g=c[f>>2]|0;h=g;d=b;e=h+36|0;do{c[h>>2]=c[d>>2];h=h+4|0;d=d+4|0}while((h|0)<(e|0));c[f>>2]=g+36;uh(a,i);vh(i);yb=j;return}}function Zh(a){a=a|0;return 119304647}function _h(a,b,d,e,g,h,i,j){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0,u=0,v=0,w=0,x=0,y=0,z=0,C=0,D=0;D=yb;yb=yb+48|0;C=D+8|0;v=D+32|0;u=D+28|0;y=D+24|0;z=D+20|0;w=D+16|0;x=D;o=B(g,e)|0;n=+A(+(+(h|0)/+(e|0)));m=+A(+(+(i|0)/+(g|0)));r=b+4|0;c[r>>2]=c[b>>2];sh(b,j);s=a+4|0;g=c[a>>2]|0;i=((c[s>>2]|0)-g|0)/12|0;e=0;while(1){if((e|0)==(i|0))break;l=c[g+(e*12|0)>>2]|0;k=((c[g+(e*12|0)+4>>2]|0)-l|0)/12|0;h=0;while(1){if((h|0)==(k|0))break;c[l+(h*12|0)+4>>2]=c[l+(h*12|0)>>2];h=h+1|0}e=e+1|0}q=(j|0)/(o|0)|0;o=d+4|0;n=+(~~n|0);m=+(~~m|0);g=C+4|0;l=0;while(1){p=c[d>>2]|0;e=p;if(l>>>0>=(((c[o>>2]|0)-p|0)/36|0)>>>0)break;i=~~(+f[e+(l*36|0)+4>>2]/m);k=c[(c[a>>2]|0)+(~~(+f[e+(l*36|0)>>2]/n)*12|0)>>2]|0;f[C>>2]=+t(+(+f[e+(l*36|0)+24>>2]));c[g>>2]=l;e=k+(i*12|0)+4|0;h=c[e>>2]|0;if(h>>>0<(c[k+(i*12|0)+8>>2]|0)>>>0){k=C;j=c[k+4>>2]|0;p=h;c[p>>2]=c[k>>2];c[p+4>>2]=j;c[e>>2]=(c[e>>2]|0)+8}else $h(k+(i*12|0)|0,C);l=l+1|0}p=b+8|0;e=c[a>>2]|0;g=e;j=0;h=g;a:while(1){if(j>>>0>=(((c[s>>2]|0)-e|0)/12|0)>>>0){e=16;break}o=0;i=g;while(1){l=c[i+(j*12|0)>>2]|0;e=l;if(o>>>0>=(((c[i+(j*12|0)+4>>2]|0)-l|0)/12|0)>>>0)break;l=e+(o*12|0)|0;e=e+(o*12|0)+4|0;g=c[e>>2]|0;i=c[l>>2]|0;k=g-i>>3;k=q>>>0>>0?q:k;if(!k)e=h;else{c[y>>2]=i;c[z>>2]=i+(k<<3);c[w>>2]=g;c[u>>2]=c[y>>2];c[v>>2]=c[z>>2];c[C>>2]=c[w>>2];ai(u,v,C,x);g=c[l>>2]|0;i=g;if(k>>>0>(c[e>>2]|0)-g>>3>>>0?!(+f[i>>2]>=+f[i+(k<<3)>>2]):0){e=23;break a}i=0;while(1){if(i>>>0>=k>>>0)break;h=(c[d>>2]|0)+((c[(c[l>>2]|0)+(i<<3)+4>>2]|0)*36|0)|0;e=c[r>>2]|0;if((e|0)==(c[p>>2]|0))Yh(b,h);else{g=e+36|0;do{c[e>>2]=c[h>>2];e=e+4|0;h=h+4|0}while((e|0)<(g|0));c[r>>2]=(c[r>>2]|0)+36}i=i+1|0}e=c[a>>2]|0}o=o+1|0;h=e;i=e}j=j+1|0;g=i;e=i}if((e|0)==16){yb=D;return}else if((e|0)==23){D=Vf(Vf(NE(Vf(Vf(Vf(56032,24171)|0,22676)|0,35e3)|0,661)|0,35007)|0,24229)|0;GE(C,D+(c[(c[D>>2]|0)+-12>>2]|0)|0);z=VF(C,56736)|0;z=Gb[c[(c[z>>2]|0)+28>>2]&63](z,10)|0;WF(C);OE(D,z)|0;KE(D)|0;ua()}}function $h(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=yb;yb=yb+32|0;d=h;e=a+4|0;f=((c[e>>2]|0)-(c[a>>2]|0)>>3)+1|0;g=di(a)|0;if(g>>>0>>0)CO(a);else{i=c[a>>2]|0;k=(c[a+8>>2]|0)-i|0;j=k>>2;ei(d,k>>3>>>0>>1>>>0?(j>>>0>>0?f:j):g,(c[e>>2]|0)-i>>3,a+8|0);g=d+8|0;e=c[b+4>>2]|0;f=c[g>>2]|0;c[f>>2]=c[b>>2];c[f+4>>2]=e;c[g>>2]=(c[g>>2]|0)+8;fi(a,d);gi(d);yb=h;return}}function ai(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var g=0,h=0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0.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=yb;yb=yb+48|0;y=K+40|0;x=K+36|0;w=K+32|0;C=K+28|0;D=K+24|0;E=K+20|0;G=K+16|0;H=K+12|0;I=K+8|0;z=K+4|0;A=K;v=c[b>>2]|0;a:while(1){u=c[d>>2]|0;n=u;t=u+-8|0;q=t;s=u+-4|0;if((v|0)==(u|0))break;r=c[a>>2]|0;k=r;b:while(1){b=n-k|0;g=b>>3;switch(g|0){case 1:case 0:break a;case 2:{J=5;break a}case 3:{J=10;break a}default:{}}if((b|0)<64){J=12;break a}g=g>>>1;p=r+(g<<3)|0;c[I>>2]=k;c[z>>2]=p;c[A>>2]=q;c[w>>2]=c[I>>2];c[x>>2]=c[z>>2];c[y>>2]=c[A>>2];b=bi(w,x,y,e)|0;l=k;j=+f[p>>2];i=+f[l>>2];if(j>2]|0)>>>0<(c[l+4>>2]|0)>>>0:0){J=53;break}g=t;while(1){m=g+-8|0;if((m|0)==(l|0))break;i=+f[m>>2];if(j>2]|0,(c[h>>2]|0)>>>0>>0):0){J=51;break b}g=m}h=l+8|0;b=h;o=+f[t>>2];j=+f[r>>2];do if(!(o>2]|0)>>>0<(c[g>>2]|0)>>>0)break}else g=r+4|0;while(1){if((h|0)==(t|0))break a;i=+f[h>>2];if(i>2]|0,F>>>0<(c[g>>2]|0)>>>0):0){J=28;break}h=h+8|0}if((J|0)==25){J=0;g=h+4|0;b=g;g=c[g>>2]|0}else if((J|0)==28){J=0;b=h+4|0;g=F}f[h>>2]=o;f[t>>2]=i;c[b>>2]=c[s>>2];c[s>>2]=g;b=h+8|0}while(0);if((t|0)==(b|0))break a;l=r+4|0;g=q;while(1){j=+f[r>>2];k=b;while(1){b=k;i=+f[b>>2];if(i>2]|0)>>>0<(c[l>>2]|0)>>>0:0)break;k=b+8|0}h=k;while(1){b=g+-8|0;i=+f[b>>2];if(!(i>2]|0)>>>0>=(c[l>>2]|0)>>>0)break}g=b}if(b>>>0<=h>>>0)break;m=c[k>>2]|0;f[k>>2]=i;c[b>>2]=m;m=h+4|0;g=g+-4|0;p=c[m>>2]|0;c[m>>2]=c[g>>2];c[g>>2]=p;g=b;b=h+8|0}b=k;if(v>>>0>>0)break a;c[a>>2]=k;r=b}if((J|0)==47){h=g+-4|0;g=h;h=c[h>>2]|0;J=52}else if((J|0)==51){g=g+-4|0;h=B;J=52}else if((J|0)==53){J=0;h=t;s=k}if((J|0)==52){J=0;s=k;r=c[k>>2]|0;f[k>>2]=i;c[m>>2]=r;r=s+4|0;t=c[r>>2]|0;c[r>>2]=h;c[g>>2]=t;b=b+1|0;h=m}g=s+8|0;k=g;if(g>>>0>>0){q=p;g=k;while(1){p=q;n=p+4|0;j=+f[p>>2];while(1){k=g;i=+f[k>>2];if(!(j>2]|0)>>>0>=(c[k+4>>2]|0)>>>0)break}g=k+8|0}m=g;while(1){l=h+-8|0;i=+f[l>>2];if(j>2]|0)>>>0<(c[h+-4>>2]|0)>>>0:0)break;h=l}k=l;if(l>>>0<=m>>>0)break;t=c[g>>2]|0;f[g>>2]=i;c[l>>2]=t;t=m+4|0;h=h+-4|0;g=c[t>>2]|0;c[t>>2]=c[h>>2];c[h>>2]=g;b=b+1|0;h=k;q=(p|0)==(m|0)?k:q;g=m+8|0}r=g;p=q;k=g}else r=g;n=k;do if((p|0)!=(r|0)){i=+f[r>>2];j=+f[p>>2];if(!(i>2]|0;g=p+4|0;m=c[g>>2]|0;if(h>>>0>=m>>>0)break}else{h=r+4|0;m=p+4|0;g=m;l=h;m=c[m>>2]|0;h=c[h>>2]|0}t=c[k>>2]|0;f[k>>2]=j;c[p>>2]=t;c[l>>2]=m;c[g>>2]=h;b=b+1|0}while(0);if((v|0)==(r|0))break;c:do if(!b)if(v>>>0>>0){b=s;while(1){g=b+8|0;if((g|0)==(r|0))break a;i=+f[b>>2];j=+f[g>>2];if(i>2]|0)>>>0<(c[b+12>>2]|0)>>>0:0)break c;b=g}}else{b=n;while(1){g=b+8|0;if((g|0)==(u|0))break a;i=+f[b>>2];j=+f[g>>2];if(i>2]|0)>>>0<(c[b+12>>2]|0)>>>0:0)break c;b=g}}while(0);if(v>>>0>>0)c[d>>2]=k;else c[a>>2]=r+8}do if((J|0)==5){c[d>>2]=t;i=+f[r>>2];j=+f[t>>2];if(!(i>2]|0;h=c[s>>2]|0;if(g>>>0>=h>>>0)break}else{g=r+4|0;b=g;h=c[s>>2]|0;g=c[g>>2]|0}f[r>>2]=j;f[t>>2]=i;c[b>>2]=h;c[s>>2]=g}else if((J|0)==10){c[C>>2]=k;c[D>>2]=k+8;c[d>>2]=t;c[E>>2]=t;c[w>>2]=c[C>>2];c[x>>2]=c[D>>2];c[y>>2]=c[E>>2];bi(w,x,y,e)|0}else if((J|0)==12){c[G>>2]=k;c[H>>2]=u;c[x>>2]=c[G>>2];c[y>>2]=c[H>>2];ci(x,y,e)}while(0);yb=K;return}function bi(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var g=0.0,h=0.0,i=0,j=0.0,k=0,l=0;l=c[b>>2]|0;k=c[a>>2]|0;j=+f[k>>2];h=+f[l>>2];if(!(j>2]|0)>>>0<(c[l+4>>2]|0)>>>0;else e=1;i=c[d>>2]|0;g=+f[i>>2];if(!(h>2]|0)>>>0<(c[i+4>>2]|0)>>>0;else b=1;do if(!e)if(b){f[l>>2]=g;f[i>>2]=h;d=l+4|0;i=i+4|0;a=c[d>>2]|0;c[d>>2]=c[i>>2];c[i>>2]=a;g=+f[k>>2];h=+f[l>>2];if(!(g>2]|0;a=c[d>>2]|0;if(e>>>0>=a>>>0){b=1;break}}else{e=k+4|0;b=e;a=c[d>>2]|0;e=c[e>>2]|0}f[k>>2]=h;f[l>>2]=g;c[b>>2]=a;c[d>>2]=e;b=2}else b=0;else{if(b){f[k>>2]=g;f[i>>2]=j;k=k+4|0;b=i+4|0;l=c[k>>2]|0;c[k>>2]=c[b>>2];c[b>>2]=l;b=1;break}f[k>>2]=h;f[l>>2]=j;k=k+4|0;a=l+4|0;d=c[k>>2]|0;c[k>>2]=c[a>>2];c[a>>2]=d;g=+f[i>>2];if(!(j>2]|0;if(d>>>0>=e>>>0){b=1;break}}else{e=i+4|0;b=e;e=c[e>>2]|0}f[l>>2]=g;f[i>>2]=j;c[a>>2]=e;c[b>>2]=d;b=2}while(0);return b|0}function ci(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,g=0.0,h=0,i=0,j=0,k=0,l=0;j=c[b>>2]|0;k=j+-8|0;l=c[a>>2]|0;while(1){if((l|0)==(k|0))break;a:do if((l|0)==(j|0))b=j;else{b=l;while(1){h=b+4|0;d=b;while(1){i=d+8|0;if((i|0)==(j|0))break a;e=+f[b>>2];g=+f[i>>2];if(e>2]|0)>>>0<(c[d+12>>2]|0)>>>0:0)break;d=i}b=i}}while(0);if((b|0)!=(l|0)){d=c[l>>2]|0;c[l>>2]=c[b>>2];c[b>>2]=d;d=l+4|0;i=b+4|0;h=c[d>>2]|0;c[d>>2]=c[i>>2];c[i>>2]=h}i=l+8|0;c[a>>2]=i;l=i}return}function di(a){a=a|0;return 536870911}function ei(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;do if(b)if(b>>>0>536870911){f=O(8)|0;bO(f,37409);c[f>>2]=16392;Q(f|0,13960,22)}else{e=rB(b<<3)|0;break}else e=0;while(0);c[a>>2]=e;d=e+(d<<3)|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+(b<<3);return}function fi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[a>>2]|0;h=a+4|0;g=b+4|0;f=(c[h>>2]|0)-e|0;d=(c[g>>2]|0)+(0-(f>>3)<<3)|0;c[g>>2]=d;if((f|0)>0){YO(d|0,e|0,f|0)|0;e=g;d=c[g>>2]|0}else e=g;g=c[a>>2]|0;c[a>>2]=d;c[e>>2]=g;g=b+8|0;f=c[h>>2]|0;c[h>>2]=c[g>>2];c[g>>2]=f;g=a+8|0;h=b+12|0;a=c[g>>2]|0;c[g>>2]=c[h>>2];c[h>>2]=a;c[b>>2]=c[e>>2];return}function gi(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a+4>>2]|0;d=a+8|0;e=c[d>>2]|0;while(1){if((e|0)==(b|0))break;f=e+-8|0;c[d>>2]=f;e=f}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function hi(a){a=+a;return +(a*a)}function ii(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=a+4|0;f=c[a>>2]|0;e=((c[d>>2]|0)-f|0)/36|0;if(e>>>0>=b>>>0){if(e>>>0>b>>>0)c[d>>2]=f+(b*36|0)}else Fi(a,b-e|0);return}function ji(a){a=a|0;return c[a+16>>2]|0}function ki(a,b,c,d,e){a=a|0;b=b|0;c=+c;d=+d;e=e|0;var g=0.0,h=0.0;h=1.0/+(1<>2]=h*c+g;f[b>>2]=h*d+g;return}function li(a){a=a|0;return a|0}function mi(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 i=0,j=0,k=0,l=0;j=yb;yb=yb+16|0;i=j;k=Lg(d)|0;k=(k|0)==(Lg(e)|0)&1;do if((Lg(f)|0)==(k|0)){k=Mg(d)|0;k=(k|0)==(Mg(e)|0)&1;if((Mg(f)|0)==(k|0)){wi(a,b,d,e,f,g,h);break}else{k=Vf(Vf(NE(Vf(Vf(Vf(56032,24457)|0,24528)|0,35e3)|0,466)|0,35007)|0,24621)|0;GE(i,k+(c[(c[k>>2]|0)+-12>>2]|0)|0);h=VF(i,56736)|0;h=Gb[c[(c[h>>2]|0)+28>>2]&63](h,10)|0;WF(i);OE(k,h)|0;KE(k)|0;ua()}}else{k=Lg(d)|0;if((k|0)==(Lg(e)|0)?(k=(Lg(e)|0)>>>1,(k|0)==(Lg(f)|0)):0){k=Mg(d)|0;if((k|0)==(Mg(e)|0)?(k=(Mg(e)|0)>>>1,(k|0)==(Mg(f)|0)):0){xi(a,b,d,e,f,g,h);break}k=Vf(Vf(NE(Vf(Vf(Vf(56032,24653)|0,24528)|0,35e3)|0,469)|0,35007)|0,24621)|0;GE(i,k+(c[(c[k>>2]|0)+-12>>2]|0)|0);l=VF(i,56736)|0;l=Gb[c[(c[l>>2]|0)+28>>2]&63](l,10)|0;WF(i);OE(k,l)|0;KE(k)|0;ua()}l=(Lg(d)|0)>>>1;if((l|0)==(Lg(e)|0)?(l=Lg(e)|0,(l|0)==(Lg(f)|0)):0){l=(Lg(d)|0)>>>1;if((l|0)==(Lg(e)|0)?(l=Lg(e)|0,(l|0)==(Lg(f)|0)):0){yi(a,b,d,e,f,g,h);break}l=Vf(Vf(NE(Vf(Vf(Vf(56032,24750)|0,24528)|0,35e3)|0,472)|0,35007)|0,24621)|0;GE(i,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);k=VF(i,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(i);OE(l,k)|0;KE(l)|0;ua()}l=Vf(Vf(NE(Vf(Vf(Vf(56032,31132)|0,24528)|0,35e3)|0,475)|0,35007)|0,24843)|0;GE(i,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);k=VF(i,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(i);OE(l,k)|0;KE(l)|0;ua()}while(0);yb=j;return 1}function ni(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;e=yb;yb=yb+48|0;d=e;if(ri(d,b,1.1920928955078125e-07)|0){si(a,d,c);a=1}else a=0;yb=e;return a|0}function oi(a,b){a=a|0;b=b|0;var c=0,d=0.0;c=b+16|0;d=+f[b>>2]*+f[c>>2];d=d-+hi(+f[b+4>>2]);if(d==0.0)a=0;else{f[a>>2]=+hi(+f[b>>2]+ +f[c>>2])/d;a=1}return a|0}function pi(a,b,c,d,e){a=a|0;b=b|0;c=+c;d=+d;e=e|0;var g=0.0,h=0.0;g=+fz(1.0,e+-1|0)+-.5;h=+(1<>2]=h*c+g;f[b>>2]=h*d+g;return}function qi(a,b,d){a=a|0;b=b|0;d=+d;var e=0,g=0,h=0,i=0;g=yb;yb=yb+16|0;e=g;if(!(d>=0.0)){h=Vf(Vf(NE(Vf(Vf(Vf(56032,34104)|0,33900)|0,35e3)|0,232)|0,35007)|0,34138)|0;GE(e,h+(c[(c[h>>2]|0)+-12>>2]|0)|0);i=VF(e,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(e);OE(h,i)|0;KE(h)|0;ua()}if(+(c[a+20>>2]|0)>d){d=+v(+(+f[a+24>>2]),+d)*+(1<>2]|0)+-12>>2]|0)|0);h=VF(e,56736)|0;h=Gb[c[(c[h>>2]|0)+28>>2]&63](h,10)|0;WF(e);OE(i,h)|0;KE(i)|0;ua()}return +(0.0)}function ri(a,b,d){a=a|0;b=b|0;d=+d;var e=0.0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;e=+ti(b);if(!(+t(+e)<=d)){e=1.0/e;j=b+16|0;l=b+20|0;g=b+32|0;f[a>>2]=e*+ui(+f[j>>2],+f[l>>2],+f[g>>2]);m=b+8|0;k=b+4|0;i=a+4|0;f[i>>2]=e*+vi(+f[m>>2],+f[k>>2],+f[g>>2],+f[b+28>>2]);h=a+8|0;f[h>>2]=e*+vi(+f[k>>2],+f[m>>2],+f[j>>2],+f[l>>2]);f[a+16>>2]=e*+ui(+f[b>>2],+f[m>>2],+f[g>>2]);g=a+20|0;f[g>>2]=e*+vi(+f[m>>2],+f[b>>2],+f[l>>2],+f[b+12>>2]);f[a+32>>2]=e*+ui(+f[b>>2],+f[k>>2],+f[j>>2]);c[a+12>>2]=c[i>>2];c[a+24>>2]=c[h>>2];c[a+28>>2]=c[g>>2];a=1}else a=0;return a|0}function si(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;e=c+4|0;d=c+8|0;f[a>>2]=+f[b>>2]*+f[c>>2]+ +f[b+4>>2]*+f[e>>2]+ +f[b+8>>2]*+f[d>>2];f[a+4>>2]=+f[b+12>>2]*+f[c>>2]+ +f[b+16>>2]*+f[e>>2]+ +f[b+20>>2]*+f[d>>2];f[a+8>>2]=+f[b+24>>2]*+f[c>>2]+ +f[b+28>>2]*+f[e>>2]+ +f[b+32>>2]*+f[d>>2];return}function ti(a){a=a|0;var b=0,c=0,d=0.0,e=0.0,g=0.0,h=0.0,i=0;b=a+32|0;g=+f[b>>2];c=a+4|0;g=g*+hi(+f[c>>2]);e=+f[a+8>>2];i=a+20|0;h=+f[c>>2]*2.0*e*+f[i>>2];c=a+16|0;d=+f[c>>2];e=d*+hi(e);d=+f[a>>2];d=d*+hi(+f[i>>2]);return +(h-g-e-d+ +f[a>>2]*+f[c>>2]*+f[b>>2])}function ui(a,b,c){a=+a;b=+b;c=+c;return +(a*c-b*b)}function vi(a,b,c,d){a=+a;b=+b;c=+c;d=+d;return +(a*d-b*c)}function wi(a,b,d,e,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|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.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0,A=0;r=yb;yb=yb+32|0;o=r+20|0;p=r+16|0;q=r+12|0;j=r+8|0;k=r+4|0;l=r;if((h|0)>0?(h+1|0)>>>0<(Lg(e)|0)>>>0:0){m=i+-1|0;if((i|0)>0?(n=i+1|0,n>>>0<(Mg(e)|0)>>>0):0){s=Lg(d)|0;if((s|0)!=(Lg(e)|0)){s=Vf(Vf(NE(Vf(Vf(Vf(56032,26146)|0,24528)|0,35e3)|0,311)|0,35007)|0,25078)|0;GE(o,s+(c[(c[s>>2]|0)+-12>>2]|0)|0);t=VF(o,56736)|0;t=Gb[c[(c[t>>2]|0)+28>>2]&63](t,10)|0;WF(o);OE(s,t)|0;KE(s)|0;ua()}t=Lg(d)|0;if((t|0)!=(Lg(g)|0)){t=Vf(Vf(NE(Vf(Vf(Vf(56032,26545)|0,24528)|0,35e3)|0,312)|0,35007)|0,25078)|0;GE(o,t+(c[(c[t>>2]|0)+-12>>2]|0)|0);s=VF(o,56736)|0;s=Gb[c[(c[s>>2]|0)+28>>2]&63](s,10)|0;WF(o);OE(t,s)|0;KE(t)|0;ua()}t=Mg(d)|0;if((t|0)!=(Mg(e)|0)){t=Vf(Vf(NE(Vf(Vf(Vf(56032,26198)|0,24528)|0,35e3)|0,313)|0,35007)|0,25078)|0;GE(o,t+(c[(c[t>>2]|0)+-12>>2]|0)|0);s=VF(o,56736)|0;s=Gb[c[(c[s>>2]|0)+28>>2]&63](s,10)|0;WF(o);OE(t,s)|0;KE(t)|0;ua()}t=Mg(d)|0;if((t|0)==(Mg(g)|0)){z=(ah(d,m)|0)+(h<<2)|0;A=(ah(d,i)|0)+(h<<2)|0;o=(ah(d,n)|0)+(h<<2)|0;d=(ah(e,i)|0)+(h<<2)|0;t=(ah(g,m)|0)+(h<<2)|0;m=(ah(g,i)|0)+(h<<2)|0;s=(ah(g,n)|0)+(h<<2)|0;zi(p,q,j,k,l,e,h,i);v=+f[m>>2];u=+f[A>>2];w=v+(u-+f[d>>2]*2.0);y=(+f[A+-4>>2]-+f[A+4>>2]+(+f[m+4>>2]-+f[m+-4>>2]))*.25;x=(+f[z>>2]-+f[o>>2]+(+f[s>>2]-+f[t>>2]))*.25;c[a>>2]=c[j>>2];t=c[l>>2]|0;c[a+4>>2]=t;f[a+8>>2]=y;c[a+12>>2]=t;c[a+16>>2]=c[k>>2];f[a+20>>2]=x;f[a+24>>2]=y;f[a+28>>2]=x;f[a+32>>2]=w;f[b>>2]=-+f[p>>2];f[b+4>>2]=-+f[q>>2];f[b+8>>2]=-((v-u)*.5);yb=r;return}else{A=Vf(Vf(NE(Vf(Vf(Vf(56032,26597)|0,24528)|0,35e3)|0,314)|0,35007)|0,25078)|0;GE(o,A+(c[(c[A>>2]|0)+-12>>2]|0)|0);z=VF(o,56736)|0;z=Gb[c[(c[z>>2]|0)+28>>2]&63](z,10)|0;WF(o);OE(A,z)|0;KE(A)|0;ua()}}A=Vf(Vf(NE(Vf(Vf(Vf(56032,24946)|0,24528)|0,35e3)|0,310)|0,35007)|0,25005)|0;GE(o,A+(c[(c[A>>2]|0)+-12>>2]|0)|0);z=VF(o,56736)|0;z=Gb[c[(c[z>>2]|0)+28>>2]&63](z,10)|0;WF(o);OE(A,z)|0;KE(A)|0;ua()}A=Vf(Vf(NE(Vf(Vf(Vf(56032,24872)|0,24528)|0,35e3)|0,309)|0,35007)|0,24930)|0;GE(o,A+(c[(c[A>>2]|0)+-12>>2]|0)|0);z=VF(o,56736)|0;z=Gb[c[(c[z>>2]|0)+28>>2]&63](z,10)|0;WF(o);OE(A,z)|0;KE(A)|0;ua()}function xi(a,b,d,e,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|0;var 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,v=0,w=0,x=0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0;w=yb;yb=yb+32|0;t=w+28|0;u=w+24|0;v=w+20|0;o=w+16|0;p=w+12|0;q=w+8|0;r=w+4|0;s=w;if((h|0)>0?(h+1|0)>>>0<(Lg(e)|0)>>>0:0){j=i+-1|0;if((i|0)>0?(l=i+1|0,l>>>0<(Mg(e)|0)>>>0):0){n=Lg(d)|0;if((n|0)!=(Lg(e)|0)){n=Vf(Vf(NE(Vf(Vf(Vf(56032,26146)|0,24528)|0,35e3)|0,415)|0,35007)|0,25078)|0;GE(t,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(t,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(t);OE(n,m)|0;KE(n)|0;ua()}n=(Lg(d)|0)>>>1;if((n|0)!=(Lg(g)|0)){n=Vf(Vf(NE(Vf(Vf(Vf(56032,25108)|0,24528)|0,35e3)|0,416)|0,35007)|0,25078)|0;GE(t,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(t,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(t);OE(n,m)|0;KE(n)|0;ua()}n=Mg(d)|0;if((n|0)!=(Mg(e)|0)){n=Vf(Vf(NE(Vf(Vf(Vf(56032,26198)|0,24528)|0,35e3)|0,417)|0,35007)|0,25078)|0;GE(t,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(t,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(t);OE(n,m)|0;KE(n)|0;ua()}n=(Mg(d)|0)>>>1;if((n|0)!=(Mg(g)|0)){n=Vf(Vf(NE(Vf(Vf(Vf(56032,25224)|0,24528)|0,35e3)|0,418)|0,35007)|0,25078)|0;GE(t,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(t,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(t);OE(n,m)|0;KE(n)|0;ua()}m=(ah(d,j)|0)+(h<<2)|0;n=(ah(d,i)|0)+(h<<2)|0;j=(ah(d,l)|0)+(h<<2)|0;d=(ah(e,i)|0)+(h<<2)|0;ki(u,v,+(h|0),+(i|0),1);k=+f[u>>2];if(!(k+-.5>=0.0)){l=Vf(Vf(NE(Vf(Vf(Vf(56032,26252)|0,24528)|0,35e3)|0,428)|0,35007)|0,26293)|0;GE(t,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);x=VF(t,56736)|0;x=Gb[c[(c[x>>2]|0)+28>>2]&63](x,10)|0;WF(t);OE(l,x)|0;KE(l)|0;ua()}if(!(+f[v>>2]+-.5>=0.0)){x=Vf(Vf(NE(Vf(Vf(Vf(56032,26347)|0,24528)|0,35e3)|0,429)|0,35007)|0,26388)|0;GE(t,x+(c[(c[x>>2]|0)+-12>>2]|0)|0);l=VF(t,56736)|0;l=Gb[c[(c[l>>2]|0)+28>>2]&63](l,10)|0;WF(t);OE(x,l)|0;KE(x)|0;ua()}if(!(k+.5<+((Lg(g)|0)>>>0))){x=Vf(Vf(NE(Vf(Vf(Vf(56032,26442)|0,24528)|0,35e3)|0,430)|0,35007)|0,26293)|0;GE(t,x+(c[(c[x>>2]|0)+-12>>2]|0)|0);l=VF(t,56736)|0;l=Gb[c[(c[l>>2]|0)+28>>2]&63](l,10)|0;WF(t);OE(x,l)|0;KE(x)|0;ua()}k=+f[v>>2]+.5;if(k<+((Mg(g)|0)>>>0)){zi(o,p,q,r,s,e,h,i);y=+Ai(g,+f[u>>2],+f[v>>2]);k=+f[n>>2];z=y+(k-+f[d>>2]*2.0);C=+f[n+-4>>2];C=C+ +Ai(g,+f[u>>2]+.5,+f[v>>2]);B=+f[n+4>>2];B=(C-(B+ +Ai(g,+f[u>>2]+-.5,+f[v>>2])))*.25;C=+f[m>>2];C=C+ +Ai(g,+f[u>>2],+f[v>>2]+.5);A=+f[j>>2];A=(C-(A+ +Ai(g,+f[u>>2],+f[v>>2]+-.5)))*.25;c[a>>2]=c[q>>2];x=c[s>>2]|0;c[a+4>>2]=x;f[a+8>>2]=B;c[a+12>>2]=x;c[a+16>>2]=c[r>>2];f[a+20>>2]=A;f[a+24>>2]=B;f[a+28>>2]=A;f[a+32>>2]=z;f[b>>2]=-+f[o>>2];f[b+4>>2]=-+f[p>>2];f[b+8>>2]=-((y-k)*.5);yb=w;return}else{x=Vf(Vf(NE(Vf(Vf(Vf(56032,26493)|0,24528)|0,35e3)|0,431)|0,35007)|0,26388)|0;GE(t,x+(c[(c[x>>2]|0)+-12>>2]|0)|0);w=VF(t,56736)|0;w=Gb[c[(c[w>>2]|0)+28>>2]&63](w,10)|0;WF(t);OE(x,w)|0;KE(x)|0;ua()}}x=Vf(Vf(NE(Vf(Vf(Vf(56032,24946)|0,24528)|0,35e3)|0,414)|0,35007)|0,25005)|0;GE(t,x+(c[(c[x>>2]|0)+-12>>2]|0)|0);w=VF(t,56736)|0;w=Gb[c[(c[w>>2]|0)+28>>2]&63](w,10)|0;WF(t);OE(x,w)|0;KE(x)|0;ua()}x=Vf(Vf(NE(Vf(Vf(Vf(56032,24872)|0,24528)|0,35e3)|0,413)|0,35007)|0,24930)|0;GE(t,x+(c[(c[x>>2]|0)+-12>>2]|0)|0);w=VF(t,56736)|0;w=Gb[c[(c[w>>2]|0)+28>>2]&63](w,10)|0;WF(t);OE(x,w)|0;KE(x)|0;ua()}function yi(a,b,d,e,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|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.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0;t=yb;yb=yb+32|0;q=t+28|0;r=t+24|0;s=t+20|0;j=t+16|0;k=t+12|0;l=t+8|0;m=t+4|0;n=t;if((h|0)>0?(h+1|0)>>>0<(Lg(e)|0)>>>0:0){o=i+-1|0;if((i|0)>0?(p=i+1|0,p>>>0<(Mg(e)|0)>>>0):0){u=(Lg(d)|0)>>>1;if((u|0)!=(Lg(e)|0)){u=Vf(Vf(NE(Vf(Vf(Vf(56032,25021)|0,24528)|0,35e3)|0,361)|0,35007)|0,25078)|0;GE(q,u+(c[(c[u>>2]|0)+-12>>2]|0)|0);v=VF(q,56736)|0;v=Gb[c[(c[v>>2]|0)+28>>2]&63](v,10)|0;WF(q);OE(u,v)|0;KE(u)|0;ua()}v=(Lg(d)|0)>>>1;if((v|0)!=(Lg(g)|0)){v=Vf(Vf(NE(Vf(Vf(Vf(56032,25108)|0,24528)|0,35e3)|0,362)|0,35007)|0,25078)|0;GE(q,v+(c[(c[v>>2]|0)+-12>>2]|0)|0);u=VF(q,56736)|0;u=Gb[c[(c[u>>2]|0)+28>>2]&63](u,10)|0;WF(q);OE(v,u)|0;KE(v)|0;ua()}v=(Mg(d)|0)>>>1;if((v|0)!=(Mg(e)|0)){v=Vf(Vf(NE(Vf(Vf(Vf(56032,25165)|0,24528)|0,35e3)|0,363)|0,35007)|0,25078)|0;GE(q,v+(c[(c[v>>2]|0)+-12>>2]|0)|0);u=VF(q,56736)|0;u=Gb[c[(c[u>>2]|0)+28>>2]&63](u,10)|0;WF(q);OE(v,u)|0;KE(v)|0;ua()}v=(Mg(d)|0)>>>1;if((v|0)==(Mg(g)|0)){C=(ah(e,i)|0)+(h<<2)|0;v=(ah(g,o)|0)+(h<<2)|0;q=(ah(g,i)|0)+(h<<2)|0;u=(ah(g,p)|0)+(h<<2)|0;pi(r,s,+(h|0),+(i|0),1);zi(j,k,l,m,n,e,h,i);w=+Ai(d,+f[r>>2],+f[s>>2]);x=+f[q>>2];y=x+(w-+f[C>>2]*2.0);B=+Ai(d,+f[r>>2]+-2.0,+f[s>>2]);B=B+ +f[q+4>>2];A=+Ai(d,+f[r>>2]+2.0,+f[s>>2]);A=(B-(A+ +f[q+-4>>2]))*.25;B=+Ai(d,+f[r>>2],+f[s>>2]+-2.0);B=B+ +f[u>>2];z=+Ai(d,+f[r>>2],+f[s>>2]+2.0);z=(B-(z+ +f[v>>2]))*.25;c[a>>2]=c[l>>2];v=c[n>>2]|0;c[a+4>>2]=v;f[a+8>>2]=A;c[a+12>>2]=v;c[a+16>>2]=c[m>>2];f[a+20>>2]=z;f[a+24>>2]=A;f[a+28>>2]=z;f[a+32>>2]=y;f[b>>2]=-+f[j>>2];f[b+4>>2]=-+f[k>>2];f[b+8>>2]=-((x-w)*.5);yb=t;return}else{C=Vf(Vf(NE(Vf(Vf(Vf(56032,25224)|0,24528)|0,35e3)|0,364)|0,35007)|0,25078)|0;GE(q,C+(c[(c[C>>2]|0)+-12>>2]|0)|0);v=VF(q,56736)|0;v=Gb[c[(c[v>>2]|0)+28>>2]&63](v,10)|0;WF(q);OE(C,v)|0;KE(C)|0;ua()}}C=Vf(Vf(NE(Vf(Vf(Vf(56032,24946)|0,24528)|0,35e3)|0,360)|0,35007)|0,25005)|0;GE(q,C+(c[(c[C>>2]|0)+-12>>2]|0)|0);v=VF(q,56736)|0;v=Gb[c[(c[v>>2]|0)+28>>2]&63](v,10)|0;WF(q);OE(C,v)|0;KE(C)|0;ua()}C=Vf(Vf(NE(Vf(Vf(Vf(56032,24872)|0,24528)|0,35e3)|0,359)|0,35007)|0,24930)|0;GE(q,C+(c[(c[C>>2]|0)+-12>>2]|0)|0);v=VF(q,56736)|0;v=Gb[c[(c[v>>2]|0)+28>>2]&63](v,10)|0;WF(q);OE(C,v)|0;KE(C)|0;ua()}function zi(a,b,d,e,g,h,i,j){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0,n=0;n=yb;yb=yb+16|0;m=n;if((i|0)>0?(i+1|0)>>>0<(Lg(h)|0)>>>0:0){k=j+-1|0;if((j|0)>0?(l=j+1|0,l>>>0<(Mg(h)|0)>>>0):0){k=(ah(h,k)|0)+(i<<2)|0;j=(ah(h,j)|0)+(i<<2)|0;m=(ah(h,l)|0)+(i<<2)|0;h=j+4|0;i=j+-4|0;f[a>>2]=(+f[h>>2]-+f[i>>2])*.5;f[b>>2]=(+f[m>>2]-+f[k>>2])*.5;f[d>>2]=+f[h>>2]+(+f[i>>2]-+f[j>>2]*2.0);f[e>>2]=+f[m>>2]+(+f[k>>2]-+f[j>>2]*2.0);f[g>>2]=(+f[k+-4>>2]+ +f[m+4>>2]-(+f[k+4>>2]+ +f[m+-4>>2]))*.25;yb=n;return}n=Vf(Vf(NE(Vf(Vf(Vf(56032,26089)|0,24528)|0,35e3)|0,285)|0,35007)|0,25005)|0;GE(m,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);j=VF(m,56736)|0;j=Gb[c[(c[j>>2]|0)+28>>2]&63](j,10)|0;WF(m);OE(n,j)|0;KE(n)|0;ua()}n=Vf(Vf(NE(Vf(Vf(Vf(56032,26033)|0,24528)|0,35e3)|0,284)|0,35007)|0,24930)|0;GE(m,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);j=VF(m,56736)|0;j=Gb[c[(c[j>>2]|0)+28>>2]&63](j,10)|0;WF(m);OE(n,j)|0;KE(n)|0;ua()}function Ai(a,b,c){a=a|0;b=+b;c=+c;var d=0,e=0,f=0;f=Bi(a)|0;e=Lg(a)|0;d=Mg(a)|0;return +(+Di(f,e,d,Ci(a)|0,b,c))}function Bi(a){a=a|0;return c[a+24>>2]|0}function Ci(a){a=a|0;return c[a+12>>2]|0}function Di(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;f=+f;return +(+Ei(a,b,c,d,e,f))}function Ei(a,b,d,e,g,h){a=a|0;b=b|0;d=d|0;e=e|0;g=+g;h=+h;var i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,t=0.0,u=0.0;p=yb;yb=yb+16|0;n=p;o=~~+s(+g);if((o|0)!=(~~g|0)){m=Vf(Vf(NE(Vf(Vf(Vf(56032,25283)|0,25335)|0,35e3)|0,69)|0,35007)|0,25411)|0;GE(n,m+(c[(c[m>>2]|0)+-12>>2]|0)|0);l=VF(n,56736)|0;l=Gb[c[(c[l>>2]|0)+28>>2]&63](l,10)|0;WF(n);OE(m,l)|0;KE(m)|0;ua()}l=~~+s(+h);if((l|0)!=(~~h|0)){m=Vf(Vf(NE(Vf(Vf(Vf(56032,25441)|0,25335)|0,35e3)|0,70)|0,35007)|0,25411)|0;GE(n,m+(c[(c[m>>2]|0)+-12>>2]|0)|0);k=VF(n,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(n);OE(m,k)|0;KE(m)|0;ua()}m=o+1|0;k=l+1|0;if(!((l|0)>-1&l>>>0>>0)){q=Vf(Vf(NE(Vf(Vf(Vf(56032,25493)|0,25335)|0,35e3)|0,79)|0,35007)|0,25539)|0;GE(n,q+(c[(c[q>>2]|0)+-12>>2]|0)|0);r=VF(n,56736)|0;r=Gb[c[(c[r>>2]|0)+28>>2]&63](r,10)|0;WF(n);OE(q,r)|0;KE(q)|0;ua()}if(k>>>0>=d>>>0){r=Vf(Vf(NE(Vf(Vf(Vf(56032,25556)|0,25335)|0,35e3)|0,80)|0,35007)|0,25616)|0;GE(n,r+(c[(c[r>>2]|0)+-12>>2]|0)|0);q=VF(n,56736)|0;q=Gb[c[(c[q>>2]|0)+28>>2]&63](q,10)|0;WF(n);OE(r,q)|0;KE(r)|0;ua()}if(!((o|0)>-1&o>>>0>>0)){r=Vf(Vf(NE(Vf(Vf(Vf(56032,25640)|0,25335)|0,35e3)|0,81)|0,35007)|0,25685)|0;GE(n,r+(c[(c[r>>2]|0)+-12>>2]|0)|0);q=VF(n,56736)|0;q=Gb[c[(c[q>>2]|0)+28>>2]&63](q,10)|0;WF(n);OE(r,q)|0;KE(r)|0;ua()}if(m>>>0>=b>>>0){r=Vf(Vf(NE(Vf(Vf(Vf(56032,25702)|0,25335)|0,35e3)|0,82)|0,35007)|0,25761)|0;GE(n,r+(c[(c[r>>2]|0)+-12>>2]|0)|0);q=VF(n,56736)|0;q=Gb[c[(c[q>>2]|0)+28>>2]&63](q,10)|0;WF(n);OE(r,q)|0;KE(r)|0;ua()}b=a+(B(l,e)|0)|0;a=b+e|0;u=+(m|0)-g;i=+(k|0)-h;j=u*i;t=g-+(o|0);i=t*i;h=h-+(l|0);g=u*h;h=t*h;if(!(j>=0.0)|!(j<=1.0001)){r=Vf(Vf(NE(Vf(Vf(Vf(56032,25785)|0,25335)|0,35e3)|0,94)|0,35007)|0,25832)|0;GE(n,r+(c[(c[r>>2]|0)+-12>>2]|0)|0);q=VF(n,56736)|0;q=Gb[c[(c[q>>2]|0)+28>>2]&63](q,10)|0;WF(n);OE(r,q)|0;KE(r)|0;ua()}if(!(i>=0.0)|!(i<=1.0001)){r=Vf(Vf(NE(Vf(Vf(Vf(56032,25845)|0,25335)|0,35e3)|0,95)|0,35007)|0,25832)|0;GE(n,r+(c[(c[r>>2]|0)+-12>>2]|0)|0);q=VF(n,56736)|0;q=Gb[c[(c[q>>2]|0)+28>>2]&63](q,10)|0;WF(n);OE(r,q)|0;KE(r)|0;ua()}if(!(g>=0.0)|!(g<=1.0001)){r=Vf(Vf(NE(Vf(Vf(Vf(56032,25892)|0,25335)|0,35e3)|0,96)|0,35007)|0,25832)|0;GE(n,r+(c[(c[r>>2]|0)+-12>>2]|0)|0);q=VF(n,56736)|0;q=Gb[c[(c[q>>2]|0)+28>>2]&63](q,10)|0;WF(n);OE(r,q)|0;KE(r)|0;ua()}if(!(h>=0.0)|!(h<=1.0001)){r=Vf(Vf(NE(Vf(Vf(Vf(56032,25939)|0,25335)|0,35e3)|0,97)|0,35007)|0,25832)|0;GE(n,r+(c[(c[r>>2]|0)+-12>>2]|0)|0);q=VF(n,56736)|0;q=Gb[c[(c[q>>2]|0)+28>>2]&63](q,10)|0;WF(n);OE(r,q)|0;KE(r)|0;ua()}if(!(h+(g+(j+i))<=1.0001)){r=Vf(Vf(NE(Vf(Vf(Vf(56032,25986)|0,25335)|0,35e3)|0,98)|0,35007)|0,25832)|0;GE(n,r+(c[(c[r>>2]|0)+-12>>2]|0)|0);q=VF(n,56736)|0;q=Gb[c[(c[q>>2]|0)+28>>2]&63](q,10)|0;WF(n);OE(r,q)|0;KE(r)|0;ua()}else{yb=p;return +(j*+f[b+(o<<2)>>2]+i*+f[b+(m<<2)>>2]+g*+f[a+(o<<2)>>2]+h*+f[a+(m<<2)>>2])}return +(0.0)}function Fi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=yb;yb=yb+32|0;f=i;g=a+8|0;h=a+4|0;d=c[h>>2]|0;do if((((c[g>>2]|0)-d|0)/36|0)>>>0>>0){d=((d-(c[a>>2]|0)|0)/36|0)+b|0;e=Zh(a)|0;if(e>>>0>>0)CO(a);else{j=c[a>>2]|0;k=((c[g>>2]|0)-j|0)/36|0;g=k<<1;th(f,k>>>0>>1>>>0?(g>>>0>>0?d:g):e,((c[h>>2]|0)-j|0)/36|0,a+8|0);Hi(f,b);uh(a,f);vh(f);break}}else Gi(a,b);while(0);yb=i;return}function Gi(a,b){a=a|0;b=b|0;var d=0,e=0;e=a+4|0;a=c[e>>2]|0;do{d=a+36|0;do{c[a>>2]=0;a=a+4|0}while((a|0)<(d|0));a=(c[e>>2]|0)+36|0;c[e>>2]=a;b=b+-1|0}while((b|0)!=0);return}function Hi(a,b){a=a|0;b=b|0;var d=0,e=0;e=a+8|0;a=c[e>>2]|0;do{d=a+36|0;do{c[a>>2]=0;a=a+4|0}while((a|0)<(d|0));a=(c[e>>2]|0)+36|0;c[e>>2]=a;b=b+-1|0}while((b|0)!=0);return}function Ii(a){a=a|0;return (c[a+4>>2]|0)-(c[a>>2]|0)>>5|0}function Ji(a,b){a=a|0;b=b|0;return (c[a>>2]|0)+(b<<5)|0}function Ki(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=yb;yb=yb+16|0;d=f;e=c[a>>2]|0;if((c[a+4>>2]|0)-e>>5>>>0>b>>>0){e=Lg(e)|0;e=~~+Ni(+Mi(+(((e>>>0)/((Lg((c[a>>2]|0)+(b<<5)|0)|0)>>>0)|0)>>>0)));yb=f;return e|0}else{f=Vf(Vf(NE(Vf(Vf(Vf(56032,26949)|0,24528)|0,35e3)|0,94)|0,35007)|0,26995)|0;GE(d,f+(c[(c[f>>2]|0)+-12>>2]|0)|0);e=VF(d,56736)|0;e=Gb[c[(c[e>>2]|0)+28>>2]&63](e,10)|0;WF(d);OE(f,e)|0;KE(f)|0;ua()}return 0}function Li(a,b){a=a|0;b=b|0;return (b|0)%(c[a+16>>2]|0)|0|0}function Mi(a){a=+a;return +(+z(+a)/.6931471824645996)}function Ni(a){a=+a;return +(+s(+(a+.5)))}function Oi(a){a=a|0;c[a>>2]=15676;eh(a+56|0);eh(a+44|0);Qi(a+32|0);Ri(a);return}function Pi(a){a=a|0;Oi(a);QA(a);return}function Qi(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;d=b;if(b|0){c[a+4>>2]=d;Nf(b,(c[a+8>>2]|0)-d|0)}return}function Ri(a){a=a|0;c[a>>2]=15692;kh(a+4|0);return}function Si(a){a=a|0;Ri(a);QA(a);return}function Ti(a,g,h,i,j){a=a|0;g=g|0;h=h|0;i=i|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;t=yb;yb=yb+16|0;k=t;if(i>>>0<=4){s=Vf(Vf(NE(Vf(Vf(Vf(56032,27047)|0,27081)|0,35e3)|0,55)|0,35007)|0,27176)|0;GE(k,s+(c[(c[s>>2]|0)+-12>>2]|0)|0);r=VF(k,56736)|0;r=Gb[c[(c[r>>2]|0)+28>>2]&63](r,10)|0;WF(k);OE(s,r)|0;KE(s)|0;ua()}if(j>>>0<=4){s=Vf(Vf(NE(Vf(Vf(Vf(56032,27195)|0,27081)|0,35e3)|0,56)|0,35007)|0,27176)|0;GE(k,s+(c[(c[s>>2]|0)+-12>>2]|0)|0);r=VF(k,56736)|0;r=Gb[c[(c[r>>2]|0)+28>>2]&63](r,10)|0;WF(k);OE(s,r)|0;KE(s)|0;ua()}o=i+-1|0;p=i+-2|0;q=i+-3|0;r=i+-4|0;l=g;m=0;while(1){if((m|0)==(j|0))break;s=h+(B(m,i)|0)|0;k=d[s>>0]|0;u=s+1|0;n=s+2|0;b[l>>1]=(k*7|0)+(d[n>>0]|0)+((d[u>>0]|0)+k<<2);k=d[s>>0]|0;b[l+2>>1]=((d[u>>0]|0)*6|0)+k+(d[s+3>>0]|0)+((d[n>>0]|0)+k<<2);k=2;n=l+4|0;while(1){if((k|0)==(p|0))break;u=k+1|0;b[n>>1]=((d[s+k>>0]|0)*6|0)+(d[s+(k+-2)>>0]|0)+((d[s+u>>0]|0)+(d[s+(k+-1)>>0]|0)<<2)+(d[s+(k+2)>>0]|0);k=u;n=n+2|0}u=l+(p<<1)|0;n=s+p|0;k=s+q|0;v=s+o|0;w=d[v>>0]|0;b[u>>1]=((d[n>>0]|0)*6|0)+w+(d[s+r>>0]|0)+(w+(d[k>>0]|0)<<2);s=d[v>>0]|0;b[u+2>>1]=(s*7|0)+(d[k>>0]|0)+((d[n>>0]|0)+s<<2);l=l+(i<<1)|0;m=m+1|0}s=j+-2|0;k=g+(i<<1)|0;q=k+(i<<1)|0;l=0;m=q;n=k;o=g;p=a;while(1){if((l|0)==(i|0))break;w=e[o>>1]|0;f[p>>2]=+((w*7|0)+((e[n>>1]|0)+w<<2)+(e[m>>1]|0)|0)*.00390625;l=l+1|0;m=m+2|0;n=n+2|0;o=o+2|0;p=p+4|0}o=0;p=q+(i<<1)|0;n=q;l=g;m=a+(i<<2)|0;while(1){if((o|0)==(i|0))break;w=e[l>>1]|0;f[m>>2]=+(((e[k>>1]|0)*6|0)+w+((e[n>>1]|0)+w<<2)+(e[p>>1]|0)|0)*.00390625;o=o+1|0;p=p+2|0;n=n+2|0;k=k+2|0;l=l+2|0;m=m+4|0}l=2;while(1){if((l|0)==(s|0))break;q=g+((B(l+-2|0,i)|0)<<1)|0;p=q+(i<<1)|0;o=p+(i<<1)|0;n=o+(i<<1)|0;k=0;m=n+(i<<1)|0;r=a+((B(l,i)|0)<<2)|0;while(1){if((k|0)==(i|0))break;f[r>>2]=+(((e[o>>1]|0)*6|0)+(e[q>>1]|0)+((e[n>>1]|0)+(e[p>>1]|0)<<2)+(e[m>>1]|0)|0)*.00390625;k=k+1|0;m=m+2|0;n=n+2|0;o=o+2|0;p=p+2|0;q=q+2|0;r=r+4|0}l=l+1|0}p=g+((B(j+-4|0,i)|0)<<1)|0;o=p+(i<<1)|0;n=o+(i<<1)|0;l=0;m=n+(i<<1)|0;k=a+((B(s,i)|0)<<2)|0;while(1){if((l|0)==(i|0))break;w=e[m>>1]|0;f[k>>2]=+(((e[n>>1]|0)*6|0)+(e[p>>1]|0)+(w+(e[o>>1]|0)<<2)+w|0)*.00390625;l=l+1|0;m=m+2|0;n=n+2|0;o=o+2|0;p=p+2|0;k=k+4|0}o=g+((B(j+-3|0,i)|0)<<1)|0;n=o+(i<<1)|0;l=0;m=n+(i<<1)|0;k=a+((B(j+-1|0,i)|0)<<2)|0;while(1){if((l|0)==(i|0))break;w=e[m>>1]|0;f[k>>2]=+((w*6|0)+(e[o>>1]|0)+(w+(e[n>>1]|0)<<2)+w|0)*.00390625;l=l+1|0;m=m+2|0;n=n+2|0;o=o+2|0;k=k+4|0}yb=t;return}function Ui(a,b,d,e,g){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0,t=0;q=yb;yb=yb+16|0;h=q;if(e>>>0<=4){p=Vf(Vf(NE(Vf(Vf(Vf(56032,27047)|0,27081)|0,35e3)|0,168)|0,35007)|0,27176)|0;GE(h,p+(c[(c[p>>2]|0)+-12>>2]|0)|0);o=VF(h,56736)|0;o=Gb[c[(c[o>>2]|0)+28>>2]&63](o,10)|0;WF(h);OE(p,o)|0;KE(p)|0;ua()}if(g>>>0<=4){p=Vf(Vf(NE(Vf(Vf(Vf(56032,27195)|0,27081)|0,35e3)|0,169)|0,35007)|0,27176)|0;GE(h,p+(c[(c[p>>2]|0)+-12>>2]|0)|0);o=VF(h,56736)|0;o=Gb[c[(c[o>>2]|0)+28>>2]&63](o,10)|0;WF(h);OE(p,o)|0;KE(p)|0;ua()}l=e+-1|0;m=e+-2|0;n=e+-3|0;o=e+-4|0;i=b;j=0;while(1){if((j|0)==(g|0))break;p=d+((B(j,e)|0)<<2)|0;r=+f[p>>2];k=p+4|0;h=p+8|0;f[i>>2]=+f[h>>2]+(r+(r*6.0+(r+ +f[k>>2])*4.0));r=+f[p>>2];f[i+4>>2]=+f[p+12>>2]+(r+(+f[k>>2]*6.0+(r+ +f[h>>2])*4.0));h=2;k=i+8|0;while(1){if((h|0)==(m|0))break;s=h+1|0;f[k>>2]=+f[p+(h+2<<2)>>2]+(+f[p+(h+-2<<2)>>2]+(+f[p+(h<<2)>>2]*6.0+(+f[p+(h+-1<<2)>>2]+ +f[p+(s<<2)>>2])*4.0));h=s;k=k+4|0}s=i+(m<<2)|0;k=p+(m<<2)|0;h=p+(n<<2)|0;t=p+(l<<2)|0;r=+f[t>>2];f[s>>2]=r+(+f[p+(o<<2)>>2]+(+f[k>>2]*6.0+(+f[h>>2]+r)*4.0));r=+f[t>>2];f[s+4>>2]=r+(+f[h>>2]+(r*6.0+(r+ +f[k>>2])*4.0));i=i+(e<<2)|0;j=j+1|0}p=g+-2|0;h=b+(e<<2)|0;n=h+(e<<2)|0;i=0;j=n;k=h;l=b;m=a;while(1){if((i|0)==(e|0))break;r=+f[l>>2];f[m>>2]=(+f[j>>2]+(r+(r*6.0+(r+ +f[k>>2])*4.0)))*.00390625;i=i+1|0;j=j+4|0;k=k+4|0;l=l+4|0;m=m+4|0}l=0;m=n+(e<<2)|0;k=n;i=b;j=a+(e<<2)|0;while(1){if((l|0)==(e|0))break;r=+f[i>>2];f[j>>2]=(+f[m>>2]+(r+(+f[h>>2]*6.0+(r+ +f[k>>2])*4.0)))*.00390625;l=l+1|0;m=m+4|0;k=k+4|0;h=h+4|0;i=i+4|0;j=j+4|0}i=2;while(1){if((i|0)==(p|0))break;n=b+((B(i+-2|0,e)|0)<<2)|0;m=n+(e<<2)|0;l=m+(e<<2)|0;k=l+(e<<2)|0;h=0;j=k+(e<<2)|0;o=a+((B(i,e)|0)<<2)|0;while(1){if((h|0)==(e|0))break;f[o>>2]=(+f[j>>2]+(+f[n>>2]+(+f[l>>2]*6.0+(+f[m>>2]+ +f[k>>2])*4.0)))*.00390625;h=h+1|0;j=j+4|0;k=k+4|0;l=l+4|0;m=m+4|0;n=n+4|0;o=o+4|0}i=i+1|0}m=b+((B(g+-4|0,e)|0)<<2)|0;l=m+(e<<2)|0;k=l+(e<<2)|0;i=0;j=k+(e<<2)|0;h=a+((B(p,e)|0)<<2)|0;while(1){if((i|0)==(e|0))break;r=+f[j>>2];f[h>>2]=(r+(+f[m>>2]+(+f[k>>2]*6.0+(+f[l>>2]+r)*4.0)))*.00390625;i=i+1|0;j=j+4|0;k=k+4|0;l=l+4|0;m=m+4|0;h=h+4|0}l=b+((B(g+-3|0,e)|0)<<2)|0;k=l+(e<<2)|0;i=0;j=k+(e<<2)|0;h=a+((B(g+-1|0,e)|0)<<2)|0;while(1){if((i|0)==(e|0))break;r=+f[j>>2];f[h>>2]=(r+(+f[l>>2]+(r*6.0+(+f[k>>2]+r)*4.0)))*.00390625;i=i+1|0;j=j+4|0;k=k+4|0;l=l+4|0;h=h+4|0}yb=q;return}function Vi(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0;l=c>>>1;j=d>>>1;k=c<<1;i=0;while(1){if((i|0)==(j|0))break;g=b+((B(k,i)|0)<<2)|0;d=0;e=g+(c<<2)|0;h=a;while(1){if((d|0)==(l|0))break;f[h>>2]=(+f[g>>2]+ +f[g+4>>2]+ +f[e>>2]+ +f[e+4>>2])*.25;d=d+1|0;e=e+8|0;g=g+8|0;h=h+4|0}i=i+1|0;a=a+(l<<2)|0}return}function Wi(a){a=a|0;c[a>>2]=15692;a=a+4|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;c[a+16>>2]=0;c[a+20>>2]=0;c[a+24>>2]=0;return}function Xi(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0;c[a+16>>2]=b;c[a+20>>2]=d;e=+La(+(1.0/+(d+-1|0)));f[a+24>>2]=e;f[a+28>>2]=1.0/+z(+e);return}function Yi(a){a=a|0;var b=0;Wi(a);c[a>>2]=15676;a=a+32|0;b=a+36|0;do{c[a>>2]=0;a=a+4|0}while((a|0)<(b|0));return}function Zi(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0;Xi(a,e,3);k=a+4|0;l=a+20|0;Pg(k,B(c[l>>2]|0,e)|0);g=0;while(1){if((g|0)>=(e|0))break;h=b>>>g;i=d>>>g;f=0;while(1){j=c[l>>2]|0;if(f>>>0>=j>>>0)break;j=(B(j,g)|0)+f|0;aq((c[k>>2]|0)+(j<<5)|0,2,h,i,-1,1);f=f+1|0}g=g+1|0}l=B(d,b)|0;_i(a+32|0,l);dh(a+44|0,l);dh(a+56|0,l);return}function _i(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=a+4|0;f=c[a>>2]|0;e=(c[d>>2]|0)-f>>1;if(e>>>0>=b>>>0){if(e>>>0>b>>>0)c[d>>2]=f+(b<<1)}else $i(a,b-e|0);return}function $i(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;i=yb;yb=yb+32|0;f=i;g=a+8|0;h=a+4|0;d=c[h>>2]|0;do if((c[g>>2]|0)-d>>1>>>0>>0){d=(d-(c[a>>2]|0)>>1)+b|0;e=bj(a)|0;if(e>>>0>>0)CO(a);else{j=c[a>>2]|0;g=(c[g>>2]|0)-j|0;cj(f,g>>1>>>0>>1>>>0?(g>>>0>>0?d:g):e,(c[h>>2]|0)-j>>1,a+8|0);dj(f,b);ej(a,f);fj(f);break}}else aj(a,b);while(0);yb=i;return}function aj(a,b){a=a|0;b=b|0;var d=0;a=a+4|0;d=c[a>>2]|0;_O(d|0,0,b<<1|0)|0;c[a>>2]=d+(b<<1);return}function bj(a){a=a|0;return 2147483647}function cj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;do if(b)if((b|0)<0){f=O(8)|0;bO(f,37409);c[f>>2]=16392;Q(f|0,13960,22)}else{e=rB(b<<1)|0;break}else e=0;while(0);c[a>>2]=e;d=e+(d<<1)|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+(b<<1);return}function dj(a,b){a=a|0;b=b|0;var d=0;a=a+8|0;d=c[a>>2]|0;_O(d|0,0,b<<1|0)|0;c[a>>2]=d+(b<<1);return}function ej(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[a>>2]|0;h=a+4|0;g=b+4|0;f=(c[h>>2]|0)-e|0;d=(c[g>>2]|0)+(0-(f>>1)<<1)|0;c[g>>2]=d;if((f|0)>0){YO(d|0,e|0,f|0)|0;e=g;d=c[g>>2]|0}else e=g;g=c[a>>2]|0;c[a>>2]=d;c[e>>2]=g;g=b+8|0;f=c[h>>2]|0;c[h>>2]=c[g>>2];c[g>>2]=f;g=a+8|0;h=b+12|0;a=c[g>>2]|0;c[g>>2]=c[h>>2];c[h>>2]=a;c[b>>2]=c[e>>2];return}function fj(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a+4>>2]|0;d=a+8|0;e=c[d>>2]|0;while(1){if((e|0)==(b|0))break;f=e+-2|0;c[d>>2]=f;e=f}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function gj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=yb;yb=yb+16|0;d=h;if((Kg(b)|0)!=1){g=Vf(Vf(NE(Vf(Vf(Vf(56032,27230)|0,27081)|0,35e3)|0,330)|0,35007)|0,27281)|0;GE(d,g+(c[(c[g>>2]|0)+-12>>2]|0)|0);f=VF(d,56736)|0;f=Gb[c[(c[f>>2]|0)+28>>2]&63](f,10)|0;WF(d);OE(g,f)|0;KE(g)|0;ua()}if((_g(b)|0)!=1){g=Vf(Vf(NE(Vf(Vf(Vf(56032,27305)|0,27081)|0,35e3)|0,331)|0,35007)|0,27350)|0;GE(d,g+(c[(c[g>>2]|0)+-12>>2]|0)|0);f=VF(d,56736)|0;f=Gb[c[(c[f>>2]|0)+28>>2]&63](f,10)|0;WF(d);OE(g,f)|0;KE(g)|0;ua()}e=a+4|0;f=a+16|0;g=a+20|0;if(((c[a+8>>2]|0)-(c[e>>2]|0)>>5|0)!=(B(c[g>>2]|0,c[f>>2]|0)|0)){i=Vf(Vf(NE(Vf(Vf(Vf(56032,27376)|0,27081)|0,35e3)|0,333)|0,35007)|0,27450)|0;GE(d,i+(c[(c[i>>2]|0)+-12>>2]|0)|0);j=VF(d,56736)|0;j=Gb[c[(c[j>>2]|0)+28>>2]&63](j,10)|0;WF(d);OE(i,j)|0;KE(i)|0;ua()}j=Lg(b)|0;if((j|0)!=(Lg(c[e>>2]|0)|0)){j=Vf(Vf(NE(Vf(Vf(Vf(56032,27485)|0,27081)|0,35e3)|0,334)|0,35007)|0,27545)|0;GE(d,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(d,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(d);OE(j,i)|0;KE(j)|0;ua()}j=Mg(b)|0;if((j|0)!=(Mg(c[e>>2]|0)|0)){j=Vf(Vf(NE(Vf(Vf(Vf(56032,27577)|0,27081)|0,35e3)|0,335)|0,35007)|0,27545)|0;GE(d,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(d,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(d);OE(j,i)|0;KE(j)|0;ua()}hj(a,c[e>>2]|0,b);b=c[e>>2]|0;hj(a,b+32|0,b);b=c[e>>2]|0;ij(a,b+64|0,b+32|0);b=1;while(1){if(b>>>0>=(c[f>>2]|0)>>>0)break;k=B(c[g>>2]|0,b)|0;k=jj((c[e>>2]|0)+(k<<5)|0)|0;d=(B(c[g>>2]|0,b)|0)+-1|0;d=jj((c[e>>2]|0)+(d<<5)|0)|0;i=(B(c[g>>2]|0,b)|0)+-1|0;i=Lg((c[e>>2]|0)+(i<<5)|0)|0;j=(B(c[g>>2]|0,b)|0)+-1|0;Vi(k,d,i,Mg((c[e>>2]|0)+(j<<5)|0)|0);j=B(c[g>>2]|0,b)|0;i=c[e>>2]|0;hj(a,i+(j+1<<5)|0,i+(j<<5)|0);j=B(c[g>>2]|0,b)|0;i=c[e>>2]|0;ij(a,i+(j+2<<5)|0,i+(j+1<<5)|0);b=b+1|0}yb=h;return}function hj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;f=yb;yb=yb+16|0;e=f;if((Kg(b)|0)!=2){g=Vf(Vf(NE(Vf(Vf(Vf(56032,27639)|0,27081)|0,35e3)|0,357)|0,35007)|0,27686)|0;GE(e,g+(c[(c[g>>2]|0)+-12>>2]|0)|0);h=VF(e,56736)|0;h=Gb[c[(c[h>>2]|0)+28>>2]&63](h,10)|0;WF(e);OE(g,h)|0;KE(g)|0;ua()}switch(Kg(d)|0){case 1:{e=jj(b)|0;g=c[a+32>>2]|0;h=Bi(d)|0;Ti(e,g,h,Lg(d)|0,Mg(d)|0);break}case 2:{e=jj(b)|0;g=c[a+44>>2]|0;h=Bi(d)|0;Ui(e,g,h,Lg(d)|0,Mg(d)|0);break}case 0:{h=O(16)|0;c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;eO(e,27722,Wf(27722)|0);kj(h,e);Q(h|0,13208,5)}default:{h=O(16)|0;c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;eO(e,27741,Wf(27741)|0);kj(h,e);Q(h|0,13208,5)}}yb=f;return}function ij(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=yb;yb=yb+32|0;f=e;j=c[a+56>>2]|0;i=Kg(d)|0;h=Lg(d)|0;g=Mg(d)|0;iq(f,j,i,h,g,Ci(d)|0,1);hj(a,f,d);hj(a,b,f);pq(f);yb=e;return}function jj(a){a=a|0;return c[a+24>>2]|0}function kj(a,b){a=a|0;b=b|0;c[a>>2]=15708;dO(a+4|0,b);return}function lj(a){a=a|0;c[a>>2]=15708;hO(a+4|0);return}function mj(a){a=a|0;lj(a);QA(a);return}function nj(b){b=b|0;b=b+4|0;if((a[b+11>>0]|0)<0)b=c[b>>2]|0;return b|0}function oj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0.0,o=0.0,p=0;m=c+-1|0;j=b+(c<<2)|0;h=b+4|0;n=+f[b>>2];o=+f[h>>2]-n;n=+f[j>>2]-n;f[a>>2]=+y(+n,+o)+3.141592653589793;f[a+4>>2]=+u(+(o*o+n*n));g=1;e=j;while(1){i=a+8|0;e=e+4|0;if(g>>>0>=m>>>0)break;l=h+4|0;n=+f[l>>2]-+f[h+-4>>2];o=+f[e>>2]-+f[h>>2];f[i>>2]=+y(+o,+n)+3.141592653589793;f[a+12>>2]=+u(+(n*n+o*o));g=g+1|0;h=l;a=i}l=d+-1|0;o=+f[h>>2];n=o-+f[h+-4>>2];o=+f[e>>2]-o;f[i>>2]=+y(+o,+n)+3.141592653589793;f[a+12>>2]=+u(+(n*n+o*o));k=1;g=i;d=j+(c<<2)|0;h=b;a=j;while(1){e=g+8|0;if(k>>>0>=l>>>0)break;j=a+4|0;n=+f[j>>2]-+f[a>>2];o=+f[d>>2]-+f[h>>2];f[e>>2]=+y(+o,+n)+3.141592653589793;f[g+12>>2]=+u(+(n*n+o*o));i=1;g=g+16|0;while(1){a=d+4|0;e=h+4|0;if(i>>>0>=m>>>0)break;p=j+4|0;n=+f[p>>2]-+f[j+-4>>2];o=+f[a>>2]-+f[e>>2];f[g>>2]=+y(+o,+n)+3.141592653589793;f[g+4>>2]=+u(+(n*n+o*o));i=i+1|0;d=a;h=e;j=p;g=g+8|0}n=+f[j>>2]-+f[j+-4>>2];o=+f[a>>2]-+f[e>>2];f[g>>2]=+y(+o,+n)+3.141592653589793;f[g+4>>2]=+u(+(n*n+o*o));k=k+1|0;d=d+8|0;h=h+8|0;a=j+4|0}h=b+((B(l,c)|0)<<2)|0;a=h+(0-c<<2)|0;p=h+4|0;o=+f[h>>2];n=+f[p>>2]-o;o=o-+f[a>>2];f[e>>2]=+y(+o,+n)+3.141592653589793;f[g+12>>2]=+u(+(n*n+o*o));h=1;g=p;while(1){d=e+8|0;a=a+4|0;if(h>>>0>=m>>>0)break;p=g+4|0;n=+f[p>>2]-+f[g+-4>>2];o=+f[g>>2]-+f[a>>2];f[d>>2]=+y(+o,+n)+3.141592653589793;f[e+12>>2]=+u(+(n*n+o*o));h=h+1|0;e=d;g=p}o=+f[g>>2];n=o-+f[g+-4>>2];o=o-+f[a>>2];f[d>>2]=+y(+o,+n)+3.141592653589793;f[e+12>>2]=+u(+(n*n+o*o));return}function pj(a){a=a|0;return 536870911}function qj(a){a=a|0;var b=0;c[a>>2]=0;c[a+4>>2]=0;a=a+12|0;b=a+40|0;do{c[a>>2]=0;a=a+4|0}while((a|0)<(b|0));return}function rj(a){a=a|0;kh(a+40|0);eh(a+28|0);return}function sj(a,b,d,e,g,h,i,j,k,l){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;h=h|0;i=+i;j=+j;k=k|0;l=+l;var m=0,n=0,o=0;c[a>>2]=e;n=a+4|0;c[n>>2]=g;c[a+8>>2]=h;f[a+12>>2]=i;f[a+16>>2]=j;c[a+20>>2]=k;f[a+24>>2]=l;dh(a+28|0,h);o=a+40|0;Pg(o,B(c[n>>2]|0,c[a>>2]|0)|0);k=0;while(1){if((k|0)==(e|0))break;a=B(k,g)|0;m=b>>>k;n=d>>>k;h=0;while(1){if((h|0)==(g|0))break;aq((c[o>>2]|0)+(h+a<<5)|0,2,m,n,-1,2);h=h+1|0}k=k+1|0}return}function tj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;g=yb;yb=yb+16|0;f=g;e=a+40|0;a=0;while(1){d=yh(b)|0;if(a>>>0>=(c[d+4>>2]|0)-(c[d>>2]|0)>>5>>>0){a=3;break}d=(c[(yh(b)|0)>>2]|0)+(a<<5)|0;h=Lg(d)|0;if((h|0)!=((Ci(d)|0)>>>2|0)){a=5;break}j=uj((c[e>>2]|0)+(a<<5)|0)|0;i=vj(d)|0;h=Lg(d)|0;oj(j,i,h,Mg(d)|0);a=a+1|0}if((a|0)==3){yb=g;return}else if((a|0)==5){j=Vf(Vf(NE(Vf(Vf(Vf(56032,27784)|0,27845)|0,35e3)|0,96)|0,35007)|0,27934)|0;GE(f,j+(c[(c[j>>2]|0)+-12>>2]|0)|0);i=VF(f,56736)|0;i=Gb[c[(c[i>>2]|0)+28>>2]&63](i,10)|0;WF(f);OE(j,i)|0;KE(j)|0;ua()}}function uj(a){a=a|0;return c[a+24>>2]|0}function vj(a){a=a|0;return c[a+24>>2]|0}function wj(a,b,d,e,g,i,j,k){a=a|0;b=b|0;d=d|0;e=e|0;g=g|0;i=+i;j=+j;k=+k;var l=0,m=0,n=0.0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0,C=0,D=0,E=0,F=0,G=0;F=yb;yb=yb+48|0;D=F+32|0;E=F+24|0;w=F+16|0;x=F+12|0;y=F+8|0;z=F+4|0;C=F;if(!(i>=0.0)){v=Vf(Vf(NE(Vf(Vf(Vf(56032,27975)|0,27845)|0,35e3)|0,119)|0,35007)|0,28005)|0;GE(D,v+(c[(c[v>>2]|0)+-12>>2]|0)|0);u=VF(D,56736)|0;u=Gb[c[(c[u>>2]|0)+28>>2]&63](u,10)|0;WF(D);OE(v,u)|0;KE(v)|0;ua()}l=a+4|0;v=(B(c[l>>2]|0,e)|0)+g|0;m=a+40|0;if(!(+((Lg((c[m>>2]|0)+(v<<5)|0)|0)>>>0)>i)){v=Vf(Vf(NE(Vf(Vf(Vf(56032,28024)|0,27845)|0,35e3)|0,120)|0,35007)|0,28104)|0;GE(D,v+(c[(c[v>>2]|0)+-12>>2]|0)|0);u=VF(D,56736)|0;u=Gb[c[(c[u>>2]|0)+28>>2]&63](u,10)|0;WF(D);OE(v,u)|0;KE(v)|0;ua()}if(!(j>=0.0)){v=Vf(Vf(NE(Vf(Vf(Vf(56032,28140)|0,27845)|0,35e3)|0,121)|0,35007)|0,28170)|0;GE(D,v+(c[(c[v>>2]|0)+-12>>2]|0)|0);u=VF(D,56736)|0;u=Gb[c[(c[u>>2]|0)+28>>2]&63](u,10)|0;WF(D);OE(v,u)|0;KE(v)|0;ua()}v=(B(c[l>>2]|0,e)|0)+g|0;if(!(+((Mg((c[m>>2]|0)+(v<<5)|0)|0)>>>0)>j)){v=Vf(Vf(NE(Vf(Vf(Vf(56032,28189)|0,27845)|0,35e3)|0,122)|0,35007)|0,28270)|0;GE(D,v+(c[(c[v>>2]|0)+-12>>2]|0)|0);u=VF(D,56736)|0;u=Gb[c[(c[u>>2]|0)+28>>2]&63](u,10)|0;WF(D);OE(v,u)|0;KE(v)|0;ua()}q=(B(c[l>>2]|0,e)|0)+g|0;q=(c[m>>2]|0)+(q<<5)|0;if((_g(q)|0)!=2){v=Vf(Vf(NE(Vf(Vf(Vf(56032,28307)|0,27845)|0,35e3)|0,126)|0,35007)|0,28348)|0;GE(D,v+(c[(c[v>>2]|0)+-12>>2]|0)|0);u=VF(D,56736)|0;u=Gb[c[(c[u>>2]|0)+28>>2]&63](u,10)|0;WF(D);OE(v,u)|0;KE(v)|0;ua()}c[d>>2]=0;e=~~(i+.5);l=~~(j+.5);a:do if(((e|0)>=0?!((l|0)<0|(Lg(q)|0)>>>0<=e>>>0):0)?(Mg(q)|0)>>>0>l>>>0:0){n=+xj(1.0,+f[a+12>>2]*k);s=-1.0/(+hi(n)*2.0);n=n*+f[a+16>>2];t=+A(+(+hi(n)));m=~~(n+.5);p=yj(0,e-m|0)|0;o=zj(m+e|0,(Lg(q)|0)+-1|0)|0;e=yj(0,l-m|0)|0;m=zj(m+l|0,(Mg(q)|0)+-1|0)|0;u=a+28|0;v=c[u>>2]|0;Aj(v,(c[a+32>>2]|0)-v>>2);v=a+8|0;while(1){if((e|0)>(m|0))break;k=+hi(+(e|0)-j);g=ah(q,e)|0;l=p;while(1){if((l|0)>(o|0))break;n=k+ +hi(+(l|0)-i);if(!(n>t)){G=g+(l<<1<<2)|0;n=+Bj(s*n);r=c[v>>2]|0;Cj(c[u>>2]|0,+f[G>>2]*+(r|0)*.159154943091895,n*+f[G+4>>2],r)}l=l+1|0}e=e+1|0}l=a+20|0;e=0;while(1){if((e|0)>=(c[l>>2]|0))break;G=c[u>>2]|0;Dj(G,G,c[v>>2]|0,15720);e=e+1|0}l=c[v>>2]|0;e=0;s=0.0;while(1){if((e|0)>=(l|0))break;j=+f[(c[u>>2]|0)+(e<<2)>>2];e=e+1|0;s=j>s?j:s}if(!(s==0.0)){if(!(s>0.0)){G=Vf(Vf(NE(Vf(Vf(Vf(56032,28379)|0,27845)|0,35e3)|0,218)|0,35007)|0,28417)|0;GE(D,G+(c[(c[G>>2]|0)+-12>>2]|0)|0);r=VF(D,56736)|0;r=Gb[c[(c[r>>2]|0)+28>>2]&63](r,10)|0;WF(D);OE(G,r)|0;KE(G)|0;ua()}p=D+4|0;q=E+4|0;r=w+4|0;o=a+24|0;m=0;e=l;while(1){if((m|0)>=(e|0))break a;n=+(m|0);f[D>>2]=n;l=c[u>>2]|0;G=l+(m<<2)|0;a=c[G>>2]|0;c[p>>2]=a;g=m+-1|0;f[E>>2]=+(g|0);g=c[l+(((g+e|0)%(e|0)|0)<<2)>>2]|0;c[q>>2]=g;m=m+1|0;f[w>>2]=+(m|0);l=c[l+(((m+e|0)%(e|0)|0)<<2)>>2]|0;c[r>>2]=l;k=(c[h>>2]=a,+f[h>>2]);if(+f[G>>2]>s*+f[o>>2]?(j=(c[h>>2]=l,+f[h>>2]),k>(c[h>>2]=g,+f[h>>2])&k>j):0){f[C>>2]=n;if(Ej(x,y,z,E,D,w)|0)Fj(C,+f[x>>2],+f[y>>2],+f[z>>2])|0;j=+(c[v>>2]|0);e=c[d>>2]|0;f[b+(e<<2)>>2]=(+f[C>>2]+.5+j)/j*6.283185307179586%6.283185307179586;c[d>>2]=e+1;e=c[v>>2]|0}}}}while(0);yb=F;return}function xj(a,b){a=+a;b=+b;return +(a>b?a:b)}function yj(a,b){a=a|0;b=b|0;return ((a|0)>(b|0)?a:b)|0}function zj(a,b){a=a|0;b=b|0;return ((a|0)<(b|0)?a:b)|0}function Aj(a,b){a=a|0;b=b|0;_O(a|0,0,b<<2|0)|0;return}function Bj(a){a=+a;return +(((((((a+6.0)*a+30.0)*a+120.0)*a+360.0)*a+720.0)*a+720.0)*.0013888888)}function Cj(a,b,d,e){a=a|0;b=+b;d=+d;e=e|0;var g=0.0,h=0,i=0,j=0,k=0,l=0;j=yb;yb=yb+16|0;i=j;if(!a){h=Vf(Vf(NE(Vf(Vf(Vf(56032,28448)|0,28484)|0,35e3)|0,139)|0,35007)|0,28571)|0;GE(i,h+(c[(c[h>>2]|0)+-12>>2]|0)|0);k=VF(i,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(i);OE(h,k)|0;KE(h)|0;ua()}if(b+.5>0.0?(g=b+-.5,g<+(e|0)):0){if(!(d>=0.0)){k=Vf(Vf(NE(Vf(Vf(Vf(56032,28702)|0,28484)|0,35e3)|0,141)|0,35007)|0,28740)|0;GE(i,k+(c[(c[k>>2]|0)+-12>>2]|0)|0);h=VF(i,56736)|0;h=Gb[c[(c[h>>2]|0)+28>>2]&63](h,10)|0;WF(i);OE(k,h)|0;KE(k)|0;ua()}if((e|0)<=-1){k=Vf(Vf(NE(Vf(Vf(Vf(56032,28769)|0,28484)|0,35e3)|0,142)|0,35007)|0,28806)|0;GE(i,k+(c[(c[k>>2]|0)+-12>>2]|0)|0);h=VF(i,56736)|0;h=Gb[c[(c[h>>2]|0)+28>>2]&63](h,10)|0;WF(i);OE(k,h)|0;KE(k)|0;ua()}k=~~+s(+g);b=b-+(k|0)+-.5;g=1.0-b;h=(k+e|0)%(e|0)|0;e=(k+1|0)%(e|0)|0;if(!(g>=0.0)){k=Vf(Vf(NE(Vf(Vf(Vf(56032,28835)|0,28484)|0,35e3)|0,150)|0,35007)|0,28866)|0;GE(i,k+(c[(c[k>>2]|0)+-12>>2]|0)|0);l=VF(i,56736)|0;l=Gb[c[(c[l>>2]|0)+28>>2]&63](l,10)|0;WF(i);OE(k,l)|0;KE(k)|0;ua()}if(!(b>=0.0)){l=Vf(Vf(NE(Vf(Vf(Vf(56032,28886)|0,28484)|0,35e3)|0,151)|0,35007)|0,28917)|0;GE(i,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);k=VF(i,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(i);OE(l,k)|0;KE(l)|0;ua()}if((h|0)<=-1){l=Vf(Vf(NE(Vf(Vf(Vf(56032,28937)|0,28484)|0,35e3)|0,152)|0,35007)|0,28985)|0;GE(i,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);k=VF(i,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(i);OE(l,k)|0;KE(l)|0;ua()}if((e|0)>-1){l=a+(h<<2)|0;f[l>>2]=g*d+ +f[l>>2];l=a+(e<<2)|0;f[l>>2]=b*d+ +f[l>>2];yb=j;return}else{l=Vf(Vf(NE(Vf(Vf(Vf(56032,29011)|0,28484)|0,35e3)|0,153)|0,35007)|0,29059)|0;GE(i,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);k=VF(i,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(i);OE(l,k)|0;KE(l)|0;ua()}}l=Vf(Vf(NE(Vf(Vf(Vf(56032,28597)|0,28484)|0,35e3)|0,140)|0,35007)|0,28662)|0;GE(i,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);k=VF(i,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(i);OE(l,k)|0;KE(l)|0;ua()}function Dj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,g=0,h=0,i=0,j=0,k=0.0,l=0,m=0.0;k=+f[b>>2];g=c+-1|0;h=b+(g<<2)|0;i=d+4|0;j=d+8|0;e=+f[h>>2];c=0;while(1){if((c|0)==(g|0))break;m=+f[b+(c<<2)>>2];l=c+1|0;f[a+(c<<2)>>2]=e*+f[d>>2]+m*+f[i>>2]+ +f[j>>2]*+f[b+(l<<2)>>2];e=m;c=l}f[a+(g<<2)>>2]=e*+f[d>>2]+ +f[i>>2]*+f[h>>2]+k*+f[j>>2];return}function Ej(a,b,c,d,e,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0,n=0.0;h=+f[g>>2];k=+f[e>>2];l=+f[d>>2];j=h-l;h=(h-k)*j;i=l-k;j=i*j;if(i==0.0|(h==0.0|j==0.0)){f[a>>2]=0.0;f[b>>2]=0.0;b=0;h=0.0}else{l=l*l;m=e+4|0;n=+f[m>>2];e=d+4|0;h=(+f[g+4>>2]-n)/h-(+f[e>>2]-n)/j;f[a>>2]=h;h=(+f[e>>2]-+f[m>>2]+(k*k-l)*h)/i;f[b>>2]=h;b=1;h=+f[e>>2]-l*+f[a>>2]-h*+f[d>>2]}f[c>>2]=h;return b|0}function Fj(a,b,c,d){a=a|0;b=+b;c=+c;d=+d;if(b==0.0)a=0;else{f[a>>2]=-c/(b*2.0);a=1}return a|0}function Gj(a){a=a|0;var b=0,d=0;c[a>>2]=0;d=rB(24)|0;Hj(d);b=c[a>>2]|0;c[a>>2]=d;if(b|0){Ij(b);QA(b)}return}function Hj(a){a=a|0;var b=0,d=0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;c[a+16>>2]=0;c[a+20>>2]=1065353216;d=rB(840)|0;Zj(d);b=c[a>>2]|0;c[a>>2]=d;if(b|0){Kj(b);QA(b)}return}function Ij(a){a=a|0;var b=0;Jj(a+4|0);b=c[a>>2]|0;c[a>>2]=0;if(b|0){Kj(b);QA(b)}return}function Jj(a){a=a|0;Wj(a);return}function Kj(a){a=a|0;Lj(a+788|0);ip(a+652|0);Mj(a+636|0);Nj(a+316|0);wh(a+160|0);Oi(a+92|0);Oj(a+72|0);Pj(a+64|0);Qj(a+12|0);return}function Lj(a){a=a|0;Uj(a+24|0);Vj(a+12|0);eh(a);return}function Mj(a){a=a|0;Qj(a);return}function Nj(a){a=a|0;return}function Oj(a){a=a|0;Rj(a);return}function Pj(a){a=a|0;var b=0,d=0;a=c[a+4>>2]|0;if(a|0?(d=a+4|0,b=c[d>>2]|0,c[d>>2]=b+-1,(b|0)==0):0){Qb[c[(c[a>>2]|0)+8>>2]&255](a);YN(a)}return}function Qj(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;d=b;if(b|0){c[a+4>>2]=d;Nf(b,(c[a+8>>2]|0)-d|0)}return}function Rj(a){a=a|0;var b=0;Sj(a,c[a+8>>2]|0);b=c[a>>2]|0;c[a>>2]=0;if(b|0)Nf(b,c[a+4>>2]<<2);return}function Sj(a,b){a=a|0;b=b|0;while(1){if(!b)break;a=c[b>>2]|0;Tj(b+8|0);Nf(b,20);b=a}return}function Tj(a){a=a|0;Pj(a+4|0);return}function Uj(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;d=b;if(b|0){c[a+4>>2]=d;Nf(b,(c[a+8>>2]|0)-d|0)}return}function Vj(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;d=b;if(b|0){c[a+4>>2]=d;Nf(b,(c[a+8>>2]|0)-d|0)}return}function Wj(a){a=a|0;var b=0;Xj(a,c[a+8>>2]|0);b=c[a>>2]|0;c[a>>2]=0;if(b|0)Nf(b,c[a+4>>2]<<2);return}function Xj(a,b){a=a|0;b=b|0;while(1){if(!b)break;a=c[b>>2]|0;Yj(b+8|0);Nf(b,24);b=a}return}function Yj(a){a=a|0;jg(a+4|0);return}function Zj(b){b=b|0;var d=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;d=b+64|0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[d+16>>2]=0;c[d+20>>2]=0;c[b+88>>2]=1065353216;Yi(b+92|0);d=b+160|0;bh(d);Ep(b+316|0);_j(b+636|0);hp(b+652|0);$j(b+788|0,.009999999776482582,1024,1064,50);ak(d,3.0);bk(d,4.0);ch(d,500);f[b+4>>2]=3.0;c[b>>2]=8;a[b+8>>0]=1;return}function _j(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;f[a+12>>2]=.699999988079071;return}function $j(a,b,d,e,f){a=a|0;b=+b;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=a;h=g+36|0;do{c[g>>2]=0;g=g+4|0}while((g|0)<(h|0));ck(a,b,d,e,f);return}function ak(a,b){a=a|0;b=+b;f[a+52>>2]=b;return}function bk(a,b){a=a|0;b=+b;f[a+56>>2]=b;return}function ck(a,b,d,e,g){a=a|0;b=+b;d=d|0;e=e|0;g=g|0;dh(a,d*9|0);dk(a+24|0,d);f[a+36>>2]=b;c[a+40>>2]=d;c[a+44>>2]=e;c[a+48>>2]=g;return}function dk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=a+4|0;f=c[a>>2]|0;e=(c[d>>2]|0)-f>>3;if(e>>>0>=b>>>0){if(e>>>0>b>>>0)c[d>>2]=f+(b<<3)}else ek(a,b-e|0);return}function ek(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=yb;yb=yb+32|0;f=i;g=a+8|0;h=a+4|0;d=c[h>>2]|0;do if((c[g>>2]|0)-d>>3>>>0>>0){d=(d-(c[a>>2]|0)>>3)+b|0;e=gk(a)|0;if(e>>>0>>0)CO(a);else{j=c[a>>2]|0;k=(c[g>>2]|0)-j|0;g=k>>2;hk(f,k>>3>>>0>>1>>>0?(g>>>0>>0?d:g):e,(c[h>>2]|0)-j>>3,a+8|0);ik(f,b);jk(a,f);kk(f);break}}else fk(a,b);while(0);yb=i;return}function fk(a,b){a=a|0;b=b|0;var d=0;a=a+4|0;d=c[a>>2]|0;_O(d|0,0,b<<3|0)|0;c[a>>2]=d+(b<<3);return}function gk(a){a=a|0;return 536870911}function hk(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;do if(b)if(b>>>0>536870911){f=O(8)|0;bO(f,37409);c[f>>2]=16392;Q(f|0,13960,22)}else{e=rB(b<<3)|0;break}else e=0;while(0);c[a>>2]=e;d=e+(d<<3)|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+(b<<3);return}function ik(a,b){a=a|0;b=b|0;var d=0;a=a+8|0;d=c[a>>2]|0;_O(d|0,0,b<<3|0)|0;c[a>>2]=d+(b<<3);return}function jk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[a>>2]|0;h=a+4|0;g=b+4|0;f=(c[h>>2]|0)-e|0;d=(c[g>>2]|0)+(0-(f>>3)<<3)|0;c[g>>2]=d;if((f|0)>0){YO(d|0,e|0,f|0)|0;e=g;d=c[g>>2]|0}else e=g;g=c[a>>2]|0;c[a>>2]=d;c[e>>2]=g;g=b+8|0;f=c[h>>2]|0;c[h>>2]=c[g>>2];c[g>>2]=f;g=a+8|0;h=b+12|0;a=c[g>>2]|0;c[g>>2]=c[h>>2];c[h>>2]=a;c[b>>2]=c[e>>2];return}function kk(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a+4>>2]|0;d=a+8|0;e=c[d>>2]|0;while(1){if((e|0)==(b|0))break;f=e+-8|0;c[d>>2]=f;e=f}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function lk(a){a=a|0;var b=0;b=c[a>>2]|0;c[a>>2]=0;if(b|0){Ij(b);QA(b)}return}function mk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[b>>2]|0;f=c[a+4>>2]|0;a:do if(f){g=f+-1|0;h=(g&f|0)==0;if(!h)if(e>>>0>>0)d=e;else d=(e>>>0)%(f>>>0)|0;else d=g&e;b=c[(c[a>>2]|0)+(d<<2)>>2]|0;if(b)while(1){b=c[b>>2]|0;if(!b){b=0;break a}a=c[b+4>>2]|0;if((a|0)==(e|0)){if((c[b+8>>2]|0)==(e|0))break a}else{if(!h){if(a>>>0>=f>>>0)a=(a>>>0)%(f>>>0)|0}else a=a&g;if((a|0)!=(d|0)){b=0;break a}}}else b=0}else b=0;while(0);return b|0}function nk(a){a=a|0;return a+4|0}function ok(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=0;while(1){if((b|0)<(c|0)|(a|0)<(c|0))break;d=d+1|0;b=b>>1;a=a>>1}return d|0}function pk(a){a=a|0;return c[a>>2]|0}function qk(a){a=a|0;return c[a+4>>2]|0}function rk(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;$l(a+8|0);am(a+36|0);return}function sk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;d=yb;yb=yb+16|0;e=d;c[a>>2]=b;f=rB(16)|0;c[f+4>>2]=0;c[f+8>>2]=0;c[f>>2]=15740;c[f+12>>2]=b;c[a+4>>2]=f;c[e>>2]=b;c[e+4>>2]=b;Pl(a,e);yb=d;return}function tk(a,b){a=a|0;b=b|0;c[a>>2]=b;return}function uk(a,b){a=a|0;b=b|0;c[a+4>>2]=b;return}function vk(b,d,e,g){b=b|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;k=yb;yb=yb+32|0;i=k+20|0;j=k;if(!d){h=Vf(Vf(NE(Vf(Vf(Vf(56032,33588)|0,30067)|0,35e3)|0,212)|0,35007)|0,33688)|0;GE(i,h+(c[(c[h>>2]|0)+-12>>2]|0)|0);l=VF(i,56736)|0;l=Gb[c[(c[l>>2]|0)+28>>2]&63](l,10)|0;WF(i);OE(h,l)|0;KE(h)|0;ua()}if(!e){l=Vf(Vf(NE(Vf(Vf(Vf(56032,30146)|0,30067)|0,35e3)|0,213)|0,35007)|0,30178)|0;GE(i,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);h=VF(i,56736)|0;h=Gb[c[(c[h>>2]|0)+28>>2]&63](h,10)|0;WF(i);OE(l,h)|0;KE(l)|0;ua()}l=yh(d)|0;if((c[l+4>>2]|0)==(c[l>>2]|0)){l=Vf(Vf(NE(Vf(Vf(Vf(56032,30195)|0,30067)|0,35e3)|0,214)|0,35007)|0,30247)|0;GE(i,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);h=VF(i,56736)|0;h=Gb[c[(c[h>>2]|0)+28>>2]&63](h,10)|0;WF(i);OE(l,h)|0;KE(l)|0;ua()}l=Lg(c[(yh(d)|0)>>2]|0)|0;if((l|0)!=(pk(e)|0)){l=Vf(Vf(NE(Vf(Vf(Vf(56032,30264)|0,30067)|0,35e3)|0,215)|0,35007)|0,30337)|0;GE(i,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);h=VF(i,56736)|0;h=Gb[c[(c[h>>2]|0)+28>>2]&63](h,10)|0;WF(i);OE(l,h)|0;KE(l)|0;ua()}l=Mg(c[(yh(d)|0)>>2]|0)|0;if((l|0)!=(qk(e)|0)){l=Vf(Vf(NE(Vf(Vf(Vf(56032,30372)|0,30067)|0,35e3)|0,216)|0,35007)|0,30337)|0;GE(i,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);h=VF(i,56736)|0;h=Gb[c[(c[h>>2]|0)+28>>2]&63](h,10)|0;WF(i);OE(l,h)|0;KE(l)|0;ua()}Ph(e,d);h=Kl(e)|0;Ll(i,((c[h+4>>2]|0)-(c[h>>2]|0)|0)/36|0);h=0;while(1){l=Kl(e)|0;if(h>>>0>=(((c[l+4>>2]|0)-(c[l>>2]|0)|0)/36|0)>>>0)break;l=c[(Kl(e)|0)>>2]|0;eg(j,+f[l+(h*36|0)>>2],+f[l+(h*36|0)+4>>2],+f[l+(h*36|0)+8>>2],+f[l+(h*36|0)+28>>2],+f[l+(h*36|0)+24>>2]>0.0);l=(c[i>>2]|0)+(h*20|0)|0;c[l>>2]=c[j>>2];c[l+4>>2]=c[j+4>>2];c[l+8>>2]=c[j+8>>2];c[l+12>>2]=c[j+12>>2];a[l+16>>0]=a[j+16>>0]|0;Mf(j);h=h+1|0}Fp(g,xk(b)|0,d,i);Lf(i);yb=k;return}function wk(){if((a[54528]|0)==0?lB(54528)|0:0){qq(55464);nB(54528)}return 55464}function xk(a){a=a|0;return a+8|0}function yk(a){a=a|0;return ((c[a+20>>2]|0)-(c[a+16>>2]|0)|0)/20|0|0}function zk(a){a=a|0;var b=0,d=0;d=a+36|0;Ek(d,128);Fk(d,8);Gk(d,8);Hk(d,16);a=a+8|0;b=c[(Ik(a)|0)>>2]|0;Jk(d,b,yk(a)|0);return}function Ak(a,b){a=a|0;b=b|0;var d=0,e=0,g=0.0,h=0.0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=yb;yb=yb+32|0;r=s+4|0;l=s;m=s+16|0;c[l>>2]=b;q=c[b>>2]|0;o=a+4|0;i=c[o>>2]|0;p=(i|0)==0;a:do if(!p){k=i+-1|0;e=(k&i|0)==0;if(!e)if(q>>>0>>0)j=q;else j=(q>>>0)%(i>>>0)|0;else j=k&q;b=c[(c[a>>2]|0)+(j<<2)>>2]|0;if(!b){b=j;n=16}else do{b=c[b>>2]|0;if(!b){b=j;n=16;break a}d=c[b+4>>2]|0;if((d|0)!=(q|0)){if(!e){if(d>>>0>=i>>>0)d=(d>>>0)%(i>>>0)|0}else d=d&k;if((d|0)!=(j|0)){b=j;n=16;break a}}}while((c[b+8>>2]|0)!=(q|0))}else{b=0;n=16}while(0);if((n|0)==16){Bk(r,a,q,57660,l,m);j=a+12|0;g=+(((c[j>>2]|0)+1|0)>>>0);h=+f[a+16>>2];do if(p|h*+(i>>>0)>>0<3|(i+-1&i|0)!=0)&1;d=~~+A(+(g/h))>>>0;Ck(a,b>>>0>>0?d:b);b=c[o>>2]|0;d=b+-1|0;if(!(d&b)){i=b;b=d&q;break}if(q>>>0>>0){i=b;b=q}else{i=b;b=(q>>>0)%(b>>>0)|0}}while(0);d=c[(c[a>>2]|0)+(b<<2)>>2]|0;if(!d){e=a+8|0;c[c[r>>2]>>2]=c[e>>2];c[e>>2]=c[r>>2];c[(c[a>>2]|0)+(b<<2)>>2]=e;e=c[r>>2]|0;b=c[e>>2]|0;if(!b)b=r;else{b=c[b+4>>2]|0;d=i+-1|0;if(d&i){if(b>>>0>=i>>>0)b=(b>>>0)%(i>>>0)|0}else b=b&d;c[(c[a>>2]|0)+(b<<2)>>2]=e;b=r}}else{c[c[r>>2]>>2]=c[d>>2];c[d>>2]=c[r>>2];b=r}r=c[b>>2]|0;c[j>>2]=(c[j>>2]|0)+1;c[b>>2]=0;b=r}yb=s;return b+12|0}function Bk(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;h=rB(20)|0;c[b>>2]=h;c[b+4>>2]=d+8;c[h+8>>2]=c[c[g>>2]>>2];c[h+12>>2]=0;c[h+16>>2]=0;a[b+8>>0]=1;c[h+4>>2]=e;c[h>>2]=0;return}function Ck(a,b){a=a|0;b=b|0;var d=0,e=0,g=0;if((b|0)!=1){if(b+-1&b)b=yD(b)|0}else b=2;e=c[a+4>>2]|0;if(b>>>0<=e>>>0){if(b>>>0>>0){d=~~+A(+(+((c[a+12>>2]|0)>>>0)/+f[a+16>>2]))>>>0;if(e>>>0>2&(e+-1&e|0)==0){g=1<<32-(C(d+-1|0)|0);d=d>>>0<2?d:g}else d=yD(d)|0;b=b>>>0>>0?d:b;if(b>>>0>>0)Dk(a,b)}}else Dk(a,b);return}function Dk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=a+4|0;a:do if(b){if(b>>>0>1073741823){a=O(8)|0;bO(a,37409);c[a>>2]=16392;Q(a|0,13960,22)}l=rB(b<<2)|0;d=c[a>>2]|0;c[a>>2]=l;if(d|0)Nf(d,c[a+4>>2]<<2);c[e>>2]=b;d=0;while(1){if((d|0)==(b|0))break;c[(c[a>>2]|0)+(d<<2)>>2]=0;d=d+1|0}f=a+8|0;d=c[f>>2]|0;if(d|0){e=c[d+4>>2]|0;k=b+-1|0;l=(k&b|0)==0;if(!l){if(e>>>0>=b>>>0)e=(e>>>0)%(b>>>0)|0}else e=e&k;c[(c[a>>2]|0)+(e<<2)>>2]=f;while(1){j=d;b:while(1){while(1){d=c[j>>2]|0;if(!d)break a;f=c[d+4>>2]|0;if(!l){if(f>>>0>=b>>>0)f=(f>>>0)%(b>>>0)|0}else f=f&k;if((f|0)==(e|0))break;g=(c[a>>2]|0)+(f<<2)|0;if(!(c[g>>2]|0))break b;h=d+8|0;g=d;while(1){i=c[g>>2]|0;if(!i)break;if((c[h>>2]|0)==(c[i+8>>2]|0))g=i;else break}c[j>>2]=i;c[g>>2]=c[c[(c[a>>2]|0)+(f<<2)>>2]>>2];c[c[(c[a>>2]|0)+(f<<2)>>2]>>2]=d}j=d}c[g>>2]=j;e=f}}}else{d=c[a>>2]|0;c[a>>2]=0;if(d|0)Nf(d,c[a+4>>2]<<2);c[e>>2]=0}while(0);return}function Ek(a,b){a=a|0;b=b|0;Jl(a+12|0,b);return}function Fk(a,b){a=a|0;b=b|0;Il(a+12|0,b);return}function Gk(a,b){a=a|0;b=b|0;c[a+104>>2]=b;return}function Hk(a,b){a=a|0;b=b|0;c[a+108>>2]=b;return}function Ik(a){a=a|0;return a+4|0}function Jk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=yb;yb=yb+16|0;g=i;Kk(g,d);f=c[g>>2]|0;h=(c[g+4>>2]|0)-f>>2;e=0;while(1){if((e|0)==(h|0))break;c[f+(e<<2)>>2]=e;e=e+1|0}Lk(a,b,d,f,h);Vj(g);yb=i;return}function Kk(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;if(b|0){Hl(a,b);Dl(a,b)}return}function Lk(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;g=rB(128)|0;Nk(g,Mk(a)|0);i=a+8|0;h=c[i>>2]|0;c[i>>2]=g;if(h){Ok(h);QA(h);g=c[i>>2]|0}Pk(g,0);Qk(a,c[i>>2]|0,b,d,e,f);return}function Mk(a){a=a|0;var b=0;b=a+4|0;a=c[b>>2]|0;c[b>>2]=a+1;return a|0}function Nk(b,d){b=b|0;d=d|0;c[b>>2]=d;a[b+100>>0]=1;d=b+104|0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[d+16>>2]=0;c[d+20>>2]=0;Gl(b+4|0,96);return}function Ok(a){a=a|0;var b=0,d=0,e=0,f=0;e=a+104|0;f=a+108|0;d=0;while(1){b=c[e>>2]|0;if(d>>>0>=(c[f>>2]|0)-b>>2>>>0)break;b=c[b+(d<<2)>>2]|0;if(b|0){Ok(b);QA(b)}d=d+1|0}Vj(a+116|0);Fl(e);return}function Pk(b,c){b=b|0;c=c|0;a[b+100>>0]=c&1;return}function Qk(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 h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;q=yb;yb=yb+32|0;o=q+20|0;p=q;h=a+12|0;n=Rk(h)|0;if((yj(n,c[a+108>>2]|0)|0)>=(g|0)){Pk(b,1);Tk(Sk(b)|0,g);h=0;while(1){if((h|0)>=(g|0))break;p=c[f+(h<<2)>>2]|0;c[(c[(Sk(b)|0)>>2]|0)+(h<<2)>>2]=p;h=h+1|0}yb=q;return}c[p>>2]=0;c[p+4>>2]=0;c[p+8>>2]=0;c[p+12>>2]=0;c[p+16>>2]=1065353216;Uk(h,d,e,f,g);m=Vk(h)|0;n=m+4|0;i=c[n>>2]|0;h=c[m>>2]|0;if((i-h>>2|0)!=(g|0)){l=Vf(Vf(NE(Vf(Vf(Vf(56032,29134)|0,29190)|0,35e3)|0,363)|0,35007)|0,29284)|0;GE(o,l+(c[(c[l>>2]|0)+-12>>2]|0)|0);k=VF(o,56736)|0;k=Gb[c[(c[k>>2]|0)+28>>2]&63](k,10)|0;WF(o);OE(l,k)|0;KE(l)|0;ua()}l=0;while(1){if(l>>>0>=i-h>>2>>>0){h=10;break}h=c[h+(l<<2)>>2]|0;if((h|0)==-1){h=12;break}if((h|0)>=(g|0)){h=14;break}h=f+(h<<2)|0;if((c[h>>2]|0)>=(e|0)){h=16;break}h=Wk(p,h)|0;i=f+(l<<2)|0;j=h+4|0;k=c[j>>2]|0;if((k|0)==(c[h+8>>2]|0))Xk(h,i);else{c[k>>2]=c[i>>2];c[j>>2]=k+4}l=l+1|0;h=c[m>>2]|0;i=c[n>>2]|0}if((h|0)==10){h=p+12|0;a:do if((c[h>>2]|0)==1){Pk(b,1);Tk(Sk(b)|0,g);h=0;while(1){if((h|0)>=(g|0))break a;o=c[f+(h<<2)>>2]|0;c[(c[(Sk(b)|0)>>2]|0)+(h<<2)>>2]=o;h=h+1|0}}else{g=Yk(b)|0;Zk(g,c[h>>2]|0);h=p+8|0;while(1){h=c[h>>2]|0;if(!h)break a;i=h;l=i+12|0;m=i+16|0;if((c[m>>2]|0)==(c[l>>2]|0))break;j=rB(128)|0;k=Mk(a)|0;_k(j,k,d+((c[i+8>>2]|0)*96|0)|0);c[o>>2]=j;Pk(j,0);i=Yk(b)|0;j=i+4|0;k=c[j>>2]|0;if((k|0)==(c[i+8>>2]|0))$k(i,o);else{c[k>>2]=c[o>>2];c[j>>2]=(c[j>>2]|0)+4}g=c[l>>2]|0;Qk(a,c[o>>2]|0,d,e,g,(c[m>>2]|0)-g>>2)}b=Vf(Vf(NE(Vf(Vf(Vf(56032,29507)|0,29190)|0,35e3)|0,387)|0,35007)|0,29553)|0;GE(o,b+(c[(c[b>>2]|0)+-12>>2]|0)|0);e=VF(o,56736)|0;e=Gb[c[(c[e>>2]|0)+28>>2]&63](e,10)|0;WF(o);OE(b,e)|0;KE(b)|0;ua()}while(0);al(p);yb=q;return}else if((h|0)==12){q=Vf(Vf(NE(Vf(Vf(Vf(56032,29306)|0,29190)|0,35e3)|0,365)|0,35007)|0,29349)|0;GE(o,q+(c[(c[q>>2]|0)+-12>>2]|0)|0);b=VF(o,56736)|0;b=Gb[c[(c[b>>2]|0)+28>>2]&63](b,10)|0;WF(o);OE(q,b)|0;KE(q)|0;ua()}else if((h|0)==14){q=Vf(Vf(NE(Vf(Vf(Vf(56032,29371)|0,29190)|0,35e3)|0,366)|0,35007)|0,29422)|0;GE(o,q+(c[(c[q>>2]|0)+-12>>2]|0)|0);b=VF(o,56736)|0;b=Gb[c[(c[b>>2]|0)+28>>2]&63](b,10)|0;WF(o);OE(q,b)|0;KE(q)|0;ua()}else if((h|0)==16){q=Vf(Vf(NE(Vf(Vf(Vf(56032,29446)|0,29190)|0,35e3)|0,367)|0,35007)|0,29422)|0;GE(o,q+(c[(c[q>>2]|0)+-12>>2]|0)|0);b=VF(o,56736)|0;b=Gb[c[(c[b>>2]|0)+28>>2]&63](b,10)|0;WF(o);OE(q,b)|0;KE(q)|0;ua()}}function Rk(a){a=a|0;return c[a+4>>2]|0}function Sk(a){a=a|0;return a+116|0}function Tk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=a+4|0;f=c[a>>2]|0;e=(c[d>>2]|0)-f>>2;if(e>>>0>=b>>>0){if(e>>>0>b>>>0)c[d>>2]=f+(b<<2)}else Cl(a,b-e|0);return}function Uk(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;s=yb;yb=yb+16|0;o=s;p=a+4|0;g=c[p>>2]|0;q=a+12|0;r=a+16|0;if((g|0)!=((c[r>>2]|0)-(c[q>>2]|0)>>2|0)){n=Vf(Vf(NE(Vf(Vf(Vf(56032,29590)|0,29635)|0,35e3)|0,154)|0,35007)|0,29707)|0;GE(o,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(o,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(o);OE(n,m)|0;KE(n)|0;ua()}if((d|0)<=0){n=Vf(Vf(NE(Vf(Vf(Vf(56032,29752)|0,29635)|0,35e3)|0,155)|0,35007)|0,29792)|0;GE(o,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(o,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(o);OE(n,m)|0;KE(n)|0;ua()}if((f|0)>(d|0)){n=Vf(Vf(NE(Vf(Vf(Vf(56032,29828)|0,29635)|0,35e3)|0,156)|0,35007)|0,29879)|0;GE(o,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(o,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(o);OE(n,m)|0;KE(n)|0;ua()}if((g|0)>(f|0)){n=Vf(Vf(NE(Vf(Vf(Vf(56032,29906)|0,29635)|0,35e3)|0,157)|0,35007)|0,29947)|0;GE(o,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(o,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(o);OE(n,m)|0;KE(n)|0;ua()}j=a+24|0;c[o>>2]=-1;ql(j,f,o);k=a+36|0;c[o>>2]=-1;ql(k,f,o);l=a+48|0;Tk(l,f);n=c[l>>2]|0;m=a+52|0;rl(n,(c[m>>2]|0)-n>>2,0);n=a+8|0;g=-1;i=0;while(1){if((i|0)>=(c[n>>2]|0))break;h=c[l>>2]|0;sl(h,(c[m>>2]|0)-h>>2,c[p>>2]|0,c[a>>2]|0);h=tl(a,k,b,d,e,f,c[l>>2]|0,c[p>>2]|0)|0;if(h>>>0>>0){ul(j,k);vl(c[q>>2]|0,c[l>>2]|0,c[p>>2]|0);g=h}i=i+1|0}if((c[p>>2]|0)==((c[r>>2]|0)-(c[q>>2]|0)>>2|0)){yb=s;return}else{s=Vf(Vf(NE(Vf(Vf(Vf(56032,29590)|0,29635)|0,35e3)|0,187)|0,35007)|0,29707)|0;GE(o,s+(c[(c[s>>2]|0)+-12>>2]|0)|0);r=VF(o,56736)|0;r=Gb[c[(c[r>>2]|0)+28>>2]&63](r,10)|0;WF(o);OE(s,r)|0;KE(s)|0;ua()}}function Vk(a){a=a|0;return a+24|0}function Wk(a,b){a=a|0;b=b|0;var d=0,e=0,g=0.0,h=0.0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=yb;yb=yb+32|0;r=s+4|0;l=s;m=s+16|0;c[l>>2]=b;q=c[b>>2]|0;o=a+4|0;i=c[o>>2]|0;p=(i|0)==0;a:do if(!p){k=i+-1|0;e=(k&i|0)==0;if(!e)if(q>>>0>>0)j=q;else j=(q>>>0)%(i>>>0)|0;else j=k&q;b=c[(c[a>>2]|0)+(j<<2)>>2]|0;if(!b){b=j;n=16}else do{b=c[b>>2]|0;if(!b){b=j;n=16;break a}d=c[b+4>>2]|0;if((d|0)!=(q|0)){if(!e){if(d>>>0>=i>>>0)d=(d>>>0)%(i>>>0)|0}else d=d&k;if((d|0)!=(j|0)){b=j;n=16;break a}}}while((c[b+8>>2]|0)!=(q|0))}else{b=0;n=16}while(0);if((n|0)==16){nl(r,a,q,57660,l,m);j=a+12|0;g=+(((c[j>>2]|0)+1|0)>>>0);h=+f[a+16>>2];do if(p|h*+(i>>>0)>>0<3|(i+-1&i|0)!=0)&1;d=~~+A(+(g/h))>>>0;ol(a,b>>>0>>0?d:b);b=c[o>>2]|0;d=b+-1|0;if(!(d&b)){i=b;b=d&q;break}if(q>>>0>>0){i=b;b=q}else{i=b;b=(q>>>0)%(b>>>0)|0}}while(0);d=c[(c[a>>2]|0)+(b<<2)>>2]|0;if(!d){e=a+8|0;c[c[r>>2]>>2]=c[e>>2];c[e>>2]=c[r>>2];c[(c[a>>2]|0)+(b<<2)>>2]=e;e=c[r>>2]|0;b=c[e>>2]|0;if(!b)b=r;else{b=c[b+4>>2]|0;d=i+-1|0;if(d&i){if(b>>>0>=i>>>0)b=(b>>>0)%(i>>>0)|0}else b=b&d;c[(c[a>>2]|0)+(b<<2)>>2]=e;b=r}}else{c[c[r>>2]>>2]=c[d>>2];c[d>>2]=c[r>>2];b=r}r=c[b>>2]|0;c[j>>2]=(c[j>>2]|0)+1;c[b>>2]=0;b=r}yb=s;return b+12|0}function Xk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=yb;yb=yb+32|0;d=h;e=a+4|0;f=((c[e>>2]|0)-(c[a>>2]|0)>>2)+1|0;g=jl(a)|0;if(g>>>0>>0)CO(a);else{i=c[a>>2]|0;k=(c[a+8>>2]|0)-i|0;j=k>>1;kl(d,k>>2>>>0>>1>>>0?(j>>>0>>0?f:j):g,(c[e>>2]|0)-i>>2,a+8|0);g=d+8|0;f=c[g>>2]|0;c[f>>2]=c[b>>2];c[g>>2]=f+4;ll(a,d);ml(d);yb=h;return}}function Yk(a){a=a|0;return a+104|0}function Zk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=yb;yb=yb+32|0;d=f;e=c[a>>2]|0;if((c[a+8>>2]|0)-e>>2>>>0>>0){fl(d,b,(c[a+4>>2]|0)-e>>2,a+8|0);gl(a,d);hl(d)}yb=f;return}function _k(b,d,e){b=b|0;d=d|0;e=e|0;c[b>>2]=d;a[b+100>>0]=1;d=b+104|0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[d+16>>2]=0;c[d+20>>2]=0;il(b+4|0,e,96);return}function $k(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=yb;yb=yb+32|0;d=h;e=a+4|0;f=((c[e>>2]|0)-(c[a>>2]|0)>>2)+1|0;g=el(a)|0;if(g>>>0>>0)CO(a);else{i=c[a>>2]|0;k=(c[a+8>>2]|0)-i|0;j=k>>1;fl(d,k>>2>>>0>>1>>>0?(j>>>0>>0?f:j):g,(c[e>>2]|0)-i>>2,a+8|0);g=d+8|0;c[c[g>>2]>>2]=c[b>>2];c[g>>2]=(c[g>>2]|0)+4;gl(a,d);hl(d);yb=h;return}}function al(a){a=a|0;bl(a);return}function bl(a){a=a|0;var b=0;cl(a,c[a+8>>2]|0);b=c[a>>2]|0;c[a>>2]=0;if(b|0)Nf(b,c[a+4>>2]<<2);return}function cl(a,b){a=a|0;b=b|0;while(1){if(!b)break;a=c[b>>2]|0;dl(b+8|0);Nf(b,24);b=a}return}function dl(a){a=a|0;Vj(a+4|0);return}function el(a){a=a|0;return 1073741823}function fl(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;do if(b)if(b>>>0>1073741823){f=O(8)|0;bO(f,37409);c[f>>2]=16392;Q(f|0,13960,22)}else{e=rB(b<<2)|0;break}else e=0;while(0);c[a>>2]=e;d=e+(d<<2)|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+(b<<2);return}function gl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[a>>2]|0;h=a+4|0;g=b+4|0;f=(c[h>>2]|0)-e|0;d=(c[g>>2]|0)+(0-(f>>2)<<2)|0;c[g>>2]=d;if((f|0)>0){YO(d|0,e|0,f|0)|0;e=g;d=c[g>>2]|0}else e=g;g=c[a>>2]|0;c[a>>2]=d;c[e>>2]=g;g=b+8|0;f=c[h>>2]|0;c[h>>2]=c[g>>2];c[g>>2]=f;g=a+8|0;h=b+12|0;a=c[g>>2]|0;c[g>>2]=c[h>>2];c[h>>2]=a;c[b>>2]=c[e>>2];return}function hl(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a+4>>2]|0;d=a+8|0;e=c[d>>2]|0;while(1){if((e|0)==(b|0))break;f=e+-4|0;c[d>>2]=f;e=f}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function il(a,b,c){a=a|0;b=b|0;c=c|0;YO(a|0,b|0,c|0)|0;return}function jl(a){a=a|0;return 1073741823}function kl(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a+12|0;c[f>>2]=0;c[a+16>>2]=e;do if(b)if(b>>>0>1073741823){f=O(8)|0;bO(f,37409);c[f>>2]=16392;Q(f|0,13960,22)}else{e=rB(b<<2)|0;break}else e=0;while(0);c[a>>2]=e;d=e+(d<<2)|0;c[a+8>>2]=d;c[a+4>>2]=d;c[f>>2]=e+(b<<2);return}function ll(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[a>>2]|0;h=a+4|0;g=b+4|0;f=(c[h>>2]|0)-e|0;d=(c[g>>2]|0)+(0-(f>>2)<<2)|0;c[g>>2]=d;if((f|0)>0){YO(d|0,e|0,f|0)|0;e=g;d=c[g>>2]|0}else e=g;g=c[a>>2]|0;c[a>>2]=d;c[e>>2]=g;g=b+8|0;f=c[h>>2]|0;c[h>>2]=c[g>>2];c[g>>2]=f;g=a+8|0;h=b+12|0;a=c[g>>2]|0;c[g>>2]=c[h>>2];c[h>>2]=a;c[b>>2]=c[e>>2];return}function ml(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a+4>>2]|0;d=a+8|0;e=c[d>>2]|0;while(1){if((e|0)==(b|0))break;f=e+-4|0;c[d>>2]=f;e=f}b=c[a>>2]|0;if(b|0)Nf(b,(c[a+12>>2]|0)-b|0);return}function nl(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;h=rB(24)|0;c[b>>2]=h;c[b+4>>2]=d+8;c[h+8>>2]=c[c[g>>2]>>2];c[h+12>>2]=0;c[h+16>>2]=0;c[h+20>>2]=0;a[b+8>>0]=1;c[h+4>>2]=e;c[h>>2]=0;return}function ol(a,b){a=a|0;b=b|0;var d=0,e=0,g=0;if((b|0)!=1){if(b+-1&b)b=yD(b)|0}else b=2;e=c[a+4>>2]|0;if(b>>>0<=e>>>0){if(b>>>0>>0){d=~~+A(+(+((c[a+12>>2]|0)>>>0)/+f[a+16>>2]))>>>0;if(e>>>0>2&(e+-1&e|0)==0){g=1<<32-(C(d+-1|0)|0);d=d>>>0<2?d:g}else d=yD(d)|0;b=b>>>0>>0?d:b;if(b>>>0>>0)pl(a,b)}}else pl(a,b);return}function pl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=a+4|0;a:do if(b){if(b>>>0>1073741823){a=O(8)|0;bO(a,37409);c[a>>2]=16392;Q(a|0,13960,22)}l=rB(b<<2)|0;d=c[a>>2]|0;c[a>>2]=l;if(d|0)Nf(d,c[a+4>>2]<<2);c[e>>2]=b;d=0;while(1){if((d|0)==(b|0))break;c[(c[a>>2]|0)+(d<<2)>>2]=0;d=d+1|0}f=a+8|0;d=c[f>>2]|0;if(d|0){e=c[d+4>>2]|0;k=b+-1|0;l=(k&b|0)==0;if(!l){if(e>>>0>=b>>>0)e=(e>>>0)%(b>>>0)|0}else e=e&k;c[(c[a>>2]|0)+(e<<2)>>2]=f;while(1){j=d;b:while(1){while(1){d=c[j>>2]|0;if(!d)break a;f=c[d+4>>2]|0;if(!l){if(f>>>0>=b>>>0)f=(f>>>0)%(b>>>0)|0}else f=f&k;if((f|0)==(e|0))break;g=(c[a>>2]|0)+(f<<2)|0;if(!(c[g>>2]|0))break b;h=d+8|0;g=d;while(1){i=c[g>>2]|0;if(!i)break;if((c[h>>2]|0)==(c[i+8>>2]|0))g=i;else break}c[j>>2]=i;c[g>>2]=c[c[(c[a>>2]|0)+(f<<2)>>2]>>2];c[c[(c[a>>2]|0)+(f<<2)>>2]>>2]=d}j=d}c[g>>2]=j;e=f}}}else{d=c[a>>2]|0;c[a>>2]=0;if(d|0)Nf(d,c[a+4>>2]<<2);c[e>>2]=0}while(0);return}function ql(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=a+4|0;g=c[a>>2]|0;f=(c[e>>2]|0)-g>>2;if(f>>>0>=b>>>0){if(f>>>0>b>>>0)c[e>>2]=g+(b<<2)}else Al(a,b-f|0,d);return}function rl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;a:do if((b|0)>=1){c[a>>2]=d;e=1;while(1){if((e|0)==(b|0))break a;f=d+1|0;c[a+(e<<2)>>2]=f;e=e+1|0;d=f}}while(0);return}function sl(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=0;while(1){if((f|0)>=(d|0))break;i=a+(f<<2)|0;g=a+(((zl(e)|0)%(b|0)|0)<<2)|0;h=c[i>>2]|0;c[i>>2]=c[g>>2];c[g>>2]=h;f=f+1|0}return}function tl(a,b,d,e,f,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0;o=yb;yb=yb+16|0;a=o;if(((c[b+4>>2]|0)-(c[b>>2]|0)>>2|0)!=(g|0)){n=Vf(Vf(NE(Vf(Vf(Vf(56032,29134)|0,29635)|0,35e3)|0,198)|0,35007)|0,29967)|0;GE(a,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(a,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(a);OE(n,m)|0;KE(n)|0;ua()}if((e|0)<=0){n=Vf(Vf(NE(Vf(Vf(Vf(56032,29752)|0,29635)|0,35e3)|0,199)|0,35007)|0,29792)|0;GE(a,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(a,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(a);OE(n,m)|0;KE(n)|0;ua()}if((g|0)>(e|0)){n=Vf(Vf(NE(Vf(Vf(Vf(56032,29828)|0,29635)|0,35e3)|0,200)|0,35007)|0,29879)|0;GE(a,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(a,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(a);OE(n,m)|0;KE(n)|0;ua()}if((i|0)<=0){n=Vf(Vf(NE(Vf(Vf(Vf(56032,29996)|0,29635)|0,35e3)|0,201)|0,35007)|0,30035)|0;GE(a,n+(c[(c[n>>2]|0)+-12>>2]|0)|0);m=VF(a,56736)|0;m=Gb[c[(c[m>>2]|0)+28>>2]&63](m,10)|0;WF(a);OE(n,m)|0;KE(n)|0;ua()}k=0;m=0;while(1){if((m|0)>=(g|0))break;n=f+(m<<2)|0;l=0;a=-1;while(1){if((l|0)==(i|0))break;e=h+(l<<2)|0;j=wl(d+((c[n>>2]|0)*96|0)|0,d+((c[f+(c[e>>2]<<2)>>2]|0)*96|0)|0)|0;if(j>>>0>>0){c[(c[b>>2]|0)+(m<<2)>>2]=c[e>>2];a=j}l=l+1|0}k=a+k|0;m=m+1|0}yb=o;return k|0}function ul(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=c[a>>2]|0;c[a>>2]=c[b>>2];c[b>>2]=f;f=a+4|0;d=b+4|0;e=c[f>>2]|0;c[f>>2]=c[d>>2];c[d>>2]=e;d=a+8|0;b=b+8|0;a=c[d>>2]|0;c[d>>2]=c[b>>2];c[b>>2]=a;return}function vl(a,b,c){a=a|0;b=b|0;c=c|0;YO(a|0,b|0,c<<2|0)|0;return}function wl(a,b){a=a|0;b=b|0;return xl(a,b)|0}function xl(a,b){a=a|0;b=b|0;var d=0;d=yl(c[a>>2]|0,c[b>>2]|0)|0;d=(yl(c[a+4>>2]|0,c[b+4>>2]|0)|0)+d|0;d=d+(yl(c[a+8>>2]|0,c[b+8>>2]|0)|0)|0;d=d+(yl(c[a+12>>2]|0,c[b+12>>2]|0)|0)|0;d=d+(yl(c[a+16>>2]|0,c[b+16>>2]|0)|0)|0;d=d+(yl(c[a+20>>2]|0,c[b+20>>2]|0)|0)|0;d=d+(yl(c[a+24>>2]|0,c[b+24>>2]|0)|0)|0;d=d+(yl(c[a+28>>2]|0,c[b+28>>2]|0)|0)|0;d=d+(yl(c[a+32>>2]|0,c[b+32>>2]|0)|0)|0;d=d+(yl(c[a+36>>2]|0,c[b+36>>2]|0)|0)|0;d=d+(yl(c[a+40>>2]|0,c[b+40>>2]|0)|0)|0;d=d+(yl(c[a+44>>2]|0,c[b+44>>2]|0)|0)|0;d=d+(yl(c[a+48>>2]|0,c[b+48>>2]|0)|0)|0;d=d+(yl(c[a+52>>2]|0,c[b+52>>2]|0)|0)|0;d=d+(yl(c[a+56>>2]|0,c[b+56>>2]|0)|0)|0;d=d+(yl(c[a+60>>2]|0,c[b+60>>2]|0)|0)|0;d=d+(yl(c[a+64>>2]|0,c[b+64>>2]|0)|0)|0;d=d+(yl(c[a+68>>2]|0,c[b+68>>2]|0)|0)|0;d=d+(yl(c[a+72>>2]|0,c[b+72>>2]|0)|0)|0;d=d+(yl(c[a+76>>2]|0,c[b+76>>2]|0)|0)|0;d=d+(yl(c[a+80>>2]|0,c[b+80>>2]|0)|0)|0;d=d+(yl(c[a+84>>2]|0,c[b+84>>2]|0)|0)|0;d=d+(yl(c[a+88>>2]|0,c[b+88>>2]|0)|0)|0;return d+(yl(c[a+92>>2]|0,c[b+92>>2]|0)|0)|0}function yl(a,b){a=a|0;b=b|0;b=b^a;b=b-(b>>>1&1431655765)|0;b=(b>>>2&858993459)+(b&858993459)|0;return (B((b>>>4)+b&252645135,16843009)|0)>>>24|0}function zl(a){a=a|0;var b=0;b=((c[a>>2]|0)*214013|0)+2531011|0;c[a>>2]=b;return b>>>16&32767|0}function Al(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;k=yb;yb=yb+32|0;h=k;i=a+8|0;j=a+4|0;e=c[j>>2]|0;g=e;do if((c[i>>2]|0)-e>>2>>>0>>0){e=(e-(c[a>>2]|0)>>2)+b|0;f=jl(a)|0;if(f>>>0>>0)CO(a);else{g=c[a>>2]|0;l=(c[i>>2]|0)-g|0;i=l>>1;kl(h,l>>2>>>0>>1>>>0?(i>>>0>>0?e:i):f,(c[j>>2]|0)-g>>2,a+8|0);Bl(h,b,d);ll(a,h);ml(h);break}}else{e=b;f=g;while(1){c[f>>2]=c[d>>2];e=e+-1|0;if(!e)break;else f=f+4|0}c[j>>2]=g+(b<<2)}while(0);yb=k;return}function Bl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;f=a+8|0;e=c[f>>2]|0;a=b;g=e;while(1){c[g>>2]=c[d>>2];a=a+-1|0;if(!a)break;else g=g+4|0}c[f>>2]=e+(b<<2);return}function Cl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=yb;yb=yb+32|0;f=i;g=a+8|0;h=a+4|0;d=c[h>>2]|0;do if((c[g>>2]|0)-d>>2>>>0>>0){d=(d-(c[a>>2]|0)>>2)+b|0;e=jl(a)|0;if(e>>>0>>0)CO(a);else{j=c[a>>2]|0;k=(c[g>>2]|0)-j|0;g=k>>1;kl(f,k>>2>>>0>>1>>>0?(g>>>0>>0?d:g):e,(c[h>>2]|0)-j>>2,a+8|0);El(f,b);ll(a,f);ml(f);break}}else Dl(a,b);while(0);yb=i;return}function Dl(a,b){a=a|0;b=b|0;var d=0;a=a+4|0;d=c[a>>2]|0;_O(d|0,0,b<<2|0)|0;c[a>>2]=d+(b<<2);return}function El(a,b){a=a|0;b=b|0;var d=0;a=a+8|0;d=c[a>>2]|0;_O(d|0,0,b<<2|0)|0;c[a>>2]=d+(b<<2);return}function Fl(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;d=b;if(b|0){c[a+4>>2]=d;Nf(b,(c[a+8>>2]|0)-d|0)}return}function Gl(a,b){a=a|0;b=b|0;_O(a|0,0,b|0)|0;return}function Hl(a,b){a=a|0;b=b|0;var d=0;if((jl(a)|0)>>>0>>0)CO(a);if(b>>>0>1073741823){b=O(8)|0;bO(b,37409);c[b>>2]=16392;Q(b|0,13960,22)}else{d=rB(b<<2)|0;c[a+4>>2]=d;c[a>>2]=d;c[a+8>>2]=d+(b<<2);return}}function Il(a,b){a=a|0;b=b|0;c[a+4>>2]=b;Tk(a+12|0,b);return}function Jl(a,b){a=a|0;b=b|0;c[a+8>>2]=b;return}function Kl(a){a=a|0;return a+60|0}function Ll(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;if(b|0){Ml(a,b);Nl(a,b)}return}function Ml(a,b){a=a|0;b=b|0;var d=0;if((sg(a)|0)>>>0>>0)CO(a);if(b>>>0>214748364){b=O(8)|0;bO(b,37409);c[b>>2]=16392;Q(b|0,13960,22)}else{d=rB(b*20|0)|0;c[a+4>>2]=d;c[a>>2]=d;c[a+8>>2]=d+(b*20|0);return}}function Nl(a,b){a=a|0;b=b|0;var d=0;d=a+4|0;a=b;b=c[d>>2]|0;do{Ol(b);b=(c[d>>2]|0)+20|0;c[d>>2]=b;a=a+-1|0}while((a|0)!=0);return}function Ol(b){b=b|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;a[b+16>>0]=1;return}function Pl(a,b){a=a|0;b=b|0;return}function Ql(a){a=a|0;Rl(a+36|0);Sl(a+8|0);return}function Rl(a){a=a|0;var b=0;Tl(a+84|0);Vj(a+72|0);Ul(a+12|0);b=a+8|0;a=c[b>>2]|0;c[b>>2]=0;if(a|0){Ok(a);QA(a)}return}function Sl(a){a=a|0;Lf(a+16|0);Kf(a+4|0);return}function Tl(a){a=a|0;Vl(a);return}function Ul(a){a=a|0;Vj(a+48|0);Vj(a+36|0);Vj(a+24|0);Vj(a+12|0);return}function Vl(a){a=a|0;var b=0,d=0,e=0,f=0;d=c[a>>2]|0;if(d|0){e=a+4|0;b=c[e>>2]|0;while(1){if((b|0)==(d|0))break;f=b+-8|0;Wl(f);b=f}c[e>>2]=d;f=c[a>>2]|0;Nf(f,(c[a+8>>2]|0)-f|0)}return}function Wl(a){a=a|0;return}function Xl(a){a=a|0;XN(a);QA(a);return}function Yl(a){a=a|0;a=c[a+12>>2]|0;if(a|0){Ql(a);QA(a)}return}function Zl(a,b){a=a|0;b=b|0;return ((c[b+4>>2]|0)==30447?a+12|0:0)|0}function _l(a){a=a|0;Nf(a,16);return}function $l(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;c[a+16>>2]=0;c[a+20>>2]=0;c[a+24>>2]=0;return}function am(a){a=a|0;var b=0,d=0;c[a>>2]=1234;c[a+4>>2]=0;c[a+8>>2]=0;b=a+12|0;bm(b,a);d=a+72|0;c[a+100>>2]=0;c[a+104>>2]=0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[d+16>>2]=0;c[d+20>>2]=0;c[a+108>>2]=16;Il(b,8);Jl(b,1);return}function bm(a,b){a=a|0;b=b|0;c[a>>2]=b;a=a+4|0;b=a+56|0;do{c[a>>2]=0;a=a+4|0}while((a|0)<(b|0));return}function cm(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 i=0,j=0,k=0,l=0,m=0,n=0;l=yb;yb=yb+32|0;m=l+24|0;j=l+12|0;k=l+16|0;n=l+8|0;i=l;c[j>>2]=h;h=rB(148)|0;rk(h);c[n>>2]=0;c[m>>2]=c[n>>2];sk(k,h,m);tk(c[k>>2]|0,f);uk(c[k>>2]|0,g);dm(xk(c[k>>2]|0)|0,96);g=em(xk(c[k>>2]|0)|0)|0;f=b+4|0;fm(g,((c[f>>2]|0)-(c[b>>2]|0)|0)/20|0);g=em(xk(c[k>>2]|0)|0)|0;if((g|0)!=(b|0))gm(g,c[b>>2]|0,c[f>>2]|0);g=Ik(xk(c[k>>2]|0)|0)|0;f=d+4|0;hm(g,(c[f>>2]|0)-(c[d>>2]|0)|0);g=Ik(xk(c[k>>2]|0)|0)|0;if((g|0)!=(d|0))im(g,c[d>>2]|0,c[f>>2]|0);zk(c[k>>2]|0);f=c[c[a>>2]>>2]|0;c[i>>2]=c[k>>2];g=c[k+4>>2]|0;c[i+4>>2]=g;if(g|0){n=g+4|0;c[n>>2]=(c[n>>2]|0)+1}jm(f,i,c[j>>2]|0);Pj(i);f=km((c[a>>2]|0)+4|0,j)|0;if((f|0)!=(e|0))lm(f,c[e>>2]|0,c[e+4>>2]|0);Pj(k);yb=l;return}function dm(a,b){a=a|0;b=b|0;c[a>>2]=b;return}function em(a){a=a|0;return a+16|0}function fm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=a+4|0;d=c[g>>2]|0;f=c[a>>2]|0;e=(d-f|0)/20|0;if(e>>>0>=b>>>0){if(e>>>0>b>>>0){a=f+(b*20|0)|0;while(1){if((d|0)==(a|0))break;f=d+-20|0;Mf(f);d=f}c[g>>2]=a}}else Am(a,b-e|0);return}function gm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=b;l=(d-e|0)/20|0;f=a+8|0;i=c[a>>2]|0;g=i;do if(l>>>0>(((c[f>>2]|0)-i|0)/20|0)>>>0){zm(a);e=sg(a)|0;if(e>>>0>>0)CO(a);else{j=((c[f>>2]|0)-(c[a>>2]|0)|0)/20|0;k=j<<1;Ml(a,j>>>0>>1>>>0?(k>>>0>>0?l:k):e);ym(a,b,d,l);break}}else{k=a+4|0;j=((c[k>>2]|0)-i|0)/20|0;h=l>>>0>j>>>0;j=h?b+(j*20|0)|0:d;e=j-e|0;if(e|0)ZO(i|0,b|0,e|0)|0;f=g+(((e|0)/20|0)*20|0)|0;if(h){ym(a,j,d,l-(((c[k>>2]|0)-(c[a>>2]|0)|0)/20|0)|0);break}e=c[k>>2]|0;while(1){if((e|0)==(f|0))break;l=e+-20|0;Mf(l);e=l}c[k>>2]=f}while(0);return}function hm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=a+4|0;f=c[a>>2]|0;e=(c[d>>2]|0)-f|0;if(e>>>0>=b>>>0){if(e>>>0>b>>>0)c[d>>2]=f+b}else vm(a,b-e|0);return}function im(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=b;k=d-i|0;f=a+8|0;e=c[a>>2]|0;j=e;do if(k>>>0>((c[f>>2]|0)-e|0)>>>0){tm(a);e=kg(a)|0;if(e>>>0>>0)CO(a);else{i=(c[f>>2]|0)-(c[a>>2]|0)|0;j=i<<1;um(a,i>>>0>>1>>>0?(j>>>0>>0?k:j):e);sm(a,b,d,k);break}}else{h=a+4|0;g=(c[h>>2]|0)-e|0;f=k>>>0>g>>>0;g=f?b+g|0:d;e=g-i|0;if(e|0)ZO(j|0,b|0,e|0)|0;if(f){sm(a,g,d,k-(c[h>>2]|0)+(c[a>>2]|0)|0);break}else{c[h>>2]=j+e;break}}while(0);return}function jm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=yb;yb=yb+16|0;h=i+4|0;e=i;c[e>>2]=d;a=a+72|0;if(mk(a,e)|0){i=O(16)|0;c[h>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;eO(h,29085,Wf(29085)|0);kj(i,h);Q(i|0,13208,5)}f=Ak(a,e)|0;g=c[b>>2]|0;c[h>>2]=g;e=h+4|0;a=c[b+4>>2]|0;c[e>>2]=a;if(!a){d=e;a=0}else{d=a+4|0;c[d>>2]=(c[d>>2]|0)+1;d=e;a=c[e>>2]|0}c[h>>2]=c[f>>2];c[f>>2]=g;b=f+4|0;c[d>>2]=c[b>>2];c[b>>2]=a;Pj(h);yb=i;return}function km(a,b){a=a|0;b=b|0;var d=0,e=0,g=0.0,h=0.0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=yb;yb=yb+32|0;r=s+4|0;l=s;m=s+16|0;c[l>>2]=b;q=c[b>>2]|0;o=a+4|0;i=c[o>>2]|0;p=(i|0)==0;a:do if(!p){k=i+-1|0;e=(k&i|0)==0;if(!e)if(q>>>0>>0)j=q;else j=(q>>>0)%(i>>>0)|0;else j=k&q;b=c[(c[a>>2]|0)+(j<<2)>>2]|0;if(!b){b=j;n=16}else do{b=c[b>>2]|0;if(!b){b=j;n=16;break a}d=c[b+4>>2]|0;if((d|0)!=(q|0)){if(!e){if(d>>>0>=i>>>0)d=(d>>>0)%(i>>>0)|0}else d=d&k;if((d|0)!=(j|0)){b=j;n=16;break a}}}while((c[b+8>>2]|0)!=(q|0))}else{b=0;n=16}while(0);if((n|0)==16){pm(r,a,q,57660,l,m);j=a+12|0;g=+(((c[j>>2]|0)+1|0)>>>0);h=+f[a+16>>2];do if(p|h*+(i>>>0)>>0<3|(i+-1&i|0)!=0)&1;d=~~+A(+(g/h))>>>0;qm(a,b>>>0>>0?d:b);b=c[o>>2]|0;d=b+-1|0;if(!(d&b)){i=b;b=d&q;break}if(q>>>0>>0){i=b;b=q}else{i=b;b=(q>>>0)%(b>>>0)|0}}while(0);d=c[(c[a>>2]|0)+(b<<2)>>2]|0;if(!d){e=a+8|0;c[c[r>>2]>>2]=c[e>>2];c[e>>2]=c[r>>2];c[(c[a>>2]|0)+(b<<2)>>2]=e;e=c[r>>2]|0;b=c[e>>2]|0;if(!b)b=r;else{b=c[b+4>>2]|0;d=i+-1|0;if(d&i){if(b>>>0>=i>>>0)b=(b>>>0)%(i>>>0)|0}else b=b&d;c[(c[a>>2]|0)+(b<<2)>>2]=e;b=r}}else{c[c[r>>2]>>2]=c[d>>2];c[d>>2]=c[r>>2];b=r}r=c[b>>2]|0;c[j>>2]=(c[j>>2]|0)+1;c[b>>2]=0;b=r}yb=s;return b+12|0}function lm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=b;k=(d-e|0)/12|0;f=a+8|0;j=c[a>>2]|0;i=j;do if(k>>>0>(((c[f>>2]|0)-j|0)/12|0)>>>0){nm(a);e=og(a)|0;if(e>>>0>>0)CO(a);else{i=((c[f>>2]|0)-(c[a>>2]|0)|0)/12|0;j=i<<1;om(a,i>>>0>>1>>>0?(j>>>0>>0?k:j):e);mm(a,b,d,k);break}}else{f=a+4|0;h=((c[f>>2]|0)-j|0)/12|0;g=k>>>0>h>>>0;h=g?b+(h*12|0)|0:d;e=h-e|0;if(e|0)ZO(j|0,b|0,e|0)|0;if(g){mm(a,h,d,k-(((c[f>>2]|0)-(c[a>>2]|0)|0)/12|0)|0);break}else{c[f>>2]=i+(((e|0)/12|0)*12|0);break}}while(0);return}function mm(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;e=a+4|0;a=d-b|0;if((a|0)>0){YO(c[e>>2]|0,b|0,a|0)|0;c[e>>2]=(c[e>>2]|0)+(((a>>>0)/12|0)*12|0)}return}function nm(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a>>2]|0;d=b;if(b|0){e=a+4|0;c[e>>2]=d;f=a+8|0;Nf(b,(c[f>>2]|0)-d|0);c[f>>2]=0;c[e>>2]=0;c[a>>2]=0}return}function om(a,b){a=a|0;b=b|0;var d=0;if((og(a)|0)>>>0>>0)CO(a);if(b>>>0>357913941){b=O(8)|0;bO(b,37409);c[b>>2]=16392;Q(b|0,13960,22)}else{d=rB(b*12|0)|0;c[a+4>>2]=d;c[a>>2]=d;c[a+8>>2]=d+(b*12|0);return}}function pm(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;h=rB(24)|0;c[b>>2]=h;c[b+4>>2]=d+8;c[h+8>>2]=c[c[g>>2]>>2];c[h+12>>2]=0;c[h+16>>2]=0;c[h+20>>2]=0;a[b+8>>0]=1;c[h+4>>2]=e;c[h>>2]=0;return}function qm(a,b){a=a|0;b=b|0;var d=0,e=0,g=0;if((b|0)!=1){if(b+-1&b)b=yD(b)|0}else b=2;e=c[a+4>>2]|0;if(b>>>0<=e>>>0){if(b>>>0>>0){d=~~+A(+(+((c[a+12>>2]|0)>>>0)/+f[a+16>>2]))>>>0;if(e>>>0>2&(e+-1&e|0)==0){g=1<<32-(C(d+-1|0)|0);d=d>>>0<2?d:g}else d=yD(d)|0;b=b>>>0>>0?d:b;if(b>>>0>>0)rm(a,b)}}else rm(a,b);return}function rm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=a+4|0;a:do if(b){if(b>>>0>1073741823){a=O(8)|0;bO(a,37409);c[a>>2]=16392;Q(a|0,13960,22)}l=rB(b<<2)|0;d=c[a>>2]|0;c[a>>2]=l;if(d|0)Nf(d,c[a+4>>2]<<2);c[e>>2]=b;d=0;while(1){if((d|0)==(b|0))break;c[(c[a>>2]|0)+(d<<2)>>2]=0;d=d+1|0}f=a+8|0;d=c[f>>2]|0;if(d|0){e=c[d+4>>2]|0;k=b+-1|0;l=(k&b|0)==0;if(!l){if(e>>>0>=b>>>0)e=(e>>>0)%(b>>>0)|0}else e=e&k;c[(c[a>>2]|0)+(e<<2)>>2]=f;while(1){j=d;b:while(1){while(1){d=c[j>>2]|0;if(!d)break a;f=c[d+4>>2]|0;if(!l){if(f>>>0>=b>>>0)f=(f>>>0)%(b>>>0)|0}else f=f&k;if((f|0)==(e|0))break;g=(c[a>>2]|0)+(f<<2)|0;if(!(c[g>>2]|0))break b;h=d+8|0;g=d;while(1){i=c[g>>2]|0;if(!i)break;if((c[h>>2]|0)==(c[i+8>>2]|0))g=i;else break}c[j>>2]=i;c[g>>2]=c[c[(c[a>>2]|0)+(f<<2)>>2]>>2];c[c[(c[a>>2]|0)+(f<<2)>>2]>>2]=d}j=d}c[g>>2]=j;e=f}}}else{d=c[a>>2]|0;c[a>>2]=0;if(d|0)Nf(d,c[a+4>>2]<<2);c[e>>2]=0}while(0);return}function sm(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;e=a+4|0;a=d-b|0;if((a|0)>0){YO(c[e>>2]|0,b|0,a|0)|0;c[e>>2]=(c[e>>2]|0)+a}return}function tm(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a>>2]|0;d=b;if(b|0){e=a+4|0;c[e>>2]=d;f=a+8|0;Nf(b,(c[f>>2]|0)-d|0);c[f>>2]=0;c[e>>2]=0;c[a>>2]=0}return}function um(a,b){a=a|0;b=b|0;var d=0;if((kg(a)|0)>>>0>>0)CO(a);else{d=rB(b)|0;c[a+4>>2]=d;c[a>>2]=d;c[a+8>>2]=d+b;return}}function vm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=yb;yb=yb+32|0;f=i;g=a+8|0;h=a+4|0;d=c[h>>2]|0;do if(((c[g>>2]|0)-d|0)>>>0>>0){d=d-(c[a>>2]|0)+b|0;e=kg(a)|0;if(e>>>0>>0)CO(a);else{j=c[a>>2]|0;k=(c[g>>2]|0)-j|0;g=k<<1;lg(f,k>>>0>>1>>>0?(g>>>0>>0?d:g):e,(c[h>>2]|0)-j|0,a+8|0);xm(f,b);mg(a,f);ng(f);break}}else wm(a,b);while(0);yb=i;return}function wm(b,d){b=b|0;d=d|0;var e=0;e=b+4|0;b=d;d=c[e>>2]|0;do{a[d>>0]=0;d=(c[e>>2]|0)+1|0;c[e>>2]=d;b=b+-1|0}while((b|0)!=0);return}function xm(b,d){b=b|0;d=d|0;var e=0;e=b+8|0;b=d;d=c[e>>2]|0;do{a[d>>0]=0;d=(c[e>>2]|0)+1|0;c[e>>2]=d;b=b+-1|0}while((b|0)!=0);return}function ym(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=a+4|0;while(1){if((b|0)==(d|0))break;e=c[a>>2]|0;c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+8>>2]=c[b+8>>2];c[e+12>>2]=c[b+12>>2];c[e+16>>2]=c[b+16>>2];c[a>>2]=(c[a>>2]|0)+20;b=b+20|0}return}function zm(a){a=a|0;var b=0,d=0,e=0,f=0;d=c[a>>2]|0;if(d|0){e=a+4|0;b=c[e>>2]|0;while(1){if((b|0)==(d|0))break;f=b+-20|0;Mf(f);b=f}c[e>>2]=d;d=c[a>>2]|0;f=a+8|0;Nf(d,(c[f>>2]|0)-d|0);c[f>>2]=0;c[e>>2]=0;c[a>>2]=0}return}function Am(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=yb;yb=yb+32|0;f=i;g=a+8|0;h=a+4|0;d=c[h>>2]|0;do if((((c[g>>2]|0)-d|0)/20|0)>>>0>>0){d=((d-(c[a>>2]|0)|0)/20|0)+b|0;e=sg(a)|0;if(e>>>0>>0)CO(a);else{j=c[a>>2]|0;k=((c[g>>2]|0)-j|0)/20|0;g=k<<1;tg(f,k>>>0>>1>>>0?(g>>>0>>0?d:g):e,((c[h>>2]|0)-j|0)/20|0,a+8|0);Bm(f,b);ug(a,f);vg(f);break}}else Nl(a,b);while(0);yb=i;return}function Bm(a,b){a=a|0;b=b|0;var d=0;d=a+8|0;a=b;b=c[d>>2]|0;do{Ol(b);b=(c[d>>2]|0)+20|0;c[d>>2]=b;a=a+-1|0}while((a|0)!=0);return}function Cm(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=yb;yb=yb+32|0;g=f;iq(g,b,1,d,e,d,1);e=Dm(c[c[a>>2]>>2]|0,g)|0;pq(g);yb=f;return e|0}function Dm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;f=yb;yb=yb+32|0;d=f;e=a+92|0;g=nk(e)|0;if(!(((c[g+4>>2]|0)!=(c[g>>2]|0)?(g=Lg(c[(nk(e)|0)>>2]|0)|0,(g|0)==(Lg(b)|0)):0)?(g=Mg(c[(nk(e)|0)>>2]|0)|0,(g|0)==(Mg(b)|0)):0)){g=Lg(b)|0;g=ok(g,Mg(b)|0,8)|0;h=Lg(b)|0;Zi(e,h,Mg(b)|0,g)}zq(d,29103);if(Qh(d)|0)gj(e,b);Aq(d);h=Em(a,e)|0;yb=f;return h|0}function Em(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;k=yb;yb=yb+64|0;e=k+16|0;j=k;g=k+56|0;h=k+48|0;i=b+160|0;f=pk(i)|0;if(!((f|0)==(Lg(c[(yh(d)|0)>>2]|0)|0)?(f=qk(i)|0,(f|0)==(Mg(c[(yh(d)|0)>>2]|0)|0)):0))xh(i,d);f=b+64|0;m=rB(148)|0;rk(m);c[h>>2]=0;c[e>>2]=c[h>>2];sk(g,m,e);m=c[g>>2]|0;c[g>>2]=c[f>>2];c[f>>2]=m;m=g+4|0;h=b+68|0;l=c[m>>2]|0;c[m>>2]=c[h>>2];c[h>>2]=l;Pj(g);h=c[f>>2]|0;tk(h,Lg(c[(yh(d)|0)>>2]|0)|0);h=c[f>>2]|0;uk(h,Mg(c[(yh(d)|0)>>2]|0)|0);zq(e,29117);if(Qh(e)|0)vk(c[f>>2]|0,d,i,b+316|0);Aq(e);m=wk()|0;Xp(e);i=(a[e+11>>0]|0)<0?c[e>>2]|0:e;l=yk(xk(c[f>>2]|0)|0)|0;c[j>>2]=35129;c[j+4>>2]=i;c[j+8>>2]=30646;c[j+12>>2]=l;sq(m,8,30602,j);hO(e);m=Fm(b,c[f>>2]|0)|0;yb=k;return m|0}function Fm(b,d){b=b|0;d=d|0;var e=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,A=0,B=0,C=0,D=0,E=0,F=0,G=0;D=yb;yb=yb+144|0;s=D+104|0;w=D;x=D+72|0;y=D+40|0;z=b+12|0;A=b+16|0;c[A>>2]=c[z>>2];B=b+24|0;c[B>>2]=-1;k=Hm(Gm(d)|0)|0;l=b+8|0;m=b+636|0;n=b+652|0;o=s+4|0;p=s+8|0;q=b+788|0;r=x+4|0;t=x+8|0;u=b+4|0;v=b+28|0;e=b+80|0;while(1){e=c[e>>2]|0;if(!e)break;zq(s,30936);do if(Qh(s)|0){E=(a[l>>0]|0)==0;g=Gm(d)|0;j=e;h=j+12|0;i=xk(c[h>>2]|0)|0;if(E){E=Km(m,g,i)|0;if(E>>>0>=(c[b>>2]|0)>>>0){C=9;break}}else{E=Jm(m,g,i,Im(c[h>>2]|0)|0)|0;if(E>>>0>=(c[b>>2]|0)>>>0){C=9;break}}Aq(s)}else{j=e;h=j+12|0;C=9}while(0);do if((C|0)==9){C=0;Aq(s);i=em(xk(c[h>>2]|0)|0)|0;zq(s,30953);if(Qh(s)|0){G=Lm(m)|0;F=Mm(d)|0;E=Nm(d)|0;g=Mm(c[h>>2]|0)|0;g=Om(n,k,i,G,F,E,g,Nm(c[h>>2]|0)|0)|0;if((g|0)<0){Aq(s);break}}else g=-1;Aq(s);c[s>>2]=0;c[o>>2]=0;c[p>>2]=0;zq(w,30970);if(Qh(w)|0)Pm(s,n,Lm(m)|0,g,1.0);Aq(w);zq(x,30993);if(Qh(x)|0?(G=Mm(c[h>>2]|0)|0,!(Qm(w,k,i,s,q,G,Nm(c[h>>2]|0)|0)|0)):0)Aq(x);else{Aq(x);c[x>>2]=0;c[r>>2]=0;c[t>>2]=0;zq(y,31017);if(Qh(y)|0?(Rm(x,w,k,i,s,+f[u>>2]),(c[r>>2]|0)-(c[x>>2]|0)>>3>>>0<(c[b>>2]|0)>>>0):0)Aq(y);else C=20;do if((C|0)==20){C=0;Aq(y);zq(y,31034);if(Qh(y)|0?(G=Gm(d)|0,G=Sm(m,G,xk(c[h>>2]|0)|0,w,10.0)|0,G>>>0<(c[b>>2]|0)>>>0):0){Aq(y);break}Aq(y);zq(y,31051);if(Qh(y)|0){E=Lm(m)|0;F=Mm(d)|0;G=Nm(d)|0;g=Mm(c[h>>2]|0)|0;g=Om(n,k,i,E,F,G,g,Nm(c[h>>2]|0)|0)|0;if((g|0)<0){Aq(y);break}}Aq(y);zq(y,31068);if(Qh(y)|0)Pm(s,n,Lm(m)|0,g,1.0);Aq(y);zq(y,31091);if(Qh(y)|0?(G=Mm(c[h>>2]|0)|0,!(Qm(w,k,i,s,q,G,Nm(c[h>>2]|0)|0)|0)):0){Aq(y);break}Aq(y);c[r>>2]=c[x>>2];zq(y,31115);if(Qh(y)|0)Rm(x,w,k,i,s,+f[u>>2]);Aq(y);G=(c[r>>2]|0)-(c[x>>2]|0)>>3;if(G>>>0>=(c[b>>2]|0)>>>0?G>>>0>(c[A>>2]|0)-(c[z>>2]|0)>>3>>>0:0){Tm(v,w);Um(z,x);c[B>>2]=c[j+8>>2]}}while(0);Qj(x)}Qj(s)}while(0)}yb=D;return (c[B>>2]|0)>-1|0}function Gm(a){a=a|0;return a+8|0}function Hm(a){a=a|0;return a+16|0}function Im(a){a=a|0;return a+36|0} +function Tu(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;i=yb;yb=yb+128|0;j=i;d=c[d+336>>2]|0;m=c[e+84>>2]|0;l=B(c[m>>2]|0,b[f>>1]|0)|0;e=B(c[m+64>>2]|0,b[f+32>>1]|0)|0;n=e+l<<2;e=l-e<<2;l=B(c[m+32>>2]|0,b[f+16>>1]|0)|0;k=B(c[m+96>>2]|0,b[f+48>>1]|0)|0;o=((k+l|0)*4433|0)+1024|0;l=o+(l*6270|0)>>11;k=o+(B(k,-15137)|0)>>11;c[j>>2]=l+n;c[j+96>>2]=n-l;c[j+32>>2]=k+e;c[j+64>>2]=e-k;k=B(c[m+4>>2]|0,b[f+2>>1]|0)|0;e=B(c[m+68>>2]|0,b[f+34>>1]|0)|0;l=e+k<<2;e=k-e<<2;k=B(c[m+36>>2]|0,b[f+18>>1]|0)|0;n=B(c[m+100>>2]|0,b[f+50>>1]|0)|0;o=((n+k|0)*4433|0)+1024|0;k=o+(k*6270|0)>>11;n=o+(B(n,-15137)|0)>>11;c[j+4>>2]=k+l;c[j+100>>2]=l-k;c[j+36>>2]=n+e;c[j+68>>2]=e-n;n=B(c[m+8>>2]|0,b[f+4>>1]|0)|0;e=B(c[m+72>>2]|0,b[f+36>>1]|0)|0;k=e+n<<2;e=n-e<<2;n=B(c[m+40>>2]|0,b[f+20>>1]|0)|0;l=B(c[m+104>>2]|0,b[f+52>>1]|0)|0;o=((l+n|0)*4433|0)+1024|0;n=o+(n*6270|0)>>11;l=o+(B(l,-15137)|0)>>11;c[j+8>>2]=n+k;c[j+104>>2]=k-n;c[j+40>>2]=l+e;c[j+72>>2]=e-l;l=B(c[m+12>>2]|0,b[f+6>>1]|0)|0;e=B(c[m+76>>2]|0,b[f+38>>1]|0)|0;n=e+l<<2;e=l-e<<2;l=B(c[m+44>>2]|0,b[f+22>>1]|0)|0;k=B(c[m+108>>2]|0,b[f+54>>1]|0)|0;o=((k+l|0)*4433|0)+1024|0;l=o+(l*6270|0)>>11;k=o+(B(k,-15137)|0)>>11;c[j+12>>2]=l+n;c[j+108>>2]=n-l;c[j+44>>2]=k+e;c[j+76>>2]=e-k;k=B(c[m+16>>2]|0,b[f+8>>1]|0)|0;e=B(c[m+80>>2]|0,b[f+40>>1]|0)|0;l=e+k<<2;e=k-e<<2;k=B(c[m+48>>2]|0,b[f+24>>1]|0)|0;n=B(c[m+112>>2]|0,b[f+56>>1]|0)|0;o=((n+k|0)*4433|0)+1024|0;k=o+(k*6270|0)>>11;n=o+(B(n,-15137)|0)>>11;c[j+16>>2]=k+l;c[j+112>>2]=l-k;c[j+48>>2]=n+e;c[j+80>>2]=e-n;n=B(c[m+20>>2]|0,b[f+10>>1]|0)|0;e=B(c[m+84>>2]|0,b[f+42>>1]|0)|0;k=e+n<<2;e=n-e<<2;n=B(c[m+52>>2]|0,b[f+26>>1]|0)|0;l=B(c[m+116>>2]|0,b[f+58>>1]|0)|0;o=((l+n|0)*4433|0)+1024|0;n=o+(n*6270|0)>>11;l=o+(B(l,-15137)|0)>>11;c[j+20>>2]=n+k;c[j+116>>2]=k-n;c[j+52>>2]=l+e;c[j+84>>2]=e-l;l=B(c[m+24>>2]|0,b[f+12>>1]|0)|0;e=B(c[m+88>>2]|0,b[f+44>>1]|0)|0;n=e+l<<2;e=l-e<<2;l=B(c[m+56>>2]|0,b[f+28>>1]|0)|0;k=B(c[m+120>>2]|0,b[f+60>>1]|0)|0;o=((k+l|0)*4433|0)+1024|0;l=o+(l*6270|0)>>11;k=o+(B(k,-15137)|0)>>11;c[j+24>>2]=l+n;c[j+120>>2]=n-l;c[j+56>>2]=k+e;c[j+88>>2]=e-k;k=B(c[m+28>>2]|0,b[f+14>>1]|0)|0;e=B(c[m+92>>2]|0,b[f+46>>1]|0)|0;l=e+k<<2;e=k-e<<2;k=B(c[m+60>>2]|0,b[f+30>>1]|0)|0;f=B(c[m+124>>2]|0,b[f+62>>1]|0)|0;m=((f+k|0)*4433|0)+1024|0;k=m+(k*6270|0)>>11;f=m+(B(f,-15137)|0)>>11;c[j+28>>2]=k+l;c[j+124>>2]=l-k;c[j+60>>2]=f+e;c[j+92>>2]=e-f;f=d+-384|0;d=j;e=0;while(1){o=(c[g+(e<<2)>>2]|0)+h|0;m=(c[d>>2]|0)+16400|0;n=c[d+16>>2]|0;p=m+n<<13;n=m-n<<13;m=c[d+8>>2]|0;k=c[d+24>>2]|0;r=(k+m|0)*4433|0;m=r+(m*6270|0)|0;k=r+(B(k,-15137)|0)|0;r=m+p|0;m=p-m|0;p=k+n|0;k=n-k|0;n=c[d+28>>2]|0;u=c[d+20>>2]|0;s=c[d+12>>2]|0;q=c[d+4>>2]|0;j=s+n|0;l=q+u|0;t=(l+j|0)*9633|0;j=t+(B(j,-16069)|0)|0;l=t+(B(l,-3196)|0)|0;t=B(q+n|0,-7373)|0;n=t+(n*2446|0)+j|0;q=t+(q*12299|0)+l|0;t=B(s+u|0,-20995)|0;l=t+(u*16819|0)+l|0;j=t+(s*25172|0)+j|0;a[o>>0]=a[f+((q+r|0)>>>18&1023)>>0]|0;a[o+7>>0]=a[f+((r-q|0)>>>18&1023)>>0]|0;a[o+1>>0]=a[f+((j+p|0)>>>18&1023)>>0]|0;a[o+6>>0]=a[f+((p-j|0)>>>18&1023)>>0]|0;a[o+2>>0]=a[f+((l+k|0)>>>18&1023)>>0]|0;a[o+5>>0]=a[f+((k-l|0)>>>18&1023)>>0]|0;a[o+3>>0]=a[f+((n+m|0)>>>18&1023)>>0]|0;a[o+4>>0]=a[f+((m-n|0)>>>18&1023)>>0]|0;e=e+1|0;if((e|0)==4)break;else d=d+32|0}yb=i;return}function Uu(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;m=yb;yb=yb+160|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){f=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;n=B(c[j+64>>2]|0,b[d+32>>1]|0)|0;p=B(c[j+128>>2]|0,b[d+64>>1]|0)|0;o=(p+n|0)*6476|0;p=n-p|0;n=(p*2896|0)+f|0;q=n+o|0;o=n-o|0;f=(B(p,-11584)|0)+f|0;p=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;n=B(c[j+96>>2]|0,b[d+48>>1]|0)|0;r=(n+p|0)*6810|0;p=r+(p*4209|0)|0;n=r+(B(n,-17828)|0)|0;c[k>>2]=p+q>>11;c[k+128>>2]=q-p>>11;c[k+32>>2]=n+o>>11;c[k+96>>2]=o-n>>11;c[k+64>>2]=f>>11;e=e+1|0;if((e|0)==8)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){r=(c[g+(d<<2)>>2]|0)+h|0;p=(c[i>>2]<<13)+134348800|0;k=c[i+16>>2]|0;j=p+(k*9373|0)|0;u=p+(B(k,-3580)|0)|0;k=p+(B(k,-11586)|0)|0;p=c[i+8>>2]|0;n=c[i+24>>2]|0;t=(n+p|0)*6810|0;p=t+(p*4209|0)|0;n=t+(B(n,-17828)|0)|0;t=p+j|0;p=j-p|0;j=n+u|0;n=u-n|0;u=c[i+4>>2]|0;v=c[i+12>>2]|0;l=c[i+20>>2]<<13;f=c[i+28>>2]|0;o=f+v|0;f=v-f|0;v=f*2531|0;w=o*7791|0;q=v+l|0;s=w+(u*11443|0)+q|0;q=(u*1812|0)-w+q|0;o=o*4815|0;v=l-v-(f<<12)|0;l=(u-f<<13)-l|0;f=(u*10323|0)-o-v|0;o=v+((u*5260|0)-o)|0;a[r>>0]=a[e+((s+t|0)>>>18&1023)>>0]|0;a[r+9>>0]=a[e+((t-s|0)>>>18&1023)>>0]|0;a[r+1>>0]=a[e+((f+j|0)>>>18&1023)>>0]|0;a[r+8>>0]=a[e+((j-f|0)>>>18&1023)>>0]|0;a[r+2>>0]=a[e+((l+k|0)>>>18&1023)>>0]|0;a[r+7>>0]=a[e+((k-l|0)>>>18&1023)>>0]|0;a[r+3>>0]=a[e+((o+n|0)>>>18&1023)>>0]|0;a[r+6>>0]=a[e+((n-o|0)>>>18&1023)>>0]|0;a[r+4>>0]=a[e+((q+p|0)>>>18&1023)>>0]|0;a[r+5>>0]=a[e+((p-q|0)>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==5)break;else i=i+32|0}yb=m;return}function Vu(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;m=yb;yb=yb+192|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){p=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;n=B((b[d+64>>1]|0)*5793|0,c[j+128>>2]|0)|0;t=n+p|0;p=(B(n,-2)|0)+p>>11;n=B((b[d+32>>1]|0)*10033|0,c[j+64>>2]|0)|0;r=n+t|0;n=t-n|0;t=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;s=B(c[j+96>>2]|0,b[d+48>>1]|0)|0;o=B(c[j+160>>2]|0,b[d+80>>1]|0)|0;f=(o+t|0)*2998|0;q=f+(s+t<<13)|0;f=f+(o-s<<13)|0;o=t-s-o<<2;c[k>>2]=q+r>>11;c[k+160>>2]=r-q>>11;c[k+32>>2]=o+p;c[k+128>>2]=p-o;c[k+64>>2]=f+n>>11;c[k+96>>2]=n-f>>11;e=e+1|0;if((e|0)==8)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){t=(c[g+(d<<2)>>2]|0)+h|0;r=(c[i>>2]<<13)+134348800|0;x=(c[i+16>>2]|0)*10033|0;w=r+x|0;x=r-x|0;k=c[i+8>>2]|0;n=c[i+24>>2]<<13;p=(k<<13)-n|0;j=p+r|0;p=r-p|0;r=n+(k*11190|0)|0;v=r+w|0;r=w-r|0;n=(k*2998|0)-n|0;k=n+x|0;n=x-n|0;x=c[i+4>>2]|0;w=c[i+12>>2]|0;q=c[i+20>>2]|0;f=c[i+28>>2]|0;z=w*10703|0;y=B(w,-4433)|0;l=q+x|0;s=(l+f|0)*7053|0;l=s+(l*2139|0)|0;u=z+(x*2295|0)+l|0;o=B(f+q|0,-8565)|0;l=(B(q,-12112)|0)+y+o+l|0;o=(f*12998|0)-z+s+o|0;s=y+(B(x,-5540)|0)+(B(f,-16244)|0)+s|0;f=x-f|0;q=w-q|0;w=(f+q|0)*4433|0;f=w+(f*6270|0)|0;q=w+(B(q,-15137)|0)|0;a[t>>0]=a[e+((u+v|0)>>>18&1023)>>0]|0;a[t+11>>0]=a[e+((v-u|0)>>>18&1023)>>0]|0;a[t+1>>0]=a[e+((f+j|0)>>>18&1023)>>0]|0;a[t+10>>0]=a[e+((j-f|0)>>>18&1023)>>0]|0;a[t+2>>0]=a[e+((l+k|0)>>>18&1023)>>0]|0;a[t+9>>0]=a[e+((k-l|0)>>>18&1023)>>0]|0;a[t+3>>0]=a[e+((o+n|0)>>>18&1023)>>0]|0;a[t+8>>0]=a[e+((n-o|0)>>>18&1023)>>0]|0;a[t+4>>0]=a[e+((q+p|0)>>>18&1023)>>0]|0;a[t+7>>0]=a[e+((p-q|0)>>>18&1023)>>0]|0;a[t+5>>0]=a[e+((s+r|0)>>>18&1023)>>0]|0;a[t+6>>0]=a[e+((r-s|0)>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==6)break;else i=i+32|0}yb=m;return}function Wu(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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,C=0;m=yb;yb=yb+224|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){f=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;w=B(c[j+64>>2]|0,b[d+32>>1]|0)|0;o=B(c[j+128>>2]|0,b[d+64>>1]|0)|0;u=B(c[j+192>>2]|0,b[d+96>>1]|0)|0;v=(o-u|0)*7223|0;p=(w-o|0)*2578|0;s=(B(o,-15083)|0)+f+p+v|0;n=u+w|0;q=(n*10438|0)+f|0;u=v+(B(u,-637)|0)+q|0;q=p+(B(w,-20239)|0)+q|0;w=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;p=B(c[j+96>>2]|0,b[d+48>>1]|0)|0;v=B(c[j+160>>2]|0,b[d+80>>1]|0)|0;x=(p+w|0)*7663|0;t=(w-p|0)*1395|0;p=B(v+p|0,-11295)|0;r=x+t+p|0;w=(v+w|0)*5027|0;t=w+(x-t)|0;p=w+(v*15326|0)+p|0;c[k>>2]=t+u>>11;c[k+192>>2]=u-t>>11;c[k+32>>2]=r+s>>11;c[k+160>>2]=s-r>>11;c[k+64>>2]=p+q>>11;c[k+128>>2]=q-p>>11;c[k+96>>2]=((o-n|0)*11585|0)+f>>11;e=e+1|0;if((e|0)==8)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){x=(c[g+(d<<2)>>2]|0)+h|0;r=(c[i>>2]<<13)+134348800|0;p=c[i+16>>2]|0;k=r+(p*10438|0)|0;n=r+(p*2578|0)|0;w=r+(B(p,-7223)|0)|0;p=r+(B(p,-11586)|0)|0;r=c[i+8>>2]|0;j=c[i+24>>2]|0;t=(j+r|0)*9058|0;v=t+(r*2237|0)|0;t=t+(B(j,-14084)|0)|0;r=(B(j,-11295)|0)+(r*5027|0)|0;j=v+k|0;v=k-v|0;k=t+n|0;t=n-t|0;n=r+w|0;r=w-r|0;w=c[i+4>>2]|0;A=c[i+12>>2]|0;y=c[i+20>>2]|0;q=c[i+28>>2]<<13;s=y+w|0;l=(A+w|0)*10935|0;C=s*9810|0;f=l+(B(w,-9232)|0)+C+q|0;s=s*6164|0;z=w-A|0;u=(z*3826|0)-q|0;w=s+(B(w,-8693)|0)+u|0;o=(B(y+A|0,-1297)|0)-q|0;l=l+(B(A,-3474)|0)+o|0;o=C+(B(y,-19447)|0)+o|0;C=(y-A|0)*11512|0;s=q+(B(y,-13850)|0)+C+s|0;u=C+(A*5529|0)+u|0;q=(z-y<<13)+q|0;a[x>>0]=a[e+((f+j|0)>>>18&1023)>>0]|0;a[x+13>>0]=a[e+((j-f|0)>>>18&1023)>>0]|0;a[x+1>>0]=a[e+((l+k|0)>>>18&1023)>>0]|0;a[x+12>>0]=a[e+((k-l|0)>>>18&1023)>>0]|0;a[x+2>>0]=a[e+((o+n|0)>>>18&1023)>>0]|0;a[x+11>>0]=a[e+((n-o|0)>>>18&1023)>>0]|0;a[x+3>>0]=a[e+((q+p|0)>>>18&1023)>>0]|0;a[x+10>>0]=a[e+((p-q|0)>>>18&1023)>>0]|0;a[x+4>>0]=a[e+((s+r|0)>>>18&1023)>>0]|0;a[x+9>>0]=a[e+((r-s|0)>>>18&1023)>>0]|0;a[x+5>>0]=a[e+((u+t|0)>>>18&1023)>>0]|0;a[x+8>>0]=a[e+((t-u|0)>>>18&1023)>>0]|0;a[x+6>>0]=a[e+((w+v|0)>>>18&1023)>>0]|0;a[x+7>>0]=a[e+((v-w|0)>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==7)break;else i=i+32|0}yb=m;return}function Xu(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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,C=0,D=0,E=0,F=0,G=0,H=0;o=yb;yb=yb+256|0;i=o;m=c[d+336>>2]|0;l=i;k=c[e+84>>2]|0;j=8;while(1){e=b[f+16>>1]|0;d=b[f+32>>1]|0;if(!((e|d)<<16>>16))if(((((b[f+48>>1]|0)==0?(b[f+64>>1]|0)==0:0)?(b[f+80>>1]|0)==0:0)?(b[f+96>>1]|0)==0:0)?(b[f+112>>1]|0)==0:0){d=B(b[f>>1]<<2,c[k>>2]|0)|0;c[l>>2]=d;c[l+32>>2]=d;c[l+64>>2]=d;c[l+96>>2]=d;c[l+128>>2]=d;c[l+160>>2]=d;c[l+192>>2]=d;e=56}else{d=0;n=9}else n=9;if((n|0)==9){n=0;x=B(b[f+64>>1]<<13,c[k+128>>2]|0)|0;p=B(b[f>>1]<<13,c[k>>2]|0)|0|1024;s=x+p|0;x=p-x|0;p=B(c[k+64>>2]|0,d<<16>>16)|0;q=B(c[k+192>>2]|0,b[f+96>>1]|0)|0;u=(q+p|0)*4433|0;p=u+(p*6270|0)|0;q=u+(B(q,-15137)|0)|0;u=p+s|0;p=s-p|0;s=q+x|0;q=x-q|0;d=B(c[k+224>>2]|0,b[f+112>>1]|0)|0;x=B(c[k+160>>2]|0,b[f+80>>1]|0)|0;v=B(c[k+96>>2]|0,b[f+48>>1]|0)|0;t=B(c[k+32>>2]|0,e<<16>>16)|0;r=v+d|0;e=t+x|0;w=(e+r|0)*9633|0;r=w+(B(r,-16069)|0)|0;e=w+(B(e,-3196)|0)|0;w=B(t+d|0,-7373)|0;d=w+(d*2446|0)+r|0;t=w+(t*12299|0)+e|0;w=B(v+x|0,-20995)|0;e=w+(x*16819|0)+e|0;r=w+(v*25172|0)+r|0;c[l>>2]=t+u>>11;c[l+224>>2]=u-t>>11;c[l+32>>2]=r+s>>11;c[l+192>>2]=s-r>>11;c[l+64>>2]=e+q>>11;c[l+160>>2]=q-e>>11;c[l+96>>2]=d+p>>11;d=p-d>>11;e=32}c[l+(e<<2)>>2]=d;if(j>>>0>1){l=l+4|0;k=k+4|0;f=f+2|0;j=j+-1|0}else break}e=m+-384|0;d=0;while(1){x=(c[g+(d<<2)>>2]|0)+h|0;r=(c[i>>2]<<13)+134348800|0;m=c[i+16>>2]|0;w=m*10703|0;m=m*4433|0;f=r+w|0;w=r-w|0;k=r+m|0;m=r-m|0;r=c[i+8>>2]|0;p=c[i+24>>2]|0;u=r-p|0;z=u*2260|0;u=u*11363|0;v=u+(p*20995|0)|0;t=z+(r*7373|0)|0;r=u+(B(r,-4926)|0)|0;p=z+(B(p,-4176)|0)|0;z=v+f|0;v=f-v|0;f=t+k|0;t=k-t|0;k=r+m|0;r=m-r|0;m=p+w|0;p=w-p|0;w=c[i+4>>2]|0;u=c[i+12>>2]|0;C=c[i+20>>2]|0;E=c[i+28>>2]|0;A=C+w|0;j=(u+w|0)*11086|0;l=A*10217|0;s=(E+w|0)*8956|0;q=(w-E|0)*7350|0;A=A*5461|0;n=(w-u|0)*3363|0;y=j+(B(w,-18730)|0)+l+s|0;w=n+(B(w,-15038)|0)+A+q|0;H=(C+u|0)*1136|0;D=(C-u|0)*11529|0;F=E+u|0;G=B(F,-5461)|0;j=j+(u*589|0)+H+G|0;F=B(F,-10217)|0;u=n+(u*16154|0)+D+F|0;n=B(E+C|0,-11086)|0;l=H+(B(C,-9222)|0)+l+n|0;n=G+(E*8728|0)+s+n|0;s=(E-C|0)*3363|0;q=F+(E*25733|0)+q+s|0;s=D+(B(C,-6278)|0)+A+s|0;a[x>>0]=a[e+((y+z|0)>>>18&1023)>>0]|0;a[x+15>>0]=a[e+((z-y|0)>>>18&1023)>>0]|0;a[x+1>>0]=a[e+((j+f|0)>>>18&1023)>>0]|0;a[x+14>>0]=a[e+((f-j|0)>>>18&1023)>>0]|0;a[x+2>>0]=a[e+((l+k|0)>>>18&1023)>>0]|0;a[x+13>>0]=a[e+((k-l|0)>>>18&1023)>>0]|0;a[x+3>>0]=a[e+((n+m|0)>>>18&1023)>>0]|0;a[x+12>>0]=a[e+((m-n|0)>>>18&1023)>>0]|0;a[x+4>>0]=a[e+((q+p|0)>>>18&1023)>>0]|0;a[x+11>>0]=a[e+((p-q|0)>>>18&1023)>>0]|0;a[x+5>>0]=a[e+((s+r|0)>>>18&1023)>>0]|0;a[x+10>>0]=a[e+((r-s|0)>>>18&1023)>>0]|0;a[x+6>>0]=a[e+((u+t|0)>>>18&1023)>>0]|0;a[x+9>>0]=a[e+((t-u|0)>>>18&1023)>>0]|0;a[x+7>>0]=a[e+((w+v|0)>>>18&1023)>>0]|0;a[x+8>>0]=a[e+((v-w|0)>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==8)break;else i=i+32|0}yb=o;return}function Yu(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;m=yb;yb=yb+512|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){r=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;v=B(c[j+128>>2]|0,b[d+64>>1]|0)|0;f=v*10703|0;v=v*4433|0;z=f+r|0;f=r-f|0;x=v+r|0;v=r-v|0;r=B(c[j+64>>2]|0,b[d+32>>1]|0)|0;t=B(c[j+192>>2]|0,b[d+96>>1]|0)|0;o=r-t|0;C=o*2260|0;o=o*11363|0;n=o+(t*20995|0)|0;p=C+(r*7373|0)|0;r=o+(B(r,-4926)|0)|0;t=C+(B(t,-4176)|0)|0;C=n+z|0;n=z-n|0;z=p+x|0;p=x-p|0;x=r+v|0;r=v-r|0;v=t+f|0;t=f-t|0;f=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;o=B(c[j+96>>2]|0,b[d+48>>1]|0)|0;E=B(c[j+160>>2]|0,b[d+80>>1]|0)|0;G=B(c[j+224>>2]|0,b[d+112>>1]|0)|0;D=E+f|0;y=(o+f|0)*11086|0;w=D*10217|0;q=(G+f|0)*8956|0;s=(f-G|0)*7350|0;D=D*5461|0;u=(f-o|0)*3363|0;A=y+(B(f,-18730)|0)+w+q|0;f=u+(B(f,-15038)|0)+D+s|0;J=(E+o|0)*1136|0;F=(E-o|0)*11529|0;H=G+o|0;I=B(H,-5461)|0;y=y+(o*589|0)+J+I|0;H=B(H,-10217)|0;o=u+(o*16154|0)+F+H|0;u=B(G+E|0,-11086)|0;w=J+(B(E,-9222)|0)+w+u|0;u=I+(G*8728|0)+q+u|0;q=(G-E|0)*3363|0;s=H+(G*25733|0)+s+q|0;q=F+(B(E,-6278)|0)+D+q|0;c[k>>2]=A+C>>11;c[k+480>>2]=C-A>>11;c[k+32>>2]=y+z>>11;c[k+448>>2]=z-y>>11;c[k+64>>2]=w+x>>11;c[k+416>>2]=x-w>>11;c[k+96>>2]=u+v>>11;c[k+384>>2]=v-u>>11;c[k+128>>2]=s+t>>11;c[k+352>>2]=t-s>>11;c[k+160>>2]=q+r>>11;c[k+320>>2]=r-q>>11;c[k+192>>2]=o+p>>11;c[k+288>>2]=p-o>>11;c[k+224>>2]=f+n>>11;c[k+256>>2]=n-f>>11;e=e+1|0;if((e|0)==8)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){J=(c[g+(d<<2)>>2]|0)+h|0;D=(c[i>>2]<<13)+134348800|0;y=c[i+16>>2]|0;I=y*10703|0;y=y*4433|0;u=D+I|0;I=D-I|0;w=D+y|0;y=D-y|0;D=c[i+8>>2]|0;A=c[i+24>>2]|0;G=D-A|0;s=G*2260|0;G=G*11363|0;H=G+(A*20995|0)|0;F=s+(D*7373|0)|0;D=G+(B(D,-4926)|0)|0;A=s+(B(A,-4176)|0)|0;s=H+u|0;H=u-H|0;u=F+w|0;F=w-F|0;w=D+y|0;D=y-D|0;y=A+I|0;A=I-A|0;I=c[i+4>>2]|0;G=c[i+12>>2]|0;q=c[i+20>>2]|0;o=c[i+28>>2]|0;r=q+I|0;v=(G+I|0)*11086|0;x=r*10217|0;E=(o+I|0)*8956|0;C=(I-o|0)*7350|0;r=r*5461|0;z=(I-G|0)*3363|0;t=v+(B(I,-18730)|0)+x+E|0;I=z+(B(I,-15038)|0)+r+C|0;k=(q+G|0)*1136|0;p=(q-G|0)*11529|0;n=o+G|0;l=B(n,-5461)|0;v=v+(G*589|0)+k+l|0;n=B(n,-10217)|0;G=z+(G*16154|0)+p+n|0;z=B(o+q|0,-11086)|0;x=k+(B(q,-9222)|0)+x+z|0;z=l+(o*8728|0)+E+z|0;E=(o-q|0)*3363|0;C=n+(o*25733|0)+C+E|0;E=p+(B(q,-6278)|0)+r+E|0;a[J>>0]=a[e+((t+s|0)>>>18&1023)>>0]|0;a[J+15>>0]=a[e+((s-t|0)>>>18&1023)>>0]|0;a[J+1>>0]=a[e+((v+u|0)>>>18&1023)>>0]|0;a[J+14>>0]=a[e+((u-v|0)>>>18&1023)>>0]|0;a[J+2>>0]=a[e+((x+w|0)>>>18&1023)>>0]|0;a[J+13>>0]=a[e+((w-x|0)>>>18&1023)>>0]|0;a[J+3>>0]=a[e+((z+y|0)>>>18&1023)>>0]|0;a[J+12>>0]=a[e+((y-z|0)>>>18&1023)>>0]|0;a[J+4>>0]=a[e+((C+A|0)>>>18&1023)>>0]|0;a[J+11>>0]=a[e+((A-C|0)>>>18&1023)>>0]|0;a[J+5>>0]=a[e+((E+D|0)>>>18&1023)>>0]|0;a[J+10>>0]=a[e+((D-E|0)>>>18&1023)>>0]|0;a[J+6>>0]=a[e+((G+F|0)>>>18&1023)>>0]|0;a[J+9>>0]=a[e+((F-G|0)>>>18&1023)>>0]|0;a[J+7>>0]=a[e+((I+H|0)>>>18&1023)>>0]|0;a[J+8>>0]=a[e+((H-I|0)>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==16)break;else i=i+32|0}yb=m;return}function Zu(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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,C=0,D=0,E=0,F=0;m=yb;yb=yb+480|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){f=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;s=B(c[j+64>>2]|0,b[d+32>>1]|0)|0;w=B(c[j+128>>2]|0,b[d+64>>1]|0)|0;t=B(c[j+192>>2]|0,b[d+96>>1]|0)|0;y=(B(t,-3580)|0)+f|0;D=(t*9373|0)+f|0;f=(B(t,-11586)|0)+f|0;t=s-w|0;w=w+s|0;E=w*10958|0;u=t*374|0;s=s*11795|0;A=u+E+D|0;u=s-E+u+y|0;E=w*4482|0;o=B(t,-3271)|0;q=D-E+o|0;o=E-s+o+y|0;w=w*6476|0;s=t*2896|0;y=s+w+y|0;s=D-w+s|0;w=f+(t*5792|0)|0;f=(B(t,-11584)|0)+f|0;t=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;D=B(c[j+96>>2]|0,b[d+48>>1]|0)|0;E=B((b[d+80>>1]|0)*10033|0,c[j+160>>2]|0)|0;C=B(c[j+224>>2]|0,b[d+112>>1]|0)|0;r=D-C|0;F=(r+t|0)*6810|0;x=F+(t*4209|0)|0;r=F+(B(r,-17828)|0)|0;F=B(D,-6810)|0;D=B(D,-11018)|0;v=t-C|0;n=(v*11522|0)+E|0;z=(C*20131|0)-D+n|0;n=F+(B(t,-9113)|0)+n|0;v=(v*10033|0)-E|0;p=(C+t|0)*4712|0;t=F+(t*3897|0)-E+p|0;p=E+D+(B(C,-7121)|0)+p|0;c[k>>2]=z+A>>11;c[k+448>>2]=A-z>>11;c[k+32>>2]=x+y>>11;c[k+416>>2]=y-x>>11;c[k+64>>2]=v+w>>11;c[k+384>>2]=w-v>>11;c[k+96>>2]=t+u>>11;c[k+352>>2]=u-t>>11;c[k+128>>2]=r+s>>11;c[k+320>>2]=s-r>>11;c[k+160>>2]=p+q>>11;c[k+288>>2]=q-p>>11;c[k+192>>2]=n+o>>11;c[k+256>>2]=o-n>>11;c[k+224>>2]=f>>11;e=e+1|0;if((e|0)==8)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){F=(c[g+(d<<2)>>2]|0)+h|0;E=(c[i>>2]<<13)+134348800|0;x=c[i+8>>2]|0;t=c[i+16>>2]|0;w=c[i+24>>2]|0;r=(B(w,-3580)|0)+E|0;n=(w*9373|0)+E|0;E=(B(w,-11586)|0)+E|0;w=x-t|0;t=t+x|0;l=t*10958|0;v=w*374|0;x=x*11795|0;p=v+l+n|0;v=x-l+v+r|0;l=t*4482|0;C=B(w,-3271)|0;z=n-l+C|0;C=l-x+C+r|0;t=t*6476|0;x=w*2896|0;r=x+t+r|0;x=n-t+x|0;t=E+(w*5792|0)|0;E=(B(w,-11584)|0)+E|0;w=c[i+4>>2]|0;n=c[i+12>>2]|0;l=(c[i+20>>2]|0)*10033|0;o=c[i+28>>2]|0;y=n-o|0;k=(y+w|0)*6810|0;s=k+(w*4209|0)|0;y=k+(B(y,-17828)|0)|0;k=B(n,-6810)|0;n=B(n,-11018)|0;u=w-o|0;D=(u*11522|0)+l|0;q=(o*20131|0)-n+D|0;D=k+(B(w,-9113)|0)+D|0;u=(u*10033|0)-l|0;A=(o+w|0)*4712|0;w=k+(w*3897|0)-l+A|0;A=l+n+(B(o,-7121)|0)+A|0;a[F>>0]=a[e+((q+p|0)>>>18&1023)>>0]|0;a[F+14>>0]=a[e+((p-q|0)>>>18&1023)>>0]|0;a[F+1>>0]=a[e+((s+r|0)>>>18&1023)>>0]|0;a[F+13>>0]=a[e+((r-s|0)>>>18&1023)>>0]|0;a[F+2>>0]=a[e+((u+t|0)>>>18&1023)>>0]|0;a[F+12>>0]=a[e+((t-u|0)>>>18&1023)>>0]|0;a[F+3>>0]=a[e+((w+v|0)>>>18&1023)>>0]|0;a[F+11>>0]=a[e+((v-w|0)>>>18&1023)>>0]|0;a[F+4>>0]=a[e+((y+x|0)>>>18&1023)>>0]|0;a[F+10>>0]=a[e+((x-y|0)>>>18&1023)>>0]|0;a[F+5>>0]=a[e+((A+z|0)>>>18&1023)>>0]|0;a[F+9>>0]=a[e+((z-A|0)>>>18&1023)>>0]|0;a[F+6>>0]=a[e+((D+C|0)>>>18&1023)>>0]|0;a[F+8>>0]=a[e+((C-D|0)>>>18&1023)>>0]|0;a[F+7>>0]=a[e+(E>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==15)break;else i=i+32|0}yb=m;return}function _u(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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,C=0,D=0,E=0,F=0;m=yb;yb=yb+448|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){t=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;r=B(c[j+128>>2]|0,b[d+64>>1]|0)|0;x=(r*10438|0)+t|0;v=(r*2578|0)+t|0;f=(B(r,-7223)|0)+t|0;t=(B(r,-11586)|0)+t>>11;r=B(c[j+64>>2]|0,b[d+32>>1]|0)|0;z=B(c[j+192>>2]|0,b[d+96>>1]|0)|0;p=(z+r|0)*9058|0;n=p+(r*2237|0)|0;p=p+(B(z,-14084)|0)|0;r=(B(z,-11295)|0)+(r*5027|0)|0;z=n+x|0;n=x-n|0;x=p+v|0;p=v-p|0;v=r+f|0;r=f-r|0;f=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;D=B(c[j+96>>2]|0,b[d+48>>1]|0)|0;A=B(c[j+160>>2]|0,b[d+80>>1]|0)|0;s=B(c[j+224>>2]|0,b[d+112>>1]|0)|0;q=s<<13;F=A+f|0;w=(D+f|0)*10935|0;E=F*9810|0;y=w+(B(f,-9232)|0)+E+q|0;F=F*6164|0;C=f-D|0;o=(C*3826|0)-q|0;f=F+(B(f,-8693)|0)+o|0;u=(B(A+D|0,-1297)|0)-q|0;w=w+(B(D,-3474)|0)+u|0;u=E+(B(A,-19447)|0)+u|0;E=(A-D|0)*11512|0;q=E+(B(A,-13850)|0)+F+q|0;o=E+(D*5529|0)+o|0;s=C-A+s<<2;c[k>>2]=y+z>>11;c[k+416>>2]=z-y>>11;c[k+32>>2]=w+x>>11;c[k+384>>2]=x-w>>11;c[k+64>>2]=u+v>>11;c[k+352>>2]=v-u>>11;c[k+96>>2]=s+t;c[k+320>>2]=t-s;c[k+128>>2]=q+r>>11;c[k+288>>2]=r-q>>11;c[k+160>>2]=o+p>>11;c[k+256>>2]=p-o>>11;c[k+192>>2]=f+n>>11;c[k+224>>2]=n-f>>11;e=e+1|0;if((e|0)==8)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){F=(c[g+(d<<2)>>2]|0)+h|0;y=(c[i>>2]<<13)+134348800|0;w=c[i+16>>2]|0;s=y+(w*10438|0)|0;u=y+(w*2578|0)|0;E=y+(B(w,-7223)|0)|0;w=y+(B(w,-11586)|0)|0;y=c[i+8>>2]|0;q=c[i+24>>2]|0;A=(q+y|0)*9058|0;D=A+(y*2237|0)|0;A=A+(B(q,-14084)|0)|0;y=(B(q,-11295)|0)+(y*5027|0)|0;q=D+s|0;D=s-D|0;s=A+u|0;A=u-A|0;u=y+E|0;y=E-y|0;E=c[i+4>>2]|0;n=c[i+12>>2]|0;p=c[i+20>>2]|0;x=c[i+28>>2]<<13;z=p+E|0;t=(n+E|0)*10935|0;l=z*9810|0;r=t+(B(E,-9232)|0)+l+x|0;z=z*6164|0;o=E-n|0;C=(o*3826|0)-x|0;E=z+(B(E,-8693)|0)+C|0;v=(B(p+n|0,-1297)|0)-x|0;t=t+(B(n,-3474)|0)+v|0;v=l+(B(p,-19447)|0)+v|0;l=(p-n|0)*11512|0;z=x+(B(p,-13850)|0)+l+z|0;C=l+(n*5529|0)+C|0;x=(o-p<<13)+x|0;a[F>>0]=a[e+((r+q|0)>>>18&1023)>>0]|0;a[F+13>>0]=a[e+((q-r|0)>>>18&1023)>>0]|0;a[F+1>>0]=a[e+((t+s|0)>>>18&1023)>>0]|0;a[F+12>>0]=a[e+((s-t|0)>>>18&1023)>>0]|0;a[F+2>>0]=a[e+((v+u|0)>>>18&1023)>>0]|0;a[F+11>>0]=a[e+((u-v|0)>>>18&1023)>>0]|0;a[F+3>>0]=a[e+((x+w|0)>>>18&1023)>>0]|0;a[F+10>>0]=a[e+((w-x|0)>>>18&1023)>>0]|0;a[F+4>>0]=a[e+((z+y|0)>>>18&1023)>>0]|0;a[F+9>>0]=a[e+((y-z|0)>>>18&1023)>>0]|0;a[F+5>>0]=a[e+((C+A|0)>>>18&1023)>>0]|0;a[F+8>>0]=a[e+((A-C|0)>>>18&1023)>>0]|0;a[F+6>>0]=a[e+((E+D|0)>>>18&1023)>>0]|0;a[F+7>>0]=a[e+((D-E|0)>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==14)break;else i=i+32|0}yb=m;return}function $u(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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,C=0,D=0,E=0,F=0,G=0,H=0;m=yb;yb=yb+416|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){f=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;n=B(c[j+64>>2]|0,b[d+32>>1]|0)|0;s=B(c[j+128>>2]|0,b[d+64>>1]|0)|0;o=B(c[j+192>>2]|0,b[d+96>>1]|0)|0;E=o+s|0;o=s-o|0;s=E*9465|0;w=(o*793|0)+f|0;A=s+(n*11249|0)+w|0;w=(n*4108|0)-s+w|0;s=E*2592|0;q=(o*3989|0)+f|0;y=(n*8672|0)-s+q|0;q=s+(B(n,-10258)|0)+q|0;E=E*3570|0;s=f+(B(o,-7678)|0)|0;u=(B(n,-1396)|0)-E+s|0;s=E+(B(n,-6581)|0)+s|0;E=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;r=B(c[j+96>>2]|0,b[d+48>>1]|0)|0;C=B(c[j+160>>2]|0,b[d+80>>1]|0)|0;p=B(c[j+224>>2]|0,b[d+112>>1]|0)|0;x=(r+E|0)*10832|0;v=(C+E|0)*9534|0;D=p+E|0;F=D*7682|0;z=x+(B(E,-16549)|0)+v+F|0;H=B(C+r|0,-2773)|0;G=B(p+r|0,-9534)|0;x=x+(r*6859|0)+H+G|0;t=B(p+C|0,-5384)|0;v=H+(B(C,-12879)|0)+v+t|0;t=G+(p*18068|0)+F+t|0;D=(D*2773|0)+((C-r|0)*7682|0)|0;r=D+(E*2611|0)+(B(r,-3818)|0)|0;p=D+(C*3150|0)+(B(p,-14273)|0)|0;c[k>>2]=z+A>>11;c[k+384>>2]=A-z>>11;c[k+32>>2]=x+y>>11;c[k+352>>2]=y-x>>11;c[k+64>>2]=v+w>>11;c[k+320>>2]=w-v>>11;c[k+96>>2]=t+u>>11;c[k+288>>2]=u-t>>11;c[k+128>>2]=r+s>>11;c[k+256>>2]=s-r>>11;c[k+160>>2]=p+q>>11;c[k+224>>2]=q-p>>11;c[k+192>>2]=((o-n|0)*11585|0)+f>>11;e=e+1|0;if((e|0)==8)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){H=(c[g+(d<<2)>>2]|0)+h|0;G=(c[i>>2]<<13)+134348800|0;F=c[i+8>>2]|0;z=c[i+16>>2]|0;E=c[i+24>>2]|0;o=E+z|0;E=z-E|0;z=o*9465|0;v=(E*793|0)+G|0;r=z+(F*11249|0)+v|0;v=(F*4108|0)-z+v|0;z=o*2592|0;C=(E*3989|0)+G|0;t=(F*8672|0)-z+C|0;C=z+(B(F,-10258)|0)+C|0;o=o*3570|0;z=G+(B(E,-7678)|0)|0;x=(B(F,-1396)|0)-o+z|0;z=o+(B(F,-6581)|0)+z|0;o=c[i+4>>2]|0;A=c[i+12>>2]|0;q=c[i+20>>2]|0;D=c[i+28>>2]|0;u=(A+o|0)*10832|0;w=(q+o|0)*9534|0;p=D+o|0;n=p*7682|0;s=u+(B(o,-16549)|0)+w+n|0;k=B(q+A|0,-2773)|0;l=B(D+A|0,-9534)|0;u=u+(A*6859|0)+k+l|0;y=B(D+q|0,-5384)|0;w=k+(B(q,-12879)|0)+w+y|0;y=l+(D*18068|0)+n+y|0;p=(p*2773|0)+((q-A|0)*7682|0)|0;A=p+(o*2611|0)+(B(A,-3818)|0)|0;D=p+(q*3150|0)+(B(D,-14273)|0)|0;a[H>>0]=a[e+((s+r|0)>>>18&1023)>>0]|0;a[H+12>>0]=a[e+((r-s|0)>>>18&1023)>>0]|0;a[H+1>>0]=a[e+((u+t|0)>>>18&1023)>>0]|0;a[H+11>>0]=a[e+((t-u|0)>>>18&1023)>>0]|0;a[H+2>>0]=a[e+((w+v|0)>>>18&1023)>>0]|0;a[H+10>>0]=a[e+((v-w|0)>>>18&1023)>>0]|0;a[H+3>>0]=a[e+((y+x|0)>>>18&1023)>>0]|0;a[H+9>>0]=a[e+((x-y|0)>>>18&1023)>>0]|0;a[H+4>>0]=a[e+((A+z|0)>>>18&1023)>>0]|0;a[H+8>>0]=a[e+((z-A|0)>>>18&1023)>>0]|0;a[H+5>>0]=a[e+((D+C|0)>>>18&1023)>>0]|0;a[H+7>>0]=a[e+((C-D|0)>>>18&1023)>>0]|0;a[H+6>>0]=a[e+((((E-F|0)*11585|0)+G|0)>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==13)break;else i=i+32|0}yb=m;return}function av(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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,C=0;m=yb;yb=yb+384|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){n=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;z=B((b[d+64>>1]|0)*10033|0,c[j+128>>2]|0)|0;y=z+n|0;z=n-z|0;t=B(c[j+64>>2]|0,b[d+32>>1]|0)|0;r=B(b[d+96>>1]<<13,c[j+192>>2]|0)|0;p=(t<<13)-r|0;v=p+n|0;p=n-p|0;n=r+(t*11190|0)|0;x=n+y|0;n=y-n|0;r=(t*2998|0)-r|0;t=r+z|0;r=z-r|0;z=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;y=B(c[j+96>>2]|0,b[d+48>>1]|0)|0;o=B(c[j+160>>2]|0,b[d+80>>1]|0)|0;u=B(c[j+224>>2]|0,b[d+112>>1]|0)|0;C=y*10703|0;A=B(y,-4433)|0;s=o+z|0;f=(u+s|0)*7053|0;s=f+(s*2139|0)|0;w=C+(z*2295|0)+s|0;q=B(u+o|0,-8565)|0;s=(B(o,-12112)|0)+A+q+s|0;q=(u*12998|0)-C+f+q|0;f=A+(B(z,-5540)|0)+(B(u,-16244)|0)+f|0;u=z-u|0;o=y-o|0;y=(u+o|0)*4433|0;u=y+(u*6270|0)|0;o=y+(B(o,-15137)|0)|0;c[k>>2]=w+x>>11;c[k+352>>2]=x-w>>11;c[k+32>>2]=u+v>>11;c[k+320>>2]=v-u>>11;c[k+64>>2]=s+t>>11;c[k+288>>2]=t-s>>11;c[k+96>>2]=q+r>>11;c[k+256>>2]=r-q>>11;c[k+128>>2]=o+p>>11;c[k+224>>2]=p-o>>11;c[k+160>>2]=f+n>>11;c[k+192>>2]=n-f>>11;e=e+1|0;if((e|0)==8)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){C=(c[g+(d<<2)>>2]|0)+h|0;z=(c[i>>2]<<13)+134348800|0;n=(c[i+16>>2]|0)*10033|0;o=z+n|0;n=z-n|0;t=c[i+8>>2]|0;v=c[i+24>>2]<<13;x=(t<<13)-v|0;r=x+z|0;x=z-x|0;z=v+(t*11190|0)|0;p=z+o|0;z=o-z|0;v=(t*2998|0)-v|0;t=v+n|0;v=n-v|0;n=c[i+4>>2]|0;o=c[i+12>>2]|0;y=c[i+20>>2]|0;s=c[i+28>>2]|0;k=o*10703|0;l=B(o,-4433)|0;u=y+n|0;A=(u+s|0)*7053|0;u=A+(u*2139|0)|0;q=k+(n*2295|0)+u|0;w=B(s+y|0,-8565)|0;u=(B(y,-12112)|0)+l+w+u|0;w=(s*12998|0)-k+A+w|0;A=l+(B(n,-5540)|0)+(B(s,-16244)|0)+A|0;s=n-s|0;y=o-y|0;o=(s+y|0)*4433|0;s=o+(s*6270|0)|0;y=o+(B(y,-15137)|0)|0;a[C>>0]=a[e+((q+p|0)>>>18&1023)>>0]|0;a[C+11>>0]=a[e+((p-q|0)>>>18&1023)>>0]|0;a[C+1>>0]=a[e+((s+r|0)>>>18&1023)>>0]|0;a[C+10>>0]=a[e+((r-s|0)>>>18&1023)>>0]|0;a[C+2>>0]=a[e+((u+t|0)>>>18&1023)>>0]|0;a[C+9>>0]=a[e+((t-u|0)>>>18&1023)>>0]|0;a[C+3>>0]=a[e+((w+v|0)>>>18&1023)>>0]|0;a[C+8>>0]=a[e+((v-w|0)>>>18&1023)>>0]|0;a[C+4>>0]=a[e+((y+x|0)>>>18&1023)>>0]|0;a[C+7>>0]=a[e+((x-y|0)>>>18&1023)>>0]|0;a[C+5>>0]=a[e+((A+z|0)>>>18&1023)>>0]|0;a[C+6>>0]=a[e+((z-A|0)>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==12)break;else i=i+32|0}yb=m;return}function bv(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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,C=0;m=yb;yb=yb+352|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){f=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;y=B(c[j+64>>2]|0,b[d+32>>1]|0)|0;z=B(c[j+128>>2]|0,b[d+64>>1]|0)|0;s=B(c[j+192>>2]|0,b[d+96>>1]|0)|0;q=(z-y|0)*3529|0;o=s+y|0;v=o-z|0;x=(v*11116|0)+f|0;w=x+((z-s|0)*20862|0)|0;u=w+(B(z,-14924)|0)+q|0;w=w+(s*17333|0)|0;q=x+q+(B(y,-12399)|0)|0;o=x+(B(o,-9467)|0)|0;s=o+(B(s,-6461)|0)|0;o=(z*15929|0)+(B(y,-11395)|0)+o|0;f=(B(v,-11585)|0)+f|0;v=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;y=B(c[j+96>>2]|0,b[d+48>>1]|0)|0;z=B(c[j+160>>2]|0,b[d+80>>1]|0)|0;x=B(c[j+224>>2]|0,b[d+112>>1]|0)|0;C=y+v|0;n=(z+C+x|0)*3264|0;C=C*7274|0;r=(z+v|0)*5492|0;p=n+((x+v|0)*3e3|0)|0;v=C+(B(v,-7562)|0)+r+p|0;t=n+(B(z+y|0,-9527)|0)|0;r=r+(B(z,-9766)|0)+t|0;A=B(x+y|0,-14731)|0;t=C+(y*16984|0)+A+t|0;p=A+(x*17223|0)+p|0;n=(z*8203|0)+(B(y,-12019)|0)+(B(x,-13802)|0)+n|0;c[k>>2]=v+w>>11;c[k+320>>2]=w-v>>11;c[k+32>>2]=t+u>>11;c[k+288>>2]=u-t>>11;c[k+64>>2]=r+s>>11;c[k+256>>2]=s-r>>11;c[k+96>>2]=p+q>>11;c[k+224>>2]=q-p>>11;c[k+128>>2]=n+o>>11;c[k+192>>2]=o-n>>11;c[k+160>>2]=f>>11;e=e+1|0;if((e|0)==8)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){C=(c[g+(d<<2)>>2]|0)+h|0;A=(c[i>>2]<<13)+134348800|0;o=c[i+8>>2]|0;n=c[i+16>>2]|0;u=c[i+24>>2]|0;w=(n-o|0)*3529|0;y=u+o|0;r=y-n|0;p=(r*11116|0)+A|0;q=p+((n-u|0)*20862|0)|0;s=q+(B(n,-14924)|0)+w|0;q=q+(u*17333|0)|0;w=p+w+(B(o,-12399)|0)|0;y=p+(B(y,-9467)|0)|0;u=y+(B(u,-6461)|0)|0;y=(n*15929|0)+(B(o,-11395)|0)+y|0;A=(B(r,-11585)|0)+A|0;r=c[i+4>>2]|0;o=c[i+12>>2]|0;n=c[i+20>>2]|0;p=c[i+28>>2]|0;k=o+r|0;z=(k+n+p|0)*3264|0;k=k*7274|0;v=(n+r|0)*5492|0;x=z+((p+r|0)*3e3|0)|0;r=k+(B(r,-7562)|0)+v+x|0;t=z+(B(n+o|0,-9527)|0)|0;v=v+(B(n,-9766)|0)+t|0;l=B(p+o|0,-14731)|0;t=k+(o*16984|0)+l+t|0;x=l+(p*17223|0)+x|0;z=(n*8203|0)+(B(o,-12019)|0)+(B(p,-13802)|0)+z|0;a[C>>0]=a[e+((r+q|0)>>>18&1023)>>0]|0;a[C+10>>0]=a[e+((q-r|0)>>>18&1023)>>0]|0;a[C+1>>0]=a[e+((t+s|0)>>>18&1023)>>0]|0;a[C+9>>0]=a[e+((s-t|0)>>>18&1023)>>0]|0;a[C+2>>0]=a[e+((v+u|0)>>>18&1023)>>0]|0;a[C+8>>0]=a[e+((u-v|0)>>>18&1023)>>0]|0;a[C+3>>0]=a[e+((x+w|0)>>>18&1023)>>0]|0;a[C+7>>0]=a[e+((w-x|0)>>>18&1023)>>0]|0;a[C+4>>0]=a[e+((z+y|0)>>>18&1023)>>0]|0;a[C+6>>0]=a[e+((y-z|0)>>>18&1023)>>0]|0;a[C+5>>0]=a[e+(A>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==11)break;else i=i+32|0}yb=m;return}function cv(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;m=yb;yb=yb+320|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){r=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;n=B(c[j+128>>2]|0,b[d+64>>1]|0)|0;t=(n*9373|0)+r|0;w=(B(n,-3580)|0)+r|0;r=(B(n,-11586)|0)+r>>11;n=B(c[j+64>>2]|0,b[d+32>>1]|0)|0;p=B(c[j+192>>2]|0,b[d+96>>1]|0)|0;v=(p+n|0)*6810|0;n=v+(n*4209|0)|0;p=v+(B(p,-17828)|0)|0;v=n+t|0;n=t-n|0;t=p+w|0;p=w-p|0;w=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;x=B(c[j+96>>2]|0,b[d+48>>1]|0)|0;s=B(c[j+160>>2]|0,b[d+80>>1]|0)|0;q=B(c[j+224>>2]|0,b[d+112>>1]|0)|0;o=q+x|0;q=x-q|0;x=q*2531|0;y=s<<13;z=o*7791|0;f=x+y|0;u=z+(w*11443|0)+f|0;f=(w*1812|0)-z+f|0;o=o*4815|0;x=y-x-(q<<12)|0;q=w-s-q<<2;s=(w*10323|0)-o-x|0;o=x+((w*5260|0)-o)|0;c[k>>2]=u+v>>11;c[k+288>>2]=v-u>>11;c[k+32>>2]=s+t>>11;c[k+256>>2]=t-s>>11;c[k+64>>2]=q+r;c[k+224>>2]=r-q;c[k+96>>2]=o+p>>11;c[k+192>>2]=p-o>>11;c[k+128>>2]=f+n>>11;c[k+160>>2]=n-f>>11;e=e+1|0;if((e|0)==8)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){z=(c[g+(d<<2)>>2]|0)+h|0;x=(c[i>>2]<<13)+134348800|0;t=c[i+16>>2]|0;r=x+(t*9373|0)|0;o=x+(B(t,-3580)|0)|0;t=x+(B(t,-11586)|0)|0;x=c[i+8>>2]|0;v=c[i+24>>2]|0;p=(v+x|0)*6810|0;x=p+(x*4209|0)|0;v=p+(B(v,-17828)|0)|0;p=x+r|0;x=r-x|0;r=v+o|0;v=o-v|0;o=c[i+4>>2]|0;n=c[i+12>>2]|0;u=c[i+20>>2]<<13;s=c[i+28>>2]|0;w=s+n|0;s=n-s|0;n=s*2531|0;l=w*7791|0;y=n+u|0;q=l+(o*11443|0)+y|0;y=(o*1812|0)-l+y|0;w=w*4815|0;n=u-n-(s<<12)|0;u=(o-s<<13)-u|0;s=(o*10323|0)-w-n|0;w=n+((o*5260|0)-w)|0;a[z>>0]=a[e+((q+p|0)>>>18&1023)>>0]|0;a[z+9>>0]=a[e+((p-q|0)>>>18&1023)>>0]|0;a[z+1>>0]=a[e+((s+r|0)>>>18&1023)>>0]|0;a[z+8>>0]=a[e+((r-s|0)>>>18&1023)>>0]|0;a[z+2>>0]=a[e+((u+t|0)>>>18&1023)>>0]|0;a[z+7>>0]=a[e+((t-u|0)>>>18&1023)>>0]|0;a[z+3>>0]=a[e+((w+v|0)>>>18&1023)>>0]|0;a[z+6>>0]=a[e+((v-w|0)>>>18&1023)>>0]|0;a[z+4>>0]=a[e+((y+x|0)>>>18&1023)>>0]|0;a[z+5>>0]=a[e+((x-y|0)>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==10)break;else i=i+32|0}yb=m;return}function dv(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;m=yb;yb=yb+288|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){q=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;w=B(c[j+64>>2]|0,b[d+32>>1]|0)|0;o=B(c[j+128>>2]|0,b[d+64>>1]|0)|0;f=B((b[d+96>>1]|0)*5793|0,c[j+192>>2]|0)|0;v=f+q|0;f=q-f-f|0;q=w-o|0;s=f+(q*5793|0)|0;f=(B(q,-11586)|0)+f|0;q=(o+w|0)*10887|0;w=w*8875|0;o=o*2012|0;u=q-o+v|0;q=v-q+w|0;o=v-w+o|0;w=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;v=B(c[j+160>>2]|0,b[d+80>>1]|0)|0;r=B(c[j+224>>2]|0,b[d+112>>1]|0)|0;x=B(B(b[d+48>>1]|0,-10033)|0,c[j+96>>2]|0)|0;p=(v+w|0)*7447|0;n=(r+w|0)*3962|0;t=p-x+n|0;y=(v-r|0)*11409|0;p=x-y+p|0;n=y+x+n|0;r=(w-v-r|0)*10033|0;c[k>>2]=t+u>>11;c[k+256>>2]=u-t>>11;c[k+32>>2]=r+s>>11;c[k+224>>2]=s-r>>11;c[k+64>>2]=p+q>>11;c[k+192>>2]=q-p>>11;c[k+96>>2]=n+o>>11;c[k+160>>2]=o-n>>11;c[k+128>>2]=f>>11;e=e+1|0;if((e|0)==8)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){y=(c[g+(d<<2)>>2]|0)+h|0;t=(c[i>>2]<<13)+134348800|0;n=c[i+8>>2]|0;v=c[i+16>>2]|0;x=(c[i+24>>2]|0)*5793|0;o=x+t|0;x=t-x-x|0;t=n-v|0;r=x+(t*5793|0)|0;x=(B(t,-11586)|0)+x|0;t=(v+n|0)*10887|0;n=n*8875|0;v=v*2012|0;p=t-v+o|0;t=o-t+n|0;v=o-n+v|0;n=c[i+4>>2]|0;o=c[i+20>>2]|0;s=c[i+28>>2]|0;l=B(c[i+12>>2]|0,-10033)|0;u=(o+n|0)*7447|0;w=(s+n|0)*3962|0;q=u-l+w|0;k=(o-s|0)*11409|0;u=l-k+u|0;w=k+l+w|0;s=(n-o-s|0)*10033|0;a[y>>0]=a[e+((q+p|0)>>>18&1023)>>0]|0;a[y+8>>0]=a[e+((p-q|0)>>>18&1023)>>0]|0;a[y+1>>0]=a[e+((s+r|0)>>>18&1023)>>0]|0;a[y+7>>0]=a[e+((r-s|0)>>>18&1023)>>0]|0;a[y+2>>0]=a[e+((u+t|0)>>>18&1023)>>0]|0;a[y+6>>0]=a[e+((t-u|0)>>>18&1023)>>0]|0;a[y+3>>0]=a[e+((w+v|0)>>>18&1023)>>0]|0;a[y+5>>0]=a[e+((v-w|0)>>>18&1023)>>0]|0;a[y+4>>0]=a[e+(x>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==9)break;else i=i+32|0}yb=m;return}function ev(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;m=yb;yb=yb+208|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){f=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;w=B(c[j+64>>2]|0,b[d+32>>1]|0)|0;o=B(c[j+128>>2]|0,b[d+64>>1]|0)|0;u=B(c[j+192>>2]|0,b[d+96>>1]|0)|0;v=(o-u|0)*7223|0;p=(w-o|0)*2578|0;s=(B(o,-15083)|0)+f+p+v|0;n=u+w|0;q=(n*10438|0)+f|0;u=v+(B(u,-637)|0)+q|0;q=p+(B(w,-20239)|0)+q|0;w=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;p=B(c[j+96>>2]|0,b[d+48>>1]|0)|0;v=B(c[j+160>>2]|0,b[d+80>>1]|0)|0;x=(p+w|0)*7663|0;t=(w-p|0)*1395|0;p=B(v+p|0,-11295)|0;r=x+t+p|0;w=(v+w|0)*5027|0;t=w+(x-t)|0;p=w+(v*15326|0)+p|0;c[k>>2]=t+u>>11;c[k+168>>2]=u-t>>11;c[k+28>>2]=r+s>>11;c[k+140>>2]=s-r>>11;c[k+56>>2]=p+q>>11;c[k+112>>2]=q-p>>11;c[k+84>>2]=((o-n|0)*11585|0)+f>>11;e=e+1|0;if((e|0)==7)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){x=(c[g+(d<<2)>>2]|0)+h|0;w=(c[i>>2]<<13)+134348800|0;l=c[i+8>>2]|0;u=c[i+16>>2]|0;o=c[i+24>>2]|0;n=(u-o|0)*7223|0;t=(l-u|0)*2578|0;q=(B(u,-15083)|0)+w+t+n|0;v=o+l|0;s=(v*10438|0)+w|0;o=n+(B(o,-637)|0)+s|0;s=t+(B(l,-20239)|0)+s|0;l=c[i+4>>2]|0;t=c[i+12>>2]|0;n=c[i+20>>2]|0;k=(t+l|0)*7663|0;p=(l-t|0)*1395|0;t=B(n+t|0,-11295)|0;r=k+p+t|0;l=(n+l|0)*5027|0;p=k-p+l|0;t=l+(n*15326|0)+t|0;a[x>>0]=a[e+((p+o|0)>>>18&1023)>>0]|0;a[x+6>>0]=a[e+((o-p|0)>>>18&1023)>>0]|0;a[x+1>>0]=a[e+((r+q|0)>>>18&1023)>>0]|0;a[x+5>>0]=a[e+((q-r|0)>>>18&1023)>>0]|0;a[x+2>>0]=a[e+((t+s|0)>>>18&1023)>>0]|0;a[x+4>>0]=a[e+((s-t|0)>>>18&1023)>>0]|0;a[x+3>>0]=a[e+((((u-v|0)*11585|0)+w|0)>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==7)break;else i=i+28|0}yb=m;return}function fv(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;m=yb;yb=yb+144|0;i=m;l=c[d+336>>2]|0;k=i;j=c[e+84>>2]|0;d=f;e=0;while(1){p=B(b[d>>1]<<13,c[j>>2]|0)|0|1024;n=B((b[d+64>>1]|0)*5793|0,c[j+128>>2]|0)|0;t=n+p|0;p=(B(n,-2)|0)+p>>11;n=B((b[d+32>>1]|0)*10033|0,c[j+64>>2]|0)|0;r=n+t|0;n=t-n|0;t=B(c[j+32>>2]|0,b[d+16>>1]|0)|0;s=B(c[j+96>>2]|0,b[d+48>>1]|0)|0;o=B(c[j+160>>2]|0,b[d+80>>1]|0)|0;f=(o+t|0)*2998|0;q=f+(s+t<<13)|0;f=f+(o-s<<13)|0;o=t-s-o<<2;c[k>>2]=q+r>>11;c[k+120>>2]=r-q>>11;c[k+24>>2]=o+p;c[k+96>>2]=p-o;c[k+48>>2]=f+n>>11;c[k+72>>2]=n-f>>11;e=e+1|0;if((e|0)==6)break;else{k=k+4|0;j=j+4|0;d=d+2|0}}e=l+-384|0;d=0;while(1){t=(c[g+(d<<2)>>2]|0)+h|0;r=(c[i>>2]<<13)+134348800|0;p=(c[i+16>>2]|0)*5793|0;k=r+p|0;p=r-p-p|0;r=(c[i+8>>2]|0)*10033|0;n=k+r|0;r=k-r|0;k=c[i+4>>2]|0;l=c[i+12>>2]|0;q=c[i+20>>2]|0;s=(q+k|0)*2998|0;o=s+(l+k<<13)|0;s=s+(q-l<<13)|0;q=k-l-q<<13;a[t>>0]=a[e+((o+n|0)>>>18&1023)>>0]|0;a[t+5>>0]=a[e+((n-o|0)>>>18&1023)>>0]|0;a[t+1>>0]=a[e+((q+p|0)>>>18&1023)>>0]|0;a[t+4>>0]=a[e+((p-q|0)>>>18&1023)>>0]|0;a[t+2>>0]=a[e+((s+r|0)>>>18&1023)>>0]|0;a[t+3>>0]=a[e+((r-s|0)>>>18&1023)>>0]|0;d=d+1|0;if((d|0)==6)break;else i=i+24|0}yb=m;return}function gv(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;i=yb;yb=yb+112|0;l=i;d=c[d+336>>2]|0;o=c[e+84>>2]|0;n=B(b[f>>1]<<13,c[o>>2]|0)|0|1024;e=B(c[o+64>>2]|0,b[f+32>>1]|0)|0;j=B(c[o+128>>2]|0,b[f+64>>1]|0)|0;q=(j+e|0)*6476|0;j=e-j|0;e=(j*2896|0)+n|0;p=e+q|0;q=e-q|0;n=(B(j,-11584)|0)+n|0;j=B(c[o+32>>2]|0,b[f+16>>1]|0)|0;e=B(c[o+96>>2]|0,b[f+48>>1]|0)|0;m=(e+j|0)*6810|0;j=m+(j*4209|0)|0;e=m+(B(e,-17828)|0)|0;c[l>>2]=j+p>>11;c[l+80>>2]=p-j>>11;j=l+20|0;c[j>>2]=e+q>>11;c[l+60>>2]=q-e>>11;c[l+40>>2]=n>>11;n=l+4|0;e=B(b[f+2>>1]<<13,c[o+4>>2]|0)|0|1024;q=B(c[o+68>>2]|0,b[f+34>>1]|0)|0;p=B(c[o+132>>2]|0,b[f+66>>1]|0)|0;m=(p+q|0)*6476|0;p=q-p|0;q=(p*2896|0)+e|0;k=q+m|0;m=q-m|0;e=(B(p,-11584)|0)+e|0;p=B(c[o+36>>2]|0,b[f+18>>1]|0)|0;q=B(c[o+100>>2]|0,b[f+50>>1]|0)|0;r=(q+p|0)*6810|0;p=r+(p*4209|0)|0;q=r+(B(q,-17828)|0)|0;c[n>>2]=p+k>>11;c[l+84>>2]=k-p>>11;c[l+24>>2]=q+m>>11;c[l+64>>2]=m-q>>11;c[l+44>>2]=e>>11;e=B(b[f+4>>1]<<13,c[o+8>>2]|0)|0|1024;q=B(c[o+72>>2]|0,b[f+36>>1]|0)|0;m=B(c[o+136>>2]|0,b[f+68>>1]|0)|0;p=(m+q|0)*6476|0;m=q-m|0;q=(m*2896|0)+e|0;k=q+p|0;p=q-p|0;e=(B(m,-11584)|0)+e|0;m=B(c[o+40>>2]|0,b[f+20>>1]|0)|0;q=B(c[o+104>>2]|0,b[f+52>>1]|0)|0;r=(q+m|0)*6810|0;m=r+(m*4209|0)|0;q=r+(B(q,-17828)|0)|0;c[l+8>>2]=m+k>>11;c[l+88>>2]=k-m>>11;c[l+28>>2]=q+p>>11;c[l+68>>2]=p-q>>11;c[l+48>>2]=e>>11;e=B(b[f+6>>1]<<13,c[o+12>>2]|0)|0|1024;q=B(c[o+76>>2]|0,b[f+38>>1]|0)|0;p=B(c[o+140>>2]|0,b[f+70>>1]|0)|0;m=(p+q|0)*6476|0;p=q-p|0;q=(p*2896|0)+e|0;k=q+m|0;m=q-m|0;e=(B(p,-11584)|0)+e|0;p=B(c[o+44>>2]|0,b[f+22>>1]|0)|0;q=B(c[o+108>>2]|0,b[f+54>>1]|0)|0;r=(q+p|0)*6810|0;p=r+(p*4209|0)|0;q=r+(B(q,-17828)|0)|0;c[l+12>>2]=p+k>>11;c[l+92>>2]=k-p>>11;c[l+32>>2]=q+m>>11;c[l+72>>2]=m-q>>11;c[l+52>>2]=e>>11;e=B(b[f+8>>1]<<13,c[o+16>>2]|0)|0|1024;q=B(c[o+80>>2]|0,b[f+40>>1]|0)|0;m=B(c[o+144>>2]|0,b[f+72>>1]|0)|0;p=(m+q|0)*6476|0;m=q-m|0;q=(m*2896|0)+e|0;k=q+p|0;p=q-p|0;e=(B(m,-11584)|0)+e|0;m=B(c[o+48>>2]|0,b[f+24>>1]|0)|0;f=B(c[o+112>>2]|0,b[f+56>>1]|0)|0;o=(f+m|0)*6810|0;m=o+(m*4209|0)|0;f=o+(B(f,-17828)|0)|0;c[l+16>>2]=m+k>>11;c[l+96>>2]=k-m>>11;c[l+36>>2]=f+p>>11;c[l+76>>2]=p-f>>11;c[l+56>>2]=e>>11;f=d+-384|0;e=(c[g>>2]|0)+h|0;d=(c[l>>2]<<13)+134348800|0;p=c[l+8>>2]|0;m=c[l+16>>2]|0;k=(m+p|0)*6476|0;m=p-m|0;p=(m*2896|0)+d|0;o=p+k|0;k=p-k|0;d=(B(m,-11584)|0)+d|0;n=c[n>>2]|0;m=c[l+12>>2]|0;p=(m+n|0)*6810|0;n=p+(n*4209|0)|0;m=p+(B(m,-17828)|0)|0;a[e>>0]=a[f+((n+o|0)>>>18&1023)>>0]|0;a[e+4>>0]=a[f+((o-n|0)>>>18&1023)>>0]|0;a[e+1>>0]=a[f+((m+k|0)>>>18&1023)>>0]|0;a[e+3>>0]=a[f+((k-m|0)>>>18&1023)>>0]|0;a[e+2>>0]=a[f+(d>>>18&1023)>>0]|0;e=(c[g+4>>2]|0)+h|0;j=(c[j>>2]<<13)+134348800|0;d=c[l+28>>2]|0;m=c[l+36>>2]|0;k=(m+d|0)*6476|0;m=d-m|0;d=(m*2896|0)+j|0;n=d+k|0;k=d-k|0;j=(B(m,-11584)|0)+j|0;m=c[l+24>>2]|0;d=c[l+32>>2]|0;o=(d+m|0)*6810|0;m=o+(m*4209|0)|0;d=o+(B(d,-17828)|0)|0;a[e>>0]=a[f+((m+n|0)>>>18&1023)>>0]|0;a[e+4>>0]=a[f+((n-m|0)>>>18&1023)>>0]|0;a[e+1>>0]=a[f+((d+k|0)>>>18&1023)>>0]|0;a[e+3>>0]=a[f+((k-d|0)>>>18&1023)>>0]|0;a[e+2>>0]=a[f+(j>>>18&1023)>>0]|0;e=(c[g+8>>2]|0)+h|0;j=(c[l+40>>2]<<13)+134348800|0;d=c[l+48>>2]|0;k=c[l+56>>2]|0;m=(k+d|0)*6476|0;k=d-k|0;d=(k*2896|0)+j|0;n=d+m|0;m=d-m|0;j=(B(k,-11584)|0)+j|0;k=c[l+44>>2]|0;d=c[l+52>>2]|0;o=(d+k|0)*6810|0;k=o+(k*4209|0)|0;d=o+(B(d,-17828)|0)|0;a[e>>0]=a[f+((k+n|0)>>>18&1023)>>0]|0;a[e+4>>0]=a[f+((n-k|0)>>>18&1023)>>0]|0;a[e+1>>0]=a[f+((d+m|0)>>>18&1023)>>0]|0;a[e+3>>0]=a[f+((m-d|0)>>>18&1023)>>0]|0;a[e+2>>0]=a[f+(j>>>18&1023)>>0]|0;e=(c[g+12>>2]|0)+h|0;j=(c[l+60>>2]<<13)+134348800|0;d=c[l+68>>2]|0;m=c[l+76>>2]|0;k=(m+d|0)*6476|0;m=d-m|0;d=(m*2896|0)+j|0;n=d+k|0;k=d-k|0;j=(B(m,-11584)|0)+j|0;m=c[l+64>>2]|0;d=c[l+72>>2]|0;o=(d+m|0)*6810|0;m=o+(m*4209|0)|0;d=o+(B(d,-17828)|0)|0;a[e>>0]=a[f+((m+n|0)>>>18&1023)>>0]|0;a[e+4>>0]=a[f+((n-m|0)>>>18&1023)>>0]|0;a[e+1>>0]=a[f+((d+k|0)>>>18&1023)>>0]|0;a[e+3>>0]=a[f+((k-d|0)>>>18&1023)>>0]|0;a[e+2>>0]=a[f+(j>>>18&1023)>>0]|0;h=(c[g+16>>2]|0)+h|0;g=(c[l+80>>2]<<13)+134348800|0;e=c[l+88>>2]|0;j=c[l+96>>2]|0;d=(j+e|0)*6476|0;j=e-j|0;e=(j*2896|0)+g|0;k=e+d|0;d=e-d|0;g=(B(j,-11584)|0)+g|0;j=c[l+84>>2]|0;e=c[l+92>>2]|0;l=(e+j|0)*6810|0;j=l+(j*4209|0)|0;e=l+(B(e,-17828)|0)|0;a[h>>0]=a[f+((j+k|0)>>>18&1023)>>0]|0;a[h+4>>0]=a[f+((k-j|0)>>>18&1023)>>0]|0;a[h+1>>0]=a[f+((e+d|0)>>>18&1023)>>0]|0;a[h+3>>0]=a[f+((d-e|0)>>>18&1023)>>0]|0;a[h+2>>0]=a[f+(g>>>18&1023)>>0]|0;yb=i;return}function hv(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;i=yb;yb=yb+64|0;k=i;d=c[d+336>>2]|0;e=c[e+84>>2]|0;m=B(c[e>>2]|0,b[f>>1]|0)|0;j=B(c[e+64>>2]|0,b[f+32>>1]|0)|0;o=j+m<<2;j=m-j<<2;m=B(c[e+32>>2]|0,b[f+16>>1]|0)|0;n=B(c[e+96>>2]|0,b[f+48>>1]|0)|0;l=((n+m|0)*4433|0)+1024|0;m=l+(m*6270|0)>>11;n=l+(B(n,-15137)|0)>>11;c[k>>2]=m+o;c[k+48>>2]=o-m;m=k+16|0;c[m>>2]=n+j;c[k+32>>2]=j-n;n=k+4|0;j=B(c[e+4>>2]|0,b[f+2>>1]|0)|0;o=B(c[e+68>>2]|0,b[f+34>>1]|0)|0;l=o+j<<2;o=j-o<<2;j=B(c[e+36>>2]|0,b[f+18>>1]|0)|0;q=B(c[e+100>>2]|0,b[f+50>>1]|0)|0;p=((q+j|0)*4433|0)+1024|0;j=p+(j*6270|0)>>11;q=p+(B(q,-15137)|0)>>11;c[n>>2]=j+l;c[k+52>>2]=l-j;c[k+20>>2]=q+o;c[k+36>>2]=o-q;q=B(c[e+8>>2]|0,b[f+4>>1]|0)|0;o=B(c[e+72>>2]|0,b[f+36>>1]|0)|0;j=o+q<<2;o=q-o<<2;q=B(c[e+40>>2]|0,b[f+20>>1]|0)|0;l=B(c[e+104>>2]|0,b[f+52>>1]|0)|0;p=((l+q|0)*4433|0)+1024|0;q=p+(q*6270|0)>>11;l=p+(B(l,-15137)|0)>>11;p=q+j|0;c[k+8>>2]=p;c[k+56>>2]=j-q;c[k+24>>2]=l+o;c[k+40>>2]=o-l;l=B(c[e+12>>2]|0,b[f+6>>1]|0)|0;o=B(c[e+76>>2]|0,b[f+38>>1]|0)|0;q=o+l<<2;o=l-o<<2;l=B(c[e+44>>2]|0,b[f+22>>1]|0)|0;e=B(c[e+108>>2]|0,b[f+54>>1]|0)|0;j=((e+l|0)*4433|0)+1024|0;l=j+(l*6270|0)>>11;e=j+(B(e,-15137)|0)>>11;j=l+q|0;c[k+12>>2]=j;c[k+60>>2]=q-l;l=e+o|0;c[k+28>>2]=l;c[k+44>>2]=o-e;e=d+-384|0;d=(c[g>>2]|0)+h|0;f=(c[k>>2]|0)+16400|0;o=f+p<<13;f=f-p<<13;n=c[n>>2]|0;p=(j+n|0)*4433|0;n=p+(n*6270|0)|0;j=p+(B(j,-15137)|0)|0;a[d>>0]=a[e+((n+o|0)>>>18&1023)>>0]|0;a[d+3>>0]=a[e+((o-n|0)>>>18&1023)>>0]|0;a[d+1>>0]=a[e+((j+f|0)>>>18&1023)>>0]|0;a[d+2>>0]=a[e+((f-j|0)>>>18&1023)>>0]|0;d=(c[g+4>>2]|0)+h|0;m=(c[m>>2]|0)+16400|0;j=c[k+24>>2]|0;f=m+j<<13;j=m-j<<13;m=c[k+20>>2]|0;n=(l+m|0)*4433|0;m=n+(m*6270|0)|0;l=n+(B(l,-15137)|0)|0;a[d>>0]=a[e+((m+f|0)>>>18&1023)>>0]|0;a[d+3>>0]=a[e+((f-m|0)>>>18&1023)>>0]|0;a[d+1>>0]=a[e+((l+j|0)>>>18&1023)>>0]|0;a[d+2>>0]=a[e+((j-l|0)>>>18&1023)>>0]|0;d=(c[g+8>>2]|0)+h|0;l=(c[k+32>>2]|0)+16400|0;j=c[k+40>>2]|0;m=l+j<<13;j=l-j<<13;l=c[k+36>>2]|0;f=c[k+44>>2]|0;n=(f+l|0)*4433|0;l=n+(l*6270|0)|0;f=n+(B(f,-15137)|0)|0;a[d>>0]=a[e+((l+m|0)>>>18&1023)>>0]|0;a[d+3>>0]=a[e+((m-l|0)>>>18&1023)>>0]|0;a[d+1>>0]=a[e+((f+j|0)>>>18&1023)>>0]|0;a[d+2>>0]=a[e+((j-f|0)>>>18&1023)>>0]|0;h=(c[g+12>>2]|0)+h|0;d=(c[k+48>>2]|0)+16400|0;f=c[k+56>>2]|0;j=d+f<<13;f=d-f<<13;d=c[k+52>>2]|0;g=c[k+60>>2]|0;k=(g+d|0)*4433|0;d=k+(d*6270|0)|0;g=k+(B(g,-15137)|0)|0;a[h>>0]=a[e+((d+j|0)>>>18&1023)>>0]|0;a[h+3>>0]=a[e+((j-d|0)>>>18&1023)>>0]|0;a[h+1>>0]=a[e+((g+f|0)>>>18&1023)>>0]|0;a[h+2>>0]=a[e+((f-g|0)>>>18&1023)>>0]|0;yb=i;return}function iv(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;i=yb;yb=yb+48|0;j=i;d=c[d+336>>2]|0;e=c[e+84>>2]|0;l=B(b[f>>1]<<13,c[e>>2]|0)|0|1024;k=B((b[f+32>>1]|0)*5793|0,c[e+64>>2]|0)|0;n=k+l|0;l=(B(k,-2)|0)+l|0;k=B((b[f+16>>1]|0)*10033|0,c[e+32>>2]|0)|0;m=k+n>>11;c[j>>2]=m;c[j+24>>2]=n-k>>11;k=j+12|0;c[k>>2]=l>>11;l=B(b[f+2>>1]<<13,c[e+4>>2]|0)|0|1024;n=B((b[f+34>>1]|0)*5793|0,c[e+68>>2]|0)|0;q=n+l|0;l=(B(n,-2)|0)+l|0;n=B((b[f+18>>1]|0)*10033|0,c[e+36>>2]|0)|0;o=n+q>>11;c[j+4>>2]=o;c[j+28>>2]=q-n>>11;l=l>>11;c[j+16>>2]=l;n=B(b[f+4>>1]<<13,c[e+8>>2]|0)|0|1024;q=B((b[f+36>>1]|0)*5793|0,c[e+72>>2]|0)|0;p=q+n|0;n=(B(q,-2)|0)+n|0;e=B((b[f+20>>1]|0)*10033|0,c[e+40>>2]|0)|0;q=e+p>>11;c[j+8>>2]=q;e=p-e>>11;c[j+32>>2]=e;n=n>>11;c[j+20>>2]=n;f=d+-384|0;d=(c[g>>2]|0)+h|0;m=(m<<13)+134348800|0;p=m+(q*5793|0)|0;m=(B(q,-11586)|0)+m|0;o=o*10033|0;a[d>>0]=a[f+((p+o|0)>>>18&1023)>>0]|0;a[d+2>>0]=a[f+((p-o|0)>>>18&1023)>>0]|0;a[d+1>>0]=a[f+(m>>>18&1023)>>0]|0;d=(c[g+4>>2]|0)+h|0;k=(c[k>>2]<<13)+134348800|0;m=k+(n*5793|0)|0;k=(B(n,-11586)|0)+k|0;l=l*10033|0;a[d>>0]=a[f+((m+l|0)>>>18&1023)>>0]|0;a[d+2>>0]=a[f+((m-l|0)>>>18&1023)>>0]|0;a[d+1>>0]=a[f+(k>>>18&1023)>>0]|0;h=(c[g+8>>2]|0)+h|0;g=(c[j+24>>2]<<13)+134348800|0;d=g+(e*5793|0)|0;g=(B(e,-11586)|0)+g|0;e=(c[j+28>>2]|0)*10033|0;a[h>>0]=a[f+((d+e|0)>>>18&1023)>>0]|0;a[h+2>>0]=a[f+((d-e|0)>>>18&1023)>>0]|0;a[h+1>>0]=a[f+(g>>>18&1023)>>0]|0;yb=i;return}function jv(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0;d=(c[d+336>>2]|0)+-384|0;j=c[e+84>>2]|0;i=B(c[j>>2]|0,b[f>>1]|0)|0;e=B(c[j+32>>2]|0,b[f+16>>1]|0)|0;i=i+4100|0;k=e+i|0;e=i-e|0;i=B(c[j+4>>2]|0,b[f+2>>1]|0)|0;f=B(c[j+36>>2]|0,b[f+18>>1]|0)|0;j=f+i|0;f=i-f|0;i=(c[g>>2]|0)+h|0;a[i>>0]=a[d+((j+k|0)>>>3&1023)>>0]|0;a[i+1>>0]=a[d+((k-j|0)>>>3&1023)>>0]|0;h=(c[g+4>>2]|0)+h|0;a[h>>0]=a[d+((f+e|0)>>>3&1023)>>0]|0;a[h+1>>0]=a[d+((e-f|0)>>>3&1023)>>0]|0;return}function kv(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;f=a[(c[d+336>>2]|0)+-384+(((B(c[c[e+84>>2]>>2]|0,b[f>>1]|0)|0)+4100|0)>>>3&1023)>>0]|0;a[(c[g>>2]|0)+h>>0]=f;return}function lv(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;o=yb;yb=yb+256|0;m=o;l=c[d+336>>2]|0;k=m;j=c[e+84>>2]|0;i=8;while(1){e=b[f+16>>1]|0;d=b[f+32>>1]|0;if(!((e|d)<<16>>16))if(((((b[f+48>>1]|0)==0?(b[f+64>>1]|0)==0:0)?(b[f+80>>1]|0)==0:0)?(b[f+96>>1]|0)==0:0)?(b[f+112>>1]|0)==0:0){d=B(b[f>>1]<<2,c[j>>2]|0)|0;c[k>>2]=d;c[k+32>>2]=d;c[k+64>>2]=d;c[k+96>>2]=d;c[k+128>>2]=d;c[k+160>>2]=d;c[k+192>>2]=d;e=56}else{d=0;n=9}else n=9;if((n|0)==9){n=0;x=B(b[f+64>>1]<<13,c[j+128>>2]|0)|0;p=B(b[f>>1]<<13,c[j>>2]|0)|0|1024;s=x+p|0;x=p-x|0;p=B(c[j+64>>2]|0,d<<16>>16)|0;q=B(c[j+192>>2]|0,b[f+96>>1]|0)|0;u=(q+p|0)*4433|0;p=u+(p*6270|0)|0;q=u+(B(q,-15137)|0)|0;u=p+s|0;p=s-p|0;s=q+x|0;q=x-q|0;d=B(c[j+224>>2]|0,b[f+112>>1]|0)|0;x=B(c[j+160>>2]|0,b[f+80>>1]|0)|0;v=B(c[j+96>>2]|0,b[f+48>>1]|0)|0;t=B(c[j+32>>2]|0,e<<16>>16)|0;r=v+d|0;e=t+x|0;w=(e+r|0)*9633|0;r=w+(B(r,-16069)|0)|0;e=w+(B(e,-3196)|0)|0;w=B(t+d|0,-7373)|0;d=w+(d*2446|0)+r|0;t=w+(t*12299|0)+e|0;w=B(v+x|0,-20995)|0;e=w+(x*16819|0)+e|0;r=w+(v*25172|0)+r|0;c[k>>2]=t+u>>11;c[k+224>>2]=u-t>>11;c[k+32>>2]=r+s>>11;c[k+192>>2]=s-r>>11;c[k+64>>2]=e+q>>11;c[k+160>>2]=q-e>>11;c[k+96>>2]=d+p>>11;d=p-d>>11;e=32}c[k+(e<<2)>>2]=d;if(i>>>0>1){k=k+4|0;j=j+4|0;f=f+2|0;i=i+-1|0}else break}l=l+-384|0;k=0;e=m;while(1){f=(c[g+(k<<2)>>2]|0)+h|0;i=(c[e>>2]|0)+16400|0;j=c[e+4>>2]|0;d=c[e+8>>2]|0;if(!(j|d))if(((((c[e+12>>2]|0)==0?(c[e+16>>2]|0)==0:0)?(c[e+20>>2]|0)==0:0)?(c[e+24>>2]|0)==0:0)?(c[e+28>>2]|0)==0:0){x=a[l+(i>>>5&1023)>>0]|0;a[f>>0]=x;_O(f+1|0,x|0,7)|0}else{d=0;n=19}else n=19;if((n|0)==19){n=0;x=c[e+16>>2]|0;s=x+i<<13;x=i-x<<13;u=c[e+24>>2]|0;q=(u+d|0)*4433|0;w=q+(d*6270|0)|0;u=q+(B(u,-15137)|0)|0;q=w+s|0;w=s-w|0;s=u+x|0;u=x-u|0;x=c[e+28>>2]|0;i=c[e+20>>2]|0;p=c[e+12>>2]|0;t=p+x|0;v=i+j|0;r=(t+v|0)*9633|0;t=r+(B(t,-16069)|0)|0;v=r+(B(v,-3196)|0)|0;r=B(x+j|0,-7373)|0;x=r+(x*2446|0)+t|0;r=r+(j*12299|0)+v|0;m=B(p+i|0,-20995)|0;v=m+(i*16819|0)+v|0;t=m+(p*25172|0)+t|0;a[f>>0]=a[l+((r+q|0)>>>18&1023)>>0]|0;a[f+7>>0]=a[l+((q-r|0)>>>18&1023)>>0]|0;a[f+1>>0]=a[l+((t+s|0)>>>18&1023)>>0]|0;a[f+6>>0]=a[l+((s-t|0)>>>18&1023)>>0]|0;a[f+2>>0]=a[l+((v+u|0)>>>18&1023)>>0]|0;a[f+5>>0]=a[l+((u-v|0)>>>18&1023)>>0]|0;a[f+3>>0]=a[l+((x+w|0)>>>18&1023)>>0]|0;a[f+4>>0]=a[l+((w-x|0)>>>18&1023)>>0]|0}k=k+1|0;if((k|0)==8)break;else e=e+32|0}yb=o;return}function mv(a,b){a=a|0;b=b|0;var d=0;d=c[a+456>>2]|0;a:do switch(b|0){case 0:{if(!(c[a+84>>2]|0)){c[d+4>>2]=c[(c[a+476>>2]|0)+4>>2];break a}c[d+4>>2]=4;b=d+12|0;if(!(c[b>>2]|0))c[b>>2]=Kb[c[(c[a+4>>2]|0)+28>>2]&31](a,c[d+8>>2]|0,0,c[d+16>>2]|0,1)|0;break}case 3:{if(!(c[d+8>>2]|0)){b=c[a>>2]|0;c[b+20>>2]=3;Qb[c[b>>2]&255](a)}c[d+4>>2]=5;break}case 2:{if(!(c[d+8>>2]|0)){b=c[a>>2]|0;c[b+20>>2]=3;Qb[c[b>>2]&255](a)}c[d+4>>2]=6;break}default:{b=c[a>>2]|0;c[b+20>>2]=3;Qb[c[b>>2]&255](a)}}while(0);c[d+24>>2]=0;c[d+20>>2]=0;return}function nv(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 i=0,j=0,k=0,l=0,m=0;i=yb;yb=yb+16|0;j=i;m=c[a+456>>2]|0;k=h-(c[g>>2]|0)|0;l=c[m+16>>2]|0;c[j>>2]=0;h=m+12|0;Yb[c[(c[a+476>>2]|0)+4>>2]&7](a,b,d,e,c[h>>2]|0,j,k>>>0>l>>>0?l:k);Vb[c[(c[a+484>>2]|0)+4>>2]&31](a,c[h>>2]|0,f+(c[g>>2]<<2)|0,c[j>>2]|0);c[g>>2]=(c[g>>2]|0)+(c[j>>2]|0);yb=i;return}function ov(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 i=0,j=0,k=0,l=0;k=c[a+456>>2]|0;l=k+24|0;f=c[l>>2]|0;if(!f){j=k+16|0;h=Kb[c[(c[a+4>>2]|0)+28>>2]&31](a,c[k+8>>2]|0,c[k+20>>2]|0,c[j>>2]|0,1)|0;i=k+12|0;c[i>>2]=h;f=c[l>>2]|0}else{h=k+12|0;j=k+16|0;i=h;h=c[h>>2]|0}Yb[c[(c[a+476>>2]|0)+4>>2]&7](a,b,d,e,h,l,c[j>>2]|0);h=c[l>>2]|0;if(h>>>0>f>>>0){h=h-f|0;Vb[c[(c[a+484>>2]|0)+4>>2]&31](a,(c[i>>2]|0)+(f<<2)|0,0,h);c[g>>2]=(c[g>>2]|0)+h;h=c[l>>2]|0}f=c[j>>2]|0;if(h>>>0>>0)return;k=k+20|0;c[k>>2]=(c[k>>2]|0)+f;c[l>>2]=0;return}function pv(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 i=0,j=0,k=0,l=0;d=c[a+456>>2]|0;j=d+24|0;b=c[j>>2]|0;if(!b){i=d+20|0;e=d+16|0;k=Kb[c[(c[a+4>>2]|0)+28>>2]&31](a,c[d+8>>2]|0,c[i>>2]|0,c[e>>2]|0,0)|0;c[d+12>>2]=k;b=c[j>>2]|0;d=k}else{i=d+20|0;e=d+16|0;d=c[d+12>>2]|0}k=(c[e>>2]|0)-b|0;l=c[g>>2]|0;h=h-l|0;k=k>>>0>h>>>0?h:k;h=(c[a+116>>2]|0)-(c[i>>2]|0)|0;k=k>>>0>h>>>0?h:k;Vb[c[(c[a+484>>2]|0)+4>>2]&31](a,d+(b<<2)|0,f+(l<<2)|0,k);c[g>>2]=(c[g>>2]|0)+k;k=(c[j>>2]|0)+k|0;c[j>>2]=k;b=c[e>>2]|0;if(k>>>0>>0)return;c[i>>2]=(c[i>>2]|0)+b;c[j>>2]=0;return}function qv(a){a=a|0;var b=0;b=c[a+476>>2]|0;c[b+92>>2]=c[a+320>>2];c[b+96>>2]=c[a+116>>2];return}function rv(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 i=0,j=0,k=0,l=0,m=0,n=0;l=c[a+476>>2]|0;m=l+92|0;i=c[m>>2]|0;k=a+320|0;e=c[k>>2]|0;if((i|0)>=(e|0)){j=a+36|0;if((c[j>>2]|0)>0){e=c[a+216>>2]|0;i=0;while(1){n=(c[b+(i<<2)>>2]|0)+((B(c[l+100+(i<<2)>>2]|0,c[d>>2]|0)|0)<<2)|0;Vb[c[l+52+(i<<2)>>2]&31](a,e,n,l+12+(i<<2)|0);i=i+1|0;if((i|0)>=(c[j>>2]|0))break;else e=e+88|0}e=c[k>>2]|0}c[m>>2]=0;i=0}n=e-i|0;b=l+96|0;j=c[b>>2]|0;n=n>>>0>j>>>0?j:n;j=c[g>>2]|0;h=h-j|0;n=n>>>0>h>>>0?h:n;Wb[c[(c[a+480>>2]|0)+4>>2]&63](a,l+12|0,i,f+(j<<2)|0,n);c[g>>2]=(c[g>>2]|0)+n;c[b>>2]=(c[b>>2]|0)-n;n=(c[m>>2]|0)+n|0;c[m>>2]=n;if((n|0)<(c[k>>2]|0))return;c[d>>2]=(c[d>>2]|0)+1;return}function sv(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;c[e>>2]=0;return}function tv(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;c[e>>2]=d;return}function uv(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;j=c[f>>2]|0;k=b+320|0;d=c[k>>2]|0;if((d|0)<=0)return;i=b+112|0;h=0;do{b=c[j+(h<<2)>>2]|0;f=c[i>>2]|0;g=b+f|0;if((f|0)>0){f=c[e+(h<<2)>>2]|0;d=b;while(1){b=a[f>>0]|0;a[d>>0]=b;a[d+1>>0]=b;d=d+2|0;if(d>>>0>=g>>>0)break;else f=f+1|0}d=c[k>>2]|0}h=h+1|0}while((h|0)<(d|0));return}function vv(b,d,e,f){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;k=c[f>>2]|0;l=b+320|0;if((c[l>>2]|0)<=0)return;j=b+112|0;h=0;i=0;while(1){b=c[k+(i<<2)>>2]|0;d=c[j>>2]|0;g=b+d|0;if((d|0)>0){f=c[e+(h<<2)>>2]|0;d=b;while(1){b=a[f>>0]|0;a[d>>0]=b;a[d+1>>0]=b;d=d+2|0;if(d>>>0>=g>>>0)break;else f=f+1|0}d=c[j>>2]|0}xv(k,i,k,i|1,1,d);i=i+2|0;if((i|0)>=(c[l>>2]|0))break;else h=h+1|0}return}function wv(b,d,e,f){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;r=c[b+476>>2]|0;q=c[f>>2]|0;d=c[d+4>>2]|0;f=a[r+140+d>>0]|0;o=f&255;d=a[r+150+d>>0]|0;r=d&255;p=b+320|0;g=c[p>>2]|0;if((g|0)<=0)return;n=b+112|0;k=f<<24>>24!=0;l=r+-1|0;if((d&255)>1){j=(f<<24>>24==0?~o:-2)+o+2|0;h=0;i=0;while(1){d=c[q+(i<<2)>>2]|0;f=c[n>>2]|0;g=d+f|0;if((f|0)>0){if(!k)break;b=c[e+(h<<2)>>2]|0;f=d;while(1){_O(f|0,a[b>>0]|0,j|0)|0;d=o;while(1){f=f+1|0;if((d|0)<=1)break;else d=d+-1|0}if(f>>>0>>0)b=b+1|0;else break}f=c[n>>2]|0}xv(q,i,q,i+1|0,l,f);i=i+r|0;if((i|0)>=(c[p>>2]|0)){m=27;break}else h=h+1|0}if((m|0)==27)return;while(1){}}if(!k){d=(c[n>>2]|0)>0;f=0;while(1){if(d)break;f=f+r|0;if((f|0)>=(g|0)){m=27;break}}if((m|0)==27)return;while(1){}}b=0;h=0;while(1){f=c[q+(h<<2)>>2]|0;m=c[n>>2]|0;i=f+m|0;if((m|0)>0){g=c[e+(b<<2)>>2]|0;while(1){_O(f|0,a[g>>0]|0,o|0)|0;d=o;while(1){f=f+1|0;if((d|0)<=1)break;else d=d+-1|0}if(f>>>0>>0)g=g+1|0;else break}}h=h+r|0;if((h|0)>=(c[p>>2]|0))break;else b=b+1|0}return}function xv(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;if((f|0)<=0)return;b=a+(b<<2)|0;a=d+(e<<2)|0;while(1){YO(c[a>>2]|0,c[b>>2]|0,g|0)|0;if((f|0)>1){b=b+4|0;a=a+4|0;f=f+-1|0}else break}return}function yv(a){a=a|0;return}function zv(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;xv(c[b>>2]|0,d,e,0,f,c[a+112>>2]|0);return}function Av(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;q=c[(c[b+480>>2]|0)+24>>2]|0;n=c[b+112>>2]|0;if((h|0)<=0)return;o=e+4|0;p=e+8|0;if(!n)return;while(1){i=h;h=h+-1|0;j=c[(c[e>>2]|0)+(f<<2)>>2]|0;k=c[(c[o>>2]|0)+(f<<2)>>2]|0;l=c[(c[p>>2]|0)+(f<<2)>>2]|0;f=f+1|0;m=c[g>>2]|0;b=0;do{a[m+b>>0]=((c[q+((d[k+b>>0]|0|256)<<2)>>2]|0)+(c[q+((d[j+b>>0]|0)<<2)>>2]|0)+(c[q+((d[l+b>>0]|0|512)<<2)>>2]|0)|0)>>>16;b=b+1|0}while((b|0)!=(n|0));if((i|0)<=1)break;else g=g+4|0}return}function Bv(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;q=c[(c[b+480>>2]|0)+24>>2]|0;n=c[b+112>>2]|0;if((h|0)<=0)return;o=e+4|0;p=e+8|0;if(!n)return;while(1){i=h;h=h+-1|0;j=c[(c[e>>2]|0)+(f<<2)>>2]|0;k=c[(c[o>>2]|0)+(f<<2)>>2]|0;l=c[(c[p>>2]|0)+(f<<2)>>2]|0;f=f+1|0;m=c[g>>2]|0;b=0;do{s=d[k+b>>0]|0;r=s+128|0;a[m+b>>0]=((c[q+((s|256)<<2)>>2]|0)+(c[q+((r+(d[j+b>>0]|0)&255)<<2)>>2]|0)+(c[q+((r+(d[l+b>>0]|0)&255|512)<<2)>>2]|0)|0)>>>16;b=b+1|0}while((b|0)!=(n|0));if((i|0)<=1)break;else g=g+4|0}return}function Cv(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;k=c[b+112>>2]|0;if((g|0)<1|(k|0)==0)return;while(1){i=g;g=g+-1|0;j=c[(c[d>>2]|0)+(e<<2)>>2]|0;b=0;h=c[f>>2]|0;while(1){l=a[j+b>>0]|0;a[h+2>>0]=l;a[h+1>>0]=l;a[h>>0]=l;b=b+1|0;if((b|0)==(k|0))break;else h=h+3|0}if((i|0)<=1)break;else{f=f+4|0;e=e+1|0}}return}function Dv(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;r=c[b+480>>2]|0;u=c[b+112>>2]|0;n=c[b+336>>2]|0;o=c[r+8>>2]|0;p=c[r+12>>2]|0;q=c[r+16>>2]|0;r=c[r+20>>2]|0;if((h|0)<=0)return;s=e+4|0;t=e+8|0;if(!u)return;while(1){j=h;h=h+-1|0;k=c[(c[e>>2]|0)+(f<<2)>>2]|0;l=c[(c[s>>2]|0)+(f<<2)>>2]|0;m=c[(c[t>>2]|0)+(f<<2)>>2]|0;f=f+1|0;b=c[g>>2]|0;i=0;while(1){v=d[k+i>>0]|0;w=d[l+i>>0]|0;x=d[m+i>>0]|0;a[b>>0]=a[n+((c[o+(x<<2)>>2]|0)+v)>>0]|0;a[b+1>>0]=a[n+(((c[q+(x<<2)>>2]|0)+(c[r+(w<<2)>>2]|0)>>16)+v)>>0]|0;a[b+2>>0]=a[n+((c[p+(w<<2)>>2]|0)+v)>>0]|0;i=i+1|0;if((i|0)==(u|0))break;else b=b+3|0}if((j|0)<=1)break;else g=g+4|0}return}function Ev(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;m=c[b+112>>2]|0;if((g|0)<=0)return;n=d+4|0;o=d+8|0;if(!m)return;while(1){i=g;g=g+-1|0;j=c[(c[d>>2]|0)+(e<<2)>>2]|0;k=c[(c[n>>2]|0)+(e<<2)>>2]|0;l=c[(c[o>>2]|0)+(e<<2)>>2]|0;e=e+1|0;b=0;h=c[f>>2]|0;while(1){a[h>>0]=a[j+b>>0]|0;a[h+1>>0]=a[k+b>>0]|0;a[h+2>>0]=a[l+b>>0]|0;b=b+1|0;if((b|0)==(m|0))break;else h=h+3|0}if((i|0)<=1)break;else f=f+4|0}return}function Fv(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;n=c[b+112>>2]|0;if((h|0)<=0)return;o=e+4|0;p=e+8|0;if(!n)return;while(1){j=h;h=h+-1|0;k=c[(c[e>>2]|0)+(f<<2)>>2]|0;l=c[(c[o>>2]|0)+(f<<2)>>2]|0;m=c[(c[p>>2]|0)+(f<<2)>>2]|0;f=f+1|0;b=0;i=c[g>>2]|0;while(1){s=a[l+b>>0]|0;q=d[m+b>>0]|0;r=(s&255)+128|0;a[i>>0]=r+(d[k+b>>0]|0);a[i+1>>0]=s;a[i+2>>0]=r+q;b=b+1|0;if((b|0)==(n|0))break;else i=i+3|0}if((j|0)<=1)break;else g=g+4|0}return}function Gv(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;s=c[b+480>>2]|0;w=c[b+112>>2]|0;o=c[b+336>>2]|0;p=c[s+8>>2]|0;q=c[s+12>>2]|0;r=c[s+16>>2]|0;s=c[s+20>>2]|0;if((h|0)<=0)return;t=e+4|0;u=e+8|0;v=e+12|0;if(!w)return;while(1){j=h;h=h+-1|0;k=c[(c[e>>2]|0)+(f<<2)>>2]|0;l=c[(c[t>>2]|0)+(f<<2)>>2]|0;m=c[(c[u>>2]|0)+(f<<2)>>2]|0;n=c[(c[v>>2]|0)+(f<<2)>>2]|0;f=f+1|0;b=c[g>>2]|0;i=0;while(1){x=d[l+i>>0]|0;z=d[m+i>>0]|0;y=~a[k+i>>0]&255;a[b>>0]=a[o+(y-(c[p+(z<<2)>>2]|0))>>0]|0;a[b+1>>0]=a[o+(y-((c[r+(z<<2)>>2]|0)+(c[s+(x<<2)>>2]|0)>>16))>>0]|0;a[b+2>>0]=a[o+(y-(c[q+(x<<2)>>2]|0))>>0]|0;a[b+3>>0]=a[n+i>>0]|0;i=i+1|0;if((i|0)==(w|0))break;else b=b+4|0}if((j|0)<=1)break;else g=g+4|0}return}function Hv(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;n=c[b+36>>2]|0;m=c[b+112>>2]|0;if((g|0)<=0)return;l=(m|0)==0;if((n|0)<=0)return;while(1){k=g;g=g+-1|0;if(!l){j=0;do{b=0;h=c[(c[d+(j<<2)>>2]|0)+(e<<2)>>2]|0;i=(c[f>>2]|0)+j|0;while(1){a[i>>0]=a[h>>0]|0;b=b+1|0;if((b|0)==(m|0))break;else{h=h+1|0;i=i+n|0}}j=j+1|0}while((j|0)!=(n|0))}if((k|0)<=1)break;else{f=f+4|0;e=e+1|0}}return}function Iv(a){a=a|0;var b=0;b=c[a+476>>2]|0;c[b+36>>2]=0;c[b+44>>2]=c[a+116>>2];return}function Jv(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 i=0,j=0,k=0,l=0,m=0,n=0;n=yb;yb=yb+16|0;l=n;m=c[a+476>>2]|0;i=m+36|0;if(!(c[i>>2]|0)){j=m+44|0;e=c[j>>2]|0;e=e>>>0<2?e:2;k=c[g>>2]|0;h=h-k|0;e=e>>>0>h>>>0?h:e;c[l>>2]=c[f+(k<<2)>>2];if(e>>>0>1)c[l+4>>2]=c[f+(k+1<<2)>>2];else{c[l+4>>2]=c[m+32>>2];c[i>>2]=1}Vb[c[m+12>>2]&31](a,b,c[d>>2]|0,l);f=(c[i>>2]|0)==0;c[g>>2]=(c[g>>2]|0)+e;c[j>>2]=(c[j>>2]|0)-e;if(!f){yb=n;return}}else{xv(m+32|0,0,f+(c[g>>2]<<2)|0,0,1,c[m+40>>2]|0);c[i>>2]=0;f=m+44|0;c[g>>2]=(c[g>>2]|0)+1;c[f>>2]=(c[f>>2]|0)+-1}c[d>>2]=(c[d>>2]|0)+1;yb=n;return}function Kv(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var 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;w=c[b+476>>2]|0;x=c[b+336>>2]|0;y=c[w+16>>2]|0;u=c[w+20>>2]|0;v=c[w+24>>2]|0;w=c[w+28>>2]|0;i=c[e>>2]|0;h=f<<1;t=c[i+(h<<2)>>2]|0;h=c[i+((h|1)<<2)>>2]|0;i=c[(c[e+4>>2]|0)+(f<<2)>>2]|0;p=c[(c[e+8>>2]|0)+(f<<2)>>2]|0;f=c[g>>2]|0;g=c[g+4>>2]|0;s=b+112|0;e=c[s>>2]|0;m=e>>>1;if(!m){j=p;b=t}else{n=i+m|0;q=e&-2;r=m*6|0;o=h+q|0;l=p;e=t;b=g;j=f;k=m;while(1){A=d[i>>0]|0;B=d[l>>0]|0;C=c[y+(B<<2)>>2]|0;B=(c[v+(B<<2)>>2]|0)+(c[w+(A<<2)>>2]|0)>>16;A=c[u+(A<<2)>>2]|0;z=d[e>>0]|0;a[j>>0]=a[x+(C+z)>>0]|0;a[j+1>>0]=a[x+(B+z)>>0]|0;a[j+2>>0]=a[x+(A+z)>>0]|0;z=d[e+1>>0]|0;a[j+3>>0]=a[x+(C+z)>>0]|0;a[j+4>>0]=a[x+(B+z)>>0]|0;a[j+5>>0]=a[x+(A+z)>>0]|0;z=d[h>>0]|0;a[b>>0]=a[x+(C+z)>>0]|0;a[b+1>>0]=a[x+(B+z)>>0]|0;a[b+2>>0]=a[x+(A+z)>>0]|0;z=d[h+1>>0]|0;a[b+3>>0]=a[x+(C+z)>>0]|0;a[b+4>>0]=a[x+(B+z)>>0]|0;a[b+5>>0]=a[x+(A+z)>>0]|0;k=k+-1|0;if(!k)break;else{l=l+1|0;i=i+1|0;h=h+2|0;e=e+2|0;b=b+6|0;j=j+6|0}}j=p+m|0;i=n;h=o;b=t+q|0;g=g+r|0;f=f+r|0;e=c[s>>2]|0}if(!(e&1))return;B=d[i>>0]|0;A=d[j>>0]|0;z=c[y+(A<<2)>>2]|0;A=(c[v+(A<<2)>>2]|0)+(c[w+(B<<2)>>2]|0)>>16;B=c[u+(B<<2)>>2]|0;C=d[b>>0]|0;a[f>>0]=a[x+(z+C)>>0]|0;a[f+1>>0]=a[x+(A+C)>>0]|0;a[f+2>>0]=a[x+(B+C)>>0]|0;C=d[h>>0]|0;a[g>>0]=a[x+(z+C)>>0]|0;a[g+1>>0]=a[x+(A+C)>>0]|0;a[g+2>>0]=a[x+(B+C)>>0]|0;return}function Lv(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;Vb[c[(c[a+476>>2]|0)+12>>2]&31](a,b,c[d>>2]|0,f+(c[g>>2]<<2)|0);c[g>>2]=(c[g>>2]|0)+1;c[d>>2]=(c[d>>2]|0)+1;return}function Mv(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var 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;s=c[b+476>>2]|0;t=c[b+336>>2]|0;u=c[s+16>>2]|0;q=c[s+20>>2]|0;r=c[s+24>>2]|0;s=c[s+28>>2]|0;p=c[(c[e>>2]|0)+(f<<2)>>2]|0;i=c[(c[e+4>>2]|0)+(f<<2)>>2]|0;h=c[(c[e+8>>2]|0)+(f<<2)>>2]|0;f=c[g>>2]|0;o=b+112|0;e=c[o>>2]|0;l=e>>>1;if(!l){b=i;g=p}else{b=i+l|0;m=e&-2;n=l*6|0;k=h;e=i;g=p;i=f;j=l;while(1){w=d[e>>0]|0;x=d[k>>0]|0;y=c[u+(x<<2)>>2]|0;x=(c[r+(x<<2)>>2]|0)+(c[s+(w<<2)>>2]|0)>>16;w=c[q+(w<<2)>>2]|0;v=d[g>>0]|0;a[i>>0]=a[t+(y+v)>>0]|0;a[i+1>>0]=a[t+(x+v)>>0]|0;a[i+2>>0]=a[t+(w+v)>>0]|0;v=d[g+1>>0]|0;a[i+3>>0]=a[t+(y+v)>>0]|0;a[i+4>>0]=a[t+(x+v)>>0]|0;a[i+5>>0]=a[t+(w+v)>>0]|0;j=j+-1|0;if(!j)break;else{k=k+1|0;e=e+1|0;g=g+2|0;i=i+6|0}}h=h+l|0;g=p+m|0;f=f+n|0;e=c[o>>2]|0}if(!(e&1))return;x=d[b>>0]|0;v=d[h>>0]|0;w=(c[r+(v<<2)>>2]|0)+(c[s+(x<<2)>>2]|0)>>16;x=c[q+(x<<2)>>2]|0;y=d[g>>0]|0;a[f>>0]=a[t+((c[u+(v<<2)>>2]|0)+y)>>0]|0;a[f+1>>0]=a[t+(w+y)>>0]|0;a[f+2>>0]=a[t+(x+y)>>0]|0;return}function Nv(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;f=c[a+484>>2]|0;g=c[f+24>>2]|0;e=a+88|0;if(!(c[e>>2]|0))d=0;else{c[e>>2]=2;d=2}if(!b){c[f+4>>2]=(d|0)==2?20:21;c[f+8>>2]=131;b=c[a+132>>2]|0;if((b|0)>=1){if((b|0)>256){d=c[a>>2]|0;c[d+20>>2]=59;c[d+24>>2]=256;Qb[c[c[a>>2]>>2]&255](a)}}else{d=c[a>>2]|0;c[d+20>>2]=58;c[d+24>>2]=1;Qb[c[c[a>>2]>>2]&255](a)}if((c[e>>2]|0)==2){e=((c[a+112>>2]|0)*6|0)+12|0;d=f+32|0;b=c[d>>2]|0;if(!b){b=Hb[c[(c[a+4>>2]|0)+4>>2]&63](a,1,e)|0;c[d>>2]=b}_O(b|0,0,e|0)|0;if(!(c[f+40>>2]|0))Pv(a);c[f+36>>2]=0}}else{c[f+4>>2]=19;c[f+8>>2]=130;c[f+28>>2]=1}b=f+28|0;if(!(c[b>>2]|0))return;_O(c[g>>2]|0,0,4096)|0;_O(c[g+4>>2]|0,0,4096)|0;_O(c[g+8>>2]|0,0,4096)|0;_O(c[g+12>>2]|0,0,4096)|0;_O(c[g+16>>2]|0,0,4096)|0;_O(c[g+20>>2]|0,0,4096)|0;_O(c[g+24>>2]|0,0,4096)|0;_O(c[g+28>>2]|0,0,4096)|0;_O(c[g+32>>2]|0,0,4096)|0;_O(c[g+36>>2]|0,0,4096)|0;_O(c[g+40>>2]|0,0,4096)|0;_O(c[g+44>>2]|0,0,4096)|0;_O(c[g+48>>2]|0,0,4096)|0;_O(c[g+52>>2]|0,0,4096)|0;_O(c[g+56>>2]|0,0,4096)|0;_O(c[g+60>>2]|0,0,4096)|0;_O(c[g+64>>2]|0,0,4096)|0;_O(c[g+68>>2]|0,0,4096)|0;_O(c[g+72>>2]|0,0,4096)|0;_O(c[g+76>>2]|0,0,4096)|0;_O(c[g+80>>2]|0,0,4096)|0;_O(c[g+84>>2]|0,0,4096)|0;_O(c[g+88>>2]|0,0,4096)|0;_O(c[g+92>>2]|0,0,4096)|0;_O(c[g+96>>2]|0,0,4096)|0;_O(c[g+100>>2]|0,0,4096)|0;_O(c[g+104>>2]|0,0,4096)|0;_O(c[g+108>>2]|0,0,4096)|0;_O(c[g+112>>2]|0,0,4096)|0;_O(c[g+116>>2]|0,0,4096)|0;_O(c[g+120>>2]|0,0,4096)|0;_O(c[g+124>>2]|0,0,4096)|0;c[b>>2]=0;return}function Ov(a){a=a|0;c[(c[a+484>>2]|0)+28>>2]=1;return}function Pv(a){a=a|0;var b=0,d=0,e=0;d=c[a+484>>2]|0;a=Hb[c[c[a+4>>2]>>2]&63](a,1,2044)|0;e=a+1020|0;c[d+40>>2]=e;c[e>>2]=0;c[a+1024>>2]=1;c[a+1016>>2]=-1;c[a+1028>>2]=2;c[a+1012>>2]=-2;c[a+1032>>2]=3;c[a+1008>>2]=-3;c[a+1036>>2]=4;c[a+1004>>2]=-4;c[a+1040>>2]=5;c[a+1e3>>2]=-5;c[a+1044>>2]=6;c[a+996>>2]=-6;c[a+1048>>2]=7;c[a+992>>2]=-7;c[a+1052>>2]=8;c[a+988>>2]=-8;c[a+1056>>2]=9;c[a+984>>2]=-9;c[a+1060>>2]=10;c[a+980>>2]=-10;c[a+1064>>2]=11;c[a+976>>2]=-11;c[a+1068>>2]=12;c[a+972>>2]=-12;c[a+1072>>2]=13;c[a+968>>2]=-13;c[a+1076>>2]=14;c[a+964>>2]=-14;c[a+1080>>2]=15;c[a+960>>2]=-15;a=16;d=16;do{c[e+(a<<2)>>2]=d;c[e+(0-a<<2)>>2]=0-d;a=a+1|0;d=(a&1^1)+d|0}while((a|0)!=48);b=0-d|0;a=48;do{c[e+(a<<2)>>2]=d;c[e+(0-a<<2)>>2]=b;a=a+1|0}while((a|0)!=256);return}function Qv(a,e,f,g){a=a|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;j=c[(c[a+484>>2]|0)+24>>2]|0;i=c[a+112>>2]|0;if((g|0)<1|(i|0)==0)return;a=0;do{f=i;h=c[e+(a<<2)>>2]|0;while(1){k=(c[j+((d[h>>0]|0)>>>3<<2)>>2]|0)+((d[h+1>>0]|0)>>>2<<6)+((d[h+2>>0]|0)>>>3<<1)|0;m=b[k>>1]|0;l=m+1<<16>>16;b[k>>1]=l<<16>>16==0?m:l;f=f+-1|0;if(!f)break;else h=h+3|0}a=a+1|0}while((a|0)!=(g|0));return}function Rv(d){d=d|0;var 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,A=0,C=0,D=0;y=d+484|0;A=c[y>>2]|0;C=d+136|0;c[C>>2]=c[A+16>>2];s=c[A+20>>2]|0;z=Hb[c[c[d+4>>2]>>2]&63](d,1,s<<5)|0;c[z>>2]=0;c[z+4>>2]=31;c[z+8>>2]=0;c[z+12>>2]=63;c[z+16>>2]=0;c[z+20>>2]=31;Wv(d,z);a:do if((s|0)>1){e=1;while(1){if((e<<1|0)>(s|0)){g=0;h=0;i=z;f=0;while(1){j=c[i+24>>2]|0;k=(j|0)>(g|0);f=k?i:f;h=h+1|0;if((h|0)==(e|0)){q=f;break}else{g=k?j:g;i=i+32|0}}}else{f=0;i=0;j=z;g=0;while(1){h=c[j+28>>2]|0;if((h|0)>(f|0)){x=(c[j+24>>2]|0)>0;g=x?j:g;f=x?h:f}i=i+1|0;if((i|0)==(e|0)){q=g;break}else j=j+32|0}}if(!q)break a;r=z+(e<<5)|0;g=q+4|0;c[z+(e<<5)+4>>2]=c[g>>2];h=q+12|0;c[z+(e<<5)+12>>2]=c[h>>2];i=q+20|0;c[z+(e<<5)+20>>2]=c[i>>2];c[r>>2]=c[q>>2];n=q+8|0;f=z+(e<<5)+8|0;c[f>>2]=c[n>>2];p=q+16|0;j=z+(e<<5)+16|0;c[j>>2]=c[p>>2];k=c[g>>2]|0;l=c[q>>2]|0;v=k-l<<4;m=c[h>>2]|0;n=c[n>>2]|0;w=(m-n|0)*12|0;o=c[i>>2]|0;p=c[p>>2]|0;x=(v|0)>(w|0);switch(((o-p<<3|0)>((x?v:w)|0)?2:(x^1)&1)&3){case 0:{t=(l+k|0)/2|0;c[g>>2]=t;f=r;g=t;t=15;break}case 1:{g=(n+m|0)/2|0;c[h>>2]=g;t=15;break}case 2:{g=(p+o|0)/2|0;c[i>>2]=g;f=j;t=15;break}default:{}}if((t|0)==15){t=0;c[f>>2]=g+1}Wv(d,q);Wv(d,r);e=e+1|0;if((e|0)>=(s|0))break a}}else e=1;while(0);x=0;do{r=c[(c[y>>2]|0)+24>>2]|0;j=c[z+(x<<5)>>2]|0;s=c[z+(x<<5)+4>>2]|0;t=c[z+(x<<5)+8>>2]|0;u=c[z+(x<<5)+12>>2]|0;v=c[z+(x<<5)+16>>2]|0;w=c[z+(x<<5)+20>>2]|0;if((j|0)>(s|0)|(t|0)>(u|0)|(v|0)>(w|0)){i=0;h=0;g=0;f=0}else{i=0;h=0;g=0;f=0;while(1){p=c[r+(j<<2)>>2]|0;q=j<<3|4;o=t;while(1){n=o<<2|2;l=p+(o<<6)+(v<<1)|0;m=v;while(1){D=b[l>>1]|0;k=D&65535;if(D<<16>>16){i=(B(m<<3|4,k)|0)+i|0;h=(B(n,k)|0)+h|0;g=(B(q,k)|0)+g|0;f=f+k|0}if((m|0)<(w|0)){l=l+2|0;m=m+1|0}else break}if((o|0)<(u|0))o=o+1|0;else break}if((j|0)<(s|0))j=j+1|0;else break}}D=f>>1;a[(c[c[C>>2]>>2]|0)+x>>0]=(g+D|0)/(f|0)|0;a[(c[(c[C>>2]|0)+4>>2]|0)+x>>0]=(h+D|0)/(f|0)|0;a[(c[(c[C>>2]|0)+8>>2]|0)+x>>0]=(i+D|0)/(f|0)|0;x=x+1|0}while((x|0)<(e|0));c[d+132>>2]=e;D=c[d>>2]|0;c[D+20>>2]=98;c[D+24>>2]=e;Sb[c[(c[d>>2]|0)+4>>2]&63](d,1);c[A+28>>2]=1;return}function Sv(e,f,g,h){e=e|0;f=f|0;g=g|0;h=h|0;var 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,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;i=c[e+484>>2]|0;U=c[i+24>>2]|0;V=c[e+112>>2]|0;O=c[e+336>>2]|0;P=c[i+40>>2]|0;S=c[e+136>>2]|0;Q=c[S>>2]|0;R=c[S+4>>2]|0;S=c[S+8>>2]|0;if((h|0)<=0)return;T=i+36|0;J=i+32|0;K=(V|0)==0;L=V+-1|0;M=L*3|0;N=(V*3|0)+3|0;I=0;do{k=c[f+(I<<2)>>2]|0;j=c[g+(I<<2)>>2]|0;if(!(c[T>>2]|0)){F=3;G=1;i=c[J>>2]|0;l=1}else{F=-3;G=-1;i=(c[J>>2]|0)+(N<<1)|0;j=j+L|0;k=k+M|0;l=0}c[T>>2]=l;if(K){l=0;k=0;j=0}else{A=F+1|0;C=F+2|0;H=B(V,F)|0;p=0;q=0;w=0;x=0;y=0;l=0;D=0;E=0;z=V;m=0;u=i;while(1){v=u;u=u+(F<<1)|0;r=d[O+((c[P+(m+8+(b[u>>1]|0)>>4<<2)>>2]|0)+(d[k>>0]|0))>>0]|0;s=d[O+((c[P+(p+8+(b[v+(A<<1)>>1]|0)>>4<<2)>>2]|0)+(d[k+1>>0]|0))>>0]|0;t=d[O+((c[P+(q+8+(b[v+(C<<1)>>1]|0)>>4<<2)>>2]|0)+(d[k+2>>0]|0))>>0]|0;n=r>>>3;o=s>>>2;p=t>>>3;q=(c[U+(n<<2)>>2]|0)+(o<<6)+(p<<1)|0;m=b[q>>1]|0;if(!(m<<16>>16)){Vv(e,n,o,p);m=b[q>>1]|0}m=(m&65535)+-1|0;a[j>>0]=m;o=r-(d[Q+m>>0]|0)|0;n=s-(d[R+m>>0]|0)|0;m=t-(d[S+m>>0]|0)|0;b[v>>1]=(o*3|0)+l;l=(o*5|0)+w|0;b[v+2>>1]=(n*3|0)+D;D=(n*5|0)+x|0;b[v+4>>1]=(m*3|0)+E;E=(m*5|0)+y|0;z=z+-1|0;if(!z)break;else{p=n*7|0;q=m*7|0;w=o;x=n;y=m;m=o*7|0;j=j+G|0;k=k+F|0}}k=D;j=E;i=i+(H<<1)|0}b[i>>1]=l;b[i+2>>1]=k;b[i+4>>1]=j;I=I+1|0}while((I|0)!=(h|0));return}function Tv(e,f,g,h){e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;r=c[(c[e+484>>2]|0)+24>>2]|0;s=c[e+112>>2]|0;if((h|0)<1|(s|0)==0)return;o=0;do{n=s;p=c[g+(o<<2)>>2]|0;q=c[f+(o<<2)>>2]|0;while(1){j=(d[q>>0]|0)>>>3;k=(d[q+1>>0]|0)>>>2;l=(d[q+2>>0]|0)>>>3;m=(c[r+(j<<2)>>2]|0)+(k<<6)+(l<<1)|0;i=b[m>>1]|0;if(!(i<<16>>16)){Vv(e,j,k,l);i=b[m>>1]|0}a[p>>0]=(i&65535)+255;n=n+-1|0;if(!n)break;else{p=p+1|0;q=q+3|0}}o=o+1|0}while((o|0)!=(h|0));return}function Uv(a){a=a|0;return}function Vv(e,f,g,h){e=e|0;f=f|0;g=g|0;h=h|0;var 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,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;N=yb;yb=yb+1408|0;K=N+384|0;L=N+128|0;i=N;M=c[(c[e+484>>2]|0)+24>>2]|0;n=f>>>2<<5;H=n|4;p=g>>>3<<5;I=p|2;r=h>>>2<<5;J=r|4;x=c[e+132>>2]|0;n=n|28;o=n+H>>1;p=p|30;q=p+I>>1;r=r|28;s=r+J>>1;if((x|0)>0){v=c[e+136>>2]|0;t=c[v>>2]|0;u=c[v+4>>2]|0;v=c[v+8>>2]|0;w=2147483647;m=0;do{j=d[t+m>>0]|0;do if((H|0)<=(j|0)){if((n|0)<(j|0)){G=j-n<<1;l=j-H<<1;l=B(l,l)|0;j=B(G,G)|0;break}if((o|0)<(j|0)){l=j-H<<1;l=B(l,l)|0;j=0;break}else{l=j-n<<1;l=B(l,l)|0;j=0;break}}else{G=j-H<<1;l=j-n<<1;l=B(l,l)|0;j=B(G,G)|0}while(0);k=d[u+m>>0]|0;do if((I|0)<=(k|0)){if((p|0)<(k|0)){G=(k-p|0)*3|0;k=(k-I|0)*3|0;j=(B(G,G)|0)+j|0;k=B(k,k)|0;break}if((q|0)<(k|0)){k=(k-I|0)*3|0;k=B(k,k)|0;break}else{k=(k-p|0)*3|0;k=B(k,k)|0;break}}else{G=(k-I|0)*3|0;k=(k-p|0)*3|0;j=(B(G,G)|0)+j|0;k=B(k,k)|0}while(0);l=k+l|0;k=d[v+m>>0]|0;do if((J|0)<=(k|0)){if((r|0)<(k|0)){G=k-r|0;k=k-J|0;j=(B(G,G)|0)+j|0;k=B(k,k)|0;break}if((s|0)<(k|0)){k=k-J|0;k=B(k,k)|0;break}else{k=k-r|0;k=B(k,k)|0;break}}else{G=k-J|0;k=k-r|0;j=(B(G,G)|0)+j|0;k=B(k,k)|0}while(0);G=l+k|0;c[K+(m<<2)>>2]=j;w=(G|0)<(w|0)?G:w;m=m+1|0}while((m|0)!=(x|0));j=0;k=0;do{if((c[K+(k<<2)>>2]|0)<=(w|0)){a[L+j>>0]=k;j=j+1|0}k=k+1|0}while((k|0)!=(x|0))}else j=0;c[K>>2]=2147483647;c[K+4>>2]=2147483647;c[K+8>>2]=2147483647;c[K+12>>2]=2147483647;c[K+16>>2]=2147483647;c[K+20>>2]=2147483647;c[K+24>>2]=2147483647;c[K+28>>2]=2147483647;c[K+32>>2]=2147483647;c[K+36>>2]=2147483647;c[K+40>>2]=2147483647;c[K+44>>2]=2147483647;c[K+48>>2]=2147483647;c[K+52>>2]=2147483647;c[K+56>>2]=2147483647;c[K+60>>2]=2147483647;c[K+64>>2]=2147483647;c[K+68>>2]=2147483647;c[K+72>>2]=2147483647;c[K+76>>2]=2147483647;c[K+80>>2]=2147483647;c[K+84>>2]=2147483647;c[K+88>>2]=2147483647;c[K+92>>2]=2147483647;c[K+96>>2]=2147483647;c[K+100>>2]=2147483647;c[K+104>>2]=2147483647;c[K+108>>2]=2147483647;c[K+112>>2]=2147483647;c[K+116>>2]=2147483647;c[K+120>>2]=2147483647;c[K+124>>2]=2147483647;c[K+128>>2]=2147483647;c[K+132>>2]=2147483647;c[K+136>>2]=2147483647;c[K+140>>2]=2147483647;c[K+144>>2]=2147483647;c[K+148>>2]=2147483647;c[K+152>>2]=2147483647;c[K+156>>2]=2147483647;c[K+160>>2]=2147483647;c[K+164>>2]=2147483647;c[K+168>>2]=2147483647;c[K+172>>2]=2147483647;c[K+176>>2]=2147483647;c[K+180>>2]=2147483647;c[K+184>>2]=2147483647;c[K+188>>2]=2147483647;c[K+192>>2]=2147483647;c[K+196>>2]=2147483647;c[K+200>>2]=2147483647;c[K+204>>2]=2147483647;c[K+208>>2]=2147483647;c[K+212>>2]=2147483647;c[K+216>>2]=2147483647;c[K+220>>2]=2147483647;c[K+224>>2]=2147483647;c[K+228>>2]=2147483647;c[K+232>>2]=2147483647;c[K+236>>2]=2147483647;c[K+240>>2]=2147483647;c[K+244>>2]=2147483647;c[K+248>>2]=2147483647;c[K+252>>2]=2147483647;c[K+256>>2]=2147483647;c[K+260>>2]=2147483647;c[K+264>>2]=2147483647;c[K+268>>2]=2147483647;c[K+272>>2]=2147483647;c[K+276>>2]=2147483647;c[K+280>>2]=2147483647;c[K+284>>2]=2147483647;c[K+288>>2]=2147483647;c[K+292>>2]=2147483647;c[K+296>>2]=2147483647;c[K+300>>2]=2147483647;c[K+304>>2]=2147483647;c[K+308>>2]=2147483647;c[K+312>>2]=2147483647;c[K+316>>2]=2147483647;c[K+320>>2]=2147483647;c[K+324>>2]=2147483647;c[K+328>>2]=2147483647;c[K+332>>2]=2147483647;c[K+336>>2]=2147483647;c[K+340>>2]=2147483647;c[K+344>>2]=2147483647;c[K+348>>2]=2147483647;c[K+352>>2]=2147483647;c[K+356>>2]=2147483647;c[K+360>>2]=2147483647;c[K+364>>2]=2147483647;c[K+368>>2]=2147483647;c[K+372>>2]=2147483647;c[K+376>>2]=2147483647;c[K+380>>2]=2147483647;c[K+384>>2]=2147483647;c[K+388>>2]=2147483647;c[K+392>>2]=2147483647;c[K+396>>2]=2147483647;c[K+400>>2]=2147483647;c[K+404>>2]=2147483647;c[K+408>>2]=2147483647;c[K+412>>2]=2147483647;c[K+416>>2]=2147483647;c[K+420>>2]=2147483647;c[K+424>>2]=2147483647;c[K+428>>2]=2147483647;c[K+432>>2]=2147483647;c[K+436>>2]=2147483647;c[K+440>>2]=2147483647;c[K+444>>2]=2147483647;c[K+448>>2]=2147483647;c[K+452>>2]=2147483647;c[K+456>>2]=2147483647;c[K+460>>2]=2147483647;c[K+464>>2]=2147483647;c[K+468>>2]=2147483647;c[K+472>>2]=2147483647;c[K+476>>2]=2147483647;c[K+480>>2]=2147483647;c[K+484>>2]=2147483647;c[K+488>>2]=2147483647;c[K+492>>2]=2147483647;c[K+496>>2]=2147483647;c[K+500>>2]=2147483647;c[K+504>>2]=2147483647;c[K+508>>2]=2147483647;if((j|0)>0){v=e+136|0;u=0;do{w=a[L+u>>0]|0;r=w&255;x=c[v>>2]|0;q=H-(d[(c[x>>2]|0)+r>>0]|0)|0;s=q<<1;s=B(s,s)|0;G=I-(d[(c[x+4>>2]|0)+r>>0]|0)|0;z=G*3|0;s=(B(z,z)|0)+s|0;r=J-(d[(c[x+8>>2]|0)+r>>0]|0)|0;G=G*72|0;x=G+144|0;z=r<<4;e=z+64|0;y=z+192|0;z=z+320|0;A=G+432|0;C=G+720|0;D=G+1008|0;E=G+1296|0;F=G+1584|0;G=G+1872|0;p=3;q=(q<<6)+256|0;r=s+(B(r,r)|0)|0;s=i;t=K;while(1){n=t+16|0;if((r|0)<(c[t>>2]|0)){c[t>>2]=r;a[s>>0]=w}k=r+e|0;l=t+4|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+1>>0]=w}k=k+y|0;l=t+8|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+2>>0]=w}k=k+z|0;l=t+12|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+3>>0]=w}m=x+r|0;o=t+32|0;if((m|0)<(c[n>>2]|0)){c[n>>2]=m;a[s+4>>0]=w}k=m+e|0;l=t+20|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+5>>0]=w}k=k+y|0;l=t+24|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+6>>0]=w}k=k+z|0;l=t+28|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+7>>0]=w}m=A+m|0;n=t+48|0;if((m|0)<(c[o>>2]|0)){c[o>>2]=m;a[s+8>>0]=w}k=m+e|0;l=t+36|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+9>>0]=w}k=k+y|0;l=t+40|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+10>>0]=w}k=k+z|0;l=t+44|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+11>>0]=w}m=C+m|0;o=t+64|0;if((m|0)<(c[n>>2]|0)){c[n>>2]=m;a[s+12>>0]=w}k=m+e|0;l=t+52|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+13>>0]=w}k=k+y|0;l=t+56|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+14>>0]=w}k=k+z|0;l=t+60|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+15>>0]=w}m=D+m|0;n=t+80|0;if((m|0)<(c[o>>2]|0)){c[o>>2]=m;a[s+16>>0]=w}k=m+e|0;l=t+68|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+17>>0]=w}k=k+y|0;l=t+72|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+18>>0]=w}k=k+z|0;l=t+76|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+19>>0]=w}m=E+m|0;o=t+96|0;if((m|0)<(c[n>>2]|0)){c[n>>2]=m;a[s+20>>0]=w}k=m+e|0;l=t+84|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+21>>0]=w}k=k+y|0;l=t+88|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+22>>0]=w}k=k+z|0;l=t+92|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+23>>0]=w}m=F+m|0;n=t+112|0;if((m|0)<(c[o>>2]|0)){c[o>>2]=m;a[s+24>>0]=w}k=m+e|0;l=t+100|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+25>>0]=w}k=k+y|0;l=t+104|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+26>>0]=w}k=k+z|0;l=t+108|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+27>>0]=w}k=G+m|0;if((k|0)<(c[n>>2]|0)){c[n>>2]=k;a[s+28>>0]=w}k=k+e|0;l=t+116|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+29>>0]=w}k=k+y|0;l=t+120|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+30>>0]=w}k=k+z|0;l=t+124|0;if((k|0)<(c[l>>2]|0)){c[l>>2]=k;a[s+31>>0]=w}r=r+q|0;if(!p)break;else{p=p+-1|0;q=q+512|0;s=s+32|0;t=t+128|0}}u=u+1|0}while((u|0)!=(j|0))}s=f&-4;t=g&-8;l=h&-4;m=t|1;n=t|2;o=t|3;p=t|4;q=t|5;r=t|6;k=g|7;j=0;while(1){g=M+(j+s<<2)|0;h=c[g>>2]|0;L=h+(t<<6)+(l<<1)|0;b[L>>1]=(d[i>>0]|0)+1;b[L+2>>1]=(d[i+1>>0]|0)+1;b[L+4>>1]=(d[i+2>>0]|0)+1;b[L+6>>1]=(d[i+3>>0]|0)+1;L=h+(m<<6)+(l<<1)|0;b[L>>1]=(d[i+4>>0]|0)+1;b[L+2>>1]=(d[i+5>>0]|0)+1;b[L+4>>1]=(d[i+6>>0]|0)+1;b[L+6>>1]=(d[i+7>>0]|0)+1;L=h+(n<<6)+(l<<1)|0;b[L>>1]=(d[i+8>>0]|0)+1;b[L+2>>1]=(d[i+9>>0]|0)+1;b[L+4>>1]=(d[i+10>>0]|0)+1;b[L+6>>1]=(d[i+11>>0]|0)+1;h=h+(o<<6)+(l<<1)|0;b[h>>1]=(d[i+12>>0]|0)+1;b[h+2>>1]=(d[i+13>>0]|0)+1;b[h+4>>1]=(d[i+14>>0]|0)+1;b[h+6>>1]=(d[i+15>>0]|0)+1;g=c[g>>2]|0;h=g+(p<<6)+(l<<1)|0;b[h>>1]=(d[i+16>>0]|0)+1;b[h+2>>1]=(d[i+17>>0]|0)+1;b[h+4>>1]=(d[i+18>>0]|0)+1;b[h+6>>1]=(d[i+19>>0]|0)+1;h=g+(q<<6)+(l<<1)|0;b[h>>1]=(d[i+20>>0]|0)+1;b[h+2>>1]=(d[i+21>>0]|0)+1;b[h+4>>1]=(d[i+22>>0]|0)+1;b[h+6>>1]=(d[i+23>>0]|0)+1;h=g+(r<<6)+(l<<1)|0;b[h>>1]=(d[i+24>>0]|0)+1;b[h+2>>1]=(d[i+25>>0]|0)+1;b[h+4>>1]=(d[i+26>>0]|0)+1;b[h+6>>1]=(d[i+27>>0]|0)+1;g=g+(k<<6)+(l<<1)|0;b[g>>1]=(d[i+28>>0]|0)+1;b[g+2>>1]=(d[i+29>>0]|0)+1;b[g+4>>1]=(d[i+30>>0]|0)+1;b[g+6>>1]=(d[i+31>>0]|0)+1;j=j+1|0;if((j|0)==4)break;else i=i+32|0}yb=N;return}function Wv(a,d){a=a|0;d=d|0;var 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;t=c[(c[a+484>>2]|0)+24>>2]|0;h=c[d>>2]|0;j=d+4|0;l=c[j>>2]|0;o=d+8|0;n=c[o>>2]|0;p=d+12|0;m=c[p>>2]|0;q=d+16|0;k=c[q>>2]|0;r=d+20|0;s=c[r>>2]|0;a:do if((l|0)<=(h|0)|(n|0)>(m|0)|(k|0)>(s|0))i=h;else{i=h;b:while(1){g=c[t+(i<<2)>>2]|0;e=n;while(1){a=g+(e<<6)+(k<<1)|0;f=k;while(1){if(b[a>>1]|0)break b;if((f|0)<(s|0)){a=a+2|0;f=f+1|0}else break}if((e|0)<(m|0))e=e+1|0;else break}if((i|0)<(l|0))i=i+1|0;else{i=h;break a}}c[d>>2]=i}while(0);c:do if(!((l|0)<=(i|0)|(n|0)>(m|0)|(k|0)>(s|0))){e=l;d:while(1){h=c[t+(e<<2)>>2]|0;f=n;while(1){a=h+(f<<6)+(k<<1)|0;g=k;while(1){if(b[a>>1]|0)break d;if((g|0)<(s|0)){a=a+2|0;g=g+1|0}else break}if((f|0)<(m|0))f=f+1|0;else break}if((e|0)>(i|0))e=e+-1|0;else break c}c[j>>2]=e;l=e}while(0);e:do if(!((m|0)<=(n|0)|(l|0)<(i|0)|(k|0)>(s|0))){f=n;f:while(1){e=i;while(1){a=(c[t+(e<<2)>>2]|0)+(f<<6)+(k<<1)|0;g=k;while(1){if(b[a>>1]|0)break f;if((g|0)<(s|0)){a=a+2|0;g=g+1|0}else break}if((e|0)<(l|0))e=e+1|0;else break}if((f|0)<(m|0))f=f+1|0;else break e}c[o>>2]=f;n=f}while(0);g:do if(!((m|0)<=(n|0)|(l|0)<(i|0)|(k|0)>(s|0))){f=m;h:while(1){e=i;while(1){a=(c[t+(e<<2)>>2]|0)+(f<<6)+(k<<1)|0;g=k;while(1){if(b[a>>1]|0)break h;if((g|0)<(s|0)){a=a+2|0;g=g+1|0}else break}if((e|0)<(l|0))e=e+1|0;else break}if((f|0)>(n|0))f=f+-1|0;else break g}c[p>>2]=f;m=f}while(0);i:do if(!((s|0)<=(k|0)|(l|0)<(i|0)|(m|0)<(n|0))){f=k;j:while(1){a=i;while(1){e=n;g=(c[t+(a<<2)>>2]|0)+(n<<6)+(f<<1)|0;while(1){if(b[g>>1]|0)break j;if((e|0)<(m|0)){e=e+1|0;g=g+64|0}else break}if((a|0)<(l|0))a=a+1|0;else break}if((f|0)<(s|0))f=f+1|0;else break i}c[q>>2]=f;k=f}while(0);k:do if((s|0)<=(k|0)|(l|0)<(i|0)|(m|0)<(n|0))f=s;else{f=s;l:while(1){a=i;while(1){e=n;g=(c[t+(a<<2)>>2]|0)+(n<<6)+(f<<1)|0;while(1){if(b[g>>1]|0)break l;if((e|0)<(m|0)){e=e+1|0;g=g+64|0}else break}if((a|0)<(l|0))a=a+1|0;else break}if((f|0)>(k|0))f=f+-1|0;else{f=s;break k}}c[r>>2]=f}while(0);r=l-i<<4;q=(m-n|0)*12|0;s=f-k<<3;c[d+24>>2]=(B(q,q)|0)+(B(r,r)|0)+(B(s,s)|0);if((l|0)<(i|0)|(m|0)<(n|0)|(f|0)<(k|0)){t=0;d=d+28|0;c[d>>2]=t;return}a=0;while(1){j=c[t+(i<<2)>>2]|0;h=n;while(1){e=k;g=j+(h<<6)+(k<<1)|0;while(1){a=a+((b[g>>1]|0)!=0&1)|0;if((e|0)>=(f|0))break;else{e=e+1|0;g=g+2|0}}if((h|0)<(m|0))h=h+1|0;else break}if((i|0)<(l|0))i=i+1|0;else break}d=d+28|0;c[d>>2]=a;return}function Xv(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;b=a+484|0;j=c[b>>2]|0;c[a+136>>2]=c[j+16>>2];c[a+132>>2]=c[j+20>>2];switch(c[a+88>>2]|0){case 0:{b=j+4|0;if((c[a+120>>2]|0)==3){c[b>>2]=22;return}else{c[b>>2]=23;return}}case 1:{l=a+120|0;c[j+4>>2]=(c[l>>2]|0)==3?24:25;c[j+48>>2]=0;if(!(c[j+28>>2]|0))_v(a);if(c[j+52>>2]|0)return;j=c[b>>2]|0;b=c[l>>2]|0;if((b|0)<=0)return;k=a+4|0;i=0;do{f=c[j+32+(i<<2)>>2]|0;a:do if(i){e=0;while(1){if((f|0)==(c[j+32+(e<<2)>>2]|0))break;e=e+1|0;if(e>>>0>=i>>>0){m=15;break a}}e=c[j+52+(e<<2)>>2]|0;if(!e)m=15}else m=15;while(0);if((m|0)==15){m=0;e=Hb[c[c[k>>2]>>2]&63](a,1,1024)|0;h=(f<<9)+-512|0;g=0;do{f=0;do{n=255-((d[5440+(g<<4)+f>>0]|0)<<1)|0;b=n*255|0;if((n|0)<0)b=0-((0-b|0)/(h|0)|0)|0;else b=(b|0)/(h|0)|0;c[e+(g<<6)+(f<<2)>>2]=b;f=f+1|0}while((f|0)!=16);g=g+1|0}while((g|0)!=16);b=c[l>>2]|0}c[j+52+(i<<2)>>2]=e;i=i+1|0}while((i|0)<(b|0));return}case 2:{c[j+4>>2]=26;c[j+84>>2]=0;if(!(c[j+68>>2]|0)){b=a+112|0;g=(c[b>>2]<<1)+4|0;h=a+120|0;if((c[h>>2]|0)<=0)return;i=a+4|0;e=0;do{c[j+68+(e<<2)>>2]=Hb[c[(c[i>>2]|0)+4>>2]&63](a,1,g)|0;e=e+1|0;f=c[h>>2]|0}while((e|0)<(f|0))}else{f=a+120|0;h=f;b=a+112|0;f=c[f>>2]|0}e=(c[b>>2]<<1)+4|0;if((f|0)<=0)return;b=0;do{_O(c[j+68+(b<<2)>>2]|0,0,e|0)|0;b=b+1|0}while((b|0)<(c[h>>2]|0));return}default:{n=c[a>>2]|0;c[n+20>>2]=49;Qb[c[n>>2]&255](a);return}}}function Yv(a){a=a|0;return}function Zv(a){a=a|0;var b=0;b=c[a>>2]|0;c[b+20>>2]=47;Qb[c[b>>2]&255](a);return}function _v(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;m=c[b+484>>2]|0;d=(c[b+88>>2]|0)==1;c[m+28>>2]=d&1;l=b+120|0;e=Ib[c[(c[b+4>>2]|0)+8>>2]&15](b,1,d?766:256,c[l>>2]|0)|0;k=m+24|0;c[k>>2]=e;b=c[m+20>>2]|0;if((c[l>>2]|0)<=0)return;if(!d){d=0;while(1){f=c[m+32+(d<<2)>>2]|0;b=(b|0)/(f|0)|0;h=c[e+(d<<2)>>2]|0;i=f+-1|0;j=i<<1;e=0;f=(f+254|0)/(j|0)|0;g=0;do{if((g|0)>(f|0))do{e=e+1|0;f=(((e<<1|1)*255|0)+i|0)/(j|0)|0}while((g|0)>(f|0));a[h+g>>0]=B(e,b)|0;g=g+1|0}while((g|0)!=256);d=d+1|0;if((d|0)>=(c[l>>2]|0))break;e=c[k>>2]|0}return}d=0;while(1){f=c[m+32+(d<<2)>>2]|0;b=(b|0)/(f|0)|0;j=e+(d<<2)|0;c[j>>2]=(c[j>>2]|0)+255;j=c[(c[k>>2]|0)+(d<<2)>>2]|0;h=f+-1|0;i=h<<1;e=0;f=(f+254|0)/(i|0)|0;g=0;do{if((g|0)>(f|0))do{e=e+1|0;f=(((e<<1|1)*255|0)+h|0)/(i|0)|0}while((g|0)>(f|0));a[j+g>>0]=B(e,b)|0;g=g+1|0}while((g|0)!=256);f=j+255|0;e=1;do{a[j+(0-e)>>0]=a[j>>0]|0;a[j+(e+255)>>0]=a[f>>0]|0;e=e+1|0}while((e|0)!=256);d=d+1|0;if((d|0)>=(c[l>>2]|0))break;e=c[k>>2]|0}return}function $v(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;m=c[(c[b+484>>2]|0)+24>>2]|0;n=c[m>>2]|0;l=c[m+4>>2]|0;m=c[m+8>>2]|0;k=c[b+112>>2]|0;if((g|0)<1|(k|0)==0)return;h=0;do{b=k;i=c[f+(h<<2)>>2]|0;j=c[e+(h<<2)>>2]|0;while(1){a[i>>0]=(d[l+(d[j+1>>0]|0)>>0]|0)+(d[n+(d[j>>0]|0)>>0]|0)+(d[m+(d[j+2>>0]|0)>>0]|0);b=b+-1|0;if(!b)break;else{i=i+1|0;j=j+3|0}}h=h+1|0}while((h|0)!=(g|0));return}function aw(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;o=c[(c[b+484>>2]|0)+24>>2]|0;p=c[b+112>>2]|0;n=c[b+120>>2]|0;if((g|0)<1|(p|0)==0)return;if((n|0)<=0){b=0;do{_O(c[f+(b<<2)>>2]|0,0,p|0)|0;b=b+1|0}while((b|0)!=(g|0));return}i=0;do{h=p;j=c[f+(i<<2)>>2]|0;k=c[e+(i<<2)>>2]|0;while(1){b=0;l=0;m=k;while(1){l=l+(d[(c[o+(b<<2)>>2]|0)+(d[m>>0]|0)>>0]|0)|0;b=b+1|0;if((b|0)==(n|0))break;else m=m+1|0}a[j>>0]=l;h=h+-1|0;if(!h)break;else{j=j+1|0;k=k+n|0}}i=i+1|0}while((i|0)!=(g|0));return}function bw(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var 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;h=c[b+484>>2]|0;u=c[h+24>>2]|0;v=c[u>>2]|0;t=c[u+4>>2]|0;u=c[u+8>>2]|0;q=c[b+112>>2]|0;if((g|0)<=0)return;w=h+48|0;r=h+52|0;s=h+56|0;p=h+60|0;b=c[w>>2]|0;if(!q){h=0;do{b=b+1&15;h=h+1|0}while((h|0)!=(g|0));c[w>>2]=b;return}o=0;do{l=c[r>>2]|0;m=c[s>>2]|0;n=c[p>>2]|0;h=q;i=0;j=c[f+(o<<2)>>2]|0;k=c[e+(o<<2)>>2]|0;while(1){a[j>>0]=(d[t+((c[m+(b<<6)+(i<<2)>>2]|0)+(d[k+1>>0]|0))>>0]|0)+(d[v+((c[l+(b<<6)+(i<<2)>>2]|0)+(d[k>>0]|0))>>0]|0)+(d[u+((c[n+(b<<6)+(i<<2)>>2]|0)+(d[k+2>>0]|0))>>0]|0);h=h+-1|0;if(!h)break;else{i=i+1&15;j=j+1|0;k=k+3|0}}b=b+1&15;c[w>>2]=b;o=o+1|0}while((o|0)!=(g|0));return}function cw(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var 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;u=c[b+484>>2]|0;v=c[b+120>>2]|0;w=c[b+112>>2]|0;if((g|0)<=0)return;t=u+48|0;m=u+24|0;n=(w|0)==0;if((v|0)<=0){b=0;do{_O(c[f+(b<<2)>>2]|0,0,w|0)|0;c[t>>2]=(c[t>>2]|0)+1&15;b=b+1|0}while((b|0)!=(g|0));return}h=0;do{o=f+(h<<2)|0;_O(c[o>>2]|0,0,w|0)|0;p=c[t>>2]|0;q=e+(h<<2)|0;if(!n){i=0;do{r=c[(c[m>>2]|0)+(i<<2)>>2]|0;s=c[u+52+(i<<2)>>2]|0;b=w;j=c[o>>2]|0;k=0;l=(c[q>>2]|0)+i|0;while(1){a[j>>0]=(d[j>>0]|0)+(d[r+((c[s+(p<<6)+(k<<2)>>2]|0)+(d[l>>0]|0))>>0]|0);b=b+-1|0;if(!b)break;else{j=j+1|0;k=k+1&15;l=l+v|0}}i=i+1|0}while((i|0)!=(v|0))}c[t>>2]=p+1&15;h=h+1|0}while((h|0)!=(g|0));return}function dw(e,f,g,h){e=e|0;f=f|0;g=g|0;h=h|0;var 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,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;J=c[e+484>>2]|0;K=c[e+120>>2]|0;L=c[e+112>>2]|0;y=c[e+336>>2]|0;if((h|0)<=0)return;z=(K|0)>0;A=J+84|0;C=J+24|0;D=J+16|0;E=(L|0)==0;F=L+-1|0;G=B(F,K)|0;H=0-K|0;I=L+1|0;x=0;do{v=g+(x<<2)|0;_O(c[v>>2]|0,0,L|0)|0;a:do if(z){w=f+(x<<2)|0;if(E){i=(c[A>>2]|0)==0;e=0;while(1){w=c[J+68+(e<<2)>>2]|0;b[(i?w:w+(I<<1)|0)>>1]=0;e=e+1|0;if((e|0)==(K|0))break a}}r=0;do{e=(c[w>>2]|0)+r|0;i=c[v>>2]|0;if(!(c[A>>2]|0)){s=K;t=1;u=c[J+68+(r<<2)>>2]|0}else{s=H;t=-1;u=(c[J+68+(r<<2)>>2]|0)+(I<<1)|0;e=e+G|0;i=i+F|0}o=c[(c[C>>2]|0)+(r<<2)>>2]|0;p=c[(c[D>>2]|0)+(r<<2)>>2]|0;q=B(L,t)|0;l=0;m=L;n=0;j=0;k=u;while(1){M=k;k=k+(t<<1)|0;N=d[y+((j+8+(b[k>>1]|0)>>4)+(d[e>>0]|0))>>0]|0;j=d[o+N>>0]|0;a[i>>0]=(d[i>>0]|0)+j;j=N-(d[p+j>>0]|0)|0;b[M>>1]=(j*3|0)+n;n=(j*5|0)+l|0;m=m+-1|0;if(!m)break;else{l=j;j=j*7|0;e=e+s|0;i=i+t|0}}b[u+(q<<1)>>1]=n;r=r+1|0}while((r|0)!=(K|0))}while(0);c[A>>2]=(c[A>>2]|0)==0&1;x=x+1|0}while((x|0)!=(h|0));return}function ew(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;g=a+428|0;d=c[g>>2]|0;e=B(d,c[a+48>>2]|0)|0;f=c[a+52>>2]|0;do if(e>>>0>f>>>0){if(e>>>0<=f<<1>>>0){c[a+112>>2]=fw(c[a+28>>2]<<1,d)|0;f=2;b=c[a+32>>2]<<1;break}if(e>>>0<=(f*3|0)>>>0){c[a+112>>2]=fw((c[a+28>>2]|0)*3|0,d)|0;f=3;b=(c[a+32>>2]|0)*3|0;break}if(e>>>0<=f<<2>>>0){c[a+112>>2]=fw(c[a+28>>2]<<2,d)|0;f=4;b=c[a+32>>2]<<2;break}if(e>>>0<=(f*5|0)>>>0){c[a+112>>2]=fw((c[a+28>>2]|0)*5|0,d)|0;f=5;b=(c[a+32>>2]|0)*5|0;break}if(e>>>0<=(f*6|0)>>>0){c[a+112>>2]=fw((c[a+28>>2]|0)*6|0,d)|0;f=6;b=(c[a+32>>2]|0)*6|0;break}if(e>>>0<=(f*7|0)>>>0){c[a+112>>2]=fw((c[a+28>>2]|0)*7|0,d)|0;f=7;b=(c[a+32>>2]|0)*7|0;break}if(e>>>0<=f<<3>>>0){c[a+112>>2]=fw(c[a+28>>2]<<3,d)|0;f=8;b=c[a+32>>2]<<3;break}if(e>>>0<=(f*9|0)>>>0){c[a+112>>2]=fw((c[a+28>>2]|0)*9|0,d)|0;f=9;b=(c[a+32>>2]|0)*9|0;break}if(e>>>0<=(f*10|0)>>>0){c[a+112>>2]=fw((c[a+28>>2]|0)*10|0,d)|0;f=10;b=(c[a+32>>2]|0)*10|0;break}if(e>>>0<=(f*11|0)>>>0){c[a+112>>2]=fw((c[a+28>>2]|0)*11|0,d)|0;f=11;b=(c[a+32>>2]|0)*11|0;break}if(e>>>0<=(f*12|0)>>>0){c[a+112>>2]=fw((c[a+28>>2]|0)*12|0,d)|0;f=12;b=(c[a+32>>2]|0)*12|0;break}if(e>>>0<=(f*13|0)>>>0){c[a+112>>2]=fw((c[a+28>>2]|0)*13|0,d)|0;f=13;b=(c[a+32>>2]|0)*13|0;break}if(e>>>0<=(f*14|0)>>>0){c[a+112>>2]=fw((c[a+28>>2]|0)*14|0,d)|0;f=14;b=(c[a+32>>2]|0)*14|0;break}b=c[a+28>>2]|0;if(e>>>0>(f*15|0)>>>0){c[a+112>>2]=fw(b<<4,d)|0;f=16;b=c[a+32>>2]<<4;break}else{c[a+112>>2]=fw(b*15|0,d)|0;f=15;b=(c[a+32>>2]|0)*15|0;break}}else{c[a+112>>2]=fw(c[a+28>>2]|0,d)|0;f=1;b=c[a+32>>2]|0}while(0);c[a+116>>2]=fw(b,c[g>>2]|0)|0;c[a+324>>2]=f;c[a+328>>2]=f;e=c[a+36>>2]|0;if((e|0)<=0)return;d=0;b=c[a+216>>2]|0;while(1){c[b+36>>2]=f;c[b+40>>2]=f;d=d+1|0;if((d|0)>=(e|0))break;else b=b+88|0}return}function fw(a,b){a=a|0;b=b|0;return (a+-1+b|0)/(b|0)|0|0}function gw(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=yb;yb=yb+16|0;i=j;e=c[a+20>>2]|0;if((e|0)!=205){h=c[a>>2]|0;c[h+20>>2]=21;c[h+24>>2]=e;Qb[c[c[a>>2]>>2]&255](a)}e=a+140|0;f=c[e>>2]|0;g=c[a+116>>2]|0;if(f>>>0>=g>>>0){i=c[a>>2]|0;c[i+20>>2]=126;Sb[c[i+4>>2]&63](a,-1);i=0;yb=j;return i|0}h=c[a+8>>2]|0;if(h|0){c[h+4>>2]=f;c[h+8>>2]=g;Qb[c[h>>2]&255](a)}c[i>>2]=0;Vb[c[(c[a+448>>2]|0)+4>>2]&31](a,b,i,d);i=c[i>>2]|0;c[e>>2]=(c[e>>2]|0)+i;yb=j;return i|0}function hw(a){a=a|0;a=Hb[c[c[a+4>>2]>>2]&63](a,0,280)|0;c[a+276>>2]=0;return a|0}function iw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=a+24|0;d=c[e>>2]|0;if(!d){f=a+4|0;d=Hb[c[c[f>>2]>>2]&63](a,0,40)|0;c[e>>2]=d;c[d+32>>2]=Hb[c[c[f>>2]>>2]&63](a,0,4096)|0;d=c[e>>2]|0}c[d+8>>2]=132;c[d+12>>2]=85;c[d+16>>2]=51;c[d+20>>2]=47;c[d+24>>2]=133;c[d+28>>2]=b;c[d+4>>2]=0;c[d>>2]=0;return}function jw(a){a=a|0;c[(c[a+24>>2]|0)+36>>2]=1;return}function kw(b){b=b|0;var d=0,e=0,f=0,g=0;e=c[b+24>>2]|0;f=e+32|0;d=eA(c[f>>2]|0,1,4096,c[e+28>>2]|0)|0;g=e+36|0;if(d|0){b=d;f=c[f>>2]|0;c[e>>2]=f;f=e+4|0;c[f>>2]=b;c[g>>2]=0;return 1}if(!(c[g>>2]|0))d=b;else{d=c[b>>2]|0;c[d+20>>2]=43;Qb[c[d>>2]&255](b);d=b}b=c[b>>2]|0;c[b+20>>2]=123;Sb[c[b+4>>2]&63](d,-1);a[c[f>>2]>>0]=-1;a[(c[f>>2]|0)+1>>0]=-39;b=2;f=c[f>>2]|0;c[e>>2]=f;f=e+4|0;c[f>>2]=b;c[g>>2]=0;return 1}function lw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;f=c[a+24>>2]|0;if((b|0)<=0)return;g=f+4|0;d=c[g>>2]|0;if((d|0)<(b|0)){e=f+12|0;do{b=b-d|0;Eb[c[e>>2]&127](a)|0;d=c[g>>2]|0}while((b|0)>(d|0))}c[f>>2]=(c[f>>2]|0)+b;c[g>>2]=d-b;return}function mw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;k=a+440|0;g=c[k>>2]|0;h=c[a>>2]|0;c[h+20>>2]=124;c[h+24>>2]=g;c[(c[a>>2]|0)+28>>2]=b;Sb[c[(c[a>>2]|0)+4>>2]&63](a,-1);h=b+1&7|208;i=b+2&7|208;j=b+7&7|208;d=b+6&7|208;b=g;a:while(1){e=(b|0)<192;f=(b&-8|0)!=208|(b|0)==(h|0)|(b|0)==(i|0);g=(b|0)==(j|0)|(b|0)==(d|0)?2:1;b:while(1){l=e?2:f?3:g;m=c[a>>2]|0;c[m+20>>2]=99;c[m+24>>2]=b;c[(c[a>>2]|0)+28>>2]=l;Sb[c[(c[a>>2]|0)+4>>2]&63](a,4);switch(l&3){case 1:{d=4;break a}case 3:{b=1;d=7;break a}case 2:break b;default:{}}}if(!(ow(a)|0)){b=0;d=7;break}b=c[k>>2]|0}if((d|0)==4){c[k>>2]=0;m=1;return m|0}else if((d|0)==7)return b|0;return 0}function nw(a){a=a|0;return}function ow(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;j=c[b+24>>2]|0;k=j+4|0;i=j+12|0;l=b+464|0;d=c[k>>2]|0;e=c[j>>2]|0;a:while(1){if(!d){if(!(Eb[c[i>>2]&127](b)|0)){d=0;f=21;break}d=c[k>>2]|0;e=c[j>>2]|0}d=d+-1|0;f=e+1|0;if((a[e>>0]|0)==-1)e=f;else{e=f;do{h=(c[l>>2]|0)+24|0;c[h>>2]=(c[h>>2]|0)+1;c[j>>2]=e;c[k>>2]=d;if(!d){if(!(Eb[c[i>>2]&127](b)|0)){d=0;f=21;break a}d=c[k>>2]|0;f=c[j>>2]|0}else f=e;d=d+-1|0;e=f+1|0}while((a[f>>0]|0)!=-1)}do{if(!d){if(!(Eb[c[i>>2]&127](b)|0)){d=0;f=21;break a}d=c[k>>2]|0;f=c[j>>2]|0}else f=e;d=d+-1|0;e=f+1|0;g=a[f>>0]|0}while(g<<24>>24==-1);f=(c[l>>2]|0)+24|0;h=c[f>>2]|0;if(g<<24>>24){f=18;break}c[f>>2]=h+2;c[j>>2]=e;c[k>>2]=d}if((f|0)==18){f=g&255;if(h|0){i=c[b>>2]|0;c[i+20>>2]=119;c[i+24>>2]=h;c[(c[b>>2]|0)+28>>2]=f;Sb[c[(c[b>>2]|0)+4>>2]&63](b,-1);c[(c[l>>2]|0)+24>>2]=0}c[b+440>>2]=f;c[j>>2]=e;c[k>>2]=d;l=1;return l|0}else if((f|0)==21)return d|0;return 0}function pw(a){a=a|0;var b=0,d=0;d=Hb[c[c[a+4>>2]>>2]&63](a,0,172)|0;b=a+464|0;c[b>>2]=d;c[d>>2]=134;c[d+4>>2]=86;c[d+8>>2]=87;c[d+28>>2]=88;c[d+96>>2]=0;c[d+100>>2]=0;c[d+36>>2]=88;c[d+104>>2]=0;c[d+40>>2]=88;c[d+108>>2]=0;c[d+44>>2]=88;c[d+112>>2]=0;c[d+48>>2]=88;c[d+116>>2]=0;c[d+52>>2]=88;c[d+120>>2]=0;c[d+56>>2]=88;c[d+124>>2]=0;c[d+60>>2]=88;c[d+128>>2]=0;c[d+64>>2]=88;c[d+132>>2]=0;c[d+68>>2]=88;c[d+136>>2]=0;c[d+72>>2]=88;c[d+140>>2]=0;c[d+76>>2]=88;c[d+144>>2]=0;c[d+80>>2]=88;c[d+148>>2]=0;c[d+84>>2]=88;c[d+152>>2]=0;c[d+156>>2]=0;c[d+92>>2]=88;c[d+160>>2]=0;c[d+32>>2]=89;c[d+88>>2]=89;b=c[b>>2]|0;c[a+216>>2]=0;c[a+144>>2]=0;c[a+440>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+24>>2]=0;c[b+164>>2]=0;return}function qw(a){a=a|0;var b=0;b=c[a+464>>2]|0;c[a+216>>2]=0;c[a+144>>2]=0;c[a+440>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+24>>2]=0;c[b+164>>2]=0;return} +function lL(b,d,e,f,g,h,i,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0;p=yb;yb=yb+16|0;o=p;k=e;while(1){if((k|0)==(f|0)){k=f;break}if(!(a[k>>0]|0))break;k=k+1|0}c[j>>2]=h;c[g>>2]=e;m=i;n=b+8|0;while(1){if((h|0)==(i|0)|(e|0)==(f|0)){b=33;break}q=d;l=c[q+4>>2]|0;b=o;c[b>>2]=c[q>>2];c[b+4>>2]=l;b=cz(c[n>>2]|0)|0;l=Pz(h,g,k-e|0,m-h>>2,d)|0;if(b|0)cz(b)|0;if((l|0)==-1){b=10;break}h=(c[j>>2]|0)+(l<<2)|0;c[j>>2]=h;if((h|0)==(i|0)){b=30;break}e=c[g>>2]|0;if((k|0)==(f|0))k=f;else{k=cz(c[n>>2]|0)|0;e=Vy(h,e,1,d)|0;if(k|0)cz(k)|0;if(e|0){e=2;b=29;break}c[j>>2]=(c[j>>2]|0)+4;e=(c[g>>2]|0)+1|0;c[g>>2]=e;k=e;while(1){if((k|0)==(f|0)){k=f;break}if(!(a[k>>0]|0))break;k=k+1|0}h=c[j>>2]|0}}do if((b|0)==10){a:while(1){c[j>>2]=h;if((e|0)==(c[g>>2]|0)){b=19;break}b=cz(c[n>>2]|0)|0;h=Vy(h,e,k-e|0,o)|0;if(b|0)cz(b)|0;switch(h|0){case -1:{b=15;break a}case -2:{b=16;break a}case 0:{h=1;break}default:{}}e=e+h|0;h=(c[j>>2]|0)+4|0}if((b|0)==15){c[g>>2]=e;e=2;b=29;break}else if((b|0)==16){c[g>>2]=e;e=1;b=29;break}else if((b|0)==19){c[g>>2]=e;e=(e|0)!=(f|0)&1;b=29;break}}else if((b|0)==30){e=c[g>>2]|0;b=33}while(0);if((b|0)!=29)if((b|0)==33)e=(e|0)!=(f|0)&1;yb=p;return e|0}function mL(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;i=yb;yb=yb+16|0;h=i;c[g>>2]=e;e=cz(c[b+8>>2]|0)|0;b=Yx(h,0,d)|0;if(e|0)cz(e)|0;a:do if((b+1|0)>>>0>=2){b=b+-1|0;if(b>>>0>(f-(c[g>>2]|0)|0)>>>0)b=1;else while(1){if(!b){b=0;break a}d=a[h>>0]|0;f=c[g>>2]|0;c[g>>2]=f+1;a[f>>0]=d;h=h+1|0;b=b+-1|0}}else b=2;while(0);yb=i;return b|0}function nL(a){a=a|0;var b=0,d=0;a=a+8|0;b=cz(c[a>>2]|0)|0;d=nz(0,0,4)|0;if(b|0)cz(b)|0;if(!d){a=c[a>>2]|0;if(!a)a=1;else{b=cz(a)|0;a=fy()|0;if(b|0)cz(b)|0;return (a|0)==1|0}}else a=-1;return a|0}function oL(a){a=a|0;return 0}function pL(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;k=e;j=a+8|0;h=0;i=0;a:while(1){if((d|0)==(e|0)|h>>>0>=f>>>0)break;g=cz(c[j>>2]|0)|0;a=Oz(d,k-d|0,b)|0;if(g|0)cz(g)|0;switch(a|0){case -2:case -1:break a;case 0:{a=1;break}default:{}}h=h+1|0;i=a+i|0;d=d+a|0}return i|0}function qL(a){a=a|0;var b=0;a=c[a+8>>2]|0;if(a){b=cz(a)|0;a=fy()|0;if(b)cz(b)|0}else a=1;return a|0}function rL(a){a=a|0;var b=0,d=0;c[a>>2]=19168;b=a+8|0;d=c[b>>2]|0;if((d|0)!=(YF()|0))Ty(c[b>>2]|0);AF(a);return}function sL(a){a=a|0;rL(a);QA(a);return}function tL(a,b,d,e,f,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0;b=yb;yb=yb+16|0;j=b+4|0;a=b;c[j>>2]=d;c[a>>2]=g;h=CL(d,e,j,g,h,a,1114111,0)|0;c[f>>2]=c[j>>2];c[i>>2]=c[a>>2];yb=b;return h|0}function uL(a,b,d,e,f,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0;b=yb;yb=yb+16|0;j=b+4|0;a=b;c[j>>2]=d;c[a>>2]=g;h=BL(d,e,j,g,h,a,1114111,0)|0;c[f>>2]=c[j>>2];c[i>>2]=c[a>>2];yb=b;return h|0}function vL(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;c[f>>2]=d;return 3}function wL(a){a=a|0;return 0}function xL(a){a=a|0;return 0}function yL(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return AL(c,d,e,1114111,0)|0}function zL(a){a=a|0;return 4}function AL(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=c;if((((g&4|0)!=0?(o-b|0)>2:0)?(a[b>>0]|0)==-17:0)?(a[b+1>>0]|0)==-69:0)g=(a[b+2>>0]|0)==-65?b+3|0:b;else g=b;h=0;a:while(1){if(!(h>>>0>>0&g>>>0>>0))break;l=a[g>>0]|0;n=l&255;if(n>>>0>f>>>0)break;do if(l<<24>>24<=-1){if((l&255)<194)break a;if((l&255)<224){if((o-g|0)<2)break a;i=d[g+1>>0]|0;if((i&192|0)!=128)break a;if((i&63|n<<6&1984)>>>0>f>>>0)break a;else{g=g+2|0;break}}if((l&255)<240){if((o-g|0)<3)break a;j=a[g+1>>0]|0;i=a[g+2>>0]|0;switch(l<<24>>24){case -32:{if((j&-32)<<24>>24!=-96)break a;break}case -19:{if((j&-32)<<24>>24!=-128)break a;break}default:if((j&-64)<<24>>24!=-128)break a}i=i&255;if((i&192|0)!=128)break a;if(((j&63)<<6|n<<12&61440|i&63)>>>0>f>>>0)break a;else{g=g+3|0;break}}if((l&255)>=245)break a;if((e-h|0)>>>0<2|(o-g|0)<4)break a;m=a[g+1>>0]|0;i=a[g+2>>0]|0;k=a[g+3>>0]|0;switch(l<<24>>24){case -16:{if((m+112&255)>=48)break a;break}case -12:{if((m&-16)<<24>>24!=-128)break a;break}default:if((m&-64)<<24>>24!=-128)break a}j=i&255;if((j&192|0)!=128)break a;i=k&255;if((i&192|0)!=128)break a;if(((m&63)<<12|n<<18&1835008|j<<6&4032|i&63)>>>0>f>>>0)break a;else{h=h+1|0;g=g+4|0}}else g=g+1|0;while(0);h=h+1|0}return g-b|0}function BL(e,f,g,h,i,j,k,l){e=e|0;f=f|0;g=g|0;h=h|0;i=i|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;c[g>>2]=e;c[j>>2]=h;if(l&4){e=c[g>>2]|0;h=f;if((((h-e|0)>2?(a[e>>0]|0)==-17:0)?(a[e+1>>0]|0)==-69:0)?(a[e+2>>0]|0)==-65:0)c[g>>2]=e+3}else h=f;s=i;a:while(1){n=c[g>>2]|0;if(n>>>0>=f>>>0){e=0;break}r=c[j>>2]|0;if(r>>>0>=i>>>0){e=1;break}m=a[n>>0]|0;q=m&255;if(q>>>0>k>>>0){e=2;break}do if(m<<24>>24>-1){b[r>>1]=m&255;e=n+1|0}else{if((m&255)<194){e=2;break a}if((m&255)<224){if((h-n|0)<2){e=1;break a}e=d[n+1>>0]|0;if((e&192|0)!=128){e=2;break a}e=e&63|q<<6&1984;if(e>>>0>k>>>0){e=2;break a}b[r>>1]=e;e=n+2|0;break}if((m&255)<240){if((h-n|0)<3){e=1;break a}l=a[n+1>>0]|0;e=a[n+2>>0]|0;switch(m<<24>>24){case -32:{if((l&-32)<<24>>24!=-96){e=2;break a}break}case -19:{if((l&-32)<<24>>24!=-128){e=2;break a}break}default:if((l&-64)<<24>>24!=-128){e=2;break a}}e=e&255;if((e&192|0)!=128){e=2;break a}e=(l&63)<<6|q<<12|e&63;if((e&65535)>>>0>k>>>0){e=2;break a}b[r>>1]=e;e=n+3|0;break}if((m&255)>=245){e=2;break a}if((h-n|0)<4){e=1;break a}o=a[n+1>>0]|0;e=a[n+2>>0]|0;l=a[n+3>>0]|0;switch(m<<24>>24){case -16:{if((o+112&255)>=48){e=2;break a}break}case -12:{if((o&-16)<<24>>24!=-128){e=2;break a}break}default:if((o&-64)<<24>>24!=-128){e=2;break a}}p=e&255;if((p&192|0)!=128){e=2;break a}e=l&255;if((e&192|0)!=128){e=2;break a}if((s-r|0)<4){e=1;break a}n=q&7;l=o&255;m=p<<6;e=e&63;if((l<<12&258048|n<<18|m&4032|e)>>>0>k>>>0){e=2;break a}b[r>>1]=l<<2&60|p>>>4&3|((l>>>4&3|n<<2)<<6)+16320|55296;r=r+2|0;c[j>>2]=r;b[r>>1]=e|m&960|56320;e=(c[g>>2]|0)+4|0}while(0);c[g>>2]=e;c[j>>2]=(c[j>>2]|0)+2}return e|0}function CL(d,f,g,h,i,j,k,l){d=d|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;var m=0,n=0;c[g>>2]=d;c[j>>2]=h;if(l&2)if((i-h|0)<3)d=1;else{c[j>>2]=h+1;a[h>>0]=-17;m=c[j>>2]|0;c[j>>2]=m+1;a[m>>0]=-69;m=c[j>>2]|0;c[j>>2]=m+1;a[m>>0]=-65;m=4}else m=4;a:do if((m|0)==4){n=f;d=c[g>>2]|0;while(1){if(d>>>0>=f>>>0){d=0;break a}h=b[d>>1]|0;m=h&65535;if(m>>>0>k>>>0){d=2;break a}do if((h&65535)<128){d=c[j>>2]|0;if((i-d|0)<1){d=1;break a}c[j>>2]=d+1;a[d>>0]=h}else{if((h&65535)<2048){d=c[j>>2]|0;if((i-d|0)<2){d=1;break a}c[j>>2]=d+1;a[d>>0]=m>>>6|192;l=c[j>>2]|0;c[j>>2]=l+1;a[l>>0]=m&63|128;break}if((h&65535)<55296){d=c[j>>2]|0;if((i-d|0)<3){d=1;break a}c[j>>2]=d+1;a[d>>0]=m>>>12|224;l=c[j>>2]|0;c[j>>2]=l+1;a[l>>0]=m>>>6&63|128;l=c[j>>2]|0;c[j>>2]=l+1;a[l>>0]=m&63|128;break}if((h&65535)>=56320){if((h&65535)<57344){d=2;break a}d=c[j>>2]|0;if((i-d|0)<3){d=1;break a}c[j>>2]=d+1;a[d>>0]=m>>>12|224;l=c[j>>2]|0;c[j>>2]=l+1;a[l>>0]=m>>>6&63|128;l=c[j>>2]|0;c[j>>2]=l+1;a[l>>0]=m&63|128;break}if((n-d|0)<4){d=1;break a}d=d+2|0;h=e[d>>1]|0;if((h&64512|0)!=56320){d=2;break a}if((i-(c[j>>2]|0)|0)<4){d=1;break a}l=m&960;if(((l<<10)+65536|m<<10&64512|h&1023)>>>0>k>>>0){d=2;break a}c[g>>2]=d;d=(l>>>6)+1|0;l=c[j>>2]|0;c[j>>2]=l+1;a[l>>0]=d>>>2|240;l=c[j>>2]|0;c[j>>2]=l+1;a[l>>0]=m>>>2&15|d<<4&48|128;l=c[j>>2]|0;c[j>>2]=l+1;a[l>>0]=m<<4&48|h>>>6&15|128;m=c[j>>2]|0;c[j>>2]=m+1;a[m>>0]=h&63|128}while(0);d=(c[g>>2]|0)+2|0;c[g>>2]=d}}while(0);return d|0}function DL(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;c[a>>2]=19216;e=a+8|0;f=a+12|0;d=0;while(1){b=c[e>>2]|0;if(d>>>0>=(c[f>>2]|0)-b>>2>>>0)break;b=c[b+(d<<2)>>2]|0;if(b|0?(h=b+4|0,g=c[h>>2]|0,c[h>>2]=g+-1,(g|0)==0):0)Qb[c[(c[b>>2]|0)+8>>2]&255](b);d=d+1|0}hO(a+144|0);FL(e);AF(a);return}function EL(a){a=a|0;DL(a);QA(a);return}function FL(b){b=b|0;var d=0,e=0;d=c[b>>2]|0;e=d;do if(d|0){c[b+4>>2]=e;if((d|0)==(b+16|0)){a[b+128>>0]=0;break}else{Nf(d,(c[b+8>>2]|0)-e|0);break}}while(0);return}function GL(b){b=b|0;var d=0;c[b>>2]=19236;d=c[b+8>>2]|0;if(d|0?a[b+12>>0]|0:0)tB(d);AF(b);return}function HL(a){a=a|0;GL(a);QA(a);return}function IL(a,b){a=a|0;b=b|0;if(b<<24>>24>-1)b=c[(RL()|0)+((b&255)<<2)>>2]&255;return b|0}function JL(b,d,e){b=b|0;d=d|0;e=e|0;while(1){if((d|0)==(e|0))break;b=a[d>>0]|0;if(b<<24>>24>-1){b=RL()|0;b=c[b+(a[d>>0]<<2)>>2]&255}a[d>>0]=b;d=d+1|0}return e|0}function KL(a,b){a=a|0;b=b|0;if(b<<24>>24>-1)b=c[(QL()|0)+(b<<24>>24<<2)>>2]&255;return b|0}function LL(b,d,e){b=b|0;d=d|0;e=e|0;while(1){if((d|0)==(e|0))break;b=a[d>>0]|0;if(b<<24>>24>-1){b=QL()|0;b=c[b+(a[d>>0]<<2)>>2]&255}a[d>>0]=b;d=d+1|0}return e|0}function ML(a,b){a=a|0;b=b|0;return b|0}function NL(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;while(1){if((c|0)==(d|0))break;a[e>>0]=a[c>>0]|0;e=e+1|0;c=c+1|0}return d|0}function OL(a,b,c){a=a|0;b=b|0;c=c|0;return (b<<24>>24>-1?b:c)|0}function PL(b,c,d,e,f){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;while(1){if((c|0)==(d|0))break;b=a[c>>0]|0;a[f>>0]=b<<24>>24>-1?b:e;f=f+1|0;c=c+1|0}return d|0}function QL(){return c[(hy()|0)>>2]|0}function RL(){return c[(iy()|0)>>2]|0}function SL(){return c[(ey()|0)>>2]|0}function TL(a){a=a|0;c[a>>2]=19288;hO(a+12|0);AF(a);return}function UL(a){a=a|0;TL(a);QA(a);return}function VL(b){b=b|0;return a[b+8>>0]|0}function WL(b){b=b|0;return a[b+9>>0]|0}function XL(a,b){a=a|0;b=b|0;dO(a,b+12|0);return}function YL(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;eO(a,51258,Wf(51258)|0);return}function ZL(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;eO(a,51252,Wf(51252)|0);return}function _L(a){a=a|0;c[a>>2]=19328;hO(a+16|0);AF(a);return}function $L(a){a=a|0;_L(a);QA(a);return}function aM(a){a=a|0;return c[a+8>>2]|0}function bM(a){a=a|0;return c[a+12>>2]|0}function cM(a,b){a=a|0;b=b|0;dO(a,b+16|0);return}function dM(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;rO(a,19384,HI(19384)|0);return}function eM(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;rO(a,19360,HI(19360)|0);return}function fM(a){a=a|0;AF(a);QA(a);return}function gM(a){a=a|0;AF(a);QA(a);return}function hM(a,c,d){a=a|0;c=c|0;d=d|0;if(d>>>0<128)a=(b[(SL()|0)+(d<<1)>>1]&c)<<16>>16!=0;else a=0;return a|0}function iM(a,d,f,g){a=a|0;d=d|0;f=f|0;g=g|0;while(1){if((d|0)==(f|0))break;if((c[d>>2]|0)>>>0<128){a=SL()|0;a=e[a+(c[d>>2]<<1)>>1]|0}else a=0;b[g>>1]=a;g=g+2|0;d=d+4|0}return f|0}function jM(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;while(1){if((e|0)==(f|0)){e=f;break}if((c[e>>2]|0)>>>0<128?(a=SL()|0,(b[a+(c[e>>2]<<1)>>1]&d)<<16>>16):0)break;e=e+4|0}return e|0}function kM(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;while(1){if((e|0)==(f|0)){e=f;break}if((c[e>>2]|0)>>>0>=128)break;a=SL()|0;if(!((b[a+(c[e>>2]<<1)>>1]&d)<<16>>16))break;e=e+4|0}return e|0}function lM(a,b){a=a|0;b=b|0;if(b>>>0<128)b=c[(RL()|0)+(b<<2)>>2]|0;return b|0}function mM(a,b,d){a=a|0;b=b|0;d=d|0;while(1){if((b|0)==(d|0))break;a=c[b>>2]|0;if(a>>>0<128){a=RL()|0;a=c[a+(c[b>>2]<<2)>>2]|0}c[b>>2]=a;b=b+4|0}return d|0}function nM(a,b){a=a|0;b=b|0;if(b>>>0<128)b=c[(QL()|0)+(b<<2)>>2]|0;return b|0}function oM(a,b,d){a=a|0;b=b|0;d=d|0;while(1){if((b|0)==(d|0))break;a=c[b>>2]|0;if(a>>>0<128){a=QL()|0;a=c[a+(c[b>>2]<<2)>>2]|0}c[b>>2]=a;b=b+4|0}return d|0}function pM(a,b){a=a|0;b=b|0;return b<<24>>24|0}function qM(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;while(1){if((d|0)==(e|0))break;c[f>>2]=a[d>>0];f=f+4|0;d=d+1|0}return e|0}function rM(a,b,c){a=a|0;b=b|0;c=c|0;return (b>>>0<128?b&255:c)|0}function sM(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;h=(e-d|0)>>>2;b=g;g=d;while(1){if((g|0)==(e|0))break;i=c[g>>2]|0;a[b>>0]=i>>>0<128?i&255:f;b=b+1|0;g=g+4|0}return d+(h<<2)|0}function tM(a){a=a|0;AF(a);QA(a);return}function uM(a){a=a|0;AF(a);QA(a);return}function vM(a){a=a|0;AF(a);QA(a);return}function wM(a){a=a|0;c[a>>2]=19644;return}function xM(a){a=a|0;c[a>>2]=19680;return}function yM(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;c[b+4>>2]=f+-1;c[b>>2]=19236;f=b+8|0;c[f>>2]=d;a[b+12>>0]=e&1;if(!d)c[f>>2]=SL()|0;return}function zM(a,b){a=a|0;b=b|0;var d=0;c[a+4>>2]=b+-1;c[a>>2]=19216;b=a+8|0;AM(b,28);d=a+144|0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;eO(d,49197,Wf(49197)|0);c[a+12>>2]=c[b>>2];BM();CM(a,54968);DM();EM(a,54976);FM();GM(a,54984);HM();IM(a,55e3);JM();KM(a,55008);LM();MM(a,55016);NM();OM(a,55032);PM();QM(a,55040);RM();SM(a,55048);TM();UM(a,55072);VM();WM(a,55104);XM();YM(a,55112);ZM();_M(a,55120);$M();aN(a,55128);bN();cN(a,55136);dN();eN(a,55144);fN();gN(a,55152);hN();iN(a,55160);jN();kN(a,55168);lN();mN(a,55176);nN();oN(a,55184);pN();qN(a,55192);rN();sN(a,55200);tN();uN(a,55216);vN();wN(a,55232);xN();yN(a,55248);zN();AN(a,55264);BN();CN(a,55272);return}function AM(b,d){b=b|0;d=d|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;a[b+128>>0]=0;if(d|0){PN(b,d);GN(b,d)}return}function BM(){c[13743]=0;c[13742]=17072;return}function CM(a,b){a=a|0;b=b|0;DN(a,b,_F(56720)|0);return}function DM(){c[13745]=0;c[13744]=17104;return}function EM(a,b){a=a|0;b=b|0;DN(a,b,_F(56728)|0);return}function FM(){yM(54984,0,0,1);return}function GM(a,b){a=a|0;b=b|0;DN(a,b,_F(56736)|0);return}function HM(){c[13751]=0;c[13750]=19432;return}function IM(a,b){a=a|0;b=b|0;DN(a,b,_F(56768)|0);return}function JM(){c[13753]=0;c[13752]=19500;return}function KM(a,b){a=a|0;b=b|0;DN(a,b,_F(57040)|0);return}function LM(){ON(55016,1);return}function MM(a,b){a=a|0;b=b|0;DN(a,b,_F(57048)|0);return}function NM(){c[13759]=0;c[13758]=19548;return}function OM(a,b){a=a|0;b=b|0;DN(a,b,_F(57056)|0);return}function PM(){c[13761]=0;c[13760]=19596;return}function QM(a,b){a=a|0;b=b|0;DN(a,b,_F(57064)|0);return}function RM(){NN(55048,1);return}function SM(a,b){a=a|0;b=b|0;DN(a,b,_F(56752)|0);return}function TM(){MN(55072,1);return}function UM(a,b){a=a|0;b=b|0;DN(a,b,_F(56776)|0);return}function VM(){c[13777]=0;c[13776]=17136;return}function WM(a,b){a=a|0;b=b|0;DN(a,b,_F(56760)|0);return}function XM(){c[13779]=0;c[13778]=17200;return}function YM(a,b){a=a|0;b=b|0;DN(a,b,_F(56784)|0);return}function ZM(){c[13781]=0;c[13780]=17264;return}function _M(a,b){a=a|0;b=b|0;DN(a,b,_F(56792)|0);return}function $M(){c[13783]=0;c[13782]=17316;return}function aN(a,b){a=a|0;b=b|0;DN(a,b,_F(56800)|0);return}function bN(){c[13785]=0;c[13784]=18672;return}function cN(a,b){a=a|0;b=b|0;DN(a,b,_F(56960)|0);return}function dN(){c[13787]=0;c[13786]=18728;return}function eN(a,b){a=a|0;b=b|0;DN(a,b,_F(56968)|0);return}function fN(){c[13789]=0;c[13788]=18784;return}function gN(a,b){a=a|0;b=b|0;DN(a,b,_F(56976)|0);return}function hN(){c[13791]=0;c[13790]=18840;return}function iN(a,b){a=a|0;b=b|0;DN(a,b,_F(56984)|0);return}function jN(){c[13793]=0;c[13792]=18896;return}function kN(a,b){a=a|0;b=b|0;DN(a,b,_F(56992)|0);return}function lN(){c[13795]=0;c[13794]=18924;return}function mN(a,b){a=a|0;b=b|0;DN(a,b,_F(57e3)|0);return}function nN(){c[13797]=0;c[13796]=18952;return}function oN(a,b){a=a|0;b=b|0;DN(a,b,_F(57008)|0);return}function pN(){c[13799]=0;c[13798]=18980;return}function qN(a,b){a=a|0;b=b|0;DN(a,b,_F(57016)|0);return}function rN(){c[13801]=0;c[13800]=19412;wM(55208);c[13800]=17368;c[13802]=17416;return}function sN(a,b){a=a|0;b=b|0;DN(a,b,_F(56868)|0);return}function tN(){c[13805]=0;c[13804]=19412;xM(55224);c[13804]=17452;c[13806]=17500;return}function uN(a,b){a=a|0;b=b|0;DN(a,b,_F(56936)|0);return}function vN(){c[13809]=0;c[13808]=19412;c[13810]=YF()|0;c[13808]=18624;return}function wN(a,b){a=a|0;b=b|0;DN(a,b,_F(56944)|0);return}function xN(){c[13813]=0;c[13812]=19412;c[13814]=YF()|0;c[13812]=18648;return}function yN(a,b){a=a|0;b=b|0;DN(a,b,_F(56952)|0);return}function zN(){c[13817]=0;c[13816]=19008;return}function AN(a,b){a=a|0;b=b|0;DN(a,b,_F(57024)|0);return}function BN(){c[13819]=0;c[13818]=19040;return}function CN(a,b){a=a|0;b=b|0;DN(a,b,_F(57032)|0);return}function DN(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;f=b+4|0;c[f>>2]=(c[f>>2]|0)+1;f=a+8|0;e=c[f>>2]|0;if((c[a+12>>2]|0)-e>>2>>>0>d>>>0)a=f;else{EN(f,d+1|0);a=f;e=c[f>>2]|0}e=c[e+(d<<2)>>2]|0;if(e|0?(g=e+4|0,f=c[g>>2]|0,c[g>>2]=f+-1,(f|0)==0):0)Qb[c[(c[e>>2]|0)+8>>2]&255](e);c[(c[a>>2]|0)+(d<<2)>>2]=b;return}function EN(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=a+4|0;f=c[a>>2]|0;e=(c[d>>2]|0)-f>>2;if(e>>>0>=b>>>0){if(e>>>0>b>>>0)c[d>>2]=f+(b<<2)}else FN(a,b-e|0);return}function FN(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=yb;yb=yb+32|0;f=i;g=a+8|0;h=a+4|0;d=c[h>>2]|0;do if((c[g>>2]|0)-d>>2>>>0>>0){d=(d-(c[a>>2]|0)>>2)+b|0;e=HN(a)|0;if(e>>>0>>0)CO(a);else{j=c[a>>2]|0;k=(c[g>>2]|0)-j|0;g=k>>1;IN(f,k>>2>>>0>>1>>>0?(g>>>0>>0?d:g):e,(c[h>>2]|0)-j>>2,a+16|0);JN(f,b);KN(a,f);LN(f);break}}else GN(a,b);while(0);yb=i;return}function GN(a,b){a=a|0;b=b|0;var d=0;d=a+4|0;a=b;b=c[d>>2]|0;do{c[b>>2]=0;b=(c[d>>2]|0)+4|0;c[d>>2]=b;a=a+-1|0}while((a|0)!=0);return}function HN(a){a=a|0;return 1073741823}function IN(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;h=b+12|0;c[h>>2]=0;c[b+16>>2]=f;do if(d){g=f+112|0;if(d>>>0<29&(a[g>>0]|0)==0){a[g>>0]=1;break}else{f=rB(d<<2)|0;break}}else f=0;while(0);c[b>>2]=f;e=f+(e<<2)|0;c[b+8>>2]=e;c[b+4>>2]=e;c[h>>2]=f+(d<<2);return}function JN(a,b){a=a|0;b=b|0;var d=0;d=a+8|0;a=b;b=c[d>>2]|0;do{c[b>>2]=0;b=(c[d>>2]|0)+4|0;c[d>>2]=b;a=a+-1|0}while((a|0)!=0);return}function KN(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=c[a>>2]|0;h=a+4|0;g=b+4|0;f=(c[h>>2]|0)-e|0;d=(c[g>>2]|0)+(0-(f>>2)<<2)|0;c[g>>2]=d;if((f|0)>0){YO(d|0,e|0,f|0)|0;e=g;d=c[g>>2]|0}else e=g;g=c[a>>2]|0;c[a>>2]=d;c[e>>2]=g;g=b+8|0;f=c[h>>2]|0;c[h>>2]=c[g>>2];c[g>>2]=f;g=a+8|0;h=b+12|0;a=c[g>>2]|0;c[g>>2]=c[h>>2];c[h>>2]=a;c[b>>2]=c[e>>2];return}function LN(b){b=b|0;var d=0,e=0,f=0,g=0;d=c[b+4>>2]|0;e=b+8|0;f=c[e>>2]|0;while(1){if((f|0)==(d|0))break;g=f+-4|0;c[e>>2]=g;f=g}e=c[b>>2]|0;f=e;do if(e|0){d=c[b+16>>2]|0;if((e|0)==(d|0)){a[d+112>>0]=0;break}else{Nf(e,(c[b+12>>2]|0)-f|0);break}}while(0);return}function MN(a,b){a=a|0;b=b|0;c[a+4>>2]=b+-1;c[a>>2]=19328;c[a+8>>2]=46;c[a+12>>2]=44;b=a+16|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;a=0;while(1){if((a|0)==3)break;c[b+(a<<2)>>2]=0;a=a+1|0}return}function NN(b,d){b=b|0;d=d|0;c[b+4>>2]=d+-1;c[b>>2]=19288;a[b+8>>0]=46;a[b+9>>0]=44;d=b+12|0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;b=0;while(1){if((b|0)==3)break;c[d+(b<<2)>>2]=0;b=b+1|0}return}function ON(a,b){a=a|0;b=b|0;c[a+4>>2]=b+-1;c[a>>2]=19168;c[a+8>>2]=YF()|0;return}function PN(b,d){b=b|0;d=d|0;var e=0;if((HN(b)|0)>>>0>>0)CO(b);e=b+128|0;if(d>>>0<29&(a[e>>0]|0)==0){a[e>>0]=1;e=b+16|0}else e=rB(d<<2)|0;c[b+4>>2]=e;c[b>>2]=e;c[b+8>>2]=e+(d<<2);return}function QN(){if((a[55280]|0)==0?lB(55280)|0:0){RN()|0;c[14269]=57072;nB(55280)}return c[14269]|0}function RN(){SN();c[14268]=55288;return 57072}function SN(){zM(55288,1);return}function TN(){UN(57080,QN()|0);return 57080}function UN(a,b){a=a|0;b=b|0;b=c[b>>2]|0;c[a>>2]=b;b=b+4|0;c[b>>2]=(c[b>>2]|0)+1;return}function VN(){if((a[55448]|0)==0?lB(55448)|0:0){TN()|0;c[14271]=57080;nB(55448)}return c[14271]|0}function WN(a){a=a|0;var b=0;b=c[(VN()|0)>>2]|0;c[a>>2]=b;a=b+4|0;c[a>>2]=(c[a>>2]|0)+1;return}function XN(a){a=a|0;return}function YN(a){a=a|0;var b=0,d=0;b=a+8|0;if(!((c[b>>2]|0)!=0?(d=c[b>>2]|0,c[b>>2]=d+-1,(d|0)!=0):0))Qb[c[(c[a>>2]|0)+16>>2]&255](a);return}function ZN(a,b,d){a=a|0;b=b|0;d=d|0;do{}while((c[a>>2]|0)==1);if(!(c[a>>2]|0)){c[a>>2]=1;Qb[d&255](b);c[a>>2]=-1}return}function _N(){ua()}function $N(a,b){a=a|0;b=b|0;var d=0,e=0;e=Oy(b)|0;d=rB(e+13|0)|0;c[d>>2]=e;c[d+4>>2]=e;c[d+8>>2]=0;d=aO(d)|0;YO(d|0,b|0,e+1|0)|0;c[a>>2]=d;return}function aO(a){a=a|0;return a+12|0}function bO(a,b){a=a|0;b=b|0;c[a>>2]=16372;$N(a+4|0,b);return}function cO(a){a=a|0;ua()}function dO(b,d){b=b|0;d=d|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;if((a[d+11>>0]|0)<0)eO(b,c[d>>2]|0,c[d+4>>2]|0);else{c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2]}return}function eO(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;g=yb;yb=yb+16|0;f=g;if(e>>>0>4294967279)cO(b);if(e>>>0<11)a[b+11>>0]=e;else{i=e+16&-16;h=rB(i)|0;c[b>>2]=h;c[b+8>>2]=i|-2147483648;c[b+4>>2]=e;b=h}TD(b,d,e)|0;a[f>>0]=0;$f(b+e|0,f);yb=g;return}function fO(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;g=yb;yb=yb+16|0;f=g;if(d>>>0>4294967279)cO(b);if(d>>>0<11)a[b+11>>0]=d;else{i=d+16&-16;h=rB(i)|0;c[b>>2]=h;c[b+8>>2]=i|-2147483648;c[b+4>>2]=d;b=h}gO(b,d,e)|0;a[f>>0]=0;$f(b+d|0,f);yb=g;return}function gO(a,b,c){a=a|0;b=b|0;c=c|0;if(b|0)_O(a|0,(ag(c)|0)&255|0,b|0)|0;return a|0}function hO(b){b=b|0;if((a[b+11>>0]|0)<0)Nf(c[b>>2]|0,c[b+8>>2]&2147483647);return}function iO(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=yb;yb=yb+16|0;i=k;j=b+11|0;f=a[j>>0]|0;g=f<<24>>24<0;if(g)h=(c[b+8>>2]&2147483647)+-1|0;else h=10;do if(h>>>0>=e>>>0){if(g)f=c[b>>2]|0;else f=b;jO(f,d,e)|0;a[i>>0]=0;$f(f+e|0,i);if((a[j>>0]|0)<0){c[b+4>>2]=e;break}else{a[j>>0]=e;break}}else{if(g)f=c[b+4>>2]|0;else f=f&255;kO(b,h,e-h|0,f,0,f,e,d)}while(0);yb=k;return b|0}function jO(a,b,c){a=a|0;b=b|0;c=c|0;if(c|0)ZO(a|0,b|0,c|0)|0;return a|0}function kO(b,d,e,f,g,h,i,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0,n=0,o=0;o=yb;yb=yb+16|0;n=o;if((-18-d|0)>>>0>>0)cO(b);if((a[b+11>>0]|0)<0)m=c[b>>2]|0;else m=b;if(d>>>0<2147483623){k=e+d|0;l=d<<1;k=k>>>0>>0?l:k;k=k>>>0<11?11:k+16&-16}else k=-17;l=rB(k)|0;if(g|0)TD(l,m,g)|0;if(i|0)TD(l+g|0,j,i)|0;f=f-h|0;e=f-g|0;if(e|0)TD(l+g+i|0,m+g+h|0,e)|0;e=d+1|0;if((e|0)!=11)Nf(m,e);c[b>>2]=l;c[b+8>>2]=k|-2147483648;i=f+i|0;c[b+4>>2]=i;a[n>>0]=0;$f(l+i|0,n);yb=o;return}function lO(a,b){a=a|0;b=b|0;return iO(a,b,Wf(b)|0)|0}function mO(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=yb;yb=yb+16|0;g=j;h=b+11|0;f=a[h>>0]|0;i=f<<24>>24<0;if(i)f=c[b+4>>2]|0;else f=f&255;do if(f>>>0>=d>>>0)if(i){i=(c[b>>2]|0)+d|0;a[g>>0]=0;$f(i,g);c[b+4>>2]=d;break}else{a[g>>0]=0;$f(b+d|0,g);a[h>>0]=d;break}else nO(b,d-f|0,e)|0;while(0);yb=j;return}function nO(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=yb;yb=yb+16|0;i=k;if(d|0){j=b+11|0;f=a[j>>0]|0;if(f<<24>>24<0){h=c[b+4>>2]|0;g=(c[b+8>>2]&2147483647)+-1|0}else{h=f&255;g=10}if((g-h|0)>>>0>>0){oO(b,g,h+d-g|0,h,h,0,0);f=a[j>>0]|0}if(f<<24>>24<0)g=c[b>>2]|0;else g=b;gO(g+h|0,d,e)|0;f=h+d|0;if((a[j>>0]|0)<0)c[b+4>>2]=f;else a[j>>0]=f;a[i>>0]=0;$f(g+f|0,i)}yb=k;return b|0}function oO(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0;if((-17-d|0)>>>0>>0)cO(b);if((a[b+11>>0]|0)<0)l=c[b>>2]|0;else l=b;if(d>>>0<2147483623){j=e+d|0;k=d<<1;j=j>>>0>>0?k:j;j=j>>>0<11?11:j+16&-16}else j=-17;k=rB(j)|0;if(g|0)TD(k,l,g)|0;e=f-h-g|0;if(e|0)TD(k+g+i|0,l+g+h|0,e)|0;e=d+1|0;if((e|0)!=11)Nf(l,e);c[b>>2]=k;c[b+8>>2]=j|-2147483648;return}function pO(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=yb;yb=yb+16|0;i=k;j=b+11|0;f=a[j>>0]|0;g=f<<24>>24<0;if(g){h=c[b+4>>2]|0;f=(c[b+8>>2]&2147483647)+-1|0}else{h=f&255;f=10}if((f-h|0)>>>0>=e>>>0){if(e|0){if(g)g=c[b>>2]|0;else g=b;TD(g+h|0,d,e)|0;f=h+e|0;if((a[j>>0]|0)<0)c[b+4>>2]=f;else a[j>>0]=f;a[i>>0]=0;$f(g+f|0,i)}}else kO(b,f,h+e-f|0,h,h,0,e,d);yb=k;return b|0}function qO(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=yb;yb=yb+16|0;h=j;i=j+1|0;a[h>>0]=d;g=b+11|0;d=a[g>>0]|0;e=d<<24>>24<0;if(e){f=c[b+4>>2]|0;d=(c[b+8>>2]&2147483647)+-1|0}else{f=d&255;d=10}if((f|0)==(d|0)){oO(b,d,1,d,d,0,0);if((a[g>>0]|0)<0)e=8;else e=7}else if(e)e=8;else e=7;if((e|0)==7){a[g>>0]=f+1;d=b}else if((e|0)==8){d=c[b>>2]|0;c[b+4>>2]=f+1}b=d+f|0;$f(b,h);a[i>>0]=0;$f(b+1|0,i);yb=j;return}function rO(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=yb;yb=yb+16|0;h=i;if(e>>>0>1073741807)cO(b);do if(e>>>0>=2){g=e+4&-4;if(g>>>0>1073741823)ua();else{f=rB(g<<2)|0;c[b>>2]=f;c[b+8>>2]=g|-2147483648;c[b+4>>2]=e;break}}else{a[b+8+3>>0]=e;f=b}while(0);iE(f,d,e)|0;c[h>>2]=0;HF(f+(e<<2)|0,h);yb=i;return}function sO(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=yb;yb=yb+16|0;h=i;if(d>>>0>1073741807)cO(b);do if(d>>>0>=2){g=d+4&-4;if(g>>>0>1073741823)ua();else{f=rB(g<<2)|0;c[b>>2]=f;c[b+8>>2]=g|-2147483648;c[b+4>>2]=d;break}}else{a[b+8+3>>0]=d;f=b}while(0);tO(f,d,e)|0;c[h>>2]=0;HF(f+(d<<2)|0,h);yb=i;return}function tO(a,b,c){a=a|0;b=b|0;c=c|0;if(b)sA(a,c,b)|0;return a|0}function uO(b){b=b|0;var d=0;d=b+8|0;if((a[d+3>>0]|0)<0)Nf(c[b>>2]|0,c[d>>2]<<2);return}function vO(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0;l=yb;yb=yb+16|0;j=l;f=b+8|0;k=f+3|0;h=a[k>>0]|0;i=h<<24>>24<0;if(i)g=(c[f>>2]&2147483647)+-1|0;else g=1;do if(g>>>0>=e>>>0){if(i)f=c[b>>2]|0;else f=b;wO(f,d,e)|0;c[j>>2]=0;HF(f+(e<<2)|0,j);if((a[k>>0]|0)<0){c[b+4>>2]=e;break}else{a[k>>0]=e;break}}else{if(i)f=c[b+4>>2]|0;else f=h&255;xO(b,g,e-g|0,f,0,f,e,d)}while(0);yb=l;return b|0}function wO(a,b,c){a=a|0;b=b|0;c=c|0;if(c)tA(a,b,c)|0;return a|0}function xO(b,d,e,f,g,h,i,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0;p=yb;yb=yb+16|0;o=p;if((1073741806-d|0)>>>0>>0)cO(b);l=b+8|0;if((a[l+3>>0]|0)<0)n=c[b>>2]|0;else n=b;if(d>>>0<536870887){e=e+d|0;k=d<<1;e=e>>>0>>0?k:e;e=e>>>0<2?2:e+4&-4;if(e>>>0>1073741823)ua();else m=e}else m=1073741807;k=rB(m<<2)|0;if(g|0)iE(k,n,g)|0;if(i|0)iE(k+(g<<2)|0,j,i)|0;f=f-h|0;e=f-g|0;if(e|0)iE(k+(g<<2)+(i<<2)|0,n+(g<<2)+(h<<2)|0,e)|0;e=d+1|0;if((e|0)!=2)Nf(n,e<<2);c[b>>2]=k;c[l>>2]=m|-2147483648;i=f+i|0;c[b+4>>2]=i;c[o>>2]=0;HF(k+(i<<2)|0,o);yb=p;return}function yO(a,b){a=a|0;b=b|0;return vO(a,b,HI(b)|0)|0}function zO(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0;if((1073741807-d|0)>>>0>>0)cO(b);m=b+8|0;if((a[m+3>>0]|0)<0)l=c[b>>2]|0;else l=b;if(d>>>0<536870887){e=e+d|0;j=d<<1;e=e>>>0>>0?j:e;e=e>>>0<2?2:e+4&-4;if(e>>>0>1073741823)ua();else k=e}else k=1073741807;j=rB(k<<2)|0;if(g|0)iE(j,l,g)|0;e=f-h-g|0;if(e|0)iE(j+(g<<2)+(i<<2)|0,l+(g<<2)+(h<<2)|0,e)|0;e=d+1|0;if((e|0)!=2)Nf(l,e<<2);c[b>>2]=j;c[m>>2]=k|-2147483648;return}function AO(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0;l=yb;yb=yb+16|0;j=l;g=b+8|0;k=g+3|0;f=a[k>>0]|0;i=f<<24>>24<0;if(i){h=c[b+4>>2]|0;f=(c[g>>2]&2147483647)+-1|0}else{h=f&255;f=1}if((f-h|0)>>>0>=e>>>0){if(e|0){if(i)g=c[b>>2]|0;else g=b;iE(g+(h<<2)|0,d,e)|0;f=h+e|0;if((a[k>>0]|0)<0)c[b+4>>2]=f;else a[k>>0]=f;c[j>>2]=0;HF(g+(f<<2)|0,j)}}else xO(b,f,h+e-f|0,h,h,0,e,d);yb=l;return b|0}function BO(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=yb;yb=yb+16|0;i=k;j=k+4|0;c[i>>2]=d;e=b+8|0;h=e+3|0;d=a[h>>0]|0;f=d<<24>>24<0;if(f){g=c[b+4>>2]|0;d=(c[e>>2]&2147483647)+-1|0}else{g=d&255;d=1}if((g|0)==(d|0)){zO(b,d,1,d,d,0,0);if((a[h>>0]|0)<0)e=8;else e=7}else if(f)e=8;else e=7;if((e|0)==7){a[h>>0]=g+1;d=b}else if((e|0)==8){d=c[b>>2]|0;c[b+4>>2]=g+1}b=d+(g<<2)|0;HF(b,i);c[j>>2]=0;HF(b+4|0,j);yb=k;return}function CO(a){a=a|0;ua()}function DO(a){a=a|0;var b=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;w=yb;yb=yb+16|0;n=w;do if(a>>>0<245){k=a>>>0<11?16:a+11&-8;a=k>>>3;m=c[14291]|0;d=m>>>a;if(d&3|0){b=(d&1^1)+a|0;a=57204+(b<<1<<2)|0;d=a+8|0;e=c[d>>2]|0;f=e+8|0;g=c[f>>2]|0;if((g|0)==(a|0))c[14291]=m&~(1<>2]=a;c[d>>2]=g}v=b<<3;c[e+4>>2]=v|3;v=e+v+4|0;c[v>>2]=c[v>>2]|1;v=f;yb=w;return v|0}l=c[14293]|0;if(k>>>0>l>>>0){if(d|0){b=2<>>12&16;b=b>>>i;d=b>>>5&8;b=b>>>d;g=b>>>2&4;b=b>>>g;a=b>>>1&2;b=b>>>a;e=b>>>1&1;e=(d|i|g|a|e)+(b>>>e)|0;b=57204+(e<<1<<2)|0;a=b+8|0;g=c[a>>2]|0;i=g+8|0;d=c[i>>2]|0;if((d|0)==(b|0)){a=m&~(1<>2]=b;c[a>>2]=d;a=m}v=e<<3;h=v-k|0;c[g+4>>2]=k|3;f=g+k|0;c[f+4>>2]=h|1;c[g+v>>2]=h;if(l|0){e=c[14296]|0;b=l>>>3;d=57204+(b<<1<<2)|0;b=1<>2]|0}c[a>>2]=e;c[b+12>>2]=e;c[e+8>>2]=b;c[e+12>>2]=d}c[14293]=h;c[14296]=f;v=i;yb=w;return v|0}g=c[14292]|0;if(g){d=(g&0-g)+-1|0;f=d>>>12&16;d=d>>>f;e=d>>>5&8;d=d>>>e;h=d>>>2&4;d=d>>>h;i=d>>>1&2;d=d>>>i;j=d>>>1&1;j=c[57468+((e|f|h|i|j)+(d>>>j)<<2)>>2]|0;d=j;i=j;j=(c[j+4>>2]&-8)-k|0;while(1){a=c[d+16>>2]|0;if(!a){a=c[d+20>>2]|0;if(!a)break}h=(c[a+4>>2]&-8)-k|0;f=h>>>0>>0;d=a;i=f?a:i;j=f?h:j}h=i+k|0;if(h>>>0>i>>>0){f=c[i+24>>2]|0;b=c[i+12>>2]|0;do if((b|0)==(i|0)){a=i+20|0;b=c[a>>2]|0;if(!b){a=i+16|0;b=c[a>>2]|0;if(!b){d=0;break}}while(1){e=b+20|0;d=c[e>>2]|0;if(!d){e=b+16|0;d=c[e>>2]|0;if(!d)break;else{b=d;a=e}}else{b=d;a=e}}c[a>>2]=0;d=b}else{d=c[i+8>>2]|0;c[d+12>>2]=b;c[b+8>>2]=d;d=b}while(0);do if(f|0){b=c[i+28>>2]|0;a=57468+(b<<2)|0;if((i|0)==(c[a>>2]|0)){c[a>>2]=d;if(!d){c[14292]=g&~(1<>2]|0)==(i|0)?v:f+20|0)>>2]=d;if(!d)break}c[d+24>>2]=f;b=c[i+16>>2]|0;if(b|0){c[d+16>>2]=b;c[b+24>>2]=d}b=c[i+20>>2]|0;if(b|0){c[d+20>>2]=b;c[b+24>>2]=d}}while(0);if(j>>>0<16){v=j+k|0;c[i+4>>2]=v|3;v=i+v+4|0;c[v>>2]=c[v>>2]|1}else{c[i+4>>2]=k|3;c[h+4>>2]=j|1;c[h+j>>2]=j;if(l|0){e=c[14296]|0;b=l>>>3;d=57204+(b<<1<<2)|0;b=1<>2]|0}c[a>>2]=e;c[b+12>>2]=e;c[e+8>>2]=b;c[e+12>>2]=d}c[14293]=j;c[14296]=h}v=i+8|0;yb=w;return v|0}else m=k}else m=k}else m=k}else if(a>>>0<=4294967231){a=a+11|0;k=a&-8;e=c[14292]|0;if(e){f=0-k|0;a=a>>>8;if(a)if(k>>>0>16777215)j=31;else{m=(a+1048320|0)>>>16&8;q=a<>>16&4;q=q<>>16&2;j=14-(i|m|j)+(q<>>15)|0;j=k>>>(j+7|0)&1|j<<1}else j=0;d=c[57468+(j<<2)>>2]|0;a:do if(!d){d=0;a=0;q=61}else{a=0;i=k<<((j|0)==31?0:25-(j>>>1)|0);g=0;while(1){h=(c[d+4>>2]&-8)-k|0;if(h>>>0>>0)if(!h){a=d;f=0;q=65;break a}else{a=d;f=h}q=c[d+20>>2]|0;d=c[d+16+(i>>>31<<2)>>2]|0;g=(q|0)==0|(q|0)==(d|0)?g:q;if(!d){d=g;q=61;break}else i=i<<1}}while(0);if((q|0)==61){if((d|0)==0&(a|0)==0){a=2<>>12&16;m=m>>>h;g=m>>>5&8;m=m>>>g;i=m>>>2&4;m=m>>>i;j=m>>>1&2;m=m>>>j;d=m>>>1&1;a=0;d=c[57468+((g|h|i|j|d)+(m>>>d)<<2)>>2]|0}if(!d){i=a;h=f}else q=65}if((q|0)==65){g=d;while(1){m=(c[g+4>>2]&-8)-k|0;d=m>>>0>>0;f=d?m:f;a=d?g:a;d=c[g+16>>2]|0;if(!d)d=c[g+20>>2]|0;if(!d){i=a;h=f;break}else g=d}}if(((i|0)!=0?h>>>0<((c[14293]|0)-k|0)>>>0:0)?(l=i+k|0,l>>>0>i>>>0):0){g=c[i+24>>2]|0;b=c[i+12>>2]|0;do if((b|0)==(i|0)){a=i+20|0;b=c[a>>2]|0;if(!b){a=i+16|0;b=c[a>>2]|0;if(!b){b=0;break}}while(1){f=b+20|0;d=c[f>>2]|0;if(!d){f=b+16|0;d=c[f>>2]|0;if(!d)break;else{b=d;a=f}}else{b=d;a=f}}c[a>>2]=0}else{v=c[i+8>>2]|0;c[v+12>>2]=b;c[b+8>>2]=v}while(0);do if(g){a=c[i+28>>2]|0;d=57468+(a<<2)|0;if((i|0)==(c[d>>2]|0)){c[d>>2]=b;if(!b){e=e&~(1<>2]|0)==(i|0)?v:g+20|0)>>2]=b;if(!b)break}c[b+24>>2]=g;a=c[i+16>>2]|0;if(a|0){c[b+16>>2]=a;c[a+24>>2]=b}a=c[i+20>>2]|0;if(a){c[b+20>>2]=a;c[a+24>>2]=b}}while(0);b:do if(h>>>0<16){v=h+k|0;c[i+4>>2]=v|3;v=i+v+4|0;c[v>>2]=c[v>>2]|1}else{c[i+4>>2]=k|3;c[l+4>>2]=h|1;c[l+h>>2]=h;b=h>>>3;if(h>>>0<256){d=57204+(b<<1<<2)|0;a=c[14291]|0;b=1<>2]|0}c[a>>2]=l;c[b+12>>2]=l;c[l+8>>2]=b;c[l+12>>2]=d;break}b=h>>>8;if(b)if(h>>>0>16777215)d=31;else{u=(b+1048320|0)>>>16&8;v=b<>>16&4;v=v<>>16&2;d=14-(t|u|d)+(v<>>15)|0;d=h>>>(d+7|0)&1|d<<1}else d=0;b=57468+(d<<2)|0;c[l+28>>2]=d;a=l+16|0;c[a+4>>2]=0;c[a>>2]=0;a=1<>2]=l;c[l+24>>2]=b;c[l+12>>2]=l;c[l+8>>2]=l;break}b=c[b>>2]|0;c:do if((c[b+4>>2]&-8|0)!=(h|0)){e=h<<((d|0)==31?0:25-(d>>>1)|0);while(1){d=b+16+(e>>>31<<2)|0;a=c[d>>2]|0;if(!a)break;if((c[a+4>>2]&-8|0)==(h|0)){b=a;break c}else{e=e<<1;b=a}}c[d>>2]=l;c[l+24>>2]=b;c[l+12>>2]=l;c[l+8>>2]=l;break b}while(0);u=b+8|0;v=c[u>>2]|0;c[v+12>>2]=l;c[u>>2]=l;c[l+8>>2]=v;c[l+12>>2]=b;c[l+24>>2]=0}while(0);v=i+8|0;yb=w;return v|0}else m=k}else m=k}else m=-1;while(0);d=c[14293]|0;if(d>>>0>=m>>>0){b=d-m|0;a=c[14296]|0;if(b>>>0>15){v=a+m|0;c[14296]=v;c[14293]=b;c[v+4>>2]=b|1;c[a+d>>2]=b;c[a+4>>2]=m|3}else{c[14293]=0;c[14296]=0;c[a+4>>2]=d|3;v=a+d+4|0;c[v>>2]=c[v>>2]|1}v=a+8|0;yb=w;return v|0}h=c[14294]|0;if(h>>>0>m>>>0){t=h-m|0;c[14294]=t;v=c[14297]|0;u=v+m|0;c[14297]=u;c[u+4>>2]=t|1;c[v+4>>2]=m|3;v=v+8|0;yb=w;return v|0}if(!(c[14409]|0)){c[14411]=4096;c[14410]=4096;c[14412]=-1;c[14413]=-1;c[14414]=0;c[14402]=0;c[14409]=n&-16^1431655768;a=4096}else a=c[14411]|0;i=m+48|0;j=m+47|0;g=a+j|0;f=0-a|0;k=g&f;if(k>>>0<=m>>>0){v=0;yb=w;return v|0}a=c[14401]|0;if(a|0?(l=c[14399]|0,n=l+k|0,n>>>0<=l>>>0|n>>>0>a>>>0):0){v=0;yb=w;return v|0}d:do if(!(c[14402]&4)){d=c[14297]|0;e:do if(d){e=57612;while(1){n=c[e>>2]|0;if(n>>>0<=d>>>0?(n+(c[e+4>>2]|0)|0)>>>0>d>>>0:0)break;a=c[e+8>>2]|0;if(!a){q=128;break e}else e=a}b=g-h&f;if(b>>>0<2147483647){a=JO(b)|0;if((a|0)==((c[e>>2]|0)+(c[e+4>>2]|0)|0)){if((a|0)!=(-1|0)){h=b;g=a;q=145;break d}}else{e=a;q=136}}else b=0}else q=128;while(0);do if((q|0)==128){d=JO(0)|0;if((d|0)!=(-1|0)?(b=d,o=c[14410]|0,p=o+-1|0,b=((p&b|0)==0?0:(p+b&0-o)-b|0)+k|0,o=c[14399]|0,p=b+o|0,b>>>0>m>>>0&b>>>0<2147483647):0){n=c[14401]|0;if(n|0?p>>>0<=o>>>0|p>>>0>n>>>0:0){b=0;break}a=JO(b)|0;if((a|0)==(d|0)){h=b;g=d;q=145;break d}else{e=a;q=136}}else b=0}while(0);do if((q|0)==136){d=0-b|0;if(!(i>>>0>b>>>0&(b>>>0<2147483647&(e|0)!=(-1|0))))if((e|0)==(-1|0)){b=0;break}else{h=b;g=e;q=145;break d}a=c[14411]|0;a=j-b+a&0-a;if(a>>>0>=2147483647){h=b;g=e;q=145;break d}if((JO(a)|0)==(-1|0)){JO(d)|0;b=0;break}else{h=a+b|0;g=e;q=145;break d}}while(0);c[14402]=c[14402]|4;q=143}else{b=0;q=143}while(0);if(((q|0)==143?k>>>0<2147483647:0)?(t=JO(k)|0,p=JO(0)|0,r=p-t|0,s=r>>>0>(m+40|0)>>>0,!((t|0)==(-1|0)|s^1|t>>>0

    Barcode marker example with Three.js

    +

    On Chrome on Android, tap the screen to start playing video stream.

    +

    Show 3x3 marker id 20 to camera to display a colorful sphere on top of it. Tap the sphere to rotate it. + +

    Back to examples

    + + + + + + + + + + diff --git a/jsartoolkit5/examples/boilerplate_threejs.html b/jsartoolkit5/examples/boilerplate_threejs.html new file mode 100644 index 0000000..514d4b4 --- /dev/null +++ b/jsartoolkit5/examples/boilerplate_threejs.html @@ -0,0 +1,151 @@ + + + + + + + diff --git a/jsartoolkit5/examples/css/index.css b/jsartoolkit5/examples/css/index.css new file mode 100644 index 0000000..aebee30 --- /dev/null +++ b/jsartoolkit5/examples/css/index.css @@ -0,0 +1,27 @@ +body { + margin: 1em; + padding: 0; + height: 100%; + width: 100%; + font-family: sans-serif; + font-size: 1.5em; + background-color: #eee; + color: #023962; +} + +ul, ol { + list-style: none; +} + +li { + margin-top: 1em; +} + +a { + color: inherit; +} + +a:hover { + background-color: #023962; + color: white; +} diff --git a/jsartoolkit5/examples/css/main.css b/jsartoolkit5/examples/css/main.css new file mode 100644 index 0000000..384c6e6 --- /dev/null +++ b/jsartoolkit5/examples/css/main.css @@ -0,0 +1,10 @@ +html, +body +{ + width: 100%; + height: 100%; + margin: 0; +} + +canvas { +} diff --git a/jsartoolkit5/examples/css/style.css b/jsartoolkit5/examples/css/style.css new file mode 100644 index 0000000..19a8e90 --- /dev/null +++ b/jsartoolkit5/examples/css/style.css @@ -0,0 +1,40 @@ +.grey-cover { + width: 100%; + height: 100%; + z-index: 999; + position: absolute; + top: 0; + left: 0; + background-color: rgba(0, 0, 0, 0.6); +} + +.loading { + width: 100%; + position: absolute; + top: 10%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 100%; + z-index: 99999; + height: 40%; +} + +.loading-text { + margin-top: 10px; + color: white; + font-weight: bold; +} + +.loading img { + height: 5em; +} + +#video { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} diff --git a/jsartoolkit5/examples/css/video-style.css b/jsartoolkit5/examples/css/video-style.css new file mode 100644 index 0000000..e3c2c8c --- /dev/null +++ b/jsartoolkit5/examples/css/video-style.css @@ -0,0 +1,112 @@ +html, +body { + margin: 0; + overflow: hidden; +} + +html { + font-family: sans-serif; +} + +#loading { + width: 100%; + position: absolute; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.45); + z-index: 9999999; +} + +#loading img { + height: 5em; +} + +#loading span{ + color: black; + font-weight: bold; +} + +.ui { + position: fixed; + + margin: 0.5rem; + + background-color: rgba( 255,255,255,0.6 ); + border-radius: 6px; +} + +.stats { + top: 0; + left: 0; + z-index: 200; + margin: 0.5rem; + padding: 0.5rem 0.5rem 0; +} + +.stats-item { + margin: 0 0 0.5rem; + +} + +.stats-item-title { + margin: 0 0 0.25rem; + + font-size: 0.75rem; +} + +#stats div { + position: relative !important; +} + +.marker { + right: 0; + bottom: 0; + z-index: 200; + margin: 0.5rem; + padding: 0.25rem 0.5rem; + + font-size: 0.75rem; + color: inherit; + text-decoration: none; +} + +#app { + position: fixed; + top: 0; + left: 0; + + width: 100%; + height: 100%; +} + +#video { + position: absolute; + top: 0; + left: 0; + + display: block; + width: 100% !important; + height: 100% !important; + object-fit: cover; +} + +#canvas { + position: absolute; + left: 0; + top: 0; + z-index: 100; + + display: block; + width: 100% !important; + height: 100% !important; + object-fit: cover; +} + + +#arvideo { + display: none; +} diff --git a/jsartoolkit5/examples/index.html b/jsartoolkit5/examples/index.html new file mode 100644 index 0000000..74d686a --- /dev/null +++ b/jsartoolkit5/examples/index.html @@ -0,0 +1,157 @@ + + + + + + + JSARToolKit5 examples + + + + + +

    Three.js examples

    + +
    + + Barcode tracking + +

    Uses device camera. +

    Use 3x3 marker id 20 +

    + +
    + + Pattern marker tracking + +

    Uses device camera. +

    Use Hiro pattern and Kanji pattern +

    + + + + + + + +
    + + Three.js example without helper API + +

    Uses pre-recorded video. +

    Not interactive. Draws a cube on top of last detected marker square. +

    + +

    Babylon.js examples

    + +
    + + Babylon.js example without helper API + +

    Uses pre-recorded video. +

    Not interactive. Draws a cube on top of last detected marker square. +

    + +

    NFT Examples

    + +
    + + nft examples by misdake + +

    nft improved worker examples by misdake +

    + +

    Canvas debug examples

    + +
    + + Image debug marker detection + +

    Runs AR marker detection on images. +

    Not interactive. +

    + +
    + + Video debug marker detection + +

    Uses pre-recorded video. +

    Not interactive. +

    + +
    + + Camera debug marker detection + +

    Uses device camera. +

    Displays detected potential marker squares in debug output. +

    + +

    Wasm esamples

    + +
    + + Image debug marker detection with Wasm + +

    Runs AR marker detection on images (with Wasm). +

    Not interactive. +

    + +
    + + Video debug marker detection with Wasm + +

    Uses pre-recorded video (with Wasm). +

    Not interactive. +

    + +
    + + nft with threejs and Wasm + +

    Using NFT with three.js and Wasm (and no webworker) +

    Use this Pinball image + as marker. +

    + + + + + + diff --git a/jsartoolkit5/examples/intro_example.html b/jsartoolkit5/examples/intro_example.html new file mode 100644 index 0000000..8c6570e --- /dev/null +++ b/jsartoolkit5/examples/intro_example.html @@ -0,0 +1,233 @@ + + +Box demo with Three.js + + + + + +

    Box demo with Three.js

    +

    On Chrome on Android, tap the screen to start playing video stream.

    +

    Show 3x3 marker id 20 to camera to display a box on top of it. Tap the box to open it. + + +

    Back to examples

    + + + + + + + + + diff --git a/jsartoolkit5/examples/js/third_party/babylon.js/babylon.2.5.max.js b/jsartoolkit5/examples/js/third_party/babylon.js/babylon.2.5.max.js new file mode 100644 index 0000000..d13be9d --- /dev/null +++ b/jsartoolkit5/examples/js/third_party/babylon.js/babylon.2.5.max.js @@ -0,0 +1,55721 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { +var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; +if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); +else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; +return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __extends = (this && this.__extends) || function (d, b) { +for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; +function __() { this.constructor = d; } +__.prototype = b.prototype; +d.prototype = new __(); +}; +var BABYLON; +(function (BABYLON) { + BABYLON.ToGammaSpace = 1 / 2.2; + BABYLON.ToLinearSpace = 2.2; + BABYLON.Epsilon = 0.001; + var MathTools = (function () { + function MathTools() { + } + MathTools.WithinEpsilon = function (a, b, epsilon) { + if (epsilon === void 0) { epsilon = 1.401298E-45; } + var num = a - b; + return -epsilon <= num && num <= epsilon; + }; + MathTools.ToHex = function (i) { + var str = i.toString(16); + if (i <= 15) { + return ("0" + str).toUpperCase(); + } + return str.toUpperCase(); + }; + // Returns -1 when value is a negative number and + // +1 when value is a positive number. + MathTools.Sign = function (value) { + value = +value; // convert to a number + if (value === 0 || isNaN(value)) + return value; + return value > 0 ? 1 : -1; + }; + MathTools.Clamp = function (value, min, max) { + if (min === void 0) { min = 0; } + if (max === void 0) { max = 1; } + return Math.min(max, Math.max(min, value)); + }; + return MathTools; + }()); + BABYLON.MathTools = MathTools; + var Color3 = (function () { + function Color3(r, g, b) { + if (r === void 0) { r = 0; } + if (g === void 0) { g = 0; } + if (b === void 0) { b = 0; } + this.r = r; + this.g = g; + this.b = b; + } + Color3.prototype.toString = function () { + return "{R: " + this.r + " G:" + this.g + " B:" + this.b + "}"; + }; + Color3.prototype.getClassName = function () { + return "Color3"; + }; + Color3.prototype.getHashCode = function () { + var hash = this.r || 0; + hash = (hash * 397) ^ (this.g || 0); + hash = (hash * 397) ^ (this.b || 0); + return hash; + }; + // Operators + Color3.prototype.toArray = function (array, index) { + if (index === undefined) { + index = 0; + } + array[index] = this.r; + array[index + 1] = this.g; + array[index + 2] = this.b; + return this; + }; + Color3.prototype.toColor4 = function (alpha) { + if (alpha === void 0) { alpha = 1; } + return new Color4(this.r, this.g, this.b, alpha); + }; + Color3.prototype.asArray = function () { + var result = []; + this.toArray(result, 0); + return result; + }; + Color3.prototype.toLuminance = function () { + return this.r * 0.3 + this.g * 0.59 + this.b * 0.11; + }; + Color3.prototype.multiply = function (otherColor) { + return new Color3(this.r * otherColor.r, this.g * otherColor.g, this.b * otherColor.b); + }; + Color3.prototype.multiplyToRef = function (otherColor, result) { + result.r = this.r * otherColor.r; + result.g = this.g * otherColor.g; + result.b = this.b * otherColor.b; + return this; + }; + Color3.prototype.equals = function (otherColor) { + return otherColor && this.r === otherColor.r && this.g === otherColor.g && this.b === otherColor.b; + }; + Color3.prototype.equalsFloats = function (r, g, b) { + return this.r === r && this.g === g && this.b === b; + }; + Color3.prototype.scale = function (scale) { + return new Color3(this.r * scale, this.g * scale, this.b * scale); + }; + Color3.prototype.scaleToRef = function (scale, result) { + result.r = this.r * scale; + result.g = this.g * scale; + result.b = this.b * scale; + return this; + }; + Color3.prototype.add = function (otherColor) { + return new Color3(this.r + otherColor.r, this.g + otherColor.g, this.b + otherColor.b); + }; + Color3.prototype.addToRef = function (otherColor, result) { + result.r = this.r + otherColor.r; + result.g = this.g + otherColor.g; + result.b = this.b + otherColor.b; + return this; + }; + Color3.prototype.subtract = function (otherColor) { + return new Color3(this.r - otherColor.r, this.g - otherColor.g, this.b - otherColor.b); + }; + Color3.prototype.subtractToRef = function (otherColor, result) { + result.r = this.r - otherColor.r; + result.g = this.g - otherColor.g; + result.b = this.b - otherColor.b; + return this; + }; + Color3.prototype.clone = function () { + return new Color3(this.r, this.g, this.b); + }; + Color3.prototype.copyFrom = function (source) { + this.r = source.r; + this.g = source.g; + this.b = source.b; + return this; + }; + Color3.prototype.copyFromFloats = function (r, g, b) { + this.r = r; + this.g = g; + this.b = b; + return this; + }; + Color3.prototype.toHexString = function () { + var intR = (this.r * 255) | 0; + var intG = (this.g * 255) | 0; + var intB = (this.b * 255) | 0; + return "#" + MathTools.ToHex(intR) + MathTools.ToHex(intG) + MathTools.ToHex(intB); + }; + Color3.prototype.toLinearSpace = function () { + var convertedColor = new Color3(); + this.toLinearSpaceToRef(convertedColor); + return convertedColor; + }; + Color3.prototype.toLinearSpaceToRef = function (convertedColor) { + convertedColor.r = Math.pow(this.r, BABYLON.ToLinearSpace); + convertedColor.g = Math.pow(this.g, BABYLON.ToLinearSpace); + convertedColor.b = Math.pow(this.b, BABYLON.ToLinearSpace); + return this; + }; + Color3.prototype.toGammaSpace = function () { + var convertedColor = new Color3(); + this.toGammaSpaceToRef(convertedColor); + return convertedColor; + }; + Color3.prototype.toGammaSpaceToRef = function (convertedColor) { + convertedColor.r = Math.pow(this.r, BABYLON.ToGammaSpace); + convertedColor.g = Math.pow(this.g, BABYLON.ToGammaSpace); + convertedColor.b = Math.pow(this.b, BABYLON.ToGammaSpace); + return this; + }; + // Statics + Color3.FromHexString = function (hex) { + if (hex.substring(0, 1) !== "#" || hex.length !== 7) { + //Tools.Warn("Color3.FromHexString must be called with a string like #FFFFFF"); + return new Color3(0, 0, 0); + } + var r = parseInt(hex.substring(1, 3), 16); + var g = parseInt(hex.substring(3, 5), 16); + var b = parseInt(hex.substring(5, 7), 16); + return Color3.FromInts(r, g, b); + }; + Color3.FromArray = function (array, offset) { + if (offset === void 0) { offset = 0; } + return new Color3(array[offset], array[offset + 1], array[offset + 2]); + }; + Color3.FromInts = function (r, g, b) { + return new Color3(r / 255.0, g / 255.0, b / 255.0); + }; + Color3.Lerp = function (start, end, amount) { + var r = start.r + ((end.r - start.r) * amount); + var g = start.g + ((end.g - start.g) * amount); + var b = start.b + ((end.b - start.b) * amount); + return new Color3(r, g, b); + }; + Color3.Red = function () { return new Color3(1, 0, 0); }; + Color3.Green = function () { return new Color3(0, 1, 0); }; + Color3.Blue = function () { return new Color3(0, 0, 1); }; + Color3.Black = function () { return new Color3(0, 0, 0); }; + Color3.White = function () { return new Color3(1, 1, 1); }; + Color3.Purple = function () { return new Color3(0.5, 0, 0.5); }; + Color3.Magenta = function () { return new Color3(1, 0, 1); }; + Color3.Yellow = function () { return new Color3(1, 1, 0); }; + Color3.Gray = function () { return new Color3(0.5, 0.5, 0.5); }; + return Color3; + }()); + BABYLON.Color3 = Color3; + var Color4 = (function () { + function Color4(r, g, b, a) { + this.r = r; + this.g = g; + this.b = b; + this.a = a; + } + // Operators + Color4.prototype.addInPlace = function (right) { + this.r += right.r; + this.g += right.g; + this.b += right.b; + this.a += right.a; + return this; + }; + Color4.prototype.asArray = function () { + var result = []; + this.toArray(result, 0); + return result; + }; + Color4.prototype.toArray = function (array, index) { + if (index === undefined) { + index = 0; + } + array[index] = this.r; + array[index + 1] = this.g; + array[index + 2] = this.b; + array[index + 3] = this.a; + return this; + }; + Color4.prototype.add = function (right) { + return new Color4(this.r + right.r, this.g + right.g, this.b + right.b, this.a + right.a); + }; + Color4.prototype.subtract = function (right) { + return new Color4(this.r - right.r, this.g - right.g, this.b - right.b, this.a - right.a); + }; + Color4.prototype.subtractToRef = function (right, result) { + result.r = this.r - right.r; + result.g = this.g - right.g; + result.b = this.b - right.b; + result.a = this.a - right.a; + return this; + }; + Color4.prototype.scale = function (scale) { + return new Color4(this.r * scale, this.g * scale, this.b * scale, this.a * scale); + }; + Color4.prototype.scaleToRef = function (scale, result) { + result.r = this.r * scale; + result.g = this.g * scale; + result.b = this.b * scale; + result.a = this.a * scale; + return this; + }; + /** + * Multipy an RGBA Color4 value by another and return a new Color4 object + * @param color The Color4 (RGBA) value to multiply by + * @returns A new Color4. + */ + Color4.prototype.multiply = function (color) { + return new Color4(this.r * color.r, this.g * color.g, this.b * color.b, this.a * color.a); + }; + /** + * Multipy an RGBA Color4 value by another and push the result in a reference value + * @param color The Color4 (RGBA) value to multiply by + * @param result The Color4 (RGBA) to fill the result in + * @returns the result Color4. + */ + Color4.prototype.multiplyToRef = function (color, result) { + result.r = this.r * color.r; + result.g = this.g * color.g; + result.b = this.b * color.b; + result.a = this.a * color.a; + return result; + }; + Color4.prototype.toString = function () { + return "{R: " + this.r + " G:" + this.g + " B:" + this.b + " A:" + this.a + "}"; + }; + Color4.prototype.getClassName = function () { + return "Color4"; + }; + Color4.prototype.getHashCode = function () { + var hash = this.r || 0; + hash = (hash * 397) ^ (this.g || 0); + hash = (hash * 397) ^ (this.b || 0); + hash = (hash * 397) ^ (this.a || 0); + return hash; + }; + Color4.prototype.clone = function () { + return new Color4(this.r, this.g, this.b, this.a); + }; + Color4.prototype.copyFrom = function (source) { + this.r = source.r; + this.g = source.g; + this.b = source.b; + this.a = source.a; + return this; + }; + Color4.prototype.toHexString = function () { + var intR = (this.r * 255) | 0; + var intG = (this.g * 255) | 0; + var intB = (this.b * 255) | 0; + var intA = (this.a * 255) | 0; + return "#" + MathTools.ToHex(intR) + MathTools.ToHex(intG) + MathTools.ToHex(intB) + MathTools.ToHex(intA); + }; + // Statics + Color4.FromHexString = function (hex) { + if (hex.substring(0, 1) !== "#" || hex.length !== 9) { + //Tools.Warn("Color4.FromHexString must be called with a string like #FFFFFFFF"); + return new Color4(0, 0, 0, 0); + } + var r = parseInt(hex.substring(1, 3), 16); + var g = parseInt(hex.substring(3, 5), 16); + var b = parseInt(hex.substring(5, 7), 16); + var a = parseInt(hex.substring(7, 9), 16); + return Color4.FromInts(r, g, b, a); + }; + Color4.Lerp = function (left, right, amount) { + var result = new Color4(0, 0, 0, 0); + Color4.LerpToRef(left, right, amount, result); + return result; + }; + Color4.LerpToRef = function (left, right, amount, result) { + result.r = left.r + (right.r - left.r) * amount; + result.g = left.g + (right.g - left.g) * amount; + result.b = left.b + (right.b - left.b) * amount; + result.a = left.a + (right.a - left.a) * amount; + }; + Color4.FromArray = function (array, offset) { + if (offset === void 0) { offset = 0; } + return new Color4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]); + }; + Color4.FromInts = function (r, g, b, a) { + return new Color4(r / 255.0, g / 255.0, b / 255.0, a / 255.0); + }; + Color4.CheckColors4 = function (colors, count) { + // Check if color3 was used + if (colors.length === count * 3) { + var colors4 = []; + for (var index = 0; index < colors.length; index += 3) { + var newIndex = (index / 3) * 4; + colors4[newIndex] = colors[index]; + colors4[newIndex + 1] = colors[index + 1]; + colors4[newIndex + 2] = colors[index + 2]; + colors4[newIndex + 3] = 1.0; + } + return colors4; + } + return colors; + }; + return Color4; + }()); + BABYLON.Color4 = Color4; + var Vector2 = (function () { + function Vector2(x, y) { + this.x = x; + this.y = y; + } + Vector2.prototype.toString = function () { + return "{X: " + this.x + " Y:" + this.y + "}"; + }; + Vector2.prototype.getClassName = function () { + return "Vector2"; + }; + Vector2.prototype.getHashCode = function () { + var hash = this.x || 0; + hash = (hash * 397) ^ (this.y || 0); + return hash; + }; + // Operators + Vector2.prototype.toArray = function (array, index) { + if (index === void 0) { index = 0; } + array[index] = this.x; + array[index + 1] = this.y; + return this; + }; + Vector2.prototype.asArray = function () { + var result = []; + this.toArray(result, 0); + return result; + }; + Vector2.prototype.copyFrom = function (source) { + this.x = source.x; + this.y = source.y; + return this; + }; + Vector2.prototype.copyFromFloats = function (x, y) { + this.x = x; + this.y = y; + return this; + }; + Vector2.prototype.add = function (otherVector) { + return new Vector2(this.x + otherVector.x, this.y + otherVector.y); + }; + Vector2.prototype.addToRef = function (otherVector, result) { + result.x = this.x + otherVector.x; + result.y = this.y + otherVector.y; + return this; + }; + Vector2.prototype.addInPlace = function (otherVector) { + this.x += otherVector.x; + this.y += otherVector.y; + return this; + }; + Vector2.prototype.addVector3 = function (otherVector) { + return new Vector2(this.x + otherVector.x, this.y + otherVector.y); + }; + Vector2.prototype.subtract = function (otherVector) { + return new Vector2(this.x - otherVector.x, this.y - otherVector.y); + }; + Vector2.prototype.subtractToRef = function (otherVector, result) { + result.x = this.x - otherVector.x; + result.y = this.y - otherVector.y; + return this; + }; + Vector2.prototype.subtractInPlace = function (otherVector) { + this.x -= otherVector.x; + this.y -= otherVector.y; + return this; + }; + Vector2.prototype.multiplyInPlace = function (otherVector) { + this.x *= otherVector.x; + this.y *= otherVector.y; + return this; + }; + Vector2.prototype.multiply = function (otherVector) { + return new Vector2(this.x * otherVector.x, this.y * otherVector.y); + }; + Vector2.prototype.multiplyToRef = function (otherVector, result) { + result.x = this.x * otherVector.x; + result.y = this.y * otherVector.y; + return this; + }; + Vector2.prototype.multiplyByFloats = function (x, y) { + return new Vector2(this.x * x, this.y * y); + }; + Vector2.prototype.divide = function (otherVector) { + return new Vector2(this.x / otherVector.x, this.y / otherVector.y); + }; + Vector2.prototype.divideToRef = function (otherVector, result) { + result.x = this.x / otherVector.x; + result.y = this.y / otherVector.y; + return this; + }; + Vector2.prototype.negate = function () { + return new Vector2(-this.x, -this.y); + }; + Vector2.prototype.scaleInPlace = function (scale) { + this.x *= scale; + this.y *= scale; + return this; + }; + Vector2.prototype.scale = function (scale) { + return new Vector2(this.x * scale, this.y * scale); + }; + Vector2.prototype.equals = function (otherVector) { + return otherVector && this.x === otherVector.x && this.y === otherVector.y; + }; + Vector2.prototype.equalsWithEpsilon = function (otherVector, epsilon) { + if (epsilon === void 0) { epsilon = BABYLON.Epsilon; } + return otherVector && MathTools.WithinEpsilon(this.x, otherVector.x, epsilon) && MathTools.WithinEpsilon(this.y, otherVector.y, epsilon); + }; + // Properties + Vector2.prototype.length = function () { + return Math.sqrt(this.x * this.x + this.y * this.y); + }; + Vector2.prototype.lengthSquared = function () { + return (this.x * this.x + this.y * this.y); + }; + // Methods + Vector2.prototype.normalize = function () { + var len = this.length(); + if (len === 0) + return this; + var num = 1.0 / len; + this.x *= num; + this.y *= num; + return this; + }; + Vector2.prototype.clone = function () { + return new Vector2(this.x, this.y); + }; + // Statics + Vector2.Zero = function () { + return new Vector2(0, 0); + }; + Vector2.FromArray = function (array, offset) { + if (offset === void 0) { offset = 0; } + return new Vector2(array[offset], array[offset + 1]); + }; + Vector2.FromArrayToRef = function (array, offset, result) { + result.x = array[offset]; + result.y = array[offset + 1]; + }; + Vector2.CatmullRom = function (value1, value2, value3, value4, amount) { + var squared = amount * amount; + var cubed = amount * squared; + var x = 0.5 * ((((2.0 * value2.x) + ((-value1.x + value3.x) * amount)) + + (((((2.0 * value1.x) - (5.0 * value2.x)) + (4.0 * value3.x)) - value4.x) * squared)) + + ((((-value1.x + (3.0 * value2.x)) - (3.0 * value3.x)) + value4.x) * cubed)); + var y = 0.5 * ((((2.0 * value2.y) + ((-value1.y + value3.y) * amount)) + + (((((2.0 * value1.y) - (5.0 * value2.y)) + (4.0 * value3.y)) - value4.y) * squared)) + + ((((-value1.y + (3.0 * value2.y)) - (3.0 * value3.y)) + value4.y) * cubed)); + return new Vector2(x, y); + }; + Vector2.Clamp = function (value, min, max) { + var x = value.x; + x = (x > max.x) ? max.x : x; + x = (x < min.x) ? min.x : x; + var y = value.y; + y = (y > max.y) ? max.y : y; + y = (y < min.y) ? min.y : y; + return new Vector2(x, y); + }; + Vector2.Hermite = function (value1, tangent1, value2, tangent2, amount) { + var squared = amount * amount; + var cubed = amount * squared; + var part1 = ((2.0 * cubed) - (3.0 * squared)) + 1.0; + var part2 = (-2.0 * cubed) + (3.0 * squared); + var part3 = (cubed - (2.0 * squared)) + amount; + var part4 = cubed - squared; + var x = (((value1.x * part1) + (value2.x * part2)) + (tangent1.x * part3)) + (tangent2.x * part4); + var y = (((value1.y * part1) + (value2.y * part2)) + (tangent1.y * part3)) + (tangent2.y * part4); + return new Vector2(x, y); + }; + Vector2.Lerp = function (start, end, amount) { + var x = start.x + ((end.x - start.x) * amount); + var y = start.y + ((end.y - start.y) * amount); + return new Vector2(x, y); + }; + Vector2.Dot = function (left, right) { + return left.x * right.x + left.y * right.y; + }; + Vector2.Normalize = function (vector) { + var newVector = vector.clone(); + newVector.normalize(); + return newVector; + }; + Vector2.Minimize = function (left, right) { + var x = (left.x < right.x) ? left.x : right.x; + var y = (left.y < right.y) ? left.y : right.y; + return new Vector2(x, y); + }; + Vector2.Maximize = function (left, right) { + var x = (left.x > right.x) ? left.x : right.x; + var y = (left.y > right.y) ? left.y : right.y; + return new Vector2(x, y); + }; + Vector2.Transform = function (vector, transformation) { + var r = Vector2.Zero(); + Vector2.TransformToRef(vector, transformation, r); + return r; + }; + Vector2.TransformToRef = function (vector, transformation, result) { + var x = (vector.x * transformation.m[0]) + (vector.y * transformation.m[4]) + transformation.m[12]; + var y = (vector.x * transformation.m[1]) + (vector.y * transformation.m[5]) + transformation.m[13]; + result.x = x; + result.y = y; + }; + Vector2.PointInTriangle = function (p, p0, p1, p2) { + var a = 1 / 2 * (-p1.y * p2.x + p0.y * (-p1.x + p2.x) + p0.x * (p1.y - p2.y) + p1.x * p2.y); + var sign = a < 0 ? -1 : 1; + var s = (p0.y * p2.x - p0.x * p2.y + (p2.y - p0.y) * p.x + (p0.x - p2.x) * p.y) * sign; + var t = (p0.x * p1.y - p0.y * p1.x + (p0.y - p1.y) * p.x + (p1.x - p0.x) * p.y) * sign; + return s > 0 && t > 0 && (s + t) < 2 * a * sign; + }; + Vector2.Distance = function (value1, value2) { + return Math.sqrt(Vector2.DistanceSquared(value1, value2)); + }; + Vector2.DistanceSquared = function (value1, value2) { + var x = value1.x - value2.x; + var y = value1.y - value2.y; + return (x * x) + (y * y); + }; + Vector2.Center = function (value1, value2) { + var center = value1.add(value2); + center.scaleInPlace(0.5); + return center; + }; + Vector2.DistanceOfPointFromSegment = function (p, segA, segB) { + var l2 = Vector2.DistanceSquared(segA, segB); + if (l2 === 0.0) { + return Vector2.Distance(p, segA); + } + var v = segB.subtract(segA); + var t = Math.max(0, Math.min(1, Vector2.Dot(p.subtract(segA), v) / l2)); + var proj = segA.add(v.multiplyByFloats(t, t)); + return Vector2.Distance(p, proj); + }; + return Vector2; + }()); + BABYLON.Vector2 = Vector2; + var Vector3 = (function () { + function Vector3(x, y, z) { + this.x = x; + this.y = y; + this.z = z; + } + Vector3.prototype.toString = function () { + return "{X: " + this.x + " Y:" + this.y + " Z:" + this.z + "}"; + }; + Vector3.prototype.getClassName = function () { + return "Vector3"; + }; + Vector3.prototype.getHashCode = function () { + var hash = this.x || 0; + hash = (hash * 397) ^ (this.y || 0); + hash = (hash * 397) ^ (this.z || 0); + return hash; + }; + // Operators + Vector3.prototype.asArray = function () { + var result = []; + this.toArray(result, 0); + return result; + }; + Vector3.prototype.toArray = function (array, index) { + if (index === void 0) { index = 0; } + array[index] = this.x; + array[index + 1] = this.y; + array[index + 2] = this.z; + return this; + }; + Vector3.prototype.toQuaternion = function () { + var result = new Quaternion(0, 0, 0, 1); + var cosxPlusz = Math.cos((this.x + this.z) * 0.5); + var sinxPlusz = Math.sin((this.x + this.z) * 0.5); + var coszMinusx = Math.cos((this.z - this.x) * 0.5); + var sinzMinusx = Math.sin((this.z - this.x) * 0.5); + var cosy = Math.cos(this.y * 0.5); + var siny = Math.sin(this.y * 0.5); + result.x = coszMinusx * siny; + result.y = -sinzMinusx * siny; + result.z = sinxPlusz * cosy; + result.w = cosxPlusz * cosy; + return result; + }; + Vector3.prototype.addInPlace = function (otherVector) { + this.x += otherVector.x; + this.y += otherVector.y; + this.z += otherVector.z; + return this; + }; + Vector3.prototype.add = function (otherVector) { + return new Vector3(this.x + otherVector.x, this.y + otherVector.y, this.z + otherVector.z); + }; + Vector3.prototype.addToRef = function (otherVector, result) { + result.x = this.x + otherVector.x; + result.y = this.y + otherVector.y; + result.z = this.z + otherVector.z; + return this; + }; + Vector3.prototype.subtractInPlace = function (otherVector) { + this.x -= otherVector.x; + this.y -= otherVector.y; + this.z -= otherVector.z; + return this; + }; + Vector3.prototype.subtract = function (otherVector) { + return new Vector3(this.x - otherVector.x, this.y - otherVector.y, this.z - otherVector.z); + }; + Vector3.prototype.subtractToRef = function (otherVector, result) { + result.x = this.x - otherVector.x; + result.y = this.y - otherVector.y; + result.z = this.z - otherVector.z; + return this; + }; + Vector3.prototype.subtractFromFloats = function (x, y, z) { + return new Vector3(this.x - x, this.y - y, this.z - z); + }; + Vector3.prototype.subtractFromFloatsToRef = function (x, y, z, result) { + result.x = this.x - x; + result.y = this.y - y; + result.z = this.z - z; + return this; + }; + Vector3.prototype.negate = function () { + return new Vector3(-this.x, -this.y, -this.z); + }; + Vector3.prototype.scaleInPlace = function (scale) { + this.x *= scale; + this.y *= scale; + this.z *= scale; + return this; + }; + Vector3.prototype.scale = function (scale) { + return new Vector3(this.x * scale, this.y * scale, this.z * scale); + }; + Vector3.prototype.scaleToRef = function (scale, result) { + result.x = this.x * scale; + result.y = this.y * scale; + result.z = this.z * scale; + }; + Vector3.prototype.equals = function (otherVector) { + return otherVector && this.x === otherVector.x && this.y === otherVector.y && this.z === otherVector.z; + }; + Vector3.prototype.equalsWithEpsilon = function (otherVector, epsilon) { + if (epsilon === void 0) { epsilon = BABYLON.Epsilon; } + return otherVector && MathTools.WithinEpsilon(this.x, otherVector.x, epsilon) && MathTools.WithinEpsilon(this.y, otherVector.y, epsilon) && MathTools.WithinEpsilon(this.z, otherVector.z, epsilon); + }; + Vector3.prototype.equalsToFloats = function (x, y, z) { + return this.x === x && this.y === y && this.z === z; + }; + Vector3.prototype.multiplyInPlace = function (otherVector) { + this.x *= otherVector.x; + this.y *= otherVector.y; + this.z *= otherVector.z; + return this; + }; + Vector3.prototype.multiply = function (otherVector) { + return new Vector3(this.x * otherVector.x, this.y * otherVector.y, this.z * otherVector.z); + }; + Vector3.prototype.multiplyToRef = function (otherVector, result) { + result.x = this.x * otherVector.x; + result.y = this.y * otherVector.y; + result.z = this.z * otherVector.z; + return this; + }; + Vector3.prototype.multiplyByFloats = function (x, y, z) { + return new Vector3(this.x * x, this.y * y, this.z * z); + }; + Vector3.prototype.divide = function (otherVector) { + return new Vector3(this.x / otherVector.x, this.y / otherVector.y, this.z / otherVector.z); + }; + Vector3.prototype.divideToRef = function (otherVector, result) { + result.x = this.x / otherVector.x; + result.y = this.y / otherVector.y; + result.z = this.z / otherVector.z; + return this; + }; + Vector3.prototype.MinimizeInPlace = function (other) { + if (other.x < this.x) + this.x = other.x; + if (other.y < this.y) + this.y = other.y; + if (other.z < this.z) + this.z = other.z; + return this; + }; + Vector3.prototype.MaximizeInPlace = function (other) { + if (other.x > this.x) + this.x = other.x; + if (other.y > this.y) + this.y = other.y; + if (other.z > this.z) + this.z = other.z; + return this; + }; + // Properties + Vector3.prototype.length = function () { + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + }; + Vector3.prototype.lengthSquared = function () { + return (this.x * this.x + this.y * this.y + this.z * this.z); + }; + // Methods + Vector3.prototype.normalize = function () { + var len = this.length(); + if (len === 0 || len === 1.0) + return this; + var num = 1.0 / len; + this.x *= num; + this.y *= num; + this.z *= num; + return this; + }; + Vector3.prototype.clone = function () { + return new Vector3(this.x, this.y, this.z); + }; + Vector3.prototype.copyFrom = function (source) { + this.x = source.x; + this.y = source.y; + this.z = source.z; + return this; + }; + Vector3.prototype.copyFromFloats = function (x, y, z) { + this.x = x; + this.y = y; + this.z = z; + return this; + }; + // Statics + Vector3.GetClipFactor = function (vector0, vector1, axis, size) { + var d0 = Vector3.Dot(vector0, axis) - size; + var d1 = Vector3.Dot(vector1, axis) - size; + var s = d0 / (d0 - d1); + return s; + }; + Vector3.FromArray = function (array, offset) { + if (!offset) { + offset = 0; + } + return new Vector3(array[offset], array[offset + 1], array[offset + 2]); + }; + Vector3.FromFloatArray = function (array, offset) { + if (!offset) { + offset = 0; + } + return new Vector3(array[offset], array[offset + 1], array[offset + 2]); + }; + Vector3.FromArrayToRef = function (array, offset, result) { + result.x = array[offset]; + result.y = array[offset + 1]; + result.z = array[offset + 2]; + }; + Vector3.FromFloatArrayToRef = function (array, offset, result) { + result.x = array[offset]; + result.y = array[offset + 1]; + result.z = array[offset + 2]; + }; + Vector3.FromFloatsToRef = function (x, y, z, result) { + result.x = x; + result.y = y; + result.z = z; + }; + Vector3.Zero = function () { + return new Vector3(0, 0, 0); + }; + Vector3.Up = function () { + return new Vector3(0, 1.0, 0); + }; + Vector3.Forward = function () { + return new Vector3(0, 0, 1.0); + }; + Vector3.Right = function () { + return new Vector3(1.0, 0, 0); + }; + Vector3.Left = function () { + return new Vector3(-1.0, 0, 0); + }; + Vector3.TransformCoordinates = function (vector, transformation) { + var result = Vector3.Zero(); + Vector3.TransformCoordinatesToRef(vector, transformation, result); + return result; + }; + Vector3.TransformCoordinatesToRef = function (vector, transformation, result) { + var x = (vector.x * transformation.m[0]) + (vector.y * transformation.m[4]) + (vector.z * transformation.m[8]) + transformation.m[12]; + var y = (vector.x * transformation.m[1]) + (vector.y * transformation.m[5]) + (vector.z * transformation.m[9]) + transformation.m[13]; + var z = (vector.x * transformation.m[2]) + (vector.y * transformation.m[6]) + (vector.z * transformation.m[10]) + transformation.m[14]; + var w = (vector.x * transformation.m[3]) + (vector.y * transformation.m[7]) + (vector.z * transformation.m[11]) + transformation.m[15]; + result.x = x / w; + result.y = y / w; + result.z = z / w; + }; + Vector3.TransformCoordinatesFromFloatsToRef = function (x, y, z, transformation, result) { + var rx = (x * transformation.m[0]) + (y * transformation.m[4]) + (z * transformation.m[8]) + transformation.m[12]; + var ry = (x * transformation.m[1]) + (y * transformation.m[5]) + (z * transformation.m[9]) + transformation.m[13]; + var rz = (x * transformation.m[2]) + (y * transformation.m[6]) + (z * transformation.m[10]) + transformation.m[14]; + var rw = (x * transformation.m[3]) + (y * transformation.m[7]) + (z * transformation.m[11]) + transformation.m[15]; + result.x = rx / rw; + result.y = ry / rw; + result.z = rz / rw; + }; + Vector3.TransformNormal = function (vector, transformation) { + var result = Vector3.Zero(); + Vector3.TransformNormalToRef(vector, transformation, result); + return result; + }; + Vector3.TransformNormalToRef = function (vector, transformation, result) { + var x = (vector.x * transformation.m[0]) + (vector.y * transformation.m[4]) + (vector.z * transformation.m[8]); + var y = (vector.x * transformation.m[1]) + (vector.y * transformation.m[5]) + (vector.z * transformation.m[9]); + var z = (vector.x * transformation.m[2]) + (vector.y * transformation.m[6]) + (vector.z * transformation.m[10]); + result.x = x; + result.y = y; + result.z = z; + }; + Vector3.TransformNormalFromFloatsToRef = function (x, y, z, transformation, result) { + result.x = (x * transformation.m[0]) + (y * transformation.m[4]) + (z * transformation.m[8]); + result.y = (x * transformation.m[1]) + (y * transformation.m[5]) + (z * transformation.m[9]); + result.z = (x * transformation.m[2]) + (y * transformation.m[6]) + (z * transformation.m[10]); + }; + Vector3.CatmullRom = function (value1, value2, value3, value4, amount) { + var squared = amount * amount; + var cubed = amount * squared; + var x = 0.5 * ((((2.0 * value2.x) + ((-value1.x + value3.x) * amount)) + + (((((2.0 * value1.x) - (5.0 * value2.x)) + (4.0 * value3.x)) - value4.x) * squared)) + + ((((-value1.x + (3.0 * value2.x)) - (3.0 * value3.x)) + value4.x) * cubed)); + var y = 0.5 * ((((2.0 * value2.y) + ((-value1.y + value3.y) * amount)) + + (((((2.0 * value1.y) - (5.0 * value2.y)) + (4.0 * value3.y)) - value4.y) * squared)) + + ((((-value1.y + (3.0 * value2.y)) - (3.0 * value3.y)) + value4.y) * cubed)); + var z = 0.5 * ((((2.0 * value2.z) + ((-value1.z + value3.z) * amount)) + + (((((2.0 * value1.z) - (5.0 * value2.z)) + (4.0 * value3.z)) - value4.z) * squared)) + + ((((-value1.z + (3.0 * value2.z)) - (3.0 * value3.z)) + value4.z) * cubed)); + return new Vector3(x, y, z); + }; + Vector3.Clamp = function (value, min, max) { + var x = value.x; + x = (x > max.x) ? max.x : x; + x = (x < min.x) ? min.x : x; + var y = value.y; + y = (y > max.y) ? max.y : y; + y = (y < min.y) ? min.y : y; + var z = value.z; + z = (z > max.z) ? max.z : z; + z = (z < min.z) ? min.z : z; + return new Vector3(x, y, z); + }; + Vector3.Hermite = function (value1, tangent1, value2, tangent2, amount) { + var squared = amount * amount; + var cubed = amount * squared; + var part1 = ((2.0 * cubed) - (3.0 * squared)) + 1.0; + var part2 = (-2.0 * cubed) + (3.0 * squared); + var part3 = (cubed - (2.0 * squared)) + amount; + var part4 = cubed - squared; + var x = (((value1.x * part1) + (value2.x * part2)) + (tangent1.x * part3)) + (tangent2.x * part4); + var y = (((value1.y * part1) + (value2.y * part2)) + (tangent1.y * part3)) + (tangent2.y * part4); + var z = (((value1.z * part1) + (value2.z * part2)) + (tangent1.z * part3)) + (tangent2.z * part4); + return new Vector3(x, y, z); + }; + Vector3.Lerp = function (start, end, amount) { + var x = start.x + ((end.x - start.x) * amount); + var y = start.y + ((end.y - start.y) * amount); + var z = start.z + ((end.z - start.z) * amount); + return new Vector3(x, y, z); + }; + Vector3.Dot = function (left, right) { + return (left.x * right.x + left.y * right.y + left.z * right.z); + }; + Vector3.Cross = function (left, right) { + var result = Vector3.Zero(); + Vector3.CrossToRef(left, right, result); + return result; + }; + Vector3.CrossToRef = function (left, right, result) { + Tmp.Vector3[0].x = left.y * right.z - left.z * right.y; + Tmp.Vector3[0].y = left.z * right.x - left.x * right.z; + Tmp.Vector3[0].z = left.x * right.y - left.y * right.x; + result.copyFrom(Tmp.Vector3[0]); + }; + Vector3.Normalize = function (vector) { + var result = Vector3.Zero(); + Vector3.NormalizeToRef(vector, result); + return result; + }; + Vector3.NormalizeToRef = function (vector, result) { + result.copyFrom(vector); + result.normalize(); + }; + Vector3.Project = function (vector, world, transform, viewport) { + var cw = viewport.width; + var ch = viewport.height; + var cx = viewport.x; + var cy = viewport.y; + var viewportMatrix = Vector3._viewportMatrixCache ? Vector3._viewportMatrixCache : (Vector3._viewportMatrixCache = new Matrix()); + Matrix.FromValuesToRef(cw / 2.0, 0, 0, 0, 0, -ch / 2.0, 0, 0, 0, 0, 1, 0, cx + cw / 2.0, ch / 2.0 + cy, 0, 1, viewportMatrix); + var matrix = Vector3._matrixCache ? Vector3._matrixCache : (Vector3._matrixCache = new Matrix()); + world.multiplyToRef(transform, matrix); + matrix.multiplyToRef(viewportMatrix, matrix); + return Vector3.TransformCoordinates(vector, matrix); + }; + Vector3.UnprojectFromTransform = function (source, viewportWidth, viewportHeight, world, transform) { + var matrix = Vector3._matrixCache ? Vector3._matrixCache : (Vector3._matrixCache = new Matrix()); + world.multiplyToRef(transform, matrix); + matrix.invert(); + source.x = source.x / viewportWidth * 2 - 1; + source.y = -(source.y / viewportHeight * 2 - 1); + var vector = Vector3.TransformCoordinates(source, matrix); + var num = source.x * matrix.m[3] + source.y * matrix.m[7] + source.z * matrix.m[11] + matrix.m[15]; + if (MathTools.WithinEpsilon(num, 1.0)) { + vector = vector.scale(1.0 / num); + } + return vector; + }; + Vector3.Unproject = function (source, viewportWidth, viewportHeight, world, view, projection) { + var matrix = Vector3._matrixCache ? Vector3._matrixCache : (Vector3._matrixCache = new Matrix()); + world.multiplyToRef(view, matrix); + matrix.multiplyToRef(projection, matrix); + matrix.invert(); + var screenSource = new Vector3(source.x / viewportWidth * 2 - 1, -(source.y / viewportHeight * 2 - 1), source.z); + var vector = Vector3.TransformCoordinates(screenSource, matrix); + var num = screenSource.x * matrix.m[3] + screenSource.y * matrix.m[7] + screenSource.z * matrix.m[11] + matrix.m[15]; + if (MathTools.WithinEpsilon(num, 1.0)) { + vector = vector.scale(1.0 / num); + } + return vector; + }; + Vector3.Minimize = function (left, right) { + var min = left.clone(); + min.MinimizeInPlace(right); + return min; + }; + Vector3.Maximize = function (left, right) { + var max = left.clone(); + max.MaximizeInPlace(right); + return max; + }; + Vector3.Distance = function (value1, value2) { + return Math.sqrt(Vector3.DistanceSquared(value1, value2)); + }; + Vector3.DistanceSquared = function (value1, value2) { + var x = value1.x - value2.x; + var y = value1.y - value2.y; + var z = value1.z - value2.z; + return (x * x) + (y * y) + (z * z); + }; + Vector3.Center = function (value1, value2) { + var center = value1.add(value2); + center.scaleInPlace(0.5); + return center; + }; + /** + * Given three orthogonal normalized left-handed oriented Vector3 axis in space (target system), + * RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply + * to something in order to rotate it from its local system to the given target system. + */ + Vector3.RotationFromAxis = function (axis1, axis2, axis3) { + var rotation = Vector3.Zero(); + Vector3.RotationFromAxisToRef(axis1, axis2, axis3, rotation); + return rotation; + }; + /** + * The same than RotationFromAxis but updates the passed ref Vector3 parameter. + */ + Vector3.RotationFromAxisToRef = function (axis1, axis2, axis3, ref) { + var u = axis1.normalize(); + var w = axis3.normalize(); + // world axis + var X = Axis.X; + var Y = Axis.Y; + // equation unknowns and vars + var yaw = 0.0; + var pitch = 0.0; + var roll = 0.0; + var x = 0.0; + var y = 0.0; + var z = 0.0; + var t = 0.0; + var sign = -1.0; + var nbRevert = 0; + var cross = Tmp.Vector3[0]; + var dot = 0.0; + // step 1 : rotation around w + // Rv3(u) = u1, and u1 belongs to plane xOz + // Rv3(w) = w1 = w invariant + var u1 = Tmp.Vector3[1]; + if (MathTools.WithinEpsilon(w.z, 0, BABYLON.Epsilon)) { + z = 1.0; + } + else if (MathTools.WithinEpsilon(w.x, 0, BABYLON.Epsilon)) { + x = 1.0; + } + else { + t = w.z / w.x; + x = -t * Math.sqrt(1 / (1 + t * t)); + z = Math.sqrt(1 / (1 + t * t)); + } + u1.x = x; + u1.y = y; + u1.z = z; + u1.normalize(); + Vector3.CrossToRef(u, u1, cross); // returns same direction as w (=local z) if positive angle : cross(source, image) + cross.normalize(); + if (Vector3.Dot(w, cross) < 0) { + sign = 1.0; + } + dot = Vector3.Dot(u, u1); + dot = (Math.min(1.0, Math.max(-1.0, dot))); // to force dot to be in the range [-1, 1] + roll = Math.acos(dot) * sign; + if (Vector3.Dot(u1, X) < 0) { + roll = Math.PI + roll; + u1 = u1.scaleInPlace(-1); + nbRevert++; + } + // step 2 : rotate around u1 + // Ru1(w1) = Ru1(w) = w2, and w2 belongs to plane xOz + // u1 is yet in xOz and invariant by Ru1, so after this step u1 and w2 will be in xOz + var w2 = Tmp.Vector3[2]; + var v2 = Tmp.Vector3[3]; + x = 0.0; + y = 0.0; + z = 0.0; + sign = -1.0; + if (MathTools.WithinEpsilon(w.z, 0, BABYLON.Epsilon)) { + x = 1.0; + } + else { + t = u1.z / u1.x; + x = -t * Math.sqrt(1 / (1 + t * t)); + z = Math.sqrt(1 / (1 + t * t)); + } + w2.x = x; + w2.y = y; + w2.z = z; + w2.normalize(); + Vector3.CrossToRef(w2, u1, v2); // v2 image of v1 through rotation around u1 + v2.normalize(); + Vector3.CrossToRef(w, w2, cross); // returns same direction as u1 (=local x) if positive angle : cross(source, image) + cross.normalize(); + if (Vector3.Dot(u1, cross) < 0) { + sign = 1.0; + } + dot = Vector3.Dot(w, w2); + dot = (Math.min(1.0, Math.max(-1.0, dot))); // to force dot to be in the range [-1, 1] + pitch = Math.acos(dot) * sign; + if (Vector3.Dot(v2, Y) < 0) { + pitch = Math.PI + pitch; + nbRevert++; + } + // step 3 : rotate around v2 + // Rv2(u1) = X, same as Rv2(w2) = Z, with X=(1,0,0) and Z=(0,0,1) + sign = -1.0; + Vector3.CrossToRef(X, u1, cross); // returns same direction as Y if positive angle : cross(source, image) + cross.normalize(); + if (Vector3.Dot(cross, Y) < 0) { + sign = 1.0; + } + dot = Vector3.Dot(u1, X); + dot = (Math.min(1.0, Math.max(-1.0, dot))); // to force dot to be in the range [-1, 1] + yaw = -Math.acos(dot) * sign; // negative : plane zOx oriented clockwise + if (dot < 0 && nbRevert < 2) { + yaw = Math.PI + yaw; + } + ref.x = pitch; + ref.y = yaw; + ref.z = roll; + }; + return Vector3; + }()); + BABYLON.Vector3 = Vector3; + //Vector4 class created for EulerAngle class conversion to Quaternion + var Vector4 = (function () { + function Vector4(x, y, z, w) { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + Vector4.prototype.toString = function () { + return "{X: " + this.x + " Y:" + this.y + " Z:" + this.z + " W:" + this.w + "}"; + }; + Vector4.prototype.getClassName = function () { + return "Vector4"; + }; + Vector4.prototype.getHashCode = function () { + var hash = this.x || 0; + hash = (hash * 397) ^ (this.y || 0); + hash = (hash * 397) ^ (this.z || 0); + hash = (hash * 397) ^ (this.w || 0); + return hash; + }; + // Operators + Vector4.prototype.asArray = function () { + var result = []; + this.toArray(result, 0); + return result; + }; + Vector4.prototype.toArray = function (array, index) { + if (index === undefined) { + index = 0; + } + array[index] = this.x; + array[index + 1] = this.y; + array[index + 2] = this.z; + array[index + 3] = this.w; + return this; + }; + Vector4.prototype.addInPlace = function (otherVector) { + this.x += otherVector.x; + this.y += otherVector.y; + this.z += otherVector.z; + this.w += otherVector.w; + return this; + }; + Vector4.prototype.add = function (otherVector) { + return new Vector4(this.x + otherVector.x, this.y + otherVector.y, this.z + otherVector.z, this.w + otherVector.w); + }; + Vector4.prototype.addToRef = function (otherVector, result) { + result.x = this.x + otherVector.x; + result.y = this.y + otherVector.y; + result.z = this.z + otherVector.z; + result.w = this.w + otherVector.w; + return this; + }; + Vector4.prototype.subtractInPlace = function (otherVector) { + this.x -= otherVector.x; + this.y -= otherVector.y; + this.z -= otherVector.z; + this.w -= otherVector.w; + return this; + }; + Vector4.prototype.subtract = function (otherVector) { + return new Vector4(this.x - otherVector.x, this.y - otherVector.y, this.z - otherVector.z, this.w - otherVector.w); + }; + Vector4.prototype.subtractToRef = function (otherVector, result) { + result.x = this.x - otherVector.x; + result.y = this.y - otherVector.y; + result.z = this.z - otherVector.z; + result.w = this.w - otherVector.w; + return this; + }; + Vector4.prototype.subtractFromFloats = function (x, y, z, w) { + return new Vector4(this.x - x, this.y - y, this.z - z, this.w - w); + }; + Vector4.prototype.subtractFromFloatsToRef = function (x, y, z, w, result) { + result.x = this.x - x; + result.y = this.y - y; + result.z = this.z - z; + result.w = this.w - w; + return this; + }; + Vector4.prototype.negate = function () { + return new Vector4(-this.x, -this.y, -this.z, -this.w); + }; + Vector4.prototype.scaleInPlace = function (scale) { + this.x *= scale; + this.y *= scale; + this.z *= scale; + this.w *= scale; + return this; + }; + Vector4.prototype.scale = function (scale) { + return new Vector4(this.x * scale, this.y * scale, this.z * scale, this.w * scale); + }; + Vector4.prototype.scaleToRef = function (scale, result) { + result.x = this.x * scale; + result.y = this.y * scale; + result.z = this.z * scale; + result.w = this.w * scale; + }; + Vector4.prototype.equals = function (otherVector) { + return otherVector && this.x === otherVector.x && this.y === otherVector.y && this.z === otherVector.z && this.w === otherVector.w; + }; + Vector4.prototype.equalsWithEpsilon = function (otherVector, epsilon) { + if (epsilon === void 0) { epsilon = BABYLON.Epsilon; } + return otherVector + && MathTools.WithinEpsilon(this.x, otherVector.x, epsilon) + && MathTools.WithinEpsilon(this.y, otherVector.y, epsilon) + && MathTools.WithinEpsilon(this.z, otherVector.z, epsilon) + && MathTools.WithinEpsilon(this.w, otherVector.w, epsilon); + }; + Vector4.prototype.equalsToFloats = function (x, y, z, w) { + return this.x === x && this.y === y && this.z === z && this.w === w; + }; + Vector4.prototype.multiplyInPlace = function (otherVector) { + this.x *= otherVector.x; + this.y *= otherVector.y; + this.z *= otherVector.z; + this.w *= otherVector.w; + return this; + }; + Vector4.prototype.multiply = function (otherVector) { + return new Vector4(this.x * otherVector.x, this.y * otherVector.y, this.z * otherVector.z, this.w * otherVector.w); + }; + Vector4.prototype.multiplyToRef = function (otherVector, result) { + result.x = this.x * otherVector.x; + result.y = this.y * otherVector.y; + result.z = this.z * otherVector.z; + result.w = this.w * otherVector.w; + return this; + }; + Vector4.prototype.multiplyByFloats = function (x, y, z, w) { + return new Vector4(this.x * x, this.y * y, this.z * z, this.w * w); + }; + Vector4.prototype.divide = function (otherVector) { + return new Vector4(this.x / otherVector.x, this.y / otherVector.y, this.z / otherVector.z, this.w / otherVector.w); + }; + Vector4.prototype.divideToRef = function (otherVector, result) { + result.x = this.x / otherVector.x; + result.y = this.y / otherVector.y; + result.z = this.z / otherVector.z; + result.w = this.w / otherVector.w; + return this; + }; + Vector4.prototype.MinimizeInPlace = function (other) { + if (other.x < this.x) + this.x = other.x; + if (other.y < this.y) + this.y = other.y; + if (other.z < this.z) + this.z = other.z; + if (other.w < this.w) + this.w = other.w; + return this; + }; + Vector4.prototype.MaximizeInPlace = function (other) { + if (other.x > this.x) + this.x = other.x; + if (other.y > this.y) + this.y = other.y; + if (other.z > this.z) + this.z = other.z; + if (other.w > this.w) + this.w = other.w; + return this; + }; + // Properties + Vector4.prototype.length = function () { + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w); + }; + Vector4.prototype.lengthSquared = function () { + return (this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w); + }; + // Methods + Vector4.prototype.normalize = function () { + var len = this.length(); + if (len === 0) + return this; + var num = 1.0 / len; + this.x *= num; + this.y *= num; + this.z *= num; + this.w *= num; + return this; + }; + Vector4.prototype.toVector3 = function () { + return new Vector3(this.x, this.y, this.z); + }; + Vector4.prototype.clone = function () { + return new Vector4(this.x, this.y, this.z, this.w); + }; + Vector4.prototype.copyFrom = function (source) { + this.x = source.x; + this.y = source.y; + this.z = source.z; + this.w = source.w; + return this; + }; + Vector4.prototype.copyFromFloats = function (x, y, z, w) { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + return this; + }; + // Statics + Vector4.FromArray = function (array, offset) { + if (!offset) { + offset = 0; + } + return new Vector4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]); + }; + Vector4.FromArrayToRef = function (array, offset, result) { + result.x = array[offset]; + result.y = array[offset + 1]; + result.z = array[offset + 2]; + result.w = array[offset + 3]; + }; + Vector4.FromFloatArrayToRef = function (array, offset, result) { + result.x = array[offset]; + result.y = array[offset + 1]; + result.z = array[offset + 2]; + result.w = array[offset + 3]; + }; + Vector4.FromFloatsToRef = function (x, y, z, w, result) { + result.x = x; + result.y = y; + result.z = z; + result.w = w; + }; + Vector4.Zero = function () { + return new Vector4(0, 0, 0, 0); + }; + Vector4.Normalize = function (vector) { + var result = Vector4.Zero(); + Vector4.NormalizeToRef(vector, result); + return result; + }; + Vector4.NormalizeToRef = function (vector, result) { + result.copyFrom(vector); + result.normalize(); + }; + Vector4.Minimize = function (left, right) { + var min = left.clone(); + min.MinimizeInPlace(right); + return min; + }; + Vector4.Maximize = function (left, right) { + var max = left.clone(); + max.MaximizeInPlace(right); + return max; + }; + Vector4.Distance = function (value1, value2) { + return Math.sqrt(Vector4.DistanceSquared(value1, value2)); + }; + Vector4.DistanceSquared = function (value1, value2) { + var x = value1.x - value2.x; + var y = value1.y - value2.y; + var z = value1.z - value2.z; + var w = value1.w - value2.w; + return (x * x) + (y * y) + (z * z) + (w * w); + }; + Vector4.Center = function (value1, value2) { + var center = value1.add(value2); + center.scaleInPlace(0.5); + return center; + }; + return Vector4; + }()); + BABYLON.Vector4 = Vector4; + var Size = (function () { + function Size(width, height) { + this.width = width; + this.height = height; + } + Size.prototype.toString = function () { + return "{W: " + this.width + ", H: " + this.height + "}"; + }; + Size.prototype.getClassName = function () { + return "Size"; + }; + Size.prototype.getHashCode = function () { + var hash = this.width || 0; + hash = (hash * 397) ^ (this.height || 0); + return hash; + }; + Size.prototype.copyFrom = function (src) { + this.width = src.width; + this.height = src.height; + }; + Size.prototype.copyFromFloats = function (width, height) { + this.width = width; + this.height = height; + }; + Size.prototype.multiplyByFloats = function (w, h) { + return new Size(this.width * w, this.height * h); + }; + Size.prototype.clone = function () { + return new Size(this.width, this.height); + }; + Size.prototype.equals = function (other) { + if (!other) { + return false; + } + return (this.width === other.width) && (this.height === other.height); + }; + Object.defineProperty(Size.prototype, "surface", { + get: function () { + return this.width * this.height; + }, + enumerable: true, + configurable: true + }); + Size.Zero = function () { + return new Size(0, 0); + }; + Size.prototype.add = function (otherSize) { + var r = new Size(this.width + otherSize.width, this.height + otherSize.height); + return r; + }; + Size.prototype.substract = function (otherSize) { + var r = new Size(this.width - otherSize.width, this.height - otherSize.height); + return r; + }; + Size.Lerp = function (start, end, amount) { + var w = start.width + ((end.width - start.width) * amount); + var h = start.height + ((end.height - start.height) * amount); + return new Size(w, h); + }; + return Size; + }()); + BABYLON.Size = Size; + var Quaternion = (function () { + function Quaternion(x, y, z, w) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + if (z === void 0) { z = 0; } + if (w === void 0) { w = 1; } + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + Quaternion.prototype.toString = function () { + return "{X: " + this.x + " Y:" + this.y + " Z:" + this.z + " W:" + this.w + "}"; + }; + Quaternion.prototype.getClassName = function () { + return "Quaternion"; + }; + Quaternion.prototype.getHashCode = function () { + var hash = this.x || 0; + hash = (hash * 397) ^ (this.y || 0); + hash = (hash * 397) ^ (this.z || 0); + hash = (hash * 397) ^ (this.w || 0); + return hash; + }; + Quaternion.prototype.asArray = function () { + return [this.x, this.y, this.z, this.w]; + }; + Quaternion.prototype.equals = function (otherQuaternion) { + return otherQuaternion && this.x === otherQuaternion.x && this.y === otherQuaternion.y && this.z === otherQuaternion.z && this.w === otherQuaternion.w; + }; + Quaternion.prototype.clone = function () { + return new Quaternion(this.x, this.y, this.z, this.w); + }; + Quaternion.prototype.copyFrom = function (other) { + this.x = other.x; + this.y = other.y; + this.z = other.z; + this.w = other.w; + return this; + }; + Quaternion.prototype.copyFromFloats = function (x, y, z, w) { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + return this; + }; + Quaternion.prototype.add = function (other) { + return new Quaternion(this.x + other.x, this.y + other.y, this.z + other.z, this.w + other.w); + }; + Quaternion.prototype.subtract = function (other) { + return new Quaternion(this.x - other.x, this.y - other.y, this.z - other.z, this.w - other.w); + }; + Quaternion.prototype.scale = function (value) { + return new Quaternion(this.x * value, this.y * value, this.z * value, this.w * value); + }; + Quaternion.prototype.multiply = function (q1) { + var result = new Quaternion(0, 0, 0, 1.0); + this.multiplyToRef(q1, result); + return result; + }; + Quaternion.prototype.multiplyToRef = function (q1, result) { + var x = this.x * q1.w + this.y * q1.z - this.z * q1.y + this.w * q1.x; + var y = -this.x * q1.z + this.y * q1.w + this.z * q1.x + this.w * q1.y; + var z = this.x * q1.y - this.y * q1.x + this.z * q1.w + this.w * q1.z; + var w = -this.x * q1.x - this.y * q1.y - this.z * q1.z + this.w * q1.w; + result.copyFromFloats(x, y, z, w); + return this; + }; + Quaternion.prototype.multiplyInPlace = function (q1) { + this.multiplyToRef(q1, this); + return this; + }; + Quaternion.prototype.conjugateToRef = function (ref) { + ref.copyFromFloats(-this.x, -this.y, -this.z, this.w); + return this; + }; + Quaternion.prototype.conjugateInPlace = function () { + this.x *= -1; + this.y *= -1; + this.z *= -1; + return this; + }; + Quaternion.prototype.conjugate = function () { + var result = new Quaternion(-this.x, -this.y, -this.z, this.w); + return result; + }; + Quaternion.prototype.length = function () { + return Math.sqrt((this.x * this.x) + (this.y * this.y) + (this.z * this.z) + (this.w * this.w)); + }; + Quaternion.prototype.normalize = function () { + var length = 1.0 / this.length(); + this.x *= length; + this.y *= length; + this.z *= length; + this.w *= length; + return this; + }; + Quaternion.prototype.toEulerAngles = function (order) { + if (order === void 0) { order = "YZX"; } + var result = Vector3.Zero(); + this.toEulerAnglesToRef(result, order); + return result; + }; + Quaternion.prototype.toEulerAnglesToRef = function (result, order) { + if (order === void 0) { order = "YZX"; } + var qz = this.z; + var qx = this.x; + var qy = this.y; + var qw = this.w; + var sqw = qw * qw; + var sqz = qz * qz; + var sqx = qx * qx; + var sqy = qy * qy; + var zAxisY = qy * qz - qx * qw; + var limit = .4999999; + if (zAxisY < -limit) { + result.y = 2 * Math.atan2(qy, qw); + result.x = Math.PI / 2; + result.z = 0; + } + else if (zAxisY > limit) { + result.y = 2 * Math.atan2(qy, qw); + result.x = -Math.PI / 2; + result.z = 0; + } + else { + result.z = Math.atan2(2.0 * (qx * qy + qz * qw), (-sqz - sqx + sqy + sqw)); + result.x = Math.asin(-2.0 * (qz * qy - qx * qw)); + result.y = Math.atan2(2.0 * (qz * qx + qy * qw), (sqz - sqx - sqy + sqw)); + } + return this; + }; + Quaternion.prototype.toRotationMatrix = function (result) { + var xx = this.x * this.x; + var yy = this.y * this.y; + var zz = this.z * this.z; + var xy = this.x * this.y; + var zw = this.z * this.w; + var zx = this.z * this.x; + var yw = this.y * this.w; + var yz = this.y * this.z; + var xw = this.x * this.w; + result.m[0] = 1.0 - (2.0 * (yy + zz)); + result.m[1] = 2.0 * (xy + zw); + result.m[2] = 2.0 * (zx - yw); + result.m[3] = 0; + result.m[4] = 2.0 * (xy - zw); + result.m[5] = 1.0 - (2.0 * (zz + xx)); + result.m[6] = 2.0 * (yz + xw); + result.m[7] = 0; + result.m[8] = 2.0 * (zx + yw); + result.m[9] = 2.0 * (yz - xw); + result.m[10] = 1.0 - (2.0 * (yy + xx)); + result.m[11] = 0; + result.m[12] = 0; + result.m[13] = 0; + result.m[14] = 0; + result.m[15] = 1.0; + return this; + }; + Quaternion.prototype.fromRotationMatrix = function (matrix) { + Quaternion.FromRotationMatrixToRef(matrix, this); + return this; + }; + // Statics + Quaternion.FromRotationMatrix = function (matrix) { + var result = new Quaternion(); + Quaternion.FromRotationMatrixToRef(matrix, result); + return result; + }; + Quaternion.FromRotationMatrixToRef = function (matrix, result) { + var data = matrix.m; + var m11 = data[0], m12 = data[4], m13 = data[8]; + var m21 = data[1], m22 = data[5], m23 = data[9]; + var m31 = data[2], m32 = data[6], m33 = data[10]; + var trace = m11 + m22 + m33; + var s; + if (trace > 0) { + s = 0.5 / Math.sqrt(trace + 1.0); + result.w = 0.25 / s; + result.x = (m32 - m23) * s; + result.y = (m13 - m31) * s; + result.z = (m21 - m12) * s; + } + else if (m11 > m22 && m11 > m33) { + s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); + result.w = (m32 - m23) / s; + result.x = 0.25 * s; + result.y = (m12 + m21) / s; + result.z = (m13 + m31) / s; + } + else if (m22 > m33) { + s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); + result.w = (m13 - m31) / s; + result.x = (m12 + m21) / s; + result.y = 0.25 * s; + result.z = (m23 + m32) / s; + } + else { + s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); + result.w = (m21 - m12) / s; + result.x = (m13 + m31) / s; + result.y = (m23 + m32) / s; + result.z = 0.25 * s; + } + }; + Quaternion.Inverse = function (q) { + return new Quaternion(-q.x, -q.y, -q.z, q.w); + }; + Quaternion.Identity = function () { + return new Quaternion(0, 0, 0, 1); + }; + Quaternion.RotationAxis = function (axis, angle) { + return Quaternion.RotationAxisToRef(axis, angle, new Quaternion()); + }; + Quaternion.RotationAxisToRef = function (axis, angle, result) { + var sin = Math.sin(angle / 2); + axis.normalize(); + result.w = Math.cos(angle / 2); + result.x = axis.x * sin; + result.y = axis.y * sin; + result.z = axis.z * sin; + return result; + }; + Quaternion.FromArray = function (array, offset) { + if (!offset) { + offset = 0; + } + return new Quaternion(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]); + }; + Quaternion.RotationYawPitchRoll = function (yaw, pitch, roll) { + var q = new Quaternion(); + Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, q); + return q; + }; + Quaternion.RotationYawPitchRollToRef = function (yaw, pitch, roll, result) { + // Produces a quaternion from Euler angles in the z-y-x orientation (Tait-Bryan angles) + var halfRoll = roll * 0.5; + var halfPitch = pitch * 0.5; + var halfYaw = yaw * 0.5; + var sinRoll = Math.sin(halfRoll); + var cosRoll = Math.cos(halfRoll); + var sinPitch = Math.sin(halfPitch); + var cosPitch = Math.cos(halfPitch); + var sinYaw = Math.sin(halfYaw); + var cosYaw = Math.cos(halfYaw); + result.x = (cosYaw * sinPitch * cosRoll) + (sinYaw * cosPitch * sinRoll); + result.y = (sinYaw * cosPitch * cosRoll) - (cosYaw * sinPitch * sinRoll); + result.z = (cosYaw * cosPitch * sinRoll) - (sinYaw * sinPitch * cosRoll); + result.w = (cosYaw * cosPitch * cosRoll) + (sinYaw * sinPitch * sinRoll); + }; + Quaternion.RotationAlphaBetaGamma = function (alpha, beta, gamma) { + var result = new Quaternion(); + Quaternion.RotationAlphaBetaGammaToRef(alpha, beta, gamma, result); + return result; + }; + Quaternion.RotationAlphaBetaGammaToRef = function (alpha, beta, gamma, result) { + // Produces a quaternion from Euler angles in the z-x-z orientation + var halfGammaPlusAlpha = (gamma + alpha) * 0.5; + var halfGammaMinusAlpha = (gamma - alpha) * 0.5; + var halfBeta = beta * 0.5; + result.x = Math.cos(halfGammaMinusAlpha) * Math.sin(halfBeta); + result.y = Math.sin(halfGammaMinusAlpha) * Math.sin(halfBeta); + result.z = Math.sin(halfGammaPlusAlpha) * Math.cos(halfBeta); + result.w = Math.cos(halfGammaPlusAlpha) * Math.cos(halfBeta); + }; + Quaternion.Slerp = function (left, right, amount) { + var result = Quaternion.Identity(); + Quaternion.SlerpToRef(left, right, amount, result); + return result; + }; + Quaternion.SlerpToRef = function (left, right, amount, result) { + var num2; + var num3; + var num = amount; + var num4 = (((left.x * right.x) + (left.y * right.y)) + (left.z * right.z)) + (left.w * right.w); + var flag = false; + if (num4 < 0) { + flag = true; + num4 = -num4; + } + if (num4 > 0.999999) { + num3 = 1 - num; + num2 = flag ? -num : num; + } + else { + var num5 = Math.acos(num4); + var num6 = (1.0 / Math.sin(num5)); + num3 = (Math.sin((1.0 - num) * num5)) * num6; + num2 = flag ? ((-Math.sin(num * num5)) * num6) : ((Math.sin(num * num5)) * num6); + } + result.x = (num3 * left.x) + (num2 * right.x); + result.y = (num3 * left.y) + (num2 * right.y); + result.z = (num3 * left.z) + (num2 * right.z); + result.w = (num3 * left.w) + (num2 * right.w); + }; + return Quaternion; + }()); + BABYLON.Quaternion = Quaternion; + var Matrix = (function () { + function Matrix() { + this.m = new Float32Array(16); + } + // Properties + Matrix.prototype.isIdentity = function () { + if (this.m[0] !== 1.0 || this.m[5] !== 1.0 || this.m[10] !== 1.0 || this.m[15] !== 1.0) + return false; + if (this.m[1] !== 0.0 || this.m[2] !== 0.0 || this.m[3] !== 0.0 || + this.m[4] !== 0.0 || this.m[6] !== 0.0 || this.m[7] !== 0.0 || + this.m[8] !== 0.0 || this.m[9] !== 0.0 || this.m[11] !== 0.0 || + this.m[12] !== 0.0 || this.m[13] !== 0.0 || this.m[14] !== 0.0) + return false; + return true; + }; + Matrix.prototype.determinant = function () { + var temp1 = (this.m[10] * this.m[15]) - (this.m[11] * this.m[14]); + var temp2 = (this.m[9] * this.m[15]) - (this.m[11] * this.m[13]); + var temp3 = (this.m[9] * this.m[14]) - (this.m[10] * this.m[13]); + var temp4 = (this.m[8] * this.m[15]) - (this.m[11] * this.m[12]); + var temp5 = (this.m[8] * this.m[14]) - (this.m[10] * this.m[12]); + var temp6 = (this.m[8] * this.m[13]) - (this.m[9] * this.m[12]); + return ((((this.m[0] * (((this.m[5] * temp1) - (this.m[6] * temp2)) + (this.m[7] * temp3))) - (this.m[1] * (((this.m[4] * temp1) - + (this.m[6] * temp4)) + (this.m[7] * temp5)))) + (this.m[2] * (((this.m[4] * temp2) - (this.m[5] * temp4)) + (this.m[7] * temp6)))) - + (this.m[3] * (((this.m[4] * temp3) - (this.m[5] * temp5)) + (this.m[6] * temp6)))); + }; + // Methods + Matrix.prototype.toArray = function () { + return this.m; + }; + Matrix.prototype.asArray = function () { + return this.toArray(); + }; + Matrix.prototype.invert = function () { + this.invertToRef(this); + return this; + }; + Matrix.prototype.reset = function () { + for (var index = 0; index < 16; index++) { + this.m[index] = 0; + } + return this; + }; + Matrix.prototype.add = function (other) { + var result = new Matrix(); + this.addToRef(other, result); + return result; + }; + Matrix.prototype.addToRef = function (other, result) { + for (var index = 0; index < 16; index++) { + result.m[index] = this.m[index] + other.m[index]; + } + return this; + }; + Matrix.prototype.addToSelf = function (other) { + for (var index = 0; index < 16; index++) { + this.m[index] += other.m[index]; + } + return this; + }; + Matrix.prototype.invertToRef = function (other) { + var l1 = this.m[0]; + var l2 = this.m[1]; + var l3 = this.m[2]; + var l4 = this.m[3]; + var l5 = this.m[4]; + var l6 = this.m[5]; + var l7 = this.m[6]; + var l8 = this.m[7]; + var l9 = this.m[8]; + var l10 = this.m[9]; + var l11 = this.m[10]; + var l12 = this.m[11]; + var l13 = this.m[12]; + var l14 = this.m[13]; + var l15 = this.m[14]; + var l16 = this.m[15]; + var l17 = (l11 * l16) - (l12 * l15); + var l18 = (l10 * l16) - (l12 * l14); + var l19 = (l10 * l15) - (l11 * l14); + var l20 = (l9 * l16) - (l12 * l13); + var l21 = (l9 * l15) - (l11 * l13); + var l22 = (l9 * l14) - (l10 * l13); + var l23 = ((l6 * l17) - (l7 * l18)) + (l8 * l19); + var l24 = -(((l5 * l17) - (l7 * l20)) + (l8 * l21)); + var l25 = ((l5 * l18) - (l6 * l20)) + (l8 * l22); + var l26 = -(((l5 * l19) - (l6 * l21)) + (l7 * l22)); + var l27 = 1.0 / ((((l1 * l23) + (l2 * l24)) + (l3 * l25)) + (l4 * l26)); + var l28 = (l7 * l16) - (l8 * l15); + var l29 = (l6 * l16) - (l8 * l14); + var l30 = (l6 * l15) - (l7 * l14); + var l31 = (l5 * l16) - (l8 * l13); + var l32 = (l5 * l15) - (l7 * l13); + var l33 = (l5 * l14) - (l6 * l13); + var l34 = (l7 * l12) - (l8 * l11); + var l35 = (l6 * l12) - (l8 * l10); + var l36 = (l6 * l11) - (l7 * l10); + var l37 = (l5 * l12) - (l8 * l9); + var l38 = (l5 * l11) - (l7 * l9); + var l39 = (l5 * l10) - (l6 * l9); + other.m[0] = l23 * l27; + other.m[4] = l24 * l27; + other.m[8] = l25 * l27; + other.m[12] = l26 * l27; + other.m[1] = -(((l2 * l17) - (l3 * l18)) + (l4 * l19)) * l27; + other.m[5] = (((l1 * l17) - (l3 * l20)) + (l4 * l21)) * l27; + other.m[9] = -(((l1 * l18) - (l2 * l20)) + (l4 * l22)) * l27; + other.m[13] = (((l1 * l19) - (l2 * l21)) + (l3 * l22)) * l27; + other.m[2] = (((l2 * l28) - (l3 * l29)) + (l4 * l30)) * l27; + other.m[6] = -(((l1 * l28) - (l3 * l31)) + (l4 * l32)) * l27; + other.m[10] = (((l1 * l29) - (l2 * l31)) + (l4 * l33)) * l27; + other.m[14] = -(((l1 * l30) - (l2 * l32)) + (l3 * l33)) * l27; + other.m[3] = -(((l2 * l34) - (l3 * l35)) + (l4 * l36)) * l27; + other.m[7] = (((l1 * l34) - (l3 * l37)) + (l4 * l38)) * l27; + other.m[11] = -(((l1 * l35) - (l2 * l37)) + (l4 * l39)) * l27; + other.m[15] = (((l1 * l36) - (l2 * l38)) + (l3 * l39)) * l27; + return this; + }; + Matrix.prototype.setTranslation = function (vector3) { + this.m[12] = vector3.x; + this.m[13] = vector3.y; + this.m[14] = vector3.z; + return this; + }; + Matrix.prototype.getTranslation = function () { + return new Vector3(this.m[12], this.m[13], this.m[14]); + }; + Matrix.prototype.multiply = function (other) { + var result = new Matrix(); + this.multiplyToRef(other, result); + return result; + }; + Matrix.prototype.copyFrom = function (other) { + for (var index = 0; index < 16; index++) { + this.m[index] = other.m[index]; + } + return this; + }; + Matrix.prototype.copyToArray = function (array, offset) { + if (offset === void 0) { offset = 0; } + for (var index = 0; index < 16; index++) { + array[offset + index] = this.m[index]; + } + return this; + }; + Matrix.prototype.multiplyToRef = function (other, result) { + this.multiplyToArray(other, result.m, 0); + return this; + }; + Matrix.prototype.multiplyToArray = function (other, result, offset) { + var tm0 = this.m[0]; + var tm1 = this.m[1]; + var tm2 = this.m[2]; + var tm3 = this.m[3]; + var tm4 = this.m[4]; + var tm5 = this.m[5]; + var tm6 = this.m[6]; + var tm7 = this.m[7]; + var tm8 = this.m[8]; + var tm9 = this.m[9]; + var tm10 = this.m[10]; + var tm11 = this.m[11]; + var tm12 = this.m[12]; + var tm13 = this.m[13]; + var tm14 = this.m[14]; + var tm15 = this.m[15]; + var om0 = other.m[0]; + var om1 = other.m[1]; + var om2 = other.m[2]; + var om3 = other.m[3]; + var om4 = other.m[4]; + var om5 = other.m[5]; + var om6 = other.m[6]; + var om7 = other.m[7]; + var om8 = other.m[8]; + var om9 = other.m[9]; + var om10 = other.m[10]; + var om11 = other.m[11]; + var om12 = other.m[12]; + var om13 = other.m[13]; + var om14 = other.m[14]; + var om15 = other.m[15]; + result[offset] = tm0 * om0 + tm1 * om4 + tm2 * om8 + tm3 * om12; + result[offset + 1] = tm0 * om1 + tm1 * om5 + tm2 * om9 + tm3 * om13; + result[offset + 2] = tm0 * om2 + tm1 * om6 + tm2 * om10 + tm3 * om14; + result[offset + 3] = tm0 * om3 + tm1 * om7 + tm2 * om11 + tm3 * om15; + result[offset + 4] = tm4 * om0 + tm5 * om4 + tm6 * om8 + tm7 * om12; + result[offset + 5] = tm4 * om1 + tm5 * om5 + tm6 * om9 + tm7 * om13; + result[offset + 6] = tm4 * om2 + tm5 * om6 + tm6 * om10 + tm7 * om14; + result[offset + 7] = tm4 * om3 + tm5 * om7 + tm6 * om11 + tm7 * om15; + result[offset + 8] = tm8 * om0 + tm9 * om4 + tm10 * om8 + tm11 * om12; + result[offset + 9] = tm8 * om1 + tm9 * om5 + tm10 * om9 + tm11 * om13; + result[offset + 10] = tm8 * om2 + tm9 * om6 + tm10 * om10 + tm11 * om14; + result[offset + 11] = tm8 * om3 + tm9 * om7 + tm10 * om11 + tm11 * om15; + result[offset + 12] = tm12 * om0 + tm13 * om4 + tm14 * om8 + tm15 * om12; + result[offset + 13] = tm12 * om1 + tm13 * om5 + tm14 * om9 + tm15 * om13; + result[offset + 14] = tm12 * om2 + tm13 * om6 + tm14 * om10 + tm15 * om14; + result[offset + 15] = tm12 * om3 + tm13 * om7 + tm14 * om11 + tm15 * om15; + return this; + }; + Matrix.prototype.equals = function (value) { + return value && + (this.m[0] === value.m[0] && this.m[1] === value.m[1] && this.m[2] === value.m[2] && this.m[3] === value.m[3] && + this.m[4] === value.m[4] && this.m[5] === value.m[5] && this.m[6] === value.m[6] && this.m[7] === value.m[7] && + this.m[8] === value.m[8] && this.m[9] === value.m[9] && this.m[10] === value.m[10] && this.m[11] === value.m[11] && + this.m[12] === value.m[12] && this.m[13] === value.m[13] && this.m[14] === value.m[14] && this.m[15] === value.m[15]); + }; + Matrix.prototype.clone = function () { + return Matrix.FromValues(this.m[0], this.m[1], this.m[2], this.m[3], this.m[4], this.m[5], this.m[6], this.m[7], this.m[8], this.m[9], this.m[10], this.m[11], this.m[12], this.m[13], this.m[14], this.m[15]); + }; + Matrix.prototype.getClassName = function () { + return "Matrix"; + }; + Matrix.prototype.getHashCode = function () { + var hash = this.m[0] || 0; + for (var i = 1; i < 16; i++) { + hash = (hash * 397) ^ (this.m[i] || 0); + } + return hash; + }; + Matrix.prototype.decompose = function (scale, rotation, translation) { + translation.x = this.m[12]; + translation.y = this.m[13]; + translation.z = this.m[14]; + var xs = MathTools.Sign(this.m[0] * this.m[1] * this.m[2] * this.m[3]) < 0 ? -1 : 1; + var ys = MathTools.Sign(this.m[4] * this.m[5] * this.m[6] * this.m[7]) < 0 ? -1 : 1; + var zs = MathTools.Sign(this.m[8] * this.m[9] * this.m[10] * this.m[11]) < 0 ? -1 : 1; + scale.x = xs * Math.sqrt(this.m[0] * this.m[0] + this.m[1] * this.m[1] + this.m[2] * this.m[2]); + scale.y = ys * Math.sqrt(this.m[4] * this.m[4] + this.m[5] * this.m[5] + this.m[6] * this.m[6]); + scale.z = zs * Math.sqrt(this.m[8] * this.m[8] + this.m[9] * this.m[9] + this.m[10] * this.m[10]); + if (scale.x === 0 || scale.y === 0 || scale.z === 0) { + rotation.x = 0; + rotation.y = 0; + rotation.z = 0; + rotation.w = 1; + return false; + } + Matrix.FromValuesToRef(this.m[0] / scale.x, this.m[1] / scale.x, this.m[2] / scale.x, 0, this.m[4] / scale.y, this.m[5] / scale.y, this.m[6] / scale.y, 0, this.m[8] / scale.z, this.m[9] / scale.z, this.m[10] / scale.z, 0, 0, 0, 0, 1, Tmp.Matrix[0]); + Quaternion.FromRotationMatrixToRef(Tmp.Matrix[0], rotation); + return true; + }; + Matrix.prototype.getRotationMatrix = function () { + var result = Matrix.Identity(); + this.getRotationMatrixToRef(result); + return result; + }; + Matrix.prototype.getRotationMatrixToRef = function (result) { + var m = this.m; + var xs = m[0] * m[1] * m[2] * m[3] < 0 ? -1 : 1; + var ys = m[4] * m[5] * m[6] * m[7] < 0 ? -1 : 1; + var zs = m[8] * m[9] * m[10] * m[11] < 0 ? -1 : 1; + var sx = xs * Math.sqrt(m[0] * m[0] + m[1] * m[1] + m[2] * m[2]); + var sy = ys * Math.sqrt(m[4] * m[4] + m[5] * m[5] + m[6] * m[6]); + var sz = zs * Math.sqrt(m[8] * m[8] + m[9] * m[9] + m[10] * m[10]); + Matrix.FromValuesToRef(m[0] / sx, m[1] / sx, m[2] / sx, 0, m[4] / sy, m[5] / sy, m[6] / sy, 0, m[8] / sz, m[9] / sz, m[10] / sz, 0, 0, 0, 0, 1, result); + }; + // Statics + Matrix.FromArray = function (array, offset) { + var result = new Matrix(); + if (!offset) { + offset = 0; + } + Matrix.FromArrayToRef(array, offset, result); + return result; + }; + Matrix.FromArrayToRef = function (array, offset, result) { + for (var index = 0; index < 16; index++) { + result.m[index] = array[index + offset]; + } + }; + Matrix.FromFloat32ArrayToRefScaled = function (array, offset, scale, result) { + for (var index = 0; index < 16; index++) { + result.m[index] = array[index + offset] * scale; + } + }; + Matrix.FromValuesToRef = function (initialM11, initialM12, initialM13, initialM14, initialM21, initialM22, initialM23, initialM24, initialM31, initialM32, initialM33, initialM34, initialM41, initialM42, initialM43, initialM44, result) { + result.m[0] = initialM11; + result.m[1] = initialM12; + result.m[2] = initialM13; + result.m[3] = initialM14; + result.m[4] = initialM21; + result.m[5] = initialM22; + result.m[6] = initialM23; + result.m[7] = initialM24; + result.m[8] = initialM31; + result.m[9] = initialM32; + result.m[10] = initialM33; + result.m[11] = initialM34; + result.m[12] = initialM41; + result.m[13] = initialM42; + result.m[14] = initialM43; + result.m[15] = initialM44; + }; + Matrix.prototype.getRow = function (index) { + if (index < 0 || index > 3) { + return null; + } + var i = index * 4; + return new Vector4(this.m[i + 0], this.m[i + 1], this.m[i + 2], this.m[i + 3]); + }; + Matrix.prototype.setRow = function (index, row) { + if (index < 0 || index > 3) { + return this; + } + var i = index * 4; + this.m[i + 0] = row.x; + this.m[i + 1] = row.y; + this.m[i + 2] = row.z; + this.m[i + 3] = row.w; + return this; + }; + Matrix.FromValues = function (initialM11, initialM12, initialM13, initialM14, initialM21, initialM22, initialM23, initialM24, initialM31, initialM32, initialM33, initialM34, initialM41, initialM42, initialM43, initialM44) { + var result = new Matrix(); + result.m[0] = initialM11; + result.m[1] = initialM12; + result.m[2] = initialM13; + result.m[3] = initialM14; + result.m[4] = initialM21; + result.m[5] = initialM22; + result.m[6] = initialM23; + result.m[7] = initialM24; + result.m[8] = initialM31; + result.m[9] = initialM32; + result.m[10] = initialM33; + result.m[11] = initialM34; + result.m[12] = initialM41; + result.m[13] = initialM42; + result.m[14] = initialM43; + result.m[15] = initialM44; + return result; + }; + Matrix.Compose = function (scale, rotation, translation) { + var result = Matrix.FromValues(scale.x, 0, 0, 0, 0, scale.y, 0, 0, 0, 0, scale.z, 0, 0, 0, 0, 1); + var rotationMatrix = Matrix.Identity(); + rotation.toRotationMatrix(rotationMatrix); + result = result.multiply(rotationMatrix); + result.setTranslation(translation); + return result; + }; + Matrix.Identity = function () { + return Matrix.FromValues(1.0, 0, 0, 0, 0, 1.0, 0, 0, 0, 0, 1.0, 0, 0, 0, 0, 1.0); + }; + Matrix.IdentityToRef = function (result) { + Matrix.FromValuesToRef(1.0, 0, 0, 0, 0, 1.0, 0, 0, 0, 0, 1.0, 0, 0, 0, 0, 1.0, result); + }; + Matrix.Zero = function () { + return Matrix.FromValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + }; + Matrix.RotationX = function (angle) { + var result = new Matrix(); + Matrix.RotationXToRef(angle, result); + return result; + }; + Matrix.Invert = function (source) { + var result = new Matrix(); + source.invertToRef(result); + return result; + }; + Matrix.RotationXToRef = function (angle, result) { + var s = Math.sin(angle); + var c = Math.cos(angle); + result.m[0] = 1.0; + result.m[15] = 1.0; + result.m[5] = c; + result.m[10] = c; + result.m[9] = -s; + result.m[6] = s; + result.m[1] = 0; + result.m[2] = 0; + result.m[3] = 0; + result.m[4] = 0; + result.m[7] = 0; + result.m[8] = 0; + result.m[11] = 0; + result.m[12] = 0; + result.m[13] = 0; + result.m[14] = 0; + }; + Matrix.RotationY = function (angle) { + var result = new Matrix(); + Matrix.RotationYToRef(angle, result); + return result; + }; + Matrix.RotationYToRef = function (angle, result) { + var s = Math.sin(angle); + var c = Math.cos(angle); + result.m[5] = 1.0; + result.m[15] = 1.0; + result.m[0] = c; + result.m[2] = -s; + result.m[8] = s; + result.m[10] = c; + result.m[1] = 0; + result.m[3] = 0; + result.m[4] = 0; + result.m[6] = 0; + result.m[7] = 0; + result.m[9] = 0; + result.m[11] = 0; + result.m[12] = 0; + result.m[13] = 0; + result.m[14] = 0; + }; + Matrix.RotationZ = function (angle) { + var result = new Matrix(); + Matrix.RotationZToRef(angle, result); + return result; + }; + Matrix.RotationZToRef = function (angle, result) { + var s = Math.sin(angle); + var c = Math.cos(angle); + result.m[10] = 1.0; + result.m[15] = 1.0; + result.m[0] = c; + result.m[1] = s; + result.m[4] = -s; + result.m[5] = c; + result.m[2] = 0; + result.m[3] = 0; + result.m[6] = 0; + result.m[7] = 0; + result.m[8] = 0; + result.m[9] = 0; + result.m[11] = 0; + result.m[12] = 0; + result.m[13] = 0; + result.m[14] = 0; + }; + Matrix.RotationAxis = function (axis, angle) { + var result = Matrix.Zero(); + Matrix.RotationAxisToRef(axis, angle, result); + return result; + }; + Matrix.RotationAxisToRef = function (axis, angle, result) { + var s = Math.sin(-angle); + var c = Math.cos(-angle); + var c1 = 1 - c; + axis.normalize(); + result.m[0] = (axis.x * axis.x) * c1 + c; + result.m[1] = (axis.x * axis.y) * c1 - (axis.z * s); + result.m[2] = (axis.x * axis.z) * c1 + (axis.y * s); + result.m[3] = 0.0; + result.m[4] = (axis.y * axis.x) * c1 + (axis.z * s); + result.m[5] = (axis.y * axis.y) * c1 + c; + result.m[6] = (axis.y * axis.z) * c1 - (axis.x * s); + result.m[7] = 0.0; + result.m[8] = (axis.z * axis.x) * c1 - (axis.y * s); + result.m[9] = (axis.z * axis.y) * c1 + (axis.x * s); + result.m[10] = (axis.z * axis.z) * c1 + c; + result.m[11] = 0.0; + result.m[15] = 1.0; + }; + Matrix.RotationYawPitchRoll = function (yaw, pitch, roll) { + var result = new Matrix(); + Matrix.RotationYawPitchRollToRef(yaw, pitch, roll, result); + return result; + }; + Matrix.RotationYawPitchRollToRef = function (yaw, pitch, roll, result) { + Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, this._tempQuaternion); + this._tempQuaternion.toRotationMatrix(result); + }; + Matrix.Scaling = function (x, y, z) { + var result = Matrix.Zero(); + Matrix.ScalingToRef(x, y, z, result); + return result; + }; + Matrix.ScalingToRef = function (x, y, z, result) { + result.m[0] = x; + result.m[1] = 0; + result.m[2] = 0; + result.m[3] = 0; + result.m[4] = 0; + result.m[5] = y; + result.m[6] = 0; + result.m[7] = 0; + result.m[8] = 0; + result.m[9] = 0; + result.m[10] = z; + result.m[11] = 0; + result.m[12] = 0; + result.m[13] = 0; + result.m[14] = 0; + result.m[15] = 1.0; + }; + Matrix.Translation = function (x, y, z) { + var result = Matrix.Identity(); + Matrix.TranslationToRef(x, y, z, result); + return result; + }; + Matrix.TranslationToRef = function (x, y, z, result) { + Matrix.FromValuesToRef(1.0, 0, 0, 0, 0, 1.0, 0, 0, 0, 0, 1.0, 0, x, y, z, 1.0, result); + }; + Matrix.Lerp = function (startValue, endValue, gradient) { + var result = Matrix.Zero(); + for (var index = 0; index < 16; index++) { + result.m[index] = startValue.m[index] * (1.0 - gradient) + endValue.m[index] * gradient; + } + return result; + }; + Matrix.DecomposeLerp = function (startValue, endValue, gradient) { + var startScale = new Vector3(0, 0, 0); + var startRotation = new Quaternion(); + var startTranslation = new Vector3(0, 0, 0); + startValue.decompose(startScale, startRotation, startTranslation); + var endScale = new Vector3(0, 0, 0); + var endRotation = new Quaternion(); + var endTranslation = new Vector3(0, 0, 0); + endValue.decompose(endScale, endRotation, endTranslation); + var resultScale = Vector3.Lerp(startScale, endScale, gradient); + var resultRotation = Quaternion.Slerp(startRotation, endRotation, gradient); + var resultTranslation = Vector3.Lerp(startTranslation, endTranslation, gradient); + return Matrix.Compose(resultScale, resultRotation, resultTranslation); + }; + Matrix.LookAtLH = function (eye, target, up) { + var result = Matrix.Zero(); + Matrix.LookAtLHToRef(eye, target, up, result); + return result; + }; + Matrix.LookAtLHToRef = function (eye, target, up, result) { + // Z axis + target.subtractToRef(eye, this._zAxis); + this._zAxis.normalize(); + // X axis + Vector3.CrossToRef(up, this._zAxis, this._xAxis); + if (this._xAxis.lengthSquared() === 0) { + this._xAxis.x = 1.0; + } + else { + this._xAxis.normalize(); + } + // Y axis + Vector3.CrossToRef(this._zAxis, this._xAxis, this._yAxis); + this._yAxis.normalize(); + // Eye angles + var ex = -Vector3.Dot(this._xAxis, eye); + var ey = -Vector3.Dot(this._yAxis, eye); + var ez = -Vector3.Dot(this._zAxis, eye); + return Matrix.FromValuesToRef(this._xAxis.x, this._yAxis.x, this._zAxis.x, 0, this._xAxis.y, this._yAxis.y, this._zAxis.y, 0, this._xAxis.z, this._yAxis.z, this._zAxis.z, 0, ex, ey, ez, 1, result); + }; + Matrix.LookAtRH = function (eye, target, up) { + var result = Matrix.Zero(); + Matrix.LookAtRHToRef(eye, target, up, result); + return result; + }; + Matrix.LookAtRHToRef = function (eye, target, up, result) { + // Z axis + eye.subtractToRef(target, this._zAxis); + this._zAxis.normalize(); + // X axis + Vector3.CrossToRef(up, this._zAxis, this._xAxis); + if (this._xAxis.lengthSquared() === 0) { + this._xAxis.x = 1.0; + } + else { + this._xAxis.normalize(); + } + // Y axis + Vector3.CrossToRef(this._zAxis, this._xAxis, this._yAxis); + this._yAxis.normalize(); + // Eye angles + var ex = -Vector3.Dot(this._xAxis, eye); + var ey = -Vector3.Dot(this._yAxis, eye); + var ez = -Vector3.Dot(this._zAxis, eye); + return Matrix.FromValuesToRef(this._xAxis.x, this._yAxis.x, this._zAxis.x, 0, this._xAxis.y, this._yAxis.y, this._zAxis.y, 0, this._xAxis.z, this._yAxis.z, this._zAxis.z, 0, ex, ey, ez, 1, result); + }; + Matrix.OrthoLH = function (width, height, znear, zfar) { + var matrix = Matrix.Zero(); + Matrix.OrthoLHToRef(width, height, znear, zfar, matrix); + return matrix; + }; + Matrix.OrthoLHToRef = function (width, height, znear, zfar, result) { + var hw = 2.0 / width; + var hh = 2.0 / height; + var id = 1.0 / (zfar - znear); + var nid = znear / (znear - zfar); + Matrix.FromValuesToRef(hw, 0, 0, 0, 0, hh, 0, 0, 0, 0, id, 0, 0, 0, nid, 1, result); + }; + Matrix.OrthoOffCenterLH = function (left, right, bottom, top, znear, zfar) { + var matrix = Matrix.Zero(); + Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, matrix); + return matrix; + }; + Matrix.OrthoOffCenterLHToRef = function (left, right, bottom, top, znear, zfar, result) { + result.m[0] = 2.0 / (right - left); + result.m[1] = result.m[2] = result.m[3] = 0; + result.m[5] = 2.0 / (top - bottom); + result.m[4] = result.m[6] = result.m[7] = 0; + result.m[10] = 1.0 / (zfar - znear); + result.m[8] = result.m[9] = result.m[11] = 0; + result.m[12] = (left + right) / (left - right); + result.m[13] = (top + bottom) / (bottom - top); + result.m[14] = -znear / (zfar - znear); + result.m[15] = 1.0; + }; + Matrix.OrthoOffCenterRH = function (left, right, bottom, top, znear, zfar) { + var matrix = Matrix.Zero(); + Matrix.OrthoOffCenterRHToRef(left, right, bottom, top, znear, zfar, matrix); + return matrix; + }; + Matrix.OrthoOffCenterRHToRef = function (left, right, bottom, top, znear, zfar, result) { + Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, result); + result.m[10] *= -1.0; + }; + Matrix.PerspectiveLH = function (width, height, znear, zfar) { + var matrix = Matrix.Zero(); + matrix.m[0] = (2.0 * znear) / width; + matrix.m[1] = matrix.m[2] = matrix.m[3] = 0.0; + matrix.m[5] = (2.0 * znear) / height; + matrix.m[4] = matrix.m[6] = matrix.m[7] = 0.0; + matrix.m[10] = -zfar / (znear - zfar); + matrix.m[8] = matrix.m[9] = 0.0; + matrix.m[11] = 1.0; + matrix.m[12] = matrix.m[13] = matrix.m[15] = 0.0; + matrix.m[14] = (znear * zfar) / (znear - zfar); + return matrix; + }; + Matrix.PerspectiveFovLH = function (fov, aspect, znear, zfar) { + var matrix = Matrix.Zero(); + Matrix.PerspectiveFovLHToRef(fov, aspect, znear, zfar, matrix); + return matrix; + }; + Matrix.PerspectiveFovLHToRef = function (fov, aspect, znear, zfar, result, isVerticalFovFixed) { + if (isVerticalFovFixed === void 0) { isVerticalFovFixed = true; } + var tan = 1.0 / (Math.tan(fov * 0.5)); + if (isVerticalFovFixed) { + result.m[0] = tan / aspect; + } + else { + result.m[0] = tan; + } + result.m[1] = result.m[2] = result.m[3] = 0.0; + if (isVerticalFovFixed) { + result.m[5] = tan; + } + else { + result.m[5] = tan * aspect; + } + result.m[4] = result.m[6] = result.m[7] = 0.0; + result.m[8] = result.m[9] = 0.0; + result.m[10] = zfar / (zfar - znear); + result.m[11] = 1.0; + result.m[12] = result.m[13] = result.m[15] = 0.0; + result.m[14] = -(znear * zfar) / (zfar - znear); + }; + Matrix.PerspectiveFovRH = function (fov, aspect, znear, zfar) { + var matrix = Matrix.Zero(); + Matrix.PerspectiveFovRHToRef(fov, aspect, znear, zfar, matrix); + return matrix; + }; + Matrix.PerspectiveFovRHToRef = function (fov, aspect, znear, zfar, result, isVerticalFovFixed) { + if (isVerticalFovFixed === void 0) { isVerticalFovFixed = true; } + var tan = 1.0 / (Math.tan(fov * 0.5)); + if (isVerticalFovFixed) { + result.m[0] = tan / aspect; + } + else { + result.m[0] = tan; + } + result.m[1] = result.m[2] = result.m[3] = 0.0; + if (isVerticalFovFixed) { + result.m[5] = tan; + } + else { + result.m[5] = tan * aspect; + } + result.m[4] = result.m[6] = result.m[7] = 0.0; + result.m[8] = result.m[9] = 0.0; + result.m[10] = zfar / (znear - zfar); + result.m[11] = -1.0; + result.m[12] = result.m[13] = result.m[15] = 0.0; + result.m[14] = (znear * zfar) / (znear - zfar); + }; + Matrix.PerspectiveFovWebVRToRef = function (fov, znear, zfar, result, isVerticalFovFixed) { + if (isVerticalFovFixed === void 0) { isVerticalFovFixed = true; } + var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0); + var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0); + var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0); + var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0); + var xScale = 2.0 / (leftTan + rightTan); + var yScale = 2.0 / (upTan + downTan); + result.m[0] = xScale; + result.m[1] = result.m[2] = result.m[3] = result.m[4] = 0.0; + result.m[5] = yScale; + result.m[6] = result.m[7] = 0.0; + result.m[8] = ((leftTan - rightTan) * xScale * 0.5); + result.m[9] = -((upTan - downTan) * yScale * 0.5); + //result.m[10] = -(znear + zfar) / (zfar - znear); + result.m[10] = -zfar / (znear - zfar); + result.m[11] = 1.0; + result.m[12] = result.m[13] = result.m[15] = 0.0; + //result.m[14] = -(2.0 * zfar * znear) / (zfar - znear); + result.m[14] = (znear * zfar) / (znear - zfar); + }; + Matrix.GetFinalMatrix = function (viewport, world, view, projection, zmin, zmax) { + var cw = viewport.width; + var ch = viewport.height; + var cx = viewport.x; + var cy = viewport.y; + var viewportMatrix = Matrix.FromValues(cw / 2.0, 0, 0, 0, 0, -ch / 2.0, 0, 0, 0, 0, zmax - zmin, 0, cx + cw / 2.0, ch / 2.0 + cy, zmin, 1); + return world.multiply(view).multiply(projection).multiply(viewportMatrix); + }; + Matrix.GetAsMatrix2x2 = function (matrix) { + return new Float32Array([ + matrix.m[0], matrix.m[1], + matrix.m[4], matrix.m[5] + ]); + }; + Matrix.GetAsMatrix3x3 = function (matrix) { + return new Float32Array([ + matrix.m[0], matrix.m[1], matrix.m[2], + matrix.m[4], matrix.m[5], matrix.m[6], + matrix.m[8], matrix.m[9], matrix.m[10] + ]); + }; + Matrix.Transpose = function (matrix) { + var result = new Matrix(); + result.m[0] = matrix.m[0]; + result.m[1] = matrix.m[4]; + result.m[2] = matrix.m[8]; + result.m[3] = matrix.m[12]; + result.m[4] = matrix.m[1]; + result.m[5] = matrix.m[5]; + result.m[6] = matrix.m[9]; + result.m[7] = matrix.m[13]; + result.m[8] = matrix.m[2]; + result.m[9] = matrix.m[6]; + result.m[10] = matrix.m[10]; + result.m[11] = matrix.m[14]; + result.m[12] = matrix.m[3]; + result.m[13] = matrix.m[7]; + result.m[14] = matrix.m[11]; + result.m[15] = matrix.m[15]; + return result; + }; + Matrix.Reflection = function (plane) { + var matrix = new Matrix(); + Matrix.ReflectionToRef(plane, matrix); + return matrix; + }; + Matrix.ReflectionToRef = function (plane, result) { + plane.normalize(); + var x = plane.normal.x; + var y = plane.normal.y; + var z = plane.normal.z; + var temp = -2 * x; + var temp2 = -2 * y; + var temp3 = -2 * z; + result.m[0] = (temp * x) + 1; + result.m[1] = temp2 * x; + result.m[2] = temp3 * x; + result.m[3] = 0.0; + result.m[4] = temp * y; + result.m[5] = (temp2 * y) + 1; + result.m[6] = temp3 * y; + result.m[7] = 0.0; + result.m[8] = temp * z; + result.m[9] = temp2 * z; + result.m[10] = (temp3 * z) + 1; + result.m[11] = 0.0; + result.m[12] = temp * plane.d; + result.m[13] = temp2 * plane.d; + result.m[14] = temp3 * plane.d; + result.m[15] = 1.0; + }; + Matrix.FromXYZAxesToRef = function (xaxis, yaxis, zaxis, mat) { + mat.m[0] = xaxis.x; + mat.m[1] = xaxis.y; + mat.m[2] = xaxis.z; + mat.m[3] = 0; + mat.m[4] = yaxis.x; + mat.m[5] = yaxis.y; + mat.m[6] = yaxis.z; + mat.m[7] = 0; + mat.m[8] = zaxis.x; + mat.m[9] = zaxis.y; + mat.m[10] = zaxis.z; + mat.m[11] = 0; + mat.m[12] = 0; + mat.m[13] = 0; + mat.m[14] = 0; + mat.m[15] = 1; + }; + Matrix.FromQuaternionToRef = function (quat, result) { + var xx = quat.x * quat.x; + var yy = quat.y * quat.y; + var zz = quat.z * quat.z; + var xy = quat.x * quat.y; + var zw = quat.z * quat.w; + var zx = quat.z * quat.x; + var yw = quat.y * quat.w; + var yz = quat.y * quat.z; + var xw = quat.x * quat.w; + result.m[0] = 1.0 - (2.0 * (yy + zz)); + result.m[1] = 2.0 * (xy + zw); + result.m[2] = 2.0 * (zx - yw); + result.m[3] = 0; + result.m[4] = 2.0 * (xy - zw); + result.m[5] = 1.0 - (2.0 * (zz + xx)); + result.m[6] = 2.0 * (yz + xw); + result.m[7] = 0; + result.m[8] = 2.0 * (zx + yw); + result.m[9] = 2.0 * (yz - xw); + result.m[10] = 1.0 - (2.0 * (yy + xx)); + result.m[11] = 0; + result.m[12] = 0; + result.m[13] = 0; + result.m[14] = 0; + result.m[15] = 1.0; + }; + Matrix._tempQuaternion = new Quaternion(); + Matrix._xAxis = Vector3.Zero(); + Matrix._yAxis = Vector3.Zero(); + Matrix._zAxis = Vector3.Zero(); + return Matrix; + }()); + BABYLON.Matrix = Matrix; + var Plane = (function () { + function Plane(a, b, c, d) { + this.normal = new Vector3(a, b, c); + this.d = d; + } + Plane.prototype.asArray = function () { + return [this.normal.x, this.normal.y, this.normal.z, this.d]; + }; + // Methods + Plane.prototype.clone = function () { + return new Plane(this.normal.x, this.normal.y, this.normal.z, this.d); + }; + Plane.prototype.getClassName = function () { + return "Plane"; + }; + Plane.prototype.getHashCode = function () { + var hash = this.normal.getHashCode(); + hash = (hash * 397) ^ (this.d || 0); + return hash; + }; + Plane.prototype.normalize = function () { + var norm = (Math.sqrt((this.normal.x * this.normal.x) + (this.normal.y * this.normal.y) + (this.normal.z * this.normal.z))); + var magnitude = 0; + if (norm !== 0) { + magnitude = 1.0 / norm; + } + this.normal.x *= magnitude; + this.normal.y *= magnitude; + this.normal.z *= magnitude; + this.d *= magnitude; + return this; + }; + Plane.prototype.transform = function (transformation) { + var transposedMatrix = Matrix.Transpose(transformation); + var x = this.normal.x; + var y = this.normal.y; + var z = this.normal.z; + var d = this.d; + var normalX = (((x * transposedMatrix.m[0]) + (y * transposedMatrix.m[1])) + (z * transposedMatrix.m[2])) + (d * transposedMatrix.m[3]); + var normalY = (((x * transposedMatrix.m[4]) + (y * transposedMatrix.m[5])) + (z * transposedMatrix.m[6])) + (d * transposedMatrix.m[7]); + var normalZ = (((x * transposedMatrix.m[8]) + (y * transposedMatrix.m[9])) + (z * transposedMatrix.m[10])) + (d * transposedMatrix.m[11]); + var finalD = (((x * transposedMatrix.m[12]) + (y * transposedMatrix.m[13])) + (z * transposedMatrix.m[14])) + (d * transposedMatrix.m[15]); + return new Plane(normalX, normalY, normalZ, finalD); + }; + Plane.prototype.dotCoordinate = function (point) { + return ((((this.normal.x * point.x) + (this.normal.y * point.y)) + (this.normal.z * point.z)) + this.d); + }; + Plane.prototype.copyFromPoints = function (point1, point2, point3) { + var x1 = point2.x - point1.x; + var y1 = point2.y - point1.y; + var z1 = point2.z - point1.z; + var x2 = point3.x - point1.x; + var y2 = point3.y - point1.y; + var z2 = point3.z - point1.z; + var yz = (y1 * z2) - (z1 * y2); + var xz = (z1 * x2) - (x1 * z2); + var xy = (x1 * y2) - (y1 * x2); + var pyth = (Math.sqrt((yz * yz) + (xz * xz) + (xy * xy))); + var invPyth; + if (pyth !== 0) { + invPyth = 1.0 / pyth; + } + else { + invPyth = 0; + } + this.normal.x = yz * invPyth; + this.normal.y = xz * invPyth; + this.normal.z = xy * invPyth; + this.d = -((this.normal.x * point1.x) + (this.normal.y * point1.y) + (this.normal.z * point1.z)); + return this; + }; + Plane.prototype.isFrontFacingTo = function (direction, epsilon) { + var dot = Vector3.Dot(this.normal, direction); + return (dot <= epsilon); + }; + Plane.prototype.signedDistanceTo = function (point) { + return Vector3.Dot(point, this.normal) + this.d; + }; + // Statics + Plane.FromArray = function (array) { + return new Plane(array[0], array[1], array[2], array[3]); + }; + Plane.FromPoints = function (point1, point2, point3) { + var result = new Plane(0, 0, 0, 0); + result.copyFromPoints(point1, point2, point3); + return result; + }; + Plane.FromPositionAndNormal = function (origin, normal) { + var result = new Plane(0, 0, 0, 0); + normal.normalize(); + result.normal = normal; + result.d = -(normal.x * origin.x + normal.y * origin.y + normal.z * origin.z); + return result; + }; + Plane.SignedDistanceToPlaneFromPositionAndNormal = function (origin, normal, point) { + var d = -(normal.x * origin.x + normal.y * origin.y + normal.z * origin.z); + return Vector3.Dot(point, normal) + d; + }; + return Plane; + }()); + BABYLON.Plane = Plane; + var Viewport = (function () { + function Viewport(x, y, width, height) { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + Viewport.prototype.toGlobal = function (renderWidth, renderHeight) { + return new Viewport(this.x * renderWidth, this.y * renderHeight, this.width * renderWidth, this.height * renderHeight); + }; + return Viewport; + }()); + BABYLON.Viewport = Viewport; + var Frustum = (function () { + function Frustum() { + } + Frustum.GetPlanes = function (transform) { + var frustumPlanes = []; + for (var index = 0; index < 6; index++) { + frustumPlanes.push(new Plane(0, 0, 0, 0)); + } + Frustum.GetPlanesToRef(transform, frustumPlanes); + return frustumPlanes; + }; + Frustum.GetPlanesToRef = function (transform, frustumPlanes) { + // Near + frustumPlanes[0].normal.x = transform.m[3] + transform.m[2]; + frustumPlanes[0].normal.y = transform.m[7] + transform.m[6]; + frustumPlanes[0].normal.z = transform.m[11] + transform.m[10]; + frustumPlanes[0].d = transform.m[15] + transform.m[14]; + frustumPlanes[0].normalize(); + // Far + frustumPlanes[1].normal.x = transform.m[3] - transform.m[2]; + frustumPlanes[1].normal.y = transform.m[7] - transform.m[6]; + frustumPlanes[1].normal.z = transform.m[11] - transform.m[10]; + frustumPlanes[1].d = transform.m[15] - transform.m[14]; + frustumPlanes[1].normalize(); + // Left + frustumPlanes[2].normal.x = transform.m[3] + transform.m[0]; + frustumPlanes[2].normal.y = transform.m[7] + transform.m[4]; + frustumPlanes[2].normal.z = transform.m[11] + transform.m[8]; + frustumPlanes[2].d = transform.m[15] + transform.m[12]; + frustumPlanes[2].normalize(); + // Right + frustumPlanes[3].normal.x = transform.m[3] - transform.m[0]; + frustumPlanes[3].normal.y = transform.m[7] - transform.m[4]; + frustumPlanes[3].normal.z = transform.m[11] - transform.m[8]; + frustumPlanes[3].d = transform.m[15] - transform.m[12]; + frustumPlanes[3].normalize(); + // Top + frustumPlanes[4].normal.x = transform.m[3] - transform.m[1]; + frustumPlanes[4].normal.y = transform.m[7] - transform.m[5]; + frustumPlanes[4].normal.z = transform.m[11] - transform.m[9]; + frustumPlanes[4].d = transform.m[15] - transform.m[13]; + frustumPlanes[4].normalize(); + // Bottom + frustumPlanes[5].normal.x = transform.m[3] + transform.m[1]; + frustumPlanes[5].normal.y = transform.m[7] + transform.m[5]; + frustumPlanes[5].normal.z = transform.m[11] + transform.m[9]; + frustumPlanes[5].d = transform.m[15] + transform.m[13]; + frustumPlanes[5].normalize(); + }; + return Frustum; + }()); + BABYLON.Frustum = Frustum; + (function (Space) { + Space[Space["LOCAL"] = 0] = "LOCAL"; + Space[Space["WORLD"] = 1] = "WORLD"; + })(BABYLON.Space || (BABYLON.Space = {})); + var Space = BABYLON.Space; + var Axis = (function () { + function Axis() { + } + Axis.X = new Vector3(1, 0, 0); + Axis.Y = new Vector3(0, 1, 0); + Axis.Z = new Vector3(0, 0, 1); + return Axis; + }()); + BABYLON.Axis = Axis; + ; + var BezierCurve = (function () { + function BezierCurve() { + } + BezierCurve.interpolate = function (t, x1, y1, x2, y2) { + // Extract X (which is equal to time here) + var f0 = 1 - 3 * x2 + 3 * x1; + var f1 = 3 * x2 - 6 * x1; + var f2 = 3 * x1; + var refinedT = t; + for (var i = 0; i < 5; i++) { + var refinedT2 = refinedT * refinedT; + var refinedT3 = refinedT2 * refinedT; + var x = f0 * refinedT3 + f1 * refinedT2 + f2 * refinedT; + var slope = 1.0 / (3.0 * f0 * refinedT2 + 2.0 * f1 * refinedT + f2); + refinedT -= (x - t) * slope; + refinedT = Math.min(1, Math.max(0, refinedT)); + } + // Resolve cubic bezier for the given x + return 3 * Math.pow(1 - refinedT, 2) * refinedT * y1 + + 3 * (1 - refinedT) * Math.pow(refinedT, 2) * y2 + + Math.pow(refinedT, 3); + }; + return BezierCurve; + }()); + BABYLON.BezierCurve = BezierCurve; + (function (Orientation) { + Orientation[Orientation["CW"] = 0] = "CW"; + Orientation[Orientation["CCW"] = 1] = "CCW"; + })(BABYLON.Orientation || (BABYLON.Orientation = {})); + var Orientation = BABYLON.Orientation; + var Angle = (function () { + function Angle(radians) { + var _this = this; + this.degrees = function () { return _this._radians * 180 / Math.PI; }; + this.radians = function () { return _this._radians; }; + this._radians = radians; + if (this._radians < 0) + this._radians += (2 * Math.PI); + } + Angle.BetweenTwoPoints = function (a, b) { + var delta = b.subtract(a); + var theta = Math.atan2(delta.y, delta.x); + return new Angle(theta); + }; + Angle.FromRadians = function (radians) { + return new Angle(radians); + }; + Angle.FromDegrees = function (degrees) { + return new Angle(degrees * Math.PI / 180); + }; + return Angle; + }()); + BABYLON.Angle = Angle; + var Arc2 = (function () { + function Arc2(startPoint, midPoint, endPoint) { + this.startPoint = startPoint; + this.midPoint = midPoint; + this.endPoint = endPoint; + var temp = Math.pow(midPoint.x, 2) + Math.pow(midPoint.y, 2); + var startToMid = (Math.pow(startPoint.x, 2) + Math.pow(startPoint.y, 2) - temp) / 2.; + var midToEnd = (temp - Math.pow(endPoint.x, 2) - Math.pow(endPoint.y, 2)) / 2.; + var det = (startPoint.x - midPoint.x) * (midPoint.y - endPoint.y) - (midPoint.x - endPoint.x) * (startPoint.y - midPoint.y); + this.centerPoint = new Vector2((startToMid * (midPoint.y - endPoint.y) - midToEnd * (startPoint.y - midPoint.y)) / det, ((startPoint.x - midPoint.x) * midToEnd - (midPoint.x - endPoint.x) * startToMid) / det); + this.radius = this.centerPoint.subtract(this.startPoint).length(); + this.startAngle = Angle.BetweenTwoPoints(this.centerPoint, this.startPoint); + var a1 = this.startAngle.degrees(); + var a2 = Angle.BetweenTwoPoints(this.centerPoint, this.midPoint).degrees(); + var a3 = Angle.BetweenTwoPoints(this.centerPoint, this.endPoint).degrees(); + // angles correction + if (a2 - a1 > +180.0) + a2 -= 360.0; + if (a2 - a1 < -180.0) + a2 += 360.0; + if (a3 - a2 > +180.0) + a3 -= 360.0; + if (a3 - a2 < -180.0) + a3 += 360.0; + this.orientation = (a2 - a1) < 0 ? Orientation.CW : Orientation.CCW; + this.angle = Angle.FromDegrees(this.orientation === Orientation.CW ? a1 - a3 : a3 - a1); + } + return Arc2; + }()); + BABYLON.Arc2 = Arc2; + var Path2 = (function () { + function Path2(x, y) { + this._points = new Array(); + this._length = 0; + this.closed = false; + this._points.push(new Vector2(x, y)); + } + Path2.prototype.addLineTo = function (x, y) { + if (closed) { + //Tools.Error("cannot add lines to closed paths"); + return this; + } + var newPoint = new Vector2(x, y); + var previousPoint = this._points[this._points.length - 1]; + this._points.push(newPoint); + this._length += newPoint.subtract(previousPoint).length(); + return this; + }; + Path2.prototype.addArcTo = function (midX, midY, endX, endY, numberOfSegments) { + if (numberOfSegments === void 0) { numberOfSegments = 36; } + if (closed) { + //Tools.Error("cannot add arcs to closed paths"); + return this; + } + var startPoint = this._points[this._points.length - 1]; + var midPoint = new Vector2(midX, midY); + var endPoint = new Vector2(endX, endY); + var arc = new Arc2(startPoint, midPoint, endPoint); + var increment = arc.angle.radians() / numberOfSegments; + if (arc.orientation === Orientation.CW) + increment *= -1; + var currentAngle = arc.startAngle.radians() + increment; + for (var i = 0; i < numberOfSegments; i++) { + var x = Math.cos(currentAngle) * arc.radius + arc.centerPoint.x; + var y = Math.sin(currentAngle) * arc.radius + arc.centerPoint.y; + this.addLineTo(x, y); + currentAngle += increment; + } + return this; + }; + Path2.prototype.close = function () { + this.closed = true; + return this; + }; + Path2.prototype.length = function () { + var result = this._length; + if (!this.closed) { + var lastPoint = this._points[this._points.length - 1]; + var firstPoint = this._points[0]; + result += (firstPoint.subtract(lastPoint).length()); + } + return result; + }; + Path2.prototype.getPoints = function () { + return this._points; + }; + Path2.prototype.getPointAtLengthPosition = function (normalizedLengthPosition) { + if (normalizedLengthPosition < 0 || normalizedLengthPosition > 1) { + //Tools.Error("normalized length position should be between 0 and 1."); + return Vector2.Zero(); + } + var lengthPosition = normalizedLengthPosition * this.length(); + var previousOffset = 0; + for (var i = 0; i < this._points.length; i++) { + var j = (i + 1) % this._points.length; + var a = this._points[i]; + var b = this._points[j]; + var bToA = b.subtract(a); + var nextOffset = (bToA.length() + previousOffset); + if (lengthPosition >= previousOffset && lengthPosition <= nextOffset) { + var dir = bToA.normalize(); + var localOffset = lengthPosition - previousOffset; + return new Vector2(a.x + (dir.x * localOffset), a.y + (dir.y * localOffset)); + } + previousOffset = nextOffset; + } + //Tools.Error("internal error"); + return Vector2.Zero(); + }; + Path2.StartingAt = function (x, y) { + return new Path2(x, y); + }; + return Path2; + }()); + BABYLON.Path2 = Path2; + var Path3D = (function () { + /** + * new Path3D(path, normal, raw) + * Creates a Path3D. A Path3D is a logical math object, so not a mesh. + * please read the description in the tutorial : http://doc.babylonjs.com/tutorials/How_to_use_Path3D + * path : an array of Vector3, the curve axis of the Path3D + * normal (optional) : Vector3, the first wanted normal to the curve. Ex (0, 1, 0) for a vertical normal. + * raw (optional, default false) : boolean, if true the returned Path3D isn't normalized. Useful to depict path acceleration or speed. + */ + function Path3D(path, firstNormal, raw) { + this.path = path; + this._curve = new Array(); + this._distances = new Array(); + this._tangents = new Array(); + this._normals = new Array(); + this._binormals = new Array(); + for (var p = 0; p < path.length; p++) { + this._curve[p] = path[p].clone(); // hard copy + } + this._raw = raw || false; + this._compute(firstNormal); + } + /** + * Returns the Path3D array of successive Vector3 designing its curve. + */ + Path3D.prototype.getCurve = function () { + return this._curve; + }; + /** + * Returns an array populated with tangent vectors on each Path3D curve point. + */ + Path3D.prototype.getTangents = function () { + return this._tangents; + }; + /** + * Returns an array populated with normal vectors on each Path3D curve point. + */ + Path3D.prototype.getNormals = function () { + return this._normals; + }; + /** + * Returns an array populated with binormal vectors on each Path3D curve point. + */ + Path3D.prototype.getBinormals = function () { + return this._binormals; + }; + /** + * Returns an array populated with distances (float) of the i-th point from the first curve point. + */ + Path3D.prototype.getDistances = function () { + return this._distances; + }; + /** + * Forces the Path3D tangent, normal, binormal and distance recomputation. + * Returns the same object updated. + */ + Path3D.prototype.update = function (path, firstNormal) { + for (var p = 0; p < path.length; p++) { + this._curve[p].x = path[p].x; + this._curve[p].y = path[p].y; + this._curve[p].z = path[p].z; + } + this._compute(firstNormal); + return this; + }; + // private function compute() : computes tangents, normals and binormals + Path3D.prototype._compute = function (firstNormal) { + var l = this._curve.length; + // first and last tangents + this._tangents[0] = this._getFirstNonNullVector(0); + if (!this._raw) { + this._tangents[0].normalize(); + } + this._tangents[l - 1] = this._curve[l - 1].subtract(this._curve[l - 2]); + if (!this._raw) { + this._tangents[l - 1].normalize(); + } + // normals and binormals at first point : arbitrary vector with _normalVector() + var tg0 = this._tangents[0]; + var pp0 = this._normalVector(this._curve[0], tg0, firstNormal); + this._normals[0] = pp0; + if (!this._raw) { + this._normals[0].normalize(); + } + this._binormals[0] = Vector3.Cross(tg0, this._normals[0]); + if (!this._raw) { + this._binormals[0].normalize(); + } + this._distances[0] = 0.0; + // normals and binormals : next points + var prev; // previous vector (segment) + var cur; // current vector (segment) + var curTang; // current tangent + // previous normal + var prevBinor; // previous binormal + for (var i = 1; i < l; i++) { + // tangents + prev = this._getLastNonNullVector(i); + if (i < l - 1) { + cur = this._getFirstNonNullVector(i); + this._tangents[i] = prev.add(cur); + this._tangents[i].normalize(); + } + this._distances[i] = this._distances[i - 1] + prev.length(); + // normals and binormals + // http://www.cs.cmu.edu/afs/andrew/scs/cs/15-462/web/old/asst2camera.html + curTang = this._tangents[i]; + prevBinor = this._binormals[i - 1]; + this._normals[i] = Vector3.Cross(prevBinor, curTang); + if (!this._raw) { + this._normals[i].normalize(); + } + this._binormals[i] = Vector3.Cross(curTang, this._normals[i]); + if (!this._raw) { + this._binormals[i].normalize(); + } + } + }; + // private function getFirstNonNullVector(index) + // returns the first non null vector from index : curve[index + N].subtract(curve[index]) + Path3D.prototype._getFirstNonNullVector = function (index) { + var i = 1; + var nNVector = this._curve[index + i].subtract(this._curve[index]); + while (nNVector.length() === 0 && index + i + 1 < this._curve.length) { + i++; + nNVector = this._curve[index + i].subtract(this._curve[index]); + } + return nNVector; + }; + // private function getLastNonNullVector(index) + // returns the last non null vector from index : curve[index].subtract(curve[index - N]) + Path3D.prototype._getLastNonNullVector = function (index) { + var i = 1; + var nLVector = this._curve[index].subtract(this._curve[index - i]); + while (nLVector.length() === 0 && index > i + 1) { + i++; + nLVector = this._curve[index].subtract(this._curve[index - i]); + } + return nLVector; + }; + // private function normalVector(v0, vt, va) : + // returns an arbitrary point in the plane defined by the point v0 and the vector vt orthogonal to this plane + // if va is passed, it returns the va projection on the plane orthogonal to vt at the point v0 + Path3D.prototype._normalVector = function (v0, vt, va) { + var normal0; + var tgl = vt.length(); + if (tgl === 0.0) { + tgl = 1.0; + } + if (va === undefined || va === null) { + var point; + if (!MathTools.WithinEpsilon(Math.abs(vt.y) / tgl, 1.0, BABYLON.Epsilon)) { + point = new Vector3(0.0, -1.0, 0.0); + } + else if (!MathTools.WithinEpsilon(Math.abs(vt.x) / tgl, 1.0, BABYLON.Epsilon)) { + point = new Vector3(1.0, 0.0, 0.0); + } + else if (!MathTools.WithinEpsilon(Math.abs(vt.z) / tgl, 1.0, BABYLON.Epsilon)) { + point = new Vector3(0.0, 0.0, 1.0); + } + normal0 = Vector3.Cross(vt, point); + } + else { + normal0 = Vector3.Cross(vt, va); + Vector3.CrossToRef(normal0, vt, normal0); + } + normal0.normalize(); + return normal0; + }; + return Path3D; + }()); + BABYLON.Path3D = Path3D; + var Curve3 = (function () { + /** + * A Curve3 object is a logical object, so not a mesh, to handle curves in the 3D geometric space. + * A Curve3 is designed from a series of successive Vector3. + * Tuto : http://doc.babylonjs.com/tutorials/How_to_use_Curve3#curve3-object + */ + function Curve3(points) { + this._length = 0.0; + this._points = points; + this._length = this._computeLength(points); + } + /** + * Returns a Curve3 object along a Quadratic Bezier curve : http://doc.babylonjs.com/tutorials/How_to_use_Curve3#quadratic-bezier-curve + * @param v0 (Vector3) the origin point of the Quadratic Bezier + * @param v1 (Vector3) the control point + * @param v2 (Vector3) the end point of the Quadratic Bezier + * @param nbPoints (integer) the wanted number of points in the curve + */ + Curve3.CreateQuadraticBezier = function (v0, v1, v2, nbPoints) { + nbPoints = nbPoints > 2 ? nbPoints : 3; + var bez = new Array(); + var equation = function (t, val0, val1, val2) { + var res = (1.0 - t) * (1.0 - t) * val0 + 2.0 * t * (1.0 - t) * val1 + t * t * val2; + return res; + }; + for (var i = 0; i <= nbPoints; i++) { + bez.push(new Vector3(equation(i / nbPoints, v0.x, v1.x, v2.x), equation(i / nbPoints, v0.y, v1.y, v2.y), equation(i / nbPoints, v0.z, v1.z, v2.z))); + } + return new Curve3(bez); + }; + /** + * Returns a Curve3 object along a Cubic Bezier curve : http://doc.babylonjs.com/tutorials/How_to_use_Curve3#cubic-bezier-curve + * @param v0 (Vector3) the origin point of the Cubic Bezier + * @param v1 (Vector3) the first control point + * @param v2 (Vector3) the second control point + * @param v3 (Vector3) the end point of the Cubic Bezier + * @param nbPoints (integer) the wanted number of points in the curve + */ + Curve3.CreateCubicBezier = function (v0, v1, v2, v3, nbPoints) { + nbPoints = nbPoints > 3 ? nbPoints : 4; + var bez = new Array(); + var equation = function (t, val0, val1, val2, val3) { + var res = (1.0 - t) * (1.0 - t) * (1.0 - t) * val0 + 3.0 * t * (1.0 - t) * (1.0 - t) * val1 + 3.0 * t * t * (1.0 - t) * val2 + t * t * t * val3; + return res; + }; + for (var i = 0; i <= nbPoints; i++) { + bez.push(new Vector3(equation(i / nbPoints, v0.x, v1.x, v2.x, v3.x), equation(i / nbPoints, v0.y, v1.y, v2.y, v3.y), equation(i / nbPoints, v0.z, v1.z, v2.z, v3.z))); + } + return new Curve3(bez); + }; + /** + * Returns a Curve3 object along a Hermite Spline curve : http://doc.babylonjs.com/tutorials/How_to_use_Curve3#hermite-spline + * @param p1 (Vector3) the origin point of the Hermite Spline + * @param t1 (Vector3) the tangent vector at the origin point + * @param p2 (Vector3) the end point of the Hermite Spline + * @param t2 (Vector3) the tangent vector at the end point + * @param nbPoints (integer) the wanted number of points in the curve + */ + Curve3.CreateHermiteSpline = function (p1, t1, p2, t2, nbPoints) { + var hermite = new Array(); + var step = 1.0 / nbPoints; + for (var i = 0; i <= nbPoints; i++) { + hermite.push(Vector3.Hermite(p1, t1, p2, t2, i * step)); + } + return new Curve3(hermite); + }; + /** + * Returns the Curve3 stored array of successive Vector3 + */ + Curve3.prototype.getPoints = function () { + return this._points; + }; + /** + * Returns the computed length (float) of the curve. + */ + Curve3.prototype.length = function () { + return this._length; + }; + /** + * Returns a new instance of Curve3 object : var curve = curveA.continue(curveB); + * This new Curve3 is built by translating and sticking the curveB at the end of the curveA. + * curveA and curveB keep unchanged. + */ + Curve3.prototype.continue = function (curve) { + var lastPoint = this._points[this._points.length - 1]; + var continuedPoints = this._points.slice(); + var curvePoints = curve.getPoints(); + for (var i = 1; i < curvePoints.length; i++) { + continuedPoints.push(curvePoints[i].subtract(curvePoints[0]).add(lastPoint)); + } + var continuedCurve = new Curve3(continuedPoints); + return continuedCurve; + }; + Curve3.prototype._computeLength = function (path) { + var l = 0; + for (var i = 1; i < path.length; i++) { + l += (path[i].subtract(path[i - 1])).length(); + } + return l; + }; + return Curve3; + }()); + BABYLON.Curve3 = Curve3; + // SphericalHarmonics + var SphericalHarmonics = (function () { + function SphericalHarmonics() { + this.L00 = Vector3.Zero(); + this.L1_1 = Vector3.Zero(); + this.L10 = Vector3.Zero(); + this.L11 = Vector3.Zero(); + this.L2_2 = Vector3.Zero(); + this.L2_1 = Vector3.Zero(); + this.L20 = Vector3.Zero(); + this.L21 = Vector3.Zero(); + this.L22 = Vector3.Zero(); + } + SphericalHarmonics.prototype.addLight = function (direction, color, deltaSolidAngle) { + var colorVector = new Vector3(color.r, color.g, color.b); + var c = colorVector.scale(deltaSolidAngle); + this.L00 = this.L00.add(c.scale(0.282095)); + this.L1_1 = this.L1_1.add(c.scale(0.488603 * direction.y)); + this.L10 = this.L10.add(c.scale(0.488603 * direction.z)); + this.L11 = this.L11.add(c.scale(0.488603 * direction.x)); + this.L2_2 = this.L2_2.add(c.scale(1.092548 * direction.x * direction.y)); + this.L2_1 = this.L2_1.add(c.scale(1.092548 * direction.y * direction.z)); + this.L21 = this.L21.add(c.scale(1.092548 * direction.x * direction.z)); + this.L20 = this.L20.add(c.scale(0.315392 * (3.0 * direction.z * direction.z - 1.0))); + this.L22 = this.L22.add(c.scale(0.546274 * (direction.x * direction.x - direction.y * direction.y))); + }; + SphericalHarmonics.prototype.scale = function (scale) { + this.L00 = this.L00.scale(scale); + this.L1_1 = this.L1_1.scale(scale); + this.L10 = this.L10.scale(scale); + this.L11 = this.L11.scale(scale); + this.L2_2 = this.L2_2.scale(scale); + this.L2_1 = this.L2_1.scale(scale); + this.L20 = this.L20.scale(scale); + this.L21 = this.L21.scale(scale); + this.L22 = this.L22.scale(scale); + }; + return SphericalHarmonics; + }()); + BABYLON.SphericalHarmonics = SphericalHarmonics; + // SphericalPolynomial + var SphericalPolynomial = (function () { + function SphericalPolynomial() { + this.x = Vector3.Zero(); + this.y = Vector3.Zero(); + this.z = Vector3.Zero(); + this.xx = Vector3.Zero(); + this.yy = Vector3.Zero(); + this.zz = Vector3.Zero(); + this.xy = Vector3.Zero(); + this.yz = Vector3.Zero(); + this.zx = Vector3.Zero(); + } + SphericalPolynomial.prototype.addAmbient = function (color) { + var colorVector = new Vector3(color.r, color.g, color.b); + this.xx = this.xx.add(colorVector); + this.yy = this.yy.add(colorVector); + this.zz = this.zz.add(colorVector); + }; + SphericalPolynomial.getSphericalPolynomialFromHarmonics = function (harmonics) { + var result = new SphericalPolynomial(); + result.x = harmonics.L11.scale(1.02333); + result.y = harmonics.L1_1.scale(1.02333); + result.z = harmonics.L10.scale(1.02333); + result.xx = harmonics.L00.scale(0.886277).subtract(harmonics.L20.scale(0.247708)).add(harmonics.L22.scale(0.429043)); + result.yy = harmonics.L00.scale(0.886277).subtract(harmonics.L20.scale(0.247708)).subtract(harmonics.L22.scale(0.429043)); + result.zz = harmonics.L00.scale(0.886277).add(harmonics.L20.scale(0.495417)); + result.yz = harmonics.L2_1.scale(0.858086); + result.zx = harmonics.L21.scale(0.858086); + result.xy = harmonics.L2_2.scale(0.858086); + return result; + }; + return SphericalPolynomial; + }()); + BABYLON.SphericalPolynomial = SphericalPolynomial; + // Vertex formats + var PositionNormalVertex = (function () { + function PositionNormalVertex(position, normal) { + if (position === void 0) { position = Vector3.Zero(); } + if (normal === void 0) { normal = Vector3.Up(); } + this.position = position; + this.normal = normal; + } + PositionNormalVertex.prototype.clone = function () { + return new PositionNormalVertex(this.position.clone(), this.normal.clone()); + }; + return PositionNormalVertex; + }()); + BABYLON.PositionNormalVertex = PositionNormalVertex; + var PositionNormalTextureVertex = (function () { + function PositionNormalTextureVertex(position, normal, uv) { + if (position === void 0) { position = Vector3.Zero(); } + if (normal === void 0) { normal = Vector3.Up(); } + if (uv === void 0) { uv = Vector2.Zero(); } + this.position = position; + this.normal = normal; + this.uv = uv; + } + PositionNormalTextureVertex.prototype.clone = function () { + return new PositionNormalTextureVertex(this.position.clone(), this.normal.clone(), this.uv.clone()); + }; + return PositionNormalTextureVertex; + }()); + BABYLON.PositionNormalTextureVertex = PositionNormalTextureVertex; + // Temporary pre-allocated objects for engine internal use + // usage in any internal function : + // var tmp = Tmp.Vector3[0]; <= gets access to the first pre-created Vector3 + // There's a Tmp array per object type : int, float, Vector2, Vector3, Vector4, Quaternion, Matrix + var Tmp = (function () { + function Tmp() { + } + Tmp.Color3 = [Color3.Black(), Color3.Black(), Color3.Black()]; + Tmp.Vector2 = [Vector2.Zero(), Vector2.Zero(), Vector2.Zero()]; // 3 temp Vector2 at once should be enough + Tmp.Vector3 = [Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), + Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero()]; // 9 temp Vector3 at once should be enough + Tmp.Vector4 = [Vector4.Zero(), Vector4.Zero(), Vector4.Zero()]; // 3 temp Vector4 at once should be enough + Tmp.Quaternion = [new Quaternion(0, 0, 0, 0)]; // 1 temp Quaternion at once should be enough + Tmp.Matrix = [Matrix.Zero(), Matrix.Zero(), + Matrix.Zero(), Matrix.Zero(), + Matrix.Zero(), Matrix.Zero(), + Matrix.Zero(), Matrix.Zero()]; // 6 temp Matrices at once should be enough + return Tmp; + }()); + BABYLON.Tmp = Tmp; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.math.js.map + + + +//# sourceMappingURL=babylon.mixins.js.map + +var BABYLON; +(function (BABYLON) { + function generateSerializableMember(type, sourceName) { + return function (target, propertyKey) { + if (!target.__serializableMembers) { + target.__serializableMembers = {}; + } + if (!target.__serializableMembers[propertyKey]) { + target.__serializableMembers[propertyKey] = { type: type, sourceName: sourceName }; + } + }; + } + function serialize(sourceName) { + return generateSerializableMember(0, sourceName); // value member + } + BABYLON.serialize = serialize; + function serializeAsTexture(sourceName) { + return generateSerializableMember(1, sourceName); // texture member + } + BABYLON.serializeAsTexture = serializeAsTexture; + function serializeAsColor3(sourceName) { + return generateSerializableMember(2, sourceName); // color3 member + } + BABYLON.serializeAsColor3 = serializeAsColor3; + function serializeAsFresnelParameters(sourceName) { + return generateSerializableMember(3, sourceName); // fresnel parameters member + } + BABYLON.serializeAsFresnelParameters = serializeAsFresnelParameters; + function serializeAsVector2(sourceName) { + return generateSerializableMember(4, sourceName); // vector2 member + } + BABYLON.serializeAsVector2 = serializeAsVector2; + function serializeAsVector3(sourceName) { + return generateSerializableMember(5, sourceName); // vector3 member + } + BABYLON.serializeAsVector3 = serializeAsVector3; + function serializeAsMeshReference(sourceName) { + return generateSerializableMember(6, sourceName); // mesh reference member + } + BABYLON.serializeAsMeshReference = serializeAsMeshReference; + function serializeAsColorCurves(sourceName) { + return generateSerializableMember(7, sourceName); // color curves + } + BABYLON.serializeAsColorCurves = serializeAsColorCurves; + var SerializationHelper = (function () { + function SerializationHelper() { + } + SerializationHelper.Serialize = function (entity, serializationObject) { + if (!serializationObject) { + serializationObject = {}; + } + // Tags + serializationObject.tags = BABYLON.Tags.GetTags(entity); + // Properties + for (var property in entity.__serializableMembers) { + var propertyDescriptor = entity.__serializableMembers[property]; + var targetPropertyName = propertyDescriptor.sourceName || property; + var propertyType = propertyDescriptor.type; + var sourceProperty = entity[property]; + if (sourceProperty !== undefined && sourceProperty !== null) { + switch (propertyType) { + case 0: + serializationObject[targetPropertyName] = sourceProperty; + break; + case 1: + serializationObject[targetPropertyName] = sourceProperty.serialize(); + break; + case 2: + serializationObject[targetPropertyName] = sourceProperty.asArray(); + break; + case 3: + serializationObject[targetPropertyName] = sourceProperty.serialize(); + break; + case 4: + serializationObject[targetPropertyName] = sourceProperty.asArray(); + break; + case 5: + serializationObject[targetPropertyName] = sourceProperty.asArray(); + break; + case 6: + serializationObject[targetPropertyName] = sourceProperty.id; + break; + case 7: + serializationObject[targetPropertyName] = sourceProperty.serialize(); + break; + } + } + } + return serializationObject; + }; + SerializationHelper.Parse = function (creationFunction, source, scene, rootUrl) { + var destination = creationFunction(); + // Tags + BABYLON.Tags.AddTagsTo(destination, source.tags); + // Properties + for (var property in destination.__serializableMembers) { + var propertyDescriptor = destination.__serializableMembers[property]; + var sourceProperty = source[propertyDescriptor.sourceName || property]; + var propertyType = propertyDescriptor.type; + if (sourceProperty !== undefined && sourceProperty !== null) { + switch (propertyType) { + case 0: + destination[property] = sourceProperty; + break; + case 1: + destination[property] = BABYLON.Texture.Parse(sourceProperty, scene, rootUrl); + break; + case 2: + destination[property] = BABYLON.Color3.FromArray(sourceProperty); + break; + case 3: + destination[property] = BABYLON.FresnelParameters.Parse(sourceProperty); + break; + case 4: + destination[property] = BABYLON.Vector2.FromArray(sourceProperty); + break; + case 5: + destination[property] = BABYLON.Vector3.FromArray(sourceProperty); + break; + case 6: + destination[property] = scene.getLastMeshByID(sourceProperty); + break; + case 7: + destination[property] = BABYLON.ColorCurves.Parse(sourceProperty); + break; + } + } + } + return destination; + }; + SerializationHelper.Clone = function (creationFunction, source) { + var destination = creationFunction(); + // Tags + BABYLON.Tags.AddTagsTo(destination, source.tags); + // Properties + for (var property in destination.__serializableMembers) { + var propertyDescriptor = destination.__serializableMembers[property]; + var sourceProperty = source[property]; + var propertyType = propertyDescriptor.type; + if (sourceProperty !== undefined && sourceProperty !== null) { + switch (propertyType) { + case 0: // Value + case 6: + destination[property] = sourceProperty; + break; + case 1: // Texture + case 2: // Color3 + case 3: // FresnelParameters + case 4: // Vector2 + case 5: // Vector3 + case 7: + destination[property] = sourceProperty.clone(); + break; + } + } + } + return destination; + }; + return SerializationHelper; + }()); + BABYLON.SerializationHelper = SerializationHelper; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.decorators.js.map + +var BABYLON; +(function (BABYLON) { + /** + * A class serves as a medium between the observable and its observers + */ + var EventState = (function () { + /** + * If the callback of a given Observer set skipNextObservers to true the following observers will be ignored + */ + function EventState(mask, skipNextObservers) { + if (skipNextObservers === void 0) { skipNextObservers = false; } + this.initalize(mask, skipNextObservers); + } + EventState.prototype.initalize = function (mask, skipNextObservers) { + if (skipNextObservers === void 0) { skipNextObservers = false; } + this.mask = mask; + this.skipNextObservers = skipNextObservers; + return this; + }; + return EventState; + }()); + BABYLON.EventState = EventState; + /** + * Represent an Observer registered to a given Observable object. + */ + var Observer = (function () { + function Observer(callback, mask) { + this.callback = callback; + this.mask = mask; + } + return Observer; + }()); + BABYLON.Observer = Observer; + /** + * The Observable class is a simple implementation of the Observable pattern. + * There's one slight particularity though: a given Observable can notify its observer using a particular mask value, only the Observers registered with this mask value will be notified. + * This enable a more fine grained execution without having to rely on multiple different Observable objects. + * For instance you may have a given Observable that have four different types of notifications: Move (mask = 0x01), Stop (mask = 0x02), Turn Right (mask = 0X04), Turn Left (mask = 0X08). + * A given observer can register itself with only Move and Stop (mask = 0x03), then it will only be notified when one of these two occurs and will never be for Turn Left/Right. + */ + var Observable = (function () { + function Observable() { + this._observers = new Array(); + this._eventState = new EventState(0); + } + /** + * Create a new Observer with the specified callback + * @param callback the callback that will be executed for that Observer + * @param mask the mask used to filter observers + * @param insertFirst if true the callback will be inserted at the first position, hence executed before the others ones. If false (default behavior) the callback will be inserted at the last position, executed after all the others already present. + */ + Observable.prototype.add = function (callback, mask, insertFirst) { + if (mask === void 0) { mask = -1; } + if (insertFirst === void 0) { insertFirst = false; } + if (!callback) { + return null; + } + var observer = new Observer(callback, mask); + if (insertFirst) { + this._observers.unshift(observer); + } + else { + this._observers.push(observer); + } + return observer; + }; + /** + * Remove an Observer from the Observable object + * @param observer the instance of the Observer to remove. If it doesn't belong to this Observable, false will be returned. + */ + Observable.prototype.remove = function (observer) { + var index = this._observers.indexOf(observer); + if (index !== -1) { + this._observers.splice(index, 1); + return true; + } + return false; + }; + /** + * Remove a callback from the Observable object + * @param callback the callback to remove. If it doesn't belong to this Observable, false will be returned. + */ + Observable.prototype.removeCallback = function (callback) { + for (var index = 0; index < this._observers.length; index++) { + if (this._observers[index].callback === callback) { + this._observers.splice(index, 1); + return true; + } + } + return false; + }; + /** + * Notify all Observers by calling their respective callback with the given data + * Will return true if all observers were executed, false if an observer set skipNextObservers to true, then prevent the subsequent ones to execute + * @param eventData + * @param mask + */ + Observable.prototype.notifyObservers = function (eventData, mask) { + if (mask === void 0) { mask = -1; } + var state = this._eventState; + state.mask = mask; + state.skipNextObservers = false; + for (var _i = 0, _a = this._observers; _i < _a.length; _i++) { + var obs = _a[_i]; + if (obs.mask & mask) { + obs.callback(eventData, state); + } + if (state.skipNextObservers) { + return false; + } + } + return true; + }; + /** + * return true is the Observable has at least one Observer registered + */ + Observable.prototype.hasObservers = function () { + return this._observers.length > 0; + }; + /** + * Clear the list of observers + */ + Observable.prototype.clear = function () { + this._observers = new Array(); + }; + /** + * Clone the current observable + */ + Observable.prototype.clone = function () { + var result = new Observable(); + result._observers = this._observers.slice(0); + return result; + }; + return Observable; + }()); + BABYLON.Observable = Observable; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.observable.js.map + +var BABYLON; +(function (BABYLON) { + var Database = (function () { + function Database(urlToScene, callbackManifestChecked) { + // Handling various flavors of prefixed version of IndexedDB + this.idbFactory = (window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB); + this.callbackManifestChecked = callbackManifestChecked; + this.currentSceneUrl = Database.ReturnFullUrlLocation(urlToScene); + this.db = null; + this.enableSceneOffline = false; + this.enableTexturesOffline = false; + this.manifestVersionFound = 0; + this.mustUpdateRessources = false; + this.hasReachedQuota = false; + if (!Database.IDBStorageEnabled) { + this.callbackManifestChecked(true); + } + else { + this.checkManifestFile(); + } + } + Database.prototype.checkManifestFile = function () { + var _this = this; + function noManifestFile() { + that.enableSceneOffline = false; + that.enableTexturesOffline = false; + that.callbackManifestChecked(false); + } + var that = this; + var timeStampUsed = false; + var manifestURL = this.currentSceneUrl + ".manifest"; + var xhr = new XMLHttpRequest(); + if (navigator.onLine) { + // Adding a timestamp to by-pass browsers' cache + timeStampUsed = true; + manifestURL = manifestURL + (manifestURL.match(/\?/) == null ? "?" : "&") + (new Date()).getTime(); + } + xhr.open("GET", manifestURL, true); + xhr.addEventListener("load", function () { + if (xhr.status === 200 || BABYLON.Tools.ValidateXHRData(xhr, 1)) { + try { + var manifestFile = JSON.parse(xhr.response); + _this.enableSceneOffline = manifestFile.enableSceneOffline; + _this.enableTexturesOffline = manifestFile.enableTexturesOffline; + if (manifestFile.version && !isNaN(parseInt(manifestFile.version))) { + _this.manifestVersionFound = manifestFile.version; + } + if (_this.callbackManifestChecked) { + _this.callbackManifestChecked(true); + } + } + catch (ex) { + noManifestFile(); + } + } + else { + noManifestFile(); + } + }, false); + xhr.addEventListener("error", function (event) { + if (timeStampUsed) { + timeStampUsed = false; + // Let's retry without the timeStamp + // It could fail when coupled with HTML5 Offline API + var retryManifestURL = _this.currentSceneUrl + ".manifest"; + xhr.open("GET", retryManifestURL, true); + xhr.send(); + } + else { + noManifestFile(); + } + }, false); + try { + xhr.send(); + } + catch (ex) { + BABYLON.Tools.Error("Error on XHR send request."); + that.callbackManifestChecked(false); + } + }; + Database.prototype.openAsync = function (successCallback, errorCallback) { + var _this = this; + function handleError() { + that.isSupported = false; + if (errorCallback) + errorCallback(); + } + var that = this; + if (!this.idbFactory || !(this.enableSceneOffline || this.enableTexturesOffline)) { + // Your browser doesn't support IndexedDB + this.isSupported = false; + if (errorCallback) + errorCallback(); + } + else { + // If the DB hasn't been opened or created yet + if (!this.db) { + this.hasReachedQuota = false; + this.isSupported = true; + var request = this.idbFactory.open("babylonjs", 1); + // Could occur if user is blocking the quota for the DB and/or doesn't grant access to IndexedDB + request.onerror = function (event) { + handleError(); + }; + // executes when a version change transaction cannot complete due to other active transactions + request.onblocked = function (event) { + BABYLON.Tools.Error("IDB request blocked. Please reload the page."); + handleError(); + }; + // DB has been opened successfully + request.onsuccess = function (event) { + _this.db = request.result; + successCallback(); + }; + // Initialization of the DB. Creating Scenes & Textures stores + request.onupgradeneeded = function (event) { + _this.db = (event.target).result; + try { + var scenesStore = _this.db.createObjectStore("scenes", { keyPath: "sceneUrl" }); + var versionsStore = _this.db.createObjectStore("versions", { keyPath: "sceneUrl" }); + var texturesStore = _this.db.createObjectStore("textures", { keyPath: "textureUrl" }); + } + catch (ex) { + BABYLON.Tools.Error("Error while creating object stores. Exception: " + ex.message); + handleError(); + } + }; + } + else { + if (successCallback) + successCallback(); + } + } + }; + Database.prototype.loadImageFromDB = function (url, image) { + var _this = this; + var completeURL = Database.ReturnFullUrlLocation(url); + var saveAndLoadImage = function () { + if (!_this.hasReachedQuota && _this.db !== null) { + // the texture is not yet in the DB, let's try to save it + _this._saveImageIntoDBAsync(completeURL, image); + } + else { + image.src = url; + } + }; + if (!this.mustUpdateRessources) { + this._loadImageFromDBAsync(completeURL, image, saveAndLoadImage); + } + else { + saveAndLoadImage(); + } + }; + Database.prototype._loadImageFromDBAsync = function (url, image, notInDBCallback) { + if (this.isSupported && this.db !== null) { + var texture; + var transaction = this.db.transaction(["textures"]); + transaction.onabort = function (event) { + image.src = url; + }; + transaction.oncomplete = function (event) { + var blobTextureURL; + if (texture) { + var URL = window.URL || window.webkitURL; + blobTextureURL = URL.createObjectURL(texture.data, { oneTimeOnly: true }); + image.onerror = function () { + BABYLON.Tools.Error("Error loading image from blob URL: " + blobTextureURL + " switching back to web url: " + url); + image.src = url; + }; + image.src = blobTextureURL; + } + else { + notInDBCallback(); + } + }; + var getRequest = transaction.objectStore("textures").get(url); + getRequest.onsuccess = function (event) { + texture = (event.target).result; + }; + getRequest.onerror = function (event) { + BABYLON.Tools.Error("Error loading texture " + url + " from DB."); + image.src = url; + }; + } + else { + BABYLON.Tools.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."); + image.src = url; + } + }; + Database.prototype._saveImageIntoDBAsync = function (url, image) { + var _this = this; + if (this.isSupported) { + // In case of error (type not supported or quota exceeded), we're at least sending back XHR data to allow texture loading later on + var generateBlobUrl = function () { + var blobTextureURL; + if (blob) { + var URL = window.URL || window.webkitURL; + try { + blobTextureURL = URL.createObjectURL(blob, { oneTimeOnly: true }); + } + // Chrome is raising a type error if we're setting the oneTimeOnly parameter + catch (ex) { + blobTextureURL = URL.createObjectURL(blob); + } + } + image.src = blobTextureURL; + }; + if (Database.IsUASupportingBlobStorage) { + var xhr = new XMLHttpRequest(), blob; + xhr.open("GET", url, true); + xhr.responseType = "blob"; + xhr.addEventListener("load", function () { + if (xhr.status === 200) { + // Blob as response (XHR2) + blob = xhr.response; + var transaction = _this.db.transaction(["textures"], "readwrite"); + // the transaction could abort because of a QuotaExceededError error + transaction.onabort = function (event) { + try { + //backwards compatibility with ts 1.0, srcElement doesn't have an "error" according to ts 1.3 + if (event.srcElement['error'] && event.srcElement['error'].name === "QuotaExceededError") { + _this.hasReachedQuota = true; + } + } + catch (ex) { } + generateBlobUrl(); + }; + transaction.oncomplete = function (event) { + generateBlobUrl(); + }; + var newTexture = { textureUrl: url, data: blob }; + try { + // Put the blob into the dabase + var addRequest = transaction.objectStore("textures").put(newTexture); + addRequest.onsuccess = function (event) { + }; + addRequest.onerror = function (event) { + generateBlobUrl(); + }; + } + catch (ex) { + // "DataCloneError" generated by Chrome when you try to inject blob into IndexedDB + if (ex.code === 25) { + Database.IsUASupportingBlobStorage = false; + } + image.src = url; + } + } + else { + image.src = url; + } + }, false); + xhr.addEventListener("error", function (event) { + BABYLON.Tools.Error("Error in XHR request in BABYLON.Database."); + image.src = url; + }, false); + xhr.send(); + } + else { + image.src = url; + } + } + else { + BABYLON.Tools.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."); + image.src = url; + } + }; + Database.prototype._checkVersionFromDB = function (url, versionLoaded) { + var _this = this; + var updateVersion = function (event) { + // the version is not yet in the DB or we need to update it + _this._saveVersionIntoDBAsync(url, versionLoaded); + }; + this._loadVersionFromDBAsync(url, versionLoaded, updateVersion); + }; + Database.prototype._loadVersionFromDBAsync = function (url, callback, updateInDBCallback) { + var _this = this; + if (this.isSupported) { + var version; + try { + var transaction = this.db.transaction(["versions"]); + transaction.oncomplete = function (event) { + if (version) { + // If the version in the JSON file is > than the version in DB + if (_this.manifestVersionFound > version.data) { + _this.mustUpdateRessources = true; + updateInDBCallback(); + } + else { + callback(version.data); + } + } + else { + _this.mustUpdateRessources = true; + updateInDBCallback(); + } + }; + transaction.onabort = function (event) { + callback(-1); + }; + var getRequest = transaction.objectStore("versions").get(url); + getRequest.onsuccess = function (event) { + version = (event.target).result; + }; + getRequest.onerror = function (event) { + BABYLON.Tools.Error("Error loading version for scene " + url + " from DB."); + callback(-1); + }; + } + catch (ex) { + BABYLON.Tools.Error("Error while accessing 'versions' object store (READ OP). Exception: " + ex.message); + callback(-1); + } + } + else { + BABYLON.Tools.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."); + callback(-1); + } + }; + Database.prototype._saveVersionIntoDBAsync = function (url, callback) { + var _this = this; + if (this.isSupported && !this.hasReachedQuota) { + try { + // Open a transaction to the database + var transaction = this.db.transaction(["versions"], "readwrite"); + // the transaction could abort because of a QuotaExceededError error + transaction.onabort = function (event) { + try { + if (event.srcElement['error'] && event.srcElement['error'].name === "QuotaExceededError") { + _this.hasReachedQuota = true; + } + } + catch (ex) { } + callback(-1); + }; + transaction.oncomplete = function (event) { + callback(_this.manifestVersionFound); + }; + var newVersion = { sceneUrl: url, data: this.manifestVersionFound }; + // Put the scene into the database + var addRequest = transaction.objectStore("versions").put(newVersion); + addRequest.onsuccess = function (event) { + }; + addRequest.onerror = function (event) { + BABYLON.Tools.Error("Error in DB add version request in BABYLON.Database."); + }; + } + catch (ex) { + BABYLON.Tools.Error("Error while accessing 'versions' object store (WRITE OP). Exception: " + ex.message); + callback(-1); + } + } + else { + callback(-1); + } + }; + Database.prototype.loadFileFromDB = function (url, sceneLoaded, progressCallBack, errorCallback, useArrayBuffer) { + var _this = this; + var completeUrl = Database.ReturnFullUrlLocation(url); + var saveAndLoadFile = function (event) { + // the scene is not yet in the DB, let's try to save it + _this._saveFileIntoDBAsync(completeUrl, sceneLoaded, progressCallBack); + }; + this._checkVersionFromDB(completeUrl, function (version) { + if (version !== -1) { + if (!_this.mustUpdateRessources) { + _this._loadFileFromDBAsync(completeUrl, sceneLoaded, saveAndLoadFile, useArrayBuffer); + } + else { + _this._saveFileIntoDBAsync(completeUrl, sceneLoaded, progressCallBack, useArrayBuffer); + } + } + else { + errorCallback(); + } + }); + }; + Database.prototype._loadFileFromDBAsync = function (url, callback, notInDBCallback, useArrayBuffer) { + if (this.isSupported) { + var targetStore; + if (url.indexOf(".babylon") !== -1) { + targetStore = "scenes"; + } + else { + targetStore = "textures"; + } + var file; + var transaction = this.db.transaction([targetStore]); + transaction.oncomplete = function (event) { + if (file) { + callback(file.data); + } + else { + notInDBCallback(); + } + }; + transaction.onabort = function (event) { + notInDBCallback(); + }; + var getRequest = transaction.objectStore(targetStore).get(url); + getRequest.onsuccess = function (event) { + file = (event.target).result; + }; + getRequest.onerror = function (event) { + BABYLON.Tools.Error("Error loading file " + url + " from DB."); + notInDBCallback(); + }; + } + else { + BABYLON.Tools.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."); + callback(); + } + }; + Database.prototype._saveFileIntoDBAsync = function (url, callback, progressCallback, useArrayBuffer) { + var _this = this; + if (this.isSupported) { + var targetStore; + if (url.indexOf(".babylon") !== -1) { + targetStore = "scenes"; + } + else { + targetStore = "textures"; + } + // Create XHR + var xhr = new XMLHttpRequest(), fileData; + xhr.open("GET", url, true); + if (useArrayBuffer) { + xhr.responseType = "arraybuffer"; + } + xhr.onprogress = progressCallback; + xhr.addEventListener("load", function () { + if (xhr.status === 200 || BABYLON.Tools.ValidateXHRData(xhr, !useArrayBuffer ? 1 : 6)) { + // Blob as response (XHR2) + //fileData = xhr.responseText; + fileData = !useArrayBuffer ? xhr.responseText : xhr.response; + if (!_this.hasReachedQuota) { + // Open a transaction to the database + var transaction = _this.db.transaction([targetStore], "readwrite"); + // the transaction could abort because of a QuotaExceededError error + transaction.onabort = function (event) { + try { + //backwards compatibility with ts 1.0, srcElement doesn't have an "error" according to ts 1.3 + if (event.srcElement['error'] && event.srcElement['error'].name === "QuotaExceededError") { + _this.hasReachedQuota = true; + } + } + catch (ex) { } + callback(fileData); + }; + transaction.oncomplete = function (event) { + callback(fileData); + }; + var newFile; + if (targetStore === "scenes") { + newFile = { sceneUrl: url, data: fileData, version: _this.manifestVersionFound }; + } + else { + newFile = { textureUrl: url, data: fileData }; + } + try { + // Put the scene into the database + var addRequest = transaction.objectStore(targetStore).put(newFile); + addRequest.onsuccess = function (event) { + }; + addRequest.onerror = function (event) { + BABYLON.Tools.Error("Error in DB add file request in BABYLON.Database."); + }; + } + catch (ex) { + callback(fileData); + } + } + else { + callback(fileData); + } + } + else { + callback(); + } + }, false); + xhr.addEventListener("error", function (event) { + BABYLON.Tools.Error("error on XHR request."); + callback(); + }, false); + xhr.send(); + } + else { + BABYLON.Tools.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."); + callback(); + } + }; + Database.IsUASupportingBlobStorage = true; + Database.IDBStorageEnabled = true; + Database.parseURL = function (url) { + var a = document.createElement('a'); + a.href = url; + var urlWithoutHash = url.substring(0, url.lastIndexOf("#")); + var fileName = url.substring(urlWithoutHash.lastIndexOf("/") + 1, url.length); + var absLocation = url.substring(0, url.indexOf(fileName, 0)); + return absLocation; + }; + Database.ReturnFullUrlLocation = function (url) { + if (url.indexOf("http:/") === -1) { + return (Database.parseURL(window.location.href) + url); + } + else { + return url; + } + }; + return Database; + }()); + BABYLON.Database = Database; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.database.js.map + +var BABYLON; +(function (BABYLON) { + var Internals; + (function (Internals) { + /* + * Based on jsTGALoader - Javascript loader for TGA file + * By Vincent Thibault + * @blog http://blog.robrowser.com/javascript-tga-loader.html + */ + var TGATools = (function () { + function TGATools() { + } + TGATools.GetTGAHeader = function (data) { + var offset = 0; + var header = { + id_length: data[offset++], + colormap_type: data[offset++], + image_type: data[offset++], + colormap_index: data[offset++] | data[offset++] << 8, + colormap_length: data[offset++] | data[offset++] << 8, + colormap_size: data[offset++], + origin: [ + data[offset++] | data[offset++] << 8, + data[offset++] | data[offset++] << 8 + ], + width: data[offset++] | data[offset++] << 8, + height: data[offset++] | data[offset++] << 8, + pixel_size: data[offset++], + flags: data[offset++] + }; + return header; + }; + TGATools.UploadContent = function (gl, data) { + // Not enough data to contain header ? + if (data.length < 19) { + BABYLON.Tools.Error("Unable to load TGA file - Not enough data to contain header"); + return; + } + // Read Header + var offset = 18; + var header = TGATools.GetTGAHeader(data); + // Assume it's a valid Targa file. + if (header.id_length + offset > data.length) { + BABYLON.Tools.Error("Unable to load TGA file - Not enough data"); + return; + } + // Skip not needed data + offset += header.id_length; + var use_rle = false; + var use_pal = false; + var use_rgb = false; + var use_grey = false; + // Get some informations. + switch (header.image_type) { + case TGATools._TYPE_RLE_INDEXED: + use_rle = true; + case TGATools._TYPE_INDEXED: + use_pal = true; + break; + case TGATools._TYPE_RLE_RGB: + use_rle = true; + case TGATools._TYPE_RGB: + use_rgb = true; + break; + case TGATools._TYPE_RLE_GREY: + use_rle = true; + case TGATools._TYPE_GREY: + use_grey = true; + break; + } + var pixel_data; + var numAlphaBits = header.flags & 0xf; + var pixel_size = header.pixel_size >> 3; + var pixel_total = header.width * header.height * pixel_size; + // Read palettes + var palettes; + if (use_pal) { + palettes = data.subarray(offset, offset += header.colormap_length * (header.colormap_size >> 3)); + } + // Read LRE + if (use_rle) { + pixel_data = new Uint8Array(pixel_total); + var c, count, i; + var localOffset = 0; + var pixels = new Uint8Array(pixel_size); + while (offset < pixel_total && localOffset < pixel_total) { + c = data[offset++]; + count = (c & 0x7f) + 1; + // RLE pixels + if (c & 0x80) { + // Bind pixel tmp array + for (i = 0; i < pixel_size; ++i) { + pixels[i] = data[offset++]; + } + // Copy pixel array + for (i = 0; i < count; ++i) { + pixel_data.set(pixels, localOffset + i * pixel_size); + } + localOffset += pixel_size * count; + } + else { + count *= pixel_size; + for (i = 0; i < count; ++i) { + pixel_data[localOffset + i] = data[offset++]; + } + localOffset += count; + } + } + } + else { + pixel_data = data.subarray(offset, offset += (use_pal ? header.width * header.height : pixel_total)); + } + // Load to texture + var x_start, y_start, x_step, y_step, y_end, x_end; + switch ((header.flags & TGATools._ORIGIN_MASK) >> TGATools._ORIGIN_SHIFT) { + default: + case TGATools._ORIGIN_UL: + x_start = 0; + x_step = 1; + x_end = header.width; + y_start = 0; + y_step = 1; + y_end = header.height; + break; + case TGATools._ORIGIN_BL: + x_start = 0; + x_step = 1; + x_end = header.width; + y_start = header.height - 1; + y_step = -1; + y_end = -1; + break; + case TGATools._ORIGIN_UR: + x_start = header.width - 1; + x_step = -1; + x_end = -1; + y_start = 0; + y_step = 1; + y_end = header.height; + break; + case TGATools._ORIGIN_BR: + x_start = header.width - 1; + x_step = -1; + x_end = -1; + y_start = header.height - 1; + y_step = -1; + y_end = -1; + break; + } + // Load the specify method + var func = '_getImageData' + (use_grey ? 'Grey' : '') + (header.pixel_size) + 'bits'; + var imageData = TGATools[func](header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, header.width, header.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, imageData); + }; + TGATools._getImageData8bits = function (header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { + var image = pixel_data, colormap = palettes; + var width = header.width, height = header.height; + var color, i = 0, x, y; + var imageData = new Uint8Array(width * height * 4); + for (y = y_start; y !== y_end; y += y_step) { + for (x = x_start; x !== x_end; x += x_step, i++) { + color = image[i]; + imageData[(x + width * y) * 4 + 3] = 255; + imageData[(x + width * y) * 4 + 2] = colormap[(color * 3) + 0]; + imageData[(x + width * y) * 4 + 1] = colormap[(color * 3) + 1]; + imageData[(x + width * y) * 4 + 0] = colormap[(color * 3) + 2]; + } + } + return imageData; + }; + TGATools._getImageData16bits = function (header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { + var image = pixel_data; + var width = header.width, height = header.height; + var color, i = 0, x, y; + var imageData = new Uint8Array(width * height * 4); + for (y = y_start; y !== y_end; y += y_step) { + for (x = x_start; x !== x_end; x += x_step, i += 2) { + color = image[i + 0] + (image[i + 1] << 8); // Inversed ? + imageData[(x + width * y) * 4 + 0] = (color & 0x7C00) >> 7; + imageData[(x + width * y) * 4 + 1] = (color & 0x03E0) >> 2; + imageData[(x + width * y) * 4 + 2] = (color & 0x001F) >> 3; + imageData[(x + width * y) * 4 + 3] = (color & 0x8000) ? 0 : 255; + } + } + return imageData; + }; + TGATools._getImageData24bits = function (header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { + var image = pixel_data; + var width = header.width, height = header.height; + var i = 0, x, y; + var imageData = new Uint8Array(width * height * 4); + for (y = y_start; y !== y_end; y += y_step) { + for (x = x_start; x !== x_end; x += x_step, i += 3) { + imageData[(x + width * y) * 4 + 3] = 255; + imageData[(x + width * y) * 4 + 2] = image[i + 0]; + imageData[(x + width * y) * 4 + 1] = image[i + 1]; + imageData[(x + width * y) * 4 + 0] = image[i + 2]; + } + } + return imageData; + }; + TGATools._getImageData32bits = function (header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { + var image = pixel_data; + var width = header.width, height = header.height; + var i = 0, x, y; + var imageData = new Uint8Array(width * height * 4); + for (y = y_start; y !== y_end; y += y_step) { + for (x = x_start; x !== x_end; x += x_step, i += 4) { + imageData[(x + width * y) * 4 + 2] = image[i + 0]; + imageData[(x + width * y) * 4 + 1] = image[i + 1]; + imageData[(x + width * y) * 4 + 0] = image[i + 2]; + imageData[(x + width * y) * 4 + 3] = image[i + 3]; + } + } + return imageData; + }; + TGATools._getImageDataGrey8bits = function (header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { + var image = pixel_data; + var width = header.width, height = header.height; + var color, i = 0, x, y; + var imageData = new Uint8Array(width * height * 4); + for (y = y_start; y !== y_end; y += y_step) { + for (x = x_start; x !== x_end; x += x_step, i++) { + color = image[i]; + imageData[(x + width * y) * 4 + 0] = color; + imageData[(x + width * y) * 4 + 1] = color; + imageData[(x + width * y) * 4 + 2] = color; + imageData[(x + width * y) * 4 + 3] = 255; + } + } + return imageData; + }; + TGATools._getImageDataGrey16bits = function (header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { + var image = pixel_data; + var width = header.width, height = header.height; + var i = 0, x, y; + var imageData = new Uint8Array(width * height * 4); + for (y = y_start; y !== y_end; y += y_step) { + for (x = x_start; x !== x_end; x += x_step, i += 2) { + imageData[(x + width * y) * 4 + 0] = image[i + 0]; + imageData[(x + width * y) * 4 + 1] = image[i + 0]; + imageData[(x + width * y) * 4 + 2] = image[i + 0]; + imageData[(x + width * y) * 4 + 3] = image[i + 1]; + } + } + return imageData; + }; + TGATools._TYPE_NO_DATA = 0; + TGATools._TYPE_INDEXED = 1; + TGATools._TYPE_RGB = 2; + TGATools._TYPE_GREY = 3; + TGATools._TYPE_RLE_INDEXED = 9; + TGATools._TYPE_RLE_RGB = 10; + TGATools._TYPE_RLE_GREY = 11; + TGATools._ORIGIN_MASK = 0x30; + TGATools._ORIGIN_SHIFT = 0x04; + TGATools._ORIGIN_BL = 0x00; + TGATools._ORIGIN_BR = 0x01; + TGATools._ORIGIN_UL = 0x02; + TGATools._ORIGIN_UR = 0x03; + return TGATools; + }()); + Internals.TGATools = TGATools; + })(Internals = BABYLON.Internals || (BABYLON.Internals = {})); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.tools.tga.js.map + +var BABYLON; +(function (BABYLON) { + var SmartArray = (function () { + function SmartArray(capacity) { + this.length = 0; + this._duplicateId = 0; + this.data = new Array(capacity); + this._id = SmartArray._GlobalId++; + } + SmartArray.prototype.push = function (value) { + this.data[this.length++] = value; + if (this.length > this.data.length) { + this.data.length *= 2; + } + if (!value.__smartArrayFlags) { + value.__smartArrayFlags = {}; + } + value.__smartArrayFlags[this._id] = this._duplicateId; + }; + SmartArray.prototype.pushNoDuplicate = function (value) { + if (value.__smartArrayFlags && value.__smartArrayFlags[this._id] === this._duplicateId) { + return false; + } + this.push(value); + return true; + }; + SmartArray.prototype.sort = function (compareFn) { + this.data.sort(compareFn); + }; + SmartArray.prototype.reset = function () { + this.length = 0; + this._duplicateId++; + }; + SmartArray.prototype.concat = function (array) { + if (array.length === 0) { + return; + } + if (this.length + array.length > this.data.length) { + this.data.length = (this.length + array.length) * 2; + } + for (var index = 0; index < array.length; index++) { + this.data[this.length++] = (array.data || array)[index]; + } + }; + SmartArray.prototype.concatWithNoDuplicate = function (array) { + if (array.length === 0) { + return; + } + if (this.length + array.length > this.data.length) { + this.data.length = (this.length + array.length) * 2; + } + for (var index = 0; index < array.length; index++) { + var item = (array.data || array)[index]; + this.pushNoDuplicate(item); + } + }; + SmartArray.prototype.indexOf = function (value) { + var position = this.data.indexOf(value); + if (position >= this.length) { + return -1; + } + return position; + }; + // Statics + SmartArray._GlobalId = 0; + return SmartArray; + }()); + BABYLON.SmartArray = SmartArray; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.smartArray.js.map + +var BABYLON; +(function (BABYLON) { + /** + * This class implement a typical dictionary using a string as key and the generic type T as value. + * The underlying implementation relies on an associative array to ensure the best performances. + * The value can be anything including 'null' but except 'undefined' + */ + var StringDictionary = (function () { + function StringDictionary() { + this._count = 0; + this._data = {}; + } + /** + * This will clear this dictionary and copy the content from the 'source' one. + * If the T value is a custom object, it won't be copied/cloned, the same object will be used + * @param source the dictionary to take the content from and copy to this dictionary + */ + StringDictionary.prototype.copyFrom = function (source) { + var _this = this; + this.clear(); + source.forEach(function (t, v) { return _this.add(t, v); }); + }; + /** + * Get a value based from its key + * @param key the given key to get the matching value from + * @return the value if found, otherwise undefined is returned + */ + StringDictionary.prototype.get = function (key) { + var val = this._data[key]; + if (val !== undefined) { + return val; + } + return undefined; + }; + /** + * Get a value from its key or add it if it doesn't exist. + * This method will ensure you that a given key/data will be present in the dictionary. + * @param key the given key to get the matching value from + * @param factory the factory that will create the value if the key is not present in the dictionary. + * The factory will only be invoked if there's no data for the given key. + * @return the value corresponding to the key. + */ + StringDictionary.prototype.getOrAddWithFactory = function (key, factory) { + var val = this.get(key); + if (val !== undefined) { + return val; + } + val = factory(key); + if (val) { + this.add(key, val); + } + return val; + }; + /** + * Get a value from its key if present in the dictionary otherwise add it + * @param key the key to get the value from + * @param val if there's no such key/value pair in the dictionary add it with this value + * @return the value corresponding to the key + */ + StringDictionary.prototype.getOrAdd = function (key, val) { + var curVal = this.get(key); + if (curVal !== undefined) { + return curVal; + } + this.add(key, val); + return val; + }; + /** + * Check if there's a given key in the dictionary + * @param key the key to check for + * @return true if the key is present, false otherwise + */ + StringDictionary.prototype.contains = function (key) { + return this._data[key] !== undefined; + }; + /** + * Add a new key and its corresponding value + * @param key the key to add + * @param value the value corresponding to the key + * @return true if the operation completed successfully, false if we couldn't insert the key/value because there was already this key in the dictionary + */ + StringDictionary.prototype.add = function (key, value) { + if (this._data[key] !== undefined) { + return false; + } + this._data[key] = value; + ++this._count; + return true; + }; + StringDictionary.prototype.set = function (key, value) { + if (this._data[key] === undefined) { + return false; + } + this._data[key] = value; + return true; + }; + /** + * Get the element of the given key and remove it from the dictionary + * @param key + */ + StringDictionary.prototype.getAndRemove = function (key) { + var val = this.get(key); + if (val !== undefined) { + delete this._data[key]; + --this._count; + return val; + } + return null; + }; + /** + * Remove a key/value from the dictionary. + * @param key the key to remove + * @return true if the item was successfully deleted, false if no item with such key exist in the dictionary + */ + StringDictionary.prototype.remove = function (key) { + if (this.contains(key)) { + delete this._data[key]; + --this._count; + return true; + } + return false; + }; + /** + * Clear the whole content of the dictionary + */ + StringDictionary.prototype.clear = function () { + this._data = {}; + this._count = 0; + }; + Object.defineProperty(StringDictionary.prototype, "count", { + get: function () { + return this._count; + }, + enumerable: true, + configurable: true + }); + /** + * Execute a callback on each key/val of the dictionary. + * Note that you can remove any element in this dictionary in the callback implementation + * @param callback the callback to execute on a given key/value pair + */ + StringDictionary.prototype.forEach = function (callback) { + for (var cur in this._data) { + var val = this._data[cur]; + callback(cur, val); + } + }; + /** + * Execute a callback on every occurrence of the dictionary until it returns a valid TRes object. + * If the callback returns null or undefined the method will iterate to the next key/value pair + * Note that you can remove any element in this dictionary in the callback implementation + * @param callback the callback to execute, if it return a valid T instanced object the enumeration will stop and the object will be returned + */ + StringDictionary.prototype.first = function (callback) { + for (var cur in this._data) { + var val = this._data[cur]; + var res = callback(cur, val); + if (res) { + return res; + } + } + return null; + }; + return StringDictionary; + }()); + BABYLON.StringDictionary = StringDictionary; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.stringDictionary.js.map + +var BABYLON; +(function (BABYLON) { + // Screenshots + var screenshotCanvas; + var cloneValue = function (source, destinationObject) { + if (!source) + return null; + if (source instanceof BABYLON.Mesh) { + return null; + } + if (source instanceof BABYLON.SubMesh) { + return source.clone(destinationObject); + } + else if (source.clone) { + return source.clone(); + } + return null; + }; + var Tools = (function () { + function Tools() { + } + Tools.Instantiate = function (className) { + var arr = className.split("."); + var fn = (window || this); + for (var i = 0, len = arr.length; i < len; i++) { + fn = fn[arr[i]]; + } + if (typeof fn !== "function") { + return null; + } + return fn; + }; + Tools.SetImmediate = function (action) { + if (window.setImmediate) { + window.setImmediate(action); + } + else { + setTimeout(action, 1); + } + }; + Tools.IsExponentOfTwo = function (value) { + var count = 1; + do { + count *= 2; + } while (count < value); + return count === value; + }; + Tools.GetExponentOfTwo = function (value, max) { + var count = 1; + do { + count *= 2; + } while (count < value); + if (count > max) + count = max; + return count; + }; + Tools.GetFilename = function (path) { + var index = path.lastIndexOf("/"); + if (index < 0) + return path; + return path.substring(index + 1); + }; + Tools.GetDOMTextContent = function (element) { + var result = ""; + var child = element.firstChild; + while (child) { + if (child.nodeType === 3) { + result += child.textContent; + } + child = child.nextSibling; + } + return result; + }; + Tools.ToDegrees = function (angle) { + return angle * 180 / Math.PI; + }; + Tools.ToRadians = function (angle) { + return angle * Math.PI / 180; + }; + Tools.EncodeArrayBufferTobase64 = function (buffer) { + var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + var output = ""; + var chr1, chr2, chr3, enc1, enc2, enc3, enc4; + var i = 0; + var bytes = new Uint8Array(buffer); + while (i < bytes.length) { + chr1 = bytes[i++]; + chr2 = i < bytes.length ? bytes[i++] : Number.NaN; // Not sure if the index + chr3 = i < bytes.length ? bytes[i++] : Number.NaN; // checks are needed here + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } + else if (isNaN(chr3)) { + enc4 = 64; + } + output += keyStr.charAt(enc1) + keyStr.charAt(enc2) + + keyStr.charAt(enc3) + keyStr.charAt(enc4); + } + return "data:image/png;base64," + output; + }; + Tools.ExtractMinAndMaxIndexed = function (positions, indices, indexStart, indexCount, bias) { + if (bias === void 0) { bias = null; } + var minimum = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + var maximum = new BABYLON.Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE); + for (var index = indexStart; index < indexStart + indexCount; index++) { + var current = new BABYLON.Vector3(positions[indices[index] * 3], positions[indices[index] * 3 + 1], positions[indices[index] * 3 + 2]); + minimum = BABYLON.Vector3.Minimize(current, minimum); + maximum = BABYLON.Vector3.Maximize(current, maximum); + } + if (bias) { + minimum.x -= minimum.x * bias.x + bias.y; + minimum.y -= minimum.y * bias.x + bias.y; + minimum.z -= minimum.z * bias.x + bias.y; + maximum.x += maximum.x * bias.x + bias.y; + maximum.y += maximum.y * bias.x + bias.y; + maximum.z += maximum.z * bias.x + bias.y; + } + return { + minimum: minimum, + maximum: maximum + }; + }; + Tools.ExtractMinAndMax = function (positions, start, count, bias, stride) { + if (bias === void 0) { bias = null; } + var minimum = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + var maximum = new BABYLON.Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE); + if (!stride) { + stride = 3; + } + for (var index = start; index < start + count; index++) { + var current = new BABYLON.Vector3(positions[index * stride], positions[index * stride + 1], positions[index * stride + 2]); + minimum = BABYLON.Vector3.Minimize(current, minimum); + maximum = BABYLON.Vector3.Maximize(current, maximum); + } + if (bias) { + minimum.x -= minimum.x * bias.x + bias.y; + minimum.y -= minimum.y * bias.x + bias.y; + minimum.z -= minimum.z * bias.x + bias.y; + maximum.x += maximum.x * bias.x + bias.y; + maximum.y += maximum.y * bias.x + bias.y; + maximum.z += maximum.z * bias.x + bias.y; + } + return { + minimum: minimum, + maximum: maximum + }; + }; + Tools.Vector2ArrayFeeder = function (array) { + return function (index) { + var isFloatArray = (array.BYTES_PER_ELEMENT !== undefined); + var length = isFloatArray ? array.length / 2 : array.length; + if (index >= length) { + return null; + } + if (isFloatArray) { + var fa = array; + return new BABYLON.Vector2(fa[index * 2 + 0], fa[index * 2 + 1]); + } + var a = array; + return a[index]; + }; + }; + Tools.ExtractMinAndMaxVector2 = function (feeder, bias) { + if (bias === void 0) { bias = null; } + var minimum = new BABYLON.Vector2(Number.MAX_VALUE, Number.MAX_VALUE); + var maximum = new BABYLON.Vector2(-Number.MAX_VALUE, -Number.MAX_VALUE); + var i = 0; + var cur = feeder(i++); + while (cur) { + minimum = BABYLON.Vector2.Minimize(cur, minimum); + maximum = BABYLON.Vector2.Maximize(cur, maximum); + cur = feeder(i++); + } + if (bias) { + minimum.x -= minimum.x * bias.x + bias.y; + minimum.y -= minimum.y * bias.x + bias.y; + maximum.x += maximum.x * bias.x + bias.y; + maximum.y += maximum.y * bias.x + bias.y; + } + return { + minimum: minimum, + maximum: maximum + }; + }; + Tools.MakeArray = function (obj, allowsNullUndefined) { + if (allowsNullUndefined !== true && (obj === undefined || obj == null)) + return undefined; + return Array.isArray(obj) ? obj : [obj]; + }; + // Misc. + Tools.GetPointerPrefix = function () { + var eventPrefix = "pointer"; + // Check if pointer events are supported + if (!window.PointerEvent && !navigator.pointerEnabled) { + eventPrefix = "mouse"; + } + return eventPrefix; + }; + /** + * @param func - the function to be called + * @param requester - the object that will request the next frame. Falls back to window. + */ + Tools.QueueNewFrame = function (func, requester) { + if (requester === void 0) { requester = window; } + //if WebVR is enabled AND presenting, requestAnimationFrame is triggered when enabled. + /*if(requester.isPresenting) { + return; + } else*/ if (requester.requestAnimationFrame) + requester.requestAnimationFrame(func); + else if (requester.msRequestAnimationFrame) + requester.msRequestAnimationFrame(func); + else if (requester.webkitRequestAnimationFrame) + requester.webkitRequestAnimationFrame(func); + else if (requester.mozRequestAnimationFrame) + requester.mozRequestAnimationFrame(func); + else if (requester.oRequestAnimationFrame) + requester.oRequestAnimationFrame(func); + else { + window.setTimeout(func, 16); + } + }; + Tools.RequestFullscreen = function (element) { + var requestFunction = element.requestFullscreen || element.msRequestFullscreen || element.webkitRequestFullscreen || element.mozRequestFullScreen; + if (!requestFunction) + return; + requestFunction.call(element); + }; + Tools.ExitFullscreen = function () { + if (document.exitFullscreen) { + document.exitFullscreen(); + } + else if (document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + } + else if (document.webkitCancelFullScreen) { + document.webkitCancelFullScreen(); + } + else if (document.msCancelFullScreen) { + document.msCancelFullScreen(); + } + }; + Tools.SetCorsBehavior = function (url, img) { + if (Tools.CorsBehavior) { + switch (typeof (Tools.CorsBehavior)) { + case "function": + var result = Tools.CorsBehavior(url); + if (result) { + return result; + } + break; + case "string": + default: + img.crossOrigin = Tools.CorsBehavior; + break; + } + } + }; + // External files + Tools.CleanUrl = function (url) { + url = url.replace(/#/mg, "%23"); + return url; + }; + Tools.LoadImage = function (url, onload, onerror, database) { + if (url instanceof ArrayBuffer) { + url = Tools.EncodeArrayBufferTobase64(url); + } + url = Tools.CleanUrl(url); + var img = new Image(); + if (url.substr(0, 5) !== "data:") { + Tools.SetCorsBehavior(url, img); + } + img.onload = function () { + onload(img); + }; + img.onerror = function (err) { + Tools.Error("Error while trying to load texture: " + url); + if (Tools.UseFallbackTexture) { + img.src = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z"; + onload(img); + } + else { + onerror(); + } + }; + var noIndexedDB = function () { + img.src = url; + }; + var loadFromIndexedDB = function () { + database.loadImageFromDB(url, img); + }; + //ANY database to do! + if (url.substr(0, 5) !== "data:" && database && database.enableTexturesOffline && BABYLON.Database.IsUASupportingBlobStorage) { + database.openAsync(loadFromIndexedDB, noIndexedDB); + } + else { + if (url.indexOf("file:") === -1) { + noIndexedDB(); + } + else { + try { + var textureName = url.substring(5).toLowerCase(); + var blobURL; + try { + blobURL = URL.createObjectURL(BABYLON.FilesInput.FilesTextures[textureName], { oneTimeOnly: true }); + } + catch (ex) { + // Chrome doesn't support oneTimeOnly parameter + blobURL = URL.createObjectURL(BABYLON.FilesInput.FilesTextures[textureName]); + } + img.src = blobURL; + } + catch (e) { + img.src = null; + } + } + } + return img; + }; + //ANY + Tools.LoadFile = function (url, callback, progressCallBack, database, useArrayBuffer, onError) { + url = Tools.CleanUrl(url); + var noIndexedDB = function () { + var request = new XMLHttpRequest(); + var loadUrl = Tools.BaseUrl + url; + request.open('GET', loadUrl, true); + if (useArrayBuffer) { + request.responseType = "arraybuffer"; + } + request.onprogress = progressCallBack; + request.onreadystatechange = function () { + if (request.readyState === 4) { + request.onreadystatechange = null; //some browsers have issues where onreadystatechange can be called multiple times with the same value + if (request.status >= 200 && request.status < 300 || (navigator.isCocoonJS && (request.status === 0))) { + callback(!useArrayBuffer ? request.responseText : request.response); + } + else { + if (onError) { + onError(); + } + else { + throw new Error("Error status: " + request.status + " - Unable to load " + loadUrl); + } + } + } + }; + request.send(null); + }; + var loadFromIndexedDB = function () { + database.loadFileFromDB(url, callback, progressCallBack, noIndexedDB, useArrayBuffer); + }; + if (url.indexOf("file:") !== -1) { + var fileName = url.substring(5).toLowerCase(); + Tools.ReadFile(BABYLON.FilesInput.FilesToLoad[fileName], callback, progressCallBack, useArrayBuffer); + } + else { + // Caching all files + if (database && database.enableSceneOffline) { + database.openAsync(loadFromIndexedDB, noIndexedDB); + } + else { + noIndexedDB(); + } + } + }; + Tools.ReadFileAsDataURL = function (fileToLoad, callback, progressCallback) { + var reader = new FileReader(); + reader.onload = function (e) { + //target doesn't have result from ts 1.3 + callback(e.target['result']); + }; + reader.onprogress = progressCallback; + reader.readAsDataURL(fileToLoad); + }; + Tools.ReadFile = function (fileToLoad, callback, progressCallBack, useArrayBuffer) { + var reader = new FileReader(); + reader.onerror = function (e) { + Tools.Log("Error while reading file: " + fileToLoad.name); + callback(JSON.stringify({ autoClear: true, clearColor: [1, 0, 0], ambientColor: [0, 0, 0], gravity: [0, -9.807, 0], meshes: [], cameras: [], lights: [] })); + }; + reader.onload = function (e) { + //target doesn't have result from ts 1.3 + callback(e.target['result']); + }; + reader.onprogress = progressCallBack; + if (!useArrayBuffer) { + // Asynchronous read + reader.readAsText(fileToLoad); + } + else { + reader.readAsArrayBuffer(fileToLoad); + } + }; + //returns a downloadable url to a file content. + Tools.FileAsURL = function (content) { + var fileBlob = new Blob([content]); + var url = window.URL || window.webkitURL; + var link = url.createObjectURL(fileBlob); + return link; + }; + // Misc. + Tools.Format = function (value, decimals) { + if (decimals === void 0) { decimals = 2; } + return value.toFixed(decimals); + }; + Tools.CheckExtends = function (v, min, max) { + if (v.x < min.x) + min.x = v.x; + if (v.y < min.y) + min.y = v.y; + if (v.z < min.z) + min.z = v.z; + if (v.x > max.x) + max.x = v.x; + if (v.y > max.y) + max.y = v.y; + if (v.z > max.z) + max.z = v.z; + }; + Tools.DeepCopy = function (source, destination, doNotCopyList, mustCopyList) { + for (var prop in source) { + if (prop[0] === "_" && (!mustCopyList || mustCopyList.indexOf(prop) === -1)) { + continue; + } + if (doNotCopyList && doNotCopyList.indexOf(prop) !== -1) { + continue; + } + var sourceValue = source[prop]; + var typeOfSourceValue = typeof sourceValue; + if (typeOfSourceValue === "function") { + continue; + } + if (typeOfSourceValue === "object") { + if (sourceValue instanceof Array) { + destination[prop] = []; + if (sourceValue.length > 0) { + if (typeof sourceValue[0] == "object") { + for (var index = 0; index < sourceValue.length; index++) { + var clonedValue = cloneValue(sourceValue[index], destination); + if (destination[prop].indexOf(clonedValue) === -1) { + destination[prop].push(clonedValue); + } + } + } + else { + destination[prop] = sourceValue.slice(0); + } + } + } + else { + destination[prop] = cloneValue(sourceValue, destination); + } + } + else { + destination[prop] = sourceValue; + } + } + }; + Tools.IsEmpty = function (obj) { + for (var i in obj) { + return false; + } + return true; + }; + Tools.RegisterTopRootEvents = function (events) { + for (var index = 0; index < events.length; index++) { + var event = events[index]; + window.addEventListener(event.name, event.handler, false); + try { + if (window.parent) { + window.parent.addEventListener(event.name, event.handler, false); + } + } + catch (e) { + } + } + }; + Tools.UnregisterTopRootEvents = function (events) { + for (var index = 0; index < events.length; index++) { + var event = events[index]; + window.removeEventListener(event.name, event.handler); + try { + if (window.parent) { + window.parent.removeEventListener(event.name, event.handler); + } + } + catch (e) { + } + } + }; + Tools.DumpFramebuffer = function (width, height, engine, successCallback, mimeType) { + if (mimeType === void 0) { mimeType = "image/png"; } + // Read the contents of the framebuffer + var numberOfChannelsByLine = width * 4; + var halfHeight = height / 2; + //Reading datas from WebGL + var data = engine.readPixels(0, 0, width, height); + //To flip image on Y axis. + for (var i = 0; i < halfHeight; i++) { + for (var j = 0; j < numberOfChannelsByLine; j++) { + var currentCell = j + i * numberOfChannelsByLine; + var targetLine = height - i - 1; + var targetCell = j + targetLine * numberOfChannelsByLine; + var temp = data[currentCell]; + data[currentCell] = data[targetCell]; + data[targetCell] = temp; + } + } + // Create a 2D canvas to store the result + if (!screenshotCanvas) { + screenshotCanvas = document.createElement('canvas'); + } + screenshotCanvas.width = width; + screenshotCanvas.height = height; + var context = screenshotCanvas.getContext('2d'); + // Copy the pixels to a 2D canvas + var imageData = context.createImageData(width, height); + var castData = (imageData.data); + castData.set(data); + context.putImageData(imageData, 0, 0); + Tools.EncodeScreenshotCanvasData(successCallback, mimeType); + }; + Tools.EncodeScreenshotCanvasData = function (successCallback, mimeType) { + if (mimeType === void 0) { mimeType = "image/png"; } + var base64Image = screenshotCanvas.toDataURL(mimeType); + if (successCallback) { + successCallback(base64Image); + } + else { + //Creating a link if the browser have the download attribute on the a tag, to automatically start download generated image. + if (("download" in document.createElement("a"))) { + var a = window.document.createElement("a"); + a.href = base64Image; + var date = new Date(); + var stringDate = (date.getFullYear() + "-" + (date.getMonth() + 1)).slice(-2) + "-" + date.getDate() + "_" + date.getHours() + "-" + ('0' + date.getMinutes()).slice(-2); + a.setAttribute("download", "screenshot_" + stringDate + ".png"); + window.document.body.appendChild(a); + a.addEventListener("click", function () { + a.parentElement.removeChild(a); + }); + a.click(); + } + else { + var newWindow = window.open(""); + var img = newWindow.document.createElement("img"); + img.src = base64Image; + newWindow.document.body.appendChild(img); + } + } + }; + Tools.CreateScreenshot = function (engine, camera, size, successCallback, mimeType) { + if (mimeType === void 0) { mimeType = "image/png"; } + var width; + var height; + // If a precision value is specified + if (size.precision) { + width = Math.round(engine.getRenderWidth() * size.precision); + height = Math.round(width / engine.getAspectRatio(camera)); + } + else if (size.width && size.height) { + width = size.width; + height = size.height; + } + else if (size.width && !size.height) { + width = size.width; + height = Math.round(width / engine.getAspectRatio(camera)); + } + else if (size.height && !size.width) { + height = size.height; + width = Math.round(height * engine.getAspectRatio(camera)); + } + else if (!isNaN(size)) { + height = size; + width = size; + } + else { + Tools.Error("Invalid 'size' parameter !"); + return; + } + if (!screenshotCanvas) { + screenshotCanvas = document.createElement('canvas'); + } + screenshotCanvas.width = width; + screenshotCanvas.height = height; + var renderContext = screenshotCanvas.getContext("2d"); + renderContext.drawImage(engine.getRenderingCanvas(), 0, 0, width, height); + Tools.EncodeScreenshotCanvasData(successCallback, mimeType); + }; + Tools.CreateScreenshotUsingRenderTarget = function (engine, camera, size, successCallback, mimeType) { + if (mimeType === void 0) { mimeType = "image/png"; } + var width; + var height; + //If a precision value is specified + if (size.precision) { + width = Math.round(engine.getRenderWidth() * size.precision); + height = Math.round(width / engine.getAspectRatio(camera)); + size = { width: width, height: height }; + } + else if (size.width && size.height) { + width = size.width; + height = size.height; + } + else if (size.width && !size.height) { + width = size.width; + height = Math.round(width / engine.getAspectRatio(camera)); + size = { width: width, height: height }; + } + else if (size.height && !size.width) { + height = size.height; + width = Math.round(height * engine.getAspectRatio(camera)); + size = { width: width, height: height }; + } + else if (!isNaN(size)) { + height = size; + width = size; + } + else { + Tools.Error("Invalid 'size' parameter !"); + return; + } + var scene = camera.getScene(); + var previousCamera = null; + if (scene.activeCamera !== camera) { + previousCamera = scene.activeCamera; + scene.activeCamera = camera; + } + //At this point size can be a number, or an object (according to engine.prototype.createRenderTargetTexture method) + var texture = new BABYLON.RenderTargetTexture("screenShot", size, scene, false, false); + texture.renderList = scene.meshes; + texture.onAfterRenderObservable.add(function () { + Tools.DumpFramebuffer(width, height, engine, successCallback, mimeType); + }); + scene.incrementRenderId(); + scene.resetCachedMaterial(); + texture.render(true); + texture.dispose(); + if (previousCamera) { + scene.activeCamera = previousCamera; + } + camera.getProjectionMatrix(true); // Force cache refresh; + }; + // XHR response validator for local file scenario + Tools.ValidateXHRData = function (xhr, dataType) { + // 1 for text (.babylon, manifest and shaders), 2 for TGA, 4 for DDS, 7 for all + if (dataType === void 0) { dataType = 7; } + try { + if (dataType & 1) { + if (xhr.responseText && xhr.responseText.length > 0) { + return true; + } + else if (dataType === 1) { + return false; + } + } + if (dataType & 2) { + // Check header width and height since there is no "TGA" magic number + var tgaHeader = BABYLON.Internals.TGATools.GetTGAHeader(xhr.response); + if (tgaHeader.width && tgaHeader.height && tgaHeader.width > 0 && tgaHeader.height > 0) { + return true; + } + else if (dataType === 2) { + return false; + } + } + if (dataType & 4) { + // Check for the "DDS" magic number + var ddsHeader = new Uint8Array(xhr.response, 0, 3); + if (ddsHeader[0] === 68 && ddsHeader[1] === 68 && ddsHeader[2] === 83) { + return true; + } + else { + return false; + } + } + } + catch (e) { + } + return false; + }; + /** + * Implementation from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#answer-2117523 + * Be aware Math.random() could cause collisions, but: + * "All but 6 of the 128 bits of the ID are randomly generated, which means that for any two ids, there's a 1 in 2^^122 (or 5.3x10^^36) chance they'll collide" + */ + Tools.RandomId = function () { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8); + return v.toString(16); + }); + }; + Object.defineProperty(Tools, "NoneLogLevel", { + get: function () { + return Tools._NoneLogLevel; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Tools, "MessageLogLevel", { + get: function () { + return Tools._MessageLogLevel; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Tools, "WarningLogLevel", { + get: function () { + return Tools._WarningLogLevel; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Tools, "ErrorLogLevel", { + get: function () { + return Tools._ErrorLogLevel; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Tools, "AllLogLevel", { + get: function () { + return Tools._MessageLogLevel | Tools._WarningLogLevel | Tools._ErrorLogLevel; + }, + enumerable: true, + configurable: true + }); + Tools._AddLogEntry = function (entry) { + Tools._LogCache = entry + Tools._LogCache; + if (Tools.OnNewCacheEntry) { + Tools.OnNewCacheEntry(entry); + } + }; + Tools._FormatMessage = function (message) { + var padStr = function (i) { return (i < 10) ? "0" + i : "" + i; }; + var date = new Date(); + return "[" + padStr(date.getHours()) + ":" + padStr(date.getMinutes()) + ":" + padStr(date.getSeconds()) + "]: " + message; + }; + Tools._LogDisabled = function (message) { + // nothing to do + }; + Tools._LogEnabled = function (message) { + var formattedMessage = Tools._FormatMessage(message); + console.log("BJS - " + formattedMessage); + var entry = "
    " + formattedMessage + "

    "; + Tools._AddLogEntry(entry); + }; + Tools._WarnDisabled = function (message) { + // nothing to do + }; + Tools._WarnEnabled = function (message) { + var formattedMessage = Tools._FormatMessage(message); + console.warn("BJS - " + formattedMessage); + var entry = "
    " + formattedMessage + "

    "; + Tools._AddLogEntry(entry); + }; + Tools._ErrorDisabled = function (message) { + // nothing to do + }; + Tools._ErrorEnabled = function (message) { + Tools.errorsCount++; + var formattedMessage = Tools._FormatMessage(message); + console.error("BJS - " + formattedMessage); + var entry = "
    " + formattedMessage + "

    "; + Tools._AddLogEntry(entry); + }; + Object.defineProperty(Tools, "LogCache", { + get: function () { + return Tools._LogCache; + }, + enumerable: true, + configurable: true + }); + Tools.ClearLogCache = function () { + Tools._LogCache = ""; + Tools.errorsCount = 0; + }; + Object.defineProperty(Tools, "LogLevels", { + set: function (level) { + if ((level & Tools.MessageLogLevel) === Tools.MessageLogLevel) { + Tools.Log = Tools._LogEnabled; + } + else { + Tools.Log = Tools._LogDisabled; + } + if ((level & Tools.WarningLogLevel) === Tools.WarningLogLevel) { + Tools.Warn = Tools._WarnEnabled; + } + else { + Tools.Warn = Tools._WarnDisabled; + } + if ((level & Tools.ErrorLogLevel) === Tools.ErrorLogLevel) { + Tools.Error = Tools._ErrorEnabled; + } + else { + Tools.Error = Tools._ErrorDisabled; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Tools, "PerformanceNoneLogLevel", { + get: function () { + return Tools._PerformanceNoneLogLevel; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Tools, "PerformanceUserMarkLogLevel", { + get: function () { + return Tools._PerformanceUserMarkLogLevel; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Tools, "PerformanceConsoleLogLevel", { + get: function () { + return Tools._PerformanceConsoleLogLevel; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Tools, "PerformanceLogLevel", { + set: function (level) { + if ((level & Tools.PerformanceUserMarkLogLevel) === Tools.PerformanceUserMarkLogLevel) { + Tools.StartPerformanceCounter = Tools._StartUserMark; + Tools.EndPerformanceCounter = Tools._EndUserMark; + return; + } + if ((level & Tools.PerformanceConsoleLogLevel) === Tools.PerformanceConsoleLogLevel) { + Tools.StartPerformanceCounter = Tools._StartPerformanceConsole; + Tools.EndPerformanceCounter = Tools._EndPerformanceConsole; + return; + } + Tools.StartPerformanceCounter = Tools._StartPerformanceCounterDisabled; + Tools.EndPerformanceCounter = Tools._EndPerformanceCounterDisabled; + }, + enumerable: true, + configurable: true + }); + Tools._StartPerformanceCounterDisabled = function (counterName, condition) { + }; + Tools._EndPerformanceCounterDisabled = function (counterName, condition) { + }; + Tools._StartUserMark = function (counterName, condition) { + if (condition === void 0) { condition = true; } + if (!condition || !Tools._performance.mark) { + return; + } + Tools._performance.mark(counterName + "-Begin"); + }; + Tools._EndUserMark = function (counterName, condition) { + if (condition === void 0) { condition = true; } + if (!condition || !Tools._performance.mark) { + return; + } + Tools._performance.mark(counterName + "-End"); + Tools._performance.measure(counterName, counterName + "-Begin", counterName + "-End"); + }; + Tools._StartPerformanceConsole = function (counterName, condition) { + if (condition === void 0) { condition = true; } + if (!condition) { + return; + } + Tools._StartUserMark(counterName, condition); + if (console.time) { + console.time(counterName); + } + }; + Tools._EndPerformanceConsole = function (counterName, condition) { + if (condition === void 0) { condition = true; } + if (!condition) { + return; + } + Tools._EndUserMark(counterName, condition); + if (console.time) { + console.timeEnd(counterName); + } + }; + Object.defineProperty(Tools, "Now", { + get: function () { + if (window.performance && window.performance.now) { + return window.performance.now(); + } + return new Date().getTime(); + }, + enumerable: true, + configurable: true + }); + /** + * This method will return the name of the class used to create the instance of the given object. + * It will works only on Javascript basic data types (number, string, ...) and instance of class declared with the @className decorator. + * @param object the object to get the class name from + * @return the name of the class, will be "object" for a custom data type not using the @className decorator + */ + Tools.getClassName = function (object, isType) { + if (isType === void 0) { isType = false; } + var name = null; + if (!isType && object.getClassName) { + name = object.getClassName(); + } + else { + if (object instanceof Object) { + var classObj = isType ? object : Object.getPrototypeOf(object); + name = classObj.constructor["__bjsclassName__"]; + } + if (!name) { + name = typeof object; + } + } + return name; + }; + Tools.first = function (array, predicate) { + for (var _i = 0, array_1 = array; _i < array_1.length; _i++) { + var el = array_1[_i]; + if (predicate(el)) { + return el; + } + } + }; + /** + * This method will return the name of the full name of the class, including its owning module (if any). + * It will works only on Javascript basic data types (number, string, ...) and instance of class declared with the @className decorator or implementing a method getClassName():string (in which case the module won't be specified). + * @param object the object to get the class name from + * @return a string that can have two forms: "moduleName.className" if module was specified when the class' Name was registered or "className" if there was not module specified. + */ + Tools.getFullClassName = function (object, isType) { + if (isType === void 0) { isType = false; } + var className = null; + var moduleName = null; + if (!isType && object.getClassName) { + className = object.getClassName(); + } + else { + if (object instanceof Object) { + var classObj = isType ? object : Object.getPrototypeOf(object); + className = classObj.constructor["__bjsclassName__"]; + moduleName = classObj.constructor["__bjsmoduleName__"]; + } + if (!className) { + className = typeof object; + } + } + if (!className) { + return null; + } + return ((moduleName != null) ? (moduleName + ".") : "") + className; + }; + /** + * This method can be used with hashCodeFromStream when your input is an array of values that are either: number, string, boolean or custom type implementing the getHashCode():number method. + * @param array + */ + Tools.arrayOrStringFeeder = function (array) { + return function (index) { + if (index >= array.length) { + return null; + } + var val = array.charCodeAt ? array.charCodeAt(index) : array[index]; + if (val && val.getHashCode) { + val = val.getHashCode(); + } + if (typeof val === "string") { + return Tools.hashCodeFromStream(Tools.arrayOrStringFeeder(val)); + } + return val; + }; + }; + /** + * Compute the hashCode of a stream of number + * To compute the HashCode on a string or an Array of data types implementing the getHashCode() method, use the arrayOrStringFeeder method. + * @param feeder a callback that will be called until it returns null, each valid returned values will be used to compute the hash code. + * @return the hash code computed + */ + Tools.hashCodeFromStream = function (feeder) { + // Based from here: http://stackoverflow.com/a/7616484/802124 + var hash = 0; + var index = 0; + var chr = feeder(index++); + while (chr != null) { + hash = ((hash << 5) - hash) + chr; + hash |= 0; // Convert to 32bit integer + chr = feeder(index++); + } + return hash; + }; + Tools.BaseUrl = ""; + Tools.CorsBehavior = "anonymous"; + Tools.UseFallbackTexture = true; + // Logs + Tools._NoneLogLevel = 0; + Tools._MessageLogLevel = 1; + Tools._WarningLogLevel = 2; + Tools._ErrorLogLevel = 4; + Tools._LogCache = ""; + Tools.errorsCount = 0; + Tools.Log = Tools._LogEnabled; + Tools.Warn = Tools._WarnEnabled; + Tools.Error = Tools._ErrorEnabled; + // Performances + Tools._PerformanceNoneLogLevel = 0; + Tools._PerformanceUserMarkLogLevel = 1; + Tools._PerformanceConsoleLogLevel = 2; + Tools._performance = window.performance; + Tools.StartPerformanceCounter = Tools._StartPerformanceCounterDisabled; + Tools.EndPerformanceCounter = Tools._EndPerformanceCounterDisabled; + return Tools; + }()); + BABYLON.Tools = Tools; + /** + * This class is used to track a performance counter which is number based. + * The user has access to many properties which give statistics of different nature + * + * The implementer can track two kinds of Performance Counter: time and count + * For time you can optionally call fetchNewFrame() to notify the start of a new frame to monitor, then call beginMonitoring() to start and endMonitoring() to record the lapsed time. endMonitoring takes a newFrame parameter for you to specify if the monitored time should be set for a new frame or accumulated to the current frame being monitored. + * For count you first have to call fetchNewFrame() to notify the start of a new frame to monitor, then call addCount() how many time required to increment the count value you monitor. + */ + var PerfCounter = (function () { + function PerfCounter() { + this._startMonitoringTime = 0; + this._min = 0; + this._max = 0; + this._average = 0; + this._lastSecAverage = 0; + this._current = 0; + this._totalValueCount = 0; + this._totalAccumulated = 0; + this._lastSecAccumulated = 0; + this._lastSecTime = 0; + this._lastSecValueCount = 0; + } + Object.defineProperty(PerfCounter.prototype, "min", { + /** + * Returns the smallest value ever + */ + get: function () { + return this._min; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PerfCounter.prototype, "max", { + /** + * Returns the biggest value ever + */ + get: function () { + return this._max; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PerfCounter.prototype, "average", { + /** + * Returns the average value since the performance counter is running + */ + get: function () { + return this._average; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PerfCounter.prototype, "lastSecAverage", { + /** + * Returns the average value of the last second the counter was monitored + */ + get: function () { + return this._lastSecAverage; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PerfCounter.prototype, "current", { + /** + * Returns the current value + */ + get: function () { + return this._current; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PerfCounter.prototype, "total", { + get: function () { + return this._totalAccumulated; + }, + enumerable: true, + configurable: true + }); + /** + * Call this method to start monitoring a new frame. + * This scenario is typically used when you accumulate monitoring time many times for a single frame, you call this method at the start of the frame, then beginMonitoring to start recording and endMonitoring(false) to accumulated the recorded time to the PerfCounter or addCount() to accumulate a monitored count. + */ + PerfCounter.prototype.fetchNewFrame = function () { + this._totalValueCount++; + this._current = 0; + this._lastSecValueCount++; + }; + /** + * Call this method to monitor a count of something (e.g. mesh drawn in viewport count) + * @param newCount the count value to add to the monitored count + * @param fetchResult true when it's the last time in the frame you add to the counter and you wish to update the statistics properties (min/max/average), false if you only want to update statistics. + */ + PerfCounter.prototype.addCount = function (newCount, fetchResult) { + this._current += newCount; + if (fetchResult) { + this._fetchResult(); + } + }; + /** + * Start monitoring this performance counter + */ + PerfCounter.prototype.beginMonitoring = function () { + this._startMonitoringTime = Tools.Now; + }; + /** + * Compute the time lapsed since the previous beginMonitoring() call. + * @param newFrame true by default to fetch the result and monitor a new frame, if false the time monitored will be added to the current frame counter + */ + PerfCounter.prototype.endMonitoring = function (newFrame) { + if (newFrame === void 0) { newFrame = true; } + if (newFrame) { + this.fetchNewFrame(); + } + var currentTime = Tools.Now; + this._current = currentTime - this._startMonitoringTime; + if (newFrame) { + this._fetchResult(); + } + }; + PerfCounter.prototype._fetchResult = function () { + this._totalAccumulated += this._current; + this._lastSecAccumulated += this._current; + // Min/Max update + this._min = Math.min(this._min, this._current); + this._max = Math.max(this._max, this._current); + this._average = this._totalAccumulated / this._totalValueCount; + // Reset last sec? + var now = Tools.Now; + if ((now - this._lastSecTime) > 1000) { + this._lastSecAverage = this._lastSecAccumulated / this._lastSecValueCount; + this._lastSecTime = now; + this._lastSecAccumulated = 0; + this._lastSecValueCount = 0; + } + }; + return PerfCounter; + }()); + BABYLON.PerfCounter = PerfCounter; + /** + * Use this className as a decorator on a given class definition to add it a name and optionally its module. + * You can then use the Tools.getClassName(obj) on an instance to retrieve its class name. + * This method is the only way to get it done in all cases, even if the .js file declaring the class is minified + * @param name The name of the class, case should be preserved + * @param module The name of the Module hosting the class, optional, but strongly recommended to specify if possible. Case should be preserved. + */ + function className(name, module) { + return function (target) { + target["__bjsclassName__"] = name; + target["__bjsmoduleName__"] = (module != null) ? module : null; + }; + } + BABYLON.className = className; + /** + * An implementation of a loop for asynchronous functions. + */ + var AsyncLoop = (function () { + /** + * Constroctor. + * @param iterations the number of iterations. + * @param _fn the function to run each iteration + * @param _successCallback the callback that will be called upon succesful execution + * @param offset starting offset. + */ + function AsyncLoop(iterations, _fn, _successCallback, offset) { + if (offset === void 0) { offset = 0; } + this.iterations = iterations; + this._fn = _fn; + this._successCallback = _successCallback; + this.index = offset - 1; + this._done = false; + } + /** + * Execute the next iteration. Must be called after the last iteration was finished. + */ + AsyncLoop.prototype.executeNext = function () { + if (!this._done) { + if (this.index + 1 < this.iterations) { + ++this.index; + this._fn(this); + } + else { + this.breakLoop(); + } + } + }; + /** + * Break the loop and run the success callback. + */ + AsyncLoop.prototype.breakLoop = function () { + this._done = true; + this._successCallback(); + }; + /** + * Helper function + */ + AsyncLoop.Run = function (iterations, _fn, _successCallback, offset) { + if (offset === void 0) { offset = 0; } + var loop = new AsyncLoop(iterations, _fn, _successCallback, offset); + loop.executeNext(); + return loop; + }; + /** + * A for-loop that will run a given number of iterations synchronous and the rest async. + * @param iterations total number of iterations + * @param syncedIterations number of synchronous iterations in each async iteration. + * @param fn the function to call each iteration. + * @param callback a success call back that will be called when iterating stops. + * @param breakFunction a break condition (optional) + * @param timeout timeout settings for the setTimeout function. default - 0. + * @constructor + */ + AsyncLoop.SyncAsyncForLoop = function (iterations, syncedIterations, fn, callback, breakFunction, timeout) { + if (timeout === void 0) { timeout = 0; } + AsyncLoop.Run(Math.ceil(iterations / syncedIterations), function (loop) { + if (breakFunction && breakFunction()) + loop.breakLoop(); + else { + setTimeout(function () { + for (var i = 0; i < syncedIterations; ++i) { + var iteration = (loop.index * syncedIterations) + i; + if (iteration >= iterations) + break; + fn(iteration); + if (breakFunction && breakFunction()) { + loop.breakLoop(); + break; + } + } + loop.executeNext(); + }, timeout); + } + }, callback); + }; + return AsyncLoop; + }()); + BABYLON.AsyncLoop = AsyncLoop; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.tools.js.map + +var BABYLON; +(function (BABYLON) { + var Internals; + (function (Internals) { + var _AlphaState = (function () { + /** + * Initializes the state. + */ + function _AlphaState() { + this._isAlphaBlendDirty = false; + this._isBlendFunctionParametersDirty = false; + this._alphaBlend = false; + this._blendFunctionParameters = new Array(4); + this.reset(); + } + Object.defineProperty(_AlphaState.prototype, "isDirty", { + get: function () { + return this._isAlphaBlendDirty || this._isBlendFunctionParametersDirty; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_AlphaState.prototype, "alphaBlend", { + get: function () { + return this._alphaBlend; + }, + set: function (value) { + if (this._alphaBlend === value) { + return; + } + this._alphaBlend = value; + this._isAlphaBlendDirty = true; + }, + enumerable: true, + configurable: true + }); + _AlphaState.prototype.setAlphaBlendFunctionParameters = function (value0, value1, value2, value3) { + if (this._blendFunctionParameters[0] === value0 && + this._blendFunctionParameters[1] === value1 && + this._blendFunctionParameters[2] === value2 && + this._blendFunctionParameters[3] === value3) { + return; + } + this._blendFunctionParameters[0] = value0; + this._blendFunctionParameters[1] = value1; + this._blendFunctionParameters[2] = value2; + this._blendFunctionParameters[3] = value3; + this._isBlendFunctionParametersDirty = true; + }; + _AlphaState.prototype.reset = function () { + this._alphaBlend = false; + this._blendFunctionParameters[0] = null; + this._blendFunctionParameters[1] = null; + this._blendFunctionParameters[2] = null; + this._blendFunctionParameters[3] = null; + this._isAlphaBlendDirty = true; + this._isBlendFunctionParametersDirty = false; + }; + _AlphaState.prototype.apply = function (gl) { + if (!this.isDirty) { + return; + } + // Alpha blend + if (this._isAlphaBlendDirty) { + if (this._alphaBlend) { + gl.enable(gl.BLEND); + } + else { + gl.disable(gl.BLEND); + } + this._isAlphaBlendDirty = false; + } + // Alpha function + if (this._isBlendFunctionParametersDirty) { + gl.blendFuncSeparate(this._blendFunctionParameters[0], this._blendFunctionParameters[1], this._blendFunctionParameters[2], this._blendFunctionParameters[3]); + this._isBlendFunctionParametersDirty = false; + } + }; + return _AlphaState; + }()); + Internals._AlphaState = _AlphaState; + })(Internals = BABYLON.Internals || (BABYLON.Internals = {})); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.alphaCullingState.js.map + +var BABYLON; +(function (BABYLON) { + var Internals; + (function (Internals) { + var _DepthCullingState = (function () { + /** + * Initializes the state. + */ + function _DepthCullingState() { + this._isDepthTestDirty = false; + this._isDepthMaskDirty = false; + this._isDepthFuncDirty = false; + this._isCullFaceDirty = false; + this._isCullDirty = false; + this._isZOffsetDirty = false; + this.reset(); + } + Object.defineProperty(_DepthCullingState.prototype, "isDirty", { + get: function () { + return this._isDepthFuncDirty || this._isDepthTestDirty || this._isDepthMaskDirty || this._isCullFaceDirty || this._isCullDirty || this._isZOffsetDirty; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_DepthCullingState.prototype, "zOffset", { + get: function () { + return this._zOffset; + }, + set: function (value) { + if (this._zOffset === value) { + return; + } + this._zOffset = value; + this._isZOffsetDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_DepthCullingState.prototype, "cullFace", { + get: function () { + return this._cullFace; + }, + set: function (value) { + if (this._cullFace === value) { + return; + } + this._cullFace = value; + this._isCullFaceDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_DepthCullingState.prototype, "cull", { + get: function () { + return this._cull; + }, + set: function (value) { + if (this._cull === value) { + return; + } + this._cull = value; + this._isCullDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_DepthCullingState.prototype, "depthFunc", { + get: function () { + return this._depthFunc; + }, + set: function (value) { + if (this._depthFunc === value) { + return; + } + this._depthFunc = value; + this._isDepthFuncDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_DepthCullingState.prototype, "depthMask", { + get: function () { + return this._depthMask; + }, + set: function (value) { + if (this._depthMask === value) { + return; + } + this._depthMask = value; + this._isDepthMaskDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_DepthCullingState.prototype, "depthTest", { + get: function () { + return this._depthTest; + }, + set: function (value) { + if (this._depthTest === value) { + return; + } + this._depthTest = value; + this._isDepthTestDirty = true; + }, + enumerable: true, + configurable: true + }); + _DepthCullingState.prototype.reset = function () { + this._depthMask = true; + this._depthTest = true; + this._depthFunc = null; + this._cullFace = null; + this._cull = null; + this._zOffset = 0; + this._isDepthTestDirty = true; + this._isDepthMaskDirty = true; + this._isDepthFuncDirty = false; + this._isCullFaceDirty = false; + this._isCullDirty = false; + this._isZOffsetDirty = false; + }; + _DepthCullingState.prototype.apply = function (gl) { + if (!this.isDirty) { + return; + } + // Cull + if (this._isCullDirty) { + if (this.cull) { + gl.enable(gl.CULL_FACE); + } + else { + gl.disable(gl.CULL_FACE); + } + this._isCullDirty = false; + } + // Cull face + if (this._isCullFaceDirty) { + gl.cullFace(this.cullFace); + this._isCullFaceDirty = false; + } + // Depth mask + if (this._isDepthMaskDirty) { + gl.depthMask(this.depthMask); + this._isDepthMaskDirty = false; + } + // Depth test + if (this._isDepthTestDirty) { + if (this.depthTest) { + gl.enable(gl.DEPTH_TEST); + } + else { + gl.disable(gl.DEPTH_TEST); + } + this._isDepthTestDirty = false; + } + // Depth func + if (this._isDepthFuncDirty) { + gl.depthFunc(this.depthFunc); + this._isDepthFuncDirty = false; + } + // zOffset + if (this._isZOffsetDirty) { + if (this.zOffset) { + gl.enable(gl.POLYGON_OFFSET_FILL); + gl.polygonOffset(this.zOffset, 0); + } + else { + gl.disable(gl.POLYGON_OFFSET_FILL); + } + this._isZOffsetDirty = false; + } + }; + return _DepthCullingState; + }()); + Internals._DepthCullingState = _DepthCullingState; + })(Internals = BABYLON.Internals || (BABYLON.Internals = {})); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.depthCullingState.js.map + +var BABYLON; +(function (BABYLON) { + var Internals; + (function (Internals) { + var _StencilState = (function () { + function _StencilState() { + this._isStencilTestDirty = false; + this._isStencilMaskDirty = false; + this._isStencilFuncDirty = false; + this._isStencilOpDirty = false; + this.reset(); + } + Object.defineProperty(_StencilState.prototype, "isDirty", { + get: function () { + return this._isStencilTestDirty || this._isStencilMaskDirty || this._isStencilFuncDirty || this._isStencilOpDirty; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_StencilState.prototype, "stencilFunc", { + get: function () { + return this._stencilFunc; + }, + set: function (value) { + if (this._stencilFunc === value) { + return; + } + this._stencilFunc = value; + this._isStencilFuncDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_StencilState.prototype, "stencilFuncRef", { + get: function () { + return this._stencilFuncRef; + }, + set: function (value) { + if (this._stencilFuncRef === value) { + return; + } + this._stencilFuncRef = value; + this._isStencilFuncDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_StencilState.prototype, "stencilFuncMask", { + get: function () { + return this._stencilFuncMask; + }, + set: function (value) { + if (this._stencilFuncMask === value) { + return; + } + this._stencilFuncMask = value; + this._isStencilFuncDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_StencilState.prototype, "stencilOpStencilFail", { + get: function () { + return this._stencilOpStencilFail; + }, + set: function (value) { + if (this._stencilOpStencilFail === value) { + return; + } + this._stencilOpStencilFail = value; + this._isStencilOpDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_StencilState.prototype, "stencilOpDepthFail", { + get: function () { + return this._stencilOpDepthFail; + }, + set: function (value) { + if (this._stencilOpDepthFail === value) { + return; + } + this._stencilOpDepthFail = value; + this._isStencilOpDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_StencilState.prototype, "stencilOpStencilDepthPass", { + get: function () { + return this._stencilOpStencilDepthPass; + }, + set: function (value) { + if (this._stencilOpStencilDepthPass === value) { + return; + } + this._stencilOpStencilDepthPass = value; + this._isStencilOpDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_StencilState.prototype, "stencilMask", { + get: function () { + return this._stencilMask; + }, + set: function (value) { + if (this._stencilMask === value) { + return; + } + this._stencilMask = value; + this._isStencilMaskDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_StencilState.prototype, "stencilTest", { + get: function () { + return this._stencilTest; + }, + set: function (value) { + if (this._stencilTest === value) { + return; + } + this._stencilTest = value; + this._isStencilTestDirty = true; + }, + enumerable: true, + configurable: true + }); + _StencilState.prototype.reset = function () { + this._stencilTest = false; + this._stencilMask = 0xFF; + this._stencilFunc = BABYLON.Engine.ALWAYS; + this._stencilFuncRef = 1; + this._stencilFuncMask = 0xFF; + this._stencilOpStencilFail = BABYLON.Engine.KEEP; + this._stencilOpDepthFail = BABYLON.Engine.KEEP; + this._stencilOpStencilDepthPass = BABYLON.Engine.REPLACE; + this._isStencilTestDirty = true; + this._isStencilMaskDirty = true; + this._isStencilFuncDirty = true; + this._isStencilOpDirty = true; + }; + _StencilState.prototype.apply = function (gl) { + if (!this.isDirty) { + return; + } + // Stencil test + if (this._isStencilTestDirty) { + if (this.stencilTest) { + gl.enable(gl.STENCIL_TEST); + } + else { + gl.disable(gl.STENCIL_TEST); + } + this._isStencilTestDirty = false; + } + // Stencil mask + if (this._isStencilMaskDirty) { + gl.stencilMask(this.stencilMask); + this._isStencilMaskDirty = false; + } + // Stencil func + if (this._isStencilFuncDirty) { + gl.stencilFunc(this.stencilFunc, this.stencilFuncRef, this.stencilFuncMask); + this._isStencilFuncDirty = false; + } + // Stencil op + if (this._isStencilOpDirty) { + gl.stencilOp(this.stencilOpStencilFail, this.stencilOpDepthFail, this.stencilOpStencilDepthPass); + this._isStencilOpDirty = false; + } + }; + return _StencilState; + }()); + Internals._StencilState = _StencilState; + })(Internals = BABYLON.Internals || (BABYLON.Internals = {})); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.stencilState.js.map + +var BABYLON; +(function (BABYLON) { + var compileShader = function (gl, source, type, defines) { + var shader = gl.createShader(type === "vertex" ? gl.VERTEX_SHADER : gl.FRAGMENT_SHADER); + gl.shaderSource(shader, (defines ? defines + "\n" : "") + source); + gl.compileShader(shader); + if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { + throw new Error(gl.getShaderInfoLog(shader)); + } + return shader; + }; + var HALF_FLOAT_OES = 0x8D61; + var getWebGLTextureType = function (gl, type) { + if (type === Engine.TEXTURETYPE_FLOAT) { + return gl.FLOAT; + } + else if (type === Engine.TEXTURETYPE_HALF_FLOAT) { + // Add Half Float Constant. + return HALF_FLOAT_OES; + } + return gl.UNSIGNED_BYTE; + }; + var getSamplingParameters = function (samplingMode, generateMipMaps, gl) { + var magFilter = gl.NEAREST; + var minFilter = gl.NEAREST; + if (samplingMode === BABYLON.Texture.BILINEAR_SAMPLINGMODE) { + magFilter = gl.LINEAR; + if (generateMipMaps) { + minFilter = gl.LINEAR_MIPMAP_NEAREST; + } + else { + minFilter = gl.LINEAR; + } + } + else if (samplingMode === BABYLON.Texture.TRILINEAR_SAMPLINGMODE) { + magFilter = gl.LINEAR; + if (generateMipMaps) { + minFilter = gl.LINEAR_MIPMAP_LINEAR; + } + else { + minFilter = gl.LINEAR; + } + } + else if (samplingMode === BABYLON.Texture.NEAREST_SAMPLINGMODE) { + magFilter = gl.NEAREST; + if (generateMipMaps) { + minFilter = gl.NEAREST_MIPMAP_LINEAR; + } + else { + minFilter = gl.NEAREST; + } + } + return { + min: minFilter, + mag: magFilter + }; + }; + var prepareWebGLTexture = function (texture, gl, scene, width, height, invertY, noMipmap, isCompressed, processFunction, samplingMode) { + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + var engine = scene.getEngine(); + var potWidth = BABYLON.Tools.GetExponentOfTwo(width, engine.getCaps().maxTextureSize); + var potHeight = BABYLON.Tools.GetExponentOfTwo(height, engine.getCaps().maxTextureSize); + engine._bindTextureDirectly(gl.TEXTURE_2D, texture); + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, invertY === undefined ? 1 : (invertY ? 1 : 0)); + texture._baseWidth = width; + texture._baseHeight = height; + texture._width = potWidth; + texture._height = potHeight; + texture.isReady = true; + processFunction(potWidth, potHeight); + var filters = getSamplingParameters(samplingMode, !noMipmap, gl); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filters.mag); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, filters.min); + if (!noMipmap && !isCompressed) { + gl.generateMipmap(gl.TEXTURE_2D); + } + engine._bindTextureDirectly(gl.TEXTURE_2D, null); + engine.resetTextureCache(); + scene._removePendingData(texture); + texture.onLoadedCallbacks.forEach(function (callback) { + callback(); + }); + texture.onLoadedCallbacks = []; + }; + var partialLoad = function (url, index, loadedImages, scene, onfinish, onErrorCallBack) { + if (onErrorCallBack === void 0) { onErrorCallBack = null; } + var img; + var onload = function () { + loadedImages[index] = img; + loadedImages._internalCount++; + scene._removePendingData(img); + if (loadedImages._internalCount === 6) { + onfinish(loadedImages); + } + }; + var onerror = function () { + scene._removePendingData(img); + if (onErrorCallBack) { + onErrorCallBack(); + } + }; + img = BABYLON.Tools.LoadImage(url, onload, onerror, scene.database); + scene._addPendingData(img); + }; + var cascadeLoad = function (rootUrl, scene, onfinish, files, onError) { + if (onError === void 0) { onError = null; } + var loadedImages = []; + loadedImages._internalCount = 0; + for (var index = 0; index < 6; index++) { + partialLoad(files[index], index, loadedImages, scene, onfinish, onError); + } + }; + var InstancingAttributeInfo = (function () { + function InstancingAttributeInfo() { + } + return InstancingAttributeInfo; + }()); + BABYLON.InstancingAttributeInfo = InstancingAttributeInfo; + var EngineCapabilities = (function () { + function EngineCapabilities() { + } + return EngineCapabilities; + }()); + BABYLON.EngineCapabilities = EngineCapabilities; + /** + * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio. + */ + var Engine = (function () { + /** + * @constructor + * @param {HTMLCanvasElement} canvas - the canvas to be used for rendering + * @param {boolean} [antialias] - enable antialias + * @param options - further options to be sent to the getContext function + */ + function Engine(canvas, antialias, options, adaptToDeviceRatio) { + var _this = this; + if (adaptToDeviceRatio === void 0) { adaptToDeviceRatio = true; } + // Public members + this.isFullscreen = false; + this.isPointerLock = false; + this.cullBackFaces = true; + this.renderEvenInBackground = true; + // To enable/disable IDB support and avoid XHR on .manifest + this.enableOfflineSupport = true; + this.scenes = new Array(); + this._windowIsBackground = false; + this._webGLVersion = "1.0"; + this._badOS = false; + this._drawCalls = new BABYLON.PerfCounter(); + this._renderingQueueLaunched = false; + this._activeRenderLoops = []; + // FPS + this.fpsRange = 60; + this.previousFramesDuration = []; + this.fps = 60; + this.deltaTime = 0; + // States + this._depthCullingState = new BABYLON.Internals._DepthCullingState(); + this._stencilState = new BABYLON.Internals._StencilState(); + this._alphaState = new BABYLON.Internals._AlphaState(); + this._alphaMode = Engine.ALPHA_DISABLE; + // Cache + this._loadedTexturesCache = new Array(); + this._maxTextureChannels = 16; + this._activeTexturesCache = new Array(this._maxTextureChannels); + this._compiledEffects = {}; + this._vertexAttribArraysEnabled = []; + this._uintIndicesCurrentlySet = false; + this._currentBoundBuffer = new Array(); + this._currentBufferPointers = []; + this._currentInstanceLocations = new Array(); + this._currentInstanceBuffers = new Array(); + // Hardware supported Compressed Textures + this._texturesSupported = new Array(); + this._onVRFullScreenTriggered = function () { + if (_this._vrDisplayEnabled && _this._vrDisplayEnabled.isPresenting) { + //get the old size before we change + _this._oldSize = new BABYLON.Size(_this.getRenderWidth(), _this.getRenderHeight()); + _this._oldHardwareScaleFactor = _this.getHardwareScalingLevel(); + //according to the WebVR specs, requestAnimationFrame should be triggered only once. + //But actually, no browser follow the specs... + //this._vrAnimationFrameHandler = this._vrDisplayEnabled.requestAnimationFrame(this._bindedRenderFunction); + //get the width and height, change the render size + var leftEye = _this._vrDisplayEnabled.getEyeParameters('left'); + var width, height; + _this.setHardwareScalingLevel(1); + _this.setSize(leftEye.renderWidth * 2, leftEye.renderHeight); + } + else { + //When the specs are implemented, need to uncomment this. + //this._vrDisplayEnabled.cancelAnimationFrame(this._vrAnimationFrameHandler); + _this.setHardwareScalingLevel(_this._oldHardwareScaleFactor); + _this.setSize(_this._oldSize.width, _this._oldSize.height); + _this._vrDisplayEnabled = undefined; + } + }; + this._renderingCanvas = canvas; + this._externalData = new BABYLON.StringDictionary(); + options = options || {}; + if (antialias != null) { + options.antialias = antialias; + } + if (options.preserveDrawingBuffer === undefined) { + options.preserveDrawingBuffer = false; + } + // Checks if some of the format renders first to allow the use of webgl inspector. + var renderToFullFloat = this._canRenderToFloatTexture(); + var renderToHalfFloat = this._canRenderToHalfFloatTexture(); + // GL + //try { + // this._gl = (canvas.getContext("webgl2", options) || canvas.getContext("experimental-webgl2", options)); + // if (this._gl) { + // this._webGLVersion = "2.0"; + // } + //} catch (e) { + // // Do nothing + //} + if (!this._gl) { + if (!canvas) { + throw new Error("The provided canvas is null or undefined."); + } + try { + this._gl = (canvas.getContext("webgl", options) || canvas.getContext("experimental-webgl", options)); + } + catch (e) { + throw new Error("WebGL not supported"); + } + } + if (!this._gl) { + throw new Error("WebGL not supported"); + } + this._onBlur = function () { + _this._windowIsBackground = true; + }; + this._onFocus = function () { + _this._windowIsBackground = false; + }; + window.addEventListener("blur", this._onBlur); + window.addEventListener("focus", this._onFocus); + // Viewport + var limitDeviceRatio = options.limitDeviceRatio || window.devicePixelRatio || 1.0; + this._hardwareScalingLevel = adaptToDeviceRatio ? 1.0 / Math.min(limitDeviceRatio, window.devicePixelRatio || 1.0) : 1.0; + this.resize(); + // Caps + this._isStencilEnable = options.stencil; + this._caps = new EngineCapabilities(); + this._caps.maxTexturesImageUnits = this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS); + this._caps.maxTextureSize = this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE); + this._caps.maxCubemapTextureSize = this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE); + this._caps.maxRenderTextureSize = this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE); + this._caps.maxVertexAttribs = this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS); + // Infos + this._glVersion = this._gl.getParameter(this._gl.VERSION); + var rendererInfo = this._gl.getExtension("WEBGL_debug_renderer_info"); + if (rendererInfo != null) { + this._glRenderer = this._gl.getParameter(rendererInfo.UNMASKED_RENDERER_WEBGL); + this._glVendor = this._gl.getParameter(rendererInfo.UNMASKED_VENDOR_WEBGL); + } + if (!this._glVendor) { + this._glVendor = "Unknown vendor"; + } + if (!this._glRenderer) { + this._glRenderer = "Unknown renderer"; + } + // Extensions + this._caps.standardDerivatives = (this._gl.getExtension('OES_standard_derivatives') !== null); + this._caps.astc = this._gl.getExtension('WEBGL_compressed_texture_astc'); + this._caps.s3tc = this._gl.getExtension('WEBGL_compressed_texture_s3tc'); + this._caps.pvrtc = this._gl.getExtension('WEBGL_compressed_texture_pvrtc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'); // 2nd is what iOS reports + this._caps.etc1 = this._gl.getExtension('WEBGL_compressed_texture_etc1'); + this._caps.etc2 = this._gl.getExtension('WEBGL_compressed_texture_etc') || this._gl.getExtension('WEBGL_compressed_texture_es3_0'); // first is the final name, found hardware using 2nd + this._caps.textureFloat = (this._gl.getExtension('OES_texture_float') !== null); + this._caps.textureAnisotropicFilterExtension = this._gl.getExtension('EXT_texture_filter_anisotropic') || this._gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic') || this._gl.getExtension('MOZ_EXT_texture_filter_anisotropic'); + this._caps.maxAnisotropy = this._caps.textureAnisotropicFilterExtension ? this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0; + this._caps.instancedArrays = this._gl.getExtension('ANGLE_instanced_arrays'); + this._caps.uintIndices = this._gl.getExtension('OES_element_index_uint') !== null; + this._caps.fragmentDepthSupported = this._gl.getExtension('EXT_frag_depth') !== null; + this._caps.highPrecisionShaderSupported = true; + this._caps.drawBuffersExtension = this._gl.getExtension('WEBGL_draw_buffers'); + this._caps.textureFloatLinearFiltering = this._gl.getExtension('OES_texture_float_linear'); + this._caps.textureLOD = this._gl.getExtension('EXT_shader_texture_lod'); + this._caps.textureFloatRender = renderToFullFloat; + this._caps.textureHalfFloat = (this._gl.getExtension('OES_texture_half_float') !== null); + this._caps.textureHalfFloatLinearFiltering = this._gl.getExtension('OES_texture_half_float_linear'); + this._caps.textureHalfFloatRender = renderToHalfFloat; + // Intelligently add supported commpressed formats in order to check for. + // Check for ASTC support first as it is most powerful and to be very cross platform. + // Next PVR & S3, which are probably superior to ETC1/2. + // Likely no hardware which supports both PVR & S3, so order matters little. + // ETC2 is newer and handles ETC1, so check for first. + if (this._caps.astc) + this.texturesSupported.push('.astc'); + if (this._caps.s3tc) + this.texturesSupported.push('.dds'); + if (this._caps.pvrtc) + this.texturesSupported.push('.pvr'); + if (this._caps.etc2) + this.texturesSupported.push('.etc2'); + if (this._caps.etc1) + this.texturesSupported.push('.etc1'); + if (this._gl.getShaderPrecisionFormat) { + var highp = this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER, this._gl.HIGH_FLOAT); + this._caps.highPrecisionShaderSupported = highp.precision !== 0; + } + // Depth buffer + this.setDepthBuffer(true); + this.setDepthFunctionToLessOrEqual(); + this.setDepthWrite(true); + // Fullscreen + this._onFullscreenChange = function () { + if (document.fullscreen !== undefined) { + _this.isFullscreen = document.fullscreen; + } + else if (document.mozFullScreen !== undefined) { + _this.isFullscreen = document.mozFullScreen; + } + else if (document.webkitIsFullScreen !== undefined) { + _this.isFullscreen = document.webkitIsFullScreen; + } + else if (document.msIsFullScreen !== undefined) { + _this.isFullscreen = document.msIsFullScreen; + } + // Pointer lock + if (_this.isFullscreen && _this._pointerLockRequested) { + canvas.requestPointerLock = canvas.requestPointerLock || + canvas.msRequestPointerLock || + canvas.mozRequestPointerLock || + canvas.webkitRequestPointerLock; + if (canvas.requestPointerLock) { + canvas.requestPointerLock(); + } + } + }; + document.addEventListener("fullscreenchange", this._onFullscreenChange, false); + document.addEventListener("mozfullscreenchange", this._onFullscreenChange, false); + document.addEventListener("webkitfullscreenchange", this._onFullscreenChange, false); + document.addEventListener("msfullscreenchange", this._onFullscreenChange, false); + // Pointer lock + this._onPointerLockChange = function () { + _this.isPointerLock = (document.mozPointerLockElement === canvas || + document.webkitPointerLockElement === canvas || + document.msPointerLockElement === canvas || + document.pointerLockElement === canvas); + }; + document.addEventListener("pointerlockchange", this._onPointerLockChange, false); + document.addEventListener("mspointerlockchange", this._onPointerLockChange, false); + document.addEventListener("mozpointerlockchange", this._onPointerLockChange, false); + document.addEventListener("webkitpointerlockchange", this._onPointerLockChange, false); + if (BABYLON.AudioEngine && !Engine.audioEngine) { + Engine.audioEngine = new BABYLON.AudioEngine(); + } + //default loading screen + this._loadingScreen = new BABYLON.DefaultLoadingScreen(this._renderingCanvas); + //Load WebVR Devices + if (options.autoEnableWebVR) { + this.initWebVR(); + } + //Detect if we are running on a faulty buggy OS. + var regexp = /AppleWebKit.*10.[\d] Mobile/; + //ua sniffing is the tool of the devil. + this._badOS = regexp.test(navigator.userAgent); + BABYLON.Tools.Log("Babylon.js engine (v" + Engine.Version + ") launched"); + } + Object.defineProperty(Engine, "NEVER", { + get: function () { + return Engine._NEVER; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "ALWAYS", { + get: function () { + return Engine._ALWAYS; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "LESS", { + get: function () { + return Engine._LESS; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "EQUAL", { + get: function () { + return Engine._EQUAL; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "LEQUAL", { + get: function () { + return Engine._LEQUAL; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "GREATER", { + get: function () { + return Engine._GREATER; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "GEQUAL", { + get: function () { + return Engine._GEQUAL; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "NOTEQUAL", { + get: function () { + return Engine._NOTEQUAL; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "KEEP", { + get: function () { + return Engine._KEEP; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "REPLACE", { + get: function () { + return Engine._REPLACE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "INCR", { + get: function () { + return Engine._INCR; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "DECR", { + get: function () { + return Engine._DECR; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "INVERT", { + get: function () { + return Engine._INVERT; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "INCR_WRAP", { + get: function () { + return Engine._INCR_WRAP; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "DECR_WRAP", { + get: function () { + return Engine._DECR_WRAP; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "ALPHA_DISABLE", { + get: function () { + return Engine._ALPHA_DISABLE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "ALPHA_ONEONE", { + get: function () { + return Engine._ALPHA_ONEONE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "ALPHA_ADD", { + get: function () { + return Engine._ALPHA_ADD; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "ALPHA_COMBINE", { + get: function () { + return Engine._ALPHA_COMBINE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "ALPHA_SUBTRACT", { + get: function () { + return Engine._ALPHA_SUBTRACT; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "ALPHA_MULTIPLY", { + get: function () { + return Engine._ALPHA_MULTIPLY; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "ALPHA_MAXIMIZED", { + get: function () { + return Engine._ALPHA_MAXIMIZED; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "DELAYLOADSTATE_NONE", { + get: function () { + return Engine._DELAYLOADSTATE_NONE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "DELAYLOADSTATE_LOADED", { + get: function () { + return Engine._DELAYLOADSTATE_LOADED; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "DELAYLOADSTATE_LOADING", { + get: function () { + return Engine._DELAYLOADSTATE_LOADING; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "DELAYLOADSTATE_NOTLOADED", { + get: function () { + return Engine._DELAYLOADSTATE_NOTLOADED; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "TEXTUREFORMAT_ALPHA", { + get: function () { + return Engine._TEXTUREFORMAT_ALPHA; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "TEXTUREFORMAT_LUMINANCE", { + get: function () { + return Engine._TEXTUREFORMAT_LUMINANCE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "TEXTUREFORMAT_LUMINANCE_ALPHA", { + get: function () { + return Engine._TEXTUREFORMAT_LUMINANCE_ALPHA; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "TEXTUREFORMAT_RGB", { + get: function () { + return Engine._TEXTUREFORMAT_RGB; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "TEXTUREFORMAT_RGBA", { + get: function () { + return Engine._TEXTUREFORMAT_RGBA; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "TEXTURETYPE_UNSIGNED_INT", { + get: function () { + return Engine._TEXTURETYPE_UNSIGNED_INT; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "TEXTURETYPE_FLOAT", { + get: function () { + return Engine._TEXTURETYPE_FLOAT; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "TEXTURETYPE_HALF_FLOAT", { + get: function () { + return Engine._TEXTURETYPE_HALF_FLOAT; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "Version", { + get: function () { + return "2.5"; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "texturesSupported", { + get: function () { + return this._texturesSupported; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "textureFormatInUse", { + get: function () { + return this._textureFormatInUse; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "webGLVersion", { + get: function () { + return this._webGLVersion; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "isStencilEnable", { + /** + * Returns true if the stencil buffer has been enabled through the creation option of the context. + */ + get: function () { + return this._isStencilEnable; + }, + enumerable: true, + configurable: true + }); + Engine.prototype._prepareWorkingCanvas = function () { + if (this._workingCanvas) { + return; + } + this._workingCanvas = document.createElement("canvas"); + this._workingContext = this._workingCanvas.getContext("2d"); + }; + Engine.prototype.resetTextureCache = function () { + for (var index = 0; index < this._maxTextureChannels; index++) { + this._activeTexturesCache[index] = null; + } + }; + Engine.prototype.getGlInfo = function () { + return { + vendor: this._glVendor, + renderer: this._glRenderer, + version: this._glVersion + }; + }; + Engine.prototype.getAspectRatio = function (camera, useScreen) { + if (useScreen === void 0) { useScreen = false; } + var viewport = camera.viewport; + return (this.getRenderWidth(useScreen) * viewport.width) / (this.getRenderHeight(useScreen) * viewport.height); + }; + Engine.prototype.getRenderWidth = function (useScreen) { + if (useScreen === void 0) { useScreen = false; } + if (!useScreen && this._currentRenderTarget) { + return this._currentRenderTarget._width; + } + return this._renderingCanvas.width; + }; + Engine.prototype.getRenderHeight = function (useScreen) { + if (useScreen === void 0) { useScreen = false; } + if (!useScreen && this._currentRenderTarget) { + return this._currentRenderTarget._height; + } + return this._renderingCanvas.height; + }; + Engine.prototype.getRenderingCanvas = function () { + return this._renderingCanvas; + }; + Engine.prototype.getRenderingCanvasClientRect = function () { + return this._renderingCanvas.getBoundingClientRect(); + }; + Engine.prototype.setHardwareScalingLevel = function (level) { + this._hardwareScalingLevel = level; + this.resize(); + }; + Engine.prototype.getHardwareScalingLevel = function () { + return this._hardwareScalingLevel; + }; + Engine.prototype.getLoadedTexturesCache = function () { + return this._loadedTexturesCache; + }; + Engine.prototype.getCaps = function () { + return this._caps; + }; + Object.defineProperty(Engine.prototype, "drawCalls", { + get: function () { + return this._drawCalls.current; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "drawCallsPerfCounter", { + get: function () { + return this._drawCalls; + }, + enumerable: true, + configurable: true + }); + Engine.prototype.getDepthFunction = function () { + return this._depthCullingState.depthFunc; + }; + Engine.prototype.setDepthFunction = function (depthFunc) { + this._depthCullingState.depthFunc = depthFunc; + }; + Engine.prototype.setDepthFunctionToGreater = function () { + this._depthCullingState.depthFunc = this._gl.GREATER; + }; + Engine.prototype.setDepthFunctionToGreaterOrEqual = function () { + this._depthCullingState.depthFunc = this._gl.GEQUAL; + }; + Engine.prototype.setDepthFunctionToLess = function () { + this._depthCullingState.depthFunc = this._gl.LESS; + }; + Engine.prototype.setDepthFunctionToLessOrEqual = function () { + this._depthCullingState.depthFunc = this._gl.LEQUAL; + }; + Engine.prototype.getStencilBuffer = function () { + return this._stencilState.stencilTest; + }; + Engine.prototype.setStencilBuffer = function (enable) { + this._stencilState.stencilTest = enable; + }; + Engine.prototype.getStencilMask = function () { + return this._stencilState.stencilMask; + }; + Engine.prototype.setStencilMask = function (mask) { + this._stencilState.stencilMask = mask; + }; + Engine.prototype.getStencilFunction = function () { + return this._stencilState.stencilFunc; + }; + Engine.prototype.getStencilFunctionReference = function () { + return this._stencilState.stencilFuncRef; + }; + Engine.prototype.getStencilFunctionMask = function () { + return this._stencilState.stencilFuncMask; + }; + Engine.prototype.setStencilFunction = function (stencilFunc) { + this._stencilState.stencilFunc = stencilFunc; + }; + Engine.prototype.setStencilFunctionReference = function (reference) { + this._stencilState.stencilFuncRef = reference; + }; + Engine.prototype.setStencilFunctionMask = function (mask) { + this._stencilState.stencilFuncMask = mask; + }; + Engine.prototype.getStencilOperationFail = function () { + return this._stencilState.stencilOpStencilFail; + }; + Engine.prototype.getStencilOperationDepthFail = function () { + return this._stencilState.stencilOpDepthFail; + }; + Engine.prototype.getStencilOperationPass = function () { + return this._stencilState.stencilOpStencilDepthPass; + }; + Engine.prototype.setStencilOperationFail = function (operation) { + this._stencilState.stencilOpStencilFail = operation; + }; + Engine.prototype.setStencilOperationDepthFail = function (operation) { + this._stencilState.stencilOpDepthFail = operation; + }; + Engine.prototype.setStencilOperationPass = function (operation) { + this._stencilState.stencilOpStencilDepthPass = operation; + }; + /** + * stop executing a render loop function and remove it from the execution array + * @param {Function} [renderFunction] the function to be removed. If not provided all functions will be removed. + */ + Engine.prototype.stopRenderLoop = function (renderFunction) { + if (!renderFunction) { + this._activeRenderLoops = []; + return; + } + var index = this._activeRenderLoops.indexOf(renderFunction); + if (index >= 0) { + this._activeRenderLoops.splice(index, 1); + } + }; + Engine.prototype._renderLoop = function () { + var shouldRender = true; + if (!this.renderEvenInBackground && this._windowIsBackground) { + shouldRender = false; + } + if (shouldRender) { + // Start new frame + this.beginFrame(); + for (var index = 0; index < this._activeRenderLoops.length; index++) { + var renderFunction = this._activeRenderLoops[index]; + renderFunction(); + } + // Present + this.endFrame(); + } + if (this._activeRenderLoops.length > 0) { + // Register new frame + BABYLON.Tools.QueueNewFrame(this._bindedRenderFunction, this._vrDisplayEnabled); + } + else { + this._renderingQueueLaunched = false; + } + }; + /** + * Register and execute a render loop. The engine can have more than one render function. + * @param {Function} renderFunction - the function to continuously execute starting the next render loop. + * @example + * engine.runRenderLoop(function () { + * scene.render() + * }) + */ + Engine.prototype.runRenderLoop = function (renderFunction) { + if (this._activeRenderLoops.indexOf(renderFunction) !== -1) { + return; + } + this._activeRenderLoops.push(renderFunction); + if (!this._renderingQueueLaunched) { + this._renderingQueueLaunched = true; + this._bindedRenderFunction = this._renderLoop.bind(this); + BABYLON.Tools.QueueNewFrame(this._bindedRenderFunction); + } + }; + /** + * Toggle full screen mode. + * @param {boolean} requestPointerLock - should a pointer lock be requested from the user + * @param {any} options - an options object to be sent to the requestFullscreen function + */ + Engine.prototype.switchFullscreen = function (requestPointerLock) { + if (this.isFullscreen) { + BABYLON.Tools.ExitFullscreen(); + } + else { + this._pointerLockRequested = requestPointerLock; + BABYLON.Tools.RequestFullscreen(this._renderingCanvas); + } + }; + Engine.prototype.clear = function (color, backBuffer, depth, stencil) { + if (stencil === void 0) { stencil = false; } + this.applyStates(); + var mode = 0; + if (backBuffer) { + this._gl.clearColor(color.r, color.g, color.b, color.a !== undefined ? color.a : 1.0); + mode |= this._gl.COLOR_BUFFER_BIT; + } + if (depth) { + this._gl.clearDepth(1.0); + mode |= this._gl.DEPTH_BUFFER_BIT; + } + if (stencil) { + this._gl.clearStencil(0); + mode |= this._gl.STENCIL_BUFFER_BIT; + } + this._gl.clear(mode); + }; + Engine.prototype.scissorClear = function (x, y, width, height, clearColor) { + var gl = this._gl; + // Save state + var curScissor = gl.getParameter(gl.SCISSOR_TEST); + var curScissorBox = gl.getParameter(gl.SCISSOR_BOX); + // Change state + gl.enable(gl.SCISSOR_TEST); + gl.scissor(x, y, width, height); + // Clear + this.clear(clearColor, true, true, true); + // Restore state + gl.scissor(curScissorBox[0], curScissorBox[1], curScissorBox[2], curScissorBox[3]); + if (curScissor === true) { + gl.enable(gl.SCISSOR_TEST); + } + else { + gl.disable(gl.SCISSOR_TEST); + } + }; + /** + * Set the WebGL's viewport + * @param {BABYLON.Viewport} viewport - the viewport element to be used. + * @param {number} [requiredWidth] - the width required for rendering. If not provided the rendering canvas' width is used. + * @param {number} [requiredHeight] - the height required for rendering. If not provided the rendering canvas' height is used. + */ + Engine.prototype.setViewport = function (viewport, requiredWidth, requiredHeight) { + var width = requiredWidth || (navigator.isCocoonJS ? window.innerWidth : this._renderingCanvas.width); + var height = requiredHeight || (navigator.isCocoonJS ? window.innerHeight : this._renderingCanvas.height); + var x = viewport.x || 0; + var y = viewport.y || 0; + this._cachedViewport = viewport; + this._gl.viewport(x * width, y * height, width * viewport.width, height * viewport.height); + }; + /** + * Directly set the WebGL Viewport + * The x, y, width & height are directly passed to the WebGL call + * @return the current viewport Object (if any) that is being replaced by this call. You can restore this viewport later on to go back to the original state. + */ + Engine.prototype.setDirectViewport = function (x, y, width, height) { + var currentViewport = this._cachedViewport; + this._cachedViewport = null; + this._gl.viewport(x, y, width, height); + return currentViewport; + }; + Engine.prototype.beginFrame = function () { + this._measureFps(); + }; + Engine.prototype.endFrame = function () { + //force a flush in case we are using a bad OS. + if (this._badOS) { + this.flushFramebuffer(); + } + //submit frame to the vr device, if enabled + if (this._vrDisplayEnabled && this._vrDisplayEnabled.isPresenting) { + this._vrDisplayEnabled.submitFrame(); + } + }; + /** + * resize the view according to the canvas' size. + * @example + * window.addEventListener("resize", function () { + * engine.resize(); + * }); + */ + Engine.prototype.resize = function () { + var width = navigator.isCocoonJS ? window.innerWidth : this._renderingCanvas.clientWidth; + var height = navigator.isCocoonJS ? window.innerHeight : this._renderingCanvas.clientHeight; + this.setSize(width / this._hardwareScalingLevel, height / this._hardwareScalingLevel); + for (var index = 0; index < this.scenes.length; index++) { + var scene = this.scenes[index]; + if (BABYLON.DebugLayer && scene.debugLayer.isVisible()) { + scene.debugLayer._syncPositions(); + } + } + }; + /** + * force a specific size of the canvas + * @param {number} width - the new canvas' width + * @param {number} height - the new canvas' height + */ + Engine.prototype.setSize = function (width, height) { + this._renderingCanvas.width = width; + this._renderingCanvas.height = height; + for (var index = 0; index < this.scenes.length; index++) { + var scene = this.scenes[index]; + for (var camIndex = 0; camIndex < scene.cameras.length; camIndex++) { + var cam = scene.cameras[camIndex]; + cam._currentRenderId = 0; + } + } + }; + //WebVR functions + Engine.prototype.initWebVR = function () { + if (!this.vrDisplaysPromise) { + this._getVRDisplays(); + } + }; + Engine.prototype.enableVR = function (vrDevice) { + this._vrDisplayEnabled = vrDevice; + this._vrDisplayEnabled.requestPresent([{ source: this.getRenderingCanvas() }]).then(this._onVRFullScreenTriggered); + }; + Engine.prototype.disableVR = function () { + if (this._vrDisplayEnabled) { + this._vrDisplayEnabled.exitPresent().then(this._onVRFullScreenTriggered); + } + }; + Engine.prototype._getVRDisplays = function () { + var _this = this; + var getWebVRDevices = function (devices) { + var size = devices.length; + var i = 0; + _this._vrDisplays = devices.filter(function (device) { + return devices[i] instanceof VRDisplay; + }); + return _this._vrDisplays; + }; + //using a key due to typescript + if (navigator.getVRDisplays) { + this.vrDisplaysPromise = navigator.getVRDisplays().then(getWebVRDevices); + } + }; + Engine.prototype.bindFramebuffer = function (texture, faceIndex, requiredWidth, requiredHeight) { + this._currentRenderTarget = texture; + this.bindUnboundFramebuffer(texture._framebuffer); + var gl = this._gl; + if (texture.isCube) { + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, texture, 0); + } + gl.viewport(0, 0, requiredWidth || texture._width, requiredHeight || texture._height); + this.wipeCaches(); + }; + Engine.prototype.bindUnboundFramebuffer = function (framebuffer) { + if (this._currentFramebuffer !== framebuffer) { + this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, framebuffer); + this._currentFramebuffer = framebuffer; + } + }; + Engine.prototype.unBindFramebuffer = function (texture, disableGenerateMipMaps) { + if (disableGenerateMipMaps === void 0) { disableGenerateMipMaps = false; } + this._currentRenderTarget = null; + if (texture.generateMipMaps && !disableGenerateMipMaps) { + var gl = this._gl; + this._bindTextureDirectly(gl.TEXTURE_2D, texture); + gl.generateMipmap(gl.TEXTURE_2D); + this._bindTextureDirectly(gl.TEXTURE_2D, null); + } + this.bindUnboundFramebuffer(null); + }; + Engine.prototype.generateMipMapsForCubemap = function (texture) { + if (texture.generateMipMaps) { + var gl = this._gl; + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture); + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + } + }; + Engine.prototype.flushFramebuffer = function () { + this._gl.flush(); + }; + Engine.prototype.restoreDefaultFramebuffer = function () { + this._currentRenderTarget = null; + this.bindUnboundFramebuffer(null); + this.setViewport(this._cachedViewport); + this.wipeCaches(); + }; + // VBOs + Engine.prototype._resetVertexBufferBinding = function () { + this.bindArrayBuffer(null); + this._cachedVertexBuffers = null; + }; + Engine.prototype.createVertexBuffer = function (vertices) { + var vbo = this._gl.createBuffer(); + this.bindArrayBuffer(vbo); + if (vertices instanceof Float32Array) { + this._gl.bufferData(this._gl.ARRAY_BUFFER, vertices, this._gl.STATIC_DRAW); + } + else { + this._gl.bufferData(this._gl.ARRAY_BUFFER, new Float32Array(vertices), this._gl.STATIC_DRAW); + } + this._resetVertexBufferBinding(); + vbo.references = 1; + return vbo; + }; + Engine.prototype.createDynamicVertexBuffer = function (vertices) { + var vbo = this._gl.createBuffer(); + this.bindArrayBuffer(vbo); + if (vertices instanceof Float32Array) { + this._gl.bufferData(this._gl.ARRAY_BUFFER, vertices, this._gl.DYNAMIC_DRAW); + } + else { + this._gl.bufferData(this._gl.ARRAY_BUFFER, new Float32Array(vertices), this._gl.DYNAMIC_DRAW); + } + this._resetVertexBufferBinding(); + vbo.references = 1; + return vbo; + }; + Engine.prototype.updateDynamicVertexBuffer = function (vertexBuffer, vertices, offset, count) { + this.bindArrayBuffer(vertexBuffer); + if (offset === undefined) { + offset = 0; + } + if (count === undefined) { + if (vertices instanceof Float32Array) { + this._gl.bufferSubData(this._gl.ARRAY_BUFFER, offset, vertices); + } + else { + this._gl.bufferSubData(this._gl.ARRAY_BUFFER, offset, new Float32Array(vertices)); + } + } + else { + if (vertices instanceof Float32Array) { + this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, vertices.subarray(offset, offset + count)); + } + else { + this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, new Float32Array(vertices).subarray(offset, offset + count)); + } + } + this._resetVertexBufferBinding(); + }; + Engine.prototype._resetIndexBufferBinding = function () { + this.bindIndexBuffer(null); + this._cachedIndexBuffer = null; + }; + Engine.prototype.createIndexBuffer = function (indices) { + var vbo = this._gl.createBuffer(); + this.bindIndexBuffer(vbo); + // Check for 32 bits indices + var arrayBuffer; + var need32Bits = false; + if (this._caps.uintIndices) { + for (var index = 0; index < indices.length; index++) { + if (indices[index] > 65535) { + need32Bits = true; + break; + } + } + arrayBuffer = need32Bits ? new Uint32Array(indices) : new Uint16Array(indices); + } + else { + arrayBuffer = new Uint16Array(indices); + } + this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, arrayBuffer, this._gl.STATIC_DRAW); + this._resetIndexBufferBinding(); + vbo.references = 1; + vbo.is32Bits = need32Bits; + return vbo; + }; + Engine.prototype.bindArrayBuffer = function (buffer) { + this.bindBuffer(buffer, this._gl.ARRAY_BUFFER); + }; + Engine.prototype.bindIndexBuffer = function (buffer) { + this.bindBuffer(buffer, this._gl.ELEMENT_ARRAY_BUFFER); + }; + Engine.prototype.bindBuffer = function (buffer, target) { + if (this._currentBoundBuffer[target] !== buffer) { + this._gl.bindBuffer(target, buffer); + this._currentBoundBuffer[target] = buffer; + } + }; + Engine.prototype.updateArrayBuffer = function (data) { + this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, data); + }; + Engine.prototype.vertexAttribPointer = function (buffer, indx, size, type, normalized, stride, offset) { + var pointer = this._currentBufferPointers[indx]; + var changed = false; + if (!pointer) { + changed = true; + this._currentBufferPointers[indx] = { indx: indx, size: size, type: type, normalized: normalized, stride: stride, offset: offset, buffer: buffer }; + } + else { + if (pointer.buffer !== buffer) { + pointer.buffer = buffer; + changed = true; + } + if (pointer.size !== size) { + pointer.size = size; + changed = true; + } + if (pointer.type !== type) { + pointer.type = type; + changed = true; + } + if (pointer.normalized !== normalized) { + pointer.normalized = normalized; + changed = true; + } + if (pointer.stride !== stride) { + pointer.stride = stride; + changed = true; + } + if (pointer.offset !== offset) { + pointer.offset = offset; + changed = true; + } + } + if (changed) { + this.bindArrayBuffer(buffer); + this._gl.vertexAttribPointer(indx, size, type, normalized, stride, offset); + } + }; + Engine.prototype.bindBuffersDirectly = function (vertexBuffer, indexBuffer, vertexDeclaration, vertexStrideSize, effect) { + if (this._cachedVertexBuffers !== vertexBuffer || this._cachedEffectForVertexBuffers !== effect) { + this._cachedVertexBuffers = vertexBuffer; + this._cachedEffectForVertexBuffers = effect; + var attributesCount = effect.getAttributesCount(); + var offset = 0; + for (var index = 0; index < attributesCount; index++) { + if (index < vertexDeclaration.length) { + var order = effect.getAttributeLocation(index); + if (order >= 0) { + if (!this._vertexAttribArraysEnabled[order]) { + this._gl.enableVertexAttribArray(order); + this._vertexAttribArraysEnabled[order] = true; + } + this.vertexAttribPointer(vertexBuffer, order, vertexDeclaration[index], this._gl.FLOAT, false, vertexStrideSize, offset); + } + offset += vertexDeclaration[index] * 4; + } + else { + //disable effect attributes that have no data + var order = effect.getAttributeLocation(index); + if (this._vertexAttribArraysEnabled[order]) { + this._gl.disableVertexAttribArray(order); + this._vertexAttribArraysEnabled[order] = false; + } + } + } + } + if (this._cachedIndexBuffer !== indexBuffer) { + this._cachedIndexBuffer = indexBuffer; + this.bindIndexBuffer(indexBuffer); + this._uintIndicesCurrentlySet = indexBuffer.is32Bits; + } + }; + Engine.prototype.bindBuffers = function (vertexBuffers, indexBuffer, effect) { + if (this._cachedVertexBuffers !== vertexBuffers || this._cachedEffectForVertexBuffers !== effect) { + this._cachedVertexBuffers = vertexBuffers; + this._cachedEffectForVertexBuffers = effect; + var attributes = effect.getAttributesNames(); + for (var index = 0; index < attributes.length; index++) { + var order = effect.getAttributeLocation(index); + if (order >= 0) { + var vertexBuffer = vertexBuffers[attributes[index]]; + if (!vertexBuffer) { + if (this._vertexAttribArraysEnabled[order]) { + this._gl.disableVertexAttribArray(order); + this._vertexAttribArraysEnabled[order] = false; + } + continue; + } + if (!this._vertexAttribArraysEnabled[order]) { + this._gl.enableVertexAttribArray(order); + this._vertexAttribArraysEnabled[order] = true; + } + var buffer = vertexBuffer.getBuffer(); + this.vertexAttribPointer(buffer, order, vertexBuffer.getSize(), this._gl.FLOAT, false, vertexBuffer.getStrideSize() * 4, vertexBuffer.getOffset() * 4); + if (vertexBuffer.getIsInstanced()) { + this._caps.instancedArrays.vertexAttribDivisorANGLE(order, 1); + this._currentInstanceLocations.push(order); + this._currentInstanceBuffers.push(buffer); + } + } + } + } + if (indexBuffer != null && this._cachedIndexBuffer !== indexBuffer) { + this._cachedIndexBuffer = indexBuffer; + this.bindIndexBuffer(indexBuffer); + this._uintIndicesCurrentlySet = indexBuffer.is32Bits; + } + }; + Engine.prototype.unbindInstanceAttributes = function () { + var boundBuffer; + for (var i = 0, ul = this._currentInstanceLocations.length; i < ul; i++) { + var instancesBuffer = this._currentInstanceBuffers[i]; + if (boundBuffer != instancesBuffer) { + boundBuffer = instancesBuffer; + this.bindArrayBuffer(instancesBuffer); + } + var offsetLocation = this._currentInstanceLocations[i]; + this._caps.instancedArrays.vertexAttribDivisorANGLE(offsetLocation, 0); + } + this._currentInstanceBuffers.length = 0; + this._currentInstanceLocations.length = 0; + }; + Engine.prototype._releaseBuffer = function (buffer) { + buffer.references--; + if (buffer.references === 0) { + this._gl.deleteBuffer(buffer); + return true; + } + return false; + }; + Engine.prototype.createInstancesBuffer = function (capacity) { + var buffer = this._gl.createBuffer(); + buffer.capacity = capacity; + this.bindArrayBuffer(buffer); + this._gl.bufferData(this._gl.ARRAY_BUFFER, capacity, this._gl.DYNAMIC_DRAW); + return buffer; + }; + Engine.prototype.deleteInstancesBuffer = function (buffer) { + this._gl.deleteBuffer(buffer); + }; + Engine.prototype.updateAndBindInstancesBuffer = function (instancesBuffer, data, offsetLocations) { + this.bindArrayBuffer(instancesBuffer); + if (data) { + this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, data); + } + if (offsetLocations[0].index !== undefined) { + var stride = 0; + for (var i = 0; i < offsetLocations.length; i++) { + var ai = offsetLocations[i]; + stride += ai.attributeSize * 4; + } + for (var i = 0; i < offsetLocations.length; i++) { + var ai = offsetLocations[i]; + if (!this._vertexAttribArraysEnabled[ai.index]) { + this._gl.enableVertexAttribArray(ai.index); + this._vertexAttribArraysEnabled[ai.index] = true; + } + this.vertexAttribPointer(instancesBuffer, ai.index, ai.attributeSize, ai.attribyteType || this._gl.FLOAT, ai.normalized || false, stride, ai.offset); + this._caps.instancedArrays.vertexAttribDivisorANGLE(ai.index, 1); + this._currentInstanceLocations.push(ai.index); + this._currentInstanceBuffers.push(instancesBuffer); + } + } + else { + for (var index = 0; index < 4; index++) { + var offsetLocation = offsetLocations[index]; + if (!this._vertexAttribArraysEnabled[offsetLocation]) { + this._gl.enableVertexAttribArray(offsetLocation); + this._vertexAttribArraysEnabled[offsetLocation] = true; + } + this.vertexAttribPointer(instancesBuffer, offsetLocation, 4, this._gl.FLOAT, false, 64, index * 16); + this._caps.instancedArrays.vertexAttribDivisorANGLE(offsetLocation, 1); + this._currentInstanceLocations.push(offsetLocation); + this._currentInstanceBuffers.push(instancesBuffer); + } + } + }; + Engine.prototype.applyStates = function () { + this._depthCullingState.apply(this._gl); + this._stencilState.apply(this._gl); + this._alphaState.apply(this._gl); + }; + Engine.prototype.draw = function (useTriangles, indexStart, indexCount, instancesCount) { + // Apply states + this.applyStates(); + this._drawCalls.addCount(1, false); + // Render + var indexFormat = this._uintIndicesCurrentlySet ? this._gl.UNSIGNED_INT : this._gl.UNSIGNED_SHORT; + var mult = this._uintIndicesCurrentlySet ? 4 : 2; + if (instancesCount) { + this._caps.instancedArrays.drawElementsInstancedANGLE(useTriangles ? this._gl.TRIANGLES : this._gl.LINES, indexCount, indexFormat, indexStart * mult, instancesCount); + return; + } + this._gl.drawElements(useTriangles ? this._gl.TRIANGLES : this._gl.LINES, indexCount, indexFormat, indexStart * mult); + }; + Engine.prototype.drawPointClouds = function (verticesStart, verticesCount, instancesCount) { + // Apply states + this.applyStates(); + this._drawCalls.addCount(1, false); + if (instancesCount) { + this._caps.instancedArrays.drawArraysInstancedANGLE(this._gl.POINTS, verticesStart, verticesCount, instancesCount); + return; + } + this._gl.drawArrays(this._gl.POINTS, verticesStart, verticesCount); + }; + Engine.prototype.drawUnIndexed = function (useTriangles, verticesStart, verticesCount, instancesCount) { + // Apply states + this.applyStates(); + this._drawCalls.addCount(1, false); + if (instancesCount) { + this._caps.instancedArrays.drawArraysInstancedANGLE(useTriangles ? this._gl.TRIANGLES : this._gl.LINES, verticesStart, verticesCount, instancesCount); + return; + } + this._gl.drawArrays(useTriangles ? this._gl.TRIANGLES : this._gl.LINES, verticesStart, verticesCount); + }; + // Shaders + Engine.prototype._releaseEffect = function (effect) { + if (this._compiledEffects[effect._key]) { + delete this._compiledEffects[effect._key]; + if (effect.getProgram()) { + this._gl.deleteProgram(effect.getProgram()); + } + } + }; + Engine.prototype.createEffect = function (baseName, attributesNames, uniformsNames, samplers, defines, fallbacks, onCompiled, onError, indexParameters) { + var vertex = baseName.vertexElement || baseName.vertex || baseName; + var fragment = baseName.fragmentElement || baseName.fragment || baseName; + var name = vertex + "+" + fragment + "@" + defines; + if (this._compiledEffects[name]) { + return this._compiledEffects[name]; + } + var effect = new BABYLON.Effect(baseName, attributesNames, uniformsNames, samplers, this, defines, fallbacks, onCompiled, onError, indexParameters); + effect._key = name; + this._compiledEffects[name] = effect; + return effect; + }; + Engine.prototype.createEffectForParticles = function (fragmentName, uniformsNames, samplers, defines, fallbacks, onCompiled, onError) { + if (uniformsNames === void 0) { uniformsNames = []; } + if (samplers === void 0) { samplers = []; } + if (defines === void 0) { defines = ""; } + return this.createEffect({ + vertex: "particles", + fragmentElement: fragmentName + }, ["position", "color", "options"], ["view", "projection"].concat(uniformsNames), ["diffuseSampler"].concat(samplers), defines, fallbacks, onCompiled, onError); + }; + Engine.prototype.createShaderProgram = function (vertexCode, fragmentCode, defines, context) { + context = context || this._gl; + var vertexShader = compileShader(context, vertexCode, "vertex", defines); + var fragmentShader = compileShader(context, fragmentCode, "fragment", defines); + var shaderProgram = context.createProgram(); + context.attachShader(shaderProgram, vertexShader); + context.attachShader(shaderProgram, fragmentShader); + context.linkProgram(shaderProgram); + var linked = context.getProgramParameter(shaderProgram, context.LINK_STATUS); + if (!linked) { + var error = context.getProgramInfoLog(shaderProgram); + if (error) { + throw new Error(error); + } + } + context.deleteShader(vertexShader); + context.deleteShader(fragmentShader); + return shaderProgram; + }; + Engine.prototype.getUniforms = function (shaderProgram, uniformsNames) { + var results = []; + for (var index = 0; index < uniformsNames.length; index++) { + results.push(this._gl.getUniformLocation(shaderProgram, uniformsNames[index])); + } + return results; + }; + Engine.prototype.getAttributes = function (shaderProgram, attributesNames) { + var results = []; + for (var index = 0; index < attributesNames.length; index++) { + try { + results.push(this._gl.getAttribLocation(shaderProgram, attributesNames[index])); + } + catch (e) { + results.push(-1); + } + } + return results; + }; + Engine.prototype.enableEffect = function (effect) { + //if (!effect || !effect.getAttributesCount() || this._currentEffect === effect) { + // if (effect && effect.onBind) { + // effect.onBind(effect); + // } + // return; + //} + // Use program + this.setProgram(effect.getProgram()); + this._currentEffect = effect; + if (effect.onBind) { + effect.onBind(effect); + } + }; + Engine.prototype.setIntArray = function (uniform, array) { + if (!uniform) + return; + this._gl.uniform1iv(uniform, array); + }; + Engine.prototype.setIntArray2 = function (uniform, array) { + if (!uniform || array.length % 2 !== 0) + return; + this._gl.uniform2iv(uniform, array); + }; + Engine.prototype.setIntArray3 = function (uniform, array) { + if (!uniform || array.length % 3 !== 0) + return; + this._gl.uniform3iv(uniform, array); + }; + Engine.prototype.setIntArray4 = function (uniform, array) { + if (!uniform || array.length % 4 !== 0) + return; + this._gl.uniform4iv(uniform, array); + }; + Engine.prototype.setFloatArray = function (uniform, array) { + if (!uniform) + return; + this._gl.uniform1fv(uniform, array); + }; + Engine.prototype.setFloatArray2 = function (uniform, array) { + if (!uniform || array.length % 2 !== 0) + return; + this._gl.uniform2fv(uniform, array); + }; + Engine.prototype.setFloatArray3 = function (uniform, array) { + if (!uniform || array.length % 3 !== 0) + return; + this._gl.uniform3fv(uniform, array); + }; + Engine.prototype.setFloatArray4 = function (uniform, array) { + if (!uniform || array.length % 4 !== 0) + return; + this._gl.uniform4fv(uniform, array); + }; + Engine.prototype.setArray = function (uniform, array) { + if (!uniform) + return; + this._gl.uniform1fv(uniform, array); + }; + Engine.prototype.setArray2 = function (uniform, array) { + if (!uniform || array.length % 2 !== 0) + return; + this._gl.uniform2fv(uniform, array); + }; + Engine.prototype.setArray3 = function (uniform, array) { + if (!uniform || array.length % 3 !== 0) + return; + this._gl.uniform3fv(uniform, array); + }; + Engine.prototype.setArray4 = function (uniform, array) { + if (!uniform || array.length % 4 !== 0) + return; + this._gl.uniform4fv(uniform, array); + }; + Engine.prototype.setMatrices = function (uniform, matrices) { + if (!uniform) + return; + this._gl.uniformMatrix4fv(uniform, false, matrices); + }; + Engine.prototype.setMatrix = function (uniform, matrix) { + if (!uniform) + return; + this._gl.uniformMatrix4fv(uniform, false, matrix.toArray()); + }; + Engine.prototype.setMatrix3x3 = function (uniform, matrix) { + if (!uniform) + return; + this._gl.uniformMatrix3fv(uniform, false, matrix); + }; + Engine.prototype.setMatrix2x2 = function (uniform, matrix) { + if (!uniform) + return; + this._gl.uniformMatrix2fv(uniform, false, matrix); + }; + Engine.prototype.setFloat = function (uniform, value) { + if (!uniform) + return; + this._gl.uniform1f(uniform, value); + }; + Engine.prototype.setFloat2 = function (uniform, x, y) { + if (!uniform) + return; + this._gl.uniform2f(uniform, x, y); + }; + Engine.prototype.setFloat3 = function (uniform, x, y, z) { + if (!uniform) + return; + this._gl.uniform3f(uniform, x, y, z); + }; + Engine.prototype.setBool = function (uniform, bool) { + if (!uniform) + return; + this._gl.uniform1i(uniform, bool); + }; + Engine.prototype.setFloat4 = function (uniform, x, y, z, w) { + if (!uniform) + return; + this._gl.uniform4f(uniform, x, y, z, w); + }; + Engine.prototype.setColor3 = function (uniform, color3) { + if (!uniform) + return; + this._gl.uniform3f(uniform, color3.r, color3.g, color3.b); + }; + Engine.prototype.setColor4 = function (uniform, color3, alpha) { + if (!uniform) + return; + this._gl.uniform4f(uniform, color3.r, color3.g, color3.b, alpha); + }; + // States + Engine.prototype.setState = function (culling, zOffset, force, reverseSide) { + if (zOffset === void 0) { zOffset = 0; } + if (reverseSide === void 0) { reverseSide = false; } + // Culling + var showSide = reverseSide ? this._gl.FRONT : this._gl.BACK; + var hideSide = reverseSide ? this._gl.BACK : this._gl.FRONT; + var cullFace = this.cullBackFaces ? showSide : hideSide; + if (this._depthCullingState.cull !== culling || force || this._depthCullingState.cullFace !== cullFace) { + if (culling) { + this._depthCullingState.cullFace = cullFace; + this._depthCullingState.cull = true; + } + else { + this._depthCullingState.cull = false; + } + } + // Z offset + this._depthCullingState.zOffset = zOffset; + }; + Engine.prototype.setDepthBuffer = function (enable) { + this._depthCullingState.depthTest = enable; + }; + Engine.prototype.getDepthWrite = function () { + return this._depthCullingState.depthMask; + }; + Engine.prototype.setDepthWrite = function (enable) { + this._depthCullingState.depthMask = enable; + }; + Engine.prototype.setColorWrite = function (enable) { + this._gl.colorMask(enable, enable, enable, enable); + }; + Engine.prototype.setAlphaMode = function (mode, noDepthWriteChange) { + if (noDepthWriteChange === void 0) { noDepthWriteChange = false; } + if (this._alphaMode === mode) { + return; + } + switch (mode) { + case Engine.ALPHA_DISABLE: + this._alphaState.alphaBlend = false; + break; + case Engine.ALPHA_COMBINE: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case Engine.ALPHA_ONEONE: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ZERO, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case Engine.ALPHA_ADD: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case Engine.ALPHA_SUBTRACT: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case Engine.ALPHA_MULTIPLY: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR, this._gl.ZERO, this._gl.ONE, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case Engine.ALPHA_MAXIMIZED: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + } + if (!noDepthWriteChange) { + this.setDepthWrite(mode === Engine.ALPHA_DISABLE); + } + this._alphaMode = mode; + }; + Engine.prototype.getAlphaMode = function () { + return this._alphaMode; + }; + Engine.prototype.setAlphaTesting = function (enable) { + this._alphaTest = enable; + }; + Engine.prototype.getAlphaTesting = function () { + return this._alphaTest; + }; + // Textures + Engine.prototype.wipeCaches = function () { + this.resetTextureCache(); + this._currentEffect = null; + this._stencilState.reset(); + this._depthCullingState.reset(); + this.setDepthFunctionToLessOrEqual(); + this._alphaState.reset(); + this._cachedVertexBuffers = null; + this._cachedIndexBuffer = null; + this._cachedEffectForVertexBuffers = null; + }; + Engine.prototype.setSamplingMode = function (texture, samplingMode) { + var gl = this._gl; + this._bindTextureDirectly(gl.TEXTURE_2D, texture); + var magFilter = gl.NEAREST; + var minFilter = gl.NEAREST; + if (samplingMode === BABYLON.Texture.BILINEAR_SAMPLINGMODE) { + magFilter = gl.LINEAR; + minFilter = gl.LINEAR; + } + else if (samplingMode === BABYLON.Texture.TRILINEAR_SAMPLINGMODE) { + magFilter = gl.LINEAR; + minFilter = gl.LINEAR_MIPMAP_LINEAR; + } + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); + this._bindTextureDirectly(gl.TEXTURE_2D, null); + texture.samplingMode = samplingMode; + }; + /** + * Set the compressed texture format to use, based on the formats you have, + * the formats supported by the hardware / browser, and those currently implemented + * in BJS. + * + * Note: The result of this call is not taken into account texture is base64 or when + * using a database / manifest. + * + * @param {Array} formatsAvailable - Extension names including dot. Case + * and order do not matter. + * @returns The extension selected. + */ + Engine.prototype.setTextureFormatToUse = function (formatsAvailable) { + for (var i = 0, len1 = this.texturesSupported.length; i < len1; i++) { + // code to allow the formats to be added as they can be developed / hw tested + if (this._texturesSupported[i] === '.astc') + continue; + if (this._texturesSupported[i] === '.pvr') + continue; + if (this._texturesSupported[i] === '.etc1') + continue; + if (this._texturesSupported[i] === '.etc2') + continue; + for (var j = 0, len2 = formatsAvailable.length; j < len2; j++) { + if (this._texturesSupported[i] === formatsAvailable[j].toLowerCase()) { + return this._textureFormatInUse = this._texturesSupported[i]; + } + } + } + // actively set format to nothing, to allow this to be called more than once + // and possibly fail the 2nd time + return this._textureFormatInUse = null; + }; + Engine.prototype.createTexture = function (url, noMipmap, invertY, scene, samplingMode, onLoad, onError, buffer) { + var _this = this; + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + if (onLoad === void 0) { onLoad = null; } + if (onError === void 0) { onError = null; } + if (buffer === void 0) { buffer = null; } + var texture = this._gl.createTexture(); + var extension; + var fromData = false; + if (url.substr(0, 5) === "data:") { + fromData = true; + } + if (!fromData) { + var lastDot = url.lastIndexOf('.'); + extension = url.substring(lastDot).toLowerCase(); + if (this._textureFormatInUse && !fromData && !scene.database) { + extension = this._textureFormatInUse; + url = url.substring(0, lastDot) + this._textureFormatInUse; + } + } + else { + var oldUrl = url; + fromData = oldUrl.split(':'); + url = oldUrl; + extension = fromData[1].substr(fromData[1].length - 4, 4).toLowerCase(); + } + var isDDS = (extension === ".dds"); + var isTGA = (extension === ".tga"); + scene._addPendingData(texture); + texture.url = url; + texture.noMipmap = noMipmap; + texture.references = 1; + texture.samplingMode = samplingMode; + texture.onLoadedCallbacks = [onLoad]; + this._loadedTexturesCache.push(texture); + var onerror = function () { + scene._removePendingData(texture); + if (onError) { + onError(); + } + }; + var callback; + if (isTGA) { + callback = function (arrayBuffer) { + var data = new Uint8Array(arrayBuffer); + var header = BABYLON.Internals.TGATools.GetTGAHeader(data); + prepareWebGLTexture(texture, _this._gl, scene, header.width, header.height, invertY, noMipmap, false, function () { + BABYLON.Internals.TGATools.UploadContent(_this._gl, data); + }, samplingMode); + }; + if (!(fromData instanceof Array)) + BABYLON.Tools.LoadFile(url, function (arrayBuffer) { + callback(arrayBuffer); + }, null, scene.database, true, onerror); + else + callback(buffer); + } + else if (isDDS) { + callback = function (data) { + var info = BABYLON.Internals.DDSTools.GetDDSInfo(data); + var loadMipmap = (info.isRGB || info.isLuminance || info.mipmapCount > 1) && !noMipmap && ((info.width >> (info.mipmapCount - 1)) === 1); + prepareWebGLTexture(texture, _this._gl, scene, info.width, info.height, invertY, !loadMipmap, info.isFourCC, function () { + BABYLON.Internals.DDSTools.UploadDDSLevels(_this._gl, _this.getCaps().s3tc, data, info, loadMipmap, 1); + }, samplingMode); + }; + if (!(fromData instanceof Array)) + BABYLON.Tools.LoadFile(url, function (data) { + callback(data); + }, null, scene.database, true, onerror); + else + callback(buffer); + } + else { + var onload = function (img) { + prepareWebGLTexture(texture, _this._gl, scene, img.width, img.height, invertY, noMipmap, false, function (potWidth, potHeight) { + var isPot = (img.width === potWidth && img.height === potHeight); + if (!isPot) { + _this._prepareWorkingCanvas(); + _this._workingCanvas.width = potWidth; + _this._workingCanvas.height = potHeight; + if (samplingMode === BABYLON.Texture.NEAREST_SAMPLINGMODE) { + _this._workingContext.imageSmoothingEnabled = false; + _this._workingContext.mozImageSmoothingEnabled = false; + _this._workingContext.oImageSmoothingEnabled = false; + _this._workingContext.webkitImageSmoothingEnabled = false; + _this._workingContext.msImageSmoothingEnabled = false; + } + _this._workingContext.drawImage(img, 0, 0, img.width, img.height, 0, 0, potWidth, potHeight); + if (samplingMode === BABYLON.Texture.NEAREST_SAMPLINGMODE) { + _this._workingContext.imageSmoothingEnabled = true; + _this._workingContext.mozImageSmoothingEnabled = true; + _this._workingContext.oImageSmoothingEnabled = true; + _this._workingContext.webkitImageSmoothingEnabled = true; + _this._workingContext.msImageSmoothingEnabled = true; + } + } + _this._gl.texImage2D(_this._gl.TEXTURE_2D, 0, _this._gl.RGBA, _this._gl.RGBA, _this._gl.UNSIGNED_BYTE, isPot ? img : _this._workingCanvas); + }, samplingMode); + }; + if (!(fromData instanceof Array)) + BABYLON.Tools.LoadImage(url, onload, onerror, scene.database); + else + BABYLON.Tools.LoadImage(buffer, onload, onerror, scene.database); + } + return texture; + }; + Engine.prototype._getInternalFormat = function (format) { + var internalFormat = this._gl.RGBA; + switch (format) { + case Engine.TEXTUREFORMAT_ALPHA: + internalFormat = this._gl.ALPHA; + break; + case Engine.TEXTUREFORMAT_LUMINANCE: + internalFormat = this._gl.LUMINANCE; + break; + case Engine.TEXTUREFORMAT_LUMINANCE_ALPHA: + internalFormat = this._gl.LUMINANCE_ALPHA; + break; + case Engine.TEXTUREFORMAT_RGB: + internalFormat = this._gl.RGB; + break; + case Engine.TEXTUREFORMAT_RGBA: + internalFormat = this._gl.RGBA; + break; + } + return internalFormat; + }; + Engine.prototype.updateRawTexture = function (texture, data, format, invertY, compression) { + if (compression === void 0) { compression = null; } + var internalFormat = this._getInternalFormat(format); + this._bindTextureDirectly(this._gl.TEXTURE_2D, texture); + this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, invertY === undefined ? 1 : (invertY ? 1 : 0)); + if (texture._width % 4 !== 0) { + this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1); + } + if (compression) { + this._gl.compressedTexImage2D(this._gl.TEXTURE_2D, 0, this.getCaps().s3tc[compression], texture._width, texture._height, 0, data); + } + else { + this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, texture._width, texture._height, 0, internalFormat, this._gl.UNSIGNED_BYTE, data); + } + if (texture.generateMipMaps) { + this._gl.generateMipmap(this._gl.TEXTURE_2D); + } + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + this.resetTextureCache(); + texture.isReady = true; + }; + Engine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression) { + if (compression === void 0) { compression = null; } + var texture = this._gl.createTexture(); + texture._baseWidth = width; + texture._baseHeight = height; + texture._width = width; + texture._height = height; + texture.references = 1; + this.updateRawTexture(texture, data, format, invertY, compression); + this._bindTextureDirectly(this._gl.TEXTURE_2D, texture); + // Filters + var filters = getSamplingParameters(samplingMode, generateMipMaps, this._gl); + this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, filters.mag); + this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, filters.min); + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + texture.samplingMode = samplingMode; + this._loadedTexturesCache.push(texture); + return texture; + }; + Engine.prototype.createDynamicTexture = function (width, height, generateMipMaps, samplingMode) { + var texture = this._gl.createTexture(); + texture._baseWidth = width; + texture._baseHeight = height; + if (generateMipMaps) { + width = BABYLON.Tools.GetExponentOfTwo(width, this._caps.maxTextureSize); + height = BABYLON.Tools.GetExponentOfTwo(height, this._caps.maxTextureSize); + } + this.resetTextureCache(); + texture._width = width; + texture._height = height; + texture.isReady = false; + texture.generateMipMaps = generateMipMaps; + texture.references = 1; + texture.samplingMode = samplingMode; + this.updateTextureSamplingMode(samplingMode, texture); + this._loadedTexturesCache.push(texture); + return texture; + }; + Engine.prototype.updateTextureSamplingMode = function (samplingMode, texture) { + var filters = getSamplingParameters(samplingMode, texture.generateMipMaps, this._gl); + if (texture.isCube) { + this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, texture); + this._gl.texParameteri(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_MAG_FILTER, filters.mag); + this._gl.texParameteri(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_MIN_FILTER, filters.min); + this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null); + } + else { + this._bindTextureDirectly(this._gl.TEXTURE_2D, texture); + this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, filters.mag); + this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, filters.min); + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + } + }; + Engine.prototype.updateDynamicTexture = function (texture, canvas, invertY, premulAlpha) { + if (premulAlpha === void 0) { premulAlpha = false; } + this._bindTextureDirectly(this._gl.TEXTURE_2D, texture); + this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, invertY ? 1 : 0); + if (premulAlpha) { + this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1); + } + this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, canvas); + if (texture.generateMipMaps) { + this._gl.generateMipmap(this._gl.TEXTURE_2D); + } + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + if (premulAlpha) { + this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0); + } + this.resetTextureCache(); + texture.isReady = true; + }; + Engine.prototype.updateVideoTexture = function (texture, video, invertY) { + if (texture._isDisabled) { + return; + } + this._bindTextureDirectly(this._gl.TEXTURE_2D, texture); + this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, invertY ? 0 : 1); // Video are upside down by default + try { + // Testing video texture support + if (this._videoTextureSupported === undefined) { + this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, video); + if (this._gl.getError() !== 0) { + this._videoTextureSupported = false; + } + else { + this._videoTextureSupported = true; + } + } + // Copy video through the current working canvas if video texture is not supported + if (!this._videoTextureSupported) { + if (!texture._workingCanvas) { + texture._workingCanvas = document.createElement("canvas"); + texture._workingContext = texture._workingCanvas.getContext("2d"); + texture._workingCanvas.width = texture._width; + texture._workingCanvas.height = texture._height; + } + texture._workingContext.drawImage(video, 0, 0, video.videoWidth, video.videoHeight, 0, 0, texture._width, texture._height); + this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, texture._workingCanvas); + } + else { + this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, video); + } + if (texture.generateMipMaps) { + this._gl.generateMipmap(this._gl.TEXTURE_2D); + } + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + this.resetTextureCache(); + texture.isReady = true; + } + catch (ex) { + // Something unexpected + // Let's disable the texture + texture._isDisabled = true; + } + }; + Engine.prototype.createRenderTargetTexture = function (size, options) { + // old version had a "generateMipMaps" arg instead of options. + // if options.generateMipMaps is undefined, consider that options itself if the generateMipmaps value + // in the same way, generateDepthBuffer is defaulted to true + var generateMipMaps = false; + var generateDepthBuffer = true; + var generateStencilBuffer = false; + var type = Engine.TEXTURETYPE_UNSIGNED_INT; + var samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; + if (options !== undefined) { + generateMipMaps = options.generateMipMaps === undefined ? options : options.generateMipMaps; + generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer; + generateStencilBuffer = generateDepthBuffer && options.generateStencilBuffer; + type = options.type === undefined ? type : options.type; + if (options.samplingMode !== undefined) { + samplingMode = options.samplingMode; + } + if (type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) { + // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE + samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE; + } + else if (type === Engine.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) { + // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE + samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE; + } + } + var gl = this._gl; + var texture = gl.createTexture(); + this._bindTextureDirectly(gl.TEXTURE_2D, texture); + var width = size.width || size; + var height = size.height || size; + var filters = getSamplingParameters(samplingMode, generateMipMaps, gl); + if (type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloat) { + type = Engine.TEXTURETYPE_UNSIGNED_INT; + BABYLON.Tools.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"); + } + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filters.mag); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, filters.min); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, getWebGLTextureType(gl, type), null); + var depthStencilBuffer; + // Create the depth/stencil buffer + if (generateStencilBuffer) { + depthStencilBuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height); + } + else if (generateDepthBuffer) { + depthStencilBuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, width, height); + } + // Create the framebuffer + var framebuffer = gl.createFramebuffer(); + this.bindUnboundFramebuffer(framebuffer); + // Manage attachments + if (generateStencilBuffer) { + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); + } + else if (generateDepthBuffer) { + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); + } + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + if (generateMipMaps) { + this._gl.generateMipmap(this._gl.TEXTURE_2D); + } + // Unbind + this._bindTextureDirectly(gl.TEXTURE_2D, null); + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + this.bindUnboundFramebuffer(null); + texture._framebuffer = framebuffer; + if (generateDepthBuffer) { + texture._depthBuffer = depthStencilBuffer; + } + texture._baseWidth = width; + texture._baseHeight = height; + texture._width = width; + texture._height = height; + texture.isReady = true; + texture.generateMipMaps = generateMipMaps; + texture.references = 1; + texture.samplingMode = samplingMode; + texture.type = type; + this.resetTextureCache(); + this._loadedTexturesCache.push(texture); + return texture; + }; + Engine.prototype.createRenderTargetCubeTexture = function (size, options) { + var gl = this._gl; + var texture = gl.createTexture(); + var generateMipMaps = true; + var generateDepthBuffer = true; + var generateStencilBuffer = false; + var samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; + if (options !== undefined) { + generateMipMaps = options.generateMipMaps === undefined ? options : options.generateMipMaps; + generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer; + generateStencilBuffer = generateDepthBuffer && options.generateStencilBuffer; + if (options.samplingMode !== undefined) { + samplingMode = options.samplingMode; + } + } + texture.isCube = true; + texture.references = 1; + texture.generateMipMaps = generateMipMaps; + texture.references = 1; + texture.samplingMode = samplingMode; + var filters = getSamplingParameters(samplingMode, generateMipMaps, gl); + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture); + for (var face = 0; face < 6; face++) { + gl.texImage2D((gl.TEXTURE_CUBE_MAP_POSITIVE_X + face), 0, gl.RGBA, size, size, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + } + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, filters.mag); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, filters.min); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + // Create the depth buffer + var depthStencilBuffer; + // Create the depth/stencil buffer + if (generateStencilBuffer) { + depthStencilBuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, size, size); + } + else if (generateDepthBuffer) { + depthStencilBuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, size, size); + } + // Create the framebuffer + var framebuffer = gl.createFramebuffer(); + this.bindUnboundFramebuffer(framebuffer); + // Manage attachments + if (generateStencilBuffer) { + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); + } + else if (generateDepthBuffer) { + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); + } + // Mipmaps + if (texture.generateMipMaps) { + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture); + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + } + // Unbind + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + this.bindUnboundFramebuffer(null); + texture._framebuffer = framebuffer; + if (generateDepthBuffer) { + texture._depthBuffer = depthStencilBuffer; + } + texture._width = size; + texture._height = size; + texture.isReady = true; + this.resetTextureCache(); + this._loadedTexturesCache.push(texture); + return texture; + }; + Engine.prototype.createCubeTexture = function (rootUrl, scene, files, noMipmap, onLoad, onError) { + var _this = this; + if (onLoad === void 0) { onLoad = null; } + if (onError === void 0) { onError = null; } + var gl = this._gl; + var texture = gl.createTexture(); + texture.isCube = true; + texture.url = rootUrl; + texture.references = 1; + texture.onLoadedCallbacks = []; + var extension = rootUrl.substr(rootUrl.length - 4, 4).toLowerCase(); + var isDDS = this.getCaps().s3tc && (extension === ".dds"); + if (isDDS) { + BABYLON.Tools.LoadFile(rootUrl, function (data) { + var info = BABYLON.Internals.DDSTools.GetDDSInfo(data); + var loadMipmap = (info.isRGB || info.isLuminance || info.mipmapCount > 1) && !noMipmap; + _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture); + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, 1); + BABYLON.Internals.DDSTools.UploadDDSLevels(_this._gl, _this.getCaps().s3tc, data, info, loadMipmap, 6); + if (!noMipmap && !info.isFourCC && info.mipmapCount === 1) { + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + } + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, loadMipmap ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + _this.resetTextureCache(); + texture._width = info.width; + texture._height = info.height; + texture.isReady = true; + }, null, null, true, onError); + } + else { + cascadeLoad(rootUrl, scene, function (imgs) { + var width = BABYLON.Tools.GetExponentOfTwo(imgs[0].width, _this._caps.maxCubemapTextureSize); + var height = width; + _this._prepareWorkingCanvas(); + _this._workingCanvas.width = width; + _this._workingCanvas.height = height; + var faces = [ + gl.TEXTURE_CUBE_MAP_POSITIVE_X, gl.TEXTURE_CUBE_MAP_POSITIVE_Y, gl.TEXTURE_CUBE_MAP_POSITIVE_Z, + gl.TEXTURE_CUBE_MAP_NEGATIVE_X, gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, gl.TEXTURE_CUBE_MAP_NEGATIVE_Z + ]; + _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture); + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, 0); + for (var index = 0; index < faces.length; index++) { + _this._workingContext.drawImage(imgs[index], 0, 0, imgs[index].width, imgs[index].height, 0, 0, width, height); + gl.texImage2D(faces[index], 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, _this._workingCanvas); + } + if (!noMipmap) { + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + } + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, noMipmap ? gl.LINEAR : gl.LINEAR_MIPMAP_LINEAR); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + _this.resetTextureCache(); + texture._width = width; + texture._height = height; + texture.isReady = true; + texture.onLoadedCallbacks.forEach(function (callback) { + callback(); + }); + if (onLoad) { + onLoad(); + } + }, files, onError); + } + this._loadedTexturesCache.push(texture); + return texture; + }; + Engine.prototype.updateTextureSize = function (texture, width, height) { + texture._width = width; + texture._height = height; + texture._size = width * height; + texture._baseWidth = width; + texture._baseHeight = height; + }; + Engine.prototype.createRawCubeTexture = function (url, scene, size, format, type, noMipmap, callback, mipmmapGenerator) { + var _this = this; + var gl = this._gl; + var texture = gl.createTexture(); + scene._addPendingData(texture); + texture.isCube = true; + texture.references = 1; + texture.url = url; + var internalFormat = this._getInternalFormat(format); + var textureType = gl.UNSIGNED_BYTE; + if (type === Engine.TEXTURETYPE_FLOAT) { + textureType = gl.FLOAT; + } + var width = size; + var height = width; + var isPot = (BABYLON.Tools.IsExponentOfTwo(width) && BABYLON.Tools.IsExponentOfTwo(height)); + texture._width = width; + texture._height = height; + var onerror = function () { + scene._removePendingData(texture); + }; + var internalCallback = function (data) { + var rgbeDataArrays = callback(data); + var facesIndex = [ + gl.TEXTURE_CUBE_MAP_POSITIVE_X, gl.TEXTURE_CUBE_MAP_POSITIVE_Y, gl.TEXTURE_CUBE_MAP_POSITIVE_Z, + gl.TEXTURE_CUBE_MAP_NEGATIVE_X, gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, gl.TEXTURE_CUBE_MAP_NEGATIVE_Z + ]; + width = texture._width; + height = texture._height; + isPot = (BABYLON.Tools.IsExponentOfTwo(width) && BABYLON.Tools.IsExponentOfTwo(height)); + _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture); + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, 0); + if (!noMipmap && isPot) { + if (mipmmapGenerator) { + var arrayTemp = []; + // Data are known to be in +X +Y +Z -X -Y -Z + // mipmmapGenerator data is expected to be order in +X -X +Y -Y +Z -Z + arrayTemp.push(rgbeDataArrays[0]); // +X + arrayTemp.push(rgbeDataArrays[3]); // -X + arrayTemp.push(rgbeDataArrays[1]); // +Y + arrayTemp.push(rgbeDataArrays[4]); // -Y + arrayTemp.push(rgbeDataArrays[2]); // +Z + arrayTemp.push(rgbeDataArrays[5]); // -Z + var mipData = mipmmapGenerator(arrayTemp); + for (var level = 0; level < mipData.length; level++) { + var mipSize = width >> level; + // mipData is order in +X -X +Y -Y +Z -Z + gl.texImage2D(facesIndex[0], level, internalFormat, mipSize, mipSize, 0, internalFormat, textureType, mipData[level][0]); + gl.texImage2D(facesIndex[1], level, internalFormat, mipSize, mipSize, 0, internalFormat, textureType, mipData[level][2]); + gl.texImage2D(facesIndex[2], level, internalFormat, mipSize, mipSize, 0, internalFormat, textureType, mipData[level][4]); + gl.texImage2D(facesIndex[3], level, internalFormat, mipSize, mipSize, 0, internalFormat, textureType, mipData[level][1]); + gl.texImage2D(facesIndex[4], level, internalFormat, mipSize, mipSize, 0, internalFormat, textureType, mipData[level][3]); + gl.texImage2D(facesIndex[5], level, internalFormat, mipSize, mipSize, 0, internalFormat, textureType, mipData[level][5]); + } + } + else { + // Data are known to be in +X +Y +Z -X -Y -Z + for (var index = 0; index < facesIndex.length; index++) { + var faceData = rgbeDataArrays[index]; + gl.texImage2D(facesIndex[index], 0, internalFormat, width, height, 0, internalFormat, textureType, faceData); + } + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + // Workaround firefox bug fix https://bugzilla.mozilla.org/show_bug.cgi?id=1221822 + // By following the webgl standard changes from Revision 7, 2014/11/24 + // Firefox Removed the support for RGB32F, since it is not natively supported on all platforms where WebGL is implemented. + if (textureType === gl.FLOAT && internalFormat === gl.RGB && gl.getError() === 1282) { + BABYLON.Tools.Log("RGB32F not renderable on Firefox, trying fallback to RGBA32F."); + // Data are known to be in +X +Y +Z -X -Y -Z + for (var index = 0; index < facesIndex.length; index++) { + var faceData = rgbeDataArrays[index]; + // Create a new RGBA Face. + var newFaceData = new Float32Array(width * height * 4); + for (var x = 0; x < width; x++) { + for (var y = 0; y < height; y++) { + var index_1 = (y * width + x) * 3; + var newIndex = (y * width + x) * 4; + // Map Old Value to new value. + newFaceData[newIndex + 0] = faceData[index_1 + 0]; + newFaceData[newIndex + 1] = faceData[index_1 + 1]; + newFaceData[newIndex + 2] = faceData[index_1 + 2]; + // Add fully opaque alpha channel. + newFaceData[newIndex + 3] = 1; + } + } + // Reupload the face. + gl.texImage2D(facesIndex[index], 0, gl.RGBA, width, height, 0, gl.RGBA, textureType, newFaceData); + } + // Try to generate mipmap again. + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + } + } + } + else { + noMipmap = true; + } + if (textureType === gl.FLOAT && !_this._caps.textureFloatLinearFiltering) { + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + } + else if (textureType === HALF_FLOAT_OES && !_this._caps.textureHalfFloatLinearFiltering) { + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + } + else { + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, noMipmap ? gl.LINEAR : gl.LINEAR_MIPMAP_LINEAR); + } + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + texture.isReady = true; + _this.resetTextureCache(); + scene._removePendingData(texture); + }; + BABYLON.Tools.LoadFile(url, function (data) { + internalCallback(data); + }, onerror, scene.database, true); + return texture; + }; + ; + Engine.prototype._releaseTexture = function (texture) { + var gl = this._gl; + if (texture._framebuffer) { + gl.deleteFramebuffer(texture._framebuffer); + } + if (texture._depthBuffer) { + gl.deleteRenderbuffer(texture._depthBuffer); + } + gl.deleteTexture(texture); + // Unbind channels + this.unbindAllTextures(); + var index = this._loadedTexturesCache.indexOf(texture); + if (index !== -1) { + this._loadedTexturesCache.splice(index, 1); + } + }; + Engine.prototype.setProgram = function (program) { + if (this._currentProgram !== program) { + this._gl.useProgram(program); + this._currentProgram = program; + } + }; + Engine.prototype.bindSamplers = function (effect) { + this.setProgram(effect.getProgram()); + var samplers = effect.getSamplers(); + for (var index = 0; index < samplers.length; index++) { + var uniform = effect.getUniform(samplers[index]); + this._gl.uniform1i(uniform, index); + } + this._currentEffect = null; + }; + Engine.prototype.activateTexture = function (texture) { + if (this._activeTexture !== texture) { + this._gl.activeTexture(texture); + this._activeTexture = texture; + } + }; + Engine.prototype._bindTextureDirectly = function (target, texture) { + if (this._activeTexturesCache[this._activeTexture] !== texture) { + this._gl.bindTexture(target, texture); + this._activeTexturesCache[this._activeTexture] = texture; + } + }; + Engine.prototype._bindTexture = function (channel, texture) { + if (channel < 0) { + return; + } + this.activateTexture(this._gl["TEXTURE" + channel]); + this._bindTextureDirectly(this._gl.TEXTURE_2D, texture); + }; + Engine.prototype.setTextureFromPostProcess = function (channel, postProcess) { + this._bindTexture(channel, postProcess._textures.data[postProcess._currentRenderTextureInd]); + }; + Engine.prototype.unbindAllTextures = function () { + for (var channel = 0; channel < this._caps.maxTexturesImageUnits; channel++) { + this.activateTexture(this._gl["TEXTURE" + channel]); + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null); + } + }; + Engine.prototype.setTexture = function (channel, uniform, texture) { + if (channel < 0) { + return; + } + this._gl.uniform1i(uniform, channel); + this._setTexture(channel, texture); + }; + Engine.prototype._setTexture = function (channel, texture) { + // Not ready? + if (!texture || !texture.isReady()) { + if (this._activeTexturesCache[channel] != null) { + this.activateTexture(this._gl["TEXTURE" + channel]); + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null); + } + return; + } + // Video + var alreadyActivated = false; + if (texture instanceof BABYLON.VideoTexture) { + this.activateTexture(this._gl["TEXTURE" + channel]); + alreadyActivated = true; + texture.update(); + } + else if (texture.delayLoadState === Engine.DELAYLOADSTATE_NOTLOADED) { + texture.delayLoad(); + return; + } + var internalTexture = texture.getInternalTexture(); + if (this._activeTexturesCache[channel] === internalTexture) { + return; + } + if (!alreadyActivated) { + this.activateTexture(this._gl["TEXTURE" + channel]); + } + if (internalTexture.isCube) { + this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, internalTexture); + if (internalTexture._cachedCoordinatesMode !== texture.coordinatesMode) { + internalTexture._cachedCoordinatesMode = texture.coordinatesMode; + // CUBIC_MODE and SKYBOX_MODE both require CLAMP_TO_EDGE. All other modes use REPEAT. + var textureWrapMode = (texture.coordinatesMode !== BABYLON.Texture.CUBIC_MODE && texture.coordinatesMode !== BABYLON.Texture.SKYBOX_MODE) ? this._gl.REPEAT : this._gl.CLAMP_TO_EDGE; + this._gl.texParameteri(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_WRAP_S, textureWrapMode); + this._gl.texParameteri(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_WRAP_T, textureWrapMode); + } + this._setAnisotropicLevel(this._gl.TEXTURE_CUBE_MAP, texture); + } + else { + this._bindTextureDirectly(this._gl.TEXTURE_2D, internalTexture); + if (internalTexture._cachedWrapU !== texture.wrapU) { + internalTexture._cachedWrapU = texture.wrapU; + switch (texture.wrapU) { + case BABYLON.Texture.WRAP_ADDRESSMODE: + this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.REPEAT); + break; + case BABYLON.Texture.CLAMP_ADDRESSMODE: + this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE); + break; + case BABYLON.Texture.MIRROR_ADDRESSMODE: + this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.MIRRORED_REPEAT); + break; + } + } + if (internalTexture._cachedWrapV !== texture.wrapV) { + internalTexture._cachedWrapV = texture.wrapV; + switch (texture.wrapV) { + case BABYLON.Texture.WRAP_ADDRESSMODE: + this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.REPEAT); + break; + case BABYLON.Texture.CLAMP_ADDRESSMODE: + this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE); + break; + case BABYLON.Texture.MIRROR_ADDRESSMODE: + this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.MIRRORED_REPEAT); + break; + } + } + this._setAnisotropicLevel(this._gl.TEXTURE_2D, texture); + } + }; + Engine.prototype.setTextureArray = function (channel, uniform, textures) { + if (channel < 0) { + return; + } + if (!this._textureUnits || this._textureUnits.length !== textures.length) { + this._textureUnits = new Int32Array(textures.length); + } + for (var i = 0; i < textures.length; i++) { + this._textureUnits[i] = channel + i; + } + this._gl.uniform1iv(uniform, this._textureUnits); + for (var index = 0; index < textures.length; index++) { + this._setTexture(channel + index, textures[index]); + } + }; + Engine.prototype._setAnisotropicLevel = function (key, texture) { + var anisotropicFilterExtension = this._caps.textureAnisotropicFilterExtension; + var value = texture.anisotropicFilteringLevel; + if (texture.getInternalTexture().samplingMode === BABYLON.Texture.NEAREST_SAMPLINGMODE) { + value = 1; + } + if (anisotropicFilterExtension && texture._cachedAnisotropicFilteringLevel !== value) { + this._gl.texParameterf(key, anisotropicFilterExtension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(value, this._caps.maxAnisotropy)); + texture._cachedAnisotropicFilteringLevel = value; + } + }; + Engine.prototype.readPixels = function (x, y, width, height) { + var data = new Uint8Array(height * width * 4); + this._gl.readPixels(x, y, width, height, this._gl.RGBA, this._gl.UNSIGNED_BYTE, data); + return data; + }; + /** + * Add an externaly attached data from its key. + * This method call will fail and return false, if such key already exists. + * If you don't care and just want to get the data no matter what, use the more convenient getOrAddExternalDataWithFactory() method. + * @param key the unique key that identifies the data + * @param data the data object to associate to the key for this Engine instance + * @return true if no such key were already present and the data was added successfully, false otherwise + */ + Engine.prototype.addExternalData = function (key, data) { + return this._externalData.add(key, data); + }; + /** + * Get an externaly attached data from its key + * @param key the unique key that identifies the data + * @return the associated data, if present (can be null), or undefined if not present + */ + Engine.prototype.getExternalData = function (key) { + return this._externalData.get(key); + }; + /** + * Get an externaly attached data from its key, create it using a factory if it's not already present + * @param key the unique key that identifies the data + * @param factory the factory that will be called to create the instance if and only if it doesn't exists + * @return the associated data, can be null if the factory returned null. + */ + Engine.prototype.getOrAddExternalDataWithFactory = function (key, factory) { + return this._externalData.getOrAddWithFactory(key, factory); + }; + /** + * Remove an externaly attached data from the Engine instance + * @param key the unique key that identifies the data + * @return true if the data was successfully removed, false if it doesn't exist + */ + Engine.prototype.removeExternalData = function (key) { + return this._externalData.remove(key); + }; + Engine.prototype.releaseInternalTexture = function (texture) { + if (!texture) { + return; + } + texture.references--; + // Final reference ? + if (texture.references === 0) { + var texturesCache = this.getLoadedTexturesCache(); + var index = texturesCache.indexOf(texture); + if (index > -1) { + texturesCache.splice(index, 1); + } + this._releaseTexture(texture); + } + }; + Engine.prototype.unbindAllAttributes = function () { + for (var i = 0, ul = this._vertexAttribArraysEnabled.length; i < ul; i++) { + if (i >= this._caps.maxVertexAttribs || !this._vertexAttribArraysEnabled[i]) { + continue; + } + this._gl.disableVertexAttribArray(i); + this._vertexAttribArraysEnabled[i] = false; + } + }; + // Dispose + Engine.prototype.dispose = function () { + this.hideLoadingUI(); + this.stopRenderLoop(); + // Release scenes + while (this.scenes.length) { + this.scenes[0].dispose(); + } + // Release audio engine + Engine.audioEngine.dispose(); + // Release effects + for (var name in this._compiledEffects) { + this._gl.deleteProgram(this._compiledEffects[name]._program); + } + // Unbind + this.unbindAllAttributes(); + this._gl = null; + //WebVR + this.disableVR(); + // Events + window.removeEventListener("blur", this._onBlur); + window.removeEventListener("focus", this._onFocus); + document.removeEventListener("fullscreenchange", this._onFullscreenChange); + document.removeEventListener("mozfullscreenchange", this._onFullscreenChange); + document.removeEventListener("webkitfullscreenchange", this._onFullscreenChange); + document.removeEventListener("msfullscreenchange", this._onFullscreenChange); + document.removeEventListener("pointerlockchange", this._onPointerLockChange); + document.removeEventListener("mspointerlockchange", this._onPointerLockChange); + document.removeEventListener("mozpointerlockchange", this._onPointerLockChange); + document.removeEventListener("webkitpointerlockchange", this._onPointerLockChange); + }; + // Loading screen + Engine.prototype.displayLoadingUI = function () { + this._loadingScreen.displayLoadingUI(); + }; + Engine.prototype.hideLoadingUI = function () { + this._loadingScreen.hideLoadingUI(); + }; + Object.defineProperty(Engine.prototype, "loadingScreen", { + get: function () { + return this._loadingScreen; + }, + set: function (loadingScreen) { + this._loadingScreen = loadingScreen; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "loadingUIText", { + set: function (text) { + this._loadingScreen.loadingUIText = text; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "loadingUIBackgroundColor", { + set: function (color) { + this._loadingScreen.loadingUIBackgroundColor = color; + }, + enumerable: true, + configurable: true + }); + Engine.prototype.attachContextLostEvent = function (callback) { + this._renderingCanvas.addEventListener("webglcontextlost", callback, false); + }; + Engine.prototype.attachContextRestoredEvent = function (callback) { + this._renderingCanvas.addEventListener("webglcontextrestored", callback, false); + }; + Engine.prototype.getVertexShaderSource = function (program) { + var shaders = this._gl.getAttachedShaders(program); + return this._gl.getShaderSource(shaders[0]); + }; + Engine.prototype.getFragmentShaderSource = function (program) { + var shaders = this._gl.getAttachedShaders(program); + return this._gl.getShaderSource(shaders[1]); + }; + // FPS + Engine.prototype.getFps = function () { + return this.fps; + }; + Engine.prototype.getDeltaTime = function () { + return this.deltaTime; + }; + Engine.prototype._measureFps = function () { + this.previousFramesDuration.push(BABYLON.Tools.Now); + var length = this.previousFramesDuration.length; + if (length >= 2) { + this.deltaTime = this.previousFramesDuration[length - 1] - this.previousFramesDuration[length - 2]; + } + if (length >= this.fpsRange) { + if (length > this.fpsRange) { + this.previousFramesDuration.splice(0, 1); + length = this.previousFramesDuration.length; + } + var sum = 0; + for (var id = 0; id < length - 1; id++) { + sum += this.previousFramesDuration[id + 1] - this.previousFramesDuration[id]; + } + this.fps = 1000.0 / (sum / (length - 1)); + } + }; + Engine.prototype._canRenderToFloatTexture = function () { + return this._canRenderToTextureOfType(BABYLON.Engine.TEXTURETYPE_FLOAT, 'OES_texture_float'); + }; + Engine.prototype._canRenderToHalfFloatTexture = function () { + return this._canRenderToTextureOfType(BABYLON.Engine.TEXTURETYPE_HALF_FLOAT, 'OES_texture_half_float'); + }; + // Thank you : http://stackoverflow.com/questions/28827511/webgl-ios-render-to-floating-point-texture + Engine.prototype._canRenderToTextureOfType = function (format, extension) { + var tempcanvas = document.createElement("canvas"); + tempcanvas.height = 16; + tempcanvas.width = 16; + var gl = (tempcanvas.getContext("webgl") || tempcanvas.getContext("experimental-webgl")); + // extension. + var ext = gl.getExtension(extension); + if (!ext) { + return false; + } + // setup GLSL program + var vertexCode = "attribute vec4 a_position;\n void main() {\n gl_Position = a_position;\n }"; + var fragmentCode = "precision mediump float;\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n\n void main() {\n gl_FragColor = texture2D(u_texture, vec2(0.5, 0.5)) * u_color;\n }"; + var program = this.createShaderProgram(vertexCode, fragmentCode, null, gl); + gl.useProgram(program); + // look up where the vertex data needs to go. + var positionLocation = gl.getAttribLocation(program, "a_position"); + var colorLoc = gl.getUniformLocation(program, "u_color"); + // provide texture coordinates for the rectangle. + var positionBuffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ + -1.0, -1.0, + 1.0, -1.0, + -1.0, 1.0, + -1.0, 1.0, + 1.0, -1.0, + 1.0, 1.0]), gl.STATIC_DRAW); + gl.enableVertexAttribArray(positionLocation); + gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0); + var whiteTex = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, whiteTex); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([255, 255, 255, 255])); + var tex = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, tex); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, getWebGLTextureType(gl, format), null); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + var fb = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fb); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0); + var cleanup = function () { + gl.deleteProgram(program); + gl.disableVertexAttribArray(positionLocation); + gl.deleteBuffer(positionBuffer); + gl.deleteFramebuffer(fb); + gl.deleteTexture(whiteTex); + gl.deleteTexture(tex); + }; + var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER); + if (status !== gl.FRAMEBUFFER_COMPLETE) { + BABYLON.Tools.Log("GL Support: can **NOT** render to " + format + " texture"); + cleanup(); + return false; + } + // Draw the rectangle. + gl.bindTexture(gl.TEXTURE_2D, whiteTex); + gl.uniform4fv(colorLoc, [0, 10, 20, 1]); + gl.drawArrays(gl.TRIANGLES, 0, 6); + gl.bindTexture(gl.TEXTURE_2D, tex); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.clearColor(1, 0, 0, 1); + gl.clear(gl.COLOR_BUFFER_BIT); + gl.uniform4fv(colorLoc, [0, 1 / 10, 1 / 20, 1]); + gl.drawArrays(gl.TRIANGLES, 0, 6); + var pixel = new Uint8Array(4); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); + if (pixel[0] !== 0 || + pixel[1] < 248 || + pixel[2] < 248 || + pixel[3] < 254) { + BABYLON.Tools.Log("GL Support: Was not able to actually render to " + format + " texture"); + cleanup(); + return false; + } + // Succesfully rendered to "format" texture. + cleanup(); + return true; + }; + // Statics + Engine.isSupported = function () { + try { + // Avoid creating an unsized context for CocoonJS, since size determined on first creation. Is not resizable + if (navigator.isCocoonJS) { + return true; + } + var tempcanvas = document.createElement("canvas"); + var gl = tempcanvas.getContext("webgl") || tempcanvas.getContext("experimental-webgl"); + return gl != null && !!window.WebGLRenderingContext; + } + catch (e) { + return false; + } + }; + // Const statics + Engine._ALPHA_DISABLE = 0; + Engine._ALPHA_ADD = 1; + Engine._ALPHA_COMBINE = 2; + Engine._ALPHA_SUBTRACT = 3; + Engine._ALPHA_MULTIPLY = 4; + Engine._ALPHA_MAXIMIZED = 5; + Engine._ALPHA_ONEONE = 6; + Engine._DELAYLOADSTATE_NONE = 0; + Engine._DELAYLOADSTATE_LOADED = 1; + Engine._DELAYLOADSTATE_LOADING = 2; + Engine._DELAYLOADSTATE_NOTLOADED = 4; + Engine._TEXTUREFORMAT_ALPHA = 0; + Engine._TEXTUREFORMAT_LUMINANCE = 1; + Engine._TEXTUREFORMAT_LUMINANCE_ALPHA = 2; + Engine._TEXTUREFORMAT_RGB = 4; + Engine._TEXTUREFORMAT_RGBA = 5; + Engine._TEXTURETYPE_UNSIGNED_INT = 0; + Engine._TEXTURETYPE_FLOAT = 1; + Engine._TEXTURETYPE_HALF_FLOAT = 2; + // Depht or Stencil test Constants. + Engine._NEVER = 0x0200; // Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn. + Engine._ALWAYS = 0x0207; // Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn. + Engine._LESS = 0x0201; // Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value. + Engine._EQUAL = 0x0202; // Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value. + Engine._LEQUAL = 0x0203; // Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value. + Engine._GREATER = 0x0204; // Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value. + Engine._GEQUAL = 0x0206; // Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value. + Engine._NOTEQUAL = 0x0205; // Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value. + // Stencil Actions Constants. + Engine._KEEP = 0x1E00; + Engine._REPLACE = 0x1E01; + Engine._INCR = 0x1E02; + Engine._DECR = 0x1E03; + Engine._INVERT = 0x150A; + Engine._INCR_WRAP = 0x8507; + Engine._DECR_WRAP = 0x8508; + // Updatable statics so stick with vars here + Engine.CollisionsEpsilon = 0.001; + Engine.CodeRepository = "src/"; + Engine.ShadersRepository = "src/Shaders/"; + return Engine; + }()); + BABYLON.Engine = Engine; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.engine.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Node is the basic class for all scene objects (Mesh, Light Camera). + */ + var Node = (function () { + /** + * @constructor + * @param {string} name - the name and id to be given to this node + * @param {BABYLON.Scene} the scene this node will be added to + */ + function Node(name, scene) { + this.state = ""; + this.metadata = null; + this.doNotSerialize = false; + this.animations = new Array(); + this._ranges = {}; + this._childrenFlag = -1; + this._isEnabled = true; + this._isReady = true; + this._currentRenderId = -1; + this._parentRenderId = -1; + /** + * An event triggered when the mesh is disposed. + * @type {BABYLON.Observable} + */ + this.onDisposeObservable = new BABYLON.Observable(); + this.name = name; + this.id = name; + this._scene = scene; + this._initCache(); + } + Object.defineProperty(Node.prototype, "parent", { + get: function () { + return this._parentNode; + }, + set: function (parent) { + if (this._parentNode === parent) { + return; + } + if (this._parentNode) { + var index = this._parentNode._children.indexOf(this); + if (index !== -1) { + this._parentNode._children.splice(index, 1); + } + } + this._parentNode = parent; + if (this._parentNode) { + if (!this._parentNode._children) { + this._parentNode._children = new Array(); + } + this._parentNode._children.push(this); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Node.prototype, "onDispose", { + set: function (callback) { + if (this._onDisposeObserver) { + this.onDisposeObservable.remove(this._onDisposeObserver); + } + this._onDisposeObserver = this.onDisposeObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Node.prototype.getScene = function () { + return this._scene; + }; + Node.prototype.getEngine = function () { + return this._scene.getEngine(); + }; + // override it in derived class + Node.prototype.getWorldMatrix = function () { + return BABYLON.Matrix.Identity(); + }; + // override it in derived class if you add new variables to the cache + // and call the parent class method + Node.prototype._initCache = function () { + this._cache = {}; + this._cache.parent = undefined; + }; + Node.prototype.updateCache = function (force) { + if (!force && this.isSynchronized()) + return; + this._cache.parent = this.parent; + this._updateCache(); + }; + // override it in derived class if you add new variables to the cache + // and call the parent class method if !ignoreParentClass + Node.prototype._updateCache = function (ignoreParentClass) { + }; + // override it in derived class if you add new variables to the cache + Node.prototype._isSynchronized = function () { + return true; + }; + Node.prototype._markSyncedWithParent = function () { + this._parentRenderId = this.parent._currentRenderId; + }; + Node.prototype.isSynchronizedWithParent = function () { + if (!this.parent) { + return true; + } + if (this._parentRenderId !== this.parent._currentRenderId) { + return false; + } + return this.parent.isSynchronized(); + }; + Node.prototype.isSynchronized = function (updateCache) { + var check = this.hasNewParent(); + check = check || !this.isSynchronizedWithParent(); + check = check || !this._isSynchronized(); + if (updateCache) + this.updateCache(true); + return !check; + }; + Node.prototype.hasNewParent = function (update) { + if (this._cache.parent === this.parent) + return false; + if (update) + this._cache.parent = this.parent; + return true; + }; + /** + * Is this node ready to be used/rendered + * @return {boolean} is it ready + */ + Node.prototype.isReady = function () { + return this._isReady; + }; + /** + * Is this node enabled. + * If the node has a parent and is enabled, the parent will be inspected as well. + * @return {boolean} whether this node (and its parent) is enabled. + * @see setEnabled + */ + Node.prototype.isEnabled = function () { + if (!this._isEnabled) { + return false; + } + if (this.parent) { + return this.parent.isEnabled(); + } + return true; + }; + /** + * Set the enabled state of this node. + * @param {boolean} value - the new enabled state + * @see isEnabled + */ + Node.prototype.setEnabled = function (value) { + this._isEnabled = value; + }; + /** + * Is this node a descendant of the given node. + * The function will iterate up the hierarchy until the ancestor was found or no more parents defined. + * @param {BABYLON.Node} ancestor - The parent node to inspect + * @see parent + */ + Node.prototype.isDescendantOf = function (ancestor) { + if (this.parent) { + if (this.parent === ancestor) { + return true; + } + return this.parent.isDescendantOf(ancestor); + } + return false; + }; + /** + * Evaluate the list of children and determine if they should be considered as descendants considering the given criterias + * @param {BABYLON.Node[]} results the result array containing the nodes matching the given criterias + * @param {boolean} directDescendantsOnly if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered. + * @param predicate: an optional predicate that will be called on every evaluated children, the predicate must return true for a given child to be part of the result, otherwise it will be ignored. + */ + Node.prototype._getDescendants = function (results, directDescendantsOnly, predicate) { + if (directDescendantsOnly === void 0) { directDescendantsOnly = false; } + if (!this._children) { + return; + } + for (var index = 0; index < this._children.length; index++) { + var item = this._children[index]; + if (!predicate || predicate(item)) { + results.push(item); + } + if (!directDescendantsOnly) { + item._getDescendants(results, false, predicate); + } + } + }; + /** + * Will return all nodes that have this node as ascendant. + * @param {boolean} directDescendantsOnly if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered. + * @param predicate: an optional predicate that will be called on every evaluated children, the predicate must return true for a given child to be part of the result, otherwise it will be ignored. + * @return {BABYLON.Node[]} all children nodes of all types. + */ + Node.prototype.getDescendants = function (directDescendantsOnly, predicate) { + var results = []; + this._getDescendants(results, directDescendantsOnly, predicate); + return results; + }; + /** + * @param predicate: an optional predicate that will be called on every evaluated children, the predicate must return true for a given child to be part of the result, otherwise it will be ignored. + * @Deprecated, legacy support. + * use getDecendants instead. + */ + Node.prototype.getChildren = function (predicate) { + return this.getDescendants(true, predicate); + }; + /** + * Get all child-meshes of this node. + */ + Node.prototype.getChildMeshes = function (directDecendantsOnly, predicate) { + var results = []; + this._getDescendants(results, directDecendantsOnly, function (node) { + return ((!predicate || predicate(node)) && (node instanceof BABYLON.AbstractMesh)); + }); + return results; + }; + Node.prototype._setReady = function (state) { + if (state === this._isReady) { + return; + } + if (!state) { + this._isReady = false; + return; + } + this._isReady = true; + if (this.onReady) { + this.onReady(this); + } + }; + Node.prototype.getAnimationByName = function (name) { + for (var i = 0; i < this.animations.length; i++) { + var animation = this.animations[i]; + if (animation.name === name) { + return animation; + } + } + return null; + }; + Node.prototype.createAnimationRange = function (name, from, to) { + // check name not already in use + if (!this._ranges[name]) { + this._ranges[name] = new BABYLON.AnimationRange(name, from, to); + for (var i = 0, nAnimations = this.animations.length; i < nAnimations; i++) { + if (this.animations[i]) { + this.animations[i].createRange(name, from, to); + } + } + } + }; + Node.prototype.deleteAnimationRange = function (name, deleteFrames) { + if (deleteFrames === void 0) { deleteFrames = true; } + for (var i = 0, nAnimations = this.animations.length; i < nAnimations; i++) { + if (this.animations[i]) { + this.animations[i].deleteRange(name, deleteFrames); + } + } + this._ranges[name] = undefined; // said much faster than 'delete this._range[name]' + }; + Node.prototype.getAnimationRange = function (name) { + return this._ranges[name]; + }; + Node.prototype.beginAnimation = function (name, loop, speedRatio, onAnimationEnd) { + var range = this.getAnimationRange(name); + if (!range) { + return null; + } + this._scene.beginAnimation(this, range.from, range.to, loop, speedRatio, onAnimationEnd); + }; + Node.prototype.serializeAnimationRanges = function () { + var serializationRanges = []; + for (var name in this._ranges) { + var range = {}; + range.name = name; + range.from = this._ranges[name].from; + range.to = this._ranges[name].to; + serializationRanges.push(range); + } + return serializationRanges; + }; + Node.prototype.dispose = function () { + this.parent = null; + // Callback + this.onDisposeObservable.notifyObservers(this); + this.onDisposeObservable.clear(); + }; + Node.ParseAnimationRanges = function (node, parsedNode, scene) { + if (parsedNode.ranges) { + for (var index = 0; index < parsedNode.ranges.length; index++) { + var data = parsedNode.ranges[index]; + node.createAnimationRange(data.name, data.from, data.to); + } + } + }; + __decorate([ + BABYLON.serialize() + ], Node.prototype, "name", void 0); + __decorate([ + BABYLON.serialize() + ], Node.prototype, "id", void 0); + __decorate([ + BABYLON.serialize() + ], Node.prototype, "uniqueId", void 0); + __decorate([ + BABYLON.serialize() + ], Node.prototype, "state", void 0); + __decorate([ + BABYLON.serialize() + ], Node.prototype, "metadata", void 0); + return Node; + }()); + BABYLON.Node = Node; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.node.js.map + +var BABYLON; +(function (BABYLON) { + var FilesInput = (function () { + /// Register to core BabylonJS object: engine, scene, rendering canvas, callback function when the scene will be loaded, + /// loading progress callback and optionnal addionnal logic to call in the rendering loop + function FilesInput(p_engine, p_scene, p_canvas, p_sceneLoadedCallback, p_progressCallback, p_additionnalRenderLoopLogicCallback, p_textureLoadingCallback, p_startingProcessingFilesCallback) { + this._engine = p_engine; + this._canvas = p_canvas; + this._currentScene = p_scene; + this._sceneLoadedCallback = p_sceneLoadedCallback; + this._progressCallback = p_progressCallback; + this._additionnalRenderLoopLogicCallback = p_additionnalRenderLoopLogicCallback; + this._textureLoadingCallback = p_textureLoadingCallback; + this._startingProcessingFilesCallback = p_startingProcessingFilesCallback; + } + FilesInput.prototype.monitorElementForDragNDrop = function (p_elementToMonitor) { + var _this = this; + if (p_elementToMonitor) { + this._elementToMonitor = p_elementToMonitor; + this._elementToMonitor.addEventListener("dragenter", function (e) { _this.drag(e); }, false); + this._elementToMonitor.addEventListener("dragover", function (e) { _this.drag(e); }, false); + this._elementToMonitor.addEventListener("drop", function (e) { _this.drop(e); }, false); + } + }; + FilesInput.prototype.renderFunction = function () { + if (this._additionnalRenderLoopLogicCallback) { + this._additionnalRenderLoopLogicCallback(); + } + if (this._currentScene) { + if (this._textureLoadingCallback) { + var remaining = this._currentScene.getWaitingItemsCount(); + if (remaining > 0) { + this._textureLoadingCallback(remaining); + } + } + this._currentScene.render(); + } + }; + FilesInput.prototype.drag = function (e) { + e.stopPropagation(); + e.preventDefault(); + }; + FilesInput.prototype.drop = function (eventDrop) { + eventDrop.stopPropagation(); + eventDrop.preventDefault(); + this.loadFiles(eventDrop); + }; + FilesInput.prototype.loadFiles = function (event) { + if (this._startingProcessingFilesCallback) + this._startingProcessingFilesCallback(); + // Handling data transfer via drag'n'drop + if (event && event.dataTransfer && event.dataTransfer.files) { + this._filesToLoad = event.dataTransfer.files; + } + // Handling files from input files + if (event && event.target && event.target.files) { + this._filesToLoad = event.target.files; + } + if (this._filesToLoad && this._filesToLoad.length > 0) { + for (var i = 0; i < this._filesToLoad.length; i++) { + switch (this._filesToLoad[i].type) { + case "image/jpeg": + case "image/png": + case "image/bmp": + FilesInput.FilesTextures[this._filesToLoad[i].name.toLowerCase()] = this._filesToLoad[i]; + break; + case "image/targa": + case "image/vnd.ms-dds": + case "audio/wav": + case "audio/x-wav": + case "audio/mp3": + case "audio/mpeg": + case "audio/mpeg3": + case "audio/x-mpeg-3": + case "audio/ogg": + FilesInput.FilesToLoad[this._filesToLoad[i].name.toLowerCase()] = this._filesToLoad[i]; + break; + default: + if (this._filesToLoad[i].name.indexOf(".mtl") !== -1) { + FilesInput.FilesToLoad[this._filesToLoad[i].name.toLowerCase()] = this._filesToLoad[i]; + } + else if ((this._filesToLoad[i].name.indexOf(".babylon") !== -1 || + this._filesToLoad[i].name.indexOf(".stl") !== -1 || + this._filesToLoad[i].name.indexOf(".obj") !== -1) + && this._filesToLoad[i].name.indexOf(".manifest") === -1 + && this._filesToLoad[i].name.indexOf(".incremental") === -1 && this._filesToLoad[i].name.indexOf(".babylonmeshdata") === -1 + && this._filesToLoad[i].name.indexOf(".babylongeometrydata") === -1 && this._filesToLoad[i].name.indexOf(".babylonbinarymeshdata") === -1 && + this._filesToLoad[i].name.indexOf(".binary.babylon") === -1) { + this._sceneFileToLoad = this._filesToLoad[i]; + } + break; + } + } + this.reload(); + } + }; + FilesInput.prototype.reload = function () { + var _this = this; + var that = this; + // If a ".babylon" file has been provided + if (this._sceneFileToLoad) { + if (this._currentScene) { + if (BABYLON.Tools.errorsCount > 0) { + BABYLON.Tools.ClearLogCache(); + BABYLON.Tools.Log("Babylon.js engine (v" + BABYLON.Engine.Version + ") launched"); + } + this._engine.stopRenderLoop(); + this._currentScene.dispose(); + } + BABYLON.SceneLoader.Load("file:", this._sceneFileToLoad, this._engine, function (newScene) { + that._currentScene = newScene; + // Wait for textures and shaders to be ready + that._currentScene.executeWhenReady(function () { + // Attach camera to canvas inputs + if (!that._currentScene.activeCamera || that._currentScene.lights.length === 0) { + that._currentScene.createDefaultCameraOrLight(); + } + that._currentScene.activeCamera.attachControl(that._canvas); + if (that._sceneLoadedCallback) { + that._sceneLoadedCallback(_this._sceneFileToLoad, that._currentScene); + } + that._engine.runRenderLoop(function () { that.renderFunction(); }); + }); + }, function (progress) { + if (_this._progressCallback) { + _this._progressCallback(progress); + } + }); + } + else { + BABYLON.Tools.Error("Please provide a valid .babylon file."); + } + }; + FilesInput.FilesTextures = new Array(); + FilesInput.FilesToLoad = new Array(); + return FilesInput; + }()); + BABYLON.FilesInput = FilesInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.filesInput.js.map + +var BABYLON; +(function (BABYLON) { + var IntersectionInfo = (function () { + function IntersectionInfo(bu, bv, distance) { + this.bu = bu; + this.bv = bv; + this.distance = distance; + this.faceId = 0; + this.subMeshId = 0; + } + return IntersectionInfo; + }()); + BABYLON.IntersectionInfo = IntersectionInfo; + var PickingInfo = (function () { + function PickingInfo() { + this.hit = false; + this.distance = 0; + this.pickedPoint = null; + this.pickedMesh = null; + this.bu = 0; + this.bv = 0; + this.faceId = -1; + this.subMeshId = 0; + this.pickedSprite = null; + } + // Methods + PickingInfo.prototype.getNormal = function (useWorldCoordinates, useVerticesNormals) { + if (useWorldCoordinates === void 0) { useWorldCoordinates = false; } + if (useVerticesNormals === void 0) { useVerticesNormals = true; } + if (!this.pickedMesh || !this.pickedMesh.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) { + return null; + } + var indices = this.pickedMesh.getIndices(); + var result; + if (useVerticesNormals) { + var normals = this.pickedMesh.getVerticesData(BABYLON.VertexBuffer.NormalKind); + var normal0 = BABYLON.Vector3.FromArray(normals, indices[this.faceId * 3] * 3); + var normal1 = BABYLON.Vector3.FromArray(normals, indices[this.faceId * 3 + 1] * 3); + var normal2 = BABYLON.Vector3.FromArray(normals, indices[this.faceId * 3 + 2] * 3); + normal0 = normal0.scale(this.bu); + normal1 = normal1.scale(this.bv); + normal2 = normal2.scale(1.0 - this.bu - this.bv); + result = new BABYLON.Vector3(normal0.x + normal1.x + normal2.x, normal0.y + normal1.y + normal2.y, normal0.z + normal1.z + normal2.z); + } + else { + var positions = this.pickedMesh.getVerticesData(BABYLON.VertexBuffer.PositionKind); + var vertex1 = BABYLON.Vector3.FromArray(positions, indices[this.faceId * 3] * 3); + var vertex2 = BABYLON.Vector3.FromArray(positions, indices[this.faceId * 3 + 1] * 3); + var vertex3 = BABYLON.Vector3.FromArray(positions, indices[this.faceId * 3 + 2] * 3); + var p1p2 = vertex1.subtract(vertex2); + var p3p2 = vertex3.subtract(vertex2); + result = BABYLON.Vector3.Cross(p1p2, p3p2); + } + if (useWorldCoordinates) { + result = BABYLON.Vector3.TransformNormal(result, this.pickedMesh.getWorldMatrix()); + } + return BABYLON.Vector3.Normalize(result); + }; + PickingInfo.prototype.getTextureCoordinates = function () { + if (!this.pickedMesh || !this.pickedMesh.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) { + return null; + } + var indices = this.pickedMesh.getIndices(); + var uvs = this.pickedMesh.getVerticesData(BABYLON.VertexBuffer.UVKind); + var uv0 = BABYLON.Vector2.FromArray(uvs, indices[this.faceId * 3] * 2); + var uv1 = BABYLON.Vector2.FromArray(uvs, indices[this.faceId * 3 + 1] * 2); + var uv2 = BABYLON.Vector2.FromArray(uvs, indices[this.faceId * 3 + 2] * 2); + uv0 = uv0.scale(1.0 - this.bu - this.bv); + uv1 = uv1.scale(this.bu); + uv2 = uv2.scale(this.bv); + return new BABYLON.Vector2(uv0.x + uv1.x + uv2.x, uv0.y + uv1.y + uv2.y); + }; + return PickingInfo; + }()); + BABYLON.PickingInfo = PickingInfo; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.pickingInfo.js.map + +var BABYLON; +(function (BABYLON) { + var BoundingSphere = (function () { + function BoundingSphere(minimum, maximum) { + this.minimum = minimum; + this.maximum = maximum; + this._tempRadiusVector = BABYLON.Vector3.Zero(); + var distance = BABYLON.Vector3.Distance(minimum, maximum); + this.center = BABYLON.Vector3.Lerp(minimum, maximum, 0.5); + this.radius = distance * 0.5; + this.centerWorld = BABYLON.Vector3.Zero(); + this._update(BABYLON.Matrix.Identity()); + } + // Methods + BoundingSphere.prototype._update = function (world) { + BABYLON.Vector3.TransformCoordinatesToRef(this.center, world, this.centerWorld); + BABYLON.Vector3.TransformNormalFromFloatsToRef(1.0, 1.0, 1.0, world, this._tempRadiusVector); + this.radiusWorld = Math.max(Math.abs(this._tempRadiusVector.x), Math.abs(this._tempRadiusVector.y), Math.abs(this._tempRadiusVector.z)) * this.radius; + }; + BoundingSphere.prototype.isInFrustum = function (frustumPlanes) { + for (var i = 0; i < 6; i++) { + if (frustumPlanes[i].dotCoordinate(this.centerWorld) <= -this.radiusWorld) + return false; + } + return true; + }; + BoundingSphere.prototype.intersectsPoint = function (point) { + var x = this.centerWorld.x - point.x; + var y = this.centerWorld.y - point.y; + var z = this.centerWorld.z - point.z; + var distance = Math.sqrt((x * x) + (y * y) + (z * z)); + if (Math.abs(this.radiusWorld - distance) < BABYLON.Epsilon) + return false; + return true; + }; + // Statics + BoundingSphere.Intersects = function (sphere0, sphere1) { + var x = sphere0.centerWorld.x - sphere1.centerWorld.x; + var y = sphere0.centerWorld.y - sphere1.centerWorld.y; + var z = sphere0.centerWorld.z - sphere1.centerWorld.z; + var distance = Math.sqrt((x * x) + (y * y) + (z * z)); + if (sphere0.radiusWorld + sphere1.radiusWorld < distance) + return false; + return true; + }; + return BoundingSphere; + }()); + BABYLON.BoundingSphere = BoundingSphere; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.boundingSphere.js.map + +var BABYLON; +(function (BABYLON) { + var BoundingBox = (function () { + function BoundingBox(minimum, maximum) { + this.minimum = minimum; + this.maximum = maximum; + this.vectors = new Array(); + this.vectorsWorld = new Array(); + // Bounding vectors + this.vectors.push(this.minimum.clone()); + this.vectors.push(this.maximum.clone()); + this.vectors.push(this.minimum.clone()); + this.vectors[2].x = this.maximum.x; + this.vectors.push(this.minimum.clone()); + this.vectors[3].y = this.maximum.y; + this.vectors.push(this.minimum.clone()); + this.vectors[4].z = this.maximum.z; + this.vectors.push(this.maximum.clone()); + this.vectors[5].z = this.minimum.z; + this.vectors.push(this.maximum.clone()); + this.vectors[6].x = this.minimum.x; + this.vectors.push(this.maximum.clone()); + this.vectors[7].y = this.minimum.y; + // OBB + this.center = this.maximum.add(this.minimum).scale(0.5); + this.extendSize = this.maximum.subtract(this.minimum).scale(0.5); + this.directions = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()]; + // World + for (var index = 0; index < this.vectors.length; index++) { + this.vectorsWorld[index] = BABYLON.Vector3.Zero(); + } + this.minimumWorld = BABYLON.Vector3.Zero(); + this.maximumWorld = BABYLON.Vector3.Zero(); + this._update(BABYLON.Matrix.Identity()); + } + // Methods + BoundingBox.prototype.getWorldMatrix = function () { + return this._worldMatrix; + }; + BoundingBox.prototype.setWorldMatrix = function (matrix) { + this._worldMatrix.copyFrom(matrix); + return this; + }; + BoundingBox.prototype._update = function (world) { + BABYLON.Vector3.FromFloatsToRef(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, this.minimumWorld); + BABYLON.Vector3.FromFloatsToRef(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, this.maximumWorld); + for (var index = 0; index < this.vectors.length; index++) { + var v = this.vectorsWorld[index]; + BABYLON.Vector3.TransformCoordinatesToRef(this.vectors[index], world, v); + if (v.x < this.minimumWorld.x) + this.minimumWorld.x = v.x; + if (v.y < this.minimumWorld.y) + this.minimumWorld.y = v.y; + if (v.z < this.minimumWorld.z) + this.minimumWorld.z = v.z; + if (v.x > this.maximumWorld.x) + this.maximumWorld.x = v.x; + if (v.y > this.maximumWorld.y) + this.maximumWorld.y = v.y; + if (v.z > this.maximumWorld.z) + this.maximumWorld.z = v.z; + } + // OBB + this.maximumWorld.addToRef(this.minimumWorld, this.center); + this.center.scaleInPlace(0.5); + BABYLON.Vector3.FromFloatArrayToRef(world.m, 0, this.directions[0]); + BABYLON.Vector3.FromFloatArrayToRef(world.m, 4, this.directions[1]); + BABYLON.Vector3.FromFloatArrayToRef(world.m, 8, this.directions[2]); + this._worldMatrix = world; + }; + BoundingBox.prototype.isInFrustum = function (frustumPlanes) { + return BoundingBox.IsInFrustum(this.vectorsWorld, frustumPlanes); + }; + BoundingBox.prototype.isCompletelyInFrustum = function (frustumPlanes) { + return BoundingBox.IsCompletelyInFrustum(this.vectorsWorld, frustumPlanes); + }; + BoundingBox.prototype.intersectsPoint = function (point) { + var delta = -BABYLON.Epsilon; + if (this.maximumWorld.x - point.x < delta || delta > point.x - this.minimumWorld.x) + return false; + if (this.maximumWorld.y - point.y < delta || delta > point.y - this.minimumWorld.y) + return false; + if (this.maximumWorld.z - point.z < delta || delta > point.z - this.minimumWorld.z) + return false; + return true; + }; + BoundingBox.prototype.intersectsSphere = function (sphere) { + return BoundingBox.IntersectsSphere(this.minimumWorld, this.maximumWorld, sphere.centerWorld, sphere.radiusWorld); + }; + BoundingBox.prototype.intersectsMinMax = function (min, max) { + if (this.maximumWorld.x < min.x || this.minimumWorld.x > max.x) + return false; + if (this.maximumWorld.y < min.y || this.minimumWorld.y > max.y) + return false; + if (this.maximumWorld.z < min.z || this.minimumWorld.z > max.z) + return false; + return true; + }; + // Statics + BoundingBox.Intersects = function (box0, box1) { + if (box0.maximumWorld.x < box1.minimumWorld.x || box0.minimumWorld.x > box1.maximumWorld.x) + return false; + if (box0.maximumWorld.y < box1.minimumWorld.y || box0.minimumWorld.y > box1.maximumWorld.y) + return false; + if (box0.maximumWorld.z < box1.minimumWorld.z || box0.minimumWorld.z > box1.maximumWorld.z) + return false; + return true; + }; + BoundingBox.IntersectsSphere = function (minPoint, maxPoint, sphereCenter, sphereRadius) { + var vector = BABYLON.Vector3.Clamp(sphereCenter, minPoint, maxPoint); + var num = BABYLON.Vector3.DistanceSquared(sphereCenter, vector); + return (num <= (sphereRadius * sphereRadius)); + }; + BoundingBox.IsCompletelyInFrustum = function (boundingVectors, frustumPlanes) { + for (var p = 0; p < 6; p++) { + for (var i = 0; i < 8; i++) { + if (frustumPlanes[p].dotCoordinate(boundingVectors[i]) < 0) { + return false; + } + } + } + return true; + }; + BoundingBox.IsInFrustum = function (boundingVectors, frustumPlanes) { + for (var p = 0; p < 6; p++) { + var inCount = 8; + for (var i = 0; i < 8; i++) { + if (frustumPlanes[p].dotCoordinate(boundingVectors[i]) < 0) { + --inCount; + } + else { + break; + } + } + if (inCount === 0) + return false; + } + return true; + }; + return BoundingBox; + }()); + BABYLON.BoundingBox = BoundingBox; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.boundingBox.js.map + +var BABYLON; +(function (BABYLON) { + var computeBoxExtents = function (axis, box) { + var p = BABYLON.Vector3.Dot(box.center, axis); + var r0 = Math.abs(BABYLON.Vector3.Dot(box.directions[0], axis)) * box.extendSize.x; + var r1 = Math.abs(BABYLON.Vector3.Dot(box.directions[1], axis)) * box.extendSize.y; + var r2 = Math.abs(BABYLON.Vector3.Dot(box.directions[2], axis)) * box.extendSize.z; + var r = r0 + r1 + r2; + return { + min: p - r, + max: p + r + }; + }; + var extentsOverlap = function (min0, max0, min1, max1) { return !(min0 > max1 || min1 > max0); }; + var axisOverlap = function (axis, box0, box1) { + var result0 = computeBoxExtents(axis, box0); + var result1 = computeBoxExtents(axis, box1); + return extentsOverlap(result0.min, result0.max, result1.min, result1.max); + }; + var BoundingInfo = (function () { + function BoundingInfo(minimum, maximum) { + this.minimum = minimum; + this.maximum = maximum; + this._isLocked = false; + this.boundingBox = new BABYLON.BoundingBox(minimum, maximum); + this.boundingSphere = new BABYLON.BoundingSphere(minimum, maximum); + } + Object.defineProperty(BoundingInfo.prototype, "isLocked", { + get: function () { + return this._isLocked; + }, + set: function (value) { + this._isLocked = value; + }, + enumerable: true, + configurable: true + }); + // Methods + BoundingInfo.prototype.update = function (world) { + if (this._isLocked) { + return; + } + this.boundingBox._update(world); + this.boundingSphere._update(world); + }; + BoundingInfo.prototype.isInFrustum = function (frustumPlanes) { + if (!this.boundingSphere.isInFrustum(frustumPlanes)) + return false; + return this.boundingBox.isInFrustum(frustumPlanes); + }; + BoundingInfo.prototype.isCompletelyInFrustum = function (frustumPlanes) { + return this.boundingBox.isCompletelyInFrustum(frustumPlanes); + }; + BoundingInfo.prototype._checkCollision = function (collider) { + return collider._canDoCollision(this.boundingSphere.centerWorld, this.boundingSphere.radiusWorld, this.boundingBox.minimumWorld, this.boundingBox.maximumWorld); + }; + BoundingInfo.prototype.intersectsPoint = function (point) { + if (!this.boundingSphere.centerWorld) { + return false; + } + if (!this.boundingSphere.intersectsPoint(point)) { + return false; + } + if (!this.boundingBox.intersectsPoint(point)) { + return false; + } + return true; + }; + BoundingInfo.prototype.intersects = function (boundingInfo, precise) { + if (!this.boundingSphere.centerWorld || !boundingInfo.boundingSphere.centerWorld) { + return false; + } + if (!BABYLON.BoundingSphere.Intersects(this.boundingSphere, boundingInfo.boundingSphere)) { + return false; + } + if (!BABYLON.BoundingBox.Intersects(this.boundingBox, boundingInfo.boundingBox)) { + return false; + } + if (!precise) { + return true; + } + var box0 = this.boundingBox; + var box1 = boundingInfo.boundingBox; + if (!axisOverlap(box0.directions[0], box0, box1)) + return false; + if (!axisOverlap(box0.directions[1], box0, box1)) + return false; + if (!axisOverlap(box0.directions[2], box0, box1)) + return false; + if (!axisOverlap(box1.directions[0], box0, box1)) + return false; + if (!axisOverlap(box1.directions[1], box0, box1)) + return false; + if (!axisOverlap(box1.directions[2], box0, box1)) + return false; + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[0], box1.directions[0]), box0, box1)) + return false; + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[0], box1.directions[1]), box0, box1)) + return false; + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[0], box1.directions[2]), box0, box1)) + return false; + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[1], box1.directions[0]), box0, box1)) + return false; + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[1], box1.directions[1]), box0, box1)) + return false; + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[1], box1.directions[2]), box0, box1)) + return false; + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[2], box1.directions[0]), box0, box1)) + return false; + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[2], box1.directions[1]), box0, box1)) + return false; + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[2], box1.directions[2]), box0, box1)) + return false; + return true; + }; + return BoundingInfo; + }()); + BABYLON.BoundingInfo = BoundingInfo; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.boundingInfo.js.map + +var BABYLON; +(function (BABYLON) { + var Ray = (function () { + function Ray(origin, direction, length) { + if (length === void 0) { length = Number.MAX_VALUE; } + this.origin = origin; + this.direction = direction; + this.length = length; + this._show = false; + } + // Methods + Ray.prototype.intersectsBoxMinMax = function (minimum, maximum) { + var d = 0.0; + var maxValue = Number.MAX_VALUE; + var inv; + var min; + var max; + var temp; + if (Math.abs(this.direction.x) < 0.0000001) { + if (this.origin.x < minimum.x || this.origin.x > maximum.x) { + return false; + } + } + else { + inv = 1.0 / this.direction.x; + min = (minimum.x - this.origin.x) * inv; + max = (maximum.x - this.origin.x) * inv; + if (max === -Infinity) { + max = Infinity; + } + if (min > max) { + temp = min; + min = max; + max = temp; + } + d = Math.max(min, d); + maxValue = Math.min(max, maxValue); + if (d > maxValue) { + return false; + } + } + if (Math.abs(this.direction.y) < 0.0000001) { + if (this.origin.y < minimum.y || this.origin.y > maximum.y) { + return false; + } + } + else { + inv = 1.0 / this.direction.y; + min = (minimum.y - this.origin.y) * inv; + max = (maximum.y - this.origin.y) * inv; + if (max === -Infinity) { + max = Infinity; + } + if (min > max) { + temp = min; + min = max; + max = temp; + } + d = Math.max(min, d); + maxValue = Math.min(max, maxValue); + if (d > maxValue) { + return false; + } + } + if (Math.abs(this.direction.z) < 0.0000001) { + if (this.origin.z < minimum.z || this.origin.z > maximum.z) { + return false; + } + } + else { + inv = 1.0 / this.direction.z; + min = (minimum.z - this.origin.z) * inv; + max = (maximum.z - this.origin.z) * inv; + if (max === -Infinity) { + max = Infinity; + } + if (min > max) { + temp = min; + min = max; + max = temp; + } + d = Math.max(min, d); + maxValue = Math.min(max, maxValue); + if (d > maxValue) { + return false; + } + } + return true; + }; + Ray.prototype.intersectsBox = function (box) { + return this.intersectsBoxMinMax(box.minimum, box.maximum); + }; + Ray.prototype.intersectsSphere = function (sphere) { + var x = sphere.center.x - this.origin.x; + var y = sphere.center.y - this.origin.y; + var z = sphere.center.z - this.origin.z; + var pyth = (x * x) + (y * y) + (z * z); + var rr = sphere.radius * sphere.radius; + if (pyth <= rr) { + return true; + } + var dot = (x * this.direction.x) + (y * this.direction.y) + (z * this.direction.z); + if (dot < 0.0) { + return false; + } + var temp = pyth - (dot * dot); + return temp <= rr; + }; + Ray.prototype.intersectsTriangle = function (vertex0, vertex1, vertex2) { + if (!this._edge1) { + this._edge1 = BABYLON.Vector3.Zero(); + this._edge2 = BABYLON.Vector3.Zero(); + this._pvec = BABYLON.Vector3.Zero(); + this._tvec = BABYLON.Vector3.Zero(); + this._qvec = BABYLON.Vector3.Zero(); + } + vertex1.subtractToRef(vertex0, this._edge1); + vertex2.subtractToRef(vertex0, this._edge2); + BABYLON.Vector3.CrossToRef(this.direction, this._edge2, this._pvec); + var det = BABYLON.Vector3.Dot(this._edge1, this._pvec); + if (det === 0) { + return null; + } + var invdet = 1 / det; + this.origin.subtractToRef(vertex0, this._tvec); + var bu = BABYLON.Vector3.Dot(this._tvec, this._pvec) * invdet; + if (bu < 0 || bu > 1.0) { + return null; + } + BABYLON.Vector3.CrossToRef(this._tvec, this._edge1, this._qvec); + var bv = BABYLON.Vector3.Dot(this.direction, this._qvec) * invdet; + if (bv < 0 || bu + bv > 1.0) { + return null; + } + //check if the distance is longer than the predefined length. + var distance = BABYLON.Vector3.Dot(this._edge2, this._qvec) * invdet; + if (distance > this.length) { + return null; + } + return new BABYLON.IntersectionInfo(bu, bv, distance); + }; + Ray.prototype.intersectsPlane = function (plane) { + var distance; + var result1 = BABYLON.Vector3.Dot(plane.normal, this.direction); + if (Math.abs(result1) < 9.99999997475243E-07) { + return null; + } + else { + var result2 = BABYLON.Vector3.Dot(plane.normal, this.origin); + distance = (-plane.d - result2) / result1; + if (distance < 0.0) { + if (distance < -9.99999997475243E-07) { + return null; + } + else { + return 0; + } + } + return distance; + } + }; + Ray.prototype.intersectsMesh = function (mesh, fastCheck) { + var tm = BABYLON.Tmp.Matrix[0]; + mesh.getWorldMatrix().invertToRef(tm); + if (this._tmpRay) { + Ray.TransformToRef(this, tm, this._tmpRay); + } + else { + this._tmpRay = Ray.Transform(this, tm); + } + return mesh.intersects(this._tmpRay, fastCheck); + }; + Ray.prototype.show = function (scene, color) { + if (!this._show) { + this._renderFunction = this._render.bind(this); + this._show = true; + this._scene = scene; + this._renderPoints = [this.origin, this.origin.add(this.direction.scale(this.length))]; + this._renderLine = BABYLON.Mesh.CreateLines("ray", this._renderPoints, scene, true); + this._scene.registerBeforeRender(this._renderFunction); + } + if (color) { + this._renderLine.color.copyFrom(color); + } + }; + Ray.prototype.hide = function () { + if (this._show) { + this._show = false; + this._scene.unregisterBeforeRender(this._renderFunction); + } + if (this._renderLine) { + this._renderLine.dispose(); + this._renderLine = null; + this._renderPoints = null; + } + }; + Ray.prototype._render = function () { + var point = this._renderPoints[1]; + point.copyFrom(this.direction); + point.scaleInPlace(this.length); + point.addInPlace(this.origin); + BABYLON.Mesh.CreateLines("ray", this._renderPoints, this._scene, true, this._renderLine); + }; + /** + * Intersection test between the ray and a given segment whithin a given tolerance (threshold) + * @param sega the first point of the segment to test the intersection against + * @param segb the second point of the segment to test the intersection against + * @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful + * @return the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection + */ + Ray.prototype.intersectionSegment = function (sega, segb, threshold) { + var rsegb = this.origin.add(this.direction.multiplyByFloats(Ray.rayl, Ray.rayl, Ray.rayl)); + var u = segb.subtract(sega); + var v = rsegb.subtract(this.origin); + var w = sega.subtract(this.origin); + var a = BABYLON.Vector3.Dot(u, u); // always >= 0 + var b = BABYLON.Vector3.Dot(u, v); + var c = BABYLON.Vector3.Dot(v, v); // always >= 0 + var d = BABYLON.Vector3.Dot(u, w); + var e = BABYLON.Vector3.Dot(v, w); + var D = a * c - b * b; // always >= 0 + var sc, sN, sD = D; // sc = sN / sD, default sD = D >= 0 + var tc, tN, tD = D; // tc = tN / tD, default tD = D >= 0 + // compute the line parameters of the two closest points + if (D < Ray.smallnum) { + sN = 0.0; // force using point P0 on segment S1 + sD = 1.0; // to prevent possible division by 0.0 later + tN = e; + tD = c; + } + else { + sN = (b * e - c * d); + tN = (a * e - b * d); + if (sN < 0.0) { + sN = 0.0; + tN = e; + tD = c; + } + else if (sN > sD) { + sN = sD; + tN = e + b; + tD = c; + } + } + if (tN < 0.0) { + tN = 0.0; + // recompute sc for this edge + if (-d < 0.0) { + sN = 0.0; + } + else if (-d > a) + sN = sD; + else { + sN = -d; + sD = a; + } + } + else if (tN > tD) { + tN = tD; + // recompute sc for this edge + if ((-d + b) < 0.0) { + sN = 0; + } + else if ((-d + b) > a) { + sN = sD; + } + else { + sN = (-d + b); + sD = a; + } + } + // finally do the division to get sc and tc + sc = (Math.abs(sN) < Ray.smallnum ? 0.0 : sN / sD); + tc = (Math.abs(tN) < Ray.smallnum ? 0.0 : tN / tD); + // get the difference of the two closest points + var qtc = v.multiplyByFloats(tc, tc, tc); + var dP = w.add(u.multiplyByFloats(sc, sc, sc)).subtract(qtc); // = S1(sc) - S2(tc) + var isIntersected = (tc > 0) && (tc <= this.length) && (dP.lengthSquared() < (threshold * threshold)); // return intersection result + if (isIntersected) { + return qtc.length(); + } + return -1; + }; + // Statics + Ray.CreateNew = function (x, y, viewportWidth, viewportHeight, world, view, projection) { + var start = BABYLON.Vector3.Unproject(new BABYLON.Vector3(x, y, 0), viewportWidth, viewportHeight, world, view, projection); + var end = BABYLON.Vector3.Unproject(new BABYLON.Vector3(x, y, 1), viewportWidth, viewportHeight, world, view, projection); + var direction = end.subtract(start); + direction.normalize(); + return new Ray(start, direction); + }; + /** + * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be + * transformed to the given world matrix. + * @param origin The origin point + * @param end The end point + * @param world a matrix to transform the ray to. Default is the identity matrix. + */ + Ray.CreateNewFromTo = function (origin, end, world) { + if (world === void 0) { world = BABYLON.Matrix.Identity(); } + var direction = end.subtract(origin); + var length = Math.sqrt((direction.x * direction.x) + (direction.y * direction.y) + (direction.z * direction.z)); + direction.normalize(); + return Ray.Transform(new Ray(origin, direction, length), world); + }; + Ray.Transform = function (ray, matrix) { + var newOrigin = BABYLON.Vector3.TransformCoordinates(ray.origin, matrix); + var newDirection = BABYLON.Vector3.TransformNormal(ray.direction, matrix); + newDirection.normalize(); + return new Ray(newOrigin, newDirection, ray.length); + }; + Ray.TransformToRef = function (ray, matrix, result) { + BABYLON.Vector3.TransformCoordinatesToRef(ray.origin, matrix, result.origin); + BABYLON.Vector3.TransformNormalToRef(ray.direction, matrix, result.direction); + ray.direction.normalize(); + }; + Ray.smallnum = 0.00000001; + Ray.rayl = 10e8; + return Ray; + }()); + BABYLON.Ray = Ray; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.ray.js.map + + +var BABYLON; +(function (BABYLON) { + var AbstractMesh = (function (_super) { + __extends(AbstractMesh, _super); + // Constructor + function AbstractMesh(name, scene) { + var _this = this; + _super.call(this, name, scene); + // Events + /** + * An event triggered when this mesh collides with another one + * @type {BABYLON.Observable} + */ + this.onCollideObservable = new BABYLON.Observable(); + /** + * An event triggered when the collision's position changes + * @type {BABYLON.Observable} + */ + this.onCollisionPositionChangeObservable = new BABYLON.Observable(); + /** + * An event triggered after the world matrix is updated + * @type {BABYLON.Observable} + */ + this.onAfterWorldMatrixUpdateObservable = new BABYLON.Observable(); + // Properties + this.definedFacingForward = true; // orientation for POV movement & rotation + this.position = new BABYLON.Vector3(0, 0, 0); + this._rotation = new BABYLON.Vector3(0, 0, 0); + this._scaling = new BABYLON.Vector3(1, 1, 1); + this.billboardMode = AbstractMesh.BILLBOARDMODE_NONE; + this.visibility = 1.0; + this.alphaIndex = Number.MAX_VALUE; + this.infiniteDistance = false; + this.isVisible = true; + this.isPickable = true; + this.showBoundingBox = false; + this.showSubMeshesBoundingBox = false; + this.isBlocker = false; + this.renderingGroupId = 0; + this.receiveShadows = false; + this.renderOutline = false; + this.outlineColor = BABYLON.Color3.Red(); + this.outlineWidth = 0.02; + this.renderOverlay = false; + this.overlayColor = BABYLON.Color3.Red(); + this.overlayAlpha = 0.5; + this.hasVertexAlpha = false; + this.useVertexColors = true; + this.applyFog = true; + this.computeBonesUsingShaders = true; + this.scalingDeterminant = 1; + this.numBoneInfluencers = 4; + this.useOctreeForRenderingSelection = true; + this.useOctreeForPicking = true; + this.useOctreeForCollisions = true; + this.layerMask = 0x0FFFFFFF; + this.alwaysSelectAsActiveMesh = false; + // Collisions + this._checkCollisions = false; + this.ellipsoid = new BABYLON.Vector3(0.5, 1, 0.5); + this.ellipsoidOffset = new BABYLON.Vector3(0, 0, 0); + this._collider = new BABYLON.Collider(); + this._oldPositionForCollisions = new BABYLON.Vector3(0, 0, 0); + this._diffPositionForCollisions = new BABYLON.Vector3(0, 0, 0); + this._newPositionForCollisions = new BABYLON.Vector3(0, 0, 0); + // Edges + this.edgesWidth = 1; + this.edgesColor = new BABYLON.Color4(1, 0, 0, 1); + // Cache + this._localWorld = BABYLON.Matrix.Zero(); + this._worldMatrix = BABYLON.Matrix.Zero(); + this._rotateYByPI = BABYLON.Matrix.RotationY(Math.PI); + this._absolutePosition = BABYLON.Vector3.Zero(); + this._collisionsTransformMatrix = BABYLON.Matrix.Zero(); + this._collisionsScalingMatrix = BABYLON.Matrix.Zero(); + this._isDirty = false; + this._pivotMatrix = BABYLON.Matrix.Identity(); + this._isDisposed = false; + this._renderId = 0; + this._intersectionsInProgress = new Array(); + this._isWorldMatrixFrozen = false; + this._unIndexed = false; + this._onCollisionPositionChange = function (collisionId, newPosition, collidedMesh) { + if (collidedMesh === void 0) { collidedMesh = null; } + //TODO move this to the collision coordinator! + if (_this.getScene().workerCollisions) + newPosition.multiplyInPlace(_this._collider.radius); + newPosition.subtractToRef(_this._oldPositionForCollisions, _this._diffPositionForCollisions); + if (_this._diffPositionForCollisions.length() > BABYLON.Engine.CollisionsEpsilon) { + _this.position.addInPlace(_this._diffPositionForCollisions); + } + if (collidedMesh) { + _this.onCollideObservable.notifyObservers(collidedMesh); + } + _this.onCollisionPositionChangeObservable.notifyObservers(_this.position); + }; + scene.addMesh(this); + } + Object.defineProperty(AbstractMesh, "BILLBOARDMODE_NONE", { + get: function () { + return AbstractMesh._BILLBOARDMODE_NONE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh, "BILLBOARDMODE_X", { + get: function () { + return AbstractMesh._BILLBOARDMODE_X; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh, "BILLBOARDMODE_Y", { + get: function () { + return AbstractMesh._BILLBOARDMODE_Y; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh, "BILLBOARDMODE_Z", { + get: function () { + return AbstractMesh._BILLBOARDMODE_Z; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh, "BILLBOARDMODE_ALL", { + get: function () { + return AbstractMesh._BILLBOARDMODE_ALL; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "onCollide", { + set: function (callback) { + if (this._onCollideObserver) { + this.onCollideObservable.remove(this._onCollideObserver); + } + this._onCollideObserver = this.onCollideObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "onCollisionPositionChange", { + set: function (callback) { + if (this._onCollisionPositionChangeObserver) { + this.onCollisionPositionChangeObservable.remove(this._onCollisionPositionChangeObserver); + } + this._onCollisionPositionChangeObserver = this.onCollisionPositionChangeObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "skeleton", { + get: function () { + return this._skeleton; + }, + set: function (value) { + if (this._skeleton && this._skeleton.needInitialSkinMatrix) { + this._skeleton._unregisterMeshWithPoseMatrix(this); + } + if (value && value.needInitialSkinMatrix) { + value._registerMeshWithPoseMatrix(this); + } + this._skeleton = value; + if (!this._skeleton) { + this._bonesTransformMatrices = null; + } + }, + enumerable: true, + configurable: true + }); + /** + * @param {boolean} fullDetails - support for multiple levels of logging within scene loading + */ + AbstractMesh.prototype.toString = function (fullDetails) { + var ret = "Name: " + this.name + ", isInstance: " + (this instanceof BABYLON.InstancedMesh ? "YES" : "NO"); + ret += ", # of submeshes: " + (this.subMeshes ? this.subMeshes.length : 0); + if (this._skeleton) { + ret += ", skeleton: " + this._skeleton.name; + } + if (fullDetails) { + ret += ", billboard mode: " + (["NONE", "X", "Y", null, "Z", null, null, "ALL"])[this.billboardMode]; + ret += ", freeze wrld mat: " + (this._isWorldMatrixFrozen || this._waitingFreezeWorldMatrix ? "YES" : "NO"); + } + return ret; + }; + Object.defineProperty(AbstractMesh.prototype, "rotation", { + /** + * Getting the rotation object. + * If rotation quaternion is set, this vector will (almost always) be the Zero vector! + */ + get: function () { + return this._rotation; + }, + set: function (newRotation) { + this._rotation = newRotation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "scaling", { + get: function () { + return this._scaling; + }, + set: function (newScaling) { + this._scaling = newScaling; + if (this.physicsImpostor) { + this.physicsImpostor.forceUpdate(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "rotationQuaternion", { + get: function () { + return this._rotationQuaternion; + }, + set: function (quaternion) { + this._rotationQuaternion = quaternion; + //reset the rotation vector. + if (quaternion && this.rotation.length()) { + this.rotation.copyFromFloats(0, 0, 0); + } + }, + enumerable: true, + configurable: true + }); + // Methods + AbstractMesh.prototype.updatePoseMatrix = function (matrix) { + this._poseMatrix.copyFrom(matrix); + }; + AbstractMesh.prototype.getPoseMatrix = function () { + return this._poseMatrix; + }; + AbstractMesh.prototype.disableEdgesRendering = function () { + if (this._edgesRenderer !== undefined) { + this._edgesRenderer.dispose(); + this._edgesRenderer = undefined; + } + }; + AbstractMesh.prototype.enableEdgesRendering = function (epsilon, checkVerticesInsteadOfIndices) { + if (epsilon === void 0) { epsilon = 0.95; } + if (checkVerticesInsteadOfIndices === void 0) { checkVerticesInsteadOfIndices = false; } + this.disableEdgesRendering(); + this._edgesRenderer = new BABYLON.EdgesRenderer(this, epsilon, checkVerticesInsteadOfIndices); + }; + Object.defineProperty(AbstractMesh.prototype, "isBlocked", { + get: function () { + return false; + }, + enumerable: true, + configurable: true + }); + AbstractMesh.prototype.getLOD = function (camera) { + return this; + }; + AbstractMesh.prototype.getTotalVertices = function () { + return 0; + }; + AbstractMesh.prototype.getIndices = function () { + return null; + }; + AbstractMesh.prototype.getVerticesData = function (kind) { + return null; + }; + AbstractMesh.prototype.isVerticesDataPresent = function (kind) { + return false; + }; + AbstractMesh.prototype.getBoundingInfo = function () { + if (this._masterMesh) { + return this._masterMesh.getBoundingInfo(); + } + if (!this._boundingInfo) { + this._updateBoundingInfo(); + } + return this._boundingInfo; + }; + AbstractMesh.prototype.setBoundingInfo = function (boundingInfo) { + this._boundingInfo = boundingInfo; + }; + Object.defineProperty(AbstractMesh.prototype, "useBones", { + get: function () { + return this.skeleton && this.getScene().skeletonsEnabled && this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesIndicesKind) && this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsKind); + }, + enumerable: true, + configurable: true + }); + AbstractMesh.prototype._preActivate = function () { + }; + AbstractMesh.prototype._preActivateForIntermediateRendering = function (renderId) { + }; + AbstractMesh.prototype._activate = function (renderId) { + this._renderId = renderId; + }; + AbstractMesh.prototype.getWorldMatrix = function () { + if (this._masterMesh) { + return this._masterMesh.getWorldMatrix(); + } + if (this._currentRenderId !== this.getScene().getRenderId()) { + this.computeWorldMatrix(); + } + return this._worldMatrix; + }; + Object.defineProperty(AbstractMesh.prototype, "worldMatrixFromCache", { + get: function () { + return this._worldMatrix; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "absolutePosition", { + get: function () { + return this._absolutePosition; + }, + enumerable: true, + configurable: true + }); + AbstractMesh.prototype.freezeWorldMatrix = function () { + this._isWorldMatrixFrozen = false; // no guarantee world is not already frozen, switch off temporarily + this.computeWorldMatrix(true); + this._isWorldMatrixFrozen = true; + }; + AbstractMesh.prototype.unfreezeWorldMatrix = function () { + this._isWorldMatrixFrozen = false; + this.computeWorldMatrix(true); + }; + Object.defineProperty(AbstractMesh.prototype, "isWorldMatrixFrozen", { + get: function () { + return this._isWorldMatrixFrozen; + }, + enumerable: true, + configurable: true + }); + AbstractMesh.prototype.rotate = function (axis, amount, space) { + axis.normalize(); + if (!this.rotationQuaternion) { + this.rotationQuaternion = BABYLON.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z); + this.rotation = BABYLON.Vector3.Zero(); + } + var rotationQuaternion; + if (!space || space === BABYLON.Space.LOCAL) { + rotationQuaternion = BABYLON.Quaternion.RotationAxisToRef(axis, amount, AbstractMesh._rotationAxisCache); + this.rotationQuaternion.multiplyToRef(rotationQuaternion, this.rotationQuaternion); + } + else { + if (this.parent) { + var invertParentWorldMatrix = this.parent.getWorldMatrix().clone(); + invertParentWorldMatrix.invert(); + axis = BABYLON.Vector3.TransformNormal(axis, invertParentWorldMatrix); + } + rotationQuaternion = BABYLON.Quaternion.RotationAxisToRef(axis, amount, AbstractMesh._rotationAxisCache); + rotationQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion); + } + }; + AbstractMesh.prototype.translate = function (axis, distance, space) { + var displacementVector = axis.scale(distance); + if (!space || space === BABYLON.Space.LOCAL) { + var tempV3 = this.getPositionExpressedInLocalSpace().add(displacementVector); + this.setPositionWithLocalVector(tempV3); + } + else { + this.setAbsolutePosition(this.getAbsolutePosition().add(displacementVector)); + } + }; + AbstractMesh.prototype.getAbsolutePosition = function () { + this.computeWorldMatrix(); + return this._absolutePosition; + }; + AbstractMesh.prototype.setAbsolutePosition = function (absolutePosition) { + if (!absolutePosition) { + return; + } + var absolutePositionX; + var absolutePositionY; + var absolutePositionZ; + if (absolutePosition.x === undefined) { + if (arguments.length < 3) { + return; + } + absolutePositionX = arguments[0]; + absolutePositionY = arguments[1]; + absolutePositionZ = arguments[2]; + } + else { + absolutePositionX = absolutePosition.x; + absolutePositionY = absolutePosition.y; + absolutePositionZ = absolutePosition.z; + } + if (this.parent) { + var invertParentWorldMatrix = this.parent.getWorldMatrix().clone(); + invertParentWorldMatrix.invert(); + var worldPosition = new BABYLON.Vector3(absolutePositionX, absolutePositionY, absolutePositionZ); + this.position = BABYLON.Vector3.TransformCoordinates(worldPosition, invertParentWorldMatrix); + } + else { + this.position.x = absolutePositionX; + this.position.y = absolutePositionY; + this.position.z = absolutePositionZ; + } + }; + // ================================== Point of View Movement ================================= + /** + * Perform relative position change from the point of view of behind the front of the mesh. + * This is performed taking into account the meshes current rotation, so you do not have to care. + * Supports definition of mesh facing forward or backward. + * @param {number} amountRight + * @param {number} amountUp + * @param {number} amountForward + */ + AbstractMesh.prototype.movePOV = function (amountRight, amountUp, amountForward) { + this.position.addInPlace(this.calcMovePOV(amountRight, amountUp, amountForward)); + }; + /** + * Calculate relative position change from the point of view of behind the front of the mesh. + * This is performed taking into account the meshes current rotation, so you do not have to care. + * Supports definition of mesh facing forward or backward. + * @param {number} amountRight + * @param {number} amountUp + * @param {number} amountForward + */ + AbstractMesh.prototype.calcMovePOV = function (amountRight, amountUp, amountForward) { + var rotMatrix = new BABYLON.Matrix(); + var rotQuaternion = (this.rotationQuaternion) ? this.rotationQuaternion : BABYLON.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z); + rotQuaternion.toRotationMatrix(rotMatrix); + var translationDelta = BABYLON.Vector3.Zero(); + var defForwardMult = this.definedFacingForward ? -1 : 1; + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(amountRight * defForwardMult, amountUp, amountForward * defForwardMult, rotMatrix, translationDelta); + return translationDelta; + }; + // ================================== Point of View Rotation ================================= + /** + * Perform relative rotation change from the point of view of behind the front of the mesh. + * Supports definition of mesh facing forward or backward. + * @param {number} flipBack + * @param {number} twirlClockwise + * @param {number} tiltRight + */ + AbstractMesh.prototype.rotatePOV = function (flipBack, twirlClockwise, tiltRight) { + this.rotation.addInPlace(this.calcRotatePOV(flipBack, twirlClockwise, tiltRight)); + }; + /** + * Calculate relative rotation change from the point of view of behind the front of the mesh. + * Supports definition of mesh facing forward or backward. + * @param {number} flipBack + * @param {number} twirlClockwise + * @param {number} tiltRight + */ + AbstractMesh.prototype.calcRotatePOV = function (flipBack, twirlClockwise, tiltRight) { + var defForwardMult = this.definedFacingForward ? 1 : -1; + return new BABYLON.Vector3(flipBack * defForwardMult, twirlClockwise, tiltRight * defForwardMult); + }; + AbstractMesh.prototype.setPivotMatrix = function (matrix) { + this._pivotMatrix = matrix; + this._cache.pivotMatrixUpdated = true; + }; + AbstractMesh.prototype.getPivotMatrix = function () { + return this._pivotMatrix; + }; + AbstractMesh.prototype._isSynchronized = function () { + if (this._isDirty) { + return false; + } + if (this.billboardMode !== this._cache.billboardMode || this.billboardMode !== AbstractMesh.BILLBOARDMODE_NONE) + return false; + if (this._cache.pivotMatrixUpdated) { + return false; + } + if (this.infiniteDistance) { + return false; + } + if (!this._cache.position.equals(this.position)) + return false; + if (this.rotationQuaternion) { + if (!this._cache.rotationQuaternion.equals(this.rotationQuaternion)) + return false; + } + if (!this._cache.rotation.equals(this.rotation)) + return false; + if (!this._cache.scaling.equals(this.scaling)) + return false; + return true; + }; + AbstractMesh.prototype._initCache = function () { + _super.prototype._initCache.call(this); + this._cache.localMatrixUpdated = false; + this._cache.position = BABYLON.Vector3.Zero(); + this._cache.scaling = BABYLON.Vector3.Zero(); + this._cache.rotation = BABYLON.Vector3.Zero(); + this._cache.rotationQuaternion = new BABYLON.Quaternion(0, 0, 0, 0); + this._cache.billboardMode = -1; + }; + AbstractMesh.prototype.markAsDirty = function (property) { + if (property === "rotation") { + this.rotationQuaternion = null; + } + this._currentRenderId = Number.MAX_VALUE; + this._isDirty = true; + }; + AbstractMesh.prototype._updateBoundingInfo = function () { + this._boundingInfo = this._boundingInfo || new BABYLON.BoundingInfo(this.absolutePosition, this.absolutePosition); + this._boundingInfo.update(this.worldMatrixFromCache); + this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache); + }; + AbstractMesh.prototype._updateSubMeshesBoundingInfo = function (matrix) { + if (!this.subMeshes) { + return; + } + for (var subIndex = 0; subIndex < this.subMeshes.length; subIndex++) { + var subMesh = this.subMeshes[subIndex]; + if (!subMesh.IsGlobal) { + subMesh.updateBoundingInfo(matrix); + } + } + }; + AbstractMesh.prototype.computeWorldMatrix = function (force) { + if (this._isWorldMatrixFrozen) { + return this._worldMatrix; + } + if (!force && (this._currentRenderId === this.getScene().getRenderId() || this.isSynchronized(true))) { + this._currentRenderId = this.getScene().getRenderId(); + return this._worldMatrix; + } + this._cache.position.copyFrom(this.position); + this._cache.scaling.copyFrom(this.scaling); + this._cache.pivotMatrixUpdated = false; + this._cache.billboardMode = this.billboardMode; + this._currentRenderId = this.getScene().getRenderId(); + this._isDirty = false; + // Scaling + BABYLON.Matrix.ScalingToRef(this.scaling.x * this.scalingDeterminant, this.scaling.y * this.scalingDeterminant, this.scaling.z * this.scalingDeterminant, BABYLON.Tmp.Matrix[1]); + // Rotation + //rotate, if quaternion is set and rotation was used + if (this.rotationQuaternion) { + var len = this.rotation.length(); + if (len) { + this.rotationQuaternion.multiplyInPlace(BABYLON.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z)); + this.rotation.copyFromFloats(0, 0, 0); + } + } + if (this.rotationQuaternion) { + this.rotationQuaternion.toRotationMatrix(BABYLON.Tmp.Matrix[0]); + this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion); + } + else { + BABYLON.Matrix.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, BABYLON.Tmp.Matrix[0]); + this._cache.rotation.copyFrom(this.rotation); + } + // Translation + if (this.infiniteDistance && !this.parent) { + var camera = this.getScene().activeCamera; + if (camera) { + var cameraWorldMatrix = camera.getWorldMatrix(); + var cameraGlobalPosition = new BABYLON.Vector3(cameraWorldMatrix.m[12], cameraWorldMatrix.m[13], cameraWorldMatrix.m[14]); + BABYLON.Matrix.TranslationToRef(this.position.x + cameraGlobalPosition.x, this.position.y + cameraGlobalPosition.y, this.position.z + cameraGlobalPosition.z, BABYLON.Tmp.Matrix[2]); + } + } + else { + BABYLON.Matrix.TranslationToRef(this.position.x, this.position.y, this.position.z, BABYLON.Tmp.Matrix[2]); + } + // Composing transformations + this._pivotMatrix.multiplyToRef(BABYLON.Tmp.Matrix[1], BABYLON.Tmp.Matrix[4]); + BABYLON.Tmp.Matrix[4].multiplyToRef(BABYLON.Tmp.Matrix[0], BABYLON.Tmp.Matrix[5]); + // Billboarding + if (this.billboardMode !== AbstractMesh.BILLBOARDMODE_NONE && this.getScene().activeCamera) { + BABYLON.Tmp.Vector3[0].copyFrom(this.position); + var localPosition = BABYLON.Tmp.Vector3[0]; + if (this.parent && this.parent.getWorldMatrix) { + this._markSyncedWithParent(); + var parentMatrix; + if (this._meshToBoneReferal) { + this.parent.getWorldMatrix().multiplyToRef(this._meshToBoneReferal.getWorldMatrix(), BABYLON.Tmp.Matrix[6]); + parentMatrix = BABYLON.Tmp.Matrix[6]; + } + else { + parentMatrix = this.parent.getWorldMatrix(); + } + BABYLON.Vector3.TransformNormalToRef(localPosition, parentMatrix, BABYLON.Tmp.Vector3[1]); + localPosition = BABYLON.Tmp.Vector3[1]; + } + var zero = this.getScene().activeCamera.globalPosition.clone(); + if (this.parent && this.parent.position) { + localPosition.addInPlace(this.parent.position); + BABYLON.Matrix.TranslationToRef(localPosition.x, localPosition.y, localPosition.z, BABYLON.Tmp.Matrix[2]); + } + if ((this.billboardMode & AbstractMesh.BILLBOARDMODE_ALL) !== AbstractMesh.BILLBOARDMODE_ALL) { + if (this.billboardMode & AbstractMesh.BILLBOARDMODE_X) + zero.x = localPosition.x + BABYLON.Epsilon; + if (this.billboardMode & AbstractMesh.BILLBOARDMODE_Y) + zero.y = localPosition.y + BABYLON.Epsilon; + if (this.billboardMode & AbstractMesh.BILLBOARDMODE_Z) + zero.z = localPosition.z + BABYLON.Epsilon; + } + BABYLON.Matrix.LookAtLHToRef(localPosition, zero, BABYLON.Vector3.Up(), BABYLON.Tmp.Matrix[3]); + BABYLON.Tmp.Matrix[3].m[12] = BABYLON.Tmp.Matrix[3].m[13] = BABYLON.Tmp.Matrix[3].m[14] = 0; + BABYLON.Tmp.Matrix[3].invert(); + BABYLON.Tmp.Matrix[5].multiplyToRef(BABYLON.Tmp.Matrix[3], this._localWorld); + this._rotateYByPI.multiplyToRef(this._localWorld, BABYLON.Tmp.Matrix[5]); + } + // Local world + BABYLON.Tmp.Matrix[5].multiplyToRef(BABYLON.Tmp.Matrix[2], this._localWorld); + // Parent + if (this.parent && this.parent.getWorldMatrix && this.billboardMode === AbstractMesh.BILLBOARDMODE_NONE) { + this._markSyncedWithParent(); + if (this._meshToBoneReferal) { + this._localWorld.multiplyToRef(this.parent.getWorldMatrix(), BABYLON.Tmp.Matrix[6]); + BABYLON.Tmp.Matrix[6].multiplyToRef(this._meshToBoneReferal.getWorldMatrix(), this._worldMatrix); + } + else { + this._localWorld.multiplyToRef(this.parent.getWorldMatrix(), this._worldMatrix); + } + } + else { + this._worldMatrix.copyFrom(this._localWorld); + } + // Bounding info + this._updateBoundingInfo(); + // Absolute position + this._absolutePosition.copyFromFloats(this._worldMatrix.m[12], this._worldMatrix.m[13], this._worldMatrix.m[14]); + // Callbacks + this.onAfterWorldMatrixUpdateObservable.notifyObservers(this); + if (!this._poseMatrix) { + this._poseMatrix = BABYLON.Matrix.Invert(this._worldMatrix); + } + return this._worldMatrix; + }; + /** + * If you'd like to be callbacked after the mesh position, rotation or scaling has been updated + * @param func: callback function to add + */ + AbstractMesh.prototype.registerAfterWorldMatrixUpdate = function (func) { + this.onAfterWorldMatrixUpdateObservable.add(func); + }; + AbstractMesh.prototype.unregisterAfterWorldMatrixUpdate = function (func) { + this.onAfterWorldMatrixUpdateObservable.removeCallback(func); + }; + AbstractMesh.prototype.setPositionWithLocalVector = function (vector3) { + this.computeWorldMatrix(); + this.position = BABYLON.Vector3.TransformNormal(vector3, this._localWorld); + }; + AbstractMesh.prototype.getPositionExpressedInLocalSpace = function () { + this.computeWorldMatrix(); + var invLocalWorldMatrix = this._localWorld.clone(); + invLocalWorldMatrix.invert(); + return BABYLON.Vector3.TransformNormal(this.position, invLocalWorldMatrix); + }; + AbstractMesh.prototype.locallyTranslate = function (vector3) { + this.computeWorldMatrix(true); + this.position = BABYLON.Vector3.TransformCoordinates(vector3, this._localWorld); + }; + AbstractMesh.prototype.lookAt = function (targetPoint, yawCor, pitchCor, rollCor, space) { + /// Orients a mesh towards a target point. Mesh must be drawn facing user. + /// The position (must be in same space as current mesh) to look at + /// optional yaw (y-axis) correction in radians + /// optional pitch (x-axis) correction in radians + /// optional roll (z-axis) correction in radians + /// Mesh oriented towards targetMesh + if (yawCor === void 0) { yawCor = 0; } + if (pitchCor === void 0) { pitchCor = 0; } + if (rollCor === void 0) { rollCor = 0; } + if (space === void 0) { space = BABYLON.Space.LOCAL; } + var dv = AbstractMesh._lookAtVectorCache; + var pos = space === BABYLON.Space.LOCAL ? this.position : this.getAbsolutePosition(); + targetPoint.subtractToRef(pos, dv); + var yaw = -Math.atan2(dv.z, dv.x) - Math.PI / 2; + var len = Math.sqrt(dv.x * dv.x + dv.z * dv.z); + var pitch = Math.atan2(dv.y, len); + this.rotationQuaternion = this.rotationQuaternion || new BABYLON.Quaternion(); + BABYLON.Quaternion.RotationYawPitchRollToRef(yaw + yawCor, pitch + pitchCor, rollCor, this.rotationQuaternion); + }; + AbstractMesh.prototype.attachToBone = function (bone, affectedMesh) { + this._meshToBoneReferal = affectedMesh; + this.parent = bone; + if (bone.getWorldMatrix().determinant() < 0) { + this.scalingDeterminant *= -1; + } + }; + AbstractMesh.prototype.detachFromBone = function () { + if (this.parent.getWorldMatrix().determinant() < 0) { + this.scalingDeterminant *= -1; + } + this._meshToBoneReferal = null; + this.parent = null; + }; + AbstractMesh.prototype.isInFrustum = function (frustumPlanes) { + return this._boundingInfo.isInFrustum(frustumPlanes); + }; + AbstractMesh.prototype.isCompletelyInFrustum = function (frustumPlanes) { + return this._boundingInfo.isCompletelyInFrustum(frustumPlanes); + ; + }; + AbstractMesh.prototype.intersectsMesh = function (mesh, precise) { + if (!this._boundingInfo || !mesh._boundingInfo) { + return false; + } + return this._boundingInfo.intersects(mesh._boundingInfo, precise); + }; + AbstractMesh.prototype.intersectsPoint = function (point) { + if (!this._boundingInfo) { + return false; + } + return this._boundingInfo.intersectsPoint(point); + }; + // Physics + /** + * @Deprecated. Use new PhysicsImpostor instead. + * */ + AbstractMesh.prototype.setPhysicsState = function (impostor, options) { + //legacy support + if (impostor.impostor) { + options = impostor; + impostor = impostor.impostor; + } + this.physicsImpostor = new BABYLON.PhysicsImpostor(this, impostor, options, this.getScene()); + return this.physicsImpostor.physicsBody; + }; + AbstractMesh.prototype.getPhysicsImpostor = function () { + return this.physicsImpostor; + }; + /** + * @Deprecated. Use getPhysicsImpostor().getParam("mass"); + */ + AbstractMesh.prototype.getPhysicsMass = function () { + return this.physicsImpostor.getParam("mass"); + }; + /** + * @Deprecated. Use getPhysicsImpostor().getParam("friction"); + */ + AbstractMesh.prototype.getPhysicsFriction = function () { + return this.physicsImpostor.getParam("friction"); + }; + /** + * @Deprecated. Use getPhysicsImpostor().getParam("restitution"); + */ + AbstractMesh.prototype.getPhysicsRestitution = function () { + return this.physicsImpostor.getParam("restitution"); + }; + AbstractMesh.prototype.getPositionInCameraSpace = function (camera) { + if (!camera) { + camera = this.getScene().activeCamera; + } + return BABYLON.Vector3.TransformCoordinates(this.absolutePosition, camera.getViewMatrix()); + }; + AbstractMesh.prototype.getDistanceToCamera = function (camera) { + if (!camera) { + camera = this.getScene().activeCamera; + } + return this.absolutePosition.subtract(camera.position).length(); + }; + AbstractMesh.prototype.applyImpulse = function (force, contactPoint) { + if (!this.physicsImpostor) { + return; + } + this.physicsImpostor.applyImpulse(force, contactPoint); + }; + AbstractMesh.prototype.setPhysicsLinkWith = function (otherMesh, pivot1, pivot2, options) { + if (!this.physicsImpostor || !otherMesh.physicsImpostor) { + return; + } + this.physicsImpostor.createJoint(otherMesh.physicsImpostor, BABYLON.PhysicsJoint.HingeJoint, { + mainPivot: pivot1, + connectedPivot: pivot2, + nativeParams: options + }); + }; + /** + * @Deprecated + */ + AbstractMesh.prototype.updatePhysicsBodyPosition = function () { + BABYLON.Tools.Warn("updatePhysicsBodyPosition() is deprecated, please use updatePhysicsBody()"); + this.updatePhysicsBody(); + }; + /** + * @Deprecated + * Calling this function is not needed anymore. + * The physics engine takes care of transofmration automatically. + */ + AbstractMesh.prototype.updatePhysicsBody = function () { + //Unneeded + }; + Object.defineProperty(AbstractMesh.prototype, "checkCollisions", { + // Collisions + get: function () { + return this._checkCollisions; + }, + set: function (collisionEnabled) { + this._checkCollisions = collisionEnabled; + if (this.getScene().workerCollisions) { + this.getScene().collisionCoordinator.onMeshUpdated(this); + } + }, + enumerable: true, + configurable: true + }); + AbstractMesh.prototype.moveWithCollisions = function (velocity) { + var globalPosition = this.getAbsolutePosition(); + globalPosition.subtractFromFloatsToRef(0, this.ellipsoid.y, 0, this._oldPositionForCollisions); + this._oldPositionForCollisions.addInPlace(this.ellipsoidOffset); + this._collider.radius = this.ellipsoid; + this.getScene().collisionCoordinator.getNewPosition(this._oldPositionForCollisions, velocity, this._collider, 3, this, this._onCollisionPositionChange, this.uniqueId); + }; + // Submeshes octree + /** + * This function will create an octree to help select the right submeshes for rendering, picking and collisions + * Please note that you must have a decent number of submeshes to get performance improvements when using octree + */ + AbstractMesh.prototype.createOrUpdateSubmeshesOctree = function (maxCapacity, maxDepth) { + if (maxCapacity === void 0) { maxCapacity = 64; } + if (maxDepth === void 0) { maxDepth = 2; } + if (!this._submeshesOctree) { + this._submeshesOctree = new BABYLON.Octree(BABYLON.Octree.CreationFuncForSubMeshes, maxCapacity, maxDepth); + } + this.computeWorldMatrix(true); + // Update octree + var bbox = this.getBoundingInfo().boundingBox; + this._submeshesOctree.update(bbox.minimumWorld, bbox.maximumWorld, this.subMeshes); + return this._submeshesOctree; + }; + // Collisions + AbstractMesh.prototype._collideForSubMesh = function (subMesh, transformMatrix, collider) { + this._generatePointsArray(); + // Transformation + if (!subMesh._lastColliderWorldVertices || !subMesh._lastColliderTransformMatrix.equals(transformMatrix)) { + subMesh._lastColliderTransformMatrix = transformMatrix.clone(); + subMesh._lastColliderWorldVertices = []; + subMesh._trianglePlanes = []; + var start = subMesh.verticesStart; + var end = (subMesh.verticesStart + subMesh.verticesCount); + for (var i = start; i < end; i++) { + subMesh._lastColliderWorldVertices.push(BABYLON.Vector3.TransformCoordinates(this._positions[i], transformMatrix)); + } + } + // Collide + collider._collide(subMesh._trianglePlanes, subMesh._lastColliderWorldVertices, this.getIndices(), subMesh.indexStart, subMesh.indexStart + subMesh.indexCount, subMesh.verticesStart, !!subMesh.getMaterial()); + if (collider.collisionFound) { + collider.collidedMesh = this; + } + }; + AbstractMesh.prototype._processCollisionsForSubMeshes = function (collider, transformMatrix) { + var subMeshes; + var len; + // Octrees + if (this._submeshesOctree && this.useOctreeForCollisions) { + var radius = collider.velocityWorldLength + Math.max(collider.radius.x, collider.radius.y, collider.radius.z); + var intersections = this._submeshesOctree.intersects(collider.basePointWorld, radius); + len = intersections.length; + subMeshes = intersections.data; + } + else { + subMeshes = this.subMeshes; + len = subMeshes.length; + } + for (var index = 0; index < len; index++) { + var subMesh = subMeshes[index]; + // Bounding test + if (len > 1 && !subMesh._checkCollision(collider)) + continue; + this._collideForSubMesh(subMesh, transformMatrix, collider); + } + }; + AbstractMesh.prototype._checkCollision = function (collider) { + // Bounding box test + if (!this._boundingInfo._checkCollision(collider)) + return; + // Transformation matrix + BABYLON.Matrix.ScalingToRef(1.0 / collider.radius.x, 1.0 / collider.radius.y, 1.0 / collider.radius.z, this._collisionsScalingMatrix); + this.worldMatrixFromCache.multiplyToRef(this._collisionsScalingMatrix, this._collisionsTransformMatrix); + this._processCollisionsForSubMeshes(collider, this._collisionsTransformMatrix); + }; + // Picking + AbstractMesh.prototype._generatePointsArray = function () { + return false; + }; + AbstractMesh.prototype.intersects = function (ray, fastCheck) { + var pickingInfo = new BABYLON.PickingInfo(); + if (!this.subMeshes || !this._boundingInfo || !ray.intersectsSphere(this._boundingInfo.boundingSphere) || !ray.intersectsBox(this._boundingInfo.boundingBox)) { + return pickingInfo; + } + if (!this._generatePointsArray()) { + return pickingInfo; + } + var intersectInfo = null; + // Octrees + var subMeshes; + var len; + if (this._submeshesOctree && this.useOctreeForPicking) { + var worldRay = BABYLON.Ray.Transform(ray, this.getWorldMatrix()); + var intersections = this._submeshesOctree.intersectsRay(worldRay); + len = intersections.length; + subMeshes = intersections.data; + } + else { + subMeshes = this.subMeshes; + len = subMeshes.length; + } + for (var index = 0; index < len; index++) { + var subMesh = subMeshes[index]; + // Bounding test + if (len > 1 && !subMesh.canIntersects(ray)) + continue; + var currentIntersectInfo = subMesh.intersects(ray, this._positions, this.getIndices(), fastCheck); + if (currentIntersectInfo) { + if (fastCheck || !intersectInfo || currentIntersectInfo.distance < intersectInfo.distance) { + intersectInfo = currentIntersectInfo; + intersectInfo.subMeshId = index; + if (fastCheck) { + break; + } + } + } + } + if (intersectInfo) { + // Get picked point + var world = this.getWorldMatrix(); + var worldOrigin = BABYLON.Vector3.TransformCoordinates(ray.origin, world); + var direction = ray.direction.clone(); + direction = direction.scale(intersectInfo.distance); + var worldDirection = BABYLON.Vector3.TransformNormal(direction, world); + var pickedPoint = worldOrigin.add(worldDirection); + // Return result + pickingInfo.hit = true; + pickingInfo.distance = BABYLON.Vector3.Distance(worldOrigin, pickedPoint); + pickingInfo.pickedPoint = pickedPoint; + pickingInfo.pickedMesh = this; + pickingInfo.bu = intersectInfo.bu; + pickingInfo.bv = intersectInfo.bv; + pickingInfo.faceId = intersectInfo.faceId; + pickingInfo.subMeshId = intersectInfo.subMeshId; + return pickingInfo; + } + return pickingInfo; + }; + AbstractMesh.prototype.clone = function (name, newParent, doNotCloneChildren) { + return null; + }; + AbstractMesh.prototype.releaseSubMeshes = function () { + if (this.subMeshes) { + while (this.subMeshes.length) { + this.subMeshes[0].dispose(); + } + } + else { + this.subMeshes = new Array(); + } + }; + AbstractMesh.prototype.dispose = function (doNotRecurse) { + var _this = this; + var index; + // Action manager + if (this.actionManager) { + this.actionManager.dispose(); + this.actionManager = null; + } + // Skeleton + this.skeleton = null; + // Animations + this.getScene().stopAnimation(this); + // Physics + if (this.physicsImpostor) { + this.physicsImpostor.dispose(); + } + // Intersections in progress + for (index = 0; index < this._intersectionsInProgress.length; index++) { + var other = this._intersectionsInProgress[index]; + var pos = other._intersectionsInProgress.indexOf(this); + other._intersectionsInProgress.splice(pos, 1); + } + this._intersectionsInProgress = []; + // Lights + var lights = this.getScene().lights; + lights.forEach(function (light) { + var meshIndex = light.includedOnlyMeshes.indexOf(_this); + if (meshIndex !== -1) { + light.includedOnlyMeshes.splice(meshIndex, 1); + } + meshIndex = light.excludedMeshes.indexOf(_this); + if (meshIndex !== -1) { + light.excludedMeshes.splice(meshIndex, 1); + } + // Shadow generators + var generator = light.getShadowGenerator(); + if (generator) { + meshIndex = generator.getShadowMap().renderList.indexOf(_this); + if (meshIndex !== -1) { + generator.getShadowMap().renderList.splice(meshIndex, 1); + } + } + }); + // Edges + if (this._edgesRenderer) { + this._edgesRenderer.dispose(); + this._edgesRenderer = null; + } + // SubMeshes + this.releaseSubMeshes(); + // Engine + this.getScene().getEngine().unbindAllAttributes(); + // Remove from scene + this.getScene().removeMesh(this); + if (!doNotRecurse) { + // Particles + for (index = 0; index < this.getScene().particleSystems.length; index++) { + if (this.getScene().particleSystems[index].emitter === this) { + this.getScene().particleSystems[index].dispose(); + index--; + } + } + // Children + var objects = this.getDescendants(true); + for (index = 0; index < objects.length; index++) { + objects[index].dispose(); + } + } + else { + var childMeshes = this.getChildMeshes(true); + for (index = 0; index < childMeshes.length; index++) { + var child = childMeshes[index]; + child.parent = null; + child.computeWorldMatrix(true); + } + } + this.onAfterWorldMatrixUpdateObservable.clear(); + this.onCollideObservable.clear(); + this.onCollisionPositionChangeObservable.clear(); + this._isDisposed = true; + _super.prototype.dispose.call(this); + }; + AbstractMesh.prototype.getDirection = function (localAxis) { + var result = BABYLON.Vector3.Zero(); + this.getDirectionToRef(localAxis, result); + return result; + }; + AbstractMesh.prototype.getDirectionToRef = function (localAxis, result) { + BABYLON.Vector3.TransformNormalToRef(localAxis, this.getWorldMatrix(), result); + }; + AbstractMesh.prototype.setPivotPoint = function (point, space) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + if (this.getScene().getRenderId() == 0) { + this.computeWorldMatrix(true); + } + var wm = this.getWorldMatrix(); + if (space == BABYLON.Space.WORLD) { + var tmat = BABYLON.Tmp.Matrix[0]; + wm.invertToRef(tmat); + point = BABYLON.Vector3.TransformCoordinates(point, tmat); + } + BABYLON.Vector3.TransformCoordinatesToRef(point, wm, this.position); + this._pivotMatrix.m[12] = -point.x; + this._pivotMatrix.m[13] = -point.y; + this._pivotMatrix.m[14] = -point.z; + this._cache.pivotMatrixUpdated = true; + }; + AbstractMesh.prototype.getPivotPoint = function () { + var point = BABYLON.Vector3.Zero(); + this.getPivotPointToRef(point); + return point; + }; + AbstractMesh.prototype.getPivotPointToRef = function (result) { + result.x = -this._pivotMatrix.m[12]; + result.y = -this._pivotMatrix.m[13]; + result.z = -this._pivotMatrix.m[14]; + }; + AbstractMesh.prototype.getAbsolutePivotPoint = function () { + var point = BABYLON.Vector3.Zero(); + this.getAbsolutePivotPointToRef(point); + return point; + }; + AbstractMesh.prototype.getAbsolutePivotPointToRef = function (result) { + result.x = this._pivotMatrix.m[12]; + result.y = this._pivotMatrix.m[13]; + result.z = this._pivotMatrix.m[14]; + this.getPivotPointToRef(result); + BABYLON.Vector3.TransformCoordinatesToRef(result, this.getWorldMatrix(), result); + }; + // Statics + AbstractMesh._BILLBOARDMODE_NONE = 0; + AbstractMesh._BILLBOARDMODE_X = 1; + AbstractMesh._BILLBOARDMODE_Y = 2; + AbstractMesh._BILLBOARDMODE_Z = 4; + AbstractMesh._BILLBOARDMODE_ALL = 7; + AbstractMesh._rotationAxisCache = new BABYLON.Quaternion(); + AbstractMesh._lookAtVectorCache = new BABYLON.Vector3(0, 0, 0); + return AbstractMesh; + }(BABYLON.Node)); + BABYLON.AbstractMesh = AbstractMesh; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.abstractMesh.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var Light = (function (_super) { + __extends(Light, _super); + function Light(name, scene) { + _super.call(this, name, scene); + this.diffuse = new BABYLON.Color3(1.0, 1.0, 1.0); + this.specular = new BABYLON.Color3(1.0, 1.0, 1.0); + this.intensity = 1.0; + this.range = Number.MAX_VALUE; + this.includeOnlyWithLayerMask = 0; + this.includedOnlyMeshes = new Array(); + this.excludedMeshes = new Array(); + this.excludeWithLayerMask = 0; + this.lightmapMode = 0; + // PBR Properties. + this.radius = 0.00001; + this._excludedMeshesIds = new Array(); + this._includedOnlyMeshesIds = new Array(); + scene.addLight(this); + } + Object.defineProperty(Light, "LIGHTMAP_DEFAULT", { + /** + * If every light affecting the material is in this lightmapMode, + * material.lightmapTexture adds or multiplies + * (depends on material.useLightmapAsShadowmap) + * after every other light calculations. + */ + get: function () { + return Light._LIGHTMAP_DEFAULT; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Light, "LIGHTMAP_SPECULAR", { + /** + * material.lightmapTexture as only diffuse lighting from this light + * adds pnly specular lighting from this light + * adds dynamic shadows + */ + get: function () { + return Light._LIGHTMAP_SPECULAR; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Light, "LIGHTMAP_SHADOWSONLY", { + /** + * material.lightmapTexture as only lighting + * no light calculation from this light + * only adds dynamic shadows from this light + */ + get: function () { + return Light._LIGHTMAP_SHADOWSONLY; + }, + enumerable: true, + configurable: true + }); + /** + * @param {boolean} fullDetails - support for multiple levels of logging within scene loading + */ + Light.prototype.toString = function (fullDetails) { + var ret = "Name: " + this.name; + ret += ", type: " + (["Point", "Directional", "Spot", "Hemispheric"])[this.getTypeID()]; + if (this.animations) { + for (var i = 0; i < this.animations.length; i++) { + ret += ", animation[0]: " + this.animations[i].toString(fullDetails); + } + } + if (fullDetails) { + } + return ret; + }; + Light.prototype.getShadowGenerator = function () { + return this._shadowGenerator; + }; + Light.prototype.getAbsolutePosition = function () { + return BABYLON.Vector3.Zero(); + }; + Light.prototype.transferToEffect = function (effect, uniformName0, uniformName1) { + }; + Light.prototype._getWorldMatrix = function () { + return BABYLON.Matrix.Identity(); + }; + Light.prototype.canAffectMesh = function (mesh) { + if (!mesh) { + return true; + } + if (this.includedOnlyMeshes.length > 0 && this.includedOnlyMeshes.indexOf(mesh) === -1) { + return false; + } + if (this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(mesh) !== -1) { + return false; + } + if (this.includeOnlyWithLayerMask !== 0 && (this.includeOnlyWithLayerMask & mesh.layerMask) === 0) { + return false; + } + if (this.excludeWithLayerMask !== 0 && this.excludeWithLayerMask & mesh.layerMask) { + return false; + } + return true; + }; + Light.prototype.getWorldMatrix = function () { + this._currentRenderId = this.getScene().getRenderId(); + var worldMatrix = this._getWorldMatrix(); + if (this.parent && this.parent.getWorldMatrix) { + if (!this._parentedWorldMatrix) { + this._parentedWorldMatrix = BABYLON.Matrix.Identity(); + } + worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._parentedWorldMatrix); + this._markSyncedWithParent(); + return this._parentedWorldMatrix; + } + return worldMatrix; + }; + Light.prototype.dispose = function () { + if (this._shadowGenerator) { + this._shadowGenerator.dispose(); + this._shadowGenerator = null; + } + // Animations + this.getScene().stopAnimation(this); + // Remove from scene + this.getScene().removeLight(this); + _super.prototype.dispose.call(this); + }; + Light.prototype.getTypeID = function () { + return 0; + }; + Light.prototype.clone = function (name) { + return BABYLON.SerializationHelper.Clone(Light.GetConstructorFromName(this.getTypeID(), name, this.getScene()), this); + }; + Light.prototype.serialize = function () { + var serializationObject = BABYLON.SerializationHelper.Serialize(this); + // Type + serializationObject.type = this.getTypeID(); + // Parent + if (this.parent) { + serializationObject.parentId = this.parent.id; + } + // Inclusion / exclusions + if (this.excludedMeshes.length > 0) { + serializationObject.excludedMeshesIds = []; + this.excludedMeshes.forEach(function (mesh) { + serializationObject.excludedMeshesIds.push(mesh.id); + }); + } + if (this.includedOnlyMeshes.length > 0) { + serializationObject.includedOnlyMeshesIds = []; + this.includedOnlyMeshes.forEach(function (mesh) { + serializationObject.includedOnlyMeshesIds.push(mesh.id); + }); + } + // Animations + BABYLON.Animation.AppendSerializedAnimations(this, serializationObject); + serializationObject.ranges = this.serializeAnimationRanges(); + return serializationObject; + }; + Light.GetConstructorFromName = function (type, name, scene) { + switch (type) { + case 0: + return function () { return new BABYLON.PointLight(name, BABYLON.Vector3.Zero(), scene); }; + case 1: + return function () { return new BABYLON.DirectionalLight(name, BABYLON.Vector3.Zero(), scene); }; + case 2: + return function () { return new BABYLON.SpotLight(name, BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), 0, 0, scene); }; + case 3: + return function () { return new BABYLON.HemisphericLight(name, BABYLON.Vector3.Zero(), scene); }; + } + }; + Light.Parse = function (parsedLight, scene) { + var light = BABYLON.SerializationHelper.Parse(Light.GetConstructorFromName(parsedLight.type, parsedLight.name, scene), parsedLight, scene); + // Inclusion / exclusions + if (parsedLight.excludedMeshesIds) { + light._excludedMeshesIds = parsedLight.excludedMeshesIds; + } + if (parsedLight.includedOnlyMeshesIds) { + light._includedOnlyMeshesIds = parsedLight.includedOnlyMeshesIds; + } + // Parent + if (parsedLight.parentId) { + light._waitingParentId = parsedLight.parentId; + } + // Animations + if (parsedLight.animations) { + for (var animationIndex = 0; animationIndex < parsedLight.animations.length; animationIndex++) { + var parsedAnimation = parsedLight.animations[animationIndex]; + light.animations.push(BABYLON.Animation.Parse(parsedAnimation)); + } + BABYLON.Node.ParseAnimationRanges(light, parsedLight, scene); + } + if (parsedLight.autoAnimate) { + scene.beginAnimation(light, parsedLight.autoAnimateFrom, parsedLight.autoAnimateTo, parsedLight.autoAnimateLoop, parsedLight.autoAnimateSpeed || 1.0); + } + return light; + }; + //lightmapMode Consts + Light._LIGHTMAP_DEFAULT = 0; + Light._LIGHTMAP_SPECULAR = 1; + Light._LIGHTMAP_SHADOWSONLY = 2; + __decorate([ + BABYLON.serializeAsColor3() + ], Light.prototype, "diffuse", void 0); + __decorate([ + BABYLON.serializeAsColor3() + ], Light.prototype, "specular", void 0); + __decorate([ + BABYLON.serialize() + ], Light.prototype, "intensity", void 0); + __decorate([ + BABYLON.serialize() + ], Light.prototype, "range", void 0); + __decorate([ + BABYLON.serialize() + ], Light.prototype, "includeOnlyWithLayerMask", void 0); + __decorate([ + BABYLON.serialize() + ], Light.prototype, "excludeWithLayerMask", void 0); + __decorate([ + BABYLON.serialize() + ], Light.prototype, "lightmapMode", void 0); + __decorate([ + BABYLON.serialize() + ], Light.prototype, "radius", void 0); + return Light; + }(BABYLON.Node)); + BABYLON.Light = Light; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.light.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var PointLight = (function (_super) { + __extends(PointLight, _super); + function PointLight(name, position, scene) { + _super.call(this, name, scene); + this.position = position; + } + PointLight.prototype.getAbsolutePosition = function () { + return this.transformedPosition ? this.transformedPosition : this.position; + }; + PointLight.prototype.computeTransformedPosition = function () { + if (this.parent && this.parent.getWorldMatrix) { + if (!this.transformedPosition) { + this.transformedPosition = BABYLON.Vector3.Zero(); + } + BABYLON.Vector3.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), this.transformedPosition); + return true; + } + return false; + }; + PointLight.prototype.transferToEffect = function (effect, positionUniformName) { + if (this.parent && this.parent.getWorldMatrix) { + this.computeTransformedPosition(); + effect.setFloat4(positionUniformName, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, 0); + return; + } + effect.setFloat4(positionUniformName, this.position.x, this.position.y, this.position.z, 0); + }; + PointLight.prototype.needCube = function () { + return true; + }; + PointLight.prototype.supportsVSM = function () { + return false; + }; + PointLight.prototype.needRefreshPerFrame = function () { + return false; + }; + PointLight.prototype.getShadowDirection = function (faceIndex) { + switch (faceIndex) { + case 0: + return new BABYLON.Vector3(1, 0, 0); + case 1: + return new BABYLON.Vector3(-1, 0, 0); + case 2: + return new BABYLON.Vector3(0, -1, 0); + case 3: + return new BABYLON.Vector3(0, 1, 0); + case 4: + return new BABYLON.Vector3(0, 0, 1); + case 5: + return new BABYLON.Vector3(0, 0, -1); + } + return BABYLON.Vector3.Zero(); + }; + PointLight.prototype.setShadowProjectionMatrix = function (matrix, viewMatrix, renderList) { + var activeCamera = this.getScene().activeCamera; + BABYLON.Matrix.PerspectiveFovLHToRef(Math.PI / 2, 1.0, activeCamera.minZ, activeCamera.maxZ, matrix); + }; + PointLight.prototype._getWorldMatrix = function () { + if (!this._worldMatrix) { + this._worldMatrix = BABYLON.Matrix.Identity(); + } + BABYLON.Matrix.TranslationToRef(this.position.x, this.position.y, this.position.z, this._worldMatrix); + return this._worldMatrix; + }; + PointLight.prototype.getTypeID = function () { + return 0; + }; + __decorate([ + BABYLON.serializeAsVector3() + ], PointLight.prototype, "position", void 0); + return PointLight; + }(BABYLON.Light)); + BABYLON.PointLight = PointLight; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.pointLight.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var SpotLight = (function (_super) { + __extends(SpotLight, _super); + function SpotLight(name, position, direction, angle, exponent, scene) { + _super.call(this, name, scene); + this.position = position; + this.direction = direction; + this.angle = angle; + this.exponent = exponent; + } + SpotLight.prototype.getAbsolutePosition = function () { + return this.transformedPosition ? this.transformedPosition : this.position; + }; + SpotLight.prototype.setShadowProjectionMatrix = function (matrix, viewMatrix, renderList) { + var activeCamera = this.getScene().activeCamera; + BABYLON.Matrix.PerspectiveFovLHToRef(this.angle, 1.0, activeCamera.minZ, activeCamera.maxZ, matrix); + }; + SpotLight.prototype.needCube = function () { + return false; + }; + SpotLight.prototype.supportsVSM = function () { + return true; + }; + SpotLight.prototype.needRefreshPerFrame = function () { + return false; + }; + SpotLight.prototype.getShadowDirection = function (faceIndex) { + return this.direction; + }; + SpotLight.prototype.setDirectionToTarget = function (target) { + this.direction = BABYLON.Vector3.Normalize(target.subtract(this.position)); + return this.direction; + }; + SpotLight.prototype.computeTransformedPosition = function () { + if (this.parent && this.parent.getWorldMatrix) { + if (!this.transformedPosition) { + this.transformedPosition = BABYLON.Vector3.Zero(); + } + BABYLON.Vector3.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), this.transformedPosition); + return true; + } + return false; + }; + SpotLight.prototype.transferToEffect = function (effect, positionUniformName, directionUniformName) { + var normalizeDirection; + if (this.parent && this.parent.getWorldMatrix) { + if (!this._transformedDirection) { + this._transformedDirection = BABYLON.Vector3.Zero(); + } + this.computeTransformedPosition(); + BABYLON.Vector3.TransformNormalToRef(this.direction, this.parent.getWorldMatrix(), this._transformedDirection); + effect.setFloat4(positionUniformName, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, this.exponent); + normalizeDirection = BABYLON.Vector3.Normalize(this._transformedDirection); + } + else { + effect.setFloat4(positionUniformName, this.position.x, this.position.y, this.position.z, this.exponent); + normalizeDirection = BABYLON.Vector3.Normalize(this.direction); + } + effect.setFloat4(directionUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, Math.cos(this.angle * 0.5)); + }; + SpotLight.prototype._getWorldMatrix = function () { + if (!this._worldMatrix) { + this._worldMatrix = BABYLON.Matrix.Identity(); + } + BABYLON.Matrix.TranslationToRef(this.position.x, this.position.y, this.position.z, this._worldMatrix); + return this._worldMatrix; + }; + SpotLight.prototype.getTypeID = function () { + return 2; + }; + SpotLight.prototype.getRotation = function () { + this.direction.normalize(); + var xaxis = BABYLON.Vector3.Cross(this.direction, BABYLON.Axis.Y); + var yaxis = BABYLON.Vector3.Cross(xaxis, this.direction); + return BABYLON.Vector3.RotationFromAxis(xaxis, yaxis, this.direction); + }; + __decorate([ + BABYLON.serializeAsVector3() + ], SpotLight.prototype, "position", void 0); + __decorate([ + BABYLON.serializeAsVector3() + ], SpotLight.prototype, "direction", void 0); + __decorate([ + BABYLON.serialize() + ], SpotLight.prototype, "angle", void 0); + __decorate([ + BABYLON.serialize() + ], SpotLight.prototype, "exponent", void 0); + return SpotLight; + }(BABYLON.Light)); + BABYLON.SpotLight = SpotLight; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.spotLight.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var HemisphericLight = (function (_super) { + __extends(HemisphericLight, _super); + function HemisphericLight(name, direction, scene) { + _super.call(this, name, scene); + this.groundColor = new BABYLON.Color3(0.0, 0.0, 0.0); + this.direction = direction; + } + HemisphericLight.prototype.setDirectionToTarget = function (target) { + this.direction = BABYLON.Vector3.Normalize(target.subtract(BABYLON.Vector3.Zero())); + return this.direction; + }; + HemisphericLight.prototype.getShadowGenerator = function () { + return null; + }; + HemisphericLight.prototype.transferToEffect = function (effect, directionUniformName, groundColorUniformName) { + var normalizeDirection = BABYLON.Vector3.Normalize(this.direction); + effect.setFloat4(directionUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, 0); + effect.setColor3(groundColorUniformName, this.groundColor.scale(this.intensity)); + }; + HemisphericLight.prototype._getWorldMatrix = function () { + if (!this._worldMatrix) { + this._worldMatrix = BABYLON.Matrix.Identity(); + } + return this._worldMatrix; + }; + HemisphericLight.prototype.getTypeID = function () { + return 3; + }; + __decorate([ + BABYLON.serializeAsColor3() + ], HemisphericLight.prototype, "groundColor", void 0); + __decorate([ + BABYLON.serializeAsVector3() + ], HemisphericLight.prototype, "direction", void 0); + return HemisphericLight; + }(BABYLON.Light)); + BABYLON.HemisphericLight = HemisphericLight; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.hemisphericLight.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var DirectionalLight = (function (_super) { + __extends(DirectionalLight, _super); + function DirectionalLight(name, direction, scene) { + _super.call(this, name, scene); + this.shadowOrthoScale = 0.5; + this.autoUpdateExtends = true; + // Cache + this._orthoLeft = Number.MAX_VALUE; + this._orthoRight = Number.MIN_VALUE; + this._orthoTop = Number.MIN_VALUE; + this._orthoBottom = Number.MAX_VALUE; + this.position = direction.scale(-1); + this.direction = direction; + } + DirectionalLight.prototype.getAbsolutePosition = function () { + return this.transformedPosition ? this.transformedPosition : this.position; + }; + DirectionalLight.prototype.setDirectionToTarget = function (target) { + this.direction = BABYLON.Vector3.Normalize(target.subtract(this.position)); + return this.direction; + }; + DirectionalLight.prototype.setShadowProjectionMatrix = function (matrix, viewMatrix, renderList) { + var activeCamera = this.getScene().activeCamera; + // Check extends + if (this.autoUpdateExtends || this._orthoLeft === Number.MAX_VALUE) { + var tempVector3 = BABYLON.Vector3.Zero(); + this._orthoLeft = Number.MAX_VALUE; + this._orthoRight = Number.MIN_VALUE; + this._orthoTop = Number.MIN_VALUE; + this._orthoBottom = Number.MAX_VALUE; + for (var meshIndex = 0; meshIndex < renderList.length; meshIndex++) { + var mesh = renderList[meshIndex]; + if (!mesh) { + continue; + } + var boundingInfo = mesh.getBoundingInfo(); + if (!boundingInfo) { + continue; + } + var boundingBox = boundingInfo.boundingBox; + for (var index = 0; index < boundingBox.vectorsWorld.length; index++) { + BABYLON.Vector3.TransformCoordinatesToRef(boundingBox.vectorsWorld[index], viewMatrix, tempVector3); + if (tempVector3.x < this._orthoLeft) + this._orthoLeft = tempVector3.x; + if (tempVector3.y < this._orthoBottom) + this._orthoBottom = tempVector3.y; + if (tempVector3.x > this._orthoRight) + this._orthoRight = tempVector3.x; + if (tempVector3.y > this._orthoTop) + this._orthoTop = tempVector3.y; + } + } + } + var xOffset = this._orthoRight - this._orthoLeft; + var yOffset = this._orthoTop - this._orthoBottom; + BABYLON.Matrix.OrthoOffCenterLHToRef(this._orthoLeft - xOffset * this.shadowOrthoScale, this._orthoRight + xOffset * this.shadowOrthoScale, this._orthoBottom - yOffset * this.shadowOrthoScale, this._orthoTop + yOffset * this.shadowOrthoScale, -activeCamera.maxZ, activeCamera.maxZ, matrix); + }; + DirectionalLight.prototype.supportsVSM = function () { + return true; + }; + DirectionalLight.prototype.needRefreshPerFrame = function () { + return true; + }; + DirectionalLight.prototype.needCube = function () { + return false; + }; + DirectionalLight.prototype.getShadowDirection = function (faceIndex) { + return this.direction; + }; + DirectionalLight.prototype.computeTransformedPosition = function () { + if (this.parent && this.parent.getWorldMatrix) { + if (!this.transformedPosition) { + this.transformedPosition = BABYLON.Vector3.Zero(); + } + BABYLON.Vector3.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), this.transformedPosition); + return true; + } + return false; + }; + DirectionalLight.prototype.transferToEffect = function (effect, directionUniformName) { + if (this.parent && this.parent.getWorldMatrix) { + if (!this._transformedDirection) { + this._transformedDirection = BABYLON.Vector3.Zero(); + } + BABYLON.Vector3.TransformNormalToRef(this.direction, this.parent.getWorldMatrix(), this._transformedDirection); + effect.setFloat4(directionUniformName, this._transformedDirection.x, this._transformedDirection.y, this._transformedDirection.z, 1); + return; + } + effect.setFloat4(directionUniformName, this.direction.x, this.direction.y, this.direction.z, 1); + }; + DirectionalLight.prototype._getWorldMatrix = function () { + if (!this._worldMatrix) { + this._worldMatrix = BABYLON.Matrix.Identity(); + } + BABYLON.Matrix.TranslationToRef(this.position.x, this.position.y, this.position.z, this._worldMatrix); + return this._worldMatrix; + }; + DirectionalLight.prototype.getTypeID = function () { + return 1; + }; + __decorate([ + BABYLON.serializeAsVector3() + ], DirectionalLight.prototype, "position", void 0); + __decorate([ + BABYLON.serializeAsVector3() + ], DirectionalLight.prototype, "direction", void 0); + __decorate([ + BABYLON.serialize() + ], DirectionalLight.prototype, "shadowOrthoScale", void 0); + __decorate([ + BABYLON.serialize() + ], DirectionalLight.prototype, "autoUpdateExtends", void 0); + return DirectionalLight; + }(BABYLON.Light)); + BABYLON.DirectionalLight = DirectionalLight; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.directionalLight.js.map + +var BABYLON; +(function (BABYLON) { + var ShadowGenerator = (function () { + function ShadowGenerator(mapSize, light) { + var _this = this; + // Members + this._filter = ShadowGenerator.FILTER_NONE; + this.blurScale = 2; + this._blurBoxOffset = 0; + this._bias = 0.00005; + this._lightDirection = BABYLON.Vector3.Zero(); + this.forceBackFacesOnly = false; + this._darkness = 0; + this._transparencyShadow = false; + this._viewMatrix = BABYLON.Matrix.Zero(); + this._projectionMatrix = BABYLON.Matrix.Zero(); + this._transformMatrix = BABYLON.Matrix.Zero(); + this._worldViewProjection = BABYLON.Matrix.Zero(); + this._currentFaceIndex = 0; + this._currentFaceIndexCache = 0; + this._useFullFloat = true; + this._light = light; + this._scene = light.getScene(); + this._mapSize = mapSize; + light._shadowGenerator = this; + // Texture type fallback from float to int if not supported. + var textureType; + var caps = this._scene.getEngine().getCaps(); + if (caps.textureFloat && caps.textureFloatLinearFiltering && caps.textureFloatRender) { + this._useFullFloat = true; + textureType = BABYLON.Engine.TEXTURETYPE_FLOAT; + } + else { + this._useFullFloat = false; + textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; + } + // Render target + this._shadowMap = new BABYLON.RenderTargetTexture(light.name + "_shadowMap", mapSize, this._scene, false, true, textureType, light.needCube()); + this._shadowMap.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; + this._shadowMap.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; + this._shadowMap.anisotropicFilteringLevel = 1; + this._shadowMap.updateSamplingMode(BABYLON.Texture.NEAREST_SAMPLINGMODE); + this._shadowMap.renderParticles = false; + this._shadowMap.onBeforeRenderObservable.add(function (faceIndex) { + _this._currentFaceIndex = faceIndex; + }); + this._shadowMap.onAfterUnbindObservable.add(function () { + if (!_this.useBlurVarianceShadowMap) { + return; + } + if (!_this._shadowMap2) { + _this._shadowMap2 = new BABYLON.RenderTargetTexture(light.name + "_shadowMap", mapSize, _this._scene, false, true, textureType); + _this._shadowMap2.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; + _this._shadowMap2.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; + _this._shadowMap2.updateSamplingMode(BABYLON.Texture.TRILINEAR_SAMPLINGMODE); + _this._downSamplePostprocess = new BABYLON.PassPostProcess("downScale", 1.0 / _this.blurScale, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, _this._scene.getEngine()); + _this._downSamplePostprocess.onApplyObservable.add(function (effect) { + effect.setTexture("textureSampler", _this._shadowMap); + }); + _this.blurBoxOffset = 1; + } + _this._scene.postProcessManager.directRender([_this._downSamplePostprocess, _this._boxBlurPostprocess], _this._shadowMap2.getInternalTexture()); + }); + // Custom render function + var renderSubMesh = function (subMesh) { + var mesh = subMesh.getRenderingMesh(); + var scene = _this._scene; + var engine = scene.getEngine(); + // Culling + engine.setState(subMesh.getMaterial().backFaceCulling); + // Managing instances + var batch = mesh._getInstancesRenderList(subMesh._id); + if (batch.mustReturn) { + return; + } + var hardwareInstancedRendering = (engine.getCaps().instancedArrays !== null) && (batch.visibleInstances[subMesh._id] !== null) && (batch.visibleInstances[subMesh._id] !== undefined); + if (_this.isReady(subMesh, hardwareInstancedRendering)) { + engine.enableEffect(_this._effect); + mesh._bind(subMesh, _this._effect, BABYLON.Material.TriangleFillMode); + var material = subMesh.getMaterial(); + _this._effect.setMatrix("viewProjection", _this.getTransformMatrix()); + _this._effect.setVector3("lightPosition", _this.getLight().position); + if (_this.getLight().needCube()) { + _this._effect.setFloat2("depthValues", scene.activeCamera.minZ, scene.activeCamera.maxZ); + } + // Alpha test + if (material && material.needAlphaTesting()) { + var alphaTexture = material.getAlphaTestTexture(); + _this._effect.setTexture("diffuseSampler", alphaTexture); + _this._effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix()); + } + // Bones + if (mesh.useBones && mesh.computeBonesUsingShaders) { + _this._effect.setMatrices("mBones", mesh.skeleton.getTransformMatrices(mesh)); + } + if (_this.forceBackFacesOnly) { + engine.setState(true, 0, false, true); + } + // Draw + mesh._processRendering(subMesh, _this._effect, BABYLON.Material.TriangleFillMode, batch, hardwareInstancedRendering, function (isInstance, world) { return _this._effect.setMatrix("world", world); }); + if (_this.forceBackFacesOnly) { + engine.setState(true, 0, false, false); + } + } + else { + // Need to reset refresh rate of the shadowMap + _this._shadowMap.resetRefreshCounter(); + } + }; + this._shadowMap.customRenderFunction = function (opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes) { + var index; + for (index = 0; index < opaqueSubMeshes.length; index++) { + renderSubMesh(opaqueSubMeshes.data[index]); + } + for (index = 0; index < alphaTestSubMeshes.length; index++) { + renderSubMesh(alphaTestSubMeshes.data[index]); + } + if (_this._transparencyShadow) { + for (index = 0; index < transparentSubMeshes.length; index++) { + renderSubMesh(transparentSubMeshes.data[index]); + } + } + }; + this._shadowMap.onClearObservable.add(function (engine) { + if (_this.useBlurVarianceShadowMap || _this.useVarianceShadowMap) { + engine.clear(new BABYLON.Color4(0, 0, 0, 0), true, true, true); + } + else { + engine.clear(new BABYLON.Color4(1.0, 1.0, 1.0, 1.0), true, true, true); + } + }); + } + Object.defineProperty(ShadowGenerator, "FILTER_NONE", { + // Static + get: function () { + return ShadowGenerator._FILTER_NONE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ShadowGenerator, "FILTER_VARIANCESHADOWMAP", { + get: function () { + return ShadowGenerator._FILTER_VARIANCESHADOWMAP; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ShadowGenerator, "FILTER_POISSONSAMPLING", { + get: function () { + return ShadowGenerator._FILTER_POISSONSAMPLING; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ShadowGenerator, "FILTER_BLURVARIANCESHADOWMAP", { + get: function () { + return ShadowGenerator._FILTER_BLURVARIANCESHADOWMAP; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ShadowGenerator.prototype, "bias", { + get: function () { + return this._bias; + }, + set: function (bias) { + this._bias = bias; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ShadowGenerator.prototype, "blurBoxOffset", { + get: function () { + return this._blurBoxOffset; + }, + set: function (value) { + var _this = this; + if (this._blurBoxOffset === value) { + return; + } + this._blurBoxOffset = value; + if (this._boxBlurPostprocess) { + this._boxBlurPostprocess.dispose(); + } + this._boxBlurPostprocess = new BABYLON.PostProcess("DepthBoxBlur", "depthBoxBlur", ["screenSize", "boxOffset"], [], 1.0 / this.blurScale, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, "#define OFFSET " + value); + this._boxBlurPostprocess.onApplyObservable.add(function (effect) { + effect.setFloat2("screenSize", _this._mapSize / _this.blurScale, _this._mapSize / _this.blurScale); + }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ShadowGenerator.prototype, "filter", { + get: function () { + return this._filter; + }, + set: function (value) { + if (this._filter === value) { + return; + } + this._filter = value; + if (this.useVarianceShadowMap || this.useBlurVarianceShadowMap || this.usePoissonSampling) { + this._shadowMap.anisotropicFilteringLevel = 16; + this._shadowMap.updateSamplingMode(BABYLON.Texture.BILINEAR_SAMPLINGMODE); + } + else { + this._shadowMap.anisotropicFilteringLevel = 1; + this._shadowMap.updateSamplingMode(BABYLON.Texture.NEAREST_SAMPLINGMODE); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ShadowGenerator.prototype, "useVarianceShadowMap", { + get: function () { + return this.filter === ShadowGenerator.FILTER_VARIANCESHADOWMAP && this._light.supportsVSM(); + }, + set: function (value) { + this.filter = (value ? ShadowGenerator.FILTER_VARIANCESHADOWMAP : ShadowGenerator.FILTER_NONE); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ShadowGenerator.prototype, "usePoissonSampling", { + get: function () { + return this.filter === ShadowGenerator.FILTER_POISSONSAMPLING || + (!this._light.supportsVSM() && (this.filter === ShadowGenerator.FILTER_VARIANCESHADOWMAP || + this.filter === ShadowGenerator.FILTER_BLURVARIANCESHADOWMAP)); + }, + set: function (value) { + this.filter = (value ? ShadowGenerator.FILTER_POISSONSAMPLING : ShadowGenerator.FILTER_NONE); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ShadowGenerator.prototype, "useBlurVarianceShadowMap", { + get: function () { + return this.filter === ShadowGenerator.FILTER_BLURVARIANCESHADOWMAP && this._light.supportsVSM(); + }, + set: function (value) { + this.filter = (value ? ShadowGenerator.FILTER_BLURVARIANCESHADOWMAP : ShadowGenerator.FILTER_NONE); + }, + enumerable: true, + configurable: true + }); + ShadowGenerator.prototype.isReady = function (subMesh, useInstances) { + var defines = []; + if (this._useFullFloat) { + defines.push("#define FULLFLOAT"); + } + if (this.useVarianceShadowMap || this.useBlurVarianceShadowMap) { + defines.push("#define VSM"); + } + if (this.getLight().needCube()) { + defines.push("#define CUBEMAP"); + } + var attribs = [BABYLON.VertexBuffer.PositionKind]; + var mesh = subMesh.getMesh(); + var material = subMesh.getMaterial(); + // Alpha test + if (material && material.needAlphaTesting()) { + defines.push("#define ALPHATEST"); + if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) { + attribs.push(BABYLON.VertexBuffer.UVKind); + defines.push("#define UV1"); + } + if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) { + var alphaTexture = material.getAlphaTestTexture(); + if (alphaTexture.coordinatesIndex === 1) { + attribs.push(BABYLON.VertexBuffer.UV2Kind); + defines.push("#define UV2"); + } + } + } + // Bones + if (mesh.useBones && mesh.computeBonesUsingShaders) { + attribs.push(BABYLON.VertexBuffer.MatricesIndicesKind); + attribs.push(BABYLON.VertexBuffer.MatricesWeightsKind); + if (mesh.numBoneInfluencers > 4) { + attribs.push(BABYLON.VertexBuffer.MatricesIndicesExtraKind); + attribs.push(BABYLON.VertexBuffer.MatricesWeightsExtraKind); + } + defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers); + defines.push("#define BonesPerMesh " + (mesh.skeleton.bones.length + 1)); + } + else { + defines.push("#define NUM_BONE_INFLUENCERS 0"); + } + // Instances + if (useInstances) { + defines.push("#define INSTANCES"); + attribs.push("world0"); + attribs.push("world1"); + attribs.push("world2"); + attribs.push("world3"); + } + // Get correct effect + var join = defines.join("\n"); + if (this._cachedDefines !== join) { + this._cachedDefines = join; + this._effect = this._scene.getEngine().createEffect("shadowMap", attribs, ["world", "mBones", "viewProjection", "diffuseMatrix", "lightPosition", "depthValues"], ["diffuseSampler"], join); + } + return this._effect.isReady(); + }; + ShadowGenerator.prototype.getShadowMap = function () { + return this._shadowMap; + }; + ShadowGenerator.prototype.getShadowMapForRendering = function () { + if (this._shadowMap2) { + return this._shadowMap2; + } + return this._shadowMap; + }; + ShadowGenerator.prototype.getLight = function () { + return this._light; + }; + // Methods + ShadowGenerator.prototype.getTransformMatrix = function () { + var scene = this._scene; + if (this._currentRenderID === scene.getRenderId() && this._currentFaceIndexCache === this._currentFaceIndex) { + return this._transformMatrix; + } + this._currentRenderID = scene.getRenderId(); + this._currentFaceIndexCache = this._currentFaceIndex; + var lightPosition = this._light.position; + BABYLON.Vector3.NormalizeToRef(this._light.getShadowDirection(this._currentFaceIndex), this._lightDirection); + if (Math.abs(BABYLON.Vector3.Dot(this._lightDirection, BABYLON.Vector3.Up())) === 1.0) { + this._lightDirection.z = 0.0000000000001; // Required to avoid perfectly perpendicular light + } + if (this._light.computeTransformedPosition()) { + lightPosition = this._light.transformedPosition; + } + if (this._light.needRefreshPerFrame() || !this._cachedPosition || !this._cachedDirection || !lightPosition.equals(this._cachedPosition) || !this._lightDirection.equals(this._cachedDirection)) { + this._cachedPosition = lightPosition.clone(); + this._cachedDirection = this._lightDirection.clone(); + BABYLON.Matrix.LookAtLHToRef(lightPosition, lightPosition.add(this._lightDirection), BABYLON.Vector3.Up(), this._viewMatrix); + this._light.setShadowProjectionMatrix(this._projectionMatrix, this._viewMatrix, this.getShadowMap().renderList); + this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix); + } + return this._transformMatrix; + }; + ShadowGenerator.prototype.getDarkness = function () { + return this._darkness; + }; + ShadowGenerator.prototype.setDarkness = function (darkness) { + if (darkness >= 1.0) + this._darkness = 1.0; + else if (darkness <= 0.0) + this._darkness = 0.0; + else + this._darkness = darkness; + }; + ShadowGenerator.prototype.setTransparencyShadow = function (hasShadow) { + this._transparencyShadow = hasShadow; + }; + ShadowGenerator.prototype._packHalf = function (depth) { + var scale = depth * 255.0; + var fract = scale - Math.floor(scale); + return new BABYLON.Vector2(depth - fract / 255.0, fract); + }; + ShadowGenerator.prototype.dispose = function () { + this._shadowMap.dispose(); + if (this._shadowMap2) { + this._shadowMap2.dispose(); + } + if (this._downSamplePostprocess) { + this._downSamplePostprocess.dispose(); + } + if (this._boxBlurPostprocess) { + this._boxBlurPostprocess.dispose(); + } + }; + ShadowGenerator.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.lightId = this._light.id; + serializationObject.mapSize = this.getShadowMap().getRenderSize(); + serializationObject.useVarianceShadowMap = this.useVarianceShadowMap; + serializationObject.usePoissonSampling = this.usePoissonSampling; + serializationObject.forceBackFacesOnly = this.forceBackFacesOnly; + serializationObject.renderList = []; + for (var meshIndex = 0; meshIndex < this.getShadowMap().renderList.length; meshIndex++) { + var mesh = this.getShadowMap().renderList[meshIndex]; + serializationObject.renderList.push(mesh.id); + } + return serializationObject; + }; + ShadowGenerator.Parse = function (parsedShadowGenerator, scene) { + //casting to point light, as light is missing the position attr and typescript complains. + var light = scene.getLightByID(parsedShadowGenerator.lightId); + var shadowGenerator = new ShadowGenerator(parsedShadowGenerator.mapSize, light); + for (var meshIndex = 0; meshIndex < parsedShadowGenerator.renderList.length; meshIndex++) { + var meshes = scene.getMeshesByID(parsedShadowGenerator.renderList[meshIndex]); + meshes.forEach(function (mesh) { + shadowGenerator.getShadowMap().renderList.push(mesh); + }); + } + if (parsedShadowGenerator.usePoissonSampling) { + shadowGenerator.usePoissonSampling = true; + } + else if (parsedShadowGenerator.useVarianceShadowMap) { + shadowGenerator.useVarianceShadowMap = true; + } + else if (parsedShadowGenerator.useBlurVarianceShadowMap) { + shadowGenerator.useBlurVarianceShadowMap = true; + if (parsedShadowGenerator.blurScale) { + shadowGenerator.blurScale = parsedShadowGenerator.blurScale; + } + if (parsedShadowGenerator.blurBoxOffset) { + shadowGenerator.blurBoxOffset = parsedShadowGenerator.blurBoxOffset; + } + } + if (parsedShadowGenerator.bias !== undefined) { + shadowGenerator.bias = parsedShadowGenerator.bias; + } + shadowGenerator.forceBackFacesOnly = parsedShadowGenerator.forceBackFacesOnly; + return shadowGenerator; + }; + ShadowGenerator._FILTER_NONE = 0; + ShadowGenerator._FILTER_VARIANCESHADOWMAP = 1; + ShadowGenerator._FILTER_POISSONSAMPLING = 2; + ShadowGenerator._FILTER_BLURVARIANCESHADOWMAP = 3; + return ShadowGenerator; + }()); + BABYLON.ShadowGenerator = ShadowGenerator; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.shadowGenerator.js.map + +var BABYLON; +(function (BABYLON) { + var intersectBoxAASphere = function (boxMin, boxMax, sphereCenter, sphereRadius) { + if (boxMin.x > sphereCenter.x + sphereRadius) + return false; + if (sphereCenter.x - sphereRadius > boxMax.x) + return false; + if (boxMin.y > sphereCenter.y + sphereRadius) + return false; + if (sphereCenter.y - sphereRadius > boxMax.y) + return false; + if (boxMin.z > sphereCenter.z + sphereRadius) + return false; + if (sphereCenter.z - sphereRadius > boxMax.z) + return false; + return true; + }; + var getLowestRoot = (function () { + var result = { root: 0, found: false }; + return function (a, b, c, maxR) { + result.root = 0; + result.found = false; + var determinant = b * b - 4.0 * a * c; + if (determinant < 0) + return result; + var sqrtD = Math.sqrt(determinant); + var r1 = (-b - sqrtD) / (2.0 * a); + var r2 = (-b + sqrtD) / (2.0 * a); + if (r1 > r2) { + var temp = r2; + r2 = r1; + r1 = temp; + } + if (r1 > 0 && r1 < maxR) { + result.root = r1; + result.found = true; + return result; + } + if (r2 > 0 && r2 < maxR) { + result.root = r2; + result.found = true; + return result; + } + return result; + }; + })(); + var Collider = (function () { + function Collider() { + this.radius = new BABYLON.Vector3(1, 1, 1); + this.retry = 0; + this.basePointWorld = BABYLON.Vector3.Zero(); + this.velocityWorld = BABYLON.Vector3.Zero(); + this.normalizedVelocity = BABYLON.Vector3.Zero(); + this._collisionPoint = BABYLON.Vector3.Zero(); + this._planeIntersectionPoint = BABYLON.Vector3.Zero(); + this._tempVector = BABYLON.Vector3.Zero(); + this._tempVector2 = BABYLON.Vector3.Zero(); + this._tempVector3 = BABYLON.Vector3.Zero(); + this._tempVector4 = BABYLON.Vector3.Zero(); + this._edge = BABYLON.Vector3.Zero(); + this._baseToVertex = BABYLON.Vector3.Zero(); + this._destinationPoint = BABYLON.Vector3.Zero(); + this._slidePlaneNormal = BABYLON.Vector3.Zero(); + this._displacementVector = BABYLON.Vector3.Zero(); + } + // Methods + Collider.prototype._initialize = function (source, dir, e) { + this.velocity = dir; + BABYLON.Vector3.NormalizeToRef(dir, this.normalizedVelocity); + this.basePoint = source; + source.multiplyToRef(this.radius, this.basePointWorld); + dir.multiplyToRef(this.radius, this.velocityWorld); + this.velocityWorldLength = this.velocityWorld.length(); + this.epsilon = e; + this.collisionFound = false; + }; + Collider.prototype._checkPointInTriangle = function (point, pa, pb, pc, n) { + pa.subtractToRef(point, this._tempVector); + pb.subtractToRef(point, this._tempVector2); + BABYLON.Vector3.CrossToRef(this._tempVector, this._tempVector2, this._tempVector4); + var d = BABYLON.Vector3.Dot(this._tempVector4, n); + if (d < 0) + return false; + pc.subtractToRef(point, this._tempVector3); + BABYLON.Vector3.CrossToRef(this._tempVector2, this._tempVector3, this._tempVector4); + d = BABYLON.Vector3.Dot(this._tempVector4, n); + if (d < 0) + return false; + BABYLON.Vector3.CrossToRef(this._tempVector3, this._tempVector, this._tempVector4); + d = BABYLON.Vector3.Dot(this._tempVector4, n); + return d >= 0; + }; + Collider.prototype._canDoCollision = function (sphereCenter, sphereRadius, vecMin, vecMax) { + var distance = BABYLON.Vector3.Distance(this.basePointWorld, sphereCenter); + var max = Math.max(this.radius.x, this.radius.y, this.radius.z); + if (distance > this.velocityWorldLength + max + sphereRadius) { + return false; + } + if (!intersectBoxAASphere(vecMin, vecMax, this.basePointWorld, this.velocityWorldLength + max)) + return false; + return true; + }; + Collider.prototype._testTriangle = function (faceIndex, trianglePlaneArray, p1, p2, p3, hasMaterial) { + var t0; + var embeddedInPlane = false; + //defensive programming, actually not needed. + if (!trianglePlaneArray) { + trianglePlaneArray = []; + } + if (!trianglePlaneArray[faceIndex]) { + trianglePlaneArray[faceIndex] = new BABYLON.Plane(0, 0, 0, 0); + trianglePlaneArray[faceIndex].copyFromPoints(p1, p2, p3); + } + var trianglePlane = trianglePlaneArray[faceIndex]; + if ((!hasMaterial) && !trianglePlane.isFrontFacingTo(this.normalizedVelocity, 0)) + return; + var signedDistToTrianglePlane = trianglePlane.signedDistanceTo(this.basePoint); + var normalDotVelocity = BABYLON.Vector3.Dot(trianglePlane.normal, this.velocity); + if (normalDotVelocity == 0) { + if (Math.abs(signedDistToTrianglePlane) >= 1.0) + return; + embeddedInPlane = true; + t0 = 0; + } + else { + t0 = (-1.0 - signedDistToTrianglePlane) / normalDotVelocity; + var t1 = (1.0 - signedDistToTrianglePlane) / normalDotVelocity; + if (t0 > t1) { + var temp = t1; + t1 = t0; + t0 = temp; + } + if (t0 > 1.0 || t1 < 0.0) + return; + if (t0 < 0) + t0 = 0; + if (t0 > 1.0) + t0 = 1.0; + } + this._collisionPoint.copyFromFloats(0, 0, 0); + var found = false; + var t = 1.0; + if (!embeddedInPlane) { + this.basePoint.subtractToRef(trianglePlane.normal, this._planeIntersectionPoint); + this.velocity.scaleToRef(t0, this._tempVector); + this._planeIntersectionPoint.addInPlace(this._tempVector); + if (this._checkPointInTriangle(this._planeIntersectionPoint, p1, p2, p3, trianglePlane.normal)) { + found = true; + t = t0; + this._collisionPoint.copyFrom(this._planeIntersectionPoint); + } + } + if (!found) { + var velocitySquaredLength = this.velocity.lengthSquared(); + var a = velocitySquaredLength; + this.basePoint.subtractToRef(p1, this._tempVector); + var b = 2.0 * (BABYLON.Vector3.Dot(this.velocity, this._tempVector)); + var c = this._tempVector.lengthSquared() - 1.0; + var lowestRoot = getLowestRoot(a, b, c, t); + if (lowestRoot.found) { + t = lowestRoot.root; + found = true; + this._collisionPoint.copyFrom(p1); + } + this.basePoint.subtractToRef(p2, this._tempVector); + b = 2.0 * (BABYLON.Vector3.Dot(this.velocity, this._tempVector)); + c = this._tempVector.lengthSquared() - 1.0; + lowestRoot = getLowestRoot(a, b, c, t); + if (lowestRoot.found) { + t = lowestRoot.root; + found = true; + this._collisionPoint.copyFrom(p2); + } + this.basePoint.subtractToRef(p3, this._tempVector); + b = 2.0 * (BABYLON.Vector3.Dot(this.velocity, this._tempVector)); + c = this._tempVector.lengthSquared() - 1.0; + lowestRoot = getLowestRoot(a, b, c, t); + if (lowestRoot.found) { + t = lowestRoot.root; + found = true; + this._collisionPoint.copyFrom(p3); + } + p2.subtractToRef(p1, this._edge); + p1.subtractToRef(this.basePoint, this._baseToVertex); + var edgeSquaredLength = this._edge.lengthSquared(); + var edgeDotVelocity = BABYLON.Vector3.Dot(this._edge, this.velocity); + var edgeDotBaseToVertex = BABYLON.Vector3.Dot(this._edge, this._baseToVertex); + a = edgeSquaredLength * (-velocitySquaredLength) + edgeDotVelocity * edgeDotVelocity; + b = edgeSquaredLength * (2.0 * BABYLON.Vector3.Dot(this.velocity, this._baseToVertex)) - 2.0 * edgeDotVelocity * edgeDotBaseToVertex; + c = edgeSquaredLength * (1.0 - this._baseToVertex.lengthSquared()) + edgeDotBaseToVertex * edgeDotBaseToVertex; + lowestRoot = getLowestRoot(a, b, c, t); + if (lowestRoot.found) { + var f = (edgeDotVelocity * lowestRoot.root - edgeDotBaseToVertex) / edgeSquaredLength; + if (f >= 0.0 && f <= 1.0) { + t = lowestRoot.root; + found = true; + this._edge.scaleInPlace(f); + p1.addToRef(this._edge, this._collisionPoint); + } + } + p3.subtractToRef(p2, this._edge); + p2.subtractToRef(this.basePoint, this._baseToVertex); + edgeSquaredLength = this._edge.lengthSquared(); + edgeDotVelocity = BABYLON.Vector3.Dot(this._edge, this.velocity); + edgeDotBaseToVertex = BABYLON.Vector3.Dot(this._edge, this._baseToVertex); + a = edgeSquaredLength * (-velocitySquaredLength) + edgeDotVelocity * edgeDotVelocity; + b = edgeSquaredLength * (2.0 * BABYLON.Vector3.Dot(this.velocity, this._baseToVertex)) - 2.0 * edgeDotVelocity * edgeDotBaseToVertex; + c = edgeSquaredLength * (1.0 - this._baseToVertex.lengthSquared()) + edgeDotBaseToVertex * edgeDotBaseToVertex; + lowestRoot = getLowestRoot(a, b, c, t); + if (lowestRoot.found) { + f = (edgeDotVelocity * lowestRoot.root - edgeDotBaseToVertex) / edgeSquaredLength; + if (f >= 0.0 && f <= 1.0) { + t = lowestRoot.root; + found = true; + this._edge.scaleInPlace(f); + p2.addToRef(this._edge, this._collisionPoint); + } + } + p1.subtractToRef(p3, this._edge); + p3.subtractToRef(this.basePoint, this._baseToVertex); + edgeSquaredLength = this._edge.lengthSquared(); + edgeDotVelocity = BABYLON.Vector3.Dot(this._edge, this.velocity); + edgeDotBaseToVertex = BABYLON.Vector3.Dot(this._edge, this._baseToVertex); + a = edgeSquaredLength * (-velocitySquaredLength) + edgeDotVelocity * edgeDotVelocity; + b = edgeSquaredLength * (2.0 * BABYLON.Vector3.Dot(this.velocity, this._baseToVertex)) - 2.0 * edgeDotVelocity * edgeDotBaseToVertex; + c = edgeSquaredLength * (1.0 - this._baseToVertex.lengthSquared()) + edgeDotBaseToVertex * edgeDotBaseToVertex; + lowestRoot = getLowestRoot(a, b, c, t); + if (lowestRoot.found) { + f = (edgeDotVelocity * lowestRoot.root - edgeDotBaseToVertex) / edgeSquaredLength; + if (f >= 0.0 && f <= 1.0) { + t = lowestRoot.root; + found = true; + this._edge.scaleInPlace(f); + p3.addToRef(this._edge, this._collisionPoint); + } + } + } + if (found) { + var distToCollision = t * this.velocity.length(); + if (!this.collisionFound || distToCollision < this.nearestDistance) { + if (!this.intersectionPoint) { + this.intersectionPoint = this._collisionPoint.clone(); + } + else { + this.intersectionPoint.copyFrom(this._collisionPoint); + } + this.nearestDistance = distToCollision; + this.collisionFound = true; + } + } + }; + Collider.prototype._collide = function (trianglePlaneArray, pts, indices, indexStart, indexEnd, decal, hasMaterial) { + for (var i = indexStart; i < indexEnd; i += 3) { + var p1 = pts[indices[i] - decal]; + var p2 = pts[indices[i + 1] - decal]; + var p3 = pts[indices[i + 2] - decal]; + this._testTriangle(i, trianglePlaneArray, p3, p2, p1, hasMaterial); + } + }; + Collider.prototype._getResponse = function (pos, vel) { + pos.addToRef(vel, this._destinationPoint); + vel.scaleInPlace((this.nearestDistance / vel.length())); + this.basePoint.addToRef(vel, pos); + pos.subtractToRef(this.intersectionPoint, this._slidePlaneNormal); + this._slidePlaneNormal.normalize(); + this._slidePlaneNormal.scaleToRef(this.epsilon, this._displacementVector); + pos.addInPlace(this._displacementVector); + this.intersectionPoint.addInPlace(this._displacementVector); + this._slidePlaneNormal.scaleInPlace(BABYLON.Plane.SignedDistanceToPlaneFromPositionAndNormal(this.intersectionPoint, this._slidePlaneNormal, this._destinationPoint)); + this._destinationPoint.subtractInPlace(this._slidePlaneNormal); + this._destinationPoint.subtractToRef(this.intersectionPoint, vel); + }; + return Collider; + }()); + BABYLON.Collider = Collider; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.collider.js.map + +var BABYLON; +(function (BABYLON) { + //WebWorker code will be inserted to this variable. + BABYLON.CollisionWorker = ""; + (function (WorkerTaskType) { + WorkerTaskType[WorkerTaskType["INIT"] = 0] = "INIT"; + WorkerTaskType[WorkerTaskType["UPDATE"] = 1] = "UPDATE"; + WorkerTaskType[WorkerTaskType["COLLIDE"] = 2] = "COLLIDE"; + })(BABYLON.WorkerTaskType || (BABYLON.WorkerTaskType = {})); + var WorkerTaskType = BABYLON.WorkerTaskType; + (function (WorkerReplyType) { + WorkerReplyType[WorkerReplyType["SUCCESS"] = 0] = "SUCCESS"; + WorkerReplyType[WorkerReplyType["UNKNOWN_ERROR"] = 1] = "UNKNOWN_ERROR"; + })(BABYLON.WorkerReplyType || (BABYLON.WorkerReplyType = {})); + var WorkerReplyType = BABYLON.WorkerReplyType; + var CollisionCoordinatorWorker = (function () { + function CollisionCoordinatorWorker() { + var _this = this; + this._scaledPosition = BABYLON.Vector3.Zero(); + this._scaledVelocity = BABYLON.Vector3.Zero(); + this.onMeshUpdated = function (mesh) { + _this._addUpdateMeshesList[mesh.uniqueId] = CollisionCoordinatorWorker.SerializeMesh(mesh); + }; + this.onGeometryUpdated = function (geometry) { + _this._addUpdateGeometriesList[geometry.id] = CollisionCoordinatorWorker.SerializeGeometry(geometry); + }; + this._afterRender = function () { + if (!_this._init) + return; + if (_this._toRemoveGeometryArray.length == 0 && _this._toRemoveMeshesArray.length == 0 && Object.keys(_this._addUpdateGeometriesList).length == 0 && Object.keys(_this._addUpdateMeshesList).length == 0) { + return; + } + //5 concurrent updates were sent to the web worker and were not yet processed. Abort next update. + //TODO make sure update runs as fast as possible to be able to update 60 FPS. + if (_this._runningUpdated > 4) { + return; + } + ++_this._runningUpdated; + var payload = { + updatedMeshes: _this._addUpdateMeshesList, + updatedGeometries: _this._addUpdateGeometriesList, + removedGeometries: _this._toRemoveGeometryArray, + removedMeshes: _this._toRemoveMeshesArray + }; + var message = { + payload: payload, + taskType: WorkerTaskType.UPDATE + }; + var serializable = []; + for (var id in payload.updatedGeometries) { + if (payload.updatedGeometries.hasOwnProperty(id)) { + //prepare transferables + serializable.push(message.payload.updatedGeometries[id].indices.buffer); + serializable.push(message.payload.updatedGeometries[id].normals.buffer); + serializable.push(message.payload.updatedGeometries[id].positions.buffer); + } + } + _this._worker.postMessage(message, serializable); + _this._addUpdateMeshesList = {}; + _this._addUpdateGeometriesList = {}; + _this._toRemoveGeometryArray = []; + _this._toRemoveMeshesArray = []; + }; + this._onMessageFromWorker = function (e) { + var returnData = e.data; + if (returnData.error != WorkerReplyType.SUCCESS) { + //TODO what errors can be returned from the worker? + BABYLON.Tools.Warn("error returned from worker!"); + return; + } + switch (returnData.taskType) { + case WorkerTaskType.INIT: + _this._init = true; + //Update the worked with ALL of the scene's current state + _this._scene.meshes.forEach(function (mesh) { + _this.onMeshAdded(mesh); + }); + _this._scene.getGeometries().forEach(function (geometry) { + _this.onGeometryAdded(geometry); + }); + break; + case WorkerTaskType.UPDATE: + _this._runningUpdated--; + break; + case WorkerTaskType.COLLIDE: + _this._runningCollisionTask = false; + var returnPayload = returnData.payload; + if (!_this._collisionsCallbackArray[returnPayload.collisionId]) + return; + _this._collisionsCallbackArray[returnPayload.collisionId](returnPayload.collisionId, BABYLON.Vector3.FromArray(returnPayload.newPosition), _this._scene.getMeshByUniqueID(returnPayload.collidedMeshUniqueId)); + //cleanup + _this._collisionsCallbackArray[returnPayload.collisionId] = undefined; + break; + } + }; + this._collisionsCallbackArray = []; + this._init = false; + this._runningUpdated = 0; + this._runningCollisionTask = false; + this._addUpdateMeshesList = {}; + this._addUpdateGeometriesList = {}; + this._toRemoveGeometryArray = []; + this._toRemoveMeshesArray = []; + } + CollisionCoordinatorWorker.prototype.getNewPosition = function (position, velocity, collider, maximumRetry, excludedMesh, onNewPosition, collisionIndex) { + if (!this._init) + return; + if (this._collisionsCallbackArray[collisionIndex] || this._collisionsCallbackArray[collisionIndex + 100000]) + return; + position.divideToRef(collider.radius, this._scaledPosition); + velocity.divideToRef(collider.radius, this._scaledVelocity); + this._collisionsCallbackArray[collisionIndex] = onNewPosition; + var payload = { + collider: { + position: this._scaledPosition.asArray(), + velocity: this._scaledVelocity.asArray(), + radius: collider.radius.asArray() + }, + collisionId: collisionIndex, + excludedMeshUniqueId: excludedMesh ? excludedMesh.uniqueId : null, + maximumRetry: maximumRetry + }; + var message = { + payload: payload, + taskType: WorkerTaskType.COLLIDE + }; + this._worker.postMessage(message); + }; + CollisionCoordinatorWorker.prototype.init = function (scene) { + this._scene = scene; + this._scene.registerAfterRender(this._afterRender); + var workerUrl = BABYLON.WorkerIncluded ? BABYLON.Engine.CodeRepository + "Collisions/babylon.collisionWorker.js" : URL.createObjectURL(new Blob([BABYLON.CollisionWorker], { type: 'application/javascript' })); + this._worker = new Worker(workerUrl); + this._worker.onmessage = this._onMessageFromWorker; + var message = { + payload: {}, + taskType: WorkerTaskType.INIT + }; + this._worker.postMessage(message); + }; + CollisionCoordinatorWorker.prototype.destroy = function () { + this._scene.unregisterAfterRender(this._afterRender); + this._worker.terminate(); + }; + CollisionCoordinatorWorker.prototype.onMeshAdded = function (mesh) { + mesh.registerAfterWorldMatrixUpdate(this.onMeshUpdated); + this.onMeshUpdated(mesh); + }; + CollisionCoordinatorWorker.prototype.onMeshRemoved = function (mesh) { + this._toRemoveMeshesArray.push(mesh.uniqueId); + }; + CollisionCoordinatorWorker.prototype.onGeometryAdded = function (geometry) { + //TODO this will break if the user uses his own function. This should be an array of callbacks! + geometry.onGeometryUpdated = this.onGeometryUpdated; + this.onGeometryUpdated(geometry); + }; + CollisionCoordinatorWorker.prototype.onGeometryDeleted = function (geometry) { + this._toRemoveGeometryArray.push(geometry.id); + }; + CollisionCoordinatorWorker.SerializeMesh = function (mesh) { + var submeshes = []; + if (mesh.subMeshes) { + submeshes = mesh.subMeshes.map(function (sm, idx) { + return { + position: idx, + verticesStart: sm.verticesStart, + verticesCount: sm.verticesCount, + indexStart: sm.indexStart, + indexCount: sm.indexCount, + hasMaterial: !!sm.getMaterial(), + sphereCenter: sm.getBoundingInfo().boundingSphere.centerWorld.asArray(), + sphereRadius: sm.getBoundingInfo().boundingSphere.radiusWorld, + boxMinimum: sm.getBoundingInfo().boundingBox.minimumWorld.asArray(), + boxMaximum: sm.getBoundingInfo().boundingBox.maximumWorld.asArray() + }; + }); + } + var geometryId = null; + if (mesh instanceof BABYLON.Mesh) { + geometryId = mesh.geometry ? mesh.geometry.id : null; + } + else if (mesh instanceof BABYLON.InstancedMesh) { + geometryId = (mesh.sourceMesh && mesh.sourceMesh.geometry) ? mesh.sourceMesh.geometry.id : null; + } + return { + uniqueId: mesh.uniqueId, + id: mesh.id, + name: mesh.name, + geometryId: geometryId, + sphereCenter: mesh.getBoundingInfo().boundingSphere.centerWorld.asArray(), + sphereRadius: mesh.getBoundingInfo().boundingSphere.radiusWorld, + boxMinimum: mesh.getBoundingInfo().boundingBox.minimumWorld.asArray(), + boxMaximum: mesh.getBoundingInfo().boundingBox.maximumWorld.asArray(), + worldMatrixFromCache: mesh.worldMatrixFromCache.asArray(), + subMeshes: submeshes, + checkCollisions: mesh.checkCollisions + }; + }; + CollisionCoordinatorWorker.SerializeGeometry = function (geometry) { + return { + id: geometry.id, + positions: new Float32Array(geometry.getVerticesData(BABYLON.VertexBuffer.PositionKind) || []), + normals: new Float32Array(geometry.getVerticesData(BABYLON.VertexBuffer.NormalKind) || []), + indices: new Int32Array(geometry.getIndices() || []), + }; + }; + return CollisionCoordinatorWorker; + }()); + BABYLON.CollisionCoordinatorWorker = CollisionCoordinatorWorker; + var CollisionCoordinatorLegacy = (function () { + function CollisionCoordinatorLegacy() { + this._scaledPosition = BABYLON.Vector3.Zero(); + this._scaledVelocity = BABYLON.Vector3.Zero(); + this._finalPosition = BABYLON.Vector3.Zero(); + } + CollisionCoordinatorLegacy.prototype.getNewPosition = function (position, velocity, collider, maximumRetry, excludedMesh, onNewPosition, collisionIndex) { + position.divideToRef(collider.radius, this._scaledPosition); + velocity.divideToRef(collider.radius, this._scaledVelocity); + collider.collidedMesh = null; + collider.retry = 0; + collider.initialVelocity = this._scaledVelocity; + collider.initialPosition = this._scaledPosition; + this._collideWithWorld(this._scaledPosition, this._scaledVelocity, collider, maximumRetry, this._finalPosition, excludedMesh); + this._finalPosition.multiplyInPlace(collider.radius); + //run the callback + onNewPosition(collisionIndex, this._finalPosition, collider.collidedMesh); + }; + CollisionCoordinatorLegacy.prototype.init = function (scene) { + this._scene = scene; + }; + CollisionCoordinatorLegacy.prototype.destroy = function () { + //Legacy need no destruction method. + }; + //No update in legacy mode + CollisionCoordinatorLegacy.prototype.onMeshAdded = function (mesh) { }; + CollisionCoordinatorLegacy.prototype.onMeshUpdated = function (mesh) { }; + CollisionCoordinatorLegacy.prototype.onMeshRemoved = function (mesh) { }; + CollisionCoordinatorLegacy.prototype.onGeometryAdded = function (geometry) { }; + CollisionCoordinatorLegacy.prototype.onGeometryUpdated = function (geometry) { }; + CollisionCoordinatorLegacy.prototype.onGeometryDeleted = function (geometry) { }; + CollisionCoordinatorLegacy.prototype._collideWithWorld = function (position, velocity, collider, maximumRetry, finalPosition, excludedMesh) { + if (excludedMesh === void 0) { excludedMesh = null; } + var closeDistance = BABYLON.Engine.CollisionsEpsilon * 10.0; + if (collider.retry >= maximumRetry) { + finalPosition.copyFrom(position); + return; + } + collider._initialize(position, velocity, closeDistance); + // Check all meshes + for (var index = 0; index < this._scene.meshes.length; index++) { + var mesh = this._scene.meshes[index]; + if (mesh.isEnabled() && mesh.checkCollisions && mesh.subMeshes && mesh !== excludedMesh) { + mesh._checkCollision(collider); + } + } + if (!collider.collisionFound) { + position.addToRef(velocity, finalPosition); + return; + } + if (velocity.x !== 0 || velocity.y !== 0 || velocity.z !== 0) { + collider._getResponse(position, velocity); + } + if (velocity.length() <= closeDistance) { + finalPosition.copyFrom(position); + return; + } + collider.retry++; + this._collideWithWorld(position, velocity, collider, maximumRetry, finalPosition, excludedMesh); + }; + return CollisionCoordinatorLegacy; + }()); + BABYLON.CollisionCoordinatorLegacy = CollisionCoordinatorLegacy; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.collisionCoordinator.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var Camera = (function (_super) { + __extends(Camera, _super); + function Camera(name, position, scene) { + _super.call(this, name, scene); + this.upVector = BABYLON.Vector3.Up(); + this.orthoLeft = null; + this.orthoRight = null; + this.orthoBottom = null; + this.orthoTop = null; + this.fov = 0.8; + this.minZ = 1.0; + this.maxZ = 10000.0; + this.inertia = 0.9; + this.mode = Camera.PERSPECTIVE_CAMERA; + this.isIntermediate = false; + this.viewport = new BABYLON.Viewport(0, 0, 1.0, 1.0); + this.layerMask = 0x0FFFFFFF; + this.fovMode = Camera.FOVMODE_VERTICAL_FIXED; + // Camera rig members + this.cameraRigMode = Camera.RIG_MODE_NONE; + this._rigCameras = new Array(); + // Cache + this._computedViewMatrix = BABYLON.Matrix.Identity(); + this._projectionMatrix = new BABYLON.Matrix(); + this._doNotComputeProjectionMatrix = false; + this._postProcesses = new Array(); + this._transformMatrix = BABYLON.Matrix.Zero(); + this._webvrViewMatrix = BABYLON.Matrix.Identity(); + this._activeMeshes = new BABYLON.SmartArray(256); + this._globalPosition = BABYLON.Vector3.Zero(); + this._refreshFrustumPlanes = true; + scene.addCamera(this); + if (!scene.activeCamera) { + scene.activeCamera = this; + } + this.position = position; + } + Object.defineProperty(Camera, "PERSPECTIVE_CAMERA", { + get: function () { + return Camera._PERSPECTIVE_CAMERA; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Camera, "ORTHOGRAPHIC_CAMERA", { + get: function () { + return Camera._ORTHOGRAPHIC_CAMERA; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Camera, "FOVMODE_VERTICAL_FIXED", { + get: function () { + return Camera._FOVMODE_VERTICAL_FIXED; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Camera, "FOVMODE_HORIZONTAL_FIXED", { + get: function () { + return Camera._FOVMODE_HORIZONTAL_FIXED; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Camera, "RIG_MODE_NONE", { + get: function () { + return Camera._RIG_MODE_NONE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Camera, "RIG_MODE_STEREOSCOPIC_ANAGLYPH", { + get: function () { + return Camera._RIG_MODE_STEREOSCOPIC_ANAGLYPH; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Camera, "RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL", { + get: function () { + return Camera._RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Camera, "RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED", { + get: function () { + return Camera._RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Camera, "RIG_MODE_STEREOSCOPIC_OVERUNDER", { + get: function () { + return Camera._RIG_MODE_STEREOSCOPIC_OVERUNDER; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Camera, "RIG_MODE_VR", { + get: function () { + return Camera._RIG_MODE_VR; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Camera, "RIG_MODE_WEBVR", { + get: function () { + return Camera._RIG_MODE_WEBVR; + }, + enumerable: true, + configurable: true + }); + /** + * @param {boolean} fullDetails - support for multiple levels of logging within scene loading + */ + Camera.prototype.toString = function (fullDetails) { + var ret = "Name: " + this.name; + ret += ", type: " + this.getTypeName(); + if (this.animations) { + for (var i = 0; i < this.animations.length; i++) { + ret += ", animation[0]: " + this.animations[i].toString(fullDetails); + } + } + if (fullDetails) { + } + return ret; + }; + Object.defineProperty(Camera.prototype, "globalPosition", { + get: function () { + return this._globalPosition; + }, + enumerable: true, + configurable: true + }); + Camera.prototype.getActiveMeshes = function () { + return this._activeMeshes; + }; + Camera.prototype.isActiveMesh = function (mesh) { + return (this._activeMeshes.indexOf(mesh) !== -1); + }; + //Cache + Camera.prototype._initCache = function () { + _super.prototype._initCache.call(this); + this._cache.position = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + this._cache.upVector = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + this._cache.mode = undefined; + this._cache.minZ = undefined; + this._cache.maxZ = undefined; + this._cache.fov = undefined; + this._cache.fovMode = undefined; + this._cache.aspectRatio = undefined; + this._cache.orthoLeft = undefined; + this._cache.orthoRight = undefined; + this._cache.orthoBottom = undefined; + this._cache.orthoTop = undefined; + this._cache.renderWidth = undefined; + this._cache.renderHeight = undefined; + }; + Camera.prototype._updateCache = function (ignoreParentClass) { + if (!ignoreParentClass) { + _super.prototype._updateCache.call(this); + } + var engine = this.getEngine(); + this._cache.position.copyFrom(this.position); + this._cache.upVector.copyFrom(this.upVector); + this._cache.mode = this.mode; + this._cache.minZ = this.minZ; + this._cache.maxZ = this.maxZ; + this._cache.fov = this.fov; + this._cache.fovMode = this.fovMode; + this._cache.aspectRatio = engine.getAspectRatio(this); + this._cache.orthoLeft = this.orthoLeft; + this._cache.orthoRight = this.orthoRight; + this._cache.orthoBottom = this.orthoBottom; + this._cache.orthoTop = this.orthoTop; + this._cache.renderWidth = engine.getRenderWidth(); + this._cache.renderHeight = engine.getRenderHeight(); + }; + Camera.prototype._updateFromScene = function () { + this.updateCache(); + this.update(); + }; + // Synchronized + Camera.prototype._isSynchronized = function () { + return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix(); + }; + Camera.prototype._isSynchronizedViewMatrix = function () { + if (!_super.prototype._isSynchronized.call(this)) + return false; + return this._cache.position.equals(this.position) + && this._cache.upVector.equals(this.upVector) + && this.isSynchronizedWithParent(); + }; + Camera.prototype._isSynchronizedProjectionMatrix = function () { + var check = this._cache.mode === this.mode + && this._cache.minZ === this.minZ + && this._cache.maxZ === this.maxZ; + if (!check) { + return false; + } + var engine = this.getEngine(); + if (this.mode === Camera.PERSPECTIVE_CAMERA) { + check = this._cache.fov === this.fov + && this._cache.fovMode === this.fovMode + && this._cache.aspectRatio === engine.getAspectRatio(this); + } + else { + check = this._cache.orthoLeft === this.orthoLeft + && this._cache.orthoRight === this.orthoRight + && this._cache.orthoBottom === this.orthoBottom + && this._cache.orthoTop === this.orthoTop + && this._cache.renderWidth === engine.getRenderWidth() + && this._cache.renderHeight === engine.getRenderHeight(); + } + return check; + }; + // Controls + Camera.prototype.attachControl = function (element, noPreventDefault) { + }; + Camera.prototype.detachControl = function (element) { + }; + Camera.prototype.update = function () { + if (this.cameraRigMode !== Camera.RIG_MODE_NONE) { + this._updateRigCameras(); + } + this._checkInputs(); + }; + Camera.prototype._checkInputs = function () { + }; + Camera.prototype._cascadePostProcessesToRigCams = function () { + // invalidate framebuffer + if (this._postProcesses.length > 0) { + this._postProcesses[0].markTextureDirty(); + } + // glue the rigPostProcess to the end of the user postprocesses & assign to each sub-camera + for (var i = 0, len = this._rigCameras.length; i < len; i++) { + var cam = this._rigCameras[i]; + var rigPostProcess = cam._rigPostProcess; + // for VR rig, there does not have to be a post process + if (rigPostProcess) { + var isPass = rigPostProcess instanceof BABYLON.PassPostProcess; + if (isPass) { + // any rig which has a PassPostProcess for rig[0], cannot be isIntermediate when there are also user postProcesses + cam.isIntermediate = this._postProcesses.length === 0; + } + cam._postProcesses = this._postProcesses.slice(0).concat(rigPostProcess); + rigPostProcess.markTextureDirty(); + } + else { + cam._postProcesses = this._postProcesses.slice(0); + } + } + }; + Camera.prototype.attachPostProcess = function (postProcess, insertAt) { + if (insertAt === void 0) { insertAt = null; } + if (!postProcess.isReusable() && this._postProcesses.indexOf(postProcess) > -1) { + BABYLON.Tools.Error("You're trying to reuse a post process not defined as reusable."); + return 0; + } + if (insertAt == null || insertAt < 0) { + this._postProcesses.push(postProcess); + } + else { + this._postProcesses.splice(insertAt, 0, postProcess); + } + this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated + return this._postProcesses.indexOf(postProcess); + }; + Camera.prototype.detachPostProcess = function (postProcess, atIndices) { + if (atIndices === void 0) { atIndices = null; } + var result = []; + var i; + var index; + if (!atIndices) { + var idx = this._postProcesses.indexOf(postProcess); + if (idx !== -1) { + this._postProcesses.splice(idx, 1); + } + } + else { + atIndices = (atIndices instanceof Array) ? atIndices : [atIndices]; + // iterate descending, so can just splice as we go + for (i = atIndices.length - 1; i >= 0; i--) { + if (this._postProcesses[atIndices[i]] !== postProcess) { + result.push(i); + continue; + } + this._postProcesses.splice(index, 1); + } + } + this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated + return result; + }; + Camera.prototype.getWorldMatrix = function () { + if (!this._worldMatrix) { + this._worldMatrix = BABYLON.Matrix.Identity(); + } + var viewMatrix = this.getViewMatrix(); + viewMatrix.invertToRef(this._worldMatrix); + return this._worldMatrix; + }; + Camera.prototype._getViewMatrix = function () { + return BABYLON.Matrix.Identity(); + }; + Camera.prototype.getViewMatrix = function (force) { + this._computedViewMatrix = this._computeViewMatrix(force); + if (!force && this._isSynchronizedViewMatrix()) { + return this._computedViewMatrix; + } + this._refreshFrustumPlanes = true; + if (!this.parent || !this.parent.getWorldMatrix) { + this._globalPosition.copyFrom(this.position); + } + else { + if (!this._worldMatrix) { + this._worldMatrix = BABYLON.Matrix.Identity(); + } + this._computedViewMatrix.invertToRef(this._worldMatrix); + this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._computedViewMatrix); + this._globalPosition.copyFromFloats(this._computedViewMatrix.m[12], this._computedViewMatrix.m[13], this._computedViewMatrix.m[14]); + this._computedViewMatrix.invert(); + this._markSyncedWithParent(); + } + this._currentRenderId = this.getScene().getRenderId(); + return this._computedViewMatrix; + }; + Camera.prototype._computeViewMatrix = function (force) { + if (!force && this._isSynchronizedViewMatrix()) { + return this._computedViewMatrix; + } + this._computedViewMatrix = this._getViewMatrix(); + this._currentRenderId = this.getScene().getRenderId(); + return this._computedViewMatrix; + }; + Camera.prototype.freezeProjectionMatrix = function (projection) { + this._doNotComputeProjectionMatrix = true; + if (projection !== undefined) { + this._projectionMatrix = projection; + } + }; + ; + Camera.prototype.unfreezeProjectionMatrix = function () { + this._doNotComputeProjectionMatrix = false; + }; + ; + Camera.prototype.getProjectionMatrix = function (force) { + if (this._doNotComputeProjectionMatrix || (!force && this._isSynchronizedProjectionMatrix())) { + return this._projectionMatrix; + } + this._refreshFrustumPlanes = true; + var engine = this.getEngine(); + var scene = this.getScene(); + if (this.mode === Camera.PERSPECTIVE_CAMERA) { + if (this.minZ <= 0) { + this.minZ = 0.1; + } + if (scene.useRightHandedSystem) { + BABYLON.Matrix.PerspectiveFovRHToRef(this.fov, engine.getAspectRatio(this), this.minZ, this.maxZ, this._projectionMatrix, this.fovMode === Camera.FOVMODE_VERTICAL_FIXED); + } + else { + BABYLON.Matrix.PerspectiveFovLHToRef(this.fov, engine.getAspectRatio(this), this.minZ, this.maxZ, this._projectionMatrix, this.fovMode === Camera.FOVMODE_VERTICAL_FIXED); + } + return this._projectionMatrix; + } + var halfWidth = engine.getRenderWidth() / 2.0; + var halfHeight = engine.getRenderHeight() / 2.0; + if (scene.useRightHandedSystem) { + BABYLON.Matrix.OrthoOffCenterRHToRef(this.orthoLeft || -halfWidth, this.orthoRight || halfWidth, this.orthoBottom || -halfHeight, this.orthoTop || halfHeight, this.minZ, this.maxZ, this._projectionMatrix); + } + else { + BABYLON.Matrix.OrthoOffCenterLHToRef(this.orthoLeft || -halfWidth, this.orthoRight || halfWidth, this.orthoBottom || -halfHeight, this.orthoTop || halfHeight, this.minZ, this.maxZ, this._projectionMatrix); + } + return this._projectionMatrix; + }; + Camera.prototype.getTranformationMatrix = function () { + this._computedViewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix); + return this._transformMatrix; + }; + Camera.prototype.updateFrustumPlanes = function () { + if (!this._refreshFrustumPlanes) { + return; + } + this.getTranformationMatrix(); + if (!this._frustumPlanes) { + this._frustumPlanes = BABYLON.Frustum.GetPlanes(this._transformMatrix); + } + else { + BABYLON.Frustum.GetPlanesToRef(this._transformMatrix, this._frustumPlanes); + } + this._refreshFrustumPlanes = false; + }; + Camera.prototype.isInFrustum = function (target) { + this.updateFrustumPlanes(); + return target.isInFrustum(this._frustumPlanes); + }; + Camera.prototype.isCompletelyInFrustum = function (target) { + this.updateFrustumPlanes(); + return target.isCompletelyInFrustum(this._frustumPlanes); + }; + Camera.prototype.dispose = function () { + // Animations + this.getScene().stopAnimation(this); + // Remove from scene + this.getScene().removeCamera(this); + while (this._rigCameras.length > 0) { + this._rigCameras.pop().dispose(); + } + // Postprocesses + for (var i = 0; i < this._postProcesses.length; ++i) { + this._postProcesses[i].dispose(this); + } + _super.prototype.dispose.call(this); + }; + // ---- Camera rigs section ---- + Camera.prototype.setCameraRigMode = function (mode, rigParams) { + while (this._rigCameras.length > 0) { + this._rigCameras.pop().dispose(); + } + this.cameraRigMode = mode; + this._cameraRigParams = {}; + //we have to implement stereo camera calcultating left and right viewpoints from interaxialDistance and target, + //not from a given angle as it is now, but until that complete code rewriting provisional stereoHalfAngle value is introduced + this._cameraRigParams.interaxialDistance = rigParams.interaxialDistance || 0.0637; + this._cameraRigParams.stereoHalfAngle = BABYLON.Tools.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637); + // create the rig cameras, unless none + if (this.cameraRigMode !== Camera.RIG_MODE_NONE) { + this._rigCameras.push(this.createRigCamera(this.name + "_L", 0)); + this._rigCameras.push(this.createRigCamera(this.name + "_R", 1)); + } + switch (this.cameraRigMode) { + case Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH: + this._rigCameras[0]._rigPostProcess = new BABYLON.PassPostProcess(this.name + "_passthru", 1.0, this._rigCameras[0]); + this._rigCameras[1]._rigPostProcess = new BABYLON.AnaglyphPostProcess(this.name + "_anaglyph", 1.0, this._rigCameras); + break; + case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL: + case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED: + case Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER: + var isStereoscopicHoriz = this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL || this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED; + this._rigCameras[0]._rigPostProcess = new BABYLON.PassPostProcess(this.name + "_passthru", 1.0, this._rigCameras[0]); + this._rigCameras[1]._rigPostProcess = new BABYLON.StereoscopicInterlacePostProcess(this.name + "_stereoInterlace", this._rigCameras, isStereoscopicHoriz); + break; + case Camera.RIG_MODE_VR: + var metrics = rigParams.vrCameraMetrics || BABYLON.VRCameraMetrics.GetDefault(); + this._rigCameras[0]._cameraRigParams.vrMetrics = metrics; + this._rigCameras[0].viewport = new BABYLON.Viewport(0, 0, 0.5, 1.0); + this._rigCameras[0]._cameraRigParams.vrWorkMatrix = new BABYLON.Matrix(); + this._rigCameras[0]._cameraRigParams.vrHMatrix = metrics.leftHMatrix; + this._rigCameras[0]._cameraRigParams.vrPreViewMatrix = metrics.leftPreViewMatrix; + this._rigCameras[0].getProjectionMatrix = this._rigCameras[0]._getVRProjectionMatrix; + this._rigCameras[1]._cameraRigParams.vrMetrics = metrics; + this._rigCameras[1].viewport = new BABYLON.Viewport(0.5, 0, 0.5, 1.0); + this._rigCameras[1]._cameraRigParams.vrWorkMatrix = new BABYLON.Matrix(); + this._rigCameras[1]._cameraRigParams.vrHMatrix = metrics.rightHMatrix; + this._rigCameras[1]._cameraRigParams.vrPreViewMatrix = metrics.rightPreViewMatrix; + this._rigCameras[1].getProjectionMatrix = this._rigCameras[1]._getVRProjectionMatrix; + if (metrics.compensateDistortion) { + this._rigCameras[0]._rigPostProcess = new BABYLON.VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Left", this._rigCameras[0], false, metrics); + this._rigCameras[1]._rigPostProcess = new BABYLON.VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Right", this._rigCameras[1], true, metrics); + } + break; + case Camera.RIG_MODE_WEBVR: + if (rigParams.vrDisplay) { + //var leftEye = rigParams.vrDisplay.getEyeParameters('left'); + //var rightEye = rigParams.vrDisplay.getEyeParameters('right'); + this._rigCameras[0].viewport = new BABYLON.Viewport(0, 0, 0.5, 1.0); + this._rigCameras[0].setCameraRigParameter("left", true); + this._rigCameras[0].setCameraRigParameter("frameData", rigParams.frameData); + //this._rigCameras[0].setCameraRigParameter("vrOffsetMatrix", Matrix.Translation(-leftEye.offset[0], leftEye.offset[1], -leftEye.offset[2])); + this._rigCameras[0]._cameraRigParams.vrWorkMatrix = new BABYLON.Matrix(); + this._rigCameras[0].getProjectionMatrix = this._getWebVRProjectionMatrix; + //this._rigCameras[0]._getViewMatrix = this._getWebVRViewMatrix; + this._rigCameras[1].viewport = new BABYLON.Viewport(0.5, 0, 0.5, 1.0); + this._rigCameras[1].setCameraRigParameter("frameData", rigParams.frameData); + //this._rigCameras[1].setCameraRigParameter("vrOffsetMatrix", Matrix.Translation(-rightEye.offset[0], rightEye.offset[1], -rightEye.offset[2])); + this._rigCameras[1]._cameraRigParams.vrWorkMatrix = new BABYLON.Matrix(); + this._rigCameras[1].getProjectionMatrix = this._getWebVRProjectionMatrix; + } + break; + } + this._cascadePostProcessesToRigCams(); + this. + update(); + }; + Camera.prototype._getVRProjectionMatrix = function () { + BABYLON.Matrix.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov, this._cameraRigParams.vrMetrics.aspectRatio, this.minZ, this.maxZ, this._cameraRigParams.vrWorkMatrix); + this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix, this._projectionMatrix); + return this._projectionMatrix; + }; + Camera.prototype._getWebVRProjectionMatrix = function () { + var projectionArray = this._cameraRigParams["left"] ? this._cameraRigParams["frameData"].leftProjectionMatrix : this._cameraRigParams["frameData"].rightProjectionMatrix; + //babylon compatible matrix + [8, 9, 10, 11].forEach(function (num) { + projectionArray[num] *= -1; + }); + BABYLON.Matrix.FromArrayToRef(projectionArray, 0, this._projectionMatrix); + return this._projectionMatrix; + }; + //Can be used, but we'll use the free camera's view matrix calculation + Camera.prototype._getWebVRViewMatrix = function () { + var projectionArray = this._cameraRigParams["left"] ? this._cameraRigParams["frameData"].leftViewMatrix : this._cameraRigParams["frameData"].rightViewMatrix; + //babylon compatible matrix + [8, 9, 10, 11].forEach(function (num) { + projectionArray[num] *= -1; + }); + BABYLON.Matrix.FromArrayToRef(projectionArray, 0, this._webvrViewMatrix); + return this._webvrViewMatrix; + }; + Camera.prototype.setCameraRigParameter = function (name, value) { + if (!this._cameraRigParams) { + this._cameraRigParams = {}; + } + this._cameraRigParams[name] = value; + //provisionnally: + if (name === "interaxialDistance") { + this._cameraRigParams.stereoHalfAngle = BABYLON.Tools.ToRadians(value / 0.0637); + } + }; + /** + * needs to be overridden by children so sub has required properties to be copied + */ + Camera.prototype.createRigCamera = function (name, cameraIndex) { + return null; + }; + /** + * May need to be overridden by children + */ + Camera.prototype._updateRigCameras = function () { + for (var i = 0; i < this._rigCameras.length; i++) { + this._rigCameras[i].minZ = this.minZ; + this._rigCameras[i].maxZ = this.maxZ; + this._rigCameras[i].fov = this.fov; + } + // only update viewport when ANAGLYPH + if (this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH) { + this._rigCameras[0].viewport = this._rigCameras[1].viewport = this.viewport; + } + }; + Camera.prototype._setupInputs = function () { + }; + Camera.prototype.serialize = function () { + var serializationObject = BABYLON.SerializationHelper.Serialize(this); + // Type + serializationObject.type = this.getTypeName(); + // Parent + if (this.parent) { + serializationObject.parentId = this.parent.id; + } + if (this.inputs) { + this.inputs.serialize(serializationObject); + } + // Animations + BABYLON.Animation.AppendSerializedAnimations(this, serializationObject); + serializationObject.ranges = this.serializeAnimationRanges(); + return serializationObject; + }; + Camera.prototype.getTypeName = function () { + return "Camera"; + }; + Camera.prototype.clone = function (name) { + return BABYLON.SerializationHelper.Clone(Camera.GetConstructorFromName(this.getTypeName(), name, this.getScene(), this.interaxialDistance, this.isStereoscopicSideBySide), this); + }; + Camera.prototype.getDirection = function (localAxis) { + var result = BABYLON.Vector3.Zero(); + this.getDirectionToRef(localAxis, result); + return result; + }; + Camera.prototype.getDirectionToRef = function (localAxis, result) { + BABYLON.Vector3.TransformNormalToRef(localAxis, this.getWorldMatrix(), result); + }; + Camera.GetConstructorFromName = function (type, name, scene, interaxial_distance, isStereoscopicSideBySide) { + if (interaxial_distance === void 0) { interaxial_distance = 0; } + if (isStereoscopicSideBySide === void 0) { isStereoscopicSideBySide = true; } + switch (type) { + case "ArcRotateCamera": + return function () { return new BABYLON.ArcRotateCamera(name, 0, 0, 1.0, BABYLON.Vector3.Zero(), scene); }; + case "DeviceOrientationCamera": + return function () { return new BABYLON.DeviceOrientationCamera(name, BABYLON.Vector3.Zero(), scene); }; + case "FollowCamera": + return function () { return new BABYLON.FollowCamera(name, BABYLON.Vector3.Zero(), scene); }; + case "ArcFollowCamera": + return function () { return new BABYLON.ArcFollowCamera(name, 0, 0, 1.0, null, scene); }; + case "GamepadCamera": + return function () { return new BABYLON.GamepadCamera(name, BABYLON.Vector3.Zero(), scene); }; + case "TouchCamera": + return function () { return new BABYLON.TouchCamera(name, BABYLON.Vector3.Zero(), scene); }; + case "VirtualJoysticksCamera": + return function () { return new BABYLON.VirtualJoysticksCamera(name, BABYLON.Vector3.Zero(), scene); }; + case "WebVRFreeCamera": + return function () { return new BABYLON.WebVRFreeCamera(name, BABYLON.Vector3.Zero(), scene); }; + case "VRDeviceOrientationFreeCamera": + return function () { return new BABYLON.VRDeviceOrientationFreeCamera(name, BABYLON.Vector3.Zero(), scene); }; + case "AnaglyphArcRotateCamera": + return function () { return new BABYLON.AnaglyphArcRotateCamera(name, 0, 0, 1.0, BABYLON.Vector3.Zero(), interaxial_distance, scene); }; + case "AnaglyphFreeCamera": + return function () { return new BABYLON.AnaglyphFreeCamera(name, BABYLON.Vector3.Zero(), interaxial_distance, scene); }; + case "AnaglyphGamepadCamera": + return function () { return new BABYLON.AnaglyphGamepadCamera(name, BABYLON.Vector3.Zero(), interaxial_distance, scene); }; + case "AnaglyphUniversalCamera": + return function () { return new BABYLON.AnaglyphUniversalCamera(name, BABYLON.Vector3.Zero(), interaxial_distance, scene); }; + case "StereoscopicArcRotateCamera": + return function () { return new BABYLON.StereoscopicArcRotateCamera(name, 0, 0, 1.0, BABYLON.Vector3.Zero(), interaxial_distance, isStereoscopicSideBySide, scene); }; + case "StereoscopicFreeCamera": + return function () { return new BABYLON.StereoscopicFreeCamera(name, BABYLON.Vector3.Zero(), interaxial_distance, isStereoscopicSideBySide, scene); }; + case "StereoscopicGamepadCamera": + return function () { return new BABYLON.StereoscopicGamepadCamera(name, BABYLON.Vector3.Zero(), interaxial_distance, isStereoscopicSideBySide, scene); }; + case "StereoscopicUniversalCamera": + return function () { return new BABYLON.StereoscopicUniversalCamera(name, BABYLON.Vector3.Zero(), interaxial_distance, isStereoscopicSideBySide, scene); }; + case "FreeCamera": + return function () { return new BABYLON.UniversalCamera(name, BABYLON.Vector3.Zero(), scene); }; + default: + return function () { return new BABYLON.UniversalCamera(name, BABYLON.Vector3.Zero(), scene); }; + } + }; + Camera.Parse = function (parsedCamera, scene) { + var type = parsedCamera.type; + var construct = Camera.GetConstructorFromName(type, parsedCamera.name, scene, parsedCamera.interaxial_distance, parsedCamera.isStereoscopicSideBySide); + var camera = BABYLON.SerializationHelper.Parse(construct, parsedCamera, scene); + // Parent + if (parsedCamera.parentId) { + camera._waitingParentId = parsedCamera.parentId; + } + //If camera has an input manager, let it parse inputs settings + if (camera.inputs) { + camera.inputs.parse(parsedCamera); + camera._setupInputs(); + } + // Target + if (parsedCamera.target) { + if (camera.setTarget) { + camera.setTarget(BABYLON.Vector3.FromArray(parsedCamera.target)); + } + } + // Apply 3d rig, when found + if (parsedCamera.cameraRigMode) { + var rigParams = (parsedCamera.interaxial_distance) ? { interaxialDistance: parsedCamera.interaxial_distance } : {}; + camera.setCameraRigMode(parsedCamera.cameraRigMode, rigParams); + } + // Animations + if (parsedCamera.animations) { + for (var animationIndex = 0; animationIndex < parsedCamera.animations.length; animationIndex++) { + var parsedAnimation = parsedCamera.animations[animationIndex]; + camera.animations.push(BABYLON.Animation.Parse(parsedAnimation)); + } + BABYLON.Node.ParseAnimationRanges(camera, parsedCamera, scene); + } + if (parsedCamera.autoAnimate) { + scene.beginAnimation(camera, parsedCamera.autoAnimateFrom, parsedCamera.autoAnimateTo, parsedCamera.autoAnimateLoop, parsedCamera.autoAnimateSpeed || 1.0); + } + return camera; + }; + // Statics + Camera._PERSPECTIVE_CAMERA = 0; + Camera._ORTHOGRAPHIC_CAMERA = 1; + Camera._FOVMODE_VERTICAL_FIXED = 0; + Camera._FOVMODE_HORIZONTAL_FIXED = 1; + Camera._RIG_MODE_NONE = 0; + Camera._RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10; + Camera._RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11; + Camera._RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12; + Camera._RIG_MODE_STEREOSCOPIC_OVERUNDER = 13; + Camera._RIG_MODE_VR = 20; + Camera._RIG_MODE_WEBVR = 21; + Camera.ForceAttachControlToAlwaysPreventDefault = false; + __decorate([ + BABYLON.serializeAsVector3() + ], Camera.prototype, "position", void 0); + __decorate([ + BABYLON.serializeAsVector3() + ], Camera.prototype, "upVector", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "orthoLeft", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "orthoRight", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "orthoBottom", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "orthoTop", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "fov", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "minZ", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "maxZ", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "inertia", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "mode", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "layerMask", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "fovMode", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "cameraRigMode", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "interaxialDistance", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "isStereoscopicSideBySide", void 0); + return Camera; + }(BABYLON.Node)); + BABYLON.Camera = Camera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.camera.js.map + +var BABYLON; +(function (BABYLON) { + BABYLON.CameraInputTypes = {}; + var CameraInputsManager = (function () { + function CameraInputsManager(camera) { + this.attached = {}; + this.camera = camera; + this.checkInputs = function () { }; + } + CameraInputsManager.prototype.add = function (input) { + var type = input.getSimpleName(); + if (this.attached[type]) { + BABYLON.Tools.Warn("camera input of type " + type + " already exists on camera"); + return; + } + this.attached[type] = input; + input.camera = this.camera; + //for checkInputs, we are dynamically creating a function + //the goal is to avoid the performance penalty of looping for inputs in the render loop + if (input.checkInputs) { + this.checkInputs = this._addCheckInputs(input.checkInputs.bind(input)); + } + if (this.attachedElement) { + input.attachControl(this.attachedElement); + } + }; + CameraInputsManager.prototype.remove = function (inputToRemove) { + for (var cam in this.attached) { + var input = this.attached[cam]; + if (input === inputToRemove) { + input.detachControl(this.attachedElement); + delete this.attached[cam]; + this.rebuildInputCheck(); + } + } + }; + CameraInputsManager.prototype.removeByType = function (inputType) { + for (var cam in this.attached) { + var input = this.attached[cam]; + if (input.getTypeName() === inputType) { + input.detachControl(this.attachedElement); + delete this.attached[cam]; + this.rebuildInputCheck(); + } + } + }; + CameraInputsManager.prototype._addCheckInputs = function (fn) { + var current = this.checkInputs; + return function () { + current(); + fn(); + }; + }; + CameraInputsManager.prototype.attachInput = function (input) { + input.attachControl(this.attachedElement, this.noPreventDefault); + }; + CameraInputsManager.prototype.attachElement = function (element, noPreventDefault) { + if (this.attachedElement) { + return; + } + noPreventDefault = BABYLON.Camera.ForceAttachControlToAlwaysPreventDefault ? false : noPreventDefault; + this.attachedElement = element; + this.noPreventDefault = noPreventDefault; + for (var cam in this.attached) { + var input = this.attached[cam]; + this.attached[cam].attachControl(element, noPreventDefault); + } + }; + CameraInputsManager.prototype.detachElement = function (element) { + if (this.attachedElement !== element) { + return; + } + for (var cam in this.attached) { + var input = this.attached[cam]; + this.attached[cam].detachControl(element); + } + this.attachedElement = null; + }; + CameraInputsManager.prototype.rebuildInputCheck = function () { + this.checkInputs = function () { }; + for (var cam in this.attached) { + var input = this.attached[cam]; + if (input.checkInputs) { + this.checkInputs = this._addCheckInputs(input.checkInputs.bind(input)); + } + } + }; + CameraInputsManager.prototype.clear = function () { + if (this.attachedElement) { + this.detachElement(this.attachedElement); + } + this.attached = {}; + this.attachedElement = null; + this.checkInputs = function () { }; + }; + CameraInputsManager.prototype.serialize = function (serializedCamera) { + var inputs = {}; + for (var cam in this.attached) { + var input = this.attached[cam]; + var res = BABYLON.SerializationHelper.Serialize(input); + inputs[input.getTypeName()] = res; + } + serializedCamera.inputsmgr = inputs; + }; + CameraInputsManager.prototype.parse = function (parsedCamera) { + var parsedInputs = parsedCamera.inputsmgr; + if (parsedInputs) { + this.clear(); + for (var n in parsedInputs) { + var construct = BABYLON.CameraInputTypes[n]; + if (construct) { + var parsedinput = parsedInputs[n]; + var input = BABYLON.SerializationHelper.Parse(function () { return new construct(); }, parsedinput, null); + this.add(input); + } + } + } + else { + //2016-03-08 this part is for managing backward compatibility + for (var n in this.attached) { + var construct = BABYLON.CameraInputTypes[this.attached[n].getTypeName()]; + if (construct) { + var input = BABYLON.SerializationHelper.Parse(function () { return new construct(); }, parsedCamera, null); + this.remove(this.attached[n]); + this.add(input); + } + } + } + }; + return CameraInputsManager; + }()); + BABYLON.CameraInputsManager = CameraInputsManager; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.cameraInputsManager.js.map + + +var BABYLON; +(function (BABYLON) { + var FreeCameraMouseInput = (function () { + function FreeCameraMouseInput(touchEnabled) { + if (touchEnabled === void 0) { touchEnabled = true; } + this.touchEnabled = touchEnabled; + this.buttons = [0, 1, 2]; + this.angularSensibility = 2000.0; + } + FreeCameraMouseInput.prototype.attachControl = function (element, noPreventDefault) { + var _this = this; + var engine = this.camera.getEngine(); + if (!this._pointerInput) { + this._pointerInput = function (p, s) { + var evt = p.event; + if (!_this.touchEnabled && evt.pointerType === "touch") { + return; + } + if (p.type !== BABYLON.PointerEventTypes.POINTERMOVE && _this.buttons.indexOf(evt.button) === -1) { + return; + } + if (p.type === BABYLON.PointerEventTypes.POINTERDOWN) { + try { + evt.srcElement.setPointerCapture(evt.pointerId); + } + catch (e) { + } + _this.previousPosition = { + x: evt.clientX, + y: evt.clientY + }; + if (!noPreventDefault) { + evt.preventDefault(); + element.focus(); + } + } + else if (p.type === BABYLON.PointerEventTypes.POINTERUP) { + try { + evt.srcElement.releasePointerCapture(evt.pointerId); + } + catch (e) { + } + _this.previousPosition = null; + if (!noPreventDefault) { + evt.preventDefault(); + } + } + else if (p.type === BABYLON.PointerEventTypes.POINTERMOVE) { + if (!_this.previousPosition || engine.isPointerLock) { + return; + } + var offsetX = evt.clientX - _this.previousPosition.x; + var offsetY = evt.clientY - _this.previousPosition.y; + if (_this.camera.getScene().useRightHandedSystem) { + _this.camera.cameraRotation.y -= offsetX / _this.angularSensibility; + } + else { + _this.camera.cameraRotation.y += offsetX / _this.angularSensibility; + } + _this.camera.cameraRotation.x += offsetY / _this.angularSensibility; + _this.previousPosition = { + x: evt.clientX, + y: evt.clientY + }; + if (!noPreventDefault) { + evt.preventDefault(); + } + } + }; + } + this._onMouseMove = function (evt) { + if (!engine.isPointerLock) { + return; + } + var offsetX = evt.movementX || evt.mozMovementX || evt.webkitMovementX || evt.msMovementX || 0; + var offsetY = evt.movementY || evt.mozMovementY || evt.webkitMovementY || evt.msMovementY || 0; + if (_this.camera.getScene().useRightHandedSystem) { + _this.camera.cameraRotation.y -= offsetX / _this.angularSensibility; + } + else { + _this.camera.cameraRotation.y += offsetX / _this.angularSensibility; + } + _this.camera.cameraRotation.x += offsetY / _this.angularSensibility; + _this.previousPosition = null; + if (!noPreventDefault) { + evt.preventDefault(); + } + }; + this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, BABYLON.PointerEventTypes.POINTERDOWN | BABYLON.PointerEventTypes.POINTERUP | BABYLON.PointerEventTypes.POINTERMOVE); + element.addEventListener("mousemove", this._onMouseMove, false); + }; + FreeCameraMouseInput.prototype.detachControl = function (element) { + if (this._observer && element) { + this.camera.getScene().onPointerObservable.remove(this._observer); + element.removeEventListener("mousemove", this._onMouseMove); + this._observer = null; + this._onMouseMove = null; + this.previousPosition = null; + } + }; + FreeCameraMouseInput.prototype.getTypeName = function () { + return "FreeCameraMouseInput"; + }; + FreeCameraMouseInput.prototype.getSimpleName = function () { + return "mouse"; + }; + __decorate([ + BABYLON.serialize() + ], FreeCameraMouseInput.prototype, "buttons", void 0); + __decorate([ + BABYLON.serialize() + ], FreeCameraMouseInput.prototype, "angularSensibility", void 0); + return FreeCameraMouseInput; + }()); + BABYLON.FreeCameraMouseInput = FreeCameraMouseInput; + BABYLON.CameraInputTypes["FreeCameraMouseInput"] = FreeCameraMouseInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.freecamera.input.mouse.js.map + + +var BABYLON; +(function (BABYLON) { + var FreeCameraKeyboardMoveInput = (function () { + function FreeCameraKeyboardMoveInput() { + this._keys = []; + this.keysUp = [38]; + this.keysDown = [40]; + this.keysLeft = [37]; + this.keysRight = [39]; + } + FreeCameraKeyboardMoveInput.prototype.attachControl = function (element, noPreventDefault) { + var _this = this; + if (!this._onKeyDown) { + element.tabIndex = 1; + this._onKeyDown = function (evt) { + if (_this.keysUp.indexOf(evt.keyCode) !== -1 || + _this.keysDown.indexOf(evt.keyCode) !== -1 || + _this.keysLeft.indexOf(evt.keyCode) !== -1 || + _this.keysRight.indexOf(evt.keyCode) !== -1) { + var index = _this._keys.indexOf(evt.keyCode); + if (index === -1) { + _this._keys.push(evt.keyCode); + } + if (!noPreventDefault) { + evt.preventDefault(); + } + } + }; + this._onKeyUp = function (evt) { + if (_this.keysUp.indexOf(evt.keyCode) !== -1 || + _this.keysDown.indexOf(evt.keyCode) !== -1 || + _this.keysLeft.indexOf(evt.keyCode) !== -1 || + _this.keysRight.indexOf(evt.keyCode) !== -1) { + var index = _this._keys.indexOf(evt.keyCode); + if (index >= 0) { + _this._keys.splice(index, 1); + } + if (!noPreventDefault) { + evt.preventDefault(); + } + } + }; + element.addEventListener("keydown", this._onKeyDown, false); + element.addEventListener("keyup", this._onKeyUp, false); + BABYLON.Tools.RegisterTopRootEvents([ + { name: "blur", handler: this._onLostFocus } + ]); + } + }; + FreeCameraKeyboardMoveInput.prototype.detachControl = function (element) { + if (this._onKeyDown) { + element.removeEventListener("keydown", this._onKeyDown); + element.removeEventListener("keyup", this._onKeyUp); + BABYLON.Tools.UnregisterTopRootEvents([ + { name: "blur", handler: this._onLostFocus } + ]); + this._keys = []; + this._onKeyDown = null; + this._onKeyUp = null; + } + }; + FreeCameraKeyboardMoveInput.prototype.checkInputs = function () { + if (this._onKeyDown) { + var camera = this.camera; + // Keyboard + for (var index = 0; index < this._keys.length; index++) { + var keyCode = this._keys[index]; + var speed = camera._computeLocalCameraSpeed(); + if (this.keysLeft.indexOf(keyCode) !== -1) { + camera._localDirection.copyFromFloats(-speed, 0, 0); + } + else if (this.keysUp.indexOf(keyCode) !== -1) { + camera._localDirection.copyFromFloats(0, 0, speed); + } + else if (this.keysRight.indexOf(keyCode) !== -1) { + camera._localDirection.copyFromFloats(speed, 0, 0); + } + else if (this.keysDown.indexOf(keyCode) !== -1) { + camera._localDirection.copyFromFloats(0, 0, -speed); + } + if (camera.getScene().useRightHandedSystem) { + camera._localDirection.z *= -1; + } + camera.getViewMatrix().invertToRef(camera._cameraTransformMatrix); + BABYLON.Vector3.TransformNormalToRef(camera._localDirection, camera._cameraTransformMatrix, camera._transformedDirection); + camera.cameraDirection.addInPlace(camera._transformedDirection); + } + } + }; + FreeCameraKeyboardMoveInput.prototype.getTypeName = function () { + return "FreeCameraKeyboardMoveInput"; + }; + FreeCameraKeyboardMoveInput.prototype._onLostFocus = function (e) { + this._keys = []; + }; + FreeCameraKeyboardMoveInput.prototype.getSimpleName = function () { + return "keyboard"; + }; + __decorate([ + BABYLON.serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysUp", void 0); + __decorate([ + BABYLON.serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysDown", void 0); + __decorate([ + BABYLON.serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysLeft", void 0); + __decorate([ + BABYLON.serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysRight", void 0); + return FreeCameraKeyboardMoveInput; + }()); + BABYLON.FreeCameraKeyboardMoveInput = FreeCameraKeyboardMoveInput; + BABYLON.CameraInputTypes["FreeCameraKeyboardMoveInput"] = FreeCameraKeyboardMoveInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.freecamera.input.keyboard.js.map + + +var BABYLON; +(function (BABYLON) { + var FreeCameraTouchInput = (function () { + function FreeCameraTouchInput() { + this._offsetX = null; + this._offsetY = null; + this._pointerCount = 0; + this._pointerPressed = []; + this.touchAngularSensibility = 200000.0; + this.touchMoveSensibility = 250.0; + } + FreeCameraTouchInput.prototype.attachControl = function (element, noPreventDefault) { + var _this = this; + var previousPosition; + if (this._pointerInput === undefined) { + this._onLostFocus = function (evt) { + _this._offsetX = null; + _this._offsetY = null; + }; + this._pointerInput = function (p, s) { + var evt = p.event; + if (evt.pointerType === "mouse") { + return; + } + if (p.type === BABYLON.PointerEventTypes.POINTERDOWN) { + if (!noPreventDefault) { + evt.preventDefault(); + } + _this._pointerPressed.push(evt.pointerId); + if (_this._pointerPressed.length !== 1) { + return; + } + previousPosition = { + x: evt.clientX, + y: evt.clientY + }; + } + else if (p.type === BABYLON.PointerEventTypes.POINTERUP) { + if (!noPreventDefault) { + evt.preventDefault(); + } + var index = _this._pointerPressed.indexOf(evt.pointerId); + if (index === -1) { + return; + } + _this._pointerPressed.splice(index, 1); + if (index != 0) { + return; + } + previousPosition = null; + _this._offsetX = null; + _this._offsetY = null; + } + else if (p.type === BABYLON.PointerEventTypes.POINTERMOVE) { + if (!noPreventDefault) { + evt.preventDefault(); + } + if (!previousPosition) { + return; + } + var index = _this._pointerPressed.indexOf(evt.pointerId); + if (index != 0) { + return; + } + _this._offsetX = evt.clientX - previousPosition.x; + _this._offsetY = -(evt.clientY - previousPosition.y); + } + }; + } + this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, BABYLON.PointerEventTypes.POINTERDOWN | BABYLON.PointerEventTypes.POINTERUP | BABYLON.PointerEventTypes.POINTERMOVE); + element.addEventListener("blur", this._onLostFocus); + }; + FreeCameraTouchInput.prototype.detachControl = function (element) { + if (this._pointerInput && element) { + this.camera.getScene().onPointerObservable.remove(this._observer); + this._observer = null; + element.removeEventListener("blur", this._onLostFocus); + this._onLostFocus = null; + this._pointerPressed = []; + this._offsetX = null; + this._offsetY = null; + this._pointerCount = 0; + } + }; + FreeCameraTouchInput.prototype.checkInputs = function () { + if (this._offsetX) { + var camera = this.camera; + camera.cameraRotation.y += this._offsetX / this.touchAngularSensibility; + if (this._pointerPressed.length > 1) { + camera.cameraRotation.x += -this._offsetY / this.touchAngularSensibility; + } + else { + var speed = camera._computeLocalCameraSpeed(); + var direction = new BABYLON.Vector3(0, 0, speed * this._offsetY / this.touchMoveSensibility); + BABYLON.Matrix.RotationYawPitchRollToRef(camera.rotation.y, camera.rotation.x, 0, camera._cameraRotationMatrix); + camera.cameraDirection.addInPlace(BABYLON.Vector3.TransformCoordinates(direction, camera._cameraRotationMatrix)); + } + } + }; + FreeCameraTouchInput.prototype.getTypeName = function () { + return "FreeCameraTouchInput"; + }; + FreeCameraTouchInput.prototype.getSimpleName = function () { + return "touch"; + }; + __decorate([ + BABYLON.serialize() + ], FreeCameraTouchInput.prototype, "touchAngularSensibility", void 0); + __decorate([ + BABYLON.serialize() + ], FreeCameraTouchInput.prototype, "touchMoveSensibility", void 0); + return FreeCameraTouchInput; + }()); + BABYLON.FreeCameraTouchInput = FreeCameraTouchInput; + BABYLON.CameraInputTypes["FreeCameraTouchInput"] = FreeCameraTouchInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.freecamera.input.touch.js.map + +var BABYLON; +(function (BABYLON) { + var FreeCameraDeviceOrientationInput = (function () { + function FreeCameraDeviceOrientationInput() { + var _this = this; + this._screenOrientationAngle = 0; + this._screenQuaternion = new BABYLON.Quaternion(); + this._alpha = 0; + this._beta = 0; + this._gamma = 0; + this._orientationChanged = function () { + _this._screenOrientationAngle = (window.orientation !== undefined ? +window.orientation : (window.screen.orientation && window.screen.orientation['angle'] ? window.screen.orientation.angle : 0)); + _this._screenOrientationAngle = -BABYLON.Tools.ToRadians(_this._screenOrientationAngle / 2); + _this._screenQuaternion.copyFromFloats(0, Math.sin(_this._screenOrientationAngle), 0, Math.cos(_this._screenOrientationAngle)); + }; + this._deviceOrientation = function (evt) { + _this._alpha = evt.alpha; + _this._beta = evt.beta; + _this._gamma = evt.gamma; + }; + this._constantTranform = new BABYLON.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5)); + this._orientationChanged(); + } + Object.defineProperty(FreeCameraDeviceOrientationInput.prototype, "camera", { + get: function () { + return this._camera; + }, + set: function (camera) { + this._camera = camera; + if (!this._camera.rotationQuaternion) + this._camera.rotationQuaternion = new BABYLON.Quaternion(); + }, + enumerable: true, + configurable: true + }); + FreeCameraDeviceOrientationInput.prototype.attachControl = function (element, noPreventDefault) { + window.addEventListener("orientationchange", this._orientationChanged); + window.addEventListener("deviceorientation", this._deviceOrientation); + //In certain cases, the attach control is called AFTER orientation was changed, + //So this is needed. + this._orientationChanged(); + }; + FreeCameraDeviceOrientationInput.prototype.detachControl = function (element) { + window.removeEventListener("orientationchange", this._orientationChanged); + window.removeEventListener("deviceorientation", this._deviceOrientation); + }; + FreeCameraDeviceOrientationInput.prototype.checkInputs = function () { + //if no device orientation provided, don't update the rotation. + //Only testing against alpha under the assumption thatnorientation will never be so exact when set. + if (!this._alpha) + return; + BABYLON.Quaternion.RotationYawPitchRollToRef(BABYLON.Tools.ToRadians(this._alpha), BABYLON.Tools.ToRadians(this._beta), -BABYLON.Tools.ToRadians(this._gamma), this.camera.rotationQuaternion); + this._camera.rotationQuaternion.multiplyInPlace(this._screenQuaternion); + this._camera.rotationQuaternion.multiplyInPlace(this._constantTranform); + //Mirror on XY Plane + this._camera.rotationQuaternion.z *= -1; + this._camera.rotationQuaternion.w *= -1; + }; + FreeCameraDeviceOrientationInput.prototype.getTypeName = function () { + return "FreeCameraDeviceOrientationInput"; + }; + FreeCameraDeviceOrientationInput.prototype.getSimpleName = function () { + return "deviceOrientation"; + }; + return FreeCameraDeviceOrientationInput; + }()); + BABYLON.FreeCameraDeviceOrientationInput = FreeCameraDeviceOrientationInput; + BABYLON.CameraInputTypes["FreeCameraDeviceOrientationInput"] = FreeCameraDeviceOrientationInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.freecamera.input.deviceorientation.js.map + + +var BABYLON; +(function (BABYLON) { + var FreeCameraGamepadInput = (function () { + function FreeCameraGamepadInput() { + this.gamepadAngularSensibility = 200; + this.gamepadMoveSensibility = 40; + } + FreeCameraGamepadInput.prototype.attachControl = function (element, noPreventDefault) { + var _this = this; + this._gamepads = new BABYLON.Gamepads(function (gamepad) { _this._onNewGameConnected(gamepad); }); + }; + FreeCameraGamepadInput.prototype.detachControl = function (element) { + if (this._gamepads) { + this._gamepads.dispose(); + } + this.gamepad = null; + }; + FreeCameraGamepadInput.prototype.checkInputs = function () { + if (this.gamepad) { + var camera = this.camera; + var LSValues = this.gamepad.leftStick; + var normalizedLX = LSValues.x / this.gamepadMoveSensibility; + var normalizedLY = LSValues.y / this.gamepadMoveSensibility; + LSValues.x = Math.abs(normalizedLX) > 0.005 ? 0 + normalizedLX : 0; + LSValues.y = Math.abs(normalizedLY) > 0.005 ? 0 + normalizedLY : 0; + var RSValues = this.gamepad.rightStick; + var normalizedRX = RSValues.x / this.gamepadAngularSensibility; + var normalizedRY = RSValues.y / this.gamepadAngularSensibility; + RSValues.x = Math.abs(normalizedRX) > 0.001 ? 0 + normalizedRX : 0; + RSValues.y = Math.abs(normalizedRY) > 0.001 ? 0 + normalizedRY : 0; + var cameraTransform = BABYLON.Matrix.RotationYawPitchRoll(camera.rotation.y, camera.rotation.x, 0); + var speed = camera._computeLocalCameraSpeed() * 50.0; + var deltaTransform = BABYLON.Vector3.TransformCoordinates(new BABYLON.Vector3(LSValues.x * speed, 0, -LSValues.y * speed), cameraTransform); + camera.cameraDirection = camera.cameraDirection.add(deltaTransform); + camera.cameraRotation = camera.cameraRotation.add(new BABYLON.Vector2(RSValues.y, RSValues.x)); + } + }; + FreeCameraGamepadInput.prototype._onNewGameConnected = function (gamepad) { + // Only the first gamepad can control the camera + if (gamepad.index === 0) { + this.gamepad = gamepad; + } + }; + FreeCameraGamepadInput.prototype.getTypeName = function () { + return "FreeCameraGamepadInput"; + }; + FreeCameraGamepadInput.prototype.getSimpleName = function () { + return "gamepad"; + }; + __decorate([ + BABYLON.serialize() + ], FreeCameraGamepadInput.prototype, "gamepadAngularSensibility", void 0); + __decorate([ + BABYLON.serialize() + ], FreeCameraGamepadInput.prototype, "gamepadMoveSensibility", void 0); + return FreeCameraGamepadInput; + }()); + BABYLON.FreeCameraGamepadInput = FreeCameraGamepadInput; + BABYLON.CameraInputTypes["FreeCameraGamepadInput"] = FreeCameraGamepadInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.freecamera.input.gamepad.js.map + + +var BABYLON; +(function (BABYLON) { + var ArcRotateCameraKeyboardMoveInput = (function () { + function ArcRotateCameraKeyboardMoveInput() { + this._keys = []; + this.keysUp = [38]; + this.keysDown = [40]; + this.keysLeft = [37]; + this.keysRight = [39]; + } + ArcRotateCameraKeyboardMoveInput.prototype.attachControl = function (element, noPreventDefault) { + var _this = this; + element.tabIndex = 1; + this._onKeyDown = function (evt) { + if (_this.keysUp.indexOf(evt.keyCode) !== -1 || + _this.keysDown.indexOf(evt.keyCode) !== -1 || + _this.keysLeft.indexOf(evt.keyCode) !== -1 || + _this.keysRight.indexOf(evt.keyCode) !== -1) { + var index = _this._keys.indexOf(evt.keyCode); + if (index === -1) { + _this._keys.push(evt.keyCode); + } + if (evt.preventDefault) { + if (!noPreventDefault) { + evt.preventDefault(); + } + } + } + }; + this._onKeyUp = function (evt) { + if (_this.keysUp.indexOf(evt.keyCode) !== -1 || + _this.keysDown.indexOf(evt.keyCode) !== -1 || + _this.keysLeft.indexOf(evt.keyCode) !== -1 || + _this.keysRight.indexOf(evt.keyCode) !== -1) { + var index = _this._keys.indexOf(evt.keyCode); + if (index >= 0) { + _this._keys.splice(index, 1); + } + if (evt.preventDefault) { + if (!noPreventDefault) { + evt.preventDefault(); + } + } + } + }; + this._onLostFocus = function () { + _this._keys = []; + }; + element.addEventListener("keydown", this._onKeyDown, false); + element.addEventListener("keyup", this._onKeyUp, false); + BABYLON.Tools.RegisterTopRootEvents([ + { name: "blur", handler: this._onLostFocus } + ]); + }; + ArcRotateCameraKeyboardMoveInput.prototype.detachControl = function (element) { + if (element) { + element.removeEventListener("keydown", this._onKeyDown); + element.removeEventListener("keyup", this._onKeyUp); + } + BABYLON.Tools.UnregisterTopRootEvents([ + { name: "blur", handler: this._onLostFocus } + ]); + this._keys = []; + this._onKeyDown = null; + this._onKeyUp = null; + this._onLostFocus = null; + }; + ArcRotateCameraKeyboardMoveInput.prototype.checkInputs = function () { + if (this._onKeyDown) { + var camera = this.camera; + for (var index = 0; index < this._keys.length; index++) { + var keyCode = this._keys[index]; + if (this.keysLeft.indexOf(keyCode) !== -1) { + camera.inertialAlphaOffset -= 0.01; + } + else if (this.keysUp.indexOf(keyCode) !== -1) { + camera.inertialBetaOffset -= 0.01; + } + else if (this.keysRight.indexOf(keyCode) !== -1) { + camera.inertialAlphaOffset += 0.01; + } + else if (this.keysDown.indexOf(keyCode) !== -1) { + camera.inertialBetaOffset += 0.01; + } + } + } + }; + ArcRotateCameraKeyboardMoveInput.prototype.getTypeName = function () { + return "ArcRotateCameraKeyboardMoveInput"; + }; + ArcRotateCameraKeyboardMoveInput.prototype.getSimpleName = function () { + return "keyboard"; + }; + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "keysUp", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "keysDown", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "keysLeft", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "keysRight", void 0); + return ArcRotateCameraKeyboardMoveInput; + }()); + BABYLON.ArcRotateCameraKeyboardMoveInput = ArcRotateCameraKeyboardMoveInput; + BABYLON.CameraInputTypes["ArcRotateCameraKeyboardMoveInput"] = ArcRotateCameraKeyboardMoveInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.arcrotatecamera.input.keyboard.js.map + + +var BABYLON; +(function (BABYLON) { + var ArcRotateCameraMouseWheelInput = (function () { + function ArcRotateCameraMouseWheelInput() { + this.wheelPrecision = 3.0; + } + ArcRotateCameraMouseWheelInput.prototype.attachControl = function (element, noPreventDefault) { + var _this = this; + this._wheel = function (p, s) { + //sanity check - this should be a PointerWheel event. + if (p.type !== BABYLON.PointerEventTypes.POINTERWHEEL) + return; + var event = p.event; + var delta = 0; + if (event.wheelDelta) { + delta = event.wheelDelta / (_this.wheelPrecision * 40); + } + else if (event.detail) { + delta = -event.detail / _this.wheelPrecision; + } + if (delta) + _this.camera.inertialRadiusOffset += delta; + if (event.preventDefault) { + if (!noPreventDefault) { + event.preventDefault(); + } + } + }; + this._observer = this.camera.getScene().onPointerObservable.add(this._wheel, BABYLON.PointerEventTypes.POINTERWHEEL); + }; + ArcRotateCameraMouseWheelInput.prototype.detachControl = function (element) { + if (this._observer && element) { + this.camera.getScene().onPointerObservable.remove(this._observer); + this._observer = null; + this._wheel = null; + } + }; + ArcRotateCameraMouseWheelInput.prototype.getTypeName = function () { + return "ArcRotateCameraMouseWheelInput"; + }; + ArcRotateCameraMouseWheelInput.prototype.getSimpleName = function () { + return "mousewheel"; + }; + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraMouseWheelInput.prototype, "wheelPrecision", void 0); + return ArcRotateCameraMouseWheelInput; + }()); + BABYLON.ArcRotateCameraMouseWheelInput = ArcRotateCameraMouseWheelInput; + BABYLON.CameraInputTypes["ArcRotateCameraMouseWheelInput"] = ArcRotateCameraMouseWheelInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.arcrotatecamera.input.mousewheel.js.map + + +var BABYLON; +(function (BABYLON) { + var eventPrefix = BABYLON.Tools.GetPointerPrefix(); + var ArcRotateCameraPointersInput = (function () { + function ArcRotateCameraPointersInput() { + this.buttons = [0, 1, 2]; + this.angularSensibilityX = 1000.0; + this.angularSensibilityY = 1000.0; + this.pinchPrecision = 6.0; + this.panningSensibility = 50.0; + this._isPanClick = false; + this.pinchInwards = true; + } + ArcRotateCameraPointersInput.prototype.attachControl = function (element, noPreventDefault) { + var _this = this; + var engine = this.camera.getEngine(); + var cacheSoloPointer; // cache pointer object for better perf on camera rotation + var pointA, pointB; + var previousPinchDistance = 0; + this._pointerInput = function (p, s) { + var evt = p.event; + if (p.type !== BABYLON.PointerEventTypes.POINTERMOVE && _this.buttons.indexOf(evt.button) === -1) { + return; + } + if (p.type === BABYLON.PointerEventTypes.POINTERDOWN) { + try { + evt.srcElement.setPointerCapture(evt.pointerId); + } + catch (e) { + } + // Manage panning with pan button click + _this._isPanClick = evt.button === _this.camera._panningMouseButton; + // manage pointers + cacheSoloPointer = { x: evt.clientX, y: evt.clientY, pointerId: evt.pointerId, type: evt.pointerType }; + if (pointA === undefined) { + pointA = cacheSoloPointer; + } + else if (pointB === undefined) { + pointB = cacheSoloPointer; + } + if (!noPreventDefault) { + evt.preventDefault(); + element.focus(); + } + } + else if (p.type === BABYLON.PointerEventTypes.POINTERUP) { + try { + evt.srcElement.releasePointerCapture(evt.pointerId); + } + catch (e) { + } + cacheSoloPointer = null; + previousPinchDistance = 0; + //would be better to use pointers.remove(evt.pointerId) for multitouch gestures, + //but emptying completly pointers collection is required to fix a bug on iPhone : + //when changing orientation while pinching camera, one pointer stay pressed forever if we don't release all pointers + //will be ok to put back pointers.remove(evt.pointerId); when iPhone bug corrected + pointA = pointB = undefined; + if (!noPreventDefault) { + evt.preventDefault(); + } + } + else if (p.type === BABYLON.PointerEventTypes.POINTERMOVE) { + if (!noPreventDefault) { + evt.preventDefault(); + } + // One button down + if (pointA && pointB === undefined) { + if (_this.panningSensibility !== 0 && + ((evt.ctrlKey && _this.camera._useCtrlForPanning) || + (!_this.camera._useCtrlForPanning && _this._isPanClick))) { + _this.camera + .inertialPanningX += -(evt.clientX - cacheSoloPointer.x) / _this.panningSensibility; + _this.camera + .inertialPanningY += (evt.clientY - cacheSoloPointer.y) / _this.panningSensibility; + } + else { + var offsetX = evt.clientX - cacheSoloPointer.x; + var offsetY = evt.clientY - cacheSoloPointer.y; + _this.camera.inertialAlphaOffset -= offsetX / _this.angularSensibilityX; + _this.camera.inertialBetaOffset -= offsetY / _this.angularSensibilityY; + } + cacheSoloPointer.x = evt.clientX; + cacheSoloPointer.y = evt.clientY; + } + else if (pointA && pointB) { + //if (noPreventDefault) { evt.preventDefault(); } //if pinch gesture, could be useful to force preventDefault to avoid html page scroll/zoom in some mobile browsers + var ed = (pointA.pointerId === evt.pointerId) ? pointA : pointB; + ed.x = evt.clientX; + ed.y = evt.clientY; + var direction = _this.pinchInwards ? 1 : -1; + var distX = pointA.x - pointB.x; + var distY = pointA.y - pointB.y; + var pinchSquaredDistance = (distX * distX) + (distY * distY); + if (previousPinchDistance === 0) { + previousPinchDistance = pinchSquaredDistance; + return; + } + if (pinchSquaredDistance !== previousPinchDistance) { + _this.camera + .inertialRadiusOffset += (pinchSquaredDistance - previousPinchDistance) / + (_this.pinchPrecision * + ((_this.angularSensibilityX + _this.angularSensibilityY) / 2) * + direction); + previousPinchDistance = pinchSquaredDistance; + } + } + } + }; + this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, BABYLON.PointerEventTypes.POINTERDOWN | BABYLON.PointerEventTypes.POINTERUP | BABYLON.PointerEventTypes.POINTERMOVE); + this._onContextMenu = function (evt) { + evt.preventDefault(); + }; + if (!this.camera._useCtrlForPanning) { + element.addEventListener("contextmenu", this._onContextMenu, false); + } + this._onLostFocus = function () { + //this._keys = []; + pointA = pointB = undefined; + previousPinchDistance = 0; + cacheSoloPointer = null; + }; + this._onMouseMove = function (evt) { + if (!engine.isPointerLock) { + return; + } + var offsetX = evt.movementX || evt.mozMovementX || evt.webkitMovementX || evt.msMovementX || 0; + var offsetY = evt.movementY || evt.mozMovementY || evt.webkitMovementY || evt.msMovementY || 0; + _this.camera.inertialAlphaOffset -= offsetX / _this.angularSensibilityX; + _this.camera.inertialBetaOffset -= offsetY / _this.angularSensibilityY; + if (!noPreventDefault) { + evt.preventDefault(); + } + }; + this._onGestureStart = function (e) { + if (window.MSGesture === undefined) { + return; + } + if (!_this._MSGestureHandler) { + _this._MSGestureHandler = new MSGesture(); + _this._MSGestureHandler.target = element; + } + _this._MSGestureHandler.addPointer(e.pointerId); + }; + this._onGesture = function (e) { + _this.camera.radius *= e.scale; + if (e.preventDefault) { + if (!noPreventDefault) { + e.stopPropagation(); + e.preventDefault(); + } + } + }; + element.addEventListener("mousemove", this._onMouseMove, false); + element.addEventListener("MSPointerDown", this._onGestureStart, false); + element.addEventListener("MSGestureChange", this._onGesture, false); + element.addEventListener("keydown", this._onKeyDown, false); + element.addEventListener("keyup", this._onKeyUp, false); + BABYLON.Tools.RegisterTopRootEvents([ + { name: "blur", handler: this._onLostFocus } + ]); + }; + ArcRotateCameraPointersInput.prototype.detachControl = function (element) { + if (element && this._observer) { + this.camera.getScene().onPointerObservable.remove(this._observer); + this._observer = null; + element.removeEventListener("contextmenu", this._onContextMenu); + element.removeEventListener("mousemove", this._onMouseMove); + element.removeEventListener("MSPointerDown", this._onGestureStart); + element.removeEventListener("MSGestureChange", this._onGesture); + element.removeEventListener("keydown", this._onKeyDown); + element.removeEventListener("keyup", this._onKeyUp); + this._isPanClick = false; + this.pinchInwards = true; + this._onKeyDown = null; + this._onKeyUp = null; + this._onMouseMove = null; + this._onGestureStart = null; + this._onGesture = null; + this._MSGestureHandler = null; + this._onLostFocus = null; + this._onContextMenu = null; + } + BABYLON.Tools.UnregisterTopRootEvents([ + { name: "blur", handler: this._onLostFocus } + ]); + }; + ArcRotateCameraPointersInput.prototype.getTypeName = function () { + return "ArcRotateCameraPointersInput"; + }; + ArcRotateCameraPointersInput.prototype.getSimpleName = function () { + return "pointers"; + }; + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraPointersInput.prototype, "buttons", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraPointersInput.prototype, "angularSensibilityX", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraPointersInput.prototype, "angularSensibilityY", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraPointersInput.prototype, "pinchPrecision", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraPointersInput.prototype, "panningSensibility", void 0); + return ArcRotateCameraPointersInput; + }()); + BABYLON.ArcRotateCameraPointersInput = ArcRotateCameraPointersInput; + BABYLON.CameraInputTypes["ArcRotateCameraPointersInput"] = ArcRotateCameraPointersInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.arcrotatecamera.input.pointers.js.map + + +var BABYLON; +(function (BABYLON) { + var ArcRotateCameraGamepadInput = (function () { + function ArcRotateCameraGamepadInput() { + this.gamepadRotationSensibility = 80; + this.gamepadMoveSensibility = 40; + } + ArcRotateCameraGamepadInput.prototype.attachControl = function (element, noPreventDefault) { + var _this = this; + this._gamepads = new BABYLON.Gamepads(function (gamepad) { _this._onNewGameConnected(gamepad); }); + }; + ArcRotateCameraGamepadInput.prototype.detachControl = function (element) { + if (this._gamepads) { + this._gamepads.dispose(); + } + this.gamepad = null; + }; + ArcRotateCameraGamepadInput.prototype.checkInputs = function () { + if (this.gamepad) { + var camera = this.camera; + var RSValues = this.gamepad.rightStick; + if (RSValues.x != 0) { + var normalizedRX = RSValues.x / this.gamepadRotationSensibility; + if (normalizedRX != 0 && Math.abs(normalizedRX) > 0.005) { + camera.inertialAlphaOffset += normalizedRX; + } + } + if (RSValues.y != 0) { + var normalizedRY = RSValues.y / this.gamepadRotationSensibility; + if (normalizedRY != 0 && Math.abs(normalizedRY) > 0.005) { + camera.inertialBetaOffset += normalizedRY; + } + } + var LSValues = this.gamepad.leftStick; + if (LSValues.y != 0) { + var normalizedLY = LSValues.y / this.gamepadMoveSensibility; + if (normalizedLY != 0 && Math.abs(normalizedLY) > 0.005) { + this.camera.inertialRadiusOffset -= normalizedLY; + } + } + } + }; + ArcRotateCameraGamepadInput.prototype._onNewGameConnected = function (gamepad) { + // Only the first gamepad can control the camera + if (gamepad.index === 0) { + this.gamepad = gamepad; + } + }; + ArcRotateCameraGamepadInput.prototype.getTypeName = function () { + return "ArcRotateCameraGamepadInput"; + }; + ArcRotateCameraGamepadInput.prototype.getSimpleName = function () { + return "gamepad"; + }; + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraGamepadInput.prototype, "gamepadRotationSensibility", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraGamepadInput.prototype, "gamepadMoveSensibility", void 0); + return ArcRotateCameraGamepadInput; + }()); + BABYLON.ArcRotateCameraGamepadInput = ArcRotateCameraGamepadInput; + BABYLON.CameraInputTypes["ArcRotateCameraGamepadInput"] = ArcRotateCameraGamepadInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.arcrotatecamera.input.gamepad.js.map + +var BABYLON; +(function (BABYLON) { + var ArcRotateCameraVRDeviceOrientationInput = (function () { + function ArcRotateCameraVRDeviceOrientationInput() { + this.alphaCorrection = 1; + this.betaCorrection = 1; + this.gammaCorrection = 1; + this._alpha = 0; + this._beta = 0; + this._gamma = 0; + this._dirty = false; + this._deviceOrientationHandler = this._onOrientationEvent.bind(this); + } + ArcRotateCameraVRDeviceOrientationInput.prototype.attachControl = function (element, noPreventDefault) { + this.camera.attachControl(element, noPreventDefault); + window.addEventListener("deviceorientation", this._deviceOrientationHandler); + }; + ArcRotateCameraVRDeviceOrientationInput.prototype._onOrientationEvent = function (evt) { + var camera = this.camera; + this._alpha = +evt.alpha | 0; + this._beta = +evt.beta | 0; + this._gamma = +evt.gamma | 0; + this._dirty = true; + }; + ArcRotateCameraVRDeviceOrientationInput.prototype.checkInputs = function () { + if (this._dirty) { + this._dirty = false; + if (this._gamma < 0) { + this._gamma = 180 + this._gamma; + } + this.camera.alpha = (-this._alpha / 180.0 * Math.PI) % Math.PI * 2; + this.camera.beta = (this._gamma / 180.0 * Math.PI); + } + }; + ArcRotateCameraVRDeviceOrientationInput.prototype.detachControl = function (element) { + window.removeEventListener("deviceorientation", this._deviceOrientationHandler); + }; + ArcRotateCameraVRDeviceOrientationInput.prototype.getTypeName = function () { + return "ArcRotateCameraVRDeviceOrientationInput"; + }; + ArcRotateCameraVRDeviceOrientationInput.prototype.getSimpleName = function () { + return "VRDeviceOrientation"; + }; + return ArcRotateCameraVRDeviceOrientationInput; + }()); + BABYLON.ArcRotateCameraVRDeviceOrientationInput = ArcRotateCameraVRDeviceOrientationInput; + BABYLON.CameraInputTypes["ArcRotateCameraVRDeviceOrientationInput"] = ArcRotateCameraVRDeviceOrientationInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.arcrotatecamera.input.vrdeviceorientation.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var TargetCamera = (function (_super) { + __extends(TargetCamera, _super); + function TargetCamera(name, position, scene) { + _super.call(this, name, position, scene); + this.cameraDirection = new BABYLON.Vector3(0, 0, 0); + this.cameraRotation = new BABYLON.Vector2(0, 0); + this.rotation = new BABYLON.Vector3(0, 0, 0); + this.speed = 2.0; + this.noRotationConstraint = false; + this.lockedTarget = null; + this._currentTarget = BABYLON.Vector3.Zero(); + this._viewMatrix = BABYLON.Matrix.Zero(); + this._camMatrix = BABYLON.Matrix.Zero(); + this._cameraTransformMatrix = BABYLON.Matrix.Zero(); + this._cameraRotationMatrix = BABYLON.Matrix.Zero(); + this._referencePoint = new BABYLON.Vector3(0, 0, 1); + this._defaultUpVector = new BABYLON.Vector3(0, 1, 0); + this._transformedReferencePoint = BABYLON.Vector3.Zero(); + this._lookAtTemp = BABYLON.Matrix.Zero(); + this._tempMatrix = BABYLON.Matrix.Zero(); + } + TargetCamera.prototype.getFrontPosition = function (distance) { + var direction = this.getTarget().subtract(this.position); + direction.normalize(); + direction.scaleInPlace(distance); + return this.globalPosition.add(direction); + }; + TargetCamera.prototype._getLockedTargetPosition = function () { + if (!this.lockedTarget) { + return null; + } + if (this.lockedTarget.absolutePosition) { + this.lockedTarget.computeWorldMatrix(); + } + return this.lockedTarget.absolutePosition || this.lockedTarget; + }; + // Cache + TargetCamera.prototype._initCache = function () { + _super.prototype._initCache.call(this); + this._cache.lockedTarget = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + this._cache.rotation = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + this._cache.rotationQuaternion = new BABYLON.Quaternion(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + }; + TargetCamera.prototype._updateCache = function (ignoreParentClass) { + if (!ignoreParentClass) { + _super.prototype._updateCache.call(this); + } + var lockedTargetPosition = this._getLockedTargetPosition(); + if (!lockedTargetPosition) { + this._cache.lockedTarget = null; + } + else { + if (!this._cache.lockedTarget) { + this._cache.lockedTarget = lockedTargetPosition.clone(); + } + else { + this._cache.lockedTarget.copyFrom(lockedTargetPosition); + } + } + this._cache.rotation.copyFrom(this.rotation); + if (this.rotationQuaternion) + this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion); + }; + // Synchronized + TargetCamera.prototype._isSynchronizedViewMatrix = function () { + if (!_super.prototype._isSynchronizedViewMatrix.call(this)) { + return false; + } + var lockedTargetPosition = this._getLockedTargetPosition(); + return (this._cache.lockedTarget ? this._cache.lockedTarget.equals(lockedTargetPosition) : !lockedTargetPosition) + && (this.rotationQuaternion ? this.rotationQuaternion.equals(this._cache.rotationQuaternion) : this._cache.rotation.equals(this.rotation)); + }; + // Methods + TargetCamera.prototype._computeLocalCameraSpeed = function () { + var engine = this.getEngine(); + return this.speed * Math.sqrt((engine.getDeltaTime() / (engine.getFps() * 100.0))); + }; + // Target + TargetCamera.prototype.setTarget = function (target) { + this.upVector.normalize(); + BABYLON.Matrix.LookAtLHToRef(this.position, target, this._defaultUpVector, this._camMatrix); + this._camMatrix.invert(); + this.rotation.x = Math.atan(this._camMatrix.m[6] / this._camMatrix.m[10]); + var vDir = target.subtract(this.position); + if (vDir.x >= 0.0) { + this.rotation.y = (-Math.atan(vDir.z / vDir.x) + Math.PI / 2.0); + } + else { + this.rotation.y = (-Math.atan(vDir.z / vDir.x) - Math.PI / 2.0); + } + this.rotation.z = 0; + if (isNaN(this.rotation.x)) { + this.rotation.x = 0; + } + if (isNaN(this.rotation.y)) { + this.rotation.y = 0; + } + if (isNaN(this.rotation.z)) { + this.rotation.z = 0; + } + if (this.rotationQuaternion) { + BABYLON.Quaternion.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this.rotationQuaternion); + } + }; + TargetCamera.prototype.getTarget = function () { + return this._currentTarget; + }; + TargetCamera.prototype._decideIfNeedsToMove = function () { + return Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0; + }; + TargetCamera.prototype._updatePosition = function () { + this.position.addInPlace(this.cameraDirection); + }; + TargetCamera.prototype._checkInputs = function () { + var needToMove = this._decideIfNeedsToMove(); + var needToRotate = Math.abs(this.cameraRotation.x) > 0 || Math.abs(this.cameraRotation.y) > 0; + // Move + if (needToMove) { + this._updatePosition(); + } + // Rotate + if (needToRotate) { + this.rotation.x += this.cameraRotation.x; + this.rotation.y += this.cameraRotation.y; + if (!this.noRotationConstraint) { + var limit = (Math.PI / 2) * 0.95; + if (this.rotation.x > limit) + this.rotation.x = limit; + if (this.rotation.x < -limit) + this.rotation.x = -limit; + } + } + // Inertia + if (needToMove) { + if (Math.abs(this.cameraDirection.x) < BABYLON.Epsilon) { + this.cameraDirection.x = 0; + } + if (Math.abs(this.cameraDirection.y) < BABYLON.Epsilon) { + this.cameraDirection.y = 0; + } + if (Math.abs(this.cameraDirection.z) < BABYLON.Epsilon) { + this.cameraDirection.z = 0; + } + this.cameraDirection.scaleInPlace(this.inertia); + } + if (needToRotate) { + if (Math.abs(this.cameraRotation.x) < BABYLON.Epsilon) { + this.cameraRotation.x = 0; + } + if (Math.abs(this.cameraRotation.y) < BABYLON.Epsilon) { + this.cameraRotation.y = 0; + } + this.cameraRotation.scaleInPlace(this.inertia); + } + _super.prototype._checkInputs.call(this); + }; + TargetCamera.prototype._updateCameraRotationMatrix = function () { + if (this.rotationQuaternion) { + this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix); + //update the up vector! + BABYLON.Vector3.TransformNormalToRef(this._defaultUpVector, this._cameraRotationMatrix, this.upVector); + } + else { + BABYLON.Matrix.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this._cameraRotationMatrix); + } + }; + TargetCamera.prototype._getViewMatrix = function () { + if (!this.lockedTarget) { + // Compute + this._updateCameraRotationMatrix(); + BABYLON.Vector3.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint); + // Computing target and final matrix + this.position.addToRef(this._transformedReferencePoint, this._currentTarget); + } + else { + this._currentTarget.copyFrom(this._getLockedTargetPosition()); + } + if (this.getScene().useRightHandedSystem) { + BABYLON.Matrix.LookAtRHToRef(this.position, this._currentTarget, this.upVector, this._viewMatrix); + } + else { + BABYLON.Matrix.LookAtLHToRef(this.position, this._currentTarget, this.upVector, this._viewMatrix); + } + return this._viewMatrix; + }; + /** + * @override + * Override Camera.createRigCamera + */ + TargetCamera.prototype.createRigCamera = function (name, cameraIndex) { + if (this.cameraRigMode !== BABYLON.Camera.RIG_MODE_NONE) { + var rigCamera = new TargetCamera(name, this.position.clone(), this.getScene()); + if (this.cameraRigMode === BABYLON.Camera.RIG_MODE_VR || this.cameraRigMode === BABYLON.Camera.RIG_MODE_WEBVR) { + if (!this.rotationQuaternion) { + this.rotationQuaternion = new BABYLON.Quaternion(); + } + rigCamera._cameraRigParams = {}; + rigCamera.rotationQuaternion = new BABYLON.Quaternion(); + } + return rigCamera; + } + return null; + }; + /** + * @override + * Override Camera._updateRigCameras + */ + TargetCamera.prototype._updateRigCameras = function () { + var camLeft = this._rigCameras[0]; + var camRight = this._rigCameras[1]; + switch (this.cameraRigMode) { + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH: + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL: + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED: + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER: + //provisionnaly using _cameraRigParams.stereoHalfAngle instead of calculations based on _cameraRigParams.interaxialDistance: + var leftSign = (this.cameraRigMode === BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED) ? 1 : -1; + var rightSign = (this.cameraRigMode === BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED) ? -1 : 1; + this._getRigCamPosition(this._cameraRigParams.stereoHalfAngle * leftSign, camLeft.position); + this._getRigCamPosition(this._cameraRigParams.stereoHalfAngle * rightSign, camRight.position); + camLeft.setTarget(this.getTarget()); + camRight.setTarget(this.getTarget()); + break; + case BABYLON.Camera.RIG_MODE_VR: + case BABYLON.Camera.RIG_MODE_WEBVR: + if (camLeft.rotationQuaternion) { + camLeft.rotationQuaternion.copyFrom(this.rotationQuaternion); + camRight.rotationQuaternion.copyFrom(this.rotationQuaternion); + } + else { + camLeft.rotation.copyFrom(this.rotation); + camRight.rotation.copyFrom(this.rotation); + } + camLeft.position.copyFrom(this.position); + camRight.position.copyFrom(this.position); + break; + } + _super.prototype._updateRigCameras.call(this); + }; + TargetCamera.prototype._getRigCamPosition = function (halfSpace, result) { + if (!this._rigCamTransformMatrix) { + this._rigCamTransformMatrix = new BABYLON.Matrix(); + } + var target = this.getTarget(); + BABYLON.Matrix.Translation(-target.x, -target.y, -target.z).multiplyToRef(BABYLON.Matrix.RotationY(halfSpace), this._rigCamTransformMatrix); + this._rigCamTransformMatrix = this._rigCamTransformMatrix.multiply(BABYLON.Matrix.Translation(target.x, target.y, target.z)); + BABYLON.Vector3.TransformCoordinatesToRef(this.position, this._rigCamTransformMatrix, result); + }; + TargetCamera.prototype.getTypeName = function () { + return "TargetCamera"; + }; + __decorate([ + BABYLON.serializeAsVector3() + ], TargetCamera.prototype, "rotation", void 0); + __decorate([ + BABYLON.serialize() + ], TargetCamera.prototype, "speed", void 0); + __decorate([ + BABYLON.serializeAsMeshReference("lockedTargetId") + ], TargetCamera.prototype, "lockedTarget", void 0); + return TargetCamera; + }(BABYLON.Camera)); + BABYLON.TargetCamera = TargetCamera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.targetCamera.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var FreeCamera = (function (_super) { + __extends(FreeCamera, _super); + function FreeCamera(name, position, scene) { + var _this = this; + _super.call(this, name, position, scene); + this.ellipsoid = new BABYLON.Vector3(0.5, 1, 0.5); + this.checkCollisions = false; + this.applyGravity = false; + this._collider = new BABYLON.Collider(); + this._needMoveForGravity = false; + this._oldPosition = BABYLON.Vector3.Zero(); + this._diffPosition = BABYLON.Vector3.Zero(); + this._newPosition = BABYLON.Vector3.Zero(); + this._onCollisionPositionChange = function (collisionId, newPosition, collidedMesh) { + if (collidedMesh === void 0) { collidedMesh = null; } + //TODO move this to the collision coordinator! + if (_this.getScene().workerCollisions) + newPosition.multiplyInPlace(_this._collider.radius); + var updatePosition = function (newPos) { + _this._newPosition.copyFrom(newPos); + _this._newPosition.subtractToRef(_this._oldPosition, _this._diffPosition); + var oldPosition = _this.position.clone(); + if (_this._diffPosition.length() > BABYLON.Engine.CollisionsEpsilon) { + _this.position.addInPlace(_this._diffPosition); + if (_this.onCollide && collidedMesh) { + _this.onCollide(collidedMesh); + } + } + }; + updatePosition(newPosition); + }; + this.inputs = new BABYLON.FreeCameraInputsManager(this); + this.inputs.addKeyboard().addMouse(); + } + Object.defineProperty(FreeCamera.prototype, "angularSensibility", { + //-- begin properties for backward compatibility for inputs + get: function () { + var mouse = this.inputs.attached["mouse"]; + if (mouse) + return mouse.angularSensibility; + }, + set: function (value) { + var mouse = this.inputs.attached["mouse"]; + if (mouse) + mouse.angularSensibility = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FreeCamera.prototype, "keysUp", { + get: function () { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) + return keyboard.keysUp; + }, + set: function (value) { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) + keyboard.keysUp = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FreeCamera.prototype, "keysDown", { + get: function () { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) + return keyboard.keysDown; + }, + set: function (value) { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) + keyboard.keysDown = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FreeCamera.prototype, "keysLeft", { + get: function () { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) + return keyboard.keysLeft; + }, + set: function (value) { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) + keyboard.keysLeft = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FreeCamera.prototype, "keysRight", { + get: function () { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) + return keyboard.keysRight; + }, + set: function (value) { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) + keyboard.keysRight = value; + }, + enumerable: true, + configurable: true + }); + // Controls + FreeCamera.prototype.attachControl = function (element, noPreventDefault) { + this.inputs.attachElement(element, noPreventDefault); + }; + FreeCamera.prototype.detachControl = function (element) { + this.inputs.detachElement(element); + this.cameraDirection = new BABYLON.Vector3(0, 0, 0); + this.cameraRotation = new BABYLON.Vector2(0, 0); + }; + FreeCamera.prototype._collideWithWorld = function (velocity) { + var globalPosition; + if (this.parent) { + globalPosition = BABYLON.Vector3.TransformCoordinates(this.position, this.parent.getWorldMatrix()); + } + else { + globalPosition = this.position; + } + globalPosition.subtractFromFloatsToRef(0, this.ellipsoid.y, 0, this._oldPosition); + this._collider.radius = this.ellipsoid; + //no need for clone, as long as gravity is not on. + var actualVelocity = velocity; + //add gravity to the velocity to prevent the dual-collision checking + if (this.applyGravity) { + //this prevents mending with cameraDirection, a global variable of the free camera class. + actualVelocity = velocity.add(this.getScene().gravity); + } + this.getScene().collisionCoordinator.getNewPosition(this._oldPosition, actualVelocity, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId); + }; + FreeCamera.prototype._checkInputs = function () { + if (!this._localDirection) { + this._localDirection = BABYLON.Vector3.Zero(); + this._transformedDirection = BABYLON.Vector3.Zero(); + } + this.inputs.checkInputs(); + _super.prototype._checkInputs.call(this); + }; + FreeCamera.prototype._decideIfNeedsToMove = function () { + return this._needMoveForGravity || Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0; + }; + FreeCamera.prototype._updatePosition = function () { + if (this.checkCollisions && this.getScene().collisionsEnabled) { + this._collideWithWorld(this.cameraDirection); + } + else { + this.position.addInPlace(this.cameraDirection); + } + }; + FreeCamera.prototype.dispose = function () { + this.inputs.clear(); + _super.prototype.dispose.call(this); + }; + FreeCamera.prototype.getTypeName = function () { + return "FreeCamera"; + }; + __decorate([ + BABYLON.serializeAsVector3() + ], FreeCamera.prototype, "ellipsoid", void 0); + __decorate([ + BABYLON.serialize() + ], FreeCamera.prototype, "checkCollisions", void 0); + __decorate([ + BABYLON.serialize() + ], FreeCamera.prototype, "applyGravity", void 0); + return FreeCamera; + }(BABYLON.TargetCamera)); + BABYLON.FreeCamera = FreeCamera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.freeCamera.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var FreeCameraInputsManager = (function (_super) { + __extends(FreeCameraInputsManager, _super); + function FreeCameraInputsManager(camera) { + _super.call(this, camera); + } + FreeCameraInputsManager.prototype.addKeyboard = function () { + this.add(new BABYLON.FreeCameraKeyboardMoveInput()); + return this; + }; + FreeCameraInputsManager.prototype.addMouse = function (touchEnabled) { + if (touchEnabled === void 0) { touchEnabled = true; } + this.add(new BABYLON.FreeCameraMouseInput(touchEnabled)); + return this; + }; + FreeCameraInputsManager.prototype.addGamepad = function () { + this.add(new BABYLON.FreeCameraGamepadInput()); + return this; + }; + FreeCameraInputsManager.prototype.addDeviceOrientation = function () { + this.add(new BABYLON.FreeCameraDeviceOrientationInput()); + return this; + }; + FreeCameraInputsManager.prototype.addTouch = function () { + this.add(new BABYLON.FreeCameraTouchInput()); + return this; + }; + FreeCameraInputsManager.prototype.addVirtualJoystick = function () { + this.add(new BABYLON.FreeCameraVirtualJoystickInput()); + return this; + }; + return FreeCameraInputsManager; + }(BABYLON.CameraInputsManager)); + BABYLON.FreeCameraInputsManager = FreeCameraInputsManager; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.freeCameraInputsManager.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var FollowCamera = (function (_super) { + __extends(FollowCamera, _super); + function FollowCamera(name, position, scene, lockedTarget) { + _super.call(this, name, position, scene); + this.radius = 12; + this.rotationOffset = 0; + this.heightOffset = 4; + this.cameraAcceleration = 0.05; + this.maxCameraSpeed = 20; + this.lockedTarget = lockedTarget; + } + FollowCamera.prototype.getRadians = function (degrees) { + return degrees * Math.PI / 180; + }; + FollowCamera.prototype.follow = function (cameraTarget) { + if (!cameraTarget) + return; + var yRotation; + if (cameraTarget.rotationQuaternion) { + var rotMatrix = new BABYLON.Matrix(); + cameraTarget.rotationQuaternion.toRotationMatrix(rotMatrix); + yRotation = Math.atan2(rotMatrix.m[8], rotMatrix.m[10]); + } + else { + yRotation = cameraTarget.rotation.y; + } + var radians = this.getRadians(this.rotationOffset) + yRotation; + var targetX = cameraTarget.position.x + Math.sin(radians) * this.radius; + var targetZ = cameraTarget.position.z + Math.cos(radians) * this.radius; + var dx = targetX - this.position.x; + var dy = (cameraTarget.position.y + this.heightOffset) - this.position.y; + var dz = (targetZ) - this.position.z; + var vx = dx * this.cameraAcceleration * 2; //this is set to .05 + var vy = dy * this.cameraAcceleration; + var vz = dz * this.cameraAcceleration * 2; + if (vx > this.maxCameraSpeed || vx < -this.maxCameraSpeed) { + vx = vx < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed; + } + if (vy > this.maxCameraSpeed || vy < -this.maxCameraSpeed) { + vy = vy < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed; + } + if (vz > this.maxCameraSpeed || vz < -this.maxCameraSpeed) { + vz = vz < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed; + } + this.position = new BABYLON.Vector3(this.position.x + vx, this.position.y + vy, this.position.z + vz); + this.setTarget(cameraTarget.position); + }; + FollowCamera.prototype._checkInputs = function () { + _super.prototype._checkInputs.call(this); + this.follow(this.lockedTarget); + }; + FollowCamera.prototype.getTypeName = function () { + return "FollowCamera"; + }; + __decorate([ + BABYLON.serialize() + ], FollowCamera.prototype, "radius", void 0); + __decorate([ + BABYLON.serialize() + ], FollowCamera.prototype, "rotationOffset", void 0); + __decorate([ + BABYLON.serialize() + ], FollowCamera.prototype, "heightOffset", void 0); + __decorate([ + BABYLON.serialize() + ], FollowCamera.prototype, "cameraAcceleration", void 0); + __decorate([ + BABYLON.serialize() + ], FollowCamera.prototype, "maxCameraSpeed", void 0); + __decorate([ + BABYLON.serializeAsMeshReference("lockedTargetId") + ], FollowCamera.prototype, "lockedTarget", void 0); + return FollowCamera; + }(BABYLON.TargetCamera)); + BABYLON.FollowCamera = FollowCamera; + var ArcFollowCamera = (function (_super) { + __extends(ArcFollowCamera, _super); + function ArcFollowCamera(name, alpha, beta, radius, target, scene) { + _super.call(this, name, BABYLON.Vector3.Zero(), scene); + this.alpha = alpha; + this.beta = beta; + this.radius = radius; + this.target = target; + this._cartesianCoordinates = BABYLON.Vector3.Zero(); + this.follow(); + } + ArcFollowCamera.prototype.follow = function () { + this._cartesianCoordinates.x = this.radius * Math.cos(this.alpha) * Math.cos(this.beta); + this._cartesianCoordinates.y = this.radius * Math.sin(this.beta); + this._cartesianCoordinates.z = this.radius * Math.sin(this.alpha) * Math.cos(this.beta); + this.position = this.target.position.add(this._cartesianCoordinates); + this.setTarget(this.target.position); + }; + ArcFollowCamera.prototype._checkInputs = function () { + _super.prototype._checkInputs.call(this); + this.follow(); + }; + ArcFollowCamera.prototype.getTypeName = function () { + return "ArcFollowCamera"; + }; + return ArcFollowCamera; + }(BABYLON.TargetCamera)); + BABYLON.ArcFollowCamera = ArcFollowCamera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.followCamera.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + // We're mainly based on the logic defined into the FreeCamera code + var TouchCamera = (function (_super) { + __extends(TouchCamera, _super); + //-- end properties for backward compatibility for inputs + function TouchCamera(name, position, scene) { + _super.call(this, name, position, scene); + this.inputs.addTouch(); + this._setupInputs(); + } + Object.defineProperty(TouchCamera.prototype, "touchAngularSensibility", { + //-- Begin properties for backward compatibility for inputs + get: function () { + var touch = this.inputs.attached["touch"]; + if (touch) + return touch.touchAngularSensibility; + }, + set: function (value) { + var touch = this.inputs.attached["touch"]; + if (touch) + touch.touchAngularSensibility = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TouchCamera.prototype, "touchMoveSensibility", { + get: function () { + var touch = this.inputs.attached["touch"]; + if (touch) + return touch.touchMoveSensibility; + }, + set: function (value) { + var touch = this.inputs.attached["touch"]; + if (touch) + touch.touchMoveSensibility = value; + }, + enumerable: true, + configurable: true + }); + TouchCamera.prototype.getTypeName = function () { + return "TouchCamera"; + }; + TouchCamera.prototype._setupInputs = function () { + var mouse = this.inputs.attached["mouse"]; + if (mouse) { + mouse.touchEnabled = false; + } + }; + return TouchCamera; + }(BABYLON.FreeCamera)); + BABYLON.TouchCamera = TouchCamera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.touchCamera.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var ArcRotateCamera = (function (_super) { + __extends(ArcRotateCamera, _super); + function ArcRotateCamera(name, alpha, beta, radius, target, scene) { + var _this = this; + _super.call(this, name, BABYLON.Vector3.Zero(), scene); + this.inertialAlphaOffset = 0; + this.inertialBetaOffset = 0; + this.inertialRadiusOffset = 0; + this.lowerAlphaLimit = null; + this.upperAlphaLimit = null; + this.lowerBetaLimit = 0.01; + this.upperBetaLimit = Math.PI; + this.lowerRadiusLimit = null; + this.upperRadiusLimit = null; + this.inertialPanningX = 0; + this.inertialPanningY = 0; + //-- end properties for backward compatibility for inputs + this.zoomOnFactor = 1; + this.targetScreenOffset = BABYLON.Vector2.Zero(); + this.allowUpsideDown = true; + this._viewMatrix = new BABYLON.Matrix(); + // Panning + this.panningAxis = new BABYLON.Vector3(1, 1, 0); + this.checkCollisions = false; + this.collisionRadius = new BABYLON.Vector3(0.5, 0.5, 0.5); + this._collider = new BABYLON.Collider(); + this._previousPosition = BABYLON.Vector3.Zero(); + this._collisionVelocity = BABYLON.Vector3.Zero(); + this._newPosition = BABYLON.Vector3.Zero(); + this._onCollisionPositionChange = function (collisionId, newPosition, collidedMesh) { + if (collidedMesh === void 0) { collidedMesh = null; } + if (_this.getScene().workerCollisions && _this.checkCollisions) { + newPosition.multiplyInPlace(_this._collider.radius); + } + if (!collidedMesh) { + _this._previousPosition.copyFrom(_this.position); + } + else { + _this.setPosition(newPosition); + if (_this.onCollide) { + _this.onCollide(collidedMesh); + } + } + // Recompute because of constraints + var cosa = Math.cos(_this.alpha); + var sina = Math.sin(_this.alpha); + var cosb = Math.cos(_this.beta); + var sinb = Math.sin(_this.beta); + if (sinb === 0) { + sinb = 0.0001; + } + var target = _this._getTargetPosition(); + target.addToRef(new BABYLON.Vector3(_this.radius * cosa * sinb, _this.radius * cosb, _this.radius * sina * sinb), _this._newPosition); + _this.position.copyFrom(_this._newPosition); + var up = _this.upVector; + if (_this.allowUpsideDown && _this.beta < 0) { + up = up.clone(); + up = up.negate(); + } + BABYLON.Matrix.LookAtLHToRef(_this.position, target, up, _this._viewMatrix); + _this._viewMatrix.m[12] += _this.targetScreenOffset.x; + _this._viewMatrix.m[13] += _this.targetScreenOffset.y; + _this._collisionTriggered = false; + }; + if (!target) { + this.target = BABYLON.Vector3.Zero(); + } + else { + this.target = target; + } + this.alpha = alpha; + this.beta = beta; + this.radius = radius; + this.getViewMatrix(); + this.inputs = new BABYLON.ArcRotateCameraInputsManager(this); + this.inputs.addKeyboard().addMouseWheel().addPointers().addGamepad(); + } + Object.defineProperty(ArcRotateCamera.prototype, "angularSensibilityX", { + //-- begin properties for backward compatibility for inputs + get: function () { + var pointers = this.inputs.attached["pointers"]; + if (pointers) + return pointers.angularSensibilityX; + }, + set: function (value) { + var pointers = this.inputs.attached["pointers"]; + if (pointers) { + pointers.angularSensibilityX = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "angularSensibilityY", { + get: function () { + var pointers = this.inputs.attached["pointers"]; + if (pointers) + return pointers.angularSensibilityY; + }, + set: function (value) { + var pointers = this.inputs.attached["pointers"]; + if (pointers) { + pointers.angularSensibilityY = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "pinchPrecision", { + get: function () { + var pointers = this.inputs.attached["pointers"]; + if (pointers) + return pointers.pinchPrecision; + }, + set: function (value) { + var pointers = this.inputs.attached["pointers"]; + if (pointers) { + pointers.pinchPrecision = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "panningSensibility", { + get: function () { + var pointers = this.inputs.attached["pointers"]; + if (pointers) + return pointers.panningSensibility; + }, + set: function (value) { + var pointers = this.inputs.attached["pointers"]; + if (pointers) { + pointers.panningSensibility = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "keysUp", { + get: function () { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) + return keyboard.keysUp; + }, + set: function (value) { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) + keyboard.keysUp = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "keysDown", { + get: function () { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) + return keyboard.keysDown; + }, + set: function (value) { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) + keyboard.keysDown = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "keysLeft", { + get: function () { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) + return keyboard.keysLeft; + }, + set: function (value) { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) + keyboard.keysLeft = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "keysRight", { + get: function () { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) + return keyboard.keysRight; + }, + set: function (value) { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) + keyboard.keysRight = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "wheelPrecision", { + get: function () { + var mousewheel = this.inputs.attached["mousewheel"]; + if (mousewheel) + return mousewheel.wheelPrecision; + }, + set: function (value) { + var mousewheel = this.inputs.attached["mousewheel"]; + if (mousewheel) + mousewheel.wheelPrecision = value; + }, + enumerable: true, + configurable: true + }); + // Cache + ArcRotateCamera.prototype._initCache = function () { + _super.prototype._initCache.call(this); + this._cache.target = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + this._cache.alpha = undefined; + this._cache.beta = undefined; + this._cache.radius = undefined; + this._cache.targetScreenOffset = BABYLON.Vector2.Zero(); + }; + ArcRotateCamera.prototype._updateCache = function (ignoreParentClass) { + if (!ignoreParentClass) { + _super.prototype._updateCache.call(this); + } + this._cache.target.copyFrom(this._getTargetPosition()); + this._cache.alpha = this.alpha; + this._cache.beta = this.beta; + this._cache.radius = this.radius; + this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset); + }; + ArcRotateCamera.prototype._getTargetPosition = function () { + if (this.target.getAbsolutePosition) { + var pos = this.target.getAbsolutePosition(); + return this._targetBoundingCenter ? pos.add(this._targetBoundingCenter) : pos; + } + return this.target; + }; + // Synchronized + ArcRotateCamera.prototype._isSynchronizedViewMatrix = function () { + if (!_super.prototype._isSynchronizedViewMatrix.call(this)) + return false; + return this._cache.target.equals(this.target) + && this._cache.alpha === this.alpha + && this._cache.beta === this.beta + && this._cache.radius === this.radius + && this._cache.targetScreenOffset.equals(this.targetScreenOffset); + }; + // Methods + ArcRotateCamera.prototype.attachControl = function (element, noPreventDefault, useCtrlForPanning, panningMouseButton) { + var _this = this; + if (useCtrlForPanning === void 0) { useCtrlForPanning = true; } + if (panningMouseButton === void 0) { panningMouseButton = 2; } + this._useCtrlForPanning = useCtrlForPanning; + this._panningMouseButton = panningMouseButton; + this.inputs.attachElement(element, noPreventDefault); + this._reset = function () { + _this.inertialAlphaOffset = 0; + _this.inertialBetaOffset = 0; + _this.inertialRadiusOffset = 0; + }; + }; + ArcRotateCamera.prototype.detachControl = function (element) { + this.inputs.detachElement(element); + if (this._reset) { + this._reset(); + } + }; + ArcRotateCamera.prototype._checkInputs = function () { + //if (async) collision inspection was triggered, don't update the camera's position - until the collision callback was called. + if (this._collisionTriggered) { + return; + } + this.inputs.checkInputs(); + // Inertia + if (this.inertialAlphaOffset !== 0 || this.inertialBetaOffset !== 0 || this.inertialRadiusOffset !== 0) { + if (this.getScene().useRightHandedSystem) { + this.alpha -= this.beta <= 0 ? -this.inertialAlphaOffset : this.inertialAlphaOffset; + } + else { + this.alpha += this.beta <= 0 ? -this.inertialAlphaOffset : this.inertialAlphaOffset; + } + this.beta += this.inertialBetaOffset; + this.radius -= this.inertialRadiusOffset; + this.inertialAlphaOffset *= this.inertia; + this.inertialBetaOffset *= this.inertia; + this.inertialRadiusOffset *= this.inertia; + if (Math.abs(this.inertialAlphaOffset) < BABYLON.Epsilon) + this.inertialAlphaOffset = 0; + if (Math.abs(this.inertialBetaOffset) < BABYLON.Epsilon) + this.inertialBetaOffset = 0; + if (Math.abs(this.inertialRadiusOffset) < BABYLON.Epsilon) + this.inertialRadiusOffset = 0; + } + // Panning inertia + if (this.inertialPanningX !== 0 || this.inertialPanningY !== 0) { + if (!this._localDirection) { + this._localDirection = BABYLON.Vector3.Zero(); + this._transformedDirection = BABYLON.Vector3.Zero(); + } + this.inertialPanningX *= this.inertia; + this.inertialPanningY *= this.inertia; + if (Math.abs(this.inertialPanningX) < BABYLON.Epsilon) + this.inertialPanningX = 0; + if (Math.abs(this.inertialPanningY) < BABYLON.Epsilon) + this.inertialPanningY = 0; + this._localDirection.copyFromFloats(this.inertialPanningX, this.inertialPanningY, this.inertialPanningY); + this._localDirection.multiplyInPlace(this.panningAxis); + this._viewMatrix.invertToRef(this._cameraTransformMatrix); + BABYLON.Vector3.TransformNormalToRef(this._localDirection, this._cameraTransformMatrix, this._transformedDirection); + //Eliminate y if map panning is enabled (panningAxis == 1,0,1) + if (!this.panningAxis.y) { + this._transformedDirection.y = 0; + } + if (!this.target.getAbsolutePosition) { + this.target.addInPlace(this._transformedDirection); + } + } + // Limits + this._checkLimits(); + _super.prototype._checkInputs.call(this); + }; + ArcRotateCamera.prototype._checkLimits = function () { + if (this.lowerBetaLimit === null || this.lowerBetaLimit === undefined) { + if (this.allowUpsideDown && this.beta > Math.PI) { + this.beta = this.beta - (2 * Math.PI); + } + } + else { + if (this.beta < this.lowerBetaLimit) { + this.beta = this.lowerBetaLimit; + } + } + if (this.upperBetaLimit === null || this.upperBetaLimit === undefined) { + if (this.allowUpsideDown && this.beta < -Math.PI) { + this.beta = this.beta + (2 * Math.PI); + } + } + else { + if (this.beta > this.upperBetaLimit) { + this.beta = this.upperBetaLimit; + } + } + if (this.lowerAlphaLimit && this.alpha < this.lowerAlphaLimit) { + this.alpha = this.lowerAlphaLimit; + } + if (this.upperAlphaLimit && this.alpha > this.upperAlphaLimit) { + this.alpha = this.upperAlphaLimit; + } + if (this.lowerRadiusLimit && this.radius < this.lowerRadiusLimit) { + this.radius = this.lowerRadiusLimit; + } + if (this.upperRadiusLimit && this.radius > this.upperRadiusLimit) { + this.radius = this.upperRadiusLimit; + } + }; + ArcRotateCamera.prototype.rebuildAnglesAndRadius = function () { + var radiusv3 = this.position.subtract(this._getTargetPosition()); + this.radius = radiusv3.length(); + // Alpha + this.alpha = Math.acos(radiusv3.x / Math.sqrt(Math.pow(radiusv3.x, 2) + Math.pow(radiusv3.z, 2))); + if (radiusv3.z < 0) { + this.alpha = 2 * Math.PI - this.alpha; + } + // Beta + this.beta = Math.acos(radiusv3.y / this.radius); + this._checkLimits(); + }; + ArcRotateCamera.prototype.setPosition = function (position) { + if (this.position.equals(position)) { + return; + } + this.position.copyFrom(position); + this.rebuildAnglesAndRadius(); + }; + ArcRotateCamera.prototype.setTarget = function (target, toBoundingCenter) { + if (toBoundingCenter === void 0) { toBoundingCenter = false; } + if (this._getTargetPosition().equals(target)) { + return; + } + if (toBoundingCenter && target.getBoundingInfo) { + this._targetBoundingCenter = target.getBoundingInfo().boundingBox.center.clone(); + } + else { + this._targetBoundingCenter = null; + } + this.target = target; + this.rebuildAnglesAndRadius(); + }; + ArcRotateCamera.prototype._getViewMatrix = function () { + // Compute + var cosa = Math.cos(this.alpha); + var sina = Math.sin(this.alpha); + var cosb = Math.cos(this.beta); + var sinb = Math.sin(this.beta); + if (sinb === 0) { + sinb = 0.0001; + } + var target = this._getTargetPosition(); + target.addToRef(new BABYLON.Vector3(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb), this._newPosition); + if (this.getScene().collisionsEnabled && this.checkCollisions) { + this._collider.radius = this.collisionRadius; + this._newPosition.subtractToRef(this.position, this._collisionVelocity); + this._collisionTriggered = true; + this.getScene().collisionCoordinator.getNewPosition(this.position, this._collisionVelocity, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId); + } + else { + this.position.copyFrom(this._newPosition); + var up = this.upVector; + if (this.allowUpsideDown && this.beta < 0) { + up = up.clone(); + up = up.negate(); + } + if (this.getScene().useRightHandedSystem) { + BABYLON.Matrix.LookAtRHToRef(this.position, target, up, this._viewMatrix); + } + else { + BABYLON.Matrix.LookAtLHToRef(this.position, target, up, this._viewMatrix); + } + this._viewMatrix.m[12] += this.targetScreenOffset.x; + this._viewMatrix.m[13] += this.targetScreenOffset.y; + } + this._currentTarget = target; + return this._viewMatrix; + }; + ArcRotateCamera.prototype.zoomOn = function (meshes, doNotUpdateMaxZ) { + if (doNotUpdateMaxZ === void 0) { doNotUpdateMaxZ = false; } + meshes = meshes || this.getScene().meshes; + var minMaxVector = BABYLON.Mesh.MinMax(meshes); + var distance = BABYLON.Vector3.Distance(minMaxVector.min, minMaxVector.max); + this.radius = distance * this.zoomOnFactor; + this.focusOn({ min: minMaxVector.min, max: minMaxVector.max, distance: distance }, doNotUpdateMaxZ); + }; + ArcRotateCamera.prototype.focusOn = function (meshesOrMinMaxVectorAndDistance, doNotUpdateMaxZ) { + if (doNotUpdateMaxZ === void 0) { doNotUpdateMaxZ = false; } + var meshesOrMinMaxVector; + var distance; + if (meshesOrMinMaxVectorAndDistance.min === undefined) { + meshesOrMinMaxVector = meshesOrMinMaxVectorAndDistance || this.getScene().meshes; + meshesOrMinMaxVector = BABYLON.Mesh.MinMax(meshesOrMinMaxVector); + distance = BABYLON.Vector3.Distance(meshesOrMinMaxVector.min, meshesOrMinMaxVector.max); + } + else { + meshesOrMinMaxVector = meshesOrMinMaxVectorAndDistance; + distance = meshesOrMinMaxVectorAndDistance.distance; + } + this.target = BABYLON.Mesh.Center(meshesOrMinMaxVector); + if (!doNotUpdateMaxZ) { + this.maxZ = distance * 2; + } + }; + /** + * @override + * Override Camera.createRigCamera + */ + ArcRotateCamera.prototype.createRigCamera = function (name, cameraIndex) { + var alphaShift; + switch (this.cameraRigMode) { + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH: + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL: + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER: + case BABYLON.Camera.RIG_MODE_VR: + alphaShift = this._cameraRigParams.stereoHalfAngle * (cameraIndex === 0 ? 1 : -1); + break; + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED: + alphaShift = this._cameraRigParams.stereoHalfAngle * (cameraIndex === 0 ? -1 : 1); + break; + } + var rigCam = new ArcRotateCamera(name, this.alpha + alphaShift, this.beta, this.radius, this.target, this.getScene()); + rigCam._cameraRigParams = {}; + return rigCam; + }; + /** + * @override + * Override Camera._updateRigCameras + */ + ArcRotateCamera.prototype._updateRigCameras = function () { + var camLeft = this._rigCameras[0]; + var camRight = this._rigCameras[1]; + camLeft.beta = camRight.beta = this.beta; + camLeft.radius = camRight.radius = this.radius; + switch (this.cameraRigMode) { + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH: + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL: + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER: + case BABYLON.Camera.RIG_MODE_VR: + camLeft.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle; + camRight.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle; + break; + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED: + camLeft.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle; + camRight.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle; + break; + } + _super.prototype._updateRigCameras.call(this); + }; + ArcRotateCamera.prototype.dispose = function () { + this.inputs.clear(); + _super.prototype.dispose.call(this); + }; + ArcRotateCamera.prototype.getTypeName = function () { + return "ArcRotateCamera"; + }; + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "alpha", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "beta", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "radius", void 0); + __decorate([ + BABYLON.serializeAsVector3() + ], ArcRotateCamera.prototype, "target", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "inertialAlphaOffset", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "inertialBetaOffset", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "inertialRadiusOffset", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "lowerAlphaLimit", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "upperAlphaLimit", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "lowerBetaLimit", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "upperBetaLimit", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "lowerRadiusLimit", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "upperRadiusLimit", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "inertialPanningX", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "inertialPanningY", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "zoomOnFactor", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "allowUpsideDown", void 0); + return ArcRotateCamera; + }(BABYLON.TargetCamera)); + BABYLON.ArcRotateCamera = ArcRotateCamera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.arcRotateCamera.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var ArcRotateCameraInputsManager = (function (_super) { + __extends(ArcRotateCameraInputsManager, _super); + function ArcRotateCameraInputsManager(camera) { + _super.call(this, camera); + } + ArcRotateCameraInputsManager.prototype.addMouseWheel = function () { + this.add(new BABYLON.ArcRotateCameraMouseWheelInput()); + return this; + }; + ArcRotateCameraInputsManager.prototype.addPointers = function () { + this.add(new BABYLON.ArcRotateCameraPointersInput()); + return this; + }; + ArcRotateCameraInputsManager.prototype.addKeyboard = function () { + this.add(new BABYLON.ArcRotateCameraKeyboardMoveInput()); + return this; + }; + ArcRotateCameraInputsManager.prototype.addGamepad = function () { + this.add(new BABYLON.ArcRotateCameraGamepadInput()); + return this; + }; + ArcRotateCameraInputsManager.prototype.addVRDeviceOrientation = function () { + this.add(new BABYLON.ArcRotateCameraVRDeviceOrientationInput()); + return this; + }; + return ArcRotateCameraInputsManager; + }(BABYLON.CameraInputsManager)); + BABYLON.ArcRotateCameraInputsManager = ArcRotateCameraInputsManager; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.arcRotateCameraInputsManager.js.map + +var BABYLON; +(function (BABYLON) { + var RenderingManager = (function () { + function RenderingManager(scene) { + this._renderingGroups = new Array(); + this._autoClearDepthStencil = {}; + this._customOpaqueSortCompareFn = {}; + this._customAlphaTestSortCompareFn = {}; + this._customTransparentSortCompareFn = {}; + this._renderinGroupInfo = null; + this._scene = scene; + for (var i = RenderingManager.MIN_RENDERINGGROUPS; i < RenderingManager.MAX_RENDERINGGROUPS; i++) { + this._autoClearDepthStencil[i] = true; + } + } + RenderingManager.prototype._renderParticles = function (index, activeMeshes) { + if (this._scene._activeParticleSystems.length === 0) { + return; + } + // Particles + var activeCamera = this._scene.activeCamera; + this._scene._particlesDuration.beginMonitoring(); + for (var particleIndex = 0; particleIndex < this._scene._activeParticleSystems.length; particleIndex++) { + var particleSystem = this._scene._activeParticleSystems.data[particleIndex]; + if (particleSystem.renderingGroupId !== index) { + continue; + } + if ((activeCamera.layerMask & particleSystem.layerMask) === 0) { + continue; + } + this._clearDepthStencilBuffer(); + if (!particleSystem.emitter.position || !activeMeshes || activeMeshes.indexOf(particleSystem.emitter) !== -1) { + this._scene._activeParticles.addCount(particleSystem.render(), false); + } + } + this._scene._particlesDuration.endMonitoring(false); + }; + RenderingManager.prototype._renderSprites = function (index) { + if (!this._scene.spritesEnabled || this._scene.spriteManagers.length === 0) { + return; + } + // Sprites + var activeCamera = this._scene.activeCamera; + this._scene._spritesDuration.beginMonitoring(); + for (var id = 0; id < this._scene.spriteManagers.length; id++) { + var spriteManager = this._scene.spriteManagers[id]; + if (spriteManager.renderingGroupId === index && ((activeCamera.layerMask & spriteManager.layerMask) !== 0)) { + this._clearDepthStencilBuffer(); + spriteManager.render(); + } + } + this._scene._spritesDuration.endMonitoring(false); + }; + RenderingManager.prototype._clearDepthStencilBuffer = function () { + if (this._depthStencilBufferAlreadyCleaned) { + return; + } + this._scene.getEngine().clear(0, false, true, true); + this._depthStencilBufferAlreadyCleaned = true; + }; + RenderingManager.prototype._renderSpritesAndParticles = function () { + if (this._currentRenderSprites) { + this._renderSprites(this._currentIndex); + } + if (this._currentRenderParticles) { + this._renderParticles(this._currentIndex, this._currentActiveMeshes); + } + }; + RenderingManager.prototype.render = function (customRenderFunction, activeMeshes, renderParticles, renderSprites) { + // Check if there's at least on observer on the onRenderingGroupObservable and initialize things to fire it + var observable = this._scene.onRenderingGroupObservable.hasObservers() ? this._scene.onRenderingGroupObservable : null; + var info = null; + if (observable) { + if (!this._renderinGroupInfo) { + this._renderinGroupInfo = new BABYLON.RenderingGroupInfo(); + } + info = this._renderinGroupInfo; + info.scene = this._scene; + info.camera = this._scene.activeCamera; + } + this._currentActiveMeshes = activeMeshes; + this._currentRenderParticles = renderParticles; + this._currentRenderSprites = renderSprites; + for (var index = RenderingManager.MIN_RENDERINGGROUPS; index < RenderingManager.MAX_RENDERINGGROUPS; index++) { + this._depthStencilBufferAlreadyCleaned = index === RenderingManager.MIN_RENDERINGGROUPS; + var renderingGroup = this._renderingGroups[index]; + var needToStepBack = false; + this._currentIndex = index; + if (renderingGroup) { + var renderingGroupMask = 0; + // Fire PRECLEAR stage + if (observable) { + renderingGroupMask = Math.pow(2, index); + info.renderStage = BABYLON.RenderingGroupInfo.STAGE_PRECLEAR; + info.renderingGroupId = index; + observable.notifyObservers(info, renderingGroupMask); + } + // Clear depth/stencil if needed + if (this._autoClearDepthStencil[index]) { + this._clearDepthStencilBuffer(); + } + // Fire PREOPAQUE stage + if (observable) { + info.renderStage = BABYLON.RenderingGroupInfo.STAGE_PREOPAQUE; + observable.notifyObservers(info, renderingGroupMask); + } + if (!renderingGroup.onBeforeTransparentRendering) { + renderingGroup.onBeforeTransparentRendering = this._renderSpritesAndParticles.bind(this); + } + // Fire PRETRANSPARENT stage + if (observable) { + info.renderStage = BABYLON.RenderingGroupInfo.STAGE_PRETRANSPARENT; + observable.notifyObservers(info, renderingGroupMask); + } + if (!renderingGroup.render(customRenderFunction)) { + this._renderingGroups.splice(index, 1); + needToStepBack = true; + this._renderSpritesAndParticles(); + } + // Fire POSTTRANSPARENT stage + if (observable) { + info.renderStage = BABYLON.RenderingGroupInfo.STAGE_POSTTRANSPARENT; + observable.notifyObservers(info, renderingGroupMask); + } + } + else { + this._renderSpritesAndParticles(); + if (observable) { + var renderingGroupMask = Math.pow(2, index); + info.renderStage = BABYLON.RenderingGroupInfo.STAGE_PRECLEAR; + info.renderingGroupId = index; + observable.notifyObservers(info, renderingGroupMask); + info.renderStage = BABYLON.RenderingGroupInfo.STAGE_POSTTRANSPARENT; + observable.notifyObservers(info, renderingGroupMask); + } + } + if (needToStepBack) { + index--; + } + } + }; + RenderingManager.prototype.reset = function () { + for (var index = RenderingManager.MIN_RENDERINGGROUPS; index < RenderingManager.MAX_RENDERINGGROUPS; index++) { + var renderingGroup = this._renderingGroups[index]; + if (renderingGroup) { + renderingGroup.prepare(); + } + } + }; + RenderingManager.prototype.dispatch = function (subMesh) { + var mesh = subMesh.getMesh(); + var renderingGroupId = mesh.renderingGroupId || 0; + if (!this._renderingGroups[renderingGroupId]) { + this._renderingGroups[renderingGroupId] = new BABYLON.RenderingGroup(renderingGroupId, this._scene, this._customOpaqueSortCompareFn[renderingGroupId], this._customAlphaTestSortCompareFn[renderingGroupId], this._customTransparentSortCompareFn[renderingGroupId]); + } + this._renderingGroups[renderingGroupId].dispatch(subMesh); + }; + /** + * Overrides the default sort function applied in the renderging group to prepare the meshes. + * This allowed control for front to back rendering or reversly depending of the special needs. + * + * @param renderingGroupId The rendering group id corresponding to its index + * @param opaqueSortCompareFn The opaque queue comparison function use to sort. + * @param alphaTestSortCompareFn The alpha test queue comparison function use to sort. + * @param transparentSortCompareFn The transparent queue comparison function use to sort. + */ + RenderingManager.prototype.setRenderingOrder = function (renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn) { + if (opaqueSortCompareFn === void 0) { opaqueSortCompareFn = null; } + if (alphaTestSortCompareFn === void 0) { alphaTestSortCompareFn = null; } + if (transparentSortCompareFn === void 0) { transparentSortCompareFn = null; } + this._customOpaqueSortCompareFn[renderingGroupId] = opaqueSortCompareFn; + this._customAlphaTestSortCompareFn[renderingGroupId] = alphaTestSortCompareFn; + this._customTransparentSortCompareFn[renderingGroupId] = transparentSortCompareFn; + if (this._renderingGroups[renderingGroupId]) { + var group = this._renderingGroups[renderingGroupId]; + group.opaqueSortCompareFn = this._customOpaqueSortCompareFn[renderingGroupId]; + group.alphaTestSortCompareFn = this._customAlphaTestSortCompareFn[renderingGroupId]; + group.transparentSortCompareFn = this._customTransparentSortCompareFn[renderingGroupId]; + } + }; + /** + * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups. + * + * @param renderingGroupId The rendering group id corresponding to its index + * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true. + */ + RenderingManager.prototype.setRenderingAutoClearDepthStencil = function (renderingGroupId, autoClearDepthStencil) { + this._autoClearDepthStencil[renderingGroupId] = autoClearDepthStencil; + }; + /** + * The max id used for rendering groups (not included) + */ + RenderingManager.MAX_RENDERINGGROUPS = 4; + /** + * The min id used for rendering groups (included) + */ + RenderingManager.MIN_RENDERINGGROUPS = 0; + return RenderingManager; + }()); + BABYLON.RenderingManager = RenderingManager; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.renderingManager.js.map + +var BABYLON; +(function (BABYLON) { + var RenderingGroup = (function () { + /** + * Creates a new rendering group. + * @param index The rendering group index + * @param opaqueSortCompareFn The opaque sort comparison function. If null no order is applied + * @param alphaTestSortCompareFn The alpha test sort comparison function. If null no order is applied + * @param transparentSortCompareFn The transparent sort comparison function. If null back to front + alpha index sort is applied + */ + function RenderingGroup(index, scene, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn) { + if (opaqueSortCompareFn === void 0) { opaqueSortCompareFn = null; } + if (alphaTestSortCompareFn === void 0) { alphaTestSortCompareFn = null; } + if (transparentSortCompareFn === void 0) { transparentSortCompareFn = null; } + this.index = index; + this._opaqueSubMeshes = new BABYLON.SmartArray(256); + this._transparentSubMeshes = new BABYLON.SmartArray(256); + this._alphaTestSubMeshes = new BABYLON.SmartArray(256); + this._scene = scene; + this.opaqueSortCompareFn = opaqueSortCompareFn; + this.alphaTestSortCompareFn = alphaTestSortCompareFn; + this.transparentSortCompareFn = transparentSortCompareFn; + } + Object.defineProperty(RenderingGroup.prototype, "opaqueSortCompareFn", { + /** + * Set the opaque sort comparison function. + * If null the sub meshes will be render in the order they were created + */ + set: function (value) { + this._opaqueSortCompareFn = value; + if (value) { + this._renderOpaque = this.renderOpaqueSorted; + } + else { + this._renderOpaque = RenderingGroup.renderUnsorted; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RenderingGroup.prototype, "alphaTestSortCompareFn", { + /** + * Set the alpha test sort comparison function. + * If null the sub meshes will be render in the order they were created + */ + set: function (value) { + this._alphaTestSortCompareFn = value; + if (value) { + this._renderAlphaTest = this.renderAlphaTestSorted; + } + else { + this._renderAlphaTest = RenderingGroup.renderUnsorted; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RenderingGroup.prototype, "transparentSortCompareFn", { + /** + * Set the transparent sort comparison function. + * If null the sub meshes will be render in the order they were created + */ + set: function (value) { + if (value) { + this._transparentSortCompareFn = value; + } + else { + this._transparentSortCompareFn = RenderingGroup.defaultTransparentSortCompare; + } + this._renderTransparent = this.renderTransparentSorted; + }, + enumerable: true, + configurable: true + }); + /** + * Render all the sub meshes contained in the group. + * @param customRenderFunction Used to override the default render behaviour of the group. + * @returns true if rendered some submeshes. + */ + RenderingGroup.prototype.render = function (customRenderFunction) { + if (customRenderFunction) { + customRenderFunction(this._opaqueSubMeshes, this._alphaTestSubMeshes, this._transparentSubMeshes); + return true; + } + if (this._opaqueSubMeshes.length === 0 && this._alphaTestSubMeshes.length === 0 && this._transparentSubMeshes.length === 0) { + if (this.onBeforeTransparentRendering) { + this.onBeforeTransparentRendering(); + } + return false; + } + var engine = this._scene.getEngine(); + // Opaque + this._renderOpaque(this._opaqueSubMeshes); + // Alpha test + engine.setAlphaTesting(true); + this._renderAlphaTest(this._alphaTestSubMeshes); + engine.setAlphaTesting(false); + if (this.onBeforeTransparentRendering) { + this.onBeforeTransparentRendering(); + } + // Transparent + this._renderTransparent(this._transparentSubMeshes); + engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE); + return true; + }; + /** + * Renders the opaque submeshes in the order from the opaqueSortCompareFn. + * @param subMeshes The submeshes to render + */ + RenderingGroup.prototype.renderOpaqueSorted = function (subMeshes) { + return RenderingGroup.renderSorted(subMeshes, this._opaqueSortCompareFn, this._scene.activeCamera.globalPosition, false); + }; + /** + * Renders the opaque submeshes in the order from the alphatestSortCompareFn. + * @param subMeshes The submeshes to render + */ + RenderingGroup.prototype.renderAlphaTestSorted = function (subMeshes) { + return RenderingGroup.renderSorted(subMeshes, this._alphaTestSortCompareFn, this._scene.activeCamera.globalPosition, false); + }; + /** + * Renders the opaque submeshes in the order from the transparentSortCompareFn. + * @param subMeshes The submeshes to render + */ + RenderingGroup.prototype.renderTransparentSorted = function (subMeshes) { + return RenderingGroup.renderSorted(subMeshes, this._transparentSortCompareFn, this._scene.activeCamera.globalPosition, true); + }; + /** + * Renders the submeshes in a specified order. + * @param subMeshes The submeshes to sort before render + * @param sortCompareFn The comparison function use to sort + * @param cameraPosition The camera position use to preprocess the submeshes to help sorting + * @param transparent Specifies to activate blending if true + */ + RenderingGroup.renderSorted = function (subMeshes, sortCompareFn, cameraPosition, transparent) { + var subIndex = 0; + var subMesh; + for (; subIndex < subMeshes.length; subIndex++) { + subMesh = subMeshes.data[subIndex]; + subMesh._alphaIndex = subMesh.getMesh().alphaIndex; + subMesh._distanceToCamera = subMesh.getBoundingInfo().boundingSphere.centerWorld.subtract(cameraPosition).length(); + } + var sortedArray = subMeshes.data.slice(0, subMeshes.length); + sortedArray.sort(sortCompareFn); + for (subIndex = 0; subIndex < sortedArray.length; subIndex++) { + subMesh = sortedArray[subIndex]; + subMesh.render(transparent); + } + }; + /** + * Renders the submeshes in the order they were dispatched (no sort applied). + * @param subMeshes The submeshes to render + */ + RenderingGroup.renderUnsorted = function (subMeshes) { + for (var subIndex = 0; subIndex < subMeshes.length; subIndex++) { + var submesh = subMeshes.data[subIndex]; + submesh.render(false); + } + }; + /** + * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent) + * are rendered back to front if in the same alpha index. + * + * @param a The first submesh + * @param b The second submesh + * @returns The result of the comparison + */ + RenderingGroup.defaultTransparentSortCompare = function (a, b) { + // Alpha index first + if (a._alphaIndex > b._alphaIndex) { + return 1; + } + if (a._alphaIndex < b._alphaIndex) { + return -1; + } + // Then distance to camera + return RenderingGroup.backToFrontSortCompare(a, b); + }; + /** + * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent) + * are rendered back to front. + * + * @param a The first submesh + * @param b The second submesh + * @returns The result of the comparison + */ + RenderingGroup.backToFrontSortCompare = function (a, b) { + // Then distance to camera + if (a._distanceToCamera < b._distanceToCamera) { + return 1; + } + if (a._distanceToCamera > b._distanceToCamera) { + return -1; + } + return 0; + }; + /** + * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent) + * are rendered front to back (prevent overdraw). + * + * @param a The first submesh + * @param b The second submesh + * @returns The result of the comparison + */ + RenderingGroup.frontToBackSortCompare = function (a, b) { + // Then distance to camera + if (a._distanceToCamera < b._distanceToCamera) { + return -1; + } + if (a._distanceToCamera > b._distanceToCamera) { + return 1; + } + return 0; + }; + /** + * Resets the different lists of submeshes to prepare a new frame. + */ + RenderingGroup.prototype.prepare = function () { + this._opaqueSubMeshes.reset(); + this._transparentSubMeshes.reset(); + this._alphaTestSubMeshes.reset(); + }; + /** + * Inserts the submesh in its correct queue depending on its material. + * @param subMesh The submesh to dispatch + */ + RenderingGroup.prototype.dispatch = function (subMesh) { + var material = subMesh.getMaterial(); + var mesh = subMesh.getMesh(); + if (material.needAlphaBlending() || mesh.visibility < 1.0 || mesh.hasVertexAlpha) { + this._transparentSubMeshes.push(subMesh); + } + else if (material.needAlphaTesting()) { + this._alphaTestSubMeshes.push(subMesh); + } + else { + this._opaqueSubMeshes.push(subMesh); // Opaque + } + }; + return RenderingGroup; + }()); + BABYLON.RenderingGroup = RenderingGroup; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.renderingGroup.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var PointerEventTypes = (function () { + function PointerEventTypes() { + } + Object.defineProperty(PointerEventTypes, "POINTERDOWN", { + get: function () { + return PointerEventTypes._POINTERDOWN; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PointerEventTypes, "POINTERUP", { + get: function () { + return PointerEventTypes._POINTERUP; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PointerEventTypes, "POINTERMOVE", { + get: function () { + return PointerEventTypes._POINTERMOVE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PointerEventTypes, "POINTERWHEEL", { + get: function () { + return PointerEventTypes._POINTERWHEEL; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PointerEventTypes, "POINTERPICK", { + get: function () { + return PointerEventTypes._POINTERPICK; + }, + enumerable: true, + configurable: true + }); + PointerEventTypes._POINTERDOWN = 0x01; + PointerEventTypes._POINTERUP = 0x02; + PointerEventTypes._POINTERMOVE = 0x04; + PointerEventTypes._POINTERWHEEL = 0x08; + PointerEventTypes._POINTERPICK = 0x10; + return PointerEventTypes; + }()); + BABYLON.PointerEventTypes = PointerEventTypes; + var PointerInfoBase = (function () { + function PointerInfoBase(type, event) { + this.type = type; + this.event = event; + } + return PointerInfoBase; + }()); + BABYLON.PointerInfoBase = PointerInfoBase; + /** + * This class is used to store pointer related info for the onPrePointerObservable event. + * Set the skipOnPointerObservable property to true if you want the engine to stop any process after this event is triggered, even not calling onPointerObservable + */ + var PointerInfoPre = (function (_super) { + __extends(PointerInfoPre, _super); + function PointerInfoPre(type, event, localX, localY) { + _super.call(this, type, event); + this.skipOnPointerObservable = false; + this.localPosition = new BABYLON.Vector2(localX, localY); + } + return PointerInfoPre; + }(PointerInfoBase)); + BABYLON.PointerInfoPre = PointerInfoPre; + /** + * This type contains all the data related to a pointer event in Babylon.js. + * The event member is an instance of PointerEvent for all types except PointerWheel and is of type MouseWheelEvent when type equals PointerWheel. The different event types can be found in the PointerEventTypes class. + */ + var PointerInfo = (function (_super) { + __extends(PointerInfo, _super); + function PointerInfo(type, event, pickInfo) { + _super.call(this, type, event); + this.pickInfo = pickInfo; + } + return PointerInfo; + }(PointerInfoBase)); + BABYLON.PointerInfo = PointerInfo; + /** + * This class is used by the onRenderingGroupObservable + */ + var RenderingGroupInfo = (function () { + function RenderingGroupInfo() { + } + /** + * Stage corresponding to the very first hook in the renderingGroup phase: before the render buffer may be cleared + * This stage will be fired no matter what + */ + RenderingGroupInfo.STAGE_PRECLEAR = 1; + /** + * Called before opaque object are rendered. + * This stage will be fired only if there's 3D Opaque content to render + */ + RenderingGroupInfo.STAGE_PREOPAQUE = 2; + /** + * Called after the opaque objects are rendered and before the transparent ones + * This stage will be fired only if there's 3D transparent content to render + */ + RenderingGroupInfo.STAGE_PRETRANSPARENT = 3; + /** + * Called after the transparent object are rendered, last hook of the renderingGroup phase + * This stage will be fired no matter what + */ + RenderingGroupInfo.STAGE_POSTTRANSPARENT = 4; + return RenderingGroupInfo; + }()); + BABYLON.RenderingGroupInfo = RenderingGroupInfo; + /** + * Represents a scene to be rendered by the engine. + * @see http://doc.babylonjs.com/page.php?p=21911 + */ + var Scene = (function () { + /** + * @constructor + * @param {BABYLON.Engine} engine - the engine to be used to render this scene. + */ + function Scene(engine) { + // Members + this.autoClear = true; + this.clearColor = new BABYLON.Color3(0.2, 0.2, 0.3); + this.ambientColor = new BABYLON.Color3(0, 0, 0); + this.forceWireframe = false; + this.forcePointsCloud = false; + this.forceShowBoundingBoxes = false; + this.animationsEnabled = true; + this.constantlyUpdateMeshUnderPointer = false; + this.useRightHandedSystem = false; + this.hoverCursor = "pointer"; + // Metadata + this.metadata = null; + // Events + /** + * An event triggered when the scene is disposed. + * @type {BABYLON.Observable} + */ + this.onDisposeObservable = new BABYLON.Observable(); + /** + * An event triggered before rendering the scene + * @type {BABYLON.Observable} + */ + this.onBeforeRenderObservable = new BABYLON.Observable(); + /** + * An event triggered after rendering the scene + * @type {BABYLON.Observable} + */ + this.onAfterRenderObservable = new BABYLON.Observable(); + /** + * An event triggered when the scene is ready + * @type {BABYLON.Observable} + */ + this.onReadyObservable = new BABYLON.Observable(); + /** + * An event triggered before rendering a camera + * @type {BABYLON.Observable} + */ + this.onBeforeCameraRenderObservable = new BABYLON.Observable(); + /** + * An event triggered after rendering a camera + * @type {BABYLON.Observable} + */ + this.onAfterCameraRenderObservable = new BABYLON.Observable(); + /** + * An event triggered when a camera is created + * @type {BABYLON.Observable} + */ + this.onNewCameraAddedObservable = new BABYLON.Observable(); + /** + * An event triggered when a camera is removed + * @type {BABYLON.Observable} + */ + this.onCameraRemovedObservable = new BABYLON.Observable(); + /** + * An event triggered when a light is created + * @type {BABYLON.Observable} + */ + this.onNewLightAddedObservable = new BABYLON.Observable(); + /** + * An event triggered when a light is removed + * @type {BABYLON.Observable} + */ + this.onLightRemovedObservable = new BABYLON.Observable(); + /** + * An event triggered when a geometry is created + * @type {BABYLON.Observable} + */ + this.onNewGeometryAddedObservable = new BABYLON.Observable(); + /** + * An event triggered when a geometry is removed + * @type {BABYLON.Observable} + */ + this.onGeometryRemovedObservable = new BABYLON.Observable(); + /** + * An event triggered when a mesh is created + * @type {BABYLON.Observable} + */ + this.onNewMeshAddedObservable = new BABYLON.Observable(); + /** + * An event triggered when a mesh is removed + * @type {BABYLON.Observable} + */ + this.onMeshRemovedObservable = new BABYLON.Observable(); + /** + * This Observable will be triggered for each stage of each renderingGroup of each rendered camera. + * The RenderinGroupInfo class contains all the information about the context in which the observable is called + * If you wish to register an Observer only for a given set of renderingGroup, use the mask with a combination of the renderingGroup index elevated to the power of two (1 for renderingGroup 0, 2 for renderingrOup1, 4 for 2 and 8 for 3) + */ + this.onRenderingGroupObservable = new BABYLON.Observable(); + // Animations + this.animations = []; + /** + * This observable event is triggered when any mouse event registered during Scene.attach() is called BEFORE the 3D engine to process anything (mesh/sprite picking for instance). + * You have the possibility to skip the 3D Engine process and the call to onPointerObservable by setting PointerInfoBase.skipOnPointerObservable to true + */ + this.onPrePointerObservable = new BABYLON.Observable(); + /** + * Observable event triggered each time an input event is received from the rendering canvas + */ + this.onPointerObservable = new BABYLON.Observable(); + this.cameraToUseForPointers = null; // Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position + this._startingPointerPosition = new BABYLON.Vector2(0, 0); + this._startingPointerTime = 0; + // Fog + /** + * is fog enabled on this scene. + * @type {boolean} + */ + this.fogEnabled = true; + this.fogMode = Scene.FOGMODE_NONE; + this.fogColor = new BABYLON.Color3(0.2, 0.2, 0.3); + this.fogDensity = 0.1; + this.fogStart = 0; + this.fogEnd = 1000.0; + // Lights + /** + * is shadow enabled on this scene. + * @type {boolean} + */ + this.shadowsEnabled = true; + /** + * is light enabled on this scene. + * @type {boolean} + */ + this.lightsEnabled = true; + /** + * All of the lights added to this scene. + * @see BABYLON.Light + * @type {BABYLON.Light[]} + */ + this.lights = new Array(); + // Cameras + /** + * All of the cameras added to this scene. + * @see BABYLON.Camera + * @type {BABYLON.Camera[]} + */ + this.cameras = new Array(); + this.activeCameras = new Array(); + // Meshes + /** + * All of the (abstract) meshes added to this scene. + * @see BABYLON.AbstractMesh + * @type {BABYLON.AbstractMesh[]} + */ + this.meshes = new Array(); + // Geometries + this._geometries = new Array(); + this.materials = new Array(); + this.multiMaterials = new Array(); + // Textures + this.texturesEnabled = true; + this.textures = new Array(); + // Particles + this.particlesEnabled = true; + this.particleSystems = new Array(); + // Sprites + this.spritesEnabled = true; + this.spriteManagers = new Array(); + // Layers + this.layers = new Array(); + this.highlightLayers = new Array(); + // Skeletons + this.skeletonsEnabled = true; + this.skeletons = new Array(); + // Lens flares + this.lensFlaresEnabled = true; + this.lensFlareSystems = new Array(); + // Collisions + this.collisionsEnabled = true; + this.gravity = new BABYLON.Vector3(0, -9.807, 0); + // Postprocesses + this.postProcessesEnabled = true; + // Customs render targets + this.renderTargetsEnabled = true; + this.dumpNextRenderTargets = false; + this.customRenderTargets = new Array(); + // Imported meshes + this.importedMeshesFiles = new Array(); + // Probes + this.probesEnabled = true; + this.reflectionProbes = new Array(); + this._actionManagers = new Array(); + this._meshesForIntersections = new BABYLON.SmartArray(256); + // Procedural textures + this.proceduralTexturesEnabled = true; + this._proceduralTextures = new Array(); + this.soundTracks = new Array(); + this._audioEnabled = true; + this._headphone = false; + // Performance counters + this._totalMeshesCounter = new BABYLON.PerfCounter(); + this._totalLightsCounter = new BABYLON.PerfCounter(); + this._totalMaterialsCounter = new BABYLON.PerfCounter(); + this._totalTexturesCounter = new BABYLON.PerfCounter(); + this._totalVertices = new BABYLON.PerfCounter(); + this._activeIndices = new BABYLON.PerfCounter(); + this._activeParticles = new BABYLON.PerfCounter(); + this._lastFrameDuration = new BABYLON.PerfCounter(); + this._evaluateActiveMeshesDuration = new BABYLON.PerfCounter(); + this._renderTargetsDuration = new BABYLON.PerfCounter(); + this._particlesDuration = new BABYLON.PerfCounter(); + this._renderDuration = new BABYLON.PerfCounter(); + this._spritesDuration = new BABYLON.PerfCounter(); + this._activeBones = new BABYLON.PerfCounter(); + this._renderId = 0; + this._executeWhenReadyTimeoutId = -1; + this._intermediateRendering = false; + this._toBeDisposed = new BABYLON.SmartArray(256); + this._pendingData = []; //ANY + this._activeMeshes = new BABYLON.SmartArray(256); + this._processedMaterials = new BABYLON.SmartArray(256); + this._renderTargets = new BABYLON.SmartArray(256); + this._activeParticleSystems = new BABYLON.SmartArray(256); + this._activeSkeletons = new BABYLON.SmartArray(32); + this._softwareSkinnedMeshes = new BABYLON.SmartArray(32); + this._activeAnimatables = new Array(); + this._transformMatrix = BABYLON.Matrix.Zero(); + this._edgesRenderers = new BABYLON.SmartArray(16); + this._uniqueIdCounter = 0; + this._engine = engine; + engine.scenes.push(this); + this._externalData = new BABYLON.StringDictionary(); + this._uid = null; + this._renderingManager = new BABYLON.RenderingManager(this); + this.postProcessManager = new BABYLON.PostProcessManager(this); + this.postProcessRenderPipelineManager = new BABYLON.PostProcessRenderPipelineManager(); + this._boundingBoxRenderer = new BABYLON.BoundingBoxRenderer(this); + if (BABYLON.OutlineRenderer) { + this._outlineRenderer = new BABYLON.OutlineRenderer(this); + } + this.attachControl(); + if (BABYLON.SoundTrack) { + this.mainSoundTrack = new BABYLON.SoundTrack(this, { mainTrack: true }); + } + //simplification queue + if (BABYLON.SimplificationQueue) { + this.simplificationQueue = new BABYLON.SimplificationQueue(); + } + //collision coordinator initialization. For now legacy per default. + this.workerCollisions = false; //(!!Worker && (!!BABYLON.CollisionWorker || BABYLON.WorkerIncluded)); + } + Object.defineProperty(Scene, "FOGMODE_NONE", { + get: function () { + return Scene._FOGMODE_NONE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene, "FOGMODE_EXP", { + get: function () { + return Scene._FOGMODE_EXP; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene, "FOGMODE_EXP2", { + get: function () { + return Scene._FOGMODE_EXP2; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene, "FOGMODE_LINEAR", { + get: function () { + return Scene._FOGMODE_LINEAR; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "onDispose", { + set: function (callback) { + if (this._onDisposeObserver) { + this.onDisposeObservable.remove(this._onDisposeObserver); + } + this._onDisposeObserver = this.onDisposeObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "beforeRender", { + set: function (callback) { + if (this._onBeforeRenderObserver) { + this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver); + } + this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "afterRender", { + set: function (callback) { + if (this._onAfterRenderObserver) { + this.onAfterRenderObservable.remove(this._onAfterRenderObserver); + } + this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "beforeCameraRender", { + set: function (callback) { + if (this._onBeforeCameraRenderObserver) { + this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver); + } + this._onBeforeCameraRenderObserver = this.onBeforeCameraRenderObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "afterCameraRender", { + set: function (callback) { + if (this._onAfterCameraRenderObserver) { + this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver); + } + this._onAfterCameraRenderObserver = this.onAfterCameraRenderObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "unTranslatedPointer", { + get: function () { + return new BABYLON.Vector2(this._unTranslatedPointerX, this._unTranslatedPointerY); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "defaultMaterial", { + get: function () { + if (!this._defaultMaterial) { + this._defaultMaterial = new BABYLON.StandardMaterial("default material", this); + } + return this._defaultMaterial; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "debugLayer", { + // Properties + get: function () { + if (!this._debugLayer) { + this._debugLayer = new BABYLON.DebugLayer(this); + } + return this._debugLayer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "workerCollisions", { + get: function () { + return this._workerCollisions; + }, + set: function (enabled) { + enabled = (enabled && !!Worker); + this._workerCollisions = enabled; + if (this.collisionCoordinator) { + this.collisionCoordinator.destroy(); + } + this.collisionCoordinator = enabled ? new BABYLON.CollisionCoordinatorWorker() : new BABYLON.CollisionCoordinatorLegacy(); + this.collisionCoordinator.init(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "SelectionOctree", { + get: function () { + return this._selectionOctree; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "meshUnderPointer", { + /** + * The mesh that is currently under the pointer. + * @return {BABYLON.AbstractMesh} mesh under the pointer/mouse cursor or null if none. + */ + get: function () { + return this._pointerOverMesh; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "pointerX", { + /** + * Current on-screen X position of the pointer + * @return {number} X position of the pointer + */ + get: function () { + return this._pointerX; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "pointerY", { + /** + * Current on-screen Y position of the pointer + * @return {number} Y position of the pointer + */ + get: function () { + return this._pointerY; + }, + enumerable: true, + configurable: true + }); + Scene.prototype.getCachedMaterial = function () { + return this._cachedMaterial; + }; + Scene.prototype.getBoundingBoxRenderer = function () { + return this._boundingBoxRenderer; + }; + Scene.prototype.getOutlineRenderer = function () { + return this._outlineRenderer; + }; + Scene.prototype.getEngine = function () { + return this._engine; + }; + Scene.prototype.getTotalVertices = function () { + return this._totalVertices.current; + }; + Object.defineProperty(Scene.prototype, "totalVerticesPerfCounter", { + get: function () { + return this._totalVertices; + }, + enumerable: true, + configurable: true + }); + Scene.prototype.getActiveIndices = function () { + return this._activeIndices.current; + }; + Object.defineProperty(Scene.prototype, "totalActiveIndicesPerfCounter", { + get: function () { + return this._activeIndices; + }, + enumerable: true, + configurable: true + }); + Scene.prototype.getActiveParticles = function () { + return this._activeParticles.current; + }; + Object.defineProperty(Scene.prototype, "activeParticlesPerfCounter", { + get: function () { + return this._activeParticles; + }, + enumerable: true, + configurable: true + }); + Scene.prototype.getActiveBones = function () { + return this._activeBones.current; + }; + Object.defineProperty(Scene.prototype, "activeBonesPerfCounter", { + get: function () { + return this._activeBones; + }, + enumerable: true, + configurable: true + }); + // Stats + Scene.prototype.getLastFrameDuration = function () { + return this._lastFrameDuration.current; + }; + Object.defineProperty(Scene.prototype, "lastFramePerfCounter", { + get: function () { + return this._lastFrameDuration; + }, + enumerable: true, + configurable: true + }); + Scene.prototype.getEvaluateActiveMeshesDuration = function () { + return this._evaluateActiveMeshesDuration.current; + }; + Object.defineProperty(Scene.prototype, "evaluateActiveMeshesDurationPerfCounter", { + get: function () { + return this._evaluateActiveMeshesDuration; + }, + enumerable: true, + configurable: true + }); + Scene.prototype.getActiveMeshes = function () { + return this._activeMeshes; + }; + Scene.prototype.getRenderTargetsDuration = function () { + return this._renderTargetsDuration.current; + }; + Scene.prototype.getRenderDuration = function () { + return this._renderDuration.current; + }; + Object.defineProperty(Scene.prototype, "renderDurationPerfCounter", { + get: function () { + return this._renderDuration; + }, + enumerable: true, + configurable: true + }); + Scene.prototype.getParticlesDuration = function () { + return this._particlesDuration.current; + }; + Object.defineProperty(Scene.prototype, "particlesDurationPerfCounter", { + get: function () { + return this._particlesDuration; + }, + enumerable: true, + configurable: true + }); + Scene.prototype.getSpritesDuration = function () { + return this._spritesDuration.current; + }; + Object.defineProperty(Scene.prototype, "spriteDuractionPerfCounter", { + get: function () { + return this._spritesDuration; + }, + enumerable: true, + configurable: true + }); + Scene.prototype.getAnimationRatio = function () { + return this._animationRatio; + }; + Scene.prototype.getRenderId = function () { + return this._renderId; + }; + Scene.prototype.incrementRenderId = function () { + this._renderId++; + }; + Scene.prototype._updatePointerPosition = function (evt) { + var canvasRect = this._engine.getRenderingCanvasClientRect(); + this._pointerX = evt.clientX - canvasRect.left; + this._pointerY = evt.clientY - canvasRect.top; + this._unTranslatedPointerX = this._pointerX; + this._unTranslatedPointerY = this._pointerY; + if (this.cameraToUseForPointers) { + this._pointerX = this._pointerX - this.cameraToUseForPointers.viewport.x * this._engine.getRenderWidth(); + this._pointerY = this._pointerY - this.cameraToUseForPointers.viewport.y * this._engine.getRenderHeight(); + } + }; + // Pointers handling + /** + * Attach events to the canvas (To handle actionManagers triggers and raise onPointerMove, onPointerDown and onPointerUp + * @param attachUp defines if you want to attach events to pointerup + * @param attachDown defines if you want to attach events to pointerdown + * @param attachMove defines if you want to attach events to pointermove + */ + Scene.prototype.attachControl = function (attachUp, attachDown, attachMove) { + var _this = this; + if (attachUp === void 0) { attachUp = true; } + if (attachDown === void 0) { attachDown = true; } + if (attachMove === void 0) { attachMove = true; } + var spritePredicate = function (sprite) { + return sprite.isPickable && sprite.actionManager && sprite.actionManager.hasPointerTriggers; + }; + this._onPointerMove = function (evt) { + _this._updatePointerPosition(evt); + // PreObservable support + if (_this.onPrePointerObservable.hasObservers()) { + var type = evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? PointerEventTypes.POINTERWHEEL : PointerEventTypes.POINTERMOVE; + var pi = new PointerInfoPre(type, evt, _this._unTranslatedPointerX, _this._unTranslatedPointerY); + _this.onPrePointerObservable.notifyObservers(pi, type); + if (pi.skipOnPointerObservable) { + return; + } + } + if (!_this.cameraToUseForPointers && !_this.activeCamera) { + return; + } + var canvas = _this._engine.getRenderingCanvas(); + if (!_this.pointerMovePredicate) { + _this.pointerMovePredicate = function (mesh) { return mesh.isPickable && mesh.isVisible && mesh.isReady() && (_this.constantlyUpdateMeshUnderPointer || mesh.actionManager !== null && mesh.actionManager !== undefined); }; + } + // Meshes + var pickResult = _this.pick(_this._unTranslatedPointerX, _this._unTranslatedPointerY, _this.pointerMovePredicate, false, _this.cameraToUseForPointers); + if (pickResult.hit && pickResult.pickedMesh) { + _this.setPointerOverSprite(null); + _this.setPointerOverMesh(pickResult.pickedMesh); + if (_this._pointerOverMesh.actionManager && _this._pointerOverMesh.actionManager.hasPointerTriggers) { + if (_this._pointerOverMesh.actionManager.hoverCursor) { + canvas.style.cursor = _this._pointerOverMesh.actionManager.hoverCursor; + } + else { + canvas.style.cursor = _this.hoverCursor; + } + } + else { + canvas.style.cursor = ""; + } + } + else { + _this.setPointerOverMesh(null); + // Sprites + pickResult = _this.pickSprite(_this._unTranslatedPointerX, _this._unTranslatedPointerY, spritePredicate, false, _this.cameraToUseForPointers); + if (pickResult.hit && pickResult.pickedSprite) { + _this.setPointerOverSprite(pickResult.pickedSprite); + if (_this._pointerOverSprite.actionManager && _this._pointerOverSprite.actionManager.hoverCursor) { + canvas.style.cursor = _this._pointerOverSprite.actionManager.hoverCursor; + } + else { + canvas.style.cursor = _this.hoverCursor; + } + } + else { + _this.setPointerOverSprite(null); + // Restore pointer + canvas.style.cursor = ""; + } + } + if (_this.onPointerMove) { + _this.onPointerMove(evt, pickResult); + } + if (_this.onPointerObservable.hasObservers()) { + var type = evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? PointerEventTypes.POINTERWHEEL : PointerEventTypes.POINTERMOVE; + var pi = new PointerInfo(type, evt, pickResult); + _this.onPointerObservable.notifyObservers(pi, type); + } + }; + this._onPointerDown = function (evt) { + _this._updatePointerPosition(evt); + // PreObservable support + if (_this.onPrePointerObservable.hasObservers()) { + var type = PointerEventTypes.POINTERDOWN; + var pi = new PointerInfoPre(type, evt, _this._unTranslatedPointerX, _this._unTranslatedPointerY); + _this.onPrePointerObservable.notifyObservers(pi, type); + if (pi.skipOnPointerObservable) { + return; + } + } + if (!_this.cameraToUseForPointers && !_this.activeCamera) { + return; + } + _this._startingPointerPosition.x = _this._pointerX; + _this._startingPointerPosition.y = _this._pointerY; + _this._startingPointerTime = new Date().getTime(); + if (!_this.pointerDownPredicate) { + _this.pointerDownPredicate = function (mesh) { + return mesh.isPickable && mesh.isVisible && mesh.isReady(); + }; + } + // Meshes + _this._pickedDownMesh = null; + var pickResult = _this.pick(_this._unTranslatedPointerX, _this._unTranslatedPointerY, _this.pointerDownPredicate, false, _this.cameraToUseForPointers); + if (pickResult.hit && pickResult.pickedMesh) { + if (pickResult.pickedMesh.actionManager) { + _this._pickedDownMesh = pickResult.pickedMesh; + if (pickResult.pickedMesh.actionManager.hasPickTriggers) { + switch (evt.button) { + case 0: + pickResult.pickedMesh.actionManager.processTrigger(BABYLON.ActionManager.OnLeftPickTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt)); + break; + case 1: + pickResult.pickedMesh.actionManager.processTrigger(BABYLON.ActionManager.OnCenterPickTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt)); + break; + case 2: + pickResult.pickedMesh.actionManager.processTrigger(BABYLON.ActionManager.OnRightPickTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt)); + break; + } + if (pickResult.pickedMesh.actionManager) { + pickResult.pickedMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickDownTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt)); + } + } + if (pickResult.pickedMesh.actionManager && pickResult.pickedMesh.actionManager.hasSpecificTrigger(BABYLON.ActionManager.OnLongPressTrigger)) { + var that = _this; + window.setTimeout(function () { + var pickResult = that.pick(that._unTranslatedPointerX, that._unTranslatedPointerY, function (mesh) { return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.actionManager && mesh.actionManager.hasSpecificTrigger(BABYLON.ActionManager.OnLongPressTrigger); }, false, that.cameraToUseForPointers); + if (pickResult.hit && pickResult.pickedMesh) { + if (pickResult.pickedMesh.actionManager) { + if (that._startingPointerTime !== 0 && ((new Date().getTime() - that._startingPointerTime) > BABYLON.ActionManager.LongPressDelay) && (Math.abs(that._startingPointerPosition.x - that._pointerX) < BABYLON.ActionManager.DragMovementThreshold && Math.abs(that._startingPointerPosition.y - that._pointerY) < BABYLON.ActionManager.DragMovementThreshold)) { + that._startingPointerTime = 0; + pickResult.pickedMesh.actionManager.processTrigger(BABYLON.ActionManager.OnLongPressTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt)); + } + } + } + }, BABYLON.ActionManager.LongPressDelay); + } + } + } + if (_this.onPointerDown) { + _this.onPointerDown(evt, pickResult); + } + if (_this.onPointerObservable.hasObservers()) { + var type = PointerEventTypes.POINTERDOWN; + var pi = new PointerInfo(type, evt, pickResult); + _this.onPointerObservable.notifyObservers(pi, type); + } + // Sprites + _this._pickedDownSprite = null; + if (_this.spriteManagers.length > 0) { + pickResult = _this.pickSprite(_this._unTranslatedPointerX, _this._unTranslatedPointerY, spritePredicate, false, _this.cameraToUseForPointers); + if (pickResult.hit && pickResult.pickedSprite) { + if (pickResult.pickedSprite.actionManager) { + _this._pickedDownSprite = pickResult.pickedSprite; + switch (evt.button) { + case 0: + pickResult.pickedSprite.actionManager.processTrigger(BABYLON.ActionManager.OnLeftPickTrigger, BABYLON.ActionEvent.CreateNewFromSprite(pickResult.pickedSprite, _this, evt)); + break; + case 1: + pickResult.pickedSprite.actionManager.processTrigger(BABYLON.ActionManager.OnCenterPickTrigger, BABYLON.ActionEvent.CreateNewFromSprite(pickResult.pickedSprite, _this, evt)); + break; + case 2: + pickResult.pickedSprite.actionManager.processTrigger(BABYLON.ActionManager.OnRightPickTrigger, BABYLON.ActionEvent.CreateNewFromSprite(pickResult.pickedSprite, _this, evt)); + break; + } + if (pickResult.pickedSprite.actionManager) { + pickResult.pickedSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPickDownTrigger, BABYLON.ActionEvent.CreateNewFromSprite(pickResult.pickedSprite, _this, evt)); + } + } + } + } + }; + this._onPointerUp = function (evt) { + _this._updatePointerPosition(evt); + // PreObservable support + if (_this.onPrePointerObservable.hasObservers()) { + var type = PointerEventTypes.POINTERUP; + var pi = new PointerInfoPre(type, evt, _this._unTranslatedPointerX, _this._unTranslatedPointerY); + _this.onPrePointerObservable.notifyObservers(pi, type); + if (pi.skipOnPointerObservable) { + return; + } + } + if (!_this.cameraToUseForPointers && !_this.activeCamera) { + return; + } + if (!_this.pointerUpPredicate) { + _this.pointerUpPredicate = function (mesh) { + return mesh.isPickable && mesh.isVisible && mesh.isReady(); + }; + } + // Meshes + var pickResult = _this.pick(_this._unTranslatedPointerX, _this._unTranslatedPointerY, _this.pointerUpPredicate, false, _this.cameraToUseForPointers); + if (pickResult.hit && pickResult.pickedMesh) { + if (_this._pickedDownMesh != null && pickResult.pickedMesh == _this._pickedDownMesh) { + if (_this.onPointerPick) { + _this.onPointerPick(evt, pickResult); + } + if (_this.onPointerObservable.hasObservers()) { + var type = PointerEventTypes.POINTERPICK; + var pi = new PointerInfo(type, evt, pickResult); + _this.onPointerObservable.notifyObservers(pi, type); + } + } + if (pickResult.pickedMesh.actionManager) { + pickResult.pickedMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickUpTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt)); + if (pickResult.pickedMesh.actionManager) { + if (Math.abs(_this._startingPointerPosition.x - _this._pointerX) < BABYLON.ActionManager.DragMovementThreshold && Math.abs(_this._startingPointerPosition.y - _this._pointerY) < BABYLON.ActionManager.DragMovementThreshold) { + pickResult.pickedMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt)); + } + } + } + } + if (_this._pickedDownMesh && _this._pickedDownMesh.actionManager && _this._pickedDownMesh !== pickResult.pickedMesh) { + _this._pickedDownMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickOutTrigger, BABYLON.ActionEvent.CreateNew(_this._pickedDownMesh, evt)); + } + if (_this.onPointerUp) { + _this.onPointerUp(evt, pickResult); + } + if (_this.onPointerObservable.hasObservers()) { + var type = PointerEventTypes.POINTERUP; + var pi = new PointerInfo(type, evt, pickResult); + _this.onPointerObservable.notifyObservers(pi, type); + } + _this._startingPointerTime = 0; + // Sprites + if (_this.spriteManagers.length > 0) { + pickResult = _this.pickSprite(_this._unTranslatedPointerX, _this._unTranslatedPointerY, spritePredicate, false, _this.cameraToUseForPointers); + if (pickResult.hit && pickResult.pickedSprite) { + if (pickResult.pickedSprite.actionManager) { + pickResult.pickedSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPickUpTrigger, BABYLON.ActionEvent.CreateNewFromSprite(pickResult.pickedSprite, _this, evt)); + if (pickResult.pickedSprite.actionManager) { + if (Math.abs(_this._startingPointerPosition.x - _this._pointerX) < BABYLON.ActionManager.DragMovementThreshold && Math.abs(_this._startingPointerPosition.y - _this._pointerY) < BABYLON.ActionManager.DragMovementThreshold) { + pickResult.pickedSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPickTrigger, BABYLON.ActionEvent.CreateNewFromSprite(pickResult.pickedSprite, _this, evt)); + } + } + } + } + if (_this._pickedDownSprite && _this._pickedDownSprite.actionManager && _this._pickedDownSprite !== pickResult.pickedSprite) { + _this._pickedDownSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPickOutTrigger, BABYLON.ActionEvent.CreateNewFromSprite(_this._pickedDownSprite, _this, evt)); + } + } + }; + this._onKeyDown = function (evt) { + if (_this.actionManager) { + _this.actionManager.processTrigger(BABYLON.ActionManager.OnKeyDownTrigger, BABYLON.ActionEvent.CreateNewFromScene(_this, evt)); + } + }; + this._onKeyUp = function (evt) { + if (_this.actionManager) { + _this.actionManager.processTrigger(BABYLON.ActionManager.OnKeyUpTrigger, BABYLON.ActionEvent.CreateNewFromScene(_this, evt)); + } + }; + var eventPrefix = BABYLON.Tools.GetPointerPrefix(); + var canvas = this._engine.getRenderingCanvas(); + if (attachMove) { + canvas.addEventListener(eventPrefix + "move", this._onPointerMove, false); + // Wheel + canvas.addEventListener('mousewheel', this._onPointerMove, false); + canvas.addEventListener('DOMMouseScroll', this._onPointerMove, false); + } + if (attachDown) { + canvas.addEventListener(eventPrefix + "down", this._onPointerDown, false); + } + if (attachUp) { + canvas.addEventListener(eventPrefix + "up", this._onPointerUp, false); + } + canvas.tabIndex = 1; + canvas.addEventListener("keydown", this._onKeyDown, false); + canvas.addEventListener("keyup", this._onKeyUp, false); + }; + Scene.prototype.detachControl = function () { + var eventPrefix = BABYLON.Tools.GetPointerPrefix(); + var canvas = this._engine.getRenderingCanvas(); + canvas.removeEventListener(eventPrefix + "move", this._onPointerMove); + canvas.removeEventListener(eventPrefix + "down", this._onPointerDown); + canvas.removeEventListener(eventPrefix + "up", this._onPointerUp); + // Wheel + canvas.removeEventListener('mousewheel', this._onPointerMove); + canvas.removeEventListener('DOMMouseScroll', this._onPointerMove); + canvas.removeEventListener("keydown", this._onKeyDown); + canvas.removeEventListener("keyup", this._onKeyUp); + }; + // Ready + Scene.prototype.isReady = function () { + if (this._pendingData.length > 0) { + return false; + } + var index; + for (index = 0; index < this._geometries.length; index++) { + var geometry = this._geometries[index]; + if (geometry.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_LOADING) { + return false; + } + } + for (index = 0; index < this.meshes.length; index++) { + var mesh = this.meshes[index]; + if (!mesh.isReady()) { + return false; + } + var mat = mesh.material; + if (mat) { + if (!mat.isReady(mesh)) { + return false; + } + } + } + return true; + }; + Scene.prototype.resetCachedMaterial = function () { + this._cachedMaterial = null; + }; + Scene.prototype.registerBeforeRender = function (func) { + this.onBeforeRenderObservable.add(func); + }; + Scene.prototype.unregisterBeforeRender = function (func) { + this.onBeforeRenderObservable.removeCallback(func); + }; + Scene.prototype.registerAfterRender = function (func) { + this.onAfterRenderObservable.add(func); + }; + Scene.prototype.unregisterAfterRender = function (func) { + this.onAfterRenderObservable.removeCallback(func); + }; + Scene.prototype._addPendingData = function (data) { + this._pendingData.push(data); + }; + Scene.prototype._removePendingData = function (data) { + var index = this._pendingData.indexOf(data); + if (index !== -1) { + this._pendingData.splice(index, 1); + } + }; + Scene.prototype.getWaitingItemsCount = function () { + return this._pendingData.length; + }; + /** + * Registers a function to be executed when the scene is ready. + * @param {Function} func - the function to be executed. + */ + Scene.prototype.executeWhenReady = function (func) { + var _this = this; + this.onReadyObservable.add(func); + if (this._executeWhenReadyTimeoutId !== -1) { + return; + } + this._executeWhenReadyTimeoutId = setTimeout(function () { + _this._checkIsReady(); + }, 150); + }; + Scene.prototype._checkIsReady = function () { + var _this = this; + if (this.isReady()) { + this.onReadyObservable.notifyObservers(this); + this.onReadyObservable.clear(); + this._executeWhenReadyTimeoutId = -1; + return; + } + this._executeWhenReadyTimeoutId = setTimeout(function () { + _this._checkIsReady(); + }, 150); + }; + // Animations + /** + * Will start the animation sequence of a given target + * @param target - the target + * @param {number} from - from which frame should animation start + * @param {number} to - till which frame should animation run. + * @param {boolean} [loop] - should the animation loop + * @param {number} [speedRatio] - the speed in which to run the animation + * @param {Function} [onAnimationEnd] function to be executed when the animation ended. + * @param {BABYLON.Animatable} [animatable] an animatable object. If not provided a new one will be created from the given params. + * @return {BABYLON.Animatable} the animatable object created for this animation + * @see BABYLON.Animatable + * @see http://doc.babylonjs.com/page.php?p=22081 + */ + Scene.prototype.beginAnimation = function (target, from, to, loop, speedRatio, onAnimationEnd, animatable) { + if (speedRatio === void 0) { speedRatio = 1.0; } + this.stopAnimation(target); + if (!animatable) { + animatable = new BABYLON.Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd); + } + // Local animations + if (target.animations) { + animatable.appendAnimations(target, target.animations); + } + // Children animations + if (target.getAnimatables) { + var animatables = target.getAnimatables(); + for (var index = 0; index < animatables.length; index++) { + this.beginAnimation(animatables[index], from, to, loop, speedRatio, onAnimationEnd, animatable); + } + } + animatable.reset(); + return animatable; + }; + Scene.prototype.beginDirectAnimation = function (target, animations, from, to, loop, speedRatio, onAnimationEnd) { + if (speedRatio === undefined) { + speedRatio = 1.0; + } + var animatable = new BABYLON.Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd, animations); + return animatable; + }; + Scene.prototype.getAnimatableByTarget = function (target) { + for (var index = 0; index < this._activeAnimatables.length; index++) { + if (this._activeAnimatables[index].target === target) { + return this._activeAnimatables[index]; + } + } + return null; + }; + Object.defineProperty(Scene.prototype, "Animatables", { + get: function () { + return this._activeAnimatables; + }, + enumerable: true, + configurable: true + }); + /** + * Will stop the animation of the given target + * @param target - the target + * @param animationName - the name of the animation to stop (all animations will be stopped is empty) + * @see beginAnimation + */ + Scene.prototype.stopAnimation = function (target, animationName) { + var animatable = this.getAnimatableByTarget(target); + if (animatable) { + animatable.stop(animationName); + } + }; + Scene.prototype._animate = function () { + if (!this.animationsEnabled || this._activeAnimatables.length === 0) { + return; + } + if (!this._animationStartDate) { + if (this._pendingData.length > 0) { + return; + } + this._animationStartDate = BABYLON.Tools.Now; + } + // Getting time + var now = BABYLON.Tools.Now; + var delay = now - this._animationStartDate; + for (var index = 0; index < this._activeAnimatables.length; index++) { + this._activeAnimatables[index]._animate(delay); + } + }; + // Matrix + Scene.prototype.getViewMatrix = function () { + return this._viewMatrix; + }; + Scene.prototype.getProjectionMatrix = function () { + return this._projectionMatrix; + }; + Scene.prototype.getTransformMatrix = function () { + return this._transformMatrix; + }; + Scene.prototype.setTransformMatrix = function (view, projection) { + this._viewMatrix = view; + this._projectionMatrix = projection; + this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix); + // Update frustum + if (!this._frustumPlanes) { + this._frustumPlanes = BABYLON.Frustum.GetPlanes(this._transformMatrix); + } + else { + BABYLON.Frustum.GetPlanesToRef(this._transformMatrix, this._frustumPlanes); + } + }; + // Methods + Scene.prototype.addMesh = function (newMesh) { + newMesh.uniqueId = this._uniqueIdCounter++; + var position = this.meshes.push(newMesh); + //notify the collision coordinator + this.collisionCoordinator.onMeshAdded(newMesh); + this.onNewMeshAddedObservable.notifyObservers(newMesh); + }; + Scene.prototype.removeMesh = function (toRemove) { + var index = this.meshes.indexOf(toRemove); + if (index !== -1) { + // Remove from the scene if mesh found + this.meshes.splice(index, 1); + } + //notify the collision coordinator + this.collisionCoordinator.onMeshRemoved(toRemove); + this.onMeshRemovedObservable.notifyObservers(toRemove); + return index; + }; + Scene.prototype.removeSkeleton = function (toRemove) { + var index = this.skeletons.indexOf(toRemove); + if (index !== -1) { + // Remove from the scene if mesh found + this.skeletons.splice(index, 1); + } + return index; + }; + Scene.prototype.removeLight = function (toRemove) { + var index = this.lights.indexOf(toRemove); + if (index !== -1) { + // Remove from the scene if mesh found + this.lights.splice(index, 1); + } + this.onLightRemovedObservable.notifyObservers(toRemove); + return index; + }; + Scene.prototype.removeCamera = function (toRemove) { + var index = this.cameras.indexOf(toRemove); + if (index !== -1) { + // Remove from the scene if mesh found + this.cameras.splice(index, 1); + } + // Remove from activeCameras + var index2 = this.activeCameras.indexOf(toRemove); + if (index2 !== -1) { + // Remove from the scene if mesh found + this.activeCameras.splice(index2, 1); + } + // Reset the activeCamera + if (this.activeCamera === toRemove) { + if (this.cameras.length > 0) { + this.activeCamera = this.cameras[0]; + } + else { + this.activeCamera = null; + } + } + this.onCameraRemovedObservable.notifyObservers(toRemove); + return index; + }; + Scene.prototype.addLight = function (newLight) { + newLight.uniqueId = this._uniqueIdCounter++; + var position = this.lights.push(newLight); + this.onNewLightAddedObservable.notifyObservers(newLight); + }; + Scene.prototype.addCamera = function (newCamera) { + newCamera.uniqueId = this._uniqueIdCounter++; + var position = this.cameras.push(newCamera); + this.onNewCameraAddedObservable.notifyObservers(newCamera); + }; + /** + * Switch active camera + * @param {Camera} newCamera - new active camera + * @param {boolean} attachControl - call attachControl for the new active camera (default: true) + */ + Scene.prototype.switchActiveCamera = function (newCamera, attachControl) { + if (attachControl === void 0) { attachControl = true; } + var canvas = this._engine.getRenderingCanvas(); + this.activeCamera.detachControl(canvas); + this.activeCamera = newCamera; + if (attachControl) { + newCamera.attachControl(canvas); + } + }; + /** + * sets the active camera of the scene using its ID + * @param {string} id - the camera's ID + * @return {BABYLON.Camera|null} the new active camera or null if none found. + * @see activeCamera + */ + Scene.prototype.setActiveCameraByID = function (id) { + var camera = this.getCameraByID(id); + if (camera) { + this.activeCamera = camera; + return camera; + } + return null; + }; + /** + * sets the active camera of the scene using its name + * @param {string} name - the camera's name + * @return {BABYLON.Camera|null} the new active camera or null if none found. + * @see activeCamera + */ + Scene.prototype.setActiveCameraByName = function (name) { + var camera = this.getCameraByName(name); + if (camera) { + this.activeCamera = camera; + return camera; + } + return null; + }; + /** + * get a material using its id + * @param {string} the material's ID + * @return {BABYLON.Material|null} the material or null if none found. + */ + Scene.prototype.getMaterialByID = function (id) { + for (var index = 0; index < this.materials.length; index++) { + if (this.materials[index].id === id) { + return this.materials[index]; + } + } + return null; + }; + /** + * get a material using its name + * @param {string} the material's name + * @return {BABYLON.Material|null} the material or null if none found. + */ + Scene.prototype.getMaterialByName = function (name) { + for (var index = 0; index < this.materials.length; index++) { + if (this.materials[index].name === name) { + return this.materials[index]; + } + } + return null; + }; + Scene.prototype.getLensFlareSystemByName = function (name) { + for (var index = 0; index < this.lensFlareSystems.length; index++) { + if (this.lensFlareSystems[index].name === name) { + return this.lensFlareSystems[index]; + } + } + return null; + }; + Scene.prototype.getLensFlareSystemByID = function (id) { + for (var index = 0; index < this.lensFlareSystems.length; index++) { + if (this.lensFlareSystems[index].id === id) { + return this.lensFlareSystems[index]; + } + } + return null; + }; + Scene.prototype.getCameraByID = function (id) { + for (var index = 0; index < this.cameras.length; index++) { + if (this.cameras[index].id === id) { + return this.cameras[index]; + } + } + return null; + }; + Scene.prototype.getCameraByUniqueID = function (uniqueId) { + for (var index = 0; index < this.cameras.length; index++) { + if (this.cameras[index].uniqueId === uniqueId) { + return this.cameras[index]; + } + } + return null; + }; + /** + * get a camera using its name + * @param {string} the camera's name + * @return {BABYLON.Camera|null} the camera or null if none found. + */ + Scene.prototype.getCameraByName = function (name) { + for (var index = 0; index < this.cameras.length; index++) { + if (this.cameras[index].name === name) { + return this.cameras[index]; + } + } + return null; + }; + /** + * get a bone using its id + * @param {string} the bone's id + * @return {BABYLON.Bone|null} the bone or null if not found + */ + Scene.prototype.getBoneByID = function (id) { + for (var skeletonIndex = 0; skeletonIndex < this.skeletons.length; skeletonIndex++) { + var skeleton = this.skeletons[skeletonIndex]; + for (var boneIndex = 0; boneIndex < skeleton.bones.length; boneIndex++) { + if (skeleton.bones[boneIndex].id === id) { + return skeleton.bones[boneIndex]; + } + } + } + return null; + }; + /** + * get a bone using its id + * @param {string} the bone's name + * @return {BABYLON.Bone|null} the bone or null if not found + */ + Scene.prototype.getBoneByName = function (name) { + for (var skeletonIndex = 0; skeletonIndex < this.skeletons.length; skeletonIndex++) { + var skeleton = this.skeletons[skeletonIndex]; + for (var boneIndex = 0; boneIndex < skeleton.bones.length; boneIndex++) { + if (skeleton.bones[boneIndex].name === name) { + return skeleton.bones[boneIndex]; + } + } + } + return null; + }; + /** + * get a light node using its name + * @param {string} the light's name + * @return {BABYLON.Light|null} the light or null if none found. + */ + Scene.prototype.getLightByName = function (name) { + for (var index = 0; index < this.lights.length; index++) { + if (this.lights[index].name === name) { + return this.lights[index]; + } + } + return null; + }; + /** + * get a light node using its ID + * @param {string} the light's id + * @return {BABYLON.Light|null} the light or null if none found. + */ + Scene.prototype.getLightByID = function (id) { + for (var index = 0; index < this.lights.length; index++) { + if (this.lights[index].id === id) { + return this.lights[index]; + } + } + return null; + }; + /** + * get a light node using its scene-generated unique ID + * @param {number} the light's unique id + * @return {BABYLON.Light|null} the light or null if none found. + */ + Scene.prototype.getLightByUniqueID = function (uniqueId) { + for (var index = 0; index < this.lights.length; index++) { + if (this.lights[index].uniqueId === uniqueId) { + return this.lights[index]; + } + } + return null; + }; + /** + * get a particle system by id + * @param id {number} the particle system id + * @return {BABYLON.ParticleSystem|null} the corresponding system or null if none found. + */ + Scene.prototype.getParticleSystemByID = function (id) { + for (var index = 0; index < this.particleSystems.length; index++) { + if (this.particleSystems[index].id === id) { + return this.particleSystems[index]; + } + } + return null; + }; + /** + * get a geometry using its ID + * @param {string} the geometry's id + * @return {BABYLON.Geometry|null} the geometry or null if none found. + */ + Scene.prototype.getGeometryByID = function (id) { + for (var index = 0; index < this._geometries.length; index++) { + if (this._geometries[index].id === id) { + return this._geometries[index]; + } + } + return null; + }; + /** + * add a new geometry to this scene. + * @param {BABYLON.Geometry} geometry - the geometry to be added to the scene. + * @param {boolean} [force] - force addition, even if a geometry with this ID already exists + * @return {boolean} was the geometry added or not + */ + Scene.prototype.pushGeometry = function (geometry, force) { + if (!force && this.getGeometryByID(geometry.id)) { + return false; + } + this._geometries.push(geometry); + //notify the collision coordinator + this.collisionCoordinator.onGeometryAdded(geometry); + this.onNewGeometryAddedObservable.notifyObservers(geometry); + return true; + }; + /** + * Removes an existing geometry + * @param {BABYLON.Geometry} geometry - the geometry to be removed from the scene. + * @return {boolean} was the geometry removed or not + */ + Scene.prototype.removeGeometry = function (geometry) { + var index = this._geometries.indexOf(geometry); + if (index > -1) { + this._geometries.splice(index, 1); + //notify the collision coordinator + this.collisionCoordinator.onGeometryDeleted(geometry); + this.onGeometryRemovedObservable.notifyObservers(geometry); + return true; + } + return false; + }; + Scene.prototype.getGeometries = function () { + return this._geometries; + }; + /** + * Get the first added mesh found of a given ID + * @param {string} id - the id to search for + * @return {BABYLON.AbstractMesh|null} the mesh found or null if not found at all. + */ + Scene.prototype.getMeshByID = function (id) { + for (var index = 0; index < this.meshes.length; index++) { + if (this.meshes[index].id === id) { + return this.meshes[index]; + } + } + return null; + }; + Scene.prototype.getMeshesByID = function (id) { + return this.meshes.filter(function (m) { + return m.id === id; + }); + }; + /** + * Get a mesh with its auto-generated unique id + * @param {number} uniqueId - the unique id to search for + * @return {BABYLON.AbstractMesh|null} the mesh found or null if not found at all. + */ + Scene.prototype.getMeshByUniqueID = function (uniqueId) { + for (var index = 0; index < this.meshes.length; index++) { + if (this.meshes[index].uniqueId === uniqueId) { + return this.meshes[index]; + } + } + return null; + }; + /** + * Get a the last added mesh found of a given ID + * @param {string} id - the id to search for + * @return {BABYLON.AbstractMesh|null} the mesh found or null if not found at all. + */ + Scene.prototype.getLastMeshByID = function (id) { + for (var index = this.meshes.length - 1; index >= 0; index--) { + if (this.meshes[index].id === id) { + return this.meshes[index]; + } + } + return null; + }; + /** + * Get a the last added node (Mesh, Camera, Light) found of a given ID + * @param {string} id - the id to search for + * @return {BABYLON.Node|null} the node found or null if not found at all. + */ + Scene.prototype.getLastEntryByID = function (id) { + var index; + for (index = this.meshes.length - 1; index >= 0; index--) { + if (this.meshes[index].id === id) { + return this.meshes[index]; + } + } + for (index = this.cameras.length - 1; index >= 0; index--) { + if (this.cameras[index].id === id) { + return this.cameras[index]; + } + } + for (index = this.lights.length - 1; index >= 0; index--) { + if (this.lights[index].id === id) { + return this.lights[index]; + } + } + return null; + }; + Scene.prototype.getNodeByID = function (id) { + var mesh = this.getMeshByID(id); + if (mesh) { + return mesh; + } + var light = this.getLightByID(id); + if (light) { + return light; + } + var camera = this.getCameraByID(id); + if (camera) { + return camera; + } + var bone = this.getBoneByID(id); + return bone; + }; + Scene.prototype.getNodeByName = function (name) { + var mesh = this.getMeshByName(name); + if (mesh) { + return mesh; + } + var light = this.getLightByName(name); + if (light) { + return light; + } + var camera = this.getCameraByName(name); + if (camera) { + return camera; + } + var bone = this.getBoneByName(name); + return bone; + }; + Scene.prototype.getMeshByName = function (name) { + for (var index = 0; index < this.meshes.length; index++) { + if (this.meshes[index].name === name) { + return this.meshes[index]; + } + } + return null; + }; + Scene.prototype.getSoundByName = function (name) { + var index; + if (BABYLON.AudioEngine) { + for (index = 0; index < this.mainSoundTrack.soundCollection.length; index++) { + if (this.mainSoundTrack.soundCollection[index].name === name) { + return this.mainSoundTrack.soundCollection[index]; + } + } + for (var sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) { + for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) { + if (this.soundTracks[sdIndex].soundCollection[index].name === name) { + return this.soundTracks[sdIndex].soundCollection[index]; + } + } + } + } + return null; + }; + Scene.prototype.getLastSkeletonByID = function (id) { + for (var index = this.skeletons.length - 1; index >= 0; index--) { + if (this.skeletons[index].id === id) { + return this.skeletons[index]; + } + } + return null; + }; + Scene.prototype.getSkeletonById = function (id) { + for (var index = 0; index < this.skeletons.length; index++) { + if (this.skeletons[index].id === id) { + return this.skeletons[index]; + } + } + return null; + }; + Scene.prototype.getSkeletonByName = function (name) { + for (var index = 0; index < this.skeletons.length; index++) { + if (this.skeletons[index].name === name) { + return this.skeletons[index]; + } + } + return null; + }; + Scene.prototype.isActiveMesh = function (mesh) { + return (this._activeMeshes.indexOf(mesh) !== -1); + }; + Object.defineProperty(Scene.prototype, "uid", { + /** + * Return a unique id as a string which can serve as an identifier for the scene + */ + get: function () { + if (!this._uid) { + this._uid = BABYLON.Tools.RandomId(); + } + return this._uid; + }, + enumerable: true, + configurable: true + }); + /** + * Add an externaly attached data from its key. + * This method call will fail and return false, if such key already exists. + * If you don't care and just want to get the data no matter what, use the more convenient getOrAddExternalDataWithFactory() method. + * @param key the unique key that identifies the data + * @param data the data object to associate to the key for this Engine instance + * @return true if no such key were already present and the data was added successfully, false otherwise + */ + Scene.prototype.addExternalData = function (key, data) { + return this._externalData.add(key, data); + }; + /** + * Get an externaly attached data from its key + * @param key the unique key that identifies the data + * @return the associated data, if present (can be null), or undefined if not present + */ + Scene.prototype.getExternalData = function (key) { + return this._externalData.get(key); + }; + /** + * Get an externaly attached data from its key, create it using a factory if it's not already present + * @param key the unique key that identifies the data + * @param factory the factory that will be called to create the instance if and only if it doesn't exists + * @return the associated data, can be null if the factory returned null. + */ + Scene.prototype.getOrAddExternalDataWithFactory = function (key, factory) { + return this._externalData.getOrAddWithFactory(key, factory); + }; + /** + * Remove an externaly attached data from the Engine instance + * @param key the unique key that identifies the data + * @return true if the data was successfully removed, false if it doesn't exist + */ + Scene.prototype.removeExternalData = function (key) { + return this._externalData.remove(key); + }; + Scene.prototype._evaluateSubMesh = function (subMesh, mesh) { + if (mesh.alwaysSelectAsActiveMesh || mesh.subMeshes.length === 1 || subMesh.isInFrustum(this._frustumPlanes)) { + var material = subMesh.getMaterial(); + if (mesh.showSubMeshesBoundingBox) { + this._boundingBoxRenderer.renderList.push(subMesh.getBoundingInfo().boundingBox); + } + if (material) { + // Render targets + if (material.getRenderTargetTextures) { + if (this._processedMaterials.indexOf(material) === -1) { + this._processedMaterials.push(material); + this._renderTargets.concatWithNoDuplicate(material.getRenderTargetTextures()); + } + } + // Dispatch + this._activeIndices.addCount(subMesh.indexCount, false); + this._renderingManager.dispatch(subMesh); + } + } + }; + Scene.prototype._isInIntermediateRendering = function () { + return this._intermediateRendering; + }; + Scene.prototype._evaluateActiveMeshes = function () { + this.activeCamera._activeMeshes.reset(); + this._activeMeshes.reset(); + this._renderingManager.reset(); + this._processedMaterials.reset(); + this._activeParticleSystems.reset(); + this._activeSkeletons.reset(); + this._softwareSkinnedMeshes.reset(); + this._boundingBoxRenderer.reset(); + this._edgesRenderers.reset(); + // Meshes + var meshes; + var len; + if (this._selectionOctree) { + var selection = this._selectionOctree.select(this._frustumPlanes); + meshes = selection.data; + len = selection.length; + } + else { + len = this.meshes.length; + meshes = this.meshes; + } + for (var meshIndex = 0; meshIndex < len; meshIndex++) { + var mesh = meshes[meshIndex]; + if (mesh.isBlocked) { + continue; + } + this._totalVertices.addCount(mesh.getTotalVertices(), false); + if (!mesh.isReady() || !mesh.isEnabled()) { + continue; + } + mesh.computeWorldMatrix(); + // Intersections + if (mesh.actionManager && mesh.actionManager.hasSpecificTriggers([BABYLON.ActionManager.OnIntersectionEnterTrigger, BABYLON.ActionManager.OnIntersectionExitTrigger])) { + this._meshesForIntersections.pushNoDuplicate(mesh); + } + // Switch to current LOD + var meshLOD = mesh.getLOD(this.activeCamera); + if (!meshLOD) { + continue; + } + mesh._preActivate(); + if (mesh.alwaysSelectAsActiveMesh || mesh.isVisible && mesh.visibility > 0 && ((mesh.layerMask & this.activeCamera.layerMask) !== 0) && mesh.isInFrustum(this._frustumPlanes)) { + this._activeMeshes.push(mesh); + this.activeCamera._activeMeshes.push(mesh); + mesh._activate(this._renderId); + this._activeMesh(mesh, meshLOD); + } + } + // Particle systems + this._particlesDuration.beginMonitoring(); + var beforeParticlesDate = BABYLON.Tools.Now; + if (this.particlesEnabled) { + BABYLON.Tools.StartPerformanceCounter("Particles", this.particleSystems.length > 0); + for (var particleIndex = 0; particleIndex < this.particleSystems.length; particleIndex++) { + var particleSystem = this.particleSystems[particleIndex]; + if (!particleSystem.isStarted()) { + continue; + } + if (!particleSystem.emitter.position || (particleSystem.emitter && particleSystem.emitter.isEnabled())) { + this._activeParticleSystems.push(particleSystem); + particleSystem.animate(); + } + } + BABYLON.Tools.EndPerformanceCounter("Particles", this.particleSystems.length > 0); + } + this._particlesDuration.endMonitoring(false); + }; + Scene.prototype._activeMesh = function (sourceMesh, mesh) { + if (mesh.skeleton && this.skeletonsEnabled) { + if (this._activeSkeletons.pushNoDuplicate(mesh.skeleton)) { + mesh.skeleton.prepare(); + } + if (!mesh.computeBonesUsingShaders) { + this._softwareSkinnedMeshes.pushNoDuplicate(mesh); + } + } + if (sourceMesh.showBoundingBox || this.forceShowBoundingBoxes) { + this._boundingBoxRenderer.renderList.push(sourceMesh.getBoundingInfo().boundingBox); + } + if (sourceMesh._edgesRenderer) { + this._edgesRenderers.push(sourceMesh._edgesRenderer); + } + if (mesh && mesh.subMeshes) { + // Submeshes Octrees + var len; + var subMeshes; + if (mesh._submeshesOctree && mesh.useOctreeForRenderingSelection) { + var intersections = mesh._submeshesOctree.select(this._frustumPlanes); + len = intersections.length; + subMeshes = intersections.data; + } + else { + subMeshes = mesh.subMeshes; + len = subMeshes.length; + } + for (var subIndex = 0; subIndex < len; subIndex++) { + var subMesh = subMeshes[subIndex]; + this._evaluateSubMesh(subMesh, mesh); + } + } + }; + Scene.prototype.updateTransformMatrix = function (force) { + this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix(force)); + }; + Scene.prototype._renderForCamera = function (camera) { + var engine = this._engine; + var startTime = BABYLON.Tools.Now; + this.activeCamera = camera; + if (!this.activeCamera) + throw new Error("Active camera not set"); + BABYLON.Tools.StartPerformanceCounter("Rendering camera " + this.activeCamera.name); + // Viewport + engine.setViewport(this.activeCamera.viewport); + // Camera + this.resetCachedMaterial(); + this._renderId++; + this.updateTransformMatrix(); + this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera); + // Meshes + this._evaluateActiveMeshesDuration.beginMonitoring(); + BABYLON.Tools.StartPerformanceCounter("Active meshes evaluation"); + this._evaluateActiveMeshes(); + this._evaluateActiveMeshesDuration.endMonitoring(false); + BABYLON.Tools.EndPerformanceCounter("Active meshes evaluation"); + // Software skinning + for (var softwareSkinnedMeshIndex = 0; softwareSkinnedMeshIndex < this._softwareSkinnedMeshes.length; softwareSkinnedMeshIndex++) { + var mesh = this._softwareSkinnedMeshes.data[softwareSkinnedMeshIndex]; + mesh.applySkeleton(mesh.skeleton); + } + // Render targets + this._renderTargetsDuration.beginMonitoring(); + var needsRestoreFrameBuffer = false; + var beforeRenderTargetDate = BABYLON.Tools.Now; + if (this.renderTargetsEnabled && this._renderTargets.length > 0) { + this._intermediateRendering = true; + BABYLON.Tools.StartPerformanceCounter("Render targets", this._renderTargets.length > 0); + for (var renderIndex = 0; renderIndex < this._renderTargets.length; renderIndex++) { + var renderTarget = this._renderTargets.data[renderIndex]; + if (renderTarget._shouldRender()) { + this._renderId++; + var hasSpecialRenderTargetCamera = renderTarget.activeCamera && renderTarget.activeCamera !== this.activeCamera; + renderTarget.render(hasSpecialRenderTargetCamera, this.dumpNextRenderTargets); + } + } + BABYLON.Tools.EndPerformanceCounter("Render targets", this._renderTargets.length > 0); + this._intermediateRendering = false; + this._renderId++; + needsRestoreFrameBuffer = true; // Restore back buffer + } + // Render HighlightLayer Texture + var stencilState = this._engine.getStencilBuffer(); + var renderhighlights = false; + if (this.renderTargetsEnabled && this.highlightLayers && this.highlightLayers.length > 0) { + this._intermediateRendering = true; + for (var i = 0; i < this.highlightLayers.length; i++) { + var highlightLayer = this.highlightLayers[i]; + if (highlightLayer.shouldRender() && + (!highlightLayer.camera || + (highlightLayer.camera.cameraRigMode === BABYLON.Camera.RIG_MODE_NONE && camera === highlightLayer.camera) || + (highlightLayer.camera.cameraRigMode !== BABYLON.Camera.RIG_MODE_NONE && highlightLayer.camera._rigCameras.indexOf(camera) > -1))) { + renderhighlights = true; + var renderTarget = highlightLayer._mainTexture; + if (renderTarget._shouldRender()) { + this._renderId++; + renderTarget.render(false, false); + needsRestoreFrameBuffer = true; + } + } + } + this._intermediateRendering = false; + this._renderId++; + } + if (needsRestoreFrameBuffer) { + engine.restoreDefaultFramebuffer(); + } + this._renderTargetsDuration.endMonitoring(false); + // Prepare Frame + this.postProcessManager._prepareFrame(); + this._renderDuration.beginMonitoring(); + // Backgrounds + var layerIndex; + var layer; + if (this.layers.length) { + engine.setDepthBuffer(false); + for (layerIndex = 0; layerIndex < this.layers.length; layerIndex++) { + layer = this.layers[layerIndex]; + if (layer.isBackground) { + layer.render(); + } + } + engine.setDepthBuffer(true); + } + // Render + BABYLON.Tools.StartPerformanceCounter("Main render"); + // Activate HighlightLayer stencil + if (renderhighlights) { + this._engine.setStencilBuffer(true); + } + this._renderingManager.render(null, null, true, true); + // Restore HighlightLayer stencil + if (renderhighlights) { + this._engine.setStencilBuffer(stencilState); + } + BABYLON.Tools.EndPerformanceCounter("Main render"); + // Bounding boxes + this._boundingBoxRenderer.render(); + // Edges + for (var edgesRendererIndex = 0; edgesRendererIndex < this._edgesRenderers.length; edgesRendererIndex++) { + this._edgesRenderers.data[edgesRendererIndex].render(); + } + // Lens flares + if (this.lensFlaresEnabled) { + BABYLON.Tools.StartPerformanceCounter("Lens flares", this.lensFlareSystems.length > 0); + for (var lensFlareSystemIndex = 0; lensFlareSystemIndex < this.lensFlareSystems.length; lensFlareSystemIndex++) { + var lensFlareSystem = this.lensFlareSystems[lensFlareSystemIndex]; + if ((camera.layerMask & lensFlareSystem.layerMask) !== 0) { + lensFlareSystem.render(); + } + } + BABYLON.Tools.EndPerformanceCounter("Lens flares", this.lensFlareSystems.length > 0); + } + // Foregrounds + if (this.layers.length) { + engine.setDepthBuffer(false); + for (layerIndex = 0; layerIndex < this.layers.length; layerIndex++) { + layer = this.layers[layerIndex]; + if (!layer.isBackground) { + layer.render(); + } + } + engine.setDepthBuffer(true); + } + // Highlight Layer + if (renderhighlights) { + engine.setDepthBuffer(false); + for (var i = 0; i < this.highlightLayers.length; i++) { + if (this.highlightLayers[i].shouldRender()) { + this.highlightLayers[i].render(); + } + } + engine.setDepthBuffer(true); + } + this._renderDuration.endMonitoring(false); + // Finalize frame + this.postProcessManager._finalizeFrame(camera.isIntermediate); + // Update camera + this.activeCamera._updateFromScene(); + // Reset some special arrays + this._renderTargets.reset(); + this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera); + BABYLON.Tools.EndPerformanceCounter("Rendering camera " + this.activeCamera.name); + }; + Scene.prototype._processSubCameras = function (camera) { + if (camera.cameraRigMode === BABYLON.Camera.RIG_MODE_NONE) { + this._renderForCamera(camera); + return; + } + // rig cameras + for (var index = 0; index < camera._rigCameras.length; index++) { + this._renderForCamera(camera._rigCameras[index]); + } + this.activeCamera = camera; + this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix()); + // Update camera + this.activeCamera._updateFromScene(); + }; + Scene.prototype._checkIntersections = function () { + for (var index = 0; index < this._meshesForIntersections.length; index++) { + var sourceMesh = this._meshesForIntersections.data[index]; + for (var actionIndex = 0; actionIndex < sourceMesh.actionManager.actions.length; actionIndex++) { + var action = sourceMesh.actionManager.actions[actionIndex]; + if (action.trigger === BABYLON.ActionManager.OnIntersectionEnterTrigger || action.trigger === BABYLON.ActionManager.OnIntersectionExitTrigger) { + var parameters = action.getTriggerParameter(); + var otherMesh = parameters instanceof BABYLON.AbstractMesh ? parameters : parameters.mesh; + var areIntersecting = otherMesh.intersectsMesh(sourceMesh, parameters.usePreciseIntersection); + var currentIntersectionInProgress = sourceMesh._intersectionsInProgress.indexOf(otherMesh); + if (areIntersecting && currentIntersectionInProgress === -1) { + if (action.trigger === BABYLON.ActionManager.OnIntersectionEnterTrigger) { + action._executeCurrent(BABYLON.ActionEvent.CreateNew(sourceMesh, null, otherMesh)); + sourceMesh._intersectionsInProgress.push(otherMesh); + } + else if (action.trigger === BABYLON.ActionManager.OnIntersectionExitTrigger) { + sourceMesh._intersectionsInProgress.push(otherMesh); + } + } + else if (!areIntersecting && currentIntersectionInProgress > -1) { + //They intersected, and now they don't. + //is this trigger an exit trigger? execute an event. + if (action.trigger === BABYLON.ActionManager.OnIntersectionExitTrigger) { + action._executeCurrent(BABYLON.ActionEvent.CreateNew(sourceMesh, null, otherMesh)); + } + //if this is an exit trigger, or no exit trigger exists, remove the id from the intersection in progress array. + if (!sourceMesh.actionManager.hasSpecificTrigger(BABYLON.ActionManager.OnIntersectionExitTrigger) || action.trigger === BABYLON.ActionManager.OnIntersectionExitTrigger) { + sourceMesh._intersectionsInProgress.splice(currentIntersectionInProgress, 1); + } + } + } + } + } + }; + Scene.prototype.render = function () { + this._lastFrameDuration.beginMonitoring(); + this._particlesDuration.fetchNewFrame(); + this._spritesDuration.fetchNewFrame(); + this._activeParticles.fetchNewFrame(); + this._renderDuration.fetchNewFrame(); + this._renderTargetsDuration.fetchNewFrame(); + this._evaluateActiveMeshesDuration.fetchNewFrame(); + this._totalVertices.fetchNewFrame(); + this._activeIndices.fetchNewFrame(); + this._activeBones.fetchNewFrame(); + this.getEngine().drawCallsPerfCounter.fetchNewFrame(); + this._meshesForIntersections.reset(); + this.resetCachedMaterial(); + BABYLON.Tools.StartPerformanceCounter("Scene rendering"); + // Actions + if (this.actionManager) { + this.actionManager.processTrigger(BABYLON.ActionManager.OnEveryFrameTrigger, null); + } + //Simplification Queue + if (this.simplificationQueue && !this.simplificationQueue.running) { + this.simplificationQueue.executeNext(); + } + // Animations + var deltaTime = Math.max(Scene.MinDeltaTime, Math.min(this._engine.getDeltaTime(), Scene.MaxDeltaTime)); + this._animationRatio = deltaTime * (60.0 / 1000.0); + this._animate(); + // Physics + if (this._physicsEngine) { + BABYLON.Tools.StartPerformanceCounter("Physics"); + this._physicsEngine._step(deltaTime / 1000.0); + BABYLON.Tools.EndPerformanceCounter("Physics"); + } + // Before render + this.onBeforeRenderObservable.notifyObservers(this); + // Customs render targets + this._renderTargetsDuration.beginMonitoring(); + var beforeRenderTargetDate = BABYLON.Tools.Now; + var engine = this.getEngine(); + var currentActiveCamera = this.activeCamera; + if (this.renderTargetsEnabled) { + BABYLON.Tools.StartPerformanceCounter("Custom render targets", this.customRenderTargets.length > 0); + for (var customIndex = 0; customIndex < this.customRenderTargets.length; customIndex++) { + var renderTarget = this.customRenderTargets[customIndex]; + if (renderTarget._shouldRender()) { + this._renderId++; + this.activeCamera = renderTarget.activeCamera || this.activeCamera; + if (!this.activeCamera) + throw new Error("Active camera not set"); + // Viewport + engine.setViewport(this.activeCamera.viewport); + // Camera + this.updateTransformMatrix(); + renderTarget.render(currentActiveCamera !== this.activeCamera, this.dumpNextRenderTargets); + } + } + BABYLON.Tools.EndPerformanceCounter("Custom render targets", this.customRenderTargets.length > 0); + this._renderId++; + } + if (this.customRenderTargets.length > 0) { + engine.restoreDefaultFramebuffer(); + } + this._renderTargetsDuration.endMonitoring(); + this.activeCamera = currentActiveCamera; + // Procedural textures + if (this.proceduralTexturesEnabled) { + BABYLON.Tools.StartPerformanceCounter("Procedural textures", this._proceduralTextures.length > 0); + for (var proceduralIndex = 0; proceduralIndex < this._proceduralTextures.length; proceduralIndex++) { + var proceduralTexture = this._proceduralTextures[proceduralIndex]; + if (proceduralTexture._shouldRender()) { + proceduralTexture.render(); + } + } + BABYLON.Tools.EndPerformanceCounter("Procedural textures", this._proceduralTextures.length > 0); + } + // Clear + this._engine.clear(this.clearColor, this.autoClear || this.forceWireframe || this.forcePointsCloud, true, true); + // Shadows + if (this.shadowsEnabled) { + for (var lightIndex = 0; lightIndex < this.lights.length; lightIndex++) { + var light = this.lights[lightIndex]; + var shadowGenerator = light.getShadowGenerator(); + if (light.isEnabled() && shadowGenerator && shadowGenerator.getShadowMap().getScene().textures.indexOf(shadowGenerator.getShadowMap()) !== -1) { + this._renderTargets.push(shadowGenerator.getShadowMap()); + } + } + } + // Depth renderer + if (this._depthRenderer) { + this._renderTargets.push(this._depthRenderer.getDepthMap()); + } + // RenderPipeline + this.postProcessRenderPipelineManager.update(); + // Multi-cameras? + if (this.activeCameras.length > 0) { + for (var cameraIndex = 0; cameraIndex < this.activeCameras.length; cameraIndex++) { + if (cameraIndex > 0) { + this._engine.clear(0, false, true, true); + } + this._processSubCameras(this.activeCameras[cameraIndex]); + } + } + else { + if (!this.activeCamera) { + throw new Error("No camera defined"); + } + this._processSubCameras(this.activeCamera); + } + // Intersection checks + this._checkIntersections(); + // Update the audio listener attached to the camera + if (BABYLON.AudioEngine) { + this._updateAudioParameters(); + } + // After render + if (this.afterRender) { + this.afterRender(); + } + this.onAfterRenderObservable.notifyObservers(this); + // Cleaning + for (var index = 0; index < this._toBeDisposed.length; index++) { + this._toBeDisposed.data[index].dispose(); + this._toBeDisposed[index] = null; + } + this._toBeDisposed.reset(); + if (this.dumpNextRenderTargets) { + this.dumpNextRenderTargets = false; + } + BABYLON.Tools.EndPerformanceCounter("Scene rendering"); + this._lastFrameDuration.endMonitoring(); + this._totalMeshesCounter.addCount(this.meshes.length, true); + this._totalLightsCounter.addCount(this.lights.length, true); + this._totalMaterialsCounter.addCount(this.materials.length, true); + this._totalTexturesCounter.addCount(this.textures.length, true); + this._activeBones.addCount(0, true); + this._activeIndices.addCount(0, true); + this._activeParticles.addCount(0, true); + }; + Scene.prototype._updateAudioParameters = function () { + if (!this.audioEnabled || (this.mainSoundTrack.soundCollection.length === 0 && this.soundTracks.length === 1)) { + return; + } + var listeningCamera; + var audioEngine = BABYLON.Engine.audioEngine; + if (this.activeCameras.length > 0) { + listeningCamera = this.activeCameras[0]; + } + else { + listeningCamera = this.activeCamera; + } + if (listeningCamera && audioEngine.canUseWebAudio) { + audioEngine.audioContext.listener.setPosition(listeningCamera.position.x, listeningCamera.position.y, listeningCamera.position.z); + var mat = BABYLON.Matrix.Invert(listeningCamera.getViewMatrix()); + var cameraDirection = BABYLON.Vector3.TransformNormal(new BABYLON.Vector3(0, 0, -1), mat); + cameraDirection.normalize(); + audioEngine.audioContext.listener.setOrientation(cameraDirection.x, cameraDirection.y, cameraDirection.z, 0, 1, 0); + var i; + for (i = 0; i < this.mainSoundTrack.soundCollection.length; i++) { + var sound = this.mainSoundTrack.soundCollection[i]; + if (sound.useCustomAttenuation) { + sound.updateDistanceFromListener(); + } + } + for (i = 0; i < this.soundTracks.length; i++) { + for (var j = 0; j < this.soundTracks[i].soundCollection.length; j++) { + sound = this.soundTracks[i].soundCollection[j]; + if (sound.useCustomAttenuation) { + sound.updateDistanceFromListener(); + } + } + } + } + }; + Object.defineProperty(Scene.prototype, "audioEnabled", { + // Audio + get: function () { + return this._audioEnabled; + }, + set: function (value) { + this._audioEnabled = value; + if (BABYLON.AudioEngine) { + if (this._audioEnabled) { + this._enableAudio(); + } + else { + this._disableAudio(); + } + } + }, + enumerable: true, + configurable: true + }); + Scene.prototype._disableAudio = function () { + var i; + for (i = 0; i < this.mainSoundTrack.soundCollection.length; i++) { + this.mainSoundTrack.soundCollection[i].pause(); + } + for (i = 0; i < this.soundTracks.length; i++) { + for (var j = 0; j < this.soundTracks[i].soundCollection.length; j++) { + this.soundTracks[i].soundCollection[j].pause(); + } + } + }; + Scene.prototype._enableAudio = function () { + var i; + for (i = 0; i < this.mainSoundTrack.soundCollection.length; i++) { + if (this.mainSoundTrack.soundCollection[i].isPaused) { + this.mainSoundTrack.soundCollection[i].play(); + } + } + for (i = 0; i < this.soundTracks.length; i++) { + for (var j = 0; j < this.soundTracks[i].soundCollection.length; j++) { + if (this.soundTracks[i].soundCollection[j].isPaused) { + this.soundTracks[i].soundCollection[j].play(); + } + } + } + }; + Object.defineProperty(Scene.prototype, "headphone", { + get: function () { + return this._headphone; + }, + set: function (value) { + this._headphone = value; + if (BABYLON.AudioEngine) { + if (this._headphone) { + this._switchAudioModeForHeadphones(); + } + else { + this._switchAudioModeForNormalSpeakers(); + } + } + }, + enumerable: true, + configurable: true + }); + Scene.prototype._switchAudioModeForHeadphones = function () { + this.mainSoundTrack.switchPanningModelToHRTF(); + for (var i = 0; i < this.soundTracks.length; i++) { + this.soundTracks[i].switchPanningModelToHRTF(); + } + }; + Scene.prototype._switchAudioModeForNormalSpeakers = function () { + this.mainSoundTrack.switchPanningModelToEqualPower(); + for (var i = 0; i < this.soundTracks.length; i++) { + this.soundTracks[i].switchPanningModelToEqualPower(); + } + }; + Scene.prototype.enableDepthRenderer = function () { + if (this._depthRenderer) { + return this._depthRenderer; + } + this._depthRenderer = new BABYLON.DepthRenderer(this); + return this._depthRenderer; + }; + Scene.prototype.disableDepthRenderer = function () { + if (!this._depthRenderer) { + return; + } + this._depthRenderer.dispose(); + this._depthRenderer = null; + }; + Scene.prototype.freezeMaterials = function () { + for (var i = 0; i < this.materials.length; i++) { + this.materials[i].freeze(); + } + }; + Scene.prototype.unfreezeMaterials = function () { + for (var i = 0; i < this.materials.length; i++) { + this.materials[i].unfreeze(); + } + }; + Scene.prototype.dispose = function () { + this.beforeRender = null; + this.afterRender = null; + this.skeletons = []; + this._boundingBoxRenderer.dispose(); + if (this._depthRenderer) { + this._depthRenderer.dispose(); + } + // Debug layer + if (this._debugLayer) { + this._debugLayer.hide(); + } + // Events + this.onDisposeObservable.notifyObservers(this); + this.onDisposeObservable.clear(); + this.onBeforeRenderObservable.clear(); + this.onAfterRenderObservable.clear(); + this.detachControl(); + // Release sounds & sounds tracks + if (BABYLON.AudioEngine) { + this.disposeSounds(); + } + // Detach cameras + var canvas = this._engine.getRenderingCanvas(); + var index; + for (index = 0; index < this.cameras.length; index++) { + this.cameras[index].detachControl(canvas); + } + // Release lights + while (this.lights.length) { + this.lights[0].dispose(); + } + // Release meshes + while (this.meshes.length) { + this.meshes[0].dispose(true); + } + // Release cameras + while (this.cameras.length) { + this.cameras[0].dispose(); + } + // Release materials + while (this.materials.length) { + this.materials[0].dispose(); + } + // Release particles + while (this.particleSystems.length) { + this.particleSystems[0].dispose(); + } + // Release sprites + while (this.spriteManagers.length) { + this.spriteManagers[0].dispose(); + } + // Release layers + while (this.layers.length) { + this.layers[0].dispose(); + } + while (this.highlightLayers.length) { + this.highlightLayers[0].dispose(); + } + // Release textures + while (this.textures.length) { + this.textures[0].dispose(); + } + // Post-processes + this.postProcessManager.dispose(); + // Physics + if (this._physicsEngine) { + this.disablePhysicsEngine(); + } + // Remove from engine + index = this._engine.scenes.indexOf(this); + if (index > -1) { + this._engine.scenes.splice(index, 1); + } + this._engine.wipeCaches(); + }; + // Release sounds & sounds tracks + Scene.prototype.disposeSounds = function () { + this.mainSoundTrack.dispose(); + for (var scIndex = 0; scIndex < this.soundTracks.length; scIndex++) { + this.soundTracks[scIndex].dispose(); + } + }; + // Octrees + Scene.prototype.getWorldExtends = function () { + var min = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + var max = new BABYLON.Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE); + for (var index = 0; index < this.meshes.length; index++) { + var mesh = this.meshes[index]; + mesh.computeWorldMatrix(true); + var minBox = mesh.getBoundingInfo().boundingBox.minimumWorld; + var maxBox = mesh.getBoundingInfo().boundingBox.maximumWorld; + BABYLON.Tools.CheckExtends(minBox, min, max); + BABYLON.Tools.CheckExtends(maxBox, min, max); + } + return { + min: min, + max: max + }; + }; + Scene.prototype.createOrUpdateSelectionOctree = function (maxCapacity, maxDepth) { + if (maxCapacity === void 0) { maxCapacity = 64; } + if (maxDepth === void 0) { maxDepth = 2; } + if (!this._selectionOctree) { + this._selectionOctree = new BABYLON.Octree(BABYLON.Octree.CreationFuncForMeshes, maxCapacity, maxDepth); + } + var worldExtends = this.getWorldExtends(); + // Update octree + this._selectionOctree.update(worldExtends.min, worldExtends.max, this.meshes); + return this._selectionOctree; + }; + // Picking + Scene.prototype.createPickingRay = function (x, y, world, camera, cameraViewSpace) { + if (cameraViewSpace === void 0) { cameraViewSpace = false; } + var engine = this._engine; + if (!camera) { + if (!this.activeCamera) + throw new Error("Active camera not set"); + camera = this.activeCamera; + } + var cameraViewport = camera.viewport; + var viewport = cameraViewport.toGlobal(engine.getRenderWidth(), engine.getRenderHeight()); + // Moving coordinates to local viewport world + x = x / this._engine.getHardwareScalingLevel() - viewport.x; + y = y / this._engine.getHardwareScalingLevel() - (this._engine.getRenderHeight() - viewport.y - viewport.height); + return BABYLON.Ray.CreateNew(x, y, viewport.width, viewport.height, world ? world : BABYLON.Matrix.Identity(), cameraViewSpace ? BABYLON.Matrix.Identity() : camera.getViewMatrix(), camera.getProjectionMatrix()); + // return BABYLON.Ray.CreateNew(x / window.devicePixelRatio, y / window.devicePixelRatio, viewport.width, viewport.height, world ? world : BABYLON.Matrix.Identity(), camera.getViewMatrix(), camera.getProjectionMatrix()); + }; + Scene.prototype.createPickingRayInCameraSpace = function (x, y, camera) { + var engine = this._engine; + if (!camera) { + if (!this.activeCamera) + throw new Error("Active camera not set"); + camera = this.activeCamera; + } + var cameraViewport = camera.viewport; + var viewport = cameraViewport.toGlobal(engine.getRenderWidth(), engine.getRenderHeight()); + var identity = BABYLON.Matrix.Identity(); + // Moving coordinates to local viewport world + x = x / this._engine.getHardwareScalingLevel() - viewport.x; + y = y / this._engine.getHardwareScalingLevel() - (this._engine.getRenderHeight() - viewport.y - viewport.height); + return BABYLON.Ray.CreateNew(x, y, viewport.width, viewport.height, identity, identity, camera.getProjectionMatrix()); + }; + Scene.prototype._internalPick = function (rayFunction, predicate, fastCheck) { + var pickingInfo = null; + for (var meshIndex = 0; meshIndex < this.meshes.length; meshIndex++) { + var mesh = this.meshes[meshIndex]; + if (predicate) { + if (!predicate(mesh)) { + continue; + } + } + else if (!mesh.isEnabled() || !mesh.isVisible || !mesh.isPickable) { + continue; + } + var world = mesh.getWorldMatrix(); + var ray = rayFunction(world); + var result = mesh.intersects(ray, fastCheck); + if (!result || !result.hit) + continue; + if (!fastCheck && pickingInfo != null && result.distance >= pickingInfo.distance) + continue; + pickingInfo = result; + if (fastCheck) { + break; + } + } + return pickingInfo || new BABYLON.PickingInfo(); + }; + Scene.prototype._internalMultiPick = function (rayFunction, predicate) { + var pickingInfos = new Array(); + for (var meshIndex = 0; meshIndex < this.meshes.length; meshIndex++) { + var mesh = this.meshes[meshIndex]; + if (predicate) { + if (!predicate(mesh)) { + continue; + } + } + else if (!mesh.isEnabled() || !mesh.isVisible || !mesh.isPickable) { + continue; + } + var world = mesh.getWorldMatrix(); + var ray = rayFunction(world); + var result = mesh.intersects(ray, false); + if (!result || !result.hit) + continue; + pickingInfos.push(result); + } + return pickingInfos; + }; + Scene.prototype._internalPickSprites = function (ray, predicate, fastCheck, camera) { + var pickingInfo = null; + camera = camera || this.activeCamera; + if (this.spriteManagers.length > 0) { + for (var spriteIndex = 0; spriteIndex < this.spriteManagers.length; spriteIndex++) { + var spriteManager = this.spriteManagers[spriteIndex]; + if (!spriteManager.isPickable) { + continue; + } + var result = spriteManager.intersects(ray, camera, predicate, fastCheck); + if (!result || !result.hit) + continue; + if (!fastCheck && pickingInfo != null && result.distance >= pickingInfo.distance) + continue; + pickingInfo = result; + if (fastCheck) { + break; + } + } + } + return pickingInfo || new BABYLON.PickingInfo(); + }; + /// Launch a ray to try to pick a mesh in the scene + /// X position on screen + /// Y position on screen + /// Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true + /// Launch a fast check only using the bounding boxes. Can be set to null. + /// camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used + Scene.prototype.pick = function (x, y, predicate, fastCheck, camera) { + var _this = this; + return this._internalPick(function (world) { return _this.createPickingRay(x, y, world, camera); }, predicate, fastCheck); + }; + /// Launch a ray to try to pick a mesh in the scene + /// X position on screen + /// Y position on screen + /// Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true + /// Launch a fast check only using the bounding boxes. Can be set to null. + /// camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used + Scene.prototype.pickSprite = function (x, y, predicate, fastCheck, camera) { + return this._internalPickSprites(this.createPickingRayInCameraSpace(x, y, camera), predicate, fastCheck, camera); + }; + Scene.prototype.pickWithRay = function (ray, predicate, fastCheck) { + var _this = this; + return this._internalPick(function (world) { + if (!_this._pickWithRayInverseMatrix) { + _this._pickWithRayInverseMatrix = BABYLON.Matrix.Identity(); + } + world.invertToRef(_this._pickWithRayInverseMatrix); + return BABYLON.Ray.Transform(ray, _this._pickWithRayInverseMatrix); + }, predicate, fastCheck); + }; + /// Launch a ray to try to pick a mesh in the scene + /// X position on screen + /// Y position on screen + /// Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true + /// camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used + Scene.prototype.multiPick = function (x, y, predicate, camera) { + var _this = this; + return this._internalMultiPick(function (world) { return _this.createPickingRay(x, y, world, camera); }, predicate); + }; + /// Launch a ray to try to pick a mesh in the scene + /// Ray to use + /// Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true + Scene.prototype.multiPickWithRay = function (ray, predicate) { + var _this = this; + return this._internalMultiPick(function (world) { + if (!_this._pickWithRayInverseMatrix) { + _this._pickWithRayInverseMatrix = BABYLON.Matrix.Identity(); + } + world.invertToRef(_this._pickWithRayInverseMatrix); + return BABYLON.Ray.Transform(ray, _this._pickWithRayInverseMatrix); + }, predicate); + }; + Scene.prototype.setPointerOverMesh = function (mesh) { + if (this._pointerOverMesh === mesh) { + return; + } + if (this._pointerOverMesh && this._pointerOverMesh.actionManager) { + this._pointerOverMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPointerOutTrigger, BABYLON.ActionEvent.CreateNew(this._pointerOverMesh)); + } + this._pointerOverMesh = mesh; + if (this._pointerOverMesh && this._pointerOverMesh.actionManager) { + this._pointerOverMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPointerOverTrigger, BABYLON.ActionEvent.CreateNew(this._pointerOverMesh)); + } + }; + Scene.prototype.getPointerOverMesh = function () { + return this._pointerOverMesh; + }; + Scene.prototype.setPointerOverSprite = function (sprite) { + if (this._pointerOverSprite === sprite) { + return; + } + if (this._pointerOverSprite && this._pointerOverSprite.actionManager) { + this._pointerOverSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPointerOutTrigger, BABYLON.ActionEvent.CreateNewFromSprite(this._pointerOverSprite, this)); + } + this._pointerOverSprite = sprite; + if (this._pointerOverSprite && this._pointerOverSprite.actionManager) { + this._pointerOverSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPointerOverTrigger, BABYLON.ActionEvent.CreateNewFromSprite(this._pointerOverSprite, this)); + } + }; + Scene.prototype.getPointerOverSprite = function () { + return this._pointerOverSprite; + }; + // Physics + Scene.prototype.getPhysicsEngine = function () { + return this._physicsEngine; + }; + /** + * Enables physics to the current scene + * @param {BABYLON.Vector3} [gravity] - the scene's gravity for the physics engine + * @param {BABYLON.IPhysicsEnginePlugin} [plugin] - The physics engine to be used. defaults to OimoJS. + * @return {boolean} was the physics engine initialized + */ + Scene.prototype.enablePhysics = function (gravity, plugin) { + if (this._physicsEngine) { + return true; + } + try { + this._physicsEngine = new BABYLON.PhysicsEngine(gravity, plugin); + return true; + } + catch (e) { + BABYLON.Tools.Error(e.message); + return false; + } + }; + Scene.prototype.disablePhysicsEngine = function () { + if (!this._physicsEngine) { + return; + } + this._physicsEngine.dispose(); + this._physicsEngine = undefined; + }; + Scene.prototype.isPhysicsEnabled = function () { + return this._physicsEngine !== undefined; + }; + /** + * + * Sets the gravity of the physics engine (and NOT of the scene) + * @param {BABYLON.Vector3} [gravity] - the new gravity to be used + */ + Scene.prototype.setGravity = function (gravity) { + BABYLON.Tools.Warn("Deprecated, please use 'scene.getPhysicsEngine().setGravity()'"); + if (!this._physicsEngine) { + return; + } + this._physicsEngine.setGravity(gravity); + }; + /** + * Legacy support, using the new API + * @Deprecated + */ + Scene.prototype.createCompoundImpostor = function (parts, options) { + BABYLON.Tools.Warn("Scene.createCompoundImpostor is deprecated. Please use PhysicsImpostor parent/child"); + if (parts.parts) { + options = parts; + parts = parts.parts; + } + var mainMesh = parts[0].mesh; + mainMesh.physicsImpostor = new BABYLON.PhysicsImpostor(mainMesh, parts[0].impostor, options, this); + for (var index = 1; index < parts.length; index++) { + var mesh = parts[index].mesh; + if (mesh.parent !== mainMesh) { + mesh.position = mesh.position.subtract(mainMesh.position); + mesh.parent = mainMesh; + } + mesh.physicsImpostor = new BABYLON.PhysicsImpostor(mesh, parts[index].impostor, options, this); + } + mainMesh.physicsImpostor.forceUpdate(); + }; + Scene.prototype.deleteCompoundImpostor = function (compound) { + var mesh = compound.parts[0].mesh; + mesh.physicsImpostor.dispose(); + mesh.physicsImpostor = null; + }; + // Misc. + Scene.prototype.createDefaultCameraOrLight = function () { + // Light + if (this.lights.length === 0) { + new BABYLON.HemisphericLight("default light", BABYLON.Vector3.Up(), this); + } + // Camera + if (!this.activeCamera) { + var camera = new BABYLON.FreeCamera("default camera", BABYLON.Vector3.Zero(), this); + // Compute position + var worldExtends = this.getWorldExtends(); + var worldCenter = worldExtends.min.add(worldExtends.max.subtract(worldExtends.min).scale(0.5)); + camera.position = new BABYLON.Vector3(worldCenter.x, worldCenter.y, worldExtends.min.z - (worldExtends.max.z - worldExtends.min.z)); + camera.setTarget(worldCenter); + this.activeCamera = camera; + } + }; + // Tags + Scene.prototype._getByTags = function (list, tagsQuery, forEach) { + if (tagsQuery === undefined) { + // returns the complete list (could be done with BABYLON.Tags.MatchesQuery but no need to have a for-loop here) + return list; + } + var listByTags = []; + forEach = forEach || (function (item) { return; }); + for (var i in list) { + var item = list[i]; + if (BABYLON.Tags.MatchesQuery(item, tagsQuery)) { + listByTags.push(item); + forEach(item); + } + } + return listByTags; + }; + Scene.prototype.getMeshesByTags = function (tagsQuery, forEach) { + return this._getByTags(this.meshes, tagsQuery, forEach); + }; + Scene.prototype.getCamerasByTags = function (tagsQuery, forEach) { + return this._getByTags(this.cameras, tagsQuery, forEach); + }; + Scene.prototype.getLightsByTags = function (tagsQuery, forEach) { + return this._getByTags(this.lights, tagsQuery, forEach); + }; + Scene.prototype.getMaterialByTags = function (tagsQuery, forEach) { + return this._getByTags(this.materials, tagsQuery, forEach).concat(this._getByTags(this.multiMaterials, tagsQuery, forEach)); + }; + /** + * Overrides the default sort function applied in the renderging group to prepare the meshes. + * This allowed control for front to back rendering or reversly depending of the special needs. + * + * @param renderingGroupId The rendering group id corresponding to its index + * @param opaqueSortCompareFn The opaque queue comparison function use to sort. + * @param alphaTestSortCompareFn The alpha test queue comparison function use to sort. + * @param transparentSortCompareFn The transparent queue comparison function use to sort. + */ + Scene.prototype.setRenderingOrder = function (renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn) { + if (opaqueSortCompareFn === void 0) { opaqueSortCompareFn = null; } + if (alphaTestSortCompareFn === void 0) { alphaTestSortCompareFn = null; } + if (transparentSortCompareFn === void 0) { transparentSortCompareFn = null; } + this._renderingManager.setRenderingOrder(renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn); + }; + /** + * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups. + * + * @param renderingGroupId The rendering group id corresponding to its index + * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true. + */ + Scene.prototype.setRenderingAutoClearDepthStencil = function (renderingGroupId, autoClearDepthStencil) { + this._renderingManager.setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil); + }; + // Statics + Scene._FOGMODE_NONE = 0; + Scene._FOGMODE_EXP = 1; + Scene._FOGMODE_EXP2 = 2; + Scene._FOGMODE_LINEAR = 3; + Scene.MinDeltaTime = 1.0; + Scene.MaxDeltaTime = 1000.0; + return Scene; + }()); + BABYLON.Scene = Scene; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.scene.js.map + +var BABYLON; +(function (BABYLON) { + var Buffer = (function () { + function Buffer(engine, data, updatable, stride, postponeInternalCreation, instanced) { + if (engine instanceof BABYLON.Mesh) { + this._engine = engine.getScene().getEngine(); + } + else { + this._engine = engine; + } + this._updatable = updatable; + this._data = data; + this._strideSize = stride; + if (!postponeInternalCreation) { + this.create(); + } + this._instanced = instanced; + } + Buffer.prototype.createVertexBuffer = function (kind, offset, size, stride) { + // a lot of these parameters are ignored as they are overriden by the buffer + return new BABYLON.VertexBuffer(this._engine, this, kind, this._updatable, true, stride ? stride : this._strideSize, this._instanced, offset, size); + }; + // Properties + Buffer.prototype.isUpdatable = function () { + return this._updatable; + }; + Buffer.prototype.getData = function () { + return this._data; + }; + Buffer.prototype.getBuffer = function () { + return this._buffer; + }; + Buffer.prototype.getStrideSize = function () { + return this._strideSize; + }; + Buffer.prototype.getIsInstanced = function () { + return this._instanced; + }; + // Methods + Buffer.prototype.create = function (data) { + if (!data && this._buffer) { + return; // nothing to do + } + data = data || this._data; + if (!this._buffer) { + if (this._updatable) { + this._buffer = this._engine.createDynamicVertexBuffer(data); + this._data = data; + } + else { + this._buffer = this._engine.createVertexBuffer(data); + } + } + else if (this._updatable) { + this._engine.updateDynamicVertexBuffer(this._buffer, data); + this._data = data; + } + }; + Buffer.prototype.update = function (data) { + this.create(data); + }; + Buffer.prototype.updateDirectly = function (data, offset, vertexCount) { + if (!this._buffer) { + return; + } + if (this._updatable) { + this._engine.updateDynamicVertexBuffer(this._buffer, data, offset, (vertexCount ? vertexCount * this.getStrideSize() : undefined)); + this._data = null; + } + }; + Buffer.prototype.dispose = function () { + if (!this._buffer) { + return; + } + if (this._engine._releaseBuffer(this._buffer)) { + this._buffer = null; + } + }; + return Buffer; + }()); + BABYLON.Buffer = Buffer; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.buffer.js.map + +var BABYLON; +(function (BABYLON) { + var VertexBuffer = (function () { + function VertexBuffer(engine, data, kind, updatable, postponeInternalCreation, stride, instanced, offset, size) { + if (!stride) { + // Deduce stride from kind + switch (kind) { + case VertexBuffer.PositionKind: + stride = 3; + break; + case VertexBuffer.NormalKind: + stride = 3; + break; + case VertexBuffer.UVKind: + case VertexBuffer.UV2Kind: + case VertexBuffer.UV3Kind: + case VertexBuffer.UV4Kind: + case VertexBuffer.UV5Kind: + case VertexBuffer.UV6Kind: + stride = 2; + break; + case VertexBuffer.ColorKind: + stride = 4; + break; + case VertexBuffer.MatricesIndicesKind: + case VertexBuffer.MatricesIndicesExtraKind: + stride = 4; + break; + case VertexBuffer.MatricesWeightsKind: + case VertexBuffer.MatricesWeightsExtraKind: + stride = 4; + break; + } + } + if (data instanceof BABYLON.Buffer) { + if (!stride) { + stride = data.getStrideSize(); + } + this._buffer = data; + this._ownsBuffer = false; + } + else { + this._buffer = new BABYLON.Buffer(engine, data, updatable, stride, postponeInternalCreation, instanced); + this._ownsBuffer = true; + } + this._stride = stride; + this._offset = offset ? offset : 0; + this._size = size ? size : stride; + this._kind = kind; + } + VertexBuffer.prototype.getKind = function () { + return this._kind; + }; + // Properties + VertexBuffer.prototype.isUpdatable = function () { + return this._buffer.isUpdatable(); + }; + VertexBuffer.prototype.getData = function () { + return this._buffer.getData(); + }; + VertexBuffer.prototype.getBuffer = function () { + return this._buffer.getBuffer(); + }; + VertexBuffer.prototype.getStrideSize = function () { + return this._stride; + }; + VertexBuffer.prototype.getOffset = function () { + return this._offset; + }; + VertexBuffer.prototype.getSize = function () { + return this._size; + }; + VertexBuffer.prototype.getIsInstanced = function () { + return this._buffer.getIsInstanced(); + }; + // Methods + VertexBuffer.prototype.create = function (data) { + return this._buffer.create(data); + }; + VertexBuffer.prototype.update = function (data) { + return this._buffer.update(data); + }; + VertexBuffer.prototype.updateDirectly = function (data, offset) { + return this._buffer.updateDirectly(data, offset); + }; + VertexBuffer.prototype.dispose = function () { + if (this._ownsBuffer) { + this._buffer.dispose(); + } + }; + Object.defineProperty(VertexBuffer, "PositionKind", { + get: function () { + return VertexBuffer._PositionKind; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VertexBuffer, "NormalKind", { + get: function () { + return VertexBuffer._NormalKind; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VertexBuffer, "UVKind", { + get: function () { + return VertexBuffer._UVKind; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VertexBuffer, "UV2Kind", { + get: function () { + return VertexBuffer._UV2Kind; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VertexBuffer, "UV3Kind", { + get: function () { + return VertexBuffer._UV3Kind; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VertexBuffer, "UV4Kind", { + get: function () { + return VertexBuffer._UV4Kind; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VertexBuffer, "UV5Kind", { + get: function () { + return VertexBuffer._UV5Kind; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VertexBuffer, "UV6Kind", { + get: function () { + return VertexBuffer._UV6Kind; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VertexBuffer, "ColorKind", { + get: function () { + return VertexBuffer._ColorKind; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VertexBuffer, "MatricesIndicesKind", { + get: function () { + return VertexBuffer._MatricesIndicesKind; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VertexBuffer, "MatricesWeightsKind", { + get: function () { + return VertexBuffer._MatricesWeightsKind; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VertexBuffer, "MatricesIndicesExtraKind", { + get: function () { + return VertexBuffer._MatricesIndicesExtraKind; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VertexBuffer, "MatricesWeightsExtraKind", { + get: function () { + return VertexBuffer._MatricesWeightsExtraKind; + }, + enumerable: true, + configurable: true + }); + // Enums + VertexBuffer._PositionKind = "position"; + VertexBuffer._NormalKind = "normal"; + VertexBuffer._UVKind = "uv"; + VertexBuffer._UV2Kind = "uv2"; + VertexBuffer._UV3Kind = "uv3"; + VertexBuffer._UV4Kind = "uv4"; + VertexBuffer._UV5Kind = "uv5"; + VertexBuffer._UV6Kind = "uv6"; + VertexBuffer._ColorKind = "color"; + VertexBuffer._MatricesIndicesKind = "matricesIndices"; + VertexBuffer._MatricesWeightsKind = "matricesWeights"; + VertexBuffer._MatricesIndicesExtraKind = "matricesIndicesExtra"; + VertexBuffer._MatricesWeightsExtraKind = "matricesWeightsExtra"; + return VertexBuffer; + }()); + BABYLON.VertexBuffer = VertexBuffer; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.vertexBuffer.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * Creates an instance based on a source mesh. + */ + var InstancedMesh = (function (_super) { + __extends(InstancedMesh, _super); + function InstancedMesh(name, source) { + _super.call(this, name, source.getScene()); + source.instances.push(this); + this._sourceMesh = source; + this.position.copyFrom(source.position); + this.rotation.copyFrom(source.rotation); + this.scaling.copyFrom(source.scaling); + if (source.rotationQuaternion) { + this.rotationQuaternion = source.rotationQuaternion.clone(); + } + this.infiniteDistance = source.infiniteDistance; + this.setPivotMatrix(source.getPivotMatrix()); + this.refreshBoundingInfo(); + this._syncSubMeshes(); + } + Object.defineProperty(InstancedMesh.prototype, "receiveShadows", { + // Methods + get: function () { + return this._sourceMesh.receiveShadows; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InstancedMesh.prototype, "material", { + get: function () { + return this._sourceMesh.material; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InstancedMesh.prototype, "visibility", { + get: function () { + return this._sourceMesh.visibility; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InstancedMesh.prototype, "skeleton", { + get: function () { + return this._sourceMesh.skeleton; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InstancedMesh.prototype, "renderingGroupId", { + get: function () { + return this._sourceMesh.renderingGroupId; + }, + enumerable: true, + configurable: true + }); + InstancedMesh.prototype.getTotalVertices = function () { + return this._sourceMesh.getTotalVertices(); + }; + Object.defineProperty(InstancedMesh.prototype, "sourceMesh", { + get: function () { + return this._sourceMesh; + }, + enumerable: true, + configurable: true + }); + InstancedMesh.prototype.getVerticesData = function (kind, copyWhenShared) { + return this._sourceMesh.getVerticesData(kind, copyWhenShared); + }; + InstancedMesh.prototype.isVerticesDataPresent = function (kind) { + return this._sourceMesh.isVerticesDataPresent(kind); + }; + InstancedMesh.prototype.getIndices = function () { + return this._sourceMesh.getIndices(); + }; + Object.defineProperty(InstancedMesh.prototype, "_positions", { + get: function () { + return this._sourceMesh._positions; + }, + enumerable: true, + configurable: true + }); + InstancedMesh.prototype.refreshBoundingInfo = function () { + var meshBB = this._sourceMesh.getBoundingInfo(); + this._boundingInfo = new BABYLON.BoundingInfo(meshBB.minimum.clone(), meshBB.maximum.clone()); + this._updateBoundingInfo(); + }; + InstancedMesh.prototype._preActivate = function () { + if (this._currentLOD) { + this._currentLOD._preActivate(); + } + }; + InstancedMesh.prototype._activate = function (renderId) { + if (this._currentLOD) { + this._currentLOD._registerInstanceForRenderId(this, renderId); + } + }; + InstancedMesh.prototype.getLOD = function (camera) { + this._currentLOD = this.sourceMesh.getLOD(this.getScene().activeCamera, this.getBoundingInfo().boundingSphere); + if (this._currentLOD === this.sourceMesh) { + return this; + } + return this._currentLOD; + }; + InstancedMesh.prototype._syncSubMeshes = function () { + this.releaseSubMeshes(); + if (this._sourceMesh.subMeshes) { + for (var index = 0; index < this._sourceMesh.subMeshes.length; index++) { + this._sourceMesh.subMeshes[index].clone(this, this._sourceMesh); + } + } + }; + InstancedMesh.prototype._generatePointsArray = function () { + return this._sourceMesh._generatePointsArray(); + }; + // Clone + InstancedMesh.prototype.clone = function (name, newParent, doNotCloneChildren) { + var result = this._sourceMesh.createInstance(name); + // Deep copy + BABYLON.Tools.DeepCopy(this, result, ["name", "subMeshes"], []); + // Bounding info + this.refreshBoundingInfo(); + // Parent + if (newParent) { + result.parent = newParent; + } + if (!doNotCloneChildren) { + // Children + for (var index = 0; index < this.getScene().meshes.length; index++) { + var mesh = this.getScene().meshes[index]; + if (mesh.parent === this) { + mesh.clone(mesh.name, result); + } + } + } + result.computeWorldMatrix(true); + return result; + }; + // Dispoe + InstancedMesh.prototype.dispose = function (doNotRecurse) { + // Remove from mesh + var index = this._sourceMesh.instances.indexOf(this); + this._sourceMesh.instances.splice(index, 1); + _super.prototype.dispose.call(this, doNotRecurse); + }; + return InstancedMesh; + }(BABYLON.AbstractMesh)); + BABYLON.InstancedMesh = InstancedMesh; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.instancedMesh.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var _InstancesBatch = (function () { + function _InstancesBatch() { + this.mustReturn = false; + this.visibleInstances = new Array(); + this.renderSelf = new Array(); + } + return _InstancesBatch; + }()); + BABYLON._InstancesBatch = _InstancesBatch; + var Mesh = (function (_super) { + __extends(Mesh, _super); + /** + * @constructor + * @param {string} name The value used by scene.getMeshByName() to do a lookup. + * @param {Scene} scene The scene to add this mesh to. + * @param {Node} parent The parent of this mesh, if it has one + * @param {Mesh} source An optional Mesh from which geometry is shared, cloned. + * @param {boolean} doNotCloneChildren When cloning, skip cloning child meshes of source, default False. + * When false, achieved by calling a clone(), also passing False. + * This will make creation of children, recursive. + */ + function Mesh(name, scene, parent, source, doNotCloneChildren, clonePhysicsImpostor) { + if (parent === void 0) { parent = null; } + if (clonePhysicsImpostor === void 0) { clonePhysicsImpostor = true; } + _super.call(this, name, scene); + // Events + /** + * An event triggered before rendering the mesh + * @type {BABYLON.Observable} + */ + this.onBeforeRenderObservable = new BABYLON.Observable(); + /** + * An event triggered after rendering the mesh + * @type {BABYLON.Observable} + */ + this.onAfterRenderObservable = new BABYLON.Observable(); + /** + * An event triggered before drawing the mesh + * @type {BABYLON.Observable} + */ + this.onBeforeDrawObservable = new BABYLON.Observable(); + // Members + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NONE; + this.instances = new Array(); + this._LODLevels = new Array(); + this._visibleInstances = {}; + this._renderIdForInstances = new Array(); + this._batchCache = new _InstancesBatch(); + this._instancesBufferSize = 32 * 16 * 4; // let's start with a maximum of 32 instances + this._sideOrientation = Mesh._DEFAULTSIDE; + this._areNormalsFrozen = false; // Will be used by ribbons mainly + if (source) { + // Geometry + if (source._geometry) { + source._geometry.applyToMesh(this); + } + // Deep copy + BABYLON.Tools.DeepCopy(source, this, ["name", "material", "skeleton", "instances", "parent"], ["_poseMatrix"]); + // Parent + this.parent = source.parent; + // Pivot + this.setPivotMatrix(source.getPivotMatrix()); + this.id = name + "." + source.id; + // Material + this.material = source.material; + var index; + if (!doNotCloneChildren) { + // Children + for (index = 0; index < scene.meshes.length; index++) { + var mesh = scene.meshes[index]; + if (mesh.parent === source) { + // doNotCloneChildren is always going to be False + var newChild = mesh.clone(name + "." + mesh.name, this, doNotCloneChildren); + } + } + } + // Physics clone + var physicsEngine = this.getScene().getPhysicsEngine(); + if (clonePhysicsImpostor && physicsEngine) { + var impostor = physicsEngine.getImpostorForPhysicsObject(source); + if (impostor) { + this.physicsImpostor = impostor.clone(this); + } + } + // Particles + for (index = 0; index < scene.particleSystems.length; index++) { + var system = scene.particleSystems[index]; + if (system.emitter === source) { + system.clone(system.name, this); + } + } + this.computeWorldMatrix(true); + } + // Parent + if (parent !== null) { + this.parent = parent; + } + } + Object.defineProperty(Mesh, "FRONTSIDE", { + /** + * Mesh side orientation : usually the external or front surface + */ + get: function () { + return Mesh._FRONTSIDE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Mesh, "BACKSIDE", { + /** + * Mesh side orientation : usually the internal or back surface + */ + get: function () { + return Mesh._BACKSIDE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Mesh, "DOUBLESIDE", { + /** + * Mesh side orientation : both internal and external or front and back surfaces + */ + get: function () { + return Mesh._DOUBLESIDE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Mesh, "DEFAULTSIDE", { + /** + * Mesh side orientation : by default, `FRONTSIDE` + */ + get: function () { + return Mesh._DEFAULTSIDE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Mesh, "NO_CAP", { + /** + * Mesh cap setting : no cap + */ + get: function () { + return Mesh._NO_CAP; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Mesh, "CAP_START", { + /** + * Mesh cap setting : one cap at the beginning of the mesh + */ + get: function () { + return Mesh._CAP_START; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Mesh, "CAP_END", { + /** + * Mesh cap setting : one cap at the end of the mesh + */ + get: function () { + return Mesh._CAP_END; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Mesh, "CAP_ALL", { + /** + * Mesh cap setting : two caps, one at the beginning and one at the end of the mesh + */ + get: function () { + return Mesh._CAP_ALL; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Mesh.prototype, "onBeforeDraw", { + set: function (callback) { + if (this._onBeforeDrawObserver) { + this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver); + } + this._onBeforeDrawObserver = this.onBeforeDrawObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + // Methods + /** + * @param {boolean} fullDetails - support for multiple levels of logging within scene loading + */ + Mesh.prototype.toString = function (fullDetails) { + var ret = _super.prototype.toString.call(this, fullDetails); + ret += ", n vertices: " + this.getTotalVertices(); + ret += ", parent: " + (this._waitingParentId ? this._waitingParentId : (this.parent ? this.parent.name : "NONE")); + if (this.animations) { + for (var i = 0; i < this.animations.length; i++) { + ret += ", animation[0]: " + this.animations[i].toString(fullDetails); + } + } + if (fullDetails) { + ret += ", flat shading: " + (this._geometry ? (this.getVerticesData(BABYLON.VertexBuffer.PositionKind).length / 3 === this.getIndices().length ? "YES" : "NO") : "UNKNOWN"); + } + return ret; + }; + Object.defineProperty(Mesh.prototype, "hasLODLevels", { + get: function () { + return this._LODLevels.length > 0; + }, + enumerable: true, + configurable: true + }); + Mesh.prototype._sortLODLevels = function () { + this._LODLevels.sort(function (a, b) { + if (a.distance < b.distance) { + return 1; + } + if (a.distance > b.distance) { + return -1; + } + return 0; + }); + }; + /** + * Add a mesh as LOD level triggered at the given distance. + * tuto : http://doc.babylonjs.com/tutorials/How_to_use_LOD + * @param {number} distance The distance from the center of the object to show this level + * @param {Mesh} mesh The mesh to be added as LOD level + * @return {Mesh} This mesh (for chaining) + */ + Mesh.prototype.addLODLevel = function (distance, mesh) { + if (mesh && mesh._masterMesh) { + BABYLON.Tools.Warn("You cannot use a mesh as LOD level twice"); + return this; + } + var level = new BABYLON.Internals.MeshLODLevel(distance, mesh); + this._LODLevels.push(level); + if (mesh) { + mesh._masterMesh = this; + } + this._sortLODLevels(); + return this; + }; + /** + * Returns the LOD level mesh at the passed distance or null if not found. + * It is related to the method `addLODLevel(distance, mesh)`. + * tuto : http://doc.babylonjs.com/tutorials/How_to_use_LOD + */ + Mesh.prototype.getLODLevelAtDistance = function (distance) { + for (var index = 0; index < this._LODLevels.length; index++) { + var level = this._LODLevels[index]; + if (level.distance === distance) { + return level.mesh; + } + } + return null; + }; + /** + * Remove a mesh from the LOD array + * tuto : http://doc.babylonjs.com/tutorials/How_to_use_LOD + * @param {Mesh} mesh The mesh to be removed. + * @return {Mesh} This mesh (for chaining) + */ + Mesh.prototype.removeLODLevel = function (mesh) { + for (var index = 0; index < this._LODLevels.length; index++) { + if (this._LODLevels[index].mesh === mesh) { + this._LODLevels.splice(index, 1); + if (mesh) { + mesh._masterMesh = null; + } + } + } + this._sortLODLevels(); + return this; + }; + /** + * Returns the registered LOD mesh distant from the parameter `camera` position if any, else returns the current mesh. + * tuto : http://doc.babylonjs.com/tutorials/How_to_use_LOD + */ + Mesh.prototype.getLOD = function (camera, boundingSphere) { + if (!this._LODLevels || this._LODLevels.length === 0) { + return this; + } + var distanceToCamera = (boundingSphere ? boundingSphere : this.getBoundingInfo().boundingSphere).centerWorld.subtract(camera.globalPosition).length(); + if (this._LODLevels[this._LODLevels.length - 1].distance > distanceToCamera) { + if (this.onLODLevelSelection) { + this.onLODLevelSelection(distanceToCamera, this, this._LODLevels[this._LODLevels.length - 1].mesh); + } + return this; + } + for (var index = 0; index < this._LODLevels.length; index++) { + var level = this._LODLevels[index]; + if (level.distance < distanceToCamera) { + if (level.mesh) { + level.mesh._preActivate(); + level.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache); + } + if (this.onLODLevelSelection) { + this.onLODLevelSelection(distanceToCamera, this, level.mesh); + } + return level.mesh; + } + } + if (this.onLODLevelSelection) { + this.onLODLevelSelection(distanceToCamera, this, this); + } + return this; + }; + Object.defineProperty(Mesh.prototype, "geometry", { + /** + * Returns the mesh internal Geometry object. + */ + get: function () { + return this._geometry; + }, + enumerable: true, + configurable: true + }); + /** + * Returns a positive integer : the total number of vertices within the mesh geometry or zero if the mesh has no geometry. + */ + Mesh.prototype.getTotalVertices = function () { + if (!this._geometry) { + return 0; + } + return this._geometry.getTotalVertices(); + }; + /** + * Returns an array of integers or floats, or a Float32Array, depending on the requested `kind` (positions, indices, normals, etc). + * If `copywhenShared` is true (default false) and if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one. + * Returns null if the mesh has no geometry or no vertex buffer. + * Possible `kind` values : + * - BABYLON.VertexBuffer.PositionKind + * - BABYLON.VertexBuffer.UVKind + * - BABYLON.VertexBuffer.UV2Kind + * - BABYLON.VertexBuffer.UV3Kind + * - BABYLON.VertexBuffer.UV4Kind + * - BABYLON.VertexBuffer.UV5Kind + * - BABYLON.VertexBuffer.UV6Kind + * - BABYLON.VertexBuffer.ColorKind + * - BABYLON.VertexBuffer.MatricesIndicesKind + * - BABYLON.VertexBuffer.MatricesIndicesExtraKind + * - BABYLON.VertexBuffer.MatricesWeightsKind + * - BABYLON.VertexBuffer.MatricesWeightsExtraKind + */ + Mesh.prototype.getVerticesData = function (kind, copyWhenShared) { + if (!this._geometry) { + return null; + } + return this._geometry.getVerticesData(kind, copyWhenShared); + }; + /** + * Returns the mesh VertexBuffer object from the requested `kind` : positions, indices, normals, etc. + * Returns `undefined` if the mesh has no geometry. + * Possible `kind` values : + * - BABYLON.VertexBuffer.PositionKind + * - BABYLON.VertexBuffer.UVKind + * - BABYLON.VertexBuffer.UV2Kind + * - BABYLON.VertexBuffer.UV3Kind + * - BABYLON.VertexBuffer.UV4Kind + * - BABYLON.VertexBuffer.UV5Kind + * - BABYLON.VertexBuffer.UV6Kind + * - BABYLON.VertexBuffer.ColorKind + * - BABYLON.VertexBuffer.MatricesIndicesKind + * - BABYLON.VertexBuffer.MatricesIndicesExtraKind + * - BABYLON.VertexBuffer.MatricesWeightsKind + * - BABYLON.VertexBuffer.MatricesWeightsExtraKind + */ + Mesh.prototype.getVertexBuffer = function (kind) { + if (!this._geometry) { + return undefined; + } + return this._geometry.getVertexBuffer(kind); + }; + /** + * Returns a boolean depending on the existence of the Vertex Data for the requested `kind`. + * Possible `kind` values : + * - BABYLON.VertexBuffer.PositionKind + * - BABYLON.VertexBuffer.UVKind + * - BABYLON.VertexBuffer.UV2Kind + * - BABYLON.VertexBuffer.UV3Kind + * - BABYLON.VertexBuffer.UV4Kind + * - BABYLON.VertexBuffer.UV5Kind + * - BABYLON.VertexBuffer.UV6Kind + * - BABYLON.VertexBuffer.ColorKind + * - BABYLON.VertexBuffer.MatricesIndicesKind + * - BABYLON.VertexBuffer.MatricesIndicesExtraKind + * - BABYLON.VertexBuffer.MatricesWeightsKind + * - BABYLON.VertexBuffer.MatricesWeightsExtraKind + */ + Mesh.prototype.isVerticesDataPresent = function (kind) { + if (!this._geometry) { + if (this._delayInfo) { + return this._delayInfo.indexOf(kind) !== -1; + } + return false; + } + return this._geometry.isVerticesDataPresent(kind); + }; + /** + * Returns a string : the list of existing `kinds` of Vertex Data for this mesh. + * Possible `kind` values : + * - BABYLON.VertexBuffer.PositionKind + * - BABYLON.VertexBuffer.UVKind + * - BABYLON.VertexBuffer.UV2Kind + * - BABYLON.VertexBuffer.UV3Kind + * - BABYLON.VertexBuffer.UV4Kind + * - BABYLON.VertexBuffer.UV5Kind + * - BABYLON.VertexBuffer.UV6Kind + * - BABYLON.VertexBuffer.ColorKind + * - BABYLON.VertexBuffer.MatricesIndicesKind + * - BABYLON.VertexBuffer.MatricesIndicesExtraKind + * - BABYLON.VertexBuffer.MatricesWeightsKind + * - BABYLON.VertexBuffer.MatricesWeightsExtraKind + */ + Mesh.prototype.getVerticesDataKinds = function () { + if (!this._geometry) { + var result = []; + if (this._delayInfo) { + this._delayInfo.forEach(function (kind, index, array) { + result.push(kind); + }); + } + return result; + } + return this._geometry.getVerticesDataKinds(); + }; + /** + * Returns a positive integer : the total number of indices in this mesh geometry. + * Returns zero if the mesh has no geometry. + */ + Mesh.prototype.getTotalIndices = function () { + if (!this._geometry) { + return 0; + } + return this._geometry.getTotalIndices(); + }; + /** + * Returns an array of integers or a Int32Array populated with the mesh indices. + * If the parameter `copyWhenShared` is true (default false) and and if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one. + * Returns an empty array if the mesh has no geometry. + */ + Mesh.prototype.getIndices = function (copyWhenShared) { + if (!this._geometry) { + return []; + } + return this._geometry.getIndices(copyWhenShared); + }; + Object.defineProperty(Mesh.prototype, "isBlocked", { + get: function () { + return this._masterMesh !== null && this._masterMesh !== undefined; + }, + enumerable: true, + configurable: true + }); + /** + * Boolean : true once the mesh is ready after all the delayed process (loading, etc) are complete. + */ + Mesh.prototype.isReady = function () { + if (this.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_LOADING) { + return false; + } + return _super.prototype.isReady.call(this); + }; + /** + * Boolean : true if the mesh has been disposed. + */ + Mesh.prototype.isDisposed = function () { + return this._isDisposed; + }; + Object.defineProperty(Mesh.prototype, "sideOrientation", { + get: function () { + return this._sideOrientation; + }, + /** + * Sets the mesh side orientation : BABYLON.Mesh.FRONTSIDE, BABYLON.Mesh.BACKSIDE, BABYLON.Mesh.DOUBLESIDE or BABYLON.Mesh.DEFAULTSIDE + * tuto : http://doc.babylonjs.com/tutorials/Discover_Basic_Elements#side-orientation + */ + set: function (sideO) { + this._sideOrientation = sideO; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Mesh.prototype, "areNormalsFrozen", { + /** + * Boolean : true if the normals aren't to be recomputed on next mesh `positions` array update. + * This property is pertinent only for updatable parametric shapes. + */ + get: function () { + return this._areNormalsFrozen; + }, + enumerable: true, + configurable: true + }); + /** + * This function affects parametric shapes on vertex position update only : ribbons, tubes, etc. + * It has no effect at all on other shapes. + * It prevents the mesh normals from being recomputed on next `positions` array update. + */ + Mesh.prototype.freezeNormals = function () { + this._areNormalsFrozen = true; + }; + /** + * This function affects parametric shapes on vertex position update only : ribbons, tubes, etc. + * It has no effect at all on other shapes. + * It reactivates the mesh normals computation if it was previously frozen. + */ + Mesh.prototype.unfreezeNormals = function () { + this._areNormalsFrozen = false; + }; + Object.defineProperty(Mesh.prototype, "overridenInstanceCount", { + /** + * Overrides instance count. Only applicable when custom instanced InterleavedVertexBuffer are used rather than InstancedMeshs + */ + set: function (count) { + this._overridenInstanceCount = count; + }, + enumerable: true, + configurable: true + }); + // Methods + Mesh.prototype._preActivate = function () { + var sceneRenderId = this.getScene().getRenderId(); + if (this._preActivateId === sceneRenderId) { + return; + } + this._preActivateId = sceneRenderId; + this._visibleInstances = null; + }; + Mesh.prototype._preActivateForIntermediateRendering = function (renderId) { + if (this._visibleInstances) { + this._visibleInstances.intermediateDefaultRenderId = renderId; + } + }; + Mesh.prototype._registerInstanceForRenderId = function (instance, renderId) { + if (!this._visibleInstances) { + this._visibleInstances = {}; + this._visibleInstances.defaultRenderId = renderId; + this._visibleInstances.selfDefaultRenderId = this._renderId; + } + if (!this._visibleInstances[renderId]) { + this._visibleInstances[renderId] = new Array(); + } + this._visibleInstances[renderId].push(instance); + }; + /** + * This method recomputes and sets a new BoundingInfo to the mesh unless it is locked. + * This means the mesh underlying bounding box and sphere are recomputed. + */ + Mesh.prototype.refreshBoundingInfo = function () { + if (this._boundingInfo.isLocked) { + return; + } + var data = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + if (data) { + var extend = BABYLON.Tools.ExtractMinAndMax(data, 0, this.getTotalVertices()); + this._boundingInfo = new BABYLON.BoundingInfo(extend.minimum, extend.maximum); + } + if (this.subMeshes) { + for (var index = 0; index < this.subMeshes.length; index++) { + this.subMeshes[index].refreshBoundingInfo(); + } + } + this._updateBoundingInfo(); + }; + Mesh.prototype._createGlobalSubMesh = function () { + var totalVertices = this.getTotalVertices(); + if (!totalVertices || !this.getIndices()) { + return null; + } + this.releaseSubMeshes(); + return new BABYLON.SubMesh(0, 0, totalVertices, 0, this.getTotalIndices(), this); + }; + Mesh.prototype.subdivide = function (count) { + if (count < 1) { + return; + } + var totalIndices = this.getTotalIndices(); + var subdivisionSize = (totalIndices / count) | 0; + var offset = 0; + // Ensure that subdivisionSize is a multiple of 3 + while (subdivisionSize % 3 !== 0) { + subdivisionSize++; + } + this.releaseSubMeshes(); + for (var index = 0; index < count; index++) { + if (offset >= totalIndices) { + break; + } + BABYLON.SubMesh.CreateFromIndices(0, offset, Math.min(subdivisionSize, totalIndices - offset), this); + offset += subdivisionSize; + } + this.synchronizeInstances(); + }; + /** + * Sets the vertex data of the mesh geometry for the requested `kind`. + * If the mesh has no geometry, a new Geometry object is set to the mesh and then passed this vertex data. + * The `data` are either a numeric array either a Float32Array. + * The parameter `updatable` is passed as is to the underlying Geometry object constructor (if initianilly none) or updater. + * The parameter `stride` is an optional positive integer, it is usually automatically deducted from the `kind` (3 for positions or normals, 2 for UV, etc). + * Note that a new underlying VertexBuffer object is created each call. + * If the `kind` is the `PositionKind`, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed. + * + * Possible `kind` values : + * - BABYLON.VertexBuffer.PositionKind + * - BABYLON.VertexBuffer.UVKind + * - BABYLON.VertexBuffer.UV2Kind + * - BABYLON.VertexBuffer.UV3Kind + * - BABYLON.VertexBuffer.UV4Kind + * - BABYLON.VertexBuffer.UV5Kind + * - BABYLON.VertexBuffer.UV6Kind + * - BABYLON.VertexBuffer.ColorKind + * - BABYLON.VertexBuffer.MatricesIndicesKind + * - BABYLON.VertexBuffer.MatricesIndicesExtraKind + * - BABYLON.VertexBuffer.MatricesWeightsKind + * - BABYLON.VertexBuffer.MatricesWeightsExtraKind + */ + Mesh.prototype.setVerticesData = function (kind, data, updatable, stride) { + if (!this._geometry) { + var vertexData = new BABYLON.VertexData(); + vertexData.set(data, kind); + var scene = this.getScene(); + new BABYLON.Geometry(BABYLON.Geometry.RandomId(), scene, vertexData, updatable, this); + } + else { + this._geometry.setVerticesData(kind, data, updatable, stride); + } + }; + Mesh.prototype.setVerticesBuffer = function (buffer) { + if (!this._geometry) { + var scene = this.getScene(); + new BABYLON.Geometry(BABYLON.Geometry.RandomId(), scene).applyToMesh(this); + } + this._geometry.setVerticesBuffer(buffer); + }; + /** + * Updates the existing vertex data of the mesh geometry for the requested `kind`. + * If the mesh has no geometry, it is simply returned as it is. + * The `data` are either a numeric array either a Float32Array. + * No new underlying VertexBuffer object is created. + * If the `kind` is the `PositionKind` and if `updateExtends` is true, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed. + * If the parameter `makeItUnique` is true, a new global geometry is created from this positions and is set to the mesh. + * + * Possible `kind` values : + * - BABYLON.VertexBuffer.PositionKind + * - BABYLON.VertexBuffer.UVKind + * - BABYLON.VertexBuffer.UV2Kind + * - BABYLON.VertexBuffer.UV3Kind + * - BABYLON.VertexBuffer.UV4Kind + * - BABYLON.VertexBuffer.UV5Kind + * - BABYLON.VertexBuffer.UV6Kind + * - BABYLON.VertexBuffer.ColorKind + * - BABYLON.VertexBuffer.MatricesIndicesKind + * - BABYLON.VertexBuffer.MatricesIndicesExtraKind + * - BABYLON.VertexBuffer.MatricesWeightsKind + * - BABYLON.VertexBuffer.MatricesWeightsExtraKind + */ + Mesh.prototype.updateVerticesData = function (kind, data, updateExtends, makeItUnique) { + if (!this._geometry) { + return; + } + if (!makeItUnique) { + this._geometry.updateVerticesData(kind, data, updateExtends); + } + else { + this.makeGeometryUnique(); + this.updateVerticesData(kind, data, updateExtends, false); + } + }; + /** + * Deprecated since BabylonJS v2.3 + */ + Mesh.prototype.updateVerticesDataDirectly = function (kind, data, offset, makeItUnique) { + BABYLON.Tools.Warn("Mesh.updateVerticesDataDirectly deprecated since 2.3."); + if (!this._geometry) { + return; + } + if (!makeItUnique) { + this._geometry.updateVerticesDataDirectly(kind, data, offset); + } + else { + this.makeGeometryUnique(); + this.updateVerticesDataDirectly(kind, data, offset, false); + } + }; + /** + * This method updates the vertex positions of an updatable mesh according to the `positionFunction` returned values. + * tuto : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#other-shapes-updatemeshpositions + * The parameter `positionFunction` is a simple JS function what is passed the mesh `positions` array. It doesn't need to return anything. + * The parameter `computeNormals` is a boolean (default true) to enable/disable the mesh normal recomputation after the vertex position update. + */ + Mesh.prototype.updateMeshPositions = function (positionFunction, computeNormals) { + if (computeNormals === void 0) { computeNormals = true; } + var positions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + positionFunction(positions); + this.updateVerticesData(BABYLON.VertexBuffer.PositionKind, positions, false, false); + if (computeNormals) { + var indices = this.getIndices(); + var normals = this.getVerticesData(BABYLON.VertexBuffer.NormalKind); + BABYLON.VertexData.ComputeNormals(positions, indices, normals); + this.updateVerticesData(BABYLON.VertexBuffer.NormalKind, normals, false, false); + } + }; + Mesh.prototype.makeGeometryUnique = function () { + if (!this._geometry) { + return; + } + var oldGeometry = this._geometry; + var geometry = this._geometry.copy(BABYLON.Geometry.RandomId()); + oldGeometry.releaseForMesh(this, true); + geometry.applyToMesh(this); + }; + /** + * Sets the mesh indices. + * Expects an array populated with integers or a Int32Array. + * If the mesh has no geometry, a new Geometry object is created and set to the mesh. + * This method creates a new index buffer each call. + */ + Mesh.prototype.setIndices = function (indices, totalVertices) { + if (!this._geometry) { + var vertexData = new BABYLON.VertexData(); + vertexData.indices = indices; + var scene = this.getScene(); + new BABYLON.Geometry(BABYLON.Geometry.RandomId(), scene, vertexData, false, this); + } + else { + this._geometry.setIndices(indices, totalVertices); + } + }; + /** + * Invert the geometry to move from a right handed system to a left handed one. + */ + Mesh.prototype.toLeftHanded = function () { + if (!this._geometry) { + return; + } + this._geometry.toLeftHanded(); + }; + Mesh.prototype._bind = function (subMesh, effect, fillMode) { + var engine = this.getScene().getEngine(); + // Wireframe + var indexToBind; + if (this._unIndexed) { + indexToBind = null; + } + else { + switch (fillMode) { + case BABYLON.Material.PointFillMode: + indexToBind = null; + break; + case BABYLON.Material.WireFrameFillMode: + indexToBind = subMesh.getLinesIndexBuffer(this.getIndices(), engine); + break; + default: + case BABYLON.Material.TriangleFillMode: + indexToBind = this._unIndexed ? null : this._geometry.getIndexBuffer(); + break; + } + } + // VBOs + engine.bindBuffers(this._geometry.getVertexBuffers(), indexToBind, effect); + }; + Mesh.prototype._draw = function (subMesh, fillMode, instancesCount) { + if (!this._geometry || !this._geometry.getVertexBuffers() || !this._geometry.getIndexBuffer()) { + return; + } + this.onBeforeDrawObservable.notifyObservers(this); + var engine = this.getScene().getEngine(); + // Draw order + switch (fillMode) { + case BABYLON.Material.PointFillMode: + engine.drawPointClouds(subMesh.verticesStart, subMesh.verticesCount, instancesCount); + break; + case BABYLON.Material.WireFrameFillMode: + if (this._unIndexed) { + engine.drawUnIndexed(false, subMesh.verticesStart, subMesh.verticesCount, instancesCount); + } + else { + engine.draw(false, 0, instancesCount > 0 ? subMesh.linesIndexCount / 2 : subMesh.linesIndexCount, instancesCount); + } + break; + default: + if (this._unIndexed) { + engine.drawUnIndexed(true, subMesh.verticesStart, subMesh.verticesCount, instancesCount); + } + else { + engine.draw(true, subMesh.indexStart, subMesh.indexCount, instancesCount); + } + } + }; + /** + * Registers for this mesh a javascript function called just before the rendering process. + * This function is passed the current mesh and doesn't return anything. + */ + Mesh.prototype.registerBeforeRender = function (func) { + this.onBeforeRenderObservable.add(func); + }; + /** + * Disposes a previously registered javascript function called before the rendering. + * This function is passed the current mesh and doesn't return anything. + */ + Mesh.prototype.unregisterBeforeRender = function (func) { + this.onBeforeRenderObservable.removeCallback(func); + }; + /** + * Registers for this mesh a javascript function called just after the rendering is complete. + * This function is passed the current mesh and doesn't return anything. + */ + Mesh.prototype.registerAfterRender = function (func) { + this.onAfterRenderObservable.add(func); + }; + /** + * Disposes a previously registered javascript function called after the rendering. + * This function is passed the current mesh and doesn't return anything. + */ + Mesh.prototype.unregisterAfterRender = function (func) { + this.onAfterRenderObservable.removeCallback(func); + }; + Mesh.prototype._getInstancesRenderList = function (subMeshId) { + var scene = this.getScene(); + this._batchCache.mustReturn = false; + this._batchCache.renderSelf[subMeshId] = this.isEnabled() && this.isVisible; + this._batchCache.visibleInstances[subMeshId] = null; + if (this._visibleInstances) { + var currentRenderId = scene.getRenderId(); + var defaultRenderId = (scene._isInIntermediateRendering() ? this._visibleInstances.intermediateDefaultRenderId : this._visibleInstances.defaultRenderId); + this._batchCache.visibleInstances[subMeshId] = this._visibleInstances[currentRenderId]; + var selfRenderId = this._renderId; + if (!this._batchCache.visibleInstances[subMeshId] && defaultRenderId) { + this._batchCache.visibleInstances[subMeshId] = this._visibleInstances[defaultRenderId]; + currentRenderId = Math.max(defaultRenderId, currentRenderId); + selfRenderId = Math.max(this._visibleInstances.selfDefaultRenderId, currentRenderId); + } + if (this._batchCache.visibleInstances[subMeshId] && this._batchCache.visibleInstances[subMeshId].length) { + if (this._renderIdForInstances[subMeshId] === currentRenderId) { + this._batchCache.mustReturn = true; + return this._batchCache; + } + if (currentRenderId !== selfRenderId) { + this._batchCache.renderSelf[subMeshId] = false; + } + } + this._renderIdForInstances[subMeshId] = currentRenderId; + } + return this._batchCache; + }; + Mesh.prototype._renderWithInstances = function (subMesh, fillMode, batch, effect, engine) { + var visibleInstances = batch.visibleInstances[subMesh._id]; + var matricesCount = visibleInstances.length + 1; + var bufferSize = matricesCount * 16 * 4; + var currentInstancesBufferSize = this._instancesBufferSize; + var instancesBuffer = this._instancesBuffer; + while (this._instancesBufferSize < bufferSize) { + this._instancesBufferSize *= 2; + } + if (!this._instancesData || currentInstancesBufferSize != this._instancesBufferSize) { + this._instancesData = new Float32Array(this._instancesBufferSize / 4); + } + var offset = 0; + var instancesCount = 0; + var world = this.getWorldMatrix(); + if (batch.renderSelf[subMesh._id]) { + world.copyToArray(this._instancesData, offset); + offset += 16; + instancesCount++; + } + if (visibleInstances) { + for (var instanceIndex = 0; instanceIndex < visibleInstances.length; instanceIndex++) { + var instance = visibleInstances[instanceIndex]; + instance.getWorldMatrix().copyToArray(this._instancesData, offset); + offset += 16; + instancesCount++; + } + } + if (!instancesBuffer || currentInstancesBufferSize != this._instancesBufferSize) { + if (instancesBuffer) { + instancesBuffer.dispose(); + } + instancesBuffer = new BABYLON.Buffer(engine, this._instancesData, true, 16, false, true); + this._instancesBuffer = instancesBuffer; + this.setVerticesBuffer(instancesBuffer.createVertexBuffer("world0", 0, 4)); + this.setVerticesBuffer(instancesBuffer.createVertexBuffer("world1", 4, 4)); + this.setVerticesBuffer(instancesBuffer.createVertexBuffer("world2", 8, 4)); + this.setVerticesBuffer(instancesBuffer.createVertexBuffer("world3", 12, 4)); + } + else { + instancesBuffer.updateDirectly(this._instancesData, 0, instancesCount); + } + engine.bindBuffers(this.geometry.getVertexBuffers(), this.geometry.getIndexBuffer(), effect); + this._draw(subMesh, fillMode, instancesCount); + engine.unbindInstanceAttributes(); + }; + Mesh.prototype._processRendering = function (subMesh, effect, fillMode, batch, hardwareInstancedRendering, onBeforeDraw, effectiveMaterial) { + var scene = this.getScene(); + var engine = scene.getEngine(); + if (hardwareInstancedRendering) { + this._renderWithInstances(subMesh, fillMode, batch, effect, engine); + } + else { + if (batch.renderSelf[subMesh._id]) { + // Draw + if (onBeforeDraw) { + onBeforeDraw(false, this.getWorldMatrix(), effectiveMaterial); + } + this._draw(subMesh, fillMode, this._overridenInstanceCount); + } + if (batch.visibleInstances[subMesh._id]) { + for (var instanceIndex = 0; instanceIndex < batch.visibleInstances[subMesh._id].length; instanceIndex++) { + var instance = batch.visibleInstances[subMesh._id][instanceIndex]; + // World + var world = instance.getWorldMatrix(); + if (onBeforeDraw) { + onBeforeDraw(true, world, effectiveMaterial); + } + // Draw + this._draw(subMesh, fillMode); + } + } + } + }; + /** + * Triggers the draw call for the mesh. + * Usually, you don't need to call this method by your own because the mesh rendering is handled by the scene rendering manager. + */ + Mesh.prototype.render = function (subMesh, enableAlphaMode) { + var scene = this.getScene(); + // Managing instances + var batch = this._getInstancesRenderList(subMesh._id); + if (batch.mustReturn) { + return; + } + // Checking geometry state + if (!this._geometry || !this._geometry.getVertexBuffers() || !this._geometry.getIndexBuffer()) { + return; + } + var callbackIndex; + this.onBeforeRenderObservable.notifyObservers(this); + var engine = scene.getEngine(); + var hardwareInstancedRendering = (engine.getCaps().instancedArrays !== null) && (batch.visibleInstances[subMesh._id] !== null) && (batch.visibleInstances[subMesh._id] !== undefined); + // Material + var effectiveMaterial = subMesh.getMaterial(); + if (!effectiveMaterial || !effectiveMaterial.isReady(this, hardwareInstancedRendering)) { + return; + } + // Outline - step 1 + var savedDepthWrite = engine.getDepthWrite(); + if (this.renderOutline) { + engine.setDepthWrite(false); + scene.getOutlineRenderer().render(subMesh, batch); + engine.setDepthWrite(savedDepthWrite); + } + effectiveMaterial._preBind(); + var effect = effectiveMaterial.getEffect(); + // Bind + var fillMode = scene.forcePointsCloud ? BABYLON.Material.PointFillMode : (scene.forceWireframe ? BABYLON.Material.WireFrameFillMode : effectiveMaterial.fillMode); + this._bind(subMesh, effect, fillMode); + var world = this.getWorldMatrix(); + effectiveMaterial.bind(world, this); + // Alpha mode + if (enableAlphaMode) { + engine.setAlphaMode(effectiveMaterial.alphaMode); + } + // Draw + this._processRendering(subMesh, effect, fillMode, batch, hardwareInstancedRendering, this._onBeforeDraw, effectiveMaterial); + // Unbind + effectiveMaterial.unbind(); + // Outline - step 2 + if (this.renderOutline && savedDepthWrite) { + engine.setDepthWrite(true); + engine.setColorWrite(false); + scene.getOutlineRenderer().render(subMesh, batch); + engine.setColorWrite(true); + } + // Overlay + if (this.renderOverlay) { + var currentMode = engine.getAlphaMode(); + engine.setAlphaMode(BABYLON.Engine.ALPHA_COMBINE); + scene.getOutlineRenderer().render(subMesh, batch, true); + engine.setAlphaMode(currentMode); + } + this.onAfterRenderObservable.notifyObservers(this); + }; + Mesh.prototype._onBeforeDraw = function (isInstance, world, effectiveMaterial) { + if (isInstance) { + effectiveMaterial.bindOnlyWorldMatrix(world); + } + }; + /** + * Returns an array populated with ParticleSystem objects whose the mesh is the emitter. + */ + Mesh.prototype.getEmittedParticleSystems = function () { + var results = new Array(); + for (var index = 0; index < this.getScene().particleSystems.length; index++) { + var particleSystem = this.getScene().particleSystems[index]; + if (particleSystem.emitter === this) { + results.push(particleSystem); + } + } + return results; + }; + /** + * Returns an array populated with ParticleSystem objects whose the mesh or its children are the emitter. + */ + Mesh.prototype.getHierarchyEmittedParticleSystems = function () { + var results = new Array(); + var descendants = this.getDescendants(); + descendants.push(this); + for (var index = 0; index < this.getScene().particleSystems.length; index++) { + var particleSystem = this.getScene().particleSystems[index]; + if (descendants.indexOf(particleSystem.emitter) !== -1) { + results.push(particleSystem); + } + } + return results; + }; + Mesh.prototype._checkDelayState = function () { + var scene = this.getScene(); + if (this._geometry) { + this._geometry.load(scene); + } + else if (this.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_NOTLOADED) { + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADING; + this._queueLoad(this, scene); + } + }; + Mesh.prototype._queueLoad = function (mesh, scene) { + var _this = this; + scene._addPendingData(mesh); + var getBinaryData = (this.delayLoadingFile.indexOf(".babylonbinarymeshdata") !== -1); + BABYLON.Tools.LoadFile(this.delayLoadingFile, function (data) { + if (data instanceof ArrayBuffer) { + _this._delayLoadingFunction(data, _this); + } + else { + _this._delayLoadingFunction(JSON.parse(data), _this); + } + _this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADED; + scene._removePendingData(_this); + }, function () { }, scene.database, getBinaryData); + }; + /** + * Boolean, true is the mesh in the frustum defined by the Plane objects from the `frustumPlanes` array parameter. + */ + Mesh.prototype.isInFrustum = function (frustumPlanes) { + if (this.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_LOADING) { + return false; + } + if (!_super.prototype.isInFrustum.call(this, frustumPlanes)) { + return false; + } + this._checkDelayState(); + return true; + }; + /** + * Sets the mesh material by the material or multiMaterial `id` property. + * The material `id` is a string identifying the material or the multiMaterial. + * This method returns nothing. + */ + Mesh.prototype.setMaterialByID = function (id) { + var materials = this.getScene().materials; + var index; + for (index = 0; index < materials.length; index++) { + if (materials[index].id === id) { + this.material = materials[index]; + return; + } + } + // Multi + var multiMaterials = this.getScene().multiMaterials; + for (index = 0; index < multiMaterials.length; index++) { + if (multiMaterials[index].id === id) { + this.material = multiMaterials[index]; + return; + } + } + }; + /** + * Returns as a new array populated with the mesh material and/or skeleton, if any. + */ + Mesh.prototype.getAnimatables = function () { + var results = []; + if (this.material) { + results.push(this.material); + } + if (this.skeleton) { + results.push(this.skeleton); + } + return results; + }; + /** + * Modifies the mesh geometry according to the passed transformation matrix. + * This method returns nothing but it really modifies the mesh even if it's originally not set as updatable. + * The mesh normals are modified accordingly the same transformation. + * tuto : http://doc.babylonjs.com/tutorials/How_Rotations_and_Translations_Work#baking-transform + * Note that, under the hood, this method sets a new VertexBuffer each call. + */ + Mesh.prototype.bakeTransformIntoVertices = function (transform) { + // Position + if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind)) { + return; + } + var submeshes = this.subMeshes.splice(0); + this._resetPointsArrayCache(); + var data = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + var temp = []; + var index; + for (index = 0; index < data.length; index += 3) { + BABYLON.Vector3.TransformCoordinates(BABYLON.Vector3.FromArray(data, index), transform).toArray(temp, index); + } + this.setVerticesData(BABYLON.VertexBuffer.PositionKind, temp, this.getVertexBuffer(BABYLON.VertexBuffer.PositionKind).isUpdatable()); + // Normals + if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) { + return; + } + data = this.getVerticesData(BABYLON.VertexBuffer.NormalKind); + temp = []; + for (index = 0; index < data.length; index += 3) { + BABYLON.Vector3.TransformNormal(BABYLON.Vector3.FromArray(data, index), transform).normalize().toArray(temp, index); + } + this.setVerticesData(BABYLON.VertexBuffer.NormalKind, temp, this.getVertexBuffer(BABYLON.VertexBuffer.NormalKind).isUpdatable()); + // flip faces? + if (transform.m[0] * transform.m[5] * transform.m[10] < 0) { + this.flipFaces(); + } + // Restore submeshes + this.releaseSubMeshes(); + this.subMeshes = submeshes; + }; + /** + * Modifies the mesh geometry according to its own current World Matrix. + * The mesh World Matrix is then reset. + * This method returns nothing but really modifies the mesh even if it's originally not set as updatable. + * tuto : tuto : http://doc.babylonjs.com/tutorials/How_Rotations_and_Translations_Work#baking-transform + * Note that, under the hood, this method sets a new VertexBuffer each call. + */ + Mesh.prototype.bakeCurrentTransformIntoVertices = function () { + this.bakeTransformIntoVertices(this.computeWorldMatrix(true)); + this.scaling.copyFromFloats(1, 1, 1); + this.position.copyFromFloats(0, 0, 0); + this.rotation.copyFromFloats(0, 0, 0); + //only if quaternion is already set + if (this.rotationQuaternion) { + this.rotationQuaternion = BABYLON.Quaternion.Identity(); + } + this._worldMatrix = BABYLON.Matrix.Identity(); + }; + // Cache + Mesh.prototype._resetPointsArrayCache = function () { + this._positions = null; + }; + Mesh.prototype._generatePointsArray = function () { + if (this._positions) + return true; + this._positions = []; + var data = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + if (!data) { + return false; + } + for (var index = 0; index < data.length; index += 3) { + this._positions.push(BABYLON.Vector3.FromArray(data, index)); + } + return true; + }; + /** + * Returns a new Mesh object generated from the current mesh properties. + * This method must not get confused with createInstance(). + * The parameter `name` is a string, the name given to the new mesh. + * The optional parameter `newParent` can be any Node object (default `null`). + * The optional parameter `doNotCloneChildren` (default `false`) allows/denies the recursive cloning of the original mesh children if any. + * The parameter `clonePhysicsImpostor` (default `true`) allows/denies the cloning in the same time of the original mesh `body` used by the physics engine, if any. + */ + Mesh.prototype.clone = function (name, newParent, doNotCloneChildren, clonePhysicsImpostor) { + if (clonePhysicsImpostor === void 0) { clonePhysicsImpostor = true; } + return new Mesh(name, this.getScene(), newParent, this, doNotCloneChildren, clonePhysicsImpostor); + }; + /** + * Disposes the mesh. + * This also frees the memory allocated under the hood to all the buffers used by WebGL. + */ + Mesh.prototype.dispose = function (doNotRecurse) { + if (this._geometry) { + this._geometry.releaseForMesh(this, true); + } + // Instances + if (this._instancesBuffer) { + this._instancesBuffer.dispose(); + this._instancesBuffer = null; + } + while (this.instances.length) { + this.instances[0].dispose(); + } + // Highlight layers. + var highlightLayers = this.getScene().highlightLayers; + for (var i = 0; i < highlightLayers.length; i++) { + var highlightLayer = highlightLayers[i]; + if (highlightLayer) { + highlightLayer.removeMesh(this); + highlightLayer.removeExcludedMesh(this); + } + } + _super.prototype.dispose.call(this, doNotRecurse); + }; + /** + * Modifies the mesh geometry according to a displacement map. + * A displacement map is a colored image. Each pixel color value (actually a gradient computed from red, green, blue values) will give the displacement to apply to each mesh vertex. + * The mesh must be set as updatable. Its internal geometry is directly modified, no new buffer are allocated. + * This method returns nothing. + * The parameter `url` is a string, the URL from the image file is to be downloaded. + * The parameters `minHeight` and `maxHeight` are the lower and upper limits of the displacement. + * The parameter `onSuccess` is an optional Javascript function to be called just after the mesh is modified. It is passed the modified mesh and must return nothing. + */ + Mesh.prototype.applyDisplacementMap = function (url, minHeight, maxHeight, onSuccess) { + var _this = this; + var scene = this.getScene(); + var onload = function (img) { + // Getting height map data + var canvas = document.createElement("canvas"); + var context = canvas.getContext("2d"); + var heightMapWidth = img.width; + var heightMapHeight = img.height; + canvas.width = heightMapWidth; + canvas.height = heightMapHeight; + context.drawImage(img, 0, 0); + // Create VertexData from map data + //Cast is due to wrong definition in lib.d.ts from ts 1.3 - https://github.com/Microsoft/TypeScript/issues/949 + var buffer = context.getImageData(0, 0, heightMapWidth, heightMapHeight).data; + _this.applyDisplacementMapFromBuffer(buffer, heightMapWidth, heightMapHeight, minHeight, maxHeight); + //execute success callback, if set + if (onSuccess) { + onSuccess(_this); + } + }; + BABYLON.Tools.LoadImage(url, onload, function () { }, scene.database); + }; + /** + * Modifies the mesh geometry according to a displacementMap buffer. + * A displacement map is a colored image. Each pixel color value (actually a gradient computed from red, green, blue values) will give the displacement to apply to each mesh vertex. + * The mesh must be set as updatable. Its internal geometry is directly modified, no new buffer are allocated. + * This method returns nothing. + * The parameter `buffer` is a `Uint8Array` buffer containing series of `Uint8` lower than 255, the red, green, blue and alpha values of each successive pixel. + * The parameters `heightMapWidth` and `heightMapHeight` are positive integers to set the width and height of the buffer image. + * The parameters `minHeight` and `maxHeight` are the lower and upper limits of the displacement. + */ + Mesh.prototype.applyDisplacementMapFromBuffer = function (buffer, heightMapWidth, heightMapHeight, minHeight, maxHeight) { + if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind) + || !this.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind) + || !this.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) { + BABYLON.Tools.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"); + return; + } + var positions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + var normals = this.getVerticesData(BABYLON.VertexBuffer.NormalKind); + var uvs = this.getVerticesData(BABYLON.VertexBuffer.UVKind); + var position = BABYLON.Vector3.Zero(); + var normal = BABYLON.Vector3.Zero(); + var uv = BABYLON.Vector2.Zero(); + for (var index = 0; index < positions.length; index += 3) { + BABYLON.Vector3.FromArrayToRef(positions, index, position); + BABYLON.Vector3.FromArrayToRef(normals, index, normal); + BABYLON.Vector2.FromArrayToRef(uvs, (index / 3) * 2, uv); + // Compute height + var u = ((Math.abs(uv.x) * heightMapWidth) % heightMapWidth) | 0; + var v = ((Math.abs(uv.y) * heightMapHeight) % heightMapHeight) | 0; + var pos = (u + v * heightMapWidth) * 4; + var r = buffer[pos] / 255.0; + var g = buffer[pos + 1] / 255.0; + var b = buffer[pos + 2] / 255.0; + var gradient = r * 0.3 + g * 0.59 + b * 0.11; + normal.normalize(); + normal.scaleInPlace(minHeight + (maxHeight - minHeight) * gradient); + position = position.add(normal); + position.toArray(positions, index); + } + BABYLON.VertexData.ComputeNormals(positions, this.getIndices(), normals); + this.updateVerticesData(BABYLON.VertexBuffer.PositionKind, positions); + this.updateVerticesData(BABYLON.VertexBuffer.NormalKind, normals); + }; + /** + * Modify the mesh to get a flat shading rendering. + * This means each mesh facet will then have its own normals. Usually new vertices are added in the mesh geometry to get this result. + * This method returns nothing. + * Warning : the mesh is really modified even if not set originally as updatable and, under the hood, a new VertexBuffer is allocated. + */ + Mesh.prototype.convertToFlatShadedMesh = function () { + /// Update normals and vertices to get a flat shading rendering. + /// Warning: This may imply adding vertices to the mesh in order to get exactly 3 vertices per face + var kinds = this.getVerticesDataKinds(); + var vbs = []; + var data = []; + var newdata = []; + var updatableNormals = false; + var kindIndex; + var kind; + for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) { + kind = kinds[kindIndex]; + var vertexBuffer = this.getVertexBuffer(kind); + if (kind === BABYLON.VertexBuffer.NormalKind) { + updatableNormals = vertexBuffer.isUpdatable(); + kinds.splice(kindIndex, 1); + kindIndex--; + continue; + } + vbs[kind] = vertexBuffer; + data[kind] = vbs[kind].getData(); + newdata[kind] = []; + } + // Save previous submeshes + var previousSubmeshes = this.subMeshes.slice(0); + var indices = this.getIndices(); + var totalIndices = this.getTotalIndices(); + // Generating unique vertices per face + var index; + for (index = 0; index < totalIndices; index++) { + var vertexIndex = indices[index]; + for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) { + kind = kinds[kindIndex]; + var stride = vbs[kind].getStrideSize(); + for (var offset = 0; offset < stride; offset++) { + newdata[kind].push(data[kind][vertexIndex * stride + offset]); + } + } + } + // Updating faces & normal + var normals = []; + var positions = newdata[BABYLON.VertexBuffer.PositionKind]; + for (index = 0; index < totalIndices; index += 3) { + indices[index] = index; + indices[index + 1] = index + 1; + indices[index + 2] = index + 2; + var p1 = BABYLON.Vector3.FromArray(positions, index * 3); + var p2 = BABYLON.Vector3.FromArray(positions, (index + 1) * 3); + var p3 = BABYLON.Vector3.FromArray(positions, (index + 2) * 3); + var p1p2 = p1.subtract(p2); + var p3p2 = p3.subtract(p2); + var normal = BABYLON.Vector3.Normalize(BABYLON.Vector3.Cross(p1p2, p3p2)); + // Store same normals for every vertex + for (var localIndex = 0; localIndex < 3; localIndex++) { + normals.push(normal.x); + normals.push(normal.y); + normals.push(normal.z); + } + } + this.setIndices(indices); + this.setVerticesData(BABYLON.VertexBuffer.NormalKind, normals, updatableNormals); + // Updating vertex buffers + for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) { + kind = kinds[kindIndex]; + this.setVerticesData(kind, newdata[kind], vbs[kind].isUpdatable()); + } + // Updating submeshes + this.releaseSubMeshes(); + for (var submeshIndex = 0; submeshIndex < previousSubmeshes.length; submeshIndex++) { + var previousOne = previousSubmeshes[submeshIndex]; + var subMesh = new BABYLON.SubMesh(previousOne.materialIndex, previousOne.indexStart, previousOne.indexCount, previousOne.indexStart, previousOne.indexCount, this); + } + this.synchronizeInstances(); + }; + /** + * This method removes all the mesh indices and add new vertices (duplication) in order to unfold facets into buffers. + * In other words, more vertices, no more indices and a single bigger VBO. + * This method returns nothing. + * The mesh is really modified even if not set originally as updatable. Under the hood, a new VertexBuffer is allocated. + * + */ + Mesh.prototype.convertToUnIndexedMesh = function () { + /// Remove indices by unfolding faces into buffers + /// Warning: This implies adding vertices to the mesh in order to get exactly 3 vertices per face + var kinds = this.getVerticesDataKinds(); + var vbs = []; + var data = []; + var newdata = []; + var updatableNormals = false; + var kindIndex; + var kind; + for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) { + kind = kinds[kindIndex]; + var vertexBuffer = this.getVertexBuffer(kind); + vbs[kind] = vertexBuffer; + data[kind] = vbs[kind].getData(); + newdata[kind] = []; + } + // Save previous submeshes + var previousSubmeshes = this.subMeshes.slice(0); + var indices = this.getIndices(); + var totalIndices = this.getTotalIndices(); + // Generating unique vertices per face + var index; + for (index = 0; index < totalIndices; index++) { + var vertexIndex = indices[index]; + for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) { + kind = kinds[kindIndex]; + var stride = vbs[kind].getStrideSize(); + for (var offset = 0; offset < stride; offset++) { + newdata[kind].push(data[kind][vertexIndex * stride + offset]); + } + } + } + // Updating indices + for (index = 0; index < totalIndices; index += 3) { + indices[index] = index; + indices[index + 1] = index + 1; + indices[index + 2] = index + 2; + } + this.setIndices(indices); + // Updating vertex buffers + for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) { + kind = kinds[kindIndex]; + this.setVerticesData(kind, newdata[kind], vbs[kind].isUpdatable()); + } + // Updating submeshes + this.releaseSubMeshes(); + for (var submeshIndex = 0; submeshIndex < previousSubmeshes.length; submeshIndex++) { + var previousOne = previousSubmeshes[submeshIndex]; + var subMesh = new BABYLON.SubMesh(previousOne.materialIndex, previousOne.indexStart, previousOne.indexCount, previousOne.indexStart, previousOne.indexCount, this); + } + this._unIndexed = true; + this.synchronizeInstances(); + }; + /** + * Inverses facet orientations and inverts also the normals with `flipNormals` (default `false`) if true. + * This method returns nothing. + * Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call. + */ + Mesh.prototype.flipFaces = function (flipNormals) { + if (flipNormals === void 0) { flipNormals = false; } + var vertex_data = BABYLON.VertexData.ExtractFromMesh(this); + var i; + if (flipNormals && this.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) { + for (i = 0; i < vertex_data.normals.length; i++) { + vertex_data.normals[i] *= -1; + } + } + var temp; + for (i = 0; i < vertex_data.indices.length; i += 3) { + // reassign indices + temp = vertex_data.indices[i + 1]; + vertex_data.indices[i + 1] = vertex_data.indices[i + 2]; + vertex_data.indices[i + 2] = temp; + } + vertex_data.applyToMesh(this); + }; + // Instances + /** + * Creates a new InstancedMesh object from the mesh model. + * An instance shares the same properties and the same material than its model. + * Only these properties of each instance can then be set individually : + * - position + * - rotation + * - rotationQuaternion + * - setPivotMatrix + * - scaling + * tuto : http://doc.babylonjs.com/tutorials/How_to_use_Instances + * Warning : this method is not supported for Line mesh and LineSystem + */ + Mesh.prototype.createInstance = function (name) { + return new BABYLON.InstancedMesh(name, this); + }; + /** + * Synchronises all the mesh instance submeshes to the current mesh submeshes, if any. + * After this call, all the mesh instances have the same submeshes than the current mesh. + * This method returns nothing. + */ + Mesh.prototype.synchronizeInstances = function () { + for (var instanceIndex = 0; instanceIndex < this.instances.length; instanceIndex++) { + var instance = this.instances[instanceIndex]; + instance._syncSubMeshes(); + } + }; + /** + * Simplify the mesh according to the given array of settings. + * Function will return immediately and will simplify async. It returns nothing. + * @param settings a collection of simplification settings. + * @param parallelProcessing should all levels calculate parallel or one after the other. + * @param type the type of simplification to run. + * @param successCallback optional success callback to be called after the simplification finished processing all settings. + */ + Mesh.prototype.simplify = function (settings, parallelProcessing, simplificationType, successCallback) { + if (parallelProcessing === void 0) { parallelProcessing = true; } + if (simplificationType === void 0) { simplificationType = BABYLON.SimplificationType.QUADRATIC; } + this.getScene().simplificationQueue.addTask({ + settings: settings, + parallelProcessing: parallelProcessing, + mesh: this, + simplificationType: simplificationType, + successCallback: successCallback + }); + }; + /** + * Optimization of the mesh's indices, in case a mesh has duplicated vertices. + * The function will only reorder the indices and will not remove unused vertices to avoid problems with submeshes. + * This should be used together with the simplification to avoid disappearing triangles. + * @param successCallback an optional success callback to be called after the optimization finished. + */ + Mesh.prototype.optimizeIndices = function (successCallback) { + var _this = this; + var indices = this.getIndices(); + var positions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + var vectorPositions = []; + for (var pos = 0; pos < positions.length; pos = pos + 3) { + vectorPositions.push(BABYLON.Vector3.FromArray(positions, pos)); + } + var dupes = []; + BABYLON.AsyncLoop.SyncAsyncForLoop(vectorPositions.length, 40, function (iteration) { + var realPos = vectorPositions.length - 1 - iteration; + var testedPosition = vectorPositions[realPos]; + for (var j = 0; j < realPos; ++j) { + var againstPosition = vectorPositions[j]; + if (testedPosition.equals(againstPosition)) { + dupes[realPos] = j; + break; + } + } + }, function () { + for (var i = 0; i < indices.length; ++i) { + indices[i] = dupes[indices[i]] || indices[i]; + } + //indices are now reordered + var originalSubMeshes = _this.subMeshes.slice(0); + _this.setIndices(indices); + _this.subMeshes = originalSubMeshes; + if (successCallback) { + successCallback(_this); + } + }); + }; + // Statics + /** + * Returns a new Mesh object what is a deep copy of the passed mesh. + * The parameter `parsedMesh` is the mesh to be copied. + * The parameter `rootUrl` is a string, it's the root URL to prefix the `delayLoadingFile` property with + */ + Mesh.Parse = function (parsedMesh, scene, rootUrl) { + var mesh = new Mesh(parsedMesh.name, scene); + mesh.id = parsedMesh.id; + BABYLON.Tags.AddTagsTo(mesh, parsedMesh.tags); + mesh.position = BABYLON.Vector3.FromArray(parsedMesh.position); + if (parsedMesh.metadata !== undefined) { + mesh.metadata = parsedMesh.metadata; + } + if (parsedMesh.rotationQuaternion) { + mesh.rotationQuaternion = BABYLON.Quaternion.FromArray(parsedMesh.rotationQuaternion); + } + else if (parsedMesh.rotation) { + mesh.rotation = BABYLON.Vector3.FromArray(parsedMesh.rotation); + } + mesh.scaling = BABYLON.Vector3.FromArray(parsedMesh.scaling); + if (parsedMesh.localMatrix) { + mesh.setPivotMatrix(BABYLON.Matrix.FromArray(parsedMesh.localMatrix)); + } + else if (parsedMesh.pivotMatrix) { + mesh.setPivotMatrix(BABYLON.Matrix.FromArray(parsedMesh.pivotMatrix)); + } + mesh.setEnabled(parsedMesh.isEnabled); + mesh.isVisible = parsedMesh.isVisible; + mesh.infiniteDistance = parsedMesh.infiniteDistance; + mesh.showBoundingBox = parsedMesh.showBoundingBox; + mesh.showSubMeshesBoundingBox = parsedMesh.showSubMeshesBoundingBox; + if (parsedMesh.applyFog !== undefined) { + mesh.applyFog = parsedMesh.applyFog; + } + if (parsedMesh.pickable !== undefined) { + mesh.isPickable = parsedMesh.pickable; + } + if (parsedMesh.alphaIndex !== undefined) { + mesh.alphaIndex = parsedMesh.alphaIndex; + } + mesh.receiveShadows = parsedMesh.receiveShadows; + mesh.billboardMode = parsedMesh.billboardMode; + if (parsedMesh.visibility !== undefined) { + mesh.visibility = parsedMesh.visibility; + } + mesh.checkCollisions = parsedMesh.checkCollisions; + if (parsedMesh.isBlocker !== undefined) { + mesh.isBlocker = parsedMesh.isBlocker; + } + mesh._shouldGenerateFlatShading = parsedMesh.useFlatShading; + // freezeWorldMatrix + if (parsedMesh.freezeWorldMatrix) { + mesh._waitingFreezeWorldMatrix = parsedMesh.freezeWorldMatrix; + } + // Parent + if (parsedMesh.parentId) { + mesh._waitingParentId = parsedMesh.parentId; + } + // Actions + if (parsedMesh.actions !== undefined) { + mesh._waitingActions = parsedMesh.actions; + } + // Overlay + if (parsedMesh.overlayAlpha !== undefined) { + mesh.overlayAlpha = parsedMesh.overlayAlpha; + } + if (parsedMesh.overlayColor !== undefined) { + mesh.overlayColor = BABYLON.Color3.FromArray(parsedMesh.overlayColor); + } + if (parsedMesh.renderOverlay !== undefined) { + mesh.renderOverlay = parsedMesh.renderOverlay; + } + // Geometry + mesh.hasVertexAlpha = parsedMesh.hasVertexAlpha; + if (parsedMesh.delayLoadingFile) { + mesh.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED; + mesh.delayLoadingFile = rootUrl + parsedMesh.delayLoadingFile; + mesh._boundingInfo = new BABYLON.BoundingInfo(BABYLON.Vector3.FromArray(parsedMesh.boundingBoxMinimum), BABYLON.Vector3.FromArray(parsedMesh.boundingBoxMaximum)); + if (parsedMesh._binaryInfo) { + mesh._binaryInfo = parsedMesh._binaryInfo; + } + mesh._delayInfo = []; + if (parsedMesh.hasUVs) { + mesh._delayInfo.push(BABYLON.VertexBuffer.UVKind); + } + if (parsedMesh.hasUVs2) { + mesh._delayInfo.push(BABYLON.VertexBuffer.UV2Kind); + } + if (parsedMesh.hasUVs3) { + mesh._delayInfo.push(BABYLON.VertexBuffer.UV3Kind); + } + if (parsedMesh.hasUVs4) { + mesh._delayInfo.push(BABYLON.VertexBuffer.UV4Kind); + } + if (parsedMesh.hasUVs5) { + mesh._delayInfo.push(BABYLON.VertexBuffer.UV5Kind); + } + if (parsedMesh.hasUVs6) { + mesh._delayInfo.push(BABYLON.VertexBuffer.UV6Kind); + } + if (parsedMesh.hasColors) { + mesh._delayInfo.push(BABYLON.VertexBuffer.ColorKind); + } + if (parsedMesh.hasMatricesIndices) { + mesh._delayInfo.push(BABYLON.VertexBuffer.MatricesIndicesKind); + } + if (parsedMesh.hasMatricesWeights) { + mesh._delayInfo.push(BABYLON.VertexBuffer.MatricesWeightsKind); + } + mesh._delayLoadingFunction = BABYLON.Geometry.ImportGeometry; + if (BABYLON.SceneLoader.ForceFullSceneLoadingForIncremental) { + mesh._checkDelayState(); + } + } + else { + BABYLON.Geometry.ImportGeometry(parsedMesh, mesh); + } + // Material + if (parsedMesh.materialId) { + mesh.setMaterialByID(parsedMesh.materialId); + } + else { + mesh.material = null; + } + // Skeleton + if (parsedMesh.skeletonId > -1) { + mesh.skeleton = scene.getLastSkeletonByID(parsedMesh.skeletonId); + if (parsedMesh.numBoneInfluencers) { + mesh.numBoneInfluencers = parsedMesh.numBoneInfluencers; + } + } + // Animations + if (parsedMesh.animations) { + for (var animationIndex = 0; animationIndex < parsedMesh.animations.length; animationIndex++) { + var parsedAnimation = parsedMesh.animations[animationIndex]; + mesh.animations.push(BABYLON.Animation.Parse(parsedAnimation)); + } + BABYLON.Node.ParseAnimationRanges(mesh, parsedMesh, scene); + } + if (parsedMesh.autoAnimate) { + scene.beginAnimation(mesh, parsedMesh.autoAnimateFrom, parsedMesh.autoAnimateTo, parsedMesh.autoAnimateLoop, parsedMesh.autoAnimateSpeed || 1.0); + } + // Layer Mask + if (parsedMesh.layerMask && (!isNaN(parsedMesh.layerMask))) { + mesh.layerMask = Math.abs(parseInt(parsedMesh.layerMask)); + } + else { + mesh.layerMask = 0x0FFFFFFF; + } + //(Deprecated) physics + if (parsedMesh.physicsImpostor) { + mesh.physicsImpostor = new BABYLON.PhysicsImpostor(mesh, parsedMesh.physicsImpostor, { + mass: parsedMesh.physicsMass, + friction: parsedMesh.physicsFriction, + restitution: parsedMesh.physicsRestitution + }, scene); + } + // Instances + if (parsedMesh.instances) { + for (var index = 0; index < parsedMesh.instances.length; index++) { + var parsedInstance = parsedMesh.instances[index]; + var instance = mesh.createInstance(parsedInstance.name); + BABYLON.Tags.AddTagsTo(instance, parsedInstance.tags); + instance.position = BABYLON.Vector3.FromArray(parsedInstance.position); + if (parsedInstance.parentId) { + instance._waitingParentId = parsedInstance.parentId; + } + if (parsedInstance.rotationQuaternion) { + instance.rotationQuaternion = BABYLON.Quaternion.FromArray(parsedInstance.rotationQuaternion); + } + else if (parsedInstance.rotation) { + instance.rotation = BABYLON.Vector3.FromArray(parsedInstance.rotation); + } + instance.scaling = BABYLON.Vector3.FromArray(parsedInstance.scaling); + instance.checkCollisions = mesh.checkCollisions; + if (parsedMesh.animations) { + for (animationIndex = 0; animationIndex < parsedMesh.animations.length; animationIndex++) { + parsedAnimation = parsedMesh.animations[animationIndex]; + instance.animations.push(BABYLON.Animation.Parse(parsedAnimation)); + } + BABYLON.Node.ParseAnimationRanges(instance, parsedMesh, scene); + } + } + } + return mesh; + }; + /** + * Creates a ribbon mesh. + * Please consider using the same method from the MeshBuilder class instead. + * The ribbon is a parametric shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes. It has no predefined shape. Its final shape will depend on the input parameters. + * + * Please read this full tutorial to understand how to design a ribbon : http://doc.babylonjs.com/tutorials/Ribbon_Tutorial + * The parameter `pathArray` is a required array of paths, what are each an array of successive Vector3. The pathArray parameter depicts the ribbon geometry. + * The parameter `closeArray` (boolean, default false) creates a seam between the first and the last paths of the path array. + * The parameter `closePath` (boolean, default false) creates a seam between the first and the last points of each path of the path array. + * The parameter `offset` (positive integer, default : rounded half size of the pathArray length), is taken in account only if the `pathArray` is containing a single path. + * It's the offset to join together the points from the same path. Ex : offset = 10 means the point 1 is joined to the point 11. + * The optional parameter `instance` is an instance of an existing Ribbon object to be updated with the passed `pathArray` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#ribbon + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreateRibbon = function (name, pathArray, closeArray, closePath, offset, scene, updatable, sideOrientation, instance) { + return BABYLON.MeshBuilder.CreateRibbon(name, { + pathArray: pathArray, + closeArray: closeArray, + closePath: closePath, + offset: offset, + updatable: updatable, + sideOrientation: sideOrientation, + instance: instance + }, scene); + }; + /** + * Creates a plane polygonal mesh. By default, this is a disc. + * Please consider using the same method from the MeshBuilder class instead. + * The parameter `radius` sets the radius size (float) of the polygon (default 0.5). + * The parameter `tessellation` sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc. + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreateDisc = function (name, radius, tessellation, scene, updatable, sideOrientation) { + var options = { + radius: radius, + tessellation: tessellation, + sideOrientation: sideOrientation, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateDisc(name, options, scene); + }; + /** + * Creates a box mesh. + * Please consider using the same method from the MeshBuilder class instead. + * The parameter `size` sets the size (float) of each box side (default 1). + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreateBox = function (name, size, scene, updatable, sideOrientation) { + var options = { + size: size, + sideOrientation: sideOrientation, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateBox(name, options, scene); + }; + /** + * Creates a sphere mesh. + * Please consider using the same method from the MeshBuilder class instead. + * The parameter `diameter` sets the diameter size (float) of the sphere (default 1). + * The parameter `segments` sets the sphere number of horizontal stripes (positive integer, default 32). + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreateSphere = function (name, segments, diameter, scene, updatable, sideOrientation) { + var options = { + segments: segments, + diameterX: diameter, + diameterY: diameter, + diameterZ: diameter, + sideOrientation: sideOrientation, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateSphere(name, options, scene); + }; + /** + * Creates a cylinder or a cone mesh. + * Please consider using the same method from the MeshBuilder class instead. + * The parameter `height` sets the height size (float) of the cylinder/cone (float, default 2). + * The parameter `diameter` sets the diameter of the top and bottom cap at once (float, default 1). + * The parameters `diameterTop` and `diameterBottom` overwrite the parameter `diameter` and set respectively the top cap and bottom cap diameter (floats, default 1). The parameter "diameterBottom" can't be zero. + * The parameter `tessellation` sets the number of cylinder sides (positive integer, default 24). Set it to 3 to get a prism for instance. + * The parameter `subdivisions` sets the number of rings along the cylinder height (positive integer, default 1). + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreateCylinder = function (name, height, diameterTop, diameterBottom, tessellation, subdivisions, scene, updatable, sideOrientation) { + if (scene === undefined || !(scene instanceof BABYLON.Scene)) { + if (scene !== undefined) { + sideOrientation = updatable || Mesh.DEFAULTSIDE; + updatable = scene; + } + scene = subdivisions; + subdivisions = 1; + } + var options = { + height: height, + diameterTop: diameterTop, + diameterBottom: diameterBottom, + tessellation: tessellation, + subdivisions: subdivisions, + sideOrientation: sideOrientation, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateCylinder(name, options, scene); + }; + // Torus (Code from SharpDX.org) + /** + * Creates a torus mesh. + * Please consider using the same method from the MeshBuilder class instead. + * The parameter `diameter` sets the diameter size (float) of the torus (default 1). + * The parameter `thickness` sets the diameter size of the tube of the torus (float, default 0.5). + * The parameter `tessellation` sets the number of torus sides (postive integer, default 16). + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreateTorus = function (name, diameter, thickness, tessellation, scene, updatable, sideOrientation) { + var options = { + diameter: diameter, + thickness: thickness, + tessellation: tessellation, + sideOrientation: sideOrientation, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateTorus(name, options, scene); + }; + /** + * Creates a torus knot mesh. + * Please consider using the same method from the MeshBuilder class instead. + * The parameter `radius` sets the global radius size (float) of the torus knot (default 2). + * The parameter `radialSegments` sets the number of sides on each tube segments (positive integer, default 32). + * The parameter `tubularSegments` sets the number of tubes to decompose the knot into (positive integer, default 32). + * The parameters `p` and `q` are the number of windings on each axis (positive integers, default 2 and 3). + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreateTorusKnot = function (name, radius, tube, radialSegments, tubularSegments, p, q, scene, updatable, sideOrientation) { + var options = { + radius: radius, + tube: tube, + radialSegments: radialSegments, + tubularSegments: tubularSegments, + p: p, + q: q, + sideOrientation: sideOrientation, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateTorusKnot(name, options, scene); + }; + /** + * Creates a line mesh. + * Please consider using the same method from the MeshBuilder class instead. + * A line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter. + * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function. + * The parameter `points` is an array successive Vector3. + * The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#lines-and-dashedlines + * When updating an instance, remember that only point positions can change, not the number of points. + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreateLines = function (name, points, scene, updatable, instance) { + var options = { + points: points, + updatable: updatable, + instance: instance + }; + return BABYLON.MeshBuilder.CreateLines(name, options, scene); + }; + /** + * Creates a dashed line mesh. + * Please consider using the same method from the MeshBuilder class instead. + * A dashed line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter. + * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function. + * The parameter `points` is an array successive Vector3. + * The parameter `dashNb` is the intended total number of dashes (positive integer, default 200). + * The parameter `dashSize` is the size of the dashes relatively the dash number (positive float, default 3). + * The parameter `gapSize` is the size of the gap between two successive dashes relatively the dash number (positive float, default 1). + * The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#lines-and-dashedlines + * When updating an instance, remember that only point positions can change, not the number of points. + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreateDashedLines = function (name, points, dashSize, gapSize, dashNb, scene, updatable, instance) { + var options = { + points: points, + dashSize: dashSize, + gapSize: gapSize, + dashNb: dashNb, + updatable: updatable, + instance: instance + }; + return BABYLON.MeshBuilder.CreateDashedLines(name, options, scene); + }; + /** + * Creates an extruded shape mesh. + * The extrusion is a parametric shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes. It has no predefined shape. Its final shape will depend on the input parameters. + * Please consider using the same method from the MeshBuilder class instead. + * + * Please read this full tutorial to understand how to design an extruded shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes#extrusion + * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be + * extruded along the Z axis. + * The parameter `path` is a required array of successive Vector3. This is the axis curve the shape is extruded along. + * The parameter `rotation` (float, default 0 radians) is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve. + * The parameter `scale` (float, default 1) is the value to scale the shape. + * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL + * The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#extruded-shape + * Remember you can only change the shape or path point positions, not their number when updating an extruded shape. + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.ExtrudeShape = function (name, shape, path, scale, rotation, cap, scene, updatable, sideOrientation, instance) { + var options = { + shape: shape, + path: path, + scale: scale, + rotation: rotation, + cap: (cap === 0) ? 0 : cap || Mesh.NO_CAP, + sideOrientation: sideOrientation, + instance: instance, + updatable: updatable + }; + return BABYLON.MeshBuilder.ExtrudeShape(name, options, scene); + }; + /** + * Creates an custom extruded shape mesh. + * The custom extrusion is a parametric shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes. It has no predefined shape. Its final shape will depend on the input parameters. + * Please consider using the same method from the MeshBuilder class instead. + * + * Please read this full tutorial to understand how to design a custom extruded shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes#extrusion + * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be + * extruded along the Z axis. + * The parameter `path` is a required array of successive Vector3. This is the axis curve the shape is extruded along. + * The parameter `rotationFunction` (JS function) is a custom Javascript function called on each path point. This function is passed the position i of the point in the path + * and the distance of this point from the begining of the path : + * ```javascript + * var rotationFunction = function(i, distance) { + * // do things + * return rotationValue; } + * ``` + * It must returns a float value that will be the rotation in radians applied to the shape on each path point. + * The parameter `scaleFunction` (JS function) is a custom Javascript function called on each path point. This function is passed the position i of the point in the path + * and the distance of this point from the begining of the path : + * ```javascript + * var scaleFunction = function(i, distance) { + * // do things + * return scaleValue;} + * ``` + * It must returns a float value that will be the scale value applied to the shape on each path point. + * The parameter `ribbonClosePath` (boolean, default false) forces the extrusion underlying ribbon to close all the paths in its `pathArray`. + * The parameter `ribbonCloseArray` (boolean, default false) forces the extrusion underlying ribbon to close its `pathArray`. + * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL + * The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#extruded-shape + * Remember you can only change the shape or path point positions, not their number when updating an extruded shape. + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.ExtrudeShapeCustom = function (name, shape, path, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, scene, updatable, sideOrientation, instance) { + var options = { + shape: shape, + path: path, + scaleFunction: scaleFunction, + rotationFunction: rotationFunction, + ribbonCloseArray: ribbonCloseArray, + ribbonClosePath: ribbonClosePath, + cap: (cap === 0) ? 0 : cap || Mesh.NO_CAP, + sideOrientation: sideOrientation, + instance: instance, + updatable: updatable + }; + return BABYLON.MeshBuilder.ExtrudeShapeCustom(name, options, scene); + }; + /** + * Creates lathe mesh. + * The lathe is a shape with a symetry axis : a 2D model shape is rotated around this axis to design the lathe. + * Please consider using the same method from the MeshBuilder class instead. + * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be + * rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero. + * The parameter `radius` (positive float, default 1) is the radius value of the lathe. + * The parameter `tessellation` (positive integer, default 64) is the side number of the lathe. + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreateLathe = function (name, shape, radius, tessellation, scene, updatable, sideOrientation) { + var options = { + shape: shape, + radius: radius, + tessellation: tessellation, + sideOrientation: sideOrientation, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateLathe(name, options, scene); + }; + /** + * Creates a plane mesh. + * Please consider using the same method from the MeshBuilder class instead. + * The parameter `size` sets the size (float) of both sides of the plane at once (default 1). + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreatePlane = function (name, size, scene, updatable, sideOrientation) { + var options = { + size: size, + width: size, + height: size, + sideOrientation: sideOrientation, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreatePlane(name, options, scene); + }; + /** + * Creates a ground mesh. + * Please consider using the same method from the MeshBuilder class instead. + * The parameters `width` and `height` (floats, default 1) set the width and height sizes of the ground. + * The parameter `subdivisions` (positive integer) sets the number of subdivisions per side. + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreateGround = function (name, width, height, subdivisions, scene, updatable) { + var options = { + width: width, + height: height, + subdivisions: subdivisions, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateGround(name, options, scene); + }; + /** + * Creates a tiled ground mesh. + * Please consider using the same method from the MeshBuilder class instead. + * The parameters `xmin` and `xmax` (floats, default -1 and 1) set the ground minimum and maximum X coordinates. + * The parameters `zmin` and `zmax` (floats, default -1 and 1) set the ground minimum and maximum Z coordinates. + * The parameter `subdivisions` is a javascript object `{w: positive integer, h: positive integer}` (default `{w: 6, h: 6}`). `w` and `h` are the + * numbers of subdivisions on the ground width and height. Each subdivision is called a tile. + * The parameter `precision` is a javascript object `{w: positive integer, h: positive integer}` (default `{w: 2, h: 2}`). `w` and `h` are the + * numbers of subdivisions on the ground width and height of each tile. + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreateTiledGround = function (name, xmin, zmin, xmax, zmax, subdivisions, precision, scene, updatable) { + var options = { + xmin: xmin, + zmin: zmin, + xmax: xmax, + zmax: zmax, + subdivisions: subdivisions, + precision: precision, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateTiledGround(name, options, scene); + }; + /** + * Creates a ground mesh from a height map. + * tuto : http://doc.babylonjs.com/tutorials/14._Height_Map + * Please consider using the same method from the MeshBuilder class instead. + * The parameter `url` sets the URL of the height map image resource. + * The parameters `width` and `height` (positive floats, default 10) set the ground width and height sizes. + * The parameter `subdivisions` (positive integer, default 1) sets the number of subdivision per side. + * The parameter `minHeight` (float, default 0) is the minimum altitude on the ground. + * The parameter `maxHeight` (float, default 1) is the maximum altitude on the ground. + * The parameter `onReady` is a javascript callback function that will be called once the mesh is just built (the height map download can last some time). + * This function is passed the newly built mesh : + * ```javascript + * function(mesh) { // do things + * return; } + * ``` + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreateGroundFromHeightMap = function (name, url, width, height, subdivisions, minHeight, maxHeight, scene, updatable, onReady) { + var options = { + width: width, + height: height, + subdivisions: subdivisions, + minHeight: minHeight, + maxHeight: maxHeight, + updatable: updatable, + onReady: onReady + }; + return BABYLON.MeshBuilder.CreateGroundFromHeightMap(name, url, options, scene); + }; + /** + * Creates a tube mesh. + * The tube is a parametric shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes. It has no predefined shape. Its final shape will depend on the input parameters. + * Please consider using the same method from the MeshBuilder class instead. + * The parameter `path` is a required array of successive Vector3. It is the curve used as the axis of the tube. + * The parameter `radius` (positive float, default 1) sets the tube radius size. + * The parameter `tessellation` (positive float, default 64) is the number of sides on the tubular surface. + * The parameter `radiusFunction` (javascript function, default null) is a vanilla javascript function. If it is not null, it overwrittes the parameter `radius`. + * This function is called on each point of the tube path and is passed the index `i` of the i-th point and the distance of this point from the first point of the path. + * It must return a radius value (positive float) : + * ```javascript + * var radiusFunction = function(i, distance) { + * // do things + * return radius; } + * ``` + * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL + * The optional parameter `instance` is an instance of an existing Tube object to be updated with the passed `pathArray` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#tube + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreateTube = function (name, path, radius, tessellation, radiusFunction, cap, scene, updatable, sideOrientation, instance) { + var options = { + path: path, + radius: radius, + tessellation: tessellation, + radiusFunction: radiusFunction, + arc: 1, + cap: cap, + updatable: updatable, + sideOrientation: sideOrientation, + instance: instance + }; + return BABYLON.MeshBuilder.CreateTube(name, options, scene); + }; + /** + * Creates a polyhedron mesh. + * Please consider using the same method from the MeshBuilder class instead. + * The parameter `type` (positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embbeded types. Please refer to the type sheet in the tutorial + * to choose the wanted type. + * The parameter `size` (positive float, default 1) sets the polygon size. + * You can overwrite the `size` on each dimension bu using the parameters `sizeX`, `sizeY` or `sizeZ` (positive floats, default to `size` value). + * You can build other polyhedron types than the 15 embbeded ones by setting the parameter `custom` (`polyhedronObject`, default null). If you set the parameter `custom`, this overwrittes the parameter `type`. + * A `polyhedronObject` is a formatted javascript object. You'll find a full file with pre-set polyhedra here : https://github.com/BabylonJS/Extensions/tree/master/Polyhedron + * You can set the color and the UV of each side of the polyhedron with the parameters `faceColors` (Color4, default `(1, 1, 1, 1)`) and faceUV (Vector4, default `(0, 0, 1, 1)`). + * To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : http://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors + * The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored. + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreatePolyhedron = function (name, options, scene) { + return BABYLON.MeshBuilder.CreatePolyhedron(name, options, scene); + }; + /** + * Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided. + * Please consider using the same method from the MeshBuilder class instead. + * The parameter `radius` sets the radius size (float) of the icosphere (default 1). + * You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters `radiusX`, `radiusY` and `radiusZ` (all by default have the same value than `radius`). + * The parameter `subdivisions` sets the number of subdivisions (postive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size. + * The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface. + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + Mesh.CreateIcoSphere = function (name, options, scene) { + return BABYLON.MeshBuilder.CreateIcoSphere(name, options, scene); + }; + /** + * Creates a decal mesh. + * Please consider using the same method from the MeshBuilder class instead. + * A decal is a mesh usually applied as a model onto the surface of another mesh. So don't forget the parameter `sourceMesh` depicting the decal. + * The parameter `position` (Vector3, default `(0, 0, 0)`) sets the position of the decal in World coordinates. + * The parameter `normal` (Vector3, default Vector3.Up) sets the normal of the mesh where the decal is applied onto in World coordinates. + * The parameter `size` (Vector3, default `(1, 1, 1)`) sets the decal scaling. + * The parameter `angle` (float in radian, default 0) sets the angle to rotate the decal. + */ + Mesh.CreateDecal = function (name, sourceMesh, position, normal, size, angle) { + var options = { + position: position, + normal: normal, + size: size, + angle: angle + }; + return BABYLON.MeshBuilder.CreateDecal(name, sourceMesh, options); + }; + // Skeletons + /** + * @returns original positions used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh. + */ + Mesh.prototype.setPositionsForCPUSkinning = function () { + var source; + if (!this._sourcePositions) { + source = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + this._sourcePositions = new Float32Array(source); + if (!this.getVertexBuffer(BABYLON.VertexBuffer.PositionKind).isUpdatable()) { + this.setVerticesData(BABYLON.VertexBuffer.PositionKind, source, true); + } + } + return this._sourcePositions; + }; + /** + * @returns original normals used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh. + */ + Mesh.prototype.setNormalsForCPUSkinning = function () { + var source; + if (!this._sourceNormals) { + source = this.getVerticesData(BABYLON.VertexBuffer.NormalKind); + this._sourceNormals = new Float32Array(source); + if (!this.getVertexBuffer(BABYLON.VertexBuffer.NormalKind).isUpdatable()) { + this.setVerticesData(BABYLON.VertexBuffer.NormalKind, source, true); + } + } + return this._sourceNormals; + }; + /** + * Update the vertex buffers by applying transformation from the bones + * @param {skeleton} skeleton to apply + */ + Mesh.prototype.applySkeleton = function (skeleton) { + if (!this.geometry) { + return; + } + if (this.geometry._softwareSkinningRenderId == this.getScene().getRenderId()) { + return; + } + this.geometry._softwareSkinningRenderId = this.getScene().getRenderId(); + if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind)) { + return this; + } + if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) { + return this; + } + if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesIndicesKind)) { + return this; + } + if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsKind)) { + return this; + } + if (!this._sourcePositions) { + var submeshes = this.subMeshes.slice(); + this.setPositionsForCPUSkinning(); + this.subMeshes = submeshes; + } + if (!this._sourceNormals) { + this.setNormalsForCPUSkinning(); + } + // positionsData checks for not being Float32Array will only pass at most once + var positionsData = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + if (!(positionsData instanceof Float32Array)) { + positionsData = new Float32Array(positionsData); + } + // normalsData checks for not being Float32Array will only pass at most once + var normalsData = this.getVerticesData(BABYLON.VertexBuffer.NormalKind); + if (!(normalsData instanceof Float32Array)) { + normalsData = new Float32Array(normalsData); + } + var matricesIndicesData = this.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind); + var matricesWeightsData = this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind); + var needExtras = this.numBoneInfluencers > 4; + var matricesIndicesExtraData = needExtras ? this.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesExtraKind) : null; + var matricesWeightsExtraData = needExtras ? this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsExtraKind) : null; + var skeletonMatrices = skeleton.getTransformMatrices(this); + var tempVector3 = BABYLON.Vector3.Zero(); + var finalMatrix = new BABYLON.Matrix(); + var tempMatrix = new BABYLON.Matrix(); + var matWeightIdx = 0; + var inf; + for (var index = 0; index < positionsData.length; index += 3, matWeightIdx += 4) { + var weight; + for (inf = 0; inf < 4; inf++) { + weight = matricesWeightsData[matWeightIdx + inf]; + if (weight > 0) { + BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesData[matWeightIdx + inf] * 16, weight, tempMatrix); + finalMatrix.addToSelf(tempMatrix); + } + else + break; + } + if (needExtras) { + for (inf = 0; inf < 4; inf++) { + weight = matricesWeightsExtraData[matWeightIdx + inf]; + if (weight > 0) { + BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesExtraData[matWeightIdx + inf] * 16, weight, tempMatrix); + finalMatrix.addToSelf(tempMatrix); + } + else + break; + } + } + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(this._sourcePositions[index], this._sourcePositions[index + 1], this._sourcePositions[index + 2], finalMatrix, tempVector3); + tempVector3.toArray(positionsData, index); + BABYLON.Vector3.TransformNormalFromFloatsToRef(this._sourceNormals[index], this._sourceNormals[index + 1], this._sourceNormals[index + 2], finalMatrix, tempVector3); + tempVector3.toArray(normalsData, index); + finalMatrix.reset(); + } + this.updateVerticesData(BABYLON.VertexBuffer.PositionKind, positionsData); + this.updateVerticesData(BABYLON.VertexBuffer.NormalKind, normalsData); + return this; + }; + // Tools + /** + * Returns an object `{min:` Vector3`, max:` Vector3`}` + * This min and max Vector3 are the minimum and maximum vectors of each mesh bounding box from the passed array, in the World system + */ + Mesh.MinMax = function (meshes) { + var minVector = null; + var maxVector = null; + meshes.forEach(function (mesh, index, array) { + var boundingBox = mesh.getBoundingInfo().boundingBox; + if (!minVector) { + minVector = boundingBox.minimumWorld; + maxVector = boundingBox.maximumWorld; + } + else { + minVector.MinimizeInPlace(boundingBox.minimumWorld); + maxVector.MaximizeInPlace(boundingBox.maximumWorld); + } + }); + return { + min: minVector, + max: maxVector + }; + }; + /** + * Returns a Vector3, the center of the `{min:` Vector3`, max:` Vector3`}` or the center of MinMax vector3 computed from a mesh array. + */ + Mesh.Center = function (meshesOrMinMaxVector) { + var minMaxVector = (meshesOrMinMaxVector instanceof Array) ? BABYLON.Mesh.MinMax(meshesOrMinMaxVector) : meshesOrMinMaxVector; + return BABYLON.Vector3.Center(minMaxVector.min, minMaxVector.max); + }; + /** + * Merge the array of meshes into a single mesh for performance reasons. + * @param {Array} meshes - The vertices source. They should all be of the same material. Entries can empty + * @param {boolean} disposeSource - When true (default), dispose of the vertices from the source meshes + * @param {boolean} allow32BitsIndices - When the sum of the vertices > 64k, this must be set to true. + * @param {Mesh} meshSubclass - When set, vertices inserted into this Mesh. Meshes can then be merged into a Mesh sub-class. + */ + Mesh.MergeMeshes = function (meshes, disposeSource, allow32BitsIndices, meshSubclass) { + if (disposeSource === void 0) { disposeSource = true; } + var index; + if (!allow32BitsIndices) { + var totalVertices = 0; + // Counting vertices + for (index = 0; index < meshes.length; index++) { + if (meshes[index]) { + totalVertices += meshes[index].getTotalVertices(); + if (totalVertices > 65536) { + BABYLON.Tools.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"); + return null; + } + } + } + } + // Merge + var vertexData; + var otherVertexData; + var source; + for (index = 0; index < meshes.length; index++) { + if (meshes[index]) { + meshes[index].computeWorldMatrix(true); + otherVertexData = BABYLON.VertexData.ExtractFromMesh(meshes[index], true); + otherVertexData.transform(meshes[index].getWorldMatrix()); + if (vertexData) { + vertexData.merge(otherVertexData); + } + else { + vertexData = otherVertexData; + source = meshes[index]; + } + } + } + if (!meshSubclass) { + meshSubclass = new Mesh(source.name + "_merged", source.getScene()); + } + vertexData.applyToMesh(meshSubclass); + // Setting properties + meshSubclass.material = source.material; + meshSubclass.checkCollisions = source.checkCollisions; + // Cleaning + if (disposeSource) { + for (index = 0; index < meshes.length; index++) { + if (meshes[index]) { + meshes[index].dispose(); + } + } + } + return meshSubclass; + }; + // Consts + Mesh._FRONTSIDE = 0; + Mesh._BACKSIDE = 1; + Mesh._DOUBLESIDE = 2; + Mesh._DEFAULTSIDE = 0; + Mesh._NO_CAP = 0; + Mesh._CAP_START = 1; + Mesh._CAP_END = 2; + Mesh._CAP_ALL = 3; + return Mesh; + }(BABYLON.AbstractMesh)); + BABYLON.Mesh = Mesh; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.mesh.js.map + +var BABYLON; +(function (BABYLON) { + var SubMesh = (function () { + function SubMesh(materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh, renderingMesh, createBoundingBox) { + if (createBoundingBox === void 0) { createBoundingBox = true; } + this.materialIndex = materialIndex; + this.verticesStart = verticesStart; + this.verticesCount = verticesCount; + this.indexStart = indexStart; + this.indexCount = indexCount; + this._renderId = 0; + this._mesh = mesh; + this._renderingMesh = renderingMesh || mesh; + mesh.subMeshes.push(this); + this._trianglePlanes = []; + this._id = mesh.subMeshes.length - 1; + if (createBoundingBox) { + this.refreshBoundingInfo(); + mesh.computeWorldMatrix(true); + } + } + Object.defineProperty(SubMesh.prototype, "IsGlobal", { + get: function () { + return (this.verticesStart === 0 && this.verticesCount == this._mesh.getTotalVertices()); + }, + enumerable: true, + configurable: true + }); + SubMesh.prototype.getBoundingInfo = function () { + if (this.IsGlobal) { + return this._mesh.getBoundingInfo(); + } + return this._boundingInfo; + }; + SubMesh.prototype.getMesh = function () { + return this._mesh; + }; + SubMesh.prototype.getRenderingMesh = function () { + return this._renderingMesh; + }; + SubMesh.prototype.getMaterial = function () { + var rootMaterial = this._renderingMesh.material; + if (rootMaterial && rootMaterial instanceof BABYLON.MultiMaterial) { + var multiMaterial = rootMaterial; + return multiMaterial.getSubMaterial(this.materialIndex); + } + if (!rootMaterial) { + return this._mesh.getScene().defaultMaterial; + } + return rootMaterial; + }; + // Methods + SubMesh.prototype.refreshBoundingInfo = function () { + this._lastColliderWorldVertices = null; + if (this.IsGlobal) { + return; + } + var data = this._renderingMesh.getVerticesData(BABYLON.VertexBuffer.PositionKind); + if (!data) { + this._boundingInfo = this._mesh._boundingInfo; + return; + } + var indices = this._renderingMesh.getIndices(); + var extend; + //is this the only submesh? + if (this.indexStart === 0 && this.indexCount === indices.length) { + //the rendering mesh's bounding info can be used, it is the standard submesh for all indices. + extend = { minimum: this._renderingMesh.getBoundingInfo().minimum.clone(), maximum: this._renderingMesh.getBoundingInfo().maximum.clone() }; + } + else { + extend = BABYLON.Tools.ExtractMinAndMaxIndexed(data, indices, this.indexStart, this.indexCount, this._renderingMesh.geometry.boundingBias); + } + this._boundingInfo = new BABYLON.BoundingInfo(extend.minimum, extend.maximum); + }; + SubMesh.prototype._checkCollision = function (collider) { + return this.getBoundingInfo()._checkCollision(collider); + }; + SubMesh.prototype.updateBoundingInfo = function (world) { + if (!this.getBoundingInfo()) { + this.refreshBoundingInfo(); + } + this.getBoundingInfo().update(world); + }; + SubMesh.prototype.isInFrustum = function (frustumPlanes) { + return this.getBoundingInfo().isInFrustum(frustumPlanes); + }; + SubMesh.prototype.isCompletelyInFrustum = function (frustumPlanes) { + return this.getBoundingInfo().isCompletelyInFrustum(frustumPlanes); + }; + SubMesh.prototype.render = function (enableAlphaMode) { + this._renderingMesh.render(this, enableAlphaMode); + }; + SubMesh.prototype.getLinesIndexBuffer = function (indices, engine) { + if (!this._linesIndexBuffer) { + var linesIndices = []; + for (var index = this.indexStart; index < this.indexStart + this.indexCount; index += 3) { + linesIndices.push(indices[index], indices[index + 1], indices[index + 1], indices[index + 2], indices[index + 2], indices[index]); + } + this._linesIndexBuffer = engine.createIndexBuffer(linesIndices); + this.linesIndexCount = linesIndices.length; + } + return this._linesIndexBuffer; + }; + SubMesh.prototype.canIntersects = function (ray) { + return ray.intersectsBox(this.getBoundingInfo().boundingBox); + }; + SubMesh.prototype.intersects = function (ray, positions, indices, fastCheck) { + var intersectInfo = null; + // LineMesh first as it's also a Mesh... + if (this._mesh instanceof BABYLON.LinesMesh) { + var lineMesh = this._mesh; + // Line test + for (var index = this.indexStart; index < this.indexStart + this.indexCount; index += 2) { + var p0 = positions[indices[index]]; + var p1 = positions[indices[index + 1]]; + var length = ray.intersectionSegment(p0, p1, lineMesh.intersectionThreshold); + if (length < 0) { + continue; + } + if (fastCheck || !intersectInfo || length < intersectInfo.distance) { + intersectInfo = new BABYLON.IntersectionInfo(null, null, length); + if (fastCheck) { + break; + } + } + } + } + else { + // Triangles test + for (var index = this.indexStart; index < this.indexStart + this.indexCount; index += 3) { + var p0 = positions[indices[index]]; + var p1 = positions[indices[index + 1]]; + var p2 = positions[indices[index + 2]]; + var currentIntersectInfo = ray.intersectsTriangle(p0, p1, p2); + if (currentIntersectInfo) { + if (currentIntersectInfo.distance < 0) { + continue; + } + if (fastCheck || !intersectInfo || currentIntersectInfo.distance < intersectInfo.distance) { + intersectInfo = currentIntersectInfo; + intersectInfo.faceId = index / 3; + if (fastCheck) { + break; + } + } + } + } + } + return intersectInfo; + }; + // Clone + SubMesh.prototype.clone = function (newMesh, newRenderingMesh) { + var result = new SubMesh(this.materialIndex, this.verticesStart, this.verticesCount, this.indexStart, this.indexCount, newMesh, newRenderingMesh, false); + if (!this.IsGlobal) { + result._boundingInfo = new BABYLON.BoundingInfo(this.getBoundingInfo().minimum, this.getBoundingInfo().maximum); + } + return result; + }; + // Dispose + SubMesh.prototype.dispose = function () { + if (this._linesIndexBuffer) { + this._mesh.getScene().getEngine()._releaseBuffer(this._linesIndexBuffer); + this._linesIndexBuffer = null; + } + // Remove from mesh + var index = this._mesh.subMeshes.indexOf(this); + this._mesh.subMeshes.splice(index, 1); + }; + // Statics + SubMesh.CreateFromIndices = function (materialIndex, startIndex, indexCount, mesh, renderingMesh) { + var minVertexIndex = Number.MAX_VALUE; + var maxVertexIndex = -Number.MAX_VALUE; + renderingMesh = renderingMesh || mesh; + var indices = renderingMesh.getIndices(); + for (var index = startIndex; index < startIndex + indexCount; index++) { + var vertexIndex = indices[index]; + if (vertexIndex < minVertexIndex) + minVertexIndex = vertexIndex; + if (vertexIndex > maxVertexIndex) + maxVertexIndex = vertexIndex; + } + return new SubMesh(materialIndex, minVertexIndex, maxVertexIndex - minVertexIndex + 1, startIndex, indexCount, mesh, renderingMesh); + }; + return SubMesh; + }()); + BABYLON.SubMesh = SubMesh; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.subMesh.js.map + +var BABYLON; +(function (BABYLON) { + var MeshBuilder = (function () { + function MeshBuilder() { + } + MeshBuilder.updateSideOrientation = function (orientation, scene) { + if (orientation == BABYLON.Mesh.DOUBLESIDE) { + return BABYLON.Mesh.DOUBLESIDE; + } + if (orientation === undefined || orientation === null) { + return BABYLON.Mesh.FRONTSIDE; + } + return orientation; + }; + /** + * Creates a box mesh. + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#box + * The parameter `size` sets the size (float) of each box side (default 1). + * You can set some different box dimensions by using the parameters `width`, `height` and `depth` (all by default have the same value than `size`). + * You can set different colors and different images to each box side by using the parameters `faceColors` (an array of 6 Color3 elements) and `faceUV` (an array of 6 Vector4 elements). + * Please read this tutorial : http://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreateBox = function (name, options, scene) { + var box = new BABYLON.Mesh(name, scene); + options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene); + var vertexData = BABYLON.VertexData.CreateBox(options); + vertexData.applyToMesh(box, options.updatable); + return box; + }; + /** + * Creates a sphere mesh. + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#sphere + * The parameter `diameter` sets the diameter size (float) of the sphere (default 1). + * You can set some different sphere dimensions, for instance to build an ellipsoid, by using the parameters `diameterX`, `diameterY` and `diameterZ` (all by default have the same value than `diameter`). + * The parameter `segments` sets the sphere number of horizontal stripes (positive integer, default 32). + * You can create an unclosed sphere with the parameter `arc` (positive float, default 1), valued between 0 and 1, what is the ratio of the circumference (latitude) : 2 x PI x ratio + * You can create an unclosed sphere on its height with the parameter `slice` (positive float, default1), valued between 0 and 1, what is the height ratio (longitude). + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreateSphere = function (name, options, scene) { + var sphere = new BABYLON.Mesh(name, scene); + options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene); + var vertexData = BABYLON.VertexData.CreateSphere(options); + vertexData.applyToMesh(sphere, options.updatable); + return sphere; + }; + /** + * Creates a plane polygonal mesh. By default, this is a disc. + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#disc + * The parameter `radius` sets the radius size (float) of the polygon (default 0.5). + * The parameter `tessellation` sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc. + * You can create an unclosed polygon with the parameter `arc` (positive float, default 1), valued between 0 and 1, what is the ratio of the circumference : 2 x PI x ratio + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreateDisc = function (name, options, scene) { + var disc = new BABYLON.Mesh(name, scene); + options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene); + var vertexData = BABYLON.VertexData.CreateDisc(options); + vertexData.applyToMesh(disc, options.updatable); + return disc; + }; + /** + * Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided. + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#icosphere + * The parameter `radius` sets the radius size (float) of the icosphere (default 1). + * You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters `radiusX`, `radiusY` and `radiusZ` (all by default have the same value than `radius`). + * The parameter `subdivisions` sets the number of subdivisions (postive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size. + * The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface. + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreateIcoSphere = function (name, options, scene) { + var sphere = new BABYLON.Mesh(name, scene); + options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene); + var vertexData = BABYLON.VertexData.CreateIcoSphere(options); + vertexData.applyToMesh(sphere, options.updatable); + return sphere; + }; + ; + /** + * Creates a ribbon mesh. + * The ribbon is a parametric shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes. It has no predefined shape. Its final shape will depend on the input parameters. + * + * Please read this full tutorial to understand how to design a ribbon : http://doc.babylonjs.com/tutorials/Ribbon_Tutorial + * The parameter `pathArray` is a required array of paths, what are each an array of successive Vector3. The pathArray parameter depicts the ribbon geometry. + * The parameter `closeArray` (boolean, default false) creates a seam between the first and the last paths of the path array. + * The parameter `closePath` (boolean, default false) creates a seam between the first and the last points of each path of the path array. + * The parameter `offset` (positive integer, default : rounded half size of the pathArray length), is taken in account only if the `pathArray` is containing a single path. + * It's the offset to join the points from the same path. Ex : offset = 10 means the point 1 is joined to the point 11. + * The optional parameter `instance` is an instance of an existing Ribbon object to be updated with the passed `pathArray` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#ribbon + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture. + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreateRibbon = function (name, options, scene) { + var pathArray = options.pathArray; + var closeArray = options.closeArray; + var closePath = options.closePath; + var offset = options.offset; + var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene); + var instance = options.instance; + var updatable = options.updatable; + if (instance) { + // positionFunction : ribbon case + // only pathArray and sideOrientation parameters are taken into account for positions update + BABYLON.Vector3.FromFloatsToRef(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, BABYLON.Tmp.Vector3[0]); // minimum + BABYLON.Vector3.FromFloatsToRef(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, BABYLON.Tmp.Vector3[1]); + var positionFunction = function (positions) { + var minlg = pathArray[0].length; + var i = 0; + var ns = (instance.sideOrientation === BABYLON.Mesh.DOUBLESIDE) ? 2 : 1; + for (var si = 1; si <= ns; si++) { + for (var p = 0; p < pathArray.length; p++) { + var path = pathArray[p]; + var l = path.length; + minlg = (minlg < l) ? minlg : l; + var j = 0; + while (j < minlg) { + positions[i] = path[j].x; + positions[i + 1] = path[j].y; + positions[i + 2] = path[j].z; + if (path[j].x < BABYLON.Tmp.Vector3[0].x) { + BABYLON.Tmp.Vector3[0].x = path[j].x; + } + if (path[j].x > BABYLON.Tmp.Vector3[1].x) { + BABYLON.Tmp.Vector3[1].x = path[j].x; + } + if (path[j].y < BABYLON.Tmp.Vector3[0].y) { + BABYLON.Tmp.Vector3[0].y = path[j].y; + } + if (path[j].y > BABYLON.Tmp.Vector3[1].y) { + BABYLON.Tmp.Vector3[1].y = path[j].y; + } + if (path[j].z < BABYLON.Tmp.Vector3[0].z) { + BABYLON.Tmp.Vector3[0].z = path[j].z; + } + if (path[j].z > BABYLON.Tmp.Vector3[1].z) { + BABYLON.Tmp.Vector3[1].z = path[j].z; + } + j++; + i += 3; + } + if (instance._closePath) { + positions[i] = path[0].x; + positions[i + 1] = path[0].y; + positions[i + 2] = path[0].z; + i += 3; + } + } + } + }; + var positions = instance.getVerticesData(BABYLON.VertexBuffer.PositionKind); + positionFunction(positions); + instance._boundingInfo = new BABYLON.BoundingInfo(BABYLON.Tmp.Vector3[0], BABYLON.Tmp.Vector3[1]); + instance._boundingInfo.update(instance._worldMatrix); + instance.updateVerticesData(BABYLON.VertexBuffer.PositionKind, positions, false, false); + if (!(instance.areNormalsFrozen)) { + var indices = instance.getIndices(); + var normals = instance.getVerticesData(BABYLON.VertexBuffer.NormalKind); + BABYLON.VertexData.ComputeNormals(positions, indices, normals); + if (instance._closePath) { + var indexFirst = 0; + var indexLast = 0; + for (var p = 0; p < pathArray.length; p++) { + indexFirst = instance._idx[p] * 3; + if (p + 1 < pathArray.length) { + indexLast = (instance._idx[p + 1] - 1) * 3; + } + else { + indexLast = normals.length - 3; + } + normals[indexFirst] = (normals[indexFirst] + normals[indexLast]) * 0.5; + normals[indexFirst + 1] = (normals[indexFirst + 1] + normals[indexLast + 1]) * 0.5; + normals[indexFirst + 2] = (normals[indexFirst + 2] + normals[indexLast + 2]) * 0.5; + normals[indexLast] = normals[indexFirst]; + normals[indexLast + 1] = normals[indexFirst + 1]; + normals[indexLast + 2] = normals[indexFirst + 2]; + } + } + instance.updateVerticesData(BABYLON.VertexBuffer.NormalKind, normals, false, false); + } + return instance; + } + else { + var ribbon = new BABYLON.Mesh(name, scene); + ribbon.sideOrientation = sideOrientation; + var vertexData = BABYLON.VertexData.CreateRibbon(options); + if (closePath) { + ribbon._idx = vertexData._idx; + } + ribbon._closePath = closePath; + ribbon._closeArray = closeArray; + vertexData.applyToMesh(ribbon, updatable); + return ribbon; + } + }; + /** + * Creates a cylinder or a cone mesh. + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#cylinder-or-cone + * The parameter `height` sets the height size (float) of the cylinder/cone (float, default 2). + * The parameter `diameter` sets the diameter of the top and bottom cap at once (float, default 1). + * The parameters `diameterTop` and `diameterBottom` overwrite the parameter `diameter` and set respectively the top cap and bottom cap diameter (floats, default 1). The parameter "diameterBottom" can't be zero. + * The parameter `tessellation` sets the number of cylinder sides (positive integer, default 24). Set it to 3 to get a prism for instance. + * The parameter `subdivisions` sets the number of rings along the cylinder height (positive integer, default 1). + * The parameter `hasRings` (boolean, default false) makes the subdivisions independent from each other, so they become different faces. + * The parameter `enclose` (boolean, default false) adds two extra faces per subdivision to a sliced cylinder to close it around its height axis. + * The parameter `arc` (float, default 1) is the ratio (max 1) to apply to the circumference to slice the cylinder. + * You can set different colors and different images to each box side by using the parameters `faceColors` (an array of n Color3 elements) and `faceUV` (an array of n Vector4 elements). + * The value of n is the number of cylinder faces. If the cylinder has only 1 subdivisions, n equals : top face + cylinder surface + bottom face = 3 + * Now, if the cylinder has 5 independent subdivisions (hasRings = true), n equals : top face + 5 stripe surfaces + bottom face = 2 + 5 = 7 + * Finally, if the cylinder has 5 independent subdivisions and is enclose, n equals : top face + 5 x (stripe surface + 2 closing faces) + bottom face = 2 + 5 * 3 = 17 + * Each array (color or UVs) is always ordered the same way : the first element is the bottom cap, the last element is the top cap. The other elements are each a ring surface. + * If `enclose` is false, a ring surface is one element. + * If `enclose` is true, a ring surface is 3 successive elements in the array : the tubular surface, then the two closing faces. + * Example how to set colors and textures on a sliced cylinder : http://www.html5gamedevs.com/topic/17945-creating-a-closed-slice-of-a-cylinder/#comment-106379 + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreateCylinder = function (name, options, scene) { + var cylinder = new BABYLON.Mesh(name, scene); + options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene); + var vertexData = BABYLON.VertexData.CreateCylinder(options); + vertexData.applyToMesh(cylinder, options.updatable); + return cylinder; + }; + /** + * Creates a torus mesh. + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#torus + * The parameter `diameter` sets the diameter size (float) of the torus (default 1). + * The parameter `thickness` sets the diameter size of the tube of the torus (float, default 0.5). + * The parameter `tessellation` sets the number of torus sides (postive integer, default 16). + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreateTorus = function (name, options, scene) { + var torus = new BABYLON.Mesh(name, scene); + options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene); + var vertexData = BABYLON.VertexData.CreateTorus(options); + vertexData.applyToMesh(torus, options.updatable); + return torus; + }; + /** + * Creates a torus knot mesh. + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#torus-knot + * The parameter `radius` sets the global radius size (float) of the torus knot (default 2). + * The parameter `radialSegments` sets the number of sides on each tube segments (positive integer, default 32). + * The parameter `tubularSegments` sets the number of tubes to decompose the knot into (positive integer, default 32). + * The parameters `p` and `q` are the number of windings on each axis (positive integers, default 2 and 3). + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreateTorusKnot = function (name, options, scene) { + var torusKnot = new BABYLON.Mesh(name, scene); + options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene); + var vertexData = BABYLON.VertexData.CreateTorusKnot(options); + vertexData.applyToMesh(torusKnot, options.updatable); + return torusKnot; + }; + /** + * Creates a line system mesh. + * A line system is a pool of many lines gathered in a single mesh. + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#linesystem + * A line system mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of lines as an input parameter. + * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineSystem to this static function. + * The parameter `lines` is an array of lines, each line being an array of successive Vector3. + * The optional parameter `instance` is an instance of an existing LineSystem object to be updated with the passed `lines` parameter. The way to update it is the same than for + * updating a simple Line mesh, you just need to update every line in the `lines` array : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#lines-and-dashedlines + * When updating an instance, remember that only line point positions can change, not the number of points, neither the number of lines. + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreateLineSystem = function (name, options, scene) { + var instance = options.instance; + var lines = options.lines; + if (instance) { + var positionFunction = function (positions) { + var i = 0; + for (var l = 0; l < lines.length; l++) { + var points = lines[l]; + for (var p = 0; p < points.length; p++) { + positions[i] = points[p].x; + positions[i + 1] = points[p].y; + positions[i + 2] = points[p].z; + i += 3; + } + } + }; + instance.updateMeshPositions(positionFunction, false); + return instance; + } + // line system creation + var lineSystem = new BABYLON.LinesMesh(name, scene); + var vertexData = BABYLON.VertexData.CreateLineSystem(options); + vertexData.applyToMesh(lineSystem, options.updatable); + return lineSystem; + }; + /** + * Creates a line mesh. + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#lines + * A line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter. + * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function. + * The parameter `points` is an array successive Vector3. + * The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#lines-and-dashedlines + * When updating an instance, remember that only point positions can change, not the number of points. + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreateLines = function (name, options, scene) { + var lines = MeshBuilder.CreateLineSystem(name, { lines: [options.points], updatable: options.updatable, instance: options.instance }, scene); + return lines; + }; + /** + * Creates a dashed line mesh. + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#dashed-lines + * A dashed line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter. + * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function. + * The parameter `points` is an array successive Vector3. + * The parameter `dashNb` is the intended total number of dashes (positive integer, default 200). + * The parameter `dashSize` is the size of the dashes relatively the dash number (positive float, default 3). + * The parameter `gapSize` is the size of the gap between two successive dashes relatively the dash number (positive float, default 1). + * The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#lines-and-dashedlines + * When updating an instance, remember that only point positions can change, not the number of points. + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreateDashedLines = function (name, options, scene) { + var points = options.points; + var instance = options.instance; + var gapSize = options.gapSize; + var dashNb = options.dashNb; + var dashSize = options.dashSize; + if (instance) { + var positionFunction = function (positions) { + var curvect = BABYLON.Vector3.Zero(); + var nbSeg = positions.length / 6; + var lg = 0; + var nb = 0; + var shft = 0; + var dashshft = 0; + var curshft = 0; + var p = 0; + var i = 0; + var j = 0; + for (i = 0; i < points.length - 1; i++) { + points[i + 1].subtractToRef(points[i], curvect); + lg += curvect.length(); + } + shft = lg / nbSeg; + dashshft = instance.dashSize * shft / (instance.dashSize + instance.gapSize); + for (i = 0; i < points.length - 1; i++) { + points[i + 1].subtractToRef(points[i], curvect); + nb = Math.floor(curvect.length() / shft); + curvect.normalize(); + j = 0; + while (j < nb && p < positions.length) { + curshft = shft * j; + positions[p] = points[i].x + curshft * curvect.x; + positions[p + 1] = points[i].y + curshft * curvect.y; + positions[p + 2] = points[i].z + curshft * curvect.z; + positions[p + 3] = points[i].x + (curshft + dashshft) * curvect.x; + positions[p + 4] = points[i].y + (curshft + dashshft) * curvect.y; + positions[p + 5] = points[i].z + (curshft + dashshft) * curvect.z; + p += 6; + j++; + } + } + while (p < positions.length) { + positions[p] = points[i].x; + positions[p + 1] = points[i].y; + positions[p + 2] = points[i].z; + p += 3; + } + }; + instance.updateMeshPositions(positionFunction, false); + return instance; + } + // dashed lines creation + var dashedLines = new BABYLON.LinesMesh(name, scene); + var vertexData = BABYLON.VertexData.CreateDashedLines(options); + vertexData.applyToMesh(dashedLines, options.updatable); + dashedLines.dashSize = dashSize; + dashedLines.gapSize = gapSize; + return dashedLines; + }; + /** + * Creates an extruded shape mesh. + * The extrusion is a parametric shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes. It has no predefined shape. Its final shape will depend on the input parameters. + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#extruded-shapes + * + * Please read this full tutorial to understand how to design an extruded shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes#extrusion + * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be + * extruded along the Z axis. + * The parameter `path` is a required array of successive Vector3. This is the axis curve the shape is extruded along. + * The parameter `rotation` (float, default 0 radians) is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve. + * The parameter `scale` (float, default 1) is the value to scale the shape. + * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL + * The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#extruded-shape + * Remember you can only change the shape or path point positions, not their number when updating an extruded shape. + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture. + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.ExtrudeShape = function (name, options, scene) { + var path = options.path; + var shape = options.shape; + var scale = options.scale || 1; + var rotation = options.rotation || 0; + var cap = (options.cap === 0) ? 0 : options.cap || BABYLON.Mesh.NO_CAP; + var updatable = options.updatable; + var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene); + var instance = options.instance; + var invertUV = options.invertUV || false; + return MeshBuilder._ExtrudeShapeGeneric(name, shape, path, scale, rotation, null, null, false, false, cap, false, scene, updatable, sideOrientation, instance, invertUV); + }; + /** + * Creates an custom extruded shape mesh. + * The custom extrusion is a parametric shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes. It has no predefined shape. Its final shape will depend on the input parameters. + * tuto :http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#custom-extruded-shapes + * + * Please read this full tutorial to understand how to design a custom extruded shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes#extrusion + * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be + * extruded along the Z axis. + * The parameter `path` is a required array of successive Vector3. This is the axis curve the shape is extruded along. + * The parameter `rotationFunction` (JS function) is a custom Javascript function called on each path point. This function is passed the position i of the point in the path + * and the distance of this point from the begining of the path : + * ```javascript + * var rotationFunction = function(i, distance) { + * // do things + * return rotationValue; } + * ``` + * It must returns a float value that will be the rotation in radians applied to the shape on each path point. + * The parameter `scaleFunction` (JS function) is a custom Javascript function called on each path point. This function is passed the position i of the point in the path + * and the distance of this point from the begining of the path : + * ```javascript + * var scaleFunction = function(i, distance) { + * // do things + * return scaleValue;} + * ``` + * It must returns a float value that will be the scale value applied to the shape on each path point. + * The parameter `ribbonClosePath` (boolean, default false) forces the extrusion underlying ribbon to close all the paths in its `pathArray`. + * The parameter `ribbonCloseArray` (boolean, default false) forces the extrusion underlying ribbon to close its `pathArray`. + * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL + * The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#extruded-shape + * Remember you can only change the shape or path point positions, not their number when updating an extruded shape. + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture. + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.ExtrudeShapeCustom = function (name, options, scene) { + var path = options.path; + var shape = options.shape; + var scaleFunction = options.scaleFunction || (function () { return 1; }); + var rotationFunction = options.rotationFunction || (function () { return 0; }); + var ribbonCloseArray = options.ribbonCloseArray || false; + var ribbonClosePath = options.ribbonClosePath || false; + var cap = (options.cap === 0) ? 0 : options.cap || BABYLON.Mesh.NO_CAP; + var updatable = options.updatable; + var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene); + var instance = options.instance; + var invertUV = options.invertUV || false; + return MeshBuilder._ExtrudeShapeGeneric(name, shape, path, null, null, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, true, scene, updatable, sideOrientation, instance, invertUV); + }; + /** + * Creates lathe mesh. + * The lathe is a shape with a symetry axis : a 2D model shape is rotated around this axis to design the lathe. + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#lathe + * + * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be + * rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero. + * The parameter `radius` (positive float, default 1) is the radius value of the lathe. + * The parameter `tessellation` (positive integer, default 64) is the side number of the lathe. + * The parameter `arc` (positive float, default 1) is the ratio of the lathe. 0.5 builds for instance half a lathe, so an opened shape. + * The parameter `closed` (boolean, default true) opens/closes the lathe circumference. This should be set to false when used with the parameter "arc". + * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture. + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreateLathe = function (name, options, scene) { + var arc = (options.arc <= 0 || options.arc > 1) ? 1.0 : options.arc || 1.0; + var closed = (options.closed === undefined) ? true : options.closed; + var shape = options.shape; + var radius = options.radius || 1; + var tessellation = options.tessellation || 64; + var updatable = options.updatable; + var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene); + var cap = options.cap || BABYLON.Mesh.NO_CAP; + var pi2 = Math.PI * 2; + var paths = new Array(); + var invertUV = options.invertUV || false; + var i = 0; + var p = 0; + var step = pi2 / tessellation * arc; + var rotated; + var path = new Array(); + ; + for (i = 0; i <= tessellation; i++) { + var path = []; + if (cap == BABYLON.Mesh.CAP_START || cap == BABYLON.Mesh.CAP_ALL) { + path.push(new BABYLON.Vector3(0, shape[0].y, 0)); + path.push(new BABYLON.Vector3(Math.cos(i * step) * shape[0].x * radius, shape[0].y, Math.sin(i * step) * shape[0].x * radius)); + } + for (p = 0; p < shape.length; p++) { + rotated = new BABYLON.Vector3(Math.cos(i * step) * shape[p].x * radius, shape[p].y, Math.sin(i * step) * shape[p].x * radius); + path.push(rotated); + } + if (cap == BABYLON.Mesh.CAP_END || cap == BABYLON.Mesh.CAP_ALL) { + path.push(new BABYLON.Vector3(Math.cos(i * step) * shape[shape.length - 1].x * radius, shape[shape.length - 1].y, Math.sin(i * step) * shape[shape.length - 1].x * radius)); + path.push(new BABYLON.Vector3(0, shape[shape.length - 1].y, 0)); + } + paths.push(path); + } + // lathe ribbon + var lathe = MeshBuilder.CreateRibbon(name, { pathArray: paths, closeArray: closed, sideOrientation: sideOrientation, updatable: updatable, invertUV: invertUV }, scene); + return lathe; + }; + /** + * Creates a plane mesh. + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#plane + * The parameter `size` sets the size (float) of both sides of the plane at once (default 1). + * You can set some different plane dimensions by using the parameters `width` and `height` (both by default have the same value than `size`). + * The parameter `sourcePlane` is a Plane instance. It builds a mesh plane from a Math plane. + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreatePlane = function (name, options, scene) { + var plane = new BABYLON.Mesh(name, scene); + options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene); + var vertexData = BABYLON.VertexData.CreatePlane(options); + vertexData.applyToMesh(plane, options.updatable); + if (options.sourcePlane) { + plane.translate(options.sourcePlane.normal, options.sourcePlane.d); + var product = Math.acos(BABYLON.Vector3.Dot(options.sourcePlane.normal, BABYLON.Axis.Z)); + var vectorProduct = BABYLON.Vector3.Cross(BABYLON.Axis.Z, options.sourcePlane.normal); + plane.rotate(vectorProduct, product); + } + return plane; + }; + /** + * Creates a ground mesh. + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#plane + * The parameters `width` and `height` (floats, default 1) set the width and height sizes of the ground. + * The parameter `subdivisions` (positive integer) sets the number of subdivisions per side. + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreateGround = function (name, options, scene) { + var ground = new BABYLON.GroundMesh(name, scene); + ground._setReady(false); + ground._subdivisionsX = options.subdivisionsX || options.subdivisions || 1; + ground._subdivisionsY = options.subdivisionsY || options.subdivisions || 1; + ground._width = options.width || 1; + ground._height = options.height || 1; + ground._maxX = ground._width / 2; + ground._maxZ = ground._height / 2; + ground._minX = -ground._maxX; + ground._minZ = -ground._maxZ; + var vertexData = BABYLON.VertexData.CreateGround(options); + vertexData.applyToMesh(ground, options.updatable); + ground._setReady(true); + return ground; + }; + /** + * Creates a tiled ground mesh. + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#tiled-ground + * The parameters `xmin` and `xmax` (floats, default -1 and 1) set the ground minimum and maximum X coordinates. + * The parameters `zmin` and `zmax` (floats, default -1 and 1) set the ground minimum and maximum Z coordinates. + * The parameter `subdivisions` is a javascript object `{w: positive integer, h: positive integer}` (default `{w: 6, h: 6}`). `w` and `h` are the + * numbers of subdivisions on the ground width and height. Each subdivision is called a tile. + * The parameter `precision` is a javascript object `{w: positive integer, h: positive integer}` (default `{w: 2, h: 2}`). `w` and `h` are the + * numbers of subdivisions on the ground width and height of each tile. + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreateTiledGround = function (name, options, scene) { + var tiledGround = new BABYLON.Mesh(name, scene); + var vertexData = BABYLON.VertexData.CreateTiledGround(options); + vertexData.applyToMesh(tiledGround, options.updatable); + return tiledGround; + }; + /** + * Creates a ground mesh from a height map. + * tuto : http://doc.babylonjs.com/tutorials/14._Height_Map + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#ground-from-a-height-map + * The parameter `url` sets the URL of the height map image resource. + * The parameters `width` and `height` (positive floats, default 10) set the ground width and height sizes. + * The parameter `subdivisions` (positive integer, default 1) sets the number of subdivision per side. + * The parameter `minHeight` (float, default 0) is the minimum altitude on the ground. + * The parameter `maxHeight` (float, default 1) is the maximum altitude on the ground. + * The parameter `onReady` is a javascript callback function that will be called once the mesh is just built (the height map download can last some time). + * This function is passed the newly built mesh : + * ```javascript + * function(mesh) { // do things + * return; } + * ``` + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreateGroundFromHeightMap = function (name, url, options, scene) { + var width = options.width || 10.0; + var height = options.height || 10.0; + var subdivisions = options.subdivisions || 1 | 0; + var minHeight = options.minHeight || 0.0; + var maxHeight = options.maxHeight || 10.0; + var updatable = options.updatable; + var onReady = options.onReady; + var ground = new BABYLON.GroundMesh(name, scene); + ground._subdivisionsX = subdivisions; + ground._subdivisionsY = subdivisions; + ground._width = width; + ground._height = height; + ground._maxX = ground._width / 2.0; + ground._maxZ = ground._height / 2.0; + ground._minX = -ground._maxX; + ground._minZ = -ground._maxZ; + ground._setReady(false); + var onload = function (img) { + // Getting height map data + var canvas = document.createElement("canvas"); + var context = canvas.getContext("2d"); + var bufferWidth = img.width; + var bufferHeight = img.height; + canvas.width = bufferWidth; + canvas.height = bufferHeight; + context.drawImage(img, 0, 0); + // Create VertexData from map data + // Cast is due to wrong definition in lib.d.ts from ts 1.3 - https://github.com/Microsoft/TypeScript/issues/949 + var buffer = context.getImageData(0, 0, bufferWidth, bufferHeight).data; + var vertexData = BABYLON.VertexData.CreateGroundFromHeightMap({ + width: width, height: height, + subdivisions: subdivisions, + minHeight: minHeight, maxHeight: maxHeight, + buffer: buffer, bufferWidth: bufferWidth, bufferHeight: bufferHeight + }); + vertexData.applyToMesh(ground, updatable); + ground._setReady(true); + //execute ready callback, if set + if (onReady) { + onReady(ground); + } + }; + BABYLON.Tools.LoadImage(url, onload, function () { }, scene.database); + return ground; + }; + /** + * Creates a tube mesh. + * The tube is a parametric shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes. It has no predefined shape. Its final shape will depend on the input parameters. + * + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#tube + * The parameter `path` is a required array of successive Vector3. It is the curve used as the axis of the tube. + * The parameter `radius` (positive float, default 1) sets the tube radius size. + * The parameter `tessellation` (positive float, default 64) is the number of sides on the tubular surface. + * The parameter `radiusFunction` (javascript function, default null) is a vanilla javascript function. If it is not null, it overwrittes the parameter `radius`. + * This function is called on each point of the tube path and is passed the index `i` of the i-th point and the distance of this point from the first point of the path. + * It must return a radius value (positive float) : + * ```javascript + * var radiusFunction = function(i, distance) { + * // do things + * return radius; } + * ``` + * The parameter `arc` (positive float, maximum 1, default 1) is the ratio to apply to the tube circumference : 2 x PI x arc. + * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL + * The optional parameter `instance` is an instance of an existing Tube object to be updated with the passed `pathArray` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#tube + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture. + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreateTube = function (name, options, scene) { + var path = options.path; + var radius = options.radius || 1.0; + var tessellation = options.tessellation || 64 | 0; + var radiusFunction = options.radiusFunction; + var cap = options.cap || BABYLON.Mesh.NO_CAP; + var invertUV = options.invertUV || false; + var updatable = options.updatable; + var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene); + var instance = options.instance; + options.arc = (options.arc <= 0.0 || options.arc > 1.0) ? 1.0 : options.arc || 1.0; + // tube geometry + var tubePathArray = function (path, path3D, circlePaths, radius, tessellation, radiusFunction, cap, arc) { + var tangents = path3D.getTangents(); + var normals = path3D.getNormals(); + var distances = path3D.getDistances(); + var pi2 = Math.PI * 2; + var step = pi2 / tessellation * arc; + var returnRadius = function () { return radius; }; + var radiusFunctionFinal = radiusFunction || returnRadius; + var circlePath; + var rad; + var normal; + var rotated; + var rotationMatrix = BABYLON.Tmp.Matrix[0]; + var index = (cap === BABYLON.Mesh._NO_CAP || cap === BABYLON.Mesh.CAP_END) ? 0 : 2; + for (var i = 0; i < path.length; i++) { + rad = radiusFunctionFinal(i, distances[i]); // current radius + circlePath = Array(); // current circle array + normal = normals[i]; // current normal + for (var t = 0; t < tessellation; t++) { + BABYLON.Matrix.RotationAxisToRef(tangents[i], step * t, rotationMatrix); + rotated = circlePath[t] ? circlePath[t] : BABYLON.Vector3.Zero(); + BABYLON.Vector3.TransformCoordinatesToRef(normal, rotationMatrix, rotated); + rotated.scaleInPlace(rad).addInPlace(path[i]); + circlePath[t] = rotated; + } + circlePaths[index] = circlePath; + index++; + } + // cap + var capPath = function (nbPoints, pathIndex) { + var pointCap = Array(); + for (var i = 0; i < nbPoints; i++) { + pointCap.push(path[pathIndex]); + } + return pointCap; + }; + switch (cap) { + case BABYLON.Mesh.NO_CAP: + break; + case BABYLON.Mesh.CAP_START: + circlePaths[0] = capPath(tessellation, 0); + circlePaths[1] = circlePaths[2].slice(0); + break; + case BABYLON.Mesh.CAP_END: + circlePaths[index] = circlePaths[index - 1].slice(0); + circlePaths[index + 1] = capPath(tessellation, path.length - 1); + break; + case BABYLON.Mesh.CAP_ALL: + circlePaths[0] = capPath(tessellation, 0); + circlePaths[1] = circlePaths[2].slice(0); + circlePaths[index] = circlePaths[index - 1].slice(0); + circlePaths[index + 1] = capPath(tessellation, path.length - 1); + break; + default: + break; + } + return circlePaths; + }; + var path3D; + var pathArray; + if (instance) { + var arc = options.arc || instance.arc; + path3D = (instance.path3D).update(path); + pathArray = tubePathArray(path, path3D, instance.pathArray, radius, instance.tessellation, radiusFunction, instance.cap, arc); + instance = MeshBuilder.CreateRibbon(null, { pathArray: pathArray, instance: instance }); + instance.path3D = path3D; + instance.pathArray = pathArray; + instance.arc = arc; + return instance; + } + // tube creation + path3D = new BABYLON.Path3D(path); + var newPathArray = new Array(); + cap = (cap < 0 || cap > 3) ? 0 : cap; + pathArray = tubePathArray(path, path3D, newPathArray, radius, tessellation, radiusFunction, cap, options.arc); + var tube = MeshBuilder.CreateRibbon(name, { pathArray: pathArray, closePath: true, closeArray: false, updatable: updatable, sideOrientation: sideOrientation, invertUV: invertUV }, scene); + tube.pathArray = pathArray; + tube.path3D = path3D; + tube.tessellation = tessellation; + tube.cap = cap; + tube.arc = options.arc; + return tube; + }; + /** + * Creates a polyhedron mesh. + * + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#polyhedron + * The parameter `type` (positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embbeded types. Please refer to the type sheet in the tutorial + * to choose the wanted type. + * The parameter `size` (positive float, default 1) sets the polygon size. + * You can overwrite the `size` on each dimension bu using the parameters `sizeX`, `sizeY` or `sizeZ` (positive floats, default to `size` value). + * You can build other polyhedron types than the 15 embbeded ones by setting the parameter `custom` (`polyhedronObject`, default null). If you set the parameter `custom`, this overwrittes the parameter `type`. + * A `polyhedronObject` is a formatted javascript object. You'll find a full file with pre-set polyhedra here : https://github.com/BabylonJS/Extensions/tree/master/Polyhedron + * You can set the color and the UV of each side of the polyhedron with the parameters `faceColors` (Color4, default `(1, 1, 1, 1)`) and faceUV (Vector4, default `(0, 0, 1, 1)`). + * To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : http://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors + * The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored. + * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + */ + MeshBuilder.CreatePolyhedron = function (name, options, scene) { + var polyhedron = new BABYLON.Mesh(name, scene); + options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene); + var vertexData = BABYLON.VertexData.CreatePolyhedron(options); + vertexData.applyToMesh(polyhedron, options.updatable); + return polyhedron; + }; + /** + * Creates a decal mesh. + * tuto : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#decals + * A decal is a mesh usually applied as a model onto the surface of another mesh. So don't forget the parameter `sourceMesh` depicting the decal. + * The parameter `position` (Vector3, default `(0, 0, 0)`) sets the position of the decal in World coordinates. + * The parameter `normal` (Vector3, default `Vector3.Up`) sets the normal of the mesh where the decal is applied onto in World coordinates. + * The parameter `size` (Vector3, default `(1, 1, 1)`) sets the decal scaling. + * The parameter `angle` (float in radian, default 0) sets the angle to rotate the decal. + */ + MeshBuilder.CreateDecal = function (name, sourceMesh, options) { + var indices = sourceMesh.getIndices(); + var positions = sourceMesh.getVerticesData(BABYLON.VertexBuffer.PositionKind); + var normals = sourceMesh.getVerticesData(BABYLON.VertexBuffer.NormalKind); + var position = options.position || BABYLON.Vector3.Zero(); + var normal = options.normal || BABYLON.Vector3.Up(); + var size = options.size || new BABYLON.Vector3(1, 1, 1); + var angle = options.angle || 0; + // Getting correct rotation + if (!normal) { + var target = new BABYLON.Vector3(0, 0, 1); + var camera = sourceMesh.getScene().activeCamera; + var cameraWorldTarget = BABYLON.Vector3.TransformCoordinates(target, camera.getWorldMatrix()); + normal = camera.globalPosition.subtract(cameraWorldTarget); + } + var yaw = -Math.atan2(normal.z, normal.x) - Math.PI / 2; + var len = Math.sqrt(normal.x * normal.x + normal.z * normal.z); + var pitch = Math.atan2(normal.y, len); + // Matrix + var decalWorldMatrix = BABYLON.Matrix.RotationYawPitchRoll(yaw, pitch, angle).multiply(BABYLON.Matrix.Translation(position.x, position.y, position.z)); + var inverseDecalWorldMatrix = BABYLON.Matrix.Invert(decalWorldMatrix); + var meshWorldMatrix = sourceMesh.getWorldMatrix(); + var transformMatrix = meshWorldMatrix.multiply(inverseDecalWorldMatrix); + var vertexData = new BABYLON.VertexData(); + vertexData.indices = []; + vertexData.positions = []; + vertexData.normals = []; + vertexData.uvs = []; + var currentVertexDataIndex = 0; + var extractDecalVector3 = function (indexId) { + var vertexId = indices[indexId]; + var result = new BABYLON.PositionNormalVertex(); + result.position = new BABYLON.Vector3(positions[vertexId * 3], positions[vertexId * 3 + 1], positions[vertexId * 3 + 2]); + // Send vector to decal local world + result.position = BABYLON.Vector3.TransformCoordinates(result.position, transformMatrix); + // Get normal + result.normal = new BABYLON.Vector3(normals[vertexId * 3], normals[vertexId * 3 + 1], normals[vertexId * 3 + 2]); + return result; + }; // Inspired by https://github.com/mrdoob/three.js/blob/eee231960882f6f3b6113405f524956145148146/examples/js/geometries/DecalGeometry.js + var clip = function (vertices, axis) { + if (vertices.length === 0) { + return vertices; + } + var clipSize = 0.5 * Math.abs(BABYLON.Vector3.Dot(size, axis)); + var clipVertices = function (v0, v1) { + var clipFactor = BABYLON.Vector3.GetClipFactor(v0.position, v1.position, axis, clipSize); + return new BABYLON.PositionNormalVertex(BABYLON.Vector3.Lerp(v0.position, v1.position, clipFactor), BABYLON.Vector3.Lerp(v0.normal, v1.normal, clipFactor)); + }; + var result = new Array(); + for (var index = 0; index < vertices.length; index += 3) { + var v1Out; + var v2Out; + var v3Out; + var total = 0; + var nV1, nV2, nV3, nV4; + var d1 = BABYLON.Vector3.Dot(vertices[index].position, axis) - clipSize; + var d2 = BABYLON.Vector3.Dot(vertices[index + 1].position, axis) - clipSize; + var d3 = BABYLON.Vector3.Dot(vertices[index + 2].position, axis) - clipSize; + v1Out = d1 > 0; + v2Out = d2 > 0; + v3Out = d3 > 0; + total = (v1Out ? 1 : 0) + (v2Out ? 1 : 0) + (v3Out ? 1 : 0); + switch (total) { + case 0: + result.push(vertices[index]); + result.push(vertices[index + 1]); + result.push(vertices[index + 2]); + break; + case 1: + if (v1Out) { + nV1 = vertices[index + 1]; + nV2 = vertices[index + 2]; + nV3 = clipVertices(vertices[index], nV1); + nV4 = clipVertices(vertices[index], nV2); + } + if (v2Out) { + nV1 = vertices[index]; + nV2 = vertices[index + 2]; + nV3 = clipVertices(vertices[index + 1], nV1); + nV4 = clipVertices(vertices[index + 1], nV2); + result.push(nV3); + result.push(nV2.clone()); + result.push(nV1.clone()); + result.push(nV2.clone()); + result.push(nV3.clone()); + result.push(nV4); + break; + } + if (v3Out) { + nV1 = vertices[index]; + nV2 = vertices[index + 1]; + nV3 = clipVertices(vertices[index + 2], nV1); + nV4 = clipVertices(vertices[index + 2], nV2); + } + result.push(nV1.clone()); + result.push(nV2.clone()); + result.push(nV3); + result.push(nV4); + result.push(nV3.clone()); + result.push(nV2.clone()); + break; + case 2: + if (!v1Out) { + nV1 = vertices[index].clone(); + nV2 = clipVertices(nV1, vertices[index + 1]); + nV3 = clipVertices(nV1, vertices[index + 2]); + result.push(nV1); + result.push(nV2); + result.push(nV3); + } + if (!v2Out) { + nV1 = vertices[index + 1].clone(); + nV2 = clipVertices(nV1, vertices[index + 2]); + nV3 = clipVertices(nV1, vertices[index]); + result.push(nV1); + result.push(nV2); + result.push(nV3); + } + if (!v3Out) { + nV1 = vertices[index + 2].clone(); + nV2 = clipVertices(nV1, vertices[index]); + nV3 = clipVertices(nV1, vertices[index + 1]); + result.push(nV1); + result.push(nV2); + result.push(nV3); + } + break; + case 3: + break; + } + } + return result; + }; + for (var index = 0; index < indices.length; index += 3) { + var faceVertices = new Array(); + faceVertices.push(extractDecalVector3(index)); + faceVertices.push(extractDecalVector3(index + 1)); + faceVertices.push(extractDecalVector3(index + 2)); + // Clip + faceVertices = clip(faceVertices, new BABYLON.Vector3(1, 0, 0)); + faceVertices = clip(faceVertices, new BABYLON.Vector3(-1, 0, 0)); + faceVertices = clip(faceVertices, new BABYLON.Vector3(0, 1, 0)); + faceVertices = clip(faceVertices, new BABYLON.Vector3(0, -1, 0)); + faceVertices = clip(faceVertices, new BABYLON.Vector3(0, 0, 1)); + faceVertices = clip(faceVertices, new BABYLON.Vector3(0, 0, -1)); + if (faceVertices.length === 0) { + continue; + } + // Add UVs and get back to world + for (var vIndex = 0; vIndex < faceVertices.length; vIndex++) { + var vertex = faceVertices[vIndex]; + //TODO check for Int32Array + vertexData.indices.push(currentVertexDataIndex); + vertex.position.toArray(vertexData.positions, currentVertexDataIndex * 3); + vertex.normal.toArray(vertexData.normals, currentVertexDataIndex * 3); + vertexData.uvs.push(0.5 + vertex.position.x / size.x); + vertexData.uvs.push(0.5 + vertex.position.y / size.y); + currentVertexDataIndex++; + } + } + // Return mesh + var decal = new BABYLON.Mesh(name, sourceMesh.getScene()); + vertexData.applyToMesh(decal); + decal.position = position.clone(); + decal.rotation = new BABYLON.Vector3(pitch, yaw, angle); + return decal; + }; + // Privates + MeshBuilder._ExtrudeShapeGeneric = function (name, shape, curve, scale, rotation, scaleFunction, rotateFunction, rbCA, rbCP, cap, custom, scene, updtbl, side, instance, invertUV) { + // extrusion geometry + var extrusionPathArray = function (shape, curve, path3D, shapePaths, scale, rotation, scaleFunction, rotateFunction, cap, custom) { + var tangents = path3D.getTangents(); + var normals = path3D.getNormals(); + var binormals = path3D.getBinormals(); + var distances = path3D.getDistances(); + var angle = 0; + var returnScale = function () { return scale; }; + var returnRotation = function () { return rotation; }; + var rotate = custom ? rotateFunction : returnRotation; + var scl = custom ? scaleFunction : returnScale; + var index = (cap === BABYLON.Mesh.NO_CAP || cap === BABYLON.Mesh.CAP_END) ? 0 : 2; + var rotationMatrix = BABYLON.Tmp.Matrix[0]; + for (var i = 0; i < curve.length; i++) { + var shapePath = new Array(); + var angleStep = rotate(i, distances[i]); + var scaleRatio = scl(i, distances[i]); + for (var p = 0; p < shape.length; p++) { + BABYLON.Matrix.RotationAxisToRef(tangents[i], angle, rotationMatrix); + var planed = ((tangents[i].scale(shape[p].z)).add(normals[i].scale(shape[p].x)).add(binormals[i].scale(shape[p].y))); + var rotated = shapePath[p] ? shapePath[p] : BABYLON.Vector3.Zero(); + BABYLON.Vector3.TransformCoordinatesToRef(planed, rotationMatrix, rotated); + rotated.scaleInPlace(scaleRatio).addInPlace(curve[i]); + shapePath[p] = rotated; + } + shapePaths[index] = shapePath; + angle += angleStep; + index++; + } + // cap + var capPath = function (shapePath) { + var pointCap = Array(); + var barycenter = BABYLON.Vector3.Zero(); + var i; + for (i = 0; i < shapePath.length; i++) { + barycenter.addInPlace(shapePath[i]); + } + barycenter.scaleInPlace(1 / shapePath.length); + for (i = 0; i < shapePath.length; i++) { + pointCap.push(barycenter); + } + return pointCap; + }; + switch (cap) { + case BABYLON.Mesh.NO_CAP: + break; + case BABYLON.Mesh.CAP_START: + shapePaths[0] = capPath(shapePaths[2]); + shapePaths[1] = shapePaths[2].slice(0); + break; + case BABYLON.Mesh.CAP_END: + shapePaths[index] = shapePaths[index - 1]; + shapePaths[index + 1] = capPath(shapePaths[index - 1]); + break; + case BABYLON.Mesh.CAP_ALL: + shapePaths[0] = capPath(shapePaths[2]); + shapePaths[1] = shapePaths[2].slice(0); + shapePaths[index] = shapePaths[index - 1]; + shapePaths[index + 1] = capPath(shapePaths[index - 1]); + break; + default: + break; + } + return shapePaths; + }; + var path3D; + var pathArray; + if (instance) { + path3D = (instance.path3D).update(curve); + pathArray = extrusionPathArray(shape, curve, instance.path3D, instance.pathArray, scale, rotation, scaleFunction, rotateFunction, instance.cap, custom); + instance = BABYLON.Mesh.CreateRibbon(null, pathArray, null, null, null, scene, null, null, instance); + return instance; + } + // extruded shape creation + path3D = new BABYLON.Path3D(curve); + var newShapePaths = new Array(); + cap = (cap < 0 || cap > 3) ? 0 : cap; + pathArray = extrusionPathArray(shape, curve, path3D, newShapePaths, scale, rotation, scaleFunction, rotateFunction, cap, custom); + var extrudedGeneric = MeshBuilder.CreateRibbon(name, { pathArray: pathArray, closeArray: rbCA, closePath: rbCP, updatable: updtbl, sideOrientation: side, invertUV: invertUV }, scene); + extrudedGeneric.pathArray = pathArray; + extrudedGeneric.path3D = path3D; + extrudedGeneric.cap = cap; + return extrudedGeneric; + }; + return MeshBuilder; + }()); + BABYLON.MeshBuilder = MeshBuilder; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.meshBuilder.js.map + + +var BABYLON; +(function (BABYLON) { + var BaseTexture = (function () { + function BaseTexture(scene) { + this.hasAlpha = false; + this.getAlphaFromRGB = false; + this.level = 1; + this.coordinatesIndex = 0; + this.coordinatesMode = BABYLON.Texture.EXPLICIT_MODE; + this.wrapU = BABYLON.Texture.WRAP_ADDRESSMODE; + this.wrapV = BABYLON.Texture.WRAP_ADDRESSMODE; + this.anisotropicFilteringLevel = 4; + this.isCube = false; + this.isRenderTarget = false; + this.animations = new Array(); + /** + * An event triggered when the texture is disposed. + * @type {BABYLON.Observable} + */ + this.onDisposeObservable = new BABYLON.Observable(); + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NONE; + this._scene = scene; + this._scene.textures.push(this); + this._uid = null; + } + Object.defineProperty(BaseTexture.prototype, "uid", { + get: function () { + if (!this._uid) { + this._uid = BABYLON.Tools.RandomId(); + } + return this._uid; + }, + enumerable: true, + configurable: true + }); + BaseTexture.prototype.toString = function () { + return this.name; + }; + Object.defineProperty(BaseTexture.prototype, "onDispose", { + set: function (callback) { + if (this._onDisposeObserver) { + this.onDisposeObservable.remove(this._onDisposeObserver); + } + this._onDisposeObserver = this.onDisposeObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + BaseTexture.prototype.getScene = function () { + return this._scene; + }; + BaseTexture.prototype.getTextureMatrix = function () { + return null; + }; + BaseTexture.prototype.getReflectionTextureMatrix = function () { + return null; + }; + BaseTexture.prototype.getInternalTexture = function () { + return this._texture; + }; + BaseTexture.prototype.isReady = function () { + if (this.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_NOTLOADED) { + return true; + } + if (this._texture) { + return this._texture.isReady; + } + return false; + }; + BaseTexture.prototype.getSize = function () { + if (this._texture._width) { + return new BABYLON.Size(this._texture._width, this._texture._height); + } + if (this._texture._size) { + return new BABYLON.Size(this._texture._size, this._texture._size); + } + return BABYLON.Size.Zero(); + }; + BaseTexture.prototype.getBaseSize = function () { + if (!this.isReady() || !this._texture) + return BABYLON.Size.Zero(); + if (this._texture._size) { + return new BABYLON.Size(this._texture._size, this._texture._size); + } + return new BABYLON.Size(this._texture._baseWidth, this._texture._baseHeight); + }; + BaseTexture.prototype.scale = function (ratio) { + }; + Object.defineProperty(BaseTexture.prototype, "canRescale", { + get: function () { + return false; + }, + enumerable: true, + configurable: true + }); + BaseTexture.prototype._removeFromCache = function (url, noMipmap) { + var texturesCache = this._scene.getEngine().getLoadedTexturesCache(); + for (var index = 0; index < texturesCache.length; index++) { + var texturesCacheEntry = texturesCache[index]; + if (texturesCacheEntry.url === url && texturesCacheEntry.noMipmap === noMipmap) { + texturesCache.splice(index, 1); + return; + } + } + }; + BaseTexture.prototype._getFromCache = function (url, noMipmap, sampling) { + var texturesCache = this._scene.getEngine().getLoadedTexturesCache(); + for (var index = 0; index < texturesCache.length; index++) { + var texturesCacheEntry = texturesCache[index]; + if (texturesCacheEntry.url === url && texturesCacheEntry.noMipmap === noMipmap) { + if (!sampling || sampling === texturesCacheEntry.samplingMode) { + texturesCacheEntry.references++; + return texturesCacheEntry; + } + } + } + return null; + }; + BaseTexture.prototype.delayLoad = function () { + }; + BaseTexture.prototype.clone = function () { + return null; + }; + BaseTexture.prototype.releaseInternalTexture = function () { + if (this._texture) { + this._scene.getEngine().releaseInternalTexture(this._texture); + delete this._texture; + } + }; + BaseTexture.prototype.dispose = function () { + // Animations + this.getScene().stopAnimation(this); + // Remove from scene + var index = this._scene.textures.indexOf(this); + if (index >= 0) { + this._scene.textures.splice(index, 1); + } + if (this._texture === undefined) { + return; + } + // Release + this.releaseInternalTexture(); + // Callback + this.onDisposeObservable.notifyObservers(this); + this.onDisposeObservable.clear(); + }; + BaseTexture.prototype.serialize = function () { + if (!this.name) { + return null; + } + var serializationObject = BABYLON.SerializationHelper.Serialize(this); + // Animations + BABYLON.Animation.AppendSerializedAnimations(this, serializationObject); + return serializationObject; + }; + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "name", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "hasAlpha", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "getAlphaFromRGB", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "level", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "coordinatesIndex", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "coordinatesMode", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "wrapU", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "wrapV", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "anisotropicFilteringLevel", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "isCube", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "isRenderTarget", void 0); + return BaseTexture; + }()); + BABYLON.BaseTexture = BaseTexture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.baseTexture.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var Texture = (function (_super) { + __extends(Texture, _super); + function Texture(url, scene, noMipmap, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer) { + var _this = this; + if (noMipmap === void 0) { noMipmap = false; } + if (invertY === void 0) { invertY = true; } + if (samplingMode === void 0) { samplingMode = Texture.TRILINEAR_SAMPLINGMODE; } + if (onLoad === void 0) { onLoad = null; } + if (onError === void 0) { onError = null; } + if (buffer === void 0) { buffer = null; } + if (deleteBuffer === void 0) { deleteBuffer = false; } + _super.call(this, scene); + this.uOffset = 0; + this.vOffset = 0; + this.uScale = 1.0; + this.vScale = 1.0; + this.uAng = 0; + this.vAng = 0; + this.wAng = 0; + this.name = url; + this.url = url; + this._noMipmap = noMipmap; + this._invertY = invertY; + this._samplingMode = samplingMode; + this._buffer = buffer; + this._deleteBuffer = deleteBuffer; + if (!url) { + return; + } + this._texture = this._getFromCache(url, noMipmap, samplingMode); + var load = function () { + if (_this._onLoadObservarble && _this._onLoadObservarble.hasObservers()) { + _this.onLoadObservable.notifyObservers(true); + } + if (onLoad) { + onLoad(); + } + }; + if (!this._texture) { + if (!scene.useDelayedTextureLoading) { + this._texture = scene.getEngine().createTexture(url, noMipmap, invertY, scene, this._samplingMode, load, onError, this._buffer); + if (deleteBuffer) { + delete this._buffer; + } + } + else { + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED; + this._delayedOnLoad = load; + this._delayedOnError = onError; + } + } + else { + if (this._texture.isReady) { + BABYLON.Tools.SetImmediate(function () { return load(); }); + } + else { + this._texture.onLoadedCallbacks.push(load); + } + } + } + Object.defineProperty(Texture.prototype, "noMipmap", { + get: function () { + return this._noMipmap; + }, + enumerable: true, + configurable: true + }); + Texture.prototype.delayLoad = function () { + if (this.delayLoadState !== BABYLON.Engine.DELAYLOADSTATE_NOTLOADED) { + return; + } + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADED; + this._texture = this._getFromCache(this.url, this._noMipmap, this._samplingMode); + if (!this._texture) { + this._texture = this.getScene().getEngine().createTexture(this.url, this._noMipmap, this._invertY, this.getScene(), this._samplingMode, this._delayedOnLoad, this._delayedOnError, this._buffer); + if (this._deleteBuffer) { + delete this._buffer; + } + } + }; + Texture.prototype.updateSamplingMode = function (samplingMode) { + if (!this._texture) { + return; + } + this._samplingMode = samplingMode; + this.getScene().getEngine().updateTextureSamplingMode(samplingMode, this._texture); + }; + Texture.prototype._prepareRowForTextureGeneration = function (x, y, z, t) { + x *= this.uScale; + y *= this.vScale; + x -= 0.5 * this.uScale; + y -= 0.5 * this.vScale; + z -= 0.5; + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(x, y, z, this._rowGenerationMatrix, t); + t.x += 0.5 * this.uScale + this.uOffset; + t.y += 0.5 * this.vScale + this.vOffset; + t.z += 0.5; + }; + Texture.prototype.getTextureMatrix = function () { + if (this.uOffset === this._cachedUOffset && + this.vOffset === this._cachedVOffset && + this.uScale === this._cachedUScale && + this.vScale === this._cachedVScale && + this.uAng === this._cachedUAng && + this.vAng === this._cachedVAng && + this.wAng === this._cachedWAng) { + return this._cachedTextureMatrix; + } + this._cachedUOffset = this.uOffset; + this._cachedVOffset = this.vOffset; + this._cachedUScale = this.uScale; + this._cachedVScale = this.vScale; + this._cachedUAng = this.uAng; + this._cachedVAng = this.vAng; + this._cachedWAng = this.wAng; + if (!this._cachedTextureMatrix) { + this._cachedTextureMatrix = BABYLON.Matrix.Zero(); + this._rowGenerationMatrix = new BABYLON.Matrix(); + this._t0 = BABYLON.Vector3.Zero(); + this._t1 = BABYLON.Vector3.Zero(); + this._t2 = BABYLON.Vector3.Zero(); + } + BABYLON.Matrix.RotationYawPitchRollToRef(this.vAng, this.uAng, this.wAng, this._rowGenerationMatrix); + this._prepareRowForTextureGeneration(0, 0, 0, this._t0); + this._prepareRowForTextureGeneration(1.0, 0, 0, this._t1); + this._prepareRowForTextureGeneration(0, 1.0, 0, this._t2); + this._t1.subtractInPlace(this._t0); + this._t2.subtractInPlace(this._t0); + BABYLON.Matrix.IdentityToRef(this._cachedTextureMatrix); + this._cachedTextureMatrix.m[0] = this._t1.x; + this._cachedTextureMatrix.m[1] = this._t1.y; + this._cachedTextureMatrix.m[2] = this._t1.z; + this._cachedTextureMatrix.m[4] = this._t2.x; + this._cachedTextureMatrix.m[5] = this._t2.y; + this._cachedTextureMatrix.m[6] = this._t2.z; + this._cachedTextureMatrix.m[8] = this._t0.x; + this._cachedTextureMatrix.m[9] = this._t0.y; + this._cachedTextureMatrix.m[10] = this._t0.z; + return this._cachedTextureMatrix; + }; + Texture.prototype.getReflectionTextureMatrix = function () { + if (this.uOffset === this._cachedUOffset && + this.vOffset === this._cachedVOffset && + this.uScale === this._cachedUScale && + this.vScale === this._cachedVScale && + this.coordinatesMode === this._cachedCoordinatesMode) { + return this._cachedTextureMatrix; + } + if (!this._cachedTextureMatrix) { + this._cachedTextureMatrix = BABYLON.Matrix.Zero(); + this._projectionModeMatrix = BABYLON.Matrix.Zero(); + } + this._cachedCoordinatesMode = this.coordinatesMode; + switch (this.coordinatesMode) { + case Texture.PLANAR_MODE: + BABYLON.Matrix.IdentityToRef(this._cachedTextureMatrix); + this._cachedTextureMatrix[0] = this.uScale; + this._cachedTextureMatrix[5] = this.vScale; + this._cachedTextureMatrix[12] = this.uOffset; + this._cachedTextureMatrix[13] = this.vOffset; + break; + case Texture.PROJECTION_MODE: + BABYLON.Matrix.IdentityToRef(this._projectionModeMatrix); + this._projectionModeMatrix.m[0] = 0.5; + this._projectionModeMatrix.m[5] = -0.5; + this._projectionModeMatrix.m[10] = 0.0; + this._projectionModeMatrix.m[12] = 0.5; + this._projectionModeMatrix.m[13] = 0.5; + this._projectionModeMatrix.m[14] = 1.0; + this._projectionModeMatrix.m[15] = 1.0; + this.getScene().getProjectionMatrix().multiplyToRef(this._projectionModeMatrix, this._cachedTextureMatrix); + break; + default: + BABYLON.Matrix.IdentityToRef(this._cachedTextureMatrix); + break; + } + return this._cachedTextureMatrix; + }; + Texture.prototype.clone = function () { + var _this = this; + return BABYLON.SerializationHelper.Clone(function () { + return new Texture(_this._texture.url, _this.getScene(), _this._noMipmap, _this._invertY, _this._samplingMode); + }, this); + }; + Object.defineProperty(Texture.prototype, "onLoadObservable", { + get: function () { + if (!this._onLoadObservarble) { + this._onLoadObservarble = new BABYLON.Observable(); + } + return this._onLoadObservarble; + }, + enumerable: true, + configurable: true + }); + // Statics + Texture.CreateFromBase64String = function (data, name, scene, noMipmap, invertY, samplingMode, onLoad, onError) { + if (samplingMode === void 0) { samplingMode = Texture.TRILINEAR_SAMPLINGMODE; } + if (onLoad === void 0) { onLoad = null; } + if (onError === void 0) { onError = null; } + return new Texture("data:" + name, scene, noMipmap, invertY, samplingMode, onLoad, onError, data); + }; + Texture.Parse = function (parsedTexture, scene, rootUrl) { + if (parsedTexture.customType) { + var customTexture = BABYLON.Tools.Instantiate(parsedTexture.customType); + return customTexture.Parse(parsedTexture, scene, rootUrl); + } + if (parsedTexture.isCube) { + return BABYLON.CubeTexture.Parse(parsedTexture, scene, rootUrl); + } + if (!parsedTexture.name && !parsedTexture.isRenderTarget) { + return null; + } + var texture = BABYLON.SerializationHelper.Parse(function () { + if (parsedTexture.mirrorPlane) { + var mirrorTexture = new BABYLON.MirrorTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene); + mirrorTexture._waitingRenderList = parsedTexture.renderList; + mirrorTexture.mirrorPlane = BABYLON.Plane.FromArray(parsedTexture.mirrorPlane); + return mirrorTexture; + } + else if (parsedTexture.isRenderTarget) { + var renderTargetTexture = new BABYLON.RenderTargetTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene); + renderTargetTexture._waitingRenderList = parsedTexture.renderList; + return renderTargetTexture; + } + else { + var texture; + if (parsedTexture.base64String) { + texture = Texture.CreateFromBase64String(parsedTexture.base64String, parsedTexture.name, scene); + } + else { + texture = new Texture(rootUrl + parsedTexture.name, scene); + } + return texture; + } + }, parsedTexture, scene); + // Animations + if (parsedTexture.animations) { + for (var animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) { + var parsedAnimation = parsedTexture.animations[animationIndex]; + texture.animations.push(BABYLON.Animation.Parse(parsedAnimation)); + } + } + return texture; + }; + Texture.LoadFromDataString = function (name, buffer, scene, deleteBuffer, noMipmap, invertY, samplingMode, onLoad, onError) { + if (deleteBuffer === void 0) { deleteBuffer = false; } + if (noMipmap === void 0) { noMipmap = false; } + if (invertY === void 0) { invertY = true; } + if (samplingMode === void 0) { samplingMode = Texture.TRILINEAR_SAMPLINGMODE; } + if (onLoad === void 0) { onLoad = null; } + if (onError === void 0) { onError = null; } + if (name.substr(0, 5) !== "data:") { + name = "data:" + name; + } + return new Texture(name, scene, noMipmap, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer); + }; + // Constants + Texture.NEAREST_SAMPLINGMODE = 1; + Texture.BILINEAR_SAMPLINGMODE = 2; + Texture.TRILINEAR_SAMPLINGMODE = 3; + Texture.EXPLICIT_MODE = 0; + Texture.SPHERICAL_MODE = 1; + Texture.PLANAR_MODE = 2; + Texture.CUBIC_MODE = 3; + Texture.PROJECTION_MODE = 4; + Texture.SKYBOX_MODE = 5; + Texture.INVCUBIC_MODE = 6; + Texture.EQUIRECTANGULAR_MODE = 7; + Texture.FIXED_EQUIRECTANGULAR_MODE = 8; + Texture.CLAMP_ADDRESSMODE = 0; + Texture.WRAP_ADDRESSMODE = 1; + Texture.MIRROR_ADDRESSMODE = 2; + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "url", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "uOffset", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "vOffset", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "uScale", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "vScale", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "uAng", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "vAng", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "wAng", void 0); + return Texture; + }(BABYLON.BaseTexture)); + BABYLON.Texture = Texture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.texture.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var CubeTexture = (function (_super) { + __extends(CubeTexture, _super); + function CubeTexture(rootUrl, scene, extensions, noMipmap, files, onLoad, onError) { + if (onLoad === void 0) { onLoad = null; } + if (onError === void 0) { onError = null; } + _super.call(this, scene); + this.coordinatesMode = BABYLON.Texture.CUBIC_MODE; + this.name = rootUrl; + this.url = rootUrl; + this._noMipmap = noMipmap; + this.hasAlpha = false; + if (!rootUrl && !files) { + return; + } + this._texture = this._getFromCache(rootUrl, noMipmap); + if (!files) { + if (!extensions) { + extensions = ["_px.jpg", "_py.jpg", "_pz.jpg", "_nx.jpg", "_ny.jpg", "_nz.jpg"]; + } + files = []; + for (var index = 0; index < extensions.length; index++) { + files.push(rootUrl + extensions[index]); + } + this._extensions = extensions; + } + this._files = files; + if (!this._texture) { + if (!scene.useDelayedTextureLoading) { + this._texture = scene.getEngine().createCubeTexture(rootUrl, scene, files, noMipmap, onLoad, onError); + } + else { + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED; + } + } + else if (onLoad) { + if (this._texture.isReady) { + BABYLON.Tools.SetImmediate(function () { return onLoad(); }); + } + else { + this._texture.onLoadedCallbacks.push(onLoad); + } + } + this.isCube = true; + this._textureMatrix = BABYLON.Matrix.Identity(); + } + CubeTexture.CreateFromImages = function (files, scene, noMipmap) { + return new CubeTexture("", scene, null, noMipmap, files); + }; + // Methods + CubeTexture.prototype.delayLoad = function () { + if (this.delayLoadState !== BABYLON.Engine.DELAYLOADSTATE_NOTLOADED) { + return; + } + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADED; + this._texture = this._getFromCache(this.url, this._noMipmap); + if (!this._texture) { + this._texture = this.getScene().getEngine().createCubeTexture(this.url, this.getScene(), this._files, this._noMipmap); + } + }; + CubeTexture.prototype.getReflectionTextureMatrix = function () { + return this._textureMatrix; + }; + CubeTexture.Parse = function (parsedTexture, scene, rootUrl) { + var texture = BABYLON.SerializationHelper.Parse(function () { + return new BABYLON.CubeTexture(rootUrl + parsedTexture.name, scene, parsedTexture.extensions); + }, parsedTexture, scene); + // Animations + if (parsedTexture.animations) { + for (var animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) { + var parsedAnimation = parsedTexture.animations[animationIndex]; + texture.animations.push(BABYLON.Animation.Parse(parsedAnimation)); + } + } + return texture; + }; + CubeTexture.prototype.clone = function () { + var _this = this; + return BABYLON.SerializationHelper.Clone(function () { + return new CubeTexture(_this.url, _this.getScene(), _this._extensions, _this._noMipmap, _this._files); + }, this); + }; + return CubeTexture; + }(BABYLON.BaseTexture)); + BABYLON.CubeTexture = CubeTexture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.cubeTexture.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var RenderTargetTexture = (function (_super) { + __extends(RenderTargetTexture, _super); + function RenderTargetTexture(name, size, scene, generateMipMaps, doNotChangeAspectRatio, type, isCube, samplingMode, generateDepthBuffer, generateStencilBuffer) { + if (doNotChangeAspectRatio === void 0) { doNotChangeAspectRatio = true; } + if (type === void 0) { type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; } + if (isCube === void 0) { isCube = false; } + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + if (generateDepthBuffer === void 0) { generateDepthBuffer = true; } + if (generateStencilBuffer === void 0) { generateStencilBuffer = false; } + _super.call(this, null, scene, !generateMipMaps); + this.isCube = isCube; + /** + * Use this list to define the list of mesh you want to render. + */ + this.renderList = new Array(); + this.renderParticles = true; + this.renderSprites = false; + this.coordinatesMode = BABYLON.Texture.PROJECTION_MODE; + // Events + /** + * An event triggered when the texture is unbind. + * @type {BABYLON.Observable} + */ + this.onAfterUnbindObservable = new BABYLON.Observable(); + /** + * An event triggered before rendering the texture + * @type {BABYLON.Observable} + */ + this.onBeforeRenderObservable = new BABYLON.Observable(); + /** + * An event triggered after rendering the texture + * @type {BABYLON.Observable} + */ + this.onAfterRenderObservable = new BABYLON.Observable(); + /** + * An event triggered after the texture clear + * @type {BABYLON.Observable} + */ + this.onClearObservable = new BABYLON.Observable(); + this._currentRefreshId = -1; + this._refreshRate = 1; + this.name = name; + this.isRenderTarget = true; + this._size = size; + this._generateMipMaps = generateMipMaps; + this._doNotChangeAspectRatio = doNotChangeAspectRatio; + if (samplingMode === BABYLON.Texture.NEAREST_SAMPLINGMODE) { + this.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; + this.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; + } + if (isCube) { + this._texture = scene.getEngine().createRenderTargetCubeTexture(size, { + generateMipMaps: generateMipMaps, + samplingMode: samplingMode, + generateDepthBuffer: generateDepthBuffer, + generateStencilBuffer: generateStencilBuffer + }); + this.coordinatesMode = BABYLON.Texture.INVCUBIC_MODE; + this._textureMatrix = BABYLON.Matrix.Identity(); + } + else { + this._texture = scene.getEngine().createRenderTargetTexture(size, { + generateMipMaps: generateMipMaps, + type: type, + samplingMode: samplingMode, + generateDepthBuffer: generateDepthBuffer, + generateStencilBuffer: generateStencilBuffer + }); + } + // Rendering groups + this._renderingManager = new BABYLON.RenderingManager(scene); + } + Object.defineProperty(RenderTargetTexture, "REFRESHRATE_RENDER_ONCE", { + get: function () { + return RenderTargetTexture._REFRESHRATE_RENDER_ONCE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RenderTargetTexture, "REFRESHRATE_RENDER_ONEVERYFRAME", { + get: function () { + return RenderTargetTexture._REFRESHRATE_RENDER_ONEVERYFRAME; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RenderTargetTexture, "REFRESHRATE_RENDER_ONEVERYTWOFRAMES", { + get: function () { + return RenderTargetTexture._REFRESHRATE_RENDER_ONEVERYTWOFRAMES; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RenderTargetTexture.prototype, "onAfterUnbind", { + set: function (callback) { + if (this._onAfterUnbindObserver) { + this.onAfterUnbindObservable.remove(this._onAfterUnbindObserver); + } + this._onAfterUnbindObserver = this.onAfterUnbindObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RenderTargetTexture.prototype, "onBeforeRender", { + set: function (callback) { + if (this._onBeforeRenderObserver) { + this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver); + } + this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RenderTargetTexture.prototype, "onAfterRender", { + set: function (callback) { + if (this._onAfterRenderObserver) { + this.onAfterRenderObservable.remove(this._onAfterRenderObserver); + } + this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RenderTargetTexture.prototype, "onClear", { + set: function (callback) { + if (this._onClearObserver) { + this.onClearObservable.remove(this._onClearObserver); + } + this._onClearObserver = this.onClearObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + RenderTargetTexture.prototype.resetRefreshCounter = function () { + this._currentRefreshId = -1; + }; + Object.defineProperty(RenderTargetTexture.prototype, "refreshRate", { + get: function () { + return this._refreshRate; + }, + // Use 0 to render just once, 1 to render on every frame, 2 to render every two frames and so on... + set: function (value) { + this._refreshRate = value; + this.resetRefreshCounter(); + }, + enumerable: true, + configurable: true + }); + RenderTargetTexture.prototype._shouldRender = function () { + if (this._currentRefreshId === -1) { + this._currentRefreshId = 1; + return true; + } + if (this.refreshRate === this._currentRefreshId) { + this._currentRefreshId = 1; + return true; + } + this._currentRefreshId++; + return false; + }; + RenderTargetTexture.prototype.isReady = function () { + if (!this.getScene().renderTargetsEnabled) { + return false; + } + return _super.prototype.isReady.call(this); + }; + RenderTargetTexture.prototype.getRenderSize = function () { + return this._size; + }; + Object.defineProperty(RenderTargetTexture.prototype, "canRescale", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + RenderTargetTexture.prototype.scale = function (ratio) { + var newSize = this._size * ratio; + this.resize(newSize, this._generateMipMaps); + }; + RenderTargetTexture.prototype.getReflectionTextureMatrix = function () { + if (this.isCube) { + return this._textureMatrix; + } + return _super.prototype.getReflectionTextureMatrix.call(this); + }; + RenderTargetTexture.prototype.resize = function (size, generateMipMaps) { + this.releaseInternalTexture(); + if (this.isCube) { + this._texture = this.getScene().getEngine().createRenderTargetCubeTexture(size); + } + else { + this._texture = this.getScene().getEngine().createRenderTargetTexture(size, generateMipMaps); + } + }; + RenderTargetTexture.prototype.render = function (useCameraPostProcess, dumpForDebug) { + var scene = this.getScene(); + if (this.useCameraPostProcesses !== undefined) { + useCameraPostProcess = this.useCameraPostProcesses; + } + if (this.activeCamera && this.activeCamera !== scene.activeCamera) { + scene.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix(true)); + } + if (this._waitingRenderList) { + this.renderList = []; + for (var index = 0; index < this._waitingRenderList.length; index++) { + var id = this._waitingRenderList[index]; + this.renderList.push(scene.getMeshByID(id)); + } + delete this._waitingRenderList; + } + // Is predicate defined? + if (this.renderListPredicate) { + this.renderList.splice(0); // Clear previous renderList + var sceneMeshes = this.getScene().meshes; + for (var index = 0; index < sceneMeshes.length; index++) { + var mesh = sceneMeshes[index]; + if (this.renderListPredicate(mesh)) { + this.renderList.push(mesh); + } + } + } + if (this.renderList && this.renderList.length === 0) { + return; + } + // Prepare renderingManager + this._renderingManager.reset(); + var currentRenderList = this.renderList ? this.renderList : scene.getActiveMeshes().data; + var currentRenderListLength = this.renderList ? this.renderList.length : scene.getActiveMeshes().length; + var sceneRenderId = scene.getRenderId(); + for (var meshIndex = 0; meshIndex < currentRenderListLength; meshIndex++) { + var mesh = currentRenderList[meshIndex]; + if (mesh) { + if (!mesh.isReady()) { + // Reset _currentRefreshId + this.resetRefreshCounter(); + continue; + } + mesh._preActivateForIntermediateRendering(sceneRenderId); + if (mesh.isEnabled() && mesh.isVisible && mesh.subMeshes && ((mesh.layerMask & scene.activeCamera.layerMask) !== 0)) { + mesh._activate(sceneRenderId); + for (var subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) { + var subMesh = mesh.subMeshes[subIndex]; + scene._activeIndices.addCount(subMesh.indexCount, false); + this._renderingManager.dispatch(subMesh); + } + } + } + } + if (this.isCube) { + for (var face = 0; face < 6; face++) { + this.renderToTarget(face, currentRenderList, currentRenderListLength, useCameraPostProcess, dumpForDebug); + scene.incrementRenderId(); + scene.resetCachedMaterial(); + } + } + else { + this.renderToTarget(0, currentRenderList, currentRenderListLength, useCameraPostProcess, dumpForDebug); + } + this.onAfterUnbindObservable.notifyObservers(this); + if (this.activeCamera && this.activeCamera !== scene.activeCamera) { + scene.setTransformMatrix(scene.activeCamera.getViewMatrix(), scene.activeCamera.getProjectionMatrix(true)); + } + scene.resetCachedMaterial(); + }; + RenderTargetTexture.prototype.renderToTarget = function (faceIndex, currentRenderList, currentRenderListLength, useCameraPostProcess, dumpForDebug) { + var scene = this.getScene(); + var engine = scene.getEngine(); + // Bind + if (!useCameraPostProcess || !scene.postProcessManager._prepareFrame(this._texture)) { + if (this.isCube) { + engine.bindFramebuffer(this._texture, faceIndex); + } + else { + engine.bindFramebuffer(this._texture); + } + } + this.onBeforeRenderObservable.notifyObservers(faceIndex); + // Clear + if (this.onClearObservable.hasObservers()) { + this.onClearObservable.notifyObservers(engine); + } + else { + engine.clear(scene.clearColor, true, true, true); + } + if (!this._doNotChangeAspectRatio) { + scene.updateTransformMatrix(true); + } + // Render + this._renderingManager.render(this.customRenderFunction, currentRenderList, this.renderParticles, this.renderSprites); + if (useCameraPostProcess) { + scene.postProcessManager._finalizeFrame(false, this._texture, faceIndex); + } + if (!this._doNotChangeAspectRatio) { + scene.updateTransformMatrix(true); + } + this.onAfterRenderObservable.notifyObservers(faceIndex); + // Dump ? + if (dumpForDebug) { + BABYLON.Tools.DumpFramebuffer(this._size, this._size, engine); + } + // Unbind + if (!this.isCube || faceIndex === 5) { + if (this.isCube) { + if (faceIndex === 5) { + engine.generateMipMapsForCubemap(this._texture); + } + } + engine.unBindFramebuffer(this._texture, this.isCube); + } + }; + /** + * Overrides the default sort function applied in the renderging group to prepare the meshes. + * This allowed control for front to back rendering or reversly depending of the special needs. + * + * @param renderingGroupId The rendering group id corresponding to its index + * @param opaqueSortCompareFn The opaque queue comparison function use to sort. + * @param alphaTestSortCompareFn The alpha test queue comparison function use to sort. + * @param transparentSortCompareFn The transparent queue comparison function use to sort. + */ + RenderTargetTexture.prototype.setRenderingOrder = function (renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn) { + if (opaqueSortCompareFn === void 0) { opaqueSortCompareFn = null; } + if (alphaTestSortCompareFn === void 0) { alphaTestSortCompareFn = null; } + if (transparentSortCompareFn === void 0) { transparentSortCompareFn = null; } + this._renderingManager.setRenderingOrder(renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn); + }; + /** + * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups. + * + * @param renderingGroupId The rendering group id corresponding to its index + * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true. + */ + RenderTargetTexture.prototype.setRenderingAutoClearDepthStencil = function (renderingGroupId, autoClearDepthStencil) { + this._renderingManager.setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil); + }; + RenderTargetTexture.prototype.clone = function () { + var textureSize = this.getSize(); + var newTexture = new RenderTargetTexture(this.name, textureSize.width, this.getScene(), this._generateMipMaps); + // Base texture + newTexture.hasAlpha = this.hasAlpha; + newTexture.level = this.level; + // RenderTarget Texture + newTexture.coordinatesMode = this.coordinatesMode; + newTexture.renderList = this.renderList.slice(0); + return newTexture; + }; + RenderTargetTexture.prototype.serialize = function () { + if (!this.name) { + return null; + } + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.renderTargetSize = this.getRenderSize(); + serializationObject.renderList = []; + for (var index = 0; index < this.renderList.length; index++) { + serializationObject.renderList.push(this.renderList[index].id); + } + return serializationObject; + }; + RenderTargetTexture._REFRESHRATE_RENDER_ONCE = 0; + RenderTargetTexture._REFRESHRATE_RENDER_ONEVERYFRAME = 1; + RenderTargetTexture._REFRESHRATE_RENDER_ONEVERYTWOFRAMES = 2; + return RenderTargetTexture; + }(BABYLON.Texture)); + BABYLON.RenderTargetTexture = RenderTargetTexture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.renderTargetTexture.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var ProceduralTexture = (function (_super) { + __extends(ProceduralTexture, _super); + function ProceduralTexture(name, size, fragment, scene, fallbackTexture, generateMipMaps, isCube) { + if (generateMipMaps === void 0) { generateMipMaps = true; } + if (isCube === void 0) { isCube = false; } + _super.call(this, null, scene, !generateMipMaps); + this.isCube = isCube; + this.isEnabled = true; + this._currentRefreshId = -1; + this._refreshRate = 1; + this._vertexBuffers = {}; + this._uniforms = new Array(); + this._samplers = new Array(); + this._textures = new Array(); + this._floats = new Array(); + this._floatsArrays = {}; + this._colors3 = new Array(); + this._colors4 = new Array(); + this._vectors2 = new Array(); + this._vectors3 = new Array(); + this._matrices = new Array(); + this._fallbackTextureUsed = false; + scene._proceduralTextures.push(this); + this.name = name; + this.isRenderTarget = true; + this._size = size; + this._generateMipMaps = generateMipMaps; + this.setFragment(fragment); + this._fallbackTexture = fallbackTexture; + var engine = scene.getEngine(); + if (isCube) { + this._texture = engine.createRenderTargetCubeTexture(size, { generateMipMaps: generateMipMaps }); + this.setFloat("face", 0); + } + else { + this._texture = engine.createRenderTargetTexture(size, generateMipMaps); + } + // VBO + var vertices = []; + vertices.push(1, 1); + vertices.push(-1, 1); + vertices.push(-1, -1); + vertices.push(1, -1); + this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = new BABYLON.VertexBuffer(engine, vertices, BABYLON.VertexBuffer.PositionKind, false, false, 2); + // Indices + var indices = []; + indices.push(0); + indices.push(1); + indices.push(2); + indices.push(0); + indices.push(2); + indices.push(3); + this._indexBuffer = engine.createIndexBuffer(indices); + } + ProceduralTexture.prototype.reset = function () { + if (this._effect === undefined) { + return; + } + var engine = this.getScene().getEngine(); + engine._releaseEffect(this._effect); + }; + ProceduralTexture.prototype.isReady = function () { + var _this = this; + var engine = this.getScene().getEngine(); + var shaders; + if (!this._fragment) { + return false; + } + if (this._fallbackTextureUsed) { + return true; + } + if (this._fragment.fragmentElement !== undefined) { + shaders = { vertex: "procedural", fragmentElement: this._fragment.fragmentElement }; + } + else { + shaders = { vertex: "procedural", fragment: this._fragment }; + } + this._effect = engine.createEffect(shaders, [BABYLON.VertexBuffer.PositionKind], this._uniforms, this._samplers, "", null, null, function () { + _this.releaseInternalTexture(); + if (_this._fallbackTexture) { + _this._texture = _this._fallbackTexture._texture; + _this._texture.references++; + } + _this._fallbackTextureUsed = true; + }); + return this._effect.isReady(); + }; + ProceduralTexture.prototype.resetRefreshCounter = function () { + this._currentRefreshId = -1; + }; + ProceduralTexture.prototype.setFragment = function (fragment) { + this._fragment = fragment; + }; + Object.defineProperty(ProceduralTexture.prototype, "refreshRate", { + get: function () { + return this._refreshRate; + }, + // Use 0 to render just once, 1 to render on every frame, 2 to render every two frames and so on... + set: function (value) { + this._refreshRate = value; + this.resetRefreshCounter(); + }, + enumerable: true, + configurable: true + }); + ProceduralTexture.prototype._shouldRender = function () { + if (!this.isEnabled || !this.isReady() || !this._texture) { + return false; + } + if (this._fallbackTextureUsed) { + return false; + } + if (this._currentRefreshId === -1) { + this._currentRefreshId = 1; + return true; + } + if (this.refreshRate === this._currentRefreshId) { + this._currentRefreshId = 1; + return true; + } + this._currentRefreshId++; + return false; + }; + ProceduralTexture.prototype.getRenderSize = function () { + return this._size; + }; + ProceduralTexture.prototype.resize = function (size, generateMipMaps) { + if (this._fallbackTextureUsed) { + return; + } + this.releaseInternalTexture(); + this._texture = this.getScene().getEngine().createRenderTargetTexture(size, generateMipMaps); + }; + ProceduralTexture.prototype._checkUniform = function (uniformName) { + if (this._uniforms.indexOf(uniformName) === -1) { + this._uniforms.push(uniformName); + } + }; + ProceduralTexture.prototype.setTexture = function (name, texture) { + if (this._samplers.indexOf(name) === -1) { + this._samplers.push(name); + } + this._textures[name] = texture; + return this; + }; + ProceduralTexture.prototype.setFloat = function (name, value) { + this._checkUniform(name); + this._floats[name] = value; + return this; + }; + ProceduralTexture.prototype.setFloats = function (name, value) { + this._checkUniform(name); + this._floatsArrays[name] = value; + return this; + }; + ProceduralTexture.prototype.setColor3 = function (name, value) { + this._checkUniform(name); + this._colors3[name] = value; + return this; + }; + ProceduralTexture.prototype.setColor4 = function (name, value) { + this._checkUniform(name); + this._colors4[name] = value; + return this; + }; + ProceduralTexture.prototype.setVector2 = function (name, value) { + this._checkUniform(name); + this._vectors2[name] = value; + return this; + }; + ProceduralTexture.prototype.setVector3 = function (name, value) { + this._checkUniform(name); + this._vectors3[name] = value; + return this; + }; + ProceduralTexture.prototype.setMatrix = function (name, value) { + this._checkUniform(name); + this._matrices[name] = value; + return this; + }; + ProceduralTexture.prototype.render = function (useCameraPostProcess) { + var scene = this.getScene(); + var engine = scene.getEngine(); + // Render + engine.enableEffect(this._effect); + engine.setState(false); + // Texture + for (var name in this._textures) { + this._effect.setTexture(name, this._textures[name]); + } + // Float + for (name in this._floats) { + this._effect.setFloat(name, this._floats[name]); + } + // Floats + for (name in this._floatsArrays) { + this._effect.setArray(name, this._floatsArrays[name]); + } + // Color3 + for (name in this._colors3) { + this._effect.setColor3(name, this._colors3[name]); + } + // Color4 + for (name in this._colors4) { + var color = this._colors4[name]; + this._effect.setFloat4(name, color.r, color.g, color.b, color.a); + } + // Vector2 + for (name in this._vectors2) { + this._effect.setVector2(name, this._vectors2[name]); + } + // Vector3 + for (name in this._vectors3) { + this._effect.setVector3(name, this._vectors3[name]); + } + // Matrix + for (name in this._matrices) { + this._effect.setMatrix(name, this._matrices[name]); + } + // VBOs + engine.bindBuffers(this._vertexBuffers, this._indexBuffer, this._effect); + if (this.isCube) { + for (var face = 0; face < 6; face++) { + engine.bindFramebuffer(this._texture, face); + this._effect.setFloat("face", face); + // Clear + engine.clear(scene.clearColor, true, true, true); + // Draw order + engine.draw(true, 0, 6); + // Mipmaps + if (face === 5) { + engine.generateMipMapsForCubemap(this._texture); + } + } + } + else { + engine.bindFramebuffer(this._texture); + // Clear + engine.clear(scene.clearColor, true, true, true); + // Draw order + engine.draw(true, 0, 6); + } + // Unbind + engine.unBindFramebuffer(this._texture, this.isCube); + if (this.onGenerated) { + this.onGenerated(); + } + }; + ProceduralTexture.prototype.clone = function () { + var textureSize = this.getSize(); + var newTexture = new ProceduralTexture(this.name, textureSize.width, this._fragment, this.getScene(), this._fallbackTexture, this._generateMipMaps); + // Base texture + newTexture.hasAlpha = this.hasAlpha; + newTexture.level = this.level; + // RenderTarget Texture + newTexture.coordinatesMode = this.coordinatesMode; + return newTexture; + }; + ProceduralTexture.prototype.dispose = function () { + var index = this.getScene()._proceduralTextures.indexOf(this); + if (index >= 0) { + this.getScene()._proceduralTextures.splice(index, 1); + } + var vertexBuffer = this._vertexBuffers[BABYLON.VertexBuffer.PositionKind]; + if (vertexBuffer) { + vertexBuffer.dispose(); + this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = null; + } + if (this._indexBuffer && this.getScene().getEngine()._releaseBuffer(this._indexBuffer)) { + this._indexBuffer = null; + } + _super.prototype.dispose.call(this); + }; + return ProceduralTexture; + }(BABYLON.Texture)); + BABYLON.ProceduralTexture = ProceduralTexture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.proceduralTexture.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var MirrorTexture = (function (_super) { + __extends(MirrorTexture, _super); + function MirrorTexture(name, size, scene, generateMipMaps) { + var _this = this; + _super.call(this, name, size, scene, generateMipMaps, true); + this.mirrorPlane = new BABYLON.Plane(0, 1, 0, 1); + this._transformMatrix = BABYLON.Matrix.Zero(); + this._mirrorMatrix = BABYLON.Matrix.Zero(); + this.onBeforeRenderObservable.add(function () { + BABYLON.Matrix.ReflectionToRef(_this.mirrorPlane, _this._mirrorMatrix); + _this._savedViewMatrix = scene.getViewMatrix(); + _this._mirrorMatrix.multiplyToRef(_this._savedViewMatrix, _this._transformMatrix); + scene.setTransformMatrix(_this._transformMatrix, scene.getProjectionMatrix()); + scene.clipPlane = _this.mirrorPlane; + scene.getEngine().cullBackFaces = false; + scene._mirroredCameraPosition = BABYLON.Vector3.TransformCoordinates(scene.activeCamera.position, _this._mirrorMatrix); + }); + this.onAfterRenderObservable.add(function () { + scene.setTransformMatrix(_this._savedViewMatrix, scene.getProjectionMatrix()); + scene.getEngine().cullBackFaces = true; + scene._mirroredCameraPosition = null; + delete scene.clipPlane; + }); + } + MirrorTexture.prototype.clone = function () { + var textureSize = this.getSize(); + var newTexture = new MirrorTexture(this.name, textureSize.width, this.getScene(), this._generateMipMaps); + // Base texture + newTexture.hasAlpha = this.hasAlpha; + newTexture.level = this.level; + // Mirror Texture + newTexture.mirrorPlane = this.mirrorPlane.clone(); + newTexture.renderList = this.renderList.slice(0); + return newTexture; + }; + MirrorTexture.prototype.serialize = function () { + if (!this.name) { + return null; + } + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.mirrorPlane = this.mirrorPlane.asArray(); + return serializationObject; + }; + return MirrorTexture; + }(BABYLON.RenderTargetTexture)); + BABYLON.MirrorTexture = MirrorTexture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.mirrorTexture.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * Creates a refraction texture used by refraction channel of the standard material. + * @param name the texture name + * @param size size of the underlying texture + * @param scene root scene + */ + var RefractionTexture = (function (_super) { + __extends(RefractionTexture, _super); + function RefractionTexture(name, size, scene, generateMipMaps) { + var _this = this; + _super.call(this, name, size, scene, generateMipMaps, true); + this.refractionPlane = new BABYLON.Plane(0, 1, 0, 1); + this.depth = 2.0; + this.onBeforeRenderObservable.add(function () { + scene.clipPlane = _this.refractionPlane; + }); + this.onAfterRenderObservable.add(function () { + delete scene.clipPlane; + }); + } + RefractionTexture.prototype.clone = function () { + var textureSize = this.getSize(); + var newTexture = new RefractionTexture(this.name, textureSize.width, this.getScene(), this._generateMipMaps); + // Base texture + newTexture.hasAlpha = this.hasAlpha; + newTexture.level = this.level; + // Refraction Texture + newTexture.refractionPlane = this.refractionPlane.clone(); + newTexture.renderList = this.renderList.slice(0); + newTexture.depth = this.depth; + return newTexture; + }; + RefractionTexture.prototype.serialize = function () { + if (!this.name) { + return null; + } + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.mirrorPlane = this.refractionPlane.asArray(); + serializationObject.depth = this.depth; + return serializationObject; + }; + return RefractionTexture; + }(BABYLON.RenderTargetTexture)); + BABYLON.RefractionTexture = RefractionTexture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.refractionTexture.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var DynamicTexture = (function (_super) { + __extends(DynamicTexture, _super); + function DynamicTexture(name, options, scene, generateMipMaps, samplingMode) { + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + _super.call(this, null, scene, !generateMipMaps); + this.name = name; + this.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; + this.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; + this._generateMipMaps = generateMipMaps; + if (options.getContext) { + this._canvas = options; + this._texture = scene.getEngine().createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode); + } + else { + this._canvas = document.createElement("canvas"); + if (options.width) { + this._texture = scene.getEngine().createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode); + } + else { + this._texture = scene.getEngine().createDynamicTexture(options, options, generateMipMaps, samplingMode); + } + } + var textureSize = this.getSize(); + this._canvas.width = textureSize.width; + this._canvas.height = textureSize.height; + this._context = this._canvas.getContext("2d"); + } + Object.defineProperty(DynamicTexture.prototype, "canRescale", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + DynamicTexture.prototype.scale = function (ratio) { + var textureSize = this.getSize(); + textureSize.width *= ratio; + textureSize.height *= ratio; + this._canvas.width = textureSize.width; + this._canvas.height = textureSize.height; + this.releaseInternalTexture(); + this._texture = this.getScene().getEngine().createDynamicTexture(textureSize.width, textureSize.height, this._generateMipMaps, this._samplingMode); + }; + DynamicTexture.prototype.getContext = function () { + return this._context; + }; + DynamicTexture.prototype.clear = function () { + var size = this.getSize(); + this._context.fillRect(0, 0, size.width, size.height); + }; + DynamicTexture.prototype.update = function (invertY) { + this.getScene().getEngine().updateDynamicTexture(this._texture, this._canvas, invertY === undefined ? true : invertY); + }; + DynamicTexture.prototype.drawText = function (text, x, y, font, color, clearColor, invertY, update) { + if (update === void 0) { update = true; } + var size = this.getSize(); + if (clearColor) { + this._context.fillStyle = clearColor; + this._context.fillRect(0, 0, size.width, size.height); + } + this._context.font = font; + if (x === null) { + var textSize = this._context.measureText(text); + x = (size.width - textSize.width) / 2; + } + this._context.fillStyle = color; + this._context.fillText(text, x, y); + if (update) { + this.update(invertY); + } + }; + DynamicTexture.prototype.clone = function () { + var textureSize = this.getSize(); + var newTexture = new DynamicTexture(this.name, textureSize, this.getScene(), this._generateMipMaps); + // Base texture + newTexture.hasAlpha = this.hasAlpha; + newTexture.level = this.level; + // Dynamic Texture + newTexture.wrapU = this.wrapU; + newTexture.wrapV = this.wrapV; + return newTexture; + }; + return DynamicTexture; + }(BABYLON.Texture)); + BABYLON.DynamicTexture = DynamicTexture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.dynamicTexture.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var VideoTexture = (function (_super) { + __extends(VideoTexture, _super); + /** + * Creates a video texture. + * Sample : https://doc.babylonjs.com/tutorials/01._Advanced_Texturing + * @param {Array} urlsOrVideo can be used to provide an array of urls or an already setup HTML video element. + * @param {BABYLON.Scene} scene is obviously the current scene. + * @param {boolean} generateMipMaps can be used to turn on mipmaps (Can be expensive for videoTextures because they are often updated). + * @param {boolean} invertY is false by default but can be used to invert video on Y axis + * @param {number} samplingMode controls the sampling method and is set to TRILINEAR_SAMPLINGMODE by default + */ + function VideoTexture(name, urlsOrVideo, scene, generateMipMaps, invertY, samplingMode) { + var _this = this; + if (generateMipMaps === void 0) { generateMipMaps = false; } + if (invertY === void 0) { invertY = false; } + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + _super.call(this, null, scene, !generateMipMaps, invertY); + this._autoLaunch = true; + var urls; + this.name = name; + if (urlsOrVideo instanceof HTMLVideoElement) { + this.video = urlsOrVideo; + } + else { + urls = urlsOrVideo; + this.video = document.createElement("video"); + this.video.autoplay = false; + this.video.loop = true; + } + this._generateMipMaps = generateMipMaps; + this._samplingMode = samplingMode; + if (BABYLON.Tools.IsExponentOfTwo(this.video.videoWidth) && BABYLON.Tools.IsExponentOfTwo(this.video.videoHeight)) { + this.wrapU = BABYLON.Texture.WRAP_ADDRESSMODE; + this.wrapV = BABYLON.Texture.WRAP_ADDRESSMODE; + } + else { + this.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; + this.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; + this._generateMipMaps = false; + } + if (urls) { + this.video.addEventListener("canplaythrough", function () { + _this._createTexture(); + }); + urls.forEach(function (url) { + var source = document.createElement("source"); + source.src = url; + _this.video.appendChild(source); + }); + } + else { + this._createTexture(); + } + this._lastUpdate = BABYLON.Tools.Now; + } + VideoTexture.prototype._createTexture = function () { + this._texture = this.getScene().getEngine().createDynamicTexture(this.video.videoWidth, this.video.videoHeight, this._generateMipMaps, this._samplingMode); + this._texture.isReady = true; + }; + VideoTexture.prototype.update = function () { + if (this._autoLaunch) { + this._autoLaunch = false; + this.video.play(); + } + var now = BABYLON.Tools.Now; + if (now - this._lastUpdate < 15 || this.video.readyState !== this.video.HAVE_ENOUGH_DATA) { + return false; + } + this._lastUpdate = now; + this.getScene().getEngine().updateVideoTexture(this._texture, this.video, this._invertY); + return true; + }; + return VideoTexture; + }(BABYLON.Texture)); + BABYLON.VideoTexture = VideoTexture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.videoTexture.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var CustomProceduralTexture = (function (_super) { + __extends(CustomProceduralTexture, _super); + function CustomProceduralTexture(name, texturePath, size, scene, fallbackTexture, generateMipMaps) { + _super.call(this, name, size, null, scene, fallbackTexture, generateMipMaps); + this._animate = true; + this._time = 0; + this._texturePath = texturePath; + //Try to load json + this.loadJson(texturePath); + this.refreshRate = 1; + } + CustomProceduralTexture.prototype.loadJson = function (jsonUrl) { + var _this = this; + var that = this; + function noConfigFile() { + BABYLON.Tools.Log("No config file found in " + jsonUrl + " trying to use ShadersStore or DOM element"); + try { + that.setFragment(that._texturePath); + } + catch (ex) { + BABYLON.Tools.Error("No json or ShaderStore or DOM element found for CustomProceduralTexture"); + } + } + var configFileUrl = jsonUrl + "/config.json"; + var xhr = new XMLHttpRequest(); + xhr.open("GET", configFileUrl, true); + xhr.addEventListener("load", function () { + if (xhr.status === 200 || BABYLON.Tools.ValidateXHRData(xhr, 1)) { + try { + _this._config = JSON.parse(xhr.response); + _this.updateShaderUniforms(); + _this.updateTextures(); + _this.setFragment(_this._texturePath + "/custom"); + _this._animate = _this._config.animate; + _this.refreshRate = _this._config.refreshrate; + } + catch (ex) { + noConfigFile(); + } + } + else { + noConfigFile(); + } + }, false); + xhr.addEventListener("error", function () { + noConfigFile(); + }, false); + try { + xhr.send(); + } + catch (ex) { + BABYLON.Tools.Error("CustomProceduralTexture: Error on XHR send request."); + } + }; + CustomProceduralTexture.prototype.isReady = function () { + if (!_super.prototype.isReady.call(this)) { + return false; + } + for (var name in this._textures) { + var texture = this._textures[name]; + if (!texture.isReady()) { + return false; + } + } + return true; + }; + CustomProceduralTexture.prototype.render = function (useCameraPostProcess) { + if (this._animate) { + this._time += this.getScene().getAnimationRatio() * 0.03; + this.updateShaderUniforms(); + } + _super.prototype.render.call(this, useCameraPostProcess); + }; + CustomProceduralTexture.prototype.updateTextures = function () { + for (var i = 0; i < this._config.sampler2Ds.length; i++) { + this.setTexture(this._config.sampler2Ds[i].sample2Dname, new BABYLON.Texture(this._texturePath + "/" + this._config.sampler2Ds[i].textureRelativeUrl, this.getScene())); + } + }; + CustomProceduralTexture.prototype.updateShaderUniforms = function () { + if (this._config) { + for (var j = 0; j < this._config.uniforms.length; j++) { + var uniform = this._config.uniforms[j]; + switch (uniform.type) { + case "float": + this.setFloat(uniform.name, uniform.value); + break; + case "color3": + this.setColor3(uniform.name, new BABYLON.Color3(uniform.r, uniform.g, uniform.b)); + break; + case "color4": + this.setColor4(uniform.name, new BABYLON.Color4(uniform.r, uniform.g, uniform.b, uniform.a)); + break; + case "vector2": + this.setVector2(uniform.name, new BABYLON.Vector2(uniform.x, uniform.y)); + break; + case "vector3": + this.setVector3(uniform.name, new BABYLON.Vector3(uniform.x, uniform.y, uniform.z)); + break; + } + } + } + this.setFloat("time", this._time); + }; + Object.defineProperty(CustomProceduralTexture.prototype, "animate", { + get: function () { + return this._animate; + }, + set: function (value) { + this._animate = value; + }, + enumerable: true, + configurable: true + }); + return CustomProceduralTexture; + }(BABYLON.ProceduralTexture)); + BABYLON.CustomProceduralTexture = CustomProceduralTexture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.customProceduralTexture.js.map + +var BABYLON; +(function (BABYLON) { + var EffectFallbacks = (function () { + function EffectFallbacks() { + this._defines = {}; + this._currentRank = 32; + this._maxRank = -1; + } + EffectFallbacks.prototype.addFallback = function (rank, define) { + if (!this._defines[rank]) { + if (rank < this._currentRank) { + this._currentRank = rank; + } + if (rank > this._maxRank) { + this._maxRank = rank; + } + this._defines[rank] = new Array(); + } + this._defines[rank].push(define); + }; + EffectFallbacks.prototype.addCPUSkinningFallback = function (rank, mesh) { + this._meshRank = rank; + this._mesh = mesh; + if (rank > this._maxRank) { + this._maxRank = rank; + } + }; + Object.defineProperty(EffectFallbacks.prototype, "isMoreFallbacks", { + get: function () { + return this._currentRank <= this._maxRank; + }, + enumerable: true, + configurable: true + }); + EffectFallbacks.prototype.reduce = function (currentDefines) { + var currentFallbacks = this._defines[this._currentRank]; + for (var index = 0; index < currentFallbacks.length; index++) { + currentDefines = currentDefines.replace("#define " + currentFallbacks[index], ""); + } + if (this._mesh && this._currentRank === this._meshRank) { + this._mesh.computeBonesUsingShaders = false; + currentDefines = currentDefines.replace("#define NUM_BONE_INFLUENCERS " + this._mesh.numBoneInfluencers, "#define NUM_BONE_INFLUENCERS 0"); + BABYLON.Tools.Log("Falling back to CPU skinning for " + this._mesh.name); + } + this._currentRank++; + return currentDefines; + }; + return EffectFallbacks; + }()); + BABYLON.EffectFallbacks = EffectFallbacks; + var Effect = (function () { + function Effect(baseName, attributesNames, uniformsNames, samplers, engine, defines, fallbacks, onCompiled, onError, indexParameters) { + var _this = this; + this._isReady = false; + this._compilationError = ""; + this._valueCache = {}; + this._engine = engine; + this.name = baseName; + this.defines = defines; + this._uniformsNames = uniformsNames.concat(samplers); + this._samplers = samplers; + this._attributesNames = attributesNames; + this.onError = onError; + this.onCompiled = onCompiled; + this._indexParameters = indexParameters; + var vertexSource; + var fragmentSource; + if (baseName.vertexElement) { + vertexSource = document.getElementById(baseName.vertexElement); + if (!vertexSource) { + vertexSource = baseName.vertexElement; + } + } + else { + vertexSource = baseName.vertex || baseName; + } + if (baseName.fragmentElement) { + fragmentSource = document.getElementById(baseName.fragmentElement); + if (!fragmentSource) { + fragmentSource = baseName.fragmentElement; + } + } + else { + fragmentSource = baseName.fragment || baseName; + } + this._loadVertexShader(vertexSource, function (vertexCode) { + _this._processIncludes(vertexCode, function (vertexCodeWithIncludes) { + _this._loadFragmentShader(fragmentSource, function (fragmentCode) { + _this._processIncludes(fragmentCode, function (fragmentCodeWithIncludes) { + _this._prepareEffect(vertexCodeWithIncludes, fragmentCodeWithIncludes, attributesNames, defines, fallbacks); + }); + }); + }); + }); + } + // Properties + Effect.prototype.isReady = function () { + return this._isReady; + }; + Effect.prototype.getProgram = function () { + return this._program; + }; + Effect.prototype.getAttributesNames = function () { + return this._attributesNames; + }; + Effect.prototype.getAttributeLocation = function (index) { + return this._attributes[index]; + }; + Effect.prototype.getAttributeLocationByName = function (name) { + var index = this._attributesNames.indexOf(name); + return this._attributes[index]; + }; + Effect.prototype.getAttributesCount = function () { + return this._attributes.length; + }; + Effect.prototype.getUniformIndex = function (uniformName) { + return this._uniformsNames.indexOf(uniformName); + }; + Effect.prototype.getUniform = function (uniformName) { + return this._uniforms[this._uniformsNames.indexOf(uniformName)]; + }; + Effect.prototype.getSamplers = function () { + return this._samplers; + }; + Effect.prototype.getCompilationError = function () { + return this._compilationError; + }; + Effect.prototype.getVertexShaderSource = function () { + return this._engine.getVertexShaderSource(this._program); + }; + Effect.prototype.getFragmentShaderSource = function () { + return this._engine.getFragmentShaderSource(this._program); + }; + // Methods + Effect.prototype._loadVertexShader = function (vertex, callback) { + // DOM element ? + if (vertex instanceof HTMLElement) { + var vertexCode = BABYLON.Tools.GetDOMTextContent(vertex); + callback(vertexCode); + return; + } + // Base64 encoded ? + if (vertex.substr(0, 7) === "base64:") { + var vertexBinary = window.atob(vertex.substr(7)); + callback(vertexBinary); + return; + } + // Is in local store ? + if (Effect.ShadersStore[vertex + "VertexShader"]) { + callback(Effect.ShadersStore[vertex + "VertexShader"]); + return; + } + var vertexShaderUrl; + if (vertex[0] === "." || vertex[0] === "/" || vertex.indexOf("http") > -1) { + vertexShaderUrl = vertex; + } + else { + vertexShaderUrl = BABYLON.Engine.ShadersRepository + vertex; + } + // Vertex shader + BABYLON.Tools.LoadFile(vertexShaderUrl + ".vertex.fx", callback); + }; + Effect.prototype._loadFragmentShader = function (fragment, callback) { + // DOM element ? + if (fragment instanceof HTMLElement) { + var fragmentCode = BABYLON.Tools.GetDOMTextContent(fragment); + callback(fragmentCode); + return; + } + // Base64 encoded ? + if (fragment.substr(0, 7) === "base64:") { + var fragmentBinary = window.atob(fragment.substr(7)); + callback(fragmentBinary); + return; + } + // Is in local store ? + if (Effect.ShadersStore[fragment + "PixelShader"]) { + callback(Effect.ShadersStore[fragment + "PixelShader"]); + return; + } + if (Effect.ShadersStore[fragment + "FragmentShader"]) { + callback(Effect.ShadersStore[fragment + "FragmentShader"]); + return; + } + var fragmentShaderUrl; + if (fragment[0] === "." || fragment[0] === "/" || fragment.indexOf("http") > -1) { + fragmentShaderUrl = fragment; + } + else { + fragmentShaderUrl = BABYLON.Engine.ShadersRepository + fragment; + } + // Fragment shader + BABYLON.Tools.LoadFile(fragmentShaderUrl + ".fragment.fx", callback); + }; + Effect.prototype._dumpShadersName = function () { + if (this.name.vertexElement) { + BABYLON.Tools.Error("Vertex shader:" + this.name.vertexElement); + BABYLON.Tools.Error("Fragment shader:" + this.name.fragmentElement); + } + else if (this.name.vertex) { + BABYLON.Tools.Error("Vertex shader:" + this.name.vertex); + BABYLON.Tools.Error("Fragment shader:" + this.name.fragment); + } + else { + BABYLON.Tools.Error("Vertex shader:" + this.name); + BABYLON.Tools.Error("Fragment shader:" + this.name); + } + }; + Effect.prototype._processIncludes = function (sourceCode, callback) { + var _this = this; + var regex = /#include<(.+)>(\((.*)\))*(\[(.*)\])*/g; + var match = regex.exec(sourceCode); + var returnValue = new String(sourceCode); + while (match != null) { + var includeFile = match[1]; + if (Effect.IncludesShadersStore[includeFile]) { + // Substitution + var includeContent = Effect.IncludesShadersStore[includeFile]; + if (match[2]) { + var splits = match[3].split(","); + for (var index = 0; index < splits.length; index += 2) { + var source = new RegExp(splits[index], "g"); + var dest = splits[index + 1]; + includeContent = includeContent.replace(source, dest); + } + } + if (match[4]) { + var indexString = match[5]; + if (indexString.indexOf("..") !== -1) { + var indexSplits = indexString.split(".."); + var minIndex = parseInt(indexSplits[0]); + var maxIndex = parseInt(indexSplits[1]); + var sourceIncludeContent = includeContent.slice(0); + includeContent = ""; + if (isNaN(maxIndex)) { + maxIndex = this._indexParameters[indexSplits[1]]; + } + for (var i = minIndex; i <= maxIndex; i++) { + includeContent += sourceIncludeContent.replace(/\{X\}/g, i) + "\n"; + } + } + else { + includeContent = includeContent.replace(/\{X\}/g, indexString); + } + } + // Replace + returnValue = returnValue.replace(match[0], includeContent); + } + else { + var includeShaderUrl = BABYLON.Engine.ShadersRepository + "ShadersInclude/" + includeFile + ".fx"; + BABYLON.Tools.LoadFile(includeShaderUrl, function (fileContent) { + Effect.IncludesShadersStore[includeFile] = fileContent; + _this._processIncludes(returnValue, callback); + }); + return; + } + match = regex.exec(sourceCode); + } + callback(returnValue); + }; + Effect.prototype._processPrecision = function (source) { + if (source.indexOf("precision highp float") === -1) { + if (!this._engine.getCaps().highPrecisionShaderSupported) { + source = "precision mediump float;\n" + source; + } + else { + source = "precision highp float;\n" + source; + } + } + else { + if (!this._engine.getCaps().highPrecisionShaderSupported) { + source = source.replace("precision highp float", "precision mediump float"); + } + } + return source; + }; + Effect.prototype._prepareEffect = function (vertexSourceCode, fragmentSourceCode, attributesNames, defines, fallbacks) { + try { + var engine = this._engine; + // Precision + vertexSourceCode = this._processPrecision(vertexSourceCode); + fragmentSourceCode = this._processPrecision(fragmentSourceCode); + this._program = engine.createShaderProgram(vertexSourceCode, fragmentSourceCode, defines); + this._uniforms = engine.getUniforms(this._program, this._uniformsNames); + this._attributes = engine.getAttributes(this._program, attributesNames); + var index; + for (index = 0; index < this._samplers.length; index++) { + var sampler = this.getUniform(this._samplers[index]); + if (sampler == null) { + this._samplers.splice(index, 1); + index--; + } + } + engine.bindSamplers(this); + this._compilationError = ""; + this._isReady = true; + if (this.onCompiled) { + this.onCompiled(this); + } + } + catch (e) { + this._compilationError = e.message; + // Let's go through fallbacks then + BABYLON.Tools.Error("Unable to compile effect: "); + BABYLON.Tools.Error("Defines: " + defines); + BABYLON.Tools.Error("Error: " + this._compilationError); + this._dumpShadersName(); + if (fallbacks && fallbacks.isMoreFallbacks) { + BABYLON.Tools.Error("Trying next fallback."); + defines = fallbacks.reduce(defines); + this._prepareEffect(vertexSourceCode, fragmentSourceCode, attributesNames, defines, fallbacks); + } + else { + if (this.onError) { + this.onError(this, this._compilationError); + } + } + } + }; + Object.defineProperty(Effect.prototype, "isSupported", { + get: function () { + return this._compilationError === ""; + }, + enumerable: true, + configurable: true + }); + Effect.prototype._bindTexture = function (channel, texture) { + this._engine._bindTexture(this._samplers.indexOf(channel), texture); + }; + Effect.prototype.setTexture = function (channel, texture) { + this._engine.setTexture(this._samplers.indexOf(channel), this.getUniform(channel), texture); + }; + Effect.prototype.setTextureArray = function (channel, textures) { + if (this._samplers.indexOf(channel + "Ex") === -1) { + var initialPos = this._samplers.indexOf(channel); + for (var index = 1; index < textures.length; index++) { + this._samplers.splice(initialPos + index, 0, channel + "Ex"); + } + } + this._engine.setTextureArray(this._samplers.indexOf(channel), this.getUniform(channel), textures); + }; + Effect.prototype.setTextureFromPostProcess = function (channel, postProcess) { + this._engine.setTextureFromPostProcess(this._samplers.indexOf(channel), postProcess); + }; + Effect.prototype._cacheMatrix = function (uniformName, matrix) { + var changed = false; + var cache = this._valueCache[uniformName]; + if (!cache || !(cache instanceof BABYLON.Matrix)) { + changed = true; + cache = new BABYLON.Matrix(); + } + var tm = cache.m; + var om = matrix.m; + for (var index = 0; index < 16; index++) { + if (tm[index] !== om[index]) { + tm[index] = om[index]; + changed = true; + } + } + this._valueCache[uniformName] = cache; + return changed; + }; + Effect.prototype._cacheFloat2 = function (uniformName, x, y) { + var cache = this._valueCache[uniformName]; + if (!cache) { + cache = [x, y]; + this._valueCache[uniformName] = cache; + return true; + } + var changed = false; + if (cache[0] !== x) { + cache[0] = x; + changed = true; + } + if (cache[1] !== y) { + cache[1] = y; + changed = true; + } + return changed; + }; + Effect.prototype._cacheFloat3 = function (uniformName, x, y, z) { + var cache = this._valueCache[uniformName]; + if (!cache) { + cache = [x, y, z]; + this._valueCache[uniformName] = cache; + return true; + } + var changed = false; + if (cache[0] !== x) { + cache[0] = x; + changed = true; + } + if (cache[1] !== y) { + cache[1] = y; + changed = true; + } + if (cache[2] !== z) { + cache[2] = z; + changed = true; + } + return changed; + }; + Effect.prototype._cacheFloat4 = function (uniformName, x, y, z, w) { + var cache = this._valueCache[uniformName]; + if (!cache) { + cache = [x, y, z, w]; + this._valueCache[uniformName] = cache; + return true; + } + var changed = false; + if (cache[0] !== x) { + cache[0] = x; + changed = true; + } + if (cache[1] !== y) { + cache[1] = y; + changed = true; + } + if (cache[2] !== z) { + cache[2] = z; + changed = true; + } + if (cache[3] !== w) { + cache[3] = w; + changed = true; + } + return changed; + }; + Effect.prototype.setIntArray = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setIntArray(this.getUniform(uniformName), array); + return this; + }; + Effect.prototype.setIntArray2 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setIntArray2(this.getUniform(uniformName), array); + return this; + }; + Effect.prototype.setIntArray3 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setIntArray3(this.getUniform(uniformName), array); + return this; + }; + Effect.prototype.setIntArray4 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setIntArray4(this.getUniform(uniformName), array); + return this; + }; + Effect.prototype.setFloatArray = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setFloatArray(this.getUniform(uniformName), array); + return this; + }; + Effect.prototype.setFloatArray2 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setFloatArray2(this.getUniform(uniformName), array); + return this; + }; + Effect.prototype.setFloatArray3 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setFloatArray3(this.getUniform(uniformName), array); + return this; + }; + Effect.prototype.setFloatArray4 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setFloatArray4(this.getUniform(uniformName), array); + return this; + }; + Effect.prototype.setArray = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setArray(this.getUniform(uniformName), array); + return this; + }; + Effect.prototype.setArray2 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setArray2(this.getUniform(uniformName), array); + return this; + }; + Effect.prototype.setArray3 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setArray3(this.getUniform(uniformName), array); + return this; + }; + Effect.prototype.setArray4 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setArray4(this.getUniform(uniformName), array); + return this; + }; + Effect.prototype.setMatrices = function (uniformName, matrices) { + this._valueCache[uniformName] = null; + this._engine.setMatrices(this.getUniform(uniformName), matrices); + return this; + }; + Effect.prototype.setMatrix = function (uniformName, matrix) { + if (this._cacheMatrix(uniformName, matrix)) { + this._engine.setMatrix(this.getUniform(uniformName), matrix); + } + return this; + }; + Effect.prototype.setMatrix3x3 = function (uniformName, matrix) { + this._valueCache[uniformName] = null; + this._engine.setMatrix3x3(this.getUniform(uniformName), matrix); + return this; + }; + Effect.prototype.setMatrix2x2 = function (uniformName, matrix) { + this._valueCache[uniformName] = null; + this._engine.setMatrix2x2(this.getUniform(uniformName), matrix); + return this; + }; + Effect.prototype.setFloat = function (uniformName, value) { + var cache = this._valueCache[uniformName]; + if (cache !== undefined && cache === value) + return this; + this._valueCache[uniformName] = value; + this._engine.setFloat(this.getUniform(uniformName), value); + return this; + }; + Effect.prototype.setBool = function (uniformName, bool) { + var cache = this._valueCache[uniformName]; + if (cache !== undefined && cache === bool) + return this; + this._valueCache[uniformName] = bool; + this._engine.setBool(this.getUniform(uniformName), bool ? 1 : 0); + return this; + }; + Effect.prototype.setVector2 = function (uniformName, vector2) { + if (this._cacheFloat2(uniformName, vector2.x, vector2.y)) { + this._engine.setFloat2(this.getUniform(uniformName), vector2.x, vector2.y); + } + return this; + }; + Effect.prototype.setFloat2 = function (uniformName, x, y) { + if (this._cacheFloat2(uniformName, x, y)) { + this._engine.setFloat2(this.getUniform(uniformName), x, y); + } + return this; + }; + Effect.prototype.setVector3 = function (uniformName, vector3) { + if (this._cacheFloat3(uniformName, vector3.x, vector3.y, vector3.z)) { + this._engine.setFloat3(this.getUniform(uniformName), vector3.x, vector3.y, vector3.z); + } + return this; + }; + Effect.prototype.setFloat3 = function (uniformName, x, y, z) { + if (this._cacheFloat3(uniformName, x, y, z)) { + this._engine.setFloat3(this.getUniform(uniformName), x, y, z); + } + return this; + }; + Effect.prototype.setVector4 = function (uniformName, vector4) { + if (this._cacheFloat4(uniformName, vector4.x, vector4.y, vector4.z, vector4.w)) { + this._engine.setFloat4(this.getUniform(uniformName), vector4.x, vector4.y, vector4.z, vector4.w); + } + return this; + }; + Effect.prototype.setFloat4 = function (uniformName, x, y, z, w) { + if (this._cacheFloat4(uniformName, x, y, z, w)) { + this._engine.setFloat4(this.getUniform(uniformName), x, y, z, w); + } + return this; + }; + Effect.prototype.setColor3 = function (uniformName, color3) { + if (this._cacheFloat3(uniformName, color3.r, color3.g, color3.b)) { + this._engine.setColor3(this.getUniform(uniformName), color3); + } + return this; + }; + Effect.prototype.setColor4 = function (uniformName, color3, alpha) { + if (this._cacheFloat4(uniformName, color3.r, color3.g, color3.b, alpha)) { + this._engine.setColor4(this.getUniform(uniformName), color3, alpha); + } + return this; + }; + // Statics + Effect.ShadersStore = {}; + Effect.IncludesShadersStore = {}; + return Effect; + }()); + BABYLON.Effect = Effect; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.effect.js.map + +var BABYLON; +(function (BABYLON) { + var MaterialHelper = (function () { + function MaterialHelper() { + } + MaterialHelper.PrepareDefinesForLights = function (scene, mesh, defines, maxSimultaneousLights) { + if (maxSimultaneousLights === void 0) { maxSimultaneousLights = 4; } + var lightIndex = 0; + var needNormals = false; + var needRebuild = false; + var needShadows = false; + var lightmapMode = false; + for (var index = 0; index < scene.lights.length; index++) { + var light = scene.lights[index]; + if (!light.isEnabled()) { + continue; + } + // Excluded check + if (light._excludedMeshesIds.length > 0) { + for (var excludedIndex = 0; excludedIndex < light._excludedMeshesIds.length; excludedIndex++) { + var excludedMesh = scene.getMeshByID(light._excludedMeshesIds[excludedIndex]); + if (excludedMesh) { + light.excludedMeshes.push(excludedMesh); + } + } + light._excludedMeshesIds = []; + } + // Included check + if (light._includedOnlyMeshesIds.length > 0) { + for (var includedOnlyIndex = 0; includedOnlyIndex < light._includedOnlyMeshesIds.length; includedOnlyIndex++) { + var includedOnlyMesh = scene.getMeshByID(light._includedOnlyMeshesIds[includedOnlyIndex]); + if (includedOnlyMesh) { + light.includedOnlyMeshes.push(includedOnlyMesh); + } + } + light._includedOnlyMeshesIds = []; + } + if (!light.canAffectMesh(mesh)) { + continue; + } + needNormals = true; + if (defines["LIGHT" + lightIndex] === undefined) { + needRebuild = true; + } + defines["LIGHT" + lightIndex] = true; + var type; + if (light instanceof BABYLON.SpotLight) { + type = "SPOTLIGHT" + lightIndex; + } + else if (light instanceof BABYLON.HemisphericLight) { + type = "HEMILIGHT" + lightIndex; + } + else if (light instanceof BABYLON.PointLight) { + type = "POINTLIGHT" + lightIndex; + } + else { + type = "DIRLIGHT" + lightIndex; + } + if (defines[type] === undefined) { + needRebuild = true; + } + defines[type] = true; + // Specular + if (!light.specular.equalsFloats(0, 0, 0) && defines["SPECULARTERM"] !== undefined) { + defines["SPECULARTERM"] = true; + } + // Shadows + if (scene.shadowsEnabled) { + var shadowGenerator = light.getShadowGenerator(); + if (mesh && mesh.receiveShadows && shadowGenerator) { + if (defines["SHADOW" + lightIndex] === undefined) { + needRebuild = true; + } + defines["SHADOW" + lightIndex] = true; + defines["SHADOWS"] = true; + if (shadowGenerator.useVarianceShadowMap || shadowGenerator.useBlurVarianceShadowMap) { + if (defines["SHADOWVSM" + lightIndex] === undefined) { + needRebuild = true; + } + defines["SHADOWVSM" + lightIndex] = true; + } + if (shadowGenerator.usePoissonSampling) { + if (defines["SHADOWPCF" + lightIndex] === undefined) { + needRebuild = true; + } + defines["SHADOWPCF" + lightIndex] = true; + } + needShadows = true; + } + } + if (light.lightmapMode != BABYLON.Light.LIGHTMAP_DEFAULT) { + lightmapMode = true; + if (defines["LIGHTMAPEXCLUDED" + lightIndex] === undefined) { + needRebuild = true; + } + if (defines["LIGHTMAPNOSPECULAR" + lightIndex] === undefined) { + needRebuild = true; + } + defines["LIGHTMAPEXCLUDED" + lightIndex] = true; + if (light.lightmapMode == BABYLON.Light.LIGHTMAP_SHADOWSONLY) { + defines["LIGHTMAPNOSPECULAR" + lightIndex] = true; + } + } + lightIndex++; + if (lightIndex === maxSimultaneousLights) + break; + } + var caps = scene.getEngine().getCaps(); + if (needShadows && caps.textureFloat && caps.textureFloatLinearFiltering && caps.textureFloatRender) { + if (defines["SHADOWFULLFLOAT"] === undefined) { + needRebuild = true; + } + defines["SHADOWFULLFLOAT"] = true; + } + if (defines["LIGHTMAPEXCLUDED"] === undefined) { + needRebuild = true; + } + if (lightmapMode) { + defines["LIGHTMAPEXCLUDED"] = true; + } + if (needRebuild) { + defines.rebuild(); + } + return needNormals; + }; + MaterialHelper.PrepareUniformsAndSamplersList = function (uniformsList, samplersList, defines, maxSimultaneousLights) { + if (maxSimultaneousLights === void 0) { maxSimultaneousLights = 4; } + for (var lightIndex = 0; lightIndex < maxSimultaneousLights; lightIndex++) { + if (!defines["LIGHT" + lightIndex]) { + break; + } + uniformsList.push("vLightData" + lightIndex, "vLightDiffuse" + lightIndex, "vLightSpecular" + lightIndex, "vLightDirection" + lightIndex, "vLightGround" + lightIndex, "lightMatrix" + lightIndex, "shadowsInfo" + lightIndex); + samplersList.push("shadowSampler" + lightIndex); + } + }; + MaterialHelper.HandleFallbacksForShadows = function (defines, fallbacks, maxSimultaneousLights) { + if (maxSimultaneousLights === void 0) { maxSimultaneousLights = 4; } + for (var lightIndex = 0; lightIndex < maxSimultaneousLights; lightIndex++) { + if (!defines["LIGHT" + lightIndex]) { + break; + } + if (lightIndex > 0) { + fallbacks.addFallback(lightIndex, "LIGHT" + lightIndex); + } + if (defines["SHADOW" + lightIndex]) { + fallbacks.addFallback(0, "SHADOW" + lightIndex); + } + if (defines["SHADOWPCF" + lightIndex]) { + fallbacks.addFallback(0, "SHADOWPCF" + lightIndex); + } + if (defines["SHADOWVSM" + lightIndex]) { + fallbacks.addFallback(0, "SHADOWVSM" + lightIndex); + } + } + }; + MaterialHelper.PrepareAttributesForBones = function (attribs, mesh, defines, fallbacks) { + if (defines["NUM_BONE_INFLUENCERS"] > 0) { + fallbacks.addCPUSkinningFallback(0, mesh); + attribs.push(BABYLON.VertexBuffer.MatricesIndicesKind); + attribs.push(BABYLON.VertexBuffer.MatricesWeightsKind); + if (defines["NUM_BONE_INFLUENCERS"] > 4) { + attribs.push(BABYLON.VertexBuffer.MatricesIndicesExtraKind); + attribs.push(BABYLON.VertexBuffer.MatricesWeightsExtraKind); + } + } + }; + MaterialHelper.PrepareAttributesForInstances = function (attribs, defines) { + if (defines["INSTANCES"]) { + attribs.push("world0"); + attribs.push("world1"); + attribs.push("world2"); + attribs.push("world3"); + } + }; + // Bindings + MaterialHelper.BindLightShadow = function (light, scene, mesh, lightIndex, effect, depthValuesAlreadySet) { + var shadowGenerator = light.getShadowGenerator(); + if (mesh.receiveShadows && shadowGenerator) { + if (!light.needCube()) { + effect.setMatrix("lightMatrix" + lightIndex, shadowGenerator.getTransformMatrix()); + } + else { + if (!depthValuesAlreadySet) { + depthValuesAlreadySet = true; + effect.setFloat2("depthValues", scene.activeCamera.minZ, scene.activeCamera.maxZ); + } + } + effect.setTexture("shadowSampler" + lightIndex, shadowGenerator.getShadowMapForRendering()); + effect.setFloat3("shadowsInfo" + lightIndex, shadowGenerator.getDarkness(), shadowGenerator.blurScale / shadowGenerator.getShadowMap().getSize().width, shadowGenerator.bias); + } + return depthValuesAlreadySet; + }; + MaterialHelper.BindLightProperties = function (light, effect, lightIndex) { + if (light instanceof BABYLON.PointLight) { + // Point Light + light.transferToEffect(effect, "vLightData" + lightIndex); + } + else if (light instanceof BABYLON.DirectionalLight) { + // Directional Light + light.transferToEffect(effect, "vLightData" + lightIndex); + } + else if (light instanceof BABYLON.SpotLight) { + // Spot Light + light.transferToEffect(effect, "vLightData" + lightIndex, "vLightDirection" + lightIndex); + } + else if (light instanceof BABYLON.HemisphericLight) { + // Hemispheric Light + light.transferToEffect(effect, "vLightData" + lightIndex, "vLightGround" + lightIndex); + } + }; + MaterialHelper.BindLights = function (scene, mesh, effect, defines, maxSimultaneousLights) { + if (maxSimultaneousLights === void 0) { maxSimultaneousLights = 4; } + var lightIndex = 0; + var depthValuesAlreadySet = false; + for (var index = 0; index < scene.lights.length; index++) { + var light = scene.lights[index]; + if (!light.isEnabled()) { + continue; + } + if (!light.canAffectMesh(mesh)) { + continue; + } + MaterialHelper.BindLightProperties(light, effect, lightIndex); + light.diffuse.scaleToRef(light.intensity, BABYLON.Tmp.Color3[0]); + effect.setColor4("vLightDiffuse" + lightIndex, BABYLON.Tmp.Color3[0], light.range); + if (defines["SPECULARTERM"]) { + light.specular.scaleToRef(light.intensity, BABYLON.Tmp.Color3[1]); + effect.setColor3("vLightSpecular" + lightIndex, BABYLON.Tmp.Color3[1]); + } + // Shadows + if (scene.shadowsEnabled) { + depthValuesAlreadySet = this.BindLightShadow(light, scene, mesh, lightIndex, effect, depthValuesAlreadySet); + } + lightIndex++; + if (lightIndex === maxSimultaneousLights) + break; + } + }; + MaterialHelper.BindFogParameters = function (scene, mesh, effect) { + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== BABYLON.Scene.FOGMODE_NONE) { + effect.setFloat4("vFogInfos", scene.fogMode, scene.fogStart, scene.fogEnd, scene.fogDensity); + effect.setColor3("vFogColor", scene.fogColor); + } + }; + MaterialHelper.BindBonesParameters = function (mesh, effect) { + if (mesh && mesh.useBones && mesh.computeBonesUsingShaders) { + var matrices = mesh.skeleton.getTransformMatrices(mesh); + if (matrices) { + effect.setMatrices("mBones", matrices); + } + } + }; + MaterialHelper.BindLogDepth = function (defines, effect, scene) { + if (defines["LOGARITHMICDEPTH"]) { + effect.setFloat("logarithmicDepthConstant", 2.0 / (Math.log(scene.activeCamera.maxZ + 1.0) / Math.LN2)); + } + }; + MaterialHelper.BindClipPlane = function (effect, scene) { + if (scene.clipPlane) { + var clipPlane = scene.clipPlane; + effect.setFloat4("vClipPlane", clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d); + } + }; + return MaterialHelper; + }()); + BABYLON.MaterialHelper = MaterialHelper; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.materialHelper.js.map + +var BABYLON; +(function (BABYLON) { + var FresnelParameters = (function () { + function FresnelParameters() { + this.isEnabled = true; + this.leftColor = BABYLON.Color3.White(); + this.rightColor = BABYLON.Color3.Black(); + this.bias = 0; + this.power = 1; + } + FresnelParameters.prototype.clone = function () { + var newFresnelParameters = new FresnelParameters(); + BABYLON.Tools.DeepCopy(this, newFresnelParameters); + return newFresnelParameters; + }; + FresnelParameters.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.isEnabled = this.isEnabled; + serializationObject.leftColor = this.leftColor; + serializationObject.rightColor = this.rightColor; + serializationObject.bias = this.bias; + serializationObject.power = this.power; + return serializationObject; + }; + FresnelParameters.Parse = function (parsedFresnelParameters) { + var fresnelParameters = new FresnelParameters(); + fresnelParameters.isEnabled = parsedFresnelParameters.isEnabled; + fresnelParameters.leftColor = BABYLON.Color3.FromArray(parsedFresnelParameters.leftColor); + fresnelParameters.rightColor = BABYLON.Color3.FromArray(parsedFresnelParameters.rightColor); + fresnelParameters.bias = parsedFresnelParameters.bias; + fresnelParameters.power = parsedFresnelParameters.power || 1.0; + return fresnelParameters; + }; + return FresnelParameters; + }()); + BABYLON.FresnelParameters = FresnelParameters; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.fresnelParameters.js.map + + +var BABYLON; +(function (BABYLON) { + var MaterialDefines = (function () { + function MaterialDefines() { + } + MaterialDefines.prototype.rebuild = function () { + if (this._keys) { + delete this._keys; + } + this._keys = Object.keys(this); + }; + MaterialDefines.prototype.isEqual = function (other) { + if (this._keys.length !== other._keys.length) { + return false; + } + for (var index = 0; index < this._keys.length; index++) { + var prop = this._keys[index]; + if (this[prop] !== other[prop]) { + return false; + } + } + return true; + }; + MaterialDefines.prototype.cloneTo = function (other) { + if (this._keys.length !== other._keys.length) { + other._keys = this._keys.slice(0); + } + for (var index = 0; index < this._keys.length; index++) { + var prop = this._keys[index]; + other[prop] = this[prop]; + } + }; + MaterialDefines.prototype.reset = function () { + for (var index = 0; index < this._keys.length; index++) { + var prop = this._keys[index]; + if (typeof (this[prop]) === "number") { + this[prop] = 0; + } + else { + this[prop] = false; + } + } + }; + MaterialDefines.prototype.toString = function () { + var result = ""; + for (var index = 0; index < this._keys.length; index++) { + var prop = this._keys[index]; + if (typeof (this[prop]) === "number") { + result += "#define " + prop + " " + this[prop] + "\n"; + } + else if (this[prop]) { + result += "#define " + prop + "\n"; + } + } + return result; + }; + return MaterialDefines; + }()); + BABYLON.MaterialDefines = MaterialDefines; + var Material = (function () { + function Material(name, scene, doNotAdd) { + this.checkReadyOnEveryCall = false; + this.checkReadyOnlyOnce = false; + this.state = ""; + this.alpha = 1.0; + this.backFaceCulling = true; + this.doNotSerialize = false; + /** + * An event triggered when the material is disposed. + * @type {BABYLON.Observable} + */ + this.onDisposeObservable = new BABYLON.Observable(); + /** + * An event triggered when the material is bound. + * @type {BABYLON.Observable} + */ + this.onBindObservable = new BABYLON.Observable(); + /** + * An event triggered when the material is unbound. + * @type {BABYLON.Observable} + */ + this.onUnBindObservable = new BABYLON.Observable(); + this.alphaMode = BABYLON.Engine.ALPHA_COMBINE; + this.disableDepthWrite = false; + this.fogEnabled = true; + this.pointSize = 1.0; + this.zOffset = 0; + this._wasPreviouslyReady = false; + this._fillMode = Material.TriangleFillMode; + this.name = name; + this.id = name; + this._scene = scene; + if (scene.useRightHandedSystem) { + this.sideOrientation = Material.ClockWiseSideOrientation; + } + else { + this.sideOrientation = Material.CounterClockWiseSideOrientation; + } + if (!doNotAdd) { + scene.materials.push(this); + } + } + Object.defineProperty(Material, "TriangleFillMode", { + get: function () { + return Material._TriangleFillMode; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material, "WireFrameFillMode", { + get: function () { + return Material._WireFrameFillMode; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material, "PointFillMode", { + get: function () { + return Material._PointFillMode; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material, "ClockWiseSideOrientation", { + get: function () { + return Material._ClockWiseSideOrientation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material, "CounterClockWiseSideOrientation", { + get: function () { + return Material._CounterClockWiseSideOrientation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "onDispose", { + set: function (callback) { + if (this._onDisposeObserver) { + this.onDisposeObservable.remove(this._onDisposeObserver); + } + this._onDisposeObserver = this.onDisposeObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "onBind", { + set: function (callback) { + if (this._onBindObserver) { + this.onBindObservable.remove(this._onBindObserver); + } + this._onBindObserver = this.onBindObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "wireframe", { + get: function () { + return this._fillMode === Material.WireFrameFillMode; + }, + set: function (value) { + this._fillMode = (value ? Material.WireFrameFillMode : Material.TriangleFillMode); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "pointsCloud", { + get: function () { + return this._fillMode === Material.PointFillMode; + }, + set: function (value) { + this._fillMode = (value ? Material.PointFillMode : Material.TriangleFillMode); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "fillMode", { + get: function () { + return this._fillMode; + }, + set: function (value) { + this._fillMode = value; + }, + enumerable: true, + configurable: true + }); + /** + * @param {boolean} fullDetails - support for multiple levels of logging within scene loading + * subclasses should override adding information pertainent to themselves + */ + Material.prototype.toString = function (fullDetails) { + var ret = "Name: " + this.name; + if (fullDetails) { + } + return ret; + }; + Object.defineProperty(Material.prototype, "isFrozen", { + get: function () { + return this.checkReadyOnlyOnce; + }, + enumerable: true, + configurable: true + }); + Material.prototype.freeze = function () { + this.checkReadyOnlyOnce = true; + }; + Material.prototype.unfreeze = function () { + this.checkReadyOnlyOnce = false; + }; + Material.prototype.isReady = function (mesh, useInstances) { + return true; + }; + Material.prototype.getEffect = function () { + return this._effect; + }; + Material.prototype.getScene = function () { + return this._scene; + }; + Material.prototype.needAlphaBlending = function () { + return (this.alpha < 1.0); + }; + Material.prototype.needAlphaTesting = function () { + return false; + }; + Material.prototype.getAlphaTestTexture = function () { + return null; + }; + Material.prototype.markDirty = function () { + this._wasPreviouslyReady = false; + }; + Material.prototype._preBind = function () { + var engine = this._scene.getEngine(); + var reverse = this.sideOrientation === Material.ClockWiseSideOrientation; + engine.enableEffect(this._effect); + engine.setState(this.backFaceCulling, this.zOffset, false, reverse); + }; + Material.prototype.bind = function (world, mesh) { + this._scene._cachedMaterial = this; + this.onBindObservable.notifyObservers(mesh); + if (this.disableDepthWrite) { + var engine = this._scene.getEngine(); + this._cachedDepthWriteState = engine.getDepthWrite(); + engine.setDepthWrite(false); + } + }; + Material.prototype.bindOnlyWorldMatrix = function (world) { + }; + Material.prototype.unbind = function () { + this.onUnBindObservable.notifyObservers(this); + if (this.disableDepthWrite) { + var engine = this._scene.getEngine(); + engine.setDepthWrite(this._cachedDepthWriteState); + } + }; + Material.prototype.clone = function (name) { + return null; + }; + Material.prototype.getBindedMeshes = function () { + var result = new Array(); + for (var index = 0; index < this._scene.meshes.length; index++) { + var mesh = this._scene.meshes[index]; + if (mesh.material === this) { + result.push(mesh); + } + } + return result; + }; + Material.prototype.dispose = function (forceDisposeEffect, forceDisposeTextures) { + // Animations + this.getScene().stopAnimation(this); + // Remove from scene + var index = this._scene.materials.indexOf(this); + if (index >= 0) { + this._scene.materials.splice(index, 1); + } + // Shader are kept in cache for further use but we can get rid of this by using forceDisposeEffect + if (forceDisposeEffect && this._effect) { + this._scene.getEngine()._releaseEffect(this._effect); + this._effect = null; + } + // Remove from meshes + for (index = 0; index < this._scene.meshes.length; index++) { + var mesh = this._scene.meshes[index]; + if (mesh.material === this) { + mesh.material = null; + } + } + // Callback + this.onDisposeObservable.notifyObservers(this); + this.onDisposeObservable.clear(); + this.onBindObservable.clear(); + this.onUnBindObservable.clear(); + }; + Material.prototype.serialize = function () { + return BABYLON.SerializationHelper.Serialize(this); + }; + Material.ParseMultiMaterial = function (parsedMultiMaterial, scene) { + var multiMaterial = new BABYLON.MultiMaterial(parsedMultiMaterial.name, scene); + multiMaterial.id = parsedMultiMaterial.id; + BABYLON.Tags.AddTagsTo(multiMaterial, parsedMultiMaterial.tags); + for (var matIndex = 0; matIndex < parsedMultiMaterial.materials.length; matIndex++) { + var subMatId = parsedMultiMaterial.materials[matIndex]; + if (subMatId) { + multiMaterial.subMaterials.push(scene.getMaterialByID(subMatId)); + } + else { + multiMaterial.subMaterials.push(null); + } + } + return multiMaterial; + }; + Material.Parse = function (parsedMaterial, scene, rootUrl) { + if (!parsedMaterial.customType) { + return BABYLON.StandardMaterial.Parse(parsedMaterial, scene, rootUrl); + } + var materialType = BABYLON.Tools.Instantiate(parsedMaterial.customType); + return materialType.Parse(parsedMaterial, scene, rootUrl); + ; + }; + Material._TriangleFillMode = 0; + Material._WireFrameFillMode = 1; + Material._PointFillMode = 2; + Material._ClockWiseSideOrientation = 0; + Material._CounterClockWiseSideOrientation = 1; + __decorate([ + BABYLON.serialize() + ], Material.prototype, "id", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "name", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "checkReadyOnEveryCall", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "checkReadyOnlyOnce", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "state", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "alpha", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "backFaceCulling", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "sideOrientation", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "alphaMode", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "disableDepthWrite", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "fogEnabled", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "pointSize", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "zOffset", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "wireframe", null); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "pointsCloud", null); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "fillMode", null); + return Material; + }()); + BABYLON.Material = Material; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.material.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var StandardMaterialDefines = (function (_super) { + __extends(StandardMaterialDefines, _super); + function StandardMaterialDefines() { + _super.call(this); + this.DIFFUSE = false; + this.AMBIENT = false; + this.OPACITY = false; + this.OPACITYRGB = false; + this.REFLECTION = false; + this.EMISSIVE = false; + this.SPECULAR = false; + this.BUMP = false; + this.PARALLAX = false; + this.PARALLAXOCCLUSION = false; + this.SPECULAROVERALPHA = false; + this.CLIPPLANE = false; + this.ALPHATEST = false; + this.ALPHAFROMDIFFUSE = false; + this.POINTSIZE = false; + this.FOG = false; + this.SPECULARTERM = false; + this.DIFFUSEFRESNEL = false; + this.OPACITYFRESNEL = false; + this.REFLECTIONFRESNEL = false; + this.REFRACTIONFRESNEL = false; + this.EMISSIVEFRESNEL = false; + this.FRESNEL = false; + this.NORMAL = false; + this.UV1 = false; + this.UV2 = false; + this.VERTEXCOLOR = false; + this.VERTEXALPHA = false; + this.NUM_BONE_INFLUENCERS = 0; + this.BonesPerMesh = 0; + this.INSTANCES = false; + this.GLOSSINESS = false; + this.ROUGHNESS = false; + this.EMISSIVEASILLUMINATION = false; + this.LINKEMISSIVEWITHDIFFUSE = false; + this.REFLECTIONFRESNELFROMSPECULAR = false; + this.LIGHTMAP = false; + this.USELIGHTMAPASSHADOWMAP = false; + this.REFLECTIONMAP_3D = false; + this.REFLECTIONMAP_SPHERICAL = false; + this.REFLECTIONMAP_PLANAR = false; + this.REFLECTIONMAP_CUBIC = false; + this.REFLECTIONMAP_PROJECTION = false; + this.REFLECTIONMAP_SKYBOX = false; + this.REFLECTIONMAP_EXPLICIT = false; + this.REFLECTIONMAP_EQUIRECTANGULAR = false; + this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = false; + this.INVERTCUBICMAP = false; + this.LOGARITHMICDEPTH = false; + this.REFRACTION = false; + this.REFRACTIONMAP_3D = false; + this.REFLECTIONOVERALPHA = false; + this.INVERTNORMALMAPX = false; + this.INVERTNORMALMAPY = false; + this.SHADOWFULLFLOAT = false; + this.CAMERACOLORGRADING = false; + this.CAMERACOLORCURVES = false; + this.rebuild(); + } + return StandardMaterialDefines; + }(BABYLON.MaterialDefines)); + var StandardMaterial = (function (_super) { + __extends(StandardMaterial, _super); + function StandardMaterial(name, scene) { + var _this = this; + _super.call(this, name, scene); + this.ambientColor = new BABYLON.Color3(0, 0, 0); + this.diffuseColor = new BABYLON.Color3(1, 1, 1); + this.specularColor = new BABYLON.Color3(1, 1, 1); + this.emissiveColor = new BABYLON.Color3(0, 0, 0); + this.specularPower = 64; + this.useAlphaFromDiffuseTexture = false; + this.useEmissiveAsIllumination = false; + this.linkEmissiveWithDiffuse = false; + this.useReflectionFresnelFromSpecular = false; + this.useSpecularOverAlpha = false; + this.useReflectionOverAlpha = false; + this.disableLighting = false; + this.useParallax = false; + this.useParallaxOcclusion = false; + this.parallaxScaleBias = 0.05; + this.roughness = 0; + this.indexOfRefraction = 0.98; + this.invertRefractionY = true; + this.useLightmapAsShadowmap = false; + this.useGlossinessFromSpecularMapAlpha = false; + this.maxSimultaneousLights = 4; + /** + * If sets to true, x component of normal map value will invert (x = 1.0 - x). + */ + this.invertNormalMapX = false; + /** + * If sets to true, y component of normal map value will invert (y = 1.0 - y). + */ + this.invertNormalMapY = false; + /** + * Color Grading 2D Lookup Texture. + * This allows special effects like sepia, black and white to sixties rendering style. + */ + this.cameraColorGradingTexture = null; + /** + * The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT). + * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects. + * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image; + * corresponding to low luminance, medium luminance, and high luminance areas respectively. + */ + this.cameraColorCurves = null; + this._renderTargets = new BABYLON.SmartArray(16); + this._worldViewProjectionMatrix = BABYLON.Matrix.Zero(); + this._globalAmbientColor = new BABYLON.Color3(0, 0, 0); + this._defines = new StandardMaterialDefines(); + this._cachedDefines = new StandardMaterialDefines(); + this._cachedDefines.BonesPerMesh = -1; + this.getRenderTargetTextures = function () { + _this._renderTargets.reset(); + if (_this.reflectionTexture && _this.reflectionTexture.isRenderTarget) { + _this._renderTargets.push(_this.reflectionTexture); + } + if (_this.refractionTexture && _this.refractionTexture.isRenderTarget) { + _this._renderTargets.push(_this.refractionTexture); + } + return _this._renderTargets; + }; + } + Object.defineProperty(StandardMaterial.prototype, "useLogarithmicDepth", { + get: function () { + return this._useLogarithmicDepth; + }, + set: function (value) { + this._useLogarithmicDepth = value && this.getScene().getEngine().getCaps().fragmentDepthSupported; + }, + enumerable: true, + configurable: true + }); + StandardMaterial.prototype.needAlphaBlending = function () { + return (this.alpha < 1.0) || (this.opacityTexture != null) || this._shouldUseAlphaFromDiffuseTexture() || this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled; + }; + StandardMaterial.prototype.needAlphaTesting = function () { + return this.diffuseTexture != null && this.diffuseTexture.hasAlpha; + }; + StandardMaterial.prototype._shouldUseAlphaFromDiffuseTexture = function () { + return this.diffuseTexture != null && this.diffuseTexture.hasAlpha && this.useAlphaFromDiffuseTexture; + }; + StandardMaterial.prototype.getAlphaTestTexture = function () { + return this.diffuseTexture; + }; + // Methods + StandardMaterial.prototype._checkCache = function (scene, mesh, useInstances) { + if (!mesh) { + return true; + } + if (this._defines.INSTANCES !== useInstances) { + return false; + } + if (mesh._materialDefines && mesh._materialDefines.isEqual(this._defines)) { + return true; + } + return false; + }; + StandardMaterial.prototype.isReady = function (mesh, useInstances) { + if (this.isFrozen) { + if (this._wasPreviouslyReady) { + return true; + } + } + var scene = this.getScene(); + var engine = scene.getEngine(); + var needUVs = false; + var needNormals = false; + this._defines.reset(); + // Lights + if (scene.lightsEnabled && !this.disableLighting) { + needNormals = BABYLON.MaterialHelper.PrepareDefinesForLights(scene, mesh, this._defines, this.maxSimultaneousLights); + } + if (!this.checkReadyOnEveryCall) { + if (this._renderId === scene.getRenderId()) { + if (this._checkCache(scene, mesh, useInstances)) { + return true; + } + } + } + // Textures + if (scene.texturesEnabled) { + if (this.diffuseTexture && StandardMaterial.DiffuseTextureEnabled) { + if (!this.diffuseTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.DIFFUSE = true; + } + } + if (this.ambientTexture && StandardMaterial.AmbientTextureEnabled) { + if (!this.ambientTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.AMBIENT = true; + } + } + if (this.opacityTexture && StandardMaterial.OpacityTextureEnabled) { + if (!this.opacityTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.OPACITY = true; + if (this.opacityTexture.getAlphaFromRGB) { + this._defines.OPACITYRGB = true; + } + } + } + if (this.reflectionTexture && StandardMaterial.ReflectionTextureEnabled) { + if (!this.reflectionTexture.isReady()) { + return false; + } + else { + needNormals = true; + this._defines.REFLECTION = true; + if (this.roughness > 0) { + this._defines.ROUGHNESS = true; + } + if (this.useReflectionOverAlpha) { + this._defines.REFLECTIONOVERALPHA = true; + } + if (this.reflectionTexture.coordinatesMode === BABYLON.Texture.INVCUBIC_MODE) { + this._defines.INVERTCUBICMAP = true; + } + this._defines.REFLECTIONMAP_3D = this.reflectionTexture.isCube; + switch (this.reflectionTexture.coordinatesMode) { + case BABYLON.Texture.CUBIC_MODE: + case BABYLON.Texture.INVCUBIC_MODE: + this._defines.REFLECTIONMAP_CUBIC = true; + break; + case BABYLON.Texture.EXPLICIT_MODE: + this._defines.REFLECTIONMAP_EXPLICIT = true; + break; + case BABYLON.Texture.PLANAR_MODE: + this._defines.REFLECTIONMAP_PLANAR = true; + break; + case BABYLON.Texture.PROJECTION_MODE: + this._defines.REFLECTIONMAP_PROJECTION = true; + break; + case BABYLON.Texture.SKYBOX_MODE: + this._defines.REFLECTIONMAP_SKYBOX = true; + break; + case BABYLON.Texture.SPHERICAL_MODE: + this._defines.REFLECTIONMAP_SPHERICAL = true; + break; + case BABYLON.Texture.EQUIRECTANGULAR_MODE: + this._defines.REFLECTIONMAP_EQUIRECTANGULAR = true; + break; + case BABYLON.Texture.FIXED_EQUIRECTANGULAR_MODE: + this._defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = true; + break; + } + } + } + if (this.emissiveTexture && StandardMaterial.EmissiveTextureEnabled) { + if (!this.emissiveTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.EMISSIVE = true; + } + } + if (this.lightmapTexture && StandardMaterial.LightmapTextureEnabled) { + if (!this.lightmapTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.LIGHTMAP = true; + this._defines.USELIGHTMAPASSHADOWMAP = this.useLightmapAsShadowmap; + } + } + if (this.specularTexture && StandardMaterial.SpecularTextureEnabled) { + if (!this.specularTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.SPECULAR = true; + this._defines.GLOSSINESS = this.useGlossinessFromSpecularMapAlpha; + } + } + if (scene.getEngine().getCaps().standardDerivatives && this.bumpTexture && StandardMaterial.BumpTextureEnabled) { + if (!this.bumpTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.BUMP = true; + if (this.useParallax) { + this._defines.PARALLAX = true; + if (this.useParallaxOcclusion) { + this._defines.PARALLAXOCCLUSION = true; + } + } + if (this.invertNormalMapX) { + this._defines.INVERTNORMALMAPX = true; + } + if (this.invertNormalMapY) { + this._defines.INVERTNORMALMAPY = true; + } + } + } + if (this.refractionTexture && StandardMaterial.RefractionTextureEnabled) { + if (!this.refractionTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.REFRACTION = true; + this._defines.REFRACTIONMAP_3D = this.refractionTexture.isCube; + } + } + if (this.cameraColorGradingTexture && StandardMaterial.ColorGradingTextureEnabled) { + if (!this.cameraColorGradingTexture.isReady()) { + return false; + } + else { + this._defines.CAMERACOLORGRADING = true; + } + } + } + // Effect + if (scene.clipPlane) { + this._defines.CLIPPLANE = true; + } + if (engine.getAlphaTesting()) { + this._defines.ALPHATEST = true; + } + if (this._shouldUseAlphaFromDiffuseTexture()) { + this._defines.ALPHAFROMDIFFUSE = true; + } + if (this.useEmissiveAsIllumination) { + this._defines.EMISSIVEASILLUMINATION = true; + } + if (this.linkEmissiveWithDiffuse) { + this._defines.LINKEMISSIVEWITHDIFFUSE = true; + } + if (this.useLogarithmicDepth) { + this._defines.LOGARITHMICDEPTH = true; + } + if (this.cameraColorCurves) { + this._defines.CAMERACOLORCURVES = true; + } + // Point size + if (this.pointsCloud || scene.forcePointsCloud) { + this._defines.POINTSIZE = true; + } + // Fog + if (scene.fogEnabled && mesh && mesh.applyFog && scene.fogMode !== BABYLON.Scene.FOGMODE_NONE && this.fogEnabled) { + this._defines.FOG = true; + } + if (StandardMaterial.FresnelEnabled) { + // Fresnel + if (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled || + this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled || + this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled || + this.refractionFresnelParameters && this.refractionFresnelParameters.isEnabled || + this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled) { + if (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled) { + this._defines.DIFFUSEFRESNEL = true; + } + if (this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled) { + this._defines.OPACITYFRESNEL = true; + } + if (this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled) { + this._defines.REFLECTIONFRESNEL = true; + if (this.useReflectionFresnelFromSpecular) { + this._defines.REFLECTIONFRESNELFROMSPECULAR = true; + } + } + if (this.refractionFresnelParameters && this.refractionFresnelParameters.isEnabled) { + this._defines.REFRACTIONFRESNEL = true; + } + if (this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled) { + this._defines.EMISSIVEFRESNEL = true; + } + needNormals = true; + this._defines.FRESNEL = true; + } + } + if (this._defines.SPECULARTERM && this.useSpecularOverAlpha) { + this._defines.SPECULAROVERALPHA = true; + } + // Attribs + if (mesh) { + if (needNormals && mesh.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) { + this._defines.NORMAL = true; + } + if (needUVs) { + if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) { + this._defines.UV1 = true; + } + if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) { + this._defines.UV2 = true; + } + } + if (mesh.useVertexColors && mesh.isVerticesDataPresent(BABYLON.VertexBuffer.ColorKind)) { + this._defines.VERTEXCOLOR = true; + if (mesh.hasVertexAlpha) { + this._defines.VERTEXALPHA = true; + } + } + if (mesh.useBones && mesh.computeBonesUsingShaders) { + this._defines.NUM_BONE_INFLUENCERS = mesh.numBoneInfluencers; + this._defines.BonesPerMesh = (mesh.skeleton.bones.length + 1); + } + // Instances + if (useInstances) { + this._defines.INSTANCES = true; + } + } + // Get correct effect + if (!this._defines.isEqual(this._cachedDefines)) { + this._defines.cloneTo(this._cachedDefines); + scene.resetCachedMaterial(); + // Fallbacks + var fallbacks = new BABYLON.EffectFallbacks(); + if (this._defines.REFLECTION) { + fallbacks.addFallback(0, "REFLECTION"); + } + if (this._defines.SPECULAR) { + fallbacks.addFallback(0, "SPECULAR"); + } + if (this._defines.BUMP) { + fallbacks.addFallback(0, "BUMP"); + } + if (this._defines.PARALLAX) { + fallbacks.addFallback(1, "PARALLAX"); + } + if (this._defines.PARALLAXOCCLUSION) { + fallbacks.addFallback(0, "PARALLAXOCCLUSION"); + } + if (this._defines.SPECULAROVERALPHA) { + fallbacks.addFallback(0, "SPECULAROVERALPHA"); + } + if (this._defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + if (this._defines.POINTSIZE) { + fallbacks.addFallback(0, "POINTSIZE"); + } + if (this._defines.LOGARITHMICDEPTH) { + fallbacks.addFallback(0, "LOGARITHMICDEPTH"); + } + BABYLON.MaterialHelper.HandleFallbacksForShadows(this._defines, fallbacks, this.maxSimultaneousLights); + if (this._defines.SPECULARTERM) { + fallbacks.addFallback(0, "SPECULARTERM"); + } + if (this._defines.DIFFUSEFRESNEL) { + fallbacks.addFallback(1, "DIFFUSEFRESNEL"); + } + if (this._defines.OPACITYFRESNEL) { + fallbacks.addFallback(2, "OPACITYFRESNEL"); + } + if (this._defines.REFLECTIONFRESNEL) { + fallbacks.addFallback(3, "REFLECTIONFRESNEL"); + } + if (this._defines.EMISSIVEFRESNEL) { + fallbacks.addFallback(4, "EMISSIVEFRESNEL"); + } + if (this._defines.FRESNEL) { + fallbacks.addFallback(4, "FRESNEL"); + } + //Attributes + var attribs = [BABYLON.VertexBuffer.PositionKind]; + if (this._defines.NORMAL) { + attribs.push(BABYLON.VertexBuffer.NormalKind); + } + if (this._defines.UV1) { + attribs.push(BABYLON.VertexBuffer.UVKind); + } + if (this._defines.UV2) { + attribs.push(BABYLON.VertexBuffer.UV2Kind); + } + if (this._defines.VERTEXCOLOR) { + attribs.push(BABYLON.VertexBuffer.ColorKind); + } + BABYLON.MaterialHelper.PrepareAttributesForBones(attribs, mesh, this._defines, fallbacks); + BABYLON.MaterialHelper.PrepareAttributesForInstances(attribs, this._defines); + var shaderName = "default"; + var join = this._defines.toString(); + var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vAmbientColor", "vDiffuseColor", "vSpecularColor", "vEmissiveColor", + "vFogInfos", "vFogColor", "pointSize", + "vDiffuseInfos", "vAmbientInfos", "vOpacityInfos", "vReflectionInfos", "vEmissiveInfos", "vSpecularInfos", "vBumpInfos", "vLightmapInfos", "vRefractionInfos", + "mBones", + "vClipPlane", "diffuseMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "specularMatrix", "bumpMatrix", "lightmapMatrix", "refractionMatrix", + "depthValues", + "diffuseLeftColor", "diffuseRightColor", "opacityParts", "reflectionLeftColor", "reflectionRightColor", "emissiveLeftColor", "emissiveRightColor", "refractionLeftColor", "refractionRightColor", + "logarithmicDepthConstant" + ]; + var samplers = ["diffuseSampler", "ambientSampler", "opacitySampler", "reflectionCubeSampler", "reflection2DSampler", "emissiveSampler", "specularSampler", "bumpSampler", "lightmapSampler", "refractionCubeSampler", "refraction2DSampler"]; + if (this._defines.CAMERACOLORCURVES) { + BABYLON.ColorCurves.PrepareUniforms(uniforms); + } + if (this._defines.CAMERACOLORGRADING) { + BABYLON.ColorGradingTexture.PrepareUniformsAndSamplers(uniforms, samplers); + } + BABYLON.MaterialHelper.PrepareUniformsAndSamplersList(uniforms, samplers, this._defines, this.maxSimultaneousLights); + this._effect = scene.getEngine().createEffect(shaderName, attribs, uniforms, samplers, join, fallbacks, this.onCompiled, this.onError, { maxSimultaneousLights: this.maxSimultaneousLights - 1 }); + } + if (!this._effect.isReady()) { + return false; + } + this._renderId = scene.getRenderId(); + this._wasPreviouslyReady = true; + if (mesh) { + if (!mesh._materialDefines) { + mesh._materialDefines = new StandardMaterialDefines(); + } + this._defines.cloneTo(mesh._materialDefines); + } + return true; + }; + StandardMaterial.prototype.unbind = function () { + if (this.reflectionTexture && this.reflectionTexture.isRenderTarget) { + this._effect.setTexture("reflection2DSampler", null); + } + if (this.refractionTexture && this.refractionTexture.isRenderTarget) { + this._effect.setTexture("refraction2DSampler", null); + } + _super.prototype.unbind.call(this); + }; + StandardMaterial.prototype.bindOnlyWorldMatrix = function (world) { + this._effect.setMatrix("world", world); + }; + StandardMaterial.prototype.bind = function (world, mesh) { + var scene = this.getScene(); + // Matrices + this.bindOnlyWorldMatrix(world); + // Bones + BABYLON.MaterialHelper.BindBonesParameters(mesh, this._effect); + if (scene.getCachedMaterial() !== this) { + this._effect.setMatrix("viewProjection", scene.getTransformMatrix()); + if (StandardMaterial.FresnelEnabled) { + // Fresnel + if (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled) { + this._effect.setColor4("diffuseLeftColor", this.diffuseFresnelParameters.leftColor, this.diffuseFresnelParameters.power); + this._effect.setColor4("diffuseRightColor", this.diffuseFresnelParameters.rightColor, this.diffuseFresnelParameters.bias); + } + if (this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled) { + this._effect.setColor4("opacityParts", new BABYLON.Color3(this.opacityFresnelParameters.leftColor.toLuminance(), this.opacityFresnelParameters.rightColor.toLuminance(), this.opacityFresnelParameters.bias), this.opacityFresnelParameters.power); + } + if (this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled) { + this._effect.setColor4("reflectionLeftColor", this.reflectionFresnelParameters.leftColor, this.reflectionFresnelParameters.power); + this._effect.setColor4("reflectionRightColor", this.reflectionFresnelParameters.rightColor, this.reflectionFresnelParameters.bias); + } + if (this.refractionFresnelParameters && this.refractionFresnelParameters.isEnabled) { + this._effect.setColor4("refractionLeftColor", this.refractionFresnelParameters.leftColor, this.refractionFresnelParameters.power); + this._effect.setColor4("refractionRightColor", this.refractionFresnelParameters.rightColor, this.refractionFresnelParameters.bias); + } + if (this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled) { + this._effect.setColor4("emissiveLeftColor", this.emissiveFresnelParameters.leftColor, this.emissiveFresnelParameters.power); + this._effect.setColor4("emissiveRightColor", this.emissiveFresnelParameters.rightColor, this.emissiveFresnelParameters.bias); + } + } + // Textures + if (scene.texturesEnabled) { + if (this.diffuseTexture && StandardMaterial.DiffuseTextureEnabled) { + this._effect.setTexture("diffuseSampler", this.diffuseTexture); + this._effect.setFloat2("vDiffuseInfos", this.diffuseTexture.coordinatesIndex, this.diffuseTexture.level); + this._effect.setMatrix("diffuseMatrix", this.diffuseTexture.getTextureMatrix()); + } + if (this.ambientTexture && StandardMaterial.AmbientTextureEnabled) { + this._effect.setTexture("ambientSampler", this.ambientTexture); + this._effect.setFloat2("vAmbientInfos", this.ambientTexture.coordinatesIndex, this.ambientTexture.level); + this._effect.setMatrix("ambientMatrix", this.ambientTexture.getTextureMatrix()); + } + if (this.opacityTexture && StandardMaterial.OpacityTextureEnabled) { + this._effect.setTexture("opacitySampler", this.opacityTexture); + this._effect.setFloat2("vOpacityInfos", this.opacityTexture.coordinatesIndex, this.opacityTexture.level); + this._effect.setMatrix("opacityMatrix", this.opacityTexture.getTextureMatrix()); + } + if (this.reflectionTexture && StandardMaterial.ReflectionTextureEnabled) { + if (this.reflectionTexture.isCube) { + this._effect.setTexture("reflectionCubeSampler", this.reflectionTexture); + } + else { + this._effect.setTexture("reflection2DSampler", this.reflectionTexture); + } + this._effect.setMatrix("reflectionMatrix", this.reflectionTexture.getReflectionTextureMatrix()); + this._effect.setFloat2("vReflectionInfos", this.reflectionTexture.level, this.roughness); + } + if (this.emissiveTexture && StandardMaterial.EmissiveTextureEnabled) { + this._effect.setTexture("emissiveSampler", this.emissiveTexture); + this._effect.setFloat2("vEmissiveInfos", this.emissiveTexture.coordinatesIndex, this.emissiveTexture.level); + this._effect.setMatrix("emissiveMatrix", this.emissiveTexture.getTextureMatrix()); + } + if (this.lightmapTexture && StandardMaterial.LightmapTextureEnabled) { + this._effect.setTexture("lightmapSampler", this.lightmapTexture); + this._effect.setFloat2("vLightmapInfos", this.lightmapTexture.coordinatesIndex, this.lightmapTexture.level); + this._effect.setMatrix("lightmapMatrix", this.lightmapTexture.getTextureMatrix()); + } + if (this.specularTexture && StandardMaterial.SpecularTextureEnabled) { + this._effect.setTexture("specularSampler", this.specularTexture); + this._effect.setFloat2("vSpecularInfos", this.specularTexture.coordinatesIndex, this.specularTexture.level); + this._effect.setMatrix("specularMatrix", this.specularTexture.getTextureMatrix()); + } + if (this.bumpTexture && scene.getEngine().getCaps().standardDerivatives && StandardMaterial.BumpTextureEnabled) { + this._effect.setTexture("bumpSampler", this.bumpTexture); + this._effect.setFloat3("vBumpInfos", this.bumpTexture.coordinatesIndex, 1.0 / this.bumpTexture.level, this.parallaxScaleBias); + this._effect.setMatrix("bumpMatrix", this.bumpTexture.getTextureMatrix()); + } + if (this.refractionTexture && StandardMaterial.RefractionTextureEnabled) { + var depth = 1.0; + if (this.refractionTexture.isCube) { + this._effect.setTexture("refractionCubeSampler", this.refractionTexture); + } + else { + this._effect.setTexture("refraction2DSampler", this.refractionTexture); + this._effect.setMatrix("refractionMatrix", this.refractionTexture.getReflectionTextureMatrix()); + if (this.refractionTexture.depth) { + depth = this.refractionTexture.depth; + } + } + this._effect.setFloat4("vRefractionInfos", this.refractionTexture.level, this.indexOfRefraction, depth, this.invertRefractionY ? -1 : 1); + } + if (this.cameraColorGradingTexture && StandardMaterial.ColorGradingTextureEnabled) { + BABYLON.ColorGradingTexture.Bind(this.cameraColorGradingTexture, this._effect); + } + } + // Clip plane + BABYLON.MaterialHelper.BindClipPlane(this._effect, scene); + // Point size + if (this.pointsCloud) { + this._effect.setFloat("pointSize", this.pointSize); + } + // Colors + scene.ambientColor.multiplyToRef(this.ambientColor, this._globalAmbientColor); + this._effect.setVector3("vEyePosition", scene._mirroredCameraPosition ? scene._mirroredCameraPosition : scene.activeCamera.position); + this._effect.setColor3("vAmbientColor", this._globalAmbientColor); + if (this._defines.SPECULARTERM) { + this._effect.setColor4("vSpecularColor", this.specularColor, this.specularPower); + } + this._effect.setColor3("vEmissiveColor", this.emissiveColor); + } + if (scene.getCachedMaterial() !== this || !this.isFrozen) { + // Diffuse + this._effect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility); + // Lights + if (scene.lightsEnabled && !this.disableLighting) { + BABYLON.MaterialHelper.BindLights(scene, mesh, this._effect, this._defines, this.maxSimultaneousLights); + } + // View + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== BABYLON.Scene.FOGMODE_NONE || this.reflectionTexture || this.refractionTexture) { + this._effect.setMatrix("view", scene.getViewMatrix()); + } + // Fog + BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._effect); + // Log. depth + BABYLON.MaterialHelper.BindLogDepth(this._defines, this._effect, scene); + // Color Curves + if (this.cameraColorCurves) { + BABYLON.ColorCurves.Bind(this.cameraColorCurves, this._effect); + } + } + _super.prototype.bind.call(this, world, mesh); + }; + StandardMaterial.prototype.getAnimatables = function () { + var results = []; + if (this.diffuseTexture && this.diffuseTexture.animations && this.diffuseTexture.animations.length > 0) { + results.push(this.diffuseTexture); + } + if (this.ambientTexture && this.ambientTexture.animations && this.ambientTexture.animations.length > 0) { + results.push(this.ambientTexture); + } + if (this.opacityTexture && this.opacityTexture.animations && this.opacityTexture.animations.length > 0) { + results.push(this.opacityTexture); + } + if (this.reflectionTexture && this.reflectionTexture.animations && this.reflectionTexture.animations.length > 0) { + results.push(this.reflectionTexture); + } + if (this.emissiveTexture && this.emissiveTexture.animations && this.emissiveTexture.animations.length > 0) { + results.push(this.emissiveTexture); + } + if (this.specularTexture && this.specularTexture.animations && this.specularTexture.animations.length > 0) { + results.push(this.specularTexture); + } + if (this.bumpTexture && this.bumpTexture.animations && this.bumpTexture.animations.length > 0) { + results.push(this.bumpTexture); + } + if (this.lightmapTexture && this.lightmapTexture.animations && this.lightmapTexture.animations.length > 0) { + results.push(this.lightmapTexture); + } + if (this.refractionTexture && this.refractionTexture.animations && this.refractionTexture.animations.length > 0) { + results.push(this.refractionTexture); + } + if (this.cameraColorGradingTexture && this.cameraColorGradingTexture.animations && this.cameraColorGradingTexture.animations.length > 0) { + results.push(this.cameraColorGradingTexture); + } + return results; + }; + StandardMaterial.prototype.dispose = function (forceDisposeEffect, forceDisposeTextures) { + if (forceDisposeTextures) { + if (this.diffuseTexture) { + this.diffuseTexture.dispose(); + } + if (this.ambientTexture) { + this.ambientTexture.dispose(); + } + if (this.opacityTexture) { + this.opacityTexture.dispose(); + } + if (this.reflectionTexture) { + this.reflectionTexture.dispose(); + } + if (this.emissiveTexture) { + this.emissiveTexture.dispose(); + } + if (this.specularTexture) { + this.specularTexture.dispose(); + } + if (this.bumpTexture) { + this.bumpTexture.dispose(); + } + if (this.lightmapTexture) { + this.lightmapTexture.dispose(); + } + if (this.refractionTexture) { + this.refractionTexture.dispose(); + } + if (this.cameraColorGradingTexture) { + this.cameraColorGradingTexture.dispose(); + } + } + _super.prototype.dispose.call(this, forceDisposeEffect, forceDisposeTextures); + }; + StandardMaterial.prototype.clone = function (name) { + var _this = this; + return BABYLON.SerializationHelper.Clone(function () { return new StandardMaterial(name, _this.getScene()); }, this); + }; + StandardMaterial.prototype.serialize = function () { + return BABYLON.SerializationHelper.Serialize(this); + }; + // Statics + StandardMaterial.Parse = function (source, scene, rootUrl) { + return BABYLON.SerializationHelper.Parse(function () { return new StandardMaterial(source.name, scene); }, source, scene, rootUrl); + }; + // Flags used to enable or disable a type of texture for all Standard Materials + StandardMaterial.DiffuseTextureEnabled = true; + StandardMaterial.AmbientTextureEnabled = true; + StandardMaterial.OpacityTextureEnabled = true; + StandardMaterial.ReflectionTextureEnabled = true; + StandardMaterial.EmissiveTextureEnabled = true; + StandardMaterial.SpecularTextureEnabled = true; + StandardMaterial.BumpTextureEnabled = true; + StandardMaterial.FresnelEnabled = true; + StandardMaterial.LightmapTextureEnabled = true; + StandardMaterial.RefractionTextureEnabled = true; + StandardMaterial.ColorGradingTextureEnabled = true; + __decorate([ + BABYLON.serializeAsTexture() + ], StandardMaterial.prototype, "diffuseTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], StandardMaterial.prototype, "ambientTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], StandardMaterial.prototype, "opacityTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], StandardMaterial.prototype, "reflectionTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], StandardMaterial.prototype, "emissiveTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], StandardMaterial.prototype, "specularTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], StandardMaterial.prototype, "bumpTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], StandardMaterial.prototype, "lightmapTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], StandardMaterial.prototype, "refractionTexture", void 0); + __decorate([ + BABYLON.serializeAsColor3("ambient") + ], StandardMaterial.prototype, "ambientColor", void 0); + __decorate([ + BABYLON.serializeAsColor3("diffuse") + ], StandardMaterial.prototype, "diffuseColor", void 0); + __decorate([ + BABYLON.serializeAsColor3("specular") + ], StandardMaterial.prototype, "specularColor", void 0); + __decorate([ + BABYLON.serializeAsColor3("emissive") + ], StandardMaterial.prototype, "emissiveColor", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "specularPower", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "useAlphaFromDiffuseTexture", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "useEmissiveAsIllumination", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "linkEmissiveWithDiffuse", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "useReflectionFresnelFromSpecular", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "useSpecularOverAlpha", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "useReflectionOverAlpha", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "disableLighting", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "useParallax", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "useParallaxOcclusion", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "parallaxScaleBias", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "roughness", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "indexOfRefraction", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "invertRefractionY", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "useLightmapAsShadowmap", void 0); + __decorate([ + BABYLON.serializeAsFresnelParameters() + ], StandardMaterial.prototype, "diffuseFresnelParameters", void 0); + __decorate([ + BABYLON.serializeAsFresnelParameters() + ], StandardMaterial.prototype, "opacityFresnelParameters", void 0); + __decorate([ + BABYLON.serializeAsFresnelParameters() + ], StandardMaterial.prototype, "reflectionFresnelParameters", void 0); + __decorate([ + BABYLON.serializeAsFresnelParameters() + ], StandardMaterial.prototype, "refractionFresnelParameters", void 0); + __decorate([ + BABYLON.serializeAsFresnelParameters() + ], StandardMaterial.prototype, "emissiveFresnelParameters", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "useGlossinessFromSpecularMapAlpha", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "maxSimultaneousLights", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "invertNormalMapX", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "invertNormalMapY", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], StandardMaterial.prototype, "cameraColorGradingTexture", void 0); + __decorate([ + BABYLON.serializeAsColorCurves() + ], StandardMaterial.prototype, "cameraColorCurves", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "useLogarithmicDepth", null); + return StandardMaterial; + }(BABYLON.Material)); + BABYLON.StandardMaterial = StandardMaterial; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.standardMaterial.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var MultiMaterial = (function (_super) { + __extends(MultiMaterial, _super); + function MultiMaterial(name, scene) { + _super.call(this, name, scene, true); + this.subMaterials = new Array(); + scene.multiMaterials.push(this); + } + // Properties + MultiMaterial.prototype.getSubMaterial = function (index) { + if (index < 0 || index >= this.subMaterials.length) { + return this.getScene().defaultMaterial; + } + return this.subMaterials[index]; + }; + // Methods + MultiMaterial.prototype.isReady = function (mesh) { + for (var index = 0; index < this.subMaterials.length; index++) { + var subMaterial = this.subMaterials[index]; + if (subMaterial) { + if (!this.subMaterials[index].isReady(mesh)) { + return false; + } + } + } + return true; + }; + MultiMaterial.prototype.clone = function (name, cloneChildren) { + var newMultiMaterial = new MultiMaterial(name, this.getScene()); + for (var index = 0; index < this.subMaterials.length; index++) { + var subMaterial = null; + if (cloneChildren) { + subMaterial = this.subMaterials[index].clone(name + "-" + this.subMaterials[index].name); + } + else { + subMaterial = this.subMaterials[index]; + } + newMultiMaterial.subMaterials.push(subMaterial); + } + return newMultiMaterial; + }; + MultiMaterial.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.name = this.name; + serializationObject.id = this.id; + serializationObject.tags = BABYLON.Tags.GetTags(this); + serializationObject.materials = []; + for (var matIndex = 0; matIndex < this.subMaterials.length; matIndex++) { + var subMat = this.subMaterials[matIndex]; + if (subMat) { + serializationObject.materials.push(subMat.id); + } + else { + serializationObject.materials.push(null); + } + } + return serializationObject; + }; + return MultiMaterial; + }(BABYLON.Material)); + BABYLON.MultiMaterial = MultiMaterial; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.multiMaterial.js.map + +var BABYLON; +(function (BABYLON) { + var SceneLoader = (function () { + function SceneLoader() { + } + Object.defineProperty(SceneLoader, "NO_LOGGING", { + get: function () { + return 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SceneLoader, "MINIMAL_LOGGING", { + get: function () { + return 1; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SceneLoader, "SUMMARY_LOGGING", { + get: function () { + return 2; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SceneLoader, "DETAILED_LOGGING", { + get: function () { + return 3; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SceneLoader, "ForceFullSceneLoadingForIncremental", { + get: function () { + return SceneLoader._ForceFullSceneLoadingForIncremental; + }, + set: function (value) { + SceneLoader._ForceFullSceneLoadingForIncremental = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SceneLoader, "ShowLoadingScreen", { + get: function () { + return SceneLoader._ShowLoadingScreen; + }, + set: function (value) { + SceneLoader._ShowLoadingScreen = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SceneLoader, "loggingLevel", { + get: function () { + return SceneLoader._loggingLevel; + }, + set: function (value) { + SceneLoader._loggingLevel = value; + }, + enumerable: true, + configurable: true + }); + SceneLoader._getDefaultPlugin = function () { + return SceneLoader._registeredPlugins[".babylon"]; + }; + SceneLoader._getPluginForExtension = function (extension) { + var registeredPlugin = SceneLoader._registeredPlugins[extension]; + if (registeredPlugin) { + return registeredPlugin; + } + return SceneLoader._getDefaultPlugin(); + }; + SceneLoader._getPluginForFilename = function (sceneFilename) { + if (sceneFilename.name) { + sceneFilename = sceneFilename.name; + } + var dotPosition = sceneFilename.lastIndexOf("."); + var queryStringPosition = sceneFilename.indexOf("?"); + if (queryStringPosition === -1) { + queryStringPosition = sceneFilename.length; + } + var extension = sceneFilename.substring(dotPosition, queryStringPosition).toLowerCase(); + return SceneLoader._getPluginForExtension(extension); + }; + // use babylon file loader directly if sceneFilename is prefixed with "data:" + SceneLoader._getDirectLoad = function (sceneFilename) { + if (sceneFilename.substr && sceneFilename.substr(0, 5) === "data:") { + return sceneFilename.substr(5); + } + return null; + }; + // Public functions + SceneLoader.GetPluginForExtension = function (extension) { + return SceneLoader._getPluginForExtension(extension).plugin; + }; + SceneLoader.RegisterPlugin = function (plugin) { + if (typeof plugin.extensions === "string") { + var extension = plugin.extensions; + SceneLoader._registeredPlugins[extension.toLowerCase()] = { + plugin: plugin, + isBinary: false + }; + } + else { + var extensions = plugin.extensions; + Object.keys(extensions).forEach(function (extension) { + SceneLoader._registeredPlugins[extension.toLowerCase()] = { + plugin: plugin, + isBinary: extensions[extension].isBinary + }; + }); + } + }; + SceneLoader.ImportMesh = function (meshesNames, rootUrl, sceneFilename, scene, onsuccess, progressCallBack, onerror) { + if (sceneFilename.substr && sceneFilename.substr(0, 1) === "/") { + BABYLON.Tools.Error("Wrong sceneFilename parameter"); + return; + } + if (sceneFilename.substr && sceneFilename.substr(0, 1) === "/") { + BABYLON.Tools.Error("Wrong sceneFilename parameter"); + return; + } + var directLoad = SceneLoader._getDirectLoad(sceneFilename); + var loadingToken = {}; + scene._addPendingData(loadingToken); + var manifestChecked = function (success) { + scene.database = database; + var registeredPlugin = directLoad ? SceneLoader._getDefaultPlugin() : SceneLoader._getPluginForFilename(sceneFilename); + var plugin = registeredPlugin.plugin; + var useArrayBuffer = registeredPlugin.isBinary; + var importMeshFromData = function (data) { + var meshes = []; + var particleSystems = []; + var skeletons = []; + try { + if (plugin.importMesh) { + var syncedPlugin = plugin; + if (!syncedPlugin.importMesh(meshesNames, scene, data, rootUrl, meshes, particleSystems, skeletons)) { + if (onerror) { + onerror(scene, 'Unable to import meshes from ' + rootUrl + sceneFilename); + } + scene._removePendingData(loadingToken); + return; + } + if (onsuccess) { + scene.importedMeshesFiles.push(rootUrl + sceneFilename); + onsuccess(meshes, particleSystems, skeletons); + scene._removePendingData(loadingToken); + } + } + else { + var asyncedPlugin = plugin; + asyncedPlugin.importMeshAsync(meshesNames, scene, data, rootUrl, function (meshes, particleSystems, skeletons) { + if (onsuccess) { + scene.importedMeshesFiles.push(rootUrl + sceneFilename); + onsuccess(meshes, particleSystems, skeletons); + scene._removePendingData(loadingToken); + } + }, function () { + if (onerror) { + onerror(scene, 'Unable to import meshes from ' + rootUrl + sceneFilename); + } + scene._removePendingData(loadingToken); + }); + } + } + catch (e) { + if (onerror) { + onerror(scene, 'Unable to import meshes from ' + rootUrl + sceneFilename, e); + } + scene._removePendingData(loadingToken); + } + }; + if (directLoad) { + importMeshFromData(directLoad); + return; + } + BABYLON.Tools.LoadFile(rootUrl + sceneFilename, function (data) { + importMeshFromData(data); + }, progressCallBack, database, useArrayBuffer); + }; + if (scene.getEngine().enableOfflineSupport && !directLoad) { + // Checking if a manifest file has been set for this scene and if offline mode has been requested + var database = new BABYLON.Database(rootUrl + sceneFilename, manifestChecked); + } + else { + // If the scene is a data stream or offline support is not enabled, it's a direct load + manifestChecked(true); + } + }; + /** + * Load a scene + * @param rootUrl a string that defines the root url for scene and resources + * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene + * @param engine is the instance of BABYLON.Engine to use to create the scene + */ + SceneLoader.Load = function (rootUrl, sceneFilename, engine, onsuccess, progressCallBack, onerror) { + SceneLoader.Append(rootUrl, sceneFilename, new BABYLON.Scene(engine), onsuccess, progressCallBack, onerror); + }; + /** + * Append a scene + * @param rootUrl a string that defines the root url for scene and resources + * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene + * @param scene is the instance of BABYLON.Scene to append to + */ + SceneLoader.Append = function (rootUrl, sceneFilename, scene, onsuccess, progressCallBack, onerror) { + if (sceneFilename.substr && sceneFilename.substr(0, 1) === "/") { + BABYLON.Tools.Error("Wrong sceneFilename parameter"); + return; + } + var directLoad = SceneLoader._getDirectLoad(sceneFilename); + var registeredPlugin = directLoad ? SceneLoader._getDefaultPlugin() : SceneLoader._getPluginForFilename(sceneFilename); + var plugin = registeredPlugin.plugin; + var useArrayBuffer = registeredPlugin.isBinary; + var database; + var loadingToken = {}; + scene._addPendingData(loadingToken); + if (SceneLoader.ShowLoadingScreen) { + scene.getEngine().displayLoadingUI(); + } + var loadSceneFromData = function (data) { + scene.database = database; + if (plugin.load) { + var syncedPlugin = plugin; + if (!syncedPlugin.load(scene, data, rootUrl)) { + if (onerror) { + onerror(scene); + } + scene._removePendingData(loadingToken); + scene.getEngine().hideLoadingUI(); + return; + } + if (onsuccess) { + onsuccess(scene); + } + scene._removePendingData(loadingToken); + } + else { + var asyncedPlugin = plugin; + asyncedPlugin.loadAsync(scene, data, rootUrl, function () { + if (onsuccess) { + onsuccess(scene); + } + scene._removePendingData(loadingToken); + }, function () { + if (onerror) { + onerror(scene); + } + scene._removePendingData(loadingToken); + scene.getEngine().hideLoadingUI(); + }); + } + if (SceneLoader.ShowLoadingScreen) { + scene.executeWhenReady(function () { + scene.getEngine().hideLoadingUI(); + }); + } + }; + var manifestChecked = function (success) { + BABYLON.Tools.LoadFile(rootUrl + sceneFilename, loadSceneFromData, progressCallBack, database, useArrayBuffer); + }; + if (directLoad) { + loadSceneFromData(directLoad); + return; + } + if (rootUrl.indexOf("file:") === -1) { + if (scene.getEngine().enableOfflineSupport) { + // Checking if a manifest file has been set for this scene and if offline mode has been requested + database = new BABYLON.Database(rootUrl + sceneFilename, manifestChecked); + } + else { + manifestChecked(true); + } + } + else { + BABYLON.Tools.ReadFile(sceneFilename, loadSceneFromData, progressCallBack, useArrayBuffer); + } + }; + // Flags + SceneLoader._ForceFullSceneLoadingForIncremental = false; + SceneLoader._ShowLoadingScreen = true; + SceneLoader._loggingLevel = SceneLoader.NO_LOGGING; + // Members + SceneLoader._registeredPlugins = {}; + return SceneLoader; + }()); + BABYLON.SceneLoader = SceneLoader; + ; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.sceneLoader.js.map + +var BABYLON; +(function (BABYLON) { + var Internals; + (function (Internals) { + var parseMaterialById = function (id, parsedData, scene, rootUrl) { + for (var index = 0, cache = parsedData.materials.length; index < cache; index++) { + var parsedMaterial = parsedData.materials[index]; + if (parsedMaterial.id === id) { + return BABYLON.Material.Parse(parsedMaterial, scene, rootUrl); + } + } + return null; + }; + var isDescendantOf = function (mesh, names, hierarchyIds) { + names = (names instanceof Array) ? names : [names]; + for (var i in names) { + if (mesh.name === names[i]) { + hierarchyIds.push(mesh.id); + return true; + } + } + if (mesh.parentId && hierarchyIds.indexOf(mesh.parentId) !== -1) { + hierarchyIds.push(mesh.id); + return true; + } + return false; + }; + var logOperation = function (operation, producer) { + return operation + " of " + (producer ? producer.file + " from " + producer.name + " version: " + producer.version + ", exporter version: " + producer.exporter_version : "unknown"); + }; + BABYLON.SceneLoader.RegisterPlugin({ + extensions: ".babylon", + importMesh: function (meshesNames, scene, data, rootUrl, meshes, particleSystems, skeletons) { + // Entire method running in try block, so ALWAYS logs as far as it got, only actually writes details + // when SceneLoader.debugLogging = true (default), or exception encountered. + // Everything stored in var log instead of writing separate lines to support only writing in exception, + // and avoid problems with multiple concurrent .babylon loads. + var log = "importMesh has failed JSON parse"; + try { + var parsedData = JSON.parse(data); + log = ""; + var fullDetails = BABYLON.SceneLoader.loggingLevel === BABYLON.SceneLoader.DETAILED_LOGGING; + var loadedSkeletonsIds = []; + var loadedMaterialsIds = []; + var hierarchyIds = []; + var index; + var cache; + for (index = 0, cache = parsedData.meshes.length; index < cache; index++) { + var parsedMesh = parsedData.meshes[index]; + if (!meshesNames || isDescendantOf(parsedMesh, meshesNames, hierarchyIds)) { + if (meshesNames instanceof Array) { + // Remove found mesh name from list. + delete meshesNames[meshesNames.indexOf(parsedMesh.name)]; + } + //Geometry? + if (parsedMesh.geometryId) { + //does the file contain geometries? + if (parsedData.geometries) { + //find the correct geometry and add it to the scene + var found = false; + ["boxes", "spheres", "cylinders", "toruses", "grounds", "planes", "torusKnots", "vertexData"].forEach(function (geometryType) { + if (found || !parsedData.geometries[geometryType] || !(parsedData.geometries[geometryType] instanceof Array)) { + return; + } + else { + parsedData.geometries[geometryType].forEach(function (parsedGeometryData) { + if (parsedGeometryData.id === parsedMesh.geometryId) { + switch (geometryType) { + case "boxes": + BABYLON.Geometry.Primitives.Box.Parse(parsedGeometryData, scene); + break; + case "spheres": + BABYLON.Geometry.Primitives.Sphere.Parse(parsedGeometryData, scene); + break; + case "cylinders": + BABYLON.Geometry.Primitives.Cylinder.Parse(parsedGeometryData, scene); + break; + case "toruses": + BABYLON.Geometry.Primitives.Torus.Parse(parsedGeometryData, scene); + break; + case "grounds": + BABYLON.Geometry.Primitives.Ground.Parse(parsedGeometryData, scene); + break; + case "planes": + BABYLON.Geometry.Primitives.Plane.Parse(parsedGeometryData, scene); + break; + case "torusKnots": + BABYLON.Geometry.Primitives.TorusKnot.Parse(parsedGeometryData, scene); + break; + case "vertexData": + BABYLON.Geometry.Parse(parsedGeometryData, scene, rootUrl); + break; + } + found = true; + } + }); + } + }); + if (!found) { + BABYLON.Tools.Warn("Geometry not found for mesh " + parsedMesh.id); + } + } + } + // Material ? + if (parsedMesh.materialId) { + var materialFound = (loadedMaterialsIds.indexOf(parsedMesh.materialId) !== -1); + if (!materialFound && parsedData.multiMaterials) { + for (var multimatIndex = 0, multimatCache = parsedData.multiMaterials.length; multimatIndex < multimatCache; multimatIndex++) { + var parsedMultiMaterial = parsedData.multiMaterials[multimatIndex]; + if (parsedMultiMaterial.id === parsedMesh.materialId) { + for (var matIndex = 0, matCache = parsedMultiMaterial.materials.length; matIndex < matCache; matIndex++) { + var subMatId = parsedMultiMaterial.materials[matIndex]; + loadedMaterialsIds.push(subMatId); + var mat = parseMaterialById(subMatId, parsedData, scene, rootUrl); + log += "\n\tMaterial " + mat.toString(fullDetails); + } + loadedMaterialsIds.push(parsedMultiMaterial.id); + var mmat = BABYLON.Material.ParseMultiMaterial(parsedMultiMaterial, scene); + materialFound = true; + log += "\n\tMulti-Material " + mmat.toString(fullDetails); + break; + } + } + } + if (!materialFound) { + loadedMaterialsIds.push(parsedMesh.materialId); + var mat = parseMaterialById(parsedMesh.materialId, parsedData, scene, rootUrl); + if (!mat) { + BABYLON.Tools.Warn("Material not found for mesh " + parsedMesh.id); + } + else { + log += "\n\tMaterial " + mat.toString(fullDetails); + } + } + } + // Skeleton ? + if (parsedMesh.skeletonId > -1 && scene.skeletons) { + var skeletonAlreadyLoaded = (loadedSkeletonsIds.indexOf(parsedMesh.skeletonId) > -1); + if (!skeletonAlreadyLoaded) { + for (var skeletonIndex = 0, skeletonCache = parsedData.skeletons.length; skeletonIndex < skeletonCache; skeletonIndex++) { + var parsedSkeleton = parsedData.skeletons[skeletonIndex]; + if (parsedSkeleton.id === parsedMesh.skeletonId) { + var skeleton = BABYLON.Skeleton.Parse(parsedSkeleton, scene); + skeletons.push(skeleton); + loadedSkeletonsIds.push(parsedSkeleton.id); + log += "\n\tSkeleton " + skeleton.toString(fullDetails); + } + } + } + } + var mesh = BABYLON.Mesh.Parse(parsedMesh, scene, rootUrl); + meshes.push(mesh); + log += "\n\tMesh " + mesh.toString(fullDetails); + } + } + // Connecting parents + var currentMesh; + for (index = 0, cache = scene.meshes.length; index < cache; index++) { + currentMesh = scene.meshes[index]; + if (currentMesh._waitingParentId) { + currentMesh.parent = scene.getLastEntryByID(currentMesh._waitingParentId); + currentMesh._waitingParentId = undefined; + } + } + // freeze and compute world matrix application + for (index = 0, cache = scene.meshes.length; index < cache; index++) { + currentMesh = scene.meshes[index]; + if (currentMesh._waitingFreezeWorldMatrix) { + currentMesh.freezeWorldMatrix(); + currentMesh._waitingFreezeWorldMatrix = undefined; + } + else { + currentMesh.computeWorldMatrix(true); + } + } + // Particles + if (parsedData.particleSystems) { + for (index = 0, cache = parsedData.particleSystems.length; index < cache; index++) { + var parsedParticleSystem = parsedData.particleSystems[index]; + if (hierarchyIds.indexOf(parsedParticleSystem.emitterId) !== -1) { + particleSystems.push(BABYLON.ParticleSystem.Parse(parsedParticleSystem, scene, rootUrl)); + } + } + } + return true; + } + catch (err) { + BABYLON.Tools.Log(logOperation("importMesh", parsedData ? parsedData.producer : "Unknown") + log); + log = null; + throw err; + } + finally { + if (log !== null && BABYLON.SceneLoader.loggingLevel !== BABYLON.SceneLoader.NO_LOGGING) { + BABYLON.Tools.Log(logOperation("importMesh", parsedData ? parsedData.producer : "Unknown") + (BABYLON.SceneLoader.loggingLevel !== BABYLON.SceneLoader.MINIMAL_LOGGING ? log : "")); + } + } + }, + load: function (scene, data, rootUrl) { + // Entire method running in try block, so ALWAYS logs as far as it got, only actually writes details + // when SceneLoader.debugLogging = true (default), or exception encountered. + // Everything stored in var log instead of writing separate lines to support only writing in exception, + // and avoid problems with multiple concurrent .babylon loads. + var log = "importScene has failed JSON parse"; + try { + var parsedData = JSON.parse(data); + log = ""; + var fullDetails = BABYLON.SceneLoader.loggingLevel === BABYLON.SceneLoader.DETAILED_LOGGING; + // Scene + scene.useDelayedTextureLoading = parsedData.useDelayedTextureLoading && !BABYLON.SceneLoader.ForceFullSceneLoadingForIncremental; + scene.autoClear = parsedData.autoClear; + scene.clearColor = BABYLON.Color4.FromArray(parsedData.clearColor); + scene.ambientColor = BABYLON.Color3.FromArray(parsedData.ambientColor); + if (parsedData.gravity) { + scene.gravity = BABYLON.Vector3.FromArray(parsedData.gravity); + } + // Fog + if (parsedData.fogMode && parsedData.fogMode !== 0) { + scene.fogMode = parsedData.fogMode; + scene.fogColor = BABYLON.Color3.FromArray(parsedData.fogColor); + scene.fogStart = parsedData.fogStart; + scene.fogEnd = parsedData.fogEnd; + scene.fogDensity = parsedData.fogDensity; + log += "\tFog mode for scene: "; + switch (scene.fogMode) { + // getters not compiling, so using hardcoded + case 1: + log += "exp\n"; + break; + case 2: + log += "exp2\n"; + break; + case 3: + log += "linear\n"; + break; + } + } + //Physics + if (parsedData.physicsEnabled) { + var physicsPlugin; + if (parsedData.physicsEngine === "cannon") { + physicsPlugin = new BABYLON.CannonJSPlugin(); + } + else if (parsedData.physicsEngine === "oimo") { + physicsPlugin = new BABYLON.OimoJSPlugin(); + } + log = "\tPhysics engine " + (parsedData.physicsEngine ? parsedData.physicsEngine : "oimo") + " enabled\n"; + //else - default engine, which is currently oimo + var physicsGravity = parsedData.physicsGravity ? BABYLON.Vector3.FromArray(parsedData.physicsGravity) : null; + scene.enablePhysics(physicsGravity, physicsPlugin); + } + // Metadata + if (parsedData.metadata !== undefined) { + scene.metadata = parsedData.metadata; + } + //collisions, if defined. otherwise, default is true + if (parsedData.collisionsEnabled != undefined) { + scene.collisionsEnabled = parsedData.collisionsEnabled; + } + scene.workerCollisions = !!parsedData.workerCollisions; + var index; + var cache; + // Lights + for (index = 0, cache = parsedData.lights.length; index < cache; index++) { + var parsedLight = parsedData.lights[index]; + var light = BABYLON.Light.Parse(parsedLight, scene); + log += (index === 0 ? "\n\tLights:" : ""); + log += "\n\t\t" + light.toString(fullDetails); + } + // Animations + if (parsedData.animations) { + for (index = 0, cache = parsedData.animations.length; index < cache; index++) { + var parsedAnimation = parsedData.animations[index]; + var animation = BABYLON.Animation.Parse(parsedAnimation); + scene.animations.push(animation); + log += (index === 0 ? "\n\tAnimations:" : ""); + log += "\n\t\t" + animation.toString(fullDetails); + } + } + if (parsedData.autoAnimate) { + scene.beginAnimation(scene, parsedData.autoAnimateFrom, parsedData.autoAnimateTo, parsedData.autoAnimateLoop, parsedData.autoAnimateSpeed || 1.0); + } + // Materials + if (parsedData.materials) { + for (index = 0, cache = parsedData.materials.length; index < cache; index++) { + var parsedMaterial = parsedData.materials[index]; + var mat = BABYLON.Material.Parse(parsedMaterial, scene, rootUrl); + log += (index === 0 ? "\n\tMaterials:" : ""); + log += "\n\t\t" + mat.toString(fullDetails); + } + } + if (parsedData.multiMaterials) { + for (index = 0, cache = parsedData.multiMaterials.length; index < cache; index++) { + var parsedMultiMaterial = parsedData.multiMaterials[index]; + var mmat = BABYLON.Material.ParseMultiMaterial(parsedMultiMaterial, scene); + log += (index === 0 ? "\n\tMultiMaterials:" : ""); + log += "\n\t\t" + mmat.toString(fullDetails); + } + } + // Skeletons + if (parsedData.skeletons) { + for (index = 0, cache = parsedData.skeletons.length; index < cache; index++) { + var parsedSkeleton = parsedData.skeletons[index]; + var skeleton = BABYLON.Skeleton.Parse(parsedSkeleton, scene); + log += (index === 0 ? "\n\tSkeletons:" : ""); + log += "\n\t\t" + skeleton.toString(fullDetails); + } + } + // Geometries + var geometries = parsedData.geometries; + if (geometries) { + // Boxes + var boxes = geometries.boxes; + if (boxes) { + for (index = 0, cache = boxes.length; index < cache; index++) { + var parsedBox = boxes[index]; + BABYLON.Geometry.Primitives.Box.Parse(parsedBox, scene); + } + } + // Spheres + var spheres = geometries.spheres; + if (spheres) { + for (index = 0, cache = spheres.length; index < cache; index++) { + var parsedSphere = spheres[index]; + BABYLON.Geometry.Primitives.Sphere.Parse(parsedSphere, scene); + } + } + // Cylinders + var cylinders = geometries.cylinders; + if (cylinders) { + for (index = 0, cache = cylinders.length; index < cache; index++) { + var parsedCylinder = cylinders[index]; + BABYLON.Geometry.Primitives.Cylinder.Parse(parsedCylinder, scene); + } + } + // Toruses + var toruses = geometries.toruses; + if (toruses) { + for (index = 0, cache = toruses.length; index < cache; index++) { + var parsedTorus = toruses[index]; + BABYLON.Geometry.Primitives.Torus.Parse(parsedTorus, scene); + } + } + // Grounds + var grounds = geometries.grounds; + if (grounds) { + for (index = 0, cache = grounds.length; index < cache; index++) { + var parsedGround = grounds[index]; + BABYLON.Geometry.Primitives.Ground.Parse(parsedGround, scene); + } + } + // Planes + var planes = geometries.planes; + if (planes) { + for (index = 0, cache = planes.length; index < cache; index++) { + var parsedPlane = planes[index]; + BABYLON.Geometry.Primitives.Plane.Parse(parsedPlane, scene); + } + } + // TorusKnots + var torusKnots = geometries.torusKnots; + if (torusKnots) { + for (index = 0, cache = torusKnots.length; index < cache; index++) { + var parsedTorusKnot = torusKnots[index]; + BABYLON.Geometry.Primitives.TorusKnot.Parse(parsedTorusKnot, scene); + } + } + // VertexData + var vertexData = geometries.vertexData; + if (vertexData) { + for (index = 0, cache = vertexData.length; index < cache; index++) { + var parsedVertexData = vertexData[index]; + BABYLON.Geometry.Parse(parsedVertexData, scene, rootUrl); + } + } + } + // Meshes + for (index = 0, cache = parsedData.meshes.length; index < cache; index++) { + var parsedMesh = parsedData.meshes[index]; + var mesh = BABYLON.Mesh.Parse(parsedMesh, scene, rootUrl); + log += (index === 0 ? "\n\tMeshes:" : ""); + log += "\n\t\t" + mesh.toString(fullDetails); + } + // Cameras + for (index = 0, cache = parsedData.cameras.length; index < cache; index++) { + var parsedCamera = parsedData.cameras[index]; + var camera = BABYLON.Camera.Parse(parsedCamera, scene); + log += (index === 0 ? "\n\tCameras:" : ""); + log += "\n\t\t" + camera.toString(fullDetails); + } + if (parsedData.activeCameraID) { + scene.setActiveCameraByID(parsedData.activeCameraID); + } + // Browsing all the graph to connect the dots + for (index = 0, cache = scene.cameras.length; index < cache; index++) { + var camera = scene.cameras[index]; + if (camera._waitingParentId) { + camera.parent = scene.getLastEntryByID(camera._waitingParentId); + camera._waitingParentId = undefined; + } + } + for (index = 0, cache = scene.lights.length; index < cache; index++) { + var light = scene.lights[index]; + if (light._waitingParentId) { + light.parent = scene.getLastEntryByID(light._waitingParentId); + light._waitingParentId = undefined; + } + } + // Sounds + var loadedSounds = []; + var loadedSound; + if (BABYLON.AudioEngine && parsedData.sounds) { + for (index = 0, cache = parsedData.sounds.length; index < cache; index++) { + var parsedSound = parsedData.sounds[index]; + if (BABYLON.Engine.audioEngine.canUseWebAudio) { + if (!parsedSound.url) + parsedSound.url = parsedSound.name; + if (!loadedSounds[parsedSound.url]) { + loadedSound = BABYLON.Sound.Parse(parsedSound, scene, rootUrl); + loadedSounds[parsedSound.url] = loadedSound; + } + else { + BABYLON.Sound.Parse(parsedSound, scene, rootUrl, loadedSounds[parsedSound.url]); + } + } + else { + var emptySound = new BABYLON.Sound(parsedSound.name, null, scene); + } + } + } + loadedSounds = []; + // Connect parents & children and parse actions + for (index = 0, cache = scene.meshes.length; index < cache; index++) { + var mesh = scene.meshes[index]; + if (mesh._waitingParentId) { + mesh.parent = scene.getLastEntryByID(mesh._waitingParentId); + mesh._waitingParentId = undefined; + } + if (mesh._waitingActions) { + BABYLON.ActionManager.Parse(mesh._waitingActions, mesh, scene); + mesh._waitingActions = undefined; + } + } + // freeze world matrix application + for (index = 0, cache = scene.meshes.length; index < cache; index++) { + var currentMesh = scene.meshes[index]; + if (currentMesh._waitingFreezeWorldMatrix) { + currentMesh.freezeWorldMatrix(); + currentMesh._waitingFreezeWorldMatrix = undefined; + } + else { + currentMesh.computeWorldMatrix(true); + } + } + // Particles Systems + if (parsedData.particleSystems) { + for (index = 0, cache = parsedData.particleSystems.length; index < cache; index++) { + var parsedParticleSystem = parsedData.particleSystems[index]; + BABYLON.ParticleSystem.Parse(parsedParticleSystem, scene, rootUrl); + } + } + // Lens flares + if (parsedData.lensFlareSystems) { + for (index = 0, cache = parsedData.lensFlareSystems.length; index < cache; index++) { + var parsedLensFlareSystem = parsedData.lensFlareSystems[index]; + BABYLON.LensFlareSystem.Parse(parsedLensFlareSystem, scene, rootUrl); + } + } + // Shadows + if (parsedData.shadowGenerators) { + for (index = 0, cache = parsedData.shadowGenerators.length; index < cache; index++) { + var parsedShadowGenerator = parsedData.shadowGenerators[index]; + BABYLON.ShadowGenerator.Parse(parsedShadowGenerator, scene); + } + } + // Actions (scene) + if (parsedData.actions) { + BABYLON.ActionManager.Parse(parsedData.actions, null, scene); + } + // Finish + return true; + } + catch (err) { + BABYLON.Tools.Log(logOperation("importScene", parsedData ? parsedData.producer : "Unknown") + log); + log = null; + throw err; + } + finally { + if (log !== null && BABYLON.SceneLoader.loggingLevel !== BABYLON.SceneLoader.NO_LOGGING) { + BABYLON.Tools.Log(logOperation("importScene", parsedData ? parsedData.producer : "Unknown") + (BABYLON.SceneLoader.loggingLevel !== BABYLON.SceneLoader.MINIMAL_LOGGING ? log : "")); + } + } + } + }); + })(Internals = BABYLON.Internals || (BABYLON.Internals = {})); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.babylonFileLoader.js.map + +var BABYLON; +(function (BABYLON) { + var SpriteManager = (function () { + function SpriteManager(name, imgUrl, capacity, cellSize, scene, epsilon, samplingMode) { + if (epsilon === void 0) { epsilon = 0.01; } + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + this.name = name; + this.sprites = new Array(); + this.renderingGroupId = 0; + this.layerMask = 0x0FFFFFFF; + this.fogEnabled = true; + this.isPickable = false; + /** + * An event triggered when the manager is disposed. + * @type {BABYLON.Observable} + */ + this.onDisposeObservable = new BABYLON.Observable(); + this._vertexBuffers = {}; + this._capacity = capacity; + this._spriteTexture = new BABYLON.Texture(imgUrl, scene, true, false, samplingMode); + this._spriteTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; + this._spriteTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; + if (cellSize.width && cellSize.height) { + this.cellWidth = cellSize.width; + this.cellHeight = cellSize.height; + } + else if (cellSize !== undefined) { + this.cellWidth = cellSize; + this.cellHeight = cellSize; + } + else { + return; + } + this._epsilon = epsilon; + this._scene = scene; + this._scene.spriteManagers.push(this); + var indices = []; + var index = 0; + for (var count = 0; count < capacity; count++) { + indices.push(index); + indices.push(index + 1); + indices.push(index + 2); + indices.push(index); + indices.push(index + 2); + indices.push(index + 3); + index += 4; + } + this._indexBuffer = scene.getEngine().createIndexBuffer(indices); + // VBO + // 16 floats per sprite (x, y, z, angle, sizeX, sizeY, offsetX, offsetY, invertU, invertV, cellIndexX, cellIndexY, color r, color g, color b, color a) + this._vertexData = new Float32Array(capacity * 16 * 4); + this._buffer = new BABYLON.Buffer(scene.getEngine(), this._vertexData, true, 16); + var positions = this._buffer.createVertexBuffer(BABYLON.VertexBuffer.PositionKind, 0, 4); + var options = this._buffer.createVertexBuffer("options", 4, 4); + var cellInfo = this._buffer.createVertexBuffer("cellInfo", 8, 4); + var colors = this._buffer.createVertexBuffer(BABYLON.VertexBuffer.ColorKind, 12, 4); + this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = positions; + this._vertexBuffers["options"] = options; + this._vertexBuffers["cellInfo"] = cellInfo; + this._vertexBuffers[BABYLON.VertexBuffer.ColorKind] = colors; + // Effects + this._effectBase = this._scene.getEngine().createEffect("sprites", [BABYLON.VertexBuffer.PositionKind, "options", "cellInfo", BABYLON.VertexBuffer.ColorKind], ["view", "projection", "textureInfos", "alphaTest"], ["diffuseSampler"], ""); + this._effectFog = this._scene.getEngine().createEffect("sprites", [BABYLON.VertexBuffer.PositionKind, "options", "cellInfo", BABYLON.VertexBuffer.ColorKind], ["view", "projection", "textureInfos", "alphaTest", "vFogInfos", "vFogColor"], ["diffuseSampler"], "#define FOG"); + } + Object.defineProperty(SpriteManager.prototype, "onDispose", { + set: function (callback) { + if (this._onDisposeObserver) { + this.onDisposeObservable.remove(this._onDisposeObserver); + } + this._onDisposeObserver = this.onDisposeObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpriteManager.prototype, "texture", { + get: function () { + return this._spriteTexture; + }, + set: function (value) { + this._spriteTexture = value; + }, + enumerable: true, + configurable: true + }); + SpriteManager.prototype._appendSpriteVertex = function (index, sprite, offsetX, offsetY, rowSize) { + var arrayOffset = index * 16; + if (offsetX === 0) + offsetX = this._epsilon; + else if (offsetX === 1) + offsetX = 1 - this._epsilon; + if (offsetY === 0) + offsetY = this._epsilon; + else if (offsetY === 1) + offsetY = 1 - this._epsilon; + this._vertexData[arrayOffset] = sprite.position.x; + this._vertexData[arrayOffset + 1] = sprite.position.y; + this._vertexData[arrayOffset + 2] = sprite.position.z; + this._vertexData[arrayOffset + 3] = sprite.angle; + this._vertexData[arrayOffset + 4] = sprite.width; + this._vertexData[arrayOffset + 5] = sprite.height; + this._vertexData[arrayOffset + 6] = offsetX; + this._vertexData[arrayOffset + 7] = offsetY; + this._vertexData[arrayOffset + 8] = sprite.invertU ? 1 : 0; + this._vertexData[arrayOffset + 9] = sprite.invertV ? 1 : 0; + var offset = (sprite.cellIndex / rowSize) >> 0; + this._vertexData[arrayOffset + 10] = sprite.cellIndex - offset * rowSize; + this._vertexData[arrayOffset + 11] = offset; + // Color + this._vertexData[arrayOffset + 12] = sprite.color.r; + this._vertexData[arrayOffset + 13] = sprite.color.g; + this._vertexData[arrayOffset + 14] = sprite.color.b; + this._vertexData[arrayOffset + 15] = sprite.color.a; + }; + SpriteManager.prototype.intersects = function (ray, camera, predicate, fastCheck) { + var count = Math.min(this._capacity, this.sprites.length); + var min = BABYLON.Vector3.Zero(); + var max = BABYLON.Vector3.Zero(); + var distance = Number.MAX_VALUE; + var currentSprite; + var cameraSpacePosition = BABYLON.Vector3.Zero(); + var cameraView = camera.getViewMatrix(); + for (var index = 0; index < count; index++) { + var sprite = this.sprites[index]; + if (!sprite) { + continue; + } + if (predicate) { + if (!predicate(sprite)) { + continue; + } + } + else if (!sprite.isPickable) { + continue; + } + BABYLON.Vector3.TransformCoordinatesToRef(sprite.position, cameraView, cameraSpacePosition); + min.copyFromFloats(cameraSpacePosition.x - sprite.width / 2, cameraSpacePosition.y - sprite.height / 2, cameraSpacePosition.z); + max.copyFromFloats(cameraSpacePosition.x + sprite.width / 2, cameraSpacePosition.y + sprite.height / 2, cameraSpacePosition.z); + if (ray.intersectsBoxMinMax(min, max)) { + var currentDistance = BABYLON.Vector3.Distance(cameraSpacePosition, ray.origin); + if (distance > currentDistance) { + distance = currentDistance; + currentSprite = sprite; + if (fastCheck) { + break; + } + } + } + } + if (currentSprite) { + var result = new BABYLON.PickingInfo(); + result.hit = true; + result.pickedSprite = currentSprite; + result.distance = distance; + return result; + } + return null; + }; + SpriteManager.prototype.render = function () { + // Check + if (!this._effectBase.isReady() || !this._effectFog.isReady() || !this._spriteTexture || !this._spriteTexture.isReady()) + return; + var engine = this._scene.getEngine(); + var baseSize = this._spriteTexture.getBaseSize(); + // Sprites + var deltaTime = engine.getDeltaTime(); + var max = Math.min(this._capacity, this.sprites.length); + var rowSize = baseSize.width / this.cellWidth; + var offset = 0; + for (var index = 0; index < max; index++) { + var sprite = this.sprites[index]; + if (!sprite) { + continue; + } + sprite._animate(deltaTime); + this._appendSpriteVertex(offset++, sprite, 0, 0, rowSize); + this._appendSpriteVertex(offset++, sprite, 1, 0, rowSize); + this._appendSpriteVertex(offset++, sprite, 1, 1, rowSize); + this._appendSpriteVertex(offset++, sprite, 0, 1, rowSize); + } + this._buffer.update(this._vertexData); + // Render + var effect = this._effectBase; + if (this._scene.fogEnabled && this._scene.fogMode !== BABYLON.Scene.FOGMODE_NONE && this.fogEnabled) { + effect = this._effectFog; + } + engine.enableEffect(effect); + var viewMatrix = this._scene.getViewMatrix(); + effect.setTexture("diffuseSampler", this._spriteTexture); + effect.setMatrix("view", viewMatrix); + effect.setMatrix("projection", this._scene.getProjectionMatrix()); + effect.setFloat2("textureInfos", this.cellWidth / baseSize.width, this.cellHeight / baseSize.height); + // Fog + if (this._scene.fogEnabled && this._scene.fogMode !== BABYLON.Scene.FOGMODE_NONE && this.fogEnabled) { + effect.setFloat4("vFogInfos", this._scene.fogMode, this._scene.fogStart, this._scene.fogEnd, this._scene.fogDensity); + effect.setColor3("vFogColor", this._scene.fogColor); + } + // VBOs + engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect); + // Draw order + engine.setDepthFunctionToLessOrEqual(); + effect.setBool("alphaTest", true); + engine.setColorWrite(false); + engine.draw(true, 0, max * 6); + engine.setColorWrite(true); + effect.setBool("alphaTest", false); + engine.setAlphaMode(BABYLON.Engine.ALPHA_COMBINE); + engine.draw(true, 0, max * 6); + engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE); + }; + SpriteManager.prototype.dispose = function () { + if (this._buffer) { + this._buffer.dispose(); + this._buffer = null; + } + if (this._indexBuffer) { + this._scene.getEngine()._releaseBuffer(this._indexBuffer); + this._indexBuffer = null; + } + if (this._spriteTexture) { + this._spriteTexture.dispose(); + this._spriteTexture = null; + } + // Remove from scene + var index = this._scene.spriteManagers.indexOf(this); + this._scene.spriteManagers.splice(index, 1); + // Callback + this.onDisposeObservable.notifyObservers(this); + this.onDisposeObservable.clear(); + }; + return SpriteManager; + }()); + BABYLON.SpriteManager = SpriteManager; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.spriteManager.js.map + +var BABYLON; +(function (BABYLON) { + var Sprite = (function () { + function Sprite(name, manager) { + this.name = name; + this.color = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0); + this.width = 1.0; + this.height = 1.0; + this.angle = 0; + this.cellIndex = 0; + this.invertU = 0; + this.invertV = 0; + this.animations = new Array(); + this.isPickable = false; + this._animationStarted = false; + this._loopAnimation = false; + this._fromIndex = 0; + this._toIndex = 0; + this._delay = 0; + this._direction = 1; + this._frameCount = 0; + this._time = 0; + this._manager = manager; + this._manager.sprites.push(this); + this.position = BABYLON.Vector3.Zero(); + } + Object.defineProperty(Sprite.prototype, "size", { + get: function () { + return this.width; + }, + set: function (value) { + this.width = value; + this.height = value; + }, + enumerable: true, + configurable: true + }); + Sprite.prototype.playAnimation = function (from, to, loop, delay, onAnimationEnd) { + this._fromIndex = from; + this._toIndex = to; + this._loopAnimation = loop; + this._delay = delay; + this._animationStarted = true; + this._direction = from < to ? 1 : -1; + this.cellIndex = from; + this._time = 0; + this._onAnimationEnd = onAnimationEnd; + }; + Sprite.prototype.stopAnimation = function () { + this._animationStarted = false; + }; + Sprite.prototype._animate = function (deltaTime) { + if (!this._animationStarted) + return; + this._time += deltaTime; + if (this._time > this._delay) { + this._time = this._time % this._delay; + this.cellIndex += this._direction; + if (this.cellIndex === this._toIndex) { + if (this._loopAnimation) { + this.cellIndex = this._fromIndex; + } + else { + this._animationStarted = false; + if (this._onAnimationEnd) { + this._onAnimationEnd(); + } + if (this.disposeWhenFinishedAnimating) { + this.dispose(); + } + } + } + } + }; + Sprite.prototype.dispose = function () { + for (var i = 0; i < this._manager.sprites.length; i++) { + if (this._manager.sprites[i] == this) { + this._manager.sprites.splice(i, 1); + } + } + }; + return Sprite; + }()); + BABYLON.Sprite = Sprite; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.sprite.js.map + +var BABYLON; +(function (BABYLON) { + var Layer = (function () { + function Layer(name, imgUrl, scene, isBackground, color) { + this.name = name; + this.scale = new BABYLON.Vector2(1, 1); + this.offset = new BABYLON.Vector2(0, 0); + this.alphaBlendingMode = BABYLON.Engine.ALPHA_COMBINE; + this._vertexBuffers = {}; + // Events + /** + * An event triggered when the layer is disposed. + * @type {BABYLON.Observable} + */ + this.onDisposeObservable = new BABYLON.Observable(); + /** + * An event triggered before rendering the scene + * @type {BABYLON.Observable} + */ + this.onBeforeRenderObservable = new BABYLON.Observable(); + /** + * An event triggered after rendering the scene + * @type {BABYLON.Observable} + */ + this.onAfterRenderObservable = new BABYLON.Observable(); + this.texture = imgUrl ? new BABYLON.Texture(imgUrl, scene, true) : null; + this.isBackground = isBackground === undefined ? true : isBackground; + this.color = color === undefined ? new BABYLON.Color4(1, 1, 1, 1) : color; + this._scene = scene; + this._scene.layers.push(this); + var engine = scene.getEngine(); + // VBO + var vertices = []; + vertices.push(1, 1); + vertices.push(-1, 1); + vertices.push(-1, -1); + vertices.push(1, -1); + var vertexBuffer = new BABYLON.VertexBuffer(engine, vertices, BABYLON.VertexBuffer.PositionKind, false, false, 2); + this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = vertexBuffer; + // Indices + var indices = []; + indices.push(0); + indices.push(1); + indices.push(2); + indices.push(0); + indices.push(2); + indices.push(3); + this._indexBuffer = engine.createIndexBuffer(indices); + // Effects + this._effect = engine.createEffect("layer", [BABYLON.VertexBuffer.PositionKind], ["textureMatrix", "color", "scale", "offset"], ["textureSampler"], ""); + this._alphaTestEffect = engine.createEffect("layer", [BABYLON.VertexBuffer.PositionKind], ["textureMatrix", "color", "scale", "offset"], ["textureSampler"], "#define ALPHATEST"); + } + Object.defineProperty(Layer.prototype, "onDispose", { + set: function (callback) { + if (this._onDisposeObserver) { + this.onDisposeObservable.remove(this._onDisposeObserver); + } + this._onDisposeObserver = this.onDisposeObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Layer.prototype, "onBeforeRender", { + set: function (callback) { + if (this._onBeforeRenderObserver) { + this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver); + } + this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Layer.prototype, "onAfterRender", { + set: function (callback) { + if (this._onAfterRenderObserver) { + this.onAfterRenderObservable.remove(this._onAfterRenderObserver); + } + this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Layer.prototype.render = function () { + var currentEffect = this.alphaTest ? this._alphaTestEffect : this._effect; + // Check + if (!currentEffect.isReady() || !this.texture || !this.texture.isReady()) + return; + var engine = this._scene.getEngine(); + this.onBeforeRenderObservable.notifyObservers(this); + // Render + engine.enableEffect(currentEffect); + engine.setState(false); + // Texture + currentEffect.setTexture("textureSampler", this.texture); + currentEffect.setMatrix("textureMatrix", this.texture.getTextureMatrix()); + // Color + currentEffect.setFloat4("color", this.color.r, this.color.g, this.color.b, this.color.a); + // Scale / offset + currentEffect.setVector2("offset", this.offset); + currentEffect.setVector2("scale", this.scale); + // VBOs + engine.bindBuffers(this._vertexBuffers, this._indexBuffer, currentEffect); + // Draw order + if (!this.alphaTest) { + engine.setAlphaMode(this.alphaBlendingMode); + engine.draw(true, 0, 6); + engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE); + } + else { + engine.draw(true, 0, 6); + } + this.onAfterRenderObservable.notifyObservers(this); + }; + Layer.prototype.dispose = function () { + var vertexBuffer = this._vertexBuffers[BABYLON.VertexBuffer.PositionKind]; + if (vertexBuffer) { + vertexBuffer.dispose(); + this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = null; + } + if (this._indexBuffer) { + this._scene.getEngine()._releaseBuffer(this._indexBuffer); + this._indexBuffer = null; + } + if (this.texture) { + this.texture.dispose(); + this.texture = null; + } + // Remove from scene + var index = this._scene.layers.indexOf(this); + this._scene.layers.splice(index, 1); + // Callback + this.onDisposeObservable.notifyObservers(this); + this.onDisposeObservable.clear(); + this.onAfterRenderObservable.clear(); + this.onBeforeRenderObservable.clear(); + }; + return Layer; + }()); + BABYLON.Layer = Layer; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.layer.js.map + +var BABYLON; +(function (BABYLON) { + var Particle = (function () { + function Particle() { + this.position = BABYLON.Vector3.Zero(); + this.direction = BABYLON.Vector3.Zero(); + this.color = new BABYLON.Color4(0, 0, 0, 0); + this.colorStep = new BABYLON.Color4(0, 0, 0, 0); + this.lifeTime = 1.0; + this.age = 0; + this.size = 0; + this.angle = 0; + this.angularSpeed = 0; + } + Particle.prototype.copyTo = function (other) { + other.position.copyFrom(this.position); + other.direction.copyFrom(this.direction); + other.color.copyFrom(this.color); + other.colorStep.copyFrom(this.colorStep); + other.lifeTime = this.lifeTime; + other.age = this.age; + other.size = this.size; + other.angle = this.angle; + other.angularSpeed = this.angularSpeed; + }; + return Particle; + }()); + BABYLON.Particle = Particle; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.particle.js.map + +var BABYLON; +(function (BABYLON) { + var randomNumber = function (min, max) { + if (min === max) { + return (min); + } + var random = Math.random(); + return ((random * (max - min)) + min); + }; + var ParticleSystem = (function () { + function ParticleSystem(name, capacity, scene, customEffect) { + var _this = this; + this.name = name; + // Members + this.animations = []; + this.renderingGroupId = 0; + this.emitter = null; + this.emitRate = 10; + this.manualEmitCount = -1; + this.updateSpeed = 0.01; + this.targetStopDuration = 0; + this.disposeOnStop = false; + this.minEmitPower = 1; + this.maxEmitPower = 1; + this.minLifeTime = 1; + this.maxLifeTime = 1; + this.minSize = 1; + this.maxSize = 1; + this.minAngularSpeed = 0; + this.maxAngularSpeed = 0; + this.layerMask = 0x0FFFFFFF; + /** + * An event triggered when the system is disposed. + * @type {BABYLON.Observable} + */ + this.onDisposeObservable = new BABYLON.Observable(); + this.blendMode = ParticleSystem.BLENDMODE_ONEONE; + this.forceDepthWrite = false; + this.gravity = BABYLON.Vector3.Zero(); + this.direction1 = new BABYLON.Vector3(0, 1.0, 0); + this.direction2 = new BABYLON.Vector3(0, 1.0, 0); + this.minEmitBox = new BABYLON.Vector3(-0.5, -0.5, -0.5); + this.maxEmitBox = new BABYLON.Vector3(0.5, 0.5, 0.5); + this.color1 = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0); + this.color2 = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0); + this.colorDead = new BABYLON.Color4(0, 0, 0, 1.0); + this.textureMask = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0); + this.particles = new Array(); + this._stockParticles = new Array(); + this._newPartsExcess = 0; + this._vertexBuffers = {}; + this._scaledColorStep = new BABYLON.Color4(0, 0, 0, 0); + this._colorDiff = new BABYLON.Color4(0, 0, 0, 0); + this._scaledDirection = BABYLON.Vector3.Zero(); + this._scaledGravity = BABYLON.Vector3.Zero(); + this._currentRenderId = -1; + this._started = false; + this._stopped = false; + this._actualFrame = 0; + this.id = name; + this._capacity = capacity; + this._scene = scene; + this._customEffect = customEffect; + scene.particleSystems.push(this); + var indices = []; + var index = 0; + for (var count = 0; count < capacity; count++) { + indices.push(index); + indices.push(index + 1); + indices.push(index + 2); + indices.push(index); + indices.push(index + 2); + indices.push(index + 3); + index += 4; + } + this._indexBuffer = scene.getEngine().createIndexBuffer(indices); + // 11 floats per particle (x, y, z, r, g, b, a, angle, size, offsetX, offsetY) + 1 filler + this._vertexData = new Float32Array(capacity * 11 * 4); + this._vertexBuffer = new BABYLON.Buffer(scene.getEngine(), this._vertexData, true, 11); + var positions = this._vertexBuffer.createVertexBuffer(BABYLON.VertexBuffer.PositionKind, 0, 3); + var colors = this._vertexBuffer.createVertexBuffer(BABYLON.VertexBuffer.ColorKind, 3, 4); + var options = this._vertexBuffer.createVertexBuffer("options", 7, 4); + this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = positions; + this._vertexBuffers[BABYLON.VertexBuffer.ColorKind] = colors; + this._vertexBuffers["options"] = options; + // Default behaviors + this.startDirectionFunction = function (emitPower, worldMatrix, directionToUpdate, particle) { + var randX = randomNumber(_this.direction1.x, _this.direction2.x); + var randY = randomNumber(_this.direction1.y, _this.direction2.y); + var randZ = randomNumber(_this.direction1.z, _this.direction2.z); + BABYLON.Vector3.TransformNormalFromFloatsToRef(randX * emitPower, randY * emitPower, randZ * emitPower, worldMatrix, directionToUpdate); + }; + this.startPositionFunction = function (worldMatrix, positionToUpdate, particle) { + var randX = randomNumber(_this.minEmitBox.x, _this.maxEmitBox.x); + var randY = randomNumber(_this.minEmitBox.y, _this.maxEmitBox.y); + var randZ = randomNumber(_this.minEmitBox.z, _this.maxEmitBox.z); + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate); + }; + this.updateFunction = function (particles) { + for (var index = 0; index < particles.length; index++) { + var particle = particles[index]; + particle.age += _this._scaledUpdateSpeed; + if (particle.age >= particle.lifeTime) { + _this.recycleParticle(particle); + index--; + continue; + } + else { + particle.colorStep.scaleToRef(_this._scaledUpdateSpeed, _this._scaledColorStep); + particle.color.addInPlace(_this._scaledColorStep); + if (particle.color.a < 0) + particle.color.a = 0; + particle.angle += particle.angularSpeed * _this._scaledUpdateSpeed; + particle.direction.scaleToRef(_this._scaledUpdateSpeed, _this._scaledDirection); + particle.position.addInPlace(_this._scaledDirection); + _this.gravity.scaleToRef(_this._scaledUpdateSpeed, _this._scaledGravity); + particle.direction.addInPlace(_this._scaledGravity); + } + } + }; + } + Object.defineProperty(ParticleSystem.prototype, "onDispose", { + set: function (callback) { + if (this._onDisposeObserver) { + this.onDisposeObservable.remove(this._onDisposeObserver); + } + this._onDisposeObserver = this.onDisposeObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + ParticleSystem.prototype.recycleParticle = function (particle) { + var lastParticle = this.particles.pop(); + if (lastParticle !== particle) { + lastParticle.copyTo(particle); + this._stockParticles.push(lastParticle); + } + }; + ParticleSystem.prototype.getCapacity = function () { + return this._capacity; + }; + ParticleSystem.prototype.isAlive = function () { + return this._alive; + }; + ParticleSystem.prototype.isStarted = function () { + return this._started; + }; + ParticleSystem.prototype.start = function () { + this._started = true; + this._stopped = false; + this._actualFrame = 0; + }; + ParticleSystem.prototype.stop = function () { + this._stopped = true; + }; + ParticleSystem.prototype._appendParticleVertex = function (index, particle, offsetX, offsetY) { + var offset = index * 11; + this._vertexData[offset] = particle.position.x; + this._vertexData[offset + 1] = particle.position.y; + this._vertexData[offset + 2] = particle.position.z; + this._vertexData[offset + 3] = particle.color.r; + this._vertexData[offset + 4] = particle.color.g; + this._vertexData[offset + 5] = particle.color.b; + this._vertexData[offset + 6] = particle.color.a; + this._vertexData[offset + 7] = particle.angle; + this._vertexData[offset + 8] = particle.size; + this._vertexData[offset + 9] = offsetX; + this._vertexData[offset + 10] = offsetY; + }; + ParticleSystem.prototype._update = function (newParticles) { + // Update current + this._alive = this.particles.length > 0; + this.updateFunction(this.particles); + // Add new ones + var worldMatrix; + if (this.emitter.position) { + worldMatrix = this.emitter.getWorldMatrix(); + } + else { + worldMatrix = BABYLON.Matrix.Translation(this.emitter.x, this.emitter.y, this.emitter.z); + } + var particle; + for (var index = 0; index < newParticles; index++) { + if (this.particles.length === this._capacity) { + break; + } + if (this._stockParticles.length !== 0) { + particle = this._stockParticles.pop(); + particle.age = 0; + } + else { + particle = new BABYLON.Particle(); + } + this.particles.push(particle); + var emitPower = randomNumber(this.minEmitPower, this.maxEmitPower); + this.startDirectionFunction(emitPower, worldMatrix, particle.direction, particle); + particle.lifeTime = randomNumber(this.minLifeTime, this.maxLifeTime); + particle.size = randomNumber(this.minSize, this.maxSize); + particle.angularSpeed = randomNumber(this.minAngularSpeed, this.maxAngularSpeed); + this.startPositionFunction(worldMatrix, particle.position, particle); + var step = randomNumber(0, 1.0); + BABYLON.Color4.LerpToRef(this.color1, this.color2, step, particle.color); + this.colorDead.subtractToRef(particle.color, this._colorDiff); + this._colorDiff.scaleToRef(1.0 / particle.lifeTime, particle.colorStep); + } + }; + ParticleSystem.prototype._getEffect = function () { + if (this._customEffect) { + return this._customEffect; + } + ; + var defines = []; + if (this._scene.clipPlane) { + defines.push("#define CLIPPLANE"); + } + // Effect + var join = defines.join("\n"); + if (this._cachedDefines !== join) { + this._cachedDefines = join; + this._effect = this._scene.getEngine().createEffect("particles", [BABYLON.VertexBuffer.PositionKind, BABYLON.VertexBuffer.ColorKind, "options"], ["invView", "view", "projection", "vClipPlane", "textureMask"], ["diffuseSampler"], join); + } + return this._effect; + }; + ParticleSystem.prototype.animate = function () { + if (!this._started) + return; + var effect = this._getEffect(); + // Check + if (!this.emitter || !effect.isReady() || !this.particleTexture || !this.particleTexture.isReady()) + return; + if (this._currentRenderId === this._scene.getRenderId()) { + return; + } + this._currentRenderId = this._scene.getRenderId(); + this._scaledUpdateSpeed = this.updateSpeed * this._scene.getAnimationRatio(); + // determine the number of particles we need to create + var newParticles; + if (this.manualEmitCount > -1) { + newParticles = this.manualEmitCount; + this._newPartsExcess = 0; + this.manualEmitCount = 0; + } + else { + newParticles = ((this.emitRate * this._scaledUpdateSpeed) >> 0); + this._newPartsExcess += this.emitRate * this._scaledUpdateSpeed - newParticles; + } + if (this._newPartsExcess > 1.0) { + newParticles += this._newPartsExcess >> 0; + this._newPartsExcess -= this._newPartsExcess >> 0; + } + this._alive = false; + if (!this._stopped) { + this._actualFrame += this._scaledUpdateSpeed; + if (this.targetStopDuration && this._actualFrame >= this.targetStopDuration) + this.stop(); + } + else { + newParticles = 0; + } + this._update(newParticles); + // Stopped? + if (this._stopped) { + if (!this._alive) { + this._started = false; + if (this.disposeOnStop) { + this._scene._toBeDisposed.push(this); + } + } + } + // Update VBO + var offset = 0; + for (var index = 0; index < this.particles.length; index++) { + var particle = this.particles[index]; + this._appendParticleVertex(offset++, particle, 0, 0); + this._appendParticleVertex(offset++, particle, 1, 0); + this._appendParticleVertex(offset++, particle, 1, 1); + this._appendParticleVertex(offset++, particle, 0, 1); + } + this._vertexBuffer.update(this._vertexData); + }; + ParticleSystem.prototype.render = function () { + var effect = this._getEffect(); + // Check + if (!this.emitter || !effect.isReady() || !this.particleTexture || !this.particleTexture.isReady() || !this.particles.length) + return 0; + var engine = this._scene.getEngine(); + // Render + engine.enableEffect(effect); + engine.setState(false); + var viewMatrix = this._scene.getViewMatrix(); + effect.setTexture("diffuseSampler", this.particleTexture); + effect.setMatrix("view", viewMatrix); + effect.setMatrix("projection", this._scene.getProjectionMatrix()); + effect.setFloat4("textureMask", this.textureMask.r, this.textureMask.g, this.textureMask.b, this.textureMask.a); + if (this._scene.clipPlane) { + var clipPlane = this._scene.clipPlane; + var invView = viewMatrix.clone(); + invView.invert(); + effect.setMatrix("invView", invView); + effect.setFloat4("vClipPlane", clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d); + } + // VBOs + engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect); + // Draw order + if (this.blendMode === ParticleSystem.BLENDMODE_ONEONE) { + engine.setAlphaMode(BABYLON.Engine.ALPHA_ONEONE); + } + else { + engine.setAlphaMode(BABYLON.Engine.ALPHA_COMBINE); + } + if (this.forceDepthWrite) { + engine.setDepthWrite(true); + } + engine.draw(true, 0, this.particles.length * 6); + engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE); + return this.particles.length; + }; + ParticleSystem.prototype.dispose = function () { + if (this._vertexBuffer) { + this._vertexBuffer.dispose(); + this._vertexBuffer = null; + } + if (this._indexBuffer) { + this._scene.getEngine()._releaseBuffer(this._indexBuffer); + this._indexBuffer = null; + } + if (this.particleTexture) { + this.particleTexture.dispose(); + this.particleTexture = null; + } + // Remove from scene + var index = this._scene.particleSystems.indexOf(this); + this._scene.particleSystems.splice(index, 1); + // Callback + this.onDisposeObservable.notifyObservers(this); + this.onDisposeObservable.clear(); + }; + // Clone + ParticleSystem.prototype.clone = function (name, newEmitter) { + var result = new ParticleSystem(name, this._capacity, this._scene); + BABYLON.Tools.DeepCopy(this, result, ["particles"]); + if (newEmitter === undefined) { + newEmitter = this.emitter; + } + result.emitter = newEmitter; + if (this.particleTexture) { + result.particleTexture = new BABYLON.Texture(this.particleTexture.url, this._scene); + } + result.start(); + return result; + }; + ParticleSystem.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.name = this.name; + serializationObject.id = this.id; + // Emitter + if (this.emitter.position) { + serializationObject.emitterId = this.emitter.id; + } + else { + serializationObject.emitter = this.emitter.asArray(); + } + serializationObject.capacity = this.getCapacity(); + if (this.particleTexture) { + serializationObject.textureName = this.particleTexture.name; + } + // Animations + BABYLON.Animation.AppendSerializedAnimations(this, serializationObject); + // Particle system + serializationObject.minAngularSpeed = this.minAngularSpeed; + serializationObject.maxAngularSpeed = this.maxAngularSpeed; + serializationObject.minSize = this.minSize; + serializationObject.maxSize = this.maxSize; + serializationObject.minEmitPower = this.minEmitPower; + serializationObject.maxEmitPower = this.maxEmitPower; + serializationObject.minLifeTime = this.minLifeTime; + serializationObject.maxLifeTime = this.maxLifeTime; + serializationObject.emitRate = this.emitRate; + serializationObject.minEmitBox = this.minEmitBox.asArray(); + serializationObject.maxEmitBox = this.maxEmitBox.asArray(); + serializationObject.gravity = this.gravity.asArray(); + serializationObject.direction1 = this.direction1.asArray(); + serializationObject.direction2 = this.direction2.asArray(); + serializationObject.color1 = this.color1.asArray(); + serializationObject.color2 = this.color2.asArray(); + serializationObject.colorDead = this.colorDead.asArray(); + serializationObject.updateSpeed = this.updateSpeed; + serializationObject.targetStopDuration = this.targetStopDuration; + serializationObject.textureMask = this.textureMask.asArray(); + serializationObject.blendMode = this.blendMode; + return serializationObject; + }; + ParticleSystem.Parse = function (parsedParticleSystem, scene, rootUrl) { + var name = parsedParticleSystem.name; + var particleSystem = new ParticleSystem(name, parsedParticleSystem.capacity, scene); + if (parsedParticleSystem.id) { + particleSystem.id = parsedParticleSystem.id; + } + // Texture + if (parsedParticleSystem.textureName) { + particleSystem.particleTexture = new BABYLON.Texture(rootUrl + parsedParticleSystem.textureName, scene); + particleSystem.particleTexture.name = parsedParticleSystem.textureName; + } + // Emitter + if (parsedParticleSystem.emitterId) { + particleSystem.emitter = scene.getLastMeshByID(parsedParticleSystem.emitterId); + } + else { + particleSystem.emitter = BABYLON.Vector3.FromArray(parsedParticleSystem.emitter); + } + // Animations + if (parsedParticleSystem.animations) { + for (var animationIndex = 0; animationIndex < parsedParticleSystem.animations.length; animationIndex++) { + var parsedAnimation = parsedParticleSystem.animations[animationIndex]; + particleSystem.animations.push(BABYLON.Animation.Parse(parsedAnimation)); + } + } + if (parsedParticleSystem.autoAnimate) { + scene.beginAnimation(particleSystem, parsedParticleSystem.autoAnimateFrom, parsedParticleSystem.autoAnimateTo, parsedParticleSystem.autoAnimateLoop, parsedParticleSystem.autoAnimateSpeed || 1.0); + } + // Particle system + particleSystem.minAngularSpeed = parsedParticleSystem.minAngularSpeed; + particleSystem.maxAngularSpeed = parsedParticleSystem.maxAngularSpeed; + particleSystem.minSize = parsedParticleSystem.minSize; + particleSystem.maxSize = parsedParticleSystem.maxSize; + particleSystem.minLifeTime = parsedParticleSystem.minLifeTime; + particleSystem.maxLifeTime = parsedParticleSystem.maxLifeTime; + particleSystem.minEmitPower = parsedParticleSystem.minEmitPower; + particleSystem.maxEmitPower = parsedParticleSystem.maxEmitPower; + particleSystem.emitRate = parsedParticleSystem.emitRate; + particleSystem.minEmitBox = BABYLON.Vector3.FromArray(parsedParticleSystem.minEmitBox); + particleSystem.maxEmitBox = BABYLON.Vector3.FromArray(parsedParticleSystem.maxEmitBox); + particleSystem.gravity = BABYLON.Vector3.FromArray(parsedParticleSystem.gravity); + particleSystem.direction1 = BABYLON.Vector3.FromArray(parsedParticleSystem.direction1); + particleSystem.direction2 = BABYLON.Vector3.FromArray(parsedParticleSystem.direction2); + particleSystem.color1 = BABYLON.Color4.FromArray(parsedParticleSystem.color1); + particleSystem.color2 = BABYLON.Color4.FromArray(parsedParticleSystem.color2); + particleSystem.colorDead = BABYLON.Color4.FromArray(parsedParticleSystem.colorDead); + particleSystem.updateSpeed = parsedParticleSystem.updateSpeed; + particleSystem.targetStopDuration = parsedParticleSystem.targetStopDuration; + particleSystem.textureMask = BABYLON.Color4.FromArray(parsedParticleSystem.textureMask); + particleSystem.blendMode = parsedParticleSystem.blendMode; + if (!parsedParticleSystem.preventAutoStart) { + particleSystem.start(); + } + return particleSystem; + }; + // Statics + ParticleSystem.BLENDMODE_ONEONE = 0; + ParticleSystem.BLENDMODE_STANDARD = 1; + return ParticleSystem; + }()); + BABYLON.ParticleSystem = ParticleSystem; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.particleSystem.js.map + +var BABYLON; +(function (BABYLON) { + var AnimationRange = (function () { + function AnimationRange(name, from, to) { + this.name = name; + this.from = from; + this.to = to; + } + AnimationRange.prototype.clone = function () { + return new AnimationRange(this.name, this.from, this.to); + }; + return AnimationRange; + }()); + BABYLON.AnimationRange = AnimationRange; + /** + * Composed of a frame, and an action function + */ + var AnimationEvent = (function () { + function AnimationEvent(frame, action, onlyOnce) { + this.frame = frame; + this.action = action; + this.onlyOnce = onlyOnce; + this.isDone = false; + } + return AnimationEvent; + }()); + BABYLON.AnimationEvent = AnimationEvent; + var PathCursor = (function () { + function PathCursor(path) { + this.path = path; + this._onchange = new Array(); + this.value = 0; + this.animations = new Array(); + } + PathCursor.prototype.getPoint = function () { + var point = this.path.getPointAtLengthPosition(this.value); + return new BABYLON.Vector3(point.x, 0, point.y); + }; + PathCursor.prototype.moveAhead = function (step) { + if (step === void 0) { step = 0.002; } + this.move(step); + return this; + }; + PathCursor.prototype.moveBack = function (step) { + if (step === void 0) { step = 0.002; } + this.move(-step); + return this; + }; + PathCursor.prototype.move = function (step) { + if (Math.abs(step) > 1) { + throw "step size should be less than 1."; + } + this.value += step; + this.ensureLimits(); + this.raiseOnChange(); + return this; + }; + PathCursor.prototype.ensureLimits = function () { + while (this.value > 1) { + this.value -= 1; + } + while (this.value < 0) { + this.value += 1; + } + return this; + }; + // used by animation engine + PathCursor.prototype.markAsDirty = function (propertyName) { + this.ensureLimits(); + this.raiseOnChange(); + return this; + }; + PathCursor.prototype.raiseOnChange = function () { + var _this = this; + this._onchange.forEach(function (f) { return f(_this); }); + return this; + }; + PathCursor.prototype.onchange = function (f) { + this._onchange.push(f); + return this; + }; + return PathCursor; + }()); + BABYLON.PathCursor = PathCursor; + var Animation = (function () { + function Animation(name, targetProperty, framePerSecond, dataType, loopMode, enableBlending) { + this.name = name; + this.targetProperty = targetProperty; + this.framePerSecond = framePerSecond; + this.dataType = dataType; + this.loopMode = loopMode; + this.enableBlending = enableBlending; + this._offsetsCache = {}; + this._highLimitsCache = {}; + this._stopped = false; + this._blendingFactor = 0; + // The set of event that will be linked to this animation + this._events = new Array(); + this.allowMatricesInterpolation = false; + this.blendingSpeed = 0.01; + this._ranges = {}; + this.targetPropertyPath = targetProperty.split("."); + this.dataType = dataType; + this.loopMode = loopMode === undefined ? Animation.ANIMATIONLOOPMODE_CYCLE : loopMode; + } + Animation._PrepareAnimation = function (name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction) { + var dataType = undefined; + if (!isNaN(parseFloat(from)) && isFinite(from)) { + dataType = Animation.ANIMATIONTYPE_FLOAT; + } + else if (from instanceof BABYLON.Quaternion) { + dataType = Animation.ANIMATIONTYPE_QUATERNION; + } + else if (from instanceof BABYLON.Vector3) { + dataType = Animation.ANIMATIONTYPE_VECTOR3; + } + else if (from instanceof BABYLON.Vector2) { + dataType = Animation.ANIMATIONTYPE_VECTOR2; + } + else if (from instanceof BABYLON.Color3) { + dataType = Animation.ANIMATIONTYPE_COLOR3; + } + else if (from instanceof BABYLON.Size) { + dataType = Animation.ANIMATIONTYPE_SIZE; + } + if (dataType == undefined) { + return null; + } + var animation = new Animation(name, targetProperty, framePerSecond, dataType, loopMode); + var keys = [{ frame: 0, value: from }, { frame: totalFrame, value: to }]; + animation.setKeys(keys); + if (easingFunction !== undefined) { + animation.setEasingFunction(easingFunction); + } + return animation; + }; + Animation.CreateAndStartAnimation = function (name, node, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) { + var animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction); + return node.getScene().beginDirectAnimation(node, [animation], 0, totalFrame, (animation.loopMode === 1), 1.0, onAnimationEnd); + }; + Animation.CreateMergeAndStartAnimation = function (name, node, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) { + var animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction); + node.animations.push(animation); + return node.getScene().beginAnimation(node, 0, totalFrame, (animation.loopMode === 1), 1.0, onAnimationEnd); + }; + // Methods + /** + * @param {boolean} fullDetails - support for multiple levels of logging within scene loading + */ + Animation.prototype.toString = function (fullDetails) { + var ret = "Name: " + this.name + ", property: " + this.targetProperty; + ret += ", datatype: " + (["Float", "Vector3", "Quaternion", "Matrix", "Color3", "Vector2"])[this.dataType]; + ret += ", nKeys: " + (this._keys ? this._keys.length : "none"); + ret += ", nRanges: " + (this._ranges ? Object.keys(this._ranges).length : "none"); + if (fullDetails) { + ret += ", Ranges: {"; + var first = true; + for (var name in this._ranges) { + if (first) { + ret += ", "; + first = false; + } + ret += name; + } + ret += "}"; + } + return ret; + }; + /** + * Add an event to this animation. + */ + Animation.prototype.addEvent = function (event) { + this._events.push(event); + }; + /** + * Remove all events found at the given frame + * @param frame + */ + Animation.prototype.removeEvents = function (frame) { + for (var index = 0; index < this._events.length; index++) { + if (this._events[index].frame === frame) { + this._events.splice(index, 1); + index--; + } + } + }; + Animation.prototype.createRange = function (name, from, to) { + // check name not already in use; could happen for bones after serialized + if (!this._ranges[name]) { + this._ranges[name] = new AnimationRange(name, from, to); + } + }; + Animation.prototype.deleteRange = function (name, deleteFrames) { + if (deleteFrames === void 0) { deleteFrames = true; } + if (this._ranges[name]) { + if (deleteFrames) { + var from = this._ranges[name].from; + var to = this._ranges[name].to; + // this loop MUST go high to low for multiple splices to work + for (var key = this._keys.length - 1; key >= 0; key--) { + if (this._keys[key].frame >= from && this._keys[key].frame <= to) { + this._keys.splice(key, 1); + } + } + } + this._ranges[name] = undefined; // said much faster than 'delete this._range[name]' + } + }; + Animation.prototype.getRange = function (name) { + return this._ranges[name]; + }; + Animation.prototype.reset = function () { + this._offsetsCache = {}; + this._highLimitsCache = {}; + this.currentFrame = 0; + this._blendingFactor = 0; + this._originalBlendValue = null; + }; + Animation.prototype.isStopped = function () { + return this._stopped; + }; + Animation.prototype.getKeys = function () { + return this._keys; + }; + Animation.prototype.getHighestFrame = function () { + var ret = 0; + for (var key = 0, nKeys = this._keys.length; key < nKeys; key++) { + if (ret < this._keys[key].frame) { + ret = this._keys[key].frame; + } + } + return ret; + }; + Animation.prototype.getEasingFunction = function () { + return this._easingFunction; + }; + Animation.prototype.setEasingFunction = function (easingFunction) { + this._easingFunction = easingFunction; + }; + Animation.prototype.floatInterpolateFunction = function (startValue, endValue, gradient) { + return startValue + (endValue - startValue) * gradient; + }; + Animation.prototype.quaternionInterpolateFunction = function (startValue, endValue, gradient) { + return BABYLON.Quaternion.Slerp(startValue, endValue, gradient); + }; + Animation.prototype.vector3InterpolateFunction = function (startValue, endValue, gradient) { + return BABYLON.Vector3.Lerp(startValue, endValue, gradient); + }; + Animation.prototype.vector2InterpolateFunction = function (startValue, endValue, gradient) { + return BABYLON.Vector2.Lerp(startValue, endValue, gradient); + }; + Animation.prototype.sizeInterpolateFunction = function (startValue, endValue, gradient) { + return BABYLON.Size.Lerp(startValue, endValue, gradient); + }; + Animation.prototype.color3InterpolateFunction = function (startValue, endValue, gradient) { + return BABYLON.Color3.Lerp(startValue, endValue, gradient); + }; + Animation.prototype.matrixInterpolateFunction = function (startValue, endValue, gradient) { + return BABYLON.Matrix.Lerp(startValue, endValue, gradient); + }; + Animation.prototype.clone = function () { + var clone = new Animation(this.name, this.targetPropertyPath.join("."), this.framePerSecond, this.dataType, this.loopMode); + if (this._keys) { + clone.setKeys(this._keys); + } + if (this._ranges) { + clone._ranges = {}; + for (var name in this._ranges) { + clone._ranges[name] = this._ranges[name].clone(); + } + } + return clone; + }; + Animation.prototype.setKeys = function (values) { + this._keys = values.slice(0); + this._offsetsCache = {}; + this._highLimitsCache = {}; + }; + Animation.prototype._getKeyValue = function (value) { + if (typeof value === "function") { + return value(); + } + return value; + }; + Animation.prototype._interpolate = function (currentFrame, repeatCount, loopMode, offsetValue, highLimitValue) { + if (loopMode === Animation.ANIMATIONLOOPMODE_CONSTANT && repeatCount > 0) { + return highLimitValue.clone ? highLimitValue.clone() : highLimitValue; + } + this.currentFrame = currentFrame; + // Try to get a hash to find the right key + var startKey = Math.max(0, Math.min(this._keys.length - 1, Math.floor(this._keys.length * (currentFrame - this._keys[0].frame) / (this._keys[this._keys.length - 1].frame - this._keys[0].frame)) - 1)); + if (this._keys[startKey].frame >= currentFrame) { + while (startKey - 1 >= 0 && this._keys[startKey].frame >= currentFrame) { + startKey--; + } + } + for (var key = startKey; key < this._keys.length; key++) { + if (this._keys[key + 1].frame >= currentFrame) { + var startValue = this._getKeyValue(this._keys[key].value); + var endValue = this._getKeyValue(this._keys[key + 1].value); + // gradient : percent of currentFrame between the frame inf and the frame sup + var gradient = (currentFrame - this._keys[key].frame) / (this._keys[key + 1].frame - this._keys[key].frame); + // check for easingFunction and correction of gradient + if (this._easingFunction != null) { + gradient = this._easingFunction.ease(gradient); + } + switch (this.dataType) { + // Float + case Animation.ANIMATIONTYPE_FLOAT: + switch (loopMode) { + case Animation.ANIMATIONLOOPMODE_CYCLE: + case Animation.ANIMATIONLOOPMODE_CONSTANT: + return this.floatInterpolateFunction(startValue, endValue, gradient); + case Animation.ANIMATIONLOOPMODE_RELATIVE: + return offsetValue * repeatCount + this.floatInterpolateFunction(startValue, endValue, gradient); + } + break; + // Quaternion + case Animation.ANIMATIONTYPE_QUATERNION: + var quaternion = null; + switch (loopMode) { + case Animation.ANIMATIONLOOPMODE_CYCLE: + case Animation.ANIMATIONLOOPMODE_CONSTANT: + quaternion = this.quaternionInterpolateFunction(startValue, endValue, gradient); + break; + case Animation.ANIMATIONLOOPMODE_RELATIVE: + quaternion = this.quaternionInterpolateFunction(startValue, endValue, gradient).add(offsetValue.scale(repeatCount)); + break; + } + return quaternion; + // Vector3 + case Animation.ANIMATIONTYPE_VECTOR3: + switch (loopMode) { + case Animation.ANIMATIONLOOPMODE_CYCLE: + case Animation.ANIMATIONLOOPMODE_CONSTANT: + return this.vector3InterpolateFunction(startValue, endValue, gradient); + case Animation.ANIMATIONLOOPMODE_RELATIVE: + return this.vector3InterpolateFunction(startValue, endValue, gradient).add(offsetValue.scale(repeatCount)); + } + // Vector2 + case Animation.ANIMATIONTYPE_VECTOR2: + switch (loopMode) { + case Animation.ANIMATIONLOOPMODE_CYCLE: + case Animation.ANIMATIONLOOPMODE_CONSTANT: + return this.vector2InterpolateFunction(startValue, endValue, gradient); + case Animation.ANIMATIONLOOPMODE_RELATIVE: + return this.vector2InterpolateFunction(startValue, endValue, gradient).add(offsetValue.scale(repeatCount)); + } + // Size + case Animation.ANIMATIONTYPE_SIZE: + switch (loopMode) { + case Animation.ANIMATIONLOOPMODE_CYCLE: + case Animation.ANIMATIONLOOPMODE_CONSTANT: + return this.sizeInterpolateFunction(startValue, endValue, gradient); + case Animation.ANIMATIONLOOPMODE_RELATIVE: + return this.sizeInterpolateFunction(startValue, endValue, gradient).add(offsetValue.scale(repeatCount)); + } + // Color3 + case Animation.ANIMATIONTYPE_COLOR3: + switch (loopMode) { + case Animation.ANIMATIONLOOPMODE_CYCLE: + case Animation.ANIMATIONLOOPMODE_CONSTANT: + return this.color3InterpolateFunction(startValue, endValue, gradient); + case Animation.ANIMATIONLOOPMODE_RELATIVE: + return this.color3InterpolateFunction(startValue, endValue, gradient).add(offsetValue.scale(repeatCount)); + } + // Matrix + case Animation.ANIMATIONTYPE_MATRIX: + switch (loopMode) { + case Animation.ANIMATIONLOOPMODE_CYCLE: + case Animation.ANIMATIONLOOPMODE_CONSTANT: + if (this.allowMatricesInterpolation) { + return this.matrixInterpolateFunction(startValue, endValue, gradient); + } + case Animation.ANIMATIONLOOPMODE_RELATIVE: + return startValue; + } + default: + break; + } + break; + } + } + return this._getKeyValue(this._keys[this._keys.length - 1].value); + }; + Animation.prototype.setValue = function (currentValue, blend) { + if (blend === void 0) { blend = false; } + // Set value + var path; + var destination; + if (this.targetPropertyPath.length > 1) { + var property = this._target[this.targetPropertyPath[0]]; + for (var index = 1; index < this.targetPropertyPath.length - 1; index++) { + property = property[this.targetPropertyPath[index]]; + } + path = this.targetPropertyPath[this.targetPropertyPath.length - 1]; + destination = property; + } + else { + path = this.targetPropertyPath[0]; + destination = this._target; + } + // Blending + if (this.enableBlending && this._blendingFactor <= 1.0) { + if (!this._originalBlendValue) { + if (destination[path].clone) { + this._originalBlendValue = destination[path].clone(); + } + else { + this._originalBlendValue = destination[path]; + } + } + if (this._originalBlendValue.prototype) { + if (this._originalBlendValue.prototype.Lerp) { + destination[path] = this._originalBlendValue.construtor.prototype.Lerp(currentValue, this._originalBlendValue, this._blendingFactor); + } + else { + destination[path] = currentValue; + } + } + else if (this._originalBlendValue.m) { + destination[path] = BABYLON.Matrix.Lerp(this._originalBlendValue, currentValue, this._blendingFactor); + } + else { + destination[path] = this._originalBlendValue * (1.0 - this._blendingFactor) + this._blendingFactor * currentValue; + } + this._blendingFactor += this.blendingSpeed; + } + else { + destination[path] = currentValue; + } + if (this._target.markAsDirty) { + this._target.markAsDirty(this.targetProperty); + } + }; + Animation.prototype.goToFrame = function (frame) { + if (frame < this._keys[0].frame) { + frame = this._keys[0].frame; + } + else if (frame > this._keys[this._keys.length - 1].frame) { + frame = this._keys[this._keys.length - 1].frame; + } + var currentValue = this._interpolate(frame, 0, this.loopMode); + this.setValue(currentValue); + }; + Animation.prototype.animate = function (delay, from, to, loop, speedRatio, blend) { + if (blend === void 0) { blend = false; } + if (!this.targetPropertyPath || this.targetPropertyPath.length < 1) { + this._stopped = true; + return false; + } + var returnValue = true; + // Adding a start key at frame 0 if missing + if (this._keys[0].frame !== 0) { + var newKey = { frame: 0, value: this._keys[0].value }; + this._keys.splice(0, 0, newKey); + } + // Check limits + if (from < this._keys[0].frame || from > this._keys[this._keys.length - 1].frame) { + from = this._keys[0].frame; + } + if (to < this._keys[0].frame || to > this._keys[this._keys.length - 1].frame) { + to = this._keys[this._keys.length - 1].frame; + } + //to and from cannot be the same key + if (from === to) { + from++; + } + // Compute ratio + var range = to - from; + var offsetValue; + // ratio represents the frame delta between from and to + var ratio = delay * (this.framePerSecond * speedRatio) / 1000.0; + var highLimitValue = 0; + if (ratio > range && !loop) { + returnValue = false; + highLimitValue = this._getKeyValue(this._keys[this._keys.length - 1].value); + } + else { + // Get max value if required + if (this.loopMode !== Animation.ANIMATIONLOOPMODE_CYCLE) { + var keyOffset = to.toString() + from.toString(); + if (!this._offsetsCache[keyOffset]) { + var fromValue = this._interpolate(from, 0, Animation.ANIMATIONLOOPMODE_CYCLE); + var toValue = this._interpolate(to, 0, Animation.ANIMATIONLOOPMODE_CYCLE); + switch (this.dataType) { + // Float + case Animation.ANIMATIONTYPE_FLOAT: + this._offsetsCache[keyOffset] = toValue - fromValue; + break; + // Quaternion + case Animation.ANIMATIONTYPE_QUATERNION: + this._offsetsCache[keyOffset] = toValue.subtract(fromValue); + break; + // Vector3 + case Animation.ANIMATIONTYPE_VECTOR3: + this._offsetsCache[keyOffset] = toValue.subtract(fromValue); + // Vector2 + case Animation.ANIMATIONTYPE_VECTOR2: + this._offsetsCache[keyOffset] = toValue.subtract(fromValue); + // Size + case Animation.ANIMATIONTYPE_SIZE: + this._offsetsCache[keyOffset] = toValue.subtract(fromValue); + // Color3 + case Animation.ANIMATIONTYPE_COLOR3: + this._offsetsCache[keyOffset] = toValue.subtract(fromValue); + default: + break; + } + this._highLimitsCache[keyOffset] = toValue; + } + highLimitValue = this._highLimitsCache[keyOffset]; + offsetValue = this._offsetsCache[keyOffset]; + } + } + if (offsetValue === undefined) { + switch (this.dataType) { + // Float + case Animation.ANIMATIONTYPE_FLOAT: + offsetValue = 0; + break; + // Quaternion + case Animation.ANIMATIONTYPE_QUATERNION: + offsetValue = new BABYLON.Quaternion(0, 0, 0, 0); + break; + // Vector3 + case Animation.ANIMATIONTYPE_VECTOR3: + offsetValue = BABYLON.Vector3.Zero(); + break; + // Vector2 + case Animation.ANIMATIONTYPE_VECTOR2: + offsetValue = BABYLON.Vector2.Zero(); + break; + // Size + case Animation.ANIMATIONTYPE_SIZE: + offsetValue = BABYLON.Size.Zero(); + break; + // Color3 + case Animation.ANIMATIONTYPE_COLOR3: + offsetValue = BABYLON.Color3.Black(); + } + } + // Compute value + var repeatCount = (ratio / range) >> 0; + var currentFrame = returnValue ? from + ratio % range : to; + var currentValue = this._interpolate(currentFrame, repeatCount, this.loopMode, offsetValue, highLimitValue); + // Set value + this.setValue(currentValue); + // Check events + for (var index = 0; index < this._events.length; index++) { + if (currentFrame >= this._events[index].frame) { + var event = this._events[index]; + if (!event.isDone) { + // If event should be done only once, remove it. + if (event.onlyOnce) { + this._events.splice(index, 1); + index--; + } + event.isDone = true; + event.action(); + } // Don't do anything if the event has already be done. + } + else if (this._events[index].isDone && !this._events[index].onlyOnce) { + // reset event, the animation is looping + this._events[index].isDone = false; + } + } + if (!returnValue) { + this._stopped = true; + } + return returnValue; + }; + Animation.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.name = this.name; + serializationObject.property = this.targetProperty; + serializationObject.framePerSecond = this.framePerSecond; + serializationObject.dataType = this.dataType; + serializationObject.loopBehavior = this.loopMode; + var dataType = this.dataType; + serializationObject.keys = []; + var keys = this.getKeys(); + for (var index = 0; index < keys.length; index++) { + var animationKey = keys[index]; + var key = {}; + key.frame = animationKey.frame; + switch (dataType) { + case Animation.ANIMATIONTYPE_FLOAT: + key.values = [animationKey.value]; + break; + case Animation.ANIMATIONTYPE_QUATERNION: + case Animation.ANIMATIONTYPE_MATRIX: + case Animation.ANIMATIONTYPE_VECTOR3: + case Animation.ANIMATIONTYPE_COLOR3: + key.values = animationKey.value.asArray(); + break; + } + serializationObject.keys.push(key); + } + serializationObject.ranges = []; + for (var name in this._ranges) { + var range = {}; + range.name = name; + range.from = this._ranges[name].from; + range.to = this._ranges[name].to; + serializationObject.ranges.push(range); + } + return serializationObject; + }; + Object.defineProperty(Animation, "ANIMATIONTYPE_FLOAT", { + get: function () { + return Animation._ANIMATIONTYPE_FLOAT; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONTYPE_VECTOR3", { + get: function () { + return Animation._ANIMATIONTYPE_VECTOR3; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONTYPE_VECTOR2", { + get: function () { + return Animation._ANIMATIONTYPE_VECTOR2; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONTYPE_SIZE", { + get: function () { + return Animation._ANIMATIONTYPE_SIZE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONTYPE_QUATERNION", { + get: function () { + return Animation._ANIMATIONTYPE_QUATERNION; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONTYPE_MATRIX", { + get: function () { + return Animation._ANIMATIONTYPE_MATRIX; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONTYPE_COLOR3", { + get: function () { + return Animation._ANIMATIONTYPE_COLOR3; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONLOOPMODE_RELATIVE", { + get: function () { + return Animation._ANIMATIONLOOPMODE_RELATIVE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONLOOPMODE_CYCLE", { + get: function () { + return Animation._ANIMATIONLOOPMODE_CYCLE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONLOOPMODE_CONSTANT", { + get: function () { + return Animation._ANIMATIONLOOPMODE_CONSTANT; + }, + enumerable: true, + configurable: true + }); + Animation.Parse = function (parsedAnimation) { + var animation = new Animation(parsedAnimation.name, parsedAnimation.property, parsedAnimation.framePerSecond, parsedAnimation.dataType, parsedAnimation.loopBehavior); + var dataType = parsedAnimation.dataType; + var keys = []; + var data; + var index; + for (index = 0; index < parsedAnimation.keys.length; index++) { + var key = parsedAnimation.keys[index]; + switch (dataType) { + case Animation.ANIMATIONTYPE_FLOAT: + data = key.values[0]; + break; + case Animation.ANIMATIONTYPE_QUATERNION: + data = BABYLON.Quaternion.FromArray(key.values); + break; + case Animation.ANIMATIONTYPE_MATRIX: + data = BABYLON.Matrix.FromArray(key.values); + break; + case Animation.ANIMATIONTYPE_COLOR3: + data = BABYLON.Color3.FromArray(key.values); + break; + case Animation.ANIMATIONTYPE_VECTOR3: + default: + data = BABYLON.Vector3.FromArray(key.values); + break; + } + keys.push({ + frame: key.frame, + value: data + }); + } + animation.setKeys(keys); + if (parsedAnimation.ranges) { + for (index = 0; index < parsedAnimation.ranges.length; index++) { + data = parsedAnimation.ranges[index]; + animation.createRange(data.name, data.from, data.to); + } + } + return animation; + }; + Animation.AppendSerializedAnimations = function (source, destination) { + if (source.animations) { + destination.animations = []; + for (var animationIndex = 0; animationIndex < source.animations.length; animationIndex++) { + var animation = source.animations[animationIndex]; + destination.animations.push(animation.serialize()); + } + } + }; + // Statics + Animation._ANIMATIONTYPE_FLOAT = 0; + Animation._ANIMATIONTYPE_VECTOR3 = 1; + Animation._ANIMATIONTYPE_QUATERNION = 2; + Animation._ANIMATIONTYPE_MATRIX = 3; + Animation._ANIMATIONTYPE_COLOR3 = 4; + Animation._ANIMATIONTYPE_VECTOR2 = 5; + Animation._ANIMATIONTYPE_SIZE = 6; + Animation._ANIMATIONLOOPMODE_RELATIVE = 0; + Animation._ANIMATIONLOOPMODE_CYCLE = 1; + Animation._ANIMATIONLOOPMODE_CONSTANT = 2; + return Animation; + }()); + BABYLON.Animation = Animation; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.animation.js.map + +var BABYLON; +(function (BABYLON) { + var Animatable = (function () { + function Animatable(scene, target, fromFrame, toFrame, loopAnimation, speedRatio, onAnimationEnd, animations) { + if (fromFrame === void 0) { fromFrame = 0; } + if (toFrame === void 0) { toFrame = 100; } + if (loopAnimation === void 0) { loopAnimation = false; } + if (speedRatio === void 0) { speedRatio = 1.0; } + this.target = target; + this.fromFrame = fromFrame; + this.toFrame = toFrame; + this.loopAnimation = loopAnimation; + this.speedRatio = speedRatio; + this.onAnimationEnd = onAnimationEnd; + this._animations = new Array(); + this._paused = false; + this.animationStarted = false; + if (animations) { + this.appendAnimations(target, animations); + } + this._scene = scene; + scene._activeAnimatables.push(this); + } + // Methods + Animatable.prototype.getAnimations = function () { + return this._animations; + }; + Animatable.prototype.appendAnimations = function (target, animations) { + for (var index = 0; index < animations.length; index++) { + var animation = animations[index]; + animation._target = target; + this._animations.push(animation); + } + }; + Animatable.prototype.getAnimationByTargetProperty = function (property) { + var animations = this._animations; + for (var index = 0; index < animations.length; index++) { + if (animations[index].targetProperty === property) { + return animations[index]; + } + } + return null; + }; + Animatable.prototype.reset = function () { + var animations = this._animations; + for (var index = 0; index < animations.length; index++) { + animations[index].reset(); + } + this._localDelayOffset = null; + this._pausedDelay = null; + }; + Animatable.prototype.enableBlending = function (blendingSpeed) { + var animations = this._animations; + for (var index = 0; index < animations.length; index++) { + animations[index].enableBlending = true; + animations[index].blendingSpeed = blendingSpeed; + } + }; + Animatable.prototype.disableBlending = function () { + var animations = this._animations; + for (var index = 0; index < animations.length; index++) { + animations[index].enableBlending = false; + } + }; + Animatable.prototype.goToFrame = function (frame) { + var animations = this._animations; + if (animations[0]) { + var fps = animations[0].framePerSecond; + var currentFrame = animations[0].currentFrame; + var adjustTime = frame - currentFrame; + var delay = adjustTime * 1000 / fps; + this._localDelayOffset -= delay; + } + for (var index = 0; index < animations.length; index++) { + animations[index].goToFrame(frame); + } + }; + Animatable.prototype.pause = function () { + if (this._paused) { + return; + } + this._paused = true; + }; + Animatable.prototype.restart = function () { + this._paused = false; + }; + Animatable.prototype.stop = function (animationName) { + var index = this._scene._activeAnimatables.indexOf(this); + if (index > -1) { + var animations = this._animations; + var numberOfAnimationsStopped = 0; + for (var index = animations.length - 1; index >= 0; index--) { + if (typeof animationName === "string" && animations[index].name != animationName) { + continue; + } + animations[index].reset(); + animations.splice(index, 1); + numberOfAnimationsStopped++; + } + if (animations.length == numberOfAnimationsStopped) { + this._scene._activeAnimatables.splice(index, 1); + if (this.onAnimationEnd) { + this.onAnimationEnd(); + } + } + } + }; + Animatable.prototype._animate = function (delay) { + if (this._paused) { + this.animationStarted = false; + if (!this._pausedDelay) { + this._pausedDelay = delay; + } + return true; + } + if (!this._localDelayOffset) { + this._localDelayOffset = delay; + } + else if (this._pausedDelay) { + this._localDelayOffset += delay - this._pausedDelay; + this._pausedDelay = null; + } + // Animating + var running = false; + var animations = this._animations; + var index; + for (index = 0; index < animations.length; index++) { + var animation = animations[index]; + var isRunning = animation.animate(delay - this._localDelayOffset, this.fromFrame, this.toFrame, this.loopAnimation, this.speedRatio); + running = running || isRunning; + } + this.animationStarted = running; + if (!running) { + // Remove from active animatables + index = this._scene._activeAnimatables.indexOf(this); + this._scene._activeAnimatables.splice(index, 1); + } + if (!running && this.onAnimationEnd) { + this.onAnimationEnd(); + this.onAnimationEnd = null; + } + return running; + }; + return Animatable; + }()); + BABYLON.Animatable = Animatable; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.animatable.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var EasingFunction = (function () { + function EasingFunction() { + // Properties + this._easingMode = EasingFunction.EASINGMODE_EASEIN; + } + Object.defineProperty(EasingFunction, "EASINGMODE_EASEIN", { + get: function () { + return EasingFunction._EASINGMODE_EASEIN; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EasingFunction, "EASINGMODE_EASEOUT", { + get: function () { + return EasingFunction._EASINGMODE_EASEOUT; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EasingFunction, "EASINGMODE_EASEINOUT", { + get: function () { + return EasingFunction._EASINGMODE_EASEINOUT; + }, + enumerable: true, + configurable: true + }); + EasingFunction.prototype.setEasingMode = function (easingMode) { + var n = Math.min(Math.max(easingMode, 0), 2); + this._easingMode = n; + }; + EasingFunction.prototype.getEasingMode = function () { + return this._easingMode; + }; + EasingFunction.prototype.easeInCore = function (gradient) { + throw new Error('You must implement this method'); + }; + EasingFunction.prototype.ease = function (gradient) { + switch (this._easingMode) { + case EasingFunction.EASINGMODE_EASEIN: + return this.easeInCore(gradient); + case EasingFunction.EASINGMODE_EASEOUT: + return (1 - this.easeInCore(1 - gradient)); + } + if (gradient >= 0.5) { + return (((1 - this.easeInCore((1 - gradient) * 2)) * 0.5) + 0.5); + } + return (this.easeInCore(gradient * 2) * 0.5); + }; + //Statics + EasingFunction._EASINGMODE_EASEIN = 0; + EasingFunction._EASINGMODE_EASEOUT = 1; + EasingFunction._EASINGMODE_EASEINOUT = 2; + return EasingFunction; + }()); + BABYLON.EasingFunction = EasingFunction; + var CircleEase = (function (_super) { + __extends(CircleEase, _super); + function CircleEase() { + _super.apply(this, arguments); + } + CircleEase.prototype.easeInCore = function (gradient) { + gradient = Math.max(0, Math.min(1, gradient)); + return (1.0 - Math.sqrt(1.0 - (gradient * gradient))); + }; + return CircleEase; + }(EasingFunction)); + BABYLON.CircleEase = CircleEase; + var BackEase = (function (_super) { + __extends(BackEase, _super); + function BackEase(amplitude) { + if (amplitude === void 0) { amplitude = 1; } + _super.call(this); + this.amplitude = amplitude; + } + BackEase.prototype.easeInCore = function (gradient) { + var num = Math.max(0, this.amplitude); + return (Math.pow(gradient, 3.0) - ((gradient * num) * Math.sin(3.1415926535897931 * gradient))); + }; + return BackEase; + }(EasingFunction)); + BABYLON.BackEase = BackEase; + var BounceEase = (function (_super) { + __extends(BounceEase, _super); + function BounceEase(bounces, bounciness) { + if (bounces === void 0) { bounces = 3; } + if (bounciness === void 0) { bounciness = 2; } + _super.call(this); + this.bounces = bounces; + this.bounciness = bounciness; + } + BounceEase.prototype.easeInCore = function (gradient) { + var y = Math.max(0.0, this.bounces); + var bounciness = this.bounciness; + if (bounciness <= 1.0) { + bounciness = 1.001; + } + var num9 = Math.pow(bounciness, y); + var num5 = 1.0 - bounciness; + var num4 = ((1.0 - num9) / num5) + (num9 * 0.5); + var num15 = gradient * num4; + var num65 = Math.log((-num15 * (1.0 - bounciness)) + 1.0) / Math.log(bounciness); + var num3 = Math.floor(num65); + var num13 = num3 + 1.0; + var num8 = (1.0 - Math.pow(bounciness, num3)) / (num5 * num4); + var num12 = (1.0 - Math.pow(bounciness, num13)) / (num5 * num4); + var num7 = (num8 + num12) * 0.5; + var num6 = gradient - num7; + var num2 = num7 - num8; + return (((-Math.pow(1.0 / bounciness, y - num3) / (num2 * num2)) * (num6 - num2)) * (num6 + num2)); + }; + return BounceEase; + }(EasingFunction)); + BABYLON.BounceEase = BounceEase; + var CubicEase = (function (_super) { + __extends(CubicEase, _super); + function CubicEase() { + _super.apply(this, arguments); + } + CubicEase.prototype.easeInCore = function (gradient) { + return (gradient * gradient * gradient); + }; + return CubicEase; + }(EasingFunction)); + BABYLON.CubicEase = CubicEase; + var ElasticEase = (function (_super) { + __extends(ElasticEase, _super); + function ElasticEase(oscillations, springiness) { + if (oscillations === void 0) { oscillations = 3; } + if (springiness === void 0) { springiness = 3; } + _super.call(this); + this.oscillations = oscillations; + this.springiness = springiness; + } + ElasticEase.prototype.easeInCore = function (gradient) { + var num2; + var num3 = Math.max(0.0, this.oscillations); + var num = Math.max(0.0, this.springiness); + if (num == 0) { + num2 = gradient; + } + else { + num2 = (Math.exp(num * gradient) - 1.0) / (Math.exp(num) - 1.0); + } + return (num2 * Math.sin(((6.2831853071795862 * num3) + 1.5707963267948966) * gradient)); + }; + return ElasticEase; + }(EasingFunction)); + BABYLON.ElasticEase = ElasticEase; + var ExponentialEase = (function (_super) { + __extends(ExponentialEase, _super); + function ExponentialEase(exponent) { + if (exponent === void 0) { exponent = 2; } + _super.call(this); + this.exponent = exponent; + } + ExponentialEase.prototype.easeInCore = function (gradient) { + if (this.exponent <= 0) { + return gradient; + } + return ((Math.exp(this.exponent * gradient) - 1.0) / (Math.exp(this.exponent) - 1.0)); + }; + return ExponentialEase; + }(EasingFunction)); + BABYLON.ExponentialEase = ExponentialEase; + var PowerEase = (function (_super) { + __extends(PowerEase, _super); + function PowerEase(power) { + if (power === void 0) { power = 2; } + _super.call(this); + this.power = power; + } + PowerEase.prototype.easeInCore = function (gradient) { + var y = Math.max(0.0, this.power); + return Math.pow(gradient, y); + }; + return PowerEase; + }(EasingFunction)); + BABYLON.PowerEase = PowerEase; + var QuadraticEase = (function (_super) { + __extends(QuadraticEase, _super); + function QuadraticEase() { + _super.apply(this, arguments); + } + QuadraticEase.prototype.easeInCore = function (gradient) { + return (gradient * gradient); + }; + return QuadraticEase; + }(EasingFunction)); + BABYLON.QuadraticEase = QuadraticEase; + var QuarticEase = (function (_super) { + __extends(QuarticEase, _super); + function QuarticEase() { + _super.apply(this, arguments); + } + QuarticEase.prototype.easeInCore = function (gradient) { + return (gradient * gradient * gradient * gradient); + }; + return QuarticEase; + }(EasingFunction)); + BABYLON.QuarticEase = QuarticEase; + var QuinticEase = (function (_super) { + __extends(QuinticEase, _super); + function QuinticEase() { + _super.apply(this, arguments); + } + QuinticEase.prototype.easeInCore = function (gradient) { + return (gradient * gradient * gradient * gradient * gradient); + }; + return QuinticEase; + }(EasingFunction)); + BABYLON.QuinticEase = QuinticEase; + var SineEase = (function (_super) { + __extends(SineEase, _super); + function SineEase() { + _super.apply(this, arguments); + } + SineEase.prototype.easeInCore = function (gradient) { + return (1.0 - Math.sin(1.5707963267948966 * (1.0 - gradient))); + }; + return SineEase; + }(EasingFunction)); + BABYLON.SineEase = SineEase; + var BezierCurveEase = (function (_super) { + __extends(BezierCurveEase, _super); + function BezierCurveEase(x1, y1, x2, y2) { + if (x1 === void 0) { x1 = 0; } + if (y1 === void 0) { y1 = 0; } + if (x2 === void 0) { x2 = 1; } + if (y2 === void 0) { y2 = 1; } + _super.call(this); + this.x1 = x1; + this.y1 = y1; + this.x2 = x2; + this.y2 = y2; + } + BezierCurveEase.prototype.easeInCore = function (gradient) { + return BABYLON.BezierCurve.interpolate(gradient, this.x1, this.y1, this.x2, this.y2); + }; + return BezierCurveEase; + }(EasingFunction)); + BABYLON.BezierCurveEase = BezierCurveEase; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.easing.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var Bone = (function (_super) { + __extends(Bone, _super); + function Bone(name, skeleton, parentBone, matrix, restPose) { + _super.call(this, name, skeleton.getScene()); + this.name = name; + this.children = new Array(); + this.animations = new Array(); + this._worldTransform = new BABYLON.Matrix(); + this._absoluteTransform = new BABYLON.Matrix(); + this._invertedAbsoluteTransform = new BABYLON.Matrix(); + this._scaleMatrix = BABYLON.Matrix.Identity(); + this._scaleVector = new BABYLON.Vector3(1, 1, 1); + this._negateScaleChildren = new BABYLON.Vector3(1, 1, 1); + this._scalingDeterminant = 1; + this._syncScaleVector = function () { + var lm = this.getLocalMatrix(); + var xsq = (lm.m[0] * lm.m[0] + lm.m[1] * lm.m[1] + lm.m[2] * lm.m[2]); + var ysq = (lm.m[4] * lm.m[4] + lm.m[5] * lm.m[5] + lm.m[6] * lm.m[6]); + var zsq = (lm.m[8] * lm.m[8] + lm.m[9] * lm.m[9] + lm.m[10] * lm.m[10]); + var xs = lm.m[0] * lm.m[1] * lm.m[2] * lm.m[3] < 0 ? -1 : 1; + var ys = lm.m[4] * lm.m[5] * lm.m[6] * lm.m[7] < 0 ? -1 : 1; + var zs = lm.m[8] * lm.m[9] * lm.m[10] * lm.m[11] < 0 ? -1 : 1; + this._scaleVector.x = xs * Math.sqrt(xsq); + this._scaleVector.y = ys * Math.sqrt(ysq); + this._scaleVector.z = zs * Math.sqrt(zsq); + if (this._parent) { + this._scaleVector.x /= this._parent._negateScaleChildren.x; + this._scaleVector.y /= this._parent._negateScaleChildren.y; + this._scaleVector.z /= this._parent._negateScaleChildren.z; + } + BABYLON.Matrix.FromValuesToRef(this._scaleVector.x, 0, 0, 0, 0, this._scaleVector.y, 0, 0, 0, 0, this._scaleVector.z, 0, 0, 0, 0, 1, this._scaleMatrix); + }; + this._skeleton = skeleton; + this._matrix = matrix; + this._baseMatrix = matrix; + this._restPose = restPose ? restPose : matrix.clone(); + skeleton.bones.push(this); + if (parentBone) { + this._parent = parentBone; + parentBone.children.push(this); + } + else { + this._parent = null; + } + this._updateDifferenceMatrix(); + if (this.getAbsoluteTransform().determinant() < 0) { + this._scalingDeterminant *= -1; + } + } + // Members + Bone.prototype.getParent = function () { + return this._parent; + }; + Bone.prototype.getLocalMatrix = function () { + return this._matrix; + }; + Bone.prototype.getBaseMatrix = function () { + return this._baseMatrix; + }; + Bone.prototype.getRestPose = function () { + return this._restPose; + }; + Bone.prototype.returnToRest = function () { + this.updateMatrix(this._restPose.clone()); + }; + Bone.prototype.getWorldMatrix = function () { + return this._worldTransform; + }; + Bone.prototype.getInvertedAbsoluteTransform = function () { + return this._invertedAbsoluteTransform; + }; + Bone.prototype.getAbsoluteTransform = function () { + return this._absoluteTransform; + }; + // Methods + Bone.prototype.updateMatrix = function (matrix, updateDifferenceMatrix) { + if (updateDifferenceMatrix === void 0) { updateDifferenceMatrix = true; } + this._baseMatrix = matrix.clone(); + this._matrix = matrix.clone(); + this._skeleton._markAsDirty(); + if (updateDifferenceMatrix) { + this._updateDifferenceMatrix(); + } + }; + Bone.prototype._updateDifferenceMatrix = function (rootMatrix) { + if (!rootMatrix) { + rootMatrix = this._baseMatrix; + } + if (this._parent) { + rootMatrix.multiplyToRef(this._parent._absoluteTransform, this._absoluteTransform); + } + else { + this._absoluteTransform.copyFrom(rootMatrix); + } + this._absoluteTransform.invertToRef(this._invertedAbsoluteTransform); + for (var index = 0; index < this.children.length; index++) { + this.children[index]._updateDifferenceMatrix(); + } + }; + Bone.prototype.markAsDirty = function () { + this._currentRenderId++; + this._skeleton._markAsDirty(); + }; + Bone.prototype.copyAnimationRange = function (source, rangeName, frameOffset, rescaleAsRequired, skelDimensionsRatio) { + if (rescaleAsRequired === void 0) { rescaleAsRequired = false; } + if (skelDimensionsRatio === void 0) { skelDimensionsRatio = null; } + // all animation may be coming from a library skeleton, so may need to create animation + if (this.animations.length === 0) { + this.animations.push(new BABYLON.Animation(this.name, "_matrix", source.animations[0].framePerSecond, BABYLON.Animation.ANIMATIONTYPE_MATRIX, 0)); + this.animations[0].setKeys([]); + } + // get animation info / verify there is such a range from the source bone + var sourceRange = source.animations[0].getRange(rangeName); + if (!sourceRange) { + return false; + } + var from = sourceRange.from; + var to = sourceRange.to; + var sourceKeys = source.animations[0].getKeys(); + // rescaling prep + var sourceBoneLength = source.length; + var sourceParent = source.getParent(); + var parent = this.getParent(); + var parentScalingReqd = rescaleAsRequired && sourceParent && sourceBoneLength && this.length && sourceBoneLength !== this.length; + var parentRatio = parentScalingReqd ? parent.length / sourceParent.length : null; + var dimensionsScalingReqd = rescaleAsRequired && !parent && skelDimensionsRatio && (skelDimensionsRatio.x !== 1 || skelDimensionsRatio.y !== 1 || skelDimensionsRatio.z !== 1); + var destKeys = this.animations[0].getKeys(); + // loop vars declaration + var orig; + var origTranslation; + var mat; + for (var key = 0, nKeys = sourceKeys.length; key < nKeys; key++) { + orig = sourceKeys[key]; + if (orig.frame >= from && orig.frame <= to) { + if (rescaleAsRequired) { + mat = orig.value.clone(); + // scale based on parent ratio, when bone has parent + if (parentScalingReqd) { + origTranslation = mat.getTranslation(); + mat.setTranslation(origTranslation.scaleInPlace(parentRatio)); + } + else if (dimensionsScalingReqd) { + origTranslation = mat.getTranslation(); + mat.setTranslation(origTranslation.multiplyInPlace(skelDimensionsRatio)); + } + else { + mat = orig.value; + } + } + else { + mat = orig.value; + } + destKeys.push({ frame: orig.frame + frameOffset, value: mat }); + } + } + this.animations[0].createRange(rangeName, from + frameOffset, to + frameOffset); + return true; + }; + Bone.prototype.translate = function (vec, space, mesh) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + var lm = this.getLocalMatrix(); + if (space == BABYLON.Space.LOCAL) { + lm.m[12] += vec.x; + lm.m[13] += vec.y; + lm.m[14] += vec.z; + } + else { + this._skeleton.computeAbsoluteTransforms(); + var tmat = BABYLON.Tmp.Matrix[0]; + var tvec = BABYLON.Tmp.Vector3[0]; + if (mesh) { + tmat.copyFrom(this._parent.getAbsoluteTransform()); + tmat.multiplyToRef(mesh.getWorldMatrix(), tmat); + } + else { + tmat.copyFrom(this._parent.getAbsoluteTransform()); + } + tmat.m[12] = 0; + tmat.m[13] = 0; + tmat.m[14] = 0; + tmat.invert(); + BABYLON.Vector3.TransformCoordinatesToRef(vec, tmat, tvec); + lm.m[12] += tvec.x; + lm.m[13] += tvec.y; + lm.m[14] += tvec.z; + } + this.markAsDirty(); + }; + Bone.prototype.setPosition = function (position, space, mesh) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + var lm = this.getLocalMatrix(); + if (space == BABYLON.Space.LOCAL) { + lm.m[12] = position.x; + lm.m[13] = position.y; + lm.m[14] = position.z; + } + else { + this._skeleton.computeAbsoluteTransforms(); + var tmat = BABYLON.Tmp.Matrix[0]; + var vec = BABYLON.Tmp.Vector3[0]; + if (mesh) { + tmat.copyFrom(this._parent.getAbsoluteTransform()); + tmat.multiplyToRef(mesh.getWorldMatrix(), tmat); + } + else { + tmat.copyFrom(this._parent.getAbsoluteTransform()); + } + tmat.invert(); + BABYLON.Vector3.TransformCoordinatesToRef(position, tmat, vec); + lm.m[12] = vec.x; + lm.m[13] = vec.y; + lm.m[14] = vec.z; + } + this.markAsDirty(); + }; + Bone.prototype.setAbsolutePosition = function (position, mesh) { + this.setPosition(position, BABYLON.Space.WORLD, mesh); + }; + Bone.prototype.setScale = function (x, y, z, scaleChildren) { + if (scaleChildren === void 0) { scaleChildren = false; } + if (this.animations[0] && !this.animations[0].isStopped()) { + if (!scaleChildren) { + this._negateScaleChildren.x = 1 / x; + this._negateScaleChildren.y = 1 / y; + this._negateScaleChildren.z = 1 / z; + } + this._syncScaleVector(); + } + this.scale(x / this._scaleVector.x, y / this._scaleVector.y, z / this._scaleVector.z, scaleChildren); + }; + Bone.prototype.scale = function (x, y, z, scaleChildren) { + if (scaleChildren === void 0) { scaleChildren = false; } + var locMat = this.getLocalMatrix(); + var origLocMat = BABYLON.Tmp.Matrix[0]; + origLocMat.copyFrom(locMat); + var origLocMatInv = BABYLON.Tmp.Matrix[1]; + origLocMatInv.copyFrom(origLocMat); + origLocMatInv.invert(); + var scaleMat = BABYLON.Tmp.Matrix[2]; + BABYLON.Matrix.FromValuesToRef(x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1, scaleMat); + this._scaleMatrix.multiplyToRef(scaleMat, this._scaleMatrix); + this._scaleVector.x *= x; + this._scaleVector.y *= y; + this._scaleVector.z *= z; + locMat.multiplyToRef(origLocMatInv, locMat); + locMat.multiplyToRef(scaleMat, locMat); + locMat.multiplyToRef(origLocMat, locMat); + var parent = this.getParent(); + if (parent) { + locMat.multiplyToRef(parent.getAbsoluteTransform(), this.getAbsoluteTransform()); + } + else { + this.getAbsoluteTransform().copyFrom(locMat); + } + var len = this.children.length; + scaleMat.invert(); + for (var i = 0; i < len; i++) { + var child = this.children[i]; + var cm = child.getLocalMatrix(); + cm.multiplyToRef(scaleMat, cm); + var lm = child.getLocalMatrix(); + lm.m[12] *= x; + lm.m[13] *= y; + lm.m[14] *= z; + } + this.computeAbsoluteTransforms(); + if (scaleChildren) { + for (var i = 0; i < len; i++) { + this.children[i].scale(x, y, z, scaleChildren); + } + } + this.markAsDirty(); + }; + Bone.prototype.setYawPitchRoll = function (yaw, pitch, roll, space, mesh) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + var rotMat = BABYLON.Tmp.Matrix[0]; + BABYLON.Matrix.RotationYawPitchRollToRef(yaw, pitch, roll, rotMat); + var rotMatInv = BABYLON.Tmp.Matrix[1]; + this._getNegativeRotationToRef(rotMatInv, space, mesh); + rotMatInv.multiplyToRef(rotMat, rotMat); + this._rotateWithMatrix(rotMat, space, mesh); + }; + Bone.prototype.rotate = function (axis, amount, space, mesh) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + var rmat = BABYLON.Tmp.Matrix[0]; + rmat.m[12] = 0; + rmat.m[13] = 0; + rmat.m[14] = 0; + BABYLON.Matrix.RotationAxisToRef(axis, amount, rmat); + this._rotateWithMatrix(rmat, space, mesh); + }; + Bone.prototype.setAxisAngle = function (axis, angle, space, mesh) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + var rotMat = BABYLON.Tmp.Matrix[0]; + BABYLON.Matrix.RotationAxisToRef(axis, angle, rotMat); + var rotMatInv = BABYLON.Tmp.Matrix[1]; + this._getNegativeRotationToRef(rotMatInv, space, mesh); + rotMatInv.multiplyToRef(rotMat, rotMat); + this._rotateWithMatrix(rotMat, space, mesh); + }; + Bone.prototype.setRotation = function (rotation, space, mesh) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + this.setYawPitchRoll(rotation.y, rotation.x, rotation.z, space, mesh); + }; + Bone.prototype.setRotationQuaternion = function (quat, space, mesh) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + var rotMatInv = BABYLON.Tmp.Matrix[0]; + this._getNegativeRotationToRef(rotMatInv, space, mesh); + var rotMat = BABYLON.Tmp.Matrix[1]; + BABYLON.Matrix.FromQuaternionToRef(quat, rotMat); + rotMatInv.multiplyToRef(rotMat, rotMat); + this._rotateWithMatrix(rotMat, space, mesh); + }; + Bone.prototype.setRotationMatrix = function (rotMat, space, mesh) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + var rotMatInv = BABYLON.Tmp.Matrix[0]; + this._getNegativeRotationToRef(rotMatInv, space, mesh); + var rotMat2 = BABYLON.Tmp.Matrix[1]; + rotMat2.copyFrom(rotMat); + rotMatInv.multiplyToRef(rotMat, rotMat2); + this._rotateWithMatrix(rotMat2, space, mesh); + }; + Bone.prototype._rotateWithMatrix = function (rmat, space, mesh) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + var lmat = this.getLocalMatrix(); + var lx = lmat.m[12]; + var ly = lmat.m[13]; + var lz = lmat.m[14]; + var parent = this.getParent(); + var parentScale = BABYLON.Tmp.Matrix[3]; + var parentScaleInv = BABYLON.Tmp.Matrix[4]; + if (parent) { + if (space == BABYLON.Space.WORLD) { + if (mesh) { + parentScale.copyFrom(mesh.getWorldMatrix()); + parent.getAbsoluteTransform().multiplyToRef(parentScale, parentScale); + } + else { + parentScale.copyFrom(parent.getAbsoluteTransform()); + } + } + else { + parentScale = parent._scaleMatrix; + } + parentScaleInv.copyFrom(parentScale); + parentScaleInv.invert(); + lmat.multiplyToRef(parentScale, lmat); + lmat.multiplyToRef(rmat, lmat); + lmat.multiplyToRef(parentScaleInv, lmat); + } + else { + if (space == BABYLON.Space.WORLD && mesh) { + parentScale.copyFrom(mesh.getWorldMatrix()); + parentScaleInv.copyFrom(parentScale); + parentScaleInv.invert(); + lmat.multiplyToRef(parentScale, lmat); + lmat.multiplyToRef(rmat, lmat); + lmat.multiplyToRef(parentScaleInv, lmat); + } + else { + lmat.multiplyToRef(rmat, lmat); + } + } + lmat.m[12] = lx; + lmat.m[13] = ly; + lmat.m[14] = lz; + this.computeAbsoluteTransforms(); + this.markAsDirty(); + }; + Bone.prototype._getNegativeRotationToRef = function (rotMatInv, space, mesh) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + if (space == BABYLON.Space.WORLD) { + var scaleMatrix = BABYLON.Tmp.Matrix[2]; + scaleMatrix.copyFrom(this._scaleMatrix); + rotMatInv.copyFrom(this.getAbsoluteTransform()); + if (mesh) { + rotMatInv.multiplyToRef(mesh.getWorldMatrix(), rotMatInv); + var meshScale = BABYLON.Tmp.Matrix[3]; + BABYLON.Matrix.ScalingToRef(mesh.scaling.x, mesh.scaling.y, mesh.scaling.z, meshScale); + scaleMatrix.multiplyToRef(meshScale, scaleMatrix); + } + rotMatInv.invert(); + scaleMatrix.m[0] *= this._scalingDeterminant; + rotMatInv.multiplyToRef(scaleMatrix, rotMatInv); + } + else { + rotMatInv.copyFrom(this.getLocalMatrix()); + rotMatInv.invert(); + var scaleMatrix = BABYLON.Tmp.Matrix[2]; + scaleMatrix.copyFrom(this._scaleMatrix); + if (this._parent) { + var pscaleMatrix = BABYLON.Tmp.Matrix[3]; + pscaleMatrix.copyFrom(this._parent._scaleMatrix); + pscaleMatrix.invert(); + pscaleMatrix.multiplyToRef(rotMatInv, rotMatInv); + } + else { + scaleMatrix.m[0] *= this._scalingDeterminant; + } + rotMatInv.multiplyToRef(scaleMatrix, rotMatInv); + } + }; + Bone.prototype.getScale = function () { + return this._scaleVector.clone(); + }; + Bone.prototype.getScaleToRef = function (result) { + result.copyFrom(this._scaleVector); + }; + Bone.prototype.getPosition = function (space, mesh) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + var pos = BABYLON.Vector3.Zero(); + this.getPositionToRef(space, mesh, pos); + return pos; + }; + Bone.prototype.getPositionToRef = function (space, mesh, result) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + if (space == BABYLON.Space.LOCAL) { + var lm = this.getLocalMatrix(); + result.x = lm.m[12]; + result.y = lm.m[13]; + result.z = lm.m[14]; + } + else { + this._skeleton.computeAbsoluteTransforms(); + var tmat = BABYLON.Tmp.Matrix[0]; + if (mesh) { + tmat.copyFrom(this.getAbsoluteTransform()); + tmat.multiplyToRef(mesh.getWorldMatrix(), tmat); + } + else { + tmat = this.getAbsoluteTransform(); + } + result.x = tmat.m[12]; + result.y = tmat.m[13]; + result.z = tmat.m[14]; + } + }; + Bone.prototype.getAbsolutePosition = function (mesh) { + var pos = BABYLON.Vector3.Zero(); + this.getPositionToRef(BABYLON.Space.WORLD, mesh, pos); + return pos; + }; + Bone.prototype.getAbsolutePositionToRef = function (mesh, result) { + this.getPositionToRef(BABYLON.Space.WORLD, mesh, result); + }; + Bone.prototype.computeAbsoluteTransforms = function () { + if (this._parent) { + this._matrix.multiplyToRef(this._parent._absoluteTransform, this._absoluteTransform); + } + else { + this._absoluteTransform.copyFrom(this._matrix); + var poseMatrix = this._skeleton.getPoseMatrix(); + if (poseMatrix) { + this._absoluteTransform.multiplyToRef(poseMatrix, this._absoluteTransform); + } + } + var children = this.children; + var len = children.length; + for (var i = 0; i < len; i++) { + children[i].computeAbsoluteTransforms(); + } + }; + Bone.prototype.getDirection = function (localAxis, mesh) { + var result = BABYLON.Vector3.Zero(); + this.getDirectionToRef(localAxis, mesh, result); + return result; + }; + Bone.prototype.getDirectionToRef = function (localAxis, mesh, result) { + this._skeleton.computeAbsoluteTransforms(); + var mat = BABYLON.Tmp.Matrix[0]; + mat.copyFrom(this.getAbsoluteTransform()); + if (mesh) { + mat.multiplyToRef(mesh.getWorldMatrix(), mat); + } + BABYLON.Vector3.TransformNormalToRef(localAxis, mat, result); + result.normalize(); + }; + Bone.prototype.getRotation = function (space, mesh) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + var result = BABYLON.Vector3.Zero(); + this.getRotationToRef(space, mesh, result); + return result; + }; + Bone.prototype.getRotationToRef = function (space, mesh, result) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + var quat = BABYLON.Tmp.Quaternion[0]; + this.getRotationQuaternionToRef(space, mesh, quat); + quat.toEulerAnglesToRef(result); + }; + Bone.prototype.getRotationQuaternion = function (space, mesh) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + var result = BABYLON.Quaternion.Identity(); + this.getRotationQuaternionToRef(space, mesh, result); + return result; + }; + Bone.prototype.getRotationQuaternionToRef = function (space, mesh, result) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + if (space == BABYLON.Space.LOCAL) { + this.getLocalMatrix().decompose(BABYLON.Tmp.Vector3[0], result, BABYLON.Tmp.Vector3[1]); + } + else { + var mat = BABYLON.Tmp.Matrix[0]; + var amat = this.getAbsoluteTransform(); + if (mesh) { + amat.multiplyToRef(mesh.getWorldMatrix(), mat); + } + else { + mat.copyFrom(amat); + } + mat.m[0] *= this._scalingDeterminant; + mat.m[1] *= this._scalingDeterminant; + mat.m[2] *= this._scalingDeterminant; + mat.decompose(BABYLON.Tmp.Vector3[0], result, BABYLON.Tmp.Vector3[1]); + } + }; + Bone.prototype.getRotationMatrix = function (space, mesh) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + var result = BABYLON.Matrix.Identity(); + this.getRotationMatrixToRef(space, mesh, result); + return result; + }; + Bone.prototype.getRotationMatrixToRef = function (space, mesh, result) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + if (space == BABYLON.Space.LOCAL) { + this.getLocalMatrix().getRotationMatrixToRef(result); + } + else { + var mat = BABYLON.Tmp.Matrix[0]; + var amat = this.getAbsoluteTransform(); + if (mesh) { + amat.multiplyToRef(mesh.getWorldMatrix(), mat); + } + else { + mat.copyFrom(amat); + } + mat.m[0] *= this._scalingDeterminant; + mat.m[1] *= this._scalingDeterminant; + mat.m[2] *= this._scalingDeterminant; + mat.getRotationMatrixToRef(result); + } + }; + Bone.prototype.getAbsolutePositionFromLocal = function (position, mesh) { + var result = BABYLON.Vector3.Zero(); + this.getAbsolutePositionFromLocalToRef(position, mesh, result); + return result; + }; + Bone.prototype.getAbsolutePositionFromLocalToRef = function (position, mesh, result) { + this._skeleton.computeAbsoluteTransforms(); + var tmat = BABYLON.Tmp.Matrix[0]; + if (mesh) { + tmat.copyFrom(this.getAbsoluteTransform()); + tmat.multiplyToRef(mesh.getWorldMatrix(), tmat); + } + else { + tmat = this.getAbsoluteTransform(); + } + BABYLON.Vector3.TransformCoordinatesToRef(position, tmat, result); + }; + Bone.prototype.getLocalPositionFromAbsolute = function (position, mesh) { + var result = BABYLON.Vector3.Zero(); + this.getLocalPositionFromAbsoluteToRef(position, mesh, result); + return result; + }; + Bone.prototype.getLocalPositionFromAbsoluteToRef = function (position, mesh, result) { + this._skeleton.computeAbsoluteTransforms(); + var tmat = BABYLON.Tmp.Matrix[0]; + tmat.copyFrom(this.getAbsoluteTransform()); + if (mesh) { + tmat.multiplyToRef(mesh.getWorldMatrix(), tmat); + } + tmat.invert(); + BABYLON.Vector3.TransformCoordinatesToRef(position, tmat, result); + }; + return Bone; + }(BABYLON.Node)); + BABYLON.Bone = Bone; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.bone.js.map + +var BABYLON; +(function (BABYLON) { + var BoneIKController = (function () { + function BoneIKController(mesh, bone, options) { + this.targetPosition = BABYLON.Vector3.Zero(); + this.poleTargetPosition = BABYLON.Vector3.Zero(); + this.poleTargetLocalOffset = BABYLON.Vector3.Zero(); + this.poleAngle = 0; + this.slerpAmount = 1; + this._bone1Quat = BABYLON.Quaternion.Identity(); + this._bone1Mat = BABYLON.Matrix.Identity(); + this._bone2Ang = Math.PI; + this._maxAngle = Math.PI; + this._tmpVec1 = BABYLON.Vector3.Zero(); + this._tmpVec2 = BABYLON.Vector3.Zero(); + this._tmpVec3 = BABYLON.Vector3.Zero(); + this._tmpVec4 = BABYLON.Vector3.Zero(); + this._tmpVec5 = BABYLON.Vector3.Zero(); + this._tmpMat1 = BABYLON.Matrix.Identity(); + this._tmpMat2 = BABYLON.Matrix.Identity(); + this._tmpQuat1 = BABYLON.Quaternion.Identity(); + this._rightHandedSystem = false; + this._bendAxis = BABYLON.Vector3.Right(); + this._slerping = false; + this._bone2 = bone; + this._bone1 = bone.getParent(); + this.mesh = mesh; + if (bone.getAbsoluteTransform().determinant() > 0) { + this._rightHandedSystem = true; + this._bendAxis.x = 0; + this._bendAxis.y = 0; + this._bendAxis.z = 1; + } + if (this._bone1.length) { + var boneScale1 = this._bone1.getScale(); + var boneScale2 = this._bone2.getScale(); + this._bone1Length = this._bone1.length * boneScale1.y * this.mesh.scaling.y; + this._bone2Length = this._bone2.length * boneScale2.y * this.mesh.scaling.y; + } + else if (this._bone1.children[0]) { + mesh.computeWorldMatrix(true); + var pos1 = this._bone2.children[0].getAbsolutePosition(mesh); + var pos2 = this._bone2.getAbsolutePosition(mesh); + var pos3 = this._bone1.getAbsolutePosition(mesh); + this._bone1Length = BABYLON.Vector3.Distance(pos1, pos2); + this._bone2Length = BABYLON.Vector3.Distance(pos2, pos3); + } + this._bone1.getRotationMatrixToRef(BABYLON.Space.WORLD, mesh, this._bone1Mat); + this.maxAngle = Math.PI; + if (options) { + if (options.targetMesh) { + this.targetMesh = options.targetMesh; + this.targetMesh.computeWorldMatrix(true); + } + if (options.poleTargetMesh) { + this.poleTargetMesh = options.poleTargetMesh; + this.poleTargetMesh.computeWorldMatrix(true); + } + else if (options.poleTargetBone) { + this.poleTargetBone = options.poleTargetBone; + } + else if (this._bone1.getParent()) { + this.poleTargetBone = this._bone1.getParent(); + } + if (options.poleTargetLocalOffset) { + this.poleTargetLocalOffset.copyFrom(options.poleTargetLocalOffset); + } + if (options.poleAngle) { + this.poleAngle = options.poleAngle; + } + if (options.bendAxis) { + this._bendAxis.copyFrom(options.bendAxis); + } + if (options.maxAngle) { + this.maxAngle = options.maxAngle; + } + if (options.slerpAmount) { + this.slerpAmount = options.slerpAmount; + } + } + } + Object.defineProperty(BoneIKController.prototype, "maxAngle", { + get: function () { + return this._maxAngle; + }, + set: function (value) { + this._setMaxAngle(value); + }, + enumerable: true, + configurable: true + }); + BoneIKController.prototype._setMaxAngle = function (ang) { + if (ang < 0) { + ang = 0; + } + if (ang > Math.PI || ang == undefined) { + ang = Math.PI; + } + this._maxAngle = ang; + var a = this._bone1Length; + var b = this._bone2Length; + this._maxReach = Math.sqrt(a * a + b * b - 2 * a * b * Math.cos(ang)); + }; + BoneIKController.prototype.update = function () { + var bone1 = this._bone1; + var target = this.targetPosition; + var poleTarget = this.poleTargetPosition; + var mat1 = this._tmpMat1; + var mat2 = this._tmpMat2; + if (this.targetMesh) { + target.copyFrom(this.targetMesh.getAbsolutePosition()); + } + if (this.poleTargetBone) { + this.poleTargetBone.getAbsolutePositionFromLocalToRef(this.poleTargetLocalOffset, this.mesh, poleTarget); + } + else if (this.poleTargetMesh) { + BABYLON.Vector3.TransformCoordinatesToRef(this.poleTargetLocalOffset, this.poleTargetMesh.getWorldMatrix(), poleTarget); + } + var bonePos = this._tmpVec1; + var zaxis = this._tmpVec2; + var xaxis = this._tmpVec3; + var yaxis = this._tmpVec4; + var upAxis = this._tmpVec5; + bone1.getAbsolutePositionToRef(this.mesh, bonePos); + poleTarget.subtractToRef(bonePos, upAxis); + if (upAxis.x == 0 && upAxis.y == 0 && upAxis.z == 0) { + upAxis.y = 1; + } + else { + upAxis.normalize(); + } + target.subtractToRef(bonePos, yaxis); + yaxis.normalize(); + BABYLON.Vector3.CrossToRef(yaxis, upAxis, zaxis); + zaxis.normalize(); + BABYLON.Vector3.CrossToRef(yaxis, zaxis, xaxis); + xaxis.normalize(); + BABYLON.Matrix.FromXYZAxesToRef(xaxis, yaxis, zaxis, mat1); + var a = this._bone1Length; + var b = this._bone2Length; + var c = BABYLON.Vector3.Distance(bonePos, target); + if (this._maxReach > 0) { + c = Math.min(this._maxReach, c); + } + var acosa = (b * b + c * c - a * a) / (2 * b * c); + var acosb = (c * c + a * a - b * b) / (2 * c * a); + if (acosa > 1) { + acosa = 1; + } + if (acosb > 1) { + acosb = 1; + } + if (acosa < -1) { + acosa = -1; + } + if (acosb < -1) { + acosb = -1; + } + var angA = Math.acos(acosa); + var angB = Math.acos(acosb); + var angC = -angA - angB; + if (this._rightHandedSystem) { + BABYLON.Matrix.RotationYawPitchRollToRef(0, 0, Math.PI * .5, mat2); + mat2.multiplyToRef(mat1, mat1); + BABYLON.Matrix.RotationAxisToRef(this._bendAxis, angB, mat2); + mat2.multiplyToRef(mat1, mat1); + } + else { + this._tmpVec1.copyFrom(this._bendAxis); + this._tmpVec1.x *= -1; + BABYLON.Matrix.RotationAxisToRef(this._tmpVec1, -angB, mat2); + mat2.multiplyToRef(mat1, mat1); + } + if (this.poleAngle) { + BABYLON.Matrix.RotationAxisToRef(yaxis, this.poleAngle, mat2); + mat1.multiplyToRef(mat2, mat1); + } + if (this.slerpAmount < 1) { + if (!this._slerping) { + BABYLON.Quaternion.FromRotationMatrixToRef(this._bone1Mat, this._bone1Quat); + } + BABYLON.Quaternion.FromRotationMatrixToRef(mat1, this._tmpQuat1); + BABYLON.Quaternion.SlerpToRef(this._bone1Quat, this._tmpQuat1, this.slerpAmount, this._bone1Quat); + angC = this._bone2Ang * (1.0 - this.slerpAmount) + angC * this.slerpAmount; + this._bone1.setRotationQuaternion(this._bone1Quat, BABYLON.Space.WORLD, this.mesh); + this._slerping = true; + } + else { + this._bone1.setRotationMatrix(mat1, BABYLON.Space.WORLD, this.mesh); + this._bone1Mat.copyFrom(mat1); + this._slerping = false; + } + this._bone2.setAxisAngle(this._bendAxis, angC, BABYLON.Space.LOCAL); + this._bone2Ang = angC; + }; + return BoneIKController; + }()); + BABYLON.BoneIKController = BoneIKController; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.boneIKController.js.map + +var BABYLON; +(function (BABYLON) { + var BoneLookController = (function () { + function BoneLookController(mesh, bone, target, options) { + this.upAxis = BABYLON.Vector3.Up(); + this.adjustYaw = 0; + this.adjustPitch = 0; + this.adjustRoll = 0; + this._tmpVec1 = BABYLON.Vector3.Zero(); + this._tmpVec2 = BABYLON.Vector3.Zero(); + this._tmpVec3 = BABYLON.Vector3.Zero(); + this._tmpVec4 = BABYLON.Vector3.Zero(); + this._tmpMat1 = BABYLON.Matrix.Identity(); + this._tmpMat2 = BABYLON.Matrix.Identity(); + this.mesh = mesh; + this.bone = bone; + this.target = target; + if (options) { + if (options.adjustYaw) { + this.adjustYaw = options.adjustYaw; + } + if (options.adjustPitch) { + this.adjustPitch = options.adjustPitch; + } + if (options.adjustRoll) { + this.adjustRoll = options.adjustRoll; + } + } + } + BoneLookController.prototype.update = function () { + var bone = this.bone; + var target = this.target; + var bonePos = this._tmpVec1; + var zaxis = this._tmpVec2; + var xaxis = this._tmpVec3; + var yaxis = this._tmpVec4; + var mat1 = this._tmpMat1; + var mat2 = this._tmpMat2; + bone.getAbsolutePositionToRef(this.mesh, bonePos); + target.subtractToRef(bonePos, zaxis); + zaxis.normalize(); + BABYLON.Vector3.CrossToRef(this.upAxis, zaxis, xaxis); + xaxis.normalize(); + BABYLON.Vector3.CrossToRef(zaxis, xaxis, yaxis); + yaxis.normalize(); + BABYLON.Matrix.FromXYZAxesToRef(xaxis, yaxis, zaxis, mat1); + if (this.adjustYaw || this.adjustPitch || this.adjustRoll) { + BABYLON.Matrix.RotationYawPitchRollToRef(this.adjustYaw, this.adjustPitch, this.adjustRoll, mat2); + mat2.multiplyToRef(mat1, mat1); + } + this.bone.setRotationMatrix(mat1, BABYLON.Space.WORLD, this.mesh); + }; + return BoneLookController; + }()); + BABYLON.BoneLookController = BoneLookController; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.boneLookController.js.map + +var BABYLON; +(function (BABYLON) { + var Skeleton = (function () { + function Skeleton(name, id, scene) { + this.name = name; + this.id = id; + this.bones = new Array(); + this.needInitialSkinMatrix = false; + this._isDirty = true; + this._meshesWithPoseMatrix = new Array(); + this._identity = BABYLON.Matrix.Identity(); + this._ranges = {}; + this._lastAbsoluteTransformsUpdateId = -1; + this.bones = []; + this._scene = scene; + scene.skeletons.push(this); + //make sure it will recalculate the matrix next time prepare is called. + this._isDirty = true; + } + // Members + Skeleton.prototype.getTransformMatrices = function (mesh) { + if (this.needInitialSkinMatrix && mesh._bonesTransformMatrices) { + return mesh._bonesTransformMatrices; + } + return this._transformMatrices; + }; + Skeleton.prototype.getScene = function () { + return this._scene; + }; + // Methods + /** + * @param {boolean} fullDetails - support for multiple levels of logging within scene loading + */ + Skeleton.prototype.toString = function (fullDetails) { + var ret = "Name: " + this.name + ", nBones: " + this.bones.length; + ret += ", nAnimationRanges: " + (this._ranges ? Object.keys(this._ranges).length : "none"); + if (fullDetails) { + ret += ", Ranges: {"; + var first = true; + for (var name_1 in this._ranges) { + if (first) { + ret += ", "; + first = false; + } + ret += name_1; + } + ret += "}"; + } + return ret; + }; + /** + * Get bone's index searching by name + * @param {string} name is bone's name to search for + * @return {number} Indice of the bone. Returns -1 if not found + */ + Skeleton.prototype.getBoneIndexByName = function (name) { + for (var boneIndex = 0, cache = this.bones.length; boneIndex < cache; boneIndex++) { + if (this.bones[boneIndex].name === name) { + return boneIndex; + } + } + return -1; + }; + Skeleton.prototype.createAnimationRange = function (name, from, to) { + // check name not already in use + if (!this._ranges[name]) { + this._ranges[name] = new BABYLON.AnimationRange(name, from, to); + for (var i = 0, nBones = this.bones.length; i < nBones; i++) { + if (this.bones[i].animations[0]) { + this.bones[i].animations[0].createRange(name, from, to); + } + } + } + }; + Skeleton.prototype.deleteAnimationRange = function (name, deleteFrames) { + if (deleteFrames === void 0) { deleteFrames = true; } + for (var i = 0, nBones = this.bones.length; i < nBones; i++) { + if (this.bones[i].animations[0]) { + this.bones[i].animations[0].deleteRange(name, deleteFrames); + } + } + this._ranges[name] = undefined; // said much faster than 'delete this._range[name]' + }; + Skeleton.prototype.getAnimationRange = function (name) { + return this._ranges[name]; + }; + /** + * Returns as an Array, all AnimationRanges defined on this skeleton + */ + Skeleton.prototype.getAnimationRanges = function () { + var animationRanges = []; + var name; + var i = 0; + for (name in this._ranges) { + animationRanges[i] = this._ranges[name]; + i++; + } + return animationRanges; + }; + /** + * note: This is not for a complete retargeting, only between very similar skeleton's with only possible bone length differences + */ + Skeleton.prototype.copyAnimationRange = function (source, name, rescaleAsRequired) { + if (rescaleAsRequired === void 0) { rescaleAsRequired = false; } + if (this._ranges[name] || !source.getAnimationRange(name)) { + return false; + } + var ret = true; + var frameOffset = this._getHighestAnimationFrame() + 1; + // make a dictionary of source skeleton's bones, so exact same order or doublely nested loop is not required + var boneDict = {}; + var sourceBones = source.bones; + var nBones; + var i; + for (i = 0, nBones = sourceBones.length; i < nBones; i++) { + boneDict[sourceBones[i].name] = sourceBones[i]; + } + if (this.bones.length !== sourceBones.length) { + BABYLON.Tools.Warn("copyAnimationRange: this rig has " + this.bones.length + " bones, while source as " + sourceBones.length); + ret = false; + } + var skelDimensionsRatio = (rescaleAsRequired && this.dimensionsAtRest && source.dimensionsAtRest) ? this.dimensionsAtRest.divide(source.dimensionsAtRest) : null; + for (i = 0, nBones = this.bones.length; i < nBones; i++) { + var boneName = this.bones[i].name; + var sourceBone = boneDict[boneName]; + if (sourceBone) { + ret = ret && this.bones[i].copyAnimationRange(sourceBone, name, frameOffset, rescaleAsRequired, skelDimensionsRatio); + } + else { + BABYLON.Tools.Warn("copyAnimationRange: not same rig, missing source bone " + boneName); + ret = false; + } + } + // do not call createAnimationRange(), since it also is done to bones, which was already done + var range = source.getAnimationRange(name); + this._ranges[name] = new BABYLON.AnimationRange(name, range.from + frameOffset, range.to + frameOffset); + return ret; + }; + Skeleton.prototype.returnToRest = function () { + for (var index = 0; index < this.bones.length; index++) { + this.bones[index].returnToRest(); + } + }; + Skeleton.prototype._getHighestAnimationFrame = function () { + var ret = 0; + for (var i = 0, nBones = this.bones.length; i < nBones; i++) { + if (this.bones[i].animations[0]) { + var highest = this.bones[i].animations[0].getHighestFrame(); + if (ret < highest) { + ret = highest; + } + } + } + return ret; + }; + Skeleton.prototype.beginAnimation = function (name, loop, speedRatio, onAnimationEnd) { + var range = this.getAnimationRange(name); + if (!range) { + return null; + } + return this._scene.beginAnimation(this, range.from, range.to, loop, speedRatio, onAnimationEnd); + }; + Skeleton.prototype._markAsDirty = function () { + this._isDirty = true; + }; + Skeleton.prototype._registerMeshWithPoseMatrix = function (mesh) { + this._meshesWithPoseMatrix.push(mesh); + }; + Skeleton.prototype._unregisterMeshWithPoseMatrix = function (mesh) { + var index = this._meshesWithPoseMatrix.indexOf(mesh); + if (index > -1) { + this._meshesWithPoseMatrix.splice(index, 1); + } + }; + Skeleton.prototype._computeTransformMatrices = function (targetMatrix, initialSkinMatrix) { + for (var index = 0; index < this.bones.length; index++) { + var bone = this.bones[index]; + var parentBone = bone.getParent(); + if (parentBone) { + bone.getLocalMatrix().multiplyToRef(parentBone.getWorldMatrix(), bone.getWorldMatrix()); + } + else { + if (initialSkinMatrix) { + bone.getLocalMatrix().multiplyToRef(initialSkinMatrix, bone.getWorldMatrix()); + } + else { + bone.getWorldMatrix().copyFrom(bone.getLocalMatrix()); + } + } + bone.getInvertedAbsoluteTransform().multiplyToArray(bone.getWorldMatrix(), targetMatrix, index * 16); + } + this._identity.copyToArray(targetMatrix, this.bones.length * 16); + }; + Skeleton.prototype.prepare = function () { + if (!this._isDirty) { + return; + } + if (this.needInitialSkinMatrix) { + for (var index = 0; index < this._meshesWithPoseMatrix.length; index++) { + var mesh = this._meshesWithPoseMatrix[index]; + if (!mesh._bonesTransformMatrices || mesh._bonesTransformMatrices.length !== 16 * (this.bones.length + 1)) { + mesh._bonesTransformMatrices = new Float32Array(16 * (this.bones.length + 1)); + } + var poseMatrix = mesh.getPoseMatrix(); + // Prepare bones + for (var boneIndex = 0; boneIndex < this.bones.length; boneIndex++) { + var bone = this.bones[boneIndex]; + if (!bone.getParent()) { + var matrix = bone.getBaseMatrix(); + matrix.multiplyToRef(poseMatrix, BABYLON.Tmp.Matrix[0]); + bone._updateDifferenceMatrix(BABYLON.Tmp.Matrix[0]); + } + } + this._computeTransformMatrices(mesh._bonesTransformMatrices, poseMatrix); + } + } + else { + if (!this._transformMatrices || this._transformMatrices.length !== 16 * (this.bones.length + 1)) { + this._transformMatrices = new Float32Array(16 * (this.bones.length + 1)); + } + this._computeTransformMatrices(this._transformMatrices, null); + } + this._isDirty = false; + this._scene._activeBones.addCount(this.bones.length, false); + }; + Skeleton.prototype.getAnimatables = function () { + if (!this._animatables || this._animatables.length !== this.bones.length) { + this._animatables = []; + for (var index = 0; index < this.bones.length; index++) { + this._animatables.push(this.bones[index]); + } + } + return this._animatables; + }; + Skeleton.prototype.clone = function (name, id) { + var result = new Skeleton(name, id || name, this._scene); + result.needInitialSkinMatrix = this.needInitialSkinMatrix; + for (var index = 0; index < this.bones.length; index++) { + var source = this.bones[index]; + var parentBone = null; + if (source.getParent()) { + var parentIndex = this.bones.indexOf(source.getParent()); + parentBone = result.bones[parentIndex]; + } + var bone = new BABYLON.Bone(source.name, result, parentBone, source.getBaseMatrix().clone(), source.getRestPose().clone()); + BABYLON.Tools.DeepCopy(source.animations, bone.animations); + } + if (this._ranges) { + result._ranges = {}; + for (var rangeName in this._ranges) { + result._ranges[rangeName] = this._ranges[rangeName].clone(); + } + } + this._isDirty = true; + return result; + }; + Skeleton.prototype.enableBlending = function (blendingSpeed) { + if (blendingSpeed === void 0) { blendingSpeed = 0.01; } + this.bones.forEach(function (bone) { + bone.animations.forEach(function (animation) { + animation.enableBlending = true; + animation.blendingSpeed = blendingSpeed; + }); + }); + }; + Skeleton.prototype.dispose = function () { + this._meshesWithPoseMatrix = []; + // Animations + this.getScene().stopAnimation(this); + // Remove from scene + this.getScene().removeSkeleton(this); + }; + Skeleton.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.name = this.name; + serializationObject.id = this.id; + serializationObject.dimensionsAtRest = this.dimensionsAtRest; + serializationObject.bones = []; + serializationObject.needInitialSkinMatrix = this.needInitialSkinMatrix; + for (var index = 0; index < this.bones.length; index++) { + var bone = this.bones[index]; + var serializedBone = { + parentBoneIndex: bone.getParent() ? this.bones.indexOf(bone.getParent()) : -1, + name: bone.name, + matrix: bone.getLocalMatrix().toArray(), + rest: bone.getRestPose().toArray() + }; + serializationObject.bones.push(serializedBone); + if (bone.length) { + serializedBone.length = bone.length; + } + if (bone.animations && bone.animations.length > 0) { + serializedBone.animation = bone.animations[0].serialize(); + } + serializationObject.ranges = []; + for (var name in this._ranges) { + var range = {}; + range.name = name; + range.from = this._ranges[name].from; + range.to = this._ranges[name].to; + serializationObject.ranges.push(range); + } + } + return serializationObject; + }; + Skeleton.Parse = function (parsedSkeleton, scene) { + var skeleton = new Skeleton(parsedSkeleton.name, parsedSkeleton.id, scene); + if (parsedSkeleton.dimensionsAtRest) { + skeleton.dimensionsAtRest = BABYLON.Vector3.FromArray(parsedSkeleton.dimensionsAtRest); + } + skeleton.needInitialSkinMatrix = parsedSkeleton.needInitialSkinMatrix; + var index; + for (index = 0; index < parsedSkeleton.bones.length; index++) { + var parsedBone = parsedSkeleton.bones[index]; + var parentBone = null; + if (parsedBone.parentBoneIndex > -1) { + parentBone = skeleton.bones[parsedBone.parentBoneIndex]; + } + var rest = parsedBone.rest ? BABYLON.Matrix.FromArray(parsedBone.rest) : null; + var bone = new BABYLON.Bone(parsedBone.name, skeleton, parentBone, BABYLON.Matrix.FromArray(parsedBone.matrix), rest); + if (parsedBone.length) { + bone.length = parsedBone.length; + } + if (parsedBone.animation) { + bone.animations.push(BABYLON.Animation.Parse(parsedBone.animation)); + } + } + // placed after bones, so createAnimationRange can cascade down + if (parsedSkeleton.ranges) { + for (index = 0; index < parsedSkeleton.ranges.length; index++) { + var data = parsedSkeleton.ranges[index]; + skeleton.createAnimationRange(data.name, data.from, data.to); + } + } + return skeleton; + }; + Skeleton.prototype.computeAbsoluteTransforms = function (forceUpdate) { + if (forceUpdate === void 0) { forceUpdate = false; } + var renderId = this._scene.getRenderId(); + if (this._lastAbsoluteTransformsUpdateId != renderId || forceUpdate) { + this.bones[0].computeAbsoluteTransforms(); + this._lastAbsoluteTransformsUpdateId = renderId; + } + }; + Skeleton.prototype.getPoseMatrix = function () { + var poseMatrix; + if (this._meshesWithPoseMatrix.length > 0) { + poseMatrix = this._meshesWithPoseMatrix[0].getPoseMatrix(); + } + return poseMatrix; + }; + return Skeleton; + }()); + BABYLON.Skeleton = Skeleton; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.skeleton.js.map + +var BABYLON; +(function (BABYLON) { + var PostProcess = (function () { + function PostProcess(name, fragmentUrl, parameters, samplers, options, camera, samplingMode, engine, reusable, defines, textureType) { + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE; } + if (textureType === void 0) { textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; } + this.name = name; + this.width = -1; + this.height = -1; + /* + Enable Pixel Perfect mode where texture is not scaled to be power of 2. + Can only be used on a single postprocess or on the last one of a chain. + */ + this.enablePixelPerfectMode = false; + this._reusable = false; + this._textures = new BABYLON.SmartArray(2); + this._currentRenderTextureInd = 0; + this._scaleRatio = new BABYLON.Vector2(1, 1); + // Events + /** + * An event triggered when the postprocess is activated. + * @type {BABYLON.Observable} + */ + this.onActivateObservable = new BABYLON.Observable(); + /** + * An event triggered when the postprocess changes its size. + * @type {BABYLON.Observable} + */ + this.onSizeChangedObservable = new BABYLON.Observable(); + /** + * An event triggered when the postprocess applies its effect. + * @type {BABYLON.Observable} + */ + this.onApplyObservable = new BABYLON.Observable(); + /** + * An event triggered before rendering the postprocess + * @type {BABYLON.Observable} + */ + this.onBeforeRenderObservable = new BABYLON.Observable(); + /** + * An event triggered after rendering the postprocess + * @type {BABYLON.Observable} + */ + this.onAfterRenderObservable = new BABYLON.Observable(); + if (camera != null) { + this._camera = camera; + this._scene = camera.getScene(); + camera.attachPostProcess(this); + this._engine = this._scene.getEngine(); + } + else { + this._engine = engine; + } + this._options = options; + this.renderTargetSamplingMode = samplingMode ? samplingMode : BABYLON.Texture.NEAREST_SAMPLINGMODE; + this._reusable = reusable || false; + this._textureType = textureType; + this._samplers = samplers || []; + this._samplers.push("textureSampler"); + this._fragmentUrl = fragmentUrl; + this._parameters = parameters || []; + this._parameters.push("scale"); + this.updateEffect(defines); + } + Object.defineProperty(PostProcess.prototype, "onActivate", { + set: function (callback) { + if (this._onActivateObserver) { + this.onActivateObservable.remove(this._onActivateObserver); + } + this._onActivateObserver = this.onActivateObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PostProcess.prototype, "onSizeChanged", { + set: function (callback) { + if (this._onSizeChangedObserver) { + this.onSizeChangedObservable.remove(this._onSizeChangedObserver); + } + this._onSizeChangedObserver = this.onSizeChangedObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PostProcess.prototype, "onApply", { + set: function (callback) { + if (this._onApplyObserver) { + this.onApplyObservable.remove(this._onApplyObserver); + } + this._onApplyObserver = this.onApplyObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PostProcess.prototype, "onBeforeRender", { + set: function (callback) { + if (this._onBeforeRenderObserver) { + this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver); + } + this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PostProcess.prototype, "onAfterRender", { + set: function (callback) { + if (this._onAfterRenderObserver) { + this.onAfterRenderObservable.remove(this._onAfterRenderObserver); + } + this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + PostProcess.prototype.updateEffect = function (defines) { + this._effect = this._engine.createEffect({ vertex: "postprocess", fragment: this._fragmentUrl }, ["position"], this._parameters, this._samplers, defines !== undefined ? defines : ""); + }; + PostProcess.prototype.isReusable = function () { + return this._reusable; + }; + /** invalidate frameBuffer to hint the postprocess to create a depth buffer */ + PostProcess.prototype.markTextureDirty = function () { + this.width = -1; + }; + PostProcess.prototype.activate = function (camera, sourceTexture) { + camera = camera || this._camera; + var scene = camera.getScene(); + var maxSize = camera.getEngine().getCaps().maxTextureSize; + var requiredWidth = ((sourceTexture ? sourceTexture._width : this._engine.getRenderingCanvas().width) * this._options) | 0; + var requiredHeight = ((sourceTexture ? sourceTexture._height : this._engine.getRenderingCanvas().height) * this._options) | 0; + var desiredWidth = this._options.width || requiredWidth; + var desiredHeight = this._options.height || requiredHeight; + if (this.renderTargetSamplingMode !== BABYLON.Texture.NEAREST_SAMPLINGMODE) { + if (!this._options.width) { + desiredWidth = BABYLON.Tools.GetExponentOfTwo(desiredWidth, maxSize); + } + if (!this._options.height) { + desiredHeight = BABYLON.Tools.GetExponentOfTwo(desiredHeight, maxSize); + } + } + if (this.width !== desiredWidth || this.height !== desiredHeight) { + if (this._textures.length > 0) { + for (var i = 0; i < this._textures.length; i++) { + this._engine._releaseTexture(this._textures.data[i]); + } + this._textures.reset(); + } + this.width = desiredWidth; + this.height = desiredHeight; + var textureSize = { width: this.width, height: this.height }; + var textureOptions = { + generateMipMaps: false, + generateDepthBuffer: camera._postProcesses.indexOf(this) === 0, + generateStencilBuffer: camera._postProcesses.indexOf(this) === 0 && this._engine.isStencilEnable, + samplingMode: this.renderTargetSamplingMode, + type: this._textureType + }; + this._textures.push(this._engine.createRenderTargetTexture(textureSize, textureOptions)); + if (this._reusable) { + this._textures.push(this._engine.createRenderTargetTexture(textureSize, textureOptions)); + } + this.onSizeChangedObservable.notifyObservers(this); + } + if (this.enablePixelPerfectMode) { + this._scaleRatio.copyFromFloats(requiredWidth / desiredWidth, requiredHeight / desiredHeight); + this._engine.bindFramebuffer(this._textures.data[this._currentRenderTextureInd], 0, requiredWidth, requiredHeight); + } + else { + this._scaleRatio.copyFromFloats(1, 1); + this._engine.bindFramebuffer(this._textures.data[this._currentRenderTextureInd]); + } + this.onActivateObservable.notifyObservers(camera); + // Clear + if (this.clearColor) { + this._engine.clear(this.clearColor, true, true, true); + } + else { + this._engine.clear(scene.clearColor, scene.autoClear || scene.forceWireframe, true, true); + } + if (this._reusable) { + this._currentRenderTextureInd = (this._currentRenderTextureInd + 1) % 2; + } + }; + Object.defineProperty(PostProcess.prototype, "isSupported", { + get: function () { + return this._effect.isSupported; + }, + enumerable: true, + configurable: true + }); + PostProcess.prototype.apply = function () { + // Check + if (!this._effect.isReady()) + return null; + // States + this._engine.enableEffect(this._effect); + this._engine.setState(false); + this._engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE); + this._engine.setDepthBuffer(false); + this._engine.setDepthWrite(false); + // Texture + this._effect._bindTexture("textureSampler", this._textures.data[this._currentRenderTextureInd]); + // Parameters + this._effect.setVector2("scale", this._scaleRatio); + this.onApplyObservable.notifyObservers(this._effect); + return this._effect; + }; + PostProcess.prototype.dispose = function (camera) { + camera = camera || this._camera; + if (this._textures.length > 0) { + for (var i = 0; i < this._textures.length; i++) { + this._engine._releaseTexture(this._textures.data[i]); + } + this._textures.reset(); + } + if (!camera) { + return; + } + camera.detachPostProcess(this); + var index = camera._postProcesses.indexOf(this); + if (index === 0 && camera._postProcesses.length > 0) { + this._camera._postProcesses[0].markTextureDirty(); + } + this.onActivateObservable.clear(); + this.onAfterRenderObservable.clear(); + this.onApplyObservable.clear(); + this.onBeforeRenderObservable.clear(); + this.onSizeChangedObservable.clear(); + }; + return PostProcess; + }()); + BABYLON.PostProcess = PostProcess; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.postProcess.js.map + +var BABYLON; +(function (BABYLON) { + var PostProcessManager = (function () { + function PostProcessManager(scene) { + this._vertexBuffers = {}; + this._scene = scene; + } + PostProcessManager.prototype._prepareBuffers = function () { + if (this._vertexBuffers[BABYLON.VertexBuffer.PositionKind]) { + return; + } + // VBO + var vertices = []; + vertices.push(1, 1); + vertices.push(-1, 1); + vertices.push(-1, -1); + vertices.push(1, -1); + this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = new BABYLON.VertexBuffer(this._scene.getEngine(), vertices, BABYLON.VertexBuffer.PositionKind, false, false, 2); + // Indices + var indices = []; + indices.push(0); + indices.push(1); + indices.push(2); + indices.push(0); + indices.push(2); + indices.push(3); + this._indexBuffer = this._scene.getEngine().createIndexBuffer(indices); + }; + // Methods + PostProcessManager.prototype._prepareFrame = function (sourceTexture) { + var postProcesses = this._scene.activeCamera._postProcesses; + if (postProcesses.length === 0 || !this._scene.postProcessesEnabled) { + return false; + } + postProcesses[0].activate(this._scene.activeCamera, sourceTexture); + return true; + }; + PostProcessManager.prototype.directRender = function (postProcesses, targetTexture) { + var engine = this._scene.getEngine(); + for (var index = 0; index < postProcesses.length; index++) { + if (index < postProcesses.length - 1) { + postProcesses[index + 1].activate(this._scene.activeCamera, targetTexture); + } + else { + if (targetTexture) { + engine.bindFramebuffer(targetTexture); + } + else { + engine.restoreDefaultFramebuffer(); + } + } + var pp = postProcesses[index]; + var effect = pp.apply(); + if (effect) { + pp.onBeforeRenderObservable.notifyObservers(effect); + // VBOs + this._prepareBuffers(); + engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect); + // Draw order + engine.draw(true, 0, 6); + pp.onAfterRenderObservable.notifyObservers(effect); + } + } + // Restore depth buffer + engine.setDepthBuffer(true); + engine.setDepthWrite(true); + }; + PostProcessManager.prototype._finalizeFrame = function (doNotPresent, targetTexture, faceIndex, postProcesses) { + postProcesses = postProcesses || this._scene.activeCamera._postProcesses; + if (postProcesses.length === 0 || !this._scene.postProcessesEnabled) { + return; + } + var engine = this._scene.getEngine(); + for (var index = 0, len = postProcesses.length; index < len; index++) { + if (index < len - 1) { + postProcesses[index + 1].activate(this._scene.activeCamera, targetTexture); + } + else { + if (targetTexture) { + engine.bindFramebuffer(targetTexture, faceIndex); + } + else { + engine.restoreDefaultFramebuffer(); + } + } + if (doNotPresent) { + break; + } + var pp = postProcesses[index]; + var effect = pp.apply(); + if (effect) { + pp.onBeforeRenderObservable.notifyObservers(effect); + // VBOs + this._prepareBuffers(); + engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect); + // Draw order + engine.draw(true, 0, 6); + pp.onAfterRenderObservable.notifyObservers(effect); + } + } + // Restore depth buffer + engine.setDepthBuffer(true); + engine.setDepthWrite(true); + }; + PostProcessManager.prototype.dispose = function () { + var buffer = this._vertexBuffers[BABYLON.VertexBuffer.PositionKind]; + if (buffer) { + buffer.dispose(); + this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = null; + } + if (this._indexBuffer) { + this._scene.getEngine()._releaseBuffer(this._indexBuffer); + this._indexBuffer = null; + } + }; + return PostProcessManager; + }()); + BABYLON.PostProcessManager = PostProcessManager; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.postProcessManager.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var PassPostProcess = (function (_super) { + __extends(PassPostProcess, _super); + function PassPostProcess(name, options, camera, samplingMode, engine, reusable) { + _super.call(this, name, "pass", null, null, options, camera, samplingMode, engine, reusable); + } + return PassPostProcess; + }(BABYLON.PostProcess)); + BABYLON.PassPostProcess = PassPostProcess; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.passPostProcess.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * This is a holder class for the physics joint created by the physics plugin. + * It holds a set of functions to control the underlying joint. + */ + var PhysicsJoint = (function () { + function PhysicsJoint(type, jointData) { + this.type = type; + this.jointData = jointData; + jointData.nativeParams = jointData.nativeParams || {}; + } + Object.defineProperty(PhysicsJoint.prototype, "physicsJoint", { + get: function () { + return this._physicsJoint; + }, + set: function (newJoint) { + if (this._physicsJoint) { + } + this._physicsJoint = newJoint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PhysicsJoint.prototype, "physicsPlugin", { + set: function (physicsPlugin) { + this._physicsPlugin = physicsPlugin; + }, + enumerable: true, + configurable: true + }); + /** + * Execute a function that is physics-plugin specific. + * @param {Function} func the function that will be executed. + * It accepts two parameters: the physics world and the physics joint. + */ + PhysicsJoint.prototype.executeNativeFunction = function (func) { + func(this._physicsPlugin.world, this._physicsJoint); + }; + //TODO check if the native joints are the same + //Joint Types + PhysicsJoint.DistanceJoint = 0; + PhysicsJoint.HingeJoint = 1; + PhysicsJoint.BallAndSocketJoint = 2; + PhysicsJoint.WheelJoint = 3; + PhysicsJoint.SliderJoint = 4; + //OIMO + PhysicsJoint.PrismaticJoint = 5; + //ENERGY FTW! (compare with this - http://ode-wiki.org/wiki/index.php?title=Manual:_Joint_Types_and_Functions) + PhysicsJoint.UniversalJoint = 6; + PhysicsJoint.Hinge2Joint = PhysicsJoint.WheelJoint; + //Cannon + //Similar to a Ball-Joint. Different in params + PhysicsJoint.PointToPointJoint = 8; + //Cannon only at the moment + PhysicsJoint.SpringJoint = 9; + PhysicsJoint.LockJoint = 10; + return PhysicsJoint; + }()); + BABYLON.PhysicsJoint = PhysicsJoint; + /** + * A class representing a physics distance joint. + */ + var DistanceJoint = (function (_super) { + __extends(DistanceJoint, _super); + function DistanceJoint(jointData) { + _super.call(this, PhysicsJoint.DistanceJoint, jointData); + } + /** + * Update the predefined distance. + */ + DistanceJoint.prototype.updateDistance = function (maxDistance, minDistance) { + this._physicsPlugin.updateDistanceJoint(this, maxDistance, minDistance); + }; + return DistanceJoint; + }(PhysicsJoint)); + BABYLON.DistanceJoint = DistanceJoint; + var MotorEnabledJoint = (function (_super) { + __extends(MotorEnabledJoint, _super); + function MotorEnabledJoint(type, jointData) { + _super.call(this, type, jointData); + } + /** + * Set the motor values. + * Attention, this function is plugin specific. Engines won't react 100% the same. + * @param {number} force the force to apply + * @param {number} maxForce max force for this motor. + */ + MotorEnabledJoint.prototype.setMotor = function (force, maxForce) { + this._physicsPlugin.setMotor(this, force, maxForce); + }; + /** + * Set the motor's limits. + * Attention, this function is plugin specific. Engines won't react 100% the same. + */ + MotorEnabledJoint.prototype.setLimit = function (upperLimit, lowerLimit) { + this._physicsPlugin.setLimit(this, upperLimit, lowerLimit); + }; + return MotorEnabledJoint; + }(PhysicsJoint)); + BABYLON.MotorEnabledJoint = MotorEnabledJoint; + /** + * This class represents a single hinge physics joint + */ + var HingeJoint = (function (_super) { + __extends(HingeJoint, _super); + function HingeJoint(jointData) { + _super.call(this, PhysicsJoint.HingeJoint, jointData); + } + /** + * Set the motor values. + * Attention, this function is plugin specific. Engines won't react 100% the same. + * @param {number} force the force to apply + * @param {number} maxForce max force for this motor. + */ + HingeJoint.prototype.setMotor = function (force, maxForce) { + this._physicsPlugin.setMotor(this, force, maxForce); + }; + /** + * Set the motor's limits. + * Attention, this function is plugin specific. Engines won't react 100% the same. + */ + HingeJoint.prototype.setLimit = function (upperLimit, lowerLimit) { + this._physicsPlugin.setLimit(this, upperLimit, lowerLimit); + }; + return HingeJoint; + }(MotorEnabledJoint)); + BABYLON.HingeJoint = HingeJoint; + /** + * This class represents a dual hinge physics joint (same as wheel joint) + */ + var Hinge2Joint = (function (_super) { + __extends(Hinge2Joint, _super); + function Hinge2Joint(jointData) { + _super.call(this, PhysicsJoint.Hinge2Joint, jointData); + } + /** + * Set the motor values. + * Attention, this function is plugin specific. Engines won't react 100% the same. + * @param {number} force the force to apply + * @param {number} maxForce max force for this motor. + * @param {motorIndex} the motor's index, 0 or 1. + */ + Hinge2Joint.prototype.setMotor = function (force, maxForce, motorIndex) { + if (motorIndex === void 0) { motorIndex = 0; } + this._physicsPlugin.setMotor(this, force, maxForce, motorIndex); + }; + /** + * Set the motor limits. + * Attention, this function is plugin specific. Engines won't react 100% the same. + * @param {number} upperLimit the upper limit + * @param {number} lowerLimit lower limit + * @param {motorIndex} the motor's index, 0 or 1. + */ + Hinge2Joint.prototype.setLimit = function (upperLimit, lowerLimit, motorIndex) { + if (motorIndex === void 0) { motorIndex = 0; } + this._physicsPlugin.setLimit(this, upperLimit, lowerLimit, motorIndex); + }; + return Hinge2Joint; + }(MotorEnabledJoint)); + BABYLON.Hinge2Joint = Hinge2Joint; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.physicsJoint.js.map + +var BABYLON; +(function (BABYLON) { + var PhysicsImpostor = (function () { + function PhysicsImpostor(object, type, _options, _scene) { + var _this = this; + if (_options === void 0) { _options = { mass: 0 }; } + this.object = object; + this.type = type; + this._options = _options; + this._scene = _scene; + this._bodyUpdateRequired = false; + this._onBeforePhysicsStepCallbacks = new Array(); + this._onAfterPhysicsStepCallbacks = new Array(); + this._onPhysicsCollideCallbacks = []; + this._deltaPosition = BABYLON.Vector3.Zero(); + this._tmpPositionWithDelta = BABYLON.Vector3.Zero(); + this._tmpRotationWithDelta = new BABYLON.Quaternion(); + /** + * this function is executed by the physics engine. + */ + this.beforeStep = function () { + _this.object.position.subtractToRef(_this._deltaPosition, _this._tmpPositionWithDelta); + //conjugate deltaRotation + if (_this._deltaRotationConjugated) { + _this.object.rotationQuaternion.multiplyToRef(_this._deltaRotationConjugated, _this._tmpRotationWithDelta); + } + else { + _this._tmpRotationWithDelta.copyFrom(_this.object.rotationQuaternion); + } + _this._physicsEngine.getPhysicsPlugin().setPhysicsBodyTransformation(_this, _this._tmpPositionWithDelta, _this._tmpRotationWithDelta); + _this._onBeforePhysicsStepCallbacks.forEach(function (func) { + func(_this); + }); + }; + /** + * this function is executed by the physics engine. + */ + this.afterStep = function () { + _this._onAfterPhysicsStepCallbacks.forEach(function (func) { + func(_this); + }); + _this._physicsEngine.getPhysicsPlugin().setTransformationFromPhysicsBody(_this); + _this.object.position.addInPlace(_this._deltaPosition); + if (_this._deltaRotation) { + _this.object.rotationQuaternion.multiplyInPlace(_this._deltaRotation); + } + }; + //event and body object due to cannon's event-based architecture. + this.onCollide = function (e) { + if (!_this._onPhysicsCollideCallbacks.length) + return; + var otherImpostor = _this._physicsEngine.getImpostorWithPhysicsBody(e.body); + if (otherImpostor) { + _this._onPhysicsCollideCallbacks.filter(function (obj) { + return obj.otherImpostors.indexOf(otherImpostor) !== -1; + }).forEach(function (obj) { + obj.callback(_this, otherImpostor); + }); + } + }; + //sanity check! + if (!this.object) { + BABYLON.Tools.Error("No object was provided. A physics object is obligatory"); + return; + } + //legacy support for old syntax. + if (!this._scene && object.getScene) { + this._scene = object.getScene(); + } + this._physicsEngine = this._scene.getPhysicsEngine(); + if (!this._physicsEngine) { + BABYLON.Tools.Error("Physics not enabled. Please use scene.enablePhysics(...) before creating impostors."); + } + else { + //set the object's quaternion, if not set + if (!this.object.rotationQuaternion) { + if (this.object.rotation) { + this.object.rotationQuaternion = BABYLON.Quaternion.RotationYawPitchRoll(this.object.rotation.y, this.object.rotation.x, this.object.rotation.z); + } + else { + this.object.rotationQuaternion = new BABYLON.Quaternion(); + } + } + //default options params + this._options.mass = (_options.mass === void 0) ? 0 : _options.mass; + this._options.friction = (_options.friction === void 0) ? 0.2 : _options.friction; + this._options.restitution = (_options.restitution === void 0) ? 0.2 : _options.restitution; + this._joints = []; + //If the mesh has a parent, don't initialize the physicsBody. Instead wait for the parent to do that. + if (!this.object.parent) { + this._init(); + } + } + } + /** + * This function will completly initialize this impostor. + * It will create a new body - but only if this mesh has no parent. + * If it has, this impostor will not be used other than to define the impostor + * of the child mesh. + */ + PhysicsImpostor.prototype._init = function () { + this._physicsEngine.removeImpostor(this); + this.physicsBody = null; + this._parent = this._parent || this._getPhysicsParent(); + if (!this.parent) { + this._physicsEngine.addImpostor(this); + } + }; + PhysicsImpostor.prototype._getPhysicsParent = function () { + if (this.object.parent instanceof BABYLON.AbstractMesh) { + var parentMesh = this.object.parent; + return parentMesh.physicsImpostor; + } + return; + }; + /** + * Should a new body be generated. + */ + PhysicsImpostor.prototype.isBodyInitRequired = function () { + return this._bodyUpdateRequired || (!this._physicsBody && !this._parent); + }; + PhysicsImpostor.prototype.setScalingUpdated = function (updated) { + this.forceUpdate(); + }; + /** + * Force a regeneration of this or the parent's impostor's body. + * Use under cautious - This will remove all joints already implemented. + */ + PhysicsImpostor.prototype.forceUpdate = function () { + this._init(); + if (this.parent) { + this.parent.forceUpdate(); + } + }; + Object.defineProperty(PhysicsImpostor.prototype, "physicsBody", { + /*public get mesh(): AbstractMesh { + return this._mesh; + }*/ + /** + * Gets the body that holds this impostor. Either its own, or its parent. + */ + get: function () { + return this._parent ? this._parent.physicsBody : this._physicsBody; + }, + /** + * Set the physics body. Used mainly by the physics engine/plugin + */ + set: function (physicsBody) { + if (this._physicsBody) { + this._physicsEngine.getPhysicsPlugin().removePhysicsBody(this); + } + this._physicsBody = physicsBody; + this.resetUpdateFlags(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PhysicsImpostor.prototype, "parent", { + get: function () { + return this._parent; + }, + set: function (value) { + this._parent = value; + }, + enumerable: true, + configurable: true + }); + PhysicsImpostor.prototype.resetUpdateFlags = function () { + this._bodyUpdateRequired = false; + }; + PhysicsImpostor.prototype.getObjectExtendSize = function () { + if (this.object.getBoundingInfo) { + this.object.computeWorldMatrix && this.object.computeWorldMatrix(true); + return this.object.getBoundingInfo().boundingBox.extendSize.scale(2).multiply(this.object.scaling); + } + else { + return PhysicsImpostor.DEFAULT_OBJECT_SIZE; + } + }; + PhysicsImpostor.prototype.getObjectCenter = function () { + if (this.object.getBoundingInfo) { + return this.object.getBoundingInfo().boundingBox.center; + } + else { + return this.object.position; + } + }; + /** + * Get a specific parametes from the options parameter. + */ + PhysicsImpostor.prototype.getParam = function (paramName) { + return this._options[paramName]; + }; + /** + * Sets a specific parameter in the options given to the physics plugin + */ + PhysicsImpostor.prototype.setParam = function (paramName, value) { + this._options[paramName] = value; + this._bodyUpdateRequired = true; + }; + /** + * Specifically change the body's mass option. Won't recreate the physics body object + */ + PhysicsImpostor.prototype.setMass = function (mass) { + if (this.getParam("mass") !== mass) { + this.setParam("mass", mass); + } + this._physicsEngine.getPhysicsPlugin().setBodyMass(this, mass); + }; + PhysicsImpostor.prototype.getLinearVelocity = function () { + return this._physicsEngine.getPhysicsPlugin().getLinearVelocity(this); + }; + /** + * Set the body's linear velocity. + */ + PhysicsImpostor.prototype.setLinearVelocity = function (velocity) { + this._physicsEngine.getPhysicsPlugin().setLinearVelocity(this, velocity); + }; + PhysicsImpostor.prototype.getAngularVelocity = function () { + return this._physicsEngine.getPhysicsPlugin().getAngularVelocity(this); + }; + /** + * Set the body's linear velocity. + */ + PhysicsImpostor.prototype.setAngularVelocity = function (velocity) { + this._physicsEngine.getPhysicsPlugin().setAngularVelocity(this, velocity); + }; + /** + * Execute a function with the physics plugin native code. + * Provide a function the will have two variables - the world object and the physics body object. + */ + PhysicsImpostor.prototype.executeNativeFunction = function (func) { + func(this._physicsEngine.getPhysicsPlugin().world, this.physicsBody); + }; + /** + * Register a function that will be executed before the physics world is stepping forward. + */ + PhysicsImpostor.prototype.registerBeforePhysicsStep = function (func) { + this._onBeforePhysicsStepCallbacks.push(func); + }; + PhysicsImpostor.prototype.unregisterBeforePhysicsStep = function (func) { + var index = this._onBeforePhysicsStepCallbacks.indexOf(func); + if (index > -1) { + this._onBeforePhysicsStepCallbacks.splice(index, 1); + } + else { + BABYLON.Tools.Warn("Function to remove was not found"); + } + }; + /** + * Register a function that will be executed after the physics step + */ + PhysicsImpostor.prototype.registerAfterPhysicsStep = function (func) { + this._onAfterPhysicsStepCallbacks.push(func); + }; + PhysicsImpostor.prototype.unregisterAfterPhysicsStep = function (func) { + var index = this._onAfterPhysicsStepCallbacks.indexOf(func); + if (index > -1) { + this._onAfterPhysicsStepCallbacks.splice(index, 1); + } + else { + BABYLON.Tools.Warn("Function to remove was not found"); + } + }; + /** + * register a function that will be executed when this impostor collides against a different body. + */ + PhysicsImpostor.prototype.registerOnPhysicsCollide = function (collideAgainst, func) { + var collidedAgainstList = collideAgainst instanceof Array ? collideAgainst : [collideAgainst]; + this._onPhysicsCollideCallbacks.push({ callback: func, otherImpostors: collidedAgainstList }); + }; + PhysicsImpostor.prototype.unregisterOnPhysicsCollide = function (collideAgainst, func) { + var collidedAgainstList = collideAgainst instanceof Array ? collideAgainst : [collideAgainst]; + var index = this._onPhysicsCollideCallbacks.indexOf({ callback: func, otherImpostors: collidedAgainstList }); + if (index > -1) { + this._onPhysicsCollideCallbacks.splice(index, 1); + } + else { + BABYLON.Tools.Warn("Function to remove was not found"); + } + }; + /** + * Apply a force + */ + PhysicsImpostor.prototype.applyForce = function (force, contactPoint) { + this._physicsEngine.getPhysicsPlugin().applyForce(this, force, contactPoint); + }; + /** + * Apply an impulse + */ + PhysicsImpostor.prototype.applyImpulse = function (force, contactPoint) { + this._physicsEngine.getPhysicsPlugin().applyImpulse(this, force, contactPoint); + }; + /** + * A help function to create a joint. + */ + PhysicsImpostor.prototype.createJoint = function (otherImpostor, jointType, jointData) { + var joint = new BABYLON.PhysicsJoint(jointType, jointData); + this.addJoint(otherImpostor, joint); + }; + /** + * Add a joint to this impostor with a different impostor. + */ + PhysicsImpostor.prototype.addJoint = function (otherImpostor, joint) { + this._joints.push({ + otherImpostor: otherImpostor, + joint: joint + }); + this._physicsEngine.addJoint(this, otherImpostor, joint); + }; + /** + * Will keep this body still, in a sleep mode. + */ + PhysicsImpostor.prototype.sleep = function () { + this._physicsEngine.getPhysicsPlugin().sleepBody(this); + }; + /** + * Wake the body up. + */ + PhysicsImpostor.prototype.wakeUp = function () { + this._physicsEngine.getPhysicsPlugin().wakeUpBody(this); + }; + PhysicsImpostor.prototype.clone = function (newObject) { + if (!newObject) + return null; + return new PhysicsImpostor(newObject, this.type, this._options, this._scene); + }; + PhysicsImpostor.prototype.dispose = function () { + var _this = this; + //no dispose if no physics engine is available. + if (!this._physicsEngine) { + return; + } + this._joints.forEach(function (j) { + _this._physicsEngine.removeJoint(_this, j.otherImpostor, j.joint); + }); + //dispose the physics body + this._physicsEngine.removeImpostor(this); + if (this.parent) { + this.parent.forceUpdate(); + } + else { + } + }; + PhysicsImpostor.prototype.setDeltaPosition = function (position) { + this._deltaPosition.copyFrom(position); + }; + PhysicsImpostor.prototype.setDeltaRotation = function (rotation) { + if (!this._deltaRotation) { + this._deltaRotation = new BABYLON.Quaternion(); + } + this._deltaRotation.copyFrom(rotation); + this._deltaRotationConjugated = this._deltaRotation.conjugate(); + }; + PhysicsImpostor.DEFAULT_OBJECT_SIZE = new BABYLON.Vector3(1, 1, 1); + //Impostor types + PhysicsImpostor.NoImpostor = 0; + PhysicsImpostor.SphereImpostor = 1; + PhysicsImpostor.BoxImpostor = 2; + PhysicsImpostor.PlaneImpostor = 3; + PhysicsImpostor.MeshImpostor = 4; + PhysicsImpostor.CylinderImpostor = 7; + PhysicsImpostor.ParticleImpostor = 8; + PhysicsImpostor.HeightmapImpostor = 9; + return PhysicsImpostor; + }()); + BABYLON.PhysicsImpostor = PhysicsImpostor; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.physicsImpostor.js.map + +var BABYLON; +(function (BABYLON) { + var PhysicsEngine = (function () { + function PhysicsEngine(gravity, _physicsPlugin) { + if (_physicsPlugin === void 0) { _physicsPlugin = new BABYLON.CannonJSPlugin(); } + this._physicsPlugin = _physicsPlugin; + //new methods and parameters + this._impostors = []; + this._joints = []; + if (!this._physicsPlugin.isSupported()) { + throw new Error("Physics Engine " + this._physicsPlugin.name + " cannot be found. " + + "Please make sure it is included."); + } + gravity = gravity || new BABYLON.Vector3(0, -9.807, 0); + this.setGravity(gravity); + this.setTimeStep(); + } + PhysicsEngine.prototype.setGravity = function (gravity) { + this.gravity = gravity; + this._physicsPlugin.setGravity(this.gravity); + }; + /** + * Set the time step of the physics engine. + * default is 1/60. + * To slow it down, enter 1/600 for example. + * To speed it up, 1/30 + * @param {number} newTimeStep the new timestep to apply to this world. + */ + PhysicsEngine.prototype.setTimeStep = function (newTimeStep) { + if (newTimeStep === void 0) { newTimeStep = 1 / 60; } + this._physicsPlugin.setTimeStep(newTimeStep); + }; + PhysicsEngine.prototype.dispose = function () { + this._impostors.forEach(function (impostor) { + impostor.dispose(); + }); + this._physicsPlugin.dispose(); + }; + PhysicsEngine.prototype.getPhysicsPluginName = function () { + return this._physicsPlugin.name; + }; + /** + * Adding a new impostor for the impostor tracking. + * This will be done by the impostor itself. + * @param {PhysicsImpostor} impostor the impostor to add + */ + PhysicsEngine.prototype.addImpostor = function (impostor) { + impostor.uniqueId = this._impostors.push(impostor); + //if no parent, generate the body + if (!impostor.parent) { + this._physicsPlugin.generatePhysicsBody(impostor); + } + }; + /** + * Remove an impostor from the engine. + * This impostor and its mesh will not longer be updated by the physics engine. + * @param {PhysicsImpostor} impostor the impostor to remove + */ + PhysicsEngine.prototype.removeImpostor = function (impostor) { + var index = this._impostors.indexOf(impostor); + if (index > -1) { + var removed = this._impostors.splice(index, 1); + //Is it needed? + if (removed.length) { + //this will also remove it from the world. + removed[0].physicsBody = null; + } + } + }; + /** + * Add a joint to the physics engine + * @param {PhysicsImpostor} mainImpostor the main impostor to which the joint is added. + * @param {PhysicsImpostor} connectedImpostor the impostor that is connected to the main impostor using this joint + * @param {PhysicsJoint} the joint that will connect both impostors. + */ + PhysicsEngine.prototype.addJoint = function (mainImpostor, connectedImpostor, joint) { + var impostorJoint = { + mainImpostor: mainImpostor, + connectedImpostor: connectedImpostor, + joint: joint + }; + joint.physicsPlugin = this._physicsPlugin; + this._joints.push(impostorJoint); + this._physicsPlugin.generateJoint(impostorJoint); + }; + PhysicsEngine.prototype.removeJoint = function (mainImpostor, connectedImpostor, joint) { + var matchingJoints = this._joints.filter(function (impostorJoint) { + return (impostorJoint.connectedImpostor === connectedImpostor + && impostorJoint.joint === joint + && impostorJoint.mainImpostor === mainImpostor); + }); + if (matchingJoints.length) { + this._physicsPlugin.removeJoint(matchingJoints[0]); + } + }; + /** + * Called by the scene. no need to call it. + */ + PhysicsEngine.prototype._step = function (delta) { + var _this = this; + //check if any mesh has no body / requires an update + this._impostors.forEach(function (impostor) { + if (impostor.isBodyInitRequired()) { + _this._physicsPlugin.generatePhysicsBody(impostor); + } + }); + if (delta > 0.1) { + delta = 0.1; + } + else if (delta <= 0) { + delta = 1.0 / 60.0; + } + this._physicsPlugin.executeStep(delta, this._impostors); + }; + PhysicsEngine.prototype.getPhysicsPlugin = function () { + return this._physicsPlugin; + }; + PhysicsEngine.prototype.getImpostorForPhysicsObject = function (object) { + for (var i = 0; i < this._impostors.length; ++i) { + if (this._impostors[i].object === object) { + return this._impostors[i]; + } + } + }; + PhysicsEngine.prototype.getImpostorWithPhysicsBody = function (body) { + for (var i = 0; i < this._impostors.length; ++i) { + if (this._impostors[i].physicsBody === body) { + return this._impostors[i]; + } + } + }; + // Statics, Legacy support. + /** + * @Deprecated + * + */ + PhysicsEngine.NoImpostor = BABYLON.PhysicsImpostor.NoImpostor; + PhysicsEngine.SphereImpostor = BABYLON.PhysicsImpostor.SphereImpostor; + PhysicsEngine.BoxImpostor = BABYLON.PhysicsImpostor.BoxImpostor; + PhysicsEngine.PlaneImpostor = BABYLON.PhysicsImpostor.PlaneImpostor; + PhysicsEngine.MeshImpostor = BABYLON.PhysicsImpostor.MeshImpostor; + PhysicsEngine.CylinderImpostor = BABYLON.PhysicsImpostor.CylinderImpostor; + PhysicsEngine.HeightmapImpostor = BABYLON.PhysicsImpostor.HeightmapImpostor; + PhysicsEngine.CapsuleImpostor = -1; + PhysicsEngine.ConeImpostor = -1; + PhysicsEngine.ConvexHullImpostor = -1; + PhysicsEngine.Epsilon = 0.001; + return PhysicsEngine; + }()); + BABYLON.PhysicsEngine = PhysicsEngine; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.physicsEngine.js.map + +var BABYLON; +(function (BABYLON) { + var VertexData = (function () { + function VertexData() { + } + VertexData.prototype.set = function (data, kind) { + switch (kind) { + case BABYLON.VertexBuffer.PositionKind: + this.positions = data; + break; + case BABYLON.VertexBuffer.NormalKind: + this.normals = data; + break; + case BABYLON.VertexBuffer.UVKind: + this.uvs = data; + break; + case BABYLON.VertexBuffer.UV2Kind: + this.uvs2 = data; + break; + case BABYLON.VertexBuffer.UV3Kind: + this.uvs3 = data; + break; + case BABYLON.VertexBuffer.UV4Kind: + this.uvs4 = data; + break; + case BABYLON.VertexBuffer.UV5Kind: + this.uvs5 = data; + break; + case BABYLON.VertexBuffer.UV6Kind: + this.uvs6 = data; + break; + case BABYLON.VertexBuffer.ColorKind: + this.colors = data; + break; + case BABYLON.VertexBuffer.MatricesIndicesKind: + this.matricesIndices = data; + break; + case BABYLON.VertexBuffer.MatricesWeightsKind: + this.matricesWeights = data; + break; + case BABYLON.VertexBuffer.MatricesIndicesExtraKind: + this.matricesIndicesExtra = data; + break; + case BABYLON.VertexBuffer.MatricesWeightsExtraKind: + this.matricesWeightsExtra = data; + break; + } + }; + VertexData.prototype.applyToMesh = function (mesh, updatable) { + this._applyTo(mesh, updatable); + }; + VertexData.prototype.applyToGeometry = function (geometry, updatable) { + this._applyTo(geometry, updatable); + }; + VertexData.prototype.updateMesh = function (mesh, updateExtends, makeItUnique) { + this._update(mesh); + }; + VertexData.prototype.updateGeometry = function (geometry, updateExtends, makeItUnique) { + this._update(geometry); + }; + VertexData.prototype._applyTo = function (meshOrGeometry, updatable) { + if (this.positions) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.PositionKind, this.positions, updatable); + } + if (this.normals) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.NormalKind, this.normals, updatable); + } + if (this.uvs) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UVKind, this.uvs, updatable); + } + if (this.uvs2) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV2Kind, this.uvs2, updatable); + } + if (this.uvs3) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV3Kind, this.uvs3, updatable); + } + if (this.uvs4) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV4Kind, this.uvs4, updatable); + } + if (this.uvs5) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV5Kind, this.uvs5, updatable); + } + if (this.uvs6) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV6Kind, this.uvs6, updatable); + } + if (this.colors) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.ColorKind, this.colors, updatable); + } + if (this.matricesIndices) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind, this.matricesIndices, updatable); + } + if (this.matricesWeights) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind, this.matricesWeights, updatable); + } + if (this.matricesIndicesExtra) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesExtraKind, this.matricesIndicesExtra, updatable); + } + if (this.matricesWeightsExtra) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.MatricesWeightsExtraKind, this.matricesWeightsExtra, updatable); + } + if (this.indices) { + meshOrGeometry.setIndices(this.indices); + } + }; + VertexData.prototype._update = function (meshOrGeometry, updateExtends, makeItUnique) { + if (this.positions) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.PositionKind, this.positions, updateExtends, makeItUnique); + } + if (this.normals) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.NormalKind, this.normals, updateExtends, makeItUnique); + } + if (this.uvs) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UVKind, this.uvs, updateExtends, makeItUnique); + } + if (this.uvs2) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV2Kind, this.uvs2, updateExtends, makeItUnique); + } + if (this.uvs3) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV3Kind, this.uvs3, updateExtends, makeItUnique); + } + if (this.uvs4) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV4Kind, this.uvs4, updateExtends, makeItUnique); + } + if (this.uvs5) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV5Kind, this.uvs5, updateExtends, makeItUnique); + } + if (this.uvs6) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV6Kind, this.uvs6, updateExtends, makeItUnique); + } + if (this.colors) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.ColorKind, this.colors, updateExtends, makeItUnique); + } + if (this.matricesIndices) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind, this.matricesIndices, updateExtends, makeItUnique); + } + if (this.matricesWeights) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind, this.matricesWeights, updateExtends, makeItUnique); + } + if (this.matricesIndicesExtra) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.MatricesIndicesExtraKind, this.matricesIndicesExtra, updateExtends, makeItUnique); + } + if (this.matricesWeightsExtra) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.MatricesWeightsExtraKind, this.matricesWeightsExtra, updateExtends, makeItUnique); + } + if (this.indices) { + meshOrGeometry.setIndices(this.indices); + } + }; + VertexData.prototype.transform = function (matrix) { + var transformed = BABYLON.Vector3.Zero(); + var index; + if (this.positions) { + var position = BABYLON.Vector3.Zero(); + for (index = 0; index < this.positions.length; index += 3) { + BABYLON.Vector3.FromArrayToRef(this.positions, index, position); + BABYLON.Vector3.TransformCoordinatesToRef(position, matrix, transformed); + this.positions[index] = transformed.x; + this.positions[index + 1] = transformed.y; + this.positions[index + 2] = transformed.z; + } + } + if (this.normals) { + var normal = BABYLON.Vector3.Zero(); + for (index = 0; index < this.normals.length; index += 3) { + BABYLON.Vector3.FromArrayToRef(this.normals, index, normal); + BABYLON.Vector3.TransformNormalToRef(normal, matrix, transformed); + this.normals[index] = transformed.x; + this.normals[index + 1] = transformed.y; + this.normals[index + 2] = transformed.z; + } + } + }; + VertexData.prototype.merge = function (other) { + if (other.indices) { + if (!this.indices) { + this.indices = []; + } + var offset = this.positions ? this.positions.length / 3 : 0; + for (var index = 0; index < other.indices.length; index++) { + //TODO check type - if Int32Array! + this.indices.push(other.indices[index] + offset); + } + } + this.positions = this._mergeElement(this.positions, other.positions); + this.normals = this._mergeElement(this.normals, other.normals); + this.uvs = this._mergeElement(this.uvs, other.uvs); + this.uvs2 = this._mergeElement(this.uvs2, other.uvs2); + this.uvs3 = this._mergeElement(this.uvs3, other.uvs3); + this.uvs4 = this._mergeElement(this.uvs4, other.uvs4); + this.uvs5 = this._mergeElement(this.uvs5, other.uvs5); + this.uvs6 = this._mergeElement(this.uvs6, other.uvs6); + this.colors = this._mergeElement(this.colors, other.colors); + this.matricesIndices = this._mergeElement(this.matricesIndices, other.matricesIndices); + this.matricesWeights = this._mergeElement(this.matricesWeights, other.matricesWeights); + this.matricesIndicesExtra = this._mergeElement(this.matricesIndicesExtra, other.matricesIndicesExtra); + this.matricesWeightsExtra = this._mergeElement(this.matricesWeightsExtra, other.matricesWeightsExtra); + }; + VertexData.prototype._mergeElement = function (source, other) { + if (!other) + return source; + if (!source) + return other; + var len = other.length + source.length; + var isSrcTypedArray = source instanceof Float32Array; + var isOthTypedArray = other instanceof Float32Array; + // use non-loop method when the source is Float32Array + if (isSrcTypedArray) { + var ret32 = new Float32Array(len); + ret32.set(source); + ret32.set(other, source.length); + return ret32; + } + else if (!isOthTypedArray) { + return source.concat(other); + } + else { + var ret = source.slice(0); // copy source to a separate array + for (var i = 0, len = other.length; i < len; i++) { + ret.push(other[i]); + } + return ret; + } + }; + VertexData.prototype.serialize = function () { + var serializationObject = this.serialize(); + if (this.positions) { + serializationObject.positions = this.positions; + } + if (this.normals) { + serializationObject.normals = this.normals; + } + if (this.uvs) { + serializationObject.uvs = this.uvs; + } + if (this.uvs2) { + serializationObject.uvs2 = this.uvs2; + } + if (this.uvs3) { + serializationObject.uvs3 = this.uvs3; + } + if (this.uvs4) { + serializationObject.uvs4 = this.uvs4; + } + if (this.uvs5) { + serializationObject.uvs5 = this.uvs5; + } + if (this.uvs6) { + serializationObject.uvs6 = this.uvs6; + } + if (this.colors) { + serializationObject.colors = this.colors; + } + if (this.matricesIndices) { + serializationObject.matricesIndices = this.matricesIndices; + serializationObject.matricesIndices._isExpanded = true; + } + if (this.matricesWeights) { + serializationObject.matricesWeights = this.matricesWeights; + } + if (this.matricesIndicesExtra) { + serializationObject.matricesIndicesExtra = this.matricesIndicesExtra; + serializationObject.matricesIndicesExtra._isExpanded = true; + } + if (this.matricesWeightsExtra) { + serializationObject.matricesWeightsExtra = this.matricesWeightsExtra; + } + serializationObject.indices = this.indices; + return serializationObject; + }; + // Statics + VertexData.ExtractFromMesh = function (mesh, copyWhenShared) { + return VertexData._ExtractFrom(mesh, copyWhenShared); + }; + VertexData.ExtractFromGeometry = function (geometry, copyWhenShared) { + return VertexData._ExtractFrom(geometry, copyWhenShared); + }; + VertexData._ExtractFrom = function (meshOrGeometry, copyWhenShared) { + var result = new VertexData(); + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind)) { + result.positions = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.PositionKind, copyWhenShared); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) { + result.normals = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.NormalKind, copyWhenShared); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) { + result.uvs = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UVKind, copyWhenShared); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) { + result.uvs2 = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV2Kind, copyWhenShared); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV3Kind)) { + result.uvs3 = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV3Kind, copyWhenShared); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV4Kind)) { + result.uvs4 = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV4Kind, copyWhenShared); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV5Kind)) { + result.uvs5 = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV5Kind, copyWhenShared); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV6Kind)) { + result.uvs6 = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV6Kind, copyWhenShared); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.ColorKind)) { + result.colors = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.ColorKind, copyWhenShared); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesIndicesKind)) { + result.matricesIndices = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind, copyWhenShared); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsKind)) { + result.matricesWeights = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind, copyWhenShared); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesIndicesExtraKind)) { + result.matricesIndicesExtra = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesExtraKind, copyWhenShared); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsExtraKind)) { + result.matricesWeightsExtra = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsExtraKind, copyWhenShared); + } + result.indices = meshOrGeometry.getIndices(copyWhenShared); + return result; + }; + VertexData.CreateRibbon = function (options) { + var pathArray = options.pathArray; + var closeArray = options.closeArray || false; + var closePath = options.closePath || false; + var invertUV = options.invertUV || false; + var defaultOffset = Math.floor(pathArray[0].length / 2); + var offset = options.offset || defaultOffset; + offset = offset > defaultOffset ? defaultOffset : Math.floor(offset); // offset max allowed : defaultOffset + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + var positions = []; + var indices = []; + var normals = []; + var uvs = []; + var us = []; // us[path_id] = [uDist1, uDist2, uDist3 ... ] distances between points on path path_id + var vs = []; // vs[i] = [vDist1, vDist2, vDist3, ... ] distances between points i of consecutives paths from pathArray + var uTotalDistance = []; // uTotalDistance[p] : total distance of path p + var vTotalDistance = []; // vTotalDistance[i] : total distance between points i of first and last path from pathArray + var minlg; // minimal length among all paths from pathArray + var lg = []; // array of path lengths : nb of vertex per path + var idx = []; // array of path indexes : index of each path (first vertex) in the total vertex number + var p; // path iterator + var i; // point iterator + var j; // point iterator + // if single path in pathArray + if (pathArray.length < 2) { + var ar1 = []; + var ar2 = []; + for (i = 0; i < pathArray[0].length - offset; i++) { + ar1.push(pathArray[0][i]); + ar2.push(pathArray[0][i + offset]); + } + pathArray = [ar1, ar2]; + } + // positions and horizontal distances (u) + var idc = 0; + var closePathCorr = (closePath) ? 1 : 0; + var path; + var l; + minlg = pathArray[0].length; + var vectlg; + var dist; + for (p = 0; p < pathArray.length; p++) { + uTotalDistance[p] = 0; + us[p] = [0]; + path = pathArray[p]; + l = path.length; + minlg = (minlg < l) ? minlg : l; + j = 0; + while (j < l) { + positions.push(path[j].x, path[j].y, path[j].z); + if (j > 0) { + vectlg = path[j].subtract(path[j - 1]).length(); + dist = vectlg + uTotalDistance[p]; + us[p].push(dist); + uTotalDistance[p] = dist; + } + j++; + } + if (closePath) { + j--; + positions.push(path[0].x, path[0].y, path[0].z); + vectlg = path[j].subtract(path[0]).length(); + dist = vectlg + uTotalDistance[p]; + us[p].push(dist); + uTotalDistance[p] = dist; + } + lg[p] = l + closePathCorr; + idx[p] = idc; + idc += (l + closePathCorr); + } + // vertical distances (v) + var path1; + var path2; + var vertex1; + var vertex2; + for (i = 0; i < minlg + closePathCorr; i++) { + vTotalDistance[i] = 0; + vs[i] = [0]; + for (p = 0; p < pathArray.length - 1; p++) { + path1 = pathArray[p]; + path2 = pathArray[p + 1]; + if (i === minlg) { + vertex1 = path1[0]; + vertex2 = path2[0]; + } + else { + vertex1 = path1[i]; + vertex2 = path2[i]; + } + vectlg = vertex2.subtract(vertex1).length(); + dist = vectlg + vTotalDistance[i]; + vs[i].push(dist); + vTotalDistance[i] = dist; + } + if (closeArray) { + path1 = pathArray[p]; + path2 = pathArray[0]; + if (i === minlg) { + vertex2 = path2[0]; + } + vectlg = vertex2.subtract(vertex1).length(); + dist = vectlg + vTotalDistance[i]; + vTotalDistance[i] = dist; + } + } + // uvs + var u; + var v; + for (p = 0; p < pathArray.length; p++) { + for (i = 0; i < minlg + closePathCorr; i++) { + u = us[p][i] / uTotalDistance[p]; + v = vs[i][p] / vTotalDistance[i]; + if (invertUV) { + uvs.push(v, u); + } + else { + uvs.push(u, v); + } + } + } + // indices + p = 0; // path index + var pi = 0; // positions array index + var l1 = lg[p] - 1; // path1 length + var l2 = lg[p + 1] - 1; // path2 length + var min = (l1 < l2) ? l1 : l2; // current path stop index + var shft = idx[1] - idx[0]; // shift + var path1nb = closeArray ? lg.length : lg.length - 1; // number of path1 to iterate on + while (pi <= min && p < path1nb) { + // draw two triangles between path1 (p1) and path2 (p2) : (p1.pi, p2.pi, p1.pi+1) and (p2.pi+1, p1.pi+1, p2.pi) clockwise + indices.push(pi, pi + shft, pi + 1); + indices.push(pi + shft + 1, pi + 1, pi + shft); + pi += 1; + if (pi === min) { + p++; + if (p === lg.length - 1) { + shft = idx[0] - idx[p]; + l1 = lg[p] - 1; + l2 = lg[0] - 1; + } + else { + shft = idx[p + 1] - idx[p]; + l1 = lg[p] - 1; + l2 = lg[p + 1] - 1; + } + pi = idx[p]; + min = (l1 < l2) ? l1 + pi : l2 + pi; + } + } + // normals + VertexData.ComputeNormals(positions, indices, normals); + if (closePath) { + var indexFirst = 0; + var indexLast = 0; + for (p = 0; p < pathArray.length; p++) { + indexFirst = idx[p] * 3; + if (p + 1 < pathArray.length) { + indexLast = (idx[p + 1] - 1) * 3; + } + else { + indexLast = normals.length - 3; + } + normals[indexFirst] = (normals[indexFirst] + normals[indexLast]) * 0.5; + normals[indexFirst + 1] = (normals[indexFirst + 1] + normals[indexLast + 1]) * 0.5; + normals[indexFirst + 2] = (normals[indexFirst + 2] + normals[indexLast + 2]) * 0.5; + normals[indexLast] = normals[indexFirst]; + normals[indexLast + 1] = normals[indexFirst + 1]; + normals[indexLast + 2] = normals[indexFirst + 2]; + } + } + // sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs); + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + if (closePath) { + vertexData._idx = idx; + } + return vertexData; + }; + VertexData.CreateBox = function (options) { + var normalsSource = [ + new BABYLON.Vector3(0, 0, 1), + new BABYLON.Vector3(0, 0, -1), + new BABYLON.Vector3(1, 0, 0), + new BABYLON.Vector3(-1, 0, 0), + new BABYLON.Vector3(0, 1, 0), + new BABYLON.Vector3(0, -1, 0) + ]; + var indices = []; + var positions = []; + var normals = []; + var uvs = []; + var width = options.width || options.size || 1; + var height = options.height || options.size || 1; + var depth = options.depth || options.size || 1; + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + var faceUV = options.faceUV || new Array(6); + var faceColors = options.faceColors; + var colors = []; + // default face colors and UV if undefined + for (var f = 0; f < 6; f++) { + if (faceUV[f] === undefined) { + faceUV[f] = new BABYLON.Vector4(0, 0, 1, 1); + } + if (faceColors && faceColors[f] === undefined) { + faceColors[f] = new BABYLON.Color4(1, 1, 1, 1); + } + } + var scaleVector = new BABYLON.Vector3(width / 2, height / 2, depth / 2); + // Create each face in turn. + for (var index = 0; index < normalsSource.length; index++) { + var normal = normalsSource[index]; + // Get two vectors perpendicular to the face normal and to each other. + var side1 = new BABYLON.Vector3(normal.y, normal.z, normal.x); + var side2 = BABYLON.Vector3.Cross(normal, side1); + // Six indices (two triangles) per face. + var verticesLength = positions.length / 3; + indices.push(verticesLength); + indices.push(verticesLength + 1); + indices.push(verticesLength + 2); + indices.push(verticesLength); + indices.push(verticesLength + 2); + indices.push(verticesLength + 3); + // Four vertices per face. + var vertex = normal.subtract(side1).subtract(side2).multiply(scaleVector); + positions.push(vertex.x, vertex.y, vertex.z); + normals.push(normal.x, normal.y, normal.z); + uvs.push(faceUV[index].z, faceUV[index].w); + if (faceColors) { + colors.push(faceColors[index].r, faceColors[index].g, faceColors[index].b, faceColors[index].a); + } + vertex = normal.subtract(side1).add(side2).multiply(scaleVector); + positions.push(vertex.x, vertex.y, vertex.z); + normals.push(normal.x, normal.y, normal.z); + uvs.push(faceUV[index].x, faceUV[index].w); + if (faceColors) { + colors.push(faceColors[index].r, faceColors[index].g, faceColors[index].b, faceColors[index].a); + } + vertex = normal.add(side1).add(side2).multiply(scaleVector); + positions.push(vertex.x, vertex.y, vertex.z); + normals.push(normal.x, normal.y, normal.z); + uvs.push(faceUV[index].x, faceUV[index].y); + if (faceColors) { + colors.push(faceColors[index].r, faceColors[index].g, faceColors[index].b, faceColors[index].a); + } + vertex = normal.add(side1).subtract(side2).multiply(scaleVector); + positions.push(vertex.x, vertex.y, vertex.z); + normals.push(normal.x, normal.y, normal.z); + uvs.push(faceUV[index].z, faceUV[index].y); + if (faceColors) { + colors.push(faceColors[index].r, faceColors[index].g, faceColors[index].b, faceColors[index].a); + } + } + // sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs); + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + if (faceColors) { + var totalColors = (sideOrientation === BABYLON.Mesh.DOUBLESIDE) ? colors.concat(colors) : colors; + vertexData.colors = totalColors; + } + return vertexData; + }; + VertexData.CreateSphere = function (options) { + var segments = options.segments || 32; + var diameterX = options.diameterX || options.diameter || 1; + var diameterY = options.diameterY || options.diameter || 1; + var diameterZ = options.diameterZ || options.diameter || 1; + var arc = (options.arc <= 0 || options.arc > 1) ? 1.0 : options.arc || 1.0; + var slice = (options.slice <= 0) ? 1.0 : options.slice || 1.0; + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + var radius = new BABYLON.Vector3(diameterX / 2, diameterY / 2, diameterZ / 2); + var totalZRotationSteps = 2 + segments; + var totalYRotationSteps = 2 * totalZRotationSteps; + var indices = []; + var positions = []; + var normals = []; + var uvs = []; + for (var zRotationStep = 0; zRotationStep <= totalZRotationSteps; zRotationStep++) { + var normalizedZ = zRotationStep / totalZRotationSteps; + var angleZ = normalizedZ * Math.PI * slice; + for (var yRotationStep = 0; yRotationStep <= totalYRotationSteps; yRotationStep++) { + var normalizedY = yRotationStep / totalYRotationSteps; + var angleY = normalizedY * Math.PI * 2 * arc; + var rotationZ = BABYLON.Matrix.RotationZ(-angleZ); + var rotationY = BABYLON.Matrix.RotationY(angleY); + var afterRotZ = BABYLON.Vector3.TransformCoordinates(BABYLON.Vector3.Up(), rotationZ); + var complete = BABYLON.Vector3.TransformCoordinates(afterRotZ, rotationY); + var vertex = complete.multiply(radius); + var normal = complete.divide(radius).normalize(); + positions.push(vertex.x, vertex.y, vertex.z); + normals.push(normal.x, normal.y, normal.z); + uvs.push(normalizedY, normalizedZ); + } + if (zRotationStep > 0) { + var verticesCount = positions.length / 3; + for (var firstIndex = verticesCount - 2 * (totalYRotationSteps + 1); (firstIndex + totalYRotationSteps + 2) < verticesCount; firstIndex++) { + indices.push((firstIndex)); + indices.push((firstIndex + 1)); + indices.push(firstIndex + totalYRotationSteps + 1); + indices.push((firstIndex + totalYRotationSteps + 1)); + indices.push((firstIndex + 1)); + indices.push((firstIndex + totalYRotationSteps + 2)); + } + } + } + // Sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs); + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + // Cylinder and cone + VertexData.CreateCylinder = function (options) { + var height = options.height || 2; + var diameterTop = (options.diameterTop === 0) ? 0 : options.diameterTop || options.diameter || 1; + var diameterBottom = (options.diameterBottom === 0) ? 0 : options.diameterBottom || options.diameter || 1; + var tessellation = options.tessellation || 24; + var subdivisions = options.subdivisions || 1; + var hasRings = options.hasRings; + var enclose = options.enclose; + var arc = (options.arc <= 0 || options.arc > 1) ? 1.0 : options.arc || 1.0; + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + var faceUV = options.faceUV || new Array(3); + var faceColors = options.faceColors; + // default face colors and UV if undefined + var quadNb = (arc !== 1 && enclose) ? 2 : 0; + var ringNb = (hasRings) ? subdivisions : 1; + var surfaceNb = 2 + (1 + quadNb) * ringNb; + var f; + for (f = 0; f < surfaceNb; f++) { + if (faceColors && faceColors[f] === undefined) { + faceColors[f] = new BABYLON.Color4(1, 1, 1, 1); + } + } + for (f = 0; f < surfaceNb; f++) { + if (faceUV && faceUV[f] === undefined) { + faceUV[f] = new BABYLON.Vector4(0, 0, 1, 1); + } + } + var indices = []; + var positions = []; + var normals = []; + var uvs = []; + var colors = []; + var angle_step = Math.PI * 2 * arc / tessellation; + var angle; + var h; + var radius; + var tan = (diameterBottom - diameterTop) / 2 / height; + var ringVertex = BABYLON.Vector3.Zero(); + var ringNormal = BABYLON.Vector3.Zero(); + var ringFirstVertex = BABYLON.Vector3.Zero(); + var ringFirstNormal = BABYLON.Vector3.Zero(); + var quadNormal = BABYLON.Vector3.Zero(); + var Y = BABYLON.Axis.Y; + // positions, normals, uvs + var i; + var j; + var r; + var ringIdx = 1; + var s = 1; // surface index + var cs = 0; + var v = 0; + for (i = 0; i <= subdivisions; i++) { + h = i / subdivisions; + radius = (h * (diameterTop - diameterBottom) + diameterBottom) / 2; + ringIdx = (hasRings && i !== 0 && i !== subdivisions) ? 2 : 1; + for (r = 0; r < ringIdx; r++) { + if (hasRings) { + s += r; + } + if (enclose) { + s += 2 * r; + } + for (j = 0; j <= tessellation; j++) { + angle = j * angle_step; + // position + ringVertex.x = Math.cos(-angle) * radius; + ringVertex.y = -height / 2 + h * height; + ringVertex.z = Math.sin(-angle) * radius; + // normal + if (diameterTop === 0 && i === subdivisions) { + // if no top cap, reuse former normals + ringNormal.x = normals[normals.length - (tessellation + 1) * 3]; + ringNormal.y = normals[normals.length - (tessellation + 1) * 3 + 1]; + ringNormal.z = normals[normals.length - (tessellation + 1) * 3 + 2]; + } + else { + ringNormal.x = ringVertex.x; + ringNormal.z = ringVertex.z; + ringNormal.y = Math.sqrt(ringNormal.x * ringNormal.x + ringNormal.z * ringNormal.z) * tan; + ringNormal.normalize(); + } + // keep first ring vertex values for enclose + if (j === 0) { + ringFirstVertex.copyFrom(ringVertex); + ringFirstNormal.copyFrom(ringNormal); + } + positions.push(ringVertex.x, ringVertex.y, ringVertex.z); + normals.push(ringNormal.x, ringNormal.y, ringNormal.z); + if (hasRings) { + v = (cs !== s) ? faceUV[s].y : faceUV[s].w; + } + else { + v = faceUV[s].y + (faceUV[s].w - faceUV[s].y) * h; + } + uvs.push(faceUV[s].x + (faceUV[s].z - faceUV[s].x) * j / tessellation, v); + if (faceColors) { + colors.push(faceColors[s].r, faceColors[s].g, faceColors[s].b, faceColors[s].a); + } + } + // if enclose, add four vertices and their dedicated normals + if (arc !== 1 && enclose) { + positions.push(ringVertex.x, ringVertex.y, ringVertex.z); + positions.push(0, ringVertex.y, 0); + positions.push(0, ringVertex.y, 0); + positions.push(ringFirstVertex.x, ringFirstVertex.y, ringFirstVertex.z); + BABYLON.Vector3.CrossToRef(Y, ringNormal, quadNormal); + quadNormal.normalize(); + normals.push(quadNormal.x, quadNormal.y, quadNormal.z, quadNormal.x, quadNormal.y, quadNormal.z); + BABYLON.Vector3.CrossToRef(ringFirstNormal, Y, quadNormal); + quadNormal.normalize(); + normals.push(quadNormal.x, quadNormal.y, quadNormal.z, quadNormal.x, quadNormal.y, quadNormal.z); + if (hasRings) { + v = (cs !== s) ? faceUV[s + 1].y : faceUV[s + 1].w; + } + else { + v = faceUV[s + 1].y + (faceUV[s + 1].w - faceUV[s + 1].y) * h; + } + uvs.push(faceUV[s + 1].x, v); + uvs.push(faceUV[s + 1].z, v); + if (hasRings) { + v = (cs !== s) ? faceUV[s + 2].y : faceUV[s + 2].w; + } + else { + v = faceUV[s + 2].y + (faceUV[s + 2].w - faceUV[s + 2].y) * h; + } + uvs.push(faceUV[s + 2].x, v); + uvs.push(faceUV[s + 2].z, v); + if (faceColors) { + colors.push(faceColors[s + 1].r, faceColors[s + 1].g, faceColors[s + 1].b, faceColors[s + 1].a); + colors.push(faceColors[s + 1].r, faceColors[s + 1].g, faceColors[s + 1].b, faceColors[s + 1].a); + colors.push(faceColors[s + 2].r, faceColors[s + 2].g, faceColors[s + 2].b, faceColors[s + 2].a); + colors.push(faceColors[s + 2].r, faceColors[s + 2].g, faceColors[s + 2].b, faceColors[s + 2].a); + } + } + if (cs !== s) { + cs = s; + } + } + } + // indices + var e = (arc !== 1 && enclose) ? tessellation + 4 : tessellation; // correction of number of iteration if enclose + var s; + i = 0; + for (s = 0; s < subdivisions; s++) { + for (j = 0; j < tessellation; j++) { + var i0 = i * (e + 1) + j; + var i1 = (i + 1) * (e + 1) + j; + var i2 = i * (e + 1) + (j + 1); + var i3 = (i + 1) * (e + 1) + (j + 1); + indices.push(i0, i1, i2); + indices.push(i3, i2, i1); + } + if (arc !== 1 && enclose) { + indices.push(i0 + 2, i1 + 2, i2 + 2); + indices.push(i3 + 2, i2 + 2, i1 + 2); + indices.push(i0 + 4, i1 + 4, i2 + 4); + indices.push(i3 + 4, i2 + 4, i1 + 4); + } + i = (hasRings) ? (i + 2) : (i + 1); + } + // Caps + var createCylinderCap = function (isTop) { + var radius = isTop ? diameterTop / 2 : diameterBottom / 2; + if (radius === 0) { + return; + } + // Cap positions, normals & uvs + var angle; + var circleVector; + var i; + var u = (isTop) ? faceUV[surfaceNb - 1] : faceUV[0]; + var c; + if (faceColors) { + c = (isTop) ? faceColors[surfaceNb - 1] : faceColors[0]; + } + // cap center + var vbase = positions.length / 3; + var offset = isTop ? height / 2 : -height / 2; + var center = new BABYLON.Vector3(0, offset, 0); + positions.push(center.x, center.y, center.z); + normals.push(0, isTop ? 1 : -1, 0); + uvs.push(u.x + (u.z - u.x) * 0.5, u.y + (u.w - u.y) * 0.5); + if (faceColors) { + colors.push(c.r, c.g, c.b, c.a); + } + var textureScale = new BABYLON.Vector2(0.5, 0.5); + for (i = 0; i <= tessellation; i++) { + angle = Math.PI * 2 * i * arc / tessellation; + var cos = Math.cos(-angle); + var sin = Math.sin(-angle); + circleVector = new BABYLON.Vector3(cos * radius, offset, sin * radius); + var textureCoordinate = new BABYLON.Vector2(cos * textureScale.x + 0.5, sin * textureScale.y + 0.5); + positions.push(circleVector.x, circleVector.y, circleVector.z); + normals.push(0, isTop ? 1 : -1, 0); + uvs.push(u.x + (u.z - u.x) * textureCoordinate.x, u.y + (u.w - u.y) * textureCoordinate.y); + if (faceColors) { + colors.push(c.r, c.g, c.b, c.a); + } + } + // Cap indices + for (i = 0; i < tessellation; i++) { + if (!isTop) { + indices.push(vbase); + indices.push(vbase + (i + 1)); + indices.push(vbase + (i + 2)); + } + else { + indices.push(vbase); + indices.push(vbase + (i + 2)); + indices.push(vbase + (i + 1)); + } + } + }; + // add caps to geometry + createCylinderCap(false); + createCylinderCap(true); + // Sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs); + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + if (faceColors) { + vertexData.colors = colors; + } + return vertexData; + }; + VertexData.CreateTorus = function (options) { + var indices = []; + var positions = []; + var normals = []; + var uvs = []; + var diameter = options.diameter || 1; + var thickness = options.thickness || 0.5; + var tessellation = options.tessellation || 16; + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + var stride = tessellation + 1; + for (var i = 0; i <= tessellation; i++) { + var u = i / tessellation; + var outerAngle = i * Math.PI * 2.0 / tessellation - Math.PI / 2.0; + var transform = BABYLON.Matrix.Translation(diameter / 2.0, 0, 0).multiply(BABYLON.Matrix.RotationY(outerAngle)); + for (var j = 0; j <= tessellation; j++) { + var v = 1 - j / tessellation; + var innerAngle = j * Math.PI * 2.0 / tessellation + Math.PI; + var dx = Math.cos(innerAngle); + var dy = Math.sin(innerAngle); + // Create a vertex. + var normal = new BABYLON.Vector3(dx, dy, 0); + var position = normal.scale(thickness / 2); + var textureCoordinate = new BABYLON.Vector2(u, v); + position = BABYLON.Vector3.TransformCoordinates(position, transform); + normal = BABYLON.Vector3.TransformNormal(normal, transform); + positions.push(position.x, position.y, position.z); + normals.push(normal.x, normal.y, normal.z); + uvs.push(textureCoordinate.x, textureCoordinate.y); + // And create indices for two triangles. + var nextI = (i + 1) % stride; + var nextJ = (j + 1) % stride; + indices.push(i * stride + j); + indices.push(i * stride + nextJ); + indices.push(nextI * stride + j); + indices.push(i * stride + nextJ); + indices.push(nextI * stride + nextJ); + indices.push(nextI * stride + j); + } + } + // Sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs); + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + VertexData.CreateLineSystem = function (options) { + var indices = []; + var positions = []; + var lines = options.lines; + var idx = 0; + for (var l = 0; l < lines.length; l++) { + var points = lines[l]; + for (var index = 0; index < points.length; index++) { + positions.push(points[index].x, points[index].y, points[index].z); + if (index > 0) { + indices.push(idx - 1); + indices.push(idx); + } + idx++; + } + } + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + return vertexData; + }; + VertexData.CreateDashedLines = function (options) { + var dashSize = options.dashSize || 3; + var gapSize = options.gapSize || 1; + var dashNb = options.dashNb || 200; + var points = options.points; + var positions = new Array(); + var indices = new Array(); + var curvect = BABYLON.Vector3.Zero(); + var lg = 0; + var nb = 0; + var shft = 0; + var dashshft = 0; + var curshft = 0; + var idx = 0; + var i = 0; + for (i = 0; i < points.length - 1; i++) { + points[i + 1].subtractToRef(points[i], curvect); + lg += curvect.length(); + } + shft = lg / dashNb; + dashshft = dashSize * shft / (dashSize + gapSize); + for (i = 0; i < points.length - 1; i++) { + points[i + 1].subtractToRef(points[i], curvect); + nb = Math.floor(curvect.length() / shft); + curvect.normalize(); + for (var j = 0; j < nb; j++) { + curshft = shft * j; + positions.push(points[i].x + curshft * curvect.x, points[i].y + curshft * curvect.y, points[i].z + curshft * curvect.z); + positions.push(points[i].x + (curshft + dashshft) * curvect.x, points[i].y + (curshft + dashshft) * curvect.y, points[i].z + (curshft + dashshft) * curvect.z); + indices.push(idx, idx + 1); + idx += 2; + } + } + // Result + var vertexData = new VertexData(); + vertexData.positions = positions; + vertexData.indices = indices; + return vertexData; + }; + VertexData.CreateGround = function (options) { + var indices = []; + var positions = []; + var normals = []; + var uvs = []; + var row, col; + var width = options.width || 1; + var height = options.height || 1; + var subdivisionsX = options.subdivisionsX || options.subdivisions || 1; + var subdivisionsY = options.subdivisionsY || options.subdivisions || 1; + for (row = 0; row <= subdivisionsY; row++) { + for (col = 0; col <= subdivisionsX; col++) { + var position = new BABYLON.Vector3((col * width) / subdivisionsX - (width / 2.0), 0, ((subdivisionsY - row) * height) / subdivisionsY - (height / 2.0)); + var normal = new BABYLON.Vector3(0, 1.0, 0); + positions.push(position.x, position.y, position.z); + normals.push(normal.x, normal.y, normal.z); + uvs.push(col / subdivisionsX, 1.0 - row / subdivisionsX); + } + } + for (row = 0; row < subdivisionsY; row++) { + for (col = 0; col < subdivisionsX; col++) { + indices.push(col + 1 + (row + 1) * (subdivisionsX + 1)); + indices.push(col + 1 + row * (subdivisionsX + 1)); + indices.push(col + row * (subdivisionsX + 1)); + indices.push(col + (row + 1) * (subdivisionsX + 1)); + indices.push(col + 1 + (row + 1) * (subdivisionsX + 1)); + indices.push(col + row * (subdivisionsX + 1)); + } + } + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + VertexData.CreateTiledGround = function (options) { + var xmin = options.xmin || -1.0; + var zmin = options.zmin || -1.0; + var xmax = options.xmax || 1.0; + var zmax = options.zmax || 1.0; + var subdivisions = options.subdivisions || { w: 1, h: 1 }; + var precision = options.precision || { w: 1, h: 1 }; + var indices = []; + var positions = []; + var normals = []; + var uvs = []; + var row, col, tileRow, tileCol; + subdivisions.h = (subdivisions.h < 1) ? 1 : subdivisions.h; + subdivisions.w = (subdivisions.w < 1) ? 1 : subdivisions.w; + precision.w = (precision.w < 1) ? 1 : precision.w; + precision.h = (precision.h < 1) ? 1 : precision.h; + var tileSize = { + 'w': (xmax - xmin) / subdivisions.w, + 'h': (zmax - zmin) / subdivisions.h + }; + function applyTile(xTileMin, zTileMin, xTileMax, zTileMax) { + // Indices + var base = positions.length / 3; + var rowLength = precision.w + 1; + for (row = 0; row < precision.h; row++) { + for (col = 0; col < precision.w; col++) { + var square = [ + base + col + row * rowLength, + base + (col + 1) + row * rowLength, + base + (col + 1) + (row + 1) * rowLength, + base + col + (row + 1) * rowLength + ]; + indices.push(square[1]); + indices.push(square[2]); + indices.push(square[3]); + indices.push(square[0]); + indices.push(square[1]); + indices.push(square[3]); + } + } + // Position, normals and uvs + var position = BABYLON.Vector3.Zero(); + var normal = new BABYLON.Vector3(0, 1.0, 0); + for (row = 0; row <= precision.h; row++) { + position.z = (row * (zTileMax - zTileMin)) / precision.h + zTileMin; + for (col = 0; col <= precision.w; col++) { + position.x = (col * (xTileMax - xTileMin)) / precision.w + xTileMin; + position.y = 0; + positions.push(position.x, position.y, position.z); + normals.push(normal.x, normal.y, normal.z); + uvs.push(col / precision.w, row / precision.h); + } + } + } + for (tileRow = 0; tileRow < subdivisions.h; tileRow++) { + for (tileCol = 0; tileCol < subdivisions.w; tileCol++) { + applyTile(xmin + tileCol * tileSize.w, zmin + tileRow * tileSize.h, xmin + (tileCol + 1) * tileSize.w, zmin + (tileRow + 1) * tileSize.h); + } + } + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + VertexData.CreateGroundFromHeightMap = function (options) { + var indices = []; + var positions = []; + var normals = []; + var uvs = []; + var row, col; + // Vertices + for (row = 0; row <= options.subdivisions; row++) { + for (col = 0; col <= options.subdivisions; col++) { + var position = new BABYLON.Vector3((col * options.width) / options.subdivisions - (options.width / 2.0), 0, ((options.subdivisions - row) * options.height) / options.subdivisions - (options.height / 2.0)); + // Compute height + var heightMapX = (((position.x + options.width / 2) / options.width) * (options.bufferWidth - 1)) | 0; + var heightMapY = ((1.0 - (position.z + options.height / 2) / options.height) * (options.bufferHeight - 1)) | 0; + var pos = (heightMapX + heightMapY * options.bufferWidth) * 4; + var r = options.buffer[pos] / 255.0; + var g = options.buffer[pos + 1] / 255.0; + var b = options.buffer[pos + 2] / 255.0; + var gradient = r * 0.3 + g * 0.59 + b * 0.11; + position.y = options.minHeight + (options.maxHeight - options.minHeight) * gradient; + // Add vertex + positions.push(position.x, position.y, position.z); + normals.push(0, 0, 0); + uvs.push(col / options.subdivisions, 1.0 - row / options.subdivisions); + } + } + // Indices + for (row = 0; row < options.subdivisions; row++) { + for (col = 0; col < options.subdivisions; col++) { + indices.push(col + 1 + (row + 1) * (options.subdivisions + 1)); + indices.push(col + 1 + row * (options.subdivisions + 1)); + indices.push(col + row * (options.subdivisions + 1)); + indices.push(col + (row + 1) * (options.subdivisions + 1)); + indices.push(col + 1 + (row + 1) * (options.subdivisions + 1)); + indices.push(col + row * (options.subdivisions + 1)); + } + } + // Normals + VertexData.ComputeNormals(positions, indices, normals); + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + VertexData.CreatePlane = function (options) { + var indices = []; + var positions = []; + var normals = []; + var uvs = []; + var width = options.width || options.size || 1; + var height = options.height || options.size || 1; + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + // Vertices + var halfWidth = width / 2.0; + var halfHeight = height / 2.0; + positions.push(-halfWidth, -halfHeight, 0); + normals.push(0, 0, -1.0); + uvs.push(0.0, 0.0); + positions.push(halfWidth, -halfHeight, 0); + normals.push(0, 0, -1.0); + uvs.push(1.0, 0.0); + positions.push(halfWidth, halfHeight, 0); + normals.push(0, 0, -1.0); + uvs.push(1.0, 1.0); + positions.push(-halfWidth, halfHeight, 0); + normals.push(0, 0, -1.0); + uvs.push(0.0, 1.0); + // Indices + indices.push(0); + indices.push(1); + indices.push(2); + indices.push(0); + indices.push(2); + indices.push(3); + // Sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs); + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + VertexData.CreateDisc = function (options) { + var positions = []; + var indices = []; + var normals = []; + var uvs = []; + var radius = options.radius || 0.5; + var tessellation = options.tessellation || 64; + var arc = (options.arc <= 0 || options.arc > 1) ? 1.0 : options.arc || 1.0; + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + // positions and uvs + positions.push(0, 0, 0); // disc center first + uvs.push(0.5, 0.5); + var theta = Math.PI * 2 * arc; + var step = theta / tessellation; + for (var a = 0; a < theta; a += step) { + var x = Math.cos(a); + var y = Math.sin(a); + var u = (x + 1) / 2; + var v = (1 - y) / 2; + positions.push(radius * x, radius * y, 0); + uvs.push(u, v); + } + if (arc === 1) { + positions.push(positions[3], positions[4], positions[5]); // close the circle + uvs.push(uvs[2], uvs[3]); + } + //indices + var vertexNb = positions.length / 3; + for (var i = 1; i < vertexNb - 1; i++) { + indices.push(i + 1, 0, i); + } + // result + VertexData.ComputeNormals(positions, indices, normals); + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs); + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + VertexData.CreateIcoSphere = function (options) { + var sideOrientation = options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + var radius = options.radius || 1; + var flat = (options.flat === undefined) ? true : options.flat; + var subdivisions = options.subdivisions || 4; + var radiusX = options.radiusX || radius; + var radiusY = options.radiusY || radius; + var radiusZ = options.radiusZ || radius; + var t = (1 + Math.sqrt(5)) / 2; + // 12 vertex x,y,z + var ico_vertices = [ + -1, t, -0, 1, t, 0, -1, -t, 0, 1, -t, 0, + 0, -1, -t, 0, 1, -t, 0, -1, t, 0, 1, t, + t, 0, 1, t, 0, -1, -t, 0, 1, -t, 0, -1 // v8-11 + ]; + // index of 3 vertex makes a face of icopshere + var ico_indices = [ + 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 12, 22, 23, + 1, 5, 20, 5, 11, 4, 23, 22, 13, 22, 18, 6, 7, 1, 8, + 14, 21, 4, 14, 4, 2, 16, 13, 6, 15, 6, 19, 3, 8, 9, + 4, 21, 5, 13, 17, 23, 6, 13, 22, 19, 6, 18, 9, 8, 1 + ]; + // vertex for uv have aliased position, not for UV + var vertices_unalias_id = [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + // vertex alias + 0, + 2, + 3, + 3, + 3, + 4, + 7, + 8, + 9, + 9, + 10, + 11 // 23: B + 12 + ]; + // uv as integer step (not pixels !) + var ico_vertexuv = [ + 5, 1, 3, 1, 6, 4, 0, 0, + 5, 3, 4, 2, 2, 2, 4, 0, + 2, 0, 1, 1, 6, 0, 6, 2, + // vertex alias (for same vertex on different faces) + 0, 4, + 3, 3, + 4, 4, + 3, 1, + 4, 2, + 4, 4, + 0, 2, + 1, 1, + 2, 2, + 3, 3, + 1, 3, + 2, 4 // 23: B + 12 + ]; + // Vertices[0, 1, ...9, A, B] : position on UV plane + // '+' indicate duplicate position to be fixed (3,9:0,2,3,4,7,8,A,B) + // First island of uv mapping + // v = 4h 3+ 2 + // v = 3h 9+ 4 + // v = 2h 9+ 5 B + // v = 1h 9 1 0 + // v = 0h 3 8 7 A + // u = 0 1 2 3 4 5 6 *a + // Second island of uv mapping + // v = 4h 0+ B+ 4+ + // v = 3h A+ 2+ + // v = 2h 7+ 6 3+ + // v = 1h 8+ 3+ + // v = 0h + // u = 0 1 2 3 4 5 6 *a + // Face layout on texture UV mapping + // ============ + // \ 4 /\ 16 / ====== + // \ / \ / /\ 11 / + // \/ 7 \/ / \ / + // ======= / 10 \/ + // /\ 17 /\ ======= + // / \ / \ \ 15 /\ + // / 8 \/ 12 \ \ / \ + // ============ \/ 6 \ + // \ 18 /\ ============ + // \ / \ \ 5 /\ 0 / + // \/ 13 \ \ / \ / + // ======= \/ 1 \/ + // ============= + // /\ 19 /\ 2 /\ + // / \ / \ / \ + // / 14 \/ 9 \/ 3 \ + // =================== + // uv step is u:1 or 0.5, v:cos(30)=sqrt(3)/2, ratio approx is 84/97 + var ustep = 138 / 1024; + var vstep = 239 / 1024; + var uoffset = 60 / 1024; + var voffset = 26 / 1024; + // Second island should have margin, not to touch the first island + // avoid any borderline artefact in pixel rounding + var island_u_offset = -40 / 1024; + var island_v_offset = +20 / 1024; + // face is either island 0 or 1 : + // second island is for faces : [4, 7, 8, 12, 13, 16, 17, 18] + var island = [ + 0, 0, 0, 0, 1, + 0, 0, 1, 1, 0, + 0, 0, 1, 1, 0, + 0, 1, 1, 1, 0 // 15 - 19 + ]; + var indices = []; + var positions = []; + var normals = []; + var uvs = []; + var current_indice = 0; + // prepare array of 3 vector (empty) (to be worked in place, shared for each face) + var face_vertex_pos = new Array(3); + var face_vertex_uv = new Array(3); + var v012; + for (v012 = 0; v012 < 3; v012++) { + face_vertex_pos[v012] = BABYLON.Vector3.Zero(); + face_vertex_uv[v012] = BABYLON.Vector2.Zero(); + } + // create all with normals + for (var face = 0; face < 20; face++) { + // 3 vertex per face + for (v012 = 0; v012 < 3; v012++) { + // look up vertex 0,1,2 to its index in 0 to 11 (or 23 including alias) + var v_id = ico_indices[3 * face + v012]; + // vertex have 3D position (x,y,z) + face_vertex_pos[v012].copyFromFloats(ico_vertices[3 * vertices_unalias_id[v_id]], ico_vertices[3 * vertices_unalias_id[v_id] + 1], ico_vertices[3 * vertices_unalias_id[v_id] + 2]); + // Normalize to get normal, then scale to radius + face_vertex_pos[v012].normalize().scaleInPlace(radius); + // uv Coordinates from vertex ID + face_vertex_uv[v012].copyFromFloats(ico_vertexuv[2 * v_id] * ustep + uoffset + island[face] * island_u_offset, ico_vertexuv[2 * v_id + 1] * vstep + voffset + island[face] * island_v_offset); + } + // Subdivide the face (interpolate pos, norm, uv) + // - pos is linear interpolation, then projected to sphere (converge polyhedron to sphere) + // - norm is linear interpolation of vertex corner normal + // (to be checked if better to re-calc from face vertex, or if approximation is OK ??? ) + // - uv is linear interpolation + // + // Topology is as below for sub-divide by 2 + // vertex shown as v0,v1,v2 + // interp index is i1 to progress in range [v0,v1[ + // interp index is i2 to progress in range [v0,v2[ + // face index as (i1,i2) for /\ : (i1,i2),(i1+1,i2),(i1,i2+1) + // and (i1,i2)' for \/ : (i1+1,i2),(i1+1,i2+1),(i1,i2+1) + // + // + // i2 v2 + // ^ ^ + // / / \ + // / / \ + // / / \ + // / / (0,1) \ + // / #---------\ + // / / \ (0,0)'/ \ + // / / \ / \ + // / / \ / \ + // / / (0,0) \ / (1,0) \ + // / #---------#---------\ + // v0 v1 + // + // --------------------> i1 + // + // interp of (i1,i2): + // along i2 : x0=lerp(v0,v2, i2/S) <---> x1=lerp(v1,v2, i2/S) + // along i1 : lerp(x0,x1, i1/(S-i2)) + // + // centroid of triangle is needed to get help normal computation + // (c1,c2) are used for centroid location + var interp_vertex = function (i1, i2, c1, c2) { + // vertex is interpolated from + // - face_vertex_pos[0..2] + // - face_vertex_uv[0..2] + var pos_x0 = BABYLON.Vector3.Lerp(face_vertex_pos[0], face_vertex_pos[2], i2 / subdivisions); + var pos_x1 = BABYLON.Vector3.Lerp(face_vertex_pos[1], face_vertex_pos[2], i2 / subdivisions); + var pos_interp = (subdivisions === i2) ? face_vertex_pos[2] : BABYLON.Vector3.Lerp(pos_x0, pos_x1, i1 / (subdivisions - i2)); + pos_interp.normalize(); + var vertex_normal; + if (flat) { + // in flat mode, recalculate normal as face centroid normal + var centroid_x0 = BABYLON.Vector3.Lerp(face_vertex_pos[0], face_vertex_pos[2], c2 / subdivisions); + var centroid_x1 = BABYLON.Vector3.Lerp(face_vertex_pos[1], face_vertex_pos[2], c2 / subdivisions); + vertex_normal = BABYLON.Vector3.Lerp(centroid_x0, centroid_x1, c1 / (subdivisions - c2)); + } + else { + // in smooth mode, recalculate normal from each single vertex position + vertex_normal = new BABYLON.Vector3(pos_interp.x, pos_interp.y, pos_interp.z); + } + // Vertex normal need correction due to X,Y,Z radius scaling + vertex_normal.x /= radiusX; + vertex_normal.y /= radiusY; + vertex_normal.z /= radiusZ; + vertex_normal.normalize(); + var uv_x0 = BABYLON.Vector2.Lerp(face_vertex_uv[0], face_vertex_uv[2], i2 / subdivisions); + var uv_x1 = BABYLON.Vector2.Lerp(face_vertex_uv[1], face_vertex_uv[2], i2 / subdivisions); + var uv_interp = (subdivisions === i2) ? face_vertex_uv[2] : BABYLON.Vector2.Lerp(uv_x0, uv_x1, i1 / (subdivisions - i2)); + positions.push(pos_interp.x * radiusX, pos_interp.y * radiusY, pos_interp.z * radiusZ); + normals.push(vertex_normal.x, vertex_normal.y, vertex_normal.z); + uvs.push(uv_interp.x, uv_interp.y); + // push each vertex has member of a face + // Same vertex can bleong to multiple face, it is pushed multiple time (duplicate vertex are present) + indices.push(current_indice); + current_indice++; + }; + for (var i2 = 0; i2 < subdivisions; i2++) { + for (var i1 = 0; i1 + i2 < subdivisions; i1++) { + // face : (i1,i2) for /\ : + // interp for : (i1,i2),(i1+1,i2),(i1,i2+1) + interp_vertex(i1, i2, i1 + 1.0 / 3, i2 + 1.0 / 3); + interp_vertex(i1 + 1, i2, i1 + 1.0 / 3, i2 + 1.0 / 3); + interp_vertex(i1, i2 + 1, i1 + 1.0 / 3, i2 + 1.0 / 3); + if (i1 + i2 + 1 < subdivisions) { + // face : (i1,i2)' for \/ : + // interp for (i1+1,i2),(i1+1,i2+1),(i1,i2+1) + interp_vertex(i1 + 1, i2, i1 + 2.0 / 3, i2 + 2.0 / 3); + interp_vertex(i1 + 1, i2 + 1, i1 + 2.0 / 3, i2 + 2.0 / 3); + interp_vertex(i1, i2 + 1, i1 + 2.0 / 3, i2 + 2.0 / 3); + } + } + } + } + // Sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs); + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + // inspired from // http://stemkoski.github.io/Three.js/Polyhedra.html + VertexData.CreatePolyhedron = function (options) { + // provided polyhedron types : + // 0 : Tetrahedron, 1 : Octahedron, 2 : Dodecahedron, 3 : Icosahedron, 4 : Rhombicuboctahedron, 5 : Triangular Prism, 6 : Pentagonal Prism, 7 : Hexagonal Prism, 8 : Square Pyramid (J1) + // 9 : Pentagonal Pyramid (J2), 10 : Triangular Dipyramid (J12), 11 : Pentagonal Dipyramid (J13), 12 : Elongated Square Dipyramid (J15), 13 : Elongated Pentagonal Dipyramid (J16), 14 : Elongated Pentagonal Cupola (J20) + var polyhedra = []; + polyhedra[0] = { vertex: [[0, 0, 1.732051], [1.632993, 0, -0.5773503], [-0.8164966, 1.414214, -0.5773503], [-0.8164966, -1.414214, -0.5773503]], face: [[0, 1, 2], [0, 2, 3], [0, 3, 1], [1, 3, 2]] }; + polyhedra[1] = { vertex: [[0, 0, 1.414214], [1.414214, 0, 0], [0, 1.414214, 0], [-1.414214, 0, 0], [0, -1.414214, 0], [0, 0, -1.414214]], face: [[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 1], [1, 4, 5], [1, 5, 2], [2, 5, 3], [3, 5, 4]] }; + polyhedra[2] = { + vertex: [[0, 0, 1.070466], [0.7136442, 0, 0.7978784], [-0.3568221, 0.618034, 0.7978784], [-0.3568221, -0.618034, 0.7978784], [0.7978784, 0.618034, 0.3568221], [0.7978784, -0.618034, 0.3568221], [-0.9341724, 0.381966, 0.3568221], [0.1362939, 1, 0.3568221], [0.1362939, -1, 0.3568221], [-0.9341724, -0.381966, 0.3568221], [0.9341724, 0.381966, -0.3568221], [0.9341724, -0.381966, -0.3568221], [-0.7978784, 0.618034, -0.3568221], [-0.1362939, 1, -0.3568221], [-0.1362939, -1, -0.3568221], [-0.7978784, -0.618034, -0.3568221], [0.3568221, 0.618034, -0.7978784], [0.3568221, -0.618034, -0.7978784], [-0.7136442, 0, -0.7978784], [0, 0, -1.070466]], + face: [[0, 1, 4, 7, 2], [0, 2, 6, 9, 3], [0, 3, 8, 5, 1], [1, 5, 11, 10, 4], [2, 7, 13, 12, 6], [3, 9, 15, 14, 8], [4, 10, 16, 13, 7], [5, 8, 14, 17, 11], [6, 12, 18, 15, 9], [10, 11, 17, 19, 16], [12, 13, 16, 19, 18], [14, 15, 18, 19, 17]] + }; + polyhedra[3] = { + vertex: [[0, 0, 1.175571], [1.051462, 0, 0.5257311], [0.3249197, 1, 0.5257311], [-0.8506508, 0.618034, 0.5257311], [-0.8506508, -0.618034, 0.5257311], [0.3249197, -1, 0.5257311], [0.8506508, 0.618034, -0.5257311], [0.8506508, -0.618034, -0.5257311], [-0.3249197, 1, -0.5257311], [-1.051462, 0, -0.5257311], [-0.3249197, -1, -0.5257311], [0, 0, -1.175571]], + face: [[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1], [1, 5, 7], [1, 7, 6], [1, 6, 2], [2, 6, 8], [2, 8, 3], [3, 8, 9], [3, 9, 4], [4, 9, 10], [4, 10, 5], [5, 10, 7], [6, 7, 11], [6, 11, 8], [7, 10, 11], [8, 11, 9], [9, 11, 10]] + }; + polyhedra[4] = { + vertex: [[0, 0, 1.070722], [0.7148135, 0, 0.7971752], [-0.104682, 0.7071068, 0.7971752], [-0.6841528, 0.2071068, 0.7971752], [-0.104682, -0.7071068, 0.7971752], [0.6101315, 0.7071068, 0.5236279], [1.04156, 0.2071068, 0.1367736], [0.6101315, -0.7071068, 0.5236279], [-0.3574067, 1, 0.1367736], [-0.7888348, -0.5, 0.5236279], [-0.9368776, 0.5, 0.1367736], [-0.3574067, -1, 0.1367736], [0.3574067, 1, -0.1367736], [0.9368776, -0.5, -0.1367736], [0.7888348, 0.5, -0.5236279], [0.3574067, -1, -0.1367736], [-0.6101315, 0.7071068, -0.5236279], [-1.04156, -0.2071068, -0.1367736], [-0.6101315, -0.7071068, -0.5236279], [0.104682, 0.7071068, -0.7971752], [0.6841528, -0.2071068, -0.7971752], [0.104682, -0.7071068, -0.7971752], [-0.7148135, 0, -0.7971752], [0, 0, -1.070722]], + face: [[0, 2, 3], [1, 6, 5], [4, 9, 11], [7, 15, 13], [8, 16, 10], [12, 14, 19], [17, 22, 18], [20, 21, 23], [0, 1, 5, 2], [0, 3, 9, 4], [0, 4, 7, 1], [1, 7, 13, 6], [2, 5, 12, 8], [2, 8, 10, 3], [3, 10, 17, 9], [4, 11, 15, 7], [5, 6, 14, 12], [6, 13, 20, 14], [8, 12, 19, 16], [9, 17, 18, 11], [10, 16, 22, 17], [11, 18, 21, 15], [13, 15, 21, 20], [14, 20, 23, 19], [16, 19, 23, 22], [18, 22, 23, 21]] + }; + polyhedra[5] = { vertex: [[0, 0, 1.322876], [1.309307, 0, 0.1889822], [-0.9819805, 0.8660254, 0.1889822], [0.1636634, -1.299038, 0.1889822], [0.3273268, 0.8660254, -0.9449112], [-0.8183171, -0.4330127, -0.9449112]], face: [[0, 3, 1], [2, 4, 5], [0, 1, 4, 2], [0, 2, 5, 3], [1, 3, 5, 4]] }; + polyhedra[6] = { vertex: [[0, 0, 1.159953], [1.013464, 0, 0.5642542], [-0.3501431, 0.9510565, 0.5642542], [-0.7715208, -0.6571639, 0.5642542], [0.6633206, 0.9510565, -0.03144481], [0.8682979, -0.6571639, -0.3996071], [-1.121664, 0.2938926, -0.03144481], [-0.2348831, -1.063314, -0.3996071], [0.5181548, 0.2938926, -0.9953061], [-0.5850262, -0.112257, -0.9953061]], face: [[0, 1, 4, 2], [0, 2, 6, 3], [1, 5, 8, 4], [3, 6, 9, 7], [5, 7, 9, 8], [0, 3, 7, 5, 1], [2, 4, 8, 9, 6]] }; + polyhedra[7] = { vertex: [[0, 0, 1.118034], [0.8944272, 0, 0.6708204], [-0.2236068, 0.8660254, 0.6708204], [-0.7826238, -0.4330127, 0.6708204], [0.6708204, 0.8660254, 0.2236068], [1.006231, -0.4330127, -0.2236068], [-1.006231, 0.4330127, 0.2236068], [-0.6708204, -0.8660254, -0.2236068], [0.7826238, 0.4330127, -0.6708204], [0.2236068, -0.8660254, -0.6708204], [-0.8944272, 0, -0.6708204], [0, 0, -1.118034]], face: [[0, 1, 4, 2], [0, 2, 6, 3], [1, 5, 8, 4], [3, 6, 10, 7], [5, 9, 11, 8], [7, 10, 11, 9], [0, 3, 7, 9, 5, 1], [2, 4, 8, 11, 10, 6]] }; + polyhedra[8] = { vertex: [[-0.729665, 0.670121, 0.319155], [-0.655235, -0.29213, -0.754096], [-0.093922, -0.607123, 0.537818], [0.702196, 0.595691, 0.485187], [0.776626, -0.36656, -0.588064]], face: [[1, 4, 2], [0, 1, 2], [3, 0, 2], [4, 3, 2], [4, 1, 0, 3]] }; + polyhedra[9] = { vertex: [[-0.868849, -0.100041, 0.61257], [-0.329458, 0.976099, 0.28078], [-0.26629, -0.013796, -0.477654], [-0.13392, -1.034115, 0.229829], [0.738834, 0.707117, -0.307018], [0.859683, -0.535264, -0.338508]], face: [[3, 0, 2], [5, 3, 2], [4, 5, 2], [1, 4, 2], [0, 1, 2], [0, 3, 5, 4, 1]] }; + polyhedra[10] = { vertex: [[-0.610389, 0.243975, 0.531213], [-0.187812, -0.48795, -0.664016], [-0.187812, 0.9759, -0.664016], [0.187812, -0.9759, 0.664016], [0.798201, 0.243975, 0.132803]], face: [[1, 3, 0], [3, 4, 0], [3, 1, 4], [0, 2, 1], [0, 4, 2], [2, 4, 1]] }; + polyhedra[11] = { vertex: [[-1.028778, 0.392027, -0.048786], [-0.640503, -0.646161, 0.621837], [-0.125162, -0.395663, -0.540059], [0.004683, 0.888447, -0.651988], [0.125161, 0.395663, 0.540059], [0.632925, -0.791376, 0.433102], [1.031672, 0.157063, -0.354165]], face: [[3, 2, 0], [2, 1, 0], [2, 5, 1], [0, 4, 3], [0, 1, 4], [4, 1, 5], [2, 3, 6], [3, 4, 6], [5, 2, 6], [4, 5, 6]] }; + polyhedra[12] = { vertex: [[-0.669867, 0.334933, -0.529576], [-0.669867, 0.334933, 0.529577], [-0.4043, 1.212901, 0], [-0.334933, -0.669867, -0.529576], [-0.334933, -0.669867, 0.529577], [0.334933, 0.669867, -0.529576], [0.334933, 0.669867, 0.529577], [0.4043, -1.212901, 0], [0.669867, -0.334933, -0.529576], [0.669867, -0.334933, 0.529577]], face: [[8, 9, 7], [6, 5, 2], [3, 8, 7], [5, 0, 2], [4, 3, 7], [0, 1, 2], [9, 4, 7], [1, 6, 2], [9, 8, 5, 6], [8, 3, 0, 5], [3, 4, 1, 0], [4, 9, 6, 1]] }; + polyhedra[13] = { vertex: [[-0.931836, 0.219976, -0.264632], [-0.636706, 0.318353, 0.692816], [-0.613483, -0.735083, -0.264632], [-0.326545, 0.979634, 0], [-0.318353, -0.636706, 0.692816], [-0.159176, 0.477529, -0.856368], [0.159176, -0.477529, -0.856368], [0.318353, 0.636706, 0.692816], [0.326545, -0.979634, 0], [0.613482, 0.735082, -0.264632], [0.636706, -0.318353, 0.692816], [0.931835, -0.219977, -0.264632]], face: [[11, 10, 8], [7, 9, 3], [6, 11, 8], [9, 5, 3], [2, 6, 8], [5, 0, 3], [4, 2, 8], [0, 1, 3], [10, 4, 8], [1, 7, 3], [10, 11, 9, 7], [11, 6, 5, 9], [6, 2, 0, 5], [2, 4, 1, 0], [4, 10, 7, 1]] }; + polyhedra[14] = { + vertex: [[-0.93465, 0.300459, -0.271185], [-0.838689, -0.260219, -0.516017], [-0.711319, 0.717591, 0.128359], [-0.710334, -0.156922, 0.080946], [-0.599799, 0.556003, -0.725148], [-0.503838, -0.004675, -0.969981], [-0.487004, 0.26021, 0.48049], [-0.460089, -0.750282, -0.512622], [-0.376468, 0.973135, -0.325605], [-0.331735, -0.646985, 0.084342], [-0.254001, 0.831847, 0.530001], [-0.125239, -0.494738, -0.966586], [0.029622, 0.027949, 0.730817], [0.056536, -0.982543, -0.262295], [0.08085, 1.087391, 0.076037], [0.125583, -0.532729, 0.485984], [0.262625, 0.599586, 0.780328], [0.391387, -0.726999, -0.716259], [0.513854, -0.868287, 0.139347], [0.597475, 0.85513, 0.326364], [0.641224, 0.109523, 0.783723], [0.737185, -0.451155, 0.538891], [0.848705, -0.612742, -0.314616], [0.976075, 0.365067, 0.32976], [1.072036, -0.19561, 0.084927]], + face: [[15, 18, 21], [12, 20, 16], [6, 10, 2], [3, 0, 1], [9, 7, 13], [2, 8, 4, 0], [0, 4, 5, 1], [1, 5, 11, 7], [7, 11, 17, 13], [13, 17, 22, 18], [18, 22, 24, 21], [21, 24, 23, 20], [20, 23, 19, 16], [16, 19, 14, 10], [10, 14, 8, 2], [15, 9, 13, 18], [12, 15, 21, 20], [6, 12, 16, 10], [3, 6, 2, 0], [9, 3, 1, 7], [9, 15, 12, 6, 3], [22, 17, 11, 5, 4, 8, 14, 19, 23, 24]] + }; + var type = (options.type < 0 || options.type >= polyhedra.length) ? 0 : options.type || 0; + var size = options.size; + var sizeX = options.sizeX || size || 1; + var sizeY = options.sizeY || size || 1; + var sizeZ = options.sizeZ || size || 1; + var data = options.custom || polyhedra[type]; + var nbfaces = data.face.length; + var faceUV = options.faceUV || new Array(nbfaces); + var faceColors = options.faceColors; + var flat = (options.flat === undefined) ? true : options.flat; + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + var positions = []; + var indices = []; + var normals = []; + var uvs = []; + var colors = []; + var index = 0; + var faceIdx = 0; // face cursor in the array "indexes" + var indexes = []; + var i = 0; + var f = 0; + var u, v, ang, x, y, tmp; + // default face colors and UV if undefined + if (flat) { + for (f = 0; f < nbfaces; f++) { + if (faceColors && faceColors[f] === undefined) { + faceColors[f] = new BABYLON.Color4(1, 1, 1, 1); + } + if (faceUV && faceUV[f] === undefined) { + faceUV[f] = new BABYLON.Vector4(0, 0, 1, 1); + } + } + } + if (!flat) { + for (i = 0; i < data.vertex.length; i++) { + positions.push(data.vertex[i][0] * sizeX, data.vertex[i][1] * sizeY, data.vertex[i][2] * sizeZ); + uvs.push(0, 0); + } + for (f = 0; f < nbfaces; f++) { + for (i = 0; i < data.face[f].length - 2; i++) { + indices.push(data.face[f][0], data.face[f][i + 2], data.face[f][i + 1]); + } + } + } + else { + for (f = 0; f < nbfaces; f++) { + var fl = data.face[f].length; // number of vertices of the current face + ang = 2 * Math.PI / fl; + x = 0.5 * Math.tan(ang / 2); + y = 0.5; + // positions, uvs, colors + for (i = 0; i < fl; i++) { + // positions + positions.push(data.vertex[data.face[f][i]][0] * sizeX, data.vertex[data.face[f][i]][1] * sizeY, data.vertex[data.face[f][i]][2] * sizeZ); + indexes.push(index); + index++; + // uvs + u = faceUV[f].x + (faceUV[f].z - faceUV[f].x) * (0.5 + x); + v = faceUV[f].y + (faceUV[f].w - faceUV[f].y) * (y - 0.5); + uvs.push(u, v); + tmp = x * Math.cos(ang) - y * Math.sin(ang); + y = x * Math.sin(ang) + y * Math.cos(ang); + x = tmp; + // colors + if (faceColors) { + colors.push(faceColors[f].r, faceColors[f].g, faceColors[f].b, faceColors[f].a); + } + } + // indices from indexes + for (i = 0; i < fl - 2; i++) { + indices.push(indexes[0 + faceIdx], indexes[i + 2 + faceIdx], indexes[i + 1 + faceIdx]); + } + faceIdx += fl; + } + } + VertexData.ComputeNormals(positions, indices, normals); + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs); + var vertexData = new VertexData(); + vertexData.positions = positions; + vertexData.indices = indices; + vertexData.normals = normals; + vertexData.uvs = uvs; + if (faceColors && flat) { + vertexData.colors = colors; + } + return vertexData; + }; + // based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3D/src/away3d/primitives/TorusKnot.as?spec=svn2473&r=2473 + VertexData.CreateTorusKnot = function (options) { + var indices = []; + var positions = []; + var normals = []; + var uvs = []; + var radius = options.radius || 2; + var tube = options.tube || 0.5; + var radialSegments = options.radialSegments || 32; + var tubularSegments = options.tubularSegments || 32; + var p = options.p || 2; + var q = options.q || 3; + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + // Helper + var getPos = function (angle) { + var cu = Math.cos(angle); + var su = Math.sin(angle); + var quOverP = q / p * angle; + var cs = Math.cos(quOverP); + var tx = radius * (2 + cs) * 0.5 * cu; + var ty = radius * (2 + cs) * su * 0.5; + var tz = radius * Math.sin(quOverP) * 0.5; + return new BABYLON.Vector3(tx, ty, tz); + }; + // Vertices + var i; + var j; + for (i = 0; i <= radialSegments; i++) { + var modI = i % radialSegments; + var u = modI / radialSegments * 2 * p * Math.PI; + var p1 = getPos(u); + var p2 = getPos(u + 0.01); + var tang = p2.subtract(p1); + var n = p2.add(p1); + var bitan = BABYLON.Vector3.Cross(tang, n); + n = BABYLON.Vector3.Cross(bitan, tang); + bitan.normalize(); + n.normalize(); + for (j = 0; j < tubularSegments; j++) { + var modJ = j % tubularSegments; + var v = modJ / tubularSegments * 2 * Math.PI; + var cx = -tube * Math.cos(v); + var cy = tube * Math.sin(v); + positions.push(p1.x + cx * n.x + cy * bitan.x); + positions.push(p1.y + cx * n.y + cy * bitan.y); + positions.push(p1.z + cx * n.z + cy * bitan.z); + uvs.push(i / radialSegments); + uvs.push(j / tubularSegments); + } + } + for (i = 0; i < radialSegments; i++) { + for (j = 0; j < tubularSegments; j++) { + var jNext = (j + 1) % tubularSegments; + var a = i * tubularSegments + j; + var b = (i + 1) * tubularSegments + j; + var c = (i + 1) * tubularSegments + jNext; + var d = i * tubularSegments + jNext; + indices.push(d); + indices.push(b); + indices.push(a); + indices.push(d); + indices.push(c); + indices.push(b); + } + } + // Normals + VertexData.ComputeNormals(positions, indices, normals); + // Sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs); + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + // Tools + /** + * @param {any} - positions (number[] or Float32Array) + * @param {any} - indices (number[] or Uint16Array) + * @param {any} - normals (number[] or Float32Array) + */ + VertexData.ComputeNormals = function (positions, indices, normals) { + var index = 0; + var p1p2x = 0.0; + var p1p2y = 0.0; + var p1p2z = 0.0; + var p3p2x = 0.0; + var p3p2y = 0.0; + var p3p2z = 0.0; + var faceNormalx = 0.0; + var faceNormaly = 0.0; + var faceNormalz = 0.0; + var length = 0.0; + var i1 = 0; + var i2 = 0; + var i3 = 0; + for (index = 0; index < positions.length; index++) { + normals[index] = 0.0; + } + // indice triplet = 1 face + var nbFaces = indices.length / 3; + for (index = 0; index < nbFaces; index++) { + i1 = indices[index * 3]; // get the indexes of each vertex of the face + i2 = indices[index * 3 + 1]; + i3 = indices[index * 3 + 2]; + p1p2x = positions[i1 * 3] - positions[i2 * 3]; // compute two vectors per face + p1p2y = positions[i1 * 3 + 1] - positions[i2 * 3 + 1]; + p1p2z = positions[i1 * 3 + 2] - positions[i2 * 3 + 2]; + p3p2x = positions[i3 * 3] - positions[i2 * 3]; + p3p2y = positions[i3 * 3 + 1] - positions[i2 * 3 + 1]; + p3p2z = positions[i3 * 3 + 2] - positions[i2 * 3 + 2]; + faceNormalx = p1p2y * p3p2z - p1p2z * p3p2y; // compute the face normal with cross product + faceNormaly = p1p2z * p3p2x - p1p2x * p3p2z; + faceNormalz = p1p2x * p3p2y - p1p2y * p3p2x; + length = Math.sqrt(faceNormalx * faceNormalx + faceNormaly * faceNormaly + faceNormalz * faceNormalz); + length = (length === 0) ? 1.0 : length; + faceNormalx /= length; // normalize this normal + faceNormaly /= length; + faceNormalz /= length; + normals[i1 * 3] += faceNormalx; // accumulate all the normals per face + normals[i1 * 3 + 1] += faceNormaly; + normals[i1 * 3 + 2] += faceNormalz; + normals[i2 * 3] += faceNormalx; + normals[i2 * 3 + 1] += faceNormaly; + normals[i2 * 3 + 2] += faceNormalz; + normals[i3 * 3] += faceNormalx; + normals[i3 * 3 + 1] += faceNormaly; + normals[i3 * 3 + 2] += faceNormalz; + } + // last normalization of each normal + for (index = 0; index < normals.length / 3; index++) { + faceNormalx = normals[index * 3]; + faceNormaly = normals[index * 3 + 1]; + faceNormalz = normals[index * 3 + 2]; + length = Math.sqrt(faceNormalx * faceNormalx + faceNormaly * faceNormaly + faceNormalz * faceNormalz); + length = (length === 0) ? 1.0 : length; + faceNormalx /= length; + faceNormaly /= length; + faceNormalz /= length; + normals[index * 3] = faceNormalx; + normals[index * 3 + 1] = faceNormaly; + normals[index * 3 + 2] = faceNormalz; + } + }; + VertexData._ComputeSides = function (sideOrientation, positions, indices, normals, uvs) { + var li = indices.length; + var ln = normals.length; + var i; + var n; + sideOrientation = sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + switch (sideOrientation) { + case BABYLON.Mesh.FRONTSIDE: + // nothing changed + break; + case BABYLON.Mesh.BACKSIDE: + var tmp; + // indices + for (i = 0; i < li; i += 3) { + tmp = indices[i]; + indices[i] = indices[i + 2]; + indices[i + 2] = tmp; + } + // normals + for (n = 0; n < ln; n++) { + normals[n] = -normals[n]; + } + break; + case BABYLON.Mesh.DOUBLESIDE: + // positions + var lp = positions.length; + var l = lp / 3; + for (var p = 0; p < lp; p++) { + positions[lp + p] = positions[p]; + } + // indices + for (i = 0; i < li; i += 3) { + indices[i + li] = indices[i + 2] + l; + indices[i + 1 + li] = indices[i + 1] + l; + indices[i + 2 + li] = indices[i] + l; + } + // normals + for (n = 0; n < ln; n++) { + normals[ln + n] = -normals[n]; + } + // uvs + var lu = uvs.length; + for (var u = 0; u < lu; u++) { + uvs[u + lu] = uvs[u]; + } + break; + } + }; + VertexData.ImportVertexData = function (parsedVertexData, geometry) { + var vertexData = new VertexData(); + // positions + var positions = parsedVertexData.positions; + if (positions) { + vertexData.set(positions, BABYLON.VertexBuffer.PositionKind); + } + // normals + var normals = parsedVertexData.normals; + if (normals) { + vertexData.set(normals, BABYLON.VertexBuffer.NormalKind); + } + // uvs + var uvs = parsedVertexData.uvs; + if (uvs) { + vertexData.set(uvs, BABYLON.VertexBuffer.UVKind); + } + // uv2s + var uv2s = parsedVertexData.uv2s; + if (uv2s) { + vertexData.set(uv2s, BABYLON.VertexBuffer.UV2Kind); + } + // uv3s + var uv3s = parsedVertexData.uv3s; + if (uv3s) { + vertexData.set(uv3s, BABYLON.VertexBuffer.UV3Kind); + } + // uv4s + var uv4s = parsedVertexData.uv4s; + if (uv4s) { + vertexData.set(uv4s, BABYLON.VertexBuffer.UV4Kind); + } + // uv5s + var uv5s = parsedVertexData.uv5s; + if (uv5s) { + vertexData.set(uv5s, BABYLON.VertexBuffer.UV5Kind); + } + // uv6s + var uv6s = parsedVertexData.uv6s; + if (uv6s) { + vertexData.set(uv6s, BABYLON.VertexBuffer.UV6Kind); + } + // colors + var colors = parsedVertexData.colors; + if (colors) { + vertexData.set(BABYLON.Color4.CheckColors4(colors, positions.length / 3), BABYLON.VertexBuffer.ColorKind); + } + // matricesIndices + var matricesIndices = parsedVertexData.matricesIndices; + if (matricesIndices) { + vertexData.set(matricesIndices, BABYLON.VertexBuffer.MatricesIndicesKind); + } + // matricesWeights + var matricesWeights = parsedVertexData.matricesWeights; + if (matricesWeights) { + vertexData.set(matricesWeights, BABYLON.VertexBuffer.MatricesWeightsKind); + } + // indices + var indices = parsedVertexData.indices; + if (indices) { + vertexData.indices = indices; + } + geometry.setAllVerticesData(vertexData, parsedVertexData.updatable); + }; + return VertexData; + }()); + BABYLON.VertexData = VertexData; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.mesh.vertexData.js.map + +var BABYLON; +(function (BABYLON) { + var Tags = (function () { + function Tags() { + } + Tags.EnableFor = function (obj) { + obj._tags = obj._tags || {}; + obj.hasTags = function () { + return Tags.HasTags(obj); + }; + obj.addTags = function (tagsString) { + return Tags.AddTagsTo(obj, tagsString); + }; + obj.removeTags = function (tagsString) { + return Tags.RemoveTagsFrom(obj, tagsString); + }; + obj.matchesTagsQuery = function (tagsQuery) { + return Tags.MatchesQuery(obj, tagsQuery); + }; + }; + Tags.DisableFor = function (obj) { + delete obj._tags; + delete obj.hasTags; + delete obj.addTags; + delete obj.removeTags; + delete obj.matchesTagsQuery; + }; + Tags.HasTags = function (obj) { + if (!obj._tags) { + return false; + } + return !BABYLON.Tools.IsEmpty(obj._tags); + }; + Tags.GetTags = function (obj, asString) { + if (asString === void 0) { asString = true; } + if (!obj._tags) { + return null; + } + if (asString) { + var tagsArray = []; + for (var tag in obj._tags) { + if (obj._tags.hasOwnProperty(tag) && obj._tags[tag] === true) { + tagsArray.push(tag); + } + } + return tagsArray.join(" "); + } + else { + return obj._tags; + } + }; + // the tags 'true' and 'false' are reserved and cannot be used as tags + // a tag cannot start with '||', '&&', and '!' + // it cannot contain whitespaces + Tags.AddTagsTo = function (obj, tagsString) { + if (!tagsString) { + return; + } + if (typeof tagsString !== "string") { + return; + } + var tags = tagsString.split(" "); + tags.forEach(function (tag, index, array) { + Tags._AddTagTo(obj, tag); + }); + }; + Tags._AddTagTo = function (obj, tag) { + tag = tag.trim(); + if (tag === "" || tag === "true" || tag === "false") { + return; + } + if (tag.match(/[\s]/) || tag.match(/^([!]|([|]|[&]){2})/)) { + return; + } + Tags.EnableFor(obj); + obj._tags[tag] = true; + }; + Tags.RemoveTagsFrom = function (obj, tagsString) { + if (!Tags.HasTags(obj)) { + return; + } + var tags = tagsString.split(" "); + for (var t in tags) { + Tags._RemoveTagFrom(obj, tags[t]); + } + }; + Tags._RemoveTagFrom = function (obj, tag) { + delete obj._tags[tag]; + }; + Tags.MatchesQuery = function (obj, tagsQuery) { + if (tagsQuery === undefined) { + return true; + } + if (tagsQuery === "") { + return Tags.HasTags(obj); + } + return BABYLON.Internals.AndOrNotEvaluator.Eval(tagsQuery, function (r) { return Tags.HasTags(obj) && obj._tags[r]; }); + }; + return Tags; + }()); + BABYLON.Tags = Tags; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.tags.js.map + +var BABYLON; +(function (BABYLON) { + var Internals; + (function (Internals) { + var AndOrNotEvaluator = (function () { + function AndOrNotEvaluator() { + } + AndOrNotEvaluator.Eval = function (query, evaluateCallback) { + if (!query.match(/\([^\(\)]*\)/g)) { + query = AndOrNotEvaluator._HandleParenthesisContent(query, evaluateCallback); + } + else { + query = query.replace(/\([^\(\)]*\)/g, function (r) { + // remove parenthesis + r = r.slice(1, r.length - 1); + return AndOrNotEvaluator._HandleParenthesisContent(r, evaluateCallback); + }); + } + if (query === "true") { + return true; + } + if (query === "false") { + return false; + } + return AndOrNotEvaluator.Eval(query, evaluateCallback); + }; + AndOrNotEvaluator._HandleParenthesisContent = function (parenthesisContent, evaluateCallback) { + evaluateCallback = evaluateCallback || (function (r) { + return r === "true" ? true : false; + }); + var result; + var or = parenthesisContent.split("||"); + for (var i in or) { + if (or.hasOwnProperty(i)) { + var ori = AndOrNotEvaluator._SimplifyNegation(or[i].trim()); + var and = ori.split("&&"); + if (and.length > 1) { + for (var j = 0; j < and.length; ++j) { + var andj = AndOrNotEvaluator._SimplifyNegation(and[j].trim()); + if (andj !== "true" && andj !== "false") { + if (andj[0] === "!") { + result = !evaluateCallback(andj.substring(1)); + } + else { + result = evaluateCallback(andj); + } + } + else { + result = andj === "true" ? true : false; + } + if (!result) { + ori = "false"; + break; + } + } + } + if (result || ori === "true") { + result = true; + break; + } + // result equals false (or undefined) + if (ori !== "true" && ori !== "false") { + if (ori[0] === "!") { + result = !evaluateCallback(ori.substring(1)); + } + else { + result = evaluateCallback(ori); + } + } + else { + result = ori === "true" ? true : false; + } + } + } + // the whole parenthesis scope is replaced by 'true' or 'false' + return result ? "true" : "false"; + }; + AndOrNotEvaluator._SimplifyNegation = function (booleanString) { + booleanString = booleanString.replace(/^[\s!]+/, function (r) { + // remove whitespaces + r = r.replace(/[\s]/g, function () { return ""; }); + return r.length % 2 ? "!" : ""; + }); + booleanString = booleanString.trim(); + if (booleanString === "!true") { + booleanString = "false"; + } + else if (booleanString === "!false") { + booleanString = "true"; + } + return booleanString; + }; + return AndOrNotEvaluator; + }()); + Internals.AndOrNotEvaluator = AndOrNotEvaluator; + })(Internals = BABYLON.Internals || (BABYLON.Internals = {})); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.andOrNotEvaluator.js.map + +var BABYLON; +(function (BABYLON) { + var PostProcessRenderPass = (function () { + function PostProcessRenderPass(scene, name, size, renderList, beforeRender, afterRender) { + this._enabled = true; + this._refCount = 0; + this._name = name; + this._renderTexture = new BABYLON.RenderTargetTexture(name, size, scene); + this.setRenderList(renderList); + this._renderTexture.onBeforeRenderObservable.add(beforeRender); + this._renderTexture.onAfterRenderObservable.add(afterRender); + this._scene = scene; + this._renderList = renderList; + } + // private + PostProcessRenderPass.prototype._incRefCount = function () { + if (this._refCount === 0) { + this._scene.customRenderTargets.push(this._renderTexture); + } + return ++this._refCount; + }; + PostProcessRenderPass.prototype._decRefCount = function () { + this._refCount--; + if (this._refCount <= 0) { + this._scene.customRenderTargets.splice(this._scene.customRenderTargets.indexOf(this._renderTexture), 1); + } + return this._refCount; + }; + PostProcessRenderPass.prototype._update = function () { + this.setRenderList(this._renderList); + }; + // public + PostProcessRenderPass.prototype.setRenderList = function (renderList) { + this._renderTexture.renderList = renderList; + }; + PostProcessRenderPass.prototype.getRenderTexture = function () { + return this._renderTexture; + }; + return PostProcessRenderPass; + }()); + BABYLON.PostProcessRenderPass = PostProcessRenderPass; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.postProcessRenderPass.js.map + +var BABYLON; +(function (BABYLON) { + var PostProcessRenderEffect = (function () { + function PostProcessRenderEffect(engine, name, getPostProcess, singleInstance) { + this._engine = engine; + this._name = name; + this._singleInstance = singleInstance || true; + this._getPostProcess = getPostProcess; + this._cameras = []; + this._indicesForCamera = []; + this._postProcesses = {}; + this._renderPasses = {}; + this._renderEffectAsPasses = {}; + } + Object.defineProperty(PostProcessRenderEffect.prototype, "isSupported", { + get: function () { + for (var index in this._postProcesses) { + if (!this._postProcesses[index].isSupported) { + return false; + } + } + return true; + }, + enumerable: true, + configurable: true + }); + PostProcessRenderEffect.prototype._update = function () { + for (var renderPassName in this._renderPasses) { + this._renderPasses[renderPassName]._update(); + } + }; + PostProcessRenderEffect.prototype.addPass = function (renderPass) { + this._renderPasses[renderPass._name] = renderPass; + this._linkParameters(); + }; + PostProcessRenderEffect.prototype.removePass = function (renderPass) { + delete this._renderPasses[renderPass._name]; + this._linkParameters(); + }; + PostProcessRenderEffect.prototype.addRenderEffectAsPass = function (renderEffect) { + this._renderEffectAsPasses[renderEffect._name] = renderEffect; + this._linkParameters(); + }; + PostProcessRenderEffect.prototype.getPass = function (passName) { + for (var renderPassName in this._renderPasses) { + if (renderPassName === passName) { + return this._renderPasses[passName]; + } + } + }; + PostProcessRenderEffect.prototype.emptyPasses = function () { + this._renderPasses = {}; + this._linkParameters(); + }; + PostProcessRenderEffect.prototype._attachCameras = function (cameras) { + var cameraKey; + var _cam = BABYLON.Tools.MakeArray(cameras || this._cameras); + for (var i = 0; i < _cam.length; i++) { + var camera = _cam[i]; + var cameraName = camera.name; + if (this._singleInstance) { + cameraKey = 0; + } + else { + cameraKey = cameraName; + } + this._postProcesses[cameraKey] = this._postProcesses[cameraKey] || this._getPostProcess(); + var index = camera.attachPostProcess(this._postProcesses[cameraKey]); + if (!this._indicesForCamera[cameraName]) { + this._indicesForCamera[cameraName] = []; + } + this._indicesForCamera[cameraName].push(index); + if (this._cameras.indexOf(camera) === -1) { + this._cameras[cameraName] = camera; + } + for (var passName in this._renderPasses) { + this._renderPasses[passName]._incRefCount(); + } + } + this._linkParameters(); + }; + PostProcessRenderEffect.prototype._detachCameras = function (cameras) { + var _cam = BABYLON.Tools.MakeArray(cameras || this._cameras); + for (var i = 0; i < _cam.length; i++) { + var camera = _cam[i]; + var cameraName = camera.name; + camera.detachPostProcess(this._postProcesses[this._singleInstance ? 0 : cameraName], this._indicesForCamera[cameraName]); + var index = this._cameras.indexOf(cameraName); + this._indicesForCamera.splice(index, 1); + this._cameras.splice(index, 1); + for (var passName in this._renderPasses) { + this._renderPasses[passName]._decRefCount(); + } + } + }; + PostProcessRenderEffect.prototype._enable = function (cameras) { + var _cam = BABYLON.Tools.MakeArray(cameras || this._cameras); + for (var i = 0; i < _cam.length; i++) { + var camera = _cam[i]; + var cameraName = camera.name; + for (var j = 0; j < this._indicesForCamera[cameraName].length; j++) { + if (camera._postProcesses[this._indicesForCamera[cameraName][j]] === undefined) { + cameras[i].attachPostProcess(this._postProcesses[this._singleInstance ? 0 : cameraName], this._indicesForCamera[cameraName][j]); + } + } + for (var passName in this._renderPasses) { + this._renderPasses[passName]._incRefCount(); + } + } + }; + PostProcessRenderEffect.prototype._disable = function (cameras) { + var _cam = BABYLON.Tools.MakeArray(cameras || this._cameras); + for (var i = 0; i < _cam.length; i++) { + var camera = _cam[i]; + var cameraName = camera.Name; + camera.detachPostProcess(this._postProcesses[this._singleInstance ? 0 : cameraName], this._indicesForCamera[cameraName]); + for (var passName in this._renderPasses) { + this._renderPasses[passName]._decRefCount(); + } + } + }; + PostProcessRenderEffect.prototype.getPostProcess = function (camera) { + if (this._singleInstance) { + return this._postProcesses[0]; + } + else { + return this._postProcesses[camera.name]; + } + }; + PostProcessRenderEffect.prototype._linkParameters = function () { + var _this = this; + for (var index in this._postProcesses) { + if (this.applyParameters) { + this.applyParameters(this._postProcesses[index]); + } + this._postProcesses[index].onBeforeRenderObservable.add(function (effect) { + _this._linkTextures(effect); + }); + } + }; + PostProcessRenderEffect.prototype._linkTextures = function (effect) { + for (var renderPassName in this._renderPasses) { + effect.setTexture(renderPassName, this._renderPasses[renderPassName].getRenderTexture()); + } + for (var renderEffectName in this._renderEffectAsPasses) { + effect.setTextureFromPostProcess(renderEffectName + "Sampler", this._renderEffectAsPasses[renderEffectName].getPostProcess()); + } + }; + return PostProcessRenderEffect; + }()); + BABYLON.PostProcessRenderEffect = PostProcessRenderEffect; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.postProcessRenderEffect.js.map + +var BABYLON; +(function (BABYLON) { + var PostProcessRenderPipeline = (function () { + function PostProcessRenderPipeline(engine, name) { + this._engine = engine; + this._name = name; + this._renderEffects = {}; + this._renderEffectsForIsolatedPass = {}; + this._cameras = []; + } + Object.defineProperty(PostProcessRenderPipeline.prototype, "isSupported", { + get: function () { + for (var renderEffectName in this._renderEffects) { + if (!this._renderEffects[renderEffectName].isSupported) { + return false; + } + } + return true; + }, + enumerable: true, + configurable: true + }); + PostProcessRenderPipeline.prototype.addEffect = function (renderEffect) { + this._renderEffects[renderEffect._name] = renderEffect; + }; + PostProcessRenderPipeline.prototype._enableEffect = function (renderEffectName, cameras) { + var renderEffects = this._renderEffects[renderEffectName]; + if (!renderEffects) { + return; + } + renderEffects._enable(BABYLON.Tools.MakeArray(cameras || this._cameras)); + }; + PostProcessRenderPipeline.prototype._disableEffect = function (renderEffectName, cameras) { + var renderEffects = this._renderEffects[renderEffectName]; + if (!renderEffects) { + return; + } + renderEffects._disable(BABYLON.Tools.MakeArray(cameras || this._cameras)); + }; + PostProcessRenderPipeline.prototype._attachCameras = function (cameras, unique) { + var _cam = BABYLON.Tools.MakeArray(cameras || this._cameras); + var indicesToDelete = []; + var i; + for (i = 0; i < _cam.length; i++) { + var camera = _cam[i]; + var cameraName = camera.name; + if (this._cameras.indexOf(camera) === -1) { + this._cameras[cameraName] = camera; + } + else if (unique) { + indicesToDelete.push(i); + } + } + for (i = 0; i < indicesToDelete.length; i++) { + cameras.splice(indicesToDelete[i], 1); + } + for (var renderEffectName in this._renderEffects) { + this._renderEffects[renderEffectName]._attachCameras(_cam); + } + }; + PostProcessRenderPipeline.prototype._detachCameras = function (cameras) { + var _cam = BABYLON.Tools.MakeArray(cameras || this._cameras); + for (var renderEffectName in this._renderEffects) { + this._renderEffects[renderEffectName]._detachCameras(_cam); + } + for (var i = 0; i < _cam.length; i++) { + this._cameras.splice(this._cameras.indexOf(_cam[i]), 1); + } + }; + PostProcessRenderPipeline.prototype._enableDisplayOnlyPass = function (passName, cameras) { + var _this = this; + var _cam = BABYLON.Tools.MakeArray(cameras || this._cameras); + var pass = null; + var renderEffectName; + for (renderEffectName in this._renderEffects) { + pass = this._renderEffects[renderEffectName].getPass(passName); + if (pass != null) { + break; + } + } + if (pass === null) { + return; + } + for (renderEffectName in this._renderEffects) { + this._renderEffects[renderEffectName]._disable(_cam); + } + pass._name = PostProcessRenderPipeline.PASS_SAMPLER_NAME; + for (var i = 0; i < _cam.length; i++) { + var camera = _cam[i]; + var cameraName = camera.name; + this._renderEffectsForIsolatedPass[cameraName] = this._renderEffectsForIsolatedPass[cameraName] || new BABYLON.PostProcessRenderEffect(this._engine, PostProcessRenderPipeline.PASS_EFFECT_NAME, function () { return new BABYLON.DisplayPassPostProcess(PostProcessRenderPipeline.PASS_EFFECT_NAME, 1.0, null, null, _this._engine, true); }); + this._renderEffectsForIsolatedPass[cameraName].emptyPasses(); + this._renderEffectsForIsolatedPass[cameraName].addPass(pass); + this._renderEffectsForIsolatedPass[cameraName]._attachCameras(camera); + } + }; + PostProcessRenderPipeline.prototype._disableDisplayOnlyPass = function (cameras) { + var _this = this; + var _cam = BABYLON.Tools.MakeArray(cameras || this._cameras); + for (var i = 0; i < _cam.length; i++) { + var camera = _cam[i]; + var cameraName = camera.name; + this._renderEffectsForIsolatedPass[cameraName] = this._renderEffectsForIsolatedPass[cameraName] || new BABYLON.PostProcessRenderEffect(this._engine, PostProcessRenderPipeline.PASS_EFFECT_NAME, function () { return new BABYLON.DisplayPassPostProcess(PostProcessRenderPipeline.PASS_EFFECT_NAME, 1.0, null, null, _this._engine, true); }); + this._renderEffectsForIsolatedPass[cameraName]._disable(camera); + } + for (var renderEffectName in this._renderEffects) { + this._renderEffects[renderEffectName]._enable(_cam); + } + }; + PostProcessRenderPipeline.prototype._update = function () { + for (var renderEffectName in this._renderEffects) { + this._renderEffects[renderEffectName]._update(); + } + for (var i = 0; i < this._cameras.length; i++) { + var cameraName = this._cameras[i].name; + if (this._renderEffectsForIsolatedPass[cameraName]) { + this._renderEffectsForIsolatedPass[cameraName]._update(); + } + } + }; + PostProcessRenderPipeline.prototype.dispose = function () { + // Must be implemented by children + }; + PostProcessRenderPipeline.PASS_EFFECT_NAME = "passEffect"; + PostProcessRenderPipeline.PASS_SAMPLER_NAME = "passSampler"; + return PostProcessRenderPipeline; + }()); + BABYLON.PostProcessRenderPipeline = PostProcessRenderPipeline; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.postProcessRenderPipeline.js.map + +var BABYLON; +(function (BABYLON) { + var PostProcessRenderPipelineManager = (function () { + function PostProcessRenderPipelineManager() { + this._renderPipelines = {}; + } + PostProcessRenderPipelineManager.prototype.addPipeline = function (renderPipeline) { + this._renderPipelines[renderPipeline._name] = renderPipeline; + }; + PostProcessRenderPipelineManager.prototype.attachCamerasToRenderPipeline = function (renderPipelineName, cameras, unique) { + var renderPipeline = this._renderPipelines[renderPipelineName]; + if (!renderPipeline) { + return; + } + renderPipeline._attachCameras(cameras, unique); + }; + PostProcessRenderPipelineManager.prototype.detachCamerasFromRenderPipeline = function (renderPipelineName, cameras) { + var renderPipeline = this._renderPipelines[renderPipelineName]; + if (!renderPipeline) { + return; + } + renderPipeline._detachCameras(cameras); + }; + PostProcessRenderPipelineManager.prototype.enableEffectInPipeline = function (renderPipelineName, renderEffectName, cameras) { + var renderPipeline = this._renderPipelines[renderPipelineName]; + if (!renderPipeline) { + return; + } + renderPipeline._enableEffect(renderEffectName, cameras); + }; + PostProcessRenderPipelineManager.prototype.disableEffectInPipeline = function (renderPipelineName, renderEffectName, cameras) { + var renderPipeline = this._renderPipelines[renderPipelineName]; + if (!renderPipeline) { + return; + } + renderPipeline._disableEffect(renderEffectName, cameras); + }; + PostProcessRenderPipelineManager.prototype.enableDisplayOnlyPassInPipeline = function (renderPipelineName, passName, cameras) { + var renderPipeline = this._renderPipelines[renderPipelineName]; + if (!renderPipeline) { + return; + } + renderPipeline._enableDisplayOnlyPass(passName, cameras); + }; + PostProcessRenderPipelineManager.prototype.disableDisplayOnlyPassInPipeline = function (renderPipelineName, cameras) { + var renderPipeline = this._renderPipelines[renderPipelineName]; + if (!renderPipeline) { + return; + } + renderPipeline._disableDisplayOnlyPass(cameras); + }; + PostProcessRenderPipelineManager.prototype.update = function () { + for (var renderPipelineName in this._renderPipelines) { + var pipeline = this._renderPipelines[renderPipelineName]; + if (!pipeline.isSupported) { + pipeline.dispose(); + delete this._renderPipelines[renderPipelineName]; + } + else { + pipeline._update(); + } + } + }; + return PostProcessRenderPipelineManager; + }()); + BABYLON.PostProcessRenderPipelineManager = PostProcessRenderPipelineManager; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.postProcessRenderPipelineManager.js.map + +var BABYLON; +(function (BABYLON) { + var BoundingBoxRenderer = (function () { + function BoundingBoxRenderer(scene) { + this.frontColor = new BABYLON.Color3(1, 1, 1); + this.backColor = new BABYLON.Color3(0.1, 0.1, 0.1); + this.showBackLines = true; + this.renderList = new BABYLON.SmartArray(32); + this._vertexBuffers = {}; + this._scene = scene; + } + BoundingBoxRenderer.prototype._prepareRessources = function () { + if (this._colorShader) { + return; + } + this._colorShader = new BABYLON.ShaderMaterial("colorShader", this._scene, "color", { + attributes: [BABYLON.VertexBuffer.PositionKind], + uniforms: ["worldViewProjection", "color"] + }); + var engine = this._scene.getEngine(); + var boxdata = BABYLON.VertexData.CreateBox(1.0); + this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = new BABYLON.VertexBuffer(engine, boxdata.positions, BABYLON.VertexBuffer.PositionKind, false); + this._indexBuffer = engine.createIndexBuffer([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 7, 1, 6, 2, 5, 3, 4]); + }; + BoundingBoxRenderer.prototype.reset = function () { + this.renderList.reset(); + }; + BoundingBoxRenderer.prototype.render = function () { + if (this.renderList.length === 0) { + return; + } + this._prepareRessources(); + if (!this._colorShader.isReady()) { + return; + } + var engine = this._scene.getEngine(); + engine.setDepthWrite(false); + this._colorShader._preBind(); + for (var boundingBoxIndex = 0; boundingBoxIndex < this.renderList.length; boundingBoxIndex++) { + var boundingBox = this.renderList.data[boundingBoxIndex]; + var min = boundingBox.minimum; + var max = boundingBox.maximum; + var diff = max.subtract(min); + var median = min.add(diff.scale(0.5)); + var worldMatrix = BABYLON.Matrix.Scaling(diff.x, diff.y, diff.z) + .multiply(BABYLON.Matrix.Translation(median.x, median.y, median.z)) + .multiply(boundingBox.getWorldMatrix()); + // VBOs + engine.bindBuffers(this._vertexBuffers, this._indexBuffer, this._colorShader.getEffect()); + if (this.showBackLines) { + // Back + engine.setDepthFunctionToGreaterOrEqual(); + this._scene.resetCachedMaterial(); + this._colorShader.setColor4("color", this.backColor.toColor4()); + this._colorShader.bind(worldMatrix); + // Draw order + engine.draw(false, 0, 24); + } + // Front + engine.setDepthFunctionToLess(); + this._scene.resetCachedMaterial(); + this._colorShader.setColor4("color", this.frontColor.toColor4()); + this._colorShader.bind(worldMatrix); + // Draw order + engine.draw(false, 0, 24); + } + this._colorShader.unbind(); + engine.setDepthFunctionToLessOrEqual(); + engine.setDepthWrite(true); + }; + BoundingBoxRenderer.prototype.dispose = function () { + if (!this._colorShader) { + return; + } + this._colorShader.dispose(); + var buffer = this._vertexBuffers[BABYLON.VertexBuffer.PositionKind]; + if (buffer) { + buffer.dispose(); + this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = null; + } + this._scene.getEngine()._releaseBuffer(this._indexBuffer); + }; + return BoundingBoxRenderer; + }()); + BABYLON.BoundingBoxRenderer = BoundingBoxRenderer; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.boundingBoxRenderer.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var Condition = (function () { + function Condition(actionManager) { + this._actionManager = actionManager; + } + Condition.prototype.isValid = function () { + return true; + }; + Condition.prototype._getProperty = function (propertyPath) { + return this._actionManager._getProperty(propertyPath); + }; + Condition.prototype._getEffectiveTarget = function (target, propertyPath) { + return this._actionManager._getEffectiveTarget(target, propertyPath); + }; + Condition.prototype.serialize = function () { + }; + Condition.prototype._serialize = function (serializedCondition) { + return { + type: 2, + children: [], + name: serializedCondition.name, + properties: serializedCondition.properties + }; + }; + return Condition; + }()); + BABYLON.Condition = Condition; + var ValueCondition = (function (_super) { + __extends(ValueCondition, _super); + function ValueCondition(actionManager, target, propertyPath, value, operator) { + if (operator === void 0) { operator = ValueCondition.IsEqual; } + _super.call(this, actionManager); + this.propertyPath = propertyPath; + this.value = value; + this.operator = operator; + this._target = target; + this._effectiveTarget = this._getEffectiveTarget(target, this.propertyPath); + this._property = this._getProperty(this.propertyPath); + } + Object.defineProperty(ValueCondition, "IsEqual", { + get: function () { + return ValueCondition._IsEqual; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ValueCondition, "IsDifferent", { + get: function () { + return ValueCondition._IsDifferent; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ValueCondition, "IsGreater", { + get: function () { + return ValueCondition._IsGreater; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ValueCondition, "IsLesser", { + get: function () { + return ValueCondition._IsLesser; + }, + enumerable: true, + configurable: true + }); + // Methods + ValueCondition.prototype.isValid = function () { + switch (this.operator) { + case ValueCondition.IsGreater: + return this._effectiveTarget[this._property] > this.value; + case ValueCondition.IsLesser: + return this._effectiveTarget[this._property] < this.value; + case ValueCondition.IsEqual: + case ValueCondition.IsDifferent: + var check; + if (this.value.equals) { + check = this.value.equals(this._effectiveTarget[this._property]); + } + else { + check = this.value === this._effectiveTarget[this._property]; + } + return this.operator === ValueCondition.IsEqual ? check : !check; + } + return false; + }; + ValueCondition.prototype.serialize = function () { + return this._serialize({ + name: "ValueCondition", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + { name: "propertyPath", value: this.propertyPath }, + { name: "value", value: BABYLON.Action._SerializeValueAsString(this.value) }, + { name: "operator", value: ValueCondition.GetOperatorName(this.operator) } + ] + }); + }; + ValueCondition.GetOperatorName = function (operator) { + switch (operator) { + case ValueCondition._IsEqual: return "IsEqual"; + case ValueCondition._IsDifferent: return "IsDifferent"; + case ValueCondition._IsGreater: return "IsGreater"; + case ValueCondition._IsLesser: return "IsLesser"; + default: return ""; + } + }; + // Statics + ValueCondition._IsEqual = 0; + ValueCondition._IsDifferent = 1; + ValueCondition._IsGreater = 2; + ValueCondition._IsLesser = 3; + return ValueCondition; + }(Condition)); + BABYLON.ValueCondition = ValueCondition; + var PredicateCondition = (function (_super) { + __extends(PredicateCondition, _super); + function PredicateCondition(actionManager, predicate) { + _super.call(this, actionManager); + this.predicate = predicate; + } + PredicateCondition.prototype.isValid = function () { + return this.predicate(); + }; + return PredicateCondition; + }(Condition)); + BABYLON.PredicateCondition = PredicateCondition; + var StateCondition = (function (_super) { + __extends(StateCondition, _super); + function StateCondition(actionManager, target, value) { + _super.call(this, actionManager); + this.value = value; + this._target = target; + } + // Methods + StateCondition.prototype.isValid = function () { + return this._target.state === this.value; + }; + StateCondition.prototype.serialize = function () { + return this._serialize({ + name: "StateCondition", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + { name: "value", value: this.value } + ] + }); + }; + return StateCondition; + }(Condition)); + BABYLON.StateCondition = StateCondition; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.condition.js.map + +var BABYLON; +(function (BABYLON) { + var Action = (function () { + function Action(triggerOptions, condition) { + this.triggerOptions = triggerOptions; + if (triggerOptions.parameter) { + this.trigger = triggerOptions.trigger; + this._triggerParameter = triggerOptions.parameter; + } + else { + this.trigger = triggerOptions; + } + this._nextActiveAction = this; + this._condition = condition; + } + // Methods + Action.prototype._prepare = function () { + }; + Action.prototype.getTriggerParameter = function () { + return this._triggerParameter; + }; + Action.prototype._executeCurrent = function (evt) { + if (this._nextActiveAction._condition) { + var condition = this._nextActiveAction._condition; + var currentRenderId = this._actionManager.getScene().getRenderId(); + // We cache the current evaluation for the current frame + if (condition._evaluationId === currentRenderId) { + if (!condition._currentResult) { + return; + } + } + else { + condition._evaluationId = currentRenderId; + if (!condition.isValid()) { + condition._currentResult = false; + return; + } + condition._currentResult = true; + } + } + this._nextActiveAction.execute(evt); + this.skipToNextActiveAction(); + }; + Action.prototype.execute = function (evt) { + }; + Action.prototype.skipToNextActiveAction = function () { + if (this._nextActiveAction._child) { + if (!this._nextActiveAction._child._actionManager) { + this._nextActiveAction._child._actionManager = this._actionManager; + } + this._nextActiveAction = this._nextActiveAction._child; + } + else { + this._nextActiveAction = this; + } + }; + Action.prototype.then = function (action) { + this._child = action; + action._actionManager = this._actionManager; + action._prepare(); + return action; + }; + Action.prototype._getProperty = function (propertyPath) { + return this._actionManager._getProperty(propertyPath); + }; + Action.prototype._getEffectiveTarget = function (target, propertyPath) { + return this._actionManager._getEffectiveTarget(target, propertyPath); + }; + Action.prototype.serialize = function (parent) { + }; + // Called by BABYLON.Action objects in serialize(...). Internal use + Action.prototype._serialize = function (serializedAction, parent) { + var serializationObject = { + type: 1, + children: [], + name: serializedAction.name, + properties: serializedAction.properties || [] + }; + // Serialize child + if (this._child) { + this._child.serialize(serializationObject); + } + // Check if "this" has a condition + if (this._condition) { + var serializedCondition = this._condition.serialize(); + serializedCondition.children.push(serializationObject); + if (parent) { + parent.children.push(serializedCondition); + } + return serializedCondition; + } + if (parent) { + parent.children.push(serializationObject); + } + return serializationObject; + }; + Action._SerializeValueAsString = function (value) { + if (typeof value === "number") { + return value.toString(); + } + if (typeof value === "boolean") { + return value ? "true" : "false"; + } + if (value instanceof BABYLON.Vector2) { + return value.x + ", " + value.y; + } + if (value instanceof BABYLON.Vector3) { + return value.x + ", " + value.y + ", " + value.z; + } + if (value instanceof BABYLON.Color3) { + return value.r + ", " + value.g + ", " + value.b; + } + if (value instanceof BABYLON.Color4) { + return value.r + ", " + value.g + ", " + value.b + ", " + value.a; + } + return value; // string + }; + Action._GetTargetProperty = function (target) { + return { + name: "target", + targetType: target instanceof BABYLON.Mesh ? "MeshProperties" + : target instanceof BABYLON.Light ? "LightProperties" + : target instanceof BABYLON.Camera ? "CameraProperties" + : "SceneProperties", + value: target instanceof BABYLON.Scene ? "Scene" : target.name + }; + }; + return Action; + }()); + BABYLON.Action = Action; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.action.js.map + +var BABYLON; +(function (BABYLON) { + /** + * ActionEvent is the event beint sent when an action is triggered. + */ + var ActionEvent = (function () { + /** + * @constructor + * @param source The mesh or sprite that triggered the action. + * @param pointerX The X mouse cursor position at the time of the event + * @param pointerY The Y mouse cursor position at the time of the event + * @param meshUnderPointer The mesh that is currently pointed at (can be null) + * @param sourceEvent the original (browser) event that triggered the ActionEvent + */ + function ActionEvent(source, pointerX, pointerY, meshUnderPointer, sourceEvent, additionalData) { + this.source = source; + this.pointerX = pointerX; + this.pointerY = pointerY; + this.meshUnderPointer = meshUnderPointer; + this.sourceEvent = sourceEvent; + this.additionalData = additionalData; + } + /** + * Helper function to auto-create an ActionEvent from a source mesh. + * @param source The source mesh that triggered the event + * @param evt {Event} The original (browser) event + */ + ActionEvent.CreateNew = function (source, evt, additionalData) { + var scene = source.getScene(); + return new ActionEvent(source, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt, additionalData); + }; + /** + * Helper function to auto-create an ActionEvent from a source mesh. + * @param source The source sprite that triggered the event + * @param scene Scene associated with the sprite + * @param evt {Event} The original (browser) event + */ + ActionEvent.CreateNewFromSprite = function (source, scene, evt, additionalData) { + return new ActionEvent(source, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt, additionalData); + }; + /** + * Helper function to auto-create an ActionEvent from a scene. If triggered by a mesh use ActionEvent.CreateNew + * @param scene the scene where the event occurred + * @param evt {Event} The original (browser) event + */ + ActionEvent.CreateNewFromScene = function (scene, evt) { + return new ActionEvent(null, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt); + }; + ActionEvent.CreateNewFromPrimitive = function (prim, pointerPos, evt, additionalData) { + return new ActionEvent(prim, pointerPos.x, pointerPos.y, null, evt, additionalData); + }; + return ActionEvent; + }()); + BABYLON.ActionEvent = ActionEvent; + /** + * Action Manager manages all events to be triggered on a given mesh or the global scene. + * A single scene can have many Action Managers to handle predefined actions on specific meshes. + */ + var ActionManager = (function () { + function ActionManager(scene) { + // Members + this.actions = new Array(); + this.hoverCursor = ''; + this._scene = scene; + scene._actionManagers.push(this); + } + Object.defineProperty(ActionManager, "NothingTrigger", { + get: function () { + return ActionManager._NothingTrigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "OnPickTrigger", { + get: function () { + return ActionManager._OnPickTrigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "OnLeftPickTrigger", { + get: function () { + return ActionManager._OnLeftPickTrigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "OnRightPickTrigger", { + get: function () { + return ActionManager._OnRightPickTrigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "OnCenterPickTrigger", { + get: function () { + return ActionManager._OnCenterPickTrigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "OnPickDownTrigger", { + get: function () { + return ActionManager._OnPickDownTrigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "OnPickUpTrigger", { + get: function () { + return ActionManager._OnPickUpTrigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "OnPickOutTrigger", { + /// This trigger will only be raised if you also declared a OnPickDown + get: function () { + return ActionManager._OnPickOutTrigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "OnLongPressTrigger", { + get: function () { + return ActionManager._OnLongPressTrigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "OnPointerOverTrigger", { + get: function () { + return ActionManager._OnPointerOverTrigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "OnPointerOutTrigger", { + get: function () { + return ActionManager._OnPointerOutTrigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "OnEveryFrameTrigger", { + get: function () { + return ActionManager._OnEveryFrameTrigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "OnIntersectionEnterTrigger", { + get: function () { + return ActionManager._OnIntersectionEnterTrigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "OnIntersectionExitTrigger", { + get: function () { + return ActionManager._OnIntersectionExitTrigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "OnKeyDownTrigger", { + get: function () { + return ActionManager._OnKeyDownTrigger; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "OnKeyUpTrigger", { + get: function () { + return ActionManager._OnKeyUpTrigger; + }, + enumerable: true, + configurable: true + }); + // Methods + ActionManager.prototype.dispose = function () { + var index = this._scene._actionManagers.indexOf(this); + if (index > -1) { + this._scene._actionManagers.splice(index, 1); + } + }; + ActionManager.prototype.getScene = function () { + return this._scene; + }; + /** + * Does this action manager handles actions of any of the given triggers + * @param {number[]} triggers - the triggers to be tested + * @return {boolean} whether one (or more) of the triggers is handeled + */ + ActionManager.prototype.hasSpecificTriggers = function (triggers) { + for (var index = 0; index < this.actions.length; index++) { + var action = this.actions[index]; + if (triggers.indexOf(action.trigger) > -1) { + return true; + } + } + return false; + }; + /** + * Does this action manager handles actions of a given trigger + * @param {number} trigger - the trigger to be tested + * @return {boolean} whether the trigger is handeled + */ + ActionManager.prototype.hasSpecificTrigger = function (trigger) { + for (var index = 0; index < this.actions.length; index++) { + var action = this.actions[index]; + if (action.trigger === trigger) { + return true; + } + } + return false; + }; + Object.defineProperty(ActionManager.prototype, "hasPointerTriggers", { + /** + * Does this action manager has pointer triggers + * @return {boolean} whether or not it has pointer triggers + */ + get: function () { + for (var index = 0; index < this.actions.length; index++) { + var action = this.actions[index]; + if (action.trigger >= ActionManager._OnPickTrigger && action.trigger <= ActionManager._OnPointerOutTrigger) { + return true; + } + } + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager.prototype, "hasPickTriggers", { + /** + * Does this action manager has pick triggers + * @return {boolean} whether or not it has pick triggers + */ + get: function () { + for (var index = 0; index < this.actions.length; index++) { + var action = this.actions[index]; + if (action.trigger >= ActionManager._OnPickTrigger && action.trigger <= ActionManager._OnPickUpTrigger) { + return true; + } + } + return false; + }, + enumerable: true, + configurable: true + }); + /** + * Registers an action to this action manager + * @param {BABYLON.Action} action - the action to be registered + * @return {BABYLON.Action} the action amended (prepared) after registration + */ + ActionManager.prototype.registerAction = function (action) { + if (action.trigger === ActionManager.OnEveryFrameTrigger) { + if (this.getScene().actionManager !== this) { + BABYLON.Tools.Warn("OnEveryFrameTrigger can only be used with scene.actionManager"); + return null; + } + } + this.actions.push(action); + action._actionManager = this; + action._prepare(); + return action; + }; + /** + * Process a specific trigger + * @param {number} trigger - the trigger to process + * @param evt {BABYLON.ActionEvent} the event details to be processed + */ + ActionManager.prototype.processTrigger = function (trigger, evt) { + for (var index = 0; index < this.actions.length; index++) { + var action = this.actions[index]; + if (action.trigger === trigger) { + if (trigger === ActionManager.OnKeyUpTrigger + || trigger === ActionManager.OnKeyDownTrigger) { + var parameter = action.getTriggerParameter(); + if (parameter) { + var unicode = evt.sourceEvent.charCode ? evt.sourceEvent.charCode : evt.sourceEvent.keyCode; + var actualkey = String.fromCharCode(unicode).toLowerCase(); + if (actualkey !== parameter.toLowerCase()) { + continue; + } + } + } + action._executeCurrent(evt); + } + } + }; + ActionManager.prototype._getEffectiveTarget = function (target, propertyPath) { + var properties = propertyPath.split("."); + for (var index = 0; index < properties.length - 1; index++) { + target = target[properties[index]]; + } + return target; + }; + ActionManager.prototype._getProperty = function (propertyPath) { + var properties = propertyPath.split("."); + return properties[properties.length - 1]; + }; + ActionManager.prototype.serialize = function (name) { + var root = { + children: [], + name: name, + type: 3, + properties: [] // Empty for root but required + }; + for (var i = 0; i < this.actions.length; i++) { + var triggerObject = { + type: 0, + children: [], + name: ActionManager.GetTriggerName(this.actions[i].trigger), + properties: [] + }; + var triggerOptions = this.actions[i].triggerOptions; + if (triggerOptions && typeof triggerOptions !== "number") { + if (triggerOptions.parameter instanceof BABYLON.Node) { + triggerObject.properties.push(BABYLON.Action._GetTargetProperty(triggerOptions.parameter)); + } + else { + var parameter = {}; + BABYLON.Tools.DeepCopy(triggerOptions.parameter, parameter, ["mesh"]); + if (triggerOptions.parameter.mesh) { + parameter._meshId = triggerOptions.parameter.mesh.id; + } + triggerObject.properties.push({ name: "parameter", targetType: null, value: parameter }); + } + } + // Serialize child action, recursively + this.actions[i].serialize(triggerObject); + // Add serialized trigger + root.children.push(triggerObject); + } + return root; + }; + ActionManager.Parse = function (parsedActions, object, scene) { + var actionManager = new BABYLON.ActionManager(scene); + if (object === null) + scene.actionManager = actionManager; + else + object.actionManager = actionManager; + // instanciate a new object + var instanciate = function (name, params) { + var newInstance = Object.create(BABYLON[name].prototype); + newInstance.constructor.apply(newInstance, params); + return newInstance; + }; + var parseParameter = function (name, value, target, propertyPath) { + if (propertyPath === null) { + // String, boolean or float + var floatValue = parseFloat(value); + if (value === "true" || value === "false") + return value === "true"; + else + return isNaN(floatValue) ? value : floatValue; + } + var effectiveTarget = propertyPath.split("."); + var values = value.split(","); + // Get effective Target + for (var i = 0; i < effectiveTarget.length; i++) { + target = target[effectiveTarget[i]]; + } + // Return appropriate value with its type + if (typeof (target) === "boolean") + return values[0] === "true"; + if (typeof (target) === "string") + return values[0]; + // Parameters with multiple values such as Vector3 etc. + var split = new Array(); + for (var i = 0; i < values.length; i++) + split.push(parseFloat(values[i])); + if (target instanceof BABYLON.Vector3) + return BABYLON.Vector3.FromArray(split); + if (target instanceof BABYLON.Vector4) + return BABYLON.Vector4.FromArray(split); + if (target instanceof BABYLON.Color3) + return BABYLON.Color3.FromArray(split); + if (target instanceof BABYLON.Color4) + return BABYLON.Color4.FromArray(split); + return parseFloat(values[0]); + }; + // traverse graph per trigger + var traverse = function (parsedAction, trigger, condition, action, combineArray) { + if (combineArray === void 0) { combineArray = null; } + if (parsedAction.detached) + return; + var parameters = new Array(); + var target = null; + var propertyPath = null; + var combine = parsedAction.combine && parsedAction.combine.length > 0; + // Parameters + if (parsedAction.type === 2) + parameters.push(actionManager); + else + parameters.push(trigger); + if (combine) { + var actions = new Array(); + for (var j = 0; j < parsedAction.combine.length; j++) { + traverse(parsedAction.combine[j], ActionManager.NothingTrigger, condition, action, actions); + } + parameters.push(actions); + } + else { + for (var i = 0; i < parsedAction.properties.length; i++) { + var value = parsedAction.properties[i].value; + var name = parsedAction.properties[i].name; + var targetType = parsedAction.properties[i].targetType; + if (name === "target") + if (targetType !== null && targetType === "SceneProperties") + value = target = scene; + else + value = target = scene.getNodeByName(value); + else if (name === "parent") + value = scene.getNodeByName(value); + else if (name === "sound") + value = scene.getSoundByName(value); + else if (name !== "propertyPath") { + if (parsedAction.type === 2 && name === "operator") + value = BABYLON.ValueCondition[value]; + else + value = parseParameter(name, value, target, name === "value" ? propertyPath : null); + } + else { + propertyPath = value; + } + parameters.push(value); + } + } + if (combineArray === null) { + parameters.push(condition); + } + else { + parameters.push(null); + } + // If interpolate value action + if (parsedAction.name === "InterpolateValueAction") { + var param = parameters[parameters.length - 2]; + parameters[parameters.length - 1] = param; + parameters[parameters.length - 2] = condition; + } + // Action or condition(s) and not CombineAction + var newAction = instanciate(parsedAction.name, parameters); + if (newAction instanceof BABYLON.Condition && condition !== null) { + var nothing = new BABYLON.DoNothingAction(trigger, condition); + if (action) + action.then(nothing); + else + actionManager.registerAction(nothing); + action = nothing; + } + if (combineArray === null) { + if (newAction instanceof BABYLON.Condition) { + condition = newAction; + newAction = action; + } + else { + condition = null; + if (action) + action.then(newAction); + else + actionManager.registerAction(newAction); + } + } + else { + combineArray.push(newAction); + } + for (var i = 0; i < parsedAction.children.length; i++) + traverse(parsedAction.children[i], trigger, condition, newAction, null); + }; + // triggers + for (var i = 0; i < parsedActions.children.length; i++) { + var triggerParams; + var trigger = parsedActions.children[i]; + if (trigger.properties.length > 0) { + var param = trigger.properties[0].value; + var value = trigger.properties[0].targetType === null ? param : scene.getMeshByName(param); + if (value._meshId) { + value.mesh = scene.getMeshByID(value._meshId); + } + triggerParams = { trigger: BABYLON.ActionManager[trigger.name], parameter: value }; + } + else + triggerParams = BABYLON.ActionManager[trigger.name]; + for (var j = 0; j < trigger.children.length; j++) { + if (!trigger.detached) + traverse(trigger.children[j], triggerParams, null, null); + } + } + }; + ActionManager.GetTriggerName = function (trigger) { + switch (trigger) { + case 0: return "NothingTrigger"; + case 1: return "OnPickTrigger"; + case 2: return "OnLeftPickTrigger"; + case 3: return "OnRightPickTrigger"; + case 4: return "OnCenterPickTrigger"; + case 5: return "OnPickDownTrigger"; + case 6: return "OnPickUpTrigger"; + case 7: return "OnLongPressTrigger"; + case 8: return "OnPointerOverTrigger"; + case 9: return "OnPointerOutTrigger"; + case 10: return "OnEveryFrameTrigger"; + case 11: return "OnIntersectionEnterTrigger"; + case 12: return "OnIntersectionExitTrigger"; + case 13: return "OnKeyDownTrigger"; + case 14: return "OnKeyUpTrigger"; + case 15: return "OnPickOutTrigger"; + default: return ""; + } + }; + // Statics + ActionManager._NothingTrigger = 0; + ActionManager._OnPickTrigger = 1; + ActionManager._OnLeftPickTrigger = 2; + ActionManager._OnRightPickTrigger = 3; + ActionManager._OnCenterPickTrigger = 4; + ActionManager._OnPickDownTrigger = 5; + ActionManager._OnPickUpTrigger = 6; + ActionManager._OnLongPressTrigger = 7; + ActionManager._OnPointerOverTrigger = 8; + ActionManager._OnPointerOutTrigger = 9; + ActionManager._OnEveryFrameTrigger = 10; + ActionManager._OnIntersectionEnterTrigger = 11; + ActionManager._OnIntersectionExitTrigger = 12; + ActionManager._OnKeyDownTrigger = 13; + ActionManager._OnKeyUpTrigger = 14; + ActionManager._OnPickOutTrigger = 15; + ActionManager.DragMovementThreshold = 10; // in pixels + ActionManager.LongPressDelay = 500; // in milliseconds + return ActionManager; + }()); + BABYLON.ActionManager = ActionManager; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.actionManager.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var InterpolateValueAction = (function (_super) { + __extends(InterpolateValueAction, _super); + function InterpolateValueAction(triggerOptions, target, propertyPath, value, duration, condition, stopOtherAnimations, onInterpolationDone) { + if (duration === void 0) { duration = 1000; } + _super.call(this, triggerOptions, condition); + this.propertyPath = propertyPath; + this.value = value; + this.duration = duration; + this.stopOtherAnimations = stopOtherAnimations; + this.onInterpolationDone = onInterpolationDone; + this._target = this._effectiveTarget = target; + } + InterpolateValueAction.prototype._prepare = function () { + this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath); + this._property = this._getProperty(this.propertyPath); + }; + InterpolateValueAction.prototype.execute = function () { + var scene = this._actionManager.getScene(); + var keys = [ + { + frame: 0, + value: this._effectiveTarget[this._property] + }, { + frame: 100, + value: this.value + } + ]; + var dataType; + if (typeof this.value === "number") { + dataType = BABYLON.Animation.ANIMATIONTYPE_FLOAT; + } + else if (this.value instanceof BABYLON.Color3) { + dataType = BABYLON.Animation.ANIMATIONTYPE_COLOR3; + } + else if (this.value instanceof BABYLON.Vector3) { + dataType = BABYLON.Animation.ANIMATIONTYPE_VECTOR3; + } + else if (this.value instanceof BABYLON.Matrix) { + dataType = BABYLON.Animation.ANIMATIONTYPE_MATRIX; + } + else if (this.value instanceof BABYLON.Quaternion) { + dataType = BABYLON.Animation.ANIMATIONTYPE_QUATERNION; + } + else { + BABYLON.Tools.Warn("InterpolateValueAction: Unsupported type (" + typeof this.value + ")"); + return; + } + var animation = new BABYLON.Animation("InterpolateValueAction", this._property, 100 * (1000.0 / this.duration), dataType, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); + animation.setKeys(keys); + if (this.stopOtherAnimations) { + scene.stopAnimation(this._effectiveTarget); + } + scene.beginDirectAnimation(this._effectiveTarget, [animation], 0, 100, false, 1, this.onInterpolationDone); + }; + InterpolateValueAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "InterpolateValueAction", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + { name: "propertyPath", value: this.propertyPath }, + { name: "value", value: BABYLON.Action._SerializeValueAsString(this.value) }, + { name: "duration", value: BABYLON.Action._SerializeValueAsString(this.duration) }, + { name: "stopOtherAnimations", value: BABYLON.Action._SerializeValueAsString(this.stopOtherAnimations) || false } + ] + }, parent); + }; + return InterpolateValueAction; + }(BABYLON.Action)); + BABYLON.InterpolateValueAction = InterpolateValueAction; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.interpolateValueAction.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var SwitchBooleanAction = (function (_super) { + __extends(SwitchBooleanAction, _super); + function SwitchBooleanAction(triggerOptions, target, propertyPath, condition) { + _super.call(this, triggerOptions, condition); + this.propertyPath = propertyPath; + this._target = this._effectiveTarget = target; + } + SwitchBooleanAction.prototype._prepare = function () { + this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath); + this._property = this._getProperty(this.propertyPath); + }; + SwitchBooleanAction.prototype.execute = function () { + this._effectiveTarget[this._property] = !this._effectiveTarget[this._property]; + }; + SwitchBooleanAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "SwitchBooleanAction", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + { name: "propertyPath", value: this.propertyPath } + ] + }, parent); + }; + return SwitchBooleanAction; + }(BABYLON.Action)); + BABYLON.SwitchBooleanAction = SwitchBooleanAction; + var SetStateAction = (function (_super) { + __extends(SetStateAction, _super); + function SetStateAction(triggerOptions, target, value, condition) { + _super.call(this, triggerOptions, condition); + this.value = value; + this._target = target; + } + SetStateAction.prototype.execute = function () { + this._target.state = this.value; + }; + SetStateAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "SetStateAction", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + { name: "value", value: this.value } + ] + }, parent); + }; + return SetStateAction; + }(BABYLON.Action)); + BABYLON.SetStateAction = SetStateAction; + var SetValueAction = (function (_super) { + __extends(SetValueAction, _super); + function SetValueAction(triggerOptions, target, propertyPath, value, condition) { + _super.call(this, triggerOptions, condition); + this.propertyPath = propertyPath; + this.value = value; + this._target = this._effectiveTarget = target; + } + SetValueAction.prototype._prepare = function () { + this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath); + this._property = this._getProperty(this.propertyPath); + }; + SetValueAction.prototype.execute = function () { + this._effectiveTarget[this._property] = this.value; + if (this._target.markAsDirty) { + this._target.markAsDirty(this._property); + } + }; + SetValueAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "SetValueAction", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + { name: "propertyPath", value: this.propertyPath }, + { name: "value", value: BABYLON.Action._SerializeValueAsString(this.value) } + ] + }, parent); + }; + return SetValueAction; + }(BABYLON.Action)); + BABYLON.SetValueAction = SetValueAction; + var IncrementValueAction = (function (_super) { + __extends(IncrementValueAction, _super); + function IncrementValueAction(triggerOptions, target, propertyPath, value, condition) { + _super.call(this, triggerOptions, condition); + this.propertyPath = propertyPath; + this.value = value; + this._target = this._effectiveTarget = target; + } + IncrementValueAction.prototype._prepare = function () { + this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath); + this._property = this._getProperty(this.propertyPath); + if (typeof this._effectiveTarget[this._property] !== "number") { + BABYLON.Tools.Warn("Warning: IncrementValueAction can only be used with number values"); + } + }; + IncrementValueAction.prototype.execute = function () { + this._effectiveTarget[this._property] += this.value; + if (this._target.markAsDirty) { + this._target.markAsDirty(this._property); + } + }; + IncrementValueAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "IncrementValueAction", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + { name: "propertyPath", value: this.propertyPath }, + { name: "value", value: BABYLON.Action._SerializeValueAsString(this.value) } + ] + }, parent); + }; + return IncrementValueAction; + }(BABYLON.Action)); + BABYLON.IncrementValueAction = IncrementValueAction; + var PlayAnimationAction = (function (_super) { + __extends(PlayAnimationAction, _super); + function PlayAnimationAction(triggerOptions, target, from, to, loop, condition) { + _super.call(this, triggerOptions, condition); + this.from = from; + this.to = to; + this.loop = loop; + this._target = target; + } + PlayAnimationAction.prototype._prepare = function () { + }; + PlayAnimationAction.prototype.execute = function () { + var scene = this._actionManager.getScene(); + scene.beginAnimation(this._target, this.from, this.to, this.loop); + }; + PlayAnimationAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "PlayAnimationAction", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + { name: "from", value: String(this.from) }, + { name: "to", value: String(this.to) }, + { name: "loop", value: BABYLON.Action._SerializeValueAsString(this.loop) || false } + ] + }, parent); + }; + return PlayAnimationAction; + }(BABYLON.Action)); + BABYLON.PlayAnimationAction = PlayAnimationAction; + var StopAnimationAction = (function (_super) { + __extends(StopAnimationAction, _super); + function StopAnimationAction(triggerOptions, target, condition) { + _super.call(this, triggerOptions, condition); + this._target = target; + } + StopAnimationAction.prototype._prepare = function () { + }; + StopAnimationAction.prototype.execute = function () { + var scene = this._actionManager.getScene(); + scene.stopAnimation(this._target); + }; + StopAnimationAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "StopAnimationAction", + properties: [BABYLON.Action._GetTargetProperty(this._target)] + }, parent); + }; + return StopAnimationAction; + }(BABYLON.Action)); + BABYLON.StopAnimationAction = StopAnimationAction; + var DoNothingAction = (function (_super) { + __extends(DoNothingAction, _super); + function DoNothingAction(triggerOptions, condition) { + if (triggerOptions === void 0) { triggerOptions = BABYLON.ActionManager.NothingTrigger; } + _super.call(this, triggerOptions, condition); + } + DoNothingAction.prototype.execute = function () { + }; + DoNothingAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "DoNothingAction", + properties: [] + }, parent); + }; + return DoNothingAction; + }(BABYLON.Action)); + BABYLON.DoNothingAction = DoNothingAction; + var CombineAction = (function (_super) { + __extends(CombineAction, _super); + function CombineAction(triggerOptions, children, condition) { + _super.call(this, triggerOptions, condition); + this.children = children; + } + CombineAction.prototype._prepare = function () { + for (var index = 0; index < this.children.length; index++) { + this.children[index]._actionManager = this._actionManager; + this.children[index]._prepare(); + } + }; + CombineAction.prototype.execute = function (evt) { + for (var index = 0; index < this.children.length; index++) { + this.children[index].execute(evt); + } + }; + CombineAction.prototype.serialize = function (parent) { + var serializationObject = _super.prototype._serialize.call(this, { + name: "CombineAction", + properties: [], + combine: [] + }, parent); + for (var i = 0; i < this.children.length; i++) { + serializationObject.combine.push(this.children[i].serialize(null)); + } + return serializationObject; + }; + return CombineAction; + }(BABYLON.Action)); + BABYLON.CombineAction = CombineAction; + var ExecuteCodeAction = (function (_super) { + __extends(ExecuteCodeAction, _super); + function ExecuteCodeAction(triggerOptions, func, condition) { + _super.call(this, triggerOptions, condition); + this.func = func; + } + ExecuteCodeAction.prototype.execute = function (evt) { + this.func(evt); + }; + return ExecuteCodeAction; + }(BABYLON.Action)); + BABYLON.ExecuteCodeAction = ExecuteCodeAction; + var SetParentAction = (function (_super) { + __extends(SetParentAction, _super); + function SetParentAction(triggerOptions, target, parent, condition) { + _super.call(this, triggerOptions, condition); + this._target = target; + this._parent = parent; + } + SetParentAction.prototype._prepare = function () { + }; + SetParentAction.prototype.execute = function () { + if (this._target.parent === this._parent) { + return; + } + var invertParentWorldMatrix = this._parent.getWorldMatrix().clone(); + invertParentWorldMatrix.invert(); + this._target.position = BABYLON.Vector3.TransformCoordinates(this._target.position, invertParentWorldMatrix); + this._target.parent = this._parent; + }; + SetParentAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "SetParentAction", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + BABYLON.Action._GetTargetProperty(this._parent), + ] + }, parent); + }; + return SetParentAction; + }(BABYLON.Action)); + BABYLON.SetParentAction = SetParentAction; + var PlaySoundAction = (function (_super) { + __extends(PlaySoundAction, _super); + function PlaySoundAction(triggerOptions, sound, condition) { + _super.call(this, triggerOptions, condition); + this._sound = sound; + } + PlaySoundAction.prototype._prepare = function () { + }; + PlaySoundAction.prototype.execute = function () { + if (this._sound !== undefined) + this._sound.play(); + }; + PlaySoundAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "PlaySoundAction", + properties: [{ name: "sound", value: this._sound.name }] + }, parent); + }; + return PlaySoundAction; + }(BABYLON.Action)); + BABYLON.PlaySoundAction = PlaySoundAction; + var StopSoundAction = (function (_super) { + __extends(StopSoundAction, _super); + function StopSoundAction(triggerOptions, sound, condition) { + _super.call(this, triggerOptions, condition); + this._sound = sound; + } + StopSoundAction.prototype._prepare = function () { + }; + StopSoundAction.prototype.execute = function () { + if (this._sound !== undefined) + this._sound.stop(); + }; + StopSoundAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "StopSoundAction", + properties: [{ name: "sound", value: this._sound.name }] + }, parent); + }; + return StopSoundAction; + }(BABYLON.Action)); + BABYLON.StopSoundAction = StopSoundAction; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.directActions.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var Geometry = (function () { + function Geometry(id, scene, vertexData, updatable, mesh) { + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NONE; + this._totalVertices = 0; + this._isDisposed = false; + this.id = id; + this._engine = scene.getEngine(); + this._meshes = []; + this._scene = scene; + //Init vertex buffer cache + this._vertexBuffers = {}; + this._indices = []; + // vertexData + if (vertexData) { + this.setAllVerticesData(vertexData, updatable); + } + else { + this._totalVertices = 0; + this._indices = []; + } + // applyToMesh + if (mesh) { + if (mesh instanceof BABYLON.LinesMesh) { + this.boundingBias = new BABYLON.Vector2(0, mesh.intersectionThreshold); + this.updateExtend(); + } + this.applyToMesh(mesh); + mesh.computeWorldMatrix(true); + } + } + Object.defineProperty(Geometry.prototype, "boundingBias", { + /** + * The Bias Vector to apply on the bounding elements (box/sphere), the max extend is computed as v += v * bias.x + bias.y, the min is computed as v -= v * bias.x + bias.y + * @returns The Bias Vector + */ + get: function () { + return this._boundingBias; + }, + set: function (value) { + if (this._boundingBias && this._boundingBias.equals(value)) { + return; + } + this._boundingBias = value.clone(); + this.updateBoundingInfo(true, null); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Geometry.prototype, "extend", { + get: function () { + return this._extend; + }, + enumerable: true, + configurable: true + }); + Geometry.prototype.getScene = function () { + return this._scene; + }; + Geometry.prototype.getEngine = function () { + return this._engine; + }; + Geometry.prototype.isReady = function () { + return this.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_LOADED || this.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_NONE; + }; + Object.defineProperty(Geometry.prototype, "doNotSerialize", { + get: function () { + for (var index = 0; index < this._meshes.length; index++) { + if (!this._meshes[index].doNotSerialize) { + return false; + } + } + return true; + }, + enumerable: true, + configurable: true + }); + Geometry.prototype.setAllVerticesData = function (vertexData, updatable) { + vertexData.applyToGeometry(this, updatable); + this.notifyUpdate(); + }; + Geometry.prototype.setVerticesData = function (kind, data, updatable, stride) { + var buffer = new BABYLON.VertexBuffer(this._engine, data, kind, updatable, this._meshes.length === 0, stride); + this.setVerticesBuffer(buffer); + }; + Geometry.prototype.setVerticesBuffer = function (buffer) { + var kind = buffer.getKind(); + if (this._vertexBuffers[kind]) { + this._vertexBuffers[kind].dispose(); + } + this._vertexBuffers[kind] = buffer; + if (kind === BABYLON.VertexBuffer.PositionKind) { + var data = buffer.getData(); + var stride = buffer.getStrideSize(); + this._totalVertices = data.length / stride; + this.updateExtend(data, stride); + var meshes = this._meshes; + var numOfMeshes = meshes.length; + for (var index = 0; index < numOfMeshes; index++) { + var mesh = meshes[index]; + mesh._resetPointsArrayCache(); + mesh._boundingInfo = new BABYLON.BoundingInfo(this._extend.minimum, this._extend.maximum); + mesh._createGlobalSubMesh(); + mesh.computeWorldMatrix(true); + } + } + this.notifyUpdate(kind); + }; + Geometry.prototype.updateVerticesDataDirectly = function (kind, data, offset) { + var vertexBuffer = this.getVertexBuffer(kind); + if (!vertexBuffer) { + return; + } + vertexBuffer.updateDirectly(data, offset); + this.notifyUpdate(kind); + }; + Geometry.prototype.updateVerticesData = function (kind, data, updateExtends) { + var vertexBuffer = this.getVertexBuffer(kind); + if (!vertexBuffer) { + return; + } + vertexBuffer.update(data); + if (kind === BABYLON.VertexBuffer.PositionKind) { + var stride = vertexBuffer.getStrideSize(); + this._totalVertices = data.length / stride; + this.updateBoundingInfo(updateExtends, data); + } + this.notifyUpdate(kind); + }; + Geometry.prototype.updateBoundingInfo = function (updateExtends, data) { + if (updateExtends) { + this.updateExtend(data); + } + var meshes = this._meshes; + var numOfMeshes = meshes.length; + for (var index = 0; index < numOfMeshes; index++) { + var mesh = meshes[index]; + mesh._resetPointsArrayCache(); + if (updateExtends) { + mesh._boundingInfo = new BABYLON.BoundingInfo(this._extend.minimum, this._extend.maximum); + for (var subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) { + var subMesh = mesh.subMeshes[subIndex]; + subMesh.refreshBoundingInfo(); + } + } + } + }; + Geometry.prototype.getTotalVertices = function () { + if (!this.isReady()) { + return 0; + } + return this._totalVertices; + }; + Geometry.prototype.getVerticesData = function (kind, copyWhenShared) { + var vertexBuffer = this.getVertexBuffer(kind); + if (!vertexBuffer) { + return null; + } + var orig = vertexBuffer.getData(); + if (!copyWhenShared || this._meshes.length === 1) { + return orig; + } + else { + var len = orig.length; + var copy = []; + for (var i = 0; i < len; i++) { + copy.push(orig[i]); + } + return copy; + } + }; + Geometry.prototype.getVertexBuffer = function (kind) { + if (!this.isReady()) { + return null; + } + return this._vertexBuffers[kind]; + }; + Geometry.prototype.getVertexBuffers = function () { + if (!this.isReady()) { + return null; + } + return this._vertexBuffers; + }; + Geometry.prototype.isVerticesDataPresent = function (kind) { + if (!this._vertexBuffers) { + if (this._delayInfo) { + return this._delayInfo.indexOf(kind) !== -1; + } + return false; + } + return this._vertexBuffers[kind] !== undefined; + }; + Geometry.prototype.getVerticesDataKinds = function () { + var result = []; + var kind; + if (!this._vertexBuffers && this._delayInfo) { + for (kind in this._delayInfo) { + result.push(kind); + } + } + else { + for (kind in this._vertexBuffers) { + result.push(kind); + } + } + return result; + }; + Geometry.prototype.setIndices = function (indices, totalVertices) { + if (this._indexBuffer) { + this._engine._releaseBuffer(this._indexBuffer); + } + this._indices = indices; + if (this._meshes.length !== 0 && this._indices) { + this._indexBuffer = this._engine.createIndexBuffer(this._indices); + } + if (totalVertices !== undefined) { + this._totalVertices = totalVertices; + } + var meshes = this._meshes; + var numOfMeshes = meshes.length; + for (var index = 0; index < numOfMeshes; index++) { + meshes[index]._createGlobalSubMesh(); + } + this.notifyUpdate(); + }; + Geometry.prototype.getTotalIndices = function () { + if (!this.isReady()) { + return 0; + } + return this._indices.length; + }; + Geometry.prototype.getIndices = function (copyWhenShared) { + if (!this.isReady()) { + return null; + } + var orig = this._indices; + if (!copyWhenShared || this._meshes.length === 1) { + return orig; + } + else { + var len = orig.length; + var copy = []; + for (var i = 0; i < len; i++) { + copy.push(orig[i]); + } + return copy; + } + }; + Geometry.prototype.getIndexBuffer = function () { + if (!this.isReady()) { + return null; + } + return this._indexBuffer; + }; + Geometry.prototype.releaseForMesh = function (mesh, shouldDispose) { + var meshes = this._meshes; + var index = meshes.indexOf(mesh); + if (index === -1) { + return; + } + for (var kind in this._vertexBuffers) { + this._vertexBuffers[kind].dispose(); + } + if (this._indexBuffer && this._engine._releaseBuffer(this._indexBuffer)) { + this._indexBuffer = null; + } + meshes.splice(index, 1); + mesh._geometry = null; + if (meshes.length === 0 && shouldDispose) { + this.dispose(); + } + }; + Geometry.prototype.applyToMesh = function (mesh) { + if (mesh._geometry === this) { + return; + } + var previousGeometry = mesh._geometry; + if (previousGeometry) { + previousGeometry.releaseForMesh(mesh); + } + var meshes = this._meshes; + // must be done before setting vertexBuffers because of mesh._createGlobalSubMesh() + mesh._geometry = this; + this._scene.pushGeometry(this); + meshes.push(mesh); + if (this.isReady()) { + this._applyToMesh(mesh); + } + else { + mesh._boundingInfo = this._boundingInfo; + } + }; + Geometry.prototype.updateExtend = function (data, stride) { + if (data === void 0) { data = null; } + if (!data) { + data = this._vertexBuffers[BABYLON.VertexBuffer.PositionKind].getData(); + } + this._extend = BABYLON.Tools.ExtractMinAndMax(data, 0, this._totalVertices, this.boundingBias, stride); + }; + Geometry.prototype._applyToMesh = function (mesh) { + var numOfMeshes = this._meshes.length; + // vertexBuffers + for (var kind in this._vertexBuffers) { + if (numOfMeshes === 1) { + this._vertexBuffers[kind].create(); + } + this._vertexBuffers[kind].getBuffer().references = numOfMeshes; + if (kind === BABYLON.VertexBuffer.PositionKind) { + mesh._resetPointsArrayCache(); + if (!this._extend) { + this.updateExtend(this._vertexBuffers[kind].getData()); + } + mesh._boundingInfo = new BABYLON.BoundingInfo(this._extend.minimum, this._extend.maximum); + mesh._createGlobalSubMesh(); + //bounding info was just created again, world matrix should be applied again. + mesh._updateBoundingInfo(); + } + } + // indexBuffer + if (numOfMeshes === 1 && this._indices && this._indices.length > 0) { + this._indexBuffer = this._engine.createIndexBuffer(this._indices); + } + if (this._indexBuffer) { + this._indexBuffer.references = numOfMeshes; + } + }; + Geometry.prototype.notifyUpdate = function (kind) { + if (this.onGeometryUpdated) { + this.onGeometryUpdated(this, kind); + } + }; + Geometry.prototype.load = function (scene, onLoaded) { + if (this.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_LOADING) { + return; + } + if (this.isReady()) { + if (onLoaded) { + onLoaded(); + } + return; + } + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADING; + this._queueLoad(scene, onLoaded); + }; + Geometry.prototype._queueLoad = function (scene, onLoaded) { + var _this = this; + scene._addPendingData(this); + BABYLON.Tools.LoadFile(this.delayLoadingFile, function (data) { + _this._delayLoadingFunction(JSON.parse(data), _this); + _this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADED; + _this._delayInfo = []; + scene._removePendingData(_this); + var meshes = _this._meshes; + var numOfMeshes = meshes.length; + for (var index = 0; index < numOfMeshes; index++) { + _this._applyToMesh(meshes[index]); + } + if (onLoaded) { + onLoaded(); + } + }, function () { }, scene.database); + }; + /** + * Invert the geometry to move from a right handed system to a left handed one. + */ + Geometry.prototype.toLeftHanded = function () { + // Flip faces + var tIndices = this.getIndices(false); + if (tIndices != null && tIndices.length > 0) { + for (var i = 0; i < tIndices.length; i += 3) { + var tTemp = tIndices[i + 0]; + tIndices[i + 0] = tIndices[i + 2]; + tIndices[i + 2] = tTemp; + } + this.setIndices(tIndices); + } + // Negate position.z + var tPositions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind, false); + if (tPositions != null && tPositions.length > 0) { + for (var i = 0; i < tPositions.length; i += 3) { + tPositions[i + 2] = -tPositions[i + 2]; + } + this.setVerticesData(BABYLON.VertexBuffer.PositionKind, tPositions, false); + } + // Negate normal.z + var tNormals = this.getVerticesData(BABYLON.VertexBuffer.NormalKind, false); + if (tNormals != null && tNormals.length > 0) { + for (var i = 0; i < tNormals.length; i += 3) { + tNormals[i + 2] = -tNormals[i + 2]; + } + this.setVerticesData(BABYLON.VertexBuffer.NormalKind, tNormals, false); + } + }; + Geometry.prototype.isDisposed = function () { + return this._isDisposed; + }; + Geometry.prototype.dispose = function () { + var meshes = this._meshes; + var numOfMeshes = meshes.length; + var index; + for (index = 0; index < numOfMeshes; index++) { + this.releaseForMesh(meshes[index]); + } + this._meshes = []; + for (var kind in this._vertexBuffers) { + this._vertexBuffers[kind].dispose(); + } + this._vertexBuffers = {}; + this._totalVertices = 0; + if (this._indexBuffer) { + this._engine._releaseBuffer(this._indexBuffer); + } + this._indexBuffer = null; + this._indices = []; + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NONE; + this.delayLoadingFile = null; + this._delayLoadingFunction = null; + this._delayInfo = []; + this._boundingInfo = null; + this._scene.removeGeometry(this); + this._isDisposed = true; + }; + Geometry.prototype.copy = function (id) { + var vertexData = new BABYLON.VertexData(); + vertexData.indices = []; + var indices = this.getIndices(); + for (var index = 0; index < indices.length; index++) { + vertexData.indices.push(indices[index]); + } + var updatable = false; + var stopChecking = false; + var kind; + for (kind in this._vertexBuffers) { + // using slice() to make a copy of the array and not just reference it + var data = this.getVerticesData(kind); + if (data instanceof Float32Array) { + vertexData.set(new Float32Array(data), kind); + } + else { + vertexData.set(data.slice(0), kind); + } + if (!stopChecking) { + updatable = this.getVertexBuffer(kind).isUpdatable(); + stopChecking = !updatable; + } + } + var geometry = new Geometry(id, this._scene, vertexData, updatable, null); + geometry.delayLoadState = this.delayLoadState; + geometry.delayLoadingFile = this.delayLoadingFile; + geometry._delayLoadingFunction = this._delayLoadingFunction; + for (kind in this._delayInfo) { + geometry._delayInfo = geometry._delayInfo || []; + geometry._delayInfo.push(kind); + } + // Bounding info + geometry._boundingInfo = new BABYLON.BoundingInfo(this._extend.minimum, this._extend.maximum); + return geometry; + }; + Geometry.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.id = this.id; + if (BABYLON.Tags.HasTags(this)) { + serializationObject.tags = BABYLON.Tags.GetTags(this); + } + return serializationObject; + }; + Geometry.prototype.serializeVerticeData = function () { + var serializationObject = this.serialize(); + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind)) { + serializationObject.positions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) { + serializationObject.normals = this.getVerticesData(BABYLON.VertexBuffer.NormalKind); + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) { + serializationObject.uvs = this.getVerticesData(BABYLON.VertexBuffer.UVKind); + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) { + serializationObject.uv2s = this.getVerticesData(BABYLON.VertexBuffer.UV2Kind); + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV3Kind)) { + serializationObject.uv3s = this.getVerticesData(BABYLON.VertexBuffer.UV3Kind); + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV4Kind)) { + serializationObject.uv4s = this.getVerticesData(BABYLON.VertexBuffer.UV4Kind); + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV5Kind)) { + serializationObject.uv5s = this.getVerticesData(BABYLON.VertexBuffer.UV5Kind); + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV6Kind)) { + serializationObject.uv6s = this.getVerticesData(BABYLON.VertexBuffer.UV6Kind); + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.ColorKind)) { + serializationObject.colors = this.getVerticesData(BABYLON.VertexBuffer.ColorKind); + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesIndicesKind)) { + serializationObject.matricesIndices = this.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind); + serializationObject.matricesIndices._isExpanded = true; + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsKind)) { + serializationObject.matricesWeights = this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind); + } + serializationObject.indices = this.getIndices(); + return serializationObject; + }; + // Statics + Geometry.ExtractFromMesh = function (mesh, id) { + var geometry = mesh._geometry; + if (!geometry) { + return null; + } + return geometry.copy(id); + }; + /** + * You should now use Tools.RandomId(), this method is still here for legacy reasons. + * Implementation from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#answer-2117523 + * Be aware Math.random() could cause collisions, but: + * "All but 6 of the 128 bits of the ID are randomly generated, which means that for any two ids, there's a 1 in 2^^122 (or 5.3x10^^36) chance they'll collide" + */ + Geometry.RandomId = function () { + return BABYLON.Tools.RandomId(); + }; + Geometry.ImportGeometry = function (parsedGeometry, mesh) { + var scene = mesh.getScene(); + // Geometry + var geometryId = parsedGeometry.geometryId; + if (geometryId) { + var geometry = scene.getGeometryByID(geometryId); + if (geometry) { + geometry.applyToMesh(mesh); + } + } + else if (parsedGeometry instanceof ArrayBuffer) { + var binaryInfo = mesh._binaryInfo; + if (binaryInfo.positionsAttrDesc && binaryInfo.positionsAttrDesc.count > 0) { + var positionsData = new Float32Array(parsedGeometry, binaryInfo.positionsAttrDesc.offset, binaryInfo.positionsAttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.PositionKind, positionsData, false); + } + if (binaryInfo.normalsAttrDesc && binaryInfo.normalsAttrDesc.count > 0) { + var normalsData = new Float32Array(parsedGeometry, binaryInfo.normalsAttrDesc.offset, binaryInfo.normalsAttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.NormalKind, normalsData, false); + } + if (binaryInfo.uvsAttrDesc && binaryInfo.uvsAttrDesc.count > 0) { + var uvsData = new Float32Array(parsedGeometry, binaryInfo.uvsAttrDesc.offset, binaryInfo.uvsAttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.UVKind, uvsData, false); + } + if (binaryInfo.uvs2AttrDesc && binaryInfo.uvs2AttrDesc.count > 0) { + var uvs2Data = new Float32Array(parsedGeometry, binaryInfo.uvs2AttrDesc.offset, binaryInfo.uvs2AttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.UV2Kind, uvs2Data, false); + } + if (binaryInfo.uvs3AttrDesc && binaryInfo.uvs3AttrDesc.count > 0) { + var uvs3Data = new Float32Array(parsedGeometry, binaryInfo.uvs3AttrDesc.offset, binaryInfo.uvs3AttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.UV3Kind, uvs3Data, false); + } + if (binaryInfo.uvs4AttrDesc && binaryInfo.uvs4AttrDesc.count > 0) { + var uvs4Data = new Float32Array(parsedGeometry, binaryInfo.uvs4AttrDesc.offset, binaryInfo.uvs4AttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.UV4Kind, uvs4Data, false); + } + if (binaryInfo.uvs5AttrDesc && binaryInfo.uvs5AttrDesc.count > 0) { + var uvs5Data = new Float32Array(parsedGeometry, binaryInfo.uvs5AttrDesc.offset, binaryInfo.uvs5AttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.UV5Kind, uvs5Data, false); + } + if (binaryInfo.uvs6AttrDesc && binaryInfo.uvs6AttrDesc.count > 0) { + var uvs6Data = new Float32Array(parsedGeometry, binaryInfo.uvs6AttrDesc.offset, binaryInfo.uvs6AttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.UV6Kind, uvs6Data, false); + } + if (binaryInfo.colorsAttrDesc && binaryInfo.colorsAttrDesc.count > 0) { + var colorsData = new Float32Array(parsedGeometry, binaryInfo.colorsAttrDesc.offset, binaryInfo.colorsAttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.ColorKind, colorsData, false, binaryInfo.colorsAttrDesc.stride); + } + if (binaryInfo.matricesIndicesAttrDesc && binaryInfo.matricesIndicesAttrDesc.count > 0) { + var matricesIndicesData = new Int32Array(parsedGeometry, binaryInfo.matricesIndicesAttrDesc.offset, binaryInfo.matricesIndicesAttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind, matricesIndicesData, false); + } + if (binaryInfo.matricesWeightsAttrDesc && binaryInfo.matricesWeightsAttrDesc.count > 0) { + var matricesWeightsData = new Float32Array(parsedGeometry, binaryInfo.matricesWeightsAttrDesc.offset, binaryInfo.matricesWeightsAttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind, matricesWeightsData, false); + } + if (binaryInfo.indicesAttrDesc && binaryInfo.indicesAttrDesc.count > 0) { + var indicesData = new Int32Array(parsedGeometry, binaryInfo.indicesAttrDesc.offset, binaryInfo.indicesAttrDesc.count); + mesh.setIndices(indicesData); + } + if (binaryInfo.subMeshesAttrDesc && binaryInfo.subMeshesAttrDesc.count > 0) { + var subMeshesData = new Int32Array(parsedGeometry, binaryInfo.subMeshesAttrDesc.offset, binaryInfo.subMeshesAttrDesc.count * 5); + mesh.subMeshes = []; + for (var i = 0; i < binaryInfo.subMeshesAttrDesc.count; i++) { + var materialIndex = subMeshesData[(i * 5) + 0]; + var verticesStart = subMeshesData[(i * 5) + 1]; + var verticesCount = subMeshesData[(i * 5) + 2]; + var indexStart = subMeshesData[(i * 5) + 3]; + var indexCount = subMeshesData[(i * 5) + 4]; + var subMesh = new BABYLON.SubMesh(materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh); + } + } + } + else if (parsedGeometry.positions && parsedGeometry.normals && parsedGeometry.indices) { + mesh.setVerticesData(BABYLON.VertexBuffer.PositionKind, parsedGeometry.positions, false); + mesh.setVerticesData(BABYLON.VertexBuffer.NormalKind, parsedGeometry.normals, false); + if (parsedGeometry.uvs) { + mesh.setVerticesData(BABYLON.VertexBuffer.UVKind, parsedGeometry.uvs, false); + } + if (parsedGeometry.uvs2) { + mesh.setVerticesData(BABYLON.VertexBuffer.UV2Kind, parsedGeometry.uvs2, false); + } + if (parsedGeometry.uvs3) { + mesh.setVerticesData(BABYLON.VertexBuffer.UV3Kind, parsedGeometry.uvs3, false); + } + if (parsedGeometry.uvs4) { + mesh.setVerticesData(BABYLON.VertexBuffer.UV4Kind, parsedGeometry.uvs4, false); + } + if (parsedGeometry.uvs5) { + mesh.setVerticesData(BABYLON.VertexBuffer.UV5Kind, parsedGeometry.uvs5, false); + } + if (parsedGeometry.uvs6) { + mesh.setVerticesData(BABYLON.VertexBuffer.UV6Kind, parsedGeometry.uvs6, false); + } + if (parsedGeometry.colors) { + mesh.setVerticesData(BABYLON.VertexBuffer.ColorKind, BABYLON.Color4.CheckColors4(parsedGeometry.colors, parsedGeometry.positions.length / 3), false); + } + if (parsedGeometry.matricesIndices) { + if (!parsedGeometry.matricesIndices._isExpanded) { + var floatIndices = []; + for (var i = 0; i < parsedGeometry.matricesIndices.length; i++) { + var matricesIndex = parsedGeometry.matricesIndices[i]; + floatIndices.push(matricesIndex & 0x000000FF); + floatIndices.push((matricesIndex & 0x0000FF00) >> 8); + floatIndices.push((matricesIndex & 0x00FF0000) >> 16); + floatIndices.push(matricesIndex >> 24); + } + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind, floatIndices, false); + } + else { + delete parsedGeometry.matricesIndices._isExpanded; + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind, parsedGeometry.matricesIndices, false); + } + } + if (parsedGeometry.matricesIndicesExtra) { + if (!parsedGeometry.matricesIndicesExtra._isExpanded) { + var floatIndices = []; + for (var i = 0; i < parsedGeometry.matricesIndicesExtra.length; i++) { + var matricesIndex = parsedGeometry.matricesIndicesExtra[i]; + floatIndices.push(matricesIndex & 0x000000FF); + floatIndices.push((matricesIndex & 0x0000FF00) >> 8); + floatIndices.push((matricesIndex & 0x00FF0000) >> 16); + floatIndices.push(matricesIndex >> 24); + } + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesExtraKind, floatIndices, false); + } + else { + delete parsedGeometry.matricesIndices._isExpanded; + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesExtraKind, parsedGeometry.matricesIndicesExtra, false); + } + } + if (parsedGeometry.matricesWeights) { + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind, parsedGeometry.matricesWeights, false); + } + if (parsedGeometry.matricesWeightsExtra) { + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesWeightsExtraKind, parsedGeometry.matricesWeightsExtra, false); + } + mesh.setIndices(parsedGeometry.indices); + } + // SubMeshes + if (parsedGeometry.subMeshes) { + mesh.subMeshes = []; + for (var subIndex = 0; subIndex < parsedGeometry.subMeshes.length; subIndex++) { + var parsedSubMesh = parsedGeometry.subMeshes[subIndex]; + var subMesh = new BABYLON.SubMesh(parsedSubMesh.materialIndex, parsedSubMesh.verticesStart, parsedSubMesh.verticesCount, parsedSubMesh.indexStart, parsedSubMesh.indexCount, mesh); + } + } + // Flat shading + if (mesh._shouldGenerateFlatShading) { + mesh.convertToFlatShadedMesh(); + delete mesh._shouldGenerateFlatShading; + } + // Update + mesh.computeWorldMatrix(true); + // Octree + if (scene['_selectionOctree']) { + scene['_selectionOctree'].addMesh(mesh); + } + }; + Geometry.Parse = function (parsedVertexData, scene, rootUrl) { + if (scene.getGeometryByID(parsedVertexData.id)) { + return null; // null since geometry could be something else than a box... + } + var geometry = new Geometry(parsedVertexData.id, scene); + BABYLON.Tags.AddTagsTo(geometry, parsedVertexData.tags); + if (parsedVertexData.delayLoadingFile) { + geometry.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED; + geometry.delayLoadingFile = rootUrl + parsedVertexData.delayLoadingFile; + geometry._boundingInfo = new BABYLON.BoundingInfo(BABYLON.Vector3.FromArray(parsedVertexData.boundingBoxMinimum), BABYLON.Vector3.FromArray(parsedVertexData.boundingBoxMaximum)); + geometry._delayInfo = []; + if (parsedVertexData.hasUVs) { + geometry._delayInfo.push(BABYLON.VertexBuffer.UVKind); + } + if (parsedVertexData.hasUVs2) { + geometry._delayInfo.push(BABYLON.VertexBuffer.UV2Kind); + } + if (parsedVertexData.hasUVs3) { + geometry._delayInfo.push(BABYLON.VertexBuffer.UV3Kind); + } + if (parsedVertexData.hasUVs4) { + geometry._delayInfo.push(BABYLON.VertexBuffer.UV4Kind); + } + if (parsedVertexData.hasUVs5) { + geometry._delayInfo.push(BABYLON.VertexBuffer.UV5Kind); + } + if (parsedVertexData.hasUVs6) { + geometry._delayInfo.push(BABYLON.VertexBuffer.UV6Kind); + } + if (parsedVertexData.hasColors) { + geometry._delayInfo.push(BABYLON.VertexBuffer.ColorKind); + } + if (parsedVertexData.hasMatricesIndices) { + geometry._delayInfo.push(BABYLON.VertexBuffer.MatricesIndicesKind); + } + if (parsedVertexData.hasMatricesWeights) { + geometry._delayInfo.push(BABYLON.VertexBuffer.MatricesWeightsKind); + } + geometry._delayLoadingFunction = BABYLON.VertexData.ImportVertexData; + } + else { + BABYLON.VertexData.ImportVertexData(parsedVertexData, geometry); + } + scene.pushGeometry(geometry, true); + return geometry; + }; + return Geometry; + }()); + BABYLON.Geometry = Geometry; + /////// Primitives ////////////////////////////////////////////// + var Geometry; + (function (Geometry) { + var Primitives; + (function (Primitives) { + /// Abstract class + var _Primitive = (function (_super) { + __extends(_Primitive, _super); + function _Primitive(id, scene, _canBeRegenerated, mesh) { + _super.call(this, id, scene, null, false, mesh); // updatable = false to be sure not to update vertices + this._canBeRegenerated = _canBeRegenerated; + this._beingRegenerated = true; + this.regenerate(); + this._beingRegenerated = false; + } + _Primitive.prototype.canBeRegenerated = function () { + return this._canBeRegenerated; + }; + _Primitive.prototype.regenerate = function () { + if (!this._canBeRegenerated) { + return; + } + this._beingRegenerated = true; + this.setAllVerticesData(this._regenerateVertexData(), false); + this._beingRegenerated = false; + }; + _Primitive.prototype.asNewGeometry = function (id) { + return _super.prototype.copy.call(this, id); + }; + // overrides + _Primitive.prototype.setAllVerticesData = function (vertexData, updatable) { + if (!this._beingRegenerated) { + return; + } + _super.prototype.setAllVerticesData.call(this, vertexData, false); + }; + _Primitive.prototype.setVerticesData = function (kind, data, updatable) { + if (!this._beingRegenerated) { + return; + } + _super.prototype.setVerticesData.call(this, kind, data, false); + }; + // to override + // protected + _Primitive.prototype._regenerateVertexData = function () { + throw new Error("Abstract method"); + }; + _Primitive.prototype.copy = function (id) { + throw new Error("Must be overriden in sub-classes."); + }; + _Primitive.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.canBeRegenerated = this.canBeRegenerated(); + return serializationObject; + }; + return _Primitive; + }(Geometry)); + Primitives._Primitive = _Primitive; + var Ribbon = (function (_super) { + __extends(Ribbon, _super); + // Members + function Ribbon(id, scene, pathArray, closeArray, closePath, offset, canBeRegenerated, mesh, side) { + if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; } + _super.call(this, id, scene, canBeRegenerated, mesh); + this.pathArray = pathArray; + this.closeArray = closeArray; + this.closePath = closePath; + this.offset = offset; + this.side = side; + } + Ribbon.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateRibbon({ pathArray: this.pathArray, closeArray: this.closeArray, closePath: this.closePath, offset: this.offset, sideOrientation: this.side }); + }; + Ribbon.prototype.copy = function (id) { + return new Ribbon(id, this.getScene(), this.pathArray, this.closeArray, this.closePath, this.offset, this.canBeRegenerated(), null, this.side); + }; + return Ribbon; + }(_Primitive)); + Primitives.Ribbon = Ribbon; + var Box = (function (_super) { + __extends(Box, _super); + // Members + function Box(id, scene, size, canBeRegenerated, mesh, side) { + if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; } + _super.call(this, id, scene, canBeRegenerated, mesh); + this.size = size; + this.side = side; + } + Box.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateBox({ size: this.size, sideOrientation: this.side }); + }; + Box.prototype.copy = function (id) { + return new Box(id, this.getScene(), this.size, this.canBeRegenerated(), null, this.side); + }; + Box.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.size = this.size; + return serializationObject; + }; + Box.Parse = function (parsedBox, scene) { + if (scene.getGeometryByID(parsedBox.id)) { + return null; // null since geometry could be something else than a box... + } + var box = new Geometry.Primitives.Box(parsedBox.id, scene, parsedBox.size, parsedBox.canBeRegenerated, null); + BABYLON.Tags.AddTagsTo(box, parsedBox.tags); + scene.pushGeometry(box, true); + return box; + }; + return Box; + }(_Primitive)); + Primitives.Box = Box; + var Sphere = (function (_super) { + __extends(Sphere, _super); + function Sphere(id, scene, segments, diameter, canBeRegenerated, mesh, side) { + if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; } + _super.call(this, id, scene, canBeRegenerated, mesh); + this.segments = segments; + this.diameter = diameter; + this.side = side; + } + Sphere.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateSphere({ segments: this.segments, diameter: this.diameter, sideOrientation: this.side }); + }; + Sphere.prototype.copy = function (id) { + return new Sphere(id, this.getScene(), this.segments, this.diameter, this.canBeRegenerated(), null, this.side); + }; + Sphere.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.segments = this.segments; + serializationObject.diameter = this.diameter; + return serializationObject; + }; + Sphere.Parse = function (parsedSphere, scene) { + if (scene.getGeometryByID(parsedSphere.id)) { + return null; // null since geometry could be something else than a sphere... + } + var sphere = new Geometry.Primitives.Sphere(parsedSphere.id, scene, parsedSphere.segments, parsedSphere.diameter, parsedSphere.canBeRegenerated, null); + BABYLON.Tags.AddTagsTo(sphere, parsedSphere.tags); + scene.pushGeometry(sphere, true); + return sphere; + }; + return Sphere; + }(_Primitive)); + Primitives.Sphere = Sphere; + var Disc = (function (_super) { + __extends(Disc, _super); + // Members + function Disc(id, scene, radius, tessellation, canBeRegenerated, mesh, side) { + if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; } + _super.call(this, id, scene, canBeRegenerated, mesh); + this.radius = radius; + this.tessellation = tessellation; + this.side = side; + } + Disc.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateDisc({ radius: this.radius, tessellation: this.tessellation, sideOrientation: this.side }); + }; + Disc.prototype.copy = function (id) { + return new Disc(id, this.getScene(), this.radius, this.tessellation, this.canBeRegenerated(), null, this.side); + }; + return Disc; + }(_Primitive)); + Primitives.Disc = Disc; + var Cylinder = (function (_super) { + __extends(Cylinder, _super); + function Cylinder(id, scene, height, diameterTop, diameterBottom, tessellation, subdivisions, canBeRegenerated, mesh, side) { + if (subdivisions === void 0) { subdivisions = 1; } + if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; } + _super.call(this, id, scene, canBeRegenerated, mesh); + this.height = height; + this.diameterTop = diameterTop; + this.diameterBottom = diameterBottom; + this.tessellation = tessellation; + this.subdivisions = subdivisions; + this.side = side; + } + Cylinder.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateCylinder({ height: this.height, diameterTop: this.diameterTop, diameterBottom: this.diameterBottom, tessellation: this.tessellation, subdivisions: this.subdivisions, sideOrientation: this.side }); + }; + Cylinder.prototype.copy = function (id) { + return new Cylinder(id, this.getScene(), this.height, this.diameterTop, this.diameterBottom, this.tessellation, this.subdivisions, this.canBeRegenerated(), null, this.side); + }; + Cylinder.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.height = this.height; + serializationObject.diameterTop = this.diameterTop; + serializationObject.diameterBottom = this.diameterBottom; + serializationObject.tessellation = this.tessellation; + return serializationObject; + }; + Cylinder.Parse = function (parsedCylinder, scene) { + if (scene.getGeometryByID(parsedCylinder.id)) { + return null; // null since geometry could be something else than a cylinder... + } + var cylinder = new Geometry.Primitives.Cylinder(parsedCylinder.id, scene, parsedCylinder.height, parsedCylinder.diameterTop, parsedCylinder.diameterBottom, parsedCylinder.tessellation, parsedCylinder.subdivisions, parsedCylinder.canBeRegenerated, null); + BABYLON.Tags.AddTagsTo(cylinder, parsedCylinder.tags); + scene.pushGeometry(cylinder, true); + return cylinder; + }; + return Cylinder; + }(_Primitive)); + Primitives.Cylinder = Cylinder; + var Torus = (function (_super) { + __extends(Torus, _super); + function Torus(id, scene, diameter, thickness, tessellation, canBeRegenerated, mesh, side) { + if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; } + _super.call(this, id, scene, canBeRegenerated, mesh); + this.diameter = diameter; + this.thickness = thickness; + this.tessellation = tessellation; + this.side = side; + } + Torus.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateTorus({ diameter: this.diameter, thickness: this.thickness, tessellation: this.tessellation, sideOrientation: this.side }); + }; + Torus.prototype.copy = function (id) { + return new Torus(id, this.getScene(), this.diameter, this.thickness, this.tessellation, this.canBeRegenerated(), null, this.side); + }; + Torus.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.diameter = this.diameter; + serializationObject.thickness = this.thickness; + serializationObject.tessellation = this.tessellation; + return serializationObject; + }; + Torus.Parse = function (parsedTorus, scene) { + if (scene.getGeometryByID(parsedTorus.id)) { + return null; // null since geometry could be something else than a torus... + } + var torus = new Geometry.Primitives.Torus(parsedTorus.id, scene, parsedTorus.diameter, parsedTorus.thickness, parsedTorus.tessellation, parsedTorus.canBeRegenerated, null); + BABYLON.Tags.AddTagsTo(torus, parsedTorus.tags); + scene.pushGeometry(torus, true); + return torus; + }; + return Torus; + }(_Primitive)); + Primitives.Torus = Torus; + var Ground = (function (_super) { + __extends(Ground, _super); + function Ground(id, scene, width, height, subdivisions, canBeRegenerated, mesh) { + _super.call(this, id, scene, canBeRegenerated, mesh); + this.width = width; + this.height = height; + this.subdivisions = subdivisions; + } + Ground.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateGround({ width: this.width, height: this.height, subdivisions: this.subdivisions }); + }; + Ground.prototype.copy = function (id) { + return new Ground(id, this.getScene(), this.width, this.height, this.subdivisions, this.canBeRegenerated(), null); + }; + Ground.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.width = this.width; + serializationObject.height = this.height; + serializationObject.subdivisions = this.subdivisions; + return serializationObject; + }; + Ground.Parse = function (parsedGround, scene) { + if (scene.getGeometryByID(parsedGround.id)) { + return null; // null since geometry could be something else than a ground... + } + var ground = new Geometry.Primitives.Ground(parsedGround.id, scene, parsedGround.width, parsedGround.height, parsedGround.subdivisions, parsedGround.canBeRegenerated, null); + BABYLON.Tags.AddTagsTo(ground, parsedGround.tags); + scene.pushGeometry(ground, true); + return ground; + }; + return Ground; + }(_Primitive)); + Primitives.Ground = Ground; + var TiledGround = (function (_super) { + __extends(TiledGround, _super); + function TiledGround(id, scene, xmin, zmin, xmax, zmax, subdivisions, precision, canBeRegenerated, mesh) { + _super.call(this, id, scene, canBeRegenerated, mesh); + this.xmin = xmin; + this.zmin = zmin; + this.xmax = xmax; + this.zmax = zmax; + this.subdivisions = subdivisions; + this.precision = precision; + } + TiledGround.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateTiledGround({ xmin: this.xmin, zmin: this.zmin, xmax: this.xmax, zmax: this.zmax, subdivisions: this.subdivisions, precision: this.precision }); + }; + TiledGround.prototype.copy = function (id) { + return new TiledGround(id, this.getScene(), this.xmin, this.zmin, this.xmax, this.zmax, this.subdivisions, this.precision, this.canBeRegenerated(), null); + }; + return TiledGround; + }(_Primitive)); + Primitives.TiledGround = TiledGround; + var Plane = (function (_super) { + __extends(Plane, _super); + function Plane(id, scene, size, canBeRegenerated, mesh, side) { + if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; } + _super.call(this, id, scene, canBeRegenerated, mesh); + this.size = size; + this.side = side; + } + Plane.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreatePlane({ size: this.size, sideOrientation: this.side }); + }; + Plane.prototype.copy = function (id) { + return new Plane(id, this.getScene(), this.size, this.canBeRegenerated(), null, this.side); + }; + Plane.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.size = this.size; + return serializationObject; + }; + Plane.Parse = function (parsedPlane, scene) { + if (scene.getGeometryByID(parsedPlane.id)) { + return null; // null since geometry could be something else than a ground... + } + var plane = new Geometry.Primitives.Plane(parsedPlane.id, scene, parsedPlane.size, parsedPlane.canBeRegenerated, null); + BABYLON.Tags.AddTagsTo(plane, parsedPlane.tags); + scene.pushGeometry(plane, true); + return plane; + }; + return Plane; + }(_Primitive)); + Primitives.Plane = Plane; + var TorusKnot = (function (_super) { + __extends(TorusKnot, _super); + function TorusKnot(id, scene, radius, tube, radialSegments, tubularSegments, p, q, canBeRegenerated, mesh, side) { + if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; } + _super.call(this, id, scene, canBeRegenerated, mesh); + this.radius = radius; + this.tube = tube; + this.radialSegments = radialSegments; + this.tubularSegments = tubularSegments; + this.p = p; + this.q = q; + this.side = side; + } + TorusKnot.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateTorusKnot({ radius: this.radius, tube: this.tube, radialSegments: this.radialSegments, tubularSegments: this.tubularSegments, p: this.p, q: this.q, sideOrientation: this.side }); + }; + TorusKnot.prototype.copy = function (id) { + return new TorusKnot(id, this.getScene(), this.radius, this.tube, this.radialSegments, this.tubularSegments, this.p, this.q, this.canBeRegenerated(), null, this.side); + }; + TorusKnot.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.radius = this.radius; + serializationObject.tube = this.tube; + serializationObject.radialSegments = this.radialSegments; + serializationObject.tubularSegments = this.tubularSegments; + serializationObject.p = this.p; + serializationObject.q = this.q; + return serializationObject; + }; + ; + TorusKnot.Parse = function (parsedTorusKnot, scene) { + if (scene.getGeometryByID(parsedTorusKnot.id)) { + return null; // null since geometry could be something else than a ground... + } + var torusKnot = new Geometry.Primitives.TorusKnot(parsedTorusKnot.id, scene, parsedTorusKnot.radius, parsedTorusKnot.tube, parsedTorusKnot.radialSegments, parsedTorusKnot.tubularSegments, parsedTorusKnot.p, parsedTorusKnot.q, parsedTorusKnot.canBeRegenerated, null); + BABYLON.Tags.AddTagsTo(torusKnot, parsedTorusKnot.tags); + scene.pushGeometry(torusKnot, true); + return torusKnot; + }; + return TorusKnot; + }(_Primitive)); + Primitives.TorusKnot = TorusKnot; + })(Primitives = Geometry.Primitives || (Geometry.Primitives = {})); + })(Geometry = BABYLON.Geometry || (BABYLON.Geometry = {})); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.geometry.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var GroundMesh = (function (_super) { + __extends(GroundMesh, _super); + function GroundMesh(name, scene) { + _super.call(this, name, scene); + this.generateOctree = false; + this._worldInverse = new BABYLON.Matrix(); + } + Object.defineProperty(GroundMesh.prototype, "subdivisions", { + get: function () { + return Math.min(this._subdivisionsX, this._subdivisionsY); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GroundMesh.prototype, "subdivisionsX", { + get: function () { + return this._subdivisionsX; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GroundMesh.prototype, "subdivisionsY", { + get: function () { + return this._subdivisionsY; + }, + enumerable: true, + configurable: true + }); + GroundMesh.prototype.optimize = function (chunksCount, octreeBlocksSize) { + if (octreeBlocksSize === void 0) { octreeBlocksSize = 32; } + this._subdivisionsX = chunksCount; + this._subdivisionsY = chunksCount; + this.subdivide(chunksCount); + this.createOrUpdateSubmeshesOctree(octreeBlocksSize); + }; + /** + * Returns a height (y) value in the Worl system : + * the ground altitude at the coordinates (x, z) expressed in the World system. + * Returns the ground y position if (x, z) are outside the ground surface. + * Not pertinent if the ground is rotated. + */ + GroundMesh.prototype.getHeightAtCoordinates = function (x, z) { + // express x and y in the ground local system + x -= this.position.x; + z -= this.position.z; + x /= this.scaling.x; + z /= this.scaling.z; + if (x < this._minX || x > this._maxX || z < this._minZ || z > this._maxZ) { + return this.position.y; + } + if (!this._heightQuads || this._heightQuads.length == 0) { + this._initHeightQuads(); + this._computeHeightQuads(); + } + var facet = this._getFacetAt(x, z); + var y = -(facet.x * x + facet.z * z + facet.w) / facet.y; + // return y in the World system + return y * this.scaling.y + this.position.y; + }; + /** + * Returns a normalized vector (Vector3) orthogonal to the ground + * at the ground coordinates (x, z) expressed in the World system. + * Returns Vector3(0, 1, 0) if (x, z) are outside the ground surface. + * Not pertinent if the ground is rotated. + */ + GroundMesh.prototype.getNormalAtCoordinates = function (x, z) { + var normal = new BABYLON.Vector3(0, 1, 0); + this.getNormalAtCoordinatesToRef(x, z, normal); + return normal; + }; + /** + * Updates the Vector3 passed a reference with a normalized vector orthogonal to the ground + * at the ground coordinates (x, z) expressed in the World system. + * Doesn't uptade the reference Vector3 if (x, z) are outside the ground surface. + * Not pertinent if the ground is rotated. + */ + GroundMesh.prototype.getNormalAtCoordinatesToRef = function (x, z, ref) { + // express x and y in the ground local system + x -= this.position.x; + z -= this.position.z; + x /= this.scaling.x; + z /= this.scaling.z; + if (x < this._minX || x > this._maxX || z < this._minZ || z > this._maxZ) { + return; + } + if (!this._heightQuads || this._heightQuads.length == 0) { + this._initHeightQuads(); + this._computeHeightQuads(); + } + var facet = this._getFacetAt(x, z); + ref.x = facet.x; + ref.y = facet.y; + ref.z = facet.z; + }; + /** + * Force the heights to be recomputed for getHeightAtCoordinates() or getNormalAtCoordinates() + * if the ground has been updated. + * This can be used in the render loop + */ + GroundMesh.prototype.updateCoordinateHeights = function () { + if (!this._heightQuads || this._heightQuads.length == 0) { + this._initHeightQuads(); + } + this._computeHeightQuads(); + }; + // Returns the element "facet" from the heightQuads array relative to (x, z) local coordinates + GroundMesh.prototype._getFacetAt = function (x, z) { + // retrieve col and row from x, z coordinates in the ground local system + var subdivisionsX = this._subdivisionsX; + var subdivisionsY = this._subdivisionsY; + var col = Math.floor((x + this._maxX) * this._subdivisionsX / this._width); + var row = Math.floor(-(z + this._maxZ) * this._subdivisionsY / this._height + this._subdivisionsY); + var quad = this._heightQuads[row * this._subdivisionsX + col]; + var facet; + if (z < quad.slope.x * x + quad.slope.y) { + facet = quad.facet1; + } + else { + facet = quad.facet2; + } + return facet; + }; + // Creates and populates the heightMap array with "facet" elements : + // a quad is two triangular facets separated by a slope, so a "facet" element is 1 slope + 2 facets + // slope : Vector2(c, h) = 2D diagonal line equation setting appart two triangular facets in a quad : z = cx + h + // facet1 : Vector4(a, b, c, d) = first facet 3D plane equation : ax + by + cz + d = 0 + // facet2 : Vector4(a, b, c, d) = second facet 3D plane equation : ax + by + cz + d = 0 + GroundMesh.prototype._initHeightQuads = function () { + var subdivisionsX = this._subdivisionsX; + var subdivisionsY = this._subdivisionsY; + this._heightQuads = new Array(); + for (var row = 0; row < subdivisionsY; row++) { + for (var col = 0; col < subdivisionsX; col++) { + var quad = { slope: BABYLON.Vector2.Zero(), facet1: new BABYLON.Vector4(0, 0, 0, 0), facet2: new BABYLON.Vector4(0, 0, 0, 0) }; + this._heightQuads[row * subdivisionsX + col] = quad; + } + } + }; + // Compute each quad element values and update the the heightMap array : + // slope : Vector2(c, h) = 2D diagonal line equation setting appart two triangular facets in a quad : z = cx + h + // facet1 : Vector4(a, b, c, d) = first facet 3D plane equation : ax + by + cz + d = 0 + // facet2 : Vector4(a, b, c, d) = second facet 3D plane equation : ax + by + cz + d = 0 + GroundMesh.prototype._computeHeightQuads = function () { + var positions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + var v1 = BABYLON.Tmp.Vector3[3]; + var v2 = BABYLON.Tmp.Vector3[2]; + var v3 = BABYLON.Tmp.Vector3[1]; + var v4 = BABYLON.Tmp.Vector3[0]; + var v1v2 = BABYLON.Tmp.Vector3[4]; + var v1v3 = BABYLON.Tmp.Vector3[5]; + var v1v4 = BABYLON.Tmp.Vector3[6]; + var norm1 = BABYLON.Tmp.Vector3[7]; + var norm2 = BABYLON.Tmp.Vector3[8]; + var i = 0; + var j = 0; + var k = 0; + var cd = 0; // 2D slope coefficient : z = cd * x + h + var h = 0; + var d1 = 0; // facet plane equation : ax + by + cz + d = 0 + var d2 = 0; + var subdivisionsX = this._subdivisionsX; + var subdivisionsY = this._subdivisionsY; + for (var row = 0; row < subdivisionsY; row++) { + for (var col = 0; col < subdivisionsX; col++) { + i = col * 3; + j = row * (subdivisionsX + 1) * 3; + k = (row + 1) * (subdivisionsX + 1) * 3; + v1.x = positions[j + i]; + v1.y = positions[j + i + 1]; + v1.z = positions[j + i + 2]; + v2.x = positions[j + i + 3]; + v2.y = positions[j + i + 4]; + v2.z = positions[j + i + 5]; + v3.x = positions[k + i]; + v3.y = positions[k + i + 1]; + v3.z = positions[k + i + 2]; + v4.x = positions[k + i + 3]; + v4.y = positions[k + i + 4]; + v4.z = positions[k + i + 5]; + // 2D slope V1V4 + cd = (v4.z - v1.z) / (v4.x - v1.x); + h = v1.z - cd * v1.x; // v1 belongs to the slope + // facet equations : + // we compute each facet normal vector + // the equation of the facet plane is : norm.x * x + norm.y * y + norm.z * z + d = 0 + // we compute the value d by applying the equation to v1 which belongs to the plane + // then we store the facet equation in a Vector4 + v2.subtractToRef(v1, v1v2); + v3.subtractToRef(v1, v1v3); + v4.subtractToRef(v1, v1v4); + BABYLON.Vector3.CrossToRef(v1v4, v1v3, norm1); // caution : CrossToRef uses the Tmp class + BABYLON.Vector3.CrossToRef(v1v2, v1v4, norm2); + norm1.normalize(); + norm2.normalize(); + d1 = -(norm1.x * v1.x + norm1.y * v1.y + norm1.z * v1.z); + d2 = -(norm2.x * v2.x + norm2.y * v2.y + norm2.z * v2.z); + var quad = this._heightQuads[row * subdivisionsX + col]; + quad.slope.copyFromFloats(cd, h); + quad.facet1.copyFromFloats(norm1.x, norm1.y, norm1.z, d1); + quad.facet2.copyFromFloats(norm2.x, norm2.y, norm2.z, d2); + } + } + }; + return GroundMesh; + }(BABYLON.Mesh)); + BABYLON.GroundMesh = GroundMesh; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.groundMesh.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var LinesMesh = (function (_super) { + __extends(LinesMesh, _super); + function LinesMesh(name, scene, parent, source, doNotCloneChildren) { + if (parent === void 0) { parent = null; } + _super.call(this, name, scene, parent, source, doNotCloneChildren); + this.color = new BABYLON.Color3(1, 1, 1); + this.alpha = 1; + this._positionBuffer = {}; + if (source) { + this.color = source.color.clone(); + this.alpha = source.alpha; + } + this._intersectionThreshold = 0.1; + this._colorShader = new BABYLON.ShaderMaterial("colorShader", scene, "color", { + attributes: [BABYLON.VertexBuffer.PositionKind], + uniforms: ["worldViewProjection", "color"], + needAlphaBlending: true + }); + this._positionBuffer[BABYLON.VertexBuffer.PositionKind] = null; + } + Object.defineProperty(LinesMesh.prototype, "intersectionThreshold", { + /** + * The intersection Threshold is the margin applied when intersection a segment of the LinesMesh with a Ray. + * This margin is expressed in world space coordinates, so its value may vary. + * Default value is 0.1 + * @returns the intersection Threshold value. + */ + get: function () { + return this._intersectionThreshold; + }, + /** + * The intersection Threshold is the margin applied when intersection a segment of the LinesMesh with a Ray. + * This margin is expressed in world space coordinates, so its value may vary. + * @param value the new threshold to apply + */ + set: function (value) { + if (this._intersectionThreshold === value) { + return; + } + this._intersectionThreshold = value; + if (this.geometry) { + this.geometry.boundingBias = new BABYLON.Vector2(0, value); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LinesMesh.prototype, "material", { + get: function () { + return this._colorShader; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LinesMesh.prototype, "checkCollisions", { + get: function () { + return false; + }, + enumerable: true, + configurable: true + }); + LinesMesh.prototype.createInstance = function (name) { + BABYLON.Tools.Log("LinesMeshes do not support createInstance."); + return null; + }; + LinesMesh.prototype._bind = function (subMesh, effect, fillMode) { + var engine = this.getScene().getEngine(); + this._positionBuffer[BABYLON.VertexBuffer.PositionKind] = this._geometry.getVertexBuffer(BABYLON.VertexBuffer.PositionKind); + // VBOs + engine.bindBuffers(this._positionBuffer, this._geometry.getIndexBuffer(), this._colorShader.getEffect()); + // Color + this._colorShader.setColor4("color", this.color.toColor4(this.alpha)); + }; + LinesMesh.prototype._draw = function (subMesh, fillMode, instancesCount) { + if (!this._geometry || !this._geometry.getVertexBuffers() || !this._geometry.getIndexBuffer()) { + return; + } + var engine = this.getScene().getEngine(); + // Draw order + engine.draw(false, subMesh.indexStart, subMesh.indexCount); + }; + LinesMesh.prototype.dispose = function (doNotRecurse) { + this._colorShader.dispose(); + _super.prototype.dispose.call(this, doNotRecurse); + }; + LinesMesh.prototype.clone = function (name, newParent, doNotCloneChildren) { + return new LinesMesh(name, this.getScene(), newParent, this, doNotCloneChildren); + }; + return LinesMesh; + }(BABYLON.Mesh)); + BABYLON.LinesMesh = LinesMesh; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.linesMesh.js.map + +var BABYLON; +(function (BABYLON) { + var DefaultLoadingScreen = (function () { + function DefaultLoadingScreen(_renderingCanvas, _loadingText, _loadingDivBackgroundColor) { + var _this = this; + if (_loadingText === void 0) { _loadingText = ""; } + if (_loadingDivBackgroundColor === void 0) { _loadingDivBackgroundColor = "black"; } + this._renderingCanvas = _renderingCanvas; + this._loadingText = _loadingText; + this._loadingDivBackgroundColor = _loadingDivBackgroundColor; + // Resize + this._resizeLoadingUI = function () { + var canvasRect = _this._renderingCanvas.getBoundingClientRect(); + _this._loadingDiv.style.position = "absolute"; + _this._loadingDiv.style.left = canvasRect.left + "px"; + _this._loadingDiv.style.top = canvasRect.top + "px"; + _this._loadingDiv.style.width = canvasRect.width + "px"; + _this._loadingDiv.style.height = canvasRect.height + "px"; + }; + } + DefaultLoadingScreen.prototype.displayLoadingUI = function () { + var _this = this; + if (this._loadingDiv) { + // Do not add a loading screen if there is already one + return; + } + this._loadingDiv = document.createElement("div"); + this._loadingDiv.id = "babylonjsLoadingDiv"; + this._loadingDiv.style.opacity = "0"; + this._loadingDiv.style.transition = "opacity 1.5s ease"; + // Loading text + this._loadingTextDiv = document.createElement("div"); + this._loadingTextDiv.style.position = "absolute"; + this._loadingTextDiv.style.left = "0"; + this._loadingTextDiv.style.top = "50%"; + this._loadingTextDiv.style.marginTop = "80px"; + this._loadingTextDiv.style.width = "100%"; + this._loadingTextDiv.style.height = "20px"; + this._loadingTextDiv.style.fontFamily = "Arial"; + this._loadingTextDiv.style.fontSize = "14px"; + this._loadingTextDiv.style.color = "white"; + this._loadingTextDiv.style.textAlign = "center"; + this._loadingTextDiv.innerHTML = "Loading"; + this._loadingDiv.appendChild(this._loadingTextDiv); + //set the predefined text + this._loadingTextDiv.innerHTML = this._loadingText; + // Loading img + var imgBack = new Image(); + imgBack.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuM4zml1AAAARbSURBVHhe7Z09aFNRFMc716kuLrq4FdyLq4Wi4CAoRQcR0UJBUBdRiuLSIYMo6CA4FF2sgw6CFAdFUOpSQYcWO4hD26UQCfXrIQrx/JJzw1OSWq3NPeL/B4Fy+0jg/HO+7j3vpUcI8b/Q39+/49ihfWdPHT94Yf/e3Se3bd263f8lus218TPn6vV6Ya8Wi/MzNRNmj18iusX9W1evmP1/EKNEIVG6CMbG6E3bt+fT++pHha8NoHdT72bLE8NDg7tGU64gLLndV4Wc4m8j/pS+vr4tGB/DT16v3Fyr8dvBe/jbit8BL0AES9LX1iPAz+BR/hFiLVCynj95dPzNy6fv3IZ/k4L3948Sq7FzYGBg4vLFGxitabuOFCbWNKGrMnbiUuo18KaV6tIHv6YtvL9/nOgE31jCktmrY7k6+/zhE4yP4Vf7hiNqh/BWWEl8mzDol4p22Lf7cIdvdUMEvv0Y2S9fE5S1hLzpqTsPkiep//gFGPnR3Yl7GL5p/xYFBrTwM+iXio3GqpwDGL5p/xYNIX7XG8Q6IJRgdIzf1KBBgafII7oMidhyQtVFaMA2Bt7il4huQRhaXphbcR2g4RXqBzKAGHiCCwGFVUAj/m/RTRDj29cvn10I0PZ3LghH5f4CL1EFlQmqqXK3jDDKFxmhQ3Yt6oQseUZGKmMnTpsOqc8o1F9kBOMjQlOLeqEeIyOc6JV6jYLJD/+XyIFvnzdgl9aXRQ5I2qZDK1SpospMqaoqON/wZZGDciLnMMiXRS7IF4hhqMTNTdk7CFu+LHLhR7BQqBvPDJUUQqCGvCMATHUgBmhWNgApmdOda9YpM+VwRYfuyyIXDK8hBlilNerLIheMZCKGwlUAyru6GlwOgPUbRxADdJ9FAChxXY864viyyEXqPxhc0M2TAfAbatSdRyHtXymhByEdRnE3ky+JnHAIhSA0h74kckETmHoQbSgGwJrCIRMEPSRIBCRIMAhZaYhaggQhJXUJEoRU9mofKwh+F22dLRRfEjlJM7w6KQwCoQpBOKTyJZETjmwRxKqtGV8SOSkNOGjKPQppBEgDDkFgpxdBVGkFgaYQQXRIFQSObk0P5ZFIpAZRHXsQ0r0hCluBWKkuvVbYCkQaCdL5ehBScudJP4yY+rLISdps1NBDEJKXMMmoSfggWC4ZQRR17oFYXph7hSiquIKQ+hJGTX1J5MYSPD/GVdNzsgLBwZVCVyAQAkF0ohiI/c1fS6tNXq9UfEnkhudmIQolsS+J3Hh/UtNDzQLhj42VKJFInqLwFYiUU5ToA+HdfI0JevUpQUAIn+vSz2lHIuUV/dJOIHhOY/IWVWGBIHQtzs88s9zyWBuTgcBLzGOmeNnfF/QslSDgMeQW85i3DOQxuipxAkCyZ8SIm4Omp+7MMlCB59j6sKZcMoM4iIEoeI2J9AKxrFobZx0v4vYInuHFS4J1GQRCAGaLEYQXfyMML5XSQgghhBBCCCH+cXp6vgNhKpSKX/XdOAAAAABJRU5ErkJggg=="; + imgBack.style.position = "absolute"; + imgBack.style.left = "50%"; + imgBack.style.top = "50%"; + imgBack.style.marginLeft = "-50px"; + imgBack.style.marginTop = "-50px"; + imgBack.style.transition = "transform 1.0s ease"; + imgBack.style.webkitTransition = "-webkit-transform 1.0s ease"; + var deg = 360; + var onTransitionEnd = function () { + deg += 360; + imgBack.style.transform = "rotateZ(" + deg + "deg)"; + imgBack.style.webkitTransform = "rotateZ(" + deg + "deg)"; + }; + imgBack.addEventListener("transitionend", onTransitionEnd); + imgBack.addEventListener("webkitTransitionEnd", onTransitionEnd); + this._loadingDiv.appendChild(imgBack); + // front image + var imgFront = new Image(); + imgFront.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuM4zml1AAAAYJSURBVHhe7Zy/qx1FFMff/2Av2Nvbi4WFiiAEY/OQ2IgQsbCJQoqkCAgpFLXyoZURLfwBIiIpgqZJoYQYlWelNsIrNOxDJcrzfHe+G97dnTl75u7euzv7zgcWHrlnZmfOmXPmzI/NjuM4juM4juM4juM4juM4juM4juM4juM45fPic08/uHf5/CvffH7lnT8PfrtxdHS0n3p+/fHGl5+89/prr5599iEWd8bg0rkXHoFyqehKnlxQpjYSDHTm9JMPsGrHylOPPXofvICKXMcIGtXdf/76AYbm6xyNW9e/eAtKC7rbKLXnvHHx5Sf4auc4Ek7OQkFU1Dap/vv37k/wSjblZANFiFIGzw98hhizwqBgs04mCBdQRNCHidoAEtY+lLIvtSdoGFeyql2ZH57HBH4sE7O+o/r9l+8/ZXUni68+2jsHBQQ9qNRGeP/tSxdSYQX/roUcpL4/f3vtM9TD+jTq92n1LQ7jxF1hhGPtwWL3gGccy8JuS1r8sVWBGXNVdSKMYjBGPUJjCzooiGuSpnwlnnOGP2dhHRSLNgpHp2oMKIriK8TmG4Qh/rwW8D6pps9b9im+LDDipXOqMVJrAngBfg9i98gevWKA+/nnCod3Dr5GfaHaDgidVym6HKRjGIkpqthcAVKGxNqBImbEo66kjCih8AOpNmkUmbMuUrR8kEqiU6FvHZLGAPJ71JCYSyhiBqmwFE2GoD6jLGIfDHtG6EzoU4dK21PCqIRMEF0FGRjFzGDtIkXVAdATvsqfT9CJ0JcOFdYiFIsiMlqYy1YOFpQo2OddqBtyEaq9y+efoVh5oPHoROjLKn0j3JIE5Ka8UqZRtGrMnneX6yVofOhDh94MSbznTcpqmDOt1vyQzOgaJAF4F3JBfIXesrNEGWWmjIX7UBZ6jRJbBMLg/DmJiKUGVHleIpnVNTa+jakzkAviJqLhi4MC9XQGBrZeKJZESSrKy7ik0VGFWhQBRDTHIACKQ5l9nAjy75gya4a2w+Jhs0FJdc0xX/GwUbAqFBkZi7QpJ2w16WUbjFyK9MJF3KaoEM74KhVtLrQOrsmRxkbdHEqmSC/c+EuGnIFkjW7Ih2Kr4CCMIvNG2hrrgLpCjiFloooYCjyYrzCRyvhyBthkIPuQtsZGdnbMTezyDiU71KTC5zr7aVsHbsz2tllrEkS5UHwU1tq1HbtPW4UbeB0O7xx8R5EsMJql+BheUmHjkNVmIRP7LutoM3+D4O4tG7vCkNO9ESZ4lL3J6rKRMPx4qKbD/A0icf8CG7tC7kTahnMTwleuYSrsS7GatRAvfZh1tTm5BmmQCdZ8a0Sefe28xUrRBkmFLKy8KTIKUDRX0Y1xagPgwbaIdeFnQULmKak3xvwNMkVGgok/N5XNoehJvejRlCDl9escI28dJU0tZ++nBTJE9mEF647x5Ehbo4s5hDOKFIU0PdofeA5F5k1q63zIWmQqNI/P3ZubjFTqKxQ3jyjHAOX0RdlgVO9hzRFpczRcjZ3Gbxxpc7Qj6+5pTYF2OFXawNI+yDGf1k2NcvOlzBQeDQ/t7zD7DsEDpJ2xATXaNtDWUS4IzP4DS2ljajAVu57SUkYw245ptxZxA5JiZaJ0DswudGn3kYUy54426EjoT4dZfYbccxC2nI92cDkZHQr96jD4AGkMDKeSy/COBsRe6VTSKFN6irLeaCh3IteQjt1E5+oudsG/b/2DfZ5AqsYo8vMDK9LB1HzSsLWvlGThdxXvC6+NsqyPPWP0pMINtbdsajfVeC6f/GZ+cdAofQoB1d+Hf9waY98I7+RXWab3Lt4zYkjHtTnlOLXHYMsCh1zWeQYehu1zfNPOOiys/d91LAKEBSgh6MJMbSA82AaHofDgAIwbgvVvlLNS11nModMm4UZergLHZBZrodmBuA3lBB1thdorSjkOmATMDwg/UBQVtglqQyx6fbEJ+H3IWIapjYAjAfeIgeCMHldueJvFaqDaAHhwf8qNsEEQ1iQbOoUUGIbCLRc8+Bvfp4jyd2FEijuO4ziO4ziO4ziO4ziO4ziO4ziO4ziOUzw7O/8D0P7rcZ/GEboAAAAASUVORK5CYII="; + imgFront.style.position = "absolute"; + imgFront.style.left = "50%"; + imgFront.style.top = "50%"; + imgFront.style.marginLeft = "-50px"; + imgFront.style.marginTop = "-50px"; + this._loadingDiv.appendChild(imgFront); + this._resizeLoadingUI(); + window.addEventListener("resize", this._resizeLoadingUI); + this._loadingDiv.style.backgroundColor = this._loadingDivBackgroundColor; + document.body.appendChild(this._loadingDiv); + setTimeout(function () { + _this._loadingDiv.style.opacity = "1"; + imgBack.style.transform = "rotateZ(360deg)"; + imgBack.style.webkitTransform = "rotateZ(360deg)"; + }, 0); + }; + DefaultLoadingScreen.prototype.hideLoadingUI = function () { + var _this = this; + if (!this._loadingDiv) { + return; + } + var onTransitionEnd = function () { + if (!_this._loadingDiv) { + return; + } + document.body.removeChild(_this._loadingDiv); + window.removeEventListener("resize", _this._resizeLoadingUI); + _this._loadingDiv = null; + }; + this._loadingDiv.style.opacity = "0"; + this._loadingDiv.addEventListener("transitionend", onTransitionEnd); + }; + Object.defineProperty(DefaultLoadingScreen.prototype, "loadingUIText", { + set: function (text) { + this._loadingText = text; + if (this._loadingTextDiv) { + this._loadingTextDiv.innerHTML = this._loadingText; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DefaultLoadingScreen.prototype, "loadingUIBackgroundColor", { + get: function () { + return this._loadingDivBackgroundColor; + }, + set: function (color) { + this._loadingDivBackgroundColor = color; + if (!this._loadingDiv) { + return; + } + this._loadingDiv.style.backgroundColor = this._loadingDivBackgroundColor; + }, + enumerable: true, + configurable: true + }); + return DefaultLoadingScreen; + }()); + BABYLON.DefaultLoadingScreen = DefaultLoadingScreen; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.loadingScreen.js.map + +var BABYLON; +(function (BABYLON) { + var AudioEngine = (function () { + function AudioEngine() { + this._audioContext = null; + this._audioContextInitialized = false; + this.canUseWebAudio = false; + this.WarnedWebAudioUnsupported = false; + this.unlocked = false; + this.isMP3supported = false; + this.isOGGsupported = false; + if (typeof window.AudioContext !== 'undefined' || typeof window.webkitAudioContext !== 'undefined') { + window.AudioContext = window.AudioContext || window.webkitAudioContext; + this.canUseWebAudio = true; + } + var audioElem = document.createElement('audio'); + if (audioElem && !!audioElem.canPlayType && audioElem.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/, '')) { + this.isMP3supported = true; + } + if (audioElem && !!audioElem.canPlayType && audioElem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, '')) { + this.isOGGsupported = true; + } + if (/iPad|iPhone|iPod/.test(navigator.platform)) { + this._unlockiOSaudio(); + } + else { + this.unlocked = true; + } + } + Object.defineProperty(AudioEngine.prototype, "audioContext", { + get: function () { + if (!this._audioContextInitialized) { + this._initializeAudioContext(); + } + return this._audioContext; + }, + enumerable: true, + configurable: true + }); + AudioEngine.prototype._unlockiOSaudio = function () { + var _this = this; + var unlockaudio = function () { + var buffer = _this.audioContext.createBuffer(1, 1, 22050); + var source = _this.audioContext.createBufferSource(); + source.buffer = buffer; + source.connect(_this.audioContext.destination); + source.start(0); + setTimeout(function () { + if ((source.playbackState === source.PLAYING_STATE || source.playbackState === source.FINISHED_STATE)) { + _this.unlocked = true; + window.removeEventListener('touchend', unlockaudio, false); + if (_this.onAudioUnlocked) { + _this.onAudioUnlocked(); + } + } + }, 0); + }; + window.addEventListener('touchend', unlockaudio, false); + }; + AudioEngine.prototype._initializeAudioContext = function () { + try { + if (this.canUseWebAudio) { + this._audioContext = new AudioContext(); + // create a global volume gain node + this.masterGain = this._audioContext.createGain(); + this.masterGain.gain.value = 1; + this.masterGain.connect(this._audioContext.destination); + this._audioContextInitialized = true; + } + } + catch (e) { + this.canUseWebAudio = false; + BABYLON.Tools.Error("Web Audio: " + e.message); + } + }; + AudioEngine.prototype.dispose = function () { + if (this.canUseWebAudio && this._audioContextInitialized) { + if (this._connectedAnalyser) { + this._connectedAnalyser.stopDebugCanvas(); + this._connectedAnalyser.dispose(); + this.masterGain.disconnect(); + this.masterGain.connect(this._audioContext.destination); + this._connectedAnalyser = null; + } + this.masterGain.gain.value = 1; + } + this.WarnedWebAudioUnsupported = false; + }; + AudioEngine.prototype.getGlobalVolume = function () { + if (this.canUseWebAudio && this._audioContextInitialized) { + return this.masterGain.gain.value; + } + else { + return -1; + } + }; + AudioEngine.prototype.setGlobalVolume = function (newVolume) { + if (this.canUseWebAudio && this._audioContextInitialized) { + this.masterGain.gain.value = newVolume; + } + }; + AudioEngine.prototype.connectToAnalyser = function (analyser) { + if (this._connectedAnalyser) { + this._connectedAnalyser.stopDebugCanvas(); + } + if (this.canUseWebAudio && this._audioContextInitialized) { + this._connectedAnalyser = analyser; + this.masterGain.disconnect(); + this._connectedAnalyser.connectAudioNodes(this.masterGain, this._audioContext.destination); + } + }; + return AudioEngine; + }()); + BABYLON.AudioEngine = AudioEngine; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.audioEngine.js.map + +var BABYLON; +(function (BABYLON) { + var Sound = (function () { + /** + * Create a sound and attach it to a scene + * @param name Name of your sound + * @param urlOrArrayBuffer Url to the sound to load async or ArrayBuffer + * @param readyToPlayCallback Provide a callback function if you'd like to load your code once the sound is ready to be played + * @param options Objects to provide with the current available options: autoplay, loop, volume, spatialSound, maxDistance, rolloffFactor, refDistance, distanceModel, panningModel, streaming + */ + function Sound(name, urlOrArrayBuffer, scene, readyToPlayCallback, options) { + var _this = this; + this.autoplay = false; + this.loop = false; + this.useCustomAttenuation = false; + this.spatialSound = false; + this.refDistance = 1; + this.rolloffFactor = 1; + this.maxDistance = 100; + this.distanceModel = "linear"; + this._panningModel = "equalpower"; + this._playbackRate = 1; + this._streaming = false; + this._startTime = 0; + this._startOffset = 0; + this._position = BABYLON.Vector3.Zero(); + this._localDirection = new BABYLON.Vector3(1, 0, 0); + this._volume = 1; + this._isLoaded = false; + this._isReadyToPlay = false; + this.isPlaying = false; + this.isPaused = false; + this._isDirectional = false; + // Used if you'd like to create a directional sound. + // If not set, the sound will be omnidirectional + this._coneInnerAngle = 360; + this._coneOuterAngle = 360; + this._coneOuterGain = 0; + this._isOutputConnected = false; + this._urlType = "Unknown"; + this.name = name; + this._scene = scene; + this._readyToPlayCallback = readyToPlayCallback; + // Default custom attenuation function is a linear attenuation + this._customAttenuationFunction = function (currentVolume, currentDistance, maxDistance, refDistance, rolloffFactor) { + if (currentDistance < maxDistance) { + return currentVolume * (1 - currentDistance / maxDistance); + } + else { + return 0; + } + }; + if (options) { + this.autoplay = options.autoplay || false; + this.loop = options.loop || false; + // if volume === 0, we need another way to check this option + if (options.volume !== undefined) { + this._volume = options.volume; + } + this.spatialSound = options.spatialSound || false; + this.maxDistance = options.maxDistance || 100; + this.useCustomAttenuation = options.useCustomAttenuation || false; + this.rolloffFactor = options.rolloffFactor || 1; + this.refDistance = options.refDistance || 1; + this.distanceModel = options.distanceModel || "linear"; + this._playbackRate = options.playbackRate || 1; + this._streaming = options.streaming || false; + } + if (BABYLON.Engine.audioEngine.canUseWebAudio) { + this._soundGain = BABYLON.Engine.audioEngine.audioContext.createGain(); + this._soundGain.gain.value = this._volume; + this._inputAudioNode = this._soundGain; + this._ouputAudioNode = this._soundGain; + if (this.spatialSound) { + this._createSpatialParameters(); + } + this._scene.mainSoundTrack.AddSound(this); + var validParameter = true; + // if no parameter is passed, you need to call setAudioBuffer yourself to prepare the sound + if (urlOrArrayBuffer) { + if (typeof (urlOrArrayBuffer) === "string") + this._urlType = "String"; + if (Array.isArray(urlOrArrayBuffer)) + this._urlType = "Array"; + if (urlOrArrayBuffer instanceof ArrayBuffer) + this._urlType = "ArrayBuffer"; + var urls = []; + var codecSupportedFound = false; + switch (this._urlType) { + case "ArrayBuffer": + if (urlOrArrayBuffer.byteLength > 0) { + codecSupportedFound = true; + this._soundLoaded(urlOrArrayBuffer); + } + break; + case "String": + urls.push(urlOrArrayBuffer); + case "Array": + if (urls.length === 0) + urls = urlOrArrayBuffer; + // If we found a supported format, we load it immediately and stop the loop + for (var i = 0; i < urls.length; i++) { + var url = urls[i]; + if (url.indexOf(".mp3", url.length - 4) !== -1 && BABYLON.Engine.audioEngine.isMP3supported) { + codecSupportedFound = true; + } + if (url.indexOf(".ogg", url.length - 4) !== -1 && BABYLON.Engine.audioEngine.isOGGsupported) { + codecSupportedFound = true; + } + if (url.indexOf(".wav", url.length - 4) !== -1) { + codecSupportedFound = true; + } + if (codecSupportedFound) { + // Loading sound using XHR2 + if (!this._streaming) { + BABYLON.Tools.LoadFile(url, function (data) { _this._soundLoaded(data); }, null, this._scene.database, true); + } + else { + this._htmlAudioElement = new Audio(url); + this._htmlAudioElement.controls = false; + this._htmlAudioElement.loop = this.loop; + this._htmlAudioElement.crossOrigin = "anonymous"; + this._htmlAudioElement.preload = "auto"; + this._htmlAudioElement.addEventListener("canplaythrough", function () { + _this._isReadyToPlay = true; + if (_this.autoplay) { + _this.play(); + } + if (_this._readyToPlayCallback) { + _this._readyToPlayCallback(); + } + }); + document.body.appendChild(this._htmlAudioElement); + } + break; + } + } + break; + default: + validParameter = false; + break; + } + if (!validParameter) { + BABYLON.Tools.Error("Parameter must be a URL to the sound, an Array of URLs (.mp3 & .ogg) or an ArrayBuffer of the sound."); + } + else { + if (!codecSupportedFound) { + this._isReadyToPlay = true; + // Simulating a ready to play event to avoid breaking code path + if (this._readyToPlayCallback) { + window.setTimeout(function () { + _this._readyToPlayCallback(); + }, 1000); + } + } + } + } + } + else { + // Adding an empty sound to avoid breaking audio calls for non Web Audio browsers + this._scene.mainSoundTrack.AddSound(this); + if (!BABYLON.Engine.audioEngine.WarnedWebAudioUnsupported) { + BABYLON.Tools.Error("Web Audio is not supported by your browser."); + BABYLON.Engine.audioEngine.WarnedWebAudioUnsupported = true; + } + // Simulating a ready to play event to avoid breaking code for non web audio browsers + if (this._readyToPlayCallback) { + window.setTimeout(function () { + _this._readyToPlayCallback(); + }, 1000); + } + } + } + Sound.prototype.dispose = function () { + if (BABYLON.Engine.audioEngine.canUseWebAudio && this._isReadyToPlay) { + if (this.isPlaying) { + this.stop(); + } + this._isReadyToPlay = false; + if (this.soundTrackId === -1) { + this._scene.mainSoundTrack.RemoveSound(this); + } + else { + this._scene.soundTracks[this.soundTrackId].RemoveSound(this); + } + if (this._soundGain) { + this._soundGain.disconnect(); + this._soundGain = null; + } + if (this._soundPanner) { + this._soundPanner.disconnect(); + this._soundPanner = null; + } + if (this._soundSource) { + this._soundSource.disconnect(); + this._soundSource = null; + } + this._audioBuffer = null; + if (this._htmlAudioElement) { + this._htmlAudioElement.pause(); + this._htmlAudioElement.src = ""; + document.body.removeChild(this._htmlAudioElement); + } + if (this._connectedMesh) { + this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc); + this._connectedMesh = null; + } + } + }; + Sound.prototype._soundLoaded = function (audioData) { + var _this = this; + this._isLoaded = true; + BABYLON.Engine.audioEngine.audioContext.decodeAudioData(audioData, function (buffer) { + _this._audioBuffer = buffer; + _this._isReadyToPlay = true; + if (_this.autoplay) { + _this.play(); + } + if (_this._readyToPlayCallback) { + _this._readyToPlayCallback(); + } + }, function (err) { BABYLON.Tools.Error("Error while decoding audio data for: " + _this.name + " / Error: " + err); }); + }; + Sound.prototype.setAudioBuffer = function (audioBuffer) { + if (BABYLON.Engine.audioEngine.canUseWebAudio) { + this._audioBuffer = audioBuffer; + this._isReadyToPlay = true; + } + }; + Sound.prototype.updateOptions = function (options) { + if (options) { + this.loop = options.loop || this.loop; + this.maxDistance = options.maxDistance || this.maxDistance; + this.useCustomAttenuation = options.useCustomAttenuation || this.useCustomAttenuation; + this.rolloffFactor = options.rolloffFactor || this.rolloffFactor; + this.refDistance = options.refDistance || this.refDistance; + this.distanceModel = options.distanceModel || this.distanceModel; + this._playbackRate = options.playbackRate || this._playbackRate; + this._updateSpatialParameters(); + if (this.isPlaying) { + if (this._streaming) { + this._htmlAudioElement.playbackRate = this._playbackRate; + } + else { + this._soundSource.playbackRate.value = this._playbackRate; + } + } + } + }; + Sound.prototype._createSpatialParameters = function () { + if (BABYLON.Engine.audioEngine.canUseWebAudio) { + if (this._scene.headphone) { + this._panningModel = "HRTF"; + } + this._soundPanner = BABYLON.Engine.audioEngine.audioContext.createPanner(); + this._updateSpatialParameters(); + this._soundPanner.connect(this._ouputAudioNode); + this._inputAudioNode = this._soundPanner; + } + }; + Sound.prototype._updateSpatialParameters = function () { + if (this.spatialSound) { + if (this.useCustomAttenuation) { + // Tricks to disable in a way embedded Web Audio attenuation + this._soundPanner.distanceModel = "linear"; + this._soundPanner.maxDistance = Number.MAX_VALUE; + this._soundPanner.refDistance = 1; + this._soundPanner.rolloffFactor = 1; + this._soundPanner.panningModel = this._panningModel; + } + else { + this._soundPanner.distanceModel = this.distanceModel; + this._soundPanner.maxDistance = this.maxDistance; + this._soundPanner.refDistance = this.refDistance; + this._soundPanner.rolloffFactor = this.rolloffFactor; + this._soundPanner.panningModel = this._panningModel; + } + } + }; + Sound.prototype.switchPanningModelToHRTF = function () { + this._panningModel = "HRTF"; + this._switchPanningModel(); + }; + Sound.prototype.switchPanningModelToEqualPower = function () { + this._panningModel = "equalpower"; + this._switchPanningModel(); + }; + Sound.prototype._switchPanningModel = function () { + if (BABYLON.Engine.audioEngine.canUseWebAudio && this.spatialSound) { + this._soundPanner.panningModel = this._panningModel; + } + }; + Sound.prototype.connectToSoundTrackAudioNode = function (soundTrackAudioNode) { + if (BABYLON.Engine.audioEngine.canUseWebAudio) { + if (this._isOutputConnected) { + this._ouputAudioNode.disconnect(); + } + this._ouputAudioNode.connect(soundTrackAudioNode); + this._isOutputConnected = true; + } + }; + /** + * Transform this sound into a directional source + * @param coneInnerAngle Size of the inner cone in degree + * @param coneOuterAngle Size of the outer cone in degree + * @param coneOuterGain Volume of the sound outside the outer cone (between 0.0 and 1.0) + */ + Sound.prototype.setDirectionalCone = function (coneInnerAngle, coneOuterAngle, coneOuterGain) { + if (coneOuterAngle < coneInnerAngle) { + BABYLON.Tools.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle."); + return; + } + this._coneInnerAngle = coneInnerAngle; + this._coneOuterAngle = coneOuterAngle; + this._coneOuterGain = coneOuterGain; + this._isDirectional = true; + if (this.isPlaying && this.loop) { + this.stop(); + this.play(); + } + }; + Sound.prototype.setPosition = function (newPosition) { + this._position = newPosition; + if (BABYLON.Engine.audioEngine.canUseWebAudio && this.spatialSound) { + this._soundPanner.setPosition(this._position.x, this._position.y, this._position.z); + } + }; + Sound.prototype.setLocalDirectionToMesh = function (newLocalDirection) { + this._localDirection = newLocalDirection; + if (BABYLON.Engine.audioEngine.canUseWebAudio && this._connectedMesh && this.isPlaying) { + this._updateDirection(); + } + }; + Sound.prototype._updateDirection = function () { + var mat = this._connectedMesh.getWorldMatrix(); + var direction = BABYLON.Vector3.TransformNormal(this._localDirection, mat); + direction.normalize(); + this._soundPanner.setOrientation(direction.x, direction.y, direction.z); + }; + Sound.prototype.updateDistanceFromListener = function () { + if (BABYLON.Engine.audioEngine.canUseWebAudio && this._connectedMesh && this.useCustomAttenuation) { + var distance = this._connectedMesh.getDistanceToCamera(this._scene.activeCamera); + this._soundGain.gain.value = this._customAttenuationFunction(this._volume, distance, this.maxDistance, this.refDistance, this.rolloffFactor); + } + }; + Sound.prototype.setAttenuationFunction = function (callback) { + this._customAttenuationFunction = callback; + }; + /** + * Play the sound + * @param time (optional) Start the sound after X seconds. Start immediately (0) by default. + * @param offset (optional) Start the sound setting it at a specific time + */ + Sound.prototype.play = function (time, offset) { + var _this = this; + if (this._isReadyToPlay && this._scene.audioEnabled) { + try { + if (this._startOffset < 0) { + time = -this._startOffset; + this._startOffset = 0; + } + var startTime = time ? BABYLON.Engine.audioEngine.audioContext.currentTime + time : BABYLON.Engine.audioEngine.audioContext.currentTime; + if (!this._soundSource || !this._streamingSource) { + if (this.spatialSound) { + this._soundPanner.setPosition(this._position.x, this._position.y, this._position.z); + if (this._isDirectional) { + this._soundPanner.coneInnerAngle = this._coneInnerAngle; + this._soundPanner.coneOuterAngle = this._coneOuterAngle; + this._soundPanner.coneOuterGain = this._coneOuterGain; + if (this._connectedMesh) { + this._updateDirection(); + } + else { + this._soundPanner.setOrientation(this._localDirection.x, this._localDirection.y, this._localDirection.z); + } + } + } + } + if (this._streaming) { + if (!this._streamingSource) { + this._streamingSource = BABYLON.Engine.audioEngine.audioContext.createMediaElementSource(this._htmlAudioElement); + this._htmlAudioElement.onended = function () { _this._onended(); }; + this._htmlAudioElement.playbackRate = this._playbackRate; + } + this._streamingSource.disconnect(); + this._streamingSource.connect(this._inputAudioNode); + this._htmlAudioElement.play(); + } + else { + this._soundSource = BABYLON.Engine.audioEngine.audioContext.createBufferSource(); + this._soundSource.buffer = this._audioBuffer; + this._soundSource.connect(this._inputAudioNode); + this._soundSource.loop = this.loop; + this._soundSource.playbackRate.value = this._playbackRate; + this._soundSource.onended = function () { _this._onended(); }; + this._soundSource.start(startTime, this.isPaused ? this._startOffset % this._soundSource.buffer.duration : offset ? offset : 0); + } + this._startTime = startTime; + this.isPlaying = true; + this.isPaused = false; + } + catch (ex) { + BABYLON.Tools.Error("Error while trying to play audio: " + this.name + ", " + ex.message); + } + } + }; + Sound.prototype._onended = function () { + this.isPlaying = false; + if (this.onended) { + this.onended(); + } + }; + /** + * Stop the sound + * @param time (optional) Stop the sound after X seconds. Stop immediately (0) by default. + */ + Sound.prototype.stop = function (time) { + if (this.isPlaying) { + if (this._streaming) { + this._htmlAudioElement.pause(); + // Test needed for Firefox or it will generate an Invalid State Error + if (this._htmlAudioElement.currentTime > 0) { + this._htmlAudioElement.currentTime = 0; + } + } + else { + var stopTime = time ? BABYLON.Engine.audioEngine.audioContext.currentTime + time : BABYLON.Engine.audioEngine.audioContext.currentTime; + this._soundSource.stop(stopTime); + this._soundSource.onended = null; + if (!this.isPaused) { + this._startOffset = 0; + } + } + this.isPlaying = false; + } + }; + Sound.prototype.pause = function () { + if (this.isPlaying) { + this.isPaused = true; + if (this._streaming) { + this._htmlAudioElement.pause(); + } + else { + this.stop(0); + this._startOffset += BABYLON.Engine.audioEngine.audioContext.currentTime - this._startTime; + } + } + }; + Sound.prototype.setVolume = function (newVolume, time) { + if (BABYLON.Engine.audioEngine.canUseWebAudio) { + if (time) { + this._soundGain.gain.cancelScheduledValues(BABYLON.Engine.audioEngine.audioContext.currentTime); + this._soundGain.gain.setValueAtTime(this._soundGain.gain.value, BABYLON.Engine.audioEngine.audioContext.currentTime); + this._soundGain.gain.linearRampToValueAtTime(newVolume, BABYLON.Engine.audioEngine.audioContext.currentTime + time); + } + else { + this._soundGain.gain.value = newVolume; + } + } + this._volume = newVolume; + }; + Sound.prototype.setPlaybackRate = function (newPlaybackRate) { + this._playbackRate = newPlaybackRate; + if (this.isPlaying) { + if (this._streaming) { + this._htmlAudioElement.playbackRate = this._playbackRate; + } + else { + this._soundSource.playbackRate.value = this._playbackRate; + } + } + }; + Sound.prototype.getVolume = function () { + return this._volume; + }; + Sound.prototype.attachToMesh = function (meshToConnectTo) { + var _this = this; + if (this._connectedMesh) { + this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc); + this._registerFunc = null; + } + this._connectedMesh = meshToConnectTo; + if (!this.spatialSound) { + this.spatialSound = true; + this._createSpatialParameters(); + if (this.isPlaying && this.loop) { + this.stop(); + this.play(); + } + } + this._onRegisterAfterWorldMatrixUpdate(this._connectedMesh); + this._registerFunc = function (connectedMesh) { return _this._onRegisterAfterWorldMatrixUpdate(connectedMesh); }; + meshToConnectTo.registerAfterWorldMatrixUpdate(this._registerFunc); + }; + Sound.prototype.detachFromMesh = function () { + if (this._connectedMesh) { + this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc); + this._registerFunc = null; + this._connectedMesh = null; + } + }; + Sound.prototype._onRegisterAfterWorldMatrixUpdate = function (connectedMesh) { + this.setPosition(connectedMesh.getBoundingInfo().boundingSphere.centerWorld); + if (BABYLON.Engine.audioEngine.canUseWebAudio && this._isDirectional && this.isPlaying) { + this._updateDirection(); + } + }; + Sound.prototype.clone = function () { + var _this = this; + if (!this._streaming) { + var setBufferAndRun = function () { + if (_this._isReadyToPlay) { + clonedSound._audioBuffer = _this.getAudioBuffer(); + clonedSound._isReadyToPlay = true; + if (clonedSound.autoplay) { + clonedSound.play(); + } + } + else { + window.setTimeout(setBufferAndRun, 300); + } + }; + var currentOptions = { + autoplay: this.autoplay, loop: this.loop, + volume: this._volume, spatialSound: this.spatialSound, maxDistance: this.maxDistance, + useCustomAttenuation: this.useCustomAttenuation, rolloffFactor: this.rolloffFactor, + refDistance: this.refDistance, distanceModel: this.distanceModel + }; + var clonedSound = new Sound(this.name + "_cloned", new ArrayBuffer(0), this._scene, null, currentOptions); + if (this.useCustomAttenuation) { + clonedSound.setAttenuationFunction(this._customAttenuationFunction); + } + clonedSound.setPosition(this._position); + clonedSound.setPlaybackRate(this._playbackRate); + setBufferAndRun(); + return clonedSound; + } + else { + return null; + } + }; + Sound.prototype.getAudioBuffer = function () { + return this._audioBuffer; + }; + Sound.prototype.serialize = function () { + var serializationObject = { + name: this.name, + url: this.name, + autoplay: this.autoplay, + loop: this.loop, + volume: this._volume, + spatialSound: this.spatialSound, + maxDistance: this.maxDistance, + rolloffFactor: this.rolloffFactor, + refDistance: this.refDistance, + distanceModel: this.distanceModel, + playbackRate: this._playbackRate, + panningModel: this._panningModel, + soundTrackId: this.soundTrackId + }; + if (this.spatialSound) { + if (this._connectedMesh) + serializationObject.connectedMeshId = this._connectedMesh.id; + serializationObject.position = this._position.asArray(); + serializationObject.refDistance = this.refDistance; + serializationObject.distanceModel = this.distanceModel; + serializationObject.isDirectional = this._isDirectional; + serializationObject.localDirectionToMesh = this._localDirection.asArray(); + serializationObject.coneInnerAngle = this._coneInnerAngle; + serializationObject.coneOuterAngle = this._coneOuterAngle; + serializationObject.coneOuterGain = this._coneOuterGain; + } + return serializationObject; + }; + Sound.Parse = function (parsedSound, scene, rootUrl, sourceSound) { + var soundName = parsedSound.name; + var soundUrl; + if (parsedSound.url) { + soundUrl = rootUrl + parsedSound.url; + } + else { + soundUrl = rootUrl + soundName; + } + var options = { + autoplay: parsedSound.autoplay, loop: parsedSound.loop, volume: parsedSound.volume, + spatialSound: parsedSound.spatialSound, maxDistance: parsedSound.maxDistance, + rolloffFactor: parsedSound.rolloffFactor, + refDistance: parsedSound.refDistance, + distanceModel: parsedSound.distanceModel, + playbackRate: parsedSound.playbackRate + }; + var newSound; + if (!sourceSound) { + newSound = new Sound(soundName, soundUrl, scene, function () { scene._removePendingData(newSound); }, options); + scene._addPendingData(newSound); + } + else { + var setBufferAndRun = function () { + if (sourceSound._isReadyToPlay) { + newSound._audioBuffer = sourceSound.getAudioBuffer(); + newSound._isReadyToPlay = true; + if (newSound.autoplay) { + newSound.play(); + } + } + else { + window.setTimeout(setBufferAndRun, 300); + } + }; + newSound = new Sound(soundName, new ArrayBuffer(0), scene, null, options); + setBufferAndRun(); + } + if (parsedSound.position) { + var soundPosition = BABYLON.Vector3.FromArray(parsedSound.position); + newSound.setPosition(soundPosition); + } + if (parsedSound.isDirectional) { + newSound.setDirectionalCone(parsedSound.coneInnerAngle || 360, parsedSound.coneOuterAngle || 360, parsedSound.coneOuterGain || 0); + if (parsedSound.localDirectionToMesh) { + var localDirectionToMesh = BABYLON.Vector3.FromArray(parsedSound.localDirectionToMesh); + newSound.setLocalDirectionToMesh(localDirectionToMesh); + } + } + if (parsedSound.connectedMeshId) { + var connectedMesh = scene.getMeshByID(parsedSound.connectedMeshId); + if (connectedMesh) { + newSound.attachToMesh(connectedMesh); + } + } + return newSound; + }; + return Sound; + }()); + BABYLON.Sound = Sound; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.sound.js.map + +var BABYLON; +(function (BABYLON) { + var SoundTrack = (function () { + function SoundTrack(scene, options) { + this.id = -1; + this._isMainTrack = false; + this._isInitialized = false; + this._scene = scene; + this.soundCollection = new Array(); + this._options = options; + if (!this._isMainTrack) { + this._scene.soundTracks.push(this); + this.id = this._scene.soundTracks.length - 1; + } + } + SoundTrack.prototype._initializeSoundTrackAudioGraph = function () { + if (BABYLON.Engine.audioEngine.canUseWebAudio) { + this._outputAudioNode = BABYLON.Engine.audioEngine.audioContext.createGain(); + this._outputAudioNode.connect(BABYLON.Engine.audioEngine.masterGain); + if (this._options) { + if (this._options.volume) { + this._outputAudioNode.gain.value = this._options.volume; + } + if (this._options.mainTrack) { + this._isMainTrack = this._options.mainTrack; + } + } + this._isInitialized = true; + } + }; + SoundTrack.prototype.dispose = function () { + if (BABYLON.Engine.audioEngine.canUseWebAudio) { + if (this._connectedAnalyser) { + this._connectedAnalyser.stopDebugCanvas(); + } + while (this.soundCollection.length) { + this.soundCollection[0].dispose(); + } + if (this._outputAudioNode) { + this._outputAudioNode.disconnect(); + } + this._outputAudioNode = null; + } + }; + SoundTrack.prototype.AddSound = function (sound) { + if (!this._isInitialized) { + this._initializeSoundTrackAudioGraph(); + } + if (BABYLON.Engine.audioEngine.canUseWebAudio) { + sound.connectToSoundTrackAudioNode(this._outputAudioNode); + } + if (sound.soundTrackId) { + if (sound.soundTrackId === -1) { + this._scene.mainSoundTrack.RemoveSound(sound); + } + else { + this._scene.soundTracks[sound.soundTrackId].RemoveSound(sound); + } + } + this.soundCollection.push(sound); + sound.soundTrackId = this.id; + }; + SoundTrack.prototype.RemoveSound = function (sound) { + var index = this.soundCollection.indexOf(sound); + if (index !== -1) { + this.soundCollection.splice(index, 1); + } + }; + SoundTrack.prototype.setVolume = function (newVolume) { + if (BABYLON.Engine.audioEngine.canUseWebAudio) { + this._outputAudioNode.gain.value = newVolume; + } + }; + SoundTrack.prototype.switchPanningModelToHRTF = function () { + if (BABYLON.Engine.audioEngine.canUseWebAudio) { + for (var i = 0; i < this.soundCollection.length; i++) { + this.soundCollection[i].switchPanningModelToHRTF(); + } + } + }; + SoundTrack.prototype.switchPanningModelToEqualPower = function () { + if (BABYLON.Engine.audioEngine.canUseWebAudio) { + for (var i = 0; i < this.soundCollection.length; i++) { + this.soundCollection[i].switchPanningModelToEqualPower(); + } + } + }; + SoundTrack.prototype.connectToAnalyser = function (analyser) { + if (this._connectedAnalyser) { + this._connectedAnalyser.stopDebugCanvas(); + } + this._connectedAnalyser = analyser; + if (BABYLON.Engine.audioEngine.canUseWebAudio) { + this._outputAudioNode.disconnect(); + this._connectedAnalyser.connectAudioNodes(this._outputAudioNode, BABYLON.Engine.audioEngine.masterGain); + } + }; + return SoundTrack; + }()); + BABYLON.SoundTrack = SoundTrack; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.soundtrack.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * Special Glow Blur post process only blurring the alpha channel + * It enforces keeping the most luminous color in the color channel. + */ + var GlowBlurPostProcess = (function (_super) { + __extends(GlowBlurPostProcess, _super); + function GlowBlurPostProcess(name, direction, blurWidth, options, camera, samplingMode, engine, reusable) { + var _this = this; + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.BILINEAR_SAMPLINGMODE; } + _super.call(this, name, "glowBlurPostProcess", ["screenSize", "direction", "blurWidth"], null, options, camera, samplingMode, engine, reusable); + this.direction = direction; + this.blurWidth = blurWidth; + this.onApplyObservable.add(function (effect) { + effect.setFloat2("screenSize", _this.width, _this.height); + effect.setVector2("direction", _this.direction); + effect.setFloat("blurWidth", _this.blurWidth); + }); + } + return GlowBlurPostProcess; + }(BABYLON.PostProcess)); + /** + * The highlight layer Helps adding a glow effect around a mesh. + * + * Once instantiated in a scene, simply use the pushMesh or removeMesh method to add or remove + * glowy meshes to your scene. + * + * !!! THIS REQUIRES AN ACTIVE STENCIL BUFFER ON THE CANVAS !!! + */ + var HighlightLayer = (function () { + /** + * Instantiates a new highlight Layer and references it to the scene.. + * @param name The name of the layer + * @param scene The scene to use the layer in + * @param options Sets of none mandatory options to use with the layer (see IHighlightLayerOptions for more information) + */ + function HighlightLayer(name, scene, options) { + this._vertexBuffers = {}; + this._mainTextureDesiredSize = { width: 0, height: 0 }; + this._meshes = {}; + this._maxSize = 0; + this._shouldRender = false; + this._instanceGlowingMeshStencilReference = HighlightLayer.glowingMeshStencilReference++; + this._excludedMeshes = {}; + /** + * Specifies whether or not the inner glow is ACTIVE in the layer. + */ + this.innerGlow = true; + /** + * Specifies whether or not the outer glow is ACTIVE in the layer. + */ + this.outerGlow = true; + /** + * Specifies wether the highlight layer is enabled or not. + */ + this.isEnabled = true; + /** + * An event triggered when the highlight layer has been disposed. + * @type {BABYLON.Observable} + */ + this.onDisposeObservable = new BABYLON.Observable(); + /** + * An event triggered when the highlight layer is about rendering the main texture with the glowy parts. + * @type {BABYLON.Observable} + */ + this.onBeforeRenderMainTextureObservable = new BABYLON.Observable(); + /** + * An event triggered when the highlight layer is being blurred. + * @type {BABYLON.Observable} + */ + this.onBeforeBlurObservable = new BABYLON.Observable(); + /** + * An event triggered when the highlight layer has been blurred. + * @type {BABYLON.Observable} + */ + this.onAfterBlurObservable = new BABYLON.Observable(); + /** + * An event triggered when the glowing blurred texture is being merged in the scene. + * @type {BABYLON.Observable} + */ + this.onBeforeComposeObservable = new BABYLON.Observable(); + /** + * An event triggered when the glowing blurred texture has been merged in the scene. + * @type {BABYLON.Observable} + */ + this.onAfterComposeObservable = new BABYLON.Observable(); + /** + * An event triggered when the highlight layer changes its size. + * @type {BABYLON.Observable} + */ + this.onSizeChangedObservable = new BABYLON.Observable(); + this._scene = scene; + var engine = scene.getEngine(); + this._engine = engine; + this._maxSize = this._engine.getCaps().maxTextureSize; + this._scene.highlightLayers.push(this); + // Warn on stencil. + if (!this._engine.isStencilEnable) { + BABYLON.Tools.Warn("Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new BABYLON.Engine(canvas, antialias, { stencil: true }"); + } + // Adapt options + this._options = options || { + mainTextureRatio: 0.25, + blurTextureSizeRatio: 0.5, + blurHorizontalSize: 1, + blurVerticalSize: 1, + alphaBlendingMode: BABYLON.Engine.ALPHA_COMBINE + }; + this._options.mainTextureRatio = this._options.mainTextureRatio || 0.25; + this._options.blurTextureSizeRatio = this._options.blurTextureSizeRatio || 0.5; + this._options.blurHorizontalSize = this._options.blurHorizontalSize || 1; + this._options.blurVerticalSize = this._options.blurVerticalSize || 1; + this._options.alphaBlendingMode = this._options.alphaBlendingMode || BABYLON.Engine.ALPHA_COMBINE; + // VBO + var vertices = []; + vertices.push(1, 1); + vertices.push(-1, 1); + vertices.push(-1, -1); + vertices.push(1, -1); + var vertexBuffer = new BABYLON.VertexBuffer(engine, vertices, BABYLON.VertexBuffer.PositionKind, false, false, 2); + this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = vertexBuffer; + // Indices + var indices = []; + indices.push(0); + indices.push(1); + indices.push(2); + indices.push(0); + indices.push(2); + indices.push(3); + this._indexBuffer = engine.createIndexBuffer(indices); + // Effect + this._glowMapMergeEffect = engine.createEffect("glowMapMerge", [BABYLON.VertexBuffer.PositionKind], ["offset"], ["textureSampler"], ""); + // Render target + this.setMainTextureSize(); + // Create Textures and post processes + this.createTextureAndPostProcesses(); + } + Object.defineProperty(HighlightLayer.prototype, "blurHorizontalSize", { + /** + * Gets the horizontal size of the blur. + */ + get: function () { + return this._horizontalBlurPostprocess.blurWidth; + }, + /** + * Specifies the horizontal size of the blur. + */ + set: function (value) { + this._horizontalBlurPostprocess.blurWidth = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(HighlightLayer.prototype, "blurVerticalSize", { + /** + * Gets the vertical size of the blur. + */ + get: function () { + return this._verticalBlurPostprocess.blurWidth; + }, + /** + * Specifies the vertical size of the blur. + */ + set: function (value) { + this._verticalBlurPostprocess.blurWidth = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(HighlightLayer.prototype, "camera", { + /** + * Gets the camera attached to the layer. + */ + get: function () { + return this._options.camera; + }, + enumerable: true, + configurable: true + }); + /** + * Creates the render target textures and post processes used in the highlight layer. + */ + HighlightLayer.prototype.createTextureAndPostProcesses = function () { + var _this = this; + var blurTextureWidth = this._mainTextureDesiredSize.width * this._options.blurTextureSizeRatio; + var blurTextureHeight = this._mainTextureDesiredSize.height * this._options.blurTextureSizeRatio; + blurTextureWidth = BABYLON.Tools.GetExponentOfTwo(blurTextureWidth, this._maxSize); + blurTextureHeight = BABYLON.Tools.GetExponentOfTwo(blurTextureHeight, this._maxSize); + this._mainTexture = new BABYLON.RenderTargetTexture("HighlightLayerMainRTT", { + width: this._mainTextureDesiredSize.width, + height: this._mainTextureDesiredSize.height + }, this._scene, false, true, BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT); + this._mainTexture.activeCamera = this._options.camera; + this._mainTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; + this._mainTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; + this._mainTexture.anisotropicFilteringLevel = 1; + this._mainTexture.updateSamplingMode(BABYLON.Texture.BILINEAR_SAMPLINGMODE); + this._mainTexture.renderParticles = false; + this._mainTexture.renderList = null; + this._blurTexture = new BABYLON.RenderTargetTexture("HighlightLayerBlurRTT", { + width: blurTextureWidth, + height: blurTextureHeight + }, this._scene, false, true, BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT); + this._blurTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; + this._blurTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; + this._blurTexture.anisotropicFilteringLevel = 16; + this._blurTexture.updateSamplingMode(BABYLON.Texture.TRILINEAR_SAMPLINGMODE); + this._blurTexture.renderParticles = false; + this._downSamplePostprocess = new BABYLON.PassPostProcess("HighlightLayerPPP", this._options.blurTextureSizeRatio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine()); + this._downSamplePostprocess.onApplyObservable.add(function (effect) { + effect.setTexture("textureSampler", _this._mainTexture); + }); + if (this._options.alphaBlendingMode === BABYLON.Engine.ALPHA_COMBINE) { + this._horizontalBlurPostprocess = new GlowBlurPostProcess("HighlightLayerHBP", new BABYLON.Vector2(1.0, 0), this._options.blurHorizontalSize, 1, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine()); + this._horizontalBlurPostprocess.onApplyObservable.add(function (effect) { + effect.setFloat2("screenSize", blurTextureWidth, blurTextureHeight); + }); + this._verticalBlurPostprocess = new GlowBlurPostProcess("HighlightLayerVBP", new BABYLON.Vector2(0, 1.0), this._options.blurVerticalSize, 1, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine()); + this._verticalBlurPostprocess.onApplyObservable.add(function (effect) { + effect.setFloat2("screenSize", blurTextureWidth, blurTextureHeight); + }); + } + else { + this._horizontalBlurPostprocess = new BABYLON.BlurPostProcess("HighlightLayerHBP", new BABYLON.Vector2(1.0, 0), this._options.blurHorizontalSize, 1, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine()); + this._horizontalBlurPostprocess.onApplyObservable.add(function (effect) { + effect.setFloat2("screenSize", blurTextureWidth, blurTextureHeight); + }); + this._verticalBlurPostprocess = new BABYLON.BlurPostProcess("HighlightLayerVBP", new BABYLON.Vector2(0, 1.0), this._options.blurVerticalSize, 1, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine()); + this._verticalBlurPostprocess.onApplyObservable.add(function (effect) { + effect.setFloat2("screenSize", blurTextureWidth, blurTextureHeight); + }); + } + this._mainTexture.onAfterUnbindObservable.add(function () { + _this.onBeforeBlurObservable.notifyObservers(_this); + _this._scene.postProcessManager.directRender([_this._downSamplePostprocess, _this._horizontalBlurPostprocess, _this._verticalBlurPostprocess], _this._blurTexture.getInternalTexture()); + _this.onAfterBlurObservable.notifyObservers(_this); + }); + // Custom render function + var renderSubMesh = function (subMesh) { + var mesh = subMesh.getRenderingMesh(); + var scene = _this._scene; + var engine = scene.getEngine(); + // Culling + engine.setState(subMesh.getMaterial().backFaceCulling); + // Managing instances + var batch = mesh._getInstancesRenderList(subMesh._id); + if (batch.mustReturn) { + return; + } + // Excluded Mesh + if (_this._excludedMeshes[mesh.id]) { + return; + } + ; + var hardwareInstancedRendering = (engine.getCaps().instancedArrays !== null) && (batch.visibleInstances[subMesh._id] !== null) && (batch.visibleInstances[subMesh._id] !== undefined); + var highlightLayerMesh = _this._meshes[mesh.id]; + var material = subMesh.getMaterial(); + var emissiveTexture = null; + if (highlightLayerMesh && highlightLayerMesh.glowEmissiveOnly && material) { + emissiveTexture = material.emissiveTexture; + } + if (_this.isReady(subMesh, hardwareInstancedRendering, emissiveTexture)) { + engine.enableEffect(_this._glowMapGenerationEffect); + mesh._bind(subMesh, _this._glowMapGenerationEffect, BABYLON.Material.TriangleFillMode); + _this._glowMapGenerationEffect.setMatrix("viewProjection", scene.getTransformMatrix()); + if (highlightLayerMesh) { + _this._glowMapGenerationEffect.setFloat4("color", highlightLayerMesh.color.r, highlightLayerMesh.color.g, highlightLayerMesh.color.b, 1.0); + } + else { + _this._glowMapGenerationEffect.setFloat4("color", HighlightLayer.neutralColor.r, HighlightLayer.neutralColor.g, HighlightLayer.neutralColor.b, HighlightLayer.neutralColor.a); + } + // Alpha test + if (material && material.needAlphaTesting()) { + var alphaTexture = material.getAlphaTestTexture(); + _this._glowMapGenerationEffect.setTexture("diffuseSampler", alphaTexture); + _this._glowMapGenerationEffect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix()); + } + // Glow emissive only + if (emissiveTexture) { + _this._glowMapGenerationEffect.setTexture("emissiveSampler", emissiveTexture); + _this._glowMapGenerationEffect.setMatrix("emissiveMatrix", emissiveTexture.getTextureMatrix()); + } + // Bones + if (mesh.useBones && mesh.computeBonesUsingShaders) { + _this._glowMapGenerationEffect.setMatrices("mBones", mesh.skeleton.getTransformMatrices(mesh)); + } + // Draw + mesh._processRendering(subMesh, _this._glowMapGenerationEffect, BABYLON.Material.TriangleFillMode, batch, hardwareInstancedRendering, function (isInstance, world) { return _this._glowMapGenerationEffect.setMatrix("world", world); }); + } + else { + // Need to reset refresh rate of the shadowMap + _this._mainTexture.resetRefreshCounter(); + } + }; + this._mainTexture.customRenderFunction = function (opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes) { + _this.onBeforeRenderMainTextureObservable.notifyObservers(_this); + var index; + for (index = 0; index < opaqueSubMeshes.length; index++) { + renderSubMesh(opaqueSubMeshes.data[index]); + } + for (index = 0; index < alphaTestSubMeshes.length; index++) { + renderSubMesh(alphaTestSubMeshes.data[index]); + } + for (index = 0; index < transparentSubMeshes.length; index++) { + renderSubMesh(transparentSubMeshes.data[index]); + } + }; + this._mainTexture.onClearObservable.add(function (engine) { + engine.clear(HighlightLayer.neutralColor, true, true, true); + }); + }; + /** + * Checks for the readiness of the element composing the layer. + * @param subMesh the mesh to check for + * @param useInstances specify wether or not to use instances to render the mesh + * @param emissiveTexture the associated emissive texture used to generate the glow + * @return true if ready otherwise, false + */ + HighlightLayer.prototype.isReady = function (subMesh, useInstances, emissiveTexture) { + if (!subMesh.getMaterial().isReady(subMesh.getMesh(), useInstances)) { + return false; + } + var defines = []; + var attribs = [BABYLON.VertexBuffer.PositionKind]; + var mesh = subMesh.getMesh(); + var material = subMesh.getMaterial(); + var uv1 = false; + var uv2 = false; + // Alpha test + if (material && material.needAlphaTesting()) { + var alphaTexture = material.getAlphaTestTexture(); + if (alphaTexture) { + defines.push("#define ALPHATEST"); + if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind) && + alphaTexture.coordinatesIndex === 1) { + defines.push("#define DIFFUSEUV2"); + uv2 = true; + } + else if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) { + defines.push("#define DIFFUSEUV1"); + uv1 = true; + } + } + } + // Emissive + if (emissiveTexture) { + defines.push("#define EMISSIVE"); + if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind) && + emissiveTexture.coordinatesIndex === 1) { + defines.push("#define EMISSIVEUV2"); + uv2 = true; + } + else if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) { + defines.push("#define EMISSIVEUV1"); + uv1 = true; + } + } + if (uv1) { + attribs.push(BABYLON.VertexBuffer.UVKind); + defines.push("#define UV1"); + } + if (uv2) { + attribs.push(BABYLON.VertexBuffer.UV2Kind); + defines.push("#define UV2"); + } + // Bones + if (mesh.useBones && mesh.computeBonesUsingShaders) { + attribs.push(BABYLON.VertexBuffer.MatricesIndicesKind); + attribs.push(BABYLON.VertexBuffer.MatricesWeightsKind); + if (mesh.numBoneInfluencers > 4) { + attribs.push(BABYLON.VertexBuffer.MatricesIndicesExtraKind); + attribs.push(BABYLON.VertexBuffer.MatricesWeightsExtraKind); + } + defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers); + defines.push("#define BonesPerMesh " + (mesh.skeleton.bones.length + 1)); + } + else { + defines.push("#define NUM_BONE_INFLUENCERS 0"); + } + // Instances + if (useInstances) { + defines.push("#define INSTANCES"); + attribs.push("world0"); + attribs.push("world1"); + attribs.push("world2"); + attribs.push("world3"); + } + // Get correct effect + var join = defines.join("\n"); + if (this._cachedDefines !== join) { + this._cachedDefines = join; + this._glowMapGenerationEffect = this._scene.getEngine().createEffect("glowMapGeneration", attribs, ["world", "mBones", "viewProjection", "diffuseMatrix", "color", "emissiveMatrix"], ["diffuseSampler", "emissiveSampler"], join); + } + return this._glowMapGenerationEffect.isReady(); + }; + /** + * Renders the glowing part of the scene by blending the blurred glowing meshes on top of the rendered scene. + */ + HighlightLayer.prototype.render = function () { + var currentEffect = this._glowMapMergeEffect; + // Check + if (!currentEffect.isReady() || !this._blurTexture.isReady()) + return; + var engine = this._scene.getEngine(); + this.onBeforeComposeObservable.notifyObservers(this); + // Render + engine.enableEffect(currentEffect); + engine.setState(false); + // Cache + var previousStencilBuffer = engine.getStencilBuffer(); + var previousStencilFunction = engine.getStencilFunction(); + var previousStencilMask = engine.getStencilMask(); + var previousAlphaMode = engine.getAlphaMode(); + // Texture + currentEffect.setTexture("textureSampler", this._blurTexture); + // VBOs + engine.bindBuffers(this._vertexBuffers, this._indexBuffer, currentEffect); + // Draw order + engine.setAlphaMode(this._options.alphaBlendingMode); + engine.setStencilMask(0x00); + engine.setStencilBuffer(true); + engine.setStencilFunctionReference(this._instanceGlowingMeshStencilReference); + if (this.outerGlow) { + currentEffect.setFloat("offset", 0); + engine.setStencilFunction(BABYLON.Engine.NOTEQUAL); + engine.draw(true, 0, 6); + } + if (this.innerGlow) { + currentEffect.setFloat("offset", 1); + engine.setStencilFunction(BABYLON.Engine.EQUAL); + engine.draw(true, 0, 6); + } + // Restore Cache + engine.setStencilFunction(previousStencilFunction); + engine.setStencilMask(previousStencilMask); + engine.setAlphaMode(previousAlphaMode); + engine.setStencilBuffer(previousStencilBuffer); + this.onAfterComposeObservable.notifyObservers(this); + // Handle size changes. + var size = this._mainTexture.getSize(); + this.setMainTextureSize(); + if (size.width !== this._mainTextureDesiredSize.width || size.height !== this._mainTextureDesiredSize.height) { + // Recreate RTT and post processes on size change. + this.onSizeChangedObservable.notifyObservers(this); + this.disposeTextureAndPostProcesses(); + this.createTextureAndPostProcesses(); + } + }; + /** + * Add a mesh in the exclusion list to prevent it to impact or being impacted by the highlight layer. + * @param mesh The mesh to exclude from the highlight layer + */ + HighlightLayer.prototype.addExcludedMesh = function (mesh) { + var meshExcluded = this._excludedMeshes[mesh.id]; + if (!meshExcluded) { + this._excludedMeshes[mesh.id] = { + mesh: mesh, + beforeRender: mesh.onBeforeRenderObservable.add(function (mesh) { + mesh.getEngine().setStencilBuffer(false); + }), + afterRender: mesh.onAfterRenderObservable.add(function (mesh) { + mesh.getEngine().setStencilBuffer(true); + }), + }; + } + }; + /** + * Remove a mesh from the exclusion list to let it impact or being impacted by the highlight layer. + * @param mesh The mesh to highlight + */ + HighlightLayer.prototype.removeExcludedMesh = function (mesh) { + var meshExcluded = this._excludedMeshes[mesh.id]; + if (meshExcluded) { + mesh.onBeforeRenderObservable.remove(meshExcluded.beforeRender); + mesh.onAfterRenderObservable.remove(meshExcluded.afterRender); + } + this._excludedMeshes[mesh.id] = undefined; + }; + /** + * Add a mesh in the highlight layer in order to make it glow with the chosen color. + * @param mesh The mesh to highlight + * @param color The color of the highlight + * @param glowEmissiveOnly Extract the glow from the emissive texture + */ + HighlightLayer.prototype.addMesh = function (mesh, color, glowEmissiveOnly) { + var _this = this; + if (glowEmissiveOnly === void 0) { glowEmissiveOnly = false; } + var meshHighlight = this._meshes[mesh.id]; + if (meshHighlight) { + meshHighlight.color = color; + } + else { + this._meshes[mesh.id] = { + mesh: mesh, + color: color, + // Lambda required for capture due to Observable this context + observerHighlight: mesh.onBeforeRenderObservable.add(function (mesh) { + if (_this._excludedMeshes[mesh.id]) { + _this.defaultStencilReference(mesh); + } + else { + mesh.getScene().getEngine().setStencilFunctionReference(_this._instanceGlowingMeshStencilReference); + } + }), + observerDefault: mesh.onAfterRenderObservable.add(this.defaultStencilReference), + glowEmissiveOnly: glowEmissiveOnly + }; + } + this._shouldRender = true; + }; + /** + * Remove a mesh from the highlight layer in order to make it stop glowing. + * @param mesh The mesh to highlight + */ + HighlightLayer.prototype.removeMesh = function (mesh) { + var meshHighlight = this._meshes[mesh.id]; + if (meshHighlight) { + mesh.onBeforeRenderObservable.remove(meshHighlight.observerHighlight); + mesh.onAfterRenderObservable.remove(meshHighlight.observerDefault); + } + this._meshes[mesh.id] = undefined; + this._shouldRender = false; + for (var meshHighlightToCheck in this._meshes) { + if (meshHighlightToCheck) { + this._shouldRender = true; + break; + } + } + }; + /** + * Returns true if the layer contains information to display, otherwise false. + */ + HighlightLayer.prototype.shouldRender = function () { + return this.isEnabled && this._shouldRender; + }; + /** + * Sets the main texture desired size which is the closest power of two + * of the engine canvas size. + */ + HighlightLayer.prototype.setMainTextureSize = function () { + if (this._options.mainTextureFixedSize) { + this._mainTextureDesiredSize.width = this._options.mainTextureFixedSize; + this._mainTextureDesiredSize.height = this._options.mainTextureFixedSize; + } + else { + this._mainTextureDesiredSize.width = this._engine.getRenderingCanvas().width * this._options.mainTextureRatio; + this._mainTextureDesiredSize.height = this._engine.getRenderingCanvas().height * this._options.mainTextureRatio; + this._mainTextureDesiredSize.width = BABYLON.Tools.GetExponentOfTwo(this._mainTextureDesiredSize.width, this._maxSize); + this._mainTextureDesiredSize.height = BABYLON.Tools.GetExponentOfTwo(this._mainTextureDesiredSize.height, this._maxSize); + } + }; + /** + * Force the stencil to the normal expected value for none glowing parts + */ + HighlightLayer.prototype.defaultStencilReference = function (mesh) { + mesh.getScene().getEngine().setStencilFunctionReference(HighlightLayer.normalMeshStencilReference); + }; + /** + * Dispose only the render target textures and post process. + */ + HighlightLayer.prototype.disposeTextureAndPostProcesses = function () { + this._blurTexture.dispose(); + this._mainTexture.dispose(); + this._downSamplePostprocess.dispose(); + this._horizontalBlurPostprocess.dispose(); + this._verticalBlurPostprocess.dispose(); + }; + /** + * Dispose the highlight layer and free resources. + */ + HighlightLayer.prototype.dispose = function () { + var vertexBuffer = this._vertexBuffers[BABYLON.VertexBuffer.PositionKind]; + if (vertexBuffer) { + vertexBuffer.dispose(); + this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = null; + } + if (this._indexBuffer) { + this._scene.getEngine()._releaseBuffer(this._indexBuffer); + this._indexBuffer = null; + } + // Clean textures and post processes + this.disposeTextureAndPostProcesses(); + // Clean mesh references + for (var id in this._meshes) { + var meshHighlight = this._meshes[id]; + if (meshHighlight && meshHighlight.mesh) { + meshHighlight.mesh.onBeforeRenderObservable.remove(meshHighlight.observerHighlight); + meshHighlight.mesh.onAfterRenderObservable.remove(meshHighlight.observerDefault); + } + } + this._meshes = null; + for (var id in this._excludedMeshes) { + var meshHighlight = this._excludedMeshes[id]; + if (meshHighlight) { + meshHighlight.mesh.onBeforeRenderObservable.remove(meshHighlight.beforeRender); + meshHighlight.mesh.onAfterRenderObservable.remove(meshHighlight.afterRender); + } + } + this._excludedMeshes = null; + // Remove from scene + var index = this._scene.highlightLayers.indexOf(this, 0); + if (index > -1) { + this._scene.highlightLayers.splice(index, 1); + } + // Callback + this.onDisposeObservable.notifyObservers(this); + this.onDisposeObservable.clear(); + this.onBeforeRenderMainTextureObservable.clear(); + this.onBeforeBlurObservable.clear(); + this.onBeforeComposeObservable.clear(); + this.onAfterComposeObservable.clear(); + this.onSizeChangedObservable.clear(); + }; + /** + * The neutral color used during the preparation of the glow effect. + * This is black by default as the blend operation is a blend operation. + */ + HighlightLayer.neutralColor = new BABYLON.Color4(0, 0, 0, 0); + /** + * Stencil value used for glowing meshes. + */ + HighlightLayer.glowingMeshStencilReference = 0x02; + /** + * Stencil value used for the other meshes in the scene. + */ + HighlightLayer.normalMeshStencilReference = 0x01; + return HighlightLayer; + }()); + BABYLON.HighlightLayer = HighlightLayer; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.highlightlayer.js.map + +var BABYLON; +(function (BABYLON) { + var SIMDVector3 = (function () { + function SIMDVector3() { + } + SIMDVector3.TransformCoordinatesToRefSIMD = function (vector, transformation, result) { + SIMDVector3.TransformCoordinatesFromFloatsToRefSIMD(vector.x, vector.y, vector.z, transformation, result); + }; + SIMDVector3.TransformCoordinatesFromFloatsToRefSIMD = function (x, y, z, transformation, result) { + var m = transformation.m; + var m0 = SIMD.Float32x4.load(m, 0); + var m1 = SIMD.Float32x4.load(m, 4); + var m2 = SIMD.Float32x4.load(m, 8); + var m3 = SIMD.Float32x4.load(m, 12); + var r = SIMD.Float32x4.add(SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.splat(x), m0), SIMD.Float32x4.mul(SIMD.Float32x4.splat(y), m1)), SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.splat(z), m2), m3)); + r = SIMD.Float32x4.div(r, SIMD.Float32x4.swizzle(r, 3, 3, 3, 3)); + result.x = SIMD.Float32x4.extractLane(r, 0); + result.y = SIMD.Float32x4.extractLane(r, 1); + result.z = SIMD.Float32x4.extractLane(r, 2); + }; + return SIMDVector3; + }()); + var SIMDMatrix = (function () { + function SIMDMatrix() { + } + SIMDMatrix.prototype.multiplyToArraySIMD = function (other, result, offset) { + var tm = this.m; + var om = other.m; + var m0 = SIMD.Float32x4.load(om, 0); + var m1 = SIMD.Float32x4.load(om, 4); + var m2 = SIMD.Float32x4.load(om, 8); + var m3 = SIMD.Float32x4.load(om, 12); + for (var i = 0; i < 16; i += 4) { + SIMD.Float32x4.store(result, i + offset, SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.splat(tm[i]), m0), SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.splat(tm[i + 1]), m1), SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.splat(tm[i + 2]), m2), SIMD.Float32x4.mul(SIMD.Float32x4.splat(tm[i + 3]), m3))))); + } + return this; + }; + SIMDMatrix.prototype.invertToRefSIMD = function (other) { + var src = this.m; + var dest = other.m; + // Load the 4 rows + var src0 = SIMD.Float32x4.load(src, 0); + var src1 = SIMD.Float32x4.load(src, 4); + var src2 = SIMD.Float32x4.load(src, 8); + var src3 = SIMD.Float32x4.load(src, 12); + // Transpose the source matrix. Sort of. Not a true transpose operation + var tmp1 = SIMD.Float32x4.shuffle(src0, src1, 0, 1, 4, 5); + var row1 = SIMD.Float32x4.shuffle(src2, src3, 0, 1, 4, 5); + var row0 = SIMD.Float32x4.shuffle(tmp1, row1, 0, 2, 4, 6); + row1 = SIMD.Float32x4.shuffle(row1, tmp1, 1, 3, 5, 7); + tmp1 = SIMD.Float32x4.shuffle(src0, src1, 2, 3, 6, 7); + var row3 = SIMD.Float32x4.shuffle(src2, src3, 2, 3, 6, 7); + var row2 = SIMD.Float32x4.shuffle(tmp1, row3, 0, 2, 4, 6); + row3 = SIMD.Float32x4.shuffle(row3, tmp1, 1, 3, 5, 7); + // This is a true transposition, but it will lead to an incorrect result + //tmp1 = shuffle(src0, src1, 0, 1, 4, 5); + //tmp2 = shuffle(src2, src3, 0, 1, 4, 5); + //row0 = shuffle(tmp1, tmp2, 0, 2, 4, 6); + //row1 = shuffle(tmp1, tmp2, 1, 3, 5, 7); + //tmp1 = shuffle(src0, src1, 2, 3, 6, 7); + //tmp2 = shuffle(src2, src3, 2, 3, 6, 7); + //row2 = shuffle(tmp1, tmp2, 0, 2, 4, 6); + //row3 = shuffle(tmp1, tmp2, 1, 3, 5, 7); + // ---- + tmp1 = SIMD.Float32x4.mul(row2, row3); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); // 0xB1 = 10110001 + var minor0 = SIMD.Float32x4.mul(row1, tmp1); + var minor1 = SIMD.Float32x4.mul(row0, tmp1); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); // 0x4E = 01001110 + minor0 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row1, tmp1), minor0); + minor1 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row0, tmp1), minor1); + minor1 = SIMD.Float32x4.swizzle(minor1, 2, 3, 0, 1); // 0x4E = 01001110 + // ---- + tmp1 = SIMD.Float32x4.mul(row1, row2); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); // 0xB1 = 10110001 + minor0 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row3, tmp1), minor0); + var minor3 = SIMD.Float32x4.mul(row0, tmp1); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); // 0x4E = 01001110 + minor0 = SIMD.Float32x4.sub(minor0, SIMD.Float32x4.mul(row3, tmp1)); + minor3 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row0, tmp1), minor3); + minor3 = SIMD.Float32x4.swizzle(minor3, 2, 3, 0, 1); // 0x4E = 01001110 + // ---- + tmp1 = SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(row1, 2, 3, 0, 1), row3); // 0x4E = 01001110 + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); // 0xB1 = 10110001 + row2 = SIMD.Float32x4.swizzle(row2, 2, 3, 0, 1); // 0x4E = 01001110 + minor0 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row2, tmp1), minor0); + var minor2 = SIMD.Float32x4.mul(row0, tmp1); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); // 0x4E = 01001110 + minor0 = SIMD.Float32x4.sub(minor0, SIMD.Float32x4.mul(row2, tmp1)); + minor2 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row0, tmp1), minor2); + minor2 = SIMD.Float32x4.swizzle(minor2, 2, 3, 0, 1); // 0x4E = 01001110 + // ---- + tmp1 = SIMD.Float32x4.mul(row0, row1); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); // 0xB1 = 10110001 + minor2 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row3, tmp1), minor2); + minor3 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row2, tmp1), minor3); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); // 0x4E = 01001110 + minor2 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row3, tmp1), minor2); + minor3 = SIMD.Float32x4.sub(minor3, SIMD.Float32x4.mul(row2, tmp1)); + // ---- + tmp1 = SIMD.Float32x4.mul(row0, row3); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); // 0xB1 = 10110001 + minor1 = SIMD.Float32x4.sub(minor1, SIMD.Float32x4.mul(row2, tmp1)); + minor2 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row1, tmp1), minor2); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); // 0x4E = 01001110 + minor1 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row2, tmp1), minor1); + minor2 = SIMD.Float32x4.sub(minor2, SIMD.Float32x4.mul(row1, tmp1)); + // ---- + tmp1 = SIMD.Float32x4.mul(row0, row2); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); // 0xB1 = 10110001 + minor1 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row3, tmp1), minor1); + minor3 = SIMD.Float32x4.sub(minor3, SIMD.Float32x4.mul(row1, tmp1)); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); // 0x4E = 01001110 + minor1 = SIMD.Float32x4.sub(minor1, SIMD.Float32x4.mul(row3, tmp1)); + minor3 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row1, tmp1), minor3); + // Compute determinant + var det = SIMD.Float32x4.mul(row0, minor0); + det = SIMD.Float32x4.add(SIMD.Float32x4.swizzle(det, 2, 3, 0, 1), det); // 0x4E = 01001110 + det = SIMD.Float32x4.add(SIMD.Float32x4.swizzle(det, 1, 0, 3, 2), det); // 0xB1 = 10110001 + tmp1 = SIMD.Float32x4.reciprocalApproximation(det); + det = SIMD.Float32x4.sub(SIMD.Float32x4.add(tmp1, tmp1), SIMD.Float32x4.mul(det, SIMD.Float32x4.mul(tmp1, tmp1))); + det = SIMD.Float32x4.swizzle(det, 0, 0, 0, 0); + // These shuffles aren't necessary if the faulty transposition is done + // up at the top of this function. + //minor0 =SIMD.Float32x4.swizzle(minor0, 2, 1, 0, 3); + //minor1 =SIMD.Float32x4.swizzle(minor1, 2, 1, 0, 3); + //minor2 =SIMD.Float32x4.swizzle(minor2, 2, 1, 0, 3); + //minor3 =SIMD.Float32x4.swizzle(minor3, 2, 1, 0, 3); + // Compute final values by multiplying with 1/det + SIMD.Float32x4.store(dest, 0, SIMD.Float32x4.mul(det, minor0)); + SIMD.Float32x4.store(dest, 4, SIMD.Float32x4.mul(det, minor1)); + SIMD.Float32x4.store(dest, 8, minor2 = SIMD.Float32x4.mul(det, minor2)); + SIMD.Float32x4.store(dest, 12, SIMD.Float32x4.mul(det, minor3)); + return this; + }; + SIMDMatrix.LookAtLHToRefSIMD = function (eyeRef, targetRef, upRef, result) { + var out = result.m; + var center = SIMD.Float32x4(targetRef.x, targetRef.y, targetRef.z, 0.0); + var eye = SIMD.Float32x4(eyeRef.x, eyeRef.y, eyeRef.z, 0.0); + var up = SIMD.Float32x4(upRef.x, upRef.y, upRef.z, 0.0); + // cc.kmVec3Subtract(f, pCenter, pEye); + var f = SIMD.Float32x4.sub(center, eye); + // cc.kmVec3Normalize(f, f); + var tmp = SIMD.Float32x4.mul(f, f); + tmp = SIMD.Float32x4.add(tmp, SIMD.Float32x4.add(SIMD.Float32x4.swizzle(tmp, 1, 2, 0, 3), SIMD.Float32x4.swizzle(tmp, 2, 0, 1, 3))); + f = SIMD.Float32x4.mul(f, SIMD.Float32x4.reciprocalSqrtApproximation(tmp)); + // cc.kmVec3Assign(up, pUp); + // cc.kmVec3Normalize(up, up); + tmp = SIMD.Float32x4.mul(up, up); + tmp = SIMD.Float32x4.add(tmp, SIMD.Float32x4.add(SIMD.Float32x4.swizzle(tmp, 1, 2, 0, 3), SIMD.Float32x4.swizzle(tmp, 2, 0, 1, 3))); + up = SIMD.Float32x4.mul(up, SIMD.Float32x4.reciprocalSqrtApproximation(tmp)); + // cc.kmVec3Cross(s, f, up); + var s = SIMD.Float32x4.sub(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(f, 1, 2, 0, 3), SIMD.Float32x4.swizzle(up, 2, 0, 1, 3)), SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(f, 2, 0, 1, 3), SIMD.Float32x4.swizzle(up, 1, 2, 0, 3))); + // cc.kmVec3Normalize(s, s); + tmp = SIMD.Float32x4.mul(s, s); + tmp = SIMD.Float32x4.add(tmp, SIMD.Float32x4.add(SIMD.Float32x4.swizzle(tmp, 1, 2, 0, 3), SIMD.Float32x4.swizzle(tmp, 2, 0, 1, 3))); + s = SIMD.Float32x4.mul(s, SIMD.Float32x4.reciprocalSqrtApproximation(tmp)); + // cc.kmVec3Cross(u, s, f); + var u = SIMD.Float32x4.sub(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s, 1, 2, 0, 3), SIMD.Float32x4.swizzle(f, 2, 0, 1, 3)), SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s, 2, 0, 1, 3), SIMD.Float32x4.swizzle(f, 1, 2, 0, 3))); + // cc.kmVec3Normalize(s, s); + tmp = SIMD.Float32x4.mul(s, s); + tmp = SIMD.Float32x4.add(tmp, SIMD.Float32x4.add(SIMD.Float32x4.swizzle(tmp, 1, 2, 0, 3), SIMD.Float32x4.swizzle(tmp, 2, 0, 1, 3))); + s = SIMD.Float32x4.mul(s, SIMD.Float32x4.reciprocalSqrtApproximation(tmp)); + var zero = SIMD.Float32x4.splat(0.0); + s = SIMD.Float32x4.neg(s); + var tmp01 = SIMD.Float32x4.shuffle(s, u, 0, 1, 4, 5); + var tmp23 = SIMD.Float32x4.shuffle(f, zero, 0, 1, 4, 5); + var a0 = SIMD.Float32x4.shuffle(tmp01, tmp23, 0, 2, 4, 6); + var a1 = SIMD.Float32x4.shuffle(tmp01, tmp23, 1, 3, 5, 7); + var a2 = SIMD.Float32x4.shuffle(SIMD.Float32x4.shuffle(s, u, 2, 3, 6, 7), SIMD.Float32x4.shuffle(f, zero, 2, 3, 6, 7), 0, 2, 4, 6); + var a3 = SIMD.Float32x4(0.0, 0.0, 0.0, 1.0); + var b = SIMD.Float32x4(1.0, 0.0, 0.0, 0.0); + SIMD.Float32x4.store(out, 0, SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b, 0, 0, 0, 0), a0), SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b, 1, 1, 1, 1), a1), SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b, 2, 2, 2, 2), a2), SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b, 3, 3, 3, 3), a3))))); + b = SIMD.Float32x4(0.0, 1.0, 0.0, 0.0); + SIMD.Float32x4.store(out, 4, SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b, 0, 0, 0, 0), a0), SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b, 1, 1, 1, 1), a1), SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b, 2, 2, 2, 2), a2), SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b, 3, 3, 3, 3), a3))))); + b = SIMD.Float32x4(0.0, 0.0, 1.0, 0.0); + SIMD.Float32x4.store(out, 8, SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b, 0, 0, 0, 0), a0), SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b, 1, 1, 1, 1), a1), SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b, 2, 2, 2, 2), a2), SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b, 3, 3, 3, 3), a3))))); + b = SIMD.Float32x4.replaceLane(SIMD.Float32x4.neg(eye), 3, 1.0); + SIMD.Float32x4.store(out, 12, SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b, 0, 0, 0, 0), a0), SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b, 1, 1, 1, 1), a1), SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b, 2, 2, 2, 2), a2), SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b, 3, 3, 3, 3), a3))))); + }; + return SIMDMatrix; + }()); + var previousMultiplyToArray = BABYLON.Matrix.prototype.multiplyToArray; + var previousInvertToRef = BABYLON.Matrix.prototype.invertToRef; + var previousLookAtLHToRef = BABYLON.Matrix.LookAtLHToRef; + var previousTransformCoordinatesToRef = BABYLON.Vector3.TransformCoordinatesToRef; + var previousTransformCoordinatesFromFloatsToRef = BABYLON.Vector3.TransformCoordinatesFromFloatsToRef; + var SIMDHelper = (function () { + function SIMDHelper() { + } + Object.defineProperty(SIMDHelper, "IsEnabled", { + get: function () { + return SIMDHelper._isEnabled; + }, + enumerable: true, + configurable: true + }); + SIMDHelper.DisableSIMD = function () { + // Replace functions + BABYLON.Matrix.prototype.multiplyToArray = previousMultiplyToArray; + BABYLON.Matrix.prototype.invertToRef = previousInvertToRef; + BABYLON.Matrix.LookAtLHToRef = previousLookAtLHToRef; + BABYLON.Vector3.TransformCoordinatesToRef = previousTransformCoordinatesToRef; + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef = previousTransformCoordinatesFromFloatsToRef; + SIMDHelper._isEnabled = false; + }; + SIMDHelper.EnableSIMD = function () { + if (self.SIMD === undefined) { + return; + } + // check if polyfills needed + if (!self.Math.fround) { + self.Math.fround = (function (array) { return function (x) { + return array[0] = x, array[0]; + }; })(new Float32Array(1)); + } + if (!self.Math.imul) { + self.Math.imul = function (a, b) { + var ah = (a >>> 16) & 0xffff; + var al = a & 0xffff; + var bh = (b >>> 16) & 0xffff; + var bl = b & 0xffff; + // the shift by 0 fixes the sign on the high part + // the final |0 converts the unsigned value into a signed value + return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0) | 0); + }; + } + // Replace functions + BABYLON.Matrix.prototype.multiplyToArray = SIMDMatrix.prototype.multiplyToArraySIMD; + BABYLON.Matrix.prototype.invertToRef = SIMDMatrix.prototype.invertToRefSIMD; + BABYLON.Matrix.LookAtLHToRef = SIMDMatrix.LookAtLHToRefSIMD; + BABYLON.Vector3.TransformCoordinatesToRef = SIMDVector3.TransformCoordinatesToRefSIMD; + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef = SIMDVector3.TransformCoordinatesFromFloatsToRefSIMD; + SIMDHelper._isEnabled = true; + }; + SIMDHelper._isEnabled = false; + return SIMDHelper; + }()); + BABYLON.SIMDHelper = SIMDHelper; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.math.SIMD.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * This class describe a rectangle that were added to the map. + * You have access to its coordinates either in pixel or normalized (UV) + */ + var PackedRect = (function () { + function PackedRect(root, parent, pos, size) { + this._pos = pos; + this._size = size; + this._root = root; + this._parent = parent; + this._contentSize = null; + this._bottomNode = null; + this._leftNode = null; + this._initialSize = null; + this._rightNode = null; + } + Object.defineProperty(PackedRect.prototype, "pos", { + /** + * @returns the position of this node into the map + */ + get: function () { + return this._pos; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PackedRect.prototype, "contentSize", { + /** + * @returns the size of the rectangle this node handles + */ + get: function () { + return this._contentSize; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PackedRect.prototype, "UVs", { + /** + * Compute the UV of the top/left, top/right, bottom/right, bottom/left points of the rectangle this node handles into the map + * @returns And array of 4 Vector2, containing UV coordinates for the four corners of the Rectangle into the map + */ + get: function () { + return this.getUVsForCustomSize(this._root._size); + }, + enumerable: true, + configurable: true + }); + /** + * You may have allocated the PackedRect using over-provisioning (you allocated more than you need in order to prevent frequent deallocations/reallocations) and then using only a part of the PackRect. + * This method will return the UVs for this part by given the custom size of what you really use + * @param customSize must be less/equal to the allocated size, UV will be compute from this + */ + PackedRect.prototype.getUVsForCustomSize = function (customSize) { + var mainWidth = this._root._size.width; + var mainHeight = this._root._size.height; + var topLeft = new BABYLON.Vector2(this._pos.x / mainWidth, this._pos.y / mainHeight); + var rightBottom = new BABYLON.Vector2((this._pos.x + customSize.width - 1) / mainWidth, (this._pos.y + customSize.height - 1) / mainHeight); + var uvs = new Array(); + uvs.push(topLeft); + uvs.push(new BABYLON.Vector2(rightBottom.x, topLeft.y)); + uvs.push(rightBottom); + uvs.push(new BABYLON.Vector2(topLeft.x, rightBottom.y)); + return uvs; + }; + /** + * Free this rectangle from the map. + * Call this method when you no longer need the rectangle to be in the map. + */ + PackedRect.prototype.freeContent = function () { + if (!this.contentSize) { + return; + } + this._contentSize = null; + // If everything below is also free, reset the whole node, and attempt to reset parents if they also become free + this.attemptDefrag(); + }; + Object.defineProperty(PackedRect.prototype, "isUsed", { + get: function () { + return this._contentSize != null || this._leftNode != null; + }, + enumerable: true, + configurable: true + }); + PackedRect.prototype.findAndSplitNode = function (contentSize) { + var node = this.findNode(contentSize); + // Not enough space... + if (!node) { + return null; + } + node.splitNode(contentSize); + return node; + }; + PackedRect.prototype.findNode = function (size) { + var resNode = null; + // If this node is used, recurse to each of his subNodes to find an available one in its branch + if (this.isUsed) { + if (this._leftNode) { + resNode = this._leftNode.findNode(size); + } + if (!resNode && this._rightNode) { + resNode = this._rightNode.findNode(size); + } + if (!resNode && this._bottomNode) { + resNode = this._bottomNode.findNode(size); + } + } + else if (this._initialSize) { + if ((size.width <= this._initialSize.width) && (size.height <= this._initialSize.height)) { + resNode = this; + } + else { + return null; + } + } + else if ((size.width <= this._size.width) && (size.height <= this._size.height)) { + resNode = this; + } + return resNode; + }; + PackedRect.prototype.splitNode = function (contentSize) { + // If there's no contentSize but an initialSize it means this node were previously allocated, but freed, we need to create a _leftNode as subNode and use to allocate the space we need (and this node will have a right/bottom subNode for the space left as this._initialSize may be greater than contentSize) + if (!this._contentSize && this._initialSize) { + this._contentSize = contentSize.clone(); + this._leftNode = new PackedRect(this._root, this, new BABYLON.Vector2(this._pos.x, this._pos.y), new BABYLON.Size(this._initialSize.width, this._initialSize.height)); + return this._leftNode.splitNode(contentSize); + } + else { + this._contentSize = contentSize.clone(); + this._initialSize = contentSize.clone(); + if (contentSize.width !== this._size.width) { + this._rightNode = new PackedRect(this._root, this, new BABYLON.Vector2(this._pos.x + contentSize.width, this._pos.y), new BABYLON.Size(this._size.width - contentSize.width, contentSize.height)); + } + if (contentSize.height !== this._size.height) { + this._bottomNode = new PackedRect(this._root, this, new BABYLON.Vector2(this._pos.x, this._pos.y + contentSize.height), new BABYLON.Size(this._size.width, this._size.height - contentSize.height)); + } + return this; + } + }; + PackedRect.prototype.attemptDefrag = function () { + if (!this.isUsed && this.isRecursiveFree) { + this.clearNode(); + if (this._parent) { + this._parent.attemptDefrag(); + } + } + }; + PackedRect.prototype.clearNode = function () { + this._initialSize = null; + this._rightNode = null; + this._bottomNode = null; + }; + Object.defineProperty(PackedRect.prototype, "isRecursiveFree", { + get: function () { + return !this.contentSize && (!this._leftNode || this._leftNode.isRecursiveFree) && (!this._rightNode || this._rightNode.isRecursiveFree) && (!this._bottomNode || this._bottomNode.isRecursiveFree); + }, + enumerable: true, + configurable: true + }); + PackedRect.prototype.evalFreeSize = function (size) { + var levelSize = 0; + if (!this.isUsed) { + if (this._initialSize) { + levelSize = this._initialSize.surface; + } + else { + levelSize = this._size.surface; + } + } + if (this._rightNode) { + levelSize += this._rightNode.evalFreeSize(0); + } + if (this._bottomNode) { + levelSize += this._bottomNode.evalFreeSize(0); + } + return levelSize + size; + }; + return PackedRect; + }()); + BABYLON.PackedRect = PackedRect; + /** + * The purpose of this class is to pack several Rectangles into a big map, while trying to fit everything as optimally as possible. + * This class is typically used to build lightmaps, sprite map or to pack several little textures into a big one. + * Note that this class allows allocated Rectangles to be freed: that is the map is dynamically maintained so you can add/remove rectangle based on their life-cycle. + */ + var RectPackingMap = (function (_super) { + __extends(RectPackingMap, _super); + /** + * Create an instance of the object with a dimension using the given size + * @param size The dimension of the rectangle that will contain all the sub ones. + */ + function RectPackingMap(size) { + _super.call(this, null, null, BABYLON.Vector2.Zero(), size); + this._root = this; + } + /** + * Add a rectangle, finding the best location to store it into the map + * @param size the dimension of the rectangle to store + * @return the Node containing the rectangle information, or null if we couldn't find a free spot + */ + RectPackingMap.prototype.addRect = function (size) { + var node = this.findAndSplitNode(size); + return node; + }; + Object.defineProperty(RectPackingMap.prototype, "freeSpace", { + /** + * Return the current space free normalized between [0;1] + * @returns {} + */ + get: function () { + var freeSize = 0; + freeSize = this.evalFreeSize(freeSize); + return freeSize / (this._size.width * this._size.height); + }, + enumerable: true, + configurable: true + }); + return RectPackingMap; + }(PackedRect)); + BABYLON.RectPackingMap = RectPackingMap; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.rectPackingMap.js.map + +var BABYLON; +(function (BABYLON) { + var DynamicFloatArrayElementInfo = (function () { + function DynamicFloatArrayElementInfo() { + } + return DynamicFloatArrayElementInfo; + }()); + BABYLON.DynamicFloatArrayElementInfo = DynamicFloatArrayElementInfo; + /** + * The purpose of this class is to store float32 based elements of a given size (defined by the stride argument) in a dynamic fashion, that is, you can add/free elements. You can then access to a defragmented/packed version of the underlying Float32Array by calling the pack() method. + * The intent is to maintain through time data that will be bound to a WebGlBuffer with the ability to change add/remove elements. + * It was first built to efficiently maintain the WebGlBuffer that contain instancing based data. + * Allocating an Element will return a instance of DynamicFloatArrayElement which contains the offset into the Float32Array of where the element starts, you are then responsible to copy your data using this offset. + * Beware, calling pack() may change the offset of some Entries because this method will defragment the Float32Array to replace empty elements by moving allocated ones at their location. + * This method will return an ArrayBufferView on the existing Float32Array that describes the used elements. Use this View to update the WebGLBuffer and NOT the "buffer" field of the class. The pack() method won't shrink/reallocate the buffer to keep it GC friendly, all the empty space will be put at the end of the buffer, the method just ensure there are no "free holes". + */ + var DynamicFloatArray = (function () { + /** + * Construct an instance of the dynamic float array + * @param stride size of one element in float (i.e. not bytes!) + * @param initialElementCount the number of available entries at construction + */ + function DynamicFloatArray(stride, initialElementCount) { + this.compareValueOffset = null; + this.sortingAscending = true; + this._stride = stride; + this.buffer = new Float32Array(stride * initialElementCount); + this._lastUsed = 0; + this._firstFree = 0; + this._allEntries = new Array(initialElementCount); + this._freeEntries = new Array(initialElementCount); + for (var i = 0; i < initialElementCount; i++) { + var element = new DynamicFloatArrayElementInfo(); + element.offset = i * stride; + this._allEntries[i] = element; + this._freeEntries[initialElementCount - i - 1] = element; + } + } + /** + * Allocate an element in the array. + * @return the element info instance that contains the offset into the main buffer of the element's location. + * Beware, this offset may change when you call pack() + */ + DynamicFloatArray.prototype.allocElement = function () { + if (this._freeEntries.length === 0) { + this._growBuffer(); + } + var el = this._freeEntries.pop(); + this._lastUsed = Math.max(el.offset, this._lastUsed); + if (el.offset === this._firstFree) { + if (this._freeEntries.length > 0) { + this._firstFree = this._freeEntries[this._freeEntries.length - 1].offset; + } + else { + this._firstFree += this._stride; + } + } + return el; + }; + /** + * Free the element corresponding to the given element info + * @param elInfo the element that describe the allocated element + */ + DynamicFloatArray.prototype.freeElement = function (elInfo) { + this._firstFree = Math.min(elInfo.offset, this._firstFree); + this._freeEntries.push(elInfo); + }; + /** + * This method will pack all the used elements into a linear sequence and put all the free space at the end. + * Instances of DynamicFloatArrayElement may have their 'offset' member changed as data could be copied from one location to another, so be sure to read/write your data based on the value inside this member after you called pack(). + * @return the subArray that is the view of the used elements area, you can use it as a source to update a WebGLBuffer + */ + DynamicFloatArray.prototype.pack = function () { + // no free slot? no need to pack + if (this._freeEntries.length === 0) { + return this.buffer; + } + // If the buffer is already packed the last used will always be lower than the first free + // The opposite may not be true, we can have a lastUsed greater than firstFree but the array still packed, because when an element is freed, lastUsed is not updated (for speed reason) so we may have a lastUsed of a freed element. But that's ok, well soon realize this case. + if (this._lastUsed < this._firstFree) { + var elementsBuffer_1 = this.buffer.subarray(0, this._lastUsed + this._stride); + return elementsBuffer_1; + } + var s = this._stride; + // Make sure there's a free element at the very end, we need it to create a range where we'll move the used elements that may appear before + var lastFree = new DynamicFloatArrayElementInfo(); + lastFree.offset = this.totalElementCount * s; + this._freeEntries.push(lastFree); + var sortedFree = this._freeEntries.sort(function (a, b) { return a.offset - b.offset; }); + var sortedAll = this._allEntries.sort(function (a, b) { return a.offset - b.offset; }); + var firstFreeSlotOffset = sortedFree[0].offset; + var freeZoneSize = 1; + var occupiedZoneSize = (this.usedElementCount + 1) * s; + var prevOffset = sortedFree[0].offset; + for (var i = 1; i < sortedFree.length; i++) { + // If the first free (which means everything before is occupied) is greater or equal the occupied zone size, it means everything is defragmented, we can quit + if (firstFreeSlotOffset >= occupiedZoneSize) { + break; + } + var curFree = sortedFree[i]; + var curOffset = curFree.offset; + // Compute the distance between this offset and the previous + var distance = curOffset - prevOffset; + // If the distance is the stride size, they are adjacent, it good, move to the next + if (distance === s) { + // Free zone is one element bigger + ++freeZoneSize; + // as we're about to iterate to the next, the cur becomes the previous... + prevOffset = curOffset; + continue; + } + // Distance is bigger, which means there's x element between the previous free and this one + var usedRange = (distance / s) - 1; + // Two cases the free zone is smaller than the data to move or bigger + // Copy what can fit in the free zone + var curMoveOffset = curOffset - s; + var copyCount = Math.min(freeZoneSize, usedRange); + for (var j = 0; j < copyCount; j++) { + var freeI = firstFreeSlotOffset / s; + var curI = curMoveOffset / s; + var moveEl = sortedAll[curI]; + this._moveElement(moveEl, firstFreeSlotOffset); + var replacedEl = sortedAll[freeI]; + // set the offset of the element we replaced with a value that will make it discard at the end of the method + replacedEl.offset = curMoveOffset; + // Swap the element we moved and the one it replaced in the sorted array to reflect the action we've made + sortedAll[freeI] = moveEl; + sortedAll[curI] = replacedEl; + curMoveOffset -= s; + firstFreeSlotOffset += s; + } + // Free Zone is smaller or equal so it's no longer a free zone, set the new one to the current location + if (freeZoneSize <= usedRange) { + firstFreeSlotOffset = curMoveOffset + s; + freeZoneSize = 1 + copyCount; + } + else { + freeZoneSize = ((curOffset - firstFreeSlotOffset) / s) + 1; + } + // as we're about to iterate to the next, the cur becomes the previous... + prevOffset = curOffset; + } + var elementsBuffer = this.buffer.subarray(0, firstFreeSlotOffset); + this._lastUsed = firstFreeSlotOffset - s; + this._firstFree = firstFreeSlotOffset; + sortedFree.pop(); // Remove the last free because that's the one we added at the start of the method + this._freeEntries = sortedFree.sort(function (a, b) { return b.offset - a.offset; }); + this._allEntries = sortedAll; + return elementsBuffer; + }; + DynamicFloatArray.prototype._moveElement = function (element, destOffset) { + for (var i = 0; i < this._stride; i++) { + this.buffer[destOffset + i] = this.buffer[element.offset + i]; + } + element.offset = destOffset; + }; + DynamicFloatArray.prototype._growBuffer = function () { + // Allocate the new buffer with 50% more entries, copy the content of the current one + var newElCount = Math.floor(this.totalElementCount * 1.5); + var newBuffer = new Float32Array(newElCount * this._stride); + newBuffer.set(this.buffer); + var curCount = this.totalElementCount; + var addedCount = newElCount - this.totalElementCount; + for (var i = 0; i < addedCount; i++) { + var element = new DynamicFloatArrayElementInfo(); + element.offset = (curCount + i) * this.stride; + this._allEntries.push(element); + this._freeEntries[addedCount - i - 1] = element; + } + this._firstFree = curCount * this.stride; + this.buffer = newBuffer; + }; + Object.defineProperty(DynamicFloatArray.prototype, "totalElementCount", { + /** + * Get the total count of entries that can fit in the current buffer + * @returns the elements count + */ + get: function () { + return this._allEntries.length; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DynamicFloatArray.prototype, "freeElementCount", { + /** + * Get the count of free entries that can still be allocated without resizing the buffer + * @returns the free elements count + */ + get: function () { + return this._freeEntries.length; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DynamicFloatArray.prototype, "usedElementCount", { + /** + * Get the count of allocated elements + * @returns the allocated elements count + */ + get: function () { + return this._allEntries.length - this._freeEntries.length; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DynamicFloatArray.prototype, "stride", { + /** + * Return the size of one element in float + * @returns the size in float + */ + get: function () { + return this._stride; + }, + enumerable: true, + configurable: true + }); + DynamicFloatArray.prototype.sort = function () { + var _this = this; + if (!this.compareValueOffset) { + throw new Error("The DynamicFloatArray.sort() method needs a valid 'compareValueOffset' property"); + } + var count = this.usedElementCount; + // Do we have to (re)create the sort table? + if (!this._sortTable || this._sortTable.length < count) { + // Small heuristic... We don't want to allocate totalElementCount right away because it may have 50 for 3 used elements, but on the other side we don't want to allocate just 3 when we just need 2, so double this value to give us some air to breath... + var newCount = Math.min(this.totalElementCount, count * 2); + this._sortTable = new Array(newCount); + } + if (!this._sortedTable || this._sortedTable.length !== count) { + this._sortedTable = new Array(count); + } + // Because, you know... + this.pack(); + //let stride = this.stride; + //for (let i = 0; i < count; i++) { + // let si = this._sortTable[i]; + // if (!si) { + // si = new SortInfo(); + // this._sortTable[i] = si; + // } + // si.entry = this._allEntries[i]; + // si.compareData = this.buffer[si.entry.offset + this.compareValueOffset]; + // si.swapedOffset = null; + // this._sortedTable[i] = si; + //} + var curOffset = 0; + var stride = this.stride; + for (var i = 0; i < count; i++, curOffset += stride) { + var si = this._sortTable[i]; + if (!si) { + si = new SortInfo(); + this._sortTable[i] = si; + } + si.compareData = this.buffer[curOffset + this.compareValueOffset]; + si.offset = curOffset; + si.swapedOffset = null; + this._sortedTable[i] = si; + } + // Let's sort the sorted table, we want to keep a track of the original one (that's why we have two buffers) + if (this.sortingAscending) { + this._sortedTable.sort(function (a, b) { return a.compareData - b.compareData; }); + } + else { + this._sortedTable.sort(function (a, b) { return b.compareData - a.compareData; }); + } + var swapElements = function (src, dst) { + for (var i = 0; i < stride; i++) { + var tps = _this.buffer[dst + i]; + _this.buffer[dst + i] = _this.buffer[src + i]; + _this.buffer[src + i] = tps; + } + }; + // The fun part begin, sortedTable give us the ordered layout to obtain, to get that we have to move elements, but when we move an element: + // it replaces an existing one.I don't want to allocate a new Float32Array and do a raw copy, because it's awful (GC - wise), + // and I still want something with a good algorithm complexity. + // So here's the deal: we are going to swap elements, but we have to track the change of location of the element being replaced, + // we need sortTable for that, it contains the original layout of SortInfo object, not the sorted one. + // The best way is to use an extra field in SortInfo, because potentially every element can be replaced. + // When we'll look for and element, we'll check if its swapedOffset is set, if so we reiterate the operation with the one there + // until we find a SortInfo object without a swapedOffset which means we got the right location + // Yes, we may have to do multiple iterations to find the right location, but hey, it won't be huge: <3 in most cases, and it's better + // than a double allocation of the whole float32Array or a O(n²/2) typical algorithm. + for (var i = 0; i < count; i++) { + // Get the element to move + var sourceSI = this._sortedTable[i]; + var destSI = this._sortTable[i]; + var sourceOff = sourceSI.offset; + // If the source changed location, find the new one + if (sourceSI.swapedOffset) { + // Follow the swapedOffset until there's none, it will mean that curSI contains the new location in its offset member + var curSI = sourceSI; + while (curSI.swapedOffset) { + curSI = this._sortTable[curSI.swapedOffset / stride]; + } + // Finally get the right location + sourceOff = curSI.offset; + } + // Tag the element being replaced with its new location + destSI.swapedOffset = sourceOff; + // Swap elements (only if needed) + if (sourceOff !== destSI.offset) { + swapElements(sourceOff, destSI.offset); + } + // Update the offset in the corresponding DFAE + //sourceSI.entry.offset = destSI.entry.offset; + this._allEntries[sourceSI.offset / stride].offset = destSI.offset; + } + this._allEntries.sort(function (a, b) { return a.offset - b.offset; }); + return true; + }; + return DynamicFloatArray; + }()); + BABYLON.DynamicFloatArray = DynamicFloatArray; + var SortInfo = (function () { + function SortInfo() { + this.compareData = this.offset = this.swapedOffset = null; + } + return SortInfo; + }()); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.dynamicFloatArray.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * This class given information about a given character. + */ + var CharInfo = (function () { + function CharInfo() { + } + return CharInfo; + }()); + BABYLON.CharInfo = CharInfo; + var FontTexture = (function (_super) { + __extends(FontTexture, _super); + /** + * Create a new instance of the FontTexture class + * @param name the name of the texture + * @param font the font to use, use the W3C CSS notation + * @param scene the scene that owns the texture + * @param maxCharCount the approximative maximum count of characters that could fit in the texture. This is an approximation because most of the fonts are proportional (each char has its own Width). The 'W' character's width is used to compute the size of the texture based on the given maxCharCount + * @param samplingMode the texture sampling mode + * @param superSample if true the FontTexture will be created with a font of a size twice bigger than the given one but all properties (lineHeight, charWidth, etc.) will be according to the original size. This is made to improve the text quality. + */ + function FontTexture(name, font, scene, maxCharCount, samplingMode, superSample, signedDistanceField) { + if (maxCharCount === void 0) { maxCharCount = 200; } + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + if (superSample === void 0) { superSample = false; } + if (signedDistanceField === void 0) { signedDistanceField = false; } + _super.call(this, null, scene, true, false, samplingMode); + this._charInfos = {}; + this._curCharCount = 0; + this._lastUpdateCharCount = -1; + this._usedCounter = 1; + this.name = name; + this.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; + this.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; + this._sdfScale = 8; + this._signedDistanceField = signedDistanceField; + this._superSample = false; + // SDF will use supersample no matter what, the resolution is otherwise too poor to produce correct result + if (superSample || signedDistanceField) { + var sfont = this.getSuperSampleFont(font); + if (sfont) { + this._superSample = true; + font = sfont; + } + } + // First canvas creation to determine the size of the texture to create + this._canvas = document.createElement("canvas"); + this._context = this._canvas.getContext("2d"); + this._context.font = font; + this._context.fillStyle = "white"; + this._context.textBaseline = "top"; + this._cachedFontId = null; + var res = this.getFontHeight(font); + this._lineHeightSuper = res.height + 4; + this._lineHeight = this._superSample ? (Math.ceil(this._lineHeightSuper / 2)) : this._lineHeightSuper; + this._offset = res.offset - 1; + this._xMargin = 1 + Math.ceil(this._lineHeightSuper / 15); // Right now this empiric formula seems to work... + this._yMargin = this._xMargin; + var maxCharWidth = this._context.measureText("W").width; + this._spaceWidthSuper = this._context.measureText(" ").width; + this._spaceWidth = this._superSample ? (this._spaceWidthSuper / 2) : this._spaceWidthSuper; + // This is an approximate size, but should always be able to fit at least the maxCharCount + var totalEstSurface = (this._lineHeightSuper + this._yMargin) * (maxCharWidth + this._xMargin) * maxCharCount; + var edge = Math.sqrt(totalEstSurface); + var textSize = Math.pow(2, Math.ceil(Math.log(edge) / Math.log(2))); + // Create the texture that will store the font characters + this._texture = scene.getEngine().createDynamicTexture(textSize, textSize, false, samplingMode); + var textureSize = this.getSize(); + this.hasAlpha = this._signedDistanceField === false; + // Recreate a new canvas with the final size: the one matching the texture (resizing the previous one doesn't work as one would expect...) + this._canvas = document.createElement("canvas"); + this._canvas.width = textureSize.width; + this._canvas.height = textureSize.height; + this._context = this._canvas.getContext("2d"); + this._context.textBaseline = "top"; + this._context.font = font; + this._context.fillStyle = "white"; + this._context.imageSmoothingEnabled = false; + this._context.clearRect(0, 0, textureSize.width, textureSize.height); + // Create a canvas for the signed distance field mode, we only have to store one char, the purpose is to render a char scaled _sdfScale times + // into this 2D context, then get the bitmap data, create the sdf char and push the result in the _context (which hold the whole Font Texture content) + // So you can see this context as an intermediate one, because it is. + if (this._signedDistanceField) { + var sdfC = document.createElement("canvas"); + var s = this._sdfScale; + sdfC.width = maxCharWidth * s; + sdfC.height = this._lineHeightSuper * s; + var sdfCtx = sdfC.getContext("2d"); + sdfCtx.scale(s, s); + sdfCtx.textBaseline = "top"; + sdfCtx.font = font; + sdfCtx.fillStyle = "white"; + sdfCtx.imageSmoothingEnabled = false; + this._sdfCanvas = sdfC; + this._sdfContext = sdfCtx; + } + this._currentFreePosition = BABYLON.Vector2.Zero(); + // Add the basic ASCII based characters + for (var i = 0x20; i < 0x7F; i++) { + var c = String.fromCharCode(i); + this.getChar(c); + } + this.update(); + } + Object.defineProperty(FontTexture.prototype, "isSuperSampled", { + get: function () { + return this._superSample; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FontTexture.prototype, "isSignedDistanceField", { + get: function () { + return this._signedDistanceField; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FontTexture.prototype, "spaceWidth", { + get: function () { + return this._spaceWidth; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FontTexture.prototype, "lineHeight", { + get: function () { + return this._lineHeight; + }, + enumerable: true, + configurable: true + }); + FontTexture.GetCachedFontTexture = function (scene, fontName, supersample, signedDistanceField) { + if (supersample === void 0) { supersample = false; } + if (signedDistanceField === void 0) { signedDistanceField = false; } + var s = scene; + if (!s.__fontTextureCache__) { + s.__fontTextureCache__ = new BABYLON.StringDictionary(); + } + var dic = s.__fontTextureCache__; + var lfn = fontName.toLocaleLowerCase() + (supersample ? "_+SS" : "_-SS") + (signedDistanceField ? "_+SDF" : "_-SDF"); + var ft = dic.get(lfn); + if (ft) { + ++ft._usedCounter; + return ft; + } + ft = new FontTexture(null, fontName, scene, supersample ? 100 : 200, BABYLON.Texture.BILINEAR_SAMPLINGMODE, supersample, signedDistanceField); + ft._cachedFontId = lfn; + dic.add(lfn, ft); + return ft; + }; + FontTexture.ReleaseCachedFontTexture = function (scene, fontName, supersample, signedDistanceField) { + if (supersample === void 0) { supersample = false; } + if (signedDistanceField === void 0) { signedDistanceField = false; } + var s = scene; + var dic = s.__fontTextureCache__; + if (!dic) { + return; + } + var lfn = fontName.toLocaleLowerCase() + (supersample ? "_+SS" : "_-SS") + (signedDistanceField ? "_+SDF" : "_-SDF"); + var font = dic.get(lfn); + if (--font._usedCounter === 0) { + dic.remove(lfn); + font.dispose(); + } + }; + /** + * Make sure the given char is present in the font map. + * @param char the character to get or add + * @return the CharInfo instance corresponding to the given character + */ + FontTexture.prototype.getChar = function (char) { + if (char.length !== 1) { + return null; + } + var info = this._charInfos[char]; + if (info) { + return info; + } + info = new CharInfo(); + var measure = this._context.measureText(char); + var textureSize = this.getSize(); + // we reached the end of the current line? + var width = Math.round(measure.width); + if (this._currentFreePosition.x + width + this._xMargin > textureSize.width) { + this._currentFreePosition.x = 0; + this._currentFreePosition.y += this._lineHeightSuper + this._yMargin; + // No more room? + if (this._currentFreePosition.y > textureSize.height) { + return this.getChar("!"); + } + } + // In sdf mode we render the character in an intermediate 2D context which scale the character this._sdfScale times (which is required to compute the sdf map accurately) + if (this._signedDistanceField) { + this._sdfContext.clearRect(0, 0, this._sdfCanvas.width, this._sdfCanvas.height); + this._sdfContext.fillText(char, 0, -this._offset); + var data = this._sdfContext.getImageData(0, 0, width * this._sdfScale, this._sdfCanvas.height); + var res = this._computeSDFChar(data); + this._context.putImageData(res, this._currentFreePosition.x, this._currentFreePosition.y); + } + else { + // Draw the character in the HTML canvas + this._context.fillText(char, this._currentFreePosition.x, this._currentFreePosition.y - this._offset); + } + // Fill the CharInfo object + info.topLeftUV = new BABYLON.Vector2(this._currentFreePosition.x / textureSize.width, this._currentFreePosition.y / textureSize.height); + info.bottomRightUV = new BABYLON.Vector2((this._currentFreePosition.x + width) / textureSize.width, info.topLeftUV.y + ((this._lineHeightSuper + 2) / textureSize.height)); + if (this._signedDistanceField) { + var off = 1 / textureSize.width; + info.topLeftUV.addInPlace(new BABYLON.Vector2(off, off)); + info.bottomRightUV.addInPlace(new BABYLON.Vector2(off, off)); + } + info.charWidth = this._superSample ? (width / 2) : width; + // Add the info structure + this._charInfos[char] = info; + this._curCharCount++; + // Set the next position + this._currentFreePosition.x += width + this._xMargin; + return info; + }; + FontTexture.prototype._computeSDFChar = function (source) { + var scl = this._sdfScale; + var sw = source.width; + var sh = source.height; + var dw = sw / scl; + var dh = sh / scl; + var roffx = 0; + var roffy = 0; + // We shouldn't look beyond half of the biggest between width and height + var radius = scl; + var br = radius - 1; + var lookupSrc = function (dx, dy, offX, offY, lookVis) { + var sx = dx * scl; + var sy = dy * scl; + // Looking out of the area? return true to make the test going on + if (((sx + offX) < 0) || ((sx + offX) >= sw) || ((sy + offY) < 0) || ((sy + offY) >= sh)) { + return true; + } + // Get the pixel we want + var val = source.data[(((sy + offY) * sw) + (sx + offX)) * 4]; + var res = (val > 0) === lookVis; + if (!res) { + roffx = offX; + roffy = offY; + } + return res; + }; + var lookupArea = function (dx, dy, lookVis) { + // Fast rejection test, if we have the same result in N, S, W, E at a distance which is the radius-1 then it means the data will be consistent in this area. That's because we've scale the rendering of the letter "radius" times, so a letter's pixel will be at least radius wide + if (lookupSrc(dx, dy, 0, br, lookVis) && + lookupSrc(dx, dy, 0, -br, lookVis) && + lookupSrc(dx, dy, -br, 0, lookVis) && + lookupSrc(dx, dy, br, 0, lookVis)) { + return 0; + } + for (var i = 1; i <= radius; i++) { + // Quick test N, S, W, E + if (!lookupSrc(dx, dy, 0, i, lookVis) || !lookupSrc(dx, dy, 0, -i, lookVis) || !lookupSrc(dx, dy, -i, 0, lookVis) || !lookupSrc(dx, dy, i, 0, lookVis)) { + return i * i; // Squared Distance is simple to compute in this case + } + // Test the frame area (except the N, S, W, E spots) from the nearest point from the center to the further one + for (var j = 1; j <= i; j++) { + if (!lookupSrc(dx, dy, -j, i, lookVis) || !lookupSrc(dx, dy, j, i, lookVis) || + !lookupSrc(dx, dy, i, -j, lookVis) || !lookupSrc(dx, dy, i, j, lookVis) || + !lookupSrc(dx, dy, -j, -i, lookVis) || !lookupSrc(dx, dy, j, -i, lookVis) || + !lookupSrc(dx, dy, -i, -j, lookVis) || !lookupSrc(dx, dy, -i, j, lookVis)) { + // We found the nearest texel having and opposite state, store the squared length + var res_1 = (i * i) + (j * j); + var count = 1; + // To improve quality we will sample the texels around this one, so it's 8 samples, we consider only the one having an opposite state, add them to the current res and will will compute the average at the end + if (!lookupSrc(dx, dy, roffx - 1, roffy, lookVis)) { + res_1 += (roffx - 1) * (roffx - 1) + roffy * roffy; + ++count; + } + if (!lookupSrc(dx, dy, roffx + 1, roffy, lookVis)) { + res_1 += (roffx + 1) * (roffx + 1) + roffy * roffy; + ++count; + } + if (!lookupSrc(dx, dy, roffx, roffy - 1, lookVis)) { + res_1 += roffx * roffx + (roffy - 1) * (roffy - 1); + ++count; + } + if (!lookupSrc(dx, dy, roffx, roffy + 1, lookVis)) { + res_1 += roffx * roffx + (roffy + 1) * (roffy + 1); + ++count; + } + if (!lookupSrc(dx, dy, roffx - 1, roffy - 1, lookVis)) { + res_1 += (roffx - 1) * (roffx - 1) + (roffy - 1) * (roffy - 1); + ++count; + } + if (!lookupSrc(dx, dy, roffx + 1, roffy + 1, lookVis)) { + res_1 += (roffx + 1) * (roffx + 1) + (roffy + 1) * (roffy + 1); + ++count; + } + if (!lookupSrc(dx, dy, roffx + 1, roffy - 1, lookVis)) { + res_1 += (roffx + 1) * (roffx + 1) + (roffy - 1) * (roffy - 1); + ++count; + } + if (!lookupSrc(dx, dy, roffx - 1, roffy + 1, lookVis)) { + res_1 += (roffx - 1) * (roffx - 1) + (roffy + 1) * (roffy + 1); + ++count; + } + // Compute the average based on the accumulated distance + return res_1 / count; + } + } + } + return 0; + }; + var tmp = new Array(dw * dh); + for (var y = 0; y < dh; y++) { + for (var x = 0; x < dw; x++) { + var curState = lookupSrc(x, y, 0, 0, true); + var d = lookupArea(x, y, curState); + if (d === 0) { + d = radius * radius * 2; + } + tmp[(y * dw) + x] = curState ? d : -d; + } + } + var res = this._context.createImageData(dw, dh); + var size = dw * dh; + for (var j = 0; j < size; j++) { + var d = tmp[j]; + var sign = (d < 0) ? -1 : 1; + d = Math.sqrt(Math.abs(d)) * sign; + d *= 127.5 / radius; + d += 127.5; + if (d < 0) { + d = 0; + } + else if (d > 255) { + d = 255; + } + d += 0.5; + res.data[j * 4 + 0] = d; + res.data[j * 4 + 1] = d; + res.data[j * 4 + 2] = d; + res.data[j * 4 + 3] = 255; + } + return res; + }; + FontTexture.prototype.measureText = function (text, tabulationSize) { + if (tabulationSize === void 0) { tabulationSize = 4; } + var maxWidth = 0; + var curWidth = 0; + var lineCount = 1; + var charxpos = 0; + // Parse each char of the string + for (var _i = 0, text_1 = text; _i < text_1.length; _i++) { + var char = text_1[_i]; + // Next line feed? + if (char === "\n") { + maxWidth = Math.max(maxWidth, curWidth); + charxpos = 0; + curWidth = 0; + ++lineCount; + continue; + } + // Tabulation ? + if (char === "\t") { + var nextPos = charxpos + tabulationSize; + nextPos = nextPos - (nextPos % tabulationSize); + curWidth += (nextPos - charxpos) * this.spaceWidth; + charxpos = nextPos; + continue; + } + if (char < " ") { + continue; + } + curWidth += this.getChar(char).charWidth; + ++charxpos; + } + maxWidth = Math.max(maxWidth, curWidth); + return new BABYLON.Size(maxWidth, lineCount * this.lineHeight); + }; + FontTexture.prototype.getSuperSampleFont = function (font) { + // Eternal thank to http://stackoverflow.com/a/10136041/802124 + var regex = /^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-,\"\sa-z]+?)\s*$/; + var res = font.toLocaleLowerCase().match(regex); + if (res == null) { + return null; + } + var size = parseInt(res[4]); + res[4] = (size * 2).toString() + (res[4].match(/\D+/) || []).pop(); + var newFont = ""; + for (var j = 1; j < res.length; j++) { + if (res[j] != null) { + newFont += res[j] + " "; + } + } + return newFont; + }; + // More info here: https://videlais.com/2014/03/16/the-many-and-varied-problems-with-measuring-font-height-for-html5-canvas/ + FontTexture.prototype.getFontHeight = function (font) { + var fontDraw = document.createElement("canvas"); + var ctx = fontDraw.getContext('2d'); + ctx.fillRect(0, 0, fontDraw.width, fontDraw.height); + ctx.textBaseline = 'top'; + ctx.fillStyle = 'white'; + ctx.font = font; + ctx.fillText('jH|', 0, 0); + var pixels = ctx.getImageData(0, 0, fontDraw.width, fontDraw.height).data; + var start = -1; + var end = -1; + for (var row = 0; row < fontDraw.height; row++) { + for (var column = 0; column < fontDraw.width; column++) { + var index = (row * fontDraw.width + column) * 4; + if (pixels[index] === 0) { + if (column === fontDraw.width - 1 && start !== -1) { + end = row; + row = fontDraw.height; + break; + } + continue; + } + else { + if (start === -1) { + start = row; + } + break; + } + } + } + return { height: (end - start) + 1, offset: start - 1 }; + }; + Object.defineProperty(FontTexture.prototype, "canRescale", { + get: function () { + return false; + }, + enumerable: true, + configurable: true + }); + FontTexture.prototype.getContext = function () { + return this._context; + }; + /** + * Call this method when you've call getChar() at least one time, this will update the texture if needed. + * Don't be afraid to call it, if no new character was added, this method simply does nothing. + */ + FontTexture.prototype.update = function () { + // Update only if there's new char added since the previous update + if (this._lastUpdateCharCount < this._curCharCount) { + this.getScene().getEngine().updateDynamicTexture(this._texture, this._canvas, false, true); + this._lastUpdateCharCount = this._curCharCount; + } + }; + // cloning should be prohibited, there's no point to duplicate this texture at all + FontTexture.prototype.clone = function () { + return null; + }; + /** + * For FontTexture retrieved using GetCachedFontTexture, use this method when you transfer this object's lifetime to another party in order to share this resource. + * When the other party is done with this object, decCachedFontTextureCounter must be called. + */ + FontTexture.prototype.incCachedFontTextureCounter = function () { + ++this._usedCounter; + }; + /** + * Use this method only in conjunction with incCachedFontTextureCounter, call it when you no longer need to use this shared resource. + */ + FontTexture.prototype.decCachedFontTextureCounter = function () { + var s = this.getScene(); + var dic = s.__fontTextureCache__; + if (!dic) { + return; + } + if (--this._usedCounter === 0) { + dic.remove(this._cachedFontId); + this.dispose(); + } + }; + return FontTexture; + }(BABYLON.Texture)); + BABYLON.FontTexture = FontTexture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.fontTexture.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var MapTexture = (function (_super) { + __extends(MapTexture, _super); + function MapTexture(name, scene, size, samplingMode, useMipMap) { + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + if (useMipMap === void 0) { useMipMap = false; } + _super.call(this, null, scene, !useMipMap, false, samplingMode); + this.name = name; + this._size = size; + this.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; + this.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; + // Create the rectPackMap that will allocate portion of the texture + this._rectPackingMap = new BABYLON.RectPackingMap(new BABYLON.Size(size.width, size.height)); + // Create the texture that will store the content + this._texture = scene.getEngine().createRenderTargetTexture(size, { generateMipMaps: !this.noMipmap, type: BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT }); + } + /** + * Allocate a rectangle of a given size in the texture map + * @param size the size of the rectangle to allocation + * @return the PackedRect instance corresponding to the allocated rect or null is there was not enough space to allocate it. + */ + MapTexture.prototype.allocateRect = function (size) { + return this._rectPackingMap.addRect(size); + }; + /** + * Free a given rectangle from the texture map + * @param rectInfo the instance corresponding to the rect to free. + */ + MapTexture.prototype.freeRect = function (rectInfo) { + if (rectInfo) { + rectInfo.freeContent(); + } + }; + Object.defineProperty(MapTexture.prototype, "freeSpace", { + /** + * Return the available space in the range of [O;1]. 0 being not space left at all, 1 being an empty texture map. + * This is the cumulated space, not the biggest available surface. Due to fragmentation you may not allocate a rect corresponding to this surface. + * @returns {} + */ + get: function () { + return this._rectPackingMap.freeSpace; + }, + enumerable: true, + configurable: true + }); + /** + * Bind the texture to the rendering engine to render in the zone of a given rectangle. + * Use this method when you want to render into the texture map with a clipspace set to the location and size of the given rect. + * Don't forget to call unbindTexture when you're done rendering + * @param rect the zone to render to + * @param clear true to clear the portion's color/depth data + */ + MapTexture.prototype.bindTextureForRect = function (rect, clear) { + return this.bindTextureForPosSize(rect.pos, rect.contentSize, clear); + }; + /** + * Bind the texture to the rendering engine to render in the zone of the given size at the given position. + * Use this method when you want to render into the texture map with a clipspace set to the location and size of the given rect. + * Don't forget to call unbindTexture when you're done rendering + * @param pos the position into the texture + * @param size the portion to fit the clip space to + * @param clear true to clear the portion's color/depth data + */ + MapTexture.prototype.bindTextureForPosSize = function (pos, size, clear) { + var engine = this.getScene().getEngine(); + engine.bindFramebuffer(this._texture); + this._replacedViewport = engine.setDirectViewport(pos.x, pos.y, size.width, size.height); + if (clear) { + // We only want to clear the part of the texture we're binding to, only the scissor can help us to achieve that + engine.scissorClear(pos.x, pos.y, size.width, size.height, new BABYLON.Color4(0, 0, 0, 0)); + } + }; + /** + * Unbind the texture map from the rendering engine. + * Call this method when you're done rendering. A previous call to bindTextureForRect has to be made. + * @param dumpForDebug if set to true the content of the texture map will be dumped to a picture file that will be sent to the internet browser. + */ + MapTexture.prototype.unbindTexture = function (dumpForDebug) { + // Dump ? + if (dumpForDebug) { + BABYLON.Tools.DumpFramebuffer(this._size.width, this._size.height, this.getScene().getEngine()); + } + var engine = this.getScene().getEngine(); + if (this._replacedViewport) { + engine.setViewport(this._replacedViewport); + this._replacedViewport = null; + } + engine.unBindFramebuffer(this._texture); + }; + Object.defineProperty(MapTexture.prototype, "canRescale", { + get: function () { + return false; + }, + enumerable: true, + configurable: true + }); + // Note, I don't know what behavior this method should have: clone the underlying texture/rectPackingMap or just reference them? + // Anyway, there's not much point to use this method for this kind of texture I guess + MapTexture.prototype.clone = function () { + return null; + }; + return MapTexture; + }(BABYLON.Texture)); + BABYLON.MapTexture = MapTexture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.mapTexture.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var ShaderMaterial = (function (_super) { + __extends(ShaderMaterial, _super); + function ShaderMaterial(name, scene, shaderPath, options) { + _super.call(this, name, scene); + this._textures = {}; + this._textureArrays = {}; + this._floats = {}; + this._floatsArrays = {}; + this._colors3 = {}; + this._colors4 = {}; + this._vectors2 = {}; + this._vectors3 = {}; + this._vectors4 = {}; + this._matrices = {}; + this._matrices3x3 = {}; + this._matrices2x2 = {}; + this._vectors3Arrays = {}; + this._cachedWorldViewMatrix = new BABYLON.Matrix(); + this._shaderPath = shaderPath; + options.needAlphaBlending = options.needAlphaBlending || false; + options.needAlphaTesting = options.needAlphaTesting || false; + options.attributes = options.attributes || ["position", "normal", "uv"]; + options.uniforms = options.uniforms || ["worldViewProjection"]; + options.samplers = options.samplers || []; + options.defines = options.defines || []; + this._options = options; + } + ShaderMaterial.prototype.needAlphaBlending = function () { + return this._options.needAlphaBlending; + }; + ShaderMaterial.prototype.needAlphaTesting = function () { + return this._options.needAlphaTesting; + }; + ShaderMaterial.prototype._checkUniform = function (uniformName) { + if (this._options.uniforms.indexOf(uniformName) === -1) { + this._options.uniforms.push(uniformName); + } + }; + ShaderMaterial.prototype.setTexture = function (name, texture) { + if (this._options.samplers.indexOf(name) === -1) { + this._options.samplers.push(name); + } + this._textures[name] = texture; + return this; + }; + ShaderMaterial.prototype.setTextureArray = function (name, textures) { + if (this._options.samplers.indexOf(name) === -1) { + this._options.samplers.push(name); + } + this._checkUniform(name); + this._textureArrays[name] = textures; + return this; + }; + ShaderMaterial.prototype.setFloat = function (name, value) { + this._checkUniform(name); + this._floats[name] = value; + return this; + }; + ShaderMaterial.prototype.setFloats = function (name, value) { + this._checkUniform(name); + this._floatsArrays[name] = value; + return this; + }; + ShaderMaterial.prototype.setColor3 = function (name, value) { + this._checkUniform(name); + this._colors3[name] = value; + return this; + }; + ShaderMaterial.prototype.setColor4 = function (name, value) { + this._checkUniform(name); + this._colors4[name] = value; + return this; + }; + ShaderMaterial.prototype.setVector2 = function (name, value) { + this._checkUniform(name); + this._vectors2[name] = value; + return this; + }; + ShaderMaterial.prototype.setVector3 = function (name, value) { + this._checkUniform(name); + this._vectors3[name] = value; + return this; + }; + ShaderMaterial.prototype.setVector4 = function (name, value) { + this._checkUniform(name); + this._vectors4[name] = value; + return this; + }; + ShaderMaterial.prototype.setMatrix = function (name, value) { + this._checkUniform(name); + this._matrices[name] = value; + return this; + }; + ShaderMaterial.prototype.setMatrix3x3 = function (name, value) { + this._checkUniform(name); + this._matrices3x3[name] = value; + return this; + }; + ShaderMaterial.prototype.setMatrix2x2 = function (name, value) { + this._checkUniform(name); + this._matrices2x2[name] = value; + return this; + }; + ShaderMaterial.prototype.setArray3 = function (name, value) { + this._checkUniform(name); + this._vectors3Arrays[name] = value; + return this; + }; + ShaderMaterial.prototype._checkCache = function (scene, mesh, useInstances) { + if (!mesh) { + return true; + } + if (this._effect && (this._effect.defines.indexOf("#define INSTANCES") !== -1) !== useInstances) { + return false; + } + return false; + }; + ShaderMaterial.prototype.isReady = function (mesh, useInstances) { + var scene = this.getScene(); + var engine = scene.getEngine(); + if (!this.checkReadyOnEveryCall) { + if (this._renderId === scene.getRenderId()) { + if (this._checkCache(scene, mesh, useInstances)) { + return true; + } + } + } + // Instances + var defines = []; + var fallbacks = new BABYLON.EffectFallbacks(); + if (useInstances) { + defines.push("#define INSTANCES"); + } + for (var index = 0; index < this._options.defines.length; index++) { + defines.push(this._options.defines[index]); + } + // Bones + if (mesh && mesh.useBones && mesh.computeBonesUsingShaders) { + defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers); + defines.push("#define BonesPerMesh " + (mesh.skeleton.bones.length + 1)); + fallbacks.addCPUSkinningFallback(0, mesh); + } + // Alpha test + if (engine.getAlphaTesting()) { + defines.push("#define ALPHATEST"); + } + var previousEffect = this._effect; + var join = defines.join("\n"); + this._effect = engine.createEffect(this._shaderPath, this._options.attributes, this._options.uniforms, this._options.samplers, join, fallbacks, this.onCompiled, this.onError); + if (!this._effect.isReady()) { + return false; + } + if (previousEffect !== this._effect) { + scene.resetCachedMaterial(); + } + this._renderId = scene.getRenderId(); + return true; + }; + ShaderMaterial.prototype.bindOnlyWorldMatrix = function (world) { + var scene = this.getScene(); + if (this._options.uniforms.indexOf("world") !== -1) { + this._effect.setMatrix("world", world); + } + if (this._options.uniforms.indexOf("worldView") !== -1) { + world.multiplyToRef(scene.getViewMatrix(), this._cachedWorldViewMatrix); + this._effect.setMatrix("worldView", this._cachedWorldViewMatrix); + } + if (this._options.uniforms.indexOf("worldViewProjection") !== -1) { + this._effect.setMatrix("worldViewProjection", world.multiply(scene.getTransformMatrix())); + } + }; + ShaderMaterial.prototype.bind = function (world, mesh) { + // Std values + this.bindOnlyWorldMatrix(world); + if (this.getScene().getCachedMaterial() !== this) { + if (this._options.uniforms.indexOf("view") !== -1) { + this._effect.setMatrix("view", this.getScene().getViewMatrix()); + } + if (this._options.uniforms.indexOf("projection") !== -1) { + this._effect.setMatrix("projection", this.getScene().getProjectionMatrix()); + } + if (this._options.uniforms.indexOf("viewProjection") !== -1) { + this._effect.setMatrix("viewProjection", this.getScene().getTransformMatrix()); + } + // Bones + BABYLON.MaterialHelper.BindBonesParameters(mesh, this._effect); + var name; + // Texture + for (name in this._textures) { + this._effect.setTexture(name, this._textures[name]); + } + // Texture arrays + for (name in this._textureArrays) { + this._effect.setTextureArray(name, this._textureArrays[name]); + } + // Float + for (name in this._floats) { + this._effect.setFloat(name, this._floats[name]); + } + // Float s + for (name in this._floatsArrays) { + this._effect.setArray(name, this._floatsArrays[name]); + } + // Color3 + for (name in this._colors3) { + this._effect.setColor3(name, this._colors3[name]); + } + // Color4 + for (name in this._colors4) { + var color = this._colors4[name]; + this._effect.setFloat4(name, color.r, color.g, color.b, color.a); + } + // Vector2 + for (name in this._vectors2) { + this._effect.setVector2(name, this._vectors2[name]); + } + // Vector3 + for (name in this._vectors3) { + this._effect.setVector3(name, this._vectors3[name]); + } + // Vector4 + for (name in this._vectors4) { + this._effect.setVector4(name, this._vectors4[name]); + } + // Matrix + for (name in this._matrices) { + this._effect.setMatrix(name, this._matrices[name]); + } + // Matrix 3x3 + for (name in this._matrices3x3) { + this._effect.setMatrix3x3(name, this._matrices3x3[name]); + } + // Matrix 2x2 + for (name in this._matrices2x2) { + this._effect.setMatrix2x2(name, this._matrices2x2[name]); + } + // Vector3Array + for (name in this._vectors3Arrays) { + this._effect.setArray3(name, this._vectors3Arrays[name]); + } + } + _super.prototype.bind.call(this, world, mesh); + }; + ShaderMaterial.prototype.clone = function (name) { + var newShaderMaterial = new ShaderMaterial(name, this.getScene(), this._shaderPath, this._options); + return newShaderMaterial; + }; + ShaderMaterial.prototype.dispose = function (forceDisposeEffect, forceDisposeTextures) { + if (forceDisposeTextures) { + var name; + for (name in this._textures) { + this._textures[name].dispose(); + } + for (name in this._textureArrays) { + var array = this._textureArrays[name]; + for (var index = 0; index < array.length; index++) { + array[index].dispose(); + } + } + } + this._textures = {}; + _super.prototype.dispose.call(this, forceDisposeEffect, forceDisposeTextures); + }; + ShaderMaterial.prototype.serialize = function () { + var serializationObject = BABYLON.SerializationHelper.Serialize(this); + serializationObject.customType = "BABYLON.ShaderMaterial"; + serializationObject.options = this._options; + serializationObject.shaderPath = this._shaderPath; + var name; + // Texture + serializationObject.textures = {}; + for (name in this._textures) { + serializationObject.textures[name] = this._textures[name].serialize(); + } + // Texture arrays + serializationObject.textureArrays = {}; + for (name in this._textureArrays) { + serializationObject.textureArrays[name] = []; + var array = this._textureArrays[name]; + for (var index = 0; index < array.length; index++) { + serializationObject.textureArrays[name].push(array[index].serialize()); + } + } + // Float + serializationObject.floats = {}; + for (name in this._floats) { + serializationObject.floats[name] = this._floats[name]; + } + // Float s + serializationObject.floatArrays = {}; + for (name in this._floatsArrays) { + serializationObject.floatArrays[name] = this._floatsArrays[name]; + } + // Color3 + serializationObject.colors3 = {}; + for (name in this._colors3) { + serializationObject.colors3[name] = this._colors3[name].asArray(); + } + // Color4 + serializationObject.colors4 = {}; + for (name in this._colors4) { + serializationObject.colors4[name] = this._colors4[name].asArray(); + } + // Vector2 + serializationObject.vectors2 = {}; + for (name in this._vectors2) { + serializationObject.vectors2[name] = this._vectors2[name].asArray(); + } + // Vector3 + serializationObject.vectors3 = {}; + for (name in this._vectors3) { + serializationObject.vectors3[name] = this._vectors3[name].asArray(); + } + // Vector4 + serializationObject.vectors4 = {}; + for (name in this._vectors4) { + serializationObject.vectors4[name] = this._vectors4[name].asArray(); + } + // Matrix + serializationObject.matrices = {}; + for (name in this._matrices) { + serializationObject.matrices[name] = this._matrices[name].asArray(); + } + // Matrix 3x3 + serializationObject.matrices3x3 = {}; + for (name in this._matrices3x3) { + serializationObject.matrices3x3[name] = this._matrices3x3[name]; + } + // Matrix 2x2 + serializationObject.matrices2x2 = {}; + for (name in this._matrices2x2) { + serializationObject.matrices2x2[name] = this._matrices2x2[name]; + } + // Vector3Array + serializationObject.vectors3Arrays = {}; + for (name in this._vectors3Arrays) { + serializationObject.vectors3Arrays[name] = this._vectors3Arrays[name]; + } + return serializationObject; + }; + ShaderMaterial.Parse = function (source, scene, rootUrl) { + var material = BABYLON.SerializationHelper.Parse(function () { return new ShaderMaterial(source.name, scene, source.shaderPath, source.options); }, source, scene, rootUrl); + var name; + // Texture + for (name in source.textures) { + material.setTexture(name, BABYLON.Texture.Parse(source.textures[name], scene, rootUrl)); + } + // Texture arrays + for (name in source.textureArrays) { + var array = source.textureArrays[name]; + var textureArray = new Array(); + for (var index = 0; index < array.length; index++) { + textureArray.push(BABYLON.Texture.Parse(array[index], scene, rootUrl)); + } + material.setTextureArray(name, textureArray); + } + // Float + for (name in source.floats) { + material.setFloat(name, source.floats[name]); + } + // Float s + for (name in source.floatsArrays) { + material.setFloats(name, source.floatsArrays[name]); + } + // Color3 + for (name in source.colors3) { + material.setColor3(name, BABYLON.Color3.FromArray(source.colors3[name])); + } + // Color4 + for (name in source.colors4) { + material.setColor4(name, BABYLON.Color4.FromArray(source.colors4[name])); + } + // Vector2 + for (name in source.vectors2) { + material.setVector2(name, BABYLON.Vector2.FromArray(source.vectors2[name])); + } + // Vector3 + for (name in source.vectors3) { + material.setVector3(name, BABYLON.Vector3.FromArray(source.vectors3[name])); + } + // Vector4 + for (name in source.vectors4) { + material.setVector4(name, BABYLON.Vector4.FromArray(source.vectors4[name])); + } + // Matrix + for (name in source.matrices) { + material.setMatrix(name, BABYLON.Matrix.FromArray(source.matrices[name])); + } + // Matrix 3x3 + for (name in source.matrices3x3) { + material.setMatrix3x3(name, source.matrices3x3[name]); + } + // Matrix 2x2 + for (name in source.matrices2x2) { + material.setMatrix2x2(name, source.matrices2x2[name]); + } + // Vector3Array + for (name in source.vectors3Arrays) { + material.setArray3(name, source.vectors3Arrays[name]); + } + return material; + }; + return ShaderMaterial; + }(BABYLON.Material)); + BABYLON.ShaderMaterial = ShaderMaterial; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.shaderMaterial.js.map + +var BABYLON; +(function (BABYLON) { + var Internals; + (function (Internals) { + // Based on demo done by Brandon Jones - http://media.tojicode.com/webgl-samples/dds.html + // All values and structures referenced from: + // http://msdn.microsoft.com/en-us/library/bb943991.aspx/ + var DDS_MAGIC = 0x20534444; + var DDSD_CAPS = 0x1, DDSD_HEIGHT = 0x2, DDSD_WIDTH = 0x4, DDSD_PITCH = 0x8, DDSD_PIXELFORMAT = 0x1000, DDSD_MIPMAPCOUNT = 0x20000, DDSD_LINEARSIZE = 0x80000, DDSD_DEPTH = 0x800000; + var DDSCAPS_COMPLEX = 0x8, DDSCAPS_MIPMAP = 0x400000, DDSCAPS_TEXTURE = 0x1000; + var DDSCAPS2_CUBEMAP = 0x200, DDSCAPS2_CUBEMAP_POSITIVEX = 0x400, DDSCAPS2_CUBEMAP_NEGATIVEX = 0x800, DDSCAPS2_CUBEMAP_POSITIVEY = 0x1000, DDSCAPS2_CUBEMAP_NEGATIVEY = 0x2000, DDSCAPS2_CUBEMAP_POSITIVEZ = 0x4000, DDSCAPS2_CUBEMAP_NEGATIVEZ = 0x8000, DDSCAPS2_VOLUME = 0x200000; + var DDPF_ALPHAPIXELS = 0x1, DDPF_ALPHA = 0x2, DDPF_FOURCC = 0x4, DDPF_RGB = 0x40, DDPF_YUV = 0x200, DDPF_LUMINANCE = 0x20000; + function FourCCToInt32(value) { + return value.charCodeAt(0) + + (value.charCodeAt(1) << 8) + + (value.charCodeAt(2) << 16) + + (value.charCodeAt(3) << 24); + } + function Int32ToFourCC(value) { + return String.fromCharCode(value & 0xff, (value >> 8) & 0xff, (value >> 16) & 0xff, (value >> 24) & 0xff); + } + var FOURCC_DXT1 = FourCCToInt32("DXT1"); + var FOURCC_DXT3 = FourCCToInt32("DXT3"); + var FOURCC_DXT5 = FourCCToInt32("DXT5"); + var headerLengthInt = 31; // The header length in 32 bit ints + // Offsets into the header array + var off_magic = 0; + var off_size = 1; + var off_flags = 2; + var off_height = 3; + var off_width = 4; + var off_mipmapCount = 7; + var off_pfFlags = 20; + var off_pfFourCC = 21; + var off_RGBbpp = 22; + var off_RMask = 23; + var off_GMask = 24; + var off_BMask = 25; + var off_AMask = 26; + var off_caps1 = 27; + var off_caps2 = 28; + ; + var DDSTools = (function () { + function DDSTools() { + } + DDSTools.GetDDSInfo = function (arrayBuffer) { + var header = new Int32Array(arrayBuffer, 0, headerLengthInt); + var mipmapCount = 1; + if (header[off_flags] & DDSD_MIPMAPCOUNT) { + mipmapCount = Math.max(1, header[off_mipmapCount]); + } + return { + width: header[off_width], + height: header[off_height], + mipmapCount: mipmapCount, + isFourCC: (header[off_pfFlags] & DDPF_FOURCC) === DDPF_FOURCC, + isRGB: (header[off_pfFlags] & DDPF_RGB) === DDPF_RGB, + isLuminance: (header[off_pfFlags] & DDPF_LUMINANCE) === DDPF_LUMINANCE, + isCube: (header[off_caps2] & DDSCAPS2_CUBEMAP) === DDSCAPS2_CUBEMAP + }; + }; + DDSTools.GetRGBAArrayBuffer = function (width, height, dataOffset, dataLength, arrayBuffer) { + var byteArray = new Uint8Array(dataLength); + var srcData = new Uint8Array(arrayBuffer); + var index = 0; + for (var y = height - 1; y >= 0; y--) { + for (var x = 0; x < width; x++) { + var srcPos = dataOffset + (x + y * width) * 4; + byteArray[index + 2] = srcData[srcPos]; + byteArray[index + 1] = srcData[srcPos + 1]; + byteArray[index] = srcData[srcPos + 2]; + byteArray[index + 3] = srcData[srcPos + 3]; + index += 4; + } + } + return byteArray; + }; + DDSTools.GetRGBArrayBuffer = function (width, height, dataOffset, dataLength, arrayBuffer) { + var byteArray = new Uint8Array(dataLength); + var srcData = new Uint8Array(arrayBuffer); + var index = 0; + for (var y = height - 1; y >= 0; y--) { + for (var x = 0; x < width; x++) { + var srcPos = dataOffset + (x + y * width) * 3; + byteArray[index + 2] = srcData[srcPos]; + byteArray[index + 1] = srcData[srcPos + 1]; + byteArray[index] = srcData[srcPos + 2]; + index += 3; + } + } + return byteArray; + }; + DDSTools.GetLuminanceArrayBuffer = function (width, height, dataOffset, dataLength, arrayBuffer) { + var byteArray = new Uint8Array(dataLength); + var srcData = new Uint8Array(arrayBuffer); + var index = 0; + for (var y = height - 1; y >= 0; y--) { + for (var x = 0; x < width; x++) { + var srcPos = dataOffset + (x + y * width); + byteArray[index] = srcData[srcPos]; + index++; + } + } + return byteArray; + }; + DDSTools.UploadDDSLevels = function (gl, ext, arrayBuffer, info, loadMipmaps, faces) { + var header = new Int32Array(arrayBuffer, 0, headerLengthInt), fourCC, blockBytes, internalFormat, width, height, dataLength, dataOffset, byteArray, mipmapCount, i; + if (header[off_magic] != DDS_MAGIC) { + BABYLON.Tools.Error("Invalid magic number in DDS header"); + return; + } + if (!info.isFourCC && !info.isRGB && !info.isLuminance) { + BABYLON.Tools.Error("Unsupported format, must contain a FourCC, RGB or LUMINANCE code"); + return; + } + if (info.isFourCC) { + fourCC = header[off_pfFourCC]; + switch (fourCC) { + case FOURCC_DXT1: + blockBytes = 8; + internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT1_EXT; + break; + case FOURCC_DXT3: + blockBytes = 16; + internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT3_EXT; + break; + case FOURCC_DXT5: + blockBytes = 16; + internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT5_EXT; + break; + default: + console.error("Unsupported FourCC code:", Int32ToFourCC(fourCC)); + return; + } + } + mipmapCount = 1; + if (header[off_flags] & DDSD_MIPMAPCOUNT && loadMipmaps !== false) { + mipmapCount = Math.max(1, header[off_mipmapCount]); + } + var bpp = header[off_RGBbpp]; + for (var face = 0; face < faces; face++) { + var sampler = faces === 1 ? gl.TEXTURE_2D : (gl.TEXTURE_CUBE_MAP_POSITIVE_X + face); + width = header[off_width]; + height = header[off_height]; + dataOffset = header[off_size] + 4; + for (i = 0; i < mipmapCount; ++i) { + if (info.isRGB) { + if (bpp === 24) { + dataLength = width * height * 3; + byteArray = DDSTools.GetRGBArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer); + gl.texImage2D(sampler, i, gl.RGB, width, height, 0, gl.RGB, gl.UNSIGNED_BYTE, byteArray); + } + else { + dataLength = width * height * 4; + byteArray = DDSTools.GetRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer); + gl.texImage2D(sampler, i, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, byteArray); + } + } + else if (info.isLuminance) { + var unpackAlignment = gl.getParameter(gl.UNPACK_ALIGNMENT); + var unpaddedRowSize = width; + var paddedRowSize = Math.floor((width + unpackAlignment - 1) / unpackAlignment) * unpackAlignment; + dataLength = paddedRowSize * (height - 1) + unpaddedRowSize; + byteArray = DDSTools.GetLuminanceArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer); + gl.texImage2D(sampler, i, gl.LUMINANCE, width, height, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, byteArray); + } + else { + dataLength = Math.max(4, width) / 4 * Math.max(4, height) / 4 * blockBytes; + byteArray = new Uint8Array(arrayBuffer, dataOffset, dataLength); + gl.compressedTexImage2D(sampler, i, internalFormat, width, height, 0, byteArray); + } + dataOffset += dataLength; + width *= 0.5; + height *= 0.5; + width = Math.max(1.0, width); + height = Math.max(1.0, height); + } + } + }; + return DDSTools; + }()); + Internals.DDSTools = DDSTools; + })(Internals = BABYLON.Internals || (BABYLON.Internals = {})); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.tools.dds.js.map + +var BABYLON; +(function (BABYLON) { + var CannonJSPlugin = (function () { + function CannonJSPlugin(_useDeltaForWorldStep, iterations) { + if (_useDeltaForWorldStep === void 0) { _useDeltaForWorldStep = true; } + if (iterations === void 0) { iterations = 10; } + this._useDeltaForWorldStep = _useDeltaForWorldStep; + this.name = "CannonJSPlugin"; + this._physicsMaterials = []; + this._fixedTimeStep = 1 / 60; + //See https://github.com/schteppe/cannon.js/blob/gh-pages/demos/collisionFilter.html + this._currentCollisionGroup = 2; + this._minus90X = new BABYLON.Quaternion(-0.7071067811865475, 0, 0, 0.7071067811865475); + this._plus90X = new BABYLON.Quaternion(0.7071067811865475, 0, 0, 0.7071067811865475); + this._tmpPosition = BABYLON.Vector3.Zero(); + this._tmpQuaternion = new BABYLON.Quaternion(); + this._tmpDeltaPosition = BABYLON.Vector3.Zero(); + this._tmpDeltaRotation = new BABYLON.Quaternion(); + this._tmpUnityRotation = new BABYLON.Quaternion(); + if (!this.isSupported()) { + BABYLON.Tools.Error("CannonJS is not available. Please make sure you included the js file."); + return; + } + this.world = new CANNON.World(); + this.world.broadphase = new CANNON.NaiveBroadphase(); + this.world.solver.iterations = iterations; + } + CannonJSPlugin.prototype.setGravity = function (gravity) { + this.world.gravity.copy(gravity); + }; + CannonJSPlugin.prototype.setTimeStep = function (timeStep) { + this._fixedTimeStep = timeStep; + }; + CannonJSPlugin.prototype.executeStep = function (delta, impostors) { + this.world.step(this._fixedTimeStep, this._useDeltaForWorldStep ? delta * 1000 : 0, 3); + }; + CannonJSPlugin.prototype.applyImpulse = function (impostor, force, contactPoint) { + var worldPoint = new CANNON.Vec3(contactPoint.x, contactPoint.y, contactPoint.z); + var impulse = new CANNON.Vec3(force.x, force.y, force.z); + impostor.physicsBody.applyImpulse(impulse, worldPoint); + }; + CannonJSPlugin.prototype.applyForce = function (impostor, force, contactPoint) { + var worldPoint = new CANNON.Vec3(contactPoint.x, contactPoint.y, contactPoint.z); + var impulse = new CANNON.Vec3(force.x, force.y, force.z); + impostor.physicsBody.applyImpulse(impulse, worldPoint); + }; + CannonJSPlugin.prototype.generatePhysicsBody = function (impostor) { + //parent-child relationship. Does this impostor has a parent impostor? + if (impostor.parent) { + if (impostor.physicsBody) { + this.removePhysicsBody(impostor); + //TODO is that needed? + impostor.forceUpdate(); + } + return; + } + //should a new body be created for this impostor? + if (impostor.isBodyInitRequired()) { + var shape = this._createShape(impostor); + //unregister events, if body is being changed + var oldBody = impostor.physicsBody; + if (oldBody) { + this.removePhysicsBody(impostor); + } + //create the body and material + var material = this._addMaterial("mat-" + impostor.uniqueId, impostor.getParam("friction"), impostor.getParam("restitution")); + var bodyCreationObject = { + mass: impostor.getParam("mass"), + material: material + }; + // A simple extend, in case native options were used. + var nativeOptions = impostor.getParam("nativeOptions"); + for (var key in nativeOptions) { + if (nativeOptions.hasOwnProperty(key)) { + bodyCreationObject[key] = nativeOptions[key]; + } + } + impostor.physicsBody = new CANNON.Body(bodyCreationObject); + impostor.physicsBody.addEventListener("collide", impostor.onCollide); + this.world.addEventListener("preStep", impostor.beforeStep); + this.world.addEventListener("postStep", impostor.afterStep); + impostor.physicsBody.addShape(shape); + this.world.add(impostor.physicsBody); + //try to keep the body moving in the right direction by taking old properties. + //Should be tested! + if (oldBody) { + ['force', 'torque', 'velocity', 'angularVelocity'].forEach(function (param) { + impostor.physicsBody[param].copy(oldBody[param]); + }); + } + this._processChildMeshes(impostor); + } + //now update the body's transformation + this._updatePhysicsBodyTransformation(impostor); + }; + CannonJSPlugin.prototype._processChildMeshes = function (mainImpostor) { + var _this = this; + var meshChildren = mainImpostor.object.getChildMeshes ? mainImpostor.object.getChildMeshes() : []; + if (meshChildren.length) { + var processMesh = function (localPosition, mesh) { + var childImpostor = mesh.getPhysicsImpostor(); + if (childImpostor) { + var parent = childImpostor.parent; + if (parent !== mainImpostor) { + var localPosition = mesh.position; + if (childImpostor.physicsBody) { + _this.removePhysicsBody(childImpostor); + childImpostor.physicsBody = null; + } + childImpostor.parent = mainImpostor; + childImpostor.resetUpdateFlags(); + mainImpostor.physicsBody.addShape(_this._createShape(childImpostor), new CANNON.Vec3(localPosition.x, localPosition.y, localPosition.z)); + //Add the mass of the children. + mainImpostor.physicsBody.mass += childImpostor.getParam("mass"); + } + } + mesh.getChildMeshes().forEach(processMesh.bind(_this, mesh.position)); + }; + meshChildren.forEach(processMesh.bind(this, BABYLON.Vector3.Zero())); + } + }; + CannonJSPlugin.prototype.removePhysicsBody = function (impostor) { + impostor.physicsBody.removeEventListener("collide", impostor.onCollide); + this.world.removeEventListener("preStep", impostor.beforeStep); + this.world.removeEventListener("postStep", impostor.afterStep); + this.world.remove(impostor.physicsBody); + }; + CannonJSPlugin.prototype.generateJoint = function (impostorJoint) { + var mainBody = impostorJoint.mainImpostor.physicsBody; + var connectedBody = impostorJoint.connectedImpostor.physicsBody; + if (!mainBody || !connectedBody) { + return; + } + var constraint; + var jointData = impostorJoint.joint.jointData; + //TODO - https://github.com/schteppe/cannon.js/blob/gh-pages/demos/collisionFilter.html + var constraintData = { + pivotA: jointData.mainPivot ? new CANNON.Vec3().copy(jointData.mainPivot) : null, + pivotB: jointData.connectedPivot ? new CANNON.Vec3().copy(jointData.connectedPivot) : null, + axisA: jointData.mainAxis ? new CANNON.Vec3().copy(jointData.mainAxis) : null, + axisB: jointData.connectedAxis ? new CANNON.Vec3().copy(jointData.connectedAxis) : null, + maxForce: jointData.nativeParams.maxForce, + collideConnected: !!jointData.collision + }; + //Not needed, Cannon has a collideConnected flag + /*if (!jointData.collision) { + //add 1st body to a collision group of its own, if it is not in 1 + if (mainBody.collisionFilterGroup === 1) { + mainBody.collisionFilterGroup = this._currentCollisionGroup; + this._currentCollisionGroup <<= 1; + } + if (connectedBody.collisionFilterGroup === 1) { + connectedBody.collisionFilterGroup = this._currentCollisionGroup; + this._currentCollisionGroup <<= 1; + } + //add their mask to the collisionFilterMask of each other: + connectedBody.collisionFilterMask = connectedBody.collisionFilterMask | ~mainBody.collisionFilterGroup; + mainBody.collisionFilterMask = mainBody.collisionFilterMask | ~connectedBody.collisionFilterGroup; + }*/ + switch (impostorJoint.joint.type) { + case BABYLON.PhysicsJoint.HingeJoint: + case BABYLON.PhysicsJoint.Hinge2Joint: + constraint = new CANNON.HingeConstraint(mainBody, connectedBody, constraintData); + break; + case BABYLON.PhysicsJoint.DistanceJoint: + constraint = new CANNON.DistanceConstraint(mainBody, connectedBody, jointData.maxDistance || 2); + break; + case BABYLON.PhysicsJoint.SpringJoint: + var springData = jointData; + constraint = new CANNON.Spring(mainBody, connectedBody, { + restLength: springData.length, + stiffness: springData.stiffness, + damping: springData.damping, + localAnchorA: constraintData.pivotA, + localAnchorB: constraintData.pivotB + }); + break; + case BABYLON.PhysicsJoint.LockJoint: + constraint = new CANNON.LockConstraint(mainBody, connectedBody, constraintData); + break; + case BABYLON.PhysicsJoint.PointToPointJoint: + case BABYLON.PhysicsJoint.BallAndSocketJoint: + default: + constraint = new CANNON.PointToPointConstraint(mainBody, constraintData.pivotA, connectedBody, constraintData.pivotA, constraintData.maxForce); + break; + } + //set the collideConnected flag after the creation, since DistanceJoint ignores it. + constraint.collideConnected = !!jointData.collision; + impostorJoint.joint.physicsJoint = constraint; + //don't add spring as constraint, as it is not one. + if (impostorJoint.joint.type !== BABYLON.PhysicsJoint.SpringJoint) { + this.world.addConstraint(constraint); + } + else { + impostorJoint.mainImpostor.registerAfterPhysicsStep(function () { + constraint.applyForce(); + }); + } + }; + CannonJSPlugin.prototype.removeJoint = function (impostorJoint) { + this.world.removeConstraint(impostorJoint.joint.physicsJoint); + }; + CannonJSPlugin.prototype._addMaterial = function (name, friction, restitution) { + var index; + var mat; + for (index = 0; index < this._physicsMaterials.length; index++) { + mat = this._physicsMaterials[index]; + if (mat.friction === friction && mat.restitution === restitution) { + return mat; + } + } + var currentMat = new CANNON.Material(name); + currentMat.friction = friction; + currentMat.restitution = restitution; + this._physicsMaterials.push(currentMat); + return currentMat; + }; + CannonJSPlugin.prototype._checkWithEpsilon = function (value) { + return value < BABYLON.PhysicsEngine.Epsilon ? BABYLON.PhysicsEngine.Epsilon : value; + }; + CannonJSPlugin.prototype._createShape = function (impostor) { + var object = impostor.object; + var returnValue; + var extendSize = impostor.getObjectExtendSize(); + switch (impostor.type) { + case BABYLON.PhysicsEngine.SphereImpostor: + var radiusX = extendSize.x; + var radiusY = extendSize.y; + var radiusZ = extendSize.z; + returnValue = new CANNON.Sphere(Math.max(this._checkWithEpsilon(radiusX), this._checkWithEpsilon(radiusY), this._checkWithEpsilon(radiusZ)) / 2); + break; + //TMP also for cylinder - TODO Cannon supports cylinder natively. + case BABYLON.PhysicsImpostor.CylinderImpostor: + returnValue = new CANNON.Cylinder(this._checkWithEpsilon(extendSize.x) / 2, this._checkWithEpsilon(extendSize.x) / 2, this._checkWithEpsilon(extendSize.y), 16); + break; + case BABYLON.PhysicsImpostor.BoxImpostor: + var box = extendSize.scale(0.5); + returnValue = new CANNON.Box(new CANNON.Vec3(this._checkWithEpsilon(box.x), this._checkWithEpsilon(box.y), this._checkWithEpsilon(box.z))); + break; + case BABYLON.PhysicsImpostor.PlaneImpostor: + BABYLON.Tools.Warn("Attention, PlaneImposter might not behave as you expect. Consider using BoxImposter instead"); + returnValue = new CANNON.Plane(); + break; + case BABYLON.PhysicsImpostor.MeshImpostor: + var rawVerts = object.getVerticesData ? object.getVerticesData(BABYLON.VertexBuffer.PositionKind) : []; + var rawFaces = object.getIndices ? object.getIndices() : []; + BABYLON.Tools.Warn("MeshImpostor only collides against spheres."); + returnValue = new CANNON.Trimesh(rawVerts, rawFaces); + break; + case BABYLON.PhysicsImpostor.HeightmapImpostor: + returnValue = this._createHeightmap(object); + break; + case BABYLON.PhysicsImpostor.ParticleImpostor: + returnValue = new CANNON.Particle(); + break; + } + return returnValue; + }; + CannonJSPlugin.prototype._createHeightmap = function (object, pointDepth) { + var pos = object.getVerticesData(BABYLON.VertexBuffer.PositionKind); + var matrix = []; + //For now pointDepth will not be used and will be automatically calculated. + //Future reference - try and find the best place to add a reference to the pointDepth variable. + var arraySize = pointDepth || ~~(Math.sqrt(pos.length / 3) - 1); + var dim = Math.min(object.getBoundingInfo().boundingBox.extendSize.x, object.getBoundingInfo().boundingBox.extendSize.z); + var elementSize = dim * 2 / arraySize; + var minY = object.getBoundingInfo().boundingBox.extendSize.y; + for (var i = 0; i < pos.length; i = i + 3) { + var x = Math.round((pos[i + 0]) / elementSize + arraySize / 2); + var z = Math.round(((pos[i + 2]) / elementSize - arraySize / 2) * -1); + var y = pos[i + 1] + minY; + if (!matrix[x]) { + matrix[x] = []; + } + if (!matrix[x][z]) { + matrix[x][z] = y; + } + matrix[x][z] = Math.max(y, matrix[x][z]); + } + for (var x = 0; x <= arraySize; ++x) { + if (!matrix[x]) { + var loc = 1; + while (!matrix[(x + loc) % arraySize]) { + loc++; + } + matrix[x] = matrix[(x + loc) % arraySize].slice(); + } + for (var z = 0; z <= arraySize; ++z) { + if (!matrix[x][z]) { + var loc = 1; + var newValue; + while (newValue === undefined) { + newValue = matrix[x][(z + loc++) % arraySize]; + } + matrix[x][z] = newValue; + } + } + } + var shape = new CANNON.Heightfield(matrix, { + elementSize: elementSize + }); + //For future reference, needed for body transformation + shape.minY = minY; + return shape; + }; + CannonJSPlugin.prototype._updatePhysicsBodyTransformation = function (impostor) { + var object = impostor.object; + //make sure it is updated... + object.computeWorldMatrix && object.computeWorldMatrix(true); + // The delta between the mesh position and the mesh bounding box center + var center = impostor.getObjectCenter(); + var extendSize = impostor.getObjectExtendSize(); + this._tmpDeltaPosition.copyFrom(object.position.subtract(center)); + this._tmpPosition.copyFrom(center); + var quaternion = object.rotationQuaternion; + //is shape is a plane or a heightmap, it must be rotated 90 degs in the X axis. + if (impostor.type === BABYLON.PhysicsImpostor.PlaneImpostor || impostor.type === BABYLON.PhysicsImpostor.HeightmapImpostor || impostor.type === BABYLON.PhysicsImpostor.CylinderImpostor) { + //-90 DEG in X, precalculated + quaternion = quaternion.multiply(this._minus90X); + //Invert! (Precalculated, 90 deg in X) + //No need to clone. this will never change. + impostor.setDeltaRotation(this._plus90X); + } + //If it is a heightfield, if should be centered. + if (impostor.type === BABYLON.PhysicsEngine.HeightmapImpostor) { + var mesh = object; + //calculate the correct body position: + var rotationQuaternion = mesh.rotationQuaternion; + mesh.rotationQuaternion = this._tmpUnityRotation; + mesh.computeWorldMatrix(true); + //get original center with no rotation + var c = center.clone(); + var oldPivot = mesh.getPivotMatrix() || BABYLON.Matrix.Translation(0, 0, 0); + //rotation is back + mesh.rotationQuaternion = rotationQuaternion; + //calculate the new center using a pivot (since Cannon.js doesn't center height maps) + var p = BABYLON.Matrix.Translation(mesh.getBoundingInfo().boundingBox.extendSize.x, 0, -mesh.getBoundingInfo().boundingBox.extendSize.z); + mesh.setPivotMatrix(p); + mesh.computeWorldMatrix(true); + //calculate the translation + var translation = mesh.getBoundingInfo().boundingBox.center.subtract(center).subtract(mesh.position).negate(); + this._tmpPosition.copyFromFloats(translation.x, translation.y - mesh.getBoundingInfo().boundingBox.extendSize.y, translation.z); + //add it inverted to the delta + this._tmpDeltaPosition.copyFrom(mesh.getBoundingInfo().boundingBox.center.subtract(c)); + this._tmpDeltaPosition.y += mesh.getBoundingInfo().boundingBox.extendSize.y; + mesh.setPivotMatrix(oldPivot); + mesh.computeWorldMatrix(true); + } + else if (impostor.type === BABYLON.PhysicsEngine.MeshImpostor) { + this._tmpDeltaPosition.copyFromFloats(0, 0, 0); + this._tmpPosition.copyFrom(object.position); + } + impostor.setDeltaPosition(this._tmpDeltaPosition); + //Now update the impostor object + impostor.physicsBody.position.copy(this._tmpPosition); + impostor.physicsBody.quaternion.copy(quaternion); + }; + CannonJSPlugin.prototype.setTransformationFromPhysicsBody = function (impostor) { + impostor.object.position.copyFrom(impostor.physicsBody.position); + impostor.object.rotationQuaternion.copyFrom(impostor.physicsBody.quaternion); + }; + CannonJSPlugin.prototype.setPhysicsBodyTransformation = function (impostor, newPosition, newRotation) { + impostor.physicsBody.position.copy(newPosition); + impostor.physicsBody.quaternion.copy(newRotation); + }; + CannonJSPlugin.prototype.isSupported = function () { + return window.CANNON !== undefined; + }; + CannonJSPlugin.prototype.setLinearVelocity = function (impostor, velocity) { + impostor.physicsBody.velocity.copy(velocity); + }; + CannonJSPlugin.prototype.setAngularVelocity = function (impostor, velocity) { + impostor.physicsBody.angularVelocity.copy(velocity); + }; + CannonJSPlugin.prototype.getLinearVelocity = function (impostor) { + var v = impostor.physicsBody.velocity; + if (!v) + return null; + return new BABYLON.Vector3(v.x, v.y, v.z); + }; + CannonJSPlugin.prototype.getAngularVelocity = function (impostor) { + var v = impostor.physicsBody.angularVelocity; + if (!v) + return null; + return new BABYLON.Vector3(v.x, v.y, v.z); + }; + CannonJSPlugin.prototype.setBodyMass = function (impostor, mass) { + impostor.physicsBody.mass = mass; + impostor.physicsBody.updateMassProperties(); + }; + CannonJSPlugin.prototype.sleepBody = function (impostor) { + impostor.physicsBody.sleep(); + }; + CannonJSPlugin.prototype.wakeUpBody = function (impostor) { + impostor.physicsBody.wakeUp(); + }; + CannonJSPlugin.prototype.updateDistanceJoint = function (joint, maxDistance, minDistance) { + joint.physicsJoint.distance = maxDistance; + }; + CannonJSPlugin.prototype.enableMotor = function (joint, motorIndex) { + if (!motorIndex) { + joint.physicsJoint.enableMotor(); + } + }; + CannonJSPlugin.prototype.disableMotor = function (joint, motorIndex) { + if (!motorIndex) { + joint.physicsJoint.disableMotor(); + } + }; + CannonJSPlugin.prototype.setMotor = function (joint, speed, maxForce, motorIndex) { + if (!motorIndex) { + joint.physicsJoint.enableMotor(); + joint.physicsJoint.setMotorSpeed(speed); + if (maxForce) { + this.setLimit(joint, maxForce); + } + } + }; + CannonJSPlugin.prototype.setLimit = function (joint, upperLimit, lowerLimit) { + joint.physicsJoint.motorEquation.maxForce = upperLimit; + joint.physicsJoint.motorEquation.minForce = lowerLimit === void 0 ? -upperLimit : lowerLimit; + }; + CannonJSPlugin.prototype.dispose = function () { + //nothing to do, actually. + }; + return CannonJSPlugin; + }()); + BABYLON.CannonJSPlugin = CannonJSPlugin; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.cannonJSPlugin.js.map + +var BABYLON; +(function (BABYLON) { + var OimoJSPlugin = (function () { + function OimoJSPlugin(iterations) { + this.name = "OimoJSPlugin"; + this._tmpImpostorsArray = []; + this._tmpPositionVector = BABYLON.Vector3.Zero(); + this.world = new OIMO.World(1 / 60, 2, iterations, true); + this.world.worldscale(1); + this.world.clear(); + //making sure no stats are calculated + this.world.isNoStat = true; + } + OimoJSPlugin.prototype.setGravity = function (gravity) { + this.world.gravity.copy(gravity); + }; + OimoJSPlugin.prototype.setTimeStep = function (timeStep) { + this.world.timeStep = timeStep; + }; + OimoJSPlugin.prototype.executeStep = function (delta, impostors) { + var _this = this; + impostors.forEach(function (impostor) { + impostor.beforeStep(); + }); + this.world.step(); + impostors.forEach(function (impostor) { + impostor.afterStep(); + //update the ordered impostors array + _this._tmpImpostorsArray[impostor.uniqueId] = impostor; + }); + //check for collisions + var contact = this.world.contacts; + while (contact !== null) { + if (contact.touching && !contact.body1.sleeping && !contact.body2.sleeping) { + contact = contact.next; + continue; + } + //is this body colliding with any other? get the impostor + var mainImpostor = this._tmpImpostorsArray[+contact.body1.name]; + var collidingImpostor = this._tmpImpostorsArray[+contact.body2.name]; + if (!mainImpostor || !collidingImpostor) { + contact = contact.next; + continue; + } + mainImpostor.onCollide({ body: collidingImpostor.physicsBody }); + collidingImpostor.onCollide({ body: mainImpostor.physicsBody }); + contact = contact.next; + } + }; + OimoJSPlugin.prototype.applyImpulse = function (impostor, force, contactPoint) { + var mass = impostor.physicsBody.massInfo.mass; + impostor.physicsBody.applyImpulse(contactPoint.scale(OIMO.INV_SCALE), force.scale(OIMO.INV_SCALE * mass)); + }; + OimoJSPlugin.prototype.applyForce = function (impostor, force, contactPoint) { + BABYLON.Tools.Warn("Oimo doesn't support applying force. Using impule instead."); + this.applyImpulse(impostor, force, contactPoint); + }; + OimoJSPlugin.prototype.generatePhysicsBody = function (impostor) { + var _this = this; + //parent-child relationship. Does this impostor has a parent impostor? + if (impostor.parent) { + if (impostor.physicsBody) { + this.removePhysicsBody(impostor); + //TODO is that needed? + impostor.forceUpdate(); + } + return; + } + if (impostor.isBodyInitRequired()) { + var bodyConfig = { + name: impostor.uniqueId, + //Oimo must have mass, also for static objects. + config: [impostor.getParam("mass") || 1, impostor.getParam("friction"), impostor.getParam("restitution")], + size: [], + type: [], + pos: [], + rot: [], + move: impostor.getParam("mass") !== 0, + //Supporting older versions of Oimo + world: this.world + }; + var impostors = [impostor]; + var addToArray = function (parent) { + if (!parent.getChildMeshes) + return; + parent.getChildMeshes().forEach(function (m) { + if (m.physicsImpostor) { + impostors.push(m.physicsImpostor); + m.physicsImpostor._init(); + } + }); + }; + addToArray(impostor.object); + var checkWithEpsilon_1 = function (value) { + return Math.max(value, BABYLON.PhysicsEngine.Epsilon); + }; + impostors.forEach(function (i) { + //get the correct bounding box + var oldQuaternion = i.object.rotationQuaternion; + var rot = new OIMO.Euler().setFromQuaternion({ + x: impostor.object.rotationQuaternion.x, + y: impostor.object.rotationQuaternion.y, + z: impostor.object.rotationQuaternion.z, + s: impostor.object.rotationQuaternion.w + }); + var extendSize = i.getObjectExtendSize(); + if (i === impostor) { + var center = impostor.getObjectCenter(); + impostor.object.position.subtractToRef(center, _this._tmpPositionVector); + //Can also use Array.prototype.push.apply + bodyConfig.pos.push(center.x); + bodyConfig.pos.push(center.y); + bodyConfig.pos.push(center.z); + //tmp solution + bodyConfig.rot.push(rot.x / (OIMO.degtorad || OIMO.TO_RAD)); + bodyConfig.rot.push(rot.y / (OIMO.degtorad || OIMO.TO_RAD)); + bodyConfig.rot.push(rot.z / (OIMO.degtorad || OIMO.TO_RAD)); + } + else { + bodyConfig.pos.push(i.object.position.x); + bodyConfig.pos.push(i.object.position.y); + bodyConfig.pos.push(i.object.position.z); + //tmp solution until https://github.com/lo-th/Oimo.js/pull/37 is merged + bodyConfig.rot.push(0); + bodyConfig.rot.push(0); + bodyConfig.rot.push(0); + } + // register mesh + switch (i.type) { + case BABYLON.PhysicsImpostor.ParticleImpostor: + BABYLON.Tools.Warn("No Particle support in Oimo.js. using SphereImpostor instead"); + case BABYLON.PhysicsImpostor.SphereImpostor: + var radiusX = extendSize.x; + var radiusY = extendSize.y; + var radiusZ = extendSize.z; + var size = Math.max(checkWithEpsilon_1(radiusX), checkWithEpsilon_1(radiusY), checkWithEpsilon_1(radiusZ)) / 2; + bodyConfig.type.push('sphere'); + //due to the way oimo works with compounds, add 3 times + bodyConfig.size.push(size); + bodyConfig.size.push(size); + bodyConfig.size.push(size); + break; + case BABYLON.PhysicsImpostor.CylinderImpostor: + var sizeX = checkWithEpsilon_1(extendSize.x) / 2; + var sizeY = checkWithEpsilon_1(extendSize.y); + bodyConfig.type.push('cylinder'); + bodyConfig.size.push(sizeX); + bodyConfig.size.push(sizeY); + //due to the way oimo works with compounds, add one more value. + bodyConfig.size.push(sizeY); + break; + case BABYLON.PhysicsImpostor.PlaneImpostor: + case BABYLON.PhysicsImpostor.BoxImpostor: + default: + var sizeX = checkWithEpsilon_1(extendSize.x); + var sizeY = checkWithEpsilon_1(extendSize.y); + var sizeZ = checkWithEpsilon_1(extendSize.z); + bodyConfig.type.push('box'); + bodyConfig.size.push(sizeX); + bodyConfig.size.push(sizeY); + bodyConfig.size.push(sizeZ); + break; + } + //actually not needed, but hey... + i.object.rotationQuaternion = oldQuaternion; + }); + impostor.physicsBody = new OIMO.Body(bodyConfig).body; //this.world.add(bodyConfig); + } + else { + this._tmpPositionVector.copyFromFloats(0, 0, 0); + } + impostor.setDeltaPosition(this._tmpPositionVector); + //this._tmpPositionVector.addInPlace(impostor.mesh.getBoundingInfo().boundingBox.center); + //this.setPhysicsBodyTransformation(impostor, this._tmpPositionVector, impostor.mesh.rotationQuaternion); + }; + OimoJSPlugin.prototype.removePhysicsBody = function (impostor) { + //impostor.physicsBody.dispose(); + //Same as : (older oimo versions) + this.world.removeRigidBody(impostor.physicsBody); + }; + OimoJSPlugin.prototype.generateJoint = function (impostorJoint) { + var mainBody = impostorJoint.mainImpostor.physicsBody; + var connectedBody = impostorJoint.connectedImpostor.physicsBody; + if (!mainBody || !connectedBody) { + return; + } + var jointData = impostorJoint.joint.jointData; + var options = jointData.nativeParams || {}; + var type; + var nativeJointData = { + body1: mainBody, + body2: connectedBody, + axe1: options.axe1 || (jointData.mainAxis ? jointData.mainAxis.asArray() : null), + axe2: options.axe2 || (jointData.connectedAxis ? jointData.connectedAxis.asArray() : null), + pos1: options.pos1 || (jointData.mainPivot ? jointData.mainPivot.asArray() : null), + pos2: options.pos2 || (jointData.connectedPivot ? jointData.connectedPivot.asArray() : null), + min: options.min, + max: options.max, + collision: options.collision || jointData.collision, + spring: options.spring, + //supporting older version of Oimo + world: this.world + }; + switch (impostorJoint.joint.type) { + case BABYLON.PhysicsJoint.BallAndSocketJoint: + type = "jointBall"; + break; + case BABYLON.PhysicsJoint.SpringJoint: + BABYLON.Tools.Warn("Oimo.js doesn't support Spring Constraint. Simulating using DistanceJoint instead"); + var springData = jointData; + nativeJointData.min = springData.length || nativeJointData.min; + //Max should also be set, just make sure it is at least min + nativeJointData.max = Math.max(nativeJointData.min, nativeJointData.max); + case BABYLON.PhysicsJoint.DistanceJoint: + type = "jointDistance"; + nativeJointData.max = jointData.maxDistance; + break; + case BABYLON.PhysicsJoint.PrismaticJoint: + type = "jointPrisme"; + break; + case BABYLON.PhysicsJoint.SliderJoint: + type = "jointSlide"; + break; + case BABYLON.PhysicsJoint.WheelJoint: + type = "jointWheel"; + break; + case BABYLON.PhysicsJoint.HingeJoint: + default: + type = "jointHinge"; + break; + } + nativeJointData.type = type; + impostorJoint.joint.physicsJoint = new OIMO.Link(nativeJointData).joint; //this.world.add(nativeJointData); + }; + OimoJSPlugin.prototype.removeJoint = function (impostorJoint) { + //Bug in Oimo prevents us from disposing a joint in the playground + //joint.joint.physicsJoint.dispose(); + //So we will bruteforce it! + try { + this.world.removeJoint(impostorJoint.joint.physicsJoint); + } + catch (e) { + BABYLON.Tools.Warn(e); + } + }; + OimoJSPlugin.prototype.isSupported = function () { + return OIMO !== undefined; + }; + OimoJSPlugin.prototype.setTransformationFromPhysicsBody = function (impostor) { + if (!impostor.physicsBody.sleeping) { + //TODO check that + if (impostor.physicsBody.shapes.next) { + var parentShape = this._getLastShape(impostor.physicsBody); + impostor.object.position.x = parentShape.position.x * OIMO.WORLD_SCALE; + impostor.object.position.y = parentShape.position.y * OIMO.WORLD_SCALE; + impostor.object.position.z = parentShape.position.z * OIMO.WORLD_SCALE; + } + else { + impostor.object.position.copyFrom(impostor.physicsBody.getPosition()); + } + impostor.object.rotationQuaternion.copyFrom(impostor.physicsBody.getQuaternion()); + impostor.object.rotationQuaternion.normalize(); + } + }; + OimoJSPlugin.prototype.setPhysicsBodyTransformation = function (impostor, newPosition, newRotation) { + var body = impostor.physicsBody; + body.position.init(newPosition.x * OIMO.INV_SCALE, newPosition.y * OIMO.INV_SCALE, newPosition.z * OIMO.INV_SCALE); + body.orientation.init(newRotation.w, newRotation.x, newRotation.y, newRotation.z); + body.syncShapes(); + body.awake(); + }; + OimoJSPlugin.prototype._getLastShape = function (body) { + var lastShape = body.shapes; + while (lastShape.next) { + lastShape = lastShape.next; + } + return lastShape; + }; + OimoJSPlugin.prototype.setLinearVelocity = function (impostor, velocity) { + impostor.physicsBody.linearVelocity.init(velocity.x, velocity.y, velocity.z); + }; + OimoJSPlugin.prototype.setAngularVelocity = function (impostor, velocity) { + impostor.physicsBody.angularVelocity.init(velocity.x, velocity.y, velocity.z); + }; + OimoJSPlugin.prototype.getLinearVelocity = function (impostor) { + var v = impostor.physicsBody.linearVelocity; + if (!v) + return null; + return new BABYLON.Vector3(v.x, v.y, v.z); + }; + OimoJSPlugin.prototype.getAngularVelocity = function (impostor) { + var v = impostor.physicsBody.angularVelocity; + if (!v) + return null; + return new BABYLON.Vector3(v.x, v.y, v.z); + }; + OimoJSPlugin.prototype.setBodyMass = function (impostor, mass) { + var staticBody = mass === 0; + //this will actually set the body's density and not its mass. + //But this is how oimo treats the mass variable. + impostor.physicsBody.shapes.density = staticBody ? 1 : mass; + impostor.physicsBody.setupMass(staticBody ? 0x2 : 0x1); + }; + OimoJSPlugin.prototype.sleepBody = function (impostor) { + impostor.physicsBody.sleep(); + }; + OimoJSPlugin.prototype.wakeUpBody = function (impostor) { + impostor.physicsBody.awake(); + }; + OimoJSPlugin.prototype.updateDistanceJoint = function (joint, maxDistance, minDistance) { + joint.physicsJoint.limitMotor.upperLimit = maxDistance; + if (minDistance !== void 0) { + joint.physicsJoint.limitMotor.lowerLimit = minDistance; + } + }; + OimoJSPlugin.prototype.setMotor = function (joint, speed, maxForce, motorIndex) { + //TODO separate rotational and transational motors. + var motor = motorIndex ? joint.physicsJoint.rotationalLimitMotor2 : joint.physicsJoint.rotationalLimitMotor1 || joint.physicsJoint.rotationalLimitMotor || joint.physicsJoint.limitMotor; + if (motor) { + motor.setMotor(speed, maxForce); + } + }; + OimoJSPlugin.prototype.setLimit = function (joint, upperLimit, lowerLimit, motorIndex) { + //TODO separate rotational and transational motors. + var motor = motorIndex ? joint.physicsJoint.rotationalLimitMotor2 : joint.physicsJoint.rotationalLimitMotor1 || joint.physicsJoint.rotationalLimitMotor || joint.physicsJoint.limitMotor; + if (motor) { + motor.setLimit(upperLimit, lowerLimit === void 0 ? -upperLimit : lowerLimit); + } + }; + OimoJSPlugin.prototype.dispose = function () { + this.world.clear(); + }; + return OimoJSPlugin; + }()); + BABYLON.OimoJSPlugin = OimoJSPlugin; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.oimoJSPlugin.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var DisplayPassPostProcess = (function (_super) { + __extends(DisplayPassPostProcess, _super); + function DisplayPassPostProcess(name, options, camera, samplingMode, engine, reusable) { + _super.call(this, name, "displayPass", ["passSampler"], ["passSampler"], options, camera, samplingMode, engine, reusable); + } + return DisplayPassPostProcess; + }(BABYLON.PostProcess)); + BABYLON.DisplayPassPostProcess = DisplayPassPostProcess; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.displayPassPostProcess.js.map + +var BABYLON; +(function (BABYLON) { + var SimplificationSettings = (function () { + function SimplificationSettings(quality, distance, optimizeMesh) { + this.quality = quality; + this.distance = distance; + this.optimizeMesh = optimizeMesh; + } + return SimplificationSettings; + }()); + BABYLON.SimplificationSettings = SimplificationSettings; + var SimplificationQueue = (function () { + function SimplificationQueue() { + this.running = false; + this._simplificationArray = []; + } + SimplificationQueue.prototype.addTask = function (task) { + this._simplificationArray.push(task); + }; + SimplificationQueue.prototype.executeNext = function () { + var task = this._simplificationArray.pop(); + if (task) { + this.running = true; + this.runSimplification(task); + } + else { + this.running = false; + } + }; + SimplificationQueue.prototype.runSimplification = function (task) { + var _this = this; + if (task.parallelProcessing) { + //parallel simplifier + task.settings.forEach(function (setting) { + var simplifier = _this.getSimplifier(task); + simplifier.simplify(setting, function (newMesh) { + task.mesh.addLODLevel(setting.distance, newMesh); + newMesh.isVisible = true; + //check if it is the last + if (setting.quality === task.settings[task.settings.length - 1].quality && task.successCallback) { + //all done, run the success callback. + task.successCallback(); + } + _this.executeNext(); + }); + }); + } + else { + //single simplifier. + var simplifier = this.getSimplifier(task); + var runDecimation = function (setting, callback) { + simplifier.simplify(setting, function (newMesh) { + task.mesh.addLODLevel(setting.distance, newMesh); + newMesh.isVisible = true; + //run the next quality level + callback(); + }); + }; + BABYLON.AsyncLoop.Run(task.settings.length, function (loop) { + runDecimation(task.settings[loop.index], function () { + loop.executeNext(); + }); + }, function () { + //execution ended, run the success callback. + if (task.successCallback) { + task.successCallback(); + } + _this.executeNext(); + }); + } + }; + SimplificationQueue.prototype.getSimplifier = function (task) { + switch (task.simplificationType) { + case SimplificationType.QUADRATIC: + default: + return new QuadraticErrorSimplification(task.mesh); + } + }; + return SimplificationQueue; + }()); + BABYLON.SimplificationQueue = SimplificationQueue; + /** + * The implemented types of simplification. + * At the moment only Quadratic Error Decimation is implemented. + */ + (function (SimplificationType) { + SimplificationType[SimplificationType["QUADRATIC"] = 0] = "QUADRATIC"; + })(BABYLON.SimplificationType || (BABYLON.SimplificationType = {})); + var SimplificationType = BABYLON.SimplificationType; + var DecimationTriangle = (function () { + function DecimationTriangle(vertices) { + this.vertices = vertices; + this.error = new Array(4); + this.deleted = false; + this.isDirty = false; + this.deletePending = false; + this.borderFactor = 0; + } + return DecimationTriangle; + }()); + BABYLON.DecimationTriangle = DecimationTriangle; + var DecimationVertex = (function () { + function DecimationVertex(position, id) { + this.position = position; + this.id = id; + this.isBorder = true; + this.q = new QuadraticMatrix(); + this.triangleCount = 0; + this.triangleStart = 0; + this.originalOffsets = []; + } + DecimationVertex.prototype.updatePosition = function (newPosition) { + this.position.copyFrom(newPosition); + }; + return DecimationVertex; + }()); + BABYLON.DecimationVertex = DecimationVertex; + var QuadraticMatrix = (function () { + function QuadraticMatrix(data) { + this.data = new Array(10); + for (var i = 0; i < 10; ++i) { + if (data && data[i]) { + this.data[i] = data[i]; + } + else { + this.data[i] = 0; + } + } + } + QuadraticMatrix.prototype.det = function (a11, a12, a13, a21, a22, a23, a31, a32, a33) { + var det = this.data[a11] * this.data[a22] * this.data[a33] + this.data[a13] * this.data[a21] * this.data[a32] + + this.data[a12] * this.data[a23] * this.data[a31] - this.data[a13] * this.data[a22] * this.data[a31] - + this.data[a11] * this.data[a23] * this.data[a32] - this.data[a12] * this.data[a21] * this.data[a33]; + return det; + }; + QuadraticMatrix.prototype.addInPlace = function (matrix) { + for (var i = 0; i < 10; ++i) { + this.data[i] += matrix.data[i]; + } + }; + QuadraticMatrix.prototype.addArrayInPlace = function (data) { + for (var i = 0; i < 10; ++i) { + this.data[i] += data[i]; + } + }; + QuadraticMatrix.prototype.add = function (matrix) { + var m = new QuadraticMatrix(); + for (var i = 0; i < 10; ++i) { + m.data[i] = this.data[i] + matrix.data[i]; + } + return m; + }; + QuadraticMatrix.FromData = function (a, b, c, d) { + return new QuadraticMatrix(QuadraticMatrix.DataFromNumbers(a, b, c, d)); + }; + //returning an array to avoid garbage collection + QuadraticMatrix.DataFromNumbers = function (a, b, c, d) { + return [a * a, a * b, a * c, a * d, b * b, b * c, b * d, c * c, c * d, d * d]; + }; + return QuadraticMatrix; + }()); + BABYLON.QuadraticMatrix = QuadraticMatrix; + var Reference = (function () { + function Reference(vertexId, triangleId) { + this.vertexId = vertexId; + this.triangleId = triangleId; + } + return Reference; + }()); + BABYLON.Reference = Reference; + /** + * An implementation of the Quadratic Error simplification algorithm. + * Original paper : http://www1.cs.columbia.edu/~cs4162/html05s/garland97.pdf + * Ported mostly from QSlim and http://voxels.blogspot.de/2014/05/quadric-mesh-simplification-with-source.html to babylon JS + * @author RaananW + */ + var QuadraticErrorSimplification = (function () { + function QuadraticErrorSimplification(_mesh) { + this._mesh = _mesh; + this.initialized = false; + this.syncIterations = 5000; + this.aggressiveness = 7; + this.decimationIterations = 100; + this.boundingBoxEpsilon = BABYLON.Epsilon; + } + QuadraticErrorSimplification.prototype.simplify = function (settings, successCallback) { + var _this = this; + this.initDecimatedMesh(); + //iterating through the submeshes array, one after the other. + BABYLON.AsyncLoop.Run(this._mesh.subMeshes.length, function (loop) { + _this.initWithMesh(loop.index, function () { + _this.runDecimation(settings, loop.index, function () { + loop.executeNext(); + }); + }, settings.optimizeMesh); + }, function () { + setTimeout(function () { + successCallback(_this._reconstructedMesh); + }, 0); + }); + }; + QuadraticErrorSimplification.prototype.isTriangleOnBoundingBox = function (triangle) { + var _this = this; + var gCount = 0; + triangle.vertices.forEach(function (vertex) { + var count = 0; + var vPos = vertex.position; + var bbox = _this._mesh.getBoundingInfo().boundingBox; + if (bbox.maximum.x - vPos.x < _this.boundingBoxEpsilon || vPos.x - bbox.minimum.x > _this.boundingBoxEpsilon) + ++count; + if (bbox.maximum.y === vPos.y || vPos.y === bbox.minimum.y) + ++count; + if (bbox.maximum.z === vPos.z || vPos.z === bbox.minimum.z) + ++count; + if (count > 1) { + ++gCount; + } + ; + }); + if (gCount > 1) { + console.log(triangle, gCount); + } + return gCount > 1; + }; + QuadraticErrorSimplification.prototype.runDecimation = function (settings, submeshIndex, successCallback) { + var _this = this; + var targetCount = ~~(this.triangles.length * settings.quality); + var deletedTriangles = 0; + var triangleCount = this.triangles.length; + var iterationFunction = function (iteration, callback) { + setTimeout(function () { + if (iteration % 5 === 0) { + _this.updateMesh(iteration === 0); + } + for (var i = 0; i < _this.triangles.length; ++i) { + _this.triangles[i].isDirty = false; + } + var threshold = 0.000000001 * Math.pow((iteration + 3), _this.aggressiveness); + var trianglesIterator = function (i) { + var tIdx = ~~(((_this.triangles.length / 2) + i) % _this.triangles.length); + var t = _this.triangles[tIdx]; + if (!t) + return; + if (t.error[3] > threshold || t.deleted || t.isDirty) { + return; + } + for (var j = 0; j < 3; ++j) { + if (t.error[j] < threshold) { + var deleted0 = []; + var deleted1 = []; + var v0 = t.vertices[j]; + var v1 = t.vertices[(j + 1) % 3]; + if (v0.isBorder || v1.isBorder) + continue; + var p = BABYLON.Vector3.Zero(); + var n = BABYLON.Vector3.Zero(); + var uv = BABYLON.Vector2.Zero(); + var color = new BABYLON.Color4(0, 0, 0, 1); + _this.calculateError(v0, v1, p, n, uv, color); + var delTr = []; + if (_this.isFlipped(v0, v1, p, deleted0, t.borderFactor, delTr)) + continue; + if (_this.isFlipped(v1, v0, p, deleted1, t.borderFactor, delTr)) + continue; + if (deleted0.indexOf(true) < 0 || deleted1.indexOf(true) < 0) + continue; + var uniqueArray = []; + delTr.forEach(function (deletedT) { + if (uniqueArray.indexOf(deletedT) === -1) { + deletedT.deletePending = true; + uniqueArray.push(deletedT); + } + }); + if (uniqueArray.length % 2 !== 0) { + continue; + } + v0.q = v1.q.add(v0.q); + v0.updatePosition(p); + var tStart = _this.references.length; + deletedTriangles = _this.updateTriangles(v0, v0, deleted0, deletedTriangles); + deletedTriangles = _this.updateTriangles(v0, v1, deleted1, deletedTriangles); + var tCount = _this.references.length - tStart; + if (tCount <= v0.triangleCount) { + if (tCount) { + for (var c = 0; c < tCount; c++) { + _this.references[v0.triangleStart + c] = _this.references[tStart + c]; + } + } + } + else { + v0.triangleStart = tStart; + } + v0.triangleCount = tCount; + break; + } + } + }; + BABYLON.AsyncLoop.SyncAsyncForLoop(_this.triangles.length, _this.syncIterations, trianglesIterator, callback, function () { return (triangleCount - deletedTriangles <= targetCount); }); + }, 0); + }; + BABYLON.AsyncLoop.Run(this.decimationIterations, function (loop) { + if (triangleCount - deletedTriangles <= targetCount) + loop.breakLoop(); + else { + iterationFunction(loop.index, function () { + loop.executeNext(); + }); + } + }, function () { + setTimeout(function () { + //reconstruct this part of the mesh + _this.reconstructMesh(submeshIndex); + successCallback(); + }, 0); + }); + }; + QuadraticErrorSimplification.prototype.initWithMesh = function (submeshIndex, callback, optimizeMesh) { + var _this = this; + this.vertices = []; + this.triangles = []; + var positionData = this._mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind); + var indices = this._mesh.getIndices(); + var submesh = this._mesh.subMeshes[submeshIndex]; + var findInVertices = function (positionToSearch) { + if (optimizeMesh) { + for (var ii = 0; ii < _this.vertices.length; ++ii) { + if (_this.vertices[ii].position.equals(positionToSearch)) { + return _this.vertices[ii]; + } + } + } + return null; + }; + var vertexReferences = []; + var vertexInit = function (i) { + var offset = i + submesh.verticesStart; + var position = BABYLON.Vector3.FromArray(positionData, offset * 3); + var vertex = findInVertices(position) || new DecimationVertex(position, _this.vertices.length); + vertex.originalOffsets.push(offset); + if (vertex.id === _this.vertices.length) { + _this.vertices.push(vertex); + } + vertexReferences.push(vertex.id); + }; + //var totalVertices = mesh.getTotalVertices(); + var totalVertices = submesh.verticesCount; + BABYLON.AsyncLoop.SyncAsyncForLoop(totalVertices, (this.syncIterations / 4) >> 0, vertexInit, function () { + var indicesInit = function (i) { + var offset = (submesh.indexStart / 3) + i; + var pos = (offset * 3); + var i0 = indices[pos + 0]; + var i1 = indices[pos + 1]; + var i2 = indices[pos + 2]; + var v0 = _this.vertices[vertexReferences[i0 - submesh.verticesStart]]; + var v1 = _this.vertices[vertexReferences[i1 - submesh.verticesStart]]; + var v2 = _this.vertices[vertexReferences[i2 - submesh.verticesStart]]; + var triangle = new DecimationTriangle([v0, v1, v2]); + triangle.originalOffset = pos; + _this.triangles.push(triangle); + }; + BABYLON.AsyncLoop.SyncAsyncForLoop(submesh.indexCount / 3, _this.syncIterations, indicesInit, function () { + _this.init(callback); + }); + }); + }; + QuadraticErrorSimplification.prototype.init = function (callback) { + var _this = this; + var triangleInit1 = function (i) { + var t = _this.triangles[i]; + t.normal = BABYLON.Vector3.Cross(t.vertices[1].position.subtract(t.vertices[0].position), t.vertices[2].position.subtract(t.vertices[0].position)).normalize(); + for (var j = 0; j < 3; j++) { + t.vertices[j].q.addArrayInPlace(QuadraticMatrix.DataFromNumbers(t.normal.x, t.normal.y, t.normal.z, -(BABYLON.Vector3.Dot(t.normal, t.vertices[0].position)))); + } + }; + BABYLON.AsyncLoop.SyncAsyncForLoop(this.triangles.length, this.syncIterations, triangleInit1, function () { + var triangleInit2 = function (i) { + var t = _this.triangles[i]; + for (var j = 0; j < 3; ++j) { + t.error[j] = _this.calculateError(t.vertices[j], t.vertices[(j + 1) % 3]); + } + t.error[3] = Math.min(t.error[0], t.error[1], t.error[2]); + }; + BABYLON.AsyncLoop.SyncAsyncForLoop(_this.triangles.length, _this.syncIterations, triangleInit2, function () { + _this.initialized = true; + callback(); + }); + }); + }; + QuadraticErrorSimplification.prototype.reconstructMesh = function (submeshIndex) { + var newTriangles = []; + var i; + for (i = 0; i < this.vertices.length; ++i) { + this.vertices[i].triangleCount = 0; + } + var t; + var j; + for (i = 0; i < this.triangles.length; ++i) { + if (!this.triangles[i].deleted) { + t = this.triangles[i]; + for (j = 0; j < 3; ++j) { + t.vertices[j].triangleCount = 1; + } + newTriangles.push(t); + } + } + var newPositionData = (this._reconstructedMesh.getVerticesData(BABYLON.VertexBuffer.PositionKind) || []); + var newNormalData = (this._reconstructedMesh.getVerticesData(BABYLON.VertexBuffer.NormalKind) || []); + var newUVsData = (this._reconstructedMesh.getVerticesData(BABYLON.VertexBuffer.UVKind) || []); + var newColorsData = (this._reconstructedMesh.getVerticesData(BABYLON.VertexBuffer.ColorKind) || []); + var normalData = this._mesh.getVerticesData(BABYLON.VertexBuffer.NormalKind); + var uvs = this._mesh.getVerticesData(BABYLON.VertexBuffer.UVKind); + var colorsData = this._mesh.getVerticesData(BABYLON.VertexBuffer.ColorKind); + var vertexCount = 0; + for (i = 0; i < this.vertices.length; ++i) { + var vertex = this.vertices[i]; + vertex.id = vertexCount; + if (vertex.triangleCount) { + vertex.originalOffsets.forEach(function (originalOffset) { + newPositionData.push(vertex.position.x); + newPositionData.push(vertex.position.y); + newPositionData.push(vertex.position.z); + newNormalData.push(normalData[originalOffset * 3]); + newNormalData.push(normalData[(originalOffset * 3) + 1]); + newNormalData.push(normalData[(originalOffset * 3) + 2]); + if (uvs && uvs.length) { + newUVsData.push(uvs[(originalOffset * 2)]); + newUVsData.push(uvs[(originalOffset * 2) + 1]); + } + else if (colorsData && colorsData.length) { + newColorsData.push(colorsData[(originalOffset * 4)]); + newColorsData.push(colorsData[(originalOffset * 4) + 1]); + newColorsData.push(colorsData[(originalOffset * 4) + 2]); + newColorsData.push(colorsData[(originalOffset * 4) + 3]); + } + ++vertexCount; + }); + } + } + var startingIndex = this._reconstructedMesh.getTotalIndices(); + var startingVertex = this._reconstructedMesh.getTotalVertices(); + var submeshesArray = this._reconstructedMesh.subMeshes; + this._reconstructedMesh.subMeshes = []; + var newIndicesArray = this._reconstructedMesh.getIndices(); //[]; + var originalIndices = this._mesh.getIndices(); + for (i = 0; i < newTriangles.length; ++i) { + t = newTriangles[i]; //now get the new referencing point for each vertex + [0, 1, 2].forEach(function (idx) { + var id = originalIndices[t.originalOffset + idx]; + var offset = t.vertices[idx].originalOffsets.indexOf(id); + if (offset < 0) + offset = 0; + newIndicesArray.push(t.vertices[idx].id + offset + startingVertex); + }); + } + //overwriting the old vertex buffers and indices. + this._reconstructedMesh.setIndices(newIndicesArray); + this._reconstructedMesh.setVerticesData(BABYLON.VertexBuffer.PositionKind, newPositionData); + this._reconstructedMesh.setVerticesData(BABYLON.VertexBuffer.NormalKind, newNormalData); + if (newUVsData.length > 0) + this._reconstructedMesh.setVerticesData(BABYLON.VertexBuffer.UVKind, newUVsData); + if (newColorsData.length > 0) + this._reconstructedMesh.setVerticesData(BABYLON.VertexBuffer.ColorKind, newColorsData); + //create submesh + var originalSubmesh = this._mesh.subMeshes[submeshIndex]; + if (submeshIndex > 0) { + this._reconstructedMesh.subMeshes = []; + submeshesArray.forEach(function (submesh) { + new BABYLON.SubMesh(submesh.materialIndex, submesh.verticesStart, submesh.verticesCount, /* 0, newPositionData.length/3, */ submesh.indexStart, submesh.indexCount, submesh.getMesh()); + }); + var newSubmesh = new BABYLON.SubMesh(originalSubmesh.materialIndex, startingVertex, vertexCount, /* 0, newPositionData.length / 3, */ startingIndex, newTriangles.length * 3, this._reconstructedMesh); + } + }; + QuadraticErrorSimplification.prototype.initDecimatedMesh = function () { + this._reconstructedMesh = new BABYLON.Mesh(this._mesh.name + "Decimated", this._mesh.getScene()); + this._reconstructedMesh.material = this._mesh.material; + this._reconstructedMesh.parent = this._mesh.parent; + this._reconstructedMesh.isVisible = false; + this._reconstructedMesh.renderingGroupId = this._mesh.renderingGroupId; + }; + QuadraticErrorSimplification.prototype.isFlipped = function (vertex1, vertex2, point, deletedArray, borderFactor, delTr) { + for (var i = 0; i < vertex1.triangleCount; ++i) { + var t = this.triangles[this.references[vertex1.triangleStart + i].triangleId]; + if (t.deleted) + continue; + var s = this.references[vertex1.triangleStart + i].vertexId; + var v1 = t.vertices[(s + 1) % 3]; + var v2 = t.vertices[(s + 2) % 3]; + if ((v1 === vertex2 || v2 === vertex2) /* && !this.isTriangleOnBoundingBox(t)*/) { + deletedArray[i] = true; + delTr.push(t); + continue; + } + var d1 = v1.position.subtract(point); + d1 = d1.normalize(); + var d2 = v2.position.subtract(point); + d2 = d2.normalize(); + if (Math.abs(BABYLON.Vector3.Dot(d1, d2)) > 0.999) + return true; + var normal = BABYLON.Vector3.Cross(d1, d2).normalize(); + deletedArray[i] = false; + if (BABYLON.Vector3.Dot(normal, t.normal) < 0.2) + return true; + } + return false; + }; + QuadraticErrorSimplification.prototype.updateTriangles = function (origVertex, vertex, deletedArray, deletedTriangles) { + var newDeleted = deletedTriangles; + for (var i = 0; i < vertex.triangleCount; ++i) { + var ref = this.references[vertex.triangleStart + i]; + var t = this.triangles[ref.triangleId]; + if (t.deleted) + continue; + if (deletedArray[i] && t.deletePending) { + t.deleted = true; + newDeleted++; + continue; + } + t.vertices[ref.vertexId] = origVertex; + t.isDirty = true; + t.error[0] = this.calculateError(t.vertices[0], t.vertices[1]) + (t.borderFactor / 2); + t.error[1] = this.calculateError(t.vertices[1], t.vertices[2]) + (t.borderFactor / 2); + t.error[2] = this.calculateError(t.vertices[2], t.vertices[0]) + (t.borderFactor / 2); + t.error[3] = Math.min(t.error[0], t.error[1], t.error[2]); + this.references.push(ref); + } + return newDeleted; + }; + QuadraticErrorSimplification.prototype.identifyBorder = function () { + for (var i = 0; i < this.vertices.length; ++i) { + var vCount = []; + var vId = []; + var v = this.vertices[i]; + var j; + for (j = 0; j < v.triangleCount; ++j) { + var triangle = this.triangles[this.references[v.triangleStart + j].triangleId]; + for (var ii = 0; ii < 3; ii++) { + var ofs = 0; + var vv = triangle.vertices[ii]; + while (ofs < vCount.length) { + if (vId[ofs] === vv.id) + break; + ++ofs; + } + if (ofs === vCount.length) { + vCount.push(1); + vId.push(vv.id); + } + else { + vCount[ofs]++; + } + } + } + for (j = 0; j < vCount.length; ++j) { + if (vCount[j] === 1) { + this.vertices[vId[j]].isBorder = true; + } + else { + this.vertices[vId[j]].isBorder = false; + } + } + } + }; + QuadraticErrorSimplification.prototype.updateMesh = function (identifyBorders) { + if (identifyBorders === void 0) { identifyBorders = false; } + var i; + if (!identifyBorders) { + var newTrianglesVector = []; + for (i = 0; i < this.triangles.length; ++i) { + if (!this.triangles[i].deleted) { + newTrianglesVector.push(this.triangles[i]); + } + } + this.triangles = newTrianglesVector; + } + for (i = 0; i < this.vertices.length; ++i) { + this.vertices[i].triangleCount = 0; + this.vertices[i].triangleStart = 0; + } + var t; + var j; + var v; + for (i = 0; i < this.triangles.length; ++i) { + t = this.triangles[i]; + for (j = 0; j < 3; ++j) { + v = t.vertices[j]; + v.triangleCount++; + } + } + var tStart = 0; + for (i = 0; i < this.vertices.length; ++i) { + this.vertices[i].triangleStart = tStart; + tStart += this.vertices[i].triangleCount; + this.vertices[i].triangleCount = 0; + } + var newReferences = new Array(this.triangles.length * 3); + for (i = 0; i < this.triangles.length; ++i) { + t = this.triangles[i]; + for (j = 0; j < 3; ++j) { + v = t.vertices[j]; + newReferences[v.triangleStart + v.triangleCount] = new Reference(j, i); + v.triangleCount++; + } + } + this.references = newReferences; + if (identifyBorders) { + this.identifyBorder(); + } + }; + QuadraticErrorSimplification.prototype.vertexError = function (q, point) { + var x = point.x; + var y = point.y; + var z = point.z; + return q.data[0] * x * x + 2 * q.data[1] * x * y + 2 * q.data[2] * x * z + 2 * q.data[3] * x + q.data[4] * y * y + + 2 * q.data[5] * y * z + 2 * q.data[6] * y + q.data[7] * z * z + 2 * q.data[8] * z + q.data[9]; + }; + QuadraticErrorSimplification.prototype.calculateError = function (vertex1, vertex2, pointResult, normalResult, uvResult, colorResult) { + var q = vertex1.q.add(vertex2.q); + var border = vertex1.isBorder && vertex2.isBorder; + var error = 0; + var qDet = q.det(0, 1, 2, 1, 4, 5, 2, 5, 7); + if (qDet !== 0 && !border) { + if (!pointResult) { + pointResult = BABYLON.Vector3.Zero(); + } + pointResult.x = -1 / qDet * (q.det(1, 2, 3, 4, 5, 6, 5, 7, 8)); + pointResult.y = 1 / qDet * (q.det(0, 2, 3, 1, 5, 6, 2, 7, 8)); + pointResult.z = -1 / qDet * (q.det(0, 1, 3, 1, 4, 6, 2, 5, 8)); + error = this.vertexError(q, pointResult); + } + else { + var p3 = (vertex1.position.add(vertex2.position)).divide(new BABYLON.Vector3(2, 2, 2)); + //var norm3 = (vertex1.normal.add(vertex2.normal)).divide(new Vector3(2, 2, 2)).normalize(); + var error1 = this.vertexError(q, vertex1.position); + var error2 = this.vertexError(q, vertex2.position); + var error3 = this.vertexError(q, p3); + error = Math.min(error1, error2, error3); + if (error === error1) { + if (pointResult) { + pointResult.copyFrom(vertex1.position); + } + } + else if (error === error2) { + if (pointResult) { + pointResult.copyFrom(vertex2.position); + } + } + else { + if (pointResult) { + pointResult.copyFrom(p3); + } + } + } + return error; + }; + return QuadraticErrorSimplification; + }()); + BABYLON.QuadraticErrorSimplification = QuadraticErrorSimplification; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.meshSimplification.js.map + +var BABYLON; +(function (BABYLON) { + var serializedGeometries = []; + var serializeGeometry = function (geometry, serializationGeometries) { + if (serializedGeometries[geometry.id]) { + return; + } + if (geometry.doNotSerialize) { + return; + } + if (geometry instanceof BABYLON.Geometry.Primitives.Box) { + serializationGeometries.boxes.push(geometry.serialize()); + } + else if (geometry instanceof BABYLON.Geometry.Primitives.Sphere) { + serializationGeometries.spheres.push(geometry.serialize()); + } + else if (geometry instanceof BABYLON.Geometry.Primitives.Cylinder) { + serializationGeometries.cylinders.push(geometry.serialize()); + } + else if (geometry instanceof BABYLON.Geometry.Primitives.Torus) { + serializationGeometries.toruses.push(geometry.serialize()); + } + else if (geometry instanceof BABYLON.Geometry.Primitives.Ground) { + serializationGeometries.grounds.push(geometry.serialize()); + } + else if (geometry instanceof BABYLON.Geometry.Primitives.Plane) { + serializationGeometries.planes.push(geometry.serialize()); + } + else if (geometry instanceof BABYLON.Geometry.Primitives.TorusKnot) { + serializationGeometries.torusKnots.push(geometry.serialize()); + } + else if (geometry instanceof BABYLON.Geometry.Primitives._Primitive) { + throw new Error("Unknown primitive type"); + } + else { + serializationGeometries.vertexData.push(geometry.serializeVerticeData()); + } + serializedGeometries[geometry.id] = true; + }; + var serializeMesh = function (mesh, serializationScene) { + var serializationObject = {}; + serializationObject.name = mesh.name; + serializationObject.id = mesh.id; + if (BABYLON.Tags.HasTags(mesh)) { + serializationObject.tags = BABYLON.Tags.GetTags(mesh); + } + serializationObject.position = mesh.position.asArray(); + if (mesh.rotationQuaternion) { + serializationObject.rotationQuaternion = mesh.rotationQuaternion.asArray(); + } + else if (mesh.rotation) { + serializationObject.rotation = mesh.rotation.asArray(); + } + serializationObject.scaling = mesh.scaling.asArray(); + serializationObject.localMatrix = mesh.getPivotMatrix().asArray(); + serializationObject.isEnabled = mesh.isEnabled(); + serializationObject.isVisible = mesh.isVisible; + serializationObject.infiniteDistance = mesh.infiniteDistance; + serializationObject.pickable = mesh.isPickable; + serializationObject.receiveShadows = mesh.receiveShadows; + serializationObject.billboardMode = mesh.billboardMode; + serializationObject.visibility = mesh.visibility; + serializationObject.checkCollisions = mesh.checkCollisions; + serializationObject.isBlocker = mesh.isBlocker; + // Parent + if (mesh.parent) { + serializationObject.parentId = mesh.parent.id; + } + // Geometry + var geometry = mesh._geometry; + if (geometry) { + var geometryId = geometry.id; + serializationObject.geometryId = geometryId; + if (!mesh.getScene().getGeometryByID(geometryId)) { + // geometry was in the memory but not added to the scene, nevertheless it's better to serialize to be able to reload the mesh with its geometry + serializeGeometry(geometry, serializationScene.geometries); + } + // SubMeshes + serializationObject.subMeshes = []; + for (var subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) { + var subMesh = mesh.subMeshes[subIndex]; + serializationObject.subMeshes.push({ + materialIndex: subMesh.materialIndex, + verticesStart: subMesh.verticesStart, + verticesCount: subMesh.verticesCount, + indexStart: subMesh.indexStart, + indexCount: subMesh.indexCount + }); + } + } + // Material + if (mesh.material) { + serializationObject.materialId = mesh.material.id; + } + else { + mesh.material = null; + } + // Skeleton + if (mesh.skeleton) { + serializationObject.skeletonId = mesh.skeleton.id; + } + // Physics + //TODO implement correct serialization for physics impostors. + if (mesh.getPhysicsImpostor()) { + serializationObject.physicsMass = mesh.getPhysicsMass(); + serializationObject.physicsFriction = mesh.getPhysicsFriction(); + serializationObject.physicsRestitution = mesh.getPhysicsRestitution(); + serializationObject.physicsImpostor = mesh.getPhysicsImpostor().type; + } + // Metadata + if (mesh.metadata) { + serializationObject.metadata = mesh.metadata; + } + // Instances + serializationObject.instances = []; + for (var index = 0; index < mesh.instances.length; index++) { + var instance = mesh.instances[index]; + var serializationInstance = { + name: instance.name, + position: instance.position.asArray(), + scaling: instance.scaling.asArray() + }; + if (instance.rotationQuaternion) { + serializationInstance.rotationQuaternion = instance.rotationQuaternion.asArray(); + } + else if (instance.rotation) { + serializationInstance.rotation = instance.rotation.asArray(); + } + serializationObject.instances.push(serializationInstance); + // Animations + BABYLON.Animation.AppendSerializedAnimations(instance, serializationInstance); + serializationInstance.ranges = instance.serializeAnimationRanges(); + } + // Animations + BABYLON.Animation.AppendSerializedAnimations(mesh, serializationObject); + serializationObject.ranges = mesh.serializeAnimationRanges(); + // Layer mask + serializationObject.layerMask = mesh.layerMask; + // Alpha + serializationObject.alphaIndex = mesh.alphaIndex; + serializationObject.hasVertexAlpha = mesh.hasVertexAlpha; + // Overlay + serializationObject.overlayAlpha = mesh.overlayAlpha; + serializationObject.overlayColor = mesh.overlayColor.asArray(); + serializationObject.renderOverlay = mesh.renderOverlay; + // Fog + serializationObject.applyFog = mesh.applyFog; + // Action Manager + if (mesh.actionManager) { + serializationObject.actions = mesh.actionManager.serialize(mesh.name); + } + return serializationObject; + }; + var finalizeSingleMesh = function (mesh, serializationObject) { + //only works if the mesh is already loaded + if (mesh.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_LOADED || mesh.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_NONE) { + //serialize material + if (mesh.material) { + if (mesh.material instanceof BABYLON.StandardMaterial) { + serializationObject.materials = serializationObject.materials || []; + if (!serializationObject.materials.some(function (mat) { return (mat.id === mesh.material.id); })) { + serializationObject.materials.push(mesh.material.serialize()); + } + } + else if (mesh.material instanceof BABYLON.MultiMaterial) { + serializationObject.multiMaterials = serializationObject.multiMaterials || []; + if (!serializationObject.multiMaterials.some(function (mat) { return (mat.id === mesh.material.id); })) { + serializationObject.multiMaterials.push(mesh.material.serialize()); + } + } + } + //serialize geometry + var geometry = mesh._geometry; + if (geometry) { + if (!serializationObject.geometries) { + serializationObject.geometries = {}; + serializationObject.geometries.boxes = []; + serializationObject.geometries.spheres = []; + serializationObject.geometries.cylinders = []; + serializationObject.geometries.toruses = []; + serializationObject.geometries.grounds = []; + serializationObject.geometries.planes = []; + serializationObject.geometries.torusKnots = []; + serializationObject.geometries.vertexData = []; + } + serializeGeometry(geometry, serializationObject.geometries); + } + // Skeletons + if (mesh.skeleton) { + serializationObject.skeletons = serializationObject.skeletons || []; + serializationObject.skeletons.push(mesh.skeleton.serialize()); + } + //serialize the actual mesh + serializationObject.meshes = serializationObject.meshes || []; + serializationObject.meshes.push(serializeMesh(mesh, serializationObject)); + } + }; + var SceneSerializer = (function () { + function SceneSerializer() { + } + SceneSerializer.ClearCache = function () { + serializedGeometries = []; + }; + SceneSerializer.Serialize = function (scene) { + var serializationObject = {}; + // Scene + serializationObject.useDelayedTextureLoading = scene.useDelayedTextureLoading; + serializationObject.autoClear = scene.autoClear; + serializationObject.clearColor = scene.clearColor.asArray(); + serializationObject.ambientColor = scene.ambientColor.asArray(); + serializationObject.gravity = scene.gravity.asArray(); + serializationObject.collisionsEnabled = scene.collisionsEnabled; + serializationObject.workerCollisions = scene.workerCollisions; + // Fog + if (scene.fogMode && scene.fogMode !== 0) { + serializationObject.fogMode = scene.fogMode; + serializationObject.fogColor = scene.fogColor.asArray(); + serializationObject.fogStart = scene.fogStart; + serializationObject.fogEnd = scene.fogEnd; + serializationObject.fogDensity = scene.fogDensity; + } + //Physics + if (scene.isPhysicsEnabled()) { + serializationObject.physicsEnabled = true; + serializationObject.physicsGravity = scene.getPhysicsEngine().gravity.asArray(); + serializationObject.physicsEngine = scene.getPhysicsEngine().getPhysicsPluginName(); + } + // Metadata + if (scene.metadata) { + serializationObject.metadata = scene.metadata; + } + // Lights + serializationObject.lights = []; + var index; + var light; + for (index = 0; index < scene.lights.length; index++) { + light = scene.lights[index]; + if (!light.doNotSerialize) { + serializationObject.lights.push(light.serialize()); + } + } + // Cameras + serializationObject.cameras = []; + for (index = 0; index < scene.cameras.length; index++) { + var camera = scene.cameras[index]; + if (!camera.doNotSerialize) { + serializationObject.cameras.push(camera.serialize()); + } + } + if (scene.activeCamera) { + serializationObject.activeCameraID = scene.activeCamera.id; + } + // Animations + BABYLON.Animation.AppendSerializedAnimations(scene, serializationObject); + // Materials + serializationObject.materials = []; + serializationObject.multiMaterials = []; + var material; + for (index = 0; index < scene.materials.length; index++) { + material = scene.materials[index]; + if (!material.doNotSerialize) { + serializationObject.materials.push(material.serialize()); + } + } + // MultiMaterials + serializationObject.multiMaterials = []; + for (index = 0; index < scene.multiMaterials.length; index++) { + var multiMaterial = scene.multiMaterials[index]; + serializationObject.multiMaterials.push(multiMaterial.serialize()); + } + // Skeletons + serializationObject.skeletons = []; + for (index = 0; index < scene.skeletons.length; index++) { + serializationObject.skeletons.push(scene.skeletons[index].serialize()); + } + // Geometries + serializationObject.geometries = {}; + serializationObject.geometries.boxes = []; + serializationObject.geometries.spheres = []; + serializationObject.geometries.cylinders = []; + serializationObject.geometries.toruses = []; + serializationObject.geometries.grounds = []; + serializationObject.geometries.planes = []; + serializationObject.geometries.torusKnots = []; + serializationObject.geometries.vertexData = []; + serializedGeometries = []; + var geometries = scene.getGeometries(); + for (index = 0; index < geometries.length; index++) { + var geometry = geometries[index]; + if (geometry.isReady()) { + serializeGeometry(geometry, serializationObject.geometries); + } + } + // Meshes + serializationObject.meshes = []; + for (index = 0; index < scene.meshes.length; index++) { + var abstractMesh = scene.meshes[index]; + if (abstractMesh instanceof BABYLON.Mesh) { + var mesh = abstractMesh; + if (!mesh.doNotSerialize) { + if (mesh.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_LOADED || mesh.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_NONE) { + serializationObject.meshes.push(serializeMesh(mesh, serializationObject)); + } + } + } + } + // Particles Systems + serializationObject.particleSystems = []; + for (index = 0; index < scene.particleSystems.length; index++) { + serializationObject.particleSystems.push(scene.particleSystems[index].serialize()); + } + // Lens flares + serializationObject.lensFlareSystems = []; + for (index = 0; index < scene.lensFlareSystems.length; index++) { + serializationObject.lensFlareSystems.push(scene.lensFlareSystems[index].serialize()); + } + // Shadows + serializationObject.shadowGenerators = []; + for (index = 0; index < scene.lights.length; index++) { + light = scene.lights[index]; + var shadowGenerator = light.getShadowGenerator(); + // Only support serialization for official generator so far. + if (shadowGenerator && shadowGenerator instanceof BABYLON.ShadowGenerator) { + serializationObject.shadowGenerators.push(shadowGenerator.serialize()); + } + } + // Action Manager + if (scene.actionManager) { + serializationObject.actions = scene.actionManager.serialize("scene"); + } + // Audio + serializationObject.sounds = []; + for (index = 0; index < scene.soundTracks.length; index++) { + var soundtrack = scene.soundTracks[index]; + for (var soundId = 0; soundId < soundtrack.soundCollection.length; soundId++) { + serializationObject.sounds.push(soundtrack.soundCollection[soundId].serialize()); + } + } + return serializationObject; + }; + SceneSerializer.SerializeMesh = function (toSerialize /* Mesh || Mesh[] */, withParents, withChildren) { + if (withParents === void 0) { withParents = false; } + if (withChildren === void 0) { withChildren = false; } + var serializationObject = {}; + toSerialize = (toSerialize instanceof Array) ? toSerialize : [toSerialize]; + if (withParents || withChildren) { + //deliberate for loop! not for each, appended should be processed as well. + for (var i = 0; i < toSerialize.length; ++i) { + if (withChildren) { + toSerialize[i].getDescendants().forEach(function (node) { + if (node instanceof BABYLON.Mesh && (toSerialize.indexOf(node) < 0)) { + toSerialize.push(node); + } + }); + } + //make sure the array doesn't contain the object already + if (withParents && toSerialize[i].parent && (toSerialize.indexOf(toSerialize[i].parent) < 0)) { + toSerialize.push(toSerialize[i].parent); + } + } + } + toSerialize.forEach(function (mesh) { + finalizeSingleMesh(mesh, serializationObject); + }); + return serializationObject; + }; + return SceneSerializer; + }()); + BABYLON.SceneSerializer = SceneSerializer; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.sceneSerializer.js.map + +// All the credit goes to this project and the guy who's behind it https://github.com/mapbox/earcut +// Huge respect for a such great lib. +// Earcut license: +// Copyright (c) 2016, Mapbox +// +// Permission to use, copy, modify, and/or distribute this software for any purpose +// with or without fee is hereby granted, provided that the above copyright notice +// and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +// OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +// THIS SOFTWARE. +var Earcut; +(function (Earcut) { + /** + * The fastest and smallest JavaScript polygon triangulation library for your WebGL apps + * @param data is a flat array of vertice coordinates like [x0, y0, x1, y1, x2, y2, ...]. + * @param holeIndices is an array of hole indices if any (e.g. [5, 8] for a 12- vertice input would mean one hole with vertices 5–7 and another with 8–11). + * @param dim is the number of coordinates per vertice in the input array (2 by default). + */ + function earcut(data, holeIndices, dim) { + dim = dim || 2; + var hasHoles = holeIndices && holeIndices.length, outerLen = hasHoles ? holeIndices[0] * dim : data.length, outerNode = linkedList(data, 0, outerLen, dim, true), triangles = []; + if (!outerNode) + return triangles; + var minX, minY, maxX, maxY, x, y, size; + if (hasHoles) + outerNode = eliminateHoles(data, holeIndices, outerNode, dim); + // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox + if (data.length > 80 * dim) { + minX = maxX = data[0]; + minY = maxY = data[1]; + for (var i = dim; i < outerLen; i += dim) { + x = data[i]; + y = data[i + 1]; + if (x < minX) + minX = x; + if (y < minY) + minY = y; + if (x > maxX) + maxX = x; + if (y > maxY) + maxY = y; + } + // minX, minY and size are later used to transform coords into integers for z-order calculation + size = Math.max(maxX - minX, maxY - minY); + } + earcutLinked(outerNode, triangles, dim, minX, minY, size, undefined); + return triangles; + } + Earcut.earcut = earcut; + // create a circular doubly linked list from polygon points in the specified winding order + function linkedList(data, start, end, dim, clockwise) { + var i, last; + if (clockwise === (signedArea(data, start, end, dim) > 0)) { + for (i = start; i < end; i += dim) + last = insertNode(i, data[i], data[i + 1], last); + } + else { + for (i = end - dim; i >= start; i -= dim) + last = insertNode(i, data[i], data[i + 1], last); + } + if (last && equals(last, last.next)) { + removeNode(last); + last = last.next; + } + return last; + } + // eliminate colinear or duplicate points + function filterPoints(start, end) { + if (!start) + return start; + if (!end) + end = start; + var p = start, again; + do { + again = false; + if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) { + removeNode(p); + p = end = p.prev; + if (p === p.next) + return null; + again = true; + } + else { + p = p.next; + } + } while (again || p !== end); + return end; + } + // main ear slicing loop which triangulates a polygon (given as a linked list) + function earcutLinked(ear, triangles, dim, minX, minY, size, pass) { + if (!ear) + return; + // interlink polygon nodes in z-order + if (!pass && size) + indexCurve(ear, minX, minY, size); + var stop = ear, prev, next; + // iterate through ears, slicing them one by one + while (ear.prev !== ear.next) { + prev = ear.prev; + next = ear.next; + if (size ? isEarHashed(ear, minX, minY, size) : isEar(ear)) { + // cut off the triangle + triangles.push(prev.i / dim); + triangles.push(ear.i / dim); + triangles.push(next.i / dim); + removeNode(ear); + // skipping the next vertice leads to less sliver triangles + ear = next.next; + stop = next.next; + continue; + } + ear = next; + // if we looped through the whole remaining polygon and can't find any more ears + if (ear === stop) { + // try filtering points and slicing again + if (!pass) { + earcutLinked(filterPoints(ear, undefined), triangles, dim, minX, minY, size, 1); + } + else if (pass === 1) { + ear = cureLocalIntersections(ear, triangles, dim); + earcutLinked(ear, triangles, dim, minX, minY, size, 2); + } + else if (pass === 2) { + splitEarcut(ear, triangles, dim, minX, minY, size); + } + break; + } + } + } + // check whether a polygon node forms a valid ear with adjacent nodes + function isEar(ear) { + var a = ear.prev, b = ear, c = ear.next; + if (area(a, b, c) >= 0) + return false; // reflex, can't be an ear + // now make sure we don't have other points inside the potential ear + var p = ear.next.next; + while (p !== ear.prev) { + if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && + area(p.prev, p, p.next) >= 0) + return false; + p = p.next; + } + return true; + } + function isEarHashed(ear, minX, minY, size) { + var a = ear.prev, b = ear, c = ear.next; + if (area(a, b, c) >= 0) + return false; // reflex, can't be an ear + // triangle bbox; min & max are calculated like this for speed + var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x), minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y), maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x), maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y); + // z-order range for the current triangle bbox; + var minZ = zOrder(minTX, minTY, minX, minY, size), maxZ = zOrder(maxTX, maxTY, minX, minY, size); + // first look for points inside the triangle in increasing z-order + var p = ear.nextZ; + while (p && p.z <= maxZ) { + if (p !== ear.prev && + p !== ear.next && + pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && + area(p.prev, p, p.next) >= 0) + return false; + p = p.nextZ; + } + // then look for points in decreasing z-order + p = ear.prevZ; + while (p && p.z >= minZ) { + if (p !== ear.prev && + p !== ear.next && + pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && + area(p.prev, p, p.next) >= 0) + return false; + p = p.prevZ; + } + return true; + } + // go through all polygon nodes and cure small local self-intersections + function cureLocalIntersections(start, triangles, dim) { + var p = start; + do { + var a = p.prev, b = p.next.next; + if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) { + triangles.push(a.i / dim); + triangles.push(p.i / dim); + triangles.push(b.i / dim); + // remove two nodes involved + removeNode(p); + removeNode(p.next); + p = start = b; + } + p = p.next; + } while (p !== start); + return p; + } + // try splitting polygon into two and triangulate them independently + function splitEarcut(start, triangles, dim, minX, minY, size) { + // look for a valid diagonal that divides the polygon into two + var a = start; + do { + var b = a.next.next; + while (b !== a.prev) { + if (a.i !== b.i && isValidDiagonal(a, b)) { + // split the polygon in two by the diagonal + var c = splitPolygon(a, b); + // filter colinear points around the cuts + a = filterPoints(a, a.next); + c = filterPoints(c, c.next); + // run earcut on each half + earcutLinked(a, triangles, dim, minX, minY, size, undefined); + earcutLinked(c, triangles, dim, minX, minY, size, undefined); + return; + } + b = b.next; + } + a = a.next; + } while (a !== start); + } + // link every hole into the outer loop, producing a single-ring polygon without holes + function eliminateHoles(data, holeIndices, outerNode, dim) { + var queue = [], i, len, start, end, list; + for (i = 0, len = holeIndices.length; i < len; i++) { + start = holeIndices[i] * dim; + end = i < len - 1 ? holeIndices[i + 1] * dim : data.length; + list = linkedList(data, start, end, dim, false); + if (list === list.next) + list.steiner = true; + queue.push(getLeftmost(list)); + } + queue.sort(compareX); + // process holes from left to right + for (i = 0; i < queue.length; i++) { + eliminateHole(queue[i], outerNode); + outerNode = filterPoints(outerNode, outerNode.next); + } + return outerNode; + } + function compareX(a, b) { + return a.x - b.x; + } + // find a bridge between vertices that connects hole with an outer ring and and link it + function eliminateHole(hole, outerNode) { + outerNode = findHoleBridge(hole, outerNode); + if (outerNode) { + var b = splitPolygon(outerNode, hole); + filterPoints(b, b.next); + } + } + // David Eberly's algorithm for finding a bridge between hole and outer polygon + function findHoleBridge(hole, outerNode) { + var p = outerNode, hx = hole.x, hy = hole.y, qx = -Infinity, m; + // find a segment intersected by a ray from the hole's leftmost point to the left; + // segment's endpoint with lesser x will be potential connection point + do { + if (hy <= p.y && hy >= p.next.y) { + var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y); + if (x <= hx && x > qx) { + qx = x; + if (x === hx) { + if (hy === p.y) + return p; + if (hy === p.next.y) + return p.next; + } + m = p.x < p.next.x ? p : p.next; + } + } + p = p.next; + } while (p !== outerNode); + if (!m) + return null; + if (hx === qx) + return m.prev; // hole touches outer segment; pick lower endpoint + // look for points inside the triangle of hole point, segment intersection and endpoint; + // if there are no points found, we have a valid connection; + // otherwise choose the point of the minimum angle with the ray as connection point + var stop = m, mx = m.x, my = m.y, tanMin = Infinity, tan; + p = m.next; + while (p !== stop) { + if (hx >= p.x && + p.x >= mx && + pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) { + tan = Math.abs(hy - p.y) / (hx - p.x); // tangential + if ((tan < tanMin || (tan === tanMin && p.x > m.x)) && locallyInside(p, hole)) { + m = p; + tanMin = tan; + } + } + p = p.next; + } + return m; + } + // interlink polygon nodes in z-order + function indexCurve(start, minX, minY, size) { + var p = start; + do { + if (p.z === null) + p.z = zOrder(p.x, p.y, minX, minY, size); + p.prevZ = p.prev; + p.nextZ = p.next; + p = p.next; + } while (p !== start); + p.prevZ.nextZ = null; + p.prevZ = null; + sortLinked(p); + } + // Simon Tatham's linked list merge sort algorithm + // http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html + function sortLinked(list) { + var i, p, q, e, tail, numMerges, pSize, qSize, inSize = 1; + do { + p = list; + list = null; + tail = null; + numMerges = 0; + while (p) { + numMerges++; + q = p; + pSize = 0; + for (i = 0; i < inSize; i++) { + pSize++; + q = q.nextZ; + if (!q) + break; + } + qSize = inSize; + while (pSize > 0 || (qSize > 0 && q)) { + if (pSize === 0) { + e = q; + q = q.nextZ; + qSize--; + } + else if (qSize === 0 || !q) { + e = p; + p = p.nextZ; + pSize--; + } + else if (p.z <= q.z) { + e = p; + p = p.nextZ; + pSize--; + } + else { + e = q; + q = q.nextZ; + qSize--; + } + if (tail) + tail.nextZ = e; + else + list = e; + e.prevZ = tail; + tail = e; + } + p = q; + } + tail.nextZ = null; + inSize *= 2; + } while (numMerges > 1); + return list; + } + // z-order of a point given coords and size of the data bounding box + function zOrder(x, y, minX, minY, size) { + // coords are transformed into non-negative 15-bit integer range + x = 32767 * (x - minX) / size; + y = 32767 * (y - minY) / size; + x = (x | (x << 8)) & 0x00FF00FF; + x = (x | (x << 4)) & 0x0F0F0F0F; + x = (x | (x << 2)) & 0x33333333; + x = (x | (x << 1)) & 0x55555555; + y = (y | (y << 8)) & 0x00FF00FF; + y = (y | (y << 4)) & 0x0F0F0F0F; + y = (y | (y << 2)) & 0x33333333; + y = (y | (y << 1)) & 0x55555555; + return x | (y << 1); + } + // find the leftmost node of a polygon ring + function getLeftmost(start) { + var p = start, leftmost = start; + do { + if (p.x < leftmost.x) + leftmost = p; + p = p.next; + } while (p !== start); + return leftmost; + } + // check if a point lies within a convex triangle + function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) { + return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 && + (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 && + (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0; + } + // check if a diagonal between two polygon nodes is valid (lies in polygon interior) + function isValidDiagonal(a, b) { + return a.next.i !== b.i && + a.prev.i !== b.i && + !intersectsPolygon(a, b) && + locallyInside(a, b) && + locallyInside(b, a) && + middleInside(a, b); + } + // signed area of a triangle + function area(p, q, r) { + return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y); + } + // check if two points are equal + function equals(p1, p2) { + return p1.x === p2.x && p1.y === p2.y; + } + // check if two segments intersect + function intersects(p1, q1, p2, q2) { + if ((equals(p1, q1) && equals(p2, q2)) || + (equals(p1, q2) && equals(p2, q1))) + return true; + return area(p1, q1, p2) > 0 !== area(p1, q1, q2) > 0 && + area(p2, q2, p1) > 0 !== area(p2, q2, q1) > 0; + } + // check if a polygon diagonal intersects any polygon segments + function intersectsPolygon(a, b) { + var p = a; + do { + if (p.i !== a.i && + p.next.i !== a.i && + p.i !== b.i && + p.next.i !== b.i && + intersects(p, p.next, a, b)) + return true; + p = p.next; + } while (p !== a); + return false; + } + // check if a polygon diagonal is locally inside the polygon + function locallyInside(a, b) { + return area(a.prev, a, a.next) < 0 + ? area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 + : area(a, b, a.prev) < 0 || area(a, a.next, b) < 0; + } + // check if the middle point of a polygon diagonal is inside the polygon + function middleInside(a, b) { + var p = a, inside = false, px = (a.x + b.x) / 2, py = (a.y + b.y) / 2; + do { + if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x)) + inside = !inside; + p = p.next; + } while (p !== a); + return inside; + } + // link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two; + // if one belongs to the outer ring and another to a hole, it merges it into a single ring + function splitPolygon(a, b) { + var a2 = new Node(a.i, a.x, a.y), b2 = new Node(b.i, b.x, b.y), an = a.next, bp = b.prev; + a.next = b; + b.prev = a; + a2.next = an; + an.prev = a2; + b2.next = a2; + a2.prev = b2; + bp.next = b2; + b2.prev = bp; + return b2; + } + // create a node and optionally link it with previous one (in a circular doubly linked list) + function insertNode(i, x, y, last) { + var p = new Node(i, x, y); + if (!last) { + p.prev = p; + p.next = p; + } + else { + p.next = last.next; + p.prev = last; + last.next.prev = p; + last.next = p; + } + return p; + } + function removeNode(p) { + p.next.prev = p.prev; + p.prev.next = p.next; + if (p.prevZ) + p.prevZ.nextZ = p.nextZ; + if (p.nextZ) + p.nextZ.prevZ = p.prevZ; + } + function Node(i, x, y) { + // vertice index in coordinates array + this.i = i; + // vertex coordinates + this.x = x; + this.y = y; + // previous and next vertice nodes in a polygon ring + this.prev = null; + this.next = null; + // z-order curve value + this.z = null; + // previous and next nodes in z-order + this.prevZ = null; + this.nextZ = null; + // indicates whether this is a steiner point + this.steiner = false; + } + /** + * return a percentage difference between the polygon area and its triangulation area; + * used to verify correctness of triangulation + */ + function deviation(data, holeIndices, dim, triangles) { + var hasHoles = holeIndices && holeIndices.length; + var outerLen = hasHoles ? holeIndices[0] * dim : data.length; + var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim)); + if (hasHoles) { + for (var i = 0, len = holeIndices.length; i < len; i++) { + var start = holeIndices[i] * dim; + var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length; + polygonArea -= Math.abs(signedArea(data, start, end, dim)); + } + } + var trianglesArea = 0; + for (i = 0; i < triangles.length; i += 3) { + var a = triangles[i] * dim; + var b = triangles[i + 1] * dim; + var c = triangles[i + 2] * dim; + trianglesArea += Math.abs((data[a] - data[c]) * (data[b + 1] - data[a + 1]) - + (data[a] - data[b]) * (data[c + 1] - data[a + 1])); + } + return polygonArea === 0 && trianglesArea === 0 ? 0 : Math.abs((trianglesArea - polygonArea) / polygonArea); + } + Earcut.deviation = deviation; + ; + function signedArea(data, start, end, dim) { + var sum = 0; + for (var i = start, j = end - dim; i < end; i += dim) { + sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]); + j = i; + } + return sum; + } + /** + * turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts + */ + function flatten(data) { + var dim = data[0][0].length, result = { vertices: [], holes: [], dimensions: dim }, holeIndex = 0; + for (var i = 0; i < data.length; i++) { + for (var j = 0; j < data[i].length; j++) { + for (var d = 0; d < dim; d++) + result.vertices.push(data[i][j][d]); + } + if (i > 0) { + holeIndex += data[i - 1].length; + result.holes.push(holeIndex); + } + } + return result; + } + Earcut.flatten = flatten; + ; +})(Earcut || (Earcut = {})); + +//# sourceMappingURL=babylon.earcut.js.map + +var BABYLON; +(function (BABYLON) { + // Unique ID when we import meshes from Babylon to CSG + var currentCSGMeshId = 0; + // # class Vertex + // Represents a vertex of a polygon. Use your own vertex class instead of this + // one to provide additional features like texture coordinates and vertex + // colors. Custom vertex classes need to provide a `pos` property and `clone()`, + // `flip()`, and `interpolate()` methods that behave analogous to the ones + // defined by `BABYLON.CSG.Vertex`. This class provides `normal` so convenience + // functions like `BABYLON.CSG.sphere()` can return a smooth vertex normal, but `normal` + // is not used anywhere else. + // Same goes for uv, it allows to keep the original vertex uv coordinates of the 2 meshes + var Vertex = (function () { + function Vertex(pos, normal, uv) { + this.pos = pos; + this.normal = normal; + this.uv = uv; + } + Vertex.prototype.clone = function () { + return new Vertex(this.pos.clone(), this.normal.clone(), this.uv.clone()); + }; + // Invert all orientation-specific data (e.g. vertex normal). Called when the + // orientation of a polygon is flipped. + Vertex.prototype.flip = function () { + this.normal = this.normal.scale(-1); + }; + // Create a new vertex between this vertex and `other` by linearly + // interpolating all properties using a parameter of `t`. Subclasses should + // override this to interpolate additional properties. + Vertex.prototype.interpolate = function (other, t) { + return new Vertex(BABYLON.Vector3.Lerp(this.pos, other.pos, t), BABYLON.Vector3.Lerp(this.normal, other.normal, t), BABYLON.Vector2.Lerp(this.uv, other.uv, t)); + }; + return Vertex; + }()); + // # class Plane + // Represents a plane in 3D space. + var Plane = (function () { + function Plane(normal, w) { + this.normal = normal; + this.w = w; + } + Plane.FromPoints = function (a, b, c) { + var v0 = c.subtract(a); + var v1 = b.subtract(a); + if (v0.lengthSquared() === 0 || v1.lengthSquared() === 0) { + return null; + } + var n = BABYLON.Vector3.Normalize(BABYLON.Vector3.Cross(v0, v1)); + return new Plane(n, BABYLON.Vector3.Dot(n, a)); + }; + Plane.prototype.clone = function () { + return new Plane(this.normal.clone(), this.w); + }; + Plane.prototype.flip = function () { + this.normal.scaleInPlace(-1); + this.w = -this.w; + }; + // Split `polygon` by this plane if needed, then put the polygon or polygon + // fragments in the appropriate lists. Coplanar polygons go into either + // `coplanarFront` or `coplanarBack` depending on their orientation with + // respect to this plane. Polygons in front or in back of this plane go into + // either `front` or `back`. + Plane.prototype.splitPolygon = function (polygon, coplanarFront, coplanarBack, front, back) { + var COPLANAR = 0; + var FRONT = 1; + var BACK = 2; + var SPANNING = 3; + // Classify each point as well as the entire polygon into one of the above + // four classes. + var polygonType = 0; + var types = []; + var i; + var t; + for (i = 0; i < polygon.vertices.length; i++) { + t = BABYLON.Vector3.Dot(this.normal, polygon.vertices[i].pos) - this.w; + var type = (t < -Plane.EPSILON) ? BACK : (t > Plane.EPSILON) ? FRONT : COPLANAR; + polygonType |= type; + types.push(type); + } + // Put the polygon in the correct list, splitting it when necessary. + switch (polygonType) { + case COPLANAR: + (BABYLON.Vector3.Dot(this.normal, polygon.plane.normal) > 0 ? coplanarFront : coplanarBack).push(polygon); + break; + case FRONT: + front.push(polygon); + break; + case BACK: + back.push(polygon); + break; + case SPANNING: + var f = [], b = []; + for (i = 0; i < polygon.vertices.length; i++) { + var j = (i + 1) % polygon.vertices.length; + var ti = types[i], tj = types[j]; + var vi = polygon.vertices[i], vj = polygon.vertices[j]; + if (ti !== BACK) + f.push(vi); + if (ti !== FRONT) + b.push(ti !== BACK ? vi.clone() : vi); + if ((ti | tj) === SPANNING) { + t = (this.w - BABYLON.Vector3.Dot(this.normal, vi.pos)) / BABYLON.Vector3.Dot(this.normal, vj.pos.subtract(vi.pos)); + var v = vi.interpolate(vj, t); + f.push(v); + b.push(v.clone()); + } + } + var poly; + if (f.length >= 3) { + poly = new Polygon(f, polygon.shared); + if (poly.plane) + front.push(poly); + } + if (b.length >= 3) { + poly = new Polygon(b, polygon.shared); + if (poly.plane) + back.push(poly); + } + break; + } + }; + // `BABYLON.CSG.Plane.EPSILON` is the tolerance used by `splitPolygon()` to decide if a + // point is on the plane. + Plane.EPSILON = 1e-5; + return Plane; + }()); + // # class Polygon + // Represents a convex polygon. The vertices used to initialize a polygon must + // be coplanar and form a convex loop. + // + // Each convex polygon has a `shared` property, which is shared between all + // polygons that are clones of each other or were split from the same polygon. + // This can be used to define per-polygon properties (such as surface color). + var Polygon = (function () { + function Polygon(vertices, shared) { + this.vertices = vertices; + this.shared = shared; + this.plane = Plane.FromPoints(vertices[0].pos, vertices[1].pos, vertices[2].pos); + } + Polygon.prototype.clone = function () { + var vertices = this.vertices.map(function (v) { return v.clone(); }); + return new Polygon(vertices, this.shared); + }; + Polygon.prototype.flip = function () { + this.vertices.reverse().map(function (v) { v.flip(); }); + this.plane.flip(); + }; + return Polygon; + }()); + // # class Node + // Holds a node in a BSP tree. A BSP tree is built from a collection of polygons + // by picking a polygon to split along. That polygon (and all other coplanar + // polygons) are added directly to that node and the other polygons are added to + // the front and/or back subtrees. This is not a leafy BSP tree since there is + // no distinction between internal and leaf nodes. + var Node = (function () { + function Node(polygons) { + this.plane = null; + this.front = null; + this.back = null; + this.polygons = []; + if (polygons) { + this.build(polygons); + } + } + Node.prototype.clone = function () { + var node = new Node(); + node.plane = this.plane && this.plane.clone(); + node.front = this.front && this.front.clone(); + node.back = this.back && this.back.clone(); + node.polygons = this.polygons.map(function (p) { return p.clone(); }); + return node; + }; + // Convert solid space to empty space and empty space to solid space. + Node.prototype.invert = function () { + for (var i = 0; i < this.polygons.length; i++) { + this.polygons[i].flip(); + } + if (this.plane) { + this.plane.flip(); + } + if (this.front) { + this.front.invert(); + } + if (this.back) { + this.back.invert(); + } + var temp = this.front; + this.front = this.back; + this.back = temp; + }; + // Recursively remove all polygons in `polygons` that are inside this BSP + // tree. + Node.prototype.clipPolygons = function (polygons) { + if (!this.plane) + return polygons.slice(); + var front = [], back = []; + for (var i = 0; i < polygons.length; i++) { + this.plane.splitPolygon(polygons[i], front, back, front, back); + } + if (this.front) { + front = this.front.clipPolygons(front); + } + if (this.back) { + back = this.back.clipPolygons(back); + } + else { + back = []; + } + return front.concat(back); + }; + // Remove all polygons in this BSP tree that are inside the other BSP tree + // `bsp`. + Node.prototype.clipTo = function (bsp) { + this.polygons = bsp.clipPolygons(this.polygons); + if (this.front) + this.front.clipTo(bsp); + if (this.back) + this.back.clipTo(bsp); + }; + // Return a list of all polygons in this BSP tree. + Node.prototype.allPolygons = function () { + var polygons = this.polygons.slice(); + if (this.front) + polygons = polygons.concat(this.front.allPolygons()); + if (this.back) + polygons = polygons.concat(this.back.allPolygons()); + return polygons; + }; + // Build a BSP tree out of `polygons`. When called on an existing tree, the + // new polygons are filtered down to the bottom of the tree and become new + // nodes there. Each set of polygons is partitioned using the first polygon + // (no heuristic is used to pick a good split). + Node.prototype.build = function (polygons) { + if (!polygons.length) + return; + if (!this.plane) + this.plane = polygons[0].plane.clone(); + var front = [], back = []; + for (var i = 0; i < polygons.length; i++) { + this.plane.splitPolygon(polygons[i], this.polygons, this.polygons, front, back); + } + if (front.length) { + if (!this.front) + this.front = new Node(); + this.front.build(front); + } + if (back.length) { + if (!this.back) + this.back = new Node(); + this.back.build(back); + } + }; + return Node; + }()); + var CSG = (function () { + function CSG() { + this.polygons = new Array(); + } + // Convert BABYLON.Mesh to BABYLON.CSG + CSG.FromMesh = function (mesh) { + var vertex, normal, uv, position, polygon, polygons = new Array(), vertices; + var matrix, meshPosition, meshRotation, meshRotationQuaternion, meshScaling; + if (mesh instanceof BABYLON.Mesh) { + mesh.computeWorldMatrix(true); + matrix = mesh.getWorldMatrix(); + meshPosition = mesh.position.clone(); + meshRotation = mesh.rotation.clone(); + if (mesh.rotationQuaternion) { + meshRotationQuaternion = mesh.rotationQuaternion.clone(); + } + meshScaling = mesh.scaling.clone(); + } + else { + throw 'BABYLON.CSG: Wrong Mesh type, must be BABYLON.Mesh'; + } + var indices = mesh.getIndices(), positions = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind), normals = mesh.getVerticesData(BABYLON.VertexBuffer.NormalKind), uvs = mesh.getVerticesData(BABYLON.VertexBuffer.UVKind); + var subMeshes = mesh.subMeshes; + for (var sm = 0, sml = subMeshes.length; sm < sml; sm++) { + for (var i = subMeshes[sm].indexStart, il = subMeshes[sm].indexCount + subMeshes[sm].indexStart; i < il; i += 3) { + vertices = []; + for (var j = 0; j < 3; j++) { + var sourceNormal = new BABYLON.Vector3(normals[indices[i + j] * 3], normals[indices[i + j] * 3 + 1], normals[indices[i + j] * 3 + 2]); + uv = new BABYLON.Vector2(uvs[indices[i + j] * 2], uvs[indices[i + j] * 2 + 1]); + var sourcePosition = new BABYLON.Vector3(positions[indices[i + j] * 3], positions[indices[i + j] * 3 + 1], positions[indices[i + j] * 3 + 2]); + position = BABYLON.Vector3.TransformCoordinates(sourcePosition, matrix); + normal = BABYLON.Vector3.TransformNormal(sourceNormal, matrix); + vertex = new Vertex(position, normal, uv); + vertices.push(vertex); + } + polygon = new Polygon(vertices, { subMeshId: sm, meshId: currentCSGMeshId, materialIndex: subMeshes[sm].materialIndex }); + // To handle the case of degenerated triangle + // polygon.plane == null <=> the polygon does not represent 1 single plane <=> the triangle is degenerated + if (polygon.plane) + polygons.push(polygon); + } + } + var csg = CSG.FromPolygons(polygons); + csg.matrix = matrix; + csg.position = meshPosition; + csg.rotation = meshRotation; + csg.scaling = meshScaling; + csg.rotationQuaternion = meshRotationQuaternion; + currentCSGMeshId++; + return csg; + }; + // Construct a BABYLON.CSG solid from a list of `BABYLON.CSG.Polygon` instances. + CSG.FromPolygons = function (polygons) { + var csg = new CSG(); + csg.polygons = polygons; + return csg; + }; + CSG.prototype.clone = function () { + var csg = new CSG(); + csg.polygons = this.polygons.map(function (p) { return p.clone(); }); + csg.copyTransformAttributes(this); + return csg; + }; + CSG.prototype.toPolygons = function () { + return this.polygons; + }; + CSG.prototype.union = function (csg) { + var a = new Node(this.clone().polygons); + var b = new Node(csg.clone().polygons); + a.clipTo(b); + b.clipTo(a); + b.invert(); + b.clipTo(a); + b.invert(); + a.build(b.allPolygons()); + return CSG.FromPolygons(a.allPolygons()).copyTransformAttributes(this); + }; + CSG.prototype.unionInPlace = function (csg) { + var a = new Node(this.polygons); + var b = new Node(csg.polygons); + a.clipTo(b); + b.clipTo(a); + b.invert(); + b.clipTo(a); + b.invert(); + a.build(b.allPolygons()); + this.polygons = a.allPolygons(); + }; + CSG.prototype.subtract = function (csg) { + var a = new Node(this.clone().polygons); + var b = new Node(csg.clone().polygons); + a.invert(); + a.clipTo(b); + b.clipTo(a); + b.invert(); + b.clipTo(a); + b.invert(); + a.build(b.allPolygons()); + a.invert(); + return CSG.FromPolygons(a.allPolygons()).copyTransformAttributes(this); + }; + CSG.prototype.subtractInPlace = function (csg) { + var a = new Node(this.polygons); + var b = new Node(csg.polygons); + a.invert(); + a.clipTo(b); + b.clipTo(a); + b.invert(); + b.clipTo(a); + b.invert(); + a.build(b.allPolygons()); + a.invert(); + this.polygons = a.allPolygons(); + }; + CSG.prototype.intersect = function (csg) { + var a = new Node(this.clone().polygons); + var b = new Node(csg.clone().polygons); + a.invert(); + b.clipTo(a); + b.invert(); + a.clipTo(b); + b.clipTo(a); + a.build(b.allPolygons()); + a.invert(); + return CSG.FromPolygons(a.allPolygons()).copyTransformAttributes(this); + }; + CSG.prototype.intersectInPlace = function (csg) { + var a = new Node(this.polygons); + var b = new Node(csg.polygons); + a.invert(); + b.clipTo(a); + b.invert(); + a.clipTo(b); + b.clipTo(a); + a.build(b.allPolygons()); + a.invert(); + this.polygons = a.allPolygons(); + }; + // Return a new BABYLON.CSG solid with solid and empty space switched. This solid is + // not modified. + CSG.prototype.inverse = function () { + var csg = this.clone(); + csg.inverseInPlace(); + return csg; + }; + CSG.prototype.inverseInPlace = function () { + this.polygons.map(function (p) { p.flip(); }); + }; + // This is used to keep meshes transformations so they can be restored + // when we build back a Babylon Mesh + // NB : All CSG operations are performed in world coordinates + CSG.prototype.copyTransformAttributes = function (csg) { + this.matrix = csg.matrix; + this.position = csg.position; + this.rotation = csg.rotation; + this.scaling = csg.scaling; + this.rotationQuaternion = csg.rotationQuaternion; + return this; + }; + // Build Raw mesh from CSG + // Coordinates here are in world space + CSG.prototype.buildMeshGeometry = function (name, scene, keepSubMeshes) { + var matrix = this.matrix.clone(); + matrix.invert(); + var mesh = new BABYLON.Mesh(name, scene), vertices = [], indices = [], normals = [], uvs = [], vertex = BABYLON.Vector3.Zero(), normal = BABYLON.Vector3.Zero(), uv = BABYLON.Vector2.Zero(), polygons = this.polygons, polygonIndices = [0, 0, 0], polygon, vertice_dict = {}, vertex_idx, currentIndex = 0, subMesh_dict = {}, subMesh_obj; + if (keepSubMeshes) { + // Sort Polygons, since subMeshes are indices range + polygons.sort(function (a, b) { + if (a.shared.meshId === b.shared.meshId) { + return a.shared.subMeshId - b.shared.subMeshId; + } + else { + return a.shared.meshId - b.shared.meshId; + } + }); + } + for (var i = 0, il = polygons.length; i < il; i++) { + polygon = polygons[i]; + // Building SubMeshes + if (!subMesh_dict[polygon.shared.meshId]) { + subMesh_dict[polygon.shared.meshId] = {}; + } + if (!subMesh_dict[polygon.shared.meshId][polygon.shared.subMeshId]) { + subMesh_dict[polygon.shared.meshId][polygon.shared.subMeshId] = { + indexStart: +Infinity, + indexEnd: -Infinity, + materialIndex: polygon.shared.materialIndex + }; + } + subMesh_obj = subMesh_dict[polygon.shared.meshId][polygon.shared.subMeshId]; + for (var j = 2, jl = polygon.vertices.length; j < jl; j++) { + polygonIndices[0] = 0; + polygonIndices[1] = j - 1; + polygonIndices[2] = j; + for (var k = 0; k < 3; k++) { + vertex.copyFrom(polygon.vertices[polygonIndices[k]].pos); + normal.copyFrom(polygon.vertices[polygonIndices[k]].normal); + uv.copyFrom(polygon.vertices[polygonIndices[k]].uv); + var localVertex = BABYLON.Vector3.TransformCoordinates(vertex, matrix); + var localNormal = BABYLON.Vector3.TransformNormal(normal, matrix); + vertex_idx = vertice_dict[localVertex.x + ',' + localVertex.y + ',' + localVertex.z]; + // Check if 2 points can be merged + if (!(typeof vertex_idx !== 'undefined' && + normals[vertex_idx * 3] === localNormal.x && + normals[vertex_idx * 3 + 1] === localNormal.y && + normals[vertex_idx * 3 + 2] === localNormal.z && + uvs[vertex_idx * 2] === uv.x && + uvs[vertex_idx * 2 + 1] === uv.y)) { + vertices.push(localVertex.x, localVertex.y, localVertex.z); + uvs.push(uv.x, uv.y); + normals.push(normal.x, normal.y, normal.z); + vertex_idx = vertice_dict[localVertex.x + ',' + localVertex.y + ',' + localVertex.z] = (vertices.length / 3) - 1; + } + indices.push(vertex_idx); + subMesh_obj.indexStart = Math.min(currentIndex, subMesh_obj.indexStart); + subMesh_obj.indexEnd = Math.max(currentIndex, subMesh_obj.indexEnd); + currentIndex++; + } + } + } + mesh.setVerticesData(BABYLON.VertexBuffer.PositionKind, vertices); + mesh.setVerticesData(BABYLON.VertexBuffer.NormalKind, normals); + mesh.setVerticesData(BABYLON.VertexBuffer.UVKind, uvs); + mesh.setIndices(indices); + if (keepSubMeshes) { + // We offset the materialIndex by the previous number of materials in the CSG mixed meshes + var materialIndexOffset = 0, materialMaxIndex; + mesh.subMeshes = new Array(); + for (var m in subMesh_dict) { + materialMaxIndex = -1; + for (var sm in subMesh_dict[m]) { + subMesh_obj = subMesh_dict[m][sm]; + BABYLON.SubMesh.CreateFromIndices(subMesh_obj.materialIndex + materialIndexOffset, subMesh_obj.indexStart, subMesh_obj.indexEnd - subMesh_obj.indexStart + 1, mesh); + materialMaxIndex = Math.max(subMesh_obj.materialIndex, materialMaxIndex); + } + materialIndexOffset += ++materialMaxIndex; + } + } + return mesh; + }; + // Build Mesh from CSG taking material and transforms into account + CSG.prototype.toMesh = function (name, material, scene, keepSubMeshes) { + var mesh = this.buildMeshGeometry(name, scene, keepSubMeshes); + mesh.material = material; + mesh.position.copyFrom(this.position); + mesh.rotation.copyFrom(this.rotation); + if (this.rotationQuaternion) { + mesh.rotationQuaternion = this.rotationQuaternion.clone(); + } + mesh.scaling.copyFrom(this.scaling); + mesh.computeWorldMatrix(true); + return mesh; + }; + return CSG; + }()); + BABYLON.CSG = CSG; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.csg.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var VRDistortionCorrectionPostProcess = (function (_super) { + __extends(VRDistortionCorrectionPostProcess, _super); + //ANY + function VRDistortionCorrectionPostProcess(name, camera, isRightEye, vrMetrics) { + var _this = this; + _super.call(this, name, "vrDistortionCorrection", [ + 'LensCenter', + 'Scale', + 'ScaleIn', + 'HmdWarpParam' + ], null, vrMetrics.postProcessScaleFactor, camera, BABYLON.Texture.BILINEAR_SAMPLINGMODE, null, null); + this._isRightEye = isRightEye; + this._distortionFactors = vrMetrics.distortionK; + this._postProcessScaleFactor = vrMetrics.postProcessScaleFactor; + this._lensCenterOffset = vrMetrics.lensCenterOffset; + this.onSizeChangedObservable.add(function () { + _this.aspectRatio = _this.width * .5 / _this.height; + _this._scaleIn = new BABYLON.Vector2(2, 2 / _this.aspectRatio); + _this._scaleFactor = new BABYLON.Vector2(.5 * (1 / _this._postProcessScaleFactor), .5 * (1 / _this._postProcessScaleFactor) * _this.aspectRatio); + _this._lensCenter = new BABYLON.Vector2(_this._isRightEye ? 0.5 - _this._lensCenterOffset * 0.5 : 0.5 + _this._lensCenterOffset * 0.5, 0.5); + }); + this.onApplyObservable.add(function (effect) { + effect.setFloat2("LensCenter", _this._lensCenter.x, _this._lensCenter.y); + effect.setFloat2("Scale", _this._scaleFactor.x, _this._scaleFactor.y); + effect.setFloat2("ScaleIn", _this._scaleIn.x, _this._scaleIn.y); + effect.setFloat4("HmdWarpParam", _this._distortionFactors[0], _this._distortionFactors[1], _this._distortionFactors[2], _this._distortionFactors[3]); + }); + } + return VRDistortionCorrectionPostProcess; + }(BABYLON.PostProcess)); + BABYLON.VRDistortionCorrectionPostProcess = VRDistortionCorrectionPostProcess; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.vrDistortionCorrectionPostProcess.js.map + +// Mainly based on these 2 articles : +// Creating an universal virtual touch joystick working for all Touch models thanks to Hand.JS : http://blogs.msdn.com/b/davrous/archive/2013/02/22/creating-an-universal-virtual-touch-joystick-working-for-all-touch-models-thanks-to-hand-js.aspx +// & on Seb Lee-Delisle original work: http://seb.ly/2011/04/multi-touch-game-controller-in-javascripthtml5-for-ipad/ +var BABYLON; +(function (BABYLON) { + (function (JoystickAxis) { + JoystickAxis[JoystickAxis["X"] = 0] = "X"; + JoystickAxis[JoystickAxis["Y"] = 1] = "Y"; + JoystickAxis[JoystickAxis["Z"] = 2] = "Z"; + })(BABYLON.JoystickAxis || (BABYLON.JoystickAxis = {})); + var JoystickAxis = BABYLON.JoystickAxis; + var VirtualJoystick = (function () { + function VirtualJoystick(leftJoystick) { + var _this = this; + if (leftJoystick) { + this._leftJoystick = true; + } + else { + this._leftJoystick = false; + } + this._joystickIndex = VirtualJoystick._globalJoystickIndex; + VirtualJoystick._globalJoystickIndex++; + // By default left & right arrow keys are moving the X + // and up & down keys are moving the Y + this._axisTargetedByLeftAndRight = JoystickAxis.X; + this._axisTargetedByUpAndDown = JoystickAxis.Y; + this.reverseLeftRight = false; + this.reverseUpDown = false; + // collections of pointers + this._touches = new BABYLON.StringDictionary(); + this.deltaPosition = BABYLON.Vector3.Zero(); + this._joystickSensibility = 25; + this._inversedSensibility = 1 / (this._joystickSensibility / 1000); + this._rotationSpeed = 25; + this._inverseRotationSpeed = 1 / (this._rotationSpeed / 1000); + this._rotateOnAxisRelativeToMesh = false; + this._onResize = function (evt) { + VirtualJoystick.vjCanvasWidth = window.innerWidth; + VirtualJoystick.vjCanvasHeight = window.innerHeight; + VirtualJoystick.vjCanvas.width = VirtualJoystick.vjCanvasWidth; + VirtualJoystick.vjCanvas.height = VirtualJoystick.vjCanvasHeight; + VirtualJoystick.halfWidth = VirtualJoystick.vjCanvasWidth / 2; + VirtualJoystick.halfHeight = VirtualJoystick.vjCanvasHeight / 2; + }; + // injecting a canvas element on top of the canvas 3D game + if (!VirtualJoystick.vjCanvas) { + window.addEventListener("resize", this._onResize, false); + VirtualJoystick.vjCanvas = document.createElement("canvas"); + VirtualJoystick.vjCanvasWidth = window.innerWidth; + VirtualJoystick.vjCanvasHeight = window.innerHeight; + VirtualJoystick.vjCanvas.width = window.innerWidth; + VirtualJoystick.vjCanvas.height = window.innerHeight; + VirtualJoystick.vjCanvas.style.width = "100%"; + VirtualJoystick.vjCanvas.style.height = "100%"; + VirtualJoystick.vjCanvas.style.position = "absolute"; + VirtualJoystick.vjCanvas.style.backgroundColor = "transparent"; + VirtualJoystick.vjCanvas.style.top = "0px"; + VirtualJoystick.vjCanvas.style.left = "0px"; + VirtualJoystick.vjCanvas.style.zIndex = "5"; + VirtualJoystick.vjCanvas.style.msTouchAction = "none"; + // Support for jQuery PEP polyfill + VirtualJoystick.vjCanvas.setAttribute("touch-action", "none"); + VirtualJoystick.vjCanvasContext = VirtualJoystick.vjCanvas.getContext('2d'); + VirtualJoystick.vjCanvasContext.strokeStyle = "#ffffff"; + VirtualJoystick.vjCanvasContext.lineWidth = 2; + document.body.appendChild(VirtualJoystick.vjCanvas); + } + VirtualJoystick.halfWidth = VirtualJoystick.vjCanvas.width / 2; + VirtualJoystick.halfHeight = VirtualJoystick.vjCanvas.height / 2; + this.pressed = false; + // default joystick color + this._joystickColor = "cyan"; + this._joystickPointerID = -1; + // current joystick position + this._joystickPointerPos = new BABYLON.Vector2(0, 0); + this._joystickPreviousPointerPos = new BABYLON.Vector2(0, 0); + // origin joystick position + this._joystickPointerStartPos = new BABYLON.Vector2(0, 0); + this._deltaJoystickVector = new BABYLON.Vector2(0, 0); + this._onPointerDownHandlerRef = function (evt) { + _this._onPointerDown(evt); + }; + this._onPointerMoveHandlerRef = function (evt) { + _this._onPointerMove(evt); + }; + this._onPointerOutHandlerRef = function (evt) { + _this._onPointerUp(evt); + }; + this._onPointerUpHandlerRef = function (evt) { + _this._onPointerUp(evt); + }; + VirtualJoystick.vjCanvas.addEventListener('pointerdown', this._onPointerDownHandlerRef, false); + VirtualJoystick.vjCanvas.addEventListener('pointermove', this._onPointerMoveHandlerRef, false); + VirtualJoystick.vjCanvas.addEventListener('pointerup', this._onPointerUpHandlerRef, false); + VirtualJoystick.vjCanvas.addEventListener('pointerout', this._onPointerUpHandlerRef, false); + VirtualJoystick.vjCanvas.addEventListener("contextmenu", function (evt) { + evt.preventDefault(); // Disables system menu + }, false); + requestAnimationFrame(function () { _this._drawVirtualJoystick(); }); + } + VirtualJoystick.prototype.setJoystickSensibility = function (newJoystickSensibility) { + this._joystickSensibility = newJoystickSensibility; + this._inversedSensibility = 1 / (this._joystickSensibility / 1000); + }; + VirtualJoystick.prototype._onPointerDown = function (e) { + var positionOnScreenCondition; + e.preventDefault(); + if (this._leftJoystick === true) { + positionOnScreenCondition = (e.clientX < VirtualJoystick.halfWidth); + } + else { + positionOnScreenCondition = (e.clientX > VirtualJoystick.halfWidth); + } + if (positionOnScreenCondition && this._joystickPointerID < 0) { + // First contact will be dedicated to the virtual joystick + this._joystickPointerID = e.pointerId; + this._joystickPointerStartPos.x = e.clientX; + this._joystickPointerStartPos.y = e.clientY; + this._joystickPointerPos = this._joystickPointerStartPos.clone(); + this._joystickPreviousPointerPos = this._joystickPointerStartPos.clone(); + this._deltaJoystickVector.x = 0; + this._deltaJoystickVector.y = 0; + this.pressed = true; + this._touches.add(e.pointerId.toString(), e); + } + else { + // You can only trigger the action buttons with a joystick declared + if (VirtualJoystick._globalJoystickIndex < 2 && this._action) { + this._action(); + this._touches.add(e.pointerId.toString(), { x: e.clientX, y: e.clientY, prevX: e.clientX, prevY: e.clientY }); + } + } + }; + VirtualJoystick.prototype._onPointerMove = function (e) { + // If the current pointer is the one associated to the joystick (first touch contact) + if (this._joystickPointerID == e.pointerId) { + this._joystickPointerPos.x = e.clientX; + this._joystickPointerPos.y = e.clientY; + this._deltaJoystickVector = this._joystickPointerPos.clone(); + this._deltaJoystickVector = this._deltaJoystickVector.subtract(this._joystickPointerStartPos); + var directionLeftRight = this.reverseLeftRight ? -1 : 1; + var deltaJoystickX = directionLeftRight * this._deltaJoystickVector.x / this._inversedSensibility; + switch (this._axisTargetedByLeftAndRight) { + case JoystickAxis.X: + this.deltaPosition.x = Math.min(1, Math.max(-1, deltaJoystickX)); + break; + case JoystickAxis.Y: + this.deltaPosition.y = Math.min(1, Math.max(-1, deltaJoystickX)); + break; + case JoystickAxis.Z: + this.deltaPosition.z = Math.min(1, Math.max(-1, deltaJoystickX)); + break; + } + var directionUpDown = this.reverseUpDown ? 1 : -1; + var deltaJoystickY = directionUpDown * this._deltaJoystickVector.y / this._inversedSensibility; + switch (this._axisTargetedByUpAndDown) { + case JoystickAxis.X: + this.deltaPosition.x = Math.min(1, Math.max(-1, deltaJoystickY)); + break; + case JoystickAxis.Y: + this.deltaPosition.y = Math.min(1, Math.max(-1, deltaJoystickY)); + break; + case JoystickAxis.Z: + this.deltaPosition.z = Math.min(1, Math.max(-1, deltaJoystickY)); + break; + } + } + else { + var data = this._touches.get(e.pointerId.toString()); + if (data) { + data.x = e.clientX; + data.y = e.clientY; + } + } + }; + VirtualJoystick.prototype._onPointerUp = function (e) { + if (this._joystickPointerID == e.pointerId) { + VirtualJoystick.vjCanvasContext.clearRect(this._joystickPointerStartPos.x - 63, this._joystickPointerStartPos.y - 63, 126, 126); + VirtualJoystick.vjCanvasContext.clearRect(this._joystickPreviousPointerPos.x - 41, this._joystickPreviousPointerPos.y - 41, 82, 82); + this._joystickPointerID = -1; + this.pressed = false; + } + else { + var touch = this._touches.get(e.pointerId.toString()); + if (touch) { + VirtualJoystick.vjCanvasContext.clearRect(touch.prevX - 43, touch.prevY - 43, 86, 86); + } + } + this._deltaJoystickVector.x = 0; + this._deltaJoystickVector.y = 0; + this._touches.remove(e.pointerId.toString()); + }; + /** + * Change the color of the virtual joystick + * @param newColor a string that must be a CSS color value (like "red") or the hexa value (like "#FF0000") + */ + VirtualJoystick.prototype.setJoystickColor = function (newColor) { + this._joystickColor = newColor; + }; + VirtualJoystick.prototype.setActionOnTouch = function (action) { + this._action = action; + }; + // Define which axis you'd like to control for left & right + VirtualJoystick.prototype.setAxisForLeftRight = function (axis) { + switch (axis) { + case JoystickAxis.X: + case JoystickAxis.Y: + case JoystickAxis.Z: + this._axisTargetedByLeftAndRight = axis; + break; + default: + this._axisTargetedByLeftAndRight = JoystickAxis.X; + break; + } + }; + // Define which axis you'd like to control for up & down + VirtualJoystick.prototype.setAxisForUpDown = function (axis) { + switch (axis) { + case JoystickAxis.X: + case JoystickAxis.Y: + case JoystickAxis.Z: + this._axisTargetedByUpAndDown = axis; + break; + default: + this._axisTargetedByUpAndDown = JoystickAxis.Y; + break; + } + }; + VirtualJoystick.prototype._clearCanvas = function () { + if (this._leftJoystick) { + VirtualJoystick.vjCanvasContext.clearRect(0, 0, VirtualJoystick.vjCanvasWidth / 2, VirtualJoystick.vjCanvasHeight); + } + else { + VirtualJoystick.vjCanvasContext.clearRect(VirtualJoystick.vjCanvasWidth / 2, 0, VirtualJoystick.vjCanvasWidth, VirtualJoystick.vjCanvasHeight); + } + }; + VirtualJoystick.prototype._drawVirtualJoystick = function () { + var _this = this; + if (this.pressed) { + this._touches.forEach(function (touch) { + if (touch.pointerId === _this._joystickPointerID) { + VirtualJoystick.vjCanvasContext.clearRect(_this._joystickPointerStartPos.x - 63, _this._joystickPointerStartPos.y - 63, 126, 126); + VirtualJoystick.vjCanvasContext.clearRect(_this._joystickPreviousPointerPos.x - 41, _this._joystickPreviousPointerPos.y - 41, 82, 82); + VirtualJoystick.vjCanvasContext.beginPath(); + VirtualJoystick.vjCanvasContext.lineWidth = 6; + VirtualJoystick.vjCanvasContext.strokeStyle = _this._joystickColor; + VirtualJoystick.vjCanvasContext.arc(_this._joystickPointerStartPos.x, _this._joystickPointerStartPos.y, 40, 0, Math.PI * 2, true); + VirtualJoystick.vjCanvasContext.stroke(); + VirtualJoystick.vjCanvasContext.closePath(); + VirtualJoystick.vjCanvasContext.beginPath(); + VirtualJoystick.vjCanvasContext.strokeStyle = _this._joystickColor; + VirtualJoystick.vjCanvasContext.lineWidth = 2; + VirtualJoystick.vjCanvasContext.arc(_this._joystickPointerStartPos.x, _this._joystickPointerStartPos.y, 60, 0, Math.PI * 2, true); + VirtualJoystick.vjCanvasContext.stroke(); + VirtualJoystick.vjCanvasContext.closePath(); + VirtualJoystick.vjCanvasContext.beginPath(); + VirtualJoystick.vjCanvasContext.strokeStyle = _this._joystickColor; + VirtualJoystick.vjCanvasContext.arc(_this._joystickPointerPos.x, _this._joystickPointerPos.y, 40, 0, Math.PI * 2, true); + VirtualJoystick.vjCanvasContext.stroke(); + VirtualJoystick.vjCanvasContext.closePath(); + _this._joystickPreviousPointerPos = _this._joystickPointerPos.clone(); + } + else { + VirtualJoystick.vjCanvasContext.clearRect(touch.prevX - 43, touch.prevY - 43, 86, 86); + VirtualJoystick.vjCanvasContext.beginPath(); + VirtualJoystick.vjCanvasContext.fillStyle = "white"; + VirtualJoystick.vjCanvasContext.beginPath(); + VirtualJoystick.vjCanvasContext.strokeStyle = "red"; + VirtualJoystick.vjCanvasContext.lineWidth = 6; + VirtualJoystick.vjCanvasContext.arc(touch.x, touch.y, 40, 0, Math.PI * 2, true); + VirtualJoystick.vjCanvasContext.stroke(); + VirtualJoystick.vjCanvasContext.closePath(); + touch.prevX = touch.x; + touch.prevY = touch.y; + } + ; + }); + } + requestAnimationFrame(function () { _this._drawVirtualJoystick(); }); + }; + VirtualJoystick.prototype.releaseCanvas = function () { + if (VirtualJoystick.vjCanvas) { + VirtualJoystick.vjCanvas.removeEventListener('pointerdown', this._onPointerDownHandlerRef); + VirtualJoystick.vjCanvas.removeEventListener('pointermove', this._onPointerMoveHandlerRef); + VirtualJoystick.vjCanvas.removeEventListener('pointerup', this._onPointerUpHandlerRef); + VirtualJoystick.vjCanvas.removeEventListener('pointerout', this._onPointerUpHandlerRef); + window.removeEventListener("resize", this._onResize); + document.body.removeChild(VirtualJoystick.vjCanvas); + VirtualJoystick.vjCanvas = null; + } + }; + // Used to draw the virtual joystick inside a 2D canvas on top of the WebGL rendering canvas + VirtualJoystick._globalJoystickIndex = 0; + return VirtualJoystick; + }()); + BABYLON.VirtualJoystick = VirtualJoystick; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.virtualJoystick.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + // We're mainly based on the logic defined into the FreeCamera code + var VirtualJoysticksCamera = (function (_super) { + __extends(VirtualJoysticksCamera, _super); + function VirtualJoysticksCamera(name, position, scene) { + _super.call(this, name, position, scene); + this.inputs.addVirtualJoystick(); + } + return VirtualJoysticksCamera; + }(BABYLON.FreeCamera)); + BABYLON.VirtualJoysticksCamera = VirtualJoysticksCamera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.virtualJoysticksCamera.js.map + +var BABYLON; +(function (BABYLON) { + var FreeCameraVirtualJoystickInput = (function () { + function FreeCameraVirtualJoystickInput() { + } + FreeCameraVirtualJoystickInput.prototype.getLeftJoystick = function () { + return this._leftjoystick; + }; + FreeCameraVirtualJoystickInput.prototype.getRightJoystick = function () { + return this._rightjoystick; + }; + FreeCameraVirtualJoystickInput.prototype.checkInputs = function () { + if (this._leftjoystick) { + var camera = this.camera; + var speed = camera._computeLocalCameraSpeed() * 50; + var cameraTransform = BABYLON.Matrix.RotationYawPitchRoll(camera.rotation.y, camera.rotation.x, 0); + var deltaTransform = BABYLON.Vector3.TransformCoordinates(new BABYLON.Vector3(this._leftjoystick.deltaPosition.x * speed, this._leftjoystick.deltaPosition.y * speed, this._leftjoystick.deltaPosition.z * speed), cameraTransform); + camera.cameraDirection = camera.cameraDirection.add(deltaTransform); + camera.cameraRotation = camera.cameraRotation.addVector3(this._rightjoystick.deltaPosition); + if (!this._leftjoystick.pressed) { + this._leftjoystick.deltaPosition = this._leftjoystick.deltaPosition.scale(0.9); + } + if (!this._rightjoystick.pressed) { + this._rightjoystick.deltaPosition = this._rightjoystick.deltaPosition.scale(0.9); + } + } + }; + FreeCameraVirtualJoystickInput.prototype.attachControl = function (element, noPreventDefault) { + this._leftjoystick = new BABYLON.VirtualJoystick(true); + this._leftjoystick.setAxisForUpDown(BABYLON.JoystickAxis.Z); + this._leftjoystick.setAxisForLeftRight(BABYLON.JoystickAxis.X); + this._leftjoystick.setJoystickSensibility(0.15); + this._rightjoystick = new BABYLON.VirtualJoystick(false); + this._rightjoystick.setAxisForUpDown(BABYLON.JoystickAxis.X); + this._rightjoystick.setAxisForLeftRight(BABYLON.JoystickAxis.Y); + this._rightjoystick.reverseUpDown = true; + this._rightjoystick.setJoystickSensibility(0.05); + this._rightjoystick.setJoystickColor("yellow"); + }; + FreeCameraVirtualJoystickInput.prototype.detachControl = function (element) { + this._leftjoystick.releaseCanvas(); + this._rightjoystick.releaseCanvas(); + }; + FreeCameraVirtualJoystickInput.prototype.getTypeName = function () { + return "FreeCameraVirtualJoystickInput"; + }; + FreeCameraVirtualJoystickInput.prototype.getSimpleName = function () { + return "virtualJoystick"; + }; + return FreeCameraVirtualJoystickInput; + }()); + BABYLON.FreeCameraVirtualJoystickInput = FreeCameraVirtualJoystickInput; + BABYLON.CameraInputTypes["FreeCameraVirtualJoystickInput"] = FreeCameraVirtualJoystickInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.freecamera.input.virtualjoystick.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var AnaglyphPostProcess = (function (_super) { + __extends(AnaglyphPostProcess, _super); + function AnaglyphPostProcess(name, options, rigCameras, samplingMode, engine, reusable) { + var _this = this; + _super.call(this, name, "anaglyph", null, ["leftSampler"], options, rigCameras[1], samplingMode, engine, reusable); + this._passedProcess = rigCameras[0]._rigPostProcess; + this.onApplyObservable.add(function (effect) { + effect.setTextureFromPostProcess("leftSampler", _this._passedProcess); + }); + } + return AnaglyphPostProcess; + }(BABYLON.PostProcess)); + BABYLON.AnaglyphPostProcess = AnaglyphPostProcess; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.anaglyphPostProcess.js.map + +var BABYLON; +(function (BABYLON) { + var OutlineRenderer = (function () { + function OutlineRenderer(scene) { + this._scene = scene; + } + OutlineRenderer.prototype.render = function (subMesh, batch, useOverlay) { + var _this = this; + if (useOverlay === void 0) { useOverlay = false; } + var scene = this._scene; + var engine = this._scene.getEngine(); + var hardwareInstancedRendering = (engine.getCaps().instancedArrays !== null) && (batch.visibleInstances[subMesh._id] !== null) && (batch.visibleInstances[subMesh._id] !== undefined); + if (!this.isReady(subMesh, hardwareInstancedRendering)) { + return; + } + var mesh = subMesh.getRenderingMesh(); + var material = subMesh.getMaterial(); + engine.enableEffect(this._effect); + this._effect.setFloat("offset", useOverlay ? 0 : mesh.outlineWidth); + this._effect.setColor4("color", useOverlay ? mesh.overlayColor : mesh.outlineColor, useOverlay ? mesh.overlayAlpha : 1.0); + this._effect.setMatrix("viewProjection", scene.getTransformMatrix()); + // Bones + if (mesh.useBones && mesh.computeBonesUsingShaders) { + this._effect.setMatrices("mBones", mesh.skeleton.getTransformMatrices(mesh)); + } + mesh._bind(subMesh, this._effect, BABYLON.Material.TriangleFillMode); + // Alpha test + if (material && material.needAlphaTesting()) { + var alphaTexture = material.getAlphaTestTexture(); + this._effect.setTexture("diffuseSampler", alphaTexture); + this._effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix()); + } + mesh._processRendering(subMesh, this._effect, BABYLON.Material.TriangleFillMode, batch, hardwareInstancedRendering, function (isInstance, world) { _this._effect.setMatrix("world", world); }); + }; + OutlineRenderer.prototype.isReady = function (subMesh, useInstances) { + var defines = []; + var attribs = [BABYLON.VertexBuffer.PositionKind, BABYLON.VertexBuffer.NormalKind]; + var mesh = subMesh.getMesh(); + var material = subMesh.getMaterial(); + // Alpha test + if (material && material.needAlphaTesting()) { + defines.push("#define ALPHATEST"); + if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) { + attribs.push(BABYLON.VertexBuffer.UVKind); + defines.push("#define UV1"); + } + if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) { + attribs.push(BABYLON.VertexBuffer.UV2Kind); + defines.push("#define UV2"); + } + } + // Bones + if (mesh.useBones && mesh.computeBonesUsingShaders) { + attribs.push(BABYLON.VertexBuffer.MatricesIndicesKind); + attribs.push(BABYLON.VertexBuffer.MatricesWeightsKind); + if (mesh.numBoneInfluencers > 4) { + attribs.push(BABYLON.VertexBuffer.MatricesIndicesExtraKind); + attribs.push(BABYLON.VertexBuffer.MatricesWeightsExtraKind); + } + defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers); + defines.push("#define BonesPerMesh " + (mesh.skeleton.bones.length + 1)); + } + else { + defines.push("#define NUM_BONE_INFLUENCERS 0"); + } + // Instances + if (useInstances) { + defines.push("#define INSTANCES"); + attribs.push("world0"); + attribs.push("world1"); + attribs.push("world2"); + attribs.push("world3"); + } + // Get correct effect + var join = defines.join("\n"); + if (this._cachedDefines !== join) { + this._cachedDefines = join; + this._effect = this._scene.getEngine().createEffect("outline", attribs, ["world", "mBones", "viewProjection", "diffuseMatrix", "offset", "color"], ["diffuseSampler"], join); + } + return this._effect.isReady(); + }; + return OutlineRenderer; + }()); + BABYLON.OutlineRenderer = OutlineRenderer; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.outlineRenderer.js.map + +var BABYLON; +(function (BABYLON) { + var MeshAssetTask = (function () { + function MeshAssetTask(name, meshesNames, rootUrl, sceneFilename) { + this.name = name; + this.meshesNames = meshesNames; + this.rootUrl = rootUrl; + this.sceneFilename = sceneFilename; + this.isCompleted = false; + } + MeshAssetTask.prototype.run = function (scene, onSuccess, onError) { + var _this = this; + BABYLON.SceneLoader.ImportMesh(this.meshesNames, this.rootUrl, this.sceneFilename, scene, function (meshes, particleSystems, skeletons) { + _this.loadedMeshes = meshes; + _this.loadedParticleSystems = particleSystems; + _this.loadedSkeletons = skeletons; + _this.isCompleted = true; + if (_this.onSuccess) { + _this.onSuccess(_this); + } + onSuccess(); + }, null, function () { + if (_this.onError) { + _this.onError(_this); + } + onError(); + }); + }; + return MeshAssetTask; + }()); + BABYLON.MeshAssetTask = MeshAssetTask; + var TextFileAssetTask = (function () { + function TextFileAssetTask(name, url) { + this.name = name; + this.url = url; + this.isCompleted = false; + } + TextFileAssetTask.prototype.run = function (scene, onSuccess, onError) { + var _this = this; + BABYLON.Tools.LoadFile(this.url, function (data) { + _this.text = data; + _this.isCompleted = true; + if (_this.onSuccess) { + _this.onSuccess(_this); + } + onSuccess(); + }, null, scene.database, false, function () { + if (_this.onError) { + _this.onError(_this); + } + onError(); + }); + }; + return TextFileAssetTask; + }()); + BABYLON.TextFileAssetTask = TextFileAssetTask; + var BinaryFileAssetTask = (function () { + function BinaryFileAssetTask(name, url) { + this.name = name; + this.url = url; + this.isCompleted = false; + } + BinaryFileAssetTask.prototype.run = function (scene, onSuccess, onError) { + var _this = this; + BABYLON.Tools.LoadFile(this.url, function (data) { + _this.data = data; + _this.isCompleted = true; + if (_this.onSuccess) { + _this.onSuccess(_this); + } + onSuccess(); + }, null, scene.database, true, function () { + if (_this.onError) { + _this.onError(_this); + } + onError(); + }); + }; + return BinaryFileAssetTask; + }()); + BABYLON.BinaryFileAssetTask = BinaryFileAssetTask; + var ImageAssetTask = (function () { + function ImageAssetTask(name, url) { + this.name = name; + this.url = url; + this.isCompleted = false; + } + ImageAssetTask.prototype.run = function (scene, onSuccess, onError) { + var _this = this; + var img = new Image(); + BABYLON.Tools.SetCorsBehavior(this.url, img); + img.onload = function () { + _this.image = img; + _this.isCompleted = true; + if (_this.onSuccess) { + _this.onSuccess(_this); + } + onSuccess(); + }; + img.onerror = function () { + if (_this.onError) { + _this.onError(_this); + } + onError(); + }; + img.src = this.url; + }; + return ImageAssetTask; + }()); + BABYLON.ImageAssetTask = ImageAssetTask; + var TextureAssetTask = (function () { + function TextureAssetTask(name, url, noMipmap, invertY, samplingMode) { + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + this.name = name; + this.url = url; + this.noMipmap = noMipmap; + this.invertY = invertY; + this.samplingMode = samplingMode; + this.isCompleted = false; + } + TextureAssetTask.prototype.run = function (scene, onSuccess, onError) { + var _this = this; + var onload = function () { + _this.isCompleted = true; + if (_this.onSuccess) { + _this.onSuccess(_this); + } + onSuccess(); + }; + var onerror = function () { + if (_this.onError) { + _this.onError(_this); + } + onError(); + }; + this.texture = new BABYLON.Texture(this.url, scene, this.noMipmap, this.invertY, this.samplingMode, onload, onerror); + }; + return TextureAssetTask; + }()); + BABYLON.TextureAssetTask = TextureAssetTask; + var CubeTextureAssetTask = (function () { + function CubeTextureAssetTask(name, url, extensions, noMipmap, files) { + this.name = name; + this.url = url; + this.extensions = extensions; + this.noMipmap = noMipmap; + this.files = files; + this.isCompleted = false; + } + CubeTextureAssetTask.prototype.run = function (scene, onSuccess, onError) { + var _this = this; + var onload = function () { + _this.isCompleted = true; + if (_this.onSuccess) { + _this.onSuccess(_this); + } + onSuccess(); + }; + var onerror = function () { + if (_this.onError) { + _this.onError(_this); + } + onError(); + }; + this.texture = new BABYLON.CubeTexture(this.url, scene, this.extensions, this.noMipmap, this.files, onload, onerror); + }; + return CubeTextureAssetTask; + }()); + BABYLON.CubeTextureAssetTask = CubeTextureAssetTask; + var AssetsManager = (function () { + function AssetsManager(scene) { + this.tasks = new Array(); + this.waitingTasksCount = 0; + this.useDefaultLoadingScreen = true; + this._scene = scene; + } + AssetsManager.prototype.addMeshTask = function (taskName, meshesNames, rootUrl, sceneFilename) { + var task = new MeshAssetTask(taskName, meshesNames, rootUrl, sceneFilename); + this.tasks.push(task); + return task; + }; + AssetsManager.prototype.addTextFileTask = function (taskName, url) { + var task = new TextFileAssetTask(taskName, url); + this.tasks.push(task); + return task; + }; + AssetsManager.prototype.addBinaryFileTask = function (taskName, url) { + var task = new BinaryFileAssetTask(taskName, url); + this.tasks.push(task); + return task; + }; + AssetsManager.prototype.addImageTask = function (taskName, url) { + var task = new ImageAssetTask(taskName, url); + this.tasks.push(task); + return task; + }; + AssetsManager.prototype.addTextureTask = function (taskName, url, noMipmap, invertY, samplingMode) { + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + var task = new TextureAssetTask(taskName, url, noMipmap, invertY, samplingMode); + this.tasks.push(task); + return task; + }; + AssetsManager.prototype._decreaseWaitingTasksCount = function () { + this.waitingTasksCount--; + if (this.waitingTasksCount === 0) { + if (this.onFinish) { + this.onFinish(this.tasks); + } + this._scene.getEngine().hideLoadingUI(); + } + }; + AssetsManager.prototype._runTask = function (task) { + var _this = this; + task.run(this._scene, function () { + if (_this.onTaskSuccess) { + _this.onTaskSuccess(task); + } + _this._decreaseWaitingTasksCount(); + }, function () { + if (_this.onTaskError) { + _this.onTaskError(task); + } + _this._decreaseWaitingTasksCount(); + }); + }; + AssetsManager.prototype.reset = function () { + this.tasks = new Array(); + return this; + }; + AssetsManager.prototype.load = function () { + this.waitingTasksCount = this.tasks.length; + if (this.waitingTasksCount === 0) { + if (this.onFinish) { + this.onFinish(this.tasks); + } + return this; + } + if (this.useDefaultLoadingScreen) { + this._scene.getEngine().displayLoadingUI(); + } + for (var index = 0; index < this.tasks.length; index++) { + var task = this.tasks[index]; + this._runTask(task); + } + return this; + }; + return AssetsManager; + }()); + BABYLON.AssetsManager = AssetsManager; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.assetsManager.js.map + +var BABYLON; +(function (BABYLON) { + var VRCameraMetrics = (function () { + function VRCameraMetrics() { + this.compensateDistortion = true; + } + Object.defineProperty(VRCameraMetrics.prototype, "aspectRatio", { + get: function () { + return this.hResolution / (2 * this.vResolution); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VRCameraMetrics.prototype, "aspectRatioFov", { + get: function () { + return (2 * Math.atan((this.postProcessScaleFactor * this.vScreenSize) / (2 * this.eyeToScreenDistance))); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VRCameraMetrics.prototype, "leftHMatrix", { + get: function () { + var meters = (this.hScreenSize / 4) - (this.lensSeparationDistance / 2); + var h = (4 * meters) / this.hScreenSize; + return BABYLON.Matrix.Translation(h, 0, 0); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VRCameraMetrics.prototype, "rightHMatrix", { + get: function () { + var meters = (this.hScreenSize / 4) - (this.lensSeparationDistance / 2); + var h = (4 * meters) / this.hScreenSize; + return BABYLON.Matrix.Translation(-h, 0, 0); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VRCameraMetrics.prototype, "leftPreViewMatrix", { + get: function () { + return BABYLON.Matrix.Translation(0.5 * this.interpupillaryDistance, 0, 0); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VRCameraMetrics.prototype, "rightPreViewMatrix", { + get: function () { + return BABYLON.Matrix.Translation(-0.5 * this.interpupillaryDistance, 0, 0); + }, + enumerable: true, + configurable: true + }); + VRCameraMetrics.GetDefault = function () { + var result = new VRCameraMetrics(); + result.hResolution = 1280; + result.vResolution = 800; + result.hScreenSize = 0.149759993; + result.vScreenSize = 0.0935999975; + result.vScreenCenter = 0.0467999987, + result.eyeToScreenDistance = 0.0410000011; + result.lensSeparationDistance = 0.0635000020; + result.interpupillaryDistance = 0.0640000030; + result.distortionK = [1.0, 0.219999999, 0.239999995, 0.0]; + result.chromaAbCorrection = [0.995999992, -0.00400000019, 1.01400006, 0.0]; + result.postProcessScaleFactor = 1.714605507808412; + result.lensCenterOffset = 0.151976421; + return result; + }; + return VRCameraMetrics; + }()); + BABYLON.VRCameraMetrics = VRCameraMetrics; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.vrCameraMetrics.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var WebVRFreeCamera = (function (_super) { + __extends(WebVRFreeCamera, _super); + function WebVRFreeCamera(name, position, scene, compensateDistortion, webVROptions) { + var _this = this; + if (compensateDistortion === void 0) { compensateDistortion = false; } + if (webVROptions === void 0) { webVROptions = {}; } + _super.call(this, name, position, scene); + this.webVROptions = webVROptions; + this._vrDevice = null; + this._cacheState = null; + this._vrEnabled = false; + this._attached = false; + //using the position provided as the current position offset + this._positionOffset = position; + //enable VR + this.getEngine().initWebVR(); + if (!this.getEngine().vrDisplaysPromise) { + BABYLON.Tools.Error("WebVR is not enabled on your browser"); + } + else { + //TODO get the metrics updated using the device's eye parameters! + //TODO also check that the device has the right capabilities! + this._frameData = new VRFrameData(); + this.getEngine().vrDisplaysPromise.then(function (devices) { + if (devices.length > 0) { + _this._vrEnabled = true; + if (_this.webVROptions.displayName) { + var found = devices.some(function (device) { + if (device.displayName === _this.webVROptions.displayName) { + _this._vrDevice = device; + return true; + } + else { + return false; + } + }); + if (!found) { + _this._vrDevice = devices[0]; + BABYLON.Tools.Warn("Display " + _this.webVROptions.displayName + " was not found. Using " + _this._vrDevice.displayName); + } + } + else { + //choose the first one + _this._vrDevice = devices[0]; + } + //reset the rig parameters. + _this.setCameraRigMode(BABYLON.Camera.RIG_MODE_WEBVR, { vrDisplay: _this._vrDevice, frameData: _this._frameData }); + if (_this._attached) { + _this.getEngine().enableVR(_this._vrDevice); + } + } + else { + BABYLON.Tools.Error("No WebVR devices found!"); + } + }); + } + this.rotationQuaternion = new BABYLON.Quaternion(); + this._quaternionCache = new BABYLON.Quaternion(); + } + WebVRFreeCamera.prototype._checkInputs = function () { + if (this._vrEnabled && this._vrDevice.getFrameData(this._frameData)) { + var currentPost = this._frameData.pose; + //make sure we have data + if (currentPost && currentPost.orientation) { + this._cacheState = currentPost; + this.rotationQuaternion.copyFromFloats(this._cacheState.orientation[0], this._cacheState.orientation[1], -this._cacheState.orientation[2], -this._cacheState.orientation[3]); + if (this.webVROptions.trackPosition && this._cacheState.position) { + this.position.copyFromFloats(this._cacheState.position[0], this._cacheState.position[1], -this._cacheState.position[2]); + //scale the position accordingly + this.webVROptions.positionScale && this.position.scaleInPlace(this.webVROptions.positionScale); + //add the position offset + this.position.addInPlace(this._positionOffset); + } + } + } + _super.prototype._checkInputs.call(this); + }; + WebVRFreeCamera.prototype.attachControl = function (element, noPreventDefault) { + _super.prototype.attachControl.call(this, element, noPreventDefault); + this._attached = true; + noPreventDefault = BABYLON.Camera.ForceAttachControlToAlwaysPreventDefault ? false : noPreventDefault; + if (this._vrEnabled) { + this.getEngine().enableVR(this._vrDevice); + } + }; + WebVRFreeCamera.prototype.detachControl = function (element) { + _super.prototype.detachControl.call(this, element); + this._vrEnabled = false; + this._attached = false; + this.getEngine().disableVR(); + }; + WebVRFreeCamera.prototype.requestVRFullscreen = function (requestPointerlock) { + //Backwards comp. + BABYLON.Tools.Warn("requestVRFullscreen is deprecated. call attachControl() to start sending frames to the VR display."); + //this.getEngine().switchFullscreen(requestPointerlock); + }; + WebVRFreeCamera.prototype.getTypeName = function () { + return "WebVRFreeCamera"; + }; + WebVRFreeCamera.prototype.resetToCurrentRotation = function () { + //uses the vrDisplay's "resetPose()". + //pitch and roll won't be affected. + this._vrDevice.resetPose(); + }; + /** + * + * Set the position offset of the VR camera + * The offset will be added to the WebVR pose, after scaling it (if set). + * + * @param {Vector3} [newPosition] an optional new position. if not provided, the current camera position will be used. + * + * @memberOf WebVRFreeCamera + */ + WebVRFreeCamera.prototype.setPositionOffset = function (newPosition) { + if (newPosition) { + this._positionOffset = newPosition; + } + else { + this._positionOffset.copyFrom(this.position); + } + }; + return WebVRFreeCamera; + }(BABYLON.FreeCamera)); + BABYLON.WebVRFreeCamera = WebVRFreeCamera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.webVRCamera.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + // Standard optimizations + var SceneOptimization = (function () { + function SceneOptimization(priority) { + if (priority === void 0) { priority = 0; } + this.priority = priority; + this.apply = function (scene) { + return true; // Return true if everything that can be done was applied + }; + } + return SceneOptimization; + }()); + BABYLON.SceneOptimization = SceneOptimization; + var TextureOptimization = (function (_super) { + __extends(TextureOptimization, _super); + function TextureOptimization(priority, maximumSize) { + var _this = this; + if (priority === void 0) { priority = 0; } + if (maximumSize === void 0) { maximumSize = 1024; } + _super.call(this, priority); + this.priority = priority; + this.maximumSize = maximumSize; + this.apply = function (scene) { + var allDone = true; + for (var index = 0; index < scene.textures.length; index++) { + var texture = scene.textures[index]; + if (!texture.canRescale) { + continue; + } + var currentSize = texture.getSize(); + var maxDimension = Math.max(currentSize.width, currentSize.height); + if (maxDimension > _this.maximumSize) { + texture.scale(0.5); + allDone = false; + } + } + return allDone; + }; + } + return TextureOptimization; + }(SceneOptimization)); + BABYLON.TextureOptimization = TextureOptimization; + var HardwareScalingOptimization = (function (_super) { + __extends(HardwareScalingOptimization, _super); + function HardwareScalingOptimization(priority, maximumScale) { + var _this = this; + if (priority === void 0) { priority = 0; } + if (maximumScale === void 0) { maximumScale = 2; } + _super.call(this, priority); + this.priority = priority; + this.maximumScale = maximumScale; + this._currentScale = 1; + this.apply = function (scene) { + _this._currentScale++; + scene.getEngine().setHardwareScalingLevel(_this._currentScale); + return _this._currentScale >= _this.maximumScale; + }; + } + return HardwareScalingOptimization; + }(SceneOptimization)); + BABYLON.HardwareScalingOptimization = HardwareScalingOptimization; + var ShadowsOptimization = (function (_super) { + __extends(ShadowsOptimization, _super); + function ShadowsOptimization() { + _super.apply(this, arguments); + this.apply = function (scene) { + scene.shadowsEnabled = false; + return true; + }; + } + return ShadowsOptimization; + }(SceneOptimization)); + BABYLON.ShadowsOptimization = ShadowsOptimization; + var PostProcessesOptimization = (function (_super) { + __extends(PostProcessesOptimization, _super); + function PostProcessesOptimization() { + _super.apply(this, arguments); + this.apply = function (scene) { + scene.postProcessesEnabled = false; + return true; + }; + } + return PostProcessesOptimization; + }(SceneOptimization)); + BABYLON.PostProcessesOptimization = PostProcessesOptimization; + var LensFlaresOptimization = (function (_super) { + __extends(LensFlaresOptimization, _super); + function LensFlaresOptimization() { + _super.apply(this, arguments); + this.apply = function (scene) { + scene.lensFlaresEnabled = false; + return true; + }; + } + return LensFlaresOptimization; + }(SceneOptimization)); + BABYLON.LensFlaresOptimization = LensFlaresOptimization; + var ParticlesOptimization = (function (_super) { + __extends(ParticlesOptimization, _super); + function ParticlesOptimization() { + _super.apply(this, arguments); + this.apply = function (scene) { + scene.particlesEnabled = false; + return true; + }; + } + return ParticlesOptimization; + }(SceneOptimization)); + BABYLON.ParticlesOptimization = ParticlesOptimization; + var RenderTargetsOptimization = (function (_super) { + __extends(RenderTargetsOptimization, _super); + function RenderTargetsOptimization() { + _super.apply(this, arguments); + this.apply = function (scene) { + scene.renderTargetsEnabled = false; + return true; + }; + } + return RenderTargetsOptimization; + }(SceneOptimization)); + BABYLON.RenderTargetsOptimization = RenderTargetsOptimization; + var MergeMeshesOptimization = (function (_super) { + __extends(MergeMeshesOptimization, _super); + function MergeMeshesOptimization() { + var _this = this; + _super.apply(this, arguments); + this._canBeMerged = function (abstractMesh) { + if (!(abstractMesh instanceof BABYLON.Mesh)) { + return false; + } + var mesh = abstractMesh; + if (!mesh.isVisible || !mesh.isEnabled()) { + return false; + } + if (mesh.instances.length > 0) { + return false; + } + if (mesh.skeleton || mesh.hasLODLevels) { + return false; + } + if (mesh.parent) { + return false; + } + return true; + }; + this.apply = function (scene, updateSelectionTree) { + var globalPool = scene.meshes.slice(0); + var globalLength = globalPool.length; + for (var index = 0; index < globalLength; index++) { + var currentPool = new Array(); + var current = globalPool[index]; + // Checks + if (!_this._canBeMerged(current)) { + continue; + } + currentPool.push(current); + // Find compatible meshes + for (var subIndex = index + 1; subIndex < globalLength; subIndex++) { + var otherMesh = globalPool[subIndex]; + if (!_this._canBeMerged(otherMesh)) { + continue; + } + if (otherMesh.material !== current.material) { + continue; + } + if (otherMesh.checkCollisions !== current.checkCollisions) { + continue; + } + currentPool.push(otherMesh); + globalLength--; + globalPool.splice(subIndex, 1); + subIndex--; + } + if (currentPool.length < 2) { + continue; + } + // Merge meshes + BABYLON.Mesh.MergeMeshes(currentPool); + } + if (updateSelectionTree != undefined) { + if (updateSelectionTree) { + scene.createOrUpdateSelectionOctree(); + } + } + else if (MergeMeshesOptimization.UpdateSelectionTree) { + scene.createOrUpdateSelectionOctree(); + } + return true; + }; + } + Object.defineProperty(MergeMeshesOptimization, "UpdateSelectionTree", { + get: function () { + return MergeMeshesOptimization._UpdateSelectionTree; + }, + set: function (value) { + MergeMeshesOptimization._UpdateSelectionTree = value; + }, + enumerable: true, + configurable: true + }); + MergeMeshesOptimization._UpdateSelectionTree = false; + return MergeMeshesOptimization; + }(SceneOptimization)); + BABYLON.MergeMeshesOptimization = MergeMeshesOptimization; + // Options + var SceneOptimizerOptions = (function () { + function SceneOptimizerOptions(targetFrameRate, trackerDuration) { + if (targetFrameRate === void 0) { targetFrameRate = 60; } + if (trackerDuration === void 0) { trackerDuration = 2000; } + this.targetFrameRate = targetFrameRate; + this.trackerDuration = trackerDuration; + this.optimizations = new Array(); + } + SceneOptimizerOptions.LowDegradationAllowed = function (targetFrameRate) { + var result = new SceneOptimizerOptions(targetFrameRate); + var priority = 0; + result.optimizations.push(new MergeMeshesOptimization(priority)); + result.optimizations.push(new ShadowsOptimization(priority)); + result.optimizations.push(new LensFlaresOptimization(priority)); + // Next priority + priority++; + result.optimizations.push(new PostProcessesOptimization(priority)); + result.optimizations.push(new ParticlesOptimization(priority)); + // Next priority + priority++; + result.optimizations.push(new TextureOptimization(priority, 1024)); + return result; + }; + SceneOptimizerOptions.ModerateDegradationAllowed = function (targetFrameRate) { + var result = new SceneOptimizerOptions(targetFrameRate); + var priority = 0; + result.optimizations.push(new MergeMeshesOptimization(priority)); + result.optimizations.push(new ShadowsOptimization(priority)); + result.optimizations.push(new LensFlaresOptimization(priority)); + // Next priority + priority++; + result.optimizations.push(new PostProcessesOptimization(priority)); + result.optimizations.push(new ParticlesOptimization(priority)); + // Next priority + priority++; + result.optimizations.push(new TextureOptimization(priority, 512)); + // Next priority + priority++; + result.optimizations.push(new RenderTargetsOptimization(priority)); + // Next priority + priority++; + result.optimizations.push(new HardwareScalingOptimization(priority, 2)); + return result; + }; + SceneOptimizerOptions.HighDegradationAllowed = function (targetFrameRate) { + var result = new SceneOptimizerOptions(targetFrameRate); + var priority = 0; + result.optimizations.push(new MergeMeshesOptimization(priority)); + result.optimizations.push(new ShadowsOptimization(priority)); + result.optimizations.push(new LensFlaresOptimization(priority)); + // Next priority + priority++; + result.optimizations.push(new PostProcessesOptimization(priority)); + result.optimizations.push(new ParticlesOptimization(priority)); + // Next priority + priority++; + result.optimizations.push(new TextureOptimization(priority, 256)); + // Next priority + priority++; + result.optimizations.push(new RenderTargetsOptimization(priority)); + // Next priority + priority++; + result.optimizations.push(new HardwareScalingOptimization(priority, 4)); + return result; + }; + return SceneOptimizerOptions; + }()); + BABYLON.SceneOptimizerOptions = SceneOptimizerOptions; + // Scene optimizer tool + var SceneOptimizer = (function () { + function SceneOptimizer() { + } + SceneOptimizer._CheckCurrentState = function (scene, options, currentPriorityLevel, onSuccess, onFailure) { + // TODO: add an epsilon + if (scene.getEngine().getFps() >= options.targetFrameRate) { + if (onSuccess) { + onSuccess(); + } + return; + } + // Apply current level of optimizations + var allDone = true; + var noOptimizationApplied = true; + for (var index = 0; index < options.optimizations.length; index++) { + var optimization = options.optimizations[index]; + if (optimization.priority === currentPriorityLevel) { + noOptimizationApplied = false; + allDone = allDone && optimization.apply(scene); + } + } + // If no optimization was applied, this is a failure :( + if (noOptimizationApplied) { + if (onFailure) { + onFailure(); + } + return; + } + // If all optimizations were done, move to next level + if (allDone) { + currentPriorityLevel++; + } + // Let's the system running for a specific amount of time before checking FPS + scene.executeWhenReady(function () { + setTimeout(function () { + SceneOptimizer._CheckCurrentState(scene, options, currentPriorityLevel, onSuccess, onFailure); + }, options.trackerDuration); + }); + }; + SceneOptimizer.OptimizeAsync = function (scene, options, onSuccess, onFailure) { + if (!options) { + options = SceneOptimizerOptions.ModerateDegradationAllowed(); + } + // Let's the system running for a specific amount of time before checking FPS + scene.executeWhenReady(function () { + setTimeout(function () { + SceneOptimizer._CheckCurrentState(scene, options, 0, onSuccess, onFailure); + }, options.trackerDuration); + }); + }; + return SceneOptimizer; + }()); + BABYLON.SceneOptimizer = SceneOptimizer; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.sceneOptimizer.js.map + +var BABYLON; +(function (BABYLON) { + var Internals; + (function (Internals) { + var MeshLODLevel = (function () { + function MeshLODLevel(distance, mesh) { + this.distance = distance; + this.mesh = mesh; + } + return MeshLODLevel; + }()); + Internals.MeshLODLevel = MeshLODLevel; + })(Internals = BABYLON.Internals || (BABYLON.Internals = {})); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.meshLODLevel.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var RawTexture = (function (_super) { + __extends(RawTexture, _super); + function RawTexture(data, width, height, format, scene, generateMipMaps, invertY, samplingMode) { + if (generateMipMaps === void 0) { generateMipMaps = true; } + if (invertY === void 0) { invertY = false; } + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + _super.call(this, null, scene, !generateMipMaps, invertY); + this.format = format; + this._texture = scene.getEngine().createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode); + this.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; + this.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; + } + RawTexture.prototype.update = function (data) { + this.getScene().getEngine().updateRawTexture(this._texture, data, this.format, this._invertY); + }; + // Statics + RawTexture.CreateLuminanceTexture = function (data, width, height, scene, generateMipMaps, invertY, samplingMode) { + if (generateMipMaps === void 0) { generateMipMaps = true; } + if (invertY === void 0) { invertY = false; } + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + return new RawTexture(data, width, height, BABYLON.Engine.TEXTUREFORMAT_LUMINANCE, scene, generateMipMaps, invertY, samplingMode); + }; + RawTexture.CreateLuminanceAlphaTexture = function (data, width, height, scene, generateMipMaps, invertY, samplingMode) { + if (generateMipMaps === void 0) { generateMipMaps = true; } + if (invertY === void 0) { invertY = false; } + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + return new RawTexture(data, width, height, BABYLON.Engine.TEXTUREFORMAT_LUMINANCE_ALPHA, scene, generateMipMaps, invertY, samplingMode); + }; + RawTexture.CreateAlphaTexture = function (data, width, height, scene, generateMipMaps, invertY, samplingMode) { + if (generateMipMaps === void 0) { generateMipMaps = true; } + if (invertY === void 0) { invertY = false; } + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + return new RawTexture(data, width, height, BABYLON.Engine.TEXTUREFORMAT_ALPHA, scene, generateMipMaps, invertY, samplingMode); + }; + RawTexture.CreateRGBTexture = function (data, width, height, scene, generateMipMaps, invertY, samplingMode) { + if (generateMipMaps === void 0) { generateMipMaps = true; } + if (invertY === void 0) { invertY = false; } + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + return new RawTexture(data, width, height, BABYLON.Engine.TEXTUREFORMAT_RGB, scene, generateMipMaps, invertY, samplingMode); + }; + RawTexture.CreateRGBATexture = function (data, width, height, scene, generateMipMaps, invertY, samplingMode) { + if (generateMipMaps === void 0) { generateMipMaps = true; } + if (invertY === void 0) { invertY = false; } + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + return new RawTexture(data, width, height, BABYLON.Engine.TEXTUREFORMAT_RGBA, scene, generateMipMaps, invertY, samplingMode); + }; + return RawTexture; + }(BABYLON.Texture)); + BABYLON.RawTexture = RawTexture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.rawTexture.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var IndexedVector2 = (function (_super) { + __extends(IndexedVector2, _super); + function IndexedVector2(original, index) { + _super.call(this, original.x, original.y); + this.index = index; + } + return IndexedVector2; + }(BABYLON.Vector2)); + var PolygonPoints = (function () { + function PolygonPoints() { + this.elements = new Array(); + } + PolygonPoints.prototype.add = function (originalPoints) { + var _this = this; + var result = new Array(); + originalPoints.forEach(function (point) { + if (result.length === 0 || !point.equalsWithEpsilon(result[0])) { + var newPoint = new IndexedVector2(point, _this.elements.length); + result.push(newPoint); + _this.elements.push(newPoint); + } + }); + return result; + }; + PolygonPoints.prototype.computeBounds = function () { + var lmin = new BABYLON.Vector2(this.elements[0].x, this.elements[0].y); + var lmax = new BABYLON.Vector2(this.elements[0].x, this.elements[0].y); + this.elements.forEach(function (point) { + // x + if (point.x < lmin.x) { + lmin.x = point.x; + } + else if (point.x > lmax.x) { + lmax.x = point.x; + } + // y + if (point.y < lmin.y) { + lmin.y = point.y; + } + else if (point.y > lmax.y) { + lmax.y = point.y; + } + }); + return { + min: lmin, + max: lmax, + width: lmax.x - lmin.x, + height: lmax.y - lmin.y + }; + }; + return PolygonPoints; + }()); + var Polygon = (function () { + function Polygon() { + } + Polygon.Rectangle = function (xmin, ymin, xmax, ymax) { + return [ + new BABYLON.Vector2(xmin, ymin), + new BABYLON.Vector2(xmax, ymin), + new BABYLON.Vector2(xmax, ymax), + new BABYLON.Vector2(xmin, ymax) + ]; + }; + Polygon.Circle = function (radius, cx, cy, numberOfSides) { + if (cx === void 0) { cx = 0; } + if (cy === void 0) { cy = 0; } + if (numberOfSides === void 0) { numberOfSides = 32; } + var result = new Array(); + var angle = 0; + var increment = (Math.PI * 2) / numberOfSides; + for (var i = 0; i < numberOfSides; i++) { + result.push(new BABYLON.Vector2(cx + Math.cos(angle) * radius, cy + Math.sin(angle) * radius)); + angle -= increment; + } + return result; + }; + Polygon.Parse = function (input) { + var floats = input.split(/[^-+eE\.\d]+/).map(parseFloat).filter(function (val) { return (!isNaN(val)); }); + var i, result = []; + for (i = 0; i < (floats.length & 0x7FFFFFFE); i += 2) { + result.push(new BABYLON.Vector2(floats[i], floats[i + 1])); + } + return result; + }; + Polygon.StartingAt = function (x, y) { + return BABYLON.Path2.StartingAt(x, y); + }; + return Polygon; + }()); + BABYLON.Polygon = Polygon; + var PolygonMeshBuilder = (function () { + function PolygonMeshBuilder(name, contours, scene) { + this._points = new PolygonPoints(); + this._outlinepoints = new PolygonPoints(); + this._holes = []; + this._epoints = new Array(); + this._eholes = new Array(); + this._name = name; + this._scene = scene; + var points; + if (contours instanceof BABYLON.Path2) { + points = contours.getPoints(); + } + else { + points = contours; + } + this._addToepoint(points); + this._points.add(points); + this._outlinepoints.add(points); + } + PolygonMeshBuilder.prototype._addToepoint = function (points) { + for (var _i = 0, points_1 = points; _i < points_1.length; _i++) { + var p = points_1[_i]; + this._epoints.push(p.x, p.y); + } + }; + PolygonMeshBuilder.prototype.addHole = function (hole) { + this._points.add(hole); + var holepoints = new PolygonPoints(); + holepoints.add(hole); + this._holes.push(holepoints); + this._eholes.push(this._epoints.length / 2); + this._addToepoint(hole); + return this; + }; + PolygonMeshBuilder.prototype.build = function (updatable, depth) { + var _this = this; + if (updatable === void 0) { updatable = false; } + var result = new BABYLON.Mesh(this._name, this._scene); + var normals = []; + var positions = []; + var uvs = []; + var bounds = this._points.computeBounds(); + this._points.elements.forEach(function (p) { + normals.push(0, 1.0, 0); + positions.push(p.x, 0, p.y); + uvs.push((p.x - bounds.min.x) / bounds.width, (p.y - bounds.min.y) / bounds.height); + }); + var indices = []; + var res = Earcut.earcut(this._epoints, this._eholes, 2); + for (var i = 0; i < res.length; i++) { + indices.push(res[i]); + } + if (depth > 0) { + var positionscount = (positions.length / 3); //get the current pointcount + this._points.elements.forEach(function (p) { + normals.push(0, -1.0, 0); + positions.push(p.x, -depth, p.y); + uvs.push(1 - (p.x - bounds.min.x) / bounds.width, 1 - (p.y - bounds.min.y) / bounds.height); + }); + var totalCount = indices.length; + for (var i = 0; i < totalCount; i += 3) { + var i0 = indices[i + 0]; + var i1 = indices[i + 1]; + var i2 = indices[i + 2]; + indices.push(i2 + positionscount); + indices.push(i1 + positionscount); + indices.push(i0 + positionscount); + } + //Add the sides + this.addSide(positions, normals, uvs, indices, bounds, this._outlinepoints, depth, false); + this._holes.forEach(function (hole) { + _this.addSide(positions, normals, uvs, indices, bounds, hole, depth, true); + }); + } + result.setVerticesData(BABYLON.VertexBuffer.PositionKind, positions, updatable); + result.setVerticesData(BABYLON.VertexBuffer.NormalKind, normals, updatable); + result.setVerticesData(BABYLON.VertexBuffer.UVKind, uvs, updatable); + result.setIndices(indices); + return result; + }; + PolygonMeshBuilder.prototype.addSide = function (positions, normals, uvs, indices, bounds, points, depth, flip) { + var StartIndex = positions.length / 3; + var ulength = 0; + for (var i = 0; i < points.elements.length; i++) { + var p = points.elements[i]; + var p1; + if ((i + 1) > points.elements.length - 1) { + p1 = points.elements[0]; + } + else { + p1 = points.elements[i + 1]; + } + positions.push(p.x, 0, p.y); + positions.push(p.x, -depth, p.y); + positions.push(p1.x, 0, p1.y); + positions.push(p1.x, -depth, p1.y); + var v1 = new BABYLON.Vector3(p.x, 0, p.y); + var v2 = new BABYLON.Vector3(p1.x, 0, p1.y); + var v3 = v2.subtract(v1); + var v4 = new BABYLON.Vector3(0, 1, 0); + var vn = BABYLON.Vector3.Cross(v3, v4); + vn = vn.normalize(); + uvs.push(ulength / bounds.width, 0); + uvs.push(ulength / bounds.width, 1); + ulength += v3.length(); + uvs.push((ulength / bounds.width), 0); + uvs.push((ulength / bounds.width), 1); + if (!flip) { + normals.push(-vn.x, -vn.y, -vn.z); + normals.push(-vn.x, -vn.y, -vn.z); + normals.push(-vn.x, -vn.y, -vn.z); + normals.push(-vn.x, -vn.y, -vn.z); + indices.push(StartIndex); + indices.push(StartIndex + 1); + indices.push(StartIndex + 2); + indices.push(StartIndex + 1); + indices.push(StartIndex + 3); + indices.push(StartIndex + 2); + } + else { + normals.push(vn.x, vn.y, vn.z); + normals.push(vn.x, vn.y, vn.z); + normals.push(vn.x, vn.y, vn.z); + normals.push(vn.x, vn.y, vn.z); + indices.push(StartIndex); + indices.push(StartIndex + 2); + indices.push(StartIndex + 1); + indices.push(StartIndex + 1); + indices.push(StartIndex + 2); + indices.push(StartIndex + 3); + } + StartIndex += 4; + } + ; + }; + return PolygonMeshBuilder; + }()); + BABYLON.PolygonMeshBuilder = PolygonMeshBuilder; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.polygonMesh.js.map + +var BABYLON; +(function (BABYLON) { + var Octree = (function () { + function Octree(creationFunc, maxBlockCapacity, maxDepth) { + if (maxDepth === void 0) { maxDepth = 2; } + this.maxDepth = maxDepth; + this.dynamicContent = new Array(); + this._maxBlockCapacity = maxBlockCapacity || 64; + this._selectionContent = new BABYLON.SmartArray(1024); + this._creationFunc = creationFunc; + } + // Methods + Octree.prototype.update = function (worldMin, worldMax, entries) { + Octree._CreateBlocks(worldMin, worldMax, entries, this._maxBlockCapacity, 0, this.maxDepth, this, this._creationFunc); + }; + Octree.prototype.addMesh = function (entry) { + for (var index = 0; index < this.blocks.length; index++) { + var block = this.blocks[index]; + block.addEntry(entry); + } + }; + Octree.prototype.select = function (frustumPlanes, allowDuplicate) { + this._selectionContent.reset(); + for (var index = 0; index < this.blocks.length; index++) { + var block = this.blocks[index]; + block.select(frustumPlanes, this._selectionContent, allowDuplicate); + } + if (allowDuplicate) { + this._selectionContent.concat(this.dynamicContent); + } + else { + this._selectionContent.concatWithNoDuplicate(this.dynamicContent); + } + return this._selectionContent; + }; + Octree.prototype.intersects = function (sphereCenter, sphereRadius, allowDuplicate) { + this._selectionContent.reset(); + for (var index = 0; index < this.blocks.length; index++) { + var block = this.blocks[index]; + block.intersects(sphereCenter, sphereRadius, this._selectionContent, allowDuplicate); + } + if (allowDuplicate) { + this._selectionContent.concat(this.dynamicContent); + } + else { + this._selectionContent.concatWithNoDuplicate(this.dynamicContent); + } + return this._selectionContent; + }; + Octree.prototype.intersectsRay = function (ray) { + this._selectionContent.reset(); + for (var index = 0; index < this.blocks.length; index++) { + var block = this.blocks[index]; + block.intersectsRay(ray, this._selectionContent); + } + this._selectionContent.concatWithNoDuplicate(this.dynamicContent); + return this._selectionContent; + }; + Octree._CreateBlocks = function (worldMin, worldMax, entries, maxBlockCapacity, currentDepth, maxDepth, target, creationFunc) { + target.blocks = new Array(); + var blockSize = new BABYLON.Vector3((worldMax.x - worldMin.x) / 2, (worldMax.y - worldMin.y) / 2, (worldMax.z - worldMin.z) / 2); + // Segmenting space + for (var x = 0; x < 2; x++) { + for (var y = 0; y < 2; y++) { + for (var z = 0; z < 2; z++) { + var localMin = worldMin.add(blockSize.multiplyByFloats(x, y, z)); + var localMax = worldMin.add(blockSize.multiplyByFloats(x + 1, y + 1, z + 1)); + var block = new BABYLON.OctreeBlock(localMin, localMax, maxBlockCapacity, currentDepth + 1, maxDepth, creationFunc); + block.addEntries(entries); + target.blocks.push(block); + } + } + } + }; + Octree.CreationFuncForMeshes = function (entry, block) { + if (!entry.isBlocked && entry.getBoundingInfo().boundingBox.intersectsMinMax(block.minPoint, block.maxPoint)) { + block.entries.push(entry); + } + }; + Octree.CreationFuncForSubMeshes = function (entry, block) { + if (entry.getBoundingInfo().boundingBox.intersectsMinMax(block.minPoint, block.maxPoint)) { + block.entries.push(entry); + } + }; + return Octree; + }()); + BABYLON.Octree = Octree; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.octree.js.map + +var BABYLON; +(function (BABYLON) { + var OctreeBlock = (function () { + function OctreeBlock(minPoint, maxPoint, capacity, depth, maxDepth, creationFunc) { + this.entries = new Array(); + this._boundingVectors = new Array(); + this._capacity = capacity; + this._depth = depth; + this._maxDepth = maxDepth; + this._creationFunc = creationFunc; + this._minPoint = minPoint; + this._maxPoint = maxPoint; + this._boundingVectors.push(minPoint.clone()); + this._boundingVectors.push(maxPoint.clone()); + this._boundingVectors.push(minPoint.clone()); + this._boundingVectors[2].x = maxPoint.x; + this._boundingVectors.push(minPoint.clone()); + this._boundingVectors[3].y = maxPoint.y; + this._boundingVectors.push(minPoint.clone()); + this._boundingVectors[4].z = maxPoint.z; + this._boundingVectors.push(maxPoint.clone()); + this._boundingVectors[5].z = minPoint.z; + this._boundingVectors.push(maxPoint.clone()); + this._boundingVectors[6].x = minPoint.x; + this._boundingVectors.push(maxPoint.clone()); + this._boundingVectors[7].y = minPoint.y; + } + Object.defineProperty(OctreeBlock.prototype, "capacity", { + // Property + get: function () { + return this._capacity; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(OctreeBlock.prototype, "minPoint", { + get: function () { + return this._minPoint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(OctreeBlock.prototype, "maxPoint", { + get: function () { + return this._maxPoint; + }, + enumerable: true, + configurable: true + }); + // Methods + OctreeBlock.prototype.addEntry = function (entry) { + if (this.blocks) { + for (var index = 0; index < this.blocks.length; index++) { + var block = this.blocks[index]; + block.addEntry(entry); + } + return; + } + this._creationFunc(entry, this); + if (this.entries.length > this.capacity && this._depth < this._maxDepth) { + this.createInnerBlocks(); + } + }; + OctreeBlock.prototype.addEntries = function (entries) { + for (var index = 0; index < entries.length; index++) { + var mesh = entries[index]; + this.addEntry(mesh); + } + }; + OctreeBlock.prototype.select = function (frustumPlanes, selection, allowDuplicate) { + if (BABYLON.BoundingBox.IsInFrustum(this._boundingVectors, frustumPlanes)) { + if (this.blocks) { + for (var index = 0; index < this.blocks.length; index++) { + var block = this.blocks[index]; + block.select(frustumPlanes, selection, allowDuplicate); + } + return; + } + if (allowDuplicate) { + selection.concat(this.entries); + } + else { + selection.concatWithNoDuplicate(this.entries); + } + } + }; + OctreeBlock.prototype.intersects = function (sphereCenter, sphereRadius, selection, allowDuplicate) { + if (BABYLON.BoundingBox.IntersectsSphere(this._minPoint, this._maxPoint, sphereCenter, sphereRadius)) { + if (this.blocks) { + for (var index = 0; index < this.blocks.length; index++) { + var block = this.blocks[index]; + block.intersects(sphereCenter, sphereRadius, selection, allowDuplicate); + } + return; + } + if (allowDuplicate) { + selection.concat(this.entries); + } + else { + selection.concatWithNoDuplicate(this.entries); + } + } + }; + OctreeBlock.prototype.intersectsRay = function (ray, selection) { + if (ray.intersectsBoxMinMax(this._minPoint, this._maxPoint)) { + if (this.blocks) { + for (var index = 0; index < this.blocks.length; index++) { + var block = this.blocks[index]; + block.intersectsRay(ray, selection); + } + return; + } + selection.concatWithNoDuplicate(this.entries); + } + }; + OctreeBlock.prototype.createInnerBlocks = function () { + BABYLON.Octree._CreateBlocks(this._minPoint, this._maxPoint, this.entries, this._capacity, this._depth, this._maxDepth, this, this._creationFunc); + }; + return OctreeBlock; + }()); + BABYLON.OctreeBlock = OctreeBlock; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.octreeBlock.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var BlurPostProcess = (function (_super) { + __extends(BlurPostProcess, _super); + function BlurPostProcess(name, direction, blurWidth, options, camera, samplingMode, engine, reusable) { + var _this = this; + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.BILINEAR_SAMPLINGMODE; } + _super.call(this, name, "blur", ["screenSize", "direction", "blurWidth"], null, options, camera, samplingMode, engine, reusable); + this.direction = direction; + this.blurWidth = blurWidth; + this.onApplyObservable.add(function (effect) { + effect.setFloat2("screenSize", _this.width, _this.height); + effect.setVector2("direction", _this.direction); + effect.setFloat("blurWidth", _this.blurWidth); + }); + } + return BlurPostProcess; + }(BABYLON.PostProcess)); + BABYLON.BlurPostProcess = BlurPostProcess; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.blurPostProcess.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var RefractionPostProcess = (function (_super) { + __extends(RefractionPostProcess, _super); + function RefractionPostProcess(name, refractionTextureUrl, color, depth, colorLevel, options, camera, samplingMode, engine, reusable) { + var _this = this; + _super.call(this, name, "refraction", ["baseColor", "depth", "colorLevel"], ["refractionSampler"], options, camera, samplingMode, engine, reusable); + this.color = color; + this.depth = depth; + this.colorLevel = colorLevel; + this.onActivateObservable.add(function (cam) { + _this._refRexture = _this._refRexture || new BABYLON.Texture(refractionTextureUrl, cam.getScene()); + }); + this.onApplyObservable.add(function (effect) { + effect.setColor3("baseColor", _this.color); + effect.setFloat("depth", _this.depth); + effect.setFloat("colorLevel", _this.colorLevel); + effect.setTexture("refractionSampler", _this._refRexture); + }); + } + // Methods + RefractionPostProcess.prototype.dispose = function (camera) { + if (this._refRexture) { + this._refRexture.dispose(); + } + _super.prototype.dispose.call(this, camera); + }; + return RefractionPostProcess; + }(BABYLON.PostProcess)); + BABYLON.RefractionPostProcess = RefractionPostProcess; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.refractionPostProcess.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var BlackAndWhitePostProcess = (function (_super) { + __extends(BlackAndWhitePostProcess, _super); + function BlackAndWhitePostProcess(name, options, camera, samplingMode, engine, reusable) { + _super.call(this, name, "blackAndWhite", null, null, options, camera, samplingMode, engine, reusable); + } + return BlackAndWhitePostProcess; + }(BABYLON.PostProcess)); + BABYLON.BlackAndWhitePostProcess = BlackAndWhitePostProcess; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.blackAndWhitePostProcess.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var ConvolutionPostProcess = (function (_super) { + __extends(ConvolutionPostProcess, _super); + function ConvolutionPostProcess(name, kernel, options, camera, samplingMode, engine, reusable) { + var _this = this; + _super.call(this, name, "convolution", ["kernel", "screenSize"], null, options, camera, samplingMode, engine, reusable); + this.kernel = kernel; + this.onApply = function (effect) { + effect.setFloat2("screenSize", _this.width, _this.height); + effect.setArray("kernel", _this.kernel); + }; + } + // Statics + // Based on http://en.wikipedia.org/wiki/Kernel_(image_processing) + ConvolutionPostProcess.EdgeDetect0Kernel = [1, 0, -1, 0, 0, 0, -1, 0, 1]; + ConvolutionPostProcess.EdgeDetect1Kernel = [0, 1, 0, 1, -4, 1, 0, 1, 0]; + ConvolutionPostProcess.EdgeDetect2Kernel = [-1, -1, -1, -1, 8, -1, -1, -1, -1]; + ConvolutionPostProcess.SharpenKernel = [0, -1, 0, -1, 5, -1, 0, -1, 0]; + ConvolutionPostProcess.EmbossKernel = [-2, -1, 0, -1, 1, 1, 0, 1, 2]; + ConvolutionPostProcess.GaussianKernel = [0, 1, 0, 1, 1, 1, 0, 1, 0]; + return ConvolutionPostProcess; + }(BABYLON.PostProcess)); + BABYLON.ConvolutionPostProcess = ConvolutionPostProcess; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.convolutionPostProcess.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var FilterPostProcess = (function (_super) { + __extends(FilterPostProcess, _super); + function FilterPostProcess(name, kernelMatrix, options, camera, samplingMode, engine, reusable) { + var _this = this; + _super.call(this, name, "filter", ["kernelMatrix"], null, options, camera, samplingMode, engine, reusable); + this.kernelMatrix = kernelMatrix; + this.onApply = function (effect) { + effect.setMatrix("kernelMatrix", _this.kernelMatrix); + }; + } + return FilterPostProcess; + }(BABYLON.PostProcess)); + BABYLON.FilterPostProcess = FilterPostProcess; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.filterPostProcess.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var FxaaPostProcess = (function (_super) { + __extends(FxaaPostProcess, _super); + function FxaaPostProcess(name, options, camera, samplingMode, engine, reusable) { + var _this = this; + _super.call(this, name, "fxaa", ["texelSize"], null, options, camera, samplingMode, engine, reusable); + this.onSizeChangedObservable.add(function () { + _this.texelWidth = 1.0 / _this.width; + _this.texelHeight = 1.0 / _this.height; + }); + this.onApplyObservable.add(function (effect) { + effect.setFloat2("texelSize", _this.texelWidth, _this.texelHeight); + }); + } + return FxaaPostProcess; + }(BABYLON.PostProcess)); + BABYLON.FxaaPostProcess = FxaaPostProcess; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.fxaaPostProcess.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var StereoscopicInterlacePostProcess = (function (_super) { + __extends(StereoscopicInterlacePostProcess, _super); + function StereoscopicInterlacePostProcess(name, rigCameras, isStereoscopicHoriz, samplingMode, engine, reusable) { + var _this = this; + _super.call(this, name, "stereoscopicInterlace", ['stepSize'], ['camASampler'], 1, rigCameras[1], samplingMode, engine, reusable, isStereoscopicHoriz ? "#define IS_STEREOSCOPIC_HORIZ 1" : undefined); + this._passedProcess = rigCameras[0]._rigPostProcess; + this._stepSize = new BABYLON.Vector2(1 / this.width, 1 / this.height); + this.onSizeChangedObservable.add(function () { + _this._stepSize = new BABYLON.Vector2(1 / _this.width, 1 / _this.height); + }); + this.onApplyObservable.add(function (effect) { + effect.setTextureFromPostProcess("camASampler", _this._passedProcess); + effect.setFloat2("stepSize", _this._stepSize.x, _this._stepSize.y); + }); + } + return StereoscopicInterlacePostProcess; + }(BABYLON.PostProcess)); + BABYLON.StereoscopicInterlacePostProcess = StereoscopicInterlacePostProcess; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.stereoscopicInterlacePostProcess.js.map + +var BABYLON; +(function (BABYLON) { + var LensFlare = (function () { + function LensFlare(size, position, color, imgUrl, system) { + this.size = size; + this.position = position; + this.alphaMode = BABYLON.Engine.ALPHA_ONEONE; + this.dispose = function () { + if (this.texture) { + this.texture.dispose(); + } + // Remove from scene + var index = this._system.lensFlares.indexOf(this); + this._system.lensFlares.splice(index, 1); + }; + this.color = color || new BABYLON.Color3(1, 1, 1); + this.texture = imgUrl ? new BABYLON.Texture(imgUrl, system.getScene(), true) : null; + this._system = system; + system.lensFlares.push(this); + } + return LensFlare; + }()); + BABYLON.LensFlare = LensFlare; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.lensFlare.js.map + +var BABYLON; +(function (BABYLON) { + var LensFlareSystem = (function () { + function LensFlareSystem(name, emitter, scene) { + this.name = name; + this.lensFlares = new Array(); + this.borderLimit = 300; + this.viewportBorder = 0; + this.layerMask = 0x0FFFFFFF; + this._vertexBuffers = {}; + this._isEnabled = true; + this._scene = scene; + this._emitter = emitter; + this.id = name; + scene.lensFlareSystems.push(this); + this.meshesSelectionPredicate = function (m) { return m.material && m.isVisible && m.isEnabled() && m.isBlocker && ((m.layerMask & scene.activeCamera.layerMask) != 0); }; + var engine = scene.getEngine(); + // VBO + var vertices = []; + vertices.push(1, 1); + vertices.push(-1, 1); + vertices.push(-1, -1); + vertices.push(1, -1); + this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = new BABYLON.VertexBuffer(engine, vertices, BABYLON.VertexBuffer.PositionKind, false, false, 2); + // Indices + var indices = []; + indices.push(0); + indices.push(1); + indices.push(2); + indices.push(0); + indices.push(2); + indices.push(3); + this._indexBuffer = engine.createIndexBuffer(indices); + // Effects + this._effect = engine.createEffect("lensFlare", [BABYLON.VertexBuffer.PositionKind], ["color", "viewportMatrix"], ["textureSampler"], ""); + } + Object.defineProperty(LensFlareSystem.prototype, "isEnabled", { + get: function () { + return this._isEnabled; + }, + set: function (value) { + this._isEnabled = value; + }, + enumerable: true, + configurable: true + }); + LensFlareSystem.prototype.getScene = function () { + return this._scene; + }; + LensFlareSystem.prototype.getEmitter = function () { + return this._emitter; + }; + LensFlareSystem.prototype.setEmitter = function (newEmitter) { + this._emitter = newEmitter; + }; + LensFlareSystem.prototype.getEmitterPosition = function () { + return this._emitter.getAbsolutePosition ? this._emitter.getAbsolutePosition() : this._emitter.position; + }; + LensFlareSystem.prototype.computeEffectivePosition = function (globalViewport) { + var position = this.getEmitterPosition(); + position = BABYLON.Vector3.Project(position, BABYLON.Matrix.Identity(), this._scene.getTransformMatrix(), globalViewport); + this._positionX = position.x; + this._positionY = position.y; + position = BABYLON.Vector3.TransformCoordinates(this.getEmitterPosition(), this._scene.getViewMatrix()); + if (this.viewportBorder > 0) { + globalViewport.x -= this.viewportBorder; + globalViewport.y -= this.viewportBorder; + globalViewport.width += this.viewportBorder * 2; + globalViewport.height += this.viewportBorder * 2; + position.x += this.viewportBorder; + position.y += this.viewportBorder; + this._positionX += this.viewportBorder; + this._positionY += this.viewportBorder; + } + if (position.z > 0) { + if ((this._positionX > globalViewport.x) && (this._positionX < globalViewport.x + globalViewport.width)) { + if ((this._positionY > globalViewport.y) && (this._positionY < globalViewport.y + globalViewport.height)) + return true; + } + return true; + } + return false; + }; + LensFlareSystem.prototype._isVisible = function () { + if (!this._isEnabled) { + return false; + } + var emitterPosition = this.getEmitterPosition(); + var direction = emitterPosition.subtract(this._scene.activeCamera.globalPosition); + var distance = direction.length(); + direction.normalize(); + var ray = new BABYLON.Ray(this._scene.activeCamera.globalPosition, direction); + var pickInfo = this._scene.pickWithRay(ray, this.meshesSelectionPredicate, true); + return !pickInfo.hit || pickInfo.distance > distance; + }; + LensFlareSystem.prototype.render = function () { + if (!this._effect.isReady()) + return false; + var engine = this._scene.getEngine(); + var viewport = this._scene.activeCamera.viewport; + var globalViewport = viewport.toGlobal(engine.getRenderWidth(true), engine.getRenderHeight(true)); + // Position + if (!this.computeEffectivePosition(globalViewport)) { + return false; + } + // Visibility + if (!this._isVisible()) { + return false; + } + // Intensity + var awayX; + var awayY; + if (this._positionX < this.borderLimit + globalViewport.x) { + awayX = this.borderLimit + globalViewport.x - this._positionX; + } + else if (this._positionX > globalViewport.x + globalViewport.width - this.borderLimit) { + awayX = this._positionX - globalViewport.x - globalViewport.width + this.borderLimit; + } + else { + awayX = 0; + } + if (this._positionY < this.borderLimit + globalViewport.y) { + awayY = this.borderLimit + globalViewport.y - this._positionY; + } + else if (this._positionY > globalViewport.y + globalViewport.height - this.borderLimit) { + awayY = this._positionY - globalViewport.y - globalViewport.height + this.borderLimit; + } + else { + awayY = 0; + } + var away = (awayX > awayY) ? awayX : awayY; + away -= this.viewportBorder; + if (away > this.borderLimit) { + away = this.borderLimit; + } + var intensity = 1.0 - (away / this.borderLimit); + if (intensity < 0) { + return false; + } + if (intensity > 1.0) { + intensity = 1.0; + } + if (this.viewportBorder > 0) { + globalViewport.x += this.viewportBorder; + globalViewport.y += this.viewportBorder; + globalViewport.width -= this.viewportBorder * 2; + globalViewport.height -= this.viewportBorder * 2; + this._positionX -= this.viewportBorder; + this._positionY -= this.viewportBorder; + } + // Position + var centerX = globalViewport.x + globalViewport.width / 2; + var centerY = globalViewport.y + globalViewport.height / 2; + var distX = centerX - this._positionX; + var distY = centerY - this._positionY; + // Effects + engine.enableEffect(this._effect); + engine.setState(false); + engine.setDepthBuffer(false); + // VBOs + engine.bindBuffers(this._vertexBuffers, this._indexBuffer, this._effect); + // Flares + for (var index = 0; index < this.lensFlares.length; index++) { + var flare = this.lensFlares[index]; + engine.setAlphaMode(flare.alphaMode); + var x = centerX - (distX * flare.position); + var y = centerY - (distY * flare.position); + var cw = flare.size; + var ch = flare.size * engine.getAspectRatio(this._scene.activeCamera, true); + var cx = 2 * (x / (globalViewport.width + globalViewport.x * 2)) - 1.0; + var cy = 1.0 - 2 * (y / (globalViewport.height + globalViewport.y * 2)); + var viewportMatrix = BABYLON.Matrix.FromValues(cw / 2, 0, 0, 0, 0, ch / 2, 0, 0, 0, 0, 1, 0, cx, cy, 0, 1); + this._effect.setMatrix("viewportMatrix", viewportMatrix); + // Texture + this._effect.setTexture("textureSampler", flare.texture); + // Color + this._effect.setFloat4("color", flare.color.r * intensity, flare.color.g * intensity, flare.color.b * intensity, 1.0); + // Draw order + engine.draw(true, 0, 6); + } + engine.setDepthBuffer(true); + engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE); + return true; + }; + LensFlareSystem.prototype.dispose = function () { + var vertexBuffer = this._vertexBuffers[BABYLON.VertexBuffer.PositionKind]; + if (vertexBuffer) { + vertexBuffer.dispose(); + this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = null; + } + if (this._indexBuffer) { + this._scene.getEngine()._releaseBuffer(this._indexBuffer); + this._indexBuffer = null; + } + while (this.lensFlares.length) { + this.lensFlares[0].dispose(); + } + // Remove from scene + var index = this._scene.lensFlareSystems.indexOf(this); + this._scene.lensFlareSystems.splice(index, 1); + }; + LensFlareSystem.Parse = function (parsedLensFlareSystem, scene, rootUrl) { + var emitter = scene.getLastEntryByID(parsedLensFlareSystem.emitterId); + var name = parsedLensFlareSystem.name || "lensFlareSystem#" + parsedLensFlareSystem.emitterId; + var lensFlareSystem = new LensFlareSystem(name, emitter, scene); + lensFlareSystem.id = parsedLensFlareSystem.id || name; + lensFlareSystem.borderLimit = parsedLensFlareSystem.borderLimit; + for (var index = 0; index < parsedLensFlareSystem.flares.length; index++) { + var parsedFlare = parsedLensFlareSystem.flares[index]; + var flare = new BABYLON.LensFlare(parsedFlare.size, parsedFlare.position, BABYLON.Color3.FromArray(parsedFlare.color), rootUrl + parsedFlare.textureName, lensFlareSystem); + } + return lensFlareSystem; + }; + LensFlareSystem.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.id = this.id; + serializationObject.name = this.name; + serializationObject.emitterId = this.getEmitter().id; + serializationObject.borderLimit = this.borderLimit; + serializationObject.flares = []; + for (var index = 0; index < this.lensFlares.length; index++) { + var flare = this.lensFlares[index]; + serializationObject.flares.push({ + size: flare.size, + position: flare.position, + color: flare.color.asArray(), + textureName: BABYLON.Tools.GetFilename(flare.texture.name) + }); + } + return serializationObject; + }; + return LensFlareSystem; + }()); + BABYLON.LensFlareSystem = LensFlareSystem; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.lensFlareSystem.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + // We're mainly based on the logic defined into the FreeCamera code + var DeviceOrientationCamera = (function (_super) { + __extends(DeviceOrientationCamera, _super); + function DeviceOrientationCamera(name, position, scene) { + _super.call(this, name, position, scene); + this._quaternionCache = new BABYLON.Quaternion(); + this.inputs.addDeviceOrientation(); + } + DeviceOrientationCamera.prototype.getTypeName = function () { + return "DeviceOrientationCamera"; + }; + DeviceOrientationCamera.prototype._checkInputs = function () { + _super.prototype._checkInputs.call(this); + this._quaternionCache.copyFrom(this.rotationQuaternion); + if (this._initialQuaternion) { + this._initialQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion); + } + }; + DeviceOrientationCamera.prototype.resetToCurrentRotation = function (axis) { + var _this = this; + if (axis === void 0) { axis = BABYLON.Axis.Y; } + //can only work if this camera has a rotation quaternion already. + if (!this.rotationQuaternion) + return; + if (!this._initialQuaternion) { + this._initialQuaternion = new BABYLON.Quaternion(); + } + this._initialQuaternion.copyFrom(this._quaternionCache || this.rotationQuaternion); + ['x', 'y', 'z'].forEach(function (axisName) { + if (!axis[axisName]) { + _this._initialQuaternion[axisName] = 0; + } + else { + _this._initialQuaternion[axisName] *= -1; + } + }); + this._initialQuaternion.normalize(); + //force rotation update + this._initialQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion); + }; + return DeviceOrientationCamera; + }(BABYLON.FreeCamera)); + BABYLON.DeviceOrientationCamera = DeviceOrientationCamera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.deviceOrientationCamera.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var VRDeviceOrientationFreeCamera = (function (_super) { + __extends(VRDeviceOrientationFreeCamera, _super); + function VRDeviceOrientationFreeCamera(name, position, scene, compensateDistortion, vrCameraMetrics) { + if (compensateDistortion === void 0) { compensateDistortion = true; } + if (vrCameraMetrics === void 0) { vrCameraMetrics = BABYLON.VRCameraMetrics.GetDefault(); } + _super.call(this, name, position, scene); + vrCameraMetrics.compensateDistortion = compensateDistortion; + this.setCameraRigMode(BABYLON.Camera.RIG_MODE_VR, { vrCameraMetrics: vrCameraMetrics }); + } + VRDeviceOrientationFreeCamera.prototype.getTypeName = function () { + return "VRDeviceOrientationFreeCamera"; + }; + return VRDeviceOrientationFreeCamera; + }(BABYLON.DeviceOrientationCamera)); + BABYLON.VRDeviceOrientationFreeCamera = VRDeviceOrientationFreeCamera; + var VRDeviceOrientationArcRotateCamera = (function (_super) { + __extends(VRDeviceOrientationArcRotateCamera, _super); + function VRDeviceOrientationArcRotateCamera(name, alpha, beta, radius, target, scene, compensateDistortion, vrCameraMetrics) { + if (compensateDistortion === void 0) { compensateDistortion = true; } + if (vrCameraMetrics === void 0) { vrCameraMetrics = BABYLON.VRCameraMetrics.GetDefault(); } + _super.call(this, name, alpha, beta, radius, target, scene); + vrCameraMetrics.compensateDistortion = compensateDistortion; + this.setCameraRigMode(BABYLON.Camera.RIG_MODE_VR, { vrCameraMetrics: vrCameraMetrics }); + this.inputs.addVRDeviceOrientation(); + } + VRDeviceOrientationArcRotateCamera.prototype.getTypeName = function () { + return "VRDeviceOrientationArcRotateCamera"; + }; + return VRDeviceOrientationArcRotateCamera; + }(BABYLON.ArcRotateCamera)); + BABYLON.VRDeviceOrientationArcRotateCamera = VRDeviceOrientationArcRotateCamera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.vrDeviceOrientationCamera.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + // We're mainly based on the logic defined into the FreeCamera code + var UniversalCamera = (function (_super) { + __extends(UniversalCamera, _super); + //-- end properties for backward compatibility for inputs + function UniversalCamera(name, position, scene) { + _super.call(this, name, position, scene); + this.inputs.addGamepad(); + } + Object.defineProperty(UniversalCamera.prototype, "gamepadAngularSensibility", { + //-- Begin properties for backward compatibility for inputs + get: function () { + var gamepad = this.inputs.attached["gamepad"]; + if (gamepad) + return gamepad.gamepadAngularSensibility; + }, + set: function (value) { + var gamepad = this.inputs.attached["gamepad"]; + if (gamepad) + gamepad.gamepadAngularSensibility = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(UniversalCamera.prototype, "gamepadMoveSensibility", { + get: function () { + var gamepad = this.inputs.attached["gamepad"]; + if (gamepad) + return gamepad.gamepadMoveSensibility; + }, + set: function (value) { + var gamepad = this.inputs.attached["gamepad"]; + if (gamepad) + gamepad.gamepadMoveSensibility = value; + }, + enumerable: true, + configurable: true + }); + UniversalCamera.prototype.getTypeName = function () { + return "UniversalCamera"; + }; + return UniversalCamera; + }(BABYLON.TouchCamera)); + BABYLON.UniversalCamera = UniversalCamera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.universalCamera.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var Gamepads = (function () { + function Gamepads(ongamedpadconnected) { + var _this = this; + this.babylonGamepads = []; + this.oneGamepadConnected = false; + this.isMonitoring = false; + this.gamepadEventSupported = 'GamepadEvent' in window; + this.gamepadSupportAvailable = (navigator.getGamepads || + !!navigator.webkitGetGamepads || !!navigator.msGetGamepads || !!navigator.webkitGamepads); + this._callbackGamepadConnected = ongamedpadconnected; + if (this.gamepadSupportAvailable) { + // Checking if the gamepad connected event is supported (like in Firefox) + if (this.gamepadEventSupported) { + this._onGamepadConnectedEvent = function (evt) { + _this._onGamepadConnected(evt); + }; + this._onGamepadDisonnectedEvent = function (evt) { + _this._onGamepadDisconnected(evt); + }; + window.addEventListener('gamepadconnected', this._onGamepadConnectedEvent, false); + window.addEventListener('gamepaddisconnected', this._onGamepadDisonnectedEvent, false); + } + else { + this._startMonitoringGamepads(); + } + } + } + Gamepads.prototype.dispose = function () { + if (Gamepads.gamepadDOMInfo) { + document.body.removeChild(Gamepads.gamepadDOMInfo); + } + if (this._onGamepadConnectedEvent) { + window.removeEventListener('gamepadconnected', this._onGamepadConnectedEvent, false); + window.removeEventListener('gamepaddisconnected', this._onGamepadDisonnectedEvent, false); + this._onGamepadConnectedEvent = null; + this._onGamepadDisonnectedEvent = null; + } + }; + Gamepads.prototype._onGamepadConnected = function (evt) { + var newGamepad = this._addNewGamepad(evt.gamepad); + if (this._callbackGamepadConnected) + this._callbackGamepadConnected(newGamepad); + this._startMonitoringGamepads(); + }; + Gamepads.prototype._addNewGamepad = function (gamepad) { + if (!this.oneGamepadConnected) { + this.oneGamepadConnected = true; + if (Gamepads.gamepadDOMInfo) { + document.body.removeChild(Gamepads.gamepadDOMInfo); + Gamepads.gamepadDOMInfo = null; + } + } + var newGamepad; + var xboxOne = (gamepad.id.search("Xbox One") !== -1); + if (xboxOne || gamepad.id.search("Xbox 360") !== -1 || gamepad.id.search("xinput") !== -1) { + newGamepad = new Xbox360Pad(gamepad.id, gamepad.index, gamepad, xboxOne); + } + else { + newGamepad = new GenericPad(gamepad.id, gamepad.index, gamepad); + } + this.babylonGamepads.push(newGamepad); + return newGamepad; + }; + Gamepads.prototype._onGamepadDisconnected = function (evt) { + // Remove the gamepad from the list of gamepads to monitor. + for (var i in this.babylonGamepads) { + if (this.babylonGamepads[i].index == evt.gamepad.index) { + this.babylonGamepads.splice(+i, 1); + break; + } + } + // If no gamepads are left, stop the polling loop. + if (this.babylonGamepads.length == 0) { + this._stopMonitoringGamepads(); + } + }; + Gamepads.prototype._startMonitoringGamepads = function () { + if (!this.isMonitoring) { + this.isMonitoring = true; + this._checkGamepadsStatus(); + } + }; + Gamepads.prototype._stopMonitoringGamepads = function () { + this.isMonitoring = false; + }; + Gamepads.prototype._checkGamepadsStatus = function () { + var _this = this; + // updating gamepad objects + this._updateGamepadObjects(); + for (var i in this.babylonGamepads) { + this.babylonGamepads[i].update(); + } + if (this.isMonitoring) { + if (window.requestAnimationFrame) { + window.requestAnimationFrame(function () { _this._checkGamepadsStatus(); }); + } + else if (window.mozRequestAnimationFrame) { + window.mozRequestAnimationFrame(function () { _this._checkGamepadsStatus(); }); + } + else if (window.webkitRequestAnimationFrame) { + window.webkitRequestAnimationFrame(function () { _this._checkGamepadsStatus(); }); + } + } + }; + // This function is called only on Chrome, which does not yet support + // connection/disconnection events, but requires you to monitor + // an array for changes. + Gamepads.prototype._updateGamepadObjects = function () { + var gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + for (var i = 0; i < gamepads.length; i++) { + if (gamepads[i]) { + if (!(gamepads[i].index in this.babylonGamepads)) { + var newGamepad = this._addNewGamepad(gamepads[i]); + if (this._callbackGamepadConnected) { + this._callbackGamepadConnected(newGamepad); + } + } + else { + this.babylonGamepads[i].browserGamepad = gamepads[i]; + } + } + } + }; + return Gamepads; + }()); + BABYLON.Gamepads = Gamepads; + var StickValues = (function () { + function StickValues(x, y) { + this.x = x; + this.y = y; + } + return StickValues; + }()); + BABYLON.StickValues = StickValues; + var Gamepad = (function () { + function Gamepad(id, index, browserGamepad, leftStickX, leftStickY, rightStickX, rightStickY) { + if (leftStickX === void 0) { leftStickX = 0; } + if (leftStickY === void 0) { leftStickY = 1; } + if (rightStickX === void 0) { rightStickX = 2; } + if (rightStickY === void 0) { rightStickY = 3; } + this.id = id; + this.index = index; + this.browserGamepad = browserGamepad; + this._leftStickAxisX = leftStickX; + this._leftStickAxisY = leftStickY; + this._rightStickAxisX = rightStickX; + this._rightStickAxisY = rightStickY; + if (this.browserGamepad.axes.length >= 2) { + this._leftStick = { x: this.browserGamepad.axes[this._leftStickAxisX], y: this.browserGamepad.axes[this._leftStickAxisY] }; + } + if (this.browserGamepad.axes.length >= 4) { + this._rightStick = { x: this.browserGamepad.axes[this._rightStickAxisX], y: this.browserGamepad.axes[this._rightStickAxisY] }; + } + } + Gamepad.prototype.onleftstickchanged = function (callback) { + this._onleftstickchanged = callback; + }; + Gamepad.prototype.onrightstickchanged = function (callback) { + this._onrightstickchanged = callback; + }; + Object.defineProperty(Gamepad.prototype, "leftStick", { + get: function () { + return this._leftStick; + }, + set: function (newValues) { + if (this._onleftstickchanged && (this._leftStick.x !== newValues.x || this._leftStick.y !== newValues.y)) { + this._onleftstickchanged(newValues); + } + this._leftStick = newValues; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Gamepad.prototype, "rightStick", { + get: function () { + return this._rightStick; + }, + set: function (newValues) { + if (this._onrightstickchanged && (this._rightStick.x !== newValues.x || this._rightStick.y !== newValues.y)) { + this._onrightstickchanged(newValues); + } + this._rightStick = newValues; + }, + enumerable: true, + configurable: true + }); + Gamepad.prototype.update = function () { + if (this._leftStick) { + this.leftStick = { x: this.browserGamepad.axes[this._leftStickAxisX], y: this.browserGamepad.axes[this._leftStickAxisY] }; + } + if (this._rightStick) { + this.rightStick = { x: this.browserGamepad.axes[this._rightStickAxisX], y: this.browserGamepad.axes[this._rightStickAxisY] }; + } + }; + return Gamepad; + }()); + BABYLON.Gamepad = Gamepad; + var GenericPad = (function (_super) { + __extends(GenericPad, _super); + function GenericPad(id, index, gamepad) { + _super.call(this, id, index, gamepad); + this.id = id; + this.index = index; + this.gamepad = gamepad; + this._buttons = new Array(gamepad.buttons.length); + } + GenericPad.prototype.onbuttondown = function (callback) { + this._onbuttondown = callback; + }; + GenericPad.prototype.onbuttonup = function (callback) { + this._onbuttonup = callback; + }; + GenericPad.prototype._setButtonValue = function (newValue, currentValue, buttonIndex) { + if (newValue !== currentValue) { + if (this._onbuttondown && newValue === 1) { + this._onbuttondown(buttonIndex); + } + if (this._onbuttonup && newValue === 0) { + this._onbuttonup(buttonIndex); + } + } + return newValue; + }; + GenericPad.prototype.update = function () { + _super.prototype.update.call(this); + for (var index = 0; index < this._buttons.length; index++) { + this._buttons[index] = this._setButtonValue(this.gamepad.buttons[index].value, this._buttons[index], index); + } + }; + return GenericPad; + }(Gamepad)); + BABYLON.GenericPad = GenericPad; + (function (Xbox360Button) { + Xbox360Button[Xbox360Button["A"] = 0] = "A"; + Xbox360Button[Xbox360Button["B"] = 1] = "B"; + Xbox360Button[Xbox360Button["X"] = 2] = "X"; + Xbox360Button[Xbox360Button["Y"] = 3] = "Y"; + Xbox360Button[Xbox360Button["Start"] = 4] = "Start"; + Xbox360Button[Xbox360Button["Back"] = 5] = "Back"; + Xbox360Button[Xbox360Button["LB"] = 6] = "LB"; + Xbox360Button[Xbox360Button["RB"] = 7] = "RB"; + Xbox360Button[Xbox360Button["LeftStick"] = 8] = "LeftStick"; + Xbox360Button[Xbox360Button["RightStick"] = 9] = "RightStick"; + })(BABYLON.Xbox360Button || (BABYLON.Xbox360Button = {})); + var Xbox360Button = BABYLON.Xbox360Button; + (function (Xbox360Dpad) { + Xbox360Dpad[Xbox360Dpad["Up"] = 0] = "Up"; + Xbox360Dpad[Xbox360Dpad["Down"] = 1] = "Down"; + Xbox360Dpad[Xbox360Dpad["Left"] = 2] = "Left"; + Xbox360Dpad[Xbox360Dpad["Right"] = 3] = "Right"; + })(BABYLON.Xbox360Dpad || (BABYLON.Xbox360Dpad = {})); + var Xbox360Dpad = BABYLON.Xbox360Dpad; + var Xbox360Pad = (function (_super) { + __extends(Xbox360Pad, _super); + function Xbox360Pad(id, index, gamepad, xboxOne) { + if (xboxOne === void 0) { xboxOne = false; } + _super.call(this, id, index, gamepad, 0, 1, (xboxOne ? 3 : 2), (xboxOne ? 4 : 3)); + this._leftTrigger = 0; + this._rightTrigger = 0; + this._buttonA = 0; + this._buttonB = 0; + this._buttonX = 0; + this._buttonY = 0; + this._buttonBack = 0; + this._buttonStart = 0; + this._buttonLB = 0; + this._buttonRB = 0; + this._buttonLeftStick = 0; + this._buttonRightStick = 0; + this._dPadUp = 0; + this._dPadDown = 0; + this._dPadLeft = 0; + this._dPadRight = 0; + this._isXboxOnePad = false; + this._isXboxOnePad = xboxOne; + } + Xbox360Pad.prototype.onlefttriggerchanged = function (callback) { + this._onlefttriggerchanged = callback; + }; + Xbox360Pad.prototype.onrighttriggerchanged = function (callback) { + this._onrighttriggerchanged = callback; + }; + Object.defineProperty(Xbox360Pad.prototype, "leftTrigger", { + get: function () { + return this._leftTrigger; + }, + set: function (newValue) { + if (this._onlefttriggerchanged && this._leftTrigger !== newValue) { + this._onlefttriggerchanged(newValue); + } + this._leftTrigger = newValue; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Xbox360Pad.prototype, "rightTrigger", { + get: function () { + return this._rightTrigger; + }, + set: function (newValue) { + if (this._onrighttriggerchanged && this._rightTrigger !== newValue) { + this._onrighttriggerchanged(newValue); + } + this._rightTrigger = newValue; + }, + enumerable: true, + configurable: true + }); + Xbox360Pad.prototype.onbuttondown = function (callback) { + this._onbuttondown = callback; + }; + Xbox360Pad.prototype.onbuttonup = function (callback) { + this._onbuttonup = callback; + }; + Xbox360Pad.prototype.ondpaddown = function (callback) { + this._ondpaddown = callback; + }; + Xbox360Pad.prototype.ondpadup = function (callback) { + this._ondpadup = callback; + }; + Xbox360Pad.prototype._setButtonValue = function (newValue, currentValue, buttonType) { + if (newValue !== currentValue) { + if (this._onbuttondown && newValue === 1) { + this._onbuttondown(buttonType); + } + if (this._onbuttonup && newValue === 0) { + this._onbuttonup(buttonType); + } + } + return newValue; + }; + Xbox360Pad.prototype._setDPadValue = function (newValue, currentValue, buttonType) { + if (newValue !== currentValue) { + if (this._ondpaddown && newValue === 1) { + this._ondpaddown(buttonType); + } + if (this._ondpadup && newValue === 0) { + this._ondpadup(buttonType); + } + } + return newValue; + }; + Object.defineProperty(Xbox360Pad.prototype, "buttonA", { + get: function () { + return this._buttonA; + }, + set: function (value) { + this._buttonA = this._setButtonValue(value, this._buttonA, Xbox360Button.A); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Xbox360Pad.prototype, "buttonB", { + get: function () { + return this._buttonB; + }, + set: function (value) { + this._buttonB = this._setButtonValue(value, this._buttonB, Xbox360Button.B); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Xbox360Pad.prototype, "buttonX", { + get: function () { + return this._buttonX; + }, + set: function (value) { + this._buttonX = this._setButtonValue(value, this._buttonX, Xbox360Button.X); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Xbox360Pad.prototype, "buttonY", { + get: function () { + return this._buttonY; + }, + set: function (value) { + this._buttonY = this._setButtonValue(value, this._buttonY, Xbox360Button.Y); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Xbox360Pad.prototype, "buttonStart", { + get: function () { + return this._buttonStart; + }, + set: function (value) { + this._buttonStart = this._setButtonValue(value, this._buttonStart, Xbox360Button.Start); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Xbox360Pad.prototype, "buttonBack", { + get: function () { + return this._buttonBack; + }, + set: function (value) { + this._buttonBack = this._setButtonValue(value, this._buttonBack, Xbox360Button.Back); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Xbox360Pad.prototype, "buttonLB", { + get: function () { + return this._buttonLB; + }, + set: function (value) { + this._buttonLB = this._setButtonValue(value, this._buttonLB, Xbox360Button.LB); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Xbox360Pad.prototype, "buttonRB", { + get: function () { + return this._buttonRB; + }, + set: function (value) { + this._buttonRB = this._setButtonValue(value, this._buttonRB, Xbox360Button.RB); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Xbox360Pad.prototype, "buttonLeftStick", { + get: function () { + return this._buttonLeftStick; + }, + set: function (value) { + this._buttonLeftStick = this._setButtonValue(value, this._buttonLeftStick, Xbox360Button.LeftStick); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Xbox360Pad.prototype, "buttonRightStick", { + get: function () { + return this._buttonRightStick; + }, + set: function (value) { + this._buttonRightStick = this._setButtonValue(value, this._buttonRightStick, Xbox360Button.RightStick); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Xbox360Pad.prototype, "dPadUp", { + get: function () { + return this._dPadUp; + }, + set: function (value) { + this._dPadUp = this._setDPadValue(value, this._dPadUp, Xbox360Dpad.Up); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Xbox360Pad.prototype, "dPadDown", { + get: function () { + return this._dPadDown; + }, + set: function (value) { + this._dPadDown = this._setDPadValue(value, this._dPadDown, Xbox360Dpad.Down); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Xbox360Pad.prototype, "dPadLeft", { + get: function () { + return this._dPadLeft; + }, + set: function (value) { + this._dPadLeft = this._setDPadValue(value, this._dPadLeft, Xbox360Dpad.Left); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Xbox360Pad.prototype, "dPadRight", { + get: function () { + return this._dPadRight; + }, + set: function (value) { + this._dPadRight = this._setDPadValue(value, this._dPadRight, Xbox360Dpad.Right); + }, + enumerable: true, + configurable: true + }); + Xbox360Pad.prototype.update = function () { + _super.prototype.update.call(this); + if (this._isXboxOnePad) { + this.buttonA = this.browserGamepad.buttons[0].value; + this.buttonB = this.browserGamepad.buttons[1].value; + this.buttonX = this.browserGamepad.buttons[2].value; + this.buttonY = this.browserGamepad.buttons[3].value; + this.buttonLB = this.browserGamepad.buttons[4].value; + this.buttonRB = this.browserGamepad.buttons[5].value; + this.leftTrigger = this.browserGamepad.axes[2]; + this.rightTrigger = this.browserGamepad.axes[5]; + this.buttonBack = this.browserGamepad.buttons[9].value; + this.buttonStart = this.browserGamepad.buttons[8].value; + this.buttonLeftStick = this.browserGamepad.buttons[6].value; + this.buttonRightStick = this.browserGamepad.buttons[7].value; + this.dPadUp = this.browserGamepad.buttons[11].value; + this.dPadDown = this.browserGamepad.buttons[12].value; + this.dPadLeft = this.browserGamepad.buttons[13].value; + this.dPadRight = this.browserGamepad.buttons[14].value; + } + else { + this.buttonA = this.browserGamepad.buttons[0].value; + this.buttonB = this.browserGamepad.buttons[1].value; + this.buttonX = this.browserGamepad.buttons[2].value; + this.buttonY = this.browserGamepad.buttons[3].value; + this.buttonLB = this.browserGamepad.buttons[4].value; + this.buttonRB = this.browserGamepad.buttons[5].value; + this.leftTrigger = this.browserGamepad.buttons[6].value; + this.rightTrigger = this.browserGamepad.buttons[7].value; + this.buttonBack = this.browserGamepad.buttons[8].value; + this.buttonStart = this.browserGamepad.buttons[9].value; + this.buttonLeftStick = this.browserGamepad.buttons[10].value; + this.buttonRightStick = this.browserGamepad.buttons[11].value; + this.dPadUp = this.browserGamepad.buttons[12].value; + this.dPadDown = this.browserGamepad.buttons[13].value; + this.dPadLeft = this.browserGamepad.buttons[14].value; + this.dPadRight = this.browserGamepad.buttons[15].value; + } + }; + return Xbox360Pad; + }(Gamepad)); + BABYLON.Xbox360Pad = Xbox360Pad; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.gamepads.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + // We're mainly based on the logic defined into the FreeCamera code + var GamepadCamera = (function (_super) { + __extends(GamepadCamera, _super); + //-- end properties for backward compatibility for inputs + function GamepadCamera(name, position, scene) { + BABYLON.Tools.Warn("Deprecated. Please use Universal Camera instead."); + _super.call(this, name, position, scene); + } + Object.defineProperty(GamepadCamera.prototype, "gamepadAngularSensibility", { + //-- Begin properties for backward compatibility for inputs + get: function () { + var gamepad = this.inputs.attached["gamepad"]; + if (gamepad) + return gamepad.gamepadAngularSensibility; + }, + set: function (value) { + var gamepad = this.inputs.attached["gamepad"]; + if (gamepad) + gamepad.gamepadAngularSensibility = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GamepadCamera.prototype, "gamepadMoveSensibility", { + get: function () { + var gamepad = this.inputs.attached["gamepad"]; + if (gamepad) + return gamepad.gamepadMoveSensibility; + }, + set: function (value) { + var gamepad = this.inputs.attached["gamepad"]; + if (gamepad) + gamepad.gamepadMoveSensibility = value; + }, + enumerable: true, + configurable: true + }); + GamepadCamera.prototype.getTypeName = function () { + return "GamepadCamera"; + }; + return GamepadCamera; + }(BABYLON.UniversalCamera)); + BABYLON.GamepadCamera = GamepadCamera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.gamepadCamera.js.map + +var BABYLON; +(function (BABYLON) { + var Analyser = (function () { + function Analyser(scene) { + this.SMOOTHING = 0.75; + this.FFT_SIZE = 512; + this.BARGRAPHAMPLITUDE = 256; + this.DEBUGCANVASPOS = { x: 20, y: 20 }; + this.DEBUGCANVASSIZE = { width: 320, height: 200 }; + this._scene = scene; + this._audioEngine = BABYLON.Engine.audioEngine; + if (this._audioEngine.canUseWebAudio) { + this._webAudioAnalyser = this._audioEngine.audioContext.createAnalyser(); + this._webAudioAnalyser.minDecibels = -140; + this._webAudioAnalyser.maxDecibels = 0; + this._byteFreqs = new Uint8Array(this._webAudioAnalyser.frequencyBinCount); + this._byteTime = new Uint8Array(this._webAudioAnalyser.frequencyBinCount); + this._floatFreqs = new Float32Array(this._webAudioAnalyser.frequencyBinCount); + } + } + Analyser.prototype.getFrequencyBinCount = function () { + if (this._audioEngine.canUseWebAudio) { + return this._webAudioAnalyser.frequencyBinCount; + } + else { + return 0; + } + }; + Analyser.prototype.getByteFrequencyData = function () { + if (this._audioEngine.canUseWebAudio) { + this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING; + this._webAudioAnalyser.fftSize = this.FFT_SIZE; + this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs); + } + return this._byteFreqs; + }; + Analyser.prototype.getByteTimeDomainData = function () { + if (this._audioEngine.canUseWebAudio) { + this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING; + this._webAudioAnalyser.fftSize = this.FFT_SIZE; + this._webAudioAnalyser.getByteTimeDomainData(this._byteTime); + } + return this._byteTime; + }; + Analyser.prototype.getFloatFrequencyData = function () { + if (this._audioEngine.canUseWebAudio) { + this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING; + this._webAudioAnalyser.fftSize = this.FFT_SIZE; + this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs); + } + return this._floatFreqs; + }; + Analyser.prototype.drawDebugCanvas = function () { + var _this = this; + if (this._audioEngine.canUseWebAudio) { + if (!this._debugCanvas) { + this._debugCanvas = document.createElement("canvas"); + this._debugCanvas.width = this.DEBUGCANVASSIZE.width; + this._debugCanvas.height = this.DEBUGCANVASSIZE.height; + this._debugCanvas.style.position = "absolute"; + this._debugCanvas.style.top = this.DEBUGCANVASPOS.y + "px"; + this._debugCanvas.style.left = this.DEBUGCANVASPOS.x + "px"; + this._debugCanvasContext = this._debugCanvas.getContext("2d"); + document.body.appendChild(this._debugCanvas); + this._registerFunc = function () { + _this.drawDebugCanvas(); + }; + this._scene.registerBeforeRender(this._registerFunc); + } + if (this._registerFunc) { + var workingArray = this.getByteFrequencyData(); + this._debugCanvasContext.fillStyle = 'rgb(0, 0, 0)'; + this._debugCanvasContext.fillRect(0, 0, this.DEBUGCANVASSIZE.width, this.DEBUGCANVASSIZE.height); + // Draw the frequency domain chart. + for (var i = 0; i < this.getFrequencyBinCount(); i++) { + var value = workingArray[i]; + var percent = value / this.BARGRAPHAMPLITUDE; + var height = this.DEBUGCANVASSIZE.height * percent; + var offset = this.DEBUGCANVASSIZE.height - height - 1; + var barWidth = this.DEBUGCANVASSIZE.width / this.getFrequencyBinCount(); + var hue = i / this.getFrequencyBinCount() * 360; + this._debugCanvasContext.fillStyle = 'hsl(' + hue + ', 100%, 50%)'; + this._debugCanvasContext.fillRect(i * barWidth, offset, barWidth, height); + } + } + } + }; + Analyser.prototype.stopDebugCanvas = function () { + if (this._debugCanvas) { + this._scene.unregisterBeforeRender(this._registerFunc); + this._registerFunc = null; + document.body.removeChild(this._debugCanvas); + this._debugCanvas = null; + this._debugCanvasContext = null; + } + }; + Analyser.prototype.connectAudioNodes = function (inputAudioNode, outputAudioNode) { + if (this._audioEngine.canUseWebAudio) { + inputAudioNode.connect(this._webAudioAnalyser); + this._webAudioAnalyser.connect(outputAudioNode); + } + }; + Analyser.prototype.dispose = function () { + if (this._audioEngine.canUseWebAudio) { + this._webAudioAnalyser.disconnect(); + } + }; + return Analyser; + }()); + BABYLON.Analyser = Analyser; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.analyser.js.map + +var BABYLON; +(function (BABYLON) { + var DepthRenderer = (function () { + function DepthRenderer(scene, type) { + var _this = this; + if (type === void 0) { type = BABYLON.Engine.TEXTURETYPE_FLOAT; } + this._viewMatrix = BABYLON.Matrix.Zero(); + this._projectionMatrix = BABYLON.Matrix.Zero(); + this._transformMatrix = BABYLON.Matrix.Zero(); + this._worldViewProjection = BABYLON.Matrix.Zero(); + this._scene = scene; + var engine = scene.getEngine(); + // Render target + this._depthMap = new BABYLON.RenderTargetTexture("depthMap", { width: engine.getRenderWidth(), height: engine.getRenderHeight() }, this._scene, false, true, type); + this._depthMap.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; + this._depthMap.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; + this._depthMap.refreshRate = 1; + this._depthMap.renderParticles = false; + this._depthMap.renderList = null; + // set default depth value to 1.0 (far away) + this._depthMap.onClearObservable.add(function (engine) { + engine.clear(new BABYLON.Color4(1.0, 1.0, 1.0, 1.0), true, true, true); + }); + // Custom render function + var renderSubMesh = function (subMesh) { + var mesh = subMesh.getRenderingMesh(); + var scene = _this._scene; + var engine = scene.getEngine(); + // Culling + engine.setState(subMesh.getMaterial().backFaceCulling); + // Managing instances + var batch = mesh._getInstancesRenderList(subMesh._id); + if (batch.mustReturn) { + return; + } + var hardwareInstancedRendering = (engine.getCaps().instancedArrays !== null) && (batch.visibleInstances[subMesh._id] !== null); + if (_this.isReady(subMesh, hardwareInstancedRendering)) { + engine.enableEffect(_this._effect); + mesh._bind(subMesh, _this._effect, BABYLON.Material.TriangleFillMode); + var material = subMesh.getMaterial(); + _this._effect.setMatrix("viewProjection", scene.getTransformMatrix()); + _this._effect.setFloat("far", scene.activeCamera.maxZ); + // Alpha test + if (material && material.needAlphaTesting()) { + var alphaTexture = material.getAlphaTestTexture(); + _this._effect.setTexture("diffuseSampler", alphaTexture); + _this._effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix()); + } + // Bones + if (mesh.useBones && mesh.computeBonesUsingShaders) { + _this._effect.setMatrices("mBones", mesh.skeleton.getTransformMatrices(mesh)); + } + // Draw + mesh._processRendering(subMesh, _this._effect, BABYLON.Material.TriangleFillMode, batch, hardwareInstancedRendering, function (isInstance, world) { return _this._effect.setMatrix("world", world); }); + } + }; + this._depthMap.customRenderFunction = function (opaqueSubMeshes, alphaTestSubMeshes) { + var index; + for (index = 0; index < opaqueSubMeshes.length; index++) { + renderSubMesh(opaqueSubMeshes.data[index]); + } + for (index = 0; index < alphaTestSubMeshes.length; index++) { + renderSubMesh(alphaTestSubMeshes.data[index]); + } + }; + } + DepthRenderer.prototype.isReady = function (subMesh, useInstances) { + var material = subMesh.getMaterial(); + if (material.disableDepthWrite) { + return false; + } + var defines = []; + var attribs = [BABYLON.VertexBuffer.PositionKind]; + var mesh = subMesh.getMesh(); + var scene = mesh.getScene(); + // Alpha test + if (material && material.needAlphaTesting()) { + defines.push("#define ALPHATEST"); + if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) { + attribs.push(BABYLON.VertexBuffer.UVKind); + defines.push("#define UV1"); + } + if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) { + attribs.push(BABYLON.VertexBuffer.UV2Kind); + defines.push("#define UV2"); + } + } + // Bones + if (mesh.useBones && mesh.computeBonesUsingShaders) { + attribs.push(BABYLON.VertexBuffer.MatricesIndicesKind); + attribs.push(BABYLON.VertexBuffer.MatricesWeightsKind); + if (mesh.numBoneInfluencers > 4) { + attribs.push(BABYLON.VertexBuffer.MatricesIndicesExtraKind); + attribs.push(BABYLON.VertexBuffer.MatricesWeightsExtraKind); + } + defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers); + defines.push("#define BonesPerMesh " + (mesh.skeleton.bones.length + 1)); + } + else { + defines.push("#define NUM_BONE_INFLUENCERS 0"); + } + // Instances + if (useInstances) { + defines.push("#define INSTANCES"); + attribs.push("world0"); + attribs.push("world1"); + attribs.push("world2"); + attribs.push("world3"); + } + // Get correct effect + var join = defines.join("\n"); + if (this._cachedDefines !== join) { + this._cachedDefines = join; + this._effect = this._scene.getEngine().createEffect("depth", attribs, ["world", "mBones", "viewProjection", "diffuseMatrix", "far"], ["diffuseSampler"], join); + } + return this._effect.isReady(); + }; + DepthRenderer.prototype.getDepthMap = function () { + return this._depthMap; + }; + // Methods + DepthRenderer.prototype.dispose = function () { + this._depthMap.dispose(); + }; + return DepthRenderer; + }()); + BABYLON.DepthRenderer = DepthRenderer; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.depthRenderer.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var SSAORenderingPipeline = (function (_super) { + __extends(SSAORenderingPipeline, _super); + /** + * @constructor + * @param {string} name - The rendering pipeline name + * @param {BABYLON.Scene} scene - The scene linked to this pipeline + * @param {any} ratio - The size of the postprocesses. Can be a number shared between passes or an object for more precision: { ssaoRatio: 0.5, combineRatio: 1.0 } + * @param {BABYLON.Camera[]} cameras - The array of cameras that the rendering pipeline will be attached to + */ + function SSAORenderingPipeline(name, scene, ratio, cameras) { + var _this = this; + _super.call(this, scene.getEngine(), name); + // Members + /** + * The PassPostProcess id in the pipeline that contains the original scene color + * @type {string} + */ + this.SSAOOriginalSceneColorEffect = "SSAOOriginalSceneColorEffect"; + /** + * The SSAO PostProcess id in the pipeline + * @type {string} + */ + this.SSAORenderEffect = "SSAORenderEffect"; + /** + * The horizontal blur PostProcess id in the pipeline + * @type {string} + */ + this.SSAOBlurHRenderEffect = "SSAOBlurHRenderEffect"; + /** + * The vertical blur PostProcess id in the pipeline + * @type {string} + */ + this.SSAOBlurVRenderEffect = "SSAOBlurVRenderEffect"; + /** + * The PostProcess id in the pipeline that combines the SSAO-Blur output with the original scene color (SSAOOriginalSceneColorEffect) + * @type {string} + */ + this.SSAOCombineRenderEffect = "SSAOCombineRenderEffect"; + /** + * The output strength of the SSAO post-process. Default value is 1.0. + * @type {number} + */ + this.totalStrength = 1.0; + /** + * The radius around the analyzed pixel used by the SSAO post-process. Default value is 0.0006 + * @type {number} + */ + this.radius = 0.0001; + /** + * Related to fallOff, used to interpolate SSAO samples (first interpolate function input) based on the occlusion difference of each pixel + * Must not be equal to fallOff and superior to fallOff. + * Default value is 0.975 + * @type {number} + */ + this.area = 0.0075; + /** + * Related to area, used to interpolate SSAO samples (second interpolate function input) based on the occlusion difference of each pixel + * Must not be equal to area and inferior to area. + * Default value is 0.0 + * @type {number} + */ + this.fallOff = 0.000001; + /** + * The base color of the SSAO post-process + * The final result is "base + ssao" between [0, 1] + * @type {number} + */ + this.base = 0.5; + this._firstUpdate = true; + this._scene = scene; + // Set up assets + this._createRandomTexture(); + this._depthTexture = scene.enableDepthRenderer().getDepthMap(); // Force depth renderer "on" + var ssaoRatio = ratio.ssaoRatio || ratio; + var combineRatio = ratio.combineRatio || ratio; + this._ratio = { + ssaoRatio: ssaoRatio, + combineRatio: combineRatio + }; + this._originalColorPostProcess = new BABYLON.PassPostProcess("SSAOOriginalSceneColor", combineRatio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false); + this._createSSAOPostProcess(ssaoRatio); + this._createBlurPostProcess(ssaoRatio); + this._createSSAOCombinePostProcess(combineRatio); + // Set up pipeline + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), this.SSAOOriginalSceneColorEffect, function () { return _this._originalColorPostProcess; }, true)); + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), this.SSAORenderEffect, function () { return _this._ssaoPostProcess; }, true)); + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), this.SSAOBlurHRenderEffect, function () { return _this._blurHPostProcess; }, true)); + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), this.SSAOBlurVRenderEffect, function () { return _this._blurVPostProcess; }, true)); + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), this.SSAOCombineRenderEffect, function () { return _this._ssaoCombinePostProcess; }, true)); + // Finish + scene.postProcessRenderPipelineManager.addPipeline(this); + if (cameras) + scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name, cameras); + } + // Public Methods + /** + * Returns the horizontal blur PostProcess + * @return {BABYLON.BlurPostProcess} The horizontal blur post-process + */ + SSAORenderingPipeline.prototype.getBlurHPostProcess = function () { + BABYLON.Tools.Error("SSAORenderinPipeline.getBlurHPostProcess() is deprecated, no more blur post-process exists"); + return null; + }; + /** + * Returns the vertical blur PostProcess + * @return {BABYLON.BlurPostProcess} The vertical blur post-process + */ + SSAORenderingPipeline.prototype.getBlurVPostProcess = function () { + BABYLON.Tools.Error("SSAORenderinPipeline.getBlurVPostProcess() is deprecated, no more blur post-process exists"); + return null; + }; + /** + * Removes the internal pipeline assets and detatches the pipeline from the scene cameras + */ + SSAORenderingPipeline.prototype.dispose = function (disableDepthRender) { + if (disableDepthRender === void 0) { disableDepthRender = false; } + for (var i = 0; i < this._scene.cameras.length; i++) { + var camera = this._scene.cameras[i]; + this._originalColorPostProcess.dispose(camera); + this._ssaoPostProcess.dispose(camera); + this._blurHPostProcess.dispose(camera); + this._blurVPostProcess.dispose(camera); + this._ssaoCombinePostProcess.dispose(camera); + } + this._randomTexture.dispose(); + if (disableDepthRender) + this._scene.disableDepthRenderer(); + this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras); + }; + // Private Methods + SSAORenderingPipeline.prototype._createBlurPostProcess = function (ratio) { + var _this = this; + /* + var samplerOffsets = [ + -8.0, -6.0, -4.0, -2.0, + 0.0, + 2.0, 4.0, 6.0, 8.0 + ]; + */ + var samples = 16; + var samplerOffsets = []; + for (var i = -8; i < 8; i++) { + samplerOffsets.push(i * 2); + } + this._blurHPostProcess = new BABYLON.PostProcess("BlurH", "ssao", ["outSize", "samplerOffsets"], ["depthSampler"], ratio, null, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, "#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 16"); + this._blurHPostProcess.onApply = function (effect) { + effect.setFloat("outSize", _this._ssaoCombinePostProcess.width); + effect.setTexture("depthSampler", _this._depthTexture); + if (_this._firstUpdate) { + effect.setArray("samplerOffsets", samplerOffsets); + } + }; + this._blurVPostProcess = new BABYLON.PostProcess("BlurV", "ssao", ["outSize", "samplerOffsets"], ["depthSampler"], ratio, null, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, "#define BILATERAL_BLUR\n#define SAMPLES 16"); + this._blurVPostProcess.onApply = function (effect) { + effect.setFloat("outSize", _this._ssaoCombinePostProcess.height); + effect.setTexture("depthSampler", _this._depthTexture); + if (_this._firstUpdate) { + effect.setArray("samplerOffsets", samplerOffsets); + _this._firstUpdate = false; + } + }; + }; + SSAORenderingPipeline.prototype._createSSAOPostProcess = function (ratio) { + var _this = this; + var numSamples = 16; + var sampleSphere = [ + 0.5381, 0.1856, -0.4319, + 0.1379, 0.2486, 0.4430, + 0.3371, 0.5679, -0.0057, + -0.6999, -0.0451, -0.0019, + 0.0689, -0.1598, -0.8547, + 0.0560, 0.0069, -0.1843, + -0.0146, 0.1402, 0.0762, + 0.0100, -0.1924, -0.0344, + -0.3577, -0.5301, -0.4358, + -0.3169, 0.1063, 0.0158, + 0.0103, -0.5869, 0.0046, + -0.0897, -0.4940, 0.3287, + 0.7119, -0.0154, -0.0918, + -0.0533, 0.0596, -0.5411, + 0.0352, -0.0631, 0.5460, + -0.4776, 0.2847, -0.0271 + ]; + var samplesFactor = 1.0 / numSamples; + this._ssaoPostProcess = new BABYLON.PostProcess("ssao", "ssao", [ + "sampleSphere", "samplesFactor", "randTextureTiles", "totalStrength", "radius", + "area", "fallOff", "base", "range", "viewport" + ], ["randomSampler"], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, "#define SAMPLES " + numSamples + "\n#define SSAO"); + var viewport = new BABYLON.Vector2(0, 0); + this._ssaoPostProcess.onApply = function (effect) { + if (_this._firstUpdate) { + effect.setArray3("sampleSphere", sampleSphere); + effect.setFloat("samplesFactor", samplesFactor); + effect.setFloat("randTextureTiles", 4.0); + } + effect.setFloat("totalStrength", _this.totalStrength); + effect.setFloat("radius", _this.radius); + effect.setFloat("area", _this.area); + effect.setFloat("fallOff", _this.fallOff); + effect.setFloat("base", _this.base); + effect.setTexture("textureSampler", _this._depthTexture); + effect.setTexture("randomSampler", _this._randomTexture); + }; + }; + SSAORenderingPipeline.prototype._createSSAOCombinePostProcess = function (ratio) { + var _this = this; + this._ssaoCombinePostProcess = new BABYLON.PostProcess("ssaoCombine", "ssaoCombine", [], ["originalColor"], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false); + this._ssaoCombinePostProcess.onApply = function (effect) { + effect.setTextureFromPostProcess("originalColor", _this._originalColorPostProcess); + }; + }; + SSAORenderingPipeline.prototype._createRandomTexture = function () { + var size = 512; + this._randomTexture = new BABYLON.DynamicTexture("SSAORandomTexture", size, this._scene, false, BABYLON.Texture.TRILINEAR_SAMPLINGMODE); + this._randomTexture.wrapU = BABYLON.Texture.WRAP_ADDRESSMODE; + this._randomTexture.wrapV = BABYLON.Texture.WRAP_ADDRESSMODE; + var context = this._randomTexture.getContext(); + var rand = function (min, max) { + return Math.random() * (max - min) + min; + }; + var randVector = BABYLON.Vector3.Zero(); + for (var x = 0; x < size; x++) { + for (var y = 0; y < size; y++) { + randVector.x = Math.floor(rand(-1.0, 1.0) * 255); + randVector.y = Math.floor(rand(-1.0, 1.0) * 255); + randVector.z = Math.floor(rand(-1.0, 1.0) * 255); + context.fillStyle = 'rgb(' + randVector.x + ', ' + randVector.y + ', ' + randVector.z + ')'; + context.fillRect(x, y, 1, 1); + } + } + this._randomTexture.update(false); + }; + __decorate([ + BABYLON.serialize() + ], SSAORenderingPipeline.prototype, "totalStrength", void 0); + __decorate([ + BABYLON.serialize() + ], SSAORenderingPipeline.prototype, "radius", void 0); + __decorate([ + BABYLON.serialize() + ], SSAORenderingPipeline.prototype, "area", void 0); + __decorate([ + BABYLON.serialize() + ], SSAORenderingPipeline.prototype, "fallOff", void 0); + __decorate([ + BABYLON.serialize() + ], SSAORenderingPipeline.prototype, "base", void 0); + __decorate([ + BABYLON.serialize() + ], SSAORenderingPipeline.prototype, "_ratio", void 0); + return SSAORenderingPipeline; + }(BABYLON.PostProcessRenderPipeline)); + BABYLON.SSAORenderingPipeline = SSAORenderingPipeline; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.ssaoRenderingPipeline.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + // Inspired by http://http.developer.nvidia.com/GPUGems3/gpugems3_ch13.html + var VolumetricLightScatteringPostProcess = (function (_super) { + __extends(VolumetricLightScatteringPostProcess, _super); + /** + * @constructor + * @param {string} name - The post-process name + * @param {any} ratio - The size of the post-process and/or internal pass (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5) + * @param {BABYLON.Camera} camera - The camera that the post-process will be attached to + * @param {BABYLON.Mesh} mesh - The mesh used to create the light scattering + * @param {number} samples - The post-process quality, default 100 + * @param {number} samplingMode - The post-process filtering mode + * @param {BABYLON.Engine} engine - The babylon engine + * @param {boolean} reusable - If the post-process is reusable + * @param {BABYLON.Scene} scene - The constructor needs a scene reference to initialize internal components. If "camera" is null (RenderPipelineà, "scene" must be provided + */ + function VolumetricLightScatteringPostProcess(name, ratio, camera, mesh, samples, samplingMode, engine, reusable, scene) { + var _this = this; + if (samples === void 0) { samples = 100; } + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.BILINEAR_SAMPLINGMODE; } + _super.call(this, name, "volumetricLightScattering", ["decay", "exposure", "weight", "meshPositionOnScreen", "density"], ["lightScatteringSampler"], ratio.postProcessRatio || ratio, camera, samplingMode, engine, reusable, "#define NUM_SAMPLES " + samples); + this._screenCoordinates = BABYLON.Vector2.Zero(); + /** + * Custom position of the mesh. Used if "useCustomMeshPosition" is set to "true" + * @type {Vector3} + */ + this.customMeshPosition = BABYLON.Vector3.Zero(); + /** + * Set if the post-process should use a custom position for the light source (true) or the internal mesh position (false) + * @type {boolean} + */ + this.useCustomMeshPosition = false; + /** + * If the post-process should inverse the light scattering direction + * @type {boolean} + */ + this.invert = true; + /** + * Array containing the excluded meshes not rendered in the internal pass + */ + this.excludedMeshes = new Array(); + /** + * Controls the overall intensity of the post-process + * @type {number} + */ + this.exposure = 0.3; + /** + * Dissipates each sample's contribution in range [0, 1] + * @type {number} + */ + this.decay = 0.96815; + /** + * Controls the overall intensity of each sample + * @type {number} + */ + this.weight = 0.58767; + /** + * Controls the density of each sample + * @type {number} + */ + this.density = 0.926; + scene = (camera === null) ? scene : camera.getScene(); // parameter "scene" can be null. + var engine = scene.getEngine(); + this._viewPort = new BABYLON.Viewport(0, 0, 1, 1).toGlobal(engine.getRenderWidth(), engine.getRenderHeight()); + // Configure mesh + this.mesh = (mesh !== null) ? mesh : VolumetricLightScatteringPostProcess.CreateDefaultMesh("VolumetricLightScatteringMesh", scene); + // Configure + this._createPass(scene, ratio.passRatio || ratio); + this.onActivate = function (camera) { + if (!_this.isSupported) { + _this.dispose(camera); + } + _this.onActivate = null; + }; + this.onApplyObservable.add(function (effect) { + _this._updateMeshScreenCoordinates(scene); + effect.setTexture("lightScatteringSampler", _this._volumetricLightScatteringRTT); + effect.setFloat("exposure", _this.exposure); + effect.setFloat("decay", _this.decay); + effect.setFloat("weight", _this.weight); + effect.setFloat("density", _this.density); + effect.setVector2("meshPositionOnScreen", _this._screenCoordinates); + }); + } + Object.defineProperty(VolumetricLightScatteringPostProcess.prototype, "useDiffuseColor", { + get: function () { + BABYLON.Tools.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead"); + return false; + }, + set: function (useDiffuseColor) { + BABYLON.Tools.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead"); + }, + enumerable: true, + configurable: true + }); + VolumetricLightScatteringPostProcess.prototype.isReady = function (subMesh, useInstances) { + var mesh = subMesh.getMesh(); + // Render this.mesh as default + if (mesh === this.mesh) { + return mesh.material.isReady(mesh); + } + var defines = []; + var attribs = [BABYLON.VertexBuffer.PositionKind]; + var material = subMesh.getMaterial(); + var needUV = false; + // Alpha test + if (material) { + if (material.needAlphaTesting()) { + defines.push("#define ALPHATEST"); + } + if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) { + attribs.push(BABYLON.VertexBuffer.UVKind); + defines.push("#define UV1"); + } + if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) { + attribs.push(BABYLON.VertexBuffer.UV2Kind); + defines.push("#define UV2"); + } + } + // Bones + if (mesh.useBones && mesh.computeBonesUsingShaders) { + attribs.push(BABYLON.VertexBuffer.MatricesIndicesKind); + attribs.push(BABYLON.VertexBuffer.MatricesWeightsKind); + defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers); + defines.push("#define BonesPerMesh " + (mesh.skeleton.bones.length + 1)); + } + else { + defines.push("#define NUM_BONE_INFLUENCERS 0"); + } + // Instances + if (useInstances) { + defines.push("#define INSTANCES"); + attribs.push("world0"); + attribs.push("world1"); + attribs.push("world2"); + attribs.push("world3"); + } + // Get correct effect + var join = defines.join("\n"); + if (this._cachedDefines !== join) { + this._cachedDefines = join; + this._volumetricLightScatteringPass = mesh.getScene().getEngine().createEffect({ vertexElement: "depth", fragmentElement: "volumetricLightScatteringPass" }, attribs, ["world", "mBones", "viewProjection", "diffuseMatrix"], ["diffuseSampler"], join); + } + return this._volumetricLightScatteringPass.isReady(); + }; + /** + * Sets the new light position for light scattering effect + * @param {BABYLON.Vector3} The new custom light position + */ + VolumetricLightScatteringPostProcess.prototype.setCustomMeshPosition = function (position) { + this.customMeshPosition = position; + }; + /** + * Returns the light position for light scattering effect + * @return {BABYLON.Vector3} The custom light position + */ + VolumetricLightScatteringPostProcess.prototype.getCustomMeshPosition = function () { + return this.customMeshPosition; + }; + /** + * Disposes the internal assets and detaches the post-process from the camera + */ + VolumetricLightScatteringPostProcess.prototype.dispose = function (camera) { + var rttIndex = camera.getScene().customRenderTargets.indexOf(this._volumetricLightScatteringRTT); + if (rttIndex !== -1) { + camera.getScene().customRenderTargets.splice(rttIndex, 1); + } + this._volumetricLightScatteringRTT.dispose(); + _super.prototype.dispose.call(this, camera); + }; + /** + * Returns the render target texture used by the post-process + * @return {BABYLON.RenderTargetTexture} The render target texture used by the post-process + */ + VolumetricLightScatteringPostProcess.prototype.getPass = function () { + return this._volumetricLightScatteringRTT; + }; + // Private methods + VolumetricLightScatteringPostProcess.prototype._meshExcluded = function (mesh) { + if (this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(mesh) !== -1) { + return true; + } + return false; + }; + VolumetricLightScatteringPostProcess.prototype._createPass = function (scene, ratio) { + var _this = this; + var engine = scene.getEngine(); + this._volumetricLightScatteringRTT = new BABYLON.RenderTargetTexture("volumetricLightScatteringMap", { width: engine.getRenderWidth() * ratio, height: engine.getRenderHeight() * ratio }, scene, false, true, BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT); + this._volumetricLightScatteringRTT.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; + this._volumetricLightScatteringRTT.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; + this._volumetricLightScatteringRTT.renderList = null; + this._volumetricLightScatteringRTT.renderParticles = false; + scene.customRenderTargets.push(this._volumetricLightScatteringRTT); + // Custom render function for submeshes + var renderSubMesh = function (subMesh) { + var mesh = subMesh.getRenderingMesh(); + if (_this._meshExcluded(mesh)) { + return; + } + var scene = mesh.getScene(); + var engine = scene.getEngine(); + // Culling + engine.setState(subMesh.getMaterial().backFaceCulling); + // Managing instances + var batch = mesh._getInstancesRenderList(subMesh._id); + if (batch.mustReturn) { + return; + } + var hardwareInstancedRendering = (engine.getCaps().instancedArrays !== null) && (batch.visibleInstances[subMesh._id] !== null); + if (_this.isReady(subMesh, hardwareInstancedRendering)) { + var effect = _this._volumetricLightScatteringPass; + if (mesh === _this.mesh) { + effect = subMesh.getMaterial().getEffect(); + } + engine.enableEffect(effect); + mesh._bind(subMesh, effect, BABYLON.Material.TriangleFillMode); + if (mesh === _this.mesh) { + subMesh.getMaterial().bind(mesh.getWorldMatrix(), mesh); + } + else { + var material = subMesh.getMaterial(); + _this._volumetricLightScatteringPass.setMatrix("viewProjection", scene.getTransformMatrix()); + // Alpha test + if (material && material.needAlphaTesting()) { + var alphaTexture = material.getAlphaTestTexture(); + _this._volumetricLightScatteringPass.setTexture("diffuseSampler", alphaTexture); + if (alphaTexture) { + _this._volumetricLightScatteringPass.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix()); + } + } + // Bones + if (mesh.useBones && mesh.computeBonesUsingShaders) { + _this._volumetricLightScatteringPass.setMatrices("mBones", mesh.skeleton.getTransformMatrices(mesh)); + } + } + // Draw + mesh._processRendering(subMesh, _this._volumetricLightScatteringPass, BABYLON.Material.TriangleFillMode, batch, hardwareInstancedRendering, function (isInstance, world) { return effect.setMatrix("world", world); }); + } + }; + // Render target texture callbacks + var savedSceneClearColor; + var sceneClearColor = new BABYLON.Color4(0.0, 0.0, 0.0, 1.0); + this._volumetricLightScatteringRTT.onBeforeRenderObservable.add(function () { + savedSceneClearColor = scene.clearColor; + scene.clearColor = sceneClearColor; + }); + this._volumetricLightScatteringRTT.onAfterRenderObservable.add(function () { + scene.clearColor = savedSceneClearColor; + }); + this._volumetricLightScatteringRTT.customRenderFunction = function (opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes) { + var engine = scene.getEngine(); + var index; + for (index = 0; index < opaqueSubMeshes.length; index++) { + renderSubMesh(opaqueSubMeshes.data[index]); + } + engine.setAlphaTesting(true); + for (index = 0; index < alphaTestSubMeshes.length; index++) { + renderSubMesh(alphaTestSubMeshes.data[index]); + } + engine.setAlphaTesting(false); + if (transparentSubMeshes.length) { + // Sort sub meshes + for (index = 0; index < transparentSubMeshes.length; index++) { + var submesh = transparentSubMeshes.data[index]; + submesh._alphaIndex = submesh.getMesh().alphaIndex; + submesh._distanceToCamera = submesh.getBoundingInfo().boundingSphere.centerWorld.subtract(scene.activeCamera.position).length(); + } + var sortedArray = transparentSubMeshes.data.slice(0, transparentSubMeshes.length); + sortedArray.sort(function (a, b) { + // Alpha index first + if (a._alphaIndex > b._alphaIndex) { + return 1; + } + if (a._alphaIndex < b._alphaIndex) { + return -1; + } + // Then distance to camera + if (a._distanceToCamera < b._distanceToCamera) { + return 1; + } + if (a._distanceToCamera > b._distanceToCamera) { + return -1; + } + return 0; + }); + // Render sub meshes + engine.setAlphaMode(BABYLON.Engine.ALPHA_COMBINE); + for (index = 0; index < sortedArray.length; index++) { + renderSubMesh(sortedArray[index]); + } + engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE); + } + }; + }; + VolumetricLightScatteringPostProcess.prototype._updateMeshScreenCoordinates = function (scene) { + var transform = scene.getTransformMatrix(); + var meshPosition; + if (this.useCustomMeshPosition) { + meshPosition = this.customMeshPosition; + } + else if (this.attachedNode) { + meshPosition = this.attachedNode.position; + } + else { + meshPosition = this.mesh.parent ? this.mesh.getAbsolutePosition() : this.mesh.position; + } + var pos = BABYLON.Vector3.Project(meshPosition, BABYLON.Matrix.Identity(), transform, this._viewPort); + this._screenCoordinates.x = pos.x / this._viewPort.width; + this._screenCoordinates.y = pos.y / this._viewPort.height; + if (this.invert) + this._screenCoordinates.y = 1.0 - this._screenCoordinates.y; + }; + // Static methods + /** + * Creates a default mesh for the Volumeric Light Scattering post-process + * @param {string} The mesh name + * @param {BABYLON.Scene} The scene where to create the mesh + * @return {BABYLON.Mesh} the default mesh + */ + VolumetricLightScatteringPostProcess.CreateDefaultMesh = function (name, scene) { + var mesh = BABYLON.Mesh.CreatePlane(name, 1, scene); + mesh.billboardMode = BABYLON.AbstractMesh.BILLBOARDMODE_ALL; + var material = new BABYLON.StandardMaterial(name + "Material", scene); + material.emissiveColor = new BABYLON.Color3(1, 1, 1); + mesh.material = material; + return mesh; + }; + __decorate([ + BABYLON.serializeAsVector3() + ], VolumetricLightScatteringPostProcess.prototype, "customMeshPosition", void 0); + __decorate([ + BABYLON.serialize() + ], VolumetricLightScatteringPostProcess.prototype, "useCustomMeshPosition", void 0); + __decorate([ + BABYLON.serialize() + ], VolumetricLightScatteringPostProcess.prototype, "invert", void 0); + __decorate([ + BABYLON.serializeAsMeshReference() + ], VolumetricLightScatteringPostProcess.prototype, "mesh", void 0); + __decorate([ + BABYLON.serialize() + ], VolumetricLightScatteringPostProcess.prototype, "excludedMeshes", void 0); + __decorate([ + BABYLON.serialize() + ], VolumetricLightScatteringPostProcess.prototype, "exposure", void 0); + __decorate([ + BABYLON.serialize() + ], VolumetricLightScatteringPostProcess.prototype, "decay", void 0); + __decorate([ + BABYLON.serialize() + ], VolumetricLightScatteringPostProcess.prototype, "weight", void 0); + __decorate([ + BABYLON.serialize() + ], VolumetricLightScatteringPostProcess.prototype, "density", void 0); + return VolumetricLightScatteringPostProcess; + }(BABYLON.PostProcess)); + BABYLON.VolumetricLightScatteringPostProcess = VolumetricLightScatteringPostProcess; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.volumetricLightScatteringPostProcess.js.map + +// BABYLON.JS Chromatic Aberration GLSL Shader +// Author: Olivier Guyot +// Separates very slightly R, G and B colors on the edges of the screen +// Inspired by Francois Tarlier & Martins Upitis + + + + + + +var BABYLON; +(function (BABYLON) { + var LensRenderingPipeline = (function (_super) { + __extends(LensRenderingPipeline, _super); + /** + * @constructor + * + * Effect parameters are as follow: + * { + * chromatic_aberration: number; // from 0 to x (1 for realism) + * edge_blur: number; // from 0 to x (1 for realism) + * distortion: number; // from 0 to x (1 for realism) + * grain_amount: number; // from 0 to 1 + * grain_texture: BABYLON.Texture; // texture to use for grain effect; if unset, use random B&W noise + * dof_focus_distance: number; // depth-of-field: focus distance; unset to disable (disabled by default) + * dof_aperture: number; // depth-of-field: focus blur bias (default: 1) + * dof_darken: number; // depth-of-field: darken that which is out of focus (from 0 to 1, disabled by default) + * dof_pentagon: boolean; // depth-of-field: makes a pentagon-like "bokeh" effect + * dof_gain: number; // depth-of-field: highlights gain; unset to disable (disabled by default) + * dof_threshold: number; // depth-of-field: highlights threshold (default: 1) + * blur_noise: boolean; // add a little bit of noise to the blur (default: true) + * } + * Note: if an effect parameter is unset, effect is disabled + * + * @param {string} name - The rendering pipeline name + * @param {object} parameters - An object containing all parameters (see above) + * @param {BABYLON.Scene} scene - The scene linked to this pipeline + * @param {number} ratio - The size of the postprocesses (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5) + * @param {BABYLON.Camera[]} cameras - The array of cameras that the rendering pipeline will be attached to + */ + function LensRenderingPipeline(name, parameters, scene, ratio, cameras) { + var _this = this; + if (ratio === void 0) { ratio = 1.0; } + _super.call(this, scene.getEngine(), name); + // Lens effects can be of the following: + // - chromatic aberration (slight shift of RGB colors) + // - blur on the edge of the lens + // - lens distortion + // - depth-of-field blur & highlights enhancing + // - depth-of-field 'bokeh' effect (shapes appearing in blurred areas) + // - grain effect (noise or custom texture) + // Two additional texture samplers are needed: + // - depth map (for depth-of-field) + // - grain texture + /** + * The chromatic aberration PostProcess id in the pipeline + * @type {string} + */ + this.LensChromaticAberrationEffect = "LensChromaticAberrationEffect"; + /** + * The highlights enhancing PostProcess id in the pipeline + * @type {string} + */ + this.HighlightsEnhancingEffect = "HighlightsEnhancingEffect"; + /** + * The depth-of-field PostProcess id in the pipeline + * @type {string} + */ + this.LensDepthOfFieldEffect = "LensDepthOfFieldEffect"; + this._scene = scene; + // Fetch texture samplers + this._depthTexture = scene.enableDepthRenderer().getDepthMap(); // Force depth renderer "on" + if (parameters.grain_texture) { + this._grainTexture = parameters.grain_texture; + } + else { + this._createGrainTexture(); + } + // save parameters + this._edgeBlur = parameters.edge_blur ? parameters.edge_blur : 0; + this._grainAmount = parameters.grain_amount ? parameters.grain_amount : 0; + this._chromaticAberration = parameters.chromatic_aberration ? parameters.chromatic_aberration : 0; + this._distortion = parameters.distortion ? parameters.distortion : 0; + this._highlightsGain = parameters.dof_gain !== undefined ? parameters.dof_gain : -1; + this._highlightsThreshold = parameters.dof_threshold ? parameters.dof_threshold : 1; + this._dofDistance = parameters.dof_focus_distance !== undefined ? parameters.dof_focus_distance : -1; + this._dofAperture = parameters.dof_aperture ? parameters.dof_aperture : 1; + this._dofDarken = parameters.dof_darken ? parameters.dof_darken : 0; + this._dofPentagon = parameters.dof_pentagon !== undefined ? parameters.dof_pentagon : true; + this._blurNoise = parameters.blur_noise !== undefined ? parameters.blur_noise : true; + // Create effects + this._createChromaticAberrationPostProcess(ratio); + this._createHighlightsPostProcess(ratio); + this._createDepthOfFieldPostProcess(ratio / 4); + // Set up pipeline + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), this.LensChromaticAberrationEffect, function () { return _this._chromaticAberrationPostProcess; }, true)); + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), this.HighlightsEnhancingEffect, function () { return _this._highlightsPostProcess; }, true)); + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), this.LensDepthOfFieldEffect, function () { return _this._depthOfFieldPostProcess; }, true)); + if (this._highlightsGain === -1) { + this._disableEffect(this.HighlightsEnhancingEffect, null); + } + // Finish + scene.postProcessRenderPipelineManager.addPipeline(this); + if (cameras) { + scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name, cameras); + } + } + // public methods (self explanatory) + LensRenderingPipeline.prototype.setEdgeBlur = function (amount) { this._edgeBlur = amount; }; + LensRenderingPipeline.prototype.disableEdgeBlur = function () { this._edgeBlur = 0; }; + LensRenderingPipeline.prototype.setGrainAmount = function (amount) { this._grainAmount = amount; }; + LensRenderingPipeline.prototype.disableGrain = function () { this._grainAmount = 0; }; + LensRenderingPipeline.prototype.setChromaticAberration = function (amount) { this._chromaticAberration = amount; }; + LensRenderingPipeline.prototype.disableChromaticAberration = function () { this._chromaticAberration = 0; }; + LensRenderingPipeline.prototype.setEdgeDistortion = function (amount) { this._distortion = amount; }; + LensRenderingPipeline.prototype.disableEdgeDistortion = function () { this._distortion = 0; }; + LensRenderingPipeline.prototype.setFocusDistance = function (amount) { this._dofDistance = amount; }; + LensRenderingPipeline.prototype.disableDepthOfField = function () { this._dofDistance = -1; }; + LensRenderingPipeline.prototype.setAperture = function (amount) { this._dofAperture = amount; }; + LensRenderingPipeline.prototype.setDarkenOutOfFocus = function (amount) { this._dofDarken = amount; }; + LensRenderingPipeline.prototype.enablePentagonBokeh = function () { + this._highlightsPostProcess.updateEffect("#define PENTAGON\n"); + }; + LensRenderingPipeline.prototype.disablePentagonBokeh = function () { + this._highlightsPostProcess.updateEffect(); + }; + LensRenderingPipeline.prototype.enableNoiseBlur = function () { this._blurNoise = true; }; + LensRenderingPipeline.prototype.disableNoiseBlur = function () { this._blurNoise = false; }; + LensRenderingPipeline.prototype.setHighlightsGain = function (amount) { + this._highlightsGain = amount; + }; + LensRenderingPipeline.prototype.setHighlightsThreshold = function (amount) { + if (this._highlightsGain === -1) { + this._highlightsGain = 1.0; + } + this._highlightsThreshold = amount; + }; + LensRenderingPipeline.prototype.disableHighlights = function () { + this._highlightsGain = -1; + }; + /** + * Removes the internal pipeline assets and detaches the pipeline from the scene cameras + */ + LensRenderingPipeline.prototype.dispose = function (disableDepthRender) { + if (disableDepthRender === void 0) { disableDepthRender = false; } + this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras); + this._chromaticAberrationPostProcess = undefined; + this._highlightsPostProcess = undefined; + this._depthOfFieldPostProcess = undefined; + this._grainTexture.dispose(); + if (disableDepthRender) + this._scene.disableDepthRenderer(); + }; + // colors shifting and distortion + LensRenderingPipeline.prototype._createChromaticAberrationPostProcess = function (ratio) { + var _this = this; + this._chromaticAberrationPostProcess = new BABYLON.PostProcess("LensChromaticAberration", "chromaticAberration", ["chromatic_aberration", "screen_width", "screen_height"], // uniforms + [], // samplers + ratio, null, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false); + this._chromaticAberrationPostProcess.onApply = function (effect) { + effect.setFloat('chromatic_aberration', _this._chromaticAberration); + effect.setFloat('screen_width', _this._scene.getEngine().getRenderingCanvas().width); + effect.setFloat('screen_height', _this._scene.getEngine().getRenderingCanvas().height); + }; + }; + // highlights enhancing + LensRenderingPipeline.prototype._createHighlightsPostProcess = function (ratio) { + var _this = this; + this._highlightsPostProcess = new BABYLON.PostProcess("LensHighlights", "lensHighlights", ["gain", "threshold", "screen_width", "screen_height"], // uniforms + [], // samplers + ratio, null, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, this._dofPentagon ? "#define PENTAGON\n" : ""); + this._highlightsPostProcess.onApply = function (effect) { + effect.setFloat('gain', _this._highlightsGain); + effect.setFloat('threshold', _this._highlightsThreshold); + effect.setTextureFromPostProcess("textureSampler", _this._chromaticAberrationPostProcess); + effect.setFloat('screen_width', _this._scene.getEngine().getRenderingCanvas().width); + effect.setFloat('screen_height', _this._scene.getEngine().getRenderingCanvas().height); + }; + }; + // colors shifting and distortion + LensRenderingPipeline.prototype._createDepthOfFieldPostProcess = function (ratio) { + var _this = this; + this._depthOfFieldPostProcess = new BABYLON.PostProcess("LensDepthOfField", "depthOfField", [ + "grain_amount", "blur_noise", "screen_width", "screen_height", "distortion", "dof_enabled", + "screen_distance", "aperture", "darken", "edge_blur", "highlights", "near", "far" + ], ["depthSampler", "grainSampler", "highlightsSampler"], ratio, null, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false); + this._depthOfFieldPostProcess.onApply = function (effect) { + effect.setTexture("depthSampler", _this._depthTexture); + effect.setTexture("grainSampler", _this._grainTexture); + effect.setTextureFromPostProcess("textureSampler", _this._highlightsPostProcess); + effect.setTextureFromPostProcess("highlightsSampler", _this._depthOfFieldPostProcess); + effect.setFloat('grain_amount', _this._grainAmount); + effect.setBool('blur_noise', _this._blurNoise); + effect.setFloat('screen_width', _this._scene.getEngine().getRenderingCanvas().width); + effect.setFloat('screen_height', _this._scene.getEngine().getRenderingCanvas().height); + effect.setFloat('distortion', _this._distortion); + effect.setBool('dof_enabled', (_this._dofDistance !== -1)); + effect.setFloat('screen_distance', 1.0 / (0.1 - 1.0 / _this._dofDistance)); + effect.setFloat('aperture', _this._dofAperture); + effect.setFloat('darken', _this._dofDarken); + effect.setFloat('edge_blur', _this._edgeBlur); + effect.setBool('highlights', (_this._highlightsGain !== -1)); + effect.setFloat('near', _this._scene.activeCamera.minZ); + effect.setFloat('far', _this._scene.activeCamera.maxZ); + }; + }; + // creates a black and white random noise texture, 512x512 + LensRenderingPipeline.prototype._createGrainTexture = function () { + var size = 512; + this._grainTexture = new BABYLON.DynamicTexture("LensNoiseTexture", size, this._scene, false, BABYLON.Texture.BILINEAR_SAMPLINGMODE); + this._grainTexture.wrapU = BABYLON.Texture.WRAP_ADDRESSMODE; + this._grainTexture.wrapV = BABYLON.Texture.WRAP_ADDRESSMODE; + var context = this._grainTexture.getContext(); + var rand = function (min, max) { + return Math.random() * (max - min) + min; + }; + var value; + for (var x = 0; x < size; x++) { + for (var y = 0; y < size; y++) { + value = Math.floor(rand(0.42, 0.58) * 255); + context.fillStyle = 'rgb(' + value + ', ' + value + ', ' + value + ')'; + context.fillRect(x, y, 1, 1); + } + } + this._grainTexture.update(false); + }; + return LensRenderingPipeline; + }(BABYLON.PostProcessRenderPipeline)); + BABYLON.LensRenderingPipeline = LensRenderingPipeline; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.lensRenderingPipeline.js.map + +// +// This post-process allows the modification of rendered colors by using +// a 'look-up table' (LUT). This effect is also called Color Grading. +// +// The object needs to be provided an url to a texture containing the color +// look-up table: the texture must be 256 pixels wide and 16 pixels high. +// Use an image editing software to tweak the LUT to match your needs. +// +// For an example of a color LUT, see here: +// http://udn.epicgames.com/Three/rsrc/Three/ColorGrading/RGBTable16x1.png +// For explanations on color grading, see here: +// http://udn.epicgames.com/Three/ColorGrading.html +// + + + + + + +var BABYLON; +(function (BABYLON) { + var ColorCorrectionPostProcess = (function (_super) { + __extends(ColorCorrectionPostProcess, _super); + function ColorCorrectionPostProcess(name, colorTableUrl, options, camera, samplingMode, engine, reusable) { + var _this = this; + _super.call(this, name, 'colorCorrection', null, ['colorTable'], options, camera, samplingMode, engine, reusable); + this._colorTableTexture = new BABYLON.Texture(colorTableUrl, camera.getScene(), true, false, BABYLON.Texture.TRILINEAR_SAMPLINGMODE); + this._colorTableTexture.anisotropicFilteringLevel = 1; + this._colorTableTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; + this._colorTableTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; + this.onApply = function (effect) { + effect.setTexture("colorTable", _this._colorTableTexture); + }; + } + return ColorCorrectionPostProcess; + }(BABYLON.PostProcess)); + BABYLON.ColorCorrectionPostProcess = ColorCorrectionPostProcess; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.colorCorrectionPostProcess.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var AnaglyphFreeCamera = (function (_super) { + __extends(AnaglyphFreeCamera, _super); + function AnaglyphFreeCamera(name, position, interaxialDistance, scene) { + _super.call(this, name, position, scene); + this.interaxialDistance = interaxialDistance; + this.setCameraRigMode(BABYLON.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: interaxialDistance }); + } + AnaglyphFreeCamera.prototype.getTypeName = function () { + return "AnaglyphFreeCamera"; + }; + return AnaglyphFreeCamera; + }(BABYLON.FreeCamera)); + BABYLON.AnaglyphFreeCamera = AnaglyphFreeCamera; + var AnaglyphArcRotateCamera = (function (_super) { + __extends(AnaglyphArcRotateCamera, _super); + function AnaglyphArcRotateCamera(name, alpha, beta, radius, target, interaxialDistance, scene) { + _super.call(this, name, alpha, beta, radius, target, scene); + this.interaxialDistance = interaxialDistance; + this.setCameraRigMode(BABYLON.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: interaxialDistance }); + } + AnaglyphArcRotateCamera.prototype.getTypeName = function () { + return "AnaglyphArcRotateCamera"; + }; + return AnaglyphArcRotateCamera; + }(BABYLON.ArcRotateCamera)); + BABYLON.AnaglyphArcRotateCamera = AnaglyphArcRotateCamera; + var AnaglyphGamepadCamera = (function (_super) { + __extends(AnaglyphGamepadCamera, _super); + function AnaglyphGamepadCamera(name, position, interaxialDistance, scene) { + _super.call(this, name, position, scene); + this.interaxialDistance = interaxialDistance; + this.setCameraRigMode(BABYLON.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: interaxialDistance }); + } + AnaglyphGamepadCamera.prototype.getTypeName = function () { + return "AnaglyphGamepadCamera"; + }; + return AnaglyphGamepadCamera; + }(BABYLON.GamepadCamera)); + BABYLON.AnaglyphGamepadCamera = AnaglyphGamepadCamera; + var AnaglyphUniversalCamera = (function (_super) { + __extends(AnaglyphUniversalCamera, _super); + function AnaglyphUniversalCamera(name, position, interaxialDistance, scene) { + _super.call(this, name, position, scene); + this.interaxialDistance = interaxialDistance; + this.setCameraRigMode(BABYLON.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: interaxialDistance }); + } + AnaglyphUniversalCamera.prototype.getTypeName = function () { + return "AnaglyphUniversalCamera"; + }; + return AnaglyphUniversalCamera; + }(BABYLON.UniversalCamera)); + BABYLON.AnaglyphUniversalCamera = AnaglyphUniversalCamera; + var StereoscopicFreeCamera = (function (_super) { + __extends(StereoscopicFreeCamera, _super); + function StereoscopicFreeCamera(name, position, interaxialDistance, isStereoscopicSideBySide, scene) { + _super.call(this, name, position, scene); + this.interaxialDistance = interaxialDistance; + this.isStereoscopicSideBySide = isStereoscopicSideBySide; + this.setCameraRigMode(isStereoscopicSideBySide ? BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : BABYLON.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER, { interaxialDistance: interaxialDistance }); + } + StereoscopicFreeCamera.prototype.getTypeName = function () { + return "StereoscopicFreeCamera"; + }; + return StereoscopicFreeCamera; + }(BABYLON.FreeCamera)); + BABYLON.StereoscopicFreeCamera = StereoscopicFreeCamera; + var StereoscopicArcRotateCamera = (function (_super) { + __extends(StereoscopicArcRotateCamera, _super); + function StereoscopicArcRotateCamera(name, alpha, beta, radius, target, interaxialDistance, isStereoscopicSideBySide, scene) { + _super.call(this, name, alpha, beta, radius, target, scene); + this.interaxialDistance = interaxialDistance; + this.isStereoscopicSideBySide = isStereoscopicSideBySide; + this.setCameraRigMode(isStereoscopicSideBySide ? BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : BABYLON.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER, { interaxialDistance: interaxialDistance }); + } + StereoscopicArcRotateCamera.prototype.getTypeName = function () { + return "StereoscopicArcRotateCamera"; + }; + return StereoscopicArcRotateCamera; + }(BABYLON.ArcRotateCamera)); + BABYLON.StereoscopicArcRotateCamera = StereoscopicArcRotateCamera; + var StereoscopicGamepadCamera = (function (_super) { + __extends(StereoscopicGamepadCamera, _super); + function StereoscopicGamepadCamera(name, position, interaxialDistance, isStereoscopicSideBySide, scene) { + _super.call(this, name, position, scene); + this.interaxialDistance = interaxialDistance; + this.isStereoscopicSideBySide = isStereoscopicSideBySide; + this.setCameraRigMode(isStereoscopicSideBySide ? BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : BABYLON.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER, { interaxialDistance: interaxialDistance }); + } + StereoscopicGamepadCamera.prototype.getTypeName = function () { + return "StereoscopicGamepadCamera"; + }; + return StereoscopicGamepadCamera; + }(BABYLON.GamepadCamera)); + BABYLON.StereoscopicGamepadCamera = StereoscopicGamepadCamera; + var StereoscopicUniversalCamera = (function (_super) { + __extends(StereoscopicUniversalCamera, _super); + function StereoscopicUniversalCamera(name, position, interaxialDistance, isStereoscopicSideBySide, scene) { + _super.call(this, name, position, scene); + this.interaxialDistance = interaxialDistance; + this.isStereoscopicSideBySide = isStereoscopicSideBySide; + this.setCameraRigMode(isStereoscopicSideBySide ? BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : BABYLON.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER, { interaxialDistance: interaxialDistance }); + } + StereoscopicUniversalCamera.prototype.getTypeName = function () { + return "StereoscopicUniversalCamera"; + }; + return StereoscopicUniversalCamera; + }(BABYLON.UniversalCamera)); + BABYLON.StereoscopicUniversalCamera = StereoscopicUniversalCamera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.stereoscopicCameras.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var HDRRenderingPipeline = (function (_super) { + __extends(HDRRenderingPipeline, _super); + /** + * @constructor + * @param {string} name - The rendering pipeline name + * @param {BABYLON.Scene} scene - The scene linked to this pipeline + * @param {any} ratio - The size of the postprocesses (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5) + * @param {BABYLON.PostProcess} originalPostProcess - the custom original color post-process. Must be "reusable". Can be null. + * @param {BABYLON.Camera[]} cameras - The array of cameras that the rendering pipeline will be attached to + */ + function HDRRenderingPipeline(name, scene, ratio, originalPostProcess, cameras) { + var _this = this; + if (originalPostProcess === void 0) { originalPostProcess = null; } + _super.call(this, scene.getEngine(), name); + /** + * Public members + */ + // Gaussian Blur + /** + * Gaussian blur coefficient + * @type {number} + */ + this.gaussCoeff = 0.3; + /** + * Gaussian blur mean + * @type {number} + */ + this.gaussMean = 1.0; + /** + * Gaussian blur standard deviation + * @type {number} + */ + this.gaussStandDev = 0.8; + /** + * Gaussian blur multiplier. Multiplies the blur effect + * @type {number} + */ + this.gaussMultiplier = 4.0; + // HDR + /** + * Exposure, controls the overall intensity of the pipeline + * @type {number} + */ + this.exposure = 1.0; + /** + * Minimum luminance that the post-process can output. Luminance is >= 0 + * @type {number} + */ + this.minimumLuminance = 1.0; + /** + * Maximum luminance that the post-process can output. Must be suprerior to minimumLuminance + * @type {number} + */ + this.maximumLuminance = 1e20; + /** + * Increase rate for luminance: eye adaptation speed to dark + * @type {number} + */ + this.luminanceIncreaserate = 0.5; + /** + * Decrease rate for luminance: eye adaptation speed to bright + * @type {number} + */ + this.luminanceDecreaseRate = 0.5; + // Bright pass + /** + * Minimum luminance needed to compute HDR + * @type {number} + */ + this.brightThreshold = 0.8; + this._needUpdate = true; + this._scene = scene; + // Bright pass + this._createBrightPassPostProcess(scene, ratio); + // Down sample X4 + this._createDownSampleX4PostProcess(scene, ratio); + // Create gaussian blur post-processes + this._createGaussianBlurPostProcess(scene, ratio); + // Texture adder + this._createTextureAdderPostProcess(scene, ratio); + // Luminance generator + this._createLuminanceGeneratorPostProcess(scene); + // HDR + this._createHDRPostProcess(scene, ratio); + // Pass postprocess + if (originalPostProcess === null) { + this._originalPostProcess = new BABYLON.PassPostProcess("hdr", ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false); + } + else { + this._originalPostProcess = originalPostProcess; + } + // Configure pipeline + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRPassPostProcess", function () { return _this._originalPostProcess; }, true)); + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRBrightPass", function () { return _this._brightPassPostProcess; }, true)); + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRDownSampleX4", function () { return _this._downSampleX4PostProcess; }, true)); + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRGaussianBlurH", function () { return _this._guassianBlurHPostProcess; }, true)); + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRGaussianBlurV", function () { return _this._guassianBlurVPostProcess; }, true)); + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRTextureAdder", function () { return _this._textureAdderPostProcess; }, true)); + var addDownSamplerPostProcess = function (id) { + _this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRDownSampler" + id, function () { return _this._downSamplePostProcesses[id]; }, true)); + }; + for (var i = HDRRenderingPipeline.LUM_STEPS - 1; i >= 0; i--) { + addDownSamplerPostProcess(i); + } + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDR", function () { return _this._hdrPostProcess; }, true)); + // Finish + scene.postProcessRenderPipelineManager.addPipeline(this); + if (cameras !== null) { + scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name, cameras); + } + this.update(); + } + /** + * Tells the pipeline to update its post-processes + */ + HDRRenderingPipeline.prototype.update = function () { + this._needUpdate = true; + }; + /** + * Returns the current calculated luminance + */ + HDRRenderingPipeline.prototype.getCurrentLuminance = function () { + return this._hdrCurrentLuminance; + }; + /** + * Returns the currently drawn luminance + */ + HDRRenderingPipeline.prototype.getOutputLuminance = function () { + return this._hdrOutputLuminance; + }; + /** + * Releases the rendering pipeline and its internal effects. Detaches pipeline from cameras + */ + HDRRenderingPipeline.prototype.dispose = function () { + this._originalPostProcess = undefined; + this._brightPassPostProcess = undefined; + this._downSampleX4PostProcess = undefined; + this._guassianBlurHPostProcess = undefined; + this._guassianBlurVPostProcess = undefined; + this._textureAdderPostProcess = undefined; + for (var i = HDRRenderingPipeline.LUM_STEPS - 1; i >= 0; i--) { + this._downSamplePostProcesses[i] = undefined; + } + this._hdrPostProcess = undefined; + this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras); + }; + /** + * Creates the HDR post-process and computes the luminance adaptation + */ + HDRRenderingPipeline.prototype._createHDRPostProcess = function (scene, ratio) { + var _this = this; + var hdrLastLuminance = 0.0; + this._hdrOutputLuminance = -1.0; + this._hdrCurrentLuminance = 1.0; + this._hdrPostProcess = new BABYLON.PostProcess("hdr", "hdr", ["exposure", "avgLuminance"], ["otherSampler"], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define HDR"); + this._hdrPostProcess.onApply = function (effect) { + if (_this._hdrOutputLuminance < 0.0) { + _this._hdrOutputLuminance = _this._hdrCurrentLuminance; + } + else { + var dt = (hdrLastLuminance - (hdrLastLuminance + scene.getEngine().getDeltaTime())) / 1000.0; + if (_this._hdrCurrentLuminance < _this._hdrOutputLuminance + _this.luminanceDecreaseRate * dt) { + _this._hdrOutputLuminance += _this.luminanceDecreaseRate * dt; + } + else if (_this._hdrCurrentLuminance > _this._hdrOutputLuminance - _this.luminanceIncreaserate * dt) { + _this._hdrOutputLuminance -= _this.luminanceIncreaserate * dt; + } + else { + _this._hdrOutputLuminance = _this._hdrCurrentLuminance; + } + } + _this._hdrOutputLuminance = BABYLON.MathTools.Clamp(_this._hdrOutputLuminance, _this.minimumLuminance, _this.maximumLuminance); + hdrLastLuminance += scene.getEngine().getDeltaTime(); + effect.setTextureFromPostProcess("textureSampler", _this._textureAdderPostProcess); + effect.setTextureFromPostProcess("otherSampler", _this._originalPostProcess); + effect.setFloat("exposure", _this.exposure); + effect.setFloat("avgLuminance", _this._hdrOutputLuminance); + _this._needUpdate = false; + }; + }; + /** + * Texture Adder post-process + */ + HDRRenderingPipeline.prototype._createTextureAdderPostProcess = function (scene, ratio) { + var _this = this; + this._textureAdderPostProcess = new BABYLON.PostProcess("hdr", "hdr", [], ["otherSampler"], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define TEXTURE_ADDER"); + this._textureAdderPostProcess.onApply = function (effect) { + effect.setTextureFromPostProcess("otherSampler", _this._originalPostProcess); + }; + }; + /** + * Down sample X4 post-process + */ + HDRRenderingPipeline.prototype._createDownSampleX4PostProcess = function (scene, ratio) { + var _this = this; + var downSampleX4Offsets = new Array(32); + this._downSampleX4PostProcess = new BABYLON.PostProcess("hdr", "hdr", ["dsOffsets"], [], ratio / 4, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define DOWN_SAMPLE_X4"); + this._downSampleX4PostProcess.onApply = function (effect) { + if (_this._needUpdate) { + var id = 0; + for (var i = -2; i < 2; i++) { + for (var j = -2; j < 2; j++) { + downSampleX4Offsets[id] = (i + 0.5) * (1.0 / _this._downSampleX4PostProcess.width); + downSampleX4Offsets[id + 1] = (j + 0.5) * (1.0 / _this._downSampleX4PostProcess.height); + id += 2; + } + } + } + effect.setArray2("dsOffsets", downSampleX4Offsets); + }; + }; + /** + * Bright pass post-process + */ + HDRRenderingPipeline.prototype._createBrightPassPostProcess = function (scene, ratio) { + var _this = this; + var brightOffsets = new Array(8); + var brightPassCallback = function (effect) { + if (_this._needUpdate) { + var sU = (1.0 / _this._brightPassPostProcess.width); + var sV = (1.0 / _this._brightPassPostProcess.height); + brightOffsets[0] = -0.5 * sU; + brightOffsets[1] = 0.5 * sV; + brightOffsets[2] = 0.5 * sU; + brightOffsets[3] = 0.5 * sV; + brightOffsets[4] = -0.5 * sU; + brightOffsets[5] = -0.5 * sV; + brightOffsets[6] = 0.5 * sU; + brightOffsets[7] = -0.5 * sV; + } + effect.setArray2("dsOffsets", brightOffsets); + effect.setFloat("brightThreshold", _this.brightThreshold); + }; + this._brightPassPostProcess = new BABYLON.PostProcess("hdr", "hdr", ["dsOffsets", "brightThreshold"], [], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define BRIGHT_PASS"); + this._brightPassPostProcess.onApply = brightPassCallback; + }; + /** + * Luminance generator. Creates the luminance post-process and down sample post-processes + */ + HDRRenderingPipeline.prototype._createLuminanceGeneratorPostProcess = function (scene) { + var _this = this; + var lumSteps = HDRRenderingPipeline.LUM_STEPS; + var luminanceOffsets = new Array(8); + var downSampleOffsets = new Array(18); + var halfDestPixelSize; + this._downSamplePostProcesses = new Array(lumSteps); + // Utils for luminance + var luminanceUpdateSourceOffsets = function (width, height) { + var sU = (1.0 / width); + var sV = (1.0 / height); + luminanceOffsets[0] = -0.5 * sU; + luminanceOffsets[1] = 0.5 * sV; + luminanceOffsets[2] = 0.5 * sU; + luminanceOffsets[3] = 0.5 * sV; + luminanceOffsets[4] = -0.5 * sU; + luminanceOffsets[5] = -0.5 * sV; + luminanceOffsets[6] = 0.5 * sU; + luminanceOffsets[7] = -0.5 * sV; + }; + var luminanceUpdateDestOffsets = function (width, height) { + var id = 0; + for (var x = -1; x < 2; x++) { + for (var y = -1; y < 2; y++) { + downSampleOffsets[id] = (x) / width; + downSampleOffsets[id + 1] = (y) / height; + id += 2; + } + } + }; + // Luminance callback + var luminanceCallback = function (effect) { + if (_this._needUpdate) { + luminanceUpdateSourceOffsets(_this._textureAdderPostProcess.width, _this._textureAdderPostProcess.height); + } + effect.setTextureFromPostProcess("textureSampler", _this._textureAdderPostProcess); + effect.setArray2("lumOffsets", luminanceOffsets); + }; + // Down sample callbacks + var downSampleCallback = function (indice) { + var i = indice; + return function (effect) { + luminanceUpdateSourceOffsets(_this._downSamplePostProcesses[i].width, _this._downSamplePostProcesses[i].height); + luminanceUpdateDestOffsets(_this._downSamplePostProcesses[i].width, _this._downSamplePostProcesses[i].height); + halfDestPixelSize = 0.5 / _this._downSamplePostProcesses[i].width; + effect.setTextureFromPostProcess("textureSampler", _this._downSamplePostProcesses[i + 1]); + effect.setFloat("halfDestPixelSize", halfDestPixelSize); + effect.setArray2("dsOffsets", downSampleOffsets); + }; + }; + var downSampleAfterRenderCallback = function (effect) { + // Unpack result + var pixel = scene.getEngine().readPixels(0, 0, 1, 1); + var bit_shift = new BABYLON.Vector4(1.0 / (255.0 * 255.0 * 255.0), 1.0 / (255.0 * 255.0), 1.0 / 255.0, 1.0); + _this._hdrCurrentLuminance = (pixel[0] * bit_shift.x + pixel[1] * bit_shift.y + pixel[2] * bit_shift.z + pixel[3] * bit_shift.w) / 100.0; + }; + // Create luminance post-process + var ratio = { width: Math.pow(3, lumSteps - 1), height: Math.pow(3, lumSteps - 1) }; + this._downSamplePostProcesses[lumSteps - 1] = new BABYLON.PostProcess("hdr", "hdr", ["lumOffsets"], [], ratio, null, BABYLON.Texture.NEAREST_SAMPLINGMODE, scene.getEngine(), false, "#define LUMINANCE_GENERATOR", BABYLON.Engine.TEXTURETYPE_FLOAT); + this._downSamplePostProcesses[lumSteps - 1].onApply = luminanceCallback; + // Create down sample post-processes + for (var i = lumSteps - 2; i >= 0; i--) { + var length = Math.pow(3, i); + ratio = { width: length, height: length }; + var defines = "#define DOWN_SAMPLE\n"; + if (i === 0) { + defines += "#define FINAL_DOWN_SAMPLE\n"; // To pack the result + } + this._downSamplePostProcesses[i] = new BABYLON.PostProcess("hdr", "hdr", ["dsOffsets", "halfDestPixelSize"], [], ratio, null, BABYLON.Texture.NEAREST_SAMPLINGMODE, scene.getEngine(), false, defines, BABYLON.Engine.TEXTURETYPE_FLOAT); + this._downSamplePostProcesses[i].onApply = downSampleCallback(i); + if (i === 0) { + this._downSamplePostProcesses[i].onAfterRender = downSampleAfterRenderCallback; + } + } + }; + /** + * Gaussian blur post-processes. Horizontal and Vertical + */ + HDRRenderingPipeline.prototype._createGaussianBlurPostProcess = function (scene, ratio) { + var _this = this; + var blurOffsetsW = new Array(9); + var blurOffsetsH = new Array(9); + var blurWeights = new Array(9); + var uniforms = ["blurOffsets", "blurWeights", "multiplier"]; + // Utils for gaussian blur + var calculateBlurOffsets = function (height) { + var lastOutputDimensions = { + width: scene.getEngine().getRenderWidth(), + height: scene.getEngine().getRenderHeight() + }; + for (var i = 0; i < 9; i++) { + var value = (i - 4.0) * (1.0 / (height === true ? lastOutputDimensions.height : lastOutputDimensions.width)); + if (height) { + blurOffsetsH[i] = value; + } + else { + blurOffsetsW[i] = value; + } + } + }; + var calculateWeights = function () { + var x = 0.0; + for (var i = 0; i < 9; i++) { + x = (i - 4.0) / 4.0; + blurWeights[i] = _this.gaussCoeff * (1.0 / Math.sqrt(2.0 * Math.PI * _this.gaussStandDev)) * Math.exp((-((x - _this.gaussMean) * (x - _this.gaussMean))) / (2.0 * _this.gaussStandDev * _this.gaussStandDev)); + } + }; + // Callback + var gaussianBlurCallback = function (height) { + return function (effect) { + if (_this._needUpdate) { + calculateWeights(); + calculateBlurOffsets(height); + } + effect.setArray("blurOffsets", height ? blurOffsetsH : blurOffsetsW); + effect.setArray("blurWeights", blurWeights); + effect.setFloat("multiplier", _this.gaussMultiplier); + }; + }; + // Create horizontal gaussian blur post-processes + this._guassianBlurHPostProcess = new BABYLON.PostProcess("hdr", "hdr", uniforms, [], ratio / 4, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define GAUSSIAN_BLUR_H"); + this._guassianBlurHPostProcess.onApply = gaussianBlurCallback(false); + // Create vertical gaussian blur post-process + this._guassianBlurVPostProcess = new BABYLON.PostProcess("hdr", "hdr", uniforms, [], ratio / 4, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define GAUSSIAN_BLUR_V"); + this._guassianBlurVPostProcess.onApply = gaussianBlurCallback(true); + }; + // Luminance generator + HDRRenderingPipeline.LUM_STEPS = 6; + return HDRRenderingPipeline; + }(BABYLON.PostProcessRenderPipeline)); + BABYLON.HDRRenderingPipeline = HDRRenderingPipeline; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.hdrRenderingPipeline.js.map + +var BABYLON; +(function (BABYLON) { + var FaceAdjacencies = (function () { + function FaceAdjacencies() { + this.edges = new Array(); + this.edgesConnectedCount = 0; + } + return FaceAdjacencies; + }()); + var EdgesRenderer = (function () { + // Beware when you use this class with complex objects as the adjacencies computation can be really long + function EdgesRenderer(source, epsilon, checkVerticesInsteadOfIndices) { + if (epsilon === void 0) { epsilon = 0.95; } + if (checkVerticesInsteadOfIndices === void 0) { checkVerticesInsteadOfIndices = false; } + this.edgesWidthScalerForOrthographic = 1000.0; + this.edgesWidthScalerForPerspective = 50.0; + this._linesPositions = new Array(); + this._linesNormals = new Array(); + this._linesIndices = new Array(); + this._buffers = {}; + this._checkVerticesInsteadOfIndices = false; + this._source = source; + this._checkVerticesInsteadOfIndices = checkVerticesInsteadOfIndices; + this._epsilon = epsilon; + this._prepareRessources(); + this._generateEdgesLines(); + } + EdgesRenderer.prototype._prepareRessources = function () { + if (this._lineShader) { + return; + } + this._lineShader = new BABYLON.ShaderMaterial("lineShader", this._source.getScene(), "line", { + attributes: ["position", "normal"], + uniforms: ["worldViewProjection", "color", "width", "aspectRatio"] + }); + this._lineShader.disableDepthWrite = true; + this._lineShader.backFaceCulling = false; + }; + EdgesRenderer.prototype.dispose = function () { + var buffer = this._buffers[BABYLON.VertexBuffer.PositionKind]; + if (buffer) { + buffer.dispose(); + this._buffers[BABYLON.VertexBuffer.PositionKind] = null; + } + buffer = this._buffers[BABYLON.VertexBuffer.NormalKind]; + if (buffer) { + buffer.dispose(); + this._buffers[BABYLON.VertexBuffer.NormalKind] = null; + } + this._source.getScene().getEngine()._releaseBuffer(this._ib); + this._lineShader.dispose(); + }; + EdgesRenderer.prototype._processEdgeForAdjacencies = function (pa, pb, p0, p1, p2) { + if (pa === p0 && pb === p1 || pa === p1 && pb === p0) { + return 0; + } + if (pa === p1 && pb === p2 || pa === p2 && pb === p1) { + return 1; + } + if (pa === p2 && pb === p0 || pa === p0 && pb === p2) { + return 2; + } + return -1; + }; + EdgesRenderer.prototype._processEdgeForAdjacenciesWithVertices = function (pa, pb, p0, p1, p2) { + if (pa.equalsWithEpsilon(p0) && pb.equalsWithEpsilon(p1) || pa.equalsWithEpsilon(p1) && pb.equalsWithEpsilon(p0)) { + return 0; + } + if (pa.equalsWithEpsilon(p1) && pb.equalsWithEpsilon(p2) || pa.equalsWithEpsilon(p2) && pb.equalsWithEpsilon(p1)) { + return 1; + } + if (pa.equalsWithEpsilon(p2) && pb.equalsWithEpsilon(p0) || pa.equalsWithEpsilon(p0) && pb.equalsWithEpsilon(p2)) { + return 2; + } + return -1; + }; + EdgesRenderer.prototype._checkEdge = function (faceIndex, edge, faceNormals, p0, p1) { + var needToCreateLine; + if (edge === undefined) { + needToCreateLine = true; + } + else { + var dotProduct = BABYLON.Vector3.Dot(faceNormals[faceIndex], faceNormals[edge]); + needToCreateLine = dotProduct < this._epsilon; + } + if (needToCreateLine) { + var offset = this._linesPositions.length / 3; + var normal = p0.subtract(p1); + normal.normalize(); + // Positions + this._linesPositions.push(p0.x); + this._linesPositions.push(p0.y); + this._linesPositions.push(p0.z); + this._linesPositions.push(p0.x); + this._linesPositions.push(p0.y); + this._linesPositions.push(p0.z); + this._linesPositions.push(p1.x); + this._linesPositions.push(p1.y); + this._linesPositions.push(p1.z); + this._linesPositions.push(p1.x); + this._linesPositions.push(p1.y); + this._linesPositions.push(p1.z); + // Normals + this._linesNormals.push(p1.x); + this._linesNormals.push(p1.y); + this._linesNormals.push(p1.z); + this._linesNormals.push(-1); + this._linesNormals.push(p1.x); + this._linesNormals.push(p1.y); + this._linesNormals.push(p1.z); + this._linesNormals.push(1); + this._linesNormals.push(p0.x); + this._linesNormals.push(p0.y); + this._linesNormals.push(p0.z); + this._linesNormals.push(-1); + this._linesNormals.push(p0.x); + this._linesNormals.push(p0.y); + this._linesNormals.push(p0.z); + this._linesNormals.push(1); + // Indices + this._linesIndices.push(offset); + this._linesIndices.push(offset + 1); + this._linesIndices.push(offset + 2); + this._linesIndices.push(offset); + this._linesIndices.push(offset + 2); + this._linesIndices.push(offset + 3); + } + }; + EdgesRenderer.prototype._generateEdgesLines = function () { + var positions = this._source.getVerticesData(BABYLON.VertexBuffer.PositionKind); + var indices = this._source.getIndices(); + // First let's find adjacencies + var adjacencies = new Array(); + var faceNormals = new Array(); + var index; + var faceAdjacencies; + // Prepare faces + for (index = 0; index < indices.length; index += 3) { + faceAdjacencies = new FaceAdjacencies(); + var p0Index = indices[index]; + var p1Index = indices[index + 1]; + var p2Index = indices[index + 2]; + faceAdjacencies.p0 = new BABYLON.Vector3(positions[p0Index * 3], positions[p0Index * 3 + 1], positions[p0Index * 3 + 2]); + faceAdjacencies.p1 = new BABYLON.Vector3(positions[p1Index * 3], positions[p1Index * 3 + 1], positions[p1Index * 3 + 2]); + faceAdjacencies.p2 = new BABYLON.Vector3(positions[p2Index * 3], positions[p2Index * 3 + 1], positions[p2Index * 3 + 2]); + var faceNormal = BABYLON.Vector3.Cross(faceAdjacencies.p1.subtract(faceAdjacencies.p0), faceAdjacencies.p2.subtract(faceAdjacencies.p1)); + faceNormal.normalize(); + faceNormals.push(faceNormal); + adjacencies.push(faceAdjacencies); + } + // Scan + for (index = 0; index < adjacencies.length; index++) { + faceAdjacencies = adjacencies[index]; + for (var otherIndex = index + 1; otherIndex < adjacencies.length; otherIndex++) { + var otherFaceAdjacencies = adjacencies[otherIndex]; + if (faceAdjacencies.edgesConnectedCount === 3) { + break; + } + if (otherFaceAdjacencies.edgesConnectedCount === 3) { + continue; + } + var otherP0 = indices[otherIndex * 3]; + var otherP1 = indices[otherIndex * 3 + 1]; + var otherP2 = indices[otherIndex * 3 + 2]; + for (var edgeIndex = 0; edgeIndex < 3; edgeIndex++) { + var otherEdgeIndex; + if (faceAdjacencies.edges[edgeIndex] !== undefined) { + continue; + } + switch (edgeIndex) { + case 0: + if (this._checkVerticesInsteadOfIndices) { + otherEdgeIndex = this._processEdgeForAdjacenciesWithVertices(faceAdjacencies.p0, faceAdjacencies.p1, otherFaceAdjacencies.p0, otherFaceAdjacencies.p1, otherFaceAdjacencies.p2); + } + else { + otherEdgeIndex = this._processEdgeForAdjacencies(indices[index * 3], indices[index * 3 + 1], otherP0, otherP1, otherP2); + } + break; + case 1: + if (this._checkVerticesInsteadOfIndices) { + otherEdgeIndex = this._processEdgeForAdjacenciesWithVertices(faceAdjacencies.p1, faceAdjacencies.p2, otherFaceAdjacencies.p0, otherFaceAdjacencies.p1, otherFaceAdjacencies.p2); + } + else { + otherEdgeIndex = this._processEdgeForAdjacencies(indices[index * 3 + 1], indices[index * 3 + 2], otherP0, otherP1, otherP2); + } + break; + case 2: + if (this._checkVerticesInsteadOfIndices) { + otherEdgeIndex = this._processEdgeForAdjacenciesWithVertices(faceAdjacencies.p2, faceAdjacencies.p0, otherFaceAdjacencies.p0, otherFaceAdjacencies.p1, otherFaceAdjacencies.p2); + } + else { + otherEdgeIndex = this._processEdgeForAdjacencies(indices[index * 3 + 2], indices[index * 3], otherP0, otherP1, otherP2); + } + break; + } + if (otherEdgeIndex === -1) { + continue; + } + faceAdjacencies.edges[edgeIndex] = otherIndex; + otherFaceAdjacencies.edges[otherEdgeIndex] = index; + faceAdjacencies.edgesConnectedCount++; + otherFaceAdjacencies.edgesConnectedCount++; + if (faceAdjacencies.edgesConnectedCount === 3) { + break; + } + } + } + } + // Create lines + for (index = 0; index < adjacencies.length; index++) { + // We need a line when a face has no adjacency on a specific edge or if all the adjacencies has an angle greater than epsilon + var current = adjacencies[index]; + this._checkEdge(index, current.edges[0], faceNormals, current.p0, current.p1); + this._checkEdge(index, current.edges[1], faceNormals, current.p1, current.p2); + this._checkEdge(index, current.edges[2], faceNormals, current.p2, current.p0); + } + // Merge into a single mesh + var engine = this._source.getScene().getEngine(); + this._buffers[BABYLON.VertexBuffer.PositionKind] = new BABYLON.VertexBuffer(engine, this._linesPositions, BABYLON.VertexBuffer.PositionKind, false); + this._buffers[BABYLON.VertexBuffer.NormalKind] = new BABYLON.VertexBuffer(engine, this._linesNormals, BABYLON.VertexBuffer.NormalKind, false, false, 4); + this._ib = engine.createIndexBuffer(this._linesIndices); + this._indicesCount = this._linesIndices.length; + }; + EdgesRenderer.prototype.render = function () { + if (!this._lineShader.isReady()) { + return; + } + var scene = this._source.getScene(); + var engine = scene.getEngine(); + this._lineShader._preBind(); + // VBOs + engine.bindBuffers(this._buffers, this._ib, this._lineShader.getEffect()); + scene.resetCachedMaterial(); + this._lineShader.setColor4("color", this._source.edgesColor); + if (scene.activeCamera.mode === BABYLON.Camera.ORTHOGRAPHIC_CAMERA) { + this._lineShader.setFloat("width", this._source.edgesWidth / this.edgesWidthScalerForOrthographic); + } + else { + this._lineShader.setFloat("width", this._source.edgesWidth / this.edgesWidthScalerForPerspective); + } + this._lineShader.setFloat("aspectRatio", engine.getAspectRatio(scene.activeCamera)); + this._lineShader.bind(this._source.getWorldMatrix()); + // Draw order + engine.draw(true, 0, this._indicesCount); + this._lineShader.unbind(); + engine.setDepthWrite(true); + }; + return EdgesRenderer; + }()); + BABYLON.EdgesRenderer = EdgesRenderer; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.edgesRenderer.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + (function (TonemappingOperator) { + TonemappingOperator[TonemappingOperator["Hable"] = 0] = "Hable"; + TonemappingOperator[TonemappingOperator["Reinhard"] = 1] = "Reinhard"; + TonemappingOperator[TonemappingOperator["HejiDawson"] = 2] = "HejiDawson"; + TonemappingOperator[TonemappingOperator["Photographic"] = 3] = "Photographic"; + })(BABYLON.TonemappingOperator || (BABYLON.TonemappingOperator = {})); + var TonemappingOperator = BABYLON.TonemappingOperator; + ; + var TonemapPostProcess = (function (_super) { + __extends(TonemapPostProcess, _super); + function TonemapPostProcess(name, _operator, exposureAdjustment, camera, samplingMode, engine, textureFormat) { + var _this = this; + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.BILINEAR_SAMPLINGMODE; } + if (textureFormat === void 0) { textureFormat = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; } + _super.call(this, name, "tonemap", ["_ExposureAdjustment"], null, 1.0, camera, samplingMode, engine, true, defines, textureFormat); + this._operator = _operator; + this.exposureAdjustment = exposureAdjustment; + var defines = "#define "; + if (this._operator === TonemappingOperator.Hable) + defines += "HABLE_TONEMAPPING"; + else if (this._operator === TonemappingOperator.Reinhard) + defines += "REINHARD_TONEMAPPING"; + else if (this._operator === TonemappingOperator.HejiDawson) + defines += "OPTIMIZED_HEJIDAWSON_TONEMAPPING"; + else if (this._operator === TonemappingOperator.Photographic) + defines += "PHOTOGRAPHIC_TONEMAPPING"; + //sadly a second call to create the effect. + this.updateEffect(defines); + this.onApply = function (effect) { + effect.setFloat("_ExposureAdjustment", _this.exposureAdjustment); + }; + } + return TonemapPostProcess; + }(BABYLON.PostProcess)); + BABYLON.TonemapPostProcess = TonemapPostProcess; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.tonemapPostProcess.js.map + +var BABYLON; +(function (BABYLON) { + var ReflectionProbe = (function () { + function ReflectionProbe(name, size, scene, generateMipMaps) { + var _this = this; + if (generateMipMaps === void 0) { generateMipMaps = true; } + this.name = name; + this._viewMatrix = BABYLON.Matrix.Identity(); + this._target = BABYLON.Vector3.Zero(); + this._add = BABYLON.Vector3.Zero(); + this.invertYAxis = false; + this.position = BABYLON.Vector3.Zero(); + this._scene = scene; + this._scene.reflectionProbes.push(this); + this._renderTargetTexture = new BABYLON.RenderTargetTexture(name, size, scene, generateMipMaps, true, BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT, true); + this._renderTargetTexture.onBeforeRenderObservable.add(function (faceIndex) { + switch (faceIndex) { + case 0: + _this._add.copyFromFloats(1, 0, 0); + break; + case 1: + _this._add.copyFromFloats(-1, 0, 0); + break; + case 2: + _this._add.copyFromFloats(0, _this.invertYAxis ? 1 : -1, 0); + break; + case 3: + _this._add.copyFromFloats(0, _this.invertYAxis ? -1 : 1, 0); + break; + case 4: + _this._add.copyFromFloats(0, 0, 1); + break; + case 5: + _this._add.copyFromFloats(0, 0, -1); + break; + } + if (_this._attachedMesh) { + _this.position.copyFrom(_this._attachedMesh.getAbsolutePosition()); + } + _this.position.addToRef(_this._add, _this._target); + BABYLON.Matrix.LookAtLHToRef(_this.position, _this._target, BABYLON.Vector3.Up(), _this._viewMatrix); + scene.setTransformMatrix(_this._viewMatrix, _this._projectionMatrix); + }); + this._renderTargetTexture.onAfterUnbindObservable.add(function () { + scene.updateTransformMatrix(true); + }); + this._projectionMatrix = BABYLON.Matrix.PerspectiveFovLH(Math.PI / 2, 1, scene.activeCamera.minZ, scene.activeCamera.maxZ); + } + Object.defineProperty(ReflectionProbe.prototype, "refreshRate", { + get: function () { + return this._renderTargetTexture.refreshRate; + }, + set: function (value) { + this._renderTargetTexture.refreshRate = value; + }, + enumerable: true, + configurable: true + }); + ReflectionProbe.prototype.getScene = function () { + return this._scene; + }; + Object.defineProperty(ReflectionProbe.prototype, "cubeTexture", { + get: function () { + return this._renderTargetTexture; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ReflectionProbe.prototype, "renderList", { + get: function () { + return this._renderTargetTexture.renderList; + }, + enumerable: true, + configurable: true + }); + ReflectionProbe.prototype.attachToMesh = function (mesh) { + this._attachedMesh = mesh; + }; + ReflectionProbe.prototype.dispose = function () { + var index = this._scene.reflectionProbes.indexOf(this); + if (index !== -1) { + // Remove from the scene if found + this._scene.reflectionProbes.splice(index, 1); + } + if (this._renderTargetTexture) { + this._renderTargetTexture.dispose(); + this._renderTargetTexture = null; + } + }; + return ReflectionProbe; + }()); + BABYLON.ReflectionProbe = ReflectionProbe; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.reflectionProbe.js.map + +var BABYLON; +(function (BABYLON) { + var SolidParticle = (function () { + /** + * Creates a Solid Particle object. + * Don't create particles manually, use instead the Solid Particle System internal tools like _addParticle() + * `particleIndex` (integer) is the particle index in the Solid Particle System pool. It's also the particle identifier. + * `positionIndex` (integer) is the starting index of the particle vertices in the SPS "positions" array. + * `model` (ModelShape) is a reference to the model shape on what the particle is designed. + * `shapeId` (integer) is the model shape identifier in the SPS. + * `idxInShape` (integer) is the index of the particle in the current model (ex: the 10th box of addShape(box, 30)) + * `modelBoundingInfo` is the reference to the model BoundingInfo used for intersection computations. + */ + function SolidParticle(particleIndex, positionIndex, model, shapeId, idxInShape, sps, modelBoundingInfo) { + this.idx = 0; // particle global index + this.color = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0); // color + this.position = BABYLON.Vector3.Zero(); // position + this.rotation = BABYLON.Vector3.Zero(); // rotation + this.scaling = new BABYLON.Vector3(1.0, 1.0, 1.0); // scaling + this.uvs = new BABYLON.Vector4(0.0, 0.0, 1.0, 1.0); // uvs + this.velocity = BABYLON.Vector3.Zero(); // velocity + this.alive = true; // alive + this.isVisible = true; // visibility + this._pos = 0; // index of this particle in the global "positions" array + this.shapeId = 0; // model shape id + this.idxInShape = 0; // index of the particle in its shape id + this.idx = particleIndex; + this._pos = positionIndex; + this._model = model; + this.shapeId = shapeId; + this.idxInShape = idxInShape; + this._sps = sps; + if (modelBoundingInfo) { + this._modelBoundingInfo = modelBoundingInfo; + this._boundingInfo = new BABYLON.BoundingInfo(modelBoundingInfo.minimum, modelBoundingInfo.maximum); + } + } + Object.defineProperty(SolidParticle.prototype, "scale", { + /** + * legacy support, changed scale to scaling + */ + get: function () { + return this.scaling; + }, + set: function (scale) { + this.scaling = scale; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SolidParticle.prototype, "quaternion", { + /** + * legacy support, changed quaternion to rotationQuaternion + */ + get: function () { + return this.rotationQuaternion; + }, + set: function (q) { + this.rotationQuaternion = q; + }, + enumerable: true, + configurable: true + }); + /** + * Returns a boolean. True if the particle intersects another particle or another mesh, else false. + * The intersection is computed on the particle bounding sphere and Axis Aligned Bounding Box (AABB) + * `target` is the object (solid particle or mesh) what the intersection is computed against. + */ + SolidParticle.prototype.intersectsMesh = function (target) { + if (!this._boundingInfo || !target._boundingInfo) { + return false; + } + if (this._sps._bSphereOnly) { + return BABYLON.BoundingSphere.Intersects(this._boundingInfo.boundingSphere, target._boundingInfo.boundingSphere); + } + return this._boundingInfo.intersects(target._boundingInfo, false); + }; + return SolidParticle; + }()); + BABYLON.SolidParticle = SolidParticle; + var ModelShape = (function () { + /** + * Creates a ModelShape object. This is an internal simplified reference to a mesh used as for a model to replicate particles from by the SPS. + * SPS internal tool, don't use it manually. + */ + function ModelShape(id, shape, shapeUV, posFunction, vtxFunction) { + this.shapeID = id; + this._shape = shape; + this._shapeUV = shapeUV; + this._positionFunction = posFunction; + this._vertexFunction = vtxFunction; + } + return ModelShape; + }()); + BABYLON.ModelShape = ModelShape; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.solidParticle.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Full documentation here : http://doc.babylonjs.com/overviews/Solid_Particle_System + */ + var SolidParticleSystem = (function () { + /** + * Creates a SPS (Solid Particle System) object. + * `name` (String) is the SPS name, this will be the underlying mesh name. + * `scene` (Scene) is the scene in which the SPS is added. + * `updatable` (optional boolean, default true) : if the SPS must be updatable or immutable. + * `isPickable` (optional boolean, default false) : if the solid particles must be pickable. + * `particleIntersection` (optional boolean, default false) : if the solid particle intersections must be computed. + * `boundingSphereOnly` (optional boolean, default false) : if the particle intersection must be computed only with the bounding sphere (no bounding box computation, so faster). + * `bSphereRadiusFactor` (optional float, default 1.0) : a number to multiply the boundind sphere radius by in order to reduce it for instance. + * Example : bSphereRadiusFactor = 1.0 / Math.sqrt(3.0) => the bounding sphere exactly matches a spherical mesh. + */ + function SolidParticleSystem(name, scene, options) { + // public members + /** + * The SPS array of Solid Particle objects. Just access each particle as with any classic array. + * Example : var p = SPS.particles[i]; + */ + this.particles = new Array(); + /** + * The SPS total number of particles. Read only. Use SPS.counter instead if you need to set your own value. + */ + this.nbParticles = 0; + /** + * If the particles must ever face the camera (default false). Useful for planar particles. + */ + this.billboard = false; + /** + * Recompute normals when adding a shape + */ + this.recomputeNormals = true; + /** + * This a counter ofr your own usage. It's not set by any SPS functions. + */ + this.counter = 0; + /** + * This empty object is intended to store some SPS specific or temporary values in order to lower the Garbage Collector activity. + * Please read : http://doc.babylonjs.com/overviews/Solid_Particle_System#garbage-collector-concerns + */ + this.vars = {}; + this._positions = new Array(); + this._indices = new Array(); + this._normals = new Array(); + this._colors = new Array(); + this._uvs = new Array(); + this._index = 0; // indices index + this._updatable = true; + this._pickable = false; + this._isVisibilityBoxLocked = false; + this._alwaysVisible = false; + this._shapeCounter = 0; + this._copy = new BABYLON.SolidParticle(null, null, null, null, null, null); + this._color = new BABYLON.Color4(0, 0, 0, 0); + this._computeParticleColor = true; + this._computeParticleTexture = true; + this._computeParticleRotation = true; + this._computeParticleVertex = false; + this._computeBoundingBox = false; + this._cam_axisZ = BABYLON.Vector3.Zero(); + this._cam_axisY = BABYLON.Vector3.Zero(); + this._cam_axisX = BABYLON.Vector3.Zero(); + this._axisX = BABYLON.Axis.X; + this._axisY = BABYLON.Axis.Y; + this._axisZ = BABYLON.Axis.Z; + this._camDir = BABYLON.Vector3.Zero(); + this._rotMatrix = new BABYLON.Matrix(); + this._invertMatrix = new BABYLON.Matrix(); + this._rotated = BABYLON.Vector3.Zero(); + this._quaternion = new BABYLON.Quaternion(); + this._vertex = BABYLON.Vector3.Zero(); + this._normal = BABYLON.Vector3.Zero(); + this._yaw = 0.0; + this._pitch = 0.0; + this._roll = 0.0; + this._halfroll = 0.0; + this._halfpitch = 0.0; + this._halfyaw = 0.0; + this._sinRoll = 0.0; + this._cosRoll = 0.0; + this._sinPitch = 0.0; + this._cosPitch = 0.0; + this._sinYaw = 0.0; + this._cosYaw = 0.0; + this._w = 0.0; + this._minimum = BABYLON.Tmp.Vector3[0]; + this._maximum = BABYLON.Tmp.Vector3[1]; + this._scale = BABYLON.Tmp.Vector3[2]; + this._translation = BABYLON.Tmp.Vector3[3]; + this._minBbox = BABYLON.Tmp.Vector3[4]; + this._maxBbox = BABYLON.Tmp.Vector3[5]; + this._particlesIntersect = false; + this._bSphereOnly = false; + this._bSphereRadiusFactor = 1.0; + this.name = name; + this._scene = scene; + this._camera = scene.activeCamera; + this._pickable = options ? options.isPickable : false; + this._particlesIntersect = options ? options.particleIntersection : false; + this._bSphereOnly = options ? options.boundingSphereOnly : false; + this._bSphereRadiusFactor = (options && options.bSphereRadiusFactor) ? options.bSphereRadiusFactor : 1.0; + if (options && options.updatable) { + this._updatable = options.updatable; + } + else { + this._updatable = true; + } + if (this._pickable) { + this.pickedParticles = []; + } + } + /** + * Builds the SPS underlying mesh. Returns a standard Mesh. + * If no model shape was added to the SPS, the returned mesh is just a single triangular plane. + */ + SolidParticleSystem.prototype.buildMesh = function () { + if (this.nbParticles === 0) { + var triangle = BABYLON.MeshBuilder.CreateDisc("", { radius: 1, tessellation: 3 }, this._scene); + this.addShape(triangle, 1); + triangle.dispose(); + } + this._positions32 = new Float32Array(this._positions); + this._uvs32 = new Float32Array(this._uvs); + this._colors32 = new Float32Array(this._colors); + if (this.recomputeNormals) { + BABYLON.VertexData.ComputeNormals(this._positions32, this._indices, this._normals); + } + this._normals32 = new Float32Array(this._normals); + this._fixedNormal32 = new Float32Array(this._normals); + var vertexData = new BABYLON.VertexData(); + vertexData.set(this._positions32, BABYLON.VertexBuffer.PositionKind); + vertexData.indices = this._indices; + vertexData.set(this._normals32, BABYLON.VertexBuffer.NormalKind); + if (this._uvs32) { + vertexData.set(this._uvs32, BABYLON.VertexBuffer.UVKind); + ; + } + if (this._colors32) { + vertexData.set(this._colors32, BABYLON.VertexBuffer.ColorKind); + } + var mesh = new BABYLON.Mesh(this.name, this._scene); + vertexData.applyToMesh(mesh, this._updatable); + this.mesh = mesh; + this.mesh.isPickable = this._pickable; + // free memory + this._positions = null; + this._normals = null; + this._uvs = null; + this._colors = null; + if (!this._updatable) { + this.particles.length = 0; + } + return mesh; + }; + /** + * Digests the mesh and generates as many solid particles in the system as wanted. Returns the SPS. + * These particles will have the same geometry than the mesh parts and will be positioned at the same localisation than the mesh original places. + * Thus the particles generated from `digest()` have their property `position` set yet. + * `mesh` ( Mesh ) is the mesh to be digested + * `facetNb` (optional integer, default 1) is the number of mesh facets per particle, this parameter is overriden by the parameter `number` if any + * `delta` (optional integer, default 0) is the random extra number of facets per particle , each particle will have between `facetNb` and `facetNb + delta` facets + * `number` (optional positive integer) is the wanted number of particles : each particle is built with `mesh_total_facets / number` facets + */ + SolidParticleSystem.prototype.digest = function (mesh, options) { + var size = (options && options.facetNb) || 1; + var number = (options && options.number); + var delta = (options && options.delta) || 0; + var meshPos = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind); + var meshInd = mesh.getIndices(); + var meshUV = mesh.getVerticesData(BABYLON.VertexBuffer.UVKind); + var meshCol = mesh.getVerticesData(BABYLON.VertexBuffer.ColorKind); + var meshNor = mesh.getVerticesData(BABYLON.VertexBuffer.NormalKind); + var f = 0; // facet counter + var totalFacets = meshInd.length / 3; // a facet is a triangle, so 3 indices + // compute size from number + if (number) { + number = (number > totalFacets) ? totalFacets : number; + size = Math.round(totalFacets / number); + delta = 0; + } + else { + size = (size > totalFacets) ? totalFacets : size; + } + var facetPos = []; // submesh positions + var facetInd = []; // submesh indices + var facetUV = []; // submesh UV + var facetCol = []; // submesh colors + var barycenter = BABYLON.Tmp.Vector3[0]; + var rand; + var sizeO = size; + while (f < totalFacets) { + size = sizeO + Math.floor((1 + delta) * Math.random()); + if (f > totalFacets - size) { + size = totalFacets - f; + } + // reset temp arrays + facetPos.length = 0; + facetInd.length = 0; + facetUV.length = 0; + facetCol.length = 0; + // iterate over "size" facets + var fi = 0; + for (var j = f * 3; j < (f + size) * 3; j++) { + facetInd.push(fi); + var i = meshInd[j]; + facetPos.push(meshPos[i * 3], meshPos[i * 3 + 1], meshPos[i * 3 + 2]); + if (meshUV) { + facetUV.push(meshUV[i * 2], meshUV[i * 2 + 1]); + } + if (meshCol) { + facetCol.push(meshCol[i * 4], meshCol[i * 4 + 1], meshCol[i * 4 + 2], meshCol[i * 4 + 3]); + } + fi++; + } + // create a model shape for each single particle + var idx = this.nbParticles; + var shape = this._posToShape(facetPos); + var shapeUV = this._uvsToShapeUV(facetUV); + // compute the barycenter of the shape + var v; + for (v = 0; v < shape.length; v++) { + barycenter.addInPlace(shape[v]); + } + barycenter.scaleInPlace(1 / shape.length); + // shift the shape from its barycenter to the origin + for (v = 0; v < shape.length; v++) { + shape[v].subtractInPlace(barycenter); + } + var bInfo; + if (this._particlesIntersect) { + bInfo = new BABYLON.BoundingInfo(barycenter, barycenter); + } + var modelShape = new BABYLON.ModelShape(this._shapeCounter, shape, shapeUV, null, null); + // add the particle in the SPS + this._meshBuilder(this._index, shape, this._positions, facetInd, this._indices, facetUV, this._uvs, facetCol, this._colors, meshNor, this._normals, idx, 0, null); + this._addParticle(idx, this._positions.length, modelShape, this._shapeCounter, 0, bInfo); + // initialize the particle position + this.particles[this.nbParticles].position.addInPlace(barycenter); + this._index += shape.length; + idx++; + this.nbParticles++; + this._shapeCounter++; + f += size; + } + return this; + }; + //reset copy + SolidParticleSystem.prototype._resetCopy = function () { + this._copy.position.x = 0; + this._copy.position.y = 0; + this._copy.position.z = 0; + this._copy.rotation.x = 0; + this._copy.rotation.y = 0; + this._copy.rotation.z = 0; + this._copy.rotationQuaternion = null; + this._copy.scaling.x = 1; + this._copy.scaling.y = 1; + this._copy.scaling.z = 1; + this._copy.uvs.x = 0; + this._copy.uvs.y = 0; + this._copy.uvs.z = 1; + this._copy.uvs.w = 1; + this._copy.color = null; + }; + // _meshBuilder : inserts the shape model in the global SPS mesh + SolidParticleSystem.prototype._meshBuilder = function (p, shape, positions, meshInd, indices, meshUV, uvs, meshCol, colors, meshNor, normals, idx, idxInShape, options) { + var i; + var u = 0; + var c = 0; + var n = 0; + this._resetCopy(); + if (options && options.positionFunction) { + options.positionFunction(this._copy, idx, idxInShape); + } + if (this._copy.rotationQuaternion) { + this._quaternion.copyFrom(this._copy.rotationQuaternion); + } + else { + this._yaw = this._copy.rotation.y; + this._pitch = this._copy.rotation.x; + this._roll = this._copy.rotation.z; + this._quaternionRotationYPR(); + } + this._quaternionToRotationMatrix(); + for (i = 0; i < shape.length; i++) { + this._vertex.x = shape[i].x; + this._vertex.y = shape[i].y; + this._vertex.z = shape[i].z; + if (options && options.vertexFunction) { + options.vertexFunction(this._copy, this._vertex, i); + } + this._vertex.x *= this._copy.scaling.x; + this._vertex.y *= this._copy.scaling.y; + this._vertex.z *= this._copy.scaling.z; + BABYLON.Vector3.TransformCoordinatesToRef(this._vertex, this._rotMatrix, this._rotated); + positions.push(this._copy.position.x + this._rotated.x, this._copy.position.y + this._rotated.y, this._copy.position.z + this._rotated.z); + if (meshUV) { + uvs.push((this._copy.uvs.z - this._copy.uvs.x) * meshUV[u] + this._copy.uvs.x, (this._copy.uvs.w - this._copy.uvs.y) * meshUV[u + 1] + this._copy.uvs.y); + u += 2; + } + if (this._copy.color) { + this._color = this._copy.color; + } + else if (meshCol && meshCol[c] !== undefined) { + this._color.r = meshCol[c]; + this._color.g = meshCol[c + 1]; + this._color.b = meshCol[c + 2]; + this._color.a = meshCol[c + 3]; + } + else { + this._color.r = 1; + this._color.g = 1; + this._color.b = 1; + this._color.a = 1; + } + colors.push(this._color.r, this._color.g, this._color.b, this._color.a); + c += 4; + if (!this.recomputeNormals && meshNor) { + this._normal.x = meshNor[n]; + this._normal.y = meshNor[n + 1]; + this._normal.z = meshNor[n + 2]; + BABYLON.Vector3.TransformCoordinatesToRef(this._normal, this._rotMatrix, this._normal); + normals.push(this._normal.x, this._normal.y, this._normal.z); + n += 3; + } + } + for (i = 0; i < meshInd.length; i++) { + indices.push(p + meshInd[i]); + } + if (this._pickable) { + var nbfaces = meshInd.length / 3; + for (i = 0; i < nbfaces; i++) { + this.pickedParticles.push({ idx: idx, faceId: i }); + } + } + }; + // returns a shape array from positions array + SolidParticleSystem.prototype._posToShape = function (positions) { + var shape = []; + for (var i = 0; i < positions.length; i += 3) { + shape.push(new BABYLON.Vector3(positions[i], positions[i + 1], positions[i + 2])); + } + return shape; + }; + // returns a shapeUV array from a Vector4 uvs + SolidParticleSystem.prototype._uvsToShapeUV = function (uvs) { + var shapeUV = []; + if (uvs) { + for (var i = 0; i < uvs.length; i++) + shapeUV.push(uvs[i]); + } + return shapeUV; + }; + // adds a new particle object in the particles array + SolidParticleSystem.prototype._addParticle = function (idx, idxpos, model, shapeId, idxInShape, bInfo) { + this.particles.push(new BABYLON.SolidParticle(idx, idxpos, model, shapeId, idxInShape, this, bInfo)); + }; + /** + * Adds some particles to the SPS from the model shape. Returns the shape id. + * Please read the doc : http://doc.babylonjs.com/overviews/Solid_Particle_System#create-an-immutable-sps + * `mesh` is any Mesh object that will be used as a model for the solid particles. + * `nb` (positive integer) the number of particles to be created from this model + * `positionFunction` is an optional javascript function to called for each particle on SPS creation. + * `vertexFunction` is an optional javascript function to called for each vertex of each particle on SPS creation + */ + SolidParticleSystem.prototype.addShape = function (mesh, nb, options) { + var meshPos = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind); + var meshInd = mesh.getIndices(); + var meshUV = mesh.getVerticesData(BABYLON.VertexBuffer.UVKind); + var meshCol = mesh.getVerticesData(BABYLON.VertexBuffer.ColorKind); + var meshNor = mesh.getVerticesData(BABYLON.VertexBuffer.NormalKind); + var bbInfo; + if (this._particlesIntersect) { + bbInfo = mesh.getBoundingInfo(); + } + var shape = this._posToShape(meshPos); + var shapeUV = this._uvsToShapeUV(meshUV); + var posfunc = options ? options.positionFunction : null; + var vtxfunc = options ? options.vertexFunction : null; + var modelShape = new BABYLON.ModelShape(this._shapeCounter, shape, shapeUV, posfunc, vtxfunc); + // particles + var idx = this.nbParticles; + for (var i = 0; i < nb; i++) { + this._meshBuilder(this._index, shape, this._positions, meshInd, this._indices, meshUV, this._uvs, meshCol, this._colors, meshNor, this._normals, idx, i, options); + if (this._updatable) { + this._addParticle(idx, this._positions.length, modelShape, this._shapeCounter, i, bbInfo); + } + this._index += shape.length; + idx++; + } + this.nbParticles += nb; + this._shapeCounter++; + return this._shapeCounter - 1; + }; + // rebuilds a particle back to its just built status : if needed, recomputes the custom positions and vertices + SolidParticleSystem.prototype._rebuildParticle = function (particle) { + this._resetCopy(); + if (particle._model._positionFunction) { + particle._model._positionFunction(this._copy, particle.idx, particle.idxInShape); + } + if (this._copy.rotationQuaternion) { + this._quaternion.copyFrom(this._copy.rotationQuaternion); + } + else { + this._yaw = this._copy.rotation.y; + this._pitch = this._copy.rotation.x; + this._roll = this._copy.rotation.z; + this._quaternionRotationYPR(); + } + this._quaternionToRotationMatrix(); + this._shape = particle._model._shape; + for (var pt = 0; pt < this._shape.length; pt++) { + this._vertex.x = this._shape[pt].x; + this._vertex.y = this._shape[pt].y; + this._vertex.z = this._shape[pt].z; + if (particle._model._vertexFunction) { + particle._model._vertexFunction(this._copy, this._vertex, pt); // recall to stored vertexFunction + } + this._vertex.x *= this._copy.scaling.x; + this._vertex.y *= this._copy.scaling.y; + this._vertex.z *= this._copy.scaling.z; + BABYLON.Vector3.TransformCoordinatesToRef(this._vertex, this._rotMatrix, this._rotated); + this._positions32[particle._pos + pt * 3] = this._copy.position.x + this._rotated.x; + this._positions32[particle._pos + pt * 3 + 1] = this._copy.position.y + this._rotated.y; + this._positions32[particle._pos + pt * 3 + 2] = this._copy.position.z + this._rotated.z; + } + particle.position.x = 0.0; + particle.position.y = 0.0; + particle.position.z = 0.0; + particle.rotation.x = 0.0; + particle.rotation.y = 0.0; + particle.rotation.z = 0.0; + particle.rotationQuaternion = null; + particle.scaling.x = 1.0; + particle.scaling.y = 1.0; + particle.scaling.z = 1.0; + }; + /** + * Rebuilds the whole mesh and updates the VBO : custom positions and vertices are recomputed if needed. + */ + SolidParticleSystem.prototype.rebuildMesh = function () { + for (var p = 0; p < this.particles.length; p++) { + this._rebuildParticle(this.particles[p]); + } + this.mesh.updateVerticesData(BABYLON.VertexBuffer.PositionKind, this._positions32, false, false); + }; + /** + * Sets all the particles : this method actually really updates the mesh according to the particle positions, rotations, colors, textures, etc. + * This method calls `updateParticle()` for each particle of the SPS. + * For an animated SPS, it is usually called within the render loop. + * @param start The particle index in the particle array where to start to compute the particle property values _(default 0)_ + * @param end The particle index in the particle array where to stop to compute the particle property values _(default nbParticle - 1)_ + * @param update If the mesh must be finally updated on this call after all the particle computations _(default true)_ + */ + SolidParticleSystem.prototype.setParticles = function (start, end, update) { + if (start === void 0) { start = 0; } + if (end === void 0) { end = this.nbParticles - 1; } + if (update === void 0) { update = true; } + if (!this._updatable) { + return; + } + // custom beforeUpdate + this.beforeUpdateParticles(start, end, update); + this._cam_axisX.x = 1.0; + this._cam_axisX.y = 0.0; + this._cam_axisX.z = 0.0; + this._cam_axisY.x = 0.0; + this._cam_axisY.y = 1.0; + this._cam_axisY.z = 0.0; + this._cam_axisZ.x = 0.0; + this._cam_axisZ.y = 0.0; + this._cam_axisZ.z = 1.0; + // if the particles will always face the camera + if (this.billboard) { + // compute the camera position and un-rotate it by the current mesh rotation + if (this.mesh._worldMatrix.decompose(this._scale, this._quaternion, this._translation)) { + this._quaternionToRotationMatrix(); + this._rotMatrix.invertToRef(this._invertMatrix); + this._camera._currentTarget.subtractToRef(this._camera.globalPosition, this._camDir); + BABYLON.Vector3.TransformCoordinatesToRef(this._camDir, this._invertMatrix, this._cam_axisZ); + this._cam_axisZ.normalize(); + // set two orthogonal vectors (_cam_axisX and and _cam_axisY) to the rotated camDir axis (_cam_axisZ) + BABYLON.Vector3.CrossToRef(this._cam_axisZ, this._axisX, this._cam_axisY); + BABYLON.Vector3.CrossToRef(this._cam_axisY, this._cam_axisZ, this._cam_axisX); + this._cam_axisY.normalize(); + this._cam_axisX.normalize(); + } + } + BABYLON.Matrix.IdentityToRef(this._rotMatrix); + var idx = 0; + var index = 0; + var colidx = 0; + var colorIndex = 0; + var uvidx = 0; + var uvIndex = 0; + var pt = 0; + if (this._computeBoundingBox) { + BABYLON.Vector3.FromFloatsToRef(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, this._minimum); + BABYLON.Vector3.FromFloatsToRef(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, this._maximum); + } + // particle loop + end = (end > this.nbParticles - 1) ? this.nbParticles - 1 : end; + for (var p = start; p <= end; p++) { + this._particle = this.particles[p]; + this._shape = this._particle._model._shape; + this._shapeUV = this._particle._model._shapeUV; + // call to custom user function to update the particle properties + this.updateParticle(this._particle); + if (this._particle.isVisible) { + // particle rotation matrix + if (this.billboard) { + this._particle.rotation.x = 0.0; + this._particle.rotation.y = 0.0; + } + if (this._computeParticleRotation || this.billboard) { + if (this._particle.rotationQuaternion) { + this._quaternion.copyFrom(this._particle.rotationQuaternion); + } + else { + this._yaw = this._particle.rotation.y; + this._pitch = this._particle.rotation.x; + this._roll = this._particle.rotation.z; + this._quaternionRotationYPR(); + } + this._quaternionToRotationMatrix(); + } + // particle vertex loop + for (pt = 0; pt < this._shape.length; pt++) { + idx = index + pt * 3; + colidx = colorIndex + pt * 4; + uvidx = uvIndex + pt * 2; + this._vertex.x = this._shape[pt].x; + this._vertex.y = this._shape[pt].y; + this._vertex.z = this._shape[pt].z; + if (this._computeParticleVertex) { + this.updateParticleVertex(this._particle, this._vertex, pt); + } + // positions + this._vertex.x *= this._particle.scaling.x; + this._vertex.y *= this._particle.scaling.y; + this._vertex.z *= this._particle.scaling.z; + this._w = (this._vertex.x * this._rotMatrix.m[3]) + (this._vertex.y * this._rotMatrix.m[7]) + (this._vertex.z * this._rotMatrix.m[11]) + this._rotMatrix.m[15]; + this._rotated.x = ((this._vertex.x * this._rotMatrix.m[0]) + (this._vertex.y * this._rotMatrix.m[4]) + (this._vertex.z * this._rotMatrix.m[8]) + this._rotMatrix.m[12]) / this._w; + this._rotated.y = ((this._vertex.x * this._rotMatrix.m[1]) + (this._vertex.y * this._rotMatrix.m[5]) + (this._vertex.z * this._rotMatrix.m[9]) + this._rotMatrix.m[13]) / this._w; + this._rotated.z = ((this._vertex.x * this._rotMatrix.m[2]) + (this._vertex.y * this._rotMatrix.m[6]) + (this._vertex.z * this._rotMatrix.m[10]) + this._rotMatrix.m[14]) / this._w; + this._positions32[idx] = this._particle.position.x + this._cam_axisX.x * this._rotated.x + this._cam_axisY.x * this._rotated.y + this._cam_axisZ.x * this._rotated.z; + this._positions32[idx + 1] = this._particle.position.y + this._cam_axisX.y * this._rotated.x + this._cam_axisY.y * this._rotated.y + this._cam_axisZ.y * this._rotated.z; + this._positions32[idx + 2] = this._particle.position.z + this._cam_axisX.z * this._rotated.x + this._cam_axisY.z * this._rotated.y + this._cam_axisZ.z * this._rotated.z; + if (this._computeBoundingBox) { + if (this._positions32[idx] < this._minimum.x) { + this._minimum.x = this._positions32[idx]; + } + if (this._positions32[idx] > this._maximum.x) { + this._maximum.x = this._positions32[idx]; + } + if (this._positions32[idx + 1] < this._minimum.y) { + this._minimum.y = this._positions32[idx + 1]; + } + if (this._positions32[idx + 1] > this._maximum.y) { + this._maximum.y = this._positions32[idx + 1]; + } + if (this._positions32[idx + 2] < this._minimum.z) { + this._minimum.z = this._positions32[idx + 2]; + } + if (this._positions32[idx + 2] > this._maximum.z) { + this._maximum.z = this._positions32[idx + 2]; + } + } + // normals : if the particles can't be morphed then just rotate the normals, what if much more faster than ComputeNormals() + if (!this._computeParticleVertex) { + this._normal.x = this._fixedNormal32[idx]; + this._normal.y = this._fixedNormal32[idx + 1]; + this._normal.z = this._fixedNormal32[idx + 2]; + this._w = (this._normal.x * this._rotMatrix.m[3]) + (this._normal.y * this._rotMatrix.m[7]) + (this._normal.z * this._rotMatrix.m[11]) + this._rotMatrix.m[15]; + this._rotated.x = ((this._normal.x * this._rotMatrix.m[0]) + (this._normal.y * this._rotMatrix.m[4]) + (this._normal.z * this._rotMatrix.m[8]) + this._rotMatrix.m[12]) / this._w; + this._rotated.y = ((this._normal.x * this._rotMatrix.m[1]) + (this._normal.y * this._rotMatrix.m[5]) + (this._normal.z * this._rotMatrix.m[9]) + this._rotMatrix.m[13]) / this._w; + this._rotated.z = ((this._normal.x * this._rotMatrix.m[2]) + (this._normal.y * this._rotMatrix.m[6]) + (this._normal.z * this._rotMatrix.m[10]) + this._rotMatrix.m[14]) / this._w; + this._normals32[idx] = this._cam_axisX.x * this._rotated.x + this._cam_axisY.x * this._rotated.y + this._cam_axisZ.x * this._rotated.z; + this._normals32[idx + 1] = this._cam_axisX.y * this._rotated.x + this._cam_axisY.y * this._rotated.y + this._cam_axisZ.y * this._rotated.z; + this._normals32[idx + 2] = this._cam_axisX.z * this._rotated.x + this._cam_axisY.z * this._rotated.y + this._cam_axisZ.z * this._rotated.z; + } + if (this._computeParticleColor) { + this._colors32[colidx] = this._particle.color.r; + this._colors32[colidx + 1] = this._particle.color.g; + this._colors32[colidx + 2] = this._particle.color.b; + this._colors32[colidx + 3] = this._particle.color.a; + } + if (this._computeParticleTexture) { + this._uvs32[uvidx] = this._shapeUV[pt * 2] * (this._particle.uvs.z - this._particle.uvs.x) + this._particle.uvs.x; + this._uvs32[uvidx + 1] = this._shapeUV[pt * 2 + 1] * (this._particle.uvs.w - this._particle.uvs.y) + this._particle.uvs.y; + } + } + } + else { + for (pt = 0; pt < this._shape.length; pt++) { + idx = index + pt * 3; + colidx = colorIndex + pt * 4; + uvidx = uvIndex + pt * 2; + this._positions32[idx] = this._camera.position.x; + this._positions32[idx + 1] = this._camera.position.y; + this._positions32[idx + 2] = this._camera.position.z; + this._normals32[idx] = 0.0; + this._normals32[idx + 1] = 0.0; + this._normals32[idx + 2] = 0.0; + if (this._computeParticleColor) { + this._colors32[colidx] = this._particle.color.r; + this._colors32[colidx + 1] = this._particle.color.g; + this._colors32[colidx + 2] = this._particle.color.b; + this._colors32[colidx + 3] = this._particle.color.a; + } + if (this._computeParticleTexture) { + this._uvs32[uvidx] = this._shapeUV[pt * 2] * (this._particle.uvs.z - this._particle.uvs.x) + this._particle.uvs.x; + this._uvs32[uvidx + 1] = this._shapeUV[pt * 2 + 1] * (this._particle.uvs.w - this._particle.uvs.y) + this._particle.uvs.y; + } + } + } + // if the particle intersections must be computed : update the bbInfo + if (this._particlesIntersect) { + var bInfo = this._particle._boundingInfo; + var bBox = bInfo.boundingBox; + var bSphere = bInfo.boundingSphere; + if (!this._bSphereOnly) { + // place, scale and rotate the particle bbox within the SPS local system, then update it + for (var b = 0; b < bBox.vectors.length; b++) { + this._vertex.x = this._particle._modelBoundingInfo.boundingBox.vectors[b].x * this._particle.scaling.x; + this._vertex.y = this._particle._modelBoundingInfo.boundingBox.vectors[b].y * this._particle.scaling.y; + this._vertex.z = this._particle._modelBoundingInfo.boundingBox.vectors[b].z * this._particle.scaling.z; + this._w = (this._vertex.x * this._rotMatrix.m[3]) + (this._vertex.y * this._rotMatrix.m[7]) + (this._vertex.z * this._rotMatrix.m[11]) + this._rotMatrix.m[15]; + this._rotated.x = ((this._vertex.x * this._rotMatrix.m[0]) + (this._vertex.y * this._rotMatrix.m[4]) + (this._vertex.z * this._rotMatrix.m[8]) + this._rotMatrix.m[12]) / this._w; + this._rotated.y = ((this._vertex.x * this._rotMatrix.m[1]) + (this._vertex.y * this._rotMatrix.m[5]) + (this._vertex.z * this._rotMatrix.m[9]) + this._rotMatrix.m[13]) / this._w; + this._rotated.z = ((this._vertex.x * this._rotMatrix.m[2]) + (this._vertex.y * this._rotMatrix.m[6]) + (this._vertex.z * this._rotMatrix.m[10]) + this._rotMatrix.m[14]) / this._w; + bBox.vectors[b].x = this._particle.position.x + this._cam_axisX.x * this._rotated.x + this._cam_axisY.x * this._rotated.y + this._cam_axisZ.x * this._rotated.z; + bBox.vectors[b].y = this._particle.position.y + this._cam_axisX.y * this._rotated.x + this._cam_axisY.y * this._rotated.y + this._cam_axisZ.y * this._rotated.z; + bBox.vectors[b].z = this._particle.position.z + this._cam_axisX.z * this._rotated.x + this._cam_axisY.z * this._rotated.y + this._cam_axisZ.z * this._rotated.z; + } + bBox._update(this.mesh._worldMatrix); + } + // place and scale the particle bouding sphere in the SPS local system, then update it + this._minBbox.x = this._particle._modelBoundingInfo.minimum.x * this._particle.scaling.x; + this._minBbox.y = this._particle._modelBoundingInfo.minimum.y * this._particle.scaling.y; + this._minBbox.z = this._particle._modelBoundingInfo.minimum.z * this._particle.scaling.z; + this._maxBbox.x = this._particle._modelBoundingInfo.maximum.x * this._particle.scaling.x; + this._maxBbox.y = this._particle._modelBoundingInfo.maximum.y * this._particle.scaling.y; + this._maxBbox.z = this._particle._modelBoundingInfo.maximum.z * this._particle.scaling.z; + bSphere.center.x = this._particle.position.x + (this._minBbox.x + this._maxBbox.x) * 0.5; + bSphere.center.y = this._particle.position.y + (this._minBbox.y + this._maxBbox.y) * 0.5; + bSphere.center.z = this._particle.position.z + (this._minBbox.z + this._maxBbox.z) * 0.5; + bSphere.radius = this._bSphereRadiusFactor * 0.5 * Math.sqrt((this._maxBbox.x - this._minBbox.x) * (this._maxBbox.x - this._minBbox.x) + (this._maxBbox.y - this._minBbox.y) * (this._maxBbox.y - this._minBbox.y) + (this._maxBbox.z - this._minBbox.z) * (this._maxBbox.z - this._minBbox.z)); + bSphere._update(this.mesh._worldMatrix); + } + // increment indexes for the next particle + index = idx + 3; + colorIndex = colidx + 4; + uvIndex = uvidx + 2; + } + // if the VBO must be updated + if (update) { + if (this._computeParticleColor) { + this.mesh.updateVerticesData(BABYLON.VertexBuffer.ColorKind, this._colors32, false, false); + } + if (this._computeParticleTexture) { + this.mesh.updateVerticesData(BABYLON.VertexBuffer.UVKind, this._uvs32, false, false); + } + this.mesh.updateVerticesData(BABYLON.VertexBuffer.PositionKind, this._positions32, false, false); + if (!this.mesh.areNormalsFrozen) { + if (this._computeParticleVertex) { + // recompute the normals only if the particles can be morphed, update then also the normal reference array _fixedNormal32[] + BABYLON.VertexData.ComputeNormals(this._positions32, this._indices, this._normals32); + for (var i = 0; i < this._normals32.length; i++) { + this._fixedNormal32[i] = this._normals32[i]; + } + } + this.mesh.updateVerticesData(BABYLON.VertexBuffer.NormalKind, this._normals32, false, false); + } + } + if (this._computeBoundingBox) { + this.mesh._boundingInfo = new BABYLON.BoundingInfo(this._minimum, this._maximum); + this.mesh._boundingInfo.update(this.mesh._worldMatrix); + } + this.afterUpdateParticles(start, end, update); + }; + SolidParticleSystem.prototype._quaternionRotationYPR = function () { + this._halfroll = this._roll * 0.5; + this._halfpitch = this._pitch * 0.5; + this._halfyaw = this._yaw * 0.5; + this._sinRoll = Math.sin(this._halfroll); + this._cosRoll = Math.cos(this._halfroll); + this._sinPitch = Math.sin(this._halfpitch); + this._cosPitch = Math.cos(this._halfpitch); + this._sinYaw = Math.sin(this._halfyaw); + this._cosYaw = Math.cos(this._halfyaw); + this._quaternion.x = (this._cosYaw * this._sinPitch * this._cosRoll) + (this._sinYaw * this._cosPitch * this._sinRoll); + this._quaternion.y = (this._sinYaw * this._cosPitch * this._cosRoll) - (this._cosYaw * this._sinPitch * this._sinRoll); + this._quaternion.z = (this._cosYaw * this._cosPitch * this._sinRoll) - (this._sinYaw * this._sinPitch * this._cosRoll); + this._quaternion.w = (this._cosYaw * this._cosPitch * this._cosRoll) + (this._sinYaw * this._sinPitch * this._sinRoll); + }; + SolidParticleSystem.prototype._quaternionToRotationMatrix = function () { + this._rotMatrix.m[0] = 1.0 - (2.0 * (this._quaternion.y * this._quaternion.y + this._quaternion.z * this._quaternion.z)); + this._rotMatrix.m[1] = 2.0 * (this._quaternion.x * this._quaternion.y + this._quaternion.z * this._quaternion.w); + this._rotMatrix.m[2] = 2.0 * (this._quaternion.z * this._quaternion.x - this._quaternion.y * this._quaternion.w); + this._rotMatrix.m[3] = 0; + this._rotMatrix.m[4] = 2.0 * (this._quaternion.x * this._quaternion.y - this._quaternion.z * this._quaternion.w); + this._rotMatrix.m[5] = 1.0 - (2.0 * (this._quaternion.z * this._quaternion.z + this._quaternion.x * this._quaternion.x)); + this._rotMatrix.m[6] = 2.0 * (this._quaternion.y * this._quaternion.z + this._quaternion.x * this._quaternion.w); + this._rotMatrix.m[7] = 0; + this._rotMatrix.m[8] = 2.0 * (this._quaternion.z * this._quaternion.x + this._quaternion.y * this._quaternion.w); + this._rotMatrix.m[9] = 2.0 * (this._quaternion.y * this._quaternion.z - this._quaternion.x * this._quaternion.w); + this._rotMatrix.m[10] = 1.0 - (2.0 * (this._quaternion.y * this._quaternion.y + this._quaternion.x * this._quaternion.x)); + this._rotMatrix.m[11] = 0; + this._rotMatrix.m[12] = 0; + this._rotMatrix.m[13] = 0; + this._rotMatrix.m[14] = 0; + this._rotMatrix.m[15] = 1.0; + }; + /** + * Disposes the SPS + */ + SolidParticleSystem.prototype.dispose = function () { + this.mesh.dispose(); + this.vars = null; + // drop references to internal big arrays for the GC + this._positions = null; + this._indices = null; + this._normals = null; + this._uvs = null; + this._colors = null; + this._positions32 = null; + this._normals32 = null; + this._fixedNormal32 = null; + this._uvs32 = null; + this._colors32 = null; + this.pickedParticles = null; + }; + /** + * Visibilty helper : Recomputes the visible size according to the mesh bounding box + * doc : http://doc.babylonjs.com/overviews/Solid_Particle_System#sps-visibility + */ + SolidParticleSystem.prototype.refreshVisibleSize = function () { + if (!this._isVisibilityBoxLocked) { + this.mesh.refreshBoundingInfo(); + } + }; + /** + * Visibility helper : Sets the size of a visibility box, this sets the underlying mesh bounding box. + * @param size the size (float) of the visibility box + * note : this doesn't lock the SPS mesh bounding box. + * doc : http://doc.babylonjs.com/overviews/Solid_Particle_System#sps-visibility + */ + SolidParticleSystem.prototype.setVisibilityBox = function (size) { + var vis = size / 2; + this.mesh._boundingInfo = new BABYLON.BoundingInfo(new BABYLON.Vector3(-vis, -vis, -vis), new BABYLON.Vector3(vis, vis, vis)); + }; + Object.defineProperty(SolidParticleSystem.prototype, "isAlwaysVisible", { + // getter and setter + get: function () { + return this._alwaysVisible; + }, + /** + * Sets the SPS as always visible or not + * doc : http://doc.babylonjs.com/overviews/Solid_Particle_System#sps-visibility + */ + set: function (val) { + this._alwaysVisible = val; + this.mesh.alwaysSelectAsActiveMesh = val; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SolidParticleSystem.prototype, "isVisibilityBoxLocked", { + get: function () { + return this._isVisibilityBoxLocked; + }, + /** + * Sets the SPS visibility box as locked or not. This enables/disables the underlying mesh bounding box updates. + * doc : http://doc.babylonjs.com/overviews/Solid_Particle_System#sps-visibility + */ + set: function (val) { + this._isVisibilityBoxLocked = val; + this.mesh.getBoundingInfo().isLocked = val; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SolidParticleSystem.prototype, "computeParticleRotation", { + // getters + get: function () { + return this._computeParticleRotation; + }, + // Optimizer setters + /** + * Tells to `setParticles()` to compute the particle rotations or not. + * Default value : true. The SPS is faster when it's set to false. + * Note : the particle rotations aren't stored values, so setting `computeParticleRotation` to false will prevents the particle to rotate. + */ + set: function (val) { + this._computeParticleRotation = val; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SolidParticleSystem.prototype, "computeParticleColor", { + get: function () { + return this._computeParticleColor; + }, + /** + * Tells to `setParticles()` to compute the particle colors or not. + * Default value : true. The SPS is faster when it's set to false. + * Note : the particle colors are stored values, so setting `computeParticleColor` to false will keep yet the last colors set. + */ + set: function (val) { + this._computeParticleColor = val; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SolidParticleSystem.prototype, "computeParticleTexture", { + get: function () { + return this._computeParticleTexture; + }, + /** + * Tells to `setParticles()` to compute the particle textures or not. + * Default value : true. The SPS is faster when it's set to false. + * Note : the particle textures are stored values, so setting `computeParticleTexture` to false will keep yet the last colors set. + */ + set: function (val) { + this._computeParticleTexture = val; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SolidParticleSystem.prototype, "computeParticleVertex", { + get: function () { + return this._computeParticleVertex; + }, + /** + * Tells to `setParticles()` to call the vertex function for each vertex of each particle, or not. + * Default value : false. The SPS is faster when it's set to false. + * Note : the particle custom vertex positions aren't stored values. + */ + set: function (val) { + this._computeParticleVertex = val; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SolidParticleSystem.prototype, "computeBoundingBox", { + get: function () { + return this._computeBoundingBox; + }, + /** + * Tells to `setParticles()` to compute or not the mesh bounding box when computing the particle positions. + */ + set: function (val) { + this._computeBoundingBox = val; + }, + enumerable: true, + configurable: true + }); + // ======================================================================= + // Particle behavior logic + // these following methods may be overwritten by the user to fit his needs + /** + * This function does nothing. It may be overwritten to set all the particle first values. + * The SPS doesn't call this function, you may have to call it by your own. + * doc : http://doc.babylonjs.com/overviews/Solid_Particle_System#particle-management + */ + SolidParticleSystem.prototype.initParticles = function () { + }; + /** + * This function does nothing. It may be overwritten to recycle a particle. + * The SPS doesn't call this function, you may have to call it by your own. + * doc : http://doc.babylonjs.com/overviews/Solid_Particle_System#particle-management + */ + SolidParticleSystem.prototype.recycleParticle = function (particle) { + return particle; + }; + /** + * Updates a particle : this function should be overwritten by the user. + * It is called on each particle by `setParticles()`. This is the place to code each particle behavior. + * doc : http://doc.babylonjs.com/overviews/Solid_Particle_System#particle-management + * ex : just set a particle position or velocity and recycle conditions + */ + SolidParticleSystem.prototype.updateParticle = function (particle) { + return particle; + }; + /** + * Updates a vertex of a particle : it can be overwritten by the user. + * This will be called on each vertex particle by `setParticles()` if `computeParticleVertex` is set to true only. + * @param particle the current particle + * @param vertex the current index of the current particle + * @param pt the index of the current vertex in the particle shape + * doc : http://doc.babylonjs.com/overviews/Solid_Particle_System#update-each-particle-shape + * ex : just set a vertex particle position + */ + SolidParticleSystem.prototype.updateParticleVertex = function (particle, vertex, pt) { + return vertex; + }; + /** + * This will be called before any other treatment by `setParticles()` and will be passed three parameters. + * This does nothing and may be overwritten by the user. + * @param start the particle index in the particle array where to stop to iterate, same than the value passed to setParticle() + * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle() + * @param update the boolean update value actually passed to setParticles() + */ + SolidParticleSystem.prototype.beforeUpdateParticles = function (start, stop, update) { + }; + /** + * This will be called by `setParticles()` after all the other treatments and just before the actual mesh update. + * This will be passed three parameters. + * This does nothing and may be overwritten by the user. + * @param start the particle index in the particle array where to stop to iterate, same than the value passed to setParticle() + * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle() + * @param update the boolean update value actually passed to setParticles() + */ + SolidParticleSystem.prototype.afterUpdateParticles = function (start, stop, update) { + }; + return SolidParticleSystem; + }()); + BABYLON.SolidParticleSystem = SolidParticleSystem; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.solidParticleSystem.js.map + +var BABYLON; +(function (BABYLON) { + var Internals; + (function (Internals) { + var FileFaceOrientation = (function () { + function FileFaceOrientation(name, worldAxisForNormal, worldAxisForFileX, worldAxisForFileY) { + this.name = name; + this.worldAxisForNormal = worldAxisForNormal; + this.worldAxisForFileX = worldAxisForFileX; + this.worldAxisForFileY = worldAxisForFileY; + } + return FileFaceOrientation; + }()); + ; + /** + * Helper class dealing with the extraction of spherical polynomial dataArray + * from a cube map. + */ + var CubeMapToSphericalPolynomialTools = (function () { + function CubeMapToSphericalPolynomialTools() { + } + /** + * Converts a cubemap to the according Spherical Polynomial data. + * This extracts the first 3 orders only as they are the only one used in the lighting. + * + * @param cubeInfo The Cube map to extract the information from. + * @return The Spherical Polynomial data. + */ + CubeMapToSphericalPolynomialTools.ConvertCubeMapToSphericalPolynomial = function (cubeInfo) { + var sphericalHarmonics = new BABYLON.SphericalHarmonics(); + var totalSolidAngle = 0.0; + // The (u,v) range is [-1,+1], so the distance between each texel is 2/Size. + var du = 2.0 / cubeInfo.size; + var dv = du; + // The (u,v) of the first texel is half a texel from the corner (-1,-1). + var minUV = du * 0.5 - 1.0; + for (var faceIndex = 0; faceIndex < 6; faceIndex++) { + var fileFace = this.FileFaces[faceIndex]; + var dataArray = cubeInfo[fileFace.name]; + var v = minUV; + // TODO: we could perform the summation directly into a SphericalPolynomial (SP), which is more efficient than SphericalHarmonic (SH). + // This is possible because during the summation we do not need the SH-specific properties, e.g. orthogonality. + // Because SP is still linear, so summation is fine in that basis. + for (var y = 0; y < cubeInfo.size; y++) { + var u = minUV; + for (var x = 0; x < cubeInfo.size; x++) { + // World direction (not normalised) + var worldDirection = fileFace.worldAxisForFileX.scale(u).add(fileFace.worldAxisForFileY.scale(v)).add(fileFace.worldAxisForNormal); + worldDirection.normalize(); + var deltaSolidAngle = Math.pow(1.0 + u * u + v * v, -3.0 / 2.0); + if (1) { + var r = dataArray[(y * cubeInfo.size * 3) + (x * 3) + 0]; + var g = dataArray[(y * cubeInfo.size * 3) + (x * 3) + 1]; + var b = dataArray[(y * cubeInfo.size * 3) + (x * 3) + 2]; + var color = new BABYLON.Color3(r, g, b); + sphericalHarmonics.addLight(worldDirection, color, deltaSolidAngle); + } + else { + if (faceIndex == 0) { + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 0] = 1; + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 1] = 0; + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 2] = 0; + } + else if (faceIndex == 1) { + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 0] = 0; + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 1] = 1; + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 2] = 0; + } + else if (faceIndex == 2) { + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 0] = 0; + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 1] = 0; + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 2] = 1; + } + else if (faceIndex == 3) { + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 0] = 1; + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 1] = 1; + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 2] = 0; + } + else if (faceIndex == 4) { + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 0] = 1; + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 1] = 0; + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 2] = 1; + } + else if (faceIndex == 5) { + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 0] = 0; + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 1] = 1; + dataArray[(y * cubeInfo.size * 3) + (x * 3) + 2] = 1; + } + var color = new BABYLON.Color3(dataArray[(y * cubeInfo.size * 3) + (x * 3) + 0], dataArray[(y * cubeInfo.size * 3) + (x * 3) + 1], dataArray[(y * cubeInfo.size * 3) + (x * 3) + 2]); + sphericalHarmonics.addLight(worldDirection, color, deltaSolidAngle); + } + totalSolidAngle += deltaSolidAngle; + u += du; + } + v += dv; + } + } + var correctSolidAngle = 4.0 * Math.PI; // Solid angle for entire sphere is 4*pi + var correction = correctSolidAngle / totalSolidAngle; + sphericalHarmonics.scale(correction); + // Additionally scale by pi -- audit needed + sphericalHarmonics.scale(1.0 / Math.PI); + return BABYLON.SphericalPolynomial.getSphericalPolynomialFromHarmonics(sphericalHarmonics); + }; + CubeMapToSphericalPolynomialTools.FileFaces = [ + new FileFaceOrientation("right", new BABYLON.Vector3(1, 0, 0), new BABYLON.Vector3(0, 0, -1), new BABYLON.Vector3(0, -1, 0)), + new FileFaceOrientation("left", new BABYLON.Vector3(-1, 0, 0), new BABYLON.Vector3(0, 0, 1), new BABYLON.Vector3(0, -1, 0)), + new FileFaceOrientation("up", new BABYLON.Vector3(0, 1, 0), new BABYLON.Vector3(1, 0, 0), new BABYLON.Vector3(0, 0, 1)), + new FileFaceOrientation("down", new BABYLON.Vector3(0, -1, 0), new BABYLON.Vector3(1, 0, 0), new BABYLON.Vector3(0, 0, -1)), + new FileFaceOrientation("front", new BABYLON.Vector3(0, 0, 1), new BABYLON.Vector3(1, 0, 0), new BABYLON.Vector3(0, -1, 0)), + new FileFaceOrientation("back", new BABYLON.Vector3(0, 0, -1), new BABYLON.Vector3(-1, 0, 0), new BABYLON.Vector3(0, -1, 0)) // -Z bottom + ]; + return CubeMapToSphericalPolynomialTools; + }()); + Internals.CubeMapToSphericalPolynomialTools = CubeMapToSphericalPolynomialTools; + })(Internals = BABYLON.Internals || (BABYLON.Internals = {})); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.tools.cubemapToSphericalPolynomial.js.map + +var BABYLON; +(function (BABYLON) { + var Internals; + (function (Internals) { + /** + * Helper class usefull to convert panorama picture to their cubemap representation in 6 faces. + */ + var PanoramaToCubeMapTools = (function () { + function PanoramaToCubeMapTools() { + } + /** + * Converts a panorma stored in RGB right to left up to down format into a cubemap (6 faces). + * + * @param float32Array The source data. + * @param inputWidth The width of the input panorama. + * @param inputhHeight The height of the input panorama. + * @param size The willing size of the generated cubemap (each faces will be size * size pixels) + * @return The cubemap data + */ + PanoramaToCubeMapTools.ConvertPanoramaToCubemap = function (float32Array, inputWidth, inputHeight, size) { + if (!float32Array) { + throw "ConvertPanoramaToCubemap: input cannot be null"; + } + if (float32Array.length != inputWidth * inputHeight * 3) { + throw "ConvertPanoramaToCubemap: input size is wrong"; + } + var textureFront = this.CreateCubemapTexture(size, this.FACE_FRONT, float32Array, inputWidth, inputHeight); + var textureBack = this.CreateCubemapTexture(size, this.FACE_BACK, float32Array, inputWidth, inputHeight); + var textureLeft = this.CreateCubemapTexture(size, this.FACE_LEFT, float32Array, inputWidth, inputHeight); + var textureRight = this.CreateCubemapTexture(size, this.FACE_RIGHT, float32Array, inputWidth, inputHeight); + var textureUp = this.CreateCubemapTexture(size, this.FACE_UP, float32Array, inputWidth, inputHeight); + var textureDown = this.CreateCubemapTexture(size, this.FACE_DOWN, float32Array, inputWidth, inputHeight); + return { + front: textureFront, + back: textureBack, + left: textureLeft, + right: textureRight, + up: textureUp, + down: textureDown, + size: size + }; + }; + PanoramaToCubeMapTools.CreateCubemapTexture = function (texSize, faceData, float32Array, inputWidth, inputHeight) { + var buffer = new ArrayBuffer(texSize * texSize * 4 * 3); + var textureArray = new Float32Array(buffer); + var rotDX1 = faceData[1].subtract(faceData[0]).scale(1 / texSize); + var rotDX2 = faceData[3].subtract(faceData[2]).scale(1 / texSize); + var dy = 1 / texSize; + var fy = 0; + for (var y = 0; y < texSize; y++) { + var xv1 = faceData[0]; + var xv2 = faceData[2]; + for (var x = 0; x < texSize; x++) { + var v = xv2.subtract(xv1).scale(fy).add(xv1); + v.normalize(); + var color = this.CalcProjectionSpherical(v, float32Array, inputWidth, inputHeight); + // 3 channels per pixels + textureArray[y * texSize * 3 + (x * 3) + 0] = color.r; + textureArray[y * texSize * 3 + (x * 3) + 1] = color.g; + textureArray[y * texSize * 3 + (x * 3) + 2] = color.b; + xv1 = xv1.add(rotDX1); + xv2 = xv2.add(rotDX2); + } + fy += dy; + } + return textureArray; + }; + PanoramaToCubeMapTools.CalcProjectionSpherical = function (vDir, float32Array, inputWidth, inputHeight) { + var theta = Math.atan2(vDir.z, vDir.x); + var phi = Math.acos(vDir.y); + while (theta < -Math.PI) + theta += 2 * Math.PI; + while (theta > Math.PI) + theta -= 2 * Math.PI; + var dx = theta / Math.PI; + var dy = phi / Math.PI; + // recenter. + dx = dx * 0.5 + 0.5; + var px = Math.round(dx * inputWidth); + if (px < 0) + px = 0; + else if (px >= inputWidth) + px = inputWidth - 1; + var py = Math.round(dy * inputHeight); + if (py < 0) + py = 0; + else if (py >= inputHeight) + py = inputHeight - 1; + var inputY = (inputHeight - py - 1); + var r = float32Array[inputY * inputWidth * 3 + (px * 3) + 0]; + var g = float32Array[inputY * inputWidth * 3 + (px * 3) + 1]; + var b = float32Array[inputY * inputWidth * 3 + (px * 3) + 2]; + return { + r: r, + g: g, + b: b + }; + }; + PanoramaToCubeMapTools.FACE_FRONT = [ + new BABYLON.Vector3(-1.0, -1.0, -1.0), + new BABYLON.Vector3(1.0, -1.0, -1.0), + new BABYLON.Vector3(-1.0, 1.0, -1.0), + new BABYLON.Vector3(1.0, 1.0, -1.0) + ]; + PanoramaToCubeMapTools.FACE_BACK = [ + new BABYLON.Vector3(1.0, -1.0, 1.0), + new BABYLON.Vector3(-1.0, -1.0, 1.0), + new BABYLON.Vector3(1.0, 1.0, 1.0), + new BABYLON.Vector3(-1.0, 1.0, 1.0) + ]; + PanoramaToCubeMapTools.FACE_RIGHT = [ + new BABYLON.Vector3(1.0, -1.0, -1.0), + new BABYLON.Vector3(1.0, -1.0, 1.0), + new BABYLON.Vector3(1.0, 1.0, -1.0), + new BABYLON.Vector3(1.0, 1.0, 1.0) + ]; + PanoramaToCubeMapTools.FACE_LEFT = [ + new BABYLON.Vector3(-1.0, -1.0, 1.0), + new BABYLON.Vector3(-1.0, -1.0, -1.0), + new BABYLON.Vector3(-1.0, 1.0, 1.0), + new BABYLON.Vector3(-1.0, 1.0, -1.0) + ]; + PanoramaToCubeMapTools.FACE_DOWN = [ + new BABYLON.Vector3(-1.0, 1.0, -1.0), + new BABYLON.Vector3(1.0, 1.0, -1.0), + new BABYLON.Vector3(-1.0, 1.0, 1.0), + new BABYLON.Vector3(1.0, 1.0, 1.0) + ]; + PanoramaToCubeMapTools.FACE_UP = [ + new BABYLON.Vector3(-1.0, -1.0, 1.0), + new BABYLON.Vector3(1.0, -1.0, 1.0), + new BABYLON.Vector3(-1.0, -1.0, -1.0), + new BABYLON.Vector3(1.0, -1.0, -1.0) + ]; + return PanoramaToCubeMapTools; + }()); + Internals.PanoramaToCubeMapTools = PanoramaToCubeMapTools; + })(Internals = BABYLON.Internals || (BABYLON.Internals = {})); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.tools.panoramaToCubemap.js.map + +var BABYLON; +(function (BABYLON) { + var Internals; + (function (Internals) { + ; + /** + * This groups tools to convert HDR texture to native colors array. + */ + var HDRTools = (function () { + function HDRTools() { + } + HDRTools.Ldexp = function (mantissa, exponent) { + if (exponent > 1023) { + return mantissa * Math.pow(2, 1023) * Math.pow(2, exponent - 1023); + } + if (exponent < -1074) { + return mantissa * Math.pow(2, -1074) * Math.pow(2, exponent + 1074); + } + return mantissa * Math.pow(2, exponent); + }; + HDRTools.Rgbe2float = function (float32array, red, green, blue, exponent, index) { + if (exponent > 0) { + exponent = this.Ldexp(1.0, exponent - (128 + 8)); + float32array[index + 0] = red * exponent; + float32array[index + 1] = green * exponent; + float32array[index + 2] = blue * exponent; + } + else { + float32array[index + 0] = 0; + float32array[index + 1] = 0; + float32array[index + 2] = 0; + } + }; + HDRTools.readStringLine = function (uint8array, startIndex) { + var line = ""; + var character = ""; + for (var i = startIndex; i < uint8array.length - startIndex; i++) { + character = String.fromCharCode(uint8array[i]); + if (character == "\n") { + break; + } + line += character; + } + return line; + }; + /** + * Reads header information from an RGBE texture stored in a native array. + * More information on this format are available here: + * https://en.wikipedia.org/wiki/RGBE_image_format + * + * @param uint8array The binary file stored in native array. + * @return The header information. + */ + HDRTools.RGBE_ReadHeader = function (uint8array) { + var height = 0; + var width = 0; + var line = this.readStringLine(uint8array, 0); + if (line[0] != '#' || line[1] != '?') { + throw "Bad HDR Format."; + } + var endOfHeader = false; + var findFormat = false; + var lineIndex = 0; + do { + lineIndex += (line.length + 1); + line = this.readStringLine(uint8array, lineIndex); + if (line == "FORMAT=32-bit_rle_rgbe") { + findFormat = true; + } + else if (line.length == 0) { + endOfHeader = true; + } + } while (!endOfHeader); + if (!findFormat) { + throw "HDR Bad header format, unsupported FORMAT"; + } + lineIndex += (line.length + 1); + line = this.readStringLine(uint8array, lineIndex); + var sizeRegexp = /^\-Y (.*) \+X (.*)$/g; + var match = sizeRegexp.exec(line); + // TODO. Support +Y and -X if needed. + if (match.length < 3) { + throw "HDR Bad header format, no size"; + } + width = parseInt(match[2]); + height = parseInt(match[1]); + if (width < 8 || width > 0x7fff) { + throw "HDR Bad header format, unsupported size"; + } + lineIndex += (line.length + 1); + return { + height: height, + width: width, + dataPosition: lineIndex + }; + }; + /** + * Returns the cubemap information (each faces texture data) extracted from an RGBE texture. + * This RGBE texture needs to store the information as a panorama. + * + * More information on this format are available here: + * https://en.wikipedia.org/wiki/RGBE_image_format + * + * @param buffer The binary file stored in an array buffer. + * @param size The expected size of the extracted cubemap. + * @return The Cube Map information. + */ + HDRTools.GetCubeMapTextureData = function (buffer, size) { + var uint8array = new Uint8Array(buffer); + var hdrInfo = this.RGBE_ReadHeader(uint8array); + var data = this.RGBE_ReadPixels_RLE(uint8array, hdrInfo); + var cubeMapData = Internals.PanoramaToCubeMapTools.ConvertPanoramaToCubemap(data, hdrInfo.width, hdrInfo.height, size); + return cubeMapData; + }; + /** + * Returns the pixels data extracted from an RGBE texture. + * This pixels will be stored left to right up to down in the R G B order in one array. + * + * More information on this format are available here: + * https://en.wikipedia.org/wiki/RGBE_image_format + * + * @param uint8array The binary file stored in an array buffer. + * @param hdrInfo The header information of the file. + * @return The pixels data in RGB right to left up to down order. + */ + HDRTools.RGBE_ReadPixels = function (uint8array, hdrInfo) { + // Keep for multi format supports. + return this.RGBE_ReadPixels_RLE(uint8array, hdrInfo); + }; + HDRTools.RGBE_ReadPixels_RLE = function (uint8array, hdrInfo) { + var num_scanlines = hdrInfo.height; + var scanline_width = hdrInfo.width; + var a, b, c, d, count; + var dataIndex = hdrInfo.dataPosition; + var index = 0, endIndex = 0, i = 0; + var scanLineArrayBuffer = new ArrayBuffer(scanline_width * 4); // four channel R G B E + var scanLineArray = new Uint8Array(scanLineArrayBuffer); + // 3 channels of 4 bytes per pixel in float. + var resultBuffer = new ArrayBuffer(hdrInfo.width * hdrInfo.height * 4 * 3); + var resultArray = new Float32Array(resultBuffer); + // read in each successive scanline + while (num_scanlines > 0) { + a = uint8array[dataIndex++]; + b = uint8array[dataIndex++]; + c = uint8array[dataIndex++]; + d = uint8array[dataIndex++]; + if (a != 2 || b != 2 || (c & 0x80)) { + // this file is not run length encoded + throw "HDR Bad header format, not RLE"; + } + if (((c << 8) | d) != scanline_width) { + throw "HDR Bad header format, wrong scan line width"; + } + index = 0; + // read each of the four channels for the scanline into the buffer + for (i = 0; i < 4; i++) { + endIndex = (i + 1) * scanline_width; + while (index < endIndex) { + a = uint8array[dataIndex++]; + b = uint8array[dataIndex++]; + if (a > 128) { + // a run of the same value + count = a - 128; + if ((count == 0) || (count > endIndex - index)) { + throw "HDR Bad Format, bad scanline data (run)"; + } + while (count-- > 0) { + scanLineArray[index++] = b; + } + } + else { + // a non-run + count = a; + if ((count == 0) || (count > endIndex - index)) { + throw "HDR Bad Format, bad scanline data (non-run)"; + } + scanLineArray[index++] = b; + if (--count > 0) { + for (var j = 0; j < count; j++) { + scanLineArray[index++] = uint8array[dataIndex++]; + } + } + } + } + } + // now convert data from buffer into floats + for (i = 0; i < scanline_width; i++) { + a = scanLineArray[i]; + b = scanLineArray[i + scanline_width]; + c = scanLineArray[i + 2 * scanline_width]; + d = scanLineArray[i + 3 * scanline_width]; + this.Rgbe2float(resultArray, a, b, c, d, (hdrInfo.height - num_scanlines) * scanline_width * 3 + i * 3); + } + num_scanlines--; + } + return resultArray; + }; + return HDRTools; + }()); + Internals.HDRTools = HDRTools; + })(Internals = BABYLON.Internals || (BABYLON.Internals = {})); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.tools.hdr.js.map + +//_______________________________________________________________ +// Extracted from CubeMapGen: +// https://code.google.com/archive/p/cubemapgen/ +// +// Following https://seblagarde.wordpress.com/2012/06/10/amd-cubemapgen-for-physically-based-rendering/ +//_______________________________________________________________ +var BABYLON; +(function (BABYLON) { + var Internals; + (function (Internals) { + /** + * The bounding box information used during the conversion process. + */ + var CMGBoundinBox = (function () { + function CMGBoundinBox() { + this.min = new BABYLON.Vector3(0, 0, 0); + this.max = new BABYLON.Vector3(0, 0, 0); + this.clear(); + } + CMGBoundinBox.prototype.clear = function () { + this.min.x = CMGBoundinBox.MAX; + this.min.y = CMGBoundinBox.MAX; + this.min.z = CMGBoundinBox.MAX; + this.max.x = CMGBoundinBox.MIN; + this.max.y = CMGBoundinBox.MIN; + this.max.z = CMGBoundinBox.MIN; + }; + CMGBoundinBox.prototype.augment = function (x, y, z) { + this.min.x = Math.min(this.min.x, x); + this.min.y = Math.min(this.min.y, y); + this.min.z = Math.min(this.min.z, z); + this.max.x = Math.max(this.max.x, x); + this.max.y = Math.max(this.max.y, y); + this.max.z = Math.max(this.max.z, z); + }; + CMGBoundinBox.prototype.clampMin = function (x, y, z) { + this.min.x = Math.max(this.min.x, x); + this.min.y = Math.max(this.min.y, y); + this.min.z = Math.max(this.min.z, z); + }; + CMGBoundinBox.prototype.clampMax = function (x, y, z) { + this.max.x = Math.min(this.max.x, x); + this.max.y = Math.min(this.max.y, y); + this.max.z = Math.min(this.max.z, z); + }; + CMGBoundinBox.prototype.empty = function () { + if ((this.min.x > this.max.y) || + (this.min.y > this.max.y) || + (this.min.z > this.max.y)) { + return true; + } + else { + return false; + } + }; + CMGBoundinBox.MAX = Number.MAX_VALUE; + CMGBoundinBox.MIN = Number.MIN_VALUE; + return CMGBoundinBox; + }()); + /** + * Helper class to PreProcess a cubemap in order to generate mipmap according to the level of blur + * required by the glossinees of a material. + * + * This only supports the cosine drop power as well as Warp fixup generation method. + * + * This is using the process from CubeMapGen described here: + * https://seblagarde.wordpress.com/2012/06/10/amd-cubemapgen-for-physically-based-rendering/ + */ + var PMREMGenerator = (function () { + /** + * Constructor of the generator. + * + * @param input The different faces data from the original cubemap in the order X+ X- Y+ Y- Z+ Z- + * @param inputSize The size of the cubemap faces + * @param outputSize The size of the output cubemap faces + * @param maxNumMipLevels The max number of mip map to generate (0 means all) + * @param numChannels The number of channels stored in the cubemap (3 for RBGE for instance) + * @param isFloat Specifies if the input texture is in float or int (hdr is usually in float) + * @param specularPower The max specular level of the desired cubemap + * @param cosinePowerDropPerMip The amount of drop the specular power will follow on each mip + * @param excludeBase Specifies wether to process the level 0 (original level) or not + * @param fixup Specifies wether to apply the edge fixup algorythm or not + */ + function PMREMGenerator(input, inputSize, outputSize, maxNumMipLevels, numChannels, isFloat, specularPower, cosinePowerDropPerMip, excludeBase, fixup) { + this.input = input; + this.inputSize = inputSize; + this.outputSize = outputSize; + this.maxNumMipLevels = maxNumMipLevels; + this.numChannels = numChannels; + this.isFloat = isFloat; + this.specularPower = specularPower; + this.cosinePowerDropPerMip = cosinePowerDropPerMip; + this.excludeBase = excludeBase; + this.fixup = fixup; + this._outputSurface = []; + this._numMipLevels = 0; + } + /** + * Launches the filter process and return the result. + * + * @return the filter cubemap in the form mip0 [faces1..6] .. mipN [faces1..6] + */ + PMREMGenerator.prototype.filterCubeMap = function () { + // Init cubemap processor + this.init(); + // Filters the cubemap + this.filterCubeMapMipChain(); + // Returns the filtered mips. + return this._outputSurface; + }; + PMREMGenerator.prototype.init = function () { + var i; + var j; + var mipLevelSize; + //if nax num mip levels is set to 0, set it to generate the entire mip chain + if (this.maxNumMipLevels == 0) { + this.maxNumMipLevels = PMREMGenerator.CP_MAX_MIPLEVELS; + } + //first miplevel size + mipLevelSize = this.outputSize; + //Iterate over mip chain, and init ArrayBufferView for mip-chain + for (j = 0; j < this.maxNumMipLevels; j++) { + this._outputSurface.length++; + this._outputSurface[j] = []; + //Iterate over faces for output images + for (i = 0; i < 6; i++) { + this._outputSurface[j].length++; + // Initializes a new array for the output. + if (this.isFloat) { + this._outputSurface[j][i] = new Float32Array(mipLevelSize * mipLevelSize * this.numChannels); + } + else { + this._outputSurface[j][i] = new Uint32Array(mipLevelSize * mipLevelSize * this.numChannels); + } + } + //next mip level is half size + mipLevelSize >>= 1; + this._numMipLevels++; + //terminate if mip chain becomes too small + if (mipLevelSize == 0) { + this.maxNumMipLevels = j; + return; + } + } + }; + //-------------------------------------------------------------------------------------- + //Cube map filtering and mip chain generation. + // the cube map filtereing is specified using a number of parameters: + // Filtering per miplevel is specified using 2D cone angle (in degrees) that + // indicates the region of the hemisphere to filter over for each tap. + // + // Note that the top mip level is also a filtered version of the original input images + // as well in order to create mip chains for diffuse environment illumination. + // The cone angle for the top level is specified by a_BaseAngle. This can be used to + // generate mipchains used to store the resutls of preintegration across the hemisphere. + // + // Then the mip angle used to genreate the next level of the mip chain from the first level + // is a_InitialMipAngle + // + // The angle for the subsequent levels of the mip chain are specified by their parents + // filtering angle and a per-level scale and bias + // newAngle = oldAngle * a_MipAnglePerLevelScale; + // + //-------------------------------------------------------------------------------------- + PMREMGenerator.prototype.filterCubeMapMipChain = function () { + // First, take count of the lighting model to modify SpecularPower + // var refSpecularPower = (a_MCO.LightingModel == CP_LIGHTINGMODEL_BLINN || a_MCO.LightingModel == CP_LIGHTINGMODEL_BLINN_BRDF) ? a_MCO.SpecularPower / GetSpecularPowerFactorToMatchPhong(a_MCO.SpecularPower) : a_MCO.SpecularPower; + // var refSpecularPower = this.specularPower; // Only Phong BRDF yet. This explains the line below using this.specularpower. + //Cone angle start (for generating subsequent mip levels) + var currentSpecularPower = this.specularPower; + //Build filter lookup tables based on the source miplevel size + this.precomputeFilterLookupTables(this.inputSize); + // Note that we need to filter the first level before generating mipmap + // So LevelIndex == 0 is base filtering hen LevelIndex > 0 is mipmap generation + for (var levelIndex = 0; levelIndex < this._numMipLevels; levelIndex++) { + // TODO : Write a function to copy and scale the base mipmap in output + // I am just lazy here and just put a high specular power value, and do some if. + if (this.excludeBase && (levelIndex == 0)) { + // If we don't want to process the base mipmap, just put a very high specular power (this allow to handle scale of the texture). + currentSpecularPower = 100000.0; + } + // Special case for cosine power mipmap chain. For quality requirement, we always process the current mipmap from the top mipmap + var srcCubeImage = this.input; + var dstCubeImage = this._outputSurface[levelIndex]; + var dstSize = this.outputSize >> levelIndex; + // Compute required angle. + var angle = this.getBaseFilterAngle(currentSpecularPower); + // filter cube surfaces + this.filterCubeSurfaces(srcCubeImage, this.inputSize, dstCubeImage, dstSize, angle, currentSpecularPower); + // fix seams + if (this.fixup) { + this.fixupCubeEdges(dstCubeImage, dstSize); + } + // Decrease the specular power to generate the mipmap chain + // TODO : Use another method for Exclude (see first comment at start of the function + if (this.excludeBase && (levelIndex == 0)) { + currentSpecularPower = this.specularPower; + } + currentSpecularPower *= this.cosinePowerDropPerMip; + } + }; + //-------------------------------------------------------------------------------------- + // This function return the BaseFilterAngle require by PMREMGenerator to its FilterExtends + // It allow to optimize the texel to access base on the specular power. + //-------------------------------------------------------------------------------------- + PMREMGenerator.prototype.getBaseFilterAngle = function (cosinePower) { + // We want to find the alpha such that: + // cos(alpha)^cosinePower = epsilon + // That's: acos(epsilon^(1/cosinePower)) + var threshold = 0.000001; // Empirical threshold (Work perfectly, didn't check for a more big number, may get some performance and still god approximation) + var angle = 180.0; + angle = Math.acos(Math.pow(threshold, 1.0 / cosinePower)); + angle *= 180.0 / Math.PI; // Convert to degree + angle *= 2.0; // * 2.0f because PMREMGenerator divide by 2 later + return angle; + }; + //-------------------------------------------------------------------------------------- + //Builds the following lookup tables prior to filtering: + // -normalizer cube map + // -tap weight lookup table + // + //-------------------------------------------------------------------------------------- + PMREMGenerator.prototype.precomputeFilterLookupTables = function (srcCubeMapWidth) { + var srcTexelAngle; + var iCubeFace; + //clear pre-existing normalizer cube map + this._normCubeMap = []; + //Normalized vectors per cubeface and per-texel solid angle + this.buildNormalizerSolidAngleCubemap(srcCubeMapWidth); + }; + //-------------------------------------------------------------------------------------- + //Builds a normalizer cubemap, with the texels solid angle stored in the fourth component + // + //Takes in a cube face size, and an array of 6 surfaces to write the cube faces into + // + //Note that this normalizer cube map stores the vectors in unbiased -1 to 1 range. + // if _bx2 style scaled and biased vectors are needed, uncomment the SCALE and BIAS + // below + //-------------------------------------------------------------------------------------- + PMREMGenerator.prototype.buildNormalizerSolidAngleCubemap = function (size) { + var iCubeFace; + var u; + var v; + //iterate over cube faces + for (iCubeFace = 0; iCubeFace < 6; iCubeFace++) { + //First three channels for norm cube, and last channel for solid angle + this._normCubeMap.push(new Float32Array(size * size * 4)); + //fast texture walk, build normalizer cube map + var facesData = this.input[iCubeFace]; + for (v = 0; v < size; v++) { + for (u = 0; u < size; u++) { + var vect = this.texelCoordToVect(iCubeFace, u, v, size, this.fixup); + this._normCubeMap[iCubeFace][(v * size + u) * 4 + 0] = vect.x; + this._normCubeMap[iCubeFace][(v * size + u) * 4 + 1] = vect.y; + this._normCubeMap[iCubeFace][(v * size + u) * 4 + 2] = vect.z; + var solidAngle = this.texelCoordSolidAngle(iCubeFace, u, v, size); + this._normCubeMap[iCubeFace][(v * size + u) * 4 + 4] = solidAngle; + } + } + } + }; + //-------------------------------------------------------------------------------------- + // Convert cubemap face texel coordinates and face idx to 3D vector + // note the U and V coords are integer coords and range from 0 to size-1 + // this routine can be used to generate a normalizer cube map + //-------------------------------------------------------------------------------------- + // SL BEGIN + PMREMGenerator.prototype.texelCoordToVect = function (faceIdx, u, v, size, fixup) { + var nvcU; + var nvcV; + var tempVec; + // Change from original AMD code + // transform from [0..res - 1] to [- (1 - 1 / res) .. (1 - 1 / res)] + // + 0.5f is for texel center addressing + nvcU = (2.0 * (u + 0.5) / size) - 1.0; + nvcV = (2.0 * (v + 0.5) / size) - 1.0; + // warp fixup + if (fixup && size > 1) { + // Code from Nvtt : http://code.google.com/p/nvidia-texture-tools/source/browse/trunk/src/nvtt/CubeSurface.cpp + var a = Math.pow(size, 2.0) / Math.pow(size - 1, 3.0); + nvcU = a * Math.pow(nvcU, 3) + nvcU; + nvcV = a * Math.pow(nvcV, 3) + nvcV; + } + // Get current vector + // generate x,y,z vector (xform 2d NVC coord to 3D vector) + // U contribution + var UVec = PMREMGenerator._sgFace2DMapping[faceIdx][PMREMGenerator.CP_UDIR]; + PMREMGenerator._vectorTemp.x = UVec[0] * nvcU; + PMREMGenerator._vectorTemp.y = UVec[1] * nvcU; + PMREMGenerator._vectorTemp.z = UVec[2] * nvcU; + // V contribution and Sum + var VVec = PMREMGenerator._sgFace2DMapping[faceIdx][PMREMGenerator.CP_VDIR]; + PMREMGenerator._vectorTemp.x += VVec[0] * nvcV; + PMREMGenerator._vectorTemp.y += VVec[1] * nvcV; + PMREMGenerator._vectorTemp.z += VVec[2] * nvcV; + //add face axis + var faceAxis = PMREMGenerator._sgFace2DMapping[faceIdx][PMREMGenerator.CP_FACEAXIS]; + PMREMGenerator._vectorTemp.x += faceAxis[0]; + PMREMGenerator._vectorTemp.y += faceAxis[1]; + PMREMGenerator._vectorTemp.z += faceAxis[2]; + //normalize vector + PMREMGenerator._vectorTemp.normalize(); + return PMREMGenerator._vectorTemp; + }; + //-------------------------------------------------------------------------------------- + // Convert 3D vector to cubemap face texel coordinates and face idx + // note the U and V coords are integer coords and range from 0 to size-1 + // this routine can be used to generate a normalizer cube map + // + // returns face IDX and texel coords + //-------------------------------------------------------------------------------------- + // SL BEGIN + /* + Mapping Texture Coordinates to Cube Map Faces + Because there are multiple faces, the mapping of texture coordinates to positions on cube map faces + is more complicated than the other texturing targets. The EXT_texture_cube_map extension is purposefully + designed to be consistent with DirectX 7's cube map arrangement. This is also consistent with the cube + map arrangement in Pixar's RenderMan package. + For cube map texturing, the (s,t,r) texture coordinates are treated as a direction vector (rx,ry,rz) + emanating from the center of a cube. (The q coordinate can be ignored since it merely scales the vector + without affecting the direction.) At texture application time, the interpolated per-fragment (s,t,r) + selects one of the cube map face's 2D mipmap sets based on the largest magnitude coordinate direction + the major axis direction). The target column in the table below explains how the major axis direction + maps to the 2D image of a particular cube map target. + + major axis + direction target sc tc ma + ---------- --------------------------------- --- --- --- + +rx GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT -rz -ry rx + -rx GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT +rz -ry rx + +ry GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT +rx +rz ry + -ry GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT +rx -rz ry + +rz GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT +rx -ry rz + -rz GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT -rx -ry rz + + Using the sc, tc, and ma determined by the major axis direction as specified in the table above, + an updated (s,t) is calculated as follows + s = ( sc/|ma| + 1 ) / 2 + t = ( tc/|ma| + 1 ) / 2 + If |ma| is zero or very nearly zero, the results of the above two equations need not be defined + (though the result may not lead to GL interruption or termination). Once the cube map face's 2D mipmap + set and (s,t) is determined, texture fetching and filtering proceeds like standard OpenGL 2D texturing. + */ + // Note this method return U and V in range from 0 to size-1 + // SL END + // Store the information in vector3 for convenience (faceindex, u, v) + PMREMGenerator.prototype.vectToTexelCoord = function (x, y, z, size) { + var maxCoord; + var faceIdx; + //absolute value 3 + var absX = Math.abs(x); + var absY = Math.abs(y); + var absZ = Math.abs(z); + if (absX >= absY && absX >= absZ) { + maxCoord = absX; + if (x >= 0) { + faceIdx = PMREMGenerator.CP_FACE_X_POS; + } + else { + faceIdx = PMREMGenerator.CP_FACE_X_NEG; + } + } + else if (absY >= absX && absY >= absZ) { + maxCoord = absY; + if (y >= 0) { + faceIdx = PMREMGenerator.CP_FACE_Y_POS; + } + else { + faceIdx = PMREMGenerator.CP_FACE_Y_NEG; + } + } + else { + maxCoord = absZ; + if (z >= 0) { + faceIdx = PMREMGenerator.CP_FACE_Z_POS; + } + else { + faceIdx = PMREMGenerator.CP_FACE_Z_NEG; + } + } + //divide through by max coord so face vector lies on cube face + var scale = 1 / maxCoord; + x *= scale; + y *= scale; + z *= scale; + var temp = PMREMGenerator._sgFace2DMapping[faceIdx][PMREMGenerator.CP_UDIR]; + var nvcU = temp[0] * x + temp[1] * y + temp[2] * z; + temp = PMREMGenerator._sgFace2DMapping[faceIdx][PMREMGenerator.CP_VDIR]; + var nvcV = temp[0] * x + temp[1] * y + temp[2] * z; + // Modify original AMD code to return value from 0 to Size - 1 + var u = Math.floor((size - 1) * 0.5 * (nvcU + 1.0)); + var v = Math.floor((size - 1) * 0.5 * (nvcV + 1.0)); + PMREMGenerator._vectorTemp.x = faceIdx; + PMREMGenerator._vectorTemp.y = u; + PMREMGenerator._vectorTemp.z = v; + return PMREMGenerator._vectorTemp; + }; + //-------------------------------------------------------------------------------------- + //Original code from Ignacio CastaÃ’o + // This formula is from Manne ÷hrstrˆm's thesis. + // Take two coordiantes in the range [-1, 1] that define a portion of a + // cube face and return the area of the projection of that portion on the + // surface of the sphere. + //-------------------------------------------------------------------------------------- + PMREMGenerator.prototype.areaElement = function (x, y) { + return Math.atan2(x * y, Math.sqrt(x * x + y * y + 1)); + }; + PMREMGenerator.prototype.texelCoordSolidAngle = function (faceIdx, u, v, size) { + // transform from [0..res - 1] to [- (1 - 1 / res) .. (1 - 1 / res)] + // (+ 0.5f is for texel center addressing) + u = (2.0 * (u + 0.5) / size) - 1.0; + v = (2.0 * (v + 0.5) / size) - 1.0; + // Shift from a demi texel, mean 1.0f / a_Size with U and V in [-1..1] + var invResolution = 1.0 / size; + // U and V are the -1..1 texture coordinate on the current face. + // Get projected area for this texel + var x0 = u - invResolution; + var y0 = v - invResolution; + var x1 = u + invResolution; + var y1 = v + invResolution; + var solidAngle = this.areaElement(x0, y0) - this.areaElement(x0, y1) - this.areaElement(x1, y0) + this.areaElement(x1, y1); + return solidAngle; + }; + //-------------------------------------------------------------------------------------- + //The key to the speed of these filtering routines is to quickly define a per-face + // bounding box of pixels which enclose all the taps in the filter kernel efficiently. + // Later these pixels are selectively processed based on their dot products to see if + // they reside within the filtering cone. + // + //This is done by computing the smallest per-texel angle to get a conservative estimate + // of the number of texels needed to be covered in width and height order to filter the + // region. the bounding box for the center taps face is defined first, and if the + // filtereing region bleeds onto the other faces, bounding boxes for the other faces are + // defined next + //-------------------------------------------------------------------------------------- + PMREMGenerator.prototype.filterCubeSurfaces = function (srcCubeMap, srcSize, dstCubeMap, dstSize, filterConeAngle, specularPower) { + // note that pixels within these regions may be rejected + // based on the anlge + var iCubeFace; + var u; + var v; + // bounding box per face to specify region to process + var filterExtents = []; + for (iCubeFace = 0; iCubeFace < 6; iCubeFace++) { + filterExtents.push(new CMGBoundinBox()); + } + // min angle a src texel can cover (in degrees) + var srcTexelAngle = (180.0 / (Math.PI) * Math.atan2(1.0, srcSize)); + // angle about center tap to define filter cone + // filter angle is 1/2 the cone angle + var filterAngle = filterConeAngle / 2.0; + //ensure filter angle is larger than a texel + if (filterAngle < srcTexelAngle) { + filterAngle = srcTexelAngle; + } + //ensure filter cone is always smaller than the hemisphere + if (filterAngle > 90.0) { + filterAngle = 90.0; + } + // the maximum number of texels in 1D the filter cone angle will cover + // used to determine bounding box size for filter extents + var filterSize = Math.ceil(filterAngle / srcTexelAngle); + // ensure conservative region always covers at least one texel + if (filterSize < 1) { + filterSize = 1; + } + // dotProdThresh threshold based on cone angle to determine whether or not taps + // reside within the cone angle + var dotProdThresh = Math.cos((Math.PI / 180.0) * filterAngle); + // process required faces + for (iCubeFace = 0; iCubeFace < 6; iCubeFace++) { + //iterate over dst cube map face texel + for (v = 0; v < dstSize; v++) { + for (u = 0; u < dstSize; u++) { + //get center tap direction + var centerTapDir = this.texelCoordToVect(iCubeFace, u, v, dstSize, this.fixup).clone(); + //clear old per-face filter extents + this.clearFilterExtents(filterExtents); + //define per-face filter extents + this.determineFilterExtents(centerTapDir, srcSize, filterSize, filterExtents); + //perform filtering of src faces using filter extents + var vect = this.processFilterExtents(centerTapDir, dotProdThresh, filterExtents, srcCubeMap, srcSize, specularPower); + dstCubeMap[iCubeFace][(v * dstSize + u) * this.numChannels + 0] = vect.x; + dstCubeMap[iCubeFace][(v * dstSize + u) * this.numChannels + 1] = vect.y; + dstCubeMap[iCubeFace][(v * dstSize + u) * this.numChannels + 2] = vect.z; + } + } + } + }; + //-------------------------------------------------------------------------------------- + //Clear filter extents for the 6 cube map faces + //-------------------------------------------------------------------------------------- + PMREMGenerator.prototype.clearFilterExtents = function (filterExtents) { + for (var iCubeFaces = 0; iCubeFaces < 6; iCubeFaces++) { + filterExtents[iCubeFaces].clear(); + } + }; + //-------------------------------------------------------------------------------------- + //Define per-face bounding box filter extents + // + // These define conservative texel regions in each of the faces the filter can possibly + // process. When the pixels in the regions are actually processed, the dot product + // between the tap vector and the center tap vector is used to determine the weight of + // the tap and whether or not the tap is within the cone. + // + //-------------------------------------------------------------------------------------- + PMREMGenerator.prototype.determineFilterExtents = function (centerTapDir, srcSize, bboxSize, filterExtents) { + //neighboring face and bleed over amount, and width of BBOX for + // left, right, top, and bottom edges of this face + var bleedOverAmount = [0, 0, 0, 0]; + var bleedOverBBoxMin = [0, 0, 0, 0]; + var bleedOverBBoxMax = [0, 0, 0, 0]; + var neighborFace; + var neighborEdge; + var oppositeFaceIdx; + //get face idx, and u, v info from center tap dir + var result = this.vectToTexelCoord(centerTapDir.x, centerTapDir.y, centerTapDir.z, srcSize); + var faceIdx = result.x; + var u = result.y; + var v = result.z; + //define bbox size within face + filterExtents[faceIdx].augment(u - bboxSize, v - bboxSize, 0); + filterExtents[faceIdx].augment(u + bboxSize, v + bboxSize, 0); + filterExtents[faceIdx].clampMin(0, 0, 0); + filterExtents[faceIdx].clampMax(srcSize - 1, srcSize - 1, 0); + //u and v extent in face corresponding to center tap + var minU = filterExtents[faceIdx].min.x; + var minV = filterExtents[faceIdx].min.y; + var maxU = filterExtents[faceIdx].max.x; + var maxV = filterExtents[faceIdx].max.y; + //bleed over amounts for face across u=0 edge (left) + bleedOverAmount[0] = (bboxSize - u); + bleedOverBBoxMin[0] = minV; + bleedOverBBoxMax[0] = maxV; + //bleed over amounts for face across u=1 edge (right) + bleedOverAmount[1] = (u + bboxSize) - (srcSize - 1); + bleedOverBBoxMin[1] = minV; + bleedOverBBoxMax[1] = maxV; + //bleed over to face across v=0 edge (up) + bleedOverAmount[2] = (bboxSize - v); + bleedOverBBoxMin[2] = minU; + bleedOverBBoxMax[2] = maxU; + //bleed over to face across v=1 edge (down) + bleedOverAmount[3] = (v + bboxSize) - (srcSize - 1); + bleedOverBBoxMin[3] = minU; + bleedOverBBoxMax[3] = maxU; + //compute bleed over regions in neighboring faces + for (var i = 0; i < 4; i++) { + if (bleedOverAmount[i] > 0) { + neighborFace = PMREMGenerator._sgCubeNgh[faceIdx][i][0]; + neighborEdge = PMREMGenerator._sgCubeNgh[faceIdx][i][1]; + //For certain types of edge abutments, the bleedOverBBoxMin, and bleedOverBBoxMax need to + // be flipped: the cases are + // if a left edge mates with a left or bottom edge on the neighbor + // if a top edge mates with a top or right edge on the neighbor + // if a right edge mates with a right or top edge on the neighbor + // if a bottom edge mates with a bottom or left edge on the neighbor + //Seeing as the edges are enumerated as follows + // left =0 + // right =1 + // top =2 + // bottom =3 + // + // so if the edge enums are the same, or the sum of the enums == 3, + // the bbox needs to be flipped + if ((i == neighborEdge) || ((i + neighborEdge) == 3)) { + bleedOverBBoxMin[i] = (srcSize - 1) - bleedOverBBoxMin[i]; + bleedOverBBoxMax[i] = (srcSize - 1) - bleedOverBBoxMax[i]; + } + //The way the bounding box is extended onto the neighboring face + // depends on which edge of neighboring face abuts with this one + switch (PMREMGenerator._sgCubeNgh[faceIdx][i][1]) { + case PMREMGenerator.CP_EDGE_LEFT: + filterExtents[neighborFace].augment(0, bleedOverBBoxMin[i], 0); + filterExtents[neighborFace].augment(bleedOverAmount[i], bleedOverBBoxMax[i], 0); + break; + case PMREMGenerator.CP_EDGE_RIGHT: + filterExtents[neighborFace].augment((srcSize - 1), bleedOverBBoxMin[i], 0); + filterExtents[neighborFace].augment((srcSize - 1) - bleedOverAmount[i], bleedOverBBoxMax[i], 0); + break; + case PMREMGenerator.CP_EDGE_TOP: + filterExtents[neighborFace].augment(bleedOverBBoxMin[i], 0, 0); + filterExtents[neighborFace].augment(bleedOverBBoxMax[i], bleedOverAmount[i], 0); + break; + case PMREMGenerator.CP_EDGE_BOTTOM: + filterExtents[neighborFace].augment(bleedOverBBoxMin[i], (srcSize - 1), 0); + filterExtents[neighborFace].augment(bleedOverBBoxMax[i], (srcSize - 1) - bleedOverAmount[i], 0); + break; + } + //clamp filter extents in non-center tap faces to remain within surface + filterExtents[neighborFace].clampMin(0, 0, 0); + filterExtents[neighborFace].clampMax(srcSize - 1, srcSize - 1, 0); + } + //If the bleed over amount bleeds past the adjacent face onto the opposite face + // from the center tap face, then process the opposite face entirely for now. + //Note that the cases in which this happens, what usually happens is that + // more than one edge bleeds onto the opposite face, and the bounding box + // encompasses the entire cube map face. + if (bleedOverAmount[i] > srcSize) { + //determine opposite face + switch (faceIdx) { + case PMREMGenerator.CP_FACE_X_POS: + oppositeFaceIdx = PMREMGenerator.CP_FACE_X_NEG; + break; + case PMREMGenerator.CP_FACE_X_NEG: + oppositeFaceIdx = PMREMGenerator.CP_FACE_X_POS; + break; + case PMREMGenerator.CP_FACE_Y_POS: + oppositeFaceIdx = PMREMGenerator.CP_FACE_Y_NEG; + break; + case PMREMGenerator.CP_FACE_Y_NEG: + oppositeFaceIdx = PMREMGenerator.CP_FACE_Y_POS; + break; + case PMREMGenerator.CP_FACE_Z_POS: + oppositeFaceIdx = PMREMGenerator.CP_FACE_Z_NEG; + break; + case PMREMGenerator.CP_FACE_Z_NEG: + oppositeFaceIdx = PMREMGenerator.CP_FACE_Z_POS; + break; + default: + break; + } + //just encompass entire face for now + filterExtents[oppositeFaceIdx].augment(0, 0, 0); + filterExtents[oppositeFaceIdx].augment((srcSize - 1), (srcSize - 1), 0); + } + } + }; + //-------------------------------------------------------------------------------------- + //ProcessFilterExtents + // Process bounding box in each cube face + // + //-------------------------------------------------------------------------------------- + PMREMGenerator.prototype.processFilterExtents = function (centerTapDir, dotProdThresh, filterExtents, srcCubeMap, srcSize, specularPower) { + //accumulators are 64-bit floats in order to have the precision needed + // over a summation of a large number of pixels + var dstAccum = [0, 0, 0, 0]; + var weightAccum = 0; + var k = 0; + var nSrcChannels = this.numChannels; + // norm cube map and srcCubeMap have same face width + var faceWidth = srcSize; + //amount to add to pointer to move to next scanline in images + var normCubePitch = faceWidth * 4; // 4 channels in normCubeMap. + var srcCubePitch = faceWidth * this.numChannels; // numChannels correponds to the cubemap number of channel + var IsPhongBRDF = 1; // Only works in Phong BRDF yet. + //(a_LightingModel == CP_LIGHTINGMODEL_PHONG_BRDF || a_LightingModel == CP_LIGHTINGMODEL_BLINN_BRDF) ? 1 : 0; // This value will be added to the specular power + // iterate over cubefaces + for (var iFaceIdx = 0; iFaceIdx < 6; iFaceIdx++) { + //if bbox is non empty + if (!filterExtents[iFaceIdx].empty()) { + var uStart = filterExtents[iFaceIdx].min.x; + var vStart = filterExtents[iFaceIdx].min.y; + var uEnd = filterExtents[iFaceIdx].max.x; + var vEnd = filterExtents[iFaceIdx].max.y; + var startIndexNormCubeMap = (4 * ((vStart * faceWidth) + uStart)); + var startIndexSrcCubeMap = (this.numChannels * ((vStart * faceWidth) + uStart)); + //note that <= is used to ensure filter extents always encompass at least one pixel if bbox is non empty + for (var v = vStart; v <= vEnd; v++) { + var normCubeRowWalk = 0; + var srcCubeRowWalk = 0; + for (var u = uStart; u <= uEnd; u++) { + //pointer to direction in cube map associated with texel + var texelVectX = this._normCubeMap[iFaceIdx][startIndexNormCubeMap + normCubeRowWalk + 0]; + var texelVectY = this._normCubeMap[iFaceIdx][startIndexNormCubeMap + normCubeRowWalk + 1]; + var texelVectZ = this._normCubeMap[iFaceIdx][startIndexNormCubeMap + normCubeRowWalk + 2]; + //check dot product to see if texel is within cone + var tapDotProd = texelVectX * centerTapDir.x + + texelVectY * centerTapDir.y + + texelVectZ * centerTapDir.z; + if (tapDotProd >= dotProdThresh && tapDotProd > 0.0) { + //solid angle stored in 4th channel of normalizer/solid angle cube map + var weight = this._normCubeMap[iFaceIdx][startIndexNormCubeMap + normCubeRowWalk + 3]; + // Here we decide if we use a Phong/Blinn or a Phong/Blinn BRDF. + // Phong/Blinn BRDF is just the Phong/Blinn model multiply by the cosine of the lambert law + // so just adding one to specularpower do the trick. + weight *= Math.pow(tapDotProd, (specularPower + IsPhongBRDF)); + //iterate over channels + for (k = 0; k < nSrcChannels; k++) { + dstAccum[k] += weight * srcCubeMap[iFaceIdx][startIndexSrcCubeMap + srcCubeRowWalk]; + srcCubeRowWalk++; + } + weightAccum += weight; //accumulate weight + } + else { + //step across source pixel + srcCubeRowWalk += nSrcChannels; + } + normCubeRowWalk += 4; // 4 channels per norm cube map. + } + startIndexNormCubeMap += normCubePitch; + startIndexSrcCubeMap += srcCubePitch; + } + } + } + //divide through by weights if weight is non zero + if (weightAccum != 0.0) { + PMREMGenerator._vectorTemp.x = (dstAccum[0] / weightAccum); + PMREMGenerator._vectorTemp.y = (dstAccum[1] / weightAccum); + PMREMGenerator._vectorTemp.z = (dstAccum[2] / weightAccum); + if (this.numChannels > 3) { + PMREMGenerator._vectorTemp.w = (dstAccum[3] / weightAccum); + } + } + else { + // otherwise sample nearest + // get face idx and u, v texel coordinate in face + var coord = this.vectToTexelCoord(centerTapDir.x, centerTapDir.y, centerTapDir.z, srcSize).clone(); + PMREMGenerator._vectorTemp.x = srcCubeMap[coord.x][this.numChannels * (coord.z * srcSize + coord.y) + 0]; + PMREMGenerator._vectorTemp.y = srcCubeMap[coord.x][this.numChannels * (coord.z * srcSize + coord.y) + 1]; + PMREMGenerator._vectorTemp.z = srcCubeMap[coord.x][this.numChannels * (coord.z * srcSize + coord.y) + 2]; + if (this.numChannels > 3) { + PMREMGenerator._vectorTemp.z = srcCubeMap[coord.x][this.numChannels * (coord.z * srcSize + coord.y) + 3]; + } + } + return PMREMGenerator._vectorTemp; + }; + //-------------------------------------------------------------------------------------- + // Fixup cube edges + // + // average texels on cube map faces across the edges + // WARP/BENT Method Only. + //-------------------------------------------------------------------------------------- + PMREMGenerator.prototype.fixupCubeEdges = function (cubeMap, cubeMapSize) { + var k; + var j; + var i; + var iFace; + var iCorner = 0; + var cornerNumPtrs = [0, 0, 0, 0, 0, 0, 0, 0]; //indexed by corner and face idx + var faceCornerStartIndicies = [[], [], [], []]; //corner pointers for face keeping track of the face they belong to. + // note that if functionality to filter across the three texels for each corner, then + //indexed by corner and face idx. the array contains the face the start points belongs to. + var cornerPtr = [ + [[], [], []], + [[], [], []], + [[], [], []], + [[], [], []], + [[], [], []], + [[], [], []], + [[], [], []], + [[], [], []] + ]; + //if there is no fixup, or fixup width = 0, do nothing + if (cubeMapSize < 1) { + return; + } + //special case 1x1 cubemap, average face colors + if (cubeMapSize == 1) { + //iterate over channels + for (k = 0; k < this.numChannels; k++) { + var accum = 0.0; + //iterate over faces to accumulate face colors + for (iFace = 0; iFace < 6; iFace++) { + accum += cubeMap[iFace][k]; + } + //compute average over 6 face colors + accum /= 6.0; + //iterate over faces to distribute face colors + for (iFace = 0; iFace < 6; iFace++) { + cubeMap[iFace][k] = accum; + } + } + return; + } + //iterate over faces to collect list of corner texel pointers + for (iFace = 0; iFace < 6; iFace++) { + //the 4 corner pointers for this face + faceCornerStartIndicies[0] = [iFace, 0]; + faceCornerStartIndicies[1] = [iFace, ((cubeMapSize - 1) * this.numChannels)]; + faceCornerStartIndicies[2] = [iFace, ((cubeMapSize) * (cubeMapSize - 1) * this.numChannels)]; + faceCornerStartIndicies[3] = [iFace, ((((cubeMapSize) * (cubeMapSize - 1)) + (cubeMapSize - 1)) * this.numChannels)]; + //iterate over face corners to collect cube corner pointers + for (iCorner = 0; iCorner < 4; iCorner++) { + var corner = PMREMGenerator._sgCubeCornerList[iFace][iCorner]; + cornerPtr[corner][cornerNumPtrs[corner]] = faceCornerStartIndicies[iCorner]; + cornerNumPtrs[corner]++; + } + } + //iterate over corners to average across corner tap values + for (iCorner = 0; iCorner < 8; iCorner++) { + for (k = 0; k < this.numChannels; k++) { + var cornerTapAccum = 0.0; + //iterate over corner texels and average results + for (i = 0; i < 3; i++) { + cornerTapAccum += cubeMap[cornerPtr[iCorner][i][0]][cornerPtr[iCorner][i][1] + k]; // Get in the cube map face the start point + channel. + } + //divide by 3 to compute average of corner tap values + cornerTapAccum *= (1.0 / 3.0); + //iterate over corner texels and average results + for (i = 0; i < 3; i++) { + cubeMap[cornerPtr[iCorner][i][0]][cornerPtr[iCorner][i][1] + k] = cornerTapAccum; + } + } + } + //iterate over the twelve edges of the cube to average across edges + for (i = 0; i < 12; i++) { + var face = PMREMGenerator._sgCubeEdgeList[i][0]; + var edge = PMREMGenerator._sgCubeEdgeList[i][1]; + var neighborFace = PMREMGenerator._sgCubeNgh[face][edge][0]; + var neighborEdge = PMREMGenerator._sgCubeNgh[face][edge][1]; + var edgeStartIndex = 0; // a_CubeMap[face].m_ImgData; + var neighborEdgeStartIndex = 0; // a_CubeMap[neighborFace].m_ImgData; + var edgeWalk = 0; + var neighborEdgeWalk = 0; + //Determine walking pointers based on edge type + // e.g. CP_EDGE_LEFT, CP_EDGE_RIGHT, CP_EDGE_TOP, CP_EDGE_BOTTOM + switch (edge) { + case PMREMGenerator.CP_EDGE_LEFT: + // no change to faceEdgeStartPtr + edgeWalk = this.numChannels * cubeMapSize; + break; + case PMREMGenerator.CP_EDGE_RIGHT: + edgeStartIndex += (cubeMapSize - 1) * this.numChannels; + edgeWalk = this.numChannels * cubeMapSize; + break; + case PMREMGenerator.CP_EDGE_TOP: + // no change to faceEdgeStartPtr + edgeWalk = this.numChannels; + break; + case PMREMGenerator.CP_EDGE_BOTTOM: + edgeStartIndex += (cubeMapSize) * (cubeMapSize - 1) * this.numChannels; + edgeWalk = this.numChannels; + break; + } + //For certain types of edge abutments, the neighbor edge walk needs to + // be flipped: the cases are + // if a left edge mates with a left or bottom edge on the neighbor + // if a top edge mates with a top or right edge on the neighbor + // if a right edge mates with a right or top edge on the neighbor + // if a bottom edge mates with a bottom or left edge on the neighbor + //Seeing as the edges are enumerated as follows + // left =0 + // right =1 + // top =2 + // bottom =3 + // + //If the edge enums are the same, or the sum of the enums == 3, + // the neighbor edge walk needs to be flipped + if ((edge == neighborEdge) || ((edge + neighborEdge) == 3)) { + switch (neighborEdge) { + case PMREMGenerator.CP_EDGE_LEFT: + neighborEdgeStartIndex += (cubeMapSize - 1) * (cubeMapSize) * this.numChannels; + neighborEdgeWalk = -(this.numChannels * cubeMapSize); + break; + case PMREMGenerator.CP_EDGE_RIGHT: + neighborEdgeStartIndex += ((cubeMapSize - 1) * (cubeMapSize) + (cubeMapSize - 1)) * this.numChannels; + neighborEdgeWalk = -(this.numChannels * cubeMapSize); + break; + case PMREMGenerator.CP_EDGE_TOP: + neighborEdgeStartIndex += (cubeMapSize - 1) * this.numChannels; + neighborEdgeWalk = -this.numChannels; + break; + case PMREMGenerator.CP_EDGE_BOTTOM: + neighborEdgeStartIndex += ((cubeMapSize - 1) * (cubeMapSize) + (cubeMapSize - 1)) * this.numChannels; + neighborEdgeWalk = -this.numChannels; + break; + } + } + else { + //swapped direction neighbor edge walk + switch (neighborEdge) { + case PMREMGenerator.CP_EDGE_LEFT: + //no change to neighborEdgeStartPtr for this case since it points + // to the upper left corner already + neighborEdgeWalk = this.numChannels * cubeMapSize; + break; + case PMREMGenerator.CP_EDGE_RIGHT: + neighborEdgeStartIndex += (cubeMapSize - 1) * this.numChannels; + neighborEdgeWalk = this.numChannels * cubeMapSize; + break; + case PMREMGenerator.CP_EDGE_TOP: + //no change to neighborEdgeStartPtr for this case since it points + // to the upper left corner already + neighborEdgeWalk = this.numChannels; + break; + case PMREMGenerator.CP_EDGE_BOTTOM: + neighborEdgeStartIndex += (cubeMapSize) * (cubeMapSize - 1) * this.numChannels; + neighborEdgeWalk = this.numChannels; + break; + } + } + //Perform edge walk, to average across the 12 edges and smoothly propagate change to + //nearby neighborhood + //step ahead one texel on edge + edgeStartIndex += edgeWalk; + neighborEdgeStartIndex += neighborEdgeWalk; + // note that this loop does not process the corner texels, since they have already been + // averaged across faces across earlier + for (j = 1; j < (cubeMapSize - 1); j++) { + //for each set of taps along edge, average them + // and rewrite the results into the edges + for (k = 0; k < this.numChannels; k++) { + var edgeTap = cubeMap[face][edgeStartIndex + k]; + var neighborEdgeTap = cubeMap[neighborFace][neighborEdgeStartIndex + k]; + //compute average of tap intensity values + var avgTap = 0.5 * (edgeTap + neighborEdgeTap); + //propagate average of taps to edge taps + cubeMap[face][edgeStartIndex + k] = avgTap; + cubeMap[neighborFace][neighborEdgeStartIndex + k] = avgTap; + } + edgeStartIndex += edgeWalk; + neighborEdgeStartIndex += neighborEdgeWalk; + } + } + }; + PMREMGenerator.CP_MAX_MIPLEVELS = 16; + PMREMGenerator.CP_UDIR = 0; + PMREMGenerator.CP_VDIR = 1; + PMREMGenerator.CP_FACEAXIS = 2; + //used to index cube faces + PMREMGenerator.CP_FACE_X_POS = 0; + PMREMGenerator.CP_FACE_X_NEG = 1; + PMREMGenerator.CP_FACE_Y_POS = 2; + PMREMGenerator.CP_FACE_Y_NEG = 3; + PMREMGenerator.CP_FACE_Z_POS = 4; + PMREMGenerator.CP_FACE_Z_NEG = 5; + //used to index image edges + // NOTE.. the actual number corresponding to the edge is important + // do not change these, or the code will break + // + // CP_EDGE_LEFT is u = 0 + // CP_EDGE_RIGHT is u = width-1 + // CP_EDGE_TOP is v = 0 + // CP_EDGE_BOTTOM is v = height-1 + PMREMGenerator.CP_EDGE_LEFT = 0; + PMREMGenerator.CP_EDGE_RIGHT = 1; + PMREMGenerator.CP_EDGE_TOP = 2; + PMREMGenerator.CP_EDGE_BOTTOM = 3; + //corners of CUBE map (P or N specifys if it corresponds to the + // positive or negative direction each of X, Y, and Z + PMREMGenerator.CP_CORNER_NNN = 0; + PMREMGenerator.CP_CORNER_NNP = 1; + PMREMGenerator.CP_CORNER_NPN = 2; + PMREMGenerator.CP_CORNER_NPP = 3; + PMREMGenerator.CP_CORNER_PNN = 4; + PMREMGenerator.CP_CORNER_PNP = 5; + PMREMGenerator.CP_CORNER_PPN = 6; + PMREMGenerator.CP_CORNER_PPP = 7; + PMREMGenerator._vectorTemp = new BABYLON.Vector4(0, 0, 0, 0); + //3x2 matrices that map cube map indexing vectors in 3d + // (after face selection and divide through by the + // _ABSOLUTE VALUE_ of the max coord) + // into NVC space + //Note this currently assumes the D3D cube face ordering and orientation + PMREMGenerator._sgFace2DMapping = [ + //XPOS face + [[0, 0, -1], + [0, -1, 0], + [1, 0, 0]], + //XNEG face + [[0, 0, 1], + [0, -1, 0], + [-1, 0, 0]], + //YPOS face + [[1, 0, 0], + [0, 0, 1], + [0, 1, 0]], + //YNEG face + [[1, 0, 0], + [0, 0, -1], + [0, -1, 0]], + //ZPOS face + [[1, 0, 0], + [0, -1, 0], + [0, 0, 1]], + //ZNEG face + [[-1, 0, 0], + [0, -1, 0], + [0, 0, -1]], + ]; + //------------------------------------------------------------------------------ + // D3D cube map face specification + // mapping from 3D x,y,z cube map lookup coordinates + // to 2D within face u,v coordinates + // + // --------------------> U direction + // | (within-face texture space) + // | _____ + // | | | + // | | +Y | + // | _____|_____|_____ _____ + // | | | | | | + // | | -X | +Z | +X | -Z | + // | |_____|_____|_____|_____| + // | | | + // | | -Y | + // | |_____| + // | + // v V direction + // (within-face texture space) + //------------------------------------------------------------------------------ + //Information about neighbors and how texture coorrdinates change across faces + // in ORDER of left, right, top, bottom (e.g. edges corresponding to u=0, + // u=1, v=0, v=1 in the 2D coordinate system of the particular face. + //Note this currently assumes the D3D cube face ordering and orientation + PMREMGenerator._sgCubeNgh = [ + //XPOS face + [[PMREMGenerator.CP_FACE_Z_POS, PMREMGenerator.CP_EDGE_RIGHT], + [PMREMGenerator.CP_FACE_Z_NEG, PMREMGenerator.CP_EDGE_LEFT], + [PMREMGenerator.CP_FACE_Y_POS, PMREMGenerator.CP_EDGE_RIGHT], + [PMREMGenerator.CP_FACE_Y_NEG, PMREMGenerator.CP_EDGE_RIGHT]], + //XNEG face + [[PMREMGenerator.CP_FACE_Z_NEG, PMREMGenerator.CP_EDGE_RIGHT], + [PMREMGenerator.CP_FACE_Z_POS, PMREMGenerator.CP_EDGE_LEFT], + [PMREMGenerator.CP_FACE_Y_POS, PMREMGenerator.CP_EDGE_LEFT], + [PMREMGenerator.CP_FACE_Y_NEG, PMREMGenerator.CP_EDGE_LEFT]], + //YPOS face + [[PMREMGenerator.CP_FACE_X_NEG, PMREMGenerator.CP_EDGE_TOP], + [PMREMGenerator.CP_FACE_X_POS, PMREMGenerator.CP_EDGE_TOP], + [PMREMGenerator.CP_FACE_Z_NEG, PMREMGenerator.CP_EDGE_TOP], + [PMREMGenerator.CP_FACE_Z_POS, PMREMGenerator.CP_EDGE_TOP]], + //YNEG face + [[PMREMGenerator.CP_FACE_X_NEG, PMREMGenerator.CP_EDGE_BOTTOM], + [PMREMGenerator.CP_FACE_X_POS, PMREMGenerator.CP_EDGE_BOTTOM], + [PMREMGenerator.CP_FACE_Z_POS, PMREMGenerator.CP_EDGE_BOTTOM], + [PMREMGenerator.CP_FACE_Z_NEG, PMREMGenerator.CP_EDGE_BOTTOM]], + //ZPOS face + [[PMREMGenerator.CP_FACE_X_NEG, PMREMGenerator.CP_EDGE_RIGHT], + [PMREMGenerator.CP_FACE_X_POS, PMREMGenerator.CP_EDGE_LEFT], + [PMREMGenerator.CP_FACE_Y_POS, PMREMGenerator.CP_EDGE_BOTTOM], + [PMREMGenerator.CP_FACE_Y_NEG, PMREMGenerator.CP_EDGE_TOP]], + //ZNEG face + [[PMREMGenerator.CP_FACE_X_POS, PMREMGenerator.CP_EDGE_RIGHT], + [PMREMGenerator.CP_FACE_X_NEG, PMREMGenerator.CP_EDGE_LEFT], + [PMREMGenerator.CP_FACE_Y_POS, PMREMGenerator.CP_EDGE_TOP], + [PMREMGenerator.CP_FACE_Y_NEG, PMREMGenerator.CP_EDGE_BOTTOM]] + ]; + //The 12 edges of the cubemap, (entries are used to index into the neighbor table) + // this table is used to average over the edges. + PMREMGenerator._sgCubeEdgeList = [ + [PMREMGenerator.CP_FACE_X_POS, PMREMGenerator.CP_EDGE_LEFT], + [PMREMGenerator.CP_FACE_X_POS, PMREMGenerator.CP_EDGE_RIGHT], + [PMREMGenerator.CP_FACE_X_POS, PMREMGenerator.CP_EDGE_TOP], + [PMREMGenerator.CP_FACE_X_POS, PMREMGenerator.CP_EDGE_BOTTOM], + [PMREMGenerator.CP_FACE_X_NEG, PMREMGenerator.CP_EDGE_LEFT], + [PMREMGenerator.CP_FACE_X_NEG, PMREMGenerator.CP_EDGE_RIGHT], + [PMREMGenerator.CP_FACE_X_NEG, PMREMGenerator.CP_EDGE_TOP], + [PMREMGenerator.CP_FACE_X_NEG, PMREMGenerator.CP_EDGE_BOTTOM], + [PMREMGenerator.CP_FACE_Z_POS, PMREMGenerator.CP_EDGE_TOP], + [PMREMGenerator.CP_FACE_Z_POS, PMREMGenerator.CP_EDGE_BOTTOM], + [PMREMGenerator.CP_FACE_Z_NEG, PMREMGenerator.CP_EDGE_TOP], + [PMREMGenerator.CP_FACE_Z_NEG, PMREMGenerator.CP_EDGE_BOTTOM] + ]; + //Information about which of the 8 cube corners are correspond to the + // the 4 corners in each cube face + // the order is upper left, upper right, lower left, lower right + PMREMGenerator._sgCubeCornerList = [ + [PMREMGenerator.CP_CORNER_PPP, PMREMGenerator.CP_CORNER_PPN, PMREMGenerator.CP_CORNER_PNP, PMREMGenerator.CP_CORNER_PNN], + [PMREMGenerator.CP_CORNER_NPN, PMREMGenerator.CP_CORNER_NPP, PMREMGenerator.CP_CORNER_NNN, PMREMGenerator.CP_CORNER_NNP], + [PMREMGenerator.CP_CORNER_NPN, PMREMGenerator.CP_CORNER_PPN, PMREMGenerator.CP_CORNER_NPP, PMREMGenerator.CP_CORNER_PPP], + [PMREMGenerator.CP_CORNER_NNP, PMREMGenerator.CP_CORNER_PNP, PMREMGenerator.CP_CORNER_NNN, PMREMGenerator.CP_CORNER_PNN], + [PMREMGenerator.CP_CORNER_NPP, PMREMGenerator.CP_CORNER_PPP, PMREMGenerator.CP_CORNER_NNP, PMREMGenerator.CP_CORNER_PNP], + [PMREMGenerator.CP_CORNER_PPN, PMREMGenerator.CP_CORNER_NPN, PMREMGenerator.CP_CORNER_PNN, PMREMGenerator.CP_CORNER_NNN] // ZNEG face + ]; + return PMREMGenerator; + }()); + Internals.PMREMGenerator = PMREMGenerator; + })(Internals = BABYLON.Internals || (BABYLON.Internals = {})); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.tools.pmremgenerator.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * This represents a texture coming from an HDR input. + * + * The only supported format is currently panorama picture stored in RGBE format. + * Example of such files can be found on HDRLib: http://hdrlib.com/ + */ + var HDRCubeTexture = (function (_super) { + __extends(HDRCubeTexture, _super); + /** + * Instantiates an HDRTexture from the following parameters. + * + * @param url The location of the HDR raw data (Panorama stored in RGBE format) + * @param scene The scene the texture will be used in + * @param size The cubemap desired size (the more it increases the longer the generation will be) If the size is omitted this implies you are using a preprocessed cubemap. + * @param noMipmap Forces to not generate the mipmap if true + * @param generateHarmonics Specifies wether you want to extract the polynomial harmonics during the generation process + * @param useInGammaSpace Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) + * @param usePMREMGenerator Specifies wether or not to generate the CubeMap through CubeMapGen to avoid seams issue at run time. + */ + function HDRCubeTexture(url, scene, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator) { + if (noMipmap === void 0) { noMipmap = false; } + if (generateHarmonics === void 0) { generateHarmonics = true; } + if (useInGammaSpace === void 0) { useInGammaSpace = false; } + if (usePMREMGenerator === void 0) { usePMREMGenerator = false; } + _super.call(this, scene); + this._useInGammaSpace = false; + this._generateHarmonics = true; + this._isBABYLONPreprocessed = false; + /** + * The texture coordinates mode. As this texture is stored in a cube format, please modify carefully. + */ + this.coordinatesMode = BABYLON.Texture.CUBIC_MODE; + /** + * The spherical polynomial data extracted from the texture. + */ + this.sphericalPolynomial = null; + /** + * Specifies wether the texture has been generated through the PMREMGenerator tool. + * This is usefull at run time to apply the good shader. + */ + this.isPMREM = false; + if (!url) { + return; + } + this.name = url; + this.url = url; + this.hasAlpha = false; + this.isCube = true; + this._textureMatrix = BABYLON.Matrix.Identity(); + if (size) { + this._isBABYLONPreprocessed = false; + this._noMipmap = noMipmap; + this._size = size; + this._useInGammaSpace = useInGammaSpace; + this._usePMREMGenerator = usePMREMGenerator && + scene.getEngine().getCaps().textureLOD && + this.getScene().getEngine().getCaps().textureFloat && + !this._useInGammaSpace; + } + else { + this._isBABYLONPreprocessed = true; + this._noMipmap = false; + this._useInGammaSpace = false; + this._usePMREMGenerator = scene.getEngine().getCaps().textureLOD && + this.getScene().getEngine().getCaps().textureFloat && + !this._useInGammaSpace; + } + this.isPMREM = this._usePMREMGenerator; + this._texture = this._getFromCache(url, this._noMipmap); + if (!this._texture) { + if (!scene.useDelayedTextureLoading) { + this.loadTexture(); + } + else { + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED; + } + } + } + /** + * Occurs when the file is a preprocessed .babylon.hdr file. + */ + HDRCubeTexture.prototype.loadBabylonTexture = function () { + var _this = this; + var mipLevels = 0; + var floatArrayView = null; + var mipmapGenerator = (!this._useInGammaSpace && this.getScene().getEngine().getCaps().textureFloat) ? function (data) { + var mips = []; + var startIndex = 30; + for (var level = 0; level < mipLevels; level++) { + mips.push([]); + // Fill each pixel of the mip level. + var faceSize = Math.pow(_this._size >> level, 2) * 3; + for (var faceIndex = 0; faceIndex < 6; faceIndex++) { + var faceData = floatArrayView.subarray(startIndex, startIndex + faceSize); + mips[level].push(faceData); + startIndex += faceSize; + } + } + return mips; + } : null; + var callback = function (buffer) { + // Create Native Array Views + var intArrayView = new Int32Array(buffer); + floatArrayView = new Float32Array(buffer); + // Fill header. + var version = intArrayView[0]; // Version 1. (MAy be use in case of format changes for backward compaibility) + _this._size = intArrayView[1]; // CubeMap max mip face size. + // Update Texture Information. + _this.getScene().getEngine().updateTextureSize(_this._texture, _this._size, _this._size); + // Fill polynomial information. + _this.sphericalPolynomial = new BABYLON.SphericalPolynomial(); + _this.sphericalPolynomial.x.copyFromFloats(floatArrayView[2], floatArrayView[3], floatArrayView[4]); + _this.sphericalPolynomial.y.copyFromFloats(floatArrayView[5], floatArrayView[6], floatArrayView[7]); + _this.sphericalPolynomial.z.copyFromFloats(floatArrayView[8], floatArrayView[9], floatArrayView[10]); + _this.sphericalPolynomial.xx.copyFromFloats(floatArrayView[11], floatArrayView[12], floatArrayView[13]); + _this.sphericalPolynomial.yy.copyFromFloats(floatArrayView[14], floatArrayView[15], floatArrayView[16]); + _this.sphericalPolynomial.zz.copyFromFloats(floatArrayView[17], floatArrayView[18], floatArrayView[19]); + _this.sphericalPolynomial.xy.copyFromFloats(floatArrayView[20], floatArrayView[21], floatArrayView[22]); + _this.sphericalPolynomial.yz.copyFromFloats(floatArrayView[23], floatArrayView[24], floatArrayView[25]); + _this.sphericalPolynomial.zx.copyFromFloats(floatArrayView[26], floatArrayView[27], floatArrayView[28]); + // Fill pixel data. + mipLevels = intArrayView[29]; // Number of mip levels. + var startIndex = 30; + var data = []; + var faceSize = Math.pow(_this._size, 2) * 3; + for (var faceIndex = 0; faceIndex < 6; faceIndex++) { + data.push(floatArrayView.subarray(startIndex, startIndex + faceSize)); + startIndex += faceSize; + } + var results = []; + var byteArray = null; + // Push each faces. + for (var k = 0; k < 6; k++) { + var dataFace = null; + // If special cases. + if (!mipmapGenerator) { + var j = ([0, 2, 4, 1, 3, 5])[k]; // Transforms +X+Y+Z... to +X-X+Y-Y... if no mipmapgenerator... + dataFace = data[j]; + if (!_this.getScene().getEngine().getCaps().textureFloat) { + // 3 channels of 1 bytes per pixel in bytes. + var byteBuffer = new ArrayBuffer(faceSize); + byteArray = new Uint8Array(byteBuffer); + } + for (var i = 0; i < _this._size * _this._size; i++) { + // Put in gamma space if requested. + if (_this._useInGammaSpace) { + dataFace[(i * 3) + 0] = Math.pow(dataFace[(i * 3) + 0], BABYLON.ToGammaSpace); + dataFace[(i * 3) + 1] = Math.pow(dataFace[(i * 3) + 1], BABYLON.ToGammaSpace); + dataFace[(i * 3) + 2] = Math.pow(dataFace[(i * 3) + 2], BABYLON.ToGammaSpace); + } + // Convert to int texture for fallback. + if (byteArray) { + var r = Math.max(dataFace[(i * 3) + 0] * 255, 0); + var g = Math.max(dataFace[(i * 3) + 1] * 255, 0); + var b = Math.max(dataFace[(i * 3) + 2] * 255, 0); + // May use luminance instead if the result is not accurate. + var max = Math.max(Math.max(r, g), b); + if (max > 255) { + var scale = 255 / max; + r *= scale; + g *= scale; + b *= scale; + } + byteArray[(i * 3) + 0] = r; + byteArray[(i * 3) + 1] = g; + byteArray[(i * 3) + 2] = b; + } + } + } + else { + dataFace = data[k]; + } + // Fill the array accordingly. + if (byteArray) { + results.push(byteArray); + } + else { + results.push(dataFace); + } + } + return results; + }; + this._texture = this.getScene().getEngine().createRawCubeTexture(this.url, this.getScene(), this._size, BABYLON.Engine.TEXTUREFORMAT_RGB, this.getScene().getEngine().getCaps().textureFloat ? BABYLON.Engine.TEXTURETYPE_FLOAT : BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT, this._noMipmap, callback, mipmapGenerator); + }; + /** + * Occurs when the file is raw .hdr file. + */ + HDRCubeTexture.prototype.loadHDRTexture = function () { + var _this = this; + var callback = function (buffer) { + // Extract the raw linear data. + var data = BABYLON.Internals.HDRTools.GetCubeMapTextureData(buffer, _this._size); + // Generate harmonics if needed. + if (_this._generateHarmonics) { + _this.sphericalPolynomial = BABYLON.Internals.CubeMapToSphericalPolynomialTools.ConvertCubeMapToSphericalPolynomial(data); + } + var results = []; + var byteArray = null; + // Push each faces. + for (var j = 0; j < 6; j++) { + // Create uintarray fallback. + if (!_this.getScene().getEngine().getCaps().textureFloat) { + // 3 channels of 1 bytes per pixel in bytes. + var byteBuffer = new ArrayBuffer(_this._size * _this._size * 3); + byteArray = new Uint8Array(byteBuffer); + } + var dataFace = data[HDRCubeTexture._facesMapping[j]]; + // If special cases. + if (_this._useInGammaSpace || byteArray) { + for (var i = 0; i < _this._size * _this._size; i++) { + // Put in gamma space if requested. + if (_this._useInGammaSpace) { + dataFace[(i * 3) + 0] = Math.pow(dataFace[(i * 3) + 0], BABYLON.ToGammaSpace); + dataFace[(i * 3) + 1] = Math.pow(dataFace[(i * 3) + 1], BABYLON.ToGammaSpace); + dataFace[(i * 3) + 2] = Math.pow(dataFace[(i * 3) + 2], BABYLON.ToGammaSpace); + } + // Convert to int texture for fallback. + if (byteArray) { + var r = Math.max(dataFace[(i * 3) + 0] * 255, 0); + var g = Math.max(dataFace[(i * 3) + 1] * 255, 0); + var b = Math.max(dataFace[(i * 3) + 2] * 255, 0); + // May use luminance instead if the result is not accurate. + var max = Math.max(Math.max(r, g), b); + if (max > 255) { + var scale = 255 / max; + r *= scale; + g *= scale; + b *= scale; + } + byteArray[(i * 3) + 0] = r; + byteArray[(i * 3) + 1] = g; + byteArray[(i * 3) + 2] = b; + } + } + } + if (byteArray) { + results.push(byteArray); + } + else { + results.push(dataFace); + } + } + return results; + }; + var mipmapGenerator = null; + if (!this._noMipmap && + this._usePMREMGenerator) { + mipmapGenerator = function (data) { + // Custom setup of the generator matching with the PBR shader values. + var generator = new BABYLON.Internals.PMREMGenerator(data, _this._size, _this._size, 0, 3, _this.getScene().getEngine().getCaps().textureFloat, 2048, 0.25, false, true); + return generator.filterCubeMap(); + }; + } + this._texture = this.getScene().getEngine().createRawCubeTexture(this.url, this.getScene(), this._size, BABYLON.Engine.TEXTUREFORMAT_RGB, this.getScene().getEngine().getCaps().textureFloat ? BABYLON.Engine.TEXTURETYPE_FLOAT : BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT, this._noMipmap, callback, mipmapGenerator); + }; + /** + * Starts the loading process of the texture. + */ + HDRCubeTexture.prototype.loadTexture = function () { + if (this._isBABYLONPreprocessed) { + this.loadBabylonTexture(); + } + else { + this.loadHDRTexture(); + } + }; + HDRCubeTexture.prototype.clone = function () { + var size = this._isBABYLONPreprocessed ? null : this._size; + var newTexture = new HDRCubeTexture(this.url, this.getScene(), size, this._noMipmap, this._generateHarmonics, this._useInGammaSpace, this._usePMREMGenerator); + // Base texture + newTexture.level = this.level; + newTexture.wrapU = this.wrapU; + newTexture.wrapV = this.wrapV; + newTexture.coordinatesIndex = this.coordinatesIndex; + newTexture.coordinatesMode = this.coordinatesMode; + return newTexture; + }; + // Methods + HDRCubeTexture.prototype.delayLoad = function () { + if (this.delayLoadState !== BABYLON.Engine.DELAYLOADSTATE_NOTLOADED) { + return; + } + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADED; + this._texture = this._getFromCache(this.url, this._noMipmap); + if (!this._texture) { + this.loadTexture(); + } + }; + HDRCubeTexture.prototype.getReflectionTextureMatrix = function () { + return this._textureMatrix; + }; + HDRCubeTexture.Parse = function (parsedTexture, scene, rootUrl) { + var texture = null; + if (parsedTexture.name && !parsedTexture.isRenderTarget) { + var size = parsedTexture.isBABYLONPreprocessed ? null : parsedTexture.size; + texture = new BABYLON.HDRCubeTexture(rootUrl + parsedTexture.name, scene, size, parsedTexture.generateHarmonics, parsedTexture.useInGammaSpace, parsedTexture.usePMREMGenerator); + texture.name = parsedTexture.name; + texture.hasAlpha = parsedTexture.hasAlpha; + texture.level = parsedTexture.level; + texture.coordinatesMode = parsedTexture.coordinatesMode; + } + return texture; + }; + HDRCubeTexture.prototype.serialize = function () { + if (!this.name) { + return null; + } + var serializationObject = {}; + serializationObject.name = this.name; + serializationObject.hasAlpha = this.hasAlpha; + serializationObject.isCube = true; + serializationObject.level = this.level; + serializationObject.size = this._size; + serializationObject.coordinatesMode = this.coordinatesMode; + serializationObject.useInGammaSpace = this._useInGammaSpace; + serializationObject.generateHarmonics = this._generateHarmonics; + serializationObject.usePMREMGenerator = this._usePMREMGenerator; + serializationObject.isBABYLONPreprocessed = this._isBABYLONPreprocessed; + serializationObject.customType = "BABYLON.HDRCubeTexture"; + return serializationObject; + }; + /** + * Saves as a file the data contained in the texture in a binary format. + * This can be used to prevent the long loading tie associated with creating the seamless texture as well + * as the spherical used in the lighting. + * @param url The HDR file url. + * @param size The size of the texture data to generate (one of the cubemap face desired width). + * @param onError Method called if any error happens during download. + * @return The packed binary data. + */ + HDRCubeTexture.generateBabylonHDROnDisk = function (url, size, onError) { + if (onError === void 0) { onError = null; } + var callback = function (buffer) { + var data = new Blob([buffer], { type: 'application/octet-stream' }); + // Returns a URL you can use as a href. + var objUrl = window.URL.createObjectURL(data); + // Simulates a link to it and click to dowload. + var a = document.createElement("a"); + document.body.appendChild(a); + a.style.display = "none"; + a.href = objUrl; + a.download = "envmap.babylon.hdr"; + a.click(); + }; + HDRCubeTexture.generateBabylonHDR(url, size, callback, onError); + }; + /** + * Serializes the data contained in the texture in a binary format. + * This can be used to prevent the long loading tie associated with creating the seamless texture as well + * as the spherical used in the lighting. + * @param url The HDR file url. + * @param size The size of the texture data to generate (one of the cubemap face desired width). + * @param onError Method called if any error happens during download. + * @return The packed binary data. + */ + HDRCubeTexture.generateBabylonHDR = function (url, size, callback, onError) { + if (onError === void 0) { onError = null; } + // Needs the url tho create the texture. + if (!url) { + return null; + } + // Check Power of two size. + if (!BABYLON.Tools.IsExponentOfTwo(size)) { + return null; + } + var getDataCallback = function (dataBuffer) { + // Extract the raw linear data. + var cubeData = BABYLON.Internals.HDRTools.GetCubeMapTextureData(dataBuffer, size); + // Generate harmonics if needed. + var sphericalPolynomial = BABYLON.Internals.CubeMapToSphericalPolynomialTools.ConvertCubeMapToSphericalPolynomial(cubeData); + // Generate seamless faces + var mipGeneratorArray = []; + // Data are known to be in +X +Y +Z -X -Y -Z + // mipmmapGenerator data is expected to be order in +X -X +Y -Y +Z -Z + mipGeneratorArray.push(cubeData.right); // +X + mipGeneratorArray.push(cubeData.left); // -X + mipGeneratorArray.push(cubeData.up); // +Y + mipGeneratorArray.push(cubeData.down); // -Y + mipGeneratorArray.push(cubeData.front); // +Z + mipGeneratorArray.push(cubeData.back); // -Z + // Custom setup of the generator matching with the PBR shader values. + var generator = new BABYLON.Internals.PMREMGenerator(mipGeneratorArray, size, size, 0, 3, true, 2048, 0.25, false, true); + var mippedData = generator.filterCubeMap(); + // Compute required byte length. + var byteLength = 1 * 4; // Raw Data Version int32. + byteLength += 4; // CubeMap max mip face size int32. + byteLength += (9 * 3 * 4); // Spherical polynomial byte length 9 Vector 3 of floats. + // Add data size. + byteLength += 4; // Number of mip levels int32. + for (var level = 0; level < mippedData.length; level++) { + var mipSize = size >> level; + byteLength += (6 * mipSize * mipSize * 3 * 4); // 6 faces of size squared rgb float pixels. + } + // Prepare binary structure. + var buffer = new ArrayBuffer(byteLength); + var intArrayView = new Int32Array(buffer); + var floatArrayView = new Float32Array(buffer); + // Fill header. + intArrayView[0] = 1; // Version 1. + intArrayView[1] = size; // CubeMap max mip face size. + // Fill polynomial information. + sphericalPolynomial.x.toArray(floatArrayView, 2); + sphericalPolynomial.y.toArray(floatArrayView, 5); + sphericalPolynomial.z.toArray(floatArrayView, 8); + sphericalPolynomial.xx.toArray(floatArrayView, 11); + sphericalPolynomial.yy.toArray(floatArrayView, 14); + sphericalPolynomial.zz.toArray(floatArrayView, 17); + sphericalPolynomial.xy.toArray(floatArrayView, 20); + sphericalPolynomial.yz.toArray(floatArrayView, 23); + sphericalPolynomial.zx.toArray(floatArrayView, 26); + // Fill pixel data. + intArrayView[29] = mippedData.length; // Number of mip levels. + var startIndex = 30; + for (var level = 0; level < mippedData.length; level++) { + // Fill each pixel of the mip level. + var faceSize = Math.pow(size >> level, 2) * 3; + for (var faceIndex = 0; faceIndex < 6; faceIndex++) { + floatArrayView.set(mippedData[level][faceIndex], startIndex); + startIndex += faceSize; + } + } + // Callback. + callback(buffer); + }; + // Download and process. + BABYLON.Tools.LoadFile(url, function (data) { + getDataCallback(data); + }, null, null, true, onError); + }; + HDRCubeTexture._facesMapping = [ + "right", + "up", + "front", + "left", + "down", + "back" + ]; + return HDRCubeTexture; + }(BABYLON.BaseTexture)); + BABYLON.HDRCubeTexture = HDRCubeTexture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.hdrCubeTexture.js.map + +var BABYLON; +(function (BABYLON) { + var Debug; + (function (Debug) { + /** + * Demo available here: http://www.babylonjs-playground.com/#1BZJVJ#8 + */ + var SkeletonViewer = (function () { + function SkeletonViewer(skeleton, mesh, scene, autoUpdateBonesMatrices, renderingGroupId) { + if (autoUpdateBonesMatrices === void 0) { autoUpdateBonesMatrices = true; } + if (renderingGroupId === void 0) { renderingGroupId = 1; } + this.skeleton = skeleton; + this.mesh = mesh; + this.autoUpdateBonesMatrices = autoUpdateBonesMatrices; + this.renderingGroupId = renderingGroupId; + this.color = BABYLON.Color3.White(); + this._debugLines = []; + this._isEnabled = false; + this._scene = scene; + this.update(); + this._renderFunction = this.update.bind(this); + } + Object.defineProperty(SkeletonViewer.prototype, "isEnabled", { + get: function () { + return this._isEnabled; + }, + set: function (value) { + if (this._isEnabled === value) { + return; + } + this._isEnabled = value; + if (value) { + this._scene.registerBeforeRender(this._renderFunction); + } + else { + this._scene.unregisterBeforeRender(this._renderFunction); + } + }, + enumerable: true, + configurable: true + }); + SkeletonViewer.prototype._getBonePosition = function (position, bone, meshMat, x, y, z) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + if (z === void 0) { z = 0; } + var tmat = BABYLON.Tmp.Matrix[0]; + var parentBone = bone.getParent(); + tmat.copyFrom(bone.getLocalMatrix()); + if (x !== 0 || y !== 0 || z !== 0) { + var tmat2 = BABYLON.Tmp.Matrix[1]; + BABYLON.Matrix.IdentityToRef(tmat2); + tmat2.m[12] = x; + tmat2.m[13] = y; + tmat2.m[14] = z; + tmat2.multiplyToRef(tmat, tmat); + } + if (parentBone) { + tmat.multiplyToRef(parentBone.getAbsoluteTransform(), tmat); + } + tmat.multiplyToRef(meshMat, tmat); + position.x = tmat.m[12]; + position.y = tmat.m[13]; + position.z = tmat.m[14]; + }; + SkeletonViewer.prototype._getLinesForBonesWithLength = function (bones, meshMat) { + var len = bones.length; + for (var i = 0; i < len; i++) { + var bone = bones[i]; + var points = this._debugLines[i]; + if (!points) { + points = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()]; + this._debugLines[i] = points; + } + this._getBonePosition(points[0], bone, meshMat); + this._getBonePosition(points[1], bone, meshMat, 0, bone.length, 0); + } + }; + SkeletonViewer.prototype._getLinesForBonesNoLength = function (bones, meshMat) { + var len = bones.length; + var boneNum = 0; + for (var i = len - 1; i >= 0; i--) { + var childBone = bones[i]; + var parentBone = childBone.getParent(); + if (!parentBone) { + continue; + } + var points = this._debugLines[boneNum]; + if (!points) { + points = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()]; + this._debugLines[boneNum] = points; + } + childBone.getAbsolutePositionToRef(this.mesh, points[0]); + parentBone.getAbsolutePositionToRef(this.mesh, points[1]); + boneNum++; + } + }; + SkeletonViewer.prototype.update = function () { + if (this.autoUpdateBonesMatrices) { + this.skeleton.computeAbsoluteTransforms(); + } + if (this.skeleton.bones[0].length === undefined) { + this._getLinesForBonesNoLength(this.skeleton.bones, this.mesh.getWorldMatrix()); + } + else { + this._getLinesForBonesWithLength(this.skeleton.bones, this.mesh.getWorldMatrix()); + } + if (!this._debugMesh) { + this._debugMesh = BABYLON.MeshBuilder.CreateLineSystem(null, { lines: this._debugLines, updatable: true }, this._scene); + this._debugMesh.renderingGroupId = this.renderingGroupId; + } + else { + BABYLON.MeshBuilder.CreateLineSystem(null, { lines: this._debugLines, updatable: true, instance: this._debugMesh }, this._scene); + } + this._debugMesh.color = this.color; + }; + SkeletonViewer.prototype.dispose = function () { + if (this._debugMesh) { + this.isEnabled = false; + this._debugMesh.dispose(); + this._debugMesh = null; + } + }; + return SkeletonViewer; + }()); + Debug.SkeletonViewer = SkeletonViewer; + })(Debug = BABYLON.Debug || (BABYLON.Debug = {})); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.skeletonViewer.js.map + +var BABYLON; +(function (BABYLON) { + var Debug; + (function (Debug) { + var AxesViewer = (function () { + function AxesViewer(scene, scaleLines) { + if (scaleLines === void 0) { scaleLines = 1; } + this._xline = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()]; + this._yline = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()]; + this._zline = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()]; + this.scaleLines = 1; + this.scaleLines = scaleLines; + this._xmesh = BABYLON.Mesh.CreateLines("xline", this._xline, scene, true); + this._ymesh = BABYLON.Mesh.CreateLines("yline", this._yline, scene, true); + this._zmesh = BABYLON.Mesh.CreateLines("zline", this._zline, scene, true); + this._xmesh.renderingGroupId = 2; + this._ymesh.renderingGroupId = 2; + this._zmesh.renderingGroupId = 2; + this._xmesh.material.checkReadyOnlyOnce = true; + this._xmesh.color = new BABYLON.Color3(1, 0, 0); + this._ymesh.material.checkReadyOnlyOnce = true; + this._ymesh.color = new BABYLON.Color3(0, 1, 0); + this._zmesh.material.checkReadyOnlyOnce = true; + this._zmesh.color = new BABYLON.Color3(0, 0, 1); + this.scene = scene; + } + AxesViewer.prototype.update = function (position, xaxis, yaxis, zaxis) { + var scaleLines = this.scaleLines; + var point1 = this._xline[0]; + var point2 = this._xline[1]; + point1.x = position.x; + point1.y = position.y; + point1.z = position.z; + point2.x = point1.x + xaxis.x * scaleLines; + point2.y = point1.y + xaxis.y * scaleLines; + point2.z = point1.z + xaxis.z * scaleLines; + BABYLON.Mesh.CreateLines(null, this._xline, null, null, this._xmesh); + point1 = this._yline[0]; + point2 = this._yline[1]; + point1.x = position.x; + point1.y = position.y; + point1.z = position.z; + point2.x = point1.x + yaxis.x * scaleLines; + point2.y = point1.y + yaxis.y * scaleLines; + point2.z = point1.z + yaxis.z * scaleLines; + BABYLON.Mesh.CreateLines(null, this._yline, null, null, this._ymesh); + point1 = this._zline[0]; + point2 = this._zline[1]; + point1.x = position.x; + point1.y = position.y; + point1.z = position.z; + point2.x = point1.x + zaxis.x * scaleLines; + point2.y = point1.y + zaxis.y * scaleLines; + point2.z = point1.z + zaxis.z * scaleLines; + BABYLON.Mesh.CreateLines(null, this._zline, null, null, this._zmesh); + }; + AxesViewer.prototype.dispose = function () { + if (this._xmesh) { + this._xmesh.dispose(); + this._ymesh.dispose(); + this._zmesh.dispose(); + this._xmesh = null; + this._ymesh = null; + this._zmesh = null; + this._xline = null; + this._yline = null; + this._zline = null; + this.scene = null; + } + }; + return AxesViewer; + }()); + Debug.AxesViewer = AxesViewer; + })(Debug = BABYLON.Debug || (BABYLON.Debug = {})); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.axesViewer.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var Debug; + (function (Debug) { + var BoneAxesViewer = (function (_super) { + __extends(BoneAxesViewer, _super); + function BoneAxesViewer(scene, bone, mesh, scaleLines) { + if (scaleLines === void 0) { scaleLines = 1; } + _super.call(this, scene, scaleLines); + this.pos = BABYLON.Vector3.Zero(); + this.xaxis = BABYLON.Vector3.Zero(); + this.yaxis = BABYLON.Vector3.Zero(); + this.zaxis = BABYLON.Vector3.Zero(); + this.mesh = mesh; + this.bone = bone; + } + BoneAxesViewer.prototype.update = function () { + var bone = this.bone; + bone.getAbsolutePositionToRef(this.mesh, this.pos); + bone.getDirectionToRef(BABYLON.Axis.X, this.mesh, this.xaxis); + bone.getDirectionToRef(BABYLON.Axis.Y, this.mesh, this.yaxis); + bone.getDirectionToRef(BABYLON.Axis.Z, this.mesh, this.zaxis); + _super.prototype.update.call(this, this.pos, this.xaxis, this.yaxis, this.zaxis); + }; + BoneAxesViewer.prototype.dispose = function () { + if (this.pos) { + this.pos = null; + this.xaxis = null; + this.yaxis = null; + this.zaxis = null; + this.mesh = null; + this.bone = null; + _super.prototype.dispose.call(this); + } + }; + return BoneAxesViewer; + }(Debug.AxesViewer)); + Debug.BoneAxesViewer = BoneAxesViewer; + })(Debug = BABYLON.Debug || (BABYLON.Debug = {})); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.boneAxesViewer.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * This represents a color grading texture. This acts as a lookup table LUT, useful during post process + * It can help converting any input color in a desired output one. This can then be used to create effects + * from sepia, black and white to sixties or futuristic rendering... + * + * The only supported format is currently 3dl. + * More information on LUT: https://en.wikipedia.org/wiki/3D_lookup_table/ + */ + var ColorGradingTexture = (function (_super) { + __extends(ColorGradingTexture, _super); + /** + * Instantiates a ColorGradingTexture from the following parameters. + * + * @param url The location of the color gradind data (currently only supporting 3dl) + * @param scene The scene the texture will be used in + */ + function ColorGradingTexture(url, scene) { + _super.call(this, scene); + if (!url) { + return; + } + this._textureMatrix = BABYLON.Matrix.Identity(); + this.name = url; + this.url = url; + this.hasAlpha = false; + this.isCube = false; + this.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; + this.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; + this.anisotropicFilteringLevel = 1; + this._texture = this._getFromCache(url, true); + if (!this._texture) { + if (!scene.useDelayedTextureLoading) { + this.loadTexture(); + } + else { + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED; + } + } + } + /** + * Returns the texture matrix used in most of the material. + * This is not used in color grading but keep for troubleshooting purpose (easily swap diffuse by colorgrading to look in). + */ + ColorGradingTexture.prototype.getTextureMatrix = function () { + return this._textureMatrix; + }; + /** + * Occurs when the file being loaded is a .3dl LUT file. + */ + ColorGradingTexture.prototype.load3dlTexture = function () { + var _this = this; + var mipLevels = 0; + var floatArrayView = null; + var texture = this.getScene().getEngine().createRawTexture(null, 1, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA, false, false, BABYLON.Texture.BILINEAR_SAMPLINGMODE); + this._texture = texture; + var callback = function (text) { + var data; + var tempData; + var line; + var lines = text.split('\n'); + var size = 0, pixelIndexW = 0, pixelIndexH = 0, pixelIndexSlice = 0; + var maxColor = 0; + for (var i = 0; i < lines.length; i++) { + line = lines[i]; + if (!ColorGradingTexture._noneEmptyLineRegex.test(line)) + continue; + if (line.indexOf('#') === 0) + continue; + var words = line.split(" "); + if (size === 0) { + // Number of space + one + size = words.length; + data = new Uint8Array(size * size * size * 4); // volume texture of side size and rgb 8 + tempData = new Float32Array(size * size * size * 4); + continue; + } + if (size != 0) { + var r = Math.max(parseInt(words[0]), 0); + var g = Math.max(parseInt(words[1]), 0); + var b = Math.max(parseInt(words[2]), 0); + maxColor = Math.max(r, maxColor); + maxColor = Math.max(g, maxColor); + maxColor = Math.max(b, maxColor); + var pixelStorageIndex = (pixelIndexW + pixelIndexSlice * size + pixelIndexH * size * size) * 4; + tempData[pixelStorageIndex + 0] = r; + tempData[pixelStorageIndex + 1] = g; + tempData[pixelStorageIndex + 2] = b; + tempData[pixelStorageIndex + 3] = 0; + pixelIndexSlice++; + if (pixelIndexSlice % size == 0) { + pixelIndexH++; + pixelIndexSlice = 0; + if (pixelIndexH % size == 0) { + pixelIndexW++; + pixelIndexH = 0; + } + } + } + } + for (var i = 0; i < tempData.length; i++) { + var value = tempData[i]; + data[i] = (value / maxColor * 255); + } + _this.getScene().getEngine().updateTextureSize(texture, size * size, size); + _this.getScene().getEngine().updateRawTexture(texture, data, BABYLON.Engine.TEXTUREFORMAT_RGBA, false); + }; + BABYLON.Tools.LoadFile(this.url, callback); + return this._texture; + }; + /** + * Starts the loading process of the texture. + */ + ColorGradingTexture.prototype.loadTexture = function () { + if (this.url && this.url.toLocaleLowerCase().indexOf(".3dl") == (this.url.length - 4)) { + this.load3dlTexture(); + } + }; + /** + * Clones the color gradind texture. + */ + ColorGradingTexture.prototype.clone = function () { + var newTexture = new ColorGradingTexture(this.url, this.getScene()); + // Base texture + newTexture.level = this.level; + return newTexture; + }; + /** + * Called during delayed load for textures. + */ + ColorGradingTexture.prototype.delayLoad = function () { + if (this.delayLoadState !== BABYLON.Engine.DELAYLOADSTATE_NOTLOADED) { + return; + } + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADED; + this._texture = this._getFromCache(this.url, true); + if (!this._texture) { + this.loadTexture(); + } + }; + /** + * Binds the color grading to the shader. + * @param colorGrading The texture to bind + * @param effect The effect to bind to + */ + ColorGradingTexture.Bind = function (colorGrading, effect) { + effect.setTexture("cameraColorGrading2DSampler", colorGrading); + var x = colorGrading.level; // Texture Level + var y = colorGrading.getSize().height; // Texture Size example with 8 + var z = y - 1.0; // SizeMinusOne 8 - 1 + var w = 1 / y; // Space of 1 slice 1 / 8 + effect.setFloat4("vCameraColorGradingInfos", x, y, z, w); + var slicePixelSizeU = w / y; // Space of 1 pixel in U direction, e.g. 1/64 + var slicePixelSizeV = w; // Space of 1 pixel in V direction, e.g. 1/8 // Space of 1 pixel in V direction, e.g. 1/8 + var x2 = z * slicePixelSizeU; // Extent of lookup range in U for a single slice so that range corresponds to (size-1) texels, for example 7/64 + var y2 = z / y; // Extent of lookup range in V for a single slice so that range corresponds to (size-1) texels, for example 7/8 + var z2 = 0.5 * slicePixelSizeU; // Offset of lookup range in U to align sample position with texel centre, for example 0.5/64 + var w2 = 0.5 * slicePixelSizeV; // Offset of lookup range in V to align sample position with texel centre, for example 0.5/8 + effect.setFloat4("vCameraColorGradingScaleOffset", x2, y2, z2, w2); + }; + /** + * Prepare the list of uniforms associated with the ColorGrading effects. + * @param uniformsList The list of uniforms used in the effect + * @param samplersList The list of samplers used in the effect + */ + ColorGradingTexture.PrepareUniformsAndSamplers = function (uniformsList, samplersList) { + uniformsList.push("vCameraColorGradingInfos", "vCameraColorGradingScaleOffset"); + samplersList.push("cameraColorGrading2DSampler"); + }; + /** + * Parses a color grading texture serialized by Babylon. + * @param parsedTexture The texture information being parsedTexture + * @param scene The scene to load the texture in + * @param rootUrl The root url of the data assets to load + * @return A color gradind texture + */ + ColorGradingTexture.Parse = function (parsedTexture, scene, rootUrl) { + var texture = null; + if (parsedTexture.name && !parsedTexture.isRenderTarget) { + texture = new BABYLON.ColorGradingTexture(parsedTexture.name, scene); + texture.name = parsedTexture.name; + texture.level = parsedTexture.level; + } + return texture; + }; + /** + * Serializes the LUT texture to json format. + */ + ColorGradingTexture.prototype.serialize = function () { + if (!this.name) { + return null; + } + var serializationObject = {}; + serializationObject.name = this.name; + serializationObject.level = this.level; + serializationObject.customType = "BABYLON.ColorGradingTexture"; + return serializationObject; + }; + /** + * Empty line regex stored for GC. + */ + ColorGradingTexture._noneEmptyLineRegex = /\S+/; + return ColorGradingTexture; + }(BABYLON.BaseTexture)); + BABYLON.ColorGradingTexture = ColorGradingTexture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.colorGradingTexture.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT). + * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects. + * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image; + * corresponding to low luminance, medium luminance, and high luminance areas respectively. + */ + var ColorCurves = (function () { + function ColorCurves() { + this._dirty = true; + this._tempColor = new BABYLON.Color4(0, 0, 0, 0); + this._globalCurve = new BABYLON.Color4(0, 0, 0, 0); + this._highlightsCurve = new BABYLON.Color4(0, 0, 0, 0); + this._midtonesCurve = new BABYLON.Color4(0, 0, 0, 0); + this._shadowsCurve = new BABYLON.Color4(0, 0, 0, 0); + this._positiveCurve = new BABYLON.Color4(0, 0, 0, 0); + this._negativeCurve = new BABYLON.Color4(0, 0, 0, 0); + this._globalHue = 30; + this._globalDensity = 0; + this._globalSaturation = 0; + this._globalExposure = 0; + this._highlightsHue = 30; + this._highlightsDensity = 0; + this._highlightsSaturation = 0; + this._highlightsExposure = 0; + this._midtonesHue = 30; + this._midtonesDensity = 0; + this._midtonesSaturation = 0; + this._midtonesExposure = 0; + this._shadowsHue = 30; + this._shadowsDensity = 0; + this._shadowsSaturation = 0; + this._shadowsExposure = 0; + } + Object.defineProperty(ColorCurves.prototype, "GlobalHue", { + /** + * Gets the global Hue value. + * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange). + */ + get: function () { + return this._globalHue; + }, + /** + * Sets the global Hue value. + * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange). + */ + set: function (value) { + this._globalHue = value; + this._dirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColorCurves.prototype, "GlobalDensity", { + /** + * Gets the global Density value. + * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect. + * Values less than zero provide a filter of opposite hue. + */ + get: function () { + return this._globalDensity; + }, + /** + * Sets the global Density value. + * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect. + * Values less than zero provide a filter of opposite hue. + */ + set: function (value) { + this._globalDensity = value; + this._dirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColorCurves.prototype, "GlobalSaturation", { + /** + * Gets the global Saturation value. + * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation. + */ + get: function () { + return this._globalSaturation; + }, + /** + * Sets the global Saturation value. + * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation. + */ + set: function (value) { + this._globalSaturation = value; + this._dirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColorCurves.prototype, "HighlightsHue", { + /** + * Gets the highlights Hue value. + * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange). + */ + get: function () { + return this._highlightsHue; + }, + /** + * Sets the highlights Hue value. + * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange). + */ + set: function (value) { + this._highlightsHue = value; + this._dirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColorCurves.prototype, "HighlightsDensity", { + /** + * Gets the highlights Density value. + * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect. + * Values less than zero provide a filter of opposite hue. + */ + get: function () { + return this._highlightsDensity; + }, + /** + * Sets the highlights Density value. + * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect. + * Values less than zero provide a filter of opposite hue. + */ + set: function (value) { + this._highlightsDensity = value; + this._dirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColorCurves.prototype, "HighlightsSaturation", { + /** + * Gets the highlights Saturation value. + * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation. + */ + get: function () { + return this._highlightsSaturation; + }, + /** + * Sets the highlights Saturation value. + * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation. + */ + set: function (value) { + this._highlightsSaturation = value; + this._dirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColorCurves.prototype, "HighlightsExposure", { + /** + * Gets the highlights Exposure value. + * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure. + */ + get: function () { + return this._highlightsExposure; + }, + /** + * Sets the highlights Exposure value. + * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure. + */ + set: function (value) { + this._highlightsExposure = value; + this._dirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColorCurves.prototype, "MidtonesHue", { + /** + * Gets the midtones Hue value. + * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange). + */ + get: function () { + return this._midtonesHue; + }, + /** + * Sets the midtones Hue value. + * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange). + */ + set: function (value) { + this._midtonesHue = value; + this._dirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColorCurves.prototype, "MidtonesDensity", { + /** + * Gets the midtones Density value. + * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect. + * Values less than zero provide a filter of opposite hue. + */ + get: function () { + return this._midtonesDensity; + }, + /** + * Sets the midtones Density value. + * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect. + * Values less than zero provide a filter of opposite hue. + */ + set: function (value) { + this._midtonesDensity = value; + this._dirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColorCurves.prototype, "MidtonesSaturation", { + /** + * Gets the midtones Saturation value. + * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation. + */ + get: function () { + return this._midtonesSaturation; + }, + /** + * Sets the midtones Saturation value. + * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation. + */ + set: function (value) { + this._midtonesSaturation = value; + this._dirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColorCurves.prototype, "MidtonesExposure", { + /** + * Gets the midtones Exposure value. + * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure. + */ + get: function () { + return this._midtonesExposure; + }, + /** + * Sets the midtones Exposure value. + * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure. + */ + set: function (value) { + this._midtonesExposure = value; + this._dirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColorCurves.prototype, "ShadowsHue", { + /** + * Gets the shadows Hue value. + * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange). + */ + get: function () { + return this._shadowsHue; + }, + /** + * Sets the shadows Hue value. + * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange). + */ + set: function (value) { + this._shadowsHue = value; + this._dirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColorCurves.prototype, "ShadowsDensity", { + /** + * Gets the shadows Density value. + * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect. + * Values less than zero provide a filter of opposite hue. + */ + get: function () { + return this._shadowsDensity; + }, + /** + * Sets the shadows Density value. + * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect. + * Values less than zero provide a filter of opposite hue. + */ + set: function (value) { + this._shadowsDensity = value; + this._dirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColorCurves.prototype, "ShadowsSaturation", { + /** + * Gets the shadows Saturation value. + * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation. + */ + get: function () { + return this._shadowsSaturation; + }, + /** + * Sets the shadows Saturation value. + * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation. + */ + set: function (value) { + this._shadowsSaturation = value; + this._dirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColorCurves.prototype, "ShadowsExposure", { + /** + * Gets the shadows Exposure value. + * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure. + */ + get: function () { + return this._shadowsExposure; + }, + /** + * Sets the shadows Exposure value. + * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure. + */ + set: function (value) { + this._shadowsExposure = value; + this._dirty = true; + }, + enumerable: true, + configurable: true + }); + /** + * Binds the color curves to the shader. + * @param colorCurves The color curve to bind + * @param effect The effect to bind to + */ + ColorCurves.Bind = function (colorCurves, effect) { + if (colorCurves._dirty) { + colorCurves._dirty = false; + // Fill in global info. + colorCurves.getColorGradingDataToRef(colorCurves._globalHue, colorCurves._globalDensity, colorCurves._globalSaturation, colorCurves._globalExposure, colorCurves._globalCurve); + // Compute highlights info. + colorCurves.getColorGradingDataToRef(colorCurves._highlightsHue, colorCurves._highlightsDensity, colorCurves._highlightsSaturation, colorCurves._highlightsExposure, colorCurves._tempColor); + colorCurves._tempColor.multiplyToRef(colorCurves._globalCurve, colorCurves._highlightsCurve); + // Compute midtones info. + colorCurves.getColorGradingDataToRef(colorCurves._midtonesHue, colorCurves._midtonesDensity, colorCurves._midtonesSaturation, colorCurves._midtonesExposure, colorCurves._tempColor); + colorCurves._tempColor.multiplyToRef(colorCurves._globalCurve, colorCurves._midtonesCurve); + // Compute shadows info. + colorCurves.getColorGradingDataToRef(colorCurves._shadowsHue, colorCurves._shadowsDensity, colorCurves._shadowsSaturation, colorCurves._shadowsExposure, colorCurves._tempColor); + colorCurves._tempColor.multiplyToRef(colorCurves._globalCurve, colorCurves._shadowsCurve); + // Compute deltas (neutral is midtones). + colorCurves._highlightsCurve.subtractToRef(colorCurves._midtonesCurve, colorCurves._positiveCurve); + colorCurves._midtonesCurve.subtractToRef(colorCurves._shadowsCurve, colorCurves._negativeCurve); + } + effect.setFloat4("vCameraColorCurvePositive", colorCurves._positiveCurve.r, colorCurves._positiveCurve.g, colorCurves._positiveCurve.b, colorCurves._positiveCurve.a); + effect.setFloat4("vCameraColorCurveNeutral", colorCurves._midtonesCurve.r, colorCurves._midtonesCurve.g, colorCurves._midtonesCurve.b, colorCurves._midtonesCurve.a); + effect.setFloat4("vCameraColorCurveNegative", colorCurves._negativeCurve.r, colorCurves._negativeCurve.g, colorCurves._negativeCurve.b, colorCurves._negativeCurve.a); + }; + /** + * Prepare the list of uniforms associated with the ColorCurves effects. + * @param uniformsList The list of uniforms used in the effect + */ + ColorCurves.PrepareUniforms = function (uniformsList) { + uniformsList.push("vCameraColorCurveNeutral", "vCameraColorCurvePositive", "vCameraColorCurveNegative"); + }; + /** + * Returns color grading data based on a hue, density, saturation and exposure value. + * @param filterHue The hue of the color filter. + * @param filterDensity The density of the color filter. + * @param saturation The saturation. + * @param exposure The exposure. + * @param result The result data container. + */ + ColorCurves.prototype.getColorGradingDataToRef = function (hue, density, saturation, exposure, result) { + if (hue == null) { + return; + } + hue = ColorCurves.clamp(hue, 0, 360); + density = ColorCurves.clamp(density, -100, 100); + saturation = ColorCurves.clamp(saturation, -100, 100); + exposure = ColorCurves.clamp(exposure, -100, 100); + // Remap the slider/config filter density with non-linear mapping and also scale by half + // so that the maximum filter density is only 50% control. This provides fine control + // for small values and reasonable range. + density = ColorCurves.applyColorGradingSliderNonlinear(density); + density *= 0.5; + exposure = ColorCurves.applyColorGradingSliderNonlinear(exposure); + if (density < 0) { + density *= -1; + hue = (hue + 180) % 360; + } + ColorCurves.fromHSBToRef(hue, density, 50 + 0.25 * exposure, result); + result.scaleToRef(2, result); + result.a = 1 + 0.01 * saturation; + }; + /** + * Takes an input slider value and returns an adjusted value that provides extra control near the centre. + * @param value The input slider value in range [-100,100]. + * @returns Adjusted value. + */ + ColorCurves.applyColorGradingSliderNonlinear = function (value) { + value /= 100; + var x = Math.abs(value); + x = Math.pow(x, 2); + if (value < 0) { + x *= -1; + } + x *= 100; + return x; + }; + /** + * Returns an RGBA Color4 based on Hue, Saturation and Brightness (also referred to as value, HSV). + * @param hue The hue (H) input. + * @param saturation The saturation (S) input. + * @param brightness The brightness (B) input. + * @result An RGBA color represented as Vector4. + */ + ColorCurves.fromHSBToRef = function (hue, saturation, brightness, result) { + var h = ColorCurves.clamp(hue, 0, 360); + var s = ColorCurves.clamp(saturation / 100, 0, 1); + var v = ColorCurves.clamp(brightness / 100, 0, 1); + if (s === 0) { + result.r = v; + result.g = v; + result.b = v; + } + else { + // sector 0 to 5 + h /= 60; + var i = Math.floor(h); + // fractional part of h + var f = h - i; + var p = v * (1 - s); + var q = v * (1 - s * f); + var t = v * (1 - s * (1 - f)); + switch (i) { + case 0: + result.r = v; + result.g = t; + result.b = p; + break; + case 1: + result.r = q; + result.g = v; + result.b = p; + break; + case 2: + result.r = p; + result.g = v; + result.b = t; + break; + case 3: + result.r = p; + result.g = q; + result.b = v; + break; + case 4: + result.r = t; + result.g = p; + result.b = v; + break; + default: + result.r = v; + result.g = p; + result.b = q; + break; + } + } + result.a = 1; + }; + /** + * Returns a value clamped between min and max + * @param value The value to clamp + * @param min The minimum of value + * @param max The maximum of value + * @returns The clamped value. + */ + ColorCurves.clamp = function (value, min, max) { + return Math.min(Math.max(value, min), max); + }; + /** + * Clones the current color curve instance. + * @return The cloned curves + */ + ColorCurves.prototype.clone = function () { + return BABYLON.SerializationHelper.Clone(function () { return new ColorCurves(); }, this); + }; + /** + * Serializes the current color curve instance to a json representation. + * @return a JSON representation + */ + ColorCurves.prototype.serialize = function () { + return BABYLON.SerializationHelper.Serialize(this); + }; + /** + * Parses the color curve from a json representation. + * @param source the JSON source to parse + * @return The parsed curves + */ + ColorCurves.Parse = function (source) { + return BABYLON.SerializationHelper.Parse(function () { return new ColorCurves(); }, source, null, null); + }; + __decorate([ + BABYLON.serialize() + ], ColorCurves.prototype, "_globalHue", void 0); + __decorate([ + BABYLON.serialize() + ], ColorCurves.prototype, "_globalDensity", void 0); + __decorate([ + BABYLON.serialize() + ], ColorCurves.prototype, "_globalSaturation", void 0); + __decorate([ + BABYLON.serialize() + ], ColorCurves.prototype, "_globalExposure", void 0); + __decorate([ + BABYLON.serialize() + ], ColorCurves.prototype, "_highlightsHue", void 0); + __decorate([ + BABYLON.serialize() + ], ColorCurves.prototype, "_highlightsDensity", void 0); + __decorate([ + BABYLON.serialize() + ], ColorCurves.prototype, "_highlightsSaturation", void 0); + __decorate([ + BABYLON.serialize() + ], ColorCurves.prototype, "_highlightsExposure", void 0); + __decorate([ + BABYLON.serialize() + ], ColorCurves.prototype, "_midtonesHue", void 0); + __decorate([ + BABYLON.serialize() + ], ColorCurves.prototype, "_midtonesDensity", void 0); + __decorate([ + BABYLON.serialize() + ], ColorCurves.prototype, "_midtonesSaturation", void 0); + __decorate([ + BABYLON.serialize() + ], ColorCurves.prototype, "_midtonesExposure", void 0); + return ColorCurves; + }()); + BABYLON.ColorCurves = ColorCurves; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.colorCurves.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var PBRMaterialDefines = (function (_super) { + __extends(PBRMaterialDefines, _super); + function PBRMaterialDefines() { + _super.call(this); + this.ALBEDO = false; + this.AMBIENT = false; + this.OPACITY = false; + this.OPACITYRGB = false; + this.REFLECTION = false; + this.EMISSIVE = false; + this.REFLECTIVITY = false; + this.BUMP = false; + this.PARALLAX = false; + this.PARALLAXOCCLUSION = false; + this.SPECULAROVERALPHA = false; + this.CLIPPLANE = false; + this.ALPHATEST = false; + this.ALPHAFROMALBEDO = false; + this.POINTSIZE = false; + this.FOG = false; + this.SPECULARTERM = false; + this.OPACITYFRESNEL = false; + this.EMISSIVEFRESNEL = false; + this.FRESNEL = false; + this.NORMAL = false; + this.UV1 = false; + this.UV2 = false; + this.VERTEXCOLOR = false; + this.VERTEXALPHA = false; + this.NUM_BONE_INFLUENCERS = 0; + this.BonesPerMesh = 0; + this.INSTANCES = false; + this.MICROSURFACEFROMREFLECTIVITYMAP = false; + this.MICROSURFACEAUTOMATIC = false; + this.EMISSIVEASILLUMINATION = false; + this.LINKEMISSIVEWITHALBEDO = false; + this.LIGHTMAP = false; + this.USELIGHTMAPASSHADOWMAP = false; + this.REFLECTIONMAP_3D = false; + this.REFLECTIONMAP_SPHERICAL = false; + this.REFLECTIONMAP_PLANAR = false; + this.REFLECTIONMAP_CUBIC = false; + this.REFLECTIONMAP_PROJECTION = false; + this.REFLECTIONMAP_SKYBOX = false; + this.REFLECTIONMAP_EXPLICIT = false; + this.REFLECTIONMAP_EQUIRECTANGULAR = false; + this.INVERTCUBICMAP = false; + this.LOGARITHMICDEPTH = false; + this.CAMERATONEMAP = false; + this.CAMERACONTRAST = false; + this.CAMERACOLORGRADING = false; + this.CAMERACOLORCURVES = false; + this.OVERLOADEDVALUES = false; + this.OVERLOADEDSHADOWVALUES = false; + this.USESPHERICALFROMREFLECTIONMAP = false; + this.REFRACTION = false; + this.REFRACTIONMAP_3D = false; + this.LINKREFRACTIONTOTRANSPARENCY = false; + this.REFRACTIONMAPINLINEARSPACE = false; + this.LODBASEDMICROSFURACE = false; + this.USEPHYSICALLIGHTFALLOFF = false; + this.RADIANCEOVERALPHA = false; + this.USEPMREMREFLECTION = false; + this.USEPMREMREFRACTION = false; + this.OPENGLNORMALMAP = false; + this.INVERTNORMALMAPX = false; + this.INVERTNORMALMAPY = false; + this.SHADOWFULLFLOAT = false; + this.METALLICWORKFLOW = false; + this.METALLICROUGHNESSGSTOREINALPHA = false; + this.METALLICROUGHNESSGSTOREINGREEN = false; + this.rebuild(); + } + return PBRMaterialDefines; + }(BABYLON.MaterialDefines)); + /** + * The Physically based material of BJS. + * + * This offers the main features of a standard PBR material. + * For more information, please refer to the documentation : + * http://doc.babylonjs.com/extensions/Physically_Based_Rendering + */ + var PBRMaterial = (function (_super) { + __extends(PBRMaterial, _super); + /** + * Instantiates a new PBRMaterial instance. + * + * @param name The material name + * @param scene The scene the material will be use in. + */ + function PBRMaterial(name, scene) { + var _this = this; + _super.call(this, name, scene); + /** + * Intensity of the direct lights e.g. the four lights available in your scene. + * This impacts both the direct diffuse and specular highlights. + */ + this.directIntensity = 1.0; + /** + * Intensity of the emissive part of the material. + * This helps controlling the emissive effect without modifying the emissive color. + */ + this.emissiveIntensity = 1.0; + /** + * Intensity of the environment e.g. how much the environment will light the object + * either through harmonics for rough material or through the refelction for shiny ones. + */ + this.environmentIntensity = 1.0; + /** + * This is a special control allowing the reduction of the specular highlights coming from the + * four lights of the scene. Those highlights may not be needed in full environment lighting. + */ + this.specularIntensity = 1.0; + this._lightingInfos = new BABYLON.Vector4(this.directIntensity, this.emissiveIntensity, this.environmentIntensity, this.specularIntensity); + /** + * Debug Control allowing disabling the bump map on this material. + */ + this.disableBumpMap = false; + /** + * Debug Control helping enforcing or dropping the darkness of shadows. + * 1.0 means the shadows have their normal darkness, 0.0 means the shadows are not visible. + */ + this.overloadedShadowIntensity = 1.0; + /** + * Debug Control helping dropping the shading effect coming from the diffuse lighting. + * 1.0 means the shade have their normal impact, 0.0 means no shading at all. + */ + this.overloadedShadeIntensity = 1.0; + this._overloadedShadowInfos = new BABYLON.Vector4(this.overloadedShadowIntensity, this.overloadedShadeIntensity, 0.0, 0.0); + /** + * The camera exposure used on this material. + * This property is here and not in the camera to allow controlling exposure without full screen post process. + * This corresponds to a photographic exposure. + */ + this.cameraExposure = 1.0; + /** + * The camera contrast used on this material. + * This property is here and not in the camera to allow controlling contrast without full screen post process. + */ + this.cameraContrast = 1.0; + /** + * Color Grading 2D Lookup Texture. + * This allows special effects like sepia, black and white to sixties rendering style. + */ + this.cameraColorGradingTexture = null; + /** + * The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT). + * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects. + * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image; + * corresponding to low luminance, medium luminance, and high luminance areas respectively. + */ + this.cameraColorCurves = null; + this._cameraInfos = new BABYLON.Vector4(1.0, 1.0, 0.0, 0.0); + this._microsurfaceTextureLods = new BABYLON.Vector2(0.0, 0.0); + /** + * Debug Control allowing to overload the ambient color. + * This as to be use with the overloadedAmbientIntensity parameter. + */ + this.overloadedAmbient = BABYLON.Color3.White(); + /** + * Debug Control indicating how much the overloaded ambient color is used against the default one. + */ + this.overloadedAmbientIntensity = 0.0; + /** + * Debug Control allowing to overload the albedo color. + * This as to be use with the overloadedAlbedoIntensity parameter. + */ + this.overloadedAlbedo = BABYLON.Color3.White(); + /** + * Debug Control indicating how much the overloaded albedo color is used against the default one. + */ + this.overloadedAlbedoIntensity = 0.0; + /** + * Debug Control allowing to overload the reflectivity color. + * This as to be use with the overloadedReflectivityIntensity parameter. + */ + this.overloadedReflectivity = new BABYLON.Color3(0.3, 0.3, 0.3); + /** + * Debug Control indicating how much the overloaded reflectivity color is used against the default one. + */ + this.overloadedReflectivityIntensity = 0.0; + /** + * Debug Control allowing to overload the emissive color. + * This as to be use with the overloadedEmissiveIntensity parameter. + */ + this.overloadedEmissive = BABYLON.Color3.White(); + /** + * Debug Control indicating how much the overloaded emissive color is used against the default one. + */ + this.overloadedEmissiveIntensity = 0.0; + this._overloadedIntensity = new BABYLON.Vector4(this.overloadedAmbientIntensity, this.overloadedAlbedoIntensity, this.overloadedReflectivityIntensity, this.overloadedEmissiveIntensity); + /** + * Debug Control allowing to overload the reflection color. + * This as to be use with the overloadedReflectionIntensity parameter. + */ + this.overloadedReflection = BABYLON.Color3.White(); + /** + * Debug Control indicating how much the overloaded reflection color is used against the default one. + */ + this.overloadedReflectionIntensity = 0.0; + /** + * Debug Control allowing to overload the microsurface. + * This as to be use with the overloadedMicroSurfaceIntensity parameter. + */ + this.overloadedMicroSurface = 0.0; + /** + * Debug Control indicating how much the overloaded microsurface is used against the default one. + */ + this.overloadedMicroSurfaceIntensity = 0.0; + this._overloadedMicroSurface = new BABYLON.Vector3(this.overloadedMicroSurface, this.overloadedMicroSurfaceIntensity, this.overloadedReflectionIntensity); + /** + * AKA Occlusion Texture Intensity in other nomenclature. + */ + this.ambientTextureStrength = 1.0; + this.ambientColor = new BABYLON.Color3(0, 0, 0); + /** + * AKA Diffuse Color in other nomenclature. + */ + this.albedoColor = new BABYLON.Color3(1, 1, 1); + /** + * AKA Specular Color in other nomenclature. + */ + this.reflectivityColor = new BABYLON.Color3(1, 1, 1); + this.reflectionColor = new BABYLON.Color3(0.5, 0.5, 0.5); + this.emissiveColor = new BABYLON.Color3(0, 0, 0); + /** + * AKA Glossiness in other nomenclature. + */ + this.microSurface = 0.9; + /** + * source material index of refraction (IOR)' / 'destination material IOR. + */ + this.indexOfRefraction = 0.66; + /** + * Controls if refraction needs to be inverted on Y. This could be usefull for procedural texture. + */ + this.invertRefractionY = false; + /** + * This parameters will make the material used its opacity to control how much it is refracting aginst not. + * Materials half opaque for instance using refraction could benefit from this control. + */ + this.linkRefractionWithTransparency = false; + /** + * The emissive and albedo are linked to never be more than one (Energy conservation). + */ + this.linkEmissiveWithAlbedo = false; + this.useLightmapAsShadowmap = false; + /** + * In this mode, the emissive informtaion will always be added to the lighting once. + * A light for instance can be thought as emissive. + */ + this.useEmissiveAsIllumination = false; + /** + * Secifies that the alpha is coming form the albedo channel alpha channel. + */ + this.useAlphaFromAlbedoTexture = false; + /** + * Specifies that the material will keeps the specular highlights over a transparent surface (only the most limunous ones). + * A car glass is a good exemple of that. When sun reflects on it you can not see what is behind. + */ + this.useSpecularOverAlpha = true; + /** + * Specifies if the reflectivity texture contains the glossiness information in its alpha channel. + */ + this.useMicroSurfaceFromReflectivityMapAlpha = false; + /** + * Specifies if the metallic texture contains the roughness information in its alpha channel. + */ + this.useRoughnessFromMetallicTextureAlpha = true; + /** + * Specifies if the metallic texture contains the roughness information in its green channel. + */ + this.useRoughnessFromMetallicTextureGreen = false; + /** + * In case the reflectivity map does not contain the microsurface information in its alpha channel, + * The material will try to infer what glossiness each pixel should be. + */ + this.useAutoMicroSurfaceFromReflectivityMap = false; + /** + * Allows to work with scalar in linear mode. This is definitely a matter of preferences and tools used during + * the creation of the material. + */ + this.useScalarInLinearSpace = false; + /** + * BJS is using an harcoded light falloff based on a manually sets up range. + * In PBR, one way to represents the fallof is to use the inverse squared root algorythm. + * This parameter can help you switch back to the BJS mode in order to create scenes using both materials. + */ + this.usePhysicalLightFalloff = true; + /** + * Specifies that the material will keeps the reflection highlights over a transparent surface (only the most limunous ones). + * A car glass is a good exemple of that. When the street lights reflects on it you can not see what is behind. + */ + this.useRadianceOverAlpha = true; + /** + * Allows using the bump map in parallax mode. + */ + this.useParallax = false; + /** + * Allows using the bump map in parallax occlusion mode. + */ + this.useParallaxOcclusion = false; + /** + * Controls the scale bias of the parallax mode. + */ + this.parallaxScaleBias = 0.05; + /** + * If sets to true, disables all the lights affecting the material. + */ + this.disableLighting = false; + /** + * Number of Simultaneous lights allowed on the material. + */ + this.maxSimultaneousLights = 4; + /** + * If sets to true, x component of normal map value will invert (x = 1.0 - x). + */ + this.invertNormalMapX = false; + /** + * If sets to true, y component of normal map value will invert (y = 1.0 - y). + */ + this.invertNormalMapY = false; + this._renderTargets = new BABYLON.SmartArray(16); + this._worldViewProjectionMatrix = BABYLON.Matrix.Zero(); + this._globalAmbientColor = new BABYLON.Color3(0, 0, 0); + this._tempColor = new BABYLON.Color3(); + this._defines = new PBRMaterialDefines(); + this._cachedDefines = new PBRMaterialDefines(); + this._myScene = null; + this._myShadowGenerator = null; + this._cachedDefines.BonesPerMesh = -1; + this.getRenderTargetTextures = function () { + _this._renderTargets.reset(); + if (_this.reflectionTexture && _this.reflectionTexture.isRenderTarget) { + _this._renderTargets.push(_this.reflectionTexture); + } + if (_this.refractionTexture && _this.refractionTexture.isRenderTarget) { + _this._renderTargets.push(_this.refractionTexture); + } + return _this._renderTargets; + }; + } + Object.defineProperty(PBRMaterial.prototype, "useLogarithmicDepth", { + get: function () { + return this._useLogarithmicDepth; + }, + set: function (value) { + this._useLogarithmicDepth = value && this.getScene().getEngine().getCaps().fragmentDepthSupported; + }, + enumerable: true, + configurable: true + }); + PBRMaterial.prototype.needAlphaBlending = function () { + if (this.linkRefractionWithTransparency) { + return false; + } + return (this.alpha < 1.0) || (this.opacityTexture != null) || this._shouldUseAlphaFromAlbedoTexture() || this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled; + }; + PBRMaterial.prototype.needAlphaTesting = function () { + if (this.linkRefractionWithTransparency) { + return false; + } + return this.albedoTexture != null && this.albedoTexture.hasAlpha; + }; + PBRMaterial.prototype._shouldUseAlphaFromAlbedoTexture = function () { + return this.albedoTexture != null && this.albedoTexture.hasAlpha && this.useAlphaFromAlbedoTexture; + }; + PBRMaterial.prototype.getAlphaTestTexture = function () { + return this.albedoTexture; + }; + PBRMaterial.prototype._checkCache = function (scene, mesh, useInstances) { + if (!mesh) { + return true; + } + if (this._defines.INSTANCES !== useInstances) { + return false; + } + if (mesh._materialDefines && mesh._materialDefines.isEqual(this._defines)) { + return true; + } + return false; + }; + PBRMaterial.prototype.convertColorToLinearSpaceToRef = function (color, ref) { + PBRMaterial.convertColorToLinearSpaceToRef(color, ref, this.useScalarInLinearSpace); + }; + PBRMaterial.convertColorToLinearSpaceToRef = function (color, ref, useScalarInLinear) { + if (!useScalarInLinear) { + color.toLinearSpaceToRef(ref); + } + else { + ref.r = color.r; + ref.g = color.g; + ref.b = color.b; + } + }; + PBRMaterial.BindLights = function (scene, mesh, effect, defines, useScalarInLinearSpace, maxSimultaneousLights, usePhysicalLightFalloff) { + var lightIndex = 0; + var depthValuesAlreadySet = false; + for (var index = 0; index < scene.lights.length; index++) { + var light = scene.lights[index]; + if (!light.isEnabled()) { + continue; + } + if (!light.canAffectMesh(mesh)) { + continue; + } + BABYLON.MaterialHelper.BindLightProperties(light, effect, lightIndex); + // GAMMA CORRECTION. + this.convertColorToLinearSpaceToRef(light.diffuse, PBRMaterial._scaledAlbedo, useScalarInLinearSpace); + PBRMaterial._scaledAlbedo.scaleToRef(light.intensity, PBRMaterial._scaledAlbedo); + effect.setColor4("vLightDiffuse" + lightIndex, PBRMaterial._scaledAlbedo, usePhysicalLightFalloff ? light.radius : light.range); + if (defines["SPECULARTERM"]) { + this.convertColorToLinearSpaceToRef(light.specular, PBRMaterial._scaledReflectivity, useScalarInLinearSpace); + PBRMaterial._scaledReflectivity.scaleToRef(light.intensity, PBRMaterial._scaledReflectivity); + effect.setColor3("vLightSpecular" + lightIndex, PBRMaterial._scaledReflectivity); + } + // Shadows + if (scene.shadowsEnabled) { + depthValuesAlreadySet = BABYLON.MaterialHelper.BindLightShadow(light, scene, mesh, lightIndex, effect, depthValuesAlreadySet); + } + lightIndex++; + if (lightIndex === maxSimultaneousLights) + break; + } + }; + PBRMaterial.prototype.isReady = function (mesh, useInstances) { + if (this.checkReadyOnlyOnce) { + if (this._wasPreviouslyReady) { + return true; + } + } + var scene = this.getScene(); + var engine = scene.getEngine(); + var needNormals = false; + var needUVs = false; + this._defines.reset(); + if (scene.lightsEnabled && !this.disableLighting) { + needNormals = BABYLON.MaterialHelper.PrepareDefinesForLights(scene, mesh, this._defines, this.maxSimultaneousLights) || needNormals; + } + if (!this.checkReadyOnEveryCall) { + if (this._renderId === scene.getRenderId()) { + if (this._checkCache(scene, mesh, useInstances)) { + return true; + } + } + } + if (scene.texturesEnabled) { + if (scene.getEngine().getCaps().textureLOD) { + this._defines.LODBASEDMICROSFURACE = true; + } + if (this.albedoTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) { + if (!this.albedoTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.ALBEDO = true; + } + } + if (this.ambientTexture && BABYLON.StandardMaterial.AmbientTextureEnabled) { + if (!this.ambientTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.AMBIENT = true; + } + } + if (this.opacityTexture && BABYLON.StandardMaterial.OpacityTextureEnabled) { + if (!this.opacityTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.OPACITY = true; + if (this.opacityTexture.getAlphaFromRGB) { + this._defines.OPACITYRGB = true; + } + } + } + if (this.reflectionTexture && BABYLON.StandardMaterial.ReflectionTextureEnabled) { + if (!this.reflectionTexture.isReady()) { + return false; + } + else { + needNormals = true; + this._defines.REFLECTION = true; + if (this.reflectionTexture.coordinatesMode === BABYLON.Texture.INVCUBIC_MODE) { + this._defines.INVERTCUBICMAP = true; + } + this._defines.REFLECTIONMAP_3D = this.reflectionTexture.isCube; + switch (this.reflectionTexture.coordinatesMode) { + case BABYLON.Texture.CUBIC_MODE: + case BABYLON.Texture.INVCUBIC_MODE: + this._defines.REFLECTIONMAP_CUBIC = true; + break; + case BABYLON.Texture.EXPLICIT_MODE: + this._defines.REFLECTIONMAP_EXPLICIT = true; + break; + case BABYLON.Texture.PLANAR_MODE: + this._defines.REFLECTIONMAP_PLANAR = true; + break; + case BABYLON.Texture.PROJECTION_MODE: + this._defines.REFLECTIONMAP_PROJECTION = true; + break; + case BABYLON.Texture.SKYBOX_MODE: + this._defines.REFLECTIONMAP_SKYBOX = true; + break; + case BABYLON.Texture.SPHERICAL_MODE: + this._defines.REFLECTIONMAP_SPHERICAL = true; + break; + case BABYLON.Texture.EQUIRECTANGULAR_MODE: + this._defines.REFLECTIONMAP_EQUIRECTANGULAR = true; + break; + } + if (this.reflectionTexture instanceof BABYLON.HDRCubeTexture && this.reflectionTexture) { + this._defines.USESPHERICALFROMREFLECTIONMAP = true; + needNormals = true; + if (this.reflectionTexture.isPMREM) { + this._defines.USEPMREMREFLECTION = true; + } + } + } + } + if (this.lightmapTexture && BABYLON.StandardMaterial.LightmapTextureEnabled) { + if (!this.lightmapTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.LIGHTMAP = true; + this._defines.USELIGHTMAPASSHADOWMAP = this.useLightmapAsShadowmap; + } + } + if (this.emissiveTexture && BABYLON.StandardMaterial.EmissiveTextureEnabled) { + if (!this.emissiveTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.EMISSIVE = true; + } + } + if (BABYLON.StandardMaterial.SpecularTextureEnabled) { + if (this.metallicTexture) { + if (!this.metallicTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.METALLICWORKFLOW = true; + this._defines.METALLICROUGHNESSGSTOREINALPHA = this.useRoughnessFromMetallicTextureAlpha; + this._defines.METALLICROUGHNESSGSTOREINGREEN = !this.useRoughnessFromMetallicTextureAlpha && this.useRoughnessFromMetallicTextureGreen; + } + } + else if (this.reflectivityTexture) { + if (!this.reflectivityTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.REFLECTIVITY = true; + this._defines.MICROSURFACEFROMREFLECTIVITYMAP = this.useMicroSurfaceFromReflectivityMapAlpha; + this._defines.MICROSURFACEAUTOMATIC = this.useAutoMicroSurfaceFromReflectivityMap; + } + } + } + if (scene.getEngine().getCaps().standardDerivatives && this.bumpTexture && BABYLON.StandardMaterial.BumpTextureEnabled && !this.disableBumpMap) { + if (!this.bumpTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.BUMP = true; + if (this.useParallax && this.albedoTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) { + this._defines.PARALLAX = true; + if (this.useParallaxOcclusion) { + this._defines.PARALLAXOCCLUSION = true; + } + } + if (this.invertNormalMapX) { + this._defines.INVERTNORMALMAPX = true; + } + if (this.invertNormalMapY) { + this._defines.INVERTNORMALMAPY = true; + } + } + } + if (this.refractionTexture && BABYLON.StandardMaterial.RefractionTextureEnabled) { + if (!this.refractionTexture.isReady()) { + return false; + } + else { + needUVs = true; + this._defines.REFRACTION = true; + this._defines.REFRACTIONMAP_3D = this.refractionTexture.isCube; + if (this.linkRefractionWithTransparency) { + this._defines.LINKREFRACTIONTOTRANSPARENCY = true; + } + if (this.refractionTexture instanceof BABYLON.HDRCubeTexture) { + this._defines.REFRACTIONMAPINLINEARSPACE = true; + if (this.refractionTexture.isPMREM) { + this._defines.USEPMREMREFRACTION = true; + } + } + } + } + if (this.cameraColorGradingTexture && BABYLON.StandardMaterial.ColorGradingTextureEnabled) { + if (!this.cameraColorGradingTexture.isReady()) { + return false; + } + else { + this._defines.CAMERACOLORGRADING = true; + } + } + } + // Effect + if (scene.clipPlane) { + this._defines.CLIPPLANE = true; + } + if (engine.getAlphaTesting()) { + this._defines.ALPHATEST = true; + } + if (this._shouldUseAlphaFromAlbedoTexture()) { + this._defines.ALPHAFROMALBEDO = true; + } + if (this.useEmissiveAsIllumination) { + this._defines.EMISSIVEASILLUMINATION = true; + } + if (this.linkEmissiveWithAlbedo) { + this._defines.LINKEMISSIVEWITHALBEDO = true; + } + if (this.useLogarithmicDepth) { + this._defines.LOGARITHMICDEPTH = true; + } + if (this.cameraContrast != 1) { + this._defines.CAMERACONTRAST = true; + } + if (this.cameraExposure != 1) { + this._defines.CAMERATONEMAP = true; + } + if (this.cameraColorCurves) { + this._defines.CAMERACOLORCURVES = true; + } + if (this.overloadedShadeIntensity != 1 || + this.overloadedShadowIntensity != 1) { + this._defines.OVERLOADEDSHADOWVALUES = true; + } + if (this.overloadedMicroSurfaceIntensity > 0 || + this.overloadedEmissiveIntensity > 0 || + this.overloadedReflectivityIntensity > 0 || + this.overloadedAlbedoIntensity > 0 || + this.overloadedAmbientIntensity > 0 || + this.overloadedReflectionIntensity > 0) { + this._defines.OVERLOADEDVALUES = true; + } + // Point size + if (this.pointsCloud || scene.forcePointsCloud) { + this._defines.POINTSIZE = true; + } + // Fog + if (scene.fogEnabled && mesh && mesh.applyFog && scene.fogMode !== BABYLON.Scene.FOGMODE_NONE && this.fogEnabled) { + this._defines.FOG = true; + } + if (BABYLON.StandardMaterial.FresnelEnabled) { + // Fresnel + if (this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled || + this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled) { + if (this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled) { + this._defines.OPACITYFRESNEL = true; + } + if (this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled) { + this._defines.EMISSIVEFRESNEL = true; + } + needNormals = true; + this._defines.FRESNEL = true; + } + } + if (this._defines.SPECULARTERM && this.useSpecularOverAlpha) { + this._defines.SPECULAROVERALPHA = true; + } + if (this.usePhysicalLightFalloff) { + this._defines.USEPHYSICALLIGHTFALLOFF = true; + } + if (this.useRadianceOverAlpha) { + this._defines.RADIANCEOVERALPHA = true; + } + // Attribs + if (mesh) { + if (needNormals && mesh.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) { + this._defines.NORMAL = true; + } + if (needUVs) { + if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) { + this._defines.UV1 = true; + } + if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) { + this._defines.UV2 = true; + } + } + if (mesh.useVertexColors && mesh.isVerticesDataPresent(BABYLON.VertexBuffer.ColorKind)) { + this._defines.VERTEXCOLOR = true; + if (mesh.hasVertexAlpha) { + this._defines.VERTEXALPHA = true; + } + } + if (mesh.useBones && mesh.computeBonesUsingShaders) { + this._defines.NUM_BONE_INFLUENCERS = mesh.numBoneInfluencers; + this._defines.BonesPerMesh = (mesh.skeleton.bones.length + 1); + } + // Instances + if (useInstances) { + this._defines.INSTANCES = true; + } + } + // Get correct effect + if (!this._defines.isEqual(this._cachedDefines)) { + this._defines.cloneTo(this._cachedDefines); + scene.resetCachedMaterial(); + // Fallbacks + var fallbacks = new BABYLON.EffectFallbacks(); + if (this._defines.REFLECTION) { + fallbacks.addFallback(0, "REFLECTION"); + } + if (this._defines.REFRACTION) { + fallbacks.addFallback(0, "REFRACTION"); + } + if (this._defines.REFLECTIVITY) { + fallbacks.addFallback(0, "REFLECTIVITY"); + } + if (this._defines.BUMP) { + fallbacks.addFallback(0, "BUMP"); + } + if (this._defines.PARALLAX) { + fallbacks.addFallback(1, "PARALLAX"); + } + if (this._defines.PARALLAXOCCLUSION) { + fallbacks.addFallback(0, "PARALLAXOCCLUSION"); + } + if (this._defines.SPECULAROVERALPHA) { + fallbacks.addFallback(0, "SPECULAROVERALPHA"); + } + if (this._defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + if (this._defines.POINTSIZE) { + fallbacks.addFallback(0, "POINTSIZE"); + } + if (this._defines.LOGARITHMICDEPTH) { + fallbacks.addFallback(0, "LOGARITHMICDEPTH"); + } + BABYLON.MaterialHelper.HandleFallbacksForShadows(this._defines, fallbacks, this.maxSimultaneousLights); + if (this._defines.SPECULARTERM) { + fallbacks.addFallback(0, "SPECULARTERM"); + } + if (this._defines.OPACITYFRESNEL) { + fallbacks.addFallback(1, "OPACITYFRESNEL"); + } + if (this._defines.EMISSIVEFRESNEL) { + fallbacks.addFallback(2, "EMISSIVEFRESNEL"); + } + if (this._defines.FRESNEL) { + fallbacks.addFallback(3, "FRESNEL"); + } + if (this._defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh); + } + //Attributes + var attribs = [BABYLON.VertexBuffer.PositionKind]; + if (this._defines.NORMAL) { + attribs.push(BABYLON.VertexBuffer.NormalKind); + } + if (this._defines.UV1) { + attribs.push(BABYLON.VertexBuffer.UVKind); + } + if (this._defines.UV2) { + attribs.push(BABYLON.VertexBuffer.UV2Kind); + } + if (this._defines.VERTEXCOLOR) { + attribs.push(BABYLON.VertexBuffer.ColorKind); + } + BABYLON.MaterialHelper.PrepareAttributesForBones(attribs, mesh, this._defines, fallbacks); + BABYLON.MaterialHelper.PrepareAttributesForInstances(attribs, this._defines); + // Legacy browser patch + var join = this._defines.toString(); + var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vAmbientColor", "vAlbedoColor", "vReflectivityColor", "vEmissiveColor", "vReflectionColor", + "vFogInfos", "vFogColor", "pointSize", + "vAlbedoInfos", "vAmbientInfos", "vOpacityInfos", "vReflectionInfos", "vEmissiveInfos", "vReflectivityInfos", "vBumpInfos", "vLightmapInfos", "vRefractionInfos", + "mBones", + "vClipPlane", "albedoMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "reflectivityMatrix", "bumpMatrix", "lightmapMatrix", "refractionMatrix", + "depthValues", + "opacityParts", "emissiveLeftColor", "emissiveRightColor", + "vLightingIntensity", "vOverloadedShadowIntensity", "vOverloadedIntensity", "vOverloadedAlbedo", "vOverloadedReflection", "vOverloadedReflectivity", "vOverloadedEmissive", "vOverloadedMicroSurface", + "logarithmicDepthConstant", + "vSphericalX", "vSphericalY", "vSphericalZ", + "vSphericalXX", "vSphericalYY", "vSphericalZZ", + "vSphericalXY", "vSphericalYZ", "vSphericalZX", + "vMicrosurfaceTextureLods", + "vCameraInfos" + ]; + var samplers = ["albedoSampler", "ambientSampler", "opacitySampler", "reflectionCubeSampler", "reflection2DSampler", "emissiveSampler", "reflectivitySampler", "bumpSampler", "lightmapSampler", "refractionCubeSampler", "refraction2DSampler"]; + BABYLON.ColorCurves.PrepareUniforms(uniforms); + BABYLON.ColorGradingTexture.PrepareUniformsAndSamplers(uniforms, samplers); + BABYLON.MaterialHelper.PrepareUniformsAndSamplersList(uniforms, samplers, this._defines, this.maxSimultaneousLights); + this._effect = scene.getEngine().createEffect("pbr", attribs, uniforms, samplers, join, fallbacks, this.onCompiled, this.onError, { maxSimultaneousLights: this.maxSimultaneousLights }); + } + if (!this._effect.isReady()) { + return false; + } + this._renderId = scene.getRenderId(); + this._wasPreviouslyReady = true; + if (mesh) { + if (!mesh._materialDefines) { + mesh._materialDefines = new PBRMaterialDefines(); + } + this._defines.cloneTo(mesh._materialDefines); + } + return true; + }; + PBRMaterial.prototype.unbind = function () { + if (this.reflectionTexture && this.reflectionTexture.isRenderTarget) { + this._effect.setTexture("reflection2DSampler", null); + } + if (this.refractionTexture && this.refractionTexture.isRenderTarget) { + this._effect.setTexture("refraction2DSampler", null); + } + _super.prototype.unbind.call(this); + }; + PBRMaterial.prototype.bindOnlyWorldMatrix = function (world) { + this._effect.setMatrix("world", world); + }; + PBRMaterial.prototype.bind = function (world, mesh) { + this._myScene = this.getScene(); + // Matrices + this.bindOnlyWorldMatrix(world); + // Bones + BABYLON.MaterialHelper.BindBonesParameters(mesh, this._effect); + if (this._myScene.getCachedMaterial() !== this) { + this._effect.setMatrix("viewProjection", this._myScene.getTransformMatrix()); + if (BABYLON.StandardMaterial.FresnelEnabled) { + if (this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled) { + this._effect.setColor4("opacityParts", new BABYLON.Color3(this.opacityFresnelParameters.leftColor.toLuminance(), this.opacityFresnelParameters.rightColor.toLuminance(), this.opacityFresnelParameters.bias), this.opacityFresnelParameters.power); + } + if (this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled) { + this._effect.setColor4("emissiveLeftColor", this.emissiveFresnelParameters.leftColor, this.emissiveFresnelParameters.power); + this._effect.setColor4("emissiveRightColor", this.emissiveFresnelParameters.rightColor, this.emissiveFresnelParameters.bias); + } + } + // Textures + if (this._myScene.texturesEnabled) { + if (this.albedoTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) { + this._effect.setTexture("albedoSampler", this.albedoTexture); + this._effect.setFloat2("vAlbedoInfos", this.albedoTexture.coordinatesIndex, this.albedoTexture.level); + this._effect.setMatrix("albedoMatrix", this.albedoTexture.getTextureMatrix()); + } + if (this.ambientTexture && BABYLON.StandardMaterial.AmbientTextureEnabled) { + this._effect.setTexture("ambientSampler", this.ambientTexture); + this._effect.setFloat3("vAmbientInfos", this.ambientTexture.coordinatesIndex, this.ambientTexture.level, this.ambientTextureStrength); + this._effect.setMatrix("ambientMatrix", this.ambientTexture.getTextureMatrix()); + } + if (this.opacityTexture && BABYLON.StandardMaterial.OpacityTextureEnabled) { + this._effect.setTexture("opacitySampler", this.opacityTexture); + this._effect.setFloat2("vOpacityInfos", this.opacityTexture.coordinatesIndex, this.opacityTexture.level); + this._effect.setMatrix("opacityMatrix", this.opacityTexture.getTextureMatrix()); + } + if (this.reflectionTexture && BABYLON.StandardMaterial.ReflectionTextureEnabled) { + this._microsurfaceTextureLods.x = Math.round(Math.log(this.reflectionTexture.getSize().width) * Math.LOG2E); + if (this.reflectionTexture.isCube) { + this._effect.setTexture("reflectionCubeSampler", this.reflectionTexture); + } + else { + this._effect.setTexture("reflection2DSampler", this.reflectionTexture); + } + this._effect.setMatrix("reflectionMatrix", this.reflectionTexture.getReflectionTextureMatrix()); + this._effect.setFloat2("vReflectionInfos", this.reflectionTexture.level, 0); + if (this._defines.USESPHERICALFROMREFLECTIONMAP) { + this._effect.setFloat3("vSphericalX", this.reflectionTexture.sphericalPolynomial.x.x, this.reflectionTexture.sphericalPolynomial.x.y, this.reflectionTexture.sphericalPolynomial.x.z); + this._effect.setFloat3("vSphericalY", this.reflectionTexture.sphericalPolynomial.y.x, this.reflectionTexture.sphericalPolynomial.y.y, this.reflectionTexture.sphericalPolynomial.y.z); + this._effect.setFloat3("vSphericalZ", this.reflectionTexture.sphericalPolynomial.z.x, this.reflectionTexture.sphericalPolynomial.z.y, this.reflectionTexture.sphericalPolynomial.z.z); + this._effect.setFloat3("vSphericalXX", this.reflectionTexture.sphericalPolynomial.xx.x, this.reflectionTexture.sphericalPolynomial.xx.y, this.reflectionTexture.sphericalPolynomial.xx.z); + this._effect.setFloat3("vSphericalYY", this.reflectionTexture.sphericalPolynomial.yy.x, this.reflectionTexture.sphericalPolynomial.yy.y, this.reflectionTexture.sphericalPolynomial.yy.z); + this._effect.setFloat3("vSphericalZZ", this.reflectionTexture.sphericalPolynomial.zz.x, this.reflectionTexture.sphericalPolynomial.zz.y, this.reflectionTexture.sphericalPolynomial.zz.z); + this._effect.setFloat3("vSphericalXY", this.reflectionTexture.sphericalPolynomial.xy.x, this.reflectionTexture.sphericalPolynomial.xy.y, this.reflectionTexture.sphericalPolynomial.xy.z); + this._effect.setFloat3("vSphericalYZ", this.reflectionTexture.sphericalPolynomial.yz.x, this.reflectionTexture.sphericalPolynomial.yz.y, this.reflectionTexture.sphericalPolynomial.yz.z); + this._effect.setFloat3("vSphericalZX", this.reflectionTexture.sphericalPolynomial.zx.x, this.reflectionTexture.sphericalPolynomial.zx.y, this.reflectionTexture.sphericalPolynomial.zx.z); + } + } + if (this.emissiveTexture && BABYLON.StandardMaterial.EmissiveTextureEnabled) { + this._effect.setTexture("emissiveSampler", this.emissiveTexture); + this._effect.setFloat2("vEmissiveInfos", this.emissiveTexture.coordinatesIndex, this.emissiveTexture.level); + this._effect.setMatrix("emissiveMatrix", this.emissiveTexture.getTextureMatrix()); + } + if (this.lightmapTexture && BABYLON.StandardMaterial.LightmapTextureEnabled) { + this._effect.setTexture("lightmapSampler", this.lightmapTexture); + this._effect.setFloat2("vLightmapInfos", this.lightmapTexture.coordinatesIndex, this.lightmapTexture.level); + this._effect.setMatrix("lightmapMatrix", this.lightmapTexture.getTextureMatrix()); + } + if (BABYLON.StandardMaterial.SpecularTextureEnabled) { + if (this.metallicTexture) { + this._effect.setTexture("reflectivitySampler", this.metallicTexture); + this._effect.setFloat2("vReflectivityInfos", this.metallicTexture.coordinatesIndex, this.metallicTexture.level); + this._effect.setMatrix("reflectivityMatrix", this.metallicTexture.getTextureMatrix()); + } + else if (this.reflectivityTexture) { + this._effect.setTexture("reflectivitySampler", this.reflectivityTexture); + this._effect.setFloat2("vReflectivityInfos", this.reflectivityTexture.coordinatesIndex, this.reflectivityTexture.level); + this._effect.setMatrix("reflectivityMatrix", this.reflectivityTexture.getTextureMatrix()); + } + } + if (this.bumpTexture && this._myScene.getEngine().getCaps().standardDerivatives && BABYLON.StandardMaterial.BumpTextureEnabled && !this.disableBumpMap) { + this._effect.setTexture("bumpSampler", this.bumpTexture); + this._effect.setFloat3("vBumpInfos", this.bumpTexture.coordinatesIndex, 1.0 / this.bumpTexture.level, this.parallaxScaleBias); + this._effect.setMatrix("bumpMatrix", this.bumpTexture.getTextureMatrix()); + } + if (this.refractionTexture && BABYLON.StandardMaterial.RefractionTextureEnabled) { + this._microsurfaceTextureLods.y = Math.round(Math.log(this.refractionTexture.getSize().width) * Math.LOG2E); + var depth = 1.0; + if (this.refractionTexture.isCube) { + this._effect.setTexture("refractionCubeSampler", this.refractionTexture); + } + else { + this._effect.setTexture("refraction2DSampler", this.refractionTexture); + this._effect.setMatrix("refractionMatrix", this.refractionTexture.getReflectionTextureMatrix()); + if (this.refractionTexture.depth) { + depth = this.refractionTexture.depth; + } + } + this._effect.setFloat4("vRefractionInfos", this.refractionTexture.level, this.indexOfRefraction, depth, this.invertRefractionY ? -1 : 1); + } + if ((this.reflectionTexture || this.refractionTexture)) { + this._effect.setFloat2("vMicrosurfaceTextureLods", this._microsurfaceTextureLods.x, this._microsurfaceTextureLods.y); + } + if (this.cameraColorGradingTexture && BABYLON.StandardMaterial.ColorGradingTextureEnabled) { + BABYLON.ColorGradingTexture.Bind(this.cameraColorGradingTexture, this._effect); + } + } + // Clip plane + BABYLON.MaterialHelper.BindClipPlane(this._effect, this._myScene); + // Point size + if (this.pointsCloud) { + this._effect.setFloat("pointSize", this.pointSize); + } + // Colors + this._myScene.ambientColor.multiplyToRef(this.ambientColor, this._globalAmbientColor); + // GAMMA CORRECTION. + this.convertColorToLinearSpaceToRef(this.reflectivityColor, PBRMaterial._scaledReflectivity); + this._effect.setVector3("vEyePosition", this._myScene._mirroredCameraPosition ? this._myScene._mirroredCameraPosition : this._myScene.activeCamera.position); + this._effect.setColor3("vAmbientColor", this._globalAmbientColor); + this._effect.setColor4("vReflectivityColor", PBRMaterial._scaledReflectivity, this.microSurface); + // GAMMA CORRECTION. + this.convertColorToLinearSpaceToRef(this.emissiveColor, PBRMaterial._scaledEmissive); + this._effect.setColor3("vEmissiveColor", PBRMaterial._scaledEmissive); + // GAMMA CORRECTION. + this.convertColorToLinearSpaceToRef(this.reflectionColor, PBRMaterial._scaledReflection); + this._effect.setColor3("vReflectionColor", PBRMaterial._scaledReflection); + } + if (this._myScene.getCachedMaterial() !== this || !this.isFrozen) { + // GAMMA CORRECTION. + this.convertColorToLinearSpaceToRef(this.albedoColor, PBRMaterial._scaledAlbedo); + this._effect.setColor4("vAlbedoColor", PBRMaterial._scaledAlbedo, this.alpha * mesh.visibility); + // Lights + if (this._myScene.lightsEnabled && !this.disableLighting) { + PBRMaterial.BindLights(this._myScene, mesh, this._effect, this._defines, this.useScalarInLinearSpace, this.maxSimultaneousLights, this.usePhysicalLightFalloff); + } + // View + if (this._myScene.fogEnabled && mesh.applyFog && this._myScene.fogMode !== BABYLON.Scene.FOGMODE_NONE || this.reflectionTexture) { + this._effect.setMatrix("view", this._myScene.getViewMatrix()); + } + // Fog + BABYLON.MaterialHelper.BindFogParameters(this._myScene, mesh, this._effect); + this._lightingInfos.x = this.directIntensity; + this._lightingInfos.y = this.emissiveIntensity; + this._lightingInfos.z = this.environmentIntensity; + this._lightingInfos.w = this.specularIntensity; + this._effect.setVector4("vLightingIntensity", this._lightingInfos); + this._overloadedShadowInfos.x = this.overloadedShadowIntensity; + this._overloadedShadowInfos.y = this.overloadedShadeIntensity; + this._effect.setVector4("vOverloadedShadowIntensity", this._overloadedShadowInfos); + this._cameraInfos.x = this.cameraExposure; + this._cameraInfos.y = this.cameraContrast; + this._effect.setVector4("vCameraInfos", this._cameraInfos); + if (this.cameraColorCurves) { + BABYLON.ColorCurves.Bind(this.cameraColorCurves, this._effect); + } + this._overloadedIntensity.x = this.overloadedAmbientIntensity; + this._overloadedIntensity.y = this.overloadedAlbedoIntensity; + this._overloadedIntensity.z = this.overloadedReflectivityIntensity; + this._overloadedIntensity.w = this.overloadedEmissiveIntensity; + this._effect.setVector4("vOverloadedIntensity", this._overloadedIntensity); + this.convertColorToLinearSpaceToRef(this.overloadedAmbient, this._tempColor); + this._effect.setColor3("vOverloadedAmbient", this._tempColor); + this.convertColorToLinearSpaceToRef(this.overloadedAlbedo, this._tempColor); + this._effect.setColor3("vOverloadedAlbedo", this._tempColor); + this.convertColorToLinearSpaceToRef(this.overloadedReflectivity, this._tempColor); + this._effect.setColor3("vOverloadedReflectivity", this._tempColor); + this.convertColorToLinearSpaceToRef(this.overloadedEmissive, this._tempColor); + this._effect.setColor3("vOverloadedEmissive", this._tempColor); + this.convertColorToLinearSpaceToRef(this.overloadedReflection, this._tempColor); + this._effect.setColor3("vOverloadedReflection", this._tempColor); + this._overloadedMicroSurface.x = this.overloadedMicroSurface; + this._overloadedMicroSurface.y = this.overloadedMicroSurfaceIntensity; + this._overloadedMicroSurface.z = this.overloadedReflectionIntensity; + this._effect.setVector3("vOverloadedMicroSurface", this._overloadedMicroSurface); + // Log. depth + BABYLON.MaterialHelper.BindLogDepth(this._defines, this._effect, this._myScene); + } + _super.prototype.bind.call(this, world, mesh); + this._myScene = null; + }; + PBRMaterial.prototype.getAnimatables = function () { + var results = []; + if (this.albedoTexture && this.albedoTexture.animations && this.albedoTexture.animations.length > 0) { + results.push(this.albedoTexture); + } + if (this.ambientTexture && this.ambientTexture.animations && this.ambientTexture.animations.length > 0) { + results.push(this.ambientTexture); + } + if (this.opacityTexture && this.opacityTexture.animations && this.opacityTexture.animations.length > 0) { + results.push(this.opacityTexture); + } + if (this.reflectionTexture && this.reflectionTexture.animations && this.reflectionTexture.animations.length > 0) { + results.push(this.reflectionTexture); + } + if (this.emissiveTexture && this.emissiveTexture.animations && this.emissiveTexture.animations.length > 0) { + results.push(this.emissiveTexture); + } + if (this.metallicTexture && this.metallicTexture.animations && this.metallicTexture.animations.length > 0) { + results.push(this.metallicTexture); + } + else if (this.reflectivityTexture && this.reflectivityTexture.animations && this.reflectivityTexture.animations.length > 0) { + results.push(this.reflectivityTexture); + } + if (this.bumpTexture && this.bumpTexture.animations && this.bumpTexture.animations.length > 0) { + results.push(this.bumpTexture); + } + if (this.lightmapTexture && this.lightmapTexture.animations && this.lightmapTexture.animations.length > 0) { + results.push(this.lightmapTexture); + } + if (this.refractionTexture && this.refractionTexture.animations && this.refractionTexture.animations.length > 0) { + results.push(this.refractionTexture); + } + if (this.cameraColorGradingTexture && this.cameraColorGradingTexture.animations && this.cameraColorGradingTexture.animations.length > 0) { + results.push(this.cameraColorGradingTexture); + } + return results; + }; + PBRMaterial.prototype.dispose = function (forceDisposeEffect, forceDisposeTextures) { + if (forceDisposeTextures) { + if (this.albedoTexture) { + this.albedoTexture.dispose(); + } + if (this.ambientTexture) { + this.ambientTexture.dispose(); + } + if (this.opacityTexture) { + this.opacityTexture.dispose(); + } + if (this.reflectionTexture) { + this.reflectionTexture.dispose(); + } + if (this.emissiveTexture) { + this.emissiveTexture.dispose(); + } + if (this.metallicTexture) { + this.metallicTexture.dispose(); + } + if (this.reflectivityTexture) { + this.reflectivityTexture.dispose(); + } + if (this.bumpTexture) { + this.bumpTexture.dispose(); + } + if (this.lightmapTexture) { + this.lightmapTexture.dispose(); + } + if (this.refractionTexture) { + this.refractionTexture.dispose(); + } + if (this.cameraColorGradingTexture) { + this.cameraColorGradingTexture.dispose(); + } + } + _super.prototype.dispose.call(this, forceDisposeEffect, forceDisposeTextures); + }; + PBRMaterial.prototype.clone = function (name) { + var _this = this; + return BABYLON.SerializationHelper.Clone(function () { return new PBRMaterial(name, _this.getScene()); }, this); + }; + PBRMaterial.prototype.serialize = function () { + var serializationObject = BABYLON.SerializationHelper.Serialize(this); + serializationObject.customType = "BABYLON.PBRMaterial"; + return serializationObject; + }; + // Statics + PBRMaterial.Parse = function (source, scene, rootUrl) { + return BABYLON.SerializationHelper.Parse(function () { return new PBRMaterial(source.name, scene); }, source, scene, rootUrl); + }; + PBRMaterial._scaledAlbedo = new BABYLON.Color3(); + PBRMaterial._scaledReflectivity = new BABYLON.Color3(); + PBRMaterial._scaledEmissive = new BABYLON.Color3(); + PBRMaterial._scaledReflection = new BABYLON.Color3(); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "directIntensity", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "emissiveIntensity", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "environmentIntensity", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "specularIntensity", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "disableBumpMap", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "overloadedShadowIntensity", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "overloadedShadeIntensity", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "cameraExposure", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "cameraContrast", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], PBRMaterial.prototype, "cameraColorGradingTexture", void 0); + __decorate([ + BABYLON.serializeAsColorCurves() + ], PBRMaterial.prototype, "cameraColorCurves", void 0); + __decorate([ + BABYLON.serializeAsColor3() + ], PBRMaterial.prototype, "overloadedAmbient", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "overloadedAmbientIntensity", void 0); + __decorate([ + BABYLON.serializeAsColor3() + ], PBRMaterial.prototype, "overloadedAlbedo", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "overloadedAlbedoIntensity", void 0); + __decorate([ + BABYLON.serializeAsColor3() + ], PBRMaterial.prototype, "overloadedReflectivity", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "overloadedReflectivityIntensity", void 0); + __decorate([ + BABYLON.serializeAsColor3() + ], PBRMaterial.prototype, "overloadedEmissive", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "overloadedEmissiveIntensity", void 0); + __decorate([ + BABYLON.serializeAsColor3() + ], PBRMaterial.prototype, "overloadedReflection", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "overloadedReflectionIntensity", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "overloadedMicroSurface", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "overloadedMicroSurfaceIntensity", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], PBRMaterial.prototype, "albedoTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], PBRMaterial.prototype, "ambientTexture", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "ambientTextureStrength", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], PBRMaterial.prototype, "opacityTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], PBRMaterial.prototype, "reflectionTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], PBRMaterial.prototype, "emissiveTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], PBRMaterial.prototype, "reflectivityTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], PBRMaterial.prototype, "metallicTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], PBRMaterial.prototype, "bumpTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], PBRMaterial.prototype, "lightmapTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture() + ], PBRMaterial.prototype, "refractionTexture", void 0); + __decorate([ + BABYLON.serializeAsColor3("ambient") + ], PBRMaterial.prototype, "ambientColor", void 0); + __decorate([ + BABYLON.serializeAsColor3("albedo") + ], PBRMaterial.prototype, "albedoColor", void 0); + __decorate([ + BABYLON.serializeAsColor3("reflectivity") + ], PBRMaterial.prototype, "reflectivityColor", void 0); + __decorate([ + BABYLON.serializeAsColor3("reflection") + ], PBRMaterial.prototype, "reflectionColor", void 0); + __decorate([ + BABYLON.serializeAsColor3("emissive") + ], PBRMaterial.prototype, "emissiveColor", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "microSurface", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "indexOfRefraction", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "invertRefractionY", void 0); + __decorate([ + BABYLON.serializeAsFresnelParameters() + ], PBRMaterial.prototype, "opacityFresnelParameters", void 0); + __decorate([ + BABYLON.serializeAsFresnelParameters() + ], PBRMaterial.prototype, "emissiveFresnelParameters", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "linkRefractionWithTransparency", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "linkEmissiveWithAlbedo", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "useLightmapAsShadowmap", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "useEmissiveAsIllumination", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "useAlphaFromAlbedoTexture", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "useSpecularOverAlpha", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "useMicroSurfaceFromReflectivityMapAlpha", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "useRoughnessFromMetallicTextureAlpha", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "useRoughnessFromMetallicTextureGreen", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "useAutoMicroSurfaceFromReflectivityMap", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "useScalarInLinearSpace", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "usePhysicalLightFalloff", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "useRadianceOverAlpha", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "useParallax", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "useParallaxOcclusion", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "parallaxScaleBias", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "disableLighting", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "maxSimultaneousLights", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "invertNormalMapX", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "invertNormalMapY", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "useLogarithmicDepth", null); + return PBRMaterial; + }(BABYLON.Material)); + BABYLON.PBRMaterial = PBRMaterial; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.pbrMaterial.js.map + +var BABYLON; +(function (BABYLON) { + var DebugLayer = (function () { + function DebugLayer(scene) { + var _this = this; + this._transformationMatrix = BABYLON.Matrix.Identity(); + this._enabled = false; + this._labelsEnabled = false; + this._displayStatistics = true; + this._displayTree = false; + this._displayLogs = false; + this._skeletonViewers = new Array(); + this._identityMatrix = BABYLON.Matrix.Identity(); + this.axisRatio = 0.02; + this.accentColor = "orange"; + this._scene = scene; + this._syncPositions = function () { + var engine = _this._scene.getEngine(); + var canvasRect = engine.getRenderingCanvasClientRect(); + if (_this._showUI) { + _this._statsDiv.style.left = (canvasRect.width - 410) + "px"; + _this._statsDiv.style.top = (canvasRect.height - 290) + "px"; + _this._statsDiv.style.width = "400px"; + _this._statsDiv.style.height = "auto"; + _this._statsSubsetDiv.style.maxHeight = "240px"; + _this._optionsDiv.style.left = "0px"; + _this._optionsDiv.style.top = "10px"; + _this._optionsDiv.style.width = "200px"; + _this._optionsDiv.style.height = "auto"; + _this._optionsSubsetDiv.style.maxHeight = (canvasRect.height - 225) + "px"; + _this._logDiv.style.left = "0px"; + _this._logDiv.style.top = (canvasRect.height - 170) + "px"; + _this._logDiv.style.width = "600px"; + _this._logDiv.style.height = "160px"; + _this._treeDiv.style.left = (canvasRect.width - 310) + "px"; + _this._treeDiv.style.top = "10px"; + _this._treeDiv.style.width = "300px"; + _this._treeDiv.style.height = "auto"; + _this._treeSubsetDiv.style.maxHeight = (canvasRect.height - 340) + "px"; + } + _this._globalDiv.style.left = canvasRect.left + "px"; + _this._globalDiv.style.top = canvasRect.top + "px"; + _this._drawingCanvas.style.left = "0px"; + _this._drawingCanvas.style.top = "0px"; + _this._drawingCanvas.style.width = engine.getRenderWidth() + "px"; + _this._drawingCanvas.style.height = engine.getRenderHeight() + "px"; + var devicePixelRatio = window.devicePixelRatio || 1; + var context = _this._drawingContext; + var backingStoreRatio = context.webkitBackingStorePixelRatio || + context.mozBackingStorePixelRatio || + context.msBackingStorePixelRatio || + context.oBackingStorePixelRatio || + context.backingStorePixelRatio || 1; + _this._ratio = devicePixelRatio / backingStoreRatio; + _this._drawingCanvas.width = engine.getRenderWidth() * _this._ratio; + _this._drawingCanvas.height = engine.getRenderHeight() * _this._ratio; + }; + this._onCanvasClick = function (evt) { + _this._clickPosition = { + x: evt.clientX * _this._ratio, + y: evt.clientY * _this._ratio + }; + }; + this._syncUI = function () { + if (_this._showUI) { + if (_this._displayStatistics) { + _this._displayStats(); + _this._statsDiv.style.display = ""; + } + else { + _this._statsDiv.style.display = "none"; + } + if (_this._displayLogs) { + _this._logDiv.style.display = ""; + } + else { + _this._logDiv.style.display = "none"; + } + if (_this._displayTree) { + _this._treeDiv.style.display = ""; + if (_this._needToRefreshMeshesTree) { + _this._needToRefreshMeshesTree = false; + _this._refreshMeshesTreeContent(); + } + } + else { + _this._treeDiv.style.display = "none"; + } + } + }; + this._syncData = function () { + if (_this._labelsEnabled || !_this._showUI) { + _this._camera.getViewMatrix().multiplyToRef(_this._camera.getProjectionMatrix(), _this._transformationMatrix); + _this._drawingContext.clearRect(0, 0, _this._drawingCanvas.width, _this._drawingCanvas.height); + var engine = _this._scene.getEngine(); + var viewport = _this._camera.viewport; + var globalViewport = viewport.toGlobal(engine.getRenderWidth(), engine.getRenderHeight()); + // Meshes + var meshes = _this._camera.getActiveMeshes(); + var index; + var projectedPosition; + for (index = 0; index < meshes.length; index++) { + var mesh = meshes.data[index]; + var position = mesh.getBoundingInfo().boundingSphere.center; + projectedPosition = BABYLON.Vector3.Project(position, mesh.getWorldMatrix(), _this._transformationMatrix, globalViewport); + if (mesh.renderOverlay || _this.shouldDisplayAxis && _this.shouldDisplayAxis(mesh)) { + _this._renderAxis(projectedPosition, mesh, globalViewport); + } + if (!_this.shouldDisplayLabel || _this.shouldDisplayLabel(mesh)) { + _this._renderLabel(mesh.name, projectedPosition, 12, function () { mesh.renderOverlay = !mesh.renderOverlay; }, function () { return mesh.renderOverlay ? 'red' : 'black'; }); + } + } + // Cameras + var cameras = _this._scene.cameras; + for (index = 0; index < cameras.length; index++) { + var camera = cameras[index]; + if (camera === _this._camera) { + continue; + } + projectedPosition = BABYLON.Vector3.Project(BABYLON.Vector3.Zero(), camera.getWorldMatrix(), _this._transformationMatrix, globalViewport); + if (!_this.shouldDisplayLabel || _this.shouldDisplayLabel(camera)) { + _this._renderLabel(camera.name, projectedPosition, 12, function () { + _this._camera.detachControl(engine.getRenderingCanvas()); + _this._camera = camera; + _this._camera.attachControl(engine.getRenderingCanvas()); + }, function () { return "purple"; }); + } + } + // Lights + var lights = _this._scene.lights; + for (index = 0; index < lights.length; index++) { + var light = lights[index]; + if (light.position) { + projectedPosition = BABYLON.Vector3.Project(light.getAbsolutePosition(), _this._identityMatrix, _this._transformationMatrix, globalViewport); + if (!_this.shouldDisplayLabel || _this.shouldDisplayLabel(light)) { + _this._renderLabel(light.name, projectedPosition, -20, function () { + light.setEnabled(!light.isEnabled()); + }, function () { return light.isEnabled() ? "orange" : "gray"; }); + } + } + } + } + _this._clickPosition = undefined; + }; + } + DebugLayer.prototype._refreshMeshesTreeContent = function () { + while (this._treeSubsetDiv.hasChildNodes()) { + this._treeSubsetDiv.removeChild(this._treeSubsetDiv.lastChild); + } + // Add meshes + var sortedArray = this._scene.meshes.slice(0, this._scene.meshes.length); + sortedArray.sort(function (a, b) { + if (a.name === b.name) { + return 0; + } + return (a.name > b.name) ? 1 : -1; + }); + for (var index = 0; index < sortedArray.length; index++) { + var mesh = sortedArray[index]; + if (!mesh.isEnabled()) { + continue; + } + this._generateAdvancedCheckBox(this._treeSubsetDiv, mesh.name, mesh.getTotalVertices() + " verts", mesh.isVisible, function (element, m) { + m.isVisible = element.checked; + }, mesh); + } + }; + DebugLayer.prototype._renderSingleAxis = function (zero, unit, unitText, label, color) { + this._drawingContext.beginPath(); + this._drawingContext.moveTo(zero.x, zero.y); + this._drawingContext.lineTo(unit.x, unit.y); + this._drawingContext.strokeStyle = color; + this._drawingContext.lineWidth = 4; + this._drawingContext.stroke(); + this._drawingContext.font = "normal 14px Segoe UI"; + this._drawingContext.fillStyle = color; + this._drawingContext.fillText(label, unitText.x, unitText.y); + }; + DebugLayer.prototype._renderAxis = function (projectedPosition, mesh, globalViewport) { + var position = mesh.getBoundingInfo().boundingSphere.center; + var worldMatrix = mesh.getWorldMatrix(); + var unprojectedVector = BABYLON.Vector3.UnprojectFromTransform(projectedPosition.add(new BABYLON.Vector3(this._drawingCanvas.width * this.axisRatio, 0, 0)), globalViewport.width, globalViewport.height, worldMatrix, this._transformationMatrix); + var unit = (unprojectedVector.subtract(position)).length(); + var xAxis = BABYLON.Vector3.Project(position.add(new BABYLON.Vector3(unit, 0, 0)), worldMatrix, this._transformationMatrix, globalViewport); + var xAxisText = BABYLON.Vector3.Project(position.add(new BABYLON.Vector3(unit * 1.5, 0, 0)), worldMatrix, this._transformationMatrix, globalViewport); + this._renderSingleAxis(projectedPosition, xAxis, xAxisText, "x", "#FF0000"); + var yAxis = BABYLON.Vector3.Project(position.add(new BABYLON.Vector3(0, unit, 0)), worldMatrix, this._transformationMatrix, globalViewport); + var yAxisText = BABYLON.Vector3.Project(position.add(new BABYLON.Vector3(0, unit * 1.5, 0)), worldMatrix, this._transformationMatrix, globalViewport); + this._renderSingleAxis(projectedPosition, yAxis, yAxisText, "y", "#00FF00"); + var zAxis = BABYLON.Vector3.Project(position.add(new BABYLON.Vector3(0, 0, unit)), worldMatrix, this._transformationMatrix, globalViewport); + var zAxisText = BABYLON.Vector3.Project(position.add(new BABYLON.Vector3(0, 0, unit * 1.5)), worldMatrix, this._transformationMatrix, globalViewport); + this._renderSingleAxis(projectedPosition, zAxis, zAxisText, "z", "#0000FF"); + }; + DebugLayer.prototype._renderLabel = function (text, projectedPosition, labelOffset, onClick, getFillStyle) { + if (projectedPosition.z > 0 && projectedPosition.z < 1.0) { + this._drawingContext.font = "normal 12px Segoe UI"; + var textMetrics = this._drawingContext.measureText(text); + var centerX = projectedPosition.x - textMetrics.width / 2; + var centerY = projectedPosition.y; + var clientRect = this._drawingCanvas.getBoundingClientRect(); + if (this._showUI && this._isClickInsideRect(clientRect.left * this._ratio + centerX - 5, clientRect.top * this._ratio + centerY - labelOffset - 12, textMetrics.width + 10, 17)) { + onClick(); + } + this._drawingContext.beginPath(); + this._drawingContext.rect(centerX - 5, centerY - labelOffset - 12, textMetrics.width + 10, 17); + this._drawingContext.fillStyle = getFillStyle(); + this._drawingContext.globalAlpha = 0.5; + this._drawingContext.fill(); + this._drawingContext.globalAlpha = 1.0; + this._drawingContext.strokeStyle = '#FFFFFF'; + this._drawingContext.lineWidth = 1; + this._drawingContext.stroke(); + this._drawingContext.fillStyle = "#FFFFFF"; + this._drawingContext.fillText(text, centerX, centerY - labelOffset); + this._drawingContext.beginPath(); + this._drawingContext.arc(projectedPosition.x, centerY, 5, 0, 2 * Math.PI, false); + this._drawingContext.fill(); + } + }; + DebugLayer.prototype._isClickInsideRect = function (x, y, width, height) { + if (!this._clickPosition) { + return false; + } + if (this._clickPosition.x < x || this._clickPosition.x > x + width) { + return false; + } + if (this._clickPosition.y < y || this._clickPosition.y > y + height) { + return false; + } + return true; + }; + DebugLayer.prototype.isVisible = function () { + return this._enabled; + }; + DebugLayer.prototype.hide = function () { + if (!this._enabled) { + return; + } + this._enabled = false; + var engine = this._scene.getEngine(); + this._scene.unregisterBeforeRender(this._syncData); + this._scene.unregisterAfterRender(this._syncUI); + this._rootElement.removeChild(this._globalDiv); + this._scene.forceShowBoundingBoxes = false; + this._scene.forceWireframe = false; + BABYLON.StandardMaterial.DiffuseTextureEnabled = true; + BABYLON.StandardMaterial.AmbientTextureEnabled = true; + BABYLON.StandardMaterial.SpecularTextureEnabled = true; + BABYLON.StandardMaterial.EmissiveTextureEnabled = true; + BABYLON.StandardMaterial.BumpTextureEnabled = true; + BABYLON.StandardMaterial.OpacityTextureEnabled = true; + BABYLON.StandardMaterial.ReflectionTextureEnabled = true; + BABYLON.StandardMaterial.LightmapTextureEnabled = true; + BABYLON.StandardMaterial.RefractionTextureEnabled = true; + BABYLON.StandardMaterial.ColorGradingTextureEnabled = true; + this._scene.shadowsEnabled = true; + this._scene.particlesEnabled = true; + this._scene.postProcessesEnabled = true; + this._scene.collisionsEnabled = true; + this._scene.lightsEnabled = true; + this._scene.texturesEnabled = true; + this._scene.lensFlaresEnabled = true; + this._scene.proceduralTexturesEnabled = true; + this._scene.renderTargetsEnabled = true; + this._scene.probesEnabled = true; + engine.getRenderingCanvas().removeEventListener("click", this._onCanvasClick); + this._clearSkeletonViewers(); + }; + DebugLayer.prototype._clearSkeletonViewers = function () { + for (var index = 0; index < this._skeletonViewers.length; index++) { + this._skeletonViewers[index].dispose(); + } + this._skeletonViewers = []; + }; + DebugLayer.prototype.show = function (showUI, camera, rootElement) { + if (showUI === void 0) { showUI = true; } + if (camera === void 0) { camera = null; } + if (rootElement === void 0) { rootElement = null; } + if (this._enabled) { + return; + } + this._enabled = true; + if (camera) { + this._camera = camera; + } + else { + this._camera = this._scene.activeCamera; + } + this._showUI = showUI; + var engine = this._scene.getEngine(); + this._globalDiv = document.createElement("div"); + this._rootElement = rootElement || document.body; + this._rootElement.appendChild(this._globalDiv); + this._generateDOMelements(); + engine.getRenderingCanvas().addEventListener("click", this._onCanvasClick); + this._syncPositions(); + this._scene.registerBeforeRender(this._syncData); + this._scene.registerAfterRender(this._syncUI); + }; + DebugLayer.prototype._clearLabels = function () { + this._drawingContext.clearRect(0, 0, this._drawingCanvas.width, this._drawingCanvas.height); + for (var index = 0; index < this._scene.meshes.length; index++) { + var mesh = this._scene.meshes[index]; + mesh.renderOverlay = false; + } + }; + DebugLayer.prototype._generateheader = function (root, text) { + var header = document.createElement("div"); + header.innerHTML = text + " "; + header.style.textAlign = "right"; + header.style.width = "100%"; + header.style.color = "white"; + header.style.backgroundColor = "Black"; + header.style.padding = "5px 5px 4px 0px"; + header.style.marginLeft = "-5px"; + header.style.fontWeight = "bold"; + root.appendChild(header); + }; + DebugLayer.prototype._generateTexBox = function (root, title, color) { + var label = document.createElement("label"); + label.style.display = "inline"; + label.innerHTML = title; + label.style.color = color; + root.appendChild(label); + root.appendChild(document.createElement("br")); + }; + DebugLayer.prototype._generateAdvancedCheckBox = function (root, leftTitle, rightTitle, initialState, task, tag) { + if (tag === void 0) { tag = null; } + var label = document.createElement("label"); + label.style.display = "inline"; + var boundingBoxesCheckbox = document.createElement("input"); + boundingBoxesCheckbox.type = "checkbox"; + boundingBoxesCheckbox.checked = initialState; + boundingBoxesCheckbox.style.display = "inline"; + boundingBoxesCheckbox.style.margin = "0px 5px 0px 0px"; + boundingBoxesCheckbox.style.verticalAlign = "sub"; + boundingBoxesCheckbox.addEventListener("change", function (evt) { + task(evt.target, tag); + }); + label.appendChild(boundingBoxesCheckbox); + var container = document.createElement("span"); + var leftPart = document.createElement("span"); + var rightPart = document.createElement("span"); + rightPart.style.cssFloat = "right"; + leftPart.innerHTML = leftTitle; + rightPart.innerHTML = rightTitle; + rightPart.style.fontSize = "12px"; + rightPart.style.maxWidth = "200px"; + container.appendChild(leftPart); + container.appendChild(rightPart); + label.appendChild(container); + root.appendChild(label); + root.appendChild(document.createElement("br")); + }; + DebugLayer.prototype._generateCheckBox = function (root, title, initialState, task, tag) { + if (tag === void 0) { tag = null; } + var label = document.createElement("label"); + label.style.display = "inline"; + var checkBox = document.createElement("input"); + checkBox.type = "checkbox"; + checkBox.checked = initialState; + checkBox.style.display = "inline"; + checkBox.style.margin = "0px 5px 0px 0px"; + checkBox.style.verticalAlign = "sub"; + checkBox.addEventListener("change", function (evt) { + task(evt.target, tag); + }); + label.appendChild(checkBox); + label.appendChild(document.createTextNode(title)); + root.appendChild(label); + root.appendChild(document.createElement("br")); + }; + DebugLayer.prototype._generateButton = function (root, title, task, tag) { + if (tag === void 0) { tag = null; } + var button = document.createElement("button"); + button.innerHTML = title; + button.style.height = "24px"; + button.style.width = "150px"; + button.style.marginBottom = "5px"; + button.style.color = "#444444"; + button.style.border = "1px solid white"; + button.className = "debugLayerButton"; + button.addEventListener("click", function (evt) { + task(evt.target, tag); + }); + root.appendChild(button); + root.appendChild(document.createElement("br")); + }; + DebugLayer.prototype._generateRadio = function (root, title, name, initialState, task, tag) { + if (tag === void 0) { tag = null; } + var label = document.createElement("label"); + label.style.display = "inline"; + var boundingBoxesRadio = document.createElement("input"); + boundingBoxesRadio.type = "radio"; + boundingBoxesRadio.name = name; + boundingBoxesRadio.checked = initialState; + boundingBoxesRadio.style.display = "inline"; + boundingBoxesRadio.style.margin = "0px 5px 0px 0px"; + boundingBoxesRadio.style.verticalAlign = "sub"; + boundingBoxesRadio.addEventListener("change", function (evt) { + task(evt.target, tag); + }); + label.appendChild(boundingBoxesRadio); + label.appendChild(document.createTextNode(title)); + root.appendChild(label); + root.appendChild(document.createElement("br")); + }; + DebugLayer.prototype._generateDOMelements = function () { + var _this = this; + this._globalDiv.id = "DebugLayer"; + this._globalDiv.style.position = "absolute"; + this._globalDiv.style.fontFamily = "Segoe UI, Arial"; + this._globalDiv.style.fontSize = "14px"; + this._globalDiv.style.color = "white"; + // Drawing canvas + this._drawingCanvas = document.createElement("canvas"); + this._drawingCanvas.id = "DebugLayerDrawingCanvas"; + this._drawingCanvas.style.position = "absolute"; + this._drawingCanvas.style.pointerEvents = "none"; + this._drawingCanvas.style.backgroundColor = "transparent"; + this._drawingContext = this._drawingCanvas.getContext("2d"); + this._globalDiv.appendChild(this._drawingCanvas); + if (this._showUI) { + var background = "rgba(128, 128, 128, 0.4)"; + var border = "rgb(180, 180, 180) solid 1px"; + // Stats + this._statsDiv = document.createElement("div"); + this._statsDiv.id = "DebugLayerStats"; + this._statsDiv.style.border = border; + this._statsDiv.style.position = "absolute"; + this._statsDiv.style.background = background; + this._statsDiv.style.padding = "0px 0px 0px 5px"; + this._generateheader(this._statsDiv, "STATISTICS"); + this._statsSubsetDiv = document.createElement("div"); + this._statsSubsetDiv.style.paddingTop = "5px"; + this._statsSubsetDiv.style.paddingBottom = "5px"; + this._statsSubsetDiv.style.overflowY = "auto"; + this._statsDiv.appendChild(this._statsSubsetDiv); + // Tree + this._treeDiv = document.createElement("div"); + this._treeDiv.id = "DebugLayerTree"; + this._treeDiv.style.border = border; + this._treeDiv.style.position = "absolute"; + this._treeDiv.style.background = background; + this._treeDiv.style.padding = "0px 0px 0px 5px"; + this._treeDiv.style.display = "none"; + this._generateheader(this._treeDiv, "MESHES TREE"); + this._treeSubsetDiv = document.createElement("div"); + this._treeSubsetDiv.style.paddingTop = "5px"; + this._treeSubsetDiv.style.paddingRight = "5px"; + this._treeSubsetDiv.style.overflowY = "auto"; + this._treeSubsetDiv.style.maxHeight = "300px"; + this._treeDiv.appendChild(this._treeSubsetDiv); + this._needToRefreshMeshesTree = true; + // Logs + this._logDiv = document.createElement("div"); + this._logDiv.style.border = border; + this._logDiv.id = "DebugLayerLogs"; + this._logDiv.style.position = "absolute"; + this._logDiv.style.background = background; + this._logDiv.style.padding = "0px 0px 0px 5px"; + this._logDiv.style.display = "none"; + this._generateheader(this._logDiv, "LOGS"); + this._logSubsetDiv = document.createElement("div"); + this._logSubsetDiv.style.height = "127px"; + this._logSubsetDiv.style.paddingTop = "5px"; + this._logSubsetDiv.style.overflowY = "auto"; + this._logSubsetDiv.style.fontSize = "12px"; + this._logSubsetDiv.style.fontFamily = "consolas"; + this._logSubsetDiv.innerHTML = BABYLON.Tools.LogCache; + this._logDiv.appendChild(this._logSubsetDiv); + BABYLON.Tools.OnNewCacheEntry = function (entry) { + _this._logSubsetDiv.innerHTML = entry + _this._logSubsetDiv.innerHTML; + }; + // Options + this._optionsDiv = document.createElement("div"); + this._optionsDiv.id = "DebugLayerOptions"; + this._optionsDiv.style.border = border; + this._optionsDiv.style.position = "absolute"; + this._optionsDiv.style.background = background; + this._optionsDiv.style.padding = "0px 0px 0px 5px"; + this._optionsDiv.style.overflowY = "auto"; + this._generateheader(this._optionsDiv, "OPTIONS"); + this._optionsSubsetDiv = document.createElement("div"); + this._optionsSubsetDiv.style.paddingTop = "5px"; + this._optionsSubsetDiv.style.paddingBottom = "5px"; + this._optionsSubsetDiv.style.overflowY = "auto"; + this._optionsSubsetDiv.style.maxHeight = "200px"; + this._optionsDiv.appendChild(this._optionsSubsetDiv); + this._generateTexBox(this._optionsSubsetDiv, "Windows:", this.accentColor); + this._generateCheckBox(this._optionsSubsetDiv, "Statistics", this._displayStatistics, function (element) { _this._displayStatistics = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Logs", this._displayLogs, function (element) { _this._displayLogs = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Meshes tree", this._displayTree, function (element) { + _this._displayTree = element.checked; + _this._needToRefreshMeshesTree = true; + }); + this._optionsSubsetDiv.appendChild(document.createElement("br")); + this._generateTexBox(this._optionsSubsetDiv, "General:", this.accentColor); + this._generateCheckBox(this._optionsSubsetDiv, "Bounding boxes", this._scene.forceShowBoundingBoxes, function (element) { _this._scene.forceShowBoundingBoxes = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Clickable labels", this._labelsEnabled, function (element) { + _this._labelsEnabled = element.checked; + if (!_this._labelsEnabled) { + _this._clearLabels(); + } + }); + this._generateCheckBox(this._optionsSubsetDiv, "Generate user marks (F12)", BABYLON.Tools.PerformanceLogLevel === BABYLON.Tools.PerformanceUserMarkLogLevel, function (element) { + if (element.checked) { + BABYLON.Tools.PerformanceLogLevel = BABYLON.Tools.PerformanceUserMarkLogLevel; + } + else { + BABYLON.Tools.PerformanceLogLevel = BABYLON.Tools.PerformanceNoneLogLevel; + } + }); + ; + this._optionsSubsetDiv.appendChild(document.createElement("br")); + this._generateTexBox(this._optionsSubsetDiv, "Rendering mode:", this.accentColor); + this._generateRadio(this._optionsSubsetDiv, "Solid", "renderMode", !this._scene.forceWireframe && !this._scene.forcePointsCloud, function (element) { + if (element.checked) { + _this._scene.forceWireframe = false; + _this._scene.forcePointsCloud = false; + } + }); + this._generateRadio(this._optionsSubsetDiv, "Wireframe", "renderMode", this._scene.forceWireframe, function (element) { + if (element.checked) { + _this._scene.forceWireframe = true; + _this._scene.forcePointsCloud = false; + } + }); + this._generateRadio(this._optionsSubsetDiv, "Point", "renderMode", this._scene.forcePointsCloud, function (element) { + if (element.checked) { + _this._scene.forceWireframe = false; + _this._scene.forcePointsCloud = true; + } + }); + this._optionsSubsetDiv.appendChild(document.createElement("br")); + this._generateTexBox(this._optionsSubsetDiv, "Texture channels:", this.accentColor); + this._generateCheckBox(this._optionsSubsetDiv, "Diffuse", BABYLON.StandardMaterial.DiffuseTextureEnabled, function (element) { BABYLON.StandardMaterial.DiffuseTextureEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Ambient", BABYLON.StandardMaterial.AmbientTextureEnabled, function (element) { BABYLON.StandardMaterial.AmbientTextureEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Specular", BABYLON.StandardMaterial.SpecularTextureEnabled, function (element) { BABYLON.StandardMaterial.SpecularTextureEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Emissive", BABYLON.StandardMaterial.EmissiveTextureEnabled, function (element) { BABYLON.StandardMaterial.EmissiveTextureEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Bump", BABYLON.StandardMaterial.BumpTextureEnabled, function (element) { BABYLON.StandardMaterial.BumpTextureEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Opacity", BABYLON.StandardMaterial.OpacityTextureEnabled, function (element) { BABYLON.StandardMaterial.OpacityTextureEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Reflection", BABYLON.StandardMaterial.ReflectionTextureEnabled, function (element) { BABYLON.StandardMaterial.ReflectionTextureEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Refraction", BABYLON.StandardMaterial.RefractionTextureEnabled, function (element) { BABYLON.StandardMaterial.RefractionTextureEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "ColorGrading", BABYLON.StandardMaterial.ColorGradingTextureEnabled, function (element) { BABYLON.StandardMaterial.ColorGradingTextureEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Lightmap", BABYLON.StandardMaterial.LightmapTextureEnabled, function (element) { BABYLON.StandardMaterial.LightmapTextureEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Fresnel", BABYLON.StandardMaterial.FresnelEnabled, function (element) { BABYLON.StandardMaterial.FresnelEnabled = element.checked; }); + this._optionsSubsetDiv.appendChild(document.createElement("br")); + this._generateTexBox(this._optionsSubsetDiv, "Options:", this.accentColor); + this._generateCheckBox(this._optionsSubsetDiv, "Animations", this._scene.animationsEnabled, function (element) { _this._scene.animationsEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Collisions", this._scene.collisionsEnabled, function (element) { _this._scene.collisionsEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Fog", this._scene.fogEnabled, function (element) { _this._scene.fogEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Lens flares", this._scene.lensFlaresEnabled, function (element) { _this._scene.lensFlaresEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Lights", this._scene.lightsEnabled, function (element) { _this._scene.lightsEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Particles", this._scene.particlesEnabled, function (element) { _this._scene.particlesEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Post-processes", this._scene.postProcessesEnabled, function (element) { _this._scene.postProcessesEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Probes", this._scene.probesEnabled, function (element) { _this._scene.probesEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Procedural textures", this._scene.proceduralTexturesEnabled, function (element) { _this._scene.proceduralTexturesEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Render targets", this._scene.renderTargetsEnabled, function (element) { _this._scene.renderTargetsEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Shadows", this._scene.shadowsEnabled, function (element) { _this._scene.shadowsEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Skeletons", this._scene.skeletonsEnabled, function (element) { _this._scene.skeletonsEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Sprites", this._scene.spritesEnabled, function (element) { _this._scene.spritesEnabled = element.checked; }); + this._generateCheckBox(this._optionsSubsetDiv, "Textures", this._scene.texturesEnabled, function (element) { _this._scene.texturesEnabled = element.checked; }); + if (BABYLON.AudioEngine && BABYLON.Engine.audioEngine.canUseWebAudio) { + this._optionsSubsetDiv.appendChild(document.createElement("br")); + this._generateTexBox(this._optionsSubsetDiv, "Audio:", this.accentColor); + this._generateRadio(this._optionsSubsetDiv, "Headphones", "panningModel", this._scene.headphone, function (element) { + if (element.checked) { + _this._scene.headphone = true; + } + }); + this._generateRadio(this._optionsSubsetDiv, "Normal Speakers", "panningModel", !this._scene.headphone, function (element) { + if (element.checked) { + _this._scene.headphone = false; + } + }); + this._generateCheckBox(this._optionsSubsetDiv, "Disable audio", !this._scene.audioEnabled, function (element) { + _this._scene.audioEnabled = !element.checked; + }); + } + this._optionsSubsetDiv.appendChild(document.createElement("br")); + this._generateTexBox(this._optionsSubsetDiv, "Viewers:", this.accentColor); + this._generateCheckBox(this._optionsSubsetDiv, "Skeletons", false, function (element) { + if (!element.checked) { + _this._clearSkeletonViewers(); + return; + } + for (var index = 0; index < _this._scene.meshes.length; index++) { + var mesh = _this._scene.meshes[index]; + if (mesh.skeleton) { + var found = false; + for (var sIndex = 0; sIndex < _this._skeletonViewers.length; sIndex++) { + if (_this._skeletonViewers[sIndex].skeleton === mesh.skeleton) { + found = true; + break; + } + } + if (found) { + continue; + } + var viewer = new BABYLON.Debug.SkeletonViewer(mesh.skeleton, mesh, _this._scene); + viewer.isEnabled = true; + _this._skeletonViewers.push(viewer); + } + } + }); + this._optionsSubsetDiv.appendChild(document.createElement("br")); + this._generateTexBox(this._optionsSubsetDiv, "Tools:", this.accentColor); + this._generateButton(this._optionsSubsetDiv, "Dump rendertargets", function (element) { _this._scene.dumpNextRenderTargets = true; }); + this._generateButton(this._optionsSubsetDiv, "Run SceneOptimizer", function (element) { BABYLON.SceneOptimizer.OptimizeAsync(_this._scene); }); + this._generateButton(this._optionsSubsetDiv, "Log camera object", function (element) { + if (_this._camera) { + console.log(_this._camera); + } + else { + console.warn("No camera defined, or debug layer created before camera creation!"); + } + }); + this._optionsSubsetDiv.appendChild(document.createElement("br")); + this._globalDiv.appendChild(this._statsDiv); + this._globalDiv.appendChild(this._logDiv); + this._globalDiv.appendChild(this._optionsDiv); + this._globalDiv.appendChild(this._treeDiv); + } + }; + DebugLayer.prototype._displayStats = function () { + var scene = this._scene; + var engine = scene.getEngine(); + var glInfo = engine.getGlInfo(); + this._statsSubsetDiv.innerHTML = "Babylon.js v" + BABYLON.Engine.Version + " - " + BABYLON.Tools.Format(engine.getFps(), 0) + " fps

    " + + "
    " + + "
    " + + "Extensions
    " + + "Std derivatives: " + (engine.getCaps().standardDerivatives ? "Yes" : "No") + "
    " + + "Compressed textures: " + (engine.getCaps().s3tc ? "Yes" : "No") + "
    " + + "Hardware instances: " + (engine.getCaps().instancedArrays ? "Yes" : "No") + "
    " + + "Texture float: " + (engine.getCaps().textureFloat ? "Yes" : "No") + "

    " + + "32bits indices: " + (engine.getCaps().uintIndices ? "Yes" : "No") + "
    " + + "Fragment depth: " + (engine.getCaps().fragmentDepthSupported ? "Yes" : "No") + "
    " + + "High precision shaders: " + (engine.getCaps().highPrecisionShaderSupported ? "Yes" : "No") + "
    " + + "Draw buffers: " + (engine.getCaps().drawBuffersExtension ? "Yes" : "No") + "
    " + + "

    " + + "
    " + + "Caps.
    " + + "Stencil: " + (engine.isStencilEnable ? "Enabled" : "Disabled") + "
    " + + "Max textures units: " + engine.getCaps().maxTexturesImageUnits + "
    " + + "Max textures size: " + engine.getCaps().maxTextureSize + "
    " + + "Max anisotropy: " + engine.getCaps().maxAnisotropy + "
    " + + "Info
    " + + "WebGL feature level: " + engine.webGLVersion + "
    " + + glInfo.version + "
    " + + "

    " + + glInfo.renderer + "
    "; + if (this.customStatsFunction) { + this._statsSubsetDiv.innerHTML += this.customStatsFunction(); + } + }; + return DebugLayer; + }()); + BABYLON.DebugLayer = DebugLayer; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.debugLayer.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + var StandardRenderingPipeline = (function (_super) { + __extends(StandardRenderingPipeline, _super); + /** + * @constructor + * @param {string} name - The rendering pipeline name + * @param {BABYLON.Scene} scene - The scene linked to this pipeline + * @param {any} ratio - The size of the postprocesses (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5) + * @param {BABYLON.PostProcess} originalPostProcess - the custom original color post-process. Must be "reusable". Can be null. + * @param {BABYLON.Camera[]} cameras - The array of cameras that the rendering pipeline will be attached to + */ + function StandardRenderingPipeline(name, scene, ratio, originalPostProcess, cameras) { + var _this = this; + if (originalPostProcess === void 0) { originalPostProcess = null; } + _super.call(this, scene.getEngine(), name); + this.downSampleX4PostProcess = null; + this.brightPassPostProcess = null; + this.gaussianBlurHPostProcesses = []; + this.gaussianBlurVPostProcesses = []; + this.textureAdderPostProcess = null; + this.textureAdderFinalPostProcess = null; + this.lensFlarePostProcess = null; + this.lensFlareComposePostProcess = null; + this.depthOfFieldPostProcess = null; + // Values + this.brightThreshold = 1.0; + this.blurWidth = 2.0; + this.gaussianCoefficient = 0.25; + this.gaussianMean = 1.0; + this.gaussianStandardDeviation = 1.0; + this.exposure = 1.0; + this.lensTexture = null; + this.lensColorTexture = null; + this.lensFlareStrength = 20.0; + this.lensFlareGhostDispersal = 1.4; + this.lensFlareHaloWidth = 0.7; + this.lensFlareDistortionStrength = 16.0; + this.lensStarTexture = null; + this.lensFlareDirtTexture = null; + this.depthOfFieldDistance = 10.0; + // IAnimatable + this.animations = []; + this._depthRenderer = null; + // Getters and setters + this._depthOfFieldEnabled = true; + this._lensFlareEnabled = true; + // Initialize + this._scene = scene; + // Create pass post-processe + if (!originalPostProcess) { + this.originalPostProcess = new BABYLON.PostProcess("HDRPass", "standard", [], [], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), true, "#define PASS_POST_PROCESS", BABYLON.Engine.TEXTURETYPE_FLOAT); + } + else { + this.originalPostProcess = originalPostProcess; + } + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRPassPostProcess", function () { return _this.originalPostProcess; }, true)); + // Create down sample X4 post-process + this._createDownSampleX4PostProcess(scene, ratio / 2); + // Create bright pass post-process + this._createBrightPassPostProcess(scene, ratio / 2); + // Create gaussian blur post-processes (down sampling blurs) + this._createGaussianBlurPostProcesses(scene, ratio / 2, 0); + this._createGaussianBlurPostProcesses(scene, ratio / 4, 1); + this._createGaussianBlurPostProcesses(scene, ratio / 8, 2); + this._createGaussianBlurPostProcesses(scene, ratio / 16, 3); + // Create texture adder post-process + this._createTextureAdderPostProcess(scene, ratio); + // Create depth-of-field source post-process + this.textureAdderFinalPostProcess = new BABYLON.PostProcess("HDRDepthOfFieldSource", "standard", [], [], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), true, "#define PASS_POST_PROCESS", BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT); + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRDepthOfFieldSource", function () { return _this.textureAdderFinalPostProcess; }, true)); + // Create lens flare post-process + this._createLensFlarePostProcess(scene, ratio); + // Create gaussian blur used by depth-of-field + this._createGaussianBlurPostProcesses(scene, ratio / 2, 5); + // Create depth-of-field post-process + this._createDepthOfFieldPostProcess(scene, ratio); + // Finish + scene.postProcessRenderPipelineManager.addPipeline(this); + if (cameras !== null) { + scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name, cameras); + } + // Deactivate + this.LensFlareEnabled = false; + this.DepthOfFieldEnabled = false; + } + Object.defineProperty(StandardRenderingPipeline.prototype, "DepthOfFieldEnabled", { + get: function () { + return this._depthOfFieldEnabled; + }, + set: function (enabled) { + var blurIndex = this.gaussianBlurHPostProcesses.length - 1; + if (enabled && !this._depthOfFieldEnabled) { + this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRGaussianBlurH" + blurIndex, this._scene.cameras); + this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRGaussianBlurV" + blurIndex, this._scene.cameras); + this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRDepthOfField", this._scene.cameras); + this._depthRenderer = this._scene.enableDepthRenderer(); + } + else if (!enabled && this._depthOfFieldEnabled) { + this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRGaussianBlurH" + blurIndex, this._scene.cameras); + this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRGaussianBlurV" + blurIndex, this._scene.cameras); + this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRDepthOfField", this._scene.cameras); + } + this._depthOfFieldEnabled = enabled; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardRenderingPipeline.prototype, "LensFlareEnabled", { + get: function () { + return this._lensFlareEnabled; + }, + set: function (enabled) { + var blurIndex = this.gaussianBlurHPostProcesses.length - 2; + if (enabled && !this._lensFlareEnabled) { + this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRLensFlare", this._scene.cameras); + this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRLensFlareShift", this._scene.cameras); + this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRGaussianBlurH" + blurIndex, this._scene.cameras); + this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRGaussianBlurV" + blurIndex, this._scene.cameras); + this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRLensFlareCompose", this._scene.cameras); + } + else if (!enabled && this._lensFlareEnabled) { + this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRLensFlare", this._scene.cameras); + this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRLensFlareShift", this._scene.cameras); + this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRGaussianBlurH" + blurIndex, this._scene.cameras); + this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRGaussianBlurV" + blurIndex, this._scene.cameras); + this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRLensFlareCompose", this._scene.cameras); + } + this._lensFlareEnabled = enabled; + }, + enumerable: true, + configurable: true + }); + // Down Sample X4 Post-Processs + StandardRenderingPipeline.prototype._createDownSampleX4PostProcess = function (scene, ratio) { + var _this = this; + var downSampleX4Offsets = new Array(32); + this.downSampleX4PostProcess = new BABYLON.PostProcess("HDRDownSampleX4", "standard", ["dsOffsets"], [], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define DOWN_SAMPLE_X4", BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT); + this.downSampleX4PostProcess.onApply = function (effect) { + var id = 0; + for (var i = -2; i < 2; i++) { + for (var j = -2; j < 2; j++) { + downSampleX4Offsets[id] = (i + 0.5) * (1.0 / _this.downSampleX4PostProcess.width); + downSampleX4Offsets[id + 1] = (j + 0.5) * (1.0 / _this.downSampleX4PostProcess.height); + id += 2; + } + } + effect.setArray2("dsOffsets", downSampleX4Offsets); + }; + // Add to pipeline + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRDownSampleX4", function () { return _this.downSampleX4PostProcess; }, true)); + }; + // Brightpass Post-Process + StandardRenderingPipeline.prototype._createBrightPassPostProcess = function (scene, ratio) { + var _this = this; + var brightOffsets = new Array(8); + this.brightPassPostProcess = new BABYLON.PostProcess("HDRBrightPass", "standard", ["dsOffsets", "brightThreshold"], [], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define BRIGHT_PASS", BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT); + this.brightPassPostProcess.onApply = function (effect) { + var sU = (1.0 / _this.brightPassPostProcess.width); + var sV = (1.0 / _this.brightPassPostProcess.height); + brightOffsets[0] = -0.5 * sU; + brightOffsets[1] = 0.5 * sV; + brightOffsets[2] = 0.5 * sU; + brightOffsets[3] = 0.5 * sV; + brightOffsets[4] = -0.5 * sU; + brightOffsets[5] = -0.5 * sV; + brightOffsets[6] = 0.5 * sU; + brightOffsets[7] = -0.5 * sV; + effect.setArray2("dsOffsets", brightOffsets); + effect.setFloat("brightThreshold", _this.brightThreshold); + }; + // Add to pipeline + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRBrightPass", function () { return _this.brightPassPostProcess; }, true)); + }; + // Create gaussian blur H&V post-processes + StandardRenderingPipeline.prototype._createGaussianBlurPostProcesses = function (scene, ratio, indice) { + var _this = this; + var blurOffsets = new Array(9); + var blurWeights = new Array(9); + var uniforms = ["blurOffsets", "blurWeights", "blurWidth"]; + var callback = function (height) { + return function (effect) { + // Weights + var x = 0.0; + for (var i = 0; i < 9; i++) { + x = (i - 4.0) / 4.0; + blurWeights[i] = + _this.gaussianCoefficient + * (1.0 / Math.sqrt(2.0 * Math.PI * _this.gaussianStandardDeviation)) + * Math.exp((-((x - _this.gaussianMean) * (x - _this.gaussianMean))) / (2.0 * _this.gaussianStandardDeviation * _this.gaussianStandardDeviation)); + } + var lastOutputDimensions = { + width: scene.getEngine().getRenderWidth(), + height: scene.getEngine().getRenderHeight() + }; + for (var i = 0; i < 9; i++) { + var value = (i - 4.0) * (1.0 / (height === true ? lastOutputDimensions.height : lastOutputDimensions.width)); + blurOffsets[i] = value; + } + effect.setArray("blurOffsets", blurOffsets); + effect.setArray("blurWeights", blurWeights); + effect.setFloat("blurWidth", _this.blurWidth); + }; + }; + // Create horizontal gaussian blur post-processes + var gaussianBlurHPostProcess = new BABYLON.PostProcess("HDRGaussianBlurH" + ratio, "standard", uniforms, [], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define GAUSSIAN_BLUR_H", BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT); + gaussianBlurHPostProcess.onApply = callback(false); + // Create vertical gaussian blur post-process + var gaussianBlurVPostProcess = new BABYLON.PostProcess("HDRGaussianBlurV" + ratio, "standard", uniforms, [], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define GAUSSIAN_BLUR_V", BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT); + gaussianBlurVPostProcess.onApply = callback(true); + // Add to pipeline + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRGaussianBlurH" + indice, function () { return gaussianBlurHPostProcess; }, true)); + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRGaussianBlurV" + indice, function () { return gaussianBlurVPostProcess; }, true)); + // Finish + this.gaussianBlurHPostProcesses.push(gaussianBlurHPostProcess); + this.gaussianBlurVPostProcesses.push(gaussianBlurVPostProcess); + }; + // Create texture adder post-process + StandardRenderingPipeline.prototype._createTextureAdderPostProcess = function (scene, ratio) { + var _this = this; + var lastGaussianBlurPostProcess = this.gaussianBlurVPostProcesses[3]; + this.textureAdderPostProcess = new BABYLON.PostProcess("HDRTextureAdder", "standard", ["exposure"], ["otherSampler", "lensSampler"], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define TEXTURE_ADDER", BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT); + this.textureAdderPostProcess.onApply = function (effect) { + effect.setTextureFromPostProcess("otherSampler", _this.originalPostProcess); + effect.setTexture("lensSampler", _this.lensTexture); + effect.setFloat("exposure", _this.exposure); + }; + // Add to pipeline + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRTextureAdder", function () { return _this.textureAdderPostProcess; }, true)); + }; + // Create lens flare post-process + StandardRenderingPipeline.prototype._createLensFlarePostProcess = function (scene, ratio) { + var _this = this; + this.lensFlarePostProcess = new BABYLON.PostProcess("HDRLensFlare", "standard", ["strength", "ghostDispersal", "haloWidth", "resolution", "distortionStrength"], ["lensColorSampler"], ratio / 2, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), true, "#define LENS_FLARE", BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT); + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRLensFlare", function () { return _this.lensFlarePostProcess; }, false)); + this._createGaussianBlurPostProcesses(scene, ratio / 4, 4); + this.lensFlareComposePostProcess = new BABYLON.PostProcess("HDRLensFlareCompose", "standard", ["lensStarMatrix"], ["otherSampler", "lensDirtSampler", "lensStarSampler"], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define LENS_FLARE_COMPOSE", BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT); + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRLensFlareCompose", function () { return _this.lensFlareComposePostProcess; }, false)); + var resolution = new BABYLON.Vector2(0, 0); + // Lens flare + this.lensFlarePostProcess.onApply = function (effect) { + effect.setTextureFromPostProcess("textureSampler", _this.gaussianBlurHPostProcesses[0]); + effect.setTexture("lensColorSampler", _this.lensColorTexture); + effect.setFloat("strength", _this.lensFlareStrength); + effect.setFloat("ghostDispersal", _this.lensFlareGhostDispersal); + effect.setFloat("haloWidth", _this.lensFlareHaloWidth); + // Shift + resolution.x = _this.lensFlarePostProcess.width; + resolution.y = _this.lensFlarePostProcess.height; + effect.setVector2("resolution", resolution); + effect.setFloat("distortionStrength", _this.lensFlareDistortionStrength); + }; + // Compose + var scaleBias1 = BABYLON.Matrix.FromValues(2.0, 0.0, -1.0, 0.0, 0.0, 2.0, -1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0); + var scaleBias2 = BABYLON.Matrix.FromValues(0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0); + this.lensFlareComposePostProcess.onApply = function (effect) { + effect.setTextureFromPostProcess("otherSampler", _this.textureAdderFinalPostProcess); + effect.setTexture("lensDirtSampler", _this.lensFlareDirtTexture); + effect.setTexture("lensStarSampler", _this.lensStarTexture); + // Lens start rotation matrix + var camerax = _this._scene.activeCamera.getViewMatrix().getRow(0); + var cameraz = _this._scene.activeCamera.getViewMatrix().getRow(2); + var camRot = BABYLON.Vector3.Dot(camerax.toVector3(), new BABYLON.Vector3(1.0, 0.0, 0.0)) + BABYLON.Vector3.Dot(cameraz.toVector3(), new BABYLON.Vector3(0.0, 0.0, 1.0)); + camRot *= 4.0; + var starRotation = BABYLON.Matrix.FromValues(Math.cos(camRot) * 0.5, -Math.sin(camRot), 0.0, 0.0, Math.sin(camRot), Math.cos(camRot) * 0.5, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0); + var lensStarMatrix = scaleBias2.multiply(starRotation).multiply(scaleBias1); + effect.setMatrix("lensStarMatrix", lensStarMatrix); + }; + }; + // Create depth-of-field post-process + StandardRenderingPipeline.prototype._createDepthOfFieldPostProcess = function (scene, ratio) { + var _this = this; + this.depthOfFieldPostProcess = new BABYLON.PostProcess("HDRDepthOfField", "standard", ["distance"], ["otherSampler", "depthSampler"], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define DEPTH_OF_FIELD", BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT); + this.depthOfFieldPostProcess.onApply = function (effect) { + effect.setTextureFromPostProcess("otherSampler", _this.textureAdderFinalPostProcess); + effect.setTexture("depthSampler", _this._depthRenderer.getDepthMap()); + effect.setFloat("distance", _this.depthOfFieldDistance); + }; + // Add to pipeline + this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRDepthOfField", function () { return _this.depthOfFieldPostProcess; }, true)); + }; + // Dispose + StandardRenderingPipeline.prototype.dispose = function () { + for (var i = 0; i < this._scene.cameras.length; i++) { + var camera = this._scene.cameras[i]; + this.originalPostProcess.dispose(camera); + this.downSampleX4PostProcess.dispose(camera); + this.brightPassPostProcess.dispose(camera); + this.textureAdderPostProcess.dispose(camera); + for (var j = 0; j < this.gaussianBlurHPostProcesses.length; j++) { + this.gaussianBlurHPostProcesses[j].dispose(camera); + } + for (var j = 0; j < this.gaussianBlurVPostProcesses.length; j++) { + this.gaussianBlurVPostProcesses[j].dispose(camera); + } + this.textureAdderFinalPostProcess.dispose(camera); + this.lensFlarePostProcess.dispose(camera); + this.lensFlareComposePostProcess.dispose(camera); + this.depthOfFieldPostProcess.dispose(camera); + } + this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras); + _super.prototype.dispose.call(this); + }; + return StandardRenderingPipeline; + }(BABYLON.PostProcessRenderPipeline)); + BABYLON.StandardRenderingPipeline = StandardRenderingPipeline; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.standardRenderingPipeline.js.map + +BABYLON.Effect.ShadersStore={"anaglyphPixelShader":"\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D leftSampler;\nvoid main(void)\n{\nvec4 leftFrag=texture2D(leftSampler,vUV);\nleftFrag=vec4(1.0,leftFrag.g,leftFrag.b,1.0);\nvec4 rightFrag=texture2D(textureSampler,vUV);\nrightFrag=vec4(rightFrag.r,1.0,1.0,1.0);\ngl_FragColor=vec4(rightFrag.rgb*leftFrag.rgb,1.0);\n}","blackAndWhitePixelShader":"\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nvoid main(void) \n{\nfloat luminance=dot(texture2D(textureSampler,vUV).rgb,vec3(0.3,0.59,0.11));\ngl_FragColor=vec4(luminance,luminance,luminance,1.0);\n}","blurPixelShader":"\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec2 screenSize;\nuniform vec2 direction;\nuniform float blurWidth;\nvoid main(void)\n{\nfloat weights[7];\nweights[0]=0.05;\nweights[1]=0.1;\nweights[2]=0.2;\nweights[3]=0.3;\nweights[4]=0.2;\nweights[5]=0.1;\nweights[6]=0.05;\nvec2 texelSize=vec2(1.0/screenSize.x,1.0/screenSize.y);\nvec2 texelStep=texelSize*direction*blurWidth;\nvec2 start=vUV-3.0*texelStep;\nvec4 baseColor=vec4(0.,0.,0.,0.);\nvec2 texelOffset=vec2(0.,0.);\nfor (int i=0; i<7; i++)\n{\nbaseColor+=texture2D(textureSampler,start+texelOffset)*weights[i];\ntexelOffset+=texelStep;\n}\ngl_FragColor=baseColor;\n}","chromaticAberrationPixelShader":"\nuniform sampler2D textureSampler; \n\nuniform float chromatic_aberration;\nuniform float screen_width;\nuniform float screen_height;\n\nvarying vec2 vUV;\nvoid main(void)\n{\nvec2 centered_screen_pos=vec2(vUV.x-0.5,vUV.y-0.5);\nfloat radius2=centered_screen_pos.x*centered_screen_pos.x\n+centered_screen_pos.y*centered_screen_pos.y;\nfloat radius=sqrt(radius2);\nvec4 original=texture2D(textureSampler,vUV);\nif (chromatic_aberration>0.0) {\n\nvec3 ref_indices=vec3(-0.3,0.0,0.3);\nfloat ref_shiftX=chromatic_aberration*radius*17.0/screen_width;\nfloat ref_shiftY=chromatic_aberration*radius*17.0/screen_height;\n\nvec2 ref_coords_r=vec2(vUV.x+ref_indices.r*ref_shiftX,vUV.y+ref_indices.r*ref_shiftY*0.5);\nvec2 ref_coords_g=vec2(vUV.x+ref_indices.g*ref_shiftX,vUV.y+ref_indices.g*ref_shiftY*0.5);\nvec2 ref_coords_b=vec2(vUV.x+ref_indices.b*ref_shiftX,vUV.y+ref_indices.b*ref_shiftY*0.5);\noriginal.r=texture2D(textureSampler,ref_coords_r).r;\noriginal.g=texture2D(textureSampler,ref_coords_g).g;\noriginal.b=texture2D(textureSampler,ref_coords_b).b;\n}\ngl_FragColor=original;\n}","colorPixelShader":"uniform vec4 color;\nvoid main(void) {\ngl_FragColor=color;\n}","colorVertexShader":"\nattribute vec3 position;\n\nuniform mat4 worldViewProjection;\nvoid main(void) {\ngl_Position=worldViewProjection*vec4(position,1.0);\n}","colorCorrectionPixelShader":"\nuniform sampler2D textureSampler; \nuniform sampler2D colorTable; \n\nvarying vec2 vUV;\n\nconst float SLICE_COUNT=16.0; \n\nvec4 sampleAs3DTexture(sampler2D texture,vec3 uv,float width) {\nfloat sliceSize=1.0/width; \nfloat slicePixelSize=sliceSize/width; \nfloat sliceInnerSize=slicePixelSize*(width-1.0); \nfloat zSlice0=min(floor(uv.z*width),width-1.0);\nfloat zSlice1=min(zSlice0+1.0,width-1.0);\nfloat xOffset=slicePixelSize*0.5+uv.x*sliceInnerSize;\nfloat s0=xOffset+(zSlice0*sliceSize);\nfloat s1=xOffset+(zSlice1*sliceSize);\nvec4 slice0Color=texture2D(texture,vec2(s0,uv.y));\nvec4 slice1Color=texture2D(texture,vec2(s1,uv.y));\nfloat zOffset=mod(uv.z*width,1.0);\nvec4 result=mix(slice0Color,slice1Color,zOffset);\nreturn result;\n}\nvoid main(void)\n{\nvec4 screen_color=texture2D(textureSampler,vUV);\ngl_FragColor=sampleAs3DTexture(colorTable,screen_color.rgb,SLICE_COUNT);\n}","convolutionPixelShader":"\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 screenSize;\nuniform float kernel[9];\nvoid main(void)\n{\nvec2 onePixel=vec2(1.0,1.0)/screenSize;\nvec4 colorSum =\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,-1))*kernel[0] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,-1))*kernel[1] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,-1))*kernel[2] +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,0))*kernel[3] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,0))*kernel[4] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,0))*kernel[5] +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,1))*kernel[6] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,1))*kernel[7] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,1))*kernel[8];\nfloat kernelWeight =\nkernel[0] +\nkernel[1] +\nkernel[2] +\nkernel[3] +\nkernel[4] +\nkernel[5] +\nkernel[6] +\nkernel[7] +\nkernel[8];\nif (kernelWeight<=0.0) {\nkernelWeight=1.0;\n}\ngl_FragColor=vec4((colorSum/kernelWeight).rgb,1);\n}","defaultPixelShader":"#ifdef BUMP\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n\n#define RECIPROCAL_PI2 0.15915494\nuniform vec3 vEyePosition;\nuniform vec3 vAmbientColor;\nuniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nuniform vec3 vEmissiveColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include\n\n#include[0..maxSimultaneousLights]\n#include\n#include\n\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform sampler2D diffuseSampler;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nvarying vec2 vAmbientUV;\nuniform sampler2D ambientSampler;\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY \nvarying vec2 vOpacityUV;\nuniform sampler2D opacitySampler;\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vEmissiveUV;\nuniform vec2 vEmissiveInfos;\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef LIGHTMAP\nvarying vec2 vLightmapUV;\nuniform vec2 vLightmapInfos;\nuniform sampler2D lightmapSampler;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif\n#ifdef REFRACTION\nuniform vec4 vRefractionInfos;\n#ifdef REFRACTIONMAP_3D\nuniform samplerCube refractionCubeSampler;\n#else\nuniform sampler2D refraction2DSampler;\nuniform mat4 refractionMatrix;\n#endif\n#ifdef REFRACTIONFRESNEL\nuniform vec4 refractionLeftColor;\nuniform vec4 refractionRightColor;\n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nvarying vec2 vSpecularUV;\nuniform vec2 vSpecularInfos;\nuniform sampler2D specularSampler;\n#endif\n\n#include\n#ifdef DIFFUSEFRESNEL\nuniform vec4 diffuseLeftColor;\nuniform vec4 diffuseRightColor;\n#endif\n#ifdef OPACITYFRESNEL\nuniform vec4 opacityParts;\n#endif\n#ifdef EMISSIVEFRESNEL\nuniform vec4 emissiveLeftColor;\nuniform vec4 emissiveRightColor;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\n#ifdef REFLECTIONMAP_3D\nuniform samplerCube reflectionCubeSampler;\n#else\nuniform sampler2D reflection2DSampler;\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED\nvarying vec3 vDirectionW;\n#endif\n#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION)\nuniform mat4 reflectionMatrix;\n#endif\n#endif\n#include\n#ifdef REFLECTIONFRESNEL\nuniform vec4 reflectionLeftColor;\nuniform vec4 reflectionRightColor;\n#endif\n#endif\n#ifdef CAMERACOLORGRADING\n#include \n#include\n#endif\n#ifdef CAMERACOLORCURVES\n#include\n#include\n#endif\n#include\n#include\n#include\n#include\nvoid main(void) {\n#include\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat alpha=vDiffuseColor.a;\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#include\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV+uvOffset);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#ifdef ALPHAFROMDIFFUSE\nalpha*=baseColor.a;\n#endif\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n\nvec3 baseAmbientColor=vec3(1.,1.,1.);\n#ifdef AMBIENT\nbaseAmbientColor=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y;\n#endif\n\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularColor=vSpecularColor.rgb;\n#ifdef SPECULAR\nvec4 specularMapColor=texture2D(specularSampler,vSpecularUV+uvOffset);\nspecularColor=specularMapColor.rgb;\n#ifdef GLOSSINESS\nglossiness=glossiness*specularMapColor.a;\n#endif\n#endif\n#else\nfloat glossiness=0.;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\nfloat shadow=1.;\n#ifdef LIGHTMAP\nvec3 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset).rgb*vLightmapInfos.y;\n#endif\n#include[0..maxSimultaneousLights]\n\nvec3 refractionColor=vec3(0.,0.,0.);\n#ifdef REFRACTION\nvec3 refractionVector=normalize(refract(-viewDirectionW,normalW,vRefractionInfos.y));\n#ifdef REFRACTIONMAP_3D\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\nif (dot(refractionVector,viewDirectionW)<1.0)\n{\nrefractionColor=textureCube(refractionCubeSampler,refractionVector).rgb*vRefractionInfos.x;\n}\n#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\nvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\nrefractionCoords.y=1.0-refractionCoords.y;\nrefractionColor=texture2D(refraction2DSampler,refractionCoords).rgb*vRefractionInfos.x;\n#endif\n#endif\n\nvec3 reflectionColor=vec3(0.,0.,0.);\n#ifdef REFLECTION\nvec3 vReflectionUVW=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_3D\n#ifdef ROUGHNESS\nfloat bias=vReflectionInfos.y;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\n#ifdef GLOSSINESS\nbias*=(1.0-specularMapColor.a);\n#endif\n#endif\n#endif\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW,bias).rgb*vReflectionInfos.x;\n#else\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW).rgb*vReflectionInfos.x;\n#endif\n#else\nvec2 coords=vReflectionUVW.xy;\n#ifdef REFLECTIONMAP_PROJECTION\ncoords/=vReflectionUVW.z;\n#endif\ncoords.y=1.0-coords.y;\nreflectionColor=texture2D(reflection2DSampler,coords).rgb*vReflectionInfos.x;\n#endif\n#ifdef REFLECTIONFRESNEL\nfloat reflectionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,reflectionRightColor.a,reflectionLeftColor.a);\n#ifdef REFLECTIONFRESNELFROMSPECULAR\n#ifdef SPECULARTERM\nreflectionColor*=specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#else\nreflectionColor*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#else\nreflectionColor*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#endif\n#endif\n#ifdef REFRACTIONFRESNEL\nfloat refractionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,refractionRightColor.a,refractionLeftColor.a);\nrefractionColor*=refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*refractionRightColor.rgb;\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\n#ifdef OPACITYRGB\nopacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);\nalpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* vOpacityInfos.y;\n#else\nalpha*=opacityMap.a*vOpacityInfos.y;\n#endif\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#ifdef OPACITYFRESNEL\nfloat opacityFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,opacityParts.z,opacityParts.w);\nalpha+=opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*opacityParts.y;\n#endif\n\nvec3 emissiveColor=vEmissiveColor;\n#ifdef EMISSIVE\nemissiveColor+=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb*vEmissiveInfos.y;\n#endif\n#ifdef EMISSIVEFRESNEL\nfloat emissiveFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,emissiveRightColor.a,emissiveLeftColor.a);\nemissiveColor*=emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*emissiveRightColor.rgb;\n#endif\n\n#ifdef DIFFUSEFRESNEL\nfloat diffuseFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,diffuseRightColor.a,diffuseLeftColor.a);\ndiffuseBase*=diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*diffuseRightColor.rgb;\n#endif\n\n#ifdef EMISSIVEASILLUMINATION\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#else\n#ifdef LINKEMISSIVEWITHDIFFUSE\nvec3 finalDiffuse=clamp((diffuseBase+emissiveColor)*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#else\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+emissiveColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#endif\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#ifdef SPECULAROVERALPHA\nalpha=clamp(alpha+dot(finalSpecular,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n#ifdef REFLECTIONOVERALPHA\nalpha=clamp(alpha+dot(reflectionColor,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n\n#ifdef EMISSIVEASILLUMINATION\nvec4 color=vec4(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor+emissiveColor+refractionColor,0.0,1.0),alpha);\n#else\nvec4 color=vec4(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor+refractionColor,alpha);\n#endif\n\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\ncolor.rgb*=lightmapColor;\n#else\ncolor.rgb+=lightmapColor;\n#endif\n#endif\n#endif\n#include\n#include\n#ifdef CAMERACOLORGRADING\ncolor=colorGrades(color);\n#endif\n#ifdef CAMERACOLORCURVES\ncolor.rgb=applyColorCurves(color.rgb);\n#endif\ngl_FragColor=color;\n}","defaultVertexShader":"\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include\n\n#include\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nvarying vec2 vAmbientUV;\nuniform mat4 ambientMatrix;\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY\nvarying vec2 vOpacityUV;\nuniform mat4 opacityMatrix;\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vEmissiveUV;\nuniform vec2 vEmissiveInfos;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef LIGHTMAP\nvarying vec2 vLightmapUV;\nuniform vec2 vLightmapInfos;\nuniform mat4 lightmapMatrix;\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nvarying vec2 vSpecularUV;\nuniform vec2 vSpecularInfos;\nuniform mat4 specularMatrix;\n#endif\n#ifdef BUMP\nvarying vec2 vBumpUV;\nuniform vec3 vBumpInfos;\nuniform mat4 bumpMatrix;\n#endif\n#include\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include\n#include\n#include[0..maxSimultaneousLights]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED\nvarying vec3 vDirectionW;\n#endif\n#include\nvoid main(void) {\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=position;\n#endif \n#include\n#include\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\nvec4 worldPos=finalWorld*vec4(position,1.0);\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED\nvDirectionW=normalize(vec3(finalWorld*vec4(position,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#ifdef AMBIENT\nif (vAmbientInfos.x == 0.)\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#ifdef OPACITY\nif (vOpacityInfos.x == 0.)\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#ifdef EMISSIVE\nif (vEmissiveInfos.x == 0.)\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#ifdef LIGHTMAP\nif (vLightmapInfos.x == 0.)\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nif (vSpecularInfos.x == 0.)\n{\nvSpecularUV=vec2(specularMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvSpecularUV=vec2(specularMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#ifdef BUMP\nif (vBumpInfos.x == 0.)\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#include\n#include\n#include[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n#include\n#include\n}","depthPixelShader":"#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\nuniform float far;\nvoid main(void)\n{\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\nfloat depth=(gl_FragCoord.z/gl_FragCoord.w)/far;\ngl_FragColor=vec4(depth,depth*depth,0.0,1.0);\n}","depthVertexShader":"\nattribute vec3 position;\n#include\n\n#include\nuniform mat4 viewProjection;\n#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\nvoid main(void)\n{\n#include\n#include\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}","depthBoxBlurPixelShader":"\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec2 screenSize;\nvoid main(void)\n{\nvec4 colorDepth=vec4(0.0);\nfor (int x=-OFFSET; x<=OFFSET; x++)\nfor (int y=-OFFSET; y<=OFFSET; y++)\ncolorDepth+=texture2D(textureSampler,vUV+vec2(x,y)/screenSize);\ngl_FragColor=(colorDepth/float((OFFSET*2+1)*(OFFSET*2+1)));\n}","depthOfFieldPixelShader":"\n\n\n\n\nuniform sampler2D textureSampler;\nuniform sampler2D highlightsSampler;\nuniform sampler2D depthSampler;\nuniform sampler2D grainSampler;\n\nuniform float grain_amount;\nuniform bool blur_noise;\nuniform float screen_width;\nuniform float screen_height;\nuniform float distortion;\nuniform bool dof_enabled;\n\nuniform float screen_distance; \nuniform float aperture;\nuniform float darken;\nuniform float edge_blur;\nuniform bool highlights;\n\nuniform float near;\nuniform float far;\n\nvarying vec2 vUV;\n\n#define PI 3.14159265\n#define TWOPI 6.28318530\n#define inverse_focal_length 0.1 \n\nvec2 centered_screen_pos;\nvec2 distorted_coords;\nfloat radius2;\nfloat radius;\n\nvec2 rand(vec2 co)\n{\nfloat noise1=(fract(sin(dot(co,vec2(12.9898,78.233)))*43758.5453));\nfloat noise2=(fract(sin(dot(co,vec2(12.9898,78.233)*2.0))*43758.5453));\nreturn clamp(vec2(noise1,noise2),0.0,1.0);\n}\n\nvec2 getDistortedCoords(vec2 coords) {\nif (distortion == 0.0) { return coords; }\nvec2 direction=1.0*normalize(centered_screen_pos);\nvec2 dist_coords=vec2(0.5,0.5);\ndist_coords.x=0.5+direction.x*radius2*1.0;\ndist_coords.y=0.5+direction.y*radius2*1.0;\nfloat dist_amount=clamp(distortion*0.23,0.0,1.0);\ndist_coords=mix(coords,dist_coords,dist_amount);\nreturn dist_coords;\n}\n\nfloat sampleScreen(inout vec4 color,const in vec2 offset,const in float weight) {\n\nvec2 coords=distorted_coords;\nfloat angle=rand(coords*100.0).x*TWOPI;\ncoords+=vec2(offset.x*cos(angle)-offset.y*sin(angle),offset.x*sin(angle)+offset.y*cos(angle));\ncolor+=texture2D(textureSampler,coords)*weight;\nreturn weight;\n}\n\nfloat getBlurLevel(float size) {\nreturn min(3.0,ceil(size/1.0));\n}\n\nvec4 getBlurColor(float size) {\nvec4 col=texture2D(textureSampler,distorted_coords);\nif (size == 0.0) { return col; }\n\n\nfloat blur_level=getBlurLevel(size);\nfloat w=(size/screen_width);\nfloat h=(size/screen_height);\nfloat total_weight=1.0;\nvec2 sample_coords;\ntotal_weight+=sampleScreen(col,vec2(-0.50*w,0.24*h),0.93);\ntotal_weight+=sampleScreen(col,vec2(0.30*w,-0.75*h),0.90);\ntotal_weight+=sampleScreen(col,vec2(0.36*w,0.96*h),0.87);\ntotal_weight+=sampleScreen(col,vec2(-1.08*w,-0.55*h),0.85);\ntotal_weight+=sampleScreen(col,vec2(1.33*w,-0.37*h),0.83);\ntotal_weight+=sampleScreen(col,vec2(-0.82*w,1.31*h),0.80);\ntotal_weight+=sampleScreen(col,vec2(-0.31*w,-1.67*h),0.78);\ntotal_weight+=sampleScreen(col,vec2(1.47*w,1.11*h),0.76);\ntotal_weight+=sampleScreen(col,vec2(-1.97*w,0.19*h),0.74);\ntotal_weight+=sampleScreen(col,vec2(1.42*w,-1.57*h),0.72);\nif (blur_level>1.0) {\ntotal_weight+=sampleScreen(col,vec2(0.01*w,2.25*h),0.70);\ntotal_weight+=sampleScreen(col,vec2(-1.62*w,-1.74*h),0.67);\ntotal_weight+=sampleScreen(col,vec2(2.49*w,0.20*h),0.65);\ntotal_weight+=sampleScreen(col,vec2(-2.07*w,1.61*h),0.63);\ntotal_weight+=sampleScreen(col,vec2(0.46*w,-2.70*h),0.61);\ntotal_weight+=sampleScreen(col,vec2(1.55*w,2.40*h),0.59);\ntotal_weight+=sampleScreen(col,vec2(-2.88*w,-0.75*h),0.56);\ntotal_weight+=sampleScreen(col,vec2(2.73*w,-1.44*h),0.54);\ntotal_weight+=sampleScreen(col,vec2(-1.08*w,3.02*h),0.52);\ntotal_weight+=sampleScreen(col,vec2(-1.28*w,-3.05*h),0.49);\n}\nif (blur_level>2.0) {\ntotal_weight+=sampleScreen(col,vec2(3.11*w,1.43*h),0.46);\ntotal_weight+=sampleScreen(col,vec2(-3.36*w,1.08*h),0.44);\ntotal_weight+=sampleScreen(col,vec2(1.80*w,-3.16*h),0.41);\ntotal_weight+=sampleScreen(col,vec2(0.83*w,3.65*h),0.38);\ntotal_weight+=sampleScreen(col,vec2(-3.16*w,-2.19*h),0.34);\ntotal_weight+=sampleScreen(col,vec2(3.92*w,-0.53*h),0.31);\ntotal_weight+=sampleScreen(col,vec2(-2.59*w,3.12*h),0.26);\ntotal_weight+=sampleScreen(col,vec2(-0.20*w,-4.15*h),0.22);\ntotal_weight+=sampleScreen(col,vec2(3.02*w,3.00*h),0.15);\n}\ncol/=total_weight; \n\nif (darken>0.0) {\ncol.rgb*=clamp(0.3,1.0,1.05-size*0.5*darken);\n}\n\n\n\n\nreturn col;\n}\nvoid main(void)\n{\n\ncentered_screen_pos=vec2(vUV.x-0.5,vUV.y-0.5);\nradius2=centered_screen_pos.x*centered_screen_pos.x+centered_screen_pos.y*centered_screen_pos.y;\nradius=sqrt(radius2);\ndistorted_coords=getDistortedCoords(vUV); \nvec2 texels_coords=vec2(vUV.x*screen_width,vUV.y*screen_height); \nfloat depth=texture2D(depthSampler,distorted_coords).r; \nfloat distance=near+(far-near)*depth; \nvec4 color=texture2D(textureSampler,vUV); \n\n\nfloat coc=abs(aperture*(screen_distance*(inverse_focal_length-1.0/distance)-1.0));\n\nif (dof_enabled == false || coc<0.07) { coc=0.0; }\n\nfloat edge_blur_amount=0.0;\nif (edge_blur>0.0) {\nedge_blur_amount=clamp((radius*2.0-1.0+0.15*edge_blur)*1.5,0.0,1.0)*1.3;\n}\n\nfloat blur_amount=max(edge_blur_amount,coc);\n\nif (blur_amount == 0.0) {\ngl_FragColor=texture2D(textureSampler,distorted_coords);\n}\nelse {\n\ngl_FragColor=getBlurColor(blur_amount*1.7);\n\nif (highlights) {\ngl_FragColor.rgb+=clamp(coc,0.0,1.0)*texture2D(highlightsSampler,distorted_coords).rgb;\n}\nif (blur_noise) {\n\nvec2 noise=rand(distorted_coords)*0.01*blur_amount;\nvec2 blurred_coord=vec2(distorted_coords.x+noise.x,distorted_coords.y+noise.y);\ngl_FragColor=0.04*texture2D(textureSampler,blurred_coord)+0.96*gl_FragColor;\n}\n}\n\nif (grain_amount>0.0) {\nvec4 grain_color=texture2D(grainSampler,texels_coords*0.003);\ngl_FragColor.rgb+=(-0.5+grain_color.rgb)*0.30*grain_amount;\n}\n}\n","displayPassPixelShader":"\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D passSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(passSampler,vUV);\n}","filterPixelShader":"\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform mat4 kernelMatrix;\nvoid main(void)\n{\nvec3 baseColor=texture2D(textureSampler,vUV).rgb;\nvec3 updatedColor=(kernelMatrix*vec4(baseColor,1.0)).rgb;\ngl_FragColor=vec4(updatedColor,1.0);\n}","fxaaPixelShader":"#define FXAA_REDUCE_MIN (1.0/128.0)\n#define FXAA_REDUCE_MUL (1.0/8.0)\n#define FXAA_SPAN_MAX 8.0\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 texelSize;\nvoid main(){\nvec2 localTexelSize=texelSize;\nvec4 rgbNW=texture2D(textureSampler,(vUV+vec2(-1.0,-1.0)*localTexelSize));\nvec4 rgbNE=texture2D(textureSampler,(vUV+vec2(1.0,-1.0)*localTexelSize));\nvec4 rgbSW=texture2D(textureSampler,(vUV+vec2(-1.0,1.0)*localTexelSize));\nvec4 rgbSE=texture2D(textureSampler,(vUV+vec2(1.0,1.0)*localTexelSize));\nvec4 rgbM=texture2D(textureSampler,vUV);\nvec4 luma=vec4(0.299,0.587,0.114,1.0);\nfloat lumaNW=dot(rgbNW,luma);\nfloat lumaNE=dot(rgbNE,luma);\nfloat lumaSW=dot(rgbSW,luma);\nfloat lumaSE=dot(rgbSE,luma);\nfloat lumaM=dot(rgbM,luma);\nfloat lumaMin=min(lumaM,min(min(lumaNW,lumaNE),min(lumaSW,lumaSE)));\nfloat lumaMax=max(lumaM,max(max(lumaNW,lumaNE),max(lumaSW,lumaSE)));\nvec2 dir=vec2(-((lumaNW+lumaNE)-(lumaSW+lumaSE)),((lumaNW+lumaSW)-(lumaNE+lumaSE)));\nfloat dirReduce=max(\n(lumaNW+lumaNE+lumaSW+lumaSE)*(0.25*FXAA_REDUCE_MUL),\nFXAA_REDUCE_MIN);\nfloat rcpDirMin=1.0/(min(abs(dir.x),abs(dir.y))+dirReduce);\ndir=min(vec2(FXAA_SPAN_MAX,FXAA_SPAN_MAX),\nmax(vec2(-FXAA_SPAN_MAX,-FXAA_SPAN_MAX),\ndir*rcpDirMin))*localTexelSize;\nvec4 rgbA=0.5*(\ntexture2D(textureSampler,vUV+dir*(1.0/3.0-0.5)) +\ntexture2D(textureSampler,vUV+dir*(2.0/3.0-0.5)));\nvec4 rgbB=rgbA*0.5+0.25*(\ntexture2D(textureSampler,vUV+dir*-0.5) +\ntexture2D(textureSampler,vUV+dir*0.5));\nfloat lumaB=dot(rgbB,luma);\nif ((lumaBlumaMax)) {\ngl_FragColor=rgbA;\n}\nelse {\ngl_FragColor=rgbB;\n}\n}","glowBlurPostProcessPixelShader":"\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec2 screenSize;\nuniform vec2 direction;\nuniform float blurWidth;\n\nfloat getLuminance(vec3 color)\n{\nreturn dot(color,vec3(0.2126,0.7152,0.0722));\n}\nvoid main(void)\n{\nfloat weights[7];\nweights[0]=0.05;\nweights[1]=0.1;\nweights[2]=0.2;\nweights[3]=0.3;\nweights[4]=0.2;\nweights[5]=0.1;\nweights[6]=0.05;\nvec2 texelSize=vec2(1.0/screenSize.x,1.0/screenSize.y);\nvec2 texelStep=texelSize*direction*blurWidth;\nvec2 start=vUV-3.0*texelStep;\nvec4 baseColor=vec4(0.,0.,0.,0.);\nvec2 texelOffset=vec2(0.,0.);\nfor (int i=0; i<7; i++)\n{\n\nvec4 texel=texture2D(textureSampler,start+texelOffset);\nbaseColor.a+=texel.a*weights[i];\n\nfloat luminance=getLuminance(baseColor.rgb);\nfloat luminanceTexel=getLuminance(texel.rgb);\nfloat choice=step(luminanceTexel,luminance);\nbaseColor.rgb=choice*baseColor.rgb+(1.0-choice)*texel.rgb;\ntexelOffset+=texelStep;\n}\ngl_FragColor=baseColor;\n}","glowMapGenerationPixelShader":"#ifdef ALPHATEST\nvarying vec2 vUVDiffuse;\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;\nuniform sampler2D emissiveSampler;\n#endif\nuniform vec4 color;\nvoid main(void)\n{\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUVDiffuse).a<0.4)\ndiscard;\n#endif\n#ifdef EMISSIVE\ngl_FragColor=texture2D(emissiveSampler,vUVEmissive);\n#else\ngl_FragColor=color;\n#endif\n}","glowMapGenerationVertexShader":"\nattribute vec3 position;\n#include\n\n#include\nuniform mat4 viewProjection;\nvarying vec4 vPosition;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef ALPHATEST\nvarying vec2 vUVDiffuse;\nuniform mat4 diffuseMatrix;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;\nuniform mat4 emissiveMatrix;\n#endif\nvoid main(void)\n{\n#include\n#include\n#ifdef CUBEMAP\nvPosition=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#else\nvPosition=viewProjection*finalWorld*vec4(position,1.0);\ngl_Position=vPosition;\n#endif\n#ifdef ALPHATEST\n#ifdef DIFFUSEUV1\nvUVDiffuse=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef DIFFUSEUV2\nvUVDiffuse=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#ifdef EMISSIVE\n#ifdef EMISSIVEUV1\nvUVEmissive=vec2(emissiveMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef EMISSIVEUV2\nvUVEmissive=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}","glowMapMergePixelShader":"\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform float offset;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\nbaseColor.a=abs(offset-baseColor.a);\ngl_FragColor=baseColor;\n}","glowMapMergeVertexShader":"\nattribute vec2 position;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=position*madd+madd;\ngl_Position=vec4(position,0.0,1.0);\n}","hdrPixelShader":"uniform sampler2D textureSampler;\nvarying vec2 vUV;\n#if defined(GAUSSIAN_BLUR_H) || defined(GAUSSIAN_BLUR_V)\nuniform float blurOffsets[9];\nuniform float blurWeights[9];\nuniform float multiplier;\nvoid main(void) {\nvec4 color=vec4(0.0,0.0,0.0,0.0);\nfor (int i=0; i<9; i++) {\n#ifdef GAUSSIAN_BLUR_H\ncolor+=(texture2D(textureSampler,vUV+vec2(blurOffsets[i]*multiplier,0.0))*blurWeights[i]);\n#else\ncolor+=(texture2D(textureSampler,vUV+vec2(0.0,blurOffsets[i]*multiplier))*blurWeights[i]);\n#endif\n}\ncolor.a=1.0;\ngl_FragColor=color;\n}\n#endif\n#if defined(TEXTURE_ADDER)\nuniform sampler2D otherSampler;\nvoid main() {\nvec4 sum=texture2D(textureSampler,vUV)+texture2D(otherSampler,vUV);\nsum.a=clamp(sum.a,0.0,1.0);\ngl_FragColor=sum;\n}\n#endif\n#if defined(LUMINANCE_GENERATOR)\nuniform vec2 lumOffsets[4];\nvoid main() {\nfloat average=0.0;\nvec4 color=vec4(0.0,0.0,0.0,0.0);\nfloat maximum=-1e20;\nfor (int i=0; i<4; i++) {\ncolor=texture2D(textureSampler,vUV+lumOffsets[i]);\nfloat GreyValue=length(color.rgb);\nmaximum=max(maximum,GreyValue);\naverage+=(0.25*log(1e-5+GreyValue));\n}\naverage=exp(average);\ngl_FragColor=vec4(average,maximum,0.0,1.0);\n}\n#endif\n#if defined(DOWN_SAMPLE)\nuniform vec2 dsOffsets[9];\nuniform float halfDestPixelSize;\n#ifdef FINAL_DOWN_SAMPLE\nvec4 pack(float value) {\nconst vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);\nconst vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);\nvec4 res=fract(value*bit_shift);\nres-=res.xxyz*bit_mask;\nreturn res;\n}\n#endif\nvoid main() {\nvec4 color=vec4(0.0,0.0,0.0,0.0);\nfloat average=0.0;\nfor (int i=0; i<9; i++) {\ncolor=texture2D(textureSampler,vUV+vec2(halfDestPixelSize,halfDestPixelSize)+dsOffsets[i]);\naverage+=color.r;\n}\naverage/=9.0;\n#ifndef FINAL_DOWN_SAMPLE\ngl_FragColor=vec4(average,average,0.0,1.0);\n#else\ngl_FragColor=pack(average);\n#endif\n}\n#endif\n#if defined(BRIGHT_PASS)\nuniform vec2 dsOffsets[4];\nuniform float brightThreshold;\nvoid main() {\nvec4 average=vec4(0.0,0.0,0.0,0.0);\naverage=texture2D(textureSampler,vUV+vec2(dsOffsets[0].x,dsOffsets[0].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[1].x,dsOffsets[1].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[2].x,dsOffsets[2].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[3].x,dsOffsets[3].y));\naverage*=0.25;\nfloat luminance=length(average.rgb);\nif (luminance1.0) { lum_threshold=0.94+0.01*threshold; }\nelse { lum_threshold=0.5+0.44*threshold; }\nluminance=clamp((luminance-lum_threshold)*(1.0/(1.0-lum_threshold)),0.0,1.0);\nhighlight*=luminance*gain;\nhighlight.a=1.0;\nreturn highlight;\n}\nvoid main(void)\n{\nvec4 original=texture2D(textureSampler,vUV);\n\nif (gain == -1.0) {\ngl_FragColor=vec4(0.0,0.0,0.0,1.0);\nreturn;\n}\nfloat w=2.0/screen_width;\nfloat h=2.0/screen_height;\nfloat weight=1.0;\n\nvec4 blurred=vec4(0.0,0.0,0.0,0.0);\n#ifdef PENTAGON\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.84*w,0.43*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.48*w,-1.29*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.61*w,1.51*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.55*w,-0.74*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.71*w,-0.52*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.94*w,1.59*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.40*w,-1.87*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.62*w,1.16*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.09*w,0.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.46*w,-1.71*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.08*w,2.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.85*w,-1.89*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.89*w,0.16*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.29*w,1.88*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.40*w,-2.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.54*w,2.26*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.60*w,-0.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.31*w,-1.30*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.83*w,2.53*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.12*w,-2.48*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.60*w,1.11*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.99*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.50*w,-2.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.85*w,3.33*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.94*w,-1.92*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.27*w,-0.53*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.95*w,2.48*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.23*w,-3.04*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.17*w,2.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.97*w,-0.04*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.25*w,-2.00*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.31*w,3.08*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.94*w,-2.59*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.37*w,0.64*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.13*w,1.93*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.03*w,-3.65*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.60*w,3.17*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.14*w,-1.19*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.00*w,-1.19*h)));\n#else\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.85*w,0.36*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.52*w,-1.14*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.46*w,1.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.46*w,-0.83*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.79*w,-0.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.11*w,1.62*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.29*w,-2.07*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.69*w,1.39*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.28*w,0.12*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.65*w,-1.69*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.08*w,2.44*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.63*w,-1.90*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.55*w,0.31*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.13*w,1.52*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.56*w,-2.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.38*w,2.34*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.64*w,-0.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.53*w,-1.21*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.06*w,2.63*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.00*w,-2.69*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.59*w,1.32*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.78*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.57*w,-2.50*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.54*w,2.93*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.39*w,-1.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,-0.28*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.04*w,2.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.02*w,-3.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.09*w,2.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.07*w,-0.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.44*w,-1.90*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.52*w,3.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.68*w,-2.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,0.79*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.76*w,1.46*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.05*w,-2.94*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.21*w,2.88*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.84*w,-1.30*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.98*w,-0.96*h)));\n#endif\nblurred/=39.0;\ngl_FragColor=blurred;\n\n}","linePixelShader":"uniform vec4 color;\nvoid main(void) {\ngl_FragColor=color;\n}","lineVertexShader":"\nattribute vec3 position;\nattribute vec4 normal;\n\nuniform mat4 worldViewProjection;\nuniform float width;\nuniform float aspectRatio;\nvoid main(void) {\nvec4 viewPosition=worldViewProjection*vec4(position,1.0);\nvec4 viewPositionNext=worldViewProjection*vec4(normal.xyz,1.0);\nvec2 currentScreen=viewPosition.xy/viewPosition.w;\nvec2 nextScreen=viewPositionNext.xy/viewPositionNext.w;\ncurrentScreen.x*=aspectRatio;\nnextScreen.x*=aspectRatio;\nvec2 dir=normalize(nextScreen-currentScreen);\nvec2 normalDir=vec2(-dir.y,dir.x);\nnormalDir*=width/2.0;\nnormalDir.x/=aspectRatio;\nvec4 offset=vec4(normalDir*normal.w,0.0,0.0);\ngl_Position=viewPosition+offset;\n}","outlinePixelShader":"uniform vec4 color;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\nvoid main(void) {\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\ngl_FragColor=color;\n}","outlineVertexShader":"\nattribute vec3 position;\nattribute vec3 normal;\n#include\n\nuniform float offset;\n#include\nuniform mat4 viewProjection;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\nvoid main(void)\n{\nvec3 offsetPosition=position+normal*offset;\n#include\n#include\ngl_Position=viewProjection*finalWorld*vec4(offsetPosition,1.0);\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}\n","particlesPixelShader":"\nvarying vec2 vUV;\nvarying vec4 vColor;\nuniform vec4 textureMask;\nuniform sampler2D diffuseSampler;\n#ifdef CLIPPLANE\nvarying float fClipDistance;\n#endif\nvoid main(void) {\n#ifdef CLIPPLANE\nif (fClipDistance>0.0)\ndiscard;\n#endif\nvec4 baseColor=texture2D(diffuseSampler,vUV);\ngl_FragColor=(baseColor*textureMask+(vec4(1.,1.,1.,1.)-textureMask))*vColor;\n}","particlesVertexShader":"\nattribute vec3 position;\nattribute vec4 color;\nattribute vec4 options;\n\nuniform mat4 view;\nuniform mat4 projection;\n\nvarying vec2 vUV;\nvarying vec4 vColor;\n#ifdef CLIPPLANE\nuniform vec4 vClipPlane;\nuniform mat4 invView;\nvarying float fClipDistance;\n#endif\nvoid main(void) { \nvec3 viewPos=(view*vec4(position,1.0)).xyz; \nvec3 cornerPos;\nfloat size=options.y;\nfloat angle=options.x;\nvec2 offset=options.zw;\ncornerPos=vec3(offset.x-0.5,offset.y-0.5,0.)*size;\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\n\nviewPos+=rotatedCorner;\ngl_Position=projection*vec4(viewPos,1.0); \nvColor=color;\nvUV=offset;\n\n#ifdef CLIPPLANE\nvec4 worldPos=invView*vec4(viewPos,1.0);\nfClipDistance=dot(worldPos,vClipPlane);\n#endif\n}","passPixelShader":"\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nvoid main(void) \n{\ngl_FragColor=texture2D(textureSampler,vUV);\n}","pbrPixelShader":"#ifdef BUMP\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef LODBASEDMICROSFURACE\n#extension GL_EXT_shader_texture_lod : enable\n#endif\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nprecision highp float;\nuniform vec3 vEyePosition;\nuniform vec3 vAmbientColor;\nuniform vec3 vReflectionColor;\nuniform vec4 vAlbedoColor;\n\nuniform vec4 vLightingIntensity;\nuniform vec4 vCameraInfos;\n#ifdef OVERLOADEDVALUES\nuniform vec4 vOverloadedIntensity;\nuniform vec3 vOverloadedAmbient;\nuniform vec3 vOverloadedAlbedo;\nuniform vec3 vOverloadedReflectivity;\nuniform vec3 vOverloadedEmissive;\nuniform vec3 vOverloadedReflection;\nuniform vec3 vOverloadedMicroSurface;\n#endif\n#ifdef OVERLOADEDSHADOWVALUES\nuniform vec4 vOverloadedShadowIntensity;\n#endif\n#if defined(REFLECTION) || defined(REFRACTION)\nuniform vec2 vMicrosurfaceTextureLods;\n#endif\nuniform vec4 vReflectivityColor;\nuniform vec3 vEmissiveColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include[0..maxSimultaneousLights]\n\n#ifdef ALBEDO\nvarying vec2 vAlbedoUV;\nuniform sampler2D albedoSampler;\nuniform vec2 vAlbedoInfos;\n#endif\n#ifdef AMBIENT\nvarying vec2 vAmbientUV;\nuniform sampler2D ambientSampler;\nuniform vec3 vAmbientInfos;\n#endif\n#ifdef OPACITY \nvarying vec2 vOpacityUV;\nuniform sampler2D opacitySampler;\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vEmissiveUV;\nuniform vec2 vEmissiveInfos;\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef LIGHTMAP\nvarying vec2 vLightmapUV;\nuniform vec2 vLightmapInfos;\nuniform sampler2D lightmapSampler;\n#endif\n#if defined(REFLECTIVITY) || defined(METALLICWORKFLOW) \nvarying vec2 vReflectivityUV;\nuniform vec2 vReflectivityInfos;\nuniform sampler2D reflectivitySampler;\n#endif\n\n#include\n#ifdef OPACITYFRESNEL\nuniform vec4 opacityParts;\n#endif\n#ifdef EMISSIVEFRESNEL\nuniform vec4 emissiveLeftColor;\nuniform vec4 emissiveRightColor;\n#endif\n\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif\n\n#ifdef REFRACTION\nuniform vec4 vRefractionInfos;\n#ifdef REFRACTIONMAP_3D\nuniform samplerCube refractionCubeSampler;\n#else\nuniform sampler2D refraction2DSampler;\nuniform mat4 refractionMatrix;\n#endif\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\n#ifdef REFLECTIONMAP_3D\nuniform samplerCube reflectionCubeSampler;\n#else\nuniform sampler2D reflection2DSampler;\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED\nvarying vec3 vDirectionW;\n#endif\n#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION)\nuniform mat4 reflectionMatrix;\n#endif\n#endif\n#include\n#endif\n#ifdef CAMERACOLORGRADING\n#include\n#endif\n#ifdef CAMERACOLORCURVES\n#include\n#endif\n\n#include\n#include\n#ifdef CAMERACOLORGRADING\n#include\n#endif\n#ifdef CAMERACOLORCURVES\n#include\n#endif\n#include\n#include\n#include\n#include\n#include\n#include\n\n#include\nvoid main(void) {\n#include\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#include\n\nvec4 surfaceAlbedo=vec4(1.,1.,1.,1.);\nvec3 surfaceAlbedoContribution=vAlbedoColor.rgb;\n\nfloat alpha=vAlbedoColor.a;\n#ifdef ALBEDO\nsurfaceAlbedo=texture2D(albedoSampler,vAlbedoUV+uvOffset);\nsurfaceAlbedo=vec4(toLinearSpace(surfaceAlbedo.rgb),surfaceAlbedo.a);\n#ifndef LINKREFRACTIONTOTRANSPARENCY\n#ifdef ALPHATEST\nif (surfaceAlbedo.a<0.4)\ndiscard;\n#endif\n#endif\n#ifdef ALPHAFROMALBEDO\nalpha*=surfaceAlbedo.a;\n#endif\nsurfaceAlbedo.rgb*=vAlbedoInfos.y;\n#else\n\nsurfaceAlbedo.rgb=surfaceAlbedoContribution;\nsurfaceAlbedoContribution=vec3(1.,1.,1.);\n#endif\n#ifdef VERTEXCOLOR\nsurfaceAlbedo.rgb*=vColor.rgb;\n#endif\n#ifdef OVERLOADEDVALUES\nsurfaceAlbedo.rgb=mix(surfaceAlbedo.rgb,vOverloadedAlbedo,vOverloadedIntensity.y);\n#endif\n\nvec3 ambientColor=vec3(1.,1.,1.);\n#ifdef AMBIENT\nambientColor=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y;\nambientColor=vec3(1.,1.,1.)-((vec3(1.,1.,1.)-ambientColor)*vAmbientInfos.z);\n#ifdef OVERLOADEDVALUES\nambientColor.rgb=mix(ambientColor.rgb,vOverloadedAmbient,vOverloadedIntensity.x);\n#endif\n#endif\n\nfloat microSurface=vReflectivityColor.a;\nvec3 surfaceReflectivityColor=vReflectivityColor.rgb;\n#ifdef OVERLOADEDVALUES\nsurfaceReflectivityColor.rgb=mix(surfaceReflectivityColor.rgb,vOverloadedReflectivity,vOverloadedIntensity.z);\n#endif\n#ifdef REFLECTIVITY\nvec4 surfaceReflectivityColorMap=texture2D(reflectivitySampler,vReflectivityUV+uvOffset);\nsurfaceReflectivityColor=surfaceReflectivityColorMap.rgb;\nsurfaceReflectivityColor=toLinearSpace(surfaceReflectivityColor);\n#ifdef OVERLOADEDVALUES\nsurfaceReflectivityColor=mix(surfaceReflectivityColor,vOverloadedReflectivity,vOverloadedIntensity.z);\n#endif\n#ifdef MICROSURFACEFROMREFLECTIVITYMAP\nmicroSurface=surfaceReflectivityColorMap.a;\n#else\n#ifdef MICROSURFACEAUTOMATIC\nmicroSurface=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor);\n#endif\n#endif\n#endif\n#ifdef METALLICWORKFLOW\nvec4 surfaceMetallicColorMap=texture2D(reflectivitySampler,vReflectivityUV+uvOffset);\n\nfloat metallic=surfaceMetallicColorMap.r; \n\nvec3 baseColor=surfaceAlbedo.rgb;\n\nsurfaceAlbedo.rgb*=(1.0-metallic);\n\n\nconst vec3 DefaultSpecularReflectanceDielectric=vec3(0.04,0.04,0.04);\n\nsurfaceReflectivityColor=mix(DefaultSpecularReflectanceDielectric,baseColor,metallic);\n#ifdef OVERLOADEDVALUES\nsurfaceReflectivityColor=mix(surfaceReflectivityColor,vOverloadedReflectivity,vOverloadedIntensity.z);\n#endif\n#ifdef METALLICROUGHNESSGSTOREINALPHA\nmicroSurface=1.0-surfaceMetallicColorMap.a;\n#else\n#ifdef METALLICROUGHNESSGSTOREINGREEN\nmicroSurface=1.0-surfaceMetallicColorMap.g;\n#endif\n#endif\n#endif\n#ifdef OVERLOADEDVALUES\nmicroSurface=mix(microSurface,vOverloadedMicroSurface.x,vOverloadedMicroSurface.y);\n#endif\n\nfloat NdotV=max(0.00000000001,dot(normalW,viewDirectionW));\n\nmicroSurface=clamp(microSurface,0.,1.)*0.98;\n\nfloat roughness=clamp(1.-microSurface,0.000001,1.0);\n\nvec3 lightDiffuseContribution=vec3(0.,0.,0.);\n#ifdef OVERLOADEDSHADOWVALUES\nvec3 shadowedOnlyLightDiffuseContribution=vec3(1.,1.,1.);\n#endif\n#ifdef SPECULARTERM\nvec3 lightSpecularContribution=vec3(0.,0.,0.);\n#endif\nfloat notShadowLevel=1.; \n#ifdef LIGHTMAP\nvec3 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset).rgb*vLightmapInfos.y;\n#endif\nfloat NdotL=-1.;\nlightingInfo info;\n\nfloat reflectance=max(max(surfaceReflectivityColor.r,surfaceReflectivityColor.g),surfaceReflectivityColor.b);\n\n\nfloat reflectance90=clamp(reflectance*25.0,0.0,1.0);\nvec3 specularEnvironmentR0=surfaceReflectivityColor.rgb;\nvec3 specularEnvironmentR90=vec3(1.0,1.0,1.0)*reflectance90;\n#include[0..maxSimultaneousLights]\n#ifdef SPECULARTERM\nlightSpecularContribution*=vLightingIntensity.w;\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\n#ifdef OPACITYRGB\nopacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);\nalpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* vOpacityInfos.y;\n#else\nalpha*=opacityMap.a*vOpacityInfos.y;\n#endif\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#ifdef OPACITYFRESNEL\nfloat opacityFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,opacityParts.z,opacityParts.w);\nalpha+=opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*opacityParts.y;\n#endif\n\nvec3 surfaceRefractionColor=vec3(0.,0.,0.);\n\n#ifdef LODBASEDMICROSFURACE\nfloat alphaG=convertRoughnessToAverageSlope(roughness);\n#endif\n#ifdef REFRACTION\nvec3 refractionVector=refract(-viewDirectionW,normalW,vRefractionInfos.y);\n#ifdef LODBASEDMICROSFURACE\n#ifdef USEPMREMREFRACTION\nfloat lodRefraction=getMipMapIndexFromAverageSlopeWithPMREM(vMicrosurfaceTextureLods.y,alphaG);\n#else\nfloat lodRefraction=getMipMapIndexFromAverageSlope(vMicrosurfaceTextureLods.y,alphaG);\n#endif\n#else\nfloat biasRefraction=(vMicrosurfaceTextureLods.y+2.)*(1.0-microSurface);\n#endif\n#ifdef REFRACTIONMAP_3D\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\nif (dot(refractionVector,viewDirectionW)<1.0)\n{\n#ifdef LODBASEDMICROSFURACE\n#ifdef USEPMREMREFRACTION\n\nif ((vMicrosurfaceTextureLods.y-lodRefraction)>4.0)\n{\n\nfloat scaleRefraction=1.-exp2(lodRefraction)/exp2(vMicrosurfaceTextureLods.y); \nfloat maxRefraction=max(max(abs(refractionVector.x),abs(refractionVector.y)),abs(refractionVector.z));\nif (abs(refractionVector.x) != maxRefraction) refractionVector.x*=scaleRefraction;\nif (abs(refractionVector.y) != maxRefraction) refractionVector.y*=scaleRefraction;\nif (abs(refractionVector.z) != maxRefraction) refractionVector.z*=scaleRefraction;\n}\n#endif\nsurfaceRefractionColor=textureCubeLodEXT(refractionCubeSampler,refractionVector,lodRefraction).rgb*vRefractionInfos.x;\n#else\nsurfaceRefractionColor=textureCube(refractionCubeSampler,refractionVector,biasRefraction).rgb*vRefractionInfos.x;\n#endif\n}\n#ifndef REFRACTIONMAPINLINEARSPACE\nsurfaceRefractionColor=toLinearSpace(surfaceRefractionColor.rgb);\n#endif\n#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\nvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\nrefractionCoords.y=1.0-refractionCoords.y;\n#ifdef LODBASEDMICROSFURACE\nsurfaceRefractionColor=texture2DLodEXT(refraction2DSampler,refractionCoords,lodRefraction).rgb*vRefractionInfos.x;\n#else\nsurfaceRefractionColor=texture2D(refraction2DSampler,refractionCoords,biasRefraction).rgb*vRefractionInfos.x;\n#endif \nsurfaceRefractionColor=toLinearSpace(surfaceRefractionColor.rgb);\n#endif\n#endif\n\nvec3 environmentRadiance=vReflectionColor.rgb;\nvec3 environmentIrradiance=vReflectionColor.rgb;\n#ifdef REFLECTION\nvec3 vReflectionUVW=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef LODBASEDMICROSFURACE\n#ifdef USEPMREMREFLECTION\nfloat lodReflection=getMipMapIndexFromAverageSlopeWithPMREM(vMicrosurfaceTextureLods.x,alphaG);\n#else\nfloat lodReflection=getMipMapIndexFromAverageSlope(vMicrosurfaceTextureLods.x,alphaG);\n#endif\n#else\nfloat biasReflection=(vMicrosurfaceTextureLods.x+2.)*(1.0-microSurface);\n#endif\n#ifdef REFLECTIONMAP_3D\n#ifdef LODBASEDMICROSFURACE\n#ifdef USEPMREMREFLECTION\n\nif ((vMicrosurfaceTextureLods.y-lodReflection)>4.0)\n{\n\nfloat scaleReflection=1.-exp2(lodReflection)/exp2(vMicrosurfaceTextureLods.x); \nfloat maxReflection=max(max(abs(vReflectionUVW.x),abs(vReflectionUVW.y)),abs(vReflectionUVW.z));\nif (abs(vReflectionUVW.x) != maxReflection) vReflectionUVW.x*=scaleReflection;\nif (abs(vReflectionUVW.y) != maxReflection) vReflectionUVW.y*=scaleReflection;\nif (abs(vReflectionUVW.z) != maxReflection) vReflectionUVW.z*=scaleReflection;\n}\n#endif\nenvironmentRadiance=textureCubeLodEXT(reflectionCubeSampler,vReflectionUVW,lodReflection).rgb*vReflectionInfos.x;\n#else\nenvironmentRadiance=textureCube(reflectionCubeSampler,vReflectionUVW,biasReflection).rgb*vReflectionInfos.x;\n#endif\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#ifndef REFLECTIONMAP_SKYBOX\nvec3 normalEnvironmentSpace=(reflectionMatrix*vec4(normalW,1)).xyz;\nenvironmentIrradiance=EnvironmentIrradiance(normalEnvironmentSpace);\n#endif\n#else\nenvironmentRadiance=toLinearSpace(environmentRadiance.rgb);\nenvironmentIrradiance=textureCube(reflectionCubeSampler,normalW,20.).rgb*vReflectionInfos.x;\nenvironmentIrradiance=toLinearSpace(environmentIrradiance.rgb);\nenvironmentIrradiance*=0.2; \n#endif\n#else\nvec2 coords=vReflectionUVW.xy;\n#ifdef REFLECTIONMAP_PROJECTION\ncoords/=vReflectionUVW.z;\n#endif\ncoords.y=1.0-coords.y;\n#ifdef LODBASEDMICROSFURACE\nenvironmentRadiance=texture2DLodEXT(reflection2DSampler,coords,lodReflection).rgb*vReflectionInfos.x;\n#else\nenvironmentRadiance=texture2D(reflection2DSampler,coords,biasReflection).rgb*vReflectionInfos.x;\n#endif\nenvironmentRadiance=toLinearSpace(environmentRadiance.rgb);\nenvironmentIrradiance=texture2D(reflection2DSampler,coords,20.).rgb*vReflectionInfos.x;\nenvironmentIrradiance=toLinearSpace(environmentIrradiance.rgb);\n#endif\n#endif\n#ifdef OVERLOADEDVALUES\nenvironmentIrradiance=mix(environmentIrradiance,vOverloadedReflection,vOverloadedMicroSurface.z);\nenvironmentRadiance=mix(environmentRadiance,vOverloadedReflection,vOverloadedMicroSurface.z);\n#endif\nenvironmentRadiance*=vLightingIntensity.z;\nenvironmentIrradiance*=vLightingIntensity.z;\n\nvec3 specularEnvironmentReflectance=FresnelSchlickEnvironmentGGX(clamp(NdotV,0.,1.),specularEnvironmentR0,specularEnvironmentR90,sqrt(microSurface));\n\nvec3 refractance=vec3(0.0,0.0,0.0);\n#ifdef REFRACTION\nvec3 transmission=vec3(1.0,1.0,1.0);\n#ifdef LINKREFRACTIONTOTRANSPARENCY\n\ntransmission*=(1.0-alpha);\n\n\nvec3 mixedAlbedo=surfaceAlbedoContribution.rgb*surfaceAlbedo.rgb;\nfloat maxChannel=max(max(mixedAlbedo.r,mixedAlbedo.g),mixedAlbedo.b);\nvec3 tint=clamp(maxChannel*mixedAlbedo,0.0,1.0);\n\nsurfaceAlbedoContribution*=alpha;\n\nenvironmentIrradiance*=alpha;\n\nsurfaceRefractionColor*=tint;\n\nalpha=1.0;\n#endif\n\nvec3 bounceSpecularEnvironmentReflectance=(2.0*specularEnvironmentReflectance)/(1.0+specularEnvironmentReflectance);\nspecularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,specularEnvironmentReflectance,alpha);\n\ntransmission*=1.0-specularEnvironmentReflectance;\n\nrefractance=surfaceRefractionColor*transmission;\n#endif\n\nsurfaceAlbedo.rgb=(1.-reflectance)*surfaceAlbedo.rgb;\nrefractance*=vLightingIntensity.z;\nenvironmentRadiance*=specularEnvironmentReflectance;\n\nvec3 surfaceEmissiveColor=vEmissiveColor;\n#ifdef EMISSIVE\nvec3 emissiveColorTex=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb;\nsurfaceEmissiveColor=toLinearSpace(emissiveColorTex.rgb)*surfaceEmissiveColor*vEmissiveInfos.y;\n#endif\n#ifdef OVERLOADEDVALUES\nsurfaceEmissiveColor=mix(surfaceEmissiveColor,vOverloadedEmissive,vOverloadedIntensity.w);\n#endif\n#ifdef EMISSIVEFRESNEL\nfloat emissiveFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,emissiveRightColor.a,emissiveLeftColor.a);\nsurfaceEmissiveColor*=emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*emissiveRightColor.rgb;\n#endif\n\n#ifdef EMISSIVEASILLUMINATION\nvec3 finalDiffuse=max(lightDiffuseContribution*surfaceAlbedoContribution+vAmbientColor,0.0)*surfaceAlbedo.rgb;\n#ifdef OVERLOADEDSHADOWVALUES\nshadowedOnlyLightDiffuseContribution=max(shadowedOnlyLightDiffuseContribution*surfaceAlbedoContribution+vAmbientColor,0.0)*surfaceAlbedo.rgb;\n#endif\n#else\n#ifdef LINKEMISSIVEWITHALBEDO\nvec3 finalDiffuse=max((lightDiffuseContribution+surfaceEmissiveColor)*surfaceAlbedoContribution+vAmbientColor,0.0)*surfaceAlbedo.rgb;\n#ifdef OVERLOADEDSHADOWVALUES\nshadowedOnlyLightDiffuseContribution=max((shadowedOnlyLightDiffuseContribution+surfaceEmissiveColor)*surfaceAlbedoContribution+vAmbientColor,0.0)*surfaceAlbedo.rgb;\n#endif\n#else\nvec3 finalDiffuse=max(lightDiffuseContribution*surfaceAlbedoContribution+surfaceEmissiveColor+vAmbientColor,0.0)*surfaceAlbedo.rgb;\n#ifdef OVERLOADEDSHADOWVALUES\nshadowedOnlyLightDiffuseContribution=max(shadowedOnlyLightDiffuseContribution*surfaceAlbedoContribution+surfaceEmissiveColor+vAmbientColor,0.0)*surfaceAlbedo.rgb;\n#endif\n#endif\n#endif\n#ifdef OVERLOADEDSHADOWVALUES\nfinalDiffuse=mix(finalDiffuse,shadowedOnlyLightDiffuseContribution,(1.0-vOverloadedShadowIntensity.y));\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=lightSpecularContribution*surfaceReflectivityColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#ifdef SPECULAROVERALPHA\nalpha=clamp(alpha+getLuminance(finalSpecular),0.,1.);\n#endif\n#ifdef RADIANCEOVERALPHA\nalpha=clamp(alpha+getLuminance(environmentRadiance),0.,1.);\n#endif\n\n\n#ifdef EMISSIVEASILLUMINATION\nvec4 finalColor=vec4(finalDiffuse*ambientColor*vLightingIntensity.x+surfaceAlbedo.rgb*environmentIrradiance+finalSpecular*vLightingIntensity.x+environmentRadiance+surfaceEmissiveColor*vLightingIntensity.y+refractance,alpha);\n#else\nvec4 finalColor=vec4(finalDiffuse*ambientColor*vLightingIntensity.x+surfaceAlbedo.rgb*environmentIrradiance+finalSpecular*vLightingIntensity.x+environmentRadiance+refractance,alpha);\n#endif\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\nfinalColor.rgb*=lightmapColor;\n#else\nfinalColor.rgb+=lightmapColor;\n#endif\n#endif\n#endif\nfinalColor=max(finalColor,0.0);\n#ifdef CAMERATONEMAP\nfinalColor.rgb=toneMaps(finalColor.rgb);\n#endif\nfinalColor.rgb=toGammaSpace(finalColor.rgb);\n#include\n#include(color,finalColor)\n#ifdef CAMERACONTRAST\nfinalColor=contrasts(finalColor);\n#endif\nfinalColor.rgb=clamp(finalColor.rgb,0.,1.);\n#ifdef CAMERACOLORGRADING\nfinalColor=colorGrades(finalColor);\n#endif\n#ifdef CAMERACOLORCURVES\nfinalColor.rgb=applyColorCurves(finalColor.rgb);\n#endif\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ngl_FragColor=finalColor;\n}","pbrVertexShader":"precision highp float;\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include\n\n#include\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef ALBEDO\nvarying vec2 vAlbedoUV;\nuniform mat4 albedoMatrix;\nuniform vec2 vAlbedoInfos;\n#endif\n#ifdef AMBIENT\nvarying vec2 vAmbientUV;\nuniform mat4 ambientMatrix;\nuniform vec3 vAmbientInfos;\n#endif\n#ifdef OPACITY\nvarying vec2 vOpacityUV;\nuniform mat4 opacityMatrix;\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vEmissiveUV;\nuniform vec2 vEmissiveInfos;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef LIGHTMAP\nvarying vec2 vLightmapUV;\nuniform vec2 vLightmapInfos;\nuniform mat4 lightmapMatrix;\n#endif\n#if defined(REFLECTIVITY) || defined(METALLICWORKFLOW) \nvarying vec2 vReflectivityUV;\nuniform vec2 vReflectivityInfos;\nuniform mat4 reflectivityMatrix;\n#endif\n#ifdef BUMP\nvarying vec2 vBumpUV;\nuniform vec3 vBumpInfos;\nuniform mat4 bumpMatrix;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include\n#include\n#include[0..maxSimultaneousLights]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED\nvarying vec3 vDirectionW;\n#endif\n#include\nvoid main(void) {\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=position;\n#endif \n#include\n#include\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\nvec4 worldPos=finalWorld*vec4(position,1.0);\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED\nvDirectionW=normalize(vec3(finalWorld*vec4(position,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef ALBEDO\nif (vAlbedoInfos.x == 0.)\n{\nvAlbedoUV=vec2(albedoMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvAlbedoUV=vec2(albedoMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#ifdef AMBIENT\nif (vAmbientInfos.x == 0.)\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#ifdef OPACITY\nif (vOpacityInfos.x == 0.)\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#ifdef EMISSIVE\nif (vEmissiveInfos.x == 0.)\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#ifdef LIGHTMAP\nif (vLightmapInfos.x == 0.)\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(REFLECTIVITY) || defined(METALLICWORKFLOW) \nif (vReflectivityInfos.x == 0.)\n{\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#ifdef BUMP\nif (vBumpInfos.x == 0.)\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include\n\n#include\n\n#include[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n\n#include\n}","postprocessVertexShader":"\nattribute vec2 position;\nuniform vec2 scale;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) { \nvUV=(position*madd+madd)*scale;\ngl_Position=vec4(position,0.0,1.0);\n}","proceduralVertexShader":"\nattribute vec2 position;\n\nvarying vec2 vPosition;\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) { \nvPosition=position;\nvUV=position*madd+madd;\ngl_Position=vec4(position,0.0,1.0);\n}","refractionPixelShader":"\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D refractionSampler;\n\nuniform vec3 baseColor;\nuniform float depth;\nuniform float colorLevel;\nvoid main() {\nfloat ref=1.0-texture2D(refractionSampler,vUV).r;\nvec2 uv=vUV-vec2(0.5);\nvec2 offset=uv*depth*ref;\nvec3 sourceColor=texture2D(textureSampler,vUV-offset).rgb;\ngl_FragColor=vec4(sourceColor+sourceColor*ref*colorLevel,1.0);\n}","shadowMapPixelShader":"#ifndef FULLFLOAT\nvec4 pack(float depth)\n{\nconst vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);\nconst vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);\nvec4 res=fract(depth*bit_shift);\nres-=res.xxyz*bit_mask;\nreturn res;\n}\n\nvec2 packHalf(float depth) \n{ \nconst vec2 bitOffset=vec2(1.0/255.,0.);\nvec2 color=vec2(depth,fract(depth*255.));\nreturn color-(color.yy*bitOffset);\n}\n#endif\nvarying vec4 vPosition;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef CUBEMAP\nuniform vec3 lightPosition;\nuniform vec2 depthValues;\n#endif\nvoid main(void)\n{\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\n#ifdef CUBEMAP\nvec3 directionToLight=vPosition.xyz-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth-depthValues.x)/(depthValues.y-depthValues.x);\ndepth=clamp(depth,0.,1.0);\n#else\nfloat depth=vPosition.z/vPosition.w;\ndepth=depth*0.5+0.5;\n#endif\n#ifdef VSM\nfloat moment1=depth;\nfloat moment2=moment1*moment1;\n#ifndef FULLFLOAT\ngl_FragColor=vec4(packHalf(moment1),packHalf(moment2));\n#else\ngl_FragColor=vec4(moment1,moment2,1.0,1.0);\n#endif\n#else\n#ifndef FULLFLOAT\ngl_FragColor=pack(depth);\n#else\ngl_FragColor=vec4(depth,1.0,1.0,1.0);\n#endif\n#endif\n}","shadowMapVertexShader":"\nattribute vec3 position;\n#include\n\n#include\nuniform mat4 viewProjection;\nvarying vec4 vPosition;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\nvoid main(void)\n{\n#include\n#include\n#ifdef CUBEMAP\nvPosition=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#else\nvPosition=viewProjection*finalWorld*vec4(position,1.0);\ngl_Position=vPosition;\n#endif\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}","spritesPixelShader":"uniform bool alphaTest;\nvarying vec4 vColor;\n\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n\n#include\nvoid main(void) {\nvec4 color=texture2D(diffuseSampler,vUV);\nif (alphaTest) \n{\nif (color.a<0.95)\ndiscard;\n}\ncolor*=vColor;\n#include\ngl_FragColor=color;\n}","spritesVertexShader":"\nattribute vec4 position;\nattribute vec4 options;\nattribute vec4 cellInfo;\nattribute vec4 color;\n\nuniform vec2 textureInfos;\nuniform mat4 view;\nuniform mat4 projection;\n\nvarying vec2 vUV;\nvarying vec4 vColor;\n#include\nvoid main(void) { \nvec3 viewPos=(view*vec4(position.xyz,1.0)).xyz; \nvec2 cornerPos;\nfloat angle=position.w;\nvec2 size=vec2(options.x,options.y);\nvec2 offset=options.zw;\nvec2 uvScale=textureInfos.xy;\ncornerPos=vec2(offset.x-0.5,offset.y-0.5)*size;\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\n\nviewPos+=rotatedCorner;\ngl_Position=projection*vec4(viewPos,1.0); \n\nvColor=color;\n\nvec2 uvOffset=vec2(abs(offset.x-cellInfo.x),1.0-abs(offset.y-cellInfo.y));\nvUV=(uvOffset+cellInfo.zw)*uvScale;\n\n#ifdef FOG\nfFogDistance=viewPos.z;\n#endif\n}","ssaoPixelShader":"\nuniform sampler2D textureSampler;\nvarying vec2 vUV;\n#ifdef SSAO\nuniform sampler2D randomSampler;\nuniform float randTextureTiles;\nuniform float samplesFactor;\nuniform vec3 sampleSphere[SAMPLES];\nuniform float totalStrength;\nuniform float radius;\nuniform float area;\nuniform float fallOff;\nuniform float base;\nvec3 normalFromDepth(float depth,vec2 coords)\n{\nvec2 offset1=vec2(0.0,radius);\nvec2 offset2=vec2(radius,0.0);\nfloat depth1=texture2D(textureSampler,coords+offset1).r;\nfloat depth2=texture2D(textureSampler,coords+offset2).r;\nvec3 p1=vec3(offset1,depth1-depth);\nvec3 p2=vec3(offset2,depth2-depth);\nvec3 normal=cross(p1,p2);\nnormal.z=-normal.z;\nreturn normalize(normal);\n}\nvoid main()\n{\nvec3 random=normalize(texture2D(randomSampler,vUV*randTextureTiles).rgb);\nfloat depth=texture2D(textureSampler,vUV).r;\nvec3 position=vec3(vUV,depth);\nvec3 normal=normalFromDepth(depth,vUV);\nfloat radiusDepth=radius/depth;\nfloat occlusion=0.0;\nvec3 ray;\nvec3 hemiRay;\nfloat occlusionDepth;\nfloat difference;\nfor (int i=0; i0.5;\ntexCoord1=vec2(useCamB ? (vUV.x-0.5)*2.0 : vUV.x*2.0,vUV.y);\ntexCoord2=vec2(texCoord1.x+stepSize.x,vUV.y);\n#else\nuseCamB=vUV.y>0.5;\ntexCoord1=vec2(vUV.x,useCamB ? (vUV.y-0.5)*2.0 : vUV.y*2.0);\ntexCoord2=vec2(vUV.x,texCoord1.y+stepSize.y);\n#endif\n\nif (useCamB){\nfrag1=texture2D(textureSampler,texCoord1).rgb;\nfrag2=texture2D(textureSampler,texCoord2).rgb;\n}else{\nfrag1=texture2D(camASampler ,texCoord1).rgb;\nfrag2=texture2D(camASampler ,texCoord2).rgb;\n}\ngl_FragColor=vec4((frag1+frag2)/TWO,1.0);\n}","tonemapPixelShader":"\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform float _ExposureAdjustment;\n#if defined(HABLE_TONEMAPPING)\nconst float A=0.15;\nconst float B=0.50;\nconst float C=0.10;\nconst float D=0.20;\nconst float E=0.02;\nconst float F=0.30;\nconst float W=11.2;\n#endif\nfloat Luminance(vec3 c)\n{\nreturn dot(c,vec3(0.22,0.707,0.071));\n}\nvoid main(void) \n{\nvec3 colour=texture2D(textureSampler,vUV).rgb;\n#if defined(REINHARD_TONEMAPPING)\nfloat lum=Luminance(colour.rgb); \nfloat lumTm=lum*_ExposureAdjustment;\nfloat scale=lumTm/(1.0+lumTm); \ncolour*=scale/lum;\n#elif defined(HABLE_TONEMAPPING)\ncolour*=_ExposureAdjustment;\nconst float ExposureBias=2.0;\nvec3 x=ExposureBias*colour;\nvec3 curr=((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;\nx=vec3(W,W,W);\nvec3 whiteScale=1.0/(((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F);\ncolour=curr*whiteScale;\n#elif defined(OPTIMIZED_HEJIDAWSON_TONEMAPPING)\ncolour*=_ExposureAdjustment;\nvec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);\nvec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);\ncolour=retColor*retColor;\n#elif defined(PHOTOGRAPHIC_TONEMAPPING)\ncolour=vec3(1.0,1.0,1.0)-exp2(-_ExposureAdjustment*colour);\n#endif\ngl_FragColor=vec4(colour.rgb,1.0);\n}","volumetricLightScatteringPixelShader":"uniform sampler2D textureSampler;\nuniform sampler2D lightScatteringSampler;\nuniform float decay;\nuniform float exposure;\nuniform float weight;\nuniform float density;\nuniform vec2 meshPositionOnScreen;\nvarying vec2 vUV;\nvoid main(void) {\nvec2 tc=vUV;\nvec2 deltaTexCoord=(tc-meshPositionOnScreen.xy);\ndeltaTexCoord*=1.0/float(NUM_SAMPLES)*density;\nfloat illuminationDecay=1.0;\nvec4 color=texture2D(lightScatteringSampler,tc)*0.4;\nfor(int i=0; i1.0 || tc.y<0.0 || tc.y>1.0)\ngl_FragColor=vec4(0.0,0.0,0.0,1.0);\nelse{\ngl_FragColor=vec4(texture2D(textureSampler,tc).rgb,1.0);\n}\n}"}; +BABYLON.Effect.IncludesShadersStore={"bonesDeclaration":"#if NUM_BONE_INFLUENCERS>0\nuniform mat4 mBones[BonesPerMesh];\nattribute vec4 matricesIndices;\nattribute vec4 matricesWeights;\n#if NUM_BONE_INFLUENCERS>4\nattribute vec4 matricesIndicesExtra;\nattribute vec4 matricesWeightsExtra;\n#endif\n#endif","bonesVertex":"#if NUM_BONE_INFLUENCERS>0\nmat4 influence;\ninfluence=mBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=mBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence+=mBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence+=mBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif \nfinalWorld=finalWorld*influence;\n#endif","bumpFragment":"vec2 uvOffset=vec2(0.0,0.0);\n#if defined(BUMP) || defined(PARALLAX)\nmat3 TBN=cotangent_frame(normalW*vBumpInfos.y,-viewDirectionW,vBumpUV);\n#endif\n#ifdef PARALLAX\nmat3 invTBN=transposeMat3(TBN);\n#ifdef PARALLAXOCCLUSION\nuvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,vBumpUV,vBumpInfos.z);\n#else\nuvOffset=parallaxOffset(invTBN*viewDirectionW,vBumpInfos.z);\n#endif\n#endif\n#ifdef BUMP\nnormalW=perturbNormal(viewDirectionW,TBN,vBumpUV+uvOffset);\n#endif","bumpFragmentFunctions":"#ifdef BUMP\nvarying vec2 vBumpUV;\nuniform vec3 vBumpInfos;\nuniform sampler2D bumpSampler;\n\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv)\n{\n\nvec3 dp1=dFdx(p);\nvec3 dp2=dFdy(p);\nvec2 duv1=dFdx(uv);\nvec2 duv2=dFdy(uv);\n\nvec3 dp2perp=cross(dp2,normal);\nvec3 dp1perp=cross(normal,dp1);\nvec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;\nvec3 binormal=dp2perp*duv1.y+dp1perp*duv2.y;\n\nfloat invmax=inversesqrt(max(dot(tangent,tangent),dot(binormal,binormal)));\nreturn mat3(tangent*invmax,binormal*invmax,normal);\n}\nvec3 perturbNormal(vec3 viewDir,mat3 cotangentFrame,vec2 uv)\n{\nvec3 map=texture2D(bumpSampler,uv).xyz;\n#ifdef INVERTNORMALMAPX\nmap.x=1.0-map.x;\n#endif\n#ifdef INVERTNORMALMAPY\nmap.y=1.0-map.y;\n#endif\nmap=map*255./127.-128./127.;\nreturn normalize(cotangentFrame*map);\n}\n#ifdef PARALLAX\nconst float minSamples=4.;\nconst float maxSamples=15.;\nconst int iMaxSamples=15;\n\nvec2 parallaxOcclusion(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale) {\nfloat parallaxLimit=length(vViewDirCoT.xy)/vViewDirCoT.z;\nparallaxLimit*=parallaxScale;\nvec2 vOffsetDir=normalize(vViewDirCoT.xy);\nvec2 vMaxOffset=vOffsetDir*parallaxLimit;\nfloat numSamples=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));\nfloat stepSize=1.0/numSamples;\n\nfloat currRayHeight=1.0;\nvec2 vCurrOffset=vec2(0,0);\nvec2 vLastOffset=vec2(0,0);\nfloat lastSampledHeight=1.0;\nfloat currSampledHeight=1.0;\nfor (int i=0; icurrRayHeight)\n{\nfloat delta1=currSampledHeight-currRayHeight;\nfloat delta2=(currRayHeight+stepSize)-lastSampledHeight;\nfloat ratio=delta1/(delta1+delta2);\nvCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;\n\nbreak;\n}\nelse\n{\ncurrRayHeight-=stepSize;\nvLastOffset=vCurrOffset;\nvCurrOffset+=stepSize*vMaxOffset;\nlastSampledHeight=currSampledHeight;\n}\n}\nreturn vCurrOffset;\n}\nvec2 parallaxOffset(vec3 viewDir,float heightScale)\n{\n\nfloat height=texture2D(bumpSampler,vBumpUV).w;\nvec2 texCoordOffset=heightScale*viewDir.xy*height;\nreturn -texCoordOffset;\n}\n#endif\n#endif","clipPlaneFragment":"#ifdef CLIPPLANE\nif (fClipDistance>0.0)\n{\ndiscard;\n}\n#endif","clipPlaneFragmentDeclaration":"#ifdef CLIPPLANE\nvarying float fClipDistance;\n#endif","clipPlaneVertex":"#ifdef CLIPPLANE\nfClipDistance=dot(worldPos,vClipPlane);\n#endif","clipPlaneVertexDeclaration":"#ifdef CLIPPLANE\nuniform vec4 vClipPlane;\nvarying float fClipDistance;\n#endif","colorCurves":"const vec3 HDTVRec709_RGBLuminanceCoefficients=vec3(0.2126,0.7152,0.0722);\nvec3 applyColorCurves(vec3 original) {\nvec3 result=original;\n\n\n\nfloat luma=dot(result.rgb,HDTVRec709_RGBLuminanceCoefficients);\nvec2 curveMix=clamp(vec2(luma*3.0-1.5,luma*-3.0+1.5),vec2(0.0,0.0),vec2(1.0,1.0));\nvec4 colorCurve=vCameraColorCurveNeutral+curveMix.x*vCameraColorCurvePositive-curveMix.y*vCameraColorCurveNegative;\nresult.rgb*=colorCurve.rgb;\nresult.rgb=mix(vec3(luma,luma,luma),result.rgb,colorCurve.a);\nreturn result;\n}","colorCurvesDefinition":"uniform vec4 vCameraColorCurveNeutral;\nuniform vec4 vCameraColorCurvePositive;\nuniform vec4 vCameraColorCurveNegative;","colorGrading":"vec4 colorGrades(vec4 color) \n{ \n\nfloat sliceContinuous=color.z*vCameraColorGradingInfos.z;\nfloat sliceInteger=floor(sliceContinuous);\n\n\nfloat sliceFraction=sliceContinuous-sliceInteger; \n\nvec2 sliceUV=color.xy*vCameraColorGradingScaleOffset.xy+vCameraColorGradingScaleOffset.zw;\n\n\nsliceUV.x+=sliceInteger*vCameraColorGradingInfos.w;\nvec4 slice0Color=texture2D(cameraColorGrading2DSampler,sliceUV);\nsliceUV.x+=vCameraColorGradingInfos.w;\nvec4 slice1Color=texture2D(cameraColorGrading2DSampler,sliceUV);\nvec3 result=mix(slice0Color.rgb,slice1Color.rgb,sliceFraction);\ncolor.rgb=mix(color.rgb,result,vCameraColorGradingInfos.x);\nreturn color;\n}","colorGradingDefinition":"uniform sampler2D cameraColorGrading2DSampler;\nuniform vec4 vCameraColorGradingInfos;\nuniform vec4 vCameraColorGradingScaleOffset;","fogFragment":"#ifdef FOG\nfloat fog=CalcFogFactor();\ncolor.rgb=fog*color.rgb+(1.0-fog)*vFogColor;\n#endif","fogFragmentDeclaration":"#ifdef FOG\n#define FOGMODE_NONE 0.\n#define FOGMODE_EXP 1.\n#define FOGMODE_EXP2 2.\n#define FOGMODE_LINEAR 3.\n#define E 2.71828\nuniform vec4 vFogInfos;\nuniform vec3 vFogColor;\nvarying float fFogDistance;\nfloat CalcFogFactor()\n{\nfloat fogCoeff=1.0;\nfloat fogStart=vFogInfos.y;\nfloat fogEnd=vFogInfos.z;\nfloat fogDensity=vFogInfos.w;\nif (FOGMODE_LINEAR == vFogInfos.x)\n{\nfogCoeff=(fogEnd-fFogDistance)/(fogEnd-fogStart);\n}\nelse if (FOGMODE_EXP == vFogInfos.x)\n{\nfogCoeff=1.0/pow(E,fFogDistance*fogDensity);\n}\nelse if (FOGMODE_EXP2 == vFogInfos.x)\n{\nfogCoeff=1.0/pow(E,fFogDistance*fFogDistance*fogDensity*fogDensity);\n}\nreturn clamp(fogCoeff,0.0,1.0);\n}\n#endif","fogVertex":"#ifdef FOG\nfFogDistance=(view*worldPos).z;\n#endif","fogVertexDeclaration":"#ifdef FOG\nvarying float fFogDistance;\n#endif","fresnelFunction":"#ifdef FRESNEL\nfloat computeFresnelTerm(vec3 viewDirection,vec3 worldNormal,float bias,float power)\n{\nfloat fresnelTerm=pow(bias+abs(dot(viewDirection,worldNormal)),power);\nreturn clamp(fresnelTerm,0.,1.);\n}\n#endif","harmonicsFunctions":"#ifdef USESPHERICALFROMREFLECTIONMAP\nuniform vec3 vSphericalX;\nuniform vec3 vSphericalY;\nuniform vec3 vSphericalZ;\nuniform vec3 vSphericalXX;\nuniform vec3 vSphericalYY;\nuniform vec3 vSphericalZZ;\nuniform vec3 vSphericalXY;\nuniform vec3 vSphericalYZ;\nuniform vec3 vSphericalZX;\nvec3 EnvironmentIrradiance(vec3 normal)\n{\n\n\n\nvec3 result =\nvSphericalX*normal.x +\nvSphericalY*normal.y +\nvSphericalZ*normal.z +\nvSphericalXX*normal.x*normal.x +\nvSphericalYY*normal.y*normal.y +\nvSphericalZZ*normal.z*normal.z +\nvSphericalYZ*normal.y*normal.z +\nvSphericalZX*normal.z*normal.x +\nvSphericalXY*normal.x*normal.y;\nreturn result.rgb;\n}\n#endif","helperFunctions":"mat3 transposeMat3(mat3 inMatrix) {\nvec3 i0=inMatrix[0];\nvec3 i1=inMatrix[1];\nvec3 i2=inMatrix[2];\nmat3 outMatrix=mat3(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);\nreturn outMatrix;\n}","instancesDeclaration":"#ifdef INSTANCES\nattribute vec4 world0;\nattribute vec4 world1;\nattribute vec4 world2;\nattribute vec4 world3;\n#else\nuniform mat4 world;\n#endif","instancesVertex":"#ifdef INSTANCES\nmat4 finalWorld=mat4(world0,world1,world2,world3);\n#else\nmat4 finalWorld=world;\n#endif","lightFragment":"#ifdef LIGHT{X}\n#if defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})\n\n#else\n#ifndef SPECULARTERM\nvec3 vLightSpecular{X}=vec3(0.);\n#endif\n#ifdef SPOTLIGHT{X}\ninfo=computeSpotLighting(viewDirectionW,normalW,vLightData{X},vLightDirection{X},vLightDiffuse{X}.rgb,vLightSpecular{X},vLightDiffuse{X}.a,glossiness);\n#endif\n#ifdef HEMILIGHT{X}\ninfo=computeHemisphericLighting(viewDirectionW,normalW,vLightData{X},vLightDiffuse{X}.rgb,vLightSpecular{X},vLightGround{X},glossiness);\n#endif\n#if defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})\ninfo=computeLighting(viewDirectionW,normalW,vLightData{X},vLightDiffuse{X}.rgb,vLightSpecular{X},vLightDiffuse{X}.a,glossiness);\n#endif\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWVSM{X}\nshadow=computeShadowWithVSM(vPositionFromLight{X},shadowSampler{X},shadowsInfo{X}.z,shadowsInfo{X}.x);\n#else\n#ifdef SHADOWPCF{X}\n#if defined(POINTLIGHT{X})\nshadow=computeShadowWithPCFCube(vLightData{X}.xyz,shadowSampler{X},shadowsInfo{X}.y,shadowsInfo{X}.z,shadowsInfo{X}.x);\n#else\nshadow=computeShadowWithPCF(vPositionFromLight{X},shadowSampler{X},shadowsInfo{X}.y,shadowsInfo{X}.z,shadowsInfo{X}.x);\n#endif\n#else\n#if defined(POINTLIGHT{X})\nshadow=computeShadowCube(vLightData{X}.xyz,shadowSampler{X},shadowsInfo{X}.x,shadowsInfo{X}.z);\n#else\nshadow=computeShadow(vPositionFromLight{X},shadowSampler{X},shadowsInfo{X}.x,shadowsInfo{X}.z);\n#endif\n#endif\n#endif\n#else\nshadow=1.;\n#endif\n#if defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})\ndiffuseBase+=lightmapColor*shadow;\n#ifdef SPECULARTERM\n#ifndef LIGHTMAPNOSPECULAR{X}\nspecularBase+=info.specular*shadow*lightmapColor;\n#endif\n#endif\n#else\ndiffuseBase+=info.diffuse*shadow;\n#ifdef SPECULARTERM\nspecularBase+=info.specular*shadow;\n#endif\n#endif\n#endif","lightFragmentDeclaration":"#ifdef LIGHT{X}\nuniform vec4 vLightData{X};\nuniform vec4 vLightDiffuse{X};\n#ifdef SPECULARTERM\nuniform vec3 vLightSpecular{X};\n#endif\n#ifdef SHADOW{X}\n#if defined(SPOTLIGHT{X}) || defined(DIRLIGHT{X})\nvarying vec4 vPositionFromLight{X};\nuniform sampler2D shadowSampler{X};\n#else\nuniform samplerCube shadowSampler{X};\n#endif\nuniform vec3 shadowsInfo{X};\n#endif\n#ifdef SPOTLIGHT{X}\nuniform vec4 vLightDirection{X};\n#endif\n#ifdef HEMILIGHT{X}\nuniform vec3 vLightGround{X};\n#endif\n#endif","lightsFragmentFunctions":"\nstruct lightingInfo\n{\nvec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n};\nlightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 lightVectorW;\nfloat attenuation=1.0;\nif (lightData.w == 0.)\n{\nvec3 direction=lightData.xyz-vPositionW;\nattenuation=max(0.,1.0-length(direction)/range);\nlightVectorW=normalize(direction);\n}\nelse\n{\nlightVectorW=normalize(-lightData.xyz);\n}\n\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nlightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 direction=lightData.xyz-vPositionW;\nvec3 lightVectorW=normalize(direction);\nfloat attenuation=max(0.,1.0-length(direction)/range);\n\nfloat cosAngle=max(0.,dot(-lightDirection.xyz,lightVectorW));\nif (cosAngle>=lightDirection.w)\n{\ncosAngle=max(0.,pow(cosAngle,lightData.w));\nattenuation*=cosAngle;\n\nfloat ndl=max(0.,dot(vNormal,-lightDirection.xyz));\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW-lightDirection.xyz);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nresult.diffuse=vec3(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3(0.);\n#endif\nreturn result;\n}\nlightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {\nlightingInfo result;\n\nfloat ndl=dot(vNormal,lightData.xyz)*0.5+0.5;\nresult.diffuse=mix(groundColor,diffuseColor,ndl);\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightData.xyz);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor;\n#endif\nreturn result;\n}\n","logDepthDeclaration":"#ifdef LOGARITHMICDEPTH\nuniform float logarithmicDepthConstant;\nvarying float vFragmentDepth;\n#endif","logDepthFragment":"#ifdef LOGARITHMICDEPTH\ngl_FragDepthEXT=log2(vFragmentDepth)*logarithmicDepthConstant*0.5;\n#endif","logDepthVertex":"#ifdef LOGARITHMICDEPTH\nvFragmentDepth=1.0+gl_Position.w;\ngl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;\n#endif","pbrFunctions":"\n#define RECIPROCAL_PI2 0.15915494\n#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\n\nconst float kPi=3.1415926535897932384626433832795;\nconst float kRougnhessToAlphaScale=0.1;\nconst float kRougnhessToAlphaOffset=0.29248125;\nfloat Square(float value)\n{\nreturn value*value;\n}\nfloat getLuminance(vec3 color)\n{\nreturn clamp(dot(color,vec3(0.2126,0.7152,0.0722)),0.,1.);\n}\nfloat convertRoughnessToAverageSlope(float roughness)\n{\n\nconst float kMinimumVariance=0.0005;\nfloat alphaG=Square(roughness)+kMinimumVariance;\nreturn alphaG;\n}\n\nfloat getMipMapIndexFromAverageSlope(float maxMipLevel,float alpha)\n{\n\n\n\n\n\n\n\nfloat mip=kRougnhessToAlphaOffset+maxMipLevel+(maxMipLevel*kRougnhessToAlphaScale*log2(alpha));\nreturn clamp(mip,0.,maxMipLevel);\n}\nfloat getMipMapIndexFromAverageSlopeWithPMREM(float maxMipLevel,float alphaG)\n{\nfloat specularPower=clamp(2./alphaG-2.,0.000001,2048.);\n\nreturn clamp(- 0.5*log2(specularPower)+5.5,0.,maxMipLevel);\n}\n\nfloat smithVisibilityG1_TrowbridgeReitzGGX(float dot,float alphaG)\n{\nfloat tanSquared=(1.0-dot*dot)/(dot*dot);\nreturn 2.0/(1.0+sqrt(1.0+alphaG*alphaG*tanSquared));\n}\nfloat smithVisibilityG_TrowbridgeReitzGGX_Walter(float NdotL,float NdotV,float alphaG)\n{\nreturn smithVisibilityG1_TrowbridgeReitzGGX(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGX(NdotV,alphaG);\n}\n\n\nfloat normalDistributionFunction_TrowbridgeReitzGGX(float NdotH,float alphaG)\n{\n\n\n\nfloat a2=Square(alphaG);\nfloat d=NdotH*NdotH*(a2-1.0)+1.0;\nreturn a2/(kPi*d*d);\n}\nvec3 fresnelSchlickGGX(float VdotH,vec3 reflectance0,vec3 reflectance90)\n{\nreturn reflectance0+(reflectance90-reflectance0)*pow(clamp(1.0-VdotH,0.,1.),5.0);\n}\nvec3 FresnelSchlickEnvironmentGGX(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)\n{\n\nfloat weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);\nreturn reflectance0+weight*(reflectance90-reflectance0)*pow(clamp(1.0-VdotN,0.,1.),5.0);\n}\n\nvec3 computeSpecularTerm(float NdotH,float NdotL,float NdotV,float VdotH,float roughness,vec3 specularColor,vec3 reflectance90)\n{\nfloat alphaG=convertRoughnessToAverageSlope(roughness);\nfloat distribution=normalDistributionFunction_TrowbridgeReitzGGX(NdotH,alphaG);\nfloat visibility=smithVisibilityG_TrowbridgeReitzGGX_Walter(NdotL,NdotV,alphaG);\nvisibility/=(4.0*NdotL*NdotV); \nvec3 fresnel=fresnelSchlickGGX(VdotH,specularColor,reflectance90);\nfloat specTerm=max(0.,visibility*distribution)*NdotL;\nreturn fresnel*specTerm*kPi; \n}\nfloat computeDiffuseTerm(float NdotL,float NdotV,float VdotH,float roughness)\n{\n\n\nfloat diffuseFresnelNV=pow(clamp(1.0-NdotL,0.000001,1.),5.0);\nfloat diffuseFresnelNL=pow(clamp(1.0-NdotV,0.000001,1.),5.0);\nfloat diffuseFresnel90=0.5+2.0*VdotH*VdotH*roughness;\nfloat diffuseFresnelTerm =\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);\nreturn diffuseFresnelTerm*NdotL;\n\n\n}\nfloat adjustRoughnessFromLightProperties(float roughness,float lightRadius,float lightDistance)\n{\n#ifdef USEPHYSICALLIGHTFALLOFF\n\nfloat lightRoughness=lightRadius/lightDistance;\n\nfloat totalRoughness=clamp(lightRoughness+roughness,0.,1.);\nreturn totalRoughness;\n#else\nreturn roughness;\n#endif\n}\nfloat computeDefaultMicroSurface(float microSurface,vec3 reflectivityColor)\n{\nfloat kReflectivityNoAlphaWorkflow_SmoothnessMax=0.95;\nfloat reflectivityLuminance=getLuminance(reflectivityColor);\nfloat reflectivityLuma=sqrt(reflectivityLuminance);\nmicroSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;\nreturn microSurface;\n}\nvec3 toLinearSpace(vec3 color)\n{\nreturn vec3(pow(color.r,2.2),pow(color.g,2.2),pow(color.b,2.2));\n}\nvec3 toGammaSpace(vec3 color)\n{\nreturn vec3(pow(color.r,1.0/2.2),pow(color.g,1.0/2.2),pow(color.b,1.0/2.2));\n}\n#ifdef CAMERATONEMAP\nvec3 toneMaps(vec3 color)\n{\ncolor=max(color,0.0);\n\ncolor.rgb=color.rgb*vCameraInfos.x;\nfloat tuning=1.5; \n\n\nvec3 tonemapped=1.0-exp2(-color.rgb*tuning); \ncolor.rgb=mix(color.rgb,tonemapped,1.0);\nreturn color;\n}\n#endif\n#ifdef CAMERACONTRAST\nvec4 contrasts(vec4 color)\n{\ncolor=clamp(color,0.0,1.0);\nvec3 resultHighContrast=color.rgb*color.rgb*(3.0-2.0*color.rgb);\nfloat contrast=vCameraInfos.y;\nif (contrast<1.0)\n{\n\ncolor.rgb=mix(vec3(0.5,0.5,0.5),color.rgb,contrast);\n}\nelse\n{\n\ncolor.rgb=mix(color.rgb,resultHighContrast,contrast-1.0);\n}\nreturn color;\n}\n#endif","pbrLightFunctions":"\nstruct lightingInfo\n{\nvec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n};\nfloat computeDistanceLightFalloff(vec3 lightOffset,float lightDistanceSquared,float range)\n{ \n#ifdef USEPHYSICALLIGHTFALLOFF\nfloat lightDistanceFalloff=1.0/((lightDistanceSquared+0.0001));\n#else\nfloat lightDistanceFalloff=max(0.,1.0-length(lightOffset)/range);\n#endif\nreturn lightDistanceFalloff;\n}\nfloat computeDirectionalLightFalloff(vec3 lightDirection,vec3 directionToLightCenterW,float lightAngle,float exponent)\n{\nfloat falloff=0.0;\n#ifdef USEPHYSICALLIGHTFALLOFF\nfloat cosHalfAngle=cos(lightAngle*0.5);\nconst float kMinusLog2ConeAngleIntensityRatio=6.64385618977; \n\n\n\n\n\nfloat concentrationKappa=kMinusLog2ConeAngleIntensityRatio/(1.0-cosHalfAngle);\n\n\nvec4 lightDirectionSpreadSG=vec4(-lightDirection*concentrationKappa,-concentrationKappa);\nfalloff=exp2(dot(vec4(directionToLightCenterW,1.0),lightDirectionSpreadSG));\n#else\nfloat cosAngle=max(0.000000000000001,dot(-lightDirection,directionToLightCenterW));\nif (cosAngle>=lightAngle)\n{\nfalloff=max(0.,pow(cosAngle,exponent));\n}\n#endif\nreturn falloff;\n}\nlightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float rangeRadius,float roughness,float NdotV,vec3 reflectance90,out float NdotL) {\nlightingInfo result;\nvec3 lightDirection;\nfloat attenuation=1.0;\nfloat lightDistance;\n\nif (lightData.w == 0.)\n{\nvec3 lightOffset=lightData.xyz-vPositionW;\nfloat lightDistanceSquared=dot(lightOffset,lightOffset);\nattenuation=computeDistanceLightFalloff(lightOffset,lightDistanceSquared,rangeRadius);\nlightDistance=sqrt(lightDistanceSquared);\nlightDirection=normalize(lightOffset);\n}\n\nelse\n{\nlightDistance=length(-lightData.xyz);\nlightDirection=normalize(-lightData.xyz);\n}\n\nroughness=adjustRoughnessFromLightProperties(roughness,rangeRadius,lightDistance);\n\nvec3 H=normalize(viewDirectionW+lightDirection);\nNdotL=max(0.00000000001,dot(vNormal,lightDirection));\nfloat VdotH=clamp(0.00000000001,1.0,dot(viewDirectionW,H));\nfloat diffuseTerm=computeDiffuseTerm(NdotL,NdotV,VdotH,roughness);\nresult.diffuse=diffuseTerm*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nfloat NdotH=max(0.00000000001,dot(vNormal,H));\nvec3 specTerm=computeSpecularTerm(NdotH,NdotL,NdotV,VdotH,roughness,specularColor,reflectance90);\nresult.specular=specTerm*attenuation;\n#endif\nreturn result;\n}\nlightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float rangeRadius,float roughness,float NdotV,vec3 reflectance90,out float NdotL) {\nlightingInfo result;\nvec3 lightOffset=lightData.xyz-vPositionW;\nvec3 directionToLightCenterW=normalize(lightOffset);\n\nfloat lightDistanceSquared=dot(lightOffset,lightOffset);\nfloat attenuation=computeDistanceLightFalloff(lightOffset,lightDistanceSquared,rangeRadius);\n\nfloat directionalAttenuation=computeDirectionalLightFalloff(lightDirection.xyz,directionToLightCenterW,lightDirection.w,lightData.w);\nattenuation*=directionalAttenuation;\n\nfloat lightDistance=sqrt(lightDistanceSquared);\nroughness=adjustRoughnessFromLightProperties(roughness,rangeRadius,lightDistance);\n\nvec3 H=normalize(viewDirectionW-lightDirection.xyz);\nNdotL=max(0.00000000001,dot(vNormal,-lightDirection.xyz));\nfloat VdotH=clamp(dot(viewDirectionW,H),0.00000000001,1.0);\nfloat diffuseTerm=computeDiffuseTerm(NdotL,NdotV,VdotH,roughness);\nresult.diffuse=diffuseTerm*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nfloat NdotH=max(0.00000000001,dot(vNormal,H));\nvec3 specTerm=computeSpecularTerm(NdotH,NdotL,NdotV,VdotH,roughness,specularColor,reflectance90);\nresult.specular=specTerm*attenuation;\n#endif\nreturn result;\n}\nlightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float roughness,float NdotV,vec3 reflectance90,out float NdotL) {\nlightingInfo result;\n\n\n\nNdotL=dot(vNormal,lightData.xyz)*0.5+0.5;\nresult.diffuse=mix(groundColor,diffuseColor,NdotL);\n#ifdef SPECULARTERM\n\nvec3 lightVectorW=normalize(lightData.xyz);\nvec3 H=normalize(viewDirectionW+lightVectorW);\nfloat NdotH=max(0.00000000001,dot(vNormal,H));\nNdotL=max(0.00000000001,NdotL);\nfloat VdotH=clamp(0.00000000001,1.0,dot(viewDirectionW,H));\nvec3 specTerm=computeSpecularTerm(NdotH,NdotL,NdotV,VdotH,roughness,specularColor,reflectance90);\nresult.specular=specTerm;\n#endif\nreturn result;\n}","pbrLightFunctionsCall":"#ifdef LIGHT{X}\n#if defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})\n\n#else\n#ifndef SPECULARTERM\nvec3 vLightSpecular{X}=vec3(0.0);\n#endif\n#ifdef SPOTLIGHT{X}\ninfo=computeSpotLighting(viewDirectionW,normalW,vLightData{X},vLightDirection{X},vLightDiffuse{X}.rgb,vLightSpecular{X},vLightDiffuse{X}.a,roughness,NdotV,specularEnvironmentR90,NdotL);\n#endif\n#ifdef HEMILIGHT{X}\ninfo=computeHemisphericLighting(viewDirectionW,normalW,vLightData{X},vLightDiffuse{X}.rgb,vLightSpecular{X},vLightGround{X},roughness,NdotV,specularEnvironmentR90,NdotL);\n#endif\n#if defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})\ninfo=computeLighting(viewDirectionW,normalW,vLightData{X},vLightDiffuse{X}.rgb,vLightSpecular{X},vLightDiffuse{X}.a,roughness,NdotV,specularEnvironmentR90,NdotL);\n#endif\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWVSM{X}\nnotShadowLevel=computeShadowWithVSM(vPositionFromLight{X},shadowSampler{X},shadowsInfo{X}.z,shadowsInfo{X}.x);\n#else\n#ifdef SHADOWPCF{X}\n#if defined(POINTLIGHT{X})\nnotShadowLevel=computeShadowWithPCFCube(vLightData{X}.xyz,shadowSampler{X},shadowsInfo{X}.y,shadowsInfo{X}.z,shadowsInfo{X}.x);\n#else\nnotShadowLevel=computeShadowWithPCF(vPositionFromLight{X},shadowSampler{X},shadowsInfo{X}.y,shadowsInfo{X}.z,shadowsInfo{X}.x);\n#endif\n#else\n#if defined(POINTLIGHT{X})\nnotShadowLevel=computeShadowCube(vLightData{X}.xyz,shadowSampler{X},shadowsInfo{X}.x,shadowsInfo{X}.z);\n#else\nnotShadowLevel=computeShadow(vPositionFromLight{X},shadowSampler{X},shadowsInfo{X}.x,shadowsInfo{X}.z);\n#endif\n#endif\n#endif\n#else\nnotShadowLevel=1.;\n#endif\n#if defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})\nlightDiffuseContribution+=lightmapColor*notShadowLevel;\n#ifdef SPECULARTERM\n#ifndef LIGHTMAPNOSPECULAR{X}\nlightSpecularContribution+=info.specular*notShadowLevel*lightmapColor;\n#endif\n#endif\n#else\nlightDiffuseContribution+=info.diffuse*notShadowLevel;\n#ifdef OVERLOADEDSHADOWVALUES\nif (NdotL<0.000000000011)\n{\nnotShadowLevel=1.;\n}\nshadowedOnlyLightDiffuseContribution*=notShadowLevel;\n#endif\n#ifdef SPECULARTERM\nlightSpecularContribution+=info.specular*notShadowLevel;\n#endif\n#endif\n#endif","pbrShadowFunctions":"\n#ifdef SHADOWS\n#ifndef SHADOWFULLFLOAT\nfloat unpack(vec4 color)\n{\nconst vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);\nreturn dot(color,bit_shift);\n}\n#endif\nuniform vec2 depthValues;\nfloat computeShadowCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,float bias)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y =-directionToLight.y;\n#ifndef SHADOWFULLFLOAT\nfloat shadow=unpack(textureCube(shadowSampler,directionToLight))+bias;\n#else\nfloat shadow=textureCube(shadowSampler,directionToLight).x+bias;\n#endif\nif (depth>shadow)\n{\n#ifdef OVERLOADEDSHADOWVALUES\nreturn mix(1.0,darkness,vOverloadedShadowIntensity.x);\n#else\nreturn darkness;\n#endif\n}\nreturn 1.0;\n}\nfloat computeShadowWithPCFCube(vec3 lightPosition,samplerCube shadowSampler,float mapSize,float bias,float darkness)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth-depthValues.x)/(depthValues.y-depthValues.x);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\nfloat visibility=1.;\nvec3 poissonDisk[4];\npoissonDisk[0]=vec3(-1.0,1.0,-1.0);\npoissonDisk[1]=vec3(1.0,-1.0,-1.0);\npoissonDisk[2]=vec3(-1.0,-1.0,-1.0);\npoissonDisk[3]=vec3(1.0,-1.0,1.0);\n\nfloat biasedDepth=depth-bias;\n#ifndef SHADOWFULLFLOAT\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize))1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\n#ifndef SHADOWFULLFLOAT\nfloat shadow=unpack(texture2D(shadowSampler,uv))+bias;\n#else\nfloat shadow=texture2D(shadowSampler,uv).x+bias;\n#endif\nif (depth.z>shadow)\n{\n#ifdef OVERLOADEDSHADOWVALUES\nreturn mix(1.0,darkness,vOverloadedShadowIntensity.x);\n#else\nreturn darkness;\n#endif\n}\nreturn 1.;\n}\nfloat computeShadowWithPCF(vec4 vPositionFromLight,sampler2D shadowSampler,float mapSize,float bias,float darkness)\n{\nvec3 depth=vPositionFromLight.xyz/vPositionFromLight.w;\ndepth=0.5*depth+vec3(0.5);\nvec2 uv=depth.xy;\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nfloat visibility=1.;\nvec2 poissonDisk[4];\npoissonDisk[0]=vec2(-0.94201624,-0.39906216);\npoissonDisk[1]=vec2(0.94558609,-0.76890725);\npoissonDisk[2]=vec2(-0.094184101,-0.92938870);\npoissonDisk[3]=vec2(0.34495938,0.29387760);\n\nfloat biasedDepth=depth.z-bias;\n#ifndef SHADOWFULLFLOAT\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[0]*mapSize))1.0 || uv.y<0. || uv.y>1.0 || depth.z>=1.0)\n{\nreturn 1.0;\n}\nvec4 texel=texture2D(shadowSampler,uv);\n#ifndef SHADOWFULLFLOAT\nvec2 moments=vec2(unpackHalf(texel.xy),unpackHalf(texel.zw));\n#else\nvec2 moments=texel.xy;\n#endif\n#ifdef OVERLOADEDSHADOWVALUES\nreturn min(1.0,mix(1.0,1.0-ChebychevInequality(moments,depth.z,bias)+darkness,vOverloadedShadowIntensity.x));\n#else\nreturn min(1.0,1.0-ChebychevInequality(moments,depth.z,bias)+darkness);\n#endif\n}\n#endif","pointCloudVertex":"#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif","pointCloudVertexDeclaration":"#ifdef POINTSIZE\nuniform float pointSize;\n#endif","reflectionFunction":"vec3 computeReflectionCoords(vec4 worldPos,vec3 worldNormal)\n{\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED\nvec3 direction=normalize(vDirectionW);\nfloat t=clamp(direction.y*-0.5+0.5,0.,1.0);\nfloat s=atan(direction.z,direction.x)*RECIPROCAL_PI2+0.5;\nreturn vec3(s,t,0);\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR\nvec3 cameraToVertex=normalize(worldPos.xyz-vEyePosition);\nvec3 r=reflect(cameraToVertex,worldNormal);\nfloat t=clamp(r.y*-0.5+0.5,0.,1.0);\nfloat s=atan(r.z,r.x)*RECIPROCAL_PI2+0.5;\nreturn vec3(s,t,0);\n#endif\n#ifdef REFLECTIONMAP_SPHERICAL\nvec3 viewDir=normalize(vec3(view*worldPos));\nvec3 viewNormal=normalize(vec3(view*vec4(worldNormal,0.0)));\nvec3 r=reflect(viewDir,viewNormal);\nr.z=r.z-1.0;\nfloat m=2.0*length(r);\nreturn vec3(r.x/m+0.5,1.0-r.y/m-0.5,0);\n#endif\n#ifdef REFLECTIONMAP_PLANAR\nvec3 viewDir=worldPos.xyz-vEyePosition;\nvec3 coords=normalize(reflect(viewDir,worldNormal));\nreturn vec3(reflectionMatrix*vec4(coords,1));\n#endif\n#ifdef REFLECTIONMAP_CUBIC\nvec3 viewDir=worldPos.xyz-vEyePosition;\nvec3 coords=reflect(viewDir,worldNormal);\n#ifdef INVERTCUBICMAP\ncoords.y=1.0-coords.y;\n#endif\nreturn vec3(reflectionMatrix*vec4(coords,0));\n#endif\n#ifdef REFLECTIONMAP_PROJECTION\nreturn vec3(reflectionMatrix*(view*worldPos));\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nreturn vPositionUVW;\n#endif\n#ifdef REFLECTIONMAP_EXPLICIT\nreturn vec3(0,0,0);\n#endif\n}","shadowsFragmentFunctions":"#ifdef SHADOWS\n#ifndef SHADOWFULLFLOAT\nfloat unpack(vec4 color)\n{\nconst vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);\nreturn dot(color,bit_shift);\n}\n#endif\nuniform vec2 depthValues;\nfloat computeShadowCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,float bias)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth-depthValues.x)/(depthValues.y-depthValues.x);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFULLFLOAT\nfloat shadow=unpack(textureCube(shadowSampler,directionToLight))+bias;\n#else\nfloat shadow=textureCube(shadowSampler,directionToLight).x+bias;\n#endif\nif (depth>shadow)\n{\nreturn darkness;\n}\nreturn 1.0;\n}\nfloat computeShadowWithPCFCube(vec3 lightPosition,samplerCube shadowSampler,float mapSize,float bias,float darkness)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth-depthValues.x)/(depthValues.y-depthValues.x);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\nfloat visibility=1.;\nvec3 poissonDisk[4];\npoissonDisk[0]=vec3(-1.0,1.0,-1.0);\npoissonDisk[1]=vec3(1.0,-1.0,-1.0);\npoissonDisk[2]=vec3(-1.0,-1.0,-1.0);\npoissonDisk[3]=vec3(1.0,-1.0,1.0);\n\nfloat biasedDepth=depth-bias;\n#ifndef SHADOWFULLFLOAT\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize))1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\n#ifndef SHADOWFULLFLOAT\nfloat shadow=unpack(texture2D(shadowSampler,uv))+bias;\n#else\nfloat shadow=texture2D(shadowSampler,uv).x+bias;\n#endif\nif (depth.z>shadow)\n{\nreturn darkness;\n}\nreturn 1.;\n}\nfloat computeShadowWithPCF(vec4 vPositionFromLight,sampler2D shadowSampler,float mapSize,float bias,float darkness)\n{\nvec3 depth=vPositionFromLight.xyz/vPositionFromLight.w;\ndepth=0.5*depth+vec3(0.5);\nvec2 uv=depth.xy;\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nfloat visibility=1.;\nvec2 poissonDisk[4];\npoissonDisk[0]=vec2(-0.94201624,-0.39906216);\npoissonDisk[1]=vec2(0.94558609,-0.76890725);\npoissonDisk[2]=vec2(-0.094184101,-0.92938870);\npoissonDisk[3]=vec2(0.34495938,0.29387760);\n\nfloat biasedDepth=depth.z-bias;\n#ifndef SHADOWFULLFLOAT\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[0]*mapSize))1.0 || uv.y<0. || uv.y>1.0 || depth.z>=1.0)\n{\nreturn 1.0;\n}\nvec4 texel=texture2D(shadowSampler,uv);\n#ifndef SHADOWFULLFLOAT\nvec2 moments=vec2(unpackHalf(texel.xy),unpackHalf(texel.zw));\n#else\nvec2 moments=texel.xy;\n#endif\nreturn min(1.0,1.0-ChebychevInequality(moments,depth.z,bias)+darkness);\n}\n#endif","shadowsVertex":"#ifdef SHADOWS\n#if defined(SPOTLIGHT{X}) || defined(DIRLIGHT{X})\nvPositionFromLight{X}=lightMatrix{X}*worldPos;\n#endif\n#endif","shadowsVertexDeclaration":"#ifdef SHADOWS\n#if defined(SPOTLIGHT{X}) || defined(DIRLIGHT{X})\nuniform mat4 lightMatrix{X};\nvarying vec4 vPositionFromLight{X};\n#endif\n#endif\n"}; +BABYLON.CollisionWorker="var BABYLON;!function(t){var e=function(t,e,o,i){return!(t.x>o.x+i)&&(!(o.x-i>e.x)&&(!(t.y>o.y+i)&&(!(o.y-i>e.y)&&(!(t.z>o.z+i)&&!(o.z-i>e.z)))))},o=function(){var t={root:0,found:!1};return function(e,o,i,s){t.root=0,t.found=!1;var r=o*o-4*e*i;if(r<0)return t;var n=Math.sqrt(r),c=(-o-n)/(2*e),h=(-o+n)/(2*e);if(c>h){var a=h;h=c,c=a}return c>0&&c0&&h=0))},i.prototype._canDoCollision=function(o,i,s,r){var n=t.Vector3.Distance(this.basePointWorld,o),c=Math.max(this.radius.x,this.radius.y,this.radius.z);return!(n>this.velocityWorldLength+c+i)&&!!e(s,r,this.basePointWorld,this.velocityWorldLength+c)},i.prototype._testTriangle=function(e,i,s,r,n,c){var h,a=!1;i||(i=[]),i[e]||(i[e]=new t.Plane(0,0,0,0),i[e].copyFromPoints(s,r,n));var l=i[e];if(c||l.isFrontFacingTo(this.normalizedVelocity,0)){var _=l.signedDistanceTo(this.basePoint),d=t.Vector3.Dot(l.normal,this.velocity);if(0==d){if(Math.abs(_)>=1)return;a=!0,h=0}else{h=(-1-_)/d;var V=(1-_)/d;if(h>V){var u=V;V=h,h=u}if(h>1||V<0)return;h<0&&(h=0),h>1&&(h=1)}this._collisionPoint.copyFromFloats(0,0,0);var P=!1,p=1;if(a||(this.basePoint.subtractToRef(l.normal,this._planeIntersectionPoint),this.velocity.scaleToRef(h,this._tempVector),this._planeIntersectionPoint.addInPlace(this._tempVector),this._checkPointInTriangle(this._planeIntersectionPoint,s,r,n,l.normal)&&(P=!0,p=h,this._collisionPoint.copyFrom(this._planeIntersectionPoint))),!P){var f=this.velocity.lengthSquared(),m=f;this.basePoint.subtractToRef(s,this._tempVector);var T=2*t.Vector3.Dot(this.velocity,this._tempVector),b=this._tempVector.lengthSquared()-1,y=o(m,T,b,p);y.found&&(p=y.root,P=!0,this._collisionPoint.copyFrom(s)),this.basePoint.subtractToRef(r,this._tempVector),T=2*t.Vector3.Dot(this.velocity,this._tempVector),b=this._tempVector.lengthSquared()-1,y=o(m,T,b,p),y.found&&(p=y.root,P=!0,this._collisionPoint.copyFrom(r)),this.basePoint.subtractToRef(n,this._tempVector),T=2*t.Vector3.Dot(this.velocity,this._tempVector),b=this._tempVector.lengthSquared()-1,y=o(m,T,b,p),y.found&&(p=y.root,P=!0,this._collisionPoint.copyFrom(n)),r.subtractToRef(s,this._edge),s.subtractToRef(this.basePoint,this._baseToVertex);var g=this._edge.lengthSquared(),v=t.Vector3.Dot(this._edge,this.velocity),R=t.Vector3.Dot(this._edge,this._baseToVertex);if(m=g*-f+v*v,T=g*(2*t.Vector3.Dot(this.velocity,this._baseToVertex))-2*v*R,b=g*(1-this._baseToVertex.lengthSquared())+R*R,y=o(m,T,b,p),y.found){var D=(v*y.root-R)/g;D>=0&&D<=1&&(p=y.root,P=!0,this._edge.scaleInPlace(D),s.addToRef(this._edge,this._collisionPoint))}n.subtractToRef(r,this._edge),r.subtractToRef(this.basePoint,this._baseToVertex),g=this._edge.lengthSquared(),v=t.Vector3.Dot(this._edge,this.velocity),R=t.Vector3.Dot(this._edge,this._baseToVertex),m=g*-f+v*v,T=g*(2*t.Vector3.Dot(this.velocity,this._baseToVertex))-2*v*R,b=g*(1-this._baseToVertex.lengthSquared())+R*R,y=o(m,T,b,p),y.found&&(D=(v*y.root-R)/g,D>=0&&D<=1&&(p=y.root,P=!0,this._edge.scaleInPlace(D),r.addToRef(this._edge,this._collisionPoint))),s.subtractToRef(n,this._edge),n.subtractToRef(this.basePoint,this._baseToVertex),g=this._edge.lengthSquared(),v=t.Vector3.Dot(this._edge,this.velocity),R=t.Vector3.Dot(this._edge,this._baseToVertex),m=g*-f+v*v,T=g*(2*t.Vector3.Dot(this.velocity,this._baseToVertex))-2*v*R,b=g*(1-this._baseToVertex.lengthSquared())+R*R,y=o(m,T,b,p),y.found&&(D=(v*y.root-R)/g,D>=0&&D<=1&&(p=y.root,P=!0,this._edge.scaleInPlace(D),n.addToRef(this._edge,this._collisionPoint)))}if(P){var x=p*this.velocity.length();(!this.collisionFound||x=i)return void this.finalPosition.copyFrom(o);this.collider._initialize(o,e,t);for(var s,l=this._collisionCache.getMeshes(),n=Object.keys(l),a=n.length,c=0;c1&&!this.checkSubmeshCollision(l)||(this.collideForSubMesh(l,o,t),this.collider.collisionFound&&(this.collider.collidedMesh=e.uniqueId))}},e.prototype.collideForSubMesh=function(e,i,r){if(!r.positionsArray){r.positionsArray=[];for(var t=0,s=r.positions.length;t4)){++r._runningUpdated;var e={updatedMeshes:r._addUpdateMeshesList,updatedGeometries:r._addUpdateGeometriesList,removedGeometries:r._toRemoveGeometryArray,removedMeshes:r._toRemoveMeshesArray},i={payload:e,taskType:o.UPDATE},t=[];for(var s in e.updatedGeometries)e.updatedGeometries.hasOwnProperty(s)&&(t.push(i.payload.updatedGeometries[s].indices.buffer),t.push(i.payload.updatedGeometries[s].normals.buffer),t.push(i.payload.updatedGeometries[s].positions.buffer));r._worker.postMessage(i,t),r._addUpdateMeshesList={},r._addUpdateGeometriesList={},r._toRemoveGeometryArray=[],r._toRemoveMeshesArray=[]}},this._onMessageFromWorker=function(t){var s=t.data;if(s.error!=i.SUCCESS)return void e.Tools.Warn(\"error returned from worker!\");switch(s.taskType){case o.INIT:r._init=!0,r._scene.meshes.forEach(function(e){r.onMeshAdded(e)}),r._scene.getGeometries().forEach(function(e){r.onGeometryAdded(e)});break;case o.UPDATE:r._runningUpdated--;break;case o.COLLIDE:r._runningCollisionTask=!1;var n=s.payload;if(!r._collisionsCallbackArray[n.collisionId])return;r._collisionsCallbackArray[n.collisionId](n.collisionId,e.Vector3.FromArray(n.newPosition),r._scene.getMeshByUniqueID(n.collidedMeshUniqueId)),r._collisionsCallbackArray[n.collisionId]=void 0}},this._collisionsCallbackArray=[],this._init=!1,this._runningUpdated=0,this._runningCollisionTask=!1,this._addUpdateMeshesList={},this._addUpdateGeometriesList={},this._toRemoveGeometryArray=[],this._toRemoveMeshesArray=[]}return t.prototype.getNewPosition=function(e,i,t,r,s,n,a){if(this._init&&!this._collisionsCallbackArray[a]&&!this._collisionsCallbackArray[a+1e5]){e.divideToRef(t.radius,this._scaledPosition),i.divideToRef(t.radius,this._scaledVelocity),this._collisionsCallbackArray[a]=n;var d={collider:{position:this._scaledPosition.asArray(),velocity:this._scaledVelocity.asArray(),radius:t.radius.asArray()},collisionId:a,excludedMeshUniqueId:s?s.uniqueId:null,maximumRetry:r},l={payload:d,taskType:o.COLLIDE};this._worker.postMessage(l)}},t.prototype.init=function(i){this._scene=i,this._scene.registerAfterRender(this._afterRender);var t=e.WorkerIncluded?e.Engine.CodeRepository+\"Collisions/babylon.collisionWorker.js\":URL.createObjectURL(new Blob([e.CollisionWorker],{type:\"application/javascript\"}));this._worker=new Worker(t),this._worker.onmessage=this._onMessageFromWorker;var r={payload:{},taskType:o.INIT};this._worker.postMessage(r)},t.prototype.destroy=function(){this._scene.unregisterAfterRender(this._afterRender),this._worker.terminate()},t.prototype.onMeshAdded=function(e){e.registerAfterWorldMatrixUpdate(this.onMeshUpdated),this.onMeshUpdated(e)},t.prototype.onMeshRemoved=function(e){this._toRemoveMeshesArray.push(e.uniqueId)},t.prototype.onGeometryAdded=function(e){e.onGeometryUpdated=this.onGeometryUpdated,this.onGeometryUpdated(e)},t.prototype.onGeometryDeleted=function(e){this._toRemoveGeometryArray.push(e.id)},t.SerializeMesh=function(o){var i=[];o.subMeshes&&(i=o.subMeshes.map(function(e,o){return{position:o,verticesStart:e.verticesStart,verticesCount:e.verticesCount,indexStart:e.indexStart,indexCount:e.indexCount,hasMaterial:!!e.getMaterial(),sphereCenter:e.getBoundingInfo().boundingSphere.centerWorld.asArray(),sphereRadius:e.getBoundingInfo().boundingSphere.radiusWorld,boxMinimum:e.getBoundingInfo().boundingBox.minimumWorld.asArray(),boxMaximum:e.getBoundingInfo().boundingBox.maximumWorld.asArray()}}));var t=null;return o instanceof e.Mesh?t=o.geometry?o.geometry.id:null:o instanceof e.InstancedMesh&&(t=o.sourceMesh&&o.sourceMesh.geometry?o.sourceMesh.geometry.id:null),{uniqueId:o.uniqueId,id:o.id,name:o.name,geometryId:t,sphereCenter:o.getBoundingInfo().boundingSphere.centerWorld.asArray(),sphereRadius:o.getBoundingInfo().boundingSphere.radiusWorld,boxMinimum:o.getBoundingInfo().boundingBox.minimumWorld.asArray(),boxMaximum:o.getBoundingInfo().boundingBox.maximumWorld.asArray(),worldMatrixFromCache:o.worldMatrixFromCache.asArray(),subMeshes:i,checkCollisions:o.checkCollisions}},t.SerializeGeometry=function(o){return{id:o.id,positions:new Float32Array(o.getVerticesData(e.VertexBuffer.PositionKind)||[]),normals:new Float32Array(o.getVerticesData(e.VertexBuffer.NormalKind)||[]),indices:new Int32Array(o.getIndices()||[])}},t}();e.CollisionCoordinatorWorker=t;var r=function(){function o(){this._scaledPosition=e.Vector3.Zero(),this._scaledVelocity=e.Vector3.Zero(),this._finalPosition=e.Vector3.Zero()}return o.prototype.getNewPosition=function(e,o,i,t,r,s,n){e.divideToRef(i.radius,this._scaledPosition),o.divideToRef(i.radius,this._scaledVelocity),i.collidedMesh=null,i.retry=0,i.initialVelocity=this._scaledVelocity,i.initialPosition=this._scaledPosition,this._collideWithWorld(this._scaledPosition,this._scaledVelocity,i,t,this._finalPosition,r),this._finalPosition.multiplyInPlace(i.radius),s(n,this._finalPosition,i.collidedMesh)},o.prototype.init=function(e){this._scene=e},o.prototype.destroy=function(){},o.prototype.onMeshAdded=function(e){},o.prototype.onMeshUpdated=function(e){},o.prototype.onMeshRemoved=function(e){},o.prototype.onGeometryAdded=function(e){},o.prototype.onGeometryUpdated=function(e){},o.prototype.onGeometryDeleted=function(e){},o.prototype._collideWithWorld=function(o,i,t,r,s,n){void 0===n&&(n=null);var a=10*e.Engine.CollisionsEpsilon;if(t.retry>=r)return void s.copyFrom(o);t._initialize(o,i,a);for(var d=0;d0?1:-1},t.Clamp=function(t,i,n){return void 0===i&&(i=0),void 0===n&&(n=1),Math.min(n,Math.max(i,t))},t}();t.MathTools=i;var n=function(){function n(t,i,n){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),this.r=t,this.g=i,this.b=n}return n.prototype.toString=function(){return\"{R: \"+this.r+\" G:\"+this.g+\" B:\"+this.b+\"}\"},n.prototype.getClassName=function(){return\"Color3\"},n.prototype.getHashCode=function(){var t=this.r||0;return t=397*t^(this.g||0),t=397*t^(this.b||0)},n.prototype.toArray=function(t,i){return void 0===i&&(i=0),t[i]=this.r,t[i+1]=this.g,t[i+2]=this.b,this},n.prototype.toColor4=function(t){return void 0===t&&(t=1),new r(this.r,this.g,this.b,t)},n.prototype.asArray=function(){var t=[];return this.toArray(t,0),t},n.prototype.toLuminance=function(){return.3*this.r+.59*this.g+.11*this.b},n.prototype.multiply=function(t){return new n(this.r*t.r,this.g*t.g,this.b*t.b)},n.prototype.multiplyToRef=function(t,i){return i.r=this.r*t.r,i.g=this.g*t.g,i.b=this.b*t.b,this},n.prototype.equals=function(t){return t&&this.r===t.r&&this.g===t.g&&this.b===t.b},n.prototype.equalsFloats=function(t,i,n){return this.r===t&&this.g===i&&this.b===n},n.prototype.scale=function(t){return new n(this.r*t,this.g*t,this.b*t)},n.prototype.scaleToRef=function(t,i){return i.r=this.r*t,i.g=this.g*t,i.b=this.b*t,this},n.prototype.add=function(t){return new n(this.r+t.r,this.g+t.g,this.b+t.b)},n.prototype.addToRef=function(t,i){return i.r=this.r+t.r,i.g=this.g+t.g,i.b=this.b+t.b,this},n.prototype.subtract=function(t){return new n(this.r-t.r,this.g-t.g,this.b-t.b)},n.prototype.subtractToRef=function(t,i){return i.r=this.r-t.r,i.g=this.g-t.g,i.b=this.b-t.b,this},n.prototype.clone=function(){return new n(this.r,this.g,this.b)},n.prototype.copyFrom=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},n.prototype.copyFromFloats=function(t,i,n){return this.r=t,this.g=i,this.b=n,this},n.prototype.toHexString=function(){var t=255*this.r|0,n=255*this.g|0,r=255*this.b|0;return\"#\"+i.ToHex(t)+i.ToHex(n)+i.ToHex(r)},n.prototype.toLinearSpace=function(){var t=new n;return this.toLinearSpaceToRef(t),t},n.prototype.toLinearSpaceToRef=function(i){return i.r=Math.pow(this.r,t.ToLinearSpace),i.g=Math.pow(this.g,t.ToLinearSpace),i.b=Math.pow(this.b,t.ToLinearSpace),this},n.prototype.toGammaSpace=function(){var t=new n;return this.toGammaSpaceToRef(t),t},n.prototype.toGammaSpaceToRef=function(i){return i.r=Math.pow(this.r,t.ToGammaSpace),i.g=Math.pow(this.g,t.ToGammaSpace),i.b=Math.pow(this.b,t.ToGammaSpace),this},n.FromHexString=function(t){if(\"#\"!==t.substring(0,1)||7!==t.length)return new n(0,0,0);var i=parseInt(t.substring(1,3),16),r=parseInt(t.substring(3,5),16),o=parseInt(t.substring(5,7),16);return n.FromInts(i,r,o)},n.FromArray=function(t,i){return void 0===i&&(i=0),new n(t[i],t[i+1],t[i+2])},n.FromInts=function(t,i,r){return new n(t/255,i/255,r/255)},n.Lerp=function(t,i,r){var o=t.r+(i.r-t.r)*r,e=t.g+(i.g-t.g)*r,s=t.b+(i.b-t.b)*r;return new n(o,e,s)},n.Red=function(){return new n(1,0,0)},n.Green=function(){return new n(0,1,0)},n.Blue=function(){return new n(0,0,1)},n.Black=function(){return new n(0,0,0)},n.White=function(){return new n(1,1,1)},n.Purple=function(){return new n(.5,0,.5)},n.Magenta=function(){return new n(1,0,1)},n.Yellow=function(){return new n(1,1,0)},n.Gray=function(){return new n(.5,.5,.5)},n}();t.Color3=n;var r=function(){function t(t,i,n,r){this.r=t,this.g=i,this.b=n,this.a=r}return t.prototype.addInPlace=function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this.a+=t.a,this},t.prototype.asArray=function(){var t=[];return this.toArray(t,0),t},t.prototype.toArray=function(t,i){return void 0===i&&(i=0),t[i]=this.r,t[i+1]=this.g,t[i+2]=this.b,t[i+3]=this.a,this},t.prototype.add=function(i){return new t(this.r+i.r,this.g+i.g,this.b+i.b,this.a+i.a)},t.prototype.subtract=function(i){return new t(this.r-i.r,this.g-i.g,this.b-i.b,this.a-i.a)},t.prototype.subtractToRef=function(t,i){return i.r=this.r-t.r,i.g=this.g-t.g,i.b=this.b-t.b,i.a=this.a-t.a,this},t.prototype.scale=function(i){return new t(this.r*i,this.g*i,this.b*i,this.a*i)},t.prototype.scaleToRef=function(t,i){return i.r=this.r*t,i.g=this.g*t,i.b=this.b*t,i.a=this.a*t,this},t.prototype.multiply=function(i){return new t(this.r*i.r,this.g*i.g,this.b*i.b,this.a*i.a)},t.prototype.multiplyToRef=function(t,i){return i.r=this.r*t.r,i.g=this.g*t.g,i.b=this.b*t.b,i.a=this.a*t.a,i},t.prototype.toString=function(){return\"{R: \"+this.r+\" G:\"+this.g+\" B:\"+this.b+\" A:\"+this.a+\"}\"},t.prototype.getClassName=function(){return\"Color4\"},t.prototype.getHashCode=function(){var t=this.r||0;return t=397*t^(this.g||0),t=397*t^(this.b||0),t=397*t^(this.a||0)},t.prototype.clone=function(){return new t(this.r,this.g,this.b,this.a)},t.prototype.copyFrom=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.toHexString=function(){var t=255*this.r|0,n=255*this.g|0,r=255*this.b|0,o=255*this.a|0;return\"#\"+i.ToHex(t)+i.ToHex(n)+i.ToHex(r)+i.ToHex(o)},t.FromHexString=function(i){if(\"#\"!==i.substring(0,1)||9!==i.length)return new t(0,0,0,0);var n=parseInt(i.substring(1,3),16),r=parseInt(i.substring(3,5),16),o=parseInt(i.substring(5,7),16),e=parseInt(i.substring(7,9),16);return t.FromInts(n,r,o,e)},t.Lerp=function(i,n,r){var o=new t(0,0,0,0);return t.LerpToRef(i,n,r,o),o},t.LerpToRef=function(t,i,n,r){r.r=t.r+(i.r-t.r)*n,r.g=t.g+(i.g-t.g)*n,r.b=t.b+(i.b-t.b)*n,r.a=t.a+(i.a-t.a)*n},t.FromArray=function(i,n){return void 0===n&&(n=0),new t(i[n],i[n+1],i[n+2],i[n+3])},t.FromInts=function(i,n,r,o){return new t(i/255,n/255,r/255,o/255)},t.CheckColors4=function(t,i){if(t.length===3*i){for(var n=[],r=0;rr.x?r.x:o,o=or.y?r.y:e,e=ei.x?t.x:i.x,o=t.y>i.y?t.y:i.y;return new n(r,o)},n.Transform=function(t,i){var r=n.Zero();return n.TransformToRef(t,i,r),r},n.TransformToRef=function(t,i,n){var r=t.x*i.m[0]+t.y*i.m[4]+i.m[12],o=t.x*i.m[1]+t.y*i.m[5]+i.m[13];n.x=r,n.y=o},n.PointInTriangle=function(t,i,n,r){var o=.5*(-n.y*r.x+i.y*(-n.x+r.x)+i.x*(n.y-r.y)+n.x*r.y),e=o<0?-1:1,s=(i.y*r.x-i.x*r.y+(r.y-i.y)*t.x+(i.x-r.x)*t.y)*e,h=(i.x*n.y-i.y*n.x+(i.y-n.y)*t.x+(n.x-i.x)*t.y)*e;return s>0&&h>0&&s+h<2*o*e},n.Distance=function(t,i){return Math.sqrt(n.DistanceSquared(t,i))},n.DistanceSquared=function(t,i){var n=t.x-i.x,r=t.y-i.y;return n*n+r*r},n.Center=function(t,i){var n=t.add(i);return n.scaleInPlace(.5),n},n.DistanceOfPointFromSegment=function(t,i,r){var o=n.DistanceSquared(i,r);if(0===o)return n.Distance(t,i);var e=r.subtract(i),s=Math.max(0,Math.min(1,n.Dot(t.subtract(i),e)/o)),h=i.add(e.multiplyByFloats(s,s));return n.Distance(t,h)},n}();t.Vector2=o;var e=function(){function n(t,i,n){this.x=t,this.y=i,this.z=n}return n.prototype.toString=function(){return\"{X: \"+this.x+\" Y:\"+this.y+\" Z:\"+this.z+\"}\"},n.prototype.getClassName=function(){return\"Vector3\"},n.prototype.getHashCode=function(){var t=this.x||0;return t=397*t^(this.y||0),t=397*t^(this.z||0)},n.prototype.asArray=function(){var t=[];return this.toArray(t,0),t},n.prototype.toArray=function(t,i){return void 0===i&&(i=0),t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,this},n.prototype.toQuaternion=function(){var t=new a(0,0,0,1),i=Math.cos(.5*(this.x+this.z)),n=Math.sin(.5*(this.x+this.z)),r=Math.cos(.5*(this.z-this.x)),o=Math.sin(.5*(this.z-this.x)),e=Math.cos(.5*this.y),s=Math.sin(.5*this.y);return t.x=r*s,t.y=-o*s,t.z=n*e,t.w=i*e,t},n.prototype.addInPlace=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},n.prototype.add=function(t){return new n(this.x+t.x,this.y+t.y,this.z+t.z)},n.prototype.addToRef=function(t,i){return i.x=this.x+t.x,i.y=this.y+t.y,i.z=this.z+t.z,this},n.prototype.subtractInPlace=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},n.prototype.subtract=function(t){return new n(this.x-t.x,this.y-t.y,this.z-t.z)},n.prototype.subtractToRef=function(t,i){return i.x=this.x-t.x,i.y=this.y-t.y,i.z=this.z-t.z,this},n.prototype.subtractFromFloats=function(t,i,r){return new n(this.x-t,this.y-i,this.z-r)},n.prototype.subtractFromFloatsToRef=function(t,i,n,r){return r.x=this.x-t,r.y=this.y-i,r.z=this.z-n,this},n.prototype.negate=function(){return new n((-this.x),(-this.y),(-this.z))},n.prototype.scaleInPlace=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.prototype.scale=function(t){return new n(this.x*t,this.y*t,this.z*t)},n.prototype.scaleToRef=function(t,i){i.x=this.x*t,i.y=this.y*t,i.z=this.z*t},n.prototype.equals=function(t){return t&&this.x===t.x&&this.y===t.y&&this.z===t.z},n.prototype.equalsWithEpsilon=function(n,r){return void 0===r&&(r=t.Epsilon),n&&i.WithinEpsilon(this.x,n.x,r)&&i.WithinEpsilon(this.y,n.y,r)&&i.WithinEpsilon(this.z,n.z,r)},n.prototype.equalsToFloats=function(t,i,n){return this.x===t&&this.y===i&&this.z===n},n.prototype.multiplyInPlace=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this},n.prototype.multiply=function(t){return new n(this.x*t.x,this.y*t.y,this.z*t.z)},n.prototype.multiplyToRef=function(t,i){return i.x=this.x*t.x,i.y=this.y*t.y,i.z=this.z*t.z,this},n.prototype.multiplyByFloats=function(t,i,r){return new n(this.x*t,this.y*i,this.z*r)},n.prototype.divide=function(t){return new n(this.x/t.x,this.y/t.y,this.z/t.z)},n.prototype.divideToRef=function(t,i){return i.x=this.x/t.x,i.y=this.y/t.y,i.z=this.z/t.z,this},n.prototype.MinimizeInPlace=function(t){return t.xthis.x&&(this.x=t.x),t.y>this.y&&(this.y=t.y),t.z>this.z&&(this.z=t.z),this},n.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},n.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z},n.prototype.normalize=function(){var t=this.length();if(0===t||1===t)return this;var i=1/t;return this.x*=i,this.y*=i,this.z*=i,this},n.prototype.clone=function(){return new n(this.x,this.y,this.z)},n.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},n.prototype.copyFromFloats=function(t,i,n){return this.x=t,this.y=i,this.z=n,this},n.GetClipFactor=function(t,i,r,o){var e=n.Dot(t,r)-o,s=n.Dot(i,r)-o,h=e/(e-s);return h},n.FromArray=function(t,i){return i||(i=0),new n(t[i],t[i+1],t[i+2])},n.FromFloatArray=function(t,i){return i||(i=0),new n(t[i],t[i+1],t[i+2])},n.FromArrayToRef=function(t,i,n){n.x=t[i],n.y=t[i+1],n.z=t[i+2]},n.FromFloatArrayToRef=function(t,i,n){n.x=t[i],n.y=t[i+1],n.z=t[i+2]},n.FromFloatsToRef=function(t,i,n,r){r.x=t,r.y=i,r.z=n},n.Zero=function(){return new n(0,0,0)},n.Up=function(){return new n(0,1,0)},n.Forward=function(){return new n(0,0,1)},n.Right=function(){return new n(1,0,0)},n.Left=function(){return new n((-1),0,0)},n.TransformCoordinates=function(t,i){var r=n.Zero();return n.TransformCoordinatesToRef(t,i,r),r},n.TransformCoordinatesToRef=function(t,i,n){var r=t.x*i.m[0]+t.y*i.m[4]+t.z*i.m[8]+i.m[12],o=t.x*i.m[1]+t.y*i.m[5]+t.z*i.m[9]+i.m[13],e=t.x*i.m[2]+t.y*i.m[6]+t.z*i.m[10]+i.m[14],s=t.x*i.m[3]+t.y*i.m[7]+t.z*i.m[11]+i.m[15];n.x=r/s,n.y=o/s,n.z=e/s},n.TransformCoordinatesFromFloatsToRef=function(t,i,n,r,o){var e=t*r.m[0]+i*r.m[4]+n*r.m[8]+r.m[12],s=t*r.m[1]+i*r.m[5]+n*r.m[9]+r.m[13],h=t*r.m[2]+i*r.m[6]+n*r.m[10]+r.m[14],a=t*r.m[3]+i*r.m[7]+n*r.m[11]+r.m[15];o.x=e/a,o.y=s/a,o.z=h/a},n.TransformNormal=function(t,i){var r=n.Zero();return n.TransformNormalToRef(t,i,r),r},n.TransformNormalToRef=function(t,i,n){var r=t.x*i.m[0]+t.y*i.m[4]+t.z*i.m[8],o=t.x*i.m[1]+t.y*i.m[5]+t.z*i.m[9],e=t.x*i.m[2]+t.y*i.m[6]+t.z*i.m[10];n.x=r,n.y=o,n.z=e},n.TransformNormalFromFloatsToRef=function(t,i,n,r,o){o.x=t*r.m[0]+i*r.m[4]+n*r.m[8],o.y=t*r.m[1]+i*r.m[5]+n*r.m[9],o.z=t*r.m[2]+i*r.m[6]+n*r.m[10]},n.CatmullRom=function(t,i,r,o,e){var s=e*e,h=e*s,a=.5*(2*i.x+(-t.x+r.x)*e+(2*t.x-5*i.x+4*r.x-o.x)*s+(-t.x+3*i.x-3*r.x+o.x)*h),u=.5*(2*i.y+(-t.y+r.y)*e+(2*t.y-5*i.y+4*r.y-o.y)*s+(-t.y+3*i.y-3*r.y+o.y)*h),m=.5*(2*i.z+(-t.z+r.z)*e+(2*t.z-5*i.z+4*r.z-o.z)*s+(-t.z+3*i.z-3*r.z+o.z)*h);return new n(a,u,m)},n.Clamp=function(t,i,r){var o=t.x;o=o>r.x?r.x:o,o=or.y?r.y:e,e=er.z?r.z:s,s=sthis.x&&(this.x=t.x),t.y>this.y&&(this.y=t.y),t.z>this.z&&(this.z=t.z),t.w>this.w&&(this.w=t.w),this},n.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},n.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},n.prototype.normalize=function(){var t=this.length();if(0===t)return this;var i=1/t;return this.x*=i,this.y*=i,this.z*=i,this.w*=i,this},n.prototype.toVector3=function(){return new e(this.x,this.y,this.z)},n.prototype.clone=function(){return new n(this.x,this.y,this.z,this.w)},n.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},n.prototype.copyFromFloats=function(t,i,n,r){return this.x=t,this.y=i,this.z=n,this.w=r,this},n.FromArray=function(t,i){return i||(i=0),new n(t[i],t[i+1],t[i+2],t[i+3])},n.FromArrayToRef=function(t,i,n){n.x=t[i],n.y=t[i+1],n.z=t[i+2],n.w=t[i+3]},n.FromFloatArrayToRef=function(t,i,n){n.x=t[i],n.y=t[i+1],n.z=t[i+2],n.w=t[i+3]},n.FromFloatsToRef=function(t,i,n,r,o){o.x=t,o.y=i,o.z=n,o.w=r},n.Zero=function(){return new n(0,0,0,0)},n.Normalize=function(t){var i=n.Zero();return n.NormalizeToRef(t,i),i},n.NormalizeToRef=function(t,i){i.copyFrom(t),i.normalize()},n.Minimize=function(t,i){var n=t.clone();return n.MinimizeInPlace(i),n},n.Maximize=function(t,i){var n=t.clone();return n.MaximizeInPlace(i),n},n.Distance=function(t,i){return Math.sqrt(n.DistanceSquared(t,i))},n.DistanceSquared=function(t,i){var n=t.x-i.x,r=t.y-i.y,o=t.z-i.z,e=t.w-i.w;return n*n+r*r+o*o+e*e},n.Center=function(t,i){var n=t.add(i);return n.scaleInPlace(.5),n},n}();t.Vector4=s;var h=function(){function t(t,i){this.width=t,this.height=i}return t.prototype.toString=function(){return\"{W: \"+this.width+\", H: \"+this.height+\"}\"},t.prototype.getClassName=function(){return\"Size\"},t.prototype.getHashCode=function(){var t=this.width||0;return t=397*t^(this.height||0)},t.prototype.copyFrom=function(t){this.width=t.width,this.height=t.height},t.prototype.copyFromFloats=function(t,i){this.width=t,this.height=i},t.prototype.multiplyByFloats=function(i,n){return new t(this.width*i,this.height*n)},t.prototype.clone=function(){return new t(this.width,this.height)},t.prototype.equals=function(t){return!!t&&(this.width===t.width&&this.height===t.height)},Object.defineProperty(t.prototype,\"surface\",{get:function(){return this.width*this.height},enumerable:!0,configurable:!0}),t.Zero=function(){return new t(0,0)},t.prototype.add=function(i){var n=new t(this.width+i.width,this.height+i.height);return n},t.prototype.substract=function(i){var n=new t(this.width-i.width,this.height-i.height);return n},t.Lerp=function(i,n,r){var o=i.width+(n.width-i.width)*r,e=i.height+(n.height-i.height)*r;return new t(o,e)},t}();t.Size=h;var a=function(){function t(t,i,n,r){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=1),this.x=t,this.y=i,this.z=n,this.w=r}return t.prototype.toString=function(){return\"{X: \"+this.x+\" Y:\"+this.y+\" Z:\"+this.z+\" W:\"+this.w+\"}\"},t.prototype.getClassName=function(){return\"Quaternion\"},t.prototype.getHashCode=function(){var t=this.x||0;return t=397*t^(this.y||0),t=397*t^(this.z||0),t=397*t^(this.w||0)},t.prototype.asArray=function(){return[this.x,this.y,this.z,this.w]},t.prototype.equals=function(t){return t&&this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},t.prototype.clone=function(){return new t(this.x,this.y,this.z,this.w)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},t.prototype.copyFromFloats=function(t,i,n,r){return this.x=t,this.y=i,this.z=n,this.w=r,this},t.prototype.add=function(i){return new t(this.x+i.x,this.y+i.y,this.z+i.z,this.w+i.w)},t.prototype.subtract=function(i){return new t(this.x-i.x,this.y-i.y,this.z-i.z,this.w-i.w)},t.prototype.scale=function(i){return new t(this.x*i,this.y*i,this.z*i,this.w*i)},t.prototype.multiply=function(i){var n=new t(0,0,0,1);return this.multiplyToRef(i,n),n},t.prototype.multiplyToRef=function(t,i){var n=this.x*t.w+this.y*t.z-this.z*t.y+this.w*t.x,r=-this.x*t.z+this.y*t.w+this.z*t.x+this.w*t.y,o=this.x*t.y-this.y*t.x+this.z*t.w+this.w*t.z,e=-this.x*t.x-this.y*t.y-this.z*t.z+this.w*t.w;return i.copyFromFloats(n,r,o,e),this},t.prototype.multiplyInPlace=function(t){return this.multiplyToRef(t,this),this},t.prototype.conjugateToRef=function(t){return t.copyFromFloats(-this.x,-this.y,-this.z,this.w),this},t.prototype.conjugateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},t.prototype.conjugate=function(){var i=new t((-this.x),(-this.y),(-this.z),this.w);return i},t.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},t.prototype.normalize=function(){var t=1/this.length();return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},t.prototype.toEulerAngles=function(t){void 0===t&&(t=\"YZX\");var i=e.Zero();return this.toEulerAnglesToRef(i,t),i},t.prototype.toEulerAnglesToRef=function(t,i){void 0===i&&(i=\"YZX\");var n=this.z,r=this.x,o=this.y,e=this.w,s=e*e,h=n*n,a=r*r,u=o*o,m=o*n-r*e,y=.4999999;return m<-y?(t.y=2*Math.atan2(o,e),t.x=Math.PI/2,t.z=0):m>y?(t.y=2*Math.atan2(o,e),t.x=-Math.PI/2,t.z=0):(t.z=Math.atan2(2*(r*o+n*e),-h-a+u+s),t.x=Math.asin(-2*(n*o-r*e)),t.y=Math.atan2(2*(n*r+o*e),h-a-u+s)),this},t.prototype.toRotationMatrix=function(t){var i=this.x*this.x,n=this.y*this.y,r=this.z*this.z,o=this.x*this.y,e=this.z*this.w,s=this.z*this.x,h=this.y*this.w,a=this.y*this.z,u=this.x*this.w;return t.m[0]=1-2*(n+r),t.m[1]=2*(o+e),t.m[2]=2*(s-h),t.m[3]=0,t.m[4]=2*(o-e),t.m[5]=1-2*(r+i),t.m[6]=2*(a+u),t.m[7]=0,t.m[8]=2*(s+h),t.m[9]=2*(a-u),t.m[10]=1-2*(n+i),t.m[11]=0,t.m[12]=0,t.m[13]=0,t.m[14]=0,t.m[15]=1,this},t.prototype.fromRotationMatrix=function(i){return t.FromRotationMatrixToRef(i,this),this},t.FromRotationMatrix=function(i){var n=new t;return t.FromRotationMatrixToRef(i,n),n},t.FromRotationMatrixToRef=function(t,i){var n,r=t.m,o=r[0],e=r[4],s=r[8],h=r[1],a=r[5],u=r[9],m=r[2],y=r[6],c=r[10],p=o+a+c;p>0?(n=.5/Math.sqrt(p+1),i.w=.25/n,i.x=(y-u)*n,i.y=(s-m)*n,i.z=(h-e)*n):o>a&&o>c?(n=2*Math.sqrt(1+o-a-c),i.w=(y-u)/n,i.x=.25*n,i.y=(e+h)/n,i.z=(s+m)/n):a>c?(n=2*Math.sqrt(1+a-o-c),i.w=(s-m)/n,i.x=(e+h)/n,i.y=.25*n,i.z=(u+y)/n):(n=2*Math.sqrt(1+c-o-a),i.w=(h-e)/n,i.x=(s+m)/n,i.y=(u+y)/n,i.z=.25*n)},t.Inverse=function(i){return new t((-i.x),(-i.y),(-i.z),i.w)},t.Identity=function(){return new t(0,0,0,1)},t.RotationAxis=function(i,n){return t.RotationAxisToRef(i,n,new t)},t.RotationAxisToRef=function(t,i,n){var r=Math.sin(i/2);return t.normalize(),n.w=Math.cos(i/2),n.x=t.x*r,n.y=t.y*r,n.z=t.z*r,n},t.FromArray=function(i,n){return n||(n=0),new t(i[n],i[n+1],i[n+2],i[n+3])},t.RotationYawPitchRoll=function(i,n,r){var o=new t;return t.RotationYawPitchRollToRef(i,n,r,o),o},t.RotationYawPitchRollToRef=function(t,i,n,r){var o=.5*n,e=.5*i,s=.5*t,h=Math.sin(o),a=Math.cos(o),u=Math.sin(e),m=Math.cos(e),y=Math.sin(s),c=Math.cos(s);r.x=c*u*a+y*m*h,r.y=y*m*a-c*u*h,r.z=c*m*h-y*u*a,r.w=c*m*a+y*u*h},t.RotationAlphaBetaGamma=function(i,n,r){var o=new t;return t.RotationAlphaBetaGammaToRef(i,n,r,o),o},t.RotationAlphaBetaGammaToRef=function(t,i,n,r){var o=.5*(n+t),e=.5*(n-t),s=.5*i;r.x=Math.cos(e)*Math.sin(s),r.y=Math.sin(e)*Math.sin(s),r.z=Math.sin(o)*Math.cos(s),r.w=Math.cos(o)*Math.cos(s)},t.Slerp=function(i,n,r){var o=t.Identity();return t.SlerpToRef(i,n,r,o),o},t.SlerpToRef=function(t,i,n,r){var o,e,s=n,h=t.x*i.x+t.y*i.y+t.z*i.z+t.w*i.w,a=!1;if(h<0&&(a=!0,h=-h),h>.999999)e=1-s,o=a?-s:s;else{var u=Math.acos(h),m=1/Math.sin(u);e=Math.sin((1-s)*u)*m,o=a?-Math.sin(s*u)*m:Math.sin(s*u)*m}r.x=e*t.x+o*i.x,r.y=e*t.y+o*i.y,r.z=e*t.z+o*i.z,r.w=e*t.w+o*i.w},t}();t.Quaternion=a;var u=function(){function t(){this.m=new Float32Array(16)}return t.prototype.isIdentity=function(){return 1===this.m[0]&&1===this.m[5]&&1===this.m[10]&&1===this.m[15]&&(0===this.m[1]&&0===this.m[2]&&0===this.m[3]&&0===this.m[4]&&0===this.m[6]&&0===this.m[7]&&0===this.m[8]&&0===this.m[9]&&0===this.m[11]&&0===this.m[12]&&0===this.m[13]&&0===this.m[14])},t.prototype.determinant=function(){var t=this.m[10]*this.m[15]-this.m[11]*this.m[14],i=this.m[9]*this.m[15]-this.m[11]*this.m[13],n=this.m[9]*this.m[14]-this.m[10]*this.m[13],r=this.m[8]*this.m[15]-this.m[11]*this.m[12],o=this.m[8]*this.m[14]-this.m[10]*this.m[12],e=this.m[8]*this.m[13]-this.m[9]*this.m[12];return this.m[0]*(this.m[5]*t-this.m[6]*i+this.m[7]*n)-this.m[1]*(this.m[4]*t-this.m[6]*r+this.m[7]*o)+this.m[2]*(this.m[4]*i-this.m[5]*r+this.m[7]*e)-this.m[3]*(this.m[4]*n-this.m[5]*o+this.m[6]*e)},t.prototype.toArray=function(){return this.m},t.prototype.asArray=function(){return this.toArray()},t.prototype.invert=function(){return this.invertToRef(this),this},t.prototype.reset=function(){for(var t=0;t<16;t++)this.m[t]=0;return this},t.prototype.add=function(i){var n=new t;return this.addToRef(i,n),n},t.prototype.addToRef=function(t,i){for(var n=0;n<16;n++)i.m[n]=this.m[n]+t.m[n];return this},t.prototype.addToSelf=function(t){for(var i=0;i<16;i++)this.m[i]+=t.m[i];return this},t.prototype.invertToRef=function(t){var i=this.m[0],n=this.m[1],r=this.m[2],o=this.m[3],e=this.m[4],s=this.m[5],h=this.m[6],a=this.m[7],u=this.m[8],m=this.m[9],y=this.m[10],c=this.m[11],p=this.m[12],f=this.m[13],x=this.m[14],l=this.m[15],z=y*l-c*x,w=m*l-c*f,v=m*x-y*f,d=u*l-c*p,g=u*x-y*p,R=u*f-m*p,T=s*z-h*w+a*v,_=-(e*z-h*d+a*g),M=e*w-s*d+a*R,A=-(e*v-s*g+h*R),b=1/(i*T+n*_+r*M+o*A),F=h*l-a*x,L=s*l-a*f,C=s*x-h*f,P=e*l-a*p,Z=e*x-h*p,S=e*f-s*p,I=h*c-a*y,H=s*c-a*m,q=s*y-h*m,D=e*c-a*u,V=e*y-h*u,N=e*m-s*u;return t.m[0]=T*b,t.m[4]=_*b,t.m[8]=M*b,t.m[12]=A*b,t.m[1]=-(n*z-r*w+o*v)*b,t.m[5]=(i*z-r*d+o*g)*b,t.m[9]=-(i*w-n*d+o*R)*b,t.m[13]=(i*v-n*g+r*R)*b,t.m[2]=(n*F-r*L+o*C)*b,t.m[6]=-(i*F-r*P+o*Z)*b,t.m[10]=(i*L-n*P+o*S)*b,t.m[14]=-(i*C-n*Z+r*S)*b,t.m[3]=-(n*I-r*H+o*q)*b,t.m[7]=(i*I-r*D+o*V)*b,t.m[11]=-(i*H-n*D+o*N)*b,t.m[15]=(i*q-n*V+r*N)*b,this},t.prototype.setTranslation=function(t){return this.m[12]=t.x,this.m[13]=t.y,this.m[14]=t.z,this},t.prototype.getTranslation=function(){return new e(this.m[12],this.m[13],this.m[14])},t.prototype.multiply=function(i){var n=new t;return this.multiplyToRef(i,n),n},t.prototype.copyFrom=function(t){for(var i=0;i<16;i++)this.m[i]=t.m[i];return this;\n},t.prototype.copyToArray=function(t,i){void 0===i&&(i=0);for(var n=0;n<16;n++)t[i+n]=this.m[n];return this},t.prototype.multiplyToRef=function(t,i){return this.multiplyToArray(t,i.m,0),this},t.prototype.multiplyToArray=function(t,i,n){var r=this.m[0],o=this.m[1],e=this.m[2],s=this.m[3],h=this.m[4],a=this.m[5],u=this.m[6],m=this.m[7],y=this.m[8],c=this.m[9],p=this.m[10],f=this.m[11],x=this.m[12],l=this.m[13],z=this.m[14],w=this.m[15],v=t.m[0],d=t.m[1],g=t.m[2],R=t.m[3],T=t.m[4],_=t.m[5],M=t.m[6],A=t.m[7],b=t.m[8],F=t.m[9],L=t.m[10],C=t.m[11],P=t.m[12],Z=t.m[13],S=t.m[14],I=t.m[15];return i[n]=r*v+o*T+e*b+s*P,i[n+1]=r*d+o*_+e*F+s*Z,i[n+2]=r*g+o*M+e*L+s*S,i[n+3]=r*R+o*A+e*C+s*I,i[n+4]=h*v+a*T+u*b+m*P,i[n+5]=h*d+a*_+u*F+m*Z,i[n+6]=h*g+a*M+u*L+m*S,i[n+7]=h*R+a*A+u*C+m*I,i[n+8]=y*v+c*T+p*b+f*P,i[n+9]=y*d+c*_+p*F+f*Z,i[n+10]=y*g+c*M+p*L+f*S,i[n+11]=y*R+c*A+p*C+f*I,i[n+12]=x*v+l*T+z*b+w*P,i[n+13]=x*d+l*_+z*F+w*Z,i[n+14]=x*g+l*M+z*L+w*S,i[n+15]=x*R+l*A+z*C+w*I,this},t.prototype.equals=function(t){return t&&this.m[0]===t.m[0]&&this.m[1]===t.m[1]&&this.m[2]===t.m[2]&&this.m[3]===t.m[3]&&this.m[4]===t.m[4]&&this.m[5]===t.m[5]&&this.m[6]===t.m[6]&&this.m[7]===t.m[7]&&this.m[8]===t.m[8]&&this.m[9]===t.m[9]&&this.m[10]===t.m[10]&&this.m[11]===t.m[11]&&this.m[12]===t.m[12]&&this.m[13]===t.m[13]&&this.m[14]===t.m[14]&&this.m[15]===t.m[15]},t.prototype.clone=function(){return t.FromValues(this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5],this.m[6],this.m[7],this.m[8],this.m[9],this.m[10],this.m[11],this.m[12],this.m[13],this.m[14],this.m[15])},t.prototype.getClassName=function(){return\"Matrix\"},t.prototype.getHashCode=function(){for(var t=this.m[0]||0,i=1;i<16;i++)t=397*t^(this.m[i]||0);return t},t.prototype.decompose=function(n,r,o){o.x=this.m[12],o.y=this.m[13],o.z=this.m[14];var e=i.Sign(this.m[0]*this.m[1]*this.m[2]*this.m[3])<0?-1:1,s=i.Sign(this.m[4]*this.m[5]*this.m[6]*this.m[7])<0?-1:1,h=i.Sign(this.m[8]*this.m[9]*this.m[10]*this.m[11])<0?-1:1;return n.x=e*Math.sqrt(this.m[0]*this.m[0]+this.m[1]*this.m[1]+this.m[2]*this.m[2]),n.y=s*Math.sqrt(this.m[4]*this.m[4]+this.m[5]*this.m[5]+this.m[6]*this.m[6]),n.z=h*Math.sqrt(this.m[8]*this.m[8]+this.m[9]*this.m[9]+this.m[10]*this.m[10]),0===n.x||0===n.y||0===n.z?(r.x=0,r.y=0,r.z=0,r.w=1,!1):(t.FromValuesToRef(this.m[0]/n.x,this.m[1]/n.x,this.m[2]/n.x,0,this.m[4]/n.y,this.m[5]/n.y,this.m[6]/n.y,0,this.m[8]/n.z,this.m[9]/n.z,this.m[10]/n.z,0,0,0,0,1,M.Matrix[0]),a.FromRotationMatrixToRef(M.Matrix[0],r),!0)},t.prototype.getRotationMatrix=function(){var i=t.Identity();return this.getRotationMatrixToRef(i),i},t.prototype.getRotationMatrixToRef=function(i){var n=this.m,r=n[0]*n[1]*n[2]*n[3]<0?-1:1,o=n[4]*n[5]*n[6]*n[7]<0?-1:1,e=n[8]*n[9]*n[10]*n[11]<0?-1:1,s=r*Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]),h=o*Math.sqrt(n[4]*n[4]+n[5]*n[5]+n[6]*n[6]),a=e*Math.sqrt(n[8]*n[8]+n[9]*n[9]+n[10]*n[10]);t.FromValuesToRef(n[0]/s,n[1]/s,n[2]/s,0,n[4]/h,n[5]/h,n[6]/h,0,n[8]/a,n[9]/a,n[10]/a,0,0,0,0,1,i)},t.FromArray=function(i,n){var r=new t;return n||(n=0),t.FromArrayToRef(i,n,r),r},t.FromArrayToRef=function(t,i,n){for(var r=0;r<16;r++)n.m[r]=t[r+i]},t.FromFloat32ArrayToRefScaled=function(t,i,n,r){for(var o=0;o<16;o++)r.m[o]=t[o+i]*n},t.FromValuesToRef=function(t,i,n,r,o,e,s,h,a,u,m,y,c,p,f,x,l){l.m[0]=t,l.m[1]=i,l.m[2]=n,l.m[3]=r,l.m[4]=o,l.m[5]=e,l.m[6]=s,l.m[7]=h,l.m[8]=a,l.m[9]=u,l.m[10]=m,l.m[11]=y,l.m[12]=c,l.m[13]=p,l.m[14]=f,l.m[15]=x},t.prototype.getRow=function(t){if(t<0||t>3)return null;var i=4*t;return new s(this.m[i+0],this.m[i+1],this.m[i+2],this.m[i+3])},t.prototype.setRow=function(t,i){if(t<0||t>3)return this;var n=4*t;return this.m[n+0]=i.x,this.m[n+1]=i.y,this.m[n+2]=i.z,this.m[n+3]=i.w,this},t.FromValues=function(i,n,r,o,e,s,h,a,u,m,y,c,p,f,x,l){var z=new t;return z.m[0]=i,z.m[1]=n,z.m[2]=r,z.m[3]=o,z.m[4]=e,z.m[5]=s,z.m[6]=h,z.m[7]=a,z.m[8]=u,z.m[9]=m,z.m[10]=y,z.m[11]=c,z.m[12]=p,z.m[13]=f,z.m[14]=x,z.m[15]=l,z},t.Compose=function(i,n,r){var o=t.FromValues(i.x,0,0,0,0,i.y,0,0,0,0,i.z,0,0,0,0,1),e=t.Identity();return n.toRotationMatrix(e),o=o.multiply(e),o.setTranslation(r),o},t.Identity=function(){return t.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},t.IdentityToRef=function(i){t.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,i)},t.Zero=function(){return t.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},t.RotationX=function(i){var n=new t;return t.RotationXToRef(i,n),n},t.Invert=function(i){var n=new t;return i.invertToRef(n),n},t.RotationXToRef=function(t,i){var n=Math.sin(t),r=Math.cos(t);i.m[0]=1,i.m[15]=1,i.m[5]=r,i.m[10]=r,i.m[9]=-n,i.m[6]=n,i.m[1]=0,i.m[2]=0,i.m[3]=0,i.m[4]=0,i.m[7]=0,i.m[8]=0,i.m[11]=0,i.m[12]=0,i.m[13]=0,i.m[14]=0},t.RotationY=function(i){var n=new t;return t.RotationYToRef(i,n),n},t.RotationYToRef=function(t,i){var n=Math.sin(t),r=Math.cos(t);i.m[5]=1,i.m[15]=1,i.m[0]=r,i.m[2]=-n,i.m[8]=n,i.m[10]=r,i.m[1]=0,i.m[3]=0,i.m[4]=0,i.m[6]=0,i.m[7]=0,i.m[9]=0,i.m[11]=0,i.m[12]=0,i.m[13]=0,i.m[14]=0},t.RotationZ=function(i){var n=new t;return t.RotationZToRef(i,n),n},t.RotationZToRef=function(t,i){var n=Math.sin(t),r=Math.cos(t);i.m[10]=1,i.m[15]=1,i.m[0]=r,i.m[1]=n,i.m[4]=-n,i.m[5]=r,i.m[2]=0,i.m[3]=0,i.m[6]=0,i.m[7]=0,i.m[8]=0,i.m[9]=0,i.m[11]=0,i.m[12]=0,i.m[13]=0,i.m[14]=0},t.RotationAxis=function(i,n){var r=t.Zero();return t.RotationAxisToRef(i,n,r),r},t.RotationAxisToRef=function(t,i,n){var r=Math.sin(-i),o=Math.cos(-i),e=1-o;t.normalize(),n.m[0]=t.x*t.x*e+o,n.m[1]=t.x*t.y*e-t.z*r,n.m[2]=t.x*t.z*e+t.y*r,n.m[3]=0,n.m[4]=t.y*t.x*e+t.z*r,n.m[5]=t.y*t.y*e+o,n.m[6]=t.y*t.z*e-t.x*r,n.m[7]=0,n.m[8]=t.z*t.x*e-t.y*r,n.m[9]=t.z*t.y*e+t.x*r,n.m[10]=t.z*t.z*e+o,n.m[11]=0,n.m[15]=1},t.RotationYawPitchRoll=function(i,n,r){var o=new t;return t.RotationYawPitchRollToRef(i,n,r,o),o},t.RotationYawPitchRollToRef=function(t,i,n,r){a.RotationYawPitchRollToRef(t,i,n,this._tempQuaternion),this._tempQuaternion.toRotationMatrix(r)},t.Scaling=function(i,n,r){var o=t.Zero();return t.ScalingToRef(i,n,r,o),o},t.ScalingToRef=function(t,i,n,r){r.m[0]=t,r.m[1]=0,r.m[2]=0,r.m[3]=0,r.m[4]=0,r.m[5]=i,r.m[6]=0,r.m[7]=0,r.m[8]=0,r.m[9]=0,r.m[10]=n,r.m[11]=0,r.m[12]=0,r.m[13]=0,r.m[14]=0,r.m[15]=1},t.Translation=function(i,n,r){var o=t.Identity();return t.TranslationToRef(i,n,r,o),o},t.TranslationToRef=function(i,n,r,o){t.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,i,n,r,1,o)},t.Lerp=function(i,n,r){for(var o=t.Zero(),e=0;e<16;e++)o.m[e]=i.m[e]*(1-r)+n.m[e]*r;return o},t.DecomposeLerp=function(i,n,r){var o=new e(0,0,0),s=new a,h=new e(0,0,0);i.decompose(o,s,h);var u=new e(0,0,0),m=new a,y=new e(0,0,0);n.decompose(u,m,y);var c=e.Lerp(o,u,r),p=a.Slerp(s,m,r),f=e.Lerp(h,y,r);return t.Compose(c,p,f)},t.LookAtLH=function(i,n,r){var o=t.Zero();return t.LookAtLHToRef(i,n,r,o),o},t.LookAtLHToRef=function(i,n,r,o){n.subtractToRef(i,this._zAxis),this._zAxis.normalize(),e.CrossToRef(r,this._zAxis,this._xAxis),0===this._xAxis.lengthSquared()?this._xAxis.x=1:this._xAxis.normalize(),e.CrossToRef(this._zAxis,this._xAxis,this._yAxis),this._yAxis.normalize();var s=-e.Dot(this._xAxis,i),h=-e.Dot(this._yAxis,i),a=-e.Dot(this._zAxis,i);return t.FromValuesToRef(this._xAxis.x,this._yAxis.x,this._zAxis.x,0,this._xAxis.y,this._yAxis.y,this._zAxis.y,0,this._xAxis.z,this._yAxis.z,this._zAxis.z,0,s,h,a,1,o)},t.LookAtRH=function(i,n,r){var o=t.Zero();return t.LookAtRHToRef(i,n,r,o),o},t.LookAtRHToRef=function(i,n,r,o){i.subtractToRef(n,this._zAxis),this._zAxis.normalize(),e.CrossToRef(r,this._zAxis,this._xAxis),0===this._xAxis.lengthSquared()?this._xAxis.x=1:this._xAxis.normalize(),e.CrossToRef(this._zAxis,this._xAxis,this._yAxis),this._yAxis.normalize();var s=-e.Dot(this._xAxis,i),h=-e.Dot(this._yAxis,i),a=-e.Dot(this._zAxis,i);return t.FromValuesToRef(this._xAxis.x,this._yAxis.x,this._zAxis.x,0,this._xAxis.y,this._yAxis.y,this._zAxis.y,0,this._xAxis.z,this._yAxis.z,this._zAxis.z,0,s,h,a,1,o)},t.OrthoLH=function(i,n,r,o){var e=t.Zero();return t.OrthoLHToRef(i,n,r,o,e),e},t.OrthoLHToRef=function(i,n,r,o,e){var s=2/i,h=2/n,a=1/(o-r),u=r/(r-o);t.FromValuesToRef(s,0,0,0,0,h,0,0,0,0,a,0,0,0,u,1,e)},t.OrthoOffCenterLH=function(i,n,r,o,e,s){var h=t.Zero();return t.OrthoOffCenterLHToRef(i,n,r,o,e,s,h),h},t.OrthoOffCenterLHToRef=function(t,i,n,r,o,e,s){s.m[0]=2/(i-t),s.m[1]=s.m[2]=s.m[3]=0,s.m[5]=2/(r-n),s.m[4]=s.m[6]=s.m[7]=0,s.m[10]=1/(e-o),s.m[8]=s.m[9]=s.m[11]=0,s.m[12]=(t+i)/(t-i),s.m[13]=(r+n)/(n-r),s.m[14]=-o/(e-o),s.m[15]=1},t.OrthoOffCenterRH=function(i,n,r,o,e,s){var h=t.Zero();return t.OrthoOffCenterRHToRef(i,n,r,o,e,s,h),h},t.OrthoOffCenterRHToRef=function(i,n,r,o,e,s,h){t.OrthoOffCenterLHToRef(i,n,r,o,e,s,h),h.m[10]*=-1},t.PerspectiveLH=function(i,n,r,o){var e=t.Zero();return e.m[0]=2*r/i,e.m[1]=e.m[2]=e.m[3]=0,e.m[5]=2*r/n,e.m[4]=e.m[6]=e.m[7]=0,e.m[10]=-o/(r-o),e.m[8]=e.m[9]=0,e.m[11]=1,e.m[12]=e.m[13]=e.m[15]=0,e.m[14]=r*o/(r-o),e},t.PerspectiveFovLH=function(i,n,r,o){var e=t.Zero();return t.PerspectiveFovLHToRef(i,n,r,o,e),e},t.PerspectiveFovLHToRef=function(t,i,n,r,o,e){void 0===e&&(e=!0);var s=1/Math.tan(.5*t);e?o.m[0]=s/i:o.m[0]=s,o.m[1]=o.m[2]=o.m[3]=0,e?o.m[5]=s:o.m[5]=s*i,o.m[4]=o.m[6]=o.m[7]=0,o.m[8]=o.m[9]=0,o.m[10]=r/(r-n),o.m[11]=1,o.m[12]=o.m[13]=o.m[15]=0,o.m[14]=-(n*r)/(r-n)},t.PerspectiveFovRH=function(i,n,r,o){var e=t.Zero();return t.PerspectiveFovRHToRef(i,n,r,o,e),e},t.PerspectiveFovRHToRef=function(t,i,n,r,o,e){void 0===e&&(e=!0);var s=1/Math.tan(.5*t);e?o.m[0]=s/i:o.m[0]=s,o.m[1]=o.m[2]=o.m[3]=0,e?o.m[5]=s:o.m[5]=s*i,o.m[4]=o.m[6]=o.m[7]=0,o.m[8]=o.m[9]=0,o.m[10]=r/(n-r),o.m[11]=-1,o.m[12]=o.m[13]=o.m[15]=0,o.m[14]=n*r/(n-r)},t.PerspectiveFovWebVRToRef=function(t,i,n,r,o){void 0===o&&(o=!0);var e=Math.tan(t.upDegrees*Math.PI/180),s=Math.tan(t.downDegrees*Math.PI/180),h=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),u=2/(h+a),m=2/(e+s);r.m[0]=u,r.m[1]=r.m[2]=r.m[3]=r.m[4]=0,r.m[5]=m,r.m[6]=r.m[7]=0,r.m[8]=(h-a)*u*.5,r.m[9]=-((e-s)*m*.5),r.m[10]=-n/(i-n),r.m[11]=1,r.m[12]=r.m[13]=r.m[15]=0,r.m[14]=i*n/(i-n)},t.GetFinalMatrix=function(i,n,r,o,e,s){var h=i.width,a=i.height,u=i.x,m=i.y,y=t.FromValues(h/2,0,0,0,0,-a/2,0,0,0,0,s-e,0,u+h/2,a/2+m,e,1);return n.multiply(r).multiply(o).multiply(y)},t.GetAsMatrix2x2=function(t){return new Float32Array([t.m[0],t.m[1],t.m[4],t.m[5]])},t.GetAsMatrix3x3=function(t){return new Float32Array([t.m[0],t.m[1],t.m[2],t.m[4],t.m[5],t.m[6],t.m[8],t.m[9],t.m[10]])},t.Transpose=function(i){var n=new t;return n.m[0]=i.m[0],n.m[1]=i.m[4],n.m[2]=i.m[8],n.m[3]=i.m[12],n.m[4]=i.m[1],n.m[5]=i.m[5],n.m[6]=i.m[9],n.m[7]=i.m[13],n.m[8]=i.m[2],n.m[9]=i.m[6],n.m[10]=i.m[10],n.m[11]=i.m[14],n.m[12]=i.m[3],n.m[13]=i.m[7],n.m[14]=i.m[11],n.m[15]=i.m[15],n},t.Reflection=function(i){var n=new t;return t.ReflectionToRef(i,n),n},t.ReflectionToRef=function(t,i){t.normalize();var n=t.normal.x,r=t.normal.y,o=t.normal.z,e=-2*n,s=-2*r,h=-2*o;i.m[0]=e*n+1,i.m[1]=s*n,i.m[2]=h*n,i.m[3]=0,i.m[4]=e*r,i.m[5]=s*r+1,i.m[6]=h*r,i.m[7]=0,i.m[8]=e*o,i.m[9]=s*o,i.m[10]=h*o+1,i.m[11]=0,i.m[12]=e*t.d,i.m[13]=s*t.d,i.m[14]=h*t.d,i.m[15]=1},t.FromXYZAxesToRef=function(t,i,n,r){r.m[0]=t.x,r.m[1]=t.y,r.m[2]=t.z,r.m[3]=0,r.m[4]=i.x,r.m[5]=i.y,r.m[6]=i.z,r.m[7]=0,r.m[8]=n.x,r.m[9]=n.y,r.m[10]=n.z,r.m[11]=0,r.m[12]=0,r.m[13]=0,r.m[14]=0,r.m[15]=1},t.FromQuaternionToRef=function(t,i){var n=t.x*t.x,r=t.y*t.y,o=t.z*t.z,e=t.x*t.y,s=t.z*t.w,h=t.z*t.x,a=t.y*t.w,u=t.y*t.z,m=t.x*t.w;i.m[0]=1-2*(r+o),i.m[1]=2*(e+s),i.m[2]=2*(h-a),i.m[3]=0,i.m[4]=2*(e-s),i.m[5]=1-2*(o+n),i.m[6]=2*(u+m),i.m[7]=0,i.m[8]=2*(h+a),i.m[9]=2*(u-m),i.m[10]=1-2*(r+n),i.m[11]=0,i.m[12]=0,i.m[13]=0,i.m[14]=0,i.m[15]=1},t._tempQuaternion=new a,t._xAxis=e.Zero(),t._yAxis=e.Zero(),t._zAxis=e.Zero(),t}();t.Matrix=u;var m=function(){function t(t,i,n,r){this.normal=new e(t,i,n),this.d=r}return t.prototype.asArray=function(){return[this.normal.x,this.normal.y,this.normal.z,this.d]},t.prototype.clone=function(){return new t(this.normal.x,this.normal.y,this.normal.z,this.d)},t.prototype.getClassName=function(){return\"Plane\"},t.prototype.getHashCode=function(){var t=this.normal.getHashCode();return t=397*t^(this.d||0)},t.prototype.normalize=function(){var t=Math.sqrt(this.normal.x*this.normal.x+this.normal.y*this.normal.y+this.normal.z*this.normal.z),i=0;return 0!==t&&(i=1/t),this.normal.x*=i,this.normal.y*=i,this.normal.z*=i,this.d*=i,this},t.prototype.transform=function(i){var n=u.Transpose(i),r=this.normal.x,o=this.normal.y,e=this.normal.z,s=this.d,h=r*n.m[0]+o*n.m[1]+e*n.m[2]+s*n.m[3],a=r*n.m[4]+o*n.m[5]+e*n.m[6]+s*n.m[7],m=r*n.m[8]+o*n.m[9]+e*n.m[10]+s*n.m[11],y=r*n.m[12]+o*n.m[13]+e*n.m[14]+s*n.m[15];return new t(h,a,m,y)},t.prototype.dotCoordinate=function(t){return this.normal.x*t.x+this.normal.y*t.y+this.normal.z*t.z+this.d},t.prototype.copyFromPoints=function(t,i,n){var r,o=i.x-t.x,e=i.y-t.y,s=i.z-t.z,h=n.x-t.x,a=n.y-t.y,u=n.z-t.z,m=e*u-s*a,y=s*h-o*u,c=o*a-e*h,p=Math.sqrt(m*m+y*y+c*c);return r=0!==p?1/p:0,this.normal.x=m*r,this.normal.y=y*r,this.normal.z=c*r,this.d=-(this.normal.x*t.x+this.normal.y*t.y+this.normal.z*t.z),this},t.prototype.isFrontFacingTo=function(t,i){var n=e.Dot(this.normal,t);return n<=i},t.prototype.signedDistanceTo=function(t){return e.Dot(t,this.normal)+this.d},t.FromArray=function(i){return new t(i[0],i[1],i[2],i[3])},t.FromPoints=function(i,n,r){var o=new t(0,0,0,0);return o.copyFromPoints(i,n,r),o},t.FromPositionAndNormal=function(i,n){var r=new t(0,0,0,0);return n.normalize(),r.normal=n,r.d=-(n.x*i.x+n.y*i.y+n.z*i.z),r},t.SignedDistanceToPlaneFromPositionAndNormal=function(t,i,n){var r=-(i.x*t.x+i.y*t.y+i.z*t.z);return e.Dot(n,i)+r},t}();t.Plane=m;var y=function(){function t(t,i,n,r){this.x=t,this.y=i,this.width=n,this.height=r}return t.prototype.toGlobal=function(i,n){return new t(this.x*i,this.y*n,this.width*i,this.height*n)},t}();t.Viewport=y;var c=function(){function t(){}return t.GetPlanes=function(i){for(var n=[],r=0;r<6;r++)n.push(new m(0,0,0,0));return t.GetPlanesToRef(i,n),n},t.GetPlanesToRef=function(t,i){i[0].normal.x=t.m[3]+t.m[2],i[0].normal.y=t.m[7]+t.m[6],i[0].normal.z=t.m[11]+t.m[10],i[0].d=t.m[15]+t.m[14],i[0].normalize(),i[1].normal.x=t.m[3]-t.m[2],i[1].normal.y=t.m[7]-t.m[6],i[1].normal.z=t.m[11]-t.m[10],i[1].d=t.m[15]-t.m[14],i[1].normalize(),i[2].normal.x=t.m[3]+t.m[0],i[2].normal.y=t.m[7]+t.m[4],i[2].normal.z=t.m[11]+t.m[8],i[2].d=t.m[15]+t.m[12],i[2].normalize(),i[3].normal.x=t.m[3]-t.m[0],i[3].normal.y=t.m[7]-t.m[4],i[3].normal.z=t.m[11]-t.m[8],i[3].d=t.m[15]-t.m[12],i[3].normalize(),i[4].normal.x=t.m[3]-t.m[1],i[4].normal.y=t.m[7]-t.m[5],i[4].normal.z=t.m[11]-t.m[9],i[4].d=t.m[15]-t.m[13],i[4].normalize(),i[5].normal.x=t.m[3]+t.m[1],i[5].normal.y=t.m[7]+t.m[5],i[5].normal.z=t.m[11]+t.m[9],i[5].d=t.m[15]+t.m[13],i[5].normalize()},t}();t.Frustum=c,function(t){t[t.LOCAL=0]=\"LOCAL\",t[t.WORLD=1]=\"WORLD\"}(t.Space||(t.Space={}));var p=(t.Space,function(){function t(){}return t.X=new e(1,0,0),t.Y=new e(0,1,0),t.Z=new e(0,0,1),t}());t.Axis=p;var f=function(){function t(){}return t.interpolate=function(t,i,n,r,o){for(var e=1-3*r+3*i,s=3*r-6*i,h=3*i,a=t,u=0;u<5;u++){var m=a*a,y=m*a,c=e*y+s*m+h*a,p=1/(3*e*m+2*s*a+h);a-=(c-t)*p,a=Math.min(1,Math.max(0,a))}return 3*Math.pow(1-a,2)*a*n+3*(1-a)*Math.pow(a,2)*o+Math.pow(a,3)},t}();t.BezierCurve=f,function(t){t[t.CW=0]=\"CW\",t[t.CCW=1]=\"CCW\"}(t.Orientation||(t.Orientation={}));var x=t.Orientation,l=function(){function t(t){var i=this;this.degrees=function(){return 180*i._radians/Math.PI},this.radians=function(){return i._radians},this._radians=t,this._radians<0&&(this._radians+=2*Math.PI)}return t.BetweenTwoPoints=function(i,n){var r=n.subtract(i),o=Math.atan2(r.y,r.x);return new t(o)},t.FromRadians=function(i){return new t(i)},t.FromDegrees=function(i){return new t(i*Math.PI/180)},t}();t.Angle=l;var z=function(){function t(t,i,n){this.startPoint=t,this.midPoint=i,this.endPoint=n;var r=Math.pow(i.x,2)+Math.pow(i.y,2),e=(Math.pow(t.x,2)+Math.pow(t.y,2)-r)/2,s=(r-Math.pow(n.x,2)-Math.pow(n.y,2))/2,h=(t.x-i.x)*(i.y-n.y)-(i.x-n.x)*(t.y-i.y);this.centerPoint=new o((e*(i.y-n.y)-s*(t.y-i.y))/h,((t.x-i.x)*s-(i.x-n.x)*e)/h),this.radius=this.centerPoint.subtract(this.startPoint).length(),this.startAngle=l.BetweenTwoPoints(this.centerPoint,this.startPoint);var a=this.startAngle.degrees(),u=l.BetweenTwoPoints(this.centerPoint,this.midPoint).degrees(),m=l.BetweenTwoPoints(this.centerPoint,this.endPoint).degrees();u-a>180&&(u-=360),u-a<-180&&(u+=360),m-u>180&&(m-=360),m-u<-180&&(m+=360),this.orientation=u-a<0?x.CW:x.CCW,this.angle=l.FromDegrees(this.orientation===x.CW?a-m:m-a)}return t}();t.Arc2=z;var w=function(){function t(t,i){this._points=new Array,this._length=0,this.closed=!1,this._points.push(new o(t,i))}return t.prototype.addLineTo=function(t,i){if(closed)return this;var n=new o(t,i),r=this._points[this._points.length-1];return this._points.push(n),this._length+=n.subtract(r).length(),this},t.prototype.addArcTo=function(t,i,n,r,e){if(void 0===e&&(e=36),closed)return this;var s=this._points[this._points.length-1],h=new o(t,i),a=new o(n,r),u=new z(s,h,a),m=u.angle.radians()/e;u.orientation===x.CW&&(m*=-1);for(var y=u.startAngle.radians()+m,c=0;c1)return o.Zero();for(var i=t*this.length(),n=0,r=0;r=n&&i<=u){var m=a.normalize(),y=i-n;return new o(s.x+m.x*y,s.y+m.y*y)}n=u}return o.Zero()},t.StartingAt=function(i,n){return new t(i,n)},t}();t.Path2=w;var v=function(){function n(t,i,n){this.path=t,this._curve=new Array,this._distances=new Array,this._tangents=new Array,this._normals=new Array,this._binormals=new Array;for(var r=0;ri+1;)i++,n=this._curve[t].subtract(this._curve[t-i]);return n},n.prototype._normalVector=function(n,r,o){var s,h=r.length();if(0===h&&(h=1),void 0===o||null===o){var a;i.WithinEpsilon(Math.abs(r.y)/h,1,t.Epsilon)?i.WithinEpsilon(Math.abs(r.x)/h,1,t.Epsilon)?i.WithinEpsilon(Math.abs(r.z)/h,1,t.Epsilon)||(a=new e(0,0,1)):a=new e(1,0,0):a=new e(0,(-1),0),s=e.Cross(r,a)}else s=e.Cross(r,o),e.CrossToRef(s,r,s);return s.normalize(),s},n}();t.Path3D=v;var d=function(){function t(t){this._length=0,this._points=t,this._length=this._computeLength(t)}return t.CreateQuadraticBezier=function(i,n,r,o){o=o>2?o:3;for(var s=new Array,h=function(t,i,n,r){var o=(1-t)*(1-t)*i+2*t*(1-t)*n+t*t*r;return o},a=0;a<=o;a++)s.push(new e(h(a/o,i.x,n.x,r.x),h(a/o,i.y,n.y,r.y),h(a/o,i.z,n.z,r.z)));return new t(s)},t.CreateCubicBezier=function(i,n,r,o,s){s=s>3?s:4;for(var h=new Array,a=function(t,i,n,r,o){var e=(1-t)*(1-t)*(1-t)*i+3*t*(1-t)*(1-t)*n+3*t*t*(1-t)*r+t*t*t*o;return e},u=0;u<=s;u++)h.push(new e(a(u/s,i.x,n.x,r.x,o.x),a(u/s,i.y,n.y,r.y,o.y),a(u/s,i.z,n.z,r.z,o.z)));return new t(h)},t.CreateHermiteSpline=function(i,n,r,o,s){for(var h=new Array,a=1/s,u=0;u<=s;u++)h.push(e.Hermite(i,n,r,o,u*a));return new t(h)},t.prototype.getPoints=function(){return this._points},t.prototype.length=function(){return this._length},t.prototype[\"continue\"]=function(i){for(var n=this._points[this._points.length-1],r=this._points.slice(),o=i.getPoints(),e=1;eWebGL.
    ', + 'Find out how to get it here.' + ].join( '\n' ) : [ + 'Your browser does not seem to support WebGL.
    ', + 'Find out how to get it here.' + ].join( '\n' ); + + } + + return element; + + }, + + addGetWebGLMessage: function ( parameters ) { + + var parent, id, element; + + parameters = parameters || {}; + + parent = parameters.parent !== undefined ? parameters.parent : document.body; + id = parameters.id !== undefined ? parameters.id : 'oldie'; + + element = Detector.getWebGLErrorMessage(); + element.id = id; + + parent.appendChild( element ); + + } + +}; + +// browserify support +if ( typeof module === 'object' ) { + + module.exports = Detector; + +} diff --git a/jsartoolkit5/examples/js/third_party/three.js/GLTFLoader.js b/jsartoolkit5/examples/js/third_party/three.js/GLTFLoader.js new file mode 100644 index 0000000..d011eb7 --- /dev/null +++ b/jsartoolkit5/examples/js/third_party/three.js/GLTFLoader.js @@ -0,0 +1,3394 @@ +/** + * @author Rich Tibbett / https://github.com/richtr + * @author mrdoob / http://mrdoob.com/ + * @author Tony Parisi / http://www.tonyparisi.com/ + * @author Takahiro / https://github.com/takahirox + * @author Don McCurdy / https://www.donmccurdy.com + */ + +THREE.GLTFLoader = ( function () { + + function GLTFLoader( manager ) { + + this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager; + this.dracoLoader = null; + + } + + GLTFLoader.prototype = { + + constructor: GLTFLoader, + + crossOrigin: 'anonymous', + + load: function ( url, onLoad, onProgress, onError ) { + + var scope = this; + + var resourcePath; + + if ( this.resourcePath !== undefined ) { + + resourcePath = this.resourcePath; + + } else if ( this.path !== undefined ) { + + resourcePath = this.path; + + } else { + + resourcePath = THREE.LoaderUtils.extractUrlBase( url ); + + } + + // Tells the LoadingManager to track an extra item, which resolves after + // the model is fully loaded. This means the count of items loaded will + // be incorrect, but ensures manager.onLoad() does not fire early. + scope.manager.itemStart( url ); + + var _onError = function ( e ) { + + if ( onError ) { + + onError( e ); + + } else { + + console.error( e ); + + } + + scope.manager.itemError( url ); + scope.manager.itemEnd( url ); + + }; + + var loader = new THREE.FileLoader( scope.manager ); + + loader.setPath( this.path ); + loader.setResponseType( 'arraybuffer' ); + + loader.load( url, function ( data ) { + + try { + + scope.parse( data, resourcePath, function ( gltf ) { + + onLoad( gltf ); + + scope.manager.itemEnd( url ); + + }, _onError ); + + } catch ( e ) { + + _onError( e ); + + } + + }, onProgress, _onError ); + + }, + + setCrossOrigin: function ( value ) { + + this.crossOrigin = value; + return this; + + }, + + setPath: function ( value ) { + + this.path = value; + return this; + + }, + + setResourcePath: function ( value ) { + + this.resourcePath = value; + return this; + + }, + + setDRACOLoader: function ( dracoLoader ) { + + this.dracoLoader = dracoLoader; + return this; + + }, + + parse: function ( data, path, onLoad, onError ) { + + var content; + var extensions = {}; + + if ( typeof data === 'string' ) { + + content = data; + + } else { + + var magic = THREE.LoaderUtils.decodeText( new Uint8Array( data, 0, 4 ) ); + + if ( magic === BINARY_EXTENSION_HEADER_MAGIC ) { + + try { + + extensions[ EXTENSIONS.KHR_BINARY_GLTF ] = new GLTFBinaryExtension( data ); + + } catch ( error ) { + + if ( onError ) onError( error ); + return; + + } + + content = extensions[ EXTENSIONS.KHR_BINARY_GLTF ].content; + + } else { + + content = THREE.LoaderUtils.decodeText( new Uint8Array( data ) ); + + } + + } + + var json = JSON.parse( content ); + + if ( json.asset === undefined || json.asset.version[ 0 ] < 2 ) { + + if ( onError ) onError( new Error( 'THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported. Use LegacyGLTFLoader instead.' ) ); + return; + + } + + if ( json.extensionsUsed ) { + + for ( var i = 0; i < json.extensionsUsed.length; ++ i ) { + + var extensionName = json.extensionsUsed[ i ]; + var extensionsRequired = json.extensionsRequired || []; + + switch ( extensionName ) { + + case EXTENSIONS.KHR_LIGHTS_PUNCTUAL: + extensions[ extensionName ] = new GLTFLightsExtension( json ); + break; + + case EXTENSIONS.KHR_MATERIALS_UNLIT: + extensions[ extensionName ] = new GLTFMaterialsUnlitExtension( json ); + break; + + case EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: + extensions[ extensionName ] = new GLTFMaterialsPbrSpecularGlossinessExtension( json ); + break; + + case EXTENSIONS.KHR_DRACO_MESH_COMPRESSION: + extensions[ extensionName ] = new GLTFDracoMeshCompressionExtension( json, this.dracoLoader ); + break; + + case EXTENSIONS.MSFT_TEXTURE_DDS: + extensions[ EXTENSIONS.MSFT_TEXTURE_DDS ] = new GLTFTextureDDSExtension( json ); + break; + + case EXTENSIONS.KHR_TEXTURE_TRANSFORM: + extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] = new GLTFTextureTransformExtension( json ); + break; + + default: + + if ( extensionsRequired.indexOf( extensionName ) >= 0 ) { + + console.warn( 'THREE.GLTFLoader: Unknown extension "' + extensionName + '".' ); + + } + + } + + } + + } + + var parser = new GLTFParser( json, extensions, { + + path: path || this.resourcePath || '', + crossOrigin: this.crossOrigin, + manager: this.manager + + } ); + + parser.parse( function ( scene, scenes, cameras, animations, json ) { + + var glTF = { + scene: scene, + scenes: scenes, + cameras: cameras, + animations: animations, + asset: json.asset, + parser: parser, + userData: {} + }; + + addUnknownExtensionsToUserData( extensions, glTF, json ); + + onLoad( glTF ); + + }, onError ); + + } + + }; + + /* GLTFREGISTRY */ + + function GLTFRegistry() { + + var objects = {}; + + return { + + get: function ( key ) { + + return objects[ key ]; + + }, + + add: function ( key, object ) { + + objects[ key ] = object; + + }, + + remove: function ( key ) { + + delete objects[ key ]; + + }, + + removeAll: function () { + + objects = {}; + + } + + }; + + } + + /*********************************/ + /********** EXTENSIONS ***********/ + /*********************************/ + + var EXTENSIONS = { + KHR_BINARY_GLTF: 'KHR_binary_glTF', + KHR_DRACO_MESH_COMPRESSION: 'KHR_draco_mesh_compression', + KHR_LIGHTS_PUNCTUAL: 'KHR_lights_punctual', + KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: 'KHR_materials_pbrSpecularGlossiness', + KHR_MATERIALS_UNLIT: 'KHR_materials_unlit', + KHR_TEXTURE_TRANSFORM: 'KHR_texture_transform', + MSFT_TEXTURE_DDS: 'MSFT_texture_dds' + }; + + /** + * DDS Texture Extension + * + * Specification: + * https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_texture_dds + * + */ + function GLTFTextureDDSExtension() { + + if ( ! THREE.DDSLoader ) { + + throw new Error( 'THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader' ); + + } + + this.name = EXTENSIONS.MSFT_TEXTURE_DDS; + this.ddsLoader = new THREE.DDSLoader(); + + } + + /** + * Lights Extension + * + * Specification: PENDING + */ + function GLTFLightsExtension( json ) { + + this.name = EXTENSIONS.KHR_LIGHTS_PUNCTUAL; + + var extension = ( json.extensions && json.extensions[ EXTENSIONS.KHR_LIGHTS_PUNCTUAL ] ) || {}; + this.lightDefs = extension.lights || []; + + } + + GLTFLightsExtension.prototype.loadLight = function ( lightIndex ) { + + var lightDef = this.lightDefs[ lightIndex ]; + var lightNode; + + var color = new THREE.Color( 0xffffff ); + if ( lightDef.color !== undefined ) color.fromArray( lightDef.color ); + + var range = lightDef.range !== undefined ? lightDef.range : 0; + + switch ( lightDef.type ) { + + case 'directional': + lightNode = new THREE.DirectionalLight( color ); + lightNode.target.position.set( 0, 0, -1 ); + lightNode.add( lightNode.target ); + break; + + case 'point': + lightNode = new THREE.PointLight( color ); + lightNode.distance = range; + break; + + case 'spot': + lightNode = new THREE.SpotLight( color ); + lightNode.distance = range; + // Handle spotlight properties. + lightDef.spot = lightDef.spot || {}; + lightDef.spot.innerConeAngle = lightDef.spot.innerConeAngle !== undefined ? lightDef.spot.innerConeAngle : 0; + lightDef.spot.outerConeAngle = lightDef.spot.outerConeAngle !== undefined ? lightDef.spot.outerConeAngle : Math.PI / 4.0; + lightNode.angle = lightDef.spot.outerConeAngle; + lightNode.penumbra = 1.0 - lightDef.spot.innerConeAngle / lightDef.spot.outerConeAngle; + lightNode.target.position.set( 0, 0, -1 ); + lightNode.add( lightNode.target ); + break; + + default: + throw new Error( 'THREE.GLTFLoader: Unexpected light type, "' + lightDef.type + '".' ); + + } + + lightNode.decay = 2; + + if ( lightDef.intensity !== undefined ) lightNode.intensity = lightDef.intensity; + + lightNode.name = lightDef.name || ( 'light_' + lightIndex ); + + return Promise.resolve( lightNode ); + + }; + + /** + * Unlit Materials Extension (pending) + * + * PR: https://github.com/KhronosGroup/glTF/pull/1163 + */ + function GLTFMaterialsUnlitExtension( json ) { + + this.name = EXTENSIONS.KHR_MATERIALS_UNLIT; + + } + + GLTFMaterialsUnlitExtension.prototype.getMaterialType = function ( material ) { + + return THREE.MeshBasicMaterial; + + }; + + GLTFMaterialsUnlitExtension.prototype.extendParams = function ( materialParams, material, parser ) { + + var pending = []; + + materialParams.color = new THREE.Color( 1.0, 1.0, 1.0 ); + materialParams.opacity = 1.0; + + var metallicRoughness = material.pbrMetallicRoughness; + + if ( metallicRoughness ) { + + if ( Array.isArray( metallicRoughness.baseColorFactor ) ) { + + var array = metallicRoughness.baseColorFactor; + + materialParams.color.fromArray( array ); + materialParams.opacity = array[ 3 ]; + + } + + if ( metallicRoughness.baseColorTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'map', metallicRoughness.baseColorTexture ) ); + + } + + } + + return Promise.all( pending ); + + }; + + /* BINARY EXTENSION */ + + var BINARY_EXTENSION_BUFFER_NAME = 'binary_glTF'; + var BINARY_EXTENSION_HEADER_MAGIC = 'glTF'; + var BINARY_EXTENSION_HEADER_LENGTH = 12; + var BINARY_EXTENSION_CHUNK_TYPES = { JSON: 0x4E4F534A, BIN: 0x004E4942 }; + + function GLTFBinaryExtension( data ) { + + this.name = EXTENSIONS.KHR_BINARY_GLTF; + this.content = null; + this.body = null; + + var headerView = new DataView( data, 0, BINARY_EXTENSION_HEADER_LENGTH ); + + this.header = { + magic: THREE.LoaderUtils.decodeText( new Uint8Array( data.slice( 0, 4 ) ) ), + version: headerView.getUint32( 4, true ), + length: headerView.getUint32( 8, true ) + }; + + if ( this.header.magic !== BINARY_EXTENSION_HEADER_MAGIC ) { + + throw new Error( 'THREE.GLTFLoader: Unsupported glTF-Binary header.' ); + + } else if ( this.header.version < 2.0 ) { + + throw new Error( 'THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.' ); + + } + + var chunkView = new DataView( data, BINARY_EXTENSION_HEADER_LENGTH ); + var chunkIndex = 0; + + while ( chunkIndex < chunkView.byteLength ) { + + var chunkLength = chunkView.getUint32( chunkIndex, true ); + chunkIndex += 4; + + var chunkType = chunkView.getUint32( chunkIndex, true ); + chunkIndex += 4; + + if ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.JSON ) { + + var contentArray = new Uint8Array( data, BINARY_EXTENSION_HEADER_LENGTH + chunkIndex, chunkLength ); + this.content = THREE.LoaderUtils.decodeText( contentArray ); + + } else if ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.BIN ) { + + var byteOffset = BINARY_EXTENSION_HEADER_LENGTH + chunkIndex; + this.body = data.slice( byteOffset, byteOffset + chunkLength ); + + } + + // Clients must ignore chunks with unknown types. + + chunkIndex += chunkLength; + + } + + if ( this.content === null ) { + + throw new Error( 'THREE.GLTFLoader: JSON content not found.' ); + + } + + } + + /** + * DRACO Mesh Compression Extension + * + * Specification: https://github.com/KhronosGroup/glTF/pull/874 + */ + function GLTFDracoMeshCompressionExtension( json, dracoLoader ) { + + if ( ! dracoLoader ) { + + throw new Error( 'THREE.GLTFLoader: No DRACOLoader instance provided.' ); + + } + + this.name = EXTENSIONS.KHR_DRACO_MESH_COMPRESSION; + this.json = json; + this.dracoLoader = dracoLoader; + THREE.DRACOLoader.getDecoderModule(); + + } + + GLTFDracoMeshCompressionExtension.prototype.decodePrimitive = function ( primitive, parser ) { + + var json = this.json; + var dracoLoader = this.dracoLoader; + var bufferViewIndex = primitive.extensions[ this.name ].bufferView; + var gltfAttributeMap = primitive.extensions[ this.name ].attributes; + var threeAttributeMap = {}; + var attributeNormalizedMap = {}; + var attributeTypeMap = {}; + + for ( var attributeName in gltfAttributeMap ) { + + if ( ! ( attributeName in ATTRIBUTES ) ) continue; + + threeAttributeMap[ ATTRIBUTES[ attributeName ] ] = gltfAttributeMap[ attributeName ]; + + } + + for ( attributeName in primitive.attributes ) { + + if ( ATTRIBUTES[ attributeName ] !== undefined && gltfAttributeMap[ attributeName ] !== undefined ) { + + var accessorDef = json.accessors[ primitive.attributes[ attributeName ] ]; + var componentType = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ]; + + attributeTypeMap[ ATTRIBUTES[ attributeName ] ] = componentType; + attributeNormalizedMap[ ATTRIBUTES[ attributeName ] ] = accessorDef.normalized === true; + + } + + } + + return parser.getDependency( 'bufferView', bufferViewIndex ).then( function ( bufferView ) { + + return new Promise( function ( resolve ) { + + dracoLoader.decodeDracoFile( bufferView, function ( geometry ) { + + for ( var attributeName in geometry.attributes ) { + + var attribute = geometry.attributes[ attributeName ]; + var normalized = attributeNormalizedMap[ attributeName ]; + + if ( normalized !== undefined ) attribute.normalized = normalized; + + } + + resolve( geometry ); + + }, threeAttributeMap, attributeTypeMap ); + + } ); + + } ); + + }; + + /** + * Texture Transform Extension + * + * Specification: + */ + function GLTFTextureTransformExtension( json ) { + + this.name = EXTENSIONS.KHR_TEXTURE_TRANSFORM; + + } + + GLTFTextureTransformExtension.prototype.extendTexture = function ( texture, transform ) { + + texture = texture.clone(); + + if ( transform.offset !== undefined ) { + + texture.offset.fromArray( transform.offset ); + + } + + if ( transform.rotation !== undefined ) { + + texture.rotation = transform.rotation; + + } + + if ( transform.scale !== undefined ) { + + texture.repeat.fromArray( transform.scale ); + + } + + if ( transform.texCoord !== undefined ) { + + console.warn( 'THREE.GLTFLoader: Custom UV sets in "' + this.name + '" extension not yet supported.' ); + + } + + texture.needsUpdate = true; + + return texture; + + }; + + /** + * Specular-Glossiness Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness + */ + function GLTFMaterialsPbrSpecularGlossinessExtension() { + + return { + + name: EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS, + + specularGlossinessParams: [ + 'color', + 'map', + 'lightMap', + 'lightMapIntensity', + 'aoMap', + 'aoMapIntensity', + 'emissive', + 'emissiveIntensity', + 'emissiveMap', + 'bumpMap', + 'bumpScale', + 'normalMap', + 'displacementMap', + 'displacementScale', + 'displacementBias', + 'specularMap', + 'specular', + 'glossinessMap', + 'glossiness', + 'alphaMap', + 'envMap', + 'envMapIntensity', + 'refractionRatio', + ], + + getMaterialType: function () { + + return THREE.ShaderMaterial; + + }, + + extendParams: function ( params, material, parser ) { + + var pbrSpecularGlossiness = material.extensions[ this.name ]; + + var shader = THREE.ShaderLib[ 'standard' ]; + + var uniforms = THREE.UniformsUtils.clone( shader.uniforms ); + + var specularMapParsFragmentChunk = [ + '#ifdef USE_SPECULARMAP', + ' uniform sampler2D specularMap;', + '#endif' + ].join( '\n' ); + + var glossinessMapParsFragmentChunk = [ + '#ifdef USE_GLOSSINESSMAP', + ' uniform sampler2D glossinessMap;', + '#endif' + ].join( '\n' ); + + var specularMapFragmentChunk = [ + 'vec3 specularFactor = specular;', + '#ifdef USE_SPECULARMAP', + ' vec4 texelSpecular = texture2D( specularMap, vUv );', + ' texelSpecular = sRGBToLinear( texelSpecular );', + ' // reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture', + ' specularFactor *= texelSpecular.rgb;', + '#endif' + ].join( '\n' ); + + var glossinessMapFragmentChunk = [ + 'float glossinessFactor = glossiness;', + '#ifdef USE_GLOSSINESSMAP', + ' vec4 texelGlossiness = texture2D( glossinessMap, vUv );', + ' // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture', + ' glossinessFactor *= texelGlossiness.a;', + '#endif' + ].join( '\n' ); + + var lightPhysicalFragmentChunk = [ + 'PhysicalMaterial material;', + 'material.diffuseColor = diffuseColor.rgb;', + 'material.specularRoughness = clamp( 1.0 - glossinessFactor, 0.04, 1.0 );', + 'material.specularColor = specularFactor.rgb;', + ].join( '\n' ); + + var fragmentShader = shader.fragmentShader + .replace( 'uniform float roughness;', 'uniform vec3 specular;' ) + .replace( 'uniform float metalness;', 'uniform float glossiness;' ) + .replace( '#include ', specularMapParsFragmentChunk ) + .replace( '#include ', glossinessMapParsFragmentChunk ) + .replace( '#include ', specularMapFragmentChunk ) + .replace( '#include ', glossinessMapFragmentChunk ) + .replace( '#include ', lightPhysicalFragmentChunk ); + + delete uniforms.roughness; + delete uniforms.metalness; + delete uniforms.roughnessMap; + delete uniforms.metalnessMap; + + uniforms.specular = { value: new THREE.Color().setHex( 0x111111 ) }; + uniforms.glossiness = { value: 0.5 }; + uniforms.specularMap = { value: null }; + uniforms.glossinessMap = { value: null }; + + params.vertexShader = shader.vertexShader; + params.fragmentShader = fragmentShader; + params.uniforms = uniforms; + params.defines = { 'STANDARD': '' }; + + params.color = new THREE.Color( 1.0, 1.0, 1.0 ); + params.opacity = 1.0; + + var pending = []; + + if ( Array.isArray( pbrSpecularGlossiness.diffuseFactor ) ) { + + var array = pbrSpecularGlossiness.diffuseFactor; + + params.color.fromArray( array ); + params.opacity = array[ 3 ]; + + } + + if ( pbrSpecularGlossiness.diffuseTexture !== undefined ) { + + pending.push( parser.assignTexture( params, 'map', pbrSpecularGlossiness.diffuseTexture ) ); + + } + + params.emissive = new THREE.Color( 0.0, 0.0, 0.0 ); + params.glossiness = pbrSpecularGlossiness.glossinessFactor !== undefined ? pbrSpecularGlossiness.glossinessFactor : 1.0; + params.specular = new THREE.Color( 1.0, 1.0, 1.0 ); + + if ( Array.isArray( pbrSpecularGlossiness.specularFactor ) ) { + + params.specular.fromArray( pbrSpecularGlossiness.specularFactor ); + + } + + if ( pbrSpecularGlossiness.specularGlossinessTexture !== undefined ) { + + var specGlossMapDef = pbrSpecularGlossiness.specularGlossinessTexture; + pending.push( parser.assignTexture( params, 'glossinessMap', specGlossMapDef ) ); + pending.push( parser.assignTexture( params, 'specularMap', specGlossMapDef ) ); + + } + + return Promise.all( pending ); + + }, + + createMaterial: function ( params ) { + + // setup material properties based on MeshStandardMaterial for Specular-Glossiness + + var material = new THREE.ShaderMaterial( { + defines: params.defines, + vertexShader: params.vertexShader, + fragmentShader: params.fragmentShader, + uniforms: params.uniforms, + fog: true, + lights: true, + opacity: params.opacity, + transparent: params.transparent + } ); + + material.isGLTFSpecularGlossinessMaterial = true; + + material.color = params.color; + + material.map = params.map === undefined ? null : params.map; + + material.lightMap = null; + material.lightMapIntensity = 1.0; + + material.aoMap = params.aoMap === undefined ? null : params.aoMap; + material.aoMapIntensity = 1.0; + + material.emissive = params.emissive; + material.emissiveIntensity = 1.0; + material.emissiveMap = params.emissiveMap === undefined ? null : params.emissiveMap; + + material.bumpMap = params.bumpMap === undefined ? null : params.bumpMap; + material.bumpScale = 1; + + material.normalMap = params.normalMap === undefined ? null : params.normalMap; + if ( params.normalScale ) material.normalScale = params.normalScale; + + material.displacementMap = null; + material.displacementScale = 1; + material.displacementBias = 0; + + material.specularMap = params.specularMap === undefined ? null : params.specularMap; + material.specular = params.specular; + + material.glossinessMap = params.glossinessMap === undefined ? null : params.glossinessMap; + material.glossiness = params.glossiness; + + material.alphaMap = null; + + material.envMap = params.envMap === undefined ? null : params.envMap; + material.envMapIntensity = 1.0; + + material.refractionRatio = 0.98; + + material.extensions.derivatives = true; + + return material; + + }, + + /** + * Clones a GLTFSpecularGlossinessMaterial instance. The ShaderMaterial.copy() method can + * copy only properties it knows about or inherits, and misses many properties that would + * normally be defined by MeshStandardMaterial. + * + * This method allows GLTFSpecularGlossinessMaterials to be cloned in the process of + * loading a glTF model, but cloning later (e.g. by the user) would require these changes + * AND also updating `.onBeforeRender` on the parent mesh. + * + * @param {THREE.ShaderMaterial} source + * @return {THREE.ShaderMaterial} + */ + cloneMaterial: function ( source ) { + + var target = source.clone(); + + target.isGLTFSpecularGlossinessMaterial = true; + + var params = this.specularGlossinessParams; + + for ( var i = 0, il = params.length; i < il; i ++ ) { + + target[ params[ i ] ] = source[ params[ i ] ]; + + } + + return target; + + }, + + // Here's based on refreshUniformsCommon() and refreshUniformsStandard() in WebGLRenderer. + refreshUniforms: function ( renderer, scene, camera, geometry, material, group ) { + + if ( material.isGLTFSpecularGlossinessMaterial !== true ) { + + return; + + } + + var uniforms = material.uniforms; + var defines = material.defines; + + uniforms.opacity.value = material.opacity; + + uniforms.diffuse.value.copy( material.color ); + uniforms.emissive.value.copy( material.emissive ).multiplyScalar( material.emissiveIntensity ); + + uniforms.map.value = material.map; + uniforms.specularMap.value = material.specularMap; + uniforms.alphaMap.value = material.alphaMap; + + uniforms.lightMap.value = material.lightMap; + uniforms.lightMapIntensity.value = material.lightMapIntensity; + + uniforms.aoMap.value = material.aoMap; + uniforms.aoMapIntensity.value = material.aoMapIntensity; + + // uv repeat and offset setting priorities + // 1. color map + // 2. specular map + // 3. normal map + // 4. bump map + // 5. alpha map + // 6. emissive map + + var uvScaleMap; + + if ( material.map ) { + + uvScaleMap = material.map; + + } else if ( material.specularMap ) { + + uvScaleMap = material.specularMap; + + } else if ( material.displacementMap ) { + + uvScaleMap = material.displacementMap; + + } else if ( material.normalMap ) { + + uvScaleMap = material.normalMap; + + } else if ( material.bumpMap ) { + + uvScaleMap = material.bumpMap; + + } else if ( material.glossinessMap ) { + + uvScaleMap = material.glossinessMap; + + } else if ( material.alphaMap ) { + + uvScaleMap = material.alphaMap; + + } else if ( material.emissiveMap ) { + + uvScaleMap = material.emissiveMap; + + } + + if ( uvScaleMap !== undefined ) { + + // backwards compatibility + if ( uvScaleMap.isWebGLRenderTarget ) { + + uvScaleMap = uvScaleMap.texture; + + } + + if ( uvScaleMap.matrixAutoUpdate === true ) { + + uvScaleMap.updateMatrix(); + + } + + uniforms.uvTransform.value.copy( uvScaleMap.matrix ); + + } + + if ( material.envMap ) { + + uniforms.envMap.value = material.envMap; + uniforms.envMapIntensity.value = material.envMapIntensity; + + // don't flip CubeTexture envMaps, flip everything else: + // WebGLRenderTargetCube will be flipped for backwards compatibility + // WebGLRenderTargetCube.texture will be flipped because it's a Texture and NOT a CubeTexture + // this check must be handled differently, or removed entirely, if WebGLRenderTargetCube uses a CubeTexture in the future + uniforms.flipEnvMap.value = material.envMap.isCubeTexture ? - 1 : 1; + + uniforms.reflectivity.value = material.reflectivity; + uniforms.refractionRatio.value = material.refractionRatio; + + uniforms.maxMipLevel.value = renderer.properties.get( material.envMap ).__maxMipLevel; + } + + uniforms.specular.value.copy( material.specular ); + uniforms.glossiness.value = material.glossiness; + + uniforms.glossinessMap.value = material.glossinessMap; + + uniforms.emissiveMap.value = material.emissiveMap; + uniforms.bumpMap.value = material.bumpMap; + uniforms.normalMap.value = material.normalMap; + + uniforms.displacementMap.value = material.displacementMap; + uniforms.displacementScale.value = material.displacementScale; + uniforms.displacementBias.value = material.displacementBias; + + if ( uniforms.glossinessMap.value !== null && defines.USE_GLOSSINESSMAP === undefined ) { + + defines.USE_GLOSSINESSMAP = ''; + // set USE_ROUGHNESSMAP to enable vUv + defines.USE_ROUGHNESSMAP = ''; + + } + + if ( uniforms.glossinessMap.value === null && defines.USE_GLOSSINESSMAP !== undefined ) { + + delete defines.USE_GLOSSINESSMAP; + delete defines.USE_ROUGHNESSMAP; + + } + + } + + }; + + } + + /*********************************/ + /********** INTERPOLATION ********/ + /*********************************/ + + // Spline Interpolation + // Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#appendix-c-spline-interpolation + function GLTFCubicSplineInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) { + + THREE.Interpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer ); + + } + + GLTFCubicSplineInterpolant.prototype = Object.create( THREE.Interpolant.prototype ); + GLTFCubicSplineInterpolant.prototype.constructor = GLTFCubicSplineInterpolant; + + GLTFCubicSplineInterpolant.prototype.copySampleValue_ = function ( index ) { + + // Copies a sample value to the result buffer. See description of glTF + // CUBICSPLINE values layout in interpolate_() function below. + + var result = this.resultBuffer, + values = this.sampleValues, + valueSize = this.valueSize, + offset = index * valueSize * 3 + valueSize; + + for ( var i = 0; i !== valueSize; i ++ ) { + + result[ i ] = values[ offset + i ]; + + } + + return result; + + }; + + GLTFCubicSplineInterpolant.prototype.beforeStart_ = GLTFCubicSplineInterpolant.prototype.copySampleValue_; + + GLTFCubicSplineInterpolant.prototype.afterEnd_ = GLTFCubicSplineInterpolant.prototype.copySampleValue_; + + GLTFCubicSplineInterpolant.prototype.interpolate_ = function ( i1, t0, t, t1 ) { + + var result = this.resultBuffer; + var values = this.sampleValues; + var stride = this.valueSize; + + var stride2 = stride * 2; + var stride3 = stride * 3; + + var td = t1 - t0; + + var p = ( t - t0 ) / td; + var pp = p * p; + var ppp = pp * p; + + var offset1 = i1 * stride3; + var offset0 = offset1 - stride3; + + var s2 = - 2 * ppp + 3 * pp; + var s3 = ppp - pp; + var s0 = 1 - s2; + var s1 = s3 - pp + p; + + // Layout of keyframe output values for CUBICSPLINE animations: + // [ inTangent_1, splineVertex_1, outTangent_1, inTangent_2, splineVertex_2, ... ] + for ( var i = 0; i !== stride; i ++ ) { + + var p0 = values[ offset0 + i + stride ]; // splineVertex_k + var m0 = values[ offset0 + i + stride2 ] * td; // outTangent_k * (t_k+1 - t_k) + var p1 = values[ offset1 + i + stride ]; // splineVertex_k+1 + var m1 = values[ offset1 + i ] * td; // inTangent_k+1 * (t_k+1 - t_k) + + result[ i ] = s0 * p0 + s1 * m0 + s2 * p1 + s3 * m1; + + } + + return result; + + }; + + /*********************************/ + /********** INTERNALS ************/ + /*********************************/ + + /* CONSTANTS */ + + var WEBGL_CONSTANTS = { + FLOAT: 5126, + //FLOAT_MAT2: 35674, + FLOAT_MAT3: 35675, + FLOAT_MAT4: 35676, + FLOAT_VEC2: 35664, + FLOAT_VEC3: 35665, + FLOAT_VEC4: 35666, + LINEAR: 9729, + REPEAT: 10497, + SAMPLER_2D: 35678, + POINTS: 0, + LINES: 1, + LINE_LOOP: 2, + LINE_STRIP: 3, + TRIANGLES: 4, + TRIANGLE_STRIP: 5, + TRIANGLE_FAN: 6, + UNSIGNED_BYTE: 5121, + UNSIGNED_SHORT: 5123 + }; + + var WEBGL_TYPE = { + 5126: Number, + //35674: THREE.Matrix2, + 35675: THREE.Matrix3, + 35676: THREE.Matrix4, + 35664: THREE.Vector2, + 35665: THREE.Vector3, + 35666: THREE.Vector4, + 35678: THREE.Texture + }; + + var WEBGL_COMPONENT_TYPES = { + 5120: Int8Array, + 5121: Uint8Array, + 5122: Int16Array, + 5123: Uint16Array, + 5125: Uint32Array, + 5126: Float32Array + }; + + var WEBGL_FILTERS = { + 9728: THREE.NearestFilter, + 9729: THREE.LinearFilter, + 9984: THREE.NearestMipMapNearestFilter, + 9985: THREE.LinearMipMapNearestFilter, + 9986: THREE.NearestMipMapLinearFilter, + 9987: THREE.LinearMipMapLinearFilter + }; + + var WEBGL_WRAPPINGS = { + 33071: THREE.ClampToEdgeWrapping, + 33648: THREE.MirroredRepeatWrapping, + 10497: THREE.RepeatWrapping + }; + + var WEBGL_SIDES = { + 1028: THREE.BackSide, // Culling front + 1029: THREE.FrontSide // Culling back + //1032: THREE.NoSide // Culling front and back, what to do? + }; + + var WEBGL_DEPTH_FUNCS = { + 512: THREE.NeverDepth, + 513: THREE.LessDepth, + 514: THREE.EqualDepth, + 515: THREE.LessEqualDepth, + 516: THREE.GreaterEqualDepth, + 517: THREE.NotEqualDepth, + 518: THREE.GreaterEqualDepth, + 519: THREE.AlwaysDepth + }; + + var WEBGL_BLEND_EQUATIONS = { + 32774: THREE.AddEquation, + 32778: THREE.SubtractEquation, + 32779: THREE.ReverseSubtractEquation + }; + + var WEBGL_BLEND_FUNCS = { + 0: THREE.ZeroFactor, + 1: THREE.OneFactor, + 768: THREE.SrcColorFactor, + 769: THREE.OneMinusSrcColorFactor, + 770: THREE.SrcAlphaFactor, + 771: THREE.OneMinusSrcAlphaFactor, + 772: THREE.DstAlphaFactor, + 773: THREE.OneMinusDstAlphaFactor, + 774: THREE.DstColorFactor, + 775: THREE.OneMinusDstColorFactor, + 776: THREE.SrcAlphaSaturateFactor + // The followings are not supported by Three.js yet + //32769: CONSTANT_COLOR, + //32770: ONE_MINUS_CONSTANT_COLOR, + //32771: CONSTANT_ALPHA, + //32772: ONE_MINUS_CONSTANT_COLOR + }; + + var WEBGL_TYPE_SIZES = { + 'SCALAR': 1, + 'VEC2': 2, + 'VEC3': 3, + 'VEC4': 4, + 'MAT2': 4, + 'MAT3': 9, + 'MAT4': 16 + }; + + var ATTRIBUTES = { + POSITION: 'position', + NORMAL: 'normal', + TEXCOORD_0: 'uv', + TEXCOORD_1: 'uv2', + COLOR_0: 'color', + WEIGHTS_0: 'skinWeight', + JOINTS_0: 'skinIndex', + }; + + var PATH_PROPERTIES = { + scale: 'scale', + translation: 'position', + rotation: 'quaternion', + weights: 'morphTargetInfluences' + }; + + var INTERPOLATION = { + CUBICSPLINE: THREE.InterpolateSmooth, // We use custom interpolation GLTFCubicSplineInterpolation for CUBICSPLINE. + // KeyframeTrack.optimize() can't handle glTF Cubic Spline output values layout, + // using THREE.InterpolateSmooth for KeyframeTrack instantiation to prevent optimization. + // See KeyframeTrack.optimize() for the detail. + LINEAR: THREE.InterpolateLinear, + STEP: THREE.InterpolateDiscrete + }; + + var STATES_ENABLES = { + 2884: 'CULL_FACE', + 2929: 'DEPTH_TEST', + 3042: 'BLEND', + 3089: 'SCISSOR_TEST', + 32823: 'POLYGON_OFFSET_FILL', + 32926: 'SAMPLE_ALPHA_TO_COVERAGE' + }; + + var ALPHA_MODES = { + OPAQUE: 'OPAQUE', + MASK: 'MASK', + BLEND: 'BLEND' + }; + + var MIME_TYPE_FORMATS = { + 'image/png': THREE.RGBAFormat, + 'image/jpeg': THREE.RGBFormat + }; + + /* UTILITY FUNCTIONS */ + + function resolveURL( url, path ) { + + // Invalid URL + if ( typeof url !== 'string' || url === '' ) return ''; + + // Absolute URL http://,https://,// + if ( /^(https?:)?\/\//i.test( url ) ) return url; + + // Data URI + if ( /^data:.*,.*$/i.test( url ) ) return url; + + // Blob URL + if ( /^blob:.*$/i.test( url ) ) return url; + + // Relative URL + return path + url; + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#default-material + */ + function createDefaultMaterial() { + + return new THREE.MeshStandardMaterial( { + color: 0xFFFFFF, + emissive: 0x000000, + metalness: 1, + roughness: 1, + transparent: false, + depthTest: true, + side: THREE.FrontSide + } ); + + } + + function addUnknownExtensionsToUserData( knownExtensions, object, objectDef ) { + + // Add unknown glTF extensions to an object's userData. + + for ( var name in objectDef.extensions ) { + + if ( knownExtensions[ name ] === undefined ) { + + object.userData.gltfExtensions = object.userData.gltfExtensions || {}; + object.userData.gltfExtensions[ name ] = objectDef.extensions[ name ]; + + } + + } + + } + + /** + * @param {THREE.Object3D|THREE.Material|THREE.BufferGeometry} object + * @param {GLTF.definition} gltfDef + */ + function assignExtrasToUserData( object, gltfDef ) { + + if ( gltfDef.extras !== undefined ) { + + if ( typeof gltfDef.extras === 'object' ) { + + object.userData = gltfDef.extras; + + } else { + + console.warn( 'THREE.GLTFLoader: Ignoring primitive type .extras, ' + gltfDef.extras ); + + } + + } + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#morph-targets + * + * @param {THREE.BufferGeometry} geometry + * @param {Array} targets + * @param {GLTFParser} parser + * @return {Promise} + */ + function addMorphTargets( geometry, targets, parser ) { + + var hasMorphPosition = false; + var hasMorphNormal = false; + + for ( var i = 0, il = targets.length; i < il; i ++ ) { + + var target = targets[ i ]; + + if ( target.POSITION !== undefined ) hasMorphPosition = true; + if ( target.NORMAL !== undefined ) hasMorphNormal = true; + + if ( hasMorphPosition && hasMorphNormal ) break; + + } + + if ( ! hasMorphPosition && ! hasMorphNormal ) return Promise.resolve( geometry ); + + var pendingPositionAccessors = []; + var pendingNormalAccessors = []; + + for ( var i = 0, il = targets.length; i < il; i ++ ) { + + var target = targets[ i ]; + + if ( hasMorphPosition ) { + + // TODO: Error-prone use of a callback inside a loop. + var accessor = target.POSITION !== undefined + ? parser.getDependency( 'accessor', target.POSITION ) + .then( function ( accessor ) { + // Cloning not to pollute original accessor below + return cloneBufferAttribute( accessor ); + } ) + : geometry.attributes.position; + + pendingPositionAccessors.push( accessor ); + + } + + if ( hasMorphNormal ) { + + // TODO: Error-prone use of a callback inside a loop. + var accessor = target.NORMAL !== undefined + ? parser.getDependency( 'accessor', target.NORMAL ) + .then( function ( accessor ) { + return cloneBufferAttribute( accessor ); + } ) + : geometry.attributes.normal; + + pendingNormalAccessors.push( accessor ); + + } + + } + + return Promise.all( [ + Promise.all( pendingPositionAccessors ), + Promise.all( pendingNormalAccessors ) + ] ).then( function ( accessors ) { + + var morphPositions = accessors[ 0 ]; + var morphNormals = accessors[ 1 ]; + + for ( var i = 0, il = targets.length; i < il; i ++ ) { + + var target = targets[ i ]; + var attributeName = 'morphTarget' + i; + + if ( hasMorphPosition ) { + + // Three.js morph position is absolute value. The formula is + // basePosition + // + weight0 * ( morphPosition0 - basePosition ) + // + weight1 * ( morphPosition1 - basePosition ) + // ... + // while the glTF one is relative + // basePosition + // + weight0 * glTFmorphPosition0 + // + weight1 * glTFmorphPosition1 + // ... + // then we need to convert from relative to absolute here. + + if ( target.POSITION !== undefined ) { + + var positionAttribute = morphPositions[ i ]; + positionAttribute.name = attributeName; + + var position = geometry.attributes.position; + + for ( var j = 0, jl = positionAttribute.count; j < jl; j ++ ) { + + positionAttribute.setXYZ( + j, + positionAttribute.getX( j ) + position.getX( j ), + positionAttribute.getY( j ) + position.getY( j ), + positionAttribute.getZ( j ) + position.getZ( j ) + ); + + } + + } + + } + + if ( hasMorphNormal ) { + + // see target.POSITION's comment + + if ( target.NORMAL !== undefined ) { + + var normalAttribute = morphNormals[ i ]; + normalAttribute.name = attributeName; + + var normal = geometry.attributes.normal; + + for ( var j = 0, jl = normalAttribute.count; j < jl; j ++ ) { + + normalAttribute.setXYZ( + j, + normalAttribute.getX( j ) + normal.getX( j ), + normalAttribute.getY( j ) + normal.getY( j ), + normalAttribute.getZ( j ) + normal.getZ( j ) + ); + + } + + } + + } + + } + + if ( hasMorphPosition ) geometry.morphAttributes.position = morphPositions; + if ( hasMorphNormal ) geometry.morphAttributes.normal = morphNormals; + + return geometry; + + } ); + + } + + /** + * @param {THREE.Mesh} mesh + * @param {GLTF.Mesh} meshDef + */ + function updateMorphTargets( mesh, meshDef ) { + + mesh.updateMorphTargets(); + + if ( meshDef.weights !== undefined ) { + + for ( var i = 0, il = meshDef.weights.length; i < il; i ++ ) { + + mesh.morphTargetInfluences[ i ] = meshDef.weights[ i ]; + + } + + } + + // .extras has user-defined data, so check that .extras.targetNames is an array. + if ( meshDef.extras && Array.isArray( meshDef.extras.targetNames ) ) { + + var targetNames = meshDef.extras.targetNames; + + if ( mesh.morphTargetInfluences.length === targetNames.length ) { + + mesh.morphTargetDictionary = {}; + + for ( var i = 0, il = targetNames.length; i < il; i ++ ) { + + mesh.morphTargetDictionary[ targetNames[ i ] ] = i; + + } + + } else { + + console.warn( 'THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.' ); + + } + + } + + } + + function isPrimitiveEqual( a, b ) { + + var dracoExtA = a.extensions ? a.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ] : undefined; + var dracoExtB = b.extensions ? b.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ] : undefined; + + if ( dracoExtA && dracoExtB ) { + + if ( dracoExtA.bufferView !== dracoExtB.bufferView ) return false; + + return isObjectEqual( dracoExtA.attributes, dracoExtB.attributes ); + + } + + if ( a.indices !== b.indices ) { + + return false; + + } + + return isObjectEqual( a.attributes, b.attributes ); + + } + + function isObjectEqual( a, b ) { + + if ( Object.keys( a ).length !== Object.keys( b ).length ) return false; + + for ( var key in a ) { + + if ( a[ key ] !== b[ key ] ) return false; + + } + + return true; + + } + + function isArrayEqual( a, b ) { + + if ( a.length !== b.length ) return false; + + for ( var i = 0, il = a.length; i < il; i ++ ) { + + if ( a[ i ] !== b[ i ] ) return false; + + } + + return true; + + } + + function getCachedGeometry( cache, newPrimitive ) { + + for ( var i = 0, il = cache.length; i < il; i ++ ) { + + var cached = cache[ i ]; + + if ( isPrimitiveEqual( cached.primitive, newPrimitive ) ) return cached.promise; + + } + + return null; + + } + + function getCachedCombinedGeometry( cache, geometries ) { + + for ( var i = 0, il = cache.length; i < il; i ++ ) { + + var cached = cache[ i ]; + + if ( isArrayEqual( geometries, cached.baseGeometries ) ) return cached.geometry; + + } + + return null; + + } + + function getCachedMultiPassGeometry( cache, geometry, primitives ) { + + for ( var i = 0, il = cache.length; i < il; i ++ ) { + + var cached = cache[ i ]; + + if ( geometry === cached.baseGeometry && isArrayEqual( primitives, cached.primitives ) ) return cached.geometry; + + } + + return null; + + } + + function cloneBufferAttribute( attribute ) { + + if ( attribute.isInterleavedBufferAttribute ) { + + var count = attribute.count; + var itemSize = attribute.itemSize; + var array = attribute.array.slice( 0, count * itemSize ); + + for ( var i = 0, j = 0; i < count; ++ i ) { + + array[ j ++ ] = attribute.getX( i ); + if ( itemSize >= 2 ) array[ j ++ ] = attribute.getY( i ); + if ( itemSize >= 3 ) array[ j ++ ] = attribute.getZ( i ); + if ( itemSize >= 4 ) array[ j ++ ] = attribute.getW( i ); + + } + + return new THREE.BufferAttribute( array, itemSize, attribute.normalized ); + + } + + return attribute.clone(); + + } + + /** + * Checks if we can build a single Mesh with MultiMaterial from multiple primitives. + * Returns true if all primitives use the same attributes/morphAttributes/mode + * and also have index. Otherwise returns false. + * + * @param {Array} primitives + * @return {Boolean} + */ + function isMultiPassGeometry( primitives ) { + + if ( primitives.length < 2 ) return false; + + var primitive0 = primitives[ 0 ]; + var targets0 = primitive0.targets || []; + + if ( primitive0.indices === undefined ) return false; + + for ( var i = 1, il = primitives.length; i < il; i ++ ) { + + var primitive = primitives[ i ]; + + if ( primitive0.mode !== primitive.mode ) return false; + if ( primitive.indices === undefined ) return false; + if ( primitive.extensions && primitive.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ] ) return false; + if ( ! isObjectEqual( primitive0.attributes, primitive.attributes ) ) return false; + + var targets = primitive.targets || []; + + if ( targets0.length !== targets.length ) return false; + + for ( var j = 0, jl = targets0.length; j < jl; j ++ ) { + + if ( ! isObjectEqual( targets0[ j ], targets[ j ] ) ) return false; + + } + + } + + return true; + + } + + /* GLTF PARSER */ + + function GLTFParser( json, extensions, options ) { + + this.json = json || {}; + this.extensions = extensions || {}; + this.options = options || {}; + + // loader object cache + this.cache = new GLTFRegistry(); + + // BufferGeometry caching + this.primitiveCache = []; + this.multiplePrimitivesCache = []; + this.multiPassGeometryCache = []; + + this.textureLoader = new THREE.TextureLoader( this.options.manager ); + this.textureLoader.setCrossOrigin( this.options.crossOrigin ); + + this.fileLoader = new THREE.FileLoader( this.options.manager ); + this.fileLoader.setResponseType( 'arraybuffer' ); + + } + + GLTFParser.prototype.parse = function ( onLoad, onError ) { + + var json = this.json; + + // Clear the loader cache + this.cache.removeAll(); + + // Mark the special nodes/meshes in json for efficient parse + this.markDefs(); + + // Fire the callback on complete + this.getMultiDependencies( [ + + 'scene', + 'animation', + 'camera' + + ] ).then( function ( dependencies ) { + + var scenes = dependencies.scenes || []; + var scene = scenes[ json.scene || 0 ]; + var animations = dependencies.animations || []; + var cameras = dependencies.cameras || []; + + onLoad( scene, scenes, cameras, animations, json ); + + } ).catch( onError ); + + }; + + /** + * Marks the special nodes/meshes in json for efficient parse. + */ + GLTFParser.prototype.markDefs = function () { + + var nodeDefs = this.json.nodes || []; + var skinDefs = this.json.skins || []; + var meshDefs = this.json.meshes || []; + + var meshReferences = {}; + var meshUses = {}; + + // Nothing in the node definition indicates whether it is a Bone or an + // Object3D. Use the skins' joint references to mark bones. + for ( var skinIndex = 0, skinLength = skinDefs.length; skinIndex < skinLength; skinIndex ++ ) { + + var joints = skinDefs[ skinIndex ].joints; + + for ( var i = 0, il = joints.length; i < il; i ++ ) { + + nodeDefs[ joints[ i ] ].isBone = true; + + } + + } + + // Meshes can (and should) be reused by multiple nodes in a glTF asset. To + // avoid having more than one THREE.Mesh with the same name, count + // references and rename instances below. + // + // Example: CesiumMilkTruck sample model reuses "Wheel" meshes. + for ( var nodeIndex = 0, nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex ++ ) { + + var nodeDef = nodeDefs[ nodeIndex ]; + + if ( nodeDef.mesh !== undefined ) { + + if ( meshReferences[ nodeDef.mesh ] === undefined ) { + + meshReferences[ nodeDef.mesh ] = meshUses[ nodeDef.mesh ] = 0; + + } + + meshReferences[ nodeDef.mesh ] ++; + + // Nothing in the mesh definition indicates whether it is + // a SkinnedMesh or Mesh. Use the node's mesh reference + // to mark SkinnedMesh if node has skin. + if ( nodeDef.skin !== undefined ) { + + meshDefs[ nodeDef.mesh ].isSkinnedMesh = true; + + } + + } + + } + + this.json.meshReferences = meshReferences; + this.json.meshUses = meshUses; + + }; + + /** + * Requests the specified dependency asynchronously, with caching. + * @param {string} type + * @param {number} index + * @return {Promise} + */ + GLTFParser.prototype.getDependency = function ( type, index ) { + + var cacheKey = type + ':' + index; + var dependency = this.cache.get( cacheKey ); + + if ( ! dependency ) { + + switch ( type ) { + + case 'scene': + dependency = this.loadScene( index ); + break; + + case 'node': + dependency = this.loadNode( index ); + break; + + case 'mesh': + dependency = this.loadMesh( index ); + break; + + case 'accessor': + dependency = this.loadAccessor( index ); + break; + + case 'bufferView': + dependency = this.loadBufferView( index ); + break; + + case 'buffer': + dependency = this.loadBuffer( index ); + break; + + case 'material': + dependency = this.loadMaterial( index ); + break; + + case 'texture': + dependency = this.loadTexture( index ); + break; + + case 'skin': + dependency = this.loadSkin( index ); + break; + + case 'animation': + dependency = this.loadAnimation( index ); + break; + + case 'camera': + dependency = this.loadCamera( index ); + break; + + case 'light': + dependency = this.extensions[ EXTENSIONS.KHR_LIGHTS_PUNCTUAL ].loadLight( index ); + break + + default: + throw new Error( 'Unknown type: ' + type ); + + } + + this.cache.add( cacheKey, dependency ); + + } + + return dependency; + + }; + + /** + * Requests all dependencies of the specified type asynchronously, with caching. + * @param {string} type + * @return {Promise>} + */ + GLTFParser.prototype.getDependencies = function ( type ) { + + var dependencies = this.cache.get( type ); + + if ( ! dependencies ) { + + var parser = this; + var defs = this.json[ type + ( type === 'mesh' ? 'es' : 's' ) ] || []; + + dependencies = Promise.all( defs.map( function ( def, index ) { + + return parser.getDependency( type, index ); + + } ) ); + + this.cache.add( type, dependencies ); + + } + + return dependencies; + + }; + + /** + * Requests all multiple dependencies of the specified types asynchronously, with caching. + * @param {Array} types + * @return {Promise>>} + */ + GLTFParser.prototype.getMultiDependencies = function ( types ) { + + var results = {}; + var pending = []; + + for ( var i = 0, il = types.length; i < il; i ++ ) { + + var type = types[ i ]; + var value = this.getDependencies( type ); + + // TODO: Error-prone use of a callback inside a loop. + value = value.then( function ( key, value ) { + + results[ key ] = value; + + }.bind( this, type + ( type === 'mesh' ? 'es' : 's' ) ) ); + + pending.push( value ); + + } + + return Promise.all( pending ).then( function () { + + return results; + + } ); + + }; + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views + * @param {number} bufferIndex + * @return {Promise} + */ + GLTFParser.prototype.loadBuffer = function ( bufferIndex ) { + + var bufferDef = this.json.buffers[ bufferIndex ]; + var loader = this.fileLoader; + + if ( bufferDef.type && bufferDef.type !== 'arraybuffer' ) { + + throw new Error( 'THREE.GLTFLoader: ' + bufferDef.type + ' buffer type is not supported.' ); + + } + + // If present, GLB container is required to be the first buffer. + if ( bufferDef.uri === undefined && bufferIndex === 0 ) { + + return Promise.resolve( this.extensions[ EXTENSIONS.KHR_BINARY_GLTF ].body ); + + } + + var options = this.options; + + return new Promise( function ( resolve, reject ) { + + loader.load( resolveURL( bufferDef.uri, options.path ), resolve, undefined, function () { + + reject( new Error( 'THREE.GLTFLoader: Failed to load buffer "' + bufferDef.uri + '".' ) ); + + } ); + + } ); + + }; + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views + * @param {number} bufferViewIndex + * @return {Promise} + */ + GLTFParser.prototype.loadBufferView = function ( bufferViewIndex ) { + + var bufferViewDef = this.json.bufferViews[ bufferViewIndex ]; + + return this.getDependency( 'buffer', bufferViewDef.buffer ).then( function ( buffer ) { + + var byteLength = bufferViewDef.byteLength || 0; + var byteOffset = bufferViewDef.byteOffset || 0; + return buffer.slice( byteOffset, byteOffset + byteLength ); + + } ); + + }; + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors + * @param {number} accessorIndex + * @return {Promise} + */ + GLTFParser.prototype.loadAccessor = function ( accessorIndex ) { + + var parser = this; + var json = this.json; + + var accessorDef = this.json.accessors[ accessorIndex ]; + + if ( accessorDef.bufferView === undefined && accessorDef.sparse === undefined ) { + + // Ignore empty accessors, which may be used to declare runtime + // information about attributes coming from another source (e.g. Draco + // compression extension). + return Promise.resolve( null ); + + } + + var pendingBufferViews = []; + + if ( accessorDef.bufferView !== undefined ) { + + pendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.bufferView ) ); + + } else { + + pendingBufferViews.push( null ); + + } + + if ( accessorDef.sparse !== undefined ) { + + pendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.sparse.indices.bufferView ) ); + pendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.sparse.values.bufferView ) ); + + } + + return Promise.all( pendingBufferViews ).then( function ( bufferViews ) { + + var bufferView = bufferViews[ 0 ]; + + var itemSize = WEBGL_TYPE_SIZES[ accessorDef.type ]; + var TypedArray = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ]; + + // For VEC3: itemSize is 3, elementBytes is 4, itemBytes is 12. + var elementBytes = TypedArray.BYTES_PER_ELEMENT; + var itemBytes = elementBytes * itemSize; + var byteOffset = accessorDef.byteOffset || 0; + var byteStride = accessorDef.bufferView !== undefined ? json.bufferViews[ accessorDef.bufferView ].byteStride : undefined; + var normalized = accessorDef.normalized === true; + var array, bufferAttribute; + + // The buffer is not interleaved if the stride is the item size in bytes. + if ( byteStride && byteStride !== itemBytes ) { + + var ibCacheKey = 'InterleavedBuffer:' + accessorDef.bufferView + ':' + accessorDef.componentType; + var ib = parser.cache.get( ibCacheKey ); + + if ( ! ib ) { + + // Use the full buffer if it's interleaved. + array = new TypedArray( bufferView ); + + // Integer parameters to IB/IBA are in array elements, not bytes. + ib = new THREE.InterleavedBuffer( array, byteStride / elementBytes ); + + parser.cache.add( ibCacheKey, ib ); + + } + + bufferAttribute = new THREE.InterleavedBufferAttribute( ib, itemSize, byteOffset / elementBytes, normalized ); + + } else { + + if ( bufferView === null ) { + + array = new TypedArray( accessorDef.count * itemSize ); + + } else { + + array = new TypedArray( bufferView, byteOffset, accessorDef.count * itemSize ); + + } + + bufferAttribute = new THREE.BufferAttribute( array, itemSize, normalized ); + + } + + // https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#sparse-accessors + if ( accessorDef.sparse !== undefined ) { + + var itemSizeIndices = WEBGL_TYPE_SIZES.SCALAR; + var TypedArrayIndices = WEBGL_COMPONENT_TYPES[ accessorDef.sparse.indices.componentType ]; + + var byteOffsetIndices = accessorDef.sparse.indices.byteOffset || 0; + var byteOffsetValues = accessorDef.sparse.values.byteOffset || 0; + + var sparseIndices = new TypedArrayIndices( bufferViews[ 1 ], byteOffsetIndices, accessorDef.sparse.count * itemSizeIndices ); + var sparseValues = new TypedArray( bufferViews[ 2 ], byteOffsetValues, accessorDef.sparse.count * itemSize ); + + if ( bufferView !== null ) { + + // Avoid modifying the original ArrayBuffer, if the bufferView wasn't initialized with zeroes. + bufferAttribute.setArray( bufferAttribute.array.slice() ); + + } + + for ( var i = 0, il = sparseIndices.length; i < il; i ++ ) { + + var index = sparseIndices[ i ]; + + bufferAttribute.setX( index, sparseValues[ i * itemSize ] ); + if ( itemSize >= 2 ) bufferAttribute.setY( index, sparseValues[ i * itemSize + 1 ] ); + if ( itemSize >= 3 ) bufferAttribute.setZ( index, sparseValues[ i * itemSize + 2 ] ); + if ( itemSize >= 4 ) bufferAttribute.setW( index, sparseValues[ i * itemSize + 3 ] ); + if ( itemSize >= 5 ) throw new Error( 'THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.' ); + + } + + } + + return bufferAttribute; + + } ); + + }; + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures + * @param {number} textureIndex + * @return {Promise} + */ + GLTFParser.prototype.loadTexture = function ( textureIndex ) { + + var parser = this; + var json = this.json; + var options = this.options; + var textureLoader = this.textureLoader; + + var URL = window.URL || window.webkitURL; + + var textureDef = json.textures[ textureIndex ]; + + var textureExtensions = textureDef.extensions || {}; + + var source; + + if ( textureExtensions[ EXTENSIONS.MSFT_TEXTURE_DDS ] ) { + + source = json.images[ textureExtensions[ EXTENSIONS.MSFT_TEXTURE_DDS ].source ]; + + } else { + + source = json.images[ textureDef.source ]; + + } + + var sourceURI = source.uri; + var isObjectURL = false; + + if ( source.bufferView !== undefined ) { + + // Load binary image data from bufferView, if provided. + + sourceURI = parser.getDependency( 'bufferView', source.bufferView ).then( function ( bufferView ) { + + isObjectURL = true; + var blob = new Blob( [ bufferView ], { type: source.mimeType } ); + sourceURI = URL.createObjectURL( blob ); + return sourceURI; + + } ); + + } + + return Promise.resolve( sourceURI ).then( function ( sourceURI ) { + + // Load Texture resource. + + var loader = THREE.Loader.Handlers.get( sourceURI ); + + if ( ! loader ) { + + loader = textureExtensions[ EXTENSIONS.MSFT_TEXTURE_DDS ] + ? parser.extensions[ EXTENSIONS.MSFT_TEXTURE_DDS ].ddsLoader + : textureLoader; + + } + + return new Promise( function ( resolve, reject ) { + + loader.load( resolveURL( sourceURI, options.path ), resolve, undefined, reject ); + + } ); + + } ).then( function ( texture ) { + + // Clean up resources and configure Texture. + + if ( isObjectURL === true ) { + + URL.revokeObjectURL( sourceURI ); + + } + + texture.flipY = false; + + if ( textureDef.name !== undefined ) texture.name = textureDef.name; + + // Ignore unknown mime types, like DDS files. + if ( source.mimeType in MIME_TYPE_FORMATS ) { + + texture.format = MIME_TYPE_FORMATS[ source.mimeType ]; + + } + + var samplers = json.samplers || {}; + var sampler = samplers[ textureDef.sampler ] || {}; + + texture.magFilter = WEBGL_FILTERS[ sampler.magFilter ] || THREE.LinearFilter; + texture.minFilter = WEBGL_FILTERS[ sampler.minFilter ] || THREE.LinearMipMapLinearFilter; + texture.wrapS = WEBGL_WRAPPINGS[ sampler.wrapS ] || THREE.RepeatWrapping; + texture.wrapT = WEBGL_WRAPPINGS[ sampler.wrapT ] || THREE.RepeatWrapping; + + return texture; + + } ); + + }; + + /** + * Asynchronously assigns a texture to the given material parameters. + * @param {Object} materialParams + * @param {string} mapName + * @param {Object} mapDef + * @return {Promise} + */ + GLTFParser.prototype.assignTexture = function ( materialParams, mapName, mapDef ) { + + var parser = this; + + return this.getDependency( 'texture', mapDef.index ).then( function ( texture ) { + + if ( parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] ) { + + var transform = mapDef.extensions !== undefined ? mapDef.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] : undefined; + + if ( transform ) { + + texture = parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ].extendTexture( texture, transform ); + + } + + } + + materialParams[ mapName ] = texture; + + } ); + + }; + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials + * @param {number} materialIndex + * @return {Promise} + */ + GLTFParser.prototype.loadMaterial = function ( materialIndex ) { + + var parser = this; + var json = this.json; + var extensions = this.extensions; + var materialDef = json.materials[ materialIndex ]; + + var materialType; + var materialParams = {}; + var materialExtensions = materialDef.extensions || {}; + + var pending = []; + + if ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ] ) { + + var sgExtension = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ]; + materialType = sgExtension.getMaterialType( materialDef ); + pending.push( sgExtension.extendParams( materialParams, materialDef, parser ) ); + + } else if ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ] ) { + + var kmuExtension = extensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ]; + materialType = kmuExtension.getMaterialType( materialDef ); + pending.push( kmuExtension.extendParams( materialParams, materialDef, parser ) ); + + } else { + + // Specification: + // https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#metallic-roughness-material + + materialType = THREE.MeshStandardMaterial; + + var metallicRoughness = materialDef.pbrMetallicRoughness || {}; + + materialParams.color = new THREE.Color( 1.0, 1.0, 1.0 ); + materialParams.opacity = 1.0; + + if ( Array.isArray( metallicRoughness.baseColorFactor ) ) { + + var array = metallicRoughness.baseColorFactor; + + materialParams.color.fromArray( array ); + materialParams.opacity = array[ 3 ]; + + } + + if ( metallicRoughness.baseColorTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'map', metallicRoughness.baseColorTexture ) ); + + } + + materialParams.metalness = metallicRoughness.metallicFactor !== undefined ? metallicRoughness.metallicFactor : 1.0; + materialParams.roughness = metallicRoughness.roughnessFactor !== undefined ? metallicRoughness.roughnessFactor : 1.0; + + if ( metallicRoughness.metallicRoughnessTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'metalnessMap', metallicRoughness.metallicRoughnessTexture ) ); + pending.push( parser.assignTexture( materialParams, 'roughnessMap', metallicRoughness.metallicRoughnessTexture ) ); + + } + + } + + if ( materialDef.doubleSided === true ) { + + materialParams.side = THREE.DoubleSide; + + } + + var alphaMode = materialDef.alphaMode || ALPHA_MODES.OPAQUE; + + if ( alphaMode === ALPHA_MODES.BLEND ) { + + materialParams.transparent = true; + + } else { + + materialParams.transparent = false; + + if ( alphaMode === ALPHA_MODES.MASK ) { + + materialParams.alphaTest = materialDef.alphaCutoff !== undefined ? materialDef.alphaCutoff : 0.5; + + } + + } + + if ( materialDef.normalTexture !== undefined && materialType !== THREE.MeshBasicMaterial ) { + + pending.push( parser.assignTexture( materialParams, 'normalMap', materialDef.normalTexture ) ); + + materialParams.normalScale = new THREE.Vector2( 1, 1 ); + + if ( materialDef.normalTexture.scale !== undefined ) { + + materialParams.normalScale.set( materialDef.normalTexture.scale, materialDef.normalTexture.scale ); + + } + + } + + if ( materialDef.occlusionTexture !== undefined && materialType !== THREE.MeshBasicMaterial ) { + + pending.push( parser.assignTexture( materialParams, 'aoMap', materialDef.occlusionTexture ) ); + + if ( materialDef.occlusionTexture.strength !== undefined ) { + + materialParams.aoMapIntensity = materialDef.occlusionTexture.strength; + + } + + } + + if ( materialDef.emissiveFactor !== undefined && materialType !== THREE.MeshBasicMaterial ) { + + materialParams.emissive = new THREE.Color().fromArray( materialDef.emissiveFactor ); + + } + + if ( materialDef.emissiveTexture !== undefined && materialType !== THREE.MeshBasicMaterial ) { + + pending.push( parser.assignTexture( materialParams, 'emissiveMap', materialDef.emissiveTexture ) ); + + } + + return Promise.all( pending ).then( function () { + + var material; + + if ( materialType === THREE.ShaderMaterial ) { + + material = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ].createMaterial( materialParams ); + + } else { + + material = new materialType( materialParams ); + + } + + if ( materialDef.name !== undefined ) material.name = materialDef.name; + + // Normal map textures use OpenGL conventions: + // https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#materialnormaltexture + if ( material.normalScale ) { + + material.normalScale.y = - material.normalScale.y; + + } + + // baseColorTexture, emissiveTexture, and specularGlossinessTexture use sRGB encoding. + if ( material.map ) material.map.encoding = THREE.sRGBEncoding; + if ( material.emissiveMap ) material.emissiveMap.encoding = THREE.sRGBEncoding; + if ( material.specularMap ) material.specularMap.encoding = THREE.sRGBEncoding; + + assignExtrasToUserData( material, materialDef ); + + if ( materialDef.extensions ) addUnknownExtensionsToUserData( extensions, material, materialDef ); + + return material; + + } ); + + }; + + /** + * @param {THREE.BufferGeometry} geometry + * @param {GLTF.Primitive} primitiveDef + * @param {GLTFParser} parser + * @return {Promise} + */ + function addPrimitiveAttributes( geometry, primitiveDef, parser ) { + + var attributes = primitiveDef.attributes; + + var pending = []; + + function assignAttributeAccessor( accessorIndex, attributeName ) { + + return parser.getDependency( 'accessor', accessorIndex ) + .then( function ( accessor ) { + + geometry.addAttribute( attributeName, accessor ); + + } ); + + } + + for ( var gltfAttributeName in attributes ) { + + var threeAttributeName = ATTRIBUTES[ gltfAttributeName ]; + + if ( ! threeAttributeName ) continue; + + // Skip attributes already provided by e.g. Draco extension. + if ( threeAttributeName in geometry.attributes ) continue; + + pending.push( assignAttributeAccessor( attributes[ gltfAttributeName ], threeAttributeName ) ); + + } + + if ( primitiveDef.indices !== undefined && ! geometry.index ) { + + var accessor = parser.getDependency( 'accessor', primitiveDef.indices ).then( function ( accessor ) { + + geometry.setIndex( accessor ); + + } ); + + pending.push( accessor ); + + } + + assignExtrasToUserData( geometry, primitiveDef ); + + return Promise.all( pending ).then( function () { + + return primitiveDef.targets !== undefined + ? addMorphTargets( geometry, primitiveDef.targets, parser ) + : geometry; + + } ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry + * + * Creates BufferGeometries from primitives. + * If we can build a single BufferGeometry with .groups from multiple primitives, returns one BufferGeometry. + * Otherwise, returns BufferGeometries without .groups as many as primitives. + * + * @param {Array} primitives + * @return {Promise>} + */ + GLTFParser.prototype.loadGeometries = function ( primitives ) { + + var parser = this; + var extensions = this.extensions; + var cache = this.primitiveCache; + + var isMultiPass = isMultiPassGeometry( primitives ); + var originalPrimitives; + + if ( isMultiPass ) { + + originalPrimitives = primitives; // save original primitives and use later + + // We build a single BufferGeometry with .groups from multiple primitives + // because all primitives share the same attributes/morph/mode and have indices. + + primitives = [ primitives[ 0 ] ]; + + // Sets .groups and combined indices to a geometry later in this method. + + } + + function createDracoPrimitive( primitive ) { + + return extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ] + .decodePrimitive( primitive, parser ) + .then( function ( geometry ) { + + return addPrimitiveAttributes( geometry, primitive, parser ); + + } ); + + } + + var pending = []; + + for ( var i = 0, il = primitives.length; i < il; i ++ ) { + + var primitive = primitives[ i ]; + + // See if we've already created this geometry + var cached = getCachedGeometry( cache, primitive ); + + if ( cached ) { + + // Use the cached geometry if it exists + pending.push( cached ); + + } else { + + var geometryPromise; + + if ( primitive.extensions && primitive.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ] ) { + + // Use DRACO geometry if available + geometryPromise = createDracoPrimitive( primitive ); + + } else { + + // Otherwise create a new geometry + geometryPromise = addPrimitiveAttributes( new THREE.BufferGeometry(), primitive, parser ); + + } + + // Cache this geometry + cache.push( { primitive: primitive, promise: geometryPromise } ); + + pending.push( geometryPromise ); + + } + + } + + return Promise.all( pending ).then( function ( geometries ) { + + if ( isMultiPass ) { + + var baseGeometry = geometries[ 0 ]; + + // See if we've already created this combined geometry + var cache = parser.multiPassGeometryCache; + var cached = getCachedMultiPassGeometry( cache, baseGeometry, originalPrimitives ); + + if ( cached !== null ) return [ cached.geometry ]; + + // Cloning geometry because of index override. + // Attributes can be reused so cloning by myself here. + var geometry = new THREE.BufferGeometry(); + + geometry.name = baseGeometry.name; + geometry.userData = baseGeometry.userData; + + for ( var key in baseGeometry.attributes ) geometry.addAttribute( key, baseGeometry.attributes[ key ] ); + for ( var key in baseGeometry.morphAttributes ) geometry.morphAttributes[ key ] = baseGeometry.morphAttributes[ key ]; + + var pendingIndices = []; + + for ( var i = 0, il = originalPrimitives.length; i < il; i ++ ) { + + pendingIndices.push( parser.getDependency( 'accessor', originalPrimitives[ i ].indices ) ); + + } + + return Promise.all( pendingIndices ).then( function ( accessors ) { + + var indices = []; + var offset = 0; + + for ( var i = 0, il = originalPrimitives.length; i < il; i ++ ) { + + var accessor = accessors[ i ]; + + for ( var j = 0, jl = accessor.count; j < jl; j ++ ) indices.push( accessor.array[ j ] ); + + geometry.addGroup( offset, accessor.count, i ); + + offset += accessor.count; + + } + + geometry.setIndex( indices ); + + cache.push( { geometry: geometry, baseGeometry: baseGeometry, primitives: originalPrimitives } ); + + return [ geometry ]; + + } ); + + } else if ( geometries.length > 1 && THREE.BufferGeometryUtils !== undefined ) { + + // Tries to merge geometries with BufferGeometryUtils if possible + + for ( var i = 1, il = primitives.length; i < il; i ++ ) { + + // can't merge if draw mode is different + if ( primitives[ 0 ].mode !== primitives[ i ].mode ) return geometries; + + } + + // See if we've already created this combined geometry + var cache = parser.multiplePrimitivesCache; + var cached = getCachedCombinedGeometry( cache, geometries ); + + if ( cached ) { + + if ( cached.geometry !== null ) return [ cached.geometry ]; + + } else { + + var geometry = THREE.BufferGeometryUtils.mergeBufferGeometries( geometries, true ); + + cache.push( { geometry: geometry, baseGeometries: geometries } ); + + if ( geometry !== null ) return [ geometry ]; + + } + + } + + return geometries; + + } ); + + }; + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes + * @param {number} meshIndex + * @return {Promise} + */ + GLTFParser.prototype.loadMesh = function ( meshIndex ) { + + var parser = this; + var json = this.json; + var extensions = this.extensions; + + var meshDef = json.meshes[ meshIndex ]; + var primitives = meshDef.primitives; + + var pending = []; + + for ( var i = 0, il = primitives.length; i < il; i ++ ) { + + var material = primitives[ i ].material === undefined + ? createDefaultMaterial() + : this.getDependency( 'material', primitives[ i ].material ); + + pending.push( material ); + + } + + return Promise.all( pending ).then( function ( originalMaterials ) { + + return parser.loadGeometries( primitives ).then( function ( geometries ) { + + var isMultiMaterial = geometries.length === 1 && geometries[ 0 ].groups.length > 0; + + var meshes = []; + + for ( var i = 0, il = geometries.length; i < il; i ++ ) { + + var geometry = geometries[ i ]; + var primitive = primitives[ i ]; + + // 1. create Mesh + + var mesh; + + var material = isMultiMaterial ? originalMaterials : originalMaterials[ i ]; + + if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLES || + primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP || + primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN || + primitive.mode === undefined ) { + + // .isSkinnedMesh isn't in glTF spec. See .markDefs() + mesh = meshDef.isSkinnedMesh === true + ? new THREE.SkinnedMesh( geometry, material ) + : new THREE.Mesh( geometry, material ); + + if ( mesh.isSkinnedMesh === true ) mesh.normalizeSkinWeights(); // #15319 + + if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP ) { + + mesh.drawMode = THREE.TriangleStripDrawMode; + + } else if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN ) { + + mesh.drawMode = THREE.TriangleFanDrawMode; + + } + + } else if ( primitive.mode === WEBGL_CONSTANTS.LINES ) { + + mesh = new THREE.LineSegments( geometry, material ); + + } else if ( primitive.mode === WEBGL_CONSTANTS.LINE_STRIP ) { + + mesh = new THREE.Line( geometry, material ); + + } else if ( primitive.mode === WEBGL_CONSTANTS.LINE_LOOP ) { + + mesh = new THREE.LineLoop( geometry, material ); + + } else if ( primitive.mode === WEBGL_CONSTANTS.POINTS ) { + + mesh = new THREE.Points( geometry, material ); + + } else { + + throw new Error( 'THREE.GLTFLoader: Primitive mode unsupported: ' + primitive.mode ); + + } + + if ( Object.keys( mesh.geometry.morphAttributes ).length > 0 ) { + + updateMorphTargets( mesh, meshDef ); + + } + + mesh.name = meshDef.name || ( 'mesh_' + meshIndex ); + + if ( geometries.length > 1 ) mesh.name += '_' + i; + + assignExtrasToUserData( mesh, meshDef ); + + meshes.push( mesh ); + + // 2. update Material depending on Mesh and BufferGeometry + + var materials = isMultiMaterial ? mesh.material : [ mesh.material ]; + + var useVertexColors = geometry.attributes.color !== undefined; + var useFlatShading = geometry.attributes.normal === undefined; + var useSkinning = mesh.isSkinnedMesh === true; + var useMorphTargets = Object.keys( geometry.morphAttributes ).length > 0; + var useMorphNormals = useMorphTargets && geometry.morphAttributes.normal !== undefined; + + for ( var j = 0, jl = materials.length; j < jl; j ++ ) { + + var material = materials[ j ]; + + if ( mesh.isPoints ) { + + var cacheKey = 'PointsMaterial:' + material.uuid; + + var pointsMaterial = parser.cache.get( cacheKey ); + + if ( ! pointsMaterial ) { + + pointsMaterial = new THREE.PointsMaterial(); + THREE.Material.prototype.copy.call( pointsMaterial, material ); + pointsMaterial.color.copy( material.color ); + pointsMaterial.map = material.map; + pointsMaterial.lights = false; // PointsMaterial doesn't support lights yet + + parser.cache.add( cacheKey, pointsMaterial ); + + } + + material = pointsMaterial; + + } else if ( mesh.isLine ) { + + var cacheKey = 'LineBasicMaterial:' + material.uuid; + + var lineMaterial = parser.cache.get( cacheKey ); + + if ( ! lineMaterial ) { + + lineMaterial = new THREE.LineBasicMaterial(); + THREE.Material.prototype.copy.call( lineMaterial, material ); + lineMaterial.color.copy( material.color ); + lineMaterial.lights = false; // LineBasicMaterial doesn't support lights yet + + parser.cache.add( cacheKey, lineMaterial ); + + } + + material = lineMaterial; + + } + + // Clone the material if it will be modified + if ( useVertexColors || useFlatShading || useSkinning || useMorphTargets ) { + + var cacheKey = 'ClonedMaterial:' + material.uuid + ':'; + + if ( material.isGLTFSpecularGlossinessMaterial ) cacheKey += 'specular-glossiness:'; + if ( useSkinning ) cacheKey += 'skinning:'; + if ( useVertexColors ) cacheKey += 'vertex-colors:'; + if ( useFlatShading ) cacheKey += 'flat-shading:'; + if ( useMorphTargets ) cacheKey += 'morph-targets:'; + if ( useMorphNormals ) cacheKey += 'morph-normals:'; + + var cachedMaterial = parser.cache.get( cacheKey ); + + if ( ! cachedMaterial ) { + + cachedMaterial = material.isGLTFSpecularGlossinessMaterial + ? extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ].cloneMaterial( material ) + : material.clone(); + + if ( useSkinning ) cachedMaterial.skinning = true; + if ( useVertexColors ) cachedMaterial.vertexColors = THREE.VertexColors; + if ( useFlatShading ) cachedMaterial.flatShading = true; + if ( useMorphTargets ) cachedMaterial.morphTargets = true; + if ( useMorphNormals ) cachedMaterial.morphNormals = true; + + parser.cache.add( cacheKey, cachedMaterial ); + + } + + material = cachedMaterial; + + } + + materials[ j ] = material; + + // workarounds for mesh and geometry + + if ( material.aoMap && geometry.attributes.uv2 === undefined && geometry.attributes.uv !== undefined ) { + + console.log( 'THREE.GLTFLoader: Duplicating UVs to support aoMap.' ); + geometry.addAttribute( 'uv2', new THREE.BufferAttribute( geometry.attributes.uv.array, 2 ) ); + + } + + if ( material.isGLTFSpecularGlossinessMaterial ) { + + // for GLTFSpecularGlossinessMaterial(ShaderMaterial) uniforms runtime update + mesh.onBeforeRender = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ].refreshUniforms; + + } + + } + + mesh.material = isMultiMaterial ? materials : materials[ 0 ]; + + } + + if ( meshes.length === 1 ) { + + return meshes[ 0 ]; + + } + + var group = new THREE.Group(); + + for ( var i = 0, il = meshes.length; i < il; i ++ ) { + + group.add( meshes[ i ] ); + + } + + return group; + + } ); + + } ); + + }; + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras + * @param {number} cameraIndex + * @return {Promise} + */ + GLTFParser.prototype.loadCamera = function ( cameraIndex ) { + + var camera; + var cameraDef = this.json.cameras[ cameraIndex ]; + var params = cameraDef[ cameraDef.type ]; + + if ( ! params ) { + + console.warn( 'THREE.GLTFLoader: Missing camera parameters.' ); + return; + + } + + if ( cameraDef.type === 'perspective' ) { + + camera = new THREE.PerspectiveCamera( THREE.Math.radToDeg( params.yfov ), params.aspectRatio || 1, params.znear || 1, params.zfar || 2e6 ); + + } else if ( cameraDef.type === 'orthographic' ) { + + camera = new THREE.OrthographicCamera( params.xmag / - 2, params.xmag / 2, params.ymag / 2, params.ymag / - 2, params.znear, params.zfar ); + + } + + if ( cameraDef.name !== undefined ) camera.name = cameraDef.name; + + assignExtrasToUserData( camera, cameraDef ); + + return Promise.resolve( camera ); + + }; + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins + * @param {number} skinIndex + * @return {Promise} + */ + GLTFParser.prototype.loadSkin = function ( skinIndex ) { + + var skinDef = this.json.skins[ skinIndex ]; + + var skinEntry = { joints: skinDef.joints }; + + if ( skinDef.inverseBindMatrices === undefined ) { + + return Promise.resolve( skinEntry ); + + } + + return this.getDependency( 'accessor', skinDef.inverseBindMatrices ).then( function ( accessor ) { + + skinEntry.inverseBindMatrices = accessor; + + return skinEntry; + + } ); + + }; + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations + * @param {number} animationIndex + * @return {Promise} + */ + GLTFParser.prototype.loadAnimation = function ( animationIndex ) { + + var json = this.json; + + var animationDef = json.animations[ animationIndex ]; + + var pendingNodes = []; + var pendingInputAccessors = []; + var pendingOutputAccessors = []; + var pendingSamplers = []; + var pendingTargets = []; + + for ( var i = 0, il = animationDef.channels.length; i < il; i ++ ) { + + var channel = animationDef.channels[ i ]; + var sampler = animationDef.samplers[ channel.sampler ]; + var target = channel.target; + var name = target.node !== undefined ? target.node : target.id; // NOTE: target.id is deprecated. + var input = animationDef.parameters !== undefined ? animationDef.parameters[ sampler.input ] : sampler.input; + var output = animationDef.parameters !== undefined ? animationDef.parameters[ sampler.output ] : sampler.output; + + pendingNodes.push( this.getDependency( 'node', name ) ); + pendingInputAccessors.push( this.getDependency( 'accessor', input ) ); + pendingOutputAccessors.push( this.getDependency( 'accessor', output ) ); + pendingSamplers.push( sampler ); + pendingTargets.push( target ); + + } + + return Promise.all( [ + + Promise.all( pendingNodes ), + Promise.all( pendingInputAccessors ), + Promise.all( pendingOutputAccessors ), + Promise.all( pendingSamplers ), + Promise.all( pendingTargets ) + + ] ).then( function ( dependencies ) { + + var nodes = dependencies[ 0 ]; + var inputAccessors = dependencies[ 1 ]; + var outputAccessors = dependencies[ 2 ]; + var samplers = dependencies[ 3 ]; + var targets = dependencies[ 4 ]; + + var tracks = []; + + for ( var i = 0, il = nodes.length; i < il; i ++ ) { + + var node = nodes[ i ]; + var inputAccessor = inputAccessors[ i ]; + var outputAccessor = outputAccessors[ i ]; + var sampler = samplers[ i ]; + var target = targets[ i ]; + + if ( node === undefined ) continue; + + node.updateMatrix(); + node.matrixAutoUpdate = true; + + var TypedKeyframeTrack; + + switch ( PATH_PROPERTIES[ target.path ] ) { + + case PATH_PROPERTIES.weights: + + TypedKeyframeTrack = THREE.NumberKeyframeTrack; + break; + + case PATH_PROPERTIES.rotation: + + TypedKeyframeTrack = THREE.QuaternionKeyframeTrack; + break; + + case PATH_PROPERTIES.position: + case PATH_PROPERTIES.scale: + default: + + TypedKeyframeTrack = THREE.VectorKeyframeTrack; + break; + + } + + var targetName = node.name ? node.name : node.uuid; + + var interpolation = sampler.interpolation !== undefined ? INTERPOLATION[ sampler.interpolation ] : THREE.InterpolateLinear; + + var targetNames = []; + + if ( PATH_PROPERTIES[ target.path ] === PATH_PROPERTIES.weights ) { + + // node can be THREE.Group here but + // PATH_PROPERTIES.weights(morphTargetInfluences) should be + // the property of a mesh object under group. + + node.traverse( function ( object ) { + + if ( object.isMesh === true && object.morphTargetInfluences ) { + + targetNames.push( object.name ? object.name : object.uuid ); + + } + + } ); + + } else { + + targetNames.push( targetName ); + + } + + // KeyframeTrack.optimize() will modify given 'times' and 'values' + // buffers before creating a truncated copy to keep. Because buffers may + // be reused by other tracks, make copies here. + for ( var j = 0, jl = targetNames.length; j < jl; j ++ ) { + + var track = new TypedKeyframeTrack( + targetNames[ j ] + '.' + PATH_PROPERTIES[ target.path ], + THREE.AnimationUtils.arraySlice( inputAccessor.array, 0 ), + THREE.AnimationUtils.arraySlice( outputAccessor.array, 0 ), + interpolation + ); + + // Here is the trick to enable custom interpolation. + // Overrides .createInterpolant in a factory method which creates custom interpolation. + if ( sampler.interpolation === 'CUBICSPLINE' ) { + + track.createInterpolant = function InterpolantFactoryMethodGLTFCubicSpline( result ) { + + // A CUBICSPLINE keyframe in glTF has three output values for each input value, + // representing inTangent, splineVertex, and outTangent. As a result, track.getValueSize() + // must be divided by three to get the interpolant's sampleSize argument. + + return new GLTFCubicSplineInterpolant( this.times, this.values, this.getValueSize() / 3, result ); + + }; + + // Workaround, provide an alternate way to know if the interpolant type is cubis spline to track. + // track.getInterpolation() doesn't return valid value for custom interpolant. + track.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = true; + + } + + tracks.push( track ); + + } + + } + + var name = animationDef.name !== undefined ? animationDef.name : 'animation_' + animationIndex; + + return new THREE.AnimationClip( name, undefined, tracks ); + + } ); + + }; + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#nodes-and-hierarchy + * @param {number} nodeIndex + * @return {Promise} + */ + GLTFParser.prototype.loadNode = function ( nodeIndex ) { + + var json = this.json; + var extensions = this.extensions; + var parser = this; + + var meshReferences = json.meshReferences; + var meshUses = json.meshUses; + + var nodeDef = json.nodes[ nodeIndex ]; + + return ( function() { + + // .isBone isn't in glTF spec. See .markDefs + if ( nodeDef.isBone === true ) { + + return Promise.resolve( new THREE.Bone() ); + + } else if ( nodeDef.mesh !== undefined ) { + + return parser.getDependency( 'mesh', nodeDef.mesh ).then( function ( mesh ) { + + var node; + + if ( meshReferences[ nodeDef.mesh ] > 1 ) { + + var instanceNum = meshUses[ nodeDef.mesh ] ++; + + node = mesh.clone(); + node.name += '_instance_' + instanceNum; + + // onBeforeRender copy for Specular-Glossiness + node.onBeforeRender = mesh.onBeforeRender; + + for ( var i = 0, il = node.children.length; i < il; i ++ ) { + + node.children[ i ].name += '_instance_' + instanceNum; + node.children[ i ].onBeforeRender = mesh.children[ i ].onBeforeRender; + + } + + } else { + + node = mesh; + + } + + // if weights are provided on the node, override weights on the mesh. + if ( nodeDef.weights !== undefined ) { + + node.traverse( function ( o ) { + + if ( ! o.isMesh ) return; + + for ( var i = 0, il = nodeDef.weights.length; i < il; i ++ ) { + + o.morphTargetInfluences[ i ] = nodeDef.weights[ i ]; + + } + + } ); + + } + + return node; + + } ); + + } else if ( nodeDef.camera !== undefined ) { + + return parser.getDependency( 'camera', nodeDef.camera ); + + } else if ( nodeDef.extensions + && nodeDef.extensions[ EXTENSIONS.KHR_LIGHTS_PUNCTUAL ] + && nodeDef.extensions[ EXTENSIONS.KHR_LIGHTS_PUNCTUAL ].light !== undefined ) { + + return parser.getDependency( 'light', nodeDef.extensions[ EXTENSIONS.KHR_LIGHTS_PUNCTUAL ].light ); + + } else { + + return Promise.resolve( new THREE.Object3D() ); + + } + + }() ).then( function ( node ) { + + if ( nodeDef.name !== undefined ) { + + node.name = THREE.PropertyBinding.sanitizeNodeName( nodeDef.name ); + + } + + assignExtrasToUserData( node, nodeDef ); + + if ( nodeDef.extensions ) addUnknownExtensionsToUserData( extensions, node, nodeDef ); + + if ( nodeDef.matrix !== undefined ) { + + var matrix = new THREE.Matrix4(); + matrix.fromArray( nodeDef.matrix ); + node.applyMatrix( matrix ); + + } else { + + if ( nodeDef.translation !== undefined ) { + + node.position.fromArray( nodeDef.translation ); + + } + + if ( nodeDef.rotation !== undefined ) { + + node.quaternion.fromArray( nodeDef.rotation ); + + } + + if ( nodeDef.scale !== undefined ) { + + node.scale.fromArray( nodeDef.scale ); + + } + + } + + return node; + + } ); + + }; + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes + * @param {number} sceneIndex + * @return {Promise} + */ + GLTFParser.prototype.loadScene = function () { + + // scene node hierachy builder + + function buildNodeHierachy( nodeId, parentObject, json, parser ) { + + var nodeDef = json.nodes[ nodeId ]; + + return parser.getDependency( 'node', nodeId ).then( function ( node ) { + + if ( nodeDef.skin === undefined ) return node; + + // build skeleton here as well + + var skinEntry; + + return parser.getDependency( 'skin', nodeDef.skin ).then( function ( skin ) { + + skinEntry = skin; + + var pendingJoints = []; + + for ( var i = 0, il = skinEntry.joints.length; i < il; i ++ ) { + + pendingJoints.push( parser.getDependency( 'node', skinEntry.joints[ i ] ) ); + + } + + return Promise.all( pendingJoints ); + + } ).then( function ( jointNodes ) { + + var meshes = node.isGroup === true ? node.children : [ node ]; + + for ( var i = 0, il = meshes.length; i < il; i ++ ) { + + var mesh = meshes[ i ]; + + var bones = []; + var boneInverses = []; + + for ( var j = 0, jl = jointNodes.length; j < jl; j ++ ) { + + var jointNode = jointNodes[ j ]; + + if ( jointNode ) { + + bones.push( jointNode ); + + var mat = new THREE.Matrix4(); + + if ( skinEntry.inverseBindMatrices !== undefined ) { + + mat.fromArray( skinEntry.inverseBindMatrices.array, j * 16 ); + + } + + boneInverses.push( mat ); + + } else { + + console.warn( 'THREE.GLTFLoader: Joint "%s" could not be found.', skinEntry.joints[ j ] ); + + } + + } + + mesh.bind( new THREE.Skeleton( bones, boneInverses ), mesh.matrixWorld ); + + }; + + return node; + + } ); + + } ).then( function ( node ) { + + // build node hierachy + + parentObject.add( node ); + + var pending = []; + + if ( nodeDef.children ) { + + var children = nodeDef.children; + + for ( var i = 0, il = children.length; i < il; i ++ ) { + + var child = children[ i ]; + pending.push( buildNodeHierachy( child, node, json, parser ) ); + + } + + } + + return Promise.all( pending ); + + } ); + + } + + return function loadScene( sceneIndex ) { + + var json = this.json; + var extensions = this.extensions; + var sceneDef = this.json.scenes[ sceneIndex ]; + var parser = this; + + var scene = new THREE.Scene(); + if ( sceneDef.name !== undefined ) scene.name = sceneDef.name; + + assignExtrasToUserData( scene, sceneDef ); + + if ( sceneDef.extensions ) addUnknownExtensionsToUserData( extensions, scene, sceneDef ); + + var nodeIds = sceneDef.nodes || []; + + var pending = []; + + for ( var i = 0, il = nodeIds.length; i < il; i ++ ) { + + pending.push( buildNodeHierachy( nodeIds[ i ], scene, json, parser ) ); + + } + + return Promise.all( pending ).then( function () { + + return scene; + + } ); + + }; + + }(); + + return GLTFLoader; + +} )(); diff --git a/jsartoolkit5/examples/js/third_party/three.js/LICENSE.txt b/jsartoolkit5/examples/js/third_party/three.js/LICENSE.txt new file mode 100644 index 0000000..5604901 --- /dev/null +++ b/jsartoolkit5/examples/js/third_party/three.js/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License + +Copyright © 2010-2017 three.js authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/jsartoolkit5/examples/js/third_party/three.js/OrbitControls.js b/jsartoolkit5/examples/js/third_party/three.js/OrbitControls.js new file mode 100644 index 0000000..151f0c8 --- /dev/null +++ b/jsartoolkit5/examples/js/third_party/three.js/OrbitControls.js @@ -0,0 +1,1042 @@ +/** + * @author qiao / https://github.com/qiao + * @author mrdoob / http://mrdoob.com + * @author alteredq / http://alteredqualia.com/ + * @author WestLangley / http://github.com/WestLangley + * @author erich666 / http://erichaines.com + */ + +// This set of controls performs orbiting, dollying (zooming), and panning. +// Unlike TrackballControls, it maintains the "up" direction object.up (+Y by default). +// +// Orbit - left mouse / touch: one finger move +// Zoom - middle mouse, or mousewheel / touch: two finger spread or squish +// Pan - right mouse, or arrow keys / touch: three finger swipe + +THREE.OrbitControls = function ( object, domElement ) { + + this.object = object; + + this.domElement = ( domElement !== undefined ) ? domElement : document; + + // Set to false to disable this control + this.enabled = true; + + // "target" sets the location of focus, where the object orbits around + this.target = new THREE.Vector3(); + + // How far you can dolly in and out ( PerspectiveCamera only ) + this.minDistance = 0; + this.maxDistance = Infinity; + + // How far you can zoom in and out ( OrthographicCamera only ) + this.minZoom = 0; + this.maxZoom = Infinity; + + // How far you can orbit vertically, upper and lower limits. + // Range is 0 to Math.PI radians. + this.minPolarAngle = 0; // radians + this.maxPolarAngle = Math.PI; // radians + + // How far you can orbit horizontally, upper and lower limits. + // If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ]. + this.minAzimuthAngle = - Infinity; // radians + this.maxAzimuthAngle = Infinity; // radians + + // Set to true to enable damping (inertia) + // If damping is enabled, you must call controls.update() in your animation loop + this.enableDamping = false; + this.dampingFactor = 0.25; + + // This option actually enables dollying in and out; left as "zoom" for backwards compatibility. + // Set to false to disable zooming + this.enableZoom = true; + this.zoomSpeed = 1.0; + + // Set to false to disable rotating + this.enableRotate = true; + this.rotateSpeed = 1.0; + + // Set to false to disable panning + this.enablePan = true; + this.keyPanSpeed = 7.0; // pixels moved per arrow key push + + // Set to true to automatically rotate around the target + // If auto-rotate is enabled, you must call controls.update() in your animation loop + this.autoRotate = false; + this.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60 + + // Set to false to disable use of the keys + this.enableKeys = true; + + // The four arrow keys + this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 }; + + // Mouse buttons + this.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT }; + + // for reset + this.target0 = this.target.clone(); + this.position0 = this.object.position.clone(); + this.zoom0 = this.object.zoom; + + // + // public methods + // + + this.getPolarAngle = function () { + + return spherical.phi; + + }; + + this.getAzimuthalAngle = function () { + + return spherical.theta; + + }; + + this.saveState = function () { + + scope.target0.copy( scope.target ); + scope.position0.copy( scope.object.position ); + scope.zoom0 = scope.object.zoom; + + }; + + this.reset = function () { + + scope.target.copy( scope.target0 ); + scope.object.position.copy( scope.position0 ); + scope.object.zoom = scope.zoom0; + + scope.object.updateProjectionMatrix(); + scope.dispatchEvent( changeEvent ); + + scope.update(); + + state = STATE.NONE; + + }; + + // this method is exposed, but perhaps it would be better if we can make it private... + this.update = function () { + + var offset = new THREE.Vector3(); + + // so camera.up is the orbit axis + var quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 1, 0 ) ); + var quatInverse = quat.clone().inverse(); + + var lastPosition = new THREE.Vector3(); + var lastQuaternion = new THREE.Quaternion(); + + return function update() { + + var position = scope.object.position; + + offset.copy( position ).sub( scope.target ); + + // rotate offset to "y-axis-is-up" space + offset.applyQuaternion( quat ); + + // angle from z-axis around y-axis + spherical.setFromVector3( offset ); + + if ( scope.autoRotate && state === STATE.NONE ) { + + rotateLeft( getAutoRotationAngle() ); + + } + + spherical.theta += sphericalDelta.theta; + spherical.phi += sphericalDelta.phi; + + // restrict theta to be between desired limits + spherical.theta = Math.max( scope.minAzimuthAngle, Math.min( scope.maxAzimuthAngle, spherical.theta ) ); + + // restrict phi to be between desired limits + spherical.phi = Math.max( scope.minPolarAngle, Math.min( scope.maxPolarAngle, spherical.phi ) ); + + spherical.makeSafe(); + + + spherical.radius *= scale; + + // restrict radius to be between desired limits + spherical.radius = Math.max( scope.minDistance, Math.min( scope.maxDistance, spherical.radius ) ); + + // move target to panned location + scope.target.add( panOffset ); + + offset.setFromSpherical( spherical ); + + // rotate offset back to "camera-up-vector-is-up" space + offset.applyQuaternion( quatInverse ); + + position.copy( scope.target ).add( offset ); + + scope.object.lookAt( scope.target ); + + if ( scope.enableDamping === true ) { + + sphericalDelta.theta *= ( 1 - scope.dampingFactor ); + sphericalDelta.phi *= ( 1 - scope.dampingFactor ); + + } else { + + sphericalDelta.set( 0, 0, 0 ); + + } + + scale = 1; + panOffset.set( 0, 0, 0 ); + + // update condition is: + // min(camera displacement, camera rotation in radians)^2 > EPS + // using small-angle approximation cos(x/2) = 1 - x^2 / 8 + + if ( zoomChanged || + lastPosition.distanceToSquared( scope.object.position ) > EPS || + 8 * ( 1 - lastQuaternion.dot( scope.object.quaternion ) ) > EPS ) { + + scope.dispatchEvent( changeEvent ); + + lastPosition.copy( scope.object.position ); + lastQuaternion.copy( scope.object.quaternion ); + zoomChanged = false; + + return true; + + } + + return false; + + }; + + }(); + + this.dispose = function () { + + scope.domElement.removeEventListener( 'contextmenu', onContextMenu, false ); + scope.domElement.removeEventListener( 'mousedown', onMouseDown, false ); + scope.domElement.removeEventListener( 'wheel', onMouseWheel, false ); + + scope.domElement.removeEventListener( 'touchstart', onTouchStart, false ); + scope.domElement.removeEventListener( 'touchend', onTouchEnd, false ); + scope.domElement.removeEventListener( 'touchmove', onTouchMove, false ); + + document.removeEventListener( 'mousemove', onMouseMove, false ); + document.removeEventListener( 'mouseup', onMouseUp, false ); + + window.removeEventListener( 'keydown', onKeyDown, false ); + + //scope.dispatchEvent( { type: 'dispose' } ); // should this be added here? + + }; + + // + // internals + // + + var scope = this; + + var changeEvent = { type: 'change' }; + var startEvent = { type: 'start' }; + var endEvent = { type: 'end' }; + + var STATE = { NONE: - 1, ROTATE: 0, DOLLY: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_DOLLY: 4, TOUCH_PAN: 5 }; + + var state = STATE.NONE; + + var EPS = 0.000001; + + // current position in spherical coordinates + var spherical = new THREE.Spherical(); + var sphericalDelta = new THREE.Spherical(); + + var scale = 1; + var panOffset = new THREE.Vector3(); + var zoomChanged = false; + + var rotateStart = new THREE.Vector2(); + var rotateEnd = new THREE.Vector2(); + var rotateDelta = new THREE.Vector2(); + + var panStart = new THREE.Vector2(); + var panEnd = new THREE.Vector2(); + var panDelta = new THREE.Vector2(); + + var dollyStart = new THREE.Vector2(); + var dollyEnd = new THREE.Vector2(); + var dollyDelta = new THREE.Vector2(); + + function getAutoRotationAngle() { + + return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed; + + } + + function getZoomScale() { + + return Math.pow( 0.95, scope.zoomSpeed ); + + } + + function rotateLeft( angle ) { + + sphericalDelta.theta -= angle; + + } + + function rotateUp( angle ) { + + sphericalDelta.phi -= angle; + + } + + var panLeft = function () { + + var v = new THREE.Vector3(); + + return function panLeft( distance, objectMatrix ) { + + v.setFromMatrixColumn( objectMatrix, 0 ); // get X column of objectMatrix + v.multiplyScalar( - distance ); + + panOffset.add( v ); + + }; + + }(); + + var panUp = function () { + + var v = new THREE.Vector3(); + + return function panUp( distance, objectMatrix ) { + + v.setFromMatrixColumn( objectMatrix, 1 ); // get Y column of objectMatrix + v.multiplyScalar( distance ); + + panOffset.add( v ); + + }; + + }(); + + // deltaX and deltaY are in pixels; right and down are positive + var pan = function () { + + var offset = new THREE.Vector3(); + + return function pan( deltaX, deltaY ) { + + var element = scope.domElement === document ? scope.domElement.body : scope.domElement; + + if ( scope.object instanceof THREE.PerspectiveCamera ) { + + // perspective + var position = scope.object.position; + offset.copy( position ).sub( scope.target ); + var targetDistance = offset.length(); + + // half of the fov is center to top of screen + targetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 ); + + // we actually don't use screenWidth, since perspective camera is fixed to screen height + panLeft( 2 * deltaX * targetDistance / element.clientHeight, scope.object.matrix ); + panUp( 2 * deltaY * targetDistance / element.clientHeight, scope.object.matrix ); + + } else if ( scope.object instanceof THREE.OrthographicCamera ) { + + // orthographic + panLeft( deltaX * ( scope.object.right - scope.object.left ) / scope.object.zoom / element.clientWidth, scope.object.matrix ); + panUp( deltaY * ( scope.object.top - scope.object.bottom ) / scope.object.zoom / element.clientHeight, scope.object.matrix ); + + } else { + + // camera neither orthographic nor perspective + console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' ); + scope.enablePan = false; + + } + + }; + + }(); + + function dollyIn( dollyScale ) { + + if ( scope.object instanceof THREE.PerspectiveCamera ) { + + scale /= dollyScale; + + } else if ( scope.object instanceof THREE.OrthographicCamera ) { + + scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom * dollyScale ) ); + scope.object.updateProjectionMatrix(); + zoomChanged = true; + + } else { + + console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' ); + scope.enableZoom = false; + + } + + } + + function dollyOut( dollyScale ) { + + if ( scope.object instanceof THREE.PerspectiveCamera ) { + + scale *= dollyScale; + + } else if ( scope.object instanceof THREE.OrthographicCamera ) { + + scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / dollyScale ) ); + scope.object.updateProjectionMatrix(); + zoomChanged = true; + + } else { + + console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' ); + scope.enableZoom = false; + + } + + } + + // + // event callbacks - update the object state + // + + function handleMouseDownRotate( event ) { + + //console.log( 'handleMouseDownRotate' ); + + rotateStart.set( event.clientX, event.clientY ); + + } + + function handleMouseDownDolly( event ) { + + //console.log( 'handleMouseDownDolly' ); + + dollyStart.set( event.clientX, event.clientY ); + + } + + function handleMouseDownPan( event ) { + + //console.log( 'handleMouseDownPan' ); + + panStart.set( event.clientX, event.clientY ); + + } + + function handleMouseMoveRotate( event ) { + + //console.log( 'handleMouseMoveRotate' ); + + rotateEnd.set( event.clientX, event.clientY ); + rotateDelta.subVectors( rotateEnd, rotateStart ); + + var element = scope.domElement === document ? scope.domElement.body : scope.domElement; + + // rotating across whole screen goes 360 degrees around + rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed ); + + // rotating up and down along whole screen attempts to go 360, but limited to 180 + rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed ); + + rotateStart.copy( rotateEnd ); + + scope.update(); + + } + + function handleMouseMoveDolly( event ) { + + //console.log( 'handleMouseMoveDolly' ); + + dollyEnd.set( event.clientX, event.clientY ); + + dollyDelta.subVectors( dollyEnd, dollyStart ); + + if ( dollyDelta.y > 0 ) { + + dollyIn( getZoomScale() ); + + } else if ( dollyDelta.y < 0 ) { + + dollyOut( getZoomScale() ); + + } + + dollyStart.copy( dollyEnd ); + + scope.update(); + + } + + function handleMouseMovePan( event ) { + + //console.log( 'handleMouseMovePan' ); + + panEnd.set( event.clientX, event.clientY ); + + panDelta.subVectors( panEnd, panStart ); + + pan( panDelta.x, panDelta.y ); + + panStart.copy( panEnd ); + + scope.update(); + + } + + function handleMouseUp( event ) { + + // console.log( 'handleMouseUp' ); + + } + + function handleMouseWheel( event ) { + + // console.log( 'handleMouseWheel' ); + + if ( event.deltaY < 0 ) { + + dollyOut( getZoomScale() ); + + } else if ( event.deltaY > 0 ) { + + dollyIn( getZoomScale() ); + + } + + scope.update(); + + } + + function handleKeyDown( event ) { + + //console.log( 'handleKeyDown' ); + + switch ( event.keyCode ) { + + case scope.keys.UP: + pan( 0, scope.keyPanSpeed ); + scope.update(); + break; + + case scope.keys.BOTTOM: + pan( 0, - scope.keyPanSpeed ); + scope.update(); + break; + + case scope.keys.LEFT: + pan( scope.keyPanSpeed, 0 ); + scope.update(); + break; + + case scope.keys.RIGHT: + pan( - scope.keyPanSpeed, 0 ); + scope.update(); + break; + + } + + } + + function handleTouchStartRotate( event ) { + + //console.log( 'handleTouchStartRotate' ); + + rotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); + + } + + function handleTouchStartDolly( event ) { + + //console.log( 'handleTouchStartDolly' ); + + var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX; + var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY; + + var distance = Math.sqrt( dx * dx + dy * dy ); + + dollyStart.set( 0, distance ); + + } + + function handleTouchStartPan( event ) { + + //console.log( 'handleTouchStartPan' ); + + panStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); + + } + + function handleTouchMoveRotate( event ) { + + //console.log( 'handleTouchMoveRotate' ); + + rotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); + rotateDelta.subVectors( rotateEnd, rotateStart ); + + var element = scope.domElement === document ? scope.domElement.body : scope.domElement; + + // rotating across whole screen goes 360 degrees around + rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed ); + + // rotating up and down along whole screen attempts to go 360, but limited to 180 + rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed ); + + rotateStart.copy( rotateEnd ); + + scope.update(); + + } + + function handleTouchMoveDolly( event ) { + + //console.log( 'handleTouchMoveDolly' ); + + var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX; + var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY; + + var distance = Math.sqrt( dx * dx + dy * dy ); + + dollyEnd.set( 0, distance ); + + dollyDelta.subVectors( dollyEnd, dollyStart ); + + if ( dollyDelta.y > 0 ) { + + dollyOut( getZoomScale() ); + + } else if ( dollyDelta.y < 0 ) { + + dollyIn( getZoomScale() ); + + } + + dollyStart.copy( dollyEnd ); + + scope.update(); + + } + + function handleTouchMovePan( event ) { + + //console.log( 'handleTouchMovePan' ); + + panEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); + + panDelta.subVectors( panEnd, panStart ); + + pan( panDelta.x, panDelta.y ); + + panStart.copy( panEnd ); + + scope.update(); + + } + + function handleTouchEnd( event ) { + + //console.log( 'handleTouchEnd' ); + + } + + // + // event handlers - FSM: listen for events and reset state + // + + function onMouseDown( event ) { + + if ( scope.enabled === false ) return; + + event.preventDefault(); + + switch ( event.button ) { + + case scope.mouseButtons.ORBIT: + + if ( scope.enableRotate === false ) return; + + handleMouseDownRotate( event ); + + state = STATE.ROTATE; + + break; + + case scope.mouseButtons.ZOOM: + + if ( scope.enableZoom === false ) return; + + handleMouseDownDolly( event ); + + state = STATE.DOLLY; + + break; + + case scope.mouseButtons.PAN: + + if ( scope.enablePan === false ) return; + + handleMouseDownPan( event ); + + state = STATE.PAN; + + break; + + } + + if ( state !== STATE.NONE ) { + + document.addEventListener( 'mousemove', onMouseMove, false ); + document.addEventListener( 'mouseup', onMouseUp, false ); + + scope.dispatchEvent( startEvent ); + + } + + } + + function onMouseMove( event ) { + + if ( scope.enabled === false ) return; + + event.preventDefault(); + + switch ( state ) { + + case STATE.ROTATE: + + if ( scope.enableRotate === false ) return; + + handleMouseMoveRotate( event ); + + break; + + case STATE.DOLLY: + + if ( scope.enableZoom === false ) return; + + handleMouseMoveDolly( event ); + + break; + + case STATE.PAN: + + if ( scope.enablePan === false ) return; + + handleMouseMovePan( event ); + + break; + + } + + } + + function onMouseUp( event ) { + + if ( scope.enabled === false ) return; + + handleMouseUp( event ); + + document.removeEventListener( 'mousemove', onMouseMove, false ); + document.removeEventListener( 'mouseup', onMouseUp, false ); + + scope.dispatchEvent( endEvent ); + + state = STATE.NONE; + + } + + function onMouseWheel( event ) { + + if ( scope.enabled === false || scope.enableZoom === false || ( state !== STATE.NONE && state !== STATE.ROTATE ) ) return; + + event.preventDefault(); + event.stopPropagation(); + + handleMouseWheel( event ); + + scope.dispatchEvent( startEvent ); // not sure why these are here... + scope.dispatchEvent( endEvent ); + + } + + function onKeyDown( event ) { + + if ( scope.enabled === false || scope.enableKeys === false || scope.enablePan === false ) return; + + handleKeyDown( event ); + + } + + function onTouchStart( event ) { + + if ( scope.enabled === false ) return; + + switch ( event.touches.length ) { + + case 1: // one-fingered touch: rotate + + if ( scope.enableRotate === false ) return; + + handleTouchStartRotate( event ); + + state = STATE.TOUCH_ROTATE; + + break; + + case 2: // two-fingered touch: dolly + + if ( scope.enableZoom === false ) return; + + handleTouchStartDolly( event ); + + state = STATE.TOUCH_DOLLY; + + break; + + case 3: // three-fingered touch: pan + + if ( scope.enablePan === false ) return; + + handleTouchStartPan( event ); + + state = STATE.TOUCH_PAN; + + break; + + default: + + state = STATE.NONE; + + } + + if ( state !== STATE.NONE ) { + + scope.dispatchEvent( startEvent ); + + } + + } + + function onTouchMove( event ) { + + if ( scope.enabled === false ) return; + + event.preventDefault(); + event.stopPropagation(); + + switch ( event.touches.length ) { + + case 1: // one-fingered touch: rotate + + if ( scope.enableRotate === false ) return; + if ( state !== STATE.TOUCH_ROTATE ) return; // is this needed?... + + handleTouchMoveRotate( event ); + + break; + + case 2: // two-fingered touch: dolly + + if ( scope.enableZoom === false ) return; + if ( state !== STATE.TOUCH_DOLLY ) return; // is this needed?... + + handleTouchMoveDolly( event ); + + break; + + case 3: // three-fingered touch: pan + + if ( scope.enablePan === false ) return; + if ( state !== STATE.TOUCH_PAN ) return; // is this needed?... + + handleTouchMovePan( event ); + + break; + + default: + + state = STATE.NONE; + + } + + } + + function onTouchEnd( event ) { + + if ( scope.enabled === false ) return; + + handleTouchEnd( event ); + + scope.dispatchEvent( endEvent ); + + state = STATE.NONE; + + } + + function onContextMenu( event ) { + + if ( scope.enabled === false ) return; + + event.preventDefault(); + + } + + // + + scope.domElement.addEventListener( 'contextmenu', onContextMenu, false ); + + scope.domElement.addEventListener( 'mousedown', onMouseDown, false ); + scope.domElement.addEventListener( 'wheel', onMouseWheel, false ); + + scope.domElement.addEventListener( 'touchstart', onTouchStart, false ); + scope.domElement.addEventListener( 'touchend', onTouchEnd, false ); + scope.domElement.addEventListener( 'touchmove', onTouchMove, false ); + + window.addEventListener( 'keydown', onKeyDown, false ); + + // force an update at start + + this.update(); + +}; + +THREE.OrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype ); +THREE.OrbitControls.prototype.constructor = THREE.OrbitControls; + +Object.defineProperties( THREE.OrbitControls.prototype, { + + center: { + + get: function () { + + console.warn( 'THREE.OrbitControls: .center has been renamed to .target' ); + return this.target; + + } + + }, + + // backward compatibility + + noZoom: { + + get: function () { + + console.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' ); + return ! this.enableZoom; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' ); + this.enableZoom = ! value; + + } + + }, + + noRotate: { + + get: function () { + + console.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' ); + return ! this.enableRotate; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' ); + this.enableRotate = ! value; + + } + + }, + + noPan: { + + get: function () { + + console.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' ); + return ! this.enablePan; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' ); + this.enablePan = ! value; + + } + + }, + + noKeys: { + + get: function () { + + console.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' ); + return ! this.enableKeys; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' ); + this.enableKeys = ! value; + + } + + }, + + staticMoving: { + + get: function () { + + console.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' ); + return ! this.enableDamping; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' ); + this.enableDamping = ! value; + + } + + }, + + dynamicDampingFactor: { + + get: function () { + + console.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' ); + return this.dampingFactor; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' ); + this.dampingFactor = value; + + } + + } + +} ); diff --git a/jsartoolkit5/examples/js/third_party/three.js/stats.min.js b/jsartoolkit5/examples/js/third_party/three.js/stats.min.js new file mode 100644 index 0000000..3ddf1e5 --- /dev/null +++ b/jsartoolkit5/examples/js/third_party/three.js/stats.min.js @@ -0,0 +1,5 @@ +// stats.js - http://github.com/mrdoob/stats.js +(function(f,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"===typeof define&&define.amd?define(e):f.Stats=e()})(this,function(){var f=function(){function e(a){c.appendChild(a.dom);return a}function u(a){for(var d=0;d=g+1E3&&(r.update(1E3*a/(c-g),100),g=c,a=0,t)){var d=performance.memory;t.update(d.usedJSHeapSize/ +1048576,d.jsHeapSizeLimit/1048576)}return c},update:function(){k=this.end()},domElement:c,setMode:u}};f.Panel=function(e,f,l){var c=Infinity,k=0,g=Math.round,a=g(window.devicePixelRatio||1),r=80*a,h=48*a,t=3*a,v=2*a,d=3*a,m=15*a,n=74*a,p=30*a,q=document.createElement("canvas");q.width=r;q.height=h;q.style.cssText="width:80px;height:48px";var b=q.getContext("2d");b.font="bold "+9*a+"px Helvetica,Arial,sans-serif";b.textBaseline="top";b.fillStyle=l;b.fillRect(0,0,r,h);b.fillStyle=f;b.fillText(e,t,v); +b.fillRect(d,m,n,p);b.fillStyle=l;b.globalAlpha=.9;b.fillRect(d,m,n,p);return{dom:q,update:function(h,w){c=Math.min(c,h);k=Math.max(k,h);b.fillStyle=l;b.globalAlpha=1;b.fillRect(0,0,r,m);b.fillStyle=f;b.fillText(g(h)+" "+e+" ("+g(c)+"-"+g(k)+")",t,v);b.drawImage(q,d+a,m,n-a,p,d,m,n-a,p);b.fillRect(d+n-a,m,a,p);b.fillStyle=l;b.globalAlpha=.9;b.fillRect(d+n-a,m,a,g((1-h/w)*p))}}};return f}); diff --git a/jsartoolkit5/examples/js/third_party/three.js/three.min.js b/jsartoolkit5/examples/js/third_party/three.js/three.min.js new file mode 100644 index 0000000..a1b5bce --- /dev/null +++ b/jsartoolkit5/examples/js/third_party/three.js/three.min.js @@ -0,0 +1,975 @@ +// threejs.org/license +(function(l,ta){"object"===typeof exports&&"undefined"!==typeof module?ta(exports):"function"===typeof define&&define.amd?define(["exports"],ta):(l=l||self,ta(l.THREE={}))})(this,function(l){function ta(){}function B(a,b){this.x=a||0;this.y=b||0}function aa(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._w=void 0!==d?d:1}function n(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}function ba(){this.elements=[1,0,0,0,1,0,0,0,1];0b&&(b=a[c]);return b}function z(){Object.defineProperty(this,"id",{value:Yf+=2});this.uuid=K.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity};this.userData={}} +function Rb(a,b,c,d,e,f){N.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.fromBufferGeometry(new ub(a,b,c,d,e,f));this.mergeVertices()}function ub(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,l,ua,F,Zf){var r=f/ua,u=g/F,x=f/2,w=g/2,A=l/2;g=ua+1;var y=F+1,X=f=0,Q,J,D=new n;for(J=0;Jm;m++){if(q=d[m])if(h=q[0],k=q[1]){p&&e.addAttribute("morphTarget"+m, +p[h]);f&&e.addAttribute("morphNormal"+m,f[h]);c[m]=k;continue}c[m]=0}g.getUniforms().setValue(a,"morphTargetInfluences",c)}}}function kg(a,b){var c={};return{update:function(d){var e=b.render.frame,f=d.geometry,g=a.get(d,f);c[g.id]!==e&&(f.isGeometry&&g.updateFromObject(d),a.update(g),c[g.id]=e);return g},dispose:function(){c={}}}}function bb(a,b,c,d,e,f,g,h,k,m){a=void 0!==a?a:[];W.call(this,a,void 0!==b?b:301,c,d,e,f,void 0!==g?g:1022,h,k,m);this.flipY=!1}function Sb(a,b,c,d){W.call(this,null); +this.image={data:a,width:b,height:c,depth:d};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1}function Tb(a,b,c,d){W.call(this,null);this.image={data:a,width:b,height:c,depth:d};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1}function Ub(a,b,c){var d=a[0];if(0>=d||0/gm,function(a,c){a=T[c];if(void 0===a)throw Error("Can not resolve #include <"+c+">");return ee(a)})}function kf(a){return a.replace(/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g, +function(a,c,d,e){a="";for(c=parseInt(c);cd||a.height>d)e=d/Math.max(a.width,a.height);if(1>e||!0===b){if("undefined"!==typeof HTMLImageElement&&a instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&a instanceof ImageBitmap)return d=b?K.floorPowerOfTwo:Math.floor,b=d(e*a.width),e=d(e*a.height), +void 0===C&&(C=h(b,e)),c=c?h(b,e):C,c.width=b,c.height=e,c.getContext("2d").drawImage(a,0,0,b,e),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+a.width+"x"+a.height+") to ("+b+"x"+e+")."),c;"data"in a&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+a.width+"x"+a.height+").")}return a}function m(a){return K.isPowerOfTwo(a.width)&&K.isPowerOfTwo(a.height)}function p(a,b){return a.generateMipmaps&&b&&1003!==a.minFilter&&1006!==a.minFilter}function q(b,c,e, +f){a.generateMipmap(b);d.get(c).__maxMipLevel=Math.log(Math.max(e,f))*Math.LOG2E}function v(a,c){if(!e.isWebGL2)return a;var d=a;6403===a&&(5126===c&&(d=33326),5131===c&&(d=33325),5121===c&&(d=33321));6407===a&&(5126===c&&(d=34837),5131===c&&(d=34843),5121===c&&(d=32849));6408===a&&(5126===c&&(d=34836),5131===c&&(d=34842),5121===c&&(d=32856));33325===d||33326===d||34842===d||34836===d?b.get("EXT_color_buffer_float"):(34843===d||34837===d)&&console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."); +return d}function l(a){return 1003===a||1004===a||1005===a?9728:9729}function r(b){b=b.target;b.removeEventListener("dispose",r);var c=d.get(b);void 0!==c.__webglInit&&(a.deleteTexture(c.__webglTexture),d.remove(b));b.isVideoTexture&&delete E[b.id];g.memory.textures--}function u(b){b=b.target;b.removeEventListener("dispose",u);var c=d.get(b),e=d.get(b.texture);if(b){void 0!==e.__webglTexture&&a.deleteTexture(e.__webglTexture);b.depthTexture&&b.depthTexture.dispose();if(b.isWebGLRenderTargetCube)for(e= +0;6>e;e++)a.deleteFramebuffer(c.__webglFramebuffer[e]),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer[e]);else a.deleteFramebuffer(c.__webglFramebuffer),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer);d.remove(b.texture);d.remove(b)}g.memory.textures--}function n(a,b){var e=d.get(a);if(a.isVideoTexture){var f=a.id,h=g.render.frame;E[f]!==h&&(E[f]=h,a.update())}if(0r;r++)t[r]=g||l?l?b.image[r].image: +b.image[r]:k(b.image[r],!1,!0,e.maxCubemapSize);var u=t[0],n=m(u)||e.isWebGL2,x=f.convert(b.format),w=f.convert(b.type),Q=v(x,w);y(34067,b,n);for(r=0;6>r;r++)if(g)for(var X,J=t[r].mipmaps,A=0,F=J.length;A=e.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+a+" texture units while this GPU supports only "+e.maxTextures);z+=1;return a};this.resetTextureUnits=function(){z=0};this.setTexture2D=n;this.setTexture2DArray=function(a,b){var e=d.get(a);0r;r++)h.__webglFramebuffer[r]=a.createFramebuffer();else if(h.__webglFramebuffer=a.createFramebuffer(),r)if(e.isWebGL2){h.__webglMultisampledFramebuffer= +a.createFramebuffer();h.__webglColorRenderbuffer=a.createRenderbuffer();a.bindRenderbuffer(36161,h.__webglColorRenderbuffer);r=f.convert(b.texture.format);var x=f.convert(b.texture.type);r=v(r,x);x=B(b);a.renderbufferStorageMultisample(36161,x,r,b.width,b.height);a.bindFramebuffer(36160,h.__webglMultisampledFramebuffer);a.framebufferRenderbuffer(36160,36064,36161,h.__webglColorRenderbuffer);a.bindRenderbuffer(36161,null);b.depthBuffer&&(h.__webglDepthRenderbuffer=a.createRenderbuffer(),F(h.__webglDepthRenderbuffer, +b,!0));a.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(l){c.bindTexture(34067,k.__webglTexture);y(34067,b.texture,t);for(r=0;6>r;r++)ua(h.__webglFramebuffer[r],b,36064,34069+r);p(b.texture,t)&&q(34067,b.texture,b.width,b.height);c.bindTexture(34067,null)}else c.bindTexture(3553,k.__webglTexture),y(3553,b.texture,t),ua(h.__webglFramebuffer,b,36064,3553),p(b.texture,t)&&q(3553,b.texture,b.width,b.height),c.bindTexture(3553, +null);if(b.depthBuffer){h=d.get(b);k=!0===b.isWebGLRenderTargetCube;if(b.depthTexture){if(k)throw Error("target.depthTexture not supported in Cube render targets");if(b&&b.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported");a.bindFramebuffer(36160,h.__webglFramebuffer);if(!b.depthTexture||!b.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");d.get(b.depthTexture).__webglTexture&&b.depthTexture.image.width=== +b.width&&b.depthTexture.image.height===b.height||(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0);n(b.depthTexture,0);h=d.get(b.depthTexture).__webglTexture;if(1026===b.depthTexture.format)a.framebufferTexture2D(36160,36096,3553,h,0);else if(1027===b.depthTexture.format)a.framebufferTexture2D(36160,33306,3553,h,0);else throw Error("Unknown depthTexture format");}else if(k)for(h.__webglDepthbuffer=[],k=0;6>k;k++)a.bindFramebuffer(36160,h.__webglFramebuffer[k]), +h.__webglDepthbuffer[k]=a.createRenderbuffer(),F(h.__webglDepthbuffer[k],b);else a.bindFramebuffer(36160,h.__webglFramebuffer),h.__webglDepthbuffer=a.createRenderbuffer(),F(h.__webglDepthbuffer,b);a.bindFramebuffer(36160,null)}};this.updateRenderTargetMipmap=function(a){var b=a.texture,f=m(a)||e.isWebGL2;if(p(b,f)){f=a.isWebGLRenderTargetCube?34067:3553;var g=d.get(b).__webglTexture;c.bindTexture(f,g);q(f,b,a.width,a.height);c.bindTexture(f,null)}};this.updateMultisampleRenderTarget=function(b){if(b.isWebGLMultisampleRenderTarget)if(e.isWebGL2){var c= +d.get(b);a.bindFramebuffer(36008,c.__webglMultisampledFramebuffer);a.bindFramebuffer(36009,c.__webglFramebuffer);c=b.width;var f=b.height,g=16384;b.depthBuffer&&(g|=256);b.stencilBuffer&&(g|=1024);a.blitFramebuffer(0,0,c,f,0,0,c,f,g,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")};this.safeSetTexture2D=function(a,b){a&&a.isWebGLRenderTarget&&(!1===G&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."), +G=!0),a=a.texture);n(a,b)};this.safeSetTextureCube=function(a,b){a&&a.isWebGLRenderTargetCube&&(!1===I&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),I=!0),a=a.texture);a&&a.isCubeTexture||Array.isArray(a.image)&&6===a.image.length?A(a,b):w(a,b)}}function pf(a,b,c){return{convert:function(a){if(1E3===a)return 10497;if(1001===a)return 33071;if(1002===a)return 33648;if(1003===a)return 9728;if(1004===a)return 9984; +if(1005===a)return 9986;if(1006===a)return 9729;if(1007===a)return 9985;if(1008===a)return 9987;if(1009===a)return 5121;if(1017===a)return 32819;if(1018===a)return 32820;if(1019===a)return 33635;if(1010===a)return 5120;if(1011===a)return 5122;if(1012===a)return 5123;if(1013===a)return 5124;if(1014===a)return 5125;if(1015===a)return 5126;if(1016===a){if(c.isWebGL2)return 5131;var d=b.get("OES_texture_half_float");if(null!==d)return d.HALF_FLOAT_OES}if(1021===a)return 6406;if(1022===a)return 6407;if(1023=== +a)return 6408;if(1024===a)return 6409;if(1025===a)return 6410;if(1026===a)return 6402;if(1027===a)return 34041;if(1028===a)return 6403;if(100===a)return 32774;if(101===a)return 32778;if(102===a)return 32779;if(200===a)return 0;if(201===a)return 1;if(202===a)return 768;if(203===a)return 769;if(204===a)return 770;if(205===a)return 771;if(206===a)return 772;if(207===a)return 773;if(208===a)return 774;if(209===a)return 775;if(210===a)return 776;if(33776===a||33777===a||33778===a||33779===a)if(d=b.get("WEBGL_compressed_texture_s3tc"), +null!==d){if(33776===a)return d.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===a)return d.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===a)return d.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===a)return d.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===a||35841===a||35842===a||35843===a)if(d=b.get("WEBGL_compressed_texture_pvrtc"),null!==d){if(35840===a)return d.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===a)return d.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===a)return d.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===a)return d.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196=== +a&&(d=b.get("WEBGL_compressed_texture_etc1"),null!==d))return d.COMPRESSED_RGB_ETC1_WEBGL;if(37808===a||37809===a||37810===a||37811===a||37812===a||37813===a||37814===a||37815===a||37816===a||37817===a||37818===a||37819===a||37820===a||37821===a)if(d=b.get("WEBGL_compressed_texture_astc"),null!==d)return a;if(103===a||104===a){if(c.isWebGL2){if(103===a)return 32775;if(104===a)return 32776}d=b.get("EXT_blend_minmax");if(null!==d){if(103===a)return d.MIN_EXT;if(104===a)return d.MAX_EXT}}if(1020===a){if(c.isWebGL2)return 34042; +d=b.get("WEBGL_depth_texture");if(null!==d)return d.UNSIGNED_INT_24_8_WEBGL}return 0}}}function Vb(){C.call(this);this.type="Group"}function Xa(){C.call(this);this.type="Camera";this.matrixWorldInverse=new P;this.projectionMatrix=new P;this.projectionMatrixInverse=new P}function ja(a,b,c,d){Xa.call(this);this.type="PerspectiveCamera";this.fov=void 0!==a?a:50;this.zoom=1;this.near=void 0!==c?c:.1;this.far=void 0!==d?d:2E3;this.focus=10;this.aspect=void 0!==b?b:1;this.view=null;this.filmGauge=35;this.filmOffset= +0;this.updateProjectionMatrix()}function Gc(a){ja.call(this);this.cameras=a||[]}function qf(a,b,c){rf.setFromMatrixPosition(b.matrixWorld);sf.setFromMatrixPosition(c.matrixWorld);var d=rf.distanceTo(sf),e=b.projectionMatrix.elements,f=c.projectionMatrix.elements,g=e[14]/(e[10]-1);c=e[14]/(e[10]+1);var h=(e[9]+1)/e[5],k=(e[9]-1)/e[5],m=(e[8]-1)/e[0],p=(f[8]+1)/f[0];e=g*m;f=g*p;p=d/(-m+p);m=p*-m;b.matrixWorld.decompose(a.position,a.quaternion,a.scale);a.translateX(m);a.translateZ(p);a.matrixWorld.compose(a.position, +a.quaternion,a.scale);a.matrixWorldInverse.getInverse(a.matrixWorld);b=g+p;g=c+p;a.projectionMatrix.makePerspective(e-m,f+(d-m),h*c/g*b,k*c/g*b,b,g)}function tf(a){function b(){return null!==e&&!0===e.isPresenting}function c(){if(b()){var c=e.getEyeParameters("left"),f=c.renderWidth*p;c=c.renderHeight*p;y=a.getPixelRatio();a.getSize(w);a.setDrawingBufferSize(2*f,c,1);J.start()}else d.enabled&&a.setDrawingBufferSize(w.width,w.height,y),J.stop()}var d=this,e=null,f=null,g=null,h=[],k=new P,m=new P, +p=1,q="stage";"undefined"!==typeof window&&"VRFrameData"in window&&(f=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",c,!1));var v=new P,l=new aa,r=new n,u=new ja;u.bounds=new Y(0,0,.5,1);u.layers.enable(1);var x=new ja;x.bounds=new Y(.5,0,.5,1);x.layers.enable(2);var A=new Gc([u,x]);A.layers.enable(1);A.layers.enable(2);var w=new B,y,D=[];this.enabled=!1;this.getController=function(a){var b=h[a];void 0===b&&(b=new Vb,b.matrixAutoUpdate=!1,b.visible=!1,h[a]=b);return b};this.getDevice= +function(){return e};this.setDevice=function(a){void 0!==a&&(e=a);J.setContext(a)};this.setFramebufferScaleFactor=function(a){p=a};this.setFrameOfReferenceType=function(a){q=a};this.setPoseTarget=function(a){void 0!==a&&(g=a)};this.getCamera=function(a){var c="stage"===q?1.6:0;if(!1===b())return a.position.set(0,c,0),a.rotation.set(0,0,0),a;e.depthNear=a.near;e.depthFar=a.far;e.getFrameData(f);if("stage"===q){var d=e.stageParameters;d?k.fromArray(d.sittingToStandingTransform):k.makeTranslation(0, +c,0)}c=f.pose;d=null!==g?g:a;d.matrix.copy(k);d.matrix.decompose(d.position,d.quaternion,d.scale);null!==c.orientation&&(l.fromArray(c.orientation),d.quaternion.multiply(l));null!==c.position&&(l.setFromRotationMatrix(k),r.fromArray(c.position),r.applyQuaternion(l),d.position.add(r));d.updateMatrixWorld();u.near=a.near;x.near=a.near;u.far=a.far;x.far=a.far;u.matrixWorldInverse.fromArray(f.leftViewMatrix);x.matrixWorldInverse.fromArray(f.rightViewMatrix);m.getInverse(k);"stage"===q&&(u.matrixWorldInverse.multiply(m), +x.matrixWorldInverse.multiply(m));a=d.parent;null!==a&&(v.getInverse(a.matrixWorld),u.matrixWorldInverse.multiply(v),x.matrixWorldInverse.multiply(v));u.matrixWorld.getInverse(u.matrixWorldInverse);x.matrixWorld.getInverse(x.matrixWorldInverse);u.projectionMatrix.fromArray(f.leftProjectionMatrix);x.projectionMatrix.fromArray(f.rightProjectionMatrix);qf(A,u,x);a=e.getLayers();a.length&&(a=a[0],null!==a.leftBounds&&4===a.leftBounds.length&&u.bounds.fromArray(a.leftBounds),null!==a.rightBounds&&4=== +a.rightBounds.length&&x.bounds.fromArray(a.rightBounds));a:for(a=0;af.matrixWorld.determinant();ca.setMaterial(e,h);var k=l(a,c,e,f),m=!1;if(b!==d.id||O!==k.id||da!==(!0===e.wireframe))b=d.id,O=k.id,da=!0===e.wireframe,m=!0;f.morphTargetInfluences&&(va.update(f,d,e,k),m=!0);h=d.index;var p=d.attributes.position;c=1;!0===e.wireframe&&(h=sa.getWireframeAttribute(d),c=2);a=wa;if(null!==h){var q=pa.get(h);a=ya;a.setIndex(q)}if(m){if(d&& +d.isInstancedBufferGeometry&&!Aa.isWebGL2&&null===na.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{ca.initAttributes();m=d.attributes;k=k.getAttributes();var v=e.defaultAttributeValues;for(D in k){var r=k[D];if(0<=r){var t=m[D];if(void 0!==t){var n=t.normalized,u=t.itemSize,x=pa.get(t);if(void 0!==x){var w=x.buffer,A=x.type;x=x.bytesPerElement;if(t.isInterleavedBufferAttribute){var y= +t.data,J=y.stride;t=t.offset;y&&y.isInstancedInterleavedBuffer?(ca.enableAttributeAndDivisor(r,y.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=y.meshPerAttribute*y.count)):ca.enableAttribute(r);L.bindBuffer(34962,w);L.vertexAttribPointer(r,u,A,n,J*x,t*x)}else t.isInstancedBufferAttribute?(ca.enableAttributeAndDivisor(r,t.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=t.meshPerAttribute*t.count)):ca.enableAttribute(r),L.bindBuffer(34962,w),L.vertexAttribPointer(r, +u,A,n,0,0)}}else if(void 0!==v&&(n=v[D],void 0!==n))switch(n.length){case 2:L.vertexAttrib2fv(r,n);break;case 3:L.vertexAttrib3fv(r,n);break;case 4:L.vertexAttrib4fv(r,n);break;default:L.vertexAttrib1fv(r,n)}}}ca.disableUnusedAttributes()}null!==h&&L.bindBuffer(34963,q.buffer)}q=Infinity;null!==h?q=h.count:void 0!==p&&(q=p.count);h=d.drawRange.start*c;p=null!==g?g.start*c:0;var D=Math.max(h,p);g=Math.max(0,Math.min(q,h+d.drawRange.count*c,p+(null!==g?g.count*c:Infinity))-1-D+1);if(0!==g){if(f.isMesh)if(!0=== +e.wireframe)ca.setLineWidth(e.wireframeLinewidth*(null===N?H:1)),a.setMode(1);else switch(f.drawMode){case 0:a.setMode(4);break;case 1:a.setMode(5);break;case 2:a.setMode(6)}else f.isLine?(e=e.linewidth,void 0===e&&(e=1),ca.setLineWidth(e*(null===N?H:1)),f.isLineSegments?a.setMode(1):f.isLineLoop?a.setMode(2):a.setMode(3)):f.isPoints?a.setMode(0):f.isSprite&&a.setMode(4);d&&d.isInstancedBufferGeometry?0c;c++){var q=p[h[c]];var l=p[h[(c+1)%3]];f[0]=Math.min(q,l);f[1]=Math.max(q,l);q=f[0]+","+f[1];void 0===g[q]&&(g[q]={index1:f[0],index2:f[1]})}}for(q in g)m=g[q],h=a.vertices[m.index1],b.push(h.x,h.y,h.z),h=a.vertices[m.index2],b.push(h.x,h.y,h.z)}else if(a&&a.isBufferGeometry)if(h=new n,null!==a.index){k= +a.attributes.position;p=a.index;var t=a.groups;0===t.length&&(t=[{start:0,count:p.count,materialIndex:0}]);a=0;for(e=t.length;ac;c++)q=p.getX(m+c),l=p.getX(m+(c+1)%3),f[0]=Math.min(q,l),f[1]=Math.max(q,l),q=f[0]+","+f[1],void 0===g[q]&&(g[q]={index1:f[0],index2:f[1]});for(q in g)m=g[q],h.fromBufferAttribute(k,m.index1),b.push(h.x,h.y,h.z),h.fromBufferAttribute(k,m.index2),b.push(h.x,h.y,h.z)}else for(k=a.attributes.position,m=0,d= +k.count/3;mc;c++)g=3*m+c,h.fromBufferAttribute(k,g),b.push(h.x,h.y,h.z),g=3*m+(c+1)%3,h.fromBufferAttribute(k,g),b.push(h.x,h.y,h.z);this.addAttribute("position",new E(b,3))}function Nc(a,b,c){N.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new $b(a,b,c));this.mergeVertices()}function $b(a,b,c){z.call(this);this.type="ParametricBufferGeometry";this.parameters={func:a,slices:b,stacks:c};var d=[],e=[],f=[],g=[],h=new n, +k=new n,m=new n,p=new n,q=new n,l,t;3>a.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var r=b+1;for(l=0;l<=c;l++){var u=l/c;for(t=0;t<=b;t++){var x=t/b;a(x,u,k);e.push(k.x,k.y,k.z);0<=x-1E-5?(a(x-1E-5,u,m),p.subVectors(k,m)):(a(x+1E-5,u,m),p.subVectors(m,k));0<=u-1E-5?(a(x,u-1E-5,m),q.subVectors(k,m)):(a(x,u+1E-5,m),q.subVectors(m,k));h.crossVectors(p,q).normalize();f.push(h.x,h.y,h.z);g.push(x,u)}}for(l=0;ld&&1===a.x&&(k[b]=a.x-1);0===c.x&&0===c.z&&(k[b]=d/2/Math.PI+.5)}z.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;var h=[],k=[];(function(a){for(var c=new n,d=new n,g=new n,h=0;he&&(.2>b&&(k[a+0]+=1),.2>c&&(k[a+2]+=1),.2>d&&(k[a+4]+=1))})();this.addAttribute("position", +new E(h,3));this.addAttribute("normal",new E(h.slice(),3));this.addAttribute("uv",new E(k,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function Pc(a,b){N.call(this);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new ac(a,b));this.mergeVertices()}function ac(a,b){ka.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type="TetrahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Qc(a,b){N.call(this); +this.type="OctahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new yb(a,b));this.mergeVertices()}function yb(a,b){ka.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Rc(a,b){N.call(this);this.type="IcosahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new bc(a,b));this.mergeVertices()}function bc(a,b){var c= +(1+Math.sqrt(5))/2;ka.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type="IcosahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Sc(a,b){N.call(this);this.type="DodecahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new cc(a,b));this.mergeVertices()}function cc(a,b){var c= +(1+Math.sqrt(5))/2,d=1/c;ka.call(this,[-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,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b);this.type="DodecahedronBufferGeometry";this.parameters= +{radius:a,detail:b}}function Tc(a,b,c,d,e,f){N.call(this);this.type="TubeGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};void 0!==f&&console.warn("THREE.TubeGeometry: taper has been removed.");a=new zb(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function zb(a,b,c,d,e){function f(e){p=a.getPointAt(e/b,p);var f=g.normals[e];e=g.binormals[e];for(l=0;l<=d;l++){var m=l/d*Math.PI* +2,q=Math.sin(m);m=-Math.cos(m);k.x=m*f.x+q*e.x;k.y=m*f.y+q*e.y;k.z=m*f.z+q*e.z;k.normalize();r.push(k.x,k.y,k.z);h.x=p.x+c*k.x;h.y=p.y+c*k.y;h.z=p.z+c*k.z;t.push(h.x,h.y,h.z)}}z.call(this);this.type="TubeBufferGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var g=a.computeFrenetFrames(b,e);this.tangents=g.tangents;this.normals=g.normals;this.binormals=g.binormals;var h=new n,k=new n,m=new B,p=new n,q,l,t=[],r=[],u=[],x=[];for(q= +0;q=b;e-=d)f=wf(e,a[e],a[e+1],f);f&&Ab(f,f.next)&&(Wc(f),f=f.next);return f}function Xc(a,b){if(!a)return a; +b||(b=a);do{var c=!1;if(a.steiner||!Ab(a,a.next)&&0!==wa(a.prev,a,a.next))a=a.next;else{Wc(a);a=b=a.prev;if(a===a.next)break;c=!0}}while(c||a!==b);return b}function Yc(a,b,c,d,e,f,g){if(a){if(!g&&f){var h=a,k=h;do null===k.z&&(k.z=je(k.x,k.y,d,e,f)),k.prevZ=k.prev,k=k.nextZ=k.next;while(k!==h);k.prevZ.nextZ=null;k.prevZ=null;h=k;var m,p,q,l,t=1;do{k=h;var r=h=null;for(p=0;k;){p++;var n=k;for(m=q=0;mq.x?p.x>t.x?p.x:t.x:q.x>t.x?q.x:t.x,y=p.y>q.y?p.y>t.y?p.y:t.y:q.y>t.y?q.y:t.y;m=je(p.x=m;){if(x!==r.prev&&x!==r.next&&Dd(p.x,p.y,q.x,q.y,t.x,t.y,x.x,x.y)&&0<=wa(x.prev,x,x.next)){r=!1;break a}x=x.prevZ}r=!0}}else a:if(r=a,p=r.prev,q=r,t=r.next,0<=wa(p,q,t))r=!1;else{for(m=r.next.next;m!==r.prev;){if(Dd(p.x,p.y,q.x,q.y,t.x,t.y,m.x,m.y)&&0<=wa(m.prev,m,m.next)){r=!1;break a}m=m.next}r=!0}if(r)b.push(k.i/c),b.push(a.i/c),b.push(n.i/c),Wc(a),h=a=n.next;else if(a=n,a===h){if(!g)Yc(Xc(a),b,c,d,e,f,1);else if(1===g){g=b;h=c;k=a;do n=k.prev, +r=k.next.next,!Ab(n,r)&&xf(n,k,k.next,r)&&Zc(n,r)&&Zc(r,n)&&(g.push(n.i/h),g.push(k.i/h),g.push(r.i/h),Wc(k),Wc(k.next),k=a=r),k=k.next;while(k!==a);a=k;Yc(a,b,c,d,e,f,2)}else if(2===g)a:{g=a;do{for(h=g.next.next;h!==g.prev;){if(k=g.i!==h.i){k=g;n=h;if(r=k.next.i!==n.i&&k.prev.i!==n.i){b:{r=k;do{if(r.i!==k.i&&r.next.i!==k.i&&r.i!==n.i&&r.next.i!==n.i&&xf(r,r.next,k,n)){r=!0;break b}r=r.next}while(r!==k);r=!1}r=!r}if(r=r&&Zc(k,n)&&Zc(n,k)){r=k;p=!1;q=(k.x+n.x)/2;n=(k.y+n.y)/2;do r.y>n!==r.next.y>n&& +r.next.y!==r.y&&q<(r.next.x-r.x)*(n-r.y)/(r.next.y-r.y)+r.x&&(p=!p),r=r.next;while(r!==k);r=p}k=r}if(k){a=yf(g,h);g=Xc(g,g.next);a=Xc(a,a.next);Yc(g,b,c,d,e,f);Yc(a,b,c,d,e,f);break a}h=h.next}g=g.next}while(g!==a)}break}}}}function eh(a,b){return a.x-b.x}function fh(a,b){var c=b,d=a.x,e=a.y,f=-Infinity;do{if(e<=c.y&&e>=c.next.y&&c.next.y!==c.y){var g=c.x+(e-c.y)*(c.next.x-c.x)/(c.next.y-c.y);if(g<=d&&g>f){f=g;if(g===d){if(e===c.y)return c;if(e===c.next.y)return c.next}var h=c.x=c.x&&c.x>=g&&d!==c.x&&Dd(eh.x)&&Zc(c,a)&&(h=c,m=p)}c=c.next}return h}function je(a,b,c,d,e){a=32767*(a-c)*e;b=32767*(b-d)*e;a=(a|a<<8)&16711935;a=(a|a<<4)&252645135;a=(a|a<<2)&858993459;b=(b|b<<8)&16711935;b=(b|b<<4)&252645135;b=(b|b<<2)&858993459;return(a|a<<1)&1431655765|((b|b<<1)&1431655765)<<1}function gh(a){var b= +a,c=a;do b.xwa(a.prev,a,a.next)?0<=wa(a,b,a.next)&&0<=wa(a,a.prev,b):0>wa(a,b,a.prev)|| +0>wa(a,a.next,b)}function yf(a,b){var c=new ke(a.i,a.x,a.y),d=new ke(b.i,b.x,b.y),e=a.next,f=b.prev;a.next=b;b.prev=a;c.next=e;e.prev=c;d.next=c;c.prev=d;f.next=d;d.prev=f;return d}function wf(a,b,c,d){a=new ke(a,b,c);d?(a.next=d.next,a.prev=d,d.next.prev=a,d.next=a):(a.prev=a,a.next=a);return a}function Wc(a){a.next.prev=a.prev;a.prev.next=a.next;a.prevZ&&(a.prevZ.nextZ=a.nextZ);a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function ke(a,b,c){this.i=a;this.x=b;this.y=c;this.nextZ=this.prevZ=this.z=this.next= +this.prev=null;this.steiner=!1}function zf(a){var b=a.length;2Number.EPSILON){var k=Math.sqrt(h),m=Math.sqrt(f*f+g*g);h=b.x-e/k;b=b.y+d/k;g=((c.x-g/m-h)*g-(c.y+f/m-b)*f)/(d*g-e*f);f=h+d*g-a.x;d=b+e*g-a.y;e=f*f+d*d;if(2>=e)return new B(f,d);e=Math.sqrt(e/2)}else a=!1,d>Number.EPSILON?f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(f=-e,e=Math.sqrt(h)):(f=d,d=e,e=Math.sqrt(h/2));return new B(f/e,d/e)}function h(a,b){for(H=a.length;0<= +--H;){var c=H;var f=H-1;0>f&&(f=a.length-1);var g,h=w+2*F;for(g=0;gp;p++){var l=m[f[p]];var n=m[f[(p+1)%3]];d[0]=Math.min(l,n);d[1]=Math.max(l,n);l=d[0]+","+d[1];void 0===e[l]?e[l]={index1:d[0],index2:d[1], +face1:h,face2:void 0}:e[l].face2=h}for(l in e)if(d=e[l],void 0===d.face2||g[d.face1].normal.dot(g[d.face2].normal)<=b)f=a[d.index1],c.push(f.x,f.y,f.z),f=a[d.index2],c.push(f.x,f.y,f.z);this.addAttribute("position",new E(c,3))}function Fb(a,b,c,d,e,f,g,h){N.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};this.fromBufferGeometry(new db(a,b,c,d,e,f,g,h));this.mergeVertices()}function db(a, +b,c,d,e,f,g,h){function k(c){var e,f=new B,k=new n,q=0,u=!0===c?a:b,w=!0===c?1:-1;var z=r;for(e=1;e<=d;e++)l.push(0,x*w,0),v.push(0,w,0),t.push(.5,.5),r++;var C=r;for(e=0;e<=d;e++){var E=e/d*h+g,G=Math.cos(E);E=Math.sin(E);k.x=u*E;k.y=x*w;k.z=u*G;l.push(k.x,k.y,k.z);v.push(0,w,0);f.x=.5*G+.5;f.y=.5*E*w+.5;t.push(f.x,f.y);r++}for(e=0;ethis.duration&&this.resetDuration()}function ih(a){switch(a.toLowerCase()){case "scalar":case "double":case "float":case "number":case "integer":return lc;case "vector":case "vector2":case "vector3":case "vector4":return mc;case "color":return Hd;case "quaternion":return hd;case "bool":case "boolean":return Gd;case "string":return Jd}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+a);}function jh(a){if(void 0===a.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse"); +var b=ih(a.type);if(void 0===a.times){var c=[],d=[];pa.flattenJSON(a.keys,c,d,"value");a.times=c;a.values=d}return void 0!==b.parse?b.parse(a):new b(a.name,a.times,a.values,a.interpolation)}function le(a,b,c){var d=this,e=!1,f=0,g=0,h=void 0;this.onStart=void 0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){g++;if(!1===e&&void 0!==d.onStart)d.onStart(a,f,g);e=!0};this.itemEnd=function(a){f++;if(void 0!==d.onProgress)d.onProgress(a,f,g);if(f===g&&(e=!1,void 0!==d.onLoad))d.onLoad()}; +this.itemError=function(a){if(void 0!==d.onError)d.onError(a)};this.resolveURL=function(a){return h?h(a):a};this.setURLModifier=function(a){h=a;return this}}function Ma(a){this.manager=void 0!==a?a:za}function Df(a){this.manager=void 0!==a?a:za}function Ef(a){this.manager=void 0!==a?a:za;this._parser=null}function me(a){this.manager=void 0!==a?a:za;this._parser=null}function id(a){this.manager=void 0!==a?a:za}function ne(a){this.manager=void 0!==a?a:za}function Kd(a){this.manager=void 0!==a?a:za} +function I(){this.type="Curve";this.arcLengthDivisions=200}function Ga(a,b,c,d,e,f,g,h){I.call(this);this.type="EllipseCurve";this.aX=a||0;this.aY=b||0;this.xRadius=c||1;this.yRadius=d||1;this.aStartAngle=e||0;this.aEndAngle=f||2*Math.PI;this.aClockwise=g||!1;this.aRotation=h||0}function nc(a,b,c,d,e,f){Ga.call(this,a,b,c,c,d,e,f);this.type="ArcCurve"}function oe(){var a=0,b=0,c=0,d=0;return{initCatmullRom:function(e,f,g,h,k){e=k*(g-e);h=k*(h-f);a=f;b=e;c=-3*f+3*g-2*e-h;d=2*f-2*g+e+h},initNonuniformCatmullRom:function(e, +f,g,h,k,m,p){e=((f-e)/k-(g-e)/(k+m)+(g-f)/m)*m;h=((g-f)/m-(h-f)/(m+p)+(h-g)/p)*m;a=f;b=e;c=-3*f+3*g-2*e-h;d=2*f-2*g+e+h},calc:function(e){var f=e*e;return a+b*e+c*f+d*f*e}}}function qa(a,b,c,d){I.call(this);this.type="CatmullRomCurve3";this.points=a||[];this.closed=b||!1;this.curveType=c||"centripetal";this.tension=d||.5}function Ff(a,b,c,d,e){b=.5*(d-b);e=.5*(e-c);var f=a*a;return(2*c-2*d+b+e)*a*f+(-3*c+3*d-2*b-e)*f+b*a+c}function jd(a,b,c,d){var e=1-a;return e*e*b+2*(1-a)*a*c+a*a*d}function kd(a, +b,c,d,e){var f=1-a,g=1-a;return f*f*f*b+3*g*g*a*c+3*(1-a)*a*a*d+a*a*a*e}function Na(a,b,c,d){I.call(this);this.type="CubicBezierCurve";this.v0=a||new B;this.v1=b||new B;this.v2=c||new B;this.v3=d||new B}function $a(a,b,c,d){I.call(this);this.type="CubicBezierCurve3";this.v0=a||new n;this.v1=b||new n;this.v2=c||new n;this.v3=d||new n}function xa(a,b){I.call(this);this.type="LineCurve";this.v1=a||new B;this.v2=b||new B}function Oa(a,b){I.call(this);this.type="LineCurve3";this.v1=a||new n;this.v2=b|| +new n}function Pa(a,b,c){I.call(this);this.type="QuadraticBezierCurve";this.v0=a||new B;this.v1=b||new B;this.v2=c||new B}function ab(a,b,c){I.call(this);this.type="QuadraticBezierCurve3";this.v0=a||new n;this.v1=b||new n;this.v2=c||new n}function Qa(a){I.call(this);this.type="SplineCurve";this.points=a||[]}function eb(){I.call(this);this.type="CurvePath";this.curves=[];this.autoClose=!1}function Ra(a){eb.call(this);this.type="Path";this.currentPoint=new B;a&&this.setFromPoints(a)}function nb(a){Ra.call(this, +a);this.uuid=K.generateUUID();this.type="Shape";this.holes=[]}function ea(a,b){C.call(this);this.type="Light";this.color=new M(a);this.intensity=void 0!==b?b:1;this.receiveShadow=void 0}function Ld(a,b,c){ea.call(this,a,c);this.type="HemisphereLight";this.castShadow=void 0;this.position.copy(C.DefaultUp);this.updateMatrix();this.groundColor=new M(b)}function Nb(a){this.camera=a;this.bias=0;this.radius=1;this.mapSize=new B(512,512);this.map=null;this.matrix=new P}function Md(){Nb.call(this,new ja(50, +1,.5,500))}function Nd(a,b,c,d,e,f){ea.call(this,a,b);this.type="SpotLight";this.position.copy(C.DefaultUp);this.updateMatrix();this.target=new C;Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(a){this.intensity=a/Math.PI}});this.distance=void 0!==c?c:0;this.angle=void 0!==d?d:Math.PI/3;this.penumbra=void 0!==e?e:0;this.decay=void 0!==f?f:1;this.shadow=new Md}function Od(a,b,c,d){ea.call(this,a,b);this.type="PointLight";Object.defineProperty(this,"power", +{get:function(){return 4*this.intensity*Math.PI},set:function(a){this.intensity=a/(4*Math.PI)}});this.distance=void 0!==c?c:0;this.decay=void 0!==d?d:1;this.shadow=new Nb(new ja(90,1,.5,500))}function ld(a,b,c,d,e,f){Xa.call(this);this.type="OrthographicCamera";this.zoom=1;this.view=null;this.left=void 0!==a?a:-1;this.right=void 0!==b?b:1;this.top=void 0!==c?c:1;this.bottom=void 0!==d?d:-1;this.near=void 0!==e?e:.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()}function Pd(){Nb.call(this, +new ld(-5,5,5,-5,.5,500))}function Qd(a,b){ea.call(this,a,b);this.type="DirectionalLight";this.position.copy(C.DefaultUp);this.updateMatrix();this.target=new C;this.shadow=new Pd}function Rd(a,b){ea.call(this,a,b);this.type="AmbientLight";this.castShadow=void 0}function Sd(a,b,c,d){ea.call(this,a,b);this.type="RectAreaLight";this.width=void 0!==c?c:10;this.height=void 0!==d?d:10}function Td(a){this.manager=void 0!==a?a:za;this.textures={}}function pe(a){this.manager=void 0!==a?a:za}function qe(a){this.manager= +void 0!==a?a:za;this.resourcePath=""}function re(a){"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported.");"undefined"===typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported.");this.manager=void 0!==a?a:za;this.options=void 0}function se(){this.type="ShapePath";this.color=new M;this.subPaths=[];this.currentPath=null}function te(a){this.type="Font";this.data=a}function Gf(a){this.manager=void 0!==a?a:za}function md(){} +function ue(a){this.manager=void 0!==a?a:za}function Hf(){this.type="StereoCamera";this.aspect=1;this.eyeSep=.064;this.cameraL=new ja;this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=!1;this.cameraR=new ja;this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate=!1}function nd(a,b,c,d){C.call(this);this.type="CubeCamera";var e=new ja(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new n(1,0,0));this.add(e);var f=new ja(90,1,a,b);f.up.set(0,-1,0);f.lookAt(new n(-1,0,0));this.add(f);var g=new ja(90, +1,a,b);g.up.set(0,0,1);g.lookAt(new n(0,1,0));this.add(g);var h=new ja(90,1,a,b);h.up.set(0,0,-1);h.lookAt(new n(0,-1,0));this.add(h);var k=new ja(90,1,a,b);k.up.set(0,-1,0);k.lookAt(new n(0,0,1));this.add(k);var m=new ja(90,1,a,b);m.up.set(0,-1,0);m.lookAt(new n(0,0,-1));this.add(m);d=d||{format:1022,magFilter:1006,minFilter:1006};this.renderTarget=new pb(c,c,d);this.renderTarget.texture.name="CubeCamera";this.update=function(a,b){null===this.parent&&this.updateMatrixWorld();var c=a.getRenderTarget(), +d=this.renderTarget,p=d.texture.generateMipmaps;d.texture.generateMipmaps=!1;a.setRenderTarget(d,0);a.render(b,e);a.setRenderTarget(d,1);a.render(b,f);a.setRenderTarget(d,2);a.render(b,g);a.setRenderTarget(d,3);a.render(b,h);a.setRenderTarget(d,4);a.render(b,k);d.texture.generateMipmaps=p;a.setRenderTarget(d,5);a.render(b,m);a.setRenderTarget(c)};this.clear=function(a,b,c,d){for(var e=a.getRenderTarget(),f=this.renderTarget,g=0;6>g;g++)a.setRenderTarget(f,g),a.clear(b,c,d);a.setRenderTarget(e)}}function ve(a){this.autoStart= +void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}function we(){C.call(this);this.type="AudioListener";this.context=xe.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null;this.timeDelta=0}function oc(a){C.call(this);this.type="Audio";this.listener=a;this.context=a.context;this.gain=this.context.createGain();this.gain.connect(a.getInput());this.autoplay=!1;this.buffer=null;this.detune=0;this.loop=!1;this.offset= +this.startTime=0;this.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.sourceType="empty";this.filters=[]}function ye(a){oc.call(this,a);this.panner=this.context.createPanner();this.panner.connect(this.gain)}function ze(a,b){this.analyser=a.context.createAnalyser();this.analyser.fftSize=void 0!==b?b:2048;this.data=new Uint8Array(this.analyser.frequencyBinCount);a.getOutput().connect(this.analyser)}function Ae(a,b,c){this.binding=a;this.valueSize=c;a=Float64Array;switch(b){case "quaternion":b= +this._slerp;break;case "string":case "bool":a=Array;b=this._select;break;default:b=this._lerp}this.buffer=new a(4*c);this._mixBufferRegion=b;this.referenceCount=this.useCount=this.cumulativeWeight=0}function If(a,b,c){c=c||ma.parseTrackName(b);this._targetGroup=a;this._bindings=a.subscribe_(b,c)}function ma(a,b,c){this.path=b;this.parsedPath=c||ma.parseTrackName(b);this.node=ma.findNode(a,this.parsedPath.nodeName)||a;this.rootNode=a}function Jf(){this.uuid=K.generateUUID();this._objects=Array.prototype.slice.call(arguments); +this.nCachedObjects_=0;var a={};this._indicesByUUID=a;for(var b=0,c=arguments.length;b!==c;++b)a[arguments[b].uuid]=b;this._paths=[];this._parsedPaths=[];this._bindings=[];this._bindingsIndicesByPath={};var d=this;this.stats={objects:{get total(){return d._objects.length},get inUse(){return this.total-d.nCachedObjects_}},get bindingsPerObject(){return d._bindings.length}}}function Kf(a,b,c){this._mixer=a;this._clip=b;this._localRoot=c||null;a=b.tracks;b=a.length;c=Array(b);for(var d={endingStart:2400, +endingEnd:2400},e=0;e!==b;++e){var f=a[e].createInterpolant(null);c[e]=f;f.settings=d}this._interpolantSettings=d;this._interpolants=c;this._propertyBindings=Array(b);this._weightInterpolant=this._timeScaleInterpolant=this._byClipCacheIndex=this._cacheIndex=null;this.loop=2201;this._loopCount=-1;this._startTime=null;this.time=0;this._effectiveWeight=this.weight=this._effectiveTimeScale=this.timeScale=1;this.repetitions=Infinity;this.paused=!1;this.enabled=!0;this.clampWhenFinished=!1;this.zeroSlopeAtEnd= +this.zeroSlopeAtStart=!0}function Be(a){this._root=a;this._initMemoryManager();this.time=this._accuIndex=0;this.timeScale=1}function Ud(a,b){"string"===typeof a&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),a=b);this.value=a}function Ce(){z.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0}function De(a,b,c){xb.call(this,a,b);this.meshPerAttribute=c||1}function Ee(a,b,c,d){"number"===typeof c&&(d=c,c=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")); +S.call(this,a,b,c);this.meshPerAttribute=d||1}function Lf(a,b,c,d){this.ray=new wb(a,b);this.near=c||0;this.far=d||Infinity;this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}};Object.defineProperties(this.params,{PointCloud:{get:function(){console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points.");return this.Points}}})}function Mf(a,b){return a.distance-b.distance}function Fe(a,b,c,d){if(!1!==a.visible&&(a.raycast(b,c),!0===d)){a=a.children;d=0;for(var e= +a.length;dc;c++,d++){var e=c/32*Math.PI*2,f=d/32*Math.PI*2;b.push(Math.cos(e),Math.sin(e),1,Math.cos(f),Math.sin(f),1)}a.addAttribute("position",new E(b,3));b=new R({fog:!1});this.cone=new V(a,b);this.add(this.cone);this.update()}function Pf(a){var b=[];a&&a.isBone&&b.push(a);for(var c=0;c +a?-1:0b;b++)a[b]=(16>b?"0":"")+b.toString(16);return function(){var b=4294967295*Math.random()|0,d=4294967295*Math.random()|0,e=4294967295*Math.random()|0,f=4294967295*Math.random()|0;return(a[b&255]+a[b>>8&255]+a[b>>16&255]+a[b>>24&255]+"-"+a[d&255]+a[d>>8&255]+"-"+a[d>>16&15|64]+a[d>>24&255]+ +"-"+a[e&63|128]+a[e>>8&255]+"-"+a[e>>16&255]+a[e>>24&255]+a[f&255]+a[f>>8&255]+a[f>>16&255]+a[f>>24&255]).toUpperCase()}}(),clamp:function(a,b,c){return Math.max(b,Math.min(c,a))},euclideanModulo:function(a,b){return(a%b+b)%b},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},lerp:function(a,b,c){return(1-c)*a+c*b},smoothstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a* +a*a*(a*(6*a-15)+10)},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(a){return a*K.DEG2RAD},radToDeg:function(a){return a*K.RAD2DEG},isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},ceilPowerOfTwo:function(a){return Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))},floorPowerOfTwo:function(a){return Math.pow(2,Math.floor(Math.log(a)/Math.LN2))}};Object.defineProperties(B.prototype, +{width:{get:function(){return this.x},set:function(a){this.x=a}},height:{get:function(){return this.y},set:function(a){this.y=a}}});Object.assign(B.prototype,{isVector2:!0,set:function(a,b){this.x=a;this.y=b;return this},setScalar:function(a){this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x; +case 1:return this.y;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this}, +addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this},subScalar:function(a){this.x-=a;this.y-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this}, +divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},applyMatrix3:function(a){var b=this.x,c=this.y;a=a.elements;this.x=a[0]*b+a[3]*c+a[6];this.y=a[1]*b+a[4]*c+a[7];return this},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y, +this.y));return this},clampScalar:function(){var a=new B,b=new B;return function(c,d){a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();return this.divideScalar(c||1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},roundToZero:function(){this.x= +0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},cross:function(a){return this.x*a.y-this.y*a.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()|| +1)},angle:function(){var a=Math.atan2(this.y,this.x);0>a&&(a+=2*Math.PI);return a},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x;a=this.y-a.y;return b*b+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b, +a).multiplyScalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute().");this.x=a.getX(b);this.y=a.getY(b);return this},rotateAround:function(a,b){var c=Math.cos(b);b=Math.sin(b);var d= +this.x-a.x,e=this.y-a.y;this.x=d*c-e*b+a.x;this.y=d*b+e*c+a.y;return this}});Object.assign(aa,{slerp:function(a,b,c,d){return c.copy(a).slerp(b,d)},slerpFlat:function(a,b,c,d,e,f,g){var h=c[d+0],k=c[d+1],m=c[d+2];c=c[d+3];d=e[f+0];var p=e[f+1],l=e[f+2];e=e[f+3];if(c!==e||h!==d||k!==p||m!==l){f=1-g;var n=h*d+k*p+m*l+c*e,t=0<=n?1:-1,r=1-n*n;r>Number.EPSILON&&(r=Math.sqrt(r),n=Math.atan2(r,n*t),f=Math.sin(f*n)/r,g=Math.sin(g*n)/r);t*=g;h=h*f+d*t;k=k*f+p*t;m=m*f+l*t;c=c*f+e*t;f===1-g&&(g=1/Math.sqrt(h* +h+k*k+m*m+c*c),h*=g,k*=g,m*=g,c*=g)}a[b]=h;a[b+1]=k;a[b+2]=m;a[b+3]=c}});Object.defineProperties(aa.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this.onChangeCallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this.onChangeCallback()}},z:{get:function(){return this._z},set:function(a){this._z=a;this.onChangeCallback()}},w:{get:function(){return this._w},set:function(a){this._w=a;this.onChangeCallback()}}});Object.assign(aa.prototype,{isQuaternion:!0, +set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._w=d;this.onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(a){this._x=a.x;this._y=a.y;this._z=a.z;this._w=a.w;this.onChangeCallback();return this},setFromEuler:function(a,b){if(!a||!a.isEuler)throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var c=a._x,d=a._y,e=a._z;a=a.order;var f=Math.cos,g=Math.sin,h=f(c/ +2),k=f(d/2);f=f(e/2);c=g(c/2);d=g(d/2);e=g(e/2);"XYZ"===a?(this._x=c*k*f+h*d*e,this._y=h*d*f-c*k*e,this._z=h*k*e+c*d*f,this._w=h*k*f-c*d*e):"YXZ"===a?(this._x=c*k*f+h*d*e,this._y=h*d*f-c*k*e,this._z=h*k*e-c*d*f,this._w=h*k*f+c*d*e):"ZXY"===a?(this._x=c*k*f-h*d*e,this._y=h*d*f+c*k*e,this._z=h*k*e+c*d*f,this._w=h*k*f-c*d*e):"ZYX"===a?(this._x=c*k*f-h*d*e,this._y=h*d*f+c*k*e,this._z=h*k*e-c*d*f,this._w=h*k*f+c*d*e):"YZX"===a?(this._x=c*k*f+h*d*e,this._y=h*d*f+c*k*e,this._z=h*k*e-c*d*f,this._w=h*k*f- +c*d*e):"XZY"===a&&(this._x=c*k*f-h*d*e,this._y=h*d*f-c*k*e,this._z=h*k*e+c*d*f,this._w=h*k*f+c*d*e);if(!1!==b)this.onChangeCallback();return this},setFromAxisAngle:function(a,b){b/=2;var c=Math.sin(b);this._x=a.x*c;this._y=a.y*c;this._z=a.z*c;this._w=Math.cos(b);this.onChangeCallback();return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],k=b[6];b=b[10];var m=c+f+b;0f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(k-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=.25*c,this._z=(g+k)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+k)/c,this._z=.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(a,b){var c=a.dot(b)+1;1E-6>c?(c=0,Math.abs(a.x)>Math.abs(a.z)?(this._x=-a.y,this._y=a.x,this._z=0):(this._x=0,this._y=-a.z,this._z=a.y)):(this._x= +a.y*b.z-a.z*b.y,this._y=a.z*b.x-a.x*b.z,this._z=a.x*b.y-a.y*b.x);this._w=c;return this.normalize()},angleTo:function(a){return 2*Math.acos(Math.abs(K.clamp(this.dot(a),-1,1)))},rotateTowards:function(a,b){var c=this.angleTo(a);if(0===c)return this;this.slerp(a,Math.min(1,b/c));return this},inverse:function(){return this.conjugate()},conjugate:function(){this._x*=-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w}, +lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this},multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."), +this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},premultiply:function(a){return this.multiplyQuaternions(a,this)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z;a=a._w;var f=b._x,g=b._y,h=b._z;b=b._w;this._x=c*b+a*f+d*h-e*g;this._y=d*b+a*g+e*f-c*h;this._z=e*b+a*h+c*g-d*f;this._w=a*b-c*f-d*g-e*h;this.onChangeCallback();return this},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z; +0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;a=1-g*g;if(a<=Number.EPSILON)return g=1-b,this._w=g*f+b*this._w,this._x=g*c+b*this._x,this._y=g*d+b*this._y,this._z=g*e+b*this._z,this.normalize();a=Math.sqrt(a);var h=Math.atan2(a,g);g=Math.sin((1-b)*h)/a;b=Math.sin(b*h)/a;this._w=f*g+this._w*b;this._x=c*g+this._x*b;this._y=d*g+this._y*b;this._z=e*g+this._z*b;this.onChangeCallback();return this},equals:function(a){return a._x=== +this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a,b){void 0===b&&(b=0);this._x=a[b];this._y=a[b+1];this._z=a[b+2];this._w=a[b+3];this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._w;return a},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){}});Object.assign(n.prototype,{isVector3:!0,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this}, +setScalar:function(a){this.z=this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x, +this.y,this.z)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;this.z+= +a.z*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subScalar:function(a){this.x-=a;this.y-=a;this.z-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."), +this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a=new aa;return function(b){b&&b.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.");return this.applyQuaternion(a.setFromEuler(b))}}(),applyAxisAngle:function(){var a=new aa;return function(b, +c){return this.applyQuaternion(a.setFromAxisAngle(b,c))}}(),applyMatrix3:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z=(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x, +c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,k=a*c+g*b-e*d,m=a*d+e*c-f*b;b=-e*b-f*c-g*d;this.x=h*a+b*-e+k*-g-m*-f;this.y=k*a+b*-f+m*-e-h*-g;this.z=m*a+b*-g+h*-f-k*-e;return this},project:function(a){return this.applyMatrix4(a.matrixWorldInverse).applyMatrix4(a.projectionMatrix)},unproject:function(a){return this.applyMatrix4(a.projectionMatrixInverse).applyMatrix4(a.matrixWorld)},transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d; +this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;return this.normalize()},divide:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);this.z=Math.min(this.z,a.z);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z,a.z);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y= +Math.max(a.y,Math.min(b.y,this.y));this.z=Math.max(a.z,Math.min(b.z,this.z));return this},clampScalar:function(){var a=new n,b=new n;return function(c,d){a.set(c,c,c);b.set(d,d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();return this.divideScalar(c||1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y); +this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x* +this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)}, +cross:function(a,b){return void 0!==b?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b)):this.crossVectors(this,a)},crossVectors:function(a,b){var c=a.x,d=a.y;a=a.z;var e=b.x,f=b.y;b=b.z;this.x=d*b-a*f;this.y=a*e-c*b;this.z=c*f-d*e;return this},projectOnVector:function(a){var b=a.dot(this)/a.lengthSq();return this.copy(a).multiplyScalar(b)},projectOnPlane:function(){var a=new n;return function(b){a.copy(this).projectOnVector(b); +return this.sub(a)}}(),reflect:function(){var a=new n;return function(b){return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/Math.sqrt(this.lengthSq()*a.lengthSq());return Math.acos(K.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)+Math.abs(this.z- +a.z)},setFromSpherical:function(a){return this.setFromSphericalCoords(a.radius,a.phi,a.theta)},setFromSphericalCoords:function(a,b,c){var d=Math.sin(b)*a;this.x=d*Math.sin(c);this.y=Math.cos(b)*a;this.z=d*Math.cos(c);return this},setFromCylindrical:function(a){return this.setFromCylindricalCoords(a.radius,a.theta,a.y)},setFromCylindricalCoords:function(a,b,c){this.x=a*Math.sin(b);this.y=c;this.z=a*Math.cos(b);return this},setFromMatrixPosition:function(a){a=a.elements;this.x=a[12];this.y=a[13];this.z= +a[14];return this},setFromMatrixScale:function(a){var b=this.setFromMatrixColumn(a,0).length(),c=this.setFromMatrixColumn(a,1).length();a=this.setFromMatrixColumn(a,2).length();this.x=b;this.y=c;this.z=a;return this},setFromMatrixColumn:function(a,b){return this.fromArray(a.elements,4*b)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0=== +b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute().");this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);return this}});Object.assign(ba.prototype,{isMatrix3:!0,set:function(a,b,c,d,e,f,g,h,k){var m=this.elements;m[0]=a;m[1]=d;m[2]=g;m[3]=b;m[4]=e;m[5]=h;m[6]=c;m[7]=f;m[8]=k;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},clone:function(){return(new this.constructor).fromArray(this.elements)}, +copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return this},setFromMatrix4:function(a){a=a.elements;this.set(a[0],a[4],a[8],a[1],a[5],a[9],a[2],a[6],a[10]);return this},applyToBufferAttribute:function(){var a=new n;return function(b){for(var c=0,d=b.count;cc;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;9>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c= +this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a}});var wc,ob={getDataURL:function(a){if("undefined"==typeof HTMLCanvasElement)return a.src;if(!(a instanceof HTMLCanvasElement)){void 0===wc&&(wc=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"));wc.width=a.width;wc.height=a.height;var b=wc.getContext("2d");a instanceof ImageData?b.putImageData(a,0,0):b.drawImage(a,0,0,a.width,a.height);a=wc}return 2048< +a.width||2048a.x||1a.x?0:1;break;case 1002:a.x=1===Math.abs(Math.floor(a.x)%2)?Math.ceil(a.x)-a.x:a.x-Math.floor(a.x)}if(0>a.y||1a.y?0:1;break;case 1002:a.y=1===Math.abs(Math.floor(a.y)%2)?Math.ceil(a.y)-a.y:a.y-Math.floor(a.y)}this.flipY&&(a.y=1-a.y);return a}});Object.defineProperty(W.prototype, +"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.assign(Y.prototype,{isVector4:!0,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setScalar:function(a){this.w=this.z=this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w= +b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), +this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;this.z+=a.z*b;this.w+=a.w*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a, +b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subScalar:function(a){this.x-=a;this.y-=a;this.z-=a;this.w-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]* +e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this},setAxisAngleFromRotationMatrix:function(a){a=a.elements;var b=a[0];var c=a[4];var d=a[8],e=a[1],f=a[5],g=a[9];var h=a[2];var k=a[6];var m=a[10];if(.01>Math.abs(c-e)&&.01>Math.abs(d-h)&&.01>Math.abs(g-k)){if(.1>Math.abs(c+ +e)&&.1>Math.abs(d+h)&&.1>Math.abs(g+k)&&.1>Math.abs(b+f+m-3))return this.set(1,0,0,0),this;a=Math.PI;b=(b+1)/2;f=(f+1)/2;m=(m+1)/2;c=(c+e)/4;d=(d+h)/4;g=(g+k)/4;b>f&&b>m?.01>b?(k=0,c=h=.707106781):(k=Math.sqrt(b),h=c/k,c=d/k):f>m?.01>f?(k=.707106781,h=0,c=.707106781):(h=Math.sqrt(f),k=c/h,c=g/h):.01>m?(h=k=.707106781,c=0):(c=Math.sqrt(m),k=d/c,h=g/c);this.set(k,h,c,a);return this}a=Math.sqrt((k-g)*(k-g)+(d-h)*(d-h)+(e-c)*(e-c));.001>Math.abs(a)&&(a=1);this.x=(k-g)/a;this.y=(d-h)/a;this.z=(e-c)/a; +this.w=Math.acos((b+f+m-1)/2);return this},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);this.z=Math.min(this.z,a.z);this.w=Math.min(this.w,a.w);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z,a.z);this.w=Math.max(this.w,a.w);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));this.z=Math.max(a.z,Math.min(b.z,this.z));this.w=Math.max(a.w,Math.min(b.w, +this.w));return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new Y,b=new Y);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();return this.divideScalar(c||1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z); +this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this}, +dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+= +(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;a[b+3]=this.w;return a},fromBufferAttribute:function(a, +b,c){void 0!==c&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute().");this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);this.w=a.getW(b);return this}});Ta.prototype=Object.assign(Object.create(ta.prototype),{constructor:Ta,isWebGLRenderTarget:!0,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose();this.viewport.set(0,0,a,b);this.scissor.set(0,0,a,b)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width= +a.width;this.height=a.height;this.viewport.copy(a.viewport);this.texture=a.texture.clone();this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.depthTexture=a.depthTexture;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});$d.prototype=Object.assign(Object.create(Ta.prototype),{constructor:$d,isWebGLMultisampleRenderTarget:!0,copy:function(a){Ta.prototype.copy.call(this,a);this.samples=a.samples;return this}});pb.prototype=Object.create(Ta.prototype);pb.prototype.constructor= +pb;pb.prototype.isWebGLRenderTargetCube=!0;qb.prototype=Object.create(W.prototype);qb.prototype.constructor=qb;qb.prototype.isDataTexture=!0;Object.assign(Ja.prototype,{isBox3:!0,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromArray:function(a){for(var b=Infinity,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=-Infinity,h=0,k=a.length;he&&(e=m);p>f&&(f=p);l>g&&(g=l)}this.min.set(b,c,d);this.max.set(e, +f,g);return this},setFromBufferAttribute:function(a){for(var b=Infinity,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=-Infinity,h=0,k=a.count;he&&(e=m);p>f&&(f=p);l>g&&(g=l)}this.min.set(b,c,d);this.max.set(e,f,g);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y||a.zthis.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z},getParameter:function(a,b){void 0===b&&(console.warn("THREE.Box3: .getParameter() target is now required"),b=new n);return b.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))}, +intersectsBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y||a.max.zthis.max.z?!1:!0},intersectsSphere:function(){var a=new n;return function(b){this.clampPoint(b.center,a);return a.distanceToSquared(b.center)<=b.radius*b.radius}}(),intersectsPlane:function(a){if(0=-a.constant},intersectsTriangle:function(){function a(a){var e;var f=0;for(e=a.length-3;f<=e;f+=3){h.fromArray(a,f);var g=m.x*Math.abs(h.x)+m.y*Math.abs(h.y)+m.z*Math.abs(h.z),k=b.dot(h),p=c.dot(h),l=d.dot(h);if(Math.max(-Math.max(k,p,l),Math.min(k,p,l))>g)return!1}return!0}var b=new n, +c=new n,d=new n,e=new n,f=new n,g=new n,h=new n,k=new n,m=new n,p=new n;return function(h){if(this.isEmpty())return!1;this.getCenter(k);m.subVectors(this.max,k);b.subVectors(h.a,k);c.subVectors(h.b,k);d.subVectors(h.c,k);e.subVectors(c,b);f.subVectors(d,c);g.subVectors(b,d);h=[0,-e.z,e.y,0,-f.z,f.y,0,-g.z,g.y,e.z,0,-e.x,f.z,0,-f.x,g.z,0,-g.x,-e.y,e.x,0,-f.y,f.x,0,-g.y,g.x,0];if(!a(h))return!1;h=[1,0,0,0,1,0,0,0,1];if(!a(h))return!1;p.crossVectors(e,f);h=[p.x,p.y,p.z];return a(h)}}(),clampPoint:function(a, +b){void 0===b&&(console.warn("THREE.Box3: .clampPoint() target is now required"),b=new n);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new n;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a=new n;return function(b){void 0===b&&console.error("THREE.Box3: .getBoundingSphere() target is now required");this.getCenter(b.center);b.radius=.5*this.getSize(a).length();return b}}(),intersect:function(a){this.min.max(a.min); +this.max.min(a.max);this.isEmpty()&&this.makeEmpty();return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(){var a=[new n,new n,new n,new n,new n,new n,new n,new n];return function(b){if(this.isEmpty())return this;a[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(b);a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b); +a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}});Object.assign(Ua.prototype,{set:function(a,b){this.center.copy(a);this.radius=b;return this}, +setFromPoints:function(){var a=new Ja;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).getCenter(d);for(var e=c=0,f=b.length;e=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius}, +distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},intersectsBox:function(a){return a.intersectsSphere(this)},intersectsPlane:function(a){return Math.abs(a.distanceToPoint(this.center))<=this.radius},clampPoint:function(a,b){var c=this.center.distanceToSquared(a);void 0===b&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),b=new n);b.copy(a);c>this.radius* +this.radius&&(b.sub(this.center).normalize(),b.multiplyScalar(this.radius).add(this.center));return b},getBoundingBox:function(a){void 0===a&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),a=new Ja);a.set(this.center,this.center);a.expandByScalar(this.radius);return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&& +a.radius===this.radius}});Object.assign(Va.prototype,{set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new n,b=new n;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,c);return this}}(), +clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){void 0=== +b&&(console.warn("THREE.Plane: .projectPoint() target is now required"),b=new n);return b.copy(this.normal).multiplyScalar(-this.distanceToPoint(a)).add(a)},intersectLine:function(){var a=new n;return function(b,c){void 0===c&&(console.warn("THREE.Plane: .intersectLine() target is now required"),c=new n);var d=b.delta(a),e=this.normal.dot(d);if(0===e){if(0===this.distanceToPoint(b.start))return c.copy(b.start)}else if(e=-(b.start.dot(this.normal)+this.constant)/e,!(0>e||1b&&0a&&0c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],m=c[7],p=c[8],l=c[9],n=c[10],t=c[11],r=c[12],u=c[13],x=c[14];c=c[15];b[0].setComponents(f-a,m-g,t-p,c-r).normalize();b[1].setComponents(f+a,m+g,t+p,c+r).normalize();b[2].setComponents(f+d,m+h,t+l,c+u).normalize();b[3].setComponents(f-d,m-h,t-l,c-u).normalize();b[4].setComponents(f-e,m-k,t-n,c-x).normalize();b[5].setComponents(f+e, +m+k,t+n,c+x).normalize();return this},intersectsObject:function(){var a=new Ua;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere).applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSprite:function(){var a=new Ua;return function(b){a.center.set(0,0,0);a.radius=.7071067811865476;a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d= +0;6>d;d++)if(b[d].distanceToPoint(c)d;d++){var e=c[d];a.x=0e.distanceToPoint(a))return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}});Object.assign(P.prototype,{isMatrix4:!0,set:function(a,b,c,d,e,f,g,h,k,m,l,q,n,t,r,u){var p= +this.elements;p[0]=a;p[4]=b;p[8]=c;p[12]=d;p[1]=e;p[5]=f;p[9]=g;p[13]=h;p[2]=k;p[6]=m;p[10]=l;p[14]=q;p[3]=n;p[7]=t;p[11]=r;p[15]=u;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},clone:function(){return(new P).fromArray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return this}, +copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractBasis:function(a,b,c){a.setFromMatrixColumn(this,0);b.setFromMatrixColumn(this,1);c.setFromMatrixColumn(this,2);return this},makeBasis:function(a,b,c){this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractRotation:function(){var a=new n;return function(b){var c=this.elements,d=b.elements,e=1/a.setFromMatrixColumn(b,0).length(),f=1/a.setFromMatrixColumn(b,1).length(); +b=1/a.setFromMatrixColumn(b,2).length();c[0]=d[0]*e;c[1]=d[1]*e;c[2]=d[2]*e;c[3]=0;c[4]=d[4]*f;c[5]=d[5]*f;c[6]=d[6]*f;c[7]=0;c[8]=d[8]*b;c[9]=d[9]*b;c[10]=d[10]*b;c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return this}}(),makeRotationFromEuler:function(a){a&&a.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c);c=Math.sin(c);var g=Math.cos(d);d=Math.sin(d);var h=Math.cos(e); +e=Math.sin(e);if("XYZ"===a.order){a=f*h;var k=f*e,m=c*h,p=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+m*d;b[5]=a-p*d;b[9]=-c*g;b[2]=p-a*d;b[6]=m+k*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,k=g*e,m=d*h,p=d*e,b[0]=a+p*c,b[4]=m*c-k,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-m,b[6]=p+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,m=d*h,p=d*e,b[0]=a-p*c,b[4]=-f*e,b[8]=m+k*c,b[1]=k+m*c,b[5]=f*h,b[9]=p-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,k=f*e,m=c*h,p=c*e,b[0]=g*h,b[4]=m*d-k,b[8]=a*d+p,b[1]=g*e,b[5]= +p*d+a,b[9]=k*d-m,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===a.order?(a=f*g,k=f*d,m=c*g,p=c*d,b[0]=g*h,b[4]=p-a*e,b[8]=m*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+m,b[10]=a-p*e):"XZY"===a.order&&(a=f*g,k=f*d,m=c*g,p=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+p,b[5]=f*h,b[9]=k*e-m,b[2]=m*e-k,b[6]=c*h,b[10]=p*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},makeRotationFromQuaternion:function(){var a=new n(0,0,0),b=new n(1,1,1);return function(c){return this.compose(a,c,b)}}(),lookAt:function(){var a= +new n,b=new n,c=new n;return function(d,e,f){var g=this.elements;c.subVectors(d,e);0===c.lengthSq()&&(c.z=1);c.normalize();a.crossVectors(f,c);0===a.lengthSq()&&(1===Math.abs(f.z)?c.x+=1E-4:c.z+=1E-4,c.normalize(),a.crossVectors(f,c));a.normalize();b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."), +this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},premultiply:function(a){return this.multiplyMatrices(a,this)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements;b=this.elements;a=c[0];var e=c[4],f=c[8],g=c[12],h=c[1],k=c[5],m=c[9],p=c[13],l=c[2],n=c[6],t=c[10],r=c[14],u=c[3],x=c[7],A=c[11];c=c[15];var w=d[0],y=d[4],D=d[8],J=d[12],B=d[1],F=d[5],C=d[9],z=d[13],E=d[2],G=d[6],I=d[10],K=d[14],M=d[3],X=d[7],Q=d[11];d=d[15];b[0]=a*w+e*B+f*E+g*M;b[4]=a*y+e*F+f*G+g*X;b[8]=a*D+e*C+f*I+ +g*Q;b[12]=a*J+e*z+f*K+g*d;b[1]=h*w+k*B+m*E+p*M;b[5]=h*y+k*F+m*G+p*X;b[9]=h*D+k*C+m*I+p*Q;b[13]=h*J+k*z+m*K+p*d;b[2]=l*w+n*B+t*E+r*M;b[6]=l*y+n*F+t*G+r*X;b[10]=l*D+n*C+t*I+r*Q;b[14]=l*J+n*z+t*K+r*d;b[3]=u*w+x*B+A*E+c*M;b[7]=u*y+x*F+A*G+c*X;b[11]=u*D+x*C+A*I+c*Q;b[15]=u*J+x*z+A*K+c*d;return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},applyToBufferAttribute:function(){var a= +new n;return function(b){for(var c=0,d=b.count;cthis.determinant()&&(g=-g);c.x=f[12];c.y=f[13];c.z=f[14];b.copy(this);c=1/g;f=1/h;var m=1/k;b.elements[0]*=c;b.elements[1]*=c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=m;b.elements[9]*=m;b.elements[10]*=m;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=k;return this}}(),makePerspective:function(a,b,c,d,e,f){void 0===f&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs."); +var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(c-d);g[9]=(c+d)/(c-d);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=1/(b-a),k=1/(c-d),m=1/(f-e);g[0]=2*h;g[4]=0;g[8]=0;g[12]=-((b+a)*h);g[1]=0;g[5]=2*k;g[9]=0;g[13]=-((c+d)*k);g[2]=0;g[6]=0;g[10]=-2*m;g[14]=-((f+e)*m);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},equals:function(a){var b=this.elements; +a=a.elements;for(var c=0;16>c;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;16>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a}});var T={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif", +alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif", +aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick( specularColor, dotNV );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}", +bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif", +clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif", +clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif", +color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}", +cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif", +defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = normalMatrix * objectTangent;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif", +emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}", +envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif", +envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif", +envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent ));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif", +envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif", +fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif", +gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif", +lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif", +lights_pars_begin:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif", +lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)", +lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif", +lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#endif\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\tfloat clearCoatInv = 1.0 - clearCoatDHR;\n\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec3 singleScattering = vec3( 0.0 );\n\t\tvec3 multiScattering = vec3( 0.0 );\n\t\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\t\tvec3 diffuse = material.diffuseColor;\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * singleScattering;\n\t\treflectedLight.indirectDiffuse += multiScattering * cosineWeightedIrradiance;\n\t\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\t#else\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#endif\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}", +lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearCoatRadiance = vec3( 0.0 );\n#endif", +lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif", +lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, irradiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n#endif", +logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif", +map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif", +metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif", +morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif", +normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t#endif\n#endif", +normal_fragment_maps:"#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t#ifdef FLIP_SIDED\n\t\t\tnormal = - normal;\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tnormal = normalize( normalMatrix * normal );\n\t#else\n\t\t#ifdef USE_TANGENT\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy = normalScale * mapN.xy;\n\t\t\tnormal = normalize( vTBN * mapN );\n\t\t#else\n\t\t\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\t\t#endif\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif", +normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#else\n\t\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\t\tvec2 st0 = dFdx( vUv.st );\n\t\t\tvec2 st1 = dFdy( vUv.st );\n\t\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\t\tvec3 N = normalize( surf_norm );\n\t\t\tmat3 tsn = mat3( S, T, N );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy *= normalScale;\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\treturn normalize( tsn * mapN );\n\t\t}\n\t#endif\n#endif", +packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}", +premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#if defined( DITHERING )\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif", +roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif", +shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif", +shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif", +shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}", +skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif", +skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif", +specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}", +uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif", +uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif", +uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}", +cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}", +depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}", +depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}", +distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}", +distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}", +equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}", +equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}", +linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}", +meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}", +meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}", +meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}", +meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}", +meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}", +meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}", +meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}", +meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}", +meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}", +meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}", +normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}", +normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}", +points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}", +points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}", +shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n}",shadow_vert:"#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}", +sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}", +sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"}, +kh={clone:Pb,merge:ia},lh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643, +darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055, +grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184, +lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130, +palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780, +teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Object.assign(M.prototype,{isColor:!0,r:1,g:1,b:1,set:function(a){a&&a.isColor?this.copy(a):"number"===typeof a?this.setHex(a):"string"===typeof a&&this.setStyle(a);return this},setScalar:function(a){this.b=this.g=this.r=a;return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255; +return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(){function a(a,c,d){0>d&&(d+=1);1d?c:d<2/3?a+6*(c-a)*(2/3-d):a}return function(b,c,d){b=K.euclideanModulo(b,1);c=K.clamp(c,0,1);d=K.clamp(d,0,1);0===c?this.r=this.g=this.b=d:(c=.5>=d?d*(1+c):d+c-d*c,d=2*d-c,this.r=a(d,c,b+1/3),this.g=a(d,c,b),this.b=a(d,c,b-1/3));return this}}(),setStyle:function(a){function b(b){void 0!==b&&1>parseFloat(b)&&console.warn("THREE.Color: Alpha component of "+ +a+" will be ignored.")}var c;if(c=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(a)){var d=c[2];switch(c[1]){case "rgb":case "rgba":if(c=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r=Math.min(255,parseInt(c[1],10))/255,this.g=Math.min(255,parseInt(c[2],10))/255,this.b=Math.min(255,parseInt(c[3],10))/255,b(c[5]),this;if(c=/^(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r=Math.min(100,parseInt(c[1],10))/100,this.g=Math.min(100,parseInt(c[2], +10))/100,this.b=Math.min(100,parseInt(c[3],10))/100,b(c[5]),this;break;case "hsl":case "hsla":if(c=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d)){d=parseFloat(c[1])/360;var e=parseInt(c[2],10)/100,f=parseInt(c[3],10)/100;b(c[5]);return this.setHSL(d,e,f)}}}else if(c=/^#([A-Fa-f0-9]+)$/.exec(a)){c=c[1];d=c.length;if(3===d)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2), +16)/255,this;if(6===d)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}a&&0a?.0773993808*a:Math.pow(.9478672986*a+.0521327014,2.4)}return function(b){this.r=a(b.r);this.g=a(b.g);this.b= +a(b.b);return this}}(),copyLinearToSRGB:function(){function a(a){return.0031308>a?12.92*a:1.055*Math.pow(a,.41666)-.055}return function(b){this.r=a(b.r);this.g=a(b.g);this.b=a(b.b);return this}}(),convertSRGBToLinear:function(){this.copySRGBToLinear(this);return this},convertLinearToSRGB:function(){this.copyLinearToSRGB(this);return this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(a){void 0=== +a&&(console.warn("THREE.Color: .getHSL() target is now required"),a={h:0,s:0,l:0});var b=this.r,c=this.g,d=this.b,e=Math.max(b,c,d),f=Math.min(b,c,d),g,h=(f+e)/2;if(f===e)f=g=0;else{var k=e-f;f=.5>=h?k/(e+f):k/(2-e-f);switch(e){case b:g=(c-d)/k+(cMath.abs(g)?(this._x=Math.atan2(-m,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(q,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(m,-1,1)),.99999>Math.abs(m)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,k)):(this._y=Math.atan2(-l,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(q,-1,1)),.99999>Math.abs(q)?(this._y=Math.atan2(-l,e),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(l, +-1,1)),.99999>Math.abs(l)?(this._x=Math.atan2(q,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-m,k),this._y=Math.atan2(-l,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(q,k),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-m,e),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order= +b;if(!1!==c)this.onChangeCallback();return this},setFromQuaternion:function(){var a=new P;return function(b,c,d){a.makeRotationFromQuaternion(b);return this.setFromRotationMatrix(a,c,d)}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(){var a=new aa;return function(b){a.setFromEuler(this);return this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x= +a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._order;return a},toVector3:function(a){return a?a.set(this._x,this._y,this._z):new n(this._x,this._y,this._z)},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){}});Object.assign(be.prototype,{set:function(a){this.mask=1<g;g++)if(d[g]===d[(g+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(d=a[f],this.faces.splice(d,1),c=0,e= +this.faceVertexUvs.length;cthis.opacity&&(d.opacity=this.opacity);!0===this.transparent&&(d.transparent=this.transparent);d.depthFunc=this.depthFunc;d.depthTest=this.depthTest;d.depthWrite=this.depthWrite;0!==this.rotation&&(d.rotation=this.rotation);!0===this.polygonOffset&&(d.polygonOffset=!0);0!==this.polygonOffsetFactor&&(d.polygonOffsetFactor=this.polygonOffsetFactor);0!==this.polygonOffsetUnits&&(d.polygonOffsetUnits=this.polygonOffsetUnits); +1!==this.linewidth&&(d.linewidth=this.linewidth);void 0!==this.dashSize&&(d.dashSize=this.dashSize);void 0!==this.gapSize&&(d.gapSize=this.gapSize);void 0!==this.scale&&(d.scale=this.scale);!0===this.dithering&&(d.dithering=!0);0a?b.copy(this.origin):b.copy(this.direction).multiplyScalar(a).add(this.origin)},distanceToPoint:function(a){return Math.sqrt(this.distanceSqToPoint(a))},distanceSqToPoint:function(){var a=new n;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceToSquared(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceToSquared(b)}}(),distanceSqToSegment:function(){var a= +new n,b=new n,c=new n;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5);b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),k=-this.direction.dot(b),m=c.dot(this.direction),l=-c.dot(b),n=c.lengthSq(),v=Math.abs(1-k*k);if(0=-t?e<=t?(h=1/v,d*=h,e*=h,k=d*(d+k*e+2*m)+e*(k*d+e+2*l)+n):(e=h,d=Math.max(0,-(k*e+m)),k=-d*d+e*(e+2*l)+n):(e=-h,d=Math.max(0,-(k*e+m)),k=-d*d+e*(e+2*l)+n):e<=-t?(d=Math.max(0,-(-k*h+m)),e=0b)return null; +b=Math.sqrt(b-e);e=d-b;d+=b;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),intersectsSphere:function(a){return this.distanceSqToPoint(a.center)<=a.radius*a.radius},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0===b)return 0===a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){a=this.distanceToPlane(a);return null===a?null:this.at(a,b)},intersectsPlane:function(a){var b=a.distanceToPoint(this.origin); +return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},intersectBox:function(a,b){var c=1/this.direction.x;var d=1/this.direction.y;var e=1/this.direction.z,f=this.origin;if(0<=c){var g=(a.min.x-f.x)*c;c*=a.max.x-f.x}else g=(a.max.x-f.x)*c,c*=a.min.x-f.x;if(0<=d){var h=(a.min.y-f.y)*d;d*=a.max.y-f.y}else h=(a.max.y-f.y)*d,d*=a.min.y-f.y;if(g>d||h>c)return null;if(h>g||g!==g)g=h;if(da||h>c)return null; +if(h>g||g!==g)g=h;if(ac?null:this.at(0<=g?g:c,b)},intersectsBox:function(){var a=new n;return function(b){return null!==this.intersectBox(b,a)}}(),intersectTriangle:function(){var a=new n,b=new n,c=new n,d=new n;return function(e,f,g,h,k){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0f)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null; +g=h*this.direction.dot(b.cross(a));if(0>g||e+g>f)return null;e=-h*a.dot(d);return 0>e?null:this.at(e/f,k)}}(),applyMatrix4:function(a){this.origin.applyMatrix4(a);this.direction.transformDirection(a);return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)}});Object.assign(ra,{getNormal:function(){var a=new n;return function(b,c,d,e){void 0===e&&(console.warn("THREE.Triangle: .getNormal() target is now required"),e=new n);e.subVectors(d,c);a.subVectors(b, +c);e.cross(a);b=e.lengthSq();return 0=a.x+a.y}}(),getUV:function(){var a=new n;return function(b,c,d,e,f,g,h,k){this.getBarycoord(b,c,d,e,a);k.set(0,0);k.addScaledVector(f,a.x);k.addScaledVector(g,a.y);k.addScaledVector(h,a.z);return k}}()});Object.assign(ra.prototype,{set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this}, +clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},getArea:function(){var a=new n,b=new n;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return.5*a.cross(b).length()}}(),getMidpoint:function(a){void 0===a&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),a=new n);return a.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(a){return ra.getNormal(this.a, +this.b,this.c,a)},getPlane:function(a){void 0===a&&(console.warn("THREE.Triangle: .getPlane() target is now required"),a=new n);return a.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(a,b){return ra.getBarycoord(a,this.a,this.b,this.c,b)},containsPoint:function(a){return ra.containsPoint(a,this.a,this.b,this.c)},getUV:function(a,b,c,d,e){return ra.getUV(a,this.a,this.b,this.c,b,c,d,e)},intersectsBox:function(a){return a.intersectsTriangle(this)},closestPointToPoint:function(){var a= +new n,b=new n,c=new n,d=new n,e=new n,f=new n;return function(g,h){void 0===h&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),h=new n);var k=this.a,m=this.b,l=this.c;a.subVectors(m,k);b.subVectors(l,k);d.subVectors(g,k);var q=a.dot(d),v=b.dot(d);if(0>=q&&0>=v)return h.copy(k);e.subVectors(g,m);var t=a.dot(e),r=b.dot(e);if(0<=t&&r<=t)return h.copy(m);var u=q*r-t*v;if(0>=u&&0<=q&&0>=t)return m=q/(q-t),h.copy(k).addScaledVector(a,m);f.subVectors(g,l);g=a.dot(f);var x= +b.dot(f);if(0<=x&&g<=x)return h.copy(l);q=g*v-q*x;if(0>=q&&0<=v&&0>=x)return u=v/(v-x),h.copy(k).addScaledVector(b,u);v=t*x-g*r;if(0>=v&&0<=r-t&&0<=g-x)return c.subVectors(l,m),u=(r-t)/(r-t+(g-x)),h.copy(m).addScaledVector(c,u);l=1/(v+q+u);m=q*l;u*=l;return h.copy(k).addScaledVector(a,m).addScaledVector(b,u)}}(),equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}});Da.prototype=Object.create(O.prototype);Da.prototype.constructor=Da;Da.prototype.isMeshBasicMaterial= +!0;Da.prototype.copy=function(a){O.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap; +this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;return this};va.prototype=Object.assign(Object.create(C.prototype),{constructor:va,isMesh:!0,setDrawMode:function(a){this.drawMode=a},copy:function(a){C.prototype.copy.call(this,a);this.drawMode=a.drawMode;void 0!==a.morphTargetInfluences&&(this.morphTargetInfluences=a.morphTargetInfluences.slice());void 0!==a.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},a.morphTargetDictionary)); +return this},updateMorphTargets:function(){var a=this.geometry;if(a.isBufferGeometry){a=a.morphAttributes;var b=Object.keys(a);if(0c.far?null:{distance:b,point:w.clone(),object:a}}function b(b,c,d,e,p,n,w,C,z,E){f.fromBufferAttribute(p,C);g.fromBufferAttribute(p,z);h.fromBufferAttribute(p,E);p=b.morphTargetInfluences;if(c.morphTargets&&n&&p){q.set(0,0,0);v.set(0,0,0);t.set(0,0,0);for(var y= +0,J=n.length;ye.far||f.push({distance:r,point:b.clone(),uv:ra.getUV(b,h,k,m,l,q,v,new B),face:null,object:this})}}(),clone:function(){return(new this.constructor(this.material)).copy(this)}, +copy:function(a){C.prototype.copy.call(this,a);void 0!==a.center&&this.center.copy(a.center);return this}});Jc.prototype=Object.assign(Object.create(C.prototype),{constructor:Jc,copy:function(a){C.prototype.copy.call(this,a,!1);a=a.levels;for(var b=0,c=a.length;b=d[e].distance)d[e-1].object.visible=!1,d[e].object.visible=!0;else break;for(;ef||(l.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(l),ud.far|| +e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}else for(g=0,r=t.length/3-1;gf||(l.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(l),ud.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g.isGeometry)for(k=g.vertices,m=k.length,g=0;gf||(l.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(l),ud.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});V.prototype=Object.assign(Object.create(oa.prototype),{constructor:V,isLineSegments:!0,computeLineDistances:function(){var a=new n,b=new n;return function(){var c=this.geometry;if(c.isBufferGeometry)if(null=== +c.index){for(var d=c.attributes.position,e=[],f=0,g=d.count;fd.far||e.push({distance:a,distanceToRay:Math.sqrt(f),point:q.clone(),index:c,face:null,object:g}))}var g=this,h=this.geometry,k=this.matrixWorld,m=d.params.Points.threshold;null===h.boundingSphere&&h.computeBoundingSphere();c.copy(h.boundingSphere);c.applyMatrix4(k);c.radius+=m;if(!1!==d.ray.intersectsSphere(c)){a.getInverse(k); +b.copy(d.ray).applyMatrix4(a);m/=(this.scale.x+this.scale.y+this.scale.z)/3;var l=m*m;m=new n;var q=new n;if(h.isBufferGeometry){var v=h.index;h=h.attributes.position.array;if(null!==v){var t=v.array;v=0;for(var r=t.length;v=a.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});Yb.prototype=Object.create(W.prototype);Yb.prototype.constructor=Yb;Yb.prototype.isCompressedTexture=!0;Lc.prototype=Object.create(W.prototype);Lc.prototype.constructor=Lc;Lc.prototype.isCanvasTexture=!0;Mc.prototype=Object.create(W.prototype);Mc.prototype.constructor=Mc;Mc.prototype.isDepthTexture=!0;Zb.prototype=Object.create(z.prototype);Zb.prototype.constructor=Zb;Nc.prototype= +Object.create(N.prototype);Nc.prototype.constructor=Nc;$b.prototype=Object.create(z.prototype);$b.prototype.constructor=$b;Oc.prototype=Object.create(N.prototype);Oc.prototype.constructor=Oc;ka.prototype=Object.create(z.prototype);ka.prototype.constructor=ka;Pc.prototype=Object.create(N.prototype);Pc.prototype.constructor=Pc;ac.prototype=Object.create(ka.prototype);ac.prototype.constructor=ac;Qc.prototype=Object.create(N.prototype);Qc.prototype.constructor=Qc;yb.prototype=Object.create(ka.prototype); +yb.prototype.constructor=yb;Rc.prototype=Object.create(N.prototype);Rc.prototype.constructor=Rc;bc.prototype=Object.create(ka.prototype);bc.prototype.constructor=bc;Sc.prototype=Object.create(N.prototype);Sc.prototype.constructor=Sc;cc.prototype=Object.create(ka.prototype);cc.prototype.constructor=cc;Tc.prototype=Object.create(N.prototype);Tc.prototype.constructor=Tc;zb.prototype=Object.create(z.prototype);zb.prototype.constructor=zb;zb.prototype.toJSON=function(){var a=z.prototype.toJSON.call(this); +a.path=this.parameters.path.toJSON();return a};Uc.prototype=Object.create(N.prototype);Uc.prototype.constructor=Uc;dc.prototype=Object.create(z.prototype);dc.prototype.constructor=dc;Vc.prototype=Object.create(N.prototype);Vc.prototype.constructor=Vc;ec.prototype=Object.create(z.prototype);ec.prototype.constructor=ec;var mh={triangulate:function(a,b,c){c=c||2;var d=b&&b.length,e=d?b[0]*c:a.length,f=vf(a,0,e,c,!0),g=[];if(!f)return g;var h;if(d){var k=c;d=[];var m;var l=0;for(m=b.length;l80*c){var t=h=a[0];var r=d=a[1];for(k=c;kh&&(h=l),b>d&&(d=b);h=Math.max(h-t,d-r);h=0!==h?1/h:0}Yc(f,g,c,t,r,h);return g}},cb={area:function(a){for(var b=a.length,c=0,d=b-1,e=0;e +cb.area(a)},triangulateShape:function(a,b){var c=[],d=[],e=[];zf(a);Af(c,a);var f=a.length;b.forEach(zf);for(a=0;aMath.abs(g-k)?[new B(a,1-c),new B(h,1-d), +new B(m,1-e),new B(n,1-b)]:[new B(g,1-c),new B(k,1-d),new B(l,1-e),new B(v,1-b)]}};$c.prototype=Object.create(N.prototype);$c.prototype.constructor=$c;fc.prototype=Object.create(Ya.prototype);fc.prototype.constructor=fc;ad.prototype=Object.create(N.prototype);ad.prototype.constructor=ad;Cb.prototype=Object.create(z.prototype);Cb.prototype.constructor=Cb;bd.prototype=Object.create(N.prototype);bd.prototype.constructor=bd;gc.prototype=Object.create(z.prototype);gc.prototype.constructor=gc;cd.prototype= +Object.create(N.prototype);cd.prototype.constructor=cd;hc.prototype=Object.create(z.prototype);hc.prototype.constructor=hc;Db.prototype=Object.create(N.prototype);Db.prototype.constructor=Db;Db.prototype.toJSON=function(){var a=N.prototype.toJSON.call(this);return Cf(this.parameters.shapes,a)};Eb.prototype=Object.create(z.prototype);Eb.prototype.constructor=Eb;Eb.prototype.toJSON=function(){var a=z.prototype.toJSON.call(this);return Cf(this.parameters.shapes,a)};ic.prototype=Object.create(z.prototype); +ic.prototype.constructor=ic;Fb.prototype=Object.create(N.prototype);Fb.prototype.constructor=Fb;db.prototype=Object.create(z.prototype);db.prototype.constructor=db;dd.prototype=Object.create(Fb.prototype);dd.prototype.constructor=dd;ed.prototype=Object.create(db.prototype);ed.prototype.constructor=ed;fd.prototype=Object.create(N.prototype);fd.prototype.constructor=fd;jc.prototype=Object.create(z.prototype);jc.prototype.constructor=jc;var ya=Object.freeze({WireframeGeometry:Zb,ParametricGeometry:Nc, +ParametricBufferGeometry:$b,TetrahedronGeometry:Pc,TetrahedronBufferGeometry:ac,OctahedronGeometry:Qc,OctahedronBufferGeometry:yb,IcosahedronGeometry:Rc,IcosahedronBufferGeometry:bc,DodecahedronGeometry:Sc,DodecahedronBufferGeometry:cc,PolyhedronGeometry:Oc,PolyhedronBufferGeometry:ka,TubeGeometry:Tc,TubeBufferGeometry:zb,TorusKnotGeometry:Uc,TorusKnotBufferGeometry:dc,TorusGeometry:Vc,TorusBufferGeometry:ec,TextGeometry:$c,TextBufferGeometry:fc,SphereGeometry:ad,SphereBufferGeometry:Cb,RingGeometry:bd, +RingBufferGeometry:gc,PlaneGeometry:Dc,PlaneBufferGeometry:vb,LatheGeometry:cd,LatheBufferGeometry:hc,ShapeGeometry:Db,ShapeBufferGeometry:Eb,ExtrudeGeometry:Bb,ExtrudeBufferGeometry:Ya,EdgesGeometry:ic,ConeGeometry:dd,ConeBufferGeometry:ed,CylinderGeometry:Fb,CylinderBufferGeometry:db,CircleGeometry:fd,CircleBufferGeometry:jc,BoxGeometry:Rb,BoxBufferGeometry:ub});Gb.prototype=Object.create(O.prototype);Gb.prototype.constructor=Gb;Gb.prototype.isShadowMaterial=!0;Gb.prototype.copy=function(a){O.prototype.copy.call(this, +a);this.color.copy(a.color);return this};kc.prototype=Object.create(Ca.prototype);kc.prototype.constructor=kc;kc.prototype.isRawShaderMaterial=!0;Za.prototype=Object.create(O.prototype);Za.prototype.constructor=Za;Za.prototype.isMeshStandardMaterial=!0;Za.prototype.copy=function(a){O.prototype.copy.call(this,a);this.defines={STANDARD:""};this.color.copy(a.color);this.roughness=a.roughness;this.metalness=a.metalness;this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity; +this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.roughnessMap=a.roughnessMap;this.metalnessMap=a.metalnessMap;this.alphaMap= +a.alphaMap;this.envMap=a.envMap;this.envMapIntensity=a.envMapIntensity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Hb.prototype=Object.create(Za.prototype);Hb.prototype.constructor=Hb;Hb.prototype.isMeshPhysicalMaterial=!0;Hb.prototype.copy=function(a){Za.prototype.copy.call(this, +a);this.defines={PHYSICAL:""};this.reflectivity=a.reflectivity;this.clearCoat=a.clearCoat;this.clearCoatRoughness=a.clearCoatRoughness;return this};La.prototype=Object.create(O.prototype);La.prototype.constructor=La;La.prototype.isMeshPhongMaterial=!0;La.prototype.copy=function(a){O.prototype.copy.call(this,a);this.color.copy(a.color);this.specular.copy(a.specular);this.shininess=a.shininess;this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity= +a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity= +a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Ib.prototype=Object.create(La.prototype);Ib.prototype.constructor=Ib;Ib.prototype.isMeshToonMaterial=!0;Ib.prototype.copy=function(a){La.prototype.copy.call(this,a);this.gradientMap=a.gradientMap; +return this};Jb.prototype=Object.create(O.prototype);Jb.prototype.constructor=Jb;Jb.prototype.isMeshNormalMaterial=!0;Jb.prototype.copy=function(a){O.prototype.copy.call(this,a);this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth= +a.wireframeLinewidth;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Kb.prototype=Object.create(O.prototype);Kb.prototype.constructor=Kb;Kb.prototype.isMeshLambertMaterial=!0;Kb.prototype.copy=function(a){O.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap= +a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Lb.prototype= +Object.create(O.prototype);Lb.prototype.constructor=Lb;Lb.prototype.isMeshMatcapMaterial=!0;Lb.prototype.copy=function(a){O.prototype.copy.call(this,a);this.defines={MATCAP:""};this.color.copy(a.color);this.matcap=a.matcap;this.map=a.map;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias; +this.alphaMap=a.alphaMap;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Mb.prototype=Object.create(R.prototype);Mb.prototype.constructor=Mb;Mb.prototype.isLineDashedMaterial=!0;Mb.prototype.copy=function(a){R.prototype.copy.call(this,a);this.scale=a.scale;this.dashSize=a.dashSize;this.gapSize=a.gapSize;return this};var nh=Object.freeze({ShadowMaterial:Gb,SpriteMaterial:mb,RawShaderMaterial:kc,ShaderMaterial:Ca,PointsMaterial:Ka,MeshPhysicalMaterial:Hb, +MeshStandardMaterial:Za,MeshPhongMaterial:La,MeshToonMaterial:Ib,MeshNormalMaterial:Jb,MeshLambertMaterial:Kb,MeshDepthMaterial:ib,MeshDistanceMaterial:jb,MeshBasicMaterial:Da,MeshMatcapMaterial:Lb,LineDashedMaterial:Mb,LineBasicMaterial:R,Material:O}),pa={arraySlice:function(a,b,c){return pa.isTypedArray(a)?new a.constructor(a.subarray(b,void 0!==c?c:a.length)):a.slice(b,c)},convertArray:function(a,b,c){return!a||!c&&a.constructor===b?a:"number"===typeof b.BYTES_PER_ELEMENT?new b(a):Array.prototype.slice.call(a)}, +isTypedArray:function(a){return ArrayBuffer.isView(a)&&!(a instanceof DataView)},getKeyframeOrder:function(a){for(var b=a.length,c=Array(b),d=0;d!==b;++d)c[d]=d;c.sort(function(b,c){return a[b]-a[c]});return c},sortedArray:function(a,b,c){for(var d=a.length,e=new a.constructor(d),f=0,g=0;g!==d;++f)for(var h=c[f]*b,k=0;k!==b;++k)e[g++]=a[h+k];return e},flattenJSON:function(a,b,c,d){for(var e=1,f=a[0];void 0!==f&&void 0===f[d];)f=a[e++];if(void 0!==f){var g=f[d];if(void 0!==g)if(Array.isArray(g)){do g= +f[d],void 0!==g&&(b.push(f.time),c.push.apply(c,g)),f=a[e++];while(void 0!==f)}else if(void 0!==g.toArray){do g=f[d],void 0!==g&&(b.push(f.time),g.toArray(c,c.length)),f=a[e++];while(void 0!==f)}else{do g=f[d],void 0!==g&&(b.push(f.time),c.push(g)),f=a[e++];while(void 0!==f)}}}};Object.assign(Fa.prototype,{evaluate:function(a){var b=this.parameterPositions,c=this._cachedIndex,d=b[c],e=b[c-1];a:{b:{c:{d:if(!(a=e)break a;else{f=b[1];a=e)break b}d=c;c=0}}for(;c>>1,ab;)--f;++f;if(0!==e||f!==d)e>=f&&(f=Math.max(f,1),e=f-1),a=this.getValueSize(),this.times=pa.arraySlice(c,e,f),this.values=pa.arraySlice(this.values,e*a,f*a);return this},validate:function(){var a=!0,b=this.getValueSize();0!==b-Math.floor(b)&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),a=!1);var c=this.times;b=this.values;var d=c.length;0===d&&(console.error("THREE.KeyframeTrack: Track is empty.", +this),a=!1);for(var e=null,f=0;f!==d;f++){var g=c[f];if("number"===typeof g&&isNaN(g)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,f,g);a=!1;break}if(null!==e&&e>g){console.error("THREE.KeyframeTrack: Out of order keys.",this,f,g,e);a=!1;break}e=g}if(void 0!==b&&pa.isTypedArray(b))for(f=0,c=b.length;f!==c;++f)if(d=b[f],isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,f,d);a=!1;break}return a},optimize:function(){for(var a=this.times,b=this.values, +c=this.getValueSize(),d=2302===this.getInterpolation(),e=1,f=a.length-1,g=1;gg)e=a+1;else if(0b&&(b=0);1Number.EPSILON&&(g.normalize(),c=Math.acos(K.clamp(d[k-1].dot(d[k]),-1,1)),e[k].applyMatrix4(h.makeRotationAxis(g,c))),f[k].crossVectors(d[k],e[k]);if(!0===b)for(c=Math.acos(K.clamp(e[0].dot(e[a]),-1,1)),c/=a,0d;)d+=c;for(;d>c;)d-=c;de&&(e=1);1E-4>d&&(d=e);1E-4>k&&(k=e);Ke.initNonuniformCatmullRom(f.x,g.x,h.x,c.x,d,e,k);Le.initNonuniformCatmullRom(f.y,g.y,h.y,c.y,d,e,k);Me.initNonuniformCatmullRom(f.z,g.z,h.z,c.z,d,e,k)}else"catmullrom"===this.curveType&&(Ke.initCatmullRom(f.x,g.x,h.x,c.x,this.tension),Le.initCatmullRom(f.y,g.y,h.y,c.y,this.tension),Me.initCatmullRom(f.z,g.z,h.z,c.z,this.tension));b.set(Ke.calc(a), +Le.calc(a),Me.calc(a));return b};qa.prototype.copy=function(a){I.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;bc.length-2?c.length-1:a+1];c=c[a>c.length-3?c.length-1:a+2];b.set(Ff(d,e.x,f.x,g.x,c.x),Ff(d,e.y,f.y,g.y,c.y));return b};Qa.prototype.copy=function(a){I.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;b=b)return b=c[a]-b,a=this.curves[a],c=a.getLength(),a.getPointAt(0===c?0:1-b/c);a++}return null},getLength:function(){var a=this.getCurveLengths(); +return a[a.length-1]},updateArcLengths:function(){this.needsUpdate=!0;this.cacheLengths=null;this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var a=[],b=0,c=0,d=this.curves.length;cNumber.EPSILON){if(0>m&&(g=b[f],k=-k,h=b[e],m=-m),!(a.yh.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=m*(a.x-g.x)-k*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=cb.isClockWise,f=this.subPaths;if(0===f.length)return[];if(!0===b)return c(f);b=[];if(1===f.length){var g=f[0];var h=new nb;h.curves=g.curves; +b.push(h);return b}var k=!e(f[0].getPoints());k=a?!k:k;h=[];var m=[],l=[],n=0;m[n]=void 0;l[n]=[];for(var v=0,t=f.length;vl.opacity&&(l.transparent=!0);d.setTextures(k);return d.parse(l)}}()});var Zd,xe={getContext:function(){void 0===Zd&&(Zd=new (window.AudioContext||window.webkitAudioContext));return Zd},setContext:function(a){Zd=a}};Object.assign(ue.prototype,{load:function(a,b,c,d){var e=new Ma(this.manager);e.setResponseType("arraybuffer");e.setPath(this.path);e.load(a,function(a){a=a.slice(0);xe.getContext().decodeAudioData(a,function(a){b(a)})},c,d)},setPath:function(a){this.path=a; +return this}});Object.assign(Hf.prototype,{update:function(){var a,b,c,d,e,f,g,h,k=new P,l=new P;return function(m){if(a!==this||b!==m.focus||c!==m.fov||d!==m.aspect*this.aspect||e!==m.near||f!==m.far||g!==m.zoom||h!==this.eyeSep){a=this;b=m.focus;c=m.fov;d=m.aspect*this.aspect;e=m.near;f=m.far;g=m.zoom;var n=m.projectionMatrix.clone();h=this.eyeSep/2;var p=h*e/b,t=e*Math.tan(K.DEG2RAD*c*.5)/g;l.elements[12]=-h;k.elements[12]=h;var r=-t*d+p;var u=t*d+p;n.elements[0]=2*e/(u-r);n.elements[8]=(u+r)/ +(u-r);this.cameraL.projectionMatrix.copy(n);r=-t*d-p;u=t*d-p;n.elements[0]=2*e/(u-r);n.elements[8]=(u+r)/(u-r);this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(m.matrixWorld).multiply(l);this.cameraR.matrixWorld.copy(m.matrixWorld).multiply(k)}}()});nd.prototype=Object.create(C.prototype);nd.prototype.constructor=nd;Object.assign(ve.prototype,{start:function(){this.oldTime=this.startTime=("undefined"===typeof performance?Date:performance).now();this.elapsedTime=0;this.running=!0}, +stop:function(){this.getElapsedTime();this.autoStart=this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var b=("undefined"===typeof performance?Date:performance).now();a=(b-this.oldTime)/1E3;this.oldTime=b;this.elapsedTime+=a}return a}});we.prototype=Object.assign(Object.create(C.prototype),{constructor:we,getInput:function(){return this.gain},removeFilter:function(){null!== +this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null);return this},getFilter:function(){return this.filter},setFilter:function(a){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination);this.filter=a;this.gain.connect(this.filter);this.filter.connect(this.context.destination);return this},getMasterVolume:function(){return this.gain.gain.value}, +setMasterVolume:function(a){this.gain.gain.setTargetAtTime(a,this.context.currentTime,.01);return this},updateMatrixWorld:function(){var a=new n,b=new aa,c=new n,d=new n,e=new ve;return function(f){C.prototype.updateMatrixWorld.call(this,f);f=this.context.listener;var g=this.up;this.timeDelta=e.getDelta();this.matrixWorld.decompose(a,b,c);d.set(0,0,-1).applyQuaternion(b);if(f.positionX){var h=this.context.currentTime+this.timeDelta;f.positionX.linearRampToValueAtTime(a.x,h);f.positionY.linearRampToValueAtTime(a.y, +h);f.positionZ.linearRampToValueAtTime(a.z,h);f.forwardX.linearRampToValueAtTime(d.x,h);f.forwardY.linearRampToValueAtTime(d.y,h);f.forwardZ.linearRampToValueAtTime(d.z,h);f.upX.linearRampToValueAtTime(g.x,h);f.upY.linearRampToValueAtTime(g.y,h);f.upZ.linearRampToValueAtTime(g.z,h)}else f.setPosition(a.x,a.y,a.z),f.setOrientation(d.x,d.y,d.z,g.x,g.y,g.z)}}()});oc.prototype=Object.assign(Object.create(C.prototype),{constructor:oc,getOutput:function(){return this.gain},setNodeSource:function(a){this.hasPlaybackControl= +!1;this.sourceType="audioNode";this.source=a;this.connect();return this},setMediaElementSource:function(a){this.hasPlaybackControl=!1;this.sourceType="mediaNode";this.source=this.context.createMediaElementSource(a);this.connect();return this},setBuffer:function(a){this.buffer=a;this.sourceType="buffer";this.autoplay&&this.play();return this},play:function(){if(!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control."); +else{var a=this.context.createBufferSource();a.buffer=this.buffer;a.loop=this.loop;a.onended=this.onEnded.bind(this);this.startTime=this.context.currentTime;a.start(this.startTime,this.offset);this.isPlaying=!0;this.source=a;this.setDetune(this.detune);this.setPlaybackRate(this.playbackRate);return this.connect()}},pause:function(){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return!0===this.isPlaying&&(this.source.stop(),this.source.onended= +null,this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this},stop:function(){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return this.source.stop(),this.source.onended=null,this.offset=0,this.isPlaying=!1,this},connect:function(){if(0d&&this._mixBufferRegion(c,a,3*b,1-d,b);d=b;for(var f=b+b;d!==f;++d)if(c[d]!==c[d+b]){e.setValue(c,a);break}},saveOriginalState:function(){var a=this.buffer,b=this.valueSize,c=3*b;this.binding.getValue(a,c);for(var d=b;d!==c;++d)a[d]=a[c+d%b];this.cumulativeWeight=0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_select:function(a, +b,c,d,e){if(.5<=d)for(d=0;d!==e;++d)a[b+d]=a[c+d]},_slerp:function(a,b,c,d){aa.slerpFlat(a,b,a,b,a,c,d)},_lerp:function(a,b,c,d,e){for(var f=1-d,g=0;g!==e;++g){var h=b+g;a[h]=a[h]*f+a[c+g]*d}}});Object.assign(If.prototype,{getValue:function(a,b){this.bind();var c=this._bindings[this._targetGroup.nCachedObjects_];void 0!==c&&c.getValue(a,b)},setValue:function(a,b){for(var c=this._bindings,d=this._targetGroup.nCachedObjects_,e=c.length;d!==e;++d)c[d].setValue(a,b)},bind:function(){for(var a=this._bindings, +b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].bind()},unbind:function(){for(var a=this._bindings,b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].unbind()}});Object.assign(ma,{Composite:If,create:function(a,b,c){return a&&a.isAnimationObjectGroup?new ma.Composite(a,b,c):new ma(a,b,c)},sanitizeNodeName:function(){var a=/[\[\]\.:\/]/g;return function(b){return b.replace(/\s/g,"_").replace(a,"")}}(),parseTrackName:function(){var a="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]", +b=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]");a=/(WCOD+)?/.source.replace("WCOD",a);var c=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),d=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),e=new RegExp("^"+b+a+c+d+"$"),f=["material","materials","bones"];return function(a){var b=e.exec(a);if(!b)throw Error("PropertyBinding: Cannot parse trackName: "+a);b={nodeName:b[2],objectName:b[3],objectIndex:b[4],propertyName:b[5],propertyIndex:b[6]};var c=b.nodeName&& +b.nodeName.lastIndexOf(".");if(void 0!==c&&-1!==c){var d=b.nodeName.substring(c+1);-1!==f.indexOf(d)&&(b.nodeName=b.nodeName.substring(0,c),b.objectName=d)}if(null===b.propertyName||0===b.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+a);return b}}(),findNode:function(a,b){if(!b||""===b||"root"===b||"."===b||-1===b||b===a.name||b===a.uuid)return a;if(a.skeleton){var c=a.skeleton.getBoneByName(b);if(void 0!==c)return c}if(a.children){var d=function(a){for(var c= +0;c=b){var n=b++,q=a[n];c[q.uuid]=l;a[l]=q;c[k]=n;a[n]=h;h=0;for(k=e;h!==k;++h){q=d[h];var v=q[l];q[l]=q[n];q[n]=v}}}this.nCachedObjects_=b},uncache:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._bindings,f=e.length,g=0,h=arguments.length;g!==h;++g){var k=arguments[g].uuid,l=d[k];if(void 0!==l)if(delete d[k],lb||0===c)return;this._startTime=null;b*=c}b*=this._updateTimeScale(a);c=this._updateTime(b);a=this._updateWeight(a);if(0c.parameterPositions[1]&&(this.stopFading(),0===d&&(this.enabled=!1))}}return this._effectiveWeight=b},_updateTimeScale:function(a){var b=0;if(!this.paused){b=this.timeScale;var c=this._timeScaleInterpolant;if(null!==c){var d=c.evaluate(a)[0]; +b*=d;a>c.parameterPositions[1]&&(this.stopWarping(),0===b?this.paused=!0:this.timeScale=b)}}return this._effectiveTimeScale=b},_updateTime:function(a){var b=this.time+a,c=this._clip.duration,d=this.loop,e=this._loopCount,f=2202===d;if(0===a)return-1===e?b:f&&1===(e&1)?c-b:b;if(2200===d)a:{if(-1===e&&(this._loopCount=0,this._setEndings(!0,!0,!1)),b>=c)b=c;else if(0>b)b=0;else break a;this.clampWhenFinished?this.paused=!0:this.enabled=!1;this._mixer.dispatchEvent({type:"finished",action:this,direction:0> +a?-1:1})}else{-1===e&&(0<=a?(e=0,this._setEndings(!0,0===this.repetitions,f)):this._setEndings(0===this.repetitions,!0,f));if(b>=c||0>b){d=Math.floor(b/c);b-=c*d;e+=Math.abs(d);var g=this.repetitions-e;0>=g?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,b=0a,this._setEndings(a,!a,f)):this._setEndings(!1,!1,f),this._loopCount=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:d}))}if(f&& +1===(e&1))return this.time=b,c-b}return this.time=b},_setEndings:function(a,b,c){var d=this._interpolantSettings;c?(d.endingStart=2401,d.endingEnd=2401):(d.endingStart=a?this.zeroSlopeAtStart?2401:2400:2402,d.endingEnd=b?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(a,b,c){var d=this._mixer,e=d.time,f=this._weightInterpolant;null===f&&(this._weightInterpolant=f=d._lendControlInterpolant());d=f.parameterPositions;f=f.sampleValues;d[0]=e;f[0]=b;d[1]=e+a;f[1]=c;return this}});Be.prototype= +Object.assign(Object.create(ta.prototype),{constructor:Be,_bindAction:function(a,b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings;a=a._interpolants;var g=c.uuid,h=this._bindingsByRootAndName,k=h[g];void 0===k&&(k={},h[g]=k);for(h=0;h!==e;++h){var l=d[h],n=l.name,q=k[n];if(void 0===q){q=f[h];if(void 0!==q){null===q._cacheIndex&&(++q.referenceCount,this._addInactiveBinding(q,g,n));continue}q=new Ae(ma.create(c,n,b&&b._propertyBindings[h].binding.parsedPath),l.ValueTypeName, +l.getValueSize());++q.referenceCount;this._addInactiveBinding(q,g,n)}f[h]=q;a[h].resultBuffer=q.buffer}},_activateAction:function(a){if(!this._isActiveAction(a)){if(null===a._cacheIndex){var b=(a._localRoot||this._root).uuid,c=a._clip.uuid,d=this._actionsByClip[c];this._bindAction(a,d&&d.knownActions[0]);this._addInactiveAction(a,c,b)}b=a._propertyBindings;c=0;for(d=b.length;c!==d;++c){var e=b[c];0===e.useCount++&&(this._lendBinding(e),e.saveOriginalState())}this._lendAction(a)}},_deactivateAction:function(a){if(this._isActiveAction(a)){for(var b= +a._propertyBindings,c=0,d=b.length;c!==d;++c){var e=b[c];0===--e.useCount&&(e.restoreOriginalState(),this._takeBackBinding(e))}this._takeBackAction(a)}},_initMemoryManager:function(){this._actions=[];this._nActiveActions=0;this._actionsByClip={};this._bindings=[];this._nActiveBindings=0;this._bindingsByRootAndName={};this._controlInterpolants=[];this._nActiveControlInterpolants=0;var a=this;this.stats={actions:{get total(){return a._actions.length},get inUse(){return a._nActiveActions}},bindings:{get total(){return a._bindings.length}, +get inUse(){return a._nActiveBindings}},controlInterpolants:{get total(){return a._controlInterpolants.length},get inUse(){return a._nActiveControlInterpolants}}}},_isActiveAction:function(a){a=a._cacheIndex;return null!==a&&athis.max.x||a.ythis.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y},getParameter:function(a,b){void 0===b&&(console.warn("THREE.Box2: .getParameter() target is now required"),b=new B); +return b.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y?!1:!0},clampPoint:function(a,b){void 0===b&&(console.warn("THREE.Box2: .clampPoint() target is now required"),b=new B);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new B;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min); +this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}});Object.assign(He.prototype,{set:function(a,b){this.start.copy(a);this.end.copy(b);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},getCenter:function(a){void 0=== +a&&(console.warn("THREE.Line3: .getCenter() target is now required"),a=new n);return a.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){void 0===a&&(console.warn("THREE.Line3: .delta() target is now required"),a=new n);return a.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a,b){void 0===b&&(console.warn("THREE.Line3: .at() target is now required"),b= +new n);return this.delta(b).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new n,b=new n;return function(c,d){a.subVectors(c,this.start);b.subVectors(this.end,this.start);c=b.dot(b);c=b.dot(a)/c;d&&(c=K.clamp(c,0,1));return c}}(),closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);void 0===c&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),c=new n);return this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a); +this.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)}});od.prototype=Object.create(C.prototype);od.prototype.constructor=od;od.prototype.isImmediateRenderObject=!0;pd.prototype=Object.create(V.prototype);pd.prototype.constructor=pd;pd.prototype.update=function(){var a=new n,b=new n,c=new ba;return function(){var d=["a","b","c"];this.object.updateMatrixWorld(!0);c.getNormalMatrix(this.object.matrixWorld);var e=this.object.matrixWorld,f= +this.geometry.attributes.position,g=this.object.geometry;if(g&&g.isGeometry)for(var h=g.vertices,k=g.faces,l=g=0,n=k.length;lMath.abs(b)&&(b=1E-8);this.scale.set(.5*this.size,.5*this.size,b);this.children[0].material.side=0>b?1:0;this.lookAt(this.plane.normal);C.prototype.updateMatrixWorld.call(this,a)};var Xd,Ie;gb.prototype=Object.create(C.prototype); +gb.prototype.constructor=gb;gb.prototype.setDirection=function(){var a=new n,b;return function(c){.99999c.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}();gb.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,Math.max(0,a-b),1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};gb.prototype.setColor= +function(a){this.line.material.color.copy(a);this.cone.material.color.copy(a)};gb.prototype.copy=function(a){C.prototype.copy.call(this,a,!1);this.line.copy(a.line);this.cone.copy(a.cone);return this};gb.prototype.clone=function(){return(new this.constructor).copy(this)};ud.prototype=Object.create(V.prototype);ud.prototype.constructor=ud;I.create=function(a,b){console.log("THREE.Curve.create() has been deprecated");a.prototype=Object.create(I.prototype);a.prototype.constructor=a;a.prototype.getPoint= +b;return a};Object.assign(eb.prototype,{createPointsGeometry:function(a){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");a=this.getPoints(a);return this.createGeometry(a)},createSpacedPointsGeometry:function(a){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");a=this.getSpacedPoints(a);return this.createGeometry(a)},createGeometry:function(a){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead."); +for(var b=new N,c=0,d=a.length;c + +Barcode multimarker example with Three.js + + + + + +

    Barcode multimarker example with Three.js

    +

    On Chrome on Android, tap the screen to start playing video stream.

    +

    Show Multi pattern 4x3 to camera to display objects on top of it. + +

    Back to examples

    + + + + + + + + + + diff --git a/jsartoolkit5/examples/multimarker_pattern_threejs.html b/jsartoolkit5/examples/multimarker_pattern_threejs.html new file mode 100644 index 0000000..c9b84e2 --- /dev/null +++ b/jsartoolkit5/examples/multimarker_pattern_threejs.html @@ -0,0 +1,138 @@ + + +Pattern multimarker example with Three.js + + + + + +

    Pattern multimarker example with Three.js

    +

    On Chrome on Android, tap the screen to start playing video stream.

    +

    Show Multi pattern (template) to camera to display objects on top of it. + +

    Back to examples

    + + + + + + + + + + + diff --git a/jsartoolkit5/examples/nft_improved_worker/index.html b/jsartoolkit5/examples/nft_improved_worker/index.html new file mode 100644 index 0000000..1dd90b2 --- /dev/null +++ b/jsartoolkit5/examples/nft_improved_worker/index.html @@ -0,0 +1,20 @@ + + + nft pages + + + + + +

    jsartoolkit5 demos with ar2Tracking

    +
    Image to recognize for the following examples https://imgur.com/HvcmRVl
    +

    Examples:

    + + + diff --git a/jsartoolkit5/examples/nft_improved_worker/main.html b/jsartoolkit5/examples/nft_improved_worker/main.html new file mode 100644 index 0000000..1e3eaee --- /dev/null +++ b/jsartoolkit5/examples/nft_improved_worker/main.html @@ -0,0 +1,58 @@ + + + NFT_test + + + + +
    Main
    +
    + + +
    + + + + + + + + diff --git a/jsartoolkit5/examples/nft_improved_worker/main.js b/jsartoolkit5/examples/nft_improved_worker/main.js new file mode 100644 index 0000000..676bf49 --- /dev/null +++ b/jsartoolkit5/examples/nft_improved_worker/main.js @@ -0,0 +1,201 @@ +function multiplyMatrices(a, b) { + var ae = a; + var be = b; + var te = new Float64Array(16); + + var a11 = ae[0], a12 = ae[4], a13 = ae[8], a14 = ae[12]; + var a21 = ae[1], a22 = ae[5], a23 = ae[9], a24 = ae[13]; + var a31 = ae[2], a32 = ae[6], a33 = ae[10], a34 = ae[14]; + var a41 = ae[3], a42 = ae[7], a43 = ae[11], a44 = ae[15]; + + var b11 = be[0], b12 = be[4], b13 = be[8], b14 = be[12]; + var b21 = be[1], b22 = be[5], b23 = be[9], b24 = be[13]; + var b31 = be[2], b32 = be[6], b33 = be[10], b34 = be[14]; + var b41 = be[3], b42 = be[7], b43 = be[11], b44 = be[15]; + + te[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41; + te[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42; + te[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43; + te[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44; + + te[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41; + te[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42; + te[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43; + te[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44; + + te[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41; + te[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42; + te[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43; + te[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44; + + te[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41; + te[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42; + te[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43; + te[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44; + + return te; +} +function transformPoint(m, xyz) { + var x = xyz.x, y = xyz.y, z = xyz.z; + var e = m; + + var w = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]); + + var r = {}; + r.x = (e[0] * x + e[4] * y + e[8] * z + e[12]) * w; + r.y = (e[1] * x + e[5] * y + e[9] * z + e[13]) * w; + r.z = (e[2] * x + e[6] * y + e[10] * z + e[14]) * w; + + return r; +} + +function isMobile() { + return /Android|mobile|iPad|iPhone/i.test(navigator.userAgent); +} + +var ar = null; +var markerResult = null; + +var markers = { + "pinball": { + width: 1637, + height: 2048, + dpi: 215, + url: "../DataNFT/pinball", + }, +}; + +function start(container, marker, video, input_width, input_height, canvas_draw, render_update) { + var vw, vh; + var sw, sh; + var pscale, sscale; + var w, h; + var pw, ph; + var ox, oy; + + var canvas_process = document.createElement('canvas'); + var context_draw = canvas_draw.getContext('2d'); + var context_process = canvas_process.getContext('2d'); + + var load = function() { + vw = input_width; + vh = input_height; + + pscale = 320 / Math.max(vw, vh / 3 * 4); + sscale = isMobile() ? window.outerWidth / input_width : 1; + + sw = vw * sscale; + sh = vh * sscale; + video.style.width = sw + "px"; + video.style.height = sh + "px"; + container.style.width = sw + "px"; + container.style.height = sh + "px"; + canvas_draw.style.clientWidth = sw + "px"; + canvas_draw.style.clientHeight = sh + "px"; + canvas_draw.width = sw; + canvas_draw.height = sh; + w = vw * pscale; + h = vh * pscale; + pw = Math.max(w, h / 3 * 4); + ph = Math.max(h, w / 4 * 3); + ox = (pw - w) / 2; + oy = (ph - h) / 2; + canvas_process.style.clientWidth = pw + "px"; + canvas_process.style.clientHeight = ph + "px"; + canvas_process.width = pw; + canvas_process.height = ph; + + var param = new ARCameraParam('../Data/camera_para-iPhone 5 rear 640x480 1.0m.dat'); + param.onload = function () { + ar = new ARController(pw, ph, param); + var cameraMatrix = ar.getCameraMatrix(); + + ar.addEventListener('getNFTMarker', function (ev) { + markerResult = {type: "found", matrixGL_RH: JSON.stringify(ev.data.matrixGL_RH), proj: JSON.stringify(cameraMatrix)}; + }); + + ar.loadNFTMarker(marker.url, function (markerId) { + ar.trackNFTMarkerId(markerId, 2); + console.log("loadNFTMarker -> ", markerId); + }); + + console.log("load complete"); + }; + }; + + var lasttime = Date.now(); + var time = 0; + + var x = 0; + var draw = function() { + context_draw.clearRect(0, 0, vw, vh); + render_update(); + var now = Date.now(); + var dt = now - lasttime; + time += dt; + lasttime = now; + + x += dt; + x %= sw; + context_draw.fillStyle = "#FFF"; + context_draw.fillRect(x, 0, 5, 10); + + + if (!markerResult) return; + var proj = JSON.parse(markerResult.proj); + var world = JSON.parse(markerResult.matrixGL_RH); + + var mat = multiplyMatrices(proj, world); + + function glpointToCanvas(xyz) { + return { + x: (xyz.x + 1) * 0.5 * pw / pscale * sscale - ox / pscale * sscale, + y: (1 - xyz.y) * 0.5 * ph / pscale * sscale - oy / pscale * sscale, + } + } + function drawpoint(x, y, z) { + var r = transformPoint(mat, {x: x, y: y, z: z}); + var c = glpointToCanvas(r); + return c; + } + + var width = marker.width; + var height = marker.height; + var dpi = marker.dpi; + + var w = width / dpi * 2.54 * 10; + var h = height / dpi * 2.54 * 10; + + var p1 = drawpoint(0, 0, 0); + var p2 = drawpoint(w, 0, 0); + var p3 = drawpoint(w, h, 0); + var p4 = drawpoint(0, h, 0); + context_draw.beginPath(); + context_draw.moveTo(p1.x, p1.y); + context_draw.lineTo(p2.x, p2.y); + context_draw.lineTo(p3.x, p3.y); + context_draw.lineTo(p4.x, p4.y); + context_draw.closePath(); + context_draw.strokeStyle = "red"; + context_draw.stroke(); + }; + + function process() { + context_process.fillStyle = "black"; + context_process.fillRect(0, 0, pw, ph); + context_process.drawImage(video, 0, 0, vw, vh, ox, oy, w, h); + markerResult = null; + if (ar) { + var imageData = context_process.getImageData(0, 0, pw, ph); + ar.process(imageData); + } + } + var tick = function() { + process(); + draw(); + requestAnimationFrame(tick); + }; + + load(); + tick(); +} diff --git a/jsartoolkit5/examples/nft_improved_worker/main_threejs_wasm_worker.html b/jsartoolkit5/examples/nft_improved_worker/main_threejs_wasm_worker.html new file mode 100644 index 0000000..fa1fc82 --- /dev/null +++ b/jsartoolkit5/examples/nft_improved_worker/main_threejs_wasm_worker.html @@ -0,0 +1,140 @@ + + + + + NFT marker example with a WebWorker, WASM and with Three.js + + + + +
    + + Loading, please wait +
    + + +
    + +
    +

    + Main +

    +
    + +
    +

    + Worker +

    +
    + +
    + + + +
    + + + +
    + + + 🖼 Marker Image + + + + + + + + + diff --git a/jsartoolkit5/examples/nft_improved_worker/main_threejs_worker.html b/jsartoolkit5/examples/nft_improved_worker/main_threejs_worker.html new file mode 100644 index 0000000..eb02568 --- /dev/null +++ b/jsartoolkit5/examples/nft_improved_worker/main_threejs_worker.html @@ -0,0 +1,141 @@ + + + + + NFT marker example with a WebWorker and Three.js + + + + +
    + + Loading, please wait +
    + + +
    + +
    +

    + Main +

    +
    + +
    +

    + Worker +

    +
    + +
    + + + +
    + + + +
    + + + 🖼 Marker Image + + + + + + + + + + diff --git a/jsartoolkit5/examples/nft_improved_worker/main_worker.html b/jsartoolkit5/examples/nft_improved_worker/main_worker.html new file mode 100644 index 0000000..656f034 --- /dev/null +++ b/jsartoolkit5/examples/nft_improved_worker/main_worker.html @@ -0,0 +1,65 @@ + + + NFT_test + + + + +
    Main
    +
    Worker
    +
    + + +
    + + + + + + + diff --git a/jsartoolkit5/examples/nft_improved_worker/main_worker.js b/jsartoolkit5/examples/nft_improved_worker/main_worker.js new file mode 100644 index 0000000..adf6763 --- /dev/null +++ b/jsartoolkit5/examples/nft_improved_worker/main_worker.js @@ -0,0 +1,207 @@ +function multiplyMatrices(a, b) { + var ae = a; + var be = b; + var te = new Float64Array(16); + + var a11 = ae[0], a12 = ae[4], a13 = ae[8], a14 = ae[12]; + var a21 = ae[1], a22 = ae[5], a23 = ae[9], a24 = ae[13]; + var a31 = ae[2], a32 = ae[6], a33 = ae[10], a34 = ae[14]; + var a41 = ae[3], a42 = ae[7], a43 = ae[11], a44 = ae[15]; + + var b11 = be[0], b12 = be[4], b13 = be[8], b14 = be[12]; + var b21 = be[1], b22 = be[5], b23 = be[9], b24 = be[13]; + var b31 = be[2], b32 = be[6], b33 = be[10], b34 = be[14]; + var b41 = be[3], b42 = be[7], b43 = be[11], b44 = be[15]; + + te[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41; + te[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42; + te[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43; + te[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44; + + te[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41; + te[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42; + te[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43; + te[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44; + + te[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41; + te[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42; + te[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43; + te[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44; + + te[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41; + te[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42; + te[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43; + te[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44; + + return te; +} + +function transformPoint(m, xyz) { + var x = xyz.x, y = xyz.y, z = xyz.z; + var e = m; + + var w = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]); + + var r = {}; + r.x = (e[0] * x + e[4] * y + e[8] * z + e[12]) * w; + r.y = (e[1] * x + e[5] * y + e[9] * z + e[13]) * w; + r.z = (e[2] * x + e[6] * y + e[10] * z + e[14]) * w; + + return r; +} + +function isMobile() { + return /Android|mobile|iPad|iPhone/i.test(navigator.userAgent); +} + +var markers = { + "pinball": { + width: 1637, + height: 2048, + dpi: 215, + url: "./examples/DataNFT/pinball", + }, +}; + +function start(container, marker, video, input_width, input_height, canvas_draw, render_update, track_update) { + var vw, vh; + var sw, sh; + var pscale, sscale; + var w, h; + var pw, ph; + var ox, oy; + var worker; + var camera_para = './../examples/Data/camera_para-iPhone 5 rear 640x480 1.0m.dat' + + var canvas_process = document.createElement('canvas'); + var context_draw = canvas_draw.getContext('2d'); + var context_process = canvas_process.getContext('2d'); + + var load = function() { + vw = input_width; + vh = input_height; + + pscale = 320 / Math.max(vw, vh / 3 * 4); + sscale = isMobile() ? window.outerWidth / input_width : 1; + + sw = vw * sscale; + sh = vh * sscale; + video.style.width = sw + "px"; + video.style.height = sh + "px"; + container.style.width = sw + "px"; + container.style.height = sh + "px"; + canvas_draw.style.clientWidth = sw + "px"; + canvas_draw.style.clientHeight = sh + "px"; + canvas_draw.width = sw; + canvas_draw.height = sh; + w = vw * pscale; + h = vh * pscale; + pw = Math.max(w, h / 3 * 4); + ph = Math.max(h, w / 4 * 3); + ox = (pw - w) / 2; + oy = (ph - h) / 2; + canvas_process.style.clientWidth = pw + "px"; + canvas_process.style.clientHeight = ph + "px"; + canvas_process.width = pw; + canvas_process.height = ph; + + worker = new Worker('../../js/artoolkit.worker.js'); + + worker.postMessage({type: "load", pw: pw, ph: ph, camera_para: camera_para, marker: '../' + marker.url}); + + worker.onmessage = function(ev) { + var msg = ev.data; + switch (msg.type) { + case "found": { + found(msg); + break; + } + case "not found": { + found(null); + break; + } + } + track_update(); + process(); + }; + }; + + var lastmsg = null; + var found = function(msg) { + lastmsg = msg; + }; + + var lasttime = Date.now(); + var time = 0; + + var x = 0; + + var draw = function() { + context_draw.clearRect(0, 0, vw, vh); + render_update(); + var now = Date.now(); + var dt = now - lasttime; + time += dt; + lasttime = now; + + x += dt; + x %= sw; + context_draw.fillStyle = "#FFF"; + context_draw.fillRect(x, 0, 5, 10); + + if (!lastmsg) return; + var proj = JSON.parse(lastmsg.proj); + var world = JSON.parse(lastmsg.matrixGL_RH); + + var mat = multiplyMatrices(proj, world); + + function glpointToCanvas(xyz) { + return { + x: (xyz.x + 1) * 0.5 * pw / pscale * sscale - ox / pscale * sscale, + y: (1 - xyz.y) * 0.5 * ph / pscale * sscale - oy / pscale * sscale, + } + } + function drawpoint(x, y, z) { + var r = transformPoint(mat, {x: x, y: y, z: z}); + var c = glpointToCanvas(r); + return c; + } + + var width = marker.width; + var height = marker.height; + var dpi = marker.dpi; + + var w = width / dpi * 2.54 * 10; + var h = height / dpi * 2.54 * 10; + + var p1 = drawpoint(0, 0, 0); + var p2 = drawpoint(w, 0, 0); + var p3 = drawpoint(w, h, 0); + var p4 = drawpoint(0, h, 0); + context_draw.beginPath(); + context_draw.moveTo(p1.x, p1.y); + context_draw.lineTo(p2.x, p2.y); + context_draw.lineTo(p3.x, p3.y); + context_draw.lineTo(p4.x, p4.y); + context_draw.closePath(); + context_draw.strokeStyle = "red"; + context_draw.stroke(); + }; + + function process() { + context_process.fillStyle = "black"; + context_process.fillRect(0, 0, pw, ph); + context_process.drawImage(video, 0, 0, vw, vh, ox, oy, w, h); + + var imageData = context_process.getImageData(0, 0, pw, ph); + worker.postMessage({type: "process", imagedata: imageData}, [imageData.data.buffer]); + } + var tick = function() { + draw(); + requestAnimationFrame(tick); + }; + + load(); + tick(); + process(); +} diff --git a/jsartoolkit5/examples/nft_improved_worker/threejs_wasm_worker.js b/jsartoolkit5/examples/nft_improved_worker/threejs_wasm_worker.js new file mode 100644 index 0000000..9600328 --- /dev/null +++ b/jsartoolkit5/examples/nft_improved_worker/threejs_wasm_worker.js @@ -0,0 +1,222 @@ +function isMobile() { + return /Android|mobile|iPad|iPhone/i.test(navigator.userAgent); +} + +var interpolationFactor = 24; + +var trackedMatrix = { + // for interpolation + delta: [ + 0,0,0,0, + 0,0,0,0, + 0,0,0,0, + 0,0,0,0 + ], + interpolated: [ + 0,0,0,0, + 0,0,0,0, + 0,0,0,0, + 0,0,0,0 + ] +} + +var markers = { + "pinball": { + width: 1637, + height: 2048, + dpi: 250, + url: "../DataNFT/pinball", + }, +}; + +var setMatrix = function (matrix, value) { + var array = []; + for (var key in value) { + array[key] = value[key]; + } + if (typeof matrix.elements.set === "function") { + matrix.elements.set(array); + } else { + matrix.elements = [].slice.call(array); + } +}; + +//var worker; +function start(container, marker, video, input_width, input_height, canvas_draw, render_update, track_update) { + worker = new Worker('wasm_worker/artoolkit.wasm_worker.js'); + worker.onmessage = function(ev) { + start2(container, marker, video, input_width, input_height, canvas_draw, render_update, track_update); + } +} + +function start2(container, marker, video, input_width, input_height, canvas_draw, render_update, track_update) { + var vw, vh; + var sw, sh; + var pscale, sscale; + var w, h; + var pw, ph; + var ox, oy; + var camera_para = './../../Data/camera_para-iPhone 5 rear 640x480 1.0m.dat' + + var canvas_process = document.createElement('canvas'); + var context_process = canvas_process.getContext('2d'); + + var renderer = new THREE.WebGLRenderer({canvas: canvas_draw, alpha: true, antialias: true}); + renderer.setPixelRatio(window.devicePixelRatio); + + var scene = new THREE.Scene(); + + var camera = new THREE.Camera(); + camera.matrixAutoUpdate = false; + + scene.add(camera); + + var sphere = new THREE.Mesh( + new THREE.SphereGeometry(0.5, 8, 8), + new THREE.MeshNormalMaterial() + ); + + var root = new THREE.Object3D(); + scene.add(root); + + sphere.material.flatShading; + sphere.position.z = 0; + sphere.position.x = 100; + sphere.position.y = 100; + sphere.scale.set(200, 200, 200); + + root.matrixAutoUpdate = false; + root.add(sphere); + + var load = function() { + vw = input_width; + vh = input_height; + + pscale = 320 / Math.max(vw, vh / 3 * 4); + sscale = isMobile() ? window.outerWidth / input_width : 1; + + sw = vw * sscale; + sh = vh * sscale; + video.style.width = sw + "px"; + video.style.height = sh + "px"; + container.style.width = sw + "px"; + container.style.height = sh + "px"; + canvas_draw.style.clientWidth = sw + "px"; + canvas_draw.style.clientHeight = sh + "px"; + canvas_draw.width = sw; + canvas_draw.height = sh; + w = vw * pscale; + h = vh * pscale; + pw = Math.max(w, h / 3 * 4); + ph = Math.max(h, w / 4 * 3); + ox = (pw - w) / 2; + oy = (ph - h) / 2; + canvas_process.style.clientWidth = pw + "px"; + canvas_process.style.clientHeight = ph + "px"; + canvas_process.width = pw; + canvas_process.height = ph; + + renderer.setSize(sw, sh); + + worker.postMessage({type: "load", pw: pw, ph: ph, camera_para: camera_para, marker: '../' + marker.url}); + + worker.onmessage = function(ev) { + var msg = ev.data; + switch (msg.type) { + case "loaded": { + var proj = JSON.parse(msg.proj); + var ratioW = pw / w; + var ratioH = ph / h; + proj[0] *= ratioW; + proj[4] *= ratioW; + proj[8] *= ratioW; + proj[12] *= ratioW; + proj[1] *= ratioH; + proj[5] *= ratioH; + proj[9] *= ratioH; + proj[13] *= ratioH; + setMatrix(camera.projectionMatrix, proj); + break; + } + + case "endLoading": { + if (msg.end == true) + // removing loader page if present + document.body.classList.remove("loading"); + document.getElementById("loading").remove(); + break; + } + + case "found": { + found(msg); + break; + } + + case "not found": { + found(null); + break; + } + } + + track_update(); + process(); + }; + }; + + var world; + + var found = function(msg) { + if (!msg) { + world = null; + } else { + world = JSON.parse(msg.matrixGL_RH); + } + }; + + var lasttime = Date.now(); + var time = 0; + + var draw = function() { + render_update(); + var now = Date.now(); + var dt = now - lasttime; + time += dt; + lasttime = now; + + if (!world) { + sphere.visible = false; + } else { + sphere.visible = true; + // interpolate matrix + for (var i = 0; i < 16; i++) { + trackedMatrix.delta[i] = world[i] - trackedMatrix.interpolated[i]; + trackedMatrix.interpolated[i] = + trackedMatrix.interpolated[i] + + trackedMatrix.delta[i] / interpolationFactor; + } + + // set matrix of 'root' by detected 'world' matrix + setMatrix(root.matrix, trackedMatrix.interpolated); + } + renderer.render(scene, camera); + }; + + function process() { + context_process.fillStyle = "black"; + context_process.fillRect(0, 0, pw, ph); + context_process.drawImage(video, 0, 0, vw, vh, ox, oy, w, h); + + var imageData = context_process.getImageData(0, 0, pw, ph); + worker.postMessage({ type: "process", imagedata: imageData }, [ + imageData.data.buffer + ]); + } + var tick = function() { + draw(); + requestAnimationFrame(tick); + }; + + load(); + tick(); + process(); +} diff --git a/jsartoolkit5/examples/nft_improved_worker/threejs_worker.js b/jsartoolkit5/examples/nft_improved_worker/threejs_worker.js new file mode 100644 index 0000000..7f5d36e --- /dev/null +++ b/jsartoolkit5/examples/nft_improved_worker/threejs_worker.js @@ -0,0 +1,211 @@ +function isMobile() { + return /Android|mobile|iPad|iPhone/i.test(navigator.userAgent); +} + +var interpolationFactor = 24; + +var trackedMatrix = { + // for interpolation + delta: [ + 0,0,0,0, + 0,0,0,0, + 0,0,0,0, + 0,0,0,0 + ], + interpolated: [ + 0,0,0,0, + 0,0,0,0, + 0,0,0,0, + 0,0,0,0 + ] +} + +var markers = { + "pinball": { + width: 1637, + height: 2048, + dpi: 250, + url: "./examples/DataNFT/pinball", + }, +}; + +var setMatrix = function (matrix, value) { + var array = []; + for (var key in value) { + array[key] = value[key]; + } + if (typeof matrix.elements.set === "function") { + matrix.elements.set(array); + } else { + matrix.elements = [].slice.call(array); + } +}; + +function start(container, marker, video, input_width, input_height, canvas_draw, render_update, track_update, greyCover) { + var vw, vh; + var sw, sh; + var pscale, sscale; + var w, h; + var pw, ph; + var ox, oy; + var worker; + var camera_para = './../examples/Data/camera_para-iPhone 5 rear 640x480 1.0m.dat' + + var canvas_process = document.createElement('canvas'); + var context_process = canvas_process.getContext('2d'); + + var renderer = new THREE.WebGLRenderer({ canvas: canvas_draw, alpha: true, antialias: true }); + renderer.setPixelRatio(window.devicePixelRatio); + + var scene = new THREE.Scene(); + + var camera = new THREE.Camera(); + camera.matrixAutoUpdate = false; + + scene.add(camera); + + var sphere = new THREE.Mesh( + new THREE.SphereGeometry(0.5, 8, 8), + new THREE.MeshNormalMaterial() + ); + + var root = new THREE.Object3D(); + scene.add(root); + + sphere.material.flatShading; + sphere.position.z = 0; + sphere.position.x = 100; + sphere.position.y = 100; + sphere.scale.set(200, 200, 200); + + root.matrixAutoUpdate = false; + root.add(sphere); + + var load = function() { + vw = input_width; + vh = input_height; + + pscale = 320 / Math.max(vw, vh / 3 * 4); + sscale = isMobile() ? window.outerWidth / input_width : 1; + + sw = vw * sscale; + sh = vh * sscale; + video.style.width = sw + "px"; + video.style.height = sh + "px"; + container.style.width = sw + "px"; + container.style.height = sh + "px"; + canvas_draw.style.clientWidth = sw + "px"; + canvas_draw.style.clientHeight = sh + "px"; + canvas_draw.width = sw; + canvas_draw.height = sh; + w = vw * pscale; + h = vh * pscale; + pw = Math.max(w, h / 3 * 4); + ph = Math.max(h, w / 4 * 3); + ox = (pw - w) / 2; + oy = (ph - h) / 2; + canvas_process.style.clientWidth = pw + "px"; + canvas_process.style.clientHeight = ph + "px"; + canvas_process.width = pw; + canvas_process.height = ph; + + renderer.setSize(sw, sh); + + worker = new Worker('../../js/artoolkit.worker.js'); + + worker.postMessage({ type: "load", pw: pw, ph: ph, camera_para: camera_para, marker: '../' + marker.url }); + + worker.onmessage = function(ev) { + var msg = ev.data; + switch (msg.type) { + case "loaded": { + var proj = JSON.parse(msg.proj); + var ratioW = pw / w; + var ratioH = ph / h; + proj[0] *= ratioW; + proj[4] *= ratioW; + proj[8] *= ratioW; + proj[12] *= ratioW; + proj[1] *= ratioH; + proj[5] *= ratioH; + proj[9] *= ratioH; + proj[13] *= ratioH; + setMatrix(camera.projectionMatrix, proj); + break; + } + case "endLoading": { + if (msg.end == true) + // removing loader page if present + document.body.classList.remove("loading"); + document.getElementById("loading").remove(); + break; + } + case "found": { + found(msg); + break; + } + case "not found": { + found(null); + break; + } + } + track_update(); + process(); + }; + }; + + var world; + + var found = function(msg) { + if (!msg) { + world = null; + } else { + world = JSON.parse(msg.matrixGL_RH); + } + }; + + var lasttime = Date.now(); + var time = 0; + + var draw = function() { + render_update(); + var now = Date.now(); + var dt = now - lasttime; + time += dt; + lasttime = now; + + if (!world) { + sphere.visible = false; + } else { + sphere.visible = true; + // interpolate matrix + for (var i = 0; i < 16; i++) { + trackedMatrix.delta[i] = world[i] - trackedMatrix.interpolated[i]; + trackedMatrix.interpolated[i] = + trackedMatrix.interpolated[i] + + trackedMatrix.delta[i] / interpolationFactor; + } + + // set matrix of 'root' by detected 'world' matrix + setMatrix(root.matrix, trackedMatrix.interpolated); + } + renderer.render(scene, camera); + }; + + function process() { + context_process.fillStyle = "black"; + context_process.fillRect(0, 0, pw, ph); + context_process.drawImage(video, 0, 0, vw, vh, ox, oy, w, h); + + var imageData = context_process.getImageData(0, 0, pw, ph); + worker.postMessage({ type: "process", imagedata: imageData }, [imageData.data.buffer]); + } + var tick = function() { + draw(); + requestAnimationFrame(tick); + }; + + load(); + tick(); + process(); +} diff --git a/jsartoolkit5/examples/nft_improved_worker/threejs_worker_gltf.html b/jsartoolkit5/examples/nft_improved_worker/threejs_worker_gltf.html new file mode 100644 index 0000000..67ec4ab --- /dev/null +++ b/jsartoolkit5/examples/nft_improved_worker/threejs_worker_gltf.html @@ -0,0 +1,122 @@ + + + + + NFT_test + + + + +
    + + Loading, please wait +
    + + + +
    +
    +

    + Main +

    +
    + +
    +

    + Worker +

    +
    +
    + + + +
    + + + +
    + + 🖼 Marker Image + + + + + + + + + diff --git a/jsartoolkit5/examples/nft_improved_worker/threejs_worker_gltf.js b/jsartoolkit5/examples/nft_improved_worker/threejs_worker_gltf.js new file mode 100644 index 0000000..a6669e6 --- /dev/null +++ b/jsartoolkit5/examples/nft_improved_worker/threejs_worker_gltf.js @@ -0,0 +1,261 @@ +var model; +var clock = new THREE.Clock(); +var mixers = []; + +function isMobile() { + return /Android|mobile|iPad|iPhone/i.test(navigator.userAgent); +} + +var interpolationFactor = 24; + +var trackedMatrix = { + // for interpolation + delta: [ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0 + ], + interpolated: [ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0 + ] +} + +var markers = { + pinball: { + width: 1637, + height: 2048, + dpi: 215, + url: "../examples/DataNFT/pinball" + } +}; + +var setMatrix = function (matrix, value) { + var array = []; + for (var key in value) { + array[key] = value[key]; + } + if (typeof matrix.elements.set === "function") { + matrix.elements.set(array); + } else { + matrix.elements = [].slice.call(array); + } +}; + +function start( container, marker, video, input_width, input_height, canvas_draw, render_update, track_update) { + var vw, vh; + var sw, sh; + var pscale, sscale; + var w, h; + var pw, ph; + var ox, oy; + var worker; + var camera_para = "./../examples/Data/camera_para-iPhone 5 rear 640x480 1.0m.dat"; + + var canvas_process = document.createElement("canvas"); + var context_process = canvas_process.getContext("2d"); + + // var context_draw = canvas_draw.getContext('2d'); + var renderer = new THREE.WebGLRenderer({ + canvas: canvas_draw, + alpha: true, + antialias: true + }); + renderer.setPixelRatio(window.devicePixelRatio); + + var scene = new THREE.Scene(); + + var camera = new THREE.Camera(); + camera.matrixAutoUpdate = false; + // var camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 1, 1000); + // camera.position.z = 400; + + scene.add(camera); + + var light = new THREE.AmbientLight(0xffffff); + scene.add(light); + + var sphere = new THREE.Mesh( + new THREE.SphereGeometry(0.5, 8, 8), + new THREE.MeshNormalMaterial() + ); + + var root = new THREE.Object3D(); + scene.add(root); + + /* Load Model */ + var threeGLTFLoader = new THREE.GLTFLoader(); + + threeGLTFLoader.load("../Data/models/Flamingo.glb", function (gltf) { + model = gltf.scene.children[0]; + model.position.z = 0; + model.position.x = 100; + model.position.y = 100; + + var animation = gltf.animations[0]; + var mixer = new THREE.AnimationMixer(model); + mixers.push(mixer); + var action = mixer.clipAction(animation); + action.play(); + + root.matrixAutoUpdate = false; + root.add(model); + } + ); + + var load = function() { + vw = input_width; + vh = input_height; + + pscale = 320 / Math.max(vw, (vh / 3) * 4); + sscale = isMobile() ? window.outerWidth / input_width : 1; + + sw = vw * sscale; + sh = vh * sscale; + video.style.width = sw + "px"; + video.style.height = sh + "px"; + container.style.width = sw + "px"; + container.style.height = sh + "px"; + canvas_draw.style.clientWidth = sw + "px"; + canvas_draw.style.clientHeight = sh + "px"; + canvas_draw.width = sw; + canvas_draw.height = sh; + w = vw * pscale; + h = vh * pscale; + pw = Math.max(w, (h / 3) * 4); + ph = Math.max(h, (w / 4) * 3); + ox = (pw - w) / 2; + oy = (ph - h) / 2; + canvas_process.style.clientWidth = pw + "px"; + canvas_process.style.clientHeight = ph + "px"; + canvas_process.width = pw; + canvas_process.height = ph; + + renderer.setSize(sw, sh); + + worker = new Worker("../../js/artoolkit.worker.js"); + + worker.postMessage({ + type: "load", + pw: pw, + ph: ph, + camera_para: camera_para, + marker: marker.url + }); + + worker.onmessage = function(ev) { + var msg = ev.data; + switch (msg.type) { + case "loaded": { + var proj = JSON.parse(msg.proj); + var ratioW = pw / w; + var ratioH = ph / h; + proj[0] *= ratioW; + proj[4] *= ratioW; + proj[8] *= ratioW; + proj[12] *= ratioW; + proj[1] *= ratioH; + proj[5] *= ratioH; + proj[9] *= ratioH; + proj[13] *= ratioH; + setMatrix(camera.projectionMatrix, proj); + break; + } + + case "endLoading": { + if (msg.end == true) { + // removing loader page if present + var loader = document.getElementById('loading'); + if (loader) { + loader.querySelector('.loading-text').innerText = 'Start the tracking!'; + setTimeout(function(){ + loader.parentElement.removeChild(loader); + }, 2000); + } + } + break; + } + + case "found": { + found(msg); + break; + } + case "not found": { + found(null); + break; + } + } + track_update(); + process(); + }; + }; + + var world; + + var found = function(msg) { + if (!msg) { + world = null; + } else { + world = JSON.parse(msg.matrixGL_RH); + } + }; + + var lasttime = Date.now(); + var time = 0; + + function process() { + context_process.fillStyle = "black"; + context_process.fillRect(0, 0, pw, ph); + context_process.drawImage(video, 0, 0, vw, vh, ox, oy, w, h); + + var imageData = context_process.getImageData(0, 0, pw, ph); + worker.postMessage({ type: "process", imagedata: imageData }, [ + imageData.data.buffer + ]); + } + + var tick = function() { + draw(); + requestAnimationFrame(tick); + + if (mixers.length > 0) { + for (var i = 0; i < mixers.length; i++) { + mixers[i].update(clock.getDelta()); + } + } + }; + + var draw = function() { + render_update(); + var now = Date.now(); + var dt = now - lasttime; + time += dt; + lasttime = now; + + if (!world) { + root.visible = false; + } else { + root.visible = true; + + // interpolate matrix + for (var i = 0; i < 16; i++) { + trackedMatrix.delta[i] = world[i] - trackedMatrix.interpolated[i]; + trackedMatrix.interpolated[i] = + trackedMatrix.interpolated[i] + + trackedMatrix.delta[i] / interpolationFactor; + } + + // set matrix of 'root' by detected 'world' matrix + setMatrix(root.matrix, trackedMatrix.interpolated); + } + + renderer.render(scene, camera); + }; + + load(); + tick(); + process(); +} diff --git a/jsartoolkit5/examples/nft_improved_worker/wasm_worker/artoolkit.wasm_worker.js b/jsartoolkit5/examples/nft_improved_worker/wasm_worker/artoolkit.wasm_worker.js new file mode 100644 index 0000000..ef2223c --- /dev/null +++ b/jsartoolkit5/examples/nft_improved_worker/wasm_worker/artoolkit.wasm_worker.js @@ -0,0 +1,89 @@ +window = {}; +window.artoolkit_wasm_url = '../../../build/artoolkit_wasm.wasm'; +window.listeners = {}; +window.addEventListener = function (name, callback) { + if (!window.listeners[name]) { + window.listeners[name] = []; + } + window.listeners[name].push(callback); +}; +window.removeEventListener = function (name, callback) { + if (window.listeners[name]) { + var index = window.listeners[name].indexOf(callback); + if (index > -1) { + window.listeners[name].splice(index, 1); + } + } +}; +window.dispatchEvent = function (event) { + var listeners = window.listeners[event.type]; + if (listeners) { + for (var i = 0; i < listeners.length; i++) { + listeners[i].call(window, event); + } + } +}; + +importScripts('../../../build/artoolkit_wasm.js'); +self.onmessage = function(e) { + var msg = e.data; + switch (msg.type) { + case "load": { + load(msg); + return; + } + case "process": { + next = msg.imagedata; + process(); + return; + } + } +}; + +var next = null; + +var ar = null; +var markerResult = null; + +function load(msg) { + var param = new ARCameraParam(msg.camera_para); + param.onload = function () { + ar = new ARController(msg.pw, msg.ph, param); + var cameraMatrix = ar.getCameraMatrix(); + + ar.addEventListener('getNFTMarker', function (ev) { + markerResult = {type: "found", matrixGL_RH: JSON.stringify(ev.data.matrixGL_RH), proj: JSON.stringify(cameraMatrix)}; + }); + + ar.loadNFTMarker(msg.marker, function (markerId) { + ar.trackNFTMarkerId(markerId, 2); + console.log("loadNFTMarker -> ", markerId); + postMessage({type: "endLoading", end: true}) + }); + + postMessage({type: "loaded", proj: JSON.stringify(cameraMatrix)}); + }; +} + +function process() { + + markerResult = null; + + if (ar) { + ar.process(next); + } + + if (markerResult) { + postMessage(markerResult); + } else { + postMessage({type: "not found"}); + } + + next = null; +} + +window.addEventListener('artoolkit-loaded', function() { + console.log('artoolkit-loaded'); + Object.assign(self, window); + postMessage({type: "wasm"}); +}); diff --git a/jsartoolkit5/examples/nft_threejs_wasm.html b/jsartoolkit5/examples/nft_threejs_wasm.html new file mode 100644 index 0000000..6e238ea --- /dev/null +++ b/jsartoolkit5/examples/nft_threejs_wasm.html @@ -0,0 +1,123 @@ + + +Pattern marker example with Three.js and wasm + + + + + + + + + + + + + + diff --git a/jsartoolkit5/examples/pattern_and_barcode_threejs.html b/jsartoolkit5/examples/pattern_and_barcode_threejs.html new file mode 100644 index 0000000..df3e04b --- /dev/null +++ b/jsartoolkit5/examples/pattern_and_barcode_threejs.html @@ -0,0 +1,150 @@ + + +Mixed marker example with Three.js + + + + + +

    Mixed marker example with Three.js

    +

    On Chrome on Android, tap the screen to start playing video stream.

    +

    Show 3x3 marker id 5, 3x3 marker id 20, Hiro pattern and Kanji pattern to camera to display a colorful objects on top of them. Tap the objects to spin them. + +

    Back to examples

    + + + + + + + + + diff --git a/jsartoolkit5/examples/pattern_threejs.html b/jsartoolkit5/examples/pattern_threejs.html new file mode 100644 index 0000000..05d8c7d --- /dev/null +++ b/jsartoolkit5/examples/pattern_threejs.html @@ -0,0 +1,123 @@ + + +Pattern marker example with Three.js + + + + + +

    Pattern marker example with Three.js

    +

    On Chrome on Android, tap the screen to start playing video stream.

    +

    Show Hiro pattern and Kanji pattern to camera to display a colorful objects on top of them. Tap the screen to rotate the objects. + +

    Back to examples

    + + + + + + + + + + + diff --git a/jsartoolkit5/examples/simple_image.html b/jsartoolkit5/examples/simple_image.html new file mode 100644 index 0000000..b96d232 --- /dev/null +++ b/jsartoolkit5/examples/simple_image.html @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + diff --git a/jsartoolkit5/examples/simple_image_wasm.html b/jsartoolkit5/examples/simple_image_wasm.html new file mode 100644 index 0000000..2dbc3cc --- /dev/null +++ b/jsartoolkit5/examples/simple_image_wasm.html @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + diff --git a/jsartoolkit5/examples/simple_rtc.html b/jsartoolkit5/examples/simple_rtc.html new file mode 100644 index 0000000..79dd144 --- /dev/null +++ b/jsartoolkit5/examples/simple_rtc.html @@ -0,0 +1,76 @@ + + + + + + + + + + + diff --git a/jsartoolkit5/examples/simple_video.html b/jsartoolkit5/examples/simple_video.html new file mode 100644 index 0000000..0078100 --- /dev/null +++ b/jsartoolkit5/examples/simple_video.html @@ -0,0 +1,29 @@ + + + + + + + + + + + + diff --git a/jsartoolkit5/examples/simple_video_wasm.html b/jsartoolkit5/examples/simple_video_wasm.html new file mode 100644 index 0000000..45d83be --- /dev/null +++ b/jsartoolkit5/examples/simple_video_wasm.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + diff --git a/jsartoolkit5/examples/test_constants.html b/jsartoolkit5/examples/test_constants.html new file mode 100644 index 0000000..823486c --- /dev/null +++ b/jsartoolkit5/examples/test_constants.html @@ -0,0 +1,69 @@ + + + + + + + + diff --git a/jsartoolkit5/examples/threejs_from_scratch.html b/jsartoolkit5/examples/threejs_from_scratch.html new file mode 100644 index 0000000..bc83ddb --- /dev/null +++ b/jsartoolkit5/examples/threejs_from_scratch.html @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + diff --git a/jsartoolkit5/js/artoolkit.api.js b/jsartoolkit5/js/artoolkit.api.js new file mode 100644 index 0000000..beb789d --- /dev/null +++ b/jsartoolkit5/js/artoolkit.api.js @@ -0,0 +1,2057 @@ +; (function () { + 'use strict' + + var scope; + if (typeof window !== 'undefined') { + scope = window; + } else { + scope = self; + }; + if (scope.artoolkit_wasm_url) { + var downloadWasm = function(url) { + return new Promise(function (resolve, reject) { + var wasmXHR = new XMLHttpRequest(); + wasmXHR.open('GET', url, true); + wasmXHR.responseType = 'arraybuffer'; + wasmXHR.onload = function () { resolve(wasmXHR.response); } + wasmXHR.onerror = function () { reject('error ' + wasmXHR.status); } + wasmXHR.send(null); + }); + }; + + var wasm = downloadWasm(scope.artoolkit_wasm_url); + + // Module.instantiateWasm is a user-implemented callback which the Emscripten runtime calls to perform + // the WebAssembly instantiation action. The callback function will be called with two parameters, imports + // and successCallback. imports is a JS object which contains all the function imports that need to be passed + // to the Module when instantiating, and once instantiated, the function should call successCallback() with + // the WebAssembly Instance object. + // The instantiation can be performed either synchronously or asynchronously. The return value of this function + // should contain the exports object of the instantiated Module, or an empty dictionary object {} if the + // instantiation is performed asynchronously, or false if instantiation failed. + Module.instantiateWasm = function (imports, successCallback) { + console.log('instantiateWasm: instantiating synchronously'); + wasm.then(function (wasmBinary) { + console.log('wasm download finished, begin instantiating'); + var wasmInstantiate = WebAssembly.instantiate(new Uint8Array(wasmBinary), imports).then(function (output) { + console.log('wasm instantiation succeeded'); + successCallback(output.instance); + }).catch(function (e) { + console.log('wasm instantiation failed! ' + e); + }); + }); + return {}; // Compiling asynchronously, no exports. + } + } + + /** + The ARController is the main object for doing AR marker detection with JSARToolKit. + + To use an ARController, you need to tell it the dimensions to use for the AR processing canvas and + pass it an ARCameraParam to define the camera parameters to use when processing images. + The ARCameraParam defines the lens distortion and aspect ratio of the camera used. + See https://www.artoolworks.com/support/library/Calibrating_your_camera for more information about AR camera parameters and how to make and use them. + + If you pass an image as the first argument, the ARController uses that as the image to process, + using the dimensions of the image as AR processing canvas width and height. If the first argument + to ARController is an image, the second argument is used as the camera param. + + The camera parameters argument can be either an ARCameraParam or an URL to a camera definition file. + If the camera argument is an URL, it is loaded into a new ARCameraParam, and the ARController dispatches + a 'load' event and calls the onload method if it is defined. + + @exports ARController + @constructor + + @param {number} width The width of the images to process. + @param {number} height The height of the images to process. + @param {ARCameraParam | string} camera The ARCameraParam to use for image processing. If this is a string, the ARController treats it as an URL and tries to load it as a ARCameraParam definition file, calling ARController#onload on success. + */ + var ARController = function (width, height, cameraPara) { + this.id = undefined; + var w = width, h = height; + + this.orientation = 'landscape'; + + this.listeners = {}; + + if (typeof width !== 'number') { + var image = width; + cameraPara = height; + w = image.videoWidth || image.width; + h = image.videoHeight || image.height; + this.image = image; + } + + this.width = w; + this.height = h; + + this.nftMarkerCount = 0; + + this.defaultMarkerWidth = 1; + this.patternMarkers = {}; + this.barcodeMarkers = {}; + this.nftMarkers = {}; + this.transform_mat = new Float32Array(16); + this.transformGL_RH = new Float64Array(16); + + if (typeof document !== 'undefined') { + this.canvas = document.createElement('canvas'); + this.canvas.width = w; + this.canvas.height = h; + this.ctx = this.canvas.getContext('2d'); + } + + this.videoWidth = w; + this.videoHeight = h; + this.videoSize = this.videoWidth * this.videoHeight; + + this.framepointer = null; + this.framesize = null; + this.dataHeap = null; + this.videoLuma = null; + this.camera_mat = null; + this.marker_transform_mat = null; + this.videoLumaPointer = null; + this._bwpointer = undefined; + this._lumaCtx = undefined; + + if (typeof cameraPara === 'string') { + this.cameraParam = new ARCameraParam(cameraPara, function () { + this._initialize(); + }.bind(this), function (err) { + console.error("ARController: Failed to load ARCameraParam", err); + this.onload(err); + }.bind(this)); + } else { + this.cameraParam = cameraPara; + this._initialize(); + } + }; + + /** + Destroys the ARController instance and frees all associated resources. + After calling dispose, the ARController can't be used any longer. Make a new one if you need one. + + Calling this avoids leaking Emscripten memory, which may be important if you're using multiple ARControllers. + */ + ARController.prototype.dispose = function () { + // It is possible to call dispose on an ARController that was never initialized. But if it was never initialized the id is undefined. + if (this.id > -1) { + artoolkit.teardown(this.id); + } + + if (this.image && this.image.srcObject) { + ARController._teardownVideo(this.image); + } + + for (var t in this) { + this[t] = null; + } + }; + + /** + Detects markers in the given image. The process method dispatches marker detection events during its run. + + The marker detection process proceeds by first dispatching a markerNum event that tells you how many + markers were found in the image. Next, a getMarker event is dispatched for each found marker square. + + Then, a getNFTMarker event is dispatched for each found NFT marker. + + Finally, getMultiMarker is dispatched for every found multimarker, followed by getMultiMarkerSub events + dispatched for each of the markers in the multimarker. + + arController.addEventListener('markerNum', function(ev) { + console.log("Detected " + ev.data + " markers.") + }); + arController.addEventListener('getMarker', function(ev) { + console.log("Detected marker with ids:", ev.data.marker.id, ev.data.marker.idPatt, ev.data.marker.idMatrix); + console.log("Marker data", ev.data.marker); + console.log("Marker transform matrix:", [].join.call(ev.data.matrix, ', ')); + }); + arController.addEventListener('getNFTMarker', function(ev) { + // do stuff + }); + arController.addEventListener('getMultiMarker', function(ev) { + console.log("Detected multimarker with id:", ev.data.multiMarkerId); + }); + arController.addEventListener('getMultiMarkerSub', function(ev) { + console.log("Submarker for " + ev.data.multiMarkerId, ev.data.markerIndex, ev.data.marker); + }); + + arController.process(image); + + + If no image is given, defaults to this.image. + + If the debugSetup has been called, draws debug markers on the debug canvas. + + @param {ImageElement | VideoElement} image The image to process [optional]. + */ + ARController.prototype.process = function (image) { + var result = this.detectMarker(image); + if (result != 0) { + console.error("detectMarker error: " + result); + } + + // get markers + var markerNum = this.getMarkerNum(); + var k, o; + for (k in this.patternMarkers) { + o = this.patternMarkers[k] + o.inPrevious = o.inCurrent; + o.inCurrent = false; + } + for (k in this.barcodeMarkers) { + o = this.barcodeMarkers[k] + o.inPrevious = o.inCurrent; + o.inCurrent = false; + } + for (k in this.nftMarkers) { + o = this.nftMarkers[k] + o.inPrevious = o.inCurrent; + o.inCurrent = false; + } + + // detect fiducial (aka squared) markers + for (var i = 0; i < markerNum; i++) { + var markerInfo = this.getMarker(i); + + var markerType = artoolkit.UNKNOWN_MARKER; + var visible = this.trackPatternMarkerId(-1); + + if (markerInfo.idPatt > -1 && (markerInfo.id === markerInfo.idPatt || markerInfo.idMatrix === -1)) { + visible = this.trackPatternMarkerId(markerInfo.idPatt); + markerType = artoolkit.PATTERN_MARKER; + + if (markerInfo.dir !== markerInfo.dirPatt) { + this.setMarkerInfoDir(i, markerInfo.dirPatt); + } + + } else if (markerInfo.idMatrix > -1) { + visible = this.trackBarcodeMarkerId(markerInfo.idMatrix); + markerType = artoolkit.BARCODE_MARKER; + + if (markerInfo.dir !== markerInfo.dirMatrix) { + this.setMarkerInfoDir(i, markerInfo.dirMatrix); + } + } + + if (markerType !== artoolkit.UNKNOWN_MARKER && visible.inPrevious) { + this.getTransMatSquareCont(i, visible.markerWidth, visible.matrix, visible.matrix); + } else { + this.getTransMatSquare(i, visible.markerWidth, visible.matrix); + } + + visible.inCurrent = true; + this.transMatToGLMat(visible.matrix, this.transform_mat); + this.transformGL_RH = this.arglCameraViewRHf(this.transform_mat); + this.dispatchEvent({ + name: 'getMarker', + target: this, + data: { + index: i, + type: markerType, + marker: markerInfo, + matrix: this.transform_mat, + matrixGL_RH: this.transformGL_RH + } + }); + } + + // detect NFT markers + var nftMarkerCount = this.nftMarkerCount; + this.detectNFTMarker(); + + // in ms + var MARKER_LOST_TIME = 200; + + for (var i = 0; i < nftMarkerCount; i++) { + var nftMarkerInfo = this.getNFTMarker(i); + var markerType = artoolkit.NFT_MARKER; + + if (nftMarkerInfo.found) { + self.markerFound = i; + self.markerFoundTime = Date.now(); + + var visible = this.trackNFTMarkerId(i); + visible.matrix.set(nftMarkerInfo.pose); + visible.inCurrent = true; + this.transMatToGLMat(visible.matrix, this.transform_mat); + this.transformGL_RH = this.arglCameraViewRHf(this.transform_mat); + this.dispatchEvent({ + name: 'getNFTMarker', + target: this, + data: { + index: i, + type: markerType, + marker: nftMarkerInfo, + matrix: this.transform_mat, + matrixGL_RH: this.transformGL_RH + } + }); + } else if (self.markerFound === i) { + // for now this marker found/lost events handling is for one marker at a time + if ((Date.now() - self.markerFoundTime) <= MARKER_LOST_TIME) { + // not handling marker lost for less than specified time + return; + }; + + delete self.markerFound; + + this.dispatchEvent({ + name: 'lostNFTMarker', + target: this, + data: { + index: i, + type: markerType, + marker: nftMarkerInfo, + matrix: this.transform_mat, + matrixGL_RH: this.transformGL_RH + } + }); + } + } + + // detect multiple markers + var multiMarkerCount = this.getMultiMarkerCount(); + for (var i = 0; i < multiMarkerCount; i++) { + var subMarkerCount = this.getMultiMarkerPatternCount(i); + var visible = false; + + artoolkit.getTransMatMultiSquareRobust(this.id, i); + this.transMatToGLMat(this.marker_transform_mat, this.transform_mat); + this.transformGL_RH = this.arglCameraViewRHf(this.transform_mat); + + for (var j = 0; j < subMarkerCount; j++) { + var multiEachMarkerInfo = this.getMultiEachMarker(i, j); + if (multiEachMarkerInfo.visible >= 0) { + visible = true; + this.dispatchEvent({ + name: 'getMultiMarker', + target: this, + data: { + multiMarkerId: i, + matrix: this.transform_mat, + matrixGL_RH: this.transformGL_RH + } + }); + break; + } + } + if (visible) { + for (var j = 0; j < subMarkerCount; j++) { + var multiEachMarkerInfo = this.getMultiEachMarker(i, j); + this.transMatToGLMat(this.marker_transform_mat, this.transform_mat); + this.transformGL_RH = this.arglCameraViewRHf(this.transform_mat); + this.dispatchEvent({ + name: 'getMultiMarkerSub', + target: this, + data: { + multiMarkerId: i, + markerIndex: j, + marker: multiEachMarkerInfo, + matrix: this.transform_mat, + matrixGL_RH: this.transformGL_RH + } + }); + } + } + } + + if (this._bwpointer) { + this.debugDraw(); + } + }; + /** + Detects the NFT markers in the process() function, + with the given tracked id. + */ + ARController.prototype.detectNFTMarker = function () { + artoolkit.detectNFTMarker(this.id); + } + + /** + Adds the given pattern marker ID to the index of tracked IDs. + Sets the markerWidth for the pattern marker to markerWidth. + + Used by process() to implement continuous tracking, + keeping track of the marker's transformation matrix + and customizable marker widths. + + @param {number} id ID of the pattern marker to track. + @param {number} [markerWidth] The width of the marker to track. + @return {Object} The marker tracking object. + */ + ARController.prototype.trackPatternMarkerId = function (id, markerWidth) { + var obj = this.patternMarkers[id]; + if (!obj) { + this.patternMarkers[id] = obj = { + inPrevious: false, + inCurrent: false, + matrix: new Float64Array(12), + matrixGL_RH: new Float64Array(12), + markerWidth: markerWidth || this.defaultMarkerWidth + }; + } + if (markerWidth) { + obj.markerWidth = markerWidth; + } + return obj; + }; + + /** + Adds the given barcode marker ID to the index of tracked IDs. + Sets the markerWidth for the pattern marker to markerWidth. + + Used by process() to implement continuous tracking, + keeping track of the marker's transformation matrix + and customizable marker widths. + + @param {number} id ID of the barcode marker to track. + @param {number} [markerWidth] The width of the marker to track. + @return {Object} The marker tracking object. + */ + ARController.prototype.trackBarcodeMarkerId = function (id, markerWidth) { + var obj = this.barcodeMarkers[id]; + if (!obj) { + this.barcodeMarkers[id] = obj = { + inPrevious: false, + inCurrent: false, + matrix: new Float64Array(12), + matrixGL_RH: new Float64Array(12), + markerWidth: markerWidth || this.defaultMarkerWidth + }; + } + if (markerWidth) { + obj.markerWidth = markerWidth; + } + return obj; + }; + + /** + Adds the given NFT marker ID to the index of tracked IDs. + Sets the markerWidth for the pattern marker to markerWidth. + + Used by process() to implement continuous tracking, + keeping track of the marker's transformation matrix + and customizable marker widths. + + @param {number} id ID of the NFT marker to track. + @param {number} markerWidth The width of the marker to track. + @return {Object} The marker tracking object. + */ + ARController.prototype.trackNFTMarkerId = function (id, markerWidth) { + var obj = this.nftMarkers[id]; + if (!obj) { + this.nftMarkers[id] = obj = { + inPrevious: false, + inCurrent: false, + matrix: new Float64Array(12), + matrixGL_RH: new Float64Array(12), + markerWidth: markerWidth || this.defaultMarkerWidth + }; + } + if (markerWidth) { + obj.markerWidth = markerWidth; + } + return obj; + }; + + /** + Returns the number of multimarkers registered on this ARController. + + @return {number} Number of multimarkers registered. + */ + ARController.prototype.getMultiMarkerCount = function () { + return artoolkit.getMultiMarkerCount(this.id); + }; + + /** + Returns the number of markers in the multimarker registered for the given multiMarkerId. + + @param {number} multiMarkerId The id number of the multimarker to access. Given by loadMultiMarker. + @return {number} Number of markers in the multimarker. Negative value indicates failure to find the multimarker. + */ + ARController.prototype.getMultiMarkerPatternCount = function (multiMarkerId) { + return artoolkit.getMultiMarkerNum(this.id, multiMarkerId); + }; + + /** + Add an event listener on this ARController for the named event, calling the callback function + whenever that event is dispatched. + + Possible events are: + * getMarker - dispatched whenever process() finds a square marker + * getMultiMarker - dispatched whenever process() finds a visible registered multimarker + * getMultiMarkerSub - dispatched by process() for each marker in a visible multimarker + * load - dispatched when the ARController is ready to use (useful if passing in a camera URL in the constructor) + + @param {string} name Name of the event to listen to. + @param {function} callback Callback function to call when an event with the given name is dispatched. + */ + ARController.prototype.addEventListener = function (name, callback) { + if (!this.listeners[name]) { + this.listeners[name] = []; + } + this.listeners[name].push(callback); + }; + + /** + Remove an event listener from the named event. + + @param {string} name Name of the event to stop listening to. + @param {function} callback Callback function to remove from the listeners of the named event. + */ + ARController.prototype.removeEventListener = function (name, callback) { + if (this.listeners[name]) { + var index = this.listeners[name].indexOf(callback); + if (index > -1) { + this.listeners[name].splice(index, 1); + } + } + }; + + /** + Dispatches the given event to all registered listeners on event.name. + + @param {Object} event Event to dispatch. + */ + ARController.prototype.dispatchEvent = function (event) { + var listeners = this.listeners[event.name]; + if (listeners) { + for (var i = 0; i < listeners.length; i++) { + listeners[i].call(this, event); + } + } + }; + + /** + Sets up a debug canvas for the AR detection. Draws a red marker on top of each detected square in the image. + + The debug canvas is added to document.body. + */ + ARController.prototype.debugSetup = function () { + document.body.appendChild(this.canvas); + + var lumaCanvas = document.createElement('canvas'); + lumaCanvas.width = this.canvas.width; + lumaCanvas.height = this.canvas.height; + this._lumaCtx = lumaCanvas.getContext('2d'); + document.body.appendChild(lumaCanvas); + + this.setDebugMode(true); + this._bwpointer = this.getProcessingImage(); + }; + + /** + Loads a pattern marker from the given URL and calls the onSuccess callback with the UID of the marker. + + arController.loadMarker(markerURL, onSuccess, onError); + + @param {string} markerURL - The URL of the marker pattern file to load. + @param {function} onSuccess - The success callback. Called with the id of the loaded marker on a successful load. + @param {function} onError - The error callback. Called with the encountered error if the load fails. + */ + ARController.prototype.loadMarker = function (markerURL, onSuccess, onError) { + if (markerURL) { + artoolkit.addMarker(this.id, markerURL, onSuccess, onError); + } + else { + if (onError) { + onError("Marker URL needs to be defined and not equal empty string!"); + } + else { + console.error("Marker URL needs to be defined and not equal empty string!"); + } + } + }; + + /** + Loads an NFT marker from the given URL prefix and calls the onSuccess callback with the UID of the marker. + + arController.loadNFTMarker(markerURL, onSuccess, onError); + + @param {string} markerURL - The URL prefix of the NFT markers to load. + @param {function} onSuccess - The success callback. Called with the id of the loaded marker on a successful load. + @param {function} onError - The error callback. Called with the encountered error if the load fails. + */ + ARController.prototype.loadNFTMarker = function (markerURL, onSuccess, onError) { + var self = this; + if (markerURL) { + return artoolkit.addNFTMarker(this.id, markerURL, function (id) { + self.nftMarkerCount = id + 1; + onSuccess(id); + }, onError); + } else { + if (onError) { + onError("Marker URL needs to be defined and not equal empty string!"); + } + else { + console.error("Marker URL needs to be defined and not equal empty string!"); + } + } + + }; + + /** + Loads a multimarker from the given URL and calls the onSuccess callback with the UID of the marker. + + arController.loadMultiMarker(markerURL, onSuccess, onError); + + @param {string} markerURL - The URL of the multimarker pattern file to load. + @param {function} onSuccess - The success callback. Called with the id and the number of sub-markers of the loaded marker on a successful load. + @param {function} onError - The error callback. Called with the encountered error if the load fails. + */ + ARController.prototype.loadMultiMarker = function (markerURL, onSuccess, onError) { + return artoolkit.addMultiMarker(this.id, markerURL, onSuccess, onError); + }; + + /** + * Populates the provided float array with the current transformation for the specified marker. After + * a call to detectMarker, all marker information will be current. Marker transformations can then be + * checked. + * @param {number} markerUID The unique identifier (UID) of the marker to query + * @param {number} markerWidth The width of the marker + * @param {Float64Array} dst The float array to populate with the 3x4 marker transformation matrix + * @return {Float64Array} The dst array. + */ + ARController.prototype.getTransMatSquare = function (markerUID, markerWidth, dst) { + artoolkit.getTransMatSquare(this.id, markerUID, markerWidth); + dst.set(this.marker_transform_mat); + return dst; + }; + + /** + * Populates the provided float array with the current transformation for the specified marker, using + * previousMarkerTransform as the previously detected transformation. After + * a call to detectMarker, all marker information will be current. Marker transformations can then be + * checked. + * @param {number} markerUID The unique identifier (UID) of the marker to query + * @param {number} markerWidth The width of the marker + * @param {Float64Array} previousMarkerTransform The float array to use as the previous 3x4 marker transformation matrix + * @param {Float64Array} dst The float array to populate with the 3x4 marker transformation matrix + * @return {Float64Array} The dst array. + */ + ARController.prototype.getTransMatSquareCont = function (markerUID, markerWidth, previousMarkerTransform, dst) { + this.marker_transform_mat.set(previousMarkerTransform); + artoolkit.getTransMatSquareCont(this.id, markerUID, markerWidth); + dst.set(this.marker_transform_mat); + return dst; + }; + + /** + * Populates the provided float array with the current transformation for the specified multimarker. After + * a call to detectMarker, all marker information will be current. Marker transformations can then be + * checked. + * + * @param {number} markerUID The unique identifier (UID) of the marker to query + * @param {Float64Array} dst The float array to populate with the 3x4 marker transformation matrix + * @return {Float64Array} The dst array. + */ + ARController.prototype.getTransMatMultiSquare = function (markerUID, dst) { + artoolkit.getTransMatMultiSquare(this.id, markerUID); + dst.set(this.marker_transform_mat); + return dst; + }; + + /** + * Populates the provided float array with the current robust transformation for the specified multimarker. After + * a call to detectMarker, all marker information will be current. Marker transformations can then be + * checked. + * @param {number} markerUID The unique identifier (UID) of the marker to query + * @param {Float64Array} dst The float array to populate with the 3x4 marker transformation matrix + * @return {Float64Array} The dst array. + */ + ARController.prototype.getTransMatMultiSquareRobust = function (markerUID, dst) { + artoolkit.getTransMatMultiSquare(this.id, markerUID); + dst.set(this.marker_transform_mat); + return dst; + }; + + /** + Converts the given 3x4 marker transformation matrix in the 12-element transMat array + into a 4x4 WebGL matrix and writes the result into the 16-element glMat array. + + If scale parameter is given, scales the transform of the glMat by the scale parameter. + + @param {Float64Array} transMat The 3x4 marker transformation matrix. + @param {Float64Array} glMat The 4x4 GL transformation matrix. + @param {number} scale The scale for the transform. + */ + ARController.prototype.transMatToGLMat = function (transMat, glMat, scale) { + if (glMat == undefined) { + glMat = new Float64Array(16); + } + glMat[0 + 0 * 4] = transMat[0]; // R1C1 + glMat[0 + 1 * 4] = transMat[1]; // R1C2 + glMat[0 + 2 * 4] = transMat[2]; + glMat[0 + 3 * 4] = transMat[3]; + glMat[1 + 0 * 4] = transMat[4]; // R2 + glMat[1 + 1 * 4] = transMat[5]; + glMat[1 + 2 * 4] = transMat[6]; + glMat[1 + 3 * 4] = transMat[7]; + glMat[2 + 0 * 4] = transMat[8]; // R3 + glMat[2 + 1 * 4] = transMat[9]; + glMat[2 + 2 * 4] = transMat[10]; + glMat[2 + 3 * 4] = transMat[11]; + glMat[3 + 0 * 4] = 0.0; + glMat[3 + 1 * 4] = 0.0; + glMat[3 + 2 * 4] = 0.0; + glMat[3 + 3 * 4] = 1.0; + if (scale != undefined && scale !== 0.0) { + glMat[12] *= scale; + glMat[13] *= scale; + glMat[14] *= scale; + } + return glMat; + }; + + /** + Converts the given 4x4 openGL matrix in the 16-element transMat array + into a 4x4 OpenGL Right-Hand-View matrix and writes the result into the 16-element glMat array. + If scale parameter is given, scales the transform of the glMat by the scale parameter. + + @param {Float64Array} glMatrix The 4x4 marker transformation matrix. + @param {Float64Array} [glRhMatrix] The 4x4 GL right hand transformation matrix. + @param {number} [scale] The scale for the transform. + */ + ARController.prototype.arglCameraViewRHf = function (glMatrix, glRhMatrix, scale) { + var m_modelview; + if (glRhMatrix == undefined) + m_modelview = new Float64Array(16); + else + m_modelview = glRhMatrix; + + // x + m_modelview[0] = glMatrix[0]; + m_modelview[4] = glMatrix[4]; + m_modelview[8] = glMatrix[8]; + m_modelview[12] = glMatrix[12]; + // y + m_modelview[1] = -glMatrix[1]; + m_modelview[5] = -glMatrix[5]; + m_modelview[9] = -glMatrix[9]; + m_modelview[13] = -glMatrix[13]; + // z + m_modelview[2] = -glMatrix[2]; + m_modelview[6] = -glMatrix[6]; + m_modelview[10] = -glMatrix[10]; + m_modelview[14] = -glMatrix[14]; + + // 0 0 0 1 + m_modelview[3] = 0; + m_modelview[7] = 0; + m_modelview[11] = 0; + m_modelview[15] = 1; + + if (scale != undefined && scale !== 0.0) { + m_modelview[12] *= scale; + m_modelview[13] *= scale; + m_modelview[14] *= scale; + } + + glRhMatrix = m_modelview; + + return glRhMatrix; + } + /** + This is the core ARToolKit marker detection function. It calls through to a set of + internal functions to perform the key marker detection steps of binarization and + labelling, contour extraction, and template matching and/or matrix code extraction. + + Typically, the resulting set of detected markers is retrieved by calling arGetMarkerNum + to get the number of markers detected and arGetMarker to get an array of ARMarkerInfo + structures with information on each detected marker, followed by a step in which + detected markers are possibly examined for some measure of goodness of match (e.g. by + examining the match confidence value) and pose extraction. + + @param {image} Image to be processed to detect markers. + @return {number} 0 if the function proceeded without error, or a value less than 0 in case of error. + A result of 0 does not however, imply any markers were detected. + */ + ARController.prototype.detectMarker = function (image) { + if (this._copyImageToHeap(image)) { + return artoolkit.detectMarker(this.id); + } + return -99; + }; + + /** + Get the number of markers detected in a video frame. + + @return {number} The number of detected markers in the most recent image passed to arDetectMarker. + Note that this is actually a count, not an index. A better name for this function would be + arGetDetectedMarkerCount, but the current name lives on for historical reasons. + */ + ARController.prototype.getMarkerNum = function () { + return artoolkit.getMarkerNum(this.id); + }; + + /** + Get the marker info struct for the given marker index in detected markers. + + Call this.detectMarker first, then use this.getMarkerNum to get the detected marker count. + + The returned object is the global artoolkit.markerInfo object and will be overwritten + by subsequent calls. If you need to hang on to it, create a copy using this.cloneMarkerInfo(); + + Returns undefined if no marker was found. + + A markerIndex of -1 is used to access the global custom marker. + + The fields of the markerInfo struct are: + @field area Area in pixels of the largest connected region, comprising the marker border and regions connected to it. Note that this is + not the same as the actual onscreen area inside the marker border. + @field id If pattern detection mode is either pattern mode OR matrix but not both, will be marker ID (>= 0) if marker is valid, or -1 if invalid. + @field idPatt If pattern detection mode includes a pattern mode, will be marker ID (>= 0) if marker is valid, or -1 if invalid. + @field idMatrix If pattern detection mode includes a matrix mode, will be marker ID (>= 0) if marker is valid, or -1 if invalid. + @field dir If pattern detection mode is either pattern mode OR matrix but not both, and id != -1, will be marker direction (range 0 to 3, inclusive). + @field dirPatt If pattern detection mode includes a pattern mode, and id != -1, will be marker direction (range 0 to 3, inclusive). + @field dirMatrix If pattern detection mode includes a matrix mode, and id != -1, will be marker direction (range 0 to 3, inclusive). + @field cf If pattern detection mode is either pattern mode OR matrix but not both, will be marker matching confidence (range 0.0 to 1.0 inclusive) if marker is valid, or -1.0 if marker is invalid. + @field cfPatt If pattern detection mode includes a pattern mode, will be marker matching confidence (range 0.0 to 1.0 inclusive) if marker is valid, or -1.0 if marker is invalid. + @field cfMatrix If pattern detection mode includes a matrix mode, will be marker matching confidence (range 0.0 to 1.0 inclusive) if marker is valid, or -1.0 if marker is invalid. + @field pos 2D position (in camera image coordinates, origin at top-left) of the centre of the marker. + @field line Line equations for the 4 sides of the marker. + @field vertex 2D positions (in camera image coordinates, origin at top-left) of the corners of the marker. vertex[(4 - dir)%4][] is the top-left corner of the marker. Other vertices proceed clockwise from this. These are idealised coordinates (i.e. the onscreen position aligns correctly with the undistorted camera image.) + + + @param {number} markerIndex The index of the marker to query. + @returns {Object} The markerInfo struct. + */ + ARController.prototype.getMarker = function (markerIndex) { + if (0 === artoolkit.getMarker(this.id, markerIndex)) { + return artoolkit.markerInfo; + } + }; + /** + Get the NFT marker info struct for the given NFT marker index in detected markers. + The returned object is the global artoolkit.NFTMarkerInfo object and will be overwritten + by subsequent calls. + + Returns undefined if no marker was found. + + A markerIndex of -1 is used to access the global custom marker. + + @param {number} markerIndex The index of the NFT marker to query. + @returns {Object} The NFTmarkerInfo struct. + */ + ARController.prototype.getNFTMarker = function (markerIndex) { + if (0 === artoolkit.getNFTMarker(this.id, markerIndex)) { + return artoolkit.NFTMarkerInfo; + } + }; + + /** + Set marker vertices to the given vertexData[4][2] array. + + Sets the marker pos to the center of the vertices. + + Useful for building custom markers for getTransMatSquare. + + A markerIndex of -1 is used to access the global custom marker. + + @param {number} markerIndex The index of the marker to edit. + @param {*} vertexData + */ + ARController.prototype.setMarkerInfoVertex = function (markerIndex, vertexData) { + for (var i = 0; i < vertexData.length; i++) { + this.marker_transform_mat[i * 2 + 0] = vertexData[i][0]; + this.marker_transform_mat[i * 2 + 1] = vertexData[i][1]; + } + return artoolkit.setMarkerInfoVertex(this.id, markerIndex); + }; + + /** + Makes a deep copy of the given marker info. + + @param {Object} markerInfo The marker info object to copy. + @return {Object} The new copy of the marker info. + */ + ARController.prototype.cloneMarkerInfo = function (markerInfo) { + return JSON.parse(JSON.stringify(markerInfo)); + }; + + /** + Get the marker info struct for the given marker index in detected markers. + + Call this.detectMarker first, then use this.getMarkerNum to get the detected marker count. + + The returned object is the global artoolkit.markerInfo object and will be overwritten + by subsequent calls. If you need to hang on to it, create a copy using this.cloneMarkerInfo(); + + Returns undefined if no marker was found. + + @field {number} pattId The index of the marker. + @field {number} pattType The type of the marker. Either AR_MULTI_PATTERN_TYPE_TEMPLATE or AR_MULTI_PATTERN_TYPE_MATRIX. + @field {number} visible 0 or larger if the marker is visible + @field {number} width The width of the marker. + + @param {number} multiMarkerId The multimarker to query. + @param {number} markerIndex The index of the marker to query. + @returns {Object} The markerInfo struct. + */ + ARController.prototype.getMultiEachMarker = function (multiMarkerId, markerIndex) { + if (0 === artoolkit.getMultiEachMarker(this.id, multiMarkerId, markerIndex)) { + return artoolkit.multiEachMarkerInfo; + } + }; + + + /** + Returns the 16-element WebGL transformation matrix used by ARController.process to + pass marker WebGL matrices to event listeners. + + Unique to each ARController. + + @return {Float64Array} The 16-element WebGL transformation matrix used by the ARController. + */ + ARController.prototype.getTransformationMatrix = function () { + return this.transform_mat; + }; + + /** + * Returns the projection matrix computed from camera parameters for the ARController. + * + * @return {Float64Array} The 16-element WebGL camera matrix for the ARController camera parameters. + */ + ARController.prototype.getCameraMatrix = function () { + return this.camera_mat; + }; + + /** + Returns the shared ARToolKit 3x4 marker transformation matrix, used for passing and receiving + marker transforms to/from the Emscripten side. + + @return {Float64Array} The 12-element 3x4 row-major marker transformation matrix used by ARToolKit. + */ + ARController.prototype.getMarkerTransformationMatrix = function () { + return this.marker_transform_mat; + }; + + + /* Setter / Getter Proxies */ + + /** + * Enables or disables debug mode in the tracker. When enabled, a black and white debug + * image is generated during marker detection. The debug image is useful for visualising + * the binarization process and choosing a threshold value. + * @param {boolean} mode true to enable debug mode, false to disable debug mode + * @see getDebugMode() + */ + ARController.prototype.setDebugMode = function (mode) { + return artoolkit.setDebugMode(this.id, mode); + }; + + /** + * Returns whether debug mode is currently enabled. + * @return {boolean} true when debug mode is enabled, false when debug mode is disabled + * @see setDebugMode() + */ + ARController.prototype.getDebugMode = function () { + return artoolkit.getDebugMode(this.id); + }; + + /** + Returns the Emscripten HEAP offset to the debug processing image used by ARToolKit. + + @return {number} HEAP offset to the debug processing image. + */ + ARController.prototype.getProcessingImage = function () { + return artoolkit.getProcessingImage(this.id); + }; + + /** + Sets the logging level to use by ARToolKit. + + @param {number} mode type for the log level. + */ + ARController.prototype.setLogLevel = function (mode) { + return artoolkit.setLogLevel(mode); + }; + + /** + Gets the logging level used by ARToolKit. + @return {number} return the log level in use. + */ + ARController.prototype.getLogLevel = function () { + return artoolkit.getLogLevel(); + }; + + /** + Sets the dir (direction) of the marker. Direction that tells about the rotation + about the marker (possible values are 0, 1, 2 or 3). + This parameter makes it possible to tell about the line order of the detected marker + (so which line is the first one) and so find the first vertex. + This is important to compute the transformation matrix in arGetTransMat(). + @param {number} markerIndex the index of the marker + @param {number} dir direction of the marker (possible values are 0, 1, 2 or 3). + @return {number} 0 (void) + */ + ARController.prototype.setMarkerInfoDir = function (markerIndex, dir) { + return artoolkit.setMarkerInfoDir(this.id, markerIndex, dir); + }; + + /** + Sets the value of the near plane of the camera. + @param {number} value the value of the near plane + @return {number} 0 (void) + */ + ARController.prototype.setProjectionNearPlane = function (value) { + return artoolkit.setProjectionNearPlane(this.id, value); + }; + + /** + Gets the value of the near plane of the camera with the give id. + @return {number} the value of the near plane. + */ + ARController.prototype.getProjectionNearPlane = function () { + return artoolkit.getProjectionNearPlane(this.id); + }; + + /** + Sets the value of the far plane of the camera. + @param {number} value the value of the far plane + @return {number} 0 (void) + */ + ARController.prototype.setProjectionFarPlane = function (value) { + return artoolkit.setProjectionFarPlane(this.id, value); + }; + + /** + Gets the value of the far plane of the camera with the give id. + @return {number} the value of the far plane. + */ + ARController.prototype.getProjectionFarPlane = function () { + return artoolkit.getProjectionFarPlane(this.id); + }; + + + /** + Set the labeling threshold mode (auto/manual). + + @param {number} mode An integer specifying the mode. One of: + AR_LABELING_THRESH_MODE_MANUAL, + AR_LABELING_THRESH_MODE_AUTO_MEDIAN, + AR_LABELING_THRESH_MODE_AUTO_OTSU, + AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE, + AR_LABELING_THRESH_MODE_AUTO_BRACKETING + */ + ARController.prototype.setThresholdMode = function (mode) { + return artoolkit.setThresholdMode(this.id, mode); + }; + + /** + * Gets the current threshold mode used for image binarization. + * @return {number} The current threshold mode + * @see getVideoThresholdMode() + */ + ARController.prototype.getThresholdMode = function () { + return artoolkit.getThresholdMode(this.id); + }; + + /** + Set the labeling threshhold. + + This function forces sets the threshold value. + The default value is AR_DEFAULT_LABELING_THRESH which is 100. + + The current threshold mode is not affected by this call. + Typically, this function is used when labeling threshold mode + is AR_LABELING_THRESH_MODE_MANUAL. + + The threshold value is not relevant if threshold mode is + AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE. + + Background: The labeling threshold is the value which + the AR library uses to differentiate between black and white + portions of an ARToolKit marker. Since the actual brightness, + contrast, and gamma of incoming images can vary signficantly + between different cameras and lighting conditions, this + value typically needs to be adjusted dynamically to a + suitable midpoint between the observed values for black + and white portions of the markers in the image. + + @param {number} threshold An integer in the range [0,255] (inclusive). + */ + ARController.prototype.setThreshold = function (threshold) { + return artoolkit.setThreshold(this.id, threshold); + }; + + /** + Get the current labeling threshold. + + This function queries the current labeling threshold. For, + AR_LABELING_THRESH_MODE_AUTO_MEDIAN, AR_LABELING_THRESH_MODE_AUTO_OTSU, + and AR_LABELING_THRESH_MODE_AUTO_BRACKETING + the threshold value is only valid until the next auto-update. + + The current threshold mode is not affected by this call. + + The threshold value is not relevant if threshold mode is + AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE. + + @return {number} The current threshold value. + */ + ARController.prototype.getThreshold = function () { + return artoolkit.getThreshold(this.id); + }; + + + /** + Set the pattern detection mode + + The pattern detection determines the method by which ARToolKit + matches detected squares in the video image to marker templates + and/or IDs. ARToolKit v4.x can match against pictorial "template" markers, + whose pattern files are created with the mk_patt utility, in either colour + or mono, and additionally can match against 2D-barcode-type "matrix" + markers, which have an embedded marker ID. Two different two-pass modes + are also available, in which a matrix-detection pass is made first, + followed by a template-matching pass. + + @param {number} mode + Options for this field are: + AR_TEMPLATE_MATCHING_COLOR + AR_TEMPLATE_MATCHING_MONO + AR_MATRIX_CODE_DETECTION + AR_TEMPLATE_MATCHING_COLOR_AND_MATRIX + AR_TEMPLATE_MATCHING_MONO_AND_MATRIX + The default mode is AR_TEMPLATE_MATCHING_COLOR. + */ + ARController.prototype.setPatternDetectionMode = function (mode) { + return artoolkit.setPatternDetectionMode(this.id, mode); + }; + + /** + Returns the current pattern detection mode. + + @return {number} The current pattern detection mode. + */ + ARController.prototype.getPatternDetectionMode = function () { + return artoolkit.getPatternDetectionMode(this.id); + }; + + /** + Set the size and ECC algorithm to be used for matrix code (2D barcode) marker detection. + + When matrix-code (2D barcode) marker detection is enabled (see arSetPatternDetectionMode) + then the size of the barcode pattern and the type of error checking and correction (ECC) + with which the markers were produced can be set via this function. + + This setting is global to a given ARHandle; It is not possible to have two different matrix + code types in use at once. + + @param type The type of matrix code (2D barcode) in use. Options include: + AR_MATRIX_CODE_3x3 + AR_MATRIX_CODE_3x3_HAMMING63 + AR_MATRIX_CODE_3x3_PARITY65 + AR_MATRIX_CODE_4x4 + AR_MATRIX_CODE_4x4_BCH_13_9_3 + AR_MATRIX_CODE_4x4_BCH_13_5_5 + The default mode is AR_MATRIX_CODE_3x3. + */ + ARController.prototype.setMatrixCodeType = function(type) { + return artoolkit.setMatrixCodeType(this.id, type); + }; + + /** + Returns the current matrix code (2D barcode) marker detection type. + + @return {number} The current matrix code type. + */ + ARController.prototype.getMatrixCodeType = function () { + return artoolkit.getMatrixCodeType(this.id); + }; + + /** + Select between detection of black markers and white markers. + + ARToolKit's labelling algorithm can work with both black-bordered + markers on a white background (AR_LABELING_BLACK_REGION) or + white-bordered markers on a black background (AR_LABELING_WHITE_REGION). + This function allows you to specify the type of markers to look for. + Note that this does not affect the pattern-detection algorith + which works on the interior of the marker. + + @param {number} mode + Options for this field are: + AR_LABELING_WHITE_REGION + AR_LABELING_BLACK_REGION + The default mode is AR_LABELING_BLACK_REGION. + */ + ARController.prototype.setLabelingMode = function(mode) { + return artoolkit.setLabelingMode(this.id, mode); + }; + + /** + Enquire whether detection is looking for black markers or white markers. + + See discussion for setLabelingMode. + + @result {number} The current labeling mode. + */ + ARController.prototype.getLabelingMode = function () { + return artoolkit.getLabelingMode(this.id); + }; + + /** + Set the width/height of the marker pattern space, as a proportion of marker width/height. + + @param {number} pattRatio The the width/height of the marker pattern space, as a proportion of marker + width/height. To set the default, pass AR_PATT_RATIO. + If compatibility with ARToolKit verions 1.0 through 4.4 is required, this value + must be 0.5. + */ + ARController.prototype.setPattRatio = function(pattRatio) { + return artoolkit.setPattRatio(this.id, pattRatio); + }; + + /** + Returns the current ratio of the marker pattern to the total marker size. + + @return {number} The current pattern ratio. + */ + ARController.prototype.getPattRatio = function () { + return artoolkit.getPattRatio(this.id); + }; + + /** + Set the image processing mode. + + When the image processing mode is AR_IMAGE_PROC_FRAME_IMAGE, + ARToolKit processes all pixels in each incoming image + to locate markers. When the mode is AR_IMAGE_PROC_FIELD_IMAGE, + ARToolKit processes pixels in only every second pixel row and + column. This is useful both for handling images from interlaced + video sources (where alternate lines are assembled from alternate + fields and thus have one field time-difference, resulting in a + "comb" effect) such as Digital Video cameras. + The effective reduction by 75% in the pixels processed also + has utility in accelerating tracking by effectively reducing + the image size to one quarter size, at the cost of pose accuraccy. + + @param {number} mode + Options for this field are: + AR_IMAGE_PROC_FRAME_IMAGE + AR_IMAGE_PROC_FIELD_IMAGE + The default mode is AR_IMAGE_PROC_FRAME_IMAGE. + */ + ARController.prototype.setImageProcMode = function(mode) { + return artoolkit.setImageProcMode(this.id, mode); + }; + + /** + Get the image processing mode. + + See arSetImageProcMode() for a complete description. + + @return {number} The current image processing mode. + */ + ARController.prototype.getImageProcMode = function () { + return artoolkit.getImageProcMode(this.id); + }; + + + /** + Draw the black and white image and debug markers to the ARController canvas. + + See setDebugMode. + @return 0 (void) + */ + ARController.prototype.debugDraw = function () { + var debugBuffer = new Uint8ClampedArray(Module.HEAPU8.buffer, this._bwpointer, this.framesize); + var id = new ImageData(new Uint8ClampedArray(this.canvas.width * this.canvas.height * 4), this.canvas.width, this.canvas.height); + for (var i = 0, j = 0; i < debugBuffer.length; i++ , j += 4) { + var v = debugBuffer[i]; + id.data[j + 0] = v; + id.data[j + 1] = v; + id.data[j + 2] = v; + id.data[j + 3] = 255; + } + this.ctx.putImageData(id, 0, 0) + + //Debug Luma + var lumaBuffer = new Uint8ClampedArray(this.framesize); + lumaBuffer.set(this.videoLuma); + var lumaImageData = new ImageData(lumaBuffer, this.videoWidth, this.videoHeight); + this._lumaCtx.putImageData(lumaImageData, 0, 0); + + var marker_num = this.getMarkerNum(); + for (var i = 0; i < marker_num; i++) { + this._debugMarker(this.getMarker(i)); + } + if (this.transform_mat && this.transformGL_RH) { + console.log("GL 4x4 Matrix: " + this.transform_mat); + console.log("GL_RH 4x4 Mat: " + this.transformGL_RH); + } + }; + + // private methods + + /** + This function init the ArController with the necessary parmeters and variables. + Don't call directly this but instead instantiate a new ArController. + @return {number} 0 (void) + */ + ARController.prototype._initialize = function () { + this.id = artoolkit.setup(this.width, this.height, this.cameraParam.id); + + this._initNFT(); + + var params = artoolkit.frameMalloc; + this.framepointer = params.framepointer; + this.framesize = params.framesize; + this.videoLumaPointer = params.videoLumaPointer; + + this.dataHeap = new Uint8Array(Module.HEAPU8.buffer, this.framepointer, this.framesize); + this.videoLuma = new Uint8Array(Module.HEAPU8.buffer, this.videoLumaPointer, this.framesize / 4); + + this.camera_mat = new Float64Array(Module.HEAPU8.buffer, params.camera, 16); + this.marker_transform_mat = new Float64Array(Module.HEAPU8.buffer, params.transform, 12); + + this.setProjectionNearPlane(0.1) + this.setProjectionFarPlane(1000); + + setTimeout(function () { + if (this.onload) { + this.onload(); + } + this.dispatchEvent({ + name: 'load', + target: this + }); + }.bind(this), 1); + }; + + /** + Init the necessary kpm handle for NFT and the settings for the CPU. + @return {number} 0 (void) + */ + ARController.prototype._initNFT = function () { + artoolkit.setupAR2(this.id); + }; + + /** + Copy the Image data to the HEAP for the debugSetup function. + @return {number} 0 (void) + */ + ARController.prototype._copyImageToHeap = function (image) { + if (!image) { + image = this.image; + } + if (image.data) { + + var imageData = image; + + } else { + this.ctx.save(); + + if (this.orientation === 'portrait') { + this.ctx.translate(this.canvas.width, 0); + this.ctx.rotate(Math.PI / 2); + this.ctx.drawImage(image, 0, 0, this.canvas.height, this.canvas.width); // draw video + } else { + this.ctx.drawImage(image, 0, 0, this.canvas.width, this.canvas.height); // draw video + } + + this.ctx.restore(); + + var imageData = this.ctx.getImageData(0, 0, this.canvas.width, this.canvas.height); + } + var data = imageData.data; // this is of type Uint8ClampedArray: The Uint8ClampedArray typed array represents an array of 8-bit unsigned integers clamped to 0-255 (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) + + //Here we have access to the unmodified video image. We now need to add the videoLuma chanel to be able to serve the underlying ARTK API + if (this.videoLuma) { + var q = 0; + //Create luma from video data assuming Pixelformat AR_PIXEL_FORMAT_RGBA (ARToolKitJS.cpp L: 43) + + for (var p = 0; p < this.videoSize; p++) { + var r = data[q + 0], g = data[q + 1], b = data[q + 2]; + // videoLuma[p] = (r+r+b+g+g+g)/6; // https://stackoverflow.com/a/596241/5843642 + this.videoLuma[p] = (r + r + r + b + g + g + g + g) >> 3; + q += 4; + } + } + + if (this.dataHeap) { + this.dataHeap.set(data); + return true; + } + return false; + }; + + /** + Draw a square black border around the detect marker with + red circle in the center. Used for debugging porpouse in debugSetup. + @return {number} 0 (void) + */ + ARController.prototype._debugMarker = function (marker) { + var vertex, pos; + vertex = marker.vertex; + var ctx = this.ctx; + ctx.strokeStyle = 'red'; + + ctx.beginPath() + ctx.moveTo(vertex[0][0], vertex[0][1]) + ctx.lineTo(vertex[1][0], vertex[1][1]) + ctx.stroke(); + + ctx.beginPath() + ctx.moveTo(vertex[2][0], vertex[2][1]) + ctx.lineTo(vertex[3][0], vertex[3][1]) + ctx.stroke() + + ctx.strokeStyle = 'green'; + ctx.beginPath() + ctx.lineTo(vertex[1][0], vertex[1][1]) + ctx.lineTo(vertex[2][0], vertex[2][1]) + ctx.stroke(); + + ctx.beginPath() + ctx.moveTo(vertex[3][0], vertex[3][1]) + ctx.lineTo(vertex[0][0], vertex[0][1]) + ctx.stroke(); + + pos = marker.pos + ctx.beginPath() + ctx.arc(pos[0], pos[1], 8, 0, Math.PI * 2) + ctx.fillStyle = 'red' + ctx.fill() + }; + + + // static + + /** + ARController.getUserMedia gets a device camera video feed and calls the given onSuccess callback with it. + + Tries to start playing the video. Playing the video can fail on Chrome for Android, + so ARController.getUserMedia adds user input event listeners to the window + that try to start playing the video. On success, the event listeners are removed. + + To use ARController.getUserMedia, call it with an object with the onSuccess attribute set to a callback function. + + ARController.getUserMedia({ + onSuccess: function(video) { + console.log("Got video", video); + } + }); + + The configuration object supports the following attributes: + + { + onSuccess : function(video), + onError : function(error), + + width : number | {min: number, max: number}, + height : number | {min: number, max: number}, + + facingMode : 'environment' | 'user' | 'left' | 'right' | { exact: 'environment' | ... } + deviceId : string | {exact: 'string'} + } + + See https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia for more information about the + width, height and facingMode attributes. + + @param {object} configuration The configuration object. + @return {HTMLVideoElement} Returns the created video element. + */ + ARController.getUserMedia = function (configuration) { + var facing = configuration.facingMode || 'environment'; + + var onSuccess = configuration.onSuccess; + var onError = configuration.onError || function (err) { console.error("ARController.getUserMedia", err); }; + + var video = document.createElement('video'); + + var readyToPlay = false; + var eventNames = [ + 'touchstart', 'touchend', 'touchmove', 'touchcancel', + 'click', 'mousedown', 'mouseup', 'mousemove', + 'keydown', 'keyup', 'keypress', 'scroll' + ]; + var play = function () { + if (readyToPlay) { + video.play().then(function () { + onSuccess(video); + }).catch(function (error) { + onError(error); + ARController._teardownVideo(video); + }); + if (!video.paused) { + eventNames.forEach(function (eventName) { + window.removeEventListener(eventName, play, true); + }); + } + } + }; + eventNames.forEach(function (eventName) { + window.addEventListener(eventName, play, true); + }); + + var success = function (stream) { + //DEPRECATED: don't use window.URL.createObjectURL(stream) any longer it might be removed soon. Only there to support old browsers src: https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL + if (window.URL.createObjectURL) { + //Need to add try-catch because iOS 11 fails to createObjectURL from stream. As this is deprecated we should remove this soon + try { + video.srcObject = stream; // DEPRECATED: this feature is in the process to being deprecated + } + catch (ex) { + // Nothing todo, the purpose of this is to remove an error from the console on iOS 11 + } + } + video.srcObject = stream; // This should be used instead. Which has the benefit to give us access to the stream object + readyToPlay = true; + video.autoplay = true; + video.playsInline = true; + play(); // Try playing without user input, should work on non-Android Chrome + }; + + var constraints = {}; + var mediaDevicesConstraints = {}; + if (configuration.width) { + mediaDevicesConstraints.width = configuration.width; + if (typeof configuration.width === 'object') { + if (configuration.width.max) { + constraints.maxWidth = configuration.width.max; + } + if (configuration.width.min) { + constraints.minWidth = configuration.width.min; + } + } else { + constraints.maxWidth = configuration.width; + } + } + + if (configuration.height) { + mediaDevicesConstraints.height = configuration.height; + if (typeof configuration.height === 'object') { + if (configuration.height.max) { + constraints.maxHeight = configuration.height.max; + } + if (configuration.height.min) { + constraints.minHeight = configuration.height.min; + } + } else { + constraints.maxHeight = configuration.height; + } + } + + mediaDevicesConstraints.facingMode = facing; + mediaDevicesConstraints.deviceId = configuration.deviceId; + + // @ts-ignore: Ignored because it is needed to support older browsers + navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; + var hdConstraints = { + audio: false, + video: constraints + }; + + + // @ts-ignore: ignored because it is needed to support older browsers + if (navigator.mediaDevices || window.MediaStreamTrack.getSources) { + if (navigator.mediaDevices) { + navigator.mediaDevices.getUserMedia({ + audio: false, + video: mediaDevicesConstraints + }).then(success, onError); + } else { + // This function of accessing the media device is deprecated and outdated and shouldn't be used anymore. + // @ts-ignore: ignored because it is needed to support older browsers + window.MediaStreamTrack.getSources(function (sources) { + var facingDir = mediaDevicesConstraints.facingMode; + if (facing && facing.exact) { + facingDir = facing.exact; + } + for (var i = 0; i < sources.length; i++) { + if (sources[i].kind === 'video' && sources[i].facing === facingDir) { + hdConstraints.video.mandatory.sourceId = sources[i].id; + break; + } + } + if (facing && facing.exact && !hdConstraints.video.mandatory.sourceId) { + onError('Failed to get camera facing the wanted direction'); + } else { + if (navigator.getUserMedia) { + navigator.getUserMedia(hdConstraints, success, onError); + } else { + onError('navigator.getUserMedia is not supported on your browser'); + } + } + }); + } + } else { + if (navigator.getUserMedia) { + navigator.getUserMedia(hdConstraints, success, onError); + } else { + onError('navigator.getUserMedia is not supported on your browser'); + } + } + + return video; + }; + /** + ARController.getUserMediaARController gets an ARController for the device camera video feed and calls the + given onSuccess callback with it. + + To use ARController.getUserMediaARController, call it with an object with the cameraParam attribute set to + a camera parameter file URL, and the onSuccess attribute set to a callback function. + + ARController.getUserMediaARController({ + cameraParam: 'Data/camera_para.dat', + onSuccess: function(arController, arCameraParam) { + console.log("Got ARController", arController); + console.log("Got ARCameraParam", arCameraParam); + console.log("Got video", arController.image); + } + }); + + The configuration object supports the following attributes: + + { + onSuccess : function(ARController, ARCameraParam), + onError : function(error), + + cameraParam: url, // URL to camera parameters definition file. + maxARVideoSize: number, // Maximum max(width, height) for the AR processing canvas. + + width : number | {min: number, ideal: number, max: number}, + height : number | {min: number, ideal: number, max: number}, + + facingMode : 'environment' | 'user' | 'left' | 'right' | { exact: 'environment' | ... } + } + + See https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia for more information about the + width, height and facingMode attributes. + + The orientation attribute of the returned ARController is set to "portrait" if the userMedia video has larger + height than width. Otherwise it's set to "landscape". The videoWidth and videoHeight attributes of the arController + are set to be always in landscape configuration so that width is larger than height. + + @param {object} configuration The configuration object. + @return {HTMLVideoElement} Returns the created video element. + */ + ARController.getUserMediaARController = function (configuration) { + var obj = {}; + for (var i in configuration) { + obj[i] = configuration[i]; + } + var onSuccess = configuration.onSuccess; + var cameraParamURL = configuration.cameraParam; + var onError = configuration.onError || function (err) { + console.error("ARController: Failed to load ARCameraParam", err); + } + + obj.onSuccess = function () { + new ARCameraParam(cameraParamURL, function () { + var arCameraParam = this; + var maxSize = configuration.maxARVideoSize || Math.max(video.videoWidth, video.videoHeight); + var f = maxSize / Math.max(video.videoWidth, video.videoHeight); + var w = f * video.videoWidth; + var h = f * video.videoHeight; + if (video.videoWidth < video.videoHeight) { + var tmp = w; + w = h; + h = tmp; + } + var arController = new ARController(w, h, arCameraParam); + arController.image = video; + if (video.videoWidth < video.videoHeight) { + arController.orientation = 'portrait'; + arController.videoWidth = video.videoHeight; + arController.videoHeight = video.videoWidth; + } else { + arController.orientation = 'landscape'; + arController.videoWidth = video.videoWidth; + arController.videoHeight = video.videoHeight; + } + onSuccess(arController, arCameraParam); + }, function (err) { + ARController._teardownVideo(video); + onError(err); + }); + }; + + var video = ARController.getUserMedia(obj); + return video; + }; + /** + * Properly end the video stream + * @param {HTMLVideoElement} video The video to stop + */ + ARController._teardownVideo = function (video) { + video.srcObject.getVideoTracks()[0].stop(); + video.srcObject = null; + video.src = null; + } + + /** + ARCameraParam is used for loading AR camera parameters for use with ARController. + Use by passing in an URL and a callback function. + + var camera = new ARCameraParam('Data/camera_para.dat', function() { + console.log('loaded camera', this.id); + }, + function(err) { + console.log('failed to load camera', err); + }); + + @exports ARCameraParam + @constructor + + @param {string} src URL to load camera parameters from. + @param {Function} onload Onload callback to be called on successful parameter loading. + @param {Function} onerror Error callback to called when things don't work out. + */ + var ARCameraParam = function (src, onload, onerror) { + this.id = -1; + this._src = ''; + this.complete = false; + if (!onload) { + this.onload = function () { console.log('Successfully loaded'); }; + console.warn("onload callback should be defined"); + } else { + this.onload = onload; + } + if (!onerror) { + this.onerror = function (err) { console.error("Error: " + err) }; + console.warn("onerror callback should be defined"); + } else { + this.onerror = onerror; + } + + if (src) { + this.load(src); + } + else { + console.warn("No camera parameter file defined! It should be defined in constructor or in ARCameraParam.load(url)"); + } + }; + + + /** + Loads the given URL as camera parameters definition file into this ARCameraParam. + + Can only be called on an unloaded ARCameraParam instance. + + @param {string} src URL to load. + */ + ARCameraParam.prototype.load = function (src) { + if (this._src !== '') { + throw ("ARCameraParam: Trying to load camera parameters twice.") + } + this._src = src; + if (src) { + artoolkit.loadCamera(src, function (id) { + this.id = id; + this.complete = true; + this.onload(); + }.bind(this), function (err) { + this.onerror(err); + }.bind(this)); + } + }; + + Object.defineProperty(ARCameraParam.prototype, 'src', { + set: function (src) { + this.load(src); + }, + get: function () { + return this._src; + } + }); + + /** + Destroys the camera parameter and frees associated Emscripten resources. + + */ + ARCameraParam.prototype.dispose = function () { + if (this.id !== -1) { + artoolkit.deleteCamera(this.id); + } + this.id = -1; + this._src = ''; + this.complete = false; + }; + + + + // ARToolKit exported JS API + // + var artoolkit = { + + UNKNOWN_MARKER: -1, + PATTERN_MARKER: 0, + BARCODE_MARKER: 1, + NFT_MARKER: 2, + + loadCamera: loadCamera, + + addMarker: addMarker, + addMultiMarker: addMultiMarker, + addNFTMarker: addNFTMarker + + }; + + var FUNCTIONS = [ + 'setup', + 'teardown', + + 'setupAR2', + + 'setLogLevel', + 'getLogLevel', + + 'setDebugMode', + 'getDebugMode', + + 'getProcessingImage', + + 'setMarkerInfoDir', + 'setMarkerInfoVertex', + + 'getTransMatSquare', + 'getTransMatSquareCont', + + 'getTransMatMultiSquare', + 'getTransMatMultiSquareRobust', + + 'getMultiMarkerNum', + 'getMultiMarkerCount', + + 'detectMarker', + 'getMarkerNum', + + 'detectNFTMarker', + + 'getNFTMarker', + 'getMarker', + 'getMultiEachMarker', + + 'setProjectionNearPlane', + 'getProjectionNearPlane', + + 'setProjectionFarPlane', + 'getProjectionFarPlane', + + 'setThresholdMode', + 'getThresholdMode', + + 'setThreshold', + 'getThreshold', + + 'setPatternDetectionMode', + 'getPatternDetectionMode', + + 'setMatrixCodeType', + 'getMatrixCodeType', + + 'setLabelingMode', + 'getLabelingMode', + + 'setPattRatio', + 'getPattRatio', + + 'setImageProcMode', + 'getImageProcMode', + ]; + + function runWhenLoaded() { + FUNCTIONS.forEach(function (n) { + artoolkit[n] = Module[n]; + }) + + for (var m in Module) { + if (m.match(/^AR/)) + artoolkit[m] = Module[m]; + } + } + + var marker_count = 0; + function addMarker(arId, url, callback, onError) { + var filename = '/marker_' + marker_count++; + ajax(url, filename, function () { + var id = Module._addMarker(arId, filename); + if (callback) callback(id); + }, function (errorNumber) { if (onError) onError(errorNumber) }); + } + + function addNFTMarker(arId, url, callback, onError) { + var mId = marker_count++; + var prefix = '/markerNFT_' + mId; + var filename1 = prefix + '.fset'; + var filename2 = prefix + '.iset'; + var filename3 = prefix + '.fset3'; + ajax(url + '.fset', filename1, function () { + ajax(url + '.iset', filename2, function () { + ajax(url + '.fset3', filename3, function () { + var id = Module._addNFTMarker(arId, prefix); + if (callback) callback(id); + }, function (errorNumber) { if (onError) onError(errorNumber) }); + }, function (errorNumber) { if (onError) onError(errorNumber) }); + }, function (errorNumber) { if (onError) onError(errorNumber) }); + } + + function bytesToString(array) { + return String.fromCharCode.apply(String, array); + } + + function parseMultiFile(bytes) { + var str = bytesToString(bytes); + + var lines = str.split('\n'); + + var files = []; + + var state = 0; // 0 - read, + var markers = 0; + + lines.forEach(function (line) { + line = line.trim(); + if (!line || line.startsWith('#')) return; // FIXME: Should probably be `if (line.indexOf('#') === 0) { return; }` + + switch (state) { + case 0: + markers = +line; + state = 1; + return; + case 1: // filename or barcode + if (!line.match(/^\d+$/)) { + files.push(line); + } + case 2: // width + case 3: // matrices + case 4: + state++; + return; + case 5: + state = 1; + return; + } + }); + + return files; + } + + var multi_marker_count = 0; + + function addMultiMarker(arId, url, callback, onError) { + var filename = '/multi_marker_' + multi_marker_count++; + ajax(url, filename, function (bytes) { + var files = parseMultiFile(bytes); + + function ok() { + var markerID = Module._addMultiMarker(arId, filename); + var markerNum = Module.getMultiMarkerNum(arId, markerID); + if (callback) callback(markerID, markerNum); + } + + if (!files.length) return ok(); + + var path = url.split('/').slice(0, -1).join('/'); + files = files.map(function (file) { + return [path + '/' + file, file] + }); + + ajaxDependencies(files, ok); + }, function (error) { if (onError) onError(error) }); + } + + var camera_count = 0; + function loadCamera(url, callback, errorCallback) { + var filename = '/camera_param_' + camera_count++; + var writeCallback = function (errorCode) { + if (!Module._loadCamera) { + if (callback) callback(id); setTimeout(writeCallback, 10); + } else { + var id = Module._loadCamera(filename); + if (callback) callback(id); + } + }; + if (typeof url === 'object') { // Maybe it's a byte array + writeByteArrayToFS(filename, url, writeCallback); + } else if (url.indexOf("\n") > -1) { // Or a string with the camera param + writeStringToFS(filename, url, writeCallback); + } else { + ajax(url, filename, writeCallback, errorCallback); + } + } + + + // transfer image + + function writeStringToFS(target, string, callback) { + var byteArray = new Uint8Array(string.length); + for (var i = 0; i < byteArray.length; i++) { + byteArray[i] = string.charCodeAt(i) & 0xff; + } + writeByteArrayToFS(target, byteArray, callback); + } + + function writeByteArrayToFS(target, byteArray, callback) { + FS.writeFile(target, byteArray, { encoding: 'binary' }); + // console.log('FS written', target); + + callback(byteArray); + } + + // Eg. + // ajax('../bin/Data2/markers.dat', '/Data2/markers.dat', callback); + // ajax('../bin/Data/patt.hiro', '/patt.hiro', callback); + + function ajax(url, target, callback, errorCallback) { + var oReq = new XMLHttpRequest(); + oReq.open('GET', url, true); + oReq.responseType = 'arraybuffer'; // blob arraybuffer + + oReq.onload = function () { + if (this.status == 200) { + // console.log('ajax done for ', url); + var arrayBuffer = oReq.response; + var byteArray = new Uint8Array(arrayBuffer); + writeByteArrayToFS(target, byteArray, callback); + } + else { + errorCallback(this.status); + } + }; + + oReq.send(); + } + + function ajaxDependencies(files, callback) { + var next = files.pop(); + if (next) { + ajax(next[0], next[1], function () { + ajaxDependencies(files, callback); + }); + } else { + callback(); + } + } + + /* Exports */ + scope.artoolkit = artoolkit; + scope.ARController = ARController; + scope.ARCameraParam = ARCameraParam; + if (scope.artoolkit_wasm_url) { + scope.Module = Module; + }; + + if (scope.Module) { + scope.Module.onRuntimeInitialized = function () { + runWhenLoaded(); + var event = new Event('artoolkit-loaded'); + scope.dispatchEvent(event); + } + } else { + scope.Module = { + onRuntimeInitialized: function () { + runWhenLoaded(); + } + }; + } + +})(); diff --git a/jsartoolkit5/js/artoolkit.three.js b/jsartoolkit5/js/artoolkit.three.js new file mode 100644 index 0000000..af1ca0d --- /dev/null +++ b/jsartoolkit5/js/artoolkit.three.js @@ -0,0 +1,402 @@ +/* THREE.js ARToolKit integration */ + +;(function() { + var integrate = function() { + /** + Helper for setting up a Three.js AR scene using the device camera as input. + Pass in the maximum dimensions of the video you want to process and onSuccess and onError callbacks. + + On a successful initialization, the onSuccess callback is called with an ThreeARScene object. + The ThreeARScene object contains two THREE.js scenes (one for the video image and other for the 3D scene) + and a couple of helper functions for doing video frame processing and AR rendering. + + Here's the structure of the ThreeARScene object: + { + scene: THREE.Scene, // The 3D scene. Put your AR objects here. + camera: THREE.Camera, // The 3D scene camera. + + arController: ARController, + + video: HTMLVideoElement, // The userMedia video element. + + videoScene: THREE.Scene, // The userMedia video image scene. Shows the video feed. + videoCamera: THREE.Camera, // Camera for the userMedia video scene. + + process: function(), // Process the current video frame and update the markers in the scene. + renderOn: function( THREE.WebGLRenderer ) // Render the AR scene and video background on the given Three.js renderer. + } + + You should use the arScene.video.videoWidth and arScene.video.videoHeight to set the width and height of your renderer. + + In your frame loop, use arScene.process() and arScene.renderOn(renderer) to do frame processing and 3D rendering, respectively. + + @param {number} width - The maximum width of the userMedia video to request. + @param {number} height - The maximum height of the userMedia video to request. + @param {function} onSuccess - Called on successful initialization with an ThreeARScene object. + @param {function} onError - Called if the initialization fails with the error encountered. + */ + ARController.getUserMediaThreeScene = function(configuration) { + var obj = {}; + for (var i in configuration) { + obj[i] = configuration[i]; + } + var onSuccess = configuration.onSuccess; + + obj.onSuccess = function(arController, arCameraParam) { + var scenes = arController.createThreeScene(); + onSuccess(scenes, arController, arCameraParam); + }; + + var video = this.getUserMediaARController(obj); + return video; + }; + + /** + Creates a Three.js scene for use with this ARController. + + Returns a ThreeARScene object that contains two THREE.js scenes (one for the video image and other for the 3D scene) + and a couple of helper functions for doing video frame processing and AR rendering. + + Here's the structure of the ThreeARScene object: + { + scene: THREE.Scene, // The 3D scene. Put your AR objects here. + camera: THREE.Camera, // The 3D scene camera. + + arController: ARController, + + video: HTMLVideoElement, // The userMedia video element. + + videoScene: THREE.Scene, // The userMedia video image scene. Shows the video feed. + videoCamera: THREE.Camera, // Camera for the userMedia video scene. + + process: function(), // Process the current video frame and update the markers in the scene. + renderOn: function( THREE.WebGLRenderer ) // Render the AR scene and video background on the given Three.js renderer. + } + + You should use the arScene.video.videoWidth and arScene.video.videoHeight to set the width and height of your renderer. + + In your frame loop, use arScene.process() and arScene.renderOn(renderer) to do frame processing and 3D rendering, respectively. + + @param video Video image to use as scene background. Defaults to this.image + */ + ARController.prototype.createThreeScene = function(video) { + video = video || this.image; + + this.setupThree(); + + // To display the video, first create a texture from it. + var videoTex = new THREE.Texture(video); + + videoTex.minFilter = THREE.LinearFilter; + videoTex.flipY = false; + + // Then create a plane textured with the video. + var plane = new THREE.Mesh( + new THREE.PlaneBufferGeometry(2, 2), + new THREE.MeshBasicMaterial({map: videoTex, side: THREE.DoubleSide}) + ); + + // The video plane shouldn't care about the z-buffer. + plane.material.depthTest = false; + plane.material.depthWrite = false; + + // Create a camera and a scene for the video plane and + // add the camera and the video plane to the scene. + var videoCamera = new THREE.OrthographicCamera(-1, 1, -1, 1, -1, 1); + var videoScene = new THREE.Scene(); + videoScene.add(plane); + videoScene.add(videoCamera); + + if (this.orientation === 'portrait') { + plane.rotation.z = Math.PI/2; + } + + var scene = new THREE.Scene(); + var camera = new THREE.Camera(); + camera.matrixAutoUpdate = false; + setProjectionMatrix(camera.projectionMatrix, this.getCameraMatrix()); + + scene.add(camera); + + + var self = this; + + return { + scene: scene, + videoScene: videoScene, + camera: camera, + videoCamera: videoCamera, + + arController: this, + + video: video, + + process: function() { + for (var i in self.threePatternMarkers) { + self.threePatternMarkers[i].visible = false; + } + for (var i in self.threeNFTMarkers) { + self.threeNFTMarkers[i].visible = false; + } + for (var i in self.threeBarcodeMarkers) { + self.threeBarcodeMarkers[i].visible = false; + } + for (var i in self.threeMultiMarkers) { + self.threeMultiMarkers[i].visible = false; + for (var j=0; j= 0); + } + }); + + /** + Index of Three.js pattern markers, maps markerID -> THREE.Object3D. + */ + this.threePatternMarkers = {}; + + /** + Index of Three.js NFT markers, maps markerID -> THREE.Object3D. + */ + this.threeNFTMarkers = {}; + + /** + Index of Three.js barcode markers, maps markerID -> THREE.Object3D. + */ + this.threeBarcodeMarkers = {}; + + /** + Index of Three.js multimarkers, maps markerID -> THREE.Object3D. + */ + this.threeMultiMarkers = {}; + }; + + }; + /** + * Helper Method for Three.js compatibility + */ + var setProjectionMatrix = function(projectionMatrix, value) { + if (typeof projectionMatrix.elements.set === "function") { + projectionMatrix.elements.set(value); + } else { + projectionMatrix.elements = [].slice.call(value); + } + }; + + var tick = function() { + if (window.ARController && window.THREE) { + integrate(); + if (window.ARThreeOnLoad) { + window.ARThreeOnLoad(); + } + } else { + setTimeout(tick, 50); + } + }; + + tick(); + +})(); diff --git a/jsartoolkit5/js/artoolkit.worker.js b/jsartoolkit5/js/artoolkit.worker.js new file mode 100644 index 0000000..6ac5228 --- /dev/null +++ b/jsartoolkit5/js/artoolkit.worker.js @@ -0,0 +1,60 @@ +importScripts('../build/artoolkit.min.js'); + +self.onmessage = function(e) { + var msg = e.data; + switch (msg.type) { + case "load": { + load(msg); + return; + } + case "process": { + next = msg.imagedata; + process(); + return; + } + } +}; + +var next = null; + +var ar = null; +var markerResult = null; + +function load(msg) { + + var param = new ARCameraParam(msg.camera_para); + + param.onload = function () { + ar = new ARController(msg.pw, msg.ph, param); + var cameraMatrix = ar.getCameraMatrix(); + + ar.addEventListener('getNFTMarker', function (ev) { + markerResult = {type: "found", matrixGL_RH: JSON.stringify(ev.data.matrixGL_RH), proj: JSON.stringify(cameraMatrix)}; + }); + + ar.loadNFTMarker(msg.marker, function (markerId) { + ar.trackNFTMarkerId(markerId, 2); + console.log("loadNFTMarker -> ", markerId); + postMessage({type: "endLoading", end: true}) + }); + + postMessage({type: "loaded", proj: JSON.stringify(cameraMatrix)}); + }; +} + +function process() { + + markerResult = null; + + if (ar) { + ar.process(next); + } + + if (markerResult) { + postMessage(markerResult); + } else { + postMessage({type: "not found"}); + } + + next = null; +} diff --git a/jsartoolkit5/tests/camera_para.dat b/jsartoolkit5/tests/camera_para.dat new file mode 100644 index 0000000..73450c7 Binary files /dev/null and b/jsartoolkit5/tests/camera_para.dat differ diff --git a/jsartoolkit5/tests/img.jpg b/jsartoolkit5/tests/img.jpg new file mode 100644 index 0000000..5c020ef Binary files /dev/null and b/jsartoolkit5/tests/img.jpg differ diff --git a/jsartoolkit5/tests/index.html b/jsartoolkit5/tests/index.html new file mode 100644 index 0000000..0798c73 --- /dev/null +++ b/jsartoolkit5/tests/index.html @@ -0,0 +1,43 @@ + + + + + + JSARToolKit QUnit tests + + + +

    Remarks regarding tests

    +
      +
    • All test work on Android Chrome version 63.0.3239.111
    • +
    • On Android Firefox 57.0.4 test 10 fails because of switched video resolution
    • +
    • On iOS (13.3) only Safari allows access to the video (as of 2020-01-08). The tests 9-11 fail because of switched camera resolution.
    • +
    • Chrome (79.0.3945.88) on desktop all tests work.
    • +
    • Firefox (71.0 (64-bit)) Test 9.9 failes- (Version 57.0.1 and 57.0.4) on desktop all tests work.
    • +
    • Safari (13.0.4) - (Version 11.0.2) on desktop all tests work
    • +
    +

    Important: You need to use https protocol for the tests.

    +
    See startServer-https.md for a documentation how to do that on MacOS.
    + + + +
    +
    + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jsartoolkit5/tests/index_wasm.html b/jsartoolkit5/tests/index_wasm.html new file mode 100644 index 0000000..3c6758e --- /dev/null +++ b/jsartoolkit5/tests/index_wasm.html @@ -0,0 +1,47 @@ + + + + + + JSARToolKit QUnit tests + + + +

    Remarks regarding tests

    +
      +
    • All test work on Android Chrome version 63.0.3239.111
    • +
    • On Android Firefox 57.0.4 test 10 fails because of switched video resolution
    • +
    • On iOS only Safari allows access to the video (as of 2018-01-08). The tests 9-11 fail because of switched camera resolution.
    • +
    • Chrome (Version 63.0.3239.108 and Version 63.0.3239.132) on desktop all tests work.
    • +
    • Firefox (Version 57.0.1 and 57.0.4) on desktop all tests work.
    • +
    • Safari (Version 11.0.2) on desktop all tests work
    • +
    +

    Important: You need to use https protocol for the tests.

    +
    See startServer-https.md for a documentation how to do that on MacOS.
    + + + +
    +
    + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jsartoolkit5/tests/papaparse.min.js b/jsartoolkit5/tests/papaparse.min.js new file mode 100755 index 0000000..14c98ff --- /dev/null +++ b/jsartoolkit5/tests/papaparse.min.js @@ -0,0 +1,7 @@ +/* @license +Papa Parse +v5.0.2 +https://github.com/mholt/PapaParse +License: MIT +*/ +!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof module&&"undefined"!=typeof exports?module.exports=t():e.Papa=t()}(this,function s(){"use strict";var f="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==f?f:{};var n=!f.document&&!!f.postMessage,o=n&&/blob:/i.test((f.location||{}).protocol),a={},h=0,b={parse:function(e,t){var r=(t=t||{}).dynamicTyping||!1;q(r)&&(t.dynamicTypingFunction=r,r={});if(t.dynamicTyping=r,t.transform=!!q(t.transform)&&t.transform,t.worker&&b.WORKERS_SUPPORTED){var i=function(){if(!b.WORKERS_SUPPORTED)return!1;var e=(r=f.URL||f.webkitURL||null,i=s.toString(),b.BLOB_URL||(b.BLOB_URL=r.createObjectURL(new Blob(["(",i,")();"],{type:"text/javascript"})))),t=new f.Worker(e);var r,i;return t.onmessage=_,t.id=h++,a[t.id]=t}();return i.userStep=t.step,i.userChunk=t.chunk,i.userComplete=t.complete,i.userError=t.error,t.step=q(t.step),t.chunk=q(t.chunk),t.complete=q(t.complete),t.error=q(t.error),delete t.worker,void i.postMessage({input:e,config:t,workerId:i.id})}var n=null;b.NODE_STREAM_INPUT,"string"==typeof e?n=t.download?new l(t):new p(t):!0===e.readable&&q(e.read)&&q(e.on)?n=new m(t):(f.File&&e instanceof File||e instanceof Object)&&(n=new c(t));return n.stream(e)},unparse:function(e,t){var i=!1,_=!0,g=",",v="\r\n",n='"',s=n+n,r=!1,a=null;!function(){if("object"!=typeof t)return;"string"!=typeof t.delimiter||b.BAD_DELIMITERS.filter(function(e){return-1!==t.delimiter.indexOf(e)}).length||(g=t.delimiter);("boolean"==typeof t.quotes||Array.isArray(t.quotes))&&(i=t.quotes);"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(r=t.skipEmptyLines);"string"==typeof t.newline&&(v=t.newline);"string"==typeof t.quoteChar&&(n=t.quoteChar);"boolean"==typeof t.header&&(_=t.header);if(Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");a=t.columns}void 0!==t.escapeChar&&(s=t.escapeChar+n)}();var o=new RegExp(U(n),"g");"string"==typeof e&&(e=JSON.parse(e));if(Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return u(null,e,r);if("object"==typeof e[0])return u(a||h(e[0]),e,r)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:h(e.data[0])),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),u(e.fields||[],e.data||[],r);throw new Error("Unable to serialize unrecognized input");function h(e){if("object"!=typeof e)return[];var t=[];for(var r in e)t.push(r);return t}function u(e,t,r){var i="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var n=Array.isArray(e)&&0=this._config.preview;if(o)f.postMessage({results:n,workerId:b.WORKER_ID,finished:a});else if(q(this._config.chunk)&&!t){if(this._config.chunk(n,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);n=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(n.data),this._completeResults.errors=this._completeResults.errors.concat(n.errors),this._completeResults.meta=n.meta),this._completed||!a||!q(this._config.complete)||n&&n.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),a||n&&n.meta.paused||this._nextChunk(),n}this._halted=!0},this._sendError=function(e){q(this._config.error)?this._config.error(e):o&&this._config.error&&f.postMessage({workerId:b.WORKER_ID,error:e,finished:!1})}}function l(e){var i;(e=e||{}).chunkSize||(e.chunkSize=b.RemoteChunkSize),u.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(i=new XMLHttpRequest,this._config.withCredentials&&(i.withCredentials=this._config.withCredentials),n||(i.onload=y(this._chunkLoaded,this),i.onerror=y(this._chunkError,this)),i.open("GET",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var t in e)i.setRequestHeader(t,e[t])}if(this._config.chunkSize){var r=this._start+this._config.chunkSize-1;i.setRequestHeader("Range","bytes="+this._start+"-"+r)}try{i.send()}catch(e){this._chunkError(e.message)}n&&0===i.status?this._chunkError():this._start+=this._config.chunkSize}},this._chunkLoaded=function(){4===i.readyState&&(i.status<200||400<=i.status?this._chunkError():(this._finished=!this._config.chunkSize||this._start>function(e){var t=e.getResponseHeader("Content-Range");if(null===t)return-1;return parseInt(t.substr(t.lastIndexOf("/")+1))}(i),this.parseChunk(i.responseText)))},this._chunkError=function(e){var t=i.statusText||e;this._sendError(new Error(t))}}function c(e){var i,n;(e=e||{}).chunkSize||(e.chunkSize=b.LocalChunkSize),u.call(this,e);var s="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,s?((i=new FileReader).onload=y(this._chunkLoaded,this),i.onerror=y(this._chunkError,this)):i=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(i.error)}}function p(e){var r;u.call(this,e=e||{}),this.stream=function(e){return r=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e=this._config.chunkSize,t=e?r.substr(0,e):r;return r=e?r.substr(e):"",this._finished=!r,this.parseChunk(t)}}}function m(e){u.call(this,e=e||{});var t=[],r=!0,i=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){i&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):r=!0},this._streamData=y(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=y(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=y(function(){this._streamCleanUp(),i=!0,this._streamData("")},this),this._streamCleanUp=y(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function r(g){var a,o,h,i=Math.pow(2,53),n=-i,s=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,u=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,t=this,r=0,f=0,d=!1,e=!1,l=[],c={data:[],errors:[],meta:{}};if(q(g.step)){var p=g.step;g.step=function(e){if(c=e,_())m();else{if(m(),0===c.data.length)return;r+=e.data.length,g.preview&&r>g.preview?o.abort():p(c,t)}}}function v(e){return"greedy"===g.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function m(){if(c&&h&&(k("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+b.DefaultDelimiter+"'"),h=!1),g.skipEmptyLines)for(var e=0;e=l.length?"__parsed_extra":l[r]),g.transform&&(s=g.transform(s,n)),s=y(n,s),"__parsed_extra"===n?(i[n]=i[n]||[],i[n].push(s)):i[n]=s}return g.header&&(r>l.length?k("FieldMismatch","TooManyFields","Too many fields: expected "+l.length+" fields but parsed "+r,f+t):r=i.length/2?"\r\n":"\r"}(e,i)),h=!1,g.delimiter)q(g.delimiter)&&(g.delimiter=g.delimiter(e),c.meta.delimiter=g.delimiter);else{var n=function(e,t,r,i,n){var s,a,o,h;n=n||[",","\t","|",";",b.RECORD_SEP,b.UNIT_SEP];for(var u=0;u=L)return R(!0)}else for(g=M,M++;;){if(-1===(g=a.indexOf(O,g+1)))return t||u.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:h.length,index:M}),w();if(g===i-1)return w(a.substring(M,g).replace(_,O));if(O!==z||a[g+1]!==z){if(O===z||0===g||a[g-1]!==z){var y=E(-1===m?p:Math.min(p,m));if(a[g+1+y]===D){f.push(a.substring(M,g).replace(_,O)),a[M=g+1+y+e]!==O&&(g=a.indexOf(O,M)),p=a.indexOf(D,M),m=a.indexOf(I,M);break}var k=E(m);if(a.substr(g+1+k,n)===I){if(f.push(a.substring(M,g).replace(_,O)),C(g+1+k+n),p=a.indexOf(D,M),g=a.indexOf(O,M),o&&(S(),j))return R();if(L&&h.length>=L)return R(!0);break}u.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:h.length,index:M}),g++}}else g++}return w();function b(e){h.push(e),d=M}function E(e){var t=0;if(-1!==e){var r=a.substring(g+1,e);r&&""===r.trim()&&(t=r.length)}return t}function w(e){return t||(void 0===e&&(e=a.substr(M)),f.push(e),M=i,b(f),o&&S()),R()}function C(e){M=e,b(f),f=[],m=a.indexOf(I,M)}function R(e,t){return{data:t||!1?h[0]:h,errors:u,meta:{delimiter:D,linebreak:I,aborted:j,truncated:!!e,cursor:d+(r||0)}}}function S(){A(R(void 0,!0)),h=[],u=[]}function x(e,t,r){var i={nextDelim:void 0,quoteSearch:void 0},n=a.indexOf(O,t+1);if(t { + const cParaUrl = './camera_para_error.dat'; + const success = function() { + } + const error = function () { + } + const cameraPara = new ARCameraParam(cParaUrl, success, error); + + assert.throws(() => {cameraPara.load('./camera_para.dat')},"Throws an error that calibration tried to load twice"); +}); +QUnit.test("Try to load twice but empty existing ARCameraPara before loading", assert => { + const cParaUrl = './camera_para_error.dat'; + const success = function() { + } + const error = function () { + } + const cameraPara = new ARCameraParam(cParaUrl, success, error); + cameraPara.dispose(); + assert.deepEqual("",cameraPara.src); + + const cameraParaString = './camera_para.dat'; + cameraPara.load(cameraParaString); + assert.deepEqual(cameraParaString, cameraPara.src, "load after dispose should work"); +}); + +/* #### ARController Module #### */ +QUnit.module("ARController", { + beforeEach : assert => { + this.timeout = 5000; + this.cleanUpTimeout = 500; + this.cParaUrl = './camera_para.dat'; + this.checkDefault = (arController) => { + assert.ok(arController); + assert.deepEqual(arController.orientation, "landscape", "Check the default values: landscape"); + assert.deepEqual(arController.listeners, {}, "Check the default values: listeners"); + assert.deepEqual(arController.defaultMarkerWidth, 1, "Check the default values: defaultMarkerWidth"); + assert.deepEqual(arController.patternMarkers,{},"Check the default values: patternMarkers==={}"); + assert.deepEqual(arController.barcodeMarkers,{},"Check the default values: barcodeMarkers==={}"); + assert.deepEqual(arController.transform_mat,new Float32Array(16),"Check the default values: transform_mat"); + assert.ok(arController.canvas, "Check the default values: canvas"); + assert.ok(arController.ctx, "Check the default values: ctx"); + } + } +}); +QUnit.test("Create ARController default", assert => { + const videoWidth = 640, videoHeight = 480; + const done = assert.async(); + assert.timeout(this.timeout); + const success = () => { + const arController = new ARController(videoWidth, videoHeight, cameraPara); + this.checkDefault(arController); + + arController.onload = (err) => { + assert.notOk(err, "no error"); + assert.ok(true, "successfully loaded"); + + assert.deepEqual(arController.cameraParam, cameraPara, "Check the default values: cameraPara"); + assert.deepEqual(arController.videoWidth, videoWidth, "Check the default values: videoWidth"); + assert.deepEqual(arController.videoHeight, videoHeight, "Check the default values: videoHeight"); + assert.notOk(arController.image, "Check the default values: image === undefined"); + + assert.deepEqual(arController.canvas.width, videoWidth,"Check the default values: canvas.width"); + assert.deepEqual(arController.canvas.height, videoHeight, "Check the default values: canvas.height"); + setTimeout(() => { + arController.dispose(); + done(); + } + ,this.cleanUpTimeout); + }; + } + const error = function () { + assert.ok(false); + } + const cameraPara = new ARCameraParam(this.cParaUrl, success, error); +}); +QUnit.test("Create ARController track image", assert => { + const done = assert.async(); + assert.timeout(this.timeout); + const success = () => { + const arController = new ARController(v1, cameraPara); + arController.debugSetup(); + arController.addEventListener('getMarker', (trackableInfo) => { + assert.ok(true, "Marker found"); + assert.deepEqual(trackableInfo.data.marker.idMatrix,0); + }); + + arController.onload = (err) => { + assert.deepEqual(arController.cameraParam, cameraPara, "Check the default values: cameraPara"); + assert.deepEqual(arController.image, v1, "Check the default values: image"); + assert.deepEqual(arController.videoWidth, v1.width, "Check the default values: image.width"); + assert.deepEqual(arController.videoHeight, v1.height, "Check the default values: image.height"); + + assert.deepEqual(arController.canvas.width, v1.width,"Check the default values: canvas.width"); + assert.deepEqual(arController.canvas.height, v1.height, "Check the default values: canvas.height"); + assert.notOk(err, "no error"); + assert.ok(true, "successfully loaded"); + + arController.loadMarker('./patt.hiro',(markerId) => { + assert.ok(markerId >= 0, "Marker loaded"); + arController.trackPatternMarkerId(markerId); + const t0 = performance.now(); + arController.process(v1); + // const detectMarkerResult = arController.detectMarker() + const t1 = performance.now(); + + // assert.ok( detectMarkerResult == 0, "Detect marker ran successfull"); + assert.ok( t1 - t0 < 700, "Process returns within expected time < 100ms actual: " + (t1 - t0)); + + arController.debugDraw(); + setTimeout(() => { + arController.dispose(); + done(); + } + ,this.cleanUpTimeout); + }); + }; + } + const error = () => { + assert.ok(false); + done(); + } + const cameraPara = new ARCameraParam(this.cParaUrl, success, error); +}); +QUnit.test("Create ARController default, CameraPara as string", assert => { + const videoWidth = 640, videoHeight = 480; + const cameraParaUrl = './camera_para.dat'; + const done = assert.async(); + assert.timeout(this.timeout); + //ARController calls _initialize, which in turn contains a timeOut-function that waits for 1ms + + const error = function () { + assert.ok(false); + done(); + } + const success = () => { + const arController = new ARController(videoWidth, videoHeight, cameraParaUrl); + + arController.onload = (err) => { + assert.notOk(err, "no error"); + assert.ok(true, "successfully loaded"); + this.checkDefault(arController); + + assert.deepEqual(arController.videoWidth, videoWidth, "Check the default values: videoWidth"); + assert.deepEqual(arController.videoHeight, videoHeight, "Check the default values: videoHeight"); + assert.notOk(arController.image, "Check the default values: image === undefined"); + + assert.deepEqual(arController.canvas.width, videoWidth,"Check the default values: canvas.width"); + assert.deepEqual(arController.canvas.height, videoHeight, "Check the default values: canvas.height"); + + setTimeout(() => { + arController.dispose(); + done(); + } + ,this.cleanUpTimeout); + }; + } + const cameraPara = new ARCameraParam(this.cParaUrl, success, error); +}); +QUnit.test("Create ARController default, CameraPara as invalid string", assert => { + const videoWidth = 640, videoHeight = 480; + const cameraParaUrl = './camera_para_error.dat'; + assert.timeout(this.timeout); + //ARController calls _initialize, which in turn contains a timeOut-function that waits for 1ms + const done = assert.async(); + + const error = function () { + assert.ok(false); + } + const success = () => { + const arController = new ARController(videoWidth, videoHeight, cameraParaUrl); + + arController.onload = (err) => { + assert.deepEqual(err, 404, "error while loading"); + setTimeout(() => { + arController.dispose(); + done(); + } + ,this.cleanUpTimeout); + }; + } + const cameraPara = new ARCameraParam(this.cParaUrl, success, error); + +}); + +/* #### ARController.getUserMedia module #### */ +QUnit.module("ARController.getUserMedia", { + afterEach : assert => { + if(this.video.srcObject) { + const track = this.video.srcObject.getTracks()[0]; + track.stop(); + this.video.srcObject = null; + } + this.video.src = null; + } +}); +QUnit.test("getUserMedia", assert => { + const width = 640; + const height = 480; + const facingMode = 'environment'; + const success = (video) => { + assert.ok(video,"Successfully created video element"); + assert.ok(video.srcObject, "Check the source object"); + assert.deepEqual(video.srcObject.getTracks().length,1, "Ensure we only get one Track back ... "); + assert.deepEqual(video.srcObject.getVideoTracks().length,1, ".. and that that track is of type 'video'"); + const videoTrack = video.srcObject.getVideoTracks()[0]; + console.log("videoTrack.label: " + videoTrack.label); + + assert.ok(videoTrack.getSettings(), "Check if the video track has settings available"); + const videoTrackSettings = videoTrack.getSettings(); + assert.deepEqual(videoTrackSettings.width, width, "Video width from constraints"); + assert.deepEqual(videoTrackSettings.height, height, "Video height from constraints"); + + const supported = navigator.mediaDevices.getSupportedConstraints(); + // Mobile supports facingMode to be set. Desktop states that facingMode is supported but doesn't list the facing mode inside the settings and hence it will fail + if(supported["facingMode"] && videoTrackSettings.facingMode) + assert.deepEqual(videoTrackSettings.facingMode, facingMode, "Video facing mode from constraints"); + + // Don't check video.src anymore because it should not be available in modern browsers + //assert.ok(video.src); + this.video = video; + done(); + } + const error = err => { + assert.notOk(err); + done(); + } + + const configuration = { + onSuccess : success, + onError : error, + width : width, + height : height, + facingMode : facingMode + + }; + assert.timeout(10000); + const done = assert.async(); + const video = ARController.getUserMedia(configuration); + // The video element is lazy loading better to check it inside the success function + assert.ok(video, "The created video element"); + // Add the video element to html + document.body.appendChild(video); +}); +QUnit.test("getUserMedia with max/min constraints", assert => { + const width = {min: 320, max: 640}; + const height = {min: 240, max: 480}; + const facingMode = {ideal: 'environment'}; + const success = (video) => { + this.video = video; + const videoTrack = video.srcObject.getVideoTracks()[0]; + const videoTrackSettings = videoTrack.getSettings(); + assert.deepEqual(videoTrackSettings.width, width.max, "Video width from constraints"); + assert.deepEqual(videoTrackSettings.height, height.max, "Video height from constraints"); + + done(); + } + const error = err => { + assert.notOk(err); + done(); + } + + const configuration = { + onSuccess : success, + onError : error, + width : width, + height : height, + facingMode : facingMode + + }; + assert.timeout(10000); + const done = assert.async(); + const video = ARController.getUserMedia(configuration); + // The video element is lazy loading better to check it inside the success function + assert.ok(video, "The created video element"); +}); +QUnit.test("getUserMedia with ideal constraints", assert => { + const width = {min: 320, ideal: 640}; + const height = {min: 240, ideal: 480}; + const facingMode = {ideal: 'environment'}; + const success = (video) => { + this.video = video; + const videoTrack = video.srcObject.getVideoTracks()[0]; + const videoTrackSettings = videoTrack.getSettings(); + assert.deepEqual(videoTrackSettings.width, width.ideal, "Video width from constraints"); + assert.deepEqual(videoTrackSettings.height, height.ideal, "Video height from constraints"); + done(); + } + const error = err => { + assert.notOk(err); + done(); + } + + const configuration = { + onSuccess : success, + onError : error, + width : width, + height : height, + facingMode : facingMode + + }; + assert.timeout(10000); + const done = assert.async(); + const video = ARController.getUserMedia(configuration); + // The video element is lazy loading better to check it inside the success function + assert.ok(video, "The created video element"); +}); + +QUnit.test("getUserMedia facing user", assert => { + const facingMode = {ideal: 'user'}; + const success = (video) => { + this.video = video; + const videoTrack = video.srcObject.getVideoTracks()[0]; + const videoTrackSettings = videoTrack.getSettings(); + + const supported = navigator.mediaDevices.getSupportedConstraints(); + // Mobile supports facingMode to be set. Desktop states that facingMode is supported but doesn't list the facing mode inside the settings and hence it will fail + if(supported["facingMode"] && videoTrackSettings.facingMode) + assert.deepEqual(videoTrackSettings.facingMode, facingMode.ideal, "Video facing mode from constraints"); + done(); + } + const error = err => { + assert.notOk(err); + done(); + } + + const configuration = { + onSuccess : success, + onError : error, + facingMode : facingMode + + }; + assert.timeout(10000); + const done = assert.async(); + const video = ARController.getUserMedia(configuration); + // The video element is lazy loading better to check it inside the success function + assert.ok(video, "The created video element"); + // Add the video element to html + document.body.appendChild(video); +}); + +/* #### ARController.getUserMediaARController module #### */ +QUnit.module("ARController.getUserMediaARController", { + beforeEach : assert => { + this.timeout = 5000; + this.cleanUpTimeout = 500; + } +}); +QUnit.test("getUserMediaARController default", assert => { + const done = assert.async(); + assert.timeout(this.timeout); + const success = (arController, arCameraParam) => { + assert.ok(arController, "ARController created"); + assert.ok(arController.id>=0, "ARController id created"); + assert.ok(arCameraParam, "ARCameraPara created"); + setTimeout( ()=> { + arController.dispose(); + done(); + }, this.cleanUpTimeout); + }; + + const error = error => { + assert.notOk(error); + done(); + } + + const config = { + onSuccess : success, + onError : error, + + cameraParam: './camera_para.dat', // URL to camera parameters definition file. + maxARVideoSize: 640, // Maximum max(width, height) for the AR processing canvas. + + width : 640, + height : 480, + + facingMode : 'environment' + } + const video = ARController.getUserMediaARController(config); + assert.ok(video, "Video created"); + document.body.appendChild(video); +}); +QUnit.test("getUserMediaARController wrong calib-url", assert => { + const done = assert.async(); + assert.timeout(5000); + const success = (arController, arCameraParam) => { + assert.notOk(arController, "ARController created"); + done(); + }; + + const error = error => { + assert.ok(error); + assert.notOk(video.srcObject); + done(); + } + + const config = { + onSuccess : success, + onError : error, + + cameraParam: './camera_para_error.dat', // URL to camera parameters definition file. + maxARVideoSize: 640, // Maximum max(width, height) for the AR processing canvas. + + width : 640, + height : 480, + + facingMode : 'environment' + } + const video = ARController.getUserMediaARController(config); + assert.ok(video, "Video created"); + document.body.appendChild(video); +}); +QUnit.module("ARController.Test trackable registration",{ + afterEach : assert => { + if(this.video.srcObject) { + const track = this.video.srcObject.getTracks()[0]; + track.stop(); + this.video.srcObject = null; + } + this.video.src = null; + } +}); +QUnit.test("Register valid square trackable", assert => { + + const done = assert.async(); + assert.timeout(5000); + + const loadMarkerSuccess = (markerId) => { + assert.ok(markerId >= 0); + done(); + } + const loadMarkerError = error => { + assert.notOk(error); + done(); + } + + + const successCallback = (arController, arCameraParam) => { + // add marker string + arController.loadMarker('../examples/Data/patt.hiro', loadMarkerSuccess, loadMarkerError); + + }; + + const errorCallback = (error) => { + console.log("ERROR" + error); + assert.notOk(error, "Error while calling `getUserMediaARController`"); + done(); + } + + const config = { + onSuccess : successCallback, + onError: errorCallback, + cameraParam: './camera_para.dat', + maxARVideoSize: 640, + width: 640, + height: 480, + facingMode: 'environment', + }; + + this.video = ARController.getUserMediaARController(config); + +}); +QUnit.test("Register invalid square trackable", assert => { + + const done = assert.async(); + assert.timeout(5000); + + const loadMarkerSuccess = (markerId) => { + assert.ok(markerId >= 0); + done(); + }; + const loadMarkerError = error => { + assert.ok(error=404, 'Test with invalid pattern-URL'); + done(); + }; + + const successCallback = (arController, arCameraParam) => { + // add marker string + arController.loadMarker('../examples/Data/patt_error.hiro', loadMarkerSuccess, loadMarkerError); + }; + + const errorCallback = (error) => { + console.log("ERROR" + error); + assert.notOk(error, "Error while calling `getUserMediaARController`"); + done(); + }; + + const config = { + onSuccess : successCallback, + onError: errorCallback, + cameraParam: './camera_para.dat', + maxARVideoSize: 640, + width: 640, + height: 480, + facingMode: 'environment', + }; + + this.video = ARController.getUserMediaARController(config); + +}); +QUnit.test("Register valid NFT trackable", assert => { + + const done = assert.async(); + assert.timeout(5000); + + const loadMarkerSuccess = (markerId) => { + assert.ok(markerId >= 0); + done(); + } + const loadMarkerError = error => { + assert.notOk(error); + done(); + } + + + const successCallback = (arController, arCameraParam) => { + // add NFT marker string + arController.loadNFTMarker('../examples/DataNFT/pinball', loadMarkerSuccess, loadMarkerError); + + }; + + const errorCallback = (error) => { + console.log("ERROR" + error); + assert.notOk(error, "Error while calling `getUserMediaARController`"); + done(); + } + + const config = { + onSuccess : successCallback, + onError: errorCallback, + cameraParam: './camera_para.dat', + maxARVideoSize: 640, + width: 640, + height: 480, + facingMode: 'environment', + }; + + this.video = ARController.getUserMediaARController(config); + +}); +QUnit.test("Register invalid NFT trackable", assert => { + + const done = assert.async(); + assert.timeout(5000); + + const loadMarkerSuccess = (markerId) => { + assert.ok(markerId >= 0); + done(); + }; + const loadMarkerError = error => { + assert.ok(error=404, 'Test with invalid pattern-URL'); + done(); + }; + + const successCallback = (arController, arCameraParam) => { + // add marker string + arController.loadNFTMarker('../examples/DataNFT/pinball-error', loadMarkerSuccess, loadMarkerError); + }; + + const errorCallback = (error) => { + console.log("ERROR" + error); + assert.notOk(error, "Error while calling `getUserMediaARController`"); + done(); + }; + + const config = { + onSuccess : successCallback, + onError: errorCallback, + cameraParam: './camera_para.dat', + maxARVideoSize: 640, + width: 640, + height: 480, + facingMode: 'environment', + }; + + this.video = ARController.getUserMediaARController(config); + +}); +QUnit.test("Register empty URL NFT trackable", assert => { + + const done = assert.async(); + assert.timeout(5000); + + const loadMarkerSuccess = (markerId) => { + assert.ok(markerId >= 0, 'MarkerId is greater or equals 0'); + done(); + }; + const loadMarkerError = error => { + console.log(error); + assert.ok(error, 'Test with invalid pattern-URL'); + done(); + }; + + const successCallback = (arController, arCameraParam) => { + // add marker string + arController.loadNFTMarker("", loadMarkerSuccess, loadMarkerError); + }; + + const errorCallback = (error) => { + console.log("ERROR" + error); + assert.notOk(error, "Error while calling `getUserMediaARController`"); + done(); + }; + + const config = { + onSuccess : successCallback, + onError: errorCallback, + cameraParam: './camera_para.dat', + maxARVideoSize: 640, + width: 640, + height: 480, + facingMode: 'environment', + }; + + this.video = ARController.getUserMediaARController(config); + +}); +QUnit.test("Register empty URL trackable", assert => { + + const done = assert.async(); + assert.timeout(5000); + + const loadMarkerSuccess = (markerId) => { + assert.ok(markerId >= 0, 'MarkerId is greater or equals 0'); + done(); + }; + const loadMarkerError = error => { + console.log(error); + assert.ok(error, 'Test with invalid pattern-URL'); + done(); + }; + + const successCallback = (arController, arCameraParam) => { + // add marker string + arController.loadMarker("", loadMarkerSuccess, loadMarkerError); + }; + + const errorCallback = (error) => { + console.log("ERROR" + error); + assert.notOk(error, "Error while calling `getUserMediaARController`"); + done(); + }; + + const config = { + onSuccess : successCallback, + onError: errorCallback, + cameraParam: './camera_para.dat', + maxARVideoSize: 640, + width: 640, + height: 480, + facingMode: 'environment', + }; + + this.video = ARController.getUserMediaARController(config); + +}); +/* #### Full setup test #### */ +QUnit.module("Performance test video",{ + beforeEach : assert => { + this.timeout = 10000; + this.cleanUpTimeout = 500; + }, + afterEach : assert => { + if(this.video.srcObject) { + const track = this.video.srcObject.getTracks()[0]; + track.stop(); + this.video.srcObject = null; + } + this.video.src = null; + } +}); +QUnit.test("PTV: performance test video", assert => { + + const testDone = assert.async(); + + performance.mark('start video measure'); + const done = () => { + performance.mark('cleanup-done'); + performance.measure('Cleanup time', 'cleanup', 'cleanup-done'); + performance.measure('Test time', 'start video measure', 'cleanup-done'); + const measures = performance.getEntriesByType('measure'); + const csv = Papa.unparse(JSON.stringify(measures)); + console.log(csv); + + testDone(); + }; + assert.timeout(this.timeout); + assert.expect(0); + const success = (arController, arCameraParam) => { + performance.mark('getUserMediaARController-success'); + performance.measure('Start videostream','start video measure', 'getUserMediaARController-success'); + + arController.loadMarker('./patt.hiro',(markerId) => { + performance.mark('loadMarker-success'); + performance.measure('Load marker','getUserMediaARController-success', 'loadMarker-success'); + + //Process the open video stream + for(var i = 0; i <= 100; i++) { + performance.mark('process-' + i + ' start'); + arController.process(this.video); + performance.mark('process-' + i + ' done'); + performance.measure('process video','process-' + i + ' start', 'process-' + i + ' done'); + } + + performance.mark('cleanup'); + arController.dispose(); + done(); + }); + }; + + const error = error => { + done(); + } + + const config = { + onSuccess : success, + onError : error, + + cameraParam: './camera_para.dat', // URL to camera parameters definition file. + maxARVideoSize: 640, // Maximum max(width, height) for the AR processing canvas. + + width : 640, + height : 480, + + facingMode : 'environment' + } + this.video = ARController.getUserMediaARController(config); + document.body.appendChild(this.video); +}); +QUnit.module("Performance test image",{ + beforeEach : assert => { + this.timeout = 10000; + this.cleanUpTimeout = 500; + } +}); +QUnit.test("performance test image", assert => { + + const testDone = assert.async(); + const cParaUrl = './camera_para.dat'; + + performance.mark('start image measure'); + const done = () => { + performance.mark('cleanup-done'); + performance.measure('Cleanup time', 'cleanup', 'cleanup-done'); + performance.measure('Test time', 'start image measure', 'cleanup-done'); + const measures = performance.getEntriesByType('measure'); + const csv = Papa.unparse(JSON.stringify(measures)); + console.log(csv); + + testDone(); + }; + assert.timeout(this.timeout); + assert.expect(0); + + const success = () => { + const arController = new ARController(v1, cameraPara); + arController.onload = () => { + performance.mark('ARController.onload()'); + performance.measure('Start ARController','start image measure', 'ARController.onload()'); + + arController.loadMarker('./patt.hiro',(markerId) => { + performance.mark('loadMarker-success'); + performance.measure('Load marker','ARController.onload()', 'loadMarker-success'); + + for(var i = 0; i <= 100; i++) { + //Process an image + performance.mark('process-' + i + ' start'); + arController.process(v1); + performance.mark('process-' + i + ' done'); + performance.measure('process image','process-' + i + ' start', 'process-' + i + ' done'); + } + + performance.mark('cleanup'); + arController.dispose(); + done(); + }); + }; + }; + + const error = error => { + assert.notOk(error); + testDone(); + } + + const cameraPara = new ARCameraParam(cParaUrl, success, error); +}); +//TODO write test for external Video stream creation diff --git a/jsartoolkit5/tests/tests_wasm.js b/jsartoolkit5/tests/tests_wasm.js new file mode 100644 index 0000000..0a4e382 --- /dev/null +++ b/jsartoolkit5/tests/tests_wasm.js @@ -0,0 +1,817 @@ + +window.addEventListener('artoolkit-loaded', () => { + + QUnit.module("ARCameraPara"); + QUnit.test( "Create object and load camera parameter", function( assert ) { + const cParaUrl = './camera_para.dat'; + const done = assert.async(); + const success = function() { + assert.ok(true, "Successfully loaded camera para"); + done(); + } + const error = function () { + assert.ok(false, "Failed loading camera para"); + done(); + } + const cameraPara = new ARCameraParam(cParaUrl, success, error, false); + assert.equal(cameraPara.src, cParaUrl, "Camera para URL is equal to: " + cParaUrl); + }); + QUnit.test( "Create object and fail to load camera parameter", function( assert ) { + const cParaUrl = './camera_para_error.dat'; + const done = assert.async(); + const success = function() { + assert.ok(false, "Successfully loaded camera para"); + done(); + } + const error = function () { + assert.ok(true, "Failed loading camera para"); + done(); + } + const cameraPara = new ARCameraParam(cParaUrl, success, error, false); + }); + QUnit.test("Try to load twice", assert => { + const cParaUrl = './camera_para_error.dat'; + const success = function() { + } + const error = function () { + } + const cameraPara = new ARCameraParam(cParaUrl, success, error); + + assert.throws(() => {cameraPara.load('./camera_para.dat')},"Throws an error that calibration tried to load twice"); + }); + QUnit.test("Try to load twice but empty existing ARCameraPara before loading", assert => { + const cParaUrl = './camera_para_error.dat'; + const success = function() { + } + const error = function () { + } + const cameraPara = new ARCameraParam(cParaUrl, success, error); + cameraPara.dispose(); + assert.deepEqual("",cameraPara.src); + + const cameraParaString = './camera_para.dat'; + cameraPara.load(cameraParaString); + assert.deepEqual(cameraParaString, cameraPara.src, "load after dispose should work"); + }); + + /* #### ARController Module #### */ + QUnit.module("ARController", { + beforeEach : assert => { + this.timeout = 5000; + this.cleanUpTimeout = 500; + this.cParaUrl = './camera_para.dat'; + this.checkDefault = (arController) => { + assert.ok(arController); + assert.deepEqual(arController.orientation, "landscape", "Check the default values: landscape"); + assert.deepEqual(arController.listeners, {}, "Check the default values: listeners"); + assert.deepEqual(arController.defaultMarkerWidth, 1, "Check the default values: defaultMarkerWidth"); + assert.deepEqual(arController.patternMarkers,{},"Check the default values: patternMarkers==={}"); + assert.deepEqual(arController.barcodeMarkers,{},"Check the default values: barcodeMarkers==={}"); + assert.deepEqual(arController.transform_mat,new Float32Array(16),"Check the default values: transform_mat"); + assert.ok(arController.canvas, "Check the default values: canvas"); + assert.ok(arController.ctx, "Check the default values: ctx"); + } + } + }); + QUnit.test("Create ARController default", assert => { + const videoWidth = 640, videoHeight = 480; + const done = assert.async(); + assert.timeout(this.timeout); + const success = () => { + const arController = new ARController(videoWidth, videoHeight, cameraPara); + this.checkDefault(arController); + + arController.onload = (err) => { + assert.notOk(err, "no error"); + assert.ok(true, "successfully loaded"); + + assert.deepEqual(arController.cameraParam, cameraPara, "Check the default values: cameraPara"); + assert.deepEqual(arController.videoWidth, videoWidth, "Check the default values: videoWidth"); + assert.deepEqual(arController.videoHeight, videoHeight, "Check the default values: videoHeight"); + assert.notOk(arController.image, "Check the default values: image === undefined"); + + assert.deepEqual(arController.canvas.width, videoWidth,"Check the default values: canvas.width"); + assert.deepEqual(arController.canvas.height, videoHeight, "Check the default values: canvas.height"); + setTimeout(() => { + arController.dispose(); + done(); + } + ,this.cleanUpTimeout); + }; + } + const error = function () { + assert.ok(false); + } + const cameraPara = new ARCameraParam(this.cParaUrl, success, error); + + }); + QUnit.test("Create ARController track image", assert => { + const done = assert.async(); + assert.timeout(this.timeout); + const success = () => { + const arController = new ARController(v1, cameraPara); + arController.debugSetup(); + this.checkDefault(arController); + + arController.onload = (err) => { + assert.notOk(err, "no error"); + assert.ok(true, "successfully loaded"); + assert.deepEqual(arController.cameraParam, cameraPara, "Check the default values: cameraPara"); + assert.deepEqual(arController.image, v1, "Check the default values: image"); + assert.deepEqual(arController.videoWidth, v1.width, "Check the default values: image.width"); + assert.deepEqual(arController.videoHeight, v1.height, "Check the default values: image.height"); + + assert.deepEqual(arController.canvas.width, v1.width,"Check the default values: canvas.width"); + assert.deepEqual(arController.canvas.height, v1.height, "Check the default values: canvas.height"); + const t0 = performance.now(); + const detectMarkerResult = arController.detectMarker() + const t1 = performance.now(); + + assert.ok( detectMarkerResult == 0, "Detected marker in image"); + assert.ok( t1 - t0 < 700, "Detect marker returns within expected time < 100ms actual: " + (t1 - t0)); + + arController.debugDraw(); + setTimeout(() => { + arController.dispose(); + done(); + } + ,this.cleanUpTimeout); + }; + } + const error = () => { + assert.ok(false); + done(); + } + const cameraPara = new ARCameraParam(this.cParaUrl, success, error); + }); + QUnit.test("Create ARController default, CameraPara as string", assert => { + const videoWidth = 640, videoHeight = 480; + const cameraParaUrl = './camera_para.dat'; + const done = assert.async(); + assert.timeout(this.timeout); + //ARController calls _initialize, which in turn contains a timeOut-function that waits for 1ms + + const error = function () { + assert.ok(false); + done(); + } + const success = () => { + const arController = new ARController(videoWidth, videoHeight, cameraParaUrl); + + arController.onload = (err) => { + assert.notOk(err, "no error"); + assert.ok(true, "successfully loaded"); + this.checkDefault(arController); + + assert.deepEqual(arController.videoWidth, videoWidth, "Check the default values: videoWidth"); + assert.deepEqual(arController.videoHeight, videoHeight, "Check the default values: videoHeight"); + assert.notOk(arController.image, "Check the default values: image === undefined"); + + assert.deepEqual(arController.canvas.width, videoWidth,"Check the default values: canvas.width"); + assert.deepEqual(arController.canvas.height, videoHeight, "Check the default values: canvas.height"); + + setTimeout(() => { + arController.dispose(); + done(); + } + ,this.cleanUpTimeout); + }; + } + const cameraPara = new ARCameraParam(this.cParaUrl, success, error); + }); + QUnit.test("Create ARController default, CameraPara as invalid string", assert => { + const videoWidth = 640, videoHeight = 480; + const cameraParaUrl = './camera_para_error.dat'; + assert.timeout(this.timeout); + //ARController calls _initialize, which in turn contains a timeOut-function that waits for 1ms + const done = assert.async(); + + const error = function () { + assert.ok(false); + } + const success = () => { + const arController = new ARController(videoWidth, videoHeight, cameraParaUrl); + + arController.onload = (err) => { + assert.deepEqual(err, 404, "error while loading"); + setTimeout(() => { + arController.dispose(); + done(); + } + ,this.cleanUpTimeout); + }; + } + const cameraPara = new ARCameraParam(this.cParaUrl, success, error); + + }); + + /* #### ARController.getUserMedia module #### */ + QUnit.module("ARController.getUserMedia", { + afterEach : assert => { + if(this.video.srcObject) { + const track = this.video.srcObject.getTracks()[0]; + track.stop(); + this.video.srcObject = null; + } + this.video.src = null; + } + }); + QUnit.test("getUserMedia", assert => { + const width = 640; + const height = 480; + const facingMode = 'environment'; + const success = (video) => { + assert.ok(video,"Successfully created video element"); + assert.ok(video.srcObject, "Check the source object"); + assert.deepEqual(video.srcObject.getTracks().length,1, "Ensure we only get one Track back ... "); + assert.deepEqual(video.srcObject.getVideoTracks().length,1, ".. and that that track is of type 'video'"); + const videoTrack = video.srcObject.getVideoTracks()[0]; + console.log("videoTrack.label: " + videoTrack.label); + + assert.ok(videoTrack.getSettings(), "Check if the video track has settings available"); + const videoTrackSettings = videoTrack.getSettings(); + assert.deepEqual(videoTrackSettings.width, width, "Video width from constraints"); + assert.deepEqual(videoTrackSettings.height, height, "Video height from constraints"); + + const supported = navigator.mediaDevices.getSupportedConstraints(); + // Mobile supports facingMode to be set. Desktop states that facingMode is supported but doesn't list the facing mode inside the settings and hence it will fail + if(supported["facingMode"] && videoTrackSettings.facingMode) + assert.deepEqual(videoTrackSettings.facingMode, facingMode, "Video facing mode from constraints"); + + // Don't check video.src anymore because it should not be available in modern browsers + //assert.ok(video.src); + this.video = video; + done(); + } + const error = err => { + assert.notOk(err); + done(); + } + + const configuration = { + onSuccess : success, + onError : error, + width : width, + height : height, + facingMode : facingMode + + }; + assert.timeout(10000); + const done = assert.async(); + const video = ARController.getUserMedia(configuration); + // The video element is lazy loading better to check it inside the success function + assert.ok(video, "The created video element"); + // Add the video element to html + document.body.appendChild(video); + }); + QUnit.test("getUserMedia with max/min constraints", assert => { + const width = {min: 320, max: 640}; + const height = {min: 240, max: 480}; + const facingMode = {ideal: 'environment'}; + const success = (video) => { + this.video = video; + const videoTrack = video.srcObject.getVideoTracks()[0]; + const videoTrackSettings = videoTrack.getSettings(); + assert.deepEqual(videoTrackSettings.width, width.max, "Video width from constraints"); + assert.deepEqual(videoTrackSettings.height, height.max, "Video height from constraints"); + + done(); + } + const error = err => { + assert.notOk(err); + done(); + } + + const configuration = { + onSuccess : success, + onError : error, + width : width, + height : height, + facingMode : facingMode + + }; + assert.timeout(10000); + const done = assert.async(); + const video = ARController.getUserMedia(configuration); + // The video element is lazy loading better to check it inside the success function + assert.ok(video, "The created video element"); + }); + QUnit.test("getUserMedia with ideal constraints", assert => { + const width = {min: 320, ideal: 640}; + const height = {min: 240, ideal: 480}; + const facingMode = {ideal: 'environment'}; + const success = (video) => { + this.video = video; + const videoTrack = video.srcObject.getVideoTracks()[0]; + const videoTrackSettings = videoTrack.getSettings(); + assert.deepEqual(videoTrackSettings.width, width.ideal, "Video width from constraints"); + assert.deepEqual(videoTrackSettings.height, height.ideal, "Video height from constraints"); + done(); + } + const error = err => { + assert.notOk(err); + done(); + } + + const configuration = { + onSuccess : success, + onError : error, + width : width, + height : height, + facingMode : facingMode + + }; + assert.timeout(10000); + const done = assert.async(); + const video = ARController.getUserMedia(configuration); + // The video element is lazy loading better to check it inside the success function + assert.ok(video, "The created video element"); + }); + + QUnit.test("getUserMedia facing user", assert => { + const facingMode = {ideal: 'user'}; + const success = (video) => { + this.video = video; + const videoTrack = video.srcObject.getVideoTracks()[0]; + const videoTrackSettings = videoTrack.getSettings(); + + const supported = navigator.mediaDevices.getSupportedConstraints(); + // Mobile supports facingMode to be set. Desktop states that facingMode is supported but doesn't list the facing mode inside the settings and hence it will fail + if(supported["facingMode"] && videoTrackSettings.facingMode) + assert.deepEqual(videoTrackSettings.facingMode, facingMode.ideal, "Video facing mode from constraints"); + done(); + } + const error = err => { + assert.notOk(err); + done(); + } + + const configuration = { + onSuccess : success, + onError : error, + facingMode : facingMode + + }; + assert.timeout(10000); + const done = assert.async(); + const video = ARController.getUserMedia(configuration); + // The video element is lazy loading better to check it inside the success function + assert.ok(video, "The created video element"); + // Add the video element to html + document.body.appendChild(video); + }); + + /* #### ARController.getUserMediaARController module #### */ + QUnit.module("ARController.getUserMediaARController", { + beforeEach : assert => { + this.timeout = 5000; + this.cleanUpTimeout = 500; + } + }); + QUnit.test("getUserMediaARController default", assert => { + const done = assert.async(); + assert.timeout(this.timeout); + const success = (arController, arCameraParam) => { + assert.ok(arController, "ARController created"); + assert.ok(arController.id>=0, "ARController id created"); + assert.ok(arCameraParam, "ARCameraPara created"); + setTimeout( ()=> { + arController.dispose(); + done(); + }, this.cleanUpTimeout); + }; + + const error = error => { + assert.notOk(error); + done(); + } + + const config = { + onSuccess : success, + onError : error, + + cameraParam: './camera_para.dat', // URL to camera parameters definition file. + maxARVideoSize: 640, // Maximum max(width, height) for the AR processing canvas. + + width : 640, + height : 480, + + facingMode : 'environment' + } + const video = ARController.getUserMediaARController(config); + assert.ok(video, "Video created"); + document.body.appendChild(video); + }); + QUnit.test("getUserMediaARController wrong calib-url", assert => { + const done = assert.async(); + assert.timeout(5000); + const success = (arController, arCameraParam) => { + assert.notOk(arController, "ARController created"); + done(); + }; + + const error = error => { + assert.ok(error); + assert.notOk(video.srcObject); + done(); + } + + const config = { + onSuccess : success, + onError : error, + + cameraParam: './camera_para_error.dat', // URL to camera parameters definition file. + maxARVideoSize: 640, // Maximum max(width, height) for the AR processing canvas. + + width : 640, + height : 480, + + facingMode : 'environment' + } + const video = ARController.getUserMediaARController(config); + assert.ok(video, "Video created"); + document.body.appendChild(video); + }); + QUnit.module("ARController.Test trackable registration",{ + afterEach : assert => { + if(this.video.srcObject) { + const track = this.video.srcObject.getTracks()[0]; + track.stop(); + this.video.srcObject = null; + } + this.video.src = null; + } + }); + QUnit.test("Register valid trackable", assert => { + + const done = assert.async(); + assert.timeout(5000); + + const loadMarkerSuccess = (markerId) => { + assert.ok(markerId >= 0); + done(); + } + const loadMarkerError = error => { + assert.notOk(error); + done(); + } + + + const successCallback = (arController, arCameraParam) => { + // add marker string + arController.loadMarker('../examples/Data/patt.hiro', loadMarkerSuccess, loadMarkerError); + + }; + + const errorCallback = (error) => { + console.log("ERROR" + error); + assert.notOk(error, "Error while calling `getUserMediaARController`"); + done(); + } + + const config = { + onSuccess : successCallback, + onError: errorCallback, + cameraParam: './camera_para.dat', + maxARVideoSize: 640, + width: 640, + height: 480, + facingMode: 'environment', + }; + + this.video = ARController.getUserMediaARController(config); + + }); + QUnit.test("Register invalid trackable", assert => { + + const done = assert.async(); + assert.timeout(5000); + + const loadMarkerSuccess = (markerId) => { + assert.ok(markerId >= 0); + done(); + }; + const loadMarkerError = error => { + assert.ok(error=404, 'Test with invalid pattern-URL'); + done(); + }; + + const successCallback = (arController, arCameraParam) => { + // add marker string + arController.loadMarker('../examples/Data/patt_error.hiro', loadMarkerSuccess, loadMarkerError); + }; + + const errorCallback = (error) => { + console.log("ERROR" + error); + assert.notOk(error, "Error while calling `getUserMediaARController`"); + done(); + }; + + const config = { + onSuccess : successCallback, + onError: errorCallback, + cameraParam: './camera_para.dat', + maxARVideoSize: 640, + width: 640, + height: 480, + facingMode: 'environment', + }; + + this.video = ARController.getUserMediaARController(config); + + }); + QUnit.test("Register valid NFT trackable", assert => { + + const done = assert.async(); + assert.timeout(5000); + + const loadMarkerSuccess = (markerId) => { + assert.ok(markerId >= 0); + done(); + } + const loadMarkerError = error => { + assert.notOk(error); + done(); + } + + + const successCallback = (arController, arCameraParam) => { + // add NFT marker string + arController.loadNFTMarker('../examples/DataNFT/pinball', loadMarkerSuccess, loadMarkerError); + + }; + + const errorCallback = (error) => { + console.log("ERROR" + error); + assert.notOk(error, "Error while calling `getUserMediaARController`"); + done(); + } + + const config = { + onSuccess : successCallback, + onError: errorCallback, + cameraParam: './camera_para.dat', + maxARVideoSize: 640, + width: 640, + height: 480, + facingMode: 'environment', + }; + + this.video = ARController.getUserMediaARController(config); + + }); + QUnit.test("Register invalid NFT trackable", assert => { + + const done = assert.async(); + assert.timeout(5000); + + const loadMarkerSuccess = (markerId) => { + assert.ok(markerId >= 0); + done(); + }; + const loadMarkerError = error => { + assert.ok(error=404, 'Test with invalid pattern-URL'); + done(); + }; + + const successCallback = (arController, arCameraParam) => { + // add marker string + arController.loadNFTMarker('../examples/DataNFT/pinball-error', loadMarkerSuccess, loadMarkerError); + }; + + const errorCallback = (error) => { + console.log("ERROR" + error); + assert.notOk(error, "Error while calling `getUserMediaARController`"); + done(); + }; + + const config = { + onSuccess : successCallback, + onError: errorCallback, + cameraParam: './camera_para.dat', + maxARVideoSize: 640, + width: 640, + height: 480, + facingMode: 'environment', + }; + + this.video = ARController.getUserMediaARController(config); + + }); + QUnit.test("Register empty URL NFT trackable", assert => { + + const done = assert.async(); + assert.timeout(5000); + + const loadMarkerSuccess = (markerId) => { + assert.ok(markerId >= 0, 'MarkerId is greater or equals 0'); + done(); + }; + const loadMarkerError = error => { + console.log(error); + assert.ok(error, 'Test with invalid pattern-URL'); + done(); + }; + + const successCallback = (arController, arCameraParam) => { + // add marker string + arController.loadNFTMarker("", loadMarkerSuccess, loadMarkerError); + }; + + const errorCallback = (error) => { + console.log("ERROR" + error); + assert.notOk(error, "Error while calling `getUserMediaARController`"); + done(); + }; + + const config = { + onSuccess : successCallback, + onError: errorCallback, + cameraParam: './camera_para.dat', + maxARVideoSize: 640, + width: 640, + height: 480, + facingMode: 'environment', + }; + + this.video = ARController.getUserMediaARController(config); + + }); + QUnit.test("Register empty URL trackable", assert => { + + const done = assert.async(); + assert.timeout(5000); + + const loadMarkerSuccess = (markerId) => { + assert.ok(markerId >= 0, 'MarkerId is greater or equals 0'); + done(); + }; + const loadMarkerError = error => { + console.log(error); + assert.ok(error, 'Test with invalid pattern-URL'); + done(); + }; + + const successCallback = (arController, arCameraParam) => { + // add marker string + arController.loadMarker("", loadMarkerSuccess, loadMarkerError); + }; + + const errorCallback = (error) => { + console.log("ERROR" + error); + assert.notOk(error, "Error while calling `getUserMediaARController`"); + done(); + }; + + const config = { + onSuccess : successCallback, + onError: errorCallback, + cameraParam: './camera_para.dat', + maxARVideoSize: 640, + width: 640, + height: 480, + facingMode: 'environment', + }; + + this.video = ARController.getUserMediaARController(config); + + }); + + + /* #### Full setup test #### */ + QUnit.module("Performance test",{ + beforeEach : assert => { + this.timeout = 10000; + this.cleanUpTimeout = 500; + }, + afterEach : assert => { + if(this.video.srcObject) { + const track = this.video.srcObject.getTracks()[0]; + track.stop(); + this.video.srcObject = null; + } + this.video.src = null; + } + }); + QUnit.test("PTV: performance test video", assert => { + + const t0 = performance.now(); + const testDone = assert.async(); + + performance.mark('start video measure'); + const done = () => { + performance.mark('cleanup-done'); + performance.measure('Cleanup time', 'cleanup', 'cleanup-done'); + performance.measure('Test time', 'start video measure', 'cleanup-done'); + const measures = performance.getEntriesByType('measure'); + const csv = Papa.unparse(JSON.stringify(measures)); + console.log(csv); + + testDone(); + }; + assert.timeout(this.timeout); + assert.expect(0); + const success = (arController, arCameraParam) => { + performance.mark('getUserMediaARController-success'); + performance.measure('Start videostream','start video measure', 'getUserMediaARController-success'); + + arController.loadMarker('./patt.hiro',(markerId) => { + performance.mark('loadMarker-success'); + performance.measure('Load marker','getUserMediaARController-success', 'loadMarker-success'); + + + let t1 = performance.now(); + //Process the open video stream + for(var i = 0; i <= 100; i++) { + performance.mark('process-' + i + ' start'); + t1 = performance.now(); + arController.process(this.video); + performance.mark('process-' + i + ' done'); + performance.measure('process video','process-' + i + ' start', 'process-' + i + ' done'); + } + + performance.mark('cleanup'); + arController.dispose(); + done(); + }); + }; + + const error = error => { + done(); + } + + const config = { + onSuccess : success, + onError : error, + + cameraParam: './camera_para.dat', // URL to camera parameters definition file. + maxARVideoSize: 640, // Maximum max(width, height) for the AR processing canvas. + + width : 640, + height : 480, + + facingMode : 'environment' + } + this.video = ARController.getUserMediaARController(config); + document.body.appendChild(this.video); + }); + + QUnit.module("Performance test image",{ + beforeEach : assert => { + this.timeout = 10000; + this.cleanUpTimeout = 500; + } + }); + QUnit.test("performance test image", assert => { + + const testDone = assert.async(); + const cParaUrl = './camera_para.dat'; + + performance.mark('start image measure'); + const done = () => { + performance.mark('cleanup-done'); + performance.measure('Cleanup time', 'cleanup', 'cleanup-done'); + performance.measure('Test time', 'start image measure', 'cleanup-done'); + const measures = performance.getEntriesByType('measure'); + const csv = Papa.unparse(JSON.stringify(measures)); + console.log(csv); + + testDone(); + }; + assert.timeout(this.timeout); + assert.expect(0); + + const success = () => { + const arController = new ARController(v1, cameraPara); + arController.onload = () => { + performance.mark('ARController.onload()'); + performance.measure('Start ARController','start image measure', 'ARController.onload()'); + + arController.loadMarker('./patt.hiro',(markerId) => { + performance.mark('loadMarker-success'); + performance.measure('Load marker','ARController.onload()', 'loadMarker-success'); + + for(var i = 0; i <= 100; i++) { + //Process an image + performance.mark('process-' + i + ' start'); + arController.process(v1); + performance.mark('process-' + i + ' done'); + performance.measure('process image','process-' + i + ' start', 'process-' + i + ' done'); + } + + performance.mark('cleanup'); + arController.dispose(); + done(); + }); + }; + }; + + const error = error => { + assert.notOk(error); + testDone(); + } + + const cameraPara = new ARCameraParam(cParaUrl, success, error); + }); +}); +//TODO write test for external Video stream creation \ No newline at end of file

    >>0&((t|0)!=(-1|0)&(p|0)!=(-1|0))^1)):0){h=s?r:b;g=t;q=145}if((q|0)==145){b=(c[14399]|0)+h|0;c[14399]=b;if(b>>>0>(c[14400]|0)>>>0)c[14400]=b;j=c[14297]|0;f:do if(j){b=57612;while(1){a=c[b>>2]|0;d=c[b+4>>2]|0;if((g|0)==(a+d|0)){q=154;break}e=c[b+8>>2]|0;if(!e)break;else b=e}if(((q|0)==154?(u=b+4|0,(c[b+12>>2]&8|0)==0):0)?g>>>0>j>>>0&a>>>0<=j>>>0:0){c[u>>2]=d+h;v=(c[14294]|0)+h|0;t=j+8|0;t=(t&7|0)==0?0:0-t&7;u=j+t|0;t=v-t|0;c[14297]=u;c[14294]=t;c[u+4>>2]=t|1;c[j+v+4>>2]=40;c[14298]=c[14413];break}if(g>>>0<(c[14295]|0)>>>0)c[14295]=g;d=g+h|0;b=57612;while(1){if((c[b>>2]|0)==(d|0)){q=162;break}a=c[b+8>>2]|0;if(!a)break;else b=a}if((q|0)==162?(c[b+12>>2]&8|0)==0:0){c[b>>2]=g;l=b+4|0;c[l>>2]=(c[l>>2]|0)+h;l=g+8|0;l=g+((l&7|0)==0?0:0-l&7)|0;b=d+8|0;b=d+((b&7|0)==0?0:0-b&7)|0;k=l+m|0;i=b-l-m|0;c[l+4>>2]=m|3;g:do if((j|0)==(b|0)){v=(c[14294]|0)+i|0;c[14294]=v;c[14297]=k;c[k+4>>2]=v|1}else{if((c[14296]|0)==(b|0)){v=(c[14293]|0)+i|0;c[14293]=v;c[14296]=k;c[k+4>>2]=v|1;c[k+v>>2]=v;break}a=c[b+4>>2]|0;if((a&3|0)==1){h=a&-8;e=a>>>3;h:do if(a>>>0<256){a=c[b+8>>2]|0;d=c[b+12>>2]|0;if((d|0)==(a|0)){c[14291]=c[14291]&~(1<>2]=d;c[d+8>>2]=a;break}}else{g=c[b+24>>2]|0;a=c[b+12>>2]|0;do if((a|0)==(b|0)){d=b+16|0;e=d+4|0;a=c[e>>2]|0;if(!a){a=c[d>>2]|0;if(!a){a=0;break}}else d=e;while(1){f=a+20|0;e=c[f>>2]|0;if(!e){f=a+16|0;e=c[f>>2]|0;if(!e)break;else{a=e;d=f}}else{a=e;d=f}}c[d>>2]=0}else{v=c[b+8>>2]|0;c[v+12>>2]=a;c[a+8>>2]=v}while(0);if(!g)break;d=c[b+28>>2]|0;e=57468+(d<<2)|0;do if((c[e>>2]|0)!=(b|0)){v=g+16|0;c[((c[v>>2]|0)==(b|0)?v:g+20|0)>>2]=a;if(!a)break h}else{c[e>>2]=a;if(a|0)break;c[14292]=c[14292]&~(1<>2]=g;d=b+16|0;e=c[d>>2]|0;if(e|0){c[a+16>>2]=e;c[e+24>>2]=a}d=c[d+4>>2]|0;if(!d)break;c[a+20>>2]=d;c[d+24>>2]=a}while(0);b=b+h|0;f=h+i|0}else f=i;b=b+4|0;c[b>>2]=c[b>>2]&-2;c[k+4>>2]=f|1;c[k+f>>2]=f;b=f>>>3;if(f>>>0<256){d=57204+(b<<1<<2)|0;a=c[14291]|0;b=1<>2]|0}c[a>>2]=k;c[b+12>>2]=k;c[k+8>>2]=b;c[k+12>>2]=d;break}b=f>>>8;do if(!b)e=0;else{if(f>>>0>16777215){e=31;break}u=(b+1048320|0)>>>16&8;v=b<>>16&4;v=v<>>16&2;e=14-(t|u|e)+(v<>>15)|0;e=f>>>(e+7|0)&1|e<<1}while(0);b=57468+(e<<2)|0;c[k+28>>2]=e;a=k+16|0;c[a+4>>2]=0;c[a>>2]=0;a=c[14292]|0;d=1<>2]=k;c[k+24>>2]=b;c[k+12>>2]=k;c[k+8>>2]=k;break}b=c[b>>2]|0;i:do if((c[b+4>>2]&-8|0)!=(f|0)){e=f<<((e|0)==31?0:25-(e>>>1)|0);while(1){d=b+16+(e>>>31<<2)|0;a=c[d>>2]|0;if(!a)break;if((c[a+4>>2]&-8|0)==(f|0)){b=a;break i}else{e=e<<1;b=a}}c[d>>2]=k;c[k+24>>2]=b;c[k+12>>2]=k;c[k+8>>2]=k;break g}while(0);u=b+8|0;v=c[u>>2]|0;c[v+12>>2]=k;c[u>>2]=k;c[k+8>>2]=v;c[k+12>>2]=b;c[k+24>>2]=0}while(0);v=l+8|0;yb=w;return v|0}b=57612;while(1){a=c[b>>2]|0;if(a>>>0<=j>>>0?(v=a+(c[b+4>>2]|0)|0,v>>>0>j>>>0):0)break;b=c[b+8>>2]|0}f=v+-47|0;a=f+8|0;a=f+((a&7|0)==0?0:0-a&7)|0;f=j+16|0;a=a>>>0>>0?j:a;b=a+8|0;d=h+-40|0;t=g+8|0;t=(t&7|0)==0?0:0-t&7;u=g+t|0;t=d-t|0;c[14297]=u;c[14294]=t;c[u+4>>2]=t|1;c[g+d+4>>2]=40;c[14298]=c[14413];d=a+4|0;c[d>>2]=27;c[b>>2]=c[14403];c[b+4>>2]=c[14404];c[b+8>>2]=c[14405];c[b+12>>2]=c[14406];c[14403]=g;c[14404]=h;c[14406]=0;c[14405]=b;b=a+24|0;do{u=b;b=b+4|0;c[b>>2]=7}while((u+8|0)>>>0>>0);if((a|0)!=(j|0)){g=a-j|0;c[d>>2]=c[d>>2]&-2;c[j+4>>2]=g|1;c[a>>2]=g;b=g>>>3;if(g>>>0<256){d=57204+(b<<1<<2)|0;a=c[14291]|0;b=1<>2]|0}c[a>>2]=j;c[b+12>>2]=j;c[j+8>>2]=b;c[j+12>>2]=d;break}b=g>>>8;if(b)if(g>>>0>16777215)e=31;else{u=(b+1048320|0)>>>16&8;v=b<>>16&4;v=v<>>16&2;e=14-(t|u|e)+(v<>>15)|0;e=g>>>(e+7|0)&1|e<<1}else e=0;d=57468+(e<<2)|0;c[j+28>>2]=e;c[j+20>>2]=0;c[f>>2]=0;b=c[14292]|0;a=1<>2]=j;c[j+24>>2]=d;c[j+12>>2]=j;c[j+8>>2]=j;break}b=c[d>>2]|0;j:do if((c[b+4>>2]&-8|0)!=(g|0)){e=g<<((e|0)==31?0:25-(e>>>1)|0);while(1){d=b+16+(e>>>31<<2)|0;a=c[d>>2]|0;if(!a)break;if((c[a+4>>2]&-8|0)==(g|0)){b=a;break j}else{e=e<<1;b=a}}c[d>>2]=j;c[j+24>>2]=b;c[j+12>>2]=j;c[j+8>>2]=j;break f}while(0);u=b+8|0;v=c[u>>2]|0;c[v+12>>2]=j;c[u>>2]=j;c[j+8>>2]=v;c[j+12>>2]=b;c[j+24>>2]=0}}else{v=c[14295]|0;if((v|0)==0|g>>>0>>0)c[14295]=g;c[14403]=g;c[14404]=h;c[14406]=0;c[14300]=c[14409];c[14299]=-1;c[14304]=57204;c[14303]=57204;c[14306]=57212;c[14305]=57212;c[14308]=57220;c[14307]=57220;c[14310]=57228;c[14309]=57228;c[14312]=57236;c[14311]=57236;c[14314]=57244;c[14313]=57244;c[14316]=57252;c[14315]=57252;c[14318]=57260;c[14317]=57260;c[14320]=57268;c[14319]=57268;c[14322]=57276;c[14321]=57276;c[14324]=57284;c[14323]=57284;c[14326]=57292;c[14325]=57292;c[14328]=57300;c[14327]=57300;c[14330]=57308;c[14329]=57308;c[14332]=57316;c[14331]=57316;c[14334]=57324;c[14333]=57324;c[14336]=57332;c[14335]=57332;c[14338]=57340;c[14337]=57340;c[14340]=57348;c[14339]=57348;c[14342]=57356;c[14341]=57356;c[14344]=57364;c[14343]=57364;c[14346]=57372;c[14345]=57372;c[14348]=57380;c[14347]=57380;c[14350]=57388;c[14349]=57388;c[14352]=57396;c[14351]=57396;c[14354]=57404;c[14353]=57404;c[14356]=57412;c[14355]=57412;c[14358]=57420;c[14357]=57420;c[14360]=57428;c[14359]=57428;c[14362]=57436;c[14361]=57436;c[14364]=57444;c[14363]=57444;c[14366]=57452;c[14365]=57452;v=h+-40|0;t=g+8|0;t=(t&7|0)==0?0:0-t&7;u=g+t|0;t=v-t|0;c[14297]=u;c[14294]=t;c[u+4>>2]=t|1;c[g+v+4>>2]=40;c[14298]=c[14413]}while(0);b=c[14294]|0;if(b>>>0>m>>>0){t=b-m|0;c[14294]=t;v=c[14297]|0;u=v+m|0;c[14297]=u;c[u+4>>2]=t|1;c[v+4>>2]=m|3;v=v+8|0;yb=w;return v|0}}c[(mx()|0)>>2]=48;v=0;yb=w;return v|0}function EO(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;if(!a)return;d=a+-8|0;f=c[14295]|0;a=c[a+-4>>2]|0;b=a&-8;j=d+b|0;do if(!(a&1)){e=c[d>>2]|0;if(!(a&3))return;h=d+(0-e)|0;g=e+b|0;if(h>>>0>>0)return;if((c[14296]|0)==(h|0)){a=j+4|0;b=c[a>>2]|0;if((b&3|0)!=3){i=h;b=g;break}c[14293]=g;c[a>>2]=b&-2;c[h+4>>2]=g|1;c[h+g>>2]=g;return}d=e>>>3;if(e>>>0<256){a=c[h+8>>2]|0;b=c[h+12>>2]|0;if((b|0)==(a|0)){c[14291]=c[14291]&~(1<>2]=b;c[b+8>>2]=a;i=h;b=g;break}}f=c[h+24>>2]|0;a=c[h+12>>2]|0;do if((a|0)==(h|0)){b=h+16|0;d=b+4|0;a=c[d>>2]|0;if(!a){a=c[b>>2]|0;if(!a){a=0;break}}else b=d;while(1){e=a+20|0;d=c[e>>2]|0;if(!d){e=a+16|0;d=c[e>>2]|0;if(!d)break;else{a=d;b=e}}else{a=d;b=e}}c[b>>2]=0}else{i=c[h+8>>2]|0;c[i+12>>2]=a;c[a+8>>2]=i}while(0);if(f){b=c[h+28>>2]|0;d=57468+(b<<2)|0;if((c[d>>2]|0)==(h|0)){c[d>>2]=a;if(!a){c[14292]=c[14292]&~(1<>2]|0)==(h|0)?i:f+20|0)>>2]=a;if(!a){i=h;b=g;break}}c[a+24>>2]=f;b=h+16|0;d=c[b>>2]|0;if(d|0){c[a+16>>2]=d;c[d+24>>2]=a}b=c[b+4>>2]|0;if(b){c[a+20>>2]=b;c[b+24>>2]=a;i=h;b=g}else{i=h;b=g}}else{i=h;b=g}}else{i=d;h=d}while(0);if(h>>>0>=j>>>0)return;a=j+4|0;e=c[a>>2]|0;if(!(e&1))return;if(!(e&2)){if((c[14297]|0)==(j|0)){j=(c[14294]|0)+b|0;c[14294]=j;c[14297]=i;c[i+4>>2]=j|1;if((i|0)!=(c[14296]|0))return;c[14296]=0;c[14293]=0;return}if((c[14296]|0)==(j|0)){j=(c[14293]|0)+b|0;c[14293]=j;c[14296]=h;c[i+4>>2]=j|1;c[h+j>>2]=j;return}f=(e&-8)+b|0;d=e>>>3;do if(e>>>0<256){b=c[j+8>>2]|0;a=c[j+12>>2]|0;if((a|0)==(b|0)){c[14291]=c[14291]&~(1<>2]=a;c[a+8>>2]=b;break}}else{g=c[j+24>>2]|0;a=c[j+12>>2]|0;do if((a|0)==(j|0)){b=j+16|0;d=b+4|0;a=c[d>>2]|0;if(!a){a=c[b>>2]|0;if(!a){d=0;break}}else b=d;while(1){e=a+20|0;d=c[e>>2]|0;if(!d){e=a+16|0;d=c[e>>2]|0;if(!d)break;else{a=d;b=e}}else{a=d;b=e}}c[b>>2]=0;d=a}else{d=c[j+8>>2]|0;c[d+12>>2]=a;c[a+8>>2]=d;d=a}while(0);if(g|0){a=c[j+28>>2]|0;b=57468+(a<<2)|0;if((c[b>>2]|0)==(j|0)){c[b>>2]=d;if(!d){c[14292]=c[14292]&~(1<>2]|0)==(j|0)?e:g+20|0)>>2]=d;if(!d)break}c[d+24>>2]=g;a=j+16|0;b=c[a>>2]|0;if(b|0){c[d+16>>2]=b;c[b+24>>2]=d}a=c[a+4>>2]|0;if(a|0){c[d+20>>2]=a;c[a+24>>2]=d}}}while(0);c[i+4>>2]=f|1;c[h+f>>2]=f;if((i|0)==(c[14296]|0)){c[14293]=f;return}}else{c[a>>2]=e&-2;c[i+4>>2]=b|1;c[h+b>>2]=b;f=b}a=f>>>3;if(f>>>0<256){d=57204+(a<<1<<2)|0;b=c[14291]|0;a=1<>2]|0}c[b>>2]=i;c[a+12>>2]=i;c[i+8>>2]=a;c[i+12>>2]=d;return}a=f>>>8;if(a)if(f>>>0>16777215)e=31;else{h=(a+1048320|0)>>>16&8;j=a<>>16&4;j=j<>>16&2;e=14-(g|h|e)+(j<>>15)|0;e=f>>>(e+7|0)&1|e<<1}else e=0;a=57468+(e<<2)|0;c[i+28>>2]=e;c[i+20>>2]=0;c[i+16>>2]=0;b=c[14292]|0;d=1<>2]=i;c[i+24>>2]=a;c[i+12>>2]=i;c[i+8>>2]=i}else{a=c[a>>2]|0;b:do if((c[a+4>>2]&-8|0)!=(f|0)){e=f<<((e|0)==31?0:25-(e>>>1)|0);while(1){d=a+16+(e>>>31<<2)|0;b=c[d>>2]|0;if(!b)break;if((c[b+4>>2]&-8|0)==(f|0)){a=b;break b}else{e=e<<1;a=b}}c[d>>2]=i;c[i+24>>2]=a;c[i+12>>2]=i;c[i+8>>2]=i;break a}while(0);h=a+8|0;j=c[h>>2]|0;c[j+12>>2]=i;c[h>>2]=i;c[i+8>>2]=j;c[i+12>>2]=a;c[i+24>>2]=0}while(0);j=(c[14299]|0)+-1|0;c[14299]=j;if(j|0)return;a=57620;while(1){a=c[a>>2]|0;if(!a)break;else a=a+8|0}c[14299]=-1;return}function FO(a,b){a=a|0;b=b|0;var d=0;if(a){d=B(b,a)|0;if((b|a)>>>0>65535)d=((d>>>0)/(a>>>0)|0|0)==(b|0)?d:-1}else d=0;a=DO(d)|0;if(!a)return a|0;if(!(c[a+-4>>2]&3))return a|0;_O(a|0,0,d|0)|0;return a|0}function GO(a,b){a=a|0;b=b|0;var d=0,e=0;if(!a){b=DO(b)|0;return b|0}if(b>>>0>4294967231){c[(mx()|0)>>2]=48;b=0;return b|0}d=HO(a+-8|0,b>>>0<11?16:b+11&-8)|0;if(d|0){b=d+8|0;return b|0}d=DO(b)|0;if(!d){b=0;return b|0}e=c[a+-4>>2]|0;e=(e&-8)-((e&3|0)==0?8:4)|0;YO(d|0,a|0,(e>>>0>>0?e:b)|0)|0;EO(a);b=d;return b|0}function HO(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;l=a+4|0;m=c[l>>2]|0;d=m&-8;i=a+d|0;if(!(m&3)){if(b>>>0<256){a=0;return a|0}if(d>>>0>=(b+4|0)>>>0?(d-b|0)>>>0<=c[14411]<<1>>>0:0)return a|0;a=0;return a|0}if(d>>>0>=b>>>0){d=d-b|0;if(d>>>0<=15)return a|0;k=a+b|0;c[l>>2]=m&1|b|2;c[k+4>>2]=d|3;m=i+4|0;c[m>>2]=c[m>>2]|1;IO(k,d);return a|0}if((c[14297]|0)==(i|0)){k=(c[14294]|0)+d|0;d=k-b|0;e=a+b|0;if(k>>>0<=b>>>0){a=0;return a|0}c[l>>2]=m&1|b|2;c[e+4>>2]=d|1;c[14297]=e;c[14294]=d;return a|0}if((c[14296]|0)==(i|0)){e=(c[14293]|0)+d|0;if(e>>>0>>0){a=0;return a|0}d=e-b|0;if(d>>>0>15){k=a+b|0;e=a+e|0;c[l>>2]=m&1|b|2;c[k+4>>2]=d|1;c[e>>2]=d;e=e+4|0;c[e>>2]=c[e>>2]&-2;e=k}else{c[l>>2]=m&1|e|2;e=a+e+4|0;c[e>>2]=c[e>>2]|1;e=0;d=0}c[14293]=d;c[14296]=e;return a|0}e=c[i+4>>2]|0;if(e&2|0){a=0;return a|0}j=(e&-8)+d|0;if(j>>>0>>0){a=0;return a|0}k=j-b|0;f=e>>>3;do if(e>>>0<256){e=c[i+8>>2]|0;d=c[i+12>>2]|0;if((d|0)==(e|0)){c[14291]=c[14291]&~(1<>2]=d;c[d+8>>2]=e;break}}else{h=c[i+24>>2]|0;d=c[i+12>>2]|0;do if((d|0)==(i|0)){e=i+16|0;f=e+4|0;d=c[f>>2]|0;if(!d){d=c[e>>2]|0;if(!d){f=0;break}}else e=f;while(1){g=d+20|0;f=c[g>>2]|0;if(!f){g=d+16|0;f=c[g>>2]|0;if(!f)break;else{d=f;e=g}}else{d=f;e=g}}c[e>>2]=0;f=d}else{f=c[i+8>>2]|0;c[f+12>>2]=d;c[d+8>>2]=f;f=d}while(0);if(h|0){d=c[i+28>>2]|0;e=57468+(d<<2)|0;if((c[e>>2]|0)==(i|0)){c[e>>2]=f;if(!f){c[14292]=c[14292]&~(1<>2]|0)==(i|0)?g:h+20|0)>>2]=f;if(!f)break}c[f+24>>2]=h;d=i+16|0;e=c[d>>2]|0;if(e|0){c[f+16>>2]=e;c[e+24>>2]=f}d=c[d+4>>2]|0;if(d|0){c[f+20>>2]=d;c[d+24>>2]=f}}}while(0);if(k>>>0<16){c[l>>2]=m&1|j|2;m=a+j+4|0;c[m>>2]=c[m>>2]|1;return a|0}else{i=a+b|0;c[l>>2]=m&1|b|2;c[i+4>>2]=k|3;m=a+j+4|0;c[m>>2]=c[m>>2]|1;IO(i,k);return a|0}return 0}function IO(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=a+b|0;d=c[a+4>>2]|0;do if(!(d&1)){f=c[a>>2]|0;if(!(d&3))return;h=a+(0-f)|0;b=f+b|0;if((c[14296]|0)==(h|0)){a=i+4|0;d=c[a>>2]|0;if((d&3|0)!=3)break;c[14293]=b;c[a>>2]=d&-2;c[h+4>>2]=b|1;c[i>>2]=b;return}e=f>>>3;if(f>>>0<256){a=c[h+8>>2]|0;d=c[h+12>>2]|0;if((d|0)==(a|0)){c[14291]=c[14291]&~(1<>2]=d;c[d+8>>2]=a;break}}g=c[h+24>>2]|0;a=c[h+12>>2]|0;do if((a|0)==(h|0)){d=h+16|0;e=d+4|0;a=c[e>>2]|0;if(!a){a=c[d>>2]|0;if(!a){a=0;break}}else d=e;while(1){f=a+20|0;e=c[f>>2]|0;if(!e){f=a+16|0;e=c[f>>2]|0;if(!e)break;else{a=e;d=f}}else{a=e;d=f}}c[d>>2]=0}else{f=c[h+8>>2]|0;c[f+12>>2]=a;c[a+8>>2]=f}while(0);if(g){d=c[h+28>>2]|0;e=57468+(d<<2)|0;if((c[e>>2]|0)==(h|0)){c[e>>2]=a;if(!a){c[14292]=c[14292]&~(1<>2]|0)==(h|0)?f:g+20|0)>>2]=a;if(!a)break}c[a+24>>2]=g;d=h+16|0;e=c[d>>2]|0;if(e|0){c[a+16>>2]=e;c[e+24>>2]=a}d=c[d+4>>2]|0;if(d){c[a+20>>2]=d;c[d+24>>2]=a}}}else h=a;while(0);a=i+4|0;e=c[a>>2]|0;if(!(e&2)){if((c[14297]|0)==(i|0)){i=(c[14294]|0)+b|0;c[14294]=i;c[14297]=h;c[h+4>>2]=i|1;if((h|0)!=(c[14296]|0))return;c[14296]=0;c[14293]=0;return}if((c[14296]|0)==(i|0)){i=(c[14293]|0)+b|0;c[14293]=i;c[14296]=h;c[h+4>>2]=i|1;c[h+i>>2]=i;return}f=(e&-8)+b|0;d=e>>>3;do if(e>>>0<256){a=c[i+8>>2]|0;b=c[i+12>>2]|0;if((b|0)==(a|0)){c[14291]=c[14291]&~(1<>2]=b;c[b+8>>2]=a;break}}else{g=c[i+24>>2]|0;b=c[i+12>>2]|0;do if((b|0)==(i|0)){a=i+16|0;d=a+4|0;b=c[d>>2]|0;if(!b){b=c[a>>2]|0;if(!b){d=0;break}}else a=d;while(1){e=b+20|0;d=c[e>>2]|0;if(!d){e=b+16|0;d=c[e>>2]|0;if(!d)break;else{b=d;a=e}}else{b=d;a=e}}c[a>>2]=0;d=b}else{d=c[i+8>>2]|0;c[d+12>>2]=b;c[b+8>>2]=d;d=b}while(0);if(g|0){b=c[i+28>>2]|0;a=57468+(b<<2)|0;if((c[a>>2]|0)==(i|0)){c[a>>2]=d;if(!d){c[14292]=c[14292]&~(1<>2]|0)==(i|0)?e:g+20|0)>>2]=d;if(!d)break}c[d+24>>2]=g;b=i+16|0;a=c[b>>2]|0;if(a|0){c[d+16>>2]=a;c[a+24>>2]=d}b=c[b+4>>2]|0;if(b|0){c[d+20>>2]=b;c[b+24>>2]=d}}}while(0);c[h+4>>2]=f|1;c[h+f>>2]=f;if((h|0)==(c[14296]|0)){c[14293]=f;return}}else{c[a>>2]=e&-2;c[h+4>>2]=b|1;c[h+b>>2]=b;f=b}b=f>>>3;if(f>>>0<256){d=57204+(b<<1<<2)|0;a=c[14291]|0;b=1<>2]|0}c[a>>2]=h;c[b+12>>2]=h;c[h+8>>2]=b;c[h+12>>2]=d;return}b=f>>>8;if(b)if(f>>>0>16777215)e=31;else{g=(b+1048320|0)>>>16&8;i=b<>>16&4;i=i<>>16&2;e=14-(d|g|e)+(i<>>15)|0;e=f>>>(e+7|0)&1|e<<1}else e=0;b=57468+(e<<2)|0;c[h+28>>2]=e;c[h+20>>2]=0;c[h+16>>2]=0;a=c[14292]|0;d=1<>2]=h;c[h+24>>2]=b;c[h+12>>2]=h;c[h+8>>2]=h;return}b=c[b>>2]|0;a:do if((c[b+4>>2]&-8|0)!=(f|0)){e=f<<((e|0)==31?0:25-(e>>>1)|0);while(1){d=b+16+(e>>>31<<2)|0;a=c[d>>2]|0;if(!a)break;if((c[a+4>>2]&-8|0)==(f|0)){b=a;break a}else{e=e<<1;b=a}}c[d>>2]=h;c[h+24>>2]=b;c[h+12>>2]=h;c[h+8>>2]=h;return}while(0);g=b+8|0;i=c[g>>2]|0;c[i+12>>2]=h;c[g>>2]=h;c[h+8>>2]=i;c[h+12>>2]=b;c[h+24>>2]=0;return}function JO(a){a=a|0;var b=0,d=0;b=TO()|0;d=c[b>>2]|0;a=d+a|0;if((a|0)<0){c[(mx()|0)>>2]=48;d=-1;return d|0}if(a>>>0>(Ba()|0)>>>0?(Da(a|0)|0)==0:0){c[(mx()|0)>>2]=48;d=-1;return d|0}c[b>>2]=a;return d|0}function KO(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;f=a&65535;e=b&65535;c=B(e,f)|0;d=a>>>16;a=(c>>>16)+(B(e,d)|0)|0;e=b>>>16;b=B(e,f)|0;return (E((a>>>16)+(B(e,d)|0)+(((a&65535)+b|0)>>>16)|0),a+b<<16|c&65535|0)|0}function LO(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;f=c;c=KO(e,f)|0;a=F()|0;return (E((B(b,f)|0)+(B(d,e)|0)+a|a&0|0),c|0|0)|0}function MO(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=a+c>>>0;return (E(b+d+(c>>>0>>0|0)>>>0|0),c|0)|0}function NO(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;d=b-d-(c>>>0>a>>>0|0)>>>0;return (E(d|0),a-c>>>0|0)|0}function OO(a){a=a|0;return (a?31-(C(a^a-1)|0)|0:32)|0}function PO(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;l=a;j=b;k=j;h=d;n=e;i=n;if(!k){g=(f|0)!=0;if(!i){if(g){c[f>>2]=(l>>>0)%(h>>>0);c[f+4>>2]=0}n=0;f=(l>>>0)/(h>>>0)>>>0;return (E(n|0),f)|0}else{if(!g){n=0;f=0;return (E(n|0),f)|0}c[f>>2]=a|0;c[f+4>>2]=b&0;n=0;f=0;return (E(n|0),f)|0}}g=(i|0)==0;do if(h){if(!g){g=(C(i|0)|0)-(C(k|0)|0)|0;if(g>>>0<=31){m=g+1|0;i=31-g|0;b=g-31>>31;h=m;a=l>>>(m>>>0)&b|k<>>(m>>>0)&b;g=0;i=l<>2]=a|0;c[f+4>>2]=j|b&0;n=0;f=0;return (E(n|0),f)|0}g=h-1|0;if(g&h|0){i=(C(h|0)|0)+33-(C(k|0)|0)|0;p=64-i|0;m=32-i|0;j=m>>31;o=i-32|0;b=o>>31;h=i;a=m-1>>31&k>>>(o>>>0)|(k<>>(i>>>0))&b;b=b&k>>>(i>>>0);g=l<>>(o>>>0))&j|l<>31;break}if(f|0){c[f>>2]=g&l;c[f+4>>2]=0}if((h|0)==1){o=j|b&0;p=a|0|0;return (E(o|0),p)|0}else{p=OO(h|0)|0;o=k>>>(p>>>0)|0;p=k<<32-p|l>>>(p>>>0)|0;return (E(o|0),p)|0}}else{if(g){if(f|0){c[f>>2]=(k>>>0)%(h>>>0);c[f+4>>2]=0}o=0;p=(k>>>0)/(h>>>0)>>>0;return (E(o|0),p)|0}if(!l){if(f|0){c[f>>2]=0;c[f+4>>2]=(k>>>0)%(i>>>0)}o=0;p=(k>>>0)/(i>>>0)>>>0;return (E(o|0),p)|0}g=i-1|0;if(!(g&i)){if(f|0){c[f>>2]=a|0;c[f+4>>2]=g&k|b&0}o=0;p=k>>>((OO(i|0)|0)>>>0);return (E(o|0),p)|0}g=(C(i|0)|0)-(C(k|0)|0)|0;if(g>>>0<=30){b=g+1|0;i=31-g|0;h=b;a=k<>>(b>>>0);b=k>>>(b>>>0);g=0;i=l<>2]=a|0;c[f+4>>2]=j|b&0;o=0;p=0;return (E(o|0),p)|0}while(0);if(!h){k=i;j=0;i=0}else{m=d|0|0;l=n|e&0;k=MO(m|0,l|0,-1,-1)|0;d=F()|0;j=i;i=0;do{e=j;j=g>>>31|j<<1;g=i|g<<1;e=a<<1|e>>>31|0;n=a>>>31|b<<1|0;NO(k|0,d|0,e|0,n|0)|0;p=F()|0;o=p>>31|((p|0)<0?-1:0)<<1;i=o&1;a=NO(e|0,n|0,o&m|0,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&l|0)|0;b=F()|0;h=h-1|0}while((h|0)!=0);k=j;j=0}h=0;if(f|0){c[f>>2]=a;c[f+4>>2]=b}o=(g|0)>>>31|(k|h)<<1|(h<<1|g>>>31)&0|j;p=(g<<1|0>>>31)&-2|i;return (E(o|0),p)|0}function QO(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return PO(a,b,c,d,0)|0}function RO(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){E(b>>>c|0);return a>>>c|(b&(1<>>c-32|0}function SO(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){E(b<>>32-c|0);return a<>8&255)<<16|(a>>16&255)<<8|a>>>24|0}function VO(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;k=k+1|0;c[a>>2]=k;while((f|0)<(e|0)){if(!(c[d+(f<<3)>>2]|0)){c[d+(f<<3)>>2]=k;c[d+((f<<3)+4)>>2]=b;c[d+((f<<3)+8)>>2]=0;E(e|0);return d|0}f=f+1|0}e=e*2|0;d=GO(d|0,8*(e+1|0)|0)|0;d=VO(a|0,b|0,d|0,e|0)|0;E(e|0);return d|0}function WO(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;while((f|0)<(d|0)){e=c[b+(f<<3)>>2]|0;if(!e)break;if((e|0)==(a|0))return c[b+((f<<3)+4)>>2]|0;f=f+1|0}return 0}function XO(a,b){a=a|0;b=b|0;if(!i){i=a;j=b}}function YO(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if((e|0)>=8192){Ca(b|0,d|0,e|0)|0;return b|0}h=b|0;g=b+e|0;if((b&3)==(d&3)){while(b&3){if(!e)return h|0;a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0}e=g&-4|0;f=e-64|0;while((b|0)<=(f|0)){c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];c[b+16>>2]=c[d+16>>2];c[b+20>>2]=c[d+20>>2];c[b+24>>2]=c[d+24>>2];c[b+28>>2]=c[d+28>>2];c[b+32>>2]=c[d+32>>2];c[b+36>>2]=c[d+36>>2];c[b+40>>2]=c[d+40>>2];c[b+44>>2]=c[d+44>>2];c[b+48>>2]=c[d+48>>2];c[b+52>>2]=c[d+52>>2];c[b+56>>2]=c[d+56>>2];c[b+60>>2]=c[d+60>>2];b=b+64|0;d=d+64|0}while((b|0)<(e|0)){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0}}else{e=g-4|0;while((b|0)<(e|0)){a[b>>0]=a[d>>0]|0;a[b+1>>0]=a[d+1>>0]|0;a[b+2>>0]=a[d+2>>0]|0;a[b+3>>0]=a[d+3>>0]|0;b=b+4|0;d=d+4|0}}while((b|0)<(g|0)){a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0}return h|0}function ZO(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>>0]=a[c>>0]|0}b=e}else YO(b,c,d)|0;return b|0}function _O(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=b+e|0;d=d&255;if((e|0)>=67){while(b&3){a[b>>0]=d;b=b+1|0}f=h&-4|0;i=d|d<<8|d<<16|d<<24;g=f-64|0;while((b|0)<=(g|0)){c[b>>2]=i;c[b+4>>2]=i;c[b+8>>2]=i;c[b+12>>2]=i;c[b+16>>2]=i;c[b+20>>2]=i;c[b+24>>2]=i;c[b+28>>2]=i;c[b+32>>2]=i;c[b+36>>2]=i;c[b+40>>2]=i;c[b+44>>2]=i;c[b+48>>2]=i;c[b+52>>2]=i;c[b+56>>2]=i;c[b+60>>2]=i;b=b+64|0}while((b|0)<(f|0)){c[b>>2]=i;b=b+4|0}}while((b|0)<(h|0)){a[b>>0]=d;b=b+1|0}return h-e|0}function $O(a){a=+a;return a>=0.0?+s(a+.5):+A(a-.5)}function aP(a,b){a=a|0;b=b|0;return +Bb[a&3](b|0)}function bP(a,b,c){a=a|0;b=b|0;c=c|0;return +Cb[a&1](b|0,c|0)}function cP(a){a=a|0;return Db[a&1]()|0}function dP(a,b){a=a|0;b=b|0;return Eb[a&127](b|0)|0}function eP(a,b,c,d,e,f,g){a=a|0;b=b|0;c=+c;d=d|0;e=e|0;f=f|0;g=g|0;return Fb[a&1](b|0,+c,d|0,e|0,f|0,g|0)|0}function fP(a,b,c){a=a|0;b=b|0;c=c|0;return Gb[a&63](b|0,c|0)|0}function gP(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Hb[a&63](b|0,c|0,d|0)|0}function hP(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return Ib[a&15](b|0,c|0,d|0,e|0)|0}function iP(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=+f;return Jb[a&7](b|0,c|0,d|0,e|0,+f)|0}function jP(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 Kb[a&31](b|0,c|0,d|0,e|0,f|0)|0}function kP(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;return Lb[a&3](b|0,c|0,d|0,e|0,f|0,+g)|0}function lP(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;return Mb[a&63](b|0,c|0,d|0,e|0,f|0,g|0)|0}function mP(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;return Nb[a&7](b|0,c|0,d|0,e|0,f|0,g|0,h|0)|0}function nP(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 Ob[a&15](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0)|0}function oP(a){a=a|0;Pb[a&1]()}function pP(a,b){a=a|0;b=b|0;Qb[a&255](b|0)}function qP(a,b,c){a=a|0;b=b|0;c=+c;Rb[a&3](b|0,+c)}function rP(a,b,c){a=a|0;b=b|0;c=c|0;Sb[a&63](b|0,c|0)}function sP(a,b,c,d){a=a|0;b=b|0;c=c|0;d=+d;Tb[a&3](b|0,c|0,+d)}function tP(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Ub[a&3](b|0,c|0,d|0)}function uP(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;Vb[a&31](b|0,c|0,d|0,e|0)}function vP(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;Wb[a&63](b|0,c|0,d|0,e|0,f|0)}function wP(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;Xb[a&7](b|0,c|0,d|0,e|0,f|0,g|0)}function xP(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;Yb[a&7](b|0,c|0,d|0,e|0,f|0,g|0,h|0)}function yP(a){a=a|0;D(0);return 0.0}function zP(a,b){a=a|0;b=b|0;D(1);return 0.0}function AP(){D(2);return 0}function BP(a){a=a|0;D(3);return 0}function CP(a,b,c,d,e,f){a=a|0;b=+b;c=c|0;d=d|0;e=e|0;f=f|0;D(4);return 0}function DP(a,b){a=a|0;b=b|0;D(5);return 0}function EP(a,b,c){a=a|0;b=b|0;c=c|0;D(6);return 0}function FP(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;D(7);return 0}function GP(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;D(8);return 0}function HP(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;D(9);return 0}function IP(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=+f;D(10);return 0}function JP(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;D(11);return 0}function KP(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;D(12);return 0}function LP(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;D(13);return 0}function MP(){D(14)}function NP(a){a=a|0;D(15)}function OP(a,b){a=a|0;b=+b;D(16)}function PP(a,b){a=a|0;b=b|0;D(17)}function QP(a,b,c){a=a|0;b=b|0;c=+c;D(18)}function RP(a,b,c){a=a|0;b=b|0;c=c|0;D(19)}function SP(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;D(20)}function TP(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;D(21)}function UP(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;D(22)}function VP(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;D(23)} + +// EMSCRIPTEN_END_FUNCS +var Bb=[yP,nr,qr,Ar];var Cb=[zP,qs];var Db=[AP,jr];var Eb=[BP,nj,ix,px,YA,LD,MD,OD,PD,_D,$D,bE,cE,_E,eF,jF,kF,pF,qF,LH,SH,TH,UH,VH,WH,XH,YH,tI,AI,BI,CI,DI,EI,FI,GI,oJ,pJ,uJ,zJ,AJ,FJ,KJ,LJ,QJ,VJ,WJ,$J,XK,YK,_K,nL,oL,qL,VL,WL,aM,bM,gL,hL,jL,wL,xL,zL,cx,Kt,DO,bx,Iq,Kq,Rq,Sq,_q,$q,ar,fr,gr,tr,vr,xr,Cr,Er,Gr,Bs,gu,iu,kw,rw,sw,tw,uw,Uw,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP,BP];var Fb=[CP,Jx];var Gb=[DP,Zl,gq,nq,QD,SD,dE,fE,aF,gF,lF,rF,IL,KL,ML,lM,nM,pM,Je,$w,Lq,Nq,Oq,Pq,Vq,Yq,Zq,cr,dr,er,lt,Ms,Ht,hu,ju,ku,ou,pu,qu,ru,tu,uu,zu,Au,Bu,Cu,Du,mw,DP,DP,DP,DP,DP,DP,DP,DP,DP,DP,DP,DP,DP,DP,DP,DP];var Hb=[EP,jx,ox,dy,DA,dB,ID,ND,RD,XD,aE,eE,$E,fF,yF,FF,LK,QK,JL,LL,OL,hM,mM,oM,rM,gw,Gq,Uq,Wq,Xq,br,ft,Ws,Cw,Dw,Cz,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP,EP];var Ib=[FP,kx,qx,NL,iM,jM,kM,qM,ut,Ew,Fw,FP,FP,FP,FP,FP];var Jb=[GP,mH,nH,DH,EH,GP,GP,GP];var Kb=[HP,wF,DF,hH,iH,kH,oH,yH,zH,BH,FH,WK,ZK,mL,pL,PL,sM,fL,iL,vL,yL,Jw,Kw,HP,HP,HP,HP,HP,HP,HP,HP,HP];var Lb=[IP,zK,FK,IP];var Mb=[JP,KF,LF,MF,NF,OF,PF,QF,RF,SF,TF,UF,GG,HG,IG,JG,KG,LG,MG,NG,OG,PG,QG,jH,lH,AH,CH,MH,NH,OH,PH,QH,uI,vI,wI,xI,yI,AK,GK,Gw,Hw,JP,JP,JP,JP,JP,JP,JP,JP,JP,JP,JP,JP,JP,JP,JP,JP,JP,JP,JP,JP,JP,JP,JP];var Nb=[KP,cJ,iJ,eK,fK,pK,qK,KP];var Ob=[LP,RH,zI,UK,VK,kL,lL,dL,eL,tL,uL,LP,LP,LP,LP,LP];var Pb=[MP,uA];var Qb=[NP,Oi,Pi,Ri,Si,lj,mj,XN,Xl,Yl,_l,eq,fq,hq,lq,mq,oq,zA,AA,BA,CA,MA,WA,XA,bB,cB,eB,BD,DD,FD,GD,UD,VD,kE,lE,mE,nE,pE,qE,rE,sE,uE,vE,wE,xE,zE,AE,BE,CE,YE,cF,hF,nF,tF,uF,vF,BF,CF,IF,JF,EG,FG,fH,gH,wH,xH,JH,KH,rI,sI,aJ,bJ,gJ,hJ,mJ,nJ,xJ,yJ,IJ,JJ,TJ,UJ,cK,dK,nK,oK,xK,yK,DK,EK,JK,KK,OK,PK,AF,cL,TK,rL,sL,DL,EL,GL,HL,TL,UL,_L,$L,fM,gM,tM,uM,vM,ff,Yw,hr,Mt,Nt,Yv,Zv,Ov,Iv,yv,qv,Fu,xu,yu,mu,nu,du,eu,Rv,Uv,jw,nw,qw,Iw,Mw,Vw,Ww,Xw,dx,fx,hx,aG,cG,gK,EO,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP,NP];var Rb=[OP,lr,pr,yr];var Sb=[PP,HD,WD,ZE,dF,iF,oF,qJ,rJ,sJ,tJ,vJ,wJ,BJ,CJ,DJ,EJ,GJ,HJ,MJ,NJ,OJ,PJ,RJ,SJ,XJ,YJ,ZJ,_J,aK,bK,NK,SK,XL,YL,ZL,cM,dM,eM,iw,rr,ur,wr,Br,Dr,Fr,Gs,Xv,Nv,mv,$t,lw,Lw,ex,gx,Kx,PP,PP,PP,PP,PP,PP,PP,PP];var Tb=[QP,vs,es,QP];var Ub=[RP,Sw,ls,RP];var Vb=[SP,GA,PA,hB,KD,ZD,xF,EF,Se,Kv,Mv,sv,tv,uv,vv,wv,au,bu,cu,Qv,Sv,Tv,$v,aw,bw,cw,dw,SP,SP,SP,SP,SP];var Wb=[TP,FA,OA,gB,zv,Av,Bv,Cv,Dv,Ev,Fv,Gv,Hv,kv,jv,iv,hv,gv,fv,ev,dv,cv,bv,av,$u,_u,Zu,Yu,Xu,Wu,Vu,Uu,Tu,Su,Ru,Qu,Pu,Ou,Nu,Mu,Lu,Ku,Ju,Iu,lv,Hu,Gu,TP,TP,TP,TP,TP,TP,TP,TP,TP,TP,TP,TP,TP,TP,TP,TP,TP];var Xb=[UP,EA,NA,fB,JD,YD,MK,RK];var Yb=[VP,Jv,Lv,rv,nv,ov,pv,VP];return{__GLOBAL__I_000101:QE,__GLOBAL__sub_I_ARToolKitJS_cpp:Bq,__GLOBAL__sub_I_bind_cpp:CB,__GLOBAL__sub_I_iostream_cpp:RE,__ZSt18uncaught_exceptionv:wD,___cxa_can_catch:uB,___cxa_is_pointer_type:vB,___embind_register_native_and_builtin_types:FB,___emscripten_environ_constructor:xB,___errno_location:mx,___getTypeName:rD,___muldi3:LO,___udivdi3:QO,__get_daylight:zB,__get_environ:BB,__get_timezone:AB,__get_tzname:yB,_bitshift64Lshr:RO,_bitshift64Shl:SO,_emscripten_get_sbrk_ptr:TO,_free:EO,_i64Add:MO,_i64Subtract:NO,_llvm_bswap_i32:UO,_malloc:DO,_memcpy:YO,_memmove:ZO,_memset:_O,_realloc:GO,_roundf:$O,_saveSetjmp:VO,_setThrew:XO,_testSetjmp:WO,dynCall_di:aP,dynCall_dii:bP,dynCall_i:cP,dynCall_ii:dP,dynCall_iidiiii:eP,dynCall_iii:fP,dynCall_iiii:gP,dynCall_iiiii:hP,dynCall_iiiiid:iP,dynCall_iiiiii:jP,dynCall_iiiiiid:kP,dynCall_iiiiiii:lP,dynCall_iiiiiiii:mP,dynCall_iiiiiiiii:nP,dynCall_v:oP,dynCall_vi:pP,dynCall_vid:qP,dynCall_vii:rP,dynCall_viid:sP,dynCall_viii:tP,dynCall_viiii:uP,dynCall_viiiii:vP,dynCall_viiiiii:wP,dynCall_viiiiiii:xP,establishStackSpace:ac,stackAlloc:Zb,stackRestore:$b,stackSave:_b}}) + + +// EMSCRIPTEN_END_ASM +(asmGlobalArg,asmLibraryArg,buffer);var __GLOBAL__I_000101=Module["__GLOBAL__I_000101"]=asm["__GLOBAL__I_000101"];var __GLOBAL__sub_I_ARToolKitJS_cpp=Module["__GLOBAL__sub_I_ARToolKitJS_cpp"]=asm["__GLOBAL__sub_I_ARToolKitJS_cpp"];var __GLOBAL__sub_I_bind_cpp=Module["__GLOBAL__sub_I_bind_cpp"]=asm["__GLOBAL__sub_I_bind_cpp"];var __GLOBAL__sub_I_iostream_cpp=Module["__GLOBAL__sub_I_iostream_cpp"]=asm["__GLOBAL__sub_I_iostream_cpp"];var __ZSt18uncaught_exceptionv=Module["__ZSt18uncaught_exceptionv"]=asm["__ZSt18uncaught_exceptionv"];var ___cxa_can_catch=Module["___cxa_can_catch"]=asm["___cxa_can_catch"];var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=asm["___cxa_is_pointer_type"];var ___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=asm["___embind_register_native_and_builtin_types"];var ___emscripten_environ_constructor=Module["___emscripten_environ_constructor"]=asm["___emscripten_environ_constructor"];var ___errno_location=Module["___errno_location"]=asm["___errno_location"];var ___getTypeName=Module["___getTypeName"]=asm["___getTypeName"];var ___muldi3=Module["___muldi3"]=asm["___muldi3"];var ___udivdi3=Module["___udivdi3"]=asm["___udivdi3"];var __get_daylight=Module["__get_daylight"]=asm["__get_daylight"];var __get_environ=Module["__get_environ"]=asm["__get_environ"];var __get_timezone=Module["__get_timezone"]=asm["__get_timezone"];var __get_tzname=Module["__get_tzname"]=asm["__get_tzname"];var _bitshift64Lshr=Module["_bitshift64Lshr"]=asm["_bitshift64Lshr"];var _bitshift64Shl=Module["_bitshift64Shl"]=asm["_bitshift64Shl"];var _emscripten_get_sbrk_ptr=Module["_emscripten_get_sbrk_ptr"]=asm["_emscripten_get_sbrk_ptr"];var _free=Module["_free"]=asm["_free"];var _i64Add=Module["_i64Add"]=asm["_i64Add"];var _i64Subtract=Module["_i64Subtract"]=asm["_i64Subtract"];var _llvm_bswap_i32=Module["_llvm_bswap_i32"]=asm["_llvm_bswap_i32"];var _malloc=Module["_malloc"]=asm["_malloc"];var _memcpy=Module["_memcpy"]=asm["_memcpy"];var _memmove=Module["_memmove"]=asm["_memmove"];var _memset=Module["_memset"]=asm["_memset"];var _realloc=Module["_realloc"]=asm["_realloc"];var _roundf=Module["_roundf"]=asm["_roundf"];var _saveSetjmp=Module["_saveSetjmp"]=asm["_saveSetjmp"];var _setThrew=Module["_setThrew"]=asm["_setThrew"];var _testSetjmp=Module["_testSetjmp"]=asm["_testSetjmp"];var establishStackSpace=Module["establishStackSpace"]=asm["establishStackSpace"];var stackAlloc=Module["stackAlloc"]=asm["stackAlloc"];var stackRestore=Module["stackRestore"]=asm["stackRestore"];var stackSave=Module["stackSave"]=asm["stackSave"];var dynCall_di=Module["dynCall_di"]=asm["dynCall_di"];var dynCall_dii=Module["dynCall_dii"]=asm["dynCall_dii"];var dynCall_i=Module["dynCall_i"]=asm["dynCall_i"];var dynCall_ii=Module["dynCall_ii"]=asm["dynCall_ii"];var dynCall_iidiiii=Module["dynCall_iidiiii"]=asm["dynCall_iidiiii"];var dynCall_iii=Module["dynCall_iii"]=asm["dynCall_iii"];var dynCall_iiii=Module["dynCall_iiii"]=asm["dynCall_iiii"];var dynCall_iiiii=Module["dynCall_iiiii"]=asm["dynCall_iiiii"];var dynCall_iiiiid=Module["dynCall_iiiiid"]=asm["dynCall_iiiiid"];var dynCall_iiiiii=Module["dynCall_iiiiii"]=asm["dynCall_iiiiii"];var dynCall_iiiiiid=Module["dynCall_iiiiiid"]=asm["dynCall_iiiiiid"];var dynCall_iiiiiii=Module["dynCall_iiiiiii"]=asm["dynCall_iiiiiii"];var dynCall_iiiiiiii=Module["dynCall_iiiiiiii"]=asm["dynCall_iiiiiiii"];var dynCall_iiiiiiiii=Module["dynCall_iiiiiiiii"]=asm["dynCall_iiiiiiiii"];var dynCall_v=Module["dynCall_v"]=asm["dynCall_v"];var dynCall_vi=Module["dynCall_vi"]=asm["dynCall_vi"];var dynCall_vid=Module["dynCall_vid"]=asm["dynCall_vid"];var dynCall_vii=Module["dynCall_vii"]=asm["dynCall_vii"];var dynCall_viid=Module["dynCall_viid"]=asm["dynCall_viid"];var dynCall_viii=Module["dynCall_viii"]=asm["dynCall_viii"];var dynCall_viiii=Module["dynCall_viiii"]=asm["dynCall_viiii"];var dynCall_viiiii=Module["dynCall_viiiii"]=asm["dynCall_viiiii"];var dynCall_viiiiii=Module["dynCall_viiiiii"]=asm["dynCall_viiiiii"];var dynCall_viiiiiii=Module["dynCall_viiiiiii"]=asm["dynCall_viiiiiii"];Module["asm"]=asm;if(memoryInitializer){if(!isDataURI(memoryInitializer)){memoryInitializer=locateFile(memoryInitializer)}if(ENVIRONMENT_IS_NODE||ENVIRONMENT_IS_SHELL){var data=readBinary(memoryInitializer);HEAPU8.set(data,GLOBAL_BASE)}else{addRunDependency("memory initializer");var applyMemoryInitializer=function(data){if(data.byteLength)data=new Uint8Array(data);HEAPU8.set(data,GLOBAL_BASE);if(Module["memoryInitializerRequest"])delete Module["memoryInitializerRequest"].response;removeRunDependency("memory initializer")};var doBrowserLoad=function(){readAsync(memoryInitializer,applyMemoryInitializer,function(){throw"could not load memory initializer "+memoryInitializer})};var memoryInitializerBytes=tryParseAsDataURI(memoryInitializer);if(memoryInitializerBytes){applyMemoryInitializer(memoryInitializerBytes.buffer)}else if(Module["memoryInitializerRequest"]){var useRequest=function(){var request=Module["memoryInitializerRequest"];var response=request.response;if(request.status!==200&&request.status!==0){var data=tryParseAsDataURI(Module["memoryInitializerRequestURL"]);if(data){response=data.buffer}else{console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+request.status+", retrying "+memoryInitializer);doBrowserLoad();return}}applyMemoryInitializer(response)};if(Module["memoryInitializerRequest"].response){setTimeout(useRequest,0)}else{Module["memoryInitializerRequest"].addEventListener("load",useRequest)}}else{doBrowserLoad()}}}var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){if(implicit&&noExitRuntime&&status===0){return}if(noExitRuntime){}else{ABORT=true;EXITSTATUS=status;exitRuntime();if(Module["onExit"])Module["onExit"](status)}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}noExitRuntime=true;run(); + diff --git a/jsartoolkit5/build/artoolkit_wasm.js b/jsartoolkit5/build/artoolkit_wasm.js new file mode 100644 index 0000000..1f327d2 --- /dev/null +++ b/jsartoolkit5/build/artoolkit_wasm.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};(function(){"use strict";var scope;if(typeof window!=="undefined"){scope=window}else{scope=self}if(scope.artoolkit_wasm_url){var downloadWasm=function(url){return new Promise(function(resolve,reject){var wasmXHR=new XMLHttpRequest;wasmXHR.open("GET",url,true);wasmXHR.responseType="arraybuffer";wasmXHR.onload=function(){resolve(wasmXHR.response)};wasmXHR.onerror=function(){reject("error "+wasmXHR.status)};wasmXHR.send(null)})};var wasm=downloadWasm(scope.artoolkit_wasm_url);Module.instantiateWasm=function(imports,successCallback){console.log("instantiateWasm: instantiating synchronously");wasm.then(function(wasmBinary){console.log("wasm download finished, begin instantiating");var wasmInstantiate=WebAssembly.instantiate(new Uint8Array(wasmBinary),imports).then(function(output){console.log("wasm instantiation succeeded");successCallback(output.instance)}).catch(function(e){console.log("wasm instantiation failed! "+e)})});return{}}}var ARController=function(width,height,cameraPara){this.id=undefined;var w=width,h=height;this.orientation="landscape";this.listeners={};if(typeof width!=="number"){var image=width;cameraPara=height;w=image.videoWidth||image.width;h=image.videoHeight||image.height;this.image=image}this.width=w;this.height=h;this.nftMarkerCount=0;this.defaultMarkerWidth=1;this.patternMarkers={};this.barcodeMarkers={};this.nftMarkers={};this.transform_mat=new Float32Array(16);this.transformGL_RH=new Float64Array(16);if(typeof document!=="undefined"){this.canvas=document.createElement("canvas");this.canvas.width=w;this.canvas.height=h;this.ctx=this.canvas.getContext("2d")}this.videoWidth=w;this.videoHeight=h;this.videoSize=this.videoWidth*this.videoHeight;this.framepointer=null;this.framesize=null;this.dataHeap=null;this.videoLuma=null;this.camera_mat=null;this.marker_transform_mat=null;this.videoLumaPointer=null;this._bwpointer=undefined;this._lumaCtx=undefined;if(typeof cameraPara==="string"){this.cameraParam=new ARCameraParam(cameraPara,function(){this._initialize()}.bind(this),function(err){console.error("ARController: Failed to load ARCameraParam",err);this.onload(err)}.bind(this))}else{this.cameraParam=cameraPara;this._initialize()}};ARController.prototype.dispose=function(){if(this.id>-1){artoolkit.teardown(this.id)}if(this.image&&this.image.srcObject){ARController._teardownVideo(this.image)}for(var t in this){this[t]=null}};ARController.prototype.process=function(image){var result=this.detectMarker(image);if(result!=0){console.error("detectMarker error: "+result)}var markerNum=this.getMarkerNum();var k,o;for(k in this.patternMarkers){o=this.patternMarkers[k];o.inPrevious=o.inCurrent;o.inCurrent=false}for(k in this.barcodeMarkers){o=this.barcodeMarkers[k];o.inPrevious=o.inCurrent;o.inCurrent=false}for(k in this.nftMarkers){o=this.nftMarkers[k];o.inPrevious=o.inCurrent;o.inCurrent=false}for(var i=0;i-1&&(markerInfo.id===markerInfo.idPatt||markerInfo.idMatrix===-1)){visible=this.trackPatternMarkerId(markerInfo.idPatt);markerType=artoolkit.PATTERN_MARKER;if(markerInfo.dir!==markerInfo.dirPatt){this.setMarkerInfoDir(i,markerInfo.dirPatt)}}else if(markerInfo.idMatrix>-1){visible=this.trackBarcodeMarkerId(markerInfo.idMatrix);markerType=artoolkit.BARCODE_MARKER;if(markerInfo.dir!==markerInfo.dirMatrix){this.setMarkerInfoDir(i,markerInfo.dirMatrix)}}if(markerType!==artoolkit.UNKNOWN_MARKER&&visible.inPrevious){this.getTransMatSquareCont(i,visible.markerWidth,visible.matrix,visible.matrix)}else{this.getTransMatSquare(i,visible.markerWidth,visible.matrix)}visible.inCurrent=true;this.transMatToGLMat(visible.matrix,this.transform_mat);this.transformGL_RH=this.arglCameraViewRHf(this.transform_mat);this.dispatchEvent({name:"getMarker",target:this,data:{index:i,type:markerType,marker:markerInfo,matrix:this.transform_mat,matrixGL_RH:this.transformGL_RH}})}var nftMarkerCount=this.nftMarkerCount;this.detectNFTMarker();var MARKER_LOST_TIME=200;for(var i=0;i=0){visible=true;this.dispatchEvent({name:"getMultiMarker",target:this,data:{multiMarkerId:i,matrix:this.transform_mat,matrixGL_RH:this.transformGL_RH}});break}}if(visible){for(var j=0;j-1){this.listeners[name].splice(index,1)}}};ARController.prototype.dispatchEvent=function(event){var listeners=this.listeners[event.name];if(listeners){for(var i=0;i>3;q+=4}}if(this.dataHeap){this.dataHeap.set(data);return true}return false};ARController.prototype._debugMarker=function(marker){var vertex,pos;vertex=marker.vertex;var ctx=this.ctx;ctx.strokeStyle="red";ctx.beginPath();ctx.moveTo(vertex[0][0],vertex[0][1]);ctx.lineTo(vertex[1][0],vertex[1][1]);ctx.stroke();ctx.beginPath();ctx.moveTo(vertex[2][0],vertex[2][1]);ctx.lineTo(vertex[3][0],vertex[3][1]);ctx.stroke();ctx.strokeStyle="green";ctx.beginPath();ctx.lineTo(vertex[1][0],vertex[1][1]);ctx.lineTo(vertex[2][0],vertex[2][1]);ctx.stroke();ctx.beginPath();ctx.moveTo(vertex[3][0],vertex[3][1]);ctx.lineTo(vertex[0][0],vertex[0][1]);ctx.stroke();pos=marker.pos;ctx.beginPath();ctx.arc(pos[0],pos[1],8,0,Math.PI*2);ctx.fillStyle="red";ctx.fill()};ARController.getUserMedia=function(configuration){var facing=configuration.facingMode||"environment";var onSuccess=configuration.onSuccess;var onError=configuration.onError||function(err){console.error("ARController.getUserMedia",err)};var video=document.createElement("video");var readyToPlay=false;var eventNames=["touchstart","touchend","touchmove","touchcancel","click","mousedown","mouseup","mousemove","keydown","keyup","keypress","scroll"];var play=function(){if(readyToPlay){video.play().then(function(){onSuccess(video)}).catch(function(error){onError(error);ARController._teardownVideo(video)});if(!video.paused){eventNames.forEach(function(eventName){window.removeEventListener(eventName,play,true)})}}};eventNames.forEach(function(eventName){window.addEventListener(eventName,play,true)});var success=function(stream){if(window.URL.createObjectURL){try{video.srcObject=stream}catch(ex){}}video.srcObject=stream;readyToPlay=true;video.autoplay=true;video.playsInline=true;play()};var constraints={};var mediaDevicesConstraints={};if(configuration.width){mediaDevicesConstraints.width=configuration.width;if(typeof configuration.width==="object"){if(configuration.width.max){constraints.maxWidth=configuration.width.max}if(configuration.width.min){constraints.minWidth=configuration.width.min}}else{constraints.maxWidth=configuration.width}}if(configuration.height){mediaDevicesConstraints.height=configuration.height;if(typeof configuration.height==="object"){if(configuration.height.max){constraints.maxHeight=configuration.height.max}if(configuration.height.min){constraints.minHeight=configuration.height.min}}else{constraints.maxHeight=configuration.height}}mediaDevicesConstraints.facingMode=facing;mediaDevicesConstraints.deviceId=configuration.deviceId;navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;var hdConstraints={audio:false,video:constraints};if(navigator.mediaDevices||window.MediaStreamTrack.getSources){if(navigator.mediaDevices){navigator.mediaDevices.getUserMedia({audio:false,video:mediaDevicesConstraints}).then(success,onError)}else{window.MediaStreamTrack.getSources(function(sources){var facingDir=mediaDevicesConstraints.facingMode;if(facing&&facing.exact){facingDir=facing.exact}for(var i=0;i-1){writeStringToFS(filename,url,writeCallback)}else{ajax(url,filename,writeCallback,errorCallback)}}function writeStringToFS(target,string,callback){var byteArray=new Uint8Array(string.length);for(var i=0;i1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];function dynamicAlloc(size){var ret=HEAP32[DYNAMICTOP_PTR>>2];var end=ret+size+15&-16;if(end>_emscripten_get_heap_size()){abort()}HEAP32[DYNAMICTOP_PTR>>2]=end;return ret}function getNativeTypeSize(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return 4}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0,"getNativeTypeSize invalid bits "+bits+", type "+type);return bits/8}else{return 0}}}}var asm2wasmImports={"f64-rem":function(x,y){return x%y},"debugger":function(){}};var functionPointers=new Array(0);var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(typeof WebAssembly!=="object"){err("no native wasm support detected")}function setValue(ptr,value,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":HEAP8[ptr>>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;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;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":878,"maximum":878,"element":"anyfunc"});var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var ALLOC_NORMAL=0;var ALLOC_NONE=3;function allocate(slab,types,allocator,ptr){var zeroinit,size;if(typeof slab==="number"){zeroinit=true;size=slab}else{zeroinit=false;size=slab.length}var singleType=typeof types==="string"?types:null;var ret;if(allocator==ALLOC_NONE){ret=ptr}else{ret=[_malloc,stackAlloc,dynamicAlloc][allocator](Math.max(size,singleType?1:types.length))}if(zeroinit){var stop;ptr=ret;assert((ret&3)==0);stop=ret+(size&~3);for(;ptr>2]=0}stop=ret+size;while(ptr>0]=0}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret)}else{HEAPU8.set(new Uint8Array(slab),ret)}return ret}var i=0,type,typeSize,previousType;while(i=endIdx))++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function allocateUTF8(str){var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8Array(str,HEAP8,ret,size);return ret}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var WASM_PAGE_SIZE=65536;var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var DYNAMIC_BASE=5303200,DYNAMICTOP_PTR=60128;var INITIAL_TOTAL_MEMORY=Module["TOTAL_MEMORY"]||268435456;if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_TOTAL_MEMORY/WASM_PAGE_SIZE,"maximum":INITIAL_TOTAL_MEMORY/WASM_PAGE_SIZE})}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_TOTAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){runtimeExited=true}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var Math_abs=Math.abs;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_min=Math.min;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";throw new WebAssembly.RuntimeError(what)}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var wasmBinaryFile="artoolkit_wasm.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_unstable":asmLibraryArg,"global":{"NaN":NaN,Infinity:Infinity},"global.Math":Math,"asm2wasm":asm2wasmImports};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiatedSource(output){receiveInstance(output["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}Module["asm"]=createWasm;var tempDouble;var tempI64;var ASM_CONSTS=[function($0,$1,$2,$3,$4,$5){if(!artoolkit["frameMalloc"]){artoolkit["frameMalloc"]={}}var frameMalloc=artoolkit["frameMalloc"];frameMalloc["framepointer"]=$1;frameMalloc["framesize"]=$2;frameMalloc["camera"]=$3;frameMalloc["transform"]=$4;frameMalloc["videoLumaPointer"]=$5},function($0,$1,$2,$3){if(!artoolkit["multiEachMarkerInfo"]){artoolkit["multiEachMarkerInfo"]={}}var multiEachMarker=artoolkit["multiEachMarkerInfo"];multiEachMarker["visible"]=$0;multiEachMarker["pattId"]=$1;multiEachMarker["pattType"]=$2;multiEachMarker["width"]=$3},function($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){var $a=arguments;var i=12;if(!artoolkit["markerInfo"]){artoolkit["markerInfo"]={pos:[0,0],line:[[0,0,0],[0,0,0],[0,0,0],[0,0,0]],vertex:[[0,0],[0,0],[0,0],[0,0]]}}var markerInfo=artoolkit["markerInfo"];markerInfo["area"]=$0;markerInfo["id"]=$1;markerInfo["idPatt"]=$2;markerInfo["idMatrix"]=$3;markerInfo["dir"]=$4;markerInfo["dirPatt"]=$5;markerInfo["dirMatrix"]=$6;markerInfo["cf"]=$7;markerInfo["cfPatt"]=$8;markerInfo["cfMatrix"]=$9;markerInfo["pos"][0]=$10;markerInfo["pos"][1]=$11;markerInfo["line"][0][0]=$a[i++];markerInfo["line"][0][1]=$a[i++];markerInfo["line"][0][2]=$a[i++];markerInfo["line"][1][0]=$a[i++];markerInfo["line"][1][1]=$a[i++];markerInfo["line"][1][2]=$a[i++];markerInfo["line"][2][0]=$a[i++];markerInfo["line"][2][1]=$a[i++];markerInfo["line"][2][2]=$a[i++];markerInfo["line"][3][0]=$a[i++];markerInfo["line"][3][1]=$a[i++];markerInfo["line"][3][2]=$a[i++];markerInfo["vertex"][0][0]=$a[i++];markerInfo["vertex"][0][1]=$a[i++];markerInfo["vertex"][1][0]=$a[i++];markerInfo["vertex"][1][1]=$a[i++];markerInfo["vertex"][2][0]=$a[i++];markerInfo["vertex"][2][1]=$a[i++];markerInfo["vertex"][3][0]=$a[i++];markerInfo["vertex"][3][1]=$a[i++];markerInfo["errorCorrected"]=$a[i++]},function($0,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13){var $a=arguments;var i=0;if(!artoolkit["NFTMarkerInfo"]){artoolkit["NFTMarkerInfo"]={id:0,error:-1,found:0,pose:[0,0,0,0,0,0,0,0,0,0,0,0]}}var markerInfo=artoolkit["NFTMarkerInfo"];markerInfo["id"]=$a[i++];markerInfo["error"]=$a[i++];markerInfo["found"]=1;markerInfo["pose"][0]=$a[i++];markerInfo["pose"][1]=$a[i++];markerInfo["pose"][2]=$a[i++];markerInfo["pose"][3]=$a[i++];markerInfo["pose"][4]=$a[i++];markerInfo["pose"][5]=$a[i++];markerInfo["pose"][6]=$a[i++];markerInfo["pose"][7]=$a[i++];markerInfo["pose"][8]=$a[i++];markerInfo["pose"][9]=$a[i++];markerInfo["pose"][10]=$a[i++];markerInfo["pose"][11]=$a[i++]},function($0){var $a=arguments;var i=0;if(!artoolkit["NFTMarkerInfo"]){artoolkit["NFTMarkerInfo"]={id:0,error:-1,found:0,pose:[0,0,0,0,0,0,0,0,0,0,0,0]}}var markerInfo=artoolkit["NFTMarkerInfo"];markerInfo["id"]=$a[i++];markerInfo["error"]=-1;markerInfo["found"]=0;markerInfo["pose"][0]=0;markerInfo["pose"][1]=0;markerInfo["pose"][2]=0;markerInfo["pose"][3]=0;markerInfo["pose"][4]=0;markerInfo["pose"][5]=0;markerInfo["pose"][6]=0;markerInfo["pose"][7]=0;markerInfo["pose"][8]=0;markerInfo["pose"][9]=0;markerInfo["pose"][10]=0;markerInfo["pose"][11]=0}];function _emscripten_asm_const_iiiiiii(code,a0,a1,a2,a3,a4,a5){return ASM_CONSTS[code](a0,a1,a2,a3,a4,a5)}function _emscripten_asm_const_iiiid(code,a0,a1,a2,a3){return ASM_CONSTS[code](a0,a1,a2,a3)}function _emscripten_asm_const_iiddddddddddddd(code,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13){return ASM_CONSTS[code](a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)}function _emscripten_asm_const_ii(code,a0){return ASM_CONSTS[code](a0)}function _emscripten_asm_const_iiiiiiiidddddddddddddddddddddddddi(code,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32){return ASM_CONSTS[code](a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32)}__ATINIT__.push({func:function(){__GLOBAL__sub_I_ARToolKitJS_cpp()}},{func:function(){___emscripten_environ_constructor()}},{func:function(){__GLOBAL__sub_I_bind_cpp()}},{func:function(){__GLOBAL__sub_I_iostream_cpp()}});function demangle(func){return func}function demangleAll(text){var regex=/\b__Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}var ENV={};function ___buildEnvironment(environ){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]="web_user";ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";ENV["_"]=thisProgram;poolPtr=getMemory(TOTAL_ENV_SIZE);envPtr=getMemory(MAX_ENV_VALUES*4);HEAP32[envPtr>>2]=poolPtr;HEAP32[environ>>2]=envPtr}else{envPtr=HEAP32[environ>>2];poolPtr=HEAP32[envPtr>>2]}var strings=[];var totalSize=0;for(var key in ENV){if(typeof ENV[key]==="string"){var line=key+"="+ENV[key];strings.push(line);totalSize+=line.length}}if(totalSize>TOTAL_ENV_SIZE){throw new Error("Environment size exceeded TOTAL_ENV_SIZE!")}var ptrSize=4;for(var i=0;i>2]=poolPtr;poolPtr+=line.length+1}HEAP32[envPtr+strings.length*ptrSize>>2]=0}function ___cxa_allocate_exception(size){return _malloc(size)}var ___exception_infos={};var ___exception_last=0;function ___cxa_throw(ptr,type,destructor){___exception_infos[ptr]={ptr:ptr,adjusted:[ptr],type:type,destructor:destructor,refcount:0,caught:false,rethrown:false};___exception_last=ptr;if(!("uncaught_exception"in __ZSt18uncaught_exceptionv)){__ZSt18uncaught_exceptionv.uncaught_exceptions=1}else{__ZSt18uncaught_exceptionv.uncaught_exceptions++}throw ptr}function ___lock(){}function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}function ___map_file(pathname,size){___setErrNo(63);return-1}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};var MEMFS={ops_table:null,mount:function(mount){return MEMFS.createNode(null,"/",16384|511,0)},createNode:function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node}return node},getFileDataAsRegularArray:function(node){if(node.contents&&node.contents.subarray){var arr=[];for(var i=0;i=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);return},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0;return}if(!node.contents||node.contents.subarray){var oldContents=node.contents;node.contents=new Uint8Array(new ArrayBuffer(newSize));if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize;return}if(!node.contents)node.contents=[];if(node.contents.length>newSize)node.contents.length=newSize;else while(node.contents.length=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){if(!FS.FSNode){FS.FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};FS.FSNode.prototype={};var readMode=292|73;var writeMode=146;Object.defineProperties(FS.FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}})}var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},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){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.indexOf("r")!==-1&&!(node.mode&292)){return 2}else if(perms.indexOf("w")!==-1&&!(node.mode&146)){return 2}else if(perms.indexOf("x")!==-1&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var err=FS.nodePermissions(dir,"x");if(err)return err;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var err=FS.nodePermissions(dir,"wx");if(err){return err}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}})}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){console.log("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(err){FS.syncFSRequests--;return callback(err)}function done(err){if(err){if(!done.errored){done.errored=true;return doCallback(err)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.indexOf(current.mount)!==-1){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var err=FS.mayCreate(parent,name);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;console.log("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(29)}return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(29)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags){var buffer=new Uint8Array(HEAPU8.subarray(addr,addr+len));FS.msync(stream,buffer,0,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:0,get:function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(){var ret=UTF8ToString(SYSCALLS.get());return ret},getStreamFromFD:function(fd){if(fd===undefined)fd=SYSCALLS.get();var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(){var low=SYSCALLS.get(),high=SYSCALLS.get();return low},getZero:function(){SYSCALLS.get()}};function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),cmd=SYSCALLS.get();switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:___setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),op=SYSCALLS.get();switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_syscall_munmap(addr,len){if(addr===-1||len===0){return-28}var info=SYSCALLS.mappings[addr];if(!info)return 0;if(len===info.len){var stream=FS.getStream(info.fd);SYSCALLS.doMsync(addr,stream,len,info.flags);FS.munmap(stream);SYSCALLS.mappings[addr]=null;if(info.allocated){_free(info.malloc)}}return 0}function ___syscall91(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get();return __emscripten_syscall_munmap(addr,len)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___unlock(){}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function ___wasi_fd_close(){return _fd_close.apply(null,arguments)}function _fd_read(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function ___wasi_fd_read(){return _fd_read.apply(null,arguments)}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function ___wasi_fd_seek(){return _fd_seek.apply(null,arguments)}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function ___wasi_fd_write(){return _fd_write.apply(null,arguments)}function getShiftFromSize(size){switch(size){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+size)}}function embind_init_charCodes(){var codes=new Array(256);for(var i=0;i<256;++i){codes[i]=String.fromCharCode(i)}embind_charCodes=codes}var embind_charCodes=undefined;function readLatin1String(ptr){var ret="";var c=ptr;while(HEAPU8[c]){ret+=embind_charCodes[HEAPU8[c++]]}return ret}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}else{return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var BindingError=undefined;function throwBindingError(message){throw new BindingError(message)}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i>shift])},destructorFunction:null})}function __embind_register_constant(name,type,value){name=readLatin1String(name);whenDependentTypesAreResolved([],[type],function(type){type=type[0];Module[name]=type["fromWireType"](value);return[]})}var emval_free_list=[];var emval_handle_array=[{},{value:undefined},{value:null},{value:true},{value:false}];function __emval_decref(handle){if(handle>4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i>2])}function __embind_register_emval(rawType,name){name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(handle){var rv=emval_handle_array[handle].value;__emval_decref(handle);return rv},"toWireType":function(destructors,value){return __emval_register(value)},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:null})}function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function new_(constructor,argumentList){if(!(constructor instanceof Function)){throw new TypeError("new_ called with constructor type "+typeof constructor+" which is not a function")}var dummy=createNamedFunction(constructor.name||"unknownFunctionName",function(){});dummy.prototype=constructor.prototype;var obj=new dummy;var r=constructor.apply(obj,argumentList);return r instanceof Object?r:obj}function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function craftInvokerFunction(humanName,argTypes,classType,cppInvokerFunc,cppTargetFunc){var argCount=argTypes.length;if(argCount<2){throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!")}var isClassMethodFunc=argTypes[1]!==null&&classType!==null;var needsDestructorStack=false;for(var i=1;i0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i>2)+i])}return array}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function embind__requireFunction(signature,rawFunction){signature=readLatin1String(signature);function makeDynCaller(dynCall){var args=[];for(var i=1;i>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=function(value){return value};if(minRange===0){var bitshift=32-8*size;fromWireType=function(value){return value<>>bitshift}}var isUnsignedType=name.indexOf("unsigned")!=-1;registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(valuemaxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0},"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(heap["buffer"],data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var str;if(stdStringIsUTF8){var endChar=HEAPU8[value+4+length];var endCharSwap=0;if(endChar!=0){endCharSwap=endChar;HEAPU8[value+4+length]=0}var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i;if(HEAPU8[currentBytePtr]==0){var stringSegment=UTF8ToString(decodeStartPtr);if(str===undefined)str=stringSegment;else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}if(endCharSwap!=0)HEAPU8[value+4+length]=endCharSwap}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr+4,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+4+i]=charCode}}else{for(var i=0;i>2];var a=new Array(length);var start=value+4>>shift;for(var i=0;i>2]=length;var start=ptr+4>>shift;for(var i=0;i>2]=now/1e3|0;HEAP32[ptr+4>>2]=now%1e3*1e3|0;return 0}function _llvm_exp2_f32(x){return Math.pow(2,x)}function _llvm_stackrestore(p){var self=_llvm_stacksave;var ret=self.LLVM_SAVEDSTACKS[p];self.LLVM_SAVEDSTACKS.splice(p,1);stackRestore(ret)}function _llvm_stacksave(){var self=_llvm_stacksave;if(!self.LLVM_SAVEDSTACKS){self.LLVM_SAVEDSTACKS=[]}self.LLVM_SAVEDSTACKS.push(stackSave());return self.LLVM_SAVEDSTACKS.length-1}var ___tm_current=60160;var ___tm_timezone=(stringToUTF8("GMT",60208,4),60208);function _tzset(){if(_tzset.called)return;_tzset.called=true;HEAP32[__get_timezone()>>2]=(new Date).getTimezoneOffset()*60;var currentYear=(new Date).getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);HEAP32[__get_daylight()>>2]=Number(winter.getTimezoneOffset()!=summer.getTimezoneOffset());function extractZone(date){var match=date.toTimeString().match(/\(([A-Za-z ]+)\)$/);return match?match[1]:"GMT"}var winterName=extractZone(winter);var summerName=extractZone(summer);var winterNamePtr=allocate(intArrayFromString(winterName),"i8",ALLOC_NORMAL);var summerNamePtr=allocate(intArrayFromString(summerName),"i8",ALLOC_NORMAL);if(summer.getTimezoneOffset()>2]=winterNamePtr;HEAP32[__get_tzname()+4>>2]=summerNamePtr}else{HEAP32[__get_tzname()>>2]=summerNamePtr;HEAP32[__get_tzname()+4>>2]=winterNamePtr}}function _localtime_r(time,tmPtr){_tzset();var date=new Date(HEAP32[time>>2]*1e3);HEAP32[tmPtr>>2]=date.getSeconds();HEAP32[tmPtr+4>>2]=date.getMinutes();HEAP32[tmPtr+8>>2]=date.getHours();HEAP32[tmPtr+12>>2]=date.getDate();HEAP32[tmPtr+16>>2]=date.getMonth();HEAP32[tmPtr+20>>2]=date.getFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getDay();var start=new Date(date.getFullYear(),0,1);var yday=(date.getTime()-start.getTime())/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+36>>2]=-(date.getTimezoneOffset()*60);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[tmPtr+32>>2]=dst;var zonePtr=HEAP32[__get_tzname()+(dst?4:0)>>2];HEAP32[tmPtr+40>>2]=zonePtr;return tmPtr}function _localtime(time){return _localtime_r(time,___tm_current)}function _longjmp(env,value){_setThrew(env,value||1);throw"longjmp"}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]);return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.indexOf(rule)>=0){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret}return ret}FS.staticInit();embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");InternalError=Module["InternalError"]=extendError(Error,"InternalError");init_emval();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}function invoke_ii(index,a1){var sp=stackSave();try{return dynCall_ii(index,a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return dynCall_iii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return dynCall_iiii(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{dynCall_vi(index,a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{dynCall_vii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{dynCall_viii(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{dynCall_viiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}var asmGlobalArg={};var asmLibraryArg={"$":___buildEnvironment,"f":___cxa_allocate_exception,"e":___cxa_throw,"z":___lock,"_":___map_file,"y":___syscall221,"Z":___syscall5,"Y":___syscall54,"X":___syscall91,"o":___unlock,"x":___wasi_fd_close,"W":___wasi_fd_read,"C":___wasi_fd_seek,"V":___wasi_fd_write,"U":__embind_register_bool,"w":__embind_register_constant,"T":__embind_register_emval,"v":__embind_register_float,"j":__embind_register_function,"k":__embind_register_integer,"i":__embind_register_memory_view,"u":__embind_register_std_string,"S":__embind_register_std_wstring,"R":__embind_register_void,"__memory_base":1024,"__table_base":0,"a":_abort,"Q":_emscripten_asm_const_ii,"P":_emscripten_asm_const_iiddddddddddddd,"O":_emscripten_asm_const_iiiid,"N":_emscripten_asm_const_iiiiiii,"M":_emscripten_asm_const_iiiiiiiidddddddddddddddddddddddddi,"L":_emscripten_get_heap_size,"J":_emscripten_memcpy_big,"I":_emscripten_resize_heap,"b":_exit,"n":_getenv,"t":_gettimeofday,"H":_llvm_exp2_f32,"m":_llvm_stackrestore,"l":_llvm_stacksave,"G":_localtime,"g":_longjmp,"E":_strftime,"D":_strftime_l,"s":_time,"c":abort,"h":getTempRet0,"q":invoke_ii,"K":invoke_iii,"F":invoke_iiii,"p":invoke_vi,"B":invoke_vii,"A":invoke_viii,"r":invoke_viiii,"memory":wasmMemory,"d":setTempRet0,"table":wasmTable};var asm=Module["asm"](asmGlobalArg,asmLibraryArg,buffer);Module["asm"]=asm;var __GLOBAL__sub_I_ARToolKitJS_cpp=Module["__GLOBAL__sub_I_ARToolKitJS_cpp"]=function(){return Module["asm"]["aa"].apply(null,arguments)};var __GLOBAL__sub_I_bind_cpp=Module["__GLOBAL__sub_I_bind_cpp"]=function(){return Module["asm"]["ba"].apply(null,arguments)};var __GLOBAL__sub_I_iostream_cpp=Module["__GLOBAL__sub_I_iostream_cpp"]=function(){return Module["asm"]["ca"].apply(null,arguments)};var __ZSt18uncaught_exceptionv=Module["__ZSt18uncaught_exceptionv"]=function(){return Module["asm"]["da"].apply(null,arguments)};var ___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=function(){return Module["asm"]["ea"].apply(null,arguments)};var ___emscripten_environ_constructor=Module["___emscripten_environ_constructor"]=function(){return Module["asm"]["fa"].apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return Module["asm"]["ga"].apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return Module["asm"]["ha"].apply(null,arguments)};var __get_daylight=Module["__get_daylight"]=function(){return Module["asm"]["ia"].apply(null,arguments)};var __get_timezone=Module["__get_timezone"]=function(){return Module["asm"]["ja"].apply(null,arguments)};var __get_tzname=Module["__get_tzname"]=function(){return Module["asm"]["ka"].apply(null,arguments)};var _free=Module["_free"]=function(){return Module["asm"]["la"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return Module["asm"]["ma"].apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return Module["asm"]["na"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return Module["asm"]["Ra"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return Module["asm"]["Sa"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return Module["asm"]["Ta"].apply(null,arguments)};var dynCall_di=Module["dynCall_di"]=function(){return Module["asm"]["oa"].apply(null,arguments)};var dynCall_dii=Module["dynCall_dii"]=function(){return Module["asm"]["pa"].apply(null,arguments)};var dynCall_i=Module["dynCall_i"]=function(){return Module["asm"]["qa"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){return Module["asm"]["ra"].apply(null,arguments)};var dynCall_iidiiii=Module["dynCall_iidiiii"]=function(){return Module["asm"]["sa"].apply(null,arguments)};var dynCall_iii=Module["dynCall_iii"]=function(){return Module["asm"]["ta"].apply(null,arguments)};var dynCall_iiii=Module["dynCall_iiii"]=function(){return Module["asm"]["ua"].apply(null,arguments)};var dynCall_iiiii=Module["dynCall_iiiii"]=function(){return Module["asm"]["va"].apply(null,arguments)};var dynCall_iiiiid=Module["dynCall_iiiiid"]=function(){return Module["asm"]["wa"].apply(null,arguments)};var dynCall_iiiiii=Module["dynCall_iiiiii"]=function(){return Module["asm"]["xa"].apply(null,arguments)};var dynCall_iiiiiid=Module["dynCall_iiiiiid"]=function(){return Module["asm"]["ya"].apply(null,arguments)};var dynCall_iiiiiii=Module["dynCall_iiiiiii"]=function(){return Module["asm"]["za"].apply(null,arguments)};var dynCall_iiiiiiii=Module["dynCall_iiiiiiii"]=function(){return Module["asm"]["Aa"].apply(null,arguments)};var dynCall_iiiiiiiii=Module["dynCall_iiiiiiiii"]=function(){return Module["asm"]["Ba"].apply(null,arguments)};var dynCall_iiiiij=Module["dynCall_iiiiij"]=function(){return Module["asm"]["Ca"].apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return Module["asm"]["Da"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){return Module["asm"]["Ea"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){return Module["asm"]["Fa"].apply(null,arguments)};var dynCall_vid=Module["dynCall_vid"]=function(){return Module["asm"]["Ga"].apply(null,arguments)};var dynCall_vif=Module["dynCall_vif"]=function(){return Module["asm"]["Ha"].apply(null,arguments)};var dynCall_vii=Module["dynCall_vii"]=function(){return Module["asm"]["Ia"].apply(null,arguments)};var dynCall_viid=Module["dynCall_viid"]=function(){return Module["asm"]["Ja"].apply(null,arguments)};var dynCall_viif=Module["dynCall_viif"]=function(){return Module["asm"]["Ka"].apply(null,arguments)};var dynCall_viii=Module["dynCall_viii"]=function(){return Module["asm"]["La"].apply(null,arguments)};var dynCall_viiii=Module["dynCall_viiii"]=function(){return Module["asm"]["Ma"].apply(null,arguments)};var dynCall_viiiii=Module["dynCall_viiiii"]=function(){return Module["asm"]["Na"].apply(null,arguments)};var dynCall_viiiiii=Module["dynCall_viiiiii"]=function(){return Module["asm"]["Oa"].apply(null,arguments)};var dynCall_viiiiiii=Module["dynCall_viiiiiii"]=function(){return Module["asm"]["Pa"].apply(null,arguments)};var dynCall_viijii=Module["dynCall_viijii"]=function(){return Module["asm"]["Qa"].apply(null,arguments)};Module["asm"]=asm;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){if(implicit&&noExitRuntime&&status===0){return}if(noExitRuntime){}else{ABORT=true;EXITSTATUS=status;exitRuntime();if(Module["onExit"])Module["onExit"](status)}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}noExitRuntime=true;run(); diff --git a/jsartoolkit5/build/artoolkit_wasm.wasm b/jsartoolkit5/build/artoolkit_wasm.wasm new file mode 100644 index 0000000..2bdb852 Binary files /dev/null and b/jsartoolkit5/build/artoolkit_wasm.wasm differ diff --git a/jsartoolkit5/examples/Data/armchair.jpg b/jsartoolkit5/examples/Data/armchair.jpg new file mode 100644 index 0000000..862f5f4 Binary files /dev/null and b/jsartoolkit5/examples/Data/armchair.jpg differ diff --git a/jsartoolkit5/examples/Data/camera_para-iPhone 5 rear 640x480 1.0m.dat b/jsartoolkit5/examples/Data/camera_para-iPhone 5 rear 640x480 1.0m.dat new file mode 100644 index 0000000..67102ed Binary files /dev/null and b/jsartoolkit5/examples/Data/camera_para-iPhone 5 rear 640x480 1.0m.dat differ diff --git a/jsartoolkit5/examples/Data/camera_para.dat b/jsartoolkit5/examples/Data/camera_para.dat new file mode 100755 index 0000000..67102ed Binary files /dev/null and b/jsartoolkit5/examples/Data/camera_para.dat differ diff --git a/jsartoolkit5/examples/Data/chalk.jpg b/jsartoolkit5/examples/Data/chalk.jpg new file mode 100644 index 0000000..82d7fe0 Binary files /dev/null and b/jsartoolkit5/examples/Data/chalk.jpg differ diff --git a/jsartoolkit5/examples/Data/chalk_multi.jpg b/jsartoolkit5/examples/Data/chalk_multi.jpg new file mode 100644 index 0000000..4b2d55a Binary files /dev/null and b/jsartoolkit5/examples/Data/chalk_multi.jpg differ diff --git a/jsartoolkit5/examples/Data/img.jpg b/jsartoolkit5/examples/Data/img.jpg new file mode 100644 index 0000000..5c020ef Binary files /dev/null and b/jsartoolkit5/examples/Data/img.jpg differ diff --git a/jsartoolkit5/examples/Data/kuva.jpg b/jsartoolkit5/examples/Data/kuva.jpg new file mode 100644 index 0000000..0711462 Binary files /dev/null and b/jsartoolkit5/examples/Data/kuva.jpg differ diff --git a/jsartoolkit5/examples/Data/logo.gif b/jsartoolkit5/examples/Data/logo.gif new file mode 100644 index 0000000..f98d04c Binary files /dev/null and b/jsartoolkit5/examples/Data/logo.gif differ diff --git a/jsartoolkit5/examples/Data/models/Flamingo.glb b/jsartoolkit5/examples/Data/models/Flamingo.glb new file mode 100644 index 0000000..662e68e Binary files /dev/null and b/jsartoolkit5/examples/Data/models/Flamingo.glb differ diff --git a/jsartoolkit5/examples/Data/multi-barcode-4x3.dat b/jsartoolkit5/examples/Data/multi-barcode-4x3.dat new file mode 100644 index 0000000..263f2c4 --- /dev/null +++ b/jsartoolkit5/examples/Data/multi-barcode-4x3.dat @@ -0,0 +1,73 @@ +12 + +00 +40.0 +1.0 0.0 0.0 -105.00 +0.0 1.0 0.0 70 +0.0 0.0 1.0 0.0 + +01 +40.0 +1.0 0.0 0.0 -35.00 +0.0 1.0 0.0 70 +0.0 0.0 1.0 0.0 + +02 +40.0 +1.0 0.0 0.0 35.00 +0.0 1.0 0.0 70 +0.0 0.0 1.0 0.0 + +03 +40.0 +1.0 0.0 0.0 105.00 +0.0 1.0 0.0 70 +0.0 0.0 1.0 0.0 + +04 +40.0 +1.0 0.0 0.0 -105.00 +0.0 1.0 0.0 0 +0.0 0.0 1.0 0.0 + +05 +40.0 +1.0 0.0 0.0 -35.00 +0.0 1.0 0.0 0 +0.0 0.0 1.0 0.0 + +06 +40.0 +1.0 0.0 0.0 35.00 +0.0 1.0 0.0 0 +0.0 0.0 1.0 0.0 + +07 +40.0 +1.0 0.0 0.0 105.00 +0.0 1.0 0.0 0 +0.0 0.0 1.0 0.0 + +08 +40.0 +1.0 0.0 0.0 -105.00 +0.0 1.0 0.0 -70 +0.0 0.0 1.0 0.0 + +09 +40.0 +1.0 0.0 0.0 -35.00 +0.0 1.0 0.0 -70 +0.0 0.0 1.0 0.0 + +10 +40.0 +1.0 0.0 0.0 35.00 +0.0 1.0 0.0 -70 +0.0 0.0 1.0 0.0 + +11 +40.0 +1.0 0.0 0.0 105.00 +0.0 1.0 0.0 -70 +0.0 0.0 1.0 0.0 \ No newline at end of file diff --git a/jsartoolkit5/examples/Data/multi.mov b/jsartoolkit5/examples/Data/multi.mov new file mode 100644 index 0000000..7e69bf9 Binary files /dev/null and b/jsartoolkit5/examples/Data/multi.mov differ diff --git a/jsartoolkit5/examples/Data/multi/marker.dat b/jsartoolkit5/examples/Data/multi/marker.dat new file mode 100755 index 0000000..f700794 --- /dev/null +++ b/jsartoolkit5/examples/Data/multi/marker.dat @@ -0,0 +1,44 @@ +#the number of patterns to be recognized +6 + +#marker 1 +patt.a +40.0 +1.0000 0.0000 0.0000 0.0000 +0.0000 1.0000 0.0000 0.0000 +0.0000 0.0000 1.0000 0.0000 + +#marker 2 +patt.b +40.0 +1.0000 0.0000 0.0000 100.0000 +0.0000 1.0000 0.0000 0.0000 +0.0000 0.0000 1.0000 0.0000 + +#marker 3 +patt.c +40.0 +1.0000 0.0000 0.0000 200.0000 +0.0000 1.0000 0.0000 0.0000 +0.0000 0.0000 1.0000 0.0000 + +#marker 4 +patt.d +40.0 +1.0000 0.0000 0.0000 0.0000 +0.0000 1.0000 0.0000 -100.0000 +0.0000 0.0000 1.0000 0.0000 + +#marker 5 +patt.g +40.0 +1.0000 0.0000 0.0000 100.0000 +0.0000 1.0000 0.0000 -100.0000 +0.0000 0.0000 1.0000 0.0000 + +#marker 6 +patt.f +40.0 +1.0000 0.0000 0.0000 200.0000 +0.0000 1.0000 0.0000 -100.0000 +0.0000 0.0000 1.0000 0.0000 diff --git a/jsartoolkit5/examples/Data/multi/patt.a b/jsartoolkit5/examples/Data/multi/patt.a new file mode 100644 index 0000000..bbbec0c --- /dev/null +++ b/jsartoolkit5/examples/Data/multi/patt.a @@ -0,0 +1,196 @@ + 201 211 215 214 217 221 222 219 198 223 223 225 226 226 225 225 + 193 219 223 222 223 220 223 216 96 216 225 225 227 227 228 224 + 193 217 220 221 222 221 223 164 63 190 224 223 226 223 224 224 + 174 214 219 217 220 217 211 107 80 129 218 219 221 223 222 219 + 180 215 217 217 218 219 181 75 78 79 190 216 220 221 221 220 + 183 213 211 217 216 214 92 82 78 76 142 212 217 218 218 216 + 195 214 216 216 217 190 108 137 78 74 90 196 215 217 217 214 + 197 213 214 215 213 130 165 188 75 71 69 137 211 212 212 211 + 192 209 212 212 180 86 204 208 120 74 71 93 205 209 210 207 + 193 207 210 208 123 139 211 207 166 71 71 72 180 205 207 202 + 168 203 206 199 72 113 128 117 113 78 69 72 107 206 206 203 + 152 204 208 151 127 196 199 198 203 170 66 72 73 185 203 198 + 164 206 209 94 192 208 208 209 208 203 73 69 60 131 202 194 + 176 213 156 82 211 208 207 207 208 211 115 68 62 84 190 188 + 184 179 79 91 145 195 207 207 202 178 103 88 88 91 110 180 + 191 191 200 195 204 199 206 202 204 189 198 187 193 188 196 170 + 175 193 203 206 210 208 209 210 192 214 211 214 217 222 217 219 + 184 211 215 215 216 213 216 206 92 213 218 217 220 220 221 222 + 186 209 211 212 214 215 218 157 49 178 215 215 219 217 218 220 + 157 206 210 208 213 211 205 94 62 107 212 214 214 216 217 220 + 162 207 208 208 210 212 172 63 60 56 180 209 213 215 216 219 + 164 205 203 208 206 207 89 65 61 56 123 204 207 211 213 215 + 172 203 207 205 206 181 92 128 60 60 72 187 206 207 207 211 + 178 203 202 205 206 114 153 183 69 59 52 125 204 204 205 213 + 179 201 201 203 174 82 202 202 106 58 56 69 199 201 203 208 + 172 198 201 202 108 119 202 201 159 49 55 47 164 200 200 200 + 156 194 197 192 53 95 111 103 101 51 53 51 84 200 199 201 + 151 195 200 142 103 176 187 181 185 151 47 50 37 176 196 196 + 161 196 200 80 182 200 199 198 200 198 57 50 44 113 197 193 + 172 206 146 69 202 200 199 200 200 203 97 46 48 60 187 182 + 180 165 62 67 133 178 198 199 192 160 85 62 58 57 84 161 + 184 182 187 178 184 184 197 192 195 176 185 177 186 176 183 160 + 201 216 220 220 226 229 228 226 204 238 233 235 232 237 238 241 + 216 239 241 240 241 240 242 238 146 246 242 243 243 244 245 246 + 208 239 239 240 241 239 242 213 82 212 242 242 243 244 244 245 + 183 238 238 237 239 237 239 149 77 144 241 239 241 243 243 245 + 183 235 237 236 239 239 215 106 73 73 214 238 241 242 243 247 + 191 234 232 237 235 239 154 95 77 75 157 237 240 237 239 244 + 199 235 234 235 236 225 138 162 80 74 100 222 236 238 241 242 + 201 234 231 234 236 166 180 215 97 74 70 161 237 233 235 240 + 207 233 231 234 222 136 224 234 141 72 71 97 235 232 234 238 + 207 230 232 232 166 160 229 230 199 72 74 72 200 231 231 237 + 194 227 230 230 125 140 147 162 163 80 70 71 119 233 230 233 + 187 227 232 195 141 198 205 208 212 180 66 70 58 215 229 230 + 195 230 235 138 202 228 231 234 230 231 85 66 62 149 235 230 + 203 232 199 113 226 231 232 232 231 235 131 67 63 83 224 228 + 215 210 110 89 183 215 231 231 227 203 136 86 74 87 119 206 + 218 208 201 202 212 204 230 227 228 212 205 198 213 209 210 196 + + 225 224 224 219 220 216 214 211 207 202 203 198 194 188 180 170 + 225 228 224 222 221 218 217 212 210 207 206 203 202 190 110 196 + 226 227 223 223 221 218 217 212 209 205 206 185 131 84 91 188 + 226 227 226 221 220 217 215 211 205 180 107 73 60 62 88 193 + 225 225 223 219 216 212 196 137 93 72 72 72 69 68 88 187 + 223 225 224 218 190 142 90 69 71 71 69 66 73 115 103 198 + 223 216 190 129 79 76 74 71 74 71 78 170 203 211 178 189 + 198 96 63 80 78 78 78 75 120 166 113 203 208 208 202 204 + 219 216 164 107 75 82 137 188 208 207 117 198 209 207 207 202 + 222 223 223 211 181 92 108 165 204 211 128 199 208 207 207 206 + 221 220 221 217 219 214 190 130 86 139 113 196 208 208 195 199 + 217 223 222 220 218 216 217 213 180 123 72 127 192 211 145 204 + 214 222 221 217 217 217 216 215 212 208 199 151 94 82 91 195 + 215 223 220 219 217 211 216 214 212 210 206 208 209 156 79 200 + 211 219 217 214 215 213 214 213 209 207 203 204 206 213 179 191 + 201 193 193 174 180 183 195 197 192 193 168 152 164 176 184 191 + 219 222 220 220 219 215 211 213 208 200 201 196 193 182 161 160 + 217 221 218 217 216 213 207 205 203 200 199 196 197 187 84 183 + 222 220 217 216 215 211 207 204 201 200 200 176 113 60 57 176 + 217 220 219 214 213 207 206 204 199 164 84 37 44 48 58 186 + 214 217 215 214 209 204 187 125 69 47 51 50 50 46 62 177 + 211 218 215 212 180 123 72 52 56 55 53 47 57 97 85 185 + 214 213 178 107 56 56 60 59 58 49 51 151 198 203 160 176 + 192 92 49 62 60 61 60 69 106 159 101 185 200 200 192 195 + 210 206 157 94 63 65 128 183 202 201 103 181 198 200 199 192 + 209 216 218 205 172 89 92 153 202 202 111 187 199 199 198 197 + 208 213 215 211 212 207 181 114 82 119 95 176 200 200 178 184 + 210 216 214 213 210 206 206 206 174 108 53 103 182 202 133 184 + 206 215 212 208 208 208 205 205 203 202 192 142 80 69 67 178 + 203 215 211 210 208 203 207 202 201 201 197 200 200 146 62 187 + 193 211 209 206 207 205 203 203 201 198 194 195 196 206 165 182 + 175 184 186 157 162 164 172 178 179 172 156 151 161 172 180 184 + 241 246 245 245 247 244 242 240 238 237 233 230 230 228 206 196 + 238 245 244 243 243 239 241 235 234 231 230 229 235 224 119 210 + 237 244 244 243 242 237 238 233 232 231 233 215 149 83 87 209 + 232 243 243 241 241 240 236 237 235 200 119 58 62 63 74 213 + 235 243 242 239 238 237 222 161 97 72 71 70 66 67 86 198 + 233 242 242 241 214 157 100 70 71 74 70 66 85 131 136 205 + 238 246 212 144 73 75 74 74 72 72 80 180 231 235 203 212 + 204 146 82 77 73 77 80 97 141 199 163 212 230 231 227 228 + 226 238 213 149 106 95 162 215 234 230 162 208 234 232 231 227 + 228 242 242 239 215 154 138 180 224 229 147 205 231 232 231 230 + 229 240 239 237 239 239 225 166 136 160 140 198 228 231 215 204 + 226 241 241 239 239 235 236 236 222 166 125 141 202 226 183 212 + 220 240 240 237 236 237 235 234 234 232 230 195 138 113 89 202 + 220 241 239 238 237 232 234 231 231 232 230 232 235 199 110 201 + 216 239 239 238 235 234 235 234 233 230 227 227 230 232 210 208 + 201 216 208 183 183 191 199 201 207 207 194 187 195 203 215 218 + + 170 196 188 193 187 198 189 204 202 206 199 204 195 200 191 191 + 180 110 91 88 88 103 178 202 207 207 195 145 91 79 179 184 + 188 190 84 62 68 115 211 208 207 207 208 211 82 156 213 176 + 194 202 131 60 69 73 203 208 209 208 208 192 94 209 206 164 + 198 203 185 73 72 66 170 203 198 199 196 127 151 208 204 152 + 203 206 206 107 72 69 78 113 117 128 113 72 199 206 203 168 + 202 207 205 180 72 71 71 166 207 211 139 123 208 210 207 193 + 207 210 209 205 93 71 74 120 208 204 86 180 212 212 209 192 + 211 212 212 211 137 69 71 75 188 165 130 213 215 214 213 197 + 214 217 217 215 196 90 74 78 137 108 190 217 216 216 214 195 + 216 218 218 217 212 142 76 78 82 92 214 216 217 211 213 183 + 220 221 221 220 216 190 79 78 75 181 219 218 217 217 215 180 + 219 222 223 221 219 218 129 80 107 211 217 220 217 219 214 174 + 224 224 223 226 223 224 190 63 164 223 221 222 221 220 217 193 + 224 228 227 227 225 225 216 96 216 223 220 223 222 223 219 193 + 225 225 226 226 225 223 223 198 219 222 221 217 214 215 211 201 + 160 183 176 186 177 185 176 195 192 197 184 184 178 187 182 184 + 161 84 57 58 62 85 160 192 199 198 178 133 67 62 165 180 + 182 187 60 48 46 97 203 200 200 199 200 202 69 146 206 172 + 193 197 113 44 50 57 198 200 198 199 200 182 80 200 196 161 + 196 196 176 37 50 47 151 185 181 187 176 103 142 200 195 151 + 201 199 200 84 51 53 51 101 103 111 95 53 192 197 194 156 + 200 200 200 164 47 55 49 159 201 202 119 108 202 201 198 172 + 208 203 201 199 69 56 58 106 202 202 82 174 203 201 201 179 + 213 205 204 204 125 52 59 69 183 153 114 206 205 202 203 178 + 211 207 207 206 187 72 60 60 128 92 181 206 205 207 203 172 + 215 213 211 207 204 123 56 61 65 89 207 206 208 203 205 164 + 219 216 215 213 209 180 56 60 63 172 212 210 208 208 207 162 + 220 217 216 214 214 212 107 62 94 205 211 213 208 210 206 157 + 220 218 217 219 215 215 178 49 157 218 215 214 212 211 209 186 + 222 221 220 220 217 218 213 92 206 216 213 216 215 215 211 184 + 219 217 222 217 214 211 214 192 210 209 208 210 206 203 193 175 + 196 210 209 213 198 205 212 228 227 230 204 212 202 201 208 218 + 206 119 87 74 86 136 203 227 231 231 215 183 89 110 210 215 + 228 224 83 63 67 131 235 231 232 232 231 226 113 199 232 203 + 230 235 149 62 66 85 231 230 234 231 228 202 138 235 230 195 + 230 229 215 58 70 66 180 212 208 205 198 141 195 232 227 187 + 233 230 233 119 71 70 80 163 162 147 140 125 230 230 227 194 + 237 231 231 200 72 74 72 199 230 229 160 166 232 232 230 207 + 238 234 232 235 97 71 72 141 234 224 136 222 234 231 233 207 + 240 235 233 237 161 70 74 97 215 180 166 236 234 231 234 201 + 242 241 238 236 222 100 74 80 162 138 225 236 235 234 235 199 + 244 239 237 240 237 157 75 77 95 154 239 235 237 232 234 191 + 247 243 242 241 238 214 73 73 106 215 239 239 236 237 235 183 + 245 243 243 241 239 241 144 77 149 239 237 239 237 238 238 183 + 245 244 244 243 242 242 212 82 213 242 239 241 240 239 239 208 + 246 245 244 243 243 242 246 146 238 242 240 241 240 241 239 216 + 241 238 237 232 235 233 238 204 226 228 229 226 220 220 216 201 + + 191 184 176 164 152 168 193 192 197 195 183 180 174 193 193 201 + 191 179 213 206 204 203 207 209 213 214 213 215 214 217 219 211 + 200 79 156 209 208 206 210 212 214 216 211 217 219 220 223 215 + 195 91 82 94 151 199 208 212 215 216 217 217 217 221 222 214 + 204 145 211 192 127 72 123 180 213 217 216 218 220 222 223 217 + 199 195 208 208 196 113 139 86 130 190 214 219 217 221 220 221 + 206 207 207 208 199 128 211 204 165 108 92 181 211 223 223 222 + 202 207 207 209 198 117 207 208 188 137 82 75 107 164 216 219 + 204 202 208 208 203 113 166 120 75 78 78 78 80 63 96 198 + 189 178 211 203 170 78 71 74 71 74 76 79 129 190 216 223 + 198 103 115 73 66 69 71 71 69 90 142 190 218 224 225 223 + 187 88 68 69 72 72 72 93 137 196 212 216 219 223 225 225 + 193 88 62 60 73 107 180 205 211 215 217 220 221 226 227 226 + 188 91 84 131 185 206 205 209 212 217 218 221 223 223 227 226 + 196 110 190 202 203 206 207 210 212 217 218 221 222 224 228 225 + 170 180 188 194 198 203 202 207 211 214 216 220 219 224 224 225 + 184 180 172 161 151 156 172 179 178 172 164 162 157 186 184 175 + 182 165 206 196 195 194 198 201 203 203 205 207 206 209 211 193 + 187 62 146 200 200 197 201 201 202 207 203 208 210 211 215 203 + 178 67 69 80 142 192 202 203 205 205 208 208 208 212 215 206 + 184 133 202 182 103 53 108 174 206 206 206 210 213 214 216 210 + 184 178 200 200 176 95 119 82 114 181 207 212 211 215 213 208 + 197 198 199 199 187 111 202 202 153 92 89 172 205 218 216 209 + 192 199 200 198 181 103 201 202 183 128 65 63 94 157 206 210 + 195 192 200 200 185 101 159 106 69 60 61 60 62 49 92 192 + 176 160 203 198 151 51 49 58 59 60 56 56 107 178 213 214 + 185 85 97 57 47 53 55 56 52 72 123 180 212 215 218 211 + 177 62 46 50 50 51 47 69 125 187 204 209 214 215 217 214 + 186 58 48 44 37 84 164 199 204 206 207 213 214 219 220 217 + 176 57 60 113 176 200 200 201 204 207 211 215 216 217 220 222 + 183 84 187 197 196 199 200 203 205 207 213 216 217 218 221 217 + 160 161 182 193 196 201 200 208 213 211 215 219 220 220 222 219 + 218 215 203 195 187 194 207 207 201 199 191 183 183 208 216 201 + 208 210 232 230 227 227 230 233 234 235 234 235 238 239 239 216 + 201 110 199 235 232 230 232 231 231 234 232 237 238 239 241 220 + 202 89 113 138 195 230 232 234 234 235 237 236 237 240 240 220 + 212 183 226 202 141 125 166 222 236 236 235 239 239 241 241 226 + 204 215 231 228 198 140 160 136 166 225 239 239 237 239 240 229 + 230 231 232 231 205 147 229 224 180 138 154 215 239 242 242 228 + 227 231 232 234 208 162 230 234 215 162 95 106 149 213 238 226 + 228 227 231 230 212 163 199 141 97 80 77 73 77 82 146 204 + 212 203 235 231 180 80 72 72 74 74 75 73 144 212 246 238 + 205 136 131 85 66 70 74 71 70 100 157 214 241 242 242 233 + 198 86 67 66 70 71 72 97 161 222 237 238 239 242 243 235 + 213 74 63 62 58 119 200 235 237 236 240 241 241 243 243 232 + 209 87 83 149 215 233 231 232 233 238 237 242 243 244 244 237 + 210 119 224 235 229 230 231 234 235 241 239 243 243 244 245 238 + 196 206 228 230 230 233 237 238 240 242 244 247 245 245 246 241 + diff --git a/jsartoolkit5/examples/Data/multi/patt.b b/jsartoolkit5/examples/Data/multi/patt.b new file mode 100644 index 0000000..70f9466 --- /dev/null +++ b/jsartoolkit5/examples/Data/multi/patt.b @@ -0,0 +1,196 @@ + 130 137 144 139 153 148 139 141 141 144 142 149 148 135 131 120 + 159 157 131 144 145 143 153 147 135 143 152 160 169 169 167 144 + 159 154 122 83 23 35 32 83 81 30 22 49 114 166 165 142 + 160 162 161 154 33 44 44 149 165 137 45 29 35 117 166 146 + 153 163 162 150 28 40 38 145 163 163 101 35 34 65 159 145 + 156 162 162 144 34 39 32 149 161 168 122 39 40 47 153 141 + 159 156 162 150 43 35 35 147 164 161 77 36 30 87 168 130 + 160 160 163 149 24 32 37 142 147 82 22 39 85 157 166 135 + 145 160 163 158 23 43 47 57 56 41 40 93 145 166 167 139 + 138 160 162 155 32 41 35 161 175 146 67 28 30 95 166 133 + 152 162 160 131 37 34 33 158 165 170 129 39 42 26 141 139 + 159 159 161 144 24 32 38 149 165 165 157 32 38 32 110 147 + 155 161 161 147 20 36 40 154 162 160 139 21 41 40 114 137 + 157 162 159 154 30 35 33 153 163 157 83 26 27 43 154 126 + 156 161 154 116 21 24 18 81 112 62 11 18 55 140 165 128 + 142 144 87 109 103 106 113 100 87 96 118 144 159 158 165 128 + 123 136 141 138 149 145 138 144 144 144 141 149 145 139 141 129 + 158 159 142 144 140 136 143 145 138 147 155 162 169 170 171 150 + 152 157 126 92 26 24 16 64 77 36 25 52 119 165 168 143 + 146 159 163 153 23 27 28 137 167 142 49 27 30 115 168 137 + 142 161 161 155 23 29 29 142 166 166 102 24 24 55 159 146 + 153 161 162 149 26 24 19 145 160 166 109 26 27 43 156 141 + 153 155 156 140 35 27 20 140 162 167 79 26 19 69 165 132 + 154 159 160 148 19 25 24 132 141 94 24 27 81 157 166 139 + 146 160 162 155 16 30 21 49 48 32 27 84 140 161 165 141 + 143 159 162 153 20 30 25 148 167 135 62 19 20 84 160 139 + 152 160 161 138 28 24 21 152 163 169 123 28 29 14 131 140 + 154 157 161 145 15 21 26 143 162 164 152 28 28 16 95 144 + 149 154 158 149 11 22 24 146 160 162 145 18 26 23 104 140 + 142 156 159 151 16 21 16 155 165 161 94 20 17 31 147 122 + 149 160 152 114 13 17 9 81 96 69 12 15 50 137 162 126 + 143 144 105 103 89 95 101 102 88 94 113 143 155 155 160 126 + 152 174 185 180 191 187 178 177 180 186 181 191 187 177 178 169 + 197 209 192 183 182 182 190 187 176 185 190 201 213 218 217 196 + 190 207 177 138 69 62 51 105 125 82 72 90 155 209 217 196 + 177 207 208 200 59 48 54 168 210 187 88 50 58 159 210 196 + 176 208 210 200 52 49 50 176 213 215 152 58 48 95 198 196 + 181 206 209 198 67 44 40 183 210 212 170 56 46 72 191 189 + 182 205 205 187 74 47 44 183 209 212 132 58 48 112 201 179 + 188 206 207 196 57 45 46 171 184 132 56 55 110 197 214 189 + 184 206 207 202 62 51 50 98 104 79 55 117 175 203 211 188 + 184 204 207 195 63 48 49 186 210 181 100 48 50 127 205 189 + 195 207 211 187 73 45 50 189 211 210 168 64 53 41 172 190 + 198 205 208 196 57 40 51 177 211 208 199 66 48 43 135 187 + 189 203 205 195 46 37 45 173 205 208 193 50 45 44 141 178 + 179 203 204 189 49 41 32 180 205 205 142 48 38 57 185 167 + 179 202 195 143 39 38 29 106 136 106 46 47 86 174 207 172 + 169 182 146 135 121 129 137 131 120 122 139 176 195 195 201 174 + + 120 144 142 146 145 141 130 135 139 133 139 147 137 126 128 128 + 131 167 165 166 159 153 168 166 167 166 141 110 114 154 165 165 + 135 169 166 117 65 47 87 157 166 95 26 32 40 43 140 158 + 148 169 114 35 34 40 30 85 145 30 42 38 41 27 55 159 + 149 160 49 29 35 39 36 39 93 28 39 32 21 26 18 144 + 142 152 22 45 101 122 77 22 40 67 129 157 139 83 11 118 + 144 143 30 137 163 168 161 82 41 146 170 165 160 157 62 96 + 141 135 81 165 163 161 164 147 56 175 165 165 162 163 112 87 + 141 147 83 149 145 149 147 142 57 161 158 149 154 153 81 100 + 139 153 32 44 38 32 35 37 47 35 33 38 40 33 18 113 + 148 143 35 44 40 39 35 32 43 41 34 32 36 35 24 106 + 153 145 23 33 28 34 43 24 23 32 37 24 20 30 21 103 + 139 144 83 154 150 144 150 149 158 155 131 144 147 154 116 109 + 144 131 122 161 162 162 162 163 163 162 160 161 161 159 154 87 + 137 157 154 162 163 162 156 160 160 160 162 159 161 162 161 144 + 130 159 159 160 153 156 159 160 145 138 152 159 155 157 156 142 + 129 150 143 137 146 141 132 139 141 139 140 144 140 122 126 126 + 141 171 168 168 159 156 165 166 165 160 131 95 104 147 162 160 + 139 170 165 115 55 43 69 157 161 84 14 16 23 31 137 155 + 145 169 119 30 24 27 19 81 140 20 29 28 26 17 50 155 + 149 162 52 27 24 26 26 27 84 19 28 28 18 20 15 143 + 141 155 25 49 102 109 79 24 27 62 123 152 145 94 12 113 + 144 147 36 142 166 166 167 94 32 135 169 164 162 161 69 94 + 144 138 77 167 166 160 162 141 48 167 163 162 160 165 96 88 + 144 145 64 137 142 145 140 132 49 148 152 143 146 155 81 102 + 138 143 16 28 29 19 20 24 21 25 21 26 24 16 9 101 + 145 136 24 27 29 24 27 25 30 30 24 21 22 21 17 95 + 149 140 26 23 23 26 35 19 16 20 28 15 11 16 13 89 + 138 144 92 153 155 149 140 148 155 153 138 145 149 151 114 103 + 141 142 126 163 161 162 156 160 162 162 161 161 158 159 152 105 + 136 159 157 159 161 161 155 159 160 159 160 157 154 156 160 144 + 123 158 152 146 142 153 153 154 146 143 152 154 149 142 149 143 + 169 196 196 196 196 189 179 189 188 189 190 187 178 167 172 174 + 178 217 217 210 198 191 201 214 211 205 172 135 141 185 207 201 + 177 218 209 159 95 72 112 197 203 127 41 43 44 57 174 195 + 187 213 155 58 48 46 48 110 175 50 53 48 45 38 86 195 + 191 201 90 50 58 56 58 55 117 48 64 66 50 48 47 176 + 181 190 72 88 152 170 132 56 55 100 168 199 193 142 46 139 + 186 185 82 187 215 212 212 132 79 181 210 208 208 205 106 122 + 180 176 125 210 213 210 209 184 104 210 211 211 205 205 136 120 + 177 187 105 168 176 183 183 171 98 186 189 177 173 180 106 131 + 178 190 51 54 50 40 44 46 50 49 50 51 45 32 29 137 + 187 182 62 48 49 44 47 45 51 48 45 40 37 41 38 129 + 191 182 69 59 52 67 74 57 62 63 73 57 46 49 39 121 + 180 183 138 200 200 198 187 196 202 195 187 196 195 189 143 135 + 185 192 177 208 210 209 205 207 207 207 211 208 205 204 195 146 + 174 209 207 207 208 206 205 206 206 204 207 205 203 203 202 182 + 152 197 190 177 176 181 182 188 184 184 195 198 189 179 179 169 + + 128 165 158 159 144 118 96 87 100 113 106 103 109 87 144 142 + 128 165 140 55 18 11 62 112 81 18 24 21 116 154 161 156 + 126 154 43 27 26 83 157 163 153 33 35 30 154 159 162 157 + 137 114 40 41 21 139 160 162 154 40 36 20 147 161 161 155 + 147 110 32 38 32 157 165 165 149 38 32 24 144 161 159 159 + 139 141 26 42 39 129 170 165 158 33 34 37 131 160 162 152 + 133 166 95 30 28 67 146 175 161 35 41 32 155 162 160 138 + 139 167 166 145 93 40 41 56 57 47 43 23 158 163 160 145 + 135 166 157 85 39 22 82 147 142 37 32 24 149 163 160 160 + 130 168 87 30 36 77 161 164 147 35 35 43 150 162 156 159 + 141 153 47 40 39 122 168 161 149 32 39 34 144 162 162 156 + 145 159 65 34 35 101 163 163 145 38 40 28 150 162 163 153 + 146 166 117 35 29 45 137 165 149 44 44 33 154 161 162 160 + 142 165 166 114 49 22 30 81 83 32 35 23 83 122 154 159 + 144 167 169 169 160 152 143 135 147 153 143 145 144 131 157 159 + 120 131 135 148 149 142 144 141 141 139 148 153 139 144 137 130 + 126 160 155 155 143 113 94 88 102 101 95 89 103 105 144 143 + 126 162 137 50 15 12 69 96 81 9 17 13 114 152 160 149 + 122 147 31 17 20 94 161 165 155 16 21 16 151 159 156 142 + 140 104 23 26 18 145 162 160 146 24 22 11 149 158 154 149 + 144 95 16 28 28 152 164 162 143 26 21 15 145 161 157 154 + 140 131 14 29 28 123 169 163 152 21 24 28 138 161 160 152 + 139 160 84 20 19 62 135 167 148 25 30 20 153 162 159 143 + 141 165 161 140 84 27 32 48 49 21 30 16 155 162 160 146 + 139 166 157 81 27 24 94 141 132 24 25 19 148 160 159 154 + 132 165 69 19 26 79 167 162 140 20 27 35 140 156 155 153 + 141 156 43 27 26 109 166 160 145 19 24 26 149 162 161 153 + 146 159 55 24 24 102 166 166 142 29 29 23 155 161 161 142 + 137 168 115 30 27 49 142 167 137 28 27 23 153 163 159 146 + 143 168 165 119 52 25 36 77 64 16 24 26 92 126 157 152 + 150 171 170 169 162 155 147 138 145 143 136 140 144 142 159 158 + 129 141 139 145 149 141 144 144 144 138 145 149 138 141 136 123 + 174 201 195 195 176 139 122 120 131 137 129 121 135 146 182 169 + 172 207 174 86 47 46 106 136 106 29 38 39 143 195 202 179 + 167 185 57 38 48 142 205 205 180 32 41 49 189 204 203 179 + 178 141 44 45 50 193 208 205 173 45 37 46 195 205 203 189 + 187 135 43 48 66 199 208 211 177 51 40 57 196 208 205 198 + 190 172 41 53 64 168 210 211 189 50 45 73 187 211 207 195 + 189 205 127 50 48 100 181 210 186 49 48 63 195 207 204 184 + 188 211 203 175 117 55 79 104 98 50 51 62 202 207 206 184 + 189 214 197 110 55 56 132 184 171 46 45 57 196 207 206 188 + 179 201 112 48 58 132 212 209 183 44 47 74 187 205 205 182 + 189 191 72 46 56 170 212 210 183 40 44 67 198 209 206 181 + 196 198 95 48 58 152 215 213 176 50 49 52 200 210 208 176 + 196 210 159 58 50 88 187 210 168 54 48 59 200 208 207 177 + 196 217 209 155 90 72 82 125 105 51 62 69 138 177 207 190 + 196 217 218 213 201 190 185 176 187 190 182 182 183 192 209 197 + 169 178 177 187 191 181 186 180 177 178 187 191 180 185 174 152 + + 142 156 157 155 159 152 138 145 160 159 156 153 160 159 159 130 + 144 161 162 161 159 162 160 160 160 156 162 163 162 154 157 137 + 87 154 159 161 161 160 162 163 163 162 162 162 161 122 131 144 + 109 116 154 147 144 131 155 158 149 150 144 150 154 83 144 139 + 103 21 30 20 24 37 32 23 24 43 34 28 33 23 145 153 + 106 24 35 36 32 34 41 43 32 35 39 40 44 35 143 148 + 113 18 33 40 38 33 35 47 37 35 32 38 44 32 153 139 + 100 81 153 154 149 158 161 57 142 147 149 145 149 83 147 141 + 87 112 163 162 165 165 175 56 147 164 161 163 165 81 135 141 + 96 62 157 160 165 170 146 41 82 161 168 163 137 30 143 144 + 118 11 83 139 157 129 67 40 22 77 122 101 45 22 152 142 + 144 18 26 21 32 39 28 93 39 36 39 35 29 49 160 149 + 159 55 27 41 38 42 30 145 85 30 40 34 35 114 169 148 + 158 140 43 40 32 26 95 166 157 87 47 65 117 166 169 135 + 165 165 154 114 110 141 166 167 166 168 153 159 166 165 167 131 + 128 128 126 137 147 139 133 139 135 130 141 145 146 142 144 120 + 143 149 142 149 154 152 143 146 154 153 153 142 146 152 158 123 + 144 160 156 154 157 160 159 160 159 155 161 161 159 157 159 136 + 105 152 159 158 161 161 162 162 160 156 162 161 163 126 142 141 + 103 114 151 149 145 138 153 155 148 140 149 155 153 92 144 138 + 89 13 16 11 15 28 20 16 19 35 26 23 23 26 140 149 + 95 17 21 22 21 24 30 30 25 27 24 29 27 24 136 145 + 101 9 16 24 26 21 25 21 24 20 19 29 28 16 143 138 + 102 81 155 146 143 152 148 49 132 140 145 142 137 64 145 144 + 88 96 165 160 162 163 167 48 141 162 160 166 167 77 138 144 + 94 69 161 162 164 169 135 32 94 167 166 166 142 36 147 144 + 113 12 94 145 152 123 62 27 24 79 109 102 49 25 155 141 + 143 15 20 18 28 28 19 84 27 26 26 24 27 52 162 149 + 155 50 17 26 28 29 20 140 81 19 27 24 30 119 169 145 + 155 137 31 23 16 14 84 161 157 69 43 55 115 165 170 139 + 160 162 147 104 95 131 160 165 166 165 156 159 168 168 171 141 + 126 126 122 140 144 140 139 141 139 132 141 146 137 143 150 129 + 169 179 179 189 198 195 184 184 188 182 181 176 177 190 197 152 + 182 202 203 203 205 207 204 206 206 205 206 208 207 207 209 174 + 146 195 204 205 208 211 207 207 207 205 209 210 208 177 192 185 + 135 143 189 195 196 187 195 202 196 187 198 200 200 138 183 180 + 121 39 49 46 57 73 63 62 57 74 67 52 59 69 182 191 + 129 38 41 37 40 45 48 51 45 47 44 49 48 62 182 187 + 137 29 32 45 51 50 49 50 46 44 40 50 54 51 190 178 + 131 106 180 173 177 189 186 98 171 183 183 176 168 105 187 177 + 120 136 205 205 211 211 210 104 184 209 210 213 210 125 176 180 + 122 106 205 208 208 210 181 79 132 212 212 215 187 82 185 186 + 139 46 142 193 199 168 100 55 56 132 170 152 88 72 190 181 + 176 47 48 50 66 64 48 117 55 58 56 58 50 90 201 191 + 195 86 38 45 48 53 50 175 110 48 46 48 58 155 213 187 + 195 174 57 44 43 41 127 203 197 112 72 95 159 209 218 177 + 201 207 185 141 135 172 205 211 214 201 191 198 210 217 217 178 + 174 172 167 178 187 190 189 188 189 179 189 196 196 196 196 169 + diff --git a/jsartoolkit5/examples/Data/multi/patt.c b/jsartoolkit5/examples/Data/multi/patt.c new file mode 100644 index 0000000..7605a43 --- /dev/null +++ b/jsartoolkit5/examples/Data/multi/patt.c @@ -0,0 +1,196 @@ + 141 153 152 152 150 151 154 154 150 153 140 144 146 136 147 120 + 163 171 168 171 171 152 117 90 78 99 121 158 176 132 174 159 + 155 171 171 157 100 46 48 112 148 154 131 81 80 72 175 156 + 149 168 160 72 38 43 145 175 174 175 180 167 76 49 169 155 + 151 164 76 39 31 115 176 175 177 176 178 172 156 71 174 156 + 155 133 38 38 40 150 169 173 175 177 175 174 174 102 175 152 + 155 85 38 39 56 166 166 171 170 175 174 173 175 164 172 159 + 147 57 32 37 90 165 163 168 169 171 172 172 176 174 173 146 + 155 42 34 35 88 169 168 168 170 169 174 167 172 172 174 144 + 157 52 35 32 67 169 169 169 170 169 170 169 171 172 172 158 + 147 71 32 38 64 157 169 171 169 168 170 169 169 170 172 150 + 150 111 25 37 46 142 168 167 165 167 167 170 169 164 169 148 + 147 154 60 32 33 103 168 167 169 165 168 170 161 126 172 147 + 149 166 149 49 33 51 128 162 163 166 167 147 80 127 171 150 + 146 167 166 153 93 50 53 76 98 100 81 82 135 170 175 146 + 153 163 155 159 156 153 135 111 114 104 138 160 162 162 167 129 + 123 140 140 148 142 143 146 145 149 138 135 133 131 130 131 106 + 148 161 160 162 164 145 106 73 67 77 95 141 164 132 162 149 + 145 156 161 146 91 29 26 88 133 137 111 59 43 55 163 148 + 138 158 143 56 19 32 128 165 168 169 171 161 64 36 161 151 + 133 152 68 21 19 104 162 165 167 168 169 169 152 56 165 152 + 144 120 25 18 27 147 162 163 162 165 165 165 165 101 160 147 + 138 74 18 15 45 155 161 162 161 164 164 164 164 162 164 149 + 128 42 16 14 64 157 157 159 161 162 163 163 164 166 162 144 + 132 27 19 16 65 156 156 159 160 161 164 162 164 165 164 145 + 133 35 15 14 48 158 155 158 158 159 162 163 161 164 164 150 + 133 60 13 18 36 149 155 157 159 158 159 159 161 162 161 143 + 136 105 15 19 22 133 155 154 156 158 159 157 160 157 160 147 + 140 152 51 13 13 78 155 153 153 153 157 157 152 114 161 143 + 143 158 138 36 8 19 112 156 153 157 159 135 71 102 161 140 + 133 155 154 146 77 26 17 51 78 90 67 63 121 158 160 147 + 130 153 149 155 152 145 116 97 96 99 127 151 149 151 150 131 + 157 180 173 183 174 179 180 180 184 176 173 171 167 169 166 149 + 175 207 209 210 209 193 153 123 123 132 146 194 216 184 204 201 + 176 205 210 197 147 83 62 123 172 184 152 93 90 103 197 199 + 168 206 197 116 52 53 156 206 214 215 218 204 105 61 197 206 + 165 198 126 52 35 122 204 209 214 214 215 215 202 93 193 203 + 174 176 71 39 44 175 205 208 214 213 213 214 215 151 200 203 + 163 130 49 34 68 191 204 207 209 209 212 215 213 207 207 201 + 162 97 36 33 91 192 202 207 210 210 212 209 210 212 215 200 + 161 74 36 34 94 196 202 204 208 208 210 209 212 211 216 200 + 163 68 36 30 68 194 204 205 205 206 206 207 210 210 214 206 + 165 100 33 33 60 184 204 203 203 205 208 207 209 211 210 202 + 162 155 35 33 40 166 202 202 202 204 204 207 207 208 209 200 + 168 196 96 23 24 106 200 202 203 201 205 208 199 163 201 197 + 168 202 190 64 22 36 151 200 201 201 204 186 130 139 200 193 + 163 201 199 186 99 42 38 86 118 139 116 110 155 193 205 196 + 164 196 194 192 193 186 160 120 121 129 164 186 193 197 194 190 + + 120 159 156 155 156 152 159 146 144 158 150 148 147 150 146 129 + 147 174 175 169 174 175 172 173 174 172 172 169 172 171 175 167 + 136 132 72 49 71 102 164 174 172 172 170 164 126 127 170 162 + 146 176 80 76 156 174 175 176 172 171 169 169 161 80 135 162 + 144 158 81 167 172 174 173 172 167 169 169 170 170 147 82 160 + 140 121 131 180 178 175 174 172 174 170 170 167 168 167 81 138 + 153 99 154 175 176 177 175 171 169 169 168 167 165 166 100 104 + 150 78 148 174 177 175 170 169 170 170 169 165 169 163 98 114 + 154 90 112 175 175 173 171 168 168 169 171 167 167 162 76 111 + 154 117 48 145 176 169 166 163 168 169 169 168 168 128 53 135 + 151 152 46 43 115 150 166 165 169 169 157 142 103 51 50 153 + 150 171 100 38 31 40 56 90 88 67 64 46 33 33 93 156 + 152 171 157 72 39 38 39 37 35 32 38 37 32 49 153 159 + 152 168 171 160 76 38 38 32 34 35 32 25 60 149 166 155 + 153 171 171 168 164 133 85 57 42 52 71 111 154 166 167 163 + 141 163 155 149 151 155 155 147 155 157 147 150 147 149 146 153 + 106 149 148 151 152 147 149 144 145 150 143 147 143 140 147 131 + 131 162 163 161 165 160 164 162 164 164 161 160 161 161 160 150 + 130 132 55 36 56 101 162 166 165 164 162 157 114 102 158 151 + 131 164 43 64 152 165 164 164 164 161 161 160 152 71 121 149 + 133 141 59 161 169 165 164 163 162 163 159 157 157 135 63 151 + 135 95 111 171 169 165 164 163 164 162 159 159 157 159 67 127 + 138 77 137 169 168 165 164 162 161 159 158 158 153 157 90 99 + 149 67 133 168 167 162 161 161 160 158 159 156 153 153 78 96 + 145 73 88 165 165 163 162 159 159 158 157 154 153 156 51 97 + 146 106 26 128 162 162 161 157 156 155 155 155 155 112 17 116 + 143 145 29 32 104 147 155 157 156 158 149 133 78 19 26 145 + 142 164 91 19 19 27 45 64 65 48 36 22 13 8 77 152 + 148 162 146 56 21 18 15 14 16 14 18 19 13 36 146 155 + 140 160 161 143 68 25 18 16 19 15 13 15 51 138 154 149 + 140 161 156 158 152 120 74 42 27 35 60 105 152 158 155 153 + 123 148 145 138 133 144 138 128 132 133 133 136 140 143 133 130 + 149 201 199 206 203 203 201 200 200 206 202 200 197 193 196 190 + 166 204 197 197 193 200 207 215 216 214 210 209 201 200 205 194 + 169 184 103 61 93 151 207 212 211 210 211 208 163 139 193 197 + 167 216 90 105 202 215 213 210 212 210 209 207 199 130 155 193 + 171 194 93 204 215 214 215 209 209 207 207 207 208 186 110 186 + 173 146 152 218 215 213 212 212 210 206 208 204 205 204 116 164 + 176 132 184 215 214 213 209 210 208 206 205 204 201 201 139 129 + 184 123 172 214 214 214 209 210 208 205 203 202 203 201 118 121 + 180 123 123 206 209 208 207 207 204 205 203 202 202 200 86 120 + 180 153 62 156 204 205 204 202 202 204 204 202 200 151 38 160 + 179 193 83 53 122 175 191 192 196 194 184 166 106 36 42 186 + 174 209 147 52 35 44 68 91 94 68 60 40 24 22 99 193 + 183 210 197 116 52 39 34 33 34 30 33 33 23 64 186 192 + 173 209 210 197 126 71 49 36 36 36 33 35 96 190 199 194 + 180 207 205 206 198 176 130 97 74 68 100 155 196 202 201 196 + 157 175 176 168 165 174 163 162 161 163 165 162 168 168 163 164 + + 129 167 162 162 160 138 104 114 111 135 153 156 159 155 163 153 + 146 175 170 135 82 81 100 98 76 53 50 93 153 166 167 146 + 150 171 127 80 147 167 166 163 162 128 51 33 49 149 166 149 + 147 172 126 161 170 168 165 169 167 168 103 33 32 60 154 147 + 148 169 164 169 170 167 167 165 167 168 142 46 37 25 111 150 + 150 172 170 169 169 170 168 169 171 169 157 64 38 32 71 147 + 158 172 172 171 169 170 169 170 169 169 169 67 32 35 52 157 + 144 174 172 172 167 174 169 170 168 168 169 88 35 34 42 155 + 146 173 174 176 172 172 171 169 168 163 165 90 37 32 57 147 + 159 172 164 175 173 174 175 170 171 166 166 56 39 38 85 155 + 152 175 102 174 174 175 177 175 173 169 150 40 38 38 133 155 + 156 174 71 156 172 178 176 177 175 176 115 31 39 76 164 151 + 155 169 49 76 167 180 175 174 175 145 43 38 72 160 168 149 + 156 175 72 80 81 131 154 148 112 48 46 100 157 171 171 155 + 159 174 132 176 158 121 99 78 90 117 152 171 171 168 171 163 + 120 147 136 146 144 140 153 150 154 154 151 150 152 152 153 141 + 131 150 151 149 151 127 99 96 97 116 145 152 155 149 153 130 + 147 160 158 121 63 67 90 78 51 17 26 77 146 154 155 133 + 140 161 102 71 135 159 157 153 156 112 19 8 36 138 158 143 + 143 161 114 152 157 157 153 153 153 155 78 13 13 51 152 140 + 147 160 157 160 157 159 158 156 154 155 133 22 19 15 105 136 + 143 161 162 161 159 159 158 159 157 155 149 36 18 13 60 133 + 150 164 164 161 163 162 159 158 158 155 158 48 14 15 35 133 + 145 164 165 164 162 164 161 160 159 156 156 65 16 19 27 132 + 144 162 166 164 163 163 162 161 159 157 157 64 14 16 42 128 + 149 164 162 164 164 164 164 161 162 161 155 45 15 18 74 138 + 147 160 101 165 165 165 165 162 163 162 147 27 18 25 120 144 + 152 165 56 152 169 169 168 167 165 162 104 19 21 68 152 133 + 151 161 36 64 161 171 169 168 165 128 32 19 56 143 158 138 + 148 163 55 43 59 111 137 133 88 26 29 91 146 161 156 145 + 149 162 132 164 141 95 77 67 73 106 145 164 162 160 161 148 + 106 131 130 131 133 135 138 149 145 146 143 142 148 140 140 123 + 190 194 197 193 186 164 129 121 120 160 186 193 192 194 196 164 + 196 205 193 155 110 116 139 118 86 38 42 99 186 199 201 163 + 193 200 139 130 186 204 201 201 200 151 36 22 64 190 202 168 + 197 201 163 199 208 205 201 203 202 200 106 24 23 96 196 168 + 200 209 208 207 207 204 204 202 202 202 166 40 33 35 155 162 + 202 210 211 209 207 208 205 203 203 204 184 60 33 33 100 165 + 206 214 210 210 207 206 206 205 205 204 194 68 30 36 68 163 + 200 216 211 212 209 210 208 208 204 202 196 94 34 36 74 161 + 200 215 212 210 209 212 210 210 207 202 192 91 33 36 97 162 + 201 207 207 213 215 212 209 209 207 204 191 68 34 49 130 163 + 203 200 151 215 214 213 213 214 208 205 175 44 39 71 176 174 + 203 193 93 202 215 215 214 214 209 204 122 35 52 126 198 165 + 206 197 61 105 204 218 215 214 206 156 53 52 116 197 206 168 + 199 197 103 90 93 152 184 172 123 62 83 147 197 210 205 176 + 201 204 184 216 194 146 132 123 123 153 193 209 210 209 207 175 + 149 166 169 167 171 173 176 184 180 180 179 174 183 173 180 157 + + 153 146 149 147 150 147 157 155 147 155 155 151 149 155 163 141 + 163 167 166 154 111 71 52 42 57 85 133 164 168 171 171 153 + 155 166 149 60 25 32 35 34 32 38 38 76 160 171 168 152 + 159 153 49 32 37 38 32 35 37 39 38 39 72 157 171 152 + 156 93 33 33 46 64 67 88 90 56 40 31 38 100 171 150 + 153 50 51 103 142 157 169 169 165 166 150 115 43 46 152 151 + 135 53 128 168 168 169 169 168 163 166 169 176 145 48 117 154 + 111 76 162 167 167 171 169 168 168 171 173 175 175 112 90 154 + 114 98 163 169 165 169 170 170 169 170 175 177 174 148 78 150 + 104 100 166 165 167 168 169 169 171 175 177 176 175 154 99 153 + 138 81 167 168 167 170 170 174 172 174 175 178 180 131 121 140 + 160 82 147 170 170 169 169 167 172 173 174 172 167 81 158 144 + 162 135 80 161 169 169 171 172 176 175 174 156 76 80 176 146 + 162 170 127 126 164 170 172 172 174 164 102 71 49 72 132 136 + 167 175 171 172 169 172 172 174 173 172 175 174 169 175 174 147 + 129 146 150 147 148 150 158 144 146 159 152 156 155 156 159 120 + 130 133 143 140 136 133 133 132 128 138 144 133 138 145 148 123 + 153 155 158 152 105 60 35 27 42 74 120 152 158 156 161 140 + 149 154 138 51 15 13 15 19 16 18 25 68 143 161 160 140 + 155 146 36 13 19 18 14 16 14 15 18 21 56 146 162 148 + 152 77 8 13 22 36 48 65 64 45 27 19 19 91 164 142 + 145 26 19 78 133 149 158 156 157 155 147 104 32 29 145 143 + 116 17 112 155 155 155 155 156 157 161 162 162 128 26 106 146 + 97 51 156 153 154 157 158 159 159 162 163 165 165 88 73 145 + 96 78 153 153 156 159 158 160 161 161 162 167 168 133 67 149 + 99 90 157 153 158 158 159 161 162 164 165 168 169 137 77 138 + 127 67 159 157 159 159 162 164 163 164 165 169 171 111 95 135 + 151 63 135 157 157 159 163 162 163 164 165 169 161 59 141 133 + 149 121 71 152 160 161 161 164 164 164 165 152 64 43 164 131 + 151 158 102 114 157 162 164 165 166 162 101 56 36 55 132 130 + 150 160 161 161 160 161 164 164 162 164 160 165 161 163 162 131 + 131 147 140 143 147 143 150 145 144 149 147 152 151 148 149 106 + 164 163 168 168 162 165 163 161 162 163 174 165 168 176 175 157 + 196 201 202 196 155 100 68 74 97 130 176 198 206 205 207 180 + 194 199 190 96 35 33 36 36 36 49 71 126 197 210 209 173 + 192 186 64 23 33 33 30 34 33 34 39 52 116 197 210 183 + 193 99 22 24 40 60 68 94 91 68 44 35 52 147 209 174 + 186 42 36 106 166 184 194 196 192 191 175 122 53 83 193 179 + 160 38 151 200 202 204 204 202 202 204 205 204 156 62 153 180 + 120 86 200 202 202 203 205 204 207 207 208 209 206 123 123 180 + 121 118 201 203 202 203 205 208 210 209 214 214 214 172 123 184 + 129 139 201 201 204 205 206 208 210 209 213 214 215 184 132 176 + 164 116 204 205 204 208 206 210 212 212 213 215 218 152 146 173 + 186 110 186 208 207 207 207 209 209 215 214 215 204 93 194 171 + 193 155 130 199 207 209 210 212 210 213 215 202 105 90 216 167 + 197 193 139 163 208 211 210 211 212 207 151 93 61 103 184 169 + 194 205 200 201 209 210 214 216 215 207 200 193 197 197 204 166 + 190 196 193 197 200 202 206 200 200 201 203 203 206 199 201 149 + diff --git a/jsartoolkit5/examples/Data/multi/patt.d b/jsartoolkit5/examples/Data/multi/patt.d new file mode 100644 index 0000000..614c2c0 --- /dev/null +++ b/jsartoolkit5/examples/Data/multi/patt.d @@ -0,0 +1,196 @@ + 96 131 130 134 123 130 136 130 133 125 134 118 125 125 129 119 + 96 130 86 81 83 84 84 85 79 104 124 145 148 145 147 138 + 84 146 144 66 19 24 47 114 89 38 21 38 113 148 146 134 + 89 147 147 101 19 23 45 149 149 143 56 21 19 102 148 131 + 91 147 147 101 21 22 37 145 148 150 133 25 25 18 131 140 + 98 147 147 94 23 24 37 142 148 148 150 50 23 20 74 137 + 102 143 144 91 21 23 42 142 148 149 149 77 25 21 36 136 + 107 144 145 90 21 22 42 139 146 148 148 86 24 23 25 136 + 91 144 148 86 21 20 41 146 148 148 148 94 19 22 21 133 + 82 144 145 81 22 23 51 146 146 147 149 105 22 20 28 137 + 92 143 144 75 22 22 51 148 149 150 149 93 22 20 50 142 + 101 144 144 92 15 18 50 146 145 150 151 75 24 19 95 138 + 105 147 150 96 17 17 56 144 145 150 134 24 19 50 149 139 + 114 148 150 85 18 15 56 146 147 140 46 17 51 137 153 141 + 104 125 114 30 18 18 19 55 57 32 38 93 141 150 149 136 + 95 121 122 116 129 129 119 122 124 136 141 155 143 140 138 136 + 85 120 116 117 119 121 123 116 125 115 125 118 118 115 122 118 + 82 122 79 77 78 80 77 82 81 99 114 138 140 140 140 132 + 74 136 132 56 9 8 42 106 80 32 10 31 111 140 140 127 + 78 135 135 84 7 10 38 139 141 133 43 11 12 96 141 126 + 81 134 133 81 8 10 28 136 137 139 121 12 10 10 123 127 + 87 133 134 76 10 11 28 134 137 139 142 39 11 9 66 128 + 95 134 134 76 7 10 30 135 137 139 140 61 11 11 28 128 + 98 133 133 69 8 8 34 136 138 139 138 77 9 11 16 121 + 80 131 134 63 8 9 34 136 136 137 140 84 7 11 10 118 + 77 132 133 60 10 10 39 138 138 138 141 93 7 10 17 125 + 87 135 134 55 8 8 42 138 136 139 139 84 9 10 37 128 + 92 135 134 73 6 6 43 136 134 137 139 58 12 8 89 125 + 95 132 133 79 7 7 47 136 134 138 125 16 10 39 132 128 + 102 135 137 75 8 7 47 136 135 131 44 9 39 120 140 127 + 92 120 106 28 8 8 8 45 47 24 29 79 131 138 139 129 + 80 114 113 103 112 114 109 108 113 124 129 137 130 132 132 124 + 113 147 147 146 139 143 149 137 147 146 153 140 147 147 151 134 + 109 150 107 101 108 105 103 119 107 126 144 166 173 172 176 162 + 101 166 161 68 19 16 63 139 107 54 29 53 138 174 177 157 + 102 167 167 106 17 17 58 171 173 163 59 17 23 124 179 156 + 109 169 169 102 15 17 47 167 172 176 145 23 17 21 158 159 + 115 166 167 95 16 16 48 165 170 172 174 57 21 15 97 157 + 119 165 166 97 15 15 50 164 171 173 174 83 18 19 50 153 + 124 167 165 90 16 16 57 163 171 173 175 103 19 21 33 143 + 106 162 165 86 16 13 56 165 171 174 174 113 15 22 26 138 + 103 164 164 82 16 14 61 166 172 172 173 118 15 18 36 142 + 113 168 164 76 13 13 66 167 170 173 172 108 17 20 60 153 + 119 168 167 94 10 13 65 166 168 170 169 82 21 17 114 153 + 122 166 165 107 13 11 66 166 167 171 156 34 19 63 163 158 + 131 166 166 101 16 11 66 163 165 156 64 18 62 151 173 154 + 120 148 132 53 21 20 23 75 76 53 54 107 158 172 172 155 + 104 138 137 127 127 125 135 134 131 140 151 163 159 159 157 155 + + 119 138 134 131 140 137 136 136 133 137 142 138 139 141 136 136 + 129 147 146 148 131 74 36 25 21 28 50 95 149 153 149 138 + 125 145 148 102 18 20 21 23 22 20 20 19 50 137 150 140 + 125 148 113 19 25 23 25 24 19 22 22 24 19 51 141 143 + 118 145 38 21 25 50 77 86 94 105 93 75 24 17 93 155 + 134 124 21 56 133 150 149 148 148 149 149 151 134 46 38 141 + 125 104 38 143 150 148 149 148 148 147 150 150 150 140 32 136 + 133 79 89 149 148 148 148 146 148 146 149 145 145 147 57 124 + 130 85 114 149 145 142 142 139 146 146 148 146 144 146 55 122 + 136 84 47 45 37 37 42 42 41 51 51 50 56 56 19 119 + 130 84 24 23 22 24 23 22 20 23 22 18 17 15 18 129 + 123 83 19 19 21 23 21 21 21 22 22 15 17 18 18 129 + 134 81 66 101 101 94 91 90 86 81 75 92 96 85 30 116 + 130 86 144 147 147 147 144 145 148 145 144 144 150 150 114 122 + 131 130 146 147 147 147 143 144 144 144 143 144 147 148 125 121 + 96 96 84 89 91 98 102 107 91 82 92 101 105 114 104 95 + 118 132 127 126 127 128 128 121 118 125 128 125 128 127 129 124 + 122 140 140 141 123 66 28 16 10 17 37 89 132 140 139 132 + 115 140 140 96 10 9 11 11 11 10 10 8 39 120 138 132 + 118 140 111 12 10 11 11 9 7 7 9 12 10 39 131 130 + 118 138 31 11 12 39 61 77 84 93 84 58 16 9 79 137 + 125 114 10 43 121 142 140 138 140 141 139 139 125 44 29 129 + 115 99 32 133 139 139 139 139 137 138 139 137 138 131 24 124 + 125 81 80 141 137 137 137 138 136 138 136 134 134 135 47 113 + 116 82 106 139 136 134 135 136 136 138 138 136 136 136 45 108 + 123 77 42 38 28 28 30 34 34 39 42 43 47 47 8 109 + 121 80 8 10 10 11 10 8 9 10 8 6 7 7 8 114 + 119 78 9 7 8 10 7 8 8 10 8 6 7 8 8 112 + 117 77 56 84 81 76 76 69 63 60 55 73 79 75 28 103 + 116 79 132 135 133 134 134 133 134 133 134 134 133 137 106 113 + 120 122 136 135 134 133 134 133 131 132 135 135 132 135 120 114 + 85 82 74 78 81 87 95 98 80 77 87 92 95 102 92 80 + 134 162 157 156 159 157 153 143 138 142 153 153 158 154 155 155 + 151 176 177 179 158 97 50 33 26 36 60 114 163 173 172 157 + 147 172 174 124 21 15 19 21 22 18 20 17 63 151 172 159 + 147 173 138 23 17 21 18 19 15 15 17 21 19 62 158 159 + 140 166 53 17 23 57 83 103 113 118 108 82 34 18 107 163 + 153 144 29 59 145 174 174 175 174 173 172 169 156 64 54 151 + 146 126 54 163 176 172 173 173 174 172 173 170 171 156 53 140 + 147 107 107 173 172 170 171 171 171 172 170 168 167 165 76 131 + 137 119 139 171 167 165 164 163 165 166 167 166 166 163 75 134 + 149 103 63 58 47 48 50 57 56 61 66 65 66 66 23 135 + 143 105 16 17 17 16 15 16 13 14 13 13 11 11 20 125 + 139 108 19 17 15 16 15 16 16 16 13 10 13 16 21 127 + 146 101 68 106 102 95 97 90 86 82 76 94 107 101 53 127 + 147 107 161 167 169 167 166 165 165 164 164 167 165 166 132 137 + 147 150 166 167 169 166 165 167 162 164 168 168 166 166 148 138 + 113 109 101 102 109 115 119 124 106 103 113 119 122 131 120 104 + + 136 138 140 143 155 141 136 124 122 119 129 129 116 122 121 95 + 136 149 150 141 93 38 32 57 55 19 18 18 30 114 125 104 + 141 153 137 51 17 46 140 147 146 56 15 18 85 150 148 114 + 139 149 50 19 24 134 150 145 144 56 17 17 96 150 147 105 + 138 95 19 24 75 151 150 145 146 50 18 15 92 144 144 101 + 142 50 20 22 93 149 150 149 148 51 22 22 75 144 143 92 + 137 28 20 22 105 149 147 146 146 51 23 22 81 145 144 82 + 133 21 22 19 94 148 148 148 146 41 20 21 86 148 144 91 + 136 25 23 24 86 148 148 146 139 42 22 21 90 145 144 107 + 136 36 21 25 77 149 149 148 142 42 23 21 91 144 143 102 + 137 74 20 23 50 150 148 148 142 37 24 23 94 147 147 98 + 140 131 18 25 25 133 150 148 145 37 22 21 101 147 147 91 + 131 148 102 19 21 56 143 149 149 45 23 19 101 147 147 89 + 134 146 148 113 38 21 38 89 114 47 24 19 66 144 146 84 + 138 147 145 148 145 124 104 79 85 84 84 83 81 86 130 96 + 119 129 125 125 118 134 125 133 130 136 130 123 134 130 131 96 + 124 132 132 130 137 129 124 113 108 109 114 112 103 113 114 80 + 129 139 138 131 79 29 24 47 45 8 8 8 28 106 120 92 + 127 140 120 39 9 44 131 135 136 47 7 8 75 137 135 102 + 128 132 39 10 16 125 138 134 136 47 7 7 79 133 132 95 + 125 89 8 12 58 139 137 134 136 43 6 6 73 134 135 92 + 128 37 10 9 84 139 139 136 138 42 8 8 55 134 135 87 + 125 17 10 7 93 141 138 138 138 39 10 10 60 133 132 77 + 118 10 11 7 84 140 137 136 136 34 9 8 63 134 131 80 + 121 16 11 9 77 138 139 138 136 34 8 8 69 133 133 98 + 128 28 11 11 61 140 139 137 135 30 10 7 76 134 134 95 + 128 66 9 11 39 142 139 137 134 28 11 10 76 134 133 87 + 127 123 10 10 12 121 139 137 136 28 10 8 81 133 134 81 + 126 141 96 12 11 43 133 141 139 38 10 7 84 135 135 78 + 127 140 140 111 31 10 32 80 106 42 8 9 56 132 136 74 + 132 140 140 140 138 114 99 81 82 77 80 78 77 79 122 82 + 118 122 115 118 118 125 115 125 116 123 121 119 117 116 120 85 + 155 157 159 159 163 151 140 131 134 135 125 127 127 137 138 104 + 155 172 172 158 107 54 53 76 75 23 20 21 53 132 148 120 + 154 173 151 62 18 64 156 165 163 66 11 16 101 166 166 131 + 158 163 63 19 34 156 171 167 166 66 11 13 107 165 166 122 + 153 114 17 21 82 169 170 168 166 65 13 10 94 167 168 119 + 153 60 20 17 108 172 173 170 167 66 13 13 76 164 168 113 + 142 36 18 15 118 173 172 172 166 61 14 16 82 164 164 103 + 138 26 22 15 113 174 174 171 165 56 13 16 86 165 162 106 + 143 33 21 19 103 175 173 171 163 57 16 16 90 165 167 124 + 153 50 19 18 83 174 173 171 164 50 15 15 97 166 165 119 + 157 97 15 21 57 174 172 170 165 48 16 16 95 167 166 115 + 159 158 21 17 23 145 176 172 167 47 17 15 102 169 169 109 + 156 179 124 23 17 59 163 173 171 58 17 17 106 167 167 102 + 157 177 174 138 53 29 54 107 139 63 16 19 68 161 166 101 + 162 176 172 173 166 144 126 107 119 103 105 108 101 107 150 109 + 134 151 147 147 140 153 146 147 137 149 143 139 146 147 147 113 + + 95 104 114 105 101 92 82 91 107 102 98 91 89 84 96 96 + 121 125 148 147 144 143 144 144 144 143 147 147 147 146 130 131 + 122 114 150 150 144 144 145 148 145 144 147 147 147 144 86 130 + 116 30 85 96 92 75 81 86 90 91 94 101 101 66 81 134 + 129 18 18 17 15 22 22 21 21 21 23 21 19 19 83 123 + 129 18 15 17 18 22 23 20 22 23 24 22 23 24 84 130 + 119 19 56 56 50 51 51 41 42 42 37 37 45 47 84 136 + 122 55 146 144 146 148 146 146 139 142 142 145 149 114 85 130 + 124 57 147 145 145 149 146 148 146 148 148 148 149 89 79 133 + 136 32 140 150 150 150 147 148 148 149 148 150 143 38 104 125 + 141 38 46 134 151 149 149 148 148 149 150 133 56 21 124 134 + 155 93 17 24 75 93 105 94 86 77 50 25 21 38 145 118 + 143 141 51 19 24 22 22 19 24 25 23 25 19 113 148 125 + 140 150 137 50 19 20 20 22 23 21 20 18 102 148 145 125 + 138 149 153 149 95 50 28 21 25 36 74 131 148 146 147 129 + 136 136 141 139 138 142 137 133 136 136 137 140 131 134 138 119 + 80 92 102 95 92 87 77 80 98 95 87 81 78 74 82 85 + 114 120 135 132 135 135 132 131 133 134 133 134 135 136 122 120 + 113 106 137 133 134 134 133 134 133 134 134 133 135 132 79 116 + 103 28 75 79 73 55 60 63 69 76 76 81 84 56 77 117 + 112 8 8 7 6 8 10 8 8 7 10 8 7 9 78 119 + 114 8 7 7 6 8 10 9 8 10 11 10 10 8 80 121 + 109 8 47 47 43 42 39 34 34 30 28 28 38 42 77 123 + 108 45 136 136 136 138 138 136 136 135 134 136 139 106 82 116 + 113 47 135 134 134 136 138 136 138 137 137 137 141 80 81 125 + 124 24 131 138 137 139 138 137 139 139 139 139 133 32 99 115 + 129 29 44 125 139 139 141 140 138 140 142 121 43 10 114 125 + 137 79 9 16 58 84 93 84 77 61 39 12 11 31 138 118 + 130 131 39 10 12 9 7 7 9 11 11 10 12 111 140 118 + 132 138 120 39 8 10 10 11 11 11 9 10 96 140 140 115 + 132 139 140 132 89 37 17 10 16 28 66 123 141 140 140 122 + 124 129 127 128 125 128 125 118 121 128 128 127 126 127 132 118 + 104 120 131 122 119 113 103 106 124 119 115 109 102 101 109 113 + 138 148 166 166 168 168 164 162 167 165 166 169 167 166 150 147 + 137 132 166 165 167 164 164 165 165 166 167 169 167 161 107 147 + 127 53 101 107 94 76 82 86 90 97 95 102 106 68 101 146 + 127 21 16 13 10 13 16 16 16 15 16 15 17 19 108 139 + 125 20 11 11 13 13 14 13 16 15 16 17 17 16 105 143 + 135 23 66 66 65 66 61 56 57 50 48 47 58 63 103 149 + 134 75 163 166 166 167 166 165 163 164 165 167 171 139 119 137 + 131 76 165 167 168 170 172 171 171 171 170 172 173 107 107 147 + 140 53 156 171 170 173 172 174 173 173 172 176 163 54 126 146 + 151 54 64 156 169 172 173 174 175 174 174 145 59 29 144 153 + 163 107 18 34 82 108 118 113 103 83 57 23 17 53 166 140 + 159 158 62 19 21 17 15 15 19 18 21 17 23 138 173 147 + 159 172 151 63 17 20 18 22 21 19 15 21 124 174 172 147 + 157 172 173 163 114 60 36 26 33 50 97 158 179 177 176 151 + 155 155 154 158 153 153 142 138 143 153 157 159 156 157 162 134 + diff --git a/jsartoolkit5/examples/Data/multi/patt.f b/jsartoolkit5/examples/Data/multi/patt.f new file mode 100644 index 0000000..9dd7777 --- /dev/null +++ b/jsartoolkit5/examples/Data/multi/patt.f @@ -0,0 +1,196 @@ + 123 136 143 142 151 150 142 144 148 149 149 148 150 147 149 129 + 126 151 128 110 120 122 113 120 112 119 113 110 114 133 157 140 + 123 155 139 94 28 27 26 86 101 95 81 39 22 110 157 133 + 125 153 151 147 23 26 22 137 159 158 158 154 52 99 155 128 + 124 151 153 139 28 25 18 134 154 157 148 157 118 93 154 137 + 124 148 152 145 28 25 15 127 153 158 88 156 150 131 155 123 + 122 149 153 136 26 26 21 136 153 143 61 151 155 153 154 135 + 132 152 152 135 21 24 23 131 128 63 41 149 156 153 156 129 + 128 149 151 139 26 24 22 69 38 23 44 155 153 155 152 125 + 124 151 151 137 30 27 18 137 151 96 46 154 154 157 154 127 + 125 148 151 139 24 26 17 135 152 151 46 150 153 156 158 123 + 125 150 151 133 26 23 17 125 151 155 111 154 155 152 152 126 + 123 149 150 139 30 23 21 126 149 149 153 151 150 151 152 128 + 116 147 150 143 29 23 18 124 145 148 146 147 146 148 152 126 + 119 144 126 81 26 23 23 73 115 138 145 148 146 148 149 122 + 112 130 109 105 106 102 102 108 103 125 127 120 124 126 123 105 + 111 128 130 130 133 136 129 132 139 137 140 140 144 141 140 116 + 118 143 123 107 110 110 108 111 103 107 107 112 105 132 154 135 + 123 146 134 80 11 13 13 72 82 82 70 31 12 100 148 127 + 122 144 145 135 11 14 10 133 148 148 152 146 46 96 150 121 + 120 143 144 128 13 15 11 128 144 146 142 149 114 96 147 128 + 122 142 144 128 12 14 9 125 142 148 83 147 145 124 147 122 + 121 142 143 125 11 12 13 125 141 134 58 145 144 144 146 131 + 123 140 143 127 10 13 10 117 114 55 36 145 146 147 146 121 + 120 139 141 126 11 13 10 52 33 11 37 147 143 146 144 118 + 118 141 141 125 15 14 9 130 140 83 44 146 145 145 146 121 + 125 140 142 129 13 14 8 126 140 144 45 144 143 143 145 126 + 118 139 140 118 10 12 7 118 138 143 93 144 141 139 142 114 + 127 138 142 124 9 11 10 123 136 139 142 139 140 141 144 118 + 113 137 140 129 9 10 7 119 135 135 137 138 137 139 140 122 + 110 134 118 70 11 9 8 63 110 132 135 135 135 138 137 117 + 103 113 94 89 88 93 92 90 94 118 115 110 113 117 114 100 + 131 145 149 147 150 154 152 152 160 155 160 159 165 163 163 145 + 134 175 149 137 143 138 138 144 136 143 142 142 140 166 187 170 + 136 176 158 94 28 28 26 101 103 108 92 37 27 119 185 171 + 145 176 177 166 33 21 15 150 178 181 185 167 64 105 183 164 + 147 175 176 165 33 22 18 149 178 180 170 180 152 117 178 161 + 138 175 174 167 34 17 20 146 176 180 114 178 175 138 179 158 + 140 172 173 161 30 17 19 142 172 170 90 174 178 177 180 168 + 144 174 173 162 30 19 19 140 145 89 52 171 177 179 182 164 + 132 170 171 162 28 19 17 79 55 20 45 173 174 176 178 151 + 139 172 172 157 34 18 16 146 162 104 49 175 175 176 178 157 + 144 172 174 162 31 16 18 148 170 175 62 170 176 176 176 159 + 140 176 172 160 29 18 14 139 172 171 105 172 177 176 174 150 + 145 169 173 157 27 18 18 145 167 169 168 169 171 173 174 156 + 132 168 171 161 22 18 13 143 168 166 166 167 168 169 170 153 + 128 163 148 102 23 17 18 90 140 163 162 164 165 170 172 151 + 133 142 123 116 104 101 105 109 116 143 144 139 141 147 144 134 + + 129 140 133 128 137 123 135 129 125 127 123 126 128 126 122 105 + 149 157 157 155 154 155 154 156 152 154 158 152 152 152 149 123 + 147 133 110 99 93 131 153 153 155 157 156 152 151 148 148 126 + 150 114 22 52 118 150 155 156 153 154 153 155 150 146 146 124 + 148 110 39 154 157 156 151 149 155 154 150 154 151 147 148 120 + 149 113 81 158 148 88 61 41 44 46 46 111 153 146 145 127 + 149 119 95 158 157 158 143 63 23 96 151 155 149 148 138 125 + 148 112 101 159 154 153 153 128 38 151 152 151 149 145 115 103 + 144 120 86 137 134 127 136 131 69 137 135 125 126 124 73 108 + 142 113 26 22 18 15 21 23 22 18 17 17 21 18 23 102 + 150 122 27 26 25 25 26 24 24 27 26 23 23 23 23 102 + 151 120 28 23 28 28 26 21 26 30 24 26 30 29 26 106 + 142 110 94 147 139 145 136 135 139 137 139 133 139 143 81 105 + 143 128 139 151 153 152 153 152 151 151 151 151 150 150 126 109 + 136 151 155 153 151 148 149 152 149 151 148 150 149 147 144 130 + 123 126 123 125 124 124 122 132 128 124 125 125 123 116 119 112 + 116 135 127 121 128 122 131 121 118 121 126 114 118 122 117 100 + 140 154 148 150 147 147 146 146 144 146 145 142 144 140 137 114 + 141 132 100 96 96 124 144 147 146 145 143 139 141 139 138 117 + 144 105 12 46 114 145 144 146 143 145 143 141 140 137 135 113 + 140 112 31 146 149 147 145 145 147 146 144 144 139 138 135 110 + 140 107 70 152 142 83 58 36 37 44 45 93 142 137 135 115 + 137 107 82 148 146 148 134 55 11 83 144 143 139 135 132 118 + 139 103 82 148 144 142 141 114 33 140 140 138 136 135 110 94 + 132 111 72 133 128 125 125 117 52 130 126 118 123 119 63 90 + 129 108 13 10 11 9 13 10 10 9 8 7 10 7 8 92 + 136 110 13 14 15 14 12 13 13 14 14 12 11 10 9 93 + 133 110 11 11 13 12 11 10 11 15 13 10 9 9 11 88 + 130 107 80 135 128 128 125 127 126 125 129 118 124 129 70 89 + 130 123 134 145 144 144 143 143 141 141 142 140 142 140 118 94 + 128 143 146 144 143 142 142 140 139 141 140 139 138 137 134 113 + 111 118 123 122 120 122 121 123 120 118 125 118 127 113 110 103 + 145 170 171 164 161 158 168 164 151 157 159 150 156 153 151 134 + 163 187 185 183 178 179 180 182 178 178 176 174 174 170 172 144 + 163 166 119 105 117 138 177 179 176 176 176 176 173 169 170 147 + 165 140 27 64 152 175 178 177 174 175 176 177 171 168 165 141 + 159 142 37 167 180 178 174 171 173 175 170 172 169 167 164 139 + 160 142 92 185 170 114 90 52 45 49 62 105 168 166 162 144 + 155 143 108 181 180 180 170 89 20 104 175 171 169 166 163 143 + 160 136 103 178 178 176 172 145 55 162 170 172 167 168 140 116 + 152 144 101 150 149 146 142 140 79 146 148 139 145 143 90 109 + 152 138 26 15 18 20 19 19 17 16 18 14 18 13 18 105 + 154 138 28 21 22 17 17 19 19 18 16 18 18 18 17 101 + 150 143 28 33 33 34 30 30 28 34 31 29 27 22 23 104 + 147 137 94 166 165 167 161 162 162 157 162 160 157 161 102 116 + 149 149 158 177 176 174 173 173 171 172 174 172 173 171 148 123 + 145 175 176 176 175 175 172 174 170 172 172 176 169 168 163 142 + 131 134 136 145 147 138 140 144 132 139 144 140 145 132 128 133 + + 105 123 126 124 120 127 125 103 108 102 102 106 105 109 130 112 + 122 149 148 146 148 145 138 115 73 23 23 26 81 126 144 119 + 126 152 148 146 147 146 148 145 124 18 23 29 143 150 147 116 + 128 152 151 150 151 153 149 149 126 21 23 30 139 150 149 123 + 126 152 152 155 154 111 155 151 125 17 23 26 133 151 150 125 + 123 158 156 153 150 46 151 152 135 17 26 24 139 151 148 125 + 127 154 157 154 154 46 96 151 137 18 27 30 137 151 151 124 + 125 152 155 153 155 44 23 38 69 22 24 26 139 151 149 128 + 129 156 153 156 149 41 63 128 131 23 24 21 135 152 152 132 + 135 154 153 155 151 61 143 153 136 21 26 26 136 153 149 122 + 123 155 131 150 156 88 158 153 127 15 25 28 145 152 148 124 + 137 154 93 118 157 148 157 154 134 18 25 28 139 153 151 124 + 128 155 99 52 154 158 158 159 137 22 26 23 147 151 153 125 + 133 157 110 22 39 81 95 101 86 26 27 28 94 139 155 123 + 140 157 133 114 110 113 119 112 120 113 122 120 110 128 151 126 + 129 149 147 150 148 149 149 148 144 142 150 151 142 143 136 123 + 100 114 117 113 110 115 118 94 90 92 93 88 89 94 113 103 + 117 137 138 135 135 135 132 110 63 8 9 11 70 118 134 110 + 122 140 139 137 138 137 135 135 119 7 10 9 129 140 137 113 + 118 144 141 140 139 142 139 136 123 10 11 9 124 142 138 127 + 114 142 139 141 144 93 143 138 118 7 12 10 118 140 139 118 + 126 145 143 143 144 45 144 140 126 8 14 13 129 142 140 125 + 121 146 145 145 146 44 83 140 130 9 14 15 125 141 141 118 + 118 144 146 143 147 37 11 33 52 10 13 11 126 141 139 120 + 121 146 147 146 145 36 55 114 117 10 13 10 127 143 140 123 + 131 146 144 144 145 58 134 141 125 13 12 11 125 143 142 121 + 122 147 124 145 147 83 148 142 125 9 14 12 128 144 142 122 + 128 147 96 114 149 142 146 144 128 11 15 13 128 144 143 120 + 121 150 96 46 146 152 148 148 133 10 14 11 135 145 144 122 + 127 148 100 12 31 70 82 82 72 13 13 11 80 134 146 123 + 135 154 132 105 112 107 107 103 111 108 110 110 107 123 143 118 + 116 140 141 144 140 140 137 139 132 129 136 133 130 130 128 111 + 134 144 147 141 139 144 143 116 109 105 101 104 116 123 142 133 + 151 172 170 165 164 162 163 140 90 18 17 23 102 148 163 128 + 153 170 169 168 167 166 166 168 143 13 18 22 161 171 168 132 + 156 174 173 171 169 168 169 167 145 18 18 27 157 173 169 145 + 150 174 176 177 172 105 171 172 139 14 18 29 160 172 176 140 + 159 176 176 176 170 62 175 170 148 18 16 31 162 174 172 144 + 157 178 176 175 175 49 104 162 146 16 18 34 157 172 172 139 + 151 178 176 174 173 45 20 55 79 17 19 28 162 171 170 132 + 164 182 179 177 171 52 89 145 140 19 19 30 162 173 174 144 + 168 180 177 178 174 90 170 172 142 19 17 30 161 173 172 140 + 158 179 138 175 178 114 180 176 146 20 17 34 167 174 175 138 + 161 178 117 152 180 170 180 178 149 18 22 33 165 176 175 147 + 164 183 105 64 167 185 181 178 150 15 21 33 166 177 176 145 + 171 185 119 27 37 92 108 103 101 26 28 28 94 158 176 136 + 170 187 166 140 142 142 143 136 144 138 138 143 137 149 175 134 + 145 163 163 165 159 160 155 160 152 152 154 150 147 149 145 131 + + 112 119 116 123 125 125 124 128 132 122 124 124 125 123 126 123 + 130 144 147 149 150 148 151 149 152 149 148 151 153 155 151 136 + 109 126 150 150 151 151 151 151 152 153 152 153 151 139 128 143 + 105 81 143 139 133 139 137 139 135 136 145 139 147 94 110 142 + 106 26 29 30 26 24 30 26 21 26 28 28 23 28 120 151 + 102 23 23 23 23 26 27 24 24 26 25 25 26 27 122 150 + 102 23 18 21 17 17 18 22 23 21 15 18 22 26 113 142 + 108 73 124 126 125 135 137 69 131 136 127 134 137 86 120 144 + 103 115 145 149 151 152 151 38 128 153 153 154 159 101 112 148 + 125 138 148 149 155 151 96 23 63 143 158 157 158 95 119 149 + 127 145 146 153 111 46 46 44 41 61 88 148 158 81 113 149 + 120 148 147 151 154 150 154 155 149 151 156 157 154 39 110 148 + 124 146 146 150 155 153 154 153 156 155 150 118 52 22 114 150 + 126 148 148 151 152 156 157 155 153 153 131 93 99 110 133 147 + 123 149 152 152 152 158 154 152 156 154 155 154 155 157 157 149 + 105 122 126 128 126 123 127 125 129 135 123 137 128 133 140 129 + 103 110 113 127 118 125 118 120 123 121 122 120 122 123 118 111 + 113 134 137 138 139 140 141 139 140 142 142 143 144 146 143 128 + 94 118 140 142 140 142 141 141 143 143 144 144 145 134 123 130 + 89 70 129 124 118 129 125 126 127 125 128 128 135 80 107 130 + 88 11 9 9 10 13 15 11 10 11 12 13 11 11 110 133 + 93 9 10 11 12 14 14 13 13 12 14 15 14 13 110 136 + 92 8 7 10 7 8 9 10 10 13 9 11 10 13 108 129 + 90 63 119 123 118 126 130 52 117 125 125 128 133 72 111 132 + 94 110 135 136 138 140 140 33 114 141 142 144 148 82 103 139 + 118 132 135 139 143 144 83 11 55 134 148 146 148 82 107 137 + 115 135 137 142 93 45 44 37 36 58 83 142 152 70 107 140 + 110 135 138 139 144 144 146 147 145 145 147 149 146 31 112 140 + 113 135 137 140 141 143 145 143 146 144 145 114 46 12 105 144 + 117 138 139 141 139 143 145 146 147 144 124 96 96 100 132 141 + 114 137 140 144 142 145 146 144 146 146 147 147 150 148 154 140 + 100 117 122 118 114 126 121 118 121 131 122 128 121 127 135 116 + 133 128 132 145 140 144 139 132 144 140 138 147 145 136 134 131 + 142 163 168 169 176 172 172 170 174 172 175 175 176 176 175 145 + 123 148 171 173 172 174 172 171 173 173 174 176 177 158 149 149 + 116 102 161 157 160 162 157 162 162 161 167 165 166 94 137 147 + 104 23 22 27 29 31 34 28 30 30 34 33 33 28 143 150 + 101 17 18 18 18 16 18 19 19 17 17 22 21 28 138 154 + 105 18 13 18 14 18 16 17 19 19 20 18 15 26 138 152 + 109 90 143 145 139 148 146 79 140 142 146 149 150 101 144 152 + 116 140 168 167 172 170 162 55 145 172 176 178 178 103 136 160 + 143 163 166 169 171 175 104 20 89 170 180 180 181 108 143 155 + 144 162 166 168 105 62 49 45 52 90 114 170 185 92 142 160 + 139 164 167 169 172 170 175 173 171 174 178 180 167 37 142 159 + 141 165 168 171 177 176 175 174 177 178 175 152 64 27 140 165 + 147 170 169 173 176 176 176 176 179 177 138 117 105 119 166 163 + 144 172 170 174 174 176 178 178 182 180 179 178 183 185 187 163 + 134 151 153 156 150 159 157 151 164 168 158 161 164 171 170 145 + diff --git a/jsartoolkit5/examples/Data/multi/patt.g b/jsartoolkit5/examples/Data/multi/patt.g new file mode 100644 index 0000000..51a7259 --- /dev/null +++ b/jsartoolkit5/examples/Data/multi/patt.g @@ -0,0 +1,196 @@ + 145 150 162 167 159 167 161 157 159 169 165 155 156 157 152 145 + 153 164 164 167 173 147 119 88 90 83 114 139 164 138 145 141 + 145 160 163 154 98 48 54 126 138 158 117 57 73 45 134 148 + 144 157 141 52 36 65 157 170 169 171 175 155 79 36 150 155 + 145 162 63 49 40 122 171 170 169 167 171 173 164 49 156 153 + 148 125 38 45 61 164 166 165 166 168 172 170 169 111 147 136 + 138 71 43 41 86 164 165 166 164 165 165 165 167 161 165 143 + 160 54 41 37 93 166 163 165 165 166 164 166 165 165 171 152 + 148 48 38 38 90 162 163 166 166 166 167 165 164 167 171 161 + 158 37 41 43 79 162 162 162 164 113 110 102 119 112 115 123 + 155 46 45 42 69 164 163 161 163 163 112 32 39 32 107 149 + 160 94 39 41 44 155 161 160 162 165 143 37 47 44 140 155 + 158 162 45 34 34 149 162 159 161 165 149 39 49 45 164 149 + 151 168 154 58 25 74 159 159 161 166 161 52 43 33 158 136 + 149 163 169 149 60 24 65 128 144 133 117 39 37 50 160 139 + 142 167 152 161 167 133 99 68 66 78 100 133 133 168 170 145 + 127 137 149 149 145 149 152 151 146 152 150 146 155 148 141 134 + 136 153 155 156 156 137 110 84 89 92 113 139 157 138 145 131 + 131 150 153 144 84 34 47 116 130 144 113 71 65 34 132 137 + 130 149 131 43 21 51 148 162 161 162 165 151 74 31 140 143 + 130 147 52 27 23 109 158 158 160 159 161 164 152 41 146 141 + 131 113 24 27 45 157 154 156 158 159 161 163 165 100 140 129 + 129 62 22 23 68 154 154 155 156 157 159 160 162 155 157 137 + 147 38 23 25 79 155 153 154 155 158 156 156 161 158 163 147 + 132 24 23 18 78 153 153 153 156 156 159 158 159 161 163 144 + 135 19 24 20 67 151 150 152 156 118 101 98 109 108 109 109 + 144 32 25 25 51 150 152 153 154 155 108 22 23 19 95 133 + 144 79 19 22 25 147 150 151 153 153 140 26 29 26 128 144 + 139 141 25 19 16 131 149 151 149 155 142 27 29 25 148 139 + 138 154 126 33 15 65 146 148 150 154 148 28 26 20 139 128 + 134 151 155 134 46 12 57 115 139 122 108 21 27 42 140 133 + 129 150 138 147 154 122 77 60 65 61 71 105 122 157 160 136 + 152 169 183 184 176 180 177 176 178 183 180 174 182 182 175 170 + 173 190 190 194 191 167 140 128 130 126 152 171 192 176 180 172 + 166 188 190 177 121 65 72 147 169 176 149 109 103 63 153 178 + 163 187 170 80 35 67 178 197 197 200 202 183 110 50 165 181 + 161 184 87 39 38 130 192 196 196 198 201 204 187 76 176 178 + 161 150 36 36 67 184 193 195 196 196 201 201 204 150 175 161 + 161 94 34 34 89 191 193 193 195 196 199 200 202 194 193 171 + 179 68 32 31 96 193 191 193 195 194 196 194 200 199 203 183 + 170 56 33 29 96 189 193 192 195 194 195 192 194 196 199 181 + 172 39 35 35 96 189 191 190 195 153 143 138 144 141 137 145 + 171 58 35 32 76 186 189 189 195 188 138 51 42 40 118 166 + 173 108 36 31 42 176 187 189 192 196 174 57 44 44 156 179 + 166 179 53 32 36 165 186 187 191 191 178 54 38 45 181 177 + 164 191 166 61 30 86 178 183 188 192 184 62 38 40 171 164 + 156 188 193 166 78 38 84 152 170 156 144 50 46 79 180 169 + 144 182 173 181 186 140 101 86 91 98 104 130 141 178 191 168 + + 145 141 148 155 153 136 143 152 161 123 149 155 149 136 139 145 + 152 145 134 150 156 147 165 171 171 115 107 140 164 158 160 170 + 157 138 45 36 49 111 161 165 167 112 32 44 45 33 50 168 + 156 164 73 79 164 169 167 165 164 119 39 47 49 43 37 133 + 155 139 57 155 173 170 165 166 165 102 32 37 39 52 39 133 + 165 114 117 175 171 172 165 164 167 110 112 143 149 161 117 100 + 169 83 158 171 167 168 165 166 166 113 163 165 165 166 133 78 + 159 90 138 169 169 166 164 165 166 164 163 162 161 161 144 66 + 157 88 126 170 170 165 166 165 166 162 161 160 159 159 128 68 + 161 119 54 157 171 166 165 163 163 162 163 161 162 159 65 99 + 167 147 48 65 122 164 164 166 162 162 164 155 149 74 24 133 + 159 173 98 36 40 61 86 93 90 79 69 44 34 25 60 167 + 167 167 154 52 49 45 41 37 38 43 42 41 34 58 149 161 + 162 164 163 141 63 38 43 41 38 41 45 39 45 154 169 152 + 150 164 160 157 162 125 71 54 48 37 46 94 162 168 163 167 + 145 153 145 144 145 148 138 160 148 158 155 160 158 151 149 142 + 134 131 137 143 141 129 137 147 144 109 133 144 139 128 133 136 + 141 145 132 140 146 140 157 163 163 109 95 128 148 139 140 160 + 148 138 34 31 41 100 155 158 161 108 19 26 25 20 42 157 + 155 157 65 74 152 165 162 161 159 109 23 29 29 26 27 122 + 146 139 71 151 164 163 160 156 158 98 22 26 27 28 21 105 + 150 113 113 165 161 161 159 156 159 101 108 140 142 148 108 71 + 152 92 144 162 159 159 157 158 156 118 155 153 155 154 122 61 + 146 89 130 161 160 158 156 155 156 156 154 153 149 150 139 65 + 151 84 116 162 158 156 155 154 153 152 153 151 151 148 115 60 + 152 110 47 148 158 154 154 153 153 150 152 150 149 146 57 77 + 149 137 34 51 109 157 154 155 153 151 150 147 131 65 12 122 + 145 156 84 21 23 45 68 79 78 67 51 25 16 15 46 154 + 149 156 144 43 27 27 23 25 18 20 25 22 19 33 134 147 + 149 155 153 131 52 24 22 23 23 24 25 19 25 126 155 138 + 137 153 150 149 147 113 62 38 24 19 32 79 141 154 151 150 + 127 136 131 130 130 131 129 147 132 135 144 144 139 138 134 129 + 170 172 178 181 178 161 171 183 181 145 166 179 177 164 169 168 + 175 180 153 165 176 175 193 203 199 137 118 156 181 171 180 191 + 182 176 63 50 76 150 194 199 196 141 40 44 45 40 79 178 + 182 192 103 110 187 204 202 200 194 144 42 44 38 38 46 141 + 174 171 109 183 204 201 200 194 192 138 51 57 54 62 50 130 + 180 152 149 202 201 201 199 196 195 143 138 174 178 184 144 104 + 183 126 176 200 198 196 196 194 194 153 188 196 191 192 156 98 + 178 130 169 197 196 196 195 195 195 195 195 192 191 188 170 91 + 176 128 147 197 196 195 193 193 192 190 189 189 187 183 152 86 + 177 140 72 178 192 193 193 191 193 191 189 187 186 178 84 101 + 180 167 65 67 130 184 191 193 189 189 186 176 165 86 38 140 + 176 191 121 35 38 67 89 96 96 96 76 42 36 30 78 186 + 184 194 177 80 39 36 34 31 29 35 32 31 32 61 166 181 + 183 190 190 170 87 36 34 32 33 35 35 36 53 166 193 173 + 169 190 188 187 184 150 94 68 56 39 58 108 179 191 188 182 + 152 173 166 163 161 161 161 179 170 172 171 173 166 164 156 144 + + 145 170 168 133 133 100 78 66 68 99 133 167 161 152 167 142 + 139 160 50 37 39 117 133 144 128 65 24 60 149 169 163 149 + 136 158 33 43 52 161 166 161 159 159 74 25 58 154 168 151 + 149 164 45 49 39 149 165 161 159 162 149 34 34 45 162 158 + 155 140 44 47 37 143 165 162 160 161 155 44 41 39 94 160 + 149 107 32 39 32 112 163 163 161 163 164 69 42 45 46 155 + 123 115 112 119 102 110 113 164 162 162 162 79 43 41 37 158 + 161 171 167 164 165 167 166 166 166 163 162 90 38 38 48 148 + 152 171 165 165 166 164 166 165 165 163 166 93 37 41 54 160 + 143 165 161 167 165 165 165 164 166 165 164 86 41 43 71 138 + 136 147 111 169 170 172 168 166 165 166 164 61 45 38 125 148 + 153 156 49 164 173 171 167 169 170 171 122 40 49 63 162 145 + 155 150 36 79 155 175 171 169 170 157 65 36 52 141 157 144 + 148 134 45 73 57 117 158 138 126 54 48 98 154 163 160 145 + 141 145 138 164 139 114 83 90 88 119 147 173 167 164 164 153 + 145 152 157 156 155 165 169 159 157 161 167 159 167 162 150 145 + 136 160 157 122 105 71 61 65 60 77 122 154 147 138 150 129 + 133 140 42 27 21 108 122 139 115 57 12 46 134 155 151 134 + 128 139 20 26 28 148 154 150 148 146 65 15 33 126 154 138 + 139 148 25 29 27 142 155 149 151 149 131 16 19 25 141 139 + 144 128 26 29 26 140 153 153 151 150 147 25 22 19 79 144 + 133 95 19 23 22 108 155 154 153 152 150 51 25 25 32 144 + 109 109 108 109 98 101 118 156 152 150 151 67 20 24 19 135 + 144 163 161 159 158 159 156 156 153 153 153 78 18 23 24 132 + 147 163 158 161 156 156 158 155 154 153 155 79 25 23 38 147 + 137 157 155 162 160 159 157 156 155 154 154 68 23 22 62 129 + 129 140 100 165 163 161 159 158 156 154 157 45 27 24 113 131 + 141 146 41 152 164 161 159 160 158 158 109 23 27 52 147 130 + 143 140 31 74 151 165 162 161 162 148 51 21 43 131 149 130 + 137 132 34 65 71 113 144 130 116 47 34 84 144 153 150 131 + 131 145 138 157 139 113 92 89 84 110 137 156 156 155 153 136 + 134 141 148 155 146 150 152 146 151 152 149 145 149 149 137 127 + 168 191 178 141 130 104 98 91 86 101 140 186 181 173 182 144 + 169 180 79 46 50 144 156 170 152 84 38 78 166 193 188 156 + 164 171 40 38 62 184 192 188 183 178 86 30 61 166 191 164 + 177 181 45 38 54 178 191 191 187 186 165 36 32 53 179 166 + 179 156 44 44 57 174 196 192 189 187 176 42 31 36 108 173 + 166 118 40 42 51 138 188 195 189 189 186 76 32 35 58 171 + 145 137 141 144 138 143 153 195 190 191 189 96 35 35 39 172 + 181 199 196 194 192 195 194 195 192 193 189 96 29 33 56 170 + 183 203 199 200 194 196 194 195 193 191 193 96 31 32 68 179 + 171 193 194 202 200 199 196 195 193 193 191 89 34 34 94 161 + 161 175 150 204 201 201 196 196 195 193 184 67 36 36 150 161 + 178 176 76 187 204 201 198 196 196 192 130 38 39 87 184 161 + 181 165 50 110 183 202 200 197 197 178 67 35 80 170 187 163 + 178 153 63 103 109 149 176 169 147 72 65 121 177 190 188 166 + 172 180 176 192 171 152 126 130 128 140 167 191 194 190 190 173 + 170 175 182 182 174 180 183 178 176 177 180 176 184 183 169 152 + + 142 149 151 158 160 155 158 148 160 138 148 145 144 145 153 145 + 167 163 168 162 94 46 37 48 54 71 125 162 157 160 164 150 + 152 169 154 45 39 45 41 38 41 43 38 63 141 163 164 162 + 161 149 58 34 41 42 43 38 37 41 45 49 52 154 167 167 + 167 60 25 34 44 69 79 90 93 86 61 40 36 98 173 159 + 133 24 74 149 155 164 162 162 166 164 164 122 65 48 147 167 + 99 65 159 162 161 163 162 163 163 165 166 171 157 54 119 161 + 68 128 159 159 160 161 162 166 165 166 165 170 170 126 88 157 + 66 144 161 161 162 163 164 166 165 164 166 169 169 138 90 159 + 78 133 166 165 165 163 113 166 166 165 168 167 171 158 83 169 + 100 117 161 149 143 112 110 167 164 165 172 171 175 117 114 165 + 133 39 52 39 37 32 102 165 166 165 170 173 155 57 139 155 + 133 37 43 49 47 39 119 164 165 167 169 164 79 73 164 156 + 168 50 33 45 44 32 112 167 165 161 111 49 36 45 138 157 + 170 160 158 164 140 107 115 171 171 165 147 156 150 134 145 152 + 145 139 136 149 155 149 123 161 152 143 136 153 155 148 141 145 + 129 134 138 139 144 144 135 132 147 129 131 130 130 131 136 127 + 150 151 154 141 79 32 19 24 38 62 113 147 149 150 153 137 + 138 155 126 25 19 25 24 23 23 22 24 52 131 153 155 149 + 147 134 33 19 22 25 20 18 25 23 27 27 43 144 156 149 + 154 46 15 16 25 51 67 78 79 68 45 23 21 84 156 145 + 122 12 65 131 147 150 151 153 155 154 157 109 51 34 137 149 + 77 57 146 149 150 152 150 153 153 154 154 158 148 47 110 152 + 60 115 148 151 151 153 152 153 154 155 156 158 162 116 84 151 + 65 139 150 149 153 154 156 156 155 156 158 160 161 130 89 146 + 61 122 154 155 153 155 118 156 158 157 159 159 162 144 92 152 + 71 108 148 142 140 108 101 159 156 159 161 161 165 113 113 150 + 105 21 28 27 26 22 98 158 156 160 163 164 151 71 139 146 + 122 27 26 29 29 23 109 159 161 162 165 152 74 65 157 155 + 157 42 20 25 26 19 108 161 158 155 100 41 31 34 138 148 + 160 140 139 148 128 95 109 163 163 157 140 146 140 132 145 141 + 136 133 128 139 144 133 109 144 147 137 129 141 143 137 131 134 + 144 156 164 166 173 171 172 170 179 161 161 161 163 166 173 152 + 182 188 191 179 108 58 39 56 68 94 150 184 187 188 190 169 + 173 193 166 53 36 35 35 33 32 34 36 87 170 190 190 183 + 181 166 61 32 31 32 35 29 31 34 36 39 80 177 194 184 + 186 78 30 36 42 76 96 96 96 89 67 38 35 121 191 176 + 140 38 86 165 176 186 189 189 193 191 184 130 67 65 167 180 + 101 84 178 186 187 189 191 193 191 193 193 192 178 72 140 177 + 86 152 183 187 189 189 190 192 193 193 195 196 197 147 128 176 + 91 170 188 191 192 195 195 195 195 195 196 196 197 169 130 178 + 98 156 192 191 196 188 153 194 194 196 196 198 200 176 126 183 + 104 144 184 178 174 138 143 195 196 199 201 201 202 149 152 180 + 130 50 62 54 57 51 138 192 194 200 201 204 183 109 171 174 + 141 46 38 38 44 42 144 194 200 202 204 187 110 103 192 182 + 178 79 40 45 44 40 141 196 199 194 150 76 50 63 176 182 + 191 180 171 181 156 118 137 199 203 193 175 176 165 153 180 175 + 168 169 164 177 179 166 145 181 183 171 161 178 181 178 172 170 + diff --git a/jsartoolkit5/examples/Data/output_4.ogg b/jsartoolkit5/examples/Data/output_4.ogg new file mode 100644 index 0000000..1283fd7 Binary files /dev/null and b/jsartoolkit5/examples/Data/output_4.ogg differ diff --git a/jsartoolkit5/examples/Data/patt.hiro b/jsartoolkit5/examples/Data/patt.hiro new file mode 100755 index 0000000..7f78e3c --- /dev/null +++ b/jsartoolkit5/examples/Data/patt.hiro @@ -0,0 +1,196 @@ + 234 235 240 233 240 234 240 235 240 237 240 238 240 240 240 232 + 229 240 240 240 240 240 240 240 240 240 240 240 240 240 240 228 + 227 240 240 240 240 240 240 240 240 240 240 240 240 240 240 239 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 236 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 234 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 236 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 231 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 229 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 225 149 240 240 186 216 225 174 240 240 240 237 238 240 240 240 + 150 107 238 231 75 208 115 147 238 228 223 226 237 180 226 240 + 150 62 181 213 62 187 113 169 197 72 29 237 120 50 53 207 + 149 63 47 78 53 184 113 101 142 5 150 150 45 217 186 83 + 121 84 220 222 58 180 121 92 128 109 237 124 155 232 161 64 + 149 71 240 240 76 210 98 109 122 108 240 129 51 119 161 155 + 149 186 240 240 98 219 135 152 207 191 236 227 152 77 175 209 + 235 235 240 233 240 234 240 235 240 236 240 238 240 240 240 240 + 229 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 227 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 236 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 234 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 236 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 232 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 229 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 225 156 240 240 186 216 225 186 240 240 240 240 240 240 240 240 + 150 117 240 231 72 206 115 162 240 232 223 237 240 180 226 240 + 150 74 187 213 51 184 103 168 197 78 29 237 120 50 53 216 + 144 77 51 74 61 184 106 101 142 5 150 152 52 217 186 85 + 117 89 219 219 65 184 121 92 128 100 236 125 156 240 170 73 + 148 71 240 240 76 210 109 109 121 99 240 137 51 120 166 164 + 140 186 240 240 98 220 150 156 207 192 236 230 152 77 176 212 + 234 235 240 233 240 234 240 235 240 236 240 238 240 240 240 233 + 229 240 240 240 240 240 240 240 240 240 240 240 240 240 240 239 + 227 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 234 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 232 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 235 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 232 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 228 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 225 156 240 240 182 212 225 180 240 240 240 240 240 240 240 240 + 150 116 238 228 66 205 115 151 238 236 225 240 240 180 226 240 + 156 84 186 211 47 184 109 170 200 92 30 240 120 50 53 216 + 147 83 51 73 50 184 106 110 148 17 151 150 45 217 186 85 + 127 98 219 219 58 179 109 101 128 107 237 125 155 240 163 72 + 155 86 240 240 76 201 85 108 121 95 232 137 51 118 153 155 + 149 189 240 240 98 220 141 154 206 178 235 230 152 77 175 209 + + 232 228 239 240 240 240 240 240 240 240 240 207 83 64 155 209 + 240 240 240 240 240 240 240 240 240 240 226 53 186 161 161 175 + 240 240 240 240 240 240 240 240 240 240 180 50 217 232 119 77 + 240 240 240 240 240 240 240 240 240 238 237 120 45 155 51 152 + 238 240 240 240 240 240 240 240 240 237 226 237 150 124 129 227 + 240 240 240 240 240 240 240 240 240 240 223 29 150 237 240 236 + 237 240 240 240 240 240 240 240 240 240 228 72 5 109 108 191 + 240 240 240 240 240 240 240 240 240 240 238 197 142 128 122 207 + 235 240 240 240 240 240 240 240 240 174 147 169 101 92 109 152 + 240 240 240 240 240 240 240 240 240 225 115 113 113 121 98 135 + 234 240 240 240 240 240 240 240 240 216 208 187 184 180 210 219 + 240 240 240 240 240 240 240 240 240 186 75 62 53 58 76 98 + 233 240 240 240 240 240 240 240 240 240 231 213 78 222 240 240 + 240 240 240 240 240 240 240 240 240 240 238 181 47 220 240 240 + 235 240 240 240 240 240 240 240 240 149 107 62 63 84 71 186 + 234 229 227 240 236 234 236 231 229 225 150 150 149 121 149 149 + 240 240 240 240 240 240 240 240 240 240 240 216 85 73 164 212 + 240 240 240 240 240 240 240 240 240 240 226 53 186 170 166 176 + 240 240 240 240 240 240 240 240 240 240 180 50 217 240 120 77 + 240 240 240 240 240 240 240 240 240 240 240 120 52 156 51 152 + 238 240 240 240 240 240 240 240 240 240 237 237 152 125 137 230 + 240 240 240 240 240 240 240 240 240 240 223 29 150 236 240 236 + 236 240 240 240 240 240 240 240 240 240 232 78 5 100 99 192 + 240 240 240 240 240 240 240 240 240 240 240 197 142 128 121 207 + 235 240 240 240 240 240 240 240 240 186 162 168 101 92 109 156 + 240 240 240 240 240 240 240 240 240 225 115 103 106 121 109 150 + 234 240 240 240 240 240 240 240 240 216 206 184 184 184 210 220 + 240 240 240 240 240 240 240 240 240 186 72 51 61 65 76 98 + 233 240 240 240 240 240 240 240 240 240 231 213 74 219 240 240 + 240 240 240 240 240 240 240 240 240 240 240 187 51 219 240 240 + 235 240 240 240 240 240 240 240 240 156 117 74 77 89 71 186 + 235 229 227 240 236 234 236 232 229 225 150 150 144 117 148 140 + 233 239 240 240 240 240 240 240 240 240 240 216 85 72 155 209 + 240 240 240 240 240 240 240 240 240 240 226 53 186 163 153 175 + 240 240 240 240 240 240 240 240 240 240 180 50 217 240 118 77 + 240 240 240 240 240 240 240 240 240 240 240 120 45 155 51 152 + 238 240 240 240 240 240 240 240 240 240 240 240 150 125 137 230 + 240 240 240 240 240 240 240 240 240 240 225 30 151 237 232 235 + 236 240 240 240 240 240 240 240 240 240 236 92 17 107 95 178 + 240 240 240 240 240 240 240 240 240 240 238 200 148 128 121 206 + 235 240 240 240 240 240 240 240 240 180 151 170 110 101 108 154 + 240 240 240 240 240 240 240 240 240 225 115 109 106 109 85 141 + 234 240 240 240 240 240 240 240 240 212 205 184 184 179 201 220 + 240 240 240 240 240 240 240 240 240 182 66 47 50 58 76 98 + 233 240 240 240 240 240 240 240 240 240 228 211 73 219 240 240 + 240 240 240 240 240 240 240 240 240 240 238 186 51 219 240 240 + 235 240 240 240 240 240 240 240 240 156 116 84 83 98 86 189 + 234 229 227 240 234 232 235 232 228 225 150 156 147 127 155 149 + + 209 175 77 152 227 236 191 207 152 135 219 98 240 240 186 149 + 155 161 119 51 129 240 108 122 109 98 210 76 240 240 71 149 + 64 161 232 155 124 237 109 128 92 121 180 58 222 220 84 121 + 83 186 217 45 150 150 5 142 101 113 184 53 78 47 63 149 + 207 53 50 120 237 29 72 197 169 113 187 62 213 181 62 150 + 240 226 180 237 226 223 228 238 147 115 208 75 231 238 107 150 + 240 240 240 238 237 240 240 240 174 225 216 186 240 240 149 225 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 229 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 231 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 236 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 234 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 236 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 239 240 240 240 240 240 240 240 240 240 240 240 240 240 240 227 + 228 240 240 240 240 240 240 240 240 240 240 240 240 240 240 229 + 232 240 240 240 238 240 237 240 235 240 234 240 233 240 235 234 + 212 176 77 152 230 236 192 207 156 150 220 98 240 240 186 140 + 164 166 120 51 137 240 99 121 109 109 210 76 240 240 71 148 + 73 170 240 156 125 236 100 128 92 121 184 65 219 219 89 117 + 85 186 217 52 152 150 5 142 101 106 184 61 74 51 77 144 + 216 53 50 120 237 29 78 197 168 103 184 51 213 187 74 150 + 240 226 180 240 237 223 232 240 162 115 206 72 231 240 117 150 + 240 240 240 240 240 240 240 240 186 225 216 186 240 240 156 225 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 229 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 232 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 236 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 234 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 236 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 227 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 229 + 240 240 240 240 238 240 236 240 235 240 234 240 233 240 235 235 + 209 175 77 152 230 235 178 206 154 141 220 98 240 240 189 149 + 155 153 118 51 137 232 95 121 108 85 201 76 240 240 86 155 + 72 163 240 155 125 237 107 128 101 109 179 58 219 219 98 127 + 85 186 217 45 150 151 17 148 110 106 184 50 73 51 83 147 + 216 53 50 120 240 30 92 200 170 109 184 47 211 186 84 156 + 240 226 180 240 240 225 236 238 151 115 205 66 228 238 116 150 + 240 240 240 240 240 240 240 240 180 225 212 182 240 240 156 225 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 228 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 232 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 235 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 232 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 234 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 + 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 227 + 239 240 240 240 240 240 240 240 240 240 240 240 240 240 240 229 + 233 240 240 240 238 240 236 240 235 240 234 240 233 240 235 234 + + 149 149 121 149 150 150 225 229 231 236 234 236 240 227 229 234 + 186 71 84 63 62 107 149 240 240 240 240 240 240 240 240 235 + 240 240 220 47 181 238 240 240 240 240 240 240 240 240 240 240 + 240 240 222 78 213 231 240 240 240 240 240 240 240 240 240 233 + 98 76 58 53 62 75 186 240 240 240 240 240 240 240 240 240 + 219 210 180 184 187 208 216 240 240 240 240 240 240 240 240 234 + 135 98 121 113 113 115 225 240 240 240 240 240 240 240 240 240 + 152 109 92 101 169 147 174 240 240 240 240 240 240 240 240 235 + 207 122 128 142 197 238 240 240 240 240 240 240 240 240 240 240 + 191 108 109 5 72 228 240 240 240 240 240 240 240 240 240 237 + 236 240 237 150 29 223 240 240 240 240 240 240 240 240 240 240 + 227 129 124 150 237 226 237 240 240 240 240 240 240 240 240 238 + 152 51 155 45 120 237 238 240 240 240 240 240 240 240 240 240 + 77 119 232 217 50 180 240 240 240 240 240 240 240 240 240 240 + 175 161 161 186 53 226 240 240 240 240 240 240 240 240 240 240 + 209 155 64 83 207 240 240 240 240 240 240 240 240 239 228 232 + 140 148 117 144 150 150 225 229 232 236 234 236 240 227 229 235 + 186 71 89 77 74 117 156 240 240 240 240 240 240 240 240 235 + 240 240 219 51 187 240 240 240 240 240 240 240 240 240 240 240 + 240 240 219 74 213 231 240 240 240 240 240 240 240 240 240 233 + 98 76 65 61 51 72 186 240 240 240 240 240 240 240 240 240 + 220 210 184 184 184 206 216 240 240 240 240 240 240 240 240 234 + 150 109 121 106 103 115 225 240 240 240 240 240 240 240 240 240 + 156 109 92 101 168 162 186 240 240 240 240 240 240 240 240 235 + 207 121 128 142 197 240 240 240 240 240 240 240 240 240 240 240 + 192 99 100 5 78 232 240 240 240 240 240 240 240 240 240 236 + 236 240 236 150 29 223 240 240 240 240 240 240 240 240 240 240 + 230 137 125 152 237 237 240 240 240 240 240 240 240 240 240 238 + 152 51 156 52 120 240 240 240 240 240 240 240 240 240 240 240 + 77 120 240 217 50 180 240 240 240 240 240 240 240 240 240 240 + 176 166 170 186 53 226 240 240 240 240 240 240 240 240 240 240 + 212 164 73 85 216 240 240 240 240 240 240 240 240 240 240 240 + 149 155 127 147 156 150 225 228 232 235 232 234 240 227 229 234 + 189 86 98 83 84 116 156 240 240 240 240 240 240 240 240 235 + 240 240 219 51 186 238 240 240 240 240 240 240 240 240 240 240 + 240 240 219 73 211 228 240 240 240 240 240 240 240 240 240 233 + 98 76 58 50 47 66 182 240 240 240 240 240 240 240 240 240 + 220 201 179 184 184 205 212 240 240 240 240 240 240 240 240 234 + 141 85 109 106 109 115 225 240 240 240 240 240 240 240 240 240 + 154 108 101 110 170 151 180 240 240 240 240 240 240 240 240 235 + 206 121 128 148 200 238 240 240 240 240 240 240 240 240 240 240 + 178 95 107 17 92 236 240 240 240 240 240 240 240 240 240 236 + 235 232 237 151 30 225 240 240 240 240 240 240 240 240 240 240 + 230 137 125 150 240 240 240 240 240 240 240 240 240 240 240 238 + 152 51 155 45 120 240 240 240 240 240 240 240 240 240 240 240 + 77 118 240 217 50 180 240 240 240 240 240 240 240 240 240 240 + 175 153 163 186 53 226 240 240 240 240 240 240 240 240 240 240 + 209 155 72 85 216 240 240 240 240 240 240 240 240 240 239 233 + diff --git a/jsartoolkit5/examples/Data/patt.kanji b/jsartoolkit5/examples/Data/patt.kanji new file mode 100755 index 0000000..87d32bb --- /dev/null +++ b/jsartoolkit5/examples/Data/patt.kanji @@ -0,0 +1,196 @@ + 214 225 240 225 214 240 216 204 214 227 181 192 198 192 181 192 + 240 240 240 240 240 240 225 232 240 240 240 240 240 240 240 236 + 240 240 240 240 240 240 75 128 220 240 240 240 240 240 240 240 + 240 240 240 240 240 240 106 53 240 240 240 240 240 240 240 237 + 240 240 240 240 240 238 118 31 240 240 240 240 240 240 240 234 + 240 240 240 240 240 240 74 49 207 240 240 240 240 240 240 240 + 240 240 240 240 240 240 53 54 177 240 240 240 240 240 240 240 + 240 240 240 240 240 240 64 31 130 240 240 240 240 240 240 219 + 240 240 240 240 240 180 37 57 78 228 240 240 240 240 240 240 + 240 240 240 240 240 118 62 157 36 185 240 240 240 240 240 231 + 240 240 240 240 240 82 65 225 67 80 230 240 240 240 240 217 + 240 240 240 225 53 76 225 240 156 62 158 240 240 240 240 226 + 240 240 199 61 9 111 235 240 240 104 58 174 228 240 240 240 + 240 142 64 26 92 227 240 240 240 229 93 64 170 226 238 216 + 90 26 12 156 240 240 240 240 240 240 204 95 30 117 192 200 + 156 16 195 233 235 240 236 240 238 239 240 186 93 53 120 237 + 214 226 240 225 212 240 216 204 212 226 181 192 198 192 185 194 + 240 240 240 240 240 240 227 232 240 240 240 240 240 240 240 238 + 240 240 240 240 240 240 95 138 225 240 240 240 240 240 240 240 + 240 240 240 240 240 240 108 59 240 240 240 240 240 240 240 237 + 240 240 240 240 240 238 118 31 240 240 240 240 240 240 240 234 + 240 240 240 240 240 240 83 47 207 240 240 240 240 240 240 240 + 240 240 240 240 240 240 56 49 177 240 240 240 240 240 240 240 + 240 240 240 240 240 240 73 41 130 240 240 240 240 240 240 222 + 240 240 240 240 240 185 46 49 86 230 240 240 240 240 240 240 + 240 240 240 240 240 118 58 165 45 192 240 240 240 240 240 234 + 240 240 240 240 240 91 63 222 74 82 240 240 240 240 240 222 + 240 240 240 226 66 86 225 240 158 63 162 240 240 240 240 228 + 240 240 202 76 11 103 235 240 234 91 49 174 228 240 240 240 + 240 142 68 16 91 226 240 240 240 228 96 74 178 233 239 222 + 90 26 4 150 240 240 240 240 240 240 213 109 46 133 204 213 + 156 14 195 234 236 240 237 240 239 240 240 192 106 57 125 238 + 214 226 240 225 212 240 216 204 214 227 181 192 198 192 184 192 + 240 240 240 240 240 240 226 232 240 240 240 240 240 240 240 236 + 240 240 240 240 240 240 85 134 220 240 240 240 240 240 240 240 + 240 240 240 240 240 240 107 58 240 240 240 240 240 240 240 237 + 240 240 240 240 240 238 118 32 240 240 240 240 240 240 240 234 + 240 240 240 240 240 240 87 60 210 240 240 240 240 240 240 240 + 240 240 240 240 240 240 58 58 178 240 240 240 240 240 240 240 + 240 240 240 240 240 240 73 31 130 240 240 240 240 240 240 219 + 240 240 240 240 240 185 46 59 86 228 240 240 240 240 240 240 + 240 240 240 240 240 118 62 168 41 186 240 240 240 240 240 231 + 240 240 240 240 240 90 65 225 60 92 235 240 240 240 240 219 + 240 240 240 225 53 82 225 240 146 63 163 240 240 240 240 228 + 240 240 198 61 5 103 235 240 234 102 58 175 232 240 240 240 + 240 134 54 13 91 226 240 240 240 229 96 68 188 238 239 222 + 90 15 3 150 240 240 240 240 240 240 213 105 48 134 204 213 + 156 14 195 233 236 240 237 240 239 239 240 192 106 57 125 238 + + 192 236 240 237 234 240 240 219 240 231 217 226 240 216 200 237 + 181 240 240 240 240 240 240 240 240 240 240 240 240 238 192 120 + 192 240 240 240 240 240 240 240 240 240 240 240 240 226 117 53 + 198 240 240 240 240 240 240 240 240 240 240 240 228 170 30 93 + 192 240 240 240 240 240 240 240 240 240 240 240 174 64 95 186 + 181 240 240 240 240 240 240 240 240 240 230 158 58 93 204 240 + 227 240 240 240 240 240 240 240 228 185 80 62 104 229 240 239 + 214 240 220 240 240 207 177 130 78 36 67 156 240 240 240 238 + 204 232 128 53 31 49 54 31 57 157 225 240 240 240 240 240 + 216 225 75 106 118 74 53 64 37 62 65 225 235 240 240 236 + 240 240 240 240 238 240 240 240 180 118 82 76 111 227 240 240 + 214 240 240 240 240 240 240 240 240 240 240 53 9 92 240 235 + 225 240 240 240 240 240 240 240 240 240 240 225 61 26 156 233 + 240 240 240 240 240 240 240 240 240 240 240 240 199 64 12 195 + 225 240 240 240 240 240 240 240 240 240 240 240 240 142 26 16 + 214 240 240 240 240 240 240 240 240 240 240 240 240 240 90 156 + 194 238 240 237 234 240 240 222 240 234 222 228 240 222 213 238 + 185 240 240 240 240 240 240 240 240 240 240 240 240 239 204 125 + 192 240 240 240 240 240 240 240 240 240 240 240 240 233 133 57 + 198 240 240 240 240 240 240 240 240 240 240 240 228 178 46 106 + 192 240 240 240 240 240 240 240 240 240 240 240 174 74 109 192 + 181 240 240 240 240 240 240 240 240 240 240 162 49 96 213 240 + 226 240 240 240 240 240 240 240 230 192 82 63 91 228 240 240 + 212 240 225 240 240 207 177 130 86 45 74 158 234 240 240 239 + 204 232 138 59 31 47 49 41 49 165 222 240 240 240 240 240 + 216 227 95 108 118 83 56 73 46 58 63 225 235 240 240 237 + 240 240 240 240 238 240 240 240 185 118 91 86 103 226 240 240 + 212 240 240 240 240 240 240 240 240 240 240 66 11 91 240 236 + 225 240 240 240 240 240 240 240 240 240 240 226 76 16 150 234 + 240 240 240 240 240 240 240 240 240 240 240 240 202 68 4 195 + 226 240 240 240 240 240 240 240 240 240 240 240 240 142 26 14 + 214 240 240 240 240 240 240 240 240 240 240 240 240 240 90 156 + 192 236 240 237 234 240 240 219 240 231 219 228 240 222 213 238 + 184 240 240 240 240 240 240 240 240 240 240 240 240 239 204 125 + 192 240 240 240 240 240 240 240 240 240 240 240 240 238 134 57 + 198 240 240 240 240 240 240 240 240 240 240 240 232 188 48 106 + 192 240 240 240 240 240 240 240 240 240 240 240 175 68 105 192 + 181 240 240 240 240 240 240 240 240 240 235 163 58 96 213 240 + 227 240 240 240 240 240 240 240 228 186 92 63 102 229 240 239 + 214 240 220 240 240 210 178 130 86 41 60 146 234 240 240 239 + 204 232 134 58 32 60 58 31 59 168 225 240 240 240 240 240 + 216 226 85 107 118 87 58 73 46 62 65 225 235 240 240 237 + 240 240 240 240 238 240 240 240 185 118 90 82 103 226 240 240 + 212 240 240 240 240 240 240 240 240 240 240 53 5 91 240 236 + 225 240 240 240 240 240 240 240 240 240 240 225 61 13 150 233 + 240 240 240 240 240 240 240 240 240 240 240 240 198 54 3 195 + 226 240 240 240 240 240 240 240 240 240 240 240 240 134 15 14 + 214 240 240 240 240 240 240 240 240 240 240 240 240 240 90 156 + + 237 120 53 93 186 240 239 238 240 236 240 235 233 195 16 156 + 200 192 117 30 95 204 240 240 240 240 240 240 156 12 26 90 + 216 238 226 170 64 93 229 240 240 240 227 92 26 64 142 240 + 240 240 240 228 174 58 104 240 240 235 111 9 61 199 240 240 + 226 240 240 240 240 158 62 156 240 225 76 53 225 240 240 240 + 217 240 240 240 240 230 80 67 225 65 82 240 240 240 240 240 + 231 240 240 240 240 240 185 36 157 62 118 240 240 240 240 240 + 240 240 240 240 240 240 228 78 57 37 180 240 240 240 240 240 + 219 240 240 240 240 240 240 130 31 64 240 240 240 240 240 240 + 240 240 240 240 240 240 240 177 54 53 240 240 240 240 240 240 + 240 240 240 240 240 240 240 207 49 74 240 240 240 240 240 240 + 234 240 240 240 240 240 240 240 31 118 238 240 240 240 240 240 + 237 240 240 240 240 240 240 240 53 106 240 240 240 240 240 240 + 240 240 240 240 240 240 240 220 128 75 240 240 240 240 240 240 + 236 240 240 240 240 240 240 240 232 225 240 240 240 240 240 240 + 192 181 192 198 192 181 227 214 204 216 240 214 225 240 225 214 + 238 125 57 106 192 240 240 239 240 237 240 236 234 195 14 156 + 213 204 133 46 109 213 240 240 240 240 240 240 150 4 26 90 + 222 239 233 178 74 96 228 240 240 240 226 91 16 68 142 240 + 240 240 240 228 174 49 91 234 240 235 103 11 76 202 240 240 + 228 240 240 240 240 162 63 158 240 225 86 66 226 240 240 240 + 222 240 240 240 240 240 82 74 222 63 91 240 240 240 240 240 + 234 240 240 240 240 240 192 45 165 58 118 240 240 240 240 240 + 240 240 240 240 240 240 230 86 49 46 185 240 240 240 240 240 + 222 240 240 240 240 240 240 130 41 73 240 240 240 240 240 240 + 240 240 240 240 240 240 240 177 49 56 240 240 240 240 240 240 + 240 240 240 240 240 240 240 207 47 83 240 240 240 240 240 240 + 234 240 240 240 240 240 240 240 31 118 238 240 240 240 240 240 + 237 240 240 240 240 240 240 240 59 108 240 240 240 240 240 240 + 240 240 240 240 240 240 240 225 138 95 240 240 240 240 240 240 + 238 240 240 240 240 240 240 240 232 227 240 240 240 240 240 240 + 194 185 192 198 192 181 226 212 204 216 240 212 225 240 226 214 + 238 125 57 106 192 240 239 239 240 237 240 236 233 195 14 156 + 213 204 134 48 105 213 240 240 240 240 240 240 150 3 15 90 + 222 239 238 188 68 96 229 240 240 240 226 91 13 54 134 240 + 240 240 240 232 175 58 102 234 240 235 103 5 61 198 240 240 + 228 240 240 240 240 163 63 146 240 225 82 53 225 240 240 240 + 219 240 240 240 240 235 92 60 225 65 90 240 240 240 240 240 + 231 240 240 240 240 240 186 41 168 62 118 240 240 240 240 240 + 240 240 240 240 240 240 228 86 59 46 185 240 240 240 240 240 + 219 240 240 240 240 240 240 130 31 73 240 240 240 240 240 240 + 240 240 240 240 240 240 240 178 58 58 240 240 240 240 240 240 + 240 240 240 240 240 240 240 210 60 87 240 240 240 240 240 240 + 234 240 240 240 240 240 240 240 32 118 238 240 240 240 240 240 + 237 240 240 240 240 240 240 240 58 107 240 240 240 240 240 240 + 240 240 240 240 240 240 240 220 134 85 240 240 240 240 240 240 + 236 240 240 240 240 240 240 240 232 226 240 240 240 240 240 240 + 192 184 192 198 192 181 227 214 204 216 240 212 225 240 226 214 + + 156 90 240 240 240 240 240 240 240 240 240 240 240 240 240 214 + 16 26 142 240 240 240 240 240 240 240 240 240 240 240 240 225 + 195 12 64 199 240 240 240 240 240 240 240 240 240 240 240 240 + 233 156 26 61 225 240 240 240 240 240 240 240 240 240 240 225 + 235 240 92 9 53 240 240 240 240 240 240 240 240 240 240 214 + 240 240 227 111 76 82 118 180 240 240 240 238 240 240 240 240 + 236 240 240 235 225 65 62 37 64 53 74 118 106 75 225 216 + 240 240 240 240 240 225 157 57 31 54 49 31 53 128 232 204 + 238 240 240 240 156 67 36 78 130 177 207 240 240 220 240 214 + 239 240 229 104 62 80 185 228 240 240 240 240 240 240 240 227 + 240 204 93 58 158 230 240 240 240 240 240 240 240 240 240 181 + 186 95 64 174 240 240 240 240 240 240 240 240 240 240 240 192 + 93 30 170 228 240 240 240 240 240 240 240 240 240 240 240 198 + 53 117 226 240 240 240 240 240 240 240 240 240 240 240 240 192 + 120 192 238 240 240 240 240 240 240 240 240 240 240 240 240 181 + 237 200 216 240 226 217 231 240 219 240 240 234 237 240 236 192 + 156 90 240 240 240 240 240 240 240 240 240 240 240 240 240 214 + 14 26 142 240 240 240 240 240 240 240 240 240 240 240 240 226 + 195 4 68 202 240 240 240 240 240 240 240 240 240 240 240 240 + 234 150 16 76 226 240 240 240 240 240 240 240 240 240 240 225 + 236 240 91 11 66 240 240 240 240 240 240 240 240 240 240 212 + 240 240 226 103 86 91 118 185 240 240 240 238 240 240 240 240 + 237 240 240 235 225 63 58 46 73 56 83 118 108 95 227 216 + 240 240 240 240 240 222 165 49 41 49 47 31 59 138 232 204 + 239 240 240 234 158 74 45 86 130 177 207 240 240 225 240 212 + 240 240 228 91 63 82 192 230 240 240 240 240 240 240 240 226 + 240 213 96 49 162 240 240 240 240 240 240 240 240 240 240 181 + 192 109 74 174 240 240 240 240 240 240 240 240 240 240 240 192 + 106 46 178 228 240 240 240 240 240 240 240 240 240 240 240 198 + 57 133 233 240 240 240 240 240 240 240 240 240 240 240 240 192 + 125 204 239 240 240 240 240 240 240 240 240 240 240 240 240 185 + 238 213 222 240 228 222 234 240 222 240 240 234 237 240 238 194 + 156 90 240 240 240 240 240 240 240 240 240 240 240 240 240 214 + 14 15 134 240 240 240 240 240 240 240 240 240 240 240 240 226 + 195 3 54 198 240 240 240 240 240 240 240 240 240 240 240 240 + 233 150 13 61 225 240 240 240 240 240 240 240 240 240 240 225 + 236 240 91 5 53 240 240 240 240 240 240 240 240 240 240 212 + 240 240 226 103 82 90 118 185 240 240 240 238 240 240 240 240 + 237 240 240 235 225 65 62 46 73 58 87 118 107 85 226 216 + 240 240 240 240 240 225 168 59 31 58 60 32 58 134 232 204 + 239 240 240 234 146 60 41 86 130 178 210 240 240 220 240 214 + 239 240 229 102 63 92 186 228 240 240 240 240 240 240 240 227 + 240 213 96 58 163 235 240 240 240 240 240 240 240 240 240 181 + 192 105 68 175 240 240 240 240 240 240 240 240 240 240 240 192 + 106 48 188 232 240 240 240 240 240 240 240 240 240 240 240 198 + 57 134 238 240 240 240 240 240 240 240 240 240 240 240 240 192 + 125 204 239 240 240 240 240 240 240 240 240 240 240 240 240 184 + 238 213 222 240 228 219 231 240 219 240 240 234 237 240 236 192 + diff --git a/jsartoolkit5/examples/Data/video.mp4 b/jsartoolkit5/examples/Data/video.mp4 new file mode 100644 index 0000000..ce28718 Binary files /dev/null and b/jsartoolkit5/examples/Data/video.mp4 differ diff --git a/jsartoolkit5/examples/DataNFT/pinball.fset b/jsartoolkit5/examples/DataNFT/pinball.fset new file mode 100644 index 0000000..586f7bf Binary files /dev/null and b/jsartoolkit5/examples/DataNFT/pinball.fset differ diff --git a/jsartoolkit5/examples/DataNFT/pinball.fset3 b/jsartoolkit5/examples/DataNFT/pinball.fset3 new file mode 100644 index 0000000..0291b4a Binary files /dev/null and b/jsartoolkit5/examples/DataNFT/pinball.fset3 differ diff --git a/jsartoolkit5/examples/DataNFT/pinball.iset b/jsartoolkit5/examples/DataNFT/pinball.iset new file mode 100644 index 0000000..5d22898 Binary files /dev/null and b/jsartoolkit5/examples/DataNFT/pinball.iset differ diff --git a/jsartoolkit5/examples/DataNFT/pinball.jpg b/jsartoolkit5/examples/DataNFT/pinball.jpg new file mode 100644 index 0000000..d1444ad Binary files /dev/null and b/jsartoolkit5/examples/DataNFT/pinball.jpg differ diff --git a/jsartoolkit5/examples/babylonjs_from_scratch.html b/jsartoolkit5/examples/babylonjs_from_scratch.html new file mode 100644 index 0000000..e621770 --- /dev/null +++ b/jsartoolkit5/examples/babylonjs_from_scratch.html @@ -0,0 +1,113 @@ + + + + + + + + + + + + + diff --git a/jsartoolkit5/examples/barcode_threejs.html b/jsartoolkit5/examples/barcode_threejs.html new file mode 100644 index 0000000..2c40507 --- /dev/null +++ b/jsartoolkit5/examples/barcode_threejs.html @@ -0,0 +1,108 @@ + + +Barcode marker example with Three.js + + + + + +

    " + + "Count
    " + + "Total meshes: " + scene.meshes.length + "
    " + + "Total lights: " + scene.lights.length + "
    " + + "Total vertices: " + scene.getTotalVertices() + "
    " + + "Total materials: " + scene.materials.length + "
    " + + "Total textures: " + scene.textures.length + "
    " + + "Active meshes: " + scene.getActiveMeshes().length + "
    " + + "Active indices: " + scene.getActiveIndices() + "
    " + + "Active bones: " + scene.getActiveBones() + "
    " + + "Active particles: " + scene.getActiveParticles() + "
    " + + "Draw calls: " + engine.drawCalls + "

    " + + "Duration
    " + + "Meshes selection:
    " + BABYLON.Tools.Format(scene.getEvaluateActiveMeshesDuration()) + " ms
    " + + "Render Targets: " + BABYLON.Tools.Format(scene.getRenderTargetsDuration()) + " ms
    " + + "Particles: " + BABYLON.Tools.Format(scene.getParticlesDuration()) + " ms
    " + + "Sprites: " + BABYLON.Tools.Format(scene.getSpritesDuration()) + " ms

    " + + "Render: " + BABYLON.Tools.Format(scene.getRenderDuration()) + " ms
    " + + "Frame: " + BABYLON.Tools.Format(scene.getLastFrameDuration()) + " ms
    " + + "Potential FPS: " + BABYLON.Tools.Format(1000.0 / scene.getLastFrameDuration(), 0) + "
    " + + "Resolution: " + engine.getRenderWidth() + "x" + engine.getRenderHeight() + "

    " + + "